Memory assign of p2020rdb

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Memory assign of p2020rdb

Jump to solution
1,515 Views
敏赵
Contributor I

Hello there,

I an designing a product using p2020cpu refering to the design of p2020rdb-pc. I have 4GB DDR, 32MB Nor Flash and no PCI. So I have to modify the memory map.In 36-bit u-boot my memory map:

                               0x0_0000_0000  0x0_ffff_ffff   DDR 

                               0xf_e000_0000  0xf_e00f_ffff  CCSRBAR                                             

                               0xf_fe00_0000   0xf_ffff_ffff     NOR  (0xf_fff8_0000 uboot)

I already have the appropriate 36-bit u-boot, I want to download the .bin file to my board by Codewarrior(v10.3.3).

I have some questions:

(1)Can I assign the address as above? Can I assign the NOR base address as I want?

(2)Do the memory windows in the Codewarrior have relationship with the memory map in u-boot? Or I can assign the address as I want?

(3)How should I assign the memory windows in Codewarrior?

(4)How should I build a project to achieve my memory map?

The steps that I download a 32-bit u-boot to p2020rdb-pc in Codewarrior is:file>new>codewarrior bareboard project  wizard>board-p2020rdb-pc >others is default.In Target Task I set Target RAM 00002000-00030000,Base Address FF000000.

(5)Now should I also choose p2020rdb-pc board? How can I achieve the 36-bit?

(6)Should I modify the files such as p2020rdb-pc_init_core.tcl? How to modify it?


Best regards,

Min Zhao

Labels (1)
0 Kudos
1 Solution
865 Views
catalindemergia
Contributor IV

Yes, the registers are 32-bits wide and the space is 36-bits, but the LAWBAR (local access window base address register)

contains only the high-order 24 bits, since the minimum size of any LAW is 4KB, so the 12 low-order bits of the base address

need not be specified. (see chapter 2 from the 2020 reference manual)

Also, you will find a lot of useful information in the " Utilizing 36-Bit Physical Addressing in U-Boot and Linux" PDF I attached here.

regards,

Catalin

View solution in original post

0 Kudos
9 Replies
865 Views
catalindemergia
Contributor IV

Hello,

If you want to change the target memory map that u-boot is making, you have to modify u-boot’s

source code. In u-boot/include/configs/<board_name.h> you will find defines used for the memory map.

After that, the code in u-boot/arch/<architecture_name>/lib/board.c will perform the memory map initialization.

Regards,

Catalin

0 Kudos
865 Views
敏赵
Contributor I

Hello,


I am afraid you may misunderstand what I meant. I don't want to modify the memory map in u-boot. I want to modify the memory windows in Codewarrior. But the question is I don't know how to modify it to match to memory map in u-boot.

Regards,

Min Zhao


0 Kudos
865 Views
catalindemergia
Contributor IV

Hello,

You have two options, either u-boot initializes the target memory map, either you use an

initialization file and CodeWarrior will do it. If you were refering to the memory windows from the

.tcl file (function init_board), yes, you can modify the .tcl if you want to, but they don't have to match

exactly what u-boot is doing. As long as the configuration is valid, you can initialize the target differently

from the initialization file.

regards,

Catalin

0 Kudos
865 Views
敏赵
Contributor I

Hello,

My board boot from NOR, because I have a 4GB DDR,32MB NOR, so I must use 36bit.

In this situation my memory map is:

               0x00000000 ~ 0xFFFFFFFF  DDR

               0xF_E0000000~ 0xF_E00FFFFF CCSR

               0xF_FE000000~ 0xF_FFFFFFFF  NOR

Can I assign the addresses like this? 

Can I still use the project for p2020rdb-pc? Or must I modify some files in the project then it can work? which files should I modify?

Best regards,

Min Zhao

0 Kudos
865 Views
catalindemergia
Contributor IV

Hello,

You have to program the LAWs (local access windows, there is a chapter "Memory Map" in the reference manual where they are described)

in order to make your custom memory map. You can modify the initialization file accordingly. This is the only modification you should do for defining

the memory map. They stay like that after they are configured, Linux does not modify LAWs after the system is booted.

regards,

Catalin

865 Views
敏赵
Contributor I

Hello,

What's the initialization file? I's it .tcl file?


Best regards,

Min Zhao

0 Kudos
865 Views
catalindemergia
Contributor IV

Yes, it's something like RDB_P2020_init_core.tcl

Catalin

865 Views
敏赵
Contributor I

In RDB_P2020_init_rom.tcl


#Memory Map

#   0xFF0000000xFFFFFFFF  LocalBus NOR FLASH16M


variable CCSRBAR   0xff700000

# L2SRBAR0

# bit 0-17 = BASE addr: 0xFFFC0000

mem [CCSR 0x20100] = 0xFFFC0000

Do the value of variable CCSRBAR and base address have relationships with the address of NOR?

My NOR address:  0xF_FE000000~ 0xF_FFFFFFFF

In this situation,  variable CCSRBAR  ?

                         mem [CCSR 0x20100] = ?

Best regards,

Min Zhao


0 Kudos
866 Views
catalindemergia
Contributor IV

Yes, the registers are 32-bits wide and the space is 36-bits, but the LAWBAR (local access window base address register)

contains only the high-order 24 bits, since the minimum size of any LAW is 4KB, so the 12 low-order bits of the base address

need not be specified. (see chapter 2 from the 2020 reference manual)

Also, you will find a lot of useful information in the " Utilizing 36-Bit Physical Addressing in U-Boot and Linux" PDF I attached here.

regards,

Catalin

0 Kudos