diff options
-rw-r--r-- | board-qemu/Makefile | 2 | ||||
-rw-r--r-- | board-qemu/slof/Makefile | 8 | ||||
-rw-r--r-- | board-qemu/slof/OF.fs | 25 | ||||
-rw-r--r-- | board-qemu/slof/hvterm.fs | 17 | ||||
-rw-r--r-- | board-qemu/slof/version.S | 36 | ||||
-rw-r--r-- | lib/libhvcall/hvcall.S | 12 | ||||
-rw-r--r-- | lib/libhvcall/hvcall.code | 5 | ||||
-rw-r--r-- | lib/libhvcall/hvcall.in | 1 | ||||
-rw-r--r-- | lib/libhvcall/libhvcall.h | 1 | ||||
-rw-r--r-- | slof/Makefile.inc | 4 |
10 files changed, 103 insertions, 8 deletions
diff --git a/board-qemu/Makefile b/board-qemu/Makefile index eb43787..29ee016 100644 --- a/board-qemu/Makefile +++ b/board-qemu/Makefile @@ -31,7 +31,7 @@ subdirs: $(SUBDIRS) $(SUBDIRS): common-libs @echo " ====== Building $@ ======" - $(MAKE) -C $@ $(MAKEARG) + $(MAKE) -C $@ $(MAKEARG) RELEASE=-DRELEASE=\"\\\"$(RELEASE)\\\"\" stage1: common-libs @echo " ====== Building llfw ======" diff --git a/board-qemu/slof/Makefile b/board-qemu/slof/Makefile index a7deed7..43db4aa 100644 --- a/board-qemu/slof/Makefile +++ b/board-qemu/slof/Makefile @@ -16,8 +16,7 @@ include ../Makefile.dirs include $(TOPBRDDIR)/config include $(TOPCMNDIR)/make.rules - -all: Makefile.dep OF.ffs paflof $(SLOFCMNDIR)/xvect.bin +all: version.o Makefile.dep OF.ffs paflof $(SLOFCMNDIR)/xvect.bin CPPFLAGS = -I$(LIBCMNDIR)/libbootmsg -I$(LIBCMNDIR)/libhvcall \ -I$(LIBCMNDIR)/libvirtio -I$(LIBCMNDIR)/libnvram \ @@ -46,6 +45,11 @@ BOARD_SLOF_CODE = $(BOARD_SLOF_IN:%.in=%.code) include $(SLOFCMNDIR)/Makefile.inc +AS1FLAGS = $(CPPFLAGS) $(RELEASE) $(CPUARCHDEF) -Wa,-mregnames + +%.o: %.S + $(CC) $(AS1FLAGS) -o $@ -c $^ + FPPINCLUDES = -I. -I$(SLOFCMNDIR)/fs -I$(SLOFCMNDIR) USB_FFS_FILES = \ diff --git a/board-qemu/slof/OF.fs b/board-qemu/slof/OF.fs index 05d87c7..a4f1064 100644 --- a/board-qemu/slof/OF.fs +++ b/board-qemu/slof/OF.fs @@ -152,6 +152,29 @@ check-for-nvramrc #include <loaders.fs> 8a8 cp +CREATE version-str 10 ALLOT +0 value temp-ptr + +: dump-display-buffer + disp-ptr to temp-ptr + " SLOF **********************************************************************" terminal-write drop + cr + version-str get-print-version + version-str @ \ start + version-str 8 + @ \ end + over - terminal-write drop + " Press 's' to enter Open Firmware." terminal-write drop + cr cr + temp-ptr disp-size > IF + temp-ptr disp-size MOD + dup + prevga-disp-buf + swap disp-size swap - terminal-write drop + temp-ptr disp-size MOD + prevga-disp-buf swap 1 - terminal-write drop + ELSE + prevga-disp-buf temp-ptr terminal-write drop + THEN +; : enable-framebuffer-output ( -- ) \ enable output on framebuffer @@ -159,8 +182,10 @@ check-for-nvramrc \ we need to open/close the screen device once \ before "ticking" display-emit to emit open-dev close-node + false to store-prevga? s" display-emit" $find IF to emit + dump-display-buffer ELSE 2drop THEN diff --git a/board-qemu/slof/hvterm.fs b/board-qemu/slof/hvterm.fs index 9700685..98c1445 100644 --- a/board-qemu/slof/hvterm.fs +++ b/board-qemu/slof/hvterm.fs @@ -13,8 +13,23 @@ \ PAPR hvterm console. Enabled very early. 0 CONSTANT default-hvtermno +\ Buffer for pre-display +4096 CONSTANT disp-size +CREATE prevga-disp-buf 4096 allot +0 value disp-ptr +true value store-prevga? -: hvterm-emit default-hvtermno SWAP hv-putchar ; +: store-to-disp-buffer ( ch -- ) + prevga-disp-buf disp-ptr disp-size MOD + c! + disp-ptr 1 + to disp-ptr +; + +: hvterm-emit + store-prevga? IF + dup store-to-disp-buffer + THEN + default-hvtermno SWAP hv-putchar +; : hvterm-key? default-hvtermno hv-haschar ; : hvterm-key BEGIN hvterm-key? UNTIL default-hvtermno hv-getchar ; diff --git a/board-qemu/slof/version.S b/board-qemu/slof/version.S new file mode 100644 index 0000000..9aa2a94 --- /dev/null +++ b/board-qemu/slof/version.S @@ -0,0 +1,36 @@ +/****************************************************************************** + * Copyright (c) 2010, 2011 IBM Corporation + * All rights reserved. + * This program and the accompanying materials + * are made available under the terms of the BSD License + * which accompanies this distribution, and is available at + * http://www.opensource.org/licenses/bsd-license.php + * + * Contributors: + * IBM Corporation - initial implementation + *****************************************************************************/ + +/* + * Print version information - in SLOF + * This code is in a separate file so that it can be easily compiled during + * each new build (for refreshing the build date). + */ + +#include "termctrl.h" +#include <product.h> + +.global print_version +print_version: + .ascii TERM_CTRL_RESET + .ascii TERM_CTRL_CRSOFF + .ascii TERM_CTRL_BRIGHT + .ascii PRODUCT_NAME + .ascii " Starting\r\n" + .ascii TERM_CTRL_RESET + .ascii " Build Date = ", __DATE__, " ", __TIME__ + .ascii "\r\n" + .ascii " FW Version = " , RELEASE + .ascii "\r\n\0" + .align 2 +.global print_version_end +print_version_end: diff --git a/lib/libhvcall/hvcall.S b/lib/libhvcall/hvcall.S index 2444953..92cf22e 100644 --- a/lib/libhvcall/hvcall.S +++ b/lib/libhvcall/hvcall.S @@ -2,12 +2,20 @@ #define __ASSEMBLY__ #include "macros.h" #include "libhvcall.h" - +#include <termctrl.h> +#include <product.h> + #define HVCALL .long 0x44000022 - .text .align 3 +ENTRY(get_print_banner) + LOAD32(r4, print_version) + LOAD32(r5, print_version_end) + std r4,0(r3) + std r5,8(r3) + blr + ENTRY(hv_generic) HVCALL blr diff --git a/lib/libhvcall/hvcall.code b/lib/libhvcall/hvcall.code index 9bd47c6..6d70b3c 100644 --- a/lib/libhvcall/hvcall.code +++ b/lib/libhvcall/hvcall.code @@ -110,3 +110,8 @@ PRIM(hv_X2d_cas) unsigned long vec = TOS.u; TOS.u = hv_cas(vec, buf, size); MIRP + +PRIM(get_X2d_print_X2d_version) + unsigned long addr = TOS.u; POP; + get_print_banner(addr); +MIRP diff --git a/lib/libhvcall/hvcall.in b/lib/libhvcall/hvcall.in index 9c8d6aa..1f9ed6b 100644 --- a/lib/libhvcall/hvcall.in +++ b/lib/libhvcall/hvcall.in @@ -29,3 +29,4 @@ cod(RX!) cod(hv-logical-memop) cod(hv-cas) +cod(get-print-version) diff --git a/lib/libhvcall/libhvcall.h b/lib/libhvcall/libhvcall.h index de54313..03813cd 100644 --- a/lib/libhvcall/libhvcall.h +++ b/lib/libhvcall/libhvcall.h @@ -32,6 +32,7 @@ extern long hv_generic(unsigned long opcode, ...); extern void hv_putchar(char c, int hvtermno); extern char hv_getchar(int hvtermno); extern char hv_haschar(int hvtermno); +extern void get_print_banner(unsigned long addr); extern int hv_send_crq(unsigned int unit, uint64_t *msgaddr); diff --git a/slof/Makefile.inc b/slof/Makefile.inc index 62af9de..8ad3337 100644 --- a/slof/Makefile.inc +++ b/slof/Makefile.inc @@ -84,9 +84,9 @@ board.code: endif paflof: $(SLOFCMNDIR)/OF.lds $(SLOFCMNDIR)/ofw.o paflof.o $(SLOFCMNDIR)/entry.o \ - helpers.o allocator.o romfs.o OF.o nvramlog.o $(LLFWBRDDIR)/board_io.o \ + helpers.o allocator.o romfs.o version.o OF.o nvramlog.o $(LLFWBRDDIR)/board_io.o \ $(LLFWBRDDIR)/io_generic_lib.o $(SLOF_LIBS) - $(CC) -T$(SLOFCMNDIR)/OF.lds $(SLOFCMNDIR)/ofw.o paflof.o helpers.o allocator.o \ + $(CC) -T$(SLOFCMNDIR)/OF.lds $(SLOFCMNDIR)/ofw.o version.o paflof.o helpers.o allocator.o \ $(SLOFCMNDIR)/entry.o romfs.o OF.o nvramlog.o $(LLFWBRDDIR)/board_io.o \ $(LLFWBRDDIR)/io_generic_lib.o $(LDFLAGS) $(SLOF_LIBS) -o $@ #save a copy of paflof before stripping |