MPC8240 PTE setup
Hi everyone,
I am new to embedded Linux but I have more than 10 years experience in embedded systems on many different processors and real-time O/Ses.
I have based my work on the Linux kernel 2.5.8 and the ZX4500 platform (plus my modification). My goal is to move from pSOS to Linux and for the moment I am using the pSOS bootloader (PPCBOOT on its way) to load the linux kernel.
I have a problem with the MMU (MPC8240+CPLD+serial port+DiskOnChip on PortX). The boot process is looping in openpic_safe_writefield() and I can see with my BDI2000 that the MMU is not translating correctly virtual addresses to physical addresses. I made a patch to use a BAT instead of PTE but this cause only to move the problem further upstream (unable to run /busybox correctly).
I have check the parameter passed with ioremap() and it's ok. With the BDI2000, I get this with the phys command:
phys 0xfdfd0000 (virtual address returned by ioremap) PHYS = 0xfffff000 END = 0xffffffff instead of PHYS 0xfdf40000 END = 0xfdffffff
Here is a screenshot (this is a pSOS boot sequence):
Standard output device initialized...
System clock initialized...
SYSTEM START @ 09:52:18 22/04/2002 (usec tick) DiskOnChip has a capacity of 32 MB Initializing User Accounts, this may take a while... Initializing FTP Server Daemon... 15.0/mxz/index : 200b - prepc error value
No startup table - cannot initialize revision control. Cannot open system files -- trying TFTP instead. Remote file: zImage.img, IP: 10.64.21.18
TFTP download completed.
Transfering control to the downloaded code.
(here it is)
loaded at: 00100000 001B0BCC relocated to: 00800000 008B0BCC zimage at: 00805980 0088DBE4 initrd at: 0088E000 008A69BF avail ram: 00400000 00800000
Linux/PPC load: console=ttyS0,19200 root=/dev/ram0 init=/busybox lash Uncompressing Linux...done.
Now booting the kernel
Robert Morin
Firmware engineer
Miranda Media Network
St-Laurent, Qc
Canada
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
Quoted 1 line · Robert Morin
I have based my work on the Linux kernel 2.5.8 ....
You don't want to use that yet :-) Use the 2_4_devel kernel.
Quoted 3 lines
....I can see with my BDI2000 that the
MMU is not translating correctly virtual addresses to physical addresses.
The mmu always translates correctly, your programming of it is probably incorrect :-)
Quoted 2 lines
.... I made a patch to use a BAT instead of PTE but this cause only to move the problem further upstream
What BAT did you change, and to what?
Quoted 8 lines
I have check the parameter passed with
ioremap()and it's ok. With the BDI2000, I get this with the phys command:phys 0xfdfd0000 (virtual address returned by ioremap) PHYS = 0xfffff000 END = 0xffffffff instead of PHYS 0xfdf40000 END = 0xfdffffff
So, you did 'virt = ioremap(0xfdf40000)' and virt == 0xfdfd0000? Where did you call ioremap()? Are you trying to remap the EUMB registers again (this is done in mpc10x_common.c for 82xx boards)?
-- Dan
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
Hi Dan,
Quoted 4 lines
Quoted 1 line
I have based my work on the Linux kernel 2.5.8 ....
You don't want to use that yet :-) Use the 2_4_devel kernel.
Ok, I will look to it.
Quoted 7 lines
Quoted 3 lines
....I can see with my BDI2000 that the
MMU is not translating correctly virtual addresses to physical addresses.The mmu always translates correctly, your programming of it is probably incorrect :-)
This is my problem and I think it's related to the pSOS bootloader but I have difficulties pointing to the problem.
Quoted 5 lines
Quoted 2 lines
.... I made a patch to use a BAT instead of PTE but this cause only to move the problem further upstream
What BAT did you change, and to what?
In my file mxhost2_setup.c in function mxhost2_map_io(), I've added:
io_block_mapping(0xfdf00000, 0xfdf00000, 0x00100000, _PAGE_IO );
as a work-around and modify also my find_bridge() to prevent using the ioremap_base.
Quoted 5 lines
Quoted 5 lines
I have check the parameter passed with
ioremap()and it's ok. With the BDI2000, I get this with the phys command:phys 0xfdfd0000 (virtual address returned by ioremap)
Quoted 8 lines
Quoted 3 lines
PHYS = 0xfffff000 END = 0xffffffff instead of PHYS 0xfdf40000 END = 0xfdffffffSo, you did 'virt = ioremap(0xfdf40000)' and virt ==
0xfdfd0000? Where did you callioremap()? Are you trying to remap the EUMB registers again (this is done inmpc10x_common.cfor 82xx boards)?
I made my trace inside the mpc10x_common.c to have this result. I am not making changes in the kernel, I want to keep as is as much as possible.
For the moment, I will move my platform into 2_4_devel to see if the situation improved.
Quoted 2 lines
-- Dan
Thanks.
Robert
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
Quoted 8 lines · Robert Morin
Hi Dan,
Quoted 3 lines
Quoted 1 line
I have based my work on the Linux kernel 2.5.8 ....
You don't want to use that yet :-) Use the 2_4_devel kernel.
Ok, I will look to it.
Also, the zx4500 port (and the sandpoint one which it is based upon) relied on an old hack to get the EPIC going which was to overload OpenPIC_NumInitSenses like so:
static void __initzx4500_init_IRQ(void)
{
OpenPIC_InitSenses = zx4500_openpic_initsenses;
OpenPIC_NumInitSenses = sizeof(zx4500_openpic_initsenses);
openpic_init(1, 0, NULL, -1);These need to be replaced with calls to openpic_set_sources(int first, int total, void *first_ISU);
I'm in the middle of making this switch for the LoPEC boards as an example for how the rest need to look, but if you get yours working please post what you did. (what I've tried, and what Matt Porter and I _think_ is right isn't working, and I'm looking into that now).
--
Tom Rini (TR1265)
http://gate.crashing.org/~trini/
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/