[openfirmware] r1261 - cpu/x86/pc/olpc/via

svn at openfirmware.info svn at openfirmware.info
Fri Jul 31 11:27:05 CEST 2009


Author: wmb
Date: 2009-07-31 11:27:04 +0200 (Fri, 31 Jul 2009)
New Revision: 1261

Added:
   cpu/x86/pc/olpc/via/cmos.fth
Modified:
   cpu/x86/pc/olpc/via/devices.fth
Log:
Via - fixed CMOS RAM high ban access (see trac 9431).


Added: cpu/x86/pc/olpc/via/cmos.fth
===================================================================
--- cpu/x86/pc/olpc/via/cmos.fth	                        (rev 0)
+++ cpu/x86/pc/olpc/via/cmos.fth	2009-07-31 09:27:04 UTC (rev 1261)
@@ -0,0 +1,50 @@
+\ See license at end of file
+purpose: Access to CMOS RAM on Via VX855
+
+: cmos-setup  ( index -- data-reg  )
+   dup h# 80 and  if
+      h# 74  pc!  h# 75
+   else
+      h# 70  pc!  h# 71
+   then
+;
+
+: cmos@  ( index -- b )  lock[  cmos-setup  pc@  ]unlock  ;
+
+: cmos!  ( b index -- )  lock[  cmos-setup  pc!  ]unlock  ;
+
+: bios-checksum-bad?  ( -- flag )
+   0  h# 2d  h# 10  do  i cmos@ +  loop   ( sum )
+   h# 2f cmos@  h# 2e cmos@  bwjoin  <>
+;
+
+\ Zero is the right checksum for zero data
+: init-bios-cmos  ( -- )  h# 30 h# 10  do  0 i cmos!  loop  ;
+
+stand-init: CMOS
+   bios-checksum-bad?  if  init-bios-cmos  then
+;
+
+\ LICENSE_BEGIN
+\ Copyright (c) 2006 FirmWorks
+\ 
+\ Permission is hereby granted, free of charge, to any person obtaining
+\ a copy of this software and associated documentation files (the
+\ "Software"), to deal in the Software without restriction, including
+\ without limitation the rights to use, copy, modify, merge, publish,
+\ distribute, sublicense, and/or sell copies of the Software, and to
+\ permit persons to whom the Software is furnished to do so, subject to
+\ the following conditions:
+\ 
+\ The above copyright notice and this permission notice shall be
+\ included in all copies or substantial portions of the Software.
+\ 
+\ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+\ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+\ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+\ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+\ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+\ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+\ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+\
+\ LICENSE_END

Modified: cpu/x86/pc/olpc/via/devices.fth
===================================================================
--- cpu/x86/pc/olpc/via/devices.fth	2009-07-29 21:45:59 UTC (rev 1260)
+++ cpu/x86/pc/olpc/via/devices.fth	2009-07-31 09:27:04 UTC (rev 1261)
@@ -160,7 +160,7 @@
 \ XXX remove the OS file commands from tools.dic
 fload ${BP}/ofw/core/filecmds.fth	\ File commands: dir, del, ren, etc.
 
-fload ${BP}/cpu/x86/pc/olpc/cmos.fth     \ CMOS RAM indices are 1f..ff , above RTC
+fload ${BP}/cpu/x86/pc/olpc/via/cmos.fth  \ CMOS RAM indices are 1f..ff , above RTC
 .( XXX Not clearing CMOS) cr
 patch noop init-bios-cmos stand-init
 




More information about the openfirmware mailing list