versatile_pb.c 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. /*
  2. * linux/arch/arm/mach-versatile/versatile_pb.c
  3. *
  4. * Copyright (C) 2004 ARM Limited
  5. * Copyright (C) 2000 Deep Blue Solutions Ltd
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 2 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  20. */
  21. #include <linux/init.h>
  22. #include <linux/device.h>
  23. #include <linux/sysdev.h>
  24. #include <linux/amba/bus.h>
  25. #include <linux/amba/pl061.h>
  26. #include <linux/amba/mmci.h>
  27. #include <linux/io.h>
  28. #include <mach/hardware.h>
  29. #include <asm/irq.h>
  30. #include <asm/mach-types.h>
  31. #include <asm/mach/arch.h>
  32. #include "core.h"
  33. #if 1
  34. #define IRQ_MMCI1A IRQ_VICSOURCE23
  35. #else
  36. #define IRQ_MMCI1A IRQ_SIC_MMCI1A
  37. #endif
  38. static struct mmci_platform_data mmc1_plat_data = {
  39. .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34,
  40. .status = mmc_status,
  41. .gpio_wp = -1,
  42. .gpio_cd = -1,
  43. };
  44. static struct pl061_platform_data gpio2_plat_data = {
  45. .gpio_base = 16,
  46. .irq_base = IRQ_GPIO2_START,
  47. };
  48. static struct pl061_platform_data gpio3_plat_data = {
  49. .gpio_base = 24,
  50. .irq_base = IRQ_GPIO3_START,
  51. };
  52. #define UART3_IRQ { IRQ_SIC_UART3, NO_IRQ }
  53. #define SCI1_IRQ { IRQ_SIC_SCI3, NO_IRQ }
  54. #define MMCI1_IRQ { IRQ_MMCI1A, IRQ_SIC_MMCI1B }
  55. /*
  56. * These devices are connected via the core APB bridge
  57. */
  58. #define GPIO2_IRQ { IRQ_GPIOINT2, NO_IRQ }
  59. #define GPIO3_IRQ { IRQ_GPIOINT3, NO_IRQ }
  60. /*
  61. * These devices are connected via the DMA APB bridge
  62. */
  63. /* FPGA Primecells */
  64. AMBA_DEVICE(uart3, "fpga:09", UART3, NULL);
  65. AMBA_DEVICE(sci1, "fpga:0a", SCI1, NULL);
  66. AMBA_DEVICE(mmc1, "fpga:0b", MMCI1, &mmc1_plat_data);
  67. /* DevChip Primecells */
  68. AMBA_DEVICE(gpio2, "dev:e6", GPIO2, &gpio2_plat_data);
  69. AMBA_DEVICE(gpio3, "dev:e7", GPIO3, &gpio3_plat_data);
  70. static struct amba_device *amba_devs[] __initdata = {
  71. &uart3_device,
  72. &gpio2_device,
  73. &gpio3_device,
  74. &sci1_device,
  75. &mmc1_device,
  76. };
  77. static void __init versatile_pb_init(void)
  78. {
  79. int i;
  80. versatile_init();
  81. for (i = 0; i < ARRAY_SIZE(amba_devs); i++) {
  82. struct amba_device *d = amba_devs[i];
  83. amba_device_register(d, &iomem_resource);
  84. }
  85. }
  86. MACHINE_START(VERSATILE_PB, "ARM-Versatile PB")
  87. /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */
  88. .boot_params = 0x00000100,
  89. .map_io = versatile_map_io,
  90. .init_early = versatile_init_early,
  91. .init_irq = versatile_init_irq,
  92. .timer = &versatile_timer,
  93. .init_machine = versatile_pb_init,
  94. MACHINE_END