All of lore.kernel.org
 help / color / mirror / Atom feed
* Hard coded register address in "drm: rcar-du: Add DPLL support"?
@ 2016-05-18 14:29 Dirk Behme
  2016-05-20  7:28 ` Dirk Behme
  0 siblings, 1 reply; 2+ messages in thread
From: Dirk Behme @ 2016-05-18 14:29 UTC (permalink / raw)
  To: linux-renesas-soc, Geert Uytterhoeven, Koji Matsuoka

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?

Best regards

Dirk

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Hard coded register address in "drm: rcar-du: Add DPLL support"?
  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
  0 siblings, 0 replies; 2+ messages in thread
From: Dirk Behme @ 2016-05-20  7:28 UTC (permalink / raw)
  To: linux-renesas-soc, Geert Uytterhoeven, Koji Matsuoka

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;
}

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-05-20  7:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 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.