[Skiboot] [PATCH v2 2/5] external/common: arm: Don't error trying to wrprotect with MTD access

Cyril Bur cyril.bur at au1.ibm.com
Mon Oct 24 15:36:47 AEDT 2016


If the access method to the flash is PNOR_MTD or BMC_MTD then the
actual access is being done for us by the kernel. This means we don't
need to worry about wrprotecting. The arch level shouldn't be returning
an error, it should be fall though.

Signed-off-by: Cyril Bur <cyril.bur at au1.ibm.com>
---
 external/common/arch_flash_arm.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/external/common/arch_flash_arm.c b/external/common/arch_flash_arm.c
index 4e71dd9..0776436 100644
--- a/external/common/arch_flash_arm.c
+++ b/external/common/arch_flash_arm.c
@@ -324,6 +324,9 @@ int arch_flash_set_wrprotect(struct blocklevel_device *bl, int set)
 	if (!arch_data.init_bl || arch_data.init_bl != bl)
 		return -1;
 
+	if (arch_data.access == PNOR_MTD || arch_data.access == BMC_MTD)
+		return 0; /* Kernel looks after this for us */
+
 	if (!arch_data.flash_chip)
 		return -1;
 
-- 
2.10.1



More information about the Skiboot mailing list