Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0-only
0002 /*
0003  * (HiSilicon's SoC based) flattened device tree enabled machine
0004  *
0005  * Copyright (c) 2012-2013 HiSilicon Ltd.
0006  * Copyright (c) 2012-2013 Linaro Ltd.
0007  *
0008  * Author: Haojian Zhuang <haojian.zhuang@linaro.org>
0009 */
0010 
0011 #include <linux/clocksource.h>
0012 #include <linux/irqchip.h>
0013 
0014 #include <asm/mach/arch.h>
0015 #include <asm/mach/map.h>
0016 
0017 #define HI3620_SYSCTRL_PHYS_BASE        0xfc802000
0018 #define HI3620_SYSCTRL_VIRT_BASE        0xfe802000
0019 
0020 /*
0021  * This table is only for optimization. Since ioremap() could always share
0022  * the same mapping if it's defined as static IO mapping.
0023  *
0024  * Without this table, system could also work. The cost is some virtual address
0025  * spaces wasted since ioremap() may be called multi times for the same
0026  * IO space.
0027  */
0028 static struct map_desc hi3620_io_desc[] __initdata = {
0029     {
0030         /* sysctrl */
0031         .pfn        = __phys_to_pfn(HI3620_SYSCTRL_PHYS_BASE),
0032         .virtual    = HI3620_SYSCTRL_VIRT_BASE,
0033         .length     = 0x1000,
0034         .type       = MT_DEVICE,
0035     },
0036 };
0037 
0038 static void __init hi3620_map_io(void)
0039 {
0040     debug_ll_io_init();
0041     iotable_init(hi3620_io_desc, ARRAY_SIZE(hi3620_io_desc));
0042 }
0043 
0044 static const char *const hi3xxx_compat[] __initconst = {
0045     "hisilicon,hi3620-hi4511",
0046     NULL,
0047 };
0048 
0049 DT_MACHINE_START(HI3620, "Hisilicon Hi3620 (Flattened Device Tree)")
0050     .map_io     = hi3620_map_io,
0051     .dt_compat  = hi3xxx_compat,
0052 MACHINE_END