[PATCH] scripts: config_whitelist: CONFIG_SYS_FLASH_AUTOPROTECT_LIST
Sergei Antonov
saproj at gmail.com
Sat Sep 10 21:59:20 CEST 2022
On Sat, 10 Sept 2022 at 17:18, Tom Rini <trini at konsulko.com> wrote:
>
> On Sun, Sep 04, 2022 at 06:54:29PM +0300, Sergei Antonov wrote:
> > On Sun, 4 Sept 2022 at 18:30, Tom Rini <trini at konsulko.com> wrote:
> > >
> > > On Sun, Sep 04, 2022 at 06:28:56PM +0300, Sergei Antonov wrote:
> > > > On Sun, 4 Sept 2022 at 18:23, Tom Rini <trini at konsulko.com> wrote:
> > > > > > > > > What type must it be in Kconfig? Note, it is an array initializer
> > > > > > > > > similar to CONFIG_SYS_BAUDRATE_TABLE.
> > > > > > > >
> > > > > > > > Ah, ugh. So, it's also currently unused code, what does it look like in
> > > > > > > > the platform you're making use of this on?
> > > > > > >
> > > > > > > In my _defconfig I use this line:
> > > > > > > CONFIG_SYS_FLASH_AUTOPROTECT_LIST="{{0x80000000, 0x40000}}"
> > > > > > > To protect the first 256 KB of flash memory.
> > > > > >
> > > > > > Please, disregard the previous message. I was too hasty to reply.
> > > > > >
> > > > > > I have include/configs/myplatform.h file which contains this line:
> > > > > > #define CONFIG_SYS_FLASH_AUTOPROTECT_LIST {{0x80000000, 0x40000}}
> > > > > >
> > > > > > And I could not convert it to Kconfig string parameter.
> > > > >
> > > > > Can this information be obtained from an existing device tree binding on
> > > > > the platform?
> > > >
> > > > Device tree exists. No, DT does not currently contain this
> > > > information. But it can be added.
> > >
> > > OK. But, is there an existing binding, or would it be a new one?
> >
> > I am using an existing "cfi-flash" driver:
> > nor at 80000000 {
> > #address-cells = <1>;
> > #size-cells = <1>;
> > compatible = "cfi-flash";
> > reg = <0x80000000 0x0>;
> > ...
> > }
>
> Getting back to this, sorry, I meant if there was a property we could
> use or some other way to infer this from the device tree. I see the
> partition binding has a way to mark things as read-only, which we could
> use as a hint (and with a new Kconfig option) to say that partitions
> that are marked as read only are then also protected.
Can "read-only;" in .dts be such a hint? Here is what I have in .my .dts:
nor at 80000000 {
#address-cells = <1>;
#size-cells = <1>;
compatible = "cfi-flash";
reg = <0x80000000 0x0>;
partitions {
...
mtd1 {
label = "bios";
reg = <0x0 0x40000>;
read-only;
};
More information about the U-Boot
mailing list