From 0ffdfbd1d0eca769878913d15f232c9219cf2aa1 Mon Sep 17 00:00:00 2001 From: Niel Fourie Date: Tue, 24 Mar 2020 16:17:03 +0100 Subject: [PATCH 01/27] cmd: part: Add subcommand to list supported partition tables Add a subcommand "types" to the part command, which lists the supported partition table types. Signed-off-by: Niel Fourie Cc: Simon Glass Reviewed-by: Simon Glass --- cmd/part.c | 27 +++++++++++++++++++++++++-- test/py/tests/test_part.py | 14 ++++++++++++++ 2 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 test/py/tests/test_part.py diff --git a/cmd/part.c b/cmd/part.c index 216f14bf5d..3395c17b89 100644 --- a/cmd/part.c +++ b/cmd/part.c @@ -182,6 +182,26 @@ static int do_part_number(int argc, char *const argv[]) return do_part_info(argc, argv, CMD_PART_INFO_NUMBER); } +static int do_part_types(int argc, char * const argv[]) +{ + struct part_driver *drv = ll_entry_start(struct part_driver, + part_driver); + const int n_ents = ll_entry_count(struct part_driver, part_driver); + struct part_driver *entry; + int i = 0; + + puts("Supported partition tables"); + + for (entry = drv; entry != drv + n_ents; entry++) { + printf("%c %s", i ? ',' : ':', entry->name); + i++; + } + if (!i) + puts(": "); + puts("\n"); + return CMD_RET_SUCCESS; +} + static int do_part(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) { @@ -198,7 +218,8 @@ static int do_part(struct cmd_tbl *cmdtp, int flag, int argc, return do_part_size(argc - 2, argv + 2); else if (!strcmp(argv[1], "number")) return do_part_number(argc - 2, argv + 2); - + else if (!strcmp(argv[1], "types")) + return do_part_types(argc - 2, argv + 2); return CMD_RET_USAGE; } @@ -222,5 +243,7 @@ U_BOOT_CMD( " part can be either partition number or partition name\n" "part number \n" " - set environment variable to the partition number using the partition name\n" - " part must be specified as partition name" + " part must be specified as partition name\n" + "part types\n" + " - list supported partition table types" ); diff --git a/test/py/tests/test_part.py b/test/py/tests/test_part.py new file mode 100644 index 0000000000..cba9804510 --- /dev/null +++ b/test/py/tests/test_part.py @@ -0,0 +1,14 @@ +# SPDX-License-Identifier: GPL-2.0 +# Copyright (C) 2020 +# Niel Fourie, DENX Software Engineering, lusus@denx.de + +import pytest + +@pytest.mark.buildconfigspec('cmd_part') +@pytest.mark.buildconfigspec('partitions') +@pytest.mark.buildconfigspec('efi_partition') +def test_dm_compat(u_boot_console): + """Test that `part types` prints a result which includes `EFI`.""" + output = u_boot_console.run_command('part types') + assert "Supported partition tables:" in output + assert "EFI" in output From 2280fa56a00a63bbabc2076330367ec2863a474b Mon Sep 17 00:00:00 2001 From: Niel Fourie Date: Tue, 24 Mar 2020 16:17:04 +0100 Subject: [PATCH 02/27] 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 --- cmd/fs.c | 11 +++++++++++ fs/fs.c | 20 ++++++++++++++++++++ include/fs.h | 11 +++++++++++ test/py/tests/test_fs/test_fs_cmd.py | 13 +++++++++++++ 4 files changed, 55 insertions(+) create mode 100644 test/py/tests/test_fs/test_fs_cmd.py diff --git a/cmd/fs.c b/cmd/fs.c index 3a0c465c15..5ad11647c2 100644 --- a/cmd/fs.c +++ b/cmd/fs.c @@ -100,3 +100,14 @@ U_BOOT_CMD( "fstype : \n" "- set environment variable to filesystem type\n" ); + +static int do_fstypes_wrapper(struct cmd_tbl *cmdtp, int flag, int argc, + char * const argv[]) +{ + return do_fs_types(cmdtp, flag, argc, argv); +} + +U_BOOT_CMD( + fstypes, 1, 1, do_fstypes_wrapper, + "List supported filesystem types", "" +); diff --git a/fs/fs.c b/fs/fs.c index ad4caaeb1e..8f8938c3c6 100644 --- a/fs/fs.c +++ b/fs/fs.c @@ -903,3 +903,23 @@ int do_ln(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[], return 0; } + +int do_fs_types(struct cmd_tbl *cmdtp, int flag, int argc, char * const argv[]) +{ + struct fstype_info *drv = fstypes; + const int n_ents = ARRAY_SIZE(fstypes); + struct fstype_info *entry; + int i = 0; + + puts("Supported filesystems"); + for (entry = drv; entry != drv + n_ents; entry++) { + if (entry->fstype != FS_TYPE_ANY) { + printf("%c %s", i ? ',' : ':', entry->name); + i++; + } + } + if (!i) + puts(": "); + puts("\n"); + return CMD_RET_SUCCESS; +} diff --git a/include/fs.h b/include/fs.h index 29f737b8c2..b08b1f40c5 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 */ diff --git a/test/py/tests/test_fs/test_fs_cmd.py b/test/py/tests/test_fs/test_fs_cmd.py new file mode 100644 index 0000000000..ba39a53159 --- /dev/null +++ b/test/py/tests/test_fs/test_fs_cmd.py @@ -0,0 +1,13 @@ +# SPDX-License-Identifier: GPL-2.0 +# Copyright (C) 2020 +# Niel Fourie, DENX Software Engineering, lusus@denx.de + +import pytest + +@pytest.mark.boardspec('sandbox') +@pytest.mark.buildconfigspec('cmd_fs_generic') +def test_dm_compat(u_boot_console): + """Test that `fstypes` prints a result which includes `sandbox`.""" + output = u_boot_console.run_command('fstypes') + assert "Supported filesystems:" in output + assert "sandbox" in output From 2e48836895d1246b40f7e166695651882e7bb68c Mon Sep 17 00:00:00 2001 From: Niel Fourie Date: Tue, 24 Mar 2020 16:17:05 +0100 Subject: [PATCH 03/27] 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(-) diff --git a/cmd/dm.c b/cmd/dm.c index 4e307ac524..1dd19fe45b 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 cb8a25b9ad..6debaf97a1 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 23f8deb14e..9773db6de1 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 f6fbf8ba4c..97203b536e 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 From e369790843d87c2089ae93cd2345723a95ace71d Mon Sep 17 00:00:00 2001 From: Niel Fourie Date: Mon, 30 Mar 2020 17:22:58 +0200 Subject: [PATCH 04/27] cmd: blkls: Add blkls command Add a command to print a list of available block device drivers, and for each, the list of known block devices. Signed-off-by: Niel Fourie Cc: Simon Glass Cc: Stefan Roese Reviewed-by: Simon Glass Reviewed-by: Stefan Roese --- cmd/Kconfig | 7 +++++ cmd/Makefile | 1 + cmd/lsblk.c | 51 +++++++++++++++++++++++++++++++++++++ test/py/tests/test_lsblk.py | 13 ++++++++++ 4 files changed, 72 insertions(+) create mode 100644 cmd/lsblk.c create mode 100644 test/py/tests/test_lsblk.py diff --git a/cmd/Kconfig b/cmd/Kconfig index 192b3b262f..0ead88eff1 100644 --- a/cmd/Kconfig +++ b/cmd/Kconfig @@ -1088,6 +1088,13 @@ config CMD_LOADS help Load an S-Record file over serial line +config CMD_LSBLK + depends on BLK + bool "lsblk - list block drivers and devices" + help + Print list of available block device drivers, and for each, the list + of known block devices. + config CMD_MMC bool "mmc" help diff --git a/cmd/Makefile b/cmd/Makefile index 974ad48b0a..006075a048 100644 --- a/cmd/Makefile +++ b/cmd/Makefile @@ -84,6 +84,7 @@ obj-$(CONFIG_CMD_LED) += led.o obj-$(CONFIG_CMD_LICENSE) += license.o obj-y += load.o obj-$(CONFIG_CMD_LOG) += log.o +obj-$(CONFIG_CMD_LSBLK) += lsblk.o obj-$(CONFIG_ID_EEPROM) += mac.o obj-$(CONFIG_CMD_MD5SUM) += md5sum.o obj-$(CONFIG_CMD_MEMORY) += mem.o diff --git a/cmd/lsblk.c b/cmd/lsblk.c new file mode 100644 index 0000000000..ece8bbf108 --- /dev/null +++ b/cmd/lsblk.c @@ -0,0 +1,51 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * (C) Copyright 2020 + * Niel Fourie, DENX Software Engineering, lusus@denx.de. + */ + +#include +#include + +static int do_lsblk(struct cmd_tbl *cmdtp, int flag, int argc, char * const argv[]) +{ + 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; + struct blk_desc *desc; + int ret, i; + + ret = uclass_get(UCLASS_BLK, &uc); + if (ret) { + puts("Could not get BLK uclass.\n"); + return CMD_RET_FAILURE; + } + puts("Block Driver Devices\n"); + puts("-----------------------------\n"); + for (entry = d; entry < d + n_ents; entry++) { + if (entry->id != UCLASS_BLK) + continue; + i = 0; + printf("%-20.20s", entry->name); + uclass_foreach_dev(udev, uc) { + if (udev->driver != entry) + continue; + desc = dev_get_uclass_platdata(udev); + printf("%c %s %u", i ? ',' : ':', + blk_get_if_type_name(desc->if_type), + desc->devnum); + i++; + } + if (!i) + puts(": "); + puts("\n"); + } + + return CMD_RET_SUCCESS; +} + +U_BOOT_CMD(lsblk, 1, 0, do_lsblk, "list block drivers and devices", + "- display list of block device drivers and attached block devices" +); diff --git a/test/py/tests/test_lsblk.py b/test/py/tests/test_lsblk.py new file mode 100644 index 0000000000..40ffe01263 --- /dev/null +++ b/test/py/tests/test_lsblk.py @@ -0,0 +1,13 @@ +# SPDX-License-Identifier: GPL-2.0+ +# Copyright (C) 2020 +# Niel Fourie, DENX Software Engineering, lusus@denx.de + +import pytest + +@pytest.mark.buildconfigspec('blk') +@pytest.mark.buildconfigspec('cmd_lsblk') +def test_lsblk(u_boot_console): + """Test that `lsblk` prints a result which includes `host`.""" + output = u_boot_console.run_command('lsblk') + assert "Block Driver" in output + assert "sandbox_host_blk" in output From 26073f9ed3ab0aaf3c2a2b433fecb30a95a067d6 Mon Sep 17 00:00:00 2001 From: Robert Marko Date: Sat, 25 Apr 2020 19:37:21 +0200 Subject: [PATCH 05/27] 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(+) diff --git a/common/image.c b/common/image.c index e1ca1a7905..ff16f5afb0 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 ebd581a594..9ababf2a2d 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, }; From 3ca564e96e90a4714147262c9d201e077ef54a26 Mon Sep 17 00:00:00 2001 From: Amit Singh Tomar Date: Sat, 9 May 2020 13:45:07 +0530 Subject: [PATCH 06/27] Actions: OWL: Calculate SDRAM size Calculate the SDRAM size from DDR capacity register registers instead of using hard-coded value. This is quite useful to get correct size on differnt boards based on Actions OWL family of SoCs (S700 and S900). There is no documentation available that talks about DDR registers, and this is very much taken from vendor source. This commit lets Linux boot on Cubieboard7-lite(based on S700). Signed-off-by: Amit Singh Tomar Reviewed-by: Manivannan Sadhasivam --- arch/arm/mach-owl/soc.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-owl/soc.c b/arch/arm/mach-owl/soc.c index 7d3f6f6285..fd6ee7c1c0 100644 --- a/arch/arm/mach-owl/soc.c +++ b/arch/arm/mach-owl/soc.c @@ -15,14 +15,34 @@ #include #include +#define DMM_INTERLEAVE_PER_CH_CFG 0xe0290028 + DECLARE_GLOBAL_DATA_PTR; +unsigned int owl_get_ddrcap(void) +{ + unsigned int val, cap; + + /* ddr capacity register initialized by ddr driver + * in early bootloader + */ +#if defined(CONFIG_MACH_S700) + val = (readl(DMM_INTERLEAVE_PER_CH_CFG) >> 8) & 0x7; + cap = (val + 1) * 256; +#elif defined(CONFIG_MACH_S900) + val = (readl(DMM_INTERLEAVE_PER_CH_CFG) >> 8) & 0xf; + cap = 64 * (1 << val); +#endif + + return cap; +} + /* * dram_init - sets uboots idea of sdram size */ int dram_init(void) { - gd->ram_size = CONFIG_SYS_SDRAM_SIZE; + gd->ram_size = owl_get_ddrcap() * 1024 * 1024; return 0; } From 0a7ba7c53c19d24f8de76082ba567a1eb2a04f96 Mon Sep 17 00:00:00 2001 From: Amit Singh Tomar Date: Sat, 9 May 2020 13:45:08 +0530 Subject: [PATCH 07/27] 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(-) diff --git a/include/configs/owl-common.h b/include/configs/owl-common.h index 98b5a96cf6..4ef9e8ed5d 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 */ From 3a217346051ac8876d63becd12b6ddb7a72e82f9 Mon Sep 17 00:00:00 2001 From: Amit Singh Tomar Date: Sat, 9 May 2020 19:55:09 +0530 Subject: [PATCH 08/27] clk: actions: Add Ethernet clocks This commit adds clocks needed for ethernet operations for Actions OWL family of SoCs (S700 and S900). Signed-off-by: Amit Singh Tomar --- arch/arm/include/asm/arch-owl/regs_s700.h | 2 ++ arch/arm/include/asm/arch-owl/regs_s900.h | 4 ++++ drivers/clk/owl/clk_owl.c | 9 +++++++++ drivers/clk/owl/clk_owl.h | 2 -- 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/arch/arm/include/asm/arch-owl/regs_s700.h b/arch/arm/include/asm/arch-owl/regs_s700.h index 2f21c15cca..90459ae95e 100644 --- a/arch/arm/include/asm/arch-owl/regs_s700.h +++ b/arch/arm/include/asm/arch-owl/regs_s700.h @@ -53,4 +53,6 @@ #define CMU_CVBSPLL 0x00B8 #define CMU_SSTSCLK 0x00C0 +#define CMU_DEVCLKEN1_ETH BIT(23) + #endif diff --git a/arch/arm/include/asm/arch-owl/regs_s900.h b/arch/arm/include/asm/arch-owl/regs_s900.h index 9e9106ddaa..084bc9b8c3 100644 --- a/arch/arm/include/asm/arch-owl/regs_s900.h +++ b/arch/arm/include/asm/arch-owl/regs_s900.h @@ -61,4 +61,8 @@ #define CMU_TVOUTPLLDEBUG0 (0x00EC) #define CMU_TVOUTPLLDEBUG1 (0x00FC) +#define CMU_DEVCLKEN1_ETH BIT(22) +#define CLK_ETHERNET CLK_ETH_MAC +#define CMU_ETHERNETPLL CMU_ASSISTPLL + #endif diff --git a/drivers/clk/owl/clk_owl.c b/drivers/clk/owl/clk_owl.c index 9715fce162..1999c87a33 100644 --- a/drivers/clk/owl/clk_owl.c +++ b/drivers/clk/owl/clk_owl.c @@ -87,6 +87,11 @@ int owl_clk_enable(struct clk *clk) /* Enable UART3 interface clock */ setbits_le32(priv->base + CMU_DEVCLKEN1, CMU_DEVCLKEN1_UART3); break; + case CLK_RMII_REF: + case CLK_ETHERNET: + setbits_le32(priv->base + CMU_DEVCLKEN1, CMU_DEVCLKEN1_ETH); + setbits_le32(priv->base + CMU_ETHERNETPLL, 5); + break; default: return -EINVAL; } @@ -112,6 +117,10 @@ int owl_clk_disable(struct clk *clk) /* Disable UART3 interface clock */ clrbits_le32(priv->base + CMU_DEVCLKEN1, CMU_DEVCLKEN1_UART3); break; + case CLK_RMII_REF: + case CLK_ETHERNET: + clrbits_le32(priv->base + CMU_DEVCLKEN1, CMU_DEVCLKEN1_ETH); + break; default: return -EINVAL; } diff --git a/drivers/clk/owl/clk_owl.h b/drivers/clk/owl/clk_owl.h index cf896bdb98..a01f81a6a7 100644 --- a/drivers/clk/owl/clk_owl.h +++ b/drivers/clk/owl/clk_owl.h @@ -62,6 +62,4 @@ struct owl_clk_priv { #define CMU_DEVCLKEN1_UART5 BIT(21) #define CMU_DEVCLKEN1_UART3 BIT(11) -#define CMU_DEVCLKEN1_ETH_S700 BIT(23) - #endif From b0778d9c2c221a13b7b977bd8eb397a16ff36fe0 Mon Sep 17 00:00:00 2001 From: Amit Singh Tomar Date: Sat, 9 May 2020 19:55:10 +0530 Subject: [PATCH 09/27] net: phy: realtek: Add support for RTL8201F PHY module. This patch adds support for Realtek PHY RTL8201F 10/100Mbs (with variants: RTL8201FN and RTL8201FL) PHYceiver. It is present on Actions Semi Cubieboard7 board. Signed-off-by: Amit Singh Tomar --- drivers/net/phy/realtek.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/drivers/net/phy/realtek.c b/drivers/net/phy/realtek.c index b4612c1cfd..feffdccabc 100644 --- a/drivers/net/phy/realtek.c +++ b/drivers/net/phy/realtek.c @@ -159,6 +159,14 @@ static int rtl8211x_config(struct phy_device *phydev) return 0; } +/* RealTek RTL8201F */ +static int rtl8201f_config(struct phy_device *phydev) +{ + genphy_config_aneg(phydev); + + return 0; +} + static int rtl8211f_config(struct phy_device *phydev) { u16 reg; @@ -398,12 +406,24 @@ static struct phy_driver RTL8211F_driver = { .writeext = &rtl8211f_phy_extwrite, }; +/* Support for RTL8201F PHY */ +static struct phy_driver RTL8201F_driver = { + .name = "RealTek RTL8201F 10/100Mbps Ethernet", + .uid = 0x1cc816, + .mask = 0xffffff, + .features = PHY_BASIC_FEATURES, + .config = &rtl8201f_config, + .startup = &rtl8211e_startup, + .shutdown = &genphy_shutdown, +}; + int phy_realtek_init(void) { phy_register(&RTL8211B_driver); phy_register(&RTL8211E_driver); phy_register(&RTL8211F_driver); phy_register(&RTL8211DN_driver); + phy_register(&RTL8201F_driver); return 0; } From fa6539a3dcbf269121ca64084cff4c146fcdaf19 Mon Sep 17 00:00:00 2001 From: Amit Singh Tomar Date: Sat, 9 May 2020 19:55:11 +0530 Subject: [PATCH 10/27] net: phy: realtek: Introduce PHY_RTL8201F_S700_RMII_TIMINGS to adjust rx/tx timings RTL8201F PHY module found on Actions Semi Cubieboard7 seems to have specific Rx/Tx interface timings requirement for proper PHY operations. These timing values are not documented anywhere and picked from vendor code. This commits lets proper packets to be transmitted over the network. Signed-off-by: Amit Singh Tomar --- drivers/net/phy/Kconfig | 9 +++++++++ drivers/net/phy/realtek.c | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+) diff --git a/drivers/net/phy/Kconfig b/drivers/net/phy/Kconfig index b0bd762ac3..4e1a93be22 100644 --- a/drivers/net/phy/Kconfig +++ b/drivers/net/phy/Kconfig @@ -235,6 +235,15 @@ config RTL8211F_PHY_FORCE_EEE_RXC_ON Default n, which means that the PHY state is not changed. To work around the issues, change this setting to y. +config RTL8201F_PHY_S700_RMII_TIMINGS + bool "Ethernet PHY RTL8201F: adjust RMII Tx Interface timings" + depends on PHY_REALTEK + help + This provides an option to configure specific timing requirements (needed + for proper PHY operations) for the PHY module present on ACTION SEMI S700 + based cubieboard7. Exact timing requiremnets seems to be SoC specific + (and it's undocumented) that comes from vendor code itself. + config PHY_SMSC bool "Microchip(SMSC) Ethernet PHYs support" diff --git a/drivers/net/phy/realtek.c b/drivers/net/phy/realtek.c index feffdccabc..b1b1fa5080 100644 --- a/drivers/net/phy/realtek.c +++ b/drivers/net/phy/realtek.c @@ -14,6 +14,7 @@ #define PHY_RTL8211x_FORCE_MASTER BIT(1) #define PHY_RTL8211E_PINE64_GIGABIT_FIX BIT(2) #define PHY_RTL8211F_FORCE_EEE_RXC_ON BIT(3) +#define PHY_RTL8201F_S700_RMII_TIMINGS BIT(4) #define PHY_AUTONEGOTIATE_TIMEOUT 5000 @@ -60,6 +61,15 @@ #define MIIM_RTL8211F_RX_DELAY 0x8 #define MIIM_RTL8211F_LCR 0x10 +#define RTL8201F_RMSR 0x10 + +#define RMSR_RX_TIMING_SHIFT BIT(2) +#define RMSR_RX_TIMING_MASK GENMASK(7, 4) +#define RMSR_RX_TIMING_VAL 0x4 +#define RMSR_TX_TIMING_SHIFT BIT(3) +#define RMSR_TX_TIMING_MASK GENMASK(11, 8) +#define RMSR_TX_TIMING_VAL 0x5 + static int rtl8211f_phy_extread(struct phy_device *phydev, int addr, int devaddr, int regnum) { @@ -114,6 +124,15 @@ static int rtl8211f_probe(struct phy_device *phydev) return 0; } +static int rtl8210f_probe(struct phy_device *phydev) +{ +#ifdef CONFIG_RTL8201F_PHY_S700_RMII_TIMINGS + phydev->flags |= PHY_RTL8201F_S700_RMII_TIMINGS; +#endif + + return 0; +} + /* RealTek RTL8211x */ static int rtl8211x_config(struct phy_device *phydev) { @@ -162,6 +181,21 @@ static int rtl8211x_config(struct phy_device *phydev) /* RealTek RTL8201F */ static int rtl8201f_config(struct phy_device *phydev) { + unsigned int reg; + + if (phydev->flags & PHY_RTL8201F_S700_RMII_TIMINGS) { + phy_write(phydev, MDIO_DEVAD_NONE, MIIM_RTL8211F_PAGE_SELECT, + 7); + reg = phy_read(phydev, MDIO_DEVAD_NONE, RTL8201F_RMSR); + reg &= ~(RMSR_RX_TIMING_MASK | RMSR_TX_TIMING_MASK); + /* Set the needed Rx/Tx Timings for proper PHY operation */ + reg |= (RMSR_RX_TIMING_VAL << RMSR_RX_TIMING_SHIFT) + | (RMSR_TX_TIMING_VAL << RMSR_TX_TIMING_SHIFT); + phy_write(phydev, MDIO_DEVAD_NONE, RTL8201F_RMSR, reg); + phy_write(phydev, MDIO_DEVAD_NONE, MIIM_RTL8211F_PAGE_SELECT, + 0); + } + genphy_config_aneg(phydev); return 0; @@ -412,6 +446,7 @@ static struct phy_driver RTL8201F_driver = { .uid = 0x1cc816, .mask = 0xffffff, .features = PHY_BASIC_FEATURES, + .probe = &rtl8210f_probe, .config = &rtl8201f_config, .startup = &rtl8211e_startup, .shutdown = &genphy_shutdown, From 3c5c4ee35f58bd9d3ca8fb2b4d31da4e5abe17f1 Mon Sep 17 00:00:00 2001 From: Amit Singh Tomar Date: Sat, 9 May 2020 19:55:12 +0530 Subject: [PATCH 11/27] net: designware: s700: Add glue code for S700 mac This patchs adds glue logic to enable designware mac present on Action Semi based S700 SoC, Configures SoC specific bits. Undocumented bit that programs the PHY interface select register comes from vendor source. It has been tested on Cubieboard7-lite based on S700 SoC. Signed-off-by: Amit Singh Tomar --- arch/arm/include/asm/arch-owl/regs_s700.h | 6 ++ drivers/net/Kconfig | 7 +++ drivers/net/Makefile | 1 + drivers/net/dwmac_s700.c | 67 +++++++++++++++++++++++ 4 files changed, 81 insertions(+) create mode 100644 drivers/net/dwmac_s700.c diff --git a/arch/arm/include/asm/arch-owl/regs_s700.h b/arch/arm/include/asm/arch-owl/regs_s700.h index 90459ae95e..0f79faec69 100644 --- a/arch/arm/include/asm/arch-owl/regs_s700.h +++ b/arch/arm/include/asm/arch-owl/regs_s700.h @@ -55,4 +55,10 @@ #define CMU_DEVCLKEN1_ETH BIT(23) +#define GPIO_MFP_PWM (0xE01B0000) +#define MFP_CTL0 (GPIO_MFP_PWM + 0x40) +#define MFP_CTL1 (GPIO_MFP_PWM + 0x44) +#define MFP_CTL2 (GPIO_MFP_PWM + 0x48) +#define MFP_CTL3 (GPIO_MFP_PWM + 0x4C) + #endif diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig index 1566b3bda1..ec3fb49832 100644 --- a/drivers/net/Kconfig +++ b/drivers/net/Kconfig @@ -238,6 +238,13 @@ config ETH_DESIGNWARE_SOCFPGA Altera system manager to correctly interface with the PHY. This code handles those SoC specifics. +config ETH_DESIGNWARE_S700 + bool "Actins S700 glue driver for Synopsys Designware Ethernet MAC" + depends on DM_ETH && ETH_DESIGNWARE + help + This provides glue layer to use Synopsys Designware Ethernet MAC + present on Actions S700 SoC. + config ETHOC bool "OpenCores 10/100 Mbps Ethernet MAC" help diff --git a/drivers/net/Makefile b/drivers/net/Makefile index 383ed1c64f..1ecdc40b8f 100644 --- a/drivers/net/Makefile +++ b/drivers/net/Makefile @@ -18,6 +18,7 @@ obj-$(CONFIG_CS8900) += cs8900.o obj-$(CONFIG_TULIP) += dc2114x.o obj-$(CONFIG_ETH_DESIGNWARE) += designware.o obj-$(CONFIG_ETH_DESIGNWARE_SOCFPGA) += dwmac_socfpga.o +obj-$(CONFIG_ETH_DESIGNWARE_S700) += dwmac_s700.o obj-$(CONFIG_DRIVER_DM9000) += dm9000x.o obj-$(CONFIG_DNET) += dnet.o obj-$(CONFIG_DM_ETH_PHY) += eth-phy-uclass.o diff --git a/drivers/net/dwmac_s700.c b/drivers/net/dwmac_s700.c new file mode 100644 index 0000000000..9d3f3ac5d9 --- /dev/null +++ b/drivers/net/dwmac_s700.c @@ -0,0 +1,67 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (C) 2020 Amit Singh Tomar + * + * Actions DWMAC specific glue layer + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include "designware.h" +#include +#include + +/* pin control for MAC */ +#define RMII_TXD01_MFP_CTL0 (0x0 << 16) +#define RMII_RXD01_MFP_CTL0 (0x0 << 8) +#define RMII_TXEN_TXER_MFP_CTL0 (0x0 << 13) +#define RMII_REF_CLK_MFP_CTL0 (0x0 << 6) +#define CLKO_25M_EN_MFP_CTL3 BIT(30) + +DECLARE_GLOBAL_DATA_PTR; + +static void dwmac_board_setup(void) +{ + clrbits_le32(MFP_CTL0, (RMII_TXD01_MFP_CTL0 | RMII_RXD01_MFP_CTL0 | + RMII_TXEN_TXER_MFP_CTL0 | RMII_REF_CLK_MFP_CTL0)); + + setbits_le32(MFP_CTL3, CLKO_25M_EN_MFP_CTL3); +} + +static int dwmac_s700_probe(struct udevice *dev) +{ + dwmac_board_setup(); + + /* This is undocumented, phy interface select register */ + writel(0x4, 0xe024c0a0); + + return designware_eth_probe(dev); +} + +static int dwmac_s700_ofdata_to_platdata(struct udevice *dev) +{ + return designware_eth_ofdata_to_platdata(dev); +} + +static const struct udevice_id dwmac_s700_ids[] = { + {.compatible = "actions,s700-ethernet"}, + { } +}; + +U_BOOT_DRIVER(dwmac_s700) = { + .name = "dwmac_s700", + .id = UCLASS_ETH, + .of_match = dwmac_s700_ids, + .ofdata_to_platdata = dwmac_s700_ofdata_to_platdata, + .probe = dwmac_s700_probe, + .ops = &designware_eth_ops, + .priv_auto_alloc_size = sizeof(struct dw_eth_dev), + .platdata_auto_alloc_size = sizeof(struct eth_pdata), + .flags = DM_FLAG_ALLOC_PRIV_DMA, +}; From 75523d54ac62fb433bb0a105093e996570b61e87 Mon Sep 17 00:00:00 2001 From: Amit Singh Tomar Date: Sat, 9 May 2020 19:55:13 +0530 Subject: [PATCH 12/27] arm: dts: s700: add node for ethernet controller This patch adds node for ethernet controller found on Action Semi OWL S700 SoC. Since, there is no upstream Linux binding exist for S700 ethernet controller, Changes are put in u-boot specific dtsi file. Signed-off-by: Amit Singh Tomar --- arch/arm/dts/s700-u-boot.dtsi | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/arch/arm/dts/s700-u-boot.dtsi b/arch/arm/dts/s700-u-boot.dtsi index a527cccc75..1b2768272c 100644 --- a/arch/arm/dts/s700-u-boot.dtsi +++ b/arch/arm/dts/s700-u-boot.dtsi @@ -6,6 +6,19 @@ /{ soc { u-boot,dm-pre-reloc; + + gmac: ethernet@e0220000 { + compatible = "actions,s700-ethernet"; + reg = <0 0xe0220000 0 0x2000>; + interrupts = ; + interrupt-names = "macirq"; + local-mac-address = [ 00 18 fe 66 66 66 ]; + clocks = <&cmu CLK_ETHERNET>, <&cmu CLK_RMII_REF>; + clock-names = "ethernet", "rmii_ref"; + phy-mode = "rmii"; + status = "okay"; + }; + }; }; From cd2baaf777ceb1de8c8367fc4eeb0560105ae7e8 Mon Sep 17 00:00:00 2001 From: Amit Singh Tomar Date: Sat, 9 May 2020 19:55:14 +0530 Subject: [PATCH 13/27] owl: Kconfig: Enable DM eth for OWL platform This patch selects CONFIG_DM_ETH (ethernet driver is base on DM model) for Action semi owl SoC. Signed-off-by: Amit Singh Tomar --- arch/arm/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 760e901364..832686596e 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -908,6 +908,7 @@ config ARCH_MX5 config ARCH_OWL bool "Actions Semi OWL SoCs" select DM + select DM_ETH select DM_SERIAL select OWL_SERIAL select CLK From 400880010333aaf85cd8630e9e457a8b75311dec Mon Sep 17 00:00:00 2001 From: Amit Singh Tomar Date: Sat, 9 May 2020 19:55:15 +0530 Subject: [PATCH 14/27] configs: Enable mac and phy configs This patch adds MAC and PHY related configs (needed for proper ethernet operations) for Action Semi S700 SoC. Signed-off-by: Amit Singh Tomar --- configs/cubieboard7_defconfig | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/configs/cubieboard7_defconfig b/configs/cubieboard7_defconfig index 637dc9e9fb..c82afc3403 100644 --- a/configs/cubieboard7_defconfig +++ b/configs/cubieboard7_defconfig @@ -10,3 +10,7 @@ CONFIG_BOOTARGS="console=ttyOWL3,115200n8" # CONFIG_DISPLAY_BOARDINFO is not set CONFIG_SYS_PROMPT="U-Boot => " CONFIG_DEFAULT_DEVICE_TREE="s700-cubieboard7" +CONFIG_ETH_DESIGNWARE_S700=y +CONFIG_ETH_DESIGNWARE=y +CONFIG_PHY_REALTEK=y +CONFIG_RTL8201F_PHY_S700_RMII_TIMINGS=y From 2bd261dd1712561b8363fbf6f9f630176fe99caa Mon Sep 17 00:00:00 2001 From: Heiko Schocher Date: Fri, 22 May 2020 11:08:59 +0200 Subject: [PATCH 15/27] gpio: search for gpio label if gpio is not found through bank name dm_gpio_lookup_name() searches for a gpio through the bank name. But we have also gpio labels, and it makes sense to search for a gpio also in the labels we have defined, if no gpio is found through the bank name definition. This is useful for example if you have a wp pin on different gpios on different board versions. If dm_gpio_lookup_name() searches also for the gpio labels, you can give the gpio an unique label name and search for this label, and do not need to differ between board revisions. Signed-off-by: Heiko Schocher Reviewed-by: Simon Glass [trini: Don't enable by default] Signed-off-by: Tom Rini --- drivers/gpio/Kconfig | 20 +++++++++++++++++ drivers/gpio/gpio-uclass.c | 46 ++++++++++++++++++++++++++++++++++++++ test/dm/gpio.c | 9 ++++++++ 3 files changed, 75 insertions(+) diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig index af608b7b0e..0e8ad9530d 100644 --- a/drivers/gpio/Kconfig +++ b/drivers/gpio/Kconfig @@ -46,6 +46,26 @@ config GPIO_HOG is a mechanism providing automatic GPIO request and config- uration as part of the gpio-controller's driver probe function. +config DM_GPIO_LOOKUP_LABEL + bool "Enable searching for gpio labelnames" + depends on DM_GPIO + help + This option enables searching for gpio names in + the defined gpio labels, if the search for the + gpio bank name failed. This makes sense if you use + different gpios on different hardware versions + for the same functionality in board code. + +config SPL_DM_GPIO_LOOKUP_LABEL + bool "Enable searching for gpio labelnames" + depends on DM_GPIO && SPL_DM && SPL_GPIO_SUPPORT + help + This option enables searching for gpio names in + the defined gpio labels, if the search for the + gpio bank name failed. This makes sense if you use + different gpios on different hardware versions + for the same functionality in board code. + config ALTERA_PIO bool "Altera PIO driver" depends on DM_GPIO diff --git a/drivers/gpio/gpio-uclass.c b/drivers/gpio/gpio-uclass.c index f016532354..ab17fa8a5d 100644 --- a/drivers/gpio/gpio-uclass.c +++ b/drivers/gpio/gpio-uclass.c @@ -68,6 +68,45 @@ static int gpio_to_device(unsigned int gpio, struct gpio_desc *desc) return ret ? ret : -ENOENT; } +#if CONFIG_IS_ENABLED(DM_GPIO_LOOKUP_LABEL) +/** + * dm_gpio_lookup_label() - look for name in gpio device + * + * search in uc_priv, if there is a gpio with labelname same + * as name. + * + * @name: name which is searched + * @uc_priv: gpio_dev_priv pointer. + * @offset: gpio offset within the device + * @return: 0 if found, -ENOENT if not. + */ +static int dm_gpio_lookup_label(const char *name, + struct gpio_dev_priv *uc_priv, ulong *offset) +{ + int len; + int i; + + *offset = -1; + len = strlen(name); + for (i = 0; i < uc_priv->gpio_count; i++) { + if (!uc_priv->name[i]) + continue; + if (!strncmp(name, uc_priv->name[i], len)) { + *offset = i; + return 0; + } + } + return -ENOENT; +} +#else +static int +dm_gpio_lookup_label(const char *name, struct gpio_dev_priv *uc_priv, + ulong *offset) +{ + return -ENOENT; +} +#endif + int dm_gpio_lookup_name(const char *name, struct gpio_desc *desc) { struct gpio_dev_priv *uc_priv = NULL; @@ -96,6 +135,13 @@ int dm_gpio_lookup_name(const char *name, struct gpio_desc *desc) if (!strict_strtoul(name + len, 10, &offset)) break; } + + /* + * if we did not found a gpio through its bank + * name, we search for a valid gpio label. + */ + if (!dm_gpio_lookup_label(name, uc_priv, &offset)) + break; } if (!dev) diff --git a/test/dm/gpio.c b/test/dm/gpio.c index ecba566983..fcee1fe598 100644 --- a/test/dm/gpio.c +++ b/test/dm/gpio.c @@ -132,6 +132,15 @@ static int dm_test_gpio(struct unit_test_state *uts) ut_assertok(dm_gpio_set_value(desc, 0)); ut_asserteq(0, dm_gpio_get_value(desc)); + /* Check if lookup for labels work */ + ut_assertok(gpio_lookup_name("hog_input_active_low", &dev, &offset, + &gpio)); + ut_asserteq_str(dev->name, "base-gpios"); + ut_asserteq(0, offset); + ut_asserteq(CONFIG_SANDBOX_GPIO_COUNT + 0, gpio); + ut_assert(gpio_lookup_name("hog_not_exist", &dev, &offset, + &gpio)); + return 0; } DM_TEST(dm_test_gpio, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT); From fa914675d2c8699765f9b7644cff761ff04732cb Mon Sep 17 00:00:00 2001 From: Heiko Schocher Date: Thu, 4 Jun 2020 17:24:00 +0200 Subject: [PATCH 16/27] test_sleep.py: make sleep time and margin configurable make the sleep time and the margin configurable. Signed-off-by: Heiko Schocher Reviewed-by: Simon Glass Reviewed-by: Stephen Warren --- test/py/tests/test_sleep.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/test/py/tests/test_sleep.py b/test/py/tests/test_sleep.py index b69edf26ef..392af29db2 100644 --- a/test/py/tests/test_sleep.py +++ b/test/py/tests/test_sleep.py @@ -11,6 +11,12 @@ change test behavior. # Setup env__sleep_accurate to False if time is not accurate on your platform env__sleep_accurate = False +# Setup env__sleep_time time in seconds board is set to sleep +env__sleep_time = 3 + +# Setup env__sleep_margin set a margin for any system overhead +env__sleep_margin = 0.25 + """ def test_sleep(u_boot_console): @@ -23,13 +29,15 @@ def test_sleep(u_boot_console): if u_boot_console.config.buildconfig.get('config_cmd_misc', 'n') != 'y': pytest.skip('sleep command not supported') + # 3s isn't too long, but is enough to cross a few second boundaries. - sleep_time = 3 + sleep_time = u_boot_console.config.env.get('env__sleep_time', 3) + sleep_margin = u_boot_console.config.env.get('env__sleep_margin', 0.25) tstart = time.time() u_boot_console.run_command('sleep %d' % sleep_time) tend = time.time() elapsed = tend - tstart assert elapsed >= (sleep_time - 0.01) if not u_boot_console.config.gdbserver: - # 0.25s margin is hopefully enough to account for any system overhead. - assert elapsed < (sleep_time + 0.25) + # margin is hopefully enough to account for any system overhead. + assert elapsed < (sleep_time + sleep_margin) From a20f0c820fb024a48f667334777ca4022838693d Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Tue, 26 May 2020 21:06:50 +0200 Subject: [PATCH 17/27] fs: fat_write: fix short name creation. Truncate file names if the buffer size is exceeded to avoid a buffer overflow. Use Sphinx style function description. Add a TODO comment. Reported-by: CID 303779 Signed-off-by: Heinrich Schuchardt Reviewed-by: Simon Glass --- fs/fat/fat_write.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/fs/fat/fat_write.c b/fs/fat/fat_write.c index 59cc0bae94..b16a39d3ff 100644 --- a/fs/fat/fat_write.c +++ b/fs/fat/fat_write.c @@ -50,8 +50,11 @@ static int disk_write(__u32 block, __u32 nr_blocks, void *buf) return ret; } -/* - * Set short name in directory entry +/** + * set_name() - set short name in directory entry + * + * @dirent: directory entry + * @filename: long file name */ static void set_name(dir_entry *dirent, const char *filename) { @@ -66,7 +69,8 @@ static void set_name(dir_entry *dirent, const char *filename) if (len == 0) return; - strcpy(s_name, filename); + strncpy(s_name, filename, VFAT_MAXLEN_BYTES - 1); + s_name[VFAT_MAXLEN_BYTES - 1] = '\0'; uppercase(s_name, len); period = strchr(s_name, '.'); @@ -87,6 +91,11 @@ static void set_name(dir_entry *dirent, const char *filename) memcpy(dirent->name, s_name, period_location); } else { memcpy(dirent->name, s_name, 6); + /* + * TODO: Translating two long names with the same first six + * characters to the same short name is utterly wrong. + * Short names must be unique. + */ dirent->name[6] = '~'; dirent->name[7] = '1'; } From 7f642cb287ee046e1c2a0a244fd924c664f48d67 Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Wed, 27 May 2020 20:04:22 +0200 Subject: [PATCH 18/27] trace: clang compatible handling of gd register On ARM systems gd is stored in register r9 or x18. When compiling with clang gd is defined as a macro calling function gd_ptr(). So we can not make assignments to gd. Use function set_gd() for setting the register on ARM. Signed-off-by: Heinrich Schuchardt Reviewed-by: Simon Glass --- lib/trace.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/trace.c b/lib/trace.c index ea8c8e0d40..831283c283 100644 --- a/lib/trace.c +++ b/lib/trace.c @@ -57,12 +57,12 @@ static inline uintptr_t __attribute__((no_instrument_function)) return offset / FUNC_SITE_SIZE; } -#ifdef CONFIG_EFI_LOADER +#if defined(CONFIG_EFI_LOADER) && defined(CONFIG_ARM) /** * trace_gd - the value of the gd register */ -static volatile void *trace_gd; +static volatile gd_t *trace_gd; /** * trace_save_gd() - save the value of the gd register @@ -82,10 +82,10 @@ static void __attribute__((no_instrument_function)) trace_save_gd(void) */ static void __attribute__((no_instrument_function)) trace_swap_gd(void) { - volatile void *temp_gd = trace_gd; + volatile gd_t *temp_gd = trace_gd; trace_gd = gd; - gd = temp_gd; + set_gd(temp_gd); } #else From b87d8d6a0e0c5c37b341c20284ef1c43601cc9c8 Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Wed, 27 May 2020 20:04:23 +0200 Subject: [PATCH 19/27] arm: remove outdated comment concerning -ffixed-x18 Clang 9 supports -ffixed-x18. Signed-off-by: Heinrich Schuchardt Reviewed-by: Simon Glass --- arch/arm/include/asm/global_data.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/arch/arm/include/asm/global_data.h b/arch/arm/include/asm/global_data.h index 7c0905d240..2aafc6d206 100644 --- a/arch/arm/include/asm/global_data.h +++ b/arch/arm/include/asm/global_data.h @@ -96,10 +96,6 @@ static inline gd_t *get_gd(void) gd_t *gd_ptr; #ifdef CONFIG_ARM64 - /* - * Make will already error that reserving x18 is not supported at the - * time of writing, clang: error: unknown argument: '-ffixed-x18' - */ __asm__ volatile("mov %0, x18\n" : "=r" (gd_ptr)); #else __asm__ volatile("mov %0, r9\n" : "=r" (gd_ptr)); From 22a4e006be52fbd5249f46c36c4d8016c15b9fa7 Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Wed, 27 May 2020 20:04:24 +0200 Subject: [PATCH 20/27] arm: use correct argument size of special registers Compiling with clang on ARMv8 shows errors like: ./arch/arm/include/asm/system.h:162:32: note: use constraint modifier "w" asm volatile("msr sctlr_el1, %0" : : "r" (val) : "cc"); ^~ %w0 These errors are due to using an incorrect size for the variables used for writing to and reading from special registers which have 64 bits on ARMv8. Mask off reserved bits when reading the exception level. Signed-off-by: Heinrich Schuchardt --- arch/arm/include/asm/system.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/arch/arm/include/asm/system.h b/arch/arm/include/asm/system.h index 7a40b56acd..b8c1b4ea74 100644 --- a/arch/arm/include/asm/system.h +++ b/arch/arm/include/asm/system.h @@ -133,14 +133,16 @@ enum dcache_option { static inline unsigned int current_el(void) { - unsigned int el; + unsigned long el; + asm volatile("mrs %0, CurrentEL" : "=r" (el) : : "cc"); - return el >> 2; + return 3 & (el >> 2); } static inline unsigned int get_sctlr(void) { - unsigned int el, val; + unsigned int el; + unsigned long val; el = current_el(); if (el == 1) @@ -153,7 +155,7 @@ static inline unsigned int get_sctlr(void) return val; } -static inline void set_sctlr(unsigned int val) +static inline void set_sctlr(unsigned long val) { unsigned int el; From 220b590d5f9f57bfd87f6f95302e286544439a99 Mon Sep 17 00:00:00 2001 From: Andre Przywara Date: Thu, 11 Jun 2020 12:03:15 +0100 Subject: [PATCH 21/27] 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(-) diff --git a/include/configs/vexpress_aemv8a.h b/include/configs/vexpress_aemv8a.h index 09cdd3dab5..e63c335f85 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 From f1dd05bc347b2dc6adb7d49e824b6696d090fb91 Mon Sep 17 00:00:00 2001 From: Andre Przywara Date: Thu, 11 Jun 2020 12:03:16 +0100 Subject: [PATCH 22/27] net: dm: Remove warning about EEPROM provided MAC address Similar to patch 821fec0ceb3e ("net: remove scary warning about EEPROM provided MAC address") this removes the somewhat awkward "warning" on boards using DM_ETH: In many parts of the computing world having a unique MAC address sitting in some on-NIC storage is considered the normal case. If there is a properly provided MAC address (either from ROM or from DT), remove the warning to not scare the user unnecessarily. Signed-off-by: Andre Przywara Reviewed-By: Ramon Fried Reviewed-by: Linus Walleij --- net/eth-uclass.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/net/eth-uclass.c b/net/eth-uclass.c index 7f89f65c92..0d9b75a9a2 100644 --- a/net/eth-uclass.c +++ b/net/eth-uclass.c @@ -560,8 +560,6 @@ static int eth_post_probe(struct udevice *dev) memcpy(pdata->enetaddr, env_enetaddr, ARP_HLEN); } else if (is_valid_ethaddr(pdata->enetaddr)) { eth_env_set_enetaddr_by_index("eth", dev->seq, pdata->enetaddr); - printf("\nWarning: %s using MAC address from %s\n", - dev->name, source); } else if (is_zero_ethaddr(pdata->enetaddr) || !is_valid_ethaddr(pdata->enetaddr)) { #ifdef CONFIG_NET_RANDOM_ETHADDR From 117a52e2387bdfcf7f74c5ec6c4985cdd7c5403e Mon Sep 17 00:00:00 2001 From: Andre Przywara Date: Thu, 11 Jun 2020 12:03:17 +0100 Subject: [PATCH 23/27] net: smc911x: Properly handle EEPROM MAC address When compiled as a DM_ETH driver, the scm911x driver was reading the MAC address from the optional EEPROM storage, but failed to copy this to the platdata struct. Since it was also missing a definition of the read_rom_hwaddr() function, the generic Ethernet code was dismissing this MAC address, falling back to a random address or denying to start at all. Add an implementation of .read_rom_hwaddr, and refactor the function reading the ROM address to be called by all interested parties. This fixes MAC address issues when using the driver in DM_ETH "mode". Signed-off-by: Andre Przywara Reviewed-By: Ramon Fried Reviewed-by: Linus Walleij --- drivers/net/smc911x.c | 60 ++++++++++++++++++++++++++----------------- 1 file changed, 36 insertions(+), 24 deletions(-) diff --git a/drivers/net/smc911x.c b/drivers/net/smc911x.c index 9d2790e561..053ff9f4ff 100644 --- a/drivers/net/smc911x.c +++ b/drivers/net/smc911x.c @@ -187,6 +187,26 @@ static void smc911x_handle_mac_address(struct smc911x_priv *priv) printf(DRIVERNAME ": MAC %pM\n", m); } +static bool smc911x_read_mac_address(struct smc911x_priv *priv) +{ + u32 addrh, addrl; + + /* address is obtained from optional eeprom */ + addrh = smc911x_get_mac_csr(priv, ADDRH); + addrl = smc911x_get_mac_csr(priv, ADDRL); + if (addrl == 0xffffffff && addrh == 0x0000ffff) + return false; + + priv->enetaddr[0] = addrl; + priv->enetaddr[1] = addrl >> 8; + priv->enetaddr[2] = addrl >> 16; + priv->enetaddr[3] = addrl >> 24; + priv->enetaddr[4] = addrh; + priv->enetaddr[5] = addrh >> 8; + + return true; +} + static int smc911x_eth_phy_read(struct smc911x_priv *priv, u8 phy, u8 reg, u16 *val) { @@ -471,7 +491,6 @@ static int smc911x_recv(struct eth_device *dev) int smc911x_initialize(u8 dev_num, int base_addr) { - unsigned long addrl, addrh; struct smc911x_priv *priv; int ret; @@ -489,18 +508,8 @@ int smc911x_initialize(u8 dev_num, int base_addr) goto err_detect; } - addrh = smc911x_get_mac_csr(priv, ADDRH); - addrl = smc911x_get_mac_csr(priv, ADDRL); - if (!(addrl == 0xffffffff && addrh == 0x0000ffff)) { - /* address is obtained from optional eeprom */ - priv->enetaddr[0] = addrl; - priv->enetaddr[1] = addrl >> 8; - priv->enetaddr[2] = addrl >> 16; - priv->enetaddr[3] = addrl >> 24; - priv->enetaddr[4] = addrh; - priv->enetaddr[5] = addrh >> 8; + if (smc911x_read_mac_address(priv)) memcpy(priv->dev.enetaddr, priv->enetaddr, 6); - } priv->dev.init = smc911x_init; priv->dev.halt = smc911x_halt; @@ -565,6 +574,19 @@ static int smc911x_recv(struct udevice *dev, int flags, uchar **packetp) return ret ? ret : -EAGAIN; } +static int smc911x_read_rom_hwaddr(struct udevice *dev) +{ + struct smc911x_priv *priv = dev_get_priv(dev); + struct eth_pdata *pdata = dev_get_platdata(dev); + + if (!smc911x_read_mac_address(priv)) + return -ENODEV; + + memcpy(pdata->enetaddr, priv->enetaddr, sizeof(pdata->enetaddr)); + + return 0; +} + static int smc911x_bind(struct udevice *dev) { return device_set_name(dev, dev->name); @@ -573,7 +595,6 @@ static int smc911x_bind(struct udevice *dev) static int smc911x_probe(struct udevice *dev) { struct smc911x_priv *priv = dev_get_priv(dev); - unsigned long addrh, addrl; int ret; /* Try to detect chip. Will fail if not present. */ @@ -581,17 +602,7 @@ static int smc911x_probe(struct udevice *dev) if (ret) return ret; - addrh = smc911x_get_mac_csr(priv, ADDRH); - addrl = smc911x_get_mac_csr(priv, ADDRL); - if (!(addrl == 0xffffffff && addrh == 0x0000ffff)) { - /* address is obtained from optional eeprom */ - priv->enetaddr[0] = addrl; - priv->enetaddr[1] = addrl >> 8; - priv->enetaddr[2] = addrl >> 16; - priv->enetaddr[3] = addrl >> 24; - priv->enetaddr[4] = addrh; - priv->enetaddr[5] = addrh >> 8; - } + smc911x_read_rom_hwaddr(dev); return 0; } @@ -612,6 +623,7 @@ static const struct eth_ops smc911x_ops = { .send = smc911x_send, .recv = smc911x_recv, .stop = smc911x_stop, + .read_rom_hwaddr = smc911x_read_rom_hwaddr, }; static const struct udevice_id smc911x_ids[] = { From cc696e7caec612c1e334db8cd729e0045662bf00 Mon Sep 17 00:00:00 2001 From: Andre Przywara Date: Thu, 11 Jun 2020 12:03:18 +0100 Subject: [PATCH 24/27] arm: juno: Enable DM_ETH The smc911X driver is now DM enabled, so we can switch the Juno board over to use DM_ETH for the on-board Fast Ethernet device. Works out of the box by using the DT. Signed-off-by: Andre Przywara Reviewed-by: Linus Walleij --- arch/arm/Kconfig | 2 +- board/armltd/vexpress64/vexpress64.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 832686596e..f115fcdcc4 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -1180,7 +1180,7 @@ config TARGET_VEXPRESS64_JUNO select DM_SERIAL select ARM_PSCI_FW select PSCI_RESET - select DM + select DM_ETH select BLK select USB select DM_USB diff --git a/board/armltd/vexpress64/vexpress64.c b/board/armltd/vexpress64/vexpress64.c index fbfa7a18f1..5932a4a0c7 100644 --- a/board/armltd/vexpress64/vexpress64.c +++ b/board/armltd/vexpress64/vexpress64.c @@ -152,11 +152,13 @@ void reset_cpu(ulong addr) int board_eth_init(bd_t *bis) { int rc = 0; +#ifndef CONFIG_DM_ETH #ifdef CONFIG_SMC91111 rc = smc91111_initialize(0, CONFIG_SMC91111_BASE); #endif #ifdef CONFIG_SMC911X rc = smc911x_initialize(0, CONFIG_SMC911X_BASE); +#endif #endif return rc; } From 44a4042b01b547a100c387538196dacfa28b88f4 Mon Sep 17 00:00:00 2001 From: Andre Przywara Date: Thu, 11 Jun 2020 12:03:19 +0100 Subject: [PATCH 25/27] sata_sil: Enable DM_PCI operation Even though the sata_sil driver was converted over to the driver model, it still assumed that the PCI controller is using the legacy interface. Allow the "devno" member to be a struct udevice pointer and use DM_PCI_COMPAT to covert the rest of the interface. Signed-off-by: Andre Przywara Reviewed-by: Linus Walleij --- drivers/ata/sata_sil.c | 11 ++++++++++- drivers/ata/sata_sil.h | 6 +++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/drivers/ata/sata_sil.c b/drivers/ata/sata_sil.c index 6896fa8771..d5ba94c172 100644 --- a/drivers/ata/sata_sil.c +++ b/drivers/ata/sata_sil.c @@ -27,7 +27,11 @@ #include "sata_sil.h" +#ifdef CONFIG_DM_PCI +#define virt_to_bus(devno, v) dm_pci_virt_to_mem(devno, (void *) (v)) +#else #define virt_to_bus(devno, v) pci_virt_to_mem(devno, (void *) (v)) +#endif /* just compatible ahci_ops */ struct sil_ops { @@ -608,13 +612,18 @@ static int sil_init_sata(struct udevice *uc_dev, int dev) /* Save the private struct to block device struct */ #if !CONFIG_IS_ENABLED(BLK) sata_dev_desc[dev].priv = (void *)sata; + sata->devno = sata_info.devno; #else priv->sil_sata_desc[dev] = sata; priv->port_num = dev; +#ifdef CONFIG_DM_PCI + sata->devno = uc_dev->parent; +#else + sata->devno = sata_info.devno; +#endif /* CONFIG_DM_PCI */ #endif sata->id = dev; sata->port = port; - sata->devno = sata_info.devno; sprintf(sata->name, "SATA#%d", dev); sil_cmd_soft_reset(sata); tmp = readl(port + PORT_SSTATUS); diff --git a/drivers/ata/sata_sil.h b/drivers/ata/sata_sil.h index ef41e8259a..a300c0c388 100644 --- a/drivers/ata/sata_sil.h +++ b/drivers/ata/sata_sil.h @@ -21,7 +21,11 @@ struct sil_sata { u16 pio; u16 mwdma; u16 udma; - pci_dev_t devno; +#ifdef CONFIG_DM_PCI + struct udevice *devno; +#else + pci_dev_t devno; +#endif int wcache; int flush; int flush_ext; From eb6211171d1349c43f3b0d0315f31605a0a67f2a Mon Sep 17 00:00:00 2001 From: Andre Przywara Date: Thu, 11 Jun 2020 12:03:20 +0100 Subject: [PATCH 26/27] arm: juno: Enable PCI The ARM Juno boards in their -r1 and -r2 variants sport a PCIe controller, which we configure already in board specific code to be ECAM compliant. Hence we can just enable the generic ECAM driver to let U-Boot use PCIe devices. Add the respective options to the Juno defconfig to enable the PCI framework and the generic ECAM driver, and initialise the driver upon loading U-Boot. Make some functions in the Juno PCIe init code static on the way. Signed-off-by: Andre Przywara Reviewed-by: Linus Walleij --- board/armltd/vexpress64/pcie.c | 14 +++++++++----- configs/vexpress_aemv8a_juno_defconfig | 5 +++++ 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/board/armltd/vexpress64/pcie.c b/board/armltd/vexpress64/pcie.c index 02de58b360..733b190e59 100644 --- a/board/armltd/vexpress64/pcie.c +++ b/board/armltd/vexpress64/pcie.c @@ -72,9 +72,9 @@ JUNO_RESET_STATUS_PHY | \ JUNO_RESET_STATUS_RC) -void xr3pci_set_atr_entry(unsigned long base, unsigned long src_addr, - unsigned long trsl_addr, int window_size, - int trsl_param) +static void xr3pci_set_atr_entry(unsigned long base, unsigned long src_addr, + unsigned long trsl_addr, int window_size, + int trsl_param) { /* X3PCI_ATR_SRC_ADDR_LOW: - bit 0: enable entry, @@ -94,7 +94,7 @@ void xr3pci_set_atr_entry(unsigned long base, unsigned long src_addr, ((u64)1) << window_size, trsl_param); } -void xr3pci_setup_atr(void) +static void xr3pci_setup_atr(void) { /* setup PCIe to CPU address translation tables */ unsigned long base = XR3_CONFIG_BASE + XR3PCI_ATR_PCIE_WIN0; @@ -141,7 +141,7 @@ void xr3pci_setup_atr(void) XR3_PCI_MEMSPACE64_SIZE, XR3PCI_ATR_TRSLID_PCIE_MEMORY); } -void xr3pci_init(void) +static void xr3pci_init(void) { u32 val; int timeout = 200; @@ -193,5 +193,9 @@ void xr3pci_init(void) void vexpress64_pcie_init(void) { + /* Initialise and configure the PCIe host bridge. */ xr3pci_init(); + + /* Register the now ECAM complaint PCIe host controller with U-Boot. */ + pci_init(); } diff --git a/configs/vexpress_aemv8a_juno_defconfig b/configs/vexpress_aemv8a_juno_defconfig index 49acb34310..4866a0e9d5 100644 --- a/configs/vexpress_aemv8a_juno_defconfig +++ b/configs/vexpress_aemv8a_juno_defconfig @@ -32,6 +32,11 @@ CONFIG_CMD_UBI=y # CONFIG_ISO_PARTITION is not set # CONFIG_EFI_PARTITION is not set CONFIG_OF_BOARD=y +CONFIG_PCI=y +CONFIG_DM_PCI=y +CONFIG_PCIE_ECAM_GENERIC=y +CONFIG_DM_PCI_COMPAT=y +CONFIG_CMD_PCI=y CONFIG_ENV_IS_IN_FLASH=y CONFIG_ENV_ADDR=0xBFC0000 # CONFIG_MMC is not set From 9b9f10e3ccded02443162980d34be517886b0645 Mon Sep 17 00:00:00 2001 From: Andre Przywara Date: Thu, 11 Jun 2020 12:03:21 +0100 Subject: [PATCH 27/27] arm: juno: Enable SATA controller The ARM Juno boards (-r1 and -r2) feature a Silicon Image 3132 PCIe SATA controller soldered on the board, providing two SATA ports. Enable the driver and the sata command in the defconfig, to be able to load images from SATA disks. Tested by loading kernels and Grub/EFI from an SSD and successfully booting a Linux system (with and without using UEFI). Signed-off-by: Andre Przywara Reviewed-by: Linus Walleij --- configs/vexpress_aemv8a_juno_defconfig | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/configs/vexpress_aemv8a_juno_defconfig b/configs/vexpress_aemv8a_juno_defconfig index 4866a0e9d5..4654c529e8 100644 --- a/configs/vexpress_aemv8a_juno_defconfig +++ b/configs/vexpress_aemv8a_juno_defconfig @@ -29,14 +29,15 @@ CONFIG_CMD_USB=y CONFIG_CMD_CACHE=y # CONFIG_CMD_MISC is not set CONFIG_CMD_UBI=y -# CONFIG_ISO_PARTITION is not set -# CONFIG_EFI_PARTITION is not set CONFIG_OF_BOARD=y CONFIG_PCI=y CONFIG_DM_PCI=y CONFIG_PCIE_ECAM_GENERIC=y CONFIG_DM_PCI_COMPAT=y CONFIG_CMD_PCI=y +CONFIG_LIBATA=y +CONFIG_SATA_SIL=y +CONFIG_CMD_SATA=y CONFIG_ENV_IS_IN_FLASH=y CONFIG_ENV_ADDR=0xBFC0000 # CONFIG_MMC is not set