Skip to contentSkip to conversation

ARM: S5PV210: Add Samsung S5PV210 CPU support

PATCH Superseded Kukjin Kim 3 participants 4 messages Jan 19, 2010 – Jan 21, 2010

Subsystems (3)

v1 of 5 Superseded Latest is v5 →

lore
Share & tools
lore

Kukjin Kim

author
#0 lore raw

PATCH 1/10 ARM: S5PV210: Add Samsung S5PV210 CPU support

This patch adds support for Samsung S5PV210 CPU. This patch also adds an entry for S5PV210 cpu in plat-s5p cpu table.

---
 arch/arm/mach-s5pv210/cpu.c                      |  126 +++++++++++++++++++++
 arch/arm/mach-s5pv210/include/mach/debug-macro.S |   39 +++++++
 arch/arm/mach-s5pv210/include/mach/entry-macro.S |   54 +++++++++
 arch/arm/mach-s5pv210/include/mach/gpio-core.h   |   19 +++
 arch/arm/mach-s5pv210/include/mach/gpio.h        |  129 ++++++++++++++++++++++
 arch/arm/mach-s5pv210/include/mach/hardware.h    |   18 +++
 arch/arm/mach-s5pv210/include/mach/map.h         |  102 +++++++++++++++++
 arch/arm/mach-s5pv210/include/mach/memory.h      |   20 ++++
 arch/arm/mach-s5pv210/include/mach/system.h      |   26 +++++
 arch/arm/mach-s5pv210/include/mach/uncompress.h  |   24 ++++
 arch/arm/plat-s5p/cpu.c                          |   15 +++
 arch/arm/plat-s5p/include/plat/s5pv210.h         |   37 ++++++
 arch/arm/plat-s5p/s5pv210-init.c                 |   44 ++++++++
 13 files changed, 653 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-s5pv210/cpu.c
 create mode 100644 arch/arm/mach-s5pv210/include/mach/debug-macro.S
 create mode 100644 arch/arm/mach-s5pv210/include/mach/entry-macro.S
 create mode 100644 arch/arm/mach-s5pv210/include/mach/gpio-core.h
 create mode 100644 arch/arm/mach-s5pv210/include/mach/gpio.h
 create mode 100644 arch/arm/mach-s5pv210/include/mach/hardware.h
 create mode 100644 arch/arm/mach-s5pv210/include/mach/map.h
 create mode 100644 arch/arm/mach-s5pv210/include/mach/memory.h
 create mode 100644 arch/arm/mach-s5pv210/include/mach/system.h
 create mode 100644 arch/arm/mach-s5pv210/include/mach/uncompress.h
 create mode 100644 arch/arm/plat-s5p/include/plat/s5pv210.h
 create mode 100644 arch/arm/plat-s5p/s5pv210-init.c
arch/arm/mach-s5pv210/cpu.c new file +126 -0
new file mode 100644
index 0000000..778d2dc
@@ -0,0 +1,126 @@
+/* linux/arch/arm/mach-s5pv210/cpu.c
+ *
+ * Copyright (c) 2010 Samsung Electronics Co., Ltd.
+ *		http://www.samsung.com/
+ *
+ * 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 <linux/kernel.h>
+#include <linux/types.h>
+#include <linux/interrupt.h>
+#include <linux/list.h>
+#include <linux/timer.h>
+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/clk.h>
+#include <linux/io.h>
+#include <linux/sysdev.h>
+#include <linux/platform_device.h>
+
+#include <asm/mach/arch.h>
+#include <asm/mach/map.h>
+#include <asm/mach/irq.h>
+
+#include <asm/proc-fns.h>
+#include <mach/map.h>
+#include <mach/regs-clock.h>
+
+#include <plat/cpu.h>
+#include <plat/devs.h>
+#include <plat/clock.h>
+#include <plat/s5pv210.h>
+
+/* Initial IO mappings */
+
+static struct map_desc s5pv210_iodesc[] __initdata = {
+	{
+		.virtual	= (unsigned long)S5P_VA_SYSTIMER,
+		.pfn		= __phys_to_pfn(S5P_PA_SYSTIMER),
+		.length		= SZ_1M,
+		.type		= MT_DEVICE,
+	}, {
+		.virtual	= (unsigned long)S5P_VA_VIC2,
+		.pfn		= __phys_to_pfn(S5P_PA_VIC2),
+		.length		= SZ_16K,
+		.type		= MT_DEVICE,
+	}, {
+		.virtual	= (unsigned long)S5P_VA_VIC3,
+		.pfn		= __phys_to_pfn(S5P_PA_VIC3),
+		.length		= SZ_16K,
+		.type		= MT_DEVICE,
+	}, {
+		.virtual	= (unsigned long)S5P_VA_SROMC,
+		.pfn		= __phys_to_pfn(S5P_PA_SROMC),
+		.length		= SZ_4K,
+		.type		= MT_DEVICE,
+	}
+};
+
+static void s5pv210_idle(void)
+{
+	if (!need_resched())
+		cpu_do_idle();
+
+	local_irq_enable();
+}
+
+/* s5pv210_map_io
+ *
+ * register the standard cpu IO areas
+*/
+
+void __init s5pv210_map_io(void)
+{
+	iotable_init(s5pv210_iodesc, ARRAY_SIZE(s5pv210_iodesc));
+}
+
+void __init s5pv210_init_clocks(int xtal)
+{
+	printk(KERN_DEBUG "%s: initializing clocks\n", __func__);
+
+	s3c24xx_register_baseclocks(xtal);
+	s5p_register_clocks(xtal);
+	s5pv210_register_clocks();
+	s5pv210_setup_clocks();
+}
+
+void __init s5pv210_init_irq(void)
+{
+	u32 vic[4];	/* S5PV210 supports 4 VIC */
+
+	/* All the VICs are fully populated. */
+	vic[0] = ~0;
+	vic[1] = ~0;
+	vic[2] = ~0;
+	vic[3] = ~0;
+
+	s5p_init_irq(vic, ARRAY_SIZE(vic));
+}
+
+static struct sysdev_class s5pv210_sysclass = {
+	.name	= "s5pv210-core",
+};
+
+static struct sys_device s5pv210_sysdev = {
+	.cls	= &s5pv210_sysclass,
+};
+
+static int __init s5pv210_core_init(void)
+{
+	return sysdev_class_register(&s5pv210_sysclass);
+}
+
+core_initcall(s5pv210_core_init);
+
+int __init s5pv210_init(void)
+{
+	printk(KERN_INFO "S5PV210: Initializing architecture\n");
+
+	/* set idle function */
+	pm_idle = s5pv210_idle;
+
+	return sysdev_register(&s5pv210_sysdev);
+}
arch/arm/mach-s5pv210/include/mach/debug-macro.S new file +39 -0
new file mode 100644
index 0000000..3c568a3
@@ -0,0 +1,39 @@
+/* linux/arch/arm/mach-s5pv210/include/mach/debug-macro.S
+ *
+ * Copyright (c) 2010 Samsung Electronics Co., Ltd.
+ *		http://www.samsung.com/
+ *
+ * Based on arch/arm/mach-s3c6400/include/mach/debug-macro.S
+ *
+ * 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.
+*/
+
+/* pull in the relevant register and map files. */
+
+#include <mach/map.h>
+#include <plat/regs-serial.h>
+
+	/* note, for the boot process to work we have to keep the UART
+	 * virtual address aligned to an 1MiB boundary for the L1
+	 * mapping the head code makes. We keep the UART virtual address
+	 * aligned and add in the offset when we load the value here.
+	 */
+
+	.macro addruart, rx
+		mrc	p15, 0, \rx, c1, c0
+		tst	\rx, #1
+		ldreq	\rx, = S5P_PA_UART
+		ldrne	\rx, = (S5P_VA_UART + S5P_PA_UART & 0xfffff)
+#if CONFIG_DEBUG_S3C_UART != 0
+		add	\rx, \rx, #(0x400 * CONFIG_DEBUG_S3C_UART)
+#endif
+	.endm
+
+/* include the reset of the code which will do the work, we're only
+ * compiling for a single cpu processor type so the default of s3c2440
+ * will be fine with us.
+ */
+
+#include <plat/debug-macro.S>
arch/arm/mach-s5pv210/include/mach/entry-macro.S new file +54 -0

54 lines not on this page · raw message

arch/arm/mach-s5pv210/include/mach/gpio-core.h new file +19 -0
new file mode 100644
index 0000000..acb6a1e
@@ -0,0 +1,19 @@
+/* linux/arch/arm/mach-s5pv210/include/mach/gpio-core.h
+ *
+ * Copyright (c) 2010 Samsung Electronics Co., Ltd.
+ *		http://www.samsung.com/
+ *
+ * S5PV210 - GPIO core support
+ *
+ * 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.
+*/
+
+#ifndef __ASM_ARCH_GPIO_CORE_H
+#define __ASM_ARCH_GPIO_CORE_H __FILE__
+
+/* currently we just include the platform support */
+#include <plat/gpio-core.h>
+
+#endif /* __ASM_ARCH_GPIO_CORE_H */
arch/arm/mach-s5pv210/include/mach/gpio.h new file +129 -0

129 lines not on this page · raw message

arch/arm/mach-s5pv210/include/mach/hardware.h new file +18 -0
new file mode 100644
index 0000000..fada7a3
@@ -0,0 +1,18 @@
+/* linux/arch/arm/mach-s5pv210/include/mach/hardware.h
+ *
+ * Copyright (c) 2010 Samsung Electronics Co., Ltd.
+ *		http://www.samsung.com/
+ *
+ * S5PV210 - Hardware support
+ *
+ * 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.
+*/
+
+#ifndef __ASM_ARCH_HARDWARE_H
+#define __ASM_ARCH_HARDWARE_H __FILE__
+
+/* currently nothing here, placeholder */
+
+#endif /* __ASM_ARCH_HARDWARE_H */
arch/arm/mach-s5pv210/include/mach/map.h new file +102 -0

102 lines not on this page · raw message

arch/arm/mach-s5pv210/include/mach/memory.h new file +20 -0
new file mode 100644
index 0000000..0f07793
@@ -0,0 +1,20 @@
+/* linux/arch/arm/mach-s5pv210/include/mach/memory.h
+ *
+ * Copyright (c) 2010 Samsung Electronics Co., Ltd.
+ *		http://www.samsung.com/
+ *
+ * S5PV210 - Memory definitions
+ *
+ * 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.
+*/
+
+#ifndef __ASM_ARCH_MEMORY_H
+#define __ASM_ARCH_MEMORY_H
+
+#define PHYS_OFFSET		UL(0x20000000)
+#define CONSISTENT_DMA_SIZE	(SZ_8M + SZ_4M + SZ_2M)
+#define NODE_MEM_SIZE_BITS	28
+
+#endif /* __ASM_ARCH_MEMORY_H */
arch/arm/mach-s5pv210/include/mach/system.h new file +26 -0
new file mode 100644
index 0000000..1ca04d5
@@ -0,0 +1,26 @@
+/* linux/arch/arm/mach-s5pv210/include/mach/system.h
+ *
+ * Copyright (c) 2010 Samsung Electronics Co., Ltd.
+ *		http://www.samsung.com/
+ *
+ * S5PV210 - system support 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.
+*/
+
+#ifndef __ASM_ARCH_SYSTEM_H
+#define __ASM_ARCH_SYSTEM_H __FILE__
+
+static void arch_idle(void)
+{
+	/* nothing here yet */
+}
+
+static void arch_reset(char mode, const char *cmd)
+{
+	/* nothing here yet */
+}
+
+#endif /* __ASM_ARCH_SYSTEM_H */
arch/arm/mach-s5pv210/include/mach/uncompress.h new file +24 -0
new file mode 100644
index 0000000..08ff2fd
@@ -0,0 +1,24 @@
+/* linux/arch/arm/mach-s5pv210/include/mach/uncompress.h
+ *
+ * Copyright (c) 2010 Samsung Electronics Co., Ltd.
+ *		http://www.samsung.com/
+ *
+ * S5PV210 - uncompress code
+ *
+ * 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.
+*/
+
+#ifndef __ASM_ARCH_UNCOMPRESS_H
+#define __ASM_ARCH_UNCOMPRESS_H
+
+#include <mach/map.h>
+#include <plat/uncompress.h>
+
+static void arch_detect_cpu(void)
+{
+	/* we do not need to do any cpu detection here at the moment. */
+}
+
+#endif /* __ASM_ARCH_UNCOMPRESS_H */
arch/arm/plat-s5p/cpu.c +15 -0
index 0895a77..b322e4c 100644
@@ -18,10 +18,12 @@
 #include <mach/regs-clock.h>
 #include <plat/cpu.h>
 #include <plat/s5p6440.h>
