ARM: OMAP: DTS: N900: fix onenand timings
diff mbox series

Message ID 20200308191934.8263-1-spinal.by@gmail.com
State New
Headers show
Series
  • ARM: OMAP: DTS: N900: fix onenand timings
Related show

Commit Message

Arthur D. March 8, 2020, 7:19 p.m. UTC
Commit a758f50f10cf ("mtd: onenand: omap2: Configure driver from DT")
started using DT specified timings for GPMC, and as a result the
OneNAND stopped working on N900 as we had wrong values in the DT.
Fix by updating the values to bootloader timings that have been tested
to be working on Nokia N900 with OneNAND manufacturers: Samsung,
Numonyx.

Fixes: a758f50f10cf ("mtd: onenand: omap2: Configure driver from DT")
Signed-off-by: Arthur Demchenkov <spinal.by@gmail.com>
---
 arch/arm/boot/dts/omap3-n900.dts | 44 +++++++++++++++++++++++++---------------
 1 file changed, 28 insertions(+), 16 deletions(-)

Comments

Merlijn Wajer March 9, 2020, 9:28 a.m. UTC | #1
Hi,

On 08/03/2020 20:19, Arthur Demchenkov wrote:
> Commit a758f50f10cf ("mtd: onenand: omap2: Configure driver from DT")
> started using DT specified timings for GPMC, and as a result the
> OneNAND stopped working on N900 as we had wrong values in the DT.
> Fix by updating the values to bootloader timings that have been tested
> to be working on Nokia N900 with OneNAND manufacturers: Samsung,
> Numonyx.
> 
> Fixes: a758f50f10cf ("mtd: onenand: omap2: Configure driver from DT")
> Signed-off-by: Arthur Demchenkov <spinal.by@gmail.com>

I've successfully tested this on my Nokia N900, so feel free to add:

Tested-by: Merlijn Wajer <merlijn@wizzup.org>

Cheers,
Merlijn
Roger Quadros March 9, 2020, 9:43 a.m. UTC | #2
On 08/03/2020 21:19, Arthur Demchenkov wrote:
> Commit a758f50f10cf ("mtd: onenand: omap2: Configure driver from DT")
> started using DT specified timings for GPMC, and as a result the
> OneNAND stopped working on N900 as we had wrong values in the DT.
> Fix by updating the values to bootloader timings that have been tested
> to be working on Nokia N900 with OneNAND manufacturers: Samsung,
> Numonyx.
> 
> Fixes: a758f50f10cf ("mtd: onenand: omap2: Configure driver from DT")
> Signed-off-by: Arthur Demchenkov <spinal.by@gmail.com>

Reviewed-by: Roger Quadros <rogerq@ti.com>

> ---
>   arch/arm/boot/dts/omap3-n900.dts | 44 +++++++++++++++++++++++++---------------
>   1 file changed, 28 insertions(+), 16 deletions(-)
> 
> diff --git a/arch/arm/boot/dts/omap3-n900.dts b/arch/arm/boot/dts/omap3-n900.dts
> index c3c6d7d04a76..4089d97405c9 100644
> --- a/arch/arm/boot/dts/omap3-n900.dts
> +++ b/arch/arm/boot/dts/omap3-n900.dts
> @@ -854,34 +854,46 @@
>   		compatible = "ti,omap2-onenand";
>   		reg = <0 0 0x20000>;	/* CS0, offset 0, IO size 128K */
>   
> +		/*
> +		 * These timings are based on CONFIG_OMAP_GPMC_DEBUG=y reported
> +		 * bootloader set values when booted with v5.1
> +		 * (OneNAND Manufacturer: Samsung):
> +		 *
> +		 *   cs0 GPMC_CS_CONFIG1: 0xfb001202
> +		 *   cs0 GPMC_CS_CONFIG2: 0x00111100
> +		 *   cs0 GPMC_CS_CONFIG3: 0x00020200
> +		 *   cs0 GPMC_CS_CONFIG4: 0x11001102
> +		 *   cs0 GPMC_CS_CONFIG5: 0x03101616
> +		 *   cs0 GPMC_CS_CONFIG6: 0x90060000
> +		 */
>   		gpmc,sync-read;
>   		gpmc,sync-write;
>   		gpmc,burst-length = <16>;
>   		gpmc,burst-read;
>   		gpmc,burst-wrap;
>   		gpmc,burst-write;
> -		gpmc,device-width = <2>; /* GPMC_DEVWIDTH_16BIT */
> -		gpmc,mux-add-data = <2>; /* GPMC_MUX_AD */
> +		gpmc,device-width = <2>;
> +		gpmc,mux-add-data = <2>;
>   		gpmc,cs-on-ns = <0>;
> -		gpmc,cs-rd-off-ns = <87>;
> -		gpmc,cs-wr-off-ns = <87>;
> +		gpmc,cs-rd-off-ns = <102>;
> +		gpmc,cs-wr-off-ns = <102>;
>   		gpmc,adv-on-ns = <0>;
> -		gpmc,adv-rd-off-ns = <10>;
> -		gpmc,adv-wr-off-ns = <10>;
> -		gpmc,oe-on-ns = <15>;
> -		gpmc,oe-off-ns = <87>;
> +		gpmc,adv-rd-off-ns = <12>;
> +		gpmc,adv-wr-off-ns = <12>;
> +		gpmc,oe-on-ns = <12>;
> +		gpmc,oe-off-ns = <102>;
>   		gpmc,we-on-ns = <0>;
> -		gpmc,we-off-ns = <87>;
> -		gpmc,rd-cycle-ns = <112>;
> -		gpmc,wr-cycle-ns = <112>;
> -		gpmc,access-ns = <81>;
> -		gpmc,page-burst-access-ns = <15>;
> +		gpmc,we-off-ns = <102>;
> +		gpmc,rd-cycle-ns = <132>;
> +		gpmc,wr-cycle-ns = <132>;
> +		gpmc,access-ns = <96>;
> +		gpmc,page-burst-access-ns = <18>;
>   		gpmc,bus-turnaround-ns = <0>;
>   		gpmc,cycle2cycle-delay-ns = <0>;
>   		gpmc,wait-monitoring-ns = <0>;
> -		gpmc,clk-activation-ns = <5>;
> -		gpmc,wr-data-mux-bus-ns = <30>;
> -		gpmc,wr-access-ns = <81>;
> +		gpmc,clk-activation-ns = <6>;
> +		gpmc,wr-data-mux-bus-ns = <36>;
> +		gpmc,wr-access-ns = <96>;
>   		gpmc,sync-clk-ps = <15000>;
>   
>   		/*
>
Tony Lindgren March 9, 2020, 4:59 p.m. UTC | #3
* Arthur Demchenkov <spinal.by@gmail.com> [200308 12:21]:
> Commit a758f50f10cf ("mtd: onenand: omap2: Configure driver from DT")
> started using DT specified timings for GPMC, and as a result the
> OneNAND stopped working on N900 as we had wrong values in the DT.
> Fix by updating the values to bootloader timings that have been tested
> to be working on Nokia N900 with OneNAND manufacturers: Samsung,
> Numonyx.
> 
> Fixes: a758f50f10cf ("mtd: onenand: omap2: Configure driver from DT")

Applying into fixes thanks.

Tony

Patch
diff mbox series

diff --git a/arch/arm/boot/dts/omap3-n900.dts b/arch/arm/boot/dts/omap3-n900.dts
index c3c6d7d04a76..4089d97405c9 100644
--- a/arch/arm/boot/dts/omap3-n900.dts
+++ b/arch/arm/boot/dts/omap3-n900.dts
@@ -854,34 +854,46 @@ 
 		compatible = "ti,omap2-onenand";
 		reg = <0 0 0x20000>;	/* CS0, offset 0, IO size 128K */
 
