common.c 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*
  2. * Copyright (c) 2011 Picochip Ltd., Jamie Iles
  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 version 2 as
  6. * published by the Free Software Foundation.
  7. *
  8. * All enquiries to support@picochip.com
  9. */
  10. #include <linux/irq.h>
  11. #include <linux/irqdomain.h>
  12. #include <linux/of.h>
  13. #include <linux/of_address.h>
  14. #include <linux/of_platform.h>
  15. #include <asm/mach/arch.h>
  16. #include <asm/hardware/vic.h>
  17. #include <mach/map.h>
  18. #include <mach/picoxcell_soc.h>
  19. #include "common.h"
  20. static void __init picoxcell_init_machine(void)
  21. {
  22. of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
  23. }
  24. static const char *picoxcell_dt_match[] = {
  25. "picochip,pc3x2",
  26. "picochip,pc3x3",
  27. NULL
  28. };
  29. static const struct of_device_id vic_of_match[] __initconst = {
  30. { .compatible = "arm,pl192-vic" },
  31. { /* Sentinel */ }
  32. };
  33. static void __init picoxcell_init_irq(void)
  34. {
  35. vic_init(IO_ADDRESS(PICOXCELL_VIC0_BASE), 0, ~0, 0);
  36. vic_init(IO_ADDRESS(PICOXCELL_VIC1_BASE), 32, ~0, 0);
  37. irq_domain_generate_simple(vic_of_match, PICOXCELL_VIC0_BASE, 0);
  38. irq_domain_generate_simple(vic_of_match, PICOXCELL_VIC1_BASE, 32);
  39. }
  40. DT_MACHINE_START(PICOXCELL, "Picochip picoXcell")
  41. .map_io = picoxcell_map_io,
  42. .nr_irqs = ARCH_NR_IRQS,
  43. .init_irq = picoxcell_init_irq,
  44. .timer = &picoxcell_timer,
  45. .init_machine = picoxcell_init_machine,
  46. .dt_compat = picoxcell_dt_match,
  47. MACHINE_END