diff --git a/libraries/CMakeLists.txt b/libraries/CMakeLists.txt index f3c5ba25fb26..13c94a94dce3 100644 --- a/libraries/CMakeLists.txt +++ b/libraries/CMakeLists.txt @@ -75,4 +75,5 @@ opae_add_subdirectory(libboard/board_d5005) opae_add_subdirectory(libboard/board_n6000) opae_add_subdirectory(libboard/board_n5010) opae_add_subdirectory(libboard/board_c6100) +opae_add_subdirectory(libboard/board_jtag_pci_dk) opae_add_subdirectory(libboard/board_cmc) diff --git a/libraries/libboard/board_jtag_pci_dk/CMakeLists.txt b/libraries/libboard/board_jtag_pci_dk/CMakeLists.txt new file mode 100644 index 000000000000..a4ea56f57a9f --- /dev/null +++ b/libraries/libboard/board_jtag_pci_dk/CMakeLists.txt @@ -0,0 +1,40 @@ +## Copyright(c) 2024, Intel Corporation +## +## Redistribution and use in source and binary forms, with or without +## modification, are permitted provided that the following conditions are met: +## +## * Redistributions of source code must retain the above copyright notice, +## this list of conditions and the following disclaimer. +## * Redistributions in binary form must reproduce the above copyright notice, +## this list of conditions and the following disclaimer in the documentation +## and/or other materials provided with the distribution. +## * Neither the name of Intel Corporation nor the names of its contributors +## may be used to endorse or promote products derived from this software +## without specific prior written permission. +## +## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +## AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +## ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +## LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +## CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +## SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +## INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +## CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +## ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +## POSSIBILITY OF SUCH DAMAGE. + +opae_add_module_library(TARGET board_jtag_pci_dk + SOURCE board_jtag_pci_dk.c + LIBS + ${CMAKE_THREAD_LIBS_INIT} + opae-c + opaeuio + board_common + COMPONENT opaeboardlib +) + +target_include_directories(board_jtag_pci_dk + PRIVATE + ${OPAE_LIB_SOURCE}/libboard/board_common +) diff --git a/libraries/libboard/board_jtag_pci_dk/board_jtag_pci_dk.c b/libraries/libboard/board_jtag_pci_dk/board_jtag_pci_dk.c new file mode 100644 index 000000000000..6e414adf3e41 --- /dev/null +++ b/libraries/libboard/board_jtag_pci_dk/board_jtag_pci_dk.c @@ -0,0 +1,76 @@ +// Copyright(c) 2024, Intel Corporation +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// * Neither the name of Intel Corporation nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. + +#ifdef HAVE_CONFIG_H +#include +#endif // HAVE_CONFIG_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "board_jtag_pci_dk.h" +#include "../board_common/board_common.h" + +#define MAC_BUF_LEN 19 + +// print board information +fpga_result print_board_info(fpga_token __attribute__((unused)) token) +{ + fpga_result resval = FPGA_OK; + + return resval; +} + +// print mac information +fpga_result print_mac_info(fpga_token __attribute__((unused)) token) +{ + fpga_result res = FPGA_OK; + + return res; +} + +// print phy group information +fpga_result print_phy_info(fpga_token token) +{ + return print_common_phy_info(token); +} + +// prints fpga boot page info +fpga_result fpga_boot_info(fpga_token token) +{ + return print_common_boot_info(token); +} diff --git a/libraries/libboard/board_jtag_pci_dk/board_jtag_pci_dk.h b/libraries/libboard/board_jtag_pci_dk/board_jtag_pci_dk.h new file mode 100644 index 000000000000..5c7196d434c7 --- /dev/null +++ b/libraries/libboard/board_jtag_pci_dk/board_jtag_pci_dk.h @@ -0,0 +1,74 @@ +// Copyright(c) 2019-2024, Intel Corporation +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// * Neither the name of Intel Corporation nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. + +#ifndef __FPGA_BOARD_JTAG_PCI_DK_H__ +#define __FPGA_BOARD_JTAG_PCI_DK_H__ + +#include + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#define FPGA_VAR_BUF_LEN 256 + + +/** +* Prints BMC, MAX10 and NIOS version. +* +* @param[in] token fpga_token object for device (FPGA_DEVICE type) +* @returns FPGA_OK on success. FPGA_NOT_FOUND if MAX10 or NIOS sysfs not found. +* FPGA_INVALID_PARAM if invalid parameters were provided +* +*/ +fpga_result print_board_info(fpga_token token); + +/** +* Prints mac informantion. +* +* @param[in] token fpga_token object for device (FPGA_DEVICE type) +* @returns FPGA_OK on success. FPGA_NOT_FOUND if mac sysfs not found. +* FPGA_INVALID_PARAM if invalid parameters were provide +* +*/ +fpga_result print_mac_info(fpga_token token); + + +/** +* Prints fpga boot page info. +* +* @param[in] token fpga_token object for device (FPGA_DEVICE type) +* @returns FPGA_OK on success. FPGA_NOT_FOUND if invalid boot info. +* FPGA_INVALID_PARAM if invalid parameters were provided +* +*/ +fpga_result fpga_boot_info(fpga_token token); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __FPGA_BOARD_JTAG_PCI_DK_H__ */ diff --git a/libraries/libopae-c/cfg-file.c b/libraries/libopae-c/cfg-file.c index 9573b855ddee..29a1e4432e38 100644 --- a/libraries/libopae-c/cfg-file.c +++ b/libraries/libopae-c/cfg-file.c @@ -293,6 +293,13 @@ STATIC libopae_config_data default_libopae_config_table[] = { { 0x8086, 0xbccf, 0x8086, 0x0000, "libopae-u.so", "{}", 0 }, // OFS + { 0x8086, 0xbcce, 0x8086, 0x0001, "libxfpga.so", "{}", 0 }, // OFS + { 0x8086, 0xbcce, 0x8086, 0x0001, "libopae-v.so", "{}", 0 }, // OFS + { 0x8086, 0xbccf, 0x8086, 0x0001, "libopae-v.so", "{}", 0 }, // OFS + { 0x8086, 0xbcce, 0x8086, 0x0001, "libopae-u.so", "{}", 0 }, // OFS + { 0x8086, 0xbccf, 0x8086, 0x0001, "libopae-u.so", "{}", 0 }, // OFS + + { 0x8086, 0xbcce, 0x8086, 0x1770, "libxfpga.so", "{}", 0 }, // N6000 { 0x8086, 0xbcce, 0x8086, 0x1770, "libopae-v.so", "{}", 0 }, // N6000 { 0x8086, 0xbccf, 0x8086, 0x1770, "libopae-v.so", "{}", 0 }, // N6000 @@ -438,9 +445,16 @@ STATIC fpgainfo_config_data default_fpgainfo_config_table[] = { { 0x8086, 0xbcce, 0x8086, 0x17d4, 0x12, "libboard_c6100.so", NULL, "Intel IPU Platform F2000X-PL" }, - { 0x8086, 0x0ddb, 0x8086, 0x0, 0x23, "libboard_cmc.so", NULL, + + { 0x8086, 0x0ddb, 0x8086, 0x0, 0x23, "libboard_cmc.so", NULL, "Intel Acceleration Development Platform CMC" }, + { 0x8086, 0xbcce, 0x8086, 0x0001, 0x0, "libboard_jtag_pci_dk.so", NULL, + "Intel Acceleration Development Platform 0001" }, + + { 0x8086, 0xbccf, 0x8086, 0x0001, 0x0, "libboard_jtag_pci_dk.so", NULL, + "Intel Acceleration Development Platform 0001" }, + { 0, 0, 0, 0, -1, NULL, NULL, "" } }; diff --git a/opae.cfg b/opae.cfg index 4d75a49e68d8..b9fc3ecfdc75 100644 --- a/opae.cfg +++ b/opae.cfg @@ -575,6 +575,86 @@ } }, + "0000": { + "enabled": true, + "platform": "Intel Acceleration JTAG PCI Development Kit", + + "devices": [ + { "name": "0000_pf", "id": [ "0x8086", "0xbcce", "0x8086", "0x0001" ] }, + { "name": "0000_vf", "id": [ "0x8086", "0xbccf", "0x8086", "0x0001" ] } + ], + + "opae": { + "plugin": [ + { + "enabled": true, + "module": "libxfpga.so", + "devices": [ "0000_pf" ], + "configuration": {} + }, + { + "enabled": true, + "module": "libopae-v.so", + "devices": [ "0000_pf", "0000_vf" ], + "configuration": {} + }, + { + "enabled": true, + "module": "libopae-u.so", + "devices": [ "0000_pf", "0000_vf" ], + "configuration": {} + } + ], + "fpgainfo": [ + { + "enabled": true, + "module": "libboard_0001.so", + "devices": [ + { "device": "0000_pf", "feature_id": "*" }, + { "device": "0000_vf", "feature_id": "*" } + ] + } + ], + "fpgad": [ + { + "enabled": true, + "module": "libfpgad-vc.so", + "devices": [ "0000_pf" ], + "configuration": { + "cool-down": 30, + "get-aer": [ "setpci -s %s ECAP_AER+0x08.L", + "setpci -s %s ECAP_AER+0x14.L" ], + "disable-aer": [ "setpci -s %s ECAP_AER+0x08.L=0xffffffff", + "setpci -s %s ECAP_AER+0x14.L=0xffffffff" ], + "set-aer": [ "setpci -s %s ECAP_AER+0x08.L=0x%08x", + "setpci -s %s ECAP_AER+0x14.L=0x%08x" ], + "sensor-overrides": [], + "monitor-seu": false + } + } + ], + "rsu": [ + { + "enabled": true, + "devices": [ "0000_pf" ], + "fpga_default_sequences": "common_rsu_sequences" + } + ], + "fpgareg": [ + { + "enabled": true, + "devices": [ "0000_pf", "0000_vf" ] + } + ], + "opae.io": [ + { + "enabled": true, + "devices": [ "0000_pf", "0000_vf" ] + } + ] + } + }, + "c6100": { "enabled": true, "platform": "Intel IPU Platform F2000X-PL", diff --git a/opae.spec.fedora b/opae.spec.fedora index c3228be1ce39..4e4e0be3c119 100644 --- a/opae.spec.fedora +++ b/opae.spec.fedora @@ -222,6 +222,7 @@ done %{_libdir}/opae/libboard_d5005.so %{_libdir}/opae/libboard_n5010.so %{_libdir}/opae/libboard_n6000.so +%{_libdir}/opae/libboard_jtag_pci_dk.so %{_libdir}/opae/libboard_c6100.so %{_libdir}/opae/libboard_cmc.so diff --git a/opae.spec.in b/opae.spec.in index 4d729ab2bb70..e81cdc6475d9 100644 --- a/opae.spec.in +++ b/opae.spec.in @@ -189,6 +189,7 @@ ldconfig @CMAKE_INSTALL_PREFIX@/@OPAE_LIB_INSTALL_DIR@/opae/libboard_n5010.so* @CMAKE_INSTALL_PREFIX@/@OPAE_LIB_INSTALL_DIR@/opae/libboard_a10gx.so* @CMAKE_INSTALL_PREFIX@/@OPAE_LIB_INSTALL_DIR@/opae/libboard_n6000.so* +@CMAKE_INSTALL_PREFIX@/@OPAE_LIB_INSTALL_DIR@/opae/libboard_jtag_pci_dk.so* @CMAKE_INSTALL_PREFIX@/@OPAE_LIB_INSTALL_DIR@/opae/libboard_c6100.so* diff --git a/opae.spec.rhel b/opae.spec.rhel index c7037371c775..82b1a4d1e50d 100644 --- a/opae.spec.rhel +++ b/opae.spec.rhel @@ -185,6 +185,7 @@ done %{_libdir}/opae/libboard_d5005.so %{_libdir}/opae/libboard_n5010.so %{_libdir}/opae/libboard_n6000.so +%{_libdir}/opae/libboard_jtag_pci_dk.so %{_libdir}/opae/libboard_c6100.so %{_libdir}/opae/libboard_cmc.so diff --git a/packaging/opae/deb/opae.install b/packaging/opae/deb/opae.install index 1adc95219722..cd3992df9a14 100644 --- a/packaging/opae/deb/opae.install +++ b/packaging/opae/deb/opae.install @@ -25,6 +25,7 @@ usr/lib/opae/libboard_n3000.so usr/lib/opae/libboard_d5005.so usr/lib/opae/libboard_n5010.so usr/lib/opae/libboard_n6000.so +usr/lib/opae/libboard_jtag_pci_dk.so usr/lib/opae/libboard_c6100.so usr/lib/opae/libboard_cmc.so usr/bin/fpgad