mach-aquila.c 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. /* linux/arch/arm/mach-s5pv210/mach-aquila.c
  2. *
  3. * Copyright (c) 2010 Samsung Electronics Co., Ltd.
  4. * http://www.samsung.com/
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License version 2 as
  8. * published by the Free Software Foundation.
  9. */
  10. #include <linux/kernel.h>
  11. #include <linux/types.h>
  12. #include <linux/init.h>
  13. #include <linux/serial_core.h>
  14. #include <linux/fb.h>
  15. #include <asm/mach/arch.h>
  16. #include <asm/mach/map.h>
  17. #include <asm/setup.h>
  18. #include <asm/mach-types.h>
  19. #include <mach/map.h>
  20. #include <mach/regs-clock.h>
  21. #include <mach/regs-fb.h>
  22. #include <plat/regs-serial.h>
  23. #include <plat/s5pv210.h>
  24. #include <plat/devs.h>
  25. #include <plat/cpu.h>
  26. #include <plat/fb.h>
  27. /* Following are default values for UCON, ULCON and UFCON UART registers */
  28. #define S5PV210_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
  29. S3C2410_UCON_RXILEVEL | \
  30. S3C2410_UCON_TXIRQMODE | \
  31. S3C2410_UCON_RXIRQMODE | \
  32. S3C2410_UCON_RXFIFO_TOI | \
  33. S3C2443_UCON_RXERR_IRQEN)
  34. #define S5PV210_ULCON_DEFAULT S3C2410_LCON_CS8
  35. #define S5PV210_UFCON_DEFAULT S3C2410_UFCON_FIFOMODE
  36. static struct s3c2410_uartcfg aquila_uartcfgs[] __initdata = {
  37. [0] = {
  38. .hwport = 0,
  39. .flags = 0,
  40. .ucon = S5PV210_UCON_DEFAULT,
  41. .ulcon = S5PV210_ULCON_DEFAULT,
  42. /*
  43. * Actually UART0 can support 256 bytes fifo, but aquila board
  44. * supports 128 bytes fifo because of initial chip bug
  45. */
  46. .ufcon = S5PV210_UFCON_DEFAULT |
  47. S5PV210_UFCON_TXTRIG128 | S5PV210_UFCON_RXTRIG128,
  48. },
  49. [1] = {
  50. .hwport = 1,
  51. .flags = 0,
  52. .ucon = S5PV210_UCON_DEFAULT,
  53. .ulcon = S5PV210_ULCON_DEFAULT,
  54. .ufcon = S5PV210_UFCON_DEFAULT |
  55. S5PV210_UFCON_TXTRIG64 | S5PV210_UFCON_RXTRIG64,
  56. },
  57. [2] = {
  58. .hwport = 2,
  59. .flags = 0,
  60. .ucon = S5PV210_UCON_DEFAULT,
  61. .ulcon = S5PV210_ULCON_DEFAULT,
  62. .ufcon = S5PV210_UFCON_DEFAULT |
  63. S5PV210_UFCON_TXTRIG16 | S5PV210_UFCON_RXTRIG16,
  64. },
  65. [3] = {
  66. .hwport = 3,
  67. .flags = 0,
  68. .ucon = S5PV210_UCON_DEFAULT,
  69. .ulcon = S5PV210_ULCON_DEFAULT,
  70. .ufcon = S5PV210_UFCON_DEFAULT |
  71. S5PV210_UFCON_TXTRIG16 | S5PV210_UFCON_RXTRIG16,
  72. },
  73. };
  74. /* Frame Buffer */
  75. static struct s3c_fb_pd_win aquila_fb_win0 = {
  76. .win_mode = {
  77. .pixclock = 1000000000000ULL / ((16+16+2+480)*(28+3+2+800)*60),
  78. .left_margin = 16,
  79. .right_margin = 16,
  80. .upper_margin = 3,
  81. .lower_margin = 28,
  82. .hsync_len = 2,
  83. .vsync_len = 2,
  84. .xres = 480,
  85. .yres = 800,
  86. },
  87. .max_bpp = 32,
  88. .default_bpp = 16,
  89. };
  90. static struct s3c_fb_pd_win aquila_fb_win1 = {
  91. .win_mode = {
  92. .pixclock = 1000000000000ULL / ((16+16+2+480)*(28+3+2+800)*60),
  93. .left_margin = 16,
  94. .right_margin = 16,
  95. .upper_margin = 3,
  96. .lower_margin = 28,
  97. .hsync_len = 2,
  98. .vsync_len = 2,
  99. .xres = 480,
  100. .yres = 800,
  101. },
  102. .max_bpp = 32,
  103. .default_bpp = 16,
  104. };
  105. static struct s3c_fb_platdata aquila_lcd_pdata __initdata = {
  106. .win[0] = &aquila_fb_win0,
  107. .win[1] = &aquila_fb_win1,
  108. .vidcon0 = VIDCON0_VIDOUT_RGB | VIDCON0_PNRMODE_RGB,
  109. .vidcon1 = VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC |
  110. VIDCON1_INV_VCLK | VIDCON1_INV_VDEN,
  111. .setup_gpio = s5pv210_fb_gpio_setup_24bpp,
  112. };
  113. static struct platform_device *aquila_devices[] __initdata = {
  114. &s3c_device_fb,
  115. &s5pc110_device_onenand,
  116. };
  117. static void __init aquila_map_io(void)
  118. {
  119. s5p_init_io(NULL, 0, S5P_VA_CHIPID);
  120. s3c24xx_init_clocks(24000000);
  121. s3c24xx_init_uarts(aquila_uartcfgs, ARRAY_SIZE(aquila_uartcfgs));
  122. }
  123. static void __init aquila_machine_init(void)
  124. {
  125. /* FB */
  126. s3c_fb_set_platdata(&aquila_lcd_pdata);
  127. platform_add_devices(aquila_devices, ARRAY_SIZE(aquila_devices));
  128. }
  129. MACHINE_START(AQUILA, "Aquila")
  130. /* Maintainers:
  131. Marek Szyprowski <m.szyprowski@samsung.com>
  132. Kyungmin Park <kyungmin.park@samsung.com> */
  133. .phys_io = S3C_PA_UART & 0xfff00000,
  134. .io_pg_offst = (((u32)S3C_VA_UART) >> 18) & 0xfffc,
  135. .boot_params = S5P_PA_SDRAM + 0x100,
  136. .init_irq = s5pv210_init_irq,
  137. .map_io = aquila_map_io,
  138. .init_machine = aquila_machine_init,
  139. .timer = &s3c24xx_timer,
  140. MACHINE_END