Author: wmb Date: Wed Aug 11 09:04:29 2010 New Revision: 1932 URL: http://tracker.coreboot.org/trac/openfirmware/changeset/1932
Log: ARM - The build target is now back to ofw.rom, not mmp2.rom
Added: cpu/arm/mmp2/ofw.bth - copied unchanged from r1924, cpu/arm/mmp2/fw.bth Deleted: cpu/arm/mmp2/fw.bth Modified: cpu/arm/mmp2/build/Makefile cpu/arm/mmp2/mmp2.bth
Modified: cpu/arm/mmp2/build/Makefile ============================================================================== --- cpu/arm/mmp2/build/Makefile Wed Aug 11 07:39:50 2010 (r1931) +++ cpu/arm/mmp2/build/Makefile Wed Aug 11 09:04:29 2010 (r1932) @@ -9,14 +9,14 @@ CLIENTDIR=../../../../clients CLIENTPROGS=
-all: mmp2.rom tags +all: ofw.rom tags
-mmp2.tag: mmp2.rom +ofw.tag: ofw.rom
-tags: mmp2.tag +tags: ofw.tag @${BASEDIR}/forth/lib/toctags ${BASEDIR} ${TAGFILES}
-mmp2.rom: FORCE build ${CLIENTPROGS} ../../../${HOSTCPU}/${OS}/forth +ofw.rom: FORCE build ${CLIENTPROGS} ../../../${HOSTCPU}/${OS}/forth ./build $@
../../../${HOSTCPU}/${OS}/forth:
Modified: cpu/arm/mmp2/mmp2.bth ============================================================================== --- cpu/arm/mmp2/mmp2.bth Wed Aug 11 07:39:50 2010 (r1931) +++ cpu/arm/mmp2/mmp2.bth Wed Aug 11 09:04:29 2010 (r1932) @@ -194,6 +194,8 @@
.( --- Saving mmp2.rom --- ) cr " mmp2.rom" $save-rom
+interact + \ LICENSE_BEGIN \ Copyright (c) 2010 FirmWorks \
Copied: cpu/arm/mmp2/ofw.bth (from r1924, cpu/arm/mmp2/fw.bth) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ cpu/arm/mmp2/ofw.bth Wed Aug 11 09:04:29 2010 (r1932, copy of r1924, cpu/arm/mmp2/fw.bth) @@ -0,0 +1,526 @@ +purpose: Build Open Firmware for Marvell MMP2 +\ See license at end of file + +dictionary: ${BP}/cpu/arm/build/basefw.dic +command: &armforth &dictionary &this +build-now + +" fw.tag" r/w create-file drop tag-file ! + +hex +\ ' $report-name is include-hook +' noop is include-hook + +fload ${BP}/cpu/arm/mmp2/config.fth + +: headerless ; : headers ; : headerless0 ; + +' (quit) to quit + +: \Tags [compile] \ ; immediate +: \NotTags [compile] \ ; immediate + +: RAMbase ( -- adr ) fw-virt-base ; +: RAMtop ( -- adr ) RAMbase /fw-ram + ; + +def-load-base ' load-base set-config-int-default + +use-movable-vector-base \ Marvell CPU core has a movable vector base + +true ' fcode-debug? set-config-int-default +\ false ' auto-boot? set-config-int-default + + + +[ifdef] serial-console +" com1" ' output-device set-config-string-default +" com1" ' input-device set-config-string-default +[then] + + +fload ${BP}/cpu/arm/mmp2/rootnode.fth \ Root node mapping - physical mode +dev / + " Marvell,Bonnell" model + " Marvell,Armada 610" encode-string " architecture" property +\ The clock frequency of the root bus may be irrelevant, since the bus is internal to the SOC +\ d# 1,000,000,000 " clock-frequency" integer-property +device-end + +: (cpu-arch ( -- adr len ) + " architecture" ['] root-node get-package-property drop + get-encoded-string +; +' (cpu-arch to cpu-arch + +\ Memory management services +[ifdef] virtual-mode +fload ${BP}/ofw/core/clntmem1.fth \ client services for memory +[else] +fload ${BP}/ofw/core/clntphy1.fth \ client services for memory +: >physical ( va -- pa ) + dup fw-virt-base - fw-virt-size u< if ( va ) + fw-virt-base - fw-pa + + then +; +[then] +fload ${BP}/ofw/core/memlist.fth \ Resource list common routines +fload ${BP}/ofw/core/showlist.fth \ Linked list display tool +fload ${BP}/ofw/core/allocph1.fth \ S Physical memory allocator +fload ${BP}/ofw/core/availpm.fth \ Available memory list + +fload ${BP}/cpu/arm/mmp2/probemem.fth \ Memory probing + +stand-init: Probing memory + " probe" memory-node @ $call-method +; + +[ifdef] virtual-mode +fload ${BP}/cpu/arm/loadvmem.fth \ /mmu node +stand-init: MMU + " /mmu" open-dev mmu-node ! +; +fload ${BP}/ofw/core/initdict.fth \ Dynamic dictionary allocation +fload ${BP}/arch/arm/loadarea.fth \ Allocate and map program load area +[else] +fload ${BP}/cpu/arm/mmp2/mmuon.fth +[then] + +\ XXX should be elsewhere +dev /client-services +: chain ( len args entry size virt -- ) + release ( len args entry ) + h# 8000 alloc-mem h# 8000 + (init-program) ( len args ) + to r1 to r2 + go +; +device-end + +fload ${BP}/cpu/arm/crc32.fth \ Assembly language Zip CRC calculation +fload ${BP}/forth/lib/crc32.fth \ High-level portion of CRC calculation + +[ifdef] resident-packages + +\needs unix-seconds> fload ${BP}/ofw/fs/unixtime.fth \ Unix time calculation +support-package: ext2-file-system + fload ${BP}/ofw/fs/ext2fs/ext2fs.fth \ Linux file system +end-support-package + +[ifdef] jffs2-support +\needs unix-seconds> fload ${BP}/ofw/fs/unixtime.fth \ Unix time calculation +support-package: jffs2-file-system + fload ${BP}/ofw/fs/jffs2/jffs2.fth \ Journaling flash file system 2 +end-support-package +[then] + +support-package: zip-file-system + fload ${BP}/ofw/fs/zipfs.fth \ Zip file system +end-support-package + +support-package: dropin-file-system + fload ${BP}/ofw/fs/dropinfs.fth \ Dropin file system +end-support-package +[then] + +fload ${BP}/ofw/core/osfile.fth \ For testing + +\ Load file format handlers + +: call32 ; + +fload ${BP}/ofw/core/allocsym.fth \ Allocate memory for symbol table +fload ${BP}/ofw/core/symcif.fth +fload ${BP}/ofw/core/symdebug.fth +: release-load-area ( boundary-adr -- ) drop ; + +[ifdef] use-elf +fload ${BP}/ofw/elf/elf.fth +fload ${BP}/ofw/elf/elfdebug.fth +[ifdef] virtual-mode +\ Depends on the assumption that physical memory is mapped 1:1 already +: (elf-map-in) ( va size -- ) 0 mem-claim drop ; +[else] +: (elf-map-in) ( va size -- ) 2drop ; +[then] +' (elf-map-in) is elf-map-in +[then] + +\ Reboot and re-entry code +fload ${BP}/ofw/core/reboot.fth \ Restart the client program +fload ${BP}/ofw/core/reenter.fth \ Various entries into Forth + +headerless +[ifdef] virtual-mode +: (initial-heap) ( -- adr len ) sp0 @ ps-size - dict-limit tuck - ; +[else] + \ : (initial-heap) ( -- adr len ) RAMtop heap-size ; +: (initial-heap) ( -- adr len ) limit heap-size ; +[then] +' (initial-heap) is initial-heap +headers + +" /openprom" find-device + " FirmWorks,3.0" encode-string " model" property +device-end + +[ifdef] virtual-mode +fload ${BP}/cpu/arm/mmusetup.fth \ Initial values for MMU lists +[then] + +: background-rgb ( -- r g b ) h# ff h# ff h# ff ; + +fload ${BP}/cpu/arm/mmp2/devices.fth + +[ifndef] virtual-mode +warning off +: stand-init-io + stand-init-io + go-fast \ From mmuon.fth +; +warning on +[then] + +true ' local-mac-address? set-config-int-default +[ifdef] resident-packages +support-package: nfs + fload ${BP}/ofw/fs/nfs/loadpkg.fth +end-support-package + +[then] +devalias nfs net//obp-tftp:last//nfs + +fload ${BP}/cpu/arm/linux.fth +h# 20.0000 to linux-params \ The Jasper Linux kernel fails unless the params are between 0x20.0000 and 0x20.4000 +d# 2382 to arm-linux-machine-type \ Marvell Jasper + +\ Add a tag describing the linear frame buffer +: mmp-fb-tag, ( -- ) + 8 tag-l, + h# 54410008 tag-l, \ ATAG_VIDEOLFB + d# 800 tag-w, \ Width + d# 480 tag-w, \ Height + d# 24 tag-w, \ Depth + d# 800 3 * tag-w, \ Pitch + fb-pa tag-l, \ Base address + d# 800 3 * d# 480 * tag-l, \ Total size - perhaps could be larger + 8 tag-b, \ Red size + d# 0 tag-b, \ Red position + 8 tag-b, \ Green size + d# 8 tag-b, \ Green position + 8 tag-b, \ Blue size + d# 16 tag-b, \ Blue position + 0 tag-b, \ Rsvd size + d# 24 tag-b, \ Rsvd position +; +\ ' mmp-fb-tag, to fb-tag, + +\ fload ${BP}/cpu/arm/mmp2/usb.fth + +false to stand-init-debug? +\ true to stand-init-debug? + +: protect-fw ( -- ) ; +: usb-power-on ( -- ) ; + +hex +: i-key-wait ( ms -- pressed? ) + cr ." Type 'i' to interrupt stand-init sequence" cr ( ms ) + 0 do + ukey? if + ukey upc ascii I = if true unloop exit then + then + 1 ms + loop + false +; + +warning @ warning off +: init +\ initial-heap add-memory + init + + standalone? if + disable-interrupts +[ifdef] notdef + d# 1000 + i-key-wait if +\ protect-fw + ." Interacting" cr hex interact + then + \ Turn on USB power here to overlap the time with other startup actions + usb-power-on +[then] + then +; +warning ! +[then] + +: (.firmware) ( -- ) + ." Open Firmware " .built cr + ." Copyright 2010 FirmWorks All Rights Reserved" cr +; +' (.firmware) to .firmware + +fload ${BP}/ofw/gui/bmptools.fth +fload ${BP}/dev/null.fth +fload ${BP}/ofw/core/bailout.fth + +\ GUI +false value gui-safeboot? + +: 2tuck ( d1 d2 -- d2 d1 d2 ) 2swap 2over ; +: user-ok "ok" ; \ This is supposed to check for authorization +true value user-mode? + +fload ${BP}/ofw/gui/loadmenu.fth +\ fload ${BP}/ofw/gui/insticon.fth + +\ Uninstall the diag menu from the general user interface vector +\ so exiting from emacs doesn't invoke the diag menu. +' quit to user-interface + +: screen-#lines ( -- n ) + screen-ih 0= if default-#lines exit then + screen-ih package( #lines )package +; +' screen-#lines to lines/page + +true value text-on? +: text-off ( -- ) + text-on? if + screen-ih remove-output + false to text-on? + then +; +: text-on ( -- ) + text-on? 0= if + screen-ih add-output + cursor-on + true to text-on? + then +; + +fload ${BP}/cpu/x86/pc/olpc/help.fth + +[ifdef] notyet +fload ${BP}/cpu/x86/pc/olpc/gamekeys.fth + +: emacs ( -- ) + false to already-go? + boot-getline to boot-file " rom:emacs" $boot +; + +fload ${BP}/ofw/gui/ofpong.fth +fload ${BP}/cpu/x86/pc/olpc/life.fth +[then] + +" u:\boot\olpc.fth ext:\boot\olpc.fth int:\boot\olpc.fth ext:\zimage /prober /usb/ethernet /usb/wlan" + ' boot-device set-config-string-default + +\needs ramdisk " " d# 128 config-string ramdisk +" " ' boot-file set-config-string-default \ Let the boot script set the cmdline + +\ Eliminate 4 second delay in install console for the case where +\ there is no keyboard. The delay is unnecessary because the screen +\ does not go blank when the device is closed. +patch drop ms install-console + +alias reboot bye + +alias crcgen drop ( crc byte -- crc' ) + +\ Dictionary growth size for the ARM Image Format header +\ 1 section before origin section table +h# 10.0000 h# 8000 - h# 4000 - dictionary-size ! + +fload ${BP}/cpu/arm/saverom.fth \ Save the dictionary for standalone startup + +fload ${BP}/forth/lib/selstr.fth + +fload ${BP}/ofw/inet/loadtcp.fth + +support-package: http + fload ${BP}/ofw/inet/http.fth \ HTTP client +end-support-package + +[ifdef] notyet +fload ${BP}/cpu/x86/pc/olpc/memtest.fth +[then] + +[ifdef] notyet +fload ${BP}/ofw/wifi/wifi-cfg.fth +support-package: supplicant +fload ${BP}/ofw/wifi/loadpkg.fth +end-support-package + +: ofw-ssids ( -- $ ) " OFWSSID" ; +' ofw-ssids to default-ssids +[then] + +fload ${BP}/ofw/inet/sntp.fth +: olpc-ntp-servers ( -- ) + " DHCP time 172.18.0.1 0.pool.ntp.org 1.pool.ntp.org 2.pool.ntp.org" +; +' olpc-ntp-servers to ntp-servers +: ntp-time&date ( -- s m h d m y ) + ntp-timestamp abort" Can't contact NTP server" + ntp>time&date +; +: .clock ( -- ) + time&date .date space .time ." UTC" cr +; +: ntp-set-clock ( -- ) + ntp-time&date " set-time" clock-node @ $call-method + .clock +; + +[ifdef] use-ppp +fload ${BP}/ofw/ppp/loadppp.fth +[then] + +" dhcp" ' ip-address set-config-string-default + +[ifdef] notyet +: c1-idle ( -- ) interrupts-enabled? if halt then ; +' c1-idle to stdin-idle +[then] + +fload ${BP}/ofw/core/countdwn.fth \ Startup countdown + +: console-start ( -- ) + install-mux-io +\ cursor-off + true to text-on? + + " //null" open-dev to null-ih \ For text-off state +; + +: interpreter-init ( -- ) + hex + warning on + only forth also definitions + +\ install-alarm + + page-mode + #line off + +\ .built cr +; + +[ifdef] notyet +: ?games ( -- ) + rocker-right game-key? if + protect-fw + time&date 5drop 1 and if + ['] pong guarded + else + ['] life-demo guarded + then + power-off + then +; +: ?diags ( -- ) + rocker-left game-key? if + protect-fw + text-on " test-all" ['] eval guarded + ." Tests complete - powering off" cr d# 5000 ms power-off + then +; + +: ?scan-nand ( -- ) + rocker-up game-key? if + protect-fw text-on ['] scan-nand guarded + then +; +: ?fs-update ( -- ) + button-check button-x or button-o or button-square or ( mask ) + game-key-mask = if protect-fw try-fs-update then +; +[then] + +: startup ( -- ) + standalone? 0= if exit then + +\ block-exceptions + no-page + + console-start + +[ifdef] notyet + read-game-keys +[then] + +\ text-off + + " probe-" do-drop-in + +[ifdef] notyet + sound + ?games +[then] + + ['] false to interrupt-auto-boot? +[ifdef] probe-usb + probe-usb + report-disk + report-keyboard +[then] + " probe+" do-drop-in + + interpreter-init +[ifdef] notyet + ?scan-nand + ?diags + ?fs-update +[then] +\ unblock-exceptions + ['] (interrupt-auto-boot?) to interrupt-auto-boot? +\ ?usb-keyboard + auto-banner? if banner then + + auto-boot + + cr cr + + quit +; + +\ This helps with TeraTerm, which sends ESC-O as the arrow key prefix +also hidden also keys-forth definitions +warning @ warning off +: esc-o key lastchar ! [""] esc-[ do-command ; +warning ! +previous previous definitions + +tag-file @ fclose tag-file off + +.( --- Saving fw.dic ...) +" fw.dic" $save-forth cr + +fload ${BP}/cpu/arm/mmp2/boot.fth + +.( --- Saving ofw.rom --- ) cr " ofw.rom" $save-rom + +\ LICENSE_BEGIN +\ Copyright (c) 2010 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