[U-Boot] [PATCH] arm: socfpga: make debug uart work on socfpga_gen5

Simon Goldschmidt simon.k.r.goldschmidt at gmail.com
Mon Jan 7 20:24:52 UTC 2019


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 <simon.k.r.goldschmidt at gmail.com>
> 
> 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;
>>   		}
>>   
>>
> 
> 



More information about the U-Boot mailing list