Skip to content

Commit

Permalink
Update LPC DD to set it's bar based upon what SBE tell us LPC bar is
Browse files Browse the repository at this point in the history
Previously the value of the BARS was hard coded. We want to be able
to handle swapped memory. We will always just use what the SBE tells
us to use as LPC bar from now on.

Change-Id: I104463926c19763bd0bde8a0fd68ef3060157fe2
RTC: 173521
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/41202
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Reviewed-by: Martin Gloff <mgloff@us.ibm.com>
Reviewed-by: Corey V. Swenson <cswenson@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
  • Loading branch information
crgeddes authored and dcrowell77 committed Jun 6, 2017
1 parent b83a842 commit 24aed91
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions src/usr/lpc/lpcdd.C
Expand Up @@ -30,6 +30,7 @@
*/

#include <sys/mmio.h>
#include <sys/mm.h>
#include <sys/task.h>
#include <sys/sync.h>
#include <string.h>
Expand All @@ -44,6 +45,7 @@
#include <lpc/lpc_reasoncodes.H>
#include <initservice/initserviceif.H>
#include <kernel/console.H> //@todo - RTC:97495 -- Resolve console access
#include <kernel/bltohbdatamgr.H>
#include <errl/errludlogregister.H>
#include <initservice/taskargs.H>
#include <config.h>
Expand Down Expand Up @@ -385,8 +387,8 @@ void block_lpc_ops( bool i_block )
*/
uint64_t get_lpc_bar( void )
{
//@todo-RTC:173521-Return live value
return MMIO_GROUP0_CHIP0_LPC_BASE_ADDR;
return mm_virt_to_phys( reinterpret_cast<void*>(
Singleton<LpcDD>::instance().getLPCBaseAddr() ));
}


Expand All @@ -407,16 +409,13 @@ LpcDD::LpcDD( TARGETING::Target* i_proc )
{
TRACFCOMP(g_trac_lpc, "LpcDD::LpcDD> " );
mutex_init( &iv_mutex );
LPCBase_t baseAddr = LPC::LPC_PHYS_BASE + LPC_ADDR_START;


setLPCBaseAddr( static_cast<uint64_t *>(
mmio_dev_map(reinterpret_cast<void *>(baseAddr),
LPC_SPACE_SIZE )));
LPCBase_t baseAddr;

if( i_proc == TARGETING::MASTER_PROCESSOR_CHIP_TARGET_SENTINEL )
{
ivp_mutex = &cv_mutex;
//Retrieve the LPC phys base from the bootloader/hostboot data manager
baseAddr = g_BlToHbDataManager.getLpcBAR() + LPC_ADDR_START;
}
else
{
Expand All @@ -428,8 +427,15 @@ LpcDD::LpcDD( TARGETING::Target* i_proc )

// Just use the local mutex
ivp_mutex = &iv_mutex;

//Correct LPC_BUS address attribute should be correct for alt_lpcdd
baseAddr = i_proc->getAttr<TARGETING::ATTR_LPC_BUS_ADDR>() + LPC_ADDR_START;
}

setLPCBaseAddr( static_cast<uint64_t *>(
mmio_dev_map(reinterpret_cast<void *>(baseAddr),
LPC_SPACE_SIZE )));

//@todo RTC:126644
// Initialize the hardware
// errlHndl_t l_errl = hwReset(LpcDD::RESET_INIT);
Expand Down

0 comments on commit 24aed91

Please sign in to comment.