aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/kernel/setup.c
diff options
context:
space:
mode:
authorHendrik Brueckner <brueckner@linux.vnet.ibm.com>2009-08-23 12:09:06 -0400
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2009-08-23 12:10:01 -0400
commit637952ca689013339b977558061fa4ca8e07e1c1 (patch)
tree96338ff9702e49eb36940059b6e66cffe352a8a5 /arch/s390/kernel/setup.c
parentcf05b824dbb871159e1b4c4f2733b9c9d2f756cf (diff)
[S390] set preferred console based on conmode
setup_arch() unconditionally sets the preferred console to ttyS. This breaks the use of 3270 devices as the console. Provide a new function to set the default preferred console for s390. The preferred console depends on the conmode parameter that is used to switch between 3270 and 3215 terminal/console mode. Signed-off-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/kernel/setup.c')
-rw-r--r--arch/s390/kernel/setup.c25
1 files changed, 18 insertions, 7 deletions
diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c
index 9717717c6fea..cbb897bc50bd 100644
--- a/arch/s390/kernel/setup.c
+++ b/arch/s390/kernel/setup.c
@@ -154,6 +154,20 @@ static int __init condev_setup(char *str)
154 154
155__setup("condev=", condev_setup); 155__setup("condev=", condev_setup);
156 156
157static void __init set_preferred_console(void)
158{
159 if (MACHINE_IS_KVM) {
160 add_preferred_console("hvc", 0, NULL);
161 s390_virtio_console_init();
162 return;
163 }
164
165 if (CONSOLE_IS_3215 || CONSOLE_IS_SCLP)
166 add_preferred_console("ttyS", 0, NULL);
167 if (CONSOLE_IS_3270)
168 add_preferred_console("tty3270", 0, NULL);
169}
170
157static int __init conmode_setup(char *str) 171static int __init conmode_setup(char *str)
158{ 172{
159#if defined(CONFIG_SCLP_CONSOLE) || defined(CONFIG_SCLP_VT220_CONSOLE) 173#if defined(CONFIG_SCLP_CONSOLE) || defined(CONFIG_SCLP_VT220_CONSOLE)
@@ -168,6 +182,7 @@ static int __init conmode_setup(char *str)
168 if (strncmp(str, "3270", 5) == 0) 182 if (strncmp(str, "3270", 5) == 0)
169 SET_CONSOLE_3270; 183 SET_CONSOLE_3270;
170#endif 184#endif
185 set_preferred_console();
171 return 1; 186 return 1;
172} 187}
173 188
@@ -780,9 +795,6 @@ static void __init setup_hwcaps(void)
780void __init 795void __init
781setup_arch(char **cmdline_p) 796setup_arch(char **cmdline_p)
782{ 797{
783 /* set up preferred console */
784 add_preferred_console("ttyS", 0, NULL);
785
786 /* 798 /*
787 * print what head.S has found out about the machine 799 * print what head.S has found out about the machine
788 */ 800 */
@@ -802,11 +814,9 @@ setup_arch(char **cmdline_p)
802 if (MACHINE_IS_VM) 814 if (MACHINE_IS_VM)
803 pr_info("Linux is running as a z/VM " 815 pr_info("Linux is running as a z/VM "
804 "guest operating system in 64-bit mode\n"); 816 "guest operating system in 64-bit mode\n");
805 else if (MACHINE_IS_KVM) { 817 else if (MACHINE_IS_KVM)
806 pr_info("Linux is running under KVM in 64-bit mode\n"); 818 pr_info("Linux is running under KVM in 64-bit mode\n");
807 add_preferred_console("hvc", 0, NULL); 819 else
808 s390_virtio_console_init();
809 } else
810 pr_info("Linux is running natively in 64-bit mode\n"); 820 pr_info("Linux is running natively in 64-bit mode\n");
811#endif /* CONFIG_64BIT */ 821#endif /* CONFIG_64BIT */
812 822
@@ -851,6 +861,7 @@ setup_arch(char **cmdline_p)
851 861
852 /* Setup default console */ 862 /* Setup default console */
853 conmode_default(); 863 conmode_default();
864 set_preferred_console();
854 865
855 /* Setup zfcpdump support */ 866 /* Setup zfcpdump support */
856 setup_zfcpdump(console_devno); 867 setup_zfcpdump(console_devno);