aboutsummaryrefslogtreecommitdiff
path: root/board-qemu/slof/helper.fs
diff options
context:
space:
mode:
authorAlexey Kardashevskiy <aik@ozlabs.ru>2017-10-09 16:02:49 +1100
committerAlexey Kardashevskiy <aik@ozlabs.ru>2017-11-06 13:28:49 +1100
commit608e416bb114ce964e742733ea6a4a5fc7c968c8 (patch)
tree7e037a9674bb9b95cfdd01b5a6881538a6b7486d /board-qemu/slof/helper.fs
parente6fc84652c9c0073f9183cbbc261ae7700f5e1e7 (diff)
downloadSLOF-608e416bb114ce964e742733ea6a4a5fc7c968c8.zip
SLOF-608e416bb114ce964e742733ea6a4a5fc7c968c8.tar.gz
SLOF-608e416bb114ce964e742733ea6a4a5fc7c968c8.tar.bz2
board-qemu: Fix slof-build-id length
The existing code hardcodes the length of /openprom/model to 10 characters even though it is less than that - len("aik")==3. All 10 chars go to the device tree blob and DTC complains on such a property as there are characters after terminating null: aik@fstn1-p1:~$ dtc -f -I dtb -O dts -o dbg.dts dbg.dtb Warning (model_is_string): "model" property in /openprom is not a string This uses the real length and limits it by 10 to avoid breaking something. Since the same code parses the build id field, this moves from-cstring to a common place for both js2x and qemu boards. Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Diffstat (limited to 'board-qemu/slof/helper.fs')
-rw-r--r--board-qemu/slof/helper.fs8
1 files changed, 1 insertions, 7 deletions
diff --git a/board-qemu/slof/helper.fs b/board-qemu/slof/helper.fs
index 40d4abc..4b2c1ee 100644
--- a/board-qemu/slof/helper.fs
+++ b/board-qemu/slof/helper.fs
@@ -11,7 +11,7 @@
\ ****************************************************************************/
: slof-build-id ( -- str len )
- flash-header 10 + a
+ flash-header 10 + dup from-cstring a min
;
: slof-revision s" 001" ;
@@ -27,12 +27,6 @@
bdate2human $cat encode-string THEN
;
-\ Fetch C string
-: from-cstring ( addr - len )
- dup dup BEGIN c@ 0 <> WHILE 1 + dup REPEAT
- swap -
-;
-
: invert-region-cs ( addr len cellsize -- )
>r over swap r@ rshift r> swap 1 hv-logical-memop drop
;