ZMII Code Panics on 440GP Ebony

2 messages, 2 authors, 2002-05-24 · open the first message on its own page

ZMII Code Panics on 440GP Ebony

From: Venkatesh Rao <hidden>
Date: 2002-05-24 15:58:15

Hi,
I am using a Rev B board and when i compiled the
latest kernel (pulled yesterday after Matt's
Checkin)and booted my ebony board, i got a panic in
ZMII. I am including a portion of the bootup log.

I looked at the ibm_ocp_zmii code and found that it
panicked init_zmii() in the following code snippet. I
think it panicked while accessing the ioremapped
zmiip->fer.

Thanks
Venkatesh

Location Where it panicked
--------------------------
	if (mode == ZMII_AUTO) {
		if (zmiip->fer & (ZMII_MII0 | ZMII_MII1))
			fep->zmii_mode = MII;
		if (zmiip->fer & (ZMII_RMII0 | ZMII_RMII1))
			fep->zmii_mode = RMII;
		if (zmiip->fer & (ZMII_SMII0 | ZMII_SMII1))
			fep->zmii_mode = SMII;
	}


BootUP Log Snippet
------------------
NET4: Linux TCP/IP 1.0 for NET4.0
IP Protocols: ICMP, UDP, TCP
IP: routing cache hash table of 1024 buckets, 8Kbytes
TCP: Hash tables configured (established 8192 bind
8192)
init_zmii: curr_zmii = 0
init_zmii: allocating dev
dev is c7ef5400
init_zmii: ocp_register
init_zmii, got dev c7ef5400
init_zmii: regs at d002b780, fep = c7fab960
Data machine check in kernel mode.
Oops: machine check, sig: 7
NIP: C0091C84 XER: 00000000 LR: C0091C6C SP: C0327ED0
REGS: c0327e10 TRAP: 0200    Not tainted
MSR: 00009030 EE: 1 PR: 0 FP: 0 ME: 1 IR/DR: 11
TASK = c0326000[1] 'swapper' Last syscall: 120
last math 00000000 last altivec 00000000
GPR00: 00000000 C0327ED0 C0326000 0000002C 00001030
00000001 00000030 C0160000
GPR08: 00000842 00000000 00000000 C0327DF0 0000053F
00000000 00000000 FFF9E120
GPR16: 00000004 FFF837A9 00000024 00000000 47868C00
00010080 BFA62401 00000000
GPR24: 00000000 C0160000 D0006800 C0327ED8 00000004
D002B780 C7FAB800 C7FAB960
Call backtrace:
C0091C6C C008F624 C00A95B8 C00AACBC C013763C C0137DB0
C012A5DC
C012A628 C0001174 C0005BD0
Kernel panic: Attempted to kill init!
 <0>Rebooting in 180 seconds..


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

Re: ZMII Code Panics on 440GP Ebony

From: Roland Dreier <hidden>
Date: 2002-05-24 16:40:53

quoted
quoted
quoted
quoted
"Venkatesh" == Venkatesh Rao [off-list ref] writes:
    Venkatesh> Hi, I am using a Rev B board and when i compiled the
    Venkatesh> latest kernel (pulled yesterday after Matt's
    Venkatesh> Checkin)and booted my ebony board, i got a panic in
    Venkatesh> ZMII. I am including a portion of the bootup log.

Yes, the linux_2_4_devel tree I pulled yesterday was not in a
consistent state for my 440GP Ebony board.  The problem is that the
Ebony setup code has not been updated for the new OCP handling code
yet.  To fix it, you need to edit arch/ppc/platforms/ebony.c and
delete the lines:

	/* FIXME: Remove after OCP code is updated */
	ebony_ocp_fixup_addrs(EMAC_ADDR[0], EMAC_ADDR[1], ZMII_ADDR[0]);

