mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: Daniel Lezcano <daniel.lezcano@linaro.org>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 2/9] clocksource: ti-dm: make available in PBL
Date: Tue, 29 Apr 2025 11:31:22 +0200	[thread overview]
Message-ID: <080c0462-8e25-4255-9e91-9d8b47cd4a0e@pengutronix.de> (raw)
In-Reply-To: <aBCXEyLrpWJpFmmN@mai.linaro.org>

Hello Daniel,

On 4/29/25 11:08, Daniel Lezcano wrote:
> On Tue, Apr 22, 2025 at 07:26:28AM +0200, Ahmad Fatoum wrote:
>> +int omap_dmtimer_init(void __iomem *mmio_start, unsigned clk_speed)
>> +{
>> +	base = mmio_start;
>> +
>> +	dmtimer_cs.mult = clocksource_hz2mult(clk_speed, dmtimer_cs.shift);
>> +
>> +	/* Enable counter */
>> +	writel(0x3, base + TCLR);
>> +
>> +	return init_clock(&dmtimer_cs);
>> +}
> 
> Can you take the opportunity to fix the function prototype with the correct types 'u32' ?

Why is u32 more correct than unsigned? The value is not written to a
register, but instead used as input to computing the multiplier.

> And replacing the litteral 0x3 with a macro ?

Sure thing.

Thanks,
Ahmad

> 
>> +
>>  static int omap_dmtimer_probe(struct device *dev)
>>  {
>>  	struct resource *iores;
>> @@ -90,12 +102,7 @@ static int omap_dmtimer_probe(struct device *dev)
>>  	if (clk_speed < 0)
>>  		return clk_speed;
>>  
>> -	dmtimer_cs.mult = clocksource_hz2mult(clk_speed, dmtimer_cs.shift);
>> -
>> -	/* Enable counter */
>> -	writel(0x3, base + TCLR);
>> -
>> -	return init_clock(&dmtimer_cs);
>> +	return omap_dmtimer_init(IOMEM(iores->start), clk_speed);
>>  }
>>  
>>  static int am335x_get_clock(struct device *dev)
>> diff --git a/include/mach/omap/am33xx-clock.h b/include/mach/omap/am33xx-clock.h
>> index af47a0f3e77a..b064337ac4f8 100644
>> --- a/include/mach/omap/am33xx-clock.h
>> +++ b/include/mach/omap/am33xx-clock.h
>> @@ -191,4 +191,7 @@ void am33xx_pll_init(int mpupll_M, int ddrpll_M);
>>  void am33xx_enable_ddr_clocks(void);
>>  int am33xx_get_osc_clock(void);
>>  
>> +int omap_dmtimer_init(void __iomem *mmio_start,
>> +		      unsigned clk_speed);
>> +
>>  #endif  /* endif _AM33XX_CLOCKS_H_ */
>> -- 
>> 2.39.5
>>
>>
>>
> 

-- 
Pengutronix e.K.                  |                             |
Steuerwalder Str. 21              | http://www.pengutronix.de/  |
31137 Hildesheim, Germany         | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686  | Fax:   +49-5121-206917-5555 |




  reply	other threads:[~2025-04-29  9:31 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-22  5:26 [PATCH 0/9] ARM: OMAP: beaglebone: add PBL SD xload support Ahmad Fatoum
2025-04-22  5:26 ` [PATCH 1/9] clocksource: make available in PBL Ahmad Fatoum
2025-04-22  5:26 ` [PATCH 2/9] clocksource: ti-dm: " Ahmad Fatoum
2025-04-29  9:08   ` Daniel Lezcano
2025-04-29  9:31     ` Ahmad Fatoum [this message]
2025-04-29 13:09       ` Daniel Lezcano
2025-04-22  5:26 ` [PATCH 3/9] mci: move mci_setup_cmd definition into header Ahmad Fatoum
2025-04-22  5:26 ` [PATCH 4/9] mci: add common PBL helper for chainloading after BootROM initialization Ahmad Fatoum
2025-04-22  5:26 ` [PATCH 5/9] mci: pbl: add autodetection of BootROM-initialized standard capacity cards Ahmad Fatoum
2025-04-22  5:26 ` [PATCH 6/9] mci: omap_hsmmc: split out common code Ahmad Fatoum
2025-04-22  5:26 ` [PATCH 7/9] ARM: OMAP: add am33xx_hsmmc_start_image for PBL Ahmad Fatoum
2025-04-22  5:26 ` [PATCH 8/9] mci: omap_hsmmc: add xload implementation " Ahmad Fatoum
2025-04-22  5:26 ` [PATCH 9/9] ARM: OMAP: beaglebone: add PBL SD xload support Ahmad Fatoum
2025-04-22 10:55 ` [PATCH 0/9] " Sascha Hauer

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=080c0462-8e25-4255-9e91-9d8b47cd4a0e@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=daniel.lezcano@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