lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID:
 <MA0P287MB2822A5D78558176D9B23240CFE082@MA0P287MB2822.INDP287.PROD.OUTLOOK.COM>
Date: Wed, 17 Apr 2024 07:53:04 +0800
From: Chen Wang <unicorn_wang@...look.com>
To: Jisheng Zhang <jszhang@...nel.org>, Chen Wang <unicornxw@...il.com>
Cc: adrian.hunter@...el.com, aou@...s.berkeley.edu, conor+dt@...nel.org,
 guoren@...nel.org, inochiama@...look.com, krzysztof.kozlowski+dt@...aro.org,
 palmer@...belt.com, paul.walmsley@...ive.com, robh@...nel.org,
 ulf.hansson@...aro.org, devicetree@...r.kernel.org,
 linux-kernel@...r.kernel.org, linux-mmc@...r.kernel.org,
 linux-riscv@...ts.infradead.org, chao.wei@...hgo.com,
 haijiao.liu@...hgo.com, xiaoguang.xing@...hgo.com, tingzhu.wang@...hgo.com
Subject: Re: [PATCH 2/3] mmc: sdhci-of-dwcmshc: Add support for Sophgo SG2042


On 2024/4/16 23:37, Jisheng Zhang wrote:
> On Tue, Apr 16, 2024 at 05:50:57PM +0800, Chen Wang wrote:
[......]
>>   
>> +#define SG2042_MAX_CLKS 2
> I don't think "bulk" is suitable here for max 2 clks, no?
Without "bulk",  I have to prepare/disable two times for each of clocks 
and handle the exception if first one failed etc. I learn this from 
rockchip, it has 3. Why you think it is  not suitable, please advise me, 
thanks.
>> +struct sg2042_priv {
>> +	struct clk_bulk_data clks[SG2042_MAX_CLKS];
> useless either

Sorry, what's this mean?

[......]

>> +
>> +	/* Set ATDL_CNFG, tuning clk not use for init */
>> +	val = FIELD_PREP(PHY_ATDL_CNFG_INPSEL_MASK, 2);
> magic "2" needs a meaningful macro definition.

Agree, will improve this in next version.

[......]

>>   
>> +static const struct sdhci_pltfm_data sdhci_dwcmshc_sg2042_pdata = {
>> +	.ops = &sdhci_dwcmshc_sg2042_ops,
>> +	.quirks = SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN |
>> +		  SDHCI_QUIRK_INVERTED_WRITE_PROTECT,
> is "wp-inverted" property better?

Yes, l will use this in next revision, thanks.

[......]

>> +
>> +static int dwcmshc_sg2042_init(struct device *dev,
>> +			       struct sdhci_host *host,
>> +			       struct dwcmshc_priv *dwc_priv)
>> +{
>> +	int err;
>> +	struct sg2042_priv *soc = NULL;
>> +
>> +	soc = devm_kzalloc(dev, sizeof(struct sg2042_priv), GFP_KERNEL);
>> +	if (!soc)
>> +		return -ENOMEM;
>> +
>> +	soc->clks[0].id = "card";
>> +	soc->clks[1].id = "timer";
> Interesting, only "card" and "timer", so which clk is for clk input of the ip?

Copy my comments from bindings patch here for quick reference:

 > SG2042 defines 3 clocks for SD/eMMC controllers.

 >- AXI_EMMC/AXI_SD for aclk/hclk(Bus interface clocks in DWC_mshc)
 >  and bclk(Core Base Clock in DWC_mshc), these 3 clocks share one
 >  source, so reuse existing "core".
 >- 100K_EMMC/100K_SD for cqetmclk(Timer clocks in DWC_mshc), so reuse
 >  existing "timer" which was added for rockchip specified.

 >- EMMC_100M/SD_100M for cclk(Card clocks in DWC_mshc), add new "card".

What you meant "clk input of the ip" is "core", right?

[......]


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