Lines Matching +full:pmu +full:- +full:sram

1 // SPDX-License-Identifier: GPL-2.0-or-later
35 static struct regmap *pmu; variable
43 ret = regmap_read(pmu, PMU_PWRDN_ST, &val); in pmu_power_domain_is_on()
57 np = dev->of_node; in rockchip_get_core_reset()
85 ret = regmap_update_bits(pmu, PMU_PWRDN_CON, BIT(pd), val); in pmu_set_power_domain()
92 ret = -1; in pmu_set_power_domain()
120 if (!sram_base_addr || (has_pmu && !pmu)) { in rockchip_boot_secondary()
121 pr_err("%s: sram or pmu missing for cpu boot\n", __func__); in rockchip_boot_secondary()
122 return -ENXIO; in rockchip_boot_secondary()
128 return -ENXIO; in rockchip_boot_secondary()
146 * (e.g: cpu frequency, bootrom frequency, sram frequency, ...) in rockchip_boot_secondary()
159 * rockchip_smp_prepare_sram - populate necessary sram block
160 * Starting cores execute the code residing at the start of the on-chip sram
161 * after power-on. Therefore make sure, this sram region is reserved and
163 * core to the real startup code in ram into the sram-region.
164 * @node: mmio-sram device node
168 unsigned int trampoline_sz = &rockchip_secondary_trampoline_end - in rockchip_smp_prepare_sram()
185 return -EINVAL; in rockchip_smp_prepare_sram()
188 /* set the boot function for the sram code */ in rockchip_smp_prepare_sram()
191 /* copy the trampoline to sram, that runs during startup of the core */ in rockchip_smp_prepare_sram()
202 .name = "rockchip-pmu",
214 * This function is only called via smp_ops->smp_prepare_cpu(). in rockchip_smp_prepare_pmu()
216 * and has an "enable-method" property that selects the SMP in rockchip_smp_prepare_pmu()
221 pmu = syscon_regmap_lookup_by_phandle(node, "rockchip,pmu"); in rockchip_smp_prepare_pmu()
223 if (!IS_ERR(pmu)) in rockchip_smp_prepare_pmu()
226 pmu = syscon_regmap_lookup_by_compatible("rockchip,rk3066-pmu"); in rockchip_smp_prepare_pmu()
227 if (!IS_ERR(pmu)) in rockchip_smp_prepare_pmu()
230 /* fallback, create our own regmap for the pmu area */ in rockchip_smp_prepare_pmu()
231 pmu = NULL; in rockchip_smp_prepare_pmu()
232 node = of_find_compatible_node(NULL, NULL, "rockchip,rk3066-pmu"); in rockchip_smp_prepare_pmu()
234 pr_err("%s: could not find pmu dt node\n", __func__); in rockchip_smp_prepare_pmu()
235 return -ENODEV; in rockchip_smp_prepare_pmu()
241 pr_err("%s: could not map pmu registers\n", __func__); in rockchip_smp_prepare_pmu()
242 return -ENOMEM; in rockchip_smp_prepare_pmu()
245 pmu = regmap_init_mmio(NULL, pmu_base, &rockchip_pmu_regmap_config); in rockchip_smp_prepare_pmu()
246 if (IS_ERR(pmu)) { in rockchip_smp_prepare_pmu()
247 int ret = PTR_ERR(pmu); in rockchip_smp_prepare_pmu()
250 pmu = NULL; in rockchip_smp_prepare_pmu()
263 node = of_find_compatible_node(NULL, NULL, "rockchip,rk3066-smp-sram"); in rockchip_smp_prepare_cpus()
265 pr_err("%s: could not find sram dt node\n", __func__); in rockchip_smp_prepare_cpus()
271 pr_err("%s: could not map sram registers\n", __func__); in rockchip_smp_prepare_cpus()
291 node = of_find_compatible_node(NULL, NULL, "arm,cortex-a9-scu"); in rockchip_smp_prepare_cpus()
373 CPU_METHOD_OF_DECLARE(rk3036_smp, "rockchip,rk3036-smp", &rk3036_smp_ops);
374 CPU_METHOD_OF_DECLARE(rk3066_smp, "rockchip,rk3066-smp", &rockchip_smp_ops);