[U-Boot] [PATCH] 83xx: correctly set encryption and I2C bus 0 clock

This patch makes sure the correct mask is applied when setting the encryption and I2C bus 0 clock in SCCR. Failing to do so may lead to ENCCM being 0 in which case I2C bus 0 won't function.
--- cpu/mpc83xx/cpu_init.c.org 2009-03-11 07:56:57.000000000 +0100 +++ cpu/mpc83xx/cpu_init.c 2009-03-11 07:57:37.000000000 +0100 @@ -106,7 +106,7 @@ void cpu_init_f (volatile immap_t * im) #ifdef CONFIG_SYS_SCCR_ENCCM /* Encryption clock mode */ im->clk.sccr = (im->clk.sccr & ~SCCR_ENCCM) | - (CONFIG_SYS_SCCR_ENCCM << SCCR_PCICM_SHIFT); + (CONFIG_SYS_SCCR_ENCCM << SCCR_ENCCM_SHIFT); #endif
#ifdef CONFIG_SYS_SCCR_PCICM
Signed-off-by: Norbert van Bolhuis nvbolhuis@aimvalley.nl

Hello Norbert,
added Kim Phillips to cc as he is the 83xx maintainer
Norbert van Bolhuis wrote:
This patch makes sure the correct mask is applied when setting the encryption and I2C bus 0 clock in SCCR. Failing to do so may lead to ENCCM being 0 in which case I2C bus 0 won't function.
--- cpu/mpc83xx/cpu_init.c.org 2009-03-11 07:56:57.000000000 +0100 +++ cpu/mpc83xx/cpu_init.c 2009-03-11 07:57:37.000000000 +0100 @@ -106,7 +106,7 @@ void cpu_init_f (volatile immap_t * im) #ifdef CONFIG_SYS_SCCR_ENCCM /* Encryption clock mode */ im->clk.sccr = (im->clk.sccr & ~SCCR_ENCCM) |
(CONFIG_SYS_SCCR_ENCCM << SCCR_PCICM_SHIFT);
(CONFIG_SYS_SCCR_ENCCM << SCCR_ENCCM_SHIFT);
#endif
#ifdef CONFIG_SYS_SCCR_PCICM
Signed-off-by: Norbert van Bolhuis nvbolhuis@aimvalley.nl
Can you please use git-format-patch for making a patch? Otherwise your patch seems okay to me,
thanks Heiko

On Wed, 11 Mar 2009 09:33:04 +0100 Heiko Schocher hs@denx.de wrote:
--- cpu/mpc83xx/cpu_init.c.org 2009-03-11 07:56:57.000000000 +0100 +++ cpu/mpc83xx/cpu_init.c 2009-03-11 07:57:37.000000000 +0100 @@ -106,7 +106,7 @@ void cpu_init_f (volatile immap_t * im) #ifdef CONFIG_SYS_SCCR_ENCCM /* Encryption clock mode */ im->clk.sccr = (im->clk.sccr & ~SCCR_ENCCM) |
(CONFIG_SYS_SCCR_ENCCM << SCCR_PCICM_SHIFT);
(CONFIG_SYS_SCCR_ENCCM << SCCR_ENCCM_SHIFT);
#endif
#ifdef CONFIG_SYS_SCCR_PCICM
Signed-off-by: Norbert van Bolhuis nvbolhuis@aimvalley.nl
Can you please use git-format-patch for making a patch? Otherwise your patch seems okay to me,
heh, I thought it wouldn't be a problem, but you're right Heiko:
Applying: 83xx: correctly set encryption and I2C bus 0 clock error: mpc83xx/cpu_init.c: does not exist in index Patch failed at 0001. When you have resolved this problem run "git am -i --resolved". If you would prefer to skip this patch, instead run "git am -i --skip". To restore the original branch and stop patching run "git am -i --abort".
even patch(1) asks which file to patch.
Norbert, can you please follow proper patch submission guidelines and resubmit? We would appreciate it as much as its (and future patches') content.
Thanks,
Kim

On Wed, Mar 11, 2009 at 12:57:43PM -0500, Kim Phillips wrote:
heh, I thought it wouldn't be a problem, but you're right Heiko:
Applying: 83xx: correctly set encryption and I2C bus 0 clock error: mpc83xx/cpu_init.c: does not exist in index Patch failed at 0001. When you have resolved this problem run "git am -i --resolved". If you would prefer to skip this patch, instead run "git am -i --skip". To restore the original branch and stop patching run "git am -i --abort".
even patch(1) asks which file to patch.
Try "git am -p0".
-Scott

On Wed, 11 Mar 2009 13:22:05 -0500 Scott Wood scottwood@freescale.com wrote:
On Wed, Mar 11, 2009 at 12:57:43PM -0500, Kim Phillips wrote:
heh, I thought it wouldn't be a problem, but you're right Heiko:
Applying: 83xx: correctly set encryption and I2C bus 0 clock error: mpc83xx/cpu_init.c: does not exist in index Patch failed at 0001. When you have resolved this problem run "git am -i --resolved". If you would prefer to skip this patch, instead run "git am -i --skip". To restore the original branch and stop patching run "git am -i --abort".
even patch(1) asks which file to patch.
Try "git am -p0".
right. That yields another problem:
Applying: 83xx: correctly set encryption and I2C bus 0 clock error: patch failed: cpu/mpc83xx/cpu_init.c:106 error: cpu/mpc83xx/cpu_init.c: patch does not apply Patch failed at 0001. When you have resolved this problem run "git am --resolved". If you would prefer to skip this patch, instead run "git am --skip". To restore the original branch and stop patching run "git am --abort".
It appears Norbert cut-n-pasted the diff and thus introduced whitespace errors.
I can obviously apply this by hand but I'd rather get Norbert up to speed with submitting patches, esp. for the sake of future, potentially unwieldy, contributions.
Kim

Kim,
Yes I just cut-n-pasted it. I hope it's better now.
Regards, Norbert.
Kim Phillips wrote:
On Wed, 11 Mar 2009 13:22:05 -0500 Scott Wood scottwood@freescale.com wrote:
On Wed, Mar 11, 2009 at 12:57:43PM -0500, Kim Phillips wrote:
heh, I thought it wouldn't be a problem, but you're right Heiko:
Applying: 83xx: correctly set encryption and I2C bus 0 clock error: mpc83xx/cpu_init.c: does not exist in index Patch failed at 0001. When you have resolved this problem run "git am -i --resolved". If you would prefer to skip this patch, instead run "git am -i --skip". To restore the original branch and stop patching run "git am -i --abort".
even patch(1) asks which file to patch.
Try "git am -p0".
right. That yields another problem:
Applying: 83xx: correctly set encryption and I2C bus 0 clock error: patch failed: cpu/mpc83xx/cpu_init.c:106 error: cpu/mpc83xx/cpu_init.c: patch does not apply Patch failed at 0001. When you have resolved this problem run "git am --resolved". If you would prefer to skip this patch, instead run "git am --skip". To restore the original branch and stop patching run "git am --abort".
It appears Norbert cut-n-pasted the diff and thus introduced whitespace errors.
I can obviously apply this by hand but I'd rather get Norbert up to speed with submitting patches, esp. for the sake of future, potentially unwieldy, contributions.
Kim

Dear Norbert van Bolhuis,
In message 49B8B26B.4090104@aimvalley.nl you wrote:
Yes I just cut-n-pasted it. I hope it's better now.
No, it is not better.
Patches should be sent inline, and not as attachments. It would be best if you used git-send-email to post the patch.
Also, your Signed-off-by: line is missing in the patch.
And it would be better if you used git-format-patch to create the patch.
Sorry for the trouble for a one-line-fix, but I think it is important to learn these things right in the beginning - the less efforts will be there when it comes to real work.
Best regards,
Wolfgang Denk

OK, no problem. Eventually I'll get it right :-) 3rd (and hopefully final) attempt:
This patch makes sure the correct mask is applied when setting the encryption and I2C bus 0 clock in SCCR. Failing to do so may lead to ENCCM being 0 in which case I2C bus 0 won't function.
diff --git a/cpu/mpc83xx/cpu_init.c b/cpu/mpc83xx/cpu_init.c index 491c2e5..8e9c875 100644 --- a/cpu/mpc83xx/cpu_init.c +++ b/cpu/mpc83xx/cpu_init.c @@ -106,7 +106,7 @@ void cpu_init_f (volatile immap_t * im) #ifdef CONFIG_SYS_SCCR_ENCCM /* Encryption clock mode */ im->clk.sccr = (im->clk.sccr & ~SCCR_ENCCM) | - (CONFIG_SYS_SCCR_ENCCM << SCCR_PCICM_SHIFT); + (CONFIG_SYS_SCCR_ENCCM << SCCR_ENCCM_SHIFT); #endif
#ifdef CONFIG_SYS_SCCR_PCICM

On Fri, 13 Mar 2009 08:58:14 +0100 Norbert van Bolhuis nvbolhuis@aimvalley.nl wrote:
OK, no problem. Eventually I'll get it right :-) 3rd (and hopefully final) attempt:
something is still wrong with the way you are submitting this patch:
Applying: mpc83xx: correctly set encryption and I2C bus 0 clock error: patch failed: cpu/mpc83xx/cpu_init.c:106 error: cpu/mpc83xx/cpu_init.c: patch does not apply Using index info to reconstruct a base tree... error: patch failed: cpu/mpc83xx/cpu_init.c:106 error: cpu/mpc83xx/cpu_init.c: patch does not apply Did you hand edit your patch? It does not apply to blobs recorded in its index. Cannot fall back to three-way merge. Patch failed at 0001.
but since I'm out next week and this should go in now, I'm manually applying it. Next time, try sending the patch to yourself and test if you can apply it before sending it here. More information can be found in linux-2.6/Documentation/{SubmittingPatches,email-clients.txt}.
Thanks for your contribution,
Kim
participants (5)
-
Heiko Schocher
-
Kim Phillips
-
Norbert van Bolhuis
-
Scott Wood
-
Wolfgang Denk