diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2016-07-05 01:04:09 -0400 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2016-07-21 05:14:29 -0400 |
commit | fa745a129cae93ca5d871ebac2a8f6c27ae3fbf2 (patch) | |
tree | 1f936cf8f8efd7beab302c5f533de95013770a65 /arch/powerpc | |
parent | 9df549afeab4ea968b6d83cf9d7a1e3c577a9846 (diff) |
powerpc/64: Move the content of setup_system() to setup_arch()
And kill setup_system().
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc')
-rw-r--r-- | arch/powerpc/kernel/head_64.S | 5 | ||||
-rw-r--r-- | arch/powerpc/kernel/setup_64.c | 134 |
2 files changed, 63 insertions, 76 deletions
diff --git a/arch/powerpc/kernel/head_64.S b/arch/powerpc/kernel/head_64.S index 064cd9397836..f765b0434731 100644 --- a/arch/powerpc/kernel/head_64.S +++ b/arch/powerpc/kernel/head_64.S | |||
@@ -941,7 +941,7 @@ start_here_multiplatform: | |||
941 | mtspr SPRN_SRR1,r4 | 941 | mtspr SPRN_SRR1,r4 |
942 | RFI | 942 | RFI |
943 | b . /* prevent speculative execution */ | 943 | b . /* prevent speculative execution */ |
944 | 944 | ||
945 | /* This is where all platforms converge execution */ | 945 | /* This is where all platforms converge execution */ |
946 | 946 | ||
947 | start_here_common: | 947 | start_here_common: |
@@ -951,9 +951,6 @@ start_here_common: | |||
951 | /* Load the TOC (virtual address) */ | 951 | /* Load the TOC (virtual address) */ |
952 | ld r2,PACATOC(r13) | 952 | ld r2,PACATOC(r13) |
953 | 953 | ||
954 | /* Do more system initializations in virtual mode */ | ||
955 | bl setup_system | ||
956 | |||
957 | /* Mark interrupts soft and hard disabled (they might be enabled | 954 | /* Mark interrupts soft and hard disabled (they might be enabled |
958 | * in the PACA when doing hotplug) | 955 | * in the PACA when doing hotplug) |
959 | */ | 956 | */ |
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c index aca215d77fe3..61c3e6c42262 100644 --- a/arch/powerpc/kernel/setup_64.c +++ b/arch/powerpc/kernel/setup_64.c | |||
@@ -512,78 +512,6 @@ static __init void print_system_info(void) | |||
512 | pr_info("-----------------------------------------------------\n"); | 512 | pr_info("-----------------------------------------------------\n"); |
513 | } | 513 | } |
514 | 514 | ||
515 | /* | ||
516 | * Do some initial setup of the system. The parameters are those which | ||
517 | * were passed in from the bootloader. | ||
518 | */ | ||
519 | void __init setup_system(void) | ||
520 | { | ||
521 | DBG(" -> setup_system()\n"); | ||
522 | |||
523 | /* | ||
524 | * Unflatten the device-tree passed by prom_init or kexec | ||
525 | */ | ||
526 | unflatten_device_tree(); | ||
527 | |||
528 | /* | ||
529 | * Fill the ppc64_caches & systemcfg structures with informations | ||
530 | * retrieved from the device-tree. | ||
531 | */ | ||
532 | initialize_cache_info(); | ||
533 | |||
534 | #ifdef CONFIG_PPC_RTAS | ||
535 | /* | ||
536 | * Initialize RTAS if available | ||
537 | */ | ||
538 | rtas_initialize(); | ||
539 | #endif /* CONFIG_PPC_RTAS */ | ||
540 | |||
541 | /* | ||
542 | * Check if we have an initrd provided via the device-tree | ||
543 | */ | ||
544 | check_for_initrd(); | ||
545 | |||
546 | /* Probe the machine type */ | ||
547 | probe_machine(); | ||
548 | |||
549 | /* | ||
550 | * We can discover serial ports now since the above did setup the | ||
551 | * hash table management for us, thus ioremap works. We do that early | ||
552 | * so that further code can be debugged | ||
553 | */ | ||
554 | find_legacy_serial_ports(); | ||
555 | |||
556 | /* | ||
557 | * Register early console | ||
558 | */ | ||
559 | register_early_udbg_console(); | ||
560 | |||
561 | /* | ||
562 | * Initialize xmon | ||
563 | */ | ||
564 | xmon_setup(); | ||
565 | |||
566 | smp_setup_cpu_maps(); | ||
567 | check_smt_enabled(); | ||
568 | setup_tlb_core_data(); | ||
569 | |||
570 | /* | ||
571 | * Freescale Book3e parts spin in a loop provided by firmware, | ||
572 | * so smp_release_cpus() does nothing for them | ||
573 | */ | ||
574 | #if defined(CONFIG_SMP) | ||
575 | /* Release secondary cpus out of their spinloops at 0x60 now that | ||
576 | * we can map physical -> logical CPU ids | ||
577 | */ | ||
578 | smp_release_cpus(); | ||
579 | #endif | ||
580 | |||
581 | /* Print various info about the machine that has been gathered so far. */ | ||
582 | print_system_info(); | ||
583 | |||
584 | DBG(" <- setup_system()\n"); | ||
585 | } | ||
586 | |||
587 | /* This returns the limit below which memory accesses to the linear | 515 | /* This returns the limit below which memory accesses to the linear |
588 | * mapping are guarnateed not to cause a TLB or SLB miss. This is | 516 | * mapping are guarnateed not to cause a TLB or SLB miss. This is |
589 | * used to allocate interrupt or emergency stacks for which our | 517 | * used to allocate interrupt or emergency stacks for which our |
@@ -695,6 +623,68 @@ void __init setup_arch(char **cmdline_p) | |||
695 | { | 623 | { |
696 | *cmdline_p = boot_command_line; | 624 | *cmdline_p = boot_command_line; |
697 | 625 | ||
626 | /* | ||
627 | * Unflatten the device-tree passed by prom_init or kexec | ||
628 | */ | ||
629 | unflatten_device_tree(); | ||
630 | |||
631 | /* | ||
632 | * Fill the ppc64_caches & systemcfg structures with informations | ||
633 | * retrieved from the device-tree. | ||
634 | */ | ||
635 | initialize_cache_info(); | ||
636 | |||
637 | #ifdef CONFIG_PPC_RTAS | ||
638 | /* | ||
639 | * Initialize RTAS if available | ||
640 | */ | ||
641 | rtas_initialize(); | ||
642 | #endif /* CONFIG_PPC_RTAS */ | ||
643 | |||
644 | /* | ||
645 | * Check if we have an initrd provided via the device-tree | ||
646 | */ | ||
647 | check_for_initrd(); | ||
648 | |||
649 | /* Probe the machine type */ | ||
650 | probe_machine(); | ||
651 | |||
652 | /* | ||
653 | * We can discover serial ports now since the above did setup the | ||
654 | * hash table management for us, thus ioremap works. We do that early | ||
655 | * so that further code can be debugged | ||
656 | */ | ||
657 | find_legacy_serial_ports(); | ||
658 | |||
659 | /* | ||
660 | * Register early console | ||
661 | */ | ||
662 | register_early_udbg_console(); | ||
663 | |||
664 | /* | ||
665 | * Initialize xmon | ||
666 | */ | ||
667 | xmon_setup(); | ||
668 | |||
669 | smp_setup_cpu_maps(); | ||
670 | check_smt_enabled(); | ||
671 | setup_tlb_core_data(); | ||
672 | |||
673 | /* | ||
674 | * Freescale Book3e parts spin in a loop provided by firmware, | ||
675 | * so smp_release_cpus() does nothing for them | ||
676 | */ | ||
677 | #if defined(CONFIG_SMP) | ||
678 | /* | ||
679 | * Release secondary cpus out of their spinloops at 0x60 now that | ||
680 | * we can map physical -> logical CPU ids | ||
681 | */ | ||
682 | smp_release_cpus(); | ||
683 | #endif | ||
684 | |||
685 | /* Print various info about the machine that has been gathered so far. */ | ||
686 | print_system_info(); | ||
687 | |||
698 | /* Reserve large chunks of memory for use by CMA for KVM */ | 688 | /* Reserve large chunks of memory for use by CMA for KVM */ |
699 | kvm_cma_reserve(); | 689 | kvm_cma_reserve(); |
700 | 690 | ||