mach-goni.c 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. /* linux/arch/arm/mach-s5pv210/mach-goni.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 goni_uartcfgs[] __initdata = {
  37. [0] = {
  38. .hwport = 0,
  39. .flags = 0,
  40. .ucon = S5PV210_UCON_DEFAULT,
  41. .ulcon = S5PV210_ULCON_DEFAULT,
  42. .ufcon = S5PV210_UFCON_DEFAULT |
  43. S5PV210_UFCON_TXTRIG256 | S5PV210_UFCON_RXTRIG256,
  44. },
  45. [1] = {
  46. .hwport = 1,
  47. .flags = 0,
  48. .ucon = S5PV210_UCON_DEFAULT,
  49. .ulcon = S5PV210_ULCON_DEFAULT,
  50. .ufcon = S5PV210_UFCON_DEFAULT |
  51. S5PV210_UFCON_TXTRIG64 | S5PV210_UFCON_RXTRIG64,
  52. },
  53. [2] = {
  54. .hwport = 2,
  55. .flags = 0,
  56. .ucon = S5PV210_UCON_DEFAULT,
  57. .ulcon = S5PV210_ULCON_DEFAULT,
  58. .ufcon = S5PV210_UFCON_DEFAULT |
  59. S5PV210_UFCON_TXTRIG16 | S5PV210_UFCON_RXTRIG16,
  60. },
  61. [3] = {
  62. .hwport = 3,
  63. .flags = 0,
  64. .ucon = S5PV210_UCON_DEFAULT,
  65. .ulcon = S5PV210_ULCON_DEFAULT,
  66. .ufcon = S5PV210_UFCON_DEFAULT |
  67. S5PV210_UFCON_TXTRIG16 | S5PV210_UFCON_RXTRIG16,
  68. },
  69. };
  70. /* Frame Buffer */
  71. static struct s3c_fb_pd_win goni_fb_win0 = {
  72. .win_mode = {
  73. .pixclock = 1000000000000ULL / ((16+16+2+480)*(28+3+2+800)*55),
  74. .left_margin = 16,
  75. .right_margin = 16,
  76. .upper_margin = 3,
  77. .lower_margin = 28,
  78. .hsync_len = 2,
  79. .vsync_len = 2,
  80. .xres = 480,
  81. .yres = 800,
  82. .refresh = 55,
  83. },
  84. .max_bpp = 32,
  85. .default_bpp = 16,
  86. };
  87. static struct s3c_fb_platdata goni_lcd_pdata __initdata = {
  88. .win[0] = &goni_fb_win0,
  89. .vidcon0 = VIDCON0_VIDOUT_RGB | VIDCON0_PNRMODE_RGB |
  90. VIDCON0_CLKSEL_LCD,
  91. .vidcon1 = VIDCON1_INV_VCLK | VIDCON1_INV_VDEN
  92. | VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC,
  93. .setup_gpio = s5pv210_fb_gpio_setup_24bpp,
  94. };
  95. static struct platform_device *goni_devices[] __initdata = {
  96. &s3c_device_fb,
  97. &s5pc110_device_onenand,
  98. };
  99. static void __init goni_map_io(void)
  100. {
  101. s5p_init_io(NULL, 0, S5P_VA_CHIPID);
  102. s3c24xx_init_clocks(24000000);
  103. s3c24xx_init_uarts(goni_uartcfgs, ARRAY_SIZE(goni_uartcfgs));
  104. }
  105. static void __init goni_machine_init(void)
  106. {
  107. /* FB */
  108. s3c_fb_set_platdata(&goni_lcd_pdata);
  109. platform_add_devices(goni_devices, ARRAY_SIZE(goni_devices));
  110. }
  111. MACHINE_START(GONI, "GONI")
  112. /* Maintainers: Kyungmin Park <kyungmin.park@samsung.com> */
  113. .phys_io = S3C_PA_UART & 0xfff00000,
  114. .io_pg_offst = (((u32)S3C_VA_UART) >> 18) & 0xfffc,
  115. .boot_params = S5P_PA_SDRAM + 0x100,
  116. .init_irq = s5pv210_init_irq,
  117. .map_io = goni_map_io,
  118. .init_machine = goni_machine_init,
  119. .timer = &s3c24xx_timer,
  120. MACHINE_END