2 * Copyright (C) 2015-2016 Wills Wang <wills.wang@live.com>
4 * SPDX-License-Identifier: GPL-2.0+
9 #include <asm/addrspace.h>
10 #include <asm/types.h>
11 #include <mach/ath79.h>
12 #include <mach/ar71xx_regs.h>
14 void _machine_restart(void)
19 base = map_physmem(AR71XX_RESET_BASE, AR71XX_RESET_SIZE,
22 reg = AR71XX_RESET_REG_RESET_MODULE;
23 else if (soc_is_ar724x())
24 reg = AR724X_RESET_REG_RESET_MODULE;
25 else if (soc_is_ar913x())
26 reg = AR913X_RESET_REG_RESET_MODULE;
27 else if (soc_is_ar933x())
28 reg = AR933X_RESET_REG_RESET_MODULE;
29 else if (soc_is_ar934x())
30 reg = AR934X_RESET_REG_RESET_MODULE;
31 else if (soc_is_qca953x())
32 reg = QCA953X_RESET_REG_RESET_MODULE;
33 else if (soc_is_qca955x())
34 reg = QCA955X_RESET_REG_RESET_MODULE;
35 else if (soc_is_qca956x())
36 reg = QCA956X_RESET_REG_RESET_MODULE;
38 puts("Reset register not defined for this SOC\n");
41 setbits_be32(base + reg, AR71XX_RESET_FULL_CHIP);
47 u32 get_bootstrap(void)
52 base = map_physmem(AR71XX_RESET_BASE, AR71XX_RESET_SIZE,
55 reg = AR933X_RESET_REG_BOOTSTRAP;
56 else if (soc_is_ar934x())
57 reg = AR934X_RESET_REG_BOOTSTRAP;
58 else if (soc_is_qca953x())
59 reg = QCA953X_RESET_REG_BOOTSTRAP;
60 else if (soc_is_qca955x())
61 reg = QCA955X_RESET_REG_BOOTSTRAP;
62 else if (soc_is_qca956x())
63 reg = QCA956X_RESET_REG_BOOTSTRAP;
65 puts("Bootstrap register not defined for this SOC\n");
68 return readl(base + reg);