From: Heinrich Schuchardt Date: Mon, 26 Feb 2024 16:32:26 +0000 (+0100) Subject: [PATCH 1/1] serial: move sbi_dbcn_available to .data section X-Git-Tag: archive/raspbian/2024.01+dfsg-6+rpi1^2~3 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=50a3e33348311628ffc452543bcf04af24bf3f7c;p=u-boot.git [PATCH 1/1] serial: move sbi_dbcn_available to .data section To: Tom Rini Cc: Rick Chen , Leo Yu-Chi Liang , u-boot@lists.denx.de, Heinrich Schuchardt Message-ID: <20240226163226.126288-1-heinrich.schuchardt@canonical.com> Origin: https://patchwork.ozlabs.org/project/uboot/patch/20240226163226.126288-1-heinrich.schuchardt@canonical.com/ Bug-Debian: https://bugs.debian.org/1060682 U-Boot SPL loads the device-tree directly behind main U-Boot overlapping the .bss section. reserve_fdt() is called in board_init_f() to relocate the device-tree to a safe location. Debug UARTs are enabled before board_init_f(). With sbi_dbcn_available in the .bss section the device-tree is corrupted when _debug_uart_init() is called in the SBI serial driver. Move the variable to the .data section. Link: https://bugs.launchpad.net/ubuntu/+source/u-boot/+bug/2054091 Fixes: dfe08374943c ("risc-v: implement DBCN based debug console") Signed-off-by: Heinrich Schuchardt Gbp-Pq: Topic riscv64 Gbp-Pq: Name serial-move-sbi_dbcn_available-to-.data-section.patch --- diff --git a/drivers/serial/serial_sbi.c b/drivers/serial/serial_sbi.c index a51a96c1e..f3ecfccab 100644 --- a/drivers/serial/serial_sbi.c +++ b/drivers/serial/serial_sbi.c @@ -17,7 +17,7 @@ static inline void _debug_uart_putc(int c) #else -static int sbi_dbcn_available; +static int sbi_dbcn_available __section(".data"); static inline void _debug_uart_init(void) {