From patchwork Tue Jul 25 14:58:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 706145 Delivered-To: patch@linaro.org Received: by 2002:a5d:464f:0:b0:317:2194:b2bc with SMTP id j15csp232168wrs; Tue, 25 Jul 2023 07:59:01 -0700 (PDT) X-Google-Smtp-Source: APBJJlG+uIl8cFK7uD5YFaiEZjW1aHhSXemzVzTLtkFH3RX3gCniTF39Rfuqtq8RzVijP7QDjIcO X-Received: by 2002:a05:622a:1447:b0:406:9532:55ab with SMTP id v7-20020a05622a144700b00406953255abmr3093173qtx.42.1690297141501; Tue, 25 Jul 2023 07:59:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690297141; cv=none; d=google.com; s=arc-20160816; b=L78d1FJKBttDMWZBv5Ev1JxD+ZOP0iSJ5y3AuXpK51+1WwIVOV3DPmHb+7gK9anNHn uEHXrmfBB99yt/wXLPjJ8gqWYSnrh0wisNsZfQshH3UXVxDGs5bZOPl6196y/1htgyv9 5TTJ4Z0G7kKkfGcoYzqxB0n3Aq0ECKc6DrxhWqsO3sOU79PCYIwaQyleNcc9YaaZvQS0 wW5sIyvfsBD7JlGZSmiRlj7tdeMQuur0dshS5wI56ngQLwf/hWbPER15qrSGuL5i9jnI F11gIyzxQapSaTWNnrpsyRDUFz8SULzjbfs12nPMnNe9Zuq9DaM5lTyNguDnpO4tSv+s io0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=s4i7zxWBFbwawN5hoH2WbNEPh79dMjPmIuyC9TUA1JY=; fh=Xi7/snscDoB0Hr+3dWviD7jG1jzi7qlbQpNfWsDXgHM=; b=c7XdS4xVw0rzq1ciJ17ouO1AFbZ+0M3Bg2VP4aZdI/+Nfi6P9ghH1ARJuKmTmoBHRm uMCGUTqWjRCl3NboJChDC3poc2P63QFniloqAjFORPSmQfOhnRWgC6sk3qBYNdLzB6M2 hB7LjxAl0TQ9smDYdEFUa6Vk+HJvaHPxY6bsjJ4ZzEn42j6XgZ5D0KBWm7nEEOCUgRRs FyAmyFyDi3tn9Xi2W0C1frNM03EP5EsB317wowGH2DglPkjqhRo/vtP+i5m0vgcbp+T+ D4F9qVenSZDWi1APZsrF4DEHANjvjDW6Oa8YEwnvBkTDHJtm5M5L3t5z/r68M21bDUXy VBnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WiQqv8hJ; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id y6-20020a05622a164600b0040546ea0f80si6384920qtj.367.2023.07.25.07.59.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 25 Jul 2023 07:59:01 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WiQqv8hJ; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qOJV0-0002Ot-Sx; Tue, 25 Jul 2023 10:58:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qOJUz-0002Ns-3U for qemu-devel@nongnu.org; Tue, 25 Jul 2023 10:58:53 -0400 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qOJUw-00018A-Ni for qemu-devel@nongnu.org; Tue, 25 Jul 2023 10:58:51 -0400 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-3fbc63c2e84so56767785e9.3 for ; Tue, 25 Jul 2023 07:58:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1690297129; x=1690901929; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=s4i7zxWBFbwawN5hoH2WbNEPh79dMjPmIuyC9TUA1JY=; b=WiQqv8hJyi5mTdrFxdItBf6EP6yakFcGpCeLGwfToTsBSqIgfXkN9CUv172FDVUpD5 WIbcnuX6x4kuC3kRzBU/US8d6zPVwprnsopR6xJBSxV/B4Z0f/vZGC+iIfuc2N8En/ME vvy2srS1dmLwM7jrEqUc8aOxk5pfLlro+owIvwq9bAvQSn5JlTE+5JMSB9Je5aZwregr O0s3z2lCp/Rru+niPG1dI/LMxp1o0tMFVyGHd0qfE4ARjEi3Aa+OCo8n6Fk/8NdW3hTe x4K2DWHKbEfOAZcUwZo8YWtd9VDL66ZQ5tgl0AGp9ywqBQPwd+dsuZ4zC0qVwng3JlEN eYng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690297129; x=1690901929; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=s4i7zxWBFbwawN5hoH2WbNEPh79dMjPmIuyC9TUA1JY=; b=RPqkfQm1Q726tMPSll7brhNhlRbpkaMwdhp6O21JqmzwXk186GAOWuPa0BO18uBTJ6 2sg7/pFjxuukTGvIoYZRfTLBJprdR61wMc61XLXyXNQLhevFuXN1BSMdLXvR063i+3rb +zFqQXveKL1sPeeJiNGuHggWQ0JqROpnpRWUIuOH2XNH+QywU5zSuJ6P9C6ZYptn133a dsETte1AtRzCXUS88usl7a03++RH4u/tFH7iifsPl2vPiIx2LndLMru0TnDqFwbiyNGe 19W9k6RKAJIQ9DZOR8Z+A6eQQVWmDI137JtxFkAexWx197zMgdTHiZg2BMSLc3bHOAVs fQEw== X-Gm-Message-State: ABy/qLYMV7dzsLL4Gdiu97hiuRlbDtZxg9XiusMwcPsWKDcIAPTbTHy6 WQ7x2fOJ2bnv2B9MHy8t/+2I4Vimn9Z7J1VXMPM= X-Received: by 2002:adf:f092:0:b0:317:5ece:e16a with SMTP id n18-20020adff092000000b003175ecee16amr4969070wro.50.1690297129252; Tue, 25 Jul 2023 07:58:49 -0700 (PDT) Received: from localhost.localdomain ([176.187.203.142]) by smtp.gmail.com with ESMTPSA id d1-20020a5d6441000000b00317643a93f4sm5219042wrw.96.2023.07.25.07.58.48 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 25 Jul 2023 07:58:48 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland , Artyom Tarasenko , Bastian Koppelmann , qemu-block@nongnu.org, Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 03/10] hw/char/escc: Implement loopback mode Date: Tue, 25 Jul 2023 16:58:22 +0200 Message-Id: <20230725145829.37782-4-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230725145829.37782-1-philmd@linaro.org> References: <20230725145829.37782-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=philmd@linaro.org; helo=mail-wm1-x336.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Thomas Huth The firmware of the m68k next-cube machine uses the loopback mode for self-testing the hardware and currently fails during this step. By implementing the loopback mode, we can make the firmware pass to the next step. Signed-off-by: Thomas Huth Reviewed-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20230716153519.31722-1-huth@tuxfamily.org> --- hw/char/escc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/char/escc.c b/hw/char/escc.c index 4f3872bfe9..4be66053c1 100644 --- a/hw/char/escc.c +++ b/hw/char/escc.c @@ -653,7 +653,9 @@ static void escc_mem_write(void *opaque, hwaddr addr, escc_update_irq(s); s->tx = val; if (s->wregs[W_TXCTRL2] & TXCTRL2_TXEN) { /* tx enabled */ - if (qemu_chr_fe_backend_connected(&s->chr)) { + if (s->wregs[W_MISC2] & MISC2_LCL_LOOP) { + serial_receive_byte(s, s->tx); + } else if (qemu_chr_fe_backend_connected(&s->chr)) { /* * XXX this blocks entire thread. Rewrite to use * qemu_chr_fe_write and background I/O callbacks