mach-exynos4-dt.c 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. /*
  2. * Samsung's Exynos4210 flattened device tree enabled machine
  3. *
  4. * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd.
  5. * http://www.samsung.com
  6. * Copyright (c) 2010-2011 Linaro Ltd.
  7. * www.linaro.org
  8. *
  9. * This program is free software; you can redistribute it and/or modify
  10. * it under the terms of the GNU General Public License version 2 as
  11. * published by the Free Software Foundation.
  12. */
  13. #include <linux/of_platform.h>
  14. #include <linux/serial_core.h>
  15. #include <asm/mach/arch.h>
  16. #include <asm/hardware/gic.h>
  17. #include <mach/map.h>
  18. #include <plat/cpu.h>
  19. #include <plat/regs-serial.h>
  20. #include "common.h"
  21. /*
  22. * The following lookup table is used to override device names when devices
  23. * are registered from device tree. This is temporarily added to enable
  24. * device tree support addition for the Exynos4 architecture.
  25. *
  26. * For drivers that require platform data to be provided from the machine
  27. * file, a platform data pointer can also be supplied along with the
  28. * devices names. Usually, the platform data elements that cannot be parsed
  29. * from the device tree by the drivers (example: function pointers) are
  30. * supplied. But it should be noted that this is a temporary mechanism and
  31. * at some point, the drivers should be capable of parsing all the platform
  32. * data from the device tree.
  33. */
  34. static const struct of_dev_auxdata exynos4210_auxdata_lookup[] __initconst = {
  35. OF_DEV_AUXDATA("samsung,exynos4210-uart", S5P_PA_UART0,
  36. "exynos4210-uart.0", NULL),
  37. OF_DEV_AUXDATA("samsung,exynos4210-uart", S5P_PA_UART1,
  38. "exynos4210-uart.1", NULL),
  39. OF_DEV_AUXDATA("samsung,exynos4210-uart", S5P_PA_UART2,
  40. "exynos4210-uart.2", NULL),
  41. OF_DEV_AUXDATA("samsung,exynos4210-uart", S5P_PA_UART3,
  42. "exynos4210-uart.3", NULL),
  43. OF_DEV_AUXDATA("samsung,exynos4210-sdhci", EXYNOS4_PA_HSMMC(0),
  44. "exynos4-sdhci.0", NULL),
  45. OF_DEV_AUXDATA("samsung,exynos4210-sdhci", EXYNOS4_PA_HSMMC(1),
  46. "exynos4-sdhci.1", NULL),
  47. OF_DEV_AUXDATA("samsung,exynos4210-sdhci", EXYNOS4_PA_HSMMC(2),
  48. "exynos4-sdhci.2", NULL),
  49. OF_DEV_AUXDATA("samsung,exynos4210-sdhci", EXYNOS4_PA_HSMMC(3),
  50. "exynos4-sdhci.3", NULL),
  51. OF_DEV_AUXDATA("samsung,s3c2440-i2c", EXYNOS4_PA_IIC(0),
  52. "s3c2440-i2c.0", NULL),
  53. OF_DEV_AUXDATA("arm,pl330", EXYNOS4_PA_PDMA0, "dma-pl330.0", NULL),
  54. OF_DEV_AUXDATA("arm,pl330", EXYNOS4_PA_PDMA1, "dma-pl330.1", NULL),
  55. {},
  56. };
  57. static void __init exynos4210_dt_map_io(void)
  58. {
  59. exynos_init_io(NULL, 0);
  60. s3c24xx_init_clocks(24000000);
  61. }
  62. static void __init exynos4210_dt_machine_init(void)
  63. {
  64. of_platform_populate(NULL, of_default_bus_match_table,
  65. exynos4210_auxdata_lookup, NULL);
  66. }
  67. static char const *exynos4210_dt_compat[] __initdata = {
  68. "samsung,exynos4210",
  69. NULL
  70. };
  71. DT_MACHINE_START(EXYNOS4210_DT, "Samsung Exynos4 (Flattened Device Tree)")
  72. /* Maintainer: Thomas Abraham <thomas.abraham@linaro.org> */
  73. .init_irq = exynos4_init_irq,
  74. .map_io = exynos4210_dt_map_io,
  75. .handle_irq = gic_handle_irq,
  76. .init_machine = exynos4210_dt_machine_init,
  77. .timer = &exynos4_timer,
  78. .dt_compat = exynos4210_dt_compat,
  79. .restart = exynos4_restart,
  80. MACHINE_END