[U-Boot] [PATCH] serial: Enable checking UART is ready for console based on device tree

Marek Vasut marex at denx.de
Tue Aug 2 14:25:00 CEST 2016


On 08/01/2016 03:01 AM, Simon Glass wrote:
> Hi,
> 
> On 26 July 2016 at 04:55, Tien Fong Chee <tfchee at altera.com> wrote:
>> This patch would do checking on device tree to ensure the UART exist
>> in the system and ready for console before setting have_console to true.
>> This is required to avoid unexpected behavior such as hang during UART
>> initialization.
>>
>> Signed-off-by: Tien Fong Chee <tfchee at altera.com>
>> Cc: Dinh Nguyen <dinguyen at opensource.altera.com>
>> Cc: Dinh Nguyen <dinh.linux at gmail.com>
>> Cc: ChinLiang <clsee at altera.com>
>> Cc: Thomas Chou <thomas at wytron.com.tw>
>> Cc: Simon Glass <sjg at chromium.org>
>> Cc: Marek Vasut <marex at denx.de>
>> ---
>>  common/console.c                  |   11 ++++---
>>  common/spl/spl.c                  |    3 +-
>>  drivers/serial/serial.c           |   58 +++++++++++++++++++++++++++++++++++-
>>  include/asm-generic/global_data.h |    1 +
>>  include/serial.h                  |    1 +
>>  5 files changed, 66 insertions(+), 8 deletions(-)
> 
> Another way to deal with this would be to have the driver return
> -EBUSY (or perhaps -EAGAIN) and set this flag in
> serial_find_console_or_panic(). After all, the unavailability of
> serial is a driver-specific thing, right?

I think the -EAGAIN makes sense -- use default null console and probe
the UART when it's ready.

> How / when does the FPGA get programmed on your system?

On CV/AV, the FPGA is loaded via the fpga command .


-- 
Best regards,
Marek Vasut


More information about the U-Boot mailing list