Skip to contentSkip to conversation

*** ARM: Update arch-vt8500 to Devicetree ***

PATCH Superseded Tony Prisk 7 participants 24 messages Aug 23, 2012 – Sep 20, 2012

Subsystems (12)
lore
Share & tools
lore

Tony Prisk

author
#0 lore raw

v4 cover *** ARM: Update arch-vt8500 to Devicetree ***

This patchset updates arch-vt8500 to devicetree and removes all the old-style code. Support for WM8650 has also been added.

Example dts/dtsi files are given for the three currently supported models.

Major changes:

GPIO code has been converted to a platform_device and rewritten as WM8505 support was broken. Add support for WM8650 gpio controller.

UHCI support was missing. Added this as a generic non-pci uhci controller as it doesn't require anything special. Should be usable by any system that doesn't have special requirements to get the UHCI controller working.

Framebuffer code patched to support WM8650. The bindings for this are of concern but there doesn't seem to be a formalized binding yet. This patch is based off Sascha Hauer's current patch on the dri-devel mailing list and should be easily patched out when its finalized.

Patchset based on Arnd's arm-soc/for-next branch.

Could I get this reviewed, hopefully for inclusion into v3.7.

Regards
Tony Prisk

Changes
v2:
Cleanup style/formatting errors
Removed erroneous commit message about GPIO not being converted to devicetree Corrected arch-vt8500/irq.c header to correct filename
Changed GPIO driver to use module_platform_driver()
Renamed vt8500_gpio_bank_regs -> vt8500_gpio_bank_regoffsets Changed vt8500_gpio_bank_regoffset fields to unsigned int
Changed bit-setting code to use BIT() macro
Removed of_find_compatible() and use pdev->dev.of_node in _probe() Removed regoff field and related code - leftover from old design Added kerneldoc regarding struct vt8500_gpio_bank_regoffsets fields Update MODULE_LICENSE on all platform devices to "GPL v2" to match their headers Renamed dts board files to clarify product names

v3:
Corrected serial driver issue after porting to device tree. pdev->id no longer valid.
Corrected irq.c to properly initialize slaved interrupt controller. Updated framebuffer drivers to use phandles for display node. Corrected dts definitions for updated framebuffer driver.

EHCI/UHCI patch (Patch 4/9) already in -next via usb-next tree.

Included common clock frame support.
Added initialization code to arch/arm/mach-vt8500/vt8500.c for clocks. Updated wm8650.dtsi to include basic clocks.

v4:
Added missing GPL header to clk-vt8500.c
Corrected unsigned variables in gpio-vt8500.c
Changed gpio-vt8500.c to use readl/writel _relaxed variants. Update serial driver to get clock source from device tree. Update dtsi files for uart clock sources.
Renamed vt8500_gpio.txt to vt8500-gpio.txt
Describe gpio flags property - currently no flags are defined, but will need to be when gpio interrupts are supported. Kept for future compatibility.

Stephen W: I've taken a look on dri-devel mailing list and -next but haven't seen a new binding document for Sascha's of_videomode_helper yet. I've left the code as is for now - hopefully the OF helper will be formalized in this cycle. I took a look at the GPIO flags - this was added on Arnd's recommendation as it will be needed later once the GPIO controller is also an interrupt-controller. I've add documentation that it should be =0 for now.

Tony Prisk (9):
arm: vt8500: Add device tree files for VIA/Wondermedia SoC's
rtc: vt8500: Add devicetree support for vt8500-rtc
serial: vt8500: Add devicetree support for vt8500-serial
usb: vt8500: Add devicetree support for vt8500-ehci and -uhci.
video: vt8500: Add devicetree support for vt8500-fb and wm8505-fb
arm: vt8500: Update arch-vt8500 to devicetree support.
arm: vt8500: doc: Add device tree bindings for arch-vt8500 devices
arm: vt8500: gpio: Devicetree support for arch-vt8500
arm: vt8500: clk: Add Common Clock Framework support

 Documentation/devicetree/bindings/arm/vt8500.txt   |   15 +
 .../bindings/arm/vt8500/via,vt8500-intc.txt        |   16 +
 .../bindings/arm/vt8500/via,vt8500-pmc.txt         |   13 +
 .../bindings/arm/vt8500/via,vt8500-timer.txt       |   15 +
 Documentation/devicetree/bindings/clock/vt8500.txt |   72 +++
 .../devicetree/bindings/gpio/gpio-vt8500.txt       |   24 +
 .../devicetree/bindings/rtc/via,vt8500-rtc.txt     |   15 +
 .../bindings/tty/serial/via,vt8500-uart.txt        |   17 +
 .../devicetree/bindings/usb/platform-uhci.txt      |   15 +
 .../devicetree/bindings/usb/via,vt8500-ehci.txt    |   15 +
 .../devicetree/bindings/vendor-prefixes.txt        |    2 +
 .../devicetree/bindings/video/via,vt8500-fb.txt    |   48 ++
 .../devicetree/bindings/video/wm,prizm-ge-rops.txt |   13 +
 .../devicetree/bindings/video/wm,wm8505-fb.txt     |   22 +
 arch/arm/Kconfig                                   |    5 +
 arch/arm/boot/dts/vt8500-bv07.dts                  |   31 ++
 arch/arm/boot/dts/vt8500.dtsi                      |  115 +++++
 arch/arm/boot/dts/wm8505-ref.dts                   |   31 ++
 arch/arm/boot/dts/wm8505.dtsi                      |  142 ++++++
 arch/arm/boot/dts/wm8650-mid.dts                   |   31 ++
 arch/arm/boot/dts/wm8650.dtsi                      |  146 ++++++
 arch/arm/mach-vt8500/Kconfig                       |   72 +--
 arch/arm/mach-vt8500/Makefile                      |    9 +-
 arch/arm/mach-vt8500/bv07.c                        |   80 ---
 arch/arm/mach-vt8500/common.h                      |   28 ++
 arch/arm/mach-vt8500/devices-vt8500.c              |   91 ----
 arch/arm/mach-vt8500/devices-wm8505.c              |   99 ----
 arch/arm/mach-vt8500/devices.c                     |  270 -----------
 arch/arm/mach-vt8500/devices.h                     |   88 ----
 arch/arm/mach-vt8500/gpio.c                        |  240 ---------
 arch/arm/mach-vt8500/include/mach/restart.h        |    4 +-
 arch/arm/mach-vt8500/include/mach/vt8500_irqs.h    |   88 ----
 arch/arm/mach-vt8500/include/mach/vt8500_regs.h    |   79 ---
 arch/arm/mach-vt8500/include/mach/wm8505_irqs.h    |  115 -----
 arch/arm/mach-vt8500/include/mach/wm8505_regs.h    |   78 ---
 arch/arm/mach-vt8500/irq.c                         |  209 ++++----
 arch/arm/mach-vt8500/restart.c                     |   54 ---
 arch/arm/mach-vt8500/timer.c                       |   67 ++-
 arch/arm/mach-vt8500/vt8500.c                      |  196 ++++++++
 arch/arm/mach-vt8500/wm8505_7in.c                  |   79 ---
 drivers/clk/Makefile                               |    1 +
 drivers/clk/clk-vt8500.c                           |  511 ++++++++++++++++++++
 drivers/gpio/Kconfig                               |    6 +
 drivers/gpio/Makefile                              |    1 +
 drivers/gpio/gpio-vt8500.c                         |  316 ++++++++++++
 drivers/rtc/rtc-vt8500.c                           |    9 +-
 drivers/tty/serial/vt8500_serial.c                 |   58 ++-
 drivers/usb/host/Kconfig                           |    4 +-
 drivers/usb/host/ehci-vt8500.c                     |   25 +-
 drivers/usb/host/uhci-hcd.c                        |    5 +
 drivers/usb/host/uhci-platform.c                   |  169 +++++++
 drivers/video/Kconfig                              |    6 +-
 drivers/video/vt8500lcdfb.c                        |   79 ++-
 drivers/video/wm8505fb.c                           |   97 +++-
 drivers/video/wmt_ge_rops.c                        |    9 +-
 55 files changed, 2463 insertions(+), 1582 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/arm/vt8500.txt
 create mode 100644 Documentation/devicetree/bindings/arm/vt8500/via,vt8500-intc.txt
 create mode 100644 Documentation/devicetree/bindings/arm/vt8500/via,vt8500-pmc.txt
 create mode 100644 Documentation/devicetree/bindings/arm/vt8500/via,vt8500-timer.txt
 create mode 100644 Documentation/devicetree/bindings/clock/vt8500.txt
 create mode 100644 Documentation/devicetree/bindings/gpio/gpio-vt8500.txt
 create mode 100644 Documentation/devicetree/bindings/rtc/via,vt8500-rtc.txt
 create mode 100644 Documentation/devicetree/bindings/tty/serial/via,vt8500-uart.txt
 create mode 100644 Documentation/devicetree/bindings/usb/platform-uhci.txt
 create mode 100644 Documentation/devicetree/bindings/usb/via,vt8500-ehci.txt
 create mode 100644 Documentation/devicetree/bindings/video/via,vt8500-fb.txt
 create mode 100644 Documentation/devicetree/bindings/video/wm,prizm-ge-rops.txt
 create mode 100644 Documentation/devicetree/bindings/video/wm,wm8505-fb.txt
 create mode 100644 arch/arm/boot/dts/vt8500-bv07.dts
 create mode 100644 arch/arm/boot/dts/vt8500.dtsi
 create mode 100644 arch/arm/boot/dts/wm8505-ref.dts
 create mode 100644 arch/arm/boot/dts/wm8505.dtsi
 create mode 100644 arch/arm/boot/dts/wm8650-mid.dts
 create mode 100644 arch/arm/boot/dts/wm8650.dtsi
 delete mode 100644 arch/arm/mach-vt8500/bv07.c
 create mode 100644 arch/arm/mach-vt8500/common.h
 delete mode 100644 arch/arm/mach-vt8500/devices-vt8500.c
 delete mode 100644 arch/arm/mach-vt8500/devices-wm8505.c
 delete mode 100644 arch/arm/mach-vt8500/devices.c
 delete mode 100644 arch/arm/mach-vt8500/devices.h
 delete mode 100644 arch/arm/mach-vt8500/gpio.c
 delete mode 100644 arch/arm/mach-vt8500/include/mach/vt8500_irqs.h
 delete mode 100644 arch/arm/mach-vt8500/include/mach/vt8500_regs.h
 delete mode 100644 arch/arm/mach-vt8500/include/mach/wm8505_irqs.h
 delete mode 100644 arch/arm/mach-vt8500/include/mach/wm8505_regs.h
 delete mode 100644 arch/arm/mach-vt8500/restart.c
 create mode 100644 arch/arm/mach-vt8500/vt8500.c
 delete mode 100644 arch/arm/mach-vt8500/wm8505_7in.c
 create mode 100644 drivers/clk/clk-vt8500.c
 create mode 100644 drivers/gpio/gpio-vt8500.c
 create mode 100644 drivers/usb/host/uhci-platform.c
Signature · 1 line
1.7.9.5
author
#1 lore raw

PATCH v4 1/9 arm: vt8500: Add device tree files for VIA/Wondermedia SoC's

Add device tree files for VT8500, WM8505 and WM8650 SoC's and reference boards.

---
 arch/arm/boot/dts/vt8500-bv07.dts |   31 ++++++++
 arch/arm/boot/dts/vt8500.dtsi     |  115 +++++++++++++++++++++++++++++
 arch/arm/boot/dts/wm8505-ref.dts  |   31 ++++++++
 arch/arm/boot/dts/wm8505.dtsi     |  142 ++++++++++++++++++++++++++++++++++++
 arch/arm/boot/dts/wm8650-mid.dts  |   31 ++++++++
 arch/arm/boot/dts/wm8650.dtsi     |  146 +++++++++++++++++++++++++++++++++++++
 6 files changed, 496 insertions(+)
 create mode 100644 arch/arm/boot/dts/vt8500-bv07.dts
 create mode 100644 arch/arm/boot/dts/vt8500.dtsi
 create mode 100644 arch/arm/boot/dts/wm8505-ref.dts
 create mode 100644 arch/arm/boot/dts/wm8505.dtsi
 create mode 100644 arch/arm/boot/dts/wm8650-mid.dts
 create mode 100644 arch/arm/boot/dts/wm8650.dtsi
arch/arm/boot/dts/vt8500-bv07.dts new file +31 -0
new file mode 100644
index 0000000..339a664
@@ -0,0 +1,31 @@
+/*
+ * vt8500-bv07.dts - Device tree file for Benign BV07 Netbook
+ *
+ * Copyright (C) 2012 Tony Prisk <[email protected]>
+ *
+ * Licensed under GPLv2 or later
+ */
+
+/dts-v1/;
+/include/ "vt8500.dtsi"
+
+/ {
+	model = "Benign BV07 Netbook";
+
+	/*
+	 * Display node is based on Sascha Hauer's patch on dri-devel.
+	 * Added a bpp property to calculate the size of the framebuffer
+	 * until the binding is formalized.
+	 */
+	display: display {
+		xres = <800>;
+		yres = <480>;
+		left-margin = <88>;
+		right-margin = <40>;
+		hsync-len = <0>;
+		upper-margin = <32>;
+		lower-margin = <11>;
+		vsync-len = <1>;
+		bpp = <16>;
+	};
+};
arch/arm/boot/dts/vt8500.dtsi new file +115 -0

115 lines not on this page · raw message

arch/arm/boot/dts/wm8505-ref.dts new file +31 -0
new file mode 100644
index 0000000..fcd9836
@@ -0,0 +1,31 @@
+/*
+ * wm8505-ref.dts - Device tree file for Wondermedia WM8505 reference netbook
+ *
+ * Copyright (C) 2012 Tony Prisk <[email protected]>
+ *
+ * Licensed under GPLv2 or later
+ */
+
+/dts-v1/;
+/include/ "wm8505.dtsi"
+
+/ {
+	model = "Wondermedia WM8505 Netbook";
+
+	/*
+	 * Display node is based on Sascha Hauer's patch on dri-devel.
+	 * Added a bpp property to calculate the size of the framebuffer
+	 * until the binding is formalized.
+	 */
+	display: display {
+		xres = <800>;
+		yres = <480>;
+		left-margin = <88>;
+		right-margin = <40>;
+		hsync-len = <0>;
+		upper-margin = <32>;
+		lower-margin = <11>;
+		vsync-len = <1>;
+		bpp = <32>;
+	};
+};
arch/arm/boot/dts/wm8505.dtsi new file +142 -0

142 lines not on this page · raw message

arch/arm/boot/dts/wm8650-mid.dts new file +31 -0
new file mode 100644
index 0000000..d37dbf0
@@ -0,0 +1,31 @@
+/*
+ * wm8650-mid.dts - Device tree file for Wondermedia WM8650-MID Tablet
+ *
+ * Copyright (C) 2012 Tony Prisk <[email protected]>
+ *
+ * Licensed under GPLv2 or later
+ */
+
+/dts-v1/;
+/include/ "wm8650.dtsi"
+
+/ {
+	model = "Wondermedia WM8650-MID Tablet";
+
+	/*
+	 * Display node is based on Sascha Hauer's patch on dri-devel.
+	 * Added a bpp property to calculate the size of the framebuffer
+	 * until the binding is formalized.
+	 */
+	display: display {
+		xres = <800>;
+		yres = <480>;
+		left-margin = <88>;
+		right-margin = <40>;
+		hsync-len = <0>;
+		upper-margin = <32>;
+		lower-margin = <11>;
+		vsync-len = <1>;
+		bpp = <16>;
+	};
+};
arch/arm/boot/dts/wm8650.dtsi new file +146 -0

146 lines not on this page · raw message

Signature · 1 line
1.7.9.5
author
#2 lore raw

PATCH v4 2/9 rtc: vt8500: Add devicetree support for vt8500-rtc

In reply to Tony Prisk
---
 drivers/rtc/rtc-vt8500.c |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/rtc/rtc-vt8500.c +8 -1
index 9e94fb1..07bf193 100644
@@ -23,6 +23,7 @@
 #include <linux/bcd.h>
 #include <linux/platform_device.h>
 #include <linux/slab.h>
