diff options
author | Sam Ravnborg <sam@ravnborg.org> | 2012-05-11 07:35:15 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-05-11 22:29:00 -0400 |
commit | 323206a1d5bb01883c3d81d163e4091904a92475 (patch) | |
tree | 31f452781ad528d6bf78b4448359c914bb47e687 /arch/sparc | |
parent | 3c23a7665bb3c842e808cf9c6007ae46d008c30d (diff) |
sparc32: drop sun4c bits from head_32.S
As we no longer support sun4c we can remove all the code to
support remapping the kernel in head_32.S.
We also try to tell the user that the machine is not support,
in case someone try to boot the kernel on a sun4c one day
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc')
-rw-r--r-- | arch/sparc/kernel/head_32.S | 148 |
1 files changed, 19 insertions, 129 deletions
diff --git a/arch/sparc/kernel/head_32.S b/arch/sparc/kernel/head_32.S index 0e23ff36a419..85623f9da6ff 100644 --- a/arch/sparc/kernel/head_32.S +++ b/arch/sparc/kernel/head_32.S | |||
@@ -63,8 +63,8 @@ cputypvar_sun4m: | |||
63 | 63 | ||
64 | .align 4 | 64 | .align 4 |
65 | 65 | ||
66 | sun4_notsup: | 66 | sun4c_notsup: |
67 | .asciz "Sparc-Linux sun4 support does no longer exist.\n\n" | 67 | .asciz "Sparc-Linux sun4/sun4c support does no longer exist.\n\n" |
68 | .align 4 | 68 | .align 4 |
69 | 69 | ||
70 | sun4e_notsup: | 70 | sun4e_notsup: |
@@ -520,10 +520,10 @@ copy_prom_lvl14: | |||
520 | ldd [%g2 + 0x8], %g4 | 520 | ldd [%g2 + 0x8], %g4 |
521 | std %g4, [%g3 + 0x8] ! Copy proms handler | 521 | std %g4, [%g3 + 0x8] ! Copy proms handler |
522 | 522 | ||
523 | /* Must determine whether we are on a sun4c MMU, SRMMU, or SUN4/400 MUTANT | 523 | /* DON'T TOUCH %l0 thru %l5 in these remapping routines, |
524 | * MMU so we can remap ourselves properly. DON'T TOUCH %l0 thru %l5 in these | 524 | * we need their values afterwards! |
525 | * remapping routines, we need their values afterwards! | ||
526 | */ | 525 | */ |
526 | |||
527 | /* Now check whether we are already mapped, if we | 527 | /* Now check whether we are already mapped, if we |
528 | * are we can skip all this garbage coming up. | 528 | * are we can skip all this garbage coming up. |
529 | */ | 529 | */ |
@@ -532,26 +532,6 @@ copy_prom_done: | |||
532 | be go_to_highmem ! this will be a nop then | 532 | be go_to_highmem ! this will be a nop then |
533 | nop | 533 | nop |
534 | 534 | ||
535 | set LOAD_ADDR, %g6 | ||
536 | cmp %g7, %g6 | ||
537 | bne remap_not_a_sun4 ! This is not a Sun4 | ||
538 | nop | ||
539 | |||
540 | or %g0, 0x1, %g1 | ||
541 | lduba [%g1] ASI_CONTROL, %g1 ! Only safe to try on Sun4. | ||
542 | subcc %g1, 0x24, %g0 ! Is this a mutant Sun4/400??? | ||
543 | be sun4_mutant_remap ! Ugh, it is... | ||
544 | nop | ||
545 | |||
546 | b sun4_normal_remap ! regular sun4, 2 level mmu | ||
547 | nop | ||
548 | |||
549 | remap_not_a_sun4: | ||
550 | lda [%g0] ASI_M_MMUREGS, %g1 ! same as ASI_PTE on sun4c | ||
551 | and %g1, 0x1, %g1 ! Test SRMMU Enable bit ;-) | ||
552 | cmp %g1, 0x0 | ||
553 | be sun4c_remap ! A sun4c MMU or normal Sun4 | ||
554 | nop | ||
555 | srmmu_remap: | 535 | srmmu_remap: |
556 | /* First, check for a viking (TI) module. */ | 536 | /* First, check for a viking (TI) module. */ |
557 | set 0x40000000, %g2 | 537 | set 0x40000000, %g2 |
@@ -657,72 +637,6 @@ srmmu_nviking: | |||
657 | b go_to_highmem | 637 | b go_to_highmem |
658 | nop ! wheee.... | 638 | nop ! wheee.... |
659 | 639 | ||
660 | /* This remaps the kernel on Sun4/4xx machines | ||
661 | * that have the Sun Mutant Three Level MMU. | ||
662 | * It's like a platypus, Sun didn't have the | ||
663 | * SRMMU in conception so they kludged the three | ||
664 | * level logic in the regular Sun4 MMU probably. | ||
665 | * | ||
666 | * Basically, you take each entry in the top level | ||
667 | * directory that maps the low 3MB starting at | ||
668 | * address zero and put the mapping in the KERNBASE | ||
669 | * slots. These top level pgd's are called regmaps. | ||
670 | */ | ||
671 | sun4_mutant_remap: | ||
672 | or %g0, %g0, %g3 ! source base | ||
673 | sethi %hi(KERNBASE), %g4 ! destination base | ||
674 | or %g4, %lo(KERNBASE), %g4 | ||
675 | sethi %hi(0x300000), %g5 | ||
676 | or %g5, %lo(0x300000), %g5 ! upper bound 3MB | ||
677 | or %g0, 0x1, %l6 | ||
678 | sll %l6, 24, %l6 ! Regmap mapping size | ||
679 | add %g3, 0x2, %g3 ! Base magic | ||
680 | add %g4, 0x2, %g4 ! Base magic | ||
681 | |||
682 | /* Main remapping loop on Sun4-Mutant-MMU. | ||
683 | * "I am not an animal..." -Famous Mutant Person | ||
684 | */ | ||
685 | sun4_mutant_loop: | ||
686 | lduha [%g3] ASI_REGMAP, %g2 ! Get lower entry | ||
687 | stha %g2, [%g4] ASI_REGMAP ! Store in high entry | ||
688 | add %g4, %l6, %g4 ! Move up high memory ptr | ||
689 | subcc %g3, %g5, %g0 ! Reached our limit? | ||
690 | blu sun4_mutant_loop ! Nope, loop again | ||
691 | add %g3, %l6, %g3 ! delay, Move up low ptr | ||
692 | b go_to_highmem ! Jump to high memory. | ||
693 | nop | ||
694 | |||
695 | /* The following is for non-4/4xx sun4 MMU's. */ | ||
696 | sun4_normal_remap: | ||
697 | mov 0, %g3 ! source base | ||
698 | set KERNBASE, %g4 ! destination base | ||
699 | set 0x300000, %g5 ! upper bound 3MB | ||
700 | mov 1, %l6 | ||
701 | sll %l6, 18, %l6 ! sun4 mmu segmap size | ||
702 | sun4_normal_loop: | ||
703 | lduha [%g3] ASI_SEGMAP, %g6 ! load phys_seg | ||
704 | stha %g6, [%g4] ASI_SEGMAP ! stort new virt mapping | ||
705 | add %g3, %l6, %g3 ! increment source pointer | ||
706 | subcc %g3, %g5, %g0 ! reached limit? | ||
707 | blu sun4_normal_loop ! nope, loop again | ||
708 | add %g4, %l6, %g4 ! delay, increment dest ptr | ||
709 | b go_to_highmem | ||
710 | nop | ||
711 | |||
712 | /* The following works for Sun4c MMU's */ | ||
713 | sun4c_remap: | ||
714 | mov 0, %g3 ! source base | ||
715 | set KERNBASE, %g4 ! destination base | ||
716 | set 0x300000, %g5 ! upper bound 3MB | ||
717 | mov 1, %l6 | ||
718 | sll %l6, 18, %l6 ! sun4c mmu segmap size | ||
719 | sun4c_remap_loop: | ||
720 | lda [%g3] ASI_SEGMAP, %g6 ! load phys_seg | ||
721 | sta %g6, [%g4] ASI_SEGMAP ! store new virt mapping | ||
722 | add %g3, %l6, %g3 ! Increment source ptr | ||
723 | subcc %g3, %g5, %g0 ! Reached limit? | ||
724 | bl sun4c_remap_loop ! Nope, loop again | ||
725 | add %g4, %l6, %g4 ! delay, Increment dest ptr | ||
726 | 640 | ||
727 | /* Now do a non-relative jump so that PC is in high-memory */ | 641 | /* Now do a non-relative jump so that PC is in high-memory */ |
728 | go_to_highmem: | 642 | go_to_highmem: |
@@ -759,16 +673,6 @@ execute_in_high_mem: | |||
759 | be found_version | 673 | be found_version |
760 | nop | 674 | nop |
761 | 675 | ||
762 | /* Old sun4's pass our load address into %o0 instead of the prom | ||
763 | * pointer. On sun4's you have to hard code the romvec pointer into | ||
764 | * your code. Sun probably still does that because they don't even | ||
765 | * trust their own "OpenBoot" specifications. | ||
766 | */ | ||
767 | set LOAD_ADDR, %g6 | ||
768 | cmp %o0, %g6 ! an old sun4? | ||
769 | be sun4_init | ||
770 | nop | ||
771 | |||
772 | found_version: | 676 | found_version: |
773 | /* Get the machine type via the mysterious romvec node operations. */ | 677 | /* Get the machine type via the mysterious romvec node operations. */ |
774 | 678 | ||
@@ -823,16 +727,16 @@ got_prop: | |||
823 | /* Update boot_cpu_id only on boot cpu */ | 727 | /* Update boot_cpu_id only on boot cpu */ |
824 | stub %g1, [%g2 + %lo(boot_cpu_id)] | 728 | stub %g1, [%g2 + %lo(boot_cpu_id)] |
825 | 729 | ||
826 | ba sun4c_continue_boot | 730 | ba continue_boot |
827 | nop | 731 | nop |
828 | #endif | 732 | #endif |
829 | set cputypval, %o2 | 733 | set cputypval, %o2 |
830 | ldub [%o2 + 0x4], %l1 | 734 | ldub [%o2 + 0x4], %l1 |
831 | 735 | ||
832 | cmp %l1, ' ' | 736 | cmp %l1, ' ' |
833 | be 1f | 737 | be no_sun4c_here |
834 | cmp %l1, 'c' | 738 | cmp %l1, 'c' |
835 | be 1f | 739 | be no_sun4c_here |
836 | cmp %l1, 'm' | 740 | cmp %l1, 'm' |
837 | be 1f | 741 | be 1f |
838 | cmp %l1, 's' | 742 | cmp %l1, 's' |
@@ -847,19 +751,12 @@ got_prop: | |||
847 | 751 | ||
848 | 1: set cputypval, %l1 | 752 | 1: set cputypval, %l1 |
849 | ldub [%l1 + 0x4], %l1 | 753 | ldub [%l1 + 0x4], %l1 |
850 | cmp %l1, 'm' ! Test for sun4d, sun4e ? | 754 | cmp %l1, 'd' ! Let us see how the beast will die |
851 | be sun4m_init | ||
852 | cmp %l1, 's' ! Treat sun4s as sun4m | ||
853 | be sun4m_init | ||
854 | cmp %l1, 'd' ! Let us see how the beast will die | ||
855 | be sun4d_init | 755 | be sun4d_init |
856 | nop | 756 | nop |
857 | 757 | ||
858 | /* Jump into mmu context zero. */ | 758 | /* If not sun4d assume sun4m */ |
859 | set AC_CONTEXT, %g1 | 759 | b sun4m_init |
860 | stba %g0, [%g1] ASI_CONTROL | ||
861 | |||
862 | b sun4c_continue_boot | ||
863 | nop | 760 | nop |
864 | 761 | ||
865 | /* CPUID in bootbus can be found at PA 0xff0140000 */ | 762 | /* CPUID in bootbus can be found at PA 0xff0140000 */ |
@@ -959,7 +856,7 @@ sun4m_init: | |||
959 | srl %o1, 28, %o1 ! Get a type of the CPU | 856 | srl %o1, 28, %o1 ! Get a type of the CPU |
960 | 857 | ||
961 | subcc %o1, 4, %g0 ! TI: Viking or MicroSPARC | 858 | subcc %o1, 4, %g0 ! TI: Viking or MicroSPARC |
962 | be sun4c_continue_boot | 859 | be continue_boot |
963 | nop | 860 | nop |
964 | 861 | ||
965 | set AC_M_SFSR, %o0 | 862 | set AC_M_SFSR, %o0 |
@@ -969,7 +866,7 @@ sun4m_init: | |||
969 | 866 | ||
970 | /* Fujitsu MicroSPARC-II has no asynchronous flavors of FARs */ | 867 | /* Fujitsu MicroSPARC-II has no asynchronous flavors of FARs */ |
971 | subcc %o1, 0, %g0 | 868 | subcc %o1, 0, %g0 |
972 | be sun4c_continue_boot | 869 | be continue_boot |
973 | nop | 870 | nop |
974 | 871 | ||
975 | set AC_M_AFSR, %o0 | 872 | set AC_M_AFSR, %o0 |
@@ -979,8 +876,7 @@ sun4m_init: | |||
979 | nop | 876 | nop |
980 | 877 | ||
981 | 878 | ||
982 | sun4c_continue_boot: | 879 | continue_boot: |
983 | |||
984 | 880 | ||
985 | /* Aieee, now set PC and nPC, enable traps, give ourselves a stack and it's | 881 | /* Aieee, now set PC and nPC, enable traps, give ourselves a stack and it's |
986 | * show-time! | 882 | * show-time! |
@@ -1161,18 +1057,12 @@ sun4c_continue_boot: | |||
1161 | /* We should not get here. */ | 1057 | /* We should not get here. */ |
1162 | call halt_me | 1058 | call halt_me |
1163 | nop | 1059 | nop |
1164 | 1060 | no_sun4c_here: | |
1165 | sun4_init: | 1061 | ld [%g7 + 0x68], %o1 |
1166 | sethi %hi(SUN4_PROM_VECTOR+0x84), %o1 | 1062 | set sun4c_notsup, %o0 |
1167 | ld [%o1 + %lo(SUN4_PROM_VECTOR+0x84)], %o1 | 1063 | call %o1 |
1168 | set sun4_notsup, %o0 | ||
1169 | call %o1 /* printf */ | ||
1170 | nop | ||
1171 | sethi %hi(SUN4_PROM_VECTOR+0xc4), %o1 | ||
1172 | ld [%o1 + %lo(SUN4_PROM_VECTOR+0xc4)], %o1 | ||
1173 | call %o1 /* exittomon */ | ||
1174 | nop | 1064 | nop |
1175 | 1: ba 1b ! Cannot exit into KMON | 1065 | b halt_me |
1176 | nop | 1066 | nop |
1177 | 1067 | ||
1178 | no_sun4e_here: | 1068 | no_sun4e_here: |