Mon Mar 29 14:27:36 2021 UTC ()
Use IBM405GP_UART0_BASE instead of hard-coded magic number 0xef000000.

No functional changes since:

	IBM405GP_UART0_BASE & ~(TLB_PG_SIZE - 1) == 0xef000000

See ppc4xx_tlb_reserve() in ibm4xx/pmap.c.


(rin)
diff -r1.60 -r1.61 src/sys/arch/evbppc/walnut/machdep.c

cvs diff -r1.60 -r1.61 src/sys/arch/evbppc/walnut/machdep.c (expand / switch to unified diff)

--- src/sys/arch/evbppc/walnut/machdep.c 2021/03/29 14:21:08 1.60
+++ src/sys/arch/evbppc/walnut/machdep.c 2021/03/29 14:27:36 1.61
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: machdep.c,v 1.60 2021/03/29 14:21:08 rin Exp $ */ 1/* $NetBSD: machdep.c,v 1.61 2021/03/29 14:27:36 rin Exp $ */
2 2
3/* 3/*
4 * Copyright 2001, 2002 Wasabi Systems, Inc. 4 * Copyright 2001, 2002 Wasabi Systems, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Written by Eduardo Horvath and Simon Burge for Wasabi Systems, Inc. 7 * Written by Eduardo Horvath and Simon Burge for Wasabi Systems, Inc.
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions 10 * modification, are permitted provided that the following conditions
11 * are met: 11 * are met:
12 * 1. Redistributions of source code must retain the above copyright 12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer. 13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright 14 * 2. Redistributions in binary form must reproduce the above copyright
@@ -57,27 +57,27 @@ @@ -57,27 +57,27 @@
57 * THIS SOFTWARE IS PROVIDED BY TOOLS GMBH ``AS IS'' AND ANY EXPRESS OR 57 * THIS SOFTWARE IS PROVIDED BY TOOLS GMBH ``AS IS'' AND ANY EXPRESS OR
58 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 58 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
59 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 59 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
60 * IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 60 * IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
61 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 61 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
62 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 62 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
63 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 63 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
64 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 64 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
65 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 65 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
66 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 66 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
67 */ 67 */
68 68
69#include <sys/cdefs.h> 69#include <sys/cdefs.h>
70__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.60 2021/03/29 14:21:08 rin Exp $"); 70__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.61 2021/03/29 14:27:36 rin Exp $");
71 71
72#include "opt_compat_netbsd.h" 72#include "opt_compat_netbsd.h"
73#include "opt_ddb.h" 73#include "opt_ddb.h"
74 74
75#include <sys/param.h> 75#include <sys/param.h>
76#include <sys/boot_flag.h> 76#include <sys/boot_flag.h>
77#include <sys/buf.h> 77#include <sys/buf.h>
78#include <sys/bus.h> 78#include <sys/bus.h>
79#include <sys/cpu.h> 79#include <sys/cpu.h>
80#include <sys/device.h> 80#include <sys/device.h>
81#include <sys/exec.h> 81#include <sys/exec.h>
82#include <sys/kernel.h> 82#include <sys/kernel.h>
83#include <sys/ksyms.h> 83#include <sys/ksyms.h>
@@ -96,26 +96,27 @@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v  @@ -96,26 +96,27 @@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v
96 96
97#include <prop/proplib.h> 97#include <prop/proplib.h>
98 98
99#include <machine/powerpc.h> 99#include <machine/powerpc.h>
100#include <machine/walnut.h> 100#include <machine/walnut.h>
101 101
102#include <powerpc/trap.h> 102#include <powerpc/trap.h>
103#include <powerpc/pcb.h> 103#include <powerpc/pcb.h>
104 104
105#include <powerpc/spr.h> 105#include <powerpc/spr.h>
106#include <powerpc/ibm4xx/spr.h> 106#include <powerpc/ibm4xx/spr.h>
107#include <powerpc/ibm4xx/cpu.h> 107#include <powerpc/ibm4xx/cpu.h>
108#include <powerpc/ibm4xx/dcr4xx.h> 108#include <powerpc/ibm4xx/dcr4xx.h>
 109#include <powerpc/ibm4xx/ibm405gp.h>
109 110
110#include <powerpc/ibm4xx/pci_machdep.h> 111#include <powerpc/ibm4xx/pci_machdep.h>
111 112
112#include <powerpc/pic/picvar.h> 113#include <powerpc/pic/picvar.h>
113 114
114#include <dev/cons.h> 115#include <dev/cons.h>
115#include <dev/pci/pcivar.h> 116#include <dev/pci/pcivar.h>
116#include <dev/pci/pciconf.h> 117#include <dev/pci/pciconf.h>
117 118
118#include "ksyms.h" 119#include "ksyms.h"
119 120
120#if defined(DDB) 121#if defined(DDB)
121#include <powerpc/db_machdep.h> 122#include <powerpc/db_machdep.h>
@@ -154,27 +155,27 @@ initppc(vaddr_t startkernel, vaddr_t end @@ -154,27 +155,27 @@ initppc(vaddr_t startkernel, vaddr_t end
154 cpu_probe_cache(); 155 cpu_probe_cache();
155 156
156 /* Save info block */ 157 /* Save info block */
157 memcpy(&board_data, info_block, sizeof(board_data)); 158 memcpy(&board_data, info_block, sizeof(board_data));
158 159
159 ibm40x_memsize_init(board_data.mem_size, startkernel); 160 ibm40x_memsize_init(board_data.mem_size, startkernel);
160 161
161 /* Linear map kernel memory */ 162 /* Linear map kernel memory */
162 for (vaddr_t va = 0; va < endkernel; va += TLB_PG_SIZE) { 163 for (vaddr_t va = 0; va < endkernel; va += TLB_PG_SIZE) {
163 ppc4xx_tlb_reserve(va, va, TLB_PG_SIZE, TLB_EX); 164 ppc4xx_tlb_reserve(va, va, TLB_PG_SIZE, TLB_EX);
164 } 165 }
165 166
166 /* Map console after physmem (see pmap_tlbmiss()) */ 167 /* Map console after physmem (see pmap_tlbmiss()) */
167 ppc4xx_tlb_reserve(0xef000000, 168 ppc4xx_tlb_reserve(IBM405GP_UART0_BASE,
168 roundup(board_data.mem_size, TLB_PG_SIZE), 169 roundup(board_data.mem_size, TLB_PG_SIZE),
169 TLB_PG_SIZE, TLB_I | TLB_G); 170 TLB_PG_SIZE, TLB_I | TLB_G);
170 171
171 mtspr(SPR_TCR, 0); /* disable all timers */ 172 mtspr(SPR_TCR, 0); /* disable all timers */
172 173
173 ibm4xx_init(startkernel, endkernel, pic_ext_intr); 174 ibm4xx_init(startkernel, endkernel, pic_ext_intr);
174 175
175#ifdef DEBUG 176#ifdef DEBUG
176 printf("Board config data:\n"); 177 printf("Board config data:\n");
177 printf(" usr_config_ver = %s\n", board_data.usr_config_ver); 178 printf(" usr_config_ver = %s\n", board_data.usr_config_ver);
178 printf(" rom_sw_ver = %s\n", board_data.rom_sw_ver); 179 printf(" rom_sw_ver = %s\n", board_data.rom_sw_ver);
179 printf(" mem_size = %u\n", board_data.mem_size); 180 printf(" mem_size = %u\n", board_data.mem_size);
180 printf(" mac_address_local = %02x:%02x:%02x:%02x:%02x:%02x\n", 181 printf(" mac_address_local = %02x:%02x:%02x:%02x:%02x:%02x\n",