All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] why  uboot  can access address 0 in cavium?
@ 2011-07-04  1:55 luyue
  0 siblings, 0 replies; only message in thread
From: luyue @ 2011-07-04  1:55 UTC (permalink / raw)
  To: u-boot

hi all,
I have some question in uboot of mips arch.

in my boot,it doesn't set the correct TLB of virtual address 0, but it 
go on accessing it.
maybe it had better via 0x80000000 to access address 0.

in the code,I found this:

octeon_bzero64_pfs(0, 0x100000);

and the function is:

void octeon_bzero64_pfs(uint64_t start_addr, uint64_t count)
{
     if (count == 0)
         return;

     /* 4 Cache line align start/count */
     start_addr &= ~(OCTEON_BZERO_PFS_STRIDE -1);
     count &= ~(OCTEON_BZERO_PFS_STRIDE -1);;

     volatile uint32_t count_low  = count & 0xffffffff;
     volatile uint32_t count_high = count >> 32;

     volatile uint32_t addr_low  = start_addr & 0xffffffff;
     volatile uint32_t addr_high = start_addr >> 32;
     asm volatile (
       "  .set push                   \n"
       "  .set mips64                       \n"
       "  .set noreorder                    \n"
       /* Standard twin 32 bit -> 64 bit construction */
       "  dsll  %[cnth], 32                 \n"
       "  dsll  %[cntl], 32          \n"
       "  dsrl  %[cntl], 32          \n"
       "  daddu %[cnth], %[cnth], %[cntl]   \n"
       /* Combined value is in cnth */
       /* Standard twin 32 bit -> 64 bit construction */
       "  dsll  %[addrh], 32                 \n"
       "  dsll  %[addrl], 32          \n"
       "  dsrl  %[addrl], 32          \n"
       "  daddu %[addrh], %[addrh], %[addrl]   \n"
       /* Combined value is in addrh */
         /* Now do real work..... */
       " 1:                               \n"
       "  daddi  %[cnth], -512              \n"
       "  pref 30, 0(%[addrh])      \n"
       "  pref 30, 128(%[addrh])      \n"
       "  pref 30, 256(%[addrh])      \n"
       "  pref 30, 384(%[addrh])      \n"
       "  bne   $0, %[cnth], 1b          \n"
       "  daddi  %[addrh], 512              \n"
       "  .set pop                       \n"
       : : [cnth] "r" (count_high), [cntl] "r" (count_low), [addrh] "r" 
(addr_high), [addrl] "r" (addr_low): "memory");
}

how or why it can access virtual address 0?

in other place,the boot access 0x20000000 without via 0x20000000|0x80000000.
where is the magic do that?

thanks for your attention

-- 
hacklu
just keep fighting

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-07-04  1:55 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-04  1:55 [U-Boot] why uboot can access address 0 in cavium? luyue

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.