lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 3 Dec 2013 11:23:35 +0100
From:	Linus Walleij <linus.walleij@...aro.org>
To:	Lee Jones <lee.jones@...aro.org>
Cc:	"linux-arm-kernel@...ts.infradead.org" 
	<linux-arm-kernel@...ts.infradead.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	David Woodhouse <dwmw2@...radead.org>,
	"linux-mtd@...ts.infradead.org" <linux-mtd@...ts.infradead.org>,
	angus.clark@...com,
	"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>
Subject: Re: [PATCH v3 14/36] mtd: st_spi_fsm: Add device-tree binding documentation

On Mon, Dec 2, 2013 at 12:03 PM, Lee Jones <lee.jones@...aro.org> wrote:
>> > +Optional properties:
>> > +  - st,syscfg          : Phandle to boot-device system configuration registers
>> > +  - st,boot-device-reg : Address of the aforementioned boot-device register(s)
>> > +  - st,boot-device-spi : Expected boot-device value if booted via this device
>> > +
>> > +Example:
>> > +       spifsm: spifsm@...02000{
>> > +               compatible         = "st,spi-fsm";
>> > +               reg                =  <0xfe902000 0x1000>;
>> > +               reg-names          = "spi-fsm";
>> > +               pinctrl-0          = <&pinctrl_fsm>;
>> > +               st,syscfg          = <&syscfg_rear>;
>> > +               st,boot-device-reg = <0x958>;
>> > +               st,boot-device-spi = <0x1a>;
>>
>> I don't think we should encode any register offsets whatsoever in device
>> tree but maybe that's just me. (Yes, Stephen will beat me up about
>> pin control single, but I consider that a special case.)
>>
>> I would just put the last two things as #defines into the driver file(s)
>> or - if it's related to other syscfg registers and varies with SoC incarnation,
>> as a #define in a shared header for that syscfg thing.
>
> No can do. This isn't _this_ device's register offset, this is a
> syscfg register offset which a) there is no driver to apply specific
> register offsets to and b) are liable to change oversubsequent SoCs.

So it can be in <linux/mfd/my-sysconfig-regs.h> as
a

#define MY_SYSCON_V1_BOOT_DEV_REG 0x958
#define MY_SYSCON_V1_BOOT_DEV_SPI 0x1a

The kernel should know which SoC is in use and
act apropriately right?

But indeed, what you're doing has been done before
in drivers/regulator/anatop-regulator.c where some
register offset is read in from the attribute
"anatop-delay-reg-offset". So it may be that the DT people
need to overrule me on this one :-)

I don't think we should hard-code knowledge of specific
register locations into the device tree at all as that makes
things very hard to debug.

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