while (end > start) {
csr_write(AX45MP_CCTL_REG_UCCTLBEGINADDR_NUM, start);
csr_write(AX45MP_CCTL_REG_UCCTLCOMMAND_NUM, l1_op);
pa = virt_to_phys((void *)start);
writel(pa, base + AX45MP_L2C_REG_CN_ACC_OFFSET(mhartid));
writel(l2_op, base + AX45MP_L2C_REG_CN_CMD_OFFSET(mhartid)); while ((ax45mp_cpu_l2c_get_cctl_status() &
AX45MP_CCTL_L2_STATUS_CN_MASK(mhartid)) !=
AX45MP_CCTL_L2_STATUS_IDLE)
;
staticint ax45mp_get_l2_line_size(struct device_node *np)
{ int ret;
ret = of_property_read_u32(np, "cache-line-size", &ax45mp_priv.ax45mp_cache_line_size); if (ret) {
pr_err("Failed to get cache-line-size, defaulting to 64 bytes\n"); return ret;
}
if (ax45mp_priv.ax45mp_cache_line_size != AX45MP_CACHE_LINE_SIZE) {
pr_err("Expected cache-line-size to be 64 bytes (found:%u)\n",
ax45mp_priv.ax45mp_cache_line_size); return -EINVAL;
}
np = of_find_matching_node(NULL, ax45mp_cache_ids); if (!of_device_is_available(np)) return -ENODEV;
ret = of_address_to_resource(np, 0, &res); if (ret) return ret;
/* * If IOCP is present on the Andes AX45MP core riscv_cbom_block_size * will be 0 for sure, so we can definitely rely on it. If * riscv_cbom_block_size = 0 we don't need to handle CMO using SW any * more so we just return success here and only if its being set we * continue further in the probe path.
*/ if (!riscv_cbom_block_size) return 0;
ax45mp_priv.l2c_base = ioremap(res.start, resource_size(&res)); if (!ax45mp_priv.l2c_base) return -ENOMEM;
ret = ax45mp_get_l2_line_size(np); if (ret) {
iounmap(ax45mp_priv.l2c_base); return ret;
}
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.