poodle.c 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. /*
  2. * linux/arch/arm/mach-pxa/poodle.c
  3. *
  4. * Support for the SHARP Poodle Board.
  5. *
  6. * Based on:
  7. * linux/arch/arm/mach-pxa/lubbock.c Author: Nicolas Pitre
  8. *
  9. * This program is free software; you can redistribute it and/or modify
  10. * it under the terms of the GNU General Public License version 2 as
  11. * published by the Free Software Foundation.
  12. *
  13. * Change Log
  14. * 12-Dec-2002 Sharp Corporation for Poodle
  15. * John Lenz <lenz@cs.wisc.edu> updates to 2.6
  16. */
  17. #include <linux/kernel.h>
  18. #include <linux/init.h>
  19. #include <linux/device.h>
  20. #include <linux/fb.h>
  21. #include <asm/hardware.h>
  22. #include <asm/mach-types.h>
  23. #include <asm/irq.h>
  24. #include <asm/setup.h>
  25. #include <asm/mach/arch.h>
  26. #include <asm/mach/map.h>
  27. #include <asm/mach/irq.h>
  28. #include <asm/arch/pxa-regs.h>
  29. #include <asm/arch/irq.h>
  30. #include <asm/arch/poodle.h>
  31. #include <asm/arch/pxafb.h>
  32. #include <asm/hardware/scoop.h>
  33. #include <asm/hardware/locomo.h>
  34. #include <asm/mach/sharpsl_param.h>
  35. #include "generic.h"
  36. static struct resource poodle_scoop_resources[] = {
  37. [0] = {
  38. .start = 0x10800000,
  39. .end = 0x10800fff,
  40. .flags = IORESOURCE_MEM,
  41. },
  42. };
  43. static struct scoop_config poodle_scoop_setup = {
  44. .io_dir = POODLE_SCOOP_IO_DIR,
  45. .io_out = POODLE_SCOOP_IO_OUT,
  46. };
  47. struct platform_device poodle_scoop_device = {
  48. .name = "sharp-scoop",
  49. .id = -1,
  50. .dev = {
  51. .platform_data = &poodle_scoop_setup,
  52. },
  53. .num_resources = ARRAY_SIZE(poodle_scoop_resources),
  54. .resource = poodle_scoop_resources,
  55. };
  56. static struct scoop_pcmcia_dev poodle_pcmcia_scoop[] = {
  57. {
  58. .dev = &poodle_scoop_device.dev,
  59. .irq = POODLE_IRQ_GPIO_CF_IRQ,
  60. .cd_irq = POODLE_IRQ_GPIO_CF_CD,
  61. .cd_irq_str = "PCMCIA0 CD",
  62. },
  63. };
  64. /* LoCoMo device */
  65. static struct resource locomo_resources[] = {
  66. [0] = {
  67. .start = 0x10000000,
  68. .end = 0x10001fff,
  69. .flags = IORESOURCE_MEM,
  70. },
  71. [1] = {
  72. .start = IRQ_GPIO(10),
  73. .end = IRQ_GPIO(10),
  74. .flags = IORESOURCE_IRQ,
  75. },
  76. };
  77. static struct platform_device locomo_device = {
  78. .name = "locomo",
  79. .id = 0,
  80. .num_resources = ARRAY_SIZE(locomo_resources),
  81. .resource = locomo_resources,
  82. };
  83. /* PXAFB device */
  84. static struct pxafb_mach_info poodle_fb_info __initdata = {
  85. .pixclock = 144700,
  86. .xres = 320,
  87. .yres = 240,
  88. .bpp = 16,
  89. .hsync_len = 7,
  90. .left_margin = 11,
  91. .right_margin = 30,
  92. .vsync_len = 2,
  93. .upper_margin = 2,
  94. .lower_margin = 0,
  95. .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
  96. .lccr0 = LCCR0_Act | LCCR0_Sngl | LCCR0_Color,
  97. .lccr3 = 0,
  98. .pxafb_backlight_power = NULL,
  99. .pxafb_lcd_power = NULL,
  100. };
  101. static struct platform_device *devices[] __initdata = {
  102. &locomo_device,
  103. &poodle_scoop_device,
  104. };
  105. static void __init poodle_init(void)
  106. {
  107. int ret = 0;
  108. /* cpu initialize */
  109. /* Pgsr Register */
  110. PGSR0 = 0x0146dd80;
  111. PGSR1 = 0x03bf0890;
  112. PGSR2 = 0x0001c000;
  113. /* Alternate Register */
  114. GAFR0_L = 0x01001000;
  115. GAFR0_U = 0x591a8010;
  116. GAFR1_L = 0x900a8451;
  117. GAFR1_U = 0xaaa5aaaa;
  118. GAFR2_L = 0x8aaaaaaa;
  119. GAFR2_U = 0x00000002;
  120. /* Direction Register */
  121. GPDR0 = 0xd3f0904c;
  122. GPDR1 = 0xfcffb7d3;
  123. GPDR2 = 0x0001ffff;
  124. /* Output Register */
  125. GPCR0 = 0x00000000;
  126. GPCR1 = 0x00000000;
  127. GPCR2 = 0x00000000;
  128. GPSR0 = 0x00400000;
  129. GPSR1 = 0x00000000;
  130. GPSR2 = 0x00000000;
  131. set_pxa_fb_info(&poodle_fb_info);
  132. scoop_num = 1;
  133. scoop_devs = &poodle_pcmcia_scoop[0];
  134. ret = platform_add_devices(devices, ARRAY_SIZE(devices));
  135. if (ret) {
  136. printk(KERN_WARNING "poodle: Unable to register LoCoMo device\n");
  137. }
  138. }
  139. static void __init fixup_poodle(struct machine_desc *desc,
  140. struct tag *tags, char **cmdline, struct meminfo *mi)
  141. {
  142. sharpsl_save_param();
  143. }
  144. static struct map_desc poodle_io_desc[] __initdata = {
  145. /* virtual physical length */
  146. { 0xef800000, 0x00000000, 0x00800000, MT_DEVICE }, /* Boot Flash */
  147. };
  148. static void __init poodle_map_io(void)
  149. {
  150. pxa_map_io();
  151. iotable_init(poodle_io_desc, ARRAY_SIZE(poodle_io_desc));
  152. /* setup sleep mode values */
  153. PWER = 0x00000002;
  154. PFER = 0x00000000;
  155. PRER = 0x00000002;
  156. PGSR0 = 0x00008000;
  157. PGSR1 = 0x003F0202;
  158. PGSR2 = 0x0001C000;
  159. PCFR |= PCFR_OPDE;
  160. }
  161. MACHINE_START(POODLE, "SHARP Poodle")
  162. .phys_ram = 0xa0000000,
  163. .phys_io = 0x40000000,
  164. .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
  165. .fixup = fixup_poodle,
  166. .map_io = poodle_map_io,
  167. .init_irq = pxa_init_irq,
  168. .timer = &pxa_timer,
  169. .init_machine = poodle_init,
  170. MACHINE_END