[PATCH 2/2] mmc: sdhci-of-aspeed: Add ast2700 support
Ryan Chen
ryan_chen at aspeedtech.com
Mon Mar 16 16:51:33 AEDT 2026
> Subject: Re: [PATCH 2/2] mmc: sdhci-of-aspeed: Add ast2700 support
>
> On Fri, Mar 13, 2026 at 01:27:57PM +0800, Ryan Chen wrote:
> > Add support for the AST2700 SOC in the sd controller driver. AST2700
> > sd controller requires an reset line, so hook up the optional reset
> > control and deassert it during probe.
> >
> > Signed-off-by: Ryan Chen <ryan_chen at aspeedtech.com>
> > ---
> > drivers/mmc/host/sdhci-of-aspeed.c | 11 +++++++++++
> > 1 file changed, 11 insertions(+)
> >
> > diff --git a/drivers/mmc/host/sdhci-of-aspeed.c
> > b/drivers/mmc/host/sdhci-of-aspeed.c
> > index ca97b01996b1..91c36245e506 100644
> > --- a/drivers/mmc/host/sdhci-of-aspeed.c
> > +++ b/drivers/mmc/host/sdhci-of-aspeed.c
> > @@ -520,6 +520,7 @@ static int aspeed_sdc_probe(struct platform_device
> > *pdev)
> >
> > {
> > struct device_node *parent, *child;
> > + struct reset_control *reset;
> > struct aspeed_sdc *sdc;
> > int ret;
> >
> > @@ -529,6 +530,15 @@ static int aspeed_sdc_probe(struct
> > platform_device *pdev)
> >
> > spin_lock_init(&sdc->lock);
> >
> > + reset = reset_control_get_optional_exclusive(&pdev->dev, NULL);
> > + if (IS_ERR(reset))
> > + return dev_err_probe(&pdev->dev, PTR_ERR(reset),
> > + "unable to acquire reset\n");
> > + ret = reset_control_deassert(sdc->rst);
> > + if (ret)
> > + return dev_err_probe(&pdev->dev, ret,
> > + "reset deassert failed\n");
> > +
> > sdc->clk = devm_clk_get(&pdev->dev, NULL);
> > if (IS_ERR(sdc->clk))
> > return PTR_ERR(sdc->clk);
> > @@ -577,6 +587,7 @@ static const struct of_device_id
> aspeed_sdc_of_match[] = {
> > { .compatible = "aspeed,ast2400-sd-controller", },
> > { .compatible = "aspeed,ast2500-sd-controller", },
> > { .compatible = "aspeed,ast2600-sd-controller", },
> > + { .compatible = "aspeed,ast2700-sd-controller", },
>
> So devices are fully compatible. You must express it in the bindings and drop
> this hunk.
Thanks the review.
Do you mean I modify the binding with following.
properties:
compatible:
oneOf:
- const: aspeed,ast2400-sd-controller
- const: aspeed,ast2500-sd-controller
- const: aspeed,ast2600-sd-controller
- items:
- const: aspeed,ast2700-sd-controller
- const: aspeed,ast2600-sd-controller
And still keep this
if:
properties:
compatible:
contains:
const: aspeed,ast2700-sd-controller
then:
required:
- resets
else:
properties:
resets: false
also the child
patternProperties:
"^sdhci@[0-9a-f]+$":
type: object
$ref: sdhci-common.yaml
unevaluatedProperties: false
properties:
compatible:
oneOf:
- const: aspeed,ast2400-sdhci
- const: aspeed,ast2500-sdhci
- const: aspeed,ast2600-sdhci
- items:
- const: aspeed,ast2700-sdhci
- const: aspeed,ast2600-sdhci
Then my dts will be following?
sdc at ... {
compatible = "aspeed,ast2700-sd-controller",
"aspeed,ast2600-sd-controller";
resets = <...>;
...
sdhci0: sdhci at 100 {
compatible = "aspeed,ast2700-sdhci",
"aspeed,ast2600-sdhci";
...
};
sdhci1: sdhci at 200 {
compatible = "aspeed,ast2700-sdhci",
"aspeed,ast2600-sdhci";
...
};
};
>
> Best regards,
> Krzysztof
More information about the Linux-aspeed
mailing list