Skip to contentSkip to conversation

My GT-64260 enhancements

PATCH Michael Sokolov 2 participants 2 messages Mar 19, 2002 – Mar 20, 2002 Network drivers

lore
Share & tools
lore
#1 lore raw
In reply to Michael Sokolov
Quoted 7 lines · Michael Sokolov

OK, guys, here again is my patch to bi_rec'ize the EV-64260-BP port, the common GT-64260 code, and the GT-64260 Ethernet driver in linuxppc_2_4_devel (against 2_4_devel because it adds two new bi_recs to the master official bi_rec list in bootinfo.h) with all controversial parts removed, just the bi_rec'ization.

I ask Matt Porter, the maintainer listed in linuxppc_2_4_devel/MAINTAINERS to either push this patch into linuxppc_2_4_devel or give a good reason not to.

No, Matt is not the maintainer for any of the 64260 code. If anyone is, it would be me (or Troy) and I will resist pushing such a patch until there is agreement on what the set of bi_recs will be and there is a patch that implements *all* of them. However, if there is no agreement in the next few days, I will push it since it is a step in the right direction.

If enough people object to my position then I will apply it. Alternatively, if you can convince someone else to push it for you, more power to you.

Mark

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

#0 lore raw

OK, guys, here again is my patch to bi_rec'ize the EV-64260-BP port, the common GT-64260 code, and the GT-64260 Ethernet driver in linuxppc_2_4_devel (against 2_4_devel because it adds two new bi_recs to the master official bi_rec list in bootinfo.h) with all controversial parts removed, just the bi_rec'ization.

I ask Matt Porter, the maintainer listed in linuxppc_2_4_devel/MAINTAINERS to either push this patch into linuxppc_2_4_devel or give a good reason not to.

MS

arch/ppc/boot/common/misc-simple.c +5 -0
diff -Nru a/arch/ppc/boot/common/misc-simple.c b/arch/ppc/boot/common/misc-simple.c
@@ -68,6 +68,7 @@
 extern void serial_close(unsigned long com_port);
 extern void gunzip(void *, int, unsigned char *, int *);
 extern void serial_fixups(void);
+extern struct bi_record *add_extra_bi_recs(struct bi_record *bp);
 
 struct bi_record *
 decompress_kernel(unsigned long load_addr, int num_words, unsigned long cksum)
@@ -208,6 +209,10 @@
 		rec = (struct bi_record *)((unsigned long)rec +
 				rec->size);
 	}
+
+#ifdef CONFIG_EV64260
+	rec = add_extra_bi_recs(rec);
+#endif
 
 	rec->tag = BI_LAST;
 	rec->size = sizeof(struct bi_record);
arch/ppc/boot/simple/Makefile +1 -1
diff -Nru a/arch/ppc/boot/simple/Makefile b/arch/ppc/boot/simple/Makefile
@@ -34,7 +34,7 @@
 ifeq ($(CONFIG_EV64260),y)
 ZIMAGE				:= zImage-EV64260
 ZIMAGEINITRD			:= zImage.initrd-EV64260
-HEADHELP			:= direct.o misc-ev64260.o
+HEADHELP			:= direct.o misc-ev64260.o ev64260-birecs.o
 TFTPIMAGE			:= /tftpboot/zImage.ev64260
 endif
 ifeq ($(CONFIG_GEMINI),y)
arch/ppc/boot/simple/ev64260-birecs.c new file +118 -0

118 lines not on this page · raw message

arch/ppc/config.in +6 -24
diff -Nru a/arch/ppc/config.in b/arch/ppc/config.in
@@ -151,33 +151,15 @@
   bool 'Enable MPC10x store gathering' CONFIG_MPC10X_STORE_GATHERING
 fi
 
 if [ "$CONFIG_EV64260" = "y" ]; then
   define_bool CONFIG_GT64260 y
   define_int CONFIG_SERIAL_CONSOLE_BAUD 115200
