All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dirk Behme <dirk.behme@de.bosch.com>
To: <linux-renesas-soc@vger.kernel.org>,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	Koji Matsuoka <koji.matsuoka.xm@renesas.com>
Subject: Re: Hard coded register address in "drm: rcar-du: Add DPLL support"?
Date: Fri, 20 May 2016 09:28:54 +0200	[thread overview]
Message-ID: <81c7a444-d6f8-747b-edef-646120b120ed@de.bosch.com> (raw)
In-Reply-To: <9fc07c0c-0760-a713-5ca0-c70861576467@de.bosch.com>

On 18.05.2016 16:29, Dirk Behme wrote:
> Hi,
>
> I'm not sure on which mailing list this
>
> https://git.kernel.org/cgit/linux/kernel/git/geert/renesas-drivers.git/commit/drivers/gpu/drm/rcar-du/rcar_du_crtc.c?h=topic/gen3-latest&id=e297be92f09a9e8f9a63e72b8d69440dbf5bbabe
>
> drm: rcar-du: Add DPLL support
>
> is discussed.
>
> But it's the same like with the hard coded MODEMR register: We don't
> want the hard coded
>
> #define PRODUCT_REG 0xfff00044
>
> here.
>
> Are there already patches or plans to convert this to a device tree
> based interface?


Looking into the HW documentation for the product register, this seems 
to be not associated with any hardware block (IP block), but 'just' a 
register somewhere in the address space. Documented in the appendix.

So a device tree based access function for this could be simple. E.g. 
like below [1].

What do you think about this? Where would we put code like this? 
drivers/misc?

Best regards

Dirk

[1]

static struct of_device_id rcar_gen3_prr_ids[] __initdata = {
         { .compatible = "renesas,rcar-gen3-prr" },
         {}
};

int __init rcar_gen3_read_product(u32 *prr)
{
         void __iomem *product;
         struct device_node *np;

         np = of_find_matching_node(NULL, rcar_gen3_prr_ids);
         if (!np) {
                 pr_err("can't find Renesas rcar-gen3-prr device node");
		return -ENOMEM;
         }

         product = of_iomap(np, 0);
         prr = ioread32(product);
         iounmap(product);
         of_node_put(np);

	return 0;
}

      reply	other threads:[~2016-05-20  7:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-18 14:29 Hard coded register address in "drm: rcar-du: Add DPLL support"? Dirk Behme
2016-05-20  7:28 ` Dirk Behme [this message]

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=81c7a444-d6f8-747b-edef-646120b120ed@de.bosch.com \
    --to=dirk.behme@de.bosch.com \
    --cc=geert+renesas@glider.be \
    --cc=koji.matsuoka.xm@renesas.com \
    --cc=linux-renesas-soc@vger.kernel.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.