From: Scott Wood <scottwood@freescale.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/2] nand/fsl_elbc: shrink SPL a bit by converting out_be32() to __raw_writel()
Date: Wed, 8 Aug 2012 20:03:33 -0500 [thread overview]
Message-ID: <20120809010333.GA25740@tyr.buserror.net> (raw)
This is needed to make room for a bugfix on p1_p2_rdb_pc. A sync is used
before the final write to LSOR that initiates the transaction, to ensure
all the other set up has been completed.
Signed-off-by: Scott Wood <scottwood@freescale.com>
---
nand_spl/nand_boot_fsl_elbc.c | 47 ++++++++++++++++++++++-------------------
1 file changed, 25 insertions(+), 22 deletions(-)
diff --git a/nand_spl/nand_boot_fsl_elbc.c b/nand_spl/nand_boot_fsl_elbc.c
index 502605b..e9d6497 100644
--- a/nand_spl/nand_boot_fsl_elbc.c
+++ b/nand_spl/nand_boot_fsl_elbc.c
@@ -66,39 +66,42 @@ static void nand_load(unsigned int offs, int uboot_size, uchar *dst)
if (large) {
fmr |= FMR_ECCM;
- out_be32(®s->fcr, (NAND_CMD_READ0 << FCR_CMD0_SHIFT) |
- (NAND_CMD_READSTART << FCR_CMD1_SHIFT));
- out_be32(®s->fir,
- (FIR_OP_CW0 << FIR_OP0_SHIFT) |
- (FIR_OP_CA << FIR_OP1_SHIFT) |
- (FIR_OP_PA << FIR_OP2_SHIFT) |
- (FIR_OP_CW1 << FIR_OP3_SHIFT) |
- (FIR_OP_RBW << FIR_OP4_SHIFT));
+ __raw_writel((NAND_CMD_READ0 << FCR_CMD0_SHIFT) |
+ (NAND_CMD_READSTART << FCR_CMD1_SHIFT),
+ ®s->fcr);
+ __raw_writel(
+ (FIR_OP_CW0 << FIR_OP0_SHIFT) |
+ (FIR_OP_CA << FIR_OP1_SHIFT) |
+ (FIR_OP_PA << FIR_OP2_SHIFT) |
+ (FIR_OP_CW1 << FIR_OP3_SHIFT) |
+ (FIR_OP_RBW << FIR_OP4_SHIFT),
+ ®s->fir);
} else {
- out_be32(®s->fcr, NAND_CMD_READ0 << FCR_CMD0_SHIFT);
- out_be32(®s->fir,
- (FIR_OP_CW0 << FIR_OP0_SHIFT) |
- (FIR_OP_CA << FIR_OP1_SHIFT) |
- (FIR_OP_PA << FIR_OP2_SHIFT) |
- (FIR_OP_RBW << FIR_OP3_SHIFT));
+ __raw_writel(NAND_CMD_READ0 << FCR_CMD0_SHIFT, ®s->fcr);
+ __raw_writel(
+ (FIR_OP_CW0 << FIR_OP0_SHIFT) |
+ (FIR_OP_CA << FIR_OP1_SHIFT) |
+ (FIR_OP_PA << FIR_OP2_SHIFT) |
+ (FIR_OP_RBW << FIR_OP3_SHIFT),
+ ®s->fir);
}
- out_be32(®s->fbcr, 0);
- clrsetbits_be32(®s->bank[0].br, BR_DECC, BR_DECC_CHK_GEN);
+ __raw_writel(0, ®s->fbcr);
while (pos < uboot_size) {
int i = 0;
- out_be32(®s->fbar, offs >> block_shift);
+ __raw_writel(offs >> block_shift, ®s->fbar);
do {
int j;
unsigned int page_offs = (offs & (block_size - 1)) << 1;
- out_be32(®s->ltesr, ~0);
- out_be32(®s->lteatr, 0);
- out_be32(®s->fpar, page_offs);
- out_be32(®s->fmr, fmr);
- out_be32(®s->lsor, 0);
+ __raw_writel(~0, ®s->ltesr);
+ __raw_writel(0, ®s->lteatr);
+ __raw_writel(page_offs, ®s->fpar);
+ __raw_writel(fmr, ®s->fmr);
+ sync();
+ __raw_writel(0, ®s->lsor);
nand_wait();
page_offs %= WINDOW_SIZE;
--
1.7.9.5
next reply other threads:[~2012-08-09 1:03 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-09 1:03 Scott Wood [this message]
2012-08-09 1:06 ` [U-Boot] [PATCH 2/2] powerpc/mpc85xx/p1_p2_rdb: add all LAWs during SPL Scott Wood
2012-08-09 2:28 ` McClintock Matthew-B29882
2012-08-09 2:28 ` McClintock Matthew-B29882
2012-08-09 16:52 ` Scott Wood
2012-08-10 6:54 ` Huang Changming-R66093
2012-08-10 16:05 ` Scott Wood
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=20120809010333.GA25740@tyr.buserror.net \
--to=scottwood@freescale.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.