2010-01-14 13:29:17 +07:00
|
|
|
/* linux/arch/arm/plat-s5p/cpu.c
|
|
|
|
*
|
2011-02-14 14:33:10 +07:00
|
|
|
* Copyright (c) 2009-2011 Samsung Electronics Co., Ltd.
|
|
|
|
* http://www.samsung.com
|
2010-01-14 13:29:17 +07: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 14:33:10 +07:00
|
|
|
|
2010-01-14 13:29:17 +07:00
|
|
|
#include <asm/mach/arch.h>
|
|
|
|
#include <asm/mach/map.h>
|
2011-02-14 14:33:10 +07:00
|
|
|
|
|
|
|
#include <mach/map.h>
|
2010-01-14 13:29:17 +07:00
|
|
|
#include <mach/regs-clock.h>
|
2011-02-14 14:33:10 +07:00
|
|
|
|
2010-01-14 13:29:17 +07:00
|
|
|
#include <plat/cpu.h>
|
|
|
|
#include <plat/s5p6440.h>
|
2010-10-18 16:29:51 +07:00
|
|
|
#include <plat/s5p6450.h>
|
2010-05-20 12:51:08 +07:00
|
|
|
#include <plat/s5pc100.h>
|
2010-02-24 14:40:29 +07:00
|
|
|
#include <plat/s5pv210.h>
|
2011-02-14 14:33:10 +07:00
|
|
|
#include <plat/exynos4.h>
|
2010-01-14 13:29:17 +07:00
|
|
|
|
|
|
|
/* table of supported CPUs */
|
|
|
|
|
|
|
|
static const char name_s5p6440[] = "S5P6440";
|
2010-10-18 16:29:51 +07:00
|
|
|
static const char name_s5p6450[] = "S5P6450";
|
2010-05-20 12:51:08 +07:00
|
|
|
static const char name_s5pc100[] = "S5PC100";
|
2010-02-24 14:40:29 +07:00
|
|
|
static const char name_s5pv210[] = "S5PV210/S5PC110";
|
2011-02-14 14:33:10 +07:00
|
|
|
static const char name_exynos4210[] = "EXYNOS4210";
|
2011-08-24 15:25:09 +07:00
|
|
|
static const char name_exynos4212[] = "EXYNOS4212";
|
2011-10-04 15:08:56 +07:00
|
|
|
static const char name_exynos4412[] = "EXYNOS4412";
|
2010-01-14 13:29:17 +07:00
|
|
|
|
|
|
|
static struct cpu_table cpu_ids[] __initdata = {
|
|
|
|
{
|
2011-08-20 00:18:18 +07:00
|
|
|
.idcode = S5P6440_CPU_ID,
|
|
|
|
.idmask = S5P64XX_CPU_MASK,
|
2010-01-14 13:29:17 +07:00
|
|
|
.map_io = s5p6440_map_io,
|
|
|
|
.init_clocks = s5p6440_init_clocks,
|
|
|
|
.init_uarts = s5p6440_init_uarts,
|
2010-10-18 16:29:51 +07:00
|
|
|
.init = s5p64x0_init,
|
2010-01-14 13:29:17 +07:00
|
|
|
.name = name_s5p6440,
|
2010-10-18 16:29:51 +07:00
|
|
|
}, {
|
2011-08-20 00:18:18 +07:00
|
|
|
.idcode = S5P6450_CPU_ID,
|
|
|
|
.idmask = S5P64XX_CPU_MASK,
|
2010-10-18 16:29:51 +07:00
|
|
|
.map_io = s5p6450_map_io,
|
|
|
|
.init_clocks = s5p6450_init_clocks,
|
|
|
|
.init_uarts = s5p6450_init_uarts,
|
|
|
|
.init = s5p64x0_init,
|
|
|
|
.name = name_s5p6450,
|
2010-05-20 12:51:08 +07:00
|
|
|
}, {
|
2011-08-20 00:18:18 +07:00
|
|
|
.idcode = S5PC100_CPU_ID,
|
|
|
|
.idmask = S5PC100_CPU_MASK,
|
2010-05-20 12:51:08 +07:00
|
|
|
.map_io = s5pc100_map_io,
|
|
|
|
.init_clocks = s5pc100_init_clocks,
|
|
|
|
.init_uarts = s5pc100_init_uarts,
|
|
|
|
.init = s5pc100_init,
|
|
|
|
.name = name_s5pc100,
|
2010-02-24 14:40:29 +07:00
|
|
|
}, {
|
2011-08-20 00:18:18 +07:00
|
|
|
.idcode = S5PV210_CPU_ID,
|
|
|
|
.idmask = S5PV210_CPU_MASK,
|
2010-02-24 14:40:29 +07: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 19:08:52 +07:00
|
|
|
}, {
|
2011-08-20 00:18:18 +07:00
|
|
|
.idcode = EXYNOS4210_CPU_ID,
|
|
|
|
.idmask = EXYNOS4_CPU_MASK,
|
2011-02-14 14:33:10 +07:00
|
|
|
.map_io = exynos4_map_io,
|
|
|
|
.init_clocks = exynos4_init_clocks,
|
|
|
|
.init_uarts = exynos4_init_uarts,
|
2011-11-06 11:54:56 +07:00
|
|
|
.init = exynos_init,
|
2011-02-14 14:33:10 +07:00
|
|
|
.name = name_exynos4210,
|
2011-08-24 15:25:09 +07: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 11:54:56 +07:00
|
|
|
.init = exynos_init,
|
2011-08-24 15:25:09 +07:00
|
|
|
.name = name_exynos4212,
|
2011-10-04 15:08:56 +07: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 11:54:56 +07:00
|
|
|
.init = exynos_init,
|
2011-10-04 15:08:56 +07:00
|
|
|
.name = name_exynos4412,
|
2010-01-14 13:29:17 +07:00
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
/* minimal IO mapping */
|
|
|
|
|
|
|
|
static struct map_desc s5p_iodesc[] __initdata = {
|
|
|
|
{
|
2010-01-27 14:57:07 +07: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 13:29:17 +07:00
|
|
|
.pfn = __phys_to_pfn(S5P_PA_SYSCON),
|
|
|
|
.length = SZ_64K,
|
|
|
|
.type = MT_DEVICE,
|
|
|
|
}, {
|
2010-01-27 14:57:07 +07:00
|
|
|
.virtual = (unsigned long)S3C_VA_TIMER,
|
2010-01-14 13:29:17 +07:00
|
|
|
.pfn = __phys_to_pfn(S5P_PA_TIMER),
|
|
|
|
.length = SZ_16K,
|
|
|
|
.type = MT_DEVICE,
|
2010-06-23 19:31:21 +07:00
|
|
|
}, {
|
|
|
|
.virtual = (unsigned long)S3C_VA_WATCHDOG,
|
|
|
|
.pfn = __phys_to_pfn(S3C_PA_WDT),
|
|
|
|
.length = SZ_4K,
|
|
|
|
.type = MT_DEVICE,
|
2010-12-02 16:06:50 +07:00
|
|
|
}, {
|
|
|
|
.virtual = (unsigned long)S5P_VA_SROMC,
|
|
|
|
.pfn = __phys_to_pfn(S5P_PA_SROMC),
|
|
|
|
.length = SZ_4K,
|
|
|
|
.type = MT_DEVICE,
|
2010-01-14 13:29:17 +07: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 10:18:07 +07:00
|
|
|
/* detect cpu id and rev. */
|
|
|
|
s5p_init_cpu(cpuid_addr);
|
|
|
|
|
2011-08-20 00:18:18 +07:00
|
|
|
s3c_init_cpu(samsung_cpu_id, cpu_ids, ARRAY_SIZE(cpu_ids));
|
2010-01-14 13:29:17 +07:00
|
|
|
}
|