Lines Matching full:core

55  * The EROM core address can be found at BCMA_CC_EROM_ADDR within the
58 * core descriptor records.
60 * The final core descriptor is followed by a 32-bit BCMA_EROM_TABLE_EOF (0xF)
89 struct bhnd_core_info *core);
92 struct bcma_erom_core *core);
100 static void bcma_erom_to_core_info(const struct bcma_erom_core *core,
125 return "core"; in bcma_erom_entry_type_name()
170 * core */ in bcma_erom_probe()
202 struct bhnd_core_info *core) in bcma_erom_lookup_core() argument
206 /* Search for the first matching core */ in bcma_erom_lookup_core()
207 return (bcma_erom_seek_matching_core(sc, desc, core)); in bcma_erom_lookup_core()
213 struct bhnd_core_info *core, bhnd_addr_t *addr, bhnd_size_t *size) in bcma_erom_lookup_core_addr() argument
224 /* Seek to the first matching core and provide the core info in bcma_erom_lookup_core_addr()
226 if ((error = bcma_erom_seek_matching_core(sc, desc, core))) in bcma_erom_lookup_core_addr()
374 /* Determine the core count */ in bcma_erom_get_core_table()
377 struct bcma_erom_core core; in bcma_erom_get_core_table() local
379 /* Seek to the first readable core entry */ in bcma_erom_get_core_table()
386 /* Read past the core descriptor */ in bcma_erom_get_core_table()
387 if ((error = bcma_erom_parse_core(sc, &core))) in bcma_erom_get_core_table()
399 /* Parse all core descriptors */ in bcma_erom_get_core_table()
402 struct bcma_erom_core core; in bcma_erom_get_core_table() local
405 /* Parse the core */ in bcma_erom_get_core_table()
410 error = bcma_erom_parse_core(sc, &core); in bcma_erom_get_core_table()
423 bcma_erom_to_core_info(&core, i, unit, &buffer[i]); in bcma_erom_get_core_table()
523 * Read and discard a core descriptor from the EROM table.
533 struct bcma_erom_core core; in bcma_erom_skip_core() local
534 return (bcma_erom_parse_core(erom, &core)); in bcma_erom_skip_core()
637 * Seek to the first core entry matching @p desc.
640 * @param desc The core match descriptor.
641 * @param[out] core On success, the matching core info. If the core info
650 const struct bhnd_core_match *desc, struct bhnd_core_info *core) in bcma_erom_seek_matching_core() argument
659 /* We can't determine a core's unit number during the initial scan. */ in bcma_erom_seek_matching_core()
663 /* Locate the first matching core */ in bcma_erom_seek_matching_core()
668 /* Seek to the next core */ in bcma_erom_seek_matching_core()
673 /* Save the core offset */ in bcma_erom_seek_matching_core()
676 /* Parse the core */ in bcma_erom_seek_matching_core()
690 /* Parse the core */ in bcma_erom_seek_matching_core()
706 /* Reposition to allow reading the next core */ in bcma_erom_seek_matching_core()
711 /* Found; seek to the core's initial offset and provide in bcma_erom_seek_matching_core()
712 * the core info to the caller */ in bcma_erom_seek_matching_core()
714 if (core != NULL) in bcma_erom_seek_matching_core()
715 *core = ci; in bcma_erom_seek_matching_core()
725 * Read the next core descriptor from the EROM table.
728 * @param[out] core On success, will be populated with the parsed core
732 * @retval non-zero Reading or parsing the core descriptor failed.
735 bcma_erom_parse_core(struct bcma_erom *erom, struct bcma_erom_core *core) in bcma_erom_parse_core() argument
748 if (!BCMA_EROM_ENTRY_IS(entry, CORE)) { in bcma_erom_parse_core()
755 core->vendor = BCMA_EROM_GET_ATTR(entry, COREA_DESIGNER); in bcma_erom_parse_core()
756 core->device = BCMA_EROM_GET_ATTR(entry, COREA_ID); in bcma_erom_parse_core()
762 if (!BCMA_EROM_ENTRY_IS(entry, CORE)) { in bcma_erom_parse_core()
766 core->rev = BCMA_EROM_GET_ATTR(entry, COREB_REV); in bcma_erom_parse_core()
767 core->num_mport = BCMA_EROM_GET_ATTR(entry, COREB_NUM_MP); in bcma_erom_parse_core()
768 core->num_dport = BCMA_EROM_GET_ATTR(entry, COREB_NUM_DP); in bcma_erom_parse_core()
769 core->num_mwrap = BCMA_EROM_GET_ATTR(entry, COREB_NUM_WMP); in bcma_erom_parse_core()
770 core->num_swrap = BCMA_EROM_GET_ATTR(entry, COREB_NUM_WSP); in bcma_erom_parse_core()
882 * @param core EROM core record to convert.
883 * @param core_idx The core index of @p core.
884 * @param core_unit The core unit of @p core.
888 bcma_erom_to_core_info(const struct bcma_erom_core *core, u_int core_idx, in bcma_erom_to_core_info() argument
891 info->vendor = core->vendor; in bcma_erom_to_core_info()
892 info->device = core->device; in bcma_erom_to_core_info()
893 info->hwrev = core->rev; in bcma_erom_to_core_info()
930 * @param corecfg Core info to be populated with the scanned port regions.
970 EROM_LOG(erom, "core%u %s%u: region count reached " in bcma_erom_corecfg_fill_port_regions()
984 EROM_LOG(erom, "core%u %s%u.%u: invalid slave port " in bcma_erom_corecfg_fill_port_regions()
1043 * Parse the next core entry from the EROM table and produce a bcma_corecfg
1047 * @param[out] result On success, the core's device info. The caller inherits
1057 struct bcma_erom_core core; in bcma_erom_next_corecfg() local
1067 /* Parse the next core entry */ in bcma_erom_next_corecfg()
1068 if ((error = bcma_erom_parse_core(erom, &core))) in bcma_erom_next_corecfg()
1071 /* Determine the core's index and unit numbers */ in bcma_erom_next_corecfg()
1078 /* Parse next core */ in bcma_erom_next_corecfg()
1087 if (core.vendor == prev_core.vendor && in bcma_erom_next_corecfg()
1088 core.device == prev_core.device) in bcma_erom_next_corecfg()
1093 /* Seek to next core */ in bcma_erom_next_corecfg()
1099 /* We already parsed the core descriptor */ in bcma_erom_next_corecfg()
1104 cfg = bcma_alloc_corecfg(core_index, core_unit, core.vendor, in bcma_erom_next_corecfg()
1105 core.device, core.rev); in bcma_erom_next_corecfg()
1111 KASSERT(core.num_mport <= BCMA_PID_MAX, ("unsupported mport count")); in bcma_erom_next_corecfg()
1112 KASSERT(core.num_dport <= BCMA_PID_MAX, ("unsupported dport count")); in bcma_erom_next_corecfg()
1113 KASSERT(core.num_mwrap + core.num_swrap <= BCMA_PID_MAX, in bcma_erom_next_corecfg()
1118 "core%u: %s %s (cid=%hx, rev=%hu, unit=%d)\n", in bcma_erom_next_corecfg()
1120 bhnd_vendor_name(core.vendor), in bcma_erom_next_corecfg()
1121 bhnd_find_core_name(core.vendor, core.device), in bcma_erom_next_corecfg()
1122 core.device, core.rev, core_unit); in bcma_erom_next_corecfg()
1125 cfg->num_master_ports = core.num_mport; in bcma_erom_next_corecfg()
1128 cfg->num_wrapper_ports = core.num_mwrap + core.num_swrap; in bcma_erom_next_corecfg()
1131 for (uint8_t i = 0; i < core.num_mport; i++) { in bcma_erom_next_corecfg()
1164 if (core.num_dport > 0) { in bcma_erom_next_corecfg()
1175 cfg->num_bridge_ports = core.num_dport; in bcma_erom_next_corecfg()
1178 cfg->num_dev_ports = core.num_dport; in bcma_erom_next_corecfg()
1184 for (uint8_t sp_num = 0; sp_num < core.num_dport; sp_num++) { in bcma_erom_next_corecfg()
1193 for (uint8_t sp_num = 0; sp_num < core.num_mwrap; sp_num++) { in bcma_erom_next_corecfg()
1202 for (uint8_t i = 0; i < core.num_swrap; i++) { in bcma_erom_next_corecfg()
1215 * core.num_mwrap in bcma_erom_next_corecfg()
1217 * (core.num_mwrap > 0) ? in bcma_erom_next_corecfg()
1218 * core.num_mwrap : in bcma_erom_next_corecfg()
1219 * ((core.vendor == BHND_MFGID_BCM) ? 1 : 0) in bcma_erom_next_corecfg()
1222 sp_num = (core.num_mwrap > 0) ? in bcma_erom_next_corecfg()
1223 core.num_mwrap : in bcma_erom_next_corecfg()
1224 ((core.vendor == BHND_MFGID_BCM) ? 1 : 0) + i; in bcma_erom_next_corecfg()
1233 * Seek to the next core entry (if any), skipping any dangling/invalid in bcma_erom_next_corecfg()
1236 * On the BCM4706, the EROM entry for the memory controller core in bcma_erom_next_corecfg()
1297 if (!BCMA_EROM_ENTRY_IS(entry, CORE)) { in bcma_erom_dump()
1298 EROM_LOG(sc, "invalid core descriptor; found " in bcma_erom_dump()