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> |
Kukjin Kim | 5f7f6a4 | 2010-01-29 10:12:14 +0900 | [diff] [blame] | 21 | #include <plat/s5p6442.h> |
Kukjin Kim | 939d28a | 2010-02-24 16:40:29 +0900 | [diff] [blame] | 22 | #include <plat/s5pv210.h> |
Kukjin Kim | 209fecd | 2010-01-14 15:29:17 +0900 | [diff] [blame] | 23 | |
| 24 | /* table of supported CPUs */ |
| 25 | |
| 26 | static const char name_s5p6440[] = "S5P6440"; |
Kukjin Kim | 5f7f6a4 | 2010-01-29 10:12:14 +0900 | [diff] [blame] | 27 | static const char name_s5p6442[] = "S5P6442"; |
Kukjin Kim | 939d28a | 2010-02-24 16:40:29 +0900 | [diff] [blame] | 28 | static const char name_s5pv210[] = "S5PV210/S5PC110"; |
Kukjin Kim | 209fecd | 2010-01-14 15:29:17 +0900 | [diff] [blame] | 29 | |
| 30 | static struct cpu_table cpu_ids[] __initdata = { |
| 31 | { |
| 32 | .idcode = 0x56440100, |
| 33 | .idmask = 0xffffff00, |
| 34 | .map_io = s5p6440_map_io, |
| 35 | .init_clocks = s5p6440_init_clocks, |
| 36 | .init_uarts = s5p6440_init_uarts, |
| 37 | .init = s5p6440_init, |
| 38 | .name = name_s5p6440, |
Kukjin Kim | 5f7f6a4 | 2010-01-29 10:12:14 +0900 | [diff] [blame] | 39 | }, { |
| 40 | .idcode = 0x36442000, |
| 41 | .idmask = 0xffffff00, |
| 42 | .map_io = s5p6442_map_io, |
| 43 | .init_clocks = s5p6442_init_clocks, |
| 44 | .init_uarts = s5p6442_init_uarts, |
| 45 | .init = s5p6442_init, |
| 46 | .name = name_s5p6442, |
Kukjin Kim | 939d28a | 2010-02-24 16:40:29 +0900 | [diff] [blame] | 47 | }, { |
| 48 | .idcode = 0x43110000, |
| 49 | .idmask = 0xfffff000, |
| 50 | .map_io = s5pv210_map_io, |
| 51 | .init_clocks = s5pv210_init_clocks, |
| 52 | .init_uarts = s5pv210_init_uarts, |
| 53 | .init = s5pv210_init, |
| 54 | .name = name_s5pv210, |
Kukjin Kim | 209fecd | 2010-01-14 15:29:17 +0900 | [diff] [blame] | 55 | }, |
| 56 | }; |
| 57 | |
| 58 | /* minimal IO mapping */ |
| 59 | |
Kukjin Kim | 209fecd | 2010-01-14 15:29:17 +0900 | [diff] [blame] | 60 | static struct map_desc s5p_iodesc[] __initdata = { |
| 61 | { |
Kukjin Kim | 8131796 | 2010-01-27 16:57:07 +0900 | [diff] [blame] | 62 | .virtual = (unsigned long)S5P_VA_CHIPID, |
| 63 | .pfn = __phys_to_pfn(S5P_PA_CHIPID), |
| 64 | .length = SZ_4K, |
| 65 | .type = MT_DEVICE, |
| 66 | }, { |
| 67 | .virtual = (unsigned long)S3C_VA_SYS, |
Kukjin Kim | 209fecd | 2010-01-14 15:29:17 +0900 | [diff] [blame] | 68 | .pfn = __phys_to_pfn(S5P_PA_SYSCON), |
| 69 | .length = SZ_64K, |
| 70 | .type = MT_DEVICE, |
| 71 | }, { |
Kukjin Kim | 8131796 | 2010-01-27 16:57:07 +0900 | [diff] [blame] | 72 | .virtual = (unsigned long)S3C_VA_UART, |
| 73 | .pfn = __phys_to_pfn(S3C_PA_UART), |
Kukjin Kim | 209fecd | 2010-01-14 15:29:17 +0900 | [diff] [blame] | 74 | .length = SZ_4K, |
| 75 | .type = MT_DEVICE, |
| 76 | }, { |
Kukjin Kim | 8131796 | 2010-01-27 16:57:07 +0900 | [diff] [blame] | 77 | .virtual = (unsigned long)VA_VIC0, |
Kukjin Kim | 209fecd | 2010-01-14 15:29:17 +0900 | [diff] [blame] | 78 | .pfn = __phys_to_pfn(S5P_PA_VIC0), |
| 79 | .length = SZ_16K, |
| 80 | .type = MT_DEVICE, |
| 81 | }, { |
Kukjin Kim | 8131796 | 2010-01-27 16:57:07 +0900 | [diff] [blame] | 82 | .virtual = (unsigned long)VA_VIC1, |
Kukjin Kim | 209fecd | 2010-01-14 15:29:17 +0900 | [diff] [blame] | 83 | .pfn = __phys_to_pfn(S5P_PA_VIC1), |
| 84 | .length = SZ_16K, |
| 85 | .type = MT_DEVICE, |
| 86 | }, { |
Kukjin Kim | 8131796 | 2010-01-27 16:57:07 +0900 | [diff] [blame] | 87 | .virtual = (unsigned long)S3C_VA_TIMER, |
Kukjin Kim | 209fecd | 2010-01-14 15:29:17 +0900 | [diff] [blame] | 88 | .pfn = __phys_to_pfn(S5P_PA_TIMER), |
| 89 | .length = SZ_16K, |
| 90 | .type = MT_DEVICE, |
| 91 | }, { |
| 92 | .virtual = (unsigned long)S5P_VA_GPIO, |
| 93 | .pfn = __phys_to_pfn(S5P_PA_GPIO), |
| 94 | .length = SZ_4K, |
| 95 | .type = MT_DEVICE, |
| 96 | }, |
| 97 | }; |
| 98 | |
| 99 | /* read cpu identification code */ |
| 100 | |
| 101 | void __init s5p_init_io(struct map_desc *mach_desc, |
| 102 | int size, void __iomem *cpuid_addr) |
| 103 | { |
| 104 | unsigned long idcode; |
| 105 | |
| 106 | /* initialize the io descriptors we need for initialization */ |
| 107 | iotable_init(s5p_iodesc, ARRAY_SIZE(s5p_iodesc)); |
| 108 | if (mach_desc) |
| 109 | iotable_init(mach_desc, size); |
| 110 | |
| 111 | idcode = __raw_readl(cpuid_addr); |
| 112 | s3c_init_cpu(idcode, cpu_ids, ARRAY_SIZE(cpu_ids)); |
| 113 | } |