From patchwork Mon Jan 9 17:23:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 640664 Delivered-To: patch@linaro.org Received: by 2002:a17:522:f3c4:b0:4b4:3859:abed with SMTP id in4csp2265193pvb; Mon, 9 Jan 2023 09:27:06 -0800 (PST) X-Google-Smtp-Source: AMrXdXu7IIDtshrWpAlU1QqHFLToSAv+f+aR02x2NOehGQ1Ad1QD+e7QEXL8Ih+fpWBkT5rXSaDN X-Received: by 2002:ac8:7409:0:b0:3a9:6b35:e7aa with SMTP id p9-20020ac87409000000b003a96b35e7aamr90398330qtq.51.1673285226599; Mon, 09 Jan 2023 09:27:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673285226; cv=none; d=google.com; s=arc-20160816; b=IYNu0mA1I3Xya4KgOoAUbxod5q3Xxi85BIoAjyFiHfYga7P1HiaPxAIgHZdiAm6EPZ ILFrX1X2F1jw+AU0vNZhcc0KjDpkm31kqI2yQtcfzhOfugXkwOSOVZlFXpHxUXZeW92K khhVFl2fMfIFdZDWNSwrh7H5CW+Ulu1cGKSAbB+r/evu+oZnLCjAl7PIuuDFhV4ticuE 80iWJL4FHjjaN1a5ilTFLAxxSDeIQwFXU9cvJVG/Lh/camjGItLqVrmNqYfk2eLTOERS IDuVRdhG8+qCXeTgEjqlqbEBP3Kew4AjNKm7t/fqaPOY1MYo0ipxAKYsFWF+yhJ7cI8s U/Gg== 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=Md1ht9BenAS9gT+l4PHU2nQxwV72/gQGjTwkecQpBFU=; b=zr66h1CjOvxSnmxuBvOdbfXYpH4d/jgYXc1OoeiYIFAw2uZicw97PFTiLFUuMZomVW cPqAylc420OBIypXOjtSVTBZramVexbtdkzfbkFnnSdkyhpk7CIOY7UOQyAnq6D/qgbS rQJVRY0Sch1xPPDrws5e4/HXFYh6+DRHlNIp7mr0rOQewecn+eCKS2prxu89YsoemMnz 19QcweBW1Xb5wWBJNY5X0U/fmv3uDxu5nLRv49vY7LW4rA3XQyM3YERWFEDwnmPIMCgn E1w+nuvRYL6uooQl/vM4e+ZefBNp7tMcTqnVldQX1KuhjPnV+u0ki5WxtWbn39cGRWvW 40+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=AW9bdWLq; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id h17-20020ac87451000000b003a7f7b2a515si9223qtr.729.2023.01.09.09.27.06 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Jan 2023 09:27:06 -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=@gmail.com header.s=20210112 header.b=AW9bdWLq; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pEvtL-0002Q5-8C; Mon, 09 Jan 2023 12:24:59 -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 1pEvtJ-0002OQ-Kx; Mon, 09 Jan 2023 12:24:57 -0500 Received: from mail-ej1-x62c.google.com ([2a00:1450:4864:20::62c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pEvtH-0000yc-7v; Mon, 09 Jan 2023 12:24:57 -0500 Received: by mail-ej1-x62c.google.com with SMTP id jo4so21928431ejb.7; Mon, 09 Jan 2023 09:24:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; 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=Md1ht9BenAS9gT+l4PHU2nQxwV72/gQGjTwkecQpBFU=; b=AW9bdWLqcZnbcIrxb0E5y6wx61MwiQ6ykdZSreG9dW6EfVUjDbTv89yH1Bt8ndq2a/ VZogJs3SI4IxDPQ+l7Mjz+ojU/nM1wZpeI6kTc3B6F5P6dJbbVs3x7wk2QV+waxT2Y0I eXXKMHV9ca0MXxTtQC1G8m9b8roJt+ywi+NQfgOcfsXitina+lZBnTr1NBxIv4w57YsX 9qa3PATPDjFYKBha977mEzEJNld0TkMnx39K1+Lkk5+LMQfUHMWQONeC7juiwxJinXmg LsKyMABRv/Sf5Twl4L9O39ysnu7UzHSwdjbF0y+o2WAWJhw4nU2lkZk6oFetCS2RiUd/ R/Wg== 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=Md1ht9BenAS9gT+l4PHU2nQxwV72/gQGjTwkecQpBFU=; b=inI9052/Q8ZdSsqogwT5RE9kwcg482P19e9IVZW7pcTxLg06eGcEl/+QUDQixXLBf9 KYky0tz2Qw+lVR6iXUgfj/Q0Gbk4b7qMoYBwT589b4QeNlimZNGFPgjlqbQodafvE72H Ebg/1f9PdDUCqnEjC2V9tdMlsTXb+g1mHL/6CYO3vDXjsjZj2Iyiom0DUlq8Nx1r6HDO SfaL9aCCUsAgEJ+51OEuM1oylx6kgGhaHzQMEIpUVUUoUtCWAyExH/UjSTetWPPPBrjn U0yZRW8EFFQ27P8BBeQ0Xf5F+TYA7ArOUO0UYWyrwspL+dVvkbKJBrAiIu9bLkD2pMqz z8aA== X-Gm-Message-State: AFqh2kqbdNKAc1zwVZgzZ6wiHZUzyd+Ojr5XBa4ltYoH9nAaxNw+Uvr4 7Z/QcFHOSReA2zgyOdaYgUb7eGpjW0MUZg== X-Received: by 2002:a17:907:c70c:b0:81e:9027:dedc with SMTP id ty12-20020a170907c70c00b0081e9027dedcmr56100887ejc.39.1673285092522; Mon, 09 Jan 2023 09:24:52 -0800 (PST) Received: from osoxes.fritz.box (p200300faaf0bb2009c4947838afc41b6.dip0.t-ipconnect.de. [2003:fa:af0b:b200:9c49:4783:8afc:41b6]) by smtp.gmail.com with ESMTPSA id 18-20020a170906201200b00846734faa9asm3925625ejo.164.2023.01.09.09.24.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Jan 2023 09:24:52 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: John G Johnson , Richard Henderson , Igor Mammedov , Elena Ufimtseva , Ani Sinha , Eduardo Habkost , Gerd Hoffmann , Jagannathan Raman , "Michael S. Tsirkin" , Paolo Bonzini , John Snow , Aurelien Jarno , qemu-ppc@nongnu.org, Jiaxun Yang , qemu-block@nongnu.org, Peter Maydell , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Phil?= =?utf-8?q?ippe_Mathieu-Daud=C3=A9?= , Marcel Apfelbaum , qemu-arm@nongnu.org, =?utf-8?q?Herv=C3=A9_Poussineau?= Subject: [PATCH v6 01/33] hw/mips/malta: Introduce PIIX4_PCI_DEVFN definition Date: Mon, 9 Jan 2023 18:23:14 +0100 Message-Id: <20230109172347.1830-2-shentey@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230109172347.1830-1-shentey@gmail.com> References: <20230109172347.1830-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62c; envelope-from=shentey@gmail.com; helo=mail-ej1-x62c.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, FREEMAIL_FROM=0.001, 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 From: Philippe Mathieu-Daudé The PIIX4 PCI-ISA bridge function is always located at 10:0. Since we want to re-use its address, add the PIIX4_PCI_DEVFN definition. Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20221027204720.33611-2-philmd@linaro.org> --- hw/mips/malta.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/mips/malta.c b/hw/mips/malta.c index c0a2e0ab04..9bffa1b128 100644 --- a/hw/mips/malta.c +++ b/hw/mips/malta.c @@ -71,6 +71,8 @@ #define FLASH_SIZE 0x400000 +#define PIIX4_PCI_DEVFN PCI_DEVFN(10, 0) + typedef struct { MemoryRegion iomem; MemoryRegion iomem_lo; /* 0 - 0x900 */ @@ -1401,7 +1403,7 @@ void mips_malta_init(MachineState *machine) empty_slot_init("GT64120", 0, 0x20000000); /* Southbridge */ - piix4 = pci_create_simple_multifunction(pci_bus, PCI_DEVFN(10, 0), true, + piix4 = pci_create_simple_multifunction(pci_bus, PIIX4_PCI_DEVFN, true, TYPE_PIIX4_PCI_DEVICE); isa_bus = ISA_BUS(qdev_get_child_bus(DEVICE(piix4), "isa.0")); From patchwork Mon Jan 9 17:23:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 640665 Delivered-To: patch@linaro.org Received: by 2002:a17:522:f3c4:b0:4b4:3859:abed with SMTP id in4csp2268779pvb; Mon, 9 Jan 2023 09:34:36 -0800 (PST) X-Google-Smtp-Source: AMrXdXucnclPTSo9o0Bc+xAgR+w+EufO5MY8n7KKF3cSQYFJ8FGF5s9HKfh8OvnTB5iY5pjY2Ja3 X-Received: by 2002:a05:622a:8c8:b0:3ad:fdb5:46c8 with SMTP id i8-20020a05622a08c800b003adfdb546c8mr3993731qte.10.1673285676361; Mon, 09 Jan 2023 09:34:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673285676; cv=none; d=google.com; s=arc-20160816; b=IvHNKZAQ6gyDnWfAH6O2mklRU7fwfS5T8i3MGpqhy0XR9yBuClqS907MyIxSxnc2va WSYZ/BQdap/oRFIm/NUWyyPU8fgB9SX659DJfVOqg9+zU/CyJBsApoqJnQPDJi5tgxR7 SKP3T5ATk5CzGyxVEzN9DNV5evfsY/L2hLoaVopsi9ooq0LkFJHG5I07/2mOzcCaSfkR zOmlARws0WmnNiw5zWFEz9OfHFAXlFM8MFdTL/cAyp1aX0CvdzYlakrEQzb56C6gWrns aklb84b7baY80WouDuj4d/7PwDfYGDn8/cmtBi/UTYJSmFpEOtEXhIV0DPE18QX8gAQJ 7rew== 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=yD2Nt3sc65GXyJk9LaQMyT8j1pCfMA2t4DX/1jlVSvA=; b=IOdGk+9AoQ8BzLnaHqKTc9L4YLsmVR5QO98BRWLxHWnKx/w4UmAVpZ63p9OQxTM0Bg TSyFSHAWmwXqafhCLFSLSYuqzoKVLE/wK3esmeP5fMY3PhAici2vH2MJ7u0VEDIZAZrJ tNqXTSlbpVKhOoRzLjP0Dt53ylNUmXmG1jYYKKOiRFIu0aN83RXc1QqucEr1gn6aqjWZ /fhyqpszjBcXesBJ+Dv3C8CET6c5dfY+a2SNbWUkv2Q1C7AfaagNRFRkHG1STA/BBZN+ htJClPGf1LNVIlpMwpsx+ec2WNm4Q+TYVWnzzOOrItXhJzjY8fT/oAq/WawzbJmikd3O 1H3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=YPvx685N; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id v14-20020a05622a188e00b003981462e81asi1688495qtc.702.2023.01.09.09.34.36 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Jan 2023 09:34:36 -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=@gmail.com header.s=20210112 header.b=YPvx685N; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pEvtM-0002RF-EZ; Mon, 09 Jan 2023 12:25:00 -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 1pEvtK-0002PF-Na; Mon, 09 Jan 2023 12:24:58 -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 1pEvtI-0000yw-Lm; Mon, 09 Jan 2023 12:24:58 -0500 Received: by mail-ej1-x62d.google.com with SMTP id fy8so21837643ejc.13; Mon, 09 Jan 2023 09:24:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; 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=yD2Nt3sc65GXyJk9LaQMyT8j1pCfMA2t4DX/1jlVSvA=; b=YPvx685NNHH+OeuQABNKzGkOQCepCahtqtF9labqsDeGjCw3pZUR7W5Y5voZuJd3O9 Yr78SR/DXEgjLo9qoDuHNtQXMxkk02EVsKogkbA/TFl49sfmOdOQCIjD63RNBe+CYsSj BhoUImI3A6rIsNP4wpdfVlmm+jCKxgxp9xIOCcoNq+zt4p6UseNzQ0pW/aZE4m6FsX2r 6kE2pJTwnoJ359v7KAAEqjWtoQ6K08p1TltVw9exrhu/5kZUqjgg1nClVL6fQGGLYRFa /gXHUdjkN2fa274gCalsscGd2QjAnUlEDxdUxJhNPE/8vV+O5NvEyGEgmJ5CIQPJ7y2P ZRqA== 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=yD2Nt3sc65GXyJk9LaQMyT8j1pCfMA2t4DX/1jlVSvA=; b=5MFquZxLs9Gs6K4T1eRAPPYeTBRdwPyVPzeLOLRrw0iitshK85y6XFc4REKGfj3rmi mATE+MGZ3Rnmtv6gJWFi9TadyvcSP9smXt5CFZAY2Sn1BhkBzTyVISVRSkjbP+eRvazQ ViNaULIfZAgo2ax2Z5/e58nsBGzIWlLdJtAZXKq3lVx5yxikBo2a8wMu2JO2IUA5RWqE y04IA48h4PMkC5BePUBo86geLxzRjadJp7haYWbmDUS1+Dc9dQMD27ay6ZHQvoPnLYu2 BVVdnyNJzHNFxo6GvC4U1c3WPJ7bdFGTJzViPqmqWbgRNk8ml6QLrDFkIgYY8cJcHQpY hSZw== X-Gm-Message-State: AFqh2kqRwheo6kSrwTixgvAFMUwzmO4j8z9d5kkKtMO/g59/q5Rna86f YvUErIM+tUVMzoS+5Mn0oRLuOAWC9u7/Dg== X-Received: by 2002:a17:906:3993:b0:844:de87:8684 with SMTP id h19-20020a170906399300b00844de878684mr64741397eje.46.1673285094028; Mon, 09 Jan 2023 09:24:54 -0800 (PST) Received: from osoxes.fritz.box (p200300faaf0bb2009c4947838afc41b6.dip0.t-ipconnect.de. [2003:fa:af0b:b200:9c49:4783:8afc:41b6]) by smtp.gmail.com with ESMTPSA id 18-20020a170906201200b00846734faa9asm3925625ejo.164.2023.01.09.09.24.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Jan 2023 09:24:53 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: John G Johnson , Richard Henderson , Igor Mammedov , Elena Ufimtseva , Ani Sinha , Eduardo Habkost , Gerd Hoffmann , Jagannathan Raman , "Michael S. Tsirkin" , Paolo Bonzini , John Snow , Aurelien Jarno , qemu-ppc@nongnu.org, Jiaxun Yang , qemu-block@nongnu.org, Peter Maydell , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Phil?= =?utf-8?q?ippe_Mathieu-Daud=C3=A9?= , Marcel Apfelbaum , qemu-arm@nongnu.org, =?utf-8?q?Herv=C3=A9_Poussineau?= Subject: [PATCH v6 02/33] hw/mips/malta: Set PIIX4 IRQ routes in embedded bootloader Date: Mon, 9 Jan 2023 18:23:15 +0100 Message-Id: <20230109172347.1830-3-shentey@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230109172347.1830-1-shentey@gmail.com> References: <20230109172347.1830-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62d; envelope-from=shentey@gmail.com; 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, FREEMAIL_FROM=0.001, 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 From: Philippe Mathieu-Daudé Linux kernel expects the northbridge & southbridge chipsets configured by the BIOS firmware. We emulate that by writing a tiny bootloader code in write_bootloader(). Upon introduction in commit 5c2b87e34d ("PIIX4 support"), the PIIX4 configuration space included values specific to the Malta board. Set the Malta-specific IRQ routing values in the embedded bootloader, so the next commit can remove the Malta specific bits from the PIIX4 PCI-ISA bridge and make it generic (matching the real hardware). Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20221027204720.33611-3-philmd@linaro.org> --- hw/mips/malta.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/hw/mips/malta.c b/hw/mips/malta.c index 9bffa1b128..c3dcd43f37 100644 --- a/hw/mips/malta.c +++ b/hw/mips/malta.c @@ -803,6 +803,8 @@ static void write_bootloader_nanomips(uint8_t *base, uint64_t run_addr, stw_p(p++, 0x8422); stw_p(p++, 0x9088); /* sw t0, 0x88(t1) */ + /* TODO set PIIX IRQC[A:D] routing values! */ + stw_p(p++, 0xe320 | NM_HI1(kernel_entry)); stw_p(p++, NM_HI2(kernel_entry)); @@ -840,6 +842,9 @@ static void write_bootloader_nanomips(uint8_t *base, uint64_t run_addr, static void write_bootloader(uint8_t *base, uint64_t run_addr, uint64_t kernel_entry) { + const char pci_pins_cfg[PCI_NUM_PINS] = { + 10, 10, 11, 11 /* PIIX IRQRC[A:D] */ + }; uint32_t *p; /* Small bootloader */ @@ -914,6 +919,20 @@ static void write_bootloader(uint8_t *base, uint64_t run_addr, #undef cpu_to_gt32 + /* + * The PIIX ISA bridge is on PCI bus 0 dev 10 func 0. + * Load the PIIX IRQC[A:D] routing config address, then + * write routing configuration to the config data register. + */ + bl_gen_write_u32(&p, /* GT_PCI0_CFGADDR */ + cpu_mips_phys_to_kseg1(NULL, 0x1be00000 + 0xcf8), + tswap32((1 << 31) /* ConfigEn */ + | PCI_BUILD_BDF(0, PIIX4_PCI_DEVFN) << 8 + | PIIX_PIRQCA)); + bl_gen_write_u32(&p, /* GT_PCI0_CFGDATA */ + cpu_mips_phys_to_kseg1(NULL, 0x1be00000 + 0xcfc), + tswap32(ldl_be_p(pci_pins_cfg))); + bl_gen_jump_kernel(&p, true, ENVP_VADDR - 64, /* From patchwork Mon Jan 9 17:23:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 640666 Delivered-To: patch@linaro.org Received: by 2002:a17:522:f3c4:b0:4b4:3859:abed with SMTP id in4csp2273805pvb; Mon, 9 Jan 2023 09:46:18 -0800 (PST) X-Google-Smtp-Source: AMrXdXuPP21IVTFwD6sfl+8fc4OM3OZq1S3UbLlsplhveeiEk+dJXwhFG2+i2w88raGndRMZwrNL X-Received: by 2002:a05:6102:3118:b0:3ce:d4bc:d5c6 with SMTP id e24-20020a056102311800b003ced4bcd5c6mr5982196vsh.11.1673286377982; Mon, 09 Jan 2023 09:46:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673286377; cv=none; d=google.com; s=arc-20160816; b=dAKukTac+8xprakuJT3aUBvzxa3iiEfngZDFmCurlu1Rr+8vKNyFLFV5aNPQ94/Y8k OnoBOLSXq628ILrw5T6xlpFdJAdBUF1xJs+04TixYyy4m5vQ0fbZdy1TeXkaSxpPjUR7 ieK0trqcGW4vZgaUUyl888Oz9tkgarYibNgDjk5CU35RgRCyrpkc+po2blVoNnW3V05/ u1mi4i+vj/NvJwBoV/3BwoFX6WnzIlVIo3Udbe3l67JFKnXLNVK22k6HcUtzMKXgKeIw FUXfIX5DgYaiQX4i/HG71R34BELMRsUx4gpFxRZJxI2LuvzjRb3D1fKmOEg5gcUHE8wF I8bw== 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=b0zxx8tPOrJ/ctNq1xpYzBZctNT1tt/hlM+VII09Kv0=; b=X1c05j7VTXIwXLFhUUy8thGlgTa3BOSUvIl8Z6HPXgyii/VCIey82q6ElWYKDle0mW c6+3IME7+xZYbEpwUETBMarBHAIphJch9JHn9tI7HXQ5RHsHnwCYyu2iqW4L5y7stBYE kx+4xPUTnpdrGwMzpkeXTsu5dRNzCnxZcCIrhgRLQAr5E7oR/JEd/yeB22qszcKgT8nd Lt3794nfpUjQbmRolKnwFkc4oW0q/mAvGc9em3gZadIfbzsz6ZFql270Dt08NaMUwdSC 8vLGWkH8lUxQP+aXS33hDIHEojefy7f8aBHZHSu4LCXjDQb9GQSRGRiG7vUX6bZpOfln 7mSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=kkzw6B3n; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id ef5-20020a05620a808500b00705b1d5b036si2445864qkb.641.2023.01.09.09.46.17 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Jan 2023 09:46:17 -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=@gmail.com header.s=20210112 header.b=kkzw6B3n; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pEvtN-0002RW-AK; Mon, 09 Jan 2023 12:25:01 -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 1pEvtL-0002QB-IM; Mon, 09 Jan 2023 12:24:59 -0500 Received: from mail-ej1-x62e.google.com ([2a00:1450:4864:20::62e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pEvtJ-0000zU-Qg; Mon, 09 Jan 2023 12:24:59 -0500 Received: by mail-ej1-x62e.google.com with SMTP id vm8so21929901ejc.2; Mon, 09 Jan 2023 09:24:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; 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=b0zxx8tPOrJ/ctNq1xpYzBZctNT1tt/hlM+VII09Kv0=; b=kkzw6B3nRxuYOqc/yTzkpiBdmJyV10/4N+ZerMGcBuZRyRqPPktKdeLn7ZCZVdcWPj RiUnKOyil+l01ReNuYR65u2m3J+xEOOkEhgYSTDXa57ADHYo81n/qu7xZyJy706vtYYo vlXhYFERbrztGYUSjjKxphwfXfGMhT5eNFqfMe9FffBUBdSGyck+n6vBtKA/x/2l+LE0 zzKA3zhvWkWS2BCjLUc+6FYIB/fy/d/er4tFWconfMz5ThUCNU0IQiYCwVxrYvEfcT+n cXRG2qPjcqCJkihYVnhpf8dIwvseytFMUvAIESBcixb/BennOwigiovyFN6obU9WmU8R N6UA== 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=b0zxx8tPOrJ/ctNq1xpYzBZctNT1tt/hlM+VII09Kv0=; b=QJcvCk97QZheRCjeEU4+hHO9GSJQdxjVCbEASaRuwqwahD7aJeyLTrH8wKaq91HkWk om4gZfbFcIWCb3OuR86ntWpKqfwv0ZgmEnGArqZX0Nz+iyrDJSbu/fpDU4FTEb8a6lvl 9LwsUzNFIMFbTq7A3mph54jlFvTcMQHB0ivRNONt1W2zr8iOtJZ+fZdV6zEWHrm3N5rW pG8E3zJ8sMkYsqbwmJodPFQq+KRjWQvBRjl9hBvu+/tpXE1h62LzJBUvhGLN480DtErl 5ePzfkEPNLk05YnZmlZLCi5cLmAX8VoEavHcj3J68TvpFenUQLKbTFHN1ksi69F2JvA5 BXqA== X-Gm-Message-State: AFqh2ko72ztoluiu3bHy2MZ33/RX2+TXlaveVI3cP0UHfuCxQze7omwM naapKCuwja8fJo0AViqBOjT2F+Wk36kRIQ== X-Received: by 2002:a17:906:3c0d:b0:84d:34f0:f766 with SMTP id h13-20020a1709063c0d00b0084d34f0f766mr9004178ejg.75.1673285095184; Mon, 09 Jan 2023 09:24:55 -0800 (PST) Received: from osoxes.fritz.box (p200300faaf0bb2009c4947838afc41b6.dip0.t-ipconnect.de. [2003:fa:af0b:b200:9c49:4783:8afc:41b6]) by smtp.gmail.com with ESMTPSA id 18-20020a170906201200b00846734faa9asm3925625ejo.164.2023.01.09.09.24.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Jan 2023 09:24:54 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: John G Johnson , Richard Henderson , Igor Mammedov , Elena Ufimtseva , Ani Sinha , Eduardo Habkost , Gerd Hoffmann , Jagannathan Raman , "Michael S. Tsirkin" , Paolo Bonzini , John Snow , Aurelien Jarno , qemu-ppc@nongnu.org, Jiaxun Yang , qemu-block@nongnu.org, Peter Maydell , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Phil?= =?utf-8?q?ippe_Mathieu-Daud=C3=A9?= , Marcel Apfelbaum , qemu-arm@nongnu.org, =?utf-8?q?Herv=C3=A9_Poussineau?= Subject: [PATCH v6 03/33] hw/isa/piix4: Correct IRQRC[A:D] reset values Date: Mon, 9 Jan 2023 18:23:16 +0100 Message-Id: <20230109172347.1830-4-shentey@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230109172347.1830-1-shentey@gmail.com> References: <20230109172347.1830-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62e; envelope-from=shentey@gmail.com; helo=mail-ej1-x62e.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, FREEMAIL_FROM=0.001, 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 From: Philippe Mathieu-Daudé IRQRC[A:D] registers reset value is 0x80. We were forcing the MIPS Malta machine routing to be able to boot a Linux kernel without any bootloader. We now have these registers initialized in the Malta machine write_bootloader(), so we can use the correct reset values. Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20221027204720.33611-4-philmd@linaro.org> --- hw/isa/piix4.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/isa/piix4.c b/hw/isa/piix4.c index 8fc1db6dc9..0d23e11a39 100644 --- a/hw/isa/piix4.c +++ b/hw/isa/piix4.c @@ -116,10 +116,10 @@ static void piix4_isa_reset(DeviceState *dev) pci_conf[0x4c] = 0x4d; pci_conf[0x4e] = 0x03; pci_conf[0x4f] = 0x00; - pci_conf[0x60] = 0x0a; // PCI A -> IRQ 10 - pci_conf[0x61] = 0x0a; // PCI B -> IRQ 10 - pci_conf[0x62] = 0x0b; // PCI C -> IRQ 11 - pci_conf[0x63] = 0x0b; // PCI D -> IRQ 11 + pci_conf[0x60] = 0x80; + pci_conf[0x61] = 0x80; + pci_conf[0x62] = 0x80; + pci_conf[0x63] = 0x80; pci_conf[0x69] = 0x02; pci_conf[0x70] = 0x80; pci_conf[0x76] = 0x0c;