Michael Niewöhner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/36570 )
Change subject: soc/intel/common: pmclib: make use of the new ETR address API ......................................................................
Patch Set 4:
(1 comment)
https://review.coreboot.org/c/coreboot/+/36570/4/src/soc/intel/common/block/... File src/soc/intel/common/block/pmc/pmclib.c:
https://review.coreboot.org/c/coreboot/+/36570/4/src/soc/intel/common/block/... PS4, Line 432: void pmc_global_reset_lock(void) : { : uint32_t *etr = soc_read_pmc_etr_addr(); : uint32_t reg; : : reg = read32(etr); : reg = (reg & ~CF9_GLB_RST) | CF9_LOCK; : write32(etr, reg); : }
besides that, why duplicate code again and again in soc/ when we can have a common function? […]
you can put anything on one line if you like to ;) I agree on the first one. The second one is not good coding style I'd say; but we could add a update32 macro, to do the same as with pci. More important, where do you draw the line when something should be put to common? I would say the goal is to have as much in common code as possible and consilidate most code sooner or later. I've seen much code that could be moved from the socs to common, but that's not easy when some guys always only copypasta code :/