From c1eb4e0c6482a20b43530dd0a1ed1855a67e914e Mon Sep 17 00:00:00 2001 From: Derek Date: Mon, 23 May 2022 10:16:12 -0400 Subject: [PATCH] Changes to allow building for Macchiatobin and building modules necessary to operate mcbin hardware (#3784) * tf-a sources use mrvl_flash rather than 'all' target * add armada 8k ethernet and SFP cages for macchiatobin use * u-boot configuration for mcbin * fix bootscript for u-boot variables * separate ebin and mcbin with if statements * add a8k PCIe and CPUFreq drivers for macchiatobin --- config/bootscripts/boot-macchiatobin-doubleshot.cmd | 4 ++-- config/kernel/linux-mvebu64-edge.config | 11 +++++++---- config/sources/families/mvebu64.conf | 12 ++++++++---- .../0001-env_and_10g.patch | 12 ++++++++++++ ...-script.patch => boot-from-script.patch.disabled} | 0 5 files changed, 29 insertions(+), 10 deletions(-) create mode 100644 patch/u-boot/u-boot-mvebu64/board_macchiatobin-doubleshot/0001-env_and_10g.patch rename patch/u-boot/u-boot-mvebu64/board_macchiatobin-doubleshot/{0001-boot-from-script.patch => boot-from-script.patch.disabled} (100%) diff --git a/config/bootscripts/boot-macchiatobin-doubleshot.cmd b/config/bootscripts/boot-macchiatobin-doubleshot.cmd index 67073191e..81c013378 100644 --- a/config/bootscripts/boot-macchiatobin-doubleshot.cmd +++ b/config/bootscripts/boot-macchiatobin-doubleshot.cmd @@ -18,8 +18,8 @@ env import -t ${scriptaddr} ${filesize} setenv bootargs "$console root=${rootdev} rootfstype=${rootfstype} rootwait loglevel=${verbosity} $extra_params $cpuidle" ext4load mmc 1:1 $kernel_addr_r $image_name -ext4load mmc 1:1 $initrd_addr $initrd_image +ext4load mmc 1:1 $initrd_addr_r $initrd_image ext4load mmc 1:1 $fdt_addr_r $fdt_name -booti $kernel_addr_r $initrd_addr $fdt_addr_r +booti $kernel_addr_r $initrd_addr_r $fdt_addr_r # mkimage -C none -A arm -T script -d /boot/boot.cmd /boot/boot.scr diff --git a/config/kernel/linux-mvebu64-edge.config b/config/kernel/linux-mvebu64-edge.config index 99b917f92..48072ed77 100644 --- a/config/kernel/linux-mvebu64-edge.config +++ b/config/kernel/linux-mvebu64-edge.config @@ -597,7 +597,7 @@ CONFIG_CPUFREQ_DT_PLATDEV=y CONFIG_ACPI_CPPC_CPUFREQ=y CONFIG_ACPI_CPPC_CPUFREQ_FIE=y CONFIG_ARM_ARMADA_37XX_CPUFREQ=y -# CONFIG_ARM_ARMADA_8K_CPUFREQ is not set +CONFIG_ARM_ARMADA_8K_CPUFREQ=y # end of CPU Frequency scaling # end of CPU Power Management @@ -1963,9 +1963,11 @@ CONFIG_PCI_HOST_GENERIC=y # # DesignWare PCI Core Support # +CONFIG_PCIE_DW=y +CONFIG_PCIE_DW_HOST=y # CONFIG_PCIE_DW_PLAT_HOST is not set # CONFIG_PCI_HISI is not set -# CONFIG_PCIE_ARMADA_8K is not set +CONFIG_PCIE_ARMADA_8K=y # CONFIG_PCIE_KIRIN is not set # CONFIG_PCI_MESON is not set # CONFIG_PCIE_AL is not set @@ -2818,7 +2820,8 @@ CONFIG_NET_VENDOR_LITEX=y CONFIG_NET_VENDOR_MARVELL=y CONFIG_MVMDIO=y CONFIG_MVNETA=y -# CONFIG_MVPP2 is not set +CONFIG_MVPP2=m +CONFIG_MVPP2_PTP=y # CONFIG_SKGE is not set CONFIG_SKY2=y # CONFIG_SKY2_DEBUG is not set @@ -2943,7 +2946,7 @@ CONFIG_PHYLIB=y CONFIG_SWPHY=y # CONFIG_LED_TRIGGER_PHY is not set CONFIG_FIXED_PHY=y -# CONFIG_SFP is not set +CONFIG_SFP=m # # MII PHY device drivers diff --git a/config/sources/families/mvebu64.conf b/config/sources/families/mvebu64.conf index f388b60e6..c7f023458 100644 --- a/config/sources/families/mvebu64.conf +++ b/config/sources/families/mvebu64.conf @@ -76,12 +76,16 @@ family_tweaks() chroot $SDCARD /bin/bash -c "apt-get -y -qq remove --auto-remove linux-sound-base alsa-base alsa-utils bluez>/dev/null 2>&1" [[ -f $SDCARD/etc/netplan/armbian-default.yaml ]] && sed -i "s/^ renderer.*/ renderer: networkd/" $SDCARD/etc/netplan/armbian-default.yaml cp $SRC/packages/bsp/mvebu64/networkd/10* $SDCARD/etc/systemd/network/ - echo "#Marvell Espressobin Console" >> $SDCARD/etc/securetty - echo "ttyMV0" >> $SDCARD/etc/securetty + if [[ $BOARD = "espressobin" ]]; then + echo "#Marvell Espressobin Console" >> $SDCARD/etc/securetty + echo "ttyMV0" >> $SDCARD/etc/securetty + fi } family_tweaks_bsp() { - cp "$SRC/packages/bsp/mvebu64/initramfs/99-uboot-fit" "$destination/etc/initramfs/post-update.d/" + if [[ $BOARD = "espressobin" ]]; then + cp "$SRC/packages/bsp/mvebu64/initramfs/99-uboot-fit" "$destination/etc/initramfs/post-update.d/" + fi } atf_custom_postprocess() @@ -114,7 +118,7 @@ uboot_custom_postprocess() display_alert "Building $FILENAME" "" "info" # http://wiki.macchiatobin.net/tiki-index.php?page=Build+from+source+-+Bootloader#Building_ATF make distclean >> $DEST/debug/compilation.log 2>&1 - make USE_COHERENT_MEM=0 LOG_LEVEL=20 MV_DDR_PATH=$SRC/cache/sources/marvell-ddr PLAT=a80x0_mcbin CROSS_COMPILE=$ATF1 BL33=$BL33 all fip $CTHREADS >> $DEST/debug/compilation.log 2>&1 + make USE_COHERENT_MEM=0 LOG_LEVEL=20 MV_DDR_PATH=$SRC/cache/sources/marvell-ddr PLAT=a80x0_mcbin CROSS_COMPILE=$ATF1 BL33=$BL33 mrvl_flash $CTHREADS >> $DEST/debug/compilation.log 2>&1 cp build/a80x0_mcbin/release/flash-image.bin $ubootdir/$FILENAME else cd $moxbootdir diff --git a/patch/u-boot/u-boot-mvebu64/board_macchiatobin-doubleshot/0001-env_and_10g.patch b/patch/u-boot/u-boot-mvebu64/board_macchiatobin-doubleshot/0001-env_and_10g.patch new file mode 100644 index 000000000..dbbd7b34f --- /dev/null +++ b/patch/u-boot/u-boot-mvebu64/board_macchiatobin-doubleshot/0001-env_and_10g.patch @@ -0,0 +1,12 @@ +diff --git a/configs/mvebu_mcbin-88f8040_defconfig b/configs/mvebu_mcbin-88f8040_defconfig +index f45ce91f6..4e81ad4ef 100644 +--- a/configs/mvebu_mcbin-88f8040_defconfig ++++ b/configs/mvebu_mcbin-88f8040_defconfig +@@ -52,6 +54,7 @@ CONFIG_SPI_FLASH_MACRONIX=y + CONFIG_SPI_FLASH_SPANSION=y + CONFIG_SPI_FLASH_STMICRO=y + CONFIG_SPI_FLASH_WINBOND=y ++CONFIG_PHYLIB_10G=y + CONFIG_PHY_MARVELL=y + CONFIG_PHY_GIGE=y + CONFIG_E1000=y diff --git a/patch/u-boot/u-boot-mvebu64/board_macchiatobin-doubleshot/0001-boot-from-script.patch b/patch/u-boot/u-boot-mvebu64/board_macchiatobin-doubleshot/boot-from-script.patch.disabled similarity index 100% rename from patch/u-boot/u-boot-mvebu64/board_macchiatobin-doubleshot/0001-boot-from-script.patch rename to patch/u-boot/u-boot-mvebu64/board_macchiatobin-doubleshot/boot-from-script.patch.disabled