if (cluster >= HIP04_MAX_CLUSTERS ||
cpu >= HIP04_MAX_CPUS_PER_CLUSTER) {
pr_err("%s: boot CPU is out of bound!\n", __func__); returnfalse;
}
hip04_set_snoop_filter(cluster, 1);
hip04_cpu_table[cluster][cpu] = 1; returntrue;
}
staticint __init hip04_smp_init(void)
{ struct device_node *np, *np_sctl, *np_fab; struct resource fab_res; void __iomem *relocation; int ret = -ENODEV;
np = of_find_compatible_node(NULL, NULL, "hisilicon,hip04-bootwrapper"); if (!np) goto err;
ret = of_property_read_u32_array(np, "boot-method",
&hip04_boot_method[0], 4); if (ret) goto err;
ret = -ENODEV;
np_sctl = of_find_compatible_node(NULL, NULL, "hisilicon,sysctrl"); if (!np_sctl) goto err;
np_fab = of_find_compatible_node(NULL, NULL, "hisilicon,hip04-fabric"); if (!np_fab) goto err;
ret = memblock_reserve(hip04_boot_method[0], hip04_boot_method[1]); if (ret) goto err;
relocation = ioremap(hip04_boot_method[2], hip04_boot_method[3]); if (!relocation) {
pr_err("failed to map relocation space\n");
ret = -ENOMEM; goto err_reloc;
}
sysctrl = of_iomap(np_sctl, 0); if (!sysctrl) {
pr_err("failed to get sysctrl base\n");
ret = -ENOMEM; goto err_sysctrl;
}
ret = of_address_to_resource(np_fab, 0, &fab_res); if (ret) {
pr_err("failed to get fabric base phys\n"); goto err_fabric;
}
fabric_phys_addr = fab_res.start;
sync_cache_w(&fabric_phys_addr);
fabric = of_iomap(np_fab, 0); if (!fabric) {
pr_err("failed to get fabric base\n");
ret = -ENOMEM; goto err_fabric;
}
if (!hip04_cpu_table_init()) {
ret = -EINVAL; goto err_table;
}
/* * Fill the instruction address that is used after secondary core * out of reset.
*/
writel_relaxed(hip04_boot_method[0], relocation);
writel_relaxed(0xa5a5a5a5, relocation + 4); /* magic number */
writel_relaxed(__pa_symbol(secondary_startup), relocation + 8);
writel_relaxed(0, relocation + 12);
iounmap(relocation);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.