Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 637952ca authored by Hendrik Brueckner's avatar Hendrik Brueckner Committed by Martin Schwidefsky
Browse files

[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: default avatarHendrik Brueckner <brueckner@linux.vnet.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent cf05b824
Loading
Loading
Loading
Loading
+18 −7
Original line number Original line Diff line number Diff line
@@ -154,6 +154,20 @@ static int __init condev_setup(char *str)


__setup("condev=", condev_setup);
__setup("condev=", condev_setup);


static void __init set_preferred_console(void)
{
	if (MACHINE_IS_KVM) {
		add_preferred_console("hvc", 0, NULL);
		s390_virtio_console_init();
		return;
	}

	if (CONSOLE_IS_3215 || CONSOLE_IS_SCLP)
		add_preferred_console("ttyS", 0, NULL);
	if (CONSOLE_IS_3270)
		add_preferred_console("tty3270", 0, NULL);
}

static int __init conmode_setup(char *str)
static int __init conmode_setup(char *str)
{
{
#if defined(CONFIG_SCLP_CONSOLE) || defined(CONFIG_SCLP_VT220_CONSOLE)
#if defined(CONFIG_SCLP_CONSOLE) || defined(CONFIG_SCLP_VT220_CONSOLE)
@@ -168,6 +182,7 @@ static int __init conmode_setup(char *str)
	if (strncmp(str, "3270", 5) == 0)
	if (strncmp(str, "3270", 5) == 0)
		SET_CONSOLE_3270;
		SET_CONSOLE_3270;
#endif
#endif
	set_preferred_console();
        return 1;
        return 1;
}
}


@@ -780,9 +795,6 @@ static void __init setup_hwcaps(void)
void __init
void __init
setup_arch(char **cmdline_p)
setup_arch(char **cmdline_p)
{
{
	/* set up preferred console */
	add_preferred_console("ttyS", 0, NULL);

        /*
        /*
         * print what head.S has found out about the machine
         * print what head.S has found out about the machine
         */
         */
@@ -802,11 +814,9 @@ setup_arch(char **cmdline_p)
	if (MACHINE_IS_VM)
	if (MACHINE_IS_VM)
		pr_info("Linux is running as a z/VM "
		pr_info("Linux is running as a z/VM "
			"guest operating system in 64-bit mode\n");
			"guest operating system in 64-bit mode\n");
	else if (MACHINE_IS_KVM) {
	else if (MACHINE_IS_KVM)
		pr_info("Linux is running under KVM in 64-bit mode\n");
		pr_info("Linux is running under KVM in 64-bit mode\n");
		add_preferred_console("hvc", 0, NULL);
	else
		s390_virtio_console_init();
	} else
		pr_info("Linux is running natively in 64-bit mode\n");
		pr_info("Linux is running natively in 64-bit mode\n");
#endif /* CONFIG_64BIT */
#endif /* CONFIG_64BIT */


@@ -851,6 +861,7 @@ setup_arch(char **cmdline_p)


        /* Setup default console */
        /* Setup default console */
	conmode_default();
	conmode_default();
	set_preferred_console();


	/* Setup zfcpdump support */
	/* Setup zfcpdump support */
	setup_zfcpdump(console_devno);
	setup_zfcpdump(console_devno);