* [U-Boot] [PATCH 0/5] mx5: USB host support for mx51evk and mx53loco
@ 2011-11-11 13:03 Wolfgang Grandegger
2011-11-11 13:03 ` [U-Boot] [PATCH 1/5] mx5: add helper functions to enable USB clocks Wolfgang Grandegger
` (6 more replies)
0 siblings, 7 replies; 16+ messages in thread
From: Wolfgang Grandegger @ 2011-11-11 13:03 UTC (permalink / raw)
To: u-boot
This patches series provides USB host support for the mx51evk and
mx53loco. The generic ehci-mx5 interface is derived from ehci-mxc
and uses the header files of the ehci-fsl interface. The callback
board_ehci_hcd_init() allows to do board-specific setup when USB is
started.
Wolfgang.
Wolfgang Grandegger (5):
mx5: add helper functions to enable USB clocks
mx5: add helper function to retrieve the GPIO number
mx5: add generic USB EHCI support for mx51 and mx53
mx53loco: add end enable USB host support on port 1
mx51evk: add end enable USB host support on port 1
arch/arm/cpu/armv7/mx5/clock.c | 72 ++++++++++++
arch/arm/include/asm/arch-mx5/clock.h | 5 +
arch/arm/include/asm/arch-mx5/crm_regs.h | 3 +
arch/arm/include/asm/arch-mx5/mx5x_pins.h | 4 +
board/freescale/mx51evk/mx51evk.c | 92 +++++++++++++++
board/freescale/mx53loco/mx53loco.c | 10 ++
drivers/usb/host/Makefile | 1 +
drivers/usb/host/ehci-mx5.c | 174 +++++++++++++++++++++++++++++
include/configs/mx51evk.h | 13 ++
include/configs/mx53loco.h | 13 ++
include/usb/ehci-fsl.h | 10 ++
11 files changed, 397 insertions(+), 0 deletions(-)
create mode 100644 drivers/usb/host/ehci-mx5.c
--
1.7.4.1
^ permalink raw reply [flat|nested] 16+ messages in thread
* [U-Boot] [PATCH 1/5] mx5: add helper functions to enable USB clocks
2011-11-11 13:03 [U-Boot] [PATCH 0/5] mx5: USB host support for mx51evk and mx53loco Wolfgang Grandegger
@ 2011-11-11 13:03 ` Wolfgang Grandegger
2011-11-11 13:03 ` [U-Boot] [PATCH 2/5] mx5: add helper function to retrieve the GPIO number Wolfgang Grandegger
` (5 subsequent siblings)
6 siblings, 0 replies; 16+ messages in thread
From: Wolfgang Grandegger @ 2011-11-11 13:03 UTC (permalink / raw)
To: u-boot
Signed-off-by: Wolfgang Grandegger <wg@denx.de>
CC: Stefano Babic <sbabic@denx.de>
---
arch/arm/cpu/armv7/mx5/clock.c | 72 ++++++++++++++++++++++++++++++
arch/arm/include/asm/arch-mx5/clock.h | 5 ++
arch/arm/include/asm/arch-mx5/crm_regs.h | 3 +
3 files changed, 80 insertions(+), 0 deletions(-)
diff --git a/arch/arm/cpu/armv7/mx5/clock.c b/arch/arm/cpu/armv7/mx5/clock.c
index 0769a64..c8dad17 100644
--- a/arch/arm/cpu/armv7/mx5/clock.c
+++ b/arch/arm/cpu/armv7/mx5/clock.c
@@ -50,6 +50,78 @@ struct mxc_pll_reg *mxc_plls[PLL_CLOCKS] = {
struct mxc_ccm_reg *mxc_ccm = (struct mxc_ccm_reg *)MXC_CCM_BASE;
+void set_usboh3_clk(void)
+{
+ unsigned int reg;
+
+ reg = readl(&mxc_ccm->cscmr1) &
+ ~MXC_CCM_CSCMR1_USBOH3_CLK_SEL_MASK;
+ reg |= 1 << MXC_CCM_CSCMR1_USBOH3_CLK_SEL_OFFSET;
+ writel(reg, &mxc_ccm->cscmr1);
+
+ reg = readl(&mxc_ccm->cscdr1);
+ reg &= ~MXC_CCM_CSCDR1_USBOH3_CLK_PODF_MASK;
+ reg &= ~MXC_CCM_CSCDR1_USBOH3_CLK_PRED_MASK;
+ reg |= 4 << MXC_CCM_CSCDR1_USBOH3_CLK_PRED_OFFSET;
+ reg |= 1 << MXC_CCM_CSCDR1_USBOH3_CLK_PODF_OFFSET;
+
+ writel(reg, &mxc_ccm->cscdr1);
+}
+
+void enable_usboh3_clk(unsigned char enable)
+{
+ unsigned int reg;
+
+ reg = readl(&mxc_ccm->CCGR2);
+ if (enable)
+ reg |= 1 << MXC_CCM_CCGR2_CG14_OFFSET;
+ else
+ reg &= ~(1 << MXC_CCM_CCGR2_CG14_OFFSET);
+ writel(reg, &mxc_ccm->CCGR2);
+}
+
+void set_usb_phy1_clk(void)
+{
+ unsigned int reg;
+
+ reg = readl(&mxc_ccm->cscmr1);
+ reg &= ~MXC_CCM_CSCMR1_USB_PHY_CLK_SEL;
+ writel(reg, &mxc_ccm->cscmr1);
+}
+
+void enable_usb_phy1_clk(unsigned char enable)
+{
+ unsigned int reg;
+
+ reg = readl(&mxc_ccm->CCGR4);
+ if (enable)
+ reg |= 1 << MXC_CCM_CCGR4_CG5_OFFSET;
+ else
+ reg &= ~(1 << MXC_CCM_CCGR4_CG5_OFFSET);
+ writel(reg, &mxc_ccm->CCGR4);
+}
+
+void set_usb_phy2_clk(void)
+{
+ unsigned int reg;
+
+ reg = readl(&mxc_ccm->cscmr1);
+ reg &= ~MXC_CCM_CSCMR1_USB_PHY_CLK_SEL;
+ writel(reg, &mxc_ccm->cscmr1);
+}
+
+void enable_usb_phy2_clk(unsigned char enable)
+{
+ unsigned int reg;
+
+ reg = readl(&mxc_ccm->CCGR4);
+ if (enable)
+ reg |= 1 << MXC_CCM_CCGR4_CG6_OFFSET;
+ else
+ reg &= ~(1 << MXC_CCM_CCGR4_CG6_OFFSET);
+ writel(reg, &mxc_ccm->CCGR4);
+}
+
/*
* Calculate the frequency of PLLn.
*/
diff --git a/arch/arm/include/asm/arch-mx5/clock.h b/arch/arm/include/asm/arch-mx5/clock.h
index 1f8a537..ea972a3 100644
--- a/arch/arm/include/asm/arch-mx5/clock.h
+++ b/arch/arm/include/asm/arch-mx5/clock.h
@@ -40,4 +40,9 @@ u32 imx_get_uartclk(void);
u32 imx_get_fecclk(void);
unsigned int mxc_get_clock(enum mxc_clock clk);
+void set_usb_phy2_clk(void);
+void enable_usb_phy2_clk(unsigned char enable);
+void set_usboh3_clk(void);
+void enable_usboh3_clk(unsigned char enable);
+
#endif /* __ASM_ARCH_CLOCK_H */
diff --git a/arch/arm/include/asm/arch-mx5/crm_regs.h b/arch/arm/include/asm/arch-mx5/crm_regs.h
index fcc0e36..7972147 100644
--- a/arch/arm/include/asm/arch-mx5/crm_regs.h
+++ b/arch/arm/include/asm/arch-mx5/crm_regs.h
@@ -195,7 +195,10 @@ struct mxc_ccm_reg {
/* Define the bits in register CCGRx */
#define MXC_CCM_CCGR_CG_MASK 0x3
+#define MXC_CCM_CCGR4_CG5_OFFSET 10
+#define MXC_CCM_CCGR4_CG6_OFFSET 12
#define MXC_CCM_CCGR5_CG5_OFFSET 10
+#define MXC_CCM_CCGR2_CG14_OFFSET 28
/* Define the bits in register CLPCR */
#define MXC_CCM_CLPCR_BYPASS_IPU_LPM_HS (0x1 << 18)
--
1.7.4.1
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [U-Boot] [PATCH 2/5] mx5: add helper function to retrieve the GPIO number
2011-11-11 13:03 [U-Boot] [PATCH 0/5] mx5: USB host support for mx51evk and mx53loco Wolfgang Grandegger
2011-11-11 13:03 ` [U-Boot] [PATCH 1/5] mx5: add helper functions to enable USB clocks Wolfgang Grandegger
@ 2011-11-11 13:03 ` Wolfgang Grandegger
2011-11-11 13:03 ` [U-Boot] [PATCH 3/5] mx5: add generic USB EHCI support for mx51 and mx53 Wolfgang Grandegger
` (4 subsequent siblings)
6 siblings, 0 replies; 16+ messages in thread
From: Wolfgang Grandegger @ 2011-11-11 13:03 UTC (permalink / raw)
To: u-boot
Signed-off-by: Wolfgang Grandegger <wg@denx.de>
CC: Stefano Babic <sbabic@denx.de>
---
arch/arm/include/asm/arch-mx5/mx5x_pins.h | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/arch/arm/include/asm/arch-mx5/mx5x_pins.h b/arch/arm/include/asm/arch-mx5/mx5x_pins.h
index 4e3a31b..3978bd5 100644
--- a/arch/arm/include/asm/arch-mx5/mx5x_pins.h
+++ b/arch/arm/include/asm/arch-mx5/mx5x_pins.h
@@ -25,6 +25,10 @@
#ifndef __ASSEMBLY__
+/* There's a off-by-one betweem the gpio bank number and the gpiochip */
+/* range e.g. GPIO_1_5 is gpio 5 under linux */
+#define IMX_GPIO_NR(bank, nr) (((bank) - 1) * 32 + (nr))
+
/*
* In order to identify pins more effectively, each mux-controlled pin's
* enumerated value is constructed in the following way:
--
1.7.4.1
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [U-Boot] [PATCH 3/5] mx5: add generic USB EHCI support for mx51 and mx53
2011-11-11 13:03 [U-Boot] [PATCH 0/5] mx5: USB host support for mx51evk and mx53loco Wolfgang Grandegger
2011-11-11 13:03 ` [U-Boot] [PATCH 1/5] mx5: add helper functions to enable USB clocks Wolfgang Grandegger
2011-11-11 13:03 ` [U-Boot] [PATCH 2/5] mx5: add helper function to retrieve the GPIO number Wolfgang Grandegger
@ 2011-11-11 13:03 ` Wolfgang Grandegger
2011-11-11 14:22 ` Fabio Estevam
2011-11-11 13:03 ` [U-Boot] [PATCH 4/5] mx53loco: add end enable USB host support on port 1 Wolfgang Grandegger
` (3 subsequent siblings)
6 siblings, 1 reply; 16+ messages in thread
From: Wolfgang Grandegger @ 2011-11-11 13:03 UTC (permalink / raw)
To: u-boot
It's derived from ehci-mxc and uses the header files of the
ehci-fsl interface. The callback board_ehci_hcd_init() has
been introduced to allow for board-specific setup when USB
is started.
Signed-off-by: Wolfgang Grandegger <wg@denx.de>
CC: Stefano Babic <sbabic@denx.de>
CC: Remy Bohmer <linux@bohmer.net>
---
drivers/usb/host/Makefile | 1 +
drivers/usb/host/ehci-mx5.c | 174 +++++++++++++++++++++++++++++++++++++++++++
include/usb/ehci-fsl.h | 10 +++
3 files changed, 185 insertions(+), 0 deletions(-)
create mode 100644 drivers/usb/host/ehci-mx5.c
diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile
index 51b2494..60632ba 100644
--- a/drivers/usb/host/Makefile
+++ b/drivers/usb/host/Makefile
@@ -41,6 +41,7 @@ else
COBJS-$(CONFIG_USB_EHCI_FSL) += ehci-fsl.o
endif
COBJS-$(CONFIG_USB_EHCI_MXC) += ehci-mxc.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
diff --git a/drivers/usb/host/ehci-mx5.c b/drivers/usb/host/ehci-mx5.c
new file mode 100644
index 0000000..5cb0344
--- /dev/null
+++ b/drivers/usb/host/ehci-mx5.c
@@ -0,0 +1,174 @@
+/*
+ * 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 <common.h>
+#include <usb.h>
+#include <errno.h>
+#include <linux/compiler.h>
+#include <usb/ehci-fsl.h>
+#include <asm/io.h>
+#include <asm/arch/imx-regs.h>
+#include <asm/arch/clock.h>
+#include <asm/arch/mx5x_pins.h>
+
+#include "ehci.h"
+#include "ehci-core.h"
+
+#define MX5_USBOTHER_REGS_OFFSET 0x800
+
+
+#define MXC_OTG_OFFSET 0
+#define MXC_H1_OFFSET 0x200
+#define MXC_H2_OFFSET 0x400
+
+#define MXC_USBCTRL_OFFSET 0
+#define MXC_USB_PHY_CTR_FUNC_OFFSET 0x8
+#define MXC_USB_PHY_CTR_FUNC2_OFFSET 0xc
+#define MXC_USB_CTRL_1_OFFSET 0x10
+#define MXC_USBH2CTRL_OFFSET 0x14
+
+/* USB_CTRL */
+#define MXC_OTG_UCTRL_OWIE_BIT (1 << 27) /* OTG wakeup intr enable */
+#define MXC_OTG_UCTRL_OPM_BIT (1 << 24) /* OTG power mask */
+#define MXC_H1_UCTRL_H1UIE_BIT (1 << 12) /* Host1 ULPI interrupt enable */
+#define MXC_H1_UCTRL_H1WIE_BIT (1 << 11) /* HOST1 wakeup intr enable */
+#define MXC_H1_UCTRL_H1PM_BIT (1 << 8) /* HOST1 power mask */
+
+/* USB_PHY_CTRL_FUNC */
+#define MXC_OTG_PHYCTRL_OC_DIS_BIT (1 << 8) /* OTG Disable Overcurrent Event */
+#define MXC_H1_OC_DIS_BIT (1 << 5) /* UH1 Disable Overcurrent Event */
+
+/* USBH2CTRL */
+#define MXC_H2_UCTRL_H2UIE_BIT (1 << 8)
+#define MXC_H2_UCTRL_H2WIE_BIT (1 << 7)
+#define MXC_H2_UCTRL_H2PM_BIT (1 << 4)
+
+/* USB_CTRL_1 */
+#define MXC_USB_CTRL_UH1_EXT_CLK_EN (1 << 25)
+
+int mxc_set_usbcontrol(int port, unsigned int flags)
+{
+ unsigned int v;
+ void __iomem *usb_base = (void __iomem *)OTG_BASE_ADDR;
+ void __iomem *usbother_base;
+ int ret = 0;
+
+ usbother_base = usb_base + MX5_USBOTHER_REGS_OFFSET;
+
+ switch (port) {
+ case 0: /* OTG port */
+ if (flags & MXC_EHCI_INTERNAL_PHY) {
+ v = __raw_readl(usbother_base +
+ MXC_USB_PHY_CTR_FUNC_OFFSET);
+ if (flags & MXC_EHCI_POWER_PINS_ENABLED)
+ /* OC/USBPWR is not used */
+ v |= MXC_OTG_PHYCTRL_OC_DIS_BIT;
+ else
+ /* OC/USBPWR is used */
+ v &= ~MXC_OTG_PHYCTRL_OC_DIS_BIT;
+ __raw_writel(v, usbother_base +
+ MXC_USB_PHY_CTR_FUNC_OFFSET);
+
+ v = __raw_readl(usbother_base + MXC_USBCTRL_OFFSET);
+ if (flags & MXC_EHCI_POWER_PINS_ENABLED)
+ v |= MXC_OTG_UCTRL_OPM_BIT;
+ else
+ v &= ~MXC_OTG_UCTRL_OPM_BIT;
+ __raw_writel(v, usbother_base + MXC_USBCTRL_OFFSET);
+ }
+ break;
+ case 1: /* Host 1 Host ULPI */
+#ifdef CONFIG_MX51
+ /* The clock for the USBH1 ULPI port will come externally
+ from the PHY. */
+ v = __raw_readl(usbother_base + MXC_USB_CTRL_1_OFFSET);
+ __raw_writel(v | MXC_USB_CTRL_UH1_EXT_CLK_EN, usbother_base +
+ MXC_USB_CTRL_1_OFFSET);
+#endif
+
+ v = __raw_readl(usbother_base + MXC_USBCTRL_OFFSET);
+ if (flags & MXC_EHCI_POWER_PINS_ENABLED)
+ v &= ~MXC_H1_UCTRL_H1PM_BIT; /* HOST1 power mask used */
+ else
+ v |= MXC_H1_UCTRL_H1PM_BIT; /* HOST1 power mask used */
+ __raw_writel(v, usbother_base + MXC_USBCTRL_OFFSET);
+
+ v = __raw_readl(usbother_base + MXC_USB_PHY_CTR_FUNC_OFFSET);
+ if (flags & MXC_EHCI_POWER_PINS_ENABLED)
+ v &= ~MXC_H1_OC_DIS_BIT; /* OC is used */
+ else
+ v |= MXC_H1_OC_DIS_BIT; /* OC is not used */
+ __raw_writel(v, usbother_base + MXC_USB_PHY_CTR_FUNC_OFFSET);
+
+ break;
+ case 2: /* Host 2 ULPI */
+ v = __raw_readl(usbother_base + MXC_USBH2CTRL_OFFSET);
+ if (flags & MXC_EHCI_POWER_PINS_ENABLED)
+ v &= ~MXC_H2_UCTRL_H2PM_BIT; /* HOST2 power mask used */
+ else
+ v |= MXC_H2_UCTRL_H2PM_BIT; /* HOST2 power mask used */
+
+ __raw_writel(v, usbother_base + MXC_USBH2CTRL_OFFSET);
+ break;
+ }
+
+ return ret;
+}
+
+int ehci_hcd_init(void)
+{
+ struct usb_ehci *ehci;
+#ifdef CONFIG_MX53
+ struct clkctl *sc_regs = (struct clkctl *)CCM_BASE_ADDR;
+ u32 reg;
+
+ reg = __raw_readl(&sc_regs->cscmr1) & ~(1 << 26);
+ /* derive USB PHY clock multiplexer from PLL3 */
+ reg |= 1 << 26;
+ __raw_writel(reg, &sc_regs->cscmr1);
+#endif
+
+ set_usboh3_clk();
+ enable_usboh3_clk(1);
+ set_usb_phy2_clk();
+ enable_usb_phy2_clk(1);
+ mdelay(1);
+
+ /* do board specific initialization */
+ board_ehci_hcd_init(CONFIG_MXC_USB_PORT);
+
+ ehci = (struct usb_ehci *)(OTG_BASE_ADDR +
+ (0x200 * CONFIG_MXC_USB_PORT));
+ hccr = (struct ehci_hccr *)((uint32_t)&ehci->caplength);
+ hcor = (struct ehci_hcor *)((uint32_t)hccr +
+ HC_LENGTH(ehci_readl(&hccr->cr_capbase)));
+ setbits_le32(&ehci->usbmode, CM_HOST);
+
+ __raw_writel(CONFIG_MXC_USB_PORTSC, &ehci->portsc);
+ setbits_le32(&ehci->portsc, USB_EN);
+
+ mxc_set_usbcontrol(CONFIG_MXC_USB_PORT, CONFIG_MXC_USB_FLAGS);
+
+ mdelay(10);
+
+ return 0;
+}
+
+int ehci_hcd_stop(void)
+{
+ return 0;
+}
+
+
diff --git a/include/usb/ehci-fsl.h b/include/usb/ehci-fsl.h
index 67600ed..26551c6 100644
--- a/include/usb/ehci-fsl.h
+++ b/include/usb/ehci-fsl.h
@@ -242,4 +242,14 @@ struct usb_ehci {
u8 res13[0xafc];
};
+/*
+ * For MXC SOCs
+ */
+#define MXC_EHCI_POWER_PINS_ENABLED (1 << 5)
+#define MXC_EHCI_TTL_ENABLED (1 << 6)
+#define MXC_EHCI_INTERNAL_PHY (1 << 7)
+
+/* Board-specific initialization */
+int board_ehci_hcd_init(int port);
+
#endif /* _EHCI_FSL_H */
--
1.7.4.1
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [U-Boot] [PATCH 4/5] mx53loco: add end enable USB host support on port 1
2011-11-11 13:03 [U-Boot] [PATCH 0/5] mx5: USB host support for mx51evk and mx53loco Wolfgang Grandegger
` (2 preceding siblings ...)
2011-11-11 13:03 ` [U-Boot] [PATCH 3/5] mx5: add generic USB EHCI support for mx51 and mx53 Wolfgang Grandegger
@ 2011-11-11 13:03 ` Wolfgang Grandegger
2011-11-16 7:22 ` Jason Liu
2011-11-24 3:01 ` Marek Vasut
2011-11-11 13:03 ` [U-Boot] [PATCH 5/5] mx51evk: " Wolfgang Grandegger
` (2 subsequent siblings)
6 siblings, 2 replies; 16+ messages in thread
From: Wolfgang Grandegger @ 2011-11-11 13:03 UTC (permalink / raw)
To: u-boot
Signed-off-by: Wolfgang Grandegger <wg@denx.de>
CC: Jason Liu <r64343@freescale.com>
---
board/freescale/mx53loco/mx53loco.c | 10 ++++++++++
include/configs/mx53loco.h | 13 +++++++++++++
2 files changed, 23 insertions(+), 0 deletions(-)
diff --git a/board/freescale/mx53loco/mx53loco.c b/board/freescale/mx53loco/mx53loco.c
index b4c7f33..7bccfa9 100644
--- a/board/freescale/mx53loco/mx53loco.c
+++ b/board/freescale/mx53loco/mx53loco.c
@@ -78,6 +78,16 @@ static void setup_iomux_uart(void)
PAD_CTL_ODE_OPENDRAIN_ENABLE);
}
+#ifdef CONFIG_USB_EHCI_MX5
+void board_ehci_hcd_init(int port)
+{
+ /* request VBUS power enable pin, GPIO[8}, gpio7 */
+ mxc_request_iomux(MX53_PIN_ATA_DA_2, IOMUX_CONFIG_ALT1);
+ gpio_direction_output(IMX_GPIO_NR(7, 8), 0);
+ gpio_set_value(IMX_GPIO_NR(7, 8), 1);
+}
+#endif
+
static void setup_iomux_fec(void)
{
/*FEC_MDIO*/
diff --git a/include/configs/mx53loco.h b/include/configs/mx53loco.h
index d699010..9ce43d7 100644
--- a/include/configs/mx53loco.h
+++ b/include/configs/mx53loco.h
@@ -72,6 +72,19 @@
#define CONFIG_CMD_MII
#define CONFIG_CMD_NET
+/* USB Configs */
+#define CONFIG_CMD_USB
+#define CONFIG_CMD_FAT
+#define CONFIG_USB_EHCI
+#define CONFIG_USB_EHCI_MX5
+#define CONFIG_USB_STORAGE
+#define CONFIG_USB_HOST_ETHER
+#define CONFIG_USB_ETHER_ASIX
+#define CONFIG_USB_ETHER_SMSC95XX
+#define CONFIG_MXC_USB_PORT 1
+#define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW)
+#define CONFIG_MXC_USB_FLAGS 0
+
/* allow to overwrite serial and ethaddr */
#define CONFIG_ENV_OVERWRITE
#define CONFIG_CONS_INDEX 1
--
1.7.4.1
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [U-Boot] [PATCH 5/5] mx51evk: add end enable USB host support on port 1
2011-11-11 13:03 [U-Boot] [PATCH 0/5] mx5: USB host support for mx51evk and mx53loco Wolfgang Grandegger
` (3 preceding siblings ...)
2011-11-11 13:03 ` [U-Boot] [PATCH 4/5] mx53loco: add end enable USB host support on port 1 Wolfgang Grandegger
@ 2011-11-11 13:03 ` Wolfgang Grandegger
2011-11-11 21:44 ` [U-Boot] [PATCH 0/5] mx5: USB host support for mx51evk and mx53loco Marek Vasut
2011-11-11 23:34 ` Jana Rapava
6 siblings, 0 replies; 16+ messages in thread
From: Wolfgang Grandegger @ 2011-11-11 13:03 UTC (permalink / raw)
To: u-boot
Signed-off-by: Wolfgang Grandegger <wg@denx.de>
CC: Stefano Babic <sbabic@denx.de>
---
board/freescale/mx51evk/mx51evk.c | 92 +++++++++++++++++++++++++++++++++++++
include/configs/mx51evk.h | 13 +++++
2 files changed, 105 insertions(+), 0 deletions(-)
diff --git a/board/freescale/mx51evk/mx51evk.c b/board/freescale/mx51evk/mx51evk.c
index 37e6e4d..12354b3 100644
--- a/board/freescale/mx51evk/mx51evk.c
+++ b/board/freescale/mx51evk/mx51evk.c
@@ -172,6 +172,95 @@ static void setup_iomux_spi(void)
}
#endif
+#ifdef CONFIG_USB_EHCI_MX5
+#define MX51EVK_USBH1_HUB_RST IMX_GPIO_NR(1, 7) /* GPIO_1_7 */
+#define MX51EVK_USBH1_STP IMX_GPIO_NR(1, 27) /* GPIO_1_27 */
+#define MX51EVK_USB_CLK_EN_B IMX_GPIO_NR(2, 1) /* GPIO_2_1 */
+#define MX51EVK_USB_PHY_RESET IMX_GPIO_NR(2, 5) /* GPIO_2_5 */
+
+#define USBH1_PAD (PAD_CTL_SRE_FAST | PAD_CTL_DRV_HIGH | \
+ PAD_CTL_100K_PU | PAD_CTL_PUE_PULL | \
+ PAD_CTL_PKE_ENABLE | PAD_CTL_HYS_ENABLE)
+#define GPIO_PAD (PAD_CTL_DRV_HIGH | PAD_CTL_PKE_ENABLE | \
+ PAD_CTL_SRE_FAST)
+#define NO_PAD (1 << 16)
+
+static void setup_usb_h1(void)
+{
+ mxc_request_iomux(MX51_PIN_USBH1_CLK, IOMUX_CONFIG_ALT0);
+ mxc_iomux_set_pad(MX51_PIN_USBH1_CLK, USBH1_PAD);
+
+ mxc_request_iomux(MX51_PIN_USBH1_DIR, IOMUX_CONFIG_ALT0);
+ mxc_iomux_set_pad(MX51_PIN_USBH1_DIR, USBH1_PAD);
+
+ mxc_request_iomux(MX51_PIN_USBH1_NXT, IOMUX_CONFIG_ALT0);
+ mxc_iomux_set_pad(MX51_PIN_USBH1_NXT, USBH1_PAD);
+
+ mxc_request_iomux(MX51_PIN_USBH1_DATA0, IOMUX_CONFIG_ALT0);
+ mxc_iomux_set_pad(MX51_PIN_USBH1_DATA0, USBH1_PAD);
+
+ mxc_request_iomux(MX51_PIN_USBH1_DATA1, IOMUX_CONFIG_ALT0);
+ mxc_iomux_set_pad(MX51_PIN_USBH1_DATA1, USBH1_PAD);
+
+ mxc_request_iomux(MX51_PIN_USBH1_DATA2, IOMUX_CONFIG_ALT0);
+ mxc_iomux_set_pad(MX51_PIN_USBH1_DATA2, USBH1_PAD);
+
+ mxc_request_iomux(MX51_PIN_USBH1_DATA3, IOMUX_CONFIG_ALT0);
+ mxc_iomux_set_pad(MX51_PIN_USBH1_DATA3, USBH1_PAD);
+
+ mxc_request_iomux(MX51_PIN_USBH1_DATA4, IOMUX_CONFIG_ALT0);
+ mxc_iomux_set_pad(MX51_PIN_USBH1_DATA4, USBH1_PAD);
+
+ mxc_request_iomux(MX51_PIN_USBH1_DATA5, IOMUX_CONFIG_ALT0);
+ mxc_iomux_set_pad(MX51_PIN_USBH1_DATA5, USBH1_PAD);
+
+ mxc_request_iomux(MX51_PIN_USBH1_DATA6, IOMUX_CONFIG_ALT0);
+ mxc_iomux_set_pad(MX51_PIN_USBH1_DATA6, USBH1_PAD);
+
+ mxc_request_iomux(MX51_PIN_USBH1_DATA7, IOMUX_CONFIG_ALT0);
+ mxc_iomux_set_pad(MX51_PIN_USBH1_DATA7, USBH1_PAD);
+
+ /* GPIO_1_7 for USBH1 hub reset */
+ mxc_request_iomux(MX51_PIN_GPIO1_7, IOMUX_CONFIG_ALT0);
+ mxc_iomux_set_pad(MX51_PIN_GPIO1_7, NO_PAD);
+
+ /* GPIO_2_1 */
+ mxc_request_iomux(MX51_PIN_EIM_D17, IOMUX_CONFIG_ALT1);
+ mxc_iomux_set_pad(MX51_PIN_EIM_D17, GPIO_PAD);
+
+ /* GPIO_2_5 for USB PHY reset */
+ mxc_request_iomux(MX51_PIN_EIM_D21, IOMUX_CONFIG_ALT1);
+ mxc_iomux_set_pad(MX51_PIN_EIM_D21, GPIO_PAD);
+}
+
+void board_ehci_hcd_init(int port)
+{
+ /* Set USBH1_STP to GPIO and toggle it */
+ mxc_request_iomux(MX51_PIN_USBH1_STP, IOMUX_CONFIG_GPIO);
+ mxc_iomux_set_pad(MX51_PIN_USBH1_STP, USBH1_PAD);
+
+ gpio_direction_output(MX51EVK_USBH1_STP, 0);
+ gpio_direction_output(MX51EVK_USB_PHY_RESET, 0);
+ mdelay(10);
+ gpio_set_value(MX51EVK_USBH1_STP, 1);
+
+ /* Set back USBH1_STP to be function */
+ mxc_request_iomux(MX51_PIN_USBH1_STP, IOMUX_CONFIG_ALT0);
+ mxc_iomux_set_pad(MX51_PIN_USBH1_STP, USBH1_PAD);
+
+ /* De-assert USB PHY RESETB */
+ gpio_set_value(MX51EVK_USB_PHY_RESET, 1);
+
+ /* Drive USB_CLK_EN_B line low */
+ gpio_direction_output(MX51EVK_USB_CLK_EN_B, 0);
+
+ /* Reset USB hub */
+ gpio_direction_output(MX51EVK_USBH1_HUB_RST, 0);
+ mdelay(2);
+ gpio_set_value(MX51EVK_USBH1_HUB_RST, 1);
+}
+#endif
+
static void power_init(void)
{
unsigned int val;
@@ -391,6 +480,9 @@ int board_early_init_f(void)
{
setup_iomux_uart();
setup_iomux_fec();
+#ifdef CONFIG_USB_EHCI_MX5
+ setup_usb_h1();
+#endif
return 0;
}
diff --git a/include/configs/mx51evk.h b/include/configs/mx51evk.h
index 7c7544f..18f1ebd 100644
--- a/include/configs/mx51evk.h
+++ b/include/configs/mx51evk.h
@@ -110,6 +110,19 @@
#define CONFIG_CMD_MII
#define CONFIG_CMD_NET
+/* USB Configs */
+#define CONFIG_CMD_USB
+#define CONFIG_CMD_FAT
+#define CONFIG_USB_EHCI
+#define CONFIG_USB_EHCI_MX5
+#define CONFIG_USB_STORAGE
+#define CONFIG_USB_HOST_ETHER
+#define CONFIG_USB_ETHER_ASIX
+#define CONFIG_USB_ETHER_SMSC95XX
+#define CONFIG_MXC_USB_PORT 1
+#define CONFIG_MXC_USB_PORTSC PORT_PTS_ULPI
+#define CONFIG_MXC_USB_FLAGS MXC_EHCI_POWER_PINS_ENABLED
+
/* allow to overwrite serial and ethaddr */
#define CONFIG_ENV_OVERWRITE
#define CONFIG_CONS_INDEX 1
--
1.7.4.1
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [U-Boot] [PATCH 3/5] mx5: add generic USB EHCI support for mx51 and mx53
2011-11-11 13:03 ` [U-Boot] [PATCH 3/5] mx5: add generic USB EHCI support for mx51 and mx53 Wolfgang Grandegger
@ 2011-11-11 14:22 ` Fabio Estevam
2011-11-14 8:39 ` Wolfgang Grandegger
0 siblings, 1 reply; 16+ messages in thread
From: Fabio Estevam @ 2011-11-11 14:22 UTC (permalink / raw)
To: u-boot
Hi Wolfgang,
On Fri, Nov 11, 2011 at 11:03 AM, Wolfgang Grandegger <wg@denx.de> wrote:
> It's derived from ehci-mxc and uses the header files of the
> ehci-fsl interface. The callback board_ehci_hcd_init() has
> been introduced to allow for board-specific setup when USB
> is started.
>
> Signed-off-by: Wolfgang Grandegger <wg@denx.de>
> CC: Stefano Babic <sbabic@denx.de>
> CC: Remy Bohmer <linux@bohmer.net>
> ---
> ?drivers/usb/host/Makefile ? | ? ?1 +
> ?drivers/usb/host/ehci-mx5.c | ?174 +++++++++++++++++++++++++++++++++++++++++++
> ?include/usb/ehci-fsl.h ? ? ?| ? 10 +++
> ?3 files changed, 185 insertions(+), 0 deletions(-)
> ?create mode 100644 drivers/usb/host/ehci-mx5.c
Do we really need to create a drivers/usb/host/ehci-mx5.c?
Can't mx5 USB support be included inside drivers/usb/host/ehci-mxc.c instead?
Regards,
Fabio Estevam
^ permalink raw reply [flat|nested] 16+ messages in thread
* [U-Boot] [PATCH 0/5] mx5: USB host support for mx51evk and mx53loco
2011-11-11 13:03 [U-Boot] [PATCH 0/5] mx5: USB host support for mx51evk and mx53loco Wolfgang Grandegger
` (4 preceding siblings ...)
2011-11-11 13:03 ` [U-Boot] [PATCH 5/5] mx51evk: " Wolfgang Grandegger
@ 2011-11-11 21:44 ` Marek Vasut
2011-11-14 8:50 ` Wolfgang Grandegger
2011-11-11 23:34 ` Jana Rapava
6 siblings, 1 reply; 16+ messages in thread
From: Marek Vasut @ 2011-11-11 21:44 UTC (permalink / raw)
To: u-boot
> This patches series provides USB host support for the mx51evk and
> mx53loco. The generic ehci-mx5 interface is derived from ehci-mxc
> and uses the header files of the ehci-fsl interface. The callback
> board_ehci_hcd_init() allows to do board-specific setup when USB is
> started.
>
> Wolfgang.
>
> Wolfgang Grandegger (5):
> mx5: add helper functions to enable USB clocks
> mx5: add helper function to retrieve the GPIO number
> mx5: add generic USB EHCI support for mx51 and mx53
> mx53loco: add end enable USB host support on port 1
> mx51evk: add end enable USB host support on port 1
>
> arch/arm/cpu/armv7/mx5/clock.c | 72 ++++++++++++
> arch/arm/include/asm/arch-mx5/clock.h | 5 +
> arch/arm/include/asm/arch-mx5/crm_regs.h | 3 +
> arch/arm/include/asm/arch-mx5/mx5x_pins.h | 4 +
> board/freescale/mx51evk/mx51evk.c | 92 +++++++++++++++
> board/freescale/mx53loco/mx53loco.c | 10 ++
> drivers/usb/host/Makefile | 1 +
> drivers/usb/host/ehci-mx5.c | 174
> +++++++++++++++++++++++++++++ include/configs/mx51evk.h |
> 13 ++
> include/configs/mx53loco.h | 13 ++
> include/usb/ehci-fsl.h | 10 ++
> 11 files changed, 397 insertions(+), 0 deletions(-)
> create mode 100644 drivers/usb/host/ehci-mx5.c
Hi,
isn't Jana already doing this kind of USB support for mx5 based on my old
patches? You didn't notice?
M
^ permalink raw reply [flat|nested] 16+ messages in thread
* [U-Boot] [PATCH 0/5] mx5: USB host support for mx51evk and mx53loco
2011-11-11 13:03 [U-Boot] [PATCH 0/5] mx5: USB host support for mx51evk and mx53loco Wolfgang Grandegger
` (5 preceding siblings ...)
2011-11-11 21:44 ` [U-Boot] [PATCH 0/5] mx5: USB host support for mx51evk and mx53loco Marek Vasut
@ 2011-11-11 23:34 ` Jana Rapava
2011-11-14 9:01 ` Wolfgang Grandegger
6 siblings, 1 reply; 16+ messages in thread
From: Jana Rapava @ 2011-11-11 23:34 UTC (permalink / raw)
To: u-boot
> This patches series provides USB host support for the mx51evk and
> mx53loco. The generic ehci-mx5 interface is derived from ehci-mxc
> and uses the header files of the ehci-fsl interface. The callback
> board_ehci_hcd_init() allows to do board-specific setup when USB is
> started.
>
> Wolfgang.
>
> Wolfgang Grandegger (5):
> mx5: add helper functions to enable USB clocks
> mx5: add helper function to retrieve the GPIO number
> mx5: add generic USB EHCI support for mx51 and mx53
> mx53loco: add end enable USB host support on port 1
> mx51evk: add end enable USB host support on port 1
>
> arch/arm/cpu/armv7/mx5/clock.c | 72 ++++++++++++
> arch/arm/include/asm/arch-mx5/clock.h | 5 +
> arch/arm/include/asm/arch-mx5/crm_regs.h | 3 +
> arch/arm/include/asm/arch-mx5/mx5x_pins.h | 4 +
> board/freescale/mx51evk/mx51evk.c | 92 +++++++++++++++
> board/freescale/mx53loco/mx53loco.c | 10 ++
> drivers/usb/host/Makefile | 1 +
> drivers/usb/host/ehci-mx5.c | 174
> +++++++++++++++++++++++++++++ include/configs/mx51evk.h |
> 13 ++
> include/configs/mx53loco.h | 13 ++
> include/usb/ehci-fsl.h | 10 ++
> 11 files changed, 397 insertions(+), 0 deletions(-)
> create mode 100644 drivers/usb/host/ehci-mx5.c
Hi, I'm working on MX51 USB support based on some patches from Marek Vasut.
It solves the problem in another way (uses structure-based offsets and generic
ULPI implementation I've written for this) and is probably more polished because
it's spent in the mailing list something like 2 months.
However, your patch supports both mx51 and mx53, so I think it would be nice
to find some way to get them together.
Last but not least, I'm sorry that I didn't respond to your first e-mail,
but I had to study for a test and hadn't time to look at your patch better.
Regards,
Jana Rapava
^ permalink raw reply [flat|nested] 16+ messages in thread
* [U-Boot] [PATCH 3/5] mx5: add generic USB EHCI support for mx51 and mx53
2011-11-11 14:22 ` Fabio Estevam
@ 2011-11-14 8:39 ` Wolfgang Grandegger
0 siblings, 0 replies; 16+ messages in thread
From: Wolfgang Grandegger @ 2011-11-14 8:39 UTC (permalink / raw)
To: u-boot
On 11/11/2011 03:22 PM, Fabio Estevam wrote:
> Hi Wolfgang,
>
> On Fri, Nov 11, 2011 at 11:03 AM, Wolfgang Grandegger <wg@denx.de> wrote:
>> It's derived from ehci-mxc and uses the header files of the
>> ehci-fsl interface. The callback board_ehci_hcd_init() has
>> been introduced to allow for board-specific setup when USB
>> is started.
>>
>> Signed-off-by: Wolfgang Grandegger <wg@denx.de>
>> CC: Stefano Babic <sbabic@denx.de>
>> CC: Remy Bohmer <linux@bohmer.net>
>> ---
>> drivers/usb/host/Makefile | 1 +
>> drivers/usb/host/ehci-mx5.c | 174 +++++++++++++++++++++++++++++++++++++++++++
>> include/usb/ehci-fsl.h | 10 +++
>> 3 files changed, 185 insertions(+), 0 deletions(-)
>> create mode 100644 drivers/usb/host/ehci-mx5.c
>
> Do we really need to create a drivers/usb/host/ehci-mx5.c?
>
> Can't mx5 USB support be included inside drivers/usb/host/ehci-mxc.c instead?
it could be included into ehci-mxc.c using #ifdef's, of course. Would
that be the better solution?
Wolfgang.
^ permalink raw reply [flat|nested] 16+ messages in thread
* [U-Boot] [PATCH 0/5] mx5: USB host support for mx51evk and mx53loco
2011-11-11 21:44 ` [U-Boot] [PATCH 0/5] mx5: USB host support for mx51evk and mx53loco Marek Vasut
@ 2011-11-14 8:50 ` Wolfgang Grandegger
2011-11-14 10:46 ` Marek Vasut
0 siblings, 1 reply; 16+ messages in thread
From: Wolfgang Grandegger @ 2011-11-14 8:50 UTC (permalink / raw)
To: u-boot
On 11/11/2011 10:44 PM, Marek Vasut wrote:
>> This patches series provides USB host support for the mx51evk and
>> mx53loco. The generic ehci-mx5 interface is derived from ehci-mxc
>> and uses the header files of the ehci-fsl interface. The callback
>> board_ehci_hcd_init() allows to do board-specific setup when USB is
>> started.
>>
>> Wolfgang.
>>
>> Wolfgang Grandegger (5):
>> mx5: add helper functions to enable USB clocks
>> mx5: add helper function to retrieve the GPIO number
>> mx5: add generic USB EHCI support for mx51 and mx53
>> mx53loco: add end enable USB host support on port 1
>> mx51evk: add end enable USB host support on port 1
>>
>> arch/arm/cpu/armv7/mx5/clock.c | 72 ++++++++++++
>> arch/arm/include/asm/arch-mx5/clock.h | 5 +
>> arch/arm/include/asm/arch-mx5/crm_regs.h | 3 +
>> arch/arm/include/asm/arch-mx5/mx5x_pins.h | 4 +
>> board/freescale/mx51evk/mx51evk.c | 92 +++++++++++++++
>> board/freescale/mx53loco/mx53loco.c | 10 ++
>> drivers/usb/host/Makefile | 1 +
>> drivers/usb/host/ehci-mx5.c | 174
>> +++++++++++++++++++++++++++++ include/configs/mx51evk.h |
>> 13 ++
>> include/configs/mx53loco.h | 13 ++
>> include/usb/ehci-fsl.h | 10 ++
>> 11 files changed, 397 insertions(+), 0 deletions(-)
>> create mode 100644 drivers/usb/host/ehci-mx5.c
>
> Hi,
>
> isn't Jana already doing this kind of USB support for mx5 based on my old
> patches? You didn't notice?
Well, I already responded on Jana's patches and presented my ideas here:
http://marc.info/?l=u-boot&m=132067806107887&w=2
Unfortunately, only the mails with subject "[PATCH] ..." get enough
attention ;-).
The big difference to Jana's patch is that he uses a board-specific
implementation (ehci_hcd_init() is in board specific code). I think we
should share some code.
Wolfgang.
^ permalink raw reply [flat|nested] 16+ messages in thread
* [U-Boot] [PATCH 0/5] mx5: USB host support for mx51evk and mx53loco
2011-11-11 23:34 ` Jana Rapava
@ 2011-11-14 9:01 ` Wolfgang Grandegger
0 siblings, 0 replies; 16+ messages in thread
From: Wolfgang Grandegger @ 2011-11-14 9:01 UTC (permalink / raw)
To: u-boot
Hi Jana,
On 11/12/2011 12:34 AM, Jana Rapava wrote:
>> This patches series provides USB host support for the mx51evk and
>> mx53loco. The generic ehci-mx5 interface is derived from ehci-mxc
>> and uses the header files of the ehci-fsl interface. The callback
>> board_ehci_hcd_init() allows to do board-specific setup when USB is
>> started.
>>
>> Wolfgang.
>>
>> Wolfgang Grandegger (5):
>> mx5: add helper functions to enable USB clocks
>> mx5: add helper function to retrieve the GPIO number
>> mx5: add generic USB EHCI support for mx51 and mx53
>> mx53loco: add end enable USB host support on port 1
>> mx51evk: add end enable USB host support on port 1
>>
>> arch/arm/cpu/armv7/mx5/clock.c | 72 ++++++++++++
>> arch/arm/include/asm/arch-mx5/clock.h | 5 +
>> arch/arm/include/asm/arch-mx5/crm_regs.h | 3 +
>> arch/arm/include/asm/arch-mx5/mx5x_pins.h | 4 +
>> board/freescale/mx51evk/mx51evk.c | 92 +++++++++++++++
>> board/freescale/mx53loco/mx53loco.c | 10 ++
>> drivers/usb/host/Makefile | 1 +
>> drivers/usb/host/ehci-mx5.c | 174
>> +++++++++++++++++++++++++++++ include/configs/mx51evk.h |
>> 13 ++
>> include/configs/mx53loco.h | 13 ++
>> include/usb/ehci-fsl.h | 10 ++
>> 11 files changed, 397 insertions(+), 0 deletions(-)
>> create mode 100644 drivers/usb/host/ehci-mx5.c
>
> Hi, I'm working on MX51 USB support based on some patches from Marek Vasut.
> It solves the problem in another way (uses structure-based offsets and generic
> ULPI implementation I've written for this) and is probably more polished because
> it's spent in the mailing list something like 2 months.
The structure-based offsets are nice. For my boards I do not need
special ULPI support and therefore it's a clearly separated interface.
> However, your patch supports both mx51 and mx53, so I think it would be nice
> to find some way to get them together.
I think we should share some code, especially the ehci_hcd_init()
callback. If my recent patch series, I call a board-specific
board_hcd_init() in the common ehci_hcd_init() which would be fine for
your hardware as well.
> Last but not least, I'm sorry that I didn't respond to your first e-mail,
> but I had to study for a test and hadn't time to look at your patch better.
No problem, you are welcome.
Unfortuantely, the existing interface ehci for the mxc is kind of mess
and if derived from various existing interfaces, mainly ehci-fsl from
u-boot and ehci-mxc from linux.
I'm going to comment on your recent patch series now...
Wolfgang.
^ permalink raw reply [flat|nested] 16+ messages in thread
* [U-Boot] [PATCH 0/5] mx5: USB host support for mx51evk and mx53loco
2011-11-14 8:50 ` Wolfgang Grandegger
@ 2011-11-14 10:46 ` Marek Vasut
2011-11-14 10:55 ` Wolfgang Grandegger
0 siblings, 1 reply; 16+ messages in thread
From: Marek Vasut @ 2011-11-14 10:46 UTC (permalink / raw)
To: u-boot
> On 11/11/2011 10:44 PM, Marek Vasut wrote:
> >> This patches series provides USB host support for the mx51evk and
> >> mx53loco. The generic ehci-mx5 interface is derived from ehci-mxc
> >> and uses the header files of the ehci-fsl interface. The callback
> >> board_ehci_hcd_init() allows to do board-specific setup when USB is
> >> started.
> >>
> >> Wolfgang.
> >>
> >> Wolfgang Grandegger (5):
> >> mx5: add helper functions to enable USB clocks
> >> mx5: add helper function to retrieve the GPIO number
> >> mx5: add generic USB EHCI support for mx51 and mx53
> >> mx53loco: add end enable USB host support on port 1
> >> mx51evk: add end enable USB host support on port 1
> >>
> >> arch/arm/cpu/armv7/mx5/clock.c | 72 ++++++++++++
> >> arch/arm/include/asm/arch-mx5/clock.h | 5 +
> >> arch/arm/include/asm/arch-mx5/crm_regs.h | 3 +
> >> arch/arm/include/asm/arch-mx5/mx5x_pins.h | 4 +
> >> board/freescale/mx51evk/mx51evk.c | 92 +++++++++++++++
> >> board/freescale/mx53loco/mx53loco.c | 10 ++
> >> drivers/usb/host/Makefile | 1 +
> >> drivers/usb/host/ehci-mx5.c | 174
> >>
> >> +++++++++++++++++++++++++++++ include/configs/mx51evk.h
> >> |
> >>
> >> 13 ++
> >> include/configs/mx53loco.h | 13 ++
> >> include/usb/ehci-fsl.h | 10 ++
> >> 11 files changed, 397 insertions(+), 0 deletions(-)
> >> create mode 100644 drivers/usb/host/ehci-mx5.c
> >
> > Hi,
> >
> > isn't Jana already doing this kind of USB support for mx5 based on my old
> > patches? You didn't notice?
>
> Well, I already responded on Jana's patches and presented my ideas here:
>
> http://marc.info/?l=u-boot&m=132067806107887&w=2
>
> Unfortunately, only the mails with subject "[PATCH] ..." get enough
> attention ;-).
Well aparently she isn't even signed to the ML ... so you need to CC her ... doh
:-/
>
> The big difference to Jana's patch is that he uses a board-specific
> implementation (ehci_hcd_init() is in board specific code). I think we
> should share some code.
Please do.
>
> Wolfgang.
M
^ permalink raw reply [flat|nested] 16+ messages in thread
* [U-Boot] [PATCH 0/5] mx5: USB host support for mx51evk and mx53loco
2011-11-14 10:46 ` Marek Vasut
@ 2011-11-14 10:55 ` Wolfgang Grandegger
0 siblings, 0 replies; 16+ messages in thread
From: Wolfgang Grandegger @ 2011-11-14 10:55 UTC (permalink / raw)
To: u-boot
On 11/14/2011 11:46 AM, Marek Vasut wrote:
>> On 11/11/2011 10:44 PM, Marek Vasut wrote:
>>>> This patches series provides USB host support for the mx51evk and
>>>> mx53loco. The generic ehci-mx5 interface is derived from ehci-mxc
>>>> and uses the header files of the ehci-fsl interface. The callback
>>>> board_ehci_hcd_init() allows to do board-specific setup when USB is
>>>> started.
>>>>
>>>> Wolfgang.
>>>>
>>>> Wolfgang Grandegger (5):
>>>> mx5: add helper functions to enable USB clocks
>>>> mx5: add helper function to retrieve the GPIO number
>>>> mx5: add generic USB EHCI support for mx51 and mx53
>>>> mx53loco: add end enable USB host support on port 1
>>>> mx51evk: add end enable USB host support on port 1
>>>>
>>>> arch/arm/cpu/armv7/mx5/clock.c | 72 ++++++++++++
>>>> arch/arm/include/asm/arch-mx5/clock.h | 5 +
>>>> arch/arm/include/asm/arch-mx5/crm_regs.h | 3 +
>>>> arch/arm/include/asm/arch-mx5/mx5x_pins.h | 4 +
>>>> board/freescale/mx51evk/mx51evk.c | 92 +++++++++++++++
>>>> board/freescale/mx53loco/mx53loco.c | 10 ++
>>>> drivers/usb/host/Makefile | 1 +
>>>> drivers/usb/host/ehci-mx5.c | 174
>>>>
>>>> +++++++++++++++++++++++++++++ include/configs/mx51evk.h
>>>> |
>>>>
>>>> 13 ++
>>>> include/configs/mx53loco.h | 13 ++
>>>> include/usb/ehci-fsl.h | 10 ++
>>>> 11 files changed, 397 insertions(+), 0 deletions(-)
>>>> create mode 100644 drivers/usb/host/ehci-mx5.c
>>>
>>> Hi,
>>>
>>> isn't Jana already doing this kind of USB support for mx5 based on my old
>>> patches? You didn't notice?
>>
>> Well, I already responded on Jana's patches and presented my ideas here:
>>
>> http://marc.info/?l=u-boot&m=132067806107887&w=2
>>
>> Unfortunately, only the mails with subject "[PATCH] ..." get enough
>> attention ;-).
>
> Well aparently she isn't even signed to the ML ... so you need to CC her ... doh
> :-/
What do you mean? I replied to *all*!
>> The big difference to Jana's patch is that he uses a board-specific
>> implementation (ehci_hcd_init() is in board specific code). I think we
>> should share some code.
>
> Please do.
See my patches ;-). Well, maybe it's more straight forward if we try to
get my patches for the MX51/53 boards accepted first and then Jana could
then use the negotiated interface. But also vise versa is fine for me.
Wolfgang.
^ permalink raw reply [flat|nested] 16+ messages in thread
* [U-Boot] [PATCH 4/5] mx53loco: add end enable USB host support on port 1
2011-11-11 13:03 ` [U-Boot] [PATCH 4/5] mx53loco: add end enable USB host support on port 1 Wolfgang Grandegger
@ 2011-11-16 7:22 ` Jason Liu
2011-11-24 3:01 ` Marek Vasut
1 sibling, 0 replies; 16+ messages in thread
From: Jason Liu @ 2011-11-16 7:22 UTC (permalink / raw)
To: u-boot
2011/11/11 Wolfgang Grandegger <wg@denx.de>:
> Signed-off-by: Wolfgang Grandegger <wg@denx.de>
> CC: Jason Liu <r64343@freescale.com>
> ---
> ?board/freescale/mx53loco/mx53loco.c | ? 10 ++++++++++
> ?include/configs/mx53loco.h ? ? ? ? ?| ? 13 +++++++++++++
> ?2 files changed, 23 insertions(+), 0 deletions(-)
>
> diff --git a/board/freescale/mx53loco/mx53loco.c b/board/freescale/mx53loco/mx53loco.c
> index b4c7f33..7bccfa9 100644
> --- a/board/freescale/mx53loco/mx53loco.c
> +++ b/board/freescale/mx53loco/mx53loco.c
> @@ -78,6 +78,16 @@ static void setup_iomux_uart(void)
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?PAD_CTL_ODE_OPENDRAIN_ENABLE);
> ?}
>
> +#ifdef CONFIG_USB_EHCI_MX5
> +void board_ehci_hcd_init(int port)
> +{
> + ? ? ? /* request VBUS power enable pin, GPIO[8}, gpio7 */
^^
here: :%s/}/]
> + ? ? ? mxc_request_iomux(MX53_PIN_ATA_DA_2, IOMUX_CONFIG_ALT1);
> + ? ? ? gpio_direction_output(IMX_GPIO_NR(7, 8), 0);
> + ? ? ? gpio_set_value(IMX_GPIO_NR(7, 8), 1);
> +}
> +#endif
> +
> ?static void setup_iomux_fec(void)
> ?{
> ? ? ? ?/*FEC_MDIO*/
> diff --git a/include/configs/mx53loco.h b/include/configs/mx53loco.h
> index d699010..9ce43d7 100644
> --- a/include/configs/mx53loco.h
> +++ b/include/configs/mx53loco.h
> @@ -72,6 +72,19 @@
> ?#define CONFIG_CMD_MII
> ?#define CONFIG_CMD_NET
>
> +/* USB Configs */
> +#define CONFIG_CMD_USB
> +#define CONFIG_CMD_FAT
> +#define CONFIG_USB_EHCI
> +#define CONFIG_USB_EHCI_MX5
> +#define CONFIG_USB_STORAGE
> +#define CONFIG_USB_HOST_ETHER
> +#define CONFIG_USB_ETHER_ASIX
> +#define CONFIG_USB_ETHER_SMSC95XX
> +#define CONFIG_MXC_USB_PORT ? ?1
> +#define CONFIG_MXC_USB_PORTSC ?(PORT_PTS_UTMI | PORT_PTS_PTW)
> +#define CONFIG_MXC_USB_FLAGS ? 0
> +
> ?/* allow to overwrite serial and ethaddr */
> ?#define CONFIG_ENV_OVERWRITE
> ?#define CONFIG_CONS_INDEX ? ? ? ? ? ? ?1
> --
> 1.7.4.1
>
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
>
^ permalink raw reply [flat|nested] 16+ messages in thread
* [U-Boot] [PATCH 4/5] mx53loco: add end enable USB host support on port 1
2011-11-11 13:03 ` [U-Boot] [PATCH 4/5] mx53loco: add end enable USB host support on port 1 Wolfgang Grandegger
2011-11-16 7:22 ` Jason Liu
@ 2011-11-24 3:01 ` Marek Vasut
1 sibling, 0 replies; 16+ messages in thread
From: Marek Vasut @ 2011-11-24 3:01 UTC (permalink / raw)
To: u-boot
> Signed-off-by: Wolfgang Grandegger <wg@denx.de>
> CC: Jason Liu <r64343@freescale.com>
> ---
> board/freescale/mx53loco/mx53loco.c | 10 ++++++++++
> include/configs/mx53loco.h | 13 +++++++++++++
> 2 files changed, 23 insertions(+), 0 deletions(-)
>
> diff --git a/board/freescale/mx53loco/mx53loco.c
> b/board/freescale/mx53loco/mx53loco.c index b4c7f33..7bccfa9 100644
> --- a/board/freescale/mx53loco/mx53loco.c
> +++ b/board/freescale/mx53loco/mx53loco.c
> @@ -78,6 +78,16 @@ static void setup_iomux_uart(void)
> PAD_CTL_ODE_OPENDRAIN_ENABLE);
> }
>
> +#ifdef CONFIG_USB_EHCI_MX5
> +void board_ehci_hcd_init(int port)
> +{
> + /* request VBUS power enable pin, GPIO[8}, gpio7 */
> + mxc_request_iomux(MX53_PIN_ATA_DA_2, IOMUX_CONFIG_ALT1);
> + gpio_direction_output(IMX_GPIO_NR(7, 8), 0);
> + gpio_set_value(IMX_GPIO_NR(7, 8), 1);
We don't have this GPIO defined by standard means?
> +}
> +#endif
> +
> static void setup_iomux_fec(void)
> {
> /*FEC_MDIO*/
> diff --git a/include/configs/mx53loco.h b/include/configs/mx53loco.h
> index d699010..9ce43d7 100644
> --- a/include/configs/mx53loco.h
> +++ b/include/configs/mx53loco.h
> @@ -72,6 +72,19 @@
> #define CONFIG_CMD_MII
> #define CONFIG_CMD_NET
>
> +/* USB Configs */
> +#define CONFIG_CMD_USB
> +#define CONFIG_CMD_FAT
> +#define CONFIG_USB_EHCI
> +#define CONFIG_USB_EHCI_MX5
> +#define CONFIG_USB_STORAGE
> +#define CONFIG_USB_HOST_ETHER
> +#define CONFIG_USB_ETHER_ASIX
> +#define CONFIG_USB_ETHER_SMSC95XX
> +#define CONFIG_MXC_USB_PORT 1
> +#define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW)
> +#define CONFIG_MXC_USB_FLAGS 0
> +
> /* allow to overwrite serial and ethaddr */
> #define CONFIG_ENV_OVERWRITE
> #define CONFIG_CONS_INDEX 1
^ permalink raw reply [flat|nested] 16+ messages in thread
end of thread, other threads:[~2011-11-24 3:01 UTC | newest]
Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-11 13:03 [U-Boot] [PATCH 0/5] mx5: USB host support for mx51evk and mx53loco Wolfgang Grandegger
2011-11-11 13:03 ` [U-Boot] [PATCH 1/5] mx5: add helper functions to enable USB clocks Wolfgang Grandegger
2011-11-11 13:03 ` [U-Boot] [PATCH 2/5] mx5: add helper function to retrieve the GPIO number Wolfgang Grandegger
2011-11-11 13:03 ` [U-Boot] [PATCH 3/5] mx5: add generic USB EHCI support for mx51 and mx53 Wolfgang Grandegger
2011-11-11 14:22 ` Fabio Estevam
2011-11-14 8:39 ` Wolfgang Grandegger
2011-11-11 13:03 ` [U-Boot] [PATCH 4/5] mx53loco: add end enable USB host support on port 1 Wolfgang Grandegger
2011-11-16 7:22 ` Jason Liu
2011-11-24 3:01 ` Marek Vasut
2011-11-11 13:03 ` [U-Boot] [PATCH 5/5] mx51evk: " Wolfgang Grandegger
2011-11-11 21:44 ` [U-Boot] [PATCH 0/5] mx5: USB host support for mx51evk and mx53loco Marek Vasut
2011-11-14 8:50 ` Wolfgang Grandegger
2011-11-14 10:46 ` Marek Vasut
2011-11-14 10:55 ` Wolfgang Grandegger
2011-11-11 23:34 ` Jana Rapava
2011-11-14 9:01 ` Wolfgang Grandegger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox