diff mbox

[U-Boot,3/3] sunxi: Do not add a stdout-path alias to dts on boards without a serial port

Message ID 1438433451-17720-3-git-send-email-hdegoede@redhat.com
State Accepted
Delegated to: Hans de Goede
Headers show

Commit Message

Hans de Goede Aug. 1, 2015, 12:50 p.m. UTC
Do not add a bogus (pointing to a non existing serial port) stdout-path
alias to dts on boards without a serial port.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 include/configs/sunxi-common.h | 2 ++
 1 file changed, 2 insertions(+)

Comments

Ian Campbell Aug. 2, 2015, 4:28 p.m. UTC | #1
On Sat, 2015-08-01 at 14:50 +0200, Hans de Goede wrote:
> Do not add a bogus (pointing to a non existing serial port) stdout-path
> alias to dts on boards without a serial port.
> 
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> ---
>  include/configs/sunxi-common.h | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi
> -common.h
> index 71b2368..a2cbcf5 100644
> --- a/include/configs/sunxi-common.h
> +++ b/include/configs/sunxi-common.h
> @@ -262,6 +262,7 @@ extern int soft_i2c_gpio_scl;
>  #define CONFIG_CONS_INDEX              1       /* UART0 */
>  #endif

Should this defaulting of CONFIG_CONS_INDEX not be gated as well (or
even instead)? Perhaps incorporate an ifndef CONFIG_CONS_INDEX into the
chain of #elseif below  (making the #error only hit for defined-but
-unknown values) to achieve what this patch wants to do?
 
> +#ifdef CONFIG_REQUIRE_SERIAL_CONSOLE
>  #if CONFIG_CONS_INDEX == 1
>  #ifdef CONFIG_MACH_SUN9I
>  #define OF_STDOUT_PATH		"/soc/serial@07000000:115200"
> @@ -277,6 +278,7 @@ extern int soft_i2c_gpio_scl;
>  #else
>  #error Unsupported console port nr. Please fix stdout-path in sunxi
> -common.h.
>  #endif
> +#endif /* ifdef CONFIG_REQUIRE_SERIAL_CONSOLE */
>  
>  /* GPIO */
>  #define CONFIG_SUNXI_GPIO
Hans de Goede Aug. 2, 2015, 6:45 p.m. UTC | #2
Hi,

On 02-08-15 18:28, Ian Campbell wrote:
> On Sat, 2015-08-01 at 14:50 +0200, Hans de Goede wrote:
>> Do not add a bogus (pointing to a non existing serial port) stdout-path
>> alias to dts on boards without a serial port.
>>
>> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
>> ---
>>   include/configs/sunxi-common.h | 2 ++
>>   1 file changed, 2 insertions(+)
>>
>> diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi
>> -common.h
>> index 71b2368..a2cbcf5 100644
>> --- a/include/configs/sunxi-common.h
>> +++ b/include/configs/sunxi-common.h
>> @@ -262,6 +262,7 @@ extern int soft_i2c_gpio_scl;
>>   #define CONFIG_CONS_INDEX              1       /* UART0 */
>>   #endif
>
> Should this defaulting of CONFIG_CONS_INDEX not be gated as well

That is a good question, unfortunately we still need this for the
SPL, where we do not use DM_SERIAL and thus CONFIG_REQUIRE_SERIAL_CONSOLE
is not used.

We are getting away with this because the sun5i die actually has
an uart0, which in the A13 package is not routed to the outside,
so we are simply sending SPL bootup messages to the tx pin at the
edge of the die, and they go no further from there...

And sofar we only have one A13 board which does not have a serial
port, all others do have a serial port. This kinda makes sense since
the A13 is a much lower pincount package compared to all the other
sunxi SoCs.

Actually before we moved most things including serial over to the
device-model, we were (ab)using the present but not wired uart0
for both the SPL, u-boot proper.

So for now to keep things working we need CONFIG_CONS_INDEX 1
even on the 1 board we have which does not have a serial port
(the uart1 pins which are routed to the outside on the A13
are used as gpio-s by the lcd.

Regards,

Hans

 > (or
> even instead)? Perhaps incorporate an ifndef CONFIG_CONS_INDEX into the
> chain of #elseif below  (making the #error only hit for defined-but
> -unknown values) to achieve what this patch wants to do?
>
>> +#ifdef CONFIG_REQUIRE_SERIAL_CONSOLE
>>   #if CONFIG_CONS_INDEX == 1
>>   #ifdef CONFIG_MACH_SUN9I
>>   #define OF_STDOUT_PATH		"/soc/serial@07000000:115200"
>> @@ -277,6 +278,7 @@ extern int soft_i2c_gpio_scl;
>>   #else
>>   #error Unsupported console port nr. Please fix stdout-path in sunxi
>> -common.h.
>>   #endif
>> +#endif /* ifdef CONFIG_REQUIRE_SERIAL_CONSOLE */
>>
>>   /* GPIO */
>>   #define CONFIG_SUNXI_GPIO
Ian Campbell Aug. 2, 2015, 6:57 p.m. UTC | #3
On Sun, 2015-08-02 at 20:45 +0200, Hans de Goede wrote:
> 
[...]
> So for now to keep things working we need CONFIG_CONS_INDEX 1
> even on the 1 board we have which does not have a serial port
> (the uart1 pins which are routed to the outside on the A13
> are used as gpio-s by the lcd.

Makes sense, thanks.

Acked-by: Ian Campbell <ijc@hellion.org.uk>

Is it worth pasting some of your longer description into the commit
message?

Ian.
Hans de Goede Aug. 3, 2015, 7:44 a.m. UTC | #4
Hi,

On 02-08-15 20:57, Ian Campbell wrote:
> On Sun, 2015-08-02 at 20:45 +0200, Hans de Goede wrote:
>>
> [...]
>> So for now to keep things working we need CONFIG_CONS_INDEX 1
>> even on the 1 board we have which does not have a serial port
>> (the uart1 pins which are routed to the outside on the A13
>> are used as gpio-s by the lcd.
>
> Makes sense, thanks.
>
> Acked-by: Ian Campbell <ijc@hellion.org.uk>
>
> Is it worth pasting some of your longer description into the commit
> message?

Probably I'll improve the commit msg a bit before submitting a pull-req
for this.

Regards,

Hans
diff mbox

Patch

diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h
index 71b2368..a2cbcf5 100644
--- a/include/configs/sunxi-common.h
+++ b/include/configs/sunxi-common.h
@@ -262,6 +262,7 @@  extern int soft_i2c_gpio_scl;
 #define CONFIG_CONS_INDEX              1       /* UART0 */
 #endif
 
+#ifdef CONFIG_REQUIRE_SERIAL_CONSOLE
 #if CONFIG_CONS_INDEX == 1
 #ifdef CONFIG_MACH_SUN9I
 #define OF_STDOUT_PATH		"/soc/serial@07000000:115200"
@@ -277,6 +278,7 @@  extern int soft_i2c_gpio_scl;
 #else
 #error Unsupported console port nr. Please fix stdout-path in sunxi-common.h.
 #endif
+#endif /* ifdef CONFIG_REQUIRE_SERIAL_CONSOLE */
 
 /* GPIO */
 #define CONFIG_SUNXI_GPIO