mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/3] imx35: register usb-misc by default
@ 2015-12-01 13:46 Florian Vallee
  2015-12-01 13:46 ` [PATCH 2/3] eukrea-cpuimx35: setup usb through chipidea-imx driver Florian Vallee
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Florian Vallee @ 2015-12-01 13:46 UTC (permalink / raw)
  To: barebox; +Cc: Florian Vallee, Eric Bénard

Signed-off-by: Florian Vallee <fvallee@eukrea.fr>
Signed-off-by: Eric Bénard <eric@eukrea.com>
---
 arch/arm/mach-imx/imx35.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/mach-imx/imx35.c b/arch/arm/mach-imx/imx35.c
index 69d45eb..3e1aa97 100644
--- a/arch/arm/mach-imx/imx35.c
+++ b/arch/arm/mach-imx/imx35.c
@@ -73,6 +73,7 @@ int imx35_devices_init(void)
 	add_generic_device("imx31-gpio", 1, NULL, MX35_GPIO2_BASE_ADDR, 0x1000, IORESOURCE_MEM, NULL);
 	add_generic_device("imx31-gpio", 2, NULL, MX35_GPIO3_BASE_ADDR, 0x1000, IORESOURCE_MEM, NULL);
 	add_generic_device("imx21-wdt", 0, NULL, MX35_WDOG_BASE_ADDR, 0x4000, IORESOURCE_MEM, NULL);
+	add_generic_device("imx35-usb-misc", 0, NULL, MX35_USB_OTG_BASE_ADDR + 0x600, 0x100, IORESOURCE_MEM, NULL);
 
 	return 0;
 }
-- 
2.1.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 2/3] eukrea-cpuimx35: setup usb through chipidea-imx driver
  2015-12-01 13:46 [PATCH 1/3] imx35: register usb-misc by default Florian Vallee
@ 2015-12-01 13:46 ` Florian Vallee
  2015-12-01 13:46 ` [PATCH 3/3] eukrea-cpuimx35: update defconfig Florian Vallee
  2015-12-02  6:56 ` [PATCH 1/3] imx35: register usb-misc by default Sascha Hauer
  2 siblings, 0 replies; 4+ messages in thread
From: Florian Vallee @ 2015-12-01 13:46 UTC (permalink / raw)
  To: barebox; +Cc: Florian Vallee, Eric Bénard

OTG and HOST port are tested with a mass storage device.

Signed-off-by: Florian Vallee <fvallee@eukrea.fr>
Signed-off-by: Eric Bénard <eric@eukrea.com>
---
 arch/arm/boards/eukrea_cpuimx35/eukrea_cpuimx35.c | 38 ++++++++++-------------
 1 file changed, 16 insertions(+), 22 deletions(-)

diff --git a/arch/arm/boards/eukrea_cpuimx35/eukrea_cpuimx35.c b/arch/arm/boards/eukrea_cpuimx35/eukrea_cpuimx35.c
index 378f4e8..7b3993d 100644
--- a/arch/arm/boards/eukrea_cpuimx35/eukrea_cpuimx35.c
+++ b/arch/arm/boards/eukrea_cpuimx35/eukrea_cpuimx35.c
@@ -91,27 +91,18 @@ static struct imx_ipu_fb_platform_data ipu_fb_data = {
 };
 
 #ifdef CONFIG_USB
-static void imx35_usb_init(void)
-{
-	unsigned int tmp;
+#ifndef CONFIG_USB_GADGET
+struct imxusb_platformdata otg_pdata = {
+	.flags = MXC_EHCI_INTERFACE_DIFF_UNI,
+	.mode = IMX_USB_MODE_HOST,
+	.phymode = USBPHY_INTERFACE_MODE_UTMI,
+};
+#endif
 
-	/* Host 1 */
-	tmp = readl(MX35_USB_OTG_BASE_ADDR + 0x600);
-	tmp &= ~(MX35_H1_SIC_MASK | MX35_H1_PM_BIT | MX35_H1_TLL_BIT |
-		MX35_H1_USBTE_BIT | MX35_H1_IPPUE_DOWN_BIT | MX35_H1_IPPUE_UP_BIT);
-	tmp |= (MXC_EHCI_INTERFACE_SINGLE_UNI) << MX35_H1_SIC_SHIFT;
-	tmp |= MX35_H1_USBTE_BIT | MX35_H1_PM_BIT | MX35_H1_TLL_BIT ;
-	tmp |= MX35_H1_IPPUE_DOWN_BIT;
-	writel(tmp, MX35_USB_OTG_BASE_ADDR + 0x600);
-
-	tmp = readl(MX35_USB_OTG_BASE_ADDR + 0x584);
-	tmp |= 3 << 30;
-	writel(tmp, MX35_USB_OTG_BASE_ADDR + 0x584);
-
-	/* Set to Host mode */
-	tmp = readl(MX35_USB_OTG_BASE_ADDR + 0x5a8);
-	writel(tmp | 0x3, MX35_USB_OTG_BASE_ADDR + 0x5a8);
-}
+struct imxusb_platformdata hs_pdata = {
+	.flags = MXC_EHCI_INTERFACE_SINGLE_UNI | MXC_EHCI_INTERNAL_PHY | MXC_EHCI_IPPUE_DOWN,
+	.mode = IMX_USB_MODE_HOST,
+};
 #endif
 
 #ifdef CONFIG_USB_GADGET
@@ -206,9 +197,12 @@ static int eukrea_cpuimx35_devices_init(void)
 	gpio_direction_output(1, 0);
 
 #ifdef CONFIG_USB
-	imx35_usb_init();
-	add_generic_usb_ehci_device(DEVICE_ID_DYNAMIC, MX35_USB_HS_BASE_ADDR, NULL);
+#ifndef CONFIG_USB_GADGET
+	imx_add_usb((void *)MX35_USB_OTG_BASE_ADDR, 0, &otg_pdata);
 #endif
+	imx_add_usb((void *)MX35_USB_HS_BASE_ADDR, 1, &hs_pdata);
+#endif
+
 #ifdef CONFIG_USB_GADGET
 	/* Workaround ENGcm09152 */
 	tmp = readl(MX35_USB_OTG_BASE_ADDR + 0x608);
-- 
2.1.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 3/3] eukrea-cpuimx35: update defconfig
  2015-12-01 13:46 [PATCH 1/3] imx35: register usb-misc by default Florian Vallee
  2015-12-01 13:46 ` [PATCH 2/3] eukrea-cpuimx35: setup usb through chipidea-imx driver Florian Vallee
@ 2015-12-01 13:46 ` Florian Vallee
  2015-12-02  6:56 ` [PATCH 1/3] imx35: register usb-misc by default Sascha Hauer
  2 siblings, 0 replies; 4+ messages in thread
From: Florian Vallee @ 2015-12-01 13:46 UTC (permalink / raw)
  To: barebox; +Cc: Florian Vallee

enable chipidea usb driver

Signed-off-by: Florian Vallee <fvallee@eukrea.fr>
---
 arch/arm/configs/eukrea_cpuimx35_defconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/configs/eukrea_cpuimx35_defconfig b/arch/arm/configs/eukrea_cpuimx35_defconfig
index 4c83102..c163827 100644
--- a/arch/arm/configs/eukrea_cpuimx35_defconfig
+++ b/arch/arm/configs/eukrea_cpuimx35_defconfig
@@ -77,6 +77,7 @@ CONFIG_NAND_ALLOW_ERASE_BAD=y
 CONFIG_NAND_IMX=y
 CONFIG_NAND_IMX_BBM=y
 CONFIG_USB_HOST=y
+CONFIG_USB_IMX_CHIPIDEA=y
 CONFIG_USB_EHCI=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
-- 
2.1.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/3] imx35: register usb-misc by default
  2015-12-01 13:46 [PATCH 1/3] imx35: register usb-misc by default Florian Vallee
  2015-12-01 13:46 ` [PATCH 2/3] eukrea-cpuimx35: setup usb through chipidea-imx driver Florian Vallee
  2015-12-01 13:46 ` [PATCH 3/3] eukrea-cpuimx35: update defconfig Florian Vallee
@ 2015-12-02  6:56 ` Sascha Hauer
  2 siblings, 0 replies; 4+ messages in thread
From: Sascha Hauer @ 2015-12-02  6:56 UTC (permalink / raw)
  To: Florian Vallee; +Cc: barebox, Eric Bénard

On Tue, Dec 01, 2015 at 02:46:46PM +0100, Florian Vallee wrote:
> Signed-off-by: Florian Vallee <fvallee@eukrea.fr>
> Signed-off-by: Eric Bénard <eric@eukrea.com>
> ---
>  arch/arm/mach-imx/imx35.c | 1 +
>  1 file changed, 1 insertion(+)

Applied, thanks

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-12-02  6:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-01 13:46 [PATCH 1/3] imx35: register usb-misc by default Florian Vallee
2015-12-01 13:46 ` [PATCH 2/3] eukrea-cpuimx35: setup usb through chipidea-imx driver Florian Vallee
2015-12-01 13:46 ` [PATCH 3/3] eukrea-cpuimx35: update defconfig Florian Vallee
2015-12-02  6:56 ` [PATCH 1/3] imx35: register usb-misc by default Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox