[U-Boot] [RESEND PATCH v2] tegra2: Enable data cache

This enables the data cache on Tegra2 boards.
As discussed on the list, this is better off in the Tegra2 cpu code than in a particular vendor directory. We should be safe turning on the cache for all Tegra2 boards.
Signed-off-by: Simon Glass sjg@chromium.org --- Changes in v2: - Enable caches for all Tegra2 boards instead of just Nvidia ones
arch/arm/cpu/armv7/tegra2/board.c | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/arch/arm/cpu/armv7/tegra2/board.c b/arch/arm/cpu/armv7/tegra2/board.c index 9061d18..a996b88 100644 --- a/arch/arm/cpu/armv7/tegra2/board.c +++ b/arch/arm/cpu/armv7/tegra2/board.c @@ -86,3 +86,11 @@ int checkboard(void) return 0; } #endif /* CONFIG_DISPLAY_BOARDINFO */ + +#ifndef CONFIG_SYS_DCACHE_OFF +void enable_caches(void) +{ + /* Enable D-cache. I-cache is already enabled in start.S */ + dcache_enable(); +} +#endif

On Tue, Oct 11, 2011 at 5:35 PM, Simon Glass sjg@chromium.org wrote:
This enables the data cache on Tegra2 boards.
As discussed on the list, this is better off in the Tegra2 cpu code than in a particular vendor directory. We should be safe turning on the cache for all Tegra2 boards.
I don't think it's safe to turn on caches yet for Tegra. I have some MMC driver fixes I'll send up shortly that deal with unaligned DMA requests that are required before turning on caches. Without these some MMC transactions just hang.
Thanks, Anton
Signed-off-by: Simon Glass sjg@chromium.org
Changes in v2:
- Enable caches for all Tegra2 boards instead of just Nvidia ones
arch/arm/cpu/armv7/tegra2/board.c | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/arch/arm/cpu/armv7/tegra2/board.c b/arch/arm/cpu/armv7/tegra2/board.c index 9061d18..a996b88 100644 --- a/arch/arm/cpu/armv7/tegra2/board.c +++ b/arch/arm/cpu/armv7/tegra2/board.c @@ -86,3 +86,11 @@ int checkboard(void) return 0; } #endif /* CONFIG_DISPLAY_BOARDINFO */
+#ifndef CONFIG_SYS_DCACHE_OFF +void enable_caches(void) +{
- /* Enable D-cache. I-cache is already enabled in start.S */
- dcache_enable();
+}
+#endif
1.7.3.1
U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot

Hi Anton,
On Wed, Oct 12, 2011 at 10:54 AM, Anton Staaf robotboy@google.com wrote:
On Tue, Oct 11, 2011 at 5:35 PM, Simon Glass sjg@chromium.org wrote:
This enables the data cache on Tegra2 boards.
As discussed on the list, this is better off in the Tegra2 cpu code than in a particular vendor directory. We should be safe turning on the cache for all Tegra2 boards.
I don't think it's safe to turn on caches yet for Tegra. I have some MMC driver fixes I'll send up shortly that deal with unaligned DMA requests that are required before turning on caches. Without these some MMC transactions just hang.
Yes that's right since yesterday's merge of MMC into u-boot-arm (prior to that there was no working MMC!). Let's hold off applying this patch until you are done.
Regards, Simon
Thanks, Anton
Signed-off-by: Simon Glass sjg@chromium.org
Changes in v2:
- Enable caches for all Tegra2 boards instead of just Nvidia ones
arch/arm/cpu/armv7/tegra2/board.c | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/arch/arm/cpu/armv7/tegra2/board.c b/arch/arm/cpu/armv7/tegra2/board.c index 9061d18..a996b88 100644 --- a/arch/arm/cpu/armv7/tegra2/board.c +++ b/arch/arm/cpu/armv7/tegra2/board.c @@ -86,3 +86,11 @@ int checkboard(void) return 0; } #endif /* CONFIG_DISPLAY_BOARDINFO */
+#ifndef CONFIG_SYS_DCACHE_OFF +void enable_caches(void) +{
- /* Enable D-cache. I-cache is already enabled in start.S */
- dcache_enable();
+}
+#endif
1.7.3.1
U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot

Simon,
-----Original Message----- From: sjg@google.com [mailto:sjg@google.com] On Behalf Of Simon Glass Sent: Wednesday, October 12, 2011 2:13 PM To: Anton Staaf Cc: U-Boot Mailing List; Tom Warren Subject: Re: [U-Boot] [RESEND PATCH v2] tegra2: Enable data cache
Hi Anton,
On Wed, Oct 12, 2011 at 10:54 AM, Anton Staaf robotboy@google.com wrote:
On Tue, Oct 11, 2011 at 5:35 PM, Simon Glass sjg@chromium.org wrote:
This enables the data cache on Tegra2 boards.
As discussed on the list, this is better off in the Tegra2 cpu code than
in a
particular vendor directory. We should be safe turning on the cache for
all
Tegra2 boards.
I don't think it's safe to turn on caches yet for Tegra. I have some MMC
driver
fixes I'll send up shortly that deal with unaligned DMA requests that are required before turning on caches. Without these some MMC transactions just hang.
Yes that's right since yesterday's merge of MMC into u-boot-arm (prior to that there was no working MMC!). Let's hold off applying this patch until you are done.
I have to disagree with the 'no working MMC' statement. When I submitted my Tegra2 MMC driver in May, it was working fine on Seaboard (hadn't tested yet on Harmony since mine was dead). At that time, DCACHE was off, so no concurrency issues nor hangs were seen. Wolfgang merged it w/master in mid-July.
Just correcting for the record,
Tom
Regards, Simon
Thanks, Anton
Signed-off-by: Simon Glass sjg@chromium.org
Changes in v2:
- Enable caches for all Tegra2 boards instead of just Nvidia ones
arch/arm/cpu/armv7/tegra2/board.c | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/arch/arm/cpu/armv7/tegra2/board.c
b/arch/arm/cpu/armv7/tegra2/board.c
index 9061d18..a996b88 100644 --- a/arch/arm/cpu/armv7/tegra2/board.c +++ b/arch/arm/cpu/armv7/tegra2/board.c @@ -86,3 +86,11 @@ int checkboard(void) return 0; } #endif /* CONFIG_DISPLAY_BOARDINFO */
+#ifndef CONFIG_SYS_DCACHE_OFF +void enable_caches(void) +{
- /* Enable D-cache. I-cache is already enabled in start.S */
- dcache_enable();
+}
+#endif
1.7.3.1
U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
----------------------------------------------------------------------------------- This email message is for the sole use of the intended recipient(s) and may contain confidential information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. -----------------------------------------------------------------------------------

Hi Tom,
On Thu, Oct 13, 2011 at 5:06 PM, Tom Warren TWarren@nvidia.com wrote:
Simon,
-----Original Message----- From: sjg@google.com [mailto:sjg@google.com] On Behalf Of Simon Glass Sent: Wednesday, October 12, 2011 2:13 PM To: Anton Staaf Cc: U-Boot Mailing List; Tom Warren Subject: Re: [U-Boot] [RESEND PATCH v2] tegra2: Enable data cache
Hi Anton,
On Wed, Oct 12, 2011 at 10:54 AM, Anton Staaf robotboy@google.com wrote:
On Tue, Oct 11, 2011 at 5:35 PM, Simon Glass sjg@chromium.org wrote:
This enables the data cache on Tegra2 boards.
As discussed on the list, this is better off in the Tegra2 cpu code than
in a
particular vendor directory. We should be safe turning on the cache for
all
Tegra2 boards.
I don't think it's safe to turn on caches yet for Tegra. I have some MMC
driver
fixes I'll send up shortly that deal with unaligned DMA requests that are required before turning on caches. Without these some MMC transactions just hang.
Yes that's right since yesterday's merge of MMC into u-boot-arm (prior to that there was no working MMC!). Let's hold off applying this patch until you are done.
I have to disagree with the 'no working MMC' statement. When I submitted my Tegra2 MMC driver in May, it was working fine on Seaboard (hadn't tested yet on Harmony since mine was dead). At that time, DCACHE was off, so no concurrency issues nor hangs were seen. Wolfgang merged it w/master in mid-July.
Just correcting for the record,
Yes I suspect you are right, it could just be my Seaboard - I have a different one from what I was using a few months ago. With this new one I see:
HEAD is now at 8380095... mmc: Tegra2: Enable SD/MMC driver for Seaboard and Harmony
Tegra2 (SeaBoard) # mmc part 0 Card did not respond to voltage select! ## Unknown partition table Tegra2 (SeaBoard) # mmc part 1 Card did not respond to voltage select! ## Unknown partition table Tegra2 (SeaBoard) #
I also remember that it worked, so I put it down to the hardware change.
So, sorry for getting this wrong.
Regards, Simon
Tom
Regards, Simon
Thanks, Anton
Signed-off-by: Simon Glass sjg@chromium.org
Changes in v2:
- Enable caches for all Tegra2 boards instead of just Nvidia ones
arch/arm/cpu/armv7/tegra2/board.c | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/arch/arm/cpu/armv7/tegra2/board.c
b/arch/arm/cpu/armv7/tegra2/board.c
index 9061d18..a996b88 100644 --- a/arch/arm/cpu/armv7/tegra2/board.c +++ b/arch/arm/cpu/armv7/tegra2/board.c @@ -86,3 +86,11 @@ int checkboard(void) return 0; } #endif /* CONFIG_DISPLAY_BOARDINFO */
+#ifndef CONFIG_SYS_DCACHE_OFF +void enable_caches(void) +{
- /* Enable D-cache. I-cache is already enabled in start.S */
- dcache_enable();
+}
+#endif
1.7.3.1
U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
This email message is for the sole use of the intended recipient(s) and may contain confidential information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.

Simon Glass wrote at Thursday, October 13, 2011 6:18 PM:
On Thu, Oct 13, 2011 at 5:06 PM, Tom Warren TWarren@nvidia.com wrote:
Simon Glass wrote at Wednesday, October 12, 2011 2:13 PM:
...
Yes that's right since yesterday's merge of MMC into u-boot-arm (prior to that there was no working MMC!). Let's hold off applying this patch until you are done.
I have to disagree with the 'no working MMC' statement. When I submitted my Tegra2 MMC driver in May, it was working fine on Seaboard (hadn't tested yet on Harmony since mine was dead). At that time, DCACHE was off, so no concurrency issues nor hangs were seen. Wolfgang merged it w/master in mid-July.
Just correcting for the record,
Yes I suspect you are right, it could just be my Seaboard - I have a different one from what I was using a few months ago. With this new one I see:
I think the issue is that MMC/SD work OK with Tom's patch "tegra2: Enable MMC for Seaboard", which isn't yet merged into mainline U-Boot. Without that, neither the MMC nor SD slot worked for me.
For Harmony you'll need my patch "tegra2: Move board_mmc_init into board files", which is part of a series that's not yet merged.

Stephen,
-----Original Message----- From: Stephen Warren Sent: Friday, October 14, 2011 8:04 AM To: Simon Glass; Tom Warren Cc: Anton Staaf; U-Boot Mailing List Subject: RE: [U-Boot] [RESEND PATCH v2] tegra2: Enable data cache
Simon Glass wrote at Thursday, October 13, 2011 6:18 PM:
On Thu, Oct 13, 2011 at 5:06 PM, Tom Warren TWarren@nvidia.com wrote:
Simon Glass wrote at Wednesday, October 12, 2011 2:13 PM:
...
Yes that's right since yesterday's merge of MMC into u-boot-arm (prior to that there was no working MMC!). Let's hold off applying this patch until you are done.
I have to disagree with the 'no working MMC' statement. When I submitted
my Tegra2 MMC driver in
May, it was working fine on Seaboard (hadn't tested yet on Harmony since
mine was dead). At that time,
DCACHE was off, so no concurrency issues nor hangs were seen. Wolfgang
merged it w/master in mid-July.
Just correcting for the record,
Yes I suspect you are right, it could just be my Seaboard - I have a different one from what I was using a few months ago. With this new one I see:
I think the issue is that MMC/SD work OK with Tom's patch "tegra2: Enable MMC for Seaboard", which isn't yet merged into mainline U-Boot. Without that, neither the MMC nor SD slot worked for me.
Not to quibble, but see commit 74fac70084bb040342fafc3b0d2ef50fbe35646f:
commit 74fac70084bb040342fafc3b0d2ef50fbe35646f Merge: 1bb5e90 8fd01b8 Author: Wolfgang Denk wd@denx.de Date: Tue Jul 19 22:27:07 2011 +0200
Merge branch 'master' of git://git.denx.de/u-boot-mmc
* 'master' of git://git.denx.de/u-boot-mmc: mmc: rescan fails on empty slot AT91:mmc:fix multiple read/write error mmc: Access mode validation for eMMC cards > 2 GiB mmc: sh_mmcif: add support for Renesas MMCIF mmc: fix the condition for MMC version 4 MMC: add marvell sdhci driver MMC: add sdhci generic framework MMC: add erase function to both mmc and sd MMC: unify mmc read and write operation -> mmc: Tegra2: Enable SD/MMC driver for Seaboard and Harmony -> mmc: Tegra2: SD/MMC driver for Seaboard - eMMC on SDMMC4, SDIO on SDMMC3
It would appear that Wolfgang merged my changes into the master branch on July 19th, unless I'm misreading this. Note that I don't see any commit by me labeled "tegra2: Enable MMC for Seaboard" - I'm assuming you meant this one.
For Harmony you'll need my patch "tegra2: Move board_mmc_init into board files", which is part of a series that's not yet merged.
-- nvpublic

Tom Warren wrote at Friday, October 14, 2011 9:56 AM:
Stephen Warren wrote at Friday, October 14, 2011 8:04 AM:
Simon Glass wrote at Thursday, October 13, 2011 6:18 PM:
On Thu, Oct 13, 2011 at 5:06 PM, Tom Warren TWarren@nvidia.com wrote:
Simon Glass wrote at Wednesday, October 12, 2011 2:13 PM:
...
Yes that's right since yesterday's merge of MMC into u-boot-arm (prior to that there was no working MMC!). Let's hold off applying this patch until you are done.
I have to disagree with the 'no working MMC' statement. When I submitted my Tegra2 MMC driver in May, it was working fine on Seaboard (hadn't tested yet on Harmony since mine was dead). At that time, DCACHE was off, so no concurrency issues nor hangs were seen. Wolfgang merged it w/master in mid-July.
Just correcting for the record,
Yes I suspect you are right, it could just be my Seaboard - I have a different one from what I was using a few months ago. With this new one I see:
I think the issue is that MMC/SD work OK with Tom's patch "tegra2: Enable MMC for Seaboard", which isn't yet merged into mainline U-Boot. Without that, neither the MMC nor SD slot worked for me.
Not to quibble, but see commit 74fac70084bb040342fafc3b0d2ef50fbe35646f:
commit 74fac70084bb040342fafc3b0d2ef50fbe35646f Merge: 1bb5e90 8fd01b8 Author: Wolfgang Denk wd@denx.de Date: Tue Jul 19 22:27:07 2011 +0200
Merge branch 'master' of git://git.denx.de/u-boot-mmc
...
-> mmc: Tegra2: Enable SD/MMC driver for Seaboard and Harmony -> mmc: Tegra2: SD/MMC driver for Seaboard - eMMC on SDMMC4, SDIO on SDMMC3
It would appear that Wolfgang merged my changes into the master branch on July 19th, unless I'm misreading this. Note that I don't see any commit by me labeled "tegra2: Enable MMC for Seaboard" - I'm assuming you meant this one.
No, I meant the following:
http://patchwork.ozlabs.org/patch/115861/
This does at least two necessary things:
a) Drives the power GPIO for the SD slot, else it's turned off.
b) Adds MMC_MODE_HC to mmc->host_caps, without which the internal eMMC didn't work for me.

Hi Tom & Stephen,
On Fri, Oct 14, 2011 at 9:02 AM, Stephen Warren swarren@nvidia.com wrote:
Tom Warren wrote at Friday, October 14, 2011 9:56 AM:
Stephen Warren wrote at Friday, October 14, 2011 8:04 AM:
Simon Glass wrote at Thursday, October 13, 2011 6:18 PM:
On Thu, Oct 13, 2011 at 5:06 PM, Tom Warren TWarren@nvidia.com wrote:
Simon Glass wrote at Wednesday, October 12, 2011 2:13 PM:
...
Yes that's right since yesterday's merge of MMC into u-boot-arm (prior to that there was no working MMC!). Let's hold off applying this patch until you are done.
I have to disagree with the 'no working MMC' statement. When I submitted my Tegra2 MMC driver in May, it was working fine on Seaboard (hadn't tested yet on Harmony since mine was dead). At that time, DCACHE was off, so no concurrency issues nor hangs were seen. Wolfgang merged it w/master in mid-July.
Just correcting for the record,
Yes I suspect you are right, it could just be my Seaboard - I have a different one from what I was using a few months ago. With this new one I see:
I think the issue is that MMC/SD work OK with Tom's patch "tegra2: Enable MMC for Seaboard", which isn't yet merged into mainline U-Boot. Without that, neither the MMC nor SD slot worked for me.
Not to quibble, but see commit 74fac70084bb040342fafc3b0d2ef50fbe35646f:
commit 74fac70084bb040342fafc3b0d2ef50fbe35646f Merge: 1bb5e90 8fd01b8 Author: Wolfgang Denk wd@denx.de Date: Tue Jul 19 22:27:07 2011 +0200
Merge branch 'master' of git://git.denx.de/u-boot-mmc
...
-> mmc: Tegra2: Enable SD/MMC driver for Seaboard and Harmony -> mmc: Tegra2: SD/MMC driver for Seaboard - eMMC on SDMMC4, SDIO on SDMMC3
It would appear that Wolfgang merged my changes into the master branch on July 19th, unless I'm misreading this. Note that I don't see any commit by me labeled "tegra2: Enable MMC for Seaboard" - I'm assuming you meant this one.
No, I meant the following:
http://patchwork.ozlabs.org/patch/115861/
This does at least two necessary things:
a) Drives the power GPIO for the SD slot, else it's turned off.
b) Adds MMC_MODE_HC to mmc->host_caps, without which the internal eMMC didn't work for me.
OK I see. This is Tom's patch that I submitted. It has been merged into arm master now so we should see it in mainline soon. Hoping that Anton's MMC patch series will make it in very soon, then the dcache on patch and we will be cooking with gas.
Regards, Simon
-- nvpublic

On Fri, Oct 14, 2011 at 9:26 AM, Simon Glass sjg@chromium.org wrote:
Hi Tom & Stephen,
On Fri, Oct 14, 2011 at 9:02 AM, Stephen Warren swarren@nvidia.com wrote:
Tom Warren wrote at Friday, October 14, 2011 9:56 AM:
Stephen Warren wrote at Friday, October 14, 2011 8:04 AM:
Simon Glass wrote at Thursday, October 13, 2011 6:18 PM:
On Thu, Oct 13, 2011 at 5:06 PM, Tom Warren TWarren@nvidia.com wrote:
Simon Glass wrote at Wednesday, October 12, 2011 2:13 PM:
...
> Yes that's right since yesterday's merge of MMC into u-boot-arm (prior > to that there was no working MMC!). Let's hold off applying this patch > until you are done. >
I have to disagree with the 'no working MMC' statement. When I submitted my Tegra2 MMC driver in May, it was working fine on Seaboard (hadn't tested yet on Harmony since mine was dead). At that time, DCACHE was off, so no concurrency issues nor hangs were seen. Wolfgang merged it w/master in mid-July.
Just correcting for the record,
Yes I suspect you are right, it could just be my Seaboard - I have a different one from what I was using a few months ago. With this new one I see:
I think the issue is that MMC/SD work OK with Tom's patch "tegra2: Enable MMC for Seaboard", which isn't yet merged into mainline U-Boot. Without that, neither the MMC nor SD slot worked for me.
Not to quibble, but see commit 74fac70084bb040342fafc3b0d2ef50fbe35646f:
commit 74fac70084bb040342fafc3b0d2ef50fbe35646f Merge: 1bb5e90 8fd01b8 Author: Wolfgang Denk wd@denx.de Date: Tue Jul 19 22:27:07 2011 +0200
Merge branch 'master' of git://git.denx.de/u-boot-mmc
...
-> mmc: Tegra2: Enable SD/MMC driver for Seaboard and Harmony -> mmc: Tegra2: SD/MMC driver for Seaboard - eMMC on SDMMC4, SDIO on SDMMC3
It would appear that Wolfgang merged my changes into the master branch on July 19th, unless I'm misreading this. Note that I don't see any commit by me labeled "tegra2: Enable MMC for Seaboard" - I'm assuming you meant this one.
No, I meant the following:
http://patchwork.ozlabs.org/patch/115861/
This does at least two necessary things:
a) Drives the power GPIO for the SD slot, else it's turned off.
b) Adds MMC_MODE_HC to mmc->host_caps, without which the internal eMMC didn't work for me.
OK I see. This is Tom's patch that I submitted. It has been merged into arm master now so we should see it in mainline soon. Hoping that Anton's MMC patch series will make it in very soon, then the dcache on patch and we will be cooking with gas.
Indeed, just a FYI, SD cards seem to work for me on my Seaboard with ToT builds. But internal MMC does not.
-Anton
Regards, Simon
-- nvpublic
participants (4)
-
Anton Staaf
-
Simon Glass
-
Stephen Warren
-
Tom Warren