Skip to contentSkip to conversation

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

PATCH Superseded Tony Prisk 6 participants 18 messages Aug 21, 2012 – Aug 23, 2012

Subsystems (12)

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore

Tony Prisk

author
#0 lore raw

v3 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.

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        |   15 +
 .../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                      |  100 ++++
 arch/arm/boot/dts/wm8505-ref.dts                   |   31 ++
 arch/arm/boot/dts/wm8505.dtsi                      |  126 +++++
 arch/arm/boot/dts/wm8650-mid.dts                   |   31 ++
 arch/arm/boot/dts/wm8650.dtsi                      |  138 ++++++
 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                           |  496 ++++++++++++++++++++
 drivers/gpio/Kconfig                               |    6 +
 drivers/gpio/Makefile                              |    1 +
 drivers/gpio/gpio-vt8500.c                         |  313 ++++++++++++
 drivers/rtc/rtc-vt8500.c                           |    9 +-
 drivers/tty/serial/vt8500_serial.c                 |   37 +-
 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, 2384 insertions(+), 1581 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 v3 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     |  100 +++++++++++++++++++++++++++
 arch/arm/boot/dts/wm8505-ref.dts  |   31 +++++++++
 arch/arm/boot/dts/wm8505.dtsi     |  126 +++++++++++++++++++++++++++++++++
 arch/arm/boot/dts/wm8650-mid.dts  |   31 +++++++++
 arch/arm/boot/dts/wm8650.dtsi     |  138 +++++++++++++++++++++++++++++++++++++
 6 files changed, 457 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 +100 -0

100 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 +126 -0

126 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 +138 -0

138 lines not on this page · raw message

Signature · 1 line
1.7.9.5
author
#2 lore raw

PATCH v3 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 v3 3/9 serial: vt8500: Add devicetree support for vt8500-serial

In reply to Tony Prisk
---
 drivers/tty/serial/vt8500_serial.c |   37 ++++++++++++++++++++++++++++++++----
 1 file changed, 33 insertions(+), 4 deletions(-)
drivers/tty/serial/vt8500_serial.c +33 -4
index 2be006f..72e32db 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
@@ -549,6 +559,7 @@ static int __devinit vt8500_serial_probe(struct platform_device *pdev)
 	struct vt8500_port *vt8500_port;
 	struct resource *mmres, *irqres;
 	int ret;
+	int port;
 
 	mmres = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	irqres = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
@@ -559,13 +570,25 @@ static int __devinit vt8500_serial_probe(struct platform_device *pdev)
 	if (!vt8500_port)
 		return -ENOMEM;
 
