discover: Move generic config routines to platform