diff options
-rw-r--r-- | config/data/pico-serprog/mkhelper.cfg | 1 | ||||
-rw-r--r-- | config/git/pico-serprog/pkg.cfg | 2 | ||||
l--------- | config/git/pico-serprog/rp2040-serprog | 1 | ||||
-rw-r--r-- | config/git/picotool/pkg.cfg | 5 | ||||
-rw-r--r-- | include/rom.sh | 16 |
5 files changed, 23 insertions, 2 deletions
diff --git a/config/data/pico-serprog/mkhelper.cfg b/config/data/pico-serprog/mkhelper.cfg index ccfdc0df..f4733dd9 100644 --- a/config/data/pico-serprog/mkhelper.cfg +++ b/config/data/pico-serprog/mkhelper.cfg @@ -7,3 +7,4 @@ serx="$sersrc/build/pico_serprog.uf2" picosdk="src/pico-sdk" serdir="$picosdk/src/boards/include/boards" premake="mkserprog pico" +picotool="$PWD/src/picotool/xbmkbin" diff --git a/config/git/pico-serprog/pkg.cfg b/config/git/pico-serprog/pkg.cfg index 7c54e9c2..64c26297 100644 --- a/config/git/pico-serprog/pkg.cfg +++ b/config/git/pico-serprog/pkg.cfg @@ -3,4 +3,4 @@ rev="e75e3a20e63269a5e3189bc2e49a6a81d45a636a" url="https://codeberg.org/libreboot/pico-serprog" bkup_url="https://git.disroot.org/libreboot/pico-serprog" -depend="pico-sdk" +depend="pico-sdk picotool" diff --git a/config/git/pico-serprog/rp2040-serprog b/config/git/pico-serprog/rp2040-serprog deleted file mode 120000 index 25af91dc..00000000 --- a/config/git/pico-serprog/rp2040-serprog +++ /dev/null @@ -1 +0,0 @@ -config/git/rp2040-serprog
\ No newline at end of file diff --git a/config/git/picotool/pkg.cfg b/config/git/picotool/pkg.cfg new file mode 100644 index 00000000..3711ce04 --- /dev/null +++ b/config/git/picotool/pkg.cfg @@ -0,0 +1,5 @@ +# SPDX-License-Identifier: GPL-3.0-or-later + +rev="df21059f7ca6f1babc7f1f3b92122cacffc85951" +url="https://github.com/raspberrypi/picotool" +bkup_url="https://codeberg.org/libreboot/picotool" diff --git a/include/rom.sh b/include/rom.sh index 2a7bc837..52e39b52 100644 --- a/include/rom.sh +++ b/include/rom.sh @@ -7,6 +7,9 @@ mkserprog() { + [ $# -lt 1 ] && $err "mkserprog: no arguments provided" + [ "$1" = "pico" ] && mkpicotool + [ "$_f" = "-d" ] && return 0 # dry run basename -as .h "$serdir/"*.h > "$TMPDIR/ser" || $err "!mk $1 $TMPDIR" @@ -20,6 +23,7 @@ mkserprog() ln -srf "$sersrc/build_$pt/" "$sersrc/build") \ && x_ cmake -DPICO_BOARD="$sertarget" \ -DPICO_SDK_PATH="$picosdk" -B "$sersrc/build" "$sersrc" \ + -Dpicotool_DIR="$picotool/picotool" \ && x_ cmake --build "$sersrc/build" [ "$1" = "stm32" ] && x_ make -C "$sersrc" \ libopencm3-just-make BOARD=$sertarget && x_ make -C \ @@ -30,6 +34,18 @@ mkserprog() [ "$XBMK_RELEASE" = "y" ] && mkrom_tarball "bin/serprog_$1"; return 0 } +mkpicotool() +{ + rm -Rf "$picotool" || $err "Can't remove picotool builddir" + ( + x_ cd src/picotool + cmake -DCMAKE_INSTALL_PREFIX=xbmkbin -DPICOTOOL_FLAT_INSTALL=1 \ + -DPICO_SDK_PATH=../pico-sdk || \ + $err "Can't prep picotool" + make install || $err "Can't build picotool"; : + ) || $err "Can't build picotool"; : +} + copyps1bios() { x_ rm -Rf bin/playstation |