kernel_optimize_test/drivers/mtd/chips
Jean-Philippe Brucker b359ed5184 mtd: cfi_cmdset_0001: Support the absence of protection registers
The flash controller implemented by the Arm Base platform behaves like
the Intel StrataFlash J3 device, but omits several features. In
particular it doesn't implement a protection register, so "Number of
Protection register fields" in the Primary Vendor-Specific Extended
Query, is 0.

The Intel StrataFlash J3 datasheet only lists 1 as a valid value for
NumProtectionFields. It describes the field as:

	"Number of Protection register fields in JEDEC ID space.
	“00h,” indicates that 256 protection bytes are available"

While a value of 0 may arguably not be architecturally valid, the
driver's current behavior is certainly wrong: if NumProtectionFields is
0, read_pri_intelext() adds a negative value to the unsigned extra_size,
and ends up in an infinite loop.

Fix it by ignoring a NumProtectionFields of 0.

Signed-off-by: Jean-Philippe Brucker <jean-philippe@linaro.org>
Tested-by: Sudeep Holla <sudeep.holla@arm.com>
Tested-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
2020-04-30 23:42:57 +05:30
..
cfi_cmdset_0001.c mtd: cfi_cmdset_0001: Support the absence of protection registers 2020-04-30 23:42:57 +05:30
cfi_cmdset_0002.c mtd: Convert fallthrough comments into statements 2020-03-30 10:14:54 +02:00
cfi_cmdset_0020.c mtd: Convert fallthrough comments into statements 2020-03-30 10:14:54 +02:00
cfi_probe.c
cfi_util.c mtd: Convert fallthrough comments into statements 2020-03-30 10:14:54 +02:00
chipreg.c treewide: Add SPDX license identifier for more missed files 2019-05-21 10:50:45 +02:00
fwh_lock.h
gen_probe.c mtd: chips: gen_probe: kill useless initializer in mtd_do_chip_probe() 2019-08-27 17:08:18 +05:30
jedec_probe.c
Kconfig treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
Makefile
map_absent.c treewide: Add SPDX license identifier for more missed files 2019-05-21 10:50:45 +02:00
map_ram.c
map_rom.c