From patchwork Wed Jan 4 22:04:40 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: 639049 Delivered-To: patch@linaro.org Received: by 2002:a17:522:f3c4:b0:4b4:3859:abed with SMTP id in4csp1971533pvb; Wed, 4 Jan 2023 14:38:07 -0800 (PST) X-Google-Smtp-Source: AMrXdXuQpn5srGMoQGTU62HIAhCPmwmrB5bcl/90SYp+b8rvur2lDdslFm3clP0zEc7Wusxx4bg8 X-Received: by 2002:a05:6214:5f8a:b0:4c7:1d2c:bd93 with SMTP id ls10-20020a0562145f8a00b004c71d2cbd93mr25170736qvb.47.1672871887193; Wed, 04 Jan 2023 14:38:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672871887; cv=none; d=google.com; s=arc-20160816; b=RPGFHVbNM0IlwUIbGYrjLKdwo34KaTXnLhxcIjpBewMlD/+IxJZaZqK+CNLWQZSD8d VGbhKnXyaSxQLokh/ZF6l48mfi0oNrq5K8sr04y3PqD0vI/4OMryNK7Y7y5T8QSeB69t IgNd7THrZzuO5Aj7imrdj9aw3qv/CMwUbKd7Asib60Ry/844jFVV2eWcDB4hZ0kTS4vE S2Wn+OWx6f46HDQyeH+29L35f/j7+4PEDpaLb4sPmOlErSNcepwgwZtabljJ+d5lc/Jb I/T+BKRaENfR+l76weHIsXnOP7e3vL7u0IlmHjG+XkhKhi9ELt/rk3xBBVIS/CZlSGAI 0Vng== 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=eRH2/Q6+taaY1C0mf1jUv5OrxulMB7iM/Sfo6HL2IVQ=; b=v5zMZSI8diSCEAMb3zH5PbT8ofd3ZdkYxxy87Jve5UGdd5N+s5L1N6TYRfMkI6h0QN w/bPubuD7Wfq6+ZJYgJo/k7bUlrd85bRfcLzpVhsHsycwcvp9OXypipdbgJU+krmCGtg 04InosMgpJqblRi+zfK+SdqgY1hCpEmsRNjn2bYxXZNv3ghsKCan1IkaQjhgld3ehNQ8 4ISojOIdqQI87nMRD/7RAef8nIkFcpPh2taN/JQtMfUaBVabIBBz0H+93Db9jdEV5HtH LAlnQ6rnyEaLjTal8GE2z+muSq967aUMV2Y/m6dkRa+pl3k1FrPD1z5l21sXP8nTNgnk mxHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nEDbMFtY; 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 fq12-20020a056214258c00b00531cc20a3b6si5710762qvb.502.2023.01.04.14.38.07 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 04 Jan 2023 14:38:07 -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=nEDbMFtY; 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 1pDBu6-0001J5-4m; Wed, 04 Jan 2023 17:06:34 -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 1pDBu4-0001FL-AR for qemu-devel@nongnu.org; Wed, 04 Jan 2023 17:06:32 -0500 Received: from mail-ej1-x62d.google.com ([2a00:1450:4864:20::62d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pDBtz-0005cY-Du for qemu-devel@nongnu.org; Wed, 04 Jan 2023 17:06:29 -0500 Received: by mail-ej1-x62d.google.com with SMTP id tz12so85983103ejc.9 for ; Wed, 04 Jan 2023 14:06:26 -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=eRH2/Q6+taaY1C0mf1jUv5OrxulMB7iM/Sfo6HL2IVQ=; b=nEDbMFtYiuO1tEPpkdBXhy5oQT831LiUY2iJK+y3FXzANhPxIRXugZteugbGJtczIU wxk9hW2bT12/v8IrT5Z65Xkhd+ABeve3HRZ6aQeaw++II7ljORjep1OVHv6bURhYyF6U 2ljIr4BXQitZtVzV2B6tgLnF+lIAB1yCgrbobDTMZRoWQhDu1muauHwZg3ZVnMr78rAd t+GJa9IMINib8sQFgtLZBscBE/cKQxRSq5/+pueGDxdF8P8qIDcq3NZtYGgMJeqUzQbr QrThF7plmTpACKFaVtYnIhTP06J/IbOkPLPzOkG35qCT27eMLrHgoadrp6Vm0jFjKFx+ 2CMQ== 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=eRH2/Q6+taaY1C0mf1jUv5OrxulMB7iM/Sfo6HL2IVQ=; b=GW5CrhhkN3SzxhP/jppvc7+B71VAdTXvkOKIY2BpC7tr2yLtZBW5FKH/PwKpPRog5E psSH0jsVThOJGoU11g3nvnQ+9T5a0Q6rd+CYm8MioSRWs9K/4Ju+2lQNh6A7EJQga8du m+a57j3kOQUB9bOPr2bpTTu4Qj/TjwV6AphFMeyNZJJNddFq6cQigV6FncBRpe2K1F12 kbRYYfXtBEFwiAdwOQpRFTwVgq8YxkA0/ngNBc0nWLt+C2Y1PWjjyV4VpAEssd0GwRt6 6eeworWIRfNGngi414oMdQeggHL68Q+LqSwrWO1sN7N+Jr97kSpnAvPiJQU0/cUTAEMu Vylw== X-Gm-Message-State: AFqh2ko5cirxU1cKvPEUYk1JulZYLc1u+caMvlAKXurXaun7iMMm6gVk ufUHo7yJd0unYCQ5ZEQys2pgzS/UD5Oss4HY X-Received: by 2002:a17:907:3f9d:b0:7c1:1c4:5eaf with SMTP id hr29-20020a1709073f9d00b007c101c45eafmr60776998ejc.49.1672869986450; Wed, 04 Jan 2023 14:06:26 -0800 (PST) Received: from localhost.localdomain ([185.126.107.38]) by smtp.gmail.com with ESMTPSA id 10-20020a170906218a00b0073d796a1043sm15640103eju.123.2023.01.04.14.06.23 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 04 Jan 2023 14:06:26 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Song Gao , Antony Pavlov , Jan Kiszka , Marcel Apfelbaum , Hanna Reitz , Bernhard Beschow , BALATON Zoltan , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Alistair Francis , Paolo Bonzini , qemu-ppc@nongnu.org, Mark Burton , Richard Henderson , Magnus Damm , "Michael S. Tsirkin" , Bin Meng , Max Filippov , Aurelien Jarno , Eduardo Habkost , Palmer Dabbelt , Radoslaw Biernacki , Jiaxun Yang , "Edgar E. Iglesias" , Xiaojuan Yang , Peter Maydell , qemu-block@nongnu.org, qemu-riscv@nongnu.org, Yoshinori Sato , Alistair Francis , qemu-arm@nongnu.org, Leif Lindholm , Kevin Wolf Subject: [PATCH 11/20] hw/microblaze: Open-code pflash_cfi01_register() Date: Wed, 4 Jan 2023 23:04:40 +0100 Message-Id: <20230104220449.41337-12-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230104220449.41337-1-philmd@linaro.org> References: <20230104220449.41337-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62d; envelope-from=philmd@linaro.org; helo=mail-ej1-x62d.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 pflash_cfi01_register() hides an implicit sysbus mapping of MMIO region #0. This is not practical in a heterogeneous world where multiple cores use different address spaces. In order to remove to remove pflash_cfi01_register() from the pflash API, open-code it as a qdev creation call followed by an explicit sysbus mapping. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Bin Meng --- hw/microblaze/petalogix_ml605_mmu.c | 8 ++++---- hw/microblaze/petalogix_s3adsp1800_mmu.c | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/hw/microblaze/petalogix_ml605_mmu.c b/hw/microblaze/petalogix_ml605_mmu.c index a24fadddca..d5ff71218d 100644 --- a/hw/microblaze/petalogix_ml605_mmu.c +++ b/hw/microblaze/petalogix_ml605_mmu.c @@ -105,10 +105,10 @@ petalogix_ml605_init(MachineState *machine) dinfo = drive_get(IF_PFLASH, 0, 0); /* 5th parameter 2 means bank-width * 10th paremeter 0 means little-endian */ - pflash_cfi01_register(FLASH_BASEADDR, "petalogix_ml605.flash", FLASH_SIZE, - dinfo ? blk_by_legacy_dinfo(dinfo) : NULL, - 64 * KiB, 2, 0x89, 0x18, 0x0000, 0x0, 0); - + dev = pflash_cfi01_create("petalogix_ml605.flash", FLASH_SIZE, + dinfo ? blk_by_legacy_dinfo(dinfo) : NULL, + 64 * KiB, 2, 0x89, 0x18, 0x0000, 0x0, 0); + sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, FLASH_BASEADDR); dev = qdev_new("xlnx.xps-intc"); qdev_prop_set_uint32(dev, "kind-of-intr", 1 << TIMER_IRQ); diff --git a/hw/microblaze/petalogix_s3adsp1800_mmu.c b/hw/microblaze/petalogix_s3adsp1800_mmu.c index 9d959d1ad8..426ff1de93 100644 --- a/hw/microblaze/petalogix_s3adsp1800_mmu.c +++ b/hw/microblaze/petalogix_s3adsp1800_mmu.c @@ -84,10 +84,10 @@ petalogix_s3adsp1800_init(MachineState *machine) memory_region_add_subregion(sysmem, ddr_base, phys_ram); dinfo = drive_get(IF_PFLASH, 0, 0); - pflash_cfi01_register(FLASH_BASEADDR, - "petalogix_s3adsp1800.flash", FLASH_SIZE, - dinfo ? blk_by_legacy_dinfo(dinfo) : NULL, - 64 * KiB, 1, 0x89, 0x18, 0x0000, 0x0, 1); + dev = pflash_cfi01_create("petalogix_s3adsp1800.flash", FLASH_SIZE, + dinfo ? blk_by_legacy_dinfo(dinfo) : NULL, + 64 * KiB, 1, 0x89, 0x18, 0x0000, 0x0, 1); + sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, FLASH_BASEADDR); dev = qdev_new("xlnx.xps-intc"); qdev_prop_set_uint32(dev, "kind-of-intr",