Skip to contentSkip to conversation

ZMII Code Panics on 440GP Ebony

DISCUSSION Venkatesh Rao 3 participants 9 messages May 24, 2002 – Jun 4, 2002

lore
Share & tools
lore
#0 lore raw

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/

#1 lore raw
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

"Venkatesh" == Venkatesh Rao <[email protected]> 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

arch/ppc/platforms/ebony.c +0 -27
diff -aur ebony.old/arch/ppc/platforms/ebony.c ebony/arch/ppc/platforms/ebony.c
@@ -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;
arch/ppc/platforms/ibm440gp.c +3 -3
diff -aur ebony.old/arch/ppc/platforms/ibm440gp.c ebony/arch/ppc/platforms/ibm440gp.c
@@ -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/

#3 lore raw
In reply to Matt Porter
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

"Matt" == Matt Porter <[email protected]> writes:

Matt> I started some things but have been busy with functionality Matt> for some time now. I'd be interested in any cleanup patches Matt> you would produce. The idea is to separate ibm440.h, Matt> ibm440gp.h, and <board>.h as appropriate. As you've Matt> noticed, I took some shortcuts in the interest of getting Matt> the core code in front of everybody quickly. :)

OK, I will send you some trivial stuff soon. I do have one question:
what belongs in ibm440.h (as opposed to ibm440gp.h)? The only documentation I have is specifically for the 440GP (other than a presentation on the 440GX) -- how do we know what is common to the 440 family?

Best,
Roland

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

#2 lore raw
In reply to Roland Dreier
Quoted 8 lines · Roland Dreier
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

"Venkatesh" == Venkatesh Rao <[email protected]> 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.

Quoted 5 lines

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:

Yes, I'm lagging a little behind all the OCP updates that are occurring. I pushed the included patch.

Quoted 10 lines

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.

I started some things but have been busy with functionality for some time now. I'd be interested in any cleanup patches you would produce. The idea is to separate ibm440.h, ibm440gp.h, and <board>.h as appropriate. As you've noticed, I took some shortcuts in the interest of getting the core code in front of everybody quickly. :)

Thanks,
--
Matt Porter
[email protected]
This is Linux Country. On a quiet night, you can hear Windows reboot.

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

#4 lore raw
In reply to Roland Dreier
Quoted 9 lines · Roland Dreier
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Matt" == Matt Porter <[email protected]> writes:

Matt> I started some things but have been busy with functionality Matt> for some time now. I'd be interested in any cleanup patches Matt> you would produce. The idea is to separate ibm440.h, Matt> ibm440gp.h, and <board>.h as appropriate. As you've Matt> noticed, I took some shortcuts in the interest of getting Matt> the core code in front of everybody quickly. :)

Quoted 5 lines

OK, I will send you some trivial stuff soon. I do have one question:
what belongs in ibm440.h (as opposed to ibm440gp.h)? The only documentation I have is specifically for the 440GP (other than a presentation on the 440GX) -- how do we know what is common to the 440 family?

Well, as a starting point, most of what is in ibm440.h should be in ibm440gp.h. The board stuff will go to ebony.h, the dcr macros to ibm440.h, and all the on-chip defs (UIC, MEM controller, MAL, PLB, PCI-X, and peripheral nums) go to ibm440gp.h. You can look at the 440 core UM to see what is part of the core. Considering the nature of a Book E part, the core defines the existence of DCRs, but they will vary between implementations. Looking at the 405 implementations should give a clue as to what kind of 440 implementations we can expect to see.

For now, we can ignore the 440GX except keeping in mind that it is a different set of peripherals. It's safe to assume that things like the UIC and memory controller will have similar if not identical definitions in ibm440gx.h but there's no point worrying too much until the docs are available. :) To start off we'll probably copy ibm440gp.h, make additions and then try to abstract into a shared file later...that's some time down the road yet though.

Regards,
--
Matt Porter
[email protected]
This is Linux Country. On a quiet night, you can hear Windows reboot.

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

#5 lore raw

Ebony crash fix & 440GP cleanup step one

This email includes two patches. First, a very small change to ocp.h. Somewhere in the recent cleanup, paddr got changed from a phys_addr_t to a void *; this doesn't work on 440GP because we have 36-bit physical addresses. (You get a machine check when the kernel tries to access the ZMII)

