jornada720.c 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. /*
  2. * linux/arch/arm/mach-sa1100/jornada720.c
  3. */
  4. #include <linux/init.h>
  5. #include <linux/kernel.h>
  6. #include <linux/tty.h>
  7. #include <linux/delay.h>
  8. #include <linux/device.h>
  9. #include <linux/ioport.h>
  10. #include <asm/hardware.h>
  11. #include <asm/hardware/sa1111.h>
  12. #include <asm/irq.h>
  13. #include <asm/mach-types.h>
  14. #include <asm/setup.h>
  15. #include <asm/mach/arch.h>
  16. #include <asm/mach/map.h>
  17. #include <asm/mach/serial_sa1100.h>
  18. #include "generic.h"
  19. #define JORTUCR_VAL 0x20000400
  20. static struct resource sa1111_resources[] = {
  21. [0] = {
  22. .start = 0x40000000,
  23. .end = 0x40001fff,
  24. .flags = IORESOURCE_MEM,
  25. },
  26. [1] = {
  27. .start = IRQ_GPIO1,
  28. .end = IRQ_GPIO1,
  29. .flags = IORESOURCE_IRQ,
  30. },
  31. };
  32. static u64 sa1111_dmamask = 0xffffffffUL;
  33. static struct platform_device sa1111_device = {
  34. .name = "sa1111",
  35. .id = 0,
  36. .dev = {
  37. .dma_mask = &sa1111_dmamask,
  38. .coherent_dma_mask = 0xffffffff,
  39. },
  40. .num_resources = ARRAY_SIZE(sa1111_resources),
  41. .resource = sa1111_resources,
  42. };
  43. static struct platform_device *devices[] __initdata = {
  44. &sa1111_device,
  45. };
  46. static int __init jornada720_init(void)
  47. {
  48. int ret = -ENODEV;
  49. if (machine_is_jornada720()) {
  50. GPDR |= GPIO_GPIO20;
  51. TUCR = JORTUCR_VAL; /* set the oscillator out to the SA-1101 */
  52. GPSR = GPIO_GPIO20;
  53. udelay(1);
  54. GPCR = GPIO_GPIO20;
  55. udelay(1);
  56. GPSR = GPIO_GPIO20;
  57. udelay(20);
  58. /* LDD4 is speaker, LDD3 is microphone */
  59. PPSR &= ~(PPC_LDD3 | PPC_LDD4);
  60. PPDR |= PPC_LDD3 | PPC_LDD4;
  61. ret = platform_add_devices(devices, ARRAY_SIZE(devices));
  62. }
  63. return ret;
  64. }
  65. arch_initcall(jornada720_init);
  66. static struct map_desc jornada720_io_desc[] __initdata = {
  67. { /* Epson registers */
  68. .virtual = 0xf0000000,
  69. .pfn = __phys_to_pfn(0x48000000),
  70. .length = 0x00100000,
  71. .type = MT_DEVICE
  72. }, { /* Epson frame buffer */
  73. .virtual = 0xf1000000,
  74. .pfn = __phys_to_pfn(0x48200000),
  75. .length = 0x00100000,
  76. .type = MT_DEVICE
  77. }, { /* SA-1111 */
  78. .virtual = 0xf4000000,
  79. .pfn = __phys_to_pfn(0x40000000),
  80. .length = 0x00100000,
  81. .type = MT_DEVICE
  82. }
  83. };
  84. static void __init jornada720_map_io(void)
  85. {
  86. sa1100_map_io();
  87. iotable_init(jornada720_io_desc, ARRAY_SIZE(jornada720_io_desc));
  88. sa1100_register_uart(0, 3);
  89. sa1100_register_uart(1, 1);
  90. }
  91. MACHINE_START(JORNADA720, "HP Jornada 720")
  92. /* Maintainer: Michael Gernoth <michael@gernoth.net> */
  93. .phys_ram = 0xc0000000,
  94. .phys_io = 0x80000000,
  95. .io_pg_offst = ((0xf8000000) >> 18) & 0xfffc,
  96. .boot_params = 0xc0000100,
  97. .map_io = jornada720_map_io,
  98. .init_irq = sa1100_init_irq,
  99. .timer = &sa1100_timer,
  100. MACHINE_END