sonic-buildimage icon indicating copy to clipboard operation
sonic-buildimage copied to clipboard

[Micas/Platform]platform support M2-W6510

Open micas-net opened this issue 2 years ago • 19 comments

Why I did it

Add new platform m2-w6510(Trident 3) ASIC Vendor: Broadcom Switch ASIC: Trident 3 Port Config: 48x25G+8x100G

How I did it

Provide device and platform related files.

How to verify it

show platform fan show platform ssdhealth show platform psustatus show platform summary show platform syseeprom show platform temperature show interface status

Work item tracking
  • Microsoft ADO (number only):

How I did it

How to verify it

Which release branch to backport (provide reason below if selected)

  • [ ] 201811
  • [ ] 201911
  • [ ] 202006
  • [ ] 202012
  • [ ] 202106
  • [ ] 202111
  • [ ] 202205
  • [ ] 202211
  • [ ] 202305

Tested branch (Please provide the tested image version)

  • [ ]
  • [ ]

Description for the changelog

Link to config_db schema for YANG module changes

A picture of a cute animal (not mandatory but encouraged)

micas-net avatar Jul 18 '23 05:07 micas-net

/azp run Azure.sonic-buildimage

xumia avatar Jul 18 '23 23:07 xumia

Azure Pipelines successfully started running 1 pipeline(s).

azure-pipelines[bot] avatar Jul 18 '23 23:07 azure-pipelines[bot]

/easycla

jarias-lfx avatar Jul 19 '23 18:07 jarias-lfx

@lguohan Hi guohan, help assign a code review to forward this PR, thanks!

micas-net avatar Aug 03 '23 06:08 micas-net

@prgeor Help review the code, thanks!

micas-net avatar Aug 18 '23 09:08 micas-net

@prgeor thanks for reviewing, and have replied some comments, and the reason for keeping other kernel modules show as below:

  1. wb_at24.c is revised based on the at24.c, adding AT24_FLAG_IRUGO flag for EEPROM's flag to enable none root users' read access, solving the problem of none root users throwing exceptions when executing the show command
  2. wb_i2c_algo_bit.c is revised based on the i2c-algo-bit.c, adding I2C level detection and 9 clock functions to improve I2C reliability
  3. wb_i2c_i801.c is revised based on the i2c-i801.c, adding controller reset and 9 clock functions to improve I2C reliability

micas-net avatar Sep 06 '23 02:09 micas-net

@lguohan for additional review

prgeor avatar Sep 06 '23 16:09 prgeor

for all duplicated drivers in the kernel, please create patch in sonic-linux-kernel, meanwhile do the upstream efforts. we can see whether some of the patch make sense or not. for example, the change to "adding AT24_FLAG_IRUGO flag for EEPROM's flag to enable none root users' read access" does not make sense to me.

lguohan avatar Sep 23 '23 08:09 lguohan

i also see binary files, we do not accept platform binary files

lguohan avatar Sep 23 '23 08:09 lguohan

@lguohan Hi Guohan, the kernel patch is only used by us for now and under Micas' platform folders. We will put forward the problems we encountered and some of our suggestions in sonic-linux-kernel community, and cooperate the community to push the solution of the problem.

Also, we follow the community rules and have deleted all binary files except custom_led.bin because the solution provided by BRCM requires users to write custom_led.c and compile it to generate the custom_led.bin file, same file exists on other vendors' platforms.

micas-net avatar Oct 05 '23 23:10 micas-net

/azpw ms_conflict

micas-net avatar Nov 01 '23 05:11 micas-net

@philo-micas I'm building this to test on a Micas unit we're evaluating with ECI. I had to make several adjustments to these files to allow the build to succeed:

platform/broadcom/sonic-platform-modules-micas/common/modules/intel_spi/intel_spi_pci.c platform/broadcom/sonic-platform-modules-micas/common/modules/intel_spi/intel_spi.c

Those changes were necessary due to the inclusion of this version of the header file:

sonic-buildimage/src/sonic-linux-kernel/linux-5.10.140/include/linux/platform_data/intel-spi.h

...which does not include the set_writable or data members:

/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * Intel PCH/PCU SPI flash driver.
 *
 * Copyright (C) 2016, Intel Corporation
 * Author: Mika Westerberg <[email protected]>
 */

#ifndef INTEL_SPI_PDATA_H
#define INTEL_SPI_PDATA_H

enum intel_spi_type {
        INTEL_SPI_BYT = 1,
        INTEL_SPI_LPT,
        INTEL_SPI_BXT,
        INTEL_SPI_CNL,
};

/**
 * struct intel_spi_boardinfo - Board specific data for Intel SPI driver
 * @type: Type which this controller is compatible with
 * @writeable: The chip is writeable
 */
struct intel_spi_boardinfo {
        enum intel_spi_type type;
        bool writeable;
};

#endif /* INTEL_SPI_PDATA_H */

This is the first time I've tried building SONiC from scratch like this, so there may be a step I overlooked. But I followed the directions in the repository README exactly.

I also had to adjust files/build_templates/sonic_debian_extension.j2 to install external copies of openssh-client_8.4p1-5+deb11u1_amd64.deb and openssh-sftp-server_8.4p1-5+deb11u1_amd64.deb to align with the custom version of openssh-server that script installs on the final build step. So something needs to be adjusted there (probably just merging the more recent commits from master, I'd guess).

justindthomas avatar Nov 30 '23 17:11 justindthomas

@lguohan Have done kernel 6.1 adaptation, as we have reviewed and fixed all reviewed comments month ago, (leave one semgrep error as 'defusedxml' not installed in sonic; test failed due to the test bed connect fail, compiling is fine), help push this pr forward again, thanks.

micas-net avatar Jan 09 '24 09:01 micas-net

report_6510_0110.zip Kernel 6.1.38 adaption Platform test report from sonic-mgmt.

micas-net avatar Jan 11 '24 09:01 micas-net

report_6510_0110.zip Kernel 6.1.38 adaption Platform test report from sonic-mgmt.

@lguohan Hi guohan, test report has been submitted, please help to push forward this pr. Thanks.

micas-net avatar Jan 11 '24 09:01 micas-net

report_6510_0110.zip Kernel 6.1.38 adaption Platform test report from sonic-mgmt.

@lguohan Hi guohan, test report has been submitted, please help to push forward this pr. Thanks.

@lguohan Hi Guohan, please take the time to push forward this PR, it is urgent for us, many thanks!

StephenSJCA avatar Mar 06 '24 03:03 StephenSJCA

Leave one semgrep error as 'defusedxml' was not installed in sonic.

micas-net avatar Mar 15 '24 11:03 micas-net

i also see binary files, we do not accept platform binary files

Is this issue addressed? @philo-micas

zhangyanzhao avatar Mar 26 '24 18:03 zhangyanzhao

i also see binary files, we do not accept platform binary files

Is this issue addressed? @philo-micas

@zhangyanzhao Yes, we have addressed and fixed it in this PR and and other PRs.

micas-net avatar Mar 27 '24 00:03 micas-net

@lguohan Hi guohan, help push forward this, most comments have been addressed, and help rerun the test case for one of the failing test case, thanks.

micas-net avatar May 17 '24 01:05 micas-net

too many duplicated linux kernel modules in this PR. All drivers under this folder (platform/broadcom/sonic-platform-modules-micas/common/modules/linux/) are duplicated from linux kernel. This is cause lots of maintenance issues.

lguohan avatar May 31 '24 07:05 lguohan