firmware: support loading into a pre-allocated buffer