+#include <plat/s5pv210.h>
 
 /* table of supported CPUs */
 
 static const char name_s5p6440[] = "S5P6440";
+static const char name_s5pv210[] = "S5PV210/S5PC110";
 
 static struct cpu_table cpu_ids[] __initdata = {
 	{
@@ -32,6 +34,14 @@ static struct cpu_table cpu_ids[] __initdata = {
 		.init_uarts	= s5p6440_init_uarts,
 		.init		= s5p6440_init,
 		.name		= name_s5p6440,
+	}, {
+		.idcode		= 0x43110000,
+		.idmask		= 0xfffff000,
+		.map_io		= s5pv210_map_io,
+		.init_clocks	= s5pv210_init_clocks,
+		.init_uarts	= s5pv210_init_uarts,
+		.init		= s5pv210_init,
+		.name		= name_s5pv210,
 	},
 };
 
@@ -41,6 +51,11 @@ static struct cpu_table cpu_ids[] __initdata = {
 
 static struct map_desc s5p_iodesc[] __initdata = {
 	{
+		.virtual	= (unsigned long)S5P_VA_CHIPID,
+		.pfn		= __phys_to_pfn(S5P_PA_CHIPID),
+		.length		= SZ_4K,
+		.type		= MT_DEVICE,
+	}, {
 		.virtual	= (unsigned long)S5P_VA_SYSCON,
 		.pfn		= __phys_to_pfn(S5P_PA_SYSCON),
 		.length		= SZ_64K,
arch/arm/plat-s5p/include/plat/s5pv210.h new file +37 -0
new file mode 100644
index 0000000..db1399c
@@ -0,0 +1,37 @@
+/* linux/arch/arm/plat-s5p/include/plat/s5pv210.h
+ *
+ * Copyright (c) 2010 Samsung Electronics Co., Ltd.
+ *		http://www.samsung.com/
+ *
+ * Header file for s5pv210 cpu support
+ *
+ * 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.
+*/
+
+/* Common init code for S5PV210 related SoCs */
+
+extern void s5pv210_common_init_uarts(struct s3c2410_uartcfg *cfg, int no);
+extern void s5pv210_register_clocks(void);
+extern void s5pv210_setup_clocks(void);
+
+#ifdef CONFIG_CPU_S5PV210
+
+extern  int s5pv210_init(void);
+extern void s5pv210_init_irq(void);
+extern void s5pv210_map_io(void);
+extern void s5pv210_init_clocks(int xtal);
+
+#define s5pv210_init_uarts s5pv210_common_init_uarts
+
+#else
+#define s5pv210_init_clocks NULL
+#define s5pv210_init_uarts NULL
+#define s5pv210_map_io NULL
+#define s5pv210_init NULL
+#endif
+
+/* S5PV210 timer */
+
+extern struct sys_timer s5pv210_timer;
arch/arm/plat-s5p/s5pv210-init.c new file +44 -0

44 lines not on this page · raw message

Signature · 1 line
1.6.2.5
#1 lore raw
Quoted 88 lines · Kukjin Kim

This patch adds support for Samsung S5PV210 CPU. This patch also adds an entry for S5PV210 cpu in plat-s5p cpu table.

---
 arch/arm/mach-s5pv210/cpu.c                      |  126 +++++++++++++++++++++
 arch/arm/mach-s5pv210/include/mach/debug-macro.S |   39 +++++++
 arch/arm/mach-s5pv210/include/mach/entry-macro.S |   54 +++++++++
 arch/arm/mach-s5pv210/include/mach/gpio-core.h   |   19 +++
 arch/arm/mach-s5pv210/include/mach/gpio.h        |  129 ++++++++++++++++++++++
 arch/arm/mach-s5pv210/include/mach/hardware.h    |   18 +++
 arch/arm/mach-s5pv210/include/mach/map.h         |  102 +++++++++++++++++
 arch/arm/mach-s5pv210/include/mach/memory.h      |   20 ++++
 arch/arm/mach-s5pv210/include/mach/system.h      |   26 +++++
 arch/arm/mach-s5pv210/include/mach/uncompress.h  |   24 ++++
 arch/arm/plat-s5p/cpu.c                          |   15 +++
 arch/arm/plat-s5p/include/plat/s5pv210.h         |   37 ++++++
 arch/arm/plat-s5p/s5pv210-init.c                 |   44 ++++++++
 13 files changed, 653 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-s5pv210/cpu.c
 create mode 100644 arch/arm/mach-s5pv210/include/mach/debug-macro.S
 create mode 100644 arch/arm/mach-s5pv210/include/mach/entry-macro.S
 create mode 100644 arch/arm/mach-s5pv210/include/mach/gpio-core.h
 create mode 100644 arch/arm/mach-s5pv210/include/mach/gpio.h
 create mode 100644 arch/arm/mach-s5pv210/include/mach/hardware.h
 create mode 100644 arch/arm/mach-s5pv210/include/mach/map.h
 create mode 100644 arch/arm/mach-s5pv210/include/mach/memory.h
 create mode 100644 arch/arm/mach-s5pv210/include/mach/system.h
 create mode 100644 arch/arm/mach-s5pv210/include/mach/uncompress.h
 create mode 100644 arch/arm/plat-s5p/include/plat/s5pv210.h
 create mode 100644 arch/arm/plat-s5p/s5pv210-init.c
arch/arm/mach-s5pv210/cpu.c new file +50 -0
new file mode 100644
index 0000000..778d2dc
@@ -0,0 +1,126 @@
+/* linux/arch/arm/mach-s5pv210/cpu.c
+ *
+ * Copyright (c) 2010 Samsung Electronics Co., Ltd.
+ *		http://www.samsung.com/
+ *
+ * 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 <linux/kernel.h>
+#include <linux/types.h>
+#include <linux/interrupt.h>
+#include <linux/list.h>
+#include <linux/timer.h>
+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/clk.h>
+#include <linux/io.h>
+#include <linux/sysdev.h>
+#include <linux/platform_device.h>
+
+#include <asm/mach/arch.h>
+#include <asm/mach/map.h>
+#include <asm/mach/irq.h>
+
+#include <asm/proc-fns.h>
+#include <mach/map.h>
+#include <mach/regs-clock.h>
+
+#include <plat/cpu.h>
+#include <plat/devs.h>
+#include <plat/clock.h>
+#include <plat/s5pv210.h>
+
+/* Initial IO mappings */
+
+static struct map_desc s5pv210_iodesc[] __initdata = {
+	{
+		.virtual	= (unsigned long)S5P_VA_SYSTIMER,
+		.pfn		= __phys_to_pfn(S5P_PA_SYSTIMER),
+		.length		= SZ_1M,
+		.type		= MT_DEVICE,
+	}, {
+		.virtual	= (unsigned long)S5P_VA_VIC2,
+		.pfn		= __phys_to_pfn(S5P_PA_VIC2),
+		.length		= SZ_16K,
+		.type		= MT_DEVICE,
+	}, {
+		.virtual	= (unsigned long)S5P_VA_VIC3,

arch/arm/mach-s5pv210/cpu.c line 60

Quoted 10 lines
arch/arm/mach-s5pv210/cpu.c new file +10 -0
+		.pfn		= __phys_to_pfn(S5P_PA_VIC3),
+		.length		= SZ_16K,
+		.type		= MT_DEVICE,
+	}, {
+		.virtual	= (unsigned long)S5P_VA_SROMC,
+		.pfn		= __phys_to_pfn(S5P_PA_SROMC),
+		.length		= SZ_4K,
+		.type		= MT_DEVICE,
+	}
+};

Since this table is in s5pv210 specific code, let's call the PA addresses such as S5P_PA_VIC2 S5PV210_PA_VIC2 to distinguish them from the other platform's variants.

Quoted 30 lines
arch/arm/mach-s5pv210/cpu.c new file +30 -0
+static void s5pv210_idle(void)
+{
+	if (!need_resched())
+		cpu_do_idle();
+
+	local_irq_enable();
+}
+
+/* s5pv210_map_io
+ *
+ * register the standard cpu IO areas
+*/
+
+void __init s5pv210_map_io(void)
+{
+	iotable_init(s5pv210_iodesc, ARRAY_SIZE(s5pv210_iodesc));
+}
+
+void __init s5pv210_init_clocks(int xtal)
+{
+	printk(KERN_DEBUG "%s: initializing clocks\n", __func__);
+
+	s3c24xx_register_baseclocks(xtal);
+	s5p_register_clocks(xtal);
+	s5pv210_register_clocks();
+	s5pv210_setup_clocks();
+}
+
+void __init s5pv210_init_irq(void)
+{

arch/arm/mach-s5pv210/cpu.c line 101

Quoted 10 lines
arch/arm/mach-s5pv210/cpu.c new file +10 -0
+	u32 vic[4];	/* S5PV210 supports 4 VIC */
+
+	/* All the VICs are fully populated. */
+	vic[0] = ~0;
+	vic[1] = ~0;
+	vic[2] = ~0;
+	vic[3] = ~0;
+
+	s5p_init_irq(vic, ARRAY_SIZE(vic));
+}

I'm begining to think we should move the vic initialisation to these functions and avoid having to pass an array and size about. I'll think about this one, maybe somethign to change once we've merged support for these systems.

Quoted 144 lines
arch/arm/mach-s5pv210/cpu.c new file +24 -0
+static struct sysdev_class s5pv210_sysclass = {
+	.name	= "s5pv210-core",
+};
+
+static struct sys_device s5pv210_sysdev = {
+	.cls	= &s5pv210_sysclass,
+};
+
+static int __init s5pv210_core_init(void)
+{
+	return sysdev_class_register(&s5pv210_sysclass);
+}
+
+core_initcall(s5pv210_core_init);
+
+int __init s5pv210_init(void)
+{
+	printk(KERN_INFO "S5PV210: Initializing architecture\n");
+
+	/* set idle function */
+	pm_idle = s5pv210_idle;
+
+	return sysdev_register(&s5pv210_sysdev);
+}
arch/arm/mach-s5pv210/include/mach/debug-macro.S new file +39 -0
new file mode 100644
index 0000000..3c568a3
@@ -0,0 +1,39 @@
+/* linux/arch/arm/mach-s5pv210/include/mach/debug-macro.S
+ *
+ * Copyright (c) 2010 Samsung Electronics Co., Ltd.
+ *		http://www.samsung.com/
+ *
+ * Based on arch/arm/mach-s3c6400/include/mach/debug-macro.S
+ *
+ * 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.
+*/
+
+/* pull in the relevant register and map files. */
+
+#include <mach/map.h>
+#include <plat/regs-serial.h>
+
+	/* note, for the boot process to work we have to keep the UART
+	 * virtual address aligned to an 1MiB boundary for the L1
+	 * mapping the head code makes. We keep the UART virtual address
+	 * aligned and add in the offset when we load the value here.
+	 */
+
+	.macro addruart, rx
+		mrc	p15, 0, \rx, c1, c0
+		tst	\rx, #1
+		ldreq	\rx, = S5P_PA_UART
+		ldrne	\rx, = (S5P_VA_UART + S5P_PA_UART & 0xfffff)
+#if CONFIG_DEBUG_S3C_UART != 0
+		add	\rx, \rx, #(0x400 * CONFIG_DEBUG_S3C_UART)
+#endif
+	.endm
+
+/* include the reset of the code which will do the work, we're only
+ * compiling for a single cpu processor type so the default of s3c2440
+ * will be fine with us.
+ */
+
+#include <plat/debug-macro.S>
arch/arm/mach-s5pv210/include/mach/entry-macro.S new file +54 -0
new file mode 100644
index 0000000..503c1ec
@@ -0,0 +1,54 @@
+/* linux/arch/arm/mach-s5pv210/include/mach/entry-macro.S
+ *
+ * Copyright (c) 2010 Samsung Electronics Co., Ltd.
+ *		http://www.samsung.com/
+ *
+ * Low-level IRQ helper macros for the Samsung S5PV210
+ *
+ * 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 <asm/hardware/vic.h>
+#include <mach/map.h>
+#include <plat/irqs.h>
+
+	.macro	disable_fiq
+	.endm
+
+	.macro	get_irqnr_preamble, base, tmp
+	ldr	\base, =S5P_VA_VIC0
+	.endm
+
+	.macro	arch_ret_to_user, tmp1, tmp2
+	.endm
+
+	.macro	get_irqnr_and_base, irqnr, irqstat, base, tmp
+
+	@ check the vic0
+	mov	\irqnr, # S5P_IRQ_OFFSET + 31
+	ldr	\irqstat, [ \base, # VIC_IRQ_STATUS ]
+	teq	\irqstat, #0
+
+	@ otherwise try vic1
+	addeq	\tmp, \base, #(S5P_VA_VIC1 - S5P_VA_VIC0)
+	addeq	\irqnr, \irqnr, #32
+	ldreq	\irqstat, [ \tmp, # VIC_IRQ_STATUS ]
+	teqeq	\irqstat, #0
+
+	@ otherwise try vic2
+	addeq	\tmp, \base, #(S5P_VA_VIC2 - S5P_VA_VIC0)
+	addeq	\irqnr, \irqnr, #32
+	ldreq	\irqstat, [ \tmp, # VIC_IRQ_STATUS ]
+	teqeq	\irqstat, #0
+
+	@ otherwise try vic3
+	addeq	\tmp, \base, #(S5P_VA_VIC3 - S5P_VA_VIC0)
+	addeq	\irqnr, \irqnr, #32
+	ldreq	\irqstat, [ \tmp, # VIC_IRQ_STATUS ]
+	teqeq	\irqstat, #0
+
+	clzne	\irqstat, \irqstat
+	subne	\irqnr, \irqnr, \irqstat
+	.endm
arch/arm/mach-s5pv210/include/mach/gpio-core.h new file +9 -0
new file mode 100644
index 0000000..acb6a1e
@@ -0,0 +1,19 @@
+/* linux/arch/arm/mach-s5pv210/include/mach/gpio-core.h
+ *
+ * Copyright (c) 2010 Samsung Electronics Co., Ltd.
+ *		http://www.samsung.com/
+ *
+ * S5PV210 - GPIO core support
+ *
+ * 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

arch/arm/mach-s5pv210/include/mach/gpio-core.h line 19

Quoted 10 lines
arch/arm/mach-s5pv210/include/mach/gpio-core.h new file +10 -0
+ * published by the Free Software Foundation.
+*/
+
+#ifndef __ASM_ARCH_GPIO_CORE_H
+#define __ASM_ARCH_GPIO_CORE_H __FILE__
+
+/* currently we just include the platform support */
+#include <plat/gpio-core.h>
+
+#endif /* __ASM_ARCH_GPIO_CORE_H */

I'm hoping we can eliminate the gpio-core.h before merging.

Quoted 257 lines
arch/arm/mach-s5pv210/include/mach/gpio.h new file +129 -0
new file mode 100644
index 0000000..533b020
@@ -0,0 +1,129 @@
+/* linux/arch/arm/mach-s5pv210/include/mach/gpio.h
+ *
+ * Copyright (c) 2010 Samsung Electronics Co., Ltd.
+ *		http://www.samsung.com/
+ *
+ * S5PV210 - GPIO lib support
+ *
+ * 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.
+*/
+
+#ifndef __ASM_ARCH_GPIO_H
+#define __ASM_ARCH_GPIO_H __FILE__
+
+#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
+
+/* GPIO bank sizes */
+#define S5PV210_GPIO_A0_NR	(8)
+#define S5PV210_GPIO_A1_NR	(4)
+#define S5PV210_GPIO_B_NR	(8)
+#define S5PV210_GPIO_C0_NR	(5)
+#define S5PV210_GPIO_C1_NR	(5)
+#define S5PV210_GPIO_D0_NR	(4)
+#define S5PV210_GPIO_D1_NR	(6)
+#define S5PV210_GPIO_E0_NR	(8)
+#define S5PV210_GPIO_E1_NR	(5)
+#define S5PV210_GPIO_F0_NR	(8)
+#define S5PV210_GPIO_F1_NR	(8)
+#define S5PV210_GPIO_F2_NR	(8)
+#define S5PV210_GPIO_F3_NR	(6)
+#define S5PV210_GPIO_G0_NR	(7)
+#define S5PV210_GPIO_G1_NR	(7)
+#define S5PV210_GPIO_G2_NR	(7)
+#define S5PV210_GPIO_G3_NR	(7)
+#define S5PV210_GPIO_H0_NR	(8)
+#define S5PV210_GPIO_H1_NR	(8)
+#define S5PV210_GPIO_H2_NR	(8)
+#define S5PV210_GPIO_H3_NR	(8)
+#define S5PV210_GPIO_I_NR	(7)
+#define S5PV210_GPIO_J0_NR	(8)
+#define S5PV210_GPIO_J1_NR	(6)
+#define S5PV210_GPIO_J2_NR	(8)
+#define S5PV210_GPIO_J3_NR	(8)
+#define S5PV210_GPIO_J4_NR	(5)
+
+/* GPIO bank numbers */
+
+/* CONFIG_S3C_GPIO_SPACE allows the user to select extra
+ * space for debugging purposes so that any accidental
+ * change from one gpio bank to another can be caught.
+*/
+
+#define S5PV210_GPIO_NEXT(__gpio) \
+	((__gpio##_START) + (__gpio##_NR) + CONFIG_S3C_GPIO_SPACE + 1)
+
+enum s5p_gpio_number {
+	S5PV210_GPIO_A0_START	= 0,
+	S5PV210_GPIO_A1_START	= S5PV210_GPIO_NEXT(S5PV210_GPIO_A0),
+	S5PV210_GPIO_B_START 	= S5PV210_GPIO_NEXT(S5PV210_GPIO_A1),
+	S5PV210_GPIO_C0_START	= S5PV210_GPIO_NEXT(S5PV210_GPIO_B),
+	S5PV210_GPIO_C1_START	= S5PV210_GPIO_NEXT(S5PV210_GPIO_C0),
+	S5PV210_GPIO_D0_START	= S5PV210_GPIO_NEXT(S5PV210_GPIO_C1),
+	S5PV210_GPIO_D1_START	= S5PV210_GPIO_NEXT(S5PV210_GPIO_D0),
+	S5PV210_GPIO_E0_START	= S5PV210_GPIO_NEXT(S5PV210_GPIO_D1),
+	S5PV210_GPIO_E1_START	= S5PV210_GPIO_NEXT(S5PV210_GPIO_E0),
+	S5PV210_GPIO_F0_START	= S5PV210_GPIO_NEXT(S5PV210_GPIO_E1),
+	S5PV210_GPIO_F1_START	= S5PV210_GPIO_NEXT(S5PV210_GPIO_F0),
+	S5PV210_GPIO_F2_START	= S5PV210_GPIO_NEXT(S5PV210_GPIO_F1),
+	S5PV210_GPIO_F3_START	= S5PV210_GPIO_NEXT(S5PV210_GPIO_F2),
+	S5PV210_GPIO_G0_START	= S5PV210_GPIO_NEXT(S5PV210_GPIO_F3),
+	S5PV210_GPIO_G1_START	= S5PV210_GPIO_NEXT(S5PV210_GPIO_G0),
+	S5PV210_GPIO_G2_START	= S5PV210_GPIO_NEXT(S5PV210_GPIO_G1),
+	S5PV210_GPIO_G3_START	= S5PV210_GPIO_NEXT(S5PV210_GPIO_G2),
+	S5PV210_GPIO_H0_START	= S5PV210_GPIO_NEXT(S5PV210_GPIO_G3),
+	S5PV210_GPIO_H1_START	= S5PV210_GPIO_NEXT(S5PV210_GPIO_H0),
+	S5PV210_GPIO_H2_START	= S5PV210_GPIO_NEXT(S5PV210_GPIO_H1),
+	S5PV210_GPIO_H3_START	= S5PV210_GPIO_NEXT(S5PV210_GPIO_H2),
+	S5PV210_GPIO_I_START	= S5PV210_GPIO_NEXT(S5PV210_GPIO_H3),
+	S5PV210_GPIO_J0_START	= S5PV210_GPIO_NEXT(S5PV210_GPIO_I),
+	S5PV210_GPIO_J1_START	= S5PV210_GPIO_NEXT(S5PV210_GPIO_J0),
+	S5PV210_GPIO_J2_START	= S5PV210_GPIO_NEXT(S5PV210_GPIO_J1),
+	S5PV210_GPIO_J3_START	= S5PV210_GPIO_NEXT(S5PV210_GPIO_J2),
+	S5PV210_GPIO_J4_START	= S5PV210_GPIO_NEXT(S5PV210_GPIO_J3),
+};
+
+/* S5PV210 GPIO number definitions */
+#define S5PV210_GPA0(_nr)	(S5PV210_GPIO_A0_START + (_nr))
+#define S5PV210_GPA1(_nr)	(S5PV210_GPIO_A1_START + (_nr))
+#define S5PV210_GPB(_nr)	(S5PV210_GPIO_B_START + (_nr))
+#define S5PV210_GPC0(_nr)	(S5PV210_GPIO_C0_START + (_nr))
+#define S5PV210_GPC1(_nr)	(S5PV210_GPIO_C1_START + (_nr))
+#define S5PV210_GPD0(_nr)	(S5PV210_GPIO_D0_START + (_nr))
+#define S5PV210_GPD1(_nr)	(S5PV210_GPIO_D1_START + (_nr))
+#define S5PV210_GPE0(_nr)	(S5PV210_GPIO_E0_START + (_nr))
+#define S5PV210_GPE1(_nr)	(S5PV210_GPIO_E1_START + (_nr))
+#define S5PV210_GPF0(_nr)	(S5PV210_GPIO_F0_START + (_nr))
+#define S5PV210_GPF1(_nr)	(S5PV210_GPIO_F1_START + (_nr))
+#define S5PV210_GPF2(_nr)	(S5PV210_GPIO_F2_START + (_nr))
+#define S5PV210_GPF3(_nr)	(S5PV210_GPIO_F3_START + (_nr))
+#define S5PV210_GPG0(_nr)	(S5PV210_GPIO_G0_START + (_nr))
+#define S5PV210_GPG1(_nr)	(S5PV210_GPIO_G1_START + (_nr))
+#define S5PV210_GPG2(_nr)	(S5PV210_GPIO_G2_START + (_nr))
+#define S5PV210_GPG3(_nr)	(S5PV210_GPIO_G3_START + (_nr))
+#define S5PV210_GPH0(_nr)	(S5PV210_GPIO_H0_START + (_nr))
+#define S5PV210_GPH1(_nr)	(S5PV210_GPIO_H1_START + (_nr))
+#define S5PV210_GPH2(_nr)	(S5PV210_GPIO_H2_START + (_nr))
+#define S5PV210_GPH3(_nr)	(S5PV210_GPIO_H3_START + (_nr))
+#define S5PV210_GPI(_nr)	(S5PV210_GPIO_I_START + (_nr))
+#define S5PV210_GPJ0(_nr)	(S5PV210_GPIO_J0_START + (_nr))
+#define S5PV210_GPJ1(_nr)	(S5PV210_GPIO_J1_START + (_nr))
+#define S5PV210_GPJ2(_nr)	(S5PV210_GPIO_J2_START + (_nr))
+#define S5PV210_GPJ3(_nr)	(S5PV210_GPIO_J3_START + (_nr))
+#define S5PV210_GPJ4(_nr)	(S5PV210_GPIO_J4_START + (_nr))
+
+/* the end of the S5PV210 specific gpios */
+#define S5PV210_GPIO_END	(S5PV210_GPJ4(S5PV210_GPIO_J4_NR) + 1)
+#define S3C_GPIO_END		S5PV210_GPIO_END
+
+/* define the number of gpios we need to the one after the GPJ4() range */
+#define ARCH_NR_GPIOS		(S5PV210_GPJ4(S5PV210_GPIO_J4_NR) +	\
+				 CONFIG_SAMSUNG_GPIO_EXTRA + 1)
+
+#include <asm-generic/gpio.h>
+
+#endif /* __ASM_ARCH_GPIO_H */
arch/arm/mach-s5pv210/include/mach/hardware.h new file +18 -0
new file mode 100644
index 0000000..fada7a3
@@ -0,0 +1,18 @@
+/* linux/arch/arm/mach-s5pv210/include/mach/hardware.h
+ *
+ * Copyright (c) 2010 Samsung Electronics Co., Ltd.
+ *		http://www.samsung.com/
+ *
+ * S5PV210 - Hardware support
+ *
+ * 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.
+*/
+
+#ifndef __ASM_ARCH_HARDWARE_H
+#define __ASM_ARCH_HARDWARE_H __FILE__
+
+/* currently nothing here, placeholder */
+
+#endif /* __ASM_ARCH_HARDWARE_H */
arch/arm/mach-s5pv210/include/mach/map.h new file +92 -0
new file mode 100644
index 0000000..dd5a811
@@ -0,0 +1,102 @@
+/* linux/arch/arm/mach-s5pv210/include/mach/map.h
+ *
+ * Copyright (c) 2010 Samsung Electronics Co., Ltd.
+ *		http://www.samsung.com/
+ *
+ * S5PV210 - Memory map definitions
+ *
+ * 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.
+*/
+
+#ifndef __ASM_ARCH_MAP_H
+#define __ASM_ARCH_MAP_H __FILE__
+
+#include <plat/map-base.h>
+
+/* Chip ID */
+#define S5PV210_PA_CHIPID	(0xE0000000)
+#define S5P_PA_CHIPID		S5PV210_PA_CHIPID
+#define S5P_VA_CHIPID		S3C_ADDR(0x00700000)
+
+/* SYSCON */
+#define S5PV210_PA_SYSCON	(0xE0100000)
+#define S5P_PA_SYSCON		S5PV210_PA_SYSCON
+#define S5P_VA_SYSCON		S3C_VA_SYS
+
+/* GPIO */
+#define S5PV210_PA_GPIO		(0xE0200000)
+#define S5P_PA_GPIO		S5PV210_PA_GPIO
+#define S5P_VA_GPIO		S3C_ADDR(0x00500000)
+
+/* I2C 0 */
+#define S5PV210_PA_IIC0		(0xE1800000)
+#define S5P_PA_IIC0		S5PV210_PA_IIC0
+
+/* Timer */
+#define S5PV210_PA_TIMER	(0xE2500000)
+#define S5P_PA_TIMER		S5PV210_PA_TIMER
+#define S5P_VA_TIMER		S3C_VA_TIMER
+
+/* SYSTEM TIMER */
+#define S5PV210_PA_SYSTIMER	(0xE2600000)
+#define S5P_PA_SYSTIMER		S5PV210_PA_SYSTIMER
+#define S5P_VA_SYSTIMER		S3C_ADDR(0x01200000)
+
+/* UART */
+#define S5PV210_PA_UART		(0xE2900000)
+#define S5P_PA_UART		S5PV210_PA_UART
+#define S5P_VA_UART		S3C_VA_UART
+
+#define S5P_PA_UART0		(S5P_PA_UART + 0x0)
+#define S5P_PA_UART1		(S5P_PA_UART + 0x400)
+#define S5P_PA_UART2		(S5P_PA_UART + 0x800)
+#define S5P_PA_UART3		(S5P_PA_UART + 0xC00)
+#define S5P_UART_OFFSET		(0x400)
+
+#define S5P_VA_UARTx(x)		(S5P_VA_UART + (S5P_PA_UART & 0xfffff) \
+				+ ((x) * S5P_UART_OFFSET))
+
+#define S5P_VA_UART0		S5P_VA_UARTx(0)
+#define S5P_VA_UART1		S5P_VA_UARTx(1)
+#define S5P_VA_UART2		S5P_VA_UARTx(2)
+#define S5P_VA_UART3		S5P_VA_UARTx(3)
+#define S5P_SZ_UART		SZ_256
+
+/* SROMC */
+#define S5PV210_PA_SROMC	(0xE8000000)
+#define S5P_PA_SROMC		S5PV210_PA_SROMC
+#define S5P_VA_SROMC		S3C_ADDR(0x01100000)
+
+/* VIC 0 */
+#define S5PV210_PA_VIC0		(0xF2000000)
+#define S5P_PA_VIC0		S5PV210_PA_VIC0
+#define S5P_VA_VIC0		(S3C_VA_IRQ + 0x0)
+
+/* VIC 1 */
+#define S5PV210_PA_VIC1		(0xF2100000)
+#define S5P_PA_VIC1		S5PV210_PA_VIC1
+#define S5P_VA_VIC1		(S3C_VA_IRQ + 0x10000)
+
+/* VIC 2 */
+#define S5PV210_PA_VIC2		(0xF2200000)
+#define S5P_PA_VIC2		S5PV210_PA_VIC2
+#define S5P_VA_VIC2		(S3C_VA_IRQ + 0x20000)
+
+/* VIC 3 */
+#define S5PV210_PA_VIC3		(0xF2300000)
+#define S5P_PA_VIC3		S5PV210_PA_VIC3
+#define S5P_VA_VIC3		(S3C_VA_IRQ + 0x30000)
+
+/* SDRAM */

arch/arm/mach-s5pv210/include/mach/map.h line 102

Quoted 10 lines
arch/arm/mach-s5pv210/include/mach/map.h new file +10 -0
+#define S5PV210_PA_SDRAM	(0x20000000)
+#define S5P_PA_SDRAM		S5PV210_PA_SDRAM
+
+/* compatibiltiy defines. */
+#define S3C_PA_UART		S5P_PA_UART
+#define S3C_UART_OFFSET		S5P_UART_OFFSET
+#define S3C_PA_TIMER		S5P_PA_TIMER
+#define S3C_PA_IIC		S5P_PA_IIC0
+
+#endif /* __ASM_ARCH_MAP_H */

I'd realy like to move away from defining these S5P_ addresses at compile time even if this may mean making the per-cpu support a bit bigger by including a copy of the iodesc table used to initialise the IO mappings.

However this might be something to deal with once this is merged.

Quoted 227 lines
arch/arm/mach-s5pv210/include/mach/memory.h new file +20 -0
new file mode 100644
index 0000000..0f07793
@@ -0,0 +1,20 @@
+/* linux/arch/arm/mach-s5pv210/include/mach/memory.h
+ *
+ * Copyright (c) 2010 Samsung Electronics Co., Ltd.
+ *		http://www.samsung.com/
+ *
+ * S5PV210 - Memory definitions
+ *
+ * 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.
+*/
+
+#ifndef __ASM_ARCH_MEMORY_H
+#define __ASM_ARCH_MEMORY_H
+
+#define PHYS_OFFSET		UL(0x20000000)
+#define CONSISTENT_DMA_SIZE	(SZ_8M + SZ_4M + SZ_2M)
+#define NODE_MEM_SIZE_BITS	28
+
+#endif /* __ASM_ARCH_MEMORY_H */
arch/arm/mach-s5pv210/include/mach/system.h new file +26 -0
new file mode 100644
index 0000000..1ca04d5
@@ -0,0 +1,26 @@
+/* linux/arch/arm/mach-s5pv210/include/mach/system.h
+ *
+ * Copyright (c) 2010 Samsung Electronics Co., Ltd.
+ *		http://www.samsung.com/
+ *
+ * S5PV210 - system support 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.
+*/
+
+#ifndef __ASM_ARCH_SYSTEM_H
+#define __ASM_ARCH_SYSTEM_H __FILE__
+
+static void arch_idle(void)
+{
+	/* nothing here yet */
+}
+
+static void arch_reset(char mode, const char *cmd)
+{
+	/* nothing here yet */
+}
+
+#endif /* __ASM_ARCH_SYSTEM_H */
arch/arm/mach-s5pv210/include/mach/uncompress.h new file +24 -0
new file mode 100644
index 0000000..08ff2fd
@@ -0,0 +1,24 @@
+/* linux/arch/arm/mach-s5pv210/include/mach/uncompress.h
+ *
+ * Copyright (c) 2010 Samsung Electronics Co., Ltd.
+ *		http://www.samsung.com/
+ *
+ * S5PV210 - uncompress code
+ *
+ * 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.
+*/
+
+#ifndef __ASM_ARCH_UNCOMPRESS_H
+#define __ASM_ARCH_UNCOMPRESS_H
+
+#include <mach/map.h>
+#include <plat/uncompress.h>
+
+static void arch_detect_cpu(void)
+{
+	/* we do not need to do any cpu detection here at the moment. */
+}
+
+#endif /* __ASM_ARCH_UNCOMPRESS_H */
arch/arm/plat-s5p/cpu.c +15 -0
index 0895a77..b322e4c 100644
@@ -18,10 +18,12 @@
 #include <mach/regs-clock.h>
 #include <plat/cpu.h>
 #include <plat/s5p6440.h>
+#include <plat/s5pv210.h>
 
 /* table of supported CPUs */
 
 static const char name_s5p6440[] = "S5P6440";
+static const char name_s5pv210[] = "S5PV210/S5PC110";
 
 static struct cpu_table cpu_ids[] __initdata = {
 	{
@@ -32,6 +34,14 @@ static struct cpu_table cpu_ids[] __initdata = {
 		.init_uarts	= s5p6440_init_uarts,
 		.init		= s5p6440_init,
 		.name		= name_s5p6440,
+	}, {
+		.idcode		= 0x43110000,
+		.idmask		= 0xfffff000,
+		.map_io		= s5pv210_map_io,
+		.init_clocks	= s5pv210_init_clocks,
+		.init_uarts	= s5pv210_init_uarts,
+		.init		= s5pv210_init,
+		.name		= name_s5pv210,
 	},
 };
 
@@ -41,6 +51,11 @@ static struct cpu_table cpu_ids[] __initdata = {
 
 static struct map_desc s5p_iodesc[] __initdata = {
 	{
+		.virtual	= (unsigned long)S5P_VA_CHIPID,
+		.pfn		= __phys_to_pfn(S5P_PA_CHIPID),
+		.length		= SZ_4K,
+		.type		= MT_DEVICE,
+	}, {
 		.virtual	= (unsigned long)S5P_VA_SYSCON,
 		.pfn		= __phys_to_pfn(S5P_PA_SYSCON),
 		.length		= SZ_64K,
arch/arm/plat-s5p/include/plat/s5pv210.h new file +37 -0
new file mode 100644
index 0000000..db1399c
@@ -0,0 +1,37 @@
+/* linux/arch/arm/plat-s5p/include/plat/s5pv210.h
+ *
+ * Copyright (c) 2010 Samsung Electronics Co., Ltd.
+ *		http://www.samsung.com/
+ *
+ * Header file for s5pv210 cpu support
+ *
+ * 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.
+*/
+
+/* Common init code for S5PV210 related SoCs */
+
+extern void s5pv210_common_init_uarts(struct s3c2410_uartcfg *cfg, int no);
+extern void s5pv210_register_clocks(void);
+extern void s5pv210_setup_clocks(void);
+
+#ifdef CONFIG_CPU_S5PV210
+
+extern  int s5pv210_init(void);
+extern void s5pv210_init_irq(void);
+extern void s5pv210_map_io(void);
+extern void s5pv210_init_clocks(int xtal);
+
+#define s5pv210_init_uarts s5pv210_common_init_uarts
+
+#else
+#define s5pv210_init_clocks NULL
+#define s5pv210_init_uarts NULL
+#define s5pv210_map_io NULL
+#define s5pv210_init NULL
+#endif
+
+/* S5PV210 timer */
+
+extern struct sys_timer s5pv210_timer;
arch/arm/plat-s5p/s5pv210-init.c new file +44 -0
new file mode 100644
index 0000000..619d058
@@ -0,0 +1,44 @@
+/* linux/arch/arm/plat-s5p/s5pv210-init.c
+ *
+ * Copyright (c) 2010 Samsung Electronics Co., Ltd.
+ *		http://www.samsung.com/
+ *
+ * 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 <linux/kernel.h>
+#include <linux/types.h>
+#include <linux/init.h>
+#include <linux/serial_core.h>
+
+#include <plat/cpu.h>
+#include <plat/devs.h>
+#include <plat/s5pv210.h>
+#include <plat/regs-serial.h>
+
+static struct s3c24xx_uart_clksrc s5pv210_serial_clocks[] = {
+	[0] = {
+		.name		= "pclk",
+		.divisor	= 1,
+		.min_baud	= 0,
+		.max_baud	= 0,
+	},
+};
+
+/* uart registration process */
+void __init s5pv210_common_init_uarts(struct s3c2410_uartcfg *cfg, int no)
+{
+	struct s3c2410_uartcfg *tcfg = cfg;
+	u32 ucnt;
+
+	for (ucnt = 0; ucnt < no; ucnt++, tcfg++) {
+		if (!tcfg->clocks) {
+			tcfg->clocks = s5pv210_serial_clocks;
+			tcfg->clocks_size = ARRAY_SIZE(s5pv210_serial_clocks);
+		}
+	}
+
+	s3c24xx_init_uartdevs("s5pv210-uart", s5p_uart_resources, cfg, no);
+}
Signature · 1 line
1.6.2.5
Signature · 4 lines
Ben

Q:      What's a light-year?
A:      One-third less calories than a regular year.
#2 lore raw
In reply to Kukjin Kim
Quoted 338 lines · Kukjin Kim

This patch adds support for Samsung S5PV210 CPU. This patch also adds an entry for S5PV210 cpu in plat-s5p cpu table.

---
 arch/arm/mach-s5pv210/cpu.c                      |  126 +++++++++++++++++++++ arch/arm/mach-s5pv210/include/mach/debug-macro.S |   39 +++++++ arch/arm/mach-s5pv210/include/mach/entry-macro.S |   54 +++++++++ arch/arm/mach-s5pv210/include/mach/gpio-core.h   |   19 +++ arch/arm/mach-s5pv210/include/mach/gpio.h        |  129 ++++++++++++++++++++++ arch/arm/mach-s5pv210/include/mach/hardware.h    |   18 +++ arch/arm/mach-s5pv210/include/mach/map.h         |  102 +++++++++++++++++ arch/arm/mach-s5pv210/include/mach/memory.h      |   20 ++++ arch/arm/mach-s5pv210/include/mach/system.h      |   26 +++++ arch/arm/mach-s5pv210/include/mach/uncompress.h  |   24 ++++ arch/arm/plat-s5p/cpu.c                          |   15 +++ arch/arm/plat-s5p/include/plat/s5pv210.h         |   37 ++++++ arch/arm/plat-s5p/s5pv210-init.c                 |   44 ++++++++

 13 files changed, 653 insertions(+), 0 deletions(-)

 create mode 100644 arch/arm/mach-s5pv210/cpu.c
 create mode 100644 arch/arm/mach-s5pv210/include/mach/debug-macro.S create mode 100644 arch/arm/mach-s5pv210/include/mach/entry-macro.S create mode 100644 arch/arm/mach-s5pv210/include/mach/gpio-core.h create mode 100644 arch/arm/mach-s5pv210/include/mach/gpio.h create mode 100644 arch/arm/mach-s5pv210/include/mach/hardware.h create mode 100644 arch/arm/mach-s5pv210/include/mach/map.h create mode 100644 arch/arm/mach-s5pv210/include/mach/memory.h create mode 100644 arch/arm/mach-s5pv210/include/mach/system.h create mode 100644 arch/arm/mach-s5pv210/include/mach/uncompress.h create mode 100644 arch/arm/plat-s5p/include/plat/s5pv210.h create mode 100644 arch/arm/plat-s5p/s5pv210-init.c

arch/arm/mach-s5pv210/cpu.c new file +126 -0
new file mode 100644
index 0000000..778d2dc
@@ -0,0 +1,126 @@
+/* linux/arch/arm/mach-s5pv210/cpu.c
+ *
+ * Copyright (c) 2010 Samsung Electronics Co., Ltd.
+ *             http://www.samsung.com/
+ *
+ * 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 <linux/kernel.h>
+#include <linux/types.h>
+#include <linux/interrupt.h>
+#include <linux/list.h>
+#include <linux/timer.h>
+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/clk.h>
+#include <linux/io.h>
+#include <linux/sysdev.h>
+#include <linux/platform_device.h>
+
+#include <asm/mach/arch.h>
+#include <asm/mach/map.h>
+#include <asm/mach/irq.h>
+
+#include <asm/proc-fns.h>
+#include <mach/map.h>
+#include <mach/regs-clock.h>
+
+#include <plat/cpu.h>
+#include <plat/devs.h>
+#include <plat/clock.h>
+#include <plat/s5pv210.h>
+
+/* Initial IO mappings */
+
+static struct map_desc s5pv210_iodesc[] __initdata = {
+       {
+               .virtual        = (unsigned long)S5P_VA_SYSTIMER,
+               .pfn            = __phys_to_pfn(S5P_PA_SYSTIMER),
+               .length         = SZ_1M,
+               .type           = MT_DEVICE,
+       }, {
+               .virtual        = (unsigned long)S5P_VA_VIC2,
+               .pfn            = __phys_to_pfn(S5P_PA_VIC2),
+               .length         = SZ_16K,
+               .type           = MT_DEVICE,
+       }, {
+               .virtual        = (unsigned long)S5P_VA_VIC3,
+               .pfn            = __phys_to_pfn(S5P_PA_VIC3),
+               .length         = SZ_16K,
+               .type           = MT_DEVICE,
+       }, {
+               .virtual        = (unsigned long)S5P_VA_SROMC,
+               .pfn            = __phys_to_pfn(S5P_PA_SROMC),
+               .length         = SZ_4K,
+               .type           = MT_DEVICE,
+       }
+};
+
+static void s5pv210_idle(void)
+{
+       if (!need_resched())
+               cpu_do_idle();
+
+       local_irq_enable();
+}
+
+/* s5pv210_map_io
+ *
+ * register the standard cpu IO areas
+*/
+
+void __init s5pv210_map_io(void)
+{
+       iotable_init(s5pv210_iodesc, ARRAY_SIZE(s5pv210_iodesc));
+}
+
+void __init s5pv210_init_clocks(int xtal)
+{
+       printk(KERN_DEBUG "%s: initializing clocks\n", __func__);
+
+       s3c24xx_register_baseclocks(xtal);
+       s5p_register_clocks(xtal);
+       s5pv210_register_clocks();
+       s5pv210_setup_clocks();
+}
+
+void __init s5pv210_init_irq(void)
+{
+       u32 vic[4];     /* S5PV210 supports 4 VIC */
+
+       /* All the VICs are fully populated. */
+       vic[0] = ~0;
+       vic[1] = ~0;
+       vic[2] = ~0;
+       vic[3] = ~0;
+
+       s5p_init_irq(vic, ARRAY_SIZE(vic));
+}
+
+static struct sysdev_class s5pv210_sysclass = {
+       .name   = "s5pv210-core",
+};
+
+static struct sys_device s5pv210_sysdev = {
+       .cls    = &s5pv210_sysclass,
+};
+
+static int __init s5pv210_core_init(void)
+{
+       return sysdev_class_register(&s5pv210_sysclass);
+}
+
+core_initcall(s5pv210_core_init);
+
+int __init s5pv210_init(void)
+{
+       printk(KERN_INFO "S5PV210: Initializing architecture\n");
+
+       /* set idle function */
+       pm_idle = s5pv210_idle;
+
+       return sysdev_register(&s5pv210_sysdev);
+}
arch/arm/mach-s5pv210/include/mach/debug-macro.S new file +39 -0
new file mode 100644
index 0000000..3c568a3
@@ -0,0 +1,39 @@
+/* linux/arch/arm/mach-s5pv210/include/mach/debug-macro.S
+ *
+ * Copyright (c) 2010 Samsung Electronics Co., Ltd.
+ *             http://www.samsung.com/
+ *
+ * Based on arch/arm/mach-s3c6400/include/mach/debug-macro.S
+ *
+ * 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.
+*/
+
+/* pull in the relevant register and map files. */
+
+#include <mach/map.h>
+#include <plat/regs-serial.h>
+
+       /* note, for the boot process to work we have to keep the UART
+        * virtual address aligned to an 1MiB boundary for the L1
+        * mapping the head code makes. We keep the UART virtual address
+        * aligned and add in the offset when we load the value here.
+        */
+
+       .macro addruart, rx
+               mrc     p15, 0, \rx, c1, c0
+               tst     \rx, #1
+               ldreq   \rx, = S5P_PA_UART
+               ldrne   \rx, = (S5P_VA_UART + S5P_PA_UART & 0xfffff)
+#if CONFIG_DEBUG_S3C_UART != 0
+               add     \rx, \rx, #(0x400 * CONFIG_DEBUG_S3C_UART)
+#endif
+       .endm
+
+/* include the reset of the code which will do the work, we're only
+ * compiling for a single cpu processor type so the default of s3c2440
+ * will be fine with us.
+ */
+
+#include <plat/debug-macro.S>
arch/arm/mach-s5pv210/include/mach/entry-macro.S new file +54 -0
new file mode 100644
index 0000000..503c1ec
@@ -0,0 +1,54 @@
+/* linux/arch/arm/mach-s5pv210/include/mach/entry-macro.S
+ *
+ * Copyright (c) 2010 Samsung Electronics Co., Ltd.
+ *             http://www.samsung.com/
+ *
+ * Low-level IRQ helper macros for the Samsung S5PV210
+ *
+ * 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 <asm/hardware/vic.h>
+#include <mach/map.h>
+#include <plat/irqs.h>
+
+       .macro  disable_fiq
+       .endm
+
+       .macro  get_irqnr_preamble, base, tmp
+       ldr     \base, =S5P_VA_VIC0
+       .endm
+
+       .macro  arch_ret_to_user, tmp1, tmp2
+       .endm
+
+       .macro  get_irqnr_and_base, irqnr, irqstat, base, tmp
+
+       @ check the vic0
+       mov     \irqnr, # S5P_IRQ_OFFSET + 31
+       ldr     \irqstat, [ \base, # VIC_IRQ_STATUS ]
+       teq     \irqstat, #0
+
+       @ otherwise try vic1
+       addeq   \tmp, \base, #(S5P_VA_VIC1 - S5P_VA_VIC0)
+       addeq   \irqnr, \irqnr, #32
+       ldreq   \irqstat, [ \tmp, # VIC_IRQ_STATUS ]
+       teqeq   \irqstat, #0
+
+       @ otherwise try vic2
+       addeq   \tmp, \base, #(S5P_VA_VIC2 - S5P_VA_VIC0)
+       addeq   \irqnr, \irqnr, #32
+       ldreq   \irqstat, [ \tmp, # VIC_IRQ_STATUS ]
+       teqeq   \irqstat, #0
+
+       @ otherwise try vic3
+       addeq   \tmp, \base, #(S5P_VA_VIC3 - S5P_VA_VIC0)
+       addeq   \irqnr, \irqnr, #32
+       ldreq   \irqstat, [ \tmp, # VIC_IRQ_STATUS ]
+       teqeq   \irqstat, #0
+
+       clzne   \irqstat, \irqstat
+       subne   \irqnr, \irqnr, \irqstat
+       .endm
arch/arm/mach-s5pv210/include/mach/gpio-core.h new file +19 -0
new file mode 100644
index 0000000..acb6a1e
@@ -0,0 +1,19 @@
+/* linux/arch/arm/mach-s5pv210/include/mach/gpio-core.h
+ *
+ * Copyright (c) 2010 Samsung Electronics Co., Ltd.
+ *             http://www.samsung.com/
+ *
+ * S5PV210 - GPIO core support
+ *
+ * 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.
+*/
+
+#ifndef __ASM_ARCH_GPIO_CORE_H
+#define __ASM_ARCH_GPIO_CORE_H __FILE__
+
+/* currently we just include the platform support */
+#include <plat/gpio-core.h>
+
+#endif /* __ASM_ARCH_GPIO_CORE_H */
arch/arm/mach-s5pv210/include/mach/gpio.h new file +38 -0
new file mode 100644
index 0000000..533b020
@@ -0,0 +1,129 @@
+/* linux/arch/arm/mach-s5pv210/include/mach/gpio.h
+ *
+ * Copyright (c) 2010 Samsung Electronics Co., Ltd.
+ *             http://www.samsung.com/
+ *
+ * S5PV210 - GPIO lib support
+ *
+ * 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.
+*/
+
+#ifndef __ASM_ARCH_GPIO_H
+#define __ASM_ARCH_GPIO_H __FILE__
+
+#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
+
+/* GPIO bank sizes */
+#define S5PV210_GPIO_A0_NR     (8)
+#define S5PV210_GPIO_A1_NR     (4)
+#define S5PV210_GPIO_B_NR      (8)
+#define S5PV210_GPIO_C0_NR     (5)
+#define S5PV210_GPIO_C1_NR     (5)
+#define S5PV210_GPIO_D0_NR     (4)
+#define S5PV210_GPIO_D1_NR     (6)
+#define S5PV210_GPIO_E0_NR     (8)
+#define S5PV210_GPIO_E1_NR     (5)
+#define S5PV210_GPIO_F0_NR     (8)
+#define S5PV210_GPIO_F1_NR     (8)
+#define S5PV210_GPIO_F2_NR     (8)
+#define S5PV210_GPIO_F3_NR     (6)
+#define S5PV210_GPIO_G0_NR     (7)
+#define S5PV210_GPIO_G1_NR     (7)
+#define S5PV210_GPIO_G2_NR     (7)
+#define S5PV210_GPIO_G3_NR     (7)

arch/arm/mach-s5pv210/include/mach/gpio.h line 48

Quoted 10 lines
arch/arm/mach-s5pv210/include/mach/gpio.h new file +10 -0
+#define S5PV210_GPIO_H0_NR     (8)
+#define S5PV210_GPIO_H1_NR     (8)
+#define S5PV210_GPIO_H2_NR     (8)
+#define S5PV210_GPIO_H3_NR     (8)
+#define S5PV210_GPIO_I_NR      (7)
+#define S5PV210_GPIO_J0_NR     (8)
+#define S5PV210_GPIO_J1_NR     (6)
+#define S5PV210_GPIO_J2_NR     (8)
+#define S5PV210_GPIO_J3_NR     (8)
+#define S5PV210_GPIO_J4_NR     (5)

Is there any reason to use the actual NR number? How about to define it's all 8. why not?
E.g., this chip support only 7 at GPIO I. then when we set the 7th bit. what's the matter?
This make a below macros are simple.

Quoted 166 lines
arch/arm/mach-s5pv210/include/mach/gpio.h new file +81 -0
+
+/* GPIO bank numbers */
+
+/* CONFIG_S3C_GPIO_SPACE allows the user to select extra
+ * space for debugging purposes so that any accidental
+ * change from one gpio bank to another can be caught.
+*/
+
+#define S5PV210_GPIO_NEXT(__gpio) \
+       ((__gpio##_START) + (__gpio##_NR) + CONFIG_S3C_GPIO_SPACE + 1)
+
+enum s5p_gpio_number {
+       S5PV210_GPIO_A0_START   = 0,
+       S5PV210_GPIO_A1_START   = S5PV210_GPIO_NEXT(S5PV210_GPIO_A0),
+       S5PV210_GPIO_B_START    = S5PV210_GPIO_NEXT(S5PV210_GPIO_A1),
+       S5PV210_GPIO_C0_START   = S5PV210_GPIO_NEXT(S5PV210_GPIO_B),
+       S5PV210_GPIO_C1_START   = S5PV210_GPIO_NEXT(S5PV210_GPIO_C0),
+       S5PV210_GPIO_D0_START   = S5PV210_GPIO_NEXT(S5PV210_GPIO_C1),
+       S5PV210_GPIO_D1_START   = S5PV210_GPIO_NEXT(S5PV210_GPIO_D0),
+       S5PV210_GPIO_E0_START   = S5PV210_GPIO_NEXT(S5PV210_GPIO_D1),
+       S5PV210_GPIO_E1_START   = S5PV210_GPIO_NEXT(S5PV210_GPIO_E0),
+       S5PV210_GPIO_F0_START   = S5PV210_GPIO_NEXT(S5PV210_GPIO_E1),
+       S5PV210_GPIO_F1_START   = S5PV210_GPIO_NEXT(S5PV210_GPIO_F0),
+       S5PV210_GPIO_F2_START   = S5PV210_GPIO_NEXT(S5PV210_GPIO_F1),
+       S5PV210_GPIO_F3_START   = S5PV210_GPIO_NEXT(S5PV210_GPIO_F2),
+       S5PV210_GPIO_G0_START   = S5PV210_GPIO_NEXT(S5PV210_GPIO_F3),
+       S5PV210_GPIO_G1_START   = S5PV210_GPIO_NEXT(S5PV210_GPIO_G0),
+       S5PV210_GPIO_G2_START   = S5PV210_GPIO_NEXT(S5PV210_GPIO_G1),
+       S5PV210_GPIO_G3_START   = S5PV210_GPIO_NEXT(S5PV210_GPIO_G2),
+       S5PV210_GPIO_H0_START   = S5PV210_GPIO_NEXT(S5PV210_GPIO_G3),
+       S5PV210_GPIO_H1_START   = S5PV210_GPIO_NEXT(S5PV210_GPIO_H0),
+       S5PV210_GPIO_H2_START   = S5PV210_GPIO_NEXT(S5PV210_GPIO_H1),
+       S5PV210_GPIO_H3_START   = S5PV210_GPIO_NEXT(S5PV210_GPIO_H2),
+       S5PV210_GPIO_I_START    = S5PV210_GPIO_NEXT(S5PV210_GPIO_H3),
+       S5PV210_GPIO_J0_START   = S5PV210_GPIO_NEXT(S5PV210_GPIO_I),
+       S5PV210_GPIO_J1_START   = S5PV210_GPIO_NEXT(S5PV210_GPIO_J0),
+       S5PV210_GPIO_J2_START   = S5PV210_GPIO_NEXT(S5PV210_GPIO_J1),
+       S5PV210_GPIO_J3_START   = S5PV210_GPIO_NEXT(S5PV210_GPIO_J2),
+       S5PV210_GPIO_J4_START   = S5PV210_GPIO_NEXT(S5PV210_GPIO_J3),
+};
+
+/* S5PV210 GPIO number definitions */
+#define S5PV210_GPA0(_nr)      (S5PV210_GPIO_A0_START + (_nr))
+#define S5PV210_GPA1(_nr)      (S5PV210_GPIO_A1_START + (_nr))
+#define S5PV210_GPB(_nr)       (S5PV210_GPIO_B_START + (_nr))
+#define S5PV210_GPC0(_nr)      (S5PV210_GPIO_C0_START + (_nr))
+#define S5PV210_GPC1(_nr)      (S5PV210_GPIO_C1_START + (_nr))
+#define S5PV210_GPD0(_nr)      (S5PV210_GPIO_D0_START + (_nr))
+#define S5PV210_GPD1(_nr)      (S5PV210_GPIO_D1_START + (_nr))
+#define S5PV210_GPE0(_nr)      (S5PV210_GPIO_E0_START + (_nr))
+#define S5PV210_GPE1(_nr)      (S5PV210_GPIO_E1_START + (_nr))
+#define S5PV210_GPF0(_nr)      (S5PV210_GPIO_F0_START + (_nr))
+#define S5PV210_GPF1(_nr)      (S5PV210_GPIO_F1_START + (_nr))
+#define S5PV210_GPF2(_nr)      (S5PV210_GPIO_F2_START + (_nr))
+#define S5PV210_GPF3(_nr)      (S5PV210_GPIO_F3_START + (_nr))
+#define S5PV210_GPG0(_nr)      (S5PV210_GPIO_G0_START + (_nr))
+#define S5PV210_GPG1(_nr)      (S5PV210_GPIO_G1_START + (_nr))
+#define S5PV210_GPG2(_nr)      (S5PV210_GPIO_G2_START + (_nr))
+#define S5PV210_GPG3(_nr)      (S5PV210_GPIO_G3_START + (_nr))
+#define S5PV210_GPH0(_nr)      (S5PV210_GPIO_H0_START + (_nr))
+#define S5PV210_GPH1(_nr)      (S5PV210_GPIO_H1_START + (_nr))
+#define S5PV210_GPH2(_nr)      (S5PV210_GPIO_H2_START + (_nr))
+#define S5PV210_GPH3(_nr)      (S5PV210_GPIO_H3_START + (_nr))
+#define S5PV210_GPI(_nr)       (S5PV210_GPIO_I_START + (_nr))
+#define S5PV210_GPJ0(_nr)      (S5PV210_GPIO_J0_START + (_nr))
+#define S5PV210_GPJ1(_nr)      (S5PV210_GPIO_J1_START + (_nr))
+#define S5PV210_GPJ2(_nr)      (S5PV210_GPIO_J2_START + (_nr))
+#define S5PV210_GPJ3(_nr)      (S5PV210_GPIO_J3_START + (_nr))
+#define S5PV210_GPJ4(_nr)      (S5PV210_GPIO_J4_START + (_nr))
+
+/* the end of the S5PV210 specific gpios */
+#define S5PV210_GPIO_END       (S5PV210_GPJ4(S5PV210_GPIO_J4_NR) + 1)
+#define S3C_GPIO_END           S5PV210_GPIO_END
+
+/* define the number of gpios we need to the one after the GPJ4() range */
+#define ARCH_NR_GPIOS          (S5PV210_GPJ4(S5PV210_GPIO_J4_NR) +     \
+                                CONFIG_SAMSUNG_GPIO_EXTRA + 1)
+
+#include <asm-generic/gpio.h>
+
+#endif /* __ASM_ARCH_GPIO_H */
arch/arm/mach-s5pv210/include/mach/hardware.h new file +18 -0
new file mode 100644
index 0000000..fada7a3
@@ -0,0 +1,18 @@
+/* linux/arch/arm/mach-s5pv210/include/mach/hardware.h
+ *
+ * Copyright (c) 2010 Samsung Electronics Co., Ltd.
+ *             http://www.samsung.com/
+ *
+ * S5PV210 - Hardware support
+ *
+ * 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.
+*/
+
+#ifndef __ASM_ARCH_HARDWARE_H
+#define __ASM_ARCH_HARDWARE_H __FILE__
+
+/* currently nothing here, placeholder */
+
+#endif /* __ASM_ARCH_HARDWARE_H */
arch/arm/mach-s5pv210/include/mach/map.h new file +55 -0
new file mode 100644
index 0000000..dd5a811
@@ -0,0 +1,102 @@
+/* linux/arch/arm/mach-s5pv210/include/mach/map.h
+ *
+ * Copyright (c) 2010 Samsung Electronics Co., Ltd.
+ *             http://www.samsung.com/
+ *
+ * S5PV210 - Memory map definitions
+ *
+ * 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.
+*/
+
+#ifndef __ASM_ARCH_MAP_H
+#define __ASM_ARCH_MAP_H __FILE__
+
+#include <plat/map-base.h>
+
+/* Chip ID */
+#define S5PV210_PA_CHIPID      (0xE0000000)
+#define S5P_PA_CHIPID          S5PV210_PA_CHIPID
+#define S5P_VA_CHIPID          S3C_ADDR(0x00700000)
+
+/* SYSCON */
+#define S5PV210_PA_SYSCON      (0xE0100000)
+#define S5P_PA_SYSCON          S5PV210_PA_SYSCON
+#define S5P_VA_SYSCON          S3C_VA_SYS
+
+/* GPIO */
+#define S5PV210_PA_GPIO                (0xE0200000)
+#define S5P_PA_GPIO            S5PV210_PA_GPIO
+#define S5P_VA_GPIO            S3C_ADDR(0x00500000)
+
+/* I2C 0 */
+#define S5PV210_PA_IIC0                (0xE1800000)
+#define S5P_PA_IIC0            S5PV210_PA_IIC0
+
+/* Timer */
+#define S5PV210_PA_TIMER       (0xE2500000)
+#define S5P_PA_TIMER           S5PV210_PA_TIMER
+#define S5P_VA_TIMER           S3C_VA_TIMER
+
+/* SYSTEM TIMER */
+#define S5PV210_PA_SYSTIMER    (0xE2600000)
+#define S5P_PA_SYSTIMER                S5PV210_PA_SYSTIMER
+#define S5P_VA_SYSTIMER                S3C_ADDR(0x01200000)
+
+/* UART */
+#define S5PV210_PA_UART                (0xE2900000)
+#define S5P_PA_UART            S5PV210_PA_UART
+#define S5P_VA_UART            S3C_VA_UART
+
+#define S5P_PA_UART0           (S5P_PA_UART + 0x0)
+#define S5P_PA_UART1           (S5P_PA_UART + 0x400)
+#define S5P_PA_UART2           (S5P_PA_UART + 0x800)
+#define S5P_PA_UART3           (S5P_PA_UART + 0xC00)

arch/arm/mach-s5pv210/include/mach/map.h line 65

Quoted 10 lines
arch/arm/mach-s5pv210/include/mach/map.h new file +10 -0
+#define S5P_UART_OFFSET                (0x400)
+
+#define S5P_VA_UARTx(x)                (S5P_VA_UART + (S5P_PA_UART & 0xfffff) \
+                               + ((x) * S5P_UART_OFFSET))
+
+#define S5P_VA_UART0           S5P_VA_UARTx(0)
+#define S5P_VA_UART1           S5P_VA_UARTx(1)
+#define S5P_VA_UART2           S5P_VA_UARTx(2)
+#define S5P_VA_UART3           S5P_VA_UARTx(3)
+#define S5P_SZ_UART            SZ_256

Please remove unfamiliar x S5P_VA_UARTx -> S5P_VA_UART.

Quoted 51 lines
arch/arm/mach-s5pv210/include/mach/map.h new file +37 -0
+
+/* SROMC */
+#define S5PV210_PA_SROMC       (0xE8000000)
+#define S5P_PA_SROMC           S5PV210_PA_SROMC
+#define S5P_VA_SROMC           S3C_ADDR(0x01100000)
+
+/* VIC 0 */
+#define S5PV210_PA_VIC0                (0xF2000000)
+#define S5P_PA_VIC0            S5PV210_PA_VIC0
+#define S5P_VA_VIC0            (S3C_VA_IRQ + 0x0)
+
+/* VIC 1 */
+#define S5PV210_PA_VIC1                (0xF2100000)
+#define S5P_PA_VIC1            S5PV210_PA_VIC1
+#define S5P_VA_VIC1            (S3C_VA_IRQ + 0x10000)
+
+/* VIC 2 */
+#define S5PV210_PA_VIC2                (0xF2200000)
+#define S5P_PA_VIC2            S5PV210_PA_VIC2
+#define S5P_VA_VIC2            (S3C_VA_IRQ + 0x20000)
+
+/* VIC 3 */
+#define S5PV210_PA_VIC3                (0xF2300000)
+#define S5P_PA_VIC3            S5PV210_PA_VIC3
+#define S5P_VA_VIC3            (S3C_VA_IRQ + 0x30000)
+
+/* SDRAM */
+#define S5PV210_PA_SDRAM       (0x20000000)
+#define S5P_PA_SDRAM           S5PV210_PA_SDRAM
+
+/* compatibiltiy defines. */
+#define S3C_PA_UART            S5P_PA_UART
+#define S3C_UART_OFFSET                S5P_UART_OFFSET
+#define S3C_PA_TIMER           S5P_PA_TIMER
+#define S3C_PA_IIC             S5P_PA_IIC0
+
+#endif /* __ASM_ARCH_MAP_H */
arch/arm/mach-s5pv210/include/mach/memory.h new file +8 -0
new file mode 100644
index 0000000..0f07793
@@ -0,0 +1,20 @@
+/* linux/arch/arm/mach-s5pv210/include/mach/memory.h
+ *
+ * Copyright (c) 2010 Samsung Electronics Co., Ltd.
+ *             http://www.samsung.com/
+ *
+ * S5PV210 - Memory definitions
+ *
+ * This program is free software; you can redistribute it and/or modify

arch/arm/mach-s5pv210/include/mach/memory.h line 18

Quoted 10 lines
arch/arm/mach-s5pv210/include/mach/memory.h new file +10 -0
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+*/
+
+#ifndef __ASM_ARCH_MEMORY_H
+#define __ASM_ARCH_MEMORY_H
+
+#define PHYS_OFFSET            UL(0x20000000)
+#define CONSISTENT_DMA_SIZE    (SZ_8M + SZ_4M + SZ_2M)
+#define NODE_MEM_SIZE_BITS     28

Can you confirm the PHYS_OFFSET is right? At previous time LSI guided that you should use the 0x3000'0000 for MFC issues. And please keep the consistent If you commit this one. we have to change the our environment from bootloader and kernel. Now we use the local kernel and mainline.

Also how can you use if we got the 0x2000'0000 with 128MiB and 0x4000'0000 with 384MiB or 512MiB.
There's too much memory holes. Please don't say use the split the user and kernel 2G/2G configuration
If we modify the base address, we can use above memory configuration without any changes.

Thank you,
Kyungmin Park

Quoted 209 lines
arch/arm/mach-s5pv210/include/mach/memory.h new file +2 -0
+
+#endif /* __ASM_ARCH_MEMORY_H */
arch/arm/mach-s5pv210/include/mach/system.h new file +26 -0
new file mode 100644
index 0000000..1ca04d5
@@ -0,0 +1,26 @@
+/* linux/arch/arm/mach-s5pv210/include/mach/system.h
+ *
+ * Copyright (c) 2010 Samsung Electronics Co., Ltd.
+ *             http://www.samsung.com/
+ *
+ * S5PV210 - system support 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.
+*/
+
+#ifndef __ASM_ARCH_SYSTEM_H
+#define __ASM_ARCH_SYSTEM_H __FILE__
+
+static void arch_idle(void)
+{
+       /* nothing here yet */
+}
+
+static void arch_reset(char mode, const char *cmd)
+{
+       /* nothing here yet */
+}
+
+#endif /* __ASM_ARCH_SYSTEM_H */
arch/arm/mach-s5pv210/include/mach/uncompress.h new file +24 -0
new file mode 100644
index 0000000..08ff2fd
@@ -0,0 +1,24 @@
+/* linux/arch/arm/mach-s5pv210/include/mach/uncompress.h
+ *
+ * Copyright (c) 2010 Samsung Electronics Co., Ltd.
+ *             http://www.samsung.com/
+ *
+ * S5PV210 - uncompress code
+ *
+ * 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.
+*/
+
+#ifndef __ASM_ARCH_UNCOMPRESS_H
+#define __ASM_ARCH_UNCOMPRESS_H
+
+#include <mach/map.h>
+#include <plat/uncompress.h>
+
+static void arch_detect_cpu(void)
+{
+       /* we do not need to do any cpu detection here at the moment. */
+}
+
+#endif /* __ASM_ARCH_UNCOMPRESS_H */
arch/arm/plat-s5p/cpu.c +15 -0
index 0895a77..b322e4c 100644
@@ -18,10 +18,12 @@
  #include <mach/regs-clock.h>
  #include <plat/cpu.h>
  #include <plat/s5p6440.h>
+#include <plat/s5pv210.h>
 
  /* table of supported CPUs */
 
  static const char name_s5p6440[] = "S5P6440";
+static const char name_s5pv210[] = "S5PV210/S5PC110";
 
  static struct cpu_table cpu_ids[] __initdata = {
        {
@@ -32,6 +34,14 @@ static struct cpu_table cpu_ids[] __initdata = {
                .init_uarts     = s5p6440_init_uarts,
                .init           = s5p6440_init,
                .name           = name_s5p6440,
+       }, {
+               .idcode         = 0x43110000,
+               .idmask         = 0xfffff000,
+               .map_io         = s5pv210_map_io,
+               .init_clocks    = s5pv210_init_clocks,
+               .init_uarts     = s5pv210_init_uarts,
+               .init           = s5pv210_init,
+               .name           = name_s5pv210,
        },
  };
 
@@ -41,6 +51,11 @@ static struct cpu_table cpu_ids[] __initdata = {
 
  static struct map_desc s5p_iodesc[] __initdata = {
        {
+               .virtual        = (unsigned long)S5P_VA_CHIPID,
+               .pfn            = __phys_to_pfn(S5P_PA_CHIPID),
+               .length         = SZ_4K,
+               .type           = MT_DEVICE,
+       }, {
                .virtual        = (unsigned long)S5P_VA_SYSCON,
                .pfn            = __phys_to_pfn(S5P_PA_SYSCON),
                .length         = SZ_64K,
arch/arm/plat-s5p/include/plat/s5pv210.h new file +37 -0
new file mode 100644
index 0000000..db1399c
@@ -0,0 +1,37 @@
+/* linux/arch/arm/plat-s5p/include/plat/s5pv210.h
+ *
+ * Copyright (c) 2010 Samsung Electronics Co., Ltd.
+ *             http://www.samsung.com/
+ *
+ * Header file for s5pv210 cpu support
+ *
+ * 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.
+*/
+
+/* Common init code for S5PV210 related SoCs */
+
+extern void s5pv210_common_init_uarts(struct s3c2410_uartcfg *cfg, int no);
+extern void s5pv210_register_clocks(void);
+extern void s5pv210_setup_clocks(void);
+
+#ifdef CONFIG_CPU_S5PV210
+
+extern  int s5pv210_init(void);
+extern void s5pv210_init_irq(void);
+extern void s5pv210_map_io(void);
+extern void s5pv210_init_clocks(int xtal);
+
+#define s5pv210_init_uarts s5pv210_common_init_uarts
+
+#else
+#define s5pv210_init_clocks NULL
+#define s5pv210_init_uarts NULL
+#define s5pv210_map_io NULL
+#define s5pv210_init NULL
+#endif
+
+/* S5PV210 timer */
+
+extern struct sys_timer s5pv210_timer;
arch/arm/plat-s5p/s5pv210-init.c new file +44 -1
new file mode 100644
index 0000000..619d058
@@ -0,0 +1,44 @@
+/* linux/arch/arm/plat-s5p/s5pv210-init.c
+ *
+ * Copyright (c) 2010 Samsung Electronics Co., Ltd.
+ *             http://www.samsung.com/
+ *
+ * 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 <linux/kernel.h>
+#include <linux/types.h>
+#include <linux/init.h>
+#include <linux/serial_core.h>
+
+#include <plat/cpu.h>
+#include <plat/devs.h>
+#include <plat/s5pv210.h>
+#include <plat/regs-serial.h>
+
+static struct s3c24xx_uart_clksrc s5pv210_serial_clocks[] = {
+       [0] = {
+               .name           = "pclk",
+               .divisor        = 1,
+               .min_baud       = 0,
+               .max_baud       = 0,
+       },
+};
+
+/* uart registration process */
+void __init s5pv210_common_init_uarts(struct s3c2410_uartcfg *cfg, int no)
+{
+       struct s3c2410_uartcfg *tcfg = cfg;
+       u32 ucnt;
+
+       for (ucnt = 0; ucnt < no; ucnt++, tcfg++) {
+               if (!tcfg->clocks) {
+                       tcfg->clocks = s5pv210_serial_clocks;
+                       tcfg->clocks_size = ARRAY_SIZE(s5pv210_serial_clocks);
+               }
+       }
+
+       s3c24xx_init_uartdevs("s5pv210-uart", s5p_uart_resources, cfg, no);
+}
--

1.6.2.5

--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

author
#3 lore raw
Quoted 6 lines · Kyungmin Park
Quoted 5 lines · Kukjin Kim

This patch adds support for Samsung S5PV210 CPU. This patch also adds an entry for S5PV210 cpu in plat-s5p cpu table.

---

(snip)

Quoted 26 lines
Quoted 26 lines
arch/arm/mach-s5pv210/include/mach/gpio.h new file +26 -0
+/* GPIO bank sizes */
+#define S5PV210_GPIO_A0_NR     (8)
+#define S5PV210_GPIO_A1_NR     (4)
+#define S5PV210_GPIO_B_NR      (8)
+#define S5PV210_GPIO_C0_NR     (5)
+#define S5PV210_GPIO_C1_NR     (5)
+#define S5PV210_GPIO_D0_NR     (4)
+#define S5PV210_GPIO_D1_NR     (6)
+#define S5PV210_GPIO_E0_NR     (8)
+#define S5PV210_GPIO_E1_NR     (5)
+#define S5PV210_GPIO_F0_NR     (8)
+#define S5PV210_GPIO_F1_NR     (8)
+#define S5PV210_GPIO_F2_NR     (8)
+#define S5PV210_GPIO_F3_NR     (6)
+#define S5PV210_GPIO_G0_NR     (7)
+#define S5PV210_GPIO_G1_NR     (7)
+#define S5PV210_GPIO_G2_NR     (7)
+#define S5PV210_GPIO_G3_NR     (7)
+#define S5PV210_GPIO_H0_NR     (8)
+#define S5PV210_GPIO_H1_NR     (8)
+#define S5PV210_GPIO_H2_NR     (8)
+#define S5PV210_GPIO_H3_NR     (8)
+#define S5PV210_GPIO_I_NR      (7)
+#define S5PV210_GPIO_J0_NR     (8)
+#define S5PV210_GPIO_J1_NR     (6)
+#define S5PV210_GPIO_J2_NR     (8)
Quoted 8 lines

arch/arm/mach-s5pv210/include/mach/gpio.h line 48

Quoted 2 lines
arch/arm/mach-s5pv210/include/mach/gpio.h new file +2 -0
+#define S5PV210_GPIO_J3_NR     (8)
+#define S5PV210_GPIO_J4_NR     (5)

Is there any reason to use the actual NR number? How about to define it's all 8. why not?
E.g., this chip support only 7 at GPIO I. then when we set the 7th bit. what's the matter?
This make a below macros are simple.

Hi,

There are banks that have less than 8 gpio's.
So it is better to keep to define the bank sizes correctly.

Quoted 65 lines
Quoted 4 lines
arch/arm/mach-s5pv210/include/mach/gpio.h new file +4 -0
+
+/* GPIO bank numbers */
+
+/* CONFIG_S3C_GPIO_SPACE allows the user to select extra

arch/arm/mach-s5pv210/include/mach/gpio.h

Quoted 10 lines
arch/arm/mach-s5pv210/include/mach/gpio.h new file +10 -0
+ * space for debugging purposes so that any accidental
+ * change from one gpio bank to another can be caught.
+*/
+
+#define S5PV210_GPIO_NEXT(__gpio) \
+       ((__gpio##_START) + (__gpio##_NR) + CONFIG_S3C_GPIO_SPACE + 1)
+
+enum s5p_gpio_number {
+       S5PV210_GPIO_A0_START   = 0,
+       S5PV210_GPIO_A1_START   =

S5PV210_GPIO_NEXT(S5PV210_GPIO_A0),

Quoted 1 line

+       S5PV210_GPIO_B_START    =

S5PV210_GPIO_NEXT(S5PV210_GPIO_A1),

Quoted 1 line

+       S5PV210_GPIO_C0_START   =

S5PV210_GPIO_NEXT(S5PV210_GPIO_B),

Quoted 1 line

+       S5PV210_GPIO_C1_START   =

S5PV210_GPIO_NEXT(S5PV210_GPIO_C0),

Quoted 1 line

+       S5PV210_GPIO_D0_START   =

S5PV210_GPIO_NEXT(S5PV210_GPIO_C1),

Quoted 1 line

+       S5PV210_GPIO_D1_START   =

S5PV210_GPIO_NEXT(S5PV210_GPIO_D0),

Quoted 1 line

+       S5PV210_GPIO_E0_START   =

S5PV210_GPIO_NEXT(S5PV210_GPIO_D1),

Quoted 1 line

+       S5PV210_GPIO_E1_START   =

S5PV210_GPIO_NEXT(S5PV210_GPIO_E0),

Quoted 1 line

+       S5PV210_GPIO_F0_START   =

S5PV210_GPIO_NEXT(S5PV210_GPIO_E1),

Quoted 1 line

+       S5PV210_GPIO_F1_START   =

S5PV210_GPIO_NEXT(S5PV210_GPIO_F0),

Quoted 1 line

+       S5PV210_GPIO_F2_START   =

S5PV210_GPIO_NEXT(S5PV210_GPIO_F1),

Quoted 1 line

+       S5PV210_GPIO_F3_START   =

S5PV210_GPIO_NEXT(S5PV210_GPIO_F2),

Quoted 1 line

+       S5PV210_GPIO_G0_START   =

S5PV210_GPIO_NEXT(S5PV210_GPIO_F3),

Quoted 1 line

+       S5PV210_GPIO_G1_START   =

S5PV210_GPIO_NEXT(S5PV210_GPIO_G0),

Quoted 1 line

+       S5PV210_GPIO_G2_START   =

S5PV210_GPIO_NEXT(S5PV210_GPIO_G1),

Quoted 1 line

+       S5PV210_GPIO_G3_START   =

S5PV210_GPIO_NEXT(S5PV210_GPIO_G2),

Quoted 1 line

+       S5PV210_GPIO_H0_START   =

S5PV210_GPIO_NEXT(S5PV210_GPIO_G3),

Quoted 1 line

+       S5PV210_GPIO_H1_START   =

S5PV210_GPIO_NEXT(S5PV210_GPIO_H0),

Quoted 1 line

+       S5PV210_GPIO_H2_START   =

S5PV210_GPIO_NEXT(S5PV210_GPIO_H1),

Quoted 1 line

+       S5PV210_GPIO_H3_START   =

S5PV210_GPIO_NEXT(S5PV210_GPIO_H2),

Quoted 1 line

+       S5PV210_GPIO_I_START    =

S5PV210_GPIO_NEXT(S5PV210_GPIO_H3),

Quoted 2 lines

+       S5PV210_GPIO_J0_START   = S5PV210_GPIO_NEXT(S5PV210_GPIO_I),
+       S5PV210_GPIO_J1_START   =

S5PV210_GPIO_NEXT(S5PV210_GPIO_J0),

Quoted 1 line

+       S5PV210_GPIO_J2_START   =

S5PV210_GPIO_NEXT(S5PV210_GPIO_J1),

Quoted 1 line

+       S5PV210_GPIO_J3_START   =

S5PV210_GPIO_NEXT(S5PV210_GPIO_J2),

Quoted 1 line

+       S5PV210_GPIO_J4_START   =

S5PV210_GPIO_NEXT(S5PV210_GPIO_J3),

Quoted 1 line

+};

(snip)

Quoted 13 lines

arch/arm/mach-s5pv210/include/mach/map.h

Quoted 12 lines
arch/arm/mach-s5pv210/include/mach/map.h new file +12 -0
+/* UART */
+#define S5PV210_PA_UART                (0xE2900000)
+#define S5P_PA_UART            S5PV210_PA_UART
+#define S5P_VA_UART            S3C_VA_UART
+
+#define S5P_PA_UART0           (S5P_PA_UART + 0x0)
+#define S5P_PA_UART1           (S5P_PA_UART + 0x400)
+#define S5P_PA_UART2           (S5P_PA_UART + 0x800)
+#define S5P_PA_UART3           (S5P_PA_UART + 0xC00)
+#define S5P_UART_OFFSET                (0x400)
+
+#define S5P_VA_UARTx(x)                (S5P_VA_UART + (S5P_PA_UART &

0xfffff) \

Quoted 9 lines

arch/arm/mach-s5pv210/include/mach/map.h line 65

Quoted 7 lines

+                               + ((x) * S5P_UART_OFFSET))

arch/arm/mach-s5pv210/include/mach/map.h new file +6 -0
+
+#define S5P_VA_UART0           S5P_VA_UARTx(0)
+#define S5P_VA_UART1           S5P_VA_UARTx(1)
+#define S5P_VA_UART2           S5P_VA_UARTx(2)
+#define S5P_VA_UART3           S5P_VA_UARTx(3)
+#define S5P_SZ_UART            SZ_256

Please remove unfamiliar x S5P_VA_UARTx -> S5P_VA_UART.

The S5P_VA_UARTx(x) macro is used calculate the virtual base address for all instances of UART module. So this macro is fine.

(snip)

Quoted 10 lines

arch/arm/mach-s5pv210/include/mach/memory.h line 18

Quoted 3 lines
arch/arm/mach-s5pv210/include/mach/memory.h new file +3 -0
+#define PHYS_OFFSET            UL(0x20000000)
+#define CONSISTENT_DMA_SIZE    (SZ_8M + SZ_4M + SZ_2M)
+#define NODE_MEM_SIZE_BITS     28

Can you confirm the PHYS_OFFSET is right? At previous time LSI guided that you should use the 0x3000'0000 for MFC issues. And please keep the consistent If you commit this one. we have to change the our environment from bootloader and kernel. Now we use the local kernel and mainline.

Quoted 6 lines

Also how can you use if we got the 0x2000'0000 with 128MiB and 0x4000'0000 with 384MiB or 512MiB.
There's too much memory holes. Please don't say use the split the user and kernel 2G/2G configuration
If we modify the base address, we can use above memory configuration without any changes.

According to hardware spec, PHYS_OFFSET is correct.

Actually in the previous kernel version, we used 0x3000_0000 as PHYS_OFFSET because of some issue. But there is no problem about that, in the present kernel.

I can understand, your concern if it changes.
So I will think more about that.

Thank you for your input.

(snip)

Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, System LSI Division, SAMSUNG ELECTRONICS CO., LTD.