[U-Boot] [PATCH 1/2] integratorap: disable dcache
The Integrator AP with CM920T (ARM920T) does not boot without D-cache disabled throughout, the actual problem comes at "bootm", at this point U-Boot tries to disable D-cache which doesn't work on this machine for some reason. The result is usually an illegal instruction trap or similar as the PC goes astray in memory and crash something like this: undefined instruction pc : [<01ff1c44>] lr : [<01fd8430>] sp : 01fa7e08 ip : 01fa7dc0 fp : r10: 01fef318 r9 : 0015 r8 : 01fa7f70 r7 : 0015 r6 : 8000 r5 : 01fa7fe8 r4 : r3 : 01fef380 r2 : 01fef8b0 r1 : r0 : fffe Flags: Nzcv IRQs off FIQs off Mode SVC_32 Resetting CPU ... Disabling D-cache brings the board support to a working state that can boot the Linux kernel. Signed-off-by: Linus Walleij --- include/configs/integratorap.h |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/include/configs/integratorap.h b/include/configs/integratorap.h index 26eac8b..acdb37c 100644 --- a/include/configs/integratorap.h +++ b/include/configs/integratorap.h @@ -48,6 +48,7 @@ #define CONFIG_CM_INIT 1 #define CONFIG_CM_REMAP1 #undef CONFIG_CM_SPD_DETECT +#define CONFIG_SYS_DCACHE_OFF /* * Size of malloc() pool -- 1.7.6 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 1/2] integratorap: disable dcache
Dear Linus Walleij, In message <1310598267-9711-1-git-send-email-linus.wall...@linaro.org> you wrote: > The Integrator AP with CM920T (ARM920T) does not boot without > D-cache disabled throughout, the actual problem comes at "bootm", > at this point U-Boot tries to disable D-cache which doesn't work > on this machine for some reason. The result is usually an > illegal instruction trap or similar as the PC goes astray in > memory and crash something like this: > > undefined instruction > pc : [<01ff1c44>] lr : [<01fd8430>] > sp : 01fa7e08 ip : 01fa7dc0 fp : > r10: 01fef318 r9 : 0015 r8 : 01fa7f70 > r7 : 0015 r6 : 8000 r5 : 01fa7fe8 r4 : > r3 : 01fef380 r2 : 01fef8b0 r1 : r0 : fffe > Flags: Nzcv IRQs off FIQs off Mode SVC_32 > Resetting CPU ... > > Disabling D-cache brings the board support to a working state that > can boot the Linux kernel. > > Signed-off-by: Linus Walleij > --- > include/configs/integratorap.h |1 + > 1 files changed, 1 insertions(+), 0 deletions(-) Sorry, but again I have to point out that I really dislike papering over existing bugs. If the disable D-cache in bootm does not work, _this_ should be analyzed and fixed instead of globally disabling he data cache. NAK. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de In accord with UNIX philosophy, Perl gives you enough rope to hang yourself. - L. Wall & R. L. Schwartz, _Programming Perl_ ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 1/2] integratorap: disable dcache
On Thu, Jul 14, 2011 at 1:39 PM, Wolfgang Denk wrote: > Sorry, but again I have to point out that I really dislike papering > over existing bugs. If the disable D-cache in bootm does not work, > _this_ should be analyzed and fixed instead of globally disabling he > data cache. No problem, I didn't label it as RFC since what it does is actually fix a regression. At one point U-boot was working on the Integrator and now it doesn't, it seems commit 880eff5cfb9df6f0855f4e48affd349ca64692e9 "ARM: cp15: setup mmu and enable dcache" is causing it. Heiko, Alessandro, do you have any hints on how to go about flushing and disabling the D-cache in bootm for ARM920T? It doesn't seem to work on this ARM CPU chip in its current form... Yours, Linus Walleij ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 1/2] integratorap: disable dcache
Hello Linus, Linus Walleij wrote: > On Thu, Jul 14, 2011 at 1:39 PM, Wolfgang Denk wrote: > >> Sorry, but again I have to point out that I really dislike papering >> over existing bugs. If the disable D-cache in bootm does not work, >> _this_ should be analyzed and fixed instead of globally disabling he >> data cache. > > No problem, I didn't label it as RFC since what it does is actually fix a > regression. > > At one point U-boot was working on the Integrator and now > it doesn't, it seems commit 880eff5cfb9df6f0855f4e48affd349ca64692e9 > "ARM: cp15: setup mmu and enable dcache" is causing it. > > Heiko, Alessandro, do you have any hints on how to go about flushing > and disabling the D-cache in bootm for ARM920T? It doesn't seem to > work on this ARM CPU chip in its current form... Hmm.. trying bootm with actual u-boot on a davinci (arm926ejs) based board, there I couldn;t use the Davinci-EMAC (if I disable the dcache it works ...) Seems above commit introduced problems for other arm architectures, drivers, ... Hmm... if we globally always enable the dcache, we have a lot of more drivers to fix (I think) ... bye, Heiko -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 1/2] integratorap: disable dcache
On Fri, Jul 15, 2011 at 09:42:53AM +0200, Heiko Schocher wrote: > Hmm.. trying bootm with actual u-boot on a davinci (arm926ejs) based > board, there I couldn;t use the Davinci-EMAC (if I disable the dcache > it works ...) I can confirm there are some cache coherency problems with the DaVinci EMAC driver. I've done a port to a new board based on the DA850 and had problems with corrupt Ethernet packets until I disabled the dcache altogether. The clue was the packets started working when I added a hex dump just before eth_send()! While I haven't come across any explicit documentation I presume the EMAC controller's independent DMA engine is simply not aware of the ARM's cache. I haven't yet identified whether there's some mechanism already in U-Boot for marking particular bits of memory as uncacheable, which would seem to be the correct approach, but turning of dcache doesn't really have any side effects that cause problems for me. Bye for now, -- Laurence Withers, http://www.guralp.com/ Direct tel:+447753988197 or tel:+44408643 Software Engineer General support queries: CMG-DCM CMG-EAM CMG-NAM ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 1/2] integratorap: disable dcache
Hi Laurence, On Friday 15 July 2011 10:54:41 Laurence Withers wrote: > On Fri, Jul 15, 2011 at 09:42:53AM +0200, Heiko Schocher wrote: > > Hmm.. trying bootm with actual u-boot on a davinci (arm926ejs) based > > board, there I couldn;t use the Davinci-EMAC (if I disable the dcache > > it works ...) > > I can confirm there are some cache coherency problems with the DaVinci EMAC > driver. I've done a port to a new board based on the DA850 and had problems > with corrupt Ethernet packets until I disabled the dcache altogether. The > clue was the packets started working when I added a hex dump just before > eth_send()! > > While I haven't come across any explicit documentation I presume the EMAC > controller's independent DMA engine is simply not aware of the ARM's cache. Yes. > I haven't yet identified whether there's some mechanism already in U-Boot > for marking particular bits of memory as uncacheable, which would seem to > be the correct approach, but turning of dcache doesn't really have any > side effects that cause problems for me. The "side effect" is a slow down on boot time. And it should be avoided if possible. We have stumbled over this d-cache "problem" on powerpc a while ago. I suggest you take a look at the EHCI driver for example (drivers/usb/host/ehci-hcd.c). Please search for CONFIG_EHCI_DCACHE). We implemented the following functions on powerpc for d-cache handling: - flush_dcache_range() - invalidate_dcache_range() The API was taken from Linux at that time. Now I notice that unfortunately this API seems to be powerpc specific in Linux. IMHO it would make sense to either implement this API for all other platforms using dcache with DMA engines (e.g. USB), or introduce another cache/flush/invalidate API and move powerpc to it as well. Best regards, Stefan -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-0 Fax: (+49)-8142-66989-80 Email: off...@denx.de ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 1/2] integratorap: disable dcache
On Fri, Jul 15, 2011 at 9:42 AM, Heiko Schocher wrote: >> Heiko, Alessandro, do you have any hints on how to go about flushing >> and disabling the D-cache in bootm for ARM920T? It doesn't seem to >> work on this ARM CPU chip in its current form... > > Hmm.. trying bootm with actual u-boot on a davinci (arm926ejs) based > board, there I couldn;t use the Davinci-EMAC (if I disable the dcache > it works ...) I take it that due to the above you cannot even get so far as to testing "bootm" on that platform with recent kernels? If you upload the kernel with say "loady" over serial (this is what I have to use on this board that has no ethernet) then does the "bootm" command work? Thanks, Linus Walleij ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot