v4.14.11 how to stop NAND timings overwrite @ at91sam9g20

This forum is for users of Microchip MPUs and who are interested in using Linux OS.

Moderator: nferre

Posts: 16
Joined: Mon Feb 19, 2018 12:41 pm

v4.14.11 how to stop NAND timings overwrite @ at91sam9g20

Tue Jun 26, 2018 11:14 am

Hi *,
we detected a very ugly overwrite by linux of SMC at AT91sam9g20 v4.14.11 .. how you can stop this bug at "choose any kernel you like" :oops: ?
https://git.kernel.org/pub/scm/linux/ke ... dae4b17d4b

Our fix is to write the wrong to internal SRAM instead of SMC registers !
We are so lucky that we found this "we kill your update" feature by ECC failures :D :D :D :D

Code: Select all

diff --git a/arch/arm/boot/dts/at91sam9260.dtsi b/arch/arm/boot/dts/at91sam9260.dtsi
index 6582f3cca929..acbc5c28dbf3 100644
--- a/arch/arm/boot/dts/at91sam9260.dtsi
+++ b/arch/arm/boot/dts/at91sam9260.dtsi
@@ -99,9 +99,9 @@
                                reg = <0xffffea00 0x200>;
-                       smc: smc@ffffec00 {
+                       smc: smc@00 {
                                compatible = "atmel,at91sam9260-smc", "syscon";
-                               reg = <0xffffec00 0x200>;
+                               reg = <0x00 0x200>;
                        matrix: matrix@ffffee00 {

Code: Select all

diff --git a/drivers/mfd/atmel-smc.c b/drivers/mfd/atmel-smc.c
index 7d77948567d7..793f81d4ccf8 100644
--- a/drivers/mfd/atmel-smc.c
+++ b/drivers/mfd/atmel-smc.c
@@ -247,10 +247,10 @@ EXPORT_SYMBOL_GPL(atmel_smc_cs_conf_set_cycle);
 void atmel_smc_cs_conf_apply(struct regmap *regmap, int cs,
                             const struct atmel_smc_cs_conf *conf)
-       regmap_write(regmap, ATMEL_SMC_SETUP(cs), conf->setup);
-       regmap_write(regmap, ATMEL_SMC_PULSE(cs), conf->pulse);
-       regmap_write(regmap, ATMEL_SMC_CYCLE(cs), conf->cycle);
-       regmap_write(regmap, ATMEL_SMC_MODE(cs), conf->mode);
+       //regmap_write(regmap, ATMEL_SMC_SETUP(cs), conf->setup);
+       //regmap_write(regmap, ATMEL_SMC_PULSE(cs), conf->pulse);
+       //regmap_write(regmap, ATMEL_SMC_CYCLE(cs), conf->cycle);
+       //regmap_write(regmap, ATMEL_SMC_MODE(cs), conf->mode);

Any hints how to avoid better are welcome because we dint define any property in our device tree
https://elixir.bootlin.com/linux/v4.14. ... el,ebi.txt
looks like its always mandatory to reprogramm bootstrap values :-(

Return to “LINUX”

Who is online

Users browsing this forum: No registered users and 15 guests