On 7/2/07, <b class="gmail_sendername">Andy Fleming</b> <<a href="mailto:afleming@gmail.com">afleming@gmail.com</a>> wrote:<div><span class="gmail_quote"></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On 6/26/07, robert lazarski <<a href="mailto:robertlazarski@gmail.com">robertlazarski@gmail.com</a>> wrote:<br>> Hi all,<br>><br>> What's confusing me is there is no constant BOOKE_PAGESZ_128M. For example,
<br>> the cds board has 128MB of SDRAM (my board has no SDRAM) . So the way the<br>> cds code allocates the 128MB<br>> for sdram is:<br>><br>> /*<br>> * TLB 6: 64M Cacheable, non-guarded
<br>> * 0xf000_0000 64M LBC SDRAM<br>> */<br>> .long TLB1_MAS0(1, 6, 0)<br>> .long TLB1_MAS1(1, 1, 0, 0, BOOKE_PAGESZ_64M)<br>> .long TLB1_MAS2(E500_TLB_EPN(CFG_LBC_SDRAM_BASE),
<br>> 0,0,0,0,0,0,0,0)<br>> .long TLB1_MAS3(E500_TLB_RPN(CFG_LBC_SDRAM_BASE),<br>> 0,0,0,0,0,1,0,1,0,1)<br>><br>><br>> With LAW comments:<br>><br>> * 0xf000_0000 0xf7ff_ffff SDRAM 128M
<br>><br><br><br>Ugh, that's awful. It's a bug, and needs to be fixed.<br><br><br>> I'm thinking this is because the TLB size can be allocated as 64MB for the<br>> 128MB of flash, and then the LAW code needs to allocate the full 128MB for
<br>> flash. So in preparation for my boards arrival, I'm thinking I can do this<br>> for the flash:<br><br>The TLB size is wrong. It can't be 128M, because Book E only allows<br>specifying powers of 4 for the size. So to do 128M, you need to use
<br>two TLB entries to specify 128M.<br><br>The LAWs *also* need to have full 128M, but they can do any power of two.<br><br>Andy<br></blockquote></div><br><br>
Thanks Andy, things are getting clearer. I found another example that seems to have a bad comment, from
the board/tqm85xx/init.S out of u-boot 1.2.0 . TLB 0, 1 does this which
seems to be a good example: <br>
<br>
/*<br>
* TLB 0, 1: 128M Non-cacheable, guarded<br>
* 0xf8000000 128M FLASH<br>
* Out of reset this entry is only 4K.<br>
*/<br>
.long TLB1_MAS0(1, 1, 0)<br>
.long TLB1_MAS1(1, 1, 0, 0, BOOKE_PAGESZ_64M)<br>
.long TLB1_MAS2(E500_TLB_EPN(CFG_FLASH_BASE), 0,0,0,0,1,0,1,0)<br>
.long TLB1_MAS3(E500_TLB_RPN(CFG_FLASH_BASE), 0,0,0,0,0,1,0,1,0,1)<br>
.long TLB1_MAS0(1, 0, 0)<br>
.long TLB1_MAS1(1, 1, 0, 0, BOOKE_PAGESZ_64M)<br>
.long TLB1_MAS2(E500_TLB_EPN(CFG_FLASH_BASE+0x4000000), 0,0,0,0,1,0,1,0)<br>
.long TLB1_MAS3(E500_TLB_RPN(CFG_FLASH_BASE+0x4000000), 0,0,0,0,0,1,0,1,0,1)<br>
<br>
But then the LAW comments say this, is this wrong? <br>
<br>
* 0xfe00_0000 0xffff_ffff FLASH (boot bank) 32M<br>
<br>
The actual LAW macros looks right though, doesn't it? <br>
<br>
#define LAWBAR2 ((CFG_LBC_FLASH_BASE>>12) & 0xfffff)<br>
#define LAWAR2 (LAWAR_EN | LAWAR_TRGT_IF_LBC | (LAWAR_SIZE & LAWAR_SIZE_128M))<br>
<br>
Robert <br>
<br>