diff options
author | Simon Glass <sjg@chromium.org> | 2011-06-13 10:58:13 -0700 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2011-08-29 10:39:24 -0700 |
commit | 01d1f9a370e1917b772023a2501acebc72ee6ab5 (patch) | |
tree | 3061e9d759ebd93ef99e3276b13c93f26ea75001 /arch/arm | |
parent | f8081a7f4eceb454b55d387d7689933acd9f68c5 (diff) |
tegra2: Run-time assignment of USB port numbers
USB ports relied on CONFIG_TEGRA2_USBx macros to select the ordering.
This change records the order that the ports are configured and uses
that to select ports by number. This properly honors CONFIG_TEGRA2_USBx
when not using an FDT.
Also removed direct access to the USB peripheral address from the Tegra2
EHCI driver.
BUG=chromium-os:11623
TEST=usb start; run usb_boot
Change-Id: Ib906ec4483bcd95ff9564411f44dc0a2e48fff8c
Reviewed-on: http://gerrit.chromium.org/gerrit/2537
Tested-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Anton Staaf <robotboy@chromium.org>
Reviewed-by: Tom Warren <twarren@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/include/asm/arch-tegra2/usb.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/arch/arm/include/asm/arch-tegra2/usb.h b/arch/arm/include/asm/arch-tegra2/usb.h index 2e3bf752ca7..bbbe3c70dd4 100644 --- a/arch/arm/include/asm/arch-tegra2/usb.h +++ b/arch/arm/include/asm/arch-tegra2/usb.h @@ -214,4 +214,23 @@ void usb_set_host_mode(void); /* Setup USB on the board */ int board_usb_init(const void *blob); +/** + * Start up the given port number (ports are numbered from 0 on each board). + * This returns values for the appropriate hccr and hcor addresses to use for + * USB EHCI operations. + * + * @param portnum port number to start + * @param hccr returns start address of EHCI HCCR registers + * @param hcor returns start address of EHCI HCOR registers + * @return 0 if ok, -1 on error (generally invalid port number) + */ +int tegrausb_start_port(unsigned portnum, u32 *hccr, u32 *hcor); + +/** + * Stop the current port + * + * @return 0 if ok, -1 if no port was active + */ +int tegrausb_stop_port(void); + #endif /* _TEGRA_USB_H_ */ |