summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAnup Patel <[email protected]>2024-09-20 10:14:46 +0530
committerAnup Patel <[email protected]>2024-10-25 22:59:54 +0530
commit8576ca423403cdff66424d8f360542aafe71c901 (patch)
tree49666e9fa06675206bfbe75a7c165d0d7602c3eb /lib
parent2ffa0a153d804910c20b82974bfe2dedcf35a777 (diff)
lib: utils/ipi: Use sbi_domain_root_add_memrange() for ACLINT mswi
The sbi_domain_root_add_memrange() should be preferred for creating multiple memregions over a range. Update ACLINT mswi driver to use sbi_domain_root_add_memrange() instead of explicitly registering memregions. Signed-off-by: Anup Patel <[email protected]> Reviewed-by: Samuel Holland <[email protected]>
Diffstat (limited to 'lib')
-rw-r--r--lib/utils/ipi/aclint_mswi.c20
1 files changed, 6 insertions, 14 deletions
diff --git a/lib/utils/ipi/aclint_mswi.c b/lib/utils/ipi/aclint_mswi.c
index c8ebb7ac..0ef3d003 100644
--- a/lib/utils/ipi/aclint_mswi.c
+++ b/lib/utils/ipi/aclint_mswi.c
@@ -84,8 +84,6 @@ int aclint_mswi_cold_init(struct aclint_mswi_data *mswi)
u32 i;
int rc;
struct sbi_scratch *scratch;
- unsigned long pos, region_size;
- struct sbi_domain_memregion reg;
/* Sanity checks */
if (!mswi || (mswi->addr & (ACLINT_MSWI_ALIGN - 1)) ||
@@ -114,18 +112,12 @@ int aclint_mswi_cold_init(struct aclint_mswi_data *mswi)
}
/* Add MSWI regions to the root domain */
- for (pos = 0; pos < mswi->size; pos += ACLINT_MSWI_ALIGN) {
- region_size = ((mswi->size - pos) < ACLINT_MSWI_ALIGN) ?
- (mswi->size - pos) : ACLINT_MSWI_ALIGN;
- sbi_domain_memregion_init(mswi->addr + pos, region_size,
- (SBI_DOMAIN_MEMREGION_MMIO |
- SBI_DOMAIN_MEMREGION_M_READABLE |
- SBI_DOMAIN_MEMREGION_M_WRITABLE),
- &reg);
- rc = sbi_domain_root_add_memregion(&reg);
- if (rc)
- return rc;
- }
+ rc = sbi_domain_root_add_memrange(mswi->addr, mswi->size, ACLINT_MSWI_ALIGN,
+ SBI_DOMAIN_MEMREGION_MMIO |
+ SBI_DOMAIN_MEMREGION_M_READABLE |
+ SBI_DOMAIN_MEMREGION_M_WRITABLE);
+ if (rc)
+ return rc;
sbi_ipi_set_device(&aclint_mswi);