]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
gemini: Activate serial USB console on the DNS-313
authorLinus Walleij <linus.walleij@linaro.org>
Sun, 11 Jun 2023 22:15:18 +0000 (00:15 +0200)
committerLinus Walleij <linus.walleij@linaro.org>
Thu, 10 Apr 2025 07:38:18 +0000 (09:38 +0200)
This brings up a serial console on the USB device port of
the DNS-313 by:

- Activating the usbgadget feature
- Selecting the usbgadget-acm package
- Adding an inittab that opens a console at ttyGS0 which is
  the device side of ttyACMn of a connected host

Link: http://patchwork.ozlabs.org/project/openwrt/patch/20250403-dns313-usb-serial-v2-4-d84de8e86931@linaro.org/
Cc: Chuanhong Guo <gch981213@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
target/linux/gemini/Makefile
target/linux/gemini/base-files/etc/board.d/02_usbgadget [new file with mode: 0644]
target/linux/gemini/base-files/etc/inittab [new file with mode: 0644]
target/linux/gemini/image/Makefile

index b2869ff72edf2db557843a729a67ec97cf601b4b..ddfe67be2bb3ddf8a00b53d9729a743fa4b4b5c8 100644 (file)
@@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk
 ARCH:=arm
 BOARD:=gemini
 BOARDNAME:=Cortina Systems CS351x
-FEATURES:=squashfs pci rtc usb dt gpio display ext4 rootfs-part boot-part
+FEATURES:=squashfs pci rtc usb usbgadget dt gpio display ext4 rootfs-part boot-part
 CPU_TYPE:=fa526
 SUBTARGETS:=generic
 
diff --git a/target/linux/gemini/base-files/etc/board.d/02_usbgadget b/target/linux/gemini/base-files/etc/board.d/02_usbgadget
new file mode 100644 (file)
index 0000000..7337e66
--- /dev/null
@@ -0,0 +1,11 @@
+. /lib/functions.sh
+
+case "$(board_name)" in
+dlink,dns-313)
+       uci set usbgadget.@preset[0].name="acm"
+       uci set usbgadget.@preset[0].UDC="69000000.usb"
+       uci commit usbgadget
+       ;;
+esac
+
+exit 0
diff --git a/target/linux/gemini/base-files/etc/inittab b/target/linux/gemini/base-files/etc/inittab
new file mode 100644 (file)
index 0000000..2530364
--- /dev/null
@@ -0,0 +1,4 @@
+::sysinit:/etc/init.d/rcS S boot
+::shutdown:/etc/init.d/rcS K shutdown
+::askconsole:/usr/libexec/login.sh
+ttyGS0::askfirst:/usr/libexec/login.sh
index 389c8f8c442af8323de57c3f22b287716af88dfd..c5d09e7120b47cab08a0d479ef2c6eb48ac4a783 100644 (file)
@@ -170,7 +170,7 @@ define Device/dlink_dns-313
        DEVICE_VENDOR := D-Link
        DEVICE_MODEL := DNS-313 1-Bay Network Storage Enclosure
        DEVICE_DTS := gemini-dlink-dns-313
-       DEVICE_PACKAGES := $(GEMINI_NAS_PACKAGES)
+       DEVICE_PACKAGES := $(GEMINI_NAS_PACKAGES) usbgadget-acm
        BLOCKSIZE := 1k
        FILESYSTEMS := ext4
        IMAGES := factory.bin.gz