* flying blind with BATs
@ 2000-10-02 14:32 Tim Montgomery
2000-10-02 15:09 ` Adrian Cox
0 siblings, 1 reply; 2+ messages in thread
From: Tim Montgomery @ 2000-10-02 14:32 UTC (permalink / raw)
To: Linux PPC Developer
hello,
I am trying to get the ppc kernel loaded on a 750-based embedded board,
and I've got an ultra-basic bootloader (the board is not PReP or
CHRP-compliant), but I believe I am having trouble with the BAT
mappings.
I have the BATs configure (by the bootloader) such that 0xc0000000
(virtual) is mapped to 0x00000000 (phys SDRAM base), but after
the image is decompressed (to the virtual addr), I get garbage when
I do a dump at 0xc0000000 (i.e. the kernel isn't there.)
I am executing the bootloader itself out of a region well above
(4MB) the kernel space.
Before I spend too much time reinventing the wheel (and beating my
head against the wall), I was curious if there was a 7xx-based
bootloader out there that I could modify to fit my needs.
Any other pointers/tips regarding machine state required on a 750
prior to jumping to the kernel would also be appreciated.
Regards,
Tim
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: flying blind with BATs
2000-10-02 14:32 flying blind with BATs Tim Montgomery
@ 2000-10-02 15:09 ` Adrian Cox
0 siblings, 0 replies; 2+ messages in thread
From: Adrian Cox @ 2000-10-02 15:09 UTC (permalink / raw)
To: Tim Montgomery; +Cc: Linux PPC Developer
Tim Montgomery wrote:
> I have the BATs configure (by the bootloader) such that 0xc0000000
> (virtual) is mapped to 0x00000000 (phys SDRAM base), but after
> the image is decompressed (to the virtual addr), I get garbage when
> I do a dump at 0xc0000000 (i.e. the kernel isn't there.)
My trick is just to load the ELF file to physical address 0. The elf
file format is easy enough to decode (mine is about 60 lines of C, and
I'll post it if there's interest). Then, I load r3 with a value to
indicate machine type ('TPE3' or 'TPE4'), and jump to the start of the
kernel turning off the cache and MMU.
Important things to note are:
1) Flush the caches over the region you've just loaded before fiddling
with MMU and cache settings.
Here's the section of my bootloader - r3 is the kernel entry point
(physical address) and r4 is 'TPE3':
ppc_run_executable:
mtspr SRR0, r3
mr 3, 4
mfspr 9, HID0
li 10, HID0_DCE
andc 9, 9, 10
mtspr HID0, 9
sync
mfmsr 9
li 10, MSR_DR | MSR_IR
andc 9, 9, 10
mtspr SRR1, 9
sync
rfi
- Adrian Cox, AG Electronics
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2000-10-02 15:09 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-10-02 14:32 flying blind with BATs Tim Montgomery
2000-10-02 15:09 ` Adrian Cox
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).