From 25e99cd2edc1fbd4192f9e0b44fc1d304e235627 Mon Sep 17 00:00:00 2001 From: lkunjumon Date: Sun, 31 Jan 2021 11:35:41 +0530 Subject: [PATCH] Updating default Uboot ENV offset --- .../tg4810m_plt_setup.sh | 18 ++++-------------- .../tg48m-p/sonic_platform/sfp_event.py | 4 ++-- .../tg48m-p_plt_setup.sh | 16 ++++------------ 3 files changed, 10 insertions(+), 28 deletions(-) diff --git a/platform/marvell-arm64/sonic-platform-tg4810m/tg4810m_plt_setup.sh b/platform/marvell-arm64/sonic-platform-tg4810m/tg4810m_plt_setup.sh index c2cb95d40..bd3391638 100755 --- a/platform/marvell-arm64/sonic-platform-tg4810m/tg4810m_plt_setup.sh +++ b/platform/marvell-arm64/sonic-platform-tg4810m/tg4810m_plt_setup.sh @@ -9,26 +9,16 @@ fw_uboot_env_cfg() if [ "$PLATFORM" = "arm64-delta_tg4810m-r0" ]; then # TG410M board Uboot ENV offset - FW_ENV_DEFAULT='/dev/mtd0 0x00100000 0x10000 0x10000' - - demo_part=$(sgdisk -p /dev/sda | grep -e "SONiC-OS") - if [ -z "$demo_part" ]; then - # ET6448M Board - For Backward compatibility - FW_ENV_DEFAULT='/dev/mtd0 0x00500000 0x80000 0x100000 8' - fi - else - FW_ENV_DEFAULT='/dev/mtd0 0x00500000 0x80000 0x100000 8' + FW_ENV_DEFAULT='/dev/mtd1 0x00000000 0x00010000 0x00001000' + echo "Using pre-configured uboot env" + echo $FW_ENV_DEFAULT > /etc/fw_env.config fi - - echo "Using pre-configured uboot env" - echo $FW_ENV_DEFAULT > /etc/fw_env.config - } main() { - #fw_uboot_env_cfg + fw_uboot_env_cfg echo "Delta-TG4810M: /dev/mtd0 FW_ENV_DEFAULT" } diff --git a/platform/marvell-arm64/sonic-platform-tg48m-p/tg48m-p/sonic_platform/sfp_event.py b/platform/marvell-arm64/sonic-platform-tg48m-p/tg48m-p/sonic_platform/sfp_event.py index 9b2b758cf..a86c071fd 100644 --- a/platform/marvell-arm64/sonic-platform-tg48m-p/tg48m-p/sonic_platform/sfp_event.py +++ b/platform/marvell-arm64/sonic-platform-tg48m-p/tg48m-p/sonic_platform/sfp_event.py @@ -56,10 +56,10 @@ def _get_transceiver_status(self): if smbus_present == 0: logger.log_info(" PMON - smbus ERROR - DEBUG sfp_event ") - cmdstatus, sfpstatus = cmd.getstatusoutput('i2cget -y 0 0x41 0x3') #need to verify the cpld register logic + cmdstatus, sfpstatus = cmd.getstatusoutput('i2cget -y 2 0x41 0x3') #need to verify the cpld register logic sfpstatus = int(sfpstatus, 16) else: - bus = smbus.SMBus(0) + bus = smbus.SMBus(2) DEVICE_ADDRESS = 0x41 DEVICE_REG = 0x3 sfpstatus = bus.read_byte_data(DEVICE_ADDRESS, DEVICE_REG) diff --git a/platform/marvell-arm64/sonic-platform-tg48m-p/tg48m-p_plt_setup.sh b/platform/marvell-arm64/sonic-platform-tg48m-p/tg48m-p_plt_setup.sh index bd4ba94ef..99a139c19 100755 --- a/platform/marvell-arm64/sonic-platform-tg48m-p/tg48m-p_plt_setup.sh +++ b/platform/marvell-arm64/sonic-platform-tg48m-p/tg48m-p_plt_setup.sh @@ -6,25 +6,17 @@ fw_uboot_env_cfg() MACH_FILE="/host/machine.conf" PLATFORM=`sed -n 's/onie_platform=\(.*\)/\1/p' $MACH_FILE` if [ "$PLATFORM" = "arm64-delta_tg48m_poe-r0" ]; then - # TG48M-P board Uboot ENV offset - FW_ENV_DEFAULT='/dev/mtd1 00010000 00001000 ' - - demo_part=$(sgdisk -p /dev/sda | grep -e "SONiC-OS") - if [ -z "$demo_part" ]; then - FW_ENV_DEFAULT='/dev/mtd1 00010000 00001000 8' - fi - else - FW_ENV_DEFAULT='/dev/mtd1 00010000 00001000 8' + FW_ENV_DEFAULT='/dev/mtd1 0x00000000 0x00010000 0x00001000' + echo "Using pre-configured uboot env" + echo $FW_ENV_DEFAULT > /etc/fw_env.config fi - echo "Using pre-configured uboot env" - echo $FW_ENV_DEFAULT > /etc/fw_env.config } main() { fw_uboot_env_cfg - echo "Delta-TG48M-P: /dev/mtd0 FW_ENV_DEFAULT" + echo "Delta-TG48M-P: /dev/mtd1 FW_ENV_DEFAULT" } main $@