+#include <linux/of.h>
 
 /*
  * Register definitions
@@ -302,12 +303,18 @@ static int __devexit vt8500_rtc_remove(struct platform_device *pdev)
 	return 0;
 }
 
+static const struct of_device_id wmt_dt_ids[] = {
+	{ .compatible = "via,vt8500-rtc", },
+	{}
+};
+
 static struct platform_driver vt8500_rtc_driver = {
 	.probe		= vt8500_rtc_probe,
 	.remove		= __devexit_p(vt8500_rtc_remove),
 	.driver		= {
 		.name	= "vt8500-rtc",
 		.owner	= THIS_MODULE,
+		.of_match_table = of_match_ptr(wmt_dt_ids),
 	},
 };
 
@@ -315,5 +322,5 @@ module_platform_driver(vt8500_rtc_driver);
 
 MODULE_AUTHOR("Alexey Charkov <[email protected]>");
 MODULE_DESCRIPTION("VIA VT8500 SoC Realtime Clock Driver (RTC)");
-MODULE_LICENSE("GPL");
+MODULE_LICENSE("GPL v2");
 MODULE_ALIAS("platform:vt8500-rtc");
Signature · 1 line
1.7.9.5
author
#3 lore raw

PATCH v4 3/9 serial: vt8500: Add devicetree support for vt8500-serial

In reply to Tony Prisk

Increase vt8500_max_ports to 6 as the WM8505 as 6 available uarts. Use devicetree port id as primary addressing for ports but allow auto-allocation if id not specified.

---
 drivers/tty/serial/vt8500_serial.c |   58 ++++++++++++++++++++++++++++++++----
 1 file changed, 53 insertions(+), 5 deletions(-)
drivers/tty/serial/vt8500_serial.c +53 -5
index 2be006f..205d4cf 100644
@@ -34,6 +34,7 @@
 #include <linux/slab.h>
 #include <linux/clk.h>
 #include <linux/platform_device.h>
+#include <linux/of.h>
 
 /*
  * UART Register offsets
@@ -76,6 +77,8 @@
 #define RX_FIFO_INTS	(RXFAF | RXFF | RXOVER | PER | FER | RXTOUT)
 #define TX_FIFO_INTS	(TXFAE | TXFE | TXUDR)
 
+#define VT8500_MAX_PORTS	6
+
 struct vt8500_port {
 	struct uart_port	uart;
 	char			name[16];
@@ -83,6 +86,13 @@ struct vt8500_port {
 	unsigned int		ier;
 };
 
+/*
+ * we use this variable to keep track of which ports
+ * have been allocated as we can't use pdev->id in
+ * devicetree
+ */
+static unsigned long vt8500_ports_in_use;
+
 static inline void vt8500_write(struct uart_port *port, unsigned int val,
 			     unsigned int off)
 {
@@ -431,7 +441,7 @@ static int vt8500_verify_port(struct uart_port *port,
 	return 0;
 }
 
-static struct vt8500_port *vt8500_uart_ports[4];
+static struct vt8500_port *vt8500_uart_ports[VT8500_MAX_PORTS];
 static struct uart_driver vt8500_uart_driver;
 
 #ifdef CONFIG_SERIAL_VT8500_CONSOLE
@@ -548,7 +558,9 @@ static int __devinit vt8500_serial_probe(struct platform_device *pdev)
 {
 	struct vt8500_port *vt8500_port;
 	struct resource *mmres, *irqres;
+	struct device_node *np = pdev->dev.of_node;
 	int ret;
+	int port;
 
 	mmres = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	irqres = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
@@ -559,16 +571,46 @@ static int __devinit vt8500_serial_probe(struct platform_device *pdev)
 	if (!vt8500_port)
 		return -ENOMEM;
 
+	if (np)
+		port = of_alias_get_id(np, "serial");
+		if (port > VT8500_MAX_PORTS)
+			port = -1;
+	else
+		port = -1;
+
+	if (port < 0) {
+		/* calculate the port id */
+		port = find_first_zero_bit(&vt8500_ports_in_use,
+					sizeof(vt8500_ports_in_use));
+	}
+
+	if (port > VT8500_MAX_PORTS)
+		return -ENODEV;
+
+	/* reserve the port id */
+	if (test_and_set_bit(port, &vt8500_ports_in_use)) {
+		/* port already in use - shouldn't really happen */
+		return -EBUSY;
+	}
+
 	vt8500_port->uart.type = PORT_VT8500;
 	vt8500_port->uart.iotype = UPIO_MEM;
 	vt8500_port->uart.mapbase = mmres->start;
 	vt8500_port->uart.irq = irqres->start;
 	vt8500_port->uart.fifosize = 16;
 	vt8500_port->uart.ops = &vt8500_uart_pops;
-	vt8500_port->uart.line = pdev->id;
+	vt8500_port->uart.line = port;
 	vt8500_port->uart.dev = &pdev->dev;
 	vt8500_port->uart.flags = UPF_IOREMAP | UPF_BOOT_AUTOCONF;
-	vt8500_port->uart.uartclk = 24000000;
+
+	vt8500_port->clk = of_clk_get(pdev->dev.of_node, 0);
+	if (vt8500_port->clk) {
+		vt8500_port->uart.uartclk = clk_get_rate(vt8500_port->clk);
+	} else {
+		/* use the default of 24Mhz if not specified and warn */
+		pr_warn("%s: serial clock source not specified\n", __func__);
+		vt8500_port->uart.uartclk = 24000000;
+	}
 
 	snprintf(vt8500_port->name, sizeof(vt8500_port->name),
 		 "VT8500 UART%d", pdev->id);
@@ -579,7 +621,7 @@ static int __devinit vt8500_serial_probe(struct platform_device *pdev)
 		goto err;
 	}
 
-	vt8500_uart_ports[pdev->id] = vt8500_port;
+	vt8500_uart_ports[port] = vt8500_port;
 
 	uart_add_one_port(&vt8500_uart_driver, &vt8500_port->uart);
 
@@ -603,12 +645,18 @@ static int __devexit vt8500_serial_remove(struct platform_device *pdev)
 	return 0;
 }
 
+static const struct of_device_id wmt_dt_ids[] = {
+	{ .compatible = "via,vt8500-uart", },
+	{}
+};
+
 static struct platform_driver vt8500_platform_driver = {
 	.probe  = vt8500_serial_probe,
 	.remove = __devexit_p(vt8500_serial_remove),
 	.driver = {
 		.name = "vt8500_serial",
 		.owner = THIS_MODULE,
+		.of_match_table = of_match_ptr(wmt_dt_ids),
 	},
 };
 
@@ -642,4 +690,4 @@ module_exit(vt8500_serial_exit);
 
 MODULE_AUTHOR("Alexey Charkov <[email protected]>");
 MODULE_DESCRIPTION("Driver for vt8500 serial device");
-MODULE_LICENSE("GPL");
+MODULE_LICENSE("GPL v2");
Signature · 1 line
1.7.9.5
Acked-by on v4 3/9
#4 lore raw

Re: [PATCHv4 3/9] serial: vt8500: Add devicetree support for vt8500-serial

Quoted 3 lines · On Thu, 23 Aug 2012 19:35:39 +1200 Tony Prisk <[email protected]> wrote:

Increase vt8500_max_ports to 6 as the WM8505 as 6 available uarts. Use devicetree port id as primary addressing for ports but allow auto-allocation if id not specified.

for the serial bits

author
#5 lore raw

PATCH v4 4/9 usb: vt8500: Add devicetree support for vt8500-ehci and -uhci.

In reply to Tony Prisk

Add devicetree support for vt8500-ehci.
Convert vt8500-uhci to a generic non-pci platform-uhci with device tree support.

---
 drivers/usb/host/Kconfig         |    4 +-
 drivers/usb/host/ehci-vt8500.c   |   25 ++++--
 drivers/usb/host/uhci-hcd.c      |    5 ++
 drivers/usb/host/uhci-platform.c |  169 ++++++++++++++++++++++++++++++++++++++
 4 files changed, 195 insertions(+), 8 deletions(-)
 create mode 100644 drivers/usb/host/uhci-platform.c
drivers/usb/host/Kconfig +2 -2
index dcfaaa9..d7a6b10 100644
@@ -450,7 +450,7 @@ config USB_OHCI_LITTLE_ENDIAN
 
 config USB_UHCI_HCD
 	tristate "UHCI HCD (most Intel and VIA) support"
-	depends on USB && (PCI || SPARC_LEON)
+	depends on USB && (PCI || SPARC_LEON || ARCH_VT8500)
 	---help---
 	  The Universal Host Controller Interface is a standard by Intel for
 	  accessing the USB hardware in the PC (which is also called the USB
@@ -468,7 +468,7 @@ config USB_UHCI_HCD
 config USB_UHCI_SUPPORT_NON_PCI_HC
 	bool
 	depends on USB_UHCI_HCD
-	default y if SPARC_LEON
+	default y if (SPARC_LEON  || ARCH_VT8500)
 
 config USB_UHCI_BIG_ENDIAN_MMIO
 	bool
drivers/usb/host/ehci-vt8500.c +19 -6
index c1eda73..0e1637b 100644
@@ -16,6 +16,7 @@
  *
  */
 
+#include <linux/of.h>
 #include <linux/platform_device.h>
 
 static int ehci_update_device(struct usb_hcd *hcd, struct usb_device *udev)
@@ -84,20 +85,23 @@ static const struct hc_driver vt8500_ehci_hc_driver = {
 	.clear_tt_buffer_complete	= ehci_clear_tt_buffer_complete,
 };
 
+static u64 wmt_ehci_dma_mask = DMA_BIT_MASK(32);
+
 static int vt8500_ehci_drv_probe(struct platform_device *pdev)
 {
 	struct usb_hcd *hcd;
 	struct ehci_hcd *ehci;
 	struct resource *res;
+	int irq;
 	int ret;
 
 	if (usb_disabled())
 		return -ENODEV;
 
-	if (pdev->resource[1].flags != IORESOURCE_IRQ) {
-		pr_debug("resource[1] is not IORESOURCE_IRQ");
-		return -ENOMEM;
-	}
+	/* devicetree created devices don't specify a dma mask */
+	if (!pdev->dev.dma_mask)
+		pdev->dev.dma_mask = &wmt_ehci_dma_mask;
+
 	hcd = usb_create_hcd(&vt8500_ehci_hc_driver, &pdev->dev, "VT8500");
 	if (!hcd)
 		return -ENOMEM;
@@ -134,8 +138,9 @@ static int vt8500_ehci_drv_probe(struct platform_device *pdev)
 
 	ehci_reset(ehci);
 
-	ret = usb_add_hcd(hcd, pdev->resource[1].start,
-			  IRQF_SHARED);
+	irq = platform_get_irq(pdev, 0);
+
+	ret = usb_add_hcd(hcd, irq, IRQF_SHARED);
 	if (ret == 0) {
 		platform_set_drvdata(pdev, hcd);
 		return ret;
@@ -162,6 +167,11 @@ static int vt8500_ehci_drv_remove(struct platform_device *pdev)
 	return 0;
 }
 
+static const struct of_device_id vt8500_ehci_ids[] = {
+	{ .compatible = "via,vt8500-ehci", },
+	{}
+};
+
 static struct platform_driver vt8500_ehci_driver = {
 	.probe		= vt8500_ehci_drv_probe,
 	.remove		= vt8500_ehci_drv_remove,
@@ -169,7 +179,10 @@ static struct platform_driver vt8500_ehci_driver = {
 	.driver = {
 		.name	= "vt8500-ehci",
 		.owner	= THIS_MODULE,
+		.of_match_table = of_match_ptr(vt8500_ehci_ids),
 	}
 };
 
 MODULE_ALIAS("platform:vt8500-ehci");
+MODULE_LICENSE("GPL v2");
+MODULE_DEVICE_TABLE(of, vt8500_ehci_ids);
drivers/usb/host/uhci-hcd.c +5 -0
index e4db350..5da5c99 100644
@@ -846,6 +846,11 @@ static const char hcd_name[] = "uhci_hcd";
 #define PLATFORM_DRIVER		uhci_grlib_driver
 #endif
 
+#ifdef CONFIG_ARCH_VT8500
+#include "uhci-platform.c"
+#define PLATFORM_DRIVER		uhci_platform_driver
+#endif
+
 #if !defined(PCI_DRIVER) && !defined(PLATFORM_DRIVER)
 #error "missing bus glue for uhci-hcd"
 #endif
drivers/usb/host/uhci-platform.c new file +169 -0

169 lines not on this page · raw message

Signature · 1 line
1.7.9.5
author
#6 lore raw

PATCH v4 5/9 video: vt8500: Add devicetree support for vt8500-fb and wm8505-fb

In reply to Tony Prisk

Update vt8500-fb, wm8505-fb and wmt-ge-rops to support device tree bindings.
Small change in wm8505-fb.c to support WM8650 framebuffer color format.

---
 drivers/video/Kconfig       |    6 +--
 drivers/video/vt8500lcdfb.c |   79 ++++++++++++++++++++++++++++++-----
 drivers/video/wm8505fb.c    |   97 ++++++++++++++++++++++++++++++++++++-------
 drivers/video/wmt_ge_rops.c |    9 +++-
 4 files changed, 161 insertions(+), 30 deletions(-)
drivers/video/Kconfig +3 -3
index 0217f74..b66d951 100644
@@ -1788,7 +1788,7 @@ config FB_AU1200
 
 config FB_VT8500
 	bool "VT8500 LCD Driver"
-	depends on (FB = y) && ARM && ARCH_VT8500 && VTWM_VERSION_VT8500
+	depends on (FB = y) && ARM && ARCH_VT8500
 	select FB_WMT_GE_ROPS
 	select FB_SYS_IMAGEBLIT
 	help
@@ -1797,11 +1797,11 @@ config FB_VT8500
 
 config FB_WM8505
 	bool "WM8505 frame buffer support"
-	depends on (FB = y) && ARM && ARCH_VT8500 && VTWM_VERSION_WM8505
+	depends on (FB = y) && ARM && ARCH_VT8500
 	select FB_WMT_GE_ROPS
 	select FB_SYS_IMAGEBLIT
 	help
-	  This is the framebuffer driver for WonderMedia WM8505
+	  This is the framebuffer driver for WonderMedia WM8505/WM8650
 	  integrated LCD controller.
 
 source "drivers/video/geode/Kconfig"
drivers/video/vt8500lcdfb.c +68 -11

124 lines not on this page · raw message

drivers/video/wm8505fb.c +82 -15

155 lines not on this page · raw message

drivers/video/wmt_ge_rops.c +8 -1
index 55be386..ba025b4 100644
@@ -158,12 +158,18 @@ static int __devexit wmt_ge_rops_remove(struct platform_device *pdev)
 	return 0;
 }
 
+static const struct of_device_id wmt_dt_ids[] = {
+	{ .compatible = "wm,prizm-ge-rops", },
+	{ /* sentinel */ }
+};
+
 static struct platform_driver wmt_ge_rops_driver = {
 	.probe		= wmt_ge_rops_probe,
 	.remove		= __devexit_p(wmt_ge_rops_remove),
 	.driver		= {
 		.owner	= THIS_MODULE,
 		.name	= "wmt_ge_rops",
+		.of_match_table = of_match_ptr(wmt_dt_ids),
 	},
 };
 
@@ -172,4 +178,5 @@ module_platform_driver(wmt_ge_rops_driver);
 MODULE_AUTHOR("Alexey Charkov <[email protected]");
 MODULE_DESCRIPTION("Accelerators for raster operations using "
 		   "WonderMedia Graphics Engine");
-MODULE_LICENSE("GPL");
+MODULE_LICENSE("GPL v2");
+MODULE_DEVICE_TABLE(of, wmt_dt_ids);
Signature · 1 line
1.7.9.5
author
#7 lore raw

PATCH v4 6/9 arm: vt8500: Update arch-vt8500 to devicetree support.

In reply to Tony Prisk

Merged existing board files to a single dt-capable file. Converted irq and timer code to devicetree.
Removed existing device files that are no longer required with devicetree support.
All existing platform devices are converted to devicetree nodes except PWM.

Removed restart.c and moved code into vt8500.c to remove duplicate PMC code.

---
 arch/arm/Kconfig                                |    5 +
 arch/arm/mach-vt8500/Kconfig                    |   72 +-----
 arch/arm/mach-vt8500/Makefile                   |    9 +-
 arch/arm/mach-vt8500/bv07.c                     |   80 -------
 arch/arm/mach-vt8500/common.h                   |   28 +++
 arch/arm/mach-vt8500/devices-vt8500.c           |   91 --------
 arch/arm/mach-vt8500/devices-wm8505.c           |   99 ---------
 arch/arm/mach-vt8500/devices.c                  |  270 -----------------------
 arch/arm/mach-vt8500/devices.h                  |   88 --------
 arch/arm/mach-vt8500/gpio.c                     |  240 --------------------
 arch/arm/mach-vt8500/include/mach/restart.h     |    4 +-
 arch/arm/mach-vt8500/include/mach/vt8500_irqs.h |   88 --------
 arch/arm/mach-vt8500/include/mach/vt8500_regs.h |   79 -------
 arch/arm/mach-vt8500/include/mach/wm8505_irqs.h |  115 ----------
 arch/arm/mach-vt8500/include/mach/wm8505_regs.h |   78 -------
 arch/arm/mach-vt8500/irq.c                      |  209 +++++++++++-------
 arch/arm/mach-vt8500/restart.c                  |   54 -----
 arch/arm/mach-vt8500/timer.c                    |   67 ++++--
 arch/arm/mach-vt8500/vt8500.c                   |  196 ++++++++++++++++
 arch/arm/mach-vt8500/wm8505_7in.c               |   79 -------
 20 files changed, 413 insertions(+), 1538 deletions(-)
 delete mode 100644 arch/arm/mach-vt8500/bv07.c
 create mode 100644 arch/arm/mach-vt8500/common.h
 delete mode 100644 arch/arm/mach-vt8500/devices-vt8500.c
 delete mode 100644 arch/arm/mach-vt8500/devices-wm8505.c
 delete mode 100644 arch/arm/mach-vt8500/devices.c
 delete mode 100644 arch/arm/mach-vt8500/devices.h
 delete mode 100644 arch/arm/mach-vt8500/gpio.c
 delete mode 100644 arch/arm/mach-vt8500/include/mach/vt8500_irqs.h
 delete mode 100644 arch/arm/mach-vt8500/include/mach/vt8500_regs.h
 delete mode 100644 arch/arm/mach-vt8500/include/mach/wm8505_irqs.h
 delete mode 100644 arch/arm/mach-vt8500/include/mach/wm8505_regs.h
 delete mode 100644 arch/arm/mach-vt8500/restart.c
 create mode 100644 arch/arm/mach-vt8500/vt8500.c
 delete mode 100644 arch/arm/mach-vt8500/wm8505_7in.c
arch/arm/Kconfig +5 -0
index 6774c80..ea8ec75 100644
@@ -996,6 +996,10 @@ config ARCH_VT8500
 	select GENERIC_CLOCKEVENTS
 	select ARCH_REQUIRE_GPIOLIB
 	select HAVE_PWM
+	select USE_OF
+	select COMMON_CLK
+	select HAVE_CLK
+	select CLKDEV_LOOKUP
 	help
 	  Support for VIA/WonderMedia VT8500/WM85xx System-on-Chip.
 
@@ -1613,6 +1617,7 @@ config ARCH_NR_GPIO
 	default 355 if ARCH_U8500
 	default 264 if MACH_H4700
 	default 512 if SOC_OMAP5
+	default 288 if ARCH_VT8500
 	default 0
 	help
 	  Maximum number of GPIOs in the system.
arch/arm/mach-vt8500/Kconfig +7 -65

80 lines not on this page · raw message

arch/arm/mach-vt8500/Makefile +2 -7
index 54e6997..1966183 100644
@@ -1,9 +1,4 @@
-obj-y += devices.o gpio.o irq.o timer.o restart.o
-
-obj-$(CONFIG_VTWM_VERSION_VT8500) += devices-vt8500.o
-obj-$(CONFIG_VTWM_VERSION_WM8505) += devices-wm8505.o
-
-obj-$(CONFIG_MACH_BV07) += bv07.o
-obj-$(CONFIG_MACH_WM8505_7IN_NETBOOK) += wm8505_7in.o
+obj-$(CONFIG_VTWM_VERSION_WMT_DT) += irq.o timer.o
+obj-$(CONFIG_MACH_WMT_DT) += vt8500.o
 
 obj-$(CONFIG_HAVE_PWM) += pwm.o
arch/arm/mach-vt8500/bv07.c deleted +0 -80

80 lines not on this page · raw message

arch/arm/mach-vt8500/common.h new file +28 -0
new file mode 100644
index 0000000..2b24196
@@ -0,0 +1,28 @@
+/* linux/arch/arm/mach-vt8500/dt_common.h
+ *
+ * Copyright (C) 2012 Tony Prisk <[email protected]>
+ *
+ * This software is licensed under the terms of the GNU General Public
+ * License version 2, as published by the Free Software Foundation, and
+ * may be copied, distributed, and modified under those terms.
+ *
+ * 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.
+ *
+ */
+
+#ifndef __ARCH_ARM_MACH_VT8500_DT_COMMON_H
+#define __ARCH_ARM_MACH_VT8500_DT_COMMON_H
+
+#include <linux/of.h>
+
+void __init vt8500_timer_init(void);
+int __init vt8500_irq_init(struct device_node *node,
+				struct device_node *parent);
+
+/* defined in drivers/clk/clk-vt8500.c */
+void __init vtwm_clk_init(void __iomem *pmc_base);
+
+#endif
arch/arm/mach-vt8500/devices-vt8500.c deleted +0 -91

91 lines not on this page · raw message

arch/arm/mach-vt8500/devices-wm8505.c deleted +0 -99

99 lines not on this page · raw message

arch/arm/mach-vt8500/devices.c deleted +0 -270

270 lines not on this page · raw message

arch/arm/mach-vt8500/devices.h deleted +0 -88

88 lines not on this page · raw message

arch/arm/mach-vt8500/gpio.c deleted +0 -240

240 lines not on this page · raw message

arch/arm/mach-vt8500/include/mach/restart.h +2 -2
index 89f9b78..7389795 100644
@@ -13,5 +13,5 @@
  *
  */
 
-void wmt_setup_restart(void);
-void wmt_restart(char mode, const char *cmd);
+void vt8500_setup_restart(void);
+void vt8500_restart(char mode, const char *cmd);
arch/arm/mach-vt8500/include/mach/vt8500_irqs.h deleted +0 -88

88 lines not on this page · raw message

arch/arm/mach-vt8500/include/mach/vt8500_regs.h deleted +0 -79

79 lines not on this page · raw message

arch/arm/mach-vt8500/include/mach/wm8505_irqs.h deleted +0 -115

115 lines not on this page · raw message

arch/arm/mach-vt8500/include/mach/wm8505_regs.h deleted +0 -78

78 lines not on this page · raw message

arch/arm/mach-vt8500/irq.c +125 -84

287 lines not on this page · raw message

arch/arm/mach-vt8500/restart.c deleted +0 -54

54 lines not on this page · raw message

arch/arm/mach-vt8500/timer.c +48 -19

131 lines not on this page · raw message

arch/arm/mach-vt8500/vt8500.c new file +196 -0

196 lines not on this page · raw message

arch/arm/mach-vt8500/wm8505_7in.c deleted +0 -79

79 lines not on this page · raw message

Signature · 1 line
1.7.9.5
author
#8 lore raw

PATCH v4 7/9 arm: vt8500: doc: Add device tree bindings for arch-vt8500 devices

In reply to Tony Prisk

Bindings for gpio, interrupt controller, power management controller, timer, realtime clock, serial uart, ehci and uhci controllers and framebuffer controllers used on the arch-vt8500 platform.

Framebuffer binding also specifies a 'display' node which is required for determining the lcd panel data.

---
 Documentation/devicetree/bindings/arm/vt8500.txt   |   15 ++++
 .../bindings/arm/vt8500/via,vt8500-intc.txt        |   16 +++++
 .../bindings/arm/vt8500/via,vt8500-pmc.txt         |   13 ++++
 .../bindings/arm/vt8500/via,vt8500-timer.txt       |   15 ++++
 Documentation/devicetree/bindings/clock/vt8500.txt |   72 ++++++++++++++++++++
 .../devicetree/bindings/gpio/gpio-vt8500.txt       |   24 +++++++
 .../devicetree/bindings/rtc/via,vt8500-rtc.txt     |   15 ++++
 .../bindings/tty/serial/via,vt8500-uart.txt        |   17 +++++
 .../devicetree/bindings/usb/platform-uhci.txt      |   15 ++++
 .../devicetree/bindings/usb/via,vt8500-ehci.txt    |   15 ++++
 .../devicetree/bindings/vendor-prefixes.txt        |    2 +
 .../devicetree/bindings/video/via,vt8500-fb.txt    |   48 +++++++++++++
 .../devicetree/bindings/video/wm,prizm-ge-rops.txt |   13 ++++
 .../devicetree/bindings/video/wm,wm8505-fb.txt     |   22 ++++++
 14 files changed, 302 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/arm/vt8500.txt
 create mode 100644 Documentation/devicetree/bindings/arm/vt8500/via,vt8500-intc.txt
 create mode 100644 Documentation/devicetree/bindings/arm/vt8500/via,vt8500-pmc.txt
 create mode 100644 Documentation/devicetree/bindings/arm/vt8500/via,vt8500-timer.txt
 create mode 100644 Documentation/devicetree/bindings/clock/vt8500.txt
 create mode 100644 Documentation/devicetree/bindings/gpio/gpio-vt8500.txt
 create mode 100644 Documentation/devicetree/bindings/rtc/via,vt8500-rtc.txt
 create mode 100644 Documentation/devicetree/bindings/tty/serial/via,vt8500-uart.txt
 create mode 100644 Documentation/devicetree/bindings/usb/platform-uhci.txt
 create mode 100644 Documentation/devicetree/bindings/usb/via,vt8500-ehci.txt
 create mode 100644 Documentation/devicetree/bindings/video/via,vt8500-fb.txt
 create mode 100644 Documentation/devicetree/bindings/video/wm,prizm-ge-rops.txt
 create mode 100644 Documentation/devicetree/bindings/video/wm,wm8505-fb.txt
Documentation/devicetree/bindings/arm/vt8500.txt new file +15 -0
new file mode 100644
index 0000000..1b3b187
@@ -0,0 +1,15 @@
+VIA/Wondermedia VT8500 Platforms Device Tree Bindings
+---------------------------------------
+
+Boards with the VIA VT8500 SoC shall have the following properties:
+Required root node property:
+compatible = "via,vt8500";
+
+Boards with the Wondermedia WM8505 SoC shall have the following properties:
+Required root node property:
+compatible = "wm,wm8505";
+
+Boards with the Wondermedia WM8650 SoC shall have the following properties:
+Required root node property:
+compatible = "wm,wm8650";
+
Documentation/devicetree/bindings/arm/vt8500/via,vt8500-intc.txt new file +16 -0
new file mode 100644
index 0000000..0a4ce10
@@ -0,0 +1,16 @@
+VIA/Wondermedia VT8500 Interrupt Controller
+-----------------------------------------------------
+
+Required properties:
+- compatible : "via,vt8500-intc"
+- reg : Should contain 1 register ranges(address and length)
+- #interrupt-cells : should be <1>
+
+Example:
+
+	intc: interrupt-controller at d8140000 {
+		compatible = "via,vt8500-intc";
+		interrupt-controller;
+		reg = <0xd8140000 0x10000>;
+		#interrupt-cells = <1>;
+	};
Documentation/devicetree/bindings/arm/vt8500/via,vt8500-pmc.txt new file +13 -0
new file mode 100644
index 0000000..521b9c7
@@ -0,0 +1,13 @@
+VIA/Wondermedia VT8500 Power Management Controller
+-----------------------------------------------------
+
+Required properties:
+- compatible : "via,vt8500-pmc"
+- reg : Should contain 1 register ranges(address and length)
+
+Example:
+
+	pmc at d8130000 {
+		compatible = "via,vt8500-pmc";
+		reg = <0xd8130000 0x1000>;
+	};
Documentation/devicetree/bindings/arm/vt8500/via,vt8500-timer.txt new file +15 -0
new file mode 100644
index 0000000..901c73f
@@ -0,0 +1,15 @@
+VIA/Wondermedia VT8500 Timer
+-----------------------------------------------------
+
+Required properties:
+- compatible : "via,vt8500-timer"
+- reg : Should contain 1 register ranges(address and length)
+- interrupts : interrupt for the timer
+
+Example:
+
+	timer at d8130100 {
+		compatible = "via,vt8500-timer";
+		reg = <0xd8130100 0x28>;
+		interrupts = <36>;
+	};
Documentation/devicetree/bindings/clock/vt8500.txt new file +72 -0

72 lines not on this page · raw message

Documentation/devicetree/bindings/gpio/gpio-vt8500.txt new file +24 -0
new file mode 100644
index 0000000..f4dc523
@@ -0,0 +1,24 @@
+VIA/Wondermedia VT8500 GPIO Controller
+-----------------------------------------------------
+
+Required properties:
+- compatible : "via,vt8500-gpio", "wm,wm8505-gpio"
+	or "wm,wm8650-gpio" depending on your SoC
+- reg : Should contain 1 register range (address and length)
+- #gpio-cells : should be <3>.
+	1) bank
+	2) pin number
+	3) flags - should be 0
+
+Example:
+
+	gpio: gpio-controller at d8110000 {
+		compatible = "via,vt8500-gpio";
+		gpio-controller;
+		reg = <0xd8110000 0x10000>;
+		#gpio-cells = <3>;
+	};
+
+	vibrate {
+		gpios = <&gpio 0 1 0>; /* Bank 0, Pin 1, No flags */
+	};
Documentation/devicetree/bindings/rtc/via,vt8500-rtc.txt new file +15 -0
new file mode 100644
index 0000000..3c0484c
@@ -0,0 +1,15 @@
+VIA/Wondermedia VT8500 Realtime Clock Controller
+-----------------------------------------------------
+
+Required properties:
+- compatible : "via,vt8500-rtc"
+- reg : Should contain 1 register ranges(address and length)
+- interrupts : alarm interrupt
+
+Example:
+
+	rtc at d8100000 {
+		compatible = "via,vt8500-rtc";
+		reg = <0xd8100000 0x10000>;
+		interrupts = <48>;
+	};
Documentation/devicetree/bindings/tty/serial/via,vt8500-uart.txt new file +17 -0
new file mode 100644
index 0000000..5feef1e
@@ -0,0 +1,17 @@
+VIA/Wondermedia VT8500 UART Controller
+-----------------------------------------------------
+
+Required properties:
+- compatible : "via,vt8500-uart"
+- reg : Should contain 1 register ranges(address and length)
+- interrupts : UART interrupt
+- clocks : phandle to the uart source clock (usually a 24Mhz fixed clock)
+
+Example:
+
+	uart at d8210000 {
+		compatible = "via,vt8500-uart";
+		reg = <0xd8210000 0x1040>;
+		interrupts = <47>;
+		clocks = <&ref24>;
+	};
Documentation/devicetree/bindings/usb/platform-uhci.txt new file +15 -0
new file mode 100644
index 0000000..a4fb071
@@ -0,0 +1,15 @@
+Generic Platform UHCI Controller
+-----------------------------------------------------
+
+Required properties:
+- compatible : "platform-uhci"
+- reg : Should contain 1 register ranges(address and length)
+- interrupts : UHCI controller interrupt
+
+Example:
+
+	uhci at d8007b00 {
+		compatible = "platform-uhci";
+		reg = <0xd8007b00 0x200>;
+		interrupts = <43>;
+	};
Documentation/devicetree/bindings/usb/via,vt8500-ehci.txt new file +15 -0
new file mode 100644
index 0000000..17b3ad1
@@ -0,0 +1,15 @@
+VIA/Wondermedia VT8500 EHCI Controller
+-----------------------------------------------------
+
+Required properties:
+- compatible : "via,vt8500-ehci"
+- reg : Should contain 1 register ranges(address and length)
+- interrupts : ehci controller interrupt
+
+Example:
+
+	ehci at d8007900 {
+		compatible = "via,vt8500-ehci";
+		reg = <0xd8007900 0x200>;
+		interrupts = <43>;
+	};
Documentation/devicetree/bindings/vendor-prefixes.txt +2 -0
index db4d3af..5c63da2 100644
@@ -47,5 +47,7 @@ sirf	SiRF Technology, Inc.
 st	STMicroelectronics
 stericsson	ST-Ericsson
 ti	Texas Instruments
