public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot-Users] Memory Banks & Flash Mapping
@ 2006-02-14  7:31 Josef Angermeier
  2006-02-17  0:12 ` Wolfgang Denk
  0 siblings, 1 reply; 7+ messages in thread
From: Josef Angermeier @ 2006-02-14  7:31 UTC (permalink / raw)
  To: u-boot

Hello u-boot users,

in the README-file you can read this:

- FLASH_BASE0_PRELIM, FLASH_BASE1_PRELIM, CFG_REMAP_OR_AM,
  CFG_PRELIM_OR_AM, CFG_OR_TIMING_FLASH, CFG_OR0_REMAP,
  CFG_OR0_PRELIM, CFG_BR0_PRELIM, CFG_OR1_REMAP, CFG_OR1_PRELIM,
  CFG_BR1_PRELIM:
     		Memory Controller Definitions: BR0/1 and OR0/1 (FLASH)

So memory bank 1 shouldn't get used for SDRAM, but bank 2 and 3 ?
*_PRELIM is the address before u-boot relocation to RAM, isn't it ? 
But *_REMAP after that ?

Whats CFG_FLASH_BASE good for, if i have to configure the memory bank
base register value of my MPC875-board anyway with CFG_BR0_* ?

Further, i am now facing the problem, that my BR1 SDRAM-memory bank gets
changed correctly at u-boot runtime, but the BR0-flash-memory-bank keeps
its PRELIM-value when reaching the command shell. 

I now wonder, if i misconfigured my board header file, or if not,
where i shall add the new memory bank reprogramming code for flash space
- in drivers/cfi_flash.c:flash_init() ?

One last question: I am porting u-boot to a not yet very popular
developer board with a MPC875. Shall i add my changes although to your
CVS repository ?

Thanks in advance

Josef

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [U-Boot-Users] Memory Banks & Flash Mapping
  2006-02-14  7:31 [U-Boot-Users] Memory Banks & Flash Mapping Josef Angermeier
@ 2006-02-17  0:12 ` Wolfgang Denk
  2006-02-17  9:20   ` Josef Angermeier
  0 siblings, 1 reply; 7+ messages in thread
From: Wolfgang Denk @ 2006-02-17  0:12 UTC (permalink / raw)
  To: u-boot

In message <20060214073113.GA2319@false> you wrote:
> 
> So memory bank 1 shouldn't get used for SDRAM, but bank 2 and 3 ?

You design the hardware, you it's your choice.

> *_PRELIM is the address before u-boot relocation to RAM, isn't it ? 
> But *_REMAP after that ?

Wrong. Please read the README.

> Whats CFG_FLASH_BASE good for, if i have to configure the memory bank
> base register value of my MPC875-board anyway with CFG_BR0_* ?

There is more than just one architecture...

> Further, i am now facing the problem, that my BR1 SDRAM-memory bank gets
> changed correctly at u-boot runtime, but the BR0-flash-memory-bank keeps
> its PRELIM-value when reaching the command shell. 

Misconfigured system?

> I now wonder, if i misconfigured my board header file, or if not,

Yes.

> where i shall add the new memory bank reprogramming code for flash space
> - in drivers/cfi_flash.c:flash_init() ?

??? There should be no need to add anything.

> One last question: I am porting u-boot to a not yet very popular
> developer board with a MPC875. Shall i add my changes although to your
> CVS repository ?

CVS is dead. We use git now.

Best regards,

Wolfgang Denk

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
It may be that your whole purpose in life is simply  to  serve  as  a
warning to others.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [U-Boot-Users] Memory Banks & Flash Mapping
  2006-02-17  0:12 ` Wolfgang Denk
@ 2006-02-17  9:20   ` Josef Angermeier
  2006-02-17  9:49     ` Wolfgang Denk
  0 siblings, 1 reply; 7+ messages in thread
From: Josef Angermeier @ 2006-02-17  9:20 UTC (permalink / raw)
  To: u-boot

Hello

> > Further, i am now facing the problem, that my BR1 SDRAM-memory bank gets
> > changed correctly at u-boot runtime, but the BR0-flash-memory-bank keeps
> > its PRELIM-value when reaching the command shell. 

> Misconfigured system?

from README:

"Because of the reset configuration for CS0# this is a mirror of the
onboard Flash memory.  To be able to re-map memory U-Boot then jumps to
its link address."

I don't get the second sentence. Flash is executed near the beginning of
address space, exactly where the SDRAM shall get mapped. How is this
possible ? 

As far as i understand my (working) u-boot code, relocation just works
for my MPC875 board just because SDRAM is 64MB and Flash is 16MB in
size. So when both are mapped to 0x0 just the first 16MB overlap and
u-boot can be successfully copied at the 64th MB and executed there. But
how could it be done if i just got 16MB of SDRAM ?

> > One last question: I am porting u-boot to a not yet very popular
> > developer board with a MPC875. Shall i add my changes although to your
> > CVS repository ?

> CVS is dead. We use git now.

My concern was, if you are interested in my extensions.

> Best regards,

> Wolfgang Denk

Thanks again Wolfgang

