Skip to contentSkip to conversation

ads fads 860 patch

PATCH Magnus Damm 1 participant 1 message Nov 26, 1999

lore
Share & tools
lore
#0 lore raw

Hello all,

Here comes my embedded-2.2.13 patch for ADS and FADS.

The following works:

ADS and FADS NFSROOT.
Only 860 tested.

Does not work:

fec.c with FADS860T.

The following files are not properly changed
they are only changed to be able to compile.... quick fix.

arch/ppc/kernel/ksysm.c
arch/ppc/kernel/setup.c
arch/ppc/mm/init.c

They have nothing to do with ADS / FADS.

Have a nice weekend!

Cheers /

Magnus Damm

arch/ppc/8xx_io/commproc.h +27 -0
diff -ruN embedded_2.2.13_org/arch/ppc/8xx_io/commproc.h embedded-2.2.13/arch/ppc/8xx_io/commproc.h
@@ -457,6 +457,33 @@
 #define SICR_ENET_CLKRT	((uint)0x0000003d)
 #endif
 
+#if defined(CONFIG_ADS) || defined(CONFIG_FADS)
+
+/*
+ * The Motorola (F)ADS boards has got ethernet on SCC1.
+ */
+
+#define PA_ENET_RXD	((ushort)0x0001)
+#define PA_ENET_TXD	((ushort)0x0002)
+
+#define PA_ENET_TCLK	((ushort)0x0100)
+#define PA_ENET_RCLK	((ushort)0x0200)
+#define PB_ENET_TENA	((ushort)0x00001000)
+
+#define PC_ENET_CLSN	((ushort)0x0010)
+#define PC_ENET_RENA	((ushort)0x0020)
+
+#define SICR_ENET_MASK	((uint)0x000000ff)
+#define SICR_ENET_CLKRT	((uint)0x0000002c) // T=CLK1, R=CLK2
+
+/* 68160 PHY control */
+
+#define PC_ENET_ETHLOOP ((ushort)0x0800)
+#define PC_ENET_TPFLDL  ((ushort)0x0400)
+#define PC_ENET_TPSQEL  ((ushort)0x0200)
+
+#endif
+
 /* SCC Event register as used by Ethernet.
 */
 #define SCCE_ENET_GRA	((ushort)0x0080)	/* Graceful stop complete */
arch/ppc/8xx_io/enet.c +27 -0
diff -ruN embedded_2.2.13_org/arch/ppc/8xx_io/enet.c embedded-2.2.13/arch/ppc/8xx_io/enet.c
@@ -981,6 +981,23 @@
 	immap->im_ioport.iop_pcdat &= ~PC_BSE_LOOPBACK;
 #endif
 
+#if defined(CONFIG_ADS) || defined(CONFIG_FADS)
+	cp->cp_pbpar |= PB_ENET_TENA;
+	cp->cp_pbdir |= PB_ENET_TENA;
+
+        /* Port C is used to control the PHY, 68160.			
+	*/		
+        immap->im_ioport.iop_pcdir |=					
+	  (PC_ENET_ETHLOOP | PC_ENET_TPFLDL | PC_ENET_TPSQEL);		
+									
+        immap->im_ioport.iop_pcdat |= PC_ENET_TPFLDL;			
+        immap->im_ioport.iop_pcdat &= ~(PC_ENET_ETHLOOP | PC_ENET_TPSQEL);
+
+	/* Enable the PHY in Board Control Status Register 1 */
+
+        *((uint *)BCSR1) &= ~BCSR1_ETHEN;       
+#endif
+
 	dev->base_addr = (unsigned long)ep;
 	dev->priv = cep;
 #if 0
@@ -1005,4 +1022,14 @@
 
 	return 0;
 }
+
+
+
+
+
+
+
+
+
+
 
arch/ppc/8xx_io/uart.c +5 -0
diff -ruN embedded_2.2.13_org/arch/ppc/8xx_io/uart.c embedded-2.2.13/arch/ppc/8xx_io/uart.c
@@ -2417,7 +2417,12 @@
 		 * make it out of the transmit buffer.
 		 */
 		if (i == CONFIG_SERIAL_CONSOLE_PORT)
+#if defined(CONFIG_ADS) || defined(CONFIG_FADS)
+			mdelay(200);
+#else
 			mdelay(2);
