
On 08/01/2016 03:01 AM, Simon Glass wrote:
Hi,
On 26 July 2016 at 04:55, Tien Fong Chee tfchee@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@altera.com Cc: Dinh Nguyen dinguyen@opensource.altera.com Cc: Dinh Nguyen dinh.linux@gmail.com Cc: ChinLiang clsee@altera.com Cc: Thomas Chou thomas@wytron.com.tw Cc: Simon Glass sjg@chromium.org Cc: Marek Vasut marex@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 .