From patchwork Sun Dec 11 20:45:29 2022 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: 633107 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp2106586pvb; Sun, 11 Dec 2022 12:52:05 -0800 (PST) X-Google-Smtp-Source: AA0mqf4kmII5mVprvu59pcbsUmnfgRJ+AyMHvD+/TQdy/bjkVi4a4TnVhorTMzmAo/K3zcFwMTvh X-Received: by 2002:a05:622a:5987:b0:3a7:f7c1:5b65 with SMTP id gb7-20020a05622a598700b003a7f7c15b65mr22283163qtb.40.1670791925430; Sun, 11 Dec 2022 12:52:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670791925; cv=none; d=google.com; s=arc-20160816; b=nqo/BTvNxb/UlH7rgJNccnslOTkdG1OW0FNV/9I8O1lLtYU3MqROmI9xD4zLTJlfoP KObPQmPhG/vdKnW133FGUkHSWvUZm+8kQq8DyRptLI8DwGCvp1oK/ODgdeMJ/wvf8p+D IhS4iKaxIBMeRRkCN8FIbrwBxwZ9gqtaGyhmXCQfIbWv/F70BTOFGbK2iQ3H+kjKVBly j9pv4diHIFcGWNEmWY1kkCfa/oGb9vYhqTjk4oX+ls1+k2kVuGBvbA705O7qkbNG86+T zwd3MtqQJ+yPdOd4Ac6YqZIiY1QUCz9hbxwExH4AXvUNltorXO1f83GP9Sl5EfcsX+n3 hFwg== 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=vOKkbdF2wzJddWGZH9AQVNLA5ppkIMO9XidfsUUqFe0=; b=VKZyUHCdzRz5uPy+8fU+zzG6vDH4BnCG6tE2erQE1qnhzMwY7QuOaZptKtwCxJ8um1 yWS8AwuG2oszlCrijW24p08k9ZSGapTDJdBmsse5+a+L74YUzO+tD7qM+Mk0EvsiIVDZ r4v8GpvcTpv0GXs/4IPbkTA6bnAFPm6YOLxybidSr9++mQCm2IiLZi3cox1YeFU4NpsY kWhs6q3cj6uYLB0Op+/zPBpcJ5xIzLUr4QRBT1jEpigURvtQlExVZ15OcB6M3knu05GC Tb4Zg6ftc/aS0LducTWS1m4aM8VlugdLe2X4qOBsnXSiOa8b6qUOJx5f6b6ooLKmK9NH C9OQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="W0QUG/+R"; 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 t6-20020ac87606000000b0038c17e556ccsi4222401qtq.394.2022.12.11.12.52.05 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 11 Dec 2022 12:52:05 -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="W0QUG/+R"; 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 1p4TDK-0005Gx-2t; Sun, 11 Dec 2022 15:46:22 -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 1p4TDH-0005Go-QP for qemu-devel@nongnu.org; Sun, 11 Dec 2022 15:46:20 -0500 Received: from mail-ej1-x634.google.com ([2a00:1450:4864:20::634]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p4TDG-0003TE-9N for qemu-devel@nongnu.org; Sun, 11 Dec 2022 15:46:19 -0500 Received: by mail-ej1-x634.google.com with SMTP id tz12so644880ejc.9 for ; Sun, 11 Dec 2022 12:46:17 -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=vOKkbdF2wzJddWGZH9AQVNLA5ppkIMO9XidfsUUqFe0=; b=W0QUG/+RIA47c9sJHUpKHf1fH9Y8SfZg9zCe7wQvwc7DCiKbwaFznJlYlxcWjL2Cd5 ZF8YM0Yv8ZVtZBN8g/BMigHMuLb/vMCVxG6JXlo5VpfQ2wMbAMNQJXAxTtOLhqh4koze yqrClRol7w0/Fbe3SF/vCUjWt5dHGPUpheQjWwSBWfiCbyr3ORT4/OPRYAM1iAuQU8dY AK4H2yjYNxpiChJMajXkXA/vWWe/BWBNSLuFDPkwHIw37Ve4LdJLrUaGTvfA9PD5+4p9 XxtNXNVa38Tjqi/hooa5I4orJDR2OzkY0cngRlazLeQRoSb7U7nY+xhOLcRZRQMgjINw N1lA== 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=vOKkbdF2wzJddWGZH9AQVNLA5ppkIMO9XidfsUUqFe0=; b=BDFKKK3Sl5CUusbJe+p37Bi7mHO47HaxTI+pc6KWi2kheakCFspL4Yfvib4VXIlwo1 CciEXNR6X5VU5cQrPmVCYwz9MMEgqXiV8vekw0xl67+RkBahhccevkYwKfAbg9uf4hKn wpG3ZzsUzm2IWRGyGyRxsGKeomo/Cg83pK5+H9z1YwyDeEoNrHhR0zCOY6FOrAdP3BIi m5TixHUrhptvyGEa1RSFK++WV+nNgcM+C/EBk639NARo/0lJXS8ShAaR8Nf3b61MfDcR mcC0SShNRukREJOex/Vvr73PRb+AW1eGJ4KYkk+Gk3aZ00UW59fvgXyTeYnPAbk02qmu kAYw== X-Gm-Message-State: ANoB5pk27m15DM4HxZcBqz1ZKy6n9a1/89PGwL0KOIoifkPfscsmEMAI M51OBOq5A+snjyx47Ub8AeQZoywjYsoaSKOVuXk= X-Received: by 2002:a17:906:3781:b0:7ac:8e6a:a674 with SMTP id n1-20020a170906378100b007ac8e6aa674mr11686082ejc.2.1670791576802; Sun, 11 Dec 2022 12:46:16 -0800 (PST) Received: from localhost.localdomain ([185.126.107.38]) by smtp.gmail.com with ESMTPSA id o20-20020a170906769400b0077a11b79b9bsm2412231ejm.133.2022.12.11.12.46.15 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 11 Dec 2022 12:46:16 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Dragan Mladjenovic , Milica Lazarevic , Jiaxun Yang , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= , Djordje Todorovic , Aurelien Jarno , Bernhard Beschow Subject: [PATCH-for-8.0 v2 07/11] hw/mips/malta: Use bootloader generator API for nanoMIPS CPUs (2/5) Date: Sun, 11 Dec 2022 21:45:29 +0100 Message-Id: <20221211204533.85359-8-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221211204533.85359-1-philmd@linaro.org> References: <20221211204533.85359-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::634; envelope-from=philmd@linaro.org; helo=mail-ej1-x634.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=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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Part 2/5: Convert PCI0 MEM0 BAR setup Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- hw/mips/malta.c | 35 ++++++----------------------------- 1 file changed, 6 insertions(+), 29 deletions(-) diff --git a/hw/mips/malta.c b/hw/mips/malta.c index 30ca4e0000..3e80a12221 100644 --- a/hw/mips/malta.c +++ b/hw/mips/malta.c @@ -687,7 +687,6 @@ static void write_bootloader_nanomips(uint8_t *base, uint64_t run_addr, * Load BAR registers as done by YAMON: * * - set up PCI0 I/O BARs from 0x18000000 to 0x181fffff - * - set up PCI0 MEM0 at 0x10000000, size 0x8000000 * */ stw_p(p++, 0xe040); stw_p(p++, 0x0681); @@ -723,20 +722,6 @@ static void write_bootloader_nanomips(uint8_t *base, uint64_t run_addr, stw_p(p++, 0xe020); stw_p(p++, 0x0001); /* lui t0, %hi(0x80000000) */ - /* 0x58 corresponds to GT_PCI0M0LD */ - stw_p(p++, 0x8422); stw_p(p++, 0x9058); - /* sw t0, 0x58(t1) */ - - stw_p(p++, 0xe020); stw_p(p++, 0x07e0); - /* lui t0, %hi(0x3f000000) */ - - /* 0x60 corresponds to GT_PCI0M0HD */ - stw_p(p++, 0x8422); stw_p(p++, 0x9060); - /* sw t0, 0x60(t1) */ - - stw_p(p++, 0xe020); stw_p(p++, 0x0821); - /* lui t0, %hi(0xc1000000) */ - #else #define cpu_to_gt32 cpu_to_be32 @@ -767,24 +752,16 @@ static void write_bootloader_nanomips(uint8_t *base, uint64_t run_addr, stw_p(p++, 0x0020); stw_p(p++, 0x0080); /* addiu[32] t0, $0, 0x80 */ - - /* 0x58 corresponds to GT_PCI0M0LD */ - stw_p(p++, 0x8422); stw_p(p++, 0x9058); - /* sw t0, 0x58(t1) */ - - stw_p(p++, 0x0020); stw_p(p++, 0x003f); - /* addiu[32] t0, $0, 0x3f */ - - /* 0x60 corresponds to GT_PCI0M0HD */ - stw_p(p++, 0x8422); stw_p(p++, 0x9060); - /* sw t0, 0x60(t1) */ - - stw_p(p++, 0x0020); stw_p(p++, 0x00c1); - /* addiu[32] t0, $0, 0xc1 */ #endif v = p; /* setup PCI0 mem windows */ + bl_gen_write_u32(&v, /* GT_PCI0M0LD */ + cpu_mips_phys_to_kseg1(NULL, 0x1be00000 + 0x58), + cpu_to_gt32(0x10000000 << 3)); + bl_gen_write_u32(&v, /* GT_PCI0M0HD */ + cpu_mips_phys_to_kseg1(NULL, 0x1be00000 + 0x60), + cpu_to_gt32(0x07e00000 << 3)); bl_gen_write_u32(&v, /* GT_PCI0M1LD */ cpu_mips_phys_to_kseg1(NULL, 0x1be00000 + 0x80), cpu_to_gt32(0x18200000 << 3));