2 * Keystone2 based boards and SOC related code.
4 * Copyright 2013 Texas Instruments, Inc.
5 * Cyril Chemparathy <cyril@ti.com>
6 * Santosh Shilimkar <santosh.shillimkar@ti.com>
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms and conditions of the GNU General Public License,
10 * version 2, as published by the Free Software Foundation.
14 #include <linux/init.h>
15 #include <linux/of_platform.h>
16 #include <linux/of_address.h>
18 #include <asm/setup.h>
19 #include <asm/mach/map.h>
20 #include <asm/mach/arch.h>
21 #include <asm/mach/time.h>
22 #include <asm/smp_plat.h>
26 #define PLL_RESET_WRITE_KEY_MASK 0xffff0000
27 #define PLL_RESET_WRITE_KEY 0x5a69
28 #define PLL_RESET BIT(16)
30 static void __iomem
*keystone_rstctrl
;
32 static void __init
keystone_init(void)
34 struct device_node
*node
;
36 node
= of_find_compatible_node(NULL
, NULL
, "ti,keystone-reset");
38 pr_warn("ti,keystone-reset node undefined\n");
40 keystone_rstctrl
= of_iomap(node
, 0);
41 if (WARN_ON(!keystone_rstctrl
))
42 pr_warn("ti,keystone-reset iomap error\n");
44 keystone_pm_runtime_init();
45 of_platform_populate(NULL
, of_default_bus_match_table
, NULL
, NULL
);
48 static const char *keystone_match
[] __initconst
= {
53 void keystone_restart(enum reboot_mode mode
, const char *cmd
)
57 BUG_ON(!keystone_rstctrl
);
59 /* Enable write access to RSTCTRL */
60 val
= readl(keystone_rstctrl
);
61 val
&= PLL_RESET_WRITE_KEY_MASK
;
62 val
|= PLL_RESET_WRITE_KEY
;
63 writel(val
, keystone_rstctrl
);
66 val
= readl(keystone_rstctrl
);
68 writel(val
, keystone_rstctrl
);
71 DT_MACHINE_START(KEYSTONE
, "Keystone")
72 #if defined(CONFIG_ZONE_DMA) && defined(CONFIG_ARM_LPAE)
73 .dma_zone_size
= SZ_2G
,
75 .smp
= smp_ops(keystone_smp_ops
),
76 .init_machine
= keystone_init
,
77 .dt_compat
= keystone_match
,
78 .restart
= keystone_restart
,