diff --git a/1000-add-sw_64-support-not-upstream-modified-files.patch b/1000-add-sw_64-support-not-upstream-modified-files.patch new file mode 100644 index 0000000000000000000000000000000000000000..687118fe97dc7d03a5b7170db5227628dc567b09 --- /dev/null +++ b/1000-add-sw_64-support-not-upstream-modified-files.patch @@ -0,0 +1,63 @@ +diff -Naur mstflint-4.10.0.org/common/compatibility.h mstflint-4.10.0.sw/common/compatibility.h +--- mstflint-4.10.0.org/common/compatibility.h 2022-05-27 11:07:58.390000000 +0000 ++++ mstflint-4.10.0.sw/common/compatibility.h 2022-05-27 11:20:13.920000000 +0000 +@@ -40,7 +40,7 @@ + + #include + +-#if defined(__ia64__) || defined(__x86_64__) || defined(__PPC64__) || defined(__arm__) ++#if defined(__ia64__) || defined(__x86_64__) || defined(__PPC64__) || defined(__arm__) || defined(__sw_64__) + #define U64L "l" + #else + #define U64L "ll" +@@ -63,6 +63,8 @@ + # define ARCH_arm64 + # elif defined(__arm__) + # define ARCH_arm6l ++# elif defined(__sw_64__) ++# define ARCH_sw_64 + # else + # error Unknown CPU architecture using the linux OS + # endif +@@ -109,7 +111,7 @@ + # define U48H_FMT "0x%012llx" + # define U64D_FMT_GEN "llu" + # endif +-#elif defined(ARCH_ia64) || defined(ARCH_x86_64) || defined(ARCH_ppc64) || defined(ARCH_arm64) ++#elif defined(ARCH_ia64) || defined(ARCH_x86_64) || defined(ARCH_ppc64) || defined(ARCH_arm64) || defined(ARCH_sw_64) + # define U64D_FMT "%lu" + # define U64H_FMT "0x%016lx" + # define U48H_FMT "0x%012lx" +diff -Naur mstflint-4.10.0.org/mtcr_ul/packets_common.h mstflint-4.10.0.sw/mtcr_ul/packets_common.h +--- mstflint-4.10.0.org/mtcr_ul/packets_common.h 2022-05-27 11:07:58.400000000 +0000 ++++ mstflint-4.10.0.sw/mtcr_ul/packets_common.h 2022-05-27 11:10:09.880000000 +0000 +@@ -152,6 +152,8 @@ + # define ARCH_arm64 + # elif defined(__arm__) + # define ARCH_arm6l ++# elif defined(__sw_64__) ++# define ARCH_sw_64 + # else + # error Unknown CPU architecture using the linux OS + # endif +diff -Naur mstflint-4.10.0.org/tools_layouts/adb_to_c_utils.h mstflint-4.10.0.sw/tools_layouts/adb_to_c_utils.h +--- mstflint-4.10.0.org/tools_layouts/adb_to_c_utils.h 2022-05-27 11:07:58.500000000 +0000 ++++ mstflint-4.10.0.sw/tools_layouts/adb_to_c_utils.h 2022-05-27 11:09:31.900000000 +0000 +@@ -137,6 +137,8 @@ + # define ARCH_arm64 + # elif defined(__arm__) + # define ARCH_arm6l ++# elif defined(__sw_64__) ++# define ARCH_sw_64 + # else + # error Unknown CPU architecture using the linux OS + # endif +@@ -180,7 +182,7 @@ + # define U64H_FMT "0x%016llx" + # define U48H_FMT "0x%012llx" + # endif +-#elif defined (ARCH_ia64) || defined(ARCH_x86_64) || defined(ARCH_ppc64) || defined(ARCH_arm64) ++#elif defined (ARCH_ia64) || defined(ARCH_x86_64) || defined(ARCH_ppc64) || defined(ARCH_arm64) || defined(ARCH_sw_64) + # define U64D_FMT "%lu" + # define U64H_FMT "0x%016lx" + # define U48H_FMT "0x%012lx" diff --git a/1001-add-loongarch64-support-not-upstream-modified-files.patch b/1001-add-loongarch64-support-not-upstream-modified-files.patch new file mode 100644 index 0000000000000000000000000000000000000000..d488ed28d77b418e2015eb5b10056b3cbcd744f6 --- /dev/null +++ b/1001-add-loongarch64-support-not-upstream-modified-files.patch @@ -0,0 +1,72 @@ +diff -Naur aa/common/compatibility.h bb/common/compatibility.h +--- aa/common/compatibility.h 2023-01-04 10:30:00.957104162 +0800 ++++ bb/common/compatibility.h 2023-01-04 10:33:48.736423701 +0800 +@@ -40,7 +40,7 @@ + + #include + +-#if defined(__ia64__) || defined(__x86_64__) || defined(__PPC64__) || defined(__arm__) || defined(__sw_64__) ++#if defined(__ia64__) || defined(__x86_64__) || defined(__PPC64__) || defined(__arm__) || defined(__sw_64__) || defined(__loongarch__) + #define U64L "l" + #else + #define U64L "ll" +@@ -65,6 +65,8 @@ + # define ARCH_arm6l + # elif defined(__sw_64__) + # define ARCH_sw_64 ++# elif defined(__loongarch__) ++# define ARCH_loongarch + # else + # error Unknown CPU architecture using the linux OS + # endif +@@ -111,7 +113,7 @@ + # define U48H_FMT "0x%012llx" + # define U64D_FMT_GEN "llu" + # endif +-#elif defined(ARCH_ia64) || defined(ARCH_x86_64) || defined(ARCH_ppc64) || defined(ARCH_arm64) || defined(ARCH_sw_64) ++#elif defined(ARCH_ia64) || defined(ARCH_x86_64) || defined(ARCH_ppc64) || defined(ARCH_arm64) || defined(ARCH_sw_64) || defined(ARCH_loongarch) + # define U64D_FMT "%lu" + # define U64H_FMT "0x%016lx" + # define U48H_FMT "0x%012lx" +diff -Naur aa/mtcr_ul/packets_common.h bb/mtcr_ul/packets_common.h +--- aa/mtcr_ul/packets_common.h 2023-01-04 10:30:00.961104220 +0800 ++++ bb/mtcr_ul/packets_common.h 2023-01-04 10:37:32.375682905 +0800 +@@ -154,6 +154,8 @@ + # define ARCH_arm6l + # elif defined(__sw_64__) + # define ARCH_sw_64 ++# elif defined(__loongarch__) ++# define ARCH_loongarch + # else + # error Unknown CPU architecture using the linux OS + # endif +@@ -175,7 +177,7 @@ + # define U8H_FMT "0x%02x" + # define U32D_FMT "%u" + # define STR_FMT "%s" +- #elif defined(ARCH_x86) || defined(ARCH_ppc) || defined(__MINGW32__) || defined(UEFI_BUILD) || defined(ARCH_arm6l) ++ #elif defined(ARCH_x86) || defined(ARCH_ppc) || defined(__MINGW32__) || defined(UEFI_BUILD) || defined(ARCH_arm6l) || defined(ARCH_loongarch) + # define U64H_FMT "0x%016llx" + # define U64D_FMT "%llu" + # define U32H_FMT "0x%08x" +diff -Naur aa/tools_layouts/adb_to_c_utils.h bb/tools_layouts/adb_to_c_utils.h +--- aa/tools_layouts/adb_to_c_utils.h 2023-01-04 10:30:00.969104337 +0800 ++++ bb/tools_layouts/adb_to_c_utils.h 2023-01-04 10:38:21.364396841 +0800 +@@ -139,6 +139,8 @@ + # define ARCH_arm6l + # elif defined(__sw_64__) + # define ARCH_sw_64 ++# elif defined(__loongarch__) ++# define ARCH_loongarch + # else + # error Unknown CPU architecture using the linux OS + # endif +@@ -182,7 +184,7 @@ + # define U64H_FMT "0x%016llx" + # define U48H_FMT "0x%012llx" + # endif +-#elif defined (ARCH_ia64) || defined(ARCH_x86_64) || defined(ARCH_ppc64) || defined(ARCH_arm64) || defined(ARCH_sw_64) ++#elif defined (ARCH_ia64) || defined(ARCH_x86_64) || defined(ARCH_ppc64) || defined(ARCH_arm64) || defined(ARCH_sw_64) || defined(ARCH_loongarch) + # define U64D_FMT "%lu" + # define U64H_FMT "0x%016lx" + # define U48H_FMT "0x%012lx" diff --git a/mstflint.spec b/mstflint.spec index d4556a109197993eb2e6316d63f9a24365b53868..b303bef79e2d9784f134f4ec5feb50159e59b882 100644 --- a/mstflint.spec +++ b/mstflint.spec @@ -1,7 +1,7 @@ Name: mstflint Summary: Firmware Burning and Diagnostics Tools Version: 4.10.0 -Release: 13 +Release: 14 License: GPLv2+ or BSD Url: https://github.com/Mellanox/mstflint Source: https://github.com/Mellanox/%{name}/releases/download/v4.10.0-1/%{name}-%{version}.tar.gz @@ -12,6 +12,9 @@ Patch0003: backport-0001-Title-Fix-error-while-burning-mcc-enabled.patch Patch0004: backport-0001-Title-Fix-errors-found-with-checkpatch-script.patch Patch0005: 0005-Allow-building-on-riscv64.patch +Patch1000: 1000-add-sw_64-support-not-upstream-modified-files.patch +Patch1001: 1001-add-loongarch64-support-not-upstream-modified-files.patch + BuildRequires: libstdc++-devel zlib-devel rdma-core-devel gcc-c++ gcc BuildRequires: libcurl-devel boost-devel libxml2-devel openssl-devel Obsoletes: openib-mstflint <= 1.4 openib-tvflash <= 0.9.2 tvflash <= 0.9.0 @@ -57,6 +60,9 @@ strip %{buildroot}/%{_libdir}/mstflint/python_tools/*.so %{_mandir}/man1/* %changelog +* Thu Aug 31 2023 panchenbo - 4.10.0-14 +- add sw_64 and loongarch64 support + * Wed Jun 28 2023 lvxiaoqian - 4.10.0-13 - Add riscv64 patch from v4.17