From 7b5933e4e25bc0275a33444011b2301b4e7ddf16 Mon Sep 17 00:00:00 2001 From: lkunjumon Date: Tue, 2 Feb 2021 16:08:33 +0530 Subject: [PATCH 1/6] Adding platform files for tg48m-p and tg4810m --- build_debian.sh | 5 + platform/marvell-arm64/one-image.mk | 1 + platform/marvell-arm64/platform-tg4810m.mk | 12 ++ platform/marvell-arm64/platform-tg48m-p.mk | 13 ++ platform/marvell-arm64/platform.conf | 136 +++++++++++++------ platform/marvell-arm64/rules.mk | 2 + platform/marvell-arm64/sonic_fit_tg4810m.its | 55 ++++++++ platform/marvell-arm64/sonic_fit_tg48m-p.its | 55 ++++++++ 8 files changed, 241 insertions(+), 38 deletions(-) create mode 100644 platform/marvell-arm64/platform-tg4810m.mk create mode 100644 platform/marvell-arm64/platform-tg48m-p.mk create mode 100644 platform/marvell-arm64/sonic_fit_tg4810m.its create mode 100644 platform/marvell-arm64/sonic_fit_tg48m-p.its diff --git a/build_debian.sh b/build_debian.sh index 2302889b9..9bd2838ee 100755 --- a/build_debian.sh +++ b/build_debian.sh @@ -535,7 +535,12 @@ if [[ $CONFIGURED_ARCH == armhf || $CONFIGURED_ARCH == arm64 ]]; then sudo LANG=C chroot $FILESYSTEM_ROOT mv /boot/u${INITRD_FILE} /boot/$INITRD_FILE elif [[ $CONFIGURED_ARCH == arm64 ]]; then sudo cp -v $PLATFORM_DIR/${sonic_asic_platform}-${CONFIGURED_ARCH}/sonic_fit.its $FILESYSTEM_ROOT/boot/ + sudo cp -v $PLATFORM_DIR/${sonic_asic_platform}-${CONFIGURED_ARCH}/sonic_fit_tg48m-p.its $FILESYSTEM_ROOT/boot/ + sudo cp -v $PLATFORM_DIR/${sonic_asic_platform}-${CONFIGURED_ARCH}/sonic_fit_tg4810m.its $FILESYSTEM_ROOT/boot/ sudo LANG=C chroot $FILESYSTEM_ROOT mkimage -f /boot/sonic_fit.its /boot/sonic_${CONFIGURED_ARCH}.fit + sudo LANG=C chroot $FILESYSTEM_ROOT mkimage -f /boot/sonic_fit_tg48m-p.its /boot/sonic_tg48m-p_${CONFIGURED_ARCH}.fit + sudo LANG=C chroot $FILESYSTEM_ROOT mkimage -f /boot/sonic_fit_tg4810m.its /boot/sonic_tg4810m_${CONFIGURED_ARCH}.fit + fi fi diff --git a/platform/marvell-arm64/one-image.mk b/platform/marvell-arm64/one-image.mk index 3d916be4e..a5ada29a3 100644 --- a/platform/marvell-arm64/one-image.mk +++ b/platform/marvell-arm64/one-image.mk @@ -5,6 +5,7 @@ $(SONIC_ONE_IMAGE)_MACHINE = marvell-arm64 $(SONIC_ONE_IMAGE)_IMAGE_TYPE = onie $(SONIC_ONE_IMAGE)_INSTALLS += $(SYSTEMD_SONIC_GENERATOR) $(SONIC_ONE_IMAGE)_INSTALLS += $(LINUX_KERNEL_DTB) +$(SONIC_ONE_IMAGE)_LAZY_INSTALLS += $(TG48M-P_PLATFORM) $(TG4810M_PLATFORM) ifeq ($(INSTALL_DEBUG_TOOLS),y) $(SONIC_ONE_IMAGE)_DOCKERS += $(SONIC_INSTALL_DOCKER_DBG_IMAGES) $(SONIC_ONE_IMAGE)_DOCKERS += $(filter-out $(patsubst %-$(DBG_IMAGE_MARK).gz,%.gz, $(SONIC_INSTALL_DOCKER_DBG_IMAGES)), $(SONIC_INSTALL_DOCKER_IMAGES)) diff --git a/platform/marvell-arm64/platform-tg4810m.mk b/platform/marvell-arm64/platform-tg4810m.mk new file mode 100644 index 000000000..a84a5024c --- /dev/null +++ b/platform/marvell-arm64/platform-tg4810m.mk @@ -0,0 +1,12 @@ +# TG4810M Platform + +TG4810M_VERSION = 1.0 +export TG4810M_VERSION + +TG4810M_PLATFORM = sonic-platform-tg4810m_$(TG4810M_VERSION)_$(CONFIGURED_ARCH).deb +$(TG4810M_PLATFORM)_SRC_PATH = $(PLATFORM_PATH)/sonic-platform-tg4810m +$(TG4810M_PLATFORM)_DEPENDS += $(LINUX_HEADERS) $(LINUX_HEADERS_COMMON) +$(TG4810M_PLATFORM)_PLATFORM = arm64-delta_tg4810m-r0 + +SONIC_DPKG_DEBS += $(TG4810M_PLATFORM) + diff --git a/platform/marvell-arm64/platform-tg48m-p.mk b/platform/marvell-arm64/platform-tg48m-p.mk new file mode 100644 index 000000000..8fa14ef28 --- /dev/null +++ b/platform/marvell-arm64/platform-tg48m-p.mk @@ -0,0 +1,13 @@ +# TG48M-P Platform + +TG48MP_VERSION=1.0 + +export TG48MP_VERSION + +TG48M-P_PLATFORM = sonic-platform-tg48m-p_$(TG48MP_VERSION)_$(CONFIGURED_ARCH).deb +$(TG48M-P_PLATFORM)_SRC_PATH = $(PLATFORM_PATH)/sonic-platform-tg48m-p +$(TG48M-P_PLATFORM)_DEPENDS += $(LINUX_HEADERS) $(LINUX_HEADERS_COMMON) +$(TG48M-P_PLATFORM)_PLATFORM = arm64-delta_tg48m_poe-r0 + +SONIC_DPKG_DEBS += $(TG48M-P_PLATFORM) + diff --git a/platform/marvell-arm64/platform.conf b/platform/marvell-arm64/platform.conf index 15f25a27b..50477127b 100644 --- a/platform/marvell-arm64/platform.conf +++ b/platform/marvell-arm64/platform.conf @@ -18,16 +18,56 @@ initrd_fname="/boot/initrd.img-4.9.0-9-2-arm64" fdt_fname="/boot/armada-7020-comexpress.dtb" fit_fname="/boot/sonic_arm64.fit" +if [ "$install_env" = "onie" ]; then + MACH_FILE="/etc/machine.conf" +else + MACH_FILE="/host/machine.conf" +fi + +PLATFORM=`sed -n 's/onie_platform=\(.*\)/\1/p' $MACH_FILE` +echo "Intalling SONiC from $install_env on Platform $PLATFORM" + # global mount defines -#demo_dev=/dev/sda1 demo_mnt=/tmp -#mtd_dev=/dev/$(cat /proc/mtd | grep "ENV" | grep -o "mtd[0-9]") FW_ENV_DEFAULT='/dev/mtd1 0x0 0x10000 0x100000' UBOOT_FW_DEFAULT=1 # Skip VID Header in UBIFS LINUX_MISC_CMD='apparmor=1 security=apparmor usbcore.autosuspend=-1' +if [ "$PLATFORM" = "arm64-delta_tg48m_poe-r0" ] || [ "$PLATFORM" = "arm64-delta_tg4810m-r0" ]; then + + demo_dev=/dev/sda2 + if [ "$PLATFORM" = "arm64-delta_tg48m_poe-r0" ]; then + fdt_fname="/boot/tg48m-p.dtb" + fit_fname="/boot/sonic_tg48m-p_arm64.fit" + else + fdt_fname="/boot/tg4810m.dtb" + fit_fname="/boot/sonic_tg4810m_arm64.fit" + fi + + SONIC_LOAD='scsi scan; ext4load scsi 0:2 $fit_addr $fit_name' + SONIC_LOAD_OLD='scsi scan; ext4load scsi 0:2 $fit_addr $fit_name_old' + BOOTARGS='setenv bootargs root='$demo_dev' rw rootwait rootfstype=ext4 panic=1 console=ttyS0,115200 ${othbootargs} ${mtdparts} ${linuxargs}' + BOOTARGS_OLD='setenv bootargs root='$demo_dev' rw rootwait rootfstype=ext4 panic=1 console=ttyS0,115200 ${othbootargs} ${mtdparts} ${linuxargs_old}' + SONIC_BOOT_CMD='run sonic_bootargs; run sonic_boot_load; test -n "$boot_once" && setenv boot_once "" && saveenv; bootm $fit_addr' + SONIC_BOOT_CMD_OLD='run sonic_bootargs_old; run sonic_boot_load_old; test -n "$boot_once" && setenv boot_once "" && saveenv; bootm $fit_addr' + +else + if [ ${IS_MASS} -eq 1 ]; then + SONIC_LOAD='ext4load usb 0 $fit_addr $fit_name' + SONIC_LOAD_OLD='ext4load usb 0 $fit_addr $fit_name_old' + else + SONIC_LOAD='ext4load mmc 0:'$demo_part' $fit_addr $fit_name' + SONIC_LOAD_OLD='ext4load mmc 0:'$demo_part' $fit_addr $fit_name' + fi + + SONIC_BOOT_CMD='run sonic_bootargs; run sonic_boot_load; bootm $fit_addr' + SONIC_BOOT_CMD_OLD='run sonic_bootargs_old; run sonic_boot_load_old; bootm $fit_addr' + BOOTARGS='setenv bootargs root='$demo_dev' rw rootwait rootfstype=ext4 panic=1 console=ttyS0,115200 ${othbootargs} ${mtdparts} ${linuxargs}' + BOOTARGS_OLD='setenv bootargs root='$demo_dev' rw rootwait rootfstype=ext4 panic=1 console=ttyS0,115200 ${othbootargs} ${mtdparts} ${linuxargs_old}' +fi + prepare_boot_menu() { echo "Sync up cache ..." sync @@ -40,13 +80,28 @@ prepare_boot_menu() { then UBOOT_ENV_SIZ="0x$(hd $PROC_ENV_FILE | awk 'FNR==1 {print $2 $3 $4 $5}')" UBOOT_ENV_ERASE_SIZ="0x$(grep uboot-env /proc/mtd | awk '{print $3}')" - if [[ -n "$UBOOT_ENV_SIZ" && -n "$UBOOT_ENV_ERASE_SIZ" ]] + if [ -n "$UBOOT_ENV_SIZ" -a -n "$UBOOT_ENV_ERASE_SIZ" ] then # Env info from DTB FW_ENV_DTB="/dev/$DTB_HAS_ENV_BLK 0x00000000 $UBOOT_ENV_SIZ $UBOOT_ENV_ERASE_SIZ" fi fi fi + + if [ -n "$FW_ENV_DTB" ] + then + echo $FW_ENV_DTB > /etc/fw_env.config + echo "Found uboot env offset in device tree" + UBOOT_ENV_CRC=$(fw_printenv 2>&1 | grep -c 'Warning: Bad CRC') || true + if [ "$UBOOT_ENV_CRC" -eq 0 ] + then + echo "Uboot env offset in device tree is valid" + UBOOT_FW_DEFAULT=0 + else + echo "Uboot env offset in device tree is NOT valid" + UBOOT_FW_DEFAULT=1 + fi + fi if [ $UBOOT_FW_DEFAULT -eq 1 ] then echo $FW_ENV_DEFAULT > /etc/fw_env.config @@ -81,11 +136,14 @@ prepare_boot_menu() { fi if [ ${IS_MASS} -eq 1 ] then - demo_dev=${blk_dev}1 + demo_dev=${blk_dev}1 else #demo_dev=$(echo $blk_dev | sed -e 's/\(mmcblk[0-9]\)/\1p/')$demo_part demo_dev=/dev/mmcblk0p1 fi + if [ "$PLATFORM" = "arm64-delta_tg48m_poe-r0" ] || [ "$PLATFORM" = "arm64-delta_tg4810m-r0" ]; then + demo_dev=/dev/sda2 + fi fi fi @@ -105,39 +163,25 @@ prepare_boot_menu() { BOOT1='echo " > Boot1: $sonic_version_1 - run sonic_image_1";echo;' BOOT2='echo " > Boot2: $sonic_version_2 - run sonic_image_2";echo;' BOOT3='echo " > Boot3: ONIE - run onie-nand-boot";echo;' + if [ "$PLATFORM" = "arm64-delta_tg48m_poe-r0" ] || [ "$PLATFORM" = "arm64-delta_tg4810m-r0" ]; then + BOOT3='echo " > Boot3: ONIE - run bootonie";echo;' + fi BORDER='echo "---------------------------------------------------";echo;' fw_setenv ${FW_ARG} print_menu $BORDER $BOOT1 $BOOT2 $BOOT3 $BORDER > /dev/null fw_setenv ${FW_ARG} linuxargs "net.ifnames=0 loopfstype=squashfs loop=$image_dir/$FILESYSTEM_SQUASHFS varlog_size=$VAR_LOG" > /dev/null fw_setenv ${FW_ARG} linuxargs_old "net.ifnames=0 loopfstype=squashfs loop=$image_dir_old/$FILESYSTEM_SQUASHFS varlog_size=$VAR_LOG" > /dev/null - sonic_bootargs_old='setenv bootargs root='$demo_dev' rw rootwait rootfstype=ext4 panic=1 console=ttyS0,115200 ${othbootargs} ${mtdparts} ${linuxargs_old}' - fw_setenv ${FW_ARG} sonic_bootargs_old $sonic_bootargs_old > /dev/null || true - sonic_boot_load_old=$(fw_printenv -n sonic_boot_load || true) - old_str="_old" - fw_setenv ${FW_ARG} sonic_boot_load_old $sonic_boot_load_old$old_str > /dev/null || true fw_setenv ${FW_ARG} kernel_addr $kernel_addr > /dev/null fw_setenv ${FW_ARG} fdt_addr $fdt_addr > /dev/null fw_setenv ${FW_ARG} fit_addr $fit_addr > /dev/null fw_setenv ${FW_ARG} initrd_addr $initrd_addr > /dev/null - # Set boot configs - if [ ${IS_MASS} -eq 1 ] - then - #USB_LOAD='ext4load usb 0 $kernel_addr $image_name; ext4load usb 0 $fdt_addr $fdt_name; ext4load usb 0 $initrd_addr $initrd_name' - USB_LOAD='ext4load usb 0 $fit_addr $fit_name' - fw_setenv ${FW_ARG} sonic_boot_load $USB_LOAD > /dev/null - else - #MMC_LOAD='ext4load mmc 0:'$demo_part' $kernel_addr $image_name; ext4load mmc 0:'$demo_part' $fdt_addr $fdt_name; ext4load mmc 0:'$demo_part' $initrd_addr $initrd_name' - MMC_LOAD='ext4load mmc 0:'$demo_part' $fit_addr $fit_name' - fw_setenv ${FW_ARG} sonic_boot_load $MMC_LOAD > /dev/null - fi - #SONIC_BOOT_CMD='run sonic_bootargs; run sonic_boot_load; booti $kernel_addr $initrd_addr $fdt_addr' - SONIC_BOOT_CMD='run sonic_bootargs; run sonic_boot_load; bootm $fit_addr' - SONIC_BOOT_CMD_OLD='run sonic_bootargs_old; run sonic_boot_load_old; bootm $fit_addr' - BOOTARGS='setenv bootargs root='$demo_dev' rw rootwait rootfstype=ext4 panic=1 console=ttyS0,115200 ${othbootargs} ${mtdparts} ${linuxargs}' + fw_setenv ${FW_ARG} sonic_boot_load $SONIC_LOAD > /dev/null + fw_setenv ${FW_ARG} sonic_boot_load_old $SONIC_LOAD_OLD > /dev/null fw_setenv ${FW_ARG} sonic_bootargs $BOOTARGS > /dev/null - fw_setenv ${FW_ARG} sonic_bootcmd $SONIC_BOOT_CMD > /dev/null - fw_setenv ${FW_ARG} sonic_image_2 $SONIC_BOOT_CMD_OLD > /dev/null + fw_setenv ${FW_ARG} sonic_bootargs_old $BOOTARGS_OLD > /dev/null || true + fw_setenv ${FW_ARG} sonic_bootcmd "$SONIC_BOOT_CMD" > /dev/null + fw_setenv ${FW_ARG} sonic_image_2 "$SONIC_BOOT_CMD_OLD" > /dev/null fw_setenv ${FW_ARG} sonic_image_1 "$SONIC_BOOT_CMD" > /dev/null fw_setenv ${FW_ARG} boot_next 'run sonic_image_1'> /dev/null fw_setenv ${FW_ARG} bootcmd 'run print_menu; usb start; test -n "$boot_once" && run boot_once; run boot_next' > /dev/null @@ -145,13 +189,16 @@ prepare_boot_menu() { } #Get block device -#Default block device is eMMC, if not look for usb storage get_install_device() { + if [ "$PLATFORM" = "arm64-delta_tg48m_poe-r0" ] || [ "$PLATFORM" = "arm64-delta_tg4810m-r0" ]; then + blk_dev=/dev/sda + echo "Selected SSD Drive $blk_dev" + return 0 + fi mass_bus="target0:0:0" for i in a b c ; do if $(ls -l /sys/block/sd$i/device 2>/dev/null | grep -q "$mass_bus") ; then - echo "/dev/sd$i" blk_dev=/dev/sd$i IS_MASS=1 echo "Selected Mass storage $blk_dev" @@ -161,7 +208,6 @@ get_install_device() mmc_bus="mmc0:aaaa" for i in 0 1 2 ; do if $(ls -l /sys/block/mmcblk$i/device 2>/dev/null | grep -q "$mmc_bus") ; then - echo "/dev/mmcblk$i" blk_dev=/dev/mmcblk$i echo "Selected mmc $blk_dev" return 0 @@ -174,19 +220,32 @@ get_install_device() create_demo_partition() { + if [ "$PLATFORM" = "arm64-delta_tg48m_poe-r0" ] || [ "$PLATFORM" = "arm64-delta_tg4810m-r0" ]; then + # SSD drive + blk_dev=/dev/sda + parted -s $blk_dev rm 2 || true + partprobe || true + parted -s --align optimal $blk_dev unit gb mkpart primary 2 26 || true + partprobe || true + echo "SSD drive partition done on $blk_dev" + return 0 + fi + if [ ${IS_MASS} -eq 1 ] then - # USB drive + #"USB drive" parted -s $blk_dev rm 1 || true partprobe || true parted -s --align optimal $blk_dev unit gb mkpart primary 1 $DISK_SIZE || true partprobe || true + echo "USB drive partition done on $blk_dev" else - # SD CARD + #"SD CARD" parted -s /dev/mmcblk0 rm 1 partprobe parted -s --align optimal /dev/mmcblk0 unit gb mkpart primary 1 $DISK_SIZE partprobe + echo "SD CARD partition done on $blk_dev" fi } @@ -201,20 +260,21 @@ create_partition() { } mount_partition() { - if [ ${IS_MASS} -eq 1 ] - then + + if [ ${IS_MASS} -eq 1 ]; then demo_dev=${blk_dev}1 else - #demo_dev=$(echo $blk_dev | sed -e 's/\(mmcblk[0-9]\)/\1p/')$demo_part demo_dev=/dev/mmcblk0p1 fi - # Make filesystem - echo "demo label: $demo_volume_label. $demo_dev..." - mkfs.ext4 -L $demo_volume_label $demo_dev + if [ "$PLATFORM" = "arm64-delta_tg48m_poe-r0" ] || [ "$PLATFORM" = "arm64-delta_tg4810m-r0" ]; then + demo_dev=/dev/sda2 + fi + echo "demo label: $demo_volume_label $demo_dev" + mkfs.ext4 -L $demo_volume_label $demo_dev mount -t ext4 -o defaults,rw $demo_dev $demo_mnt || { - echo "Error: Unable to mount $demo_dev on $demo_mnt" + echo "Error: Unable to mount $demo_dev on $demo_mnt" exit 1 } } diff --git a/platform/marvell-arm64/rules.mk b/platform/marvell-arm64/rules.mk index f8e4c12a4..30c2c4688 100644 --- a/platform/marvell-arm64/rules.mk +++ b/platform/marvell-arm64/rules.mk @@ -1,4 +1,6 @@ #include $(PLATFORM_PATH)/sdk.mk +include $(PLATFORM_PATH)/platform-tg48m-p.mk +include $(PLATFORM_PATH)/platform-tg4810m.mk include $(PLATFORM_PATH)/sai.mk include $(PLATFORM_PATH)/docker-syncd-mrvl.mk include $(PLATFORM_PATH)/docker-syncd-mrvl-rpc.mk diff --git a/platform/marvell-arm64/sonic_fit_tg4810m.its b/platform/marvell-arm64/sonic_fit_tg4810m.its new file mode 100644 index 000000000..5d9c1e25a --- /dev/null +++ b/platform/marvell-arm64/sonic_fit_tg4810m.its @@ -0,0 +1,55 @@ +/dts-v1/; + +/ { + description = "U-Boot fitImage for SONIC Marvell Arm64"; + #address-cells = <1>; + + images { + kernel@0 { + description = "Linux Kernel"; + data = /incbin/("/boot/vmlinuz-4.19.0-6-2-arm64"); + type = "kernel"; + arch = "arm64"; + os = "linux"; + compression = "none"; + load = <0x6000000>; + entry = <0x6000000>; + hash@1 { + algo = "sha1"; + }; + }; + fdt@0 { + description = "Flattened Device Tree blob"; + data = /incbin/("/boot/tg4810m.dtb"); + type = "flat_dt"; + arch = "arm64"; + compression = "none"; + hash@1 { + algo = "sha1"; + }; + }; + ramdisk@0 { + description = "ramdisk"; + data = /incbin/("/boot/initrd.img-4.19.0-6-2-arm64"); + type = "ramdisk"; + arch = "arm64"; + os = "linux"; + compression = "gzip"; + hash@1 { + algo = "sha1"; + }; + }; + }; + configurations { + default = "conf@1"; + conf@1 { + description = "Boot Linux kernel with FDT blob + ramdisk"; + kernel = "kernel@0"; + fdt = "fdt@0"; + ramdisk = "ramdisk@0"; + hash@1 { + algo = "sha1"; + }; + }; + }; +}; diff --git a/platform/marvell-arm64/sonic_fit_tg48m-p.its b/platform/marvell-arm64/sonic_fit_tg48m-p.its new file mode 100644 index 000000000..c86de74c4 --- /dev/null +++ b/platform/marvell-arm64/sonic_fit_tg48m-p.its @@ -0,0 +1,55 @@ +/dts-v1/; + +/ { + description = "U-Boot fitImage for SONIC Marvell Arm64"; + #address-cells = <1>; + + images { + kernel@0 { + description = "Linux Kernel"; + data = /incbin/("/boot/vmlinuz-4.19.0-6-2-arm64"); + type = "kernel"; + arch = "arm64"; + os = "linux"; + compression = "none"; + load = <0x6000000>; + entry = <0x6000000>; + hash@1 { + algo = "sha1"; + }; + }; + fdt@0 { + description = "Flattened Device Tree blob"; + data = /incbin/("/boot/tg48m-p.dtb"); + type = "flat_dt"; + arch = "arm64"; + compression = "none"; + hash@1 { + algo = "sha1"; + }; + }; + ramdisk@0 { + description = "ramdisk"; + data = /incbin/("/boot/initrd.img-4.19.0-6-2-arm64"); + type = "ramdisk"; + arch = "arm64"; + os = "linux"; + compression = "gzip"; + hash@1 { + algo = "sha1"; + }; + }; + }; + configurations { + default = "conf@1"; + conf@1 { + description = "Boot Linux kernel with FDT blob + ramdisk"; + kernel = "kernel@0"; + fdt = "fdt@0"; + ramdisk = "ramdisk@0"; + hash@1 { + algo = "sha1"; + }; + }; + }; +}; From d61d125d9f115eb684f6eca24625ee25bbaf632e Mon Sep 17 00:00:00 2001 From: lkunjumon Date: Tue, 2 Feb 2021 19:03:23 +0530 Subject: [PATCH 2/6] removing pmon2.0 changes --- platform/marvell-arm64/platform-tg4810m.mk | 12 ------------ platform/marvell-arm64/platform-tg48m-p.mk | 13 ------------- platform/marvell-arm64/rules.mk | 2 -- 3 files changed, 27 deletions(-) delete mode 100644 platform/marvell-arm64/platform-tg4810m.mk delete mode 100644 platform/marvell-arm64/platform-tg48m-p.mk diff --git a/platform/marvell-arm64/platform-tg4810m.mk b/platform/marvell-arm64/platform-tg4810m.mk deleted file mode 100644 index a84a5024c..000000000 --- a/platform/marvell-arm64/platform-tg4810m.mk +++ /dev/null @@ -1,12 +0,0 @@ -# TG4810M Platform - -TG4810M_VERSION = 1.0 -export TG4810M_VERSION - -TG4810M_PLATFORM = sonic-platform-tg4810m_$(TG4810M_VERSION)_$(CONFIGURED_ARCH).deb -$(TG4810M_PLATFORM)_SRC_PATH = $(PLATFORM_PATH)/sonic-platform-tg4810m -$(TG4810M_PLATFORM)_DEPENDS += $(LINUX_HEADERS) $(LINUX_HEADERS_COMMON) -$(TG4810M_PLATFORM)_PLATFORM = arm64-delta_tg4810m-r0 - -SONIC_DPKG_DEBS += $(TG4810M_PLATFORM) - diff --git a/platform/marvell-arm64/platform-tg48m-p.mk b/platform/marvell-arm64/platform-tg48m-p.mk deleted file mode 100644 index 8fa14ef28..000000000 --- a/platform/marvell-arm64/platform-tg48m-p.mk +++ /dev/null @@ -1,13 +0,0 @@ -# TG48M-P Platform - -TG48MP_VERSION=1.0 - -export TG48MP_VERSION - -TG48M-P_PLATFORM = sonic-platform-tg48m-p_$(TG48MP_VERSION)_$(CONFIGURED_ARCH).deb -$(TG48M-P_PLATFORM)_SRC_PATH = $(PLATFORM_PATH)/sonic-platform-tg48m-p -$(TG48M-P_PLATFORM)_DEPENDS += $(LINUX_HEADERS) $(LINUX_HEADERS_COMMON) -$(TG48M-P_PLATFORM)_PLATFORM = arm64-delta_tg48m_poe-r0 - -SONIC_DPKG_DEBS += $(TG48M-P_PLATFORM) - diff --git a/platform/marvell-arm64/rules.mk b/platform/marvell-arm64/rules.mk index 30c2c4688..f8e4c12a4 100644 --- a/platform/marvell-arm64/rules.mk +++ b/platform/marvell-arm64/rules.mk @@ -1,6 +1,4 @@ #include $(PLATFORM_PATH)/sdk.mk -include $(PLATFORM_PATH)/platform-tg48m-p.mk -include $(PLATFORM_PATH)/platform-tg4810m.mk include $(PLATFORM_PATH)/sai.mk include $(PLATFORM_PATH)/docker-syncd-mrvl.mk include $(PLATFORM_PATH)/docker-syncd-mrvl-rpc.mk From 42b461adb1cb8da1d6c75fe0200f2ad2d92742e8 Mon Sep 17 00:00:00 2001 From: lkunjumon Date: Thu, 4 Mar 2021 18:36:06 +0530 Subject: [PATCH 3/6] Adding platform changes --- build_debian.sh | 4 -- platform/marvell-arm64/platform.conf | 26 +++++---- platform/marvell-arm64/sonic_fit.its | 46 +++++++++++++++- platform/marvell-arm64/sonic_fit_tg4810m.its | 55 -------------------- platform/marvell-arm64/sonic_fit_tg48m-p.its | 55 -------------------- 5 files changed, 59 insertions(+), 127 deletions(-) delete mode 100644 platform/marvell-arm64/sonic_fit_tg4810m.its delete mode 100644 platform/marvell-arm64/sonic_fit_tg48m-p.its diff --git a/build_debian.sh b/build_debian.sh index 9bd2838ee..490dd51a8 100755 --- a/build_debian.sh +++ b/build_debian.sh @@ -535,11 +535,7 @@ if [[ $CONFIGURED_ARCH == armhf || $CONFIGURED_ARCH == arm64 ]]; then sudo LANG=C chroot $FILESYSTEM_ROOT mv /boot/u${INITRD_FILE} /boot/$INITRD_FILE elif [[ $CONFIGURED_ARCH == arm64 ]]; then sudo cp -v $PLATFORM_DIR/${sonic_asic_platform}-${CONFIGURED_ARCH}/sonic_fit.its $FILESYSTEM_ROOT/boot/ - sudo cp -v $PLATFORM_DIR/${sonic_asic_platform}-${CONFIGURED_ARCH}/sonic_fit_tg48m-p.its $FILESYSTEM_ROOT/boot/ - sudo cp -v $PLATFORM_DIR/${sonic_asic_platform}-${CONFIGURED_ARCH}/sonic_fit_tg4810m.its $FILESYSTEM_ROOT/boot/ sudo LANG=C chroot $FILESYSTEM_ROOT mkimage -f /boot/sonic_fit.its /boot/sonic_${CONFIGURED_ARCH}.fit - sudo LANG=C chroot $FILESYSTEM_ROOT mkimage -f /boot/sonic_fit_tg48m-p.its /boot/sonic_tg48m-p_${CONFIGURED_ARCH}.fit - sudo LANG=C chroot $FILESYSTEM_ROOT mkimage -f /boot/sonic_fit_tg4810m.its /boot/sonic_tg4810m_${CONFIGURED_ARCH}.fit fi fi diff --git a/platform/marvell-arm64/platform.conf b/platform/marvell-arm64/platform.conf index 50477127b..248a655cd 100644 --- a/platform/marvell-arm64/platform.conf +++ b/platform/marvell-arm64/platform.conf @@ -38,26 +38,30 @@ LINUX_MISC_CMD='apparmor=1 security=apparmor usbcore.autosuspend=-1' if [ "$PLATFORM" = "arm64-delta_tg48m_poe-r0" ] || [ "$PLATFORM" = "arm64-delta_tg4810m-r0" ]; then demo_dev=/dev/sda2 - if [ "$PLATFORM" = "arm64-delta_tg48m_poe-r0" ]; then - fdt_fname="/boot/tg48m-p.dtb" - fit_fname="/boot/sonic_tg48m-p_arm64.fit" - else - fdt_fname="/boot/tg4810m.dtb" - fit_fname="/boot/sonic_tg4810m_arm64.fit" - fi - SONIC_LOAD='scsi scan; ext4load scsi 0:2 $fit_addr $fit_name' SONIC_LOAD_OLD='scsi scan; ext4load scsi 0:2 $fit_addr $fit_name_old' BOOTARGS='setenv bootargs root='$demo_dev' rw rootwait rootfstype=ext4 panic=1 console=ttyS0,115200 ${othbootargs} ${mtdparts} ${linuxargs}' BOOTARGS_OLD='setenv bootargs root='$demo_dev' rw rootwait rootfstype=ext4 panic=1 console=ttyS0,115200 ${othbootargs} ${mtdparts} ${linuxargs_old}' - SONIC_BOOT_CMD='run sonic_bootargs; run sonic_boot_load; test -n "$boot_once" && setenv boot_once "" && saveenv; bootm $fit_addr' - SONIC_BOOT_CMD_OLD='run sonic_bootargs_old; run sonic_boot_load_old; test -n "$boot_once" && setenv boot_once "" && saveenv; bootm $fit_addr' - + if [ "$PLATFORM" = "arm64-delta_tg4810m-r0" ]; then + SONIC_BOOT_CMD='run sonic_bootargs; run sonic_boot_load; test -n "$boot_once" && setenv boot_once "" && saveenv; bootm $fit_addr#delta_tg4810m' + SONIC_BOOT_CMD_OLD='run sonic_bootargs_old; run sonic_boot_load_old; test -n "$boot_once" && setenv boot_once "" && saveenv; bootm $fit_addr#delta_tg4810m' + else + SONIC_BOOT_CMD='run sonic_bootargs; run sonic_boot_load; test -n "$boot_once" && setenv boot_once "" && saveenv; bootm $fit_addr#delta_tg48m_poe' + SONIC_BOOT_CMD_OLD='run sonic_bootargs_old; run sonic_boot_load_old; test -n "$boot_once" && setenv boot_once "" && saveenv; bootm $fit_addr#delta_tg48m_poe' + fi + else + get_install_device + if [ $? -ne 0 ]; then + echo "Error: Unable to detect $blk_dev $demo_dev" + exit 1 + if [ ${IS_MASS} -eq 1 ]; then + demo_dev=${blk_dev}1 SONIC_LOAD='ext4load usb 0 $fit_addr $fit_name' SONIC_LOAD_OLD='ext4load usb 0 $fit_addr $fit_name_old' else + demo_dev=/dev/mmcblk0p1 SONIC_LOAD='ext4load mmc 0:'$demo_part' $fit_addr $fit_name' SONIC_LOAD_OLD='ext4load mmc 0:'$demo_part' $fit_addr $fit_name' fi diff --git a/platform/marvell-arm64/sonic_fit.its b/platform/marvell-arm64/sonic_fit.its index 9b09d4cd3..28ef68c0d 100644 --- a/platform/marvell-arm64/sonic_fit.its +++ b/platform/marvell-arm64/sonic_fit.its @@ -28,6 +28,30 @@ algo = "sha1"; }; }; + fdt@1 { + description = "Flattened Device Tree blob"; + data = /incbin/("/boot/tg4810m.dtb"); + type = "flat_dt"; + arch = "arm64"; + load = <0x10000000>; + compression = "none"; + hash@1 { + algo = "sha1"; + }; + }; + fdt@2 { + description = "Flattened Device Tree blob"; + data = /incbin/("/boot/tg48m-p.dtb"); + type = "flat_dt"; + arch = "arm64"; + load = <0x10000000>; + compression = "none"; + hash@1 { + algo = "sha1"; + }; + }; + + ramdisk@0 { description = "ramdisk"; data = /incbin/("/boot/initrd.img-4.9.0-9-2-arm64"); @@ -41,8 +65,8 @@ }; }; configurations { - default = "conf@1"; - conf@1 { + default = "config_falcon"; + config_falcon { description = "Boot Linux kernel with FDT blob + ramdisk"; kernel = "kernel@0"; fdt = "fdt@0"; @@ -51,5 +75,23 @@ algo = "sha1"; }; }; + delta_tg4810m { + description = "Boot Linux kernel with FDT blob + ramdisk"; + kernel = "kernel@0"; + fdt = "fdt@1"; + ramdisk = "ramdisk@0"; + hash@1 { + algo = "sha1"; + }; + }; + delta_tg48m_poe { + description = "Boot Linux kernel with FDT blob + ramdisk"; + kernel = "kernel@0"; + fdt = "fdt@2"; + ramdisk = "ramdisk@0"; + hash@1 { + algo = "sha1"; + }; + }; }; }; diff --git a/platform/marvell-arm64/sonic_fit_tg4810m.its b/platform/marvell-arm64/sonic_fit_tg4810m.its deleted file mode 100644 index 5d9c1e25a..000000000 --- a/platform/marvell-arm64/sonic_fit_tg4810m.its +++ /dev/null @@ -1,55 +0,0 @@ -/dts-v1/; - -/ { - description = "U-Boot fitImage for SONIC Marvell Arm64"; - #address-cells = <1>; - - images { - kernel@0 { - description = "Linux Kernel"; - data = /incbin/("/boot/vmlinuz-4.19.0-6-2-arm64"); - type = "kernel"; - arch = "arm64"; - os = "linux"; - compression = "none"; - load = <0x6000000>; - entry = <0x6000000>; - hash@1 { - algo = "sha1"; - }; - }; - fdt@0 { - description = "Flattened Device Tree blob"; - data = /incbin/("/boot/tg4810m.dtb"); - type = "flat_dt"; - arch = "arm64"; - compression = "none"; - hash@1 { - algo = "sha1"; - }; - }; - ramdisk@0 { - description = "ramdisk"; - data = /incbin/("/boot/initrd.img-4.19.0-6-2-arm64"); - type = "ramdisk"; - arch = "arm64"; - os = "linux"; - compression = "gzip"; - hash@1 { - algo = "sha1"; - }; - }; - }; - configurations { - default = "conf@1"; - conf@1 { - description = "Boot Linux kernel with FDT blob + ramdisk"; - kernel = "kernel@0"; - fdt = "fdt@0"; - ramdisk = "ramdisk@0"; - hash@1 { - algo = "sha1"; - }; - }; - }; -}; diff --git a/platform/marvell-arm64/sonic_fit_tg48m-p.its b/platform/marvell-arm64/sonic_fit_tg48m-p.its deleted file mode 100644 index c86de74c4..000000000 --- a/platform/marvell-arm64/sonic_fit_tg48m-p.its +++ /dev/null @@ -1,55 +0,0 @@ -/dts-v1/; - -/ { - description = "U-Boot fitImage for SONIC Marvell Arm64"; - #address-cells = <1>; - - images { - kernel@0 { - description = "Linux Kernel"; - data = /incbin/("/boot/vmlinuz-4.19.0-6-2-arm64"); - type = "kernel"; - arch = "arm64"; - os = "linux"; - compression = "none"; - load = <0x6000000>; - entry = <0x6000000>; - hash@1 { - algo = "sha1"; - }; - }; - fdt@0 { - description = "Flattened Device Tree blob"; - data = /incbin/("/boot/tg48m-p.dtb"); - type = "flat_dt"; - arch = "arm64"; - compression = "none"; - hash@1 { - algo = "sha1"; - }; - }; - ramdisk@0 { - description = "ramdisk"; - data = /incbin/("/boot/initrd.img-4.19.0-6-2-arm64"); - type = "ramdisk"; - arch = "arm64"; - os = "linux"; - compression = "gzip"; - hash@1 { - algo = "sha1"; - }; - }; - }; - configurations { - default = "conf@1"; - conf@1 { - description = "Boot Linux kernel with FDT blob + ramdisk"; - kernel = "kernel@0"; - fdt = "fdt@0"; - ramdisk = "ramdisk@0"; - hash@1 { - algo = "sha1"; - }; - }; - }; -}; From a488304cd0bf68f642fe5e899ab8c362118faf6e Mon Sep 17 00:00:00 2001 From: lkunjumon Date: Thu, 4 Mar 2021 18:57:49 +0530 Subject: [PATCH 4/6] Updating platform file --- platform/marvell-arm64/platform.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/platform/marvell-arm64/platform.conf b/platform/marvell-arm64/platform.conf index 248a655cd..b321eceb2 100644 --- a/platform/marvell-arm64/platform.conf +++ b/platform/marvell-arm64/platform.conf @@ -55,6 +55,7 @@ else if [ $? -ne 0 ]; then echo "Error: Unable to detect $blk_dev $demo_dev" exit 1 + fi if [ ${IS_MASS} -eq 1 ]; then demo_dev=${blk_dev}1 From ba39e1b550087c1020fff76e1459d3232f60cd92 Mon Sep 17 00:00:00 2001 From: lkunjumon Date: Fri, 5 Mar 2021 11:28:09 +0530 Subject: [PATCH 5/6] updated usb and mmc device selection --- platform/marvell-arm64/platform.conf | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/platform/marvell-arm64/platform.conf b/platform/marvell-arm64/platform.conf index b321eceb2..8c7bef811 100644 --- a/platform/marvell-arm64/platform.conf +++ b/platform/marvell-arm64/platform.conf @@ -51,11 +51,24 @@ if [ "$PLATFORM" = "arm64-delta_tg48m_poe-r0" ] || [ "$PLATFORM" = "arm64-delta_ fi else - get_install_device - if [ $? -ne 0 ]; then - echo "Error: Unable to detect $blk_dev $demo_dev" - exit 1 - fi + + mass_bus="target0:0:0" + for i in a b c ; do + if $(ls -l /sys/block/sd$i/device 2>/dev/null | grep -q "$mass_bus") ; then + blk_dev=/dev/sd$i + IS_MASS=1 + echo "Selected Mass storage $blk_dev" + return 0 + fi + done + mmc_bus="mmc0:aaaa" + for i in 0 1 2 ; do + if $(ls -l /sys/block/mmcblk$i/device 2>/dev/null | grep -q "$mmc_bus") ; then + blk_dev=/dev/mmcblk$i + echo "Selected mmc $blk_dev" + return 0 + fi + done if [ ${IS_MASS} -eq 1 ]; then demo_dev=${blk_dev}1 From d421a50c75c3f65a38155adff30f4bd748ecad28 Mon Sep 17 00:00:00 2001 From: lkunjumon Date: Fri, 5 Mar 2021 11:33:14 +0530 Subject: [PATCH 6/6] updating usb node selection --- platform/marvell-arm64/platform.conf | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/platform/marvell-arm64/platform.conf b/platform/marvell-arm64/platform.conf index 8c7bef811..ede3e7695 100644 --- a/platform/marvell-arm64/platform.conf +++ b/platform/marvell-arm64/platform.conf @@ -57,16 +57,6 @@ else if $(ls -l /sys/block/sd$i/device 2>/dev/null | grep -q "$mass_bus") ; then blk_dev=/dev/sd$i IS_MASS=1 - echo "Selected Mass storage $blk_dev" - return 0 - fi - done - mmc_bus="mmc0:aaaa" - for i in 0 1 2 ; do - if $(ls -l /sys/block/mmcblk$i/device 2>/dev/null | grep -q "$mmc_bus") ; then - blk_dev=/dev/mmcblk$i - echo "Selected mmc $blk_dev" - return 0 fi done