Lines Matching +full:bcm11351 +full:- +full:cpu +full:- +full:method
1 // SPDX-License-Identifier: GPL-2.0
3 * Copyright (C) 2014-2015 Broadcom Corporation
12 #include <linux/irqchip/irq-bcm2836.h>
34 #define OF_SECONDARY_BOOT "secondary-boot-reg"
54 return -ENXIO; in scu_a9_enable()
61 return -ENOENT; in scu_a9_enable()
68 return -ENOMEM; in scu_a9_enable()
78 static u32 secondary_boot_addr_for(unsigned int cpu) in secondary_boot_addr_for() argument
81 struct device_node *cpu_node = of_get_cpu_node(cpu, NULL); in secondary_boot_addr_for()
84 pr_err("Failed to find device tree node for CPU%u\n", cpu); in secondary_boot_addr_for()
91 pr_err("required secondary boot register not specified for CPU%u\n", in secondary_boot_addr_for()
92 cpu); in secondary_boot_addr_for()
99 static int nsp_write_lut(unsigned int cpu) in nsp_write_lut() argument
103 const u32 secondary_boot_addr = secondary_boot_addr_for(cpu); in nsp_write_lut()
106 return -EINVAL; in nsp_write_lut()
111 pr_warn("unable to ioremap SKU-ROM LUT register for cpu %u\n", cpu); in nsp_write_lut()
112 return -ENOMEM; in nsp_write_lut()
134 /* Update the CPU present map to reflect uniprocessor mode */ in bcm_smp_prepare_cpus()
135 pr_warn("failed to enable A9 SCU - disabling SMP\n"); in bcm_smp_prepare_cpus()
151 * - Encode the (hardware) CPU id with the bottom bits of the secondary
153 * - Write that value into the secondary boot register.
154 * - Generate an event to wake up the secondary CPU(s).
155 * - Wait for the secondary boot register to be re-written, which
158 static int kona_boot_secondary(unsigned int cpu, struct task_struct *idle) in kona_boot_secondary() argument
166 const u32 secondary_boot_addr = secondary_boot_addr_for(cpu); in kona_boot_secondary()
168 cpu_id = cpu_logical_map(cpu); in kona_boot_secondary()
170 pr_err("bad cpu id (%u > %u)\n", cpu_id, BOOT_ADDR_CPUID_MASK); in kona_boot_secondary()
171 return -EINVAL; in kona_boot_secondary()
175 return -EINVAL; in kona_boot_secondary()
180 pr_err("unable to map boot register for cpu %u\n", cpu_id); in kona_boot_secondary()
181 return -ENOMEM; in kona_boot_secondary()
201 timeout = local_clock() - start_clock > SECONDARY_TIMEOUT_NS; in kona_boot_secondary()
208 pr_err("timeout waiting for cpu %u to start\n", cpu_id); in kona_boot_secondary()
210 return -ENXIO; in kona_boot_secondary()
213 /* Cluster Dormant Control command to bring CPU into a running state */
216 #define CDC_CMD_REG(cpu) (CDC_CMD_OFFSET + 4*(cpu)) argument
220 * idle state. A command needs to be sent to the block to bring the CPU
223 static int bcm23550_boot_secondary(unsigned int cpu, struct task_struct *idle) in bcm23550_boot_secondary() argument
233 name = "brcm,bcm23550-cdc"; in bcm23550_boot_secondary()
237 return -ENODEV; in bcm23550_boot_secondary()
245 return -ENOMEM; in bcm23550_boot_secondary()
249 ret = kona_boot_secondary(cpu, idle); in bcm23550_boot_secondary()
253 /* Bring this CPU to RUN state so that nIRQ nFIQ in bcm23550_boot_secondary()
256 writel_relaxed(CDC_CMD, cdc_base + CDC_CMD_REG(cpu)); in bcm23550_boot_secondary()
264 static int nsp_boot_secondary(unsigned int cpu, struct task_struct *idle) in nsp_boot_secondary() argument
272 ret = nsp_write_lut(cpu); in nsp_boot_secondary()
278 /* Send a CPU wakeup interrupt to the secondary core */ in nsp_boot_secondary()
279 arch_send_wakeup_ipi_mask(cpumask_of(cpu)); in nsp_boot_secondary()
285 static int bcm2836_boot_secondary(unsigned int cpu, struct task_struct *idle) in bcm2836_boot_secondary() argument
291 name = "brcm,bcm2836-l1-intc"; in bcm2836_boot_secondary()
295 return -ENODEV; in bcm2836_boot_secondary()
303 return -ENOMEM; in bcm2836_boot_secondary()
307 intc_base + LOCAL_MAILBOX3_SET0 + 16 * cpu); in bcm2836_boot_secondary()
321 CPU_METHOD_OF_DECLARE(bcm_smp_bcm281xx, "brcm,bcm11351-cpu-method",
334 CPU_METHOD_OF_DECLARE(bcm_smp_nsp, "brcm,bcm-nsp-smp", &nsp_smp_ops);
339 CPU_METHOD_OF_DECLARE(bcm_smp_bcm2836, "brcm,bcm2836-smp", &bcm2836_smp_ops);