Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'zynq-soc-for-4.2' of https://github.com/Xilinx/linux-xlnx into next/soc

Merge "arm: Xilinx Zynq SoC patches for v4.2" from Michal Simek:

- Change SoC reset path
- Fix SLCR unlock scheme

* tag 'zynq-soc-for-4.2' of https://github.com/Xilinx/linux-xlnx:
ARM: zynq: Drop use of slcr_unlock in zynq_slcr_system_restart
ARM: zynq: Use restart_handler mechanism for slcr reset

+19 -16
-6
arch/arm/mach-zynq/common.c
··· 190 190 irqchip_init(); 191 191 } 192 192 193 - static void zynq_system_reset(enum reboot_mode mode, const char *cmd) 194 - { 195 - zynq_slcr_system_reset(); 196 - } 197 - 198 193 static const char * const zynq_dt_match[] = { 199 194 "xlnx,zynq-7000", 200 195 NULL ··· 207 212 .init_time = zynq_timer_init, 208 213 .dt_compat = zynq_dt_match, 209 214 .reserve = zynq_memory_init, 210 - .restart = zynq_system_reset, 211 215 MACHINE_END
-1
arch/arm/mach-zynq/common.h
··· 21 21 22 22 extern int zynq_slcr_init(void); 23 23 extern int zynq_early_slcr_init(void); 24 - extern void zynq_slcr_system_reset(void); 25 24 extern void zynq_slcr_cpu_stop(int cpu); 26 25 extern void zynq_slcr_cpu_start(int cpu); 27 26 extern bool zynq_slcr_cpu_state_read(int cpu);
+19 -9
arch/arm/mach-zynq/slcr.c
··· 15 15 */ 16 16 17 17 #include <linux/io.h> 18 + #include <linux/reboot.h> 18 19 #include <linux/mfd/syscon.h> 19 20 #include <linux/of_address.h> 20 21 #include <linux/regmap.h> ··· 93 92 } 94 93 95 94 /** 96 - * zynq_slcr_system_reset - Reset the entire system. 95 + * zynq_slcr_system_restart - Restart the entire system. 96 + * 97 + * @nb: Pointer to restart notifier block (unused) 98 + * @action: Reboot mode (unused) 99 + * @data: Restart handler private data (unused) 100 + * 101 + * Return: 0 always 97 102 */ 98 - void zynq_slcr_system_reset(void) 103 + static 104 + int zynq_slcr_system_restart(struct notifier_block *nb, 105 + unsigned long action, void *data) 99 106 { 100 107 u32 reboot; 101 - 102 - /* 103 - * Unlock the SLCR then reset the system. 104 - * Note that this seems to require raw i/o 105 - * functions or there's a lockup? 106 - */ 107 - zynq_slcr_unlock(); 108 108 109 109 /* 110 110 * Clear 0x0F000000 bits of reboot status register to workaround ··· 115 113 zynq_slcr_read(&reboot, SLCR_REBOOT_STATUS_OFFSET); 116 114 zynq_slcr_write(reboot & 0xF0FFFFFF, SLCR_REBOOT_STATUS_OFFSET); 117 115 zynq_slcr_write(1, SLCR_PS_RST_CTRL_OFFSET); 116 + return 0; 118 117 } 118 + 119 + static struct notifier_block zynq_slcr_restart_nb = { 120 + .notifier_call = zynq_slcr_system_restart, 121 + .priority = 192, 122 + }; 119 123 120 124 /** 121 125 * zynq_slcr_cpu_start - Start cpu ··· 226 218 227 219 /* unlock the SLCR so that registers can be changed */ 228 220 zynq_slcr_unlock(); 221 + 222 + register_restart_handler(&zynq_slcr_restart_nb); 229 223 230 224 pr_info("%s mapped to %p\n", np->name, zynq_slcr_base); 231 225