[openfirmware] r1152 - in cpu/x86: . pc pc/biosload

svn at openfirmware.info svn at openfirmware.info
Sat Apr 18 21:19:30 CEST 2009


Author: wmb
Date: 2009-04-18 21:19:30 +0200 (Sat, 18 Apr 2009)
New Revision: 1152

Added:
   cpu/x86/pc/biosload/config-via.fth
Modified:
   cpu/x86/pc/biosload/addrs.fth
   cpu/x86/pc/biosload/biostart.bth
   cpu/x86/pc/biosload/ofw.bth
   cpu/x86/pc/biosload/reset.bth
   cpu/x86/pc/biosload/start.bth
   cpu/x86/pc/biosload/usb.fth
   cpu/x86/pc/ramtest.fth
   cpu/x86/startmacros.fth
Log:
biosload version - support Via demo board






Modified: cpu/x86/pc/biosload/addrs.fth
===================================================================
--- cpu/x86/pc/biosload/addrs.fth	2009-04-18 19:16:40 UTC (rev 1151)
+++ cpu/x86/pc/biosload/addrs.fth	2009-04-18 19:19:30 UTC (rev 1152)
@@ -49,6 +49,21 @@
                   h#   08.0000 constant dropin-size
 [then]
 
+[ifdef] via-demo
+\ Don't assume a lot of memory (256M for most versions, 128M for a few)
+\needs fw-pa      h#  e00.0000 constant fw-pa     \ OFW dictionary location
+\needs /fw-ram    h#   20.0000 constant /fw-ram
+
+\needs heap-base  h#  e20.0000 constant heap-base \ Dynamic allocation heap
+\needs heap-size  h#   20.0000 constant heap-size
+
+\needs dma-base   h#  e40.0000 constant dma-base  \ DMA heap
+\needs dma-size   h#   20.0000 constant dma-size
+
+                  h#  e60.0000 constant dropin-base  \ Location of payload in RAM
+                  h#   08.0000 constant dropin-size
+[then]
+
 \needs dropin-base  h# 198.0000 constant dropin-base
 \needs dropin-size  h#   8.0000 constant dropin-size
 \needs ResetBase    dropin-base h# 20 +  constant ResetBase	\ Location of "reset" dropin in ROM

Modified: cpu/x86/pc/biosload/biostart.bth
===================================================================
--- cpu/x86/pc/biosload/biostart.bth	2009-04-18 19:16:40 UTC (rev 1151)
+++ cpu/x86/pc/biosload/biostart.bth	2009-04-18 19:19:30 UTC (rev 1152)
@@ -8,8 +8,6 @@
 
 fload ${BP}/cpu/x86/asmtools.fth
 
-create debug-startup
-
 : le-w,  here  /w allot  le-w!  ;
 : le-l,  here  /l allot  le-l!  ;
 
@@ -29,15 +27,7 @@
    "  # dx mov   # al mov   al dx out " evaluate
 ;
 
-: v-report  ( char -- )
-   " # al mov  al h# b8000 #) mov  h# 1d # al mov  al h# b8001 #) mov" evaluate
-;
-: vr-report  ( char -- )  \ Real mode version
-   " ds push  h# b000 # push ds pop" evaluate   
-   " # al mov  al h# 8000 #) mov   h# 1d # al mov  al h# 8001 #) mov"  evaluate
-   " ds pop" evaluate
-;
-
+fload ${BP}/cpu/x86/pc/egareport.fth			\ Startup reports
 fload ${BP}/cpu/x86/pc/report.fth			\ Startup reports
 
 start-assembling
@@ -150,9 +140,9 @@
 
 ascii 5 vr-report
 
-carret report
-linefeed report
-ascii F report
+\ carret report
+\ linefeed report
+\ ascii F report
 
 \ copy GDT template to a fixed place in memory (gdt-pa)
 
@@ -222,9 +212,9 @@
       stacktop #  sp  mov	\ Initialize the 32-bit stack pointer
 
 ascii 6 v-report
-ascii o report
+\ ascii o report
 
-ascii r report
+\ ascii r report
 
       0 #  si mov  here 4 - >r	\ Get offset to following dropins
       cx    si add		\ Absolute address of following dropins

Added: cpu/x86/pc/biosload/config-via.fth
===================================================================
--- cpu/x86/pc/biosload/config-via.fth	                        (rev 0)
+++ cpu/x86/pc/biosload/config-via.fth	2009-04-18 19:19:30 UTC (rev 1152)
@@ -0,0 +1,55 @@
+\ See license at end of file
+purpose: Configuration for loading from a USB key via Syslinux
+
+\ --- The environment that "boots" OFW ---
+\ - Image Format - Example Media - previous stage bootloader
+
+\ - (Syslinux) COM32 format - USB Key w/ FAT FS - Syslinux
+create syslinux-loaded
+
+create via-demo
+
+create debug-startup
+
+\ create serial-console
+create use-usb-debug-port
+create pc
+
+\ create pseudo-nvram
+create resident-packages
+create addresses-assigned  \ Don't reassign PCI addresses
+\ create virtual-mode
+create use-root-isa
+create use-isa-ide
+create use-ega
+create use-elf
+create use-watch-all
+\ create use-null-nvram
+create pseudo-nvram
+create no-floppy-node
+
+fload ${BP}/cpu/x86/pc/biosload/addrs.fth
+
+\ 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/biosload/ofw.bth
===================================================================
--- cpu/x86/pc/biosload/ofw.bth	2009-04-18 19:16:40 UTC (rev 1151)
+++ cpu/x86/pc/biosload/ofw.bth	2009-04-18 19:19:30 UTC (rev 1152)
@@ -87,6 +87,11 @@
    " ${BP}/dev/pci/build/pcibridg.fc"           " class060400"     $add-deflated-dropin
    " ${BP}/dev/ide/build/leghier.fc"            " class01018a"     $add-deflated-dropin
 
+   " ${BP}/dev/mmc/sdhci/build/sdhci.fc"        " class080501"     $add-deflated-dropin
+   " ${BP}/dev/mmc/sdhci/build/sdmmc.fc"        " sdmmc"           $add-deflated-dropin
+
+   " ${BP}/dev/usb2/hcd/ehci/build/ehci.fc"	" class0c0320"     $add-deflated-dropin
+
    " ${BP}/dev/usb2/hcd/uhci/build/uhci.fc"	" class0c0300"     $add-deflated-dropin
    " ${BP}/dev/usb2/hcd/ohci/build/ohci.fc"	" class0c0310"     $add-deflated-dropin
    " ${BP}/dev/usb2/hcd/ehci/build/ehci.fc"	" class0c0320"     $add-deflated-dropin

Modified: cpu/x86/pc/biosload/reset.bth
===================================================================
--- cpu/x86/pc/biosload/reset.bth	2009-04-18 19:16:40 UTC (rev 1151)
+++ cpu/x86/pc/biosload/reset.bth	2009-04-18 19:19:30 UTC (rev 1152)
@@ -4,8 +4,6 @@
 command: &builder &this
 build-now
 
-create debug-startup
-
 fload ${BP}/cpu/x86/pc/biosload/config.fth
 
 \needs start-assembling  fload ${BP}/cpu/x86/asmtools.fth
@@ -72,7 +70,7 @@
    80  70  isa-c!		\ Disable NMI
    71 # dx mov  dx al in	\ Why do we do this?
 
-[ifdef] debug-startup
+[ifdef] intel-chip-stuff
 h# 8000.f880 # ax mov  h# cf8 # dx mov  ax dx out
 h# 140f.0010 # ax mov  h# cfc # dx mov  ax dx out  \ Set LPC decoding
 
@@ -132,7 +130,9 @@
 \ h# 60 # al mov  al h# 2e # out  h#  6 # al mov  al h# 2f # out  \ High address
 \ h# 61 # al mov  al h# 2e # out  h# 80 # al mov  al h# 2f # out  \ Low address
 \ h# 30 # al mov  al h# 2e # out  h#  1 # al mov  al h# 2f # out  \ Enable
+[then]
 
+[ifdef] debug-startup
 init-com1
 
 carret report

Modified: cpu/x86/pc/biosload/start.bth
===================================================================
--- cpu/x86/pc/biosload/start.bth	2009-04-18 19:16:40 UTC (rev 1151)
+++ cpu/x86/pc/biosload/start.bth	2009-04-18 19:19:30 UTC (rev 1152)
@@ -7,18 +7,15 @@
 \needs start-assembling  fload ${BP}/cpu/x86/asmtools.fth
 \needs write-dropin      fload ${BP}/forth/lib/mkdropin.fth
 
-create debug-startup
-
 hex
 
-fload ${BP}/cpu/x86/pc/report.fth			\ Startup reports
-
 fload ${BP}/cpu/x86/pc/biosload/config.fth
 
+fload ${BP}/cpu/x86/pc/report.fth			\ Startup reports
+
 start-assembling
 
 label my-entry
-
 [ifdef] debug-startup
    e9 c,  0 ,				\ To be patched later
 end-code
