Intel® Makers
Intel® Edison, Intel® Joule™, Intel® Curie™, Intel® Galileo
Announcements
Welcome - This is a Peer-to-Peer Forum only. Intel has discontinued these products but you may find support from other customers on this Forum
9868 Discussions

DRAM initialization of Galileo Gen2: ROM code or firmware?

AInte
New Contributor I
5,720 Views

Dear community,

I was exploring the DRAM module that is implemented in the Galileo. I want to test the data retention characteristics of the DRAM but I exhibited that if one turns the board on, something writes values to the DRAM. I wanted to disable this procedure but wasn't successful yet. Thus, I was asking myself if there is some initalization code as part of potential ROM code that can not be disabled anyway? Or doesn't the Galileo platform implement any ROM code and everything is initialized within the firmware?

Best,

André

23 Replies
AInte
New Contributor I
39 Views

Dear Diego,

thanks for the updated. I was trying to modify the code and test it but ran into some problems. I am using Board_Support_Package_Sources_for_Intel_Quark_v1.1.0.7z and my modified MemoryInit function that is part of MrcWrapper.c looks like this after commenting out the code snippets you mentioned (please, see below).

However, compiling this modified MrcWrapper.c leads to quite some errors:

In file included from /IntelGalileo/BSP_1.1.0/Quark_EDKII/Build/QuarkPlatform/DEBUG_GCC46/IA32/QuarkPlatformPkg/Platform/Pei/PlatformInit/PlatformInitPei/DEBUG/AutoGen.h:18:0,

from :0:

/IntelGalileo/BSP_1.1.0/Quark_EDKII/QuarkPlatformPkg/Platform/Pei/PlatformInit/MrcWrapper.c: In function 'MemoryInit':

/IntelGalileo/BSP_1.1.0/Quark_EDKII/MdePkg/Include/Library/PcdLib.h:391:45: error: '_PCD_GET_MODE_32_PcdMemorySize' undeclared (first use in this function)

# define PcdGet32(TokenName) _PCD_GET_MODE_32_# TokenName

^

/IntelGalileo/BSP_1.1.0/Quark_EDKII/QuarkPlatformPkg/Platform/Pei/PlatformInit/MrcWrapper.c:459:22: note: in expansion of macro 'PcdGet32'

MrcData.mem_size = PcdGet32 (PcdMemorySize);

^

/IntelGalileo/BSP_1.1.0/Quark_EDKII/MdePkg/Include/Library/PcdLib.h:391:45: note: each undeclared identifier is reported only once for each function it appears in

# define PcdGet32(TokenName) _PCD_GET_MODE_32_# TokenName

^

/IntelGalileo/BSP_1.1.0/Quark_EDKII/QuarkPlatformPkg/Platform/Pei/PlatformInit/MrcWrapper.c:459:22: note: in expansion of macro 'PcdGet32'

MrcData.mem_size = PcdGet32 (PcdMemorySize);

^

/IntelGalileo/BSP_1.1.0/Quark_EDKII/QuarkPlatformPkg/Platform/Pei/PlatformInit/MrcWrapper.c: At top level:

/IntelGalileo/BSP_1.1.0/Quark_EDKII/QuarkPlatformPkg/Platform/Pei/PlatformInit/MrcWrapper.c:112:1: error: 'MrcConfigureFromMcFuses' defined but not used [-Werror=unused-function]

MrcConfigureFromMcFuses (

^

cc1: all warnings being treated as errors

make: *** [/IntelGalileo/BSP_1.1.0/Quark_EDKII/Build/QuarkPlatform/DEBUG_GCC46/IA32/QuarkPlatformPkg/Platform/Pei/PlatformInit/PlatformInitPei/OUTPUT/MrcWrapper.obj] Error 1

build.py...

: error 7000: Failed to execute command

I guess, I either use a different version of MrcWrapper.c or the code modifications suggested require some changes to the code at another place.

Best,

André

EFI_STATUS

MemoryInit (

IN EFI_PEI_SERVICES **PeiServices

)

{

MRC_PARAMS MrcData;

EFI_BOOT_MODE BootMode;

EFI_STATUS Status;

EFI_PEI_READ_ONLY_VARIABLE2_PPI *VariableServices;

EFI_STATUS_CODE_VALUE ErrorCodeValue;

// PEI_QNC_MEMORY_INIT_PPI *QNCMemoryInitPpi;

UINT16 PmswAdr;

ErrorCodeValue = 0;

VariableServices = NULL;

DEBUG ((DEBUG_INFO, "Performing modified MemoryInit\n"));

//

// It is critical that both of these data structures are initialized to 0.

// This PEIM knows the number of DIMMs in the system and works with that

// information. The MCH PEIM that consumes these data structures does not

// know the number of DIMMs so it expects the entire structure to be

// properly initialized. By initializing these to zero, all flags indicating

// that the SPD is present or the row should be configured are set to false.

//

ZeroMem (&MrcData, sizeof(MrcData));

//

// Determine boot mode

//

Status = PeiServicesGetBootMode (&BootMode);

ASSERT_EFI_ERROR (Status);

//

// Initialize Error type for reporting status code

//

switch (BootMode) {

case BOOT_ON_FLASH_UPDATE:

ErrorCodeValue = EFI_COMPUTING_UNIT_MEMORY + EFI_CU_MEMORY_EC_UPDATE_FAIL;

break;

case BOOT_ON_S3_RESUME:

ErrorCodeValue = EFI_COMPUTING_UNIT_MEMORY + EFI_CU_MEMORY_EC_S3_RESUME_FAIL;

break;

default:

ErrorCodeValue = EFI_COMPUTING_UNIT_MEMORY;

break;

}

//

// Specify MRC boot mode

//

switch (BootMode) {

case BOOT_ON_S3_RESUME:

case BOOT_ON_FLASH_UPDATE:

MrcData.boot_mode = bmS3;

break;

case BOOT_ASSUMING_NO_CONFIGURATION_CHANGES:

MrcData.boot_mode = bmFast;

break;

default:

MrcData.boot_mode = bmCold;

break;

}

//

// Configure MRC input parameters.

//

// Status = MrcConfigureFromMcFuses (&MrcData);

// ASSERT_EFI_ERROR (Status);

Status = MrcConfigureFromInfoHob (&MrcData);

ASSERT_EFI_ERROR (Status);

MrcUartConfig(&MrcData);

if (BootMode == BOOT_IN_RECOVERY_MODE) {

//

// Always do bmCold on recovery.

//

DEBUG ((DEBUG_INFO, "MemoryInit:Force bmCold on Recovery\n"));

MrcData.boot_mode = bmCold;

} else {

//

// Get necessary PPI

//

Status = PeiServicesLocatePpi (

&gEfiPeiReadOnlyVariable2PpiGuid, // GUID

0, // INSTANCE

NULL, // EFI_PEI_PPI_DESCRIPTOR

(VOID **)&VariableServices // PPI

);

ASSERT_EFI_ERROR (Status);

//

// Load Memory configuration data saved in previous boot from variable

//

Status = LoadConfig (

PeiServices,

VariableServices,

&MrcData

);

if (EFI_ERROR (Status)) {

switch (BootMode) {

case BOOT_ON_S3_RESUME:

case BOOT_ON_FLASH_UPDATE:

REPORT_STAT...

idata
Community Manager
39 Views

Hi an.schall,

 

 

Please let us review the errors you got.

 

 

We'll check them and get back to you as soon as possible.

 

 

Regards,

 

Diego
idata
Community Manager
39 Views

Hello an.schall,

 

 

Our previous post was a suggestion to where you should look for in order to identify where the initialization code is located, however, considering the fact that what you are trying to do is a specific modification to the firmware rather than fixing an issue, we're not going to continue reviewing it and we will leave the debugging part to the user who is the one interested in these specific firmware modifications.

 

 

Regards,

 

-Diego
Reply