All of lore.kernel.org
 help / color / mirror / Atom feed
From: robert.jarzmik@free.fr (Robert Jarzmik)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/4] rtc: sa1100: convert to run-time register mapping
Date: Wed, 04 Feb 2015 18:30:21 +0100	[thread overview]
Message-ID: <87h9v1a8k2.fsf@free.fr> (raw)
In-Reply-To: <1423005775-26457-3-git-send-email-robh@kernel.org> (Rob Herring's message of "Tue, 3 Feb 2015 17:22:53 -0600")

Rob Herring <robh@kernel.org> writes:

Hi Rob,

> SA1100 and PXA differ only in register offsets which are currently
> hardcoded in a machine specific header. Some arm64 platforms (PXA1928)
> have this RTC block also.
>
> Convert the driver to use ioremap and set the register offsets dynamically.
> Since we are touching all the register accesses, convert them all to
> readl/writel.
A general comment, probably made by Arnd already, why not using the relaxed
accessors ?

... zip ...

> +	iores = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> +	base = devm_ioremap_resource(&pdev->dev, iores);
> +	if (IS_ERR(base))
> +		return PTR_ERR(base);
> +
> +	if (IS_ENABLED(CONFIG_ARCH_SA1100) ||
> +	    of_device_is_compatible(pdev->dev.of_node, "mrvl,sa1100-rtc")) {
> +		info->rcnr = base + 0x04;
> +		info->rtsr = base + 0x10;
> +		info->rtar = base + 0x00;
> +		info->rttr = base + 0x08;
> +	} else {
> +		info->rcnr = base + 0x0;
> +		info->rtsr = base + 0x8;
> +		info->rtar = base + 0x4;
> +		info->rttr = base + 0xc;
> +	}
> +
This is making me feel a bit uncomfortable. What if a single kernel is built for
both SA1100 and PXA, and used in a PXA platform (as this drivers is also used in
pxa2xx and pxa3xx) ?

And just for your information, both rtc-sa1100 and rtc-pxa can be used at the
same time in a pxa kernel.

Apart from that worry it's quite nice.

Cheers.

-- 
Robert

  parent reply	other threads:[~2015-02-04 17:30 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-03 23:22 [PATCH 0/4] SA1100 RTC clean-up for ARM64 Rob Herring
2015-02-03 23:22 ` [PATCH 1/4] ARM: pxa: add memory resource to RTC device Rob Herring
2015-02-03 23:22 ` [PATCH 2/4] rtc: sa1100: convert to run-time register mapping Rob Herring
2015-02-04 13:25   ` Arnd Bergmann
2015-02-04 13:44     ` Rob Herring
2015-02-04 13:49       ` Rob Herring
2015-02-04 14:24         ` Arnd Bergmann
2015-02-04 17:30   ` Robert Jarzmik [this message]
2015-02-05 13:34     ` Rob Herring
2015-02-05 13:50       ` Russell King - ARM Linux
2015-02-05 19:18         ` Robert Jarzmik
2015-02-05 20:47           ` Rob Herring
2015-02-06 16:26             ` Robert Jarzmik
2015-02-05 23:37           ` Russell King - ARM Linux
2015-02-06 16:20             ` =Robert Jarzmik
2015-02-14 12:22   ` Robert Jarzmik
2015-02-03 23:22 ` [PATCH 3/4] ARM: sa1100: remove unused RTC register definitions Rob Herring
2015-02-03 23:22 ` [PATCH 4/4] ARM: mmp: " Rob Herring
2015-02-04 10:44 ` [PATCH 0/4] SA1100 RTC clean-up for ARM64 Russell King - ARM Linux
2015-02-04 13:58   ` Rob Herring

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=87h9v1a8k2.fsf@free.fr \
    --to=robert.jarzmik@free.fr \
    --cc=linux-arm-kernel@lists.infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.