diff mbox

[U-Boot] At start of autoboot check, flush any pending RX bytes

Message ID CAOCHtYiQXNxaPQq+AERCzgt3GSnA6BUvv_Aa-26tnJ6LmhrafQ@mail.gmail.com
State RFC
Delegated to: Tom Rini
Headers show

Commit Message

Robert Nelson Jan. 14, 2016, 5:48 p.m. UTC
On Thu, Jan 14, 2016 at 11:31 AM, Tom Rini <trini@konsulko.com> wrote:

> On Mon, Jan 11, 2016 at 09:59:18AM -0700, Simon Glass wrote:
> > Hi Craig,
> >
> > On 20 December 2015 at 19:07, Craig McQueen
> > <craig.mcqueen@innerrange.com> wrote:
> > > This is to avoid the boot sequence halting due to initial "junk"
> > > received on serial input.
> > >
> > > Signed-off-by: Craig McQueen <craig.mcqueen@innerrange.com>
> > > ---
> > > I have found that on the BeagleBone Black, U-Boot occasionally halts at
> > > the U-Boot prompt at boot-up, whether power-up, warm external
> > > reset or software reset. I have seen other people report the same
> issue.
> > >
> > > This seems to be due to U-Boot receiving "junk" data on the serial
> > > console. The BeagleBone Black has a pull-down resistor which was
> > > apparently added to try to mitigate this issue, but it doesn't entirely
> > > fix it.
> >
> > I wonder if this can be fixed for that board only?
>
> No, and it's not -exactly- a that board only problem.  It's a HW design
> issue that can show up elsewhere too.  I _think_ however in this case
> the answer would be to migrate to perhaps CONFIG_AUTOBOOT_KEYED_CTRLC as
> that's one of the reason various other boards use that set of options.
>
> I would suggest bringing this up on the beaglebone list to see what the
> various people that ship and support these boards think, thanks!
>

I actually enabled this feature this week by default for beagleboard.org:


It'll take time to replace older images but on target users can just:

cd /opt/scripts/tools/developers/
git pull
sudo ./update_bootloader.sh

U-Boot SPL 2016.01-00001-g4eb802e (Jan 13 2016 - 11:14:31)
Trying to boot from MMC
bad magic


U-Boot 2016.01-00001-g4eb802e (Jan 13 2016 - 11:14:31 -0600), Build:
jenkins-github_Bootloader-Builder-313

       Watchdog enabled
I2C:   ready
DRAM:  512 MiB
Reset Source: Global external warm reset has occurred.
Reset Source: Power-on reset has occurred.
MMC:   OMAP SD/MMC: 0, OMAP SD/MMC: 1
Using default environment

Net:   <ethaddr> not set. Validating first E-fuse MAC
cpsw, usb_ether
Press SPACE to abort autoboot in 2 seconds
=>


Regards,

Comments

