From nobody Mon Feb 9 20:32:54 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1635799731148158.99866103806107; Mon, 1 Nov 2021 13:48:51 -0700 (PDT) Received: from localhost ([::1]:51944 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mheEc-0001Sk-83 for importer@patchew.org; Mon, 01 Nov 2021 16:48:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53886) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mhdxS-0002m7-Vl for qemu-devel@nongnu.org; Mon, 01 Nov 2021 16:31:07 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:43488 helo=mail.default.ilande.bv.iomart.io) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mhdxO-0002mX-5A for qemu-devel@nongnu.org; Mon, 01 Nov 2021 16:31:06 -0400 Received: from [2a00:23c4:8b9d:f500:9396:df17:737c:b32c] (helo=kentang.home) by mail.default.ilande.bv.iomart.io with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mhdwz-00030v-IL; Mon, 01 Nov 2021 20:30:41 +0000 From: Mark Cave-Ayland To: qemu-devel@nongnu.org, peter.maydell@linaro.org Date: Mon, 1 Nov 2021 20:30:49 +0000 Message-Id: <20211101203049.28925-1-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8b9d:f500:9396:df17:737c:b32c X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH] escc: update transmit status bits when switching to async mode X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.default.ilande.bv.iomart.io) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.default.ilande.bv.iomart.io X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1635799732182100001 Content-Type: text/plain; charset="utf-8" The recent ESCC reset changes cause a regression when attemping to use a re= al SS-5 Sun PROM instead of OpenBIOS. The Sun PROM doesn't send an explicit re= set command to the ESCC but gets stuck in a loop probing the keyboard waiting f= or STATUS_TXEMPTY to be set in R_STATUS followed by SPEC_ALLSENT in R_SPEC. Reading through the ESCC datasheet again indicates that SPEC_ALLSENT is upd= ated when a write to W_TXCTRL1 selects async mode, or remains high if sync mode = is selected. Whilst there is no explicit mention of STATUS_TXEMPTY, the ESCC d= evice emulation always updates these two register bits together when transmitting= data. Add extra logic to update both transmit status bits accordingly when writin= g to W_TXCTRL1 which enables the Sun PROM to initialise and boot again under QEM= U. Signed-off-by: Mark Cave-Ayland --- hw/char/escc.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/hw/char/escc.c b/hw/char/escc.c index 0fce4f6324..b33cdc229f 100644 --- a/hw/char/escc.c +++ b/hw/char/escc.c @@ -575,6 +575,18 @@ static void escc_mem_write(void *opaque, hwaddr addr, s->wregs[s->reg] =3D val; break; case W_TXCTRL1: + s->wregs[s->reg] =3D val; + if (val & TXCTRL1_STPMSK) { + ESCCSERIOQueue *q =3D &s->queue; + if (s->type =3D=3D escc_serial || q->count =3D=3D 0) { + s->rregs[R_STATUS] |=3D STATUS_TXEMPTY; + s->rregs[R_SPEC] |=3D SPEC_ALLSENT; + } + } else { + s->rregs[R_STATUS] &=3D ~STATUS_TXEMPTY; + s->rregs[R_SPEC] |=3D SPEC_ALLSENT; + } + /* fallthrough */ case W_TXCTRL2: s->wregs[s->reg] =3D val; escc_update_parameters(s); --=20 2.20.1