⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 update-2.4.19-axis.patch

📁 rtai-3.1-test3的源代码(Real-Time Application Interface )
💻 PATCH
📖 第 1 页 / 共 5 页
字号:
-		   csum, ptable_head->checksum); */ 		ptable_ok = (csum == ptable_head->checksum);  		/* Read the entries and use/show the info.  */-		printk(" Found %s partition table at 0x%08lX-0x%08lX.\n",-		       (ptable_ok ? "valid" : "invalid"),-		       (unsigned long)ptable_head,-		       (unsigned long)max_addr);+		printk(" Found a%s partition table at 0x%p-0x%p.\n",+		       (ptable_ok ? " valid" : "n invalid"), ptable_head,+		       max_addr);  		/* We have found a working bootblock.  Now read the-		   partition table.  Scan the table.  It ends when-		   there is 0xffffffff, that is, empty flash.  */-		+		 * partition table.  Scan the table.  It ends when+		 * there is 0xffffffff, that is, empty flash.+		 */ 		while (ptable_ok 		       && ptable->offset != 0xffffffff 		       && ptable < max_addr@@ -352,59 +464,64 @@ 		use_default_ptable = !ptable_ok; 	} +	if (romfs_in_flash) {+		/* Add an overlapping device for the root partition (romfs). */++		axis_partitions[pidx].name = "romfs";+		axis_partitions[pidx].size = romfs_length;+		axis_partitions[pidx].offset = romfs_start - FLASH_CACHED_ADDR;+		axis_partitions[pidx].mask_flags |= MTD_WRITEABLE;++		printk(" Adding readonly flash partition for romfs image:\n");+		printk(pmsg, pidx, axis_partitions[pidx].offset,+		       axis_partitions[pidx].size);+		pidx++;+	}+ 	if (use_default_ptable) {-		printk(" Using default partition table\n");+		printk(" Using default partition table.\n"); 		err = add_mtd_partitions(mymtd, axis_default_partitions, 		                         NUM_DEFAULT_PARTITIONS); 	} else {-		if (romfs_in_flash) {-			axis_partitions[pidx].name = "romfs";-			axis_partitions[pidx].size = romfs_length;-			axis_partitions[pidx].offset = romfs_start --						       FLASH_CACHED_ADDR;-			axis_partitions[pidx].mask_flags |= MTD_WRITEABLE;--			printk(" Adding readonly partition for romfs image:\n");-			printk(pmsg, pidx, axis_partitions[pidx].offset,-			       axis_partitions[pidx].size);-			pidx++;-		}- 		err = add_mtd_partitions(mymtd, axis_partitions, pidx); 	}-	if (!err && !romfs_in_flash) {-#ifdef CONFIG_MTD_MTDRAM-		/* Allocate, initialise and forget the mtd ram struct-		 * when booting from RAM-		 */-		struct mtd_info *romfs_mtd = (struct mtd_info *)kmalloc(sizeof(struct mtd_info), GFP_KERNEL);-		printk("MTD RAM device romfs_start: 0x%08lX len %lu\n",-		       romfs_start, romfs_length); -#if (CONFIG_MTDRAM_TOTAL_SIZE != 0) || (CONFIG_MTDRAM_ABS_POS != 0)-#error "You must set CONFIG_MTDRAM_TOTAL_SIZE and CONFIG_MTDRAM_ABS_POS to 0"-#endif-		err = mtdram_init_device(romfs_mtd, (void*)romfs_start, -		                         romfs_length, "romfs in RAM");+	if (err) {+		panic("axisflashmap could not add MTD partitions!\n");+	}++	if (!romfs_in_flash) {+		/* Create an RAM device for the root partition (romfs). */++#if !defined(CONFIG_MTD_MTDRAM) || (CONFIG_MTDRAM_TOTAL_SIZE != 0) || (CONFIG_MTDRAM_ABS_POS != 0)+		/* No use trying to boot this kernel from RAM. Panic! */+		printk(KERN_EMERG "axisflashmap: Cannot create an MTD RAM "+		       "device due to kernel (mis)configuration!\n");+		panic("This kernel cannot boot from RAM!\n"); #else-#warning ######################################-#warning # You must enable CONFIG_MTD_MTDRAM  #-#warning # with TOTAL_SIZE 0 and ABS_POS 0 to # -#warning # be able to boot with cramfs in RAM #-#warning ######################################-/* Maybe overkill to save these bytes in non debug builds, but let's do it..- * (No point in printing if we don't have a debug port anyway...)- */-#ifndef CONFIG_ETRAX_DEBUG_PORT_NULL-		printk("## Can't mount romfs in RAM using MTDRAM.\n");-		printk("## You must enable MTD_MTDRAM with TOTAL_SIZE 0 and ABS_POS 0\n");+		struct mtd_info *mtd_ram;++		mtd_ram = (struct mtd_info *)kmalloc(sizeof(struct mtd_info),+						     GFP_KERNEL);+		if (!mtd_ram) {+			panic("axisflashmap couldn't allocate memory for "+			      "mtd_info!\n");+		}++		printk(" Adding RAM partition for romfs image:\n");+		printk(pmsg, pidx, romfs_start, romfs_length);++		err = mtdram_init_device(mtd_ram, (void*)romfs_start, +		                         romfs_length, "romfs");+		if (err) {+			panic("axisflashmap could not initialize MTD RAM "+			      "device!\n");+		} #endif-#endif /* CONFIG_MTD_MTDRAM */ 	}+ 	return err; } -/* This adds the above to the kernels init-call chain */-+/* This adds the above to the kernels init-call chain. */ module_init(init_axis_flash);-diff -Nur /home/starvik/download/kernel/linux-2.4.19/arch/cris/drivers/bluetooth/Makefile ./arch/cris/drivers/bluetooth/Makefile--- /home/starvik/download/kernel/linux-2.4.19/arch/cris/drivers/bluetooth/Makefile	Sat Aug  3 02:39:42 2002+++ ./arch/cris/drivers/bluetooth/Makefile	Wed Oct 23 12:28:59 2002@@ -1,4 +1,4 @@-include $(APPS)/Rules.elinux+include $(AXIS_TOP_DIR)/tools/build/Rules.axis  all: diff -Nur /home/starvik/download/kernel/linux-2.4.19/arch/cris/drivers/ds1302.c ./arch/cris/drivers/ds1302.c--- /home/starvik/download/kernel/linux-2.4.19/arch/cris/drivers/ds1302.c	Sat Aug  3 02:39:42 2002+++ ./arch/cris/drivers/ds1302.c	Wed Oct 23 12:28:59 2002@@ -7,6 +7,16 @@ *! Functions exported: ds1302_readreg, ds1302_writereg, ds1302_init, get_rtc_status *! *! $Log: update-2.4.19-axis.patch,v $ *! Revision 1.1.1.1  2004/06/06 14:14:02  rpm *! Vesuvio baseline *! *! Revision 1.1.1.1  2004/04/04 19:00:54  pgerum *! Vesuvio baseline *! *! Revision 1.1.1.1  2004/02/15 11:56:24  pgerum *! Magma baseline *! *! Revision 1.1  2004/01/02 15:11:03  pgerum *! Add Axis update to 2.4.19 *!+*! Revision 1.15  2002/10/11 16:14:33  johana+*! Added CONFIG_ETRAX_DS1302_TRICKLE_CHARGE and initial setting of the+*! trcklecharge register.+*!+*! Revision 1.14  2002/10/10 12:15:38  magnusmn+*! Added support for having the RST signal on bit g0+*!+*! Revision 1.13  2002/05/29 15:16:08  johana+*! Removed unused variables.+*! *! Revision 1.12  2002/04/10 15:35:25  johana *! Moved probe function closer to init function and marked it __init. *!@@ -85,7 +95,7 @@ *! *! (C) Copyright 1999, 2000, 2001  Axis Communications AB, LUND, SWEDEN *!-*! $Id: update-2.4.19-axis.patch,v 1.1.1.1 2004/06/06 14:14:02 rpm Exp $+*! $Id: update-2.4.19-axis.patch,v 1.1.1.1 2004/06/06 14:14:02 rpm Exp $ *! *!***************************************************************************/ @@ -322,7 +332,6 @@ 		{ 			struct rtc_time rtc_tm; 			unsigned char mon, day, hrs, min, sec, leap_yr;-			unsigned char save_control, save_freq_select; 			unsigned int yrs;  			if (!capable(CAP_SYS_TIME))@@ -386,7 +395,6 @@ 		case RTC_SET_CHARGE: /* set the RTC TRICKLE CHARGE register */ 		{ 			int tcs_val;                        -			unsigned char save_control, save_freq_select;  			if (!capable(CAP_SYS_TIME)) 				return -EPERM;@@ -492,17 +500,25 @@ {  	if (!ds1302_probe()) { #ifdef CONFIG_ETRAX_DS1302_RST_ON_GENERIC_PORT+#if CONFIG_ETRAX_DS1302_RSTBIT == 27 		/* 		 * The only way to set g27 to output is to enable ATA. 		 * 		 * Make sure that R_GEN_CONFIG is setup correct. 		 */     		genconfig_shadow = ((genconfig_shadow &-				     ~IO_MASK(R_GEN_CONFIG, ata))-				   | +				     ~IO_MASK(R_GEN_CONFIG, ata)) |  				   (IO_STATE(R_GEN_CONFIG, ata, select)));         		*R_GEN_CONFIG = genconfig_shadow;-    		if (!ds1302_probe())+#elif CONFIG_ETRAX_DS1302_RSTBIT == 0+		+		/* Set the direction of this bit to out. */		+    		genconfig_shadow = ((genconfig_shadow &+				     ~IO_MASK(R_GEN_CONFIG, g0dir)) | +				   (IO_STATE(R_GEN_CONFIG, g0dir, out)));    +    		*R_GEN_CONFIG = genconfig_shadow;+#endif+		if (!ds1302_probe())       			return -1; #else     		return -1;@@ -514,5 +530,8 @@ 		       ds1302_name, RTC_MAJOR_NR); 		return -1; 	}+	/* Initialise trickle charger */+	ds1302_writereg(RTC_TRICKLECHARGER,+			RTC_TCR_PATTERN |(CONFIG_ETRAX_DS1302_TRICKLE_CHARGE & 0x0F)); 	return 0; }diff -Nur /home/starvik/download/kernel/linux-2.4.19/arch/cris/drivers/ethernet.c ./arch/cris/drivers/ethernet.c--- /home/starvik/download/kernel/linux-2.4.19/arch/cris/drivers/ethernet.c	Sat Aug  3 02:39:42 2002+++ ./arch/cris/drivers/ethernet.c	Wed Oct 23 12:28:59 2002@@ -1,4 +1,4 @@-/* $Id: update-2.4.19-axis.patch,v 1.1.1.1 2004/06/06 14:14:02 rpm Exp $+/* $Id: update-2.4.19-axis.patch,v 1.1.1.1 2004/06/06 14:14:02 rpm Exp $  *  * e100net.c: A network driver for the ETRAX 100LX network controller.  *@@ -7,6 +7,18 @@  * The outline of this driver comes from skeleton.c.  *  * $Log: update-2.4.19-axis.patch,v $  * Revision 1.1.1.1  2004/06/06 14:14:02  rpm  * Vesuvio baseline  *  * Revision 1.1.1.1  2004/04/04 19:00:54  pgerum  * Vesuvio baseline  *  * Revision 1.1.1.1  2004/02/15 11:56:24  pgerum  * Magma baseline  *  * Revision 1.1  2004/01/02 15:11:03  pgerum  * Add Axis update to 2.4.19  *+ * Revision 1.33  2002/10/02 20:16:17  hp+ * SETF, SETS: Use underscored IO_x_ macros rather than incorrect token concatenation+ *+ * Revision 1.32  2002/09/16 06:05:58  starvik+ * Align memory returned by dev_alloc_skb+ * Moved handling of sent packets to interrupt to avoid reference counting problem+ *+ * Revision 1.31  2002/09/10 13:28:23  larsv+ * Return -EINVAL for unknown ioctls to avoid confusing tools that tests+ * for supported functionality by issuing special ioctls, i.e. wireless+ * extensions.+ *  * Revision 1.30  2002/05/07 18:50:08  johana  * Correct spelling in comments.  *@@ -163,6 +175,7 @@ #include <asm/system.h> #include <asm/bitops.h> #include <asm/ethernet.h>+#include <asm/cache.h>  //#define ETHDEBUG #define D(x)@@ -264,10 +277,10 @@ #define GET_BIT(bit,val)   (((val) >> (bit)) & 0x01)  /* Define some macros to access ETRAX 100 registers */-#define SETF(var, reg, field, val) var = (var & ~IO_MASK(##reg##, field)) | \-					  IO_FIELD(##reg##, field, val)-#define SETS(var, reg, field, val) var = (var & ~IO_MASK(##reg##, field)) | \-					  IO_STATE(##reg##, field, val)+#define SETF(var, reg, field, val) var = (var & ~IO_MASK_(reg##_, field##_)) | \+					  IO_FIELD_(reg##_, field##_, val)+#define SETS(var, reg, field, val) var = (var & ~IO_MASK_(reg##_, field##_)) | \+					  IO_STATE_(reg##_, field##_, _##val)  static etrax_eth_descr *myNextRxDesc;  /* Points to the next descriptor to                                           to be processed */@@ -304,8 +317,7 @@ static int e100_open(struct net_device *dev); static int e100_set_mac_address(struct net_device *dev, void *addr); static int e100_send_packet(struct sk_buff *skb, struct net_device *dev);-static void e100rx_interrupt(int irq, void *dev_id, struct pt_regs *regs);-static void e100tx_interrupt(int irq, void *dev_id, struct pt_regs *regs);+static void e100rxtx_interrupt(int irq, void *dev_id, struct pt_regs *regs); static void e100nw_interrupt(int irq, void *dev_id, struct pt_regs *regs); static void e100_rx(struct net_device *dev); static int e100_close(struct net_device *dev);@@ -399,11 +411,14 @@ 	/* Initialise receive descriptors */  	for (i = 0; i < NBR_OF_RX_DESC; i++) {-		RxDescList[i].skb = dev_alloc_skb(MAX_MEDIA_DATA_SIZE);+		/* Allocate two extra cachelines to make sure that buffer used by DMA+		 * does not share cacheline with any other data (to avoid cache bug)+		 */+		RxDescList[i].skb = dev_alloc_skb(MAX_MEDIA_DATA_SIZE + 2 * L1_CACHE_BYTES); 		RxDescList[i].descr.ctrl   = 0; 		RxDescList[i].descr.sw_len = MAX_MEDIA_DATA_SIZE; 		RxDescList[i].descr.next   = virt_to_phys(&RxDescList[i + 1]);-		RxDescList[i].descr.buf    = virt_to_phys(RxDescList[i].skb->data);+		RxDescList[i].descr.buf    = L1_CACHE_ALIGN(virt_to_phys(RxDescList[i].skb->data)); 		RxDescList[i].descr.status = 0; 		RxDescList[i].descr.hw_len = 0;              @@ -540,14 +555,14 @@  	/* allocate the irq corresponding to the receiving DMA */ -	if (request_irq(NETWORK_DMA_RX_IRQ_NBR, e100rx_interrupt, 0,+	if (request_irq(NETWORK_DMA_RX_IRQ_NBR, e100rxtx_interrupt, 0, 			cardname, (void *)dev)) { 		goto grace_exit0; 	}  	/* allocate the irq corresponding to the transmitting DMA */ -	if (request_irq(NETWORK_DMA_TX_IRQ_NBR, e100tx_interrupt, 0,+	if (request_irq(NETWORK_DMA_TX_IRQ_NBR, e100rxtx_interrupt, 0, 			cardname, (void *)dev)) { 		goto grace_exit1; 	}@@ -958,21 +973,6 @@ 		*R_IRQ_MASK2_SET = IO_STATE(R_IRQ_MASK2_SET, dma0_eop, set); 		netif_stop_queue(dev); 	}-	else {-	  /* Report any packets that have been sent */-		while (myFirstTxDesc != phys_to_virt(*R_DMA_CH0_FIRST) &&-		       myFirstTxDesc != myNextTxDesc)-		{-			np->stats.tx_bytes += myFirstTxDesc->skb->len;-			np->stats.tx_packets++;--			/* dma is ready with the transmission of the data in tx_skb, so now-			   we can release the skb memory */-			dev_kfree_skb(myFirstTxDesc->skb);-			myFirstTxDesc->skb = 0;-			myFirstTxDesc = phys_to_virt(myFirstTxDesc->descr.next);				-		}-	}  	spin_unlock_irq(&np->lock); @@ -985,11 +985,13 @@  */  static void-e100rx_interrupt(int irq, void *dev_id, struct pt_regs * regs)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -