[PATCH 1/1] serial: move sbi_dbcn_available to .data section
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Mon, 26 Feb 2024 16:32:26 +0000 (17:32 +0100)
committerVagrant Cascadian <vagrant@debian.org>
Thu, 2 Jan 2025 21:47:07 +0000 (13:47 -0800)
commit50a3e33348311628ffc452543bcf04af24bf3f7c
treecfc67ac0059a3a9973f8f8de4a4073bbdbd7dd01
parent22041215c0c7baeae078c246ce7623aaf3b5c131
[PATCH 1/1] serial: move sbi_dbcn_available to .data section

To: Tom Rini <trini@konsulko.com>
Cc: Rick Chen <rick@andestech.com>, Leo Yu-Chi Liang <ycliang@andestech.com>,
 u-boot@lists.denx.de,
 Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
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 <heinrich.schuchardt@canonical.com>
Gbp-Pq: Topic riscv64
Gbp-Pq: Name serial-move-sbi_dbcn_available-to-.data-section.patch
drivers/serial/serial_sbi.c