u-boot/drivers
Maksim Kiselev fa03568e46 serial-uclass: reset gd->cur_serial_dev to NULL if serial not found
Reset gd->cur_serial_dev pointer to avoid calling non-relocated code
from relocated code if a serial driver is not found and
CONFIG_REQUIRE_SERIAL_CONSOLE is disabled.

Here is detailed explanation of what this patch is trying to fix.

U-boot calls the serial_find_console_or_panic() function twice.
The first console setup occurs before U-boot relocation in
the serial_init(). This stage uses simple FDT parsing and
assigns gd->cur_serial_dev to a "serial" device that lives in
non-relocated code too.

The second console setup after U-boot relocation(from serial_initialize())
may use full live DT (if OF_LIVE enabled) probe sequence with buses,
clocks, resets, etc... And if the console setup fails at this step,
than we should be caught by panic_str("No serial driver found").

But... If we disable CONFIG_REQUIRE_SERIAL_CONSOLE, than we
return from serial_init() with gd->cur_serial_dev pointing
to the "old"(non-relocated) serial device.

And if this area, where "old" serial device is placed, is changed
(e.g. Linux kernel may be relocated at this address), than we will get
an unexpected crash on the next call of printf().

Signed-off-by: Maksim Kiselev <bigunclemax@gmail.com>
2023-08-30 17:56:21 -04:00
..
adc adc: Use regulator_set_enable_if_allowed 2023-08-14 09:14:41 -04:00
ata ata: dwc_ahci: Fix support for other platforms 2023-07-28 18:45:03 +08:00
axi axi: fix definition of axi_sandbox_get_emul() 2023-06-01 12:32:03 -04:00
bios_emulator bios_emulator: Drop VIDEO_IO_OFFSET 2023-07-17 17:08:44 +08:00
block blk: Add bounce buffer support to read/write operations 2023-08-22 15:17:53 -04:00
bootcount global: Move remaining CONFIG_SYS_* to CFG_SYS_* 2022-12-05 16:06:08 -05:00
bus bus: Optionally include TI sysc driver in SPL/TPL 2022-12-02 08:39:00 -05:00
button dm: button: add support for linux_code in button-gpio.c driver 2023-02-10 12:50:01 -05:00
cache drivers: use dev_read_addr_ptr when cast to pointer 2023-05-06 17:28:18 +08:00
clk Merge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-sh 2023-08-20 11:09:11 -04:00
core dm: core: Correct error handling when event fails 2023-08-25 17:55:18 -04:00
cpu imx9: add i.MX93 variants support 2023-05-21 16:54:41 +02:00
crypto Correct SPL uses of HW_WATCHDOG 2023-02-10 07:41:39 -05:00
ddr treewide: unify the linker symbol reference format 2023-08-09 09:21:42 -04:00
demo demo: migrate uclass to livetree 2021-10-05 08:50:15 -04:00
dfu dfu: Add proper dependency for CONFIG_DFU_MMC 2023-07-17 15:38:11 -04:00
dma dma: ti: Update J21E PSIL endpoint information for MAIN CPSW0 2023-08-15 17:46:39 -04:00
extcon extcon: add MAX14526 MUIC support 2023-05-02 14:23:58 -04:00
fastboot Kconfigs: Correct default of "0" on hex type entries 2023-08-09 09:21:42 -04:00
firmware arm_ffa: use debug logs 2023-08-17 12:29:21 -04:00
fpga event: Add fpga load event 2023-07-21 09:00:39 +02:00
fuzz sandbox: Implement fuzzing engine driver 2022-06-23 12:58:19 -04:00
fwu-mdata FWU: Add FWU metadata access driver for MTD storage regions 2023-06-09 13:52:40 -04:00
gpio gpio: pca953x: Add TI TCA9554 support 2023-08-17 16:39:20 -04:00
hwspinlock treewide: invaild -> invalid 2022-01-13 07:57:49 -05:00
i2c Prepare v2023.10-rc3 2023-08-21 17:32:17 -04:00
input input: Flush the keyboard buffer before resetting it 2023-05-11 10:25:29 +08:00
iommu iommu: Implement mapping IOMMUs for PCI devices 2023-01-27 14:47:58 -05:00
led drivers: led: bcm6858: do not use null label to find the top 2023-07-25 12:44:46 -04:00
mailbox mailbox: k3-sec-proxy: Fill non-message tx data fields with 0x0 2023-07-25 12:44:46 -04:00
memory memory: atmel-ebi: add Atmel EBI (External Bus Interface) driver 2022-12-08 18:06:27 +02:00
mfd mfd: syscon: atmel-smc: Add new helpers to ease SMC regs manipulation 2022-12-08 18:06:27 +02:00
misc Kconfigs: Correct default of "0" on hex type entries 2023-08-09 09:21:42 -04:00
mmc Prepare v2023.10-rc3 2023-08-21 17:32:17 -04:00
mtd mtd: nand: raw: atmel: Remove duplicate line 2023-08-23 16:03:26 +03:00
mux Correct SPL uses of MULTIPLEXER 2023-03-02 17:45:58 -05:00
net net: ti: am65-cpsw-nuss: Add logic to support MDIO reset 2023-08-15 17:46:39 -04:00
nvme bootstd: Rename bootdev_setup_sibling_blk() 2023-08-09 23:31:11 +08:00
pch x86: Convert some debug statements to use logging 2023-07-17 17:23:14 +08:00
pci pci: pcie-brcmstb: do not rely on CLKREQ# signal 2023-08-30 11:47:43 -04:00
pci_endpoint dm: define LOG_CATEGORY for all uclass 2021-07-06 10:38:03 -06:00
phy phy: ti: j721e-wiz: Add SGMII support in WIZ driver for J721E 2023-08-15 17:46:39 -04:00
pinctrl pinctrl: rockchip: Fix drive and input schmitt on RK3568 2023-08-14 11:07:27 +08:00
power power: regulator: rk8xx: Add 500us delay after LDO regulator is enabled 2023-07-31 20:33:18 +08:00
pwm pwm: mtk: add support for MediaTek MT7988 SoC 2023-08-03 09:40:49 -04:00
qe global: Finish CONFIG -> CFG migration 2023-01-20 12:27:24 -05:00
ram board: mediatek: update config headers 2023-08-03 09:40:49 -04:00
reboot-mode reboot-mode: Add NVMEM reboot mode 2023-01-11 11:54:50 -05:00
remoteproc remoteproc: uclass: Clean up a return 2023-08-08 17:05:43 -04:00
reset reset: mediatek: check malloc return valaue before use 2023-08-03 09:40:49 -04:00
rng rockchip: rng: add trngv1 for rk3588 2023-04-21 15:16:01 +08:00
rtc drivers: rtc: max313xx: provide read8/write8 2023-07-25 12:44:46 -04:00
scsi scsi: Add buffer_aligned check pass-through 2023-08-22 15:17:53 -04:00
serial serial-uclass: reset gd->cur_serial_dev to NULL if serial not found 2023-08-30 17:56:21 -04:00
smem smem: msm: add missing <linux/sizes.h> 2022-10-12 08:56:24 -04:00
soc arm64: zynqmp: Switch to amd.com emails 2023-07-21 09:00:38 +02:00
sound test: test sandbox sound driver more rigorously 2022-12-05 17:43:21 +01:00
spi spi: mtk_spim: clear IRQ enable bits 2023-08-03 09:40:49 -04:00
spmi spmi: msm: add arbiter version 5 support 2021-10-31 08:46:44 -04:00
sysinfo sysinfo: gpio: fix loop over DT "revisions" array 2023-03-30 15:09:59 -04:00
sysreset sysreset: Change Kconfig GPIO dependency 2023-07-07 16:47:15 -04:00
tee drivers: tee: sandbox: Fix SCP03 control emulator 2023-04-28 11:30:17 -06:00
thermal imx: move imx8 sci header file to include/firmware/imx 2023-05-21 16:54:32 +02:00
timer omap: timer: add ti,am654-timer compatibility 2023-07-28 10:10:29 -04:00
tpm tpm: sandbox: Change the return code when device is already open 2023-02-28 09:44:25 +02:00
ufs ufs: Implement cache management 2023-08-24 13:47:44 -04:00
usb Prepare v2023.10-rc3 2023-08-21 17:32:17 -04:00
video Prepare v2023.10-rc3 2023-08-21 17:32:17 -04:00
virtio bootstd: Rename bootdev_setup_sibling_blk() 2023-08-09 23:31:11 +08:00
w1 dm: treewide: Do not use the return value of simple uclass iterator 2022-10-29 07:36:33 -06:00
w1-eeprom dm: define LOG_CATEGORY for all uclass 2021-07-06 10:38:03 -06:00
watchdog watchdog: ftwdt010: need to reset watchdog in ftwdt010_wdt_start() 2023-08-10 08:39:16 +02:00
xen xen: Limit execution to EL1 only 2023-04-25 15:31:28 -04:00
Kconfig bios_emulator: Add Kconfig and adjust Makefile for SPL 2023-07-17 17:08:44 +08:00
Makefile video: Tidy up Makefile rule for video 2023-08-09 23:31:11 +08:00