+via	VIA Technologies, Inc.
 wlf	Wolfson Microelectronics
+wm	Wondermedia Technologies, Inc.
 xlnx	Xilinx
Documentation/devicetree/bindings/video/via,vt8500-fb.txt new file +48 -0

48 lines not on this page · raw message

Documentation/devicetree/bindings/video/wm,prizm-ge-rops.txt new file +13 -0
new file mode 100644
index 0000000..a850fa0
@@ -0,0 +1,13 @@
+VIA/Wondermedia Graphics Engine Controller
+-----------------------------------------------------
+
+Required properties:
+- compatible : "wm,prizm-ge-rops"
+- reg : Should contain 1 register ranges(address and length)
+
+Example:
+
+	ge_rops at d8050400 {
+		compatible = "wm,prizm-ge-rops";
+		reg = <0xd8050400 0x100>;
+	};
Documentation/devicetree/bindings/video/wm,wm8505-fb.txt new file +22 -0
new file mode 100644
index 0000000..64f016a
@@ -0,0 +1,22 @@
+Wondermedia WM8505 Framebuffer
+-----------------------------------------------------
+
+Required properties:
+- compatible : "wm,wm8505-fb"
+- reg : Should contain 1 register ranges(address and length)
+- via,display: a phandle pointing to the display node
+
+Required nodes:
+- display: a display node is required to initialize the lcd panel
+	This should be in the board dts. See definition in
+	Documentation/devicetree/bindings/video/via,vt8500-fb.txt
+
+
+Example:
+
+	fb at d8050800 {
+		compatible = "wm,wm8505-fb";
+		reg = <0xd8050800 0x200>;
+		via,display = <&display>;
+	};
+
Signature · 1 line
1.7.9.5
#9 lore raw

