Index: sys/dev/bhnd/bcma/bcma.c =================================================================== --- sys/dev/bhnd/bcma/bcma.c +++ sys/dev/bhnd/bcma/bcma.c @@ -251,6 +251,8 @@ return (dinfo->corecfg->num_bridge_ports); case BHND_PORT_AGENT: return (dinfo->corecfg->num_wrapper_ports); + default: + return (0); } } @@ -296,10 +298,19 @@ continue; STAILQ_FOREACH(map, &port->sp_maps, m_link) - if (map->m_region_num == region_num) + if (map->m_region_num == region_num){ + if (bootverbose) + device_printf(dev, "core %d: found RID by port number( %u ) = %d\n", + dinfo->corecfg->core_info.core_idx, port_num, map->m_rid); + return map->m_rid; + } + } + if (bootverbose) + device_printf(dev, "core %d: can't find RID by port number: %u\n", dinfo->corecfg->core_info.core_idx, port_num); + return -1; } Index: sys/dev/bhnd/bcma/bcma_subr.c =================================================================== --- sys/dev/bhnd/bcma/bcma_subr.c +++ sys/dev/bhnd/bcma/bcma_subr.c @@ -135,6 +135,7 @@ return (&cfg->wrapper_ports); break; } + return (NULL); } /** @@ -170,6 +171,16 @@ map->m_rid = resource_list_add_next( &dinfo->resources, SYS_RES_MEMORY, map->m_base, end, map->m_size); + if(bootverbose) + device_printf(bus, + "core%u %s%u.%u: region %llx-%llx added " + "as resource with id=%d\n", + dinfo->corecfg->core_info.core_idx, + bhnd_port_type_name(port->sp_type), + port->sp_num, map->m_region_num, + (unsigned long long) map->m_base, + (unsigned long long) end, + map->m_rid); } else if (bootverbose) { device_printf(bus, "core%u %s%u.%u: region %llx-%llx extends " Index: sys/dev/bhnd/bhnd.c =================================================================== --- sys/dev/bhnd/bhnd.c +++ sys/dev/bhnd/bhnd.c @@ -357,6 +357,8 @@ return (BHND_PROBE_DEFAULT); } + + return -1; } /** @@ -888,7 +890,7 @@ DEVMETHOD(bhnd_bus_alloc_resource, bhnd_generic_alloc_bhnd_resource), DEVMETHOD(bhnd_bus_release_resource, bhnd_generic_release_bhnd_resource), DEVMETHOD(bhnd_bus_activate_resource, bhnd_generic_activate_bhnd_resource), - DEVMETHOD(bhnd_bus_activate_resource, bhnd_generic_deactivate_bhnd_resource), + DEVMETHOD(bhnd_bus_deactivate_resource, bhnd_generic_deactivate_bhnd_resource), DEVMETHOD(bhnd_bus_get_chipid, bhnd_generic_get_chipid), DEVMETHOD(bhnd_bus_get_probe_order, bhnd_generic_get_probe_order), DEVMETHOD(bhnd_bus_read_1, bhnd_read_1), Index: sys/dev/bhnd/bhnd_subr.c =================================================================== --- sys/dev/bhnd/bhnd_subr.c +++ sys/dev/bhnd/bhnd_subr.c @@ -183,6 +183,8 @@ return ("bridge"); case BHND_PORT_AGENT: return ("agent"); + default: + return (""); } } @@ -579,6 +581,10 @@ /* Allocate the ChipCommon window resource and fetch the chipid data */ rid = rs->rid; rtype = rs->type; + if (bootverbose) + device_printf(dev, "trying to allocate rid 0x%04x\n", rid); + + res = bus_alloc_resource_any(dev, rtype, &rid, RF_ACTIVE); if (res == NULL) { device_printf(dev, @@ -586,8 +592,14 @@ return (ENXIO); } + if (bootverbose) + device_printf(dev, "CHIPC pre-read [0x%04x]: 0x%04x, 0x%04x\n", rid, chipc_offset + CHIPC_ID, res->r_bushandle); + /* Fetch the basic chip info */ reg = bus_read_4(res, chipc_offset + CHIPC_ID); + if (bootverbose) + device_printf(dev, "CHIPC: 0x%04x\n", reg); + *result = bhnd_parse_chipid(reg, 0x0); /* Fetch the enum base address */