Remapping S6000 platform files under Vendor (DellEmc) specific directory (#3079)

This commit is contained in:
Karthik Gengan 2019-06-26 00:53:24 +05:30 committed by Joe LeVeque
parent 94b3c362f8
commit b92d980769
24 changed files with 32 additions and 230 deletions

View File

@ -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)

View File

@ -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)

View File

@ -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

View File

@ -5,7 +5,7 @@ Maintainer: Dell Team <support@dell.com>
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

View File

@ -0,0 +1,2 @@
s6000/systemd/platform-modules-s6000.service etc/systemd/system
common/io_rd_wr.py usr/local/bin

View File

@ -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#

View File

@ -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:

View File

@ -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

View File

@ -1,5 +0,0 @@
platform-modules-s6000 (1.0) unstable; urgency=low
* Initial release
-- Shuotian Cheng <shuche@microsoft.com> Mon, 11 Nov 2015 11:11:11 -0800

View File

@ -1,12 +0,0 @@
Source: platform-modules-s6000
Section: main
Priority: extra
Maintainer: Shuotian Cheng <shuche@microsoft.com>
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

View File

@ -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.

View File

@ -1,2 +0,0 @@
systemd/platform-modules-s6000.service lib/systemd/system
scripts/io_rd_wr.py usr/local/bin

View File

@ -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

View File

@ -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 <offset>'
print '\t\t io_rd_wr.py --set --val <val> --offset <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:])