[PATCH 01/16] serial: sh: Fix compile error when lacking HSCIF support

Paul Barker paul.barker.ct at bp.renesas.com
Wed Oct 4 09:49:05 CEST 2023


On 03/10/2023 13:42, Marek Vasut wrote:
> On 9/20/23 14:41, Paul Barker wrote:
>> If we attempt to compile serial_sh.c for a system which lacks HSCIF
>> support (e.g. R8A7740), we see the following compilation error:
>>
>>      In file included from drivers/serial/serial_sh.c:20:
>>      drivers/serial/serial_sh.c: In function ‘sh_serial_init_generic’:
>>      drivers/serial/serial_sh.h:429:35: warning: implicit declaration of function ‘sci_HSSRR_out’; did you mean ‘sci_SCSCR_out’? [-Wimplicit-function-declaration]
>>        429 | #define sci_out(port, reg, value) sci_##reg##_out(port, value)
>>            |                                   ^~~~
>>      drivers/serial/serial_sh.c:62:17: note: in expansion of macro ‘sci_out’
>>         62 |                 sci_out(port, HSSRR, HSSRR_SRE | HSSRR_SRCYC8);
>>            |                 ^~~~~~~
>>
>> To fix this, only try to support access to the HSSRR register for SoCs
>> where it actually exists.
>>
>> Fixes: bbe36e29ca2c ('serial: sh: Add HSCIF support for R-Car SoC')
>> Signed-off-by: Paul Barker <paul.barker.ct at bp.renesas.com>
>> Reviewed-by: Biju Das <biju.das.jz at bp.renesas.com>
>> Cc: Hai Pham <hai.pham.ud at renesas.com>
>> Cc: Marek Vasut <marek.vasut+renesas at mailbox.org>
>> Cc: Simon Glass <sjg at chromium.org>
>> ---
>>   drivers/serial/serial_sh.c | 2 ++
>>   1 file changed, 2 insertions(+)
>>
>> diff --git a/drivers/serial/serial_sh.c b/drivers/serial/serial_sh.c
>> index 20cda5dbe272..5e543dbf3d58 100644
>> --- a/drivers/serial/serial_sh.c
>> +++ b/drivers/serial/serial_sh.c
>> @@ -58,8 +58,10 @@ static void sh_serial_init_generic(struct uart_port *port)
>>   	sci_out(port, SCSPTR, 0x0003);
>>   #endif
>>   
>> +#if IS_ENABLED(CONFIG_RCAR_GEN2) || IS_ENABLED(CONFIG_RCAR_GEN3) || IS_ENABLED(CONFIG_RCAR_GEN4)
> 
> There should be CONFIG_RCAR_64 for GEN3+GEN4, please use it.

In patch 5 of this series I add CONFIG_RZG2L, which selects
CONFIG_RCAR_64 but doesn't have HSCIF support.

An alternative would be to use this here:

    #if IS_ENABLED(CONFIG_RCAR_GEN2) || IS_ENABLED(CONFIG_RCAR_64)

Then in patch 5 modify it to

    #if IS_ENABLED(CONFIG_RCAR_GEN2) || IS_ENABLED(CONFIG_RCAR_64) &&
!IS_ENABLED(CONFIG_RZG2L)

I don't have any strong preference on which one to use.

Thanks,
Paul
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_0x27F4B3459F002257.asc
Type: application/pgp-keys
Size: 3520 bytes
Desc: OpenPGP public key
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20231004/8787e6b5/attachment.key>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 236 bytes
Desc: OpenPGP digital signature
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20231004/8787e6b5/attachment.sig>


More information about the U-Boot mailing list