mirror of
https://gitee.com/Vancouver2017/luban-lite.git
synced 2025-12-26 22:18:54 +00:00
v1.2.1
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2023, ArtInChip Technology Co., Ltd
|
||||
* Copyright (c) 2023-2025, ArtInChip Technology Co., Ltd
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
@@ -320,6 +320,18 @@ void hal_sdmc_set_phase(struct aic_sdmc_host *host, u32 drv, u32 smp)
|
||||
sdmc_writel(host, SDMC_DLYCTRL, temp);
|
||||
}
|
||||
|
||||
void hal_sdmc_set_delay(struct aic_sdmc_host *host, u32 drv, u32 smp)
|
||||
{
|
||||
u32 temp = 0;
|
||||
|
||||
temp = sdmc_readl(host, SDMC_DLYCTRL);
|
||||
temp &= ~SDMC_DLYCTRL_CLK_DRV_DLY_MASK;
|
||||
temp &= ~SDMC_DLYCTRL_CLK_SMP_DLY_MASK;
|
||||
temp |= drv << SDMC_DLYCTRL_CLK_DRV_DLY_SHIFT |
|
||||
smp << SDMC_DLYCTRL_CLK_SMP_DLY_SHIFT;
|
||||
sdmc_writel(host, SDMC_DLYCTRL, temp);
|
||||
}
|
||||
|
||||
void hal_sdmc_set_buswidth(struct aic_sdmc_host *host, u32 buswidth)
|
||||
{
|
||||
u32 val = 0;
|
||||
@@ -402,6 +414,33 @@ void hal_sdmc_fifo_init(struct aic_sdmc_host *host, u32 *thd)
|
||||
(512 << SDMC_CTC_CARDTHR_SHIFT) | SDMC_CTC_CARDRDTHR_EN);
|
||||
}
|
||||
|
||||
void hal_sdmc_soft_reset(struct aic_sdmc_host *host)
|
||||
{
|
||||
u32 temp = 0;
|
||||
|
||||
temp = sdmc_readl(host, SDMC_INTEN);
|
||||
sdmc_writel(host, SDMC_INTEN, 0);
|
||||
|
||||
sdmc_writel(host, SDMC_IDMAINTEN, 0);
|
||||
|
||||
if (hal_sdmc_reset(host, SDMC_HCTRL1_RESET_ALL)) {
|
||||
pr_err("Failed to reset!\n");
|
||||
return;
|
||||
}
|
||||
|
||||
sdmc_writel(host, SDMC_INTEN, temp);
|
||||
|
||||
hal_sdmc_set_cmd(host, SDMC_CMD_PRV_DAT_WAIT | SDMC_CMD_UPD_CLK | SDMC_CMD_START);
|
||||
|
||||
if (hal_sdmc_wait_cmd_started(host)) {
|
||||
pr_err("Failed to wait cmd started!\n");
|
||||
return;
|
||||
}
|
||||
|
||||
temp = sdmc_readl(host, SDMC_OINTST);
|
||||
sdmc_writel(host, SDMC_OINTST, temp);
|
||||
}
|
||||
|
||||
void hal_sdmc_init(struct aic_sdmc_host *host)
|
||||
{
|
||||
sdmc_writel(host, SDMC_OINTST, 0xFFFFFFFF);
|
||||
|
||||
Reference in New Issue
Block a user