Skip to contentSkip to conversation

ohci-nxp: Device tree support

RFC PATCH New Roland Stigge 1 participant 2 messages Apr 4, 2012

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

RFC PATCH 1/2 ohci-nxp: Device tree support

This patch adds device tree support to ohci-nxp.c

---

Applies to v3.4-rc1

There is one remaining problem when booting with devicetree enabled:

Bootup looks fine:

===============================================================
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver ISP1301 Vendor ID : 0x04cc
ISP1301 Product ID : 0x1301
ISP1301 Version ID : 0x0210
usb-ohci usb-ohci: at 0xf3120000, irq 0
usb-ohci usb-ohci: nxp OHCI
usb-ohci usb-ohci: new USB bus registered, assigned bus number 1 usb-ohci usb-ohci: irq 59, io mem 0xf3120000
===============================================================

I.e., iomem, irq and i2c to the USB PHY (ISP1201) works.

Upon USB connection (e.g. Mass Storage), I get:

===============================================================
usb 1-1: new full-speed USB device number 2 using usb-ohci usb 1-1: device descriptor read/64, error -62
usb 1-1: device descriptor read/64, error -62
usb 1-1: new full-speed USB device number 3 using usb-ohci usb 1-1: device descriptor read/64, error -62
usb 1-1: device descriptor read/64, error -62
usb 1-1: new full-speed USB device number 4 using usb-ohci
VFS: Mounted root (nfs filesystem) on device 0:9. Freeing init memory: 144K
usb 1-1: device not accepting address 4, error -62 usb 1-1: new full-speed USB device number 5 using usb-ohci usb 1-1: device not accepting address 5, error -62 hub 1-0:1.0: unable to enumerate USB device on port 1
===============================================================

Another USB device consistently shows:

===============================================================
usb 1-1: new full-speed USB device number 6 using usb-ohci

hub 1-0:1.0: Cannot enable port 1.  Maybe the USB cable is bad?
hub 1-0:1.0: Cannot enable port 1.  Maybe the USB cable is bad?
hub 1-0:1.0: Cannot enable port 1.  Maybe the USB cable is bad?
hub 1-0:1.0: Cannot enable port 1.  Maybe the USB cable is bad?

hub 1-0:1.0: unable to enumerate USB device on port 1
===============================================================

With different devices, I traced it to a different place in drivers/usb/core each, and since with every device we get a different error pattern, I suspected incorrect clocking or signalling since the host already does part of the USB protocol but can't find any.

Before the DT conversion, it worked as expected.

Is this a known pitfall upon DT conversions?

Thanks in advance!

In the next patch, I'm including my work-in-progress remaining DT conversion patch. Together with my previously posted patch series of 8 (+gpio), this will eventually become the LPC32xx DT conversion.

Roland

 Documentation/devicetree/bindings/usb/ohci-nxp.txt |   16 +++++
 drivers/usb/host/ohci-nxp.c                        |   57 +++++++++++++++------
 2 files changed, 57 insertions(+), 16 deletions(-)
Documentation/devicetree/bindings/usb/ohci-nxp.txt new file +16 -0
@@ -0,0 +1,16 @@
+* OHCI controller, NXP ohci-nxp variant
+
+Required properties:
+- compatible: must be "nxp,ohci-nxp"
+- reg: physical base address of the controller and length of memory mapped
+  region.
+- interrupts: The OHCI interrupt
+
+Example (LPC32xx):
+
+	ohci at 31020000 {
+		compatible = "nxp,ohci-nxp";
+		reg = <0x31020000 0x300>;
+		interrupt-parent = <&mic>;
+		interrupts = <0x3b 0>;
+	};
drivers/usb/host/ohci-nxp.c +41 -16

130 lines not on this page · raw message

#1 lore raw

RFC PATCH 2/2 ARM: LPC32xx: Device tree support

This patch adds device tree support for the LPC32xx SoC

arch/arm/boot/dts/lpc32xx.dtsi: Include for devices based on LPC32xx arch/arm/boot/dts/phy3250.dts: Board support for PHYTEC phyCORE-LPC3250 arch/arm/boot/mach-lpc32xx/irq.c: irq domain conversion

---

This is just work in progress to give some context of what I'm doing to mach-lpc32xx, especially wrt. OHCI (see PATCH 1/2).

Applies to v3.4-rc1 and uses the various other driver DT conversion patches (patches posted previously, but they shouldn't be essential).

Please ignore the yet unconnected devices in the dtsi file. Also, SPI and LCD conversion is still missing.

I'm planning to do the serial port DT connections in separate, later patches.

The remaining lines of phy3250.c will finally also be merged into common.c.

Is it necessary or reasonable to split off the irq domain conversion in irq.c?

Thanks,

Roland

 Documentation/devicetree/bindings/arm/lpc32xx-mic.txt |   39 ++
 Documentation/devicetree/bindings/arm/lpc32xx.txt     |    8 
 arch/arm/Kconfig                                      |    1 
 arch/arm/boot/dts/lpc32xx.dtsi                        |  262 ++++++++++++++++++
 arch/arm/boot/dts/phy3250.dts                         |   74 +++++
 arch/arm/mach-lpc32xx/Kconfig                         |   26 -
 arch/arm/mach-lpc32xx/common.c                        |  171 -----------
 arch/arm/mach-lpc32xx/irq.c                           |   77 +++--
 arch/arm/mach-lpc32xx/phy3250.c                       |   85 ++---
 9 files changed, 471 insertions(+), 272 deletions(-)
Documentation/devicetree/bindings/arm/lpc32xx-mic.txt new file +39 -0
@@ -0,0 +1,39 @@
+* NXP LPC32xx Main Interrupt Controller
+  (MIC, including SIC1 and SIC2 secondary controllers)
+
+Required properties:
+- compatible: Should be "nxp,lpc32xx-mic"
+- interrupt-controller: Identifies the node as an interrupt controller.
+- interrupt-parent: Empty for the interrupt controller itself
+- #interrupt-cells: The number of cells to define the interrupts. Should be 2.
+  The first cell is the IRQ number
+  The second cell is used to specify mode:
+      1 = low-to-high edge triggered
+      2 = high-to-low edge triggered
+      4 = active high level-sensitive
+      8 = active low level-sensitive
+      Default for internal sources should be set to 4 (active high).
+- reg: Should contain MIC registers location and length
+
+Examples:
+	/*
+	 * MIC
+	 */
+	mic: interrupt-controller at 40008000 {
+		compatible = "nxp,lpc32xx-mic";
+		interrupt-controller;
+		interrupt-parent;
+		#interrupt-cells = <2>;
+		reg = <0x40008000 0xC000>;
+	};
+
+	/*
+	 * ADC
+	 */
+	adc at 40048000 {
+		compatible = "nxp,lpc32xx-adc";
+		reg = <0x40048000 0x1000>;
+		interrupt-parent = <&mic>;
+		interrupts = <39 4>;
+	};
+
Documentation/devicetree/bindings/arm/lpc32xx.txt new file +8 -0
@@ -0,0 +1,8 @@
+NXP LPC32xx Platforms Device Tree Bindings
+------------------------------------------
+
+Boards with the NXP LPC32xx SoC shall have the following properties:
+
+Required root node property:
+
+compatible = "nxp,lpc32xx";
arch/arm/Kconfig +1 -0
@@ -596,6 +596,7 @@ config ARCH_LPC32XX
 	select USB_ARCH_HAS_OHCI
 	select CLKDEV_LOOKUP
 	select GENERIC_CLOCKEVENTS
+	select USE_OF
 	help
 	  Support for the NXP LPC32XX family of processors
 
arch/arm/boot/dts/lpc32xx.dtsi new file +262 -0

262 lines not on this page · raw message

arch/arm/boot/dts/phy3250.dts new file +74 -0

74 lines not on this page · raw message

arch/arm/mach-lpc32xx/Kconfig +0 -26
@@ -29,30 +29,4 @@ config ARCH_LPC32XX_UART6_SELECT
 
 endmenu
 
-menu "LPC32XX chip components"
-
-config ARCH_LPC32XX_IRAM_FOR_NET
-	bool "Use IRAM for network buffers"
-	default y
-	help
-	  Say Y here to use the LPC internal fast IRAM (i.e. 256KB SRAM) as
-	  network buffer.  If the total combined required buffer sizes is
-	  larger than the size of IRAM, then SDRAM will be used instead.
-
-	  This can be enabled safely if the IRAM is not intended for other
-	  uses.
-
-config ARCH_LPC32XX_MII_SUPPORT
-	bool "Check to enable MII support or leave disabled for RMII support"
-	help
-	  Say Y here to enable MII support, or N for RMII support. Regardless of
-	  which support is selected, the ethernet interface driver needs to be
-	  selected in the device driver networking section.
-
-	  The PHY3250 reference board uses RMII, so users of this board should
-	  say N.
-
-endmenu
-
 endif
-
arch/arm/mach-lpc32xx/common.c +0 -171

183 lines not on this page · raw message

arch/arm/mach-lpc32xx/irq.c +57 -20

172 lines not on this page · raw message

arch/arm/mach-lpc32xx/phy3250.c +30 -55

147 lines not on this page · raw message