mach-ncp.c 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. // SPDX-License-Identifier: GPL-2.0
  2. //
  3. // Copyright (C) 2008-2009 Samsung Electronics
  4. #include <linux/kernel.h>
  5. #include <linux/types.h>
  6. #include <linux/interrupt.h>
  7. #include <linux/list.h>
  8. #include <linux/timer.h>
  9. #include <linux/init.h>
  10. #include <linux/serial_core.h>
  11. #include <linux/serial_s3c.h>
  12. #include <linux/platform_device.h>
  13. #include <linux/io.h>
  14. #include <linux/i2c.h>
  15. #include <linux/fb.h>
  16. #include <linux/gpio.h>
  17. #include <linux/delay.h>
  18. #include <video/platform_lcd.h>
  19. #include <video/samsung_fimd.h>
  20. #include <asm/mach/arch.h>
  21. #include <asm/mach/map.h>
  22. #include <asm/mach/irq.h>
  23. #include <mach/irqs.h>
  24. #include <mach/hardware.h>
  25. #include <mach/map.h>
  26. #include <asm/irq.h>
  27. #include <asm/mach-types.h>
  28. #include <linux/platform_data/i2c-s3c2410.h>
  29. #include <plat/fb.h>
  30. #include <plat/devs.h>
  31. #include <plat/cpu.h>
  32. #include <plat/samsung-time.h>
  33. #include "common.h"
  34. #define UCON S3C2410_UCON_DEFAULT
  35. #define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE
  36. #define UFCON S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE
  37. static struct s3c2410_uartcfg ncp_uartcfgs[] __initdata = {
  38. /* REVISIT: NCP uses only serial 1, 2 */
  39. [0] = {
  40. .hwport = 0,
  41. .flags = 0,
  42. .ucon = UCON,
  43. .ulcon = ULCON,
  44. .ufcon = UFCON,
  45. },
  46. [1] = {
  47. .hwport = 1,
  48. .flags = 0,
  49. .ucon = UCON,
  50. .ulcon = ULCON,
  51. .ufcon = UFCON,
  52. },
  53. [2] = {
  54. .hwport = 2,
  55. .flags = 0,
  56. .ucon = UCON,
  57. .ulcon = ULCON,
  58. .ufcon = UFCON,
  59. },
  60. };
  61. static struct platform_device *ncp_devices[] __initdata = {
  62. &s3c_device_hsmmc1,
  63. &s3c_device_i2c0,
  64. };
  65. static struct map_desc ncp_iodesc[] __initdata = {};
  66. static void __init ncp_map_io(void)
  67. {
  68. s3c64xx_init_io(ncp_iodesc, ARRAY_SIZE(ncp_iodesc));
  69. s3c64xx_set_xtal_freq(12000000);
  70. s3c24xx_init_uarts(ncp_uartcfgs, ARRAY_SIZE(ncp_uartcfgs));
  71. samsung_set_timer_source(SAMSUNG_PWM3, SAMSUNG_PWM4);
  72. }
  73. static void __init ncp_machine_init(void)
  74. {
  75. s3c_i2c0_set_platdata(NULL);
  76. platform_add_devices(ncp_devices, ARRAY_SIZE(ncp_devices));
  77. }
  78. MACHINE_START(NCP, "NCP")
  79. /* Maintainer: Samsung Electronics */
  80. .atag_offset = 0x100,
  81. .nr_irqs = S3C64XX_NR_IRQS,
  82. .init_irq = s3c6410_init_irq,
  83. .map_io = ncp_map_io,
  84. .init_machine = ncp_machine_init,
  85. .init_time = samsung_timer_init,
  86. .restart = s3c64xx_restart,
  87. MACHINE_END