Merge branch '2020-03-13-master-imports'

- Address the regression with the 'gpio' command
- Fix mcfuart regression
- Other minor fixes
This commit is contained in:
Tom Rini 2020-03-13 13:21:17 -04:00
commit 50be9f0e1c
8 changed files with 93 additions and 36 deletions

View file

@ -329,8 +329,21 @@ F: drivers/usb/host/ehci-msm.c
ARM STI ARM STI
M: Patrice Chotard <patrice.chotard@st.com> M: Patrice Chotard <patrice.chotard@st.com>
S: Maintained S: Maintained
T: git https://gitlab.denx.de/u-boot/custodians/u-boot-stm.git
F: arch/arm/mach-sti/ F: arch/arm/mach-sti/
F: arch/arm/include/asm/arch-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 ARM STM SPEAR
#M: Vipin Kumar <vipin.kumar@st.com> #M: Vipin Kumar <vipin.kumar@st.com>

View file

@ -903,7 +903,7 @@ ifneq ($(CONFIG_BUILD_TARGET),)
ALL-y += $(CONFIG_BUILD_TARGET:"%"=%) ALL-y += $(CONFIG_BUILD_TARGET:"%"=%)
endif endif
ifdef CONFIG_INIT_SP_RELATIVE ifeq ($(CONFIG_INIT_SP_RELATIVE)$(CONFIG_OF_SEPARATE),yy)
ALL-y += init_sp_bss_offset_check ALL-y += init_sp_bss_offset_check
endif endif
@ -1208,7 +1208,7 @@ binary_size_check: u-boot-nodtb.bin FORCE
fi \ fi \
fi fi
ifdef CONFIG_INIT_SP_RELATIVE ifeq ($(CONFIG_INIT_SP_RELATIVE)$(CONFIG_OF_SEPARATE),yy)
ifneq ($(CONFIG_SYS_MALLOC_F_LEN),) ifneq ($(CONFIG_SYS_MALLOC_F_LEN),)
subtract_sys_malloc_f_len = space=$$(($${space} - $(CONFIG_SYS_MALLOC_F_LEN))) subtract_sys_malloc_f_len = space=$$(($${space} - $(CONFIG_SYS_MALLOC_F_LEN)))
else else

View file

@ -248,7 +248,12 @@ static int do_gpio(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
if (ret != -EBUSY) if (ret != -EBUSY)
gpio_free(gpio); 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: err:
if (ret != -EBUSY) if (ret != -EBUSY)

View file

@ -1011,8 +1011,10 @@ int fit_image_get_data_and_size(const void *fit, int noffset,
if (external_data) { if (external_data) {
debug("External Data\n"); debug("External Data\n");
ret = fit_image_get_data_size(fit, noffset, &len); ret = fit_image_get_data_size(fit, noffset, &len);
if (!ret) {
*data = fit + offset; *data = fit + offset;
*size = len; *size = len;
}
} else { } else {
ret = fit_image_get_data(fit, noffset, data, size); ret = fit_image_get_data(fit, noffset, data, size);
} }

View file

@ -39,7 +39,7 @@ obj-$(CONFIG_COREBOOT_SERIAL) += serial_coreboot.o
obj-$(CONFIG_CORTINA_UART) += serial_cortina.o obj-$(CONFIG_CORTINA_UART) += serial_cortina.o
obj-$(CONFIG_EFI_APP) += serial_efi.o obj-$(CONFIG_EFI_APP) += serial_efi.o
obj-$(CONFIG_LPC32XX_HSUART) += lpc32xx_hsuart.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_SYS_NS16550) += ns16550.o
obj-$(CONFIG_S5P) += serial_s5p.o obj-$(CONFIG_S5P) += serial_s5p.o
obj-$(CONFIG_MXC_UART) += serial_mxc.o obj-$(CONFIG_MXC_UART) += serial_mxc.o

View file

@ -85,6 +85,8 @@ static int coldfire_serial_probe(struct udevice *dev)
{ {
struct coldfire_serial_platdata *plat = dev->platdata; struct coldfire_serial_platdata *plat = dev->platdata;
plat->port = dev->seq;
return mcf_serial_init_common((uart_t *)plat->base, return mcf_serial_init_common((uart_t *)plat->base,
plat->port, plat->baudrate); plat->port, plat->baudrate);
} }
@ -148,8 +150,6 @@ static int coldfire_ofdata_to_platdata(struct udevice *dev)
return -ENODEV; return -ENODEV;
plat->base = (uint32_t)addr_base; plat->base = (uint32_t)addr_base;
plat->port = dev->seq;
plat->baudrate = gd->baudrate; plat->baudrate = gd->baudrate;
return 0; return 0;

View file

@ -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)