Then edit arch/ppc/platforms/ibm440gp.c -- change the initialization
of core_ocp[] so the EMAC and ZMII lines read:

	{EMAC, EBONY_EMAC0_ADDR, OCP_IRQ_NA},
	{EMAC, EBONY_EMAC1_ADDR, OCP_IRQ_NA},
	{ZMII, EBONY_ZMII_ADDR, OCP_IRQ_NA},

I'm including a patch at the end of this email.  Perhaps someone who
can check in to the tree and who can confirm that I've understood how
this is intended to work can get this into the linux_2_4_devel tree.

In addition, it seems to me that the EBONY_{ZMII,EMAC0,EMAC1}_{ADDR
constants should be renamed to PPC440GP_xxx constants since they are
not Ebony specific but rather apply to all IBM 440GP designs.  As
further cleanup, one can probably remove the EMAC_ADDR and ZMII_ADDR
variables.

I would be happy to help with this cleanup; however, I don't want to
step on anyone's work in progress.  However, if anyone would like
patches to do some of this cleanup I could put some together fairly
quickly.

Best,
Roland

diff -aur ebony.old/arch/ppc/platforms/ebony.c ebony/arch/ppc/platforms/ebony.c
--- ebony.old/arch/ppc/platforms/ebony.c	Fri May 24 09:23:40 2002
+++ ebony/arch/ppc/platforms/ebony.c	Fri May 24 09:13:29 2002
@@ -215,30 +215,6 @@
 TODC_ALLOC();
 #endif /* CONFIG_PPC_RTC */

-/*
- * FIXME: Remove after the OCP drivers start using
- * ioremap_native(get_ocp_paddr(...), ...)
- */
-void
-ebony_ocp_fixup_addrs(struct emac_regs *emac0_addr, struct emac_regs *emac1_addr,
-		struct zmii_regs *zmii_addr)
-{
-	int i;
-	int emac_count = 0;
-
-	for (i = 0; core_ocp[i].type != OCP_NULL_TYPE; i++) {
-		if (core_ocp[i].type == EMAC) {
-			core_ocp[i].paddr = emac_count++ ?
-				emac1_addr : emac0_addr;
-		}
-		else if (core_ocp[i].type == ZMII) {
-			core_ocp[i].paddr = zmii_addr;
-		}
-	}
-
-	return;
-}
-
 static void __init
 ebony_setup_arch(void)
 {
@@ -269,9 +245,6 @@
 	/* Setup ZMII access */
 	ZMII_ADDR[0] = (struct zmii_regs *)
 		ioremap64(EBONY_ZMII_ADDR, EBONY_ZMII_SIZE);
-
-	/* FIXME: Remove after OCP code is updated */
-	ebony_ocp_fixup_addrs(EMAC_ADDR[0], EMAC_ADDR[1], ZMII_ADDR[0]);

 	/* init to some ~sane value until calibrate_delay() runs */
         loops_per_jiffy = 50000000/HZ;
diff -aur ebony.old/arch/ppc/platforms/ibm440gp.c ebony/arch/ppc/platforms/ibm440gp.c
--- ebony.old/arch/ppc/platforms/ibm440gp.c	Fri May 24 09:23:05 2002
+++ ebony/arch/ppc/platforms/ibm440gp.c	Thu May 23 14:44:35 2002
@@ -68,9 +68,9 @@
 	{PCI, PCI0_BASE, OCP_IRQ_NA},
 	{OPB, OPB0_BASE, OCP_IRQ_NA},
 #endif
-	{EMAC, 0, OCP_IRQ_NA},
-	{EMAC, 0, OCP_IRQ_NA},
-	{ZMII, 0, OCP_IRQ_NA},
+	{EMAC, EBONY_EMAC0_ADDR, OCP_IRQ_NA},
+	{EMAC, EBONY_EMAC1_ADDR, OCP_IRQ_NA},
+	{ZMII, EBONY_ZMII_ADDR, OCP_IRQ_NA},
 	{OCP_NULL_TYPE, 0x0, OCP_IRQ_NA},

 };
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help