From 16b8c06fd3d20dc52f867d44a3bf1aa75d911c7f Mon Sep 17 00:00:00 2001 From: Francesco Gazzetta Date: Thu, 14 Sep 2023 10:39:11 +0200 Subject: [PATCH] star64: add mmc firmware updater And make the sd one actually write to the sd --- pine64/star64/README.md | 18 ++++++++++++++++++ pine64/star64/firmware.nix | 12 ++++++++++-- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/pine64/star64/README.md b/pine64/star64/README.md index 08b6d36..f74da94 100644 --- a/pine64/star64/README.md +++ b/pine64/star64/README.md @@ -83,6 +83,24 @@ hardware.deviceTree.overlays = [{ # Updating the bootloader +## eMMC + +Install the firmware update script + +``` nix +environment.systemPackages = [ + (pkgs.callPackage + "${nixos-hardware}/pine64/star64/firmware.nix" + { }).updater-mmc +]; +``` + +Then run as root + +``` sh +star64-firmware-update-mmc +``` + ## SD-Card Install the firmware update script diff --git a/pine64/star64/firmware.nix b/pine64/star64/firmware.nix index b1b76c8..c300de4 100644 --- a/pine64/star64/firmware.nix +++ b/pine64/star64/firmware.nix @@ -67,12 +67,20 @@ in rec { flashcp -v ${uboot-fit-image}/share/pine64-star64/star64_fw_payload.img /dev/mtd1 ''; }; - updater-sd = writeShellApplication { - name = "star64-firmware-update-sd"; + updater-mmc = writeShellApplication { + name = "star64-firmware-update-mmc"; runtimeInputs = [ ]; text = '' dd if=${spl}/share/pine64-star64/spl.bin of=/dev/mmcblk0p1 conv=fsync dd if=${uboot-fit-image}/share/pine64-star64/star64_fw_payload.img of=/dev/mmcblk0p2 conv=fsync ''; }; + updater-sd = writeShellApplication { + name = "star64-firmware-update-sd"; + runtimeInputs = [ ]; + text = '' + dd if=${spl}/share/pine64-star64/spl.bin of=/dev/mmcblk1p1 conv=fsync + dd if=${uboot-fit-image}/share/pine64-star64/star64_fw_payload.img of=/dev/mmcblk1p2 conv=fsync + ''; + }; }