Josef Angermeier

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [U-Boot-Users] Memory Banks & Flash Mapping
  2006-02-17  9:20   ` Josef Angermeier
@ 2006-02-17  9:49     ` Wolfgang Denk
  2006-02-17 11:44       ` Josef Angermeier
  0 siblings, 1 reply; 7+ messages in thread
From: Wolfgang Denk @ 2006-02-17  9:49 UTC (permalink / raw)
  To: u-boot

In message <20060217092048.GA4381@false> you wrote:
> 
> "Because of the reset configuration for CS0# this is a mirror of the
> onboard Flash memory.  To be able to re-map memory U-Boot then jumps to
> its link address."
> 
> I don't get the second sentence. Flash is executed near the beginning of
> address space, exactly where the SDRAM shall get mapped. How is this
> possible ? 

How is what possible? Jumping to  the  link  addresses?  Because  the
flash  gets  mirrores many times. Mapping of SDRAM? Because we change
the flash mapping from the reset  configuration  via  a  pre,liminary
into the final mapping.

> As far as i understand my (working) u-boot code, relocation just works
> for my MPC875 board just because SDRAM is 64MB and Flash is 16MB in
> size. So when both are mapped to 0x0 just the first 16MB overlap and

RAM gets mapped only long after flash has been reconfigured, and then
it's out of the way.

> My concern was, if you are interested in my extensions.

Yes, of course.

Best regards,

Wolfgang Denk

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
I had the rare misfortune of being one of the first people to try and
implement a PL/1 compiler.                             -- T. Cheatham

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [U-Boot-Users] Memory Banks & Flash Mapping
  2006-02-17  9:49     ` Wolfgang Denk
@ 2006-02-17 11:44       ` Josef Angermeier
  2006-02-17 13:52         ` Wolfgang Denk
  0 siblings, 1 reply; 7+ messages in thread
From: Josef Angermeier @ 2006-02-17 11:44 UTC (permalink / raw)
  To: u-boot

Hello again!

> > As far as i understand my (working) u-boot code, relocation just works
> > for my MPC875 board just because SDRAM is 64MB and Flash is 16MB in
> > size. So when both are mapped to 0x0 just the first 16MB overlap and

> RAM gets mapped only long after flash has been reconfigured, and then
> it's out of the way.

I see. Which files hold the sourcecode to map the flash away ? - I'd
like to understand that one!

Thanks Wolfang

Best regards,
Josef

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [U-Boot-Users] Memory Banks & Flash Mapping
  2006-02-17 11:44       ` Josef Angermeier
@ 2006-02-17 13:52         ` Wolfgang Denk
  2006-02-17 20:27           ` Josef Angermeier
  0 siblings, 1 reply; 7+ messages in thread
From: Wolfgang Denk @ 2006-02-17 13:52 UTC (permalink / raw)
  To: u-boot

In message <20060217114421.GB13280@false> you wrote:
>
> I see. Which files hold the sourcecode to map the flash away ? - I'd
> like to understand that one!

That's the memory controller initialization -  function  cpu_init_f()
in "cpu/mpc8xx/cpu_init.c"

Best regards,

Wolfgang Denk

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Q:  How do you tell if you're making  love  to  a  nurse,  a  school-
    teacher, or an airline stewardess?
A:  A nurse says: "This won't hurt  a  bit."  A  schoolteacher  says:
    "We're  going to have to do this over and over again until we get
    it right." An airline stewardess says: "Just hold this over  your
    mouth and nose, and breath normally."

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [U-Boot-Users] Memory Banks & Flash Mapping
  2006-02-17 13:52         ` Wolfgang Denk
@ 2006-02-17 20:27           ` Josef Angermeier
  0 siblings, 0 replies; 7+ messages in thread
From: Josef Angermeier @ 2006-02-17 20:27 UTC (permalink / raw)
  To: u-boot

Hello Wolfgang

> > I see. Which files hold the sourcecode to map the flash away ? - I'd
> > like to understand that one!

> That's the memory controller initialization -  function  cpu_init_f()
> in "cpu/mpc8xx/cpu_init.c"

AAAHH! Thanks, i think i finally understood it!

My flash memory space gets now fully initialized in cpu_init_f. Changed
TEXT_BASE to 0x40f00000 and BR0_PRELIM to 0x40000001. 

So MPC875 starts execution at 0xfff00100, because of ignoring the upper
8 address bits and CS0 default usage after reset, u-boot is executed
anyway. When jumping to 0x40fXXXXX, the CPU is aware of the flash
destination and br0 is updated to 0x40000000 to stop aliasing and keep
execution in flash working...  :-))) big thanks goes to Wolfgang!


> Best regards,

> Wolfgang Denk

byebye
Josef

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2006-02-17 20:27 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-14  7:31 [U-Boot-Users] Memory Banks & Flash Mapping Josef Angermeier
2006-02-17  0:12 ` Wolfgang Denk
2006-02-17  9:20   ` Josef Angermeier
2006-02-17  9:49     ` Wolfgang Denk
2006-02-17 11:44       ` Josef Angermeier
2006-02-17 13:52         ` Wolfgang Denk
2006-02-17 20:27           ` Josef Angermeier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox