Skip to content

Commit d001feb

Browse files
dcrowell77A. Patrick Williams III
authored and
A. Patrick Williams III
committed
Create LPC Device Driver
Split LPC function out from PNOR DD and incorporate Stradale changes Change-Id: I4162db1a9f52ba3c0c973438b7b70baeae00aee2 Origin: Google Shared Technology RTC: 97494 Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/11198 Tested-by: Jenkins Server Reviewed-by: Michael Baiocchi <[email protected]> Reviewed-by: Douglas R. Gilbert <[email protected]> Reviewed-by: Daniel M. Crowell <[email protected]> Reviewed-by: A. Patrick Williams III <[email protected]>
1 parent e7d14e4 commit d001feb

15 files changed

+1792
-605
lines changed

src/build/tools/listdeps.pl

+1
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@
209209
"libfsi.so" => '1',
210210
"libscan.so" => '1',
211211
"libgpio.so" => '1',
212+
"liblpc.so" => '1',
212213

213214
);
214215

src/include/usr/devicefw/userif.H

+13
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ namespace DeviceFW
5858
SCAN,
5959
EEPROM,
6060
GPIO,
61+
LPC,
62+
6163
LAST_ACCESS_TYPE,
6264
};
6365

@@ -141,6 +143,17 @@ namespace DeviceFW
141143
static_cast<uint64_t>(( i_ringlen )),\
142144
static_cast<uint64_t>(( i_flag ))
143145

146+
/**
147+
* Construct the device addressing parameters for the LPC device ops.
148+
* @param[in] i_trans_type - LPC transaction type.
149+
* @param[in] i_address - LPC address to operate on.
150+
* Flag options are located in: src/include/usr/lpc/lpcif.H
151+
*/
152+
#define DEVICE_LPC_ADDRESS( i_trans_type, i_address )\
153+
DeviceFW::LPC, static_cast<uint64_t>(( i_trans_type )),\
154+
static_cast<uint64_t>(( i_address ))
155+
156+
144157
/**
145158
* Construct the device addressing parameters for the EEPROM device ops.
146159
* @param[in] i_eeprom_enum - The chip number of the EEPROM to access. See

src/include/usr/hbotcompid.H

+9
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,15 @@ const compId_t GPIO_COMP_ID = 0x2300;
325325
const char GPIO_COMP_NAME[] = "gpio";
326326
//@}
327327

328+
/** @name LPC
329+
* Low Pin Count Bus
330+
*/
331+
//@{
332+
const compId_t LPC_COMP_ID = 0x2400;
333+
const char LPC_COMP_NAME[] = "lpc";
334+
//@}
335+
336+
328337
/** @name RESERVED
329338
* Reserved component ID. x3100 is the component ID
330339
* of FipS ERRL component. Due to our use of

src/include/usr/lpc/lpc_reasoncodes.H

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
/* IBM_PROLOG_BEGIN_TAG */
2+
/* This is an automatically generated prolog. */
3+
/* */
4+
/* $Source: src/include/usr/lpc/lpc_reasoncodes.H $ */
5+
/* */
6+
/* OpenPOWER HostBoot Project */
7+
/* */
8+
/* Contributors Listed Below - COPYRIGHT 2014 */
9+
/* [+] Google Inc. */
10+
/* [+] International Business Machines Corp. */
11+
/* */
12+
/* */
13+
/* Licensed under the Apache License, Version 2.0 (the "License"); */
14+
/* you may not use this file except in compliance with the License. */
15+
/* You may obtain a copy of the License at */
16+
/* */
17+
/* http://www.apache.org/licenses/LICENSE-2.0 */
18+
/* */
19+
/* Unless required by applicable law or agreed to in writing, software */
20+
/* distributed under the License is distributed on an "AS IS" BASIS, */
21+
/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */
22+
/* implied. See the License for the specific language governing */
23+
/* permissions and limitations under the License. */
24+
/* */
25+
/* IBM_PROLOG_END_TAG */
26+
#ifndef __LPC_REASONCODES_H
27+
#define __LPC_REASONCODES_H
28+
29+
#include <hbotcompid.H>
30+
31+
namespace LPC
32+
{
33+
enum LPCModuleId
34+
{
35+
MOD_LPCDD_INVALID_MODULE = 0x00,
36+
MOD_LPCDD_CHECKADDR = 0x01,
37+
MOD_LPCDD_READLPC = 0x02,
38+
MOD_LPCDD_WRITELPC = 0x03,
39+
MOD_LPCDD_CHECKFOROPBERRORS = 0x04,
40+
MOD_LPCDD_HWRESET = 0x05,
41+
MOD_CREATE_ALTMASTER = 0x06,
42+
MOD_READLPC = 0x07,
43+
MOD_WRITELPC = 0x08,
44+
};
45+
46+
enum LPCReasonCode
47+
{
48+
RC_INVALID_ADDR = LPC_COMP_ID | 0x01,
49+
RC_ECCB_ERROR = LPC_COMP_ID | 0x02,
50+
RC_BAD_ARG = LPC_COMP_ID | 0x03,
51+
RC_OPB_ERROR = LPC_COMP_ID | 0x04,
52+
RC_UNSUPPORTED_OPERATION = LPC_COMP_ID | 0x05,
53+
RC_ALTMASTER_EXISTS = LPC_COMP_ID | 0x06,
54+
RC_CANT_USE_MASTER = LPC_COMP_ID | 0x07,
55+
RC_CANT_USE_SENTINEL = LPC_COMP_ID | 0x08,
56+
RC_BAD_TARGET = LPC_COMP_ID | 0x09,
57+
};
58+
};
59+
60+
#endif

src/include/usr/lpc/lpcif.H

+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
/* IBM_PROLOG_BEGIN_TAG */
2+
/* This is an automatically generated prolog. */
3+
/* */
4+
/* $Source: src/include/usr/lpc/lpcif.H $ */
5+
/* */
6+
/* OpenPOWER HostBoot Project */
7+
/* */
8+
/* Contributors Listed Below - COPYRIGHT 2014 */
9+
/* [+] Google Inc. */
10+
/* [+] International Business Machines Corp. */
11+
/* */
12+
/* */
13+
/* Licensed under the Apache License, Version 2.0 (the "License"); */
14+
/* you may not use this file except in compliance with the License. */
15+
/* You may obtain a copy of the License at */
16+
/* */
17+
/* http://www.apache.org/licenses/LICENSE-2.0 */
18+
/* */
19+
/* Unless required by applicable law or agreed to in writing, software */
20+
/* distributed under the License is distributed on an "AS IS" BASIS, */
21+
/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */
22+
/* implied. See the License for the specific language governing */
23+
/* permissions and limitations under the License. */
24+
/* */
25+
/* IBM_PROLOG_END_TAG */
26+
#ifndef __LPCIF_H
27+
#define __LPCIF_H
28+
29+
#include <errl/errlentry.H>
30+
31+
namespace LPC
32+
{
33+
34+
/**
35+
* @enum LPC::TransType
36+
* @brief LPC Transaction Types
37+
*/
38+
enum TransType {
39+
TRANS_IO,
40+
TRANS_MEM,
41+
TRANS_FW,
42+
TRANS_REG, // LPCHC Register space
43+
TRANS_ABS, // Address parm is absolute
44+
TRANS_LAST //Invalid, used for looping and tests
45+
};
46+
47+
48+
/**
49+
* @brief Create/delete software objects to support non-master access
50+
*
51+
* Only a single altmaster object can be active at any given time. The
52+
* previous object must be destroyed before creating another one.
53+
*
54+
* @param i_create true: create objects, false: destroy previous objects
55+
* @param i_proc Processor target to use for LPC access
56+
*
57+
* @return Error if invalid parms or ordering occurs
58+
*/
59+
errlHndl_t create_altmaster_objects( bool i_create,
60+
TARGETING::Target* i_proc );
61+
62+
}; // namespace LPC
63+
64+
#endif // end __LPCIF_H

src/include/usr/pnor/pnor_reasoncodes.H

+3-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
/* OpenPOWER HostBoot Project */
77
/* */
88
/* Contributors Listed Below - COPYRIGHT 2011,2014 */
9+
/* [+] Google Inc. */
910
/* [+] International Business Machines Corp. */
1011
/* */
1112
/* */
@@ -86,12 +87,13 @@ namespace PNOR
8687
RC_ERROR_IN_STATUS_REG = PNOR_COMP_ID | 0x10,
8788
//termination_rc
8889
RC_REINITIALIZE_SFC = PNOR_COMP_ID | 0x11,
90+
RC_SFC_ERROR = PNOR_COMP_ID | 0x12,
8991
};
9092

9193
enum UserDetailsTypes
9294
{
9395
PNOR_UDT_NO_FORMAT = 0x0,
94-
PNOR_UDT_PNORDD_PARAMETERS = 0x1,
96+
PNOR_UDT_PNORDD_PARAMETERS = 0x1,
9597
};
9698
};
9799

src/makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ BASE_MODULES += scom
110110
BASE_MODULES += xscom
111111
BASE_MODULES += initservice
112112
BASE_MODULES += secureboot_base
113+
BASE_MODULES += lpc
113114
BASE_MODULES += pnor
114115
BASE_MODULES += vfs
115116

@@ -233,7 +234,6 @@ RUNTIME_TESTCASE_MODULES += testutil_rt
233234
RUNTIME_TESTCASE_MODULES += testvpd_rt
234235
RUNTIME_TESTCASE_MODULES += testhwpf_rt
235236

236-
237237
RELOCATABLE_IMAGE_LDFLAGS = -pie --export-dynamic
238238

239239
hbicore_OBJECTS += ${BASE_OBJECTS}

src/usr/lpc/HBconfig

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
config LPC_CONSOLE
2+
default n
3+
help
4+
Enable the Hostboot console over the LPC bus.

0 commit comments

Comments
 (0)