Re: [PATCHv1] rtc: bcm-iproc: Add support for Broadcom iproc rtc

From: Arnd Bergmann
Date: Wed Mar 11 2015 - 17:47:25 EST


On Wednesday 11 March 2015 13:00:22 Arun Ramamurthy wrote:
>
> Arnd, this is the device tree entry that I would end up with and I plan
> to use syscon_regmap_lookup_by_phandle in the rtc driver. Does this look
> acceptable?
>
> rtc: iproc_rtc@0x03026000 {
> compatible = "brcm,iproc-rtc";
> reg = <0x03026000 0xC>,
> iso_cell_syscon = <&crmu_iso_cell_control>;
> bbl_auth_syscon = <&crmu_bbl_auth>
> status = "okay";
>
> crmu_iso_cell_control:crmu@0x0301C02C {
> compatible = "syscon";
> reg = <0x0301C038 0x8>
> }
>
> crmu_bbl_auth:crmu@0x03024C74 {
> compatible = "syscon";
> reg = <0x03024C74 0x8>;
> }

This doesn't look right, sorry:

A syscon device is defined as a collection of registers that
have no logical grouping within them but that can be seen
as a single device. What you have here instead are two syscon
nodes that each have only a single 8-byte register.

What are the other registers surrounding those? I would expect
something like

crmu0: syscon@03010000 {
compatible = "syscon";
reg = <0x03010000 0x10000>;
};

and then use an offset into the syscon from the rtc node, like

iproc_rtc: rtc@03026000 {
compatible = "brcm,iproc-rtc";
reg = <0x03026000 0x1000>;
iso_cell_syscon = <&crmu0 0xc038>;
bbl_auth_syscon = <&crmu1 0x4c74>;
};

Note also that you got most of the naming wrong:

- node names should be generic strings like "rtc", "syscon", "pci" etc.
The specific strings are defined in ePAPR.
- unit addresses should match the first 'reg' property and
not start with '0x'.
- it seems strange that the rtc has only 12 bytes of registers,
though that may actually be correct.

Arnd
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/