Re: [PATCHv4 7/9] arm: vt8500: doc: Add device tree bindings for arch-vt8500 devices

Quoted 6 lines · Tony Prisk

Bindings for gpio, interrupt controller, power management controller, timer, realtime clock, serial uart, ehci and uhci controllers and framebuffer controllers used on the arch-vt8500 platform.

Framebuffer binding also specifies a 'display' node which is required for determining the lcd panel data.

Overall, these bindings look okay, but there is some effort to standardize a binding for displays:

http://comments.gmane.org/gmane.linux.drivers.devicetree/21386

I would like to see that used rather than something custom.

Rob

author
#10 lore raw

PATCH v4 8/9 arm: vt8500: gpio: Devicetree support for arch-vt8500

In reply to Tony Prisk

Converted the existing arch-vt8500 gpio to a platform_device. Added support for WM8505 and WM8650 GPIO controllers. Replaced existing readl/writel calls with _relaxed variants. Replaced existing unsigned variables with u32 to match register size.

---
 drivers/gpio/Kconfig       |    6 +
 drivers/gpio/Makefile      |    1 +
 drivers/gpio/gpio-vt8500.c |  316 ++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 323 insertions(+)
 create mode 100644 drivers/gpio/gpio-vt8500.c
drivers/gpio/Kconfig +6 -0
index 542f0c0..3c8897a 100644
@@ -183,6 +183,12 @@ config GPIO_STA2X11
 	  Say yes here to support the STA2x11/ConneXt GPIO device.
 	  The GPIO module has 128 GPIO pins with alternate functions.
 
