Merge tag 'v3.10.77' into update
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / arch / arm / mach-bcm / board_bcm.c
CommitLineData
8ac49e04
CD
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
8ac49e04
CD
14#include <linux/of_platform.h>
15#include <linux/init.h>
16#include <linux/device.h>
17#include <linux/platform_device.h>
0529e315 18#include <linux/irqchip.h>
8011657b 19#include <linux/clocksource.h>
8ac49e04
CD
20
21#include <asm/mach/arch.h>
8ac49e04 22#include <asm/mach/time.h>
b8eb35fd 23#include <asm/hardware/cache-l2x0.h>
8ac49e04 24
8ac49e04 25
b8eb35fd
CD
26#include "bcm_kona_smc.h"
27
28static int __init kona_l2_cache_init(void)
29{
30 if (!IS_ENABLED(CONFIG_CACHE_L2X0))
31 return 0;
32
33 bcm_kona_smc(SSAPI_ENABLE_L2_CACHE, 0, 0, 0, 0);
34
35 /*
36 * The aux_val and aux_mask have no effect since L2 cache is already
37 * enabled. Pass 0s for aux_val and 1s for aux_mask for default value.
38 */
39 l2x0_of_init(0, ~0);
40
41 return 0;
42}
43
8ac49e04
CD
44static void __init board_init(void)
45{
46 of_platform_populate(NULL, of_default_bus_match_table, NULL,
47 &platform_bus);
b8eb35fd
CD
48
49 bcm_kona_smc_init();
50
51 kona_l2_cache_init();
8ac49e04
CD
52}
53
54static const char * const bcm11351_dt_compat[] = { "bcm,bcm11351", NULL, };
55
56DT_MACHINE_START(BCM11351_DT, "Broadcom Application Processor")
0529e315 57 .init_irq = irqchip_init,
8011657b 58 .init_time = clocksource_of_init,
8ac49e04
CD
59 .init_machine = board_init,
60 .dt_compat = bcm11351_dt_compat,
8ac49e04 61MACHINE_END