poodle.c 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  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. /* LoCoMo device */
  57. static struct resource locomo_resources[] = {
  58. [0] = {
  59. .start = 0x10000000,
  60. .end = 0x10001fff,
  61. .flags = IORESOURCE_MEM,
  62. },
  63. [1] = {
  64. .start = IRQ_GPIO(10),
  65. .end = IRQ_GPIO(10),
  66. .flags = IORESOURCE_IRQ,
  67. },
  68. };
  69. static struct platform_device locomo_device = {
  70. .name = "locomo",
  71. .id = 0,
  72. .num_resources = ARRAY_SIZE(locomo_resources),
  73. .resource = locomo_resources,
  74. };
  75. /* PXAFB device */
  76. static struct pxafb_mach_info poodle_fb_info __initdata = {
  77. .pixclock = 144700,
  78. .xres = 320,
  79. .yres = 240,
  80. .bpp = 16,
  81. .hsync_len = 7,
  82. .left_margin = 11,
  83. .right_margin = 30,
  84. .vsync_len = 2,
  85. .upper_margin = 2,
  86. .lower_margin = 0,
  87. .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
  88. .lccr0 = LCCR0_Act | LCCR0_Sngl | LCCR0_Color,
  89. .lccr3 = 0,
  90. .pxafb_backlight_power = NULL,
  91. .pxafb_lcd_power = NULL,
  92. };
  93. static struct platform_device *devices[] __initdata = {
  94. &locomo_device,
  95. &poodle_scoop_device,
  96. };
  97. static void __init poodle_init(void)
  98. {
  99. int ret = 0;
  100. /* cpu initialize */
  101. /* Pgsr Register */
  102. PGSR0 = 0x0146dd80;
  103. PGSR1 = 0x03bf0890;
  104. PGSR2 = 0x0001c000;
  105. /* Alternate Register */
  106. GAFR0_L = 0x01001000;
  107. GAFR0_U = 0x591a8010;
  108. GAFR1_L = 0x900a8451;
  109. GAFR1_U = 0xaaa5aaaa;
  110. GAFR2_L = 0x8aaaaaaa;
  111. GAFR2_U = 0x00000002;
  112. /* Direction Register */
  113. GPDR0 = 0xd3f0904c;
  114. GPDR1 = 0xfcffb7d3;
  115. GPDR2 = 0x0001ffff;
  116. /* Output Register */
  117. GPCR0 = 0x00000000;
  118. GPCR1 = 0x00000000;
  119. GPCR2 = 0x00000000;
  120. GPSR0 = 0x00400000;
  121. GPSR1 = 0x00000000;
  122. GPSR2 = 0x00000000;
  123. set_pxa_fb_info(&poodle_fb_info);
  124. ret = platform_add_devices(devices, ARRAY_SIZE(devices));
  125. if (ret) {
  126. printk(KERN_WARNING "poodle: Unable to register LoCoMo device\n");
  127. }
  128. }
  129. static void __init fixup_poodle(struct machine_desc *desc,
  130. struct tag *tags, char **cmdline, struct meminfo *mi)
  131. {
  132. sharpsl_save_param();
  133. }
  134. static struct map_desc poodle_io_desc[] __initdata = {
  135. /* virtual physical length */
  136. { 0xef800000, 0x00000000, 0x00800000, MT_DEVICE }, /* Boot Flash */
  137. };
  138. static void __init poodle_map_io(void)
  139. {
  140. pxa_map_io();
  141. iotable_init(poodle_io_desc, ARRAY_SIZE(poodle_io_desc));
  142. /* setup sleep mode values */
  143. PWER = 0x00000002;
  144. PFER = 0x00000000;
  145. PRER = 0x00000002;
  146. PGSR0 = 0x00008000;
  147. PGSR1 = 0x003F0202;
  148. PGSR2 = 0x0001C000;
  149. PCFR |= PCFR_OPDE;
  150. }
  151. MACHINE_START(POODLE, "SHARP Poodle")
  152. .phys_ram = 0xa0000000,
  153. .phys_io = 0x40000000,
  154. .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
  155. .fixup = fixup_poodle,
  156. .map_io = poodle_map_io,
  157. .init_irq = pxa_init_irq,
  158. .timer = &pxa_timer,
  159. .init_machine = poodle_init,
  160. MACHINE_END