| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: mainbus.c,v 1.8 2021/08/07 16:18:55 thorpej Exp $ */ | | 1 | /* $NetBSD: mainbus.c,v 1.9 2022/03/30 22:34:48 macallan Exp $ */ |
2 | | | 2 | |
3 | /*- | | 3 | /*- |
4 | * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc. | | 4 | * Copyright (c) 2001, 2002 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 Matthew Fredette. | | 8 | * by Matthew Fredette. |
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. |
| @@ -48,27 +48,27 @@ | | | @@ -48,27 +48,27 @@ |
48 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | | 48 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
49 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | | 49 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
50 | * IN NO EVENT SHALL THE AUTHOR OR HIS RELATIVES BE LIABLE FOR ANY DIRECT, | | 50 | * IN NO EVENT SHALL THE AUTHOR OR HIS RELATIVES BE LIABLE FOR ANY DIRECT, |
51 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | | 51 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
52 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | | 52 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
53 | * SERVICES; LOSS OF MIND, USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | | 53 | * SERVICES; LOSS OF MIND, USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
54 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | | 54 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, |
55 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING | | 55 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING |
56 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF | | 56 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF |
57 | * THE POSSIBILITY OF SUCH DAMAGE. | | 57 | * THE POSSIBILITY OF SUCH DAMAGE. |
58 | */ | | 58 | */ |
59 | | | 59 | |
60 | #include <sys/cdefs.h> | | 60 | #include <sys/cdefs.h> |
61 | __KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.8 2021/08/07 16:18:55 thorpej Exp $"); | | 61 | __KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.9 2022/03/30 22:34:48 macallan Exp $"); |
62 | | | 62 | |
63 | #include "locators.h" | | 63 | #include "locators.h" |
64 | #include "power.h" | | 64 | #include "power.h" |
65 | #include "lcd.h" | | 65 | #include "lcd.h" |
66 | | | 66 | |
67 | #include <sys/param.h> | | 67 | #include <sys/param.h> |
68 | #include <sys/systm.h> | | 68 | #include <sys/systm.h> |
69 | #include <sys/device.h> | | 69 | #include <sys/device.h> |
70 | #include <sys/reboot.h> | | 70 | #include <sys/reboot.h> |
71 | #include <sys/extent.h> | | 71 | #include <sys/extent.h> |
72 | #include <sys/mbuf.h> | | 72 | #include <sys/mbuf.h> |
73 | #include <sys/proc.h> | | 73 | #include <sys/proc.h> |
74 | #include <sys/kmem.h> | | 74 | #include <sys/kmem.h> |
| @@ -1402,36 +1402,42 @@ mbattach(device_t parent, device_t self, | | | @@ -1402,36 +1402,42 @@ mbattach(device_t parent, device_t self, |
1402 | | | 1402 | |
1403 | #if NPOWER > 0 | | 1403 | #if NPOWER > 0 |
1404 | /* get some power */ | | 1404 | /* get some power */ |
1405 | memset(&nca, 0, sizeof(nca)); | | 1405 | memset(&nca, 0, sizeof(nca)); |
1406 | nca.ca_name = "power"; | | 1406 | nca.ca_name = "power"; |
1407 | nca.ca_irq = HPPACF_IRQ_UNDEF; | | 1407 | nca.ca_irq = HPPACF_IRQ_UNDEF; |
1408 | nca.ca_iot = &hppa_bustag; | | 1408 | nca.ca_iot = &hppa_bustag; |
1409 | config_found(self, &nca, mbprint, CFARGS_NONE); | | 1409 | config_found(self, &nca, mbprint, CFARGS_NONE); |
1410 | #endif | | 1410 | #endif |
1411 | | | 1411 | |
1412 | #if NLCD > 0 | | 1412 | #if NLCD > 0 |
1413 | memset(&nca, 0, sizeof(nca)); | | 1413 | memset(&nca, 0, sizeof(nca)); |
1414 | err = pdcproc_chassis_info(&pdc_chassis_info, &nca.ca_pcl); | | 1414 | err = pdcproc_chassis_info(&pdc_chassis_info, &nca.ca_pcl); |
1415 | if (!err && nca.ca_pcl.enabled) { | | 1415 | if (!err) { |
1416 | nca.ca_name = "lcd"; | | 1416 | if (nca.ca_pcl.enabled) { |
1417 | nca.ca_dp.dp_bc[0] = nca.ca_dp.dp_bc[1] = nca.ca_dp.dp_bc[2] = | | 1417 | nca.ca_name = "lcd"; |
1418 | nca.ca_dp.dp_bc[3] = nca.ca_dp.dp_bc[4] = nca.ca_dp.dp_bc[5] = -1; | | 1418 | nca.ca_dp.dp_bc[0] = nca.ca_dp.dp_bc[1] = nca.ca_dp.dp_bc[2] = |
1419 | nca.ca_dp.dp_mod = -1; | | 1419 | nca.ca_dp.dp_bc[3] = nca.ca_dp.dp_bc[4] = nca.ca_dp.dp_bc[5] = -1; |
1420 | nca.ca_irq = HPPACF_IRQ_UNDEF; | | 1420 | nca.ca_dp.dp_mod = -1; |
1421 | nca.ca_iot = &hppa_bustag; | | 1421 | nca.ca_irq = HPPACF_IRQ_UNDEF; |
1422 | nca.ca_hpa = nca.ca_pcl.cmd_addr; | | 1422 | nca.ca_iot = &hppa_bustag; |
1423 | | | 1423 | nca.ca_hpa = nca.ca_pcl.cmd_addr; |
1424 | config_found(self, &nca, mbprint, CFARGS_NONE); | | 1424 | |
| | | 1425 | config_found(self, &nca, mbprint, CFARGS_NONE); |
| | | 1426 | } else if (nca.ca_pcl.model == 2) { |
| | | 1427 | bus_space_map(&hppa_bustag, nca.ca_pcl.cmd_addr, |
| | | 1428 | 4, 0, (bus_space_handle_t *)&machine_ledaddr); |
| | | 1429 | machine_ledword = 1; |
| | | 1430 | } |
1425 | } | | 1431 | } |
1426 | #endif | | 1432 | #endif |
1427 | | | 1433 | |
1428 | hppa_modules_scan(); | | 1434 | hppa_modules_scan(); |
1429 | | | 1435 | |
1430 | /* Search and attach all CPUs and memory controllers. */ | | 1436 | /* Search and attach all CPUs and memory controllers. */ |
1431 | memset(&nca, 0, sizeof(nca)); | | 1437 | memset(&nca, 0, sizeof(nca)); |
1432 | nca.ca_name = "mainbus"; | | 1438 | nca.ca_name = "mainbus"; |
1433 | nca.ca_hpa = 0; | | 1439 | nca.ca_hpa = 0; |
1434 | nca.ca_hpabase = HPPA_FPA; /* Central bus */ | | 1440 | nca.ca_hpabase = HPPA_FPA; /* Central bus */ |
1435 | nca.ca_nmodules = MAXMODBUS; | | 1441 | nca.ca_nmodules = MAXMODBUS; |
1436 | nca.ca_irq = HPPACF_IRQ_UNDEF; | | 1442 | nca.ca_irq = HPPACF_IRQ_UNDEF; |
1437 | nca.ca_iot = &hppa_bustag; | | 1443 | nca.ca_iot = &hppa_bustag; |