[coreboot] Refactoring duplicate Embedded Controller code