Kukjin Kim | 209fecd | 2010-01-14 15:29:17 +0900 | [diff] [blame] | 1 | /* linux/arch/arm/plat-s5p/cpu.c |
| 2 | * |
| 3 | * Copyright (c) 2009 Samsung Electronics Co., Ltd. |
| 4 | * http://www.samsung.com/ |
| 5 | * |
| 6 | * S5P CPU Support |
| 7 | * |
| 8 | * This program is free software; you can redistribute it and/or modify |
| 9 | * it under the terms of the GNU General Public License version 2 as |
| 10 | * published by the Free Software Foundation. |
| 11 | */ |
| 12 | |
| 13 | #include <linux/init.h> |
| 14 | #include <linux/module.h> |
| 15 | #include <mach/map.h> |
| 16 | #include <asm/mach/arch.h> |
| 17 | #include <asm/mach/map.h> |
| 18 | #include <mach/regs-clock.h> |
| 19 | #include <plat/cpu.h> |
| 20 | #include <plat/s5p6440.h> |
| 21 | |
| 22 | /* table of supported CPUs */ |
| 23 | |
| 24 | static const char name_s5p6440[] = "S5P6440"; |
| 25 | |
| 26 | static struct cpu_table cpu_ids[] __initdata = { |
| 27 | { |
| 28 | .idcode = 0x56440100, |
| 29 | .idmask = 0xffffff00, |
| 30 | .map_io = s5p6440_map_io, |
| 31 | .init_clocks = s5p6440_init_clocks, |
| 32 | .init_uarts = s5p6440_init_uarts, |
| 33 | .init = s5p6440_init, |
| 34 | .name = name_s5p6440, |
| 35 | }, |
| 36 | }; |
| 37 | |
| 38 | /* minimal IO mapping */ |
| 39 | |
Kukjin Kim | 209fecd | 2010-01-14 15:29:17 +0900 | [diff] [blame] | 40 | static struct map_desc s5p_iodesc[] __initdata = { |
| 41 | { |
Kukjin Kim | 8131796 | 2010-01-27 16:57:07 +0900 | [diff] [blame^] | 42 | .virtual = (unsigned long)S5P_VA_CHIPID, |
| 43 | .pfn = __phys_to_pfn(S5P_PA_CHIPID), |
| 44 | .length = SZ_4K, |
| 45 | .type = MT_DEVICE, |
| 46 | }, { |
| 47 | .virtual = (unsigned long)S3C_VA_SYS, |
Kukjin Kim | 209fecd | 2010-01-14 15:29:17 +0900 | [diff] [blame] | 48 | .pfn = __phys_to_pfn(S5P_PA_SYSCON), |
| 49 | .length = SZ_64K, |
| 50 | .type = MT_DEVICE, |
| 51 | }, { |
Kukjin Kim | 8131796 | 2010-01-27 16:57:07 +0900 | [diff] [blame^] | 52 | .virtual = (unsigned long)S3C_VA_UART, |
| 53 | .pfn = __phys_to_pfn(S3C_PA_UART), |
Kukjin Kim | 209fecd | 2010-01-14 15:29:17 +0900 | [diff] [blame] | 54 | .length = SZ_4K, |
| 55 | .type = MT_DEVICE, |
| 56 | }, { |
Kukjin Kim | 8131796 | 2010-01-27 16:57:07 +0900 | [diff] [blame^] | 57 | .virtual = (unsigned long)VA_VIC0, |
Kukjin Kim | 209fecd | 2010-01-14 15:29:17 +0900 | [diff] [blame] | 58 | .pfn = __phys_to_pfn(S5P_PA_VIC0), |
| 59 | .length = SZ_16K, |
| 60 | .type = MT_DEVICE, |
| 61 | }, { |
Kukjin Kim | 8131796 | 2010-01-27 16:57:07 +0900 | [diff] [blame^] | 62 | .virtual = (unsigned long)VA_VIC1, |
Kukjin Kim | 209fecd | 2010-01-14 15:29:17 +0900 | [diff] [blame] | 63 | .pfn = __phys_to_pfn(S5P_PA_VIC1), |
| 64 | .length = SZ_16K, |
| 65 | .type = MT_DEVICE, |
| 66 | }, { |
Kukjin Kim | 8131796 | 2010-01-27 16:57:07 +0900 | [diff] [blame^] | 67 | .virtual = (unsigned long)S3C_VA_TIMER, |
Kukjin Kim | 209fecd | 2010-01-14 15:29:17 +0900 | [diff] [blame] | 68 | .pfn = __phys_to_pfn(S5P_PA_TIMER), |
| 69 | .length = SZ_16K, |
| 70 | .type = MT_DEVICE, |
| 71 | }, { |
| 72 | .virtual = (unsigned long)S5P_VA_GPIO, |
| 73 | .pfn = __phys_to_pfn(S5P_PA_GPIO), |
| 74 | .length = SZ_4K, |
| 75 | .type = MT_DEVICE, |
| 76 | }, |
| 77 | }; |
| 78 | |
| 79 | /* read cpu identification code */ |
| 80 | |
| 81 | void __init s5p_init_io(struct map_desc *mach_desc, |
| 82 | int size, void __iomem *cpuid_addr) |
| 83 | { |
| 84 | unsigned long idcode; |
| 85 | |
| 86 | /* initialize the io descriptors we need for initialization */ |
| 87 | iotable_init(s5p_iodesc, ARRAY_SIZE(s5p_iodesc)); |
| 88 | if (mach_desc) |
| 89 | iotable_init(mach_desc, size); |
| 90 | |
| 91 | idcode = __raw_readl(cpuid_addr); |
| 92 | s3c_init_cpu(idcode, cpu_ids, ARRAY_SIZE(cpu_ids)); |
| 93 | } |