bcm2835.c 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /*
  2. * Copyright (C) 2010 Broadcom
  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. #include <linux/init.h>
  15. #include <linux/irqchip/bcm2835.h>
  16. #include <linux/of_platform.h>
  17. #include <asm/mach/arch.h>
  18. #include <asm/mach/map.h>
  19. #include <asm/mach/time.h>
  20. #include <mach/bcm2835_soc.h>
  21. static struct map_desc io_map __initdata = {
  22. .virtual = BCM2835_PERIPH_VIRT,
  23. .pfn = __phys_to_pfn(BCM2835_PERIPH_PHYS),
  24. .length = BCM2835_PERIPH_SIZE,
  25. .type = MT_DEVICE
  26. };
  27. void __init bcm2835_map_io(void)
  28. {
  29. iotable_init(&io_map, 1);
  30. }
  31. void __init bcm2835_init(void)
  32. {
  33. int ret;
  34. ret = of_platform_populate(NULL, of_default_bus_match_table, NULL,
  35. NULL);
  36. if (ret) {
  37. pr_err("of_platform_populate failed: %d\n", ret);
  38. BUG();
  39. }
  40. }
  41. static void __init bcm2835_timer_init(void)
  42. {
  43. }
  44. struct sys_timer bcm2835_timer = {
  45. .init = bcm2835_timer_init
  46. };
  47. static const char * const bcm2835_compat[] = {
  48. "brcm,bcm2835",
  49. NULL
  50. };
  51. DT_MACHINE_START(BCM2835, "BCM2835")
  52. .map_io = bcm2835_map_io,
  53. .init_irq = bcm2835_init_irq,
  54. .handle_irq = bcm2835_handle_irq,
  55. .init_machine = bcm2835_init,
  56. .timer = &bcm2835_timer,
  57. .dt_compat = bcm2835_compat
  58. MACHINE_END