netarm_hal.patch

来自「开放源码实时操作系统源码.」· PATCH 代码 · 共 535 行 · 第 1/2 页

PATCH
535
字号
+
 #endif
 
diff -Naur orig/hal/arm/netarm/current/include/pkgconf/mlt_arm_netarm_ram.ldi new/hal/arm/netarm/current/include/pkgconf/mlt_arm_netarm_ram.ldi
--- orig/hal/arm/netarm/current/include/pkgconf/mlt_arm_netarm_ram.ldi	2004-11-29 17:35:46.000000000 +0100
+++ new/hal/arm/netarm/current/include/pkgconf/mlt_arm_netarm_ram.ldi	2005-03-10 14:56:07.137708600 +0100
@@ -3,34 +3,32 @@
 MEMORY
 {
     noncacheram : ORIGIN = 0, LENGTH = 16*1024*1024
-    dataram : ORIGIN = 0x4000000, LENGTH = 16*1024*1024
-    codecacheram : ORIGIN = 0x8000000, LENGTH = 16*1024*1024
+    codecacheram : ORIGIN = 0x4000000, LENGTH = 16*1024*1024
+    datacacheram : ORIGIN = 0x8000000, LENGTH = 16*1024*1024
 }
 
 SECTIONS
 {
     SECTIONS_BEGIN
-	_dataram = 0x4000000;
+	_dataram = 0x8000000;
     SECTION_rom_vectors (nocacheram, 0x0, LMA_EQ_VMA)
     SECTION_fixed_vectors (nocacheram, ALIGN (0x4), LMA_EQ_VMA)
-	code_start = . + 0x8000000; 
-    SECTION_text (codecacheram, code_start, AT (code_start - 0x8000000))
+	code_start = . + 0x4000000; 
+    SECTION_text (codecacheram, code_start, AT (code_start - 0x4000000))
 	fini = .;
-    SECTION_fini (codecacheram, ALIGN (0x4), AT (fini - 0x8000000))
+    SECTION_fini (codecacheram, ALIGN (0x4), AT (fini - 0x4000000))
 	rodata = .;
-    SECTION_rodata (codecacheram, ALIGN (0x4), AT (rodata - 0x8000000))
+    SECTION_rodata (codecacheram, ALIGN (0x4), AT (rodata - 0x4000000))
 	rodata1 = .;
-    SECTION_rodata1 (codecacheram, ALIGN (0x4), AT (rodata1 - 0x8000000))
+    SECTION_rodata1 (codecacheram, ALIGN (0x4), AT (rodata1 - 0x4000000))
 	fixup = .;
-    SECTION_fixup (codecacheram, ALIGN (0x4), AT (fixup - 0x8000000))
+    SECTION_fixup (codecacheram, ALIGN (0x4), AT (fixup - 0x4000000))
 	gcc_except_table =.;
-    SECTION_gcc_except_table (codecacheram, ALIGN (0x4), AT (gcc_except_table - 0x8000000))
-	data_start = ALIGN(0x4) - 0x4000000; 
-    SECTION_data (dataram, data_start, AT (data_start - 0x4000000))
+    SECTION_gcc_except_table (codecacheram, ALIGN (0x4), AT (gcc_except_table - 0x4000000))
+	data_start = ALIGN(0x4) + 0x4000000; 
+    SECTION_data (datacacheram, data_start, AT (data_start - 0x8000000))
 	bss = .;
-    SECTION_bss (dataram, ALIGN (0x4), AT (bss - 0x4000000))
+    SECTION_bss (datacacheram, ALIGN (0x4), AT (bss - 0x8000000))
     CYG_LABEL_DEFN(__heap1) = ALIGN (0x8);
     SECTIONS_END
 }
