Skip to contentSkip to conversation

start.S code snippet doubt

U-Boot-Users Nishant Galange 5 participants 6 messages Nov 22, 2004 – Nov 23, 2004

lore
Share & tools
lore
#0 lore raw

Hi all,

What does the following code achieve: (Code snippet from start.S) boot_cold:

#if defined(CONFIG_MPC8260ADS)
	lis	r3, CFG_DEFAULT_IMMR at h
	nop
	lwz	r4, 0(r3)
	nop
	rlwinm	r4, r4, 0, 8, 5
	nop
	oris	r4, r4, 0x0200
	nop
	stw	r4, 0(r3)
	nop

#endif /* CONFIG_MPC8260ADS */

Can anyone please tell me the importance/significance of this code?

Regards,
Nishant

#1 lore raw
Quoted 2 lines · In message <[email protected]> you wrote:

What does the following code achieve: (Code snippet from start.S)

Which start.S? There are at least 25 files with this name.

Quoted 12 lines

boot_cold:

#if defined(CONFIG_MPC8260ADS)
	lis	r3, CFG_DEFAULT_IMMR at h
	nop
	lwz	r4, 0(r3)
	nop
	rlwinm	r4, r4, 0, 8, 5
	nop
	oris	r4, r4, 0x0200
	nop
	stw	r4, 0(r3)
	nop
Quoted 1 line

#endif /* CONFIG_MPC8260ADS */

Did you try to understand what the code is doing? And what CFG_DEFAULT_IMMR might mean?

Quoted 1 line

Can anyone please tell me the importance/significance of this code?

The code is very important and significant - without it U-Boot will not run on this board.

Best regards,

Wolfgang Denk

Signature · 5 lines
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
A person who is more than casually interested in computers should  be
well  schooled in machine language, since it is a fundamental part of
a computer.                                           -- Donald Knuth
#2 lore raw

[U-Boot-Users] Can the CPU load from flash without configuring it first?

Well, I think it *must* be that way, but to be sure I ask this probably question, though:

If a MPC875 starts, it will try to boot from the device selected by chip-select 0 (CS0), unless otherwise stated in the hard reset configuration word.
It will then try to access a flash/eprom/something device via the "GPCM" memory controller.
In order for this to work, the GPCM of the CPU must be possible to access a flash/eprom without prior configuration when booting.

Is that right?

Best regards,

Peter Asemann

#3 lore raw

[U-Boot-Users] Can the CPU load from flash without configuring it first?

Quoted 10 lines · Peter Asemann

Well, I think it *must* be that way, but to be sure I ask this probably question, though:

If a MPC875 starts, it will try to boot from the device selected by chip-select 0 (CS0), unless otherwise stated in the hard reset configuration word.
It will then try to access a flash/eprom/something device via the "GPCM" memory controller.
In order for this to work, the GPCM of the CPU must be possible to access a flash/eprom without prior configuration when booting.

How else could it boot otherwise? ;-)

Have a look at the power up default values of the GPCM config registers. You will see that their (most probably) set to meet the requirements for standard flash devices...

--
Steven

#4 lore raw

[U-Boot-Users] Can the CPU load from flash without configuring it first?

In reply to Peter Asemann
Quoted 6 lines · In message <[email protected]> you wrote:

Well, I think it *must* be that way, but to be sure I ask this probably question, though:

If a MPC875 starts, it will try to boot from the device selected by chip-select 0 (CS0), unless otherwise stated in the hard reset configuration word.

Don't speculate. RTFM. Read the User's manual for the processor. All these issues are there explained in great detail.

Best regards,

Wolfgang Denk

Signature · 3 lines
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Successful and fortunate crime is called virtue.             - Seneca
#5 lore raw
In reply to Nishant Galange
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

Nishant Galange writes:

Nishant> Hi all, What does the following code achieve: (Code snippet Nishant> from start.S) boot_cold:
Nishant> #if defined(CONFIG_MPC8260ADS)
Nishant> lis r3, CFG_DEFAULT_IMMR at h
Nishant> nop
Nishant> lwz r4, 0(r3)
Nishant> nop
Nishant> rlwinm r4, r4, 0, 8, 5
Nishant> nop
Nishant> oris r4, r4, 0x0200
Nishant> nop
Nishant> stw r4, 0(r3)
Nishant> nop
Nishant> #endif /* CONFIG_MPC8260ADS */

Nishant> Can anyone please tell me the importance/significance of Nishant> this code?

This code fixes incorrect BADDR configuration caused by wrong HRCW supplied by BCSR (FPGA) on some MPC8260ADS boards. It's configured as if there was L2 cache so that lower address lines are not functional (64-bit data bus). Without this code, such a board can't start from 32-bit flash SIMM. This code is for MPC8260ADS only so there should not be any problem.

Signature · 4 lines
========================================================================
 Yuli Barcohen       | Phone +972-9-765-1788 |  Software Project Leader
 yuli at arabellasw.com | Fax   +972-9-765-7494 | Arabella Software, Israel
========================================================================