git: 38d60dbac724 - main - sysutils/blisp: Utility for for flashing Bouffalo Labs RISC-V Microcontrollers and SoCs

From: Daniel Engberg <diizzy_at_FreeBSD.org>
Date: Sat, 25 Mar 2023 18:15:14 UTC
The branch main has been updated by diizzy:

URL: https://cgit.FreeBSD.org/ports/commit/?id=38d60dbac72467af69671a0340dc6fc579d8dc8b

commit 38d60dbac72467af69671a0340dc6fc579d8dc8b
Author:     Pero Orsolic <porsolic@gmail.com>
AuthorDate: 2023-03-25 18:11:58 +0000
Commit:     Daniel Engberg <diizzy@FreeBSD.org>
CommitDate: 2023-03-25 18:14:54 +0000

    sysutils/blisp: Utility for for flashing Bouffalo Labs RISC-V Microcontrollers and SoCs
    
    Utility and library for flashing Bouffalo RISC-V MCUs such as upgrading
    firmware on Pinecil V2 open source soldering iron
    
    PR:             269870
---
 sysutils/Makefile                    |  1 +
 sysutils/blisp/Makefile              | 30 ++++++++++++++++++++++++++++++
 sysutils/blisp/distinfo              |  5 +++++
 sysutils/blisp/files/devd-blisp.conf |  8 ++++++++
 sysutils/blisp/pkg-descr             |  2 ++
 sysutils/blisp/pkg-message           | 14 ++++++++++++++
 6 files changed, 60 insertions(+)

diff --git a/sysutils/Makefile b/sysutils/Makefile
index c591e4bfed06..dead15bdb048 100644
--- a/sysutils/Makefile
+++ b/sysutils/Makefile
@@ -132,6 +132,7 @@
     SUBDIR += bkpupsd
     SUBDIR += bksh
     SUBDIR += bkt
+    SUBDIR += blisp
     SUBDIR += boot-extract
     SUBDIR += bottom
     SUBDIR += boxbackup-devel
diff --git a/sysutils/blisp/Makefile b/sysutils/blisp/Makefile
new file mode 100644
index 000000000000..d278eec2cb3a
--- /dev/null
+++ b/sysutils/blisp/Makefile
@@ -0,0 +1,30 @@
+PORTNAME=	blisp
+DISTVERSION=	g20230317
+CATEGORIES=	sysutils
+
+MAINTAINER=	porsolic@gmail.com
+COMMENT=	Utility and library for flashing Bouffalo RISC-V MCUs
+WWW=		https://github.com/pine64/blisp
+
+LICENSE=	MIT
+LICENSE_FILE=	${WRKSRC}/LICENSE
+
+LIB_DEPENDS=	libserialport.so:devel/libserialport
+
+USES=		cmake
+
+USE_GITHUB=	yes
+GH_ACCOUNT=	pine64
+GH_TAGNAME=	6f508d3
+GH_TUPLE=	argtable:argtable3:6f0e40b:group_argtable/vendor/argtable3
+
+PLIST_FILES=	bin/blisp \
+		etc/devd/blisp.conf
+
+CMAKE_ON=	BLISP_BUILD_CLI
+
+do-install:
+	${INSTALL_PROGRAM} ${BUILD_WRKSRC}/tools/blisp/blisp ${STAGEDIR}${PREFIX}/bin
+	${INSTALL_DATA} files/devd-blisp.conf ${STAGEDIR}${PREFIX}/etc/devd/blisp.conf
+
+.include <bsd.port.mk>
diff --git a/sysutils/blisp/distinfo b/sysutils/blisp/distinfo
new file mode 100644
index 000000000000..0e4246ff5abe
--- /dev/null
+++ b/sysutils/blisp/distinfo
@@ -0,0 +1,5 @@
+TIMESTAMP = 1679043406
+SHA256 (pine64-blisp-g20230317-6f508d3_GH0.tar.gz) = 47e7e12aa5edc85f61ff4cdea37eca4169bf5479701d8ed0214875b6b8e627b6
+SIZE (pine64-blisp-g20230317-6f508d3_GH0.tar.gz) = 110347
+SHA256 (argtable-argtable3-6f0e40b_GH0.tar.gz) = 5ac298f92cd26bc2cab541ac7a8f7295a040675d621e594864bb93ac8bfbcf59
+SIZE (argtable-argtable3-6f0e40b_GH0.tar.gz) = 510332
diff --git a/sysutils/blisp/files/devd-blisp.conf b/sysutils/blisp/files/devd-blisp.conf
new file mode 100644
index 000000000000..1ec38d7baae7
--- /dev/null
+++ b/sysutils/blisp/files/devd-blisp.conf
@@ -0,0 +1,8 @@
+# enable user flash of Bouffalo Labs RISC-V MCUs (such in Pinecil v2 soldering
+# iron, PineCone dev board, PineNut programmer and others).
+attach 100 {
+	match "vendor"		"0xffff";
+	match "product"		"0xffff";
+	match "release"		"0x0200";
+	action "chmod 660 /dev/$ugen";
+};
diff --git a/sysutils/blisp/pkg-descr b/sysutils/blisp/pkg-descr
new file mode 100644
index 000000000000..4b50bf9413d0
--- /dev/null
+++ b/sysutils/blisp/pkg-descr
@@ -0,0 +1,2 @@
+Utility and library for flashing Bouffalo RISC-V MCUs such as upgrading
+firmware on Pinecil V2 open source soldering iron
diff --git a/sysutils/blisp/pkg-message b/sysutils/blisp/pkg-message
new file mode 100644
index 000000000000..8fe4f97eb12e
--- /dev/null
+++ b/sysutils/blisp/pkg-message
@@ -0,0 +1,14 @@
+[
+{ type: install
+  message: <<EOM
+Blisp is a utility for flashing Bouffalo Labs RISC-V Microcontrollers and SoCs.
+It's tested with Pinecil v2 soldering iron, but should work with PineCone dev board, PineNut programmer and other hardware with same MCU.
+
+A devd conf file is included which will set permission on USB device to enable flashing.
+To activate execute following command: service devd restart
+
+Example:
+blisp --write -c bl70x --reset <path/to/firmware.bin>
+EOM
+}
+]