socfpga.c 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*
  2. * Copyright (C) 2012 Altera Corporation
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation; either version 2 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  16. */
  17. #include <linux/dw_apb_timer.h>
  18. #include <linux/of_irq.h>
  19. #include <linux/of_platform.h>
  20. #include <asm/hardware/cache-l2x0.h>
  21. #include <asm/hardware/gic.h>
  22. #include <asm/mach/arch.h>
  23. extern void socfpga_init_clocks(void);
  24. const static struct of_device_id irq_match[] = {
  25. { .compatible = "arm,cortex-a9-gic", .data = gic_of_init, },
  26. {}
  27. };
  28. static void __init gic_init_irq(void)
  29. {
  30. of_irq_init(irq_match);
  31. }
  32. static void socfpga_cyclone5_restart(char mode, const char *cmd)
  33. {
  34. /* TODO: */
  35. }
  36. static void __init socfpga_cyclone5_init(void)
  37. {
  38. l2x0_of_init(0, ~0UL);
  39. of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
  40. socfpga_init_clocks();
  41. }
  42. static const char *altera_dt_match[] = {
  43. "altr,socfpga",
  44. "altr,socfpga-cyclone5",
  45. NULL
  46. };
  47. DT_MACHINE_START(SOCFPGA, "Altera SOCFPGA")
  48. .init_irq = gic_init_irq,
  49. .handle_irq = gic_handle_irq,
  50. .timer = &dw_apb_timer,
  51. .init_machine = socfpga_cyclone5_init,
  52. .restart = socfpga_cyclone5_restart,
  53. .dt_compat = altera_dt_match,
  54. MACHINE_END