This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Creating a drop in replacement for the pcmb package


On Tue, 2001-10-02 at 21:50, Jonathan Larmour wrote:
> Ian Campbell wrote:
> > The other attached patch (memsize-fixes.patch - which I am posting more
> > for comment than inclusion since it may not be the correct approach) is
> > to allow the memory size to be hardcoded. The display attributes in the
> > CDL have FIXMEs because I am not entirely sure how to describe what they
> > are. I'm also not convinced by my choice of option names.
> 
> That's very good for a CDL newbie though! I think CYGNUM_HAL_MEMSIZE would
> be better as CYGPKG_HAL_I386_PCMB_MEMSIZE. 

I've attached a new version of the patch with this new name, and what I
hope are more correct descriptions. Patch also includes the RTC_PERIOD
change below (they were v. close in the source, which makes splitting
the two patches a pain..)

> 
> > I would like to be able to change the value of CYGNUM_HAL_RTC_PERIOD in
> > hal_i386_pcmb.cdl, however it is defined using a 'calculated' statement.
> > Is there any problem with making this into a 'default_value'?
> 
> Yeah, for now; although I'd be tempted just to move it down into the
> platform. I take it the merlin doesn't use an 8253 compatible PIT then?

As I understand it, the PIT is 8253 compatible, but the crystal is not
PC standard frequency. The 386EX has a pre-scale register which scales
the clock input for the PIT. The upshot is that PIT0 needs a
non-standard count to generate the 18.2Hz clock.

Cheers,
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.7
diff -u -r1.7 ChangeLog
--- packages/hal/i386/pcmb/current/ChangeLog	2001/10/05 15:31:49	1.7
+++ packages/hal/i386/pcmb/current/ChangeLog	2001/10/08 12:47:28
@@ -1,3 +1,12 @@
+2001-10-08  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-01  Ian Campbell  <icampbell@arcom.co.uk>
 
 	* include/pcmb_io.h: Include CYGBLD_HAL_PLATFORM_H rather than
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/08 12:36:54
@@ -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/08 12:36:54
@@ -70,6 +70,12 @@
 
 void hal_pcmb_init(void)
 {
+#ifdef CYG_HAL_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 CYG_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
 }
 
 /*------------------------------------------------------------------------*/

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]