Skip to content

Commit

Permalink
ARM: S5PV210: Add Samsung S5PV210 CPU support
Browse files Browse the repository at this point in the history
This patch adds support for Samsung S5PV210 CPU. This patch also adds
an entry for S5PV210 cpu in plat-s5p cpu table.

Signed-off-by: Thomas Abraham <thomas.ab@samsung.com>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
  • Loading branch information
Kukjin Kim authored and Ben Dooks committed Feb 24, 2010
1 parent 2e5070b commit 939d28a
Show file tree
Hide file tree
Showing 19 changed files with 732 additions and 0 deletions.
40 changes: 40 additions & 0 deletions arch/arm/mach-s5pv210/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# 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 PLAT_S5P
help
Enable S5PV210 CPU support

choice
prompt "Select machine type"
depends on ARCH_S5PV210
default MACH_SMDKV210

config MACH_SMDKV210
bool "SMDKV210"
select CPU_S5PV210
select ARCH_SPARSEMEM_ENABLE
help
Machine support for Samsung SMDKV210

config MACH_SMDKC110
bool "SMDKC110"
select CPU_S5PV210
select ARCH_SPARSEMEM_ENABLE
help
Machine support for Samsung SMDKC110
S5PC110(MCP) is one of package option of S5PV210

endchoice

endif
18 changes: 18 additions & 0 deletions arch/arm/mach-s5pv210/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# 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 init.o

# machine support

2 changes: 2 additions & 0 deletions arch/arm/mach-s5pv210/Makefile.boot
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
zreladdr-y := 0x20008000
params_phys-y := 0x20000100
126 changes: 126 additions & 0 deletions arch/arm/mach-s5pv210/cpu.c
Original file line number Diff line number Diff line change
@@ -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(S5PV210_PA_SYSTIMER),
.length = SZ_1M,
.type = MT_DEVICE,
}, {
.virtual = (unsigned long)VA_VIC2,
.pfn = __phys_to_pfn(S5PV210_PA_VIC2),
.length = SZ_16K,
.type = MT_DEVICE,
}, {
.virtual = (unsigned long)VA_VIC3,
.pfn = __phys_to_pfn(S5PV210_PA_VIC3),
.length = SZ_16K,
.type = MT_DEVICE,
}, {
.virtual = (unsigned long)S5P_VA_SROMC,
.pfn = __phys_to_pfn(S5PV210_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);
}
42 changes: 42 additions & 0 deletions arch/arm/mach-s5pv210/include/mach/debug-macro.S
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/* 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, = S3C_PA_UART
ldrne \rx, = S3C_VA_UART
#if CONFIG_DEBUG_S3C_UART != 0
add \rx, \rx, #(0x400 * CONFIG_DEBUG_S3C_UART)
#endif
.endm

#define fifo_full fifo_full_s5pv210
#define fifo_level fifo_level_s5pv210

/* 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>
54 changes: 54 additions & 0 deletions arch/arm/mach-s5pv210/include/mach/entry-macro.S
Original file line number Diff line number Diff line change
@@ -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, =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, #(VA_VIC1 - VA_VIC0)
addeq \irqnr, \irqnr, #32
ldreq \irqstat, [ \tmp, # VIC_IRQ_STATUS ]
teqeq \irqstat, #0

@ otherwise try vic2
addeq \tmp, \base, #(VA_VIC2 - VA_VIC0)
addeq \irqnr, \irqnr, #32
ldreq \irqstat, [ \tmp, # VIC_IRQ_STATUS ]
teqeq \irqstat, #0

@ otherwise try vic3
addeq \tmp, \base, #(VA_VIC3 - VA_VIC0)
addeq \irqnr, \irqnr, #32
ldreq \irqstat, [ \tmp, # VIC_IRQ_STATUS ]
teqeq \irqstat, #0

clzne \irqstat, \irqstat
subne \irqnr, \irqnr, \irqstat
.endm
Loading

0 comments on commit 939d28a

Please sign in to comment.