[ECOS] [PATCHES] Update to pcmb memory sizing and two tiny fixes

Ian Campbell icampbell@arcom.co.uk
Fri Oct 19 06:29:00 GMT 2001


Hi all,

Sometime ago I sent memsize-fixes.patch to the list which allows the
choice at compile time of hardcoding the memory regions or probing the
BIOS. Fortunately this patch doesn't seem to have been applied yet as it
contains a glaring error. At some point I renamed the CDL option, but
neglected to also rename the #ifdef in the c file. I have attached
memsize-fixes-2.patch which is corrected. (It also changes
CYGNUM_HAL_RTC_PERIOD to use default_value rather than calculated, which
allows the value to be overriden in the board specific HAL)

In the process of getting the FLASH to work on our board I noticed that
the macro HAL_[ID]CACHE_IS_ENABLED was not defined for i386 targets
(preventing the flash stuff from building). The attached patch
'cache-is-enabled.patch' implements this in the spirit of the other i386
CACHE macros (ie does nothing).

Finally, I tried to use the tcp-echo test in the net package, the target
part was unable to setup it's network via DHCP, I think because the main
thread and load threads were of higher priority then the networking
thread, so the DHCP replies were not received. tcp-echo-test.patch
delays the starting of the load threads until after the network is
initialised and starts the main thread with a lower priority, bumping it
up after the network has initialised.

Thanks,
Ian.


-- 
Ian Campbell
Design Engineer

Arcom Control Systems Ltd,
Clifton Road,
Cambridge CB1 7EA
United Kingdom

Tel: +44 (0)1223 411200 ext. 3204
E-Mail: icampbell@arcom.co.uk
Web: http://www.arcomcontrols.com


_____________________________________________________________________
The message in this transmission is sent in confidence for the attention of the addressee only and should not be disclosed to any other party. Unauthorised recipients are requested to preserve this confidentiality. Please advise the sender if the addressee is not resident at the receiving end.

This message has been checked for all viruses by MessageLabs Virus Control Centre. 

Company registered in England No. 1608562.
Registered Office: Unit 8, Clifton Road, Cambridge, CB1 7EA, United Kingdom, Tel: 01223 411200.
Index: packages/hal/i386/pcmb/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/i386/pcmb/current/ChangeLog,v
retrieving revision 1.8
diff -u -r1.8 ChangeLog
--- packages/hal/i386/pcmb/current/ChangeLog	2001/10/19 07:02:34	1.8
+++ packages/hal/i386/pcmb/current/ChangeLog	2001/10/19 12:43:56
@@ -1,3 +1,12 @@
+2001-10-19  Ian Campbell  <icampbell@arcom.co.uk>
+
+	* cdl/hal_i386_pcmb.cdl: Add cdl_options for
+	CYGPKG_HAL_I386_PCMB_MEMSIZE to allow configuration of how memory
+	is detected. Change CYGNUM_HAL_RTC_PERIOD to use default_value
+	rather than calculated (so it can be overridden in the platform).
+	* src/pcmb_misc.c: Implement CYGPKG_HAL_I386_PCMB_MEMSIZE
+	configuration options.
+	
 2001-10-16  Mark Salter  <msalter@redhat.com>
 
 	* src/pcmb_serial.c (cyg_hal_plf_serial_init): Use CDL to determine
Index: packages/hal/i386/pcmb/current/cdl/hal_i386_pcmb.cdl
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/i386/pcmb/current/cdl/hal_i386_pcmb.cdl,v
retrieving revision 1.3
diff -u -r1.3 hal_i386_pcmb.cdl
--- packages/hal/i386/pcmb/current/cdl/hal_i386_pcmb.cdl	2001/09/12 00:59:23	1.3
+++ packages/hal/i386/pcmb/current/cdl/hal_i386_pcmb.cdl	2001/10/19 12:43:56
@@ -83,11 +83,36 @@
         cdl_option CYGNUM_HAL_RTC_PERIOD {
             display       "Real-time clock period"
             flavor        data
-           calculated     11932
+	    default_value 11932
         }
     }
 
-    
+    cdl_component CYGPKG_HAL_I386_PCMB_MEMSIZE {
+	display       "How to discover the size of available RAM."
+	flavor        data
+	legal_values  {"BIOS" "HARDCODE"}
+	default_value {"BIOS"}
+	description   "It is possible for the HAL to discover the 
+	               size of RAM In several ways. Currently this
+                       can be done by querying the BIOS or by 
+                       hardcoding the values into the executable."
+
+	cdl_option CYGPKG_HAL_I386_PCMB_MEMSIZE_BASE {
+	    display       "Amount of Base RAM available."
+	    flavor        data
+	    default_value 0x000F0000
+	    active_if     { CYGPKG_HAL_I386_PCMB_MEMSIZE == "HARDCODE" }
+	}
+
+	cdl_option CYGPKG_HAL_I386_PCMB_MEMSIZE_EXTENDED {
+	    display       "Amount of Extended RAM available."
+	    flavor        data
+	    default_value 0x00100000
+	    active_if     { CYGPKG_HAL_I386_PCMB_MEMSIZE == "HARDCODE" }
+	}
+
+    }
+
     cdl_interface CYGINT_HAL_I386_PCMB_SCREEN_SUPPORT {
 	display       "Enable PC screen support"
 	compile       pcmb_screen.c
Index: packages/hal/i386/pcmb/current/src/pcmb_misc.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/i386/pcmb/current/src/pcmb_misc.c,v
retrieving revision 1.3
diff -u -r1.3 pcmb_misc.c
--- packages/hal/i386/pcmb/current/src/pcmb_misc.c	2001/09/12 00:59:23	1.3
+++ packages/hal/i386/pcmb/current/src/pcmb_misc.c	2001/10/19 12:43:56
@@ -70,6 +70,12 @@
 
 void hal_pcmb_init(void)
 {
+#ifdef CYGPKG_HAL_I386_PCMB_MEMSIZE_HARDCODE
+    cyg_hal_pcmb_memsize_base = CYGPKG_HAL_I386_PCMB_MEMSIZE_BASE;
+    cyg_hal_pcmb_memsize_extended = CYGPKG_HAL_I386_PCMB_MEMSIZE_EXTENDED;
+#endif
+
+#ifdef CYGPKG_HAL_I386_PCMB_HAL_MEMSIZE_BIOS
     cyg_uint8 lo,hi;
     
     HAL_READ_CMOS( 0x15, lo );
@@ -89,7 +95,7 @@
 #endif
 
     cyg_hal_pcmb_memsize_extended = ((hi<<8)+lo)*1024;
-
+#endif
 }
 
 /*------------------------------------------------------------------------*/


More information about the Ecos-discuss mailing list