From patchwork Tue Mar 15 21:22:08 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [v2] kernel: disable software protection bits for macronix flash chips at init From: Jan Kraus X-Patchwork-Id: 18 Message-Id: <1458076928-14154-2-git-send-email-mayosemmel@gmail.com> To: franken-dev@freifunk.net Cc: Jan Kraus Date: Tue, 15 Mar 2016 22:22:08 +0100 The bootloader of AirOS 5.6.x doesn't remove the flash protection for us, so we have to do this ourselves. Signed-off-by: Jan Kraus Reviewed-by: Tim Niemeyer --- ...ion-bits-for-macronix-flash-chips-at-init.patch | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 build_patches/0004-kernel-disable-software-protection-bits-for-macronix-flash-chips-at-init.patch diff --git a/build_patches/0004-kernel-disable-software-protection-bits-for-macronix-flash-chips-at-init.patch b/build_patches/0004-kernel-disable-software-protection-bits-for-macronix-flash-chips-at-init.patch new file mode 100644 index 0000000..a5b87ec --- /dev/null +++ b/build_patches/0004-kernel-disable-software-protection-bits-for-macronix-flash-chips-at-init.patch @@ -0,0 +1,22 @@ +From: Matthias Schiffer +Date: Fri, 26 Feb 2016 04:24:06 +0100 +Subject: kernel: disable software protection bits for macronix flash chips at init + +Backport of r47626 + +diff --git a/target/linux/generic/patches-3.18/465-m25p80-mx-disable-software-protection.patch b/target/linux/generic/patches-3.18/465-m25p80-mx-disable-software-protection.patch +new file mode 100644 +index 0000000..d7d7eec +--- /dev/null ++++ target/linux/generic/patches-3.18/465-m25p80-mx-disable-software-protection.patch +@@ -0,0 +1,10 @@ ++--- a/drivers/mtd/spi-nor/spi-nor.c +++++ b/drivers/mtd/spi-nor/spi-nor.c ++@@ -962,6 +962,7 @@ int spi_nor_scan(struct spi_nor *nor, co ++ ++ if (JEDEC_MFR(info->jedec_id) == CFI_MFR_ATMEL || ++ JEDEC_MFR(info->jedec_id) == CFI_MFR_INTEL || +++ JEDEC_MFR(info->jedec_id) == CFI_MFR_MACRONIX || ++ JEDEC_MFR(info->jedec_id) == CFI_MFR_SST) { ++ write_enable(nor); ++ write_sr(nor, 0);