Tom Rini Jan. 14, 2016, 5:51 p.m. UTC | #1
On Thu, Jan 14, 2016 at 11:48:07AM -0600, Robert Nelson wrote:
> On Thu, Jan 14, 2016 at 11:31 AM, Tom Rini <trini@konsulko.com> wrote:
> 
> > On Mon, Jan 11, 2016 at 09:59:18AM -0700, Simon Glass wrote:
> > > Hi Craig,
> > >
> > > On 20 December 2015 at 19:07, Craig McQueen
> > > <craig.mcqueen@innerrange.com> wrote:
> > > > This is to avoid the boot sequence halting due to initial "junk"
> > > > received on serial input.
> > > >
> > > > Signed-off-by: Craig McQueen <craig.mcqueen@innerrange.com>
> > > > ---
> > > > I have found that on the BeagleBone Black, U-Boot occasionally halts at
> > > > the U-Boot prompt at boot-up, whether power-up, warm external
> > > > reset or software reset. I have seen other people report the same
> > issue.
> > > >
> > > > This seems to be due to U-Boot receiving "junk" data on the serial
> > > > console. The BeagleBone Black has a pull-down resistor which was
> > > > apparently added to try to mitigate this issue, but it doesn't entirely
> > > > fix it.
> > >
> > > I wonder if this can be fixed for that board only?
> >
> > No, and it's not -exactly- a that board only problem.  It's a HW design
> > issue that can show up elsewhere too.  I _think_ however in this case
> > the answer would be to migrate to perhaps CONFIG_AUTOBOOT_KEYED_CTRLC as
> > that's one of the reason various other boards use that set of options.
> >
> > I would suggest bringing this up on the beaglebone list to see what the
> > various people that ship and support these boards think, thanks!
> >
> 
> I actually enabled this feature this week by default for beagleboard.org:
> 
> diff --git a/configs/am335x_evm_defconfig b/configs/am335x_evm_defconfig
> index 27cb881..8699953 100644
> --- a/configs/am335x_evm_defconfig
> +++ b/configs/am335x_evm_defconfig
> @@ -3,7 +3,10 @@ CONFIG_TARGET_AM335X_EVM=y
>  CONFIG_SPL_STACK_R_ADDR=0x82000000
>  CONFIG_SPL=y
>  CONFIG_SPL_STACK_R=y
> -CONFIG_SYS_EXTRA_OPTIONS="NAND"
> +CONFIG_AUTOBOOT_KEYED=y
> +CONFIG_AUTOBOOT_PROMPT="Press SPACE to abort autoboot in %d seconds\n"
> +CONFIG_AUTOBOOT_DELAY_STR="d"
> +CONFIG_AUTOBOOT_STOP_STR=" "
>  # CONFIG_CMD_IMLS is not set
>  # CONFIG_CMD_FLASH is not set
>  CONFIG_CMD_GPIO=y
> 
> It'll take time to replace older images but on target users can just:
> 
> cd /opt/scripts/tools/developers/
> git pull
> sudo ./update_bootloader.sh
> 
> U-Boot SPL 2016.01-00001-g4eb802e (Jan 13 2016 - 11:14:31)
> Trying to boot from MMC
> bad magic
> 
> 
> U-Boot 2016.01-00001-g4eb802e (Jan 13 2016 - 11:14:31 -0600), Build:
> jenkins-github_Bootloader-Builder-313
> 
>        Watchdog enabled
> I2C:   ready
> DRAM:  512 MiB
> Reset Source: Global external warm reset has occurred.
> Reset Source: Power-on reset has occurred.
> MMC:   OMAP SD/MMC: 0, OMAP SD/MMC: 1
> Using default environment
> 
> Net:   <ethaddr> not set. Validating first E-fuse MAC
> cpsw, usb_ether
> Press SPACE to abort autoboot in 2 seconds
> =>

Space eh? OK.  Now would be the time to push this upstream as the merge
window just opened :)
Robert Nelson Jan. 14, 2016, 5:56 p.m. UTC | #2
On Thu, Jan 14, 2016 at 11:51 AM, Tom Rini <trini@konsulko.com> wrote:

