Lines Matching +full:cpu +full:- +full:read

1 // SPDX-License-Identifier: GPL-2.0-or-later
5 * Copyright (c) 2011-2013 Xilinx Inc.
18 #define SLCR_A9_CPU_RST_CTRL_OFFSET 0x244 /* CPU Software Reset Control */
33 * zynq_slcr_write - Write to a register in SLCR block
46 * zynq_slcr_read - Read a register in SLCR block
48 * @val: Pointer to value to be read from SLCR
59 * zynq_slcr_unlock - Unlock SLCR registers
71 * zynq_slcr_get_device_id - Read device code id
87 * zynq_slcr_system_restart - Restart the entire system.
103 * the FSBL not loading the bitstream after soft-reboot in zynq_slcr_system_restart()
118 * zynq_slcr_cpu_start - Start cpu
119 * @cpu: cpu number
121 void zynq_slcr_cpu_start(int cpu) in zynq_slcr_cpu_start() argument
126 reg &= ~(SLCR_A9_CPU_RST << cpu); in zynq_slcr_cpu_start()
128 reg &= ~(SLCR_A9_CPU_CLKSTOP << cpu); in zynq_slcr_cpu_start()
131 zynq_slcr_cpu_state_write(cpu, false); in zynq_slcr_cpu_start()
135 * zynq_slcr_cpu_stop - Stop cpu
136 * @cpu: cpu number
138 void zynq_slcr_cpu_stop(int cpu) in zynq_slcr_cpu_stop() argument
143 reg |= (SLCR_A9_CPU_CLKSTOP | SLCR_A9_CPU_RST) << cpu; in zynq_slcr_cpu_stop()
148 * zynq_slcr_cpu_state_read - Read cpu state
149 * @cpu: cpu number
151 * SLCR_REBOOT_STATUS save upper 2 bits (31/30 cpu states for cpu0 and cpu1)
152 * 0 means cpu is running, 1 cpu is going to die.
154 * Return: true if cpu is running, false if cpu is going to die
156 bool zynq_slcr_cpu_state_read(int cpu) in zynq_slcr_cpu_state_read() argument
161 state &= 1 << (31 - cpu); in zynq_slcr_cpu_state_read()
167 * zynq_slcr_cpu_state_write - Write cpu state
168 * @cpu: cpu number
169 * @die: cpu state - true if cpu is going to die
171 * SLCR_REBOOT_STATUS save upper 2 bits (31/30 cpu states for cpu0 and cpu1)
172 * 0 means cpu is running, 1 cpu is going to die.
174 void zynq_slcr_cpu_state_write(int cpu, bool die) in zynq_slcr_cpu_state_write() argument
179 mask = 1 << (31 - cpu); in zynq_slcr_cpu_state_write()
188 * zynq_early_slcr_init - Early slcr init function
198 np = of_find_compatible_node(NULL, NULL, "xlnx,zynq-slcr"); in zynq_early_slcr_init()
210 np->data = (__force void *)zynq_slcr_base; in zynq_early_slcr_init()
212 zynq_slcr_regmap = syscon_regmap_lookup_by_compatible("xlnx,zynq-slcr"); in zynq_early_slcr_init()
214 pr_err("%s: failed to find zynq-slcr\n", __func__); in zynq_early_slcr_init()
216 return -ENODEV; in zynq_early_slcr_init()