mach-smdk2410.c 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. // SPDX-License-Identifier: GPL-2.0+
  2. //
  3. // Copyright (C) 2004 by FS Forth-Systeme GmbH
  4. // All rights reserved.
  5. //
  6. // @Author: Jonas Dietsche
  7. //
  8. // @History:
  9. // derived from linux/arch/arm/mach-s3c2410/mach-bast.c, written by
  10. // Ben Dooks <[email protected]>
  11. #include <linux/kernel.h>
  12. #include <linux/types.h>
  13. #include <linux/interrupt.h>
  14. #include <linux/list.h>
  15. #include <linux/timer.h>
  16. #include <linux/init.h>
  17. #include <linux/serial_core.h>
  18. #include <linux/serial_s3c.h>
  19. #include <linux/platform_device.h>
  20. #include <linux/io.h>
  21. #include "gpio-samsung.h"
  22. #include "gpio-cfg.h"
  23. #include <asm/mach/arch.h>
  24. #include <asm/mach/map.h>
  25. #include <asm/mach/irq.h>
  26. #include <asm/irq.h>
  27. #include <asm/mach-types.h>
  28. #include <linux/platform_data/i2c-s3c2410.h>
  29. #include "devs.h"
  30. #include "cpu.h"
  31. #include "s3c24xx.h"
  32. #include "common-smdk-s3c24xx.h"
  33. static struct map_desc smdk2410_iodesc[] __initdata = {
  34. /* nothing here yet */
  35. };
  36. #define UCON S3C2410_UCON_DEFAULT
  37. #define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB
  38. #define UFCON S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE
  39. static struct s3c2410_uartcfg smdk2410_uartcfgs[] __initdata = {
  40. [0] = {
  41. .hwport = 0,
  42. .flags = 0,
  43. .ucon = UCON,
  44. .ulcon = ULCON,
  45. .ufcon = UFCON,
  46. },
  47. [1] = {
  48. .hwport = 1,
  49. .flags = 0,
  50. .ucon = UCON,
  51. .ulcon = ULCON,
  52. .ufcon = UFCON,
  53. },
  54. [2] = {
  55. .hwport = 2,
  56. .flags = 0,
  57. .ucon = UCON,
  58. .ulcon = ULCON,
  59. .ufcon = UFCON,
  60. }
  61. };
  62. static struct platform_device *smdk2410_devices[] __initdata = {
  63. &s3c_device_ohci,
  64. &s3c_device_lcd,
  65. &s3c_device_wdt,
  66. &s3c_device_i2c0,
  67. &s3c_device_iis,
  68. };
  69. static void __init smdk2410_map_io(void)
  70. {
  71. s3c24xx_init_io(smdk2410_iodesc, ARRAY_SIZE(smdk2410_iodesc));
  72. s3c24xx_init_uarts(smdk2410_uartcfgs, ARRAY_SIZE(smdk2410_uartcfgs));
  73. s3c24xx_set_timer_source(S3C24XX_PWM3, S3C24XX_PWM4);
  74. }
  75. static void __init smdk2410_init_time(void)
  76. {
  77. s3c2410_init_clocks(12000000);
  78. s3c24xx_timer_init();
  79. }
  80. static void __init smdk2410_init(void)
  81. {
  82. s3c_i2c0_set_platdata(NULL);
  83. platform_add_devices(smdk2410_devices, ARRAY_SIZE(smdk2410_devices));
  84. /* Configure the I2S pins (GPE0...GPE4) in correct mode */
  85. s3c_gpio_cfgall_range(S3C2410_GPE(0), 5, S3C_GPIO_SFN(2),
  86. S3C_GPIO_PULL_NONE);
  87. smdk_machine_init();
  88. }
  89. MACHINE_START(SMDK2410, "SMDK2410") /* @TODO: request a new identifier and switch
  90. * to SMDK2410 */
  91. /* Maintainer: Jonas Dietsche */
  92. .atag_offset = 0x100,
  93. .nr_irqs = NR_IRQS_S3C2410,
  94. .map_io = smdk2410_map_io,
  95. .init_irq = s3c2410_init_irq,
  96. .init_machine = smdk2410_init,
  97. .init_time = smdk2410_init_time,
  98. MACHINE_END