summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2022-12-12 20:11:20 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2022-12-12 20:11:20 +0100
commit9917db36e42acac81ff914faf19af3d95e90e327 (patch)
tree4658ad2da6ec3f47aa41612773194d257e180c5d /common
parentca188ad0da3b95ee99eab57187f995492bf259eb (diff)
parent3ec12bd4de20561bef8ecb4989c900a061e925d0 (diff)
downloadbarebox-9917db36e42acac81ff914faf19af3d95e90e327.tar.gz
barebox-9917db36e42acac81ff914faf19af3d95e90e327.tar.xz
Merge branch 'for-next/misc'
Diffstat (limited to 'common')
-rw-r--r--common/Kconfig4
-rw-r--r--common/Makefile2
-rw-r--r--common/boards/qemu-virt/overlay-of-flash.dts4
-rw-r--r--common/bootsource.c14
4 files changed, 16 insertions, 8 deletions
diff --git a/common/Kconfig b/common/Kconfig
index fb2bf49683..19cd793110 100644
--- a/common/Kconfig
+++ b/common/Kconfig
@@ -27,7 +27,7 @@ config HAS_DMA
Drivers that depend on a DMA implementation can depend on this
config, so that you don't get a compilation error.
-config HAS_ARCH_SJLJ
+config ARCH_HAS_SJLJ
bool
help
Architecture has support implemented for setjmp()/longjmp()/initjmp()
@@ -1004,7 +1004,7 @@ config POLLER
config BTHREAD
bool "barebox co-operative (green) thread infrastructure"
select HAS_SCHED
- depends on HAS_ARCH_SJLJ
+ depends on ARCH_HAS_SJLJ
help
barebox threads are lightweight cooperative (green) threads that are
scheduled within delay loops and the console idle to asynchronously
diff --git a/common/Makefile b/common/Makefile
index 35f2120496..25f5653f90 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -11,7 +11,7 @@ obj-y += startup.o
obj-y += misc.o
obj-pbl-y += memsize.o
obj-y += resource.o
-obj-y += bootsource.o
+obj-pbl-y += bootsource.o
obj-$(CONFIG_ELF) += elf.o
obj-y += restart.o
obj-y += poweroff.o
diff --git a/common/boards/qemu-virt/overlay-of-flash.dts b/common/boards/qemu-virt/overlay-of-flash.dts
index ace2c7026b..3f2beaac37 100644
--- a/common/boards/qemu-virt/overlay-of-flash.dts
+++ b/common/boards/qemu-virt/overlay-of-flash.dts
@@ -4,8 +4,8 @@
/plugin/;
#ifdef RISCV_VIRT
-#define PARTS_TARGET_PATH "/soc/flash@20000000"
-#define ENV_DEVICE_PATH "/soc/flash@20000000/partitions/partition@3c00000"
+#define PARTS_TARGET_PATH "/flash@20000000"
+#define ENV_DEVICE_PATH "/flash@20000000/partitions/partition@3c00000"
#else
#define PARTS_TARGET_PATH "/flash@0"
#define ENV_DEVICE_PATH "/flash@0/partitions/partition@3c00000"
diff --git a/common/bootsource.c b/common/bootsource.c
index 70bac945de..66bddf2dac 100644
--- a/common/bootsource.c
+++ b/common/bootsource.c
@@ -10,7 +10,7 @@
#include <magicvar.h>
#include <init.h>
-static const char *bootsource_str[] = {
+static const char *bootsource_str[BOOTSOURCE_MAX] = {
[BOOTSOURCE_UNKNOWN] = "unknown",
[BOOTSOURCE_NAND] = "nand",
[BOOTSOURCE_NOR] = "nor",
@@ -33,6 +33,14 @@ static enum bootsource bootsource = BOOTSOURCE_UNKNOWN;
static int bootsource_instance = BOOTSOURCE_INSTANCE_UNKNOWN;
const char *bootsource_alias_name = NULL;
+const char *bootsource_to_string(enum bootsource src)
+{
+ if (src >= ARRAY_SIZE(bootsource_str))
+ return NULL;
+
+ return bootsource_str[src];
+}
+
const char *bootsource_get_alias_stem(enum bootsource src)
{
switch (src) {
@@ -107,12 +115,12 @@ void bootsource_set_alias_name(const char *name)
void bootsource_set_raw(enum bootsource src, int instance)
{
- if (src >= ARRAY_SIZE(bootsource_str))
+ if (src >= BOOTSOURCE_MAX)
src = BOOTSOURCE_UNKNOWN;
bootsource = src;
- setenv("bootsource", bootsource_str[src]);
+ setenv("bootsource", bootsource_to_string(src));
bootsource_set_raw_instance(instance);
}