[PATCH v4 1/2] mtd: rawnand: meson: discard the common MMC sub clock framework

Liang Yang liang.yang at amlogic.com
Tue Apr 19 22:44:32 PDT 2022


Hi Miquel,

On 2022/4/19 23:25, Miquel Raynal wrote:
> [ EXTERNAL EMAIL ]
> 
> Hello,
> 
> liang.yang at amlogic.com wrote on Tue, 19 Apr 2022 17:17:48 +0800:
> 
>> Hello Miquel,
>>
>> On 2022/4/19 16:26, Miquel Raynal wrote:
>>> [ EXTERNAL EMAIL ]
>>>
>>> Hello,
>>>
>>> liang.yang at amlogic.com wrote on Mon, 18 Apr 2022 11:40:10 +0800:
>>>    
>>>> Hi Miquel,
>>>>
>>>> i have some confusion when i prepare the patches. for DT compatibility, it falls back to the old DT when failed to get resource by the new DT, but there is some points:
>>>> a. old DT depends on MMC sub clock driver, but it never be merged, so it can't work.
>>>
>>> I don't get what you mean here, sorry. I believe there is a new way to
>>> describe this clock but grabbing the one from the MMC still works, does
>>> not it?
>>>    
>>
>> No, it doesn't. after the NFC driver using the MMC sub clock framework was merged into the mainline of kernel, we didn't continue to submit the series of patches about MMC sub clock after v9. when i found that, we made a discussion to decide whether to recover the series of patches about MMC sub clock framework, finally, see the description from cover letter, we plan to abandon it and adopt the new clock scheme in this series of patches.
> 
> I am not sure to follow. Is the current code completely broken? I
> believe it is not, so I don't understand your issue.

i think only the code about the clock is completely broken.

> 
> Can you please summarize the situation?

Yes. the current NFC clock implementation depends on the following 
series of patches 
[https://lore.kernel.org/all/20220121074508.42168-5-liang.yang@amlogic.com], 
which we call "Meson MMC Sub Clock Controller Driver".
when i was preparing the NFC patchset at that time, we discussed how the 
clock should be implemented base on the special clock framework for NFC 
and EMMC port. then we decided to implement a driver "Meson MMC Sub 
Clock Controller Driver". so another people begin to prepare "Meson MMC 
Sub Clock Controller Driver", but submitted it by different patchset.
finally, now the meson NFC patchset is accepted and merged, but "Meson 
MMC Sub Clock Controller Driver" patchset is not. also we decide to 
abandon the patset "Meson MMC Sub Clock Controller Driver" and implement 
the new clock design in this series.

> 
>>
>> Thanks.
>>
>>>> b. if it falls back to the old DT, beside the regmap lookup below, it seems that we have to preserve the code of the old clock setting in nfc_clk_init().
>>>
>>> Yes, probably.
>>>    
>>>> do we still need to avoid break DT compatibility?
>>>
>>> We should try our best to avoid breaking the DT, yes.
>>>    
>>>>
>>>> Thanks.
>>>>
>>>> On 2022/4/11 10:40, Liang Yang wrote:
>>>>>>>         nfc->dev = dev;
>>>>>>> -    res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>>>>>>> -    nfc->reg_base = devm_ioremap_resource(dev, res);
>>>>>>> +    nfc->reg_base = devm_platform_ioremap_resource_byname(pdev, "nfc");
>>>>>>
>>>>>> This change seems unrelated.
>>>>>
>>>>> To be consistent with the following > devm_platform_ioremap_resource_byname(pdev, "emmc"). do you mean that we > don't need it?>
>>>>>>>         if (IS_ERR(nfc->reg_base))
>>>>>>>             return PTR_ERR(nfc->reg_base);
>>>>>>> -    nfc->reg_clk =
>>>>>>> -        syscon_regmap_lookup_by_phandle(dev->of_node,
>>>>>>> -                        "amlogic,mmc-syscon");
>>>>>>> -    if (IS_ERR(nfc->reg_clk)) {
>>>>>>> -        dev_err(dev, "Failed to lookup clock base\n");
>>>>>>> -        return PTR_ERR(nfc->reg_clk);
>>>>>>> -    }
>>>>>>> +    nfc->sd_emmc_clock = devm_platform_ioremap_resource_byname(pdev, >>> "emmc");
>>>>>>> +    if (IS_ERR(nfc->sd_emmc_clock))
>>>>>>> +        return PTR_ERR(nfc->sd_emmc_clock);
>>>>>>
>>>>>> While I agree this is much better than the previous solution, we cannot
>>>>>> break DT compatibility, so you need to try getting the emmc clock, but
>>>>>> if it fails you should fallback to the regmap lookup.
>>>>>
>>>>> ok, i will fix it next version. thanks.
>>>>>     >>>>   >>>>>        irq = platform_get_irq(pdev, 0);
>>>
>>>
>>> Thanks,
>>> Miquèl
>>>
>>> .
> 
> 
> Thanks,
> Miquèl
> 
> .



More information about the linux-mtd mailing list