Ideally a law stating every version of firmware/software must be freely available, and no mechanism preventing flashing even older firmwares must be present
That doesn't work with keeping the device secure though. Security issues need to be treated as quality problems that are in breach of the original contract until rectified. But then referring to an original firmware won't work. So downgrading the user experience also needs to be treated as breach of contract.