Rather than repeating the same code in two files (SPL and TPL), move it to a shared filed. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Dragan Simic <dsimic@manjaro.org> Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>