hisilicon.c 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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/clocksource.h>
  14. #include <linux/irqchip.h>
  15. #include <asm/mach/arch.h>
  16. #include <asm/mach/map.h>
  17. #define HI3620_SYSCTRL_PHYS_BASE 0xfc802000
  18. #define HI3620_SYSCTRL_VIRT_BASE 0xfe802000
  19. /*
  20. * This table is only for optimization. Since ioremap() could always share
  21. * the same mapping if it's defined as static IO mapping.
  22. *
  23. * Without this table, system could also work. The cost is some virtual address
  24. * spaces wasted since ioremap() may be called multi times for the same
  25. * IO space.
  26. */
  27. static struct map_desc hi3620_io_desc[] __initdata = {
  28. {
  29. /* sysctrl */
  30. .pfn = __phys_to_pfn(HI3620_SYSCTRL_PHYS_BASE),
  31. .virtual = HI3620_SYSCTRL_VIRT_BASE,
  32. .length = 0x1000,
  33. .type = MT_DEVICE,
  34. },
  35. };
  36. static void __init hi3620_map_io(void)
  37. {
  38. debug_ll_io_init();
  39. iotable_init(hi3620_io_desc, ARRAY_SIZE(hi3620_io_desc));
  40. }
  41. static const char *const hi3xxx_compat[] __initconst = {
  42. "hisilicon,hi3620-hi4511",
  43. NULL,
  44. };
  45. DT_MACHINE_START(HI3620, "Hisilicon Hi3620 (Flattened Device Tree)")
  46. .map_io = hi3620_map_io,
  47. .dt_compat = hi3xxx_compat,
  48. MACHINE_END