w1: w1-gpio: Loosen timings to improve cold boot reliability
PATCH 1/1 w1: w1-gpio: Loosen timings to improve cold boot reliability
From: Chris Morgan <[email protected]>
On my NTC CHIP whenever I do a cold boot any attached DIPs cannot be found. Rebooting on the other hand appears to fix the issue. I found that if I modified the timing slightly (but still within spec) the w1 identification on cold boot became far more reliable.
--- drivers/w1/w1-gpio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/w1/w1-gpio.c +2 -2
@@ -22,8 +22,8 @@#define W1_TIMING_E 9#define W1_TIMING_F 55#define W1_TIMING_G 0 -#define W1_TIMING_H 480 -#define W1_TIMING_I 70 +#define W1_TIMING_H 600 +#define W1_TIMING_I 100#define W1_TIMING_J 410struct w1_gpio_pdata {
Signature · 1 line
2.30.2
Quoted 28 lines · Chris Morgan
From: Chris Morgan <[email protected]>
On my NTC CHIP whenever I do a cold boot any attached DIPs cannot be found. Rebooting on the other hand appears to fix the issue. I found that if I modified the timing slightly (but still within spec) the w1 identification on cold boot became far more reliable.
Signed-off-by Chris Morgan <[email protected]>--- drivers/w1/w1-gpio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/w1/w1-gpio.c +2
-3@@ -22,8 +22,8 @@#define W1_TIMING_E 9#define W1_TIMING_F 55#define W1_TIMING_G 0 -#define W1_TIMING_H 480 -#define W1_TIMING_I 70 +#define W1_TIMING_H 600 +#define W1_TIMING_I 100#define W1_TIMING_J 410struct w1_gpio_pdata { --
Quoted 2 lines
2.30.2
Hi,
Thanks for your patch,
I will test this on my boards at some point, but I can't promise exactly when.
If there are any other users of this protocol, I think they should test it as well.
Eugen
Quoted 28 lines · Chris Morgan
From: Chris Morgan <[email protected]>
On my NTC CHIP whenever I do a cold boot any attached DIPs cannot be found. Rebooting on the other hand appears to fix the issue. I found that if I modified the timing slightly (but still within spec) the w1 identification on cold boot became far more reliable.
Signed-off-by Chris Morgan <[email protected]>--- drivers/w1/w1-gpio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/w1/w1-gpio.c +2
-3@@ -22,8 +22,8 @@#define W1_TIMING_E 9#define W1_TIMING_F 55#define W1_TIMING_G 0 -#define W1_TIMING_H 480 -#define W1_TIMING_I 70 +#define W1_TIMING_H 600 +#define W1_TIMING_I 100#define W1_TIMING_J 410struct w1_gpio_pdata { --
Quoted 2 lines
2.30.2
Hi Chris,
I tested your patch on my board sama5d2_xplained, and it works. Thus, you can add my
However, I disagree with the changes you did in timings. What I found was that timing 'H' could go up to 640 , but timing 'I' to a maximum of 75 or so. [1]
I am thinking maybe you could also check your udelays with a scope on the 1wire line ? Because your problem might be in fact in some other part , like udelays not properly aligned/synchronized/accurate at cold boot time, depending on the source of clock you are using.
Eugen
Quoted 39 lines · On Mon, Nov 22, 2021 at 11:16:22AM +0000, [email protected] wrote:
Quoted 28 lines · Chris Morgan
From: Chris Morgan <[email protected]>
On my NTC CHIP whenever I do a cold boot any attached DIPs cannot be found. Rebooting on the other hand appears to fix the issue. I found that if I modified the timing slightly (but still within spec) the w1 identification on cold boot became far more reliable.
Signed-off-by Chris Morgan <[email protected]>--- drivers/w1/w1-gpio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/w1/w1-gpio.c +2
-3@@ -22,8 +22,8 @@#define W1_TIMING_E 9#define W1_TIMING_F 55#define W1_TIMING_G 0 -#define W1_TIMING_H 480 -#define W1_TIMING_I 70 +#define W1_TIMING_H 600 +#define W1_TIMING_I 100#define W1_TIMING_J 410struct w1_gpio_pdata { --Quoted 2 lines
2.30.2
Hi Chris,
I tested your patch on my board
sama5d2_xplained, and it works. Thus, you can add myTested-by Eugen Hristev <[email protected]>
Quoted 8 lines
However, I disagree with the changes you did in timings. What I found was that timing 'H' could go up to 640 , but timing 'I' to a maximum of 75 or so. [1]
I am thinking maybe you could also check your udelays with a scope on the 1wire line ? Because your problem might be in fact in some other part , like udelays not properly aligned/synchronized/accurate at cold boot time, depending on the source of clock you are using.
I lack a scope, but will extensively test 640 and 75 as the new timings. Would that be acceptable?
Thank you.
Quoted 49 lines · Chris Morgan
Quoted 39 lines · On Mon, Nov 22, 2021 at 11:16:22AM +0000, [email protected] wrote:
Quoted 28 lines · Chris Morgan
From: Chris Morgan <[email protected]>
On my NTC CHIP whenever I do a cold boot any attached DIPs cannot be found. Rebooting on the other hand appears to fix the issue. I found that if I modified the timing slightly (but still within spec) the w1 identification on cold boot became far more reliable.
Signed-off-by Chris Morgan <[email protected]>--- drivers/w1/w1-gpio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/w1/w1-gpio.c +2
-3@@ -22,8 +22,8 @@#define W1_TIMING_E 9#define W1_TIMING_F 55#define W1_TIMING_G 0 -#define W1_TIMING_H 480 -#define W1_TIMING_I 70 +#define W1_TIMING_H 600 +#define W1_TIMING_I 100#define W1_TIMING_J 410struct w1_gpio_pdata { --Quoted 2 lines
2.30.2
Hi Chris,
I tested your patch on my board
sama5d2_xplained, and it works. Thus, you can add myTested-by Eugen Hristev <[email protected]>Quoted 8 lines
However, I disagree with the changes you did in timings. What I found was that timing 'H' could go up to 640 , but timing 'I' to a maximum of 75 or so. [1]
I am thinking maybe you could also check your udelays with a scope on the 1wire line ? Because your problem might be in fact in some other part , like udelays not properly aligned/synchronized/accurate at cold boot time, depending on the source of clock you are using.
Quoted 4 lines
I lack a scope, but will extensively test 640 and 75 as the new timings. Would that be acceptable?
Thank you.
Hi Chris,
The timings should be in spec, however, if your particular SoC has a problem with delays, this should be investigated.
Does your board with with the maximum timings ? (but still in spec)
Eugen
Quoted 53 lines · On 12/9/21 10:27 AM, Eugen Hristev - M18282 wrote:
Quoted 52 lines · Chris Morgan
Quoted 39 lines · On Mon, Nov 22, 2021 at 11:16:22AM +0000, [email protected] wrote:
Quoted 28 lines · Chris Morgan
From: Chris Morgan <[email protected]>
On my NTC CHIP whenever I do a cold boot any attached DIPs cannot be found. Rebooting on the other hand appears to fix the issue. I found that if I modified the timing slightly (but still within spec) the w1 identification on cold boot became far more reliable.
Signed-off-by Chris Morgan <[email protected]>--- drivers/w1/w1-gpio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/w1/w1-gpio.c +2
-3@@ -22,8 +22,8 @@#define W1_TIMING_E 9#define W1_TIMING_F 55#define W1_TIMING_G 0 -#define W1_TIMING_H 480 -#define W1_TIMING_I 70 +#define W1_TIMING_H 600 +#define W1_TIMING_I 100#define W1_TIMING_J 410struct w1_gpio_pdata { --Quoted 2 lines
2.30.2
Hi Chris,
I tested your patch on my board
sama5d2_xplained, and it works. Thus, you can add myTested-by Eugen Hristev <[email protected]>Quoted 8 lines
However, I disagree with the changes you did in timings. What I found was that timing 'H' could go up to 640 , but timing 'I' to a maximum of 75 or so. [1]
I am thinking maybe you could also check your udelays with a scope on the 1wire line ? Because your problem might be in fact in some other part , like udelays not properly aligned/synchronized/accurate at cold boot time, depending on the source of clock you are using.
I lack a scope, but will extensively test 640 and 75 as the new timings. Would that be acceptable?
Quoted 8 lines
Quoted 1 line
Thank you.
Hi Chris,
The timings should be in spec, however, if your particular SoC has a problem with delays, this should be investigated.
Does your board with with the maximum timings ? (but still in spec)
Hi Chris,
I am moving this patch to 'Changes requested' and waiting on your reply about 640 / 75 timings which you said you will test.
Eugen
Quoted 10 lines
Eugen
Quoted 61 lines · On Tue, Apr 26, 2022 at 06:49:20AM +0000, [email protected] wrote:
Quoted 60 lines · On 12/9/21 10:27 AM, Eugen Hristev - M18282 wrote:
Quoted 49 lines · Chris Morgan
Quoted 39 lines · On Mon, Nov 22, 2021 at 11:16:22AM +0000, [email protected] wrote:
Quoted 28 lines · Chris Morgan
From: Chris Morgan <[email protected]>
On my NTC CHIP whenever I do a cold boot any attached DIPs cannot be found. Rebooting on the other hand appears to fix the issue. I found that if I modified the timing slightly (but still within spec) the w1 identification on cold boot became far more reliable.
Signed-off-by Chris Morgan <[email protected]>--- drivers/w1/w1-gpio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/w1/w1-gpio.c +2
-3@@ -22,8 +22,8 @@#define W1_TIMING_E 9#define W1_TIMING_F 55#define W1_TIMING_G 0 -#define W1_TIMING_H 480 -#define W1_TIMING_I 70 +#define W1_TIMING_H 600 +#define W1_TIMING_I 100#define W1_TIMING_J 410struct w1_gpio_pdata { --Quoted 2 lines
2.30.2
Hi Chris,
I tested your patch on my board
sama5d2_xplained, and it works. Thus, you can add myTested-by Eugen Hristev <[email protected]>Quoted 8 lines
However, I disagree with the changes you did in timings. What I found was that timing 'H' could go up to 640 , but timing 'I' to a maximum of 75 or so. [1]
I am thinking maybe you could also check your udelays with a scope on the 1wire line ? Because your problem might be in fact in some other part , like udelays not properly aligned/synchronized/accurate at cold boot time, depending on the source of clock you are using.
Quoted 4 lines
I lack a scope, but will extensively test 640 and 75 as the new timings. Would that be acceptable?
Thank you.
Hi Chris,
The timings should be in spec, however, if your particular SoC has a problem with delays, this should be investigated.
Quoted 7 lines
Quoted 1 line
Does your board with with the maximum timings ? (but still in spec)
Hi Chris,
I am moving this patch to 'Changes requested' and waiting on your reply about 640 / 75 timings which you said you will test.
I tested. It works better, but still fails some of the time on cold boot (warm boots always seem to succeed though). For some reason so far I am only able to get the original timings I submitted to work consistently.
I have tested this on both an NTC CHIP and a prototype Source Parts Popcorn, both with similar effect (warm boot fine, cold boot intermittant). Both boards use the same SOC and are tested with the same DIP (a PocketCHIP).
If this needs to be made board specific to overcome an issue with the Allwinner R8 let me know and maybe we can figure out a board specific override.
Thank you.
Quoted 14 lines
Eugen
Quoted 10 lines
Eugen