soc/intel/common/lpss: Add lpss_is_controller_in_reset
Add new API function lpss_is_controller_in_reset that returns whether the LPSS controller is in reset. Also, add lpss.c to smm stage so that lpss_is_controller_in_reset can be used in smihandler. BUG=b:64030366 Change-Id: I0fe5c2890ee799b08482e487296a483fa8d42461 Signed-off-by: Furquan Shaikh <furquan@chromium.org> Reviewed-on: https://review.coreboot.org/20885 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org>
This commit is contained in:
parent
3406dd64c3
commit
3b90b5f129
|
@ -27,4 +27,7 @@ void lpss_reset_release(uintptr_t base);
|
||||||
*/
|
*/
|
||||||
void lpss_clk_update(uintptr_t base, uint32_t clk_m_val, uint32_t clk_n_val);
|
void lpss_clk_update(uintptr_t base, uint32_t clk_m_val, uint32_t clk_n_val);
|
||||||
|
|
||||||
|
/* Check if controller is in reset. */
|
||||||
|
bool lpss_is_controller_in_reset(uintptr_t base);
|
||||||
|
|
||||||
#endif /* SOC_INTEL_COMMON_BLOCK_LPSS_H */
|
#endif /* SOC_INTEL_COMMON_BLOCK_LPSS_H */
|
||||||
|
|
|
@ -2,3 +2,4 @@ bootblock-$(CONFIG_SOC_INTEL_COMMON_BLOCK_LPSS) += lpss.c
|
||||||
romstage-$(CONFIG_SOC_INTEL_COMMON_BLOCK_LPSS) += lpss.c
|
romstage-$(CONFIG_SOC_INTEL_COMMON_BLOCK_LPSS) += lpss.c
|
||||||
verstage-$(CONFIG_SOC_INTEL_COMMON_BLOCK_LPSS) += lpss.c
|
verstage-$(CONFIG_SOC_INTEL_COMMON_BLOCK_LPSS) += lpss.c
|
||||||
ramstage-$(CONFIG_SOC_INTEL_COMMON_BLOCK_LPSS) += lpss.c
|
ramstage-$(CONFIG_SOC_INTEL_COMMON_BLOCK_LPSS) += lpss.c
|
||||||
|
smm-$(CONFIG_SOC_INTEL_COMMON_BLOCK_LPSS) += lpss.c
|
||||||
|
|
|
@ -39,6 +39,17 @@
|
||||||
/* DMA Software Reset Control */
|
/* DMA Software Reset Control */
|
||||||
#define LPSS_DMA_RST_RELEASE (1 << 2)
|
#define LPSS_DMA_RST_RELEASE (1 << 2)
|
||||||
|
|
||||||
|
bool lpss_is_controller_in_reset(uintptr_t base)
|
||||||
|
{
|
||||||
|
uint8_t *addr = (void *)base;
|
||||||
|
uint32_t val = read32(addr + LPSS_RESET_CTL_REG);
|
||||||
|
|
||||||
|
if (val == 0xFFFFFFFF)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
return !(val & LPSS_CNT_RST_RELEASE);
|
||||||
|
}
|
||||||
|
|
||||||
void lpss_reset_release(uintptr_t base)
|
void lpss_reset_release(uintptr_t base)
|
||||||
{
|
{
|
||||||
uint8_t *addr = (void *)base;
|
uint8_t *addr = (void *)base;
|
||||||
|
|
Loading…
Reference in New Issue