LCD: Add an option to skip registration as an stdio output
PATCH 1/1 LCD: Add an option to skip registration as an stdio output
From: Stephane Ayotte <[email protected]>
This patch adds an option to skip the registration of LCD stdio ouput for boards that want to show different text on LCD than on serial output (or the active stdout selected by the environment variable).
---
This implementation is similar to what has been added to cfb_console.c by Stefan Roese <[email protected]> per commit 6cc7ba9e on 05/15/2009
I am sending this patch using <[email protected]>
as our regular smtp server <[email protected]> causes patch issues.
common/lcd.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)
common/lcd.c +13 -0
@@ -143,6 +143,16 @@ __weak int lcd_get_size(int *line_length)return *line_length * panel_info.vl_row; } +/* +* Implement a weak default function for boards that optionally +* need to skip the lcd console initialization. +*/ +__weak int board_lcd_console_skip (void ) +{ +/* As default, don't skip cfb init */ +return 0 ; +} +int drv_lcd_init (void ) {struct stdio_dev lcddev;
@@ -152,6 +162,9 @@ int drv_lcd_init(void)lcd_init (lcd_base); +if (board_lcd_console_skip ()) +return 0 ; +/* Device initialization */ memset (&lcddev,0 ,sizeof (lcddev));
Signature · 1 line
1.8.3.1
PATCH 1/1 LCD: Add an option to skip registration as an stdio output
Hello Anatolij,
Does this patch have a chance to get to the release even if it has missed RC1?
Thanks,
Stephane
Quoted 53 lines · On Tue, Nov 3, 2015 at 11:14 AM, <[email protected]> wrote:
From: Stephane Ayotte <[email protected]>
This patch adds an option to skip the registration of LCD stdio ouput for boards that want to show different text on LCD than on serial output (or the active stdout selected by the environment variable).
Signed-off-by Stephane Ayotte <[email protected]>---
This implementation is similar to what has been added to
cfb_console.cby Stefan Roese <[email protected]> per commit6cc7ba9eon 05/15/2009I am sending this patch using <[email protected]>
as our regular smtp server <[email protected]> causes patch issues.common/lcd.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)common/lcd.c +13
-1@@ -143,6 +143,16 @@ __weak int lcd_get_size(int *line_length)return *line_length * panel_info.vl_row; } +/* +* Implement a weak default function for boards that optionally +* need to skip the lcd console initialization. +*/ +__weak int board_lcd_console_skip (void ) +{ +/* As default, don't skip cfb init */ +return 0 ; +} +int drv_lcd_init (void ) {struct stdio_dev lcddev;@@ -152,6 +162,9 @@ int drv_lcd_init(void)lcd_init (lcd_base); +if (board_lcd_console_skip ()) +return 0 ; +/* Device initialization */ memset (&lcddev,0 ,sizeof (lcddev)); --1.8.3.1
PATCH 1/1 LCD: Add an option to skip registration as an stdio output
Hello Stephane,
On Thu, 19 Nov 2015 08:41:44 -0500
Stephane Ayotte <[email protected]> wrote:
...
Quoted 2 lines
Does this patch have a chance to get to the release even if it has missed RC1?
yes, I've queued it in my tree.
Thanks,
Anatolij
PATCH 1/1 LCD: Add an option to skip registration as an stdio output
In reply to sayotte.tyco at gmail.comQuoted 9 lines · On Tue, 3 Nov 2015 11:14:49 -0500 sayotte.tyco at gmail.com wrote:
From: Stephane Ayotte <[email protected]>
This patch adds an option to skip the registration of LCD stdio ouput for boards that want to show different text on LCD than on serial output (or the active stdout selected by the environment variable).
Signed-off-by Stephane Ayotte <[email protected]>---
Quoted 8 lines
This implementation is similar to what has been added to
cfb_console.cby Stefan Roese <[email protected]> per commit6cc7ba9eon 05/15/2009I am sending this patch using <[email protected]>
as our regular smtp server <[email protected]> causes patch issues.common/lcd.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)
applied to u-boot-video/master, thanks!
Anatolij
PATCH 1/1 LCD: Add an option to skip registration as an stdio output
hi,
sorry i was absent a few days from u-boot (writing vxWorks drivers :-() ...
but, do we really need this ?
i had same problem on my b&r boards, were we printout something on lcd but console should remain on stdout/stdin.
what about:
int overwrite_console(void)
{
return 1;
}and activate
#define CONFIG_SYS_CONSOLE_IS_IN_ENV
#define CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE
should do the same i think.
best regards,
Hannes
Quoted 29 lines · Anatolij Gustschin
Quoted 9 lines · On Tue, 3 Nov 2015 11:14:49 -0500 sayotte.tyco at gmail.com wrote:
From: Stephane Ayotte <[email protected]>
This patch adds an option to skip the registration of LCD stdio ouput for boards that want to show different text on LCD than on serial output (or the active stdout selected by the environment variable).
Signed-off-by Stephane Ayotte <[email protected]>---
Quoted 8 lines
This implementation is similar to what has been added to
cfb_console.cby Stefan Roese <[email protected]> per commit6cc7ba9eon 05/15/2009I am sending this patch using <[email protected]>
as our regular smtp server <[email protected]> causes patch issues.common/lcd.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)applied to u-boot-video/master, thanks!
Anatolij
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot
Ayotte
PATCH 1/1 LCD: Add an option to skip registration as an stdio output
Thanks for the info, Hannes. I agree with you that I could have met my requirements (of showing "applicative" output to the LCD and "technical/debug" output to the serial port) with CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE. To be totally honest, I had not seen this config and was attracted to how the video device did it.
For the sake of argumentation only, I will raise the question whether CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE breaks NETCONSOLE. If I understand correctly, this config will force the console to use only the serial device. I could imagine use cases for netconsole and LCD.
I'm asking the question, really, as this is just from my reading of the code. I haven't tested with netconsole.
My feeling is that there should be a more generic way of saying whether a device should register to stdio or not. My preference would go to an API over individual configs for each device. Neither of the two solutions are ideal nor completely implemented as this time.
Anatolij, based on Hannes info, if you want to backtrack on this, I'm open both ways.
Thanks,
Stephane
________________________________________
From: U-Boot [u-boot-bounces at lists.denx.de] on behalf of Hannes Schmelzer [hannes at schmelzer.or.at]
Sent: Tuesday, December 01, 2015 12:41 PM
To: Anatolij Gustschin; sayotte.tyco at gmail.com
Cc: u-boot at lists.denx.de; trini at konsulko.com
Subject: Re: [U-Boot] [PATCH] LCD: Add an option to skip registration as an stdio output
hi,
sorry i was absent a few days from u-boot (writing vxWorks drivers :-() ...
but, do we really need this ?
i had same problem on my b&r boards, were we printout something on lcd but console should remain on stdout/stdin.
what about:
int overwrite_console(void)
{
return 1;
}and activate
#define CONFIG_SYS_CONSOLE_IS_IN_ENV
#define CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE
should do the same i think.
best regards,
Hannes
Quoted 20 lines · Anatolij Gustschin
Quoted 9 lines · On Tue, 3 Nov 2015 11:14:49 -0500 sayotte.tyco at gmail.com wrote:
From: Stephane Ayotte <[email protected]>
This patch adds an option to skip the registration of LCD stdio ouput for boards that want to show different text on LCD than on serial output (or the active stdout selected by the environment variable).
Signed-off-by Stephane Ayotte <[email protected]>---
Quoted 8 lines
This implementation is similar to what has been added to
cfb_console.cby Stefan Roese <[email protected]> per commit6cc7ba9eon 05/15/2009I am sending this patch using <[email protected]>
as our regular smtp server <[email protected]> causes patch issues.common/lcd.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)
Quoted 9 lines
applied to u-boot-video/master, thanks!
Anatolij
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.denx.de_mailman_listinfo_u-2Dboot&d=CwICAg&c=0YGvTs3tT-VMy8_v51yLDw&r=hKJIzptToavgYbbj9AV421mE6NXayrpl14-njwOHYSQ&m=DfAFsiSn9H0bgqbWZfUz1Iy4i-sN_4cLdZO3S4ZZwv0&s=evCiUq3rZQa24tuFptK6hotCqAjw7TISa5RrShNqBxw&e=
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.denx.de_mailman_listinfo_u-2Dboot&d=CwICAg&c=0YGvTs3tT-VMy8_v51yLDw&r=hKJIzptToavgYbbj9AV421mE6NXayrpl14-njwOHYSQ&m=DfAFsiSn9H0bgqbWZfUz1Iy4i-sN_4cLdZO3S4ZZwv0&s=evCiUq3rZQa24tuFptK6hotCqAjw7TISa5RrShNqBxw&e=
________________________________
This e-mail contains privileged and confidential information intended for the use of the addressees named above. If you are not the intended recipient of this e-mail, you are hereby notified that you must not disseminate, copy or take any action in respect of any information contained in it. If you have received this e-mail in error, please notify the sender immediately by e-mail and immediately destroy this e-mail and its attachments.
PATCH 1/1 LCD: Add an option to skip registration as an stdio output
On 12/01/2015 10:31 PM, Ayotte, Stephane wrote:
Hi Stephane,
Quoted 5 lines
Thanks for the info, Hannes. I agree with you that I could have met my requirements (of showing "applicative" output to the LCD and "technical/debug" output to the serial port) with
CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE. To be totally honest, I had not seen this config and was attracted to how the video device did it.For the sake of argumentation only, I will raise the question whether
CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINEbreaks NETCONSOLE. If I understand correctly, this config will force the console to use only the serial device. I could imagine use cases for netconsole and LCD.I'm asking the question, really, as this is just from my reading of the code. I haven't tested with netconsole.
I also read the code again and my understanding is.
First the environment is asked for stdin, stdout, stderr devices - afterwards overwrite_console is asked how about searching for some other devices.
If overwrite_console returns != 0 the devs inputdev,outputdev,errdev are left uninitialized / values from environment (see line 802...805 in common/console.c).
A few lines afterwards the fallback takes care about if NULL and assigns "serial" to them.
So there is no indication for me breaking netconsole. Further i'm also using netconsole on my B&R boards, its working fine.
Quoted 3 lines
My feeling is that there should be a more generic way of saying whether a device should register to stdio or not. My preference would go to an API over individual configs for each device. Neither of the two solutions are ideal nor completely implemented as this time.
Anatolij, based on Hannes info, if you want to backtrack on this, I'm open both ways.
I would suggest to have not too much ways for one goal. Maybe it would be enough work a bit on documentation how to quiet console on LCD.
Quoted 2 lines
Thanks,
Stephane
best regards,
Hannes
Quoted 32 lines
________________________________________
From: U-Boot [u-boot-bounces at lists.denx.de] on behalf of Hannes Schmelzer [hannes at schmelzer.or.at]
Sent: Tuesday, December 01, 2015 12:41 PM
To: Anatolij Gustschin; sayotte.tyco at gmail.com
Cc: u-boot at lists.denx.de; trini at konsulko.com
Subject: Re: [U-Boot] [PATCH] LCD: Add an option to skip registration as an stdio outputhi,
sorry i was absent a few days from u-boot (writing vxWorks drivers :-() ...
but, do we really need this ?
i had same problem on my b&r boards, were we printout something on lcd but console should remain on stdout/stdin.
what about:
int
overwrite_console(void){ return 1; }and activate
#defineCONFIG_SYS_CONSOLE_IS_IN_ENV
#defineCONFIG_SYS_CONSOLE_OVERWRITE_ROUTINEshould do the same i think.
best regards,
Hannes
Ayotte
PATCH 1/1 LCD: Add an option to skip registration as an stdio output
Quoted 23 lines · Hannes Schmelzer
On 12/01/2015 10:31 PM, Ayotte, Stephane wrote:
Hi Stephane,
Quoted 1 line
Thanks for the info, Hannes. I agree with you that I could have met my
requirements (of showing "applicative" output to the LCD and "technical/debug" output to the serial port) with
CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE. To be totally honest, I had not seen this config and was attracted to how the video device did it.Quoted 2 lines
For the sake of argumentation only, I will raise the question whether
CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINEbreaks NETCONSOLE. If I understand correctly, this config will force the console to use only the serial device. I could imagine use cases for netconsole and LCD.Quoted 2 lines
I'm asking the question, really, as this is just from my reading of the code. I
haven't tested with netconsole.
I also read the code again and my understanding is.
First the environment is asked for stdin, stdout, stderr devices - afterwardsoverwrite_consoleis asked how about searching for some other devices. Ifoverwrite_consolereturns != 0 the devs inputdev,outputdev,errdev are left uninitialized / values from environment (see line 802...805 incommon/console.c).
Quoted 5 lines
A few lines afterwards the fallback takes care about if NULL and assigns "serial" to them.
So there is no indication for me breaking netconsole. Further i'm also using netconsole on my B&R boards, its working fine.
Thanks for the clarification. In that case, you are right that we end up with two different solutions. It's too bad your clarification came just a little after the pull request.
Quoted 9 lines
Quoted 1 line
My feeling is that there should be a more generic way of saying whether a
device should register to stdio or not. My preference would go to an API over individual configs for each device. Neither of the two solutions are ideal nor completely implemented as this time.
Quoted 2 lines
Anatolij, based on Hannes info, if you want to backtrack on this, I'm open both
ways.
I would suggest to have not too much ways for one goal. Maybe it would be enough work a bit on documentation how to quiet console on LCD.
I agree with you 100% on not having multiple ways. What would be the procedure at this point? Submit a reverse patch?
Regards,
Stephane
Quoted 38 lines
Quoted 2 lines
Thanks,
Stephanebest regards,
HannesQuoted 34 lines
________________________________________
From: U-Boot [u-boot-bounces at lists.denx.de] on behalf of Hannes Schmelzer [hannes at schmelzer.or.at]
Sent: Tuesday, December 01, 2015 12:41 PM
To: Anatolij Gustschin; sayotte.tyco at gmail.com
Cc: u-boot at lists.denx.de; trini at konsulko.com
Subject: Re: [U-Boot] [PATCH] LCD: Add an option to skip registration as an stdio outputhi,
sorry i was absent a few days from u-boot (writing vxWorks drivers :-() ...
but, do we really need this ?
i had same problem on my b&r boards, were we printout something on lcd but console should remain on stdout/stdin.
what about:
int
overwrite_console(void){ return 1; }and activate
#defineCONFIG_SYS_CONSOLE_IS_IN_ENV
#defineCONFIG_SYS_CONSOLE_OVERWRITE_ROUTINEshould do the same i think.
best regards,
Hannes
________________________________
This e-mail contains privileged and confidential information intended for the use of the addressees named above. If you are not the intended recipient of this e-mail, you are hereby notified that you must not disseminate, copy or take any action in respect of any information contained in it. If you have received this e-mail in error, please notify the sender immediately by e-mail and immediately destroy this e-mail and its attachments.
PATCH 1/1 LCD: Add an option to skip registration as an stdio output
Quoted 35 lines · Stephane
Quoted 21 lines · Hannes Schmelzer
On 12/01/2015 10:31 PM, Ayotte, Stephane wrote:
Hi Stephane,
Quoted 1 line
Thanks for the info, Hannes. I agree with you that I could have met my
requirements (of showing "applicative" output to the LCD and "technical/debug" output to the serial port) with
CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE. To be totally honest, I had not seen this config and was attracted to how the video device did it.Quoted 1 line
For the sake of argumentation only, I will raise the question whether
CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINEbreaks NETCONSOLE. If I understand correctly, this config will force the console to use only the serial device. I could imagine use cases for netconsole and LCD.Quoted 1 line
I'm asking the question, really, as this is just from my reading of the code. I
haven't tested with netconsole.
I also read the code again and my understanding is.
First the environment is asked for stdin, stdout, stderr devices - afterwardsoverwrite_consoleis asked how about searching for some other devices. Ifoverwrite_consolereturns != 0 the devs inputdev,outputdev,errdev are left uninitialized / values from environment (see line 802...805 incommon/console.c).Quoted 5 lines
A few lines afterwards the fallback takes care about if NULL and assigns "serial" to them.
So there is no indication for me breaking netconsole. Further i'm also using netconsole on my B&R boards, its working fine.
Thanks for the clarification. In that case, you are right that we end up with two different solutions. It's too bad your clarification came just a little after the pull request.
Quoted 4 lines
Quoted 1 line
My feeling is that there should be a more generic way of saying whether a
device should register to stdio or not. My preference would go to an API over individual configs for each device. Neither of the two solutions are ideal nor completely implemented as this time.
Quoted 6 lines
Quoted 4 lines
Quoted 1 line
Anatolij, based on Hannes info, if you want to backtrack on this, I'm open both
ways.
I would suggest to have not too much ways for one goal. Maybe it would be enough work a bit on documentation how to quiet console on LCD.I agree with you 100% on not having multiple ways. What would be the procedure at this point? Submit a reverse patch?
i would suggest reverting the commit and send some patch with the revert. What do Anatolij or Tom say?
Quoted 3 lines
Regards,
Stephane
best regards,
Hannes
PATCH 1/1 LCD: Add an option to skip registration as an stdio output
In reply to AyotteHi,
On Wed, 2 Dec 2015 14:08:16 +0000
"Ayotte, Stephane" <[email protected]> wrote:
...
Quoted 8 lines
Quoted 4 lines
Quoted 1 line
Anatolij, based on Hannes info, if you want to backtrack on this, I'm open both
ways.
I would suggest to have not too much ways for one goal. Maybe it would be enough work a bit on documentation how to quiet console on LCD.I agree with you 100% on not having multiple ways. What would be the procedure at this point?
Submit a reverse patch?
I'll just revert this patch and prepare a pull request.
Thanks!
--
Anatolij