Attention is currently required from: Anjaneya "Reddy" Chagam, Maxim Polyakov, Morgan Jang. Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/49457 )
Change subject: intel/xeon_sp, mb/ocp/deltalake: Rework get_stack_busnos() ......................................................................
Patch Set 4:
(2 comments)
File src/soc/intel/xeon_sp/util.c:
https://review.coreboot.org/c/coreboot/+/49457/comment/925f301e_77ba69c6 PS4, Line 18: get_stack_busnos As this function now provides one bus number, remove the plural `s`: `get_stack_busno`
https://review.coreboot.org/c/coreboot/+/49457/comment/30de17c5_0a32aedf PS4, Line 19: { : uint32_t reg; : uint8_t busno = 0; : if (stack >= MAX_IIO_STACK) { : printk(BIOS_ERR, "%s:%s Stack %d does not exist!\n", __FILE__, __func__, stack); : } else if (stack >= 4) { : reg = pci_mmio_read_config32(PCI_DEV(UBOX_DECS_BUS, UBOX_DECS_DEV, : UBOX_DECS_FUNC), UBOX_DECS_CPUBUSNO1_CSR); : busno = BUSNO(stack - 4, reg); : } else { : reg = pci_mmio_read_config32(PCI_DEV(UBOX_DECS_BUS, UBOX_DECS_DEV, : UBOX_DECS_FUNC), UBOX_DECS_CPUBUSNO_CSR); : busno = BUSNO(stack, reg); : } : return busno; : } Since the register definitions are orthogonal, this can be simplified a bit:
{ if (stack >= MAX_IIO_STACK) { printk(BIOS_ERR, "%s: Stack %u does not exist!\n", __func__, stack); return 0; } const pci_devfn_t dev = PCI_DEV(UBOX_DECS_BUS, UBOX_DECS_DEV, UBOX_DECS_FUNC); const uint32_t reg32 = pci_io_read_config32(dev, UBOX_DECS_CPUBUSNO_CSR + stack / 4); return (reg32 >> (8 * (stack % 4)) & 0xff; }
Yes, this doesn't use any of the definitions that the previous patch adds. I find it's clearer this way.