Kyösti Mälkki has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32765 )
Change subject: Use !ENV_PAYLOAD_LOADER to select __SIMPLE_DEVICE__ ......................................................................
Patch Set 3:
Patch Set 3:
I'd rather have __SIMPLE_DEVICE__ completely removed. Unfortunately the work that would allow this (to always use struct device *) in stages where devicetree is present, has been stalled as the related util/sconfig changes are not receiving any reviews.
IMO the proposed changes obfuscates what __SIMPLE_DEVICE__ is/was for since there is no relation to payload loading whatsoever.
As i understand the use of __SIMPLE_DEVICE__ is to differentiate between Pre DRAM stage and post DRAM stage. So i believe we might still need __SIMPLE_DEVICE__ definition with this approach.
Not quite right. The only reason it was introduced is to solve the name collision we have with PCI config accessors. We needed a way to have the same source code file built for different stages; but different stages use different prototypes for functions like pci_config_read/write().
With the PCI config accessors now inlined, there is no perfomance penalty if we move romstage away from passing pci_devfn_t to struct device *. As matter of fact, for code sections that move data from devicetree.cb to hardware, latter probably creates more tighter assembly output.
https://review.coreboot.org/q/topic:devicetree