From 2280fa56a00a63bbabc2076330367ec2863a474b Mon Sep 17 00:00:00 2001 From: Niel Fourie Date: Tue, 24 Mar 2020 16:17:04 +0100 Subject: cmd: fs: Add command to list supported fs types Added command "fstypes" to list supported/included filesystems. Signed-off-by: Niel Fourie Cc: Simon Glass Reviewed-by: Simon Glass [trini: Limit to sandbox] Signed-off-by: Tom Rini --- include/fs.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'include') diff --git a/include/fs.h b/include/fs.h index 29f737b8c21..b08b1f40c59 100644 --- a/include/fs.h +++ b/include/fs.h @@ -259,4 +259,15 @@ int do_fs_uuid(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[], */ int do_fs_type(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]); +/** + * do_fs_types - List supported filesystems. + * + * @cmdtp: Command information for fstypes + * @flag: Command flags (CMD_FLAG_...) + * @argc: Number of arguments + * @argv: List of arguments + * @return result (see enum command_ret_t) + */ +int do_fs_types(struct cmd_tbl *cmdtp, int flag, int argc, char * const argv[]); + #endif /* _FS_H */ -- cgit v1.3.1 From 2e48836895d1246b40f7e166695651882e7bb68c Mon Sep 17 00:00:00 2001 From: Niel Fourie Date: Tue, 24 Mar 2020 16:17:05 +0100 Subject: cmd: dm: Fixed/Added DM driver listing subcommands Renamed dm "drivers" subcommand to "compat" (as it listed compatibility strings) and prevent it from segfaulting when drivers have no of_match populated. Added a new "drivers" subcommand to dump a list of all known DM drivers and for each, their uclass id, uclass driver and names of attached devices. Added a new "static" subcommand to dump a list of DM drivers with statically defined platform data. Signed-off-by: Niel Fourie Cc: Simon Glass Cc: Sean Anderson Reviewed-by: Simon Glass --- cmd/dm.c | 22 ++++++++++++++++++- drivers/core/dump.c | 55 +++++++++++++++++++++++++++++++++++++++++++++++- include/dm/util.h | 6 ++++++ test/py/tests/test_dm.py | 22 +++++++++++++++++-- 4 files changed, 101 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/cmd/dm.c b/cmd/dm.c index 4e307ac5245..1dd19fe45b5 100644 --- a/cmd/dm.c +++ b/cmd/dm.c @@ -48,11 +48,29 @@ static int do_dm_dump_drivers(struct cmd_tbl *cmdtp, int flag, int argc, return 0; } +static int do_dm_dump_driver_compat(struct cmd_tbl *cmdtp, int flag, int argc, + char * const argv[]) +{ + dm_dump_driver_compat(); + + return 0; +} + +static int do_dm_dump_static_driver_info(struct cmd_tbl *cmdtp, int flag, int argc, + char * const argv[]) +{ + dm_dump_static_driver_info(); + + return 0; +} + static struct cmd_tbl test_commands[] = { U_BOOT_CMD_MKENT(tree, 0, 1, do_dm_dump_all, "", ""), U_BOOT_CMD_MKENT(uclass, 1, 1, do_dm_dump_uclass, "", ""), U_BOOT_CMD_MKENT(devres, 1, 1, do_dm_dump_devres, "", ""), U_BOOT_CMD_MKENT(drivers, 1, 1, do_dm_dump_drivers, "", ""), + U_BOOT_CMD_MKENT(compat, 1, 1, do_dm_dump_driver_compat, "", ""), + U_BOOT_CMD_MKENT(static, 1, 1, do_dm_dump_static_driver_info, "", ""), }; static __maybe_unused void dm_reloc(void) @@ -94,5 +112,7 @@ U_BOOT_CMD( "tree Dump driver model tree ('*' = activated)\n" "dm uclass Dump list of instances for each uclass\n" "dm devres Dump list of device resources for each device\n" - "dm drivers Dump list of drivers and their compatible strings" + "dm drivers Dump list of drivers with uclass and instances\n" + "dm compat Dump list of drivers with compatibility strings\n" + "dm static Dump list of drivers with static platform data" ); diff --git a/drivers/core/dump.c b/drivers/core/dump.c index cb8a25b9ad6..6debaf97a1d 100644 --- a/drivers/core/dump.c +++ b/drivers/core/dump.c @@ -97,7 +97,7 @@ void dm_dump_uclass(void) } } -void dm_dump_drivers(void) +void dm_dump_driver_compat(void) { struct driver *d = ll_entry_start(struct driver, driver); const int n_ents = ll_entry_count(struct driver, driver); @@ -120,3 +120,56 @@ void dm_dump_drivers(void) printf("%-20.20s %s\n", "", match->compatible); } } + +void dm_dump_drivers(void) +{ + struct driver *d = ll_entry_start(struct driver, driver); + const int n_ents = ll_entry_count(struct driver, driver); + struct driver *entry; + struct udevice *udev; + struct uclass *uc; + int i; + + puts("Driver uid uclass Devices\n"); + puts("----------------------------------------------------------\n"); + + for (entry = d; entry < d + n_ents; entry++) { + uclass_get(entry->id, &uc); + + printf("%-25.25s %-3.3d %-20.20s ", entry->name, entry->id, + uc ? uc->uc_drv->name : ""); + + if (!uc) { + puts("\n"); + continue; + } + + i = 0; + uclass_foreach_dev(udev, uc) { + if (udev->driver != entry) + continue; + if (i) + printf("%-51.51s", ""); + + printf("%-25.25s\n", udev->name); + i++; + } + if (!i) + puts("\n"); + } +} + +void dm_dump_static_driver_info(void) +{ + struct driver_info *drv = ll_entry_start(struct driver_info, + driver_info); + const int n_ents = ll_entry_count(struct driver_info, driver_info); + struct driver_info *entry; + + puts("Driver Address\n"); + puts("---------------------------------\n"); + for (entry = drv; entry != drv + n_ents; entry++) { + printf("%-25.25s @%08lx\n", entry->name, + (ulong)map_to_sysmem(entry->platdata)); + } +} diff --git a/include/dm/util.h b/include/dm/util.h index 23f8deb14e6..9773db6de17 100644 --- a/include/dm/util.h +++ b/include/dm/util.h @@ -42,4 +42,10 @@ static inline void dm_dump_devres(void) /* Dump out a list of drivers */ void dm_dump_drivers(void); +/* Dump out a list with each driver's compatibility strings */ +void dm_dump_driver_compat(void); + +/* Dump out a list of drivers with static platform data */ +void dm_dump_static_driver_info(void); + #endif diff --git a/test/py/tests/test_dm.py b/test/py/tests/test_dm.py index f6fbf8ba4c5..97203b536e1 100644 --- a/test/py/tests/test_dm.py +++ b/test/py/tests/test_dm.py @@ -4,14 +4,32 @@ import pytest @pytest.mark.buildconfigspec('cmd_dm') -def test_dm_drivers(u_boot_console): - """Test that each driver in `dm tree` is also listed in `dm drivers`.""" +def test_dm_compat(u_boot_console): + """Test that each driver in `dm tree` is also listed in `dm compat`.""" response = u_boot_console.run_command('dm tree') driver_index = response.find('Driver') assert driver_index != -1 drivers = (line[driver_index:].split()[0] for line in response[:-1].split('\n')[2:]) + response = u_boot_console.run_command('dm compat') + for driver in drivers: + assert driver in response + +@pytest.mark.buildconfigspec('cmd_dm') +def test_dm_drivers(u_boot_console): + """Test that each driver in `dm compat` is also listed in `dm drivers`.""" + response = u_boot_console.run_command('dm compat') + drivers = (line[:20].rstrip() for line in response[:-1].split('\n')[2:]) + response = u_boot_console.run_command('dm drivers') + for driver in drivers: + assert driver in response + +@pytest.mark.buildconfigspec('cmd_dm') +def test_dm_static(u_boot_console): + """Test that each driver in `dm static` is also listed in `dm drivers`.""" + response = u_boot_console.run_command('dm static') + drivers = (line[:25].rstrip() for line in response[:-1].split('\n')[2:]) response = u_boot_console.run_command('dm drivers') for driver in drivers: assert driver in response -- cgit v1.3.1 From 26073f9ed3ab0aaf3c2a2b433fecb30a95a067d6 Mon Sep 17 00:00:00 2001 From: Robert Marko Date: Sat, 25 Apr 2020 19:37:21 +0200 Subject: image: Add support for ZSTD decompression This patch adds support for ZSTD decompression of FIT images. Signed-off-by: Robert Marko Cc: Luka Perkov --- common/image.c | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ include/image.h | 1 + 2 files changed, 53 insertions(+) (limited to 'include') diff --git a/common/image.c b/common/image.c index e1ca1a7905e..ff16f5afb0a 100644 --- a/common/image.c +++ b/common/image.c @@ -46,6 +46,7 @@ #include #include #include +#include #ifdef CONFIG_CMD_BDI extern int do_bdinfo(struct cmd_tbl *cmdtp, int flag, int argc, @@ -198,6 +199,7 @@ static const table_entry_t uimage_comp[] = { { IH_COMP_LZMA, "lzma", "lzma compressed", }, { IH_COMP_LZO, "lzo", "lzo compressed", }, { IH_COMP_LZ4, "lz4", "lz4 compressed", }, + { IH_COMP_ZSTD, "zstd", "zstd compressed", }, { -1, "", "", }, }; @@ -508,6 +510,56 @@ int image_decomp(int comp, ulong load, ulong image_start, int type, break; } #endif /* CONFIG_LZ4 */ +#ifdef CONFIG_ZSTD + case IH_COMP_ZSTD: { + size_t size = unc_len; + ZSTD_DStream *dstream; + ZSTD_inBuffer in_buf; + ZSTD_outBuffer out_buf; + void *workspace; + size_t wsize; + + wsize = ZSTD_DStreamWorkspaceBound(image_len); + workspace = malloc(wsize); + if (!workspace) { + debug("%s: cannot allocate workspace of size %zu\n", __func__, + wsize); + return -1; + } + + dstream = ZSTD_initDStream(image_len, workspace, wsize); + if (!dstream) { + printf("%s: ZSTD_initDStream failed\n", __func__); + return ZSTD_getErrorCode(ret); + } + + in_buf.src = image_buf; + in_buf.pos = 0; + in_buf.size = image_len; + + out_buf.dst = load_buf; + out_buf.pos = 0; + out_buf.size = size; + + while (1) { + size_t ret; + + ret = ZSTD_decompressStream(dstream, &out_buf, &in_buf); + if (ZSTD_isError(ret)) { + printf("%s: ZSTD_decompressStream error %d\n", __func__, + ZSTD_getErrorCode(ret)); + return ZSTD_getErrorCode(ret); + } + + if (in_buf.pos >= image_len || !ret) + break; + } + + image_len = out_buf.pos; + + break; + } +#endif /* CONFIG_ZSTD */ default: printf("Unimplemented compression type %d\n", comp); return -ENOSYS; diff --git a/include/image.h b/include/image.h index ebd581a5944..9ababf2a2d3 100644 --- a/include/image.h +++ b/include/image.h @@ -326,6 +326,7 @@ enum { IH_COMP_LZMA, /* lzma Compression Used */ IH_COMP_LZO, /* lzo Compression Used */ IH_COMP_LZ4, /* lz4 Compression Used */ + IH_COMP_ZSTD, /* zstd Compression Used */ IH_COMP_COUNT, }; -- cgit v1.3.1 From 0a7ba7c53c19d24f8de76082ba567a1eb2a04f96 Mon Sep 17 00:00:00 2001 From: Amit Singh Tomar Date: Sat, 9 May 2020 13:45:08 +0530 Subject: arm: actions: remove "CONFIG_SYS_SDRAM_SIZE" for Actions Owl Semi SoCs Now that, we calculate SDRAM size by reading DDR registers, "CONFIG_SYS_SDRAM_SIZE" is no more needed. This commit removes "CONFIG_SYS_SDRAM_SIZE" from common configuration file. Signed-off-by: Amit Singh Tomar Reviewed-by: Manivannan Sadhasivam --- include/configs/owl-common.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include') diff --git a/include/configs/owl-common.h b/include/configs/owl-common.h index 98b5a96cf61..4ef9e8ed5d8 100644 --- a/include/configs/owl-common.h +++ b/include/configs/owl-common.h @@ -12,7 +12,6 @@ /* SDRAM Definitions */ #define CONFIG_SYS_SDRAM_BASE 0x0 -#define CONFIG_SYS_SDRAM_SIZE 0x80000000 /* Generic Timer Definitions */ #define COUNTER_FREQUENCY (24000000) /* 24MHz */ -- cgit v1.3.1 From 220b590d5f9f57bfd87f6f95302e286544439a99 Mon Sep 17 00:00:00 2001 From: Andre Przywara Date: Thu, 11 Jun 2020 12:03:15 +0100 Subject: arm: vexpress64: Fix counter frequency The arch timer on 64-bit Arm Ltd. platforms is driven by a 24 MHz crystal oscillator, so the frequency is not 25165824 MHz, as the current code suggests. Signed-off-by: Andre Przywara Reviewed-by: Linus Walleij --- include/configs/vexpress_aemv8a.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/configs/vexpress_aemv8a.h b/include/configs/vexpress_aemv8a.h index 09cdd3dab5b..e63c335f857 100644 --- a/include/configs/vexpress_aemv8a.h +++ b/include/configs/vexpress_aemv8a.h @@ -68,7 +68,7 @@ #define V2M_SYS_CFGSTAT (V2M_SYSREGS + 0x0a8) /* Generic Timer Definitions */ -#define COUNTER_FREQUENCY (0x1800000) /* 24MHz */ +#define COUNTER_FREQUENCY 24000000 /* 24MHz */ /* Generic Interrupt Controller Definitions */ #ifdef CONFIG_GICV3 -- cgit v1.3.1