-fi
-
-if [ "$CONFIG_GT64260" = "y" ]; then
-   mainmenu_option next_comment
-   comment 'Galileo GT64260 Options'
-   bool 'GT64260 Ethernet Ports' CONFIG_GT64260_ETH
-   if [ "$CONFIG_GT64260_ETH" = "y" ]; then
-     bool ' EVB64260 - Ethernet Port 0' CONFIG_GT64260_ETH_0
-     string '  MAC Address' CONFIG_GT64260_ETH_0_MACADDR "feffff000000"
-     bool ' EVB64260 - Ethernet Port 1' CONFIG_GT64260_ETH_1
-     string '  MAC Address' CONFIG_GT64260_ETH_1_MACADDR "feffff000001"
-     bool ' EVB64260 - Ethernet Port 2' CONFIG_GT64260_ETH_2
-     string '  MAC Address' CONFIG_GT64260_ETH_2_MACADDR "feffff000002"
-   fi
-   bool 'GT64260 MPSC Serial Ports' CONFIG_GT64260_MPSC
-   if [ "$CONFIG_GT64260_MPSC" = "y" ]; then
-     bool ' MPSC Port 0' CONFIG_GT64260_MPSC_0
-     bool ' MPSC Port 1' CONFIG_GT64260_MPSC_1
-     bool ' MPSC Port 0 as system console' CONFIG_GT64260_CONSOLE
-   fi
-   if [ "$CONFIG_GT64260_CONSOLE" = "y" ]; then
-     define_bool CONFIG_SERIAL_CONSOLE y
-   fi
-   endmenu
+  mainmenu_option next_comment
+  comment 'EV-64260-BP zImage Wrapper Options'
+  string 'Ethernet 0 MAC Address' CONFIG_EV64260_ETH_0_MACADDR "feffff000000"
+  string 'Ethernet 1 MAC Address' CONFIG_EV64260_ETH_1_MACADDR "feffff000001"
+  string 'Ethernet 2 MAC Address' CONFIG_EV64260_ETH_2_MACADDR "feffff000002"
+  endmenu
 fi
 
 if [ "$CONFIG_K2" = "y" ]; then
arch/ppc/kernel/gt64260_common.c +1 -0
diff -Nru a/arch/ppc/kernel/gt64260_common.c b/arch/ppc/kernel/gt64260_common.c
@@ -58,6 +58,7 @@
 
 
 u32	gt64260_base; /* Virtual base address of 64260's regs */
+u32	gt64260_phys_base; /* Physical base address of 64260's regs */
 u32	gt64260_revision; /* Revision of the chip */
 u8	gt64260_pci_exclude_bridge = TRUE;
 
arch/ppc/kernel/setup.c +13 -0
diff -Nru a/arch/ppc/kernel/setup.c b/arch/ppc/kernel/setup.c
@@ -35,6 +35,7 @@
 #include <asm/uaccess.h>
 #include <asm/system.h>
 #include <asm/pmac_feature.h>
+#include <asm/gt64260.h>
 
 #if defined CONFIG_KGDB
 #include <asm/kgdb.h>
@@ -491,6 +492,18 @@
 		case BI_MEMSIZE:
 			boot_mem_size = data[0];
 			break;
+#ifdef CONFIG_GT64260
+		case BI_GT64260_BASE:
+			gt64260_phys_base = data[0];
+			break;
+#ifdef CONFIG_GT64260_ETH
+		case BI_GT64260_ETH_CFG:
+			gt64260_eth_enable |= 1 << data[0];
+			bcopy(&data[1], &gt64260_eth_config[data[0]],
+			      sizeof(struct gt64260_eth_config));
+			break;
+#endif /* CONFIG_GT64260_ETH */
+#endif /* CONFIG_GT64260 */
 		}
 		rec = (struct bi_record *)((ulong)rec + rec->size);
 	}
arch/ppc/platforms/ev64260_setup.c +10 -4
diff -Nru a/arch/ppc/platforms/ev64260_setup.c b/arch/ppc/platforms/ev64260_setup.c
@@ -105,7 +105,7 @@
 	GT64260_BRIDGE_INFO_DEFAULT(&info, ev64260_find_end_of_memory());
 
 	/* Lookup PCI host bridges */
