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

Niteesh G. S. niteesh.gs at gmail.com
Thu May 6 08:28:52 UTC 2021


ping.

On Sat, May 1, 2021 at 9:47 PM Niteesh G. S. <niteesh.gs at gmail.com> wrote:

> On Sat, May 1, 2021 at 8:31 PM Joel Sherrill <joel at rtems.org> wrote:
>
>>
>>
>> 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?
>>
> Yes, the primary UART is different across models.
>
> Rpi's have two UARTs PL011 and miniuart, on models which have Bluetooth
> the PL011 is used to talk to the Bluetooth and miniuart acts as the
> primary UART.
> Now we can change this by adding miniuart-bt to config.txt but the
> miniuart is
> based on the VPU core and requires to add another option which sets the
> core to
> a fixed freq.
>
>>
>> ---
>>>>  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/20210506/14e937a8/attachment-0001.html>


More information about the devel mailing list