From ce5e3ea7995269a49a530284af25cc8cc44bb37d Mon Sep 17 00:00:00 2001 From: Angelo Durgehello Date: Sat, 29 Feb 2020 01:01:32 +0100 Subject: [PATCH 1/7] serial: mcfuart: fix uart port index Actually, using dev->seq value before probe to deduce the current serial port index leads to reading an invalid seq value (-1). So, getting dev->seq at probe time. Signed-off-by: Angelo Durgehello --- drivers/serial/mcfuart.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/serial/mcfuart.c b/drivers/serial/mcfuart.c index 066e5a18d8..b599064b48 100644 --- a/drivers/serial/mcfuart.c +++ b/drivers/serial/mcfuart.c @@ -85,6 +85,8 @@ static int coldfire_serial_probe(struct udevice *dev) { struct coldfire_serial_platdata *plat = dev->platdata; + plat->port = dev->seq; + return mcf_serial_init_common((uart_t *)plat->base, plat->port, plat->baudrate); } @@ -148,8 +150,6 @@ static int coldfire_ofdata_to_platdata(struct udevice *dev) return -ENODEV; plat->base = (uint32_t)addr_base; - - plat->port = dev->seq; plat->baudrate = gd->baudrate; return 0; From 1886024a0e17a37d86dce622e395e37262d7bc3a Mon Sep 17 00:00:00 2001 From: Angelo Durgehello Date: Sat, 29 Feb 2020 01:09:35 +0100 Subject: [PATCH 2/7] serial: mcfuart: renaming to a more appropriate name All drivers seems to align now to serial_xxx maning, so, aligning also this driver, to allow to be found easily. Signed-off-by: Angelo Durgehello --- drivers/serial/Makefile | 2 +- drivers/serial/{mcfuart.c => serial_mcf.c} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename drivers/serial/{mcfuart.c => serial_mcf.c} (100%) diff --git a/drivers/serial/Makefile b/drivers/serial/Makefile index e26b64494e..e4a92bbbb7 100644 --- a/drivers/serial/Makefile +++ b/drivers/serial/Makefile @@ -39,7 +39,7 @@ obj-$(CONFIG_COREBOOT_SERIAL) += serial_coreboot.o obj-$(CONFIG_CORTINA_UART) += serial_cortina.o obj-$(CONFIG_EFI_APP) += serial_efi.o obj-$(CONFIG_LPC32XX_HSUART) += lpc32xx_hsuart.o -obj-$(CONFIG_MCFUART) += mcfuart.o +obj-$(CONFIG_MCFUART) += serial_mcf.o obj-$(CONFIG_SYS_NS16550) += ns16550.o obj-$(CONFIG_S5P) += serial_s5p.o obj-$(CONFIG_MXC_UART) += serial_mxc.o diff --git a/drivers/serial/mcfuart.c b/drivers/serial/serial_mcf.c similarity index 100% rename from drivers/serial/mcfuart.c rename to drivers/serial/serial_mcf.c From dde1b75e9526d887a9aba9d4b30eb62ad2f22013 Mon Sep 17 00:00:00 2001 From: AKASHI Takahiro Date: Tue, 10 Mar 2020 09:20:43 +0900 Subject: [PATCH 3/7] Makefile: doesn't need check stack size when dtb is not built The commit 5fed97af20da ("Makefile: ensure DTB doesn't overflow into initial stack") adds an extra check for stack size in BSS if CONFIG_SYS_INIT_SP_BSS_OFFSET is enabled. This check, however, doesn't make sense under the configuration where control dtb won't be built in and it should be void in such cases. Signed-off-by: AKASHI Takahiro Fixes: 5fed97af20da ("Makefile: ensure DTB doesn't overflow into initial stack") Reviewed-by: Stephen Warren --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 07539ca596..fa687f13a5 100644 --- a/Makefile +++ b/Makefile @@ -903,7 +903,7 @@ ifneq ($(CONFIG_BUILD_TARGET),) ALL-y += $(CONFIG_BUILD_TARGET:"%"=%) endif -ifdef CONFIG_INIT_SP_RELATIVE +ifeq ($(CONFIG_INIT_SP_RELATIVE)$(CONFIG_OF_SEPARATE),yy) ALL-y += init_sp_bss_offset_check endif @@ -1208,7 +1208,7 @@ binary_size_check: u-boot-nodtb.bin FORCE fi \ fi -ifdef CONFIG_INIT_SP_RELATIVE +ifeq ($(CONFIG_INIT_SP_RELATIVE)$(CONFIG_OF_SEPARATE),yy) ifneq ($(CONFIG_SYS_MALLOC_F_LEN),) subtract_sys_malloc_f_len = space=$$(($${space} - $(CONFIG_SYS_MALLOC_F_LEN))) else From 4af2a33ee5b91223f993af9bb0de1a081090634b Mon Sep 17 00:00:00 2001 From: Alex Kiernan Date: Wed, 11 Mar 2020 08:46:29 +0000 Subject: [PATCH 4/7] cmd: gpio: Make `gpio input` return pin value again 4dbc107f4683 ("cmd: gpio: Correct do_gpio() return value") correctly changed the behaviour of the gpio command to return CMD_RET_SUCCESS or CMD_RET_FAILURE, but any existing script which expects the return value to be the pin value is broken by this change. Reinstate the legacy behaviour for `gpio input` only. Fixes: 4dbc107f4683 ("cmd: gpio: Correct do_gpio() return value") Signed-off-by: Alex Kiernan Signed-off-by: Alex Kiernan Reviewed-by: Simon Glass --- cmd/gpio.c | 7 ++++++- test/py/tests/test_gpio.py | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 test/py/tests/test_gpio.py diff --git a/cmd/gpio.c b/cmd/gpio.c index 16c2cebb3d..408a942455 100644 --- a/cmd/gpio.c +++ b/cmd/gpio.c @@ -248,7 +248,12 @@ static int do_gpio(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) if (ret != -EBUSY) gpio_free(gpio); - return CMD_RET_SUCCESS; + /* + * Whilst wrong, the legacy gpio input command returns the pin + * value, or CMD_RET_FAILURE (which is indistinguishable from a + * valid pin value). + */ + return (sub_cmd == GPIOC_INPUT) ? value : CMD_RET_SUCCESS; err: if (ret != -EBUSY) diff --git a/test/py/tests/test_gpio.py b/test/py/tests/test_gpio.py new file mode 100644 index 0000000000..8c64f686b0 --- /dev/null +++ b/test/py/tests/test_gpio.py @@ -0,0 +1,37 @@ +# SPDX-License-Identifier: GPL-2.0+ + +import pytest + +@pytest.mark.boardspec('sandbox') +@pytest.mark.buildconfigspec('cmd_gpio') +def test_gpio_input(u_boot_console): + """Test that gpio input correctly returns the value of a gpio pin.""" + + response = u_boot_console.run_command('gpio input 0; echo rc:$?') + expected_response = 'rc:0' + assert(expected_response in response) + response = u_boot_console.run_command('gpio toggle 0; gpio input 0; echo rc:$?') + expected_response = 'rc:1' + assert(expected_response in response) + +@pytest.mark.boardspec('sandbox') +@pytest.mark.buildconfigspec('cmd_gpio') +def test_gpio_exit_statuses(u_boot_console): + """Test that non-input gpio commands correctly return the command + success/failure status.""" + + expected_response = 'rc:0' + response = u_boot_console.run_command('gpio clear 0; echo rc:$?') + assert(expected_response in response) + response = u_boot_console.run_command('gpio set 0; echo rc:$?') + assert(expected_response in response) + response = u_boot_console.run_command('gpio toggle 0; echo rc:$?') + assert(expected_response in response) + response = u_boot_console.run_command('gpio status -a; echo rc:$?') + assert(expected_response in response) + + expected_response = 'rc:1' + response = u_boot_console.run_command('gpio nonexistent-command; echo rc:$?') + assert(expected_response in response) + response = u_boot_console.run_command('gpio input 200; echo rc:$?') + assert(expected_response in response) From 92a19be25889f1e1689146fedda562f39053bd56 Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Wed, 11 Mar 2020 12:26:53 +0100 Subject: [PATCH 5/7] watchdog: Align Kconfig properties Just cleanup help indentation to be the same for all options. It means indentation. OMAP3 should be indented by tabs which is also fixed. Signed-off-by: Michal Simek --- drivers/watchdog/Kconfig | 56 ++++++++++++++++++++-------------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig index d24c1e4835..cb4da2e3cf 100644 --- a/drivers/watchdog/Kconfig +++ b/drivers/watchdog/Kconfig @@ -24,15 +24,15 @@ config HW_WATCHDOG config WATCHDOG_RESET_DISABLE bool "Disable reset watchdog" help - Disable reset watchdog, which can let WATCHDOG_RESET invalid, so - that the watchdog will not be fed in u-boot. + Disable reset watchdog, which can let WATCHDOG_RESET invalid, so + that the watchdog will not be fed in u-boot. config IMX_WATCHDOG bool "Enable Watchdog Timer support for IMX and LSCH2 of NXP" select HW_WATCHDOG if !WDT help - Select this to enable the IMX and LSCH2 of Layerscape watchdog - driver. + Select this to enable the IMX and LSCH2 of Layerscape watchdog + driver. config OMAP_WATCHDOG bool "TI OMAP watchdog driver" @@ -50,8 +50,8 @@ config DESIGNWARE_WATCHDOG bool "Designware watchdog timer support" select HW_WATCHDOG if !WDT help - Enable this to support Designware Watchdog Timer IP, present e.g. - on Altera SoCFPGA SoCs. + Enable this to support Designware Watchdog Timer IP, present e.g. + on Altera SoCFPGA SoCs. config WDT bool "Enable driver model for watchdog timer drivers" @@ -68,10 +68,10 @@ config WDT_ARMADA_37XX bool "Marvell Armada 37xx watchdog timer support" depends on WDT && ARMADA_3700 help - Enable this to support Watchdog Timer on Marvell Armada 37xx SoC. - There are 4 possible clocks which can be used on these SoCs. This - driver uses the second clock (ID 1), assuming that so will also - Linux's driver. + Enable this to support Watchdog Timer on Marvell Armada 37xx SoC. + There are 4 possible clocks which can be used on these SoCs. This + driver uses the second clock (ID 1), assuming that so will also + Linux's driver. config WDT_ASPEED bool "Aspeed ast2400/ast2500 watchdog timer support" @@ -88,8 +88,8 @@ config WDT_AT91 bool "AT91 watchdog timer support" depends on WDT help - Select this to enable Microchip watchdog timer, which can be found on - some AT91 devices. + Select this to enable Microchip watchdog timer, which can be found on + some AT91 devices. config WDT_BCM6345 bool "BCM6345 watchdog timer support" @@ -105,8 +105,8 @@ config WDT_CDNS depends on WDT imply WATCHDOG help - Select this to enable Cadence watchdog timer, which can be found on some - Xilinx Microzed Platform. + Select this to enable Cadence watchdog timer, which can be found on some + Xilinx Microzed Platform. config WDT_CORTINA bool "Cortina Access CAxxxx watchdog timer support" @@ -114,21 +114,21 @@ config WDT_CORTINA help Cortina Access CAxxxx watchdog timer support. This driver support all CPU ISAs supported by Cortina - Access CAxxxx SoCs. + Access CAxxxx SoCs. config WDT_MPC8xx bool "MPC8xx watchdog timer support" depends on WDT && MPC8xx select HW_WATCHDOG help - Select this to enable mpc8xx watchdog timer + Select this to enable mpc8xx watchdog timer config WDT_MT7621 bool "MediaTek MT7621 watchdog timer support" depends on WDT && SOC_MT7628 help - Select this to enable Ralink / Mediatek watchdog timer, - which can be found on some MediaTek chips. + Select this to enable Ralink / Mediatek watchdog timer, + which can be found on some MediaTek chips. config WDT_MTK bool "MediaTek watchdog timer support" @@ -139,10 +139,10 @@ config WDT_MTK It performs full SoC reset. config WDT_OMAP3 - bool "TI OMAP watchdog timer support" - depends on WDT && ARCH_OMAP2PLUS - default y if AM33XX - help + bool "TI OMAP watchdog timer support" + depends on WDT && ARCH_OMAP2PLUS + default y if AM33XX + help This enables OMAP3+ watchdog timer driver, which can be found on some TI chipsets and inline with driver model. @@ -151,8 +151,8 @@ config WDT_ORION depends on WDT select CLK help - Select this to enable Orion watchdog timer, which can be found on some - Marvell Armada chips. + Select this to enable Orion watchdog timer, which can be found on some + Marvell Armada chips. config WDT_SANDBOX bool "Enable Watchdog Timer support for Sandbox" @@ -166,8 +166,8 @@ config WDT_SP805 bool "SP805 watchdog timer support" depends on WDT help - Select this to enable SP805 watchdog timer, which can be found on some - nxp layerscape chips. + Select this to enable SP805 watchdog timer, which can be found on some + nxp layerscape chips. config WDT_STM32MP bool "IWDG watchdog driver for STM32 MP's family" @@ -182,8 +182,8 @@ config XILINX_TB_WATCHDOG depends on WDT imply WATCHDOG help - Select this to enable Xilinx Axi watchdog timer, which can be found on some - Xilinx Microblaze Platforms. + Select this to enable Xilinx Axi watchdog timer, which can be found on some + Xilinx Microblaze Platforms. config WDT_TANGIER bool "Intel Tangier watchdog timer support" From 183780491f9b45da6bec9627304b2c26169e8801 Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Wed, 11 Mar 2020 21:51:08 +0100 Subject: [PATCH 6/7] fit: check return value of fit_image_get_data_size() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit GCC-10 reports: In file included from tools/common/image-fit.c:1: include/image.h: In function ‘fit_image_get_data_and_size’: ./tools/../common/image-fit.c:1015:9: warning: ‘len’ may be used uninitialized in this function [-Wmaybe-uninitialized] 1015 | *size = len; | ~~~~~~^~~~~ ./tools/../common/image-fit.c:996:6: note: ‘len’ was declared here 996 | int len; | ^~~ Add the missing check of the return value of fit_image_get_data_size(). Fixes: c3c863880479 ("add FIT data-position & data-offset property support") Signed-off-by: Heinrich Schuchardt Reviewed-by: Simon Goldschmidt --- common/image-fit.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/common/image-fit.c b/common/image-fit.c index f3bb00c98a..4435bc4f1d 100644 --- a/common/image-fit.c +++ b/common/image-fit.c @@ -1011,8 +1011,10 @@ int fit_image_get_data_and_size(const void *fit, int noffset, if (external_data) { debug("External Data\n"); ret = fit_image_get_data_size(fit, noffset, &len); - *data = fit + offset; - *size = len; + if (!ret) { + *data = fit + offset; + *size = len; + } } else { ret = fit_image_get_data(fit, noffset, data, size); } From d21ffa2a2ebc366b8ca644324d76bb2924947373 Mon Sep 17 00:00:00 2001 From: Patrice Chotard Date: Thu, 12 Mar 2020 11:11:18 +0100 Subject: [PATCH 7/7] MAINTAINERS: update entry for ARM STI Add STi drivers/include files and git tree. Signed-off-by: Patrice Chotard --- MAINTAINERS | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 2c43573ff5..92dda40a85 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -329,8 +329,21 @@ F: drivers/usb/host/ehci-msm.c ARM STI M: Patrice Chotard S: Maintained +T: git https://gitlab.denx.de/u-boot/custodians/u-boot-stm.git F: arch/arm/mach-sti/ F: arch/arm/include/asm/arch-sti*/ +F: drivers/phy/sti_usb_phy.c +F: drivers/pinctrl/pinctrl-sti.c +F: drivers/mmc/sti_sdhci.c +F: drivers/reset/sti-reset.c +F: drivers/serial/serial_sti_asc.c +F: drivers/sysreset/sysreset_sti.c +F: drivers/timer/sti-timer.c +F: drivers/usb/host/dwc3-sti-glue.c +F: include/dwc3-sti-glue.h +F: include/dt-bindings/clock/stih407-clks.h +F: include/dt-bindings/clock/stih410-clks.h +F: include/dt-bindings/reset/stih407-resets.h ARM STM SPEAR #M: Vipin Kumar