lart.c 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. /*
  2. * linux/arch/arm/mach-sa1100/lart.c
  3. */
  4. #include <linux/init.h>
  5. #include <linux/kernel.h>
  6. #include <linux/tty.h>
  7. #include <video/sa1100fb.h>
  8. #include <mach/hardware.h>
  9. #include <asm/setup.h>
  10. #include <asm/mach-types.h>
  11. #include <asm/page.h>
  12. #include <asm/mach/arch.h>
  13. #include <asm/mach/map.h>
  14. #include <asm/mach/serial_sa1100.h>
  15. #include <mach/mcp.h>
  16. #include <mach/irqs.h>
  17. #include "generic.h"
  18. #warning "include/asm/arch-sa1100/ide.h needs fixing for lart"
  19. static struct mcp_plat_data lart_mcp_data = {
  20. .mccr0 = MCCR0_ADM,
  21. .sclk_rate = 11981000,
  22. };
  23. #ifdef LART_GREY_LCD
  24. static struct sa1100fb_mach_info lart_grey_info = {
  25. .pixclock = 150000, .bpp = 4,
  26. .xres = 320, .yres = 240,
  27. .hsync_len = 1, .vsync_len = 1,
  28. .left_margin = 4, .upper_margin = 0,
  29. .right_margin = 2, .lower_margin = 0,
  30. .cmap_greyscale = 1,
  31. .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
  32. .lccr0 = LCCR0_Mono | LCCR0_Sngl | LCCR0_Pas | LCCR0_4PixMono,
  33. .lccr3 = LCCR3_OutEnH | LCCR3_PixRsEdg | LCCR3_ACBsDiv(512),
  34. };
  35. #endif
  36. #ifdef LART_COLOR_LCD
  37. static struct sa1100fb_mach_info lart_color_info = {
  38. .pixclock = 150000, .bpp = 16,
  39. .xres = 320, .yres = 240,
  40. .hsync_len = 2, .vsync_len = 3,
  41. .left_margin = 69, .upper_margin = 14,
  42. .right_margin = 8, .lower_margin = 4,
  43. .lccr0 = LCCR0_Color | LCCR0_Sngl | LCCR0_Act,
  44. .lccr3 = LCCR3_OutEnH | LCCR3_PixFlEdg | LCCR3_ACBsDiv(512),
  45. };
  46. #endif
  47. #ifdef LART_VIDEO_OUT
  48. static struct sa1100fb_mach_info lart_video_info = {
  49. .pixclock = 39721, .bpp = 16,
  50. .xres = 640, .yres = 480,
  51. .hsync_len = 95, .vsync_len = 2,
  52. .left_margin = 40, .upper_margin = 32,
  53. .right_margin = 24, .lower_margin = 11,
  54. .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
  55. .lccr0 = LCCR0_Color | LCCR0_Sngl | LCCR0_Act,
  56. .lccr3 = LCCR3_OutEnL | LCCR3_PixFlEdg | LCCR3_ACBsDiv(512),
  57. };
  58. #endif
  59. #ifdef LART_KIT01_LCD
  60. static struct sa1100fb_mach_info lart_kit01_info = {
  61. .pixclock = 63291, .bpp = 16,
  62. .xres = 640, .yres = 480,
  63. .hsync_len = 64, .vsync_len = 3,
  64. .left_margin = 122, .upper_margin = 45,
  65. .right_margin = 10, .lower_margin = 10,
  66. .lccr0 = LCCR0_Color | LCCR0_Sngl | LCCR0_Act,
  67. .lccr3 = LCCR3_OutEnH | LCCR3_PixFlEdg
  68. };
  69. #endif
  70. static void __init lart_init(void)
  71. {
  72. struct sa1100fb_mach_info *inf = NULL;
  73. #ifdef LART_GREY_LCD
  74. inf = &lart_grey_info;
  75. #endif
  76. #ifdef LART_COLOR_LCD
  77. inf = &lart_color_info;
  78. #endif
  79. #ifdef LART_VIDEO_OUT
  80. inf = &lart_video_info;
  81. #endif
  82. #ifdef LART_KIT01_LCD
  83. inf = &lart_kit01_info;
  84. #endif
  85. if (inf)
  86. sa11x0_register_lcd(inf);
  87. sa11x0_ppc_configure_mcp();
  88. sa11x0_register_mcp(&lart_mcp_data);
  89. }
  90. static struct map_desc lart_io_desc[] __initdata = {
  91. { /* main flash memory */
  92. .virtual = 0xe8000000,
  93. .pfn = __phys_to_pfn(0x00000000),
  94. .length = 0x00400000,
  95. .type = MT_DEVICE
  96. }, { /* main flash, alternative location */
  97. .virtual = 0xec000000,
  98. .pfn = __phys_to_pfn(0x08000000),
  99. .length = 0x00400000,
  100. .type = MT_DEVICE
  101. }
  102. };
  103. static void __init lart_map_io(void)
  104. {
  105. sa1100_map_io();
  106. iotable_init(lart_io_desc, ARRAY_SIZE(lart_io_desc));
  107. sa1100_register_uart(0, 3);
  108. sa1100_register_uart(1, 1);
  109. sa1100_register_uart(2, 2);
  110. GAFR |= (GPIO_UART_TXD | GPIO_UART_RXD);
  111. GPDR |= GPIO_UART_TXD;
  112. GPDR &= ~GPIO_UART_RXD;
  113. PPAR |= PPAR_UPR;
  114. }
  115. MACHINE_START(LART, "LART")
  116. .atag_offset = 0x100,
  117. .map_io = lart_map_io,
  118. .nr_irqs = SA1100_NR_IRQS,
  119. .init_irq = sa1100_init_irq,
  120. .init_machine = lart_init,
  121. .timer = &sa1100_timer,
  122. .restart = sa11x0_restart,
  123. MACHINE_END