From: Simon Goldschmidt Date: Mon, 7 Jan 2019 21:24:52 +0100 Subject: [U-Boot] [PATCH] arm: socfpga: make debug uart work on socfpga_gen5 In-Reply-To: <81fe0635-48a1-3b7d-3564-4e3fb95f4567@denx.de> References: <20190107193617.27034-1-simon.k.r.goldschmidt@gmail.com> <81fe0635-48a1-3b7d-3564-4e3fb95f4567@denx.de> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Am 07.01.2019 um 21:19 schrieb Marek Vasut: > On 1/7/19 8:36 PM, Simon Goldschmidt wrote: >> When debug UART is enabled on socfpga_gen5, the debug uart driver hangs >> in an endless loop because 'socfpga_bridges_reset' calls printf before >> the debug UART is initialized. >> >> After the generic fix for this in the UART driver did not work due to >> portability issues, let's just drop this printf statement when called >> from SPL with debug UART enabled. >> >> Signed-off-by: Simon Goldschmidt > > Can we have an un-portable fix which at least works on SoCFPGA ? :) This one worked on socfpga but broke rockchip: https://patchwork.ozlabs.org/patch/992553/ However, the message below wasn't shown either with that patch applied. The code just runs too early to enable the UART. Do you want to keep the message (although I failed to see in which situation it can be printed) or do you just dislike the #ifdef thing? Regards, Simon > >> --- >> >> This is about my fourth try to get the debug uart usable on socfpga gen5. >> Hope this time I'll make it :-) >> It's really annoying to have local diffs only for enabling the debug uart! >> >> arch/arm/mach-socfpga/reset_manager_gen5.c | 3 +++ >> 1 file changed, 3 insertions(+) >> >> diff --git a/arch/arm/mach-socfpga/reset_manager_gen5.c b/arch/arm/mach-socfpga/reset_manager_gen5.c >> index 25baef79bc..39d8fbed94 100644 >> --- a/arch/arm/mach-socfpga/reset_manager_gen5.c >> +++ b/arch/arm/mach-socfpga/reset_manager_gen5.c >> @@ -90,7 +90,10 @@ void socfpga_bridges_reset(int enable) >> if (!fpgamgr_test_fpga_ready()) { >> /* FPGA not ready, do nothing. We allow system to boot >> * without FPGA ready. So, return 0 instead of error. */ >> +#if !defined CONFIG_SPL_BUILD || !defined CONFIG_DEBUG_UART >> + /* In SPL, this is called before debug-uart init... */ >> printf("%s: FPGA not ready, aborting.\n", __func__); >> +#endif >> return; >> } >> >> > >