diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2022-01-19 09:26:42 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2022-01-19 09:26:42 +0100 |
commit | be1539b920302cfcde300f8e8607d548e1f75b8a (patch) | |
tree | b2b3315db903fb9e2ab46da5b6bf9ea7ab0c67b3 /common | |
parent | 6d6b90e1a6e2ea8ff8976eb1f1246e8fcc0babcf (diff) | |
parent | a3787cd1bb0b290de44c8e947db742057c71011b (diff) | |
download | barebox-be1539b920302cfcde300f8e8607d548e1f75b8a.tar.gz barebox-be1539b920302cfcde300f8e8607d548e1f75b8a.tar.xz |
Merge branch 'for-next/misc'
Diffstat (limited to 'common')
-rw-r--r-- | common/Kconfig | 20 | ||||
-rw-r--r-- | common/boards/qemu-virt/overlay-of-flash.dts | 17 | ||||
-rw-r--r-- | common/complete.c | 21 | ||||
-rw-r--r-- | common/state/backend_bucket_direct.c | 4 | ||||
-rw-r--r-- | common/state/backend_storage.c | 7 |
5 files changed, 50 insertions, 19 deletions
diff --git a/common/Kconfig b/common/Kconfig index 814b820e2a..c1a8ef7e20 100644 --- a/common/Kconfig +++ b/common/Kconfig @@ -1344,6 +1344,13 @@ config DEBUG_ROCKCHIP_RK3568_UART Say Y here if you want kernel low-level debugging support on RK3568. +config DEBUG_ROCKCHIP_RK3399_UART + bool "RK3399 Debug UART" + depends on ARCH_RK3399 + help + Say Y here if you want kernel low-level debugging support + on RK3399. + config DEBUG_SOCFPGA_UART0 bool "Use SOCFPGA UART0 for low-level debug" depends on ARCH_SOCFPGA @@ -1451,7 +1458,8 @@ config DEBUG_OMAP_UART_PORT config DEBUG_ROCKCHIP_UART_PORT int "RK3xxx UART debug port" if DEBUG_ROCKCHIP_RK3188_UART || \ DEBUG_ROCKCHIP_RK3288_UART || \ - DEBUG_ROCKCHIP_RK3568_UART + DEBUG_ROCKCHIP_RK3568_UART || \ + DEBUG_ROCKCHIP_RK3399_UART default 2 depends on ARCH_ROCKCHIP help @@ -1501,9 +1509,15 @@ config DEBUG_INITCALLS If enabled this will print initcall traces. config DEBUG_PROBES - bool "Trace driver probes" + bool "Trace driver probes/removes" help - If enabled this will print driver probe traces. + If enabled this will log driver probe and remove traces. If DEBUG_LL is enabled, + probes will be printed even before registering consoles. If it's disabled, they + will be collected in the log and written out once a console is active. + + Removes are written to the log and will be printed as long as consoles exist. + Most consoles do not implement a remove callback to remain operable until + the very end. Consoles using DMA, however, must be removed. config PBL_BREAK bool "Execute software break on pbl start" diff --git a/common/boards/qemu-virt/overlay-of-flash.dts b/common/boards/qemu-virt/overlay-of-flash.dts index a271a45510..b912cbec18 100644 --- a/common/boards/qemu-virt/overlay-of-flash.dts +++ b/common/boards/qemu-virt/overlay-of-flash.dts @@ -35,15 +35,20 @@ }; }; }; + fragment@1 { - target-path="/"; + target-path = "/chosen"; __overlay__ { - chosen { - environment { - compatible = "barebox,environment"; - device-path = ENV_DEVICE_PATH; - }; + environment { + compatible = "barebox,environment"; + device-path = ENV_DEVICE_PATH; }; + }; + }; + + fragment@2 { + target-path = "/"; + __overlay__ { aliases { state = "/state"; }; diff --git a/common/complete.c b/common/complete.c index e504b75606..ab3c985493 100644 --- a/common/complete.c +++ b/common/complete.c @@ -14,17 +14,18 @@ #include <command.h> #include <environment.h> -static int file_complete(struct string_list *sl, char *instr, int exec) +static int file_complete(struct string_list *sl, char *instr, + const char *dirn, int exec) { char *path = strdup(instr); struct stat s; DIR *dir; struct dirent *d; char tmp[PATH_MAX]; - char *base, *dirn; + char *base; base = basename(instr); - dirn = dirname(path); + dirn = dirn ?: dirname(path); dir = opendir(dirn); if (!dir) @@ -250,12 +251,20 @@ EXPORT_SYMBOL(devicetree_complete); int devicetree_file_complete(struct string_list *sl, char *instr) { devicetree_complete(sl, instr); - file_complete(sl, instr, 0); + file_complete(sl, instr, NULL, 0); return 0; } EXPORT_SYMBOL(devicetree_file_complete); +int tutorial_complete(struct string_list *sl, char *instr) +{ + file_complete(sl, instr, "/env/data/tutorial", 0); + + return 0; +} +EXPORT_SYMBOL(tutorial_complete); + static int env_param_complete(struct string_list *sl, char *instr, int eval) { struct device_d *dev; @@ -392,11 +401,11 @@ int complete(char *instr, char **outstr) if (!instr) { instr = t; if (t && (t[0] == '/' || !strncmp(t, "./", 2))) { - file_complete(&sl, t, 1); + file_complete(&sl, t, NULL, 1); instr = t; } else if ((t = strrchr(t, ' '))) { t++; - file_complete(&sl, t, 0); + file_complete(&sl, t, NULL, 0); instr = t; } else { command_complete(&sl, instr); diff --git a/common/state/backend_bucket_direct.c b/common/state/backend_bucket_direct.c index 517aec6063..117cdfb46c 100644 --- a/common/state/backend_bucket_direct.c +++ b/common/state/backend_bucket_direct.c @@ -76,9 +76,9 @@ static int state_backend_bucket_direct_read(struct state_backend_storage_bucket if (meta.magic != ~0 && !!meta.magic) bucket->wrong_magic = 1; if (!IS_ENABLED(CONFIG_STATE_BACKWARD_COMPATIBLE)) { - dev_err(direct->dev, "No meta data header found\n"); dev_dbg(direct->dev, "Enable backward compatibility or increase stride size\n"); - return -EINVAL; + return dev_err_state_init(direct->dev, meta.magic ? -EINVAL : -ENOMEDIUM, + "No meta data header found\n"); } read_len = direct->max_size; if (lseek(direct->fd, direct->offset, SEEK_SET) != diff --git a/common/state/backend_storage.c b/common/state/backend_storage.c index 72f8bcf521..c55d22e37f 100644 --- a/common/state/backend_storage.c +++ b/common/state/backend_storage.c @@ -156,10 +156,13 @@ int state_storage_read(struct state_backend_storage *storage, totalbuckets++; ret = bucket->read(bucket, &bucket->buf, &bucket->len); - if (ret == -EUCLEAN) + if (ret == -EUCLEAN) { bucket->needs_refresh = 1; - else if (ret) + } else if (ret) { + if (ret == -ENOMEDIUM) + zerobuckets++; continue; + } /* * Verify the buffer crcs. The buffer length is passed in the len argument, |