+	/* 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;
@@ -579,7 +602,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 +626,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 +671,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
author
#8 lore raw

PATCH v3 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
#9 lore raw

PATCH v3 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
#10 lore raw

PATCH v3 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
#11 lore raw

PATCH v3 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        |   15 ++++
 .../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, 300 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..1a122bf
@@ -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
+
+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 +15 -0
new file mode 100644
index 0000000..3222502
@@ -0,0 +1,15 @@
+VIA/Wondermedia VT8500 UART Controller
+-----------------------------------------------------
+
+Required properties:
+- compatible : "via,vt8500-uart"
+- reg : Should contain 1 register ranges(address and length)
+- interrupts : UART interrupt
+
+Example:
+
+	uart at d8210000 {
+		compatible = "via,vt8500-uart";
+		reg = <0xd8210000 0x1040>;
+		interrupts = <47>;
+	};
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
author
#14 lore raw

PATCH v3 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.

---
 drivers/gpio/Kconfig       |    6 +
 drivers/gpio/Makefile      |    1 +
 drivers/gpio/gpio-vt8500.c |  313 ++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 320 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 +313 -0

313 lines not on this page · raw message

Signature · 1 line
1.7.9.5
author
#17 lore raw

PATCH v3 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 |  496 ++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 497 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 +496 -0

496 lines not on this page · raw message

Signature · 1 line
1.7.9.5
#4 lore raw

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

In reply to Tony Prisk
Quoted 4 lines · On Wed, 22 Aug 2012 08:47:32 +1200 Tony Prisk <[email protected]> wrote:
---
 drivers/tty/serial/vt8500_serial.c |   37 ++++++++++++++++++++++++++++++++----
 1 file changed, 33 insertions(+), 4 deletions(-)

Can we have a comment attached to a change this size. In particular one describing why it gone from 4 to 6 ports, and why the port id twiddling.

Is there a reason you can't use the device tree port id ?

What are the regression risks for existing users expecting the pdev->id binding ?

author
#5 lore raw

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

Quoted 13 lines · Alan Cox
Quoted 4 lines · On Wed, 22 Aug 2012 08:47:32 +1200 Tony Prisk <[email protected]> wrote:
---
 drivers/tty/serial/vt8500_serial.c |   37 ++++++++++++++++++++++++++++++++----
 1 file changed, 33 insertions(+), 4 deletions(-)

Can we have a comment attached to a change this size. In particular one describing why it gone from 4 to 6 ports, and why the port id twiddling.

Is there a reason you can't use the device tree port id ?

Quoted 7 lines

What are the regression risks for existing users expecting the pdev->id binding ?

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

Sorry Alan,

The original patch was very simple, but I revisited it to fix other issues and forgot to add the relevant comments.

Port size is changed to fix a problem - WM8505 actually had 6 uart's defined in platform data but the vt8500_ports variable was only 4.

I have added devicetree port id support as well.

No regression risks as the entire platform is being converted to devicetree and existing code dropped in this patchset.

Patchv4 3/9 to follow.

Regards

Tony Prisk

#6 lore raw

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

Quoted 7 lines · Tony Prisk

The original patch was very simple, but I revisited it to fix other issues and forgot to add the relevant comments.

Port size is changed to fix a problem - WM8505 actually had 6 uart's defined in platform data but the vt8500_ports variable was only 4.

I have added devicetree port id support as well.

If you do multiple things in one driver, you should normally send multiple patches as well, each with a description why that change is done. It may seem silly at first to send out a one-line patch next to a 100-line patch for the same file, but those cases are actually the ones where it's most important.

Arnd

#15 lore raw

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

In reply to Tony Prisk
Quoted 2 lines · Tony Prisk

Converted the existing arch-vt8500 gpio to a platform_device. Added support for WM8505 and WM8650 GPIO controllers.

(...)

Quoted 1 line

+ unsigned val;

I asked about the datatype for this "val", it sure isn't "unsigned".

I suspected the registers were only 8bit and so it should be u8. But atleast use u32 if you must use all these bits.

(...)

drivers/gpio/gpio-vt8500.c line 141

Quoted 3 lines
drivers/gpio/gpio-vt8500.c new file +3 -0
+       val = readl(vt8500_chip->base + vt8500_chip->regs->en);
+       val |= BIT(offset);
+       writel(val, vt8500_chip->base + vt8500_chip->regs->en);

BTW: have you considered [readl|writel]_relaxed?

Yours,
Linus Walleij

author
#16 lore raw

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

Quoted 9 lines
Quoted 2 lines

Converted the existing arch-vt8500 gpio to a platform_device. Added support for WM8505 and WM8650 GPIO controllers.

(...)

Quoted 1 line

+ unsigned val;

I asked about the datatype for this "val", it sure isn't "unsigned".

I suspected the registers were only 8bit and so it should be u8. But atleast use u32 if you must use all these bits.

Sorry - missed adding this to my list of fixes. I've used u32 as the datasheet advises these are 32-bit registers and must be read/written as such.
Changes included in v4.

Quoted 6 lines

(...)

drivers/gpio/gpio-vt8500.c line 141

Quoted 3 lines
drivers/gpio/gpio-vt8500.c new file +3 -0
+       val = readl(vt8500_chip->base + vt8500_chip->regs->en);
+       val |= BIT(offset);
+       writel(val, vt8500_chip->base + vt8500_chip->regs->en);

BTW: have you considered [readl|writel]_relaxed?

I haven't - and to be honest I didn't know what difference it would make until I read up on it.
Most of this code already existed in mainline in arch/arm/mach-vt8500/gpio.c and I simply moved it across to drivers/gpio and made some changes/additions. Having looked, I don't see any reason why it can't use the _relaxed variants. Changes included in v4.

I'll post up v4 for review when I get home in about 7 hours.

Work always gets in the way of being productive :)

Regards

Tony Prisk

#12 lore raw

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

In reply to Tony Prisk

Documentation/devicetree/bindings/gpio/gpio_vt8500.txt line 11

Quoted 13 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.

Documentation/devicetree/bindings/gpio/gpio_vt8500.txt +4 -0
 
+- #gpio-cells : should be <3>.
+	1) bank
+	2) pin number
+	3) flags

Should this enumerate what legal values are for flags, or point at a standard document that does?

Documentation/devicetree/bindings/tty/serial/via,vt8500-uart.txt line 15

Quoted 7 lines
Documentation/devicetree/bindings/tty/serial/via,vt8500-uart.txt +5 -0
 
+	uart at d8210000 {
+		compatible = "via,vt8500-uart";
+		reg = <0xd8210000 0x1040>;
+		interrupts = <47>;
+	};

How does the UART know what frequency its clock input is, in order to calculate dividers? Should there be a clocks property to link to the input clock, so the rate can be queried? If so, a reference to the common clock binding, plus a specification of which clocks must be listed in the clock property should be included here.

Quoted 5 lines
Documentation/devicetree/bindings/video/via,vt8500-fb.txt +3 -0
 
+VIA VT8500 Display
+-----------------------------------------------------
+Required properties:

Documentation/devicetree/bindings/video/via,vt8500-fb.txt line 35

Quoted 10 lines
Documentation/devicetree/bindings/video/via,vt8500-fb.txt +10 -0
+- xres : lcd panel horizontal resolution
+- yres : lcd panel vertical resolution
+- left-margin,
+- right-margin,
+- hsync-len: lcd panel horizontal timings in pixels
+- upper-margin,
+- lower-margin,
+- vsync-len: lcd panel verticals timings in pixels
+- bpp: lcd panel bit-depth.
+	<16> for RGB565, <32> for RGB888

Shouldn't this reference Sascha Hauer's binding document (although I suppose it isn't checked in yet), and just document the additions? I wonder if this binding should be written assuming Sascha's binding doc will be checked in?

author
#13 lore raw

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

Quoted 10 lines · Stephen Warren
Quoted 8 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.

Documentation/devicetree/bindings/gpio/gpio_vt8500.txt +0 -0
Quoted 7 lines

Documentation/devicetree/bindings/gpio/gpio_vt8500.txt line 11

Quoted 4 lines

+- #gpio-cells : should be <3>.

Documentation/devicetree/bindings/gpio/gpio_vt8500.txt +3 -0
+	1) bank
+	2) pin number
+	3) flags

Should this enumerate what legal values are for flags, or point at a standard document that does?

There currently are no supported flags - guess this was an oversight. I'll take a look if there are any that we might require in the future and implement them otherwise I'll drop the flags reference.

Quoted 15 lines

Documentation/devicetree/bindings/tty/serial/via,vt8500-uart.txt line 15

Quoted 8 lines
Documentation/devicetree/bindings/tty/serial/via,vt8500-uart.txt +5 -0
 
+	uart at d8210000 {
+		compatible = "via,vt8500-uart";
+		reg = <0xd8210000 0x1040>;
+		interrupts = <47>;
+	};

How does the UART know what frequency its clock input is, in order to calculate dividers? Should there be a clocks property to link to the input clock, so the rate can be queried? If so, a reference to the common clock binding, plus a specification of which clocks must be listed in the clock property should be included here.

I didn't revisit the code that had already been posted in v1/v2 when I added the common clock code and there was no clock handling code at that point. The uart's are all clocked via a clkgen that outputs 24Mhz and this was hardcoded in the driver.
I will correct this and add the appropriate device tree entries and documentation.

Quoted 12 lines
Quoted 12 lines
Documentation/devicetree/bindings/video/via,vt8500-fb.txt +10 -0
 
+VIA VT8500 Display
+-----------------------------------------------------
+Required properties:
+- xres : lcd panel horizontal resolution
+- yres : lcd panel vertical resolution
+- left-margin,
+- right-margin,
+- hsync-len: lcd panel horizontal timings in pixels
+- upper-margin,
+- lower-margin,
Quoted 8 lines

Documentation/devicetree/bindings/video/via,vt8500-fb.txt line 35

Quoted 3 lines
+- vsync-len: lcd panel verticals timings in pixels
+- bpp: lcd panel bit-depth.
Documentation/devicetree/bindings/video/via,vt8500-fb.txt +1 -0
+	<16> for RGB565, <32> for RGB888

Shouldn't this reference Sascha Hauer's binding document (although I suppose it isn't checked in yet), and just document the additions? I wonder if this binding should be written assuming Sascha's binding doc will be checked in?

I haven't seen Sascha's binding yet - I'm not even sure its been agreed upon but it does seem to be the most likely candidate so far. Hopefully it will get accepted in this window, and I will have time to do exactly as you commented, which was the plan from the start. This binding was based on the most current one I had seen suggested at the time.

Given the additional comments for this patch set, and the required changes I'll hold off posting v4 until everything is tidied up.

Regards

Tony Prisk

#7 lore raw

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

In reply to Arnd Bergmann
Quoted 7 lines · Arnd Bergmann
Quoted 6 lines · Tony Prisk

The original patch was very simple, but I revisited it to fix other issues and forgot to add the relevant comments.

Port size is changed to fix a problem - WM8505 actually had 6 uart's defined in platform data but the vt8500_ports variable was only 4.

Quoted 7 lines
Quoted 1 line

I have added devicetree port id support as well.

If you do multiple things in one driver, you should normally send multiple patches as well, each with a description why that change is done. It may seem silly at first to send out a one-line patch next to a 100-line patch for the same file, but those cases are actually the ones where it's most important.

Think of us poor git-bisect monkeys who have no idea why something broke but can (purely mechanically) figure out which commit did it. If it's a patch that does three unrelated things, we're kinda stuck.

Rob

Signature · 2 lines
GNU/Linux isn't: Linux=GPLv2, GNU=GPLv3+, they can't share code.
Either it's "mere aggregation", or a license violation.  Pick one.