aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc')
-rw-r--r--arch/powerpc/kernel/setup_64.c270
1 files changed, 0 insertions, 270 deletions
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
index 0312422881ae..9cdf294e76f6 100644
--- a/arch/powerpc/kernel/setup_64.c
+++ b/arch/powerpc/kernel/setup_64.c
@@ -138,23 +138,6 @@ static struct notifier_block ppc64_panic_block = {
138 .priority = INT_MIN /* may not return; must be done last */ 138 .priority = INT_MIN /* may not return; must be done last */
139}; 139};
140 140
141/*
142 * Perhaps we can put the pmac screen_info[] here
143 * on pmac as well so we don't need the ifdef's.
144 * Until we get multiple-console support in here
145 * that is. -- Cort
146 * Maybe tie it to serial consoles, since this is really what
147 * these processors use on existing boards. -- Dan
148 */
149struct screen_info screen_info = {
150 .orig_x = 0,
151 .orig_y = 25,
152 .orig_video_cols = 80,
153 .orig_video_lines = 25,
154 .orig_video_isVGA = 1,
155 .orig_video_points = 16
156};
157
158#ifdef CONFIG_SMP 141#ifdef CONFIG_SMP
159 142
160static int smt_enabled_cmdline; 143static int smt_enabled_cmdline;
@@ -641,51 +624,6 @@ void __init setup_system(void)
641 DBG(" <- setup_system()\n"); 624 DBG(" <- setup_system()\n");
642} 625}
643 626
644/* also used by kexec */
645void machine_shutdown(void)
646{
647 if (ppc_md.nvram_sync)
648 ppc_md.nvram_sync();
649}
650
651void machine_restart(char *cmd)
652{
653 machine_shutdown();
654 ppc_md.restart(cmd);
655#ifdef CONFIG_SMP
656 smp_send_stop();
657#endif
658 printk(KERN_EMERG "System Halted, OK to turn off power\n");
659 local_irq_disable();
660 while (1) ;
661}
662
663void machine_power_off(void)
664{
665 machine_shutdown();
666 ppc_md.power_off();
667#ifdef CONFIG_SMP
668 smp_send_stop();
669#endif
670 printk(KERN_EMERG "System Halted, OK to turn off power\n");
671 local_irq_disable();
672 while (1) ;
673}
674/* Used by the G5 thermal driver */
675EXPORT_SYMBOL_GPL(machine_power_off);
676
677void machine_halt(void)
678{
679 machine_shutdown();
680 ppc_md.halt();
681#ifdef CONFIG_SMP
682 smp_send_stop();
683#endif
684 printk(KERN_EMERG "System Halted, OK to turn off power\n");
685 local_irq_disable();
686 while (1) ;
687}
688
689static int ppc64_panic_event(struct notifier_block *this, 627static int ppc64_panic_event(struct notifier_block *this,
690 unsigned long event, void *ptr) 628 unsigned long event, void *ptr)
691{ 629{
@@ -693,90 +631,6 @@ static int ppc64_panic_event(struct notifier_block *this,
693 return NOTIFY_DONE; 631 return NOTIFY_DONE;
694} 632}
695 633
696
697#ifdef CONFIG_SMP
698DEFINE_PER_CPU(unsigned int, pvr);
699#endif
700
701static int show_cpuinfo(struct seq_file *m, void *v)
702{
703 unsigned long cpu_id = (unsigned long)v - 1;
704 unsigned int pvr;
705 unsigned short maj;
706 unsigned short min;
707
708 if (cpu_id == NR_CPUS) {
709 seq_printf(m, "timebase\t: %lu\n", ppc_tb_freq);
710
711 if (ppc_md.show_cpuinfo != NULL)
712 ppc_md.show_cpuinfo(m);
713
714 return 0;
715 }
716
717 /* We only show online cpus: disable preempt (overzealous, I
718 * knew) to prevent cpu going down. */
719 preempt_disable();
720 if (!cpu_online(cpu_id)) {
721 preempt_enable();
722 return 0;
723 }
724
725#ifdef CONFIG_SMP
726 pvr = per_cpu(pvr, cpu_id);
727#else
728 pvr = mfspr(SPRN_PVR);
729#endif
730 maj = (pvr >> 8) & 0xFF;
731 min = pvr & 0xFF;
732
733 seq_printf(m, "processor\t: %lu\n", cpu_id);
734 seq_printf(m, "cpu\t\t: ");
735
736 if (cur_cpu_spec->pvr_mask)
737 seq_printf(m, "%s", cur_cpu_spec->cpu_name);
738 else
739 seq_printf(m, "unknown (%08x)", pvr);
740
741#ifdef CONFIG_ALTIVEC
742 if (cpu_has_feature(CPU_FTR_ALTIVEC))
743 seq_printf(m, ", altivec supported");
744#endif /* CONFIG_ALTIVEC */
745
746 seq_printf(m, "\n");
747
748 /*
749 * Assume here that all clock rates are the same in a
750 * smp system. -- Cort
751 */
752 seq_printf(m, "clock\t\t: %lu.%06luMHz\n", ppc_proc_freq / 1000000,
753 ppc_proc_freq % 1000000);
754
755 seq_printf(m, "revision\t: %hd.%hd\n\n", maj, min);
756
757 preempt_enable();
758 return 0;
759}
760
761static void *c_start(struct seq_file *m, loff_t *pos)
762{
763 return *pos <= NR_CPUS ? (void *)((*pos)+1) : NULL;
764}
765static void *c_next(struct seq_file *m, void *v, loff_t *pos)
766{
767 ++*pos;
768 return c_start(m, pos);
769}
770static void c_stop(struct seq_file *m, void *v)
771{
772}
773struct seq_operations cpuinfo_op = {
774 .start =c_start,
775 .next = c_next,
776 .stop = c_stop,
777 .show = show_cpuinfo,
778};
779
780/* 634/*
781 * These three variables are used to save values passed to us by prom_init() 635 * These three variables are used to save values passed to us by prom_init()
782 * via the device tree. The TCE variables are needed because with a memory_limit 636 * via the device tree. The TCE variables are needed because with a memory_limit
@@ -803,130 +657,6 @@ static int __init early_parsemem(char *p)
803early_param("mem", early_parsemem); 657early_param("mem", early_parsemem);
804#endif /* CONFIG_PPC_ISERIES */ 658#endif /* CONFIG_PPC_ISERIES */
805 659
806#ifdef CONFIG_PPC_MULTIPLATFORM
807static int __init set_preferred_console(void)
808{
809 struct device_node *prom_stdout = NULL;
810 char *name;
811 u32 *spd;
812 int offset = 0;
813
814 DBG(" -> set_preferred_console()\n");
815
816 /* The user has requested a console so this is already set up. */
817 if (strstr(saved_command_line, "console=")) {
818 DBG(" console was specified !\n");
819 return -EBUSY;
820 }
821
822 if (!of_chosen) {
823 DBG(" of_chosen is NULL !\n");
824 return -ENODEV;
825 }
826 /* We are getting a weird phandle from OF ... */
827 /* ... So use the full path instead */
828 name = (char *)get_property(of_chosen, "linux,stdout-path", NULL);
829 if (name == NULL) {
830 DBG(" no linux,stdout-path !\n");
831 return -ENODEV;
832 }
833 prom_stdout = of_find_node_by_path(name);
834 if (!prom_stdout) {
835 DBG(" can't find stdout package %s !\n", name);
836 return -ENODEV;
837 }
838 DBG("stdout is %s\n", prom_stdout->full_name);
839
840 name = (char *)get_property(prom_stdout, "name", NULL);
841 if (!name) {
842 DBG(" stdout package has no name !\n");
843 goto not_found;
844 }
845 spd = (u32 *)get_property(prom_stdout, "current-speed", NULL);
846
847 if (0)
848 ;
849#ifdef CONFIG_SERIAL_8250_CONSOLE
850 else if (strcmp(name, "serial") == 0) {
851 int i;
852 u32 *reg = (u32 *)get_property(prom_stdout, "reg", &i);
853 if (i > 8) {
854 switch (reg[1]) {
855 case 0x3f8:
856 offset = 0;
857 break;
858 case 0x2f8:
859 offset = 1;
860 break;
861 case 0x898:
862 offset = 2;
863 break;
864 case 0x890:
865 offset = 3;
866 break;
867 default:
868 /* We dont recognise the serial port */
869 goto not_found;
870 }
871 }
872 }
873#endif /* CONFIG_SERIAL_8250_CONSOLE */
874#ifdef CONFIG_PPC_PSERIES
875 else if (strcmp(name, "vty") == 0) {
876 u32 *reg = (u32 *)get_property(prom_stdout, "reg", NULL);
877 char *compat = (char *)get_property(prom_stdout, "compatible", NULL);
878
879 if (reg && compat && (strcmp(compat, "hvterm-protocol") == 0)) {
880 /* Host Virtual Serial Interface */
881 int offset;
882 switch (reg[0]) {
883 case 0x30000000:
884 offset = 0;
885 break;
886 case 0x30000001:
887 offset = 1;
888 break;
889 default:
890 goto not_found;
891 }
892 of_node_put(prom_stdout);
893 DBG("Found hvsi console at offset %d\n", offset);
894 return add_preferred_console("hvsi", offset, NULL);
895 } else {
896 /* pSeries LPAR virtual console */
897 of_node_put(prom_stdout);
898 DBG("Found hvc console\n");
899 return add_preferred_console("hvc", 0, NULL);
900 }
901 }
902#endif /* CONFIG_PPC_PSERIES */
903#ifdef CONFIG_SERIAL_PMACZILOG_CONSOLE
904 else if (strcmp(name, "ch-a") == 0)
905 offset = 0;
906 else if (strcmp(name, "ch-b") == 0)
907 offset = 1;
908#endif /* CONFIG_SERIAL_PMACZILOG_CONSOLE */
909 else
910 goto not_found;
911 of_node_put(prom_stdout);
912
913 DBG("Found serial console at ttyS%d\n", offset);
914
915 if (spd) {
916 static char __initdata opt[16];
917 sprintf(opt, "%d", *spd);
918 return add_preferred_console("ttyS", offset, opt);
919 } else
920 return add_preferred_console("ttyS", offset, NULL);
921
922 not_found:
923 DBG("No preferred console found !\n");
924 of_node_put(prom_stdout);
925 return -ENODEV;
926}
927console_initcall(set_preferred_console);
928#endif /* CONFIG_PPC_MULTIPLATFORM */
929
930#ifdef CONFIG_IRQSTACKS 660#ifdef CONFIG_IRQSTACKS
931static void __init irqstack_early_init(void) 661static void __init irqstack_early_init(void)
932{ 662{