lart.c 3.3 KB

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