Srinivas Kandagatla | 65ebcc1 | 2013-06-25 12:15:10 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2013 STMicroelectronics (R&D) Limited. |
| 3 | * Author(s): Srinivas Kandagatla <srinivas.kandagatla@st.com> |
| 4 | * |
| 5 | * This program is free software; you can redistribute it and/or modify |
| 6 | * it under the terms of the GNU General Public License version 2 as |
| 7 | * published by the Free Software Foundation. |
| 8 | */ |
| 9 | |
Srinivas Kandagatla | 65ebcc1 | 2013-06-25 12:15:10 +0100 | [diff] [blame] | 10 | #include <linux/irq.h> |
Sebastian Hesselbarth | 28fbb151 | 2013-08-27 15:23:07 +0200 | [diff] [blame] | 11 | #include <linux/of_platform.h> |
Srinivas Kandagatla | 65ebcc1 | 2013-06-25 12:15:10 +0100 | [diff] [blame] | 12 | #include <asm/hardware/cache-l2x0.h> |
| 13 | #include <asm/mach/arch.h> |
| 14 | |
| 15 | #include "smp.h" |
| 16 | |
| 17 | void __init stih41x_l2x0_init(void) |
| 18 | { |
| 19 | u32 way_size = 0x4; |
| 20 | u32 aux_ctrl; |
| 21 | /* may be this can be encoded in macros like BIT*() */ |
| 22 | aux_ctrl = (0x1 << L2X0_AUX_CTRL_SHARE_OVERRIDE_SHIFT) | |
| 23 | (0x1 << L2X0_AUX_CTRL_DATA_PREFETCH_SHIFT) | |
| 24 | (0x1 << L2X0_AUX_CTRL_INSTR_PREFETCH_SHIFT) | |
| 25 | (way_size << L2X0_AUX_CTRL_WAY_SIZE_SHIFT); |
| 26 | |
| 27 | l2x0_of_init(aux_ctrl, L2X0_AUX_CTRL_MASK); |
| 28 | } |
| 29 | |
Sebastian Hesselbarth | 28fbb151 | 2013-08-27 15:23:07 +0200 | [diff] [blame] | 30 | static void __init stih41x_machine_init(void) |
Srinivas Kandagatla | 65ebcc1 | 2013-06-25 12:15:10 +0100 | [diff] [blame] | 31 | { |
Srinivas Kandagatla | 65ebcc1 | 2013-06-25 12:15:10 +0100 | [diff] [blame] | 32 | stih41x_l2x0_init(); |
Sebastian Hesselbarth | 28fbb151 | 2013-08-27 15:23:07 +0200 | [diff] [blame] | 33 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); |
Srinivas Kandagatla | 65ebcc1 | 2013-06-25 12:15:10 +0100 | [diff] [blame] | 34 | } |
| 35 | |
| 36 | static const char *stih41x_dt_match[] __initdata = { |
| 37 | "st,stih415", |
Srinivas Kandagatla | 15969b4 | 2013-06-25 12:15:23 +0100 | [diff] [blame] | 38 | "st,stih416", |
Srinivas Kandagatla | 65ebcc1 | 2013-06-25 12:15:10 +0100 | [diff] [blame] | 39 | NULL |
| 40 | }; |
| 41 | |
Srinivas Kandagatla | 15969b4 | 2013-06-25 12:15:23 +0100 | [diff] [blame] | 42 | DT_MACHINE_START(STM, "STiH415/416 SoC with Flattened Device Tree") |
Sebastian Hesselbarth | 28fbb151 | 2013-08-27 15:23:07 +0200 | [diff] [blame] | 43 | .init_machine = stih41x_machine_init, |
Srinivas Kandagatla | 65ebcc1 | 2013-06-25 12:15:10 +0100 | [diff] [blame] | 44 | .smp = smp_ops(sti_smp_ops), |
| 45 | .dt_compat = stih41x_dt_match, |
| 46 | MACHINE_END |