jornada720.c 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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. /* virtual physical length type */
  68. { 0xf0000000, 0x48000000, 0x00100000, MT_DEVICE }, /* Epson registers */
  69. { 0xf1000000, 0x48200000, 0x00100000, MT_DEVICE }, /* Epson frame buffer */
  70. { 0xf4000000, 0x40000000, 0x00100000, MT_DEVICE } /* SA-1111 */
  71. };
  72. static void __init jornada720_map_io(void)
  73. {
  74. sa1100_map_io();
  75. iotable_init(jornada720_io_desc, ARRAY_SIZE(jornada720_io_desc));
  76. sa1100_register_uart(0, 3);
  77. sa1100_register_uart(1, 1);
  78. }
  79. MACHINE_START(JORNADA720, "HP Jornada 720")
  80. /* Maintainer: Michael Gernoth <michael@gernoth.net> */
  81. .phys_ram = 0xc0000000,
  82. .phys_io = 0x80000000,
  83. .io_pg_offst = ((0xf8000000) >> 18) & 0xfffc,
  84. .boot_params = 0xc0000100,
  85. .map_io = jornada720_map_io,
  86. .init_irq = sa1100_init_irq,
  87. .timer = &sa1100_timer,
  88. MACHINE_END