From d6c100d0604bf70d5b28a666f80ff026d5727418 Mon Sep 17 00:00:00 2001 From: Cary Chen Date: Mon, 8 May 2023 16:42:41 +0800 Subject: [PATCH 1/2] [tn48m] Add new platform TN48M2-SWDEV - Add new platform support for TN48M2-SWDEV to Dent-3.0. This Platform is modified from TN48M2 with the SPI flash changed to 64MB to accommodate switchdev supported ONIE. Signed-off-by: Cary Chen --- .../5.15-lts/configs/arm64-all/Makefile | 2 +- .../module/src/platform_lib.c | 26 +++++++++ .../module/src/platform_lib.h | 2 + .../src/arm64_delta_tn48m/module/src/psui.c | 7 +++ .../src/arm64_delta_tn48m/module/src/sysi.c | 5 ++ .../src/modules/arm64-delta-tn48m-cpld.c | 7 +++ .../delta/arm64/tn48m/tn48m2-swdev/.gitignore | 2 + .../delta/arm64/tn48m/tn48m2-swdev/Makefile | 1 + .../arm64/tn48m/tn48m2-swdev/modules/Makefile | 1 + .../arm64/tn48m/tn48m2-swdev/modules/PKG.yml | 1 + .../tn48m2-swdev/modules/builds/.gitignore | 1 + .../tn48m2-swdev/modules/builds/Makefile | 7 +++ .../arm64/tn48m/tn48m2-swdev/onlp/Makefile | 1 + .../arm64/tn48m/tn48m2-swdev/onlp/PKG.yml | 1 + .../tn48m/tn48m2-swdev/onlp/builds/Makefile | 2 + .../tn48m2-swdev/onlp/builds/lib/Makefile | 3 ++ .../onlp/builds/onlpdump/Makefile | 3 ++ .../tn48m2-swdev/platform-config/Makefile | 1 + .../tn48m2-swdev/platform-config/r0/Makefile | 1 + .../tn48m2-swdev/platform-config/r0/PKG.yml | 1 + .../src/lib/arm64-delta-tn48m2-swdev-r0.yml | 54 +++++++++++++++++++ .../arm64_delta_tn48m2_swdev_r0/__init__.py | 38 +++++++++++++ setup.env | 1 + 23 files changed, 167 insertions(+), 1 deletion(-) create mode 100644 packages/platforms/delta/arm64/tn48m/tn48m2-swdev/.gitignore create mode 100644 packages/platforms/delta/arm64/tn48m/tn48m2-swdev/Makefile create mode 100644 packages/platforms/delta/arm64/tn48m/tn48m2-swdev/modules/Makefile create mode 100644 packages/platforms/delta/arm64/tn48m/tn48m2-swdev/modules/PKG.yml create mode 100644 packages/platforms/delta/arm64/tn48m/tn48m2-swdev/modules/builds/.gitignore create mode 100644 packages/platforms/delta/arm64/tn48m/tn48m2-swdev/modules/builds/Makefile create mode 100644 packages/platforms/delta/arm64/tn48m/tn48m2-swdev/onlp/Makefile create mode 100644 packages/platforms/delta/arm64/tn48m/tn48m2-swdev/onlp/PKG.yml create mode 100644 packages/platforms/delta/arm64/tn48m/tn48m2-swdev/onlp/builds/Makefile create mode 100644 packages/platforms/delta/arm64/tn48m/tn48m2-swdev/onlp/builds/lib/Makefile create mode 100644 packages/platforms/delta/arm64/tn48m/tn48m2-swdev/onlp/builds/onlpdump/Makefile create mode 100644 packages/platforms/delta/arm64/tn48m/tn48m2-swdev/platform-config/Makefile create mode 100644 packages/platforms/delta/arm64/tn48m/tn48m2-swdev/platform-config/r0/Makefile create mode 100644 packages/platforms/delta/arm64/tn48m/tn48m2-swdev/platform-config/r0/PKG.yml create mode 100644 packages/platforms/delta/arm64/tn48m/tn48m2-swdev/platform-config/r0/src/lib/arm64-delta-tn48m2-swdev-r0.yml create mode 100755 packages/platforms/delta/arm64/tn48m/tn48m2-swdev/platform-config/r0/src/python/arm64_delta_tn48m2_swdev_r0/__init__.py diff --git a/packages/base/any/kernels/5.15-lts/configs/arm64-all/Makefile b/packages/base/any/kernels/5.15-lts/configs/arm64-all/Makefile index 6ed5bf116..5b2e1d3ef 100644 --- a/packages/base/any/kernels/5.15-lts/configs/arm64-all/Makefile +++ b/packages/base/any/kernels/5.15-lts/configs/arm64-all/Makefile @@ -15,7 +15,7 @@ K_PATCH_SERIES=series.arm64 include ../../kconfig.mk K_CONFIG := arm64-all.config -K_BUILD_TARGET := Image Image.gz freescale/fsl-ls1043a-rdb.dtb freescale/fsl-ls1046a-rdb-sdk.dtb freescale/fsl-ls2080a-rdb.dtb freescale/fsl-ls2088a-rdb.dtb freescale/fsl-ls1088a-rdb.dtb marvell/accton-as4224.dtb marvell/accton-as5114.dtb marvell/accton-as4564-26p.dtb marvell/delta-tn48m.dtb marvell/delta-tn4810m.dtb marvell/delta-tn48m-dn.dtb marvell/delta-tn4810m-dn.dtb +K_BUILD_TARGET := Image Image.gz freescale/fsl-ls1043a-rdb.dtb freescale/fsl-ls1046a-rdb-sdk.dtb freescale/fsl-ls2080a-rdb.dtb freescale/fsl-ls2088a-rdb.dtb freescale/fsl-ls1088a-rdb.dtb marvell/accton-as4224.dtb marvell/accton-as5114.dtb marvell/accton-as4564-26p.dtb marvell/delta-tn48m.dtb marvell/delta-tn4810m.dtb marvell/delta-tn48m-dn.dtb marvell/delta-tn4810m-dn.dtb marvell/delta-tn48m2-swdev.dtb K_COPY_SRC := arch/arm64/boot/Image K_COPY_GZIP := 1 ifndef K_COPY_DST diff --git a/packages/platforms/delta/arm64/tn48m/src/arm64_delta_tn48m/module/src/platform_lib.c b/packages/platforms/delta/arm64/tn48m/src/arm64_delta_tn48m/module/src/platform_lib.c index 96bbcf7b2..e757ccf49 100644 --- a/packages/platforms/delta/arm64/tn48m/src/arm64_delta_tn48m/module/src/platform_lib.c +++ b/packages/platforms/delta/arm64/tn48m/src/arm64_delta_tn48m/module/src/platform_lib.c @@ -29,6 +29,7 @@ #include #include #include +#include #include "platform_lib.h" plat_id_t gPlat_id = PID_UNKNOWN; @@ -111,6 +112,22 @@ plat_info_t gPlat_info[] = { .psu_count = 2, .led_count = 3, + .sfp_start_idx = 49, + .sfp_end_idx = 52, + }, + [PID_TN48M2_SWDEV] = { + .name = "arm64-delta-tn48m2-swdev", + + .onie_eeprom_path = "/sys/bus/i2c/devices/1-0056/eeprom", + + .cpld_bus = 0, + .cpld_path = "/sys/bus/i2c/devices/0-0041", + + .thermal_count = 11, + .fan_count = 3, + .psu_count = 3, + .led_count = 3, + .sfp_start_idx = 49, .sfp_end_idx = 52, }, @@ -119,12 +136,14 @@ plat_info_t gPlat_info[] = { plat_id_t get_platform_id(void) { int len; + int rc; int pid = PID_UNKNOWN; int cpld_bus = 0; char buf[4] = {0}; char pid_fullpath[PATH_MAX] = {0}; plat_info_t *tn48m_info = &gPlat_info[PID_TN48M]; plat_info_t *tn4810m_pvt_info = &gPlat_info[PID_TN4810M_PVT]; + onlp_onie_info_t onie_syseeprom; if (plat_os_file_is_existed(tn48m_info->cpld_path)) { sprintf(pid_fullpath, "%s/platform_id", tn48m_info->cpld_path); @@ -148,6 +167,13 @@ plat_id_t get_platform_id(void) if (pid == PID_TN4810M_PVT && cpld_bus == 0) pid = PID_TN4810M_NONPVT; + /* Special case to check TN48M2-SWDEV platform */ + if (pid == PID_TN48M2) { + rc = onlp_onie_decode_file(&onie_syseeprom, tn48m_info->onie_eeprom_path); + if (rc >= 0 && onie_syseeprom.device_version >= 4) + pid = PID_TN48M2_SWDEV; + } + return pid; } diff --git a/packages/platforms/delta/arm64/tn48m/src/arm64_delta_tn48m/module/src/platform_lib.h b/packages/platforms/delta/arm64/tn48m/src/arm64_delta_tn48m/module/src/platform_lib.h index c55beaccc..5d71a8b24 100644 --- a/packages/platforms/delta/arm64/tn48m/src/arm64_delta_tn48m/module/src/platform_lib.h +++ b/packages/platforms/delta/arm64/tn48m/src/arm64_delta_tn48m/module/src/platform_lib.h @@ -40,6 +40,7 @@ typedef enum plat_id { PID_TN4810M_PVT, PID_TN48M2, PID_TN4810M_NONPVT, + PID_TN48M2_SWDEV, PID_UNKNOWN, } plat_id_t; @@ -156,6 +157,7 @@ typedef enum plat_psu_id { PLAT_PSU_ID_INVALID = 0, PLAT_PSU_ID_1, PLAT_PSU_ID_2, + PLAT_PSU_ID_3, PLAT_PSU_ID_MAX } plat_psu_id_t; diff --git a/packages/platforms/delta/arm64/tn48m/src/arm64_delta_tn48m/module/src/psui.c b/packages/platforms/delta/arm64/tn48m/src/arm64_delta_tn48m/module/src/psui.c index 0f26d3aa3..8342aa954 100644 --- a/packages/platforms/delta/arm64/tn48m/src/arm64_delta_tn48m/module/src/psui.c +++ b/packages/platforms/delta/arm64/tn48m/src/arm64_delta_tn48m/module/src/psui.c @@ -173,6 +173,12 @@ static plat_psu_t plat_tn48m2_psus[] = { .power_status_path = "/sys/bus/i2c/devices/0-0041/psu2_powergood", .state = PLAT_PSU_STATE_PRESENT, }, + [PLAT_PSU_ID_3] = { + .name = "DCIN", + .type = PLAT_PSU_TYPE_DC12, + .power_status_path = "/sys/bus/i2c/devices/0-0041/dcin_powergood", + .state = PLAT_PSU_STATE_PRESENT, + }, }; static plat_psu_t* get_plat_psu() @@ -186,6 +192,7 @@ static plat_psu_t* get_plat_psu() else if (gPlat_id == PID_TN4810M_NONPVT) return plat_tn4810m_nonpvt_psus; else + /* tn48m2 and tn48m2-swdev shares the same psu configuration */ return plat_tn48m2_psus; } diff --git a/packages/platforms/delta/arm64/tn48m/src/arm64_delta_tn48m/module/src/sysi.c b/packages/platforms/delta/arm64/tn48m/src/arm64_delta_tn48m/module/src/sysi.c index 4c9bf3884..041f3d2ba 100644 --- a/packages/platforms/delta/arm64/tn48m/src/arm64_delta_tn48m/module/src/sysi.c +++ b/packages/platforms/delta/arm64/tn48m/src/arm64_delta_tn48m/module/src/sysi.c @@ -53,6 +53,8 @@ onlp_sysi_platform_get(void) return "arm64-delta-tn48m-poe"; else if (gPlat_id == PID_TN48M2) return "arm64-delta-tn48m2"; + else if (gPlat_id == PID_TN48M2_SWDEV) + return "arm64-delta-tn48m2-swdev"; else if (gPlat_id == PID_TN4810M_PVT || gPlat_id == PID_TN4810M_NONPVT) return "arm64-delta-tn4810m"; else @@ -73,6 +75,9 @@ onlp_sysi_platform_set(const char* platform) if (strstr(platform, "arm64-delta-tn48m-poe-r0")) { return ONLP_STATUS_OK; } + if (strstr(platform, "arm64-delta-tn48m2-swdev-r0")) { + return ONLP_STATUS_OK; + } if (strstr(platform, "arm64-delta-tn4810m-r0")) { return ONLP_STATUS_OK; } diff --git a/packages/platforms/delta/arm64/tn48m/src/modules/arm64-delta-tn48m-cpld.c b/packages/platforms/delta/arm64/tn48m/src/modules/arm64-delta-tn48m-cpld.c index 73dfd87b5..b58c8e0c2 100644 --- a/packages/platforms/delta/arm64/tn48m/src/modules/arm64-delta-tn48m-cpld.c +++ b/packages/platforms/delta/arm64/tn48m/src/modules/arm64-delta-tn48m-cpld.c @@ -53,6 +53,7 @@ #define TN48M_CPLD_BIT_PSU2_PRESENT 1 #define TN48M_CPLD_BIT_PSU1_PG 2 #define TN48M_CPLD_BIT_PSU2_PG 3 +#define TN48M_CPLD_BIT_DCIN_PG 6 #define I2C_RW_RETRY_COUNT 10 #define I2C_RW_RETRY_INTERVAL 60 /* ms */ @@ -124,6 +125,7 @@ enum tn48m_cpld_sysfs_attributes { PSU2_PRESENT, PSU1_PG, PSU2_PG, + DCIN_PG, MODULE_PRESENT_ALL, MODULE_RX_LOS_ALL, MODULE_TX_DIS_ALL, @@ -410,6 +412,9 @@ static ssize_t show_psu_status_bit(struct device *dev, case PSU2_PG: bit = !!(data->psu_status & BIT(TN48M_CPLD_BIT_PSU2_PG)); break; + case DCIN_PG: + bit = !!(data->psu_status & BIT(TN48M_CPLD_BIT_DCIN_PG)); + break; default: bit = 0; dev_err(dev, "Unknown case %d in show_psu_status_bit.\n", attr->index); @@ -423,6 +428,7 @@ static SENSOR_DEVICE_ATTR(psu1_present, S_IRUGO, show_psu_status_bit, NULL, PSU1 static SENSOR_DEVICE_ATTR(psu2_present, S_IRUGO, show_psu_status_bit, NULL, PSU2_PRESENT); static SENSOR_DEVICE_ATTR(psu1_powergood, S_IRUGO, show_psu_status_bit, NULL, PSU1_PG); static SENSOR_DEVICE_ATTR(psu2_powergood, S_IRUGO, show_psu_status_bit, NULL, PSU2_PG); +static SENSOR_DEVICE_ATTR(dcin_powergood, S_IRUGO, show_psu_status_bit, NULL, DCIN_PG); static ssize_t show_module_status_all(struct device *dev, struct device_attribute *devattr, @@ -646,6 +652,7 @@ static struct attribute *tn48m_cpld_attributes[] = { &sensor_dev_attr_psu2_present.dev_attr.attr, &sensor_dev_attr_psu1_powergood.dev_attr.attr, &sensor_dev_attr_psu2_powergood.dev_attr.attr, + &sensor_dev_attr_dcin_powergood.dev_attr.attr, /* tn48m transceiver attributes */ &sensor_dev_attr_module_tx_dis_all.dev_attr.attr, &sensor_dev_attr_module_present_all.dev_attr.attr, diff --git a/packages/platforms/delta/arm64/tn48m/tn48m2-swdev/.gitignore b/packages/platforms/delta/arm64/tn48m/tn48m2-swdev/.gitignore new file mode 100644 index 000000000..da339e467 --- /dev/null +++ b/packages/platforms/delta/arm64/tn48m/tn48m2-swdev/.gitignore @@ -0,0 +1,2 @@ +*arm64*delta*tn48m2*swdev*.mk +onlpdump.mk diff --git a/packages/platforms/delta/arm64/tn48m/tn48m2-swdev/Makefile b/packages/platforms/delta/arm64/tn48m/tn48m2-swdev/Makefile new file mode 100644 index 000000000..dc1e7b86f --- /dev/null +++ b/packages/platforms/delta/arm64/tn48m/tn48m2-swdev/Makefile @@ -0,0 +1 @@ +include $(ONL)/make/pkg.mk diff --git a/packages/platforms/delta/arm64/tn48m/tn48m2-swdev/modules/Makefile b/packages/platforms/delta/arm64/tn48m/tn48m2-swdev/modules/Makefile new file mode 100644 index 000000000..dc1e7b86f --- /dev/null +++ b/packages/platforms/delta/arm64/tn48m/tn48m2-swdev/modules/Makefile @@ -0,0 +1 @@ +include $(ONL)/make/pkg.mk diff --git a/packages/platforms/delta/arm64/tn48m/tn48m2-swdev/modules/PKG.yml b/packages/platforms/delta/arm64/tn48m/tn48m2-swdev/modules/PKG.yml new file mode 100644 index 000000000..20c97e80f --- /dev/null +++ b/packages/platforms/delta/arm64/tn48m/tn48m2-swdev/modules/PKG.yml @@ -0,0 +1 @@ +!include $ONL_TEMPLATES/platform-modules.yml ARCH=arm64 VENDOR=delta BASENAME=arm64-delta-tn48m2-swdev KERNELS="onl-kernel-5.15-lts-arm64-all:arm64" diff --git a/packages/platforms/delta/arm64/tn48m/tn48m2-swdev/modules/builds/.gitignore b/packages/platforms/delta/arm64/tn48m/tn48m2-swdev/modules/builds/.gitignore new file mode 100644 index 000000000..a65b41774 --- /dev/null +++ b/packages/platforms/delta/arm64/tn48m/tn48m2-swdev/modules/builds/.gitignore @@ -0,0 +1 @@ +lib diff --git a/packages/platforms/delta/arm64/tn48m/tn48m2-swdev/modules/builds/Makefile b/packages/platforms/delta/arm64/tn48m/tn48m2-swdev/modules/builds/Makefile new file mode 100644 index 000000000..6732f07f0 --- /dev/null +++ b/packages/platforms/delta/arm64/tn48m/tn48m2-swdev/modules/builds/Makefile @@ -0,0 +1,7 @@ +KERNELS := onl-kernel-5.15-lts-arm64-all:arm64 +KMODULES := $(ONL)/packages/platforms/delta/arm64/tn48m/src/modules/ +VENDOR := delta +BASENAME := arm64-delta-tn48m2-swdev +ARCH := arm64 +include $(ONL)/make/kmodule.mk +export CROSS_COMPILE=aarch64-linux-gnu- diff --git a/packages/platforms/delta/arm64/tn48m/tn48m2-swdev/onlp/Makefile b/packages/platforms/delta/arm64/tn48m/tn48m2-swdev/onlp/Makefile new file mode 100644 index 000000000..dc1e7b86f --- /dev/null +++ b/packages/platforms/delta/arm64/tn48m/tn48m2-swdev/onlp/Makefile @@ -0,0 +1 @@ +include $(ONL)/make/pkg.mk diff --git a/packages/platforms/delta/arm64/tn48m/tn48m2-swdev/onlp/PKG.yml b/packages/platforms/delta/arm64/tn48m/tn48m2-swdev/onlp/PKG.yml new file mode 100644 index 000000000..eedcb9054 --- /dev/null +++ b/packages/platforms/delta/arm64/tn48m/tn48m2-swdev/onlp/PKG.yml @@ -0,0 +1 @@ +!include $ONL_TEMPLATES/onlp-platform-any.yml PLATFORM=arm64-delta-tn48m2-swdev ARCH=arm64 TOOLCHAIN=aarch64-linux-gnu diff --git a/packages/platforms/delta/arm64/tn48m/tn48m2-swdev/onlp/builds/Makefile b/packages/platforms/delta/arm64/tn48m/tn48m2-swdev/onlp/builds/Makefile new file mode 100644 index 000000000..e7437cb23 --- /dev/null +++ b/packages/platforms/delta/arm64/tn48m/tn48m2-swdev/onlp/builds/Makefile @@ -0,0 +1,2 @@ +FILTER=src +include $(ONL)/make/subdirs.mk diff --git a/packages/platforms/delta/arm64/tn48m/tn48m2-swdev/onlp/builds/lib/Makefile b/packages/platforms/delta/arm64/tn48m/tn48m2-swdev/onlp/builds/lib/Makefile new file mode 100644 index 000000000..3e398d9e2 --- /dev/null +++ b/packages/platforms/delta/arm64/tn48m/tn48m2-swdev/onlp/builds/lib/Makefile @@ -0,0 +1,3 @@ +PLATFORM := arm64-delta-tn48m2-swdev +PLATFORM_MODULE := arm64_delta_tn48m +include $(ONL)/packages/base/any/onlp/builds/platform/libonlp-platform.mk diff --git a/packages/platforms/delta/arm64/tn48m/tn48m2-swdev/onlp/builds/onlpdump/Makefile b/packages/platforms/delta/arm64/tn48m/tn48m2-swdev/onlp/builds/onlpdump/Makefile new file mode 100644 index 000000000..7fe1822fe --- /dev/null +++ b/packages/platforms/delta/arm64/tn48m/tn48m2-swdev/onlp/builds/onlpdump/Makefile @@ -0,0 +1,3 @@ +PLATFORM := arm64-delta-tn48m2-swdev +PLATFORM_MODULE := arm64_delta_tn48m +include $(ONL)/packages/base/any/onlp/builds/platform/onlps.mk diff --git a/packages/platforms/delta/arm64/tn48m/tn48m2-swdev/platform-config/Makefile b/packages/platforms/delta/arm64/tn48m/tn48m2-swdev/platform-config/Makefile new file mode 100644 index 000000000..dc1e7b86f --- /dev/null +++ b/packages/platforms/delta/arm64/tn48m/tn48m2-swdev/platform-config/Makefile @@ -0,0 +1 @@ +include $(ONL)/make/pkg.mk diff --git a/packages/platforms/delta/arm64/tn48m/tn48m2-swdev/platform-config/r0/Makefile b/packages/platforms/delta/arm64/tn48m/tn48m2-swdev/platform-config/r0/Makefile new file mode 100644 index 000000000..dc1e7b86f --- /dev/null +++ b/packages/platforms/delta/arm64/tn48m/tn48m2-swdev/platform-config/r0/Makefile @@ -0,0 +1 @@ +include $(ONL)/make/pkg.mk diff --git a/packages/platforms/delta/arm64/tn48m/tn48m2-swdev/platform-config/r0/PKG.yml b/packages/platforms/delta/arm64/tn48m/tn48m2-swdev/platform-config/r0/PKG.yml new file mode 100644 index 000000000..436866238 --- /dev/null +++ b/packages/platforms/delta/arm64/tn48m/tn48m2-swdev/platform-config/r0/PKG.yml @@ -0,0 +1 @@ +!include $ONL_TEMPLATES/platform-config-platform.yml ARCH=arm64 VENDOR=delta BASENAME=arm64-delta-tn48m2-swdev REVISION=r0 diff --git a/packages/platforms/delta/arm64/tn48m/tn48m2-swdev/platform-config/r0/src/lib/arm64-delta-tn48m2-swdev-r0.yml b/packages/platforms/delta/arm64/tn48m/tn48m2-swdev/platform-config/r0/src/lib/arm64-delta-tn48m2-swdev-r0.yml new file mode 100644 index 000000000..dd064558a --- /dev/null +++ b/packages/platforms/delta/arm64/tn48m/tn48m2-swdev/platform-config/r0/src/lib/arm64-delta-tn48m2-swdev-r0.yml @@ -0,0 +1,54 @@ +--- + +###################################################################### +# +# platform-config for TN48M2-SWDEV +# +###################################################################### + +arm64-delta-tn48m2-swdev-r0: + flat_image_tree: + kernel: + <<: *arm64-kernel-5-15 + dtb: + =: delta-tn48m2-swdev.dtb + <<: *arm64-kernel-5-15-package + itb: + <<: *arm64-itb + + loader: + device: /dev/sda + ##partition: /dev/sda1 + loadaddr: 0x10000000 + nos_bootcmds: *ssd_bootcmds + + setenv: + - bootargs: >- + $console + onl_platform=$onl_platform + + environment: + - device: /dev/mtd1 + env_offset: 0x00000000 + env_size: 0x00010000 + sector_size: 0x00010000 + + installer: + - ONL-BOOT: + =: 128MiB + format: ext2 + ##format: raw + - ONL-CONFIG: + =: 128MiB + format: ext4 + - ONL-IMAGES: + =: 1GiB + format: ext4 + - ONL-DATA: + =: 100% + format: ext4 + + network: + interfaces: + ma1: + name: eth0 diff --git a/packages/platforms/delta/arm64/tn48m/tn48m2-swdev/platform-config/r0/src/python/arm64_delta_tn48m2_swdev_r0/__init__.py b/packages/platforms/delta/arm64/tn48m/tn48m2-swdev/platform-config/r0/src/python/arm64_delta_tn48m2_swdev_r0/__init__.py new file mode 100755 index 000000000..07a402020 --- /dev/null +++ b/packages/platforms/delta/arm64/tn48m/tn48m2-swdev/platform-config/r0/src/python/arm64_delta_tn48m2_swdev_r0/__init__.py @@ -0,0 +1,38 @@ +#!/usr/bin/python + +from onl.platform.base import * +from onl.platform.delta import * + +class OnlPlatform_arm64_delta_tn48m2_swdev_r0(OnlPlatformDelta, + OnlPlatformPortConfig_48x1_4x10): + PLATFORM='arm64-delta-tn48m2-swdev-r0' + MODEL="TN48M2-SWDEV" + SYS_OBJECT_ID=".48.14" + + def baseconfig(self): + # Insert platform drivers + self.insmod("arm64-delta-tn48m-cpld.ko") + self.insmod("arm64-delta-tn48m-led.ko") + + ########### initialize I2C bus 1 ########### + self.new_i2c_devices ( + [ + # FAN Controller + ('adt7473', 0x2e, 1), + + # Temperature devices + ('tmp1075', 0x4a, 1), + ('tmp1075', 0x4b, 1), + ] + ) + + # Insert Marvell prestera modules by only probing prestera_pci module + # Suggested by Taras Chornyi + self.modprobe('prestera_pci') + + # set up systemctl rules + for swp in range(1, 53): + cmd = "systemctl enable switchdev-online@swp%d" % swp + subprocess.check_call(cmd, shell=True) + + return True diff --git a/setup.env b/setup.env index e312887d6..d292e0dd7 100755 --- a/setup.env +++ b/setup.env @@ -63,6 +63,7 @@ arm64-nxp-ls1046ardb-r0 arm64-delta-tx4810-r0 arm64-delta-tn4810m-r0 arm64-delta-tn48m2-r0 +arm64-delta-tn48m2-swdev-r0 arm64-delta-tn48m-r0 arm64-delta-tn48m-poe-r0 arm64-delta-tn48m-dn-r0 From c846a24b6e7a13ba739c055ace38cf44d0cc1a36 Mon Sep 17 00:00:00 2001 From: Cary Chen Date: Wed, 17 May 2023 10:16:36 +0800 Subject: [PATCH 2/2] [tn48m] Add DC power status support for TN48M2 ONLP - Added support to show DC power input status in ONLP for TN48M2 platform Signed-off-by: Cary Chen --- .../arm64/tn48m/src/arm64_delta_tn48m/module/src/platform_lib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/platforms/delta/arm64/tn48m/src/arm64_delta_tn48m/module/src/platform_lib.c b/packages/platforms/delta/arm64/tn48m/src/arm64_delta_tn48m/module/src/platform_lib.c index e757ccf49..1d9426d48 100644 --- a/packages/platforms/delta/arm64/tn48m/src/arm64_delta_tn48m/module/src/platform_lib.c +++ b/packages/platforms/delta/arm64/tn48m/src/arm64_delta_tn48m/module/src/platform_lib.c @@ -109,7 +109,7 @@ plat_info_t gPlat_info[] = { .thermal_count = 11, .fan_count = 3, - .psu_count = 2, + .psu_count = 3, .led_count = 3, .sfp_start_idx = 49,