[PATCH] bsps/raspberrypi/console: Fix default console device

Joel Sherrill joel at rtems.org
Sat May 1 15:01:41 UTC 2021


On Sat, May 1, 2021, 8:53 AM Niteesh G. S. <niteesh.gs at gmail.com> wrote:

> Just to provide more context,
> When the CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER option is used
> and no --console option is provided, the console driver defaults to PL011.
> In raspberry pi 3 and other models whose primary UART is not PL011, we get
> no output.
> This patch fixes that by linking the primary UART to the console device.
>
> Thanks,
> Niteesh
>
> On Sat, May 1, 2021 at 7:05 PM G S Niteesh Babu <niteesh.gs at gmail.com>
> wrote:
>
>> When no console argument is given, the driver defaults to pl011
>> this results in no output in case of Rpi3 whose primary uart is
>> miniuart.
>> This patch fixes that by defaulting to the primary uart when no
>> console option is provided.
>>
>
Does the default need to vary by model?

---
>>  bsps/arm/raspberrypi/console/console-config.c | 12 +++++++++---
>>  1 file changed, 9 insertions(+), 3 deletions(-)
>>
>> diff --git a/bsps/arm/raspberrypi/console/console-config.c
>> b/bsps/arm/raspberrypi/console/console-config.c
>> index 6b8eb80aa4..bd3a8d34c2 100644
>> --- a/bsps/arm/raspberrypi/console/console-config.c
>> +++ b/bsps/arm/raspberrypi/console/console-config.c
>> @@ -165,10 +165,16 @@ static void console_select( void )
>>      }
>>    }else {
>>      /**
>> -     * If no command line option was given, default to PL011.
>> +     * If no console option was given we default to the primary uarts.
>> +     * The initialization of the uart's and BSP_output_char is already
>> done
>> +     * in the uart_probe function called before this. So now we can
>> safely
>> +     * compare BSP_output_char.
>>       */
>> -    BSP_output_char = output_char_pl011;
>> -    link(PL011, CONSOLE_DEVICE_NAME);
>> +    if (BSP_output_char == output_char_pl011) {
>> +      link(PL011, CONSOLE_DEVICE_NAME);
>> +    }else {
>> +      link(MINIUART, CONSOLE_DEVICE_NAME);
>> +    }
>>    }
>>  }
>>
>> --
>> 2.17.1
>>
>> _______________________________________________
> devel mailing list
> devel at rtems.org
> http://lists.rtems.org/mailman/listinfo/devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20210501/2bd54cc0/attachment.html>


More information about the devel mailing list