Re: [U-Boot] building and updating u-boot on redboot based

Hi Matthias,
I did update my board after applying the patch you sent and I found no problem with booting up of the board. The only visible change to me was in U-Boot version string with latest time stamp and -dirty appended as below.
Before Update: U-Boot 2009.11-00400-g77e7273 (Feb 21 2010 - 01:15:31)
After Update: U-Boot 2009.11-00400-g77e7273-dirty (Feb 22 2010 - 13:06:39)
Is there any specific test/command you would like me to execute?
Regards, Vipul.
On Mon, Feb 22, 2010 at 12:35 PM, Matthias Kaehlcke matthias@kaehlcke.netwrote:
hi vipul,
something must have gone wrong when copying the patch to the mail ... i attached the patch to this mail, i hope this works better
thanks for testing!
matthias
El Mon, Feb 22, 2010 at 12:05:29PM -0800 Vipul Jain ha dit:
I tried to copy paste the diffs into a text file called
ep93xx.sdram.patch and ran patch command but it rejected/failed. I did notice that in the email the diff has mingled around the @@ -R +R@@ with the source code line as below: @@ -101,6 +120,11 @@ static void setup_refresh_timer(void)
I was wondering, if you could send me the diff in text file rather can copy paste it in email.
I am attaching the patch file I created the rej report that got
created in
case you would like to have a look.
Regards, Vipul.
On Mon, Feb 22, 2010 at 1:04 AM, Matthias Kaehlcke <
matthias@kaehlcke.net>
wrote:
hi vipul, El Sun, Feb 21, 2010 at 01:13:22PM -0800 Vipul Jain ha dit: > I had two workspaces one which I got from main u-boot source
base
and > other from > git clone git://gitorious.org/u-boot-ep93xx/u-boot-ep93xx.git > and by mistake I used u-boot.bin image build from this ep93xx specific > > source tree which made my board unbootable. This time I build
the
image > from main > u-boot git source while using the download tool and it powered
up
as > smooth as it > can without any issues. so I believe that main u-boot source is perfect. > > Sorry about any confusion. Will have to now figure out how to restore > linux kernel > back? ... :) > > Please kindly let me know if you want me to perform any kind of testing > for ep9302. > I will be more than happy if I could be of any help to you. as i told you in a previous mail the current SDRAM initialization isn't totally correct. it works on most boards, but doesn't follow
the
sequence in the specification. below is a patch that works on my edb9301 and edb9307a boards, it would be good to know if this is
also
true for the edb9302. when you find some time could you please apply it on your tree and tell me if the board boots? thanks Matthias --- diff --git a/board/edb93xx/sdram_cfg.c b/board/edb93xx/sdram_cfg.c index 6155f0e..61950f3 100644 --- a/board/edb93xx/sdram_cfg.c +++ b/board/edb93xx/sdram_cfg.c @@ -1,5 +1,6 @@ /* - * Copyright (C) 2009 Matthias Kaehlcke <matthias@kaehlcke.net> + * Copyright (C) 2010, 2009 + * Matthias Kaehlcke <matthias@kaehlcke.net> * * Copyright (C) 2006 Dominic Rath <Dominic.Rath@gmx.de> * @@ -26,13 +27,13 @@ #include "sdram_cfg.h" #include "early_udelay.h" +#define PRECHARGE_BANK(bank) (*(volatile uint32_t *) \ + (SDRAM_BASE_ADDR | SDRAM_BANK_SEL_##bank)) = 0 + #define PROGRAM_MODE_REG(bank) (*(volatile uint32_t *) \ (SDRAM_BASE_ADDR | SDRAM_BANK_SEL_##bank | SDRAM_MODE_REG_VAL)) -#define PRECHARGE_BANK(bank) (*(volatile uint32_t *) \ - (SDRAM_BASE_ADDR | SDRAM_BANK_SEL_##bank)) - -static void force_precharge(void); +static void precharge_all_banks(void); static void setup_refresh_timer(void); static void program_mode_registers(void); @@ -47,7 +48,7 @@ void sdram_cfg(void) early_udelay(200); - force_precharge(); + precharge_all_banks(); setup_refresh_timer(); @@ -57,19 +58,37 @@ void sdram_cfg(void) writel(GLCONFIG_CKE, &sdram->glconfig); } -static void force_precharge(void) +static void precharge_all_banks(void) { + struct sdram_regs *sdram = (struct sdram_regs *)SDRAM_BASE; + + /* Issue PRECHARGE ALL commands */ + writel(GLCONFIG_INIT | GLCONFIG_CKE, &sdram->glconfig); + /* - * Errata most EP93xx revisions say that PRECHARGE ALL isn't always - * issued. + * Errata of most EP93xx revisions say that PRECHARGE ALL
isn't
always + * issued * - * Do a read from each bank to make sure they're precharged + * Cirrus proposes a workaround which consists in performing
a
read from + * each bank to force the precharge. This causes some boards
to
hang. + * Writing to the SDRAM banks instead of reading has the
same
+ * side-effect (the SDRAM controller issues the necessary precharges), + * but is known to work on all supported boards */ PRECHARGE_BANK(0); + +#if (CONFIG_NR_DRAM_BANKS >= 2) PRECHARGE_BANK(1); +#endif + +#if (CONFIG_NR_DRAM_BANKS >= 3) PRECHARGE_BANK(2); +#endif + +#if (CONFIG_NR_DRAM_BANKS == 4) PRECHARGE_BANK(3); +#endif } static void setup_refresh_timer(void) @@ -101,6 +120,11 @@ static void setup_refresh_timer(void) static void program_mode_registers(void) { + struct sdram_regs *sdram = (struct sdram_regs *)SDRAM_BASE; + + /* Select mode register update mode */ + writel(GLCONFIG_MRS | GLCONFIG_CKE, &sdram->glconfig); + La guerra es un acto abominable en el que se matan personas que
no
se conocen, dirigidas por personas que se conocen y no se matan
.''`.
using free software / Debian GNU/Linux | http://debian.org : :'
:
`.
`'`
gpg --keyserver pgp.mit.edu --recv-keys 47D8E5D4
`-
--- board/edb93xx/sdram_cfg.c +++ board/edb93xx/sdram_cfg.c @@ -1,5 +1,6 @@ /*
- Copyright (C) 2009 Matthias Kaehlcke matthias@kaehlcke.net
- Copyright (C) 2010, 2009
- Matthias Kaehlcke matthias@kaehlcke.net
- Copyright (C) 2006 Dominic Rath Dominic.Rath@gmx.de
@@ -26,13 +27,13 @@ #include "sdram_cfg.h" #include "early_udelay.h"
+#define PRECHARGE_BANK(bank) (*(volatile uint32_t *) \
(SDRAM_BASE_ADDR | SDRAM_BANK_SEL_##bank)) = 0
#define PROGRAM_MODE_REG(bank) (*(volatile uint32_t *) \ (SDRAM_BASE_ADDR | SDRAM_BANK_SEL_##bank |
SDRAM_MODE_REG_VAL))
-#define PRECHARGE_BANK(bank) (*(volatile uint32_t *) \
(SDRAM_BASE_ADDR |
SDRAM_BANK_SEL_##bank))
-static void force_precharge(void); +static void precharge_all_banks(void); static void setup_refresh_timer(void); static void program_mode_registers(void);
@@ -47,7 +48,7 @@ void sdram_cfg(void)
early_udelay(200);
force_precharge();
precharge_all_banks(); setup_refresh_timer();
@@ -57,19 +58,37 @@ void sdram_cfg(void) writel(GLCONFIG_CKE, &sdram->glconfig); }
-static void force_precharge(void) +static void precharge_all_banks(void) {
struct sdram_regs *sdram = (struct sdram_regs *)SDRAM_BASE;
/* Issue PRECHARGE ALL commands */
writel(GLCONFIG_INIT | GLCONFIG_CKE, &sdram->glconfig);
/*
* Errata most EP93xx revisions say that PRECHARGE ALL isn't
always
* issued.
* Errata of most EP93xx revisions say that PRECHARGE ALL isn't
always
* issued *
* Do a read from each bank to make sure they're precharged
* Cirrus proposes a workaround which consists in performing a
read from
* each bank to force the precharge. This causes some boards to
hang.
* Writing to the SDRAM banks instead of reading has the same
* side-effect (the SDRAM controller issues the necessary
precharges),
* but is known to work on all supported boards */ PRECHARGE_BANK(0);
+#if (CONFIG_NR_DRAM_BANKS >= 2) PRECHARGE_BANK(1); +#endif
+#if (CONFIG_NR_DRAM_BANKS >= 3) PRECHARGE_BANK(2); +#endif
+#if (CONFIG_NR_DRAM_BANKS == 4) PRECHARGE_BANK(3); +#endif }
static void setup_refresh_timer(void) @@ -101,6 +120,11 @@ static void setup_refresh_timer(void)
static void program_mode_registers(void) {
struct sdram_regs *sdram = (struct sdram_regs *)SDRAM_BASE;
/* Select mode register update mode */
writel(GLCONFIG_MRS | GLCONFIG_CKE, &sdram->glconfig);
-- Matthias Kaehlcke Embedded Linux Developer Barcelona
You must have a plan. If you don't have a plan, you'll become part of somebody else's plan .''`.
using free software / Debian GNU/Linux | http://debian.org : :' : `. `'` gpg --keyserver pgp.mit.edu --recv-keys 47D8E5D4 `-

Hi Vipul,
El Mon, Feb 22, 2010 at 01:25:01PM -0800 Vipul Jain ha dit:
I did update my board after applying the patch you sent and I found no problem with booting up of the board. The only visible change to me was in U-Boot version string with latest time stamp and -dirty appended as below.
good news!
Before Update: U-Boot 2009.11-00400-g77e7273 (Feb 21 2010 - 01:15:31)
After Update: U-Boot 2009.11-00400-g77e7273-dirty (Feb 22 2010 - 13:06:39)
Is there any specific test/command you would like me to execute?
if the board boots with the modified SDRAM initialization no further testing is required
thanks a lot for testing!
participants (2)
-
Matthias Kaehlcke
-
Vipul Jain