public inbox for devicetree@vger.kernel.org
 help / color / mirror / Atom feed
From: Jiayu Du <jiayu.riscv@isrc.iscas.ac.cn>
To: Junhui Liu <junhui.liu@pigmoral.tech>,
	krzk@kernel.org, ulf.hansson@linaro.org, adrian.hunter@intel.com,
	robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org
Cc: pjw@kernel.org, palmer@dabbelt.com, aou@eecs.berkeley.edu,
	linux-mmc@vger.kernel.org, devicetree@vger.kernel.org,
	linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org,
	gaohan@iscas.ac.cn, me@ziyao.cc,
	linux-riscv <linux-riscv-bounces@lists.infradead.org>
Subject: Re: [PATCH v3 0/3] Add SDHCI support for Canaan K230 SoC
Date: Thu, 12 Mar 2026 20:39:49 +0800	[thread overview]
Message-ID: <abK0FcDHrQsDKBnl@duge-virtual-machine> (raw)
In-Reply-To: <DGZT8U7OMGG3.WS9SPLJF9Y4Q@pigmoral.tech>

On Wed, Mar 11, 2026 at 04:29:48PM +0800, Junhui Liu wrote:
> Hi Jiayu,
> Thanks for your work.
> 
> On Tue Mar 10, 2026 at 2:45 PM CST, Jiayu Du wrote:
> > This series is based on the k230 usbphy series[1].
> >
> > This patch series adds SDHCI support for the Canaan K230 SoC,
> > which uses Synopsys DWCMSHC SDHCI controllers, include MMC0 and MMC1.
> > The hardware designs of these two controllers are different.
> > The MMC0 supports eMMC, while MMC1 only supports SDIO. Detailed
> > information can be found in the vendor's manual[2].
> >
> > From the vendor's K230 manual:
> >  - MMC0 supports eMMC5.0 and SDIO3.0, usually for eMMC chips.
> >  - MMC1 only does SDIO3.0 in 4/1-bit mode up to SDR104, and the manual
> >    clearly says it can't handle eMMC because of pin count and limits.
> >
> > Therefore, there are two separate compatibles and the driver treats them
> > differently.
> >
> > Link: https://lore.kernel.org/all/20260121145526.14672-1-jiayu.riscv@isrc.iscas.ac.cn/ [1]
> > Link: https://github.com/kendryte/k230_docs/blob/main/en/00_hardware/K230_Hardware_Design_Guide.md#mmc-circuit [2]
> >
> > Changes in v3:
> > - Drop the clock maxItems.
> > - Add a const void *match_data to the struct dwcmshc_priv
> > - Copy the match_data pointer to dwcmshc_priv in the common dwcmshc_probe
> > - Link to v2: https://lore.kernel.org/all/20260226115923.75670-1-jiayu.riscv@isrc.iscas.ac.cn/
> >
> > Changes in v2:
> > - Change the clock minItems to 5.
> > - Add comments to explain the reason for setting SDHCI_PROG_CLOCK_MODE.
> > - Write the power selection logic in the phy init cleaner.
> > - Replace manual delay loop with read_poll_timeout.
> > - Drop unnecessarily braces where a single statement will do.
> > - Add the match_data pointer to dwcmshc_pltfm_data.
> > - Add dwcmshc_k230_match_data struct to separate eMMC/SDIO config data
> > - Split K230 into individual emmc/sdio platform data instances instead of
> >   sharing one.
> > - Remove redundant have_phy member in k230_priv.
> > - Replace of_find_compatible_node with of_parse_phandle to get USB PHY
> >   from DT phandle.
> > - Link to v1: https://lore.kernel.org/all/20260204082908.27501-1-jiayu.riscv@isrc.iscas.ac.cn/
> >
> > Jiayu Du (3):
> >   dt-bindings: mmc: Add sdhci support for Canaan k230
> >   mmc: sdhci-dwcmshc: Add Canaan K230 DWCMSHC controller support
> >   riscv: dts: canaan: Add mmc nodes for K230
> >
> >  .../bindings/mmc/snps,dwcmshc-sdhci.yaml      |  28 ++
> >  .../boot/dts/canaan/k230-canmv-dshanpi.dts    |  56 ++++
> >  .../dts/canaan/k230-canmv-module-dshanpi.dtsi |   7 +
> >  arch/riscv/boot/dts/canaan/k230.dtsi          |  28 ++
> >  drivers/mmc/host/sdhci-of-dwcmshc.c           | 287 ++++++++++++++++++
> >  5 files changed, 406 insertions(+)
> 
> Tested-by: Junhui Liu <junhui.liu@pigmoral.tech>
> 
> Tested ok on CanMV-K230-V1.1 (k230-canmv.dts) with AP6212 (BCM43430)
> SDIO WiFi module on MMC0 and MicroSD card on MMC1.
> 
> To be noted, a "broken-cd" property is needed to support SD card insert
> and remove detect on CanMV board because the CD pin is not connected. I
> am not sure if this is also needed on DShanPi as I don't have its
> schematic.

Thank you for your test and reminder. I have checked the schematic and
I will add "broken-cd" in the next version.

Best regards,
Jiayu Du


      reply	other threads:[~2026-03-12 12:40 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-10  6:45 [PATCH v3 0/3] Add SDHCI support for Canaan K230 SoC Jiayu Du
2026-03-10  6:45 ` [PATCH v3 1/3] dt-bindings: mmc: Add sdhci support for Canaan k230 Jiayu Du
2026-03-10  6:45 ` [PATCH v3 2/3] mmc: sdhci-dwcmshc: Add Canaan K230 DWCMSHC controller support Jiayu Du
2026-03-11 14:04   ` Adrian Hunter
2026-03-12 13:31     ` Jiayu Du
2026-03-10  6:45 ` [PATCH v3 3/3] riscv: dts: canaan: Add mmc nodes for K230 Jiayu Du
2026-03-11  8:29 ` [PATCH v3 0/3] Add SDHCI support for Canaan K230 SoC Junhui Liu
2026-03-12 12:39   ` Jiayu Du [this message]

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=abK0FcDHrQsDKBnl@duge-virtual-machine \
    --to=jiayu.riscv@isrc.iscas.ac.cn \
    --cc=adrian.hunter@intel.com \
    --cc=aou@eecs.berkeley.edu \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=gaohan@iscas.ac.cn \
    --cc=junhui.liu@pigmoral.tech \
    --cc=krzk+dt@kernel.org \
    --cc=krzk@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-riscv-bounces@lists.infradead.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=me@ziyao.cc \
    --cc=palmer@dabbelt.com \
    --cc=pjw@kernel.org \
    --cc=robh@kernel.org \
    --cc=ulf.hansson@linaro.org \
    /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