memoryCall.c 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. /*
  2. * Versatile Express V2M Motherboard Support
  3. */
  4. #include <linux/device.h>
  5. #include <linux/amba/bus.h>
  6. #include <linux/amba/mmci.h>
  7. #include <linux/io.h>
  8. #include <linux/smp.h>
  9. #include <linux/init.h>
  10. #include <linux/of_address.h>
  11. #include <linux/of_fdt.h>
  12. #include <linux/of_irq.h>
  13. #include <linux/of_platform.h>
  14. #include <linux/platform_device.h>
  15. #include <linux/ata_platform.h>
  16. #include <linux/smsc911x.h>
  17. #include <linux/spinlock.h>
  18. #include <linux/usb/isp1760.h>
  19. #include <linux/mtd/physmap.h>
  20. #include <linux/regulator/fixed.h>
  21. #include <linux/regulator/machine.h>
  22. #include <linux/vexpress.h>
  23. #include <asm/arch_timer.h>
  24. #include <asm/mach-types.h>
  25. #include <asm/sizes.h>
  26. #include <asm/smp_twd.h>
  27. #include <asm/mach/arch.h>
  28. #include <asm/mach/map.h>
  29. #include <asm/mach/time.h>
  30. #include <asm/hardware/arm_timer.h>
  31. #include <asm/hardware/cache-l2x0.h>
  32. #include <asm/hardware/gic.h>
  33. #include <asm/hardware/timer-sp.h>
  34. #include <mach/ct-ca9x4.h>
  35. #include <mach/motherboard.h>
  36. #include <plat/sched_clock.h>
  37. #include <plat/platsmp.h>
  38. #include "core.h"
  39. #define V2M_PA_CS0 0x40000000
  40. #define V2M_PA_CS1 0x44000000
  41. #define V2M_PA_CS2 0x48000000
  42. #define V2M_PA_CS3 0x4c000000
  43. #define V2M_PA_CS7 0x10000000
  44. static struct map_desc v2m_io_desc[] __initdata = {
  45. {
  46. .virtual = V2M_PERIPH,
  47. .pfn = __phys_to_pfn(V2M_PA_CS7),
  48. .length = SZ_128K,
  49. .type = MT_DEVICE,
  50. },
  51. };
  52. static void __init v2m_sp804_init(void __iomem *base, unsigned int irq)
  53. {
  54. if (WARN_ON(!base || irq == NO_IRQ))
  55. return;
  56. writel(0, base + TIMER_1_BASE + TIMER_CTRL);
  57. writel(0, base + TIMER_2_BASE + TIMER_CTRL);
  58. sp804_clocksource_init(base + TIMER_2_BASE, "v2m-timer1");
  59. sp804_clockevents_init(base + TIMER_1_BASE, irq, "v2m-timer0");
  60. }
  61. static struct resource v2m_pcie_i2c_resource = {
  62. .start = V2M_SERIAL_BUS_PCI,
  63. .end = V2M_SERIAL_BUS_PCI + SZ_4K - 1,
  64. .flags = IORESOURCE_MEM,
  65. };
  66. static struct platform_device v2m_pcie_i2c_device = {
  67. .name = "versatile-i2c",
  68. .id = 0,
  69. .num_resources = 1,
  70. .resource = &v2m_pcie_i2c_resource,
  71. };
  72. static struct resource v2m_ddc_i2c_resource = {
  73. .start = V2M_SERIAL_BUS_DVI,
  74. .end = V2M_SERIAL_BUS_DVI + SZ_4K - 1,
  75. .flags = IORESOURCE_MEM,
  76. };
  77. static struct platform_device v2m_ddc_i2c_device = {
  78. .name = "versatile-i2c",