+config GPIO_VT8500
+	bool "VIA/Wondermedia SoC GPIO Support"
+	depends on ARCH_VT8500
+	help
+	  Say yes here to support the VT8500/WM8505/WM8650 GPIO controller.
+
 config GPIO_XILINX
 	bool "Xilinx GPIO support"
 	depends on PPC_OF || MICROBLAZE
drivers/gpio/Makefile +1 -0
index 0f55662..2c014b9 100644
@@ -66,6 +66,7 @@ obj-$(CONFIG_GPIO_TPS65912)	+= gpio-tps65912.o
 obj-$(CONFIG_GPIO_TWL4030)	+= gpio-twl4030.o
 obj-$(CONFIG_GPIO_UCB1400)	+= gpio-ucb1400.o
 obj-$(CONFIG_GPIO_VR41XX)	+= gpio-vr41xx.o
+obj-$(CONFIG_GPIO_VT8500)	+= gpio-vt8500.o
 obj-$(CONFIG_GPIO_VX855)	+= gpio-vx855.o
 obj-$(CONFIG_GPIO_WM831X)	+= gpio-wm831x.o
 obj-$(CONFIG_GPIO_WM8350)	+= gpio-wm8350.o
drivers/gpio/gpio-vt8500.c new file +316 -0

316 lines not on this page · raw message

Signature · 1 line
1.7.9.5
Reviewed-by on v4 8/9
#11 lore raw

Re: [rtc-linux] [PATCHv4 8/9] arm: vt8500: gpio: Devicetree support for arch-vt8500

Quoted 6 lines · Tony Prisk

Converted the existing arch-vt8500 gpio to a platform_device. Added support for WM8505 and WM8650 GPIO controllers. Replaced existing readl/writel calls with _relaxed variants. Replaced existing unsigned variables with u32 to match register size.

Sweet!

Yours,
Linus Walleij

author
#12 lore raw

PATCH v4 9/9 arm: vt8500: clk: Add Common Clock Framework support

In reply to Tony Prisk

This patch adds common clock framework support for arch-vt8500. Support for PLL and device clocks on VT8500, WM8505 and WM8650 are included.

---
 drivers/clk/Makefile     |    1 +
 drivers/clk/clk-vt8500.c |  511 ++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 512 insertions(+)
 create mode 100644 drivers/clk/clk-vt8500.c
drivers/clk/Makefile +1 -0
index 5869ea3..42fb173 100644
@@ -10,6 +10,7 @@ obj-$(CONFIG_ARCH_SOCFPGA)	+= socfpga/
 obj-$(CONFIG_PLAT_SPEAR)	+= spear/
 obj-$(CONFIG_ARCH_U300)		+= clk-u300.o
 obj-$(CONFIG_ARCH_INTEGRATOR)	+= versatile/
+obj-$(CONFIG_ARCH_VT8500)	+= clk-vt8500.o
 
 # Chip specific
 obj-$(CONFIG_COMMON_CLK_WM831X) += clk-wm831x.o
drivers/clk/clk-vt8500.c new file +511 -0

511 lines not on this page · raw message

Signature · 1 line
1.7.9.5
#13 lore raw
In reply to Tony Prisk
Quoted 4 lines · Tony Prisk

Patchset based on Arnd's arm-soc/for-next branch.

Could I get this reviewed, hopefully for inclusion into v3.7.

I can take them into the arm-soc tree if there are no new comments. For the last two patches, you need to get an Acked-by comment from the gpio and clk maintainers, respectively, or you should send them the patches for inclusion in those subsystem trees.

Arnd

author
#14 lore raw

v4 cover *** ARM: Update arch-vt8500 to Devicetree ***

Quoted 12 lines · Tony Prisk
Quoted 4 lines

Patchset based on Arnd's arm-soc/for-next branch.

Could I get this reviewed, hopefully for inclusion into v3.7.

I can take them into the arm-soc tree if there are no new comments. For the last two patches, you need to get an Acked-by comment from the gpio and clk maintainers, respectively, or you should send them the patches for inclusion in those subsystem trees.

Arnd

Linus W has provided some feedback on the gpio driver - I missed the issues he raised the first time around so just waiting for him to take a look at v4 when he's got time.

I haven't heard from Mike T in regards to the new clock code - He did reply about the original patch (pre-devicetree) but I asked him to hold off reviewing it because it was going to be rewritten.

EHCI/UHCI has gone to -next (on patchv2) via usb-next
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git
There haven't been any changes to it in v3/v4.

GPIO going via another tree isn't really an issue if necessary.

Without the clock patch (9/9), the mach-vt8500 patch (6/9) won't compile due to unresolved symbols.

In arch/arm/mach-vt8500/vt8500.c - you will get an unresolved symbol for 'vtwm_clk_init'

Not sure if this matters, thought I should point it out.
Does it need to compile cleanly in your tree (which is what I would assume), or just once its all combined in -next?
Does it matter that the usb patches are already in -next?

I don't really understand the requirements around submitting to individual trees and which (if any) of these points are actually issues.

Regards

Tony Prisk

#15 lore raw

v4 cover *** ARM: Update arch-vt8500 to Devicetree ***

Quoted 9 lines · Tony Prisk
Quoted 1 line · Tony Prisk

Without the clock patch (9/9), the mach-vt8500 patch (6/9) won't compile due to unresolved symbols.

In arch/arm/mach-vt8500/vt8500.c - you will get an unresolved symbol for 'vtwm_clk_init'

Quoted 7 lines

Not sure if this matters, thought I should point it out.
Does it need to compile cleanly in your tree (which is what I would assume), or just once its all combined in -next?
Does it matter that the usb patches are already in -next?

I don't really understand the requirements around submitting to individual trees and which (if any) of these points are actually issues.

The rule is that each changeset should be free of regressions compared to the version before. So if you have a set of 7 patches in one branch that you want me to pick up, the result after applying those 7 patches should work, and each previous step should also work. You cannot for instance add a call to a function in one patch and then provide that function in the following patch.

There are multiple ways to achieve this:

* when you have dependencies, get everything merged through one maintainer tree, and get Acks for each patch that belongs to another maintainer.

* submit a branch with the patches that other stuff depends on to both the subsystem maintainer who is responsible for it and to the subsystem maintainer who gets the other patches that are built on top of this branch. If you do this, you have to make sure that the first branch never gets rebased and that the second branch is not sent before the first one is upstream.

* change the code so that no dependencies exist, e.g. by introducing a dummy implementation in one patch and the proper one in another. This can generate merge conflicts, but that's usually ok.

Arnd

author
#16 lore raw

v4 cover *** ARM: Update arch-vt8500 to Devicetree ***

Quoted 38 lines · Arnd Bergmann
Quoted 9 lines · Tony Prisk
Quoted 1 line · Tony Prisk

Without the clock patch (9/9), the mach-vt8500 patch (6/9) won't compile due to unresolved symbols.

In arch/arm/mach-vt8500/vt8500.c - you will get an unresolved symbol for 'vtwm_clk_init'

Quoted 7 lines

Not sure if this matters, thought I should point it out.
Does it need to compile cleanly in your tree (which is what I would assume), or just once its all combined in -next?
Does it matter that the usb patches are already in -next?

I don't really understand the requirements around submitting to individual trees and which (if any) of these points are actually issues.

The rule is that each changeset should be free of regressions compared to the version before. So if you have a set of 7 patches in one branch that you want me to pick up, the result after applying those 7 patches should work, and each previous step should also work. You cannot for instance add a call to a function in one patch and then provide that function in the following patch.

There are multiple ways to achieve this:

* when you have dependencies, get everything merged through one maintainer tree, and get Acks for each patch that belongs to another maintainer.