Second, the beginning of moving generic IBM 440GP stuff out of ebony.c/ebony.h and into platforms/ibm440gp.h. I tested this on my Ebony and it boots and runs fine. I didn't go too far because I want to make sure everyone feels what I'm doing is the right way to go. Please let me know what you think.

Best,
Roland

# This is a BitKeeper generated patch for the following project:
# Project Name: Linux 2.4 for PowerPC development tree
# This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas:
# ChangeSet 1.1039 -> 1.1040
# include/asm-ppc/ocp.h 1.16 -> 1.17
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 02/05/28 [email protected] 1.1040
# Fix paddr in ocp.h
# --------------------------------------------
#

include/asm-ppc/ocp.h +1 -1
diff -Nru a/include/asm-ppc/ocp.h b/include/asm-ppc/ocp.h
@@ -117,7 +117,7 @@
 	char name[16];
 	u16 num;
 	enum ocp_type type;	/* OCP devive type */
-	void *paddr;
+        phys_addr_t paddr;
 	void *vaddr;
 	u32 flags;
 	struct irq_resources irq_resource[MAX_EMACS][OCP_MAX_IRQS];

# This is a BitKeeper generated patch for the following project:
# Project Name: Linux 2.4 for PowerPC development tree
# This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas:
# ChangeSet 1.1025 -> 1.1025.1.1
# include/asm-ppc/ibm4xx.h 1.15 -> 1.16
# include/asm-ppc/ibm440.h 1.8 -> 1.9
# arch/ppc/platforms/ebony.h 1.8 -> 1.9
# arch/ppc/platforms/ibm440gp.c 1.11 -> 1.12
# arch/ppc/platforms/ebony.c 1.9 -> 1.10
# (new) -> 1.2 arch/ppc/platforms/ibm440gp.h
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 02/05/27 [email protected] 1.1026
# Change OCP ENET driver to use the proper PCI_DMA_* direction constants

# as arguments to consistent_sync(), instead of defining its own.  TODO:
# change consistent_sync() and/or other code to remove the need for the
# PCI constants.
# --------------------------------------------
# 02/05/27	[email protected]	1.1027
# Minor 4xx serial fixups from Scott Anderson <[email protected]>.
# --------------------------------------------
# 02/05/27	[email protected]	1.1028
# We don't really want to be using PCI_DMA_* directional constants for consistent_sync() since it is not necessarily PCI.
# Cset exclude: [email protected]|ChangeSet|20020527053847|07881
# --------------------------------------------
# 02/05/27	[email protected]	1.1029
# Convert IBM OCP IDE to use the DMA_* directional constants.
# --------------------------------------------
# 02/05/27	[email protected]	1.1030
# Odd.  bk didn't fix this in the cset -x.  Bring back include/asm-ppc/ocp-dma.h
# --------------------------------------------
# 02/05/27	[email protected]	1.1031
# Well, that's what I get for not reading my email before working.. Backout my last changes.
# Cset exclude: [email protected]|ChangeSet|20020527160528|10008
# Cset exclude: [email protected]|ChangeSet|20020527160119|11671
# Cset exclude: [email protected]|ChangeSet|20020527155917|11666
# --------------------------------------------
# 02/05/27	[email protected]	1.1032
# ...and bk didn't catch the re-deletion again either.  Larry, are you
# snooping this? :)
# --------------------------------------------
# 02/05/27	[email protected]	1.118.1.516
# Critical fix from Paul (from linux-kernel):
# The patch below fixes two bugs in the PPC code.  The first bug was
# caused by an exception table entry pointing to the wrong instruction.
# As a result of this bug, a copy_to_user() with an unmapped or
# inaccessible destination address could cause an oops.  The second bug
# was that clear_user on PPC was returning -EFAULT rather than the
# number of bytes not cleared.
#
# Thanks to Rusty Russell for demonstrating the existence of these bugs
# with his test-read.c program.
# --------------------------------------------
# 02/05/27	[email protected]	1.1033
# Merge in recent linuxppc_2_4 changes.
# --------------------------------------------
# 02/05/27	[email protected]	1.1034
# Actually remove the right file.  It'd be nice if cset -x did this right
# to start with...
# --------------------------------------------
# 02/05/28	[email protected]	1.1035
# Add support for the Davicom DM9131 PHY to the 8260 FCC driver.  From
# Murray Jensen <[email protected]>
# --------------------------------------------
# 02/05/28	[email protected]	1.1036
# Better describe (and modify slightly) how we come up with 3 ethernet
# addresses from 1 in the 8260 FCC enet driver.  From
# Murray Jensen <[email protected]>
# --------------------------------------------
# 02/05/28	[email protected]	1.1037
# Lots of OCP updates from Armin:
# Rename functions to <class>_<action>_<object>.
# Change ocp_driver to ocp_dev.
# Added type_info struct for the name/desc.
# --------------------------------------------
# 02/05/28	[email protected]	1.1038
# Add in OCP documentation, from Armin.
# --------------------------------------------
# 02/05/28	[email protected]	1.1025.1.1
# Begin reorganization of IBM 440GP code out of Ebony-specific files.
# --------------------------------------------
#
diff -Nru a/arch/ppc/platforms/ebony.c b/arch/ppc/platforms/ebony.c
--- a/arch/ppc/platforms/ebony.c	Tue May 28 14:57:14 2002
+++ b/arch/ppc/platforms/ebony.c	Tue May 28 14:57:14 2002
@@ -44,15 +44,8 @@
 #endif /* CONFIG_PPC_RTC */
 #include <asm/bootinfo.h>
 #include <asm/ppc4xx_pic.h>
