br200-wp.c 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. // SPDX-License-Identifier: GPL-2.0-or-later
  2. /*
  3. * Aerohive BR200-WP Board Setup
  4. * Copyright (C) 2023 Pawel Dembicki <[email protected]>
  5. *
  6. * Based on:
  7. * hiveap-330.c:
  8. * Aerohive HiveAP-330 Board Setup
  9. * Copyright (C) 2017 Chris Blake <[email protected]>
  10. */
  11. #include <linux/stddef.h>
  12. #include <linux/kernel.h>
  13. #include <linux/delay.h>
  14. #include <linux/interrupt.h>
  15. #include <linux/of_platform.h>
  16. #include <asm/time.h>
  17. #include <asm/machdep.h>
  18. #include <asm/pci-bridge.h>
  19. #include <mm/mmu_decl.h>
  20. #include <asm/prom.h>
  21. #include <asm/udbg.h>
  22. #include <asm/mpic.h>
  23. #include <sysdev/fsl_soc.h>
  24. #include <sysdev/fsl_pci.h>
  25. #include "smp.h"
  26. #include "mpc85xx.h"
  27. void __init br200_wp_pic_init(void)
  28. {
  29. struct mpic *mpic;
  30. mpic = mpic_alloc(NULL, 0,
  31. MPIC_BIG_ENDIAN |
  32. MPIC_SINGLE_DEST_CPU,
  33. 0, 256, " OpenPIC ");
  34. BUG_ON(mpic == NULL);
  35. mpic_init(mpic);
  36. }
  37. /*
  38. * Setup the architecture
  39. */
  40. static void __init br200_wp_setup_arch(void)
  41. {
  42. if (ppc_md.progress)
  43. ppc_md.progress("br200_wp_setup_arch()", 0);
  44. fsl_pci_assign_primary();
  45. pr_info("br200-wp board from Aerohive\n");
  46. }
  47. machine_arch_initcall(br200_wp, mpc85xx_common_publish_devices);
  48. /*
  49. * Called very early, device-tree isn't unflattened
  50. */
  51. static int __init br200_wp_probe(void)
  52. {
  53. if (of_machine_is_compatible("aerohive,br200-wp"))
  54. return 1;
  55. return 0;
  56. }
  57. define_machine(br200_wp) {
  58. .name = "P1020 RDB",
  59. .probe = br200_wp_probe,
  60. .setup_arch = br200_wp_setup_arch,
  61. .init_IRQ = br200_wp_pic_init,
  62. #ifdef CONFIG_PCI
  63. .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
  64. .pcibios_fixup_phb = fsl_pcibios_fixup_phb,
  65. #endif
  66. .get_irq = mpic_get_irq,
  67. .calibrate_decr = generic_calibrate_decr,
  68. .progress = udbg_progress,
  69. };