in your scenario, there is a downtime. You better have some maintenance window available first.
Here is the sequence.
failover to secondary.
power off primary, upgrade the hardware.
plug in all the necessary cabled
power on the primary, you should console access, as soon as the primary comes up (not 100% online yet), you powerdown the secondary.
upgrade the secondary.
There is a downtime when primary is coming up and secondary is going down. But it should be 30 seconds or less.
Thanks
Nadeem