-#include <asm/ocp.h>
-
-#include <platforms/ibm_ocp.h>
-#include <platforms/ebony.h>

extern void abort(void);
-extern struct emac_regs *EMAC_ADDR[];
-extern struct zmii_regs *ZMII_ADDR[];
-extern struct ocp_def core_ocp[];

/* Global Variables */
unsigned char __res[sizeof (bd_t)];
@@ -208,8 +201,6 @@
ppc_md.pci_map_irq = ebony_map_irq;
}

-extern char cmd_line[];
-
#ifdef CONFIG_PPC_RTC
TODC_ALLOC();
#endif /* CONFIG_PPC_RTC */
@@ -234,16 +225,6 @@
ioremap64(EBONY_RTC_ADDR, EBONY_RTC_SIZE), 8);
#endif /* CONFIG_PPC_RTC */
-
- /* Setup EMAC access */
- EMAC_ADDR[0] = (struct emac_regs *)
- ioremap64(EBONY_EMAC0_ADDR, EBONY_EMAC_SIZE);
- EMAC_ADDR[1] = (struct emac_regs *)
- ioremap64(EBONY_EMAC1_ADDR, EBONY_EMAC_SIZE);
-
- /* Setup ZMII access */
- ZMII_ADDR[0] = (struct zmii_regs *)
- ioremap64(EBONY_ZMII_ADDR, EBONY_ZMII_SIZE);

/* init to some ~sane value until calibrate_delay() runs */

         loops_per_jiffy = 50000000/HZ;
arch/ppc/platforms/ebony.h +1 -18
diff -Nru a/arch/ppc/platforms/ebony.h b/arch/ppc/platforms/ebony.h
@@ -21,7 +21,7 @@
 #define __ASM_EBONY_H__
 
 #include <linux/config.h>
-#include <asm/ibm440.h>
+#include <platforms/ibm440gp.h>
 
 /* F/W TLB mapping used in bootloader glue to reset EMAC */
 #define EBONY_EMAC0_MR0		0xE0000800
@@ -37,23 +37,6 @@
 /* Default clock rates for Rev. B and Rev. C silicon */
 #define EBONY_440GP_RB_SYSCLK	33000000
 #define EBONY_440GP_RC_SYSCLK	400000000