> On Thu, Jan 14, 2016 at 11:48:07AM -0600, Robert Nelson wrote:
> > On Thu, Jan 14, 2016 at 11:31 AM, Tom Rini <trini@konsulko.com> wrote:
> >
> > > On Mon, Jan 11, 2016 at 09:59:18AM -0700, Simon Glass wrote:
> > > > Hi Craig,
> > > >
> > > > On 20 December 2015 at 19:07, Craig McQueen
> > > > <craig.mcqueen@innerrange.com> wrote:
> > > > > This is to avoid the boot sequence halting due to initial "junk"
> > > > > received on serial input.
> > > > >
> > > > > Signed-off-by: Craig McQueen <craig.mcqueen@innerrange.com>
> > > > > ---
> > > > > I have found that on the BeagleBone Black, U-Boot occasionally
> halts at
> > > > > the U-Boot prompt at boot-up, whether power-up, warm external
> > > > > reset or software reset. I have seen other people report the same
> > > issue.
> > > > >
> > > > > This seems to be due to U-Boot receiving "junk" data on the serial
> > > > > console. The BeagleBone Black has a pull-down resistor which was
> > > > > apparently added to try to mitigate this issue, but it doesn't
> entirely
> > > > > fix it.
> > > >
> > > > I wonder if this can be fixed for that board only?
> > >
> > > No, and it's not -exactly- a that board only problem.  It's a HW design
> > > issue that can show up elsewhere too.  I _think_ however in this case
> > > the answer would be to migrate to perhaps CONFIG_AUTOBOOT_KEYED_CTRLC
> as
> > > that's one of the reason various other boards use that set of options.
> > >
> > > I would suggest bringing this up on the beaglebone list to see what the
> > > various people that ship and support these boards think, thanks!
> > >
> >
> > I actually enabled this feature this week by default for beagleboard.org
> :
> >
> > diff --git a/configs/am335x_evm_defconfig b/configs/am335x_evm_defconfig
> > index 27cb881..8699953 100644
> > --- a/configs/am335x_evm_defconfig
> > +++ b/configs/am335x_evm_defconfig
> > @@ -3,7 +3,10 @@ CONFIG_TARGET_AM335X_EVM=y
> >  CONFIG_SPL_STACK_R_ADDR=0x82000000
> >  CONFIG_SPL=y
> >  CONFIG_SPL_STACK_R=y
> > -CONFIG_SYS_EXTRA_OPTIONS="NAND"
> > +CONFIG_AUTOBOOT_KEYED=y
> > +CONFIG_AUTOBOOT_PROMPT="Press SPACE to abort autoboot in %d seconds\n"
> > +CONFIG_AUTOBOOT_DELAY_STR="d"
> > +CONFIG_AUTOBOOT_STOP_STR=" "
> >  # CONFIG_CMD_IMLS is not set
> >  # CONFIG_CMD_FLASH is not set
> >  CONFIG_CMD_GPIO=y
> >
> > It'll take time to replace older images but on target users can just:
> >
> > cd /opt/scripts/tools/developers/
> > git pull
> > sudo ./update_bootloader.sh
> >
> > U-Boot SPL 2016.01-00001-g4eb802e (Jan 13 2016 - 11:14:31)
> > Trying to boot from MMC
> > bad magic
> >
> >
> > U-Boot 2016.01-00001-g4eb802e (Jan 13 2016 - 11:14:31 -0600), Build:
> > jenkins-github_Bootloader-Builder-313
> >
> >        Watchdog enabled
> > I2C:   ready
> > DRAM:  512 MiB
> > Reset Source: Global external warm reset has occurred.
> > Reset Source: Power-on reset has occurred.
> > MMC:   OMAP SD/MMC: 0, OMAP SD/MMC: 1
> > Using default environment
> >
> > Net:   <ethaddr> not set. Validating first E-fuse MAC
> > cpsw, usb_ether
> > Press SPACE to abort autoboot in 2 seconds
> > =>
>
> Space eh? OK.  Now would be the time to push this upstream as the merge
> window just opened :)
>

That seemed like the most common when i looked at it..

