Skip to contentSkip to conversation

ARM: Add basic architecture support for VIA/WonderMedia 85xx SoC's

PATCH Superseded Alexey Charkov 5 participants 27 messages Oct 20, 2010 – Nov 1, 2010

Subsystems (10)

v1 of 12 Superseded Latest is v12 →

lore
Share & tools
lore

Alexey Charkov

author maintainer
#0 lore raw

PATCH 1/6 ARM: Add basic architecture support for VIA/WonderMedia 85xx SoC's

This adds support for the family of Systems-on-Chip produced initially by VIA and now its subsidiary WonderMedia that have recently become widespread in lower-end Chinese ARM-based tablets and netbooks.

Support is included for both VT8500 and WM8505, selectable by a configuration switch at kernel build time.

Included are basic machine initialization files, register and interrupt definitions, support for the on-chip interrupt controller, high-precision OS timer, GPIO lines, necessary macros for early debug, pulse-width-modulated outputs control, as well as platform device configurations for the specific drivers implemented elsewhere.

---

Please review and state whether this could be acceptable for a merge to mainline in the coming 2.6.37 window. If possible, I would deeply appreciate a merge to a relevant git tree for integration prior to asking Linus to pull the changes. I could rebase the code if needed, currently this is against Linus' master branch.

Due credits go to the community for providing feedback, advice and testing for all code in this patch and the follow-ups.

 arch/arm/Kconfig                                |   14 +
 arch/arm/Makefile                               |    1 +
 arch/arm/boot/compressed/Makefile               |    4 +
 arch/arm/boot/compressed/head-vt8500.S          |   46 +++
 arch/arm/mach-vt8500/Kconfig                    |   56 ++++
 arch/arm/mach-vt8500/Makefile                   |    6 +
 arch/arm/mach-vt8500/Makefile.boot              |    3 +
 arch/arm/mach-vt8500/bv07.c                     |   80 +++++
 arch/arm/mach-vt8500/devices.c                  |  393 +++++++++++++++++++++++
 arch/arm/mach-vt8500/devices.h                  |   58 ++++
 arch/arm/mach-vt8500/gpio.c                     |  226 +++++++++++++
 arch/arm/mach-vt8500/include/mach/debug-macro.S |   35 ++
 arch/arm/mach-vt8500/include/mach/entry-macro.S |   32 ++
 arch/arm/mach-vt8500/include/mach/gpio.h        |    6 +
 arch/arm/mach-vt8500/include/mach/hardware.h    |   12 +
 arch/arm/mach-vt8500/include/mach/io.h          |   28 ++
 arch/arm/mach-vt8500/include/mach/irqs.h        |  189 +++++++++++
 arch/arm/mach-vt8500/include/mach/memory.h      |   28 ++
 arch/arm/mach-vt8500/include/mach/system.h      |   20 ++
 arch/arm/mach-vt8500/include/mach/timex.h       |   26 ++
 arch/arm/mach-vt8500/include/mach/uncompress.h  |   37 +++
 arch/arm/mach-vt8500/include/mach/vmalloc.h     |   20 ++
 arch/arm/mach-vt8500/include/mach/vt8500.h      |  143 ++++++++
 arch/arm/mach-vt8500/include/mach/vt8500fb.h    |   31 ++
 arch/arm/mach-vt8500/irq.c                      |  126 ++++++++
 arch/arm/mach-vt8500/pwm.c                      |  250 ++++++++++++++
 arch/arm/mach-vt8500/timer.c                    |  192 +++++++++++
 arch/arm/mach-vt8500/wm8505_7in.c               |   81 +++++
 28 files changed, 2143 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/boot/compressed/head-vt8500.S
 create mode 100644 arch/arm/mach-vt8500/Kconfig
 create mode 100644 arch/arm/mach-vt8500/Makefile
 create mode 100644 arch/arm/mach-vt8500/Makefile.boot
 create mode 100644 arch/arm/mach-vt8500/bv07.c
 create mode 100644 arch/arm/mach-vt8500/devices.c
 create mode 100644 arch/arm/mach-vt8500/devices.h
 create mode 100644 arch/arm/mach-vt8500/gpio.c
 create mode 100644 arch/arm/mach-vt8500/include/mach/debug-macro.S
 create mode 100644 arch/arm/mach-vt8500/include/mach/entry-macro.S
 create mode 100644 arch/arm/mach-vt8500/include/mach/gpio.h
 create mode 100644 arch/arm/mach-vt8500/include/mach/hardware.h
 create mode 100644 arch/arm/mach-vt8500/include/mach/io.h
 create mode 100644 arch/arm/mach-vt8500/include/mach/irqs.h
 create mode 100644 arch/arm/mach-vt8500/include/mach/memory.h
 create mode 100644 arch/arm/mach-vt8500/include/mach/system.h
 create mode 100644 arch/arm/mach-vt8500/include/mach/timex.h
 create mode 100644 arch/arm/mach-vt8500/include/mach/uncompress.h
 create mode 100644 arch/arm/mach-vt8500/include/mach/vmalloc.h
 create mode 100644 arch/arm/mach-vt8500/include/mach/vt8500.h
 create mode 100644 arch/arm/mach-vt8500/include/mach/vt8500fb.h
 create mode 100644 arch/arm/mach-vt8500/irq.c
 create mode 100644 arch/arm/mach-vt8500/pwm.c
 create mode 100644 arch/arm/mach-vt8500/timer.c
 create mode 100644 arch/arm/mach-vt8500/wm8505_7in.c
arch/arm/Kconfig +14 -0
index 9c26ba7..90f0142 100644
@@ -824,6 +824,18 @@ config PLAT_SPEAR
 	help
 	  Support for ST's SPEAr platform (SPEAr3xx, SPEAr6xx and SPEAr13xx).
 
+config ARCH_VT8500
+	bool "VIA/WonderMedia 85xx"
+	select CPU_ARM926T
+	select GENERIC_GPIO
+	select ARCH_HAS_CPUFREQ
+	select GENERIC_TIME
+	select GENERIC_CLOCKEVENTS
+	select ARCH_REQUIRE_GPIOLIB
+	select HAVE_CLK
+	select HAVE_PWM
+	help
+	  Support for VIA/WonderMedia VT8500/WM85xx System-on-Chip.
 endchoice
 
 #
@@ -952,6 +964,8 @@ source "arch/arm/mach-versatile/Kconfig"
 
 source "arch/arm/mach-vexpress/Kconfig"
 
+source "arch/arm/mach-vt8500/Kconfig"
+
 source "arch/arm/mach-w90x900/Kconfig"
 
 # Definitions to make life easier
arch/arm/Makefile +1 -0
index 59c1ce8..65ae7ee 100644
@@ -188,6 +188,7 @@ machine-$(CONFIG_ARCH_U300)		:= u300
 machine-$(CONFIG_ARCH_U8500)		:= ux500
 machine-$(CONFIG_ARCH_VERSATILE)	:= versatile
 machine-$(CONFIG_ARCH_VEXPRESS)		:= vexpress
+machine-$(CONFIG_ARCH_VT8500)		:= vt8500
 machine-$(CONFIG_ARCH_W90X900)		:= w90x900
 machine-$(CONFIG_ARCH_NUC93X)		:= nuc93x
 machine-$(CONFIG_FOOTBRIDGE)		:= footbridge
arch/arm/boot/compressed/Makefile +4 -0
index 65a7c1c..62cade4 100644
@@ -29,6 +29,10 @@ ifeq ($(CONFIG_ARCH_SA1100),y)
 OBJS		+= head-sa1100.o
 endif
 
+ifeq ($(CONFIG_ARCH_VT8500),y)
+OBJS		+= head-vt8500.o
+endif
+
 ifeq ($(CONFIG_CPU_XSCALE),y)
 OBJS		+= head-xscale.o
 endif
arch/arm/boot/compressed/head-vt8500.S new file +46 -0

46 lines not on this page · raw message

arch/arm/mach-vt8500/Kconfig new file +56 -0

56 lines not on this page · raw message

arch/arm/mach-vt8500/Makefile new file +6 -0
new file mode 100644
index 0000000..17e0841
@@ -0,0 +1,6 @@
+obj-y += devices.o gpio.o irq.o timer.o
+
+obj-$(CONFIG_MACH_BV07) += bv07.o
+obj-$(CONFIG_MACH_WM8505_7IN_NETBOOK) += wm8505_7in.o
+
+obj-$(CONFIG_HAVE_PWM) += pwm.o
arch/arm/mach-vt8500/Makefile.boot new file +3 -0
new file mode 100644
index 0000000..a8acc4e
@@ -0,0 +1,3 @@
+   zreladdr-y	:= 0x00008000
+params_phys-y	:= 0x00000100
+initrd_phys-y	:= 0x01000000
arch/arm/mach-vt8500/bv07.c new file +80 -0

80 lines not on this page · raw message

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

393 lines not on this page · raw message

arch/arm/mach-vt8500/devices.h new file +58 -0

58 lines not on this page · raw message

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

226 lines not on this page · raw message

arch/arm/mach-vt8500/include/mach/debug-macro.S new file +35 -0
new file mode 100644
index 0000000..264e0be
@@ -0,0 +1,35 @@
+/*
+ * arch/arm/mach-vt8500/include/mach/debug-macro.S
+ *
+ *  Copyright (C) 2010 Alexey Charkov <[email protected]>
+ *
+ * Debugging macro include header
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+*/
+
+#include <mach/vt8500.h>
+
+	.macro	addruart, rx, tmp
+	mrc	p15, 0, \rx, c1, c0
+	tst	\rx, #1			@ MMU enabled?
+	moveq	\rx,      #0xd8000000
+	movne	\rx,      #0xf8000000	@ virtual base
+	orr	\rx, \rx, #0x00200000
+	.endm
+
+	.macro	senduart,rd,rx
+	strb	\rd, [\rx, #0]
+	.endm
+
+	.macro	busyuart,rd,rx
+1001:	ldr	\rd, [\rx, #0x1c]
+	ands	\rd, \rd, #0x2
+	bne	1001b
+	.endm
+
+	.macro	waituart,rd,rx
+	.endm
arch/arm/mach-vt8500/include/mach/entry-macro.S new file +32 -0
new file mode 100644
index 0000000..92684c7
@@ -0,0 +1,32 @@
+/*
+ * arch/arm/mach-vt8500/include/mach/entry-macro.S
+ *
+ * Low-level IRQ helper macros for VIA VT8500
+ *
+ * This file is licensed under  the terms of the GNU General Public
+ * License version 2. This program is licensed "as is" without any
+ * warranty of any kind, whether express or implied.
+ */
+
+	.macro	disable_fiq
+	.endm
+
+	.macro  get_irqnr_preamble, base, tmp
+	@ physical 0xd8140000 is virtual 0xf8140000
+	mov	\base, #0xf8000000
+	orr	\base, \base, #0x00140000
+	.endm
+
+	.macro  arch_ret_to_user, tmp1, tmp2
+	.endm
+
+	.macro	get_irqnr_and_base, irqnr, irqstat, base, tmp
+	ldr	\irqnr, [\base]
+	cmp	\irqnr, #63 @ may be false positive, check interrupt status
+	bne	1001f
+	ldr	\irqstat, [\base, #0x84]
+	ands	\irqstat, #0x80000000
+	moveq	\irqnr, #0
+1001:
+	.endm
+
arch/arm/mach-vt8500/include/mach/gpio.h new file +6 -0
new file mode 100644
index 0000000..94ff276
@@ -0,0 +1,6 @@
+#include <asm-generic/gpio.h>
+
+#define gpio_get_value	__gpio_get_value
+#define gpio_set_value	__gpio_set_value
+#define gpio_cansleep	__gpio_cansleep
+#define gpio_to_irq	__gpio_to_irq
arch/arm/mach-vt8500/include/mach/hardware.h new file +12 -0
new file mode 100644
index 0000000..db4163f
@@ -0,0 +1,12 @@
+/* arch/arm/mach-vt8500/include/mach/hardware.h
+ *
+ * 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.
+ *
+ */
arch/arm/mach-vt8500/include/mach/io.h new file +28 -0
new file mode 100644
index 0000000..dc2181a
@@ -0,0 +1,28 @@
+/*
+ *  arch/arm/mach-vt8500/include/mach/io.h
+ *
+ *  Copyright (C) 2003 ARM Limited
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+#ifndef __ASM_ARM_ARCH_IO_H
+#define __ASM_ARM_ARCH_IO_H
+
+#define IO_SPACE_LIMIT 0xffffffff
+
+#define __io(a)		__typesafe_io(a)
+#define __mem_pci(a)	(a)
+
+#endif
arch/arm/mach-vt8500/include/mach/irqs.h new file +189 -0

189 lines not on this page · raw message

arch/arm/mach-vt8500/include/mach/memory.h new file +28 -0
new file mode 100644
index 0000000..175f914
@@ -0,0 +1,28 @@
+/*
+ *  arch/arm/mach-vt8500/include/mach/memory.h
+ *
+ *  Copyright (C) 2003 ARM Limited
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+#ifndef __ASM_ARCH_MEMORY_H
+#define __ASM_ARCH_MEMORY_H
+
+/*
+ * Physical DRAM offset.
+ */
+#define PHYS_OFFSET	UL(0x00000000)
+
+#endif
arch/arm/mach-vt8500/include/mach/system.h new file +20 -0
new file mode 100644
index 0000000..0289fcc
@@ -0,0 +1,20 @@
+/*
+ * arch/arm/mach-vt8500/include/mach/system.h
+ *
+ */
+#include <mach/hardware.h>
+#include <mach/vt8500.h>
+#include <asm/io.h>
+
+/* PM Software Reset request register */
+#define VT8500_PMSR_OFFSET	0x60
+
+static inline void arch_idle(void)
+{
+	cpu_do_idle();
+}
+
+static inline void arch_reset(char mode, const char *cmd)
+{
+	writel(1, ioremap(VT8500_PMC_BASE + VT8500_PMSR_OFFSET, 4));
+}
arch/arm/mach-vt8500/include/mach/timex.h new file +26 -0
new file mode 100644
index 0000000..8487e4c
@@ -0,0 +1,26 @@
+/*
+ *  arch/arm/mach-vt8500/include/mach/timex.h
+ *
+ *  Copyright (C) 2010 Alexey Charkov <[email protected]>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#ifndef MACH_TIMEX_H
+#define MACH_TIMEX_H
+
+#define CLOCK_TICK_RATE		(3000000)
+
+#endif /* MACH_TIMEX_H */
arch/arm/mach-vt8500/include/mach/uncompress.h new file +37 -0
new file mode 100644
index 0000000..e5d6436
@@ -0,0 +1,37 @@
+/* arch/arm/mach-vt8500/include/mach/uncompress.h
+ *
+ * Copyright (C) 2010 Alexey Charkov <[email protected]>
+ *
+ * Based on arch/arm/mach-dove/include/mach/uncompress.h
+ *
+ * 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.
+ *
+ */
+
+#include <mach/vt8500.h>
+#include <asm/io.h>
+
+static void putc(const char c)
+{
+	while (readb(VT8500_UART0_BASE + 0x1c) & 0x2)
+		/* Tx busy, wait and poll */;
+
+	writeb(c, VT8500_UART0_BASE);
+}
+
+static void flush(void)
+{
+}
+
+/*
+ * nothing to do
+ */
+#define arch_decomp_setup()
+#define arch_decomp_wdog()
arch/arm/mach-vt8500/include/mach/vmalloc.h new file +20 -0
new file mode 100644
index 0000000..75a6912
@@ -0,0 +1,20 @@
+/*
+ *  arch/arm/mach-vt8500/include/mach/vmalloc.h
+ *
+ *  Copyright (C) 2000 Russell King.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+#define VMALLOC_END		(PAGE_OFFSET + 0x10000000)
arch/arm/mach-vt8500/include/mach/vt8500.h new file +143 -0

143 lines not on this page · raw message

arch/arm/mach-vt8500/include/mach/vt8500fb.h new file +31 -0
new file mode 100644
index 0000000..cc7f25e
@@ -0,0 +1,31 @@
+/*
+ *  VT8500/WM8505 Frame Buffer platform data definitions
+ *
+ *  Copyright (C) 2010 Ed Spiridonov <[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 _VT8500FB_H
+#define _VT8500FB_H
+
+#include <linux/fb.h>
+
+struct vt8500fb_platform_data {
+	struct fb_videomode	mode;
+	__u32			xres_virtual;
+	__u32			yres_virtual;
+	__u32			bpp;
+	unsigned long		video_mem_phys;
+	void			*video_mem_virt;
+	unsigned long		video_mem_len;
+};
+
+#endif /* _VT8500FB_H */
arch/arm/mach-vt8500/irq.c new file +126 -0

126 lines not on this page · raw message

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

250 lines not on this page · raw message

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

192 lines not on this page · raw message

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

81 lines not on this page · raw message

Signature · 1 line
1.7.3.1
author maintainer
#1 lore raw

PATCH 2/6 serial: Add support for UART on VIA VT8500 and compatibles

This adds a driver for the serial ports found in VIA and WonderMedia Systems-on-Chip. Interrupt-driven FIFO operation is implemented. The hardware also supports pure register-based operation (which is slower) and DMA-based FIFO operation. As the FIFOs are only 16 bytes long, DMA operation is probably not worth the hassle.

---

Please review and state whether this could be acceptable for a merge to mainline in the coming 2.6.37 window. If possible, I would deeply appreciate a merge to a relevant git tree for integration prior to asking Linus to pull the changes. I could rebase the code if needed, currently this is against Linus' master branch.

This patch relies on the basic architecture support for VT8500/WM8505 to be in place, as introduced by PATCH 1/6 in this series.

Due credits go to the community for providing feedback, advice and testing.

NB: The development is being done at:
http://gitorious.org/linux-on-via-vt8500/vt8500-kernel

Relevant code may be pulled from a git tree in there.

 drivers/serial/Kconfig         |   10 +
 drivers/serial/Makefile        |    1 +
 drivers/serial/vt8500_serial.c |  637 ++++++++++++++++++++++++++++++++++++++++
 include/linux/serial_core.h    |    3 +
 4 files changed, 651 insertions(+), 0 deletions(-)
 create mode 100644 drivers/serial/vt8500_serial.c
drivers/serial/Kconfig +10 -0
index 12900f7..a04e6b3 100644
@@ -1387,6 +1387,16 @@ config SERIAL_MSM_CONSOLE
 	depends on SERIAL_MSM=y
 	select SERIAL_CORE_CONSOLE
 
+config SERIAL_VT8500
+	bool "VIA VT8500 on-chip serial port support"
+	depends on ARM && ARCH_VT8500
+	select SERIAL_CORE
+
+config SERIAL_VT8500_CONSOLE
+	bool "VIA VT8500 serial console support"
+	depends on SERIAL_VT8500=y
+	select SERIAL_CORE_CONSOLE
+
 config SERIAL_NETX
 	tristate "NetX serial port support"
 	depends on ARM && ARCH_NETX
drivers/serial/Makefile +1 -0
index 1ca4fd5..d7c836c 100644
@@ -86,5 +86,6 @@ obj-$(CONFIG_SERIAL_TIMBERDALE)	+= timbuart.o
 obj-$(CONFIG_SERIAL_GRLIB_GAISLER_APBUART) += apbuart.o
 obj-$(CONFIG_SERIAL_ALTERA_JTAGUART) += altera_jtaguart.o
 obj-$(CONFIG_SERIAL_ALTERA_UART) += altera_uart.o
+obj-$(CONFIG_SERIAL_VT8500) += vt8500_serial.o
 obj-$(CONFIG_SERIAL_MRST_MAX3110)	+= mrst_max3110.o
 obj-$(CONFIG_SERIAL_MFD_HSU)	+= mfd.o
drivers/serial/vt8500_serial.c new file +637 -0

637 lines not on this page · raw message

include/linux/serial_core.h +3 -0
index 563e234..d641853 100644
@@ -196,6 +196,9 @@
 /* High Speed UART for Medfield */
 #define PORT_MFD	95
 
+/* VIA VT8500 SoC */
+#define PORT_VT8500	96
+
 #ifdef __KERNEL__
 
 #include <linux/compiler.h>
Signature · 1 line
1.7.3.1
author maintainer
#6 lore raw

PATCH 3/6 input: Add support for VIA VT8500 and compatibles in i8042

In reply to Alexey Charkov

VIA and WonderMedia Systems-on-Chip feature a standard i8042-compatible keyboard and mouse controller. This adds necessary glue to enable use of the standard driver with these systems.

---

Please review and state whether this could be acceptable for a merge to mainline in the coming 2.6.37 window. If possible, I would deeply appreciate a merge to a relevant git tree for integration prior to asking Linus to pull the changes. I could rebase the code if needed, currently this is against Linus' master branch.

This patch relies on the basic architecture support for VT8500/WM8505 to be in place, as introduced by PATCH 1/6 in this series.

Due credits go to the community for providing feedback, advice and testing.

NB: The development is being done at:
http://gitorious.org/linux-on-via-vt8500/vt8500-kernel

Relevant code may be pulled from a git tree in there.

 drivers/input/serio/Kconfig        |    3 +-
 drivers/input/serio/i8042-vt8500.h |   71 ++++++++++++++++++++++++++++++++++++
 drivers/input/serio/i8042.h        |    2 +
 3 files changed, 75 insertions(+), 1 deletions(-)
 create mode 100644 drivers/input/serio/i8042-vt8500.h
drivers/input/serio/Kconfig +2 -1
index 3bfe8fa..2b86774 100644
@@ -21,7 +21,8 @@ if SERIO
 config SERIO_I8042
 	tristate "i8042 PC Keyboard controller" if EMBEDDED || !X86
 	default y
-	depends on !PARISC && (!ARM || ARCH_SHARK || FOOTBRIDGE_HOST) && \
+	depends on !PARISC && \
+		  (!ARM || ARCH_SHARK || ARCH_VT8500 || FOOTBRIDGE_HOST) && \
 		   (!SUPERH || SH_CAYMAN) && !M68K && !BLACKFIN
 	help
 	  i8042 is the chip over which the standard AT keyboard and PS/2
drivers/input/serio/i8042-vt8500.h new file +71 -0

71 lines not on this page · raw message

drivers/input/serio/i8042.h +2 -0
index cbc1beb..bdb2aeb 100644
@@ -16,6 +16,8 @@
 
 #if defined(CONFIG_MACH_JAZZ)
 #include "i8042-jazzio.h"
+#elif defined(CONFIG_ARCH_VT8500)
+#include "i8042-vt8500.h"
 #elif defined(CONFIG_SGI_HAS_I8042)
 #include "i8042-ip22io.h"
 #elif defined(CONFIG_SNI_RM)
Signature · 1 line
1.7.3.1
author maintainer
#13 lore raw

PATCH 4/6 usb: Add support for VIA VT8500 and compatibles in EHCI HCD

In reply to Alexey Charkov

VIA and WonderMedia Systems-on-Chip feature a standard EHCI host controller. This adds necessary glue to use the standard driver with these systems.

---

Please review and state whether this could be acceptable for a merge to mainline in the coming 2.6.37 window. If possible, I would deeply appreciate a merge to a relevant git tree for integration prior to asking Linus to pull the changes. I could rebase the code if needed, currently this is against Linus' master branch.

This patch relies on the basic architecture support for VT8500/WM8505 to be in place, as introduced by PATCH 1/6 in this series.

Due credits go to the community for providing feedback, advice and testing.

NB: The development is being done at:
http://gitorious.org/linux-on-via-vt8500/vt8500-kernel

Relevant code may be pulled from a git tree in there.

 drivers/usb/Kconfig            |    1 +
 drivers/usb/host/ehci-hcd.c    |    5 +
 drivers/usb/host/ehci-vt8500.c |  173 ++++++++++++++++++++++++++++++++++++++++
 3 files changed, 179 insertions(+), 0 deletions(-)
 create mode 100644 drivers/usb/host/ehci-vt8500.c
drivers/usb/Kconfig +1 -0
index 4aa00e6..6858637 100644
@@ -65,6 +65,7 @@ config USB_ARCH_HAS_EHCI
 	default y if ARCH_AT91SAM9G45
 	default y if ARCH_MXC
 	default y if ARCH_OMAP3
+	default y if ARCH_VT8500
 	default PCI
 
 # ARM SA1111 chips have a non-PCI based "OHCI-compatible" USB host interface.
drivers/usb/host/ehci-hcd.c +5 -0
index 34a928d..2015b02 100644
@@ -1197,6 +1197,11 @@ MODULE_LICENSE ("GPL");
 #define	PLATFORM_DRIVER		ehci_atmel_driver
 #endif
 
+#ifdef CONFIG_ARCH_VT8500
+#include "ehci-vt8500.c"
+#define	PLATFORM_DRIVER		vt8500_ehci_driver
+#endif
+
 #if !defined(PCI_DRIVER) && !defined(PLATFORM_DRIVER) && \
     !defined(PS3_SYSTEM_BUS_DRIVER) && !defined(OF_PLATFORM_DRIVER) && \
     !defined(XILINX_OF_PLATFORM_DRIVER)
drivers/usb/host/ehci-vt8500.c new file +173 -0

173 lines not on this page · raw message

Signature · 1 line
1.7.3.1
author maintainer
#18 lore raw

PATCH 5/6 rtc: Add support for the RTC in VIA VT8500 and compatibles

In reply to Alexey Charkov

This adds a driver for the RTC devices in VIA and WonderMedia Systems-on-Chip. Alarm, 1Hz interrupts, reading and setting time are supported.

---

Please review and state whether this could be acceptable for a merge to mainline in the coming 2.6.37 window. If possible, I would deeply appreciate a merge to a relevant git tree for integration prior to asking Linus to pull the changes. I could rebase the code if needed, currently this is against Linus' master branch.

This patch relies on the basic architecture support for VT8500/WM8505 to be in place, as introduced by PATCH 1/6 in this series.

Due credits go to the community for providing feedback, advice and testing.

NB: The development is being done at:
http://gitorious.org/linux-on-via-vt8500/vt8500-kernel

Relevant code may be pulled from a git tree in there.

 drivers/rtc/Kconfig      |    7 +
 drivers/rtc/Makefile     |    1 +
 drivers/rtc/rtc-vt8500.c |  363 ++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 371 insertions(+), 0 deletions(-)
 create mode 100644 drivers/rtc/rtc-vt8500.c
drivers/rtc/Kconfig +7 -0
index 48ca713..b87a2f9 100644
@@ -854,6 +854,13 @@ config RTC_DRV_PXA
          This RTC driver uses PXA RTC registers available since pxa27x
          series (RDxR, RYxR) instead of legacy RCNR, RTAR.
 
+config RTC_DRV_VT8500
+	tristate "VIA/WonderMedia 85xx SoC RTC"
+	depends on ARCH_VT8500
+	help
+	  If you say Y here you will get access to the real time clock
+	  built into your VIA VT8500 SoC or its relatives.
+
 
 config RTC_DRV_SUN4V
 	bool "SUN4V Hypervisor RTC"
drivers/rtc/Makefile +1 -0
index 0f207b3..0c09922 100644
@@ -95,6 +95,7 @@ obj-$(CONFIG_RTC_DRV_TWL4030)	+= rtc-twl.o
 obj-$(CONFIG_RTC_DRV_TX4939)	+= rtc-tx4939.o
 obj-$(CONFIG_RTC_DRV_V3020)	+= rtc-v3020.o
 obj-$(CONFIG_RTC_DRV_VR41XX)	+= rtc-vr41xx.o
+obj-$(CONFIG_RTC_DRV_VT8500)	+= rtc-vt8500.o
 obj-$(CONFIG_RTC_DRV_WM831X)	+= rtc-wm831x.o
 obj-$(CONFIG_RTC_DRV_WM8350)	+= rtc-wm8350.o
 obj-$(CONFIG_RTC_DRV_X1205)	+= rtc-x1205.o
drivers/rtc/rtc-vt8500.c new file +363 -0

363 lines not on this page · raw message

Signature · 1 line
1.7.3.1
author maintainer
#19 lore raw

PATCH 6/6 ARM: Add support for the display controllers in VT8500 and WM8505

In reply to Alexey Charkov

This adds drivers for the LCD controller found in VIA VT8500 SoC, GOVR display controller found in WonderMedia WM8505 SoC and for the Graphics Engine present in both of them that provides hardware accelerated raster operations (used for copyarea and fillrect).

---

Please review and state whether this could be acceptable for a merge to mainline in the coming 2.6.37 window. If possible, I would deeply appreciate a merge to a relevant git tree for integration prior to asking Linus to pull the changes. I could rebase the code if needed, currently this is against Linus' master branch.

This patch relies on the basic architecture support for VT8500/WM8505 to be in place, as introduced by PATCH 1/6 in this series. Both framebuffer drivers are independent (and never end up together in one system), but both depend on wmt_ge_rops for raster acceleration.

Due credits go to the community for providing feedback, advice and testing. Driver for WM8505 is by Ed Spiridonov, as stated in the relevant copyright header, parts modified by myself.

Invaluable work wrt the Graphics Engine documentation has been done by Giuseppe Gatta aka nextvolume. Also special thanks go to Angus Gratton aka projectgus for convincing VIA to partly release GPL kernel sources for the vendor-provided images, which greatly helped in understanding some parts of WM8505's complex video handling chain.

NB: The development is being done at:
http://gitorious.org/linux-on-via-vt8500/vt8500-kernel

Relevant code may be pulled from a git tree in there.

 drivers/video/Kconfig         |   26 +++
 drivers/video/Makefile        |    3 +
 drivers/video/vt8500lcdfb.c   |  452 +++++++++++++++++++++++++++++++++++++++++
 drivers/video/vt8500lcdfb.h   |   34 +++
 drivers/video/wm8505fb.c      |  438 +++++++++++++++++++++++++++++++++++++++
 drivers/video/wm8505fb_regs.h |   76 +++++++
 drivers/video/wmt_ge_rops.c   |  186 +++++++++++++++++
 drivers/video/wmt_ge_rops.h   |    5 +
 8 files changed, 1220 insertions(+), 0 deletions(-)
 create mode 100644 drivers/video/vt8500lcdfb.c
 create mode 100644 drivers/video/vt8500lcdfb.h
 create mode 100644 drivers/video/wm8505fb.c
 create mode 100644 drivers/video/wm8505fb_regs.h
 create mode 100644 drivers/video/wmt_ge_rops.c
 create mode 100644 drivers/video/wmt_ge_rops.h
drivers/video/Kconfig +26 -0
index 8b31fdf..cd3e481 100644
@@ -184,6 +184,14 @@ config FB_SYS_FOPS
        depends on FB
        default n
 
+config FB_WMT_GE_ROPS
+	tristate
+	depends on FB
+	default n
+	---help---
+	  Include functions for accelerated rectangle filling and area
+	  copying using WonderMedia Graphics Engine operations.
+
 config FB_DEFERRED_IO
 	bool
 	depends on FB
@@ -1720,6 +1728,24 @@ config FB_AU1200
 	  various panels and CRTs by passing in kernel cmd line option
 	  au1200fb:panel=<name>.
 
+config FB_VT8500
+	bool "VT8500 LCD Driver"
+	depends on (FB = y) && ARM && ARCH_VT8500 && VTWM_VERSION_VT8500
+	select FB_WMT_GE_ROPS
+	select FB_SYS_IMAGEBLIT
+	help
+	  This is the framebuffer driver for VIA VT8500 integrated LCD
+	  controller.
+
+config FB_WM8505
+	bool "WM8505 frame buffer support"
+	depends on (FB = y) && ARM && ARCH_VT8500 && VTWM_VERSION_WM8505
+	select FB_WMT_GE_ROPS
+	select FB_SYS_IMAGEBLIT
+	help
+	  This is the framebuffer driver for WonderMedia WM8505
+	  integrated LCD controller.
+
 source "drivers/video/geode/Kconfig"
 
 config FB_HIT
drivers/video/Makefile +3 -0
index 485e8ed..8d916dc 100644
@@ -26,6 +26,7 @@ obj-$(CONFIG_FB_SVGALIB)       += svgalib.o
 obj-$(CONFIG_FB_MACMODES)      += macmodes.o
 obj-$(CONFIG_FB_DDC)           += fb_ddc.o
 obj-$(CONFIG_FB_DEFERRED_IO)   += fb_defio.o
+obj-$(CONFIG_FB_WMT_GE_ROPS)   += wmt_ge_rops.o
 
 # Hardware specific drivers go first
 obj-$(CONFIG_FB_AMIGA)            += amifb.o c2p_planar.o
@@ -104,6 +105,8 @@ obj-$(CONFIG_FB_W100)		  += w100fb.o
 obj-$(CONFIG_FB_TMIO)		  += tmiofb.o
 obj-$(CONFIG_FB_AU1100)		  += au1100fb.o
 obj-$(CONFIG_FB_AU1200)		  += au1200fb.o
+obj-$(CONFIG_FB_VT8500)		  += vt8500lcdfb.o
+obj-$(CONFIG_FB_WM8505)		  += wm8505fb.o
 obj-$(CONFIG_FB_PMAG_AA)	  += pmag-aa-fb.o
 obj-$(CONFIG_FB_PMAG_BA)	  += pmag-ba-fb.o
 obj-$(CONFIG_FB_PMAGB_B)	  += pmagb-b-fb.o
drivers/video/vt8500lcdfb.c new file +452 -0

452 lines not on this page · raw message

drivers/video/vt8500lcdfb.h new file +34 -0
new file mode 100644
index 0000000..36ca3ca
@@ -0,0 +1,34 @@
+/*
+ *  linux/drivers/video/vt8500lcdfb.h
+ *
+ *  Copyright (C) 2010 Alexey Charkov <[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.
+ */
+
+struct vt8500lcd_info {
+	struct fb_info		fb;
+	void __iomem		*regbase;
+	void __iomem		*palette_cpu;
+	dma_addr_t		palette_phys;
+	size_t			palette_size;
+	wait_queue_head_t	wait;
+};
+
+static int bpp_values[] = {
+	1,
+	2,
+	4,
+	8,
+	12,
+	16,
+	18,
+	24,
+};
drivers/video/wm8505fb.c new file +438 -0

438 lines not on this page · raw message

drivers/video/wm8505fb_regs.h new file +76 -0

76 lines not on this page · raw message

drivers/video/wmt_ge_rops.c new file +186 -0

186 lines not on this page · raw message

drivers/video/wmt_ge_rops.h new file +5 -0
new file mode 100644
index 0000000..8738075
@@ -0,0 +1,5 @@
+extern void wmt_ge_fillrect(struct fb_info *info,
+			    const struct fb_fillrect *rect);
+extern void wmt_ge_copyarea(struct fb_info *info,
+			    const struct fb_copyarea *area);
+extern int wmt_ge_sync(struct fb_info *info);
Signature · 1 line
1.7.3.1
maintainer
#7 lore raw

Re: [PATCH 3/6] input: Add support for VIA VT8500 and compatibles in i8042

In reply to Alexey Charkov
Quoted 7 lines · Alexey Charkov

VIA and WonderMedia Systems-on-Chip feature a standard i8042-compatible keyboard and mouse controller. This adds necessary glue to enable use of the standard driver with these systems.

---

Quoted 8 lines

Please review and state whether this could be acceptable for a merge to mainline in the coming 2.6.37 window. If possible, I would deeply appreciate a merge to a relevant git tree for integration prior to asking Linus to pull the changes. I could rebase the code if needed, currently this is against Linus' master branch.

This patch relies on the basic architecture support for VT8500/WM8505 to be in place, as introduced by PATCH 1/6 in this series.

What tree this code will be coming through through?

drivers/input/serio/i8042-vt8500.h line 61

Quoted 4 lines
drivers/input/serio/i8042-vt8500.h new file +4 -0
+
+static inline int i8042_platform_init(void)
+{
+	i8042_reset = 1;

= true; - it's a boolean.

drivers/input/serio/i8042-vt8500.h line 62

Quoted 1 line
drivers/input/serio/i8042-vt8500.h new file +1 -0
+	regbase = ioremap(VT8500_PS2_BASE, SZ_1K);

Error handling?

Thanks.

Signature · 1 line
Dmitry
#2 lore raw

Re: [PATCH 2/6] serial: Add support for UART on VIA VT8500 and compatibles

In reply to Alexey Charkov
Quoted 11 lines · Alexey Charkov

This adds a driver for the serial ports found in VIA and WonderMedia Systems-on-Chip. Interrupt-driven FIFO operation is implemented. The hardware also supports pure register-based operation (which is slower) and DMA-based FIFO operation. As the FIFOs are only 16 bytes long, DMA operation is probably not worth the hassle.

---

Please review and state whether this could be acceptable for a merge to mainline in the coming 2.6.37 window.

.37? Aren't you cutting it a bit close here? My trees unofficially closed a few days or so ago for new stuff to go to .37, what kept this from being sent previously?

Quoted 7 lines

If possible, I would deeply appreciate a merge to a relevant git tree for integration prior to asking Linus to pull the changes. I could rebase the code if needed, currently this is against Linus' master branch.

This patch relies on the basic architecture support for VT8500/WM8505 to be in place, as introduced by PATCH 1/6 in this series.

So it will just fail to build without that patch?

thanks,

greg k-h

#14 lore raw

Re: [PATCH 4/6] usb: Add support for VIA VT8500 and compatibles in EHCI HCD

In reply to Alexey Charkov
Quoted 7 lines · Alexey Charkov

VIA and WonderMedia Systems-on-Chip feature a standard EHCI host controller. This adds necessary glue to use the standard driver with these systems.

---

Quoted 8 lines

Please review and state whether this could be acceptable for a merge to mainline in the coming 2.6.37 window. If possible, I would deeply appreciate a merge to a relevant git tree for integration prior to asking Linus to pull the changes. I could rebase the code if needed, currently this is against Linus' master branch.

This patch relies on the basic architecture support for VT8500/WM8505 to be in place, as introduced by PATCH 1/6 in this series.

Will this code fail to build without that patch?

thanks,

greg k-h

author maintainer
#8 lore raw

Re: [PATCH 3/6] input: Add support for VIA VT8500 and compatibles in i8042

In reply to Dmitry Torokhov

2010/10/21 Dmitry Torokhov <[email protected]>

Quoted 15 lines · Alexey Charkov
Quoted 13 lines

VIA and WonderMedia Systems-on-Chip feature a standard i8042-compatible keyboard and mouse controller. This adds necessary glue to enable use of the standard driver with these systems.

---

Please review and state whether this could be acceptable for a merge to mainline in the coming 2.6.37 window. If possible, I would deeply appreciate a merge to a relevant git tree for integration prior to asking Linus to pull the changes. I could rebase the code if needed, currently this is against Linus' master branch.

Quoted 5 lines
Quoted 2 lines

This patch relies on the basic architecture support for VT8500/WM8505 to be in place, as introduced by PATCH 1/6 in this series.

What tree this code will be coming through through?

Should be Russel King's ARM tree, probably. The whole series is CC'd to linux-arm-kernel and to the relevant subsystems maintainers, as I was instructed to do at a previous submission attempt.

Quoted 7 lines

drivers/input/serio/i8042-vt8500.h

Quoted 4 lines
drivers/input/serio/i8042-vt8500.h new file +4 -0
+
+static inline int i8042_platform_init(void)
+{
+ ? ? i8042_reset = 1;

= true; - it's a boolean.

Got it, thanks.

Quoted 4 lines
Quoted 1 line

+ ? ? regbase = ioremap(VT8500_PS2_BASE, SZ_1K);

Error handling?

Ok, I've missed this. Will be fixed.

Quoted 4 lines

Thanks.

--
Dmitry

Thanks for your review, Dmitry! Are there any other issues with this or is it otherwise good enough to receive your Ack?

author maintainer
#3 lore raw

Re: [PATCH 2/6] serial: Add support for UART on VIA VT8500 and compatibles

In reply to Greg KH

2010/10/21 Greg KH <[email protected]>:

Quoted 10 lines · Alexey Charkov
Quoted 9 lines

This adds a driver for the serial ports found in VIA and WonderMedia Systems-on-Chip. Interrupt-driven FIFO operation is implemented. The hardware also supports pure register-based operation (which is slower) and DMA-based FIFO operation. As the FIFOs are only 16 bytes long, DMA operation is probably not worth the hassle.

---

Quoted 7 lines
Quoted 2 lines

Please review and state whether this could be acceptable for a merge to mainline in the coming 2.6.37 window.

.37? ?Aren't you cutting it a bit close here? ?My trees unofficially closed a few days or so ago for new stuff to go to .37, what kept this from being sent previously?

In fact, I'm somewhat new to kernel development, and have not yet understood the good timings to do things properly. My view was that the merge window is when new stuff should be submitted, while everything in between is devoted to fixing breakage just introduced. So, I must have been wrong :)

Quoted 10 lines
Quoted 7 lines

If possible, I would deeply appreciate a merge to a relevant git tree for integration prior to asking Linus to pull the changes. I could rebase the code if needed, currently this is against Linus' master branch.

This patch relies on the basic architecture support for VT8500/WM8505 to be in place, as introduced by PATCH 1/6 in this series.

So it will just fail to build without that patch?

It won't, and it should not even be selectable, as there is a Kconfig dependency on the relevant arch. It's just that it would be useless without the relevant arch support.

Quoted 4 lines

thanks,

greg k-h

author maintainer
#9 lore raw

PATCH v2 3/6 input: Add support for VIA VT8500 and compatibles in i8042

In reply to Dmitry Torokhov

VIA and WonderMedia Systems-on-Chip feature a standard i8042-compatible keyboard and mouse controller. This adds necessary glue to enable use of the standard driver with these systems.

---

This is to incorporate fixes to issues noted by Dmitry at the first attempt.

 drivers/input/serio/Kconfig        |    3 +-
 drivers/input/serio/i8042-vt8500.h |   74 ++++++++++++++++++++++++++++++++++++
 drivers/input/serio/i8042.h        |    2 +
 3 files changed, 78 insertions(+), 1 deletions(-)
 create mode 100644 drivers/input/serio/i8042-vt8500.h
drivers/input/serio/Kconfig +2 -1
index 3bfe8fa..2b86774 100644
@@ -21,7 +21,8 @@ if SERIO
 config SERIO_I8042
 	tristate "i8042 PC Keyboard controller" if EMBEDDED || !X86
 	default y
-	depends on !PARISC && (!ARM || ARCH_SHARK || FOOTBRIDGE_HOST) && \
+	depends on !PARISC && \
+		  (!ARM || ARCH_SHARK || ARCH_VT8500 || FOOTBRIDGE_HOST) && \
 		   (!SUPERH || SH_CAYMAN) && !M68K && !BLACKFIN
 	help
 	  i8042 is the chip over which the standard AT keyboard and PS/2
drivers/input/serio/i8042-vt8500.h new file +74 -0

74 lines not on this page · raw message

drivers/input/serio/i8042.h +2 -0
index cbc1beb..bdb2aeb 100644
@@ -16,6 +16,8 @@
 
 #if defined(CONFIG_MACH_JAZZ)
 #include "i8042-jazzio.h"
+#elif defined(CONFIG_ARCH_VT8500)
+#include "i8042-vt8500.h"
 #elif defined(CONFIG_SGI_HAS_I8042)
 #include "i8042-ip22io.h"
 #elif defined(CONFIG_SNI_RM)
Signature · 1 line
1.7.3.1
#4 lore raw

Re: [PATCH 2/6] serial: Add support for UART on VIA VT8500 and compatibles

In reply to Alexey Charkov
Quoted 14 lines · Alexey Charkov

2010/10/21 Greg KH <[email protected]>:

Quoted 13 lines · Alexey Charkov
Quoted 11 lines

This adds a driver for the serial ports found in VIA and WonderMedia Systems-on-Chip. Interrupt-driven FIFO operation is implemented. The hardware also supports pure register-based operation (which is slower) and DMA-based FIFO operation. As the FIFOs are only 16 bytes long, DMA operation is probably not worth the hassle.

---

Please review and state whether this could be acceptable for a merge to mainline in the coming 2.6.37 window.

Quoted 7 lines
Quoted 4 lines

.37? ??Aren't you cutting it a bit close here? ??My trees unofficially closed a few days or so ago for new stuff to go to .37, what kept this from being sent previously?

In fact, I'm somewhat new to kernel development, and have not yet understood the good timings to do things properly.

Please read the information in Documentation/development_process, it will help you out a lot.

Quoted 3 lines

My view was that the merge window is when new stuff should be submitted, while everything in between is devoted to fixing breakage just introduced. So, I must have been wrong :)

The merge window is for the subsystem maintainers, not the individual developers. You need to have the code into a subsystem tree before the merge window in order to be able to get it accepted.

Quoted 8 lines
Quoted 8 lines
Quoted 7 lines

If possible, I would deeply appreciate a merge to a relevant git tree for integration prior to asking Linus to pull the changes. I could rebase the code if needed, currently this is against Linus' master branch.

This patch relies on the basic architecture support for VT8500/WM8505 to be in place, as introduced by PATCH 1/6 in this series.

Quoted 6 lines
Quoted 2 lines

So it will just fail to build without that patch?

It won't, and it should not even be selectable, as there is a Kconfig dependency on the relevant arch. It's just that it would be useless without the relevant arch support.

That's good to know.

As the .37 merge window just opened, you are going to have to wait until 2.6.37-rc1 before anyone will be able to have the time to review and accept these patches, sorry. Please resend them then.

thanks,

greg k-h

author maintainer
#15 lore raw

Re: [PATCH 4/6] usb: Add support for VIA VT8500 and compatibles in EHCI HCD

In reply to Greg KH

2010/10/21 Greg KH <[email protected]>:

Quoted 14 lines · Alexey Charkov
Quoted 13 lines

VIA and WonderMedia Systems-on-Chip feature a standard EHCI host controller. This adds necessary glue to use the standard driver with these systems.

---

Please review and state whether this could be acceptable for a merge to mainline in the coming 2.6.37 window. If possible, I would deeply appreciate a merge to a relevant git tree for integration prior to asking Linus to pull the changes. I could rebase the code if needed, currently this is against Linus' master branch.

Quoted 5 lines
Quoted 2 lines

This patch relies on the basic architecture support for VT8500/WM8505 to be in place, as introduced by PATCH 1/6 in this series.

Will this code fail to build without that patch?

As all the additions are ifdef-ed, it won't unless somebody manually defines CONFIG_ARCH_VT8500. But in that case the person should probably know what (s)he is doing.

#16 lore raw

Re: [PATCH 4/6] usb: Add support for VIA VT8500 and compatibles in EHCI HCD

Quoted 18 lines · Alexey Charkov

2010/10/21 Greg KH <[email protected]>:

Quoted 17 lines · Alexey Charkov
Quoted 15 lines

VIA and WonderMedia Systems-on-Chip feature a standard EHCI host controller. This adds necessary glue to use the standard driver with these systems.

---

Please review and state whether this could be acceptable for a merge to mainline in the coming 2.6.37 window. If possible, I would deeply appreciate a merge to a relevant git tree for integration prior to asking Linus to pull the changes. I could rebase the code if needed, currently this is against Linus' master branch.

This patch relies on the basic architecture support for VT8500/WM8505 to be in place, as introduced by PATCH 1/6 in this series.

Quoted 6 lines
Quoted 2 lines

Will this code fail to build without that patch?

As all the additions are ifdef-ed, it won't unless somebody manually defines CONFIG_ARCH_VT8500. But in that case the person should probably know what (s)he is doing.

Ok, how about we wait for the core code to be accepted, and then have you resend the drivers for submission?

Make sense?

thanks,

greg k-h

author maintainer
#5 lore raw

Re: [PATCH 2/6] serial: Add support for UART on VIA VT8500 and compatibles

In reply to Greg KH

2010/10/21 Greg KH <[email protected]>:

Quoted 51 lines · Alexey Charkov
Quoted 14 lines

2010/10/21 Greg KH <[email protected]>:

Quoted 13 lines · Alexey Charkov
Quoted 11 lines

This adds a driver for the serial ports found in VIA and WonderMedia Systems-on-Chip. Interrupt-driven FIFO operation is implemented. The hardware also supports pure register-based operation (which is slower) and DMA-based FIFO operation. As the FIFOs are only 16 bytes long, DMA operation is probably not worth the hassle.

---

Please review and state whether this could be acceptable for a merge to mainline in the coming 2.6.37 window.

Quoted 7 lines
Quoted 4 lines

.37? ??Aren't you cutting it a bit close here? ??My trees unofficially closed a few days or so ago for new stuff to go to .37, what kept this from being sent previously?

In fact, I'm somewhat new to kernel development, and have not yet understood the good timings to do things properly.

Please read the information in Documentation/development_process, it will help you out a lot.

Quoted 3 lines

My view was that the merge window is when new stuff should be submitted, while everything in between is devoted to fixing breakage just introduced. ?So, I must have been wrong :)

The merge window is for the subsystem maintainers, not the individual developers. ?You need to have the code into a subsystem tree before the merge window in order to be able to get it accepted.

Quoted 8 lines
Quoted 8 lines
Quoted 7 lines

If possible, I would deeply appreciate a merge to a relevant git tree for integration prior to asking Linus to pull the changes. I could rebase the code if needed, currently this is against Linus' master branch.

This patch relies on the basic architecture support for VT8500/WM8505 to be in place, as introduced by PATCH 1/6 in this series.

Quoted 6 lines
Quoted 2 lines

So it will just fail to build without that patch?

It won't, and it should not even be selectable, as there is a Kconfig dependency on the relevant arch. It's just that it would be useless without the relevant arch support.

That's good to know.

Quoted 8 lines

As the .37 merge window just opened, you are going to have to wait until 2.6.37-rc1 before anyone will be able to have the time to review and accept these patches, sorry. ?Please resend them then.

thanks,

greg k-h

Thanks for the directions, Greg! Probably we will have more things to submit by then, so it does not really hurt.

Best regards,
Alexey

author maintainer
#17 lore raw

Re: [PATCH 4/6] usb: Add support for VIA VT8500 and compatibles in EHCI HCD

In reply to Greg KH

2010/10/21 Greg KH <[email protected]>:

Quoted 22 lines · Alexey Charkov
Quoted 21 lines

2010/10/21 Greg KH <[email protected]>:

Quoted 19 lines · Alexey Charkov
Quoted 7 lines

VIA and WonderMedia Systems-on-Chip feature a standard EHCI host controller. This adds necessary glue to use the standard driver with these systems.

---

Quoted 8 lines

Please review and state whether this could be acceptable for a merge to mainline in the coming 2.6.37 window. If possible, I would deeply appreciate a merge to a relevant git tree for integration prior to asking Linus to pull the changes. I could rebase the code if needed, currently this is against Linus' master branch.

This patch relies on the basic architecture support for VT8500/WM8505 to be in place, as introduced by PATCH 1/6 in this series.

Will this code fail to build without that patch?

Quoted 9 lines
Quoted 3 lines

As all the additions are ifdef-ed, it won't unless somebody manually defines CONFIG_ARCH_VT8500. But in that case the person should probably know what (s)he is doing.

Ok, how about we wait for the core code to be accepted, and then have you resend the drivers for submission?

Make sense?

For me, it's perfectly fine. I was just a bit uncomfortable about submitting the core code with platform data for missing drivers, which take quite a sizeable part of that PATCH 1/6.

Quoted 4 lines

thanks,

greg k-h

Best regards,
Alexey

maintainer Acked-by on v2 3/6
#10 lore raw

Re: [PATCH 3/6 v2] input: Add support for VIA VT8500 and compatibles in i8042

In reply to Alexey Charkov
Quoted 5 lines · Alexey Charkov

VIA and WonderMedia Systems-on-Chip feature a standard i8042-compatible keyboard and mouse controller. This adds necessary glue to enable use of the standard driver with these systems.

Thanks.

Signature · 1 line
Dmitry
#20 lore raw
In reply to Alexey Charkov
Quoted 5 lines · On Wednesday 20 October 2010 22:55:33 Alexey Charkov wrote:

Please review and state whether this could be acceptable for a merge to mainline in the coming 2.6.37 window. If possible, I would deeply appreciate a merge to a relevant git tree for integration prior to asking Linus to pull the changes. I could rebase the code if needed, currently this is against Linus' master branch.

As Greg mentioned for his review of the serial drivers, it's too late for 2.6.37. Fortunately that means you're really early for 2.6.38 and getting it in there should be easy.

The code does look very good though overall.

Quoted 13 lines
arch/arm/mach-vt8500/Kconfig new file +13 -0
+
+choice
+	prompt "LCD panel size"
+	depends on (FB_VT8500 || FB_WM8505)
+	default WMT_PANEL_800X480
+
+config WMT_PANEL_800X480
+	bool "7-inch with 800x480 resolution"
+	help
+	  These are found in most of the netbooks in generic cases, as
+	  well as in Eken M001 tablets and possibly elsewhere.
+
+config WMT_PANEL_800X600

arch/arm/mach-vt8500/Kconfig line 54

Quoted 10 lines
arch/arm/mach-vt8500/Kconfig new file +10 -0
+	bool "8-inch with 800x600 resolution"
+	help
+	  These are found in Eken M003 tablets and possibly elsewhere.
+
+config WMT_PANEL_1024X600
+	bool "10-inch with 1024x600 resolution"
+	help
+	  These are found in Eken M006 tablets and possibly elsewhere.
+
+endchoice

This should really be a run-time or at least boot-time option. If you set the frame buffer size at compile time, I guess you can no longer boot on a machine that uses a different size.

Quoted 14 lines
arch/arm/mach-vt8500/bv07.c new file +14 -0
+#include <mach/vt8500.h>
+#include "devices.h"
+
+static struct platform_device *devices[] __initdata = {
+	&vt8500_device_uart0,
+#ifdef CONFIG_FB_VT8500
+	&vt8500_device_lcdc,
+#endif
+#ifdef CONFIG_USB_EHCI_HCD
+	&vt8500_device_ehci,
+#endif
+#ifdef CONFIG_FB_WMT_GE_ROPS
+	&vt8500_device_ge_rops,
+#endif

arch/arm/mach-vt8500/bv07.c line 49

Quoted 10 lines
arch/arm/mach-vt8500/bv07.c new file +10 -0
+#ifdef CONFIG_HAVE_PWM
+	&vt8500_device_pwm,
+#endif
+#ifdef CONFIG_BACKLIGHT_PWM
+	&vt8500_device_pwmbl,
+#endif
+#ifdef CONFIG_RTC_DRV_VT8500
+	&vt8500_device_rtc,
+#endif
+};

This doesn't work if the drivers are built as loadable modules, right? I wouldn't even make the definitions of the devices configuration dependent. The idea of the device model is that you describe what you have in one place and use that information to load the drivers for it.

Quoted 18 lines
arch/arm/mach-vt8500/devices.h new file +18 -0
+#ifdef CONFIG_VTWM_VERSION_WM8505
+extern struct platform_device vt8500_device_uart4;
+extern struct platform_device vt8500_device_uart5;
+#endif
+
+#ifdef CONFIG_FB_VT8500
+extern struct platform_device vt8500_device_lcdc;
+#endif
+#ifdef CONFIG_FB_WM8505
+extern struct platform_device vt8500_device_wm8505_fb;
+#endif
+
+#ifdef CONFIG_USB_EHCI_HCD
+extern struct platform_device vt8500_device_ehci;
+#endif
+
+#ifdef CONFIG_FB_WMT_GE_ROPS
+extern struct platform_device vt8500_device_ge_rops;

arch/arm/mach-vt8500/devices.h line 57

Quoted 10 lines
arch/arm/mach-vt8500/devices.h new file +10 -0
+#endif
+#ifdef CONFIG_HAVE_PWM
+extern struct platform_device vt8500_device_pwm;
+#endif
+#ifdef CONFIG_BACKLIGHT_PWM
+extern struct platform_device vt8500_device_pwmbl;
+#endif
+#ifdef CONFIG_RTC_DRV_VT8500
+extern struct platform_device vt8500_device_rtc;
+#endif

The declarations never belong in an #ifdef, just make them unconditional.

arch/arm/mach-vt8500/include/mach/io.h line 28

Quoted 9 lines
arch/arm/mach-vt8500/include/mach/io.h new file +9 -0
+#ifndef __ASM_ARM_ARCH_IO_H
+#define __ASM_ARM_ARCH_IO_H
+
+#define IO_SPACE_LIMIT 0xffffffff
+
+#define __io(a)		__typesafe_io(a)
+#define __mem_pci(a)	(a)
+
+#endif

This won't work if you ever want to use the PCI on vt8505 with devices that have I/O space mapping.

You need to define IO_SPACE_LIMIT to the size of your I/O space and make the __io macro offset the address with the start of that window.

Arnd

author maintainer
#21 lore raw

2010/10/21 Arnd Bergmann <[email protected]>:

Quoted 8 lines · On Wednesday 20 October 2010 22:55:33 Alexey Charkov wrote:
Quoted 6 lines

Please review and state whether this could be acceptable for a merge to mainline in the coming 2.6.37 window. If possible, I would deeply appreciate a merge to a relevant git tree for integration prior to asking Linus to pull the changes. I could rebase the code if needed, currently this is against Linus' master branch.

Quoted 6 lines

As Greg mentioned for his review of the serial drivers, it's too late for 2.6.37. Fortunately that means you're really early for 2.6.38 and getting it in there should be easy.

The code does look very good though overall.

Good to hear that, thanks!

Quoted 19 lines
Quoted 19 lines
(quoted diff) +19 -0
+
+choice
+ ? ? prompt "LCD panel size"
+ ? ? depends on (FB_VT8500 || FB_WM8505)
+ ? ? default WMT_PANEL_800X480
+
+config WMT_PANEL_800X480
+ ? ? bool "7-inch with 800x480 resolution"
+ ? ? help
+ ? ? ? These are found in most of the netbooks in generic cases, as
+ ? ? ? well as in Eken M001 tablets and possibly elsewhere.
+
+config WMT_PANEL_800X600
+ ? ? bool "8-inch with 800x600 resolution"
+ ? ? help
+ ? ? ? These are found in Eken M003 tablets and possibly elsewhere.
+
+config WMT_PANEL_1024X600
+ ? ? bool "10-inch with 1024x600 resolution"
Quoted 9 lines

Review

Quoted 4 lines

+ ? ? help
+ ? ? ? These are found in Eken M006 tablets and possibly elsewhere.

(quoted diff) +2 -0
+
+endchoice

This should really be a run-time or at least boot-time option. If you set the frame buffer size at compile time, I guess you can no longer boot on a machine that uses a different size.

It could be, but then I'd have to parse kernel command line at the map_io stage. Is that fine? If yes, I could rework it to e.g. accept a default value via Kconfig and allow it to be overriden via a boot argument.

And due to the fact that the framebuffer size calculation is tied to panel specification, it will boot in any case. The only problem that one could encounter would be suboptimal display (for example, offscreen pixmaps to become actually visible on screen if the panel is taller
than expected, or some corruption in case it is wider).

Quoted 21 lines
Quoted 21 lines
arch/arm/mach-vt8500/bv07.c new file +21 -0
+#include <mach/vt8500.h>
+#include "devices.h"
+
+static struct platform_device *devices[] __initdata = {
+ ? ? &vt8500_device_uart0,
+#ifdef CONFIG_FB_VT8500
+ ? ? &vt8500_device_lcdc,
+#endif
+#ifdef CONFIG_USB_EHCI_HCD
+ ? ? &vt8500_device_ehci,
+#endif
+#ifdef CONFIG_FB_WMT_GE_ROPS
+ ? ? &vt8500_device_ge_rops,
+#endif
+#ifdef CONFIG_HAVE_PWM
+ ? ? &vt8500_device_pwm,
+#endif
+#ifdef CONFIG_BACKLIGHT_PWM
+ ? ? &vt8500_device_pwmbl,
+#endif
+#ifdef CONFIG_RTC_DRV_VT8500
Quoted 9 lines

Review

Quoted 3 lines

+ ? ? &vt8500_device_rtc,

(quoted diff) +2 -0
+#endif
+};

This doesn't work if the drivers are built as loadable modules, right? I wouldn't even make the definitions of the devices configuration dependent. The idea of the device model is that you describe what you have in one place and use that information to load the drivers for it.

But with loadable modules those symbols should still be defined as 'm' or something, shouldn't they? Anyway, I'll drop those conditions, thanks for pointing out.

Quoted 23 lines
Quoted 23 lines
arch/arm/mach-vt8500/devices.h new file +23 -0
+#ifdef CONFIG_VTWM_VERSION_WM8505
+extern struct platform_device vt8500_device_uart4;
+extern struct platform_device vt8500_device_uart5;
+#endif
+
+#ifdef CONFIG_FB_VT8500
+extern struct platform_device vt8500_device_lcdc;
+#endif
+#ifdef CONFIG_FB_WM8505
+extern struct platform_device vt8500_device_wm8505_fb;
+#endif
+
+#ifdef CONFIG_USB_EHCI_HCD
+extern struct platform_device vt8500_device_ehci;
+#endif
+
+#ifdef CONFIG_FB_WMT_GE_ROPS
+extern struct platform_device vt8500_device_ge_rops;
+#endif
+#ifdef CONFIG_HAVE_PWM
+extern struct platform_device vt8500_device_pwm;
+#endif
+#ifdef CONFIG_BACKLIGHT_PWM
Quoted 9 lines

arch/arm/mach-vt8500/devices.h line 57

Quoted 5 lines
arch/arm/mach-vt8500/devices.h new file +5 -0
+extern struct platform_device vt8500_device_pwmbl;
+#endif
+#ifdef CONFIG_RTC_DRV_VT8500
+extern struct platform_device vt8500_device_rtc;
+#endif

The declarations never belong in an #ifdef, just make them unconditional.

Ok, got it.

Quoted 14 lines

arch/arm/mach-vt8500/include/mach/io.h line 28

Quoted 9 lines
arch/arm/mach-vt8500/include/mach/io.h new file +9 -0
+#ifndef __ASM_ARM_ARCH_IO_H
+#define __ASM_ARM_ARCH_IO_H
+
+#define IO_SPACE_LIMIT 0xffffffff
+
+#define __io(a) ? ? ? ? ? ? ?__typesafe_io(a)
+#define __mem_pci(a) (a)
+
+#endif

This won't work if you ever want to use the PCI on vt8505 with devices that have I/O space mapping.

Quoted 3 lines

You need to define IO_SPACE_LIMIT to the size of your I/O space and make the __io macro offset the address with the start of that window.

The problem is that there is no documentation available for the PCI bus in these systems (if it is even implemented there). Vendor-provided sources do not really clarify it either, which you have commented about at:
http://groups.google.com/group/vt8500-wm8505-linux-kernel/msg/97bf44bc5ea5d46a?

With no possibilities to test this (as I don't know any of these devices to really use PCI with enumeration rather than just static platform-like definitions as in the vendor's kernel), I just can't imagine how this could be done any better.

Quoted 2 lines

? ? ? ?Arnd

Thanks!
Alexey

#22 lore raw
Quoted 29 lines · Alexey Charkov
Quoted 19 lines
Quoted 19 lines
arch/arm/mach-vt8500/Kconfig new file +19 -0
+
+choice
+     prompt "LCD panel size"
+     depends on (FB_VT8500 || FB_WM8505)
+     default WMT_PANEL_800X480
+
+config WMT_PANEL_800X480
+     bool "7-inch with 800x480 resolution"
+     help
+       These are found in most of the netbooks in generic cases, as
+       well as in Eken M001 tablets and possibly elsewhere.
+
+config WMT_PANEL_800X600
+     bool "8-inch with 800x600 resolution"
+     help
+       These are found in Eken M003 tablets and possibly elsewhere.
+
+config WMT_PANEL_1024X600
+     bool "10-inch with 1024x600 resolution"
Quoted 9 lines

arch/arm/mach-vt8500/Kconfig line 54

Quoted 4 lines
arch/arm/mach-vt8500/Kconfig new file +4 -0
+     help
+       These are found in Eken M006 tablets and possibly elsewhere.
+
+endchoice

This should really be a run-time or at least boot-time option. If you set the frame buffer size at compile time, I guess you can no longer boot on a machine that uses a different size.

Quoted 4 lines

It could be, but then I'd have to parse kernel command line at the map_io stage. Is that fine? If yes, I could rework it to e.g. accept a default value via Kconfig and allow it to be overriden via a boot argument.

Parsing complex options in general is not ok, but something simpler probably is.

Having a Kconfig selected default is probably a good idea. The most simple way to select this at boot time would be to have a list of possible resolutions and pass a table index.

Would a __setup() call work for you?

Quoted 6 lines

And due to the fact that the framebuffer size calculation is tied to panel specification, it will boot in any case. The only problem that one could encounter would be suboptimal display (for example, offscreen pixmaps to become actually visible on screen if the panel is taller
than expected, or some corruption in case it is wider).

Another option might be to have a submenu with the possible resolutions you want to allow and size the frame buffer for the largest of those, but allow overriding the actual one at boot time.

Quoted 31 lines
Quoted 21 lines
Quoted 21 lines
arch/arm/mach-vt8500/bv07.c new file +21 -0
+#include <mach/vt8500.h>
+#include "devices.h"
+
+static struct platform_device *devices[] __initdata = {
+     &vt8500_device_uart0,
+#ifdef CONFIG_FB_VT8500
+     &vt8500_device_lcdc,
+#endif
+#ifdef CONFIG_USB_EHCI_HCD
+     &vt8500_device_ehci,
+#endif
+#ifdef CONFIG_FB_WMT_GE_ROPS
+     &vt8500_device_ge_rops,
+#endif
+#ifdef CONFIG_HAVE_PWM
+     &vt8500_device_pwm,
+#endif
+#ifdef CONFIG_BACKLIGHT_PWM
+     &vt8500_device_pwmbl,
+#endif
+#ifdef CONFIG_RTC_DRV_VT8500
Quoted 9 lines

arch/arm/mach-vt8500/bv07.c line 49

Quoted 3 lines
arch/arm/mach-vt8500/bv07.c new file +3 -0
+     &vt8500_device_rtc,
+#endif
+};

This doesn't work if the drivers are built as loadable modules, right? I wouldn't even make the definitions of the devices configuration dependent. The idea of the device model is that you describe what you have in one place and use that information to load the drivers for it.

Quoted 3 lines

But with loadable modules those symbols should still be defined as 'm' or something, shouldn't they? Anyway, I'll drop those conditions, thanks for pointing out.

If you configure an option as a module you get e.g. CONFIG_USB_EHCI_HCD_MODULE=1, but CONFIG_USB_EHCI_HCD remains unset. It would be possible to check for both of them, but IMHO it's cleaner to just leave the code in unconditionally.

Quoted 24 lines
Quoted 14 lines

arch/arm/mach-vt8500/include/mach/io.h line 28

Quoted 9 lines
arch/arm/mach-vt8500/include/mach/io.h new file +9 -0
+#ifndef __ASM_ARM_ARCH_IO_H
+#define __ASM_ARM_ARCH_IO_H
+
+#define IO_SPACE_LIMIT 0xffffffff
+
+#define __io(a)              __typesafe_io(a)
+#define __mem_pci(a) (a)
+
+#endif

This won't work if you ever want to use the PCI on vt8505 with devices that have I/O space mapping.

Quoted 3 lines

You need to define IO_SPACE_LIMIT to the size of your I/O space and make the __io macro offset the address with the start of that window.

The problem is that there is no documentation available for the PCI bus in these systems (if it is even implemented there). Vendor-provided sources do not really clarify it either, which you have commented about at:
http://groups.google.com/group/vt8500-wm8505-linux-kernel/msg/97bf44bc5ea5d46a?

Quoted 4 lines

With no possibilities to test this (as I don't know any of these devices to really use PCI with enumeration rather than just static platform-like definitions as in the vendor's kernel), I just can't imagine how this could be done any better.

I can have a look again. It shouldn't be hard to do an almost correct implementation based on the source code we have, but I only own a wm8505 based device, so I also have no way of testing and it would very likely have some subtle bugs.

Arnd

author maintainer
#23 lore raw

2010/10/21 Arnd Bergmann <[email protected]>:

Quoted 36 lines · Alexey Charkov
Quoted 30 lines
Quoted 20 lines
Quoted 20 lines
(quoted diff) +19 -0
+
+choice
+ ? ? prompt "LCD panel size"
+ ? ? depends on (FB_VT8500 || FB_WM8505)
+ ? ? default WMT_PANEL_800X480
+
+config WMT_PANEL_800X480
+ ? ? bool "7-inch with 800x480 resolution"
+ ? ? help
+ ? ? ? These are found in most of the netbooks in generic cases, as
+ ? ? ? well as in Eken M001 tablets and possibly elsewhere.
+
+config WMT_PANEL_800X600
+ ? ? bool "8-inch with 800x600 resolution"
+ ? ? help
+ ? ? ? These are found in Eken M003 tablets and possibly elsewhere.
+
+config WMT_PANEL_1024X600
+ ? ? bool "10-inch with 1024x600 resolution"
Quoted 9 lines

Review

Quoted 4 lines

+ ? ? help
+ ? ? ? These are found in Eken M006 tablets and possibly elsewhere.

(quoted diff) +2 -0
+
+endchoice

This should really be a run-time or at least boot-time option. If you set the frame buffer size at compile time, I guess you can no longer boot on a machine that uses a different size.

Quoted 4 lines

It could be, but then I'd have to parse kernel command line at the map_io stage. Is that fine? If yes, I could rework it to e.g. accept a default value via Kconfig and allow it to be overriden via a boot argument.

Quoted 9 lines

Parsing complex options in general is not ok, but something simpler probably is.

Having a Kconfig selected default is probably a good idea. The most simple way to select this at boot time would be to have a list of possible resolutions and pass a table index.

Would a __setup() call work for you?

Should probably be fine. Will it be allowable to accept something like "panel=800x480" and strncmp it against a list of recognized values, fall back to a Kconfig default on failure and printk the possibilities? Just expecting an obscure table index would not be too user-friendly, imho.

Quoted 11 lines
Quoted 6 lines

And due to the fact that the framebuffer size calculation is tied to panel specification, it will boot in any case. The only problem that one could encounter would be suboptimal display (for example, offscreen pixmaps to become actually visible on screen if the panel is taller
than expected, or some corruption in case it is wider).

Another option might be to have a submenu with the possible resolutions you want to allow and size the frame buffer for the largest of those, but allow overriding the actual one at boot time.

In this case display parameters could be parsed in the driver itself, but quite some memory will be over-allocated in extreme cases without any way to claim it back after boot. Having only 128MB of RAM, is it really better?

Quoted 31 lines
Quoted 31 lines
Quoted 30 lines
Quoted 14 lines
arch/arm/mach-vt8500/bv07.c new file +14 -0
+#include <mach/vt8500.h>
+#include "devices.h"
+
+static struct platform_device *devices[] __initdata = {
+ ? ? &vt8500_device_uart0,
+#ifdef CONFIG_FB_VT8500
+ ? ? &vt8500_device_lcdc,
+#endif
+#ifdef CONFIG_USB_EHCI_HCD
+ ? ? &vt8500_device_ehci,
+#endif
+#ifdef CONFIG_FB_WMT_GE_ROPS
+ ? ? &vt8500_device_ge_rops,
+#endif

arch/arm/mach-vt8500/bv07.c line 49

Quoted 10 lines
arch/arm/mach-vt8500/bv07.c new file +10 -0
+#ifdef CONFIG_HAVE_PWM
+ ? ? &vt8500_device_pwm,
+#endif
+#ifdef CONFIG_BACKLIGHT_PWM
+ ? ? &vt8500_device_pwmbl,
+#endif
+#ifdef CONFIG_RTC_DRV_VT8500
+ ? ? &vt8500_device_rtc,
+#endif
+};

This doesn't work if the drivers are built as loadable modules, right? I wouldn't even make the definitions of the devices configuration dependent. The idea of the device model is that you describe what you have in one place and use that information to load the drivers for it.

Quoted 8 lines
Quoted 3 lines

But with loadable modules those symbols should still be defined as 'm' or something, shouldn't they? Anyway, I'll drop those conditions, thanks for pointing out.

If you configure an option as a module you get e.g. CONFIG_USB_EHCI_HCD_MODULE=1, but CONFIG_USB_EHCI_HCD remains unset. It would be possible to check for both of them, but IMHO it's cleaner to just leave the code in unconditionally.

Cleaned this up in the development repo, thanks. Only left #ifdef's for the sections where respective register/interrupt definitions would be unavailable due to compiling for a different SoC version, and adjusted the conditions accordingly.

Quoted 29 lines
Quoted 24 lines
Quoted 14 lines

arch/arm/mach-vt8500/include/mach/io.h line 28

Quoted 9 lines
arch/arm/mach-vt8500/include/mach/io.h new file +9 -0
+#ifndef __ASM_ARM_ARCH_IO_H
+#define __ASM_ARM_ARCH_IO_H
+
+#define IO_SPACE_LIMIT 0xffffffff
+
+#define __io(a) ? ? ? ? ? ? ?__typesafe_io(a)
+#define __mem_pci(a) (a)
+
+#endif

This won't work if you ever want to use the PCI on vt8505 with devices that have I/O space mapping.

Quoted 3 lines

You need to define IO_SPACE_LIMIT to the size of your I/O space and make the __io macro offset the address with the start of that window.

The problem is that there is no documentation available for the PCI bus in these systems (if it is even implemented there). Vendor-provided sources do not really clarify it either, which you have commented about at:
http://groups.google.com/group/vt8500-wm8505-linux-kernel/msg/97bf44bc5ea5d46a?

Quoted 4 lines

With no possibilities to test this (as I don't know any of these devices to really use PCI with enumeration rather than just static platform-like definitions as in the vendor's kernel), I just can't imagine how this could be done any better.

Quoted 5 lines

I can have a look again. It shouldn't be hard to do an almost correct implementation based on the source code we have, but I only own a wm8505 based device, so I also have no way of testing and it would very likely have some subtle bugs.

Ok, figuring out better values for the macros would be great!

Quoted 2 lines

? ? ? ?Arnd

Thanks,
Alexey

#24 lore raw
Quoted 9 lines · On Thursday 21 October 2010 23:08:39 Alexey Charkov wrote:

2010/10/21 Arnd Bergmann <[email protected]>:

Quoted 8 lines · Alexey Charkov

Parsing complex options in general is not ok, but something simpler probably is.

Having a Kconfig selected default is probably a good idea. The most simple way to select this at boot time would be to have a list of possible resolutions and pass a table index.

Quoted 8 lines
Quoted 2 lines

Would a __setup() call work for you?

Should probably be fine. Will it be allowable to accept something like "panel=800x480" and strncmp it against a list of recognized values, fall back to a Kconfig default on failure and printk the possibilities? Just expecting an obscure table index would not be too user-friendly, imho.

Sounds reasonable to me.

Quoted 12 lines
Quoted 11 lines
Quoted 6 lines

And due to the fact that the framebuffer size calculation is tied to panel specification, it will boot in any case. The only problem that one could encounter would be suboptimal display (for example, offscreen pixmaps to become actually visible on screen if the panel is taller
than expected, or some corruption in case it is wider).

Another option might be to have a submenu with the possible resolutions you want to allow and size the frame buffer for the largest of those, but allow overriding the actual one at boot time.

Quoted 4 lines

In this case display parameters could be parsed in the driver itself, but quite some memory will be over-allocated in extreme cases without any way to claim it back after boot. Having only 128MB of RAM, is it really better?

Well, you could still build a specialized kernel with only support for one resolution if you care about every byte.

Quoted 4 lines

Cleaned this up in the development repo, thanks. Only left #ifdef's for the sections where respective register/interrupt definitions would be unavailable due to compiling for a different SoC version, and adjusted the conditions accordingly.

Ideally those should also be run-time decisions so you can build a kernel that works on both. It's all __init code, so it won't eat up any RAM afterwards.

Quoted 11 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines

arch/arm/mach-vt8500/include/mach/io.h line 28

Quoted 9 lines
arch/arm/mach-vt8500/include/mach/io.h new file +9 -0
+#ifndef __ASM_ARM_ARCH_IO_H
+#define __ASM_ARM_ARCH_IO_H
+
+#define IO_SPACE_LIMIT 0xffffffff
+
+#define __io(a)              __typesafe_io(a)
+#define __mem_pci(a) (a)
+
+#endif

Ok, figuring out better values for the macros would be great!

For the IO_SPACE_LIMIT, just make it 0xffff

For __io, you need to find a place in your virtual address space and map the real IO space.

According to the VIA source code, the physical I/O window is at 0xd8000000, they also map it to the same address in virtual space but you can have anywhere convienient.

Arnd

author maintainer
#25 lore raw

2010/10/22 Arnd Bergmann <[email protected]>:

Quoted 33 lines · On Thursday 21 October 2010 23:08:39 Alexey Charkov wrote:
Quoted 9 lines

2010/10/21 Arnd Bergmann <[email protected]>:

Quoted 8 lines · Alexey Charkov

Parsing complex options in general is not ok, but something simpler probably is.

Having a Kconfig selected default is probably a good idea. The most simple way to select this at boot time would be to have a list of possible resolutions and pass a table index.

Quoted 8 lines
Quoted 2 lines

Would a __setup() call work for you?

Should probably be fine. Will it be allowable to accept something like "panel=800x480" and strncmp it against a list of recognized values, fall back to a Kconfig default on failure and printk the possibilities? Just expecting an obscure table index would not be too user-friendly, imho.

Sounds reasonable to me.

Quoted 12 lines
Quoted 11 lines
Quoted 6 lines

And due to the fact that the framebuffer size calculation is tied to panel specification, it will boot in any case. The only problem that one could encounter would be suboptimal display (for example, offscreen pixmaps to become actually visible on screen if the panel is taller
than expected, or some corruption in case it is wider).

Another option might be to have a submenu with the possible resolutions you want to allow and size the frame buffer for the largest of those, but allow overriding the actual one at boot time.

Quoted 8 lines
Quoted 4 lines

In this case display parameters could be parsed in the driver itself, but quite some memory will be over-allocated in extreme cases without any way to claim it back after boot. Having only 128MB of RAM, is it really better?

Well, you could still build a specialized kernel with only support for one resolution if you care about every byte.

If it is fine to accept an option like "panel=<value_from_a_list>" at map_io stage, then I'd rather go that way, and calculate the minimum required buffer size for the current configuration. Especially if we decide to make a unified image for different SoC revisions, as WM8505 requires 32bpp framebuffer, while VT8500 requires it to be 4MB-aligned native-bpp.

Quoted 9 lines
Quoted 4 lines

Cleaned this up in the development repo, thanks. Only left #ifdef's for the sections where respective register/interrupt definitions would be unavailable due to compiling for a different SoC version, and adjusted the conditions accordingly.

Ideally those should also be run-time decisions so you can build a kernel that works on both. It's all __init code, so it won't eat up any RAM afterwards.

I thought about that, and it should be quite useful. However, register and interrupt definitions should then be converted into some indexed data structures instead of macros (as they differ between VT8500 and WM8505), and the correct index should be selectable at runtime.

Is there any way to determine which mach type we are currently running at after early head.S initialization completes and before we could need to use any registers and/or interrupts? It could probably be done in machine-specific fixup functions, but I'm unsure whether this would be a correct way to go.

Quoted 12 lines
Quoted 11 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines

arch/arm/mach-vt8500/include/mach/io.h line 28

Quoted 9 lines
arch/arm/mach-vt8500/include/mach/io.h new file +9 -0
+#ifndef __ASM_ARM_ARCH_IO_H
+#define __ASM_ARM_ARCH_IO_H
+
+#define IO_SPACE_LIMIT 0xffffffff
+
+#define __io(a) ? ? ? ? ? ? ?__typesafe_io(a)
+#define __mem_pci(a) (a)
+
+#endif

Ok, figuring out better values for the macros would be great!

Quoted 9 lines

For the IO_SPACE_LIMIT, just make it 0xffff

For __io, you need to find a place in your virtual address space and map the real IO space.

According to the VIA source code, the physical I/O window is at 0xd8000000, they also map it to the same address in virtual space but you can have anywhere convienient.

Are you sure about that? 0xd8000000 is the MMIO base, as far as I can tell (see register definitions in <mach/vt8500.h>). In earlier discussions you presumed [1] that IO could be at 0xc0000000, but I'm not sure how to verify that. If so, should it then look something like this:

#define __io(a) ((void __iomem *)(((a) + 0xc0000000) + SOME_OFFSET_TO_VIRT_SPACE))

?
By the way, other boards except for footbridge, integrator, ebsa110 and ixp4xx define IO_SPACE_LIMIT to be 0xffffffff. 0xffff seems more plausbile, though...

Quoted 2 lines

? ? ? ?Arnd

Thanks,
Alexey

[1] http://groups.google.com/group/vt8500-wm8505-linux-kernel/msg/97bf44bc5ea5d46a?

#26 lore raw
Quoted 7 lines · On Friday 22 October 2010 15:52:26 Alexey Charkov wrote:

2010/10/22 Arnd Bergmann <[email protected]>:

Quoted 5 lines · On Thursday 21 October 2010 23:08:39 Alexey Charkov wrote:

Well, you could still build a specialized kernel with only support for one resolution if you care about every byte.

Quoted 6 lines

If it is fine to accept an option like "panel=<value_from_a_list>" at map_io stage, then I'd rather go that way, and calculate the minimum required buffer size for the current configuration. Especially if we decide to make a unified image for different SoC revisions, as WM8505 requires 32bpp framebuffer, while VT8500 requires it to be 4MB-aligned native-bpp.

sounds ok to me.

Quoted 10 lines
Quoted 9 lines
Quoted 4 lines

Cleaned this up in the development repo, thanks. Only left #ifdef's for the sections where respective register/interrupt definitions would be unavailable due to compiling for a different SoC version, and adjusted the conditions accordingly.

Ideally those should also be run-time decisions so you can build a kernel that works on both. It's all __init code, so it won't eat up any RAM afterwards.

Quoted 4 lines

I thought about that, and it should be quite useful. However, register and interrupt definitions should then be converted into some indexed data structures instead of macros (as they differ between VT8500 and WM8505), and the correct index should be selectable at runtime.

Right.

Quoted 5 lines

Is there any way to determine which mach type we are currently running at after early head.S initialization completes and before we could need to use any registers and/or interrupts? It could probably be done in machine-specific fixup functions, but I'm unsure whether this would be a correct way to go.

Normally you put the register areas into the resources for platform devices, which are board specific. The drivers then ioremap the resource and use offsets into those ranges.

Quoted 10 lines
Quoted 9 lines

For the IO_SPACE_LIMIT, just make it 0xffff

For __io, you need to find a place in your virtual address space and map the real IO space.

According to the VIA source code, the physical I/O window is at 0xd8000000, they also map it to the same address in virtual space but you can have anywhere convienient.

Quoted 8 lines

Are you sure about that? 0xd8000000 is the MMIO base, as far as I can tell (see register definitions in <mach/vt8500.h>). In earlier discussions you presumed [1] that IO could be at 0xc0000000, but I'm not sure how to verify that. If so, should it then look something like this:

#define __io(a) ((void __iomem *)(((a) + 0xc0000000) + SOME_OFFSET_TO_VIRT_SPACE))

You are right, 0xd8000000 is certainly not the PCI I/O space, it is the SoC MMIO area.

The comment in the original PCI code says

/*
* PCI Bridge Memory Map is between 0xC0000:0000 - 0xC3FF:FFFF(64MB)
* The first 64KB is allocated for the PCI I/O Space, except for the
* 0xCF8 - 0xCFF(8Bytes) for the PCI Configuration
* Others are reserved for the MemorySpace.
*/

So this should be mapped somewhere. Best map this in your map_desc at boot time to a fixed __iomem address.

Quoted 4 lines

?
By the way, other boards except for footbridge, integrator, ebsa110 and ixp4xx define IO_SPACE_LIMIT to be 0xffffffff. 0xffff seems more plausbile, though...

Yes, I have noticed that before and have thought about fixing them/ If you don't have PCI or PCMCIA, it doesn't really matter. What some platforms do is to define the I/O port range to be 32 bit addressable and then have multiple PCI buses with long port numbers, relying on the bus to crop them to 16 bits again, but that breaks a few assumptions in other code.

Arnd

#11 lore raw

Re: [PATCH 3/6] input: Add support for VIA VT8500 and compatibles in i8042

In reply to Alexey Charkov
Quoted 35 lines · Alexey Charkov

VIA and WonderMedia Systems-on-Chip feature a standard i8042-compatible keyboard and mouse controller. This adds necessary glue to enable use of the standard driver with these systems.

---

Please review and state whether this could be acceptable for a merge to mainline in the coming 2.6.37 window. If possible, I would deeply appreciate a merge to a relevant git tree for integration prior to asking Linus to pull the changes. I could rebase the code if needed, currently this is against Linus' master branch.

This patch relies on the basic architecture support for VT8500/WM8505 to be in place, as introduced by PATCH 1/6 in this series.

Due credits go to the community for providing feedback, advice and testing.

NB: The development is being done at:
http://gitorious.org/linux-on-via-vt8500/vt8500-kernel

Relevant code may be pulled from a git tree in there.

 drivers/input/serio/Kconfig        |    3 +-
 drivers/input/serio/i8042-vt8500.h |   71 ++++++++++++++++++++++++++++++++++++
 drivers/input/serio/i8042.h        |    2 +
 3 files changed, 75 insertions(+), 1 deletions(-)
 create mode 100644 drivers/input/serio/i8042-vt8500.h
drivers/input/serio/Kconfig +0 -0
index 3bfe8fa..2b86774 100644

drivers/input/serio/Kconfig if SERIO · line 26

Quoted 7 lines
drivers/input/serio/Kconfig +2 -1
@@ -21,7 +21,8 @@ if SERIO
 config SERIO_I8042
 	tristate "i8042 PC Keyboard controller" if EMBEDDED || !X86
 	default y
-	depends on !PARISC && (!ARM || ARCH_SHARK || FOOTBRIDGE_HOST) && \
+	depends on !PARISC && \
+		  (!ARM || ARCH_SHARK || ARCH_VT8500 || FOOTBRIDGE_HOST) && \
 		   (!SUPERH || SH_CAYMAN) && !M68K && !BLACKFIN

this looks like someone could do with a HAS_SERIO_I8042 Kconfig entry and have the relevant archs select it instead of having this mess.

Quoted 84 lines
drivers/input/serio/Kconfig +0 -0
 	help
 	  i8042 is the chip over which the standard AT keyboard and PS/2
drivers/input/serio/i8042-vt8500.h new file +71 -0
new file mode 100644
index 0000000..d30df82
@@ -0,0 +1,71 @@
+#ifndef _I8042_VT8500_H
+#define _I8042_VT8500_H
+
+#include <mach/irqs.h>
+#include <mach/vt8500.h>
+
+/*
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published by
+ * the Free Software Foundation.
+ */
+
+static void __iomem *regbase;
+
+/*
+ * Names.
+ */
+
+#define I8042_KBD_PHYS_DESC "vt8500ps2/serio0"
+#define I8042_AUX_PHYS_DESC "vt8500ps2/serio1"
+#define I8042_MUX_PHYS_DESC "vt8500ps2/serio%d"
+
+/*
+ * IRQs.
+ */
+
+#define I8042_KBD_IRQ	IRQ_PS2KBD
+#define I8042_AUX_IRQ	IRQ_PS2MOUSE
+
+
+/*
+ * Register numbers.
+ */
+
+#define I8042_COMMAND_REG	(regbase + 0x4)
+#define I8042_STATUS_REG	(regbase + 0x4)
+#define I8042_DATA_REG		(regbase + 0x0)
+
+static inline int i8042_read_data(void)
+{
+	return readl(I8042_DATA_REG);
+}
+
+static inline int i8042_read_status(void)
+{
+	return readl(I8042_STATUS_REG);
+}
+
+static inline void i8042_write_data(int val)
+{
+	writel(val, I8042_DATA_REG);
+}
+
+static inline void i8042_write_command(int val)
+{
+	writel(val, I8042_COMMAND_REG);
+}
+
+static inline int i8042_platform_init(void)
+{
+	i8042_reset = 1;
+	regbase = ioremap(VT8500_PS2_BASE, SZ_1K);
+	return 0;
+}
+
+static inline void i8042_platform_exit(void)
+{
+	iounmap(regbase);
+}
+
+#endif /* _I8042_VT8500_H */
drivers/input/serio/i8042.h +0 -0
index cbc1beb..bdb2aeb 100644

drivers/input/serio/i8042.h line 23

Quoted 8 lines
drivers/input/serio/i8042.h +2 -0
@@ -16,6 +16,8 @@
 
 #if defined(CONFIG_MACH_JAZZ)
 #include "i8042-jazzio.h"
+#elif defined(CONFIG_ARCH_VT8500)
+#include "i8042-vt8500.h"
 #elif defined(CONFIG_SGI_HAS_I8042)
 #include "i8042-ip22io.h"
 #elif defined(CONFIG_SNI_RM)

yeurk... how about having a core i8042 implementation and having a structure with the necessary callbacks for the code, so that we don't end up having to select what is builtin for the system we're compiling for?

Signature · 1 line
Ben
author maintainer
#12 lore raw

Re: [PATCH 3/6] input: Add support for VIA VT8500 and compatibles in i8042

2010/10/31 Ben Dooks <[email protected]>:

Quoted 31 lines · Alexey Charkov
Quoted 30 lines

VIA and WonderMedia Systems-on-Chip feature a standard i8042-compatible keyboard and mouse controller. This adds necessary glue to enable use of the standard driver with these systems.

---

Please review and state whether this could be acceptable for a merge to mainline in the coming 2.6.37 window. If possible, I would deeply appreciate a merge to a relevant git tree for integration prior to asking Linus to pull the changes. I could rebase the code if needed, currently this is against Linus' master branch.

This patch relies on the basic architecture support for VT8500/WM8505 to be in place, as introduced by PATCH 1/6 in this series.

Due credits go to the community for providing feedback, advice and testing.

NB: The development is being done at:
http://gitorious.org/linux-on-via-vt8500/vt8500-kernel

Relevant code may be pulled from a git tree in there.

?drivers/input/serio/Kconfig ? ? ? ?| ? ?3 +-
?drivers/input/serio/i8042-vt8500.h | ? 71 ++++++++++++++++++++++++++++++++++++
?drivers/input/serio/i8042.h ? ? ? ?| ? ?2 +

?3 files changed, 75 insertions(+), 1 deletions(-) ?create mode 100644 drivers/input/serio/i8042-vt8500.h

Quoted 17 lines
Quoted 5 lines
drivers/input/serio/Kconfig +0 -0
index 3bfe8fa..2b86774 100644
@@ -21,7 +21,8 @@ if SERIO
Quoted 7 lines

?config SERIO_I8042
? ? ? tristate "i8042 PC Keyboard controller" if EMBEDDED || !X86 ? ? ? default y
- ? ? depends on !PARISC && (!ARM || ARCH_SHARK || FOOTBRIDGE_HOST) && \
+ ? ? depends on !PARISC && \
+ ? ? ? ? ? ? ? (!ARM || ARCH_SHARK || ARCH_VT8500 || FOOTBRIDGE_HOST) && \
? ? ? ? ? ? ? ? ?(!SUPERH || SH_CAYMAN) && !M68K && !BLACKFIN

this looks like someone could do with a HAS_SERIO_I8042 Kconfig entry and have the relevant archs select it instead of having this mess.

True, it would make things much cleaner. However, that's probably out of scope of adding VT8500 support here, thus not for me to decide :)

<snip>

Quoted 6 lines

yeurk... how about having a core i8042 implementation and having a structure with the necessary callbacks for the code, so that we don't end up having to select what is builtin for the system we're compiling for?

I would really like to see this implemented as a standard platform driver (accepting resources and platform_data as necessary). This would be a way cleaner approach, with less code duplication and less patching of the driver itself whenever a new platform is to be added. However, I don't know how that kind of a change would affect other arches.

Quoted 3 lines

--
Ben

Thanks,
Alexey