-
-/* EMAC location */
-#define EBONY_EMAC0_ADDR	0x0000000140000800
-#define EBONY_EMAC1_ADDR	0x0000000140000900
-#define EBONY_EMAC_SIZE		0x70
-
-/* ZMII location */
-#define EBONY_ZMII_ADDR		0x0000000140000780
-#define EBONY_ZMII_SIZE		0x0c
-
-/* I2C location */
-#define EBONY_IIC0_ADDR		0x40000400
-#define EBONY_IIC1_ADDR		0x40000500
-
-/* RTC/NVRAM location */
-#define EBONY_RTC_ADDR		0x0000000148000000
-#define EBONY_RTC_SIZE		0x2000
 
 /*
  * Serial port defines
arch/ppc/platforms/ibm440gp.c +7 -9
diff -Nru a/arch/ppc/platforms/ibm440gp.c b/arch/ppc/platforms/ibm440gp.c
@@ -61,23 +61,21 @@
 struct ocp_def core_ocp[] = {
 	{UART, UART0_IO_BASE, UART0_INT},
 	{UART, UART1_IO_BASE, UART1_INT},
-	{IIC, EBONY_IIC0_ADDR, IIC0_IRQ},
-	{IIC, EBONY_IIC1_ADDR, IIC1_IRQ},
+	{IIC, PPC440GP_IIC0_ADDR, IIC0_IRQ},
+	{IIC, PPC440GP_IIC1_ADDR, IIC1_IRQ},
 #if 0 /* FIXME: Undefined */
 	{GPIO, GPIO0_BASE, OCP_IRQ_NA},
 	{PCI, PCI0_BASE, OCP_IRQ_NA},
 	{OPB, OPB0_BASE, OCP_IRQ_NA},
 #endif
-	{EMAC, EBONY_EMAC0_ADDR, OCP_IRQ_NA},
-	{EMAC, EBONY_EMAC1_ADDR, OCP_IRQ_NA},
-	{ZMII, EBONY_ZMII_ADDR, OCP_IRQ_NA},
+	{EMAC, PPC440GP_EMAC0_ADDR, OCP_IRQ_NA},
+	{EMAC, PPC440GP_EMAC1_ADDR, OCP_IRQ_NA},
+	{ZMII, PPC440GP_ZMII_ADDR, OCP_IRQ_NA},
 	{OCP_NULL_TYPE, 0x0, OCP_IRQ_NA},
 
 };
 
-struct emac_regs *EMAC_ADDR[EMAC_NUMS];
-struct zmii_regs *ZMII_ADDR[ZMII_NUMS];
 struct iic_regs *IIC_ADDR[] = {
-	(struct iic_regs *) EBONY_IIC0_ADDR,
-	(struct iic_regs *) EBONY_IIC1_ADDR
+	(struct iic_regs *) PPC440GP_IIC0_ADDR,
+	(struct iic_regs *) PPC440GP_IIC1_ADDR
 };
arch/ppc/platforms/ibm440gp.h new file +58 -0

58 lines not on this page · raw message

include/asm-ppc/ibm440.h +2 -27
diff -Nru a/include/asm-ppc/ibm440.h b/include/asm-ppc/ibm440.h
@@ -77,26 +77,6 @@
  * into the kernel.
  */
 #ifndef __ASSEMBLY__
-extern unsigned char __res[];
-
-/* Device Control Registers */
-
-#define stringify(s)	tostring(s)
-#define tostring(s)	#s
-
-#define mfdcr(rn) mfdcr_or_dflt(rn, 0)
-
-#define mfdcr_or_dflt(rn,default_rval) \
-	({unsigned int rval;						\
-	if (rn == 0)							\
-		rval = default_rval;					\
-	else								\
-		asm volatile("mfdcr %0," stringify(rn) : "=r" (rval));	\
-	rval;})
-
-#define mtdcr(rn, v)  \
-	{if (rn != 0) \
-		asm volatile("mtdcr " stringify(rn) ",%0" : : "r" (v));}
 
 /*
  * DCRN definitions
@@ -318,13 +298,6 @@
 #define PCIX0_MSGOH		0x10c
 #define PCIX0_IM		0x1f8
 
-#define EMAC_NUMS		2
-#define UART_NUMS		2
-#define ZMII_NUMS		1
-#define IIC_NUMS		2
-#define IIC0_IRQ		2
-#define IIC1_IRQ		3
-
 #define IIC_OWN			0x55
 #define IIC_CLOCK		50
 
@@ -333,6 +306,8 @@
 #define UIC_CASCADE_MASK	0x0003		/* bits 30 & 31 */
 
 #define BD_EMAC_ADDR(e,i) bi_enetaddr[e][i]