-
-
diff -Naur orig/hal/arm/netarm/current/include/pkgconf/mlt_arm_netarm_romram.ldi new/hal/arm/netarm/current/include/pkgconf/mlt_arm_netarm_romram.ldi
--- orig/hal/arm/netarm/current/include/pkgconf/mlt_arm_netarm_romram.ldi	2004-11-29 17:35:46.000000000 +0100
+++ new/hal/arm/netarm/current/include/pkgconf/mlt_arm_netarm_romram.ldi	2005-03-10 14:56:18.184583600 +0100
@@ -3,34 +3,32 @@
 MEMORY
 {
     noncacheram : ORIGIN = 0, LENGTH = 16*1024*1024
-    dataram : ORIGIN = 0x4000000, LENGTH = 16*1024*1024
-    codecacheram : ORIGIN = 0x8000000, LENGTH = 16*1024*1024
+    codecacheram : ORIGIN = 0x4000000, LENGTH = 16*1024*1024
+    datacacheram : ORIGIN = 0x8000000, LENGTH = 16*1024*1024
 }
 
 SECTIONS
 {
     SECTIONS_BEGIN
-	_dataram = 0x4000000;
+	_dataram = 0x8000000;
     SECTION_rom_vectors (nocacheram, 0x0, LMA_EQ_VMA)
     SECTION_fixed_vectors (nocacheram, ALIGN (0x4), LMA_EQ_VMA)
-	code_start = . + 0x8000000; 
-    SECTION_text (codecacheram, code_start, AT (code_start -  0x8000000))
+	code_start = . + 0x4000000; 
+    SECTION_text (codecacheram, code_start, AT (code_start - 0x4000000))
 	fini = .;
-    SECTION_fini (codecacheram, ALIGN (0x4), AT (fini -  0x8000000))
+    SECTION_fini (codecacheram, ALIGN (0x4), AT (fini - 0x4000000))
 	rodata = .;
-    SECTION_rodata (codecacheram, ALIGN (0x4), AT (rodata -  0x8000000))
+    SECTION_rodata (codecacheram, ALIGN (0x4), AT (rodata - 0x4000000))
 	rodata1 = .;
-    SECTION_rodata1 (codecacheram, ALIGN (0x4), AT (rodata1 -  0x8000000))
+    SECTION_rodata1 (codecacheram, ALIGN (0x4), AT (rodata1 - 0x4000000))
 	fixup = .;
-    SECTION_fixup (codecacheram, ALIGN (0x4), AT (fixup -  0x8000000))
-	gcc_except_table = .;
-    SECTION_gcc_except_table (codecacheram, ALIGN (0x4), AT (gcc_except_table -  0x8000000))
-	data_start = . - 0x4000000; 
-    SECTION_data (dataram, data_start, AT (data_start -  0x4000000))
+    SECTION_fixup (codecacheram, ALIGN (0x4), AT (fixup - 0x4000000))
+	gcc_except_table =.;
+    SECTION_gcc_except_table (codecacheram, ALIGN (0x4), AT (gcc_except_table - 0x4000000))
+	data_start = ALIGN(0x4) + 0x4000000; 
+    SECTION_data (datacacheram, data_start, AT (data_start - 0x8000000))
 	bss = .;
-    SECTION_bss (dataram, ALIGN (0x4), AT (bss -  0x4000000))
+    SECTION_bss (datacacheram, ALIGN (0x4), AT (bss - 0x8000000))
     CYG_LABEL_DEFN(__heap1) = ALIGN (0x8);
     SECTIONS_END
 }
-
-
diff -Naur orig/hal/arm/netarm/current/include/plf_mmap.h new/hal/arm/netarm/current/include/plf_mmap.h
--- orig/hal/arm/netarm/current/include/plf_mmap.h	1970-01-01 01:00:00.000000000 +0100
+++ new/hal/arm/netarm/current/include/plf_mmap.h	2005-04-01 11:13:23.378304500 +0200
@@ -0,0 +1,62 @@
+#ifndef CYGONCE_HAL_NETARM_PLATFORM_PLF_MMAP_H
+#define CYGONCE_HAL_NETARM_PLATFORM_PLF_MMAP_H
+//==========================================================================
+//
+//      plf_mmap.h
+//
+//      Platform specific memory map support
+//
+//==========================================================================
+//####ECOSGPLCOPYRIGHTBEGIN####
+// -------------------------------------------
+// This file is part of eCos, the Embedded Configurable Operating System
+// Copyright (C) 2005 eCosCentric Ltd.
+//
+// eCos 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 or (at your option) any later version.
+//
+// eCos is distributed in the hope that it will be useful, but WITHOUT ANY
+// WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+// for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with eCos; if not, write to the Free Software Foundation, Inc.,
+// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+//
+// As a special exception, if other files instantiate templates or use macros
+// or inline functions from this file, or you compile this file and link it
+// with other works to produce a work based on this file, this file does not
+// by itself cause the resulting work to be covered by the GNU General Public
+// License. However the source code for this file must still be made available
+// in accordance with section (3) of the GNU General Public License.
+//
+// This exception does not invalidate any other reasons why a work based on
+// this file might be covered by the GNU General Public License.
+//
+// -------------------------------------------
+//####ECOSGPLCOPYRIGHTEND####
+//==========================================================================
+//#####DESCRIPTIONBEGIN####
+//
+// Author(s):           Harald Brandl (harald.brandl@fh-joanneum.at)
+// Contributors:        Harald Brandl
+// Date:                01.04.2005
+// Purpose:             NET+ARM memory map macro
+// Description:
+//
+//####DESCRIPTIONEND####
+//
+//==========================================================================
+
+
+extern unsigned int _dataram;
+
+
+#define HAL_CACHED_TO_UNCACHED_ADDRESS( caddr, uaddr, type ) CYG_MACRO_START       \
+    uaddr = (type)((cyg_uint32)caddr - (cyg_uint32)(&_dataram)); \
+CYG_MACRO_END
+
+//---------------------------------------------------------------------------
+#endif // CYGONCE_HAL_NETARM_PLATFORM_PLF_MMAP_H
diff -Naur orig/hal/arm/netarm/current/src/netarm_misc.c new/hal/arm/netarm/current/src/netarm_misc.c
--- orig/hal/arm/netarm/current/src/netarm_misc.c	2004-11-29 17:35:48.000000000 +0100
+++ new/hal/arm/netarm/current/src/netarm_misc.c	2005-02-22 11:57:58.296703200 +0100
@@ -7,15 +7,15 @@
 //==========================================================================
 //==========================================================================
 //#####DESCRIPTIONBEGIN####
