[U-Boot] [PATCH 0/4] Add USB support to orion5x and edminiv2

This patch set adds USB support to the LaCie ED Mini V2 by renaming the 'kirkwood' USB driver a 'marvell' USB driver, sharing it between the orion5x SoC family and enabling it for the edminiv2 board.
(this is similar to what was done with the 'mvgbe' driver in commits 9b6bcdcb to ab9164d0)
Albert ARIBAUD (4): Rename ehci-kirkwood as ehci-marvell Remove kirkwood-specifics from marvell EHCI driver orion5x: add USB host ehci-marvell support edminiv2: add USB host support
arch/arm/include/asm/arch-kirkwood/config.h | 2 +- arch/arm/include/asm/arch-kirkwood/kirkwood.h | 12 ++++++ arch/arm/include/asm/arch-orion5x/orion5x.h | 12 ++++++ drivers/usb/host/Makefile | 2 +- .../usb/host/{ehci-kirkwood.c => ehci-marvell.c} | 36 ++++++++++++-------- include/configs/edminiv2.h | 14 ++++++++ 6 files changed, 62 insertions(+), 16 deletions(-) rename drivers/usb/host/{ehci-kirkwood.c => ehci-marvell.c} (73%)

Signed-off-by: Albert ARIBAUD albert.u.boot@aribaud.net --- arch/arm/include/asm/arch-kirkwood/config.h | 2 +- drivers/usb/host/Makefile | 2 +- .../usb/host/{ehci-kirkwood.c => ehci-marvell.c} | 0 3 files changed, 2 insertions(+), 2 deletions(-) rename drivers/usb/host/{ehci-kirkwood.c => ehci-marvell.c} (100%)
diff --git a/arch/arm/include/asm/arch-kirkwood/config.h b/arch/arm/include/asm/arch-kirkwood/config.h index d1c1998..91164eb 100644 --- a/arch/arm/include/asm/arch-kirkwood/config.h +++ b/arch/arm/include/asm/arch-kirkwood/config.h @@ -104,7 +104,7 @@ * USB/EHCI */ #ifdef CONFIG_CMD_USB -#define CONFIG_USB_EHCI_KIRKWOOD +#define CONFIG_USB_EHCI_MARVELL #define CONFIG_EHCI_IS_TDI #endif /* CONFIG_CMD_USB */
diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile index 77e217f..7ba36ca 100644 --- a/drivers/usb/host/Makefile +++ b/drivers/usb/host/Makefile @@ -45,7 +45,7 @@ COBJS-$(CONFIG_USB_EHCI_MXS) += ehci-mxs.o COBJS-$(CONFIG_USB_EHCI_MX5) += ehci-mx5.o COBJS-$(CONFIG_USB_EHCI_PPC4XX) += ehci-ppc4xx.o COBJS-$(CONFIG_USB_EHCI_IXP4XX) += ehci-ixp.o -COBJS-$(CONFIG_USB_EHCI_KIRKWOOD) += ehci-kirkwood.o +COBJS-$(CONFIG_USB_EHCI_MARVELL) += ehci-marvell.o COBJS-$(CONFIG_USB_EHCI_PCI) += ehci-pci.o COBJS-$(CONFIG_USB_EHCI_VCT) += ehci-vct.o
diff --git a/drivers/usb/host/ehci-kirkwood.c b/drivers/usb/host/ehci-marvell.c similarity index 100% rename from drivers/usb/host/ehci-kirkwood.c rename to drivers/usb/host/ehci-marvell.c

