2010-01-14 14:29:17 +08:00
|
|
|
/* linux/arch/arm/plat-s5p/cpu.c
|
|
|
|
*
|
2011-02-14 15:33:10 +08:00
|
|
|
* Copyright (c) 2009-2011 Samsung Electronics Co., Ltd.
|
|
|
|
* http://www.samsung.com
|
2010-01-14 14:29:17 +08:00
|
|
|
*
|
|
|
|
* S5P 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.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <linux/init.h>
|
|
|
|
#include <linux/module.h>
|
2011-02-14 15:33:10 +08:00
|
|
|
|
2010-01-14 14:29:17 +08:00
|
|
|
#include <asm/mach/arch.h>
|
|
|
|
#include <asm/mach/map.h>
|
2011-02-14 15:33:10 +08:00
|
|
|
|
|
|
|
#include <mach/map.h>
|
2010-01-14 14:29:17 +08:00
|
|
|
#include <mach/regs-clock.h>
|
2011-02-14 15:33:10 +08:00
|
|
|
|
2010-01-14 14:29:17 +08:00
|
|
|
#include <plat/cpu.h>
|
2010-02-24 15:40:29 +08:00
|
|
|
#include <plat/s5pv210.h>
|
2011-02-14 15:33:10 +08:00
|
|
|
#include <plat/exynos4.h>
|
2010-01-14 14:29:17 +08:00
|
|
|
|
|
|
|
/* table of supported CPUs */
|
|
|
|
|
2010-02-24 15:40:29 +08:00
|
|
|
static const char name_s5pv210[] = "S5PV210/S5PC110";
|
2011-02-14 15:33:10 +08:00
|
|
|
static const char name_exynos4210[] = "EXYNOS4210";
|
2011-08-24 16:25:09 +08:00
|
|
|
static const char name_exynos4212[] = "EXYNOS4212";
|
2011-10-04 16:08:56 +08:00
|
|
|
static const char name_exynos4412[] = "EXYNOS4412";
|
2010-01-14 14:29:17 +08:00
|
|
|
|
|
|
|
static struct cpu_table cpu_ids[] __initdata = {
|
|
|
|
{
|
2011-08-20 01:18:18 +08:00
|
|
|
.idcode = S5PV210_CPU_ID,
|
|
|
|
.idmask = S5PV210_CPU_MASK,
|
2010-02-24 15:40:29 +08:00
|
|
|
.map_io = s5pv210_map_io,
|
|
|
|
.init_clocks = s5pv210_init_clocks,
|
|
|
|
.init_uarts = s5pv210_init_uarts,
|
|
|
|
.init = s5pv210_init,
|
|
|
|
.name = name_s5pv210,
|
2010-07-26 20:08:52 +08:00
|
|
|
}, {
|
2011-08-20 01:18:18 +08:00
|
|
|
.idcode = EXYNOS4210_CPU_ID,
|
|
|
|
.idmask = EXYNOS4_CPU_MASK,
|
2011-02-14 15:33:10 +08:00
|
|
|
.map_io = exynos4_map_io,
|
|
|
|
.init_clocks = exynos4_init_clocks,
|
|
|
|
.init_uarts = exynos4_init_uarts,
|
2011-11-06 12:54:56 +08:00
|
|
|
.init = exynos_init,
|
2011-02-14 15:33:10 +08:00
|
|
|
.name = name_exynos4210,
|
2011-08-24 16:25:09 +08:00
|
|
|
}, {
|
|
|
|
.idcode = EXYNOS4212_CPU_ID,
|
|
|
|
.idmask = EXYNOS4_CPU_MASK,
|
|
|
|
.map_io = exynos4_map_io,
|
|
|
|
.init_clocks = exynos4_init_clocks,
|
|
|
|
.init_uarts = exynos4_init_uarts,
|
2011-11-06 12:54:56 +08:00
|
|
|
.init = exynos_init,
|
2011-08-24 16:25:09 +08:00
|
|
|
.name = name_exynos4212,
|
2011-10-04 16:08:56 +08:00
|
|
|
}, {
|
|
|
|
.idcode = EXYNOS4412_CPU_ID,
|
|
|
|
.idmask = EXYNOS4_CPU_MASK,
|
|
|
|
.map_io = exynos4_map_io,
|
|
|
|
.init_clocks = exynos4_init_clocks,
|
|
|
|
.init_uarts = exynos4_init_uarts,
|
2011-11-06 12:54:56 +08:00
|
|
|
.init = exynos_init,
|
2011-10-04 16:08:56 +08:00
|
|
|
.name = name_exynos4412,
|
2010-01-14 14:29:17 +08:00
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
/* minimal IO mapping */
|
|
|
|
|
|
|
|
static struct map_desc s5p_iodesc[] __initdata = {
|
|
|
|
{
|
2010-01-27 15:57:07 +08:00
|
|
|
.virtual = (unsigned long)S5P_VA_CHIPID,
|
|
|
|
.pfn = __phys_to_pfn(S5P_PA_CHIPID),
|
|
|
|
.length = SZ_4K,
|
|
|
|
.type = MT_DEVICE,
|
|
|
|
}, {
|
|
|
|
.virtual = (unsigned long)S3C_VA_SYS,
|
2010-01-14 14:29:17 +08:00
|
|
|
.pfn = __phys_to_pfn(S5P_PA_SYSCON),
|
|
|
|
.length = SZ_64K,
|
|
|
|
.type = MT_DEVICE,
|
|
|
|
}, {
|
2010-01-27 15:57:07 +08:00
|
|
|
.virtual = (unsigned long)S3C_VA_TIMER,
|
2010-01-14 14:29:17 +08:00
|
|
|
.pfn = __phys_to_pfn(S5P_PA_TIMER),
|
|
|
|
.length = SZ_16K,
|
|
|
|
.type = MT_DEVICE,
|
2010-06-23 20:31:21 +08:00
|
|
|
}, {
|
|
|
|
.virtual = (unsigned long)S3C_VA_WATCHDOG,
|
|
|
|
.pfn = __phys_to_pfn(S3C_PA_WDT),
|
|
|
|
.length = SZ_4K,
|
|
|
|
.type = MT_DEVICE,
|
2010-12-02 17:06:50 +08:00
|
|
|
}, {
|
|
|
|
.virtual = (unsigned long)S5P_VA_SROMC,
|
|
|
|
.pfn = __phys_to_pfn(S5P_PA_SROMC),
|
|
|
|
.length = SZ_4K,
|
|
|
|
.type = MT_DEVICE,
|
2010-01-14 14:29:17 +08:00
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
/* read cpu identification code */
|
|
|
|
|
|
|
|
void __init s5p_init_io(struct map_desc *mach_desc,
|
|
|
|
int size, void __iomem *cpuid_addr)
|
|
|
|
{
|
|
|
|
/* initialize the io descriptors we need for initialization */
|
|
|
|
iotable_init(s5p_iodesc, ARRAY_SIZE(s5p_iodesc));
|
|
|
|
if (mach_desc)
|
|
|
|
iotable_init(mach_desc, size);
|
|
|
|
|
2011-08-20 11:18:07 +08:00
|
|
|
/* detect cpu id and rev. */
|
|
|
|
s5p_init_cpu(cpuid_addr);
|
|
|
|
|
2011-08-20 01:18:18 +08:00
|
|
|
s3c_init_cpu(samsung_cpu_id, cpu_ids, ARRAY_SIZE(cpu_ids));
|
2010-01-14 14:29:17 +08:00
|
|
|
}
|