sunxi.c 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*
  2. * Device Tree support for Allwinner A1X SoCs
  3. *
  4. * Copyright (C) 2012 Maxime Ripard
  5. *
  6. * Maxime Ripard <maxime.ripard@free-electrons.com>
  7. *
  8. * This file is licensed under the terms of the GNU General Public
  9. * License version 2. This program is licensed "as is" without any
  10. * warranty of any kind, whether express or implied.
  11. */
  12. #include <linux/kernel.h>
  13. #include <linux/init.h>
  14. #include <linux/of_irq.h>
  15. #include <linux/of_platform.h>
  16. #include <linux/io.h>
  17. #include <linux/sunxi_timer.h>
  18. #include <linux/irqchip/sunxi.h>
  19. #include <asm/hardware/vic.h>
  20. #include <asm/mach/arch.h>
  21. #include <asm/mach/map.h>
  22. #include "sunxi.h"
  23. static struct map_desc sunxi_io_desc[] __initdata = {
  24. {
  25. .virtual = (unsigned long) SUNXI_REGS_VIRT_BASE,
  26. .pfn = __phys_to_pfn(SUNXI_REGS_PHYS_BASE),
  27. .length = SUNXI_REGS_SIZE,
  28. .type = MT_DEVICE,
  29. },
  30. };
  31. void __init sunxi_map_io(void)
  32. {
  33. iotable_init(sunxi_io_desc, ARRAY_SIZE(sunxi_io_desc));
  34. }
  35. static void __init sunxi_dt_init(void)
  36. {
  37. of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
  38. }
  39. static const char * const sunxi_board_dt_compat[] = {
  40. "allwinner,sun5i",
  41. NULL,
  42. };
  43. DT_MACHINE_START(SUNXI_DT, "Allwinner A1X (Device Tree)")
  44. .init_machine = sunxi_dt_init,
  45. .map_io = sunxi_map_io,
  46. .init_irq = sunxi_init_irq,
  47. .handle_irq = sunxi_handle_irq,
  48. .timer = &sunxi_timer,
  49. .dt_compat = sunxi_board_dt_compat,
  50. MACHINE_END