bcm_5301x.c 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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. static bool first_fault = true;
  14. static int bcm5301x_abort_handler(unsigned long addr, unsigned int fsr,
  15. struct pt_regs *regs)
  16. {
  17. if ((fsr == 0x1406 || fsr == 0x1c06) && first_fault) {
  18. first_fault = false;
  19. /*
  20. * These faults with codes 0x1406 (BCM4709) or 0x1c06 happens
  21. * for no good reason, possibly left over from the CFE boot
  22. * loader.
  23. */
  24. pr_warn("External imprecise Data abort at addr=%#lx, fsr=%#x ignored.\n",
  25. addr, fsr);
  26. /* Returning non-zero causes fault display and panic */
  27. return 0;
  28. }
  29. /* Others should cause a fault */
  30. return 1;
  31. }
  32. static void __init bcm5301x_init_early(void)
  33. {
  34. /* Install our hook */
  35. hook_fault_code(16 + 6, bcm5301x_abort_handler, SIGBUS, BUS_OBJERR,
  36. "imprecise external abort");
  37. }
  38. static const char __initconst *bcm5301x_dt_compat[] = {
  39. "brcm,bcm4708",
  40. NULL,
  41. };
  42. DT_MACHINE_START(BCM5301X, "BCM5301X")
  43. .l2c_aux_val = 0,
  44. .l2c_aux_mask = ~0,
  45. .init_early = bcm5301x_init_early,
  46. .dt_compat = bcm5301x_dt_compat,
  47. MACHINE_END