+
+#include <asm/ibm4xx.h>
 
 #endif /* __ASSEMBLY__ */
 #endif /* __ASM_IBM440_H__ */
include/asm-ppc/ibm4xx.h +28 -24

66 lines not on this page · raw message

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

#6 lore raw

Re: Ebony crash fix & 440GP cleanup step one

Quoted 11 lines · Roland Dreier

This email includes two patches. First, a very small change to ocp.h. Somewhere in the recent cleanup, paddr got changed from a phys_addr_t to a void *; this doesn't work on 440GP because we have 36-bit physical addresses. (You get a machine check when the kernel tries to access the ZMII)

Second, the beginning of moving generic IBM 440GP stuff out of ebony.c/ebony.h and into platforms/ibm440gp.h. I tested this on my Ebony and it boots and runs fine. I didn't go too far because I want to make sure everyone feels what I'm doing is the right way to go. Please let me know what you think.

Looks great, pushed. There's still more work to do in the includes but it's a good start. I'm moving the PCIX initialization to a common library, so don't overlap there if you wander out of moving headers around.

Regards,
--
Matt Porter
[email protected]
This is Linux Country. On a quiet night, you can hear Windows reboot.

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

#7 lore raw

Re: Ebony crash fix & 440GP cleanup step one

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

"Matt" == Matt Porter <[email protected]> writes:

Matt> Looks great, pushed. There's still more work to do in the Matt> includes but it's a good start. I'm moving the PCIX Matt> initialization to a common library, so don't overlap there Matt> if you wander out of moving headers around.

Cool. I'm starting to think about the best way to organize the code in ebony.c. It seems like maybe ebony.c should become ppc440_setup.c with the Ebony-specific stuff inside #ifdef CONFIG_EBONY (and if we do that, maybe ppc4xx_setup.c should be split into ppc40x_setup.c and really generic stuff in ppc4xx_setup.c). Another option would be to keep ebony.c but move most of the code into library functions in a new ppc440_setup.c file.

My motivation is that I'm going to have a few 440GP-based boards to deal with soon, and I'd like to minimize the amount of code that has to be copied or duplicated to support a new board. I'd like to do this in a way that fits in well with the kernel so it's easy for me to keep our kernel tree in sync with the main tree.

What are your thoughts?

Thanks,
Roland

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

#8 lore raw

A few more PPC440GP/Ebony cleanups

In reply to Matt Porter

Hi, here's another step towards getting generic 440GP stuff out of ebony.h/ebony.c.

At this point ebony.h looks OK to me. For ebony.c, it seems to me that at least ebony_calibrate_decr(), ebony_find_end_of_memory() and the PCI setup want to be generic.

Do you think it would be better to create an arch/ppc/kernel/ppc440_setup.c with library functions like ppc440_find_end_of_memory() that ebony.c uses, or just turn ebony.c into ppc440_setup.c and use #ifdefs for new 440GP boards?

Best,
Roland

# This is a BitKeeper generated patch for the following project:
# Project Name: Linux 2.4 for PowerPC development tree
# This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas:
# ChangeSet 1.1059 -> 1.1059.1.1
# BitKeeper/etc/logging_ok 1.61 -> 1.62
# arch/ppc/platforms/ebony.h 1.10 -> 1.11
# arch/ppc/platforms/ibm440gp.h 1.2 -> 1.3
# arch/ppc/platforms/ebony.c 1.10 -> 1.10.1.1
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 02/05/30 [email protected] 1.1060
# Fix 440GP type 1 config cycle generation. Systems with P2P

