While I totally support such legislation (even for current sold devices, not just deprecated), there's a massive pile of android devices with open bootloader which never got any decent second life support.

Those might be niche devices, I think if were Samsung or Pixel devices, it would be a different story, similar for Apple devices, they are fewer variants, that it would be a lot of developers putting effort on adding upstream Linux support if they were open, like is happening with the Macs with the M series.

Samsung is actually the worst offender in the Android world for making variants.

Each device usually has 5 versions for each market (US, EU, China, Korea, Rest of the world) + individual board revisions.

And that's not counting the massive amount of devices they produce outside the flagships.

Let's pick the Galaxy S10 for example, you have the S10, S10+, S10e, S10 Lite, S10 5G. The US ones are on Snapdragon SOC, the other ones on Exynos SOC and each region has additional quirks...

That shouldn't stop the regulation from existing, but yes, maybe another regulation in a similar way for forcing companies to open source drivers and bringup code after N years of the release?

Even when the drivers are open source, it's far from easy. I'm thinking about these old Linux 4.2 touch screen drivers, they are there, fully open-source and despite that, almost none of them are in modern mainline.