-	if (gt64260_find_bridges(EV64260_BRIDGE_REG_BASE,
+	if (gt64260_find_bridges(gt64260_phys_base,
 				 &info,
 				 ev64260_map_irq)) {
 		printk("Bridge initialization failed.\n");
@@ -322,7 +322,7 @@
 
 	if (mem_size == 0) {
 		/* Next 2 lines are a kludge for gt64260_get_mem_size() */
-		gt64260_base = EV64260_BRIDGE_REG_BASE;
+		gt64260_base = gt64260_phys_base;
 		ev64260_set_bat();
 		mem_size = gt64260_get_mem_size();
 	}
@@ -498,7 +498,13 @@
 platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
 	      unsigned long r6, unsigned long r7)
 {
-	parse_bootinfo(find_bootinfo());
+	/*
+	 * The GT-64260 physical base address will normally be passed in a
+	 * bootinfo record, but if there isn't one the default below will
+	 * remain in effect.
+	 */
+	gt64260_phys_base = EV64260_BRIDGE_REG_BASE;
+	parse_bootinfo((struct bi_record *) (r3 + KERNELBASE));
 
 	isa_mem_base = 0;
 
@@ -530,7 +536,7 @@
 #ifdef	CONFIG_SERIAL_TEXT_DEBUG
 	ev64260_set_bat();
 #ifdef	CONFIG_GT64260_CONSOLE
-	gt64260_base = EV64260_BRIDGE_REG_BASE;
+	gt64260_base = gt64260_phys_base;
 	ppc_md.progress = gt64260_mpsc_progress; /* embedded UART */
 #else
 	ppc_md.progress = ev64260_16550_progress; /* Dev module DUART */
drivers/net/Config.in +3 -0
diff -Nru a/drivers/net/Config.in b/drivers/net/Config.in
@@ -37,6 +37,9 @@
       fi
       dep_tristate '  BMAC (G3 ethernet) support' CONFIG_BMAC $CONFIG_ALL_PPC
       dep_tristate '  GMAC (G4/iBook ethernet) support' CONFIG_GMAC $CONFIG_ALL_PPC
+      if [ "$CONFIG_GT64260" = "y" ]; then
+	 bool '  GT64260 Ethernet Ports' CONFIG_GT64260_ETH
+      fi
       if [ "$CONFIG_4xx" = "y" ]; then
          if [ "$CONFIG_REDWOOD_4" = "y" -o "$CONFIG_403GCX" = "y" ]; then
 	    tristate '  National DP83902AV (Oak ethernet) support' CONFIG_OAKNET
drivers/net/gt64260_eth.c +39 -140

286 lines not on this page · raw message

drivers/net/gt64260_eth.h +6 -41

92 lines not on this page · raw message

include/asm-ppc/bootinfo.h +3 -0
diff -Nru a/include/asm-ppc/bootinfo.h b/include/asm-ppc/bootinfo.h
@@ -32,6 +32,9 @@
 #define BI_SYSMAP		0x1015
 #define BI_MACHTYPE		0x1016
 #define BI_MEMSIZE		0x1017
+/* For systems with the GT-64260 system controller */
+#define	BI_GT64260_BASE		0x1018
+#define	BI_GT64260_ETH_CFG	0x1019
 
 extern struct bi_record *find_bootinfo(void);
 extern void parse_bootinfo(struct bi_record *rec);
include/asm-ppc/gt64260.h +9 -0
diff -Nru a/include/asm-ppc/gt64260.h b/include/asm-ppc/gt64260.h
@@ -30,6 +30,7 @@
 
 
 extern u32     gt64260_base;
+extern u32     gt64260_phys_base;
 extern u32     gt64260_irq_base;     /* We handle the next 96 IRQs from here */
 extern u32     gt64260_revision;
 extern u8      gt64260_pci_exclude_bridge;
@@ -186,6 +187,14 @@
 	(ip)->pci_1_io_size	  = GT64260_PCI_1_IO_SIZE;		\
 	(ip)->pci_1_io_swap	  = GT64260_CPU_PCI_SWAP_NONE;		\
 }
+
+/* GT64260 Ethernet configuration passed via bootinfo records */
+extern struct gt64260_eth_config {
+	u_char eth_stat_addr[6];
+	u_char is_rmii;
+	u_char phy_addr;
+} gt64260_eth_config[3];
+extern u_long gt64260_eth_enable;
 
 /*
  *****************************************************************************

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