# bridges now work.
#
# The 440GP has a lazy host bridge that needs the cycle type
# bit in the CFGA set appropriately for the desired cycle type.
# We now key off a machdep flag to set the cycle type bit as
# needed in the indirect_pci method.
# --------------------------------------------
# 02/05/31	[email protected]	1.1039.1.1
# Delete the ppc64 *.original files, they aren't needed.
# --------------------------------------------
# 02/05/31	[email protected]	1.1061
# Merge bk://[email protected]/linuxppc_2_4_devel
# into quango.ozlabs.ibm.com:/home/paulus/kernel/linuxppc_2_4_devel
# --------------------------------------------
# 02/05/31	[email protected]	1.1062
# Merge bill-the-cat.bloom.county:/home/trini/work/kernel/pristine/linuxppc_2_4
# into bill-the-cat.bloom.county:/home/trini/work/kernel/pristine/linuxppc_2_4_devel
# --------------------------------------------
# 02/05/31	[email protected]	1.1063
# Not sure how the NPNet question got added twice, but..
# Also move it into its own menu for clarity.
# --------------------------------------------
# 02/05/31	[email protected]	1.1064
# Update the ash/ceder/walnut defconfigs to be a bit more reasonable.
# --------------------------------------------
# 02/06/01	[email protected]	1.1065
# I finally found why my tibook wouldn't wake up from sleep.  It was
# because a couple of routines used in the wakeup code were marked
# __init.  This changeset fixes that.
# --------------------------------------------
# 02/06/01	hozer@narn.(none)	1.1066
# Fix polarities on PReP machines with OpenPIC (i.e., my MTX)
# (This needs to be done for pplus_pci.c also, I believe)
# --------------------------------------------
# 02/06/03	[email protected]	1.1067
# Correct comment.
# --------------------------------------------
# 02/06/03	[email protected]	1.118.1.522
# Fix briq initial IO base (should help xmon)
# --------------------------------------------
# 02/06/03	[email protected]	1.118.1.523
# Add IBM 750FX CPU to cputable
# --------------------------------------------
# 02/06/03	[email protected]	1.118.1.524
# Fix nvram on B&W G3 and Yikes G4, Add new iBook to machine list
# Fix warning in i2c-keywest
# --------------------------------------------
# 02/06/03	[email protected]	1.1064.1.1
# Enable the 4xx debug code paths on 440 as well.
# Fix DBCR0 save and add Debug exception handling.
# This fixes a bug that was being avoided by having
# the BDI switch on.
# --------------------------------------------
# 02/06/03	[email protected]	1.1068
# Merge bk://[email protected]/linuxppc_2_4_devel
# into beef.az.mvista.com:/home/mporter/src/booke
# --------------------------------------------
# 02/06/03	[email protected]	1.118.1.525
# According to the errata list, the TAU unit on the 7455 reports temperatures
# that are 35 to 55 degrees lower than actual.  It also states that the TAU
# is not supported as a feature and is not included in any 7455 documentation.
# Remove from the feature list.
# --------------------------------------------
# 02/06/03	[email protected]	1.1069
# Book E cleanups from Kumar Gala <[email protected]>.
#
# Added a CONFIG_BOOKE option so in the future as more BOOKE processores/cores
# come out generic code is not duplicated.  Currently the only BOOKE part that
# exists is the 440.
#
# Renamed CONFIG_440 to CONFIG_BOOKE in cases where we really are ifdefing
# around BOOKE architecture details, not 440 implementation details.
#
# In the future, we'll use -mbooke if we are CONFIG_BOOKE as well, but
# it's necessary to be at binutils 2.11.90.0.10+ for that and most
# folks are using 2.10-based 4xx binutils at the moment that enable
# all the necessary Book E instructions.
# --------------------------------------------
# 02/06/03	[email protected]	1.118.1.526
# According to the 7450 errata sheet (#25) the TAU is not a supported
# feature of any of the 7450s and has been removed from all documentation
# except for the errata sheet, so remove it from the feature list.
# --------------------------------------------
# 02/06/03	[email protected]	1.1070
# Merge recent linuxppc_2_4 changes.
# --------------------------------------------
# 02/06/03	[email protected]	1.1071
# First round of Motorola Sandpoint fixes.  Tested on an X3B.
# --------------------------------------------
# 02/06/03	[email protected]	1.1059.1.1
# Move generic PPC440GP serial defines from ebony.h to ibm440gp.h
# --------------------------------------------
#
diff -Nru a/BitKeeper/etc/logging_ok b/BitKeeper/etc/logging_ok
--- a/BitKeeper/etc/logging_ok	Mon Jun  3 17:08:54 2002
+++ b/BitKeeper/etc/logging_ok	Mon Jun  3 17:08:54 2002
@@ -50,3 +50,4 @@
 [email protected]
 [email protected]
 [email protected]
