iopsys.sh: refactor: extract common code into a function
This avoids code duplication for the other targets once they need to get correct configuration from FIT.
This avoids code duplication for the other targets once they need to get correct configuration from FIT.