mach-s3c64xx-dt.c 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. // SPDX-License-Identifier: GPL-2.0
  2. //
  3. // Samsung's S3C64XX flattened device tree enabled machine
  4. //
  5. // Copyright (c) 2013 Tomasz Figa <tomasz.figa@gmail.com>
  6. #include <asm/mach/arch.h>
  7. #include <asm/mach/map.h>
  8. #include <asm/system_misc.h>
  9. #include <plat/cpu.h>
  10. #include <mach/map.h>
  11. #include "common.h"
  12. #include "watchdog-reset.h"
  13. /*
  14. * IO mapping for shared system controller IP.
  15. *
  16. * FIXME: Make remaining drivers use dynamic mapping.
  17. */
  18. static struct map_desc s3c64xx_dt_iodesc[] __initdata = {
  19. {
  20. .virtual = (unsigned long)S3C_VA_SYS,
  21. .pfn = __phys_to_pfn(S3C64XX_PA_SYSCON),
  22. .length = SZ_4K,
  23. .type = MT_DEVICE,
  24. },
  25. };
  26. static void __init s3c64xx_dt_map_io(void)
  27. {
  28. debug_ll_io_init();
  29. iotable_init(s3c64xx_dt_iodesc, ARRAY_SIZE(s3c64xx_dt_iodesc));
  30. s3c64xx_init_cpu();
  31. if (!soc_is_s3c64xx())
  32. panic("SoC is not S3C64xx!");
  33. }
  34. static void __init s3c64xx_dt_init_machine(void)
  35. {
  36. samsung_wdt_reset_of_init();
  37. }
  38. static void s3c64xx_dt_restart(enum reboot_mode mode, const char *cmd)
  39. {
  40. if (mode != REBOOT_SOFT)
  41. samsung_wdt_reset();
  42. /* if all else fails, or mode was for soft, jump to 0 */
  43. soft_restart(0);
  44. }
  45. static const char *const s3c64xx_dt_compat[] __initconst = {
  46. "samsung,s3c6400",
  47. "samsung,s3c6410",
  48. NULL
  49. };
  50. DT_MACHINE_START(S3C6400_DT, "Samsung S3C64xx (Flattened Device Tree)")
  51. /* Maintainer: Tomasz Figa <tomasz.figa@gmail.com> */
  52. .dt_compat = s3c64xx_dt_compat,
  53. .map_io = s3c64xx_dt_map_io,
  54. .init_machine = s3c64xx_dt_init_machine,
  55. .restart = s3c64xx_dt_restart,
  56. MACHINE_END