+#endif
+
 #endif
 		info = kmalloc(sizeof(ser_info_t), GFP_KERNEL);
 		if (info) {
arch/ppc/config.in +3 -1
diff -ruN embedded_2.2.13_org/arch/ppc/config.in embedded-2.2.13/arch/ppc/config.in
@@ -31,7 +31,9 @@
 	 MBX		CONFIG_MBX \
 	 RPXL		CONFIG_RPXLITE \
 	 RPXC		CONFIG_RPXCLASSIC \
-	 BSE-IP		CONFIG_BSEIP" PowerMac
+	 BSE-IP		CONFIG_BSEIP	   \
+	 ADS 		CONFIG_ADS \
+	 FADS  		CONFIG_FADS" PowerMac
 
 bool 'Symmetric multi-processing support' CONFIG_SMP
 if [ "$CONFIG_ALL_PPC" != "y" ];then
arch/ppc/kernel/irq.c +4 -0
diff -ruN embedded_2.2.13_org/arch/ppc/kernel/irq.c embedded-2.2.13/arch/ppc/kernel/irq.c
@@ -54,9 +54,13 @@
 #include <asm/gg2.h>
 #include <asm/cache.h>
 #include <asm/prom.h>
+
+#ifdef CONFIG_APUS
 #include <asm/amigaints.h>
 #include <asm/amigahw.h>
 #include <asm/amigappc.h>
+#endif /* CONFIG_APUS */
+
 #include <asm/ptrace.h>
 
 #include "local_irq.h"
arch/ppc/kernel/ppc8xx_pic.c +8 -3
diff -ruN embedded_2.2.13_org/arch/ppc/kernel/ppc8xx_pic.c embedded-2.2.13/arch/ppc/kernel/ppc8xx_pic.c
@@ -137,6 +137,8 @@
 	ppc_irq_dispatch_handler( regs, irq );
 }
 
+#endif
+
 /* Only the MBX uses the external 8259.  This allows us to catch standard
  * drivers that may mess up the internal interrupt controllers, and also
  * allow them to run without modification on the MBX.
@@ -145,7 +147,10 @@
 	unsigned long irqflags, const char * devname, void *dev_id)
 {
 
-	irq += i8259_pic.irq_offset;
-	return (request_8xxirq(irq, handler, irqflags, devname, dev_id));
-}
+#ifdef CONFIG_MBX
+        irq += i8259_pic.irq_offset;
+        return (request_8xxirq(irq, handler, irqflags, devname, dev_id));
+#else
+        panic("request_irq");
 #endif
+}
arch/ppc/kernel/ppc_ksyms.c +7 -2
diff -ruN embedded_2.2.13_org/arch/ppc/kernel/ppc_ksyms.c embedded-2.2.13/arch/ppc/kernel/ppc_ksyms.c
@@ -69,6 +69,7 @@
 EXPORT_SYMBOL(ppc_local_irq_count);
 EXPORT_SYMBOL(ppc_local_bh_count);
 
+#if 0 // damm
 EXPORT_SYMBOL(isa_io_base);
 EXPORT_SYMBOL(isa_mem_base);
 EXPORT_SYMBOL(pci_dram_offset);
@@ -77,6 +78,7 @@
 EXPORT_SYMBOL(DMA_MODE_WRITE);
 EXPORT_SYMBOL(_prep_type);
 EXPORT_SYMBOL(ucSystemType);
+#endif
 
 EXPORT_SYMBOL(atomic_add);
 EXPORT_SYMBOL(atomic_sub);
@@ -180,19 +182,21 @@
 
 EXPORT_SYMBOL(_machine);
 EXPORT_SYMBOL(ppc_md);
-
+#if 0 //damm
 EXPORT_SYMBOL(adb_request);
 EXPORT_SYMBOL(adb_register);
 EXPORT_SYMBOL(cuda_request);
 EXPORT_SYMBOL(cuda_poll);
 EXPORT_SYMBOL(pmu_request);
 EXPORT_SYMBOL(pmu_poll);
+#endif
 #ifdef CONFIG_PMAC_PBOOK
 EXPORT_SYMBOL(pmu_register_sleep_notifier);
 EXPORT_SYMBOL(pmu_unregister_sleep_notifier);
 EXPORT_SYMBOL(pmu_enable_irled);
 #endif CONFIG_PMAC_PBOOK
 EXPORT_SYMBOL(abort);
+#if 0 // damm
 EXPORT_SYMBOL(find_devices);
 EXPORT_SYMBOL(find_type_devices);
 EXPORT_SYMBOL(find_compatible_devices);
@@ -204,6 +208,7 @@
 EXPORT_SYMBOL(feature_set);
 EXPORT_SYMBOL(feature_clear);
 EXPORT_SYMBOL(feature_test);
+#endif
 #ifdef CONFIG_SCSI
 EXPORT_SYMBOL(note_scsi_host);
 #endif
@@ -214,7 +219,7 @@
 #endif /* CONFIG_PMAC */
 
 EXPORT_SYMBOL(abs);
-EXPORT_SYMBOL(device_is_compatible);
+// damm EXPORT_SYMBOL(device_is_compatible);
 
 EXPORT_SYMBOL_NOVERS(__ashrdi3);
 EXPORT_SYMBOL_NOVERS(__lshrdi3);
arch/ppc/kernel/setup.c +1 -1
diff -ruN embedded_2.2.13_org/arch/ppc/kernel/setup.c embedded-2.2.13/arch/ppc/kernel/setup.c
@@ -22,7 +22,7 @@
 #include <asm/processor.h>
 #include <asm/pgtable.h>
 #include <asm/bootinfo.h>
-#include <asm/setup.h>
+//#include <asm/setup.h>
 #include <asm/amigappc.h>
 #include <asm/smp.h>
 #ifdef CONFIG_8xx
