From patchwork Mon Feb 20 11:51:09 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: 655077 Delivered-To: patch@linaro.org Received: by 2002:adf:9bcd:0:0:0:0:0 with SMTP id e13csp1349193wrc; Mon, 20 Feb 2023 03:52:34 -0800 (PST) X-Google-Smtp-Source: AK7set8A/IRli1kqnI/pC+b8swolhDcOTL5if0okSFwXGZLrWMmGASx4EjbtkrKbkLmGCY31xPRH X-Received: by 2002:a05:622a:3cc:b0:3bd:140c:91ed with SMTP id k12-20020a05622a03cc00b003bd140c91edmr40669qtx.52.1676893953993; Mon, 20 Feb 2023 03:52:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676893953; cv=none; d=google.com; s=arc-20160816; b=KHqm7J4MY3SeGI5Jj72CR27aglSd20l+vD76jjveUHOb4c4MOMhL8sKmkdZii3Nd77 PMyfBeC/iByiaehuOH9PU9sz9wDx15R5jBS1iSLrBGX7NRIlplY9KfeJTAPMpYuHIGCd Z1M0EJjRtEejqUXhmp7DB3NSAfb6ODTo9J/sPH9OZJtBGz8FtGJzSAp8Pe+I2cgO4Wn2 Kd0daFanrfz4ghy230x1lTovymF84aBrmdDdFXZ5IORhsD38UQw/tPTtB8rXCbOHr7dx G6iVK6hAAQZOHyFl7yl8L4myIkRIR85JYV1o6JRwylCePxk1OFOIXlDDVUktYVNH6SfZ 9uuA== 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=wg6knbur2mmJV8L9g7D6SKJ7/ERhPsRC33COYh3Bljw=; b=YCbUOoNktG6wKRXOB3MPkxyPkH7cYVT2mtVqgTdeFNMxbqU7DFDvwMm2J035bH07VG UUFkeVauLOLRN8A7/p9gBDRyjvKDTS3WZX6Hf5+YllRxKmawGxmeKCF56xng2bSNwsIX 7mHOqxLyNJLzzoI8wdJAGPpOFsMSXi6lFzFCOskU+5m2V0QseyABOBLFgKcjkgjspGJb Ykn8G3GF9BRQ7jcVKTrJgv5qIaWOuqNrOOgwmoPb9vT1bV5erVgM8KoFlRXD1y5tvbND f0l6p0WZUlqlB/QXIuBUbV6SwYj4myLcQ924/EO2xSczNUr7BY3NtQvjYUfEoqQkV6mN lnrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VDZ000fo; 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 bn4-20020a05620a2ac400b0073b2dc1946asi9105940qkb.685.2023.02.20.03.52.33 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 20 Feb 2023 03:52:33 -0800 (PST) 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=VDZ000fo; 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 1pU4hj-0001jB-Tu; Mon, 20 Feb 2023 06:51:35 -0500 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 1pU4hi-0001i9-Ud for qemu-devel@nongnu.org; Mon, 20 Feb 2023 06:51:34 -0500 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pU4hh-00056R-EU for qemu-devel@nongnu.org; Mon, 20 Feb 2023 06:51:34 -0500 Received: by mail-wm1-x330.google.com with SMTP id az11-20020a05600c600b00b003dc4fd6e61dso812046wmb.5 for ; Mon, 20 Feb 2023 03:51:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=wg6knbur2mmJV8L9g7D6SKJ7/ERhPsRC33COYh3Bljw=; b=VDZ000fopMnMKslEBLL9pEqrmVFf6Xs+q7tczg18RLnpAu5FoBKA0uFfeC37vrT2jg SN2ndwkQHgN/DevtloSzAbEot55W2BfIBGZCthMfcJTNzuOfxJSOQECx8gNwhG0ijIDp Rf6mvFysejO1GmNcFGdhh2UPPxKJ5sCOLdixtObDrSk44krnxezNyqwgDnd0g+YKUD10 K1PQBKDMbx6l1y/WMM4/Ux6YgtbfClWWKL9H7RaP610wjjUDFLI9W0NAIvB43cdBhHju Pkmcnmhxmp4Te5xh/0Fn6TmWRWIJWSqoNnvhJn4GPcmYpJYMZo9z4hIvRHzmIwygacUN i1ow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=wg6knbur2mmJV8L9g7D6SKJ7/ERhPsRC33COYh3Bljw=; b=1kG/Wr3BX8vfLmyRloglVCih50Yk87VhbWIa5amzsWfInmxmehUCcD6AuCUe8PMI1S B84l7dwAp5mKXP5Helr1jEZKLAGUgOsrSgCiHVJZHbk4RxbLFCzRsDjLyeQA+M6S3ICa /oV1J3DD+b8Wz6q0QwZk2hxpNGgOce1G8GXe7GPYzfbU7xKZQtMwK7ku7c4lMLD4qjTU AEBF0AlNhcftFtdb061T/qpXs7ZPugoO+n816MF0QduN3gtMBqPjo88o12C9bwpr6x1K FZFK5HBmwp3Y/bUvNmfPzGvIReOpC0XxtFjc1xeUuAbngmzcZ61983fLlaOxRrLoLm8H gVFQ== X-Gm-Message-State: AO0yUKWVGLKTv2oEpB6Z/DpiSa+DLn/DUhs37b1sjXvyO3shuIZSJQaC 7hVvHbikk7goaRfw+S/Ptn5qFwQtIa/AFBzU X-Received: by 2002:a05:600c:1895:b0:3e2:589:2512 with SMTP id x21-20020a05600c189500b003e205892512mr780466wmp.21.1676893891694; Mon, 20 Feb 2023 03:51:31 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id x8-20020a1c7c08000000b003dc4480df80sm89905wmc.34.2023.02.20.03.51.30 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 20 Feb 2023 03:51:31 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, Peter Maydell , Markus Armbruster , Paolo Bonzini , Alistair Francis , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , "Edgar E. Iglesias" , =?utf-8?q?Philippe_Mathieu-?= =?utf-8?q?Daud=C3=A9?= Subject: [PATCH 3/8] hw/char/pl011: Open-code pl011_luminary_create() Date: Mon, 20 Feb 2023 12:51:09 +0100 Message-Id: <20230220115114.25237-4-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230220115114.25237-1-philmd@linaro.org> References: <20230220115114.25237-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::330; envelope-from=philmd@linaro.org; helo=mail-wm1-x330.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 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 pl011_luminary_create() is only used for the Stellaris board, open-code it. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Alex Bennée Reviewed-by: Richard Henderson --- hw/arm/stellaris.c | 11 ++++++++--- include/hw/char/pl011.h | 17 ----------------- 2 files changed, 8 insertions(+), 20 deletions(-) diff --git a/hw/arm/stellaris.c b/hw/arm/stellaris.c index 67a2293d35..f7e99baf62 100644 --- a/hw/arm/stellaris.c +++ b/hw/arm/stellaris.c @@ -1146,9 +1146,14 @@ static void stellaris_init(MachineState *ms, stellaris_board_info *board) for (i = 0; i < 4; i++) { if (board->dc2 & (1 << i)) { - pl011_luminary_create(0x4000c000 + i * 0x1000, - qdev_get_gpio_in(nvic, uart_irq[i]), - serial_hd(i)); + SysBusDevice *sbd; + + dev = qdev_new("pl011_luminary"); + sbd = SYS_BUS_DEVICE(dev); + qdev_prop_set_chr(dev, "chardev", serial_hd(i)); + sysbus_realize_and_unref(sbd, &error_fatal); + sysbus_mmio_map(sbd, 0, 0x4000c000 + i * 0x1000); + sysbus_connect_irq(sbd, 0, qdev_get_gpio_in(nvic, uart_irq[i])); } } if (board->dc2 & (1 << 4)) { diff --git a/include/hw/char/pl011.h b/include/hw/char/pl011.h index d82870c006..d853802132 100644 --- a/include/hw/char/pl011.h +++ b/include/hw/char/pl011.h @@ -57,21 +57,4 @@ struct PL011State { DeviceState *pl011_create(hwaddr addr, qemu_irq irq, Chardev *chr); -static inline DeviceState *pl011_luminary_create(hwaddr addr, - qemu_irq irq, - Chardev *chr) -{ - DeviceState *dev; - SysBusDevice *s; - - dev = qdev_new("pl011_luminary"); - s = SYS_BUS_DEVICE(dev); - qdev_prop_set_chr(dev, "chardev", chr); - sysbus_realize_and_unref(s, &error_fatal); - sysbus_mmio_map(s, 0, addr); - sysbus_connect_irq(s, 0, irq); - - return dev; -} - #endif