Skip to contentSkip to conversation

ARM: S5PV210: Add Samsung S5PV210 CPU support

PATCH Superseded Kukjin Kim 1 participant 1 message Jan 21, 2010

Subsystems (3)

v2 of 5 Superseded Latest is v5 →

lore
Share & tools
lore

Kukjin Kim

author
#0 lore raw

PATCH v2 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/Kconfig                    |   72 ++++++++++++
 arch/arm/mach-s5pv210/Makefile                   |   22 ++++
 arch/arm/mach-s5pv210/Makefile.boot              |    2 +
 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.h        |  129 ++++++++++++++++++++++
 arch/arm/mach-s5pv210/include/mach/hardware.h    |   18 +++
 arch/arm/mach-s5pv210/include/mach/map.h         |   98 ++++++++++++++++
 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/mach-s5pv210/s5pv210-init.c             |   44 ++++++++
 arch/arm/plat-s5p/cpu.c                          |   15 +++
 arch/arm/plat-s5p/include/plat/s5pv210.h         |   37 ++++++
 15 files changed, 726 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-s5pv210/Kconfig
 create mode 100644 arch/arm/mach-s5pv210/Makefile
 create mode 100644 arch/arm/mach-s5pv210/Makefile.boot
 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.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/mach-s5pv210/s5pv210-init.c
 create mode 100644 arch/arm/plat-s5p/include/plat/s5pv210.h
arch/arm/mach-s5pv210/Kconfig new file +72 -0
new file mode 100644
index 0000000..61dcaf0
@@ -0,0 +1,72 @@
+# arch/arm/mach-s5pv210/Kconfig
+#
+# Copyright (c) 2010 Samsung Electronics Co., Ltd.
+#		http://www.samsung.com/
+#
+# Licensed under GPLv2
+
+# Configuration options for the S5PV210/S5PC110
+
+if ARCH_S5PV210
+
+config CPU_S5PV210
+	bool
+	select CPU_S5PV210_INIT
+	select CPU_S5PV210_CLOCK
+	help
+	  Enable S5PV210 CPU support
+
+config CPU_S5PV210_INIT
+	bool
+	help
+	  Initialization code for the S5PV210.
+
+config CPU_S5PV210_CLOCK
+	bool
+	help
+	  Clock support code for the S5PV210.
+
+choice
+	prompt "Select machine type"
+	depends on ARCH_S5PV210
+	default MACH_SMDKV210
+
+config MACH_SMDKV210
+	bool "SMDKV210"
+	select CPU_S5PV210
+	select ARCH_DISCONTIGMEM_ENABLE
+	help
+	  Machine support for Samsung SMDKV210
+
+config MACH_SMDKC110
+	bool "SMDKC110"
+	select CPU_S5PV210
+	select ARCH_DISCONTIGMEM_ENABLE
+	help
+	  Machine support for Samsung SMDKC110
+
+endchoice
+
+choice
+	prompt "Setup CPU Type for S5PC110"
+	depends on MACH_SMDKC110
+	default S5PC110_B_TYPE
+
+config S5PC110_B_TYPE
+	bool "select B-Type"
+	help
+	  Select B-Type S5PC110 CPU
+
+config S5PC110_D_TYPE
+	bool "select D-Type"
+	help
+	  Select D-Type S5PC110 CPU
+
+config S5PC110_H_TYPE
+	bool "Select H-Type"
+	help
+	  Select H-Type S5PC110 CPU
+
+endchoice
+
+endif
arch/arm/mach-s5pv210/Makefile new file +22 -0
new file mode 100644
index 0000000..82a61a5
@@ -0,0 +1,22 @@
+# arch/arm/mach-s5pv210/Makefile
+#
+# Copyright (c) 2010 Samsung Electronics Co., Ltd.
+# 		http://www.samsung.com/
+#
+# Licensed under GPLv2
+
+obj-y				:=
+obj-m				:=
+obj-n				:=
+obj-				:=
+
+# Core support for S5PV210 system
+
+obj-$(CONFIG_CPU_S5PV210)	+= cpu.o
+obj-$(CONFIG_CPU_S5PV210_INIT)	+= s5pv210-init.o
+obj-$(CONFIG_CPU_S5PV210_CLOCK)	+= s5pv210-clock.o
+
+# machine support
+
+obj-$(CONFIG_MACH_SMDKV210)	+= mach-smdkv210.o
+obj-$(CONFIG_MACH_SMDKC110)	+= mach-smdkc110.o
arch/arm/mach-s5pv210/Makefile.boot new file +2 -0
new file mode 100644
index 0000000..ff90aa1
@@ -0,0 +1,2 @@
+   zreladdr-y	:= 0x20008000
+params_phys-y	:= 0x20000100
arch/arm/mach-s5pv210/cpu.c new file +126 -0

126 lines not on this page · raw message

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.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 +98 -0

98 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/mach-s5pv210/s5pv210-init.c new file +44 -0

44 lines not on this page · raw message

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;
Signature · 1 line
1.6.2.5