hisilicon.c 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. /*
  3. * (Hisilicon's SoC based) flattened device tree enabled machine
  4. *
  5. * Copyright (c) 2012-2013 Hisilicon Ltd.
  6. * Copyright (c) 2012-2013 Linaro Ltd.
  7. *
  8. * Author: Haojian Zhuang <haojian.zhuang@linaro.org>
  9. */
  10. #include <linux/clocksource.h>
  11. #include <linux/irqchip.h>
  12. #include <asm/mach/arch.h>
  13. #include <asm/mach/map.h>
  14. #define HI3620_SYSCTRL_PHYS_BASE 0xfc802000
  15. #define HI3620_SYSCTRL_VIRT_BASE 0xfe802000
  16. /*
  17. * This table is only for optimization. Since ioremap() could always share
  18. * the same mapping if it's defined as static IO mapping.
  19. *
  20. * Without this table, system could also work. The cost is some virtual address
  21. * spaces wasted since ioremap() may be called multi times for the same
  22. * IO space.
  23. */
  24. static struct map_desc hi3620_io_desc[] __initdata = {
  25. {
  26. /* sysctrl */
  27. .pfn = __phys_to_pfn(HI3620_SYSCTRL_PHYS_BASE),
  28. .virtual = HI3620_SYSCTRL_VIRT_BASE,
  29. .length = 0x1000,
  30. .type = MT_DEVICE,
  31. },
  32. };
  33. static void __init hi3620_map_io(void)
  34. {
  35. debug_ll_io_init();
  36. iotable_init(hi3620_io_desc, ARRAY_SIZE(hi3620_io_desc));
  37. }
  38. static const char *const hi3xxx_compat[] __initconst = {
  39. "hisilicon,hi3620-hi4511",
  40. NULL,
  41. };
  42. DT_MACHINE_START(HI3620, "Hisilicon Hi3620 (Flattened Device Tree)")
  43. .map_io = hi3620_map_io,
  44. .dt_compat = hi3xxx_compat,
  45. MACHINE_END