build: refactor platforms a bit, add support for discovery board