mach-smdk6442.c 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. /* linux/arch/arm/mach-s5p6442/mach-smdk6442.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/i2c.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 <plat/regs-serial.h>
  22. #include <plat/s5p6442.h>
  23. #include <plat/devs.h>
  24. #include <plat/cpu.h>
  25. #include <plat/iic.h>
  26. /* Following are default values for UCON, ULCON and UFCON UART registers */
  27. #define SMDK6442_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
  28. S3C2410_UCON_RXILEVEL | \
  29. S3C2410_UCON_TXIRQMODE | \
  30. S3C2410_UCON_RXIRQMODE | \
  31. S3C2410_UCON_RXFIFO_TOI | \
  32. S3C2443_UCON_RXERR_IRQEN)
  33. #define SMDK6442_ULCON_DEFAULT S3C2410_LCON_CS8
  34. #define SMDK6442_UFCON_DEFAULT (S3C2410_UFCON_FIFOMODE | \
  35. S5PV210_UFCON_TXTRIG4 | \
  36. S5PV210_UFCON_RXTRIG4)
  37. static struct s3c2410_uartcfg smdk6442_uartcfgs[] __initdata = {
  38. [0] = {
  39. .hwport = 0,
  40. .flags = 0,
  41. .ucon = SMDK6442_UCON_DEFAULT,
  42. .ulcon = SMDK6442_ULCON_DEFAULT,
  43. .ufcon = SMDK6442_UFCON_DEFAULT,
  44. },
  45. [1] = {
  46. .hwport = 1,
  47. .flags = 0,
  48. .ucon = SMDK6442_UCON_DEFAULT,
  49. .ulcon = SMDK6442_ULCON_DEFAULT,
  50. .ufcon = SMDK6442_UFCON_DEFAULT,
  51. },
  52. [2] = {
  53. .hwport = 2,
  54. .flags = 0,
  55. .ucon = SMDK6442_UCON_DEFAULT,
  56. .ulcon = SMDK6442_ULCON_DEFAULT,
  57. .ufcon = SMDK6442_UFCON_DEFAULT,
  58. },
  59. };
  60. static struct platform_device *smdk6442_devices[] __initdata = {
  61. &s3c_device_i2c0,
  62. &samsung_asoc_dma,
  63. &s5p6442_device_iis0,
  64. &s3c_device_wdt,
  65. };
  66. static struct i2c_board_info smdk6442_i2c_devs0[] __initdata = {
  67. { I2C_BOARD_INFO("wm8580", 0x1b), },
  68. };
  69. static void __init smdk6442_map_io(void)
  70. {
  71. s5p_init_io(NULL, 0, S5P_VA_CHIPID);
  72. s3c24xx_init_clocks(12000000);
  73. s3c24xx_init_uarts(smdk6442_uartcfgs, ARRAY_SIZE(smdk6442_uartcfgs));
  74. }
  75. static void __init smdk6442_machine_init(void)
  76. {
  77. s3c_i2c0_set_platdata(NULL);
  78. i2c_register_board_info(0, smdk6442_i2c_devs0,
  79. ARRAY_SIZE(smdk6442_i2c_devs0));
  80. platform_add_devices(smdk6442_devices, ARRAY_SIZE(smdk6442_devices));
  81. }
  82. MACHINE_START(SMDK6442, "SMDK6442")
  83. /* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */
  84. .boot_params = S5P_PA_SDRAM + 0x100,
  85. .init_irq = s5p6442_init_irq,
  86. .map_io = smdk6442_map_io,
  87. .init_machine = smdk6442_machine_init,
  88. .timer = &s3c24xx_timer,
  89. MACHINE_END