mach-ncp.c 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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 "irqs.h"
  24. #include "map.h"
  25. #include <asm/irq.h>
  26. #include <asm/mach-types.h>
  27. #include <linux/platform_data/i2c-s3c2410.h>
  28. #include "fb.h"
  29. #include "devs.h"
  30. #include "cpu.h"
  31. #include "s3c64xx.h"
  32. #define UCON S3C2410_UCON_DEFAULT
  33. #define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE
  34. #define UFCON S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE
  35. static struct s3c2410_uartcfg ncp_uartcfgs[] __initdata = {
  36. /* REVISIT: NCP uses only serial 1, 2 */
  37. [0] = {
  38. .hwport = 0,
  39. .flags = 0,
  40. .ucon = UCON,
  41. .ulcon = ULCON,
  42. .ufcon = UFCON,
  43. },
  44. [1] = {
  45. .hwport = 1,
  46. .flags = 0,
  47. .ucon = UCON,
  48. .ulcon = ULCON,
  49. .ufcon = UFCON,
  50. },
  51. [2] = {
  52. .hwport = 2,
  53. .flags = 0,
  54. .ucon = UCON,
  55. .ulcon = ULCON,
  56. .ufcon = UFCON,
  57. },
  58. };
  59. static struct platform_device *ncp_devices[] __initdata = {
  60. &s3c_device_hsmmc1,
  61. &s3c_device_i2c0,
  62. };
  63. static struct map_desc ncp_iodesc[] __initdata = {};
  64. static void __init ncp_map_io(void)
  65. {
  66. s3c64xx_init_io(ncp_iodesc, ARRAY_SIZE(ncp_iodesc));
  67. s3c64xx_set_xtal_freq(12000000);
  68. s3c24xx_init_uarts(ncp_uartcfgs, ARRAY_SIZE(ncp_uartcfgs));
  69. s3c64xx_set_timer_source(S3C64XX_PWM3, S3C64XX_PWM4);
  70. }
  71. static void __init ncp_machine_init(void)
  72. {
  73. s3c_i2c0_set_platdata(NULL);
  74. platform_add_devices(ncp_devices, ARRAY_SIZE(ncp_devices));
  75. }
  76. MACHINE_START(NCP, "NCP")
  77. /* Maintainer: Samsung Electronics */
  78. .atag_offset = 0x100,
  79. .nr_irqs = S3C64XX_NR_IRQS,
  80. .init_irq = s3c6410_init_irq,
  81. .map_io = ncp_map_io,
  82. .init_machine = ncp_machine_init,
  83. .init_time = s3c64xx_timer_init,
  84. MACHINE_END