From ca146386637c2b1c2d787e6d2881b34962a39994 Mon Sep 17 00:00:00 2001 From: Emmanuel Sacristan Date: Wed, 8 Jun 2016 16:46:52 -0500 Subject: mmu init files Change-Id: I70dd2393e923a88428b6d00c0ec48113dd2630cd Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/25533 Tested-by: Jenkins Server Reviewed-by: Joseph J. McGill Reviewed-by: Jenny Huynh Reviewed-by: Jennifer A. Stofer Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/31200 Tested-by: Jenkins Server Tested-by: FSP CI Jenkins --- .../p9/procedures/hwp/initfiles/p9_mmu_scom.C | 357 +++++++++++++++++++++ .../p9/procedures/hwp/initfiles/p9_mmu_scom.H | 45 +++ 2 files changed, 402 insertions(+) create mode 100644 src/import/chips/p9/procedures/hwp/initfiles/p9_mmu_scom.C create mode 100644 src/import/chips/p9/procedures/hwp/initfiles/p9_mmu_scom.H (limited to 'src') diff --git a/src/import/chips/p9/procedures/hwp/initfiles/p9_mmu_scom.C b/src/import/chips/p9/procedures/hwp/initfiles/p9_mmu_scom.C new file mode 100644 index 00000000..11b1def1 --- /dev/null +++ b/src/import/chips/p9/procedures/hwp/initfiles/p9_mmu_scom.C @@ -0,0 +1,357 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/import/chips/p9/procedures/hwp/initfiles/p9_mmu_scom.C $ */ +/* */ +/* OpenPOWER sbe Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 2016 */ +/* [+] 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_mmu_scom.H" +#include +#include +#include + +using namespace fapi2; + +constexpr auto literal_0x0000000000000000 = 0x0000000000000000; +constexpr auto literal_0x049F700000000000 = 0x049F700000000000; +constexpr auto literal_0x00000000000C = 0x00000000000C; +constexpr auto literal_0x000000000000 = 0x000000000000; +constexpr auto literal_0x9000FAFC00FC = 0x9000FAFC00FC; +constexpr auto literal_0xF8 = 0xF8; +constexpr auto literal_0x0258 = 0x0258; + +fapi2::ReturnCode p9_mmu_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, 0x5012c03ull, l_scom_buffer ); + + if (l_rc) + { + FAPI_ERR("ERROR executing: getScom (0x5012c03ull)"); + break; + } + + { + l_scom_buffer.insert (literal_0x0000000000000000, 0, 22, 0 ); + } + + l_rc = fapi2::putScom(TGT0, 0x5012c03ull, l_scom_buffer); + + if (l_rc) + { + FAPI_ERR("ERROR executing: putScom (0x5012c03ull)"); + break; + } + } + { + l_rc = fapi2::getScom( TGT0, 0x5012c06ull, l_scom_buffer ); + + if (l_rc) + { + FAPI_ERR("ERROR executing: getScom (0x5012c06ull)"); + break; + } + + { + l_scom_buffer.insert (literal_0x0000000000000000, 0, 22, 0 ); + } + + l_rc = fapi2::putScom(TGT0, 0x5012c06ull, l_scom_buffer); + + if (l_rc) + { + FAPI_ERR("ERROR executing: putScom (0x5012c06ull)"); + break; + } + } + { + l_rc = fapi2::getScom( TGT0, 0x5012c07ull, l_scom_buffer ); + + if (l_rc) + { + FAPI_ERR("ERROR executing: getScom (0x5012c07ull)"); + break; + } + + { + l_scom_buffer.insert (literal_0x049F700000000000, 0, 22, 0 ); + } + + l_rc = fapi2::putScom(TGT0, 0x5012c07ull, l_scom_buffer); + + if (l_rc) + { + FAPI_ERR("ERROR executing: putScom (0x5012c07ull)"); + 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; + } + + fapi2::ATTR_PROC_FABRIC_PUMP_MODE_Type l_TGT1_ATTR_PROC_FABRIC_PUMP_MODE; + l_rc = FAPI_ATTR_GET(fapi2::ATTR_PROC_FABRIC_PUMP_MODE, TGT1, l_TGT1_ATTR_PROC_FABRIC_PUMP_MODE); + + if (l_rc) + { + FAPI_ERR("ERROR executing: FAPI_ATTR_GET (ATTR_PROC_FABRIC_PUMP_MODE)"); + break; + } + + { + l_rc = fapi2::getScom( TGT0, 0x5012c15ull, l_scom_buffer ); + + if (l_rc) + { + FAPI_ERR("ERROR executing: getScom (0x5012c15ull)"); + break; + } + + { + 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, 33, 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, 33, 1, 63 ); + } + } + + { + if ((l_TGT1_ATTR_PROC_FABRIC_PUMP_MODE == fapi2::ENUM_ATTR_PROC_FABRIC_PUMP_MODE_CHIP_IS_NODE)) + { + constexpr auto l_scom_buffer_ON = 0x1; + l_scom_buffer.insert (l_scom_buffer_ON, 39, 1, 63 ); + } + else if ((l_TGT1_ATTR_PROC_FABRIC_PUMP_MODE == fapi2::ENUM_ATTR_PROC_FABRIC_PUMP_MODE_CHIP_IS_GROUP)) + { + constexpr auto l_scom_buffer_OFF = 0x0; + l_scom_buffer.insert (l_scom_buffer_OFF, 39, 1, 63 ); + } + } + + l_rc = fapi2::putScom(TGT0, 0x5012c15ull, l_scom_buffer); + + if (l_rc) + { + FAPI_ERR("ERROR executing: putScom (0x5012c15ull)"); + break; + } + } + + { + l_rc = fapi2::getScom( TGT0, 0x5012c43ull, l_scom_buffer ); + + if (l_rc) + { + FAPI_ERR("ERROR executing: getScom (0x5012c43ull)"); + break; + } + + { + l_scom_buffer.insert (literal_0x00000000000C, 0, 48, 16 ); + } + + l_rc = fapi2::putScom(TGT0, 0x5012c43ull, l_scom_buffer); + + if (l_rc) + { + FAPI_ERR("ERROR executing: putScom (0x5012c43ull)"); + break; + } + } + + { + l_rc = fapi2::getScom( TGT0, 0x5012c46ull, l_scom_buffer ); + + if (l_rc) + { + FAPI_ERR("ERROR executing: getScom (0x5012c46ull)"); + break; + } + + { + l_scom_buffer.insert (literal_0x000000000000, 0, 48, 16 ); + } + + l_rc = fapi2::putScom(TGT0, 0x5012c46ull, l_scom_buffer); + + if (l_rc) + { + FAPI_ERR("ERROR executing: putScom (0x5012c46ull)"); + break; + } + } + + { + l_rc = fapi2::getScom( TGT0, 0x5012c47ull, l_scom_buffer ); + + if (l_rc) + { + FAPI_ERR("ERROR executing: getScom (0x5012c47ull)"); + break; + } + + { + l_scom_buffer.insert (literal_0x9000FAFC00FC, 0, 48, 16 ); + } + + l_rc = fapi2::putScom(TGT0, 0x5012c47ull, l_scom_buffer); + + if (l_rc) + { + FAPI_ERR("ERROR executing: putScom (0x5012c47ull)"); + break; + } + } + + { + l_rc = fapi2::getScom( TGT0, 0x5012c52ull, l_scom_buffer ); + + if (l_rc) + { + FAPI_ERR("ERROR executing: getScom (0x5012c52ull)"); + break; + } + + { + constexpr auto l_scom_buffer_SINGLE_THREAD_MODE_ST_INV = 0x70; + l_scom_buffer.insert (l_scom_buffer_SINGLE_THREAD_MODE_ST_INV, 20, 1, 57 ); + l_scom_buffer.insert (l_scom_buffer_SINGLE_THREAD_MODE_ST_INV, 24, 1, 62 ); + l_scom_buffer.insert (l_scom_buffer_SINGLE_THREAD_MODE_ST_INV, 26, 1, 63 ); + } + + { + constexpr auto l_scom_buffer_SINGLE_THREAD_MODE_ST_INV = 0x70; + l_scom_buffer.insert (l_scom_buffer_SINGLE_THREAD_MODE_ST_INV, 20, 1, 57 ); + l_scom_buffer.insert (l_scom_buffer_SINGLE_THREAD_MODE_ST_INV, 24, 1, 62 ); + l_scom_buffer.insert (l_scom_buffer_SINGLE_THREAD_MODE_ST_INV, 26, 1, 63 ); + } + + { + l_scom_buffer.insert (literal_0xF8, 30, 1, 59 ); + l_scom_buffer.insert (literal_0xF8, 60, 4, 60 ); + } + + l_rc = fapi2::putScom(TGT0, 0x5012c52ull, l_scom_buffer); + + if (l_rc) + { + FAPI_ERR("ERROR executing: putScom (0x5012c52ull)"); + break; + } + } + + { + l_rc = fapi2::getScom( TGT0, 0x5012c53ull, l_scom_buffer ); + + if (l_rc) + { + FAPI_ERR("ERROR executing: getScom (0x5012c53ull)"); + break; + } + + { + constexpr auto l_scom_buffer_SINGLE_THREAD_MODE_ST_INV = 0x70; + l_scom_buffer.insert (l_scom_buffer_SINGLE_THREAD_MODE_ST_INV, 2, 2, 60 ); + } + + { + l_scom_buffer.insert (literal_0x0258, 32, 16, 48 ); + } + + l_rc = fapi2::putScom(TGT0, 0x5012c53ull, l_scom_buffer); + + if (l_rc) + { + FAPI_ERR("ERROR executing: putScom (0x5012c53ull)"); + break; + } + } + + { + l_rc = fapi2::getScom( TGT0, 0x5012c54ull, l_scom_buffer ); + + if (l_rc) + { + FAPI_ERR("ERROR executing: getScom (0x5012c54ull)"); + break; + } + + { + constexpr auto l_scom_buffer_SINGLE_THREAD_MODE_ST_INV = 0x70; + l_scom_buffer.insert (l_scom_buffer_SINGLE_THREAD_MODE_ST_INV, 16, 1, 58 ); + } + + l_rc = fapi2::putScom(TGT0, 0x5012c54ull, l_scom_buffer); + + if (l_rc) + { + FAPI_ERR("ERROR executing: putScom (0x5012c54ull)"); + break; + } + } + + { + l_rc = fapi2::getScom( TGT0, 0x5012c55ull, l_scom_buffer ); + + if (l_rc) + { + FAPI_ERR("ERROR executing: getScom (0x5012c55ull)"); + break; + } + + { + constexpr auto l_scom_buffer_SINGLE_THREAD_MODE_ST_INV = 0x70; + l_scom_buffer.insert (l_scom_buffer_SINGLE_THREAD_MODE_ST_INV, 16, 1, 59 ); + } + + { + constexpr auto l_scom_buffer_ON = 0x1; + l_scom_buffer.insert (l_scom_buffer_ON, 21, 1, 63 ); + } + + l_rc = fapi2::putScom(TGT0, 0x5012c55ull, l_scom_buffer); + + if (l_rc) + { + FAPI_ERR("ERROR executing: putScom (0x5012c55ull)"); + break; + } + } + } + while (0); + + return l_rc; +} diff --git a/src/import/chips/p9/procedures/hwp/initfiles/p9_mmu_scom.H b/src/import/chips/p9/procedures/hwp/initfiles/p9_mmu_scom.H new file mode 100644 index 00000000..4fc55355 --- /dev/null +++ b/src/import/chips/p9/procedures/hwp/initfiles/p9_mmu_scom.H @@ -0,0 +1,45 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/import/chips/p9/procedures/hwp/initfiles/p9_mmu_scom.H $ */ +/* */ +/* OpenPOWER sbe Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 2016 */ +/* [+] 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 */ +#ifndef _INIT_P9_MMU_SCOM_PROCEDURE_H_ +#define _INIT_P9_MMU_SCOM_PROCEDURE_H_ + + +#include +#include +#include + + +typedef fapi2::ReturnCode (*p9_mmu_scom_FP_t)(const fapi2::Target&, + const fapi2::Target&); + +extern "C" +{ + + fapi2::ReturnCode p9_mmu_scom(const fapi2::Target& TGT0, + const fapi2::Target& TGT1); + +} + +#endif -- cgit v1.2.1