From 94ca269049e2a57107c3d7a3713e8bfd054a2153 Mon Sep 17 00:00:00 2001 From: Andy Shevchenko Date: Tue, 11 Dec 2018 18:22:28 +0200 Subject: [PATCH 01/11] scripts/check-config.sh: Add usage() When arguments are not supplied the error message is misleading and doesn't tell what exactly has to be done. Fix this by adding usage() and call it if above circumstance occurs. Signed-off-by: Andy Shevchenko Reviewed-by: Simon Glass --- scripts/check-config.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/scripts/check-config.sh b/scripts/check-config.sh index 4848ca6e25..583f7d0963 100755 --- a/scripts/check-config.sh +++ b/scripts/check-config.sh @@ -17,6 +17,15 @@ set -e set -u +PROG_NAME="${0##*/}" + +usage() { + echo "$PROG_NAME " + exit 1 +} + +[ $# -ge 3 ] || usage + path="$1" whitelist="$2" srctree="$3" From 5766a271761210a78faf04b68136676a672fabc4 Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Fri, 14 Dec 2018 22:43:48 +0100 Subject: [PATCH 02/11] tests: enable DT overlay tests by default Enable device tree overlay tests by default if unit tests are selected and the runtime is configured via device tree. Overlays have been mainlined in the device tree compiler so there is no reason anymore to disable the tests by default. Signed-off-by: Heinrich Schuchardt --- test/overlay/Kconfig | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/test/overlay/Kconfig b/test/overlay/Kconfig index 13c85428cb..a4f154415d 100644 --- a/test/overlay/Kconfig +++ b/test/overlay/Kconfig @@ -1,11 +1,10 @@ config UT_OVERLAY bool "Enable Device Tree Overlays Unit Tests" - depends on OF_LIBFDT_OVERLAY - depends on UNIT_TEST + depends on UNIT_TEST && OF_CONTROL + default y + select OF_LIBFDT_OVERLAY help This enables the 'ut overlay' command which runs a series of unit tests on the fdt overlay code. If all is well then all tests pass although there will be a few messages printed along the way. - Be warned that it requires an out-of-tree dtc compiler with patches - to support the DT overlays, otherwise it will fail. From a1702746dfd985f69c1c32ae9618f066443e43a9 Mon Sep 17 00:00:00 2001 From: Adam Ford Date: Fri, 14 Dec 2018 16:28:30 -0600 Subject: [PATCH 03/11] ARM: mach-omap2: omap3: Fix GPIO clocking in SPL OMAP3_GPIO_x is needed to enable each GPIO bank on the OMAP3 boards. At one point, the #ifdef's were replaced with if CONFIG_IS_ENABLED but this won't work for people who need OMAP3_GPIO_x in SPL since the SPL prefix for this option isn't used in Kconfig. This patch moves the check to #if defined and also makes Kconfig select the banks if CMD_GPIO is used which makes the checks in the code less cumbersome. Fixes: bd8a9c14c91c ("arm: mach-omap2/omap3/clock.c: Enable all GPIO with CMD_GPIO") Reported-by: Liam O'Shaughnessy Signed-off-by: Adam Ford [trini: Migrate omap3_igep00x0.h] Signed-off-by: Tom Rini --- arch/arm/mach-omap2/omap3/Kconfig | 5 +++++ arch/arm/mach-omap2/omap3/clock.c | 10 +++++----- include/configs/omap3_igep00x0.h | 4 ---- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/arch/arm/mach-omap2/omap3/Kconfig b/arch/arm/mach-omap2/omap3/Kconfig index e0d02fb4e5..0286b0daa3 100644 --- a/arch/arm/mach-omap2/omap3/Kconfig +++ b/arch/arm/mach-omap2/omap3/Kconfig @@ -3,18 +3,23 @@ if OMAP34XX # We only enable the clocks for the GPIO banks that a given board requies. config OMAP3_GPIO_2 bool + default y if CMD_GPIO config OMAP3_GPIO_3 bool + default y if CMD_GPIO config OMAP3_GPIO_4 bool + default y if CMD_GPIO config OMAP3_GPIO_5 bool + default y if CMD_GPIO config OMAP3_GPIO_6 bool + default y if CMD_GPIO choice prompt "OMAP3 board select" diff --git a/arch/arm/mach-omap2/omap3/clock.c b/arch/arm/mach-omap2/omap3/clock.c index 9a03bfa9d3..cb9e91ebc3 100644 --- a/arch/arm/mach-omap2/omap3/clock.c +++ b/arch/arm/mach-omap2/omap3/clock.c @@ -750,23 +750,23 @@ void per_clocks_enable(void) setbits_le32(&prcm_base->iclken_per, 0x00000800); #endif -#if (CONFIG_IS_ENABLED(OMAP3_GPIO_2) || CONFIG_IS_ENABLED(CMD_GPIO)) +#if defined(CONFIG_OMAP3_GPIO_2) setbits_le32(&prcm_base->fclken_per, 0x00002000); setbits_le32(&prcm_base->iclken_per, 0x00002000); #endif -#if (CONFIG_IS_ENABLED(OMAP3_GPIO_3) || CONFIG_IS_ENABLED(CMD_GPIO)) +#if defined(CONFIG_OMAP3_GPIO_3) setbits_le32(&prcm_base->fclken_per, 0x00004000); setbits_le32(&prcm_base->iclken_per, 0x00004000); #endif -#if (CONFIG_IS_ENABLED(OMAP3_GPIO_4) || CONFIG_IS_ENABLED(CMD_GPIO)) +#if defined(CONFIG_OMAP3_GPIO_4) setbits_le32(&prcm_base->fclken_per, 0x00008000); setbits_le32(&prcm_base->iclken_per, 0x00008000); #endif -#if (CONFIG_IS_ENABLED(OMAP3_GPIO_5) || CONFIG_IS_ENABLED(CMD_GPIO)) +#if defined(CONFIG_OMAP3_GPIO_5) setbits_le32(&prcm_base->fclken_per, 0x00010000); setbits_le32(&prcm_base->iclken_per, 0x00010000); #endif -#if (CONFIG_IS_ENABLED(OMAP3_GPIO_6) || CONFIG_IS_ENABLED(CMD_GPIO)) +#if defined(CONFIG_OMAP3_GPIO_6) setbits_le32(&prcm_base->fclken_per, 0x00020000); setbits_le32(&prcm_base->iclken_per, 0x00020000); #endif diff --git a/include/configs/omap3_igep00x0.h b/include/configs/omap3_igep00x0.h index b9d6569752..775374cf28 100644 --- a/include/configs/omap3_igep00x0.h +++ b/include/configs/omap3_igep00x0.h @@ -20,10 +20,6 @@ #define CONFIG_REVISION_TAG 1 -/* GPIO banks */ -#define CONFIG_OMAP3_GPIO_2 /* GPIO32..63 is in GPIO bank 2 */ -#define CONFIG_OMAP3_GPIO_4 /* GPIO96..127 is in GPIO bank 4 */ - /* TPS65950 */ #define PBIASLITEVMODE1 (1 << 8) From a7f4b4b344396590845e6552c82829ef68ef9f89 Mon Sep 17 00:00:00 2001 From: Lukasz Majewski Date: Tue, 18 Dec 2018 12:30:50 +0100 Subject: [PATCH 04/11] dm: pinctrl: Prevent (re-)configuring pins when already done before relocation This commit prevents from re-configuring pins if those were configured before relocation. Some pins - like UART or DDR must be setup before relocation (as they have 'u-boot,dm-pre-reloc' property set in DTS). Without this change, those pins are re-configured after relocation (pre_reloc_only = 0, so we do not "continue"). Such behavior may be a problem for DDR PAD configuration, as they might be already leveled/tuned with original setup). Signed-off-by: Lukasz Majewski --- drivers/pinctrl/pinctrl-uclass.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/pinctrl/pinctrl-uclass.c b/drivers/pinctrl/pinctrl-uclass.c index 6db0445067..29c910c55f 100644 --- a/drivers/pinctrl/pinctrl-uclass.c +++ b/drivers/pinctrl/pinctrl-uclass.c @@ -117,9 +117,9 @@ static int pinconfig_post_bind(struct udevice *dev) int ret; dev_for_each_subnode(node, dev) { - if (pre_reloc_only && - !ofnode_pre_reloc(node)) + if (pre_reloc_only ^ ofnode_pre_reloc(node)) continue; + /* * If this node has "compatible" property, this is not * a pin configuration node, but a normal device. skip. From 8efae021db1166ea07be0b2eda7f074d767843ea Mon Sep 17 00:00:00 2001 From: Cristian Ciocaltea Date: Tue, 18 Dec 2018 20:03:49 +0200 Subject: [PATCH 05/11] api: storage: Fix enumeration of storage devices dev_stor_get() is not able to find the next available device in the current storage group when the previous enumerated device belongs to a different group or class (e.g. network). The root cause is the device group iterator not being reset after an unsuccessful search for the last returned device so that the following search for the next available device will start from beginning. The issue has been identified by loading and booting GRUB in a QEMU vexpress-a9 environment. Signed-off-by: Cristian Ciocaltea --- api/api_storage.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/api/api_storage.c b/api/api_storage.c index 8aeeda2715..2b90c18aae 100644 --- a/api/api_storage.c +++ b/api/api_storage.c @@ -99,6 +99,7 @@ static int dev_stor_get(int type, int *more, struct device_info *di) { struct blk_desc *dd; int found = 0; + int found_last = 0; int i = 0; /* Wasn't configured for this type, return 0 directly */ @@ -111,9 +112,13 @@ static int dev_stor_get(int type, int *more, struct device_info *di) if (di->cookie == (void *)blk_get_dev(specs[type].name, i)) { i += 1; + found_last = 1; break; } } + + if (!found_last) + i = 0; } for (; i < specs[type].max_dev; i++) { From adc702e22948ec5fe7b6706d0d66ec3bdd35e323 Mon Sep 17 00:00:00 2001 From: Lokesh Vutla Date: Wed, 19 Dec 2018 12:53:31 +0530 Subject: [PATCH 06/11] arm: K3: Fix usage of CONFIG_SYS_K3_KEY For signing the tiboot3.bin image, an optional KEY file can be passed using CONFIG_SYS_K3_KEY. Right now, Makefile scripts directly takes the config value and uses it for signing. This is okay if the build directory is a sub-directory of source tree, otherwise it fails. Fix it by using the path relative to the source tree. Reported-by: Jean-Jacques Hiblot Signed-off-by: Lokesh Vutla --- arch/arm/mach-k3/config.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/mach-k3/config.mk b/arch/arm/mach-k3/config.mk index 7fc0b3f357..be00d79fb0 100644 --- a/arch/arm/mach-k3/config.mk +++ b/arch/arm/mach-k3/config.mk @@ -37,7 +37,7 @@ cmd_gencert = cat $(srctree)/tools/k3_x509template.txt | sed $(SED_OPTS) > u-boo ifeq ($(CONFIG_SYS_K3_KEY), "") KEY=u-boot-spl-eckey.pem else -KEY=$(patsubst "%",%,$(CONFIG_SYS_K3_KEY)) +KEY=$(patsubst "%",$(srctree)/%,$(CONFIG_SYS_K3_KEY)) endif u-boot-spl-eckey.pem: FORCE From 7b4ea2d888b434c6c07e124a0615da0468624971 Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Wed, 19 Dec 2018 16:57:38 +0100 Subject: [PATCH 07/11] phy: Fix u-boot coruption when fixed-phy is used When fixed-link phy is used subnode offset is used as phy address. This number is bigger then space allocated for bus structure (allocated via mdio_alloc). bus->phymap[] array has PHY_MAX_ADDR size (32). That's why writing bus->phymap[addr] where addr is < 0 or > PHY_MAX_ADDR is causing write to memory which can caused full U-Boot crash. The patch is checking if address is in correct range. Signed-off-by: Michal Simek --- drivers/net/phy/phy.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c index e837eb7688..cda4caa803 100644 --- a/drivers/net/phy/phy.c +++ b/drivers/net/phy/phy.c @@ -656,7 +656,8 @@ static struct phy_device *phy_device_create(struct mii_dev *bus, int addr, phy_probe(dev); - bus->phymap[addr] = dev; + if (addr >= 0 && addr < PHY_MAX_ADDR) + bus->phymap[addr] = dev; return dev; } From 7d39b748ed868d5024d0653e5337bcc51a66b0f0 Mon Sep 17 00:00:00 2001 From: Weijie Gao Date: Thu, 20 Dec 2018 16:12:49 +0800 Subject: [PATCH 08/11] mt7623: fix a typo in include/configs/mt7623.h Fix typo: neede -> needed Signed-off-by: Weijie Gao --- include/configs/mt7623.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/configs/mt7623.h b/include/configs/mt7623.h index 68da920e30..ba763501cf 100644 --- a/include/configs/mt7623.h +++ b/include/configs/mt7623.h @@ -46,7 +46,7 @@ /* DRAM */ #define CONFIG_SYS_SDRAM_BASE 0x80000000 -/* This is neede for kernel booting */ +/* This is needed for kernel booting */ #define FDT_HIGH "fdt_high=0xac000000\0" /* Extra environment variables */ From 1f5a3cd0aa36b5acf4d705de063028880a1273a2 Mon Sep 17 00:00:00 2001 From: Weijie Gao Date: Thu, 20 Dec 2018 16:12:50 +0800 Subject: [PATCH 09/11] mt7629: use linux kernel compatible SMP initialization This patch changes mt7629 to use the compatible platform SMP initialization method of linux kernel. Signed-off-by: Weijie Gao --- arch/arm/mach-mediatek/mt7629/lowlevel_init.S | 52 ++++++++++++++++--- 1 file changed, 44 insertions(+), 8 deletions(-) diff --git a/arch/arm/mach-mediatek/mt7629/lowlevel_init.S b/arch/arm/mach-mediatek/mt7629/lowlevel_init.S index 90dd4ea48e..3375796b79 100644 --- a/arch/arm/mach-mediatek/mt7629/lowlevel_init.S +++ b/arch/arm/mach-mediatek/mt7629/lowlevel_init.S @@ -5,6 +5,14 @@ #include +#define WAIT_CODE_SRAM_BASE 0x0010ff00 + +#define SLAVE_JUMP_REG 0x10202034 +#define SLAVE1_MAGIC_REG 0x10202038 +#define SLAVE1_MAGIC_NUM 0x534c4131 + +#define GIC_CPU_BASE 0x10320000 + ENTRY(lowlevel_init) #ifndef CONFIG_SPL_BUILD @@ -28,6 +36,7 @@ ENTRY(lowlevel_init) mrc p15, 0, r0, c0, c0, 5 ands r1, r0, #0x40000000 bne go @ Go if UP + /* read slave CPU number */ ands r0, r0, #0x0f beq go @ Go if core0 on primary core tile b secondary @@ -37,14 +46,41 @@ go: mov pc, lr secondary: - /* read slave CPU number into r0 firstly */ - mrc p15, 0, r0, c0, c0, 5 - and r0, r0, #0x0f + /* enable GIC as cores will be waken up by IPI */ + ldr r2, =GIC_CPU_BASE + mov r1, #0xf0 + str r1, [r2, #4] + mov r1, #1 + str r1, [r2, #0] + + ldr r1, [r2] + orr r1, #1 + str r1, [r2] + + /* copy wait code into SRAM */ + ldr r0, =slave_cpu_wait + ldm r0, {r1 - r8} @ slave_cpu_wait has eight insns + ldr r0, =WAIT_CODE_SRAM_BASE + stm r0, {r1 - r8} + + /* pass args to slave_cpu_wait */ + ldr r0, =SLAVE1_MAGIC_REG + ldr r1, =SLAVE1_MAGIC_NUM + + /* jump to wait code in SRAM */ + ldr pc, =WAIT_CODE_SRAM_BASE -loop: - dsb - isb - wfi @Zzz... - b loop #endif ENDPROC(lowlevel_init) + +/* This function will be copied into SRAM */ +ENTRY(slave_cpu_wait) + wfi + ldr r2, [r0] + cmp r2, r1 + bne slave_cpu_wait + movw r0, #:lower16:SLAVE_JUMP_REG + movt r0, #:upper16:SLAVE_JUMP_REG + ldr r1, [r0] + mov pc, r1 +ENDPROC(slave_cpu_wait) From ca80b561e18b69f55a632f12f0ca0ffa04456c69 Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Fri, 21 Dec 2018 02:57:03 +0100 Subject: [PATCH 10/11] doc: README.commands: sub-commands Describe the implementation of sub-commands. Signed-off-by: Heinrich Schuchardt Reviewed-by: Simon Glass --- doc/README.commands | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/doc/README.commands b/doc/README.commands index 1d29c4d91d..0ccadae0b7 100644 --- a/doc/README.commands +++ b/doc/README.commands @@ -28,6 +28,42 @@ comp: Pointer to the completion function. May be NULL. entering the command arguments to complete the entry. Command completion is only available if CONFIG_AUTO_COMPLETE is defined. +Sub-command definition +---------------------- + +Likewise an array of cmd_tbl_t holding sub-commands can be created using either +of the following macros: + +* U_BOOT_CMD_MKENT(name, maxargs, repeatable, command, "usage", "help") +* U_BOOT_CMD_MKENTCOMPLETE(name, maxargs, repeatable, command, "usage, "help", + comp) + +This table has to be evaluated in the command function of the main command, e.g. + + static cmd_tbl_t cmd_sub[] = { + U_BOOT_CMD_MKENT(foo, CONFIG_SYS_MAXARGS, 1, do_foo, "", ""), + U_BOOT_CMD_MKENT(bar, CONFIG_SYS_MAXARGS, 1, do_bar, "", ""), + }; + + static int do_cmd(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) + { + cmd_tbl_t *cp; + + if (argc < 2) + return CMD_RET_USAGE; + + /* drop sub-command argument */ + argc--; + argv++; + + cp = find_cmd_tbl(argv[0], cmd_ut_sub, ARRAY_SIZE(cmd_sub)); + + if (cp) + return cp->cmd(cmdtp, flag, argc, argv); + + return CMD_RET_USAGE; + } + Command function ---------------- From e17e0ceb83538c015a50b965547f2f4d38f81c5d Mon Sep 17 00:00:00 2001 From: Lokesh Vutla Date: Mon, 24 Dec 2018 16:37:41 +0530 Subject: [PATCH 11/11] power: regulator: Return success on attempt to disable an always-on regulator commit 4f86a724e82c0 ("power: regulator: denied disable on always-on regulator") throws an error when requested to disable an always-on regulator. It is right that an always-on regulator should not be attempted to be disabled. But at the same time regulator framework should not return an error when such request is received. Instead it should just return success without attempting to disable the specified regulator. This is because the requesting driver will not have the idea if the regulator is always-on or not. The requesting driver will always try to enable/disable regulator as per the required flow. So it is upto regulator framework to not break such scenarios. Fixes: 4f86a724e82c0 ("power: regulator: denied disable on always-on regulator") Reported-by: Jean-Jacques Hiblot Reviewed-by: Faiz Abbas Signed-off-by: Lokesh Vutla --- drivers/power/regulator/regulator-uclass.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/power/regulator/regulator-uclass.c b/drivers/power/regulator/regulator-uclass.c index 4511625ff2..39e46279d5 100644 --- a/drivers/power/regulator/regulator-uclass.c +++ b/drivers/power/regulator/regulator-uclass.c @@ -113,7 +113,7 @@ int regulator_set_enable(struct udevice *dev, bool enable) uc_pdata = dev_get_uclass_platdata(dev); if (!enable && uc_pdata->always_on) - return -EACCES; + return 0; return ops->set_enable(dev, enable); }