📄 plat_api.c
字号:
* as a function, to give OEMs the opportunity to analyze the current state
* of their system, and adjust these values accordingly (if desired).
*
****************************************************************************/
UINT8 PLAT_DefineArrayParameters(PSM_OEMInfoPtr oem_info_ptr)
{
static const PSM_OEMInfo oem_info = {
/* PhysicalReadStartAddress */ (VOID_PTR)0x00000000,
/* PhysicalWriteStartAddress */ (VOID_PTR)0x00000000,
/* PhysicalBurstReadStartAddress */ (VOID_PTR)0x00000000,
#ifdef MMXIP_MEMMAP
/* VirtualReadStartAddress */ (VOID_PTR)0xA0000000,
/* VirtualWriteStartAddress */ (VOID_PTR)0xA0000000,
/* VirtualBurstReadStartAddress */ (VOID_PTR)0xA0000000,
#else
/* VirtualReadStartAddress */ (VOID_PTR)0x98C00000,
/* VirtualWriteStartAddress */ (VOID_PTR)0xB8C00000,
/* VirtualBurstReadStartAddress */ (VOID_PTR)0x98C00000,
#endif
/* MaximumArrayLength */ 0x02000000,
/* MaximumRegistrySize */ 0x00080000,
/* ManagedAreaStart */ 0x01A00000,
/* ManagedAreaLength */ 0x00500000,
/* ReadBusWidth */ 32,
/* WriteBusWidth */ 32,
/* BurstReadBusWidth */ 0
};
/* Copy the local OEMInfo structure out to the caller's structure */
*oem_info_ptr = oem_info;
/* enable/disable polling for interrupts */
Interrupts_Polling_Write = FALSE;
Interrupts_Polling_Erase = TRUE;
/* enable/disable HWRWW */
Multiple_Partitions = FALSE;
/* no polling for interrupts if HWRWW is enable */
if (Multiple_Partitions)
{
Interrupts_Polling_Write = FALSE;
Interrupts_Polling_Erase = FALSE;
}
/* All done; return with no errors */
return(FALSE);
}
/****************************************************************************
*
* "PLAT_FormatRecovery"
*
* DESCRIPTION:
* This function is called by the PSM software stack if its initialization
* fails due to (what appears to be) a corrupted data partition. The
* purpose of this function is to allow the OEM to decide whether to
* reformat the data partition, as a "last resort" form of recovery. Note
* that this may not be the best course of action, if the OEM suspects that
* the initialization is failing due to a low-battery condition, rather than
* because of a data corruption issue in flash.
*
****************************************************************************/
UINT8 PLAT_FormatRecovery(PSM_FormatOptionsPtr format_options_ptr)
{
static const PSM_FormatOptions format_options = {
/* MinimumReclaimSize */ 0x4000,
/* StreamingGranularity */ 0x400,
/* MaxFilenameLength */ 0x100,
/* ReclaimThreshold */ 25,
/* StreamingOverhead */ 10,
/* UpdateAccessTimesEnabled */ FALSE,
/* Reserved */ FALSE
};
/* Copy the local FormatOptions structure out to the caller's structure */
*format_options_ptr = format_options;
/* Return TRUE to allow PSM to reformat the data partition */
return (TRUE);
}
/****************************************************************************
*
* "PLAT_VPEN_ToggleInit"
*
* DESCRIPTION:
* This function is called by the PSM software stack to to enable or disable
* the toggling of the flash device Erase/Program/Block lock enable pin.
*
*
* VPEN_VirtualReadRegAddress - A pointer containing an address which can be
* used to read the current state I/O register
* controlling the VPEN line of the flash
* device. This information is required to
* properly change the VPEN I/O bit without
* changing the state of the other I/O bits that
* may be controled by the register. This
* address MUST be a valid system address if
* VPEN_ReadModifyWrite is set to TRUE.
*
* VPEN_VirtualSetRegAddress - A pointer containing an address which can be
* used to access the I/O register that controls
* setting (ouput set to TRUE) VPEN line of the
* flash device. This information is required
* to properly change the VPEN I/O bit. This
* address MUST be a valid system address.
*
* VPEN_VirtualClearRegAddress - A pointer containing an address which can be
* used to access the I/O register that controls
* clearing (ouput set to FALSE) VPEN line of the
* flash device. This information is required
* to properly change the VPEN I/O bit. This
* address MUST be a valid system address.
*
* VPEN_SetMask - Defines the bit mask needed to set the VPEN bit active.
*
* VPEN_ClearMask - Defines the bit mask needed to set the VPEN bit inactive.
*
* VPEN_ToggleEnabled - Set to TRUE if toggling of VPEN will be used.
*
* VPEN_ReadModifyWrite - This defines wether or not the register controlling
* the VPEN can be read from.
* Set to FALSE if the register is a write only. The
* mask value will be store at the Virtual write
* register address location.
* Set to TRUE - the current register value will be
* read from the read register address. Next the mask
* will be applied to this value. (Note if negative
* logic the mask value inverted first) The the value
* is stored at the write register address.
*
*
****************************************************************************/
BOOL PLAT_VPEN_ToggleInit(PLAT_OEM_VPENToggleInfoPtr vpen_info_ptr)
{
static const PLAT_OEM_VPENToggleInfo vpen_info = {
/* VPEN_VirtualReadRegAddress */ (VOID_PTR)0xab800010,
/* VPEN_VirtualSetRegAddress */ (VOID_PTR)0xab800010,
/* VPEN_VirtualClearRegAddress */ (VOID_PTR)0xab800010,
/* VPEN_SetMask */ 0x0,
/* VPEN_ClearMask */ 0x0,
/* VPEN_ToggleEnabled */ FALSE,
/* VPEN_ReadModifyWrite */ FALSE,
};
/* Copy the local FormatOptions structure out to the caller's structure */
*vpen_info_ptr = vpen_info;
/* All done; return with no errors */
return (vpen_info.VPEN_ToggleEnabled);
}
/****************************************************************************
*
* "PLAT_DefineSystemIdleEventEnabled"
*
* DESCRIPTION:
* This fuction is called by the PSM software stack to initialize its
* configuration for a system idle event. The SystemIdleEventEnabled
* should only be set to TRUE if a name event will be created with the exact
* name specified in the users guide and the signalling and unsignalling of
* the event will be completely comtrolled by the OEM. The OEM must determine
* when the sytem is "idle" when signalling the event and unsignal the
* event when system is in use.
*
****************************************************************************/
BOOL PLAT_DefineSystemIdleEventEnabled(void)
{
BOOL SystemIdleEventEnabled = FALSE;
return (SystemIdleEventEnabled);
}
/****************************************************************************
*
* "PLAT_INTC_AddrInit"
*
* DESCRIPTION:
* This function is called by the PSM software stack to determine the OEM
* IRQ Pending Register Address(icip) & FIQ interuppt Pending Register Address
* location (icfp, if applicable). These Registers will be polled by PSM to
* check the pending interrupts to be serviced. OEM must set appropriate polling
* flag (say if only IRQ is enabled by OEM or both IRQ and FIQ are enabled)
* INTC_icipVirtualReadAddress: This is the absolute virtual address location
where the OEM implemented the IRQ Pending Register
* INTC_icfpVirtualReadAdderss: This is the absolute virtual address location
where the OEM implemented the FIQ Pending Register
****************************************************************************/
BOOL PLAT_INTC_AddrInit(PLAT_OEM_INTC_AddrInfoPtr intc_addr_info_ptr)
{
static const PLAT_OEM_INTC_AddrInfo intc_addr_info= {
/*INTC_icipVirtualReadAddress */ (VOID_PTR)0xA5200000,
/*INTC_icfpVirtualReadAdderss */ NULL
};
*intc_addr_info_ptr = intc_addr_info;
return (TRUE);
}
/*---------------------------- End of PLAT_API.C --------------------------*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -