[POWERPC] Consolidate feature fixup code
[powerpc.git] / arch / powerpc / kernel / setup_64.c
index 4b2e32e..1969b56 100644 (file)
@@ -170,6 +170,9 @@ void __init setup_paca(int cpu)
 
 void __init early_setup(unsigned long dt_ptr)
 {
+       /* Identify CPU type */
+       identify_cpu(0);
+
        /* Assume we're on cpu 0 for now. Don't write to the paca yet! */
        setup_paca(0);
 
@@ -348,6 +351,14 @@ void __init setup_system(void)
 {
        DBG(" -> setup_system()\n");
 
+       /* Apply the CPUs-specific and firmware specific fixups to kernel
+        * text (nop out sections not relevant to this CPU or this firmware)
+        */
+       do_feature_fixups(0, cur_cpu_spec->cpu_features,
+                         &__start___ftr_fixup, &__stop___ftr_fixup);
+       do_feature_fixups(0, powerpc_firmware_features,
+                         &__start___fw_ftr_fixup, &__stop___fw_ftr_fixup);
+
        /*
         * Unflatten the device-tree passed by prom_init or kexec
         */