Module Name: src Committed By: thorpej Date: Sat May 15 03:22:17 UTC 2021
Modified Files: src/sys/arch/sparc64/dev [thorpej-i2c-spi-conf]: pcf8591_envctrl.c src/sys/arch/sparc64/sparc64 [thorpej-i2c-spi-conf]: autoconf.c ofw_patch.c ofw_patch.h Log Message: - Move all of the stuff-missing-from-OFW-device-tree stuff into a new function sparc64_device_tree_fixup(), and call it from device_register(). - sparc64_device_tree_fixup() is table-driven, selecting the table based on the machine_model. It can appy "dtnode" fixups (by matching the device's OFW path) and "special" fixups, which are especially useful when a property needs to be added to another device that happens to not be in the OFW device tree. - Implement enumeration of missing-from-OFW-device-tree i2c devices by "sub-classing" the controller's device handle, intercepting the "i2c-enumerate-devices" device call. We let the "super" first enumerate any i2c devices that are in the OFW device tree, and then enumerate our own additions after that is done. i2c additions are provided by the machine_model fixup tables. To generate a diff of this commit: cvs rdiff -u -r1.19 -r1.19.4.1 src/sys/arch/sparc64/dev/pcf8591_envctrl.c cvs rdiff -u -r1.228.2.1 -r1.228.2.2 src/sys/arch/sparc64/sparc64/autoconf.c cvs rdiff -u -r1.7 -r1.7.4.1 src/sys/arch/sparc64/sparc64/ofw_patch.c cvs rdiff -u -r1.4 -r1.4.6.1 src/sys/arch/sparc64/sparc64/ofw_patch.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/sparc64/dev/pcf8591_envctrl.c diff -u src/sys/arch/sparc64/dev/pcf8591_envctrl.c:1.19 src/sys/arch/sparc64/dev/pcf8591_envctrl.c:1.19.4.1 --- src/sys/arch/sparc64/dev/pcf8591_envctrl.c:1.19 Wed Jan 27 02:20:03 2021 +++ src/sys/arch/sparc64/dev/pcf8591_envctrl.c Sat May 15 03:22:17 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: pcf8591_envctrl.c,v 1.19 2021/01/27 02:20:03 thorpej Exp $ */ +/* $NetBSD: pcf8591_envctrl.c,v 1.19.4.1 2021/05/15 03:22:17 thorpej Exp $ */ /* $OpenBSD: pcf8591_envctrl.c,v 1.6 2007/10/25 21:17:20 kettenis Exp $ */ /* @@ -19,7 +19,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: pcf8591_envctrl.c,v 1.19 2021/01/27 02:20:03 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pcf8591_envctrl.c,v 1.19.4.1 2021/05/15 03:22:17 thorpej Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -125,9 +125,11 @@ ecadc_attach(device_t parent, device_t s int64_t minv, warnv, crit, num, den; u_int8_t junk[PCF8591_CHANNELS + 1]; envsys_data_t *sensor; - int len, error, addr, chan, node = (int)ia->ia_cookie; + int len, error, addr, chan, node; u_int i; + node = devhandle_to_of(device_handle(self)); + sc->sc_dev = self; sc->sc_nchan = 0; sc->sc_hastimer = 0; Index: src/sys/arch/sparc64/sparc64/autoconf.c diff -u src/sys/arch/sparc64/sparc64/autoconf.c:1.228.2.1 src/sys/arch/sparc64/sparc64/autoconf.c:1.228.2.2 --- src/sys/arch/sparc64/sparc64/autoconf.c:1.228.2.1 Thu May 13 00:47:28 2021 +++ src/sys/arch/sparc64/sparc64/autoconf.c Sat May 15 03:22:17 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: autoconf.c,v 1.228.2.1 2021/05/13 00:47:28 thorpej Exp $ */ +/* $NetBSD: autoconf.c,v 1.228.2.2 2021/05/15 03:22:17 thorpej Exp $ */ /* * Copyright (c) 1996 @@ -48,7 +48,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.228.2.1 2021/05/13 00:47:28 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.228.2.2 2021/05/15 03:22:17 thorpej Exp $"); #include "opt_ddb.h" #include "opt_kgdb.h" @@ -1005,6 +1005,9 @@ device_register(device_t dev, void *aux) devhandle_t devhandle; int ofnode = 0; + /* Fixup devices that have missing device tree information. */ + sparc64_device_tree_fixup(dev, aux); + /* * If the device has a valid OpenFirmware node association, * grab it now. @@ -1025,24 +1028,6 @@ device_register(device_t dev, void *aux) * Ignore mainbus0 itself, it certainly is not a boot * device. */ - } else if (device_is_a(busdev, "iic")) { - struct i2c_attach_args *ia = aux; - - if (ia->ia_name == NULL) /* indirect config */ - return; - - ofnode = (int)ia->ia_cookie; - if (device_is_a(dev, "pcagpio")) { - if (!strcmp(machine_model, "SUNW,Sun-Fire-V240") || - !strcmp(machine_model, "SUNW,Sun-Fire-V210")) { - add_gpio_props_v210(dev, aux); - } - } - if (device_is_a(dev, "pcf8574io")) { - if (!strcmp(machine_model, "SUNW,Ultra-250")) { - add_gpio_props_e250(dev, aux); - } - } return; } else if (device_is_a(dev, "sd") || device_is_a(dev, "cd")) { struct scsipibus_attach_args *sa = aux; @@ -1097,11 +1082,6 @@ device_register(device_t dev, void *aux) dev_bi_unit_drive_match(dev, ofnode, periph->periph_target + off, 0, periph->periph_lun); } - - if (device_is_a(busdev, "scsibus")) { - /* see if we're in a known SCA drivebay */ - add_drivebay_props(dev, ofnode, aux); - } return; } else if (device_is_a(dev, "wd")) { struct ata_device *adev = aux; @@ -1125,9 +1105,6 @@ device_register(device_t dev, void *aux) ofnode = devhandle_to_of(devhandle); } - if (busdev == NULL) - return; - if (ofnode != 0) { uint8_t eaddr[ETHER_ADDR_LEN]; char tmpstr[32]; @@ -1224,64 +1201,6 @@ noether: } } - /* - * Check for I2C busses and add data for their direct configuration. - */ - if (device_is_a(dev, "iic")) { - devhandle_t bushandle = device_handle(busdev); - int busnode = - devhandle_type(bushandle) == DEVHANDLE_TYPE_OF ? - devhandle_to_of(bushandle) : 0; - - if (busnode) { - prop_dictionary_t props = device_properties(busdev); - prop_object_t cfg = prop_dictionary_get(props, - "i2c-child-devices"); - if (!cfg) { - int node; - const char *name; - - /* - * pmu's i2c devices are under the "i2c" node, - * so find it out. - */ - name = prom_getpropstring(busnode, "name"); - if (strcmp(name, "pmu") == 0) { - for (node = OF_child(busnode); - node != 0; node = OF_peer(node)) { - name = prom_getpropstring(node, - "name"); - if (strcmp(name, "i2c") == 0) { - busnode = node; - break; - } - } - } - - of_enter_i2c_devs(props, busnode, - sizeof(cell_t), 1); - } - } - - if (!strcmp(machine_model, "TAD,SPARCLE")) - add_spdmem_props_sparcle(busdev); - - if (device_is_a(busdev, "pcfiic") && - (!strcmp(machine_model, "SUNW,Sun-Fire-V240") || - !strcmp(machine_model, "SUNW,Sun-Fire-V210"))) - add_env_sensors_v210(busdev); - - /* E450 SUNW,envctrl */ - if (device_is_a(busdev, "pcfiic") && - (!strcmp(machine_model, "SUNW,Ultra-4"))) - add_i2c_props_e450(busdev, busnode); - - /* E250 SUNW,envctrltwo */ - if (device_is_a(busdev, "pcfiic") && - (!strcmp(machine_model, "SUNW,Ultra-250"))) - add_i2c_props_e250(busdev, busnode); - } - /* set properties for PCI framebuffers */ if (device_is_a(busdev, "pci")) { /* see if this is going to be console */ @@ -1344,10 +1263,7 @@ noether: } } #endif - set_static_edid(dict); } - - set_hw_props(dev); } /* Index: src/sys/arch/sparc64/sparc64/ofw_patch.c diff -u src/sys/arch/sparc64/sparc64/ofw_patch.c:1.7 src/sys/arch/sparc64/sparc64/ofw_patch.c:1.7.4.1 --- src/sys/arch/sparc64/sparc64/ofw_patch.c:1.7 Wed Dec 23 07:01:14 2020 +++ src/sys/arch/sparc64/sparc64/ofw_patch.c Sat May 15 03:22:17 2021 @@ -1,11 +1,11 @@ -/* $NetBSD: ofw_patch.c,v 1.7 2020/12/23 07:01:14 jdc Exp $ */ +/* $NetBSD: ofw_patch.c,v 1.7.4.1 2021/05/15 03:22:17 thorpej Exp $ */ /*- - * Copyright (c) 2020 The NetBSD Foundation, Inc. + * Copyright (c) 2020, 2021 The NetBSD Foundation, Inc. * All rights reserved. * * This code is derived from software contributed to The NetBSD Foundation - * by Julian Coleman. + * by Julian Coleman and Jason R. Thorpe. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -29,9 +29,10 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ofw_patch.c,v 1.7 2020/12/23 07:01:14 jdc Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ofw_patch.c,v 1.7.4.1 2021/05/15 03:22:17 thorpej Exp $"); #include <sys/param.h> +#include <sys/kmem.h> #include <dev/i2c/i2cvar.h> #include <dev/scsipi/scsipiconf.h> @@ -41,6 +42,10 @@ __KERNEL_RCSID(0, "$NetBSD: ofw_patch.c, #include <sparc64/sparc64/ofw_patch.h> #include <sparc64/sparc64/static_edid.h> +/***************************************************************************** + * GPIO fixup support + *****************************************************************************/ + static void add_gpio_pin(prop_array_t pins, const char *name, int num, int act, int def) { @@ -54,328 +59,822 @@ add_gpio_pin(prop_array_t pins, const ch prop_object_release(pin); } -static prop_array_t -create_i2c_dict(device_t busdev) +struct gpio_pin_fixup { + const char *name; + int num; + int act; + int def; +}; + +static void +add_gpio_pins(device_t dev, const struct gpio_pin_fixup *addpins, int npins) +{ + prop_dictionary_t dict = device_properties(dev); + prop_array_t pins = prop_array_create(); + int i; + + for (i = 0; i < npins; i++) { + add_gpio_pin(pins, addpins[i].name, addpins[i].num, + addpins[i].act, addpins[i].def); + } + + prop_dictionary_set(dict, "pins", pins); + prop_object_release(pins); +} + +/***************************************************************************** + * I2C device fixup support + *****************************************************************************/ + +/* + * On some systems, there are lots of i2c devices missing from the + * device tree. + * + * The way we deal with this is by defining a devhandle_impl subclass + * of the i2c controller's devhandle, create a new OF-type devhandle + * with the new devhandle_impl, and stuff that into the controller + * device's handle, which will then pass that handle on down to the iic bus + * instance. This devhandle_impl will implement "i2c-enumerate-devices", + * and pass everything else along to the super. + * + * This devhandle_impl will be wrapped inside of a container structure + * that will point to the extra devices that need to be added as children + * of that node. The "i2c-enumerate-devices" call will first enumerate + * devices that are present in the device tree, and then enumerate the + * additions. + */ + +struct i2c_addition { + const char *name; + const char *compat; + i2c_addr_t addr; +}; + +struct i2c_fixup_container { + struct devhandle_impl i2c_devhandle_impl; + devhandle_t i2c_super_handle; + const struct i2c_addition *i2c_additions; + int i2c_nadditions; + int i2c_phandle; +}; + +static int +i2c_fixup_enumerate_devices(device_t dev, devhandle_t call_handle, void *v) +{ + struct i2c_enumerate_devices_args *args = v; + const struct devhandle_impl *impl = call_handle.impl; + const struct i2c_fixup_container *fixup = + container_of((struct devhandle_impl *)__UNCONST(impl), + struct i2c_fixup_container, i2c_devhandle_impl); + devhandle_t super_handle = fixup->i2c_super_handle; + device_call_t super_call; + int error; + + /* First, enumerate using whatever is in the device tree. */ + super_call = devhandle_lookup_device_call(super_handle, + "i2c-enumerate-devices", &super_handle); + if (super_call != NULL) { + error = super_call(dev, super_handle, args); + if (error) { + return error; + } + } + + /* Now enumerate our additions. */ + const struct i2c_addition *i2c_adds = fixup->i2c_additions; + KASSERT(i2c_adds != NULL); + prop_dictionary_t props; + int i; + bool cbrv; + + for (i = 0; i < fixup->i2c_nadditions; i++) { + props = prop_dictionary_create(); + + args->ia->ia_addr = i2c_adds[i].addr; + args->ia->ia_name = i2c_adds[i].name; + args->ia->ia_clist = i2c_adds[i].compat; + args->ia->ia_clist_size = strlen(i2c_adds[i].compat) + 1; + args->ia->ia_prop = props; + if (fixup->i2c_phandle != 0) { + args->ia->ia_devhandle = + devhandle_from_of(fixup->i2c_phandle); + } else { + devhandle_invalidate(&args->ia->ia_devhandle); + } + + cbrv = args->callback(dev, args); + + prop_object_release(props); + + if (! cbrv) { + break; + } + } + + return 0; +} + +static device_call_t +i2c_fixup_lookup_device_call(devhandle_t handle, const char *name, + devhandle_t *call_handlep) { - prop_dictionary_t props = device_properties(busdev); - prop_array_t cfg = NULL; + if (strcmp(name, "i2c-enumerate-devices") == 0) { + return i2c_fixup_enumerate_devices; + } - cfg = prop_dictionary_get(props, "i2c-child-devices"); - if (!cfg) { - DPRINTF(ACDB_PROBE, ("\nCreating new i2c-child-devices\n")); - cfg = prop_array_create(); - prop_dictionary_set(props, "i2c-child-devices", cfg); - prop_dictionary_set_bool(props, "i2c-indirect-config", false); - } - return cfg; + /* Defer everything else to the "super". */ + return NULL; } static void -add_i2c_device(prop_array_t cfg, const char *name, const char *compat, -uint32_t addr, uint64_t node) -{ - prop_dictionary_t dev; - - DPRINTF(ACDB_PROBE, ("\nAdding i2c device: %s (%s) @ 0x%x (%lx)\n", - name, compat == NULL ? "NULL" : compat, addr, node & 0xffffffff)); - dev = prop_dictionary_create(); - prop_dictionary_set_string(dev, "name", name); - if (compat != NULL) - prop_dictionary_set_data(dev, "compatible", compat, - strlen(compat) + 1); - prop_dictionary_set_uint32(dev, "addr", addr); - prop_dictionary_set_uint64(dev, "cookie", node); - prop_array_add(cfg, dev); - prop_object_release(dev); +add_i2c_devices(device_t dev, const struct i2c_addition *i2c_adds, int nadds, + int phandle) +{ + struct i2c_fixup_container *fixup; + + fixup = kmem_alloc(sizeof(*fixup), KM_SLEEP); + + fixup->i2c_additions = i2c_adds; + fixup->i2c_nadditions = nadds; + fixup->i2c_phandle = phandle; + + /* Stash away the super-class handle. */ + devhandle_t devhandle = device_handle(dev); + fixup->i2c_super_handle = devhandle; + + /* Sub-class the devhandle_impl. */ + devhandle_impl_inherit(&fixup->i2c_devhandle_impl, devhandle.impl); + fixup->i2c_devhandle_impl.lookup_device_call = + i2c_fixup_lookup_device_call; + + /* + * ...and slide that on into the device. This handle will be + * passed on to the iic bus instance, and our enumeration method + * will get called to enumerate the child devices. + */ + devhandle.impl = &fixup->i2c_devhandle_impl; + device_set_handle(dev, devhandle); } -void -add_gpio_props_v210(device_t dev, void *aux) +/***************************************************************************** + * System fixup machinery + *****************************************************************************/ + +struct system_fixup { + const struct device_compatible_entry *dtnode_fixups; + void (*special_fixups)(device_t, void *); +}; + +static bool +device_handle_matches_phandle(device_t dev, int phandle) { - struct i2c_attach_args *ia = aux; - prop_dictionary_t dict = device_properties(dev); - prop_array_t pins; + devhandle_t devhandle = device_handle(dev); - switch (ia->ia_addr) { - case 0x38: /* front panel LEDs */ - pins = prop_array_create(); - add_gpio_pin(pins, "LED indicator", 7, 0, -1); - add_gpio_pin(pins, "LED fault", 5, 0, 0); - add_gpio_pin(pins, "LED power", 4, 0, 1); - prop_dictionary_set(dict, "pins", pins); - prop_object_release(pins); - break; - case 0x23: /* drive bay O/1 LEDs */ - pins = prop_array_create(); - add_gpio_pin(pins, "LED bay0_fault", 10, 0, 0); - add_gpio_pin(pins, "LED bay1_fault", 11, 0, 0); - add_gpio_pin(pins, "LED bay0_remove", 12, 0, 0); - add_gpio_pin(pins, "LED bay1_remove", 13, 0, 0); - prop_dictionary_set(dict, "pins", pins); - prop_object_release(pins); - break; - case 0x25: /* drive bay 2/3 LEDs (v240 only)*/ - pins = prop_array_create(); - add_gpio_pin(pins, "LED bay2_fault", 10, 0, 0); - add_gpio_pin(pins, "LED bay3_fault", 11, 0, 0); - add_gpio_pin(pins, "LED bay2_remove", 12, 0, 0); - add_gpio_pin(pins, "LED bay3_remove", 13, 0, 0); - prop_dictionary_set(dict, "pins", pins); - prop_object_release(pins); - break; + if (devhandle_type(devhandle) != DEVHANDLE_TYPE_OF) { + return false; } + return devhandle_to_of(devhandle) == phandle; } -void -add_gpio_props_e250(device_t dev, void *aux) +static int onboard_scsi_phandle __read_mostly; + +static void +onboard_scsi_fixup(device_t dev, void *aux) { - struct i2c_attach_args *ia = aux; - prop_dictionary_t dict = device_properties(dev); - prop_array_t pins; + /* We're just going to remember the phandle for now. */ + devhandle_t devhandle = device_handle(dev); + KASSERT(devhandle_type(devhandle) == DEVHANDLE_TYPE_OF); + onboard_scsi_phandle = devhandle_to_of(devhandle); +} - switch (ia->ia_addr) { - case 0x38: /* interrupt status */ - pins = prop_array_create(); - add_gpio_pin(pins, "ALERT high_temp", 1, 0, 30); - add_gpio_pin(pins, "ALERT disk_event", 2, 0, 30); - add_gpio_pin(pins, "ALERT fan_fail", 4, 0, 30); - add_gpio_pin(pins, "ALERT key_event", 5, 0, 30); - add_gpio_pin(pins, "ALERT psu_event", 6, 0, 30); - prop_dictionary_set(dict, "pins", pins); - prop_object_release(pins); - break; - case 0x39: /* PSU status */ - pins = prop_array_create(); - add_gpio_pin(pins, "INDICATOR psu0_present", 0, 0, -1); - add_gpio_pin(pins, "INDICATOR psu1_present", 1, 0, -1); - add_gpio_pin(pins, "INDICATOR psu0_fault", 4, 0, -1); - add_gpio_pin(pins, "INDICATOR psu1_fault", 5, 0, -1); - prop_dictionary_set(dict, "pins", pins); - prop_object_release(pins); - break; - case 0x3d: /* disk status */ - pins = prop_array_create(); - add_gpio_pin(pins, "INDICATOR disk0_present", - 0, 0, -1); - add_gpio_pin(pins, "INDICATOR disk1_present", - 1, 0, -1); - add_gpio_pin(pins, "INDICATOR disk2_present", - 2, 0, -1); - add_gpio_pin(pins, "INDICATOR disk3_present", - 3, 0, -1); - add_gpio_pin(pins, "INDICATOR disk4_present", - 4, 0, -1); - add_gpio_pin(pins, "INDICATOR disk5_present", - 5, 0, -1); - prop_dictionary_set(dict, "pins", pins); - prop_object_release(pins); - break; - case 0x3e: /* front panel LEDs (E250/E450) */ - pins = prop_array_create(); - add_gpio_pin(pins, "LED disk_fault", 0, 0, -1); - add_gpio_pin(pins, "LED psu_fault", 1, 0, -1); - add_gpio_pin(pins, "LED overtemp", 2, 0, -1); - add_gpio_pin(pins, "LED fault", 3, 0, -1); - add_gpio_pin(pins, "LED activity", 4, 0, -1); - /* Pin 5 is power LED, but not controllable */ - add_gpio_pin(pins, "INDICATOR key_normal", 6, 0, -1); - add_gpio_pin(pins, "INDICATOR key_diag", 7, 0, -1); - /* If not "normal" or "diag", key is "lock" */ - prop_dictionary_set(dict, "pins", pins); - prop_object_release(pins); - break; - case 0x3f: /* disk fault LEDs */ - pins = prop_array_create(); - add_gpio_pin(pins, "LED disk0_fault", 0, 0, -1); - add_gpio_pin(pins, "LED disk1_fault", 1, 0, -1); - add_gpio_pin(pins, "LED disk2_fault", 2, 0, -1); - add_gpio_pin(pins, "LED disk3_fault", 3, 0, -1); - add_gpio_pin(pins, "LED disk4_fault", 4, 0, -1); - add_gpio_pin(pins, "LED disk5_fault", 5, 0, -1); - prop_dictionary_set(dict, "pins", pins); - prop_object_release(pins); - break; +static bool +device_is_on_onboard_scsi(device_t dev) +{ + device_t parent = device_parent(dev); + + if (onboard_scsi_phandle == 0) { + return false; + } + + if (!device_is_a(parent, "scsibus")) { + return false; } + + device_t grandparent = device_parent(parent); + KASSERT(grandparent != NULL); + + return device_handle_matches_phandle(grandparent, onboard_scsi_phandle); } -void -add_drivebay_props(device_t dev, int ofnode, void *aux) +/***************************************************************************** + * System fixups for SUNW,Sun-Fire-V210 and SUNW,Sun-Fire-V240 + *****************************************************************************/ + +static void +v210_drive_bay_0_1_fixup(device_t dev, void *aux) { - struct scsipibus_attach_args *sa = aux; - int target = sa->sa_periph->periph_target; - prop_dictionary_t dict = device_properties(dev); - char path[256]= ""; - char name[16]; - int nbays; - - if ((strcmp(machine_model, "SUNW,Sun-Fire-V210") == 0) || - (strcmp(machine_model, "SUNW,Sun-Fire-V240") == 0)) { - OF_package_to_path(ofnode, path, sizeof(path)); + static const struct gpio_pin_fixup addpins[] = { + { .name = "LED bay0_fault", .num = 10, .act = 0, .def = 0 }, + { .name = "LED bay1_fault", .num = 11, .act = 0, .def = 0 }, + { .name = "LED bay0_remove", .num = 12, .act = 0, .def = 0 }, + { .name = "LED bay1_remove", .num = 13, .act = 0, .def = 0 }, + }; + add_gpio_pins(dev, addpins, __arraycount(addpins)); +} - /* see if we're on the onboard controller's 1st channel */ - if (strcmp(path, "/pci@1c,600000/scsi@2") != 0) - return; +static void +v240_drive_bay_2_3_fixup(device_t dev, void *aux) +{ + static const struct gpio_pin_fixup addpins[] = { + { .name = "LED bay2_fault", .num = 10, .act = 0, .def = 0 }, + { .name = "LED bay3_fault", .num = 11, .act = 0, .def = 0 }, + { .name = "LED bay2_remove", .num = 12, .act = 0, .def = 0 }, + { .name = "LED bay3_remove", .num = 13, .act = 0, .def = 0 }, + }; + add_gpio_pins(dev, addpins, __arraycount(addpins)); +} - /* yes, yes we are */ - if (strcmp(machine_model, "SUNW,Sun-Fire-V240") == 0) - nbays = 4; - else - nbays = 2; - if ( target < nbays) { +static void +v210_front_panel_fixup(device_t dev, void *aux) +{ + static const struct gpio_pin_fixup addpins[] = { + { .name = "LED indicator", .num = 7, .act = 0, .def = -1 }, + { .name = "LED fault", .num = 5, .act = 0, .def = 0 }, + { .name = "LED power", .num = 4, .act = 0, .def = 1 }, + }; + add_gpio_pins(dev, addpins, __arraycount(addpins)); +} + +static int v210_env_sensors_i2c_phandle __read_mostly; + +static void +v210_env_sensors_fixup(device_t dev, void *aux) +{ + static const struct i2c_addition i2c_adds[] = { + { .name = "hardware-monitor", + .compat = "i2c-adm1026", .addr = 0x2e }, + + { .name = "temperature-sensor", + .compat = "i2c-lm75", .addr = 0x4e }, + }; + + /* Squirrel away the phandle for later. */ + KASSERT(v210_env_sensors_i2c_phandle == 0); + devhandle_t devhandle = device_handle(dev); + v210_env_sensors_i2c_phandle = devhandle_to_of(devhandle); + + add_i2c_devices(dev, i2c_adds, __arraycount(i2c_adds), 0); +} + +static const struct device_compatible_entry dtnode_fixup_table_v210[] = { + { .compat = "/pci/isa@7/i2c@0,320/gpio@0,46", + .data = v210_drive_bay_0_1_fixup }, + + /* V240 only */ + { .compat = "/pci/isa@7/i2c@0,320/gpio@0,4a", + .data = v240_drive_bay_2_3_fixup }, + + { .compat = "/pci/isa@7/i2c@0,320/gpio@0,70", + .data = v210_front_panel_fixup }, + + { .compat = "/pci/isa@7/i2c@0,320", + .data = v210_env_sensors_fixup }, + + { .compat = "/pci@1c,600000/scsi@2", + .data = onboard_scsi_fixup }, + + DEVICE_COMPAT_EOL +}; + +static void +v210_v240_special_fixups_onboard_scsi(device_t dev, void *aux, int nbays) +{ + if (device_is_on_onboard_scsi(dev)) { + struct scsipibus_attach_args *sa = aux; + int target = sa->sa_periph->periph_target; + prop_dictionary_t dict = device_properties(dev); + char name[16]; + + if (target < nbays) { snprintf(name, sizeof(name), "bay%d", target); prop_dictionary_set_string(dict, "location", name); } } +} - if (!strcmp(machine_model, "SUNW,Ultra-250")) { - OF_package_to_path(ofnode, path, sizeof(path)); +static void +v210_special_fixups_hardware_monitor(device_t dev, void *aux) +{ + device_t parent = device_parent(dev); - /* see if we're on the onboard controller's 1st channel */ - if (strcmp(path, "/pci@1f,4000/scsi@3") != 0) - return; + /* Set some properties on the fan sensor. */ - /* disk 0 is target 0 */ - if (!target) { - strncpy(name, "bay0", sizeof(name)); - prop_dictionary_set_string(dict, "location", name); - /* disks 1 - 5 are targets 8 - 12 */ - } else if ( target < 13) { - snprintf(name, sizeof(name), "bay%d", target - 7); - prop_dictionary_set_string(dict, "location", name); - } + if (!device_is_a(parent, "iic")) { + return; + } + + device_t grandparent = device_parent(parent); + KASSERT(grandparent != NULL); + + + if (! device_handle_matches_phandle(grandparent, + v210_env_sensors_i2c_phandle)) { + return; + } + + struct i2c_attach_args *ia = aux; + if (ia->ia_addr == 0x2e) { + prop_dictionary_t props = device_properties(dev); + prop_dictionary_set_uint8(props, "fan_div2", 0x55); + prop_dictionary_set_bool(props, "multi_read", true); } } -/* - * Add SPARCle spdmem devices (0x50 and 0x51) that are not in the OFW tree - */ -void -add_spdmem_props_sparcle(device_t busdev) +static void +v210_special_fixups(device_t dev, void *aux) { - prop_array_t cfg; - int i; + v210_v240_special_fixups_onboard_scsi(dev, aux, 2); + v210_special_fixups_hardware_monitor(dev, aux); +} + +static void +v240_special_fixups(device_t dev, void *aux) +{ + v210_v240_special_fixups_onboard_scsi(dev, aux, 4); + v210_special_fixups_hardware_monitor(dev, aux); +} - DPRINTF(ACDB_PROBE, ("\nAdding spdmem for SPARCle ")); +static const struct system_fixup system_fixups_v210 = { + .dtnode_fixups = dtnode_fixup_table_v210, + .special_fixups = v210_special_fixups, +}; - cfg = create_i2c_dict(busdev); - for (i = 0x50; i <= 0x51; i++) - add_i2c_device(cfg, "dimm-spd", NULL, i, 0); - prop_object_release(cfg); +static const struct system_fixup system_fixups_v240 = { + .dtnode_fixups = dtnode_fixup_table_v210, + .special_fixups = v240_special_fixups, +}; + +/***************************************************************************** + * System fixups for SUNW,Sun-Fire-V440 + *****************************************************************************/ + +static void +v440_hardware_monitor_fixup(device_t dev, void *aux) +{ + prop_dictionary_t props = device_properties(dev); + prop_dictionary_set_bool(props, "multi_read", true); } -/* - * Add V210/V240 environmental sensors that are not in the OFW tree. - */ -void -add_env_sensors_v210(device_t busdev) +static const struct device_compatible_entry dtnode_fixup_table_v440[] = { + { .compat = "/pci/isa@7/i2c@0,320/hardware-monitor@0,5c", + .data = v440_hardware_monitor_fixup }, + + DEVICE_COMPAT_EOL +}; + +static const struct system_fixup system_fixups_v440 = { + .dtnode_fixups = dtnode_fixup_table_v440, +}; + +/***************************************************************************** + * System fixups for SUNW,Ultra-250 + *****************************************************************************/ + +static int e250_envctrltwo_phandle __read_mostly; + +static void +e250_envctrltwo_fixup(device_t dev, void *aux) { - prop_array_t cfg; + static const struct i2c_addition i2c_adds[] = { + /* PSU temperature / CPU fan */ + { .name = "PSU", .compat = "ecadc", .addr = 0x4a }, - DPRINTF(ACDB_PROBE, ("\nAdding sensors for %s ", machine_model)); - cfg = create_i2c_dict(busdev); + /* CPU and system board temperature */ + { .name = "CPU", .compat = "ecadc", .addr = 0x4f }, - /* ADM1026 at 0x2e */ - add_i2c_device(cfg, "hardware-monitor", "i2c-adm1026", 0x2e, 0); - /* LM75 at 0x4e */ - add_i2c_device(cfg, "temperature-sensor", "i2c-lm75", 0x4e, 0); + /* GPIOs */ + { .name = "gpio", .compat = "i2c-pcf8574", .addr = 0x38 }, + { .name = "gpio", .compat = "i2c-pcf8574", .addr = 0x39 }, + { .name = "gpio", .compat = "i2c-pcf8574", .addr = 0x3d }, + { .name = "gpio", .compat = "i2c-pcf8574", .addr = 0x3e }, + { .name = "gpio", .compat = "i2c-pcf8574", .addr = 0x3f }, + + /* NVRAM */ + { .name = "nvram", .compat = "i2c-at24c02", .addr = 0x52 }, + + /* RSC clock */ + { .name = "rscrtc", .compat = "i2c-ds1307", .addr = 0x68 }, + }; + devhandle_t devhandle = device_handle(dev); + KASSERT(devhandle_type(devhandle) == DEVHANDLE_TYPE_OF); + + /* Squirrel away the phandle for later. */ + KASSERT(e250_envctrltwo_phandle == 0); + e250_envctrltwo_phandle = devhandle_to_of(devhandle); + + add_i2c_devices(dev, i2c_adds, __arraycount(i2c_adds), + e250_envctrltwo_phandle); } -/* Sensors and GPIO's for E450 and E250 */ -void -add_i2c_props_e450(device_t busdev, uint64_t node) -{ - prop_array_t cfg; +static const struct device_compatible_entry dtnode_fixup_table_e250[] = { + { .compat = "/pci@1f,4000/ebus@1/SUNW,envctrltwo@14,600000", + .data = e250_envctrltwo_fixup }, - DPRINTF(ACDB_PROBE, ("\nAdding sensors for %s ", machine_model)); - cfg = create_i2c_dict(busdev); + { .compat = "/pci@1f,4000/scsi@3", + .data = onboard_scsi_fixup, }, - /* Power supply 1 temperature. */ - add_i2c_device(cfg, "PSU-1", "ecadc", 0x48, node); + DEVICE_COMPAT_EOL +}; - /* Power supply 2 temperature. */ - add_i2c_device(cfg, "PSU-2", "ecadc", 0x49, node); +static void +e250_special_fixups_envctrltwo(device_t dev, void *aux) +{ + /* interrupt status */ + static const struct gpio_pin_fixup gpio_0x38_addpins[] = { + { .name = "ALERT high_temp", .num = 1, .act = 0, .def = 30 }, + { .name = "ALERT disk_event", .num = 2, .act = 0, .def = 30 }, + { .name = "ALERT fan_fail", .num = 4, .act = 0, .def = 30 }, + { .name = "ALERT key_event", .num = 5, .act = 0, .def = 30 }, + { .name = "ALERT psu_event", .num = 6, .act = 0, .def = 30 }, + }; + + /* PSU status */ + static const struct gpio_pin_fixup gpio_0x39_addpins[] = { + { .name = "INDICATOR psu0_present", + .num = 0, .act = 0, .def = -1 }, + { .name = "INDICATOR psu1_present", + .num = 1, .act = 0, .def = -1 }, + { .name = "INDICATOR psu0_fault", + .num = 4, .act = 0, .def = -1 }, + { .name = "INDICATOR psu1_fault", + .num = 5, .act = 0, .def = -1 }, + }; + + /* disk status */ + static const struct gpio_pin_fixup gpio_0x3d_addpins[] = { + { .name = "INDICATOR disk0_present", + .num = 0, .act = 0, .def = -1 }, + { .name = "INDICATOR disk1_present", + .num = 1, .act = 0, .def = -1 }, + { .name = "INDICATOR disk2_present", + .num = 2, .act = 0, .def = -1 }, + { .name = "INDICATOR disk3_present", + .num = 3, .act = 0, .def = -1 }, + { .name = "INDICATOR disk4_present", + .num = 4, .act = 0, .def = -1 }, + { .name = "INDICATOR disk5_present", + .num = 5, .act = 0, .def = -1 }, + }; + + /* front panel */ + static const struct gpio_pin_fixup gpio_0x3e_addpins[] = { + { .name = "LED disk_fault", + .num = 0, .act = 0, .def = -1 }, + { .name = "LED psu_fault", + .num = 1, .act = 0, .def = -1 }, + { .name = "LED overtemp", + .num = 2, .act = 0, .def = -1 }, + { .name = "LED fault", + .num = 3, .act = 0, .def = -1 }, + { .name = "LED activity", + .num = 4, .act = 0, .def = -1 }, + + /* Pin 5 is power LED, but is not controllable. */ + + { .name = "INDICATOR key_normal", + .num = 6, .act = 0, .def = -1 }, + { .name = "INDICATOR key_diag", + .num = 7, .act = 0, .def = -1 }, + /* If not "normal" or "diag", key is "lock". */ + }; + + /* disk fault LEDs */ + static const struct gpio_pin_fixup gpio_0x3f_addpins[] = { + { .name = "LED disk0_fault", .num = 0, .act = 0, .def = -1 }, + { .name = "LED disk1_fault", .num = 1, .act = 0, .def = -1 }, + { .name = "LED disk2_fault", .num = 2, .act = 0, .def = -1 }, + { .name = "LED disk3_fault", .num = 3, .act = 0, .def = -1 }, + { .name = "LED disk4_fault", .num = 4, .act = 0, .def = -1 }, + { .name = "LED disk5_fault", .num = 5, .act = 0, .def = -1 }, + }; + + /* + * We need to fix up GPIO pin properties for GPIO controllers + * that don't appear in the device tree. + * + * We need to check if our parent is "iic" and grandparent + * is the envctrltwo node. + */ + device_t parent = device_parent(dev); + if (!device_is_a(parent, "iic")) { + return; + } - /* Power supply 3 temperature. */ - add_i2c_device(cfg, "PSU-3", "ecadc", 0x4a, node); + device_t grandparent = device_parent(dev); + KASSERT(grandparent != NULL); - /* Ambient temperature. */ - add_i2c_device(cfg, "ambient", "i2c-lm75", 0x4d, node); + if (! device_handle_matches_phandle(grandparent, + e250_envctrltwo_phandle)) { + return; + } - /* CPU temperatures. */ - add_i2c_device(cfg, "CPU", "ecadc", 0x4f, node); + struct i2c_attach_args *ia = aux; + const struct gpio_pin_fixup *addpins; + int naddpins; - prop_object_release(cfg); + switch (ia->ia_addr) { + case 0x38: + addpins = gpio_0x38_addpins; + naddpins = __arraycount(gpio_0x38_addpins); + break; + + case 0x39: + addpins = gpio_0x39_addpins; + naddpins = __arraycount(gpio_0x39_addpins); + break; + + case 0x3d: + addpins = gpio_0x3d_addpins; + naddpins = __arraycount(gpio_0x3d_addpins); + break; + + case 0x3e: + addpins = gpio_0x3e_addpins; + naddpins = __arraycount(gpio_0x3e_addpins); + break; + + case 0x3f: + addpins = gpio_0x3f_addpins; + naddpins = __arraycount(gpio_0x3f_addpins); + break; + + default: + /* No fixups. */ + return; + } + add_gpio_pins(dev, addpins, naddpins); } -void -add_i2c_props_e250(device_t busdev, uint64_t node) +static void +e250_special_fixups_onboard_scsi(device_t dev, void *aux) { - prop_array_t cfg; - int i; + if (device_is_on_onboard_scsi(dev)) { + struct scsipibus_attach_args *sa = aux; + int target = sa->sa_periph->periph_target; + prop_dictionary_t dict = device_properties(dev); + char name[16]; + + /* + * disk 0 is target 0. + * disks 1 - 5 are targets 8 - 12. + */ + if (target == 0) { + prop_dictionary_set_string(dict, "location", "bay0"); + } else if (target >= 8 && target <= 12) { + snprintf(name, sizeof(name), "bay%d", target - 7); + prop_dictionary_set_string(dict, "location", name); + } + } +} - DPRINTF(ACDB_PROBE, ("\nAdding sensors for %s ", machine_model)); - cfg = create_i2c_dict(busdev); +static void +e250_special_fixups(device_t dev, void *aux) +{ + e250_special_fixups_envctrltwo(dev, aux); + e250_special_fixups_onboard_scsi(dev, aux); +} - /* PSU temperature / CPU fan */ - add_i2c_device(cfg, "PSU", "ecadc", 0x4a, node); +static const struct system_fixup system_fixups_e250 = { + .dtnode_fixups = dtnode_fixup_table_e250, + .special_fixups = e250_special_fixups, +}; - /* CPU & system board temperature */ - add_i2c_device(cfg, "CPU", "ecadc", 0x4f, node); +/***************************************************************************** + * System fixups for SUNW,Ultra-4 + *****************************************************************************/ - /* GPIO's */ - for (i = 0x38; i <= 0x39; i++) - add_i2c_device(cfg, "gpio", "i2c-pcf8574", i, node); - for (i = 0x3d; i <= 0x3f; i++) - add_i2c_device(cfg, "gpio", "i2c-pcf8574", i, node); +static void +e450_envctrl_fixup(device_t dev, void *aux) +{ + static const struct i2c_addition i2c_adds[] = { + /* Power supply 1 temperature. */ + { .name = "PSU-1", .compat = "ecadc", .addr = 0x48 }, + + /* Power supply 2 temperature. */ + { .name = "PSU-2", .compat = "ecadc", .addr = 0x49 }, - /* NVRAM */ - add_i2c_device(cfg, "nvram", "i2c-at24c02", 0x52, node); + /* Power supply 3 temperature. */ + { .name = "PSU-3", .compat = "ecadc", .addr = 0x4a }, - /* RSC clock */ - add_i2c_device(cfg, "rscrtc", "i2c-ds1307", 0x68, node); + /* Ambient temperature. */ + { .name = "ambient", .compat = "i2c-lm75", .addr = 0x4d }, - prop_object_release(cfg); + /* CPU temperatures. */ + { .name = "CPU", .compat = "ecadc", .addr = 0x4f }, + }; + devhandle_t devhandle = device_handle(dev); + KASSERT(devhandle_type(devhandle) == DEVHANDLE_TYPE_OF); + add_i2c_devices(dev, i2c_adds, __arraycount(i2c_adds), + devhandle_to_of(devhandle)); } -/* Hardware specific device properties */ -void -set_hw_props(device_t dev) +static const struct device_compatible_entry dtnode_fixup_table_e450[] = { + /* XXX Could make this into a special fixup, but dtnode is nicer. */ + { .compat = "/XXX/need/the/OFW/path", + .data = e450_envctrl_fixup }, + + DEVICE_COMPAT_EOL +}; + +static const struct system_fixup system_fixups_e450 = { + .dtnode_fixups = dtnode_fixup_table_e450, +}; + +/***************************************************************************** + * System fixups for TAD,SPARCLE + *****************************************************************************/ + +static void +sparcle_smbus_fixup(device_t dev, void *aux) { - device_t busdev = device_parent(dev); + static const struct i2c_addition i2c_adds[] = { + { .name = "dimm-spd", + .compat = "netbsd,dimm-spd", .addr = 0x50 }, + { .name = "dimm-spd", + .compat = "netbsd,dimm-spd", .addr = 0x51 }, + }; + devhandle_t devhandle = device_handle(dev); + KASSERT(devhandle_type(devhandle) == DEVHANDLE_TYPE_OF); + add_i2c_devices(dev, i2c_adds, __arraycount(i2c_adds), 0); +}; + +static const struct device_compatible_entry dtnode_fixup_table_sparcle[] = { + { .compat = "/pci/ebut@11", + .data = sparcle_smbus_fixup }, + + DEVICE_COMPAT_EOL +}; + +static const struct system_fixup system_fixups_sparcle = { + .dtnode_fixups = dtnode_fixup_table_sparcle, +}; + +/***************************************************************************** + * System fixups for NATE,Meso-999 + *****************************************************************************/ - if ((!strcmp(machine_model, "SUNW,Sun-Fire-V240") || - !strcmp(machine_model, "SUNW,Sun-Fire-V210"))) { - device_t busparent = device_parent(busdev); - prop_dictionary_t props = device_properties(dev); +static void +meso999_edid_fixup(device_t dev, void *aux) +{ + prop_dictionary_t props = device_properties(dev); + prop_dictionary_set_data(props, "EDID:1", + edid_meso999, sizeof(edid_meso999)); +} + +static const struct device_compatible_entry dtnode_fixup_table_meso999[] = { + { .compat = "/pci/SUNW,XVR-100@2", + .data = meso999_edid_fixup }, + + DEVICE_COMPAT_EOL +}; + +static const struct system_fixup system_fixups_meso999 = { + .dtnode_fixups = dtnode_fixup_table_meso999, +}; + +/***************************************************************************** + * Universal fixups + *****************************************************************************/ + +static void +universal_fixups(device_t dev, void *aux) +{ + /* + * If the parent of an "iic" instance is named "pmu" in the + * device tree, then we need to fix up the devhandle for the + * bus because the device tree topology is: + * + * pmu -> i2c -> [devices...] + */ + if (device_is_a(dev, "iic")) { + device_t parent = device_parent(dev); + devhandle_t parent_devhandle = device_handle(parent); + char name[32]; - if (busparent != NULL && device_is_a(busparent, "pcfiic") && - device_is_a(dev, "adm1026hm") && props != NULL) { - prop_dictionary_set_uint8(props, "fan_div2", 0x55); - prop_dictionary_set_bool(props, "multi_read", true); + if (devhandle_type(parent_devhandle) != DEVHANDLE_TYPE_OF) { + return; } - } + int parent_phandle = devhandle_to_of(parent_devhandle); - if (!strcmp(machine_model, "SUNW,Sun-Fire-V440")) { - device_t busparent = device_parent(busdev); - prop_dictionary_t props = device_properties(dev); - if (busparent != NULL && device_is_a(busparent, "pcfiic") && - device_is_a(dev, "adm1026hm") && props != NULL) { - prop_dictionary_set_bool(props, "multi_read", true); + if (OF_getprop(parent_phandle, "name", name, + sizeof(name)) <= 0) { + return; + } + name[sizeof(name) - 1] = '\0'; /* sanity */ + if (strcmp(name, "pmu") != 0) { + return; + } + + int node; + for (node = OF_child(parent_phandle); node != 0; + node = OF_peer(node)) { + if (OF_getprop(node, "name", name, + sizeof(name)) <= 0) { + continue; + } + if (strcmp(name, "i2c") == 0) { + device_set_handle(dev, + devhandle_from_of(node)); + break; + } } } } -/* Static EDID definitions */ +/***************************************************************************** + * End of system-specific data + *****************************************************************************/ + +/* + * Some systems are missing some important information in the + * OpenFirmware device tree, or the tree has some quirks we need + * to deal with. + */ +static const struct device_compatible_entry system_fixup_table[] = { + { .compat = "SUNW,Sun-Fire-V210", .data = &system_fixups_v210 }, + { .compat = "SUNW,Sun-Fire-V240", .data = &system_fixups_v240 }, + + { .compat = "SUNW,Sun-Fire-V440", .data = &system_fixups_v440 }, + + { .compat = "SUNW,Ultra-250", .data = &system_fixups_e250 }, + + { .compat = "SUNW,Ultra-4", .data = &system_fixups_e450 }, + + { .compat = "TAD,SPARCLE", .data = &system_fixups_sparcle }, + + { .compat = "NATE,Meso-999", .data = &system_fixups_meso999 }, + + DEVICE_COMPAT_EOL +}; + +#define MAX_PACKAGE_PATH 512 + void -set_static_edid(prop_dictionary_t dict) +sparc64_device_tree_fixup(device_t dev, void *aux) { - if (!strcmp(machine_model, "NATE,Meso-999")) { - prop_data_t edid; + static const struct system_fixup *system_fixup_entry; + static bool system_fixup_entry_initialized; + const struct device_compatible_entry *dce; + void (*fn)(device_t, void *); + devhandle_t devhandle; + + /* First, deal with some universal fixups. */ + universal_fixups(dev, aux); + + devhandle = device_handle(dev); + + if (! system_fixup_entry_initialized) { + dce = device_compatible_lookup((const char **)&machine_model, 1, + system_fixup_table); + if (dce != NULL) { + system_fixup_entry = dce->data; + } + system_fixup_entry_initialized = true; + } + if (system_fixup_entry == NULL) { + /* No fixups for this machine. */ + return; + } + + /* + * First apply any applicable fixups to this device based + * on its node in the device tree. + */ + if (system_fixup_entry->dtnode_fixups != NULL && + devhandle_type(devhandle) == DEVHANDLE_TYPE_OF) { + int phandle = devhandle_to_of(devhandle); + char *package_path = kmem_zalloc(MAX_PACKAGE_PATH, KM_SLEEP); + int path_size; + + path_size = OF_package_to_path(phandle, package_path, + MAX_PACKAGE_PATH); + package_path[MAX_PACKAGE_PATH - 1] = '\0'; /* sanity */ + if (path_size > 0) { + const char *ccp = package_path; + dce = device_compatible_lookup(&ccp, 1, + system_fixup_entry->dtnode_fixups); + if (dce != NULL && (fn = dce->data) != NULL) { + (*fn)(dev, aux); + } + } + kmem_free(package_path, MAX_PACKAGE_PATH); + } - DPRINTF(ACDB_PROBE, ("\nAdding EDID for Meso-999 ")); - edid = prop_data_create_copy(edid_meso999, - sizeof(edid_meso999)); - prop_dictionary_set(dict, "EDID:1", edid); - prop_object_release(edid); + /* + * Now apply any special fixups (this is mainly applicable to + * deivces that do not have nodes in the device tree. + */ + if (system_fixup_entry->special_fixups != NULL) { + (*system_fixup_entry->special_fixups)(dev, aux); } } Index: src/sys/arch/sparc64/sparc64/ofw_patch.h diff -u src/sys/arch/sparc64/sparc64/ofw_patch.h:1.4 src/sys/arch/sparc64/sparc64/ofw_patch.h:1.4.6.1 --- src/sys/arch/sparc64/sparc64/ofw_patch.h:1.4 Thu Oct 29 06:47:38 2020 +++ src/sys/arch/sparc64/sparc64/ofw_patch.h Sat May 15 03:22:17 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: ofw_patch.h,v 1.4 2020/10/29 06:47:38 jdc Exp $ */ +/* $NetBSD: ofw_patch.h,v 1.4.6.1 2021/05/15 03:22:17 thorpej Exp $ */ /*- * Copyright (c) 2020 The NetBSD Foundation, Inc. @@ -41,14 +41,6 @@ extern int autoconf_debug; #define DPRINTF(l, s) #endif -void add_gpio_props_v210(device_t, void *); -void add_gpio_props_e250(device_t, void *); -void add_drivebay_props(device_t, int, void *); -void add_spdmem_props_sparcle(device_t); -void add_env_sensors_v210(device_t); -void add_i2c_props_e450(device_t, uint64_t); -void add_i2c_props_e250(device_t, uint64_t); -void set_hw_props(device_t); -void set_static_edid(prop_dictionary_t); +void sparc64_device_tree_fixup(device_t, void *); #endif /* OFW_PATCH_H */