blob: fe067f6cebb6de876602615b380ec8e414e001cf [file] [log] [blame]
Hauke Mehrtens5b293eb2014-02-04 00:01:43 +01001/*
2 * Broadcom BCM470X / BCM5301X ARM platform code.
3 *
4 * Copyright 2013 Hauke Mehrtens <hauke@hauke-m.de>
5 *
6 * Licensed under the GNU/GPL. See COPYING for details.
7 */
8#include <linux/of_platform.h>
9#include <asm/hardware/cache-l2x0.h>
10
11#include <asm/mach/arch.h>
Rafał Miłecki5ed56ca2016-10-29 13:12:29 +020012#include <asm/siginfo.h>
13#include <asm/signal.h>
14
15#define FSR_EXTERNAL (1 << 12)
16#define FSR_READ (0 << 10)
17#define FSR_IMPRECISE 0x0406
Hauke Mehrtensfdf48502014-02-04 00:01:46 +010018
Nicolas Pitre19c233b2015-07-27 18:27:52 -040019static const char *const bcm5301x_dt_compat[] __initconst = {
Hauke Mehrtens5b293eb2014-02-04 00:01:43 +010020 "brcm,bcm4708",
21 NULL,
22};
23
Rafał Miłecki5ed56ca2016-10-29 13:12:29 +020024static int bcm5301x_abort_handler(unsigned long addr, unsigned int fsr,
25 struct pt_regs *regs)
26{
27 /*
28 * We want to ignore aborts forwarded from the PCIe bus that are
29 * expected and shouldn't really be passed by the PCIe controller.
30 * The biggest disadvantage is the same FSR code may be reported when
31 * reading non-existing APB register and we shouldn't ignore that.
32 */
33 if (fsr == (FSR_EXTERNAL | FSR_READ | FSR_IMPRECISE))
34 return 0;
35
36 return 1;
37}
38
39static void __init bcm5301x_init_early(void)
40{
41 hook_fault_code(16 + 6, bcm5301x_abort_handler, SIGBUS, BUS_OBJERR,
42 "imprecise external abort");
43}
44
Hauke Mehrtens5b293eb2014-02-04 00:01:43 +010045DT_MACHINE_START(BCM5301X, "BCM5301X")
Russell Kingd458773f2014-04-28 15:27:59 +010046 .l2c_aux_val = 0,
47 .l2c_aux_mask = ~0,
Hauke Mehrtens5b293eb2014-02-04 00:01:43 +010048 .dt_compat = bcm5301x_dt_compat,
Rafał Miłecki5ed56ca2016-10-29 13:12:29 +020049 .init_early = bcm5301x_init_early,
Hauke Mehrtens5b293eb2014-02-04 00:01:43 +010050MACHINE_END