Skip to contentSkip to conversation

linuxppc_2_4_devel patch for Force CPCI-690

PATCH Mark A. Greer 1 participant 2 messages Apr 30, 2003 – May 1, 2003 Network drivers

lore
Share & tools
lore
#0 lore raw

The following patch adds support for the Force CPCI-690 cPCI board.

If no one objects, please push this into linuxppc_2_4_devel.

Thanks,

Mark

===== arch/ppc/config.in 1.177 vs edited =====

arch/ppc/config.in +2 -1
@@ -143,6 +143,7 @@
 	"CHRP/PowerMac/PReP	CONFIG_ALL_PPC		\
 	 Amiga-APUS		CONFIG_APUS		\
 	 Cogent-Willow		CONFIG_WILLOW		\
+	 Force-CPCI690		CONFIG_CPCI690		\
 	 Force-PowerCore	CONFIG_PCORE		\
 	 Force-PowerPMC250	CONFIG_POWERPMC250	\
 	 Marvell-EV-64260-BP	CONFIG_EV64260		\
@@ -170,7 +171,7 @@
 fi
 
 if [ "$CONFIG_EV64260" = "y" -o "$CONFIG_HXEB100" = "y" \
-  -o "$CONFIG_PUMA_A" = "y" ]; then
+  -o "$CONFIG_PUMA_A" = "y" -o "$CONFIG_CPCI690" = "y" ]; then
     define_bool CONFIG_GT64260 y
 fi
 

===== arch/ppc/boot/simple/Makefile 1.25 vs edited =====

arch/ppc/boot/simple/Makefile +13 -0
@@ -31,6 +31,13 @@
 TFTPIMAGE			:= /tftpboot/zImage.embedded
 MISC				:= misc-embedded.o
 endif
+ifeq ($(CONFIG_CPCI690),y)
+ZIMAGE				:= zImage-CPCI690
+ZIMAGEINITRD			:= zImage.initrd-CPCI690
+EXTRA				:= misc-gt64260.o gt64260_stub.o misc-cpci690.o
+CACHEFLAG			:= -include clear.S
+TFTPIMAGE			:= /tftpboot/zImage.cpci690
+endif
 ifeq ($(CONFIG_IBM_OPENBIOS),y)
 ZIMAGE				:= zImage-TREE
 ZIMAGEINITRD			:= zImage.initrd-TREE
@@ -258,6 +265,12 @@
 
 zImage.initrd-K2: zvmlinux.initrd
 	ln -sf zImage.initrd.elf ../images/zImage.initrd.k2
+
+zImage-CPCI690: zvmlinux
+	dd if=zvmlinux of=../images/zImage.cpci690 skip=64 bs=1k
+
+zImage.initrd-CPCI690: zvmlinux.initrd
+	dd if=zvmlinux.initrd of=../images/zImage.initrd.cpci690 skip=64 bs=1k
 
 zImage-EV64260: zvmlinux
 	ln -sf zImage.elf ../images/zImage.ev64260

===== arch/ppc/configs/cpci690_defconfig 1.1 vs edited =====

arch/ppc/configs/cpci690_defconfig +601 -0

601 lines not on this page · raw message

===== arch/ppc/kernel/Makefile 1.128 vs edited =====

arch/ppc/kernel/Makefile +1 -0
@@ -87,6 +87,7 @@
 					indirect_pci.o i8259.o
 obj-$(CONFIG_ADIR)		+= i8259.o indirect_pci.o pci_auto.o \
 					todc_time.o
+obj-$(CONFIG_CPCI690)		+= indirect_pci.o todc_time.o pci_auto.o
 obj-$(CONFIG_GT64260)		+= gt64260_common.o gt64260_pic.o
 obj-$(CONFIG_EV64260)		+= indirect_pci.o todc_time.o pci_auto.o
 obj-$(CONFIG_PUMA_A)		+= indirect_pci.o todc_time.o pci_auto.o

===== arch/ppc/platforms/Makefile 1.38 vs edited =====

arch/ppc/platforms/Makefile +1 -0
@@ -62,6 +62,7 @@
 obj-$(CONFIG_PPC_RTAS)		+= error_log.o proc_rtas.o
 obj-$(CONFIG_PREP_RESIDUAL)	+= residual.o
 obj-$(CONFIG_ADIR)		+= adir_setup.o adir_pic.o adir_pci.o
+obj-$(CONFIG_CPCI690)		+= cpci690.o
 obj-$(CONFIG_EV64260)		+= ev64260.o
 obj-$(CONFIG_GEMINI)		+= gemini_pci.o gemini_setup.o gemini_prom.o
 obj-$(CONFIG_K2)		+= k2_setup.o k2_pci.o

===== arch/ppc/platforms/cpci690.c 1.1 vs edited =====

arch/ppc/platforms/cpci690.c +638 -0

638 lines not on this page · raw message

===== arch/ppc/platforms/cpci690.h 1.1 vs edited =====

arch/ppc/platforms/cpci690.h +70 -0

70 lines not on this page · raw message

===== drivers/net/gt64260_eth.h 1.7 vs edited =====

drivers/net/gt64260_eth.h +4 -0
@@ -183,6 +183,10 @@
 #define PHY_LXT97x
 #define PHY_ADD0                                4
 #define PHY_ADD1                                5
+#elif CONFIG_CPCI690
+#define PHY_ADD0                                0
+#define PHY_ADD1                                1
+#define PHY_ADD2                                2
 #else
 #define PHY_ADD0                                4
 #define PHY_ADD1                                5
#1 lore raw
Quoted 7 lines · Mark A. Greer

The following patch adds support for the Force CPCI-690 cPCI board.

If no one objects, please push this into linuxppc_2_4_devel.

Thanks,

Mark

Grr, forgot a file in the patch...

Mark

===== arch/ppc/boot/simple/misc-cpci690.c 1.1 vs edited =====

arch/ppc/boot/simple/misc-cpci690.c +72 -0
@@ -0,0 +1,72 @@
+/*
+ * arch/ppc/boot/simple/misc-cpci690.c
+ *
+ * Add birec data for Force CPCI690 board.
+ *
+ * Author: Mark A. Greer <[email protected]>
+ *
+ * Copyright 2003 MontaVista Software Inc.
+ *
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
+ */
+
+#include <linux/types.h>
+#include <asm/bootinfo.h>
+
+#include "nonstdio.h"
+
+#include "../../platforms/cpci690.h"
+
+#define ENET_MAC_LEN	6
+#define GT64260_SETUP	"gt_mac"
+
+extern struct bi_record *decompress_kernel(unsigned long load_addr,
+						int num_words,
+						unsigned long cksum);
+
+static bd_t	board_info;
+
+/*
+ * The MAC addresses are store in the RTC's NVRAM.  We need to get them out
+ * from there, convert to the proper format for the kernel driver,
+ * and pass them into the kernel.
+ */
+struct bi_record *
+load_kernel(u32 load_addr, int num_words, u32 chksum)
+{
+	struct bi_record	*bi_recs;
+	struct bi_record	*rec;
+	bd_t			*bip = &board_info;
+
+	bi_recs = decompress_kernel(load_addr, num_words, chksum);
+
+	/*
+	 * Get the MAC addrs from RTC's NVRAM and pass in to kernel via
+	 * a bd_t type of bi_rec.
+	 */
+	rec = bi_recs;
+	if (rec && rec->tag == BI_FIRST) {
+		bip->bi_magic = CPCI690_BI_MAGIC;
+
+		memcpy(bip->bi_enetaddr[0],
+				(void *)(CPCI690_TODC_BASE+CPCI690_MAC_OFFSET),
+				sizeof(bip->bi_enetaddr));
+
+		while (rec->tag != BI_LAST)
+			rec = (struct bi_record *)((ulong)rec + rec->size);
+
+		rec->tag = BI_BOARD_INFO;
+		memcpy((char *)rec->data, bip, sizeof(bd_t));
+		rec->size = sizeof(struct bi_record) + sizeof(bd_t);
+		rec = (struct bi_record *)((unsigned long)rec + rec->size);
+
+		rec->tag = BI_LAST;
+	        rec->size = sizeof(struct bi_record);
+	        rec = (struct bi_record *)((ulong)rec + rec->size);
+	}
+
+	return bi_recs;
+}