From owner-svn-ports-all@freebsd.org Fri Nov 13 17:13:14 2020 Return-Path: Delivered-To: svn-ports-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AC2372E813B; Fri, 13 Nov 2020 17:13:14 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CXlRG4SQ1z4dqh; Fri, 13 Nov 2020 17:13:14 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8C0F01BB29; Fri, 13 Nov 2020 17:13:14 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0ADHDEkn070528; Fri, 13 Nov 2020 17:13:14 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0ADHDDEH070520; Fri, 13 Nov 2020 17:13:13 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202011131713.0ADHDDEH070520@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Fri, 13 Nov 2020 17:13:13 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r555035 - in head/sysutils: . u-boot-master u-boot-sopine-spi u-boot-sopine-spi/files X-SVN-Group: ports-head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head/sysutils: . u-boot-master u-boot-sopine-spi u-boot-sopine-spi/files X-SVN-Commit-Revision: 555035 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2020 17:13:14 -0000 Author: manu Date: Fri Nov 13 17:13:13 2020 New Revision: 555035 URL: https://svnweb.freebsd.org/changeset/ports/555035 Log: u-boot-sopine-spi: Add new port While the u-boot-sopine port can boot from SPI on the Pine64-LTS and Sopine module the env is saved and read from the eMMC. This is a modified sopine u-boot that only read and store the env in the spi flash available on thoses boards. Additionally there is also a sopine-spi-flasher.img that can be burnt on a sdcard and when booted it will program the spi flash. Added: head/sysutils/u-boot-sopine-spi/ head/sysutils/u-boot-sopine-spi/Makefile (contents, props changed) head/sysutils/u-boot-sopine-spi/files/ head/sysutils/u-boot-sopine-spi/files/boot.cmd (contents, props changed) head/sysutils/u-boot-sopine-spi/files/spi_fragment (contents, props changed) head/sysutils/u-boot-sopine-spi/pkg-descr (contents, props changed) Modified: head/sysutils/Makefile head/sysutils/u-boot-master/Makefile Modified: head/sysutils/Makefile ============================================================================== --- head/sysutils/Makefile Fri Nov 13 17:09:20 2020 (r555034) +++ head/sysutils/Makefile Fri Nov 13 17:13:13 2020 (r555035) @@ -1392,6 +1392,7 @@ SUBDIR += u-boot-rpi4 SUBDIR += u-boot-sinovoip-bpi-m3 SUBDIR += u-boot-sopine + SUBDIR += u-boot-sopine-spi SUBDIR += u-boot-tools SUBDIR += u-boot-utilite SUBDIR += u-boot-wandboard Modified: head/sysutils/u-boot-master/Makefile ============================================================================== --- head/sysutils/u-boot-master/Makefile Fri Nov 13 17:09:20 2020 (r555034) +++ head/sysutils/u-boot-master/Makefile Fri Nov 13 17:13:13 2020 (r555035) @@ -173,6 +173,13 @@ PLIST_FILES+= ${UBOOT_DIR}/${i} .endfor PLIST_FILES+= ${UBOOT_DIR}/README +.if defined(PLIST_EXTRAS) +.for i in ${PLIST_EXTRAS} +PLIST_FILES+= ${UBOOT_DIR}/${i} +.endfor +.endif + +.if !defined(NO_METADATA) .if defined(UBOOT_METADATA_${FAMILY:tu}_METHOD) METADATA_METHOD=${UBOOT_METADATA_${FAMILY:tu}_METHOD} METADATA_FILES=${UBOOT_METADATA_${FAMILY:tu}_FILES} @@ -184,6 +191,7 @@ METADATA_BS=${UBOOT_METADATA_${FAMILY:tu}_RAW_BS} .elif ${METADATA_METHOD} == "file" .else .error "Unsupported METADATA_METHOD" +.endif .endif .endif Added: head/sysutils/u-boot-sopine-spi/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sysutils/u-boot-sopine-spi/Makefile Fri Nov 13 17:13:13 2020 (r555035) @@ -0,0 +1,25 @@ +# $FreeBSD$ + +MASTERDIR= ${.CURDIR}/../u-boot-master + +MODEL= sopine-spi +BOARD_CONFIG= sopine_baseboard_defconfig +FAMILY= allwinner64 + +CONFIG_FRAGMENT= ${.CURDIR}/../u-boot-sopine-spi/files/spi_fragment +FRAGMENT_NAME= spi_fragment +NO_METADATA= yes +UBOOT_PLIST= u-boot-sunxi-with-spl.bin \ + boot.scr +PLIST_EXTRAS= sopine-spi-flasher.img + +post-build: + mkimage -C none -A arm64 -T script -d ${.CURDIR}/../u-boot-sopine-spi/files/boot.cmd ${WRKSRC}/boot.scr + +post-stage: + makefs -t msdos -s 5m ${WRKDIR}/sopine-spi-flash.msdos ${STAGEDIR}/${INST} + mkimg -v -s mbr -p fat32::5M:1M -o ${STAGEDIR}/${INST}/sopine-spi-flasher.img + dd if=${WRKDIR}/sopine-spi-flash.msdos of=${STAGEDIR}/${INST}/sopine-spi-flasher.img bs=1M oseek=1 conv=notrunc + dd if=${STAGEDIR}/${INST}/u-boot-sunxi-with-spl.bin of=${STAGEDIR}/${INST}/sopine-spi-flasher.img bs=1k oseek=8 conv=notrunc + +.include "${MASTERDIR}/Makefile" Added: head/sysutils/u-boot-sopine-spi/files/boot.cmd ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sysutils/u-boot-sopine-spi/files/boot.cmd Fri Nov 13 17:13:13 2020 (r555035) @@ -0,0 +1,8 @@ +sf probe +sf erase 0 0x100000 +fatload mmc 0 ${kernel_addr_r} u-boot-sunxi-with-spl.bin +sf write ${kernel_addr_r} 0 0x100000 +echo "Flash programmed" +while true; do +sleep 1 +done Added: head/sysutils/u-boot-sopine-spi/files/spi_fragment ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sysutils/u-boot-sopine-spi/files/spi_fragment Fri Nov 13 17:13:13 2020 (r555035) @@ -0,0 +1,5 @@ +CONFIG_ENV_SIZE=0x20000 +CONFIG_ENV_OFFSET=0x100000 +CONFIG_ENV_SECT_SIZE=0x10000 +CONFIG_ENV_IS_IN_FAT=n +CONFIG_ENV_IS_IN_SPI_FLASH=y Added: head/sysutils/u-boot-sopine-spi/pkg-descr ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sysutils/u-boot-sopine-spi/pkg-descr Fri Nov 13 17:13:13 2020 (r555035) @@ -0,0 +1,18 @@ +U-Boot loader and related files for the Sopine SPI Flash. + +To install this bootloader on the spi flash just do from a running sopine system: +dd if=/usr/local/share/u-boot/u-boot-sopine-spi/u-boot-sunxi-with-spl.bin of=/dev/flash/spi0 bs=64k conv=sync + +U-boot environment variables are save in the flash and not in the fat partition. + +You can also use the flasher image +dd if=/usr/local/share/u-boot/u-boot-sopine-spi/sopine-spi-flasher.img of=/path/to/sdcard +Boot the sdcard on the sopine/pine64-lts and it will erase and populate the spi flash +with this u-boot. +Since there is no led that we can flash do indicate that flashing is done the best way to +know it to connect an uart adapter or hdmi monitor. + +For information about running FreeBSD on Allwinner boards, see + https://wiki.freebsd.org/FreeBSD/arm/Allwinner + +WWW: https://www.denx.de/wiki/U-Boot