From: <jh80.chung@samsung.com>
To: "'Weijie Gao'" <weijie.gao@mediatek.com>, <u-boot@lists.denx.de>
Cc: "'GSS_MTK_Uboot_upstream'" <GSS_MTK_Uboot_upstream@mediatek.com>,
"'Peng Fan'" <peng.fan@nxp.com>
Subject: RE: [PATCH 05/31] mmc: mediatek: add support for MediaTek MT7891/MT7986 SoCs
Date: Thu, 11 Aug 2022 14:50:10 +0900 [thread overview]
Message-ID: <000701d8ad46$38041fe0$a80c5fa0$@samsung.com> (raw)
In-Reply-To: <b10884041df3c521e587e33f8aacb1770ddd83be.1659581119.git.weijie.gao@mediatek.com>
> -----Original Message-----
> From: Weijie Gao [mailto:weijie.gao@mediatek.com]
> Sent: Thursday, August 4, 2022 12:35 PM
> To: u-boot@lists.denx.de
> Cc: GSS_MTK_Uboot_upstream; Peng Fan; Jaehoon Chung; Weijie Gao
> Subject: [PATCH 05/31] mmc: mediatek: add support for MediaTek MT7891/MT7986 SoCs
>
> This patch adds eMMC and SDXC support for MediaTek MT7981/MT7986 SoCs
>
> Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
Best Regards,
Jaehoon Chung
> ---
> drivers/mmc/mtk-sd.c | 68 ++++++++++++++++++++++++++++++++++----------
> 1 file changed, 53 insertions(+), 15 deletions(-)
>
> diff --git a/drivers/mmc/mtk-sd.c b/drivers/mmc/mtk-sd.c
> index e61e8cf4b9..b206b0a085 100644
> --- a/drivers/mmc/mtk-sd.c
> +++ b/drivers/mmc/mtk-sd.c
> @@ -1496,7 +1496,12 @@ static void msdc_init_hw(struct msdc_host *host)
> /* Enable data & cmd interrupts */
> writel(DATA_INTS_MASK | CMD_INTS_MASK, &host->base->msdc_inten);
>
> - writel(0, tune_reg);
> + if (host->top_base) {
> + writel(0, &host->top_base->emmc_top_control);
> + writel(0, &host->top_base->emmc_top_cmd);
> + } else {
> + writel(0, tune_reg);
> + }
> writel(0, &host->base->msdc_iocon);
>
> if (host->r_smpl)
> @@ -1507,9 +1512,14 @@ static void msdc_init_hw(struct msdc_host *host)
> writel(0x403c0046, &host->base->patch_bit0);
> writel(0xffff4089, &host->base->patch_bit1);
>
> - if (host->dev_comp->stop_clk_fix)
> + if (host->dev_comp->stop_clk_fix) {
> clrsetbits_le32(&host->base->patch_bit1, MSDC_PB1_STOP_DLY_M,
> 3 << MSDC_PB1_STOP_DLY_S);
> + clrbits_le32(&host->base->sdc_fifo_cfg,
> + SDC_FIFO_CFG_WRVALIDSEL);
> + clrbits_le32(&host->base->sdc_fifo_cfg,
> + SDC_FIFO_CFG_RDVALIDSEL);
> + }
>
> if (host->dev_comp->busy_check)
> clrbits_le32(&host->base->patch_bit1, (1 << 7));
> @@ -1544,15 +1554,28 @@ static void msdc_init_hw(struct msdc_host *host)
> }
>
> if (host->dev_comp->data_tune) {
> - setbits_le32(tune_reg,
> - MSDC_PAD_TUNE_RD_SEL | MSDC_PAD_TUNE_CMD_SEL);
> - clrsetbits_le32(&host->base->patch_bit0,
> - MSDC_INT_DAT_LATCH_CK_SEL_M,
> - host->latch_ck <<
> - MSDC_INT_DAT_LATCH_CK_SEL_S);
> + if (host->top_base) {
> + setbits_le32(&host->top_base->emmc_top_control,
> + PAD_DAT_RD_RXDLY_SEL);
> + clrbits_le32(&host->top_base->emmc_top_control,
> + DATA_K_VALUE_SEL);
> + setbits_le32(&host->top_base->emmc_top_cmd,
> + PAD_CMD_RD_RXDLY_SEL);
> + } else {
> + setbits_le32(tune_reg,
> + MSDC_PAD_TUNE_RD_SEL | MSDC_PAD_TUNE_CMD_SEL);
> + clrsetbits_le32(&host->base->patch_bit0,
> + MSDC_INT_DAT_LATCH_CK_SEL_M,
> + host->latch_ck <<
> + MSDC_INT_DAT_LATCH_CK_SEL_S);
> + }
> } else {
> /* choose clock tune */
> - setbits_le32(tune_reg, MSDC_PAD_TUNE_RXDLYSEL);
> + if (host->top_base)
> + setbits_le32(&host->top_base->emmc_top_control,
> + PAD_RXDLY_SEL);
> + else
> + setbits_le32(tune_reg, MSDC_PAD_TUNE_RXDLYSEL);
> }
>
> if (host->dev_comp->builtin_pad_ctrl) {
> @@ -1604,12 +1627,6 @@ static void msdc_init_hw(struct msdc_host *host)
> clrsetbits_le32(&host->base->sdc_cfg, SDC_CFG_DTOC_M,
> 3 << SDC_CFG_DTOC_S);
>
> - if (host->dev_comp->stop_clk_fix) {
> - clrbits_le32(&host->base->sdc_fifo_cfg,
> - SDC_FIFO_CFG_WRVALIDSEL);
> - clrbits_le32(&host->base->sdc_fifo_cfg,
> - SDC_FIFO_CFG_RDVALIDSEL);
> - }
>
> host->def_tune_para.iocon = readl(&host->base->msdc_iocon);
> host->def_tune_para.pad_tune = readl(&host->base->pad_tune);
> @@ -1792,6 +1809,25 @@ static const struct msdc_compatible mt7623_compat = {
> .enhance_rx = false
> };
>
> +static const struct msdc_compatible mt7986_compat = {
> + .clk_div_bits = 12,
> + .pad_tune0 = true,
> + .async_fifo = true,
> + .data_tune = true,
> + .busy_check = true,
> + .stop_clk_fix = true,
> + .enhance_rx = true,
> +};
> +
> +static const struct msdc_compatible mt7981_compat = {
> + .clk_div_bits = 12,
> + .pad_tune0 = true,
> + .async_fifo = true,
> + .data_tune = true,
> + .busy_check = true,
> + .stop_clk_fix = true,
> +};
> +
> static const struct msdc_compatible mt8512_compat = {
> .clk_div_bits = 12,
> .pad_tune0 = true,
> @@ -1824,6 +1860,8 @@ static const struct udevice_id msdc_ids[] = {
> { .compatible = "mediatek,mt7621-mmc", .data = (ulong)&mt7621_compat },
> { .compatible = "mediatek,mt7622-mmc", .data = (ulong)&mt7622_compat },
> { .compatible = "mediatek,mt7623-mmc", .data = (ulong)&mt7623_compat },
> + { .compatible = "mediatek,mt7986-mmc", .data = (ulong)&mt7986_compat },
> + { .compatible = "mediatek,mt7981-mmc", .data = (ulong)&mt7981_compat },
> { .compatible = "mediatek,mt8512-mmc", .data = (ulong)&mt8512_compat },
> { .compatible = "mediatek,mt8516-mmc", .data = (ulong)&mt8516_compat },
> { .compatible = "mediatek,mt8183-mmc", .data = (ulong)&mt8183_compat },
> --
> 2.17.1
next prev parent reply other threads:[~2022-08-11 5:50 UTC|newest]
Thread overview: 100+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-04 3:34 [PATCH 00/31] Add support for MediaTek MT7981/MT7986 SoCs Weijie Gao
2022-08-04 3:34 ` [PATCH 01/31] arm: mediatek: add support for MediaTek MT7986 SoC Weijie Gao
2022-08-04 8:37 ` Daniel Golle
2022-08-04 8:50 ` Weijie Gao
2022-08-05 8:43 ` Weijie Gao
2022-08-06 16:09 ` Daniel Golle
2022-08-08 1:37 ` Weijie Gao
2022-08-04 3:34 ` [PATCH 02/31] arm: mediatek: add support for MediaTek MT7981 SoC Weijie Gao
2022-08-04 13:57 ` Simon Glass
2022-08-08 2:17 ` Weijie Gao
2022-08-08 19:26 ` Simon Glass
2022-08-04 3:35 ` [PATCH 03/31] board: mediatek: add MT7986 reference boards Weijie Gao
2022-08-04 13:57 ` Simon Glass
2022-08-09 9:10 ` Daniel Golle
2022-08-12 11:02 ` Weijie Gao
2022-08-12 11:29 ` Daniel Golle
2022-08-04 3:35 ` [PATCH 04/31] board: mediatek: add MT7981 " Weijie Gao
2022-08-04 13:57 ` Simon Glass
2022-08-04 3:35 ` [PATCH 05/31] mmc: mediatek: add support for MediaTek MT7891/MT7986 SoCs Weijie Gao
2022-08-04 13:57 ` Simon Glass
2022-08-08 2:22 ` Weijie Gao
2022-08-11 5:50 ` jh80.chung [this message]
2022-08-04 3:35 ` [PATCH 06/31] net: mediatek: use a struct to cover variations of all SoCs Weijie Gao
2022-08-04 13:56 ` Simon Glass
2022-08-08 2:28 ` Weijie Gao
2022-08-04 3:35 ` [PATCH 07/31] net: mediatek: stop using bitfileds for DMA descriptors Weijie Gao
2022-08-04 13:56 ` Simon Glass
2022-08-06 17:50 ` Ramon Fried
2022-08-08 2:29 ` Weijie Gao
2022-08-04 3:35 ` [PATCH 08/31] net: mediatek: add support for PDMA v2 Weijie Gao
2022-08-04 13:56 ` Simon Glass
2022-08-06 17:49 ` Ramon Fried
2022-08-04 3:35 ` [PATCH 09/31] net: mediatek: add support for MediaTek MT7981/MT7986 Weijie Gao
2022-08-06 17:48 ` Ramon Fried
2022-08-04 3:35 ` [PATCH 10/31] serial: mtk: add support for using dynamic baud clock souce Weijie Gao
2022-08-04 13:56 ` Simon Glass
2022-08-08 2:36 ` Weijie Gao
2022-08-08 19:26 ` Simon Glass
2022-08-04 3:35 ` [PATCH 11/31] arm: dts: mt7622: force high-speed mode for uart Weijie Gao
2022-08-04 13:57 ` Simon Glass
2022-08-04 3:35 ` [PATCH 12/31] pwm: mtk: add support for MediaTek MT7986 SoC Weijie Gao
2022-08-04 13:57 ` Simon Glass
2022-08-04 3:35 ` [PATCH 13/31] pwm: mtk: add support for MediaTek MT7981 SoC Weijie Gao
2022-08-04 13:57 ` Simon Glass
2022-08-04 3:35 ` [PATCH 14/31] timer: mtk: add support for MediaTek MT7981/MT7986 SoCs Weijie Gao
2022-08-04 13:57 ` Simon Glass
2022-08-04 3:35 ` [PATCH 15/31] watchdog: mediatek: add support for MediaTek MT7986 SoC Weijie Gao
2022-08-04 13:57 ` Simon Glass
2022-08-04 3:36 ` [PATCH 16/31] spi: add support for MediaTek spi-mem controller Weijie Gao
2022-08-04 13:57 ` Simon Glass
2022-08-04 3:36 ` [PATCH 17/31] i2c: add support for MediaTek I2C interface Weijie Gao
2022-08-04 13:57 ` Simon Glass
2022-08-08 3:00 ` Weijie Gao
2022-08-10 11:12 ` Heiko Schocher
2022-08-10 11:24 ` Michael Nazzareno Trimarchi
2022-08-12 9:46 ` Weijie Gao
2022-08-04 3:36 ` [PATCH 18/31] arm: dts: mt7622: add i2c support Weijie Gao
2022-08-04 13:57 ` Simon Glass
2022-08-04 3:36 ` [PATCH 19/31] dt-bindings: pinctrl: mediatek: add a header for common pinconf parameters Weijie Gao
2022-08-04 13:57 ` Simon Glass
2022-08-04 3:36 ` [PATCH 20/31] pinctrl: mediatek: add pinctrl driver for MT7981 SoC Weijie Gao
2022-08-04 13:57 ` Simon Glass
2022-08-04 3:36 ` [PATCH 21/31] pinctrl: mediatek: add pinctrl driver for MT7986 SoC Weijie Gao
2022-08-04 13:57 ` Simon Glass
2022-08-04 3:36 ` [PATCH 22/31] clk: mediatek: add CLK_BYPASS_XTAL flag to allow bypassing searching clock parent of xtal clock Weijie Gao
2022-08-04 13:57 ` Simon Glass
2022-08-08 3:01 ` Weijie Gao
2022-08-04 3:36 ` [PATCH 23/31] clk: mediatek: add support to configure clock driver parent Weijie Gao
2022-08-04 13:57 ` Simon Glass
2022-08-13 4:18 ` Sean Anderson
2022-08-23 10:43 ` Weijie Gao
2022-08-04 3:36 ` [PATCH 24/31] clk: mediatek: add infrasys clock mux support Weijie Gao
2022-08-04 13:57 ` Simon Glass
2022-08-13 4:21 ` Sean Anderson
2022-08-17 8:00 ` Weijie Gao
2022-08-04 3:36 ` [PATCH 25/31] clk: mediatek: add CLK_XTAL support for clock driver Weijie Gao
2022-08-04 13:57 ` Simon Glass
2022-08-08 3:10 ` Weijie Gao
2022-08-13 4:25 ` Sean Anderson
2022-08-17 8:08 ` Weijie Gao
2022-08-04 3:36 ` [PATCH 26/31] clk: mediatek: add clock driver support for MediaTek MT7986 SoC Weijie Gao
2022-08-04 13:57 ` Simon Glass
2022-08-08 3:13 ` Weijie Gao
2022-08-04 3:36 ` [PATCH 27/31] clk: mediatek: add clock driver support for MediaTek MT7981 SoC Weijie Gao
2022-08-04 13:57 ` Simon Glass
2022-08-08 3:18 ` Weijie Gao
2022-08-13 4:31 ` Sean Anderson
2022-08-17 8:16 ` Weijie Gao
2022-08-04 3:36 ` [PATCH 28/31] tools: mtk_image: split gfh header verification into a new function Weijie Gao
2022-08-04 13:57 ` Simon Glass
2022-08-04 3:36 ` [PATCH 29/31] tools: mtk_image: split the code of generating NAND header into a new file Weijie Gao
2022-08-04 13:57 ` Simon Glass
2022-08-08 3:23 ` Weijie Gao
2022-08-05 18:26 ` Daniel Golle
2022-08-08 3:26 ` Weijie Gao
2022-08-04 3:36 ` [PATCH 30/31] tools: mtk_image: add support for nand headers used by newer chips Weijie Gao
2022-08-04 13:57 ` Simon Glass
2022-08-08 3:31 ` Weijie Gao
2022-08-04 3:36 ` [PATCH 31/31] MAINTAINERS: update maintainer for MediaTek ARM platform Weijie Gao
2022-08-04 13:57 ` Simon Glass
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='000701d8ad46$38041fe0$a80c5fa0$@samsung.com' \
--to=jh80.chung@samsung.com \
--cc=GSS_MTK_Uboot_upstream@mediatek.com \
--cc=peng.fan@nxp.com \
--cc=u-boot@lists.denx.de \
--cc=weijie.gao@mediatek.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox