Skip to contentSkip to conversation

scripts: config_whitelist: CONFIG_SYS_FLASH_AUTOPROTECT_LIST

PATCH In review Sergei Antonov 2 participants 13 messages Sep 3, 2022 – Sep 10, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scripts: config_whitelist: CONFIG_SYS_FLASH_AUTOPROTECT_LIST

CONFIG_SYS_FLASH_AUTOPROTECT_LIST is a feature of drivers/mtd/cfi_flash.c driver. It allows to specify a range of protected eraseblocks on flash memory.

Fixes build error:
Error: You must add new CONFIG options using Kconfig The following new ad-hoc CONFIG options were detected:
CONFIG_SYS_FLASH_AUTOPROTECT_LIST

---
 scripts/config_whitelist.txt | 1 +
 1 file changed, 1 insertion(+)
scripts/config_whitelist.txt +1 -0
index 22a0f2bf8a5d..d2e4e5375baf 100644
@@ -633,6 +633,7 @@ CONFIG_SYS_FLASH0
 CONFIG_SYS_FLASH1
 CONFIG_SYS_FLASH1_BASE_PHYS
 CONFIG_SYS_FLASH1_BASE_PHYS_EARLY
+CONFIG_SYS_FLASH_AUTOPROTECT_LIST
 CONFIG_SYS_FLASH_BANKS_LIST
 CONFIG_SYS_FLASH_BANKS_SIZES
 CONFIG_SYS_FLASH_BASE
Signature · 1 line
2.34.1
#1 lore raw
Quoted 8 lines · Sergei Antonov

CONFIG_SYS_FLASH_AUTOPROTECT_LIST is a feature of drivers/mtd/cfi_flash.c driver. It allows to specify a range of protected eraseblocks on flash memory.

Fixes build error:
Error: You must add new CONFIG options using Kconfig The following new ad-hoc CONFIG options were detected:
CONFIG_SYS_FLASH_AUTOPROTECT_LIST

Quoted 4 lines
---
 scripts/config_whitelist.txt | 1 +
 1 file changed, 1 insertion(+)

Please move this to Kconfig so that it can be enabled, thanks.

Signature · 1 line
Tom
#2 lore raw
Quoted 11 lines · Tom Rini
Quoted 8 lines · Sergei Antonov

CONFIG_SYS_FLASH_AUTOPROTECT_LIST is a feature of drivers/mtd/cfi_flash.c driver. It allows to specify a range of protected eraseblocks on flash memory.

Fixes build error:
Error: You must add new CONFIG options using Kconfig The following new ad-hoc CONFIG options were detected:
CONFIG_SYS_FLASH_AUTOPROTECT_LIST

Quoted 6 lines
Quoted 4 lines
---
 scripts/config_whitelist.txt | 1 +
 1 file changed, 1 insertion(+)

Please move this to Kconfig so that it can be enabled, thanks.

What type must it be in Kconfig? Note, it is an array initializer similar to CONFIG_SYS_BAUDRATE_TABLE.

#3 lore raw
Quoted 17 lines · Sergei Antonov
Quoted 16 lines · Tom Rini
Quoted 12 lines · Sergei Antonov

CONFIG_SYS_FLASH_AUTOPROTECT_LIST is a feature of drivers/mtd/cfi_flash.c driver. It allows to specify a range of protected eraseblocks on flash memory.

Fixes build error:
Error: You must add new CONFIG options using Kconfig The following new ad-hoc CONFIG options were detected:
CONFIG_SYS_FLASH_AUTOPROTECT_LIST

---
 scripts/config_whitelist.txt | 1 +
 1 file changed, 1 insertion(+)
Quoted 4 lines
Quoted 1 line

Please move this to Kconfig so that it can be enabled, thanks.

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?

Signature · 1 line
Tom
#4 lore raw
Quoted 19 lines · Tom Rini
Quoted 17 lines · Sergei Antonov
Quoted 16 lines · Tom Rini
Quoted 12 lines · Sergei Antonov

CONFIG_SYS_FLASH_AUTOPROTECT_LIST is a feature of drivers/mtd/cfi_flash.c driver. It allows to specify a range of protected eraseblocks on flash memory.

Fixes build error:
Error: You must add new CONFIG options using Kconfig The following new ad-hoc CONFIG options were detected:
CONFIG_SYS_FLASH_AUTOPROTECT_LIST

---
 scripts/config_whitelist.txt | 1 +
 1 file changed, 1 insertion(+)
Quoted 7 lines
Quoted 4 lines
Quoted 1 line

Please move this to Kconfig so that it can be enabled, thanks.

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.

#5 lore raw
Quoted 26 lines · Sergei Antonov
Quoted 24 lines · Tom Rini
Quoted 21 lines · Sergei Antonov
Quoted 11 lines · Tom Rini
Quoted 8 lines · Sergei Antonov

CONFIG_SYS_FLASH_AUTOPROTECT_LIST is a feature of drivers/mtd/cfi_flash.c driver. It allows to specify a range of protected eraseblocks on flash memory.

Fixes build error:
Error: You must add new CONFIG options using Kconfig The following new ad-hoc CONFIG options were detected:
CONFIG_SYS_FLASH_AUTOPROTECT_LIST

Quoted 6 lines
Quoted 4 lines
---
 scripts/config_whitelist.txt | 1 +
 1 file changed, 1 insertion(+)

Please move this to Kconfig so that it can be enabled, thanks.

What type must it be in Kconfig? Note, it is an array initializer similar to CONFIG_SYS_BAUDRATE_TABLE.

Quoted 6 lines
Quoted 2 lines

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.

#6 lore raw
Quoted 34 lines · Sergei Antonov
Quoted 26 lines · Sergei Antonov
Quoted 24 lines · Tom Rini
Quoted 21 lines · Sergei Antonov
Quoted 11 lines · Tom Rini
Quoted 8 lines · Sergei Antonov

CONFIG_SYS_FLASH_AUTOPROTECT_LIST is a feature of drivers/mtd/cfi_flash.c driver. It allows to specify a range of protected eraseblocks on flash memory.

Fixes build error:
Error: You must add new CONFIG options using Kconfig The following new ad-hoc CONFIG options were detected:
CONFIG_SYS_FLASH_AUTOPROTECT_LIST

Quoted 6 lines
Quoted 4 lines
---
 scripts/config_whitelist.txt | 1 +
 1 file changed, 1 insertion(+)

Please move this to Kconfig so that it can be enabled, thanks.

What type must it be in Kconfig? Note, it is an array initializer similar to CONFIG_SYS_BAUDRATE_TABLE.

Quoted 6 lines
Quoted 2 lines

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.

Quoted 6 lines

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?

Signature · 1 line
Tom
#7 lore raw
Quoted 12 lines · Tom Rini
Quoted 12 lines
Quoted 9 lines
Quoted 5 lines
Quoted 2 lines

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.

Quoted 7 lines
Quoted 4 lines

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.

#8 lore raw
Quoted 16 lines · Sergei Antonov
Quoted 15 lines · Tom Rini
Quoted 15 lines
Quoted 9 lines
Quoted 5 lines
Quoted 2 lines

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

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

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'm wary of adding and upstreaming a new binding here, as the next option would be to rename this to CFG_SYS_FLASH_AUTOPROTECT_LIST and continue to #define it.

Signature · 1 line
Tom
#9 lore raw
Quoted 20 lines · Tom Rini
Quoted 18 lines · Sergei Antonov
Quoted 17 lines · Tom Rini
Quoted 16 lines
Quoted 9 lines
Quoted 5 lines
Quoted 2 lines

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.

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

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@80000000 {
                        #address-cells = <1>;
                        #size-cells = <1>;
                        compatible = "cfi-flash";
                        reg = <0x80000000 0x0>;
                        ...
                }
#10 lore raw
Quoted 29 lines · Sergei Antonov
Quoted 20 lines · Tom Rini
Quoted 18 lines · Sergei Antonov
Quoted 17 lines · Tom Rini
Quoted 16 lines
Quoted 9 lines
Quoted 5 lines
Quoted 2 lines

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.

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

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?

Quoted 8 lines

I am using an existing "cfi-flash" driver:

                nor@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. But it's also fine to go with renaming this to be CFG_SYS_... and continue to #define it, instead.

Signature · 1 line
Tom
#11 lore raw
Quoted 40 lines · Tom Rini
Quoted 29 lines · Sergei Antonov
Quoted 20 lines · Tom Rini
Quoted 18 lines · Sergei Antonov
Quoted 17 lines · Tom Rini
Quoted 16 lines
Quoted 9 lines
Quoted 5 lines
Quoted 2 lines

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.

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

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?

Quoted 8 lines

I am using an existing "cfi-flash" driver:

                nor@80000000 {
                        #address-cells = <1>;
                        #size-cells = <1>;
                        compatible = "cfi-flash";
                        reg = <0x80000000 0x0>;
                        ...
                }
Quoted 5 lines

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@80000000 {
    #address-cells = <1>;
    #size-cells = <1>;
    compatible = "cfi-flash";
    reg = <0x80000000 0x0>;
    partitions {
      ...
      mtd1 {
        label = "bios";
        reg = <0x0 0x40000>;
        read-only;
      };
#12 lore raw
Quoted 48 lines · Sergei Antonov
Quoted 40 lines · Tom Rini
Quoted 29 lines · Sergei Antonov
Quoted 20 lines · Tom Rini
Quoted 18 lines · Sergei Antonov
Quoted 17 lines · Tom Rini
Quoted 16 lines
Quoted 9 lines
Quoted 5 lines
Quoted 2 lines

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.

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

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?

Quoted 8 lines

I am using an existing "cfi-flash" driver:

                nor@80000000 {
                        #address-cells = <1>;
                        #size-cells = <1>;
                        compatible = "cfi-flash";
                        reg = <0x80000000 0x0>;
                        ...
                }
Quoted 5 lines

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:

Quoted 12 lines
  nor@80000000 {
    #address-cells = <1>;
    #size-cells = <1>;
    compatible = "cfi-flash";
    reg = <0x80000000 0x0>;
    partitions {
      ...
      mtd1 {
        label = "bios";
        reg = <0x0 0x40000>;
        read-only;
      };

Yes, that's what I was trying to suggest. If you're interested in implementing it, that's great!

Signature · 1 line
Tom