1*4882a593Smuzhiyun /*
2*4882a593Smuzhiyun * Broadcom BCM470X / BCM5301X ARM platform code.
3*4882a593Smuzhiyun *
4*4882a593Smuzhiyun * Copyright 2013 Hauke Mehrtens <hauke@hauke-m.de>
5*4882a593Smuzhiyun *
6*4882a593Smuzhiyun * Licensed under the GNU/GPL. See COPYING for details.
7*4882a593Smuzhiyun */
8*4882a593Smuzhiyun #include <linux/of_platform.h>
9*4882a593Smuzhiyun #include <asm/hardware/cache-l2x0.h>
10*4882a593Smuzhiyun
11*4882a593Smuzhiyun #include <asm/mach/arch.h>
12*4882a593Smuzhiyun #include <asm/siginfo.h>
13*4882a593Smuzhiyun #include <asm/signal.h>
14*4882a593Smuzhiyun
15*4882a593Smuzhiyun #define FSR_EXTERNAL (1 << 12)
16*4882a593Smuzhiyun #define FSR_READ (0 << 10)
17*4882a593Smuzhiyun #define FSR_IMPRECISE 0x0406
18*4882a593Smuzhiyun
19*4882a593Smuzhiyun static const char *const bcm5301x_dt_compat[] __initconst = {
20*4882a593Smuzhiyun "brcm,bcm4708",
21*4882a593Smuzhiyun NULL,
22*4882a593Smuzhiyun };
23*4882a593Smuzhiyun
bcm5301x_abort_handler(unsigned long addr,unsigned int fsr,struct pt_regs * regs)24*4882a593Smuzhiyun static int bcm5301x_abort_handler(unsigned long addr, unsigned int fsr,
25*4882a593Smuzhiyun struct pt_regs *regs)
26*4882a593Smuzhiyun {
27*4882a593Smuzhiyun /*
28*4882a593Smuzhiyun * We want to ignore aborts forwarded from the PCIe bus that are
29*4882a593Smuzhiyun * expected and shouldn't really be passed by the PCIe controller.
30*4882a593Smuzhiyun * The biggest disadvantage is the same FSR code may be reported when
31*4882a593Smuzhiyun * reading non-existing APB register and we shouldn't ignore that.
32*4882a593Smuzhiyun */
33*4882a593Smuzhiyun if (fsr == (FSR_EXTERNAL | FSR_READ | FSR_IMPRECISE))
34*4882a593Smuzhiyun return 0;
35*4882a593Smuzhiyun
36*4882a593Smuzhiyun return 1;
37*4882a593Smuzhiyun }
38*4882a593Smuzhiyun
bcm5301x_init_early(void)39*4882a593Smuzhiyun static void __init bcm5301x_init_early(void)
40*4882a593Smuzhiyun {
41*4882a593Smuzhiyun hook_fault_code(16 + 6, bcm5301x_abort_handler, SIGBUS, BUS_OBJERR,
42*4882a593Smuzhiyun "imprecise external abort");
43*4882a593Smuzhiyun }
44*4882a593Smuzhiyun
45*4882a593Smuzhiyun DT_MACHINE_START(BCM5301X, "BCM5301X")
46*4882a593Smuzhiyun .l2c_aux_val = 0,
47*4882a593Smuzhiyun .l2c_aux_mask = ~0,
48*4882a593Smuzhiyun .dt_compat = bcm5301x_dt_compat,
49*4882a593Smuzhiyun .init_early = bcm5301x_init_early,
50*4882a593Smuzhiyun MACHINE_END
51