@@ -30,7 +27,6 @@
 [ifdef] debug-startup
 \ ascii x report
 [then]
-
    ret
 end-code
 

Modified: cpu/x86/pc/biosload/usb.fth
===================================================================
--- cpu/x86/pc/biosload/usb.fth	2009-04-18 19:16:40 UTC (rev 1151)
+++ cpu/x86/pc/biosload/usb.fth	2009-04-18 19:19:30 UTC (rev 1152)
@@ -14,6 +14,11 @@
 
 : (probe-usb2)  ( -- )
    " device_type" get-property  if  exit  then
+[ifdef] use-usb-debug-port
+   \ I haven't figured out how to turn on the EHCI cleanly
+   \ when the Debug Port is running
+   dbgp-off
+[then]
    get-encoded-string  " ehci" $=  if
       pwd$ open-dev  ?dup  if  close-dev  then
    then
@@ -52,8 +57,13 @@
       drop " /usb"  comp  0=  if  ( )
          red-letters  ." Using USB keyboard." cr  black-letters
          " keyboard" input
+         exit
       then
    then
+   " /usb/serial" open-dev  ?dup  if
+      red-letters  ." Using USB serial console." cr  black-letters
+      dup set-stdin set-stdout
+   then
 ;
 
 \ Unlink every node whose phys.hi component matches port

Modified: cpu/x86/pc/ramtest.fth
===================================================================
--- cpu/x86/pc/ramtest.fth	2009-04-18 19:16:40 UTC (rev 1151)
+++ cpu/x86/pc/ramtest.fth	2009-04-18 19:19:30 UTC (rev 1152)
@@ -3,15 +3,15 @@
 
 ascii I report  ascii n report  ascii c report  
 carret report  linefeed report
-here asm-base - ResetBase + .x cr
-0 # ax mov
+\ here asm-base - ResetBase + .x cr
+ramtest-start # ax mov
 begin
    ax 0 [ax] mov
    4 # ax add
-   h# 10.0000 # ax cmp
+   ramtest-end # ax cmp
 0= until
 
-0 # ax mov
+ramtest-start # ax mov
 begin
    0 [ax] bx mov
    ax bx cmp  <>  if
@@ -19,21 +19,21 @@
       begin again
    then
    4 # ax add
-   h# 10.000 # ax cmp
+   ramtest-end # ax cmp
 0= until
 ascii G report  ascii o report  ascii o report  ascii d report
 carret report  linefeed report
 
 ascii P report  ascii a report  ascii t report  ascii 5 report  
 carret report  linefeed report
-0 # ax mov
+ramtest-start # ax mov
 begin
    h# 55555555 # 0 [ax] mov
    4 # ax add
-   h# 10.0000 # ax cmp
+   ramtest-end # ax cmp
 0= until
 
-0 # ax mov
+ramtest-start # ax mov
 begin
    0 [ax] bx mov
    h# 55555555 # bx cmp  <>  if
@@ -41,21 +41,21 @@
       begin again
    then
    4 # ax add
-   h# 10.000 ax # cmp
+   ramtest-end ax # cmp
 0= until
 ascii G report  ascii o report  ascii o report  ascii d report
 carret report  linefeed report
 
 ascii P report  ascii a report  ascii t report  ascii A report  
 carret report  linefeed report
-0 # ax mov
+ramtest-start # ax mov
 begin
    h# aaaaaaaa # 0 [ax] mov
    4 # ax add
-   h# 10.0000 # ax cmp
+   ramtest-end # ax cmp
 0= until
 
-0 # ax mov
+ramtest-start # ax mov
 begin
    0 [ax] bx mov
    h# aaaaaaaa # bx cmp  <>  if
@@ -63,7 +63,7 @@
       begin again
    then
    4 # ax add
-   h# 10.000 # ax cmp
+   ramtest-end # ax cmp
 0= until
 ascii G report  ascii o report  ascii o report  ascii d report
 carret report  linefeed report

Modified: cpu/x86/startmacros.fth
===================================================================
--- cpu/x86/startmacros.fth	2009-04-18 19:16:40 UTC (rev 1151)
+++ cpu/x86/startmacros.fth	2009-04-18 19:19:30 UTC (rev 1152)
@@ -111,6 +111,11 @@
    ax ax xor
    op: dx ax in
 ;
+: config-wb  ( b config-adr -- )
+   config-setup     ( )
+   # al  mov        ( )
+   al dx out
+;
 : config-rb  ( config-adr -- )  \ Returns value in AL
    config-setup     ( )
    ax ax xor




More information about the openfirmware mailing list