blob: bfeb4721e8f0536d4a5e41b77ccedee8d1547975 [file] [log] [blame]
Anthony Wilsonf0d958d2018-10-24 16:37:50 -05001/**
Patrick Venturee84b4dd2018-11-01 16:06:31 -07002 * Copyright (C) 2018 IBM Corporation
Anthony Wilsonf0d958d2018-10-24 16:37:50 -05003 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16#include <phosphor-logging/log.hpp>
17#include "cfam_access.hpp"
18#include "p9_cfam.hpp"
19#include "registration.hpp"
20#include "targeting.hpp"
21
22namespace openpower
23{
24namespace p9
25{
26
27using namespace phosphor::logging;
28using namespace openpower::cfam::access;
29using namespace openpower::cfam::p9;
30using namespace openpower::targeting;
31
32/**
33 * @brief Disables PCIE drivers and receiver in the PCIE root ctrl 1 register
34 * @return void
35 */
36void cleanupPcie()
37{
38 Targeting targets;
39 const auto& master = *(targets.begin());
40
41 log<level::INFO>("Running P9 procedure cleanupPcie");
42
43 // Disable the PCIE drivers and receiver
44 writeReg(master, P9_ROOT_CTRL1_CLEAR, 0x00001C00);
45}
46
47REGISTER_PROCEDURE("cleanupPcie", cleanupPcie);
48
49}
Patrick Venturee84b4dd2018-11-01 16:06:31 -070050}