+		/*
+		 * These timings are based on CONFIG_OMAP_GPMC_DEBUG=y reported
+		 * bootloader set values when booted with v5.1
+		 * (OneNAND Manufacturer: Samsung):
+		 *
+		 *   cs0 GPMC_CS_CONFIG1: 0xfb001202
+		 *   cs0 GPMC_CS_CONFIG2: 0x00111100
+		 *   cs0 GPMC_CS_CONFIG3: 0x00020200
+		 *   cs0 GPMC_CS_CONFIG4: 0x11001102
+		 *   cs0 GPMC_CS_CONFIG5: 0x03101616
+		 *   cs0 GPMC_CS_CONFIG6: 0x90060000
+		 */
 		gpmc,sync-read;
 		gpmc,sync-write;
 		gpmc,burst-length = <16>;
 		gpmc,burst-read;
 		gpmc,burst-wrap;
 		gpmc,burst-write;
-		gpmc,device-width = <2>; /* GPMC_DEVWIDTH_16BIT */
-		gpmc,mux-add-data = <2>; /* GPMC_MUX_AD */
+		gpmc,device-width = <2>;
+		gpmc,mux-add-data = <2>;
 		gpmc,cs-on-ns = <0>;
-		gpmc,cs-rd-off-ns = <87>;
-		gpmc,cs-wr-off-ns = <87>;
+		gpmc,cs-rd-off-ns = <102>;
+		gpmc,cs-wr-off-ns = <102>;
 		gpmc,adv-on-ns = <0>;
-		gpmc,adv-rd-off-ns = <10>;
-		gpmc,adv-wr-off-ns = <10>;
-		gpmc,oe-on-ns = <15>;
-		gpmc,oe-off-ns = <87>;
+		gpmc,adv-rd-off-ns = <12>;
+		gpmc,adv-wr-off-ns = <12>;
+		gpmc,oe-on-ns = <12>;
+		gpmc,oe-off-ns = <102>;
 		gpmc,we-on-ns = <0>;
-		gpmc,we-off-ns = <87>;
-		gpmc,rd-cycle-ns = <112>;
-		gpmc,wr-cycle-ns = <112>;
-		gpmc,access-ns = <81>;
-		gpmc,page-burst-access-ns = <15>;
+		gpmc,we-off-ns = <102>;
+		gpmc,rd-cycle-ns = <132>;
+		gpmc,wr-cycle-ns = <132>;
+		gpmc,access-ns = <96>;
+		gpmc,page-burst-access-ns = <18>;
 		gpmc,bus-turnaround-ns = <0>;
 		gpmc,cycle2cycle-delay-ns = <0>;
 		gpmc,wait-monitoring-ns = <0>;
-		gpmc,clk-activation-ns = <5>;
-		gpmc,wr-data-mux-bus-ns = <30>;
-		gpmc,wr-access-ns = <81>;
+		gpmc,clk-activation-ns = <6>;
+		gpmc,wr-data-mux-bus-ns = <36>;
+		gpmc,wr-access-ns = <96>;
 		gpmc,sync-clk-ps = <15000>;
 
 		/*