hiveap-330.c 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. /*
  2. * Aerohive HiveAP-330 Board Setup
  3. *
  4. * Copyright (C) 2017 Chris Blake <[email protected]>
  5. *
  6. * Based on:
  7. * mpc85xx_rdb.c:
  8. * MPC85xx RDB Board Setup
  9. * Copyright 2013 Freescale Semiconductor Inc.
  10. *
  11. * This program is free software; you can redistribute it and/or modify it
  12. * under the terms of the GNU General Public License as published by the
  13. * Free Software Foundation; either version 2 of the License, or (at your
  14. * option) any later version.
  15. */
  16. #include <linux/stddef.h>
  17. #include <linux/kernel.h>
  18. #include <linux/delay.h>
  19. #include <linux/interrupt.h>
  20. #include <linux/of_platform.h>
  21. #include <asm/time.h>
  22. #include <asm/machdep.h>
  23. #include <asm/pci-bridge.h>
  24. #include <mm/mmu_decl.h>
  25. #include <asm/prom.h>
  26. #include <asm/udbg.h>
  27. #include <asm/mpic.h>
  28. #include <sysdev/fsl_soc.h>
  29. #include <sysdev/fsl_pci.h>
  30. #include "smp.h"
  31. #include "mpc85xx.h"
  32. void __init hiveap_330_pic_init(void)
  33. {
  34. struct mpic *mpic;
  35. mpic = mpic_alloc(NULL, 0,
  36. MPIC_BIG_ENDIAN |
  37. MPIC_SINGLE_DEST_CPU,
  38. 0, 256, " OpenPIC ");
  39. BUG_ON(mpic == NULL);
  40. mpic_init(mpic);
  41. }
  42. /*
  43. * Setup the architecture
  44. */
  45. static void __init hiveap_330_setup_arch(void)
  46. {
  47. if (ppc_md.progress)
  48. ppc_md.progress("hiveap_330_setup_arch()", 0);
  49. mpc85xx_smp_init();
  50. fsl_pci_assign_primary();
  51. printk(KERN_INFO "HiveAP-330 board from Aerohive\n");
  52. }
  53. machine_arch_initcall(hiveap_330, mpc85xx_common_publish_devices);
  54. /*
  55. * Called very early, device-tree isn't unflattened
  56. */
  57. static int __init hiveap_330_probe(void)
  58. {
  59. if (of_machine_is_compatible("aerohive,hiveap-330"))
  60. return 1;
  61. return 0;
  62. }
  63. define_machine(hiveap_330) {
  64. .name = "P1020 RDB",
  65. .probe = hiveap_330_probe,
  66. .setup_arch = hiveap_330_setup_arch,
  67. .init_IRQ = hiveap_330_pic_init,
  68. #ifdef CONFIG_PCI
  69. .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
  70. .pcibios_fixup_phb = fsl_pcibios_fixup_phb,
  71. #endif
  72. .get_irq = mpic_get_irq,
  73. .calibrate_decr = generic_calibrate_decr,
  74. .progress = udbg_progress,
  75. };