* submit a branch with the patches that other stuff depends on to both the subsystem maintainer who is responsible for it and to the subsystem maintainer who gets the other patches that are built on top of this branch. If you do this, you have to make sure that the first branch never gets rebased and that the second branch is not sent before the first one is upstream.

Quoted 6 lines

* change the code so that no dependencies exist, e.g. by introducing a dummy implementation in one patch and the proper one in another. This can generate merge conflicts, but that's usually ok.

Arnd

I was about to say that if Mike has any issues with the driver that I can fix the patch conflict at the same time, but I just realised that its more work than I originally thought :)

I was going to move the arch-vt8500 part of the clocks patch back into the clocks patch - but that will just move the issue from arm-soc to clocks because Mike's branch won't have the arch-vt8500 patch so the patch will fail.

If Mike is OK with it once the clocks driver is reviewed, it will be a lot easier for the whole lot to go in via arm-soc, otherwise I can try figuring out how to get the arch-vt8500 patch to Mike first, and then the clocks patch.

Regards
Tony Prisk

#17 lore raw

v4 cover *** ARM: Update arch-vt8500 to Devicetree ***

Quoted 8 lines · Tony Prisk

I was about to say that if Mike has any issues with the driver that I can fix the patch conflict at the same time, but I just realised that its more work than I originally thought :)

I was going to move the arch-vt8500 part of the clocks patch back into the clocks patch - but that will just move the issue from arm-soc to clocks because Mike's branch won't have the arch-vt8500 patch so the patch will fail.

But that's ok, because without the arch-v8500 part, nothing uses the vt8500-clock driver, so nothing breaks. You can introduce broken code in the meantime as long as it's impossible to enable and it will work afterwards.

Arnd

author
#18 lore raw

v4 cover *** ARM: Update arch-vt8500 to Devicetree ***

Quoted 10 lines · Arnd Bergmann
Quoted 8 lines · Tony Prisk

I was about to say that if Mike has any issues with the driver that I can fix the patch conflict at the same time, but I just realised that its more work than I originally thought :)

I was going to move the arch-vt8500 part of the clocks patch back into the clocks patch - but that will just move the issue from arm-soc to clocks because Mike's branch won't have the arch-vt8500 patch so the patch will fail.

Quoted 6 lines

But that's ok, because without the arch-v8500 part, nothing uses the vt8500-clock driver, so nothing breaks. You can introduce broken code in the meantime as long as it's impossible to enable and it will work afterwards.

Arnd

You lost me a little bit there :)
If it stays as is now, the arch-vt8500 patch will introduce an unresolved symbol.
If I move the clock code from the arch-vt8500 patch to the clock patch, then the clock patch won't apply because it needs the arch-vt8500 patch first and Mike won't have that patch, but it would be fine if both patches went in via your tree.

Or are you saying to apply the clock patch as is before the arch-vt8500 patch?

Tony P

maintainer
#19 lore raw

v4 cover *** ARM: Update arch-vt8500 to Devicetree ***

2012/8/24 Tony Prisk <[email protected]>:

Quoted 18 lines · Arnd Bergmann
Quoted 10 lines · Tony Prisk
Quoted 8 lines

I was about to say that if Mike has any issues with the driver that I can fix the patch conflict at the same time, but I just realised that its more work than I originally thought :)

I was going to move the arch-vt8500 part of the clocks patch back into the clocks patch - but that will just move the issue from arm-soc to clocks because Mike's branch won't have the arch-vt8500 patch so the patch will fail.

Quoted 6 lines

But that's ok, because without the arch-v8500 part, nothing uses the vt8500-clock driver, so nothing breaks. You can introduce broken code in the meantime as long as it's impossible to enable and it will work afterwards.

Arnd

Quoted 7 lines

You lost me a little bit there :)
If it stays as is now, the arch-vt8500 patch will introduce an unresolved symbol.
If I move the clock code from the arch-vt8500 patch to the clock patch, then the clock patch won't apply because it needs the arch-vt8500 patch first and Mike won't have that patch, but it would be fine if both patches went in via your tree.

Why don't you add a #define in the first patch that makes your to-be-unresolved symbol a no-op and then drop it within the clock patch?

Best,
Alexey

author
#20 lore raw

v4 cover *** ARM: Update arch-vt8500 to Devicetree ***

Quoted 27 lines · Alexey Charkov

2012/8/24 Tony Prisk <[email protected]>:

Quoted 18 lines · Arnd Bergmann
Quoted 10 lines · Tony Prisk
Quoted 8 lines

I was about to say that if Mike has any issues with the driver that I can fix the patch conflict at the same time, but I just realised that its more work than I originally thought :)

I was going to move the arch-vt8500 part of the clocks patch back into the clocks patch - but that will just move the issue from arm-soc to clocks because Mike's branch won't have the arch-vt8500 patch so the patch will fail.

Quoted 6 lines

But that's ok, because without the arch-v8500 part, nothing uses the vt8500-clock driver, so nothing breaks. You can introduce broken code in the meantime as long as it's impossible to enable and it will work afterwards.

Arnd

Quoted 7 lines

You lost me a little bit there :)
If it stays as is now, the arch-vt8500 patch will introduce an unresolved symbol.
If I move the clock code from the arch-vt8500 patch to the clock patch, then the clock patch won't apply because it needs the arch-vt8500 patch first and Mike won't have that patch, but it would be fine if both patches went in via your tree.

Quoted 7 lines

Why don't you add a #define in the first patch that makes your to-be-unresolved symbol a no-op and then drop it within the clock patch?

Best,
Alexey

I knew we kept you around for a reason :)

Cheers,
Tony P

author
#21 lore raw

v4 cover *** ARM: Update arch-vt8500 to Devicetree ***

In reply to Alexey Charkov
Quoted 27 lines · Alexey Charkov

2012/8/24 Tony Prisk <[email protected]>:

Quoted 18 lines · Arnd Bergmann
Quoted 10 lines · Tony Prisk
Quoted 8 lines

I was about to say that if Mike has any issues with the driver that I can fix the patch conflict at the same time, but I just realised that its more work than I originally thought :)

I was going to move the arch-vt8500 part of the clocks patch back into the clocks patch - but that will just move the issue from arm-soc to clocks because Mike's branch won't have the arch-vt8500 patch so the patch will fail.

Quoted 6 lines

But that's ok, because without the arch-v8500 part, nothing uses the vt8500-clock driver, so nothing breaks. You can introduce broken code in the meantime as long as it's impossible to enable and it will work afterwards.

Arnd

Quoted 7 lines

You lost me a little bit there :)
If it stays as is now, the arch-vt8500 patch will introduce an unresolved symbol.
If I move the clock code from the arch-vt8500 patch to the clock patch, then the clock patch won't apply because it needs the arch-vt8500 patch first and Mike won't have that patch, but it would be fine if both patches went in via your tree.

Quoted 7 lines

Why don't you add a #define in the first patch that makes your to-be-unresolved symbol a no-op and then drop it within the clock patch?

Best,
Alexey

Actually - that doesn't resolve the problem unless it all goes in via the same tree still because the clock patch can only drop the #define if the arch-vt8500 patch exists still - same as problem #2 I mentioned.

If the clock patch goes via Mikes tree he will need the arch-vt8500 patch as well - don't think it can be avoided.

Still easier to send the whole lot via arm-soc, then at least we can resolve the patch conflicts without having to apply the patches twice.

Regards
Tony P

#22 lore raw
In reply to Tony Prisk
Quoted 3 lines · Tony Prisk

Linus W has provided some feedback on the gpio driver - I missed the issues he raised the first time around so just waiting for him to take a look at v4 when he's got time.

Reviewed and OK:ed, looking good now.

Yours,
Linus Walleij

#23 lore raw
In reply to Tony Prisk
Quoted 14 lines · Tony Prisk

This patchset updates arch-vt8500 to devicetree and removes all the old-style code. Support for WM8650 has also been added.

Example dts/dtsi files are given for the three currently supported models.

Major changes:

GPIO code has been converted to a platform_device and rewritten as WM8505 support was broken. Add support for WM8650 gpio controller.

UHCI support was missing. Added this as a generic non-pci uhci controller as it doesn't require anything special. Should be usable by any system that doesn't have special requirements to get the UHCI controller working.

Quoted 6 lines

Framebuffer code patched to support WM8650. The bindings for this are of concern but there doesn't seem to be a formalized binding yet. This patch is based off Sascha Hauer's current patch on the dri-devel mailing list and should be easily patched out when its finalized.

Patchset based on Arnd's arm-soc/for-next branch.

I believe all the issues I pointed out are fixed in this series. I'm not sure I reviewed it in enough detail to ack it, but I'm fine with what I saw.