From: Viswanath Bandi <bandiv@txc.stpn.soft.net>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] Accessing IRAM & DRAM through different segments in MIPS
Date: Wed, 09 Jan 2008 13:33:23 +0530 [thread overview]
Message-ID: <47847FCB.2040603@txc.stpn.soft.net> (raw)
In-Reply-To: <7aee76880801071830g5689b6e1u9e4451ce14c23dd1@mail.gmail.com>
Thanks Shinya & Donald for the suggestions.
Following is our cache configuration.
Cache Size (KB): 8KBytes
Associativity (Lines Per Set): 4-Ways
Way Size (KB): 2KBytes
Number of Sets:128 Sets
Cache Line Size: 16-bytes per line
One more thing I found out is that the cache works when configured in
write-through mode (with or without write allocate). The only mode which
is giving problem is "write-back, write allocate".
Two more points:
1) By the time the program hangs, relocation is done and program starts
executing from DDR. It hangs somewhere down the program.
2) Whenever it hangs, it's reading gp value from stack and getting wrong
value. When I single step through the code which actually puts it on the
stack (sw), then this program goes further. Doesn't hang at this point.
I will try this piece of code and see if it makes any difference.
Best Regards,
Viswanath Bandi
Hoi-Ho Chan wrote:
> I had a similar problem with running U-boot on a 4KEc processor on
> cached memory, u-boot got stuck after display the memory sizes. Then I
> added a routine like this:
>
> ulong start_addr = KSEG0;
> ulong end_addr = start_addr + CFG_DCACHE_SIZE;
>
> while (start_addr < end_addr) {
> __asm__ __voltaile__(".set noreorder; \
> .set mips3; \
> cache %1, (%0);
> .set mips0;
> .set reorder"::"r"(start_addr),
> "i"(Index_Writeback_Inv_D));
>
> start_addr += CFG_CACHELINE_SIZE;
> }
>
> and then call it at lib_mips/board.c right before relocate_code(...)
>
> seems to work for me.
>
> Thanks
> Donald
>
> On Jan 5, 2008 4:55 AM, Viswanath Bandi <bandiv@txc.stpn.soft.net> wrote:
>
>> Hi All,
>>
>> I am trying to run U-boot on a MIPS 4KEc processor mapped onto FPGA. The
>> code is working fine when KSEG0 is configured as un-cached segment (K0
>> field in CP0 register 16 configured as 2). But when I make this as
>> cached segment, the code crashes and I see that the values on the stack
>> are not written correctly. Due to this the program causes some exception
>> or the other.
>>
>> In order to isolate the problem between icache and dcache, I want to try
>> and access IRAM using KSEG1 addresses (0xA0000000 onwards) and DRAM
>> using KSEG0 addresses (0x80000000) or vice versa. Is the possible? Can
>> it be done through some configuration changes or #defines? This way I
>> can find out whether instruction is the culprit for not writing the
>> value in memory or the data cache.
>>
>> I would very much appreciate any information in this regard.
>>
>> Best Regards,
>> Viswanath Bandi
>>
>>
>>
>> -------------------------------------------------------------------------
>> This SF.net email is sponsored by: Microsoft
>> Defy all challenges. Microsoft(R) Visual Studio 2005.
>> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>> _______________________________________________
>> U-Boot-Users mailing list
>> U-Boot-Users at lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/u-boot-users
>>
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.denx.de/pipermail/u-boot/attachments/20080109/bb6c292b/attachment.htm
next prev parent reply other threads:[~2008-01-09 8:03 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-05 10:55 [U-Boot-Users] Accessing IRAM & DRAM through different segments in MIPS Viswanath Bandi
2008-01-06 4:55 ` Shinya Kuribayashi
2008-01-08 2:30 ` Hoi-Ho Chan
2008-01-09 8:03 ` Viswanath Bandi [this message]
2008-01-09 9:45 ` Shinya Kuribayashi
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=47847FCB.2040603@txc.stpn.soft.net \
--to=bandiv@txc.stpn.soft.net \
--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