Re: spontaneous reboot only once after power-up
[email protected] (ITOH Yasufumi)
| Newsgroups | gmane.os.netbsd.ports.dreamcast,gmane.os.netbsd.ports.sh3 |
|---|---|
| Message-ID | <[email protected]> |
In article <[email protected]> [email protected] writes: > In article <[email protected]> > [email protected] wrote: > > > I happen to try following change and the problem disappear. > > Here, we are clearing the TLB. The original code clears TLB > > via address array, and new code does it via data array 1. > > I just take a look at SH4 programming manual, but > I guess if you use UTLB data array 1 to invalidate TLB entries > there are follow problems: > (1) it does not clear VPN I don't think it is a problem. The V (valid) and D (dirty) bits are cleared by either way, and the VPN shall not make sense if an entry is not valid (if the MMU works as described). > (2) it might break other bits (cacheable, writethrough etc.) If a new entry is loaded by LDTLB instruction all the fields will be overwritten, and I don't think it is a problem (if the MMU works as described :-). I tried some alternatives in sh4_tlb_invalidate_all(): (a) the code of my previous mail (works) for (e = 0; e < eend; e++) { a = SH4_UTLB_DA1 | (e << SH4_UTLB_E_SHIFT); _reg_write_4(a, 0); /* SZ = 0 */ } (b) page size 1MB (causes reset) for (e = 0; e < eend; e++) { a = SH4_UTLB_DA1 | (e << SH4_UTLB_E_SHIFT); _reg_write_4(a, 0x90); /* SZ = 3 */ } ...and I think at least the SZ (page size) field should be initialized. Possibly, an errata or something? Have anyone heard something like this? > BTW, there is an errata about TLB usage for SH3: > http://www.hitachisemiconductor.com/sic/resource/japan/eng/pdf/mpumcu/ms/tnsh7291ae.pdf > According to this doc, it's better to wrote 0xf0000000 to VPN on > invalidating TLB entries to avoid an exception on TLB > (which might cause another bug of SH3). Mmm, I tried (c) VA = 0xf0000000 (causes reset) for (e = 0; e < eend; e++) { a = SH4_UTLB_AA | (e << SH4_UTLB_E_SHIFT); _reg_write_4(a, 0xf0000000); } and no improvement. Thoughts? -- ITOH Yasufumi