Skip to content

Commit

Permalink
[U-Boot env] Remove A revision Ethernet device tree adjustment
Browse files Browse the repository at this point in the history
which is not required on Star64, and fix "find" call in build workflow.

Signed-off-by: MichaIng <[email protected]>
  • Loading branch information
MichaIng committed Dec 17, 2023
1 parent 3831beb commit 7667621
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/visionfive2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
make -j$(nproc)
make install INSTALL_PATH='linux-image-star64/boot'
make dtbs_install INSTALL_DTBS_PATH='linux-image-star64/usr/lib/linux-image-star64'
find linux-image-star64/usr/lib/linux-image-star64 -mindepth 1 ! \( -name 'starfive' -o 'jh7110-pine64-star64.dtb' \) -exec rm -Rfv {} +
find linux-image-star64/usr/lib/linux-image-star64 -mindepth 1 ! \( -name 'starfive' -o -name 'jh7110-pine64-star64.dtb' \) -exec rm -Rfv {} +
make modules_install INSTALL_MOD_PATH='linux-image-star64'
rm linux-image-star64/lib/modules/*/build linux-image-star64/lib/modules/*/source
mkdir -p linux-image-star64/lib/firmware
Expand Down
9 changes: 2 additions & 7 deletions linux-image-star64/etc/u-boot-initial-env
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,9 @@ efi_dtb_prefixes=/ /dtb/ /dtb/current/
fdtfile=starfive/jh7110-pine64-star64.dtb
ipaddr=192.168.120.230

preboot=run chipa_set_uboot
chipa_set_uboot=fdt addr "${uboot_fdt_addr}"; run chipa_set
chipa_set=if test "${chip_vision}" = 'A'; then echo 'VisionFive 2 revision A detected, updating device tree for Ethernet access ...'; run chipa_gmac_set; fi
chipa_gmac_set=fdt set /soc/ethernet@16030000/ethernet-phy@0 tx_inverted_10 <0x0>; fdt set /soc/ethernet@16030000/ethernet-phy@0 tx_inverted_100 <0x0>; fdt set /soc/ethernet@16030000/ethernet-phy@0 tx_inverted_1000 <0x0>; fdt set /soc/ethernet@16030000/ethernet-phy@0 tx_delay_sel <0x9>; fdt set /soc/ethernet@16040000/ethernet-phy@1 tx_inverted_10 <0x0>; fdt set /soc/ethernet@16040000/ethernet-phy@1 tx_inverted_100 <0x0>; fdt set /soc/ethernet@16040000/ethernet-phy@1 tx_inverted_1000 <0x0>; fdt set /soc/ethernet@16040000/ethernet-phy@1 tx_delay_sel <0x9>

bootcmd=setenv devnum; for target in "${boot_targets}"; do echo "Trying to boot from ${target} ..."; run "bootcmd_${target}"; done

boot_targets=mmc1 usb0 nvme0 mmc0 dhcp
boot_targets=mmc1 mmc0 dhcp
bootcmd_mmc1=devnum=1; run mmc_boot
bootcmd_usb0=devnum=0; run usb_boot
bootcmd_nvme0=devnum=0; run nvme_boot
Expand Down Expand Up @@ -53,7 +48,7 @@ fdt_loaddtb=echo "Trying to load device tree from ${devtype}${devnum} partition
fdt_sizecheck=fatsize "${devtype}" "${devnum}:${bootpart}" "${prefix}dtbs/${fdtfile}"
set_fdt_distro=echo "Updating device tree ${prefix}dtbs/${fdtfile} on ${devtype}${devnum} partition ${bootpart} ..."; run chipa_set_linux; run cpu_vol_set; fatwrite "${devtype}" "${devnum}:${bootpart}" "${fdt_addr_r}" "${prefix}dtbs/${fdtfile}" "${filesize}"

chipa_set_linux=run visionfive2_mem_set; run chipa_set
chipa_set_linux=run visionfive2_mem_set
visionfive2_mem_set=fdt memory "${memory_addr}" "${memory_size}"; run cma_resize
cma_resize=if test "${memory_size}" -eq 40000000; then run cma_ddr1g_set; elif test "${memory_size}" -eq 80000000; then run cma_ddr2g_set; elif test "${memory_size}" -eq 100000000; then run cma_ddr4g_set; elif test "${memory_size}" -ge 200000000; then run cma_ddr8g_set; fi
cma_ddr1g_set=echo 'Updating device tree for 1 GiB RAM size ...'; fdt set "${cma_node}" size "<0x0 0x${cma_1g}>"; fdt set "${cma_node}" alloc-ranges "<0x0 0x${cma_start} 0x0 0x${cma_1g}>"
Expand Down

0 comments on commit 7667621

Please sign in to comment.