grep -R "AUTOBOOT_PROMPT" configs/*defconfig

Do you want me to hit all 3 bbb related configs?

beagleboard.org uses: am335x_evm_defconfig

I know some users use:
am335x_boneblack_defconfig
am335x_boneblack_vboot_defconfig

Regards,
Tom Rini Jan. 14, 2016, 6:03 p.m. UTC | #3
On Thu, Jan 14, 2016 at 11:56:29AM -0600, Robert Nelson wrote:
> On Thu, Jan 14, 2016 at 11:51 AM, Tom Rini <trini@konsulko.com> wrote:
> 
> > On Thu, Jan 14, 2016 at 11:48:07AM -0600, Robert Nelson wrote:
> > > On Thu, Jan 14, 2016 at 11:31 AM, Tom Rini <trini@konsulko.com> wrote:
> > >
> > > > On Mon, Jan 11, 2016 at 09:59:18AM -0700, Simon Glass wrote:
> > > > > Hi Craig,
> > > > >
> > > > > On 20 December 2015 at 19:07, Craig McQueen
> > > > > <craig.mcqueen@innerrange.com> wrote:
> > > > > > This is to avoid the boot sequence halting due to initial "junk"
> > > > > > received on serial input.
> > > > > >
> > > > > > Signed-off-by: Craig McQueen <craig.mcqueen@innerrange.com>
> > > > > > ---
> > > > > > I have found that on the BeagleBone Black, U-Boot occasionally
> > halts at
> > > > > > the U-Boot prompt at boot-up, whether power-up, warm external
> > > > > > reset or software reset. I have seen other people report the same
> > > > issue.
> > > > > >
> > > > > > This seems to be due to U-Boot receiving "junk" data on the serial
> > > > > > console. The BeagleBone Black has a pull-down resistor which was
> > > > > > apparently added to try to mitigate this issue, but it doesn't
> > entirely
> > > > > > fix it.
> > > > >
> > > > > I wonder if this can be fixed for that board only?
> > > >
> > > > No, and it's not -exactly- a that board only problem.  It's a HW design
> > > > issue that can show up elsewhere too.  I _think_ however in this case
> > > > the answer would be to migrate to perhaps CONFIG_AUTOBOOT_KEYED_CTRLC
> > as
> > > > that's one of the reason various other boards use that set of options.
> > > >
> > > > I would suggest bringing this up on the beaglebone list to see what the
> > > > various people that ship and support these boards think, thanks!
> > > >
> > >
> > > I actually enabled this feature this week by default for beagleboard.org
> > :
> > >
> > > diff --git a/configs/am335x_evm_defconfig b/configs/am335x_evm_defconfig
> > > index 27cb881..8699953 100644
> > > --- a/configs/am335x_evm_defconfig
> > > +++ b/configs/am335x_evm_defconfig
> > > @@ -3,7 +3,10 @@ CONFIG_TARGET_AM335X_EVM=y
> > >  CONFIG_SPL_STACK_R_ADDR=0x82000000
> > >  CONFIG_SPL=y
> > >  CONFIG_SPL_STACK_R=y
> > > -CONFIG_SYS_EXTRA_OPTIONS="NAND"
> > > +CONFIG_AUTOBOOT_KEYED=y
> > > +CONFIG_AUTOBOOT_PROMPT="Press SPACE to abort autoboot in %d seconds\n"
> > > +CONFIG_AUTOBOOT_DELAY_STR="d"
> > > +CONFIG_AUTOBOOT_STOP_STR=" "
> > >  # CONFIG_CMD_IMLS is not set
> > >  # CONFIG_CMD_FLASH is not set
> > >  CONFIG_CMD_GPIO=y
> > >
> > > It'll take time to replace older images but on target users can just:
> > >
> > > cd /opt/scripts/tools/developers/
> > > git pull
> > > sudo ./update_bootloader.sh
> > >
> > > U-Boot SPL 2016.01-00001-g4eb802e (Jan 13 2016 - 11:14:31)
> > > Trying to boot from MMC
> > > bad magic
> > >
> > >
> > > U-Boot 2016.01-00001-g4eb802e (Jan 13 2016 - 11:14:31 -0600), Build:
> > > jenkins-github_Bootloader-Builder-313
> > >
> > >        Watchdog enabled
> > > I2C:   ready
> > > DRAM:  512 MiB
> > > Reset Source: Global external warm reset has occurred.
> > > Reset Source: Power-on reset has occurred.
> > > MMC:   OMAP SD/MMC: 0, OMAP SD/MMC: 1
> > > Using default environment
> > >
> > > Net:   <ethaddr> not set. Validating first E-fuse MAC
> > > cpsw, usb_ether
> > > Press SPACE to abort autoboot in 2 seconds
> > > =>
> >
> > Space eh? OK.  Now would be the time to push this upstream as the merge
> > window just opened :)
> >
> 
> That seemed like the most common when i looked at it..
> 
> grep -R "AUTOBOOT_PROMPT" configs/*defconfig
> 
> Do you want me to hit all 3 bbb related configs?
> 
> beagleboard.org uses: am335x_evm_defconfig
> 
> I know some users use:
> am335x_boneblack_defconfig
> am335x_boneblack_vboot_defconfig

Yeah, hit those two as well please.  We can ignore the NOR ones since
people with a NOR cape likely have their UART hooked up anyhow and
that's iirc when the junk is a big problem.
diff mbox

Patch

diff --git a/configs/am335x_evm_defconfig b/configs/am335x_evm_defconfig
index 27cb881..8699953 100644
--- a/configs/am335x_evm_defconfig
+++ b/configs/am335x_evm_defconfig
@@ -3,7 +3,10 @@  CONFIG_TARGET_AM335X_EVM=y
 CONFIG_SPL_STACK_R_ADDR=0x82000000
 CONFIG_SPL=y
 CONFIG_SPL_STACK_R=y
-CONFIG_SYS_EXTRA_OPTIONS="NAND"
+CONFIG_AUTOBOOT_KEYED=y
+CONFIG_AUTOBOOT_PROMPT="Press SPACE to abort autoboot in %d seconds\n"
+CONFIG_AUTOBOOT_DELAY_STR="d"
+CONFIG_AUTOBOOT_STOP_STR=" "
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y