blob: c6bd7c7bd4aa4949203505247f0fd9db21ea0c5b [file] [log] [blame]
Kevin Hilmana9434e92013-12-17 16:23:49 -08001/*
Haojian Zhuang389ee0c2013-12-20 10:52:56 +08002 * (Hisilicon's SoC based) flattened device tree enabled machine
Haojian Zhuang2c7268c2013-12-11 15:54:50 +08003 *
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
14#include <linux/clk-provider.h>
15#include <linux/clocksource.h>
16#include <linux/irqchip.h>
Kevin Hilmana9434e92013-12-17 16:23:49 -080017
Haojian Zhuang2c7268c2013-12-11 15:54:50 +080018#include <asm/mach/arch.h>
19#include <asm/mach/map.h>
20
Kevin Hilmana9434e92013-12-17 16:23:49 -080021#define HI3620_SYSCTRL_PHYS_BASE 0xfc802000
22#define HI3620_SYSCTRL_VIRT_BASE 0xfe802000
23
Haojian Zhuang2c7268c2013-12-11 15:54:50 +080024/*
25 * This table is only for optimization. Since ioremap() could always share
26 * the same mapping if it's defined as static IO mapping.
27 *
28 * Without this table, system could also work. The cost is some virtual address
29 * spaces wasted since ioremap() may be called multi times for the same
30 * IO space.
31 */
32static struct map_desc hi3620_io_desc[] __initdata = {
33 {
Kevin Hilmana9434e92013-12-17 16:23:49 -080034 /* sysctrl */
35 .pfn = __phys_to_pfn(HI3620_SYSCTRL_PHYS_BASE),
36 .virtual = HI3620_SYSCTRL_VIRT_BASE,
Haojian Zhuang2c7268c2013-12-11 15:54:50 +080037 .length = 0x1000,
38 .type = MT_DEVICE,
39 },
40};
41
42static void __init hi3620_map_io(void)
43{
44 debug_ll_io_init();
45 iotable_init(hi3620_io_desc, ARRAY_SIZE(hi3620_io_desc));
46}
47
Uwe Kleine-König543c5042015-02-18 21:01:45 +010048static const char *const hi3xxx_compat[] __initconst = {
Haojian Zhuang2c7268c2013-12-11 15:54:50 +080049 "hisilicon,hi3620-hi4511",
50 NULL,
51};
52
53DT_MACHINE_START(HI3620, "Hisilicon Hi3620 (Flattened Device Tree)")
54 .map_io = hi3620_map_io,
Haojian Zhuang2c7268c2013-12-11 15:54:50 +080055 .dt_compat = hi3xxx_compat,
Haojian Zhuang2c7268c2013-12-11 15:54:50 +080056MACHINE_END
Haifeng Yan06cc5c12014-04-11 11:54:11 +080057
Uwe Kleine-König543c5042015-02-18 21:01:45 +010058static const char *const hix5hd2_compat[] __initconst = {
Haifeng Yan06cc5c12014-04-11 11:54:11 +080059 "hisilicon,hix5hd2",
60 NULL,
61};
62
63DT_MACHINE_START(HIX5HD2_DT, "Hisilicon HIX5HD2 (Flattened Device Tree)")
64 .dt_compat = hix5hd2_compat,
Haifeng Yan06cc5c12014-04-11 11:54:11 +080065MACHINE_END
Haojian Zhuang2d518ed2014-05-09 16:58:04 +080066
Uwe Kleine-König543c5042015-02-18 21:01:45 +010067static const char *const hip04_compat[] __initconst = {
Haojian Zhuang2d518ed2014-05-09 16:58:04 +080068 "hisilicon,hip04-d01",
69 NULL,
70};
71
72DT_MACHINE_START(HIP04, "Hisilicon HiP04 (Flattened Device Tree)")
73 .dt_compat = hip04_compat,
74MACHINE_END
Wang Long82fd1322014-12-24 03:09:57 +000075
Uwe Kleine-König543c5042015-02-18 21:01:45 +010076static const char *const hip01_compat[] __initconst = {
Wang Long82fd1322014-12-24 03:09:57 +000077 "hisilicon,hip01",
78 "hisilicon,hip01-ca9x2",
79 NULL,
80};
81
82DT_MACHINE_START(HIP01, "Hisilicon HIP01 (Flattened Device Tree)")
83 .dt_compat = hip01_compat,
84MACHINE_END