Skip to content

Commit

Permalink
Add nvidia arm section and an ability to patch kconfig-inc and fix ma…
Browse files Browse the repository at this point in the history
…nage-config (sonic-net#336)

* \Add nvidia arm markers and add an ability to patch kconfig-inc

Signed-off-by: Vivek Reddy <[email protected]>

* Minor issue in manage_config script

Signed-off-by: Vivek Reddy <[email protected]>

* Handle review comments

Signed-off-by: Vivek Reddy <[email protected]>

* Moved all the changes into one patch

Signed-off-by: Vivek Reddy <[email protected]>

* Intgerate HW-MGMT 7.0030.1037 Changes

 ## Patch List
* 0172-DS-platform-mlx-platform-Add-SPI-path-for-rack-switc.patch :
* 0182-platform-mellanox-Introduce-support-of-new-Nvidia-L1.patch : torvalds/linux@dd635e33b5c9
* 0183-platform-mellanox-Split-initialization-procedure.patch : torvalds/linux@0170f616f496
* 0184-platform-mellanox-Split-logic-in-init-and-exit-flow.patch : torvalds/linux@158cd8320776
* 0185-platform-mellanox-Extend-all-systems-with-I2C-notifi.patch : torvalds/linux@233fd7e44cd7
* 0187-platform_data-mlxreg-Add-field-with-mapped-resource-.patch : torvalds/linux@26917eab144c
* 0188-i2c-mux-Add-register-map-based-mux-driver.patch : https://patchwork.ozlabs.org/project/linux-i2c/patch/[email protected]/
* 0189-i2c-mlxcpld-Allow-driver-to-run-on-ARM64-architectur.patch :
* 0190-i2c-mlxcpld-Support-PCIe-mapped-register-space.patch :
* 0192-i2c-mlxcpld-Add-support-for-extended-transaction-len.patch :
* 0193-platform-mellanox-mlx-platform-Add-mux-selection-reg.patch : torvalds/linux@cefdbc7815660
* 0194-platform-mellanox-mlx-platform-Move-bus-shift-assign.patch : torvalds/linux@50b823fdd357e
* 0195-platform-mellanox-Add-support-for-dynamic-I2C-channe.patch :
* 0196-platform-mellanox-Cosmetic-changes.patch :
* 0197-platform-mellanox-Fix-order-in-exit-flow.patch :
* 0198-platform-mellanox-Add-new-attributes.patch :
* 0199-platform-mellanox-Change-register-offset-addresses.patch :
* 0269-platform-mellanox-Add-field-upgrade-capability-regis.patch :
* 0270-platform-mellanox-Modify-reset-causes-description.patch :
* 0278-platform-mellanox-mlx-platform-Modify-graceful-shutd.patch :
* 0279-platform-mellanox-mlx-platform-Fix-signals-polarity-.patch :
* 0280-platform-mellanox-mlxreg-hotplug-Extend-condition-fo.patch :
* 0281-platform-mellanox-mlx-platform-Modify-health-and-pow.patch :
* 0282-platform-mellanox-mlx-platform-Add-reset-cause-attri.patch :
* 0284-platform-mellanox-mlx-platform-add-support-for-addit.patch :
* 0294-hwmon-pmbus-Add-support-for-MPS-Multi-phase-mp2891-c.patch :
* 0295-dt-bindings-trivial-devices-Add-mps-mp2891.patch :
* 0304-platform-mellanox-mlx-platform-Modify-power-off-call.patch :
* 0305-Extend-driver-to-support-Infineon-Digital-Multi-phas.patch :
* 0311-platform-mellanox-nvsw-sn2201-change-fans-i2c-busses.patch :
* 0312-platform-mellanox-mlx-platform-Add-reset-callback.patch :
* 0313-platform-mellanox-mlx-platform-Prepare-driver-to-all.patch :
* 0314-platform-mellanox-mlx-platform-Introduce-ACPI-init-f.patch :
* 0315-platform-mellanox-mlx-platform-Get-interrupt-line-th.patch :
* 0316-platform-mellanox-Add-initial-support-for-PCIe-based.patch :

* Revert the manage-config changes

Signed-off-by: Vivek Reddy <[email protected]>

* Modify manage-config script to have error messages be printed out

Changes in adding secure-boot support caused error messages (about
configs not having the expected value) to be suppressed. This makes
debugging such failures harder.

Modify the code to make sure those messages always get printed to
console.

Signed-off-by: Saikrishna Arcot <[email protected]>

* fix the invocation during secure boot

Signed-off-by: Vivek Reddy <[email protected]>

* Revert "Intgerate HW-MGMT 7.0030.1037 Changes"

This reverts commit 9125a63.

* Retain markers for common & amd64 but add a section for arm64

Signed-off-by: Vivek Reddy <[email protected]>

---------

Signed-off-by: Vivek Reddy <[email protected]>
Signed-off-by: Saikrishna Arcot <[email protected]>
Co-authored-by: Saikrishna Arcot <[email protected]>
  • Loading branch information
vivekrnv and saiarcot895 authored Oct 10, 2023
1 parent d5232ab commit fee7d7e
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 27 deletions.
22 changes: 9 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -77,19 +77,15 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
fi
fi

if [ -f "$(NON_UP_DIR)/series.patch" ]; then
echo "Patch the series file"
cat $(NON_UP_DIR)/series.patch
pushd patch
# clear any unstaged changes
git stash -- series
git apply $(NON_UP_DIR)/series.patch
popd

if [ -d "$(NON_UP_DIR)/patches" ]; then
echo "Copy the non upstream patches"
cp $(NON_UP_DIR)/patches/*.patch patch/
fi
if [ -f "$(NON_UP_DIR)/external-changes.patch" ]; then
cat $(NON_UP_DIR)/external-changes.patch
git stash -- patch/
git apply $(NON_UP_DIR)/external-changes.patch
fi

if [ -d "$(NON_UP_DIR)/patches" ]; then
echo "Copy the non upstream patches"
cp $(NON_UP_DIR)/patches/*.patch patch/
fi

# Obtaining the Debian kernel source
Expand Down
13 changes: 7 additions & 6 deletions manage-config
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ function process_inclusion_exclusion_files(){

# Process any exclusions in the kernel
if [ -f ${exclusion_file} ]; then
exclusion_opts=$(get_section_opts ${exclusion_file} "common" ${ARCH} ${PLATFORM})
exclusion_opts=$(get_section_opts ${exclusion_file} "common" ${ARCH} ${PLATFORM} ${PLATFORM}-${ARCH})
while read -r opt; do
if [ ! -z "$opt" ] && [[ ! "$opt" =~ ^#.* ]]; then
scripts/config --file ${CONFIG_FILE} -d $opt
Expand All @@ -85,7 +85,7 @@ function process_inclusion_exclusion_files(){

# Process any inclusions in the kernel
if [ -f ${inclusion_file} ]; then
inclusion_opts=$(get_section_opts ${inclusion_file} "common" ${ARCH} ${PLATFORM})
inclusion_opts=$(get_section_opts ${inclusion_file} "common" ${ARCH} ${PLATFORM} ${PLATFORM}-${ARCH})
while read -r opt; do
if [ ! -z "$opt" ] && [[ ! "$opt" =~ ^#.* ]]; then
n=${opt%=*}
Expand Down Expand Up @@ -133,7 +133,7 @@ function process_inclusion_exclusion_files(){
fi
fi
done <<< ${inclusion_opts};
if [ ! $ret = 2 ]; then
if [ $ret = 0 ]; then
echo "No error"
fi
fi
Expand All @@ -158,8 +158,8 @@ function process_inclusion_exclusion_files(){
exclusion_file="../patch/kconfig-exclusions"
inclusion_file="../patch/kconfig-inclusions"
force_inclusion_file="../patch/kconfig-force-inclusions"
ret_process_inc_ex=0
ret_process_inc_ex=$(process_inclusion_exclusion_files > /dev/null; echo $?)
process_inclusion_exclusion_files
ret_process_inc_ex=$?

# Secure Boot support
if [ $ret_process_inc_ex -eq 0 ]; then
Expand All @@ -179,7 +179,8 @@ if [ $ret_process_inc_ex -eq 0 ]; then
# save the new pub key in kernel
sed -i "s|^CONFIG_SYSTEM_TRUSTED_KEYS=.*|CONFIG_SYSTEM_TRUSTED_KEYS=\"$SECURE_UPGRADE_SIGNING_CERT\"|g" ${inclusion_file}

ret_process_inc_ex=$(process_inclusion_exclusion_files > /dev/null; echo $?)
process_inclusion_exclusion_files
ret_process_inc_ex=$?
echo "Secure Boot kernel configuration done."
else
echo "no Secure Boot Kernel configuration required."
Expand Down
6 changes: 6 additions & 0 deletions patch/kconfig-exclusions
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,15 @@ CONFIG_CGROUP_NET_CLASSID
CONFIG_NET_CLS_CGROUP
CONFIG_NETFILTER_XT_MATCH_CGROUP
CONFIG_CGROUP_NET_PRIO
###-> mellanox_common-start
###-> mellanox_common-end

[amd64]
# Unset X86_PAT according to Broadcom's requirement
CONFIG_X86_PAT
CONFIG_MLXSW_PCI
###-> mellanox_amd64-start
###-> mellanox_amd64-end

[arm64]
CONFIG_SQUASHFS_DECOMP_MULTI_PERCPU
Expand Down Expand Up @@ -51,3 +55,5 @@ CONFIG_EFI
CONFIG_LOCK_DOWN_KERNEL
CONFIG_SECONDARY_TRUSTED_KEYRING
CONFIG_SYSTEM_BLACKLIST_KEYRING

[mellanox-arm64]
14 changes: 6 additions & 8 deletions patch/kconfig-inclusions
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
# Description: Add kconfig options that has to be included in the kernel
# Note: Markers should start with "###->"
# Header should end with .*-start eg: any_description-start
# Footer must end with .*-end eg: any_description-end
# Markers should not be nested

[common]
CONFIG_LOG_BUF_SHIFT=20
###-> mellanox_common-start
###-> mellanox_common-end

[amd64]
# For Arista
Expand Down Expand Up @@ -37,7 +33,7 @@ CONFIG_SENSORS_MAX31790=m
# For optoe
CONFIG_EEPROM_OPTOE=m

###-> mellanox-start
###-> mellanox_amd64-start
CONFIG_OF=y
CONFIG_THERMAL_OF=y
CONFIG_CPU_THERMAL=y
Expand Down Expand Up @@ -138,7 +134,7 @@ CONFIG_I2C_I801=m
CONFIG_PINCTRL=y
CONFIG_PINCTRL_INTEL=y
CONFIG_SPI_PXA2XX=m
###-> mellanox-end
###-> mellanox_amd64-end

# For Cisco 8000
CONFIG_PHYLIB=m
Expand Down Expand Up @@ -230,3 +226,5 @@ CONFIG_I2C_MUX_GPIO=m
[marvell-armhf]
CONFIG_MTD_CMDLINE_PARTS=y
CONFIG_MTD_OF_PARTS=y

[mellanox-arm64]

0 comments on commit fee7d7e

Please sign in to comment.