瀏覽代碼

arm: Keep track of the tlb size as well as its location

It may be necessary to know where the TLB area ends as well as where it
starts. This allows board code to complete a secure memory erase without
destroying the page tables.

Signed-off-by: Gabe Black <gabeblack@google.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
Gabe Black 12 年之前
父節點
當前提交
724cdffca1
共有 2 個文件被更改,包括 4 次插入2 次删除
  1. 1 0
      arch/arm/include/asm/global_data.h
  2. 3 2
      arch/arm/lib/board.c

+ 1 - 0
arch/arm/include/asm/global_data.h

@@ -73,6 +73,7 @@ typedef	struct	global_data {
 	unsigned long	reloc_off;
 	unsigned long	reloc_off;
 #if !(defined(CONFIG_SYS_ICACHE_OFF) && defined(CONFIG_SYS_DCACHE_OFF))
 #if !(defined(CONFIG_SYS_ICACHE_OFF) && defined(CONFIG_SYS_DCACHE_OFF))
 	unsigned long	tlb_addr;
 	unsigned long	tlb_addr;
+	unsigned long	tlb_size;
 #endif
 #endif
 	const void	*fdt_blob;	/* Our device tree, NULL if none */
 	const void	*fdt_blob;	/* Our device tree, NULL if none */
 	void		**jt;		/* jump table */
 	void		**jt;		/* jump table */

+ 3 - 2
arch/arm/lib/board.c

@@ -348,13 +348,14 @@ void board_init_f(ulong bootflag)
 
 
 #if !(defined(CONFIG_SYS_ICACHE_OFF) && defined(CONFIG_SYS_DCACHE_OFF))
 #if !(defined(CONFIG_SYS_ICACHE_OFF) && defined(CONFIG_SYS_DCACHE_OFF))
 	/* reserve TLB table */
 	/* reserve TLB table */
-	addr -= (4096 * 4);
+	gd->tlb_size = 4096 * 4;
+	addr -= gd->tlb_size;
 
 
 	/* round down to next 64 kB limit */
 	/* round down to next 64 kB limit */
 	addr &= ~(0x10000 - 1);
 	addr &= ~(0x10000 - 1);
 
 
 	gd->tlb_addr = addr;
 	gd->tlb_addr = addr;
-	debug("TLB table at: %08lx\n", addr);
+	debug("TLB table from %08lx to %08lx\n", addr, addr + gd->tlb_size);
 #endif
 #endif
 
 
 	/* round down to next 4 kB limit */
 	/* round down to next 4 kB limit */