mach-smdk6400.c 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. // SPDX-License-Identifier: GPL-2.0
  2. //
  3. // Copyright 2008 Simtec Electronics
  4. // Ben Dooks <[email protected]>
  5. // http://armlinux.simtec.co.uk/
  6. #include <linux/kernel.h>
  7. #include <linux/types.h>
  8. #include <linux/interrupt.h>
  9. #include <linux/list.h>
  10. #include <linux/timer.h>
  11. #include <linux/init.h>
  12. #include <linux/serial_core.h>
  13. #include <linux/serial_s3c.h>
  14. #include <linux/platform_device.h>
  15. #include <linux/i2c.h>
  16. #include <linux/io.h>
  17. #include <asm/mach-types.h>
  18. #include <asm/mach/arch.h>
  19. #include <asm/mach/map.h>
  20. #include <asm/mach/irq.h>
  21. #include "irqs.h"
  22. #include "map.h"
  23. #include "devs.h"
  24. #include "cpu.h"
  25. #include <linux/platform_data/i2c-s3c2410.h>
  26. #include "gpio-samsung.h"
  27. #include "s3c64xx.h"
  28. #define UCON S3C2410_UCON_DEFAULT | S3C2410_UCON_UCLK
  29. #define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB
  30. #define UFCON S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE
  31. static struct s3c2410_uartcfg smdk6400_uartcfgs[] __initdata = {
  32. [0] = {
  33. .hwport = 0,
  34. .flags = 0,
  35. .ucon = 0x3c5,
  36. .ulcon = 0x03,
  37. .ufcon = 0x51,
  38. },
  39. [1] = {
  40. .hwport = 1,
  41. .flags = 0,
  42. .ucon = 0x3c5,
  43. .ulcon = 0x03,
  44. .ufcon = 0x51,
  45. },
  46. };
  47. static struct map_desc smdk6400_iodesc[] = {};
  48. static void __init smdk6400_map_io(void)
  49. {
  50. s3c64xx_init_io(smdk6400_iodesc, ARRAY_SIZE(smdk6400_iodesc));
  51. s3c64xx_set_xtal_freq(12000000);
  52. s3c24xx_init_uarts(smdk6400_uartcfgs, ARRAY_SIZE(smdk6400_uartcfgs));
  53. s3c64xx_set_timer_source(S3C64XX_PWM3, S3C64XX_PWM4);
  54. }
  55. static struct platform_device *smdk6400_devices[] __initdata = {
  56. &s3c_device_hsmmc1,
  57. &s3c_device_i2c0,
  58. };
  59. static struct i2c_board_info i2c_devs[] __initdata = {
  60. { I2C_BOARD_INFO("wm8753", 0x1A), },
  61. { I2C_BOARD_INFO("24c08", 0x50), },
  62. };
  63. static void __init smdk6400_machine_init(void)
  64. {
  65. i2c_register_board_info(0, i2c_devs, ARRAY_SIZE(i2c_devs));
  66. platform_add_devices(smdk6400_devices, ARRAY_SIZE(smdk6400_devices));
  67. }
  68. MACHINE_START(SMDK6400, "SMDK6400")
  69. /* Maintainer: Ben Dooks <[email protected]> */
  70. .atag_offset = 0x100,
  71. .nr_irqs = S3C64XX_NR_IRQS,
  72. .init_irq = s3c6400_init_irq,
  73. .map_io = smdk6400_map_io,
  74. .init_machine = smdk6400_machine_init,
  75. .init_time = s3c64xx_timer_init,
  76. MACHINE_END