diff --git a/_projects/sparcv8leon3-gr716-mimas/build.project b/_projects/sparcv8leon3-gr716-mimas/build.project index 093ed972..028be321 100644 --- a/_projects/sparcv8leon3-gr716-mimas/build.project +++ b/_projects/sparcv8leon3-gr716-mimas/build.project @@ -8,31 +8,16 @@ [ "${BASH_SOURCE[0]}" -ef "$0" ] && echo "You should source this script, not execute it!" && exit 1 -BOOT_DEVICE="uart0" +# no NVM storage, all programs are being loaded via UART +export BOOT_DEVICE="uart0" export PLO_DEVICES="gpio-gr716 uart-grlib" -PREINIT_SCRIPT=( - "map ocram 0x31000000 0x3101FFFF rwx" - "map extram 0x40000000 0x401FFFFF rwx" - "phfs uart0 0.0 phoenixd" - "console 0.1" -) - - -USER_SCRIPT=( - "kernel ${BOOT_DEVICE}" - "app ${BOOT_DEVICE} -x dummyfs extram extram" - "app ${BOOT_DEVICE} -x grlib-multi extram extram" - "app ${BOOT_DEVICE} -x psh extram extram" - "wait 500" - "go!" -) - - -b_convert_project() { +prepare_plo_img() { + #TODO: consider using nvm.yaml for merging header with plo local f="${PREFIX_PROG_STRIPPED}plo-${TARGET_FAMILY}-${TARGET_SUBFAMILY}.img" local sz=$(stat -c%s "$f") + #TODO: why "- 4" ? sz=$(((sz - 4)/4)) printf "\xde\xad\xbe\xef" > "$PREFIX_BOOT/plo.img" printf "%08X" $sz | xxd -r -p >> "$PREFIX_BOOT/plo.img" @@ -42,10 +27,15 @@ b_convert_project() { b_image_project () { - cp "${PREFIX_PROG_STRIPPED}phoenix-${TARGET_FAMILY}-${TARGET_SUBFAMILY}.elf" "$PREFIX_BOOT/" - cp "${PREFIX_PROG_STRIPPED}dummyfs" "$PREFIX_BOOT/" - cp "${PREFIX_PROG_STRIPPED}grlib-multi" "$PREFIX_BOOT/" - cp "${PREFIX_PROG_STRIPPED}psh" "$PREFIX_BOOT/" + prepare_plo_img; + + # no NVM storage, all programs are being loaded via UART - prepare user.plo and all binaries in "PREFIX_BOOT" + image_builder.py script --nvm "$NVM_CONFIG" --script "$PLO_SCRIPT_USER" --out "${PREFIX_BOOT}/user.plo" + + cp -a "${PREFIX_PROG_STRIPPED}phoenix-${TARGET_FAMILY}-${TARGET_SUBFAMILY}.elf" "$PREFIX_BOOT/" + cp -a "${PREFIX_PROG_STRIPPED}dummyfs" "$PREFIX_BOOT/" + cp -a "${PREFIX_PROG_STRIPPED}grlib-multi" "$PREFIX_BOOT/" + cp -a "${PREFIX_PROG_STRIPPED}psh" "$PREFIX_BOOT/" b_log "The images have been built for the ${TARGET} platform" } diff --git a/_projects/sparcv8leon3-gr716-mimas/preinit.yaml b/_projects/sparcv8leon3-gr716-mimas/preinit.yaml new file mode 100644 index 00000000..f423fd77 --- /dev/null +++ b/_projects/sparcv8leon3-gr716-mimas/preinit.yaml @@ -0,0 +1,18 @@ +size: 0x1000 +is_relative: False + +contents: + - map ocram 0x31000000 0x3101FFFF rwx + - map extram 0x40000000 0x401FFFFF rwx + - phfs uart0 0.0 phoenixd + - console 0.1 + + - if: '{{ not(env.RAM_SCRIPT) | default(false) }}' + action: call + set_base: True + device: '{{ env.BOOT_DEVICE }}' + filename: user.plo + offset: 0 # BOOT_DEVICE is UART, offset doesn't matter? + target_magic: '{{ env.MAGIC_USER_SCRIPT }}' + + diff --git a/_projects/sparcv8leon3-gr716-mimas/user.plo.yaml b/_projects/sparcv8leon3-gr716-mimas/user.plo.yaml new file mode 100644 index 00000000..fba9a991 --- /dev/null +++ b/_projects/sparcv8leon3-gr716-mimas/user.plo.yaml @@ -0,0 +1,13 @@ +# kernel + initrd +magic: '{{ env.MAGIC_USER_SCRIPT }}' +size: 0x1000 +is_relative: True + +contents: + - kernel {{ env.BOOT_DEVICE }} + - app {{ env.BOOT_DEVICE }} -x dummyfs extram extram + - app {{ env.BOOT_DEVICE }} -x grlib-multi extram extram + - app {{ env.BOOT_DEVICE }} -x psh extram extram + - wait 2000 + - go! + diff --git a/_projects/sparcv8leon3-gr716-mini/build.project b/_projects/sparcv8leon3-gr716-mini/build.project index 394b756f..05af3e25 100644 --- a/_projects/sparcv8leon3-gr716-mini/build.project +++ b/_projects/sparcv8leon3-gr716-mini/build.project @@ -10,12 +10,19 @@ export PLO_DEVICES="gpio-gr716 uart-grlib flash-gr716" -b_convert_project() { - ./phoenix-rtos-build/scripts/gr716-convert.py "${PREFIX_PROG_STRIPPED}plo-${TARGET_FAMILY}-${TARGET_SUBFAMILY}.elf" -o "${PREFIX_PROG_STRIPPED}plo-${TARGET_FAMILY}-${TARGET_SUBFAMILY}.img" - ./phoenix-rtos-build/scripts/gr716-bch.py "${PREFIX_PROG_STRIPPED}plo-${TARGET_FAMILY}-${TARGET_SUBFAMILY}.img" "$PREFIX_BOOT/plo.bch" +prepare_plo_img() { + #FIXME: img file already produced by the plo make, change the output filename + FLASH_SIZE=$(image_builder.py query --nvm "$NVM_CONFIG" '{{ nvm.flash0._meta.size }}') + gr716-convert.py "${PREFIX_PROG_STRIPPED}plo-${TARGET_FAMILY}-${TARGET_SUBFAMILY}.elf" -o "${PREFIX_PROG_STRIPPED}plo-${TARGET_FAMILY}-${TARGET_SUBFAMILY}.img" + gr716-bch.py -s "$FLASH_SIZE" "${PREFIX_PROG_STRIPPED}plo-${TARGET_FAMILY}-${TARGET_SUBFAMILY}.img" "$PREFIX_BOOT/plo.bch" } b_image_project () { + prepare_plo_img; + + image_builder.py -v partition --nvm "$NVM_CONFIG" --name kernel --script "$PLO_SCRIPT_USER" + image_builder.py -v disk --nvm "$NVM_CONFIG" --name flash0 --part "plo=${PREFIX_PROG_STRIPPED}plo-${TARGET_FAMILY}-${TARGET_SUBFAMILY}.img" --out "phoenix.disk" + b_log "The images have been built for the ${TARGET} platform" } diff --git a/_targets/sparcv8leon3/generic/build.project b/_targets/sparcv8leon3/generic/build.project index 0a99571b..3c38aeff 100644 --- a/_targets/sparcv8leon3/generic/build.project +++ b/_targets/sparcv8leon3/generic/build.project @@ -30,30 +30,13 @@ export PORTS_CURL=n # # Platform dependent parameters # -SIZE_PAGE=$((0x1000)) -PAGE_MASK=$((~(SIZE_PAGE - 1))) -KERNEL_OFFS=$((0x10000)) +export SIZE_PAGE=$((0x1000)) -BOOT_DEVICE="ram0" # Default boot device -NAME_USER_SCRIPT="user.plo" # User script name -OFFS_USER_SCRIPT=$((0xf000)) -MAGIC_USER_SCRIPT=$((0xdabaabad)) # User script magic value - - -PREINIT_SCRIPT=( - "map sram 0x40000000 0x47ffffff rwx" - "console 0.0" - "phfs ram0 4.0 raw" -) - -USER_SCRIPT=( - "kernel ${BOOT_DEVICE}" - "app ${BOOT_DEVICE} -x dummyfs sram sram" - "app ${BOOT_DEVICE} -x grlib-uart sram sram" - "app ${BOOT_DEVICE} -x psh sram sram" - "wait 500" - "go!" -) +# +# Project specific build +# +export BOOT_DEVICE="ram0" +export MAGIC_USER_SCRIPT=dabaabad b_build_project() { @@ -66,19 +49,17 @@ b_build_target() { b_log "Building $TARGET project" b_log "Building phoenix-rtos-loader" - b_mkscript_preinit - - make -C plo all + image_builder.py script --nvm "$NVM_CONFIG" --script "$PLO_SCRIPT_PREINIT" --out script.plo + RAM_SCRIPT=1 image_builder.py script --nvm "$NVM_CONFIG" --script "$PLO_SCRIPT_PREINIT" --out script-ram.plo + make -C plo base - cp "${PREFIX_PROG_STRIPPED}plo-${TARGET_FAMILY}-${TARGET_SUBFAMILY}.elf" "${PREFIX_BOOT}/plo.elf" + cp -a "${PREFIX_PROG_STRIPPED}plo-${TARGET_FAMILY}-${TARGET_SUBFAMILY}.elf" "${PREFIX_BOOT}/plo.elf" } b_image_target() { - b_mkscript_user "${USER_SCRIPT[@]}" - cp "$PLO_SCRIPT_DIR/$NAME_USER_SCRIPT" "${PREFIX_BOOT}" - - b_prod_image + image_builder.py -v partition --nvm "$NVM_CONFIG" --name kernel --script "$PLO_SCRIPT_USER" + image_builder.py -v disk --nvm "$NVM_CONFIG" --name flash0 --part "plo=${PREFIX_PROG_STRIPPED}plo-${TARGET_FAMILY}-${TARGET_SUBFAMILY}.img" --out "phoenix.disk" } diff --git a/_targets/sparcv8leon3/generic/nvm.yaml b/_targets/sparcv8leon3/generic/nvm.yaml new file mode 100644 index 00000000..6cf51610 --- /dev/null +++ b/_targets/sparcv8leon3/generic/nvm.yaml @@ -0,0 +1,10 @@ +flash0: + size: 0x800000 # 8 MB + block_size: 0x100 # program page size + padding_byte: 0xff + partitions: + - name: plo + offs: 0x0 + - name: kernel + offs: 0xf000 + # if size not set - last non-virtual partition will be extnded to the end of flash diff --git a/_targets/sparcv8leon3/generic/preinit.plo.yaml b/_targets/sparcv8leon3/generic/preinit.plo.yaml new file mode 100644 index 00000000..21b1a9b3 --- /dev/null +++ b/_targets/sparcv8leon3/generic/preinit.plo.yaml @@ -0,0 +1,16 @@ +size: 0x1000 +is_relative: False + +contents: + - map sram 0x40000000 0x47ffffff rwx + - console 0.0 + - phfs ram0 4.0 raw + + - if: '{{ not(env.RAM_SCRIPT) | default(false) }}' + action: call + set_base: True + device: '{{ env.BOOT_DEVICE }}' + filename: user.plo + offset: '{{ nvm.flash0.kernel.offs }}' + target_magic: '{{ env.MAGIC_USER_SCRIPT }}' + diff --git a/_targets/sparcv8leon3/generic/user.plo.yaml b/_targets/sparcv8leon3/generic/user.plo.yaml new file mode 100644 index 00000000..852a6fcd --- /dev/null +++ b/_targets/sparcv8leon3/generic/user.plo.yaml @@ -0,0 +1,12 @@ +# kernel + initrd +magic: '{{ env.MAGIC_USER_SCRIPT }}' +size: 0x1000 +is_relative: True + +contents: + - kernel {{ env.BOOT_DEVICE }} + - app {{ env.BOOT_DEVICE }} -x dummyfs sram sram + - app {{ env.BOOT_DEVICE }} -x grlib-uart sram sram + - app {{ env.BOOT_DEVICE }} -x psh sram sram + - wait 500 + - go! diff --git a/_targets/sparcv8leon3/gr712rc/build.project b/_targets/sparcv8leon3/gr712rc/build.project index 14bd76ee..11f582a9 100644 --- a/_targets/sparcv8leon3/gr712rc/build.project +++ b/_targets/sparcv8leon3/gr712rc/build.project @@ -30,34 +30,12 @@ export PORTS_CURL=n # # Platform dependent parameters # -SIZE_PAGE=$((0x1000)) -PAGE_MASK=$((~(SIZE_PAGE - 1))) -KERNEL_OFFS=$((0x10000)) - -BOOT_DEVICE="flash0" # Default boot device -NAME_USER_SCRIPT="user.plo" # User script name -OFFS_USER_SCRIPT=$((0xf000)) -MAGIC_USER_SCRIPT=$((0xdabaabad)) # User script magic value -ERASE_SIZE=$((0x20000)) # Rootfs disk erase block size (in bytes) -FS_OFFS=$((0xc0000)) - - -PREINIT_SCRIPT=( - "map sram 0x40000000 0x80000000 rwx" - "console 0.0" - "phfs uart1 0.1 phoenixd" - "phfs flash0 2.0 raw" -) +export SIZE_PAGE=$((0x1000)) -USER_SCRIPT=( - "kernel ${BOOT_DEVICE}" - "app ${BOOT_DEVICE} -x dummyfs;-N;devfs;-D sram sram" - "app ${BOOT_DEVICE} -x grlib-multi sram sram" - "app ${BOOT_DEVICE} -x gr712rc-flash;-r;root:jffs2 sram sram" - "app ${BOOT_DEVICE} -x psh;-i;/etc/rc.psh sram sram" - "wait 500" - "go!" -) +export BOOT_DEVICE="flash0" # Default boot device +export MAGIC_USER_SCRIPT="dabaabad" # User script magic value +#TODO: move to nvm.yaml +ERASE_SIZE=$((0x20000)) # Rootfs disk erase block size (in bytes) b_build_project() { @@ -70,25 +48,18 @@ b_build_target() { b_log "Building $TARGET project" b_log "Building phoenix-rtos-loader" - b_mkscript_preinit - + image_builder.py script --nvm "$NVM_CONFIG" --script "$PLO_SCRIPT_PREINIT" --out script.plo make -C plo all - cp "${PREFIX_PROG_STRIPPED}plo-${TARGET_FAMILY}-${TARGET_SUBFAMILY}.img" "$PREFIX_BOOT/plo.img" - cp "${PREFIX_PROG_STRIPPED}plo-ram-${TARGET_FAMILY}-${TARGET_SUBFAMILY}.img" "$PREFIX_BOOT/plo-ram.img" + cp -a "${PREFIX_PROG_STRIPPED}plo-${TARGET_FAMILY}-${TARGET_SUBFAMILY}.img" "$PREFIX_BOOT/plo.img" + cp -a "${PREFIX_PROG_STRIPPED}plo-ram-${TARGET_FAMILY}-${TARGET_SUBFAMILY}.img" "$PREFIX_BOOT/plo-ram.img" } b_image_target() { - b_mkscript_user "${USER_SCRIPT[@]}" - cp "$PLO_SCRIPT_DIR/$NAME_USER_SCRIPT" "${PREFIX_BOOT}" - - b_prod_image + image_builder.py -v partition --nvm "$NVM_CONFIG" --name kernel --script "$PLO_SCRIPT_USER" b_log "Creating rootfs" - # FIXME: does work only on macOS, for now hackish solution based on extending PATH - mtd-utils/build.sh - PATH="$(pwd)/_build/host-generic-pc/prog/:$PATH" ROOTFS="$PREFIX_BOOT/rootfs.jffs2" @@ -100,29 +71,18 @@ b_image_target() { mv "$ROOTFS.tmp" "$ROOTFS" fi - sz=$(du -b "$ROOTFS" | awk '{ print $1 }') - echo "rootfs size: $((sz/1024))KB" - - local start=$(((FS_OFFS+sz+ERASE_SIZE-1)/ERASE_SIZE)) # Start clean block after rootfs - local end=$((FLASH_SZ/ERASE_SIZE)) # Number of blocks in flash - local nblocks=$((end-start-1)) # Clean blocks - - # cmd for creating cleanmarkers in plo on clean system - echo "Create cleanmarkers in plo:" - echo "jffs2 -d 2.0 -c ${start}:${nblocks}:${ERASE_SIZE}:16" + local FS_OFFS=$(image_builder.py query --nvm "$NVM_CONFIG" '{{ nvm.flash0.rootfs.offs }}') + local FS_SZ=$(image_builder.py query --nvm "$NVM_CONFIG" '{{ nvm.flash0.rootfs.size }}') + sz=$(du -k "$ROOTFS" | awk '{ print $1 }') + echo "rootfs size: ${sz} kB / $((FS_SZ / 1024)) kB" + [ "$sz" -gt "$FS_SZ" ] && b_die "rootfs size exceeds the target partition!" - # set rootfs offset in image - OFFSET=$FS_OFFS - b_add2img "$ROOTFS" "$PHOENIX_DISK" - - if [[ -f "$PREFIX_BOOT"/ptable.img ]]; then - rm "$PREFIX_BOOT"/ptable.img - fi + # cmd for creating cleanmarkers in plo + echo "Format jffs2 partition in plo:" + echo "jffs2 -d 2.0 -c $((FS_OFFS / ERASE_SIZE)):$((FS_SZ / ERASE_SIZE)):${ERASE_SIZE}:16" - "$PREFIX_BOOT"/psdisk "$PREFIX_BOOT"/ptable.img -m "$FLASH_SZ",0x20000 \ - -p boot0,0,$((FS_OFFS)),0x51 \ - -p root,$((FS_OFFS)),$((FLASH_SZ-FS_OFFS-ERASE_SIZE)),0x72 \ - -p ptable,$((FLASH_SZ-ERASE_SIZE)),$((ERASE_SIZE)),0x51 + image_builder.py ptable --nvm "$NVM_CONFIG" + image_builder.py -v disk --nvm "$NVM_CONFIG" --part "rootfs=$ROOTFS" --part "plo=${PREFIX_PROG_STRIPPED}plo-${TARGET_FAMILY}-${TARGET_SUBFAMILY}.img" } diff --git a/_targets/sparcv8leon3/gr712rc/nvm.yaml b/_targets/sparcv8leon3/gr712rc/nvm.yaml new file mode 100644 index 00000000..8d58ff4c --- /dev/null +++ b/_targets/sparcv8leon3/gr712rc/nvm.yaml @@ -0,0 +1,15 @@ +flash0: + size: 0x1000000 # 16 MB + block_size: 0x1000 + # eraseblock_size: 0x20000 # TODO: add generic support? + padding_byte: 0xff + partitions: + - name: plo + offs: 0x0 + - name: kernel + offs: 0x20000 + - name: rootfs + offs: 0x100000 + - name: ptable + offs: 0xfe0000 + size: 0x20000 diff --git a/_targets/sparcv8leon3/gr712rc/preinit.plo.yaml b/_targets/sparcv8leon3/gr712rc/preinit.plo.yaml new file mode 100644 index 00000000..941abd6f --- /dev/null +++ b/_targets/sparcv8leon3/gr712rc/preinit.plo.yaml @@ -0,0 +1,18 @@ +size: 0x1000 +is_relative: False + +contents: + #FIXME: map should end at 0x7fffffff + - map sram 0x40000000 0x80000000 rwx + - console 0.0 + - phfs uart1 0.1 phoenixd + - phfs flash0 2.0 raw + + - if: '{{ not(env.RAM_SCRIPT) | default(false) }}' + action: call + set_base: True + device: '{{ env.BOOT_DEVICE }}' + filename: user.plo + offset: '{{ nvm.flash0.kernel.offs }}' + target_magic: '{{ env.MAGIC_USER_SCRIPT }}' + diff --git a/_targets/sparcv8leon3/gr712rc/user.plo.yaml b/_targets/sparcv8leon3/gr712rc/user.plo.yaml new file mode 100644 index 00000000..96504bc4 --- /dev/null +++ b/_targets/sparcv8leon3/gr712rc/user.plo.yaml @@ -0,0 +1,13 @@ +# kernel + initrd +magic: '{{ env.MAGIC_USER_SCRIPT }}' +size: 0x1000 +is_relative: True + +contents: + - kernel {{ env.BOOT_DEVICE }} + - app {{ env.BOOT_DEVICE }} -x dummyfs;-N;devfs;-D sram sram + - app {{ env.BOOT_DEVICE }} -x grlib-multi sram sram + - app {{ env.BOOT_DEVICE }} -x gr712rc-flash;-r;root:jffs2 sram sram + - app {{ env.BOOT_DEVICE }} -x psh;-i;/etc/rc.psh sram sram + - wait 500 + - go! diff --git a/_targets/sparcv8leon3/gr716/build.project b/_targets/sparcv8leon3/gr716/build.project index a2b32b8c..f0cea5bb 100644 --- a/_targets/sparcv8leon3/gr716/build.project +++ b/_targets/sparcv8leon3/gr716/build.project @@ -30,40 +30,21 @@ export PORTS_CURL=n # # Platform dependent parameters # -SIZE_PAGE=$((0x200)) -PAGE_MASK=$((~(SIZE_PAGE - 1))) +export SIZE_PAGE=$((0x200)) -BOOT_DEVICE="flash0" # Default boot device -NAME_USER_SCRIPT="user.plo" # User script name -OFFS_USER_SCRIPT=$((0xE400)) -MAGIC_USER_SCRIPT=$((0xdabaabad)) # User script magic value -KERNEL_OFFS=$((0xF400)) +# +# Project specific build +# +export BOOT_DEVICE="flash0" # Default boot device +export MAGIC_USER_SCRIPT="dabaabad" # User script magic value # Physical kernel address KERNEL_PHBASE=$((0x31000000)) # iram start address KERNEL_PHOFFS=$((0x0)) -export KERNEL_PHADDR=$(printf "%08x" $((KERNEL_PHBASE + KERNEL_PHOFFS))) - - -PREINIT_SCRIPT=( - "map dram 0x30000000 0x3000FFFF rw" - "map iram 0x31000000 0x3101FFFF rx" - "map extram 0x40000000 0x401FFFFF rwx" - "phfs uart3 0.3 phoenixd" - "phfs flash0 2.0 raw" - "console 0.2" -) - -USER_SCRIPT=( - "kernel ${BOOT_DEVICE}" - "app ${BOOT_DEVICE} -x dummyfs extram extram" - "app ${BOOT_DEVICE} -x grlib-multi extram extram" - "app ${BOOT_DEVICE} -x psh extram extram" - "app ${BOOT_DEVICE} -x gr716-flash extram extram" - "wait 2000" - "go!" -) +KERNEL_PHADDR=$(printf "%08x" $((KERNEL_PHBASE + KERNEL_PHOFFS))) +export KERNEL_PHADDR + b_build_project() { b_log "Building user applications" @@ -75,22 +56,18 @@ b_build_target() { b_log "Building $TARGET project" b_log "Building phoenix-rtos-loader" - b_mkscript_preinit + image_builder.py script --nvm "$NVM_CONFIG" --script "$PLO_SCRIPT_PREINIT" --out script.plo + RAM_SCRIPT=1 image_builder.py script --nvm "$NVM_CONFIG" --script "$PLO_SCRIPT_PREINIT" --out script-ram.plo make -C plo all - declare -F b_convert_project >/dev/null && b_convert_project - - cp "${PREFIX_PROG_STRIPPED}plo-ram-${TARGET_FAMILY}-${TARGET_SUBFAMILY}.img" "$PREFIX_BOOT/plo-ram.img" + cp -a "${PREFIX_PROG_STRIPPED}plo-ram-${TARGET_FAMILY}-${TARGET_SUBFAMILY}.img" "$PREFIX_BOOT/plo-ram.img" } b_image_target() { - b_mkscript_user "${USER_SCRIPT[@]}" - cp "$PLO_SCRIPT_DIR/$NAME_USER_SCRIPT" "${PREFIX_BOOT}" - - b_prod_image + :; } diff --git a/_targets/sparcv8leon3/gr716/nvm.yaml b/_targets/sparcv8leon3/gr716/nvm.yaml new file mode 100644 index 00000000..e4e9ab48 --- /dev/null +++ b/_targets/sparcv8leon3/gr716/nvm.yaml @@ -0,0 +1,11 @@ +flash0: + size: 0x1000000 # 16 MB + block_size: 0x100 # program page size + padding_byte: 0xff + partitions: + - name: plo + offs: 0x0 + - name: kernel + offs: 0xe400 + # if size not set - last non-virtual partition will be extnded to the end of flash + # TODO: add explicit/virtual partition for BCH diff --git a/_targets/sparcv8leon3/gr716/preinit.plo.yaml b/_targets/sparcv8leon3/gr716/preinit.plo.yaml new file mode 100644 index 00000000..3eaa0872 --- /dev/null +++ b/_targets/sparcv8leon3/gr716/preinit.plo.yaml @@ -0,0 +1,19 @@ +size: 0x1000 +is_relative: False + +contents: + - map dram 0x30000000 0x3000FFFF rw + - map iram 0x31000000 0x3101FFFF rx + - map extram 0x40000000 0x401FFFFF rwx + - phfs uart3 0.3 phoenixd + - phfs flash0 2.0 raw + - console 0.2 + + - if: '{{ not(env.RAM_SCRIPT) | default(false) }}' + action: call + set_base: True + device: '{{ env.BOOT_DEVICE }}' + filename: user.plo + offset: '{{ nvm.flash0.kernel.offs }}' + target_magic: '{{ env.MAGIC_USER_SCRIPT }}' + diff --git a/_targets/sparcv8leon3/gr716/user.plo.yaml b/_targets/sparcv8leon3/gr716/user.plo.yaml new file mode 100644 index 00000000..d41d4d07 --- /dev/null +++ b/_targets/sparcv8leon3/gr716/user.plo.yaml @@ -0,0 +1,13 @@ +# kernel + initrd +magic: '{{ env.MAGIC_USER_SCRIPT }}' +size: 0x1000 +is_relative: True + +contents: + - kernel {{ env.BOOT_DEVICE }} + - app {{ env.BOOT_DEVICE }} -x dummyfs extram extram + - app {{ env.BOOT_DEVICE }} -x grlib-multi extram extram + - app {{ env.BOOT_DEVICE }} -x psh extram extram + - app {{ env.BOOT_DEVICE }} -x gr716-flash extram extram + - wait 2000 + - go!