All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Nelson <eric@nelint.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] imx_common: check for Serial Downloader in spl_boot_device
Date: Sat, 5 Dec 2015 13:13:58 -0700	[thread overview]
Message-ID: <56634586.6050200@nelint.com> (raw)
In-Reply-To: <1449219732-5396-1-git-send-email-sbabic@denx.de>

Hi Stefano,

On 12/04/2015 02:02 AM, Stefano Babic wrote:
> Check for bmode before reading the boot device
> to check if a serial downloader is started,
> and returns UART if the serial downloader is set,
> letting SPL to wait for an image if
> CONFIG_SPL_YMODEM_SUPPORT is set.
> 
> This allows to load again a SPL based board
> with imx_usb_loader together with a tool
> such as kermit.
> 
> Signed-off-by: Stefano Babic <sbabic@denx.de>
> CC: Tim Harvey <tharvey@gateworks.com>
> CC: Fabio Estevam <Fabio.Estevam@freescale.com>
> CC: Eric Nelson <eric.nelson@boundarydevices.com>
> ---
> 
> Note: I know we have already discussed more complicated solution
> 	for adding multilple files to imx_usb_loader.
> 	However, fixing ymodem support for i.MX6
> 	was trivial and imx_usb_loader is working
> 	again.
> 
>  arch/arm/imx-common/spl.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/arch/arm/imx-common/spl.c b/arch/arm/imx-common/spl.c
> index ac6e40e..28217d2 100644
> --- a/arch/arm/imx-common/spl.c
> +++ b/arch/arm/imx-common/spl.c
> @@ -20,7 +20,14 @@ u32 spl_boot_device(void)
>  	struct src *psrc = (struct src *)SRC_BASE_ADDR;
>  	unsigned int gpr10_boot = readl(&psrc->gpr10) & (1 << 28);
>  	unsigned reg = gpr10_boot ? readl(&psrc->gpr9) : readl(&psrc->sbmr1);
> +	unsigned int bmode = readl(&psrc->sbmr2);
>  
> +	/*
> +	 * Check for BMODE if serial downloader is enabled
> +	 * BOOT_MODE - see IMX6DQRM Table 8-1
> +	 */

I think you may need to check only bits 24 and 25 here.

> +	if ((bmode >> 24) == 0x01) /* Serial Downloader */
> +		return BOOT_DEVICE_UART;

Even though the data sheet says the high bits should be zero,
I'm seeing some other bits set on an i.MX6SL:

	=> mm 0x020d801c
	020d801c: 22000001 ? x

Separately, what's your thought about enabling this when the
system is reset through "bmode usb"?

http://git.denx.de/?p=u-boot.git;a=blob;f=arch/arm/cpu/armv7/mx6/soc.c;h=bf5ae8cdffd8b0887291249332b06f66dc644832;hb=HEAD#l389

Since the gpr9 value in this mode is 0x00000001, the switch
statement currently falls into the NOR/OneNAND block, which
is pretty useless.

  parent reply	other threads:[~2015-12-05 20:13 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-04  9:02 [U-Boot] [PATCH] imx_common: check for Serial Downloader in spl_boot_device Stefano Babic
2015-12-04 10:51 ` Fabio Estevam
2015-12-04 11:49   ` Stefano Babic
2015-12-04 13:09     ` Stefan Roese
2015-12-04 14:30       ` Tim Harvey
2015-12-05  7:10       ` Stefano Babic
2015-12-05 20:13 ` Eric Nelson [this message]
2015-12-07  9:55   ` Stefano Babic
2015-12-07 11:59     ` Stefano Babic
2015-12-07 14:08     ` Eric Nelson
2015-12-07 14:24       ` Stefano Babic

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56634586.6050200@nelint.com \
    --to=eric@nelint.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.