mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-21 03:33:59 +08:00
0dfeada909
- ehci-orion dt binding - gpio-poweroff - use dt regulators - move mpp to DT/pinctrl Depends on: - orion/boards - merge conflicts - keep all 'select's in Kconfig - remove all #includes in board-*.c - pinctrl/devel up to: -06763c7
pinctrl: mvebu: move to its own directory -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (GNU/Linux) iQEcBAABAgAGBQJQsEfdAAoJEAi3KVZQDZAeBd8IAIAkBGIJyUJSmQJEWkZ/9ezq UOLec1t/TnLhAQ1Sk8g4C41wmHKYNqmZSVaAXC+QP6Yw+Gdhlw+V6YBjOYDzA7Y4 k8ljw3SFbvS+AIx0qK26j6Tf6En2H5lMXsdlKoarCV+G+MxAHsQO7jL6y7BFwTlX QnwJFz+NRzMFxaPiCS+43oZuxIIzkHe8wKMb0y7nSiNQYUUv8TdKvyK+ekFuszOp v6uo/MI1p1/xdUxDbEKxOwmUjAy7x+t0LUFi1dsWuiDHdrG+BVT4NkJuFaD8Ui13 VoUD1ogyWHQZV2hq0dfj+9Hed5NEgl6toAzGN9LPLmsuVUXCnB2CdBprhuDv5F8= =yaX1 -----END PGP SIGNATURE----- Merge tag 'orion_dt_for_3.8' of git://git.infradead.org/users/jcooper/linux into next/dt From Jason Cooper: orion dt for v3.8 - ehci-orion dt binding - gpio-poweroff - use dt regulators - move mpp to DT/pinctrl Depends on: - orion/boards - merge conflicts - keep all 'select's in Kconfig - remove all #includes in board-*.c - pinctrl/devel up to: -06763c7
pinctrl: mvebu: move to its own directory * tag 'orion_dt_for_3.8' of git://git.infradead.org/users/jcooper/linux: (211 commits) ARM: Kirkwood: remove kirkwood_ehci_init() from new boards ARM: Kirkwood: Add support LED of OpenBlocks A6 ARM: Kirkwood: Convert to EHCI via DT for OpenBlocks A6 ARM: kirkwood: Add NAND partiton map for OpenBlocks A6 ARM: kirkwood: Add support second I2C bus and RTC on OpenBlocks A6 ARM: kirkwood: Add support DT of second I2C bus ARM: kirkwood: Convert mplcec4 board to pinctrl ARM: Kirkwood: Convert km_kirkwood to pinctrl ARM: Kirkwood: support 98DX412x kirkwoods with pinctrl ARM: Kirkwood: Convert IX2-200 to pinctrl. ARM: Kirkwood: Convert lsxl boards to pinctrl. ARM: Kirkwood: Convert ib62x0 to pinctrl. ARM: Kirkwood: Convert GoFlex Net to pinctrl. ARM: Kirkwood: Convert dreamplug to pinctrl. ARM: Kirkwood: Convert dockstar to pinctrl. ARM: Kirkwood: Convert dnskw to pinctrl ARM: Kirkwood: Convert iConnect to pinctrl. ARM: Kirkwood: Convert TS219 to pinctrl. ARM: Kirkwood: Add DTSI files for pinctrl ARM: Kirkwood: Make use of mvebu pincltl and gpio drivers ... Signed-off-by: Olof Johansson <olof@lixom.net>
99 lines
2.7 KiB
C
99 lines
2.7 KiB
C
/*
|
|
* Copyright (c) 2009 Daniel Mack <daniel@caiaq.de>
|
|
* Copyright (C) 2010 Freescale Semiconductor, Inc.
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify it
|
|
* under the terms of the GNU General Public License as published by the
|
|
* Free Software Foundation; either version 2 of the License, or (at your
|
|
* option) any later version.
|
|
*
|
|
* This program is distributed in the hope that it will be useful, but
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
|
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
* for more details.
|
|
*/
|
|
|
|
#include <linux/platform_device.h>
|
|
#include <linux/io.h>
|
|
#include <linux/platform_data/usb-ehci-mxc.h>
|
|
|
|
#include "hardware.h"
|
|
|
|
#define USBCTRL_OTGBASE_OFFSET 0x600
|
|
|
|
#define MX25_OTG_SIC_SHIFT 29
|
|
#define MX25_OTG_SIC_MASK (0x3 << MX25_OTG_SIC_SHIFT)
|
|
#define MX25_OTG_PM_BIT (1 << 24)
|
|
#define MX25_OTG_PP_BIT (1 << 11)
|
|
#define MX25_OTG_OCPOL_BIT (1 << 3)
|
|
|
|
#define MX25_H1_SIC_SHIFT 21
|
|
#define MX25_H1_SIC_MASK (0x3 << MX25_H1_SIC_SHIFT)
|
|
#define MX25_H1_PP_BIT (1 << 18)
|
|
#define MX25_H1_PM_BIT (1 << 16)
|
|
#define MX25_H1_IPPUE_UP_BIT (1 << 7)
|
|
#define MX25_H1_IPPUE_DOWN_BIT (1 << 6)
|
|
#define MX25_H1_TLL_BIT (1 << 5)
|
|
#define MX25_H1_USBTE_BIT (1 << 4)
|
|
#define MX25_H1_OCPOL_BIT (1 << 2)
|
|
|
|
int mx25_initialize_usb_hw(int port, unsigned int flags)
|
|
{
|
|
unsigned int v;
|
|
|
|
v = readl(MX25_IO_ADDRESS(MX25_USB_BASE_ADDR + USBCTRL_OTGBASE_OFFSET));
|
|
|
|
switch (port) {
|
|
case 0: /* OTG port */
|
|
v &= ~(MX25_OTG_SIC_MASK | MX25_OTG_PM_BIT | MX25_OTG_PP_BIT |
|
|
MX25_OTG_OCPOL_BIT);
|
|
v |= (flags & MXC_EHCI_INTERFACE_MASK) << MX25_OTG_SIC_SHIFT;
|
|
|
|
if (!(flags & MXC_EHCI_POWER_PINS_ENABLED))
|
|
v |= MX25_OTG_PM_BIT;
|
|
|
|
if (flags & MXC_EHCI_PWR_PIN_ACTIVE_HIGH)
|
|
v |= MX25_OTG_PP_BIT;
|
|
|
|
if (!(flags & MXC_EHCI_OC_PIN_ACTIVE_LOW))
|
|
v |= MX25_OTG_OCPOL_BIT;
|
|
|
|
break;
|
|
case 1: /* H1 port */
|
|
v &= ~(MX25_H1_SIC_MASK | MX25_H1_PM_BIT | MX25_H1_PP_BIT |
|
|
MX25_H1_OCPOL_BIT | MX25_H1_TLL_BIT | MX25_H1_USBTE_BIT |
|
|
MX25_H1_IPPUE_DOWN_BIT | MX25_H1_IPPUE_UP_BIT);
|
|
v |= (flags & MXC_EHCI_INTERFACE_MASK) << MX25_H1_SIC_SHIFT;
|
|
|
|
if (!(flags & MXC_EHCI_POWER_PINS_ENABLED))
|
|
v |= MX25_H1_PM_BIT;
|
|
|
|
if (flags & MXC_EHCI_PWR_PIN_ACTIVE_HIGH)
|
|
v |= MX25_H1_PP_BIT;
|
|
|
|
if (!(flags & MXC_EHCI_OC_PIN_ACTIVE_LOW))
|
|
v |= MX25_H1_OCPOL_BIT;
|
|
|
|
if (!(flags & MXC_EHCI_TTL_ENABLED))
|
|
v |= MX25_H1_TLL_BIT;
|
|
|
|
if (flags & MXC_EHCI_INTERNAL_PHY)
|
|
v |= MX25_H1_USBTE_BIT;
|
|
|
|
if (flags & MXC_EHCI_IPPUE_DOWN)
|
|
v |= MX25_H1_IPPUE_DOWN_BIT;
|
|
|
|
if (flags & MXC_EHCI_IPPUE_UP)
|
|
v |= MX25_H1_IPPUE_UP_BIT;
|
|
|
|
break;
|
|
default:
|
|
return -EINVAL;
|
|
}
|
|
|
|
writel(v, MX25_IO_ADDRESS(MX25_USB_BASE_ADDR + USBCTRL_OTGBASE_OFFSET));
|
|
|
|
return 0;
|
|
}
|
|
|