From: "Eric Bénard" <eric@eukrea.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [NEXT PATCH v1 4/7] MX35: Add soc_boot_mode and soc_boot_device to MX35
Date: Sun, 23 Sep 2012 21:25:43 +0200 [thread overview]
Message-ID: <20120923212543.38e1abc4@eb-e6520> (raw)
In-Reply-To: <1346918700-32429-5-git-send-email-sbabic@denx.de>
Hi Stefano,
Le Thu, 6 Sep 2012 10:04:57 +0200,
Stefano Babic <sbabic@denx.de> a ?crit :
> +#define RCSR_MEM_CTL_WEIM 0
> +#define RCSR_MEM_CTL_NAND 1
> +#define RCSR_MEM_CTL_SD 2
> +#define RCSR_MEM_TYPE_NOR 0
> +#define RCSR_MEM_TYPE_ONENAND 2
> +#define RCSR_MEM_TYPE_SD 0
> +#define RCSR_MEM_TYPE_I2C 2
> +#define RCSR_MEM_TYPE_SPI 3
> +
> +u32 spl_boot_device(void)
> +{
> + puts("spl_boot_device\n");
> + struct ccm_regs *ccm =
> + (struct ccm_regs *)IMX_CCM_BASE;
> +
> +#if 1
> + return BOOT_DEVICE_MMC1;
> +#endif
thisseems not clean and seems caused by the fact that the define
RCSR_MEM_CTL_SD should be 3 and not 2 so in your tests the function
spl_boot_device was not detecting the right boot mode. Also IMHO this
define should be named RCSR_MEM_CTL_EXPANSION as in the app note AN3996
at end of page 3 (there is a typo in the reference manual which seems
to be a copy'n paste from i.MX25 as it doesn't take in acount the ATA
HDD case) :
http://cache.freescale.com/files/dsp/doc/app_note/AN3996.pdf
> +
> + u32 rcsr = readl(&ccm->rcsr);
> + u32 mem_type, mem_ctl;
> +
> + /* In external mode, no boot device is returned */
> + if ((rcsr >> 10) & 0x03)
> + return BOOT_DEVICE_NONE;
> +
> + mem_ctl = (rcsr >> 25) & 0x03;
> + mem_type = (rcsr >> 23) & 0x03;
> +
> + switch (mem_ctl) {
> + case RCSR_MEM_CTL_WEIM:
> + switch (mem_type) {
> + case RCSR_MEM_TYPE_NOR:
> + return BOOT_DEVICE_NOR;
> + case RCSR_MEM_TYPE_ONENAND:
> + return BOOT_DEVICE_ONE_NAND;
> + default:
> + return BOOT_DEVICE_NONE;
> + }
> + case RCSR_MEM_CTL_NAND:
> + return BOOT_DEVICE_NAND;
> + case RCSR_MEM_CTL_SD:
> + switch (mem_type) {
> + case RCSR_MEM_TYPE_SD:
> + return BOOT_DEVICE_MMC1;
> + case RCSR_MEM_TYPE_I2C:
> + return BOOT_DEVICE_I2C;
> + case RCSR_MEM_TYPE_SPI:
> + return BOOT_DEVICE_SPI;
> + default:
> + return BOOT_DEVICE_NONE;
> + }
> + }
> +
> + return BOOT_DEVICE_NONE;
> +}
> +
Eric
next prev parent reply other threads:[~2012-09-23 19:25 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-06 8:04 [U-Boot] [NEXT PATCH v1 0/7] In this patchset, a new i.MX35 board is added implementing Stefano Babic
2012-09-06 8:04 ` [U-Boot] [NEXT PATCH v1 1/7] ARM: Fix start.S when used with SPL in arm1136 Stefano Babic
2012-09-06 8:04 ` [U-Boot] [NEXT PATCH v1 2/7] NAND: added NAND type to nand_ids Stefano Babic
2012-09-06 23:19 ` Scott Wood
2012-09-07 9:12 ` Stefano Babic
2012-09-07 15:23 ` Stefano Babic
2012-09-07 18:56 ` Scott Wood
2012-09-10 12:09 ` Stefano Babic
2012-09-10 23:18 ` Scott Wood
2012-10-01 7:02 ` Stefano Babic
2012-09-23 19:01 ` Eric Bénard
2012-09-24 8:29 ` Stefano Babic
2012-09-06 8:04 ` [U-Boot] [NEXT PATCH v1 3/7] MX35: add LOW_LEVEL_SRAM_STACK to use SPL_FRAMEWORK Stefano Babic
2012-09-06 8:04 ` [U-Boot] [NEXT PATCH v1 4/7] MX35: Add soc_boot_mode and soc_boot_device to MX35 Stefano Babic
2012-09-23 19:25 ` Eric Bénard [this message]
2012-09-24 8:35 ` Stefano Babic
2012-09-06 8:04 ` [U-Boot] [NEXT PATCH v1 5/7] SPL: Added MLO for mx35 SOC to SPL Makefile Stefano Babic
2012-09-06 17:49 ` Tom Rini
2012-09-06 19:59 ` Stefano Babic
2012-09-06 20:48 ` Tom Rini
2012-09-06 21:57 ` stefano babic
2012-09-10 12:27 ` Thomas Petazzoni
2012-09-10 12:44 ` Stefano Babic
2012-09-10 12:54 ` Tom Rini
2012-09-06 8:04 ` [U-Boot] [NEXT PATCH v1 6/7] ARM: Add MLO target to arm1136 Stefano Babic
2012-09-06 8:05 ` [U-Boot] [NEXT PATCH v1 7/7] MX35: add support for woodburn board 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=20120923212543.38e1abc4@eb-e6520 \
--to=eric@eukrea.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox