hisilicon.c 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /*
  2. * (Hisilicon's SoC based) flattened device tree enabled machine
  3. *
  4. * Copyright (c) 2012-2013 Hisilicon Ltd.
  5. * Copyright (c) 2012-2013 Linaro Ltd.
  6. *
  7. * Author: Haojian Zhuang <haojian.zhuang@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/clk-provider.h>
  14. #include <linux/clocksource.h>
  15. #include <linux/irqchip.h>
  16. #include <asm/mach/arch.h>
  17. #include <asm/mach/map.h>
  18. #define HI3620_SYSCTRL_PHYS_BASE 0xfc802000
  19. #define HI3620_SYSCTRL_VIRT_BASE 0xfe802000
  20. /*
  21. * This table is only for optimization. Since ioremap() could always share
  22. * the same mapping if it's defined as static IO mapping.
  23. *
  24. * Without this table, system could also work. The cost is some virtual address
  25. * spaces wasted since ioremap() may be called multi times for the same
  26. * IO space.
  27. */
  28. static struct map_desc hi3620_io_desc[] __initdata = {
  29. {
  30. /* sysctrl */
  31. .pfn = __phys_to_pfn(HI3620_SYSCTRL_PHYS_BASE),
  32. .virtual = HI3620_SYSCTRL_VIRT_BASE,
  33. .length = 0x1000,
  34. .type = MT_DEVICE,
  35. },
  36. };
  37. static void __init hi3620_map_io(void)
  38. {
  39. debug_ll_io_init();
  40. iotable_init(hi3620_io_desc, ARRAY_SIZE(hi3620_io_desc));
  41. }
  42. static const char *hi3xxx_compat[] __initconst = {
  43. "hisilicon,hi3620-hi4511",
  44. NULL,
  45. };
  46. DT_MACHINE_START(HI3620, "Hisilicon Hi3620 (Flattened Device Tree)")
  47. .map_io = hi3620_map_io,
  48. .dt_compat = hi3xxx_compat,
  49. MACHINE_END
  50. static const char *hix5hd2_compat[] __initconst = {
  51. "hisilicon,hix5hd2",
  52. NULL,
  53. };
  54. DT_MACHINE_START(HIX5HD2_DT, "Hisilicon HIX5HD2 (Flattened Device Tree)")
  55. .dt_compat = hix5hd2_compat,
  56. MACHINE_END
  57. static const char *hip04_compat[] __initconst = {
  58. "hisilicon,hip04-d01",
  59. NULL,
  60. };
  61. DT_MACHINE_START(HIP04, "Hisilicon HiP04 (Flattened Device Tree)")
  62. .dt_compat = hip04_compat,
  63. MACHINE_END