From nobody Sun Nov 24 11:35:29 2024 Received: from fhigh-a3-smtp.messagingengine.com (fhigh-a3-smtp.messagingengine.com [103.168.172.154]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B1804216A28 for ; Tue, 5 Nov 2024 23:58:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.154 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730851102; cv=none; b=fz3chbunO0umY6M4sTfnqIF/Pl7XK9QW0HIkvl1WrxDuCHQIfTVC/CkItxRia2Z8Bk5YUZxQ9UwrM4jYl8859eKqx1GsbBCWSbUMNO9lK9w3tcPhjYujLU7wesbfQ+oumAWzX5+t5ZRNVRiouUcT0VmrV2FtejxdCgiuHJXm5ik= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730851102; c=relaxed/simple; bh=JtUF2H9w8fqLw+OadS7UHTS9qtXIn2XKlYlYS+esBA4=; h=To:Cc:Message-ID:From:Subject:Date; b=S8NBXveKUH+3Uqv6HK20UUf0KQ8vpdIkgZz1F9rFY/ybvdr3Dc40cnP3PHB7pGUhbH7iLgoPb4/qOpoGQbwQqnPYToIiL7rRMKQVY3Aq/81ZpTw8Od4i3/BVp3Wl5zxmy3ZpVPRzJz4XaFv6MgqWmABeF0ltA22pXCradxLFUGg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=linux-m68k.org; spf=none smtp.mailfrom=linux-m68k.org; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=PCpB71Mx; arc=none smtp.client-ip=103.168.172.154 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=linux-m68k.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux-m68k.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="PCpB71Mx" Received: from phl-compute-08.internal (phl-compute-08.phl.internal [10.202.2.48]) by mailfhigh.phl.internal (Postfix) with ESMTP id BA7FC11401B0; Tue, 5 Nov 2024 18:58:17 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-08.internal (MEProxy); Tue, 05 Nov 2024 18:58:17 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:message-id:reply-to:subject :subject:to:to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; t=1730851097; x=1730937497; bh=8ndbTcqqvH3rcUpcuPISyy7t255N OSgE5KUHC2VGzSU=; b=PCpB71MxcShoPNKJkCI0U0Mp+iWb0vgbJj9v8/AZ3N7I lXg8mJEIMJMQCi6s2ojc6b7R65oLTvYUg1m4dlIWlW8FD9bSp3JS01v893va4H0J +QB0JkRPMCkbVrGl9A5EYbaORZlUU3zJZTVYzkn6zXNlmrXYdDY0pTGmkkEYcaft OUPpxu6kppVPEWSLCTVUrgVYyXRjbPta31YMOF5P645RWXwWEAssU7WI8eldhDvk hbpgoxsX0BqgjKR9iB5zWW+R8ZJJI2xiNSn0BUkB+ZSay/4rjsFoZYe5EWRNWUHA iCJnvLPMo7CfPQ7Ka7FdGmJAcQR6zUjry5I7LzrIXA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrtddugddujecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdpuffr tefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnth hsucdlqddutddtmdenucfjughrpefvvefkhffuffestddtredttddttdenucfhrhhomhep hfhinhhnucfvhhgrihhnuceofhhthhgrihhnsehlihhnuhigqdhmieekkhdrohhrgheqne cuggftrfgrthhtvghrnhepheffgfegfeevgeevtdeiffefveeutdeghfeuheeiteffjeef gfegveefuedvudelnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilh hfrhhomhepfhhthhgrihhnsehlihhnuhigqdhmieekkhdrohhrghdpnhgspghrtghpthht ohephedpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepghgvvghrtheslhhinhhugi dqmheikehkrdhorhhgpdhrtghpthhtohepuggrnhhivghlsedtgidtfhdrtghomhdprhgt phhtthhopehsthgrsghlvgeskhgvrhhnvghlrdhorhhgpdhrtghpthhtoheplhhinhhugi dqmheikehksehlihhsthhsrdhlihhnuhigqdhmieekkhdrohhrghdprhgtphhtthhopehl ihhnuhigqdhkvghrnhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrgh X-ME-Proxy: Feedback-ID: i58a146ae:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 5 Nov 2024 18:58:15 -0500 (EST) To: Geert Uytterhoeven Cc: Daniel Palmer , stable@kernel.org, linux-m68k@lists.linux-m68k.org, linux-kernel@vger.kernel.org Message-ID: From: Finn Thain Subject: [PATCH] m68k: mvme147: Reinstate early console Date: Wed, 06 Nov 2024 10:51:24 +1100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Daniel Palmer Commit a38eaa07a0ce ("m68k/mvme147: config.c - Remove unused functions"), removed the console functionality for the mvme147 instead of wiring it up to an early console. Put the console write function back and wire it up like mvme16x does so it's possible to see Linux boot on this fine hardware once more. Cc: Daniel Palmer Cc: stable@kernel.org Fixes: a38eaa07a0ce ("m68k/mvme147: config.c - Remove unused functions") Signed-off-by: Daniel Palmer Co-developed-by: Finn Thain Signed-off-by: Finn Thain Reviewed-by: Geert Uytterhoeven --- Changed since previous submission: - Added co-developed-by and reviewed-by tags. - Use a static scc_delay() function instead of a macro. This revision produces the same object code as the previous one. Hence it doesn't need further testing. --- arch/m68k/kernel/early_printk.c | 3 +++ arch/m68k/mvme147/config.c | 30 ++++++++++++++++++++++++++++++ arch/m68k/mvme147/mvme147.h | 6 ++++++ 3 files changed, 39 insertions(+) create mode 100644 arch/m68k/mvme147/mvme147.h diff --git a/arch/m68k/kernel/early_printk.c b/arch/m68k/kernel/early_print= k.c index 3cc944df04f6..d9399be89ad3 100644 --- a/arch/m68k/kernel/early_printk.c +++ b/arch/m68k/kernel/early_printk.c @@ -14,6 +14,7 @@ =20 =20 #include "../mvme16x/mvme16x.h" +#include "../mvme147/mvme147.h" =20 asmlinkage void __init debug_cons_nputs(const char *s, unsigned n); =20 @@ -24,6 +25,8 @@ static void __ref debug_cons_write(struct console *c, defined(CONFIG_COLDFIRE)) if (MACH_IS_MVME16x) mvme16x_cons_write(c, s, n); + else if (MACH_IS_MVME147) + mvme147_scc_write(c, s, n); else debug_cons_nputs(s, n); #endif diff --git a/arch/m68k/mvme147/config.c b/arch/m68k/mvme147/config.c index 8b5dc07f0811..cc2fb0a83cf0 100644 --- a/arch/m68k/mvme147/config.c +++ b/arch/m68k/mvme147/config.c @@ -32,6 +32,7 @@ #include #include =20 +#include "mvme147.h" =20 static void mvme147_get_model(char *model); extern void mvme147_sched_init(void); @@ -185,3 +186,32 @@ int mvme147_hwclk(int op, struct rtc_time *t) } return 0; } + +static void scc_delay(void) +{ + __asm__ __volatile__ ("nop; nop;"); +} + +static void scc_write(char ch) +{ + do { + scc_delay(); + } while (!(in_8(M147_SCC_A_ADDR) & BIT(2))); + scc_delay(); + out_8(M147_SCC_A_ADDR, 8); + scc_delay(); + out_8(M147_SCC_A_ADDR, ch); +} + +void mvme147_scc_write(struct console *co, const char *str, unsigned int c= ount) +{ + unsigned long flags; + + local_irq_save(flags); + while (count--) { + if (*str =3D=3D '\n') + scc_write('\r'); + scc_write(*str++); + } + local_irq_restore(flags); +} diff --git a/arch/m68k/mvme147/mvme147.h b/arch/m68k/mvme147/mvme147.h new file mode 100644 index 000000000000..140bc98b0102 --- /dev/null +++ b/arch/m68k/mvme147/mvme147.h @@ -0,0 +1,6 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +struct console; + +/* config.c */ +void mvme147_scc_write(struct console *co, const char *str, unsigned int c= ount); --=20 2.44.2