Christian Daudt | 8ac49e0 | 2012-11-19 09:46:10 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2012 Broadcom Corporation |
| 3 | * |
| 4 | * This program is free software; you can redistribute it and/or |
| 5 | * modify it under the terms of the GNU General Public License as |
| 6 | * published by the Free Software Foundation version 2. |
| 7 | * |
| 8 | * This program is distributed "as is" WITHOUT ANY WARRANTY of any |
| 9 | * kind, whether express or implied; without even the implied warranty |
| 10 | * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 11 | * GNU General Public License for more details. |
| 12 | */ |
| 13 | |
Christian Daudt | 8ac49e0 | 2012-11-19 09:46:10 -0800 | [diff] [blame] | 14 | #include <linux/of_platform.h> |
| 15 | #include <linux/init.h> |
| 16 | #include <linux/device.h> |
| 17 | #include <linux/platform_device.h> |
Rob Herring | 0529e315 | 2012-11-05 16:18:28 -0600 | [diff] [blame] | 18 | #include <linux/irqchip.h> |
Christian Daudt | 8ac49e0 | 2012-11-19 09:46:10 -0800 | [diff] [blame] | 19 | |
| 20 | #include <asm/mach/arch.h> |
Christian Daudt | 8ac49e0 | 2012-11-19 09:46:10 -0800 | [diff] [blame] | 21 | #include <asm/mach/time.h> |
Christian Daudt | b8eb35f | 2013-02-26 21:48:49 -0800 | [diff] [blame^] | 22 | #include <asm/hardware/cache-l2x0.h> |
Christian Daudt | 8ac49e0 | 2012-11-19 09:46:10 -0800 | [diff] [blame] | 23 | |
Christian Daudt | 8ac49e0 | 2012-11-19 09:46:10 -0800 | [diff] [blame] | 24 | static void timer_init(void) |
| 25 | { |
| 26 | } |
| 27 | |
Christian Daudt | 8ac49e0 | 2012-11-19 09:46:10 -0800 | [diff] [blame] | 28 | |
Christian Daudt | b8eb35f | 2013-02-26 21:48:49 -0800 | [diff] [blame^] | 29 | #include "bcm_kona_smc.h" |
| 30 | |
| 31 | static int __init kona_l2_cache_init(void) |
| 32 | { |
| 33 | if (!IS_ENABLED(CONFIG_CACHE_L2X0)) |
| 34 | return 0; |
| 35 | |
| 36 | bcm_kona_smc(SSAPI_ENABLE_L2_CACHE, 0, 0, 0, 0); |
| 37 | |
| 38 | /* |
| 39 | * The aux_val and aux_mask have no effect since L2 cache is already |
| 40 | * enabled. Pass 0s for aux_val and 1s for aux_mask for default value. |
| 41 | */ |
| 42 | l2x0_of_init(0, ~0); |
| 43 | |
| 44 | return 0; |
| 45 | } |
| 46 | |
Christian Daudt | 8ac49e0 | 2012-11-19 09:46:10 -0800 | [diff] [blame] | 47 | static void __init board_init(void) |
| 48 | { |
| 49 | of_platform_populate(NULL, of_default_bus_match_table, NULL, |
| 50 | &platform_bus); |
Christian Daudt | b8eb35f | 2013-02-26 21:48:49 -0800 | [diff] [blame^] | 51 | |
| 52 | bcm_kona_smc_init(); |
| 53 | |
| 54 | kona_l2_cache_init(); |
Christian Daudt | 8ac49e0 | 2012-11-19 09:46:10 -0800 | [diff] [blame] | 55 | } |
| 56 | |
| 57 | static const char * const bcm11351_dt_compat[] = { "bcm,bcm11351", NULL, }; |
| 58 | |
| 59 | DT_MACHINE_START(BCM11351_DT, "Broadcom Application Processor") |
Rob Herring | 0529e315 | 2012-11-05 16:18:28 -0600 | [diff] [blame] | 60 | .init_irq = irqchip_init, |
Stephen Warren | 6bb27d7 | 2012-11-08 12:40:59 -0700 | [diff] [blame] | 61 | .init_time = timer_init, |
Christian Daudt | 8ac49e0 | 2012-11-19 09:46:10 -0800 | [diff] [blame] | 62 | .init_machine = board_init, |
| 63 | .dt_compat = bcm11351_dt_compat, |
Christian Daudt | 8ac49e0 | 2012-11-19 09:46:10 -0800 | [diff] [blame] | 64 | MACHINE_END |