From b92d98076959db2cda2eeb96f89f7a4fd0b67b07 Mon Sep 17 00:00:00 2001 From: Karthik Gengan <50580882+gengankarthik@users.noreply.github.com> Date: Wed, 26 Jun 2019 00:53:24 +0530 Subject: [PATCH] Remapping S6000 platform files under Vendor (DellEmc) specific directory (#3079) --- platform/broadcom/platform-modules-dell.mk | 16 +++- platform/broadcom/platform-modules-s6000.mk | 13 --- platform/broadcom/rules.mk | 1 - .../debian/control | 6 +- .../debian/platform-modules-s6000.init | 0 .../debian/platform-modules-s6000.install | 2 + .../debian/platform-modules-s6000.postinst | 7 ++ .../sonic-platform-modules-dell/debian/rules | 6 +- .../s6000}/LICENSE | 0 .../s6000}/MAINTAINERS | 0 .../s6000}/README.md | 0 .../s6000}/modules/Makefile | 0 .../s6000}/modules/dell_s6000_platform.c | 0 .../s6000}/scripts/reset-qsfp | 0 .../s6000}/scripts/set-fan-speed | 0 .../systemd/platform-modules-s6000.service | 0 .../sonic-platform-modules-s6000/.gitignore | 50 ---------- .../debian/changelog | 5 - .../debian/compat | 1 - .../debian/control | 12 --- .../debian/copyright | 16 ---- .../debian/platform-modules-s6000.install | 2 - .../sonic-platform-modules-s6000/debian/rules | 32 ------- .../scripts/io_rd_wr.py | 93 ------------------- 24 files changed, 32 insertions(+), 230 deletions(-) delete mode 100644 platform/broadcom/platform-modules-s6000.mk rename platform/broadcom/{sonic-platform-modules-s6000 => sonic-platform-modules-dell}/debian/platform-modules-s6000.init (100%) create mode 100644 platform/broadcom/sonic-platform-modules-dell/debian/platform-modules-s6000.install create mode 100644 platform/broadcom/sonic-platform-modules-dell/debian/platform-modules-s6000.postinst rename platform/broadcom/{sonic-platform-modules-s6000 => sonic-platform-modules-dell/s6000}/LICENSE (100%) rename platform/broadcom/{sonic-platform-modules-s6000 => sonic-platform-modules-dell/s6000}/MAINTAINERS (100%) rename platform/broadcom/{sonic-platform-modules-s6000 => sonic-platform-modules-dell/s6000}/README.md (100%) rename platform/broadcom/{sonic-platform-modules-s6000 => sonic-platform-modules-dell/s6000}/modules/Makefile (100%) rename platform/broadcom/{sonic-platform-modules-s6000 => sonic-platform-modules-dell/s6000}/modules/dell_s6000_platform.c (100%) rename platform/broadcom/{sonic-platform-modules-s6000 => sonic-platform-modules-dell/s6000}/scripts/reset-qsfp (100%) rename platform/broadcom/{sonic-platform-modules-s6000 => sonic-platform-modules-dell/s6000}/scripts/set-fan-speed (100%) rename platform/broadcom/{sonic-platform-modules-s6000 => sonic-platform-modules-dell/s6000}/systemd/platform-modules-s6000.service (100%) delete mode 100644 platform/broadcom/sonic-platform-modules-s6000/.gitignore delete mode 100644 platform/broadcom/sonic-platform-modules-s6000/debian/changelog delete mode 100644 platform/broadcom/sonic-platform-modules-s6000/debian/compat delete mode 100644 platform/broadcom/sonic-platform-modules-s6000/debian/control delete mode 100644 platform/broadcom/sonic-platform-modules-s6000/debian/copyright delete mode 100644 platform/broadcom/sonic-platform-modules-s6000/debian/platform-modules-s6000.install delete mode 100755 platform/broadcom/sonic-platform-modules-s6000/debian/rules delete mode 100755 platform/broadcom/sonic-platform-modules-s6000/scripts/io_rd_wr.py diff --git a/platform/broadcom/platform-modules-dell.mk b/platform/broadcom/platform-modules-dell.mk index a2d051ffd9..5c8032c8b4 100644 --- a/platform/broadcom/platform-modules-dell.mk +++ b/platform/broadcom/platform-modules-dell.mk @@ -1,26 +1,36 @@ -# Dell Z9100, S6100, Z9264F Platform modules +# Dell S6000, Z9100, S6100, Z9264F Platform modules -DELL_Z9264F_PLATFORM_MODULE_VERSION = 1.1 +DELL_S6000_PLATFORM_MODULE_VERSION = 1.1 DELL_Z9100_PLATFORM_MODULE_VERSION = 1.1 DELL_S6100_PLATFORM_MODULE_VERSION = 1.1 +DELL_Z9264F_PLATFORM_MODULE_VERSION = 1.1 -export DELL_Z9264F_PLATFORM_MODULE_VERSION +export DELL_S6000_PLATFORM_MODULE_VERSION export DELL_Z9100_PLATFORM_MODULE_VERSION export DELL_S6100_PLATFORM_MODULE_VERSION +export DELL_Z9264F_PLATFORM_MODULE_VERSION + +# Dell Z9100 Platform modules DELL_Z9100_PLATFORM_MODULE = platform-modules-z9100_$(DELL_Z9100_PLATFORM_MODULE_VERSION)_amd64.deb $(DELL_Z9100_PLATFORM_MODULE)_SRC_PATH = $(PLATFORM_PATH)/sonic-platform-modules-dell $(DELL_Z9100_PLATFORM_MODULE)_DEPENDS += $(LINUX_HEADERS) $(LINUX_HEADERS_COMMON) $(DELL_Z9100_PLATFORM_MODULE)_PLATFORM = x86_64-dell_z9100_c2538-r0 SONIC_DPKG_DEBS += $(DELL_Z9100_PLATFORM_MODULE) +# Dell S6100 Platform modules DELL_S6100_PLATFORM_MODULE = platform-modules-s6100_$(DELL_S6100_PLATFORM_MODULE_VERSION)_amd64.deb $(DELL_S6100_PLATFORM_MODULE)_PLATFORM = x86_64-dell_s6100_c2538-r0 $(eval $(call add_extra_package,$(DELL_Z9100_PLATFORM_MODULE),$(DELL_S6100_PLATFORM_MODULE))) +# Dell Z9264F Platform modules DELL_Z9264F_PLATFORM_MODULE = platform-modules-z9264f_$(DELL_Z9264F_PLATFORM_MODULE_VERSION)_amd64.deb $(DELL_Z9264F_PLATFORM_MODULE)_PLATFORM = x86_64-dellemc_z9264f_c3538-r0 $(eval $(call add_extra_package,$(DELL_Z9100_PLATFORM_MODULE),$(DELL_Z9264F_PLATFORM_MODULE))) +# Dell S6000 Platform modules +DELL_S6000_PLATFORM_MODULE = platform-modules-s6000_$(DELL_S6000_PLATFORM_MODULE_VERSION)_amd64.deb +$(DELL_S6000_PLATFORM_MODULE)_PLATFORM = x86_64-dell_s6000_s1220-r0 +$(eval $(call add_extra_package,$(DELL_Z9100_PLATFORM_MODULE),$(DELL_S6000_PLATFORM_MODULE))) SONIC_STRETCH_DEBS += $(DELL_Z9100_PLATFORM_MODULE) diff --git a/platform/broadcom/platform-modules-s6000.mk b/platform/broadcom/platform-modules-s6000.mk deleted file mode 100644 index 00cd2cadf2..0000000000 --- a/platform/broadcom/platform-modules-s6000.mk +++ /dev/null @@ -1,13 +0,0 @@ -# Dell S6000 Platform modules - -DELL_S6000_PLATFORM_MODULE_VERSION = 1.0 - -export DELL_S6000_PLATFORM_MODULE_VERSION - -DELL_S6000_PLATFORM_MODULE = platform-modules-s6000_$(DELL_S6000_PLATFORM_MODULE_VERSION)_amd64.deb -$(DELL_S6000_PLATFORM_MODULE)_SRC_PATH = $(PLATFORM_PATH)/sonic-platform-modules-s6000 -$(DELL_S6000_PLATFORM_MODULE)_DEPENDS += $(LINUX_HEADERS) $(LINUX_HEADERS_COMMON) -$(DELL_S6000_PLATFORM_MODULE)_PLATFORM = x86_64-dell_s6000_s1220-r0 -SONIC_DPKG_DEBS += $(DELL_S6000_PLATFORM_MODULE) - -SONIC_STRETCH_DEBS += $(DELL_S6000_PLATFORM_MODULE) diff --git a/platform/broadcom/rules.mk b/platform/broadcom/rules.mk index abedbbe1d6..02eb58df0c 100644 --- a/platform/broadcom/rules.mk +++ b/platform/broadcom/rules.mk @@ -1,6 +1,5 @@ include $(PLATFORM_PATH)/sai-modules.mk include $(PLATFORM_PATH)/sai.mk -include $(PLATFORM_PATH)/platform-modules-s6000.mk include $(PLATFORM_PATH)/platform-modules-dell.mk include $(PLATFORM_PATH)/platform-modules-arista.mk include $(PLATFORM_PATH)/platform-modules-ingrasys.mk diff --git a/platform/broadcom/sonic-platform-modules-dell/debian/control b/platform/broadcom/sonic-platform-modules-dell/debian/control index c30a261fd9..cc24fa13cc 100644 --- a/platform/broadcom/sonic-platform-modules-dell/debian/control +++ b/platform/broadcom/sonic-platform-modules-dell/debian/control @@ -5,7 +5,7 @@ Maintainer: Dell Team Build-Depends: debhelper (>= 8.0.0), bzip2 Standards-Version: 3.9.3 -Package: platform-modules-z9264f +Package: platform-modules-s6000 Architecture: amd64 Depends: linux-image-4.9.0-9-2-amd64 Description: kernel modules for platform devices such as fan, led, sfp @@ -20,3 +20,7 @@ Architecture: amd64 Depends: linux-image-4.9.0-9-2-amd64 Description: kernel modules for platform devices such as fan, led, sfp +Package: platform-modules-z9264f +Architecture: amd64 +Depends: linux-image-4.9.0-9-2-amd64 +Description: kernel modules for platform devices such as fan, led, sfp diff --git a/platform/broadcom/sonic-platform-modules-s6000/debian/platform-modules-s6000.init b/platform/broadcom/sonic-platform-modules-dell/debian/platform-modules-s6000.init similarity index 100% rename from platform/broadcom/sonic-platform-modules-s6000/debian/platform-modules-s6000.init rename to platform/broadcom/sonic-platform-modules-dell/debian/platform-modules-s6000.init diff --git a/platform/broadcom/sonic-platform-modules-dell/debian/platform-modules-s6000.install b/platform/broadcom/sonic-platform-modules-dell/debian/platform-modules-s6000.install new file mode 100644 index 0000000000..63eeddf04e --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-dell/debian/platform-modules-s6000.install @@ -0,0 +1,2 @@ +s6000/systemd/platform-modules-s6000.service etc/systemd/system +common/io_rd_wr.py usr/local/bin diff --git a/platform/broadcom/sonic-platform-modules-dell/debian/platform-modules-s6000.postinst b/platform/broadcom/sonic-platform-modules-dell/debian/platform-modules-s6000.postinst new file mode 100644 index 0000000000..a9b90fa86f --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-dell/debian/platform-modules-s6000.postinst @@ -0,0 +1,7 @@ +# postinst script for S6000 + +# Enable Dell-S6000-platform-service +depmod -a +systemctl enable platform-modules-s6000.service +systemctl start platform-modules-s6000.service +#DEBHELPER# diff --git a/platform/broadcom/sonic-platform-modules-dell/debian/rules b/platform/broadcom/sonic-platform-modules-dell/debian/rules index 860e46bf70..5f8fffd399 100755 --- a/platform/broadcom/sonic-platform-modules-dell/debian/rules +++ b/platform/broadcom/sonic-platform-modules-dell/debian/rules @@ -5,7 +5,7 @@ export INSTALL_MOD_DIR:=extra KVERSION ?= $(shell uname -r) KERNEL_SRC := /lib/modules/$(KVERSION) MOD_SRC_DIR:= $(shell pwd) -MODULE_DIRS:= s6100 z9100 z9264f +MODULE_DIRS:= s6000 z9100 s6100 z9264f COMMON_DIR := common %: @@ -30,6 +30,10 @@ override_dh_auto_install: $(KERNEL_SRC)/$(INSTALL_MOD_DIR); \ cp $(MOD_SRC_DIR)/$${mod}/modules/*.ko \ debian/platform-modules-$${mod}/$(KERNEL_SRC)/$(INSTALL_MOD_DIR); \ + if [ $$mod = "s6000" ]; then \ + dh_installdirs -pplatform-modules-$${mod} usr/local/bin ; \ + cp -r $(MOD_SRC_DIR)/$${mod}/scripts/* debian/platform-modules-$${mod}/usr/local/bin; \ + fi; \ done) override_dh_usrlocal: diff --git a/platform/broadcom/sonic-platform-modules-s6000/LICENSE b/platform/broadcom/sonic-platform-modules-dell/s6000/LICENSE similarity index 100% rename from platform/broadcom/sonic-platform-modules-s6000/LICENSE rename to platform/broadcom/sonic-platform-modules-dell/s6000/LICENSE diff --git a/platform/broadcom/sonic-platform-modules-s6000/MAINTAINERS b/platform/broadcom/sonic-platform-modules-dell/s6000/MAINTAINERS similarity index 100% rename from platform/broadcom/sonic-platform-modules-s6000/MAINTAINERS rename to platform/broadcom/sonic-platform-modules-dell/s6000/MAINTAINERS diff --git a/platform/broadcom/sonic-platform-modules-s6000/README.md b/platform/broadcom/sonic-platform-modules-dell/s6000/README.md similarity index 100% rename from platform/broadcom/sonic-platform-modules-s6000/README.md rename to platform/broadcom/sonic-platform-modules-dell/s6000/README.md diff --git a/platform/broadcom/sonic-platform-modules-s6000/modules/Makefile b/platform/broadcom/sonic-platform-modules-dell/s6000/modules/Makefile similarity index 100% rename from platform/broadcom/sonic-platform-modules-s6000/modules/Makefile rename to platform/broadcom/sonic-platform-modules-dell/s6000/modules/Makefile diff --git a/platform/broadcom/sonic-platform-modules-s6000/modules/dell_s6000_platform.c b/platform/broadcom/sonic-platform-modules-dell/s6000/modules/dell_s6000_platform.c similarity index 100% rename from platform/broadcom/sonic-platform-modules-s6000/modules/dell_s6000_platform.c rename to platform/broadcom/sonic-platform-modules-dell/s6000/modules/dell_s6000_platform.c diff --git a/platform/broadcom/sonic-platform-modules-s6000/scripts/reset-qsfp b/platform/broadcom/sonic-platform-modules-dell/s6000/scripts/reset-qsfp similarity index 100% rename from platform/broadcom/sonic-platform-modules-s6000/scripts/reset-qsfp rename to platform/broadcom/sonic-platform-modules-dell/s6000/scripts/reset-qsfp diff --git a/platform/broadcom/sonic-platform-modules-s6000/scripts/set-fan-speed b/platform/broadcom/sonic-platform-modules-dell/s6000/scripts/set-fan-speed similarity index 100% rename from platform/broadcom/sonic-platform-modules-s6000/scripts/set-fan-speed rename to platform/broadcom/sonic-platform-modules-dell/s6000/scripts/set-fan-speed diff --git a/platform/broadcom/sonic-platform-modules-s6000/systemd/platform-modules-s6000.service b/platform/broadcom/sonic-platform-modules-dell/s6000/systemd/platform-modules-s6000.service similarity index 100% rename from platform/broadcom/sonic-platform-modules-s6000/systemd/platform-modules-s6000.service rename to platform/broadcom/sonic-platform-modules-dell/s6000/systemd/platform-modules-s6000.service diff --git a/platform/broadcom/sonic-platform-modules-s6000/.gitignore b/platform/broadcom/sonic-platform-modules-s6000/.gitignore deleted file mode 100644 index 7f287d5382..0000000000 --- a/platform/broadcom/sonic-platform-modules-s6000/.gitignore +++ /dev/null @@ -1,50 +0,0 @@ -# Object files -*.o -*.ko -*.obj -*.elf - -# Precompiled Headers -*.gch -*.pch - -# Libraries -*.lib -*.a -*.la -*.lo - -# Shared objects (inc. Windows DLLs) -*.dll -*.so -*.so.* -*.dylib - -# Executables -*.exe -*.out -*.app -*.i*86 -*.x86_64 -*.hex - -# Debug files -*.dSYM/ -*.su - -# Kernel Module Compile Results -*.mod* -*.cmd -*.o.d -.tmp_versions/ -modules.order -Module.symvers -Mkfile.old -dkms.conf - -# Debian packaging -*.debhelper.log -*.postinst.debhelper -*.postrm.debhelper -*.prerm.debhelper -*.substvars diff --git a/platform/broadcom/sonic-platform-modules-s6000/debian/changelog b/platform/broadcom/sonic-platform-modules-s6000/debian/changelog deleted file mode 100644 index 0a6b7820bd..0000000000 --- a/platform/broadcom/sonic-platform-modules-s6000/debian/changelog +++ /dev/null @@ -1,5 +0,0 @@ -platform-modules-s6000 (1.0) unstable; urgency=low - - * Initial release - - -- Shuotian Cheng Mon, 11 Nov 2015 11:11:11 -0800 diff --git a/platform/broadcom/sonic-platform-modules-s6000/debian/compat b/platform/broadcom/sonic-platform-modules-s6000/debian/compat deleted file mode 100644 index 45a4fb75db..0000000000 --- a/platform/broadcom/sonic-platform-modules-s6000/debian/compat +++ /dev/null @@ -1 +0,0 @@ -8 diff --git a/platform/broadcom/sonic-platform-modules-s6000/debian/control b/platform/broadcom/sonic-platform-modules-s6000/debian/control deleted file mode 100644 index a9f2a76ebe..0000000000 --- a/platform/broadcom/sonic-platform-modules-s6000/debian/control +++ /dev/null @@ -1,12 +0,0 @@ -Source: platform-modules-s6000 -Section: main -Priority: extra -Maintainer: Shuotian Cheng -Build-Depends: debhelper (>= 8.0.0), bzip2 -Standards-Version: 3.9.3 - -Package: platform-modules-s6000 -Architecture: amd64 -Depends: linux-image-4.9.0-9-2-amd64 -Description: kernel modules for platform devices such as fan, led, sfp - diff --git a/platform/broadcom/sonic-platform-modules-s6000/debian/copyright b/platform/broadcom/sonic-platform-modules-s6000/debian/copyright deleted file mode 100644 index 6fbc5a7f6c..0000000000 --- a/platform/broadcom/sonic-platform-modules-s6000/debian/copyright +++ /dev/null @@ -1,16 +0,0 @@ -Provides linux sysfs interface to Dell S6000 platform hardware peripherals -Copyright (C) 2016 Microsoft - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/platform/broadcom/sonic-platform-modules-s6000/debian/platform-modules-s6000.install b/platform/broadcom/sonic-platform-modules-s6000/debian/platform-modules-s6000.install deleted file mode 100644 index 8fdf12a41c..0000000000 --- a/platform/broadcom/sonic-platform-modules-s6000/debian/platform-modules-s6000.install +++ /dev/null @@ -1,2 +0,0 @@ -systemd/platform-modules-s6000.service lib/systemd/system -scripts/io_rd_wr.py usr/local/bin diff --git a/platform/broadcom/sonic-platform-modules-s6000/debian/rules b/platform/broadcom/sonic-platform-modules-s6000/debian/rules deleted file mode 100755 index 5473743ea3..0000000000 --- a/platform/broadcom/sonic-platform-modules-s6000/debian/rules +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/make -f - -export INSTALL_MOD_DIR:=extra - -PACKAGE_NAME := platform-modules-s6000 -KVERSION ?= $(shell uname -r) -KERNEL_SRC := /lib/modules/$(KVERSION) -MODULE_SRC := $(shell pwd)/modules -SCRIPT_SRC := $(shell pwd)/scripts - -%: - dh $@ --with=systemd - -override_dh_auto_build: - make -C $(KERNEL_SRC)/build M=$(MODULE_SRC) - -override_dh_auto_install: - dh_installdirs -p$(PACKAGE_NAME) $(KERNEL_SRC)/$(INSTALL_MOD_DIR) - cp $(MODULE_SRC)/*.ko debian/$(PACKAGE_NAME)/$(KERNEL_SRC)/$(INSTALL_MOD_DIR) - dh_installdirs -p$(PACKAGE_NAME) usr/local/bin - cp -r $(SCRIPT_SRC)/* debian/$(PACKAGE_NAME)/usr/local/bin - -override_dh_usrlocal: - -override_dh_pysupport: - -override_dh_clean: - dh_clean - rm -f $(MODULE_SRC)/*.o $(MODULE_SRC)/*.ko $(MODULE_SRC)/*.mod.c $(MODULE_SRC)/.*.cmd - rm -f $(MODULE_SRC)/Module.markers $(MODULE_SRC)/Module.symvers $(MODULE_SRC)/modules.order - rm -rf $(MODULE_SRC)/.tmp_versions - diff --git a/platform/broadcom/sonic-platform-modules-s6000/scripts/io_rd_wr.py b/platform/broadcom/sonic-platform-modules-s6000/scripts/io_rd_wr.py deleted file mode 100755 index dc9dd09807..0000000000 --- a/platform/broadcom/sonic-platform-modules-s6000/scripts/io_rd_wr.py +++ /dev/null @@ -1,93 +0,0 @@ -#!/usr/bin/python -#Script to read/write the io based registers - -import sys -import os -import getopt -import struct - -io_resource='/dev/port' - -def usage(): - ''' This is the Usage Method ''' - - print 'Utility for IO read/write' - print '\t\t io_rd_wr.py --get --offset ' - print '\t\t io_rd_wr.py --set --val --offset ' - sys.exit(1) - -def io_reg_read(io_resource,offset): - fd=os.open(io_resource, os.O_RDONLY) - if(fd<0): - print 'file open failed %s"%io_resource' - return - if(os.lseek(fd, offset, os.SEEK_SET) != offset): - print 'lseek failed on %s'%io_resource - return - buf=os.read(fd,1) - reg_val1=ord(buf) - print 'reg value %x'%reg_val1 - os.close(fd) - -def io_reg_write(io_resource,offset,val): - fd=os.open(io_resource,os.O_RDWR) - if(fd<0): - print 'file open failed %s"%io_resource' - return - if(os.lseek(fd, offset, os.SEEK_SET) != offset): - print 'lseek failed on %s'%io_resource - return - ret=os.write(fd,struct.pack('B',val)) - if(ret != 1): - print 'write failed %d'%ret - return - os.close(fd) - -def main(argv): - - ''' The main function will read the user input from the - command line argument and process the request ''' - - opts = '' - val = '' - choice = '' - resouce = '' - offset = '' - - try: - opts, args = getopt.getopt(argv, "hgs:" , \ - ["val=","offset=","help", "get", "set"]) - - except getopt.GetoptError: - usage() - - for opt,arg in opts: - - if opt in ('-h','--help'): - choice = 'help' - - elif opt in ('-g', '--get'): - choice = 'get' - - elif opt in ('-s', '--set'): - choice = 'set' - - elif opt == '--offset': - offset = int(arg,16) - - elif opt == '--val': - val = int(arg,16) - - if choice == 'get' and offset != '': - io_reg_read(io_resource,offset) - - elif choice == 'set' and offset != '' and val != '': - io_reg_write(io_resource,offset,val) - - else: - usage() - -#Calling the main method -if __name__ == "__main__": - main(sys.argv[1:]) -