Wed Apr 19 16:43:23 2023 UTC ()
Pull up following revision(s) (requested by tsutsui in ticket #1627):

	sys/arch/luna68k/luna68k/mainbus.c: revision 1.20

Fix device name for xpbus at mainbus for LUNA-II, missed on psgpam merge.

Fortunately harmless because xpbus_match() doesn't check ma_name in
mainbus_attach_args.


(martin)
diff -r1.15 -r1.15.18.1 src/sys/arch/luna68k/luna68k/mainbus.c

cvs diff -r1.15 -r1.15.18.1 src/sys/arch/luna68k/luna68k/mainbus.c (switch to unified diff)

--- src/sys/arch/luna68k/luna68k/mainbus.c 2017/03/09 14:05:59 1.15
+++ src/sys/arch/luna68k/luna68k/mainbus.c 2023/04/19 16:43:23 1.15.18.1
@@ -1,113 +1,113 @@ @@ -1,113 +1,113 @@
1/* $NetBSD: mainbus.c,v 1.15 2017/03/09 14:05:59 tsutsui Exp $ */ 1/* $NetBSD: mainbus.c,v 1.15.18.1 2023/04/19 16:43:23 martin Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2000 The NetBSD Foundation, Inc. 4 * Copyright (c) 2000 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Tohru Nishimura. 8 * by Tohru Nishimura.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright 15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the 16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution. 17 * documentation and/or other materials provided with the distribution.
18 * 18 *
19 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 19 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE. 29 * POSSIBILITY OF SUCH DAMAGE.
30 */ 30 */
31 31
32#include <sys/cdefs.h> 32#include <sys/cdefs.h>
33 33
34__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.15 2017/03/09 14:05:59 tsutsui Exp $"); 34__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.15.18.1 2023/04/19 16:43:23 martin Exp $");
35 35
36#include <sys/param.h> 36#include <sys/param.h>
37#include <sys/systm.h> 37#include <sys/systm.h>
38#include <sys/device.h> 38#include <sys/device.h>
39 39
40#include <machine/cpu.h> 40#include <machine/cpu.h>
41#include <machine/autoconf.h> 41#include <machine/autoconf.h>
42 42
43static const struct mainbus_attach_args luna_devs[] = { 43static const struct mainbus_attach_args luna_devs[] = {
44 { "clock", 0x45000000, -1 }, /* Mostek TimeKeeper */ 44 { "clock", 0x45000000, -1 }, /* Mostek TimeKeeper */
45 { "lcd", 0x4d000000, -1 }, /* Sharp LM16X212 LCD module */ 45 { "lcd", 0x4d000000, -1 }, /* Sharp LM16X212 LCD module */
46 { "le", 0xf1000000, 3 }, /* Am7990 */ 46 { "le", 0xf1000000, 3 }, /* Am7990 */
47 { "sio", 0x51000000, 6 }, /* uPD7201A */ 47 { "sio", 0x51000000, 6 }, /* uPD7201A */
48 { "xp", 0x71000000, 1 }, /* HD647180XP */ 48 { "xp", 0x71000000, 1 }, /* HD647180XP */
49 { "fb", 0xc1100000, -1 }, /* BrookTree RAMDAC */ 49 { "fb", 0xc1100000, -1 }, /* BrookTree RAMDAC */
50 { "spc", 0xe1000000, 2 }, /* MB89352 */ 50 { "spc", 0xe1000000, 2 }, /* MB89352 */
51}; 51};
52 52
53static const struct mainbus_attach_args luna2_devs[] = { 53static const struct mainbus_attach_args luna2_devs[] = {
54 { "clock", 0x45000000, -1 }, /* Dallas TimeKeeper */ 54 { "clock", 0x45000000, -1 }, /* Dallas TimeKeeper */
55 { "lcd", 0x4d000000, -1 }, /* Sharp LM16X212 LCD module */ 55 { "lcd", 0x4d000000, -1 }, /* Sharp LM16X212 LCD module */
56 { "le", 0xf1000000, 3 }, /* Am7990 */ 56 { "le", 0xf1000000, 3 }, /* Am7990 */
57 { "sio", 0x51000000, 6 }, /* uPD7201A */ 57 { "sio", 0x51000000, 6 }, /* uPD7201A */
58 { "xp", 0x71000000, 1 }, /* HD647180XP */ 58 { "xpbus", 0x71000000, -1 }, /* HD647180XP */
59 { "fb", 0xc1100000, -1 }, /* BrookTree RAMDAC */ 59 { "fb", 0xc1100000, -1 }, /* BrookTree RAMDAC */
60 { "spc", 0xe1000000, 2 }, /* internal MB89352 */ 60 { "spc", 0xe1000000, 2 }, /* internal MB89352 */
61 { "spc", 0xe1000040, 2 }, /* external MB89352 */ 61 { "spc", 0xe1000040, 2 }, /* external MB89352 */
62}; 62};
63 63
64static void mainbus_attach(device_t, device_t, void *); 64static void mainbus_attach(device_t, device_t, void *);
65static int mainbus_match(device_t, cfdata_t, void *); 65static int mainbus_match(device_t, cfdata_t, void *);
66static int mainbus_print(void *, const char *); 66static int mainbus_print(void *, const char *);
67 67
68CFATTACH_DECL_NEW(mainbus, 0, 68CFATTACH_DECL_NEW(mainbus, 0,
69 mainbus_match, mainbus_attach, NULL, NULL); 69 mainbus_match, mainbus_attach, NULL, NULL);
70 70
71static int 71static int
72mainbus_match(device_t parent, cfdata_t cf, void *args) 72mainbus_match(device_t parent, cfdata_t cf, void *args)
73{ 73{
74 static bool mainbus_matched; 74 static bool mainbus_matched;
75 75
76 if (mainbus_matched) 76 if (mainbus_matched)
77 return 0; 77 return 0;
78 78
79 mainbus_matched = true; 79 mainbus_matched = true;
80 return 1; 80 return 1;
81} 81}
82 82
83static void 83static void
84mainbus_attach(device_t parent, device_t self, void *args) 84mainbus_attach(device_t parent, device_t self, void *args)
85{ 85{
86 int i, ndevs; 86 int i, ndevs;
87 const struct mainbus_attach_args *devs; 87 const struct mainbus_attach_args *devs;
88 struct mainbus_attach_args ma; 88 struct mainbus_attach_args ma;
89 89
90 if (machtype == LUNA_II) { 90 if (machtype == LUNA_II) {
91 devs = luna2_devs; 91 devs = luna2_devs;
92 ndevs = __arraycount(luna2_devs); 92 ndevs = __arraycount(luna2_devs);
93 } else { 93 } else {
94 devs = luna_devs; 94 devs = luna_devs;
95 ndevs = __arraycount(luna_devs); 95 ndevs = __arraycount(luna_devs);
96 } 96 }
97 aprint_normal("\n"); 97 aprint_normal("\n");
98 for (i = 0; i < ndevs; i++) { 98 for (i = 0; i < ndevs; i++) {
99 ma = devs[i]; 99 ma = devs[i];
100 config_found(self, &ma, mainbus_print); 100 config_found(self, &ma, mainbus_print);
101 } 101 }
102} 102}
103 103
104static int 104static int
105mainbus_print(void *aux, const char *pnp) 105mainbus_print(void *aux, const char *pnp)
106{ 106{
107 struct mainbus_attach_args *ma = aux; 107 struct mainbus_attach_args *ma = aux;
108 108
109 if (pnp) 109 if (pnp)
110 aprint_normal("%s at %s", ma->ma_name, pnp); 110 aprint_normal("%s at %s", ma->ma_name, pnp);
111 111
112 return UNCONF; 112 return UNCONF;
113} 113}