Skip to content

Commit

Permalink
Wiren Board 8 support (#155)
Browse files Browse the repository at this point in the history
* add Wiren Board 8 support
* of: ignore mdio-gpio aliases in of_find_gpiochips
* add comment about missing compatibility entry in check-if-supports-usb-network.sh

---------

Co-authored-by: Evgeny Boger <[email protected]>
  • Loading branch information
webconn and evgeny-boger authored May 21, 2024
1 parent 8d22b38 commit 76c2097
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 17 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ install: build_mass_storage
utils/lib/wb-usb-otg/wb-usb-otg-common.sh \
utils/lib/wb-usb-otg/wb-usb-otg-start.sh \
utils/lib/wb-usb-otg/wb-usb-otg-stop.sh \
utils/lib/wb-usb-otg/check-wb7.sh
utils/lib/wb-usb-otg/check-if-supports-usb-network.sh

install -Dm0644 -t $(USBOTGDIR) \
$(MASS_STORAGE_FNAME)
Expand Down
12 changes: 12 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
wb-utils (4.21.1) stable; urgency=medium

* fix USB device (Debug Network) mode on WB8

-- Evgeny Boger <[email protected]> Wed, 20 May 2024 20:12:24 +0300

wb-utils (4.21.0) stable; urgency=medium

* add Wiren Board 8 support

-- Nikita Maslov <[email protected]> Mon, 20 May 2024 16:03:58 +0500

wb-utils (4.20.5) stable; urgency=medium

* Fix compatibility checks for FIT updates
Expand Down
2 changes: 1 addition & 1 deletion debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Package: wb-utils
Architecture: all
Depends: ${shlibs:Depends}, ${misc:Depends}, lsb-base (>= 4.1), u-boot-tools-wb (>= 2015.07+wb-3), inotify-tools, pv, jq,
nginx-extras, python3-wb-common (>= 2.0.0~~), wb-configs (>= 3.18.0~~), util-linux,
linux-image-wb6 (>= 5.10.35-wb108~~) | linux-image-wb7 (>= 5.10.35-wb130~~), wb-bootlet,
linux-image-wb6 (>= 5.10.35-wb108~~) | linux-image-wb7 (>= 5.10.35-wb130~~) | linux-image-wb8, wb-bootlet,
device-tree-compiler, parted, rsync, systemd (>= 243), wb-ec-firmware
Conflicts: wb-configs (<< 1.69.4)
Breaks: wb-homa-ism-radio (<< 1.17.2), wb-rules-system (<< 1.6.1), wb-mqtt-serial (<< 1.47.2), wb-mqtt-homeui (<< 1.7.1),
Expand Down
2 changes: 1 addition & 1 deletion debian/wb-utils.wb-usb-otg.service
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ RemainAfterExit=true
ExecStop=/usr/lib/wb-utils/wb-usb-otg/wb-usb-otg-stop.sh
StandardOutput=journal
StandardError=journal
ExecCondition=/usr/lib/wb-utils/wb-usb-otg/check-wb7.sh
ExecCondition=/usr/lib/wb-utils/wb-usb-otg/check-if-supports-usb-network.sh

[Install]
WantedBy=multi-user.target
2 changes: 1 addition & 1 deletion utils/lib/of.sh
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ of_get_prop_auto() {

of_find_gpiochips() {
local n=0
for gpiochip in $(of_node_props /aliases | grep gpio); do
for gpiochip in $(of_node_props /aliases | grep gpio | grep -v mdio); do
node="$(of_get_prop_str /aliases "$gpiochip")"
phandle=$(of_get_prop_ulong "$node" phandle)
ncells=$(of_get_prop_ulong "$node" "#gpio-cells")
Expand Down
8 changes: 7 additions & 1 deletion utils/lib/wb-image-update/fit/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,13 @@ echo -n "+fit-factory-reset " >> /var/lib/wb-image-update/firmware-compatible
echo -n "+force-repartition " >> /var/lib/wb-image-update/firmware-compatible
echo -n "+repartition-ramsize-fix " >> /var/lib/wb-image-update/firmware-compatible

if [[ ! -f /var/lib/wb-image-update/zImage ]] || [[ ! -f /var/lib/wb-image-update/boot.dtb ]]; then
if of_machine_match "wirenboard,wirenboard-8xx"; then
KERNEL_IMAGE="Image.gz"
else
KERNEL_IMAGE="zImage"
fi

if [[ ! -f "/var/lib/wb-image-update/$KERNEL_IMAGE" ]] || [[ ! -f /var/lib/wb-image-update/boot.dtb ]]; then
echo "bootlet is not found, something went wrong"
exit 1
fi
2 changes: 1 addition & 1 deletion utils/lib/wb-image-update/postinst/10update-wbec-firmware
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ fi
COMPATIBLE=$(chroot "$ROOTFS" fdtget -t s "$FACTORY_DTB" / compatible)

case "$COMPATIBLE" in
*wirenboard,wirenboard-74x*)
*wirenboard,wirenboard-74x*|*wirenboard,wirenboard-8xx*)
echo "Trying to update WBEC firmware"
chroot "$ROOTFS" /bin/bash -c "export DTB=$FACTORY_DTB; /usr/bin/wb-ec-firmware-update"
;;
Expand Down
13 changes: 13 additions & 0 deletions utils/lib/wb-usb-otg/check-if-supports-usb-network.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

. /usr/lib/wb-utils/wb_env.sh

wb_source "of"

# wirenboard-720 matches all Wiren Board 7.x boards, that all is because of missing entry in earlier DTBs

if of_machine_match "wirenboard,wirenboard-720" || of_machine_match "wirenboard,wirenboard-84x"; then
exit 0
fi

exit 1
11 changes: 0 additions & 11 deletions utils/lib/wb-usb-otg/check-wb7.sh

This file was deleted.

0 comments on commit 76c2097

Please sign in to comment.