bcm_5301x.c 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  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. #include <asm/mach/arch.h>
  11. #include <asm/siginfo.h>
  12. #include <asm/signal.h>
  13. #define FSR_EXTERNAL (1 << 12)
  14. #define FSR_READ (0 << 10)
  15. #define FSR_IMPRECISE 0x0406
  16. static const char *const bcm5301x_dt_compat[] __initconst = {
  17. "brcm,bcm4708",
  18. NULL,
  19. };
  20. static int bcm5301x_abort_handler(unsigned long addr, unsigned int fsr,
  21. struct pt_regs *regs)
  22. {
  23. /*
  24. * We want to ignore aborts forwarded from the PCIe bus that are
  25. * expected and shouldn't really be passed by the PCIe controller.
  26. * The biggest disadvantage is the same FSR code may be reported when
  27. * reading non-existing APB register and we shouldn't ignore that.
  28. */
  29. if (fsr == (FSR_EXTERNAL | FSR_READ | FSR_IMPRECISE))
  30. return 0;
  31. return 1;
  32. }
  33. static void __init bcm5301x_init_early(void)
  34. {
  35. hook_fault_code(16 + 6, bcm5301x_abort_handler, SIGBUS, BUS_OBJERR,
  36. "imprecise external abort");
  37. }
  38. DT_MACHINE_START(BCM5301X, "BCM5301X")
  39. .l2c_aux_val = 0,
  40. .l2c_aux_mask = ~0,
  41. .dt_compat = bcm5301x_dt_compat,
  42. .init_early = bcm5301x_init_early,
  43. MACHINE_END