arch/ppc/mbxboot/head.S +12 -3
diff -ruN embedded_2.2.13_org/arch/ppc/mbxboot/head.S embedded-2.2.13/arch/ppc/mbxboot/head.S
@@ -37,6 +37,10 @@
  *		...and the first and second functions listed above are
  *			done for us (it knows ELF images).
  *
+ * On the (F)ADS,
+ *		R1 - Stack pointer at a high memory address.
+ *              R3 - Pointer to Board Information Block.
+ *		
  * For other embedded boards we build the Board Information Block.
  */
 
@@ -45,8 +49,12 @@
 	bl	start_
 start_:
 #ifndef CONFIG_MBX
-	lis	r11, local_bd_info@h
-	ori	r11, r11, local_bd_info@l
+#if defined(CONFIG_ADS) || defined(CONFIG_FADS)
+	mr	r11,r3		/* Save pointer to residual/board data */
+#else
+ 	lis	r11, local_bd_info@h
+ 	ori	r11, r11, local_bd_info@l
+#endif
 
 	mfmsr	r3		/* Turn off interrupts  */
 	li	r4,0
@@ -241,7 +249,7 @@
 	blr
 
 	.comm	.stack,4096*2,4
-#ifndef CONFIG_MBX
+#if !(defined(CONFIG_MBX) || defined(CONFIG_ADS) || defined(CONFIG_FADS))
 local_bd_info:
 	.long	0
 	.long	0x01000000
@@ -251,3 +259,4 @@
 	.long	0
 	.long	0
 #endif
+
arch/ppc/mbxboot/m8xx_tty.c +7 -0
diff -ruN embedded_2.2.13_org/arch/ppc/mbxboot/m8xx_tty.c embedded-2.2.13/arch/ppc/mbxboot/m8xx_tty.c
@@ -100,6 +100,13 @@
 	cp->cp_brgc1 =
 		((((bd->bi_intfreq * 1000000)/16) / bd->bi_baudrate) << 1) | CPM_BRG_EN;
 
+#if defined(CONFIG_ADS) || defined(CONFIG_FADS)
+	/* Enable SMC1 in Board Control Status Register 1 */
+
+        *((uint *)BCSR1) &= ~BCSR1_RS232EN_1;       
+#endif
+
+
 #else /* CONFIG_MBX */
 	if (*MBX_CSR1 & CSR1_COMEN) {
 		/* COM1 is enabled.  Initialize SMC1 and use it for
arch/ppc/mm/init.c +7 -1
diff -ruN embedded_2.2.13_org/arch/ppc/mm/init.c embedded-2.2.13/arch/ppc/mm/init.c
@@ -51,8 +51,10 @@
 #include <asm/smp.h>
 #include <asm/bootx.h>
 /* APUS includes */
+#ifdef CONFIG_APUS
 #include <asm/setup.h>
 #include <asm/amigahw.h>
+#endif /* CONFIG_APUS */
 /* END APUS includes */
 
 int prom_trashed;
@@ -72,7 +74,7 @@
 unsigned long ioremap_bot;
 unsigned long avail_start;
 extern int num_memory;
-extern struct mem_info memory[NUM_MEMINFO];
+extern struct mem_info memory[];
 extern boot_infos_t *boot_infos;
 #ifndef __SMP__
 struct pgtable_cache_struct quicklists;
@@ -1102,6 +1104,10 @@
         ioremap(PCI_CSR_ADDR, PCI_CSR_SIZE);
 	ioremap(RPX_CSR_ADDR, RPX_CSR_SIZE);
 #endif
+#if defined(CONFIG_ADS) || defined(CONFIG_FADS)
+	ioremap(BCSR_ADDR, BCSR_SIZE);
+#endif
+
 #endif /* CONFIG_8xx */
 }
 
include/asm-ppc/ads.h +156 -0

156 lines not on this page · raw message

include/asm-ppc/fads.h +154 -15

191 lines not on this page · raw message

include/asm-ppc/mpc8xx.h +20 -0
diff -ruN embedded_2.2.13_org/include/asm-ppc/mpc8xx.h embedded-2.2.13/include/asm-ppc/mpc8xx.h
@@ -12,6 +12,10 @@
 #include <asm/mbx.h>
 #endif
 
+#ifdef CONFIG_ADS
+#include <asm/ads.h>
+#endif
+
 #ifdef CONFIG_FADS
 #include <asm/fads.h>
 #endif
@@ -54,3 +58,19 @@
 		       void *dev_id);
 
 #endif
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
include/asm-ppc/processor.h +1 -0
diff -ruN embedded_2.2.13_org/include/asm-ppc/processor.h embedded-2.2.13/include/asm-ppc/processor.h
@@ -70,6 +70,7 @@
 #define _MACH_bseip   128 /* Bright Star Engineering ip-Engine */
 #define _MACH_yk      256 /* Motorola Yellowknife */
 #define _MACH_rpxclassic 512  /* RPCG RPX-Classic 8xx board */
+#define _MACH_ads     1024    /* Motorola ADS board */
 
 /* see residual.h for these */
 #define _PREP_Motorola 0x01  /* motorola prep */