fdt: Fix update of "interrupt-controller" node at CAS
fdt: Fix update of "interrupt-controller" node at CAS

Now that QEMU passes a full FDT at CAS without rebooting, a guest that
has switched from XICS to XIVE ends up being presented an malformed
"interrupt-controller" node in the DT:

# dtc -I fs -O dts /proc/device-tree
<stdout>: Warning (unit_address_vs_reg): /interrupt-controller: node has a reg or ranges property, but no unit name
...
        interrupt-controller {
                ibm,xive-eq-sizes = <0x10>;
                device_type = "power-ivpe";
                ibm,interrupt-server-ranges = <0x00 0x03>;
                compatible = "ibm,power-ivpe";
                #interrupt-cells = <0x02>;
                reg = <0x60302 0x31b0000 0x00 0x10000 0x60302 0x31a0000 0x00 0x10000>;
                phandle = <0xe7448a8>;
                ibm,xive-lisn-ranges = <0x00 0x03>;
                interrupt-controller;
        };

The node should have its unit set to "60302031b0000" as reported by dtc.
Also the node still has an "ibm,interrupt-server-ranges" property which
only makes sense with XICS.

This happens because we find an existing "interrupt-controller" node,
which describes a XICS controller, and we _wrongly_ decide to copy
all the properties from the new node into it. Delete the existing node
instead so that we create a new node with the appropriate properties
and unit name.

Signed-off-by: Greg Kurz <cc878073a22fe20c2ded9f6f326476101ddf4b25@kaod.org>
Reviewed-by: Alexey Kardashevskiy <ac1fc56530d7d037e1ea666f130daca22d72f964@ozlabs.ru>
Signed-off-by: Alexey Kardashevskiy <ac1fc56530d7d037e1ea666f130daca22d72f964@ozlabs.ru>

aik/SLOF,qemu/SLOF,stefanberger/SLOF-tpm,stefanberger/SLOF-tpm,stefanberger/SLOF-tpm,qemu/SLOF,qemu/SLOF,aik/SLOF,aik/SLOF