Attention is currently required from: Nico Huber, Furquan Shaikh, Nick Vaccaro. Tim Wawrzynczak has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/57069 )
Change subject: coreboot tables: Add type-c port info to coreboot table ......................................................................
Patch Set 23:
(3 comments)
File src/lib/coreboot_table.c:
https://review.coreboot.org/c/coreboot/+/57069/comment/45415cbc_82597eb7 PS23, Line 254: ASSERT nit: `assert`, but I don't think it needs to assert, just a error print and return seems fine.
https://review.coreboot.org/c/coreboot/+/57069/comment/f957c809_2a46bba2 PS23, Line 258: "No nit: prefix with `ERROR: `, e.g. `"ERROR: No more room...`
https://review.coreboot.org/c/coreboot/+/57069/comment/dc2d9ddd_c610c3db PS23, Line 245: struct type_c_port_info variant_type_c_info[LB_MAX_TYPE_C_PORTS]; : struct lb_type_c_info *rec; : int count = 0; : int i; : : count = sysinfo_fill_type_c_info(variant_type_c_info, LB_MAX_TYPE_C_PORTS); : if (count == 0) : return; : : ASSERT(count <= LB_MAX_TYPE_C_PORTS); : : rec = (struct lb_type_c_info *)lb_new_record(header); : if (!rec) { : printk(BIOS_ERR, "No more room in coreboot table!\n"); : return; : } : : rec->tag = LB_TAG_TYPE_C_INFO; : rec->size = sizeof(*rec) + sizeof(struct type_c_port_info) * count; : rec->port_count = count; : for (i = 0; i < count; i++) { : rec->type_c_info[i] = variant_type_c_info[i]; : : printk(BIOS_INFO, "Passing conn%d type-c info to payload: " : "usb2:%d usb3:%d sbu:%d data:%d\n", i, : rec->type_c_info[i].usb2_port_number, : rec->type_c_info[i].usb3_port_number, : rec->type_c_info[i].sbu_orientation, : rec->type_c_info[i].data_orientation); : } Could this be reorganized to just copy straight into the coreboot table?
pseudocode: ``` rec = lb_new_record(header); rec->tag = LB_TYPE_C_INFO; count = sysinfo_fill_type_c_info(rec->type_c_info, LB_MAX_TYPE_C_PORTS); if (count is too big) die();
rec->size = sizeof(*rec) + sizeof(struct type_c_port_info * count); rec->port_count = count; ```