summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVishal Patel <vishal.patel@amd.com>2023-10-20 11:03:18 -0700
committerMark Hatle <mark.hatle@amd.com>2023-10-21 09:29:12 -0500
commit60884254a0d4bdb85d1e8ae457256e93d92d95f0 (patch)
tree86c821416d7b4e18f11502ec4f5be72feaa4ea90
parentb1c18d8556879817faba0f61b58eefc2e2f25919 (diff)
downloadmeta-xilinx-60884254a0d4bdb85d1e8ae457256e93d92d95f0.tar.gz
freeipmi: Update SRCREV
Upstream changelog: Update NEWS Use poll() instead of select() to avoid segfaults with high number of open fd. ipmi-sensors: fix help output typo configure.ac: 'inb' and `outb' may be defined as inline functions (ex. glibc 2.28 on debian buster (amd64)), so check with AC_CHECK_DECL instead of AC_CHECK_FUNCS . Due to `Fix build issue when inb/outb are not available on some systems' in 1.6.9 release, the previously working kcs driver was causing errors. configure.ac: Add define definition for cbrt in math library to config.h.in configure.ac: Add define definitions for exp10, exp2, log2 to config.h.in man/ipmi-oem.8.pre.in: Document support on Supermicro X9DRD Update NEWS man/Makefile.am: Fix make distcheck ipmi-config.8.pre.in: Add pointer to ipmi-config.conf(5) manpage so users know to look there. Update NEWS common/portability/freeipmi-portability.h: Fix portability of cbrt() redefinition. cube root is x^(1/3) not x^-3. doc: document issue with Vadatech VT811 libfreeipmi: add missing xilinx header to dist Update NEWS, version for release Update lib versions for release Update NEWS libipmimonitoring: handle units special case libfreeipmi: fix typo in fiid template field contrib/pet/petalert.pl: Fix output error message typo global: fix various typos in comments / docs man: Fix a bunch of typos doc: fix a number of typos Update NEWS ipmiseld: avoid double free ipmi-fru: fix compilation for non C99 compilation Update NEWS Update ChangeLog Add initial support for Xilinx OEM FRU records libfreeipmi: fix comment typo Update ChangeLog configure.ac: Use AC_USE_SYSTEM_EXTENSIONS instead of appending -D_GNU_SOURCE configure.ac: Fix detecting sighandler_t on glibc configure.ac: Fix -Wimplicit-function-declaration for printf Update ChangeLog add --disable-doc Document issue in Intel M50CYP Update NEWS Update ChangeLog with ipmi-sel date range options ipmi-sel: update manpage for new date format ipmi-sel: make --date-range more granular doc: fix typo in freeipmi-bugs-issues-and-workarounds.txt configure.ac: add extra build help / messages Update NEWS common/portability: fix portability issue on cygwin Signed-off-by: Vishal Patel <vishal.patel@amd.com> Signed-off-by: Mark Hatle <mark.hatle@amd.com>
-rw-r--r--meta-xilinx-core/recipes-support/freeipmi/freeipmi/0001-Add-initial-support-for-Xilinx-OEM-FRU-records.patch370
-rw-r--r--meta-xilinx-core/recipes-support/freeipmi/freeipmi/0002-ipmi-fru-fix-compilation-for-non-C99-compilation.patch29
-rw-r--r--meta-xilinx-core/recipes-support/freeipmi/freeipmi_1.6.10.bb4
3 files changed, 1 insertions, 402 deletions
diff --git a/meta-xilinx-core/recipes-support/freeipmi/freeipmi/0001-Add-initial-support-for-Xilinx-OEM-FRU-records.patch b/meta-xilinx-core/recipes-support/freeipmi/freeipmi/0001-Add-initial-support-for-Xilinx-OEM-FRU-records.patch
deleted file mode 100644
index c7d4aefd..00000000
--- a/meta-xilinx-core/recipes-support/freeipmi/freeipmi/0001-Add-initial-support-for-Xilinx-OEM-FRU-records.patch
+++ /dev/null
@@ -1,370 +0,0 @@
1From 1128691f6e2709b44eccafb0b303b07da55a814e Mon Sep 17 00:00:00 2001
2From: Christian Kohn <chris.kohn@amd.com>
3Date: Mon, 17 Oct 2022 19:28:22 -0700
4Subject: [PATCH] Add initial support for Xilinx OEM FRU records
5
6The supported Xilinx OEM FRU records are MAC_ID and FREE_FORM. This FRU OEM
7extension parses these records and prints them with proper formatting.
8
9To use this feature, run the ipmi-fru command as follows:
10$ sudo ./ipmi-fru --fru-file=/sys/devices/platform/axi/ff030000.i2c/i2c-1/1-0051/eeprom \
11 --interpret-oem-data
12
13Note: The EEPROM address can vary between different platforms. This is just an
14 example.
15
16This feature has been tested with the Xilinx Kria KV260 and KR260 Starter Kits.
17
18Signed-off-by: Christian Kohn <chris.kohn@amd.com>
19---
20 ipmi-fru/Makefile.am | 2 +
21 ipmi-fru/ipmi-fru-oem-xilinx.c | 171 ++++++++++++++++++
22 ipmi-fru/ipmi-fru-oem-xilinx.h | 33 ++++
23 ipmi-fru/ipmi-fru-output.c | 14 ++
24 libfreeipmi/include/freeipmi/freeipmi.h.in | 1 +
25 .../oem/ipmi-fru-xilinx-oem-record-format.h | 45 +++++
26 .../spec/ipmi-iana-enterprise-numbers-spec.h | 1 +
27 7 files changed, 267 insertions(+)
28 create mode 100644 ipmi-fru/ipmi-fru-oem-xilinx.c
29 create mode 100644 ipmi-fru/ipmi-fru-oem-xilinx.h
30 create mode 100644 libfreeipmi/include/freeipmi/record-format/oem/ipmi-fru-xilinx-oem-record-format.h
31
32diff --git a/ipmi-fru/Makefile.am b/ipmi-fru/Makefile.am
33index c92ba0e8c..c8545eede 100644
34--- a/ipmi-fru/Makefile.am
35+++ b/ipmi-fru/Makefile.am
36@@ -25,6 +25,8 @@ ipmi_fru_SOURCES = \
37 ipmi-fru-argp.h \
38 ipmi-fru-oem-wistron.c \
39 ipmi-fru-oem-wistron.h \
40+ ipmi-fru-oem-xilinx.c \
41+ ipmi-fru-oem-xilinx.h \
42 ipmi-fru-output.c \
43 ipmi-fru-output.h
44
45diff --git a/ipmi-fru/ipmi-fru-oem-xilinx.c b/ipmi-fru/ipmi-fru-oem-xilinx.c
46new file mode 100644
47index 000000000..87bb18f00
48--- /dev/null
49+++ b/ipmi-fru/ipmi-fru-oem-xilinx.c
50@@ -0,0 +1,171 @@
51+/*
52+ * Copyright (C) 2022, Advanced Micro Devices, Inc.
53+ *
54+ * This program is free software: you can redistribute it and/or modify
55+ * it under the terms of the GNU General Public License as published by
56+ * the Free Software Foundation, either version 3 of the License, or
57+ * (at your option) any later version.
58+ *
59+ * This program is distributed in the hope that it will be useful,
60+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
61+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
62+ * GNU General Public License for more details.
63+ *
64+ * You should have received a copy of the GNU General Public License
65+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
66+ *
67+ */
68+
69+#if HAVE_CONFIG_H
70+#include "config.h"
71+#endif /* HAVE_CONFIG_H */
72+
73+#include <stdio.h>
74+#include <stdlib.h>
75+#if STDC_HEADERS
76+#include <string.h>
77+#endif /* STDC_HEADERS */
78+#include <assert.h>
79+
80+#include <freeipmi/freeipmi.h>
81+
82+#include "ipmi-fru_.h"
83+#include "ipmi-fru-oem-xilinx.h"
84+
85+#include "freeipmi-portability.h"
86+
87+static char *
88+_version_str (uint8_t version)
89+{
90+ switch (version)
91+ {
92+ case IPMI_FRU_OEM_XILINX_MAC_ID_VERSION_BOARD:
93+ return "Board";
94+ case IPMI_FRU_OEM_XILINX_MAC_ID_VERSION_SYSCTL:
95+ return "System Controller";
96+ case IPMI_FRU_OEM_XILINX_MAC_ID_VERSION_MODULE:
97+ return "Module";
98+ case IPMI_FRU_OEM_XILINX_MAC_ID_VERSION_DUT_MAC:
99+ return "DUT - MAC";
100+ case IPMI_FRU_OEM_XILINX_MAC_ID_VERSION_DUT_ETHERCAT:
101+ return "DUT - EtherCAT";
102+ default:
103+ return "";
104+ }
105+
106+ return (NULL); /* NOT REACHED */
107+}
108+
109+int
110+ipmi_fru_oem_xilinx_oem_record (ipmi_fru_state_data_t *state_data,
111+ uint8_t record_type_id,
112+ uint32_t manufacturer_id,
113+ uint8_t *oem_data,
114+ unsigned int oem_data_len)
115+{
116+ assert (state_data);
117+ assert (manufacturer_id == IPMI_IANA_ENTERPRISE_ID_XILINX);
118+ assert (oem_data);
119+
120+ /* The MAC_ID record type ID is 0xD2. The MAC ID record consists of a 1 byte
121+ * version ID followed by one or more 6-byte MAC addresses. If the MAC ID
122+ * version is set to "DUT - EtherCAT", a 4-byte EtherCAT ID is used instead of
123+ * a 6-byte MAC address.
124+ */
125+ if (record_type_id == IPMI_FRU_OEM_XILINX_MAC_ID && oem_data_len)
126+ {
127+ uint8_t version = oem_data[0];
128+ unsigned int len = oem_data_len - 1;
129+
130+ pstdout_printf (state_data->pstate,
131+ " FRU OEM MAC Version: %s (%xh)\n",
132+ _version_str(version),
133+ version);
134+
135+ /* The MAC_ID record can hold multiple MAC addresses that are 6 bytes long
136+ * each if version is set to 0x31.
137+ */
138+ if ((version == IPMI_FRU_OEM_XILINX_MAC_ID_VERSION_BOARD ||
139+ version == IPMI_FRU_OEM_XILINX_MAC_ID_VERSION_SYSCTL ||
140+ version == IPMI_FRU_OEM_XILINX_MAC_ID_VERSION_MODULE ||
141+ version == IPMI_FRU_OEM_XILINX_MAC_ID_VERSION_DUT_MAC ) &&
142+ (len % 6) == 0)
143+ {
144+ unsigned int i, j, start, stop;
145+ unsigned int mac_cnt = len / 6;
146+
147+ for (j = 0; j < mac_cnt; j++)
148+ {
149+ pstdout_printf (state_data->pstate, " FRU OEM MAC ID %d: ", j);
150+
151+ start = j*6 + 1;
152+ stop = start + 5;
153+
154+ for (i = start; i < stop; i++)
155+ {
156+ pstdout_printf (state_data->pstate, "%02x:", oem_data[i]);
157+ }
158+
159+ pstdout_printf (state_data->pstate, "%02x\n", oem_data[i]);
160+ }
161+
162+ return (1);
163+ }
164+
165+ /* The MAC_ID record holds one EtherCAT ID that is 4 bytes long if version
166+ * is set to 0x32. The assigned EtherCAT ID for Xilinx is 0x0000056F.
167+ */
168+ if (version == IPMI_FRU_OEM_XILINX_MAC_ID_VERSION_DUT_ETHERCAT &&
169+ len == 4)
170+ {
171+ pstdout_printf (state_data->pstate, " FRU OEM EtherCAT ID: 0x");
172+
173+ for (unsigned int i = 1; i < len+1; i++)
174+ {
175+ pstdout_printf (state_data->pstate, "%02X", oem_data[i]);
176+ }
177+
178+ pstdout_printf (state_data->pstate, "\n");
179+
180+ return (1);
181+ }
182+ }
183+
184+ /* The free form data record type ID is 0xD3. It consists of one or more
185+ * fields where each field is split into N byte identifier and M byte data
186+ * followed by a 0x00 end of field delimiter. The below code parses the free
187+ * form record and prints each field on a new line prefixed with 'FRU OEM '.
188+ */
189+ if (record_type_id == IPMI_FRU_OEM_XILINX_FREE_FORM && oem_data_len)
190+ {
191+ unsigned int i;
192+ unsigned int new_field = 1;
193+
194+ for (i = 0; i < oem_data_len; i++)
195+ {
196+ /* 0x00 marks the end of the field */
197+ if (oem_data[i] == 0)
198+ {
199+ if (new_field == 0)
200+ {
201+ pstdout_printf (state_data->pstate, "\n");
202+ }
203+ new_field = 1;
204+ continue;
205+ }
206+
207+ /* Start of a new field */
208+ if (new_field == 1)
209+ {
210+ new_field = 0;
211+ pstdout_printf (state_data->pstate, " FRU OEM ");
212+ }
213+
214+ pstdout_printf (state_data->pstate, "%c", oem_data[i]);
215+ }
216+
217+ return (1);
218+ }
219+
220+ return (0);
221+}
222diff --git a/ipmi-fru/ipmi-fru-oem-xilinx.h b/ipmi-fru/ipmi-fru-oem-xilinx.h
223new file mode 100644
224index 000000000..2484cd515
225--- /dev/null
226+++ b/ipmi-fru/ipmi-fru-oem-xilinx.h
227@@ -0,0 +1,33 @@
228+/*
229+ * Copyright (C) 2022, Advanced Micro Devices, Inc.
230+ *
231+ * This program is free software: you can redistribute it and/or modify
232+ * it under the terms of the GNU General Public License as published by
233+ * the Free Software Foundation, either version 3 of the License, or
234+ * (at your option) any later version.
235+ *
236+ * This program is distributed in the hope that it will be useful,
237+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
238+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
239+ * GNU General Public License for more details.
240+ *
241+ * You should have received a copy of the GNU General Public License
242+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
243+ *
244+ */
245+
246+#ifndef IPMI_FRU_OEM_XILINX_H
247+#define IPMI_FRU_OEM_XILINX_H
248+
249+#include <freeipmi/freeipmi.h>
250+
251+#include "ipmi-fru_.h"
252+
253+/* Returns 1 on interpretation, 0 if not, -1 on error */
254+int ipmi_fru_oem_xilinx_oem_record (ipmi_fru_state_data_t *state_data,
255+ uint8_t record_type_id,
256+ uint32_t manufacturer_id,
257+ uint8_t *oem_data,
258+ unsigned int oem_data_len);
259+
260+#endif /* IPMI_FRU_OEM_XILINX_H */
261diff --git a/ipmi-fru/ipmi-fru-output.c b/ipmi-fru/ipmi-fru-output.c
262index 845971018..d29c4470e 100644
263--- a/ipmi-fru/ipmi-fru-output.c
264+++ b/ipmi-fru/ipmi-fru-output.c
265@@ -51,6 +51,7 @@
266 #include "ipmi-fru_.h"
267 #include "ipmi-fru-output.h"
268 #include "ipmi-fru-oem-wistron.h"
269+#include "ipmi-fru-oem-xilinx.h"
270 #include "tool-util-common.h"
271
272 #include "freeipmi-portability.h"
273@@ -1201,6 +1202,19 @@ ipmi_fru_output_oem_record (ipmi_fru_state_data_t *state_data,
274 if (ret)
275 return (0);
276 }
277+
278+ if (manufacturer_id == IPMI_IANA_ENTERPRISE_ID_XILINX)
279+ {
280+ if ((ret = ipmi_fru_oem_xilinx_oem_record (state_data,
281+ record_type_id,
282+ manufacturer_id,
283+ oem_data,
284+ oem_data_len)) < 0)
285+ return (-1);
286+
287+ if (ret)
288+ return (0);
289+ }
290 }
291
292 if (oem_data_len)
293diff --git a/libfreeipmi/include/freeipmi/freeipmi.h.in b/libfreeipmi/include/freeipmi/freeipmi.h.in
294index a03178e97..fbd6749e9 100644
295--- a/libfreeipmi/include/freeipmi/freeipmi.h.in
296+++ b/libfreeipmi/include/freeipmi/freeipmi.h.in
297@@ -82,6 +82,7 @@ extern "C" {
298 #include <freeipmi/record-format/ipmi-sdr-record-format.h>
299 #include <freeipmi/record-format/ipmi-sel-record-format.h>
300 #include <freeipmi/record-format/oem/ipmi-fru-wistron-oem-record-format.h>
301+#include <freeipmi/record-format/oem/ipmi-fru-xilinx-oem-record-format.h>
302 #include <freeipmi/record-format/oem/ipmi-sdr-oem-intel-node-manager-record-format.h>
303 #include <freeipmi/record-format/oem/ipmi-sdr-oem-intel-record-format.h>
304 #include <freeipmi/record-format/oem/ipmi-sel-oem-intel-record-format.h>
305diff --git a/libfreeipmi/include/freeipmi/record-format/oem/ipmi-fru-xilinx-oem-record-format.h b/libfreeipmi/include/freeipmi/record-format/oem/ipmi-fru-xilinx-oem-record-format.h
306new file mode 100644
307index 000000000..434e2031a
308--- /dev/null
309+++ b/libfreeipmi/include/freeipmi/record-format/oem/ipmi-fru-xilinx-oem-record-format.h
310@@ -0,0 +1,45 @@
311+/*
312+ * Copyright (C) 2022, Advanced Micro Devices, Inc.
313+ *
314+ * This program is free software: you can redistribute it and/or modify
315+ * it under the terms of the GNU General Public License as published by
316+ * the Free Software Foundation, either version 3 of the License, or
317+ * (at your option) any later version.
318+ *
319+ * This program is distributed in the hope that it will be useful,
320+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
321+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
322+ * GNU General Public License for more details.
323+ *
324+ * You should have received a copy of the GNU General Public License
325+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
326+ *
327+ */
328+
329+#ifndef IPMI_FRU_OEM_XILINX_RECORD_FORMAT_H
330+#define IPMI_FRU_OEM_XILINX_RECORD_FORMAT_H
331+
332+#ifdef __cplusplus
333+extern "C" {
334+#endif
335+
336+#include <freeipmi/fiid/fiid.h>
337+
338+/* OEM multi-record IDs used by Xilinx */
339+#define IPMI_FRU_OEM_XILINX_THERMAL 0xD0
340+#define IPMI_FRU_OEM_XILINX_POWER 0xD1
341+#define IPMI_FRU_OEM_XILINX_MAC_ID 0xD2
342+#define IPMI_FRU_OEM_XILINX_FREE_FORM 0xD3
343+
344+/* OEM MAC ID versions used by Xilinx */
345+#define IPMI_FRU_OEM_XILINX_MAC_ID_VERSION_BOARD 0x01
346+#define IPMI_FRU_OEM_XILINX_MAC_ID_VERSION_SYSCTL 0x11
347+#define IPMI_FRU_OEM_XILINX_MAC_ID_VERSION_MODULE 0x21
348+#define IPMI_FRU_OEM_XILINX_MAC_ID_VERSION_DUT_MAC 0x31
349+#define IPMI_FRU_OEM_XILINX_MAC_ID_VERSION_DUT_ETHERCAT 0x32
350+
351+#ifdef __cplusplus
352+}
353+#endif
354+
355+#endif /* IPMI_FRU_OEM_XILINX_RECORD_FORMAT_H */
356diff --git a/libfreeipmi/include/freeipmi/spec/ipmi-iana-enterprise-numbers-spec.h b/libfreeipmi/include/freeipmi/spec/ipmi-iana-enterprise-numbers-spec.h
357index d286f33a4..4c24b5259 100644
358--- a/libfreeipmi/include/freeipmi/spec/ipmi-iana-enterprise-numbers-spec.h
359+++ b/libfreeipmi/include/freeipmi/spec/ipmi-iana-enterprise-numbers-spec.h
360@@ -29,6 +29,7 @@ extern "C" {
361 #define IPMI_IANA_ENTERPRISE_ID_SUN_MICROSYSTEMS 42
362 #define IPMI_IANA_ENTERPRISE_ID_INTEL 343
363 #define IPMI_IANA_ENTERPRISE_ID_DELL 674
364+#define IPMI_IANA_ENTERPRISE_ID_XILINX 4314
365 #define IPMI_IANA_ENTERPRISE_ID_MAGNUM_TECHNOLOGIES 5593
366 #define IPMI_IANA_ENTERPRISE_ID_QUANTA 7244
367 #define IPMI_IANA_ENTERPRISE_ID_FUJITSU 10368
368--
3692.17.1
370
diff --git a/meta-xilinx-core/recipes-support/freeipmi/freeipmi/0002-ipmi-fru-fix-compilation-for-non-C99-compilation.patch b/meta-xilinx-core/recipes-support/freeipmi/freeipmi/0002-ipmi-fru-fix-compilation-for-non-C99-compilation.patch
deleted file mode 100644
index c0f36405..00000000
--- a/meta-xilinx-core/recipes-support/freeipmi/freeipmi/0002-ipmi-fru-fix-compilation-for-non-C99-compilation.patch
+++ /dev/null
@@ -1,29 +0,0 @@
1From c578c999b7d9aabbd6e54b0310a609b8f96ae962 Mon Sep 17 00:00:00 2001
2From: Albert Chu <chu11@llnl.gov>
3Date: Tue, 8 Nov 2022 16:33:39 -0800
4Subject: [PATCH] ipmi-fru: fix compilation for non C99 compilation
5
6---
7 ipmi-fru/ipmi-fru-oem-xilinx.c | 4 +++-
8 1 file changed, 3 insertions(+), 1 deletion(-)
9
10diff --git a/ipmi-fru/ipmi-fru-oem-xilinx.c b/ipmi-fru/ipmi-fru-oem-xilinx.c
11index 87bb18f00..937aa7614 100644
12--- a/ipmi-fru/ipmi-fru-oem-xilinx.c
13+++ b/ipmi-fru/ipmi-fru-oem-xilinx.c
14@@ -118,9 +118,11 @@ ipmi_fru_oem_xilinx_oem_record (ipmi_fru_state_data_t *state_data,
15 if (version == IPMI_FRU_OEM_XILINX_MAC_ID_VERSION_DUT_ETHERCAT &&
16 len == 4)
17 {
18+ unsigned int i;
19+
20 pstdout_printf (state_data->pstate, " FRU OEM EtherCAT ID: 0x");
21
22- for (unsigned int i = 1; i < len+1; i++)
23+ for (i = 1; i < len+1; i++)
24 {
25 pstdout_printf (state_data->pstate, "%02X", oem_data[i]);
26 }
27--
282.17.1
29
diff --git a/meta-xilinx-core/recipes-support/freeipmi/freeipmi_1.6.10.bb b/meta-xilinx-core/recipes-support/freeipmi/freeipmi_1.6.10.bb
index a9d60465..7beb0f5e 100644
--- a/meta-xilinx-core/recipes-support/freeipmi/freeipmi_1.6.10.bb
+++ b/meta-xilinx-core/recipes-support/freeipmi/freeipmi_1.6.10.bb
@@ -31,10 +31,8 @@ LIC_FILES_CHKSUM = " \
31BRANCH ?= "freeipmi-1-6-0-stable" 31BRANCH ?= "freeipmi-1-6-0-stable"
32SRC_URI = " \ 32SRC_URI = " \
33 git://git.savannah.gnu.org/freeipmi.git;iprotocol=https;branch=${BRANCH} \ 33 git://git.savannah.gnu.org/freeipmi.git;iprotocol=https;branch=${BRANCH} \
34 file://0001-Add-initial-support-for-Xilinx-OEM-FRU-records.patch \
35 file://0002-ipmi-fru-fix-compilation-for-non-C99-compilation.patch \
36 " 34 "
37SRCREV ?= "1f7eea294c2967802019100b07cf1e44b3160a2b" 35SRCREV ?= "816a69eb15a9034351381211d9cd15de81da10c7"
38 36
39S = "${WORKDIR}/git" 37S = "${WORKDIR}/git"
40 38