[email protected]
diff -Nru a/arch/ppc/platforms/ebony.c b/arch/ppc/platforms/ebony.c
--- a/arch/ppc/platforms/ebony.c	Mon Jun  3 17:08:54 2002
+++ b/arch/ppc/platforms/ebony.c	Mon Jun  3 17:08:54 2002
@@ -255,7 +255,7 @@
 	serial_req.irq = 0;
 	serial_req.flags = ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST;
 	serial_req.io_type = SERIAL_IO_MEM;
-	serial_req.iomem_base = ioremap64(EBONY_UART_0, 8);
+	serial_req.iomem_base = ioremap64(PPC440GP_UART_0, 8);
 	serial_req.iomem_reg_shift = 0;

if (early_serial_setup(&serial_req) != 0) {
@@ -266,7 +266,7 @@
serial_req.line = 1; serial_req.port = 1;
serial_req.irq = 1;
- serial_req.iomem_base = ioremap64(EBONY_UART_1, 8);
+ serial_req.iomem_base = ioremap64(PPC440GP_UART_1, 8);

if (early_serial_setup(&serial_req) != 0) {
printk("Early serial init of port 1 failed\n");

arch/ppc/platforms/ebony.h +0 -22
diff -Nru a/arch/ppc/platforms/ebony.h b/arch/ppc/platforms/ebony.h
@@ -62,29 +62,7 @@
 /*
  * Serial port defines
  */
-#define RS_TABLE_SIZE	2
-
-/* OpenBIOS defined UART mappings, used before early_serial_setup */
-#define UART0_IO_BASE	(u8 *) 0xE0000200
-#define UART1_IO_BASE	(u8 *) 0xE0000300
-
-/* 440GP UART physical addresses, ioremapped for early_serial_setup */
-#define EBONY_UART_0	0x0000000140000200
-#define EBONY_UART_1	0x0000000140000300
-
 #define BASE_BAUD	33000000/3/16
-#define UART0_INT	0
-#define UART1_INT	1
-
-#define STD_UART_OP(num)					\
-	{ 0, BASE_BAUD, 0, UART##num##_INT,			\
-		(ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST),	\
-		iomem_base: UART##num##_IO_BASE,		\
-		io_type: SERIAL_IO_MEM},
-
-#define SERIAL_PORT_DFNS	\
-	STD_UART_OP(0)		\
-	STD_UART_OP(1)
 
 /* PCI support */
 #define EBONY_PCI_LOWER_IO	0x00000000
arch/ppc/platforms/ibm440gp.h +23 -2
diff -Nru a/arch/ppc/platforms/ibm440gp.h b/arch/ppc/platforms/ibm440gp.h
@@ -40,13 +40,34 @@
 #define PPC440GP_ZMII_SIZE	0x0c
 
 /* I2C location */
-#define PPC440GP_IIC0_ADDR	0x40000400
-#define PPC440GP_IIC1_ADDR	0x40000500
+#define PPC440GP_IIC0_ADDR	0x0000000140000400
+#define PPC440GP_IIC1_ADDR	0x0000000140000500
 
 /*
  * Serial port defines
  */
 #define RS_TABLE_SIZE	2
+
+/* OpenBIOS defined UART mappings, used before early_serial_setup */
+#define UART0_IO_BASE	(u8 *) 0xE0000200
+#define UART1_IO_BASE	(u8 *) 0xE0000300
+
+/* 440GP UART physical addresses, ioremapped for early_serial_setup */
+#define PPC440GP_UART_0	0x0000000140000200
+#define PPC440GP_UART_1	0x0000000140000300
+
+#define UART0_INT	0
+#define UART1_INT	1
+
+#define STD_UART_OP(num)					\
+	{ 0, BASE_BAUD, 0, UART##num##_INT,			\
+		(ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST),	\
+		iomem_base: UART##num##_IO_BASE,		\
+		io_type: SERIAL_IO_MEM},
+
+#define SERIAL_PORT_DFNS	\
+	STD_UART_OP(0)		\
+	STD_UART_OP(1)
 
 #include <asm/ibm440.h>
 

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