Index: head/sys/dev/bhnd/bcma/bcma.c =================================================================== --- head/sys/dev/bhnd/bcma/bcma.c +++ head/sys/dev/bhnd/bcma/bcma.c @@ -97,7 +97,7 @@ r_count = size; r_end = r_start + r_count - 1; - dinfo->rid_agent = 0; + dinfo->rid_agent = i + 1; dinfo->res_agent = bhnd_alloc_resource(dev, SYS_RES_MEMORY, &dinfo->rid_agent, r_start, r_end, r_count, RF_ACTIVE); if (dinfo->res_agent == NULL) { Index: head/sys/dev/bhnd/bcma/bcma_erom.c =================================================================== --- head/sys/dev/bhnd/bcma/bcma_erom.c +++ head/sys/dev/bhnd/bcma/bcma_erom.c @@ -878,7 +878,26 @@ for (uint8_t i = 0; i < core.num_swrap; i++) { /* Slave wrapper ports are not numbered distinctly from master * wrapper ports. */ - uint8_t sp_num = core.num_mwrap + i; + + /* + * Broadcom DDR1/DDR2 Memory Controller + * (cid=82e, rev=1, unit=0, d/mw/sw = 2/0/1 ) -> + * bhnd0: erom[0xdc]: core6 agent0.0: mismatch got: 0x1 (0x2) + * + * ARM BP135 AMBA3 AXI to APB Bridge + * (cid=135, rev=0, unit=0, d/mw/sw = 1/0/1 ) -> + * bhnd0: erom[0x124]: core9 agent1.0: mismatch got: 0x0 (0x2) + * + * core.num_mwrap + * ===> + * (core.num_mwrap > 0) ? + * core.num_mwrap : + * ((core.vendor == BHND_MFGID_BCM) ? 1 : 0) + */ + uint8_t sp_num; + sp_num = (core.num_mwrap > 0) ? + core.num_mwrap : + ((core.vendor == BHND_MFGID_BCM) ? 1 : 0) + i; error = erom_corecfg_fill_port_regions(erom, cfg, sp_num, BCMA_EROM_REGION_TYPE_SWRAP);