1
2
3
4
5
6
7
8
9
10
11
12
13
14#include <linux/clocksource.h>
15#include <linux/of_address.h>
16
17#include <asm/mach/arch.h>
18
19#include "kona_l2_cache.h"
20
21#define SECWDOG_OFFSET 0x00000000
22#define SECWDOG_RESERVED_MASK 0xe2000000
23#define SECWDOG_WD_LOAD_FLAG_MASK 0x10000000
24#define SECWDOG_EN_MASK 0x08000000
25#define SECWDOG_SRSTEN_MASK 0x04000000
26#define SECWDOG_CLKS_SHIFT 20
27#define SECWDOG_COUNT_SHIFT 0
28
29static void bcm281xx_restart(enum reboot_mode mode, const char *cmd)
30{
31 uint32_t val;
32 void __iomem *base;
33 struct device_node *np_wdog;
34
35 np_wdog = of_find_compatible_node(NULL, NULL, "brcm,kona-wdt");
36 if (!np_wdog) {
37 pr_emerg("Couldn't find brcm,kona-wdt\n");
38 return;
39 }
40 base = of_iomap(np_wdog, 0);
41 of_node_put(np_wdog);
42 if (!base) {
43 pr_emerg("Couldn't map brcm,kona-wdt\n");
44 return;
45 }
46
47
48 val = readl(base + SECWDOG_OFFSET);
49 val &= SECWDOG_RESERVED_MASK | SECWDOG_WD_LOAD_FLAG_MASK;
50 val |= SECWDOG_EN_MASK | SECWDOG_SRSTEN_MASK |
51 (0x15 << SECWDOG_CLKS_SHIFT) |
52 (0x8 << SECWDOG_COUNT_SHIFT);
53 writel(val, base + SECWDOG_OFFSET);
54
55
56 while (1);
57}
58
59static void __init bcm281xx_init(void)
60{
61 kona_l2_cache_init();
62}
63
64static const char * const bcm281xx_dt_compat[] = {
65 "brcm,bcm11351",
66 NULL,
67};
68
69DT_MACHINE_START(BCM281XX_DT, "BCM281xx Broadcom Application Processor")
70 .init_machine = bcm281xx_init,
71 .restart = bcm281xx_restart,
72 .dt_compat = bcm281xx_dt_compat,
73MACHINE_END
74