-// 
+//
 // Author(s):    Peter De Schrijver (p2@mind.be)
 // Contributors: Peter De Schrijver (p2@mind.be)
 // Date:         2002-10-25
 // Purpose:      HAL board support
 // Description:  Implementations of HAL board interfaces
-// 
+//
 //####DESCRIPTIONEND####
-// 
+//
 //========================================================================*/
 
 #include <pkgconf/hal.h>
@@ -29,7 +29,7 @@
 #include <cyg/hal/hal_io.h>             // IO macros
 #include <cyg/hal/hal_arch.h>           // Register state info
 #include <cyg/hal/hal_diag.h>
-#include <cyg/hal/hal_intr.h>           // Interrupt names 
+#include <cyg/hal/hal_intr.h>           // Interrupt names
 #include <cyg/hal/hal_cache.h>
 #include <cyg/hal/hal_netarm.h>         // Hardware definitions
 #include <cyg/hal/hal_if.h>             // calling interface API
@@ -74,9 +74,9 @@
 void hal_clock_read(cyg_uint32 *pvalue) {
 
 	static cyg_uint32 clock_val;
-	
-	clock_val=*TIMERSTAT1 & 0x1ff; 
-	*pvalue = (cyg_uint32)(_period - clock_val); 
+
+	clock_val=*TIMERSTAT1 & 0x1ff;
+	*pvalue = (cyg_uint32)(_period - clock_val);
 
 }
 
@@ -97,24 +97,19 @@
 
 void hal_hardware_init(void) {
 
+#if defined (CYGSEM_HAL_ENABLE_ICACHE_ON_STARTUP) ||	\
+	defined (CYGSEM_HAL_ENABLE_DCACHE_ON_STARTUP)
 
-#ifdef ENABLECACHE
-	/* CS1 BSIZE = 4 */
-	*OR1&=~(3 << 4);
-	*OR1|=1 << 4;
-	
-	HAL_ICACHE_ENABLE();
-#endif /* ENABLECACHE */
+	HAL_CACHE_ENABLE();
 
+#endif /* ENABLECACHE */
 
 	*INTENABLE_CLR=0xffffffff;
-			
+
 	hal_clock_initialize(CYGNUM_HAL_RTC_PERIOD);
 
 	hal_if_init();
 
-//	HAL_ICACHE_DISABLE();
-
 }
 
 int hal_spurious_ints;
@@ -125,8 +120,8 @@
 	int i;
 
 	stat=*INTSTATUS;
-	
-	for(i=0;i<CYGNUM_HAL_ISR_MAX;i++) 
+
+	for(i=0;i<CYGNUM_HAL_ISR_MAX;i++)
 		if(stat & (1<<i))
 			return i+1;
 
@@ -154,7 +149,7 @@
 
 	if((vector>=CYGNUM_HAL_INTERRUPT_C0) && (vector<=CYGNUM_HAL_INTERRUPT_C3)) {
 		*PORTC|=1<< (vector+23);
-    	if(up) 
+    	if(up)
 			*PORTC|=1<< (vector+15);
 		else
 			*PORTC&=~(1<< (vector+15));

⌨️ 快捷键说明

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