diff --git a/src/import/chips/p9/procedures/hwp/initfiles/p9_nx_scom.C b/src/import/chips/p9/procedures/hwp/initfiles/p9_nx_scom.C new file mode 100644 index 00000000000..a6857fe7cc6 --- /dev/null +++ b/src/import/chips/p9/procedures/hwp/initfiles/p9_nx_scom.C @@ -0,0 +1,576 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/import/chips/p9/procedures/hwp/initfiles/p9_nx_scom.C $ */ +/* */ +/* OpenPOWER HostBoot Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 2016,2017 */ +/* [+] International Business Machines Corp. */ +/* */ +/* */ +/* Licensed under the Apache License, Version 2.0 (the "License"); */ +/* you may not use this file except in compliance with the License. */ +/* You may obtain a copy of the License at */ +/* */ +/* http://www.apache.org/licenses/LICENSE-2.0 */ +/* */ +/* Unless required by applicable law or agreed to in writing, software */ +/* distributed under the License is distributed on an "AS IS" BASIS, */ +/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ +/* implied. See the License for the specific language governing */ +/* permissions and limitations under the License. */ +/* */ +/* IBM_PROLOG_END_TAG */ +#include "p9_nx_scom.H" +#include +#include +#include + +using namespace fapi2; + +constexpr auto literal_0x1100088303E = 0x1100088303E; +constexpr auto literal_0x0208577C1C0 = 0x0208577C1C0; +constexpr auto literal_0x6E1FF77CFC0 = 0x6E1FF77CFC0; +constexpr auto literal_1 = 1; +constexpr auto literal_0xFC = 0xFC; +constexpr auto literal_8 = 8; +constexpr auto literal_2 = 2; +constexpr auto literal_0x0000C20801F90FFC = 0x0000C20801F90FFC; +constexpr auto literal_0x000300063E040000 = 0x000300063E040000; +constexpr auto literal_0x00033DF7FE06F800 = 0x00033DF7FE06F800; + +fapi2::ReturnCode p9_nx_scom(const fapi2::Target& TGT0, + const fapi2::Target& TGT1) +{ + fapi2::ReturnCode l_rc = 0; + + do + { + fapi2::buffer l_scom_buffer; + { + l_rc = fapi2::getScom( TGT0, 0x2011041ull, l_scom_buffer ); + + if (l_rc) + { + FAPI_ERR("ERROR executing: getScom (0x2011041ull)"); + break; + } + + { + constexpr auto l_scom_buffer_ON = 0x1; + l_scom_buffer.insert (l_scom_buffer_ON, 63, 1, 63 ); + } + + { + constexpr auto l_scom_buffer_ON = 0x1; + l_scom_buffer.insert (l_scom_buffer_ON, 62, 1, 63 ); + } + + { + constexpr auto l_scom_buffer_ON = 0x1; + l_scom_buffer.insert (l_scom_buffer_ON, 58, 1, 63 ); + } + + { + constexpr auto l_scom_buffer_ON = 0x1; + l_scom_buffer.insert (l_scom_buffer_ON, 57, 1, 63 ); + } + + { + constexpr auto l_scom_buffer_ON = 0x1; + l_scom_buffer.insert (l_scom_buffer_ON, 61, 1, 63 ); + } + + l_rc = fapi2::putScom(TGT0, 0x2011041ull, l_scom_buffer); + + if (l_rc) + { + FAPI_ERR("ERROR executing: putScom (0x2011041ull)"); + break; + } + } + { + l_rc = fapi2::getScom( TGT0, 0x2011042ull, l_scom_buffer ); + + if (l_rc) + { + FAPI_ERR("ERROR executing: getScom (0x2011042ull)"); + break; + } + + { + constexpr auto l_scom_buffer_MAX_13_INRD = 0xd; + l_scom_buffer.insert (l_scom_buffer_MAX_13_INRD, 33, 4, 60 ); + } + + { + constexpr auto l_scom_buffer_MAX_7_INRD = 0x7; + l_scom_buffer.insert (l_scom_buffer_MAX_7_INRD, 37, 4, 60 ); + } + + { + constexpr auto l_scom_buffer_MAX_13_INRD = 0xd; + l_scom_buffer.insert (l_scom_buffer_MAX_13_INRD, 8, 4, 60 ); + } + + { + constexpr auto l_scom_buffer_MAX_7_INRD = 0x7; + l_scom_buffer.insert (l_scom_buffer_MAX_7_INRD, 12, 4, 60 ); + } + + { + constexpr auto l_scom_buffer_MAX_3_INRD = 0x3; + l_scom_buffer.insert (l_scom_buffer_MAX_3_INRD, 25, 4, 60 ); + } + + { + constexpr auto l_scom_buffer_OFF = 0x0; + l_scom_buffer.insert (l_scom_buffer_OFF, 48, 1, 63 ); + } + + { + constexpr auto l_scom_buffer_ON = 0x1; + l_scom_buffer.insert (l_scom_buffer_ON, 23, 1, 63 ); + } + + { + constexpr auto l_scom_buffer_ON = 0x1; + l_scom_buffer.insert (l_scom_buffer_ON, 24, 1, 63 ); + } + + { + constexpr auto l_scom_buffer_ON = 0x1; + l_scom_buffer.insert (l_scom_buffer_ON, 16, 1, 63 ); + } + + { + constexpr auto l_scom_buffer_ON = 0x1; + l_scom_buffer.insert (l_scom_buffer_ON, 17, 1, 63 ); + } + + { + constexpr auto l_scom_buffer_OFF = 0x0; + l_scom_buffer.insert (l_scom_buffer_OFF, 56, 1, 63 ); + } + + l_rc = fapi2::putScom(TGT0, 0x2011042ull, l_scom_buffer); + + if (l_rc) + { + FAPI_ERR("ERROR executing: putScom (0x2011042ull)"); + break; + } + } + { + l_rc = fapi2::getScom( TGT0, 0x201105cull, l_scom_buffer ); + + if (l_rc) + { + FAPI_ERR("ERROR executing: getScom (0x201105cull)"); + break; + } + + { + constexpr auto l_scom_buffer_DIVIDE_BY_4 = 0x2; + l_scom_buffer.insert (l_scom_buffer_DIVIDE_BY_4, 1, 4, 60 ); + } + + { + constexpr auto l_scom_buffer_ON = 0x1; + l_scom_buffer.insert (l_scom_buffer_ON, 0, 1, 63 ); + } + + { + constexpr auto l_scom_buffer_DIVIDE_BY_4 = 0x2; + l_scom_buffer.insert (l_scom_buffer_DIVIDE_BY_4, 6, 4, 60 ); + } + + { + constexpr auto l_scom_buffer_ON = 0x1; + l_scom_buffer.insert (l_scom_buffer_ON, 5, 1, 63 ); + } + + { + constexpr auto l_scom_buffer_DIVIDE_BY_4 = 0x2; + l_scom_buffer.insert (l_scom_buffer_DIVIDE_BY_4, 11, 4, 60 ); + } + + { + constexpr auto l_scom_buffer_ON = 0x1; + l_scom_buffer.insert (l_scom_buffer_ON, 10, 1, 63 ); + } + + { + constexpr auto l_scom_buffer_DIVIDE_BY_4 = 0x2; + l_scom_buffer.insert (l_scom_buffer_DIVIDE_BY_4, 16, 4, 60 ); + } + + { + constexpr auto l_scom_buffer_ON = 0x1; + l_scom_buffer.insert (l_scom_buffer_ON, 15, 1, 63 ); + } + + { + constexpr auto l_scom_buffer_DIVIDE_BY_4 = 0x2; + l_scom_buffer.insert (l_scom_buffer_DIVIDE_BY_4, 21, 4, 60 ); + } + + { + constexpr auto l_scom_buffer_ON = 0x1; + l_scom_buffer.insert (l_scom_buffer_ON, 20, 1, 63 ); + } + + { + constexpr auto l_scom_buffer_ON = 0x1; + l_scom_buffer.insert (l_scom_buffer_ON, 25, 1, 63 ); + } + + { + constexpr auto l_scom_buffer_DIVIDE_BY_32 = 0x3; + l_scom_buffer.insert (l_scom_buffer_DIVIDE_BY_32, 26, 4, 60 ); + } + + l_rc = fapi2::putScom(TGT0, 0x201105cull, l_scom_buffer); + + if (l_rc) + { + FAPI_ERR("ERROR executing: putScom (0x201105cull)"); + break; + } + } + { + l_rc = fapi2::getScom( TGT0, 0x2011083ull, l_scom_buffer ); + + if (l_rc) + { + FAPI_ERR("ERROR executing: getScom (0x2011083ull)"); + break; + } + + { + l_scom_buffer.insert (literal_0x1100088303E, 0, 44, 20 ); + } + + l_rc = fapi2::putScom(TGT0, 0x2011083ull, l_scom_buffer); + + if (l_rc) + { + FAPI_ERR("ERROR executing: putScom (0x2011083ull)"); + break; + } + } + { + l_rc = fapi2::getScom( TGT0, 0x2011086ull, l_scom_buffer ); + + if (l_rc) + { + FAPI_ERR("ERROR executing: getScom (0x2011086ull)"); + break; + } + + { + l_scom_buffer.insert (literal_0x0208577C1C0, 0, 44, 20 ); + } + + l_rc = fapi2::putScom(TGT0, 0x2011086ull, l_scom_buffer); + + if (l_rc) + { + FAPI_ERR("ERROR executing: putScom (0x2011086ull)"); + break; + } + } + { + l_rc = fapi2::getScom( TGT0, 0x2011087ull, l_scom_buffer ); + + if (l_rc) + { + FAPI_ERR("ERROR executing: getScom (0x2011087ull)"); + break; + } + + { + l_scom_buffer.insert (literal_0x6E1FF77CFC0, 0, 44, 20 ); + } + + l_rc = fapi2::putScom(TGT0, 0x2011087ull, l_scom_buffer); + + if (l_rc) + { + FAPI_ERR("ERROR executing: putScom (0x2011087ull)"); + break; + } + } + fapi2::ATTR_PROC_FABRIC_ADDR_BAR_MODE_Type l_TGT1_ATTR_PROC_FABRIC_ADDR_BAR_MODE; + l_rc = FAPI_ATTR_GET(fapi2::ATTR_PROC_FABRIC_ADDR_BAR_MODE, TGT1, l_TGT1_ATTR_PROC_FABRIC_ADDR_BAR_MODE); + + if (l_rc) + { + FAPI_ERR("ERROR executing: FAPI_ATTR_GET (ATTR_PROC_FABRIC_ADDR_BAR_MODE)"); + break; + } + + { + l_rc = fapi2::getScom( TGT0, 0x2011095ull, l_scom_buffer ); + + if (l_rc) + { + FAPI_ERR("ERROR executing: getScom (0x2011095ull)"); + break; + } + + { + constexpr auto l_scom_buffer_ON = 0x1; + l_scom_buffer.insert (l_scom_buffer_ON, 22, 1, 63 ); + } + + { + if ((l_TGT1_ATTR_PROC_FABRIC_ADDR_BAR_MODE == fapi2::ENUM_ATTR_PROC_FABRIC_ADDR_BAR_MODE_SMALL_SYSTEM)) + { + constexpr auto l_scom_buffer_ON = 0x1; + l_scom_buffer.insert (l_scom_buffer_ON, 23, 1, 63 ); + } + else if ((l_TGT1_ATTR_PROC_FABRIC_ADDR_BAR_MODE == fapi2::ENUM_ATTR_PROC_FABRIC_ADDR_BAR_MODE_LARGE_SYSTEM)) + { + constexpr auto l_scom_buffer_OFF = 0x0; + l_scom_buffer.insert (l_scom_buffer_OFF, 23, 1, 63 ); + } + } + + { + l_scom_buffer.insert (literal_1, 25, 2, 62 ); + } + + { + l_scom_buffer.insert (literal_0xFC, 40, 8, 56 ); + } + + { + l_scom_buffer.insert (literal_0xFC, 48, 8, 56 ); + } + + l_rc = fapi2::putScom(TGT0, 0x2011095ull, l_scom_buffer); + + if (l_rc) + { + FAPI_ERR("ERROR executing: putScom (0x2011095ull)"); + break; + } + } + + { + l_rc = fapi2::getScom( TGT0, 0x20110a8ull, l_scom_buffer ); + + if (l_rc) + { + FAPI_ERR("ERROR executing: getScom (0x20110a8ull)"); + break; + } + + { + l_scom_buffer.insert (literal_8, 8, 4, 60 ); + } + + { + l_scom_buffer.insert (literal_8, 4, 4, 60 ); + } + + { + l_scom_buffer.insert (literal_8, 12, 4, 60 ); + } + + { + l_scom_buffer.insert (literal_8, 16, 4, 60 ); + } + + l_rc = fapi2::putScom(TGT0, 0x20110a8ull, l_scom_buffer); + + if (l_rc) + { + FAPI_ERR("ERROR executing: putScom (0x20110a8ull)"); + break; + } + } + + { + l_rc = fapi2::getScom( TGT0, 0x20110c3ull, l_scom_buffer ); + + if (l_rc) + { + FAPI_ERR("ERROR executing: getScom (0x20110c3ull)"); + break; + } + + { + l_scom_buffer.insert (literal_8, 27, 9, 55 ); + } + + l_rc = fapi2::putScom(TGT0, 0x20110c3ull, l_scom_buffer); + + if (l_rc) + { + FAPI_ERR("ERROR executing: putScom (0x20110c3ull)"); + break; + } + } + + { + l_rc = fapi2::getScom( TGT0, 0x20110c4ull, l_scom_buffer ); + + if (l_rc) + { + FAPI_ERR("ERROR executing: getScom (0x20110c4ull)"); + break; + } + + { + l_scom_buffer.insert (literal_8, 27, 9, 55 ); + } + + l_rc = fapi2::putScom(TGT0, 0x20110c4ull, l_scom_buffer); + + if (l_rc) + { + FAPI_ERR("ERROR executing: putScom (0x20110c4ull)"); + break; + } + } + + { + l_rc = fapi2::getScom( TGT0, 0x20110c5ull, l_scom_buffer ); + + if (l_rc) + { + FAPI_ERR("ERROR executing: getScom (0x20110c5ull)"); + break; + } + + { + l_scom_buffer.insert (literal_8, 27, 9, 55 ); + } + + l_rc = fapi2::putScom(TGT0, 0x20110c5ull, l_scom_buffer); + + if (l_rc) + { + FAPI_ERR("ERROR executing: putScom (0x20110c5ull)"); + break; + } + } + + { + l_rc = fapi2::getScom( TGT0, 0x20110d5ull, l_scom_buffer ); + + if (l_rc) + { + FAPI_ERR("ERROR executing: getScom (0x20110d5ull)"); + break; + } + + { + constexpr auto l_scom_buffer_ON = 0x1; + l_scom_buffer.insert (l_scom_buffer_ON, 1, 1, 63 ); + } + + l_rc = fapi2::putScom(TGT0, 0x20110d5ull, l_scom_buffer); + + if (l_rc) + { + FAPI_ERR("ERROR executing: putScom (0x20110d5ull)"); + break; + } + } + + { + l_rc = fapi2::getScom( TGT0, 0x20110d6ull, l_scom_buffer ); + + if (l_rc) + { + FAPI_ERR("ERROR executing: getScom (0x20110d6ull)"); + break; + } + + { + l_scom_buffer.insert (literal_2, 9, 3, 61 ); + } + + l_rc = fapi2::putScom(TGT0, 0x20110d6ull, l_scom_buffer); + + if (l_rc) + { + FAPI_ERR("ERROR executing: putScom (0x20110d6ull)"); + break; + } + } + + { + l_rc = fapi2::getScom( TGT0, 0x2011103ull, l_scom_buffer ); + + if (l_rc) + { + FAPI_ERR("ERROR executing: getScom (0x2011103ull)"); + break; + } + + { + l_scom_buffer.insert (literal_0x0000C20801F90FFC, 0, 50, 14 ); + } + + l_rc = fapi2::putScom(TGT0, 0x2011103ull, l_scom_buffer); + + if (l_rc) + { + FAPI_ERR("ERROR executing: putScom (0x2011103ull)"); + break; + } + } + + { + l_rc = fapi2::getScom( TGT0, 0x2011106ull, l_scom_buffer ); + + if (l_rc) + { + FAPI_ERR("ERROR executing: getScom (0x2011106ull)"); + break; + } + + { + l_scom_buffer.insert (literal_0x000300063E040000, 0, 50, 14 ); + } + + l_rc = fapi2::putScom(TGT0, 0x2011106ull, l_scom_buffer); + + if (l_rc) + { + FAPI_ERR("ERROR executing: putScom (0x2011106ull)"); + break; + } + } + + { + l_rc = fapi2::getScom( TGT0, 0x2011107ull, l_scom_buffer ); + + if (l_rc) + { + FAPI_ERR("ERROR executing: getScom (0x2011107ull)"); + break; + } + + { + l_scom_buffer.insert (literal_0x00033DF7FE06F800, 0, 50, 14 ); + } + + l_rc = fapi2::putScom(TGT0, 0x2011107ull, l_scom_buffer); + + if (l_rc) + { + FAPI_ERR("ERROR executing: putScom (0x2011107ull)"); + break; + } + } + } + while (0); + + return l_rc; +}