FreeBSD kernel pms device code
|
The file implements the functions for reset and shutdown. More...
#include <sys/cdefs.h>
#include <dev/pms/config.h>
#include <dev/pms/RefTisa/sallsdk/spc/saglobal.h>
Go to the source code of this file.
Functions | |
__FBSDID ("$FreeBSD$") | |
LOCAL bit32 | si_V_SoftReset (agsaRoot_t *agRoot, bit32 signature) |
LOCAL bit32 | siSpcSoftResetRDYChk (agsaRoot_t *agRoot) |
Function to check FW is ready for soft reset. More... | |
GLOBAL void | saHwReset (agsaRoot_t *agRoot, bit32 resetType, bit32 resetParm) |
Function to reset the Hardware. More... | |
GLOBAL void | saHwShutdown (agsaRoot_t *agRoot) |
Function to shutdown the Hardware. More... | |
GLOBAL void | siChipReset (agsaRoot_t *agRoot) |
Generic Reset. More... | |
GLOBAL bit32 | siChipResetV (agsaRoot_t *agRoot, bit32 signature) |
Function to Reset the SPC V Hardware. More... | |
GLOBAL void | siChipResetSpc (agsaRoot_t *agRoot) |
Function to Reset the SPC Hardware. More... | |
GLOBAL bit32 | siSoftReset (agsaRoot_t *agRoot, bit32 signature) |
GLOBAL bit32 | siSpcSoftReset (agsaRoot_t *agRoot, bit32 signature) |
Function to soft/FW reset the SPC. More... | |
GLOBAL bit32 | siBar4Shift (agsaRoot_t *agRoot, bit32 shiftValue) |
Function to do BAR shifting. More... | |
GLOBAL void | siUpdateBarOffsetTable (agsaRoot_t *agRoot, bit32 Spc_Type) |
GLOBAL bit32 | siHalRegReadExt (agsaRoot_t *agRoot, bit32 generic, bit32 regOffset) |
GLOBAL void | siHalRegWriteExt (agsaRoot_t *agRoot, bit32 generic, bit32 regOffset, bit32 regValue) |
GLOBAL void | siPCITriger (agsaRoot_t *agRoot) |
GLOBAL bit32 | siGetPciBar (agsaRoot_t *agRoot) |
GLOBAL bit32 | siGetTableOffset (agsaRoot_t *agRoot, bit32 TableOffsetInTable) |
GLOBAL void | siCheckQs (agsaRoot_t *agRoot) |
GLOBAL void | siPciCpyMem (agsaRoot_t *agRoot, bit32 soffset, const void *dst, bit32 DWcount, bit32 busBaseNumber) |
Variables | |
bit32 | gWait_3 = 3 |
bit32 | gWait_2 = 2 |
bit32 | gWaitmSec = 0 |
agsaBarOffset_t | SPCTable [] |
agsaBarOffset_t | SPC_V_Table [] |
The file implements the functions for reset and shutdown.
Definition in file sahw.c.
__FBSDID | ( | "$FreeBSD$" | ) |
GLOBAL void saHwReset | ( | agsaRoot_t * | agRoot, |
bit32 | resetType, | ||
bit32 | resetParm | ||
) |
Function to reset the Hardware.
The saHwReset() function is called to reset the SAS/SATA HW controller All outstanding I/Os are explicitly aborted. This API need to access before saInitialize() so checking saRoot is needed
agRoot | Handles for this instance of SAS/SATA hardware |
resetType | The reset type |
resetParm | The paramter passed for reset operation |
Definition at line 87 of file sahw.c.
References agFALSE, agNULL, AGSA_CHIP_RESET, AGSA_RC_HDA_NO_FW_RUNNING, AGSA_RC_SUCCESS, AGSA_SOFT_RESET, agTRUE, BOOTTLOADERHDA_IDLE, CHIP_RESET_FW, CHIP_RESETTING, agsaLLRoot_s::chipStatus, agsaFatalErrorInfo_s::errorInfo0, agsaFatalErrorInfo_s::errorInfo1, agsaFatalErrorInfo_s::errorInfo2, agsaFatalErrorInfo_s::errorInfo3, mpiHostLLConfigDescriptor_s::FatalErrorDumpLength0, mpiHostLLConfigDescriptor_s::FatalErrorDumpLength1, mpiHostLLConfigDescriptor_s::FatalErrorDumpOffset0, mpiHostLLConfigDescriptor_s::FatalErrorDumpOffset1, GEN_MSGU_SCRATCH_PAD_0, GEN_MSGU_SCRATCH_PAD_1, GEN_MSGU_SCRATCH_PAD_2, GEN_MSGU_SCRATCH_PAD_3, HDA_CMD_CODE_OFFSET, HDA_RSP_OFFSET1MB, HDA_STATUS_BITS, hpDBG_VERY_LOUD, agsaLLRoot_s::hwConfig, agsaLLRoot_s::mainConfigTable, agsaSwConfig_s::maxActiveIOs, agsaLLRoot_s::memoryAllocated, MSGU_SCRATCH_PAD_0, MSGU_SCRATCH_PAD_1, MSGU_SCRATCH_PAD_2, MSGU_SCRATCH_PAD_3, OSSA_FAILURE, OSSA_HW_EVENT_MALFUNCTION, OSSA_HW_EVENT_RESET_COMPLETE, OSSA_HW_EVENT_RESET_START, OSSA_SUCCESS, ossaHwCB(), ossaHwRegReadExt(), PCIBAR3, REG_DUMP_NUM0, REG_DUMP_NUM1, agsaFatalErrorInfo_s::regDumpBusBaseNum0, agsaFatalErrorInfo_s::regDumpBusBaseNum1, agsaFatalErrorInfo_s::regDumpLen0, agsaFatalErrorInfo_s::regDumpLen1, agsaFatalErrorInfo_s::regDumpOffset0, agsaFatalErrorInfo_s::regDumpOffset1, mpiHostLLConfigDescriptor_s::regDumpPCIBAR, agsaLLRoot_s::registerDump0, agsaLLRoot_s::registerDump1, agsaLLRoot_s::ResetFailed, agsaLLRoot_s::ResetStartTick, SA_ASSERT, SA_DBG1, saCountActiveIORequests(), saGetControllerStatus(), saSystemInterruptsActive(), SCRATCH_PAD1_ERR, SCRATCH_PAD1_V_BOOTLDR_ERROR, SCRATCH_PAD1_V_ERROR_STATE, SCRATCH_PAD1_V_READY, SCRATCH_PAD2_ERR, SCRATCH_PAD_STATE_MASK, agsaContext_s::sdkData, SHIFT8, si_memset(), siChipReset(), siChipResetV(), siDumpActiveIORequests(), siGetRegisterDumpGSM(), siHalRegReadExt(), siInitResources(), siSpcSoftReset(), smIS_SPC(), smIS_SPCV(), smTraceFuncEnter, smTraceFuncExit, SPC_SOFT_RESET_SIGNATURE, agsaLLRoot_s::swConfig, agsaLLRoot_s::sysIntsActive, agsaLLRoot_s::timeTick, and agsaLLRoot_s::usecsPerTick.
Referenced by tiCOMReset().
GLOBAL void saHwShutdown | ( | agsaRoot_t * | agRoot | ) |
Function to shutdown the Hardware.
The saHwShutdown() function is called to discontinue the use of the SAS/SATA hardware. Upon return, the SASA/SAT hardware instance does not generate any interrupts or any other bus accesses. All LL Layer hardware host resources (i.e. both cached and noncached memory) are no longer owned by the LL Layer.
agRoot | handles for this instance of SAS/SATA hardware |
Definition at line 395 of file sahw.c.
References agNULL, mpiOCQueue_s::agRoot, CHIP_SHUTDOWN, agsaLLRoot_s::chipStatus, mpiOCQueue_s::consumerIdx, GEN_MSGU_SCRATCH_PAD_0, GEN_MSGU_SCRATCH_PAD_1, GEN_MSGU_SCRATCH_PAD_2, GEN_MSGU_SCRATCH_PAD_3, agsaSwConfig_s::hostDirectAccessMode, agsaSwConfig_s::hostDirectAccessSupport, hpDBG_VERY_LOUD, agsaLLRoot_s::hwConfig, agsaLLRoot_s::memoryAllocated, mpiUnInitConfigTable(), MSGU_SCRATCH_PAD_0, MSGU_SCRATCH_PAD_1, MSGU_SCRATCH_PAD_2, MSGU_SCRATCH_PAD_3, agsaQueueConfig_s::numOutboundQueues, agsaLLRoot_s::outboundQueue, mpiOCQueue_s::piPointer, mpiOCQueue_s::producerIdx, agsaLLRoot_s::QueueConfig, SA_ASSERT, SA_DBG1, SA_DBG4, agsaContext_s::sdkData, siChipResetV(), siHalRegReadExt(), siInitResources(), siScratchDump(), siSpcSoftReset(), smIS_SPC(), smIS_SPCV(), smTraceFuncEnter, smTraceFuncExit, SPC_HDASOFT_RESET_SIGNATURE, SPC_SOFT_RESET_SIGNATURE, agsaLLRoot_s::swConfig, and agsaLLRoot_s::usecsPerTick.
Referenced by tiCOMShutDown().
LOCAL bit32 si_V_SoftReset | ( | agsaRoot_t * | agRoot, |
bit32 | signature | ||
) |
Definition at line 891 of file sahw.c.
References AGSA_RC_SUCCESS, SA_DBG1, siChipResetV(), SPC_HDASOFT_RESET_SIGNATURE, and SPC_SOFT_RESET_SIGNATURE.
Referenced by siSoftReset().
GLOBAL bit32 siBar4Shift | ( | agsaRoot_t * | agRoot, |
bit32 | shiftValue | ||
) |
Function to do BAR shifting.
The siBarShift() function is called to shift BAR base address
agRoot | handles for this instance of SAS/SATA hardware |
shiftValue | shifting value |
Definition at line 1333 of file sahw.c.
References AGSA_RC_FAILURE, AGSA_RC_SUCCESS, hpDBG_VERY_LOUD, MAKE_MODULO, ossaHwRegReadExt(), ossaHwRegWriteExt(), ossaStallThread(), PCIBAR0, PCIBAR1, SA_DBG1, SA_DBG2, smIS_SPC(), smIS_SPCV(), smTrace, smTraceFuncEnter, smTraceFuncExit, SPC_IBW_AXI_TRANSLATION_LOW, V_MEMBASE_II_ShiftRegister, WAIT_INCREMENT, and WAIT_SECONDS.
Referenced by mpiInitialize(), saInitialize(), saLocalPhyControl(), siGetForensicData(), siGSMDump(), siSpcSoftReset(), and siSpcSoftResetRDYChk().
GLOBAL void siCheckQs | ( | agsaRoot_t * | agRoot | ) |
Definition at line 2952 of file sahw.c.
References mpiOCQueue_s::agRoot, mpiICQueue_s::agRoot, mpiICQueue_s::ciPointer, mpiOCQueue_s::consumerIdx, mpiICQueue_s::consumerIdx, agsaLLRoot_s::inboundQueue, mpiOCQueue_s::numElements, mpiICQueue_s::numElements, agsaQueueConfig_s::numInboundQueues, agsaQueueConfig_s::numOutboundQueues, agsaLLRoot_s::outboundQueue, mpiOCQueue_s::piPointer, mpiOCQueue_s::producerIdx, mpiICQueue_s::producerIdx, agsaLLRoot_s::QueueConfig, SA_DBG1, and agsaContext_s::sdkData.
GLOBAL void siChipReset | ( | agsaRoot_t * | agRoot | ) |
Generic Reset.
The siChipReset() function is called to reset the SPC chip. Upon return, the SPC chip got reset. The PCIe bus got reset.
agRoot | handles for this instance of SAS/SATA hardware |
Definition at line 528 of file sahw.c.
References agNULL, hpDBG_VERY_LOUD, SA_ASSERT, SA_DBG1, agsaContext_s::sdkData, siChipResetSpc(), siChipResetV(), smIS_SPC(), smTraceFuncEnter, smTraceFuncExit, and SPC_SOFT_RESET_SIGNATURE.
Referenced by saHwReset().
GLOBAL void siChipResetSpc | ( | agsaRoot_t * | agRoot | ) |
Function to Reset the SPC Hardware.
The siChipResetSpc() function is called to reset the SPC chip. Upon return, the SPC chip got reset. The PCIe bus got reset.
agRoot | handles for this instance of SAS/SATA hardware |
Definition at line 835 of file sahw.c.
References hpDBG_VERY_LOUD, ossaHwRegReadExt(), ossaHwRegWriteExt(), ossaStallThread(), PCIBAR2, SA_DBG1, smTraceFuncEnter, smTraceFuncExit, SPC_REG_RESET, SPC_REG_RESET_DEVICE, and WAIT_INCREMENT.
Referenced by siChipReset().
GLOBAL bit32 siChipResetV | ( | agsaRoot_t * | agRoot, |
bit32 | signature | ||
) |
Function to Reset the SPC V Hardware.
The siChipResetV() function is called to reset the SPC chip. Upon return, the SPC chip got reset. The PCIe bus got reset.
agRoot | handles for this instance of SAS/SATA hardware |
Definition at line 569 of file sahw.c.
References AGSA_RC_FAILURE, AGSA_RC_SUCCESS, hpDBG_LOUD, hpDBG_VERY_LOUD, MAKE_MODULO, MSGU_SCRATCH_PAD_1, ossaHwRegReadExt(), ossaHwRegWriteExt(), ossaStallThread(), ossaTimeStamp64(), PCIBAR0, SA_DBG1, SCRATCH_PAD1_V_BOOTSTATE_CRIT_ERROR, SCRATCH_PAD1_V_BOOTSTATE_HDA_BOOTSTRAP, SCRATCH_PAD1_V_BOOTSTATE_HDA_SEEPROM, SCRATCH_PAD1_V_BOOTSTATE_HDA_SOFTRESET, SCRATCH_PAD1_V_BOOTSTATE_MASK, SCRATCH_PAD1_V_ERROR_STATE, SCRATCH_PAD1_V_ILA_MASK, SCRATCH_PAD1_V_IOP0_MASK, SCRATCH_PAD1_V_IOP1_MASK, SCRATCH_PAD1_V_RAAE_MASK, smIS_SPCV_2_IOP(), smTrace, smTraceFuncEnter, smTraceFuncExit, SPC_HDASOFT_RESET_SIGNATURE, SPC_SOFT_RESET_SIGNATURE, SPC_V_HDA_RESPONSE_OFFSET, SPC_V_HDAR_IDLE, SPC_V_HDAR_RSPCODE_MASK, SPCv_Reset_Read_ChipResetOccurred, SPCv_Reset_Read_Mask, SPCv_Reset_Read_NoReset, SPCv_Reset_Read_NormalResetOccurred, SPCv_Reset_Read_SoftResetHDAOccurred, SPCv_Reset_Write_NormalReset, SPCv_Reset_Write_SoftResetHDA, V_SoftResetRegister, and WAIT_INCREMENT.
Referenced by saHwReset(), saHwShutdown(), saInitialize(), si_V_SoftReset(), and siChipReset().
GLOBAL bit32 siGetPciBar | ( | agsaRoot_t * | agRoot | ) |
Definition at line 2915 of file sahw.c.
References GEN_MSGU_SCRATCH_PAD_0, mpiGetPCIBarIndex(), MSGU_SCRATCH_PAD_0, SCRATCH_PAD0_BAR_MASK, SHIFT26, and siHalRegReadExt().
Referenced by mpiInitialize(), siFatalErrorBuffer(), siGetTableOffset(), and siNonFatalErrorBuffer().
GLOBAL bit32 siGetTableOffset | ( | agsaRoot_t * | agRoot, |
bit32 | TableOffsetInTable | ||
) |
Definition at line 2929 of file sahw.c.
References GEN_MSGU_SCRATCH_PAD_0, MSGU_SCRATCH_PAD_0, ossaHwRegReadExt(), SA_DBG4, SCRATCH_PAD0_OFFSET_MASK, siGetPciBar(), and siHalRegReadExt().
Referenced by siFatalErrorBuffer(), siNonFatalErrorBuffer(), and siWaitForFatalTransfer().
GLOBAL bit32 siHalRegReadExt | ( | agsaRoot_t * | agRoot, |
bit32 | generic, | ||
bit32 | regOffset | ||
) |
Definition at line 2818 of file sahw.c.
References agNULL, ossaHwRegRead(), ossaHwRegReadExt(), SA_ASSERT, and WHATTABLE.
Referenced by mpiInitialize(), mpiReadCALTable(), mpiReadGSTable(), mpiUnInitConfigTable(), mpiWaitForConfigTable(), mpiWrAnalogSetupTable(), mpiWrIntVecTable(), mpiWriteCALTable(), mpiWrPhyAttrbTable(), saDelayedInterruptHandler(), saGetControllerInfo(), saGetControllerStatus(), saHwReset(), saHwShutdown(), saTimerTick(), siDisableLegacy_V_Interrupts(), siFatalErrorBuffer(), siFatalInterruptHandler(), siGetPciBar(), siGetTableOffset(), siOurLegacy_V_Interrupt(), siProcessOBMsg(), siReenableLegacy_V_Interrupts(), siReenableMSIInterrupts(), siSpcGetErrorContent(), and siSpcvGetErrorContent().
GLOBAL void siHalRegWriteExt | ( | agsaRoot_t * | agRoot, |
bit32 | generic, | ||
bit32 | regOffset, | ||
bit32 | regValue | ||
) |
Definition at line 2858 of file sahw.c.
References agNULL, ossaHwRegWrite(), ossaHwRegWriteExt(), SA_ASSERT, SA_DBG6, and WHATTABLE.
Referenced by mpiInitialize(), mpiUnInitConfigTable(), saSystemInterruptsActive(), siReenableLegacyInterrupts(), siReenableMSIInterrupts(), and siReenableMSIXInterrupts().
GLOBAL void siPciCpyMem | ( | agsaRoot_t * | agRoot, |
bit32 | soffset, | ||
const void * | dst, | ||
bit32 | DWcount, | ||
bit32 | busBaseNumber | ||
) |
Definition at line 2991 of file sahw.c.
References ossaHwRegReadExt(), SA_ASSERT, and SA_DBG1.
Referenced by siFatalErrorBuffer().
GLOBAL void siPCITriger | ( | agsaRoot_t * | agRoot | ) |
Definition at line 2907 of file sahw.c.
References ossaHwRegReadExt(), PCIBAR0, PCIE_TRIGGER_ON_REGISTER_READ, and SA_DBG1.
Referenced by mpiParseOBIomb(), mpiSSPEvent(), and saInitialize().
GLOBAL bit32 siSoftReset | ( | agsaRoot_t * | agRoot, |
bit32 | signature | ||
) |
Definition at line 872 of file sahw.c.
References AGSA_RC_SUCCESS, si_V_SoftReset(), siSpcSoftReset(), and smIS_SPCV().
Referenced by saInitialize().
GLOBAL bit32 siSpcSoftReset | ( | agsaRoot_t * | agRoot, |
bit32 | signature | ||
) |
Function to soft/FW reset the SPC.
The siSpcSoftReset() function is called to soft reset SPC. Upon return, the SPC FW got reset. The PCIe bus is not touched.
agRoot | handles for this instance of SAS/SATA hardware |
signature | soft reset normal signature or HDA soft reset signature |
Definition at line 926 of file sahw.c.
References agNULL, AGSA_RC_FAILURE, AGSA_RC_SUCCESS, GPIO_ADDR_BASE, GPIO_GPIO_0_0UTPUT_CTL_OFFSET, GSM_ADDR_BASE, GSM_CONFIG_RESET, GSM_CONFIG_RESET_VALUE, GSM_READ_ADDR_PARITY_CHECK, GSM_READ_ADDR_PARITY_INDIC, GSM_WRITE_ADDR_PARITY_CHECK, GSM_WRITE_ADDR_PARITY_INDIC, GSM_WRITE_DATA_PARITY_CHECK, GSM_WRITE_DATA_PARITY_INDIC, hpDBG_VERY_LOUD, MAKE_MODULO, MBIC_AAP1_ADDR_BASE, MBIC_IOP_ADDR_BASE, MBIC_NMI_ENABLE_VPE0_AAP1, MBIC_NMI_ENABLE_VPE0_IOP, mpiWaitForConfigTable(), MSGU_HOST_SCRATCH_PAD_0, MSGU_ODCR, MSGU_ODMR, MSGU_SCRATCH_PAD_0, MSGU_SCRATCH_PAD_1, MSGU_SCRATCH_PAD_2, MSGU_SCRATCH_PAD_3, ODCR_CLEAR_ALL, ODMR_CLEAR_ALL, ossaHwRegRead(), ossaHwRegReadExt(), ossaHwRegWrite(), ossaHwRegWriteExt(), ossaStallThread(), PCIBAR1, PCIBAR2, PCIE_ERROR_INTERRUPT, PCIE_ERROR_INTERRUPT_ENABLE, PCIE_EVENT_INTERRUPT, PCIE_EVENT_INTERRUPT_ENABLE, RAM_ECC_DB_ERR, SA_ASSERT, SA_DBG1, SCRATCH_PAD1_RST, agsaContext_s::sdkData, siBar4Shift(), siSpcSoftResetRDYChk(), smTrace, smTraceFuncEnter, smTraceFuncExit, SPC_HDASOFT_RESET_SIGNATURE, SPC_REG_RESET, SPC_REG_RESET_BDMA_CORE, SPC_REG_RESET_OSSP, SPC_REG_RESET_PCS_AAP1_SS, SPC_REG_RESET_PCS_IOP_SS, SPC_SOFT_RESET_SIGNATURE, SPC_TOP_LEVEL_ADDR_BASE, WAIT_INCREMENT, and WAIT_SECONDS.
Referenced by saHwReset(), saHwShutdown(), saInitialize(), and siSoftReset().
LOCAL bit32 siSpcSoftResetRDYChk | ( | agsaRoot_t * | agRoot | ) |
Function to check FW is ready for soft reset.
The siSpcSoftResetRDYChk() function is called to check status of FW
agRoot | handles for this instance of SAS/SATA hardware |
Definition at line 2640 of file sahw.c.
References AGSA_RC_FAILURE, AGSA_RC_SUCCESS, BOOTTLOADERHDA_IDLE, HDA_CMD_CODE_OFFSET, HDA_RSP_OFFSET1MB, HDA_STATUS_BITS, MSGU_SCRATCH_PAD_0, MSGU_SCRATCH_PAD_1, MSGU_SCRATCH_PAD_2, MSGU_SCRATCH_PAD_3, ONE_HUNDRED_MILLISECS, ossaHwRegRead(), ossaHwRegReadExt(), ossaHwRegWriteExt(), ossaStallThread(), PCIBAR2, PCIBAR3, RB6_ACCESS_REG, RB6_MAGIC_NUMBER_RST, SA_DBG1, SCRATCH_PAD1_AAP_ERROR_STATE, SCRATCH_PAD1_FW_INIT_ERR, SCRATCH_PAD2_FWRDY_RST, siBar4Shift(), SPC_RB6_OFFSET, and WAIT_SECONDS.
Referenced by siSpcSoftReset().
GLOBAL void siUpdateBarOffsetTable | ( | agsaRoot_t * | agRoot, |
bit32 | Spc_Type | ||
) |
agsaRoot | Pointer to a data structure containing both application and LL layer context handles |
Spc_type | Device Id of hardware |
Return: None
Definition at line 2768 of file sahw.c.
References agsaBarOffset_s::Bar, agsaBarOffset_s::Generic, hpDBG_VERY_LOUD, agsaBarOffset_s::Length, agsaBarOffset_s::Offset, SA_DBG1, SA_DBG4, SA_DBG5, agsaContext_s::sdkData, si_memcpy(), smTrace, smTraceFuncEnter, smTraceFuncExit, SPC_V_Table, agsaLLRoot_s::SpcBarOffset, SPCTable, and VEN_DEV_SPC.
Referenced by saInitialize().
bit32 gWait_2 = 2 |
Definition at line 55 of file sahw.c.
Referenced by mpiInitialize(), mpiUnInitConfigTable(), mpiWaitForConfigTable(), and saGetControllerInfo().
agsaBarOffset_t SPC_V_Table[] |
Definition at line 2736 of file sahw.c.
Referenced by siUpdateBarOffsetTable().
agsaBarOffset_t SPCTable[] |