Magnus Damm | 7f627f0 | 2012-05-16 15:44:58 +0900 | [diff] [blame] | 1 | /* |
| 2 | * Emma Mobile EV2 processor support |
| 3 | * |
| 4 | * Copyright (C) 2012 Magnus Damm |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License as published by |
| 8 | * the Free Software Foundation; version 2 of the License. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU General Public License for more details. |
| 14 | * |
| 15 | * You should have received a copy of the GNU General Public License |
| 16 | * along with this program; if not, write to the Free Software |
| 17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
| 18 | */ |
Magnus Damm | a3153e6 | 2013-11-07 08:21:11 +0900 | [diff] [blame] | 19 | #include <linux/clk-provider.h> |
Magnus Damm | 7f627f0 | 2012-05-16 15:44:58 +0900 | [diff] [blame] | 20 | #include <linux/kernel.h> |
| 21 | #include <linux/init.h> |
Magnus Damm | 3d5de27 | 2012-05-16 15:45:54 +0900 | [diff] [blame] | 22 | #include <linux/of_platform.h> |
Magnus Damm | 7f627f0 | 2012-05-16 15:44:58 +0900 | [diff] [blame] | 23 | #include <mach/common.h> |
| 24 | #include <mach/emev2.h> |
Magnus Damm | 7f627f0 | 2012-05-16 15:44:58 +0900 | [diff] [blame] | 25 | #include <asm/mach-types.h> |
| 26 | #include <asm/mach/arch.h> |
| 27 | #include <asm/mach/map.h> |
Magnus Damm | 7f627f0 | 2012-05-16 15:44:58 +0900 | [diff] [blame] | 28 | |
Magnus Damm | bd5a875 | 2012-05-16 15:45:25 +0900 | [diff] [blame] | 29 | static struct map_desc emev2_io_desc[] __initdata = { |
| 30 | #ifdef CONFIG_SMP |
Magnus Damm | bd5a875 | 2012-05-16 15:45:25 +0900 | [diff] [blame] | 31 | /* 2M mapping for SCU + L2 controller */ |
| 32 | { |
| 33 | .virtual = 0xf0000000, |
| 34 | .pfn = __phys_to_pfn(0x1e000000), |
| 35 | .length = SZ_2M, |
| 36 | .type = MT_DEVICE |
| 37 | }, |
| 38 | #endif |
| 39 | }; |
| 40 | |
| 41 | void __init emev2_map_io(void) |
| 42 | { |
| 43 | iotable_init(emev2_io_desc, ARRAY_SIZE(emev2_io_desc)); |
| 44 | } |
| 45 | |
Magnus Damm | 4146fa8 | 2013-07-02 18:27:33 +0900 | [diff] [blame] | 46 | void __init emev2_init_delay(void) |
Magnus Damm | 7f627f0 | 2012-05-16 15:44:58 +0900 | [diff] [blame] | 47 | { |
| 48 | shmobile_setup_delay(533, 1, 3); /* Cortex-A9 @ 533MHz */ |
Magnus Damm | 3d5de27 | 2012-05-16 15:45:54 +0900 | [diff] [blame] | 49 | } |
| 50 | |
Magnus Damm | a3153e6 | 2013-11-07 08:21:11 +0900 | [diff] [blame] | 51 | static void __init emev2_add_standard_devices_dt(void) |
| 52 | { |
| 53 | #ifdef CONFIG_COMMON_CLK |
| 54 | of_clk_init(NULL); |
| 55 | #else |
| 56 | emev2_clock_init(); |
| 57 | #endif |
| 58 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); |
| 59 | } |
| 60 | |
Magnus Damm | 3d5de27 | 2012-05-16 15:45:54 +0900 | [diff] [blame] | 61 | static const char *emev2_boards_compat_dt[] __initdata = { |
| 62 | "renesas,emev2", |
| 63 | NULL, |
| 64 | }; |
| 65 | |
Magnus Damm | 3d5de27 | 2012-05-16 15:45:54 +0900 | [diff] [blame] | 66 | DT_MACHINE_START(EMEV2_DT, "Generic Emma Mobile EV2 (Flattened Device Tree)") |
Marc Zyngier | a62580e | 2011-09-08 13:15:22 +0100 | [diff] [blame] | 67 | .smp = smp_ops(emev2_smp_ops), |
Magnus Damm | 0ea2b53 | 2013-07-02 18:28:22 +0900 | [diff] [blame] | 68 | .map_io = emev2_map_io, |
Magnus Damm | 3d5de27 | 2012-05-16 15:45:54 +0900 | [diff] [blame] | 69 | .init_early = emev2_init_delay, |
Magnus Damm | a3153e6 | 2013-11-07 08:21:11 +0900 | [diff] [blame] | 70 | .init_machine = emev2_add_standard_devices_dt, |
Magnus Damm | 3f348e1 | 2013-11-07 08:21:20 +0900 | [diff] [blame] | 71 | .init_late = shmobile_init_late, |
Magnus Damm | 3d5de27 | 2012-05-16 15:45:54 +0900 | [diff] [blame] | 72 | .dt_compat = emev2_boards_compat_dt, |
| 73 | MACHINE_END |