Skip to content

Commit

Permalink
[CI][doc][build] Trim platform folder files trailing blanks
Browse files Browse the repository at this point in the history
- run pre-commit tox profile to trim all trailing blanks
- use several commits with a per-folder based strategy
  to ease their merge

Issue sonic-net#15114

Signed-off-by: Guillaume Lambert <guillaume.lambert@orange.com>
  • Loading branch information
guillaumelambert committed May 19, 2023
1 parent ecb4db5 commit b25a1ed
Show file tree
Hide file tree
Showing 1,079 changed files with 12,207 additions and 12,208 deletions.
4 changes: 2 additions & 2 deletions platform/barefoot/bfn-modules/modules/bf_ioctl.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*******************************************************************************
Barefoot Networks Switch ASIC Linux driver
Copyright(c) 2015 - 2019 Barefoot Networks, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms and conditions of the GNU General Public License,
version 2, as published by the Free Software Foundation.
Expand Down Expand Up @@ -39,7 +39,7 @@ typedef uint64_t phys_addr_t;

#define BF_IOC_MAGIC 'b'
#define BF_TBUS_MSIX_INDICES_MAX 3
#define BF_TBUS_MSIX_INDICES_MIN 1
#define BF_TBUS_MSIX_INDICES_MIN 1

typedef struct bf_dma_bus_map_s
{
Expand Down
2 changes: 1 addition & 1 deletion platform/barefoot/bfn-modules/modules/bf_kdrv.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*******************************************************************************
Barefoot Networks Switch ASIC Linux driver
Copyright(c) 2015 - 2019 Barefoot Networks, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms and conditions of the GNU General Public License,
version 2, as published by the Free Software Foundation.
Expand Down
4 changes: 2 additions & 2 deletions platform/barefoot/docker-saiserver-bfn.mk
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ $(SYNCD_INIT_COMMON_SCRIPT)_PATH = $(SRC_PATH)/sonic-sairedis/syncd/scripts
SONIC_COPY_FILES += $(SYNCD_INIT_COMMON_SCRIPT)

# Same dependence as syncd
$(DOCKER_SAISERVER_BFN)_DEPENDS += $(SAISERVER)
$(DOCKER_SAISERVER_BFN)_DEPENDS += $(SAISERVER)
# Install syncd for reuse the config fun
#$(DOCKER_SAISERVER_BFN)_DEPENDS += $(SYNCD)
$(DOCKER_SAISERVER_BFN)_DEPENDS += $(BFN_SAI) $(BFN_INGRASYS_PLATFORM) $(BFN_PLATFORM) $(LIBTHRIFT_0_14_1)
$(DOCKER_SAISERVER_BFN)_FILES += $(SYNCD_INIT_COMMON_SCRIPT)

# Same dependence as ENABLE_SYNCD_RPC
# Same dependence as ENABLE_SYNCD_RPC
$(DOCKER_SAISERVER_BFN)_DEPENDS += $(LIBSAITHRIFT_DEV) $(LIBTHRIFT_0_14_1_DEV)

# Runtime dependency on sai is set only for syncd
Expand Down
2 changes: 1 addition & 1 deletion platform/barefoot/one-image.mk
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ $(SONIC_ONE_IMAGE)_LAZY_INSTALLS += $(BFN_PLATFORM_MODULE)
$(SONIC_ONE_IMAGE)_LAZY_INSTALLS += $(BFN_MONTARA_PLATFORM_MODULE)
$(SONIC_ONE_IMAGE)_LAZY_INSTALLS += $(BFN_NEWPORT_PLATFORM_MODULE)
$(SONIC_ONE_IMAGE)_LAZY_INSTALLS += $(BFN_NEWPORT_BF_PLATFORM_MODULE)
$(SONIC_ONE_IMAGE)_LAZY_INSTALLS += $(WNC_OSW1800_PLATFORM_MODULE)
$(SONIC_ONE_IMAGE)_LAZY_INSTALLS += $(WNC_OSW1800_PLATFORM_MODULE)
$(SONIC_ONE_IMAGE)_LAZY_INSTALLS += $(INGRASYS_S9180_32X_PLATFORM_MODULE)
$(SONIC_ONE_IMAGE)_LAZY_INSTALLS += $(INGRASYS_S9280_64X_PLATFORM_MODULE)
$(SONIC_ONE_IMAGE)_LAZY_INSTALLS += $(BFN_MONTARA_QS_PLATFORM_MODULE)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def get_bmc_version():
ver = "N/A"
def bmc_get(client):
return client.pltfm_mgr.pltfm_mgr_chss_mgmt_bmc_ver_get()
try:
try:
ver = thrift_try(bmc_get)
except Exception:
pass
Expand Down Expand Up @@ -101,7 +101,7 @@ def __parse_component_section(self, section, component, is_module_component=Fals
for key2, value2 in value1.items():
if not self.__is_str(value2):
self.__parser_component_fail("string is expected: key={}".format(key2))

self.__chassis_component_map[section][key1] = value1

if missing_key is not None:
Expand Down Expand Up @@ -139,7 +139,7 @@ def get_components_list(self):
self.__component_list = []
for key, value in self.__chassis_component_map[self.__bf_model].items():
self.__component_list.append(key)

return self.__component_list

def get_chassis_component_map(self):
Expand All @@ -150,7 +150,7 @@ def __parse_platform_components(self, platform_components_path):
data = json.load(platform_components)
kkey, val = list(data[self.CHASSIS_KEY].items())[0]
self.__bf_model = kkey

if not self.__is_dict(data):
self.__parser_platform_fail("dictionary is expected: key=root")

Expand Down Expand Up @@ -179,7 +179,7 @@ def __init__(self, component_index=0):
self.name = "N/A"
self.version = "N/A"
self.description = "N/A"
self.name = self.bpcp.get_components_list()[self.index]
self.name = self.bpcp.get_components_list()[self.index]
except IndexError as e:
print("Error: No components found in plaform_components.json")

Expand Down Expand Up @@ -281,7 +281,7 @@ def is_replaceable(self):
bool: True if it is replaceable.
"""
return False

def get_available_firmware_version(self, image_path):
return 'None'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def file_create(path, mode=None):
Ensure that file is created with the appropriate permissions
Args:
path: full path of a file
mode: file permission in octal representation
mode: file permission in octal representation
"""
def run_cmd(cmd):
if os.geteuid() != 0:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def __get_thresholds(self, f):
def check_in_range(self, temperature):
temp_f = float(temperature)
return temp_f > self._min_temperature and temp_f <= self._max_temperature

def check_high_threshold(self, temperature, attr_suffix):
temp_f = float(temperature)
check_range = True
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ Build-Depends: debhelper (>= 9)
Standards-Version: 1.0.0

Package: sonic-platform-ingrasys-s9180-32x
Architecture: amd64
Architecture: amd64
Description: This package contains S9180-32X platform driver utility for SONiC project.

Package: sonic-platform-ingrasys-s9280-64x
Architecture: amd64
Architecture: amd64
Description: This package contains S9280-64X platform driver utility for SONiC project.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ start)
;;

stop)

i2c_utils.sh i2c_deinit

echo "done."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ start)
;;

stop)

i2c_utils i2c_deinit

echo "done."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ Please see the LICENSE file for copies of both licenses.
## Kernel modules and drivers

The driver for interacting with Ingrasys S9180-32X is contained in the I2C
kernel module and initialization script. The initialization script loads
The driver for interacting with Ingrasys S9180-32X is contained in the I2C
kernel module and initialization script. The initialization script loads
the modules in the correct order. It has been built and tested against
the Linux 3.16 kernel.
the Linux 3.16 kernel.

The initialization script will modprobe the needed modules, navigate to the
module's device directory in sysfs, and write configuration data to
The initialization script will modprobe the needed modules, navigate to the
module's device directory in sysfs, and write configuration data to
the kernel module.

### IGB
Expand All @@ -54,7 +54,7 @@ The IGB module must be loaded first on Ingrasys S9180-32X platform.
The I2C i801 on Ingrasys S9180-32X can be found in
`/sys/bus/i2c/devices/i2c-0/`

This is I2C bus for Clock Gen, DIMM channel and digital potentiometers.
This is I2C bus for Clock Gen, DIMM channel and digital potentiometers.

The i801 module must be loaded second on Ingrasys S9180-32X.

Expand All @@ -69,36 +69,36 @@ The i801 module must be loaded third on Ingrasys S9180-32X.

### I2C PCA9548
The PCA9548 module on S9180-32X can be found in
`/sys/bus/i2c/devices/i2c-2/` , `/sys/bus/i2c/devices/i2c-3/`,
`/sys/bus/i2c/devices/i2c-2/` , `/sys/bus/i2c/devices/i2c-3/`,
`/sys/bus/i2c/devices/i2c-4/`, `/sys/bus/i2c/devices/i2c-5/`,
`/sys/bus/i2c/devices/i2c-6/`, `/sys/bus/i2c/devices/i2c-7/`,
`/sys/bus/i2c/devices/i2c-8/`, `/sys/bus/i2c/devices/i2c-9/`.

The pca9548 module for zQSFP module get/set functions, PSU information,
The pca9548 module for zQSFP module get/set functions, PSU information,
fan status and EEPROM.

## Hardware components

The hardware components are initialized in the init script on S9180-32X.
The hardware components are initialized in the init script on S9180-32X.
The following describes manual initialization as well as interaction.
The examples below are just for Ingrasys S9180-32X platform.

### Hardware initialization

When the sonic-platform-ingrasys-s9180 package is installed on the S9180-32X,
it is automatically initialized. If you want to manual initialization, the
it is automatically initialized. If you want to manual initialization, the
utility command usage as follows:
```
i2c_utils.sh i2c_init
```

### EEPROM

The EEPROM is including the board SKU, model name, vendor name, serial number,
The EEPROM is including the board SKU, model name, vendor name, serial number,
and other information can be accessed with the specific eeprom kernel module.
After using `modprobe eeprom_mb` to detect the eeprom, it will show up in sysfs.

The hexdump utility can be used to decode the raw output of the EEPROM.
The hexdump utility can be used to decode the raw output of the EEPROM.
For example,
```
bash# echo "mb_eeprom 0x54" > /sys/bus/i2c/devices/i2c-9/new_device
Expand Down Expand Up @@ -129,11 +129,11 @@ QSFP Module Port LEDs control by ASIC library.

### Fan speed

Fan speed are controlled by the w83795 kernel module.
Fan speed are controlled by the w83795 kernel module.
It can be found in `/sys/class/hwmon/hwmon3/device/`.
If they were compiled as modules, you will need to modprobe w83795 for
their sysfs entries to show up. Each fan has an `fan<N>_input` file
for reading the fan speed. And `pwm1` setting fan1 to fan4,
their sysfs entries to show up. Each fan has an `fan<N>_input` file
for reading the fan speed. And `pwm1` setting fan1 to fan4,
`pwm2` setting fan5 to fan8.

There is docker-platform-monitor container installed fancontrol package that can
Expand All @@ -143,19 +143,19 @@ automatic control platform fan speed.
### Temperature sensors

Temperature sensors are controlled by the w83795 kernel
module. It can be found in `/sys/class/hwmon/hwmon3/device/`.
module. It can be found in `/sys/class/hwmon/hwmon3/device/`.
If they were compiled as modules, then you will need to modprobe w83795 for
their sysfs entries to show up.
`temp1_input` is front MAC temperature sensor. `temp2_input` is rear MAC
temperature sensor.
`temp1_input` is front MAC temperature sensor. `temp2_input` is rear MAC
temperature sensor.

There is docker-platform-monitor container installed lm-sensors package that can
monitor platform temperature. And `sensors` command can show each
monitor platform temperature. And `sensors` command can show each
temperature sensors status.

### Power supplies

Power supplies status and its EEPROM info can be used i2c utility
Power supplies status and its EEPROM info can be used i2c utility
`/usr/sbin/i2c_utils.sh` to get.
The usage as follows:
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ MODULE_PARM_DESC(nowayout,
"Watchdog cannot be stopped once started (default="
__MODULE_STRING(WATCHDOG_NOWAYOUT) ")");


static int cpld_wdt_check_timeout_range(unsigned int tmrval)
{
if (tmrval < 5 || tmrval > 20) {
Expand All @@ -141,7 +141,7 @@ static int cpld_wdt_stop(void *arg)
spin_lock(&cpld_wdt_private.io_lock);

outb(0x1, TCO1_STS);

DEBUG_PRINT("cpld_wdt_stop done");

spin_unlock(&cpld_wdt_private.io_lock);
Expand All @@ -157,7 +157,7 @@ static int cpld_wdt_ping(void *arg)
outb(0x1, TCO1_STS); /* write 1 to clear bit */
udelay(100);
outb(0x3, TCO1_STS);

DEBUG_PRINT("cpld_wdt_ping done");

spin_unlock(&cpld_wdt_private.io_lock);
Expand Down Expand Up @@ -210,9 +210,9 @@ static int cpld_wdt_probe(struct platform_device *dev)

/* Make sure the watchdog is not running */
cpld_wdt_stop(NULL);

cpld_wdt_check_timeout_range(heartbeat);

cpld_wdt_tsk = kthread_create(kthread_wdt_ping_loop, &data, "cpld_wdt_tsk");
if (IS_ERR(cpld_wdt_tsk)) {
ret = PTR_ERR(cpld_wdt_tsk);
Expand Down Expand Up @@ -271,10 +271,10 @@ static int __init cpld_wdt_init_module(void)
printk(KERN_WARNING "Fail to create cpld device\n");
goto error_cpld;
}


return 0;
error_cpld:
error_cpld:
platform_driver_unregister(&cpld_wdt_driver);
return err;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ static void mb_eeprom_update_client(struct i2c_client *client, u8 slice)
data->data[j] = res & 0xFF;
}
}

data->last_updated[slice] = jiffies;
data->valid |= (1 << slice);
}
Expand Down
Loading

0 comments on commit b25a1ed

Please sign in to comment.