Signed-off-by: Albert ARIBAUD albert.u.boot@aribaud.net --- arch/arm/include/asm/arch-kirkwood/kirkwood.h | 12 +++++++++ drivers/usb/host/ehci-marvell.c | 31 +++++++++++++----------- 2 files changed, 29 insertions(+), 14 deletions(-)
diff --git a/arch/arm/include/asm/arch-kirkwood/kirkwood.h b/arch/arm/include/asm/arch-kirkwood/kirkwood.h index 0035ed5..47771d5 100644 --- a/arch/arm/include/asm/arch-kirkwood/kirkwood.h +++ b/arch/arm/include/asm/arch-kirkwood/kirkwood.h @@ -65,6 +65,18 @@ #define MVGBE0_BASE KW_EGIGA0_BASE #define MVGBE1_BASE KW_EGIGA1_BASE
+/* Kirkwood USB Host controller */ +#define MVUSB0_BASE KW_USB20_BASE +#define MVUSB0_CPU_ATTR_DRAM_CS0 KWCPU_ATTR_DRAM_CS0 +#define MVUSB0_CPU_ATTR_DRAM_CS1 KWCPU_ATTR_DRAM_CS1 +#define MVUSB0_CPU_ATTR_DRAM_CS2 KWCPU_ATTR_DRAM_CS2 +#define MVUSB0_CPU_ATTR_DRAM_CS3 KWCPU_ATTR_DRAM_CS3 + +/* Kirkwood CPU memory windows */ +#define MVCPU_WIN_CTRL_DATA KWCPU_WIN_CTRL_DATA +#define MVCPU_WIN_ENABLE KWCPU_WIN_ENABLE +#define MVCPU_WIN_DISABLE KWCPU_WIN_DISABLE + #if defined (CONFIG_KW88F6281) #include <asm/arch/kw88f6281.h> #elif defined (CONFIG_KW88F6192) diff --git a/drivers/usb/host/ehci-marvell.c b/drivers/usb/host/ehci-marvell.c index 6300587..e342d78 100644 --- a/drivers/usb/host/ehci-marvell.c +++ b/drivers/usb/host/ehci-marvell.c @@ -30,8 +30,10 @@ #include <asm/arch/cpu.h> #include <asm/arch/kirkwood.h>
-#define rdl(off) readl(KW_USB20_BASE + (off)) -#define wrl(off, val) writel((val), KW_USB20_BASE + (off)) +DECLARE_GLOBAL_DATA_PTR; + +#define rdl(off) readl(MVUSB0_BASE + (off)) +#define wrl(off, val) writel((val), MVUSB0_BASE + (off))
#define USB_WINDOW_CTRL(i) (0x320 + ((i) << 4)) #define USB_WINDOW_BASE(i) (0x324 + ((i) << 4)) @@ -43,23 +45,23 @@ static void usb_brg_adrdec_setup(void) { int i; - u32 size, attrib; + u32 size, base, attrib;
for (i = 0; i < CONFIG_NR_DRAM_BANKS; i++) {
/* Enable DRAM bank */ switch (i) { case 0: - attrib = KWCPU_ATTR_DRAM_CS0; + attrib = MVUSB0_CPU_ATTR_DRAM_CS0; break; case 1: - attrib = KWCPU_ATTR_DRAM_CS1; + attrib = MVUSB0_CPU_ATTR_DRAM_CS1; break; case 2: - attrib = KWCPU_ATTR_DRAM_CS2; + attrib = MVUSB0_CPU_ATTR_DRAM_CS2; break; case 3: - attrib = KWCPU_ATTR_DRAM_CS3; + attrib = MVUSB0_CPU_ATTR_DRAM_CS3; break; default: /* invalide bank, disable access */ @@ -67,15 +69,16 @@ static void usb_brg_adrdec_setup(void) break; }
- size = kw_sdram_bs(i); + size = gd->bd->bi_dram[i].size; + base = gd->bd->bi_dram[i].start; if ((size) && (attrib)) wrl(USB_WINDOW_CTRL(i), - KWCPU_WIN_CTRL_DATA(size, USB_TARGET_DRAM, - attrib, KWCPU_WIN_ENABLE)); + MVCPU_WIN_CTRL_DATA(size, USB_TARGET_DRAM, + attrib, MVCPU_WIN_ENABLE)); else - wrl(USB_WINDOW_CTRL(i), KWCPU_WIN_DISABLE); + wrl(USB_WINDOW_CTRL(i), MVCPU_WIN_DISABLE);
- wrl(USB_WINDOW_BASE(i), kw_sdram_bar(i)); + wrl(USB_WINDOW_BASE(i), base); } }
@@ -87,11 +90,11 @@ int ehci_hcd_init(void) { usb_brg_adrdec_setup();
- hccr = (struct ehci_hccr *)(KW_USB20_BASE + 0x100); + hccr = (struct ehci_hccr *)(MVUSB0_BASE + 0x100); hcor = (struct ehci_hcor *)((uint32_t) hccr + HC_LENGTH(ehci_readl(&hccr->cr_capbase)));
- debug("Kirkwood-ehci: init hccr %x and hcor %x hc_length %d\n", + debug("ehci-marvell: init hccr %x and hcor %x hc_length %d\n", (uint32_t)hccr, (uint32_t)hcor, (uint32_t)HC_LENGTH(ehci_readl(&hccr->cr_capbase)));

Signed-off-by: Albert ARIBAUD albert.u.boot@aribaud.net --- arch/arm/include/asm/arch-orion5x/orion5x.h | 12 ++++++++++++ drivers/usb/host/ehci-marvell.c | 5 +++++ 2 files changed, 17 insertions(+), 0 deletions(-)
diff --git a/arch/arm/include/asm/arch-orion5x/orion5x.h b/arch/arm/include/asm/arch-orion5x/orion5x.h index 18225b9..b0d3368 100644 --- a/arch/arm/include/asm/arch-orion5x/orion5x.h +++ b/arch/arm/include/asm/arch-orion5x/orion5x.h @@ -58,6 +58,18 @@ #define MAX_MVGBE_DEVS 1 #define MVGBE0_BASE ORION5X_EGIGA_BASE
+/* Orion5x USB Host controller is port 1 */ +#define MVUSB0_BASE ORION5X_USB20_HOST_PORT_BASE +#define MVUSB0_CPU_ATTR_DRAM_CS0 ORION5X_ATTR_DRAM_CS0 +#define MVUSB0_CPU_ATTR_DRAM_CS1 ORION5X_ATTR_DRAM_CS1 +#define MVUSB0_CPU_ATTR_DRAM_CS2 ORION5X_ATTR_DRAM_CS2 +#define MVUSB0_CPU_ATTR_DRAM_CS3 ORION5X_ATTR_DRAM_CS3 + +/* Kirkwood CPU memory windows */ +#define MVCPU_WIN_CTRL_DATA ORION5X_CPU_WIN_CTRL_DATA +#define MVCPU_WIN_ENABLE ORION5X_WIN_ENABLE +#define MVCPU_WIN_DISABLE ORION5X_WIN_DISABLE + #define CONFIG_MAX_RAM_BANK_SIZE (64*1024*1024)
/* include here SoC variants. 5181, 5281, 6183 should go here when diff --git a/drivers/usb/host/ehci-marvell.c b/drivers/usb/host/ehci-marvell.c index e342d78..89c8af7 100644 --- a/drivers/usb/host/ehci-marvell.c +++ b/drivers/usb/host/ehci-marvell.c @@ -28,7 +28,12 @@ #include "ehci.h" #include "ehci-core.h" #include <asm/arch/cpu.h> + +#if defined(CONFIG_KIRKWOOD) #include <asm/arch/kirkwood.h> +#elif defined(CONFIG_ORION5X) +#include <asm/arch/orion5x.h> +#endif
DECLARE_GLOBAL_DATA_PTR;

Signed-off-by: Albert ARIBAUD albert.u.boot@aribaud.net --- include/configs/edminiv2.h | 14 ++++++++++++++ 1 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/include/configs/edminiv2.h b/include/configs/edminiv2.h index 88d32b2..4162e8d 100644 --- a/include/configs/edminiv2.h +++ b/include/configs/edminiv2.h @@ -134,6 +134,7 @@ #include <config_cmd_default.h> #define CONFIG_CMD_IDE #define CONFIG_CMD_I2C +#define CONFIG_CMD_USB
/* * Network @@ -183,6 +184,19 @@ #endif /* CMD_IDE */
/* + * Common USB/EHCI configuration + */ +#ifdef CONFIG_CMD_USB +#define CONFIG_USB_EHCI /* Enable EHCI USB support */ +#define CONFIG_USB_EHCI_MARVELL +#define ORION5X_USB20_HOST_PORT_BASE ORION5X_USB20_PORT0_BASE +#define CONFIG_USB_STORAGE +#define CONFIG_DOS_PARTITION +#define CONFIG_ISO_PARTITION +#define CONFIG_SUPPORT_VFAT +#endif /* CONFIG_CMD_USB */ + +/* * I2C related stuff */ #ifdef CONFIG_CMD_I2C

-----Original Message----- From: u-boot-bounces@lists.denx.de [mailto:u-boot- bounces@lists.denx.de] On Behalf Of Albert ARIBAUD Sent: 16 January 2012 13:39 To: u-boot@lists.denx.de Subject: [U-Boot] [PATCH 0/4] Add USB support to orion5x and edminiv2
This patch set adds USB support to the LaCie ED Mini V2 by renaming the 'kirkwood' USB driver a 'marvell' USB driver, sharing it between the orion5x SoC family and enabling it for the edminiv2 board.
(this is similar to what was done with the 'mvgbe' driver in commits 9b6bcdcb to ab9164d0)
Hi Albert This is patch series tested on both the platforms- Kirkwood, Orion for this change?
Otherwise, Acked-by: Prafulla Wadaskar Prafulla@marvell.com
Regards.. Prafulla . ..

Hi Prafulla,
Le 16/01/2012 09:20, Prafulla Wadaskar a écrit :
-----Original Message----- From: u-boot-bounces@lists.denx.de [mailto:u-boot- bounces@lists.denx.de] On Behalf Of Albert ARIBAUD Sent: 16 January 2012 13:39 To: u-boot@lists.denx.de Subject: [U-Boot] [PATCH 0/4] Add USB support to orion5x and edminiv2
This patch set adds USB support to the LaCie ED Mini V2 by renaming the 'kirkwood' USB driver a 'marvell' USB driver, sharing it between the orion5x SoC family and enabling it for the edminiv2 board.
(this is similar to what was done with the 'mvgbe' driver in commits 9b6bcdcb to ab9164d0)
Hi Albert This is patch series tested on both the platforms- Kirkwood, Orion for this change?
Otherwise, Acked-by: Prafulla WadaskarPrafulla@marvell.com
Regards.. Prafulla . ..
For kirkwood the code is just a bunch of renames with no functional impact, but I did test the patch set on kirkwood for build-time and run-time regressions while developing it.
However, since then I have rebased it a couple of times, and my openrd-client is currently not available for testing again. Could you possibly test it?
Amicalement,

-----Original Message----- From: Albert ARIBAUD [mailto:albert.u.boot@aribaud.net] Sent: 16 January 2012 14:00 To: Prafulla Wadaskar Cc: u-boot@lists.denx.de Subject: Re: [U-Boot] [PATCH 0/4] Add USB support to orion5x and edminiv2
Hi Prafulla,
Le 16/01/2012 09:20, Prafulla Wadaskar a écrit :
-----Original Message----- From: u-boot-bounces@lists.denx.de [mailto:u-boot- bounces@lists.denx.de] On Behalf Of Albert ARIBAUD Sent: 16 January 2012 13:39 To: u-boot@lists.denx.de Subject: [U-Boot] [PATCH 0/4] Add USB support to orion5x and
edminiv2
This patch set adds USB support to the LaCie ED Mini V2 by renaming the 'kirkwood' USB driver a 'marvell' USB driver, sharing it
between
the orion5x SoC family and enabling it for the edminiv2 board.
(this is similar to what was done with the 'mvgbe' driver in
commits
9b6bcdcb to ab9164d0)
Hi Albert This is patch series tested on both the platforms- Kirkwood, Orion
for this change?
Otherwise, Acked-by: Prafulla WadaskarPrafulla@marvell.com
Regards.. Prafulla . ..
For kirkwood the code is just a bunch of renames with no functional impact, but I did test the patch set on kirkwood for build-time and run-time regressions while developing it.
However, since then I have rebased it a couple of times, and my openrd-client is currently not available for testing again. Could you possibly test it?
Okay I will do it in next week is that okay with you?
Regards.. Prafulla . .
Amicalement,
Albert.

Hi Prafulla,
Le 16/01/2012 09:32, Prafulla Wadaskar a écrit :
-----Original Message----- From: Albert ARIBAUD [mailto:albert.u.boot@aribaud.net] Sent: 16 January 2012 14:00 To: Prafulla Wadaskar Cc: u-boot@lists.denx.de Subject: Re: [U-Boot] [PATCH 0/4] Add USB support to orion5x and edminiv2
Hi Prafulla,
Le 16/01/2012 09:20, Prafulla Wadaskar a écrit :
-----Original Message----- From: u-boot-bounces@lists.denx.de [mailto:u-boot- bounces@lists.denx.de] On Behalf Of Albert ARIBAUD Sent: 16 January 2012 13:39 To: u-boot@lists.denx.de Subject: [U-Boot] [PATCH 0/4] Add USB support to orion5x and
edminiv2
This patch set adds USB support to the LaCie ED Mini V2 by renaming the 'kirkwood' USB driver a 'marvell' USB driver, sharing it
between
the orion5x SoC family and enabling it for the edminiv2 board.
(this is similar to what was done with the 'mvgbe' driver in
commits
9b6bcdcb to ab9164d0)
Hi Albert This is patch series tested on both the platforms- Kirkwood, Orion
for this change?
Otherwise, Acked-by: Prafulla WadaskarPrafulla@marvell.com
Regards.. Prafulla . ..
For kirkwood the code is just a bunch of renames with no functional impact, but I did test the patch set on kirkwood for build-time and run-time regressions while developing it.
However, since then I have rebased it a couple of times, and my openrd-client is currently not available for testing again. Could you possibly test it?
Okay I will do it in next week is that okay with you?
Don't bother: I've been lent another open-rd and I could run the u-boot image through openocd during lunch break. I've just tested usb start, usb tree with a mass storage USB key plugged in, usb info, usb part) and all works fine.
Regards.. Prafulla . .
Amicalement,

-----Original Message----- From: u-boot-bounces@lists.denx.de [mailto:u-boot- bounces@lists.denx.de] On Behalf Of Albert ARIBAUD Sent: 16 January 2012 13:39 To: u-boot@lists.denx.de Subject: [U-Boot] [PATCH 0/4] Add USB support to orion5x and edminiv2
This patch set adds USB support to the LaCie ED Mini V2 by renaming the 'kirkwood' USB driver a 'marvell' USB driver, sharing it between the orion5x SoC family and enabling it for the edminiv2 board.
(this is similar to what was done with the 'mvgbe' driver in commits 9b6bcdcb to ab9164d0)
Albert ARIBAUD (4): Rename ehci-kirkwood as ehci-marvell Remove kirkwood-specifics from marvell EHCI driver orion5x: add USB host ehci-marvell support edminiv2: add USB host support
arch/arm/include/asm/arch-kirkwood/config.h | 2 +- arch/arm/include/asm/arch-kirkwood/kirkwood.h | 12 ++++++ arch/arm/include/asm/arch-orion5x/orion5x.h | 12 ++++++ drivers/usb/host/Makefile | 2 +- .../usb/host/{ehci-kirkwood.c => ehci-marvell.c} | 36 ++++++++++++-------- include/configs/edminiv2.h | 14 ++++++++ 6 files changed, 62 insertions(+), 16 deletions(-) rename drivers/usb/host/{ehci-kirkwood.c => ehci-marvell.c} (73%)
Applied this patch serried to u-boot-marvell.git master branch
Regards.. Prafulla . . .
participants (2)
-
Albert ARIBAUD
-
Prafulla Wadaskar