mirror of
https://github.com/riscv-software-src/opensbi.git
synced 2025-08-24 23:41:23 +01:00
lib: utils/fdt: Don't use sbi_string functions
When SBI is built by external firmware, we need to use their functions,
defined in libfdt_env.h.
Just like 2cfd2fc904
Signed-off-by: Daniel Schaefer <daniel.schaefer@hpe.com>
Reviewed-by: Abner Chang <abner.chang@hpe.com>
Reviewed-by: Xiang W <wxjstz@126.com>
Reviewed-by: Anup Patel <anup.patel@wdc.com>
This commit is contained in:

committed by
Anup Patel

parent
c9ef2bc7e4
commit
ee7c2b27ea
@@ -9,6 +9,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <libfdt.h>
|
#include <libfdt.h>
|
||||||
|
#include <libfdt_env.h>
|
||||||
#include <sbi/sbi_domain.h>
|
#include <sbi/sbi_domain.h>
|
||||||
#include <sbi/sbi_error.h>
|
#include <sbi/sbi_error.h>
|
||||||
#include <sbi/sbi_hartmask.h>
|
#include <sbi/sbi_hartmask.h>
|
||||||
@@ -95,7 +96,7 @@ static int __fixup_find_domain_offset(void *fdt, int doff, void *p)
|
|||||||
{
|
{
|
||||||
struct __fixup_find_domain_offset_info *fdo = p;
|
struct __fixup_find_domain_offset_info *fdo = p;
|
||||||
|
|
||||||
if (!sbi_strcmp(fdo->name, fdt_get_name(fdt, doff, NULL)))
|
if (!strcmp(fdo->name, fdt_get_name(fdt, doff, NULL)))
|
||||||
*fdo->doffset = doff;
|
*fdo->doffset = doff;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@@ -287,7 +288,7 @@ static int __fdt_parse_domain(void *fdt, int domain_offset, void *opaque)
|
|||||||
regions = &fdt_regions[fdt_domains_count][0];
|
regions = &fdt_regions[fdt_domains_count][0];
|
||||||
|
|
||||||
/* Read DT node name */
|
/* Read DT node name */
|
||||||
sbi_strncpy(dom->name, fdt_get_name(fdt, domain_offset, NULL),
|
strncpy(dom->name, fdt_get_name(fdt, domain_offset, NULL),
|
||||||
sizeof(dom->name));
|
sizeof(dom->name));
|
||||||
dom->name[sizeof(dom->name) - 1] = '\0';
|
dom->name[sizeof(dom->name) - 1] = '\0';
|
||||||
|
|
||||||
@@ -313,7 +314,7 @@ static int __fdt_parse_domain(void *fdt, int domain_offset, void *opaque)
|
|||||||
|
|
||||||
/* Setup memregions from DT */
|
/* Setup memregions from DT */
|
||||||
val32 = 0;
|
val32 = 0;
|
||||||
sbi_memset(regions, 0,
|
memset(regions, 0,
|
||||||
sizeof(*regions) * (FDT_DOMAIN_REGION_MAX_COUNT + 1));
|
sizeof(*regions) * (FDT_DOMAIN_REGION_MAX_COUNT + 1));
|
||||||
dom->regions = regions;
|
dom->regions = regions;
|
||||||
err = fdt_iterate_each_memregion(fdt, domain_offset, &val32,
|
err = fdt_iterate_each_memregion(fdt, domain_offset, &val32,
|
||||||
@@ -337,7 +338,7 @@ static int __fdt_parse_domain(void *fdt, int domain_offset, void *opaque)
|
|||||||
continue;
|
continue;
|
||||||
if (FDT_DOMAIN_REGION_MAX_COUNT <= val32)
|
if (FDT_DOMAIN_REGION_MAX_COUNT <= val32)
|
||||||
return SBI_EINVAL;
|
return SBI_EINVAL;
|
||||||
sbi_memcpy(®ions[val32++], reg, sizeof(*reg));
|
memcpy(®ions[val32++], reg, sizeof(*reg));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Read "boot-hart" DT property */
|
/* Read "boot-hart" DT property */
|
||||||
|
Reference in New Issue
Block a user