This commit is contained in:
@@ -64,6 +64,10 @@ static inline phys_addr_t map_to_sysmem(const void *ptr)
|
||||
#define __raw_readl(a) __arch_getl(a)
|
||||
#define __raw_readq(a) __arch_getq(a)
|
||||
|
||||
/* adding for cadence_qspi_apb.c */
|
||||
#define memcpy_fromio(a, c, l) memcpy((a), (c), (l))
|
||||
#define memcpy_toio(c, a, l) memcpy((c), (a), (l))
|
||||
|
||||
#define dmb() mb()
|
||||
#define __iormb() rmb()
|
||||
#define __iowmb() wmb()
|
||||
|
||||
@@ -152,6 +152,7 @@ void sbi_remote_sfence_vma_asid(const unsigned long *hart_mask,
|
||||
void sbi_set_timer(uint64_t stime_value);
|
||||
long sbi_get_spec_version(void);
|
||||
int sbi_get_impl_id(void);
|
||||
int sbi_get_impl_version(long *version);
|
||||
int sbi_probe_extension(int ext);
|
||||
void sbi_srst_reset(unsigned long type, unsigned long reason);
|
||||
|
||||
|
||||
@@ -89,6 +89,25 @@ int sbi_get_impl_id(void)
|
||||
return -ENOTSUPP;
|
||||
}
|
||||
|
||||
/**
|
||||
* sbi_get_impl_version() - get SBI implementation version
|
||||
*
|
||||
* @version: pointer to receive version
|
||||
* Return: 0 on success, -ENOTSUPP otherwise
|
||||
*/
|
||||
int sbi_get_impl_version(long *version)
|
||||
{
|
||||
struct sbiret ret;
|
||||
|
||||
ret = sbi_ecall(SBI_EXT_BASE, SBI_EXT_BASE_GET_IMP_VERSION,
|
||||
0, 0, 0, 0, 0, 0);
|
||||
if (ret.error)
|
||||
return -ENOTSUPP;
|
||||
if (version)
|
||||
*version = ret.value;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* sbi_probe_extension() - Check if an SBI extension ID is supported or not.
|
||||
* @extid: The extension ID to be probed.
|
||||
|
||||
@@ -57,9 +57,9 @@ ulong board_flash_get_legacy(ulong base, int banknum, flash_info_t *info)
|
||||
void *board_fdt_blob_setup(int *err)
|
||||
{
|
||||
*err = 0;
|
||||
#if CONFIG_IS_ENABLED(OF_BOARD)
|
||||
#if defined(CONFIG_OF_BOARD)
|
||||
return (void *)(ulong)gd->arch.firmware_fdt_addr;
|
||||
#elif CONFIG_IS_ENABLED(OF_SEPARATE)
|
||||
#elif defined(CONFIG_OF_SEPARATE)
|
||||
return (void *)CONFIG_SYS_FDT_BASE;
|
||||
#else
|
||||
*err = -EINVAL;
|
||||
|
||||
@@ -49,24 +49,34 @@ static struct sbi_ext extensions[] = {
|
||||
static int do_sbi(struct cmd_tbl *cmdtp, int flag, int argc,
|
||||
char *const argv[])
|
||||
{
|
||||
int i;
|
||||
int i, impl_id;
|
||||
long ret;
|
||||
|
||||
ret = sbi_get_spec_version();
|
||||
if (ret >= 0)
|
||||
printf("SBI %ld.%ld\n", ret >> 24, ret & 0xffffff);
|
||||
ret = sbi_get_impl_id();
|
||||
if (ret >= 0) {
|
||||
printf("SBI %ld.%ld", ret >> 24, ret & 0xffffff);
|
||||
impl_id = sbi_get_impl_id();
|
||||
if (impl_id >= 0) {
|
||||
for (i = 0; i < ARRAY_SIZE(implementations); ++i) {
|
||||
if (ret == implementations[i].id) {
|
||||
printf("%s\n", implementations[i].name);
|
||||
if (impl_id == implementations[i].id) {
|
||||
long vers;
|
||||
|
||||
printf("\n%s ", implementations[i].name);
|
||||
ret = sbi_get_impl_version(&vers);
|
||||
if (ret < 0)
|
||||
break;
|
||||
if (impl_id == 1)
|
||||
printf("%ld.%ld",
|
||||
vers >> 16, vers & 0xffff);
|
||||
else
|
||||
printf("0x%lx", vers);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (i == ARRAY_SIZE(implementations))
|
||||
printf("Unknown implementation ID %ld\n", ret);
|
||||
printf("Unknown implementation ID %ld", ret);
|
||||
}
|
||||
printf("Extensions:\n");
|
||||
printf("\nExtensions:\n");
|
||||
for (i = 0; i < ARRAY_SIZE(extensions); ++i) {
|
||||
ret = sbi_probe_extension(extensions[i].id);
|
||||
if (ret > 0)
|
||||
|
||||
@@ -898,7 +898,7 @@ int boot_get_kbd(struct lmb *lmb, struct bd_info **kbd)
|
||||
debug("## kernel board info at 0x%08lx\n", (ulong)*kbd);
|
||||
|
||||
#if defined(DEBUG)
|
||||
if (IS_ENABLED(CONFIG_CMD_BDI)
|
||||
if (IS_ENABLED(CONFIG_CMD_BDI))
|
||||
do_bdinfo(NULL, 0, 0, NULL);
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user