On 22/08/2023 22:38, Marek Vasut wrote:
> On 8/22/23 20:10, 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...@bp.renesas.com>
>> Cc: Hai Pham <hai.pham...@renesas.com>
>> Cc: Marek Vasut <marek.vasut+rene...@mailbox.org>
>> Cc: Simon Glass <s...@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..cd9bcf4f0a25 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 defined(CONFIG_RCAR_GEN2) || defined(CONFIG_RCAR_GEN3) || 
>> defined(CONFIG_RCAR_GEN4)
> 
> You can use CONFIG_RCAR_64 instead of GEN3+GEN4 test.

I'm going to be sending patches for the RZ/G2L shortly which enables
CONFIG_RCAR_64 but lacks HSCIF support. Testing for RCAR gen3/gen4 now
will avoid the need to make another change here.

> 
> Also, can does
> 
> #if IS_ENABLED(CONFIG_RCAR_GEN2) || IS_ENABLED(CONFIG_RCAR_64)
> 
> work ?

I'll give this a try with the IS_ENABLED() macros and send over a v2 if
it works.

Thanks,
Paul

Attachment: OpenPGP_0x27F4B3459F002257.asc
Description: OpenPGP public key

Attachment: OpenPGP_signature
Description: OpenPGP digital signature

Reply via email to