Skip to contentSkip to conversation

What are IBAT and DBAT?

U-Boot-Users Shawn 5 participants 7 messages Jun 28, 2004 – Jul 10, 2004

lore
Share & tools
lore

Shawn

author
#0 lore raw

Hi,

When trying to port u-boot to a MPC8245 card, I'm not sure what IBAT and DBAT register work for. For example, sl8245.h defines 4 regions of IBAT:
SDRAM_BASE, 0x40000000, 0x80000000, and 0xf0000000.

1. Why are these regions defined?

2. Does it mean that you cannot access that memory area if the area hasn't been set by configuring IBAT and DBAT accordingly?

3. Can IBAT and DBAT be modified dynamically? For example, if I want to access 0x70000000 ~ 0x78000000 temporarily, which is not defined in configuration header file, can I change the configuration of one of IBAT and DBAT pair, e.g. ibat2 and dbat2?

Thanks,
-Shawn.

__________________________________
Do you Yahoo!?
Yahoo! Mail is new and improved - Check it out!
http://promotions.yahoo.com/new_mail

#1 lore raw

Dear Shawn,

Quoted 3 lines · in message <[email protected]> you wrote:

When trying to port u-boot to a MPC8245 card, I'm not sure what IBAT and DBAT register work for. For example, sl8245.h defines 4 regions of IBAT:

If you have to ask such a question this is an indication that you don't have the qualification to port U-Boot. When dealing with software on such a low level as the boot loader you need a thorough understanding of the hardware and it's internal workings. Without this you are lost.

No offence meant.

Best regards,

Wolfgang Denk

Signature · 3 lines
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email: wd at denx.de
Of course there's no reason for it, it's just our policy.
#3 lore raw
In reply to Shawn
Quoted 5 lines · Shawn

3. Can IBAT and DBAT be modified dynamically? For example, if I want to access 0x70000000 ~ 0x78000000 temporarily, which is not defined in configuration header file, can I change the configuration of one of IBAT and DBAT pair, e.g. ibat2 and dbat2?

The Broadcom BMW board is based on the MPC8245, and it accesses part of that region of memory. You should use that code as an example.

However, I should note that, in U-Boot 1.0.0, the file "board/bmw/early_init.S" does not contain a GPL header.

-Robert DeLaGarza

#6 lore raw
In reply to Shawn

Hi,

Quoted 5 lines

3. Can IBAT and DBAT be modified dynamically? For example, if I want to access 0x70000000 ~ 0x78000000 temporarily, which is not defined in configuration header file, can I change the configuration of one of IBAT and DBAT pair, e.g. ibat2 and dbat2?

In case of board/etin/debris board.
DBAT1/IBAT1 is used for cache before RAM is initialized. After RAM is initialized and the data memory area is mapped to RAM, DBAT1/IBAT1 is not needed.
So I use DBAT1 for a flash memory at 0x78000000 after it. See board/etin/debris/flash.c.
You can find the following code in flash_init function.

msr = get_msr();
set_msr(msr & ~(MSR_IR | MSR_DR));

mtibat1l(0x70000000 | BATL_PP_10 | BATL_CACHEINHIBIT);
mtibat1u(0x70000000 | BATU_BL_256M | BATU_VS | BATU_VP);
mtdbat1l(0x70000000 | BATL_PP_10 | BATL_CACHEINHIBIT);
mtdbat1u(0x70000000 | BATU_BL_256M | BATU_VS | BATU_VP);

set_msr(msr);

You can also change IBAT1 with similar method.

Regards,
Sangmoon Kim

#4 lore raw
In reply to DeLaGarza

If you do use the bmw board as a model, be sure to include your define along with the "#if defined CONFIG_BMW" (in start.S) or you will not "drop" into early_init_f in early_init.S.

Quoted 22 lines · Robert
Quoted 1 line · Shawn

3. Can IBAT and DBAT be modified dynamically? For example,

if I want to

Quoted 1 line

access 0x70000000 ~ 0x78000000 temporarily, which is not

defined in

Quoted 1 line

configuration header file, can I change the configuration of

one of IBAT

Quoted 2 lines

and DBAT pair, e.g. ibat2 and dbat2?

The Broadcom BMW board is based on the MPC8245, and it accesses part of
that region of memory. You should use that code as an example.

However, I should note that, in U-Boot 1.0.0, the file "board/bmw/early_init.S" does not contain a GPL header.

-Robert DeLaGarza

Quoted 11 lines

-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training. Attend Black Hat Briefings & Training, Las Vegas July 24-29 - digital self defense, top technical experts, no vendor pitches,
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
U-Boot-Users mailing list
U-Boot-Users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users

__________________________________
Do you Yahoo!?
Yahoo! Mail Address AutoComplete - You start. We finish.
http://promotions.yahoo.com/new_mail

author
#2 lore raw
In reply to Wolfgang Denk
Quoted 10 lines
Quoted 1 line

When trying to port u-boot to a MPC8245 card, I'm not sure what IBAT

and

Quoted 1 line

DBAT register work for. For example, sl8245.h defines 4 regions of

IBAT:

If you have to ask such a question this is an indication that you don't have the qualification to port U-Boot. When dealing with software on such a low level as the boot loader you need a thorough understanding of the hardware and it's internal workings. Without this you are lost.

:(. You didn't answer the questions though. I'm learning from practice. I don't recall I touched any IBAT/DBAT configuration when I ported ppcboot to a MPC855 board. So configuring them seems new to me.

Thank other guys here for giving me hints and references.

-Shawn.

__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - Send 10MB messages!
http://promotions.yahoo.com/new_mail

#5 lore raw
In reply to DeLaGarza
Quoted 3 lines · In message <[email protected]> you wrote:

However, I should note that, in U-Boot 1.0.0, the file "board/bmw/early_init.S" does not contain a GPL header.

Thanks for pointing out. I will try to fix this.

James, IIRC it was you who submitted the "board/bmw/early_init.S" code; can you please submit a patch to add a GPL header to this file, or otherwise make clear that this file is under GPL so I can do that?

Best regards,

Wolfgang Denk

Signature · 3 lines
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email: wd at denx.de
Prediction is very difficult, especially of the future.  - Niels Bohr