Skip to contentSkip to conversation

USB: Armada100: Add UTMI PHY interface driver

PATCH New Ajay Bhargav 3 participants 9 messages Jan 25, 2012 – Feb 26, 2012

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/3 USB: Armada100: Add UTMI PHY interface driver

This patch adds USB host controller's UTMI PHY interface driver for Armada100 SOCs.

---
 arch/arm/include/asm/arch-armada100/armada100.h |    7 ++
 drivers/usb/host/utmi-armada100.c               |   87 +++++++++++++++++++++++
 drivers/usb/host/utmi-armada100.h               |   79 ++++++++++++++++++++
 3 files changed, 173 insertions(+), 0 deletions(-)
 create mode 100644 drivers/usb/host/utmi-armada100.c
 create mode 100644 drivers/usb/host/utmi-armada100.h
arch/arm/include/asm/arch-armada100/armada100.h +7 -0
index 0ed3a8e..d6984dc 100644
@@ -43,6 +43,13 @@
 #define SSP2_APBCLK		0x01
 #define SSP2_FNCLK		0x02
 
+/* USB Clock/reset control bits */
+#define USB_SPH_AXICLK_EN	0x10
+#define USB_SPH_AXI_RST		0x02
+
+/* MPMU Clocks */
+#define MPMU_EN_ALL_CLKS	0x1EFFFF
+
 /* Register Base Addresses */
 #define ARMD1_DRAM_BASE		0xB0000000
 #define ARMD1_FEC_BASE		0xC0800000
drivers/usb/host/utmi-armada100.c new file +87 -0

87 lines not on this page · raw message

drivers/usb/host/utmi-armada100.h new file +79 -0

79 lines not on this page · raw message

Signature · 1 line
1.7.7.2
#1 lore raw

PATCH 2/3 USB: Armada100: ECHI Driver for Armada100 SOCs

This patch adds support for USB EHCI driver for Armada100 SOCs.

---
 arch/arm/include/asm/arch-armada100/armada100.h |    1 +
 drivers/usb/host/Makefile                       |    1 +
 drivers/usb/host/ehci-armada100.c               |   62 +++++++++++++++++++++++
 3 files changed, 64 insertions(+), 0 deletions(-)
 create mode 100644 drivers/usb/host/ehci-armada100.c
arch/arm/include/asm/arch-armada100/armada100.h +1 -0
index d6984dc..26f836e 100644
@@ -67,6 +67,7 @@
 #define ARMD1_SSP5_BASE		0xD4021000
 #define ARMD1_UART3_BASE	0xD4026000
 #define ARMD1_MPMU_BASE		0xD4050000
+#define ARMD1_USB_HOST_BASE	0xD4209000
 #define ARMD1_APMU_BASE		0xD4282800
 #define ARMD1_CPU_BASE		0xD4282C00
 
drivers/usb/host/Makefile +1 -0
index 77e217f..94e72c3 100644
@@ -35,6 +35,7 @@ COBJS-$(CONFIG_USB_SL811HS) += sl811-hcd.o
 
 # echi
 COBJS-$(CONFIG_USB_EHCI) += ehci-hcd.o
+COBJS-$(CONFIG_USB_EHCI_ARMADA100) += ehci-armada100.o utmi-armada100.o
 ifdef CONFIG_MPC512X
 COBJS-$(CONFIG_USB_EHCI_FSL) += ehci-mpc512x.o
 else
drivers/usb/host/ehci-armada100.c new file +62 -0

62 lines not on this page · raw message

Signature · 1 line
1.7.7.2
#2 lore raw

PATCH 2/3 USB: Armada100: ECHI Driver for Armada100 SOCs

Quoted 93 lines

-----Original Message-----
From: Ajay Bhargav [mailto:ajay.bhargav at einfochips.com]
Sent: 25 January 2012 17:50
To: linux at bohmer.net
Cc: Prafulla Wadaskar; marek.vasut at gmail.com; u-boot at lists.denx.de; Ajay Bhargav
Subject: [PATCH 2/3] USB: Armada100: ECHI Driver for Armada100 SOCs

This patch adds support for USB EHCI driver for Armada100 SOCs.

---
 arch/arm/include/asm/arch-armada100/armada100.h |    1 +
 drivers/usb/host/Makefile                       |    1 +
 drivers/usb/host/ehci-armada100.c               |   62
+++++++++++++++++++++++
 3 files changed, 64 insertions(+), 0 deletions(-)
 create mode 100644 drivers/usb/host/ehci-armada100.c
arch/arm/include/asm/arch-armada100/armada100.h +1 -0
index d6984dc..26f836e 100644
@@ -67,6 +67,7 @@
 #define ARMD1_SSP5_BASE		0xD4021000
 #define ARMD1_UART3_BASE	0xD4026000
 #define ARMD1_MPMU_BASE		0xD4050000
+#define ARMD1_USB_HOST_BASE	0xD4209000
 #define ARMD1_APMU_BASE		0xD4282800
 #define ARMD1_CPU_BASE		0xD4282C00
 
drivers/usb/host/Makefile +1 -0
index 77e217f..94e72c3 100644
@@ -35,6 +35,7 @@ COBJS-$(CONFIG_USB_SL811HS) += sl811-hcd.o
 
 # echi
 COBJS-$(CONFIG_USB_EHCI) += ehci-hcd.o
+COBJS-$(CONFIG_USB_EHCI_ARMADA100) += ehci-armada100.o utmi-

armada100.o
ifdef CONFIG_MPC512X
COBJS-$(CONFIG_USB_EHCI_FSL) += ehci-mpc512x.o
else

drivers/usb/host/ehci-armada100.c new file +39 -0
new file mode 100644
index 0000000..cf05d1a
@@ -0,0 +1,62 @@
+/*
+ * (C) Copyright 2012
+ * eInfochips Ltd. <www.einfochips.com>
+ * Written-by: Ajay Bhargav <[email protected]>
+ *
+ * This driver is based on Kirkwood echi driver
+ * (C) Copyright 2009
+ * Marvell Semiconductor <www.marvell.com>
+ * Written-by: Prafulla Wadaskar <[email protected]>
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301 USA
+ */
+
+#include <common.h>
+#include <asm/io.h>
+#include <usb.h>
+#include "ehci.h"
+#include "ehci-core.h"
+#include <asm/arch/cpu.h>
+#include <asm/arch/armada100.h>
+#include "utmi-armada100.h"
+
+/*

drivers/usb/host/ehci-armada100.c line 49

Quoted 10 lines
drivers/usb/host/ehci-armada100.c new file +10 -0
+ * EHCI host controller init
+ */
+int ehci_hcd_init(void)
+{
+	utmi_init();
+	hccr = (struct ehci_hccr *)(ARMD1_USB_HOST_BASE + 0x100);
+	hcor = (struct ehci_hcor *)((uint32_t) hccr
+			+ HC_LENGTH(ehci_readl(&hccr->cr_capbase)));
+
+	printf("Kirkwood-ehci: init hccr %x and hcor %x hc_length %d\n",

Wrong printf message, it's not Kirkwood.

Regards..
Prafulla . . .

#3 lore raw

PATCH 2/3 USB: Armada100: ECHI Driver for Armada100 SOCs

----- "Prafulla Wadaskar" <[email protected]> wrote:
[...snip...]

Quoted 8 lines

Review

Quoted 2 lines
(quoted diff) +2 -0
+
+        printf("Kirkwood-ehci: init hccr %x and hcor %x hc_length %d\n",

Wrong printf message, it's not Kirkwood.

Regards..
Prafulla . . .

I don't know how I missed that.. though, I did changed it :/ Any other comments on patches?

Regards,
Ajay Bhargav

#4 lore raw

PATCH 3/3 Armada100: gplugD: Add USB command support

In reply to Ajay Bhargav

This patch adds support for USB commands and USB storage device for Marvell gplugD

---
 include/configs/gplugd.h |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)
include/configs/gplugd.h +17 -0
index 9813309..f8dc74f 100644
@@ -134,4 +134,21 @@
 #define CONFIG_CMD_EDITENV
 #define CONFIG_CMD_SAVEENV
 
+#define CONFIG_CMD_USB
+
+#ifdef CONFIG_CMD_USB
+#define CONFIG_USB_EHCI
+#define CONFIG_USB_EHCI_ARMADA100
+#define CONFIG_EHCI_IS_TDI
+#define CONFIG_USB_STORAGE
+
+#ifndef CONFIG_DOS_PARTITION
+#define CONFIG_DOS_PARTITION
+#endif /* CONFIG_DOS_PARTITION */
+
+#define CONFIG_ISO_PARTITION
+#define CONFIG_SUPPORT_VFAT
+#define CONFIG_CMD_EXT2
+#endif /* CONFIG_CMD_USB */
+
 #endif	/* __CONFIG_GPLUGD_H */
Signature · 1 line
1.7.7.2
#5 lore raw

PATCH 3/3 Armada100: gplugD: Add USB command support

Quoted 23 lines

-----Original Message-----
From: Ajay Bhargav [mailto:ajay.bhargav at einfochips.com]
Sent: 25 January 2012 17:50
To: linux at bohmer.net
Cc: Prafulla Wadaskar; marek.vasut at gmail.com; u-boot at lists.denx.de; Ajay Bhargav
Subject: [PATCH 3/3] Armada100: gplugD: Add USB command support

This patch adds support for USB commands and USB storage device for Marvell gplugD

---
 include/configs/gplugd.h |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)
include/configs/gplugd.h +0 -0
index 9813309..f8dc74f 100644

include/configs/gplugd.h line 137

Quoted 4 lines
include/configs/gplugd.h +1 -0
@@ -134,4 +134,21 @@
 #define CONFIG_CMD_EDITENV
 #define CONFIG_CMD_SAVEENV
 
+#define CONFIG_CMD_USB

This line should be moved up where all the commands are defined (below config_cmd_default.h)

include/configs/gplugd.h line 145

Quoted 8 lines
include/configs/gplugd.h +8 -0
+
+#ifdef CONFIG_CMD_USB
+#define CONFIG_USB_EHCI
+#define CONFIG_USB_EHCI_ARMADA100
+#define CONFIG_EHCI_IS_TDI
+#define CONFIG_USB_STORAGE
+
+#ifndef CONFIG_DOS_PARTITION

Does this undef needed? remove it you can.

Regards..
Prafulla . . .

#6 lore raw

PATCH 3/3 Armada100: gplugD: Add USB command support

Quoted 10 lines · ----- "Prafulla Wadaskar
Quoted 10 lines

-----Original Message-----
From: Ajay Bhargav [mailto:ajay.bhargav at einfochips.com]
Sent: 25 January 2012 17:50
To: linux at bohmer.net
Cc: Prafulla Wadaskar; marek.vasut at gmail.com; u-boot at lists.denx.de; Ajay Bhargav
Subject: [PATCH 3/3] Armada100: gplugD: Add USB command support

This patch adds support for USB commands and USB storage device for Marvell gplugD

[...snip...]

Quoted 11 lines

include/configs/gplugd.h line 145

Quoted 8 lines
include/configs/gplugd.h +7 -0
+#ifdef CONFIG_CMD_USB
+#define CONFIG_USB_EHCI
+#define CONFIG_USB_EHCI_ARMADA100
+#define CONFIG_EHCI_IS_TDI
+#define CONFIG_USB_STORAGE
+
+#ifndef CONFIG_DOS_PARTITION

Does this undef needed? remove it you can.

Quoted 3 lines

Regards..
Prafulla . . .

I will review it again and remove it if not needed.

Regards,
Ajay Bhargav

#7 lore raw

PATCH 1/3 USB: Armada100: Add UTMI PHY interface driver

In reply to Ajay Bhargav
Quoted 30 lines

-----Original Message-----
From: Ajay Bhargav [mailto:ajay.bhargav at einfochips.com]
Sent: 25 January 2012 17:50
To: linux at bohmer.net
Cc: Prafulla Wadaskar; marek.vasut at gmail.com; u-boot at lists.denx.de; Ajay Bhargav
Subject: [PATCH 1/3] USB: Armada100: Add UTMI PHY interface driver

This patch adds USB host controller's UTMI PHY interface driver for Armada100 SOCs.

---
 arch/arm/include/asm/arch-armada100/armada100.h |    7 ++
 drivers/usb/host/utmi-armada100.c               |   87
+++++++++++++++++++++++
 drivers/usb/host/utmi-armada100.h               |   79
++++++++++++++++++++
 3 files changed, 173 insertions(+), 0 deletions(-)
 create mode 100644 drivers/usb/host/utmi-armada100.c
 create mode 100644 drivers/usb/host/utmi-armada100.h
arch/arm/include/asm/arch-armada100/armada100.h +0 -0
index 0ed3a8e..d6984dc 100644

arch/arm/include/asm/arch-armada100/armada100.h line 51

Quoted 9 lines
arch/arm/include/asm/arch-armada100/armada100.h +6 -0
@@ -43,6 +43,13 @@
 #define SSP2_APBCLK		0x01
 #define SSP2_FNCLK		0x02
 
+/* USB Clock/reset control bits */
+#define USB_SPH_AXICLK_EN	0x10
+#define USB_SPH_AXI_RST		0x02
+
+/* MPMU Clocks */
+#define MPMU_EN_ALL_CLKS	0x1EFFFF

Turning on all clocks is not logical to enable this support, only relevant clock necessary for this components SHOULD BE enabled.

Enabling clocks for unused peripherals/components may result in unnecessarily extra power consumption

Otherwise ack for rest of the patch

Regards..
Prafulla . . .

#8 lore raw

PATCH 1/3 USB: Armada100: Add UTMI PHY interface driver

In reply to Ajay Bhargav
Quoted 4 lines

This patch adds USB host controller's UTMI PHY interface driver for Armada100 SOCs.

Quoted 9 lines
---
 arch/arm/include/asm/arch-armada100/armada100.h |    7 ++
 drivers/usb/host/utmi-armada100.c               |   87
+++++++++++++++++++++++ drivers/usb/host/utmi-armada100.h               | 
 79 ++++++++++++++++++++ 3 files changed, 173 insertions(+), 0
deletions(-)
 create mode 100644 drivers/usb/host/utmi-armada100.c
 create mode 100644 drivers/usb/host/utmi-armada100.h

Hi,

what's the status of this patch/patchset?

Thanks
M