#define OPAL_LPC_READ                          67
 #define OPAL_LPC_WRITE                         68
 #define OPAL_RETURN_CPU                                69
+#define OPAL_REINIT_CPUS                       70
 #define OPAL_ELOG_READ                         71
 #define OPAL_ELOG_WRITE                                72
 #define OPAL_ELOG_ACK                          73
        uint64_t pestB[OPAL_PHB3_NUM_PEST_REGS];
 };
 
+enum {
+       OPAL_REINIT_CPUS_HILE_BE        = (1 << 0),
+       OPAL_REINIT_CPUS_HILE_LE        = (1 << 1),
+};
+
 typedef struct oppanel_line {
        const char *    line;
        uint64_t        line_len;
                            uint16_t *pci_error_type, uint16_t *severity);
 int64_t opal_pci_poll(uint64_t phb_id);
 int64_t opal_return_cpu(void);
+int64_t opal_reinit_cpus(uint64_t flags);
 
 int64_t opal_xscom_read(uint32_t gcid, uint64_t pcb_addr, __be64 *val);
 int64_t opal_xscom_write(uint32_t gcid, uint64_t pcb_addr, uint64_t val);
 
 OPAL_CALL(opal_lpc_read,                       OPAL_LPC_READ);
 OPAL_CALL(opal_lpc_write,                      OPAL_LPC_WRITE);
 OPAL_CALL(opal_return_cpu,                     OPAL_RETURN_CPU);
+OPAL_CALL(opal_reinit_cpus,                    OPAL_REINIT_CPUS);
 OPAL_CALL(opal_read_elog,                      OPAL_ELOG_READ);
 OPAL_CALL(opal_send_ack_elog,                  OPAL_ELOG_ACK);
 OPAL_CALL(opal_get_elog_size,                  OPAL_ELOG_SIZE);
 
 static uint64_t last_notified_mask = 0x0ul;
 static atomic_t opal_notifier_hold = ATOMIC_INIT(0);
 
+static void opal_reinit_cores(void)
+{
+       /* Do the actual re-init, This will clobber all FPRs, VRs, etc...
+        *
+        * It will preserve non volatile GPRs and HSPRG0/1. It will
+        * also restore HIDs and other SPRs to their original value
+        * but it might clobber a bunch.
+        */
+#ifdef __BIG_ENDIAN__
+       opal_reinit_cpus(OPAL_REINIT_CPUS_HILE_BE);
+#else
+       opal_reinit_cpus(OPAL_REINIT_CPUS_HILE_LE);
+#endif
+}
+
 int __init early_init_dt_scan_opal(unsigned long node,
                                   const char *uname, int depth, void *data)
 {
                printk("OPAL V1 detected !\n");
        }
 
+       /* Reinit all cores with the right endian */
+       opal_reinit_cores();
+
+       /* Restore some bits */
+       if (cur_cpu_spec->cpu_restore)
+               cur_cpu_spec->cpu_restore();
+
        return 1;
 }