backfire: ppc40x: move perwe fixup into a separate function (backport of r20929)