EHCI support for Panasonic UniPhier SoCs
Subsystems (4)
cover EHCI support for Panasonic UniPhier SoCs
This series includes both USB parts and Panasonic SoC-specific parts to resolve the patch dependency.
Marek,
please review at least 3/4 and issue your Ack if it is OK.
After it is Ack'ed, I will apply this series to my repo.
Masahiro Yamada (4):
usb: add basic USB configs in Kconfig
ARM: UniPhier: add MIO register file
usb: UniPhier: add UniPhier on-chip EHCI host driver support
ARM: UniPhier: enable USB features
arch/arm/cpu/armv7/uniphier/ph1-ld4/platdevice.c | 13 +++++ arch/arm/cpu/armv7/uniphier/ph1-pro4/platdevice.c | 10 ++++ arch/arm/cpu/armv7/uniphier/ph1-sld8/platdevice.c | 13 +++++ arch/arm/include/asm/arch-uniphier/ehci-uniphier.h | 33 +++++++++++++ arch/arm/include/asm/arch-uniphier/mio-regs.h | 20 ++++++++ arch/arm/include/asm/arch-uniphier/platdevice.h | 2 + configs/ph1_ld4_defconfig | 3 ++ configs/ph1_pro4_defconfig | 3 ++ configs/ph1_sld8_defconfig | 3 ++ drivers/usb/Kconfig | 46 ++++++++++++++++++ drivers/usb/host/Kconfig | 56 ++++++++++++++++++++++ drivers/usb/host/Makefile | 1 + drivers/usb/host/ehci-uniphier.c | 39 +++++++++++++++ include/configs/uniphier-common.h | 7 +++ 14 files changed, 249 insertions(+) create mode 100644 arch/arm/include/asm/arch-uniphier/ehci-uniphier.h create mode 100644 arch/arm/include/asm/arch-uniphier/mio-regs.h create mode 100644 drivers/usb/host/Kconfig create mode 100644 drivers/usb/host/ehci-uniphier.c
Signature · 1 line
1.9.1
PATCH 1/4 usb: add basic USB configs in Kconfig
---
drivers/usb/Kconfig | 46 ++++++++++++++++++++++++++++++++++++++++++++++ drivers/usb/host/Kconfig | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 94 insertions(+) create mode 100644 drivers/usb/host/Kconfig
drivers/usb/Kconfig +46 -0
@@ -0,0 +1,46 @@ +config USB_ARCH_HAS_HCD + def_bool y + +config USB + bool "Support for Host-side USB" + depends on USB_ARCH_HAS_HCD + ---help--- + Universal Serial Bus (USB) is a specification for a serial bus + subsystem which offers higher speeds and more features than the + traditional PC serial port. The bus supplies power to peripherals + and allows for hot swapping. Up to 127 USB peripherals can be + connected to a single USB host in a tree structure. + + The USB host is the root of the tree, the peripherals are the + leaves and the inner nodes are special USB devices called hubs. + Most PCs now have USB host ports, used to connect peripherals + such as scanners, keyboards, mice, modems, cameras, disks, + flash memory, network links, and printers to the PC. + + Say Y here if your computer has a host-side USB port and you want + to use USB devices. You then need to say Y to at least one of the + Host Controller Driver (HCD) options below. Choose a USB 1.1 + controller, such as "UHCI HCD support" or "OHCI HCD support", + and "EHCI HCD (USB 2.0) support" except for older systems that + do not have USB 2.0 support. It doesn't normally hurt to select + them all if you are not certain. + + If your system has a device-side USB port, used in the peripheral + side of the USB protocol, see the "USB Gadget" framework instead. + + After choosing your HCD, then select drivers for the USB peripherals + you'll be using. You may want to check out the information provided + in <file:Documentation/usb/> and especially the links given in + <file:Documentation/usb/usb-help.txt>. + +if USB + +source "drivers/usb/host/Kconfig" + +config USB_STORAGE + bool "USB Mass Storage support" + ---help--- + Say Y here if you want to connect USB mass storage devices to your + board's USB port. + +endif
drivers/usb/host/Kconfig new file +48 -0
48 lines not on this page · raw message
Signature · 1 line
1.9.1
PATCH 2/4 ARM: UniPhier: add MIO register file
In reply to Masahiro YamadaThis commit adds register defines of MIO (Media I/O) block of UniPhier platform. This file is necessary to control the reset signals of the USB cores.
---
arch/arm/include/asm/arch-uniphier/mio-regs.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 arch/arm/include/asm/arch-uniphier/mio-regs.h
arch/arm/include/asm/arch-uniphier/mio-regs.h new file +20 -0
@@ -0,0 +1,20 @@ +/* +* UniPhier MIO (Media I/O) registers +* +* Copyright (C) 2014 Panasonic Corporation +* +* SPDX-License-Identifier: GPL-2.0+ +*/ + +#ifndef ARCH_MIO_REGS_H +#define ARCH_MIO_REGS_H + +#define MIO_BASE 0x59810000 + +#define MIO_CLKCTRL (i) (MIO_BASE + 0x200 * (i) + 0x0020) +#define MIO_RSTCTRL (i) (MIO_BASE + 0x200 * (i) + 0x0110) +#define MIO_USB_RSTCTRL (i) (MIO_BASE + 0x200 * (i) + 0x0114) + +#define MIO_USB_RSTCTRL_XRST (0x1 << 0) + +#endif /* ARCH_MIO_REGS_H */
Signature · 1 line
1.9.1
PATCH 3/4 usb: UniPhier: add UniPhier on-chip EHCI host driver support
In reply to Masahiro YamadaSupport EHCI host driver used on Panasonic UniPhier platform. Since Device Tree is not supported on UniPhier yet, the base address of USB cores are passed from board files (platdevice.c).
TODO for me:
Move the base address to device trees.
---
arch/arm/cpu/armv7/uniphier/ph1-ld4/platdevice.c | 13 ++++++++ arch/arm/cpu/armv7/uniphier/ph1-pro4/platdevice.c | 10 ++++++ arch/arm/cpu/armv7/uniphier/ph1-sld8/platdevice.c | 13 ++++++++ arch/arm/include/asm/arch-uniphier/ehci-uniphier.h | 33 ++++++++++++++++++ arch/arm/include/asm/arch-uniphier/platdevice.h | 2 ++ drivers/usb/host/Kconfig | 8 +++++ drivers/usb/host/Makefile | 1 + drivers/usb/host/ehci-uniphier.c | 39 ++++++++++++++++++++++ 8 files changed, 119 insertions(+) create mode 100644 arch/arm/include/asm/arch-uniphier/ehci-uniphier.h create mode 100644 drivers/usb/host/ehci-uniphier.c
arch/arm/cpu/armv7/uniphier/ph1-ld4/platdevice.c +13 -0
@@ -13,3 +13,16 @@ SERIAL_DEVICE(0, 0x54006800, UART_MASTER_CLK) SERIAL_DEVICE(1, 0x54006900, UART_MASTER_CLK) SERIAL_DEVICE(2, 0x54006a00, UART_MASTER_CLK)SERIAL_DEVICE (3 ,0x54006b00 ,UART_MASTER_CLK ) + +/* USB : TODO for Masahiro Yamada: move base address to Device Tree */ +struct uniphier_ehci_platform_data uniphier_ehci_platdata[] = { + { + .base =0x5a800100 , + }, + { + .base =0x5a810100 , + }, + { + .base =0x5a820100 , + }, +};
arch/arm/cpu/armv7/uniphier/ph1-pro4/platdevice.c +10 -0
@@ -13,3 +13,13 @@ SERIAL_DEVICE(0, 0x54006800, UART_MASTER_CLK) SERIAL_DEVICE(1, 0x54006900, UART_MASTER_CLK) SERIAL_DEVICE(2, 0x54006a00, UART_MASTER_CLK)SERIAL_DEVICE (3 ,0x54006b00 ,UART_MASTER_CLK ) + +/* USB : TODO for Masahiro Yamada: move base address to Device Tree */ +struct uniphier_ehci_platform_data uniphier_ehci_platdata[] = { + { + .base =0x5a800100 , + }, + { + .base =0x5a810100 , + }, +};
arch/arm/cpu/armv7/uniphier/ph1-sld8/platdevice.c +13 -0
@@ -13,3 +13,16 @@ SERIAL_DEVICE(0, 0x54006800, UART_MASTER_CLK) SERIAL_DEVICE(1, 0x54006900, UART_MASTER_CLK) SERIAL_DEVICE(2, 0x54006a00, UART_MASTER_CLK)SERIAL_DEVICE (3 ,0x54006b00 ,UART_MASTER_CLK ) + +/* USB : TODO for Masahiro Yamada: move base address to Device Tree */ +struct uniphier_ehci_platform_data uniphier_ehci_platdata[] = { + { + .base =0x5a800100 , + }, + { + .base =0x5a810100 , + }, + { + .base =0x5a820100 , + }, +};
arch/arm/include/asm/arch-uniphier/ehci-uniphier.h new file +33 -0
@@ -0,0 +1,33 @@ +/* +* Copyright (C) 2014 Panasonic Corporation +* Author: Masahiro Yamada <[email protected]> +* +* SPDX-License-Identifier: GPL-2.0+ +*/ + +#ifndef __PLAT_UNIPHIER_EHCI_H +#define __PLAT_UNIPHIER_EHCI_H + +#include <linux/types.h> +#include <asm/io.h> +#include "mio-regs.h" + +struct uniphier_ehci_platform_data { +unsigned long base; +}; + +extern struct uniphier_ehci_platform_data uniphier_ehci_platdata[]; + +static inline void uniphier_ehci_reset (int index,int on) +{ +u32 tmp; + + tmp =readl (MIO_USB_RSTCTRL (index)); +if (on) + tmp &= ~MIO_USB_RSTCTRL_XRST ; +else + tmp |=MIO_USB_RSTCTRL_XRST ; +writel (tmp,MIO_USB_RSTCTRL (index)); +} + +#endif /* __PLAT_UNIPHIER_EHCI_H */
arch/arm/include/asm/arch-uniphier/platdevice.h +2 -0
@@ -21,4 +21,6 @@ U_BOOT_DEVICE(serial##n) = { \ .platdata = &serial_device##n \ }; +#include <asm/arch/ehci-uniphier.h> +#endif /* ARCH_PLATDEVICE_H */
drivers/usb/host/Kconfig +8 -0
@@ -45,4 +45,12 @@ config USB_EHCI if USB_EHCI_HCD +config USB_EHCI_UNIPHIER + bool "Support for Panasonic UniPhier on-chip EHCI USB controller" + depends on ARCH_UNIPHIER + default y + ---help--- + Enables support for the on-chip EHCI controller on Panasonic + UniPhier SoCs. + endif
drivers/usb/host/Makefile +1 -0
@@ -37,6 +37,7 @@ obj-$(CONFIG_USB_EHCI_PCI) += ehci-pci.o obj-$(CONFIG_USB_EHCI_SPEAR) += ehci-spear.o obj-$(CONFIG_USB_EHCI_SUNXI) += ehci-sunxi.o obj-$(CONFIG_USB_EHCI_TEGRA) += ehci-tegra.o +obj-$(CONFIG_USB_EHCI_UNIPHIER) += ehci-uniphier.o obj-$(CONFIG_USB_EHCI_VCT) += ehci-vct.o obj-$(CONFIG_USB_EHCI_RMOBILE) += ehci-rmobile.o obj-$(CONFIG_USB_EHCI_ZYNQ) += ehci-zynq.o
drivers/usb/host/ehci-uniphier.c new file +39 -0
@@ -0,0 +1,39 @@ +/* +* Copyright (C) 2014 Panasonic Corporation +* Author: Masahiro Yamada <[email protected]> +* +* SPDX-License-Identifier: GPL-2.0+ +*/ + +#include <common.h> +#include <usb.h> +#include <asm/arch/ehci-uniphier.h> +#include "ehci.h" + +/* +* Create the appropriate control structures to manage +* a new EHCI host controller. +*/ +int ehci_hcd_init (int index,enum usb_init_type init,struct ehci_hccr **hccr, +struct ehci_hcor **hcor) +{ +struct ehci_hccr *cr; +struct ehci_hcor *or; + +uniphier_ehci_reset (index,0 ); + + cr = (struct ehci_hccr *)(uniphier_ehci_platdata[index].base); + or = (void *)cr +HC_LENGTH (ehci_readl (&cr->cr_capbase)); + + *hccr = cr; + *hcor = or; + +return 0 ; +} + +int ehci_hcd_stop (int index) +{ +uniphier_ehci_reset (index,1 ); + +return 0 ; +}
Signature · 1 line
1.9.1
PATCH 4/4 ARM: UniPhier: enable USB features
In reply to Masahiro YamadaFAT-formated USB storage device access is available.
---
configs/ph1_ld4_defconfig | 3 +++ configs/ph1_pro4_defconfig | 3 +++ configs/ph1_sld8_defconfig | 3 +++ include/configs/uniphier-common.h | 7 +++++++ 4 files changed, 16 insertions(+)
configs/ph1_ld4_defconfig +3 -0
@@ -8,4 +8,7 @@ CONFIG_SYS_NAND_DENALI_64BIT=y CONFIG_NAND_DENALI_SPARE_AREA_SKIP_BYTES=8 CONFIG_DM_SERIAL=y CONFIG_UNIPHIER_SERIAL=y +CONFIG_USB=y +CONFIG_USB_EHCI_HCD=y +CONFIG_USB_STORAGE=y S:CONFIG_SPL_NAND_DENALI=y
configs/ph1_pro4_defconfig +3 -0
@@ -8,4 +8,7 @@ CONFIG_SYS_NAND_DENALI_64BIT=y CONFIG_NAND_DENALI_SPARE_AREA_SKIP_BYTES=8 CONFIG_DM_SERIAL=y CONFIG_UNIPHIER_SERIAL=y +CONFIG_USB=y +CONFIG_USB_EHCI_HCD=y +CONFIG_USB_STORAGE=y S:CONFIG_SPL_NAND_DENALI=y
configs/ph1_sld8_defconfig +3 -0
@@ -8,4 +8,7 @@ CONFIG_SYS_NAND_DENALI_64BIT=y CONFIG_NAND_DENALI_SPARE_AREA_SKIP_BYTES=8 CONFIG_DM_SERIAL=y CONFIG_UNIPHIER_SERIAL=y +CONFIG_USB=y +CONFIG_USB_EHCI_HCD=y +CONFIG_USB_STORAGE=y S:CONFIG_SPL_NAND_DENALI=y
include/configs/uniphier-common.h +7 -0
@@ -166,6 +166,13 @@ are defined. Select only one of them."#define CONFIG_SYS_NAND_USE_FLASH_BBT #define CONFIG_SYS_NAND_BAD_BLOCK_POS 0 +/* USB */ +#define CONFIG_CMD_USB +#define CONFIG_USB_MAX_CONTROLLER_COUNT 2 +#define CONFIG_CMD_FAT +#define CONFIG_FAT_WRITE +#define CONFIG_DOS_PARTITION +/* memtest works on */ #define CONFIG_SYS_MEMTEST_START CONFIG_SYS_SDRAM_BASE#define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_SDRAM_BASE + 0x01000000)
Signature · 1 line
1.9.1
cover EHCI support for Panasonic UniPhier SoCs
In reply to Masahiro YamadaQuoted 5 lines · Masahiro Yamada
This series includes both USB parts and Panasonic SoC-specific parts to resolve the patch dependency.
Marek,
please review at least 3/4 and issue your Ack if it is OK.
For the whole series:
Do you want to pick this yourself or shall I pick it via u-boot-usb ?
Best regards,
Marek Vasut
cover EHCI support for Panasonic UniPhier SoCs
Hi Marek,
Quoted 4 lines · On Fri, 7 Nov 2014 11:45:48 +0100 Marek Vasut <[email protected]> wrote:
Quoted 3 lines · Masahiro Yamada
This series includes both USB parts and Panasonic SoC-specific parts to resolve the patch dependency.
Quoted 8 lines
Quoted 2 lines
Marek,
please review at least 3/4 and issue your Ack if it is OK.For the whole series:
Acked-by Marek Vasut <[email protected]>Do you want to pick this yourself or shall I pick it via u-boot-usb ?
Thank you for your quick review!
I am planning to apply this series along with some other uniphier patches and send a pull request to Tom.
Best Regards
Masahiro Yamada
cover EHCI support for Panasonic UniPhier SoCs
Quoted 1 line · Masahiro Yamada
Hi Marek,
Hi!
Quoted 13 lines
On Fri, 7 Nov 2014 11:45:48 +0100
Quoted 10 lines · Marek Vasut
Quoted 5 lines · Masahiro Yamada
This series includes both USB parts and Panasonic SoC-specific parts to resolve the patch dependency.
Marek,
please review at least 3/4 and issue your Ack if it is OK.For the whole series:
Acked-by Marek Vasut <[email protected]>
Quoted 6 lines
Quoted 1 line
Do you want to pick this yourself or shall I pick it via u-boot-usb ?
Thank you for your quick review!
I am planning to apply this series along with some other uniphier patches and send a pull request to Tom.
Please do.
Thank you!
Best regards,
Marek Vasut
cover EHCI support for Panasonic UniPhier SoCs
In reply to Masahiro Yamada2014-11-07 18:48 GMT+09:00 Masahiro Yamada <[email protected]>:
Quoted 11 lines
This series includes both USB parts and Panasonic SoC-specific parts to resolve the patch dependency.
Marek,
please review at least 3/4 and issue your Ack if it is OK.After it is Ack'ed, I will apply this series to my repo.
Quoted 6 lines
Masahiro Yamada (4):
usb: add basic USB configs inKconfig
ARM: UniPhier: add MIO register file
usb: UniPhier: add UniPhier on-chip EHCI host driver support
ARM: UniPhier: enable USB features
Series, applied to u-boot-uniphier/master.
Signature · 2 lines
Best Regards Masahiro Yamada