[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAFBinCAbTuNGEG13f71F8vhN3yGce+kkYJ7PHMpZbh8DzSapJg@mail.gmail.com>
Date: Wed, 10 May 2023 22:40:37 +0200
From: Martin Blumenstingl <martin.blumenstingl@...glemail.com>
To: Arseniy Krasnov <AVKrasnov@...rdevices.ru>
Cc: Liang Yang <liang.yang@...ogic.com>,
Miquel Raynal <miquel.raynal@...tlin.com>,
Richard Weinberger <richard@....at>,
Vignesh Raghavendra <vigneshr@...com>,
Neil Armstrong <neil.armstrong@...aro.org>,
Kevin Hilman <khilman@...libre.com>,
Jerome Brunet <jbrunet@...libre.com>,
Jianxin Pan <jianxin.pan@...ogic.com>,
Yixun Lan <yixun.lan@...ogic.com>, oxffffaa@...il.com,
kernel@...rdevices.ru, linux-mtd@...ts.infradead.org,
linux-arm-kernel@...ts.infradead.org,
linux-amlogic@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 6/6] mtd: rawnand: meson: rename node for chip select
Hello Arseniy,
On Wed, May 10, 2023 at 1:13 PM Arseniy Krasnov
<AVKrasnov@...rdevices.ru> wrote:
>
> This renames node with values for chip select from "reg" to "cs". It is
> needed because when OTP access is enabled on the attached storage, MTD
> subsystem registers this storage in the NVMEM subsystem. NVMEM in turn
> tries to use "reg" node in its own manner, supposes that it has another
> layout. All of this leads to device initialization failure.
In general: if we change the device-tree interface (in this case:
replacing a "reg" with a "cs" property) the dt-bindings have to be
updated as well.
Documentation/devicetree/bindings/mtd/nand-controller.yaml and
Documentation/devicetree/bindings/mtd/amlogic,meson-nand.yaml show
that the chip select of a NAND chip is specified with a "reg"
property.
Also the code has to be backwards compatible with old .dtbs.
> Example:
>
> [...] nvmem mtd0-user-otp: nvmem: invalid reg on /soc/bus@...00000/...
> [...] mtd mtd0: Failed to register OTP NVMEM device
> [...] meson-nand ffe07800.nfc: failed to register MTD device: -22
> [...] meson-nand ffe07800.nfc: failed to init NAND chips
> [...] meson-nand: probe of ffe07800.nfc failed with error -22
This is odd - can you please share your definition of the &nfc node?
&nfc {
nand_chip0: nand@0 {
reg = <0>;
};
};
This should result in nand_set_flash_node() being called with
&nand_chip0 (if it's called with &nfc then something is buggy in our
driver).
If there's no child nodes within &nand_chip0 then why would the
MTD-to-NVMEM code think that it has to parse something?
If you do have child nodes and those are partitions, then make sure
that the structure is correct (see the extra "partitions" node inside
which all partitions are nested):
&nand_chip0 {
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
partition@0 {
label = "u-boot";
reg = <0x0000000 0x4000>;
read-only;
};
};
};
Best regards,,
Martin
Powered by blists - more mailing lists