Skip to contentSkip to conversation

The three U6715 patches after third review

PATCH New Philippe Langlais 2 participants 6 messages Jul 19, 2010 – Jul 23, 2010

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

These patches fixes latest Russell King comments (date 07/15/2010).

Regards,
Philippe

#1 lore raw

PATCH 1/3 U6/U6715 ARM architecture files

---
 arch/arm/Kconfig                               |   11 +
 arch/arm/Makefile                              |    2 +
 arch/arm/mach-u67xx/Kconfig                    |   12 +
 arch/arm/mach-u67xx/Makefile                   |   11 +
 arch/arm/mach-u67xx/Makefile.boot              |    4 +
 arch/arm/mach-u67xx/board_u67xx_wavex.c        |   47 +++
 arch/arm/mach-u67xx/devices.c                  |   28 ++
 arch/arm/plat-u6xxx/Kconfig                    |   22 ++
 arch/arm/plat-u6xxx/Makefile                   |    8 +
 arch/arm/plat-u6xxx/include/mach/cpu.h         |   36 ++
 arch/arm/plat-u6xxx/include/mach/debug-macro.S |   38 ++
 arch/arm/plat-u6xxx/include/mach/entry-macro.S |   32 ++
 arch/arm/plat-u6xxx/include/mach/hardware.h    |   41 +++
 arch/arm/plat-u6xxx/include/mach/io.h          |   30 ++
 arch/arm/plat-u6xxx/include/mach/irqs.h        |  102 ++++++
 arch/arm/plat-u6xxx/include/mach/memory.h      |   17 +
 arch/arm/plat-u6xxx/include/mach/regs-u6.h     |  121 +++++++
 arch/arm/plat-u6xxx/include/mach/system.h      |   42 +++
 arch/arm/plat-u6xxx/include/mach/timer.h       |   16 +
 arch/arm/plat-u6xxx/include/mach/timex.h       |   23 ++
 arch/arm/plat-u6xxx/include/mach/uncompress.h  |   47 +++
 arch/arm/plat-u6xxx/include/mach/vmalloc.h     |   10 +
 arch/arm/plat-u6xxx/io.c                       |   34 ++
 arch/arm/plat-u6xxx/irq.c                      |  254 ++++++++++++++
 arch/arm/plat-u6xxx/timer.c                    |  446 ++++++++++++++++++++++++
 25 files changed, 1434 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-u67xx/Kconfig
 create mode 100644 arch/arm/mach-u67xx/Makefile
 create mode 100644 arch/arm/mach-u67xx/Makefile.boot
 create mode 100644 arch/arm/mach-u67xx/board_u67xx_wavex.c
 create mode 100644 arch/arm/mach-u67xx/devices.c
 create mode 100644 arch/arm/plat-u6xxx/Kconfig
 create mode 100644 arch/arm/plat-u6xxx/Makefile
 create mode 100644 arch/arm/plat-u6xxx/include/mach/cpu.h
 create mode 100644 arch/arm/plat-u6xxx/include/mach/debug-macro.S
 create mode 100644 arch/arm/plat-u6xxx/include/mach/entry-macro.S
 create mode 100644 arch/arm/plat-u6xxx/include/mach/hardware.h
 create mode 100644 arch/arm/plat-u6xxx/include/mach/io.h
 create mode 100644 arch/arm/plat-u6xxx/include/mach/irqs.h
 create mode 100644 arch/arm/plat-u6xxx/include/mach/memory.h
 create mode 100644 arch/arm/plat-u6xxx/include/mach/regs-u6.h
 create mode 100644 arch/arm/plat-u6xxx/include/mach/system.h
 create mode 100644 arch/arm/plat-u6xxx/include/mach/timer.h
 create mode 100644 arch/arm/plat-u6xxx/include/mach/timex.h
 create mode 100644 arch/arm/plat-u6xxx/include/mach/uncompress.h
 create mode 100644 arch/arm/plat-u6xxx/include/mach/vmalloc.h
 create mode 100644 arch/arm/plat-u6xxx/io.c
 create mode 100644 arch/arm/plat-u6xxx/irq.c
 create mode 100644 arch/arm/plat-u6xxx/timer.c
arch/arm/Kconfig +11 -0
index cf30fc9..1ae089c 100644
@@ -739,6 +739,14 @@ config ARCH_U300
 	help
 	  Support for ST-Ericsson U300 series mobile platforms.
 
+config PLAT_U6XXX
+	bool "ST-Ericsson U6XXX Series"
+	select CPU_ARM926T
+	select GENERIC_GPIO
+	select ARCH_REQUIRE_GPIOLIB
+	help
+	  Support for ST-Ericsson's U6XXX architecture
+
 config ARCH_U8500
 	bool "ST-Ericsson U8500 Series"
 	select CPU_V7
@@ -910,6 +918,9 @@ source "arch/arm/mach-tegra/Kconfig"
 
 source "arch/arm/mach-u300/Kconfig"
 
+source "arch/arm/plat-u6xxx/Kconfig"
+source "arch/arm/mach-u67xx/Kconfig"
+
 source "arch/arm/mach-ux500/Kconfig"
 
 source "arch/arm/mach-versatile/Kconfig"
arch/arm/Makefile +2 -0
index 2de67c9..c510a64 100644
@@ -176,6 +176,7 @@ machine-$(CONFIG_ARCH_STMP378X)		:= stmp378x
 machine-$(CONFIG_ARCH_STMP37XX)		:= stmp37xx
 machine-$(CONFIG_ARCH_TEGRA)		:= tegra
 machine-$(CONFIG_ARCH_U300)		:= u300
+machine-$(CONFIG_ARCH_U67XX)		:= u67xx
 machine-$(CONFIG_ARCH_U8500)		:= ux500
 machine-$(CONFIG_ARCH_VERSATILE)	:= versatile
 machine-$(CONFIG_ARCH_VEXPRESS)		:= vexpress
@@ -200,6 +201,7 @@ plat-$(CONFIG_PLAT_PXA)		:= pxa
 plat-$(CONFIG_PLAT_S3C24XX)	:= s3c24xx samsung
 plat-$(CONFIG_PLAT_S5P)		:= s5p samsung
 plat-$(CONFIG_PLAT_SPEAR)	:= spear
+plat-$(CONFIG_PLAT_U6XXX)	:= u6xxx
 plat-$(CONFIG_PLAT_VERSATILE)	:= versatile
 
 ifeq ($(CONFIG_ARCH_EBSA110),y)
arch/arm/mach-u67xx/Kconfig new file +12 -0
new file mode 100644
index 0000000..f02f6e2
@@ -0,0 +1,12 @@
+comment "U67XX Board Type"
+	depends on ARCH_U67XX
+
+choice
+	depends on ARCH_U67XX
+	prompt "Choose the U67XX Board type"
+	default MACH_U67XX_WAVEC_2GB
+	help
+		Choose the ST-Ericsson Reference Design Board
+config MACH_U67XX_WAVEC_2GB
+	bool "U67XX WaveC Board with 2Gb Micron combo"
+endchoice
arch/arm/mach-u67xx/Makefile new file +11 -0
new file mode 100644
index 0000000..38cf624
@@ -0,0 +1,11 @@
+#
+## Makefile for the linux kernel, hardware dependent part of ST-Ericsson U67xx
+#
+#
+## Object file lists.
+
+# Common support
+obj-y			:= devices.o
+
+# Specific board support
+obj-$(CONFIG_MACH_U67XX_WAVEC_2GB) += board_u67xx_wavex.o
arch/arm/mach-u67xx/Makefile.boot new file +4 -0
new file mode 100644
index 0000000..c4e8c02
@@ -0,0 +1,4 @@
+   zreladdr-y		:= 0x20008000
+params_phys-y		:= 0x20000100
+initrd_phys-y		:= 0x26000000
+
arch/arm/mach-u67xx/board_u67xx_wavex.c new file +47 -0

47 lines not on this page · raw message

arch/arm/mach-u67xx/devices.c new file +28 -0
new file mode 100644
index 0000000..1d00b35
@@ -0,0 +1,28 @@
+/*
+ * linux/arch/arm/mach-u67xx/devices.c
+ *
+ * Copyright (C) ST-Ericsson SA 2010
+ * Author: Philippe Langlais <[email protected]> for ST-Ericsson.
+ * License terms:  GNU General Public License (GPL), version 2
+ *
+ * Device specification for the U67XX
+ */
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/device.h>
+#include <linux/platform_device.h>
+
+/* list of devices */
+static struct platform_device *platform_devs[] __initdata = {
+};
+
+/* register generic devices */
+
+static int __init u67xx_devices_init(void)
+{
+	platform_add_devices(platform_devs, ARRAY_SIZE(platform_devs));
+	return 0;
+}
+
+arch_initcall(u67xx_devices_init);
arch/arm/plat-u6xxx/Kconfig new file +22 -0
new file mode 100644
index 0000000..10929ea
@@ -0,0 +1,22 @@
+if PLAT_U6XXX
+
+menu "STE U6XXX Implementations"
+
+choice
+	prompt "U67XX System Type"
+	default ARCH_U67XX
+
+config ARCH_U67XX
+	bool "U67XX"
+	select GENERIC_TIME
+	select GENERIC_CLOCKEVENTS
+	select U6_MTU_TIMER
+endchoice
+
+endmenu
+
+config U6_MTU_TIMER
+	bool
+	default y
+
+endif
arch/arm/plat-u6xxx/Makefile new file +8 -0
new file mode 100644
index 0000000..12c832c
@@ -0,0 +1,8 @@
+#
+# Makefile for the linux kernel hardware independant part of STE U6XXX.
+#
+
+# Common support
+obj-y := io.o irq.o
+
+obj-$(CONFIG_U6_MTU_TIMER) += timer.o
arch/arm/plat-u6xxx/include/mach/cpu.h new file +36 -0
new file mode 100644
index 0000000..7512ce6
@@ -0,0 +1,36 @@
+/*
+ * linux/arch/arm/plat-u6xxx/include/mach/cpu.h
+ *
+ * Copyright (C) ST-Ericsson SA 2010
+ * Author: Philippe Langlais <[email protected]> for ST-Ericsson.
+ * License terms:  GNU General Public License (GPL), version 2
+ * U6 cpu type detection
+ */
+
+#ifndef __ASM_PLAT_CPU_H
+#define __ASM_PLAT_CPU_H
+
+/*
+ * Macros to group U6xxx into cpu classes.
+ * These can be used in most places.
+ * cpu_is_u67xx():	True for U67XX
+ */
+
+#define GET_U6XXX_CLASS		((inl(SCON_SYSVER_REG)&0x0F00)>>8)
+#define GET_U6XXX_SUBCLASS	((inl(SCON_SYSVER_REG)&0x0FF0)>>4)
+
+#define cpu_is_u67xx()		0
+#define cpu_is_u67xx_v2()	0
+#define cpu_is_u67xx_v3()	0
+
+#if defined(CONFIG_ARCH_U67XX)
+#  undef cpu_is_u67xx
+#  undef cpu_is_u67xx_v2
+#  undef cpu_is_u67xx_v3
+#  define cpu_is_u67xx()	(GET_U6XXX_CLASS == 0x6)
+#  define cpu_is_u67xx_v2()	(GET_U6XXX_SUBCLASS == 0x62)
+#  define cpu_is_u67xx_v3()	(GET_U6XXX_SUBCLASS == 0x63)
+#endif
+
+#endif /* __ASM_PLAT_CPU_H */
+
arch/arm/plat-u6xxx/include/mach/debug-macro.S new file +38 -0
new file mode 100644
index 0000000..039c810
@@ -0,0 +1,38 @@
+/* linux/arch/arm/plat-u6xxx/include/mach/debug-macro.S
+ *
+ * Debugging macro include header
+ *
+ *  Copyright (C) 2010 ST-Ericsson
+ *
+ * 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/hardware.h>
+
+		.macro	addruart,rx
+		mrc	p15, 0, \rx, c1, c0
+		tst	\rx, #1                       @ MMU enabled?
+		ldreq	\rx, = UART1_BASE             @ physical base address
+		ldrne	\rx, = IO_ADDRESS(UART1_BASE) @ virtual base
+		.endm
+
+		.macro	senduart,rd,rx
+		strb	\rd, [\rx]
+		.endm
+
+		.macro	waituart,rd,rx
+1001:
+		ldr	\rd, [\rx, #20]
+		tst	\rd, #1 << 5	@ LSR_THRE - 0 when full
+		beq	1001b
+		.endm
+
+		.macro	busyuart,rd,rx
+1001:
+		ldr	\rd, [\rx, #20]
+		tst	\rd, #1 << 6	@ LSR_TEMT - 0 when busy
+		beq	1001b
+		.endm
arch/arm/plat-u6xxx/include/mach/entry-macro.S new file +32 -0
new file mode 100644
index 0000000..cae8824
@@ -0,0 +1,32 @@
+/*
+ * linux/arch/arm/plat-u6xxx/include/mach/entry-macro.S
+ *
+ * Low-level IRQ helper macros for U6-based platforms
+ * Copyright (C) ST-Ericsson SA 2010
+ *
+ * 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.
+ */
+#include <mach/hardware.h>
+#include <mach/irqs.h>
+
+	.macro  arch_ret_to_user, tmp1, tmp2
+	.endm
+
+	.macro	disable_fiq
+	.endm
+
+	.macro  get_irqnr_preamble, base, tmp
+	ldr	\base, =IO_ADDRESS(INTC_BASE)
+	.endm
+
+	.macro	get_irqnr_and_base, irqnr, irqstat, base, tmp
+	ldr	\irqnr, [\base, #INTC_VECTOR_IRQ_OFFSET] @ load intc vector reg
+	mov	\irqnr, \irqnr, lsr #3              @ Bits[0..2] are reserved
+	ands	\irqnr, \irqnr, #0x00FF             @ mask Bits[11..31]
+	.endm
+
+	.macro	irq_prio_table
+	.endm
+
arch/arm/plat-u6xxx/include/mach/hardware.h new file +41 -0

41 lines not on this page · raw message

arch/arm/plat-u6xxx/include/mach/io.h new file +30 -0
new file mode 100644
index 0000000..e8a93b4
@@ -0,0 +1,30 @@
+/*
+ * linux/arch/arm/plat-u6xxx/include/mach/io.h
+ *
+ * Copyright (C) ST-Ericsson SA 2010
+ * Author: Philippe Langlais <[email protected]> for ST-Ericsson.
+ * License terms:  GNU General Public License (GPL), version 2
+ *
+ * Dummy IO map & IO definitions
+ */
+#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)
+
+/*
+ * I/O mapping
+ */
+#ifdef __ASSEMBLER__
+#define IOMEM(x)		(x)
+#else
+#define IOMEM(x)		((void __force __iomem *)(x))
+#endif
+#define U6_IO_ADDRESS(pa)	IOMEM(IO_ADDRESS(pa))
+
+void u6xxx_map_io(void);
+
+#endif /* __ASM_ARM_ARCH_IO_H */
arch/arm/plat-u6xxx/include/mach/irqs.h new file +102 -0

102 lines not on this page · raw message

arch/arm/plat-u6xxx/include/mach/memory.h new file +17 -0
new file mode 100644
index 0000000..71a5c60
@@ -0,0 +1,17 @@
+/*
+ * linux/arch/arm/plat-u6xxx/include/mach/memory.h
+ *
+ * Copyright (C) ST-Ericsson SA 2010
+ * Author: Philippe Langlais <[email protected]> for ST-Ericsson.
+ * License terms:  GNU General Public License (GPL), version 2
+ */
+
+#ifndef __ASM_ARCH_MEMORY_H
+#define __ASM_ARCH_MEMORY_H
+
+/*
+ * Physical DRAM offset.
+ */
+#define PHYS_OFFSET		UL(0x20000000)
+
+#endif
arch/arm/plat-u6xxx/include/mach/regs-u6.h new file +121 -0

121 lines not on this page · raw message

arch/arm/plat-u6xxx/include/mach/system.h new file +42 -0

42 lines not on this page · raw message

arch/arm/plat-u6xxx/include/mach/timer.h new file +16 -0
new file mode 100644
index 0000000..614d6cf
@@ -0,0 +1,16 @@
+/*
+ *  linux/arch/arm/plat-u6xxx/include/mach/timer.h
+ *
+ * Copyright (C) ST-Ericsson SA 2010
+ * Author: Philippe Langlais <[email protected]> for ST-Ericsson.
+ * License terms:  GNU General Public License (GPL), version 2
+ */
+
+#ifndef __PLAT_TIMER_H
+#define __PLAT_TIMER_H
+
+struct sys_timer;
+
+extern struct sys_timer u6_timer;
+
+#endif
arch/arm/plat-u6xxx/include/mach/timex.h new file +23 -0
new file mode 100644
index 0000000..1e71241
@@ -0,0 +1,23 @@
+/*
+ *  linux/arch/arm/plat-u6xxx/include/mach/timex.h
+ *
+ *  Integrator architecture timex specifications
+ *
+ *  Copyright (C) 1999 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
+ */
+
+#define CLOCK_TICK_RATE		(50000000 / 16)
arch/arm/plat-u6xxx/include/mach/uncompress.h new file +47 -0

47 lines not on this page · raw message

arch/arm/plat-u6xxx/include/mach/vmalloc.h new file +10 -0
new file mode 100644
index 0000000..cb89107
@@ -0,0 +1,10 @@
+/*
+ * linux/arch/arm/plat-u6/include/mach/vmalloc.h
+ * Copyright (C) ST-Ericsson SA 2010
+ * Author: Philippe Langlais <[email protected]> for ST-Ericsson.
+ * License terms:  GNU General Public License (GPL), version 2
+ *
+ * Virtual memory allocations
+ * End must be above the I/O registers and on an even 2MiB boundary.
+ */
+#define VMALLOC_END       0xe8000000UL
arch/arm/plat-u6xxx/io.c new file +34 -0
new file mode 100644
index 0000000..01d447c
@@ -0,0 +1,34 @@
+/*
+ * linux/arch/arm/plat-u6xxx/io.c
+ *
+ * Copyright (C) ST-Ericsson SA 2010
+ * Author: Philippe Langlais <[email protected]> for ST-Ericsson.
+ * License terms:  GNU General Public License (GPL), version 2
+ */
+
+#include <linux/sched.h>
+#include <linux/mm.h>
+#include <linux/init.h>
+#include <linux/io.h>
+
+#include <mach/hardware.h>
+#include <asm/pgtable.h>
+#include <asm/page.h>
+
+#include <asm/mach/map.h>
+
+
+static struct map_desc u6xxx_io_desc[] __initdata = {
+	{
+		.virtual  = IO_BASE_VIRT,	/* only peripherals */
+		.pfn      = __phys_to_pfn(IO_BASE_PHYS),
+		.length   = IO_SIZE,
+		.type     = MT_DEVICE,
+	}
+};
+
+void __init u6xxx_map_io(void)
+{
+    iotable_init(u6xxx_io_desc, ARRAY_SIZE(u6xxx_io_desc));
+}
+
arch/arm/plat-u6xxx/irq.c new file +254 -0

254 lines not on this page · raw message

arch/arm/plat-u6xxx/timer.c new file +446 -0

446 lines not on this page · raw message

Signature · 1 line
1.7.1
#2 lore raw

PATCH 1/3 U6/U6715 ARM architecture files

arch/arm/plat-u6xxx/include/mach/cpu.h line 20

Quoted 8 lines · Philippe Langlais
arch/arm/plat-u6xxx/include/mach/cpu.h new file +8 -0
+/*
+ * Macros to group U6xxx into cpu classes.
+ * These can be used in most places.
+ * cpu_is_u67xx():	True for U67XX
+ */
+
+#define GET_U6XXX_CLASS		((inl(SCON_SYSVER_REG)&0x0F00)>>8)
+#define GET_U6XXX_SUBCLASS	((inl(SCON_SYSVER_REG)&0x0FF0)>>4)

Bah. Still finding ISA/PCI IO macros in your source. Can you review your own patches and eliminate all {in,out}s?[bwl] calls please? (that's inb, inw, inl, insb, insw, insl, and the out variants too...)

arch/arm/plat-u6xxx/timer.c line 354

Quoted 12 lines
arch/arm/plat-u6xxx/timer.c new file +12 -0
+static void u6_clockevent_init_mmtu(void)
+{
+	printk(PKMOD "clockevent_init_mmtu\n");
+
+	/* prescale 13Mhz -> 1Mhz */
+#ifndef U6_MMTU_CLOCK_SOURCE
+	u6_mmtu_timer_init(0, 0, (MMTU_SYS_FRQ / MMTU_ROOT_FRQ), 0);
+#endif
+
+/* issue it is shorter than reality and generates spurious irq */
+/*      clockevent_mmtu.mult = div_sc(MMTU_ROOT_FRQ, NSEC_PER_SEC,
+ *      clockevent_mmtu.shift) + 1;*/

Shouldn't these comments be indented?

arch/arm/plat-u6xxx/timer.c line 360

Quoted 6 lines
arch/arm/plat-u6xxx/timer.c new file +6 -0
+	clockevent_mmtu.mult =
+	    div_sc(MMTU_ROOT_FRQ, NSEC_PER_SEC, clockevent_mmtu.shift);
+
+/*      clockevent_mmtu.max_delta_ns = div_sc(RELOAD_COUNTER_MMTU,
+ *      clockevent_mmtu.mult, clockevent_mmtu.shift);*/
+/*  In fact it is wider than the 32bits variable !!! */

Ditto.

arch/arm/plat-u6xxx/timer.c line 365

Quoted 5 lines
arch/arm/plat-u6xxx/timer.c new file +5 -0
+	clockevent_mmtu.max_delta_ns = 0xFFFFFFFF;
+
+/*  MMTU HW limitation: match register can't be set w/ tcval+1 */
+/*      clockevent_mmtu.min_delta_ns = div_sc(1, clockevent_mmtu.mult,
+ *      clockevent_mmtu.shift)+1;*/

Ditto.

#3 lore raw

PATCH 1/3 U6/U6715 ARM architecture files

Hi

Quoted 16 lines · Russell King - ARM Linux

arch/arm/plat-u6xxx/include/mach/cpu.h line 20

Quoted 9 lines · Philippe Langlais
arch/arm/plat-u6xxx/include/mach/cpu.h new file +8 -0
+/*
+ * Macros to group U6xxx into cpu classes.
+ * These can be used in most places.
+ * cpu_is_u67xx():	True for U67XX
+ */
+
+#define GET_U6XXX_CLASS		((inl(SCON_SYSVER_REG)&0x0F00)>>8)
+#define GET_U6XXX_SUBCLASS	((inl(SCON_SYSVER_REG)&0x0FF0)>>4)

Bah. Still finding ISA/PCI IO macros in your source. Can you review your own patches and eliminate all {in,out}s?[bwl] calls please? (that's inb, inw, inl, insb, insw, insl, and the out variants too...)

OK, I beg your pardon, these are the last occurrences.

Quoted 26 lines

arch/arm/plat-u6xxx/timer.c line 354

Quoted 13 lines
arch/arm/plat-u6xxx/timer.c new file +12 -0
+static void u6_clockevent_init_mmtu(void)
+{
+	printk(PKMOD "clockevent_init_mmtu\n");
+
+	/* prescale 13Mhz ->  1Mhz */
+#ifndef U6_MMTU_CLOCK_SOURCE
+	u6_mmtu_timer_init(0, 0, (MMTU_SYS_FRQ / MMTU_ROOT_FRQ), 0);
+#endif
+
+/* issue it is shorter than reality and generates spurious irq */
+/*      clockevent_mmtu.mult = div_sc(MMTU_ROOT_FRQ, NSEC_PER_SEC,
+ *      clockevent_mmtu.shift) + 1;*/

Shouldn't these comments be indented?

arch/arm/plat-u6xxx/timer.c line 360

Quoted 7 lines
arch/arm/plat-u6xxx/timer.c new file +6 -0
+	clockevent_mmtu.mult =
+	    div_sc(MMTU_ROOT_FRQ, NSEC_PER_SEC, clockevent_mmtu.shift);
+
+/*      clockevent_mmtu.max_delta_ns = div_sc(RELOAD_COUNTER_MMTU,
+ *      clockevent_mmtu.mult, clockevent_mmtu.shift);*/
+/*  In fact it is wider than the 32bits variable !!! */

Ditto.

Quoted 9 lines

arch/arm/plat-u6xxx/timer.c line 365

Quoted 6 lines
arch/arm/plat-u6xxx/timer.c new file +5 -0
+	clockevent_mmtu.max_delta_ns = 0xFFFFFFFF;
+
+/*  MMTU HW limitation: match register can't be set w/ tcval+1 */
+/*      clockevent_mmtu.min_delta_ns = div_sc(1, clockevent_mmtu.mult,
+ *      clockevent_mmtu.shift)+1;*/

Ditto.

OK
I attach the patch with all fixes.
The last iteration ?

Regards

#4 lore raw

PATCH 2/3 U6715 clocks gating management U6 clock generic driver & U6715 cgu clock specific

In reply to Philippe Langlais
---
 arch/arm/Kconfig                          |    1 +
 arch/arm/mach-u67xx/Makefile              |    5 +-
 arch/arm/mach-u67xx/cgu.c                 |  753 +++++++++++++++++++++++++
 arch/arm/mach-u67xx/cgu.h                 |   57 ++
 arch/arm/mach-u67xx/clock_data_u67xx.c    |  865 +++++++++++++++++++++++++++++
 arch/arm/plat-u6xxx/Makefile              |    2 +-
 arch/arm/plat-u6xxx/clock.c               |  621 +++++++++++++++++++++
 arch/arm/plat-u6xxx/include/mach/clkdev.h |   13 +
 arch/arm/plat-u6xxx/include/mach/clock.h  |  378 +++++++++++++
 9 files changed, 2693 insertions(+), 2 deletions(-)
 create mode 100644 arch/arm/mach-u67xx/cgu.c
 create mode 100644 arch/arm/mach-u67xx/cgu.h
 create mode 100644 arch/arm/mach-u67xx/clock_data_u67xx.c
 create mode 100644 arch/arm/plat-u6xxx/clock.c
 create mode 100644 arch/arm/plat-u6xxx/include/mach/clkdev.h
 create mode 100644 arch/arm/plat-u6xxx/include/mach/clock.h
arch/arm/Kconfig +1 -0
index 1ae089c..a250f2e 100644
@@ -742,6 +742,7 @@ config ARCH_U300
 config PLAT_U6XXX
 	bool "ST-Ericsson U6XXX Series"
 	select CPU_ARM926T
+	select COMMON_CLKDEV
 	select GENERIC_GPIO
 	select ARCH_REQUIRE_GPIOLIB
 	help
arch/arm/mach-u67xx/Makefile +4 -1
index 38cf624..d4e35a7 100644
@@ -5,7 +5,10 @@
 ## Object file lists.
 
 # Common support
-obj-y			:= devices.o
+obj-y			:= devices.o cgu.o
+
+# Specific machine support
+obj-y += clock_data_u67xx.o
 
 # Specific board support
 obj-$(CONFIG_MACH_U67XX_WAVEC_2GB) += board_u67xx_wavex.o
arch/arm/mach-u67xx/cgu.c new file +753 -0

753 lines not on this page · raw message

arch/arm/mach-u67xx/cgu.h new file +57 -0

57 lines not on this page · raw message

arch/arm/mach-u67xx/clock_data_u67xx.c new file +865 -0

865 lines not on this page · raw message

arch/arm/plat-u6xxx/Makefile +1 -1
index 12c832c..afdf82b 100644
@@ -3,6 +3,6 @@
 #
 
 # Common support
-obj-y := io.o irq.o
+obj-y := io.o irq.o clock.o
 
 obj-$(CONFIG_U6_MTU_TIMER) += timer.o
arch/arm/plat-u6xxx/clock.c new file +621 -0

621 lines not on this page · raw message

arch/arm/plat-u6xxx/include/mach/clkdev.h new file +13 -0
new file mode 100644
index 0000000..730c49d
@@ -0,0 +1,13 @@
+#ifndef __MACH_CLKDEV_H
+#define __MACH_CLKDEV_H
+
+static inline int __clk_get(struct clk *clk)
+{
+	return 1;
+}
+
+static inline void __clk_put(struct clk *clk)
+{
+}
+
+#endif
arch/arm/plat-u6xxx/include/mach/clock.h new file +378 -0

378 lines not on this page · raw message

Signature · 1 line
1.7.1
#5 lore raw

PATCH 3/3 U6715 gpio platform driver This driver is U6XXX platform generic

In reply to Philippe Langlais
---
 arch/arm/mach-u67xx/board_u67xx_wavex.c |  468 ++++++++++++++++++++++
 arch/arm/mach-u67xx/devices.c           |   67 +++
 arch/arm/plat-u6xxx/Makefile            |    2 +-
 arch/arm/plat-u6xxx/gpio.c              |  665 +++++++++++++++++++++++++++++++
 arch/arm/plat-u6xxx/include/mach/gpio.h |  391 ++++++++++++++++++
 arch/arm/plat-u6xxx/include/mach/scon.h |  123 ++++++
 6 files changed, 1715 insertions(+), 1 deletions(-)
 create mode 100644 arch/arm/plat-u6xxx/gpio.c
 create mode 100644 arch/arm/plat-u6xxx/include/mach/gpio.h
 create mode 100644 arch/arm/plat-u6xxx/include/mach/scon.h
arch/arm/mach-u67xx/board_u67xx_wavex.c +468 -0
index 633989f..c54a79b 100644
@@ -14,6 +14,7 @@
 #include <linux/sched.h>
 #include <linux/interrupt.h>
 #include <linux/init.h>
+#include <linux/gpio.h>
 #include <linux/platform_device.h>
 
 #include <asm/setup.h>
@@ -23,6 +24,472 @@
 #include <mach/hardware.h>
 #include <mach/irqs.h>
 #include <mach/timer.h>
+#include <mach/scon.h>
+
+/**
+ * SCON initial settings
+ * Allows to define the PIN multiplexing for all the platform (Linux and Modem)
+ */
+struct u6_scon_config u6_scon_init_config[SCON_REGISTER_NB] = {
+ {
+	SCON_SYSMUX0_REG,
+	0 |
+	(GPIO_MODE_MUX0 << (2 * (GPIO_A0  & 0xF))) | /* FM IRQ */
+	(GPIO_MODE_MUX1 << (2 * (GPIO_A1  & 0xF))) | /* UART 2 */
+	(GPIO_MODE_MUX1 << (2 * (GPIO_A2  & 0xF))) | /* UART 2 */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_A3  & 0xF))) |
+	(GPIO_MODE_MUX3 << (2 * (GPIO_A4  & 0xF))) | /* SIMOFF_copy for modem */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_A5  & 0xF))) | /* for AGPS */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_A6  & 0xF))) | /* LCD backlight
+							-> ressource backligth*/
+	(GPIO_MODE_MUX0 << (2 * (GPIO_A7  & 0xF))) | /* Bluetooth */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_A8  & 0xF))) | /* Reserved for mode DPWS*/
+	(GPIO_MODE_MUX0 << (2 * (GPIO_A9  & 0xF))) | /* Reserved for mode DPWS*/
+	(GPIO_MODE_MUX1 << (2 * (GPIO_A10 & 0xF))) | /* UART2 */
+	(GPIO_MODE_MUX1 << (2 * (GPIO_A11 & 0xF))) | /* UART2 */
+	(GPIO_MODE_MUX1 << (2 * (GPIO_A12 & 0xF))) | /* UART 1, configured
+							by boot, don't touch */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_A13 & 0xF))) | /* free */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_A14 & 0xF))) | /* PMU irq */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_A15 & 0xF)))
+ },
+ {
+	SCON_SYSMUX1_REG,
+	0 |
+	(GPIO_MODE_MUX0 << (2 * (GPIO_A16 & 0xF))) | /* FCI data 3 */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_A17 & 0xF))) | /* free */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_A18 & 0xF))) | /* FCI data 2 */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_A19 & 0xF))) | /* FCI data 1 */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_A20 & 0xF))) | /* Cam Ligth copy */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_A21 & 0xF))) | /* RF on -> GPIO */
+	(GPIO_MODE_MUX2 << (2 * (GPIO_A22 & 0xF))) | /* RF RF_DPN */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_A23 & 0xF))) | /* RF reset -> GPIO */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_A24 & 0xF))) | /* AGPS reset */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_A25 & 0xF))) | /* AGPS wake up */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_A26 & 0xF))) | /* free */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_A27 & 0xF))) | /* SPI1 */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_A28 & 0xF))) | /* SPI1 */
+	(GPIO_MODE_MUX1 << (2 * (GPIO_A29 & 0xF))) | /* Audio IIS */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_A30 & 0xF))) | /* AGPS pwr on */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_A31 & 0xF)))  /* free */
+ },
+ {
+	SCON_SYSMUX2_REG,
+	0 |
+	(GPIO_MODE_MUX0 << (2 * (GPIO_B0  & 0xF))) | /* RF DD */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_B1  & 0xF))) | /* RF DU */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_B2  & 0xF))) | /* RF FSC */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_B3  & 0xF))) | /* RF DCL */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_B4  & 0xF))) | /* UART RTS1 -> console */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_B5  & 0xF))) | /* UART TXD1 -> console */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_B6  & 0xF))) | /* NFI ready -> for NFI */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_B7  & 0xF))) | /* VDE_EOFI -> VDE already
+						configured by splashscreen */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_B8  & 0xF))) | /* RFEN0 */
+	(GPIO_MODE_MUX1 << (2 * (GPIO_B9  & 0xF))) | /* FCICMD -> for FCI */
+	(GPIO_MODE_MUX1 << (2 * (GPIO_B10 & 0xF))) | /* FCICLK -> for FCI */
+	(GPIO_MODE_MUX1 << (2 * (GPIO_B11 & 0xF))) | /* FCIDATA0 -> for FCI */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_B12 & 0xF))) | /* RFSIG6 */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_B13 & 0xF))) | /* RFSIG7 */
+	(GPIO_MODE_MUX3 << (2 * (GPIO_B14 & 0xF))) |
+	(GPIO_MODE_MUX0 << (2 * (GPIO_B15 & 0xF)))  /* RFDATA */
+ },
+ {
+	SCON_SYSMUX3_REG,
+	0
+ },
+ {
+	SCON_SYSMUX4_REG,
+	0 |
+	(GPIO_MODE_MUX0 << (2 * (GPIO_C0  & 0xF))) | /* VDE */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_C1  & 0xF))) | /* VDE */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_C2  & 0xF))) | /* VDE */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_C3  & 0xF))) | /* VDE */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_C4  & 0xF))) | /* VDE */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_C5  & 0xF))) | /* VDE */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_C6  & 0xF))) | /* VDE */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_C7  & 0xF))) | /* VDE */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_C8  & 0xF))) | /* VDE */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_C9  & 0xF))) | /* VDE */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_C10 & 0xF))) | /* VDE */
+#ifdef CONFIG_EBI_BUS
+	(GPIO_MODE_MUX2 << (2 * (GPIO_C11 & 0xF))) | /* EBI_CS0 */
+#else
+	(GPIO_MODE_MUX0 << (2 * (GPIO_C11 & 0xF))) | /* VDE */
+#endif
+	(GPIO_MODE_MUX0 << (2 * (GPIO_C12 & 0xF))) | /* VDE */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_C13 & 0xF))) | /* VDE */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_C14 & 0xF))) | /* KCOL0 -> keypad */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_C15 & 0xF)))  /* KCOL1 -> keypad */
+
+ },
+ {
+	SCON_SYSMUX5_REG,
+	0 |
+	(GPIO_MODE_MUX0 << (2 * (GPIO_C16 & 0xF))) | /* KCOL2 -> keypad */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_C17 & 0xF))) | /* KCOL3 -> keypad */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_C18 & 0xF))) | /* KCOL4 -> keypad */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_C19 & 0xF))) | /* KROW0 -> keypad */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_C20 & 0xF))) | /* KROW1 -> keypad */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_C21 & 0xF))) | /* KROW2 -> keypad */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_C22 & 0xF))) | /* KROW3 -> keypad */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_C23 & 0xF))) | /* KROW4 -> keypad */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_C24 & 0xF))) | /* RF3GSPIEN0 */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_C25 & 0xF))) | /* RF3GSPIDATA */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_C26 & 0xF))) | /* RF3GSPICLK */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_C27 & 0xF))) | /* RFSM_OUT0 */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_C28 & 0xF))) | /* RFSM_OUT1 */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_C29 & 0xF))) | /* RFSM_OUT2 */
+	(GPIO_MODE_MUX1 << (2 * (GPIO_C30 & 0xF))) | /* I2C -> ressource */
+	(GPIO_MODE_MUX1 << (2 * (GPIO_C31 & 0xF)))  /* I2C -> ressource */
+ },
+ {
+	SCON_SYSMUX6_REG,
+	0 |
+	(GPIO_MODE_MUX1 << (2 * (GPIO_D0  & 0xF))) | /* CAM PWRDN1 -> CAM */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_D1  & 0xF))) | /* CAM DATA 0 */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_D2  & 0xF))) | /* CAM DATA 1 */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_D3  & 0xF))) | /* CAM DATA 2 */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_D4  & 0xF))) | /* CAM DATA 3 */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_D5  & 0xF))) | /* CAM DATA 4 */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_D6  & 0xF))) | /* CAM DATA 5 */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_D7  & 0xF))) | /* CAM DATA 6 */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_D8  & 0xF))) | /* CAM DATA 7 */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_D9  & 0xF))) | /* CAM DATA 8 */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_D10 & 0xF))) | /* CAM DATA 9 */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_D11 & 0xF))) | /* CAMVS */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_D12 & 0xF))) | /* CAMHS */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_D13 & 0xF))) | /* CAMCLKI */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_D14 & 0xF))) | /* CAMCLKO */
+	(GPIO_MODE_MUX2 << (2 * (GPIO_D15 & 0xF)))  /* VDDC2EN */
+ },
+ {
+	SCON_SYSMUX7_REG,
+	0 |
+	(GPIO_MODE_MUX0 << (2 * (GPIO_D16 & 0xF))) | /* RF3GGPO9 */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_D17 & 0xF))) | /* RF3GGPO8 */
+	(GPIO_MODE_MUX1 << (2 * (GPIO_D18 & 0xF))) | /* FCI card detect, FCI */
+	(GPIO_MODE_MUX2 << (2 * (GPIO_D19 & 0xF))) | /* CAM_Prelight copy, CAM*/
+	(GPIO_MODE_MUX0 << (2 * (GPIO_D20 & 0xF))) | /* UART1 RXD1 -> Console */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_D21 & 0xF))) | /* DIISWS */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_D22 & 0xF))) | /* DIISSDO */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_D23 & 0xF))) | /* DIISCK */
+	(GPIO_MODE_MUX1 << (2 * (GPIO_D24 & 0xF))) | /* GPIOD24 ->FM Reset */
+	(GPIO_MODE_MUX2 << (2 * (GPIO_D25 & 0xF))) | /* RFSIG3 */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_D26 & 0xF))) | /* RF3GGPO6 */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_D27 & 0xF))) | /* RF3GGPO7 */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_D28 & 0xF))) | /* RF3GGPO5 */
+	(GPIO_MODE_MUX1 << (2 * (GPIO_D29 & 0xF))) | /* GPIOD29 USB suspend */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_D30 & 0xF))) | /* RF3GGPO4 */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_D31 & 0xF)))  /* RFCLK */
+ },
+#ifdef CONFIG_MACH_U67XX_V2_WAVEB_2GB
+{
+	SCON_SYSMUX8_REG,
+	0 |
+	(GPIO_MODE_MUX0 << (2 * (GPIO_E0  & 0xF))) | /* DEBUG */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_E1  & 0xF))) | /* DEBUG */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_E2  & 0xF))) | /* DEBUG */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_E3  & 0xF))) | /* DEBUG */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_E4  & 0xF))) | /* DEBUG */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_E5  & 0xF))) | /* DEBUG */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_E6  & 0xF))) | /* DEBUG */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_E7  & 0xF))) | /* DEBUG */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_E8  & 0xF))) | /* DEBUG */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_E9  & 0xF))) | /* DEBUG */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_E10 & 0xF))) | /* DEBUG */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_E11 & 0xF))) | /* DEBUG */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_E12 & 0xF))) | /* DEBUG */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_E13 & 0xF))) | /* DEBUG */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_E14 & 0xF))) | /* DEBUG */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_E15 & 0xF)))  /* DEBUG */
+ },
+ {
+	SCON_SYSMUX9_REG,
+	0 |
+	(GPIO_MODE_MUX0 << (2 * (GPIO_E16 & 0xF))) | /* DEBUG */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_E17 & 0xF))) | /* DEBUG */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_E18 & 0xF))) | /* DEBUG */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_E19 & 0xF))) | /* DEBUG */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_E20 & 0xF))) | /* DEBUG */
+	(GPIO_MODE_MUX1 << (2 * (GPIO_E21 & 0xF))) | /* SDATO2 -> SPI2 */
+	(GPIO_MODE_MUX1 << (2 * (GPIO_E22 & 0xF))) | /* SDATIN2 -> SPI2 */
+	(GPIO_MODE_MUX1 << (2 * (GPIO_E23 & 0xF))) | /* SCLK2 -> SPI2 */
+	(GPIO_MODE_MUX1 << (2 * (GPIO_E24 & 0xF))) | /* FCI_copy -> FCI */
+	(GPIO_MODE_MUX1 << (2 * (GPIO_E25 & 0xF))) | /* FCI_copy -> FCI */
+	(GPIO_MODE_MUX1 << (2 * (GPIO_E26 & 0xF))) | /* FCI_copy -> FCI */
+	(GPIO_MODE_MUX1 << (2 * (GPIO_E27 & 0xF))) | /* FCI_copy -> FCI */
+	(GPIO_MODE_MUX1 << (2 * (GPIO_E28 & 0xF))) | /* FCI_copy -> FCI */
+	(GPIO_MODE_MUX1 << (2 * (GPIO_E29 & 0xF))) | /* FCI_copy
+							-> FCI USB suspend */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_E30 & 0xF))) | /* RFSM_OUT3 */
+	(GPIO_MODE_MUX1 << (2 * (GPIO_E31 & 0xF)))  /* GPIO CAM */
+ },
+#else
+{
+	SCON_SYSMUX8_REG,
+	0 |
+	(GPIO_MODE_MUX2 << (2 * (GPIO_E0  & 0xF))) | /* DEBUG */
+	(GPIO_MODE_MUX2 << (2 * (GPIO_E1  & 0xF))) | /* DEBUG */
+	(GPIO_MODE_MUX2 << (2 * (GPIO_E2  & 0xF))) | /* DEBUG */
+	(GPIO_MODE_MUX2 << (2 * (GPIO_E3  & 0xF))) | /* DEBUG */
+	(GPIO_MODE_MUX2 << (2 * (GPIO_E4  & 0xF))) | /* DEBUG */
+	(GPIO_MODE_MUX2 << (2 * (GPIO_E5  & 0xF))) | /* DEBUG */
+	(GPIO_MODE_MUX2 << (2 * (GPIO_E6  & 0xF))) | /* DEBUG */
+	(GPIO_MODE_MUX2 << (2 * (GPIO_E7  & 0xF))) | /* DEBUG */
+	(GPIO_MODE_MUX2 << (2 * (GPIO_E8  & 0xF))) | /* DEBUG */
+	(GPIO_MODE_MUX2 << (2 * (GPIO_E9  & 0xF))) | /* DEBUG */
+	(GPIO_MODE_MUX2 << (2 * (GPIO_E10 & 0xF))) | /* DEBUG */
+	(GPIO_MODE_MUX2 << (2 * (GPIO_E11 & 0xF))) | /* DEBUG */
+	(GPIO_MODE_MUX2 << (2 * (GPIO_E12 & 0xF))) | /* DEBUG */
+	(GPIO_MODE_MUX2 << (2 * (GPIO_E13 & 0xF))) | /* DEBUG */
+	(GPIO_MODE_MUX2 << (2 * (GPIO_E14 & 0xF))) | /* DEBUG */
+	(GPIO_MODE_MUX2 << (2 * (GPIO_E15 & 0xF)))  /* DEBUG */
+ },
+ {
+	SCON_SYSMUX9_REG,
+	0 |
+	(GPIO_MODE_MUX2 << (2 * (GPIO_E16 & 0xF))) | /* DEBUG */
+	(GPIO_MODE_MUX2 << (2 * (GPIO_E17 & 0xF))) | /* DEBUG */
+	(GPIO_MODE_MUX2 << (2 * (GPIO_E18 & 0xF))) | /* DEBUG */
+	(GPIO_MODE_MUX2 << (2 * (GPIO_E19 & 0xF))) | /* DEBUG */
+	(GPIO_MODE_MUX2 << (2 * (GPIO_E20 & 0xF))) | /* DEBUG */
+	(GPIO_MODE_MUX1 << (2 * (GPIO_E21 & 0xF))) | /* SDATO2 -> SPI2 */
+	(GPIO_MODE_MUX1 << (2 * (GPIO_E22 & 0xF))) | /* SDATIN2 -> SPI2 */
+	(GPIO_MODE_MUX1 << (2 * (GPIO_E23 & 0xF))) | /* SCLK2 -> SPI2 */
+	(GPIO_MODE_MUX1 << (2 * (GPIO_E24 & 0xF))) | /* FCI_copy -> FCI */
+	(GPIO_MODE_MUX1 << (2 * (GPIO_E25 & 0xF))) | /* FCI_copy -> FCI */
+	(GPIO_MODE_MUX1 << (2 * (GPIO_E26 & 0xF))) | /* FCI_copy -> FCI */
+	(GPIO_MODE_MUX1 << (2 * (GPIO_E27 & 0xF))) | /* FCI_copy -> FCI */
+	(GPIO_MODE_MUX1 << (2 * (GPIO_E28 & 0xF))) | /* FCI_copy -> FCI */
+	(GPIO_MODE_MUX1 << (2 * (GPIO_E29 & 0xF))) | /* FCI_copy
+							-> FCI USB suspend */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_E30 & 0xF))) | /* RFSM_OUT3 */
+	(GPIO_MODE_MUX1 << (2 * (GPIO_E31 & 0xF)))  /* GPIO CAM */
+ },
+
+#endif
+ {
+	SCON_SYSMUX10_REG,
+	0 |
+#ifdef CONFIG_EBI_BUS
+	(GPIO_MODE_MUX3 << (2 * (GPIO_F0  & 0xF))) | /* EBI_IO0_copy */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_F1  & 0xF))) | /* EBI_OE_RW_copy */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_F2  & 0xF))) | /* EBI_WE_E_copy */
+#else
+	(GPIO_MODE_MUX1 << (2 * (GPIO_F0  & 0xF))) | /* CAM_PWR_REG -> CAM */
+	(GPIO_MODE_MUX1 << (2 * (GPIO_F1  & 0xF))) | /* AGPS FRAME_SYNC, AGPS */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_F2  & 0xF))) | /* free */
+#endif
+	(GPIO_MODE_MUX0 << (2 * (GPIO_F3  & 0xF))) | /* KCOL5 -> Keypad */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_F4  & 0xF))) | /* KCOL6 -> Keypad */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_F5  & 0xF))) | /* KCOL7 -> Keypad */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_F6  & 0xF))) | /* KROW5 -> Keypad */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_F7  & 0xF))) | /* KROW6 -> Keypad */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_F8  & 0xF))) | /* KROW7 -> Keypad */
+	(GPIO_MODE_MUX1 << (2 * (GPIO_F9  & 0xF))) | /* eMMC_PDn -> FCI */
+#ifdef CONFIG_EBI_BUS
+	(GPIO_MODE_MUX3 << (2 * (GPIO_F10 & 0xF))) | /* VDE_CS0_copy */
+	(GPIO_MODE_MUX3 << (2 * (GPIO_F11 & 0xF))) | /* EBI_IO1_copy */
+	(GPIO_MODE_MUX3 << (2 * (GPIO_F12 & 0xF))) | /* EBI_IO2_copy */
+	(GPIO_MODE_MUX3 << (2 * (GPIO_F13 & 0xF))) | /* EBI_IO3_copy */
+	(GPIO_MODE_MUX3 << (2 * (GPIO_F14 & 0xF))) | /* EBI_IO4_copy */
+	(GPIO_MODE_MUX3 << (2 * (GPIO_F15 & 0xF)))  /* EBI_IO5_copy */
+#else
+	(GPIO_MODE_MUX3 << (2 * (GPIO_F10 & 0xF))) | /* VDE */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_F11 & 0xF))) | /* VDE */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_F12 & 0xF))) | /* VDE */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_F13 & 0xF))) | /* VDE */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_F14 & 0xF))) | /* VDE */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_F15 & 0xF)))  /* VDE */
+#endif
+ },
+ {
+	SCON_SYSMUX11_REG,
+	0 |
+#ifdef CONFIG_EBI_BUS
+	(GPIO_MODE_MUX3 << (2 * (GPIO_F16 & 0xF))) | /* EBI_IO6_copy */
+	(GPIO_MODE_MUX3 << (2 * (GPIO_F17 & 0xF))) | /* EBI_IO7_copy */
+#else
+	(GPIO_MODE_MUX0 << (2 * (GPIO_F16 & 0xF))) | /* VDE */
+	(GPIO_MODE_MUX0 << (2 * (GPIO_F17 & 0xF))) | /* VDE */
+#endif
+	(GPIO_MODE_MUX0 << (2 * (GPIO_F18 & 0xF)))  /* NFI_CE_n -> NFI */
+ },
+ /* Configure PAD Value */
+ {
+	SCON_SYSPAD0_REG,
+	0 |
+	(SCON_PAD_REPEATER    << (2 * (GPIO_A0   & 0xF))) |
+	(SCON_PAD_REPEATER    << (2 * (GPIO_A1   & 0xF))) |
+	(SCON_PAD_PLAIN_INPUT << (2 * (GPIO_A2   & 0xF))) |
+	(SCON_PAD_REPEATER    << (2 * (GPIO_A3   & 0xF))) |
+	(SCON_PAD_PLAIN_INPUT << (2 * (GPIO_A4   & 0xF))) |
+	(SCON_PAD_REPEATER    << (2 * (GPIO_A5   & 0xF))) |
+	(SCON_PAD_REPEATER    << (2 * (GPIO_A6   & 0xF))) |
+	(SCON_PAD_REPEATER    << (2 * (GPIO_A7   & 0xF))) |
+	(SCON_PAD_REPEATER    << (2 * (GPIO_A8   & 0xF))) |
+	(SCON_PAD_REPEATER    << (2 * (GPIO_A9   & 0xF))) |
+	(SCON_PAD_REPEATER    << (2 * (GPIO_A10  & 0xF))) |
+	(SCON_PAD_REPEATER    << (2 * (GPIO_A11  & 0xF))) |
+	(SCON_PAD_REPEATER    << (2 * (GPIO_A12  & 0xF))) |
+	(SCON_PAD_REPEATER    << (2 * (GPIO_A13  & 0xF))) |
+	(SCON_PAD_PLAIN_INPUT << (2 * (GPIO_A14  & 0xF))) |
+	(SCON_PAD_REPEATER    << (2 * (GPIO_A15  & 0xF)))
+ },
+ {
+	SCON_SYSPAD1_REG,
+	0 |
+	(SCON_PAD_PLAIN_INPUT << (2 * (GPIO_A16  & 0xF))) |
+	(SCON_PAD_REPEATER    << (2 * (GPIO_A17  & 0xF))) |
+	(SCON_PAD_PLAIN_INPUT << (2 * (GPIO_A18  & 0xF))) |
+	(SCON_PAD_PLAIN_INPUT << (2 * (GPIO_A19  & 0xF))) |
+	(SCON_PAD_REPEATER    << (2 * (GPIO_A20  & 0xF))) |
+	(SCON_PAD_REPEATER    << (2 * (GPIO_A21  & 0xF))) |
+	(SCON_PAD_REPEATER    << (2 * (GPIO_A22  & 0xF))) |
+	(SCON_PAD_REPEATER    << (2 * (GPIO_A23  & 0xF))) |
+	(SCON_PAD_REPEATER    << (2 * (GPIO_A24  & 0xF))) |
+	(SCON_PAD_REPEATER    << (2 * (GPIO_A25  & 0xF))) |
+	(SCON_PAD_REPEATER    << (2 * (GPIO_A26  & 0xF))) |
+	(SCON_PAD_REPEATER    << (2 * (GPIO_A27  & 0xF))) |
+	(SCON_PAD_REPEATER    << (2 * (GPIO_A28  & 0xF))) |
+	(SCON_PAD_REPEATER    << (2 * (GPIO_A29  & 0xF))) |
+	(SCON_PAD_REPEATER    << (2 * (GPIO_A30  & 0xF))) |
+	(SCON_PAD_REPEATER    << (2 * (GPIO_A31  & 0xF)))
+ },
+ {
+	SCON_SYSPAD2_REG,
+	0 |
+	(SCON_PAD_PULL_DOWN   << (2 * (GPIO_B0   & 0xF))) |
+	(SCON_PAD_PULL_DOWN   << (2 * (GPIO_B1   & 0xF))) |
+	(SCON_PAD_REPEATER    << (2 * (GPIO_B2   & 0xF))) |
+	(SCON_PAD_REPEATER    << (2 * (GPIO_B3   & 0xF))) |
+	(SCON_PAD_REPEATER    << (2 * (GPIO_B4   & 0xF))) |
+	(SCON_PAD_REPEATER    << (2 * (GPIO_B5   & 0xF))) |
+	(SCON_PAD_PLAIN_INPUT << (2 * (GPIO_B6   & 0xF))) |
+	(SCON_PAD_REPEATER    << (2 * (GPIO_B7   & 0xF))) |
+	(SCON_PAD_REPEATER    << (2 * (GPIO_B8   & 0xF))) |
+	(SCON_PAD_REPEATER    << (2 * (GPIO_B9   & 0xF))) |
+	(SCON_PAD_REPEATER    << (2 * (GPIO_B10  & 0xF))) |
+	(SCON_PAD_PLAIN_INPUT << (2 * (GPIO_B11  & 0xF))) |
+	(SCON_PAD_REPEATER    << (2 * (GPIO_B12  & 0xF))) |
+	(SCON_PAD_REPEATER    << (2 * (GPIO_B13  & 0xF))) |
+	(SCON_PAD_REPEATER    << (2 * (GPIO_B14  & 0xF))) |
+	(SCON_PAD_REPEATER    << (2 * (GPIO_B15  & 0xF)))
+ },
+};
+
+/* GPIO def settings to avoid HW issue */
+struct u6_gpio_config u6_gpio_init_config[] = {
+	/* GPIO A bank */
+	{
+		.gpio = GPIO_A5,
+		.dir = GPIO_DIR_OUTPUT,
+		.value = 1,
+	},
+	{
+		.gpio = GPIO_A6,
+		.dir = GPIO_DIR_OUTPUT,
+		.value = 1,
+	},
+	{
+		.gpio = GPIO_A7,
+		.dir = GPIO_DIR_OUTPUT,
+		.value = 0,
+	},
+	{
+		.gpio = GPIO_A8,
+		.dir = GPIO_DIR_OUTPUT,
+		.value = 1,
+	},
+	{
+		.gpio = GPIO_A9,
+		.dir = GPIO_DIR_OUTPUT,
+		.value = 1,
+	},
+	{
+		.gpio = GPIO_A13,
+		.dir = GPIO_DIR_OUTPUT,
+		.value = 0,
+	},
+	{
+		.gpio = GPIO_A17,
+		.dir = GPIO_DIR_OUTPUT,
+		.value = 0,
+	},
+	{
+		.gpio = GPIO_A21,
+		.dir = GPIO_DIR_OUTPUT,
+		.value = 0,
+	},
+	{
+		.gpio = GPIO_A23,
+		.dir = GPIO_DIR_OUTPUT,
+		.value = 0,
+	},
+	{
+		.gpio = GPIO_A24,
+		.dir = GPIO_DIR_OUTPUT,
+		.value = 1,
+	},
+	{
+		.gpio = GPIO_A25,
+		.dir = GPIO_DIR_OUTPUT,
+		.value = 0,
+	},
+	{
+		.gpio = GPIO_A30,
+		.dir = GPIO_DIR_OUTPUT,
+		.value = 0,
+	},
+	/* GPIO B bank */
+	/* GPIO C bank */
+	/* GPIO D bank */
+	{
+		.gpio = GPIO_D0,
+		.dir = GPIO_DIR_OUTPUT,
+		.value = 0,
+	},
+	{
+		.gpio = GPIO_D24,
+		.dir = GPIO_DIR_OUTPUT,
+		.value = 0,
+	},
+	{
+		.gpio = GPIO_D29,
+		.dir = GPIO_DIR_OUTPUT,
+		.value = 0,
+	},
+	/* GPIO E bank */
+	{
+		.gpio = GPIO_E31,
+		.dir = GPIO_DIR_OUTPUT,
+		.value = 0,
+	},
+	/* GPIO F bank */
+	{
+		.gpio = GPIO_F0,
+		.dir = GPIO_DIR_OUTPUT,
+		.value = 0,
+	},
+	{
+		.gpio = GPIO_F1,
+		.dir = GPIO_DIR_OUTPUT,
+		.value = 0,
+	},
+	{
+		.gpio = GPIO_F2,
+		.dir = GPIO_DIR_OUTPUT,
+		.value = 0,
+	},
+	{
+		.gpio = GPIO_F9,
+		.dir = GPIO_DIR_OUTPUT,
+		.value = 0,
+	}
+};
+
+u32 gpio_to_configure = ARRAY_SIZE(u6_gpio_init_config);
 
 /* List of board specific devices */
 static struct platform_device *devices[] __initdata = {
@@ -30,6 +497,7 @@ static struct platform_device *devices[] __initdata = {
 
 void __init u67xx_init(void)
 {
+	u6_gpio_init();
 	/* Add specific board devices */
 	platform_add_devices(devices, ARRAY_SIZE(devices));
 }
arch/arm/mach-u67xx/devices.c +67 -0

77 lines not on this page · raw message

arch/arm/plat-u6xxx/Makefile +1 -1
index afdf82b..3d6898e 100644
@@ -3,6 +3,6 @@
 #
 
 # Common support
-obj-y := io.o irq.o clock.o
+obj-y := io.o irq.o clock.o gpio.o
 
 obj-$(CONFIG_U6_MTU_TIMER) += timer.o
arch/arm/plat-u6xxx/gpio.c new file +665 -0

665 lines not on this page · raw message

arch/arm/plat-u6xxx/include/mach/gpio.h new file +391 -0

391 lines not on this page · raw message

arch/arm/plat-u6xxx/include/mach/scon.h new file +123 -0

123 lines not on this page · raw message

Signature · 1 line
1.7.1