diff mbox

[U-Boot,07/32] nitrogen6x: Allow U-Boot to be silent on UART2

Message ID 1412277413-30271-8-git-send-email-eric.nelson@boundarydevices.com
State Changes Requested
Delegated to: Stefano Babic
Headers show

Commit Message

Eric Nelson Oct. 2, 2014, 7:16 p.m. UTC
Several customers are using UART2 (normally the serial console
for U-Boot) as connections to printers or other peripherals
that are not tolerant of stray inputs during reset.

Provide a simple way to eliminate output on the serial port
by conditionally configuring these pads as GPIOs during
U-Boot.

Signed-off-by: Eric Nelson <eric.nelson@boundarydevices.com>
---
 board/boundary/nitrogen6x/nitrogen6x.c | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Stefano Babic Oct. 6, 2014, 3:42 p.m. UTC | #1
Hi Eric,

On 02/10/2014 21:16, Eric Nelson wrote:
> Several customers are using UART2 (normally the serial console
> for U-Boot) as connections to printers or other peripherals
> that are not tolerant of stray inputs during reset.
> 
> Provide a simple way to eliminate output on the serial port
> by conditionally configuring these pads as GPIOs during
> U-Boot.
> 
> Signed-off-by: Eric Nelson <eric.nelson@boundarydevices.com>
> ---
>  board/boundary/nitrogen6x/nitrogen6x.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/board/boundary/nitrogen6x/nitrogen6x.c b/board/boundary/nitrogen6x/nitrogen6x.c
> index e795492..621cdbc 100644
> --- a/board/boundary/nitrogen6x/nitrogen6x.c
> +++ b/board/boundary/nitrogen6x/nitrogen6x.c
> @@ -77,9 +77,15 @@ static iomux_v3_cfg_t const uart1_pads[] = {
>  	MX6_PAD_SD3_DAT7__UART1_TX_DATA | MUX_PAD_CTRL(UART_PAD_CTRL),
>  };
>  
> +/* #define CONFIG_SILENT_UART */

Theoretically, we have already in U-Boot CONFIG_SILENT_CONSOLE, without
the need to introduce a new CONFIG_.

>  static iomux_v3_cfg_t const uart2_pads[] = {
> +#ifndef CONFIG_SILENT_UART
>  	MX6_PAD_EIM_D26__UART2_TX_DATA | MUX_PAD_CTRL(UART_PAD_CTRL),
>  	MX6_PAD_EIM_D27__UART2_RX_DATA | MUX_PAD_CTRL(UART_PAD_CTRL),
> +#else
> +	MX6_PAD_EIM_D26__GPIO3_IO26 | MUX_PAD_CTRL(UART_PAD_CTRL),
> +	MX6_PAD_EIM_D27__GPIO3_IO27 | MUX_PAD_CTRL(UART_PAD_CTRL),
> +#endif

I understand the reason, anyway this looks like a hack (uart is still
configured while iomux is not correctly set). Can you check if your goal
is simply reached with CONFIG_SILENT_CONSOLE ?

Best regards,
Stefano Babic
Eric Nelson Oct. 6, 2014, 3:51 p.m. UTC | #2
Thanks Stefano,

On 10/06/2014 08:42 AM, Stefano Babic wrote:
> Hi Eric,
> 
> On 02/10/2014 21:16, Eric Nelson wrote:
>> Several customers are using UART2 (normally the serial console
>> for U-Boot) as connections to printers or other peripherals
>> that are not tolerant of stray inputs during reset.
>>
>> Provide a simple way to eliminate output on the serial port
>> by conditionally configuring these pads as GPIOs during
>> U-Boot.
>>
>> Signed-off-by: Eric Nelson <eric.nelson@boundarydevices.com>
>> ---
>>  board/boundary/nitrogen6x/nitrogen6x.c | 6 ++++++
>>  1 file changed, 6 insertions(+)
>>
>> diff --git a/board/boundary/nitrogen6x/nitrogen6x.c b/board/boundary/nitrogen6x/nitrogen6x.c
>> index e795492..621cdbc 100644
>> --- a/board/boundary/nitrogen6x/nitrogen6x.c
>> +++ b/board/boundary/nitrogen6x/nitrogen6x.c
>> @@ -77,9 +77,15 @@ static iomux_v3_cfg_t const uart1_pads[] = {
>>  	MX6_PAD_SD3_DAT7__UART1_TX_DATA | MUX_PAD_CTRL(UART_PAD_CTRL),
>>  };
>>  
>> +/* #define CONFIG_SILENT_UART */
> 
> Theoretically, we have already in U-Boot CONFIG_SILENT_CONSOLE, without
> the need to introduce a new CONFIG_.
> 
>>  static iomux_v3_cfg_t const uart2_pads[] = {
>> +#ifndef CONFIG_SILENT_UART
>>  	MX6_PAD_EIM_D26__UART2_TX_DATA | MUX_PAD_CTRL(UART_PAD_CTRL),
>>  	MX6_PAD_EIM_D27__UART2_RX_DATA | MUX_PAD_CTRL(UART_PAD_CTRL),
>> +#else
>> +	MX6_PAD_EIM_D26__GPIO3_IO26 | MUX_PAD_CTRL(UART_PAD_CTRL),
>> +	MX6_PAD_EIM_D27__GPIO3_IO27 | MUX_PAD_CTRL(UART_PAD_CTRL),
>> +#endif
> 
> I understand the reason, anyway this looks like a hack (uart is still
> configured while iomux is not correctly set). Can you check if your goal
> is simply reached with CONFIG_SILENT_CONSOLE ?
> 
Will do. I wasn't aware of that one.

Regards,


Eric
diff mbox

Patch

diff --git a/board/boundary/nitrogen6x/nitrogen6x.c b/board/boundary/nitrogen6x/nitrogen6x.c
index e795492..621cdbc 100644
--- a/board/boundary/nitrogen6x/nitrogen6x.c
+++ b/board/boundary/nitrogen6x/nitrogen6x.c
@@ -77,9 +77,15 @@  static iomux_v3_cfg_t const uart1_pads[] = {
 	MX6_PAD_SD3_DAT7__UART1_TX_DATA | MUX_PAD_CTRL(UART_PAD_CTRL),
 };
 
+/* #define CONFIG_SILENT_UART */
 static iomux_v3_cfg_t const uart2_pads[] = {
+#ifndef CONFIG_SILENT_UART
 	MX6_PAD_EIM_D26__UART2_TX_DATA | MUX_PAD_CTRL(UART_PAD_CTRL),
 	MX6_PAD_EIM_D27__UART2_RX_DATA | MUX_PAD_CTRL(UART_PAD_CTRL),
+#else
+	MX6_PAD_EIM_D26__GPIO3_IO26 | MUX_PAD_CTRL(UART_PAD_CTRL),
+	MX6_PAD_EIM_D27__GPIO3_IO27 | MUX_PAD_CTRL(UART_PAD_CTRL),
+#endif
 };
 
 #define PC MUX_PAD_CTRL(I2C_PAD_CTRL)