Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/evbarm/rpi Don't depend on any memory split for ini...



details:   https://anonhg.NetBSD.org/src/rev/a2678215d2af
branches:  trunk
changeset: 781580:a2678215d2af
user:      skrll <skrll%NetBSD.org@localhost>
date:      Sun Sep 16 14:14:56 2012 +0000

description:
Don't depend on any memory split for initial L1 table. Size kernel mapping
according to actual size.

diffstat:

 sys/arch/evbarm/rpi/rpi_start.S |  21 +++++++++------------
 1 files changed, 9 insertions(+), 12 deletions(-)

diffs (63 lines):

diff -r b59a2fb1d8f7 -r a2678215d2af sys/arch/evbarm/rpi/rpi_start.S
--- a/sys/arch/evbarm/rpi/rpi_start.S   Sun Sep 16 13:47:41 2012 +0000
+++ b/sys/arch/evbarm/rpi/rpi_start.S   Sun Sep 16 14:14:56 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rpi_start.S,v 1.5 2012/08/22 12:36:35 jakllsch Exp $   */
+/*     $NetBSD: rpi_start.S,v 1.6 2012/09/16 14:14:56 skrll Exp $      */
 
 /*
  * Copyright (c) 2002, 2003  Genetec Corporation.  All rights reserved.
@@ -87,11 +87,7 @@
 #include <arm/armreg.h>
 #include "assym.h"
 
-RCSID("$NetBSD: rpi_start.S,v 1.5 2012/08/22 12:36:35 jakllsch Exp $")
-
-/* Location (in MiB) to put temporary MMU tables just below. */
-/* Raspberry Pi start.elf will give us anywhere between 128MiB and 240MiB */
-#define MINSPLIT 128
+RCSID("$NetBSD: rpi_start.S,v 1.6 2012/09/16 14:14:56 skrll Exp $")
 
 /*
  * Workaround Erratum 411920 
@@ -177,6 +173,7 @@
        bhi     2b
 
 3:     ldmia   itable!, {va,pa,n_sec,attr}
+       mov     n_sec, n_sec, lsr #L1_S_SHIFT
        /* Convert va to l1 offset:     va = 4 * (va >> L1_S_SHIFT)     */
        mov     va, va, LSR #L1_S_SHIFT
        mov     va, va, LSL #2
@@ -259,8 +256,8 @@
        .word   L1_S_FRAME
 
 Ltemp_l1_table:
-       /* Put the temporary L1 translation table at the end of SDRAM. */
-       .word   0x00000000 + MINSPLIT * 0x100000 - L1_TABLE_SIZE
+       /* Put the temporary L1 translation table just below the kernel. */
+       .word   0x4000
        
 Lstart:
        .word   start
@@ -310,17 +307,17 @@
 
 mmu_init_table:
        /* Add 1MB of VA==PA at 0x00000000 so we can keep the kernel going */
-       MMU_INIT(0x00000000, 0x00000000,
-           (MINSPLIT * L1_S_SIZE + L1_S_SIZE - 1) / L1_S_SIZE, 
+       MMU_INIT(0x0, 0x0,
+           (_end - KERNEL_BASE + L1_S_SIZE - 1),
            L1_S_PROTO | L1_S_AP_KRW)
 
        MMU_INIT(KERNEL_BASE, 0x0,
-           (MINSPLIT * L1_S_SIZE + L1_S_SIZE - 1) / L1_S_SIZE,
+           (_end - KERNEL_BASE + L1_S_SIZE - 1),
            L1_S_PROTO | L1_S_AP_KRW  | L1_S_B | L1_S_C)
 
        /* Map the 16MB of peripherals */
        MMU_INIT(RPI_KERNEL_IO_VBASE, RPI_KERNEL_IO_PBASE,
-           (RPI_KERNEL_IO_VSIZE + L1_S_SIZE - 1) / L1_S_SIZE,
+           (RPI_KERNEL_IO_VSIZE + L1_S_SIZE - 1),
            L1_S_PROTO | L1_S_AP_KRW)
 
        /* end of table */



Home | Main Index | Thread Index | Old Index