From: Kumar Gala <galak@kernel.crashing.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 02/15] Clean up usage of icache_disable/dcache_disable
Date: Fri, 15 Aug 2008 08:24:32 -0500 [thread overview]
Message-ID: <1218806685-3615-2-git-send-email-galak@kernel.crashing.org> (raw)
In-Reply-To: <1218806685-3615-1-git-send-email-galak@kernel.crashing.org>
There is no point in disabling the icache on 7xx/74xx/86xx parts and not
also flushing the icache. All callers of invalidate_l1_instruction_cache()
call icache_disable() right after. Make it so icache_disable() calls
invalidate_l1_instruction_cache() for us.
Also, dcache_disable() already calls dcache_flush() so there is no point
in the explicit calls of dcache_flush().
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
---
board/Marvell/db64360/db64360.c | 5 -----
board/Marvell/db64460/db64460.c | 5 -----
board/esd/cpci750/cpci750.c | 4 ----
board/freescale/mpc7448hpc2/mpc7448hpc2.c | 2 --
board/prodrive/p3mx/p3mx.c | 2 --
common/cmd_bootm.c | 2 --
cpu/74xx_7xx/cache.S | 4 ++++
cpu/mpc86xx/cache.S | 4 ++++
8 files changed, 8 insertions(+), 20 deletions(-)
diff --git a/board/Marvell/db64360/db64360.c b/board/Marvell/db64360/db64360.c
index a2ab2d7..2a810a6 100644
--- a/board/Marvell/db64360/db64360.c
+++ b/board/Marvell/db64360/db64360.c
@@ -51,9 +51,6 @@
#define DP(x)
#endif
-extern void flush_data_cache (void);
-extern void invalidate_l1_instruction_cache (void);
-
/* ------------------------------------------------------------------------- */
/* this is the current GT register space location */
@@ -930,7 +927,5 @@ void board_prebootm_init ()
my_remap_gt_regs_bootm (CFG_GT_REGS, BRIDGE_REG_BASE_BOOTM);
icache_disable ();
- invalidate_l1_instruction_cache ();
- flush_data_cache ();
dcache_disable ();
}
diff --git a/board/Marvell/db64460/db64460.c b/board/Marvell/db64460/db64460.c
index a4abf8d..1ae898d 100644
--- a/board/Marvell/db64460/db64460.c
+++ b/board/Marvell/db64460/db64460.c
@@ -51,9 +51,6 @@
#define DP(x)
#endif
-extern void flush_data_cache (void);
-extern void invalidate_l1_instruction_cache (void);
-
/* ------------------------------------------------------------------------- */
/* this is the current GT register space location */
@@ -930,7 +927,5 @@ void board_prebootm_init ()
my_remap_gt_regs_bootm (CFG_GT_REGS, BRIDGE_REG_BASE_BOOTM);
icache_disable ();
- invalidate_l1_instruction_cache ();
- flush_data_cache ();
dcache_disable ();
}
diff --git a/board/esd/cpci750/cpci750.c b/board/esd/cpci750/cpci750.c
index 298aa6a..5ab76c6 100644
--- a/board/esd/cpci750/cpci750.c
+++ b/board/esd/cpci750/cpci750.c
@@ -120,8 +120,6 @@ static char show_config_tab[][15] = {{"PCI0DLL_2 "}, /* 31 */
{"DRAMPLL_NDiv_1"}, /* 01 */
{"DRAMPLL_NDiv_0"}}; /* 00 */
-extern void flush_data_cache (void);
-extern void invalidate_l1_instruction_cache (void);
extern flash_info_t flash_info[];
/* ------------------------------------------------------------------------- */
@@ -961,8 +959,6 @@ void board_prebootm_init ()
my_remap_gt_regs_bootm (CFG_GT_REGS, CFG_DFL_GT_REGS);
icache_disable ();
- invalidate_l1_instruction_cache ();
- flush_data_cache ();
dcache_disable ();
}
diff --git a/board/freescale/mpc7448hpc2/mpc7448hpc2.c b/board/freescale/mpc7448hpc2/mpc7448hpc2.c
index b3d83cc..6f74c31 100644
--- a/board/freescale/mpc7448hpc2/mpc7448hpc2.c
+++ b/board/freescale/mpc7448hpc2/mpc7448hpc2.c
@@ -37,8 +37,6 @@
DECLARE_GLOBAL_DATA_PTR;
-extern void flush_data_cache (void);
-extern void invalidate_l1_instruction_cache (void);
extern void tsi108_init_f (void);
int display_mem_map (void);
diff --git a/board/prodrive/p3mx/p3mx.c b/board/prodrive/p3mx/p3mx.c
index d54ddaf..69d7c9b 100644
--- a/board/prodrive/p3mx/p3mx.c
+++ b/board/prodrive/p3mx/p3mx.c
@@ -62,8 +62,6 @@ DECLARE_GLOBAL_DATA_PTR;
#define DP(x)
#endif
-extern void flush_data_cache (void);
-extern void invalidate_l1_instruction_cache (void);
extern flash_info_t flash_info[];
/* ------------------------------------------------------------------------- */
diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c
index 5295969..0b14b06 100644
--- a/common/cmd_bootm.c
+++ b/common/cmd_bootm.c
@@ -236,8 +236,6 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
* bios emulation, so turn them off again
*/
icache_disable();
- invalidate_l1_instruction_cache();
- flush_data_cache();
dcache_disable();
#endif
diff --git a/cpu/74xx_7xx/cache.S b/cpu/74xx_7xx/cache.S
index 3a745cb..eac4544 100644
--- a/cpu/74xx_7xx/cache.S
+++ b/cpu/74xx_7xx/cache.S
@@ -245,6 +245,10 @@ _GLOBAL(icache_enable)
* Disable L1 Instruction cache
*/
_GLOBAL(icache_disable)
+ mflr r4
+ bl invalidate_l1_instruction_cache /* uses r3 */
+ sync
+ mtlr r4
mfspr r3, HID0
li r5, 0
ori r5, r5, HID0_ICE
diff --git a/cpu/mpc86xx/cache.S b/cpu/mpc86xx/cache.S
index 2e4ea02..80ff688 100644
--- a/cpu/mpc86xx/cache.S
+++ b/cpu/mpc86xx/cache.S
@@ -232,6 +232,10 @@ _GLOBAL(icache_enable)
* Disable L1 Instruction cache
*/
_GLOBAL(icache_disable)
+ mflr r4
+ bl invalidate_l1_instruction_cache /* uses r3 */
+ sync
+ mtlr r4
mfspr r3, HID0
li r5, 0
ori r5, r5, HID0_ICE
--
1.5.5.1
next prev parent reply other threads:[~2008-08-15 13:24 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-15 13:24 [U-Boot] [PATCH 01/15] Update linux bootm to support ePAPR client interface Kumar Gala
2008-08-15 13:24 ` Kumar Gala [this message]
2008-08-15 13:24 ` [U-Boot] [PATCH 03/15] Add command to enable/disable interrupts Kumar Gala
2008-08-15 13:24 ` [U-Boot] [PATCH 04/15] fdt: added the ability to set initrd start/end via chosen command Kumar Gala
2008-08-15 13:24 ` [U-Boot] [PATCH 05/15] fdt: fdt addr w/o any args reports back the current working address Kumar Gala
2008-08-15 13:24 ` [U-Boot] [PATCH 06/15] bootm: refactor entry point code Kumar Gala
2008-08-15 13:24 ` [U-Boot] [PATCH 07/15] bootm: refactor ramdisk locating code Kumar Gala
2008-08-15 13:24 ` [U-Boot] [PATCH 08/15] bootm: refactor fdt locating and relocation code Kumar Gala
2008-08-15 13:24 ` [U-Boot] [PATCH 09/15] bootm: Set working fdt address as part of the bootm flow Kumar Gala
2008-08-15 13:24 ` [U-Boot] [PATCH 10/15] bootm: move lmb into the bootm_headers_t structure Kumar Gala
2008-08-15 13:24 ` [U-Boot] [PATCH 11/15] bootm: refactor image detection and os load steps Kumar Gala
2008-08-15 13:24 ` [U-Boot] [PATCH 12/15] fdt: refactor fdt resize code Kumar Gala
2008-08-15 13:24 ` [U-Boot] [PATCH 13/15] fdt: refactor initrd related code Kumar Gala
2008-08-15 13:24 ` [U-Boot] [PATCH 14/15] fdt: Added resize command Kumar Gala
2008-08-15 13:24 ` [U-Boot] [PATCH 15/15] bootm: refactor do_reset and os boot function args Kumar Gala
2008-08-26 21:48 ` Wolfgang Denk
2008-08-26 21:46 ` [U-Boot] [PATCH 14/15] fdt: Added resize command Wolfgang Denk
2008-08-26 21:45 ` [U-Boot] [PATCH 13/15] fdt: refactor initrd related code Wolfgang Denk
2008-08-26 21:45 ` Wolfgang Denk
2008-08-26 21:43 ` [U-Boot] [PATCH 12/15] fdt: refactor fdt resize code Wolfgang Denk
2008-08-26 21:42 ` [U-Boot] [PATCH 11/15] bootm: refactor image detection and os load steps Wolfgang Denk
2008-08-26 21:38 ` [U-Boot] [PATCH 10/15] bootm: move lmb into the bootm_headers_t structure Wolfgang Denk
2008-08-26 21:37 ` [U-Boot] [PATCH 09/15] bootm: Set working fdt address as part of the bootm flow Wolfgang Denk
2008-08-26 21:37 ` [U-Boot] [PATCH 08/15] bootm: refactor fdt locating and relocation code Wolfgang Denk
2008-08-26 21:35 ` [U-Boot] [PATCH 07/15] bootm: refactor ramdisk locating code Wolfgang Denk
2008-08-21 12:02 ` [U-Boot] [PATCH 06/15] bootm: refactor entry point code Kumar Gala
2008-08-26 21:34 ` Wolfgang Denk
2008-08-26 21:47 ` Jerry Van Baren
2008-08-26 21:57 ` Wolfgang Denk
2008-08-27 0:07 ` Kumar Gala
2008-08-26 21:31 ` Wolfgang Denk
2008-08-18 23:07 ` [U-Boot] [PATCH 05/15] fdt: fdt addr w/o any args reports back the current working address Wolfgang Denk
2008-08-18 23:23 ` Jerry Van Baren
2008-08-20 22:56 ` Wolfgang Denk
2008-08-18 23:04 ` [U-Boot] [PATCH 04/15] fdt: added the ability to set initrd start/end via chosen command Wolfgang Denk
2008-08-20 22:56 ` Wolfgang Denk
2008-08-18 22:59 ` [U-Boot] [PATCH 03/15] Add command to enable/disable interrupts Wolfgang Denk
2008-08-18 23:18 ` Kumar Gala
2008-08-20 22:53 ` Wolfgang Denk
2008-08-18 22:57 ` [U-Boot] [PATCH 02/15] Clean up usage of icache_disable/dcache_disable Wolfgang Denk
2008-08-18 22:55 ` [U-Boot] [PATCH 01/15] Update linux bootm to support ePAPR client interface Wolfgang Denk
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1218806685-3615-2-git-send-email-galak@kernel.crashing.org \
--to=galak@kernel.crashing.org \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox