/* Boot ROM Chip Info struct */ #define MMIO_OFFSET_CHIP_INFO 0x04
#define MMIO_OFFSET_ROM_EXIT_CODE 0x40
#define MMIO_OFFSET_PSI_ADDRESS 0x54
#define MMIO_OFFSET_PSI_SIZE 0x5C
#define MMIO_OFFSET_IPC_STATUS 0x60
#define MMIO_OFFSET_CONTEXT_INFO 0x64
#define MMIO_OFFSET_BASE_ADDR 0x6C
#define MMIO_OFFSET_END_ADDR 0x74
#define MMIO_OFFSET_CP_VERSION 0xF0
#define MMIO_OFFSET_CP_CAPABILITIES 0xF4
/* Timeout in 50 msec to wait for the modem boot code to write a valid * execution stage into mmio area
*/ #define IPC_MMIO_EXEC_STAGE_TIMEOUT 50
/* check if exec stage has one of the valid values */ staticbool ipc_mmio_is_valid_exec_stage(enum ipc_mem_exec_stage stage)
{ switch (stage) { case IPC_MEM_EXEC_STAGE_BOOT: case IPC_MEM_EXEC_STAGE_PSI: case IPC_MEM_EXEC_STAGE_EBL: case IPC_MEM_EXEC_STAGE_RUN: case IPC_MEM_EXEC_STAGE_CRASH: case IPC_MEM_EXEC_STAGE_CD_READY: returntrue; default: returnfalse;
}
}
/* Check for a valid execution stage to make sure that the boot code * has correctly initialized the MMIO area.
*/ do {
stage = ipc_mmio_get_exec_stage(ipc_mmio); if (ipc_mmio_is_valid_exec_stage(stage)) break;
/* read chip info size and version from chip info structure */
ipc_mmio->chip_info_version =
ioread8(ipc_mmio->base + ipc_mmio->offset.chip_info);
/* Increment of 2 is needed as the size value in the chip info * excludes the version and size field, which are always present
*/
ipc_mmio->chip_info_size =
ioread8(ipc_mmio->base + ipc_mmio->offset.chip_info + 1) + 2;
void ipc_mmio_config(struct iosm_mmio *ipc_mmio)
{ if (!ipc_mmio) return;
/* AP memory window (full window is open and active so that modem checks * each AP address) 0 means don't check on modem side.
*/
iowrite64(0, ipc_mmio->base + ipc_mmio->offset.ap_win_base);
iowrite64(0, ipc_mmio->base + ipc_mmio->offset.ap_win_end);
void ipc_mmio_set_contex_info_addr(struct iosm_mmio *ipc_mmio, phys_addr_t addr)
{ if (!ipc_mmio) return;
/* store context_info address. This will be stored in the mmio area * during IPC_MEM_DEVICE_IPC_INIT state via ipc_mmio_config()
*/
ipc_mmio->context_info_addr = addr;
}
int ipc_mmio_get_cp_version(struct iosm_mmio *ipc_mmio)
{ if (ipc_mmio) return ioread32(ipc_mmio->base + ipc_mmio->offset.cp_version);
return -EFAULT;
}
Messung V0.5
¤ Dauer der Verarbeitung: 0.1 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.