From: luyue <hacklu.uboot@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] why uboot can access address 0 in cavium?
Date: Mon, 04 Jul 2011 09:55:15 +0800 [thread overview]
Message-ID: <4E111D83.40707@gmail.com> (raw)
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
reply other threads:[~2011-07-04 1:55 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4E111D83.40707@gmail.com \
--to=hacklu.uboot@gmail.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox