hc
2024-05-13 9d77db3c730780c8ef5ccd4b66403ff5675cfe4e
kernel/arch/arm/mach-socfpga/socfpga.c
....@@ -1,24 +1,13 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * Copyright (C) 2012-2015 Altera Corporation
3
- *
4
- * This program is free software; you can redistribute it and/or modify
5
- * it under the terms of the GNU General Public License as published by
6
- * the Free Software Foundation; either version 2 of the License, or
7
- * (at your option) any later version.
8
- *
9
- * This program is distributed in the hope that it will be useful,
10
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
- * GNU General Public License for more details.
13
- *
14
- * You should have received a copy of the GNU General Public License
15
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
164 */
175 #include <linux/irqchip.h>
186 #include <linux/of_address.h>
197 #include <linux/of_irq.h>
208 #include <linux/of_platform.h>
219 #include <linux/reboot.h>
10
+#include <linux/reset/socfpga.h>
2211
2312 #include <asm/hardware/cache-l2x0.h>
2413 #include <asm/mach/arch.h>
....@@ -32,7 +21,7 @@
3221 void __iomem *sdr_ctl_base_addr;
3322 unsigned long socfpga_cpu1start_addr;
3423
35
-void __init socfpga_sysmgr_init(void)
24
+static void __init socfpga_sysmgr_init(void)
3625 {
3726 struct device_node *np;
3827
....@@ -64,6 +53,7 @@
6453
6554 if (IS_ENABLED(CONFIG_EDAC_ALTERA_OCRAM))
6655 socfpga_init_ocram_ecc();
56
+ socfpga_reset_init();
6757 }
6858
6959 static void __init socfpga_arria10_init_irq(void)
....@@ -74,6 +64,7 @@
7464 socfpga_init_arria10_l2_ecc();
7565 if (IS_ENABLED(CONFIG_EDAC_ALTERA_OCRAM))
7666 socfpga_init_arria10_ocram_ecc();
67
+ socfpga_reset_init();
7768 }
7869
7970 static void socfpga_cyclone5_restart(enum reboot_mode mode, const char *cmd)
....@@ -82,10 +73,10 @@
8273
8374 temp = readl(rst_manager_base_addr + SOCFPGA_RSTMGR_CTRL);
8475
85
- if (mode == REBOOT_HARD)
86
- temp |= RSTMGR_CTRL_SWCOLDRSTREQ;
87
- else
76
+ if (mode == REBOOT_WARM)
8877 temp |= RSTMGR_CTRL_SWWARMRSTREQ;
78
+ else
79
+ temp |= RSTMGR_CTRL_SWCOLDRSTREQ;
8980 writel(temp, rst_manager_base_addr + SOCFPGA_RSTMGR_CTRL);
9081 }
9182
....@@ -95,10 +86,10 @@
9586
9687 temp = readl(rst_manager_base_addr + SOCFPGA_A10_RSTMGR_CTRL);
9788
98
- if (mode == REBOOT_HARD)
99
- temp |= RSTMGR_CTRL_SWCOLDRSTREQ;
100
- else
89
+ if (mode == REBOOT_WARM)
10190 temp |= RSTMGR_CTRL_SWWARMRSTREQ;
91
+ else
92
+ temp |= RSTMGR_CTRL_SWCOLDRSTREQ;
10293 writel(temp, rst_manager_base_addr + SOCFPGA_A10_RSTMGR_CTRL);
10394 }
10495