blob: 28599326d4adaf33fcdbb69c7cfddfc20bf616c2 [file] [log] [blame]
Christian Daudt8ac49e02012-11-19 09:46:10 -08001/*
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 Daudt8ac49e02012-11-19 09:46:10 -080014#include <linux/of_platform.h>
15#include <linux/init.h>
16#include <linux/device.h>
17#include <linux/platform_device.h>
Christian Daudt80116572013-03-13 14:27:27 -070018#include <linux/clocksource.h>
Christian Daudt8ac49e02012-11-19 09:46:10 -080019
20#include <asm/mach/arch.h>
Christian Daudt8ac49e02012-11-19 09:46:10 -080021#include <asm/mach/time.h>
Christian Daudtb8eb35f2013-02-26 21:48:49 -080022#include <asm/hardware/cache-l2x0.h>
Christian Daudt8ac49e02012-11-19 09:46:10 -080023
Christian Daudt8ac49e02012-11-19 09:46:10 -080024
Christian Daudtb8eb35f2013-02-26 21:48:49 -080025#include "bcm_kona_smc.h"
26
27static int __init kona_l2_cache_init(void)
28{
29 if (!IS_ENABLED(CONFIG_CACHE_L2X0))
30 return 0;
31
32 bcm_kona_smc(SSAPI_ENABLE_L2_CACHE, 0, 0, 0, 0);
33
34 /*
35 * The aux_val and aux_mask have no effect since L2 cache is already
36 * enabled. Pass 0s for aux_val and 1s for aux_mask for default value.
37 */
38 l2x0_of_init(0, ~0);
39
40 return 0;
41}
42
Christian Daudt8ac49e02012-11-19 09:46:10 -080043static void __init board_init(void)
44{
45 of_platform_populate(NULL, of_default_bus_match_table, NULL,
46 &platform_bus);
Christian Daudtb8eb35f2013-02-26 21:48:49 -080047
48 bcm_kona_smc_init();
49
50 kona_l2_cache_init();
Christian Daudt8ac49e02012-11-19 09:46:10 -080051}
52
53static const char * const bcm11351_dt_compat[] = { "bcm,bcm11351", NULL, };
54
55DT_MACHINE_START(BCM11351_DT, "Broadcom Application Processor")
Christian Daudt80116572013-03-13 14:27:27 -070056 .init_time = clocksource_of_init,
Christian Daudt8ac49e02012-11-19 09:46:10 -080057 .init_machine = board_init,
58 .dt_compat = bcm11351_dt_compat,
Christian Daudt8ac49e02012-11-19 09:46:10 -080059MACHINE_END