From patchwork Mon Oct 4 13:47:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 515205 Delivered-To: patch@linaro.org Received: by 2002:adf:fbc8:0:0:0:0:0 with SMTP id d8csp4369611wrs; Mon, 4 Oct 2021 06:49:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxqMq6m1Wi10MV0Abnq/AX77u2nPXhBBBBc2NwcLyZALjnqfBxYkMeiS5+lSk16OK8m5yJw X-Received: by 2002:adf:a443:: with SMTP id e3mr11040979wra.115.1633355367481; Mon, 04 Oct 2021 06:49:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633355367; cv=none; d=google.com; s=arc-20160816; b=ZgNTj0cnWiyjADBToGSn5Xlv3LF6ckPLfk8I5gCQfi/Z8Sv0RBBRJRETjq+fyk8ni7 xoaelzLX3rzHwxSFCnK5137P9YRPxs/vjYFcEZxuucj5yfnGKK9VyAmsFf+vc0p6TL60 wpWoUddoL2OsKOQtE27KOW9NYw1r7Sqvy0XJgu7U+CmdeDTEPfEnLJK3C7AffyxKTt60 LdW33ZLcXnOwN4cpFuqpmjTmbeu01CLdcMSp/LOyatIZA3l1PDXwq1xSeaUiCsFP4e0N kTSy5BBZNpX4uTWxa2z8MiyFN6ugBdANfBlR0Au+vY3fvP7f+kPmnwbIXELryJwKbu22 Yabg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=7s+jokOdadsrB9ImtjPpK01MtYEBGF9XKyEbrtLXIJU=; b=WIebvAbQ+LtBJ5w6hLlgRtLmMH9bWotytx0qNZqZhAVprR7GeQrc8/6TLBm8MiYla0 WcbhU9LmrbFNt4LKsh/e/HbDHQj1gfx8/z9afoBOap7alyzkI3NDJQolGhBwa7xC+vaX RUlsPVurDI/bgt+ZaGK18AOBGuWbJtpbR32y0mW/gcAYT0b5BSOWkv3JvKhnq5vnpjGX AV0szM7R73P2MJHPHFBlhhpT450knXGGQeDEacuohZGinmebrr2UmdX5CdlAfd/RjOUI tTDiY/9xtnfk5Am48Kq7YQnwTeTz7p8eFgpvJbpm4wdi9gOszgPmfV7r2t4L5VH0TVIS 2QCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=j9aJLF2k; 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=fail (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 k17si11624965wmo.234.2021.10.04.06.49.27 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 04 Oct 2021 06:49:27 -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=fail header.i=@linaro.org header.s=google header.b=j9aJLF2k; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:41712 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mXOLO-0006y7-K0 for patch@linaro.org; Mon, 04 Oct 2021 09:49:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38670) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mXOJr-00067F-C8 for qemu-devel@nongnu.org; Mon, 04 Oct 2021 09:47:51 -0400 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]:40654) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mXOJm-0007CM-8V for qemu-devel@nongnu.org; Mon, 04 Oct 2021 09:47:51 -0400 Received: by mail-wm1-x331.google.com with SMTP id t16-20020a1c7710000000b003049690d882so19666702wmi.5 for ; Mon, 04 Oct 2021 06:47:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=7s+jokOdadsrB9ImtjPpK01MtYEBGF9XKyEbrtLXIJU=; b=j9aJLF2kSwRc0fXUpDhq2He5bQeWCY8wysIn9cp1CaKpNh4BLSLW1TpxV69PLGhiMX 2mmI2Q/KZSNDkdIov0NsjdRpVopFk6uvIb8vXbmOCIUNBABEhvaDpI/lgUbji+mhvthJ dcpjvGr1jOdwtKjIpmHaRKadwUFYg9+0GwfFUA6VOohssvC38hAcP4leBk3eBcAYzkLF EAYBtgimLi9+xIwEZJN6amvR1F83qJSkORNK5OtjzKWOxhyiErKG1Htz3yFYjNWXrihR 27350BaJEoml+RdtNv8PM7AHQY7LzBAuObgBbHiE8NE3eoRUlIKCyDi8352M3N/AuOGG 4EYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=7s+jokOdadsrB9ImtjPpK01MtYEBGF9XKyEbrtLXIJU=; b=AkWF+GDStVWvDC1d3P6ni+F622VImeldWJqP5yAVb3SWPgx3Fr91fmGaelXJYJgFIw tHA1pIu81JZVgmrH6HHIy5dk9a5D9QuetpzVmmn8gLxFbrVTHL+4UBHXovoSxjcVURXJ V/i+Eh2OIHibNg6nF3UkoRBPalnj/Ni8ghVaTjGSUqNUFAK3OQgN9KDMTUjmEI6aAQpY knJqxBGhLvzPzHKwLMAptdSbJ+Bk7IeOQjgTcYX9RCsBQYJ8yiFWJtEXbSlZP4BHFtSs hkkw48dNixh97FVybx+dJ+X5XhgXTiqxYSIiTeswL6mCCF7H/v4MWBkQi2LD9fc111O8 0qxw== X-Gm-Message-State: AOAM532H7ZmH7RXxQxxG6nMxSFIsT6qMsX3Cdvdl2LC/wKLJvIUAu0cM 1AZeiqobQDtmFXKAVhFujxqyCw== X-Received: by 2002:a7b:c048:: with SMTP id u8mr18426941wmc.113.1633355264418; Mon, 04 Oct 2021 06:47:44 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id s3sm14457226wrm.40.2021.10.04.06.47.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Oct 2021 06:47:42 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 16AD61FF98; Mon, 4 Oct 2021 14:47:42 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 1/7] hw/misc/bcm2835_property: Add FIXME comment for uninitialized memory Date: Mon, 4 Oct 2021 14:47:35 +0100 Message-Id: <20211004134742.2044280-2-alex.bennee@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211004134742.2044280-1-alex.bennee@linaro.org> References: <20211004134742.2044280-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x331.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, T_SPF_TEMPERROR=0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , qemu-arm@nongnu.org, =?utf-8?q?Alex_Benn=C3=A9e?= , f4bug@amsat.org, Andrew Baumann Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé We are returning unintialized memory, this is probably unsafe. Reported-by: Peter Maydell Signed-off-by: Philippe Mathieu-Daudé Signed-off-by: Alex Bennée --- hw/misc/bcm2835_property.c | 2 ++ 1 file changed, 2 insertions(+) -- 2.30.2 diff --git a/hw/misc/bcm2835_property.c b/hw/misc/bcm2835_property.c index 73941bdae9..791c7554ec 100644 --- a/hw/misc/bcm2835_property.c +++ b/hw/misc/bcm2835_property.c @@ -61,6 +61,7 @@ static void bcm2835_property_mbox_push(BCM2835PropertyState *s, uint32_t value) qemu_log_mask(LOG_UNIMP, "bcm2835_property: 0x%08x get board model NYI\n", tag); + /* FIXME returning uninitialized memory */ resplen = 4; break; case 0x00010002: /* Get board revision */ @@ -75,6 +76,7 @@ static void bcm2835_property_mbox_push(BCM2835PropertyState *s, uint32_t value) qemu_log_mask(LOG_UNIMP, "bcm2835_property: 0x%08x get board serial NYI\n", tag); + /* FIXME returning uninitialized memory */ resplen = 8; break; case 0x00010005: /* Get ARM memory */ From patchwork Mon Oct 4 13:47:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 515206 Delivered-To: patch@linaro.org Received: by 2002:adf:fbc8:0:0:0:0:0 with SMTP id d8csp4372207wrs; Mon, 4 Oct 2021 06:52:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxAflFMZTszpAAQOnrXNQqCPi93U2Nb6EgOA2lQBDW08b5T8kZw2ufRM9MFbyL9ygw7STuE X-Received: by 2002:ac8:4e53:: with SMTP id e19mr13237270qtw.220.1633355539519; Mon, 04 Oct 2021 06:52:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633355539; cv=none; d=google.com; s=arc-20160816; b=qq7aJkXgwXNpCYhkR16Ikb48gxmLCGhQUYhJqqnzNyS8/cq71aiW0ZrL3ifOSgISt/ 5uFopPXIq3BOwsMd8IgORVyMgrNZ4PARTKYo0asZeR0dO6uFcWB1m9d4eUDmRkW8qCU9 fWlJghMJJSekR9qDMmDp2mPD2+sYAOiPuribm1bBifQAv0lwk6Ecl0iNMDwRpkD2MkdB 5MXonbcKdOHT0ARUwKBJJ3pfND5IK4ujy0iSM5B+A2BgleWx8Bl+Cd8wDgwErH0aWb5X etQ/Hk1ZNGHEjG6lV+C2MnplVl0lYQYs9xHgLsA/55vT9y5W+G/4v0D0WizlI8GpOEcN D4cA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=lIR/QX1UEyMaEQkzlnv0koPsuyPpzDzqnJZkMaWnDRw=; b=LgkDJ/eeNXFSVj2VacHZURnG7HrGbP35qDcDIqx0WuOkzRCbIt35CK9NcYSv3Y0Kiw /gPgCr7rQxRz57ThkveuOBzLUGeNHyt4o5nVq8tMeIdIdJVQqqS7deGUFtcIuNNVOqsH NvaOaCnMCP27GtzTLQTTFiNHMMqImb3CkeWwmDJYVgbDUr5GbFF414h5V8NpwxQmKkgg yoHN3Goyr5Hs97TyYI3maptTJDoEFdh+QYXhRsWBkTTR9neMlMg6kG0w9ziKzReGttwf rnnmJUvauL27trLRNcjku5oB2xHKITV1Zfhq9vWfh7h7kIZm8M6UbK7nj6s/KsD+odoI VDiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=MpHMUEsJ; 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=fail (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 l26si9416777uac.121.2021.10.04.06.52.19 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 04 Oct 2021 06:52:19 -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=fail header.i=@linaro.org header.s=google header.b=MpHMUEsJ; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:49226 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mXOOA-0003g8-Td for patch@linaro.org; Mon, 04 Oct 2021 09:52:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38604) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mXOJp-00062Q-3q for qemu-devel@nongnu.org; Mon, 04 Oct 2021 09:47:49 -0400 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]:37583) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mXOJm-0007Az-8Y for qemu-devel@nongnu.org; Mon, 04 Oct 2021 09:47:48 -0400 Received: by mail-wr1-x42d.google.com with SMTP id e12so10657202wra.4 for ; Mon, 04 Oct 2021 06:47:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=lIR/QX1UEyMaEQkzlnv0koPsuyPpzDzqnJZkMaWnDRw=; b=MpHMUEsJ982icNkG1XQ1Gfu47udzGozksirRt3xXnr1w2t+Yj7ahjkG6wdr5oCob6l PVIvV5NQAFMgTvqb0SCYSEppUmKTFZX/Iv89AsXBmYRW9S/GwLFturOIdwnsbSMw5EK/ QFldFLW52dm4oqucRRghu5MAX05C7CF8MYJiFZqqhx0Uw4js0+ol1hE+wt3+LR8RpIgo WEkLCt/UXFUXm3eFAcFPPF+yzFpVf8uifzYdQw44tqF6IYpp7wiDaiBVQJZW8GOBMTg4 ZVlPD6kJiYjrT5yh3bXvY3uwR5NVsfHPJQxFAsgiX78eH4FFRZg9matQbuzvowCD8JGW V7/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=lIR/QX1UEyMaEQkzlnv0koPsuyPpzDzqnJZkMaWnDRw=; b=UD86s0A4/QOzlBFK6x/fC+dIg+P7zCbaPgRfZVJCOSkGk9w7l6TExIfBdNdwI6f6Mf kZeSL527mxlf36wbCYhdQ2qlfNBDjCUX9l9FKNE+1tlIiF9OHWdE80zFB6ljdckLqnYe /6IoJ4dBM9bNkjpy1pg9btQtmMgSIQLSVxyAl0yLqEcJodxFSruJnw2fyYOSnII3XnjF PeGiIiCzbW2drzCMXcl3YzSc1JOI4MZfqC/C6fU8yBvCErdy8cG/17ma+CVT13tRmnlq +NYwpxTZCjiW7xswUgN0TibM8CAZrn/nRICc8GxHQw6BJ2/hAhf2DKBzRtL3o3BNY5Kj TH8w== X-Gm-Message-State: AOAM530SaoMZhW11lRrYyyikSbDrzXL/+4RMmvvHYEIPjkk2GPEwGAIn Wfp0S+ms9pF4qz8r6isPxL152A== X-Received: by 2002:adf:c70b:: with SMTP id k11mr13947426wrg.154.1633355263744; Mon, 04 Oct 2021 06:47:43 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id q10sm14357977wmq.12.2021.10.04.06.47.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Oct 2021 06:47:42 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 2CE6F1FF99; Mon, 4 Oct 2021 14:47:42 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 2/7] hw/misc/bcm2835_property: Handle the 'domain state' property Date: Mon, 4 Oct 2021 14:47:36 +0100 Message-Id: <20211004134742.2044280-3-alex.bennee@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211004134742.2044280-1-alex.bennee@linaro.org> References: <20211004134742.2044280-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42d; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42d.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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , qemu-arm@nongnu.org, =?utf-8?q?Alex_Benn=C3=A9e?= , f4bug@amsat.org, Andrew Baumann Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé The kernel is happy with this change, so we don't need to do anything more sophisticated. Reviewed-by: Peter Maydell Signed-off-by: Philippe Mathieu-Daudé Signed-off-by: Alex Bennée --- hw/misc/bcm2835_property.c | 8 ++++++++ 1 file changed, 8 insertions(+) -- 2.30.2 diff --git a/hw/misc/bcm2835_property.c b/hw/misc/bcm2835_property.c index 791c7554ec..b089e47584 100644 --- a/hw/misc/bcm2835_property.c +++ b/hw/misc/bcm2835_property.c @@ -133,6 +133,14 @@ static void bcm2835_property_mbox_push(BCM2835PropertyState *s, uint32_t value) resplen = 8; break; + case 0x00030030: /* Get domain state */ + qemu_log_mask(LOG_UNIMP, + "bcm2835_property: 0x%08x get domain state NYI\n", + tag); + /* FIXME returning uninitialized memory */ + resplen = 8; + break; + case 0x00038002: /* Set clock rate */ case 0x00038004: /* Set max clock rate */ case 0x00038007: /* Set min clock rate */ From patchwork Mon Oct 4 13:47:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 515209 Delivered-To: patch@linaro.org Received: by 2002:adf:fbc8:0:0:0:0:0 with SMTP id d8csp4374639wrs; Mon, 4 Oct 2021 06:54:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw8Z0Z1MH2MtO0Aewhld4ua4ymB7GaF4014SNRqS9CVH8ZiiM23dxBxTuJKdJjGKExUNRmu X-Received: by 2002:a1f:a9c4:: with SMTP id s187mr16691140vke.9.1633355699281; Mon, 04 Oct 2021 06:54:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633355699; cv=none; d=google.com; s=arc-20160816; b=CyxResbVYXbq/BCPCHWtWoRtU1/hktjOv/3kHVNL8zpDpvRuu5ejXw0H39xGVqfm/3 Kq5eE2otPemPtpJs+mxdXxgXilJrwWb2plDQaTZMWnrz+YUVNUESd0ep5iUISMZBEWKl 8kvTM1uXZASB56/DHX8266UqCe3HTcwjKoWGq3tw4o0LObYv8wib43PufUAL9i2rA/iV aOJ9gj9nM3fpoSDwORgf+9S4Xou1obxWDnRF2aUQTBvem6Zb/G2bhK7Sod0E3GADyI1v Utmp1oto0sHrN/+nEkBs6g5t/J0vTwEGP5keuwYuY/N2MiQ1HjQlArhd+up6MxMLKL9e dTgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=tauNzcyK3cSG+a2zOUMTvnbEnpz8TOCzEQ2k8WtON+U=; b=rG3XH1RGLoz4N8J3MmvdVzj/lFlBAoapCaTZ+y8r1N64xLnEU/y57iah2dn1VW2PpI LuMxPCOUpw87UsvUWpz4yrb919qsnmkAhTf3iu7WAM+Oyi1TkjUHwhNNPzXTAvmWYts9 Z/J25ZD6XR4rcA2mSYV1csPBFIBzhYrOnujEntQf8/gV21jGi5avrrK/ivPFuIQ5XtDK HuHOF+cLcvYaQIhIix3VNh+YYZ34SnkeAxr49OZXWy1z5Z7YhTTL0XRD0nyp2vRRvgRJ AVwGMrsR9SanJEty6TLcbmMS3LerYBFq98nwjEvUw85LEgboXHyPz971SFJS+4BTJLq/ jwhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=HIbAKXqB; 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=fail (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 f8si7325600vsk.107.2021.10.04.06.54.59 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 04 Oct 2021 06:54:59 -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=fail header.i=@linaro.org header.s=google header.b=HIbAKXqB; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:58240 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mXOQk-0001PL-K7 for patch@linaro.org; Mon, 04 Oct 2021 09:54:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38746) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mXOJw-0006BC-Qz for qemu-devel@nongnu.org; Mon, 04 Oct 2021 09:47:56 -0400 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]:44845) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mXOJr-0007GY-D7 for qemu-devel@nongnu.org; Mon, 04 Oct 2021 09:47:54 -0400 Received: by mail-wm1-x32a.google.com with SMTP id m14-20020a05600c3b0e00b0030d4dffd04fso19174wms.3 for ; Mon, 04 Oct 2021 06:47:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=tauNzcyK3cSG+a2zOUMTvnbEnpz8TOCzEQ2k8WtON+U=; b=HIbAKXqBvw0K7GFZKnJPeqruoEm9V3ah3HKu2OaGeeT6yJ5r3+kDThPCUye9HdC905 uBQUZIYZrqlyVrJyF3l7WEE6WST67tiethhG9mKvIxlCIde/wTKZqVjxOIBtLBidnPWY xK/ffCxC8Kq5G+0gI+A9KAj31wOj0KHbAKi7EQoIK2RVIZ+ppEc0Cps5RfMba5uIOblR caenSTPty7zDxSNOWqJ4+z8vs0UZJR3YXxpPJXM3VUD7aPZIMZm67KMJTiD7yQGDoxWU tCeWp8ucNISTdwlKRNvPXlyQlIap1ZCMRh19V/Kse6q2b+xDkMPR4nW47zEEKqMyXY0l 2CvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=tauNzcyK3cSG+a2zOUMTvnbEnpz8TOCzEQ2k8WtON+U=; b=sEgidHshgpbKHnTydE2Us9U8aWT9LuKwaiddrmRn4V95HdJF8yYkrdlyWI/1gdNjss B8f/IjudZ4CTfA1reOlfBRFI6ZFk/R0rtPRWUt1bD6mIfx0KsvMe8uD31dBhSwaFXOpF E3EmS5I4Ar6Q2E5jy713482MILBhNvylOQnvVzoX8+ucjqvf9ElMt3KWboRwBUGd8Z8T iB6+53gwK/hheNRGpee6VciDYrBnSnsKu1PkgQDjo6xZitJjSPRgY4guCJ9i3BeAKqWo j7qX3MMIo5argHAZ2nFSHDDL6C928HX1tcGGZEji2ZE8+rscL3TBG9onV1q68aWfLjsT Rx9w== X-Gm-Message-State: AOAM531+Hsq5o3yjW73u6CugdujaqD0WZeKYokUauPKeH3cZf8I/1iAh 3zPjDOdWv2bsd8q7yJDg5kB5ow== X-Received: by 2002:a7b:cf17:: with SMTP id l23mr7205450wmg.152.1633355269919; Mon, 04 Oct 2021 06:47:49 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id c204sm4744265wme.11.2021.10.04.06.47.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Oct 2021 06:47:45 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 4816E1FF9A; Mon, 4 Oct 2021 14:47:42 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 3/7] hw/arm: fix the position of vcram for raspi Date: Mon, 4 Oct 2021 14:47:37 +0100 Message-Id: <20211004134742.2044280-4-alex.bennee@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211004134742.2044280-1-alex.bennee@linaro.org> References: <20211004134742.2044280-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32a.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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Michael Bishop , f4bug@amsat.org, Andrew Baumann , qemu-arm@nongnu.org, =?utf-8?q?Alex_B?= =?utf-8?b?ZW5uw6ll?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" The previous calculation fell over when I tried to create a 8gb Pi 4 because the values were only 32 bit. However the quirk of the Pi hardware is the vcram can only appear in the first 1gb of address space. This also limits where the initial kernel and DTB can be loaded (notice the DTS for the 8gb Pi4 still only uses 32 bit sizes). Fix this cleaning up setup_boot to directly use vcram_base and documenting what is going on. NB: the aliases are confusing. Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Cc: Michael Bishop --- hw/arm/bcm2835_peripherals.c | 14 +++++++++++--- hw/arm/bcm2836.c | 2 ++ hw/arm/raspi.c | 19 ++++++++++++------- 3 files changed, 25 insertions(+), 10 deletions(-) -- 2.30.2 diff --git a/hw/arm/bcm2835_peripherals.c b/hw/arm/bcm2835_peripherals.c index 48538c9360..46852bc8a6 100644 --- a/hw/arm/bcm2835_peripherals.c +++ b/hw/arm/bcm2835_peripherals.c @@ -12,6 +12,7 @@ #include "qemu/osdep.h" #include "qapi/error.h" #include "qemu/module.h" +#include "qemu/units.h" #include "hw/arm/bcm2835_peripherals.h" #include "hw/misc/bcm2835_mbox_defs.h" #include "hw/arm/raspi_platform.h" @@ -74,6 +75,7 @@ static void bcm2835_peripherals_init(Object *obj) /* Framebuffer */ object_initialize_child(obj, "fb", &s->fb, TYPE_BCM2835_FB); object_property_add_alias(obj, "vcram-size", OBJECT(&s->fb), "vcram-size"); + object_property_add_alias(obj, "vcram-base", OBJECT(&s->fb), "vcram-base"); object_property_add_const_link(OBJECT(&s->fb), "dma-mr", OBJECT(&s->gpu_bus_mr)); @@ -138,7 +140,7 @@ static void bcm2835_peripherals_realize(DeviceState *dev, Error **errp) Object *obj; MemoryRegion *ram; Error *err = NULL; - uint64_t ram_size, vcram_size; + uint64_t ram_size, vcram_size, vcram_base; int n; obj = object_property_get_link(OBJECT(dev), "ram", &error_abort); @@ -235,15 +237,21 @@ static void bcm2835_peripherals_realize(DeviceState *dev, Error **errp) qdev_get_gpio_in_named(DEVICE(&s->ic), BCM2835_IC_ARM_IRQ, INTERRUPT_ARM_MAILBOX)); - /* Framebuffer */ + /* + * The framebuffer has to live in the first 1gb of addressable + * space which is fine for older Pi's with less than 1gb of RAM + * but we need to take care not to put it too high otherwise + */ vcram_size = object_property_get_uint(OBJECT(s), "vcram-size", &err); if (err) { error_propagate(errp, err); return; } + vcram_base = MIN(ram_size, 1 * GiB) - vcram_size; + if (!object_property_set_uint(OBJECT(&s->fb), "vcram-base", - ram_size - vcram_size, errp)) { + vcram_base, errp)) { return; } diff --git a/hw/arm/bcm2836.c b/hw/arm/bcm2836.c index 24354338ca..255ba8265a 100644 --- a/hw/arm/bcm2836.c +++ b/hw/arm/bcm2836.c @@ -62,6 +62,8 @@ static void bcm2836_init(Object *obj) "board-rev"); object_property_add_alias(obj, "vcram-size", OBJECT(&s->peripherals), "vcram-size"); + object_property_add_alias(obj, "vcram-base", OBJECT(&s->peripherals), + "vcram-base"); } static bool bcm283x_common_realize(DeviceState *dev, Error **errp) diff --git a/hw/arm/raspi.c b/hw/arm/raspi.c index 146d35382b..3fb1c3138b 100644 --- a/hw/arm/raspi.c +++ b/hw/arm/raspi.c @@ -196,14 +196,19 @@ static void reset_secondary(ARMCPU *cpu, const struct arm_boot_info *info) cpu_set_pc(cs, info->smp_loader_start); } +/* + * NB: ram_limit isn't the same as ram_size - it indicates the portion + * of RAM that boot components can live in (up to the first 1gb - the + * vcram_size, aka vcram_base) + */ static void setup_boot(MachineState *machine, RaspiProcessorId processor_id, - size_t ram_size) + size_t ram_limit) { RaspiMachineState *s = RASPI_MACHINE(machine); int r; s->binfo.board_id = MACH_TYPE_BCM2708; - s->binfo.ram_size = ram_size; + s->binfo.ram_size = ram_limit; s->binfo.nb_cpus = machine->smp.cpus; if (processor_id <= PROCESSOR_ID_BCM2836) { @@ -239,7 +244,7 @@ static void setup_boot(MachineState *machine, RaspiProcessorId processor_id, ? FIRMWARE_ADDR_2 : FIRMWARE_ADDR_3; /* load the firmware image (typically kernel.img) */ r = load_image_targphys(machine->firmware, firmware_addr, - ram_size - firmware_addr); + ram_limit - firmware_addr); if (r < 0) { error_report("Failed to load firmware from %s", machine->firmware); exit(1); @@ -258,7 +263,7 @@ static void raspi_machine_init(MachineState *machine) RaspiMachineState *s = RASPI_MACHINE(machine); uint32_t board_rev = mc->board_rev; uint64_t ram_size = board_ram_size(board_rev); - uint32_t vcram_size; + uint32_t vcram_base; DriveInfo *di; BlockBackend *blk; BusState *bus; @@ -295,10 +300,10 @@ static void raspi_machine_init(MachineState *machine) qdev_prop_set_drive_err(carddev, "drive", blk, &error_fatal); qdev_realize_and_unref(carddev, bus, &error_fatal); - vcram_size = object_property_get_uint(OBJECT(&s->soc), "vcram-size", + vcram_base = object_property_get_uint(OBJECT(&s->soc), "vcram-base", &error_abort); - setup_boot(machine, board_processor_id(mc->board_rev), - machine->ram_size - vcram_size); + + setup_boot(machine, board_processor_id(mc->board_rev), vcram_base); } static void raspi_machine_class_common_init(MachineClass *mc, From patchwork Mon Oct 4 13:47:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 515204 Delivered-To: patch@linaro.org Received: by 2002:adf:fbc8:0:0:0:0:0 with SMTP id d8csp4369405wrs; Mon, 4 Oct 2021 06:49:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxTtX76LbMmoangijGxoXk10kkhT1wy8gN0q6yVtJY8oAJMk714NyD/cH+/f4uYP3z6XPqB X-Received: by 2002:a67:c107:: with SMTP id d7mr3593165vsj.38.1633355352301; Mon, 04 Oct 2021 06:49:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633355352; cv=none; d=google.com; s=arc-20160816; b=jM4OYNUK4ospXpTU+hvd9arl/StAtxNl18JqvI94c+K+BXnYa4MQjiyPL9Tkr6OuuR Ee2/8POIRCqX0uRcQ5KH9vl9dUd1yIUa8N5eedBYBqvbDz9tll8orKcQh2jjVOv/4K+E SrtK2VXWMobSeHsaQ62+8B9NqTlJy67e1dj7RFzPawjPk1JlldwfTlKraTv7iLz0Sq2G 3UFFiEt9YAzPHesM62g4AYBn589JL1qw4YDYkzs4A8rA+KAQYyweqZ5aR34/xRZCMflu IanQwfxMej5wFHkIMp2BFQ055xSMtocc068rX5v4ZqvwClPsT0O8jIx5xsyRyF9ciC1w xnOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=Us2EA51yLTgS1au9j6qZ6FszBVCH7jwMNhk/McVC0ic=; b=R8QDVkz9vZNN1g2Oo9LX33lMmUwP2nexgVTLAOv9BOwRXS4QdUewnGUSvUgx+VwW4a puzwf9BYigDZHzV6WQYx5n2iH01EZDXAiaHocsEcZHFVLaY6vnpzcXw6v0UdQZ7oD4OP WPPEKEsGaiYSd1H+QRoPgqPVLZlW++bejVzX4wILxenIhmmQY64RKsn2O+j7HNrLHWWb cAlmnSa0fMhLoCjZmJzuvV5D5fBLFTld/f29ty2ItNuqSCY6z/xLLXqMEA85fkfSj5pl 8tMYxsWSM9mExyQ1F/lFGxdd/wuM46JDFPGQ70k0SLiMphtXAoigDzrL8EXSLLhiPFNd teaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=gGhzuzEF; 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=fail (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 b2si7818000uam.224.2021.10.04.06.49.12 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 04 Oct 2021 06:49:12 -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=fail header.i=@linaro.org header.s=google header.b=gGhzuzEF; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:41496 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mXOL9-0006pl-IA for patch@linaro.org; Mon, 04 Oct 2021 09:49:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38650) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mXOJq-00065V-OO for qemu-devel@nongnu.org; Mon, 04 Oct 2021 09:47:50 -0400 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]:34634) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mXOJo-0007Er-VH for qemu-devel@nongnu.org; Mon, 04 Oct 2021 09:47:50 -0400 Received: by mail-wm1-x332.google.com with SMTP id r4-20020a7bc084000000b0030d6fc48bd2so10334wmh.1 for ; Mon, 04 Oct 2021 06:47:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Us2EA51yLTgS1au9j6qZ6FszBVCH7jwMNhk/McVC0ic=; b=gGhzuzEFqz0zMqH4ZngdGORPC/MUEe3rFbxpAN+2eALpdD9iBhD1EZlD2Kkw3YPXen sT582VYBHWEhpDQ0huWWwWNltQtYoQ2cpfdFzHWocrokFmwAdJH7rCSQ6manu37fpe3K b3W0TDXz51ZOb4vktR/K0Gv6c94VuxQU3bL6TPnFg0CUROnQoYZZXvgaGADuLk9DXfHg UTzOviK02CuiOHggbK8QiUmrnF6n/3hfd++XN0YEHhDhwtIKZ1p8T5bHiLvI0oWOPUem p6rImJKP9gjPIcV+1tGrdratMQCjQt+e4K1ITK3/Ar+ZiSMCDv77mHHcK8vvFZDTW5/G X5VA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Us2EA51yLTgS1au9j6qZ6FszBVCH7jwMNhk/McVC0ic=; b=XbqhdTz7qO6zSffLV8GAxD9IlvGlFRwgHykExs/IvTk8e7KkDs8jZe55mbPyl5j6wq 4btVrzvlR14es+H6WRdKdRpjYHObG4tXE7h09zqzn6NGWdwhs4A1oPDryI3EpFmjyj/t Y5vZUYC0gY6C23x7NXrOytRq2Gj3FgDMrUvBzKD3rThzYbDf22K872ZHv4p5AEi43D4n XKF+cPlgqe1F4IowO5Jr9wg2OQdUGEQYhXhEzp+rG+1LRBG2zliJp0351RSKsnZbN4DQ JHIoarYl/o8lD0AJu/oknuTdOBqzoCKfF6RUTTXmbgevCmB3OE+1xPDpoXZbIOmACaoz YNmQ== X-Gm-Message-State: AOAM5329Qv0HpnabH43eGnwa7NyX16ZbdK2O4+eFnpA4ig3shajKXbrv UcwjxeXn+vVlBa8GiIvPdG1cjQ== X-Received: by 2002:a05:600c:a08:: with SMTP id z8mr18858107wmp.165.1633355267430; Mon, 04 Oct 2021 06:47:47 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id h1sm14528381wmb.7.2021.10.04.06.47.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Oct 2021 06:47:45 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 62DEA1FF9B; Mon, 4 Oct 2021 14:47:42 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 4/7] hw/arm/bcm2835_peripherals: Map various BCM2711 blocks Date: Mon, 4 Oct 2021 14:47:38 +0100 Message-Id: <20211004134742.2044280-5-alex.bennee@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211004134742.2044280-1-alex.bennee@linaro.org> References: <20211004134742.2044280-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x332.google.com X-Spam_score_int: -1 X-Spam_score: -0.2 X-Spam_bar: / X-Spam_report: (-0.2 / 5.0 requ) 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , qemu-arm@nongnu.org, =?utf-8?q?Alex_Benn=C3=A9e?= , f4bug@amsat.org, Andrew Baumann Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé The BCM2711 provides more peripherals. Add them as 'unimplemented' so we can track when/how firmware and kernel access them. Based on various sources: * U-boot: https://github.com/raspberrypi/firmware/tree/next/boot - arch/arm/dts/bcm283x.dtsi - arch/arm/dts/bcm2838.dtsi - arch/arm/dts/bcm2838-rpi-4-b.dts * Arnd Bergmann analysis: https://www.cnx-software.com/2019/06/24/raspberry-pi-4-features-broadcom-bcm2711-processor-up-to-4gb-ram/#comment-563948 * Linux: https://patchwork.kernel.org/patch/11053097/ - arch/arm/boot/dts/bcm283x.dtsi - arch/arm/boot/dts/bcm283x-rpi-usb-peripheral.dtsi - arch/arm/boot/dts/bcm2711.dtsi - arch/arm/boot/dts/bcm2711-rpi-4-b.dts Signed-off-by: Philippe Mathieu-Daudé [AJB: merge fixes, drop dwc2 unimp] Signed-off-by: Alex Bennée --- TODO: At least use proper pl011[2] and pl011[3] vAJB: - fixed merge conflict on re-base - rename to BCM2711 - drop dwc2 unimp (as it is now imp) --- include/hw/arm/bcm2835_peripherals.h | 9 ++++++--- include/hw/arm/raspi_platform.h | 14 ++++++++++++++ hw/arm/bcm2835_peripherals.c | 24 +++++++++++++++++++----- 3 files changed, 39 insertions(+), 8 deletions(-) -- 2.30.2 diff --git a/include/hw/arm/bcm2835_peripherals.h b/include/hw/arm/bcm2835_peripherals.h index d864879421..8f7f23712a 100644 --- a/include/hw/arm/bcm2835_peripherals.h +++ b/include/hw/arm/bcm2835_peripherals.h @@ -52,6 +52,7 @@ struct BCM2835PeripheralState { BCM2835PowerMgtState powermgt; BCM2835CprmanState cprman; PL011State uart0; + UnimplementedDeviceState uartu[6]; BCM2835AuxState aux; BCM2835FBState fb; BCM2835DMAState dma; @@ -63,16 +64,18 @@ struct BCM2835PeripheralState { BCM2835SDHostState sdhost; BCM2835GpioState gpio; Bcm2835ThermalState thermal; + DWC2State dwc2; UnimplementedDeviceState i2s; - UnimplementedDeviceState spi[1]; - UnimplementedDeviceState i2c[3]; + UnimplementedDeviceState spi[7]; + UnimplementedDeviceState i2c[7]; UnimplementedDeviceState otp; UnimplementedDeviceState dbus; UnimplementedDeviceState ave0; UnimplementedDeviceState v3d; UnimplementedDeviceState bscsl; UnimplementedDeviceState smi; - DWC2State dwc2; + UnimplementedDeviceState xhci; + UnimplementedDeviceState argon; UnimplementedDeviceState sdramc; }; diff --git a/include/hw/arm/raspi_platform.h b/include/hw/arm/raspi_platform.h index e0e6c8ce94..7b6393542a 100644 --- a/include/hw/arm/raspi_platform.h +++ b/include/hw/arm/raspi_platform.h @@ -51,10 +51,22 @@ #define RNG_OFFSET 0x104000 #define GPIO_OFFSET 0x200000 #define UART0_OFFSET 0x201000 /* PL011 */ +#define UART2_OFFSET 0x201400 /* PL011 */ +#define UART3_OFFSET 0x201600 /* PL011 */ +#define UART4_OFFSET 0x201800 /* PL011 */ +#define UART5_OFFSET 0x201a00 /* PL011 */ #define MMCI0_OFFSET 0x202000 /* Legacy MMC */ #define I2S_OFFSET 0x203000 /* PCM */ #define SPI0_OFFSET 0x204000 /* SPI master */ +#define SPI3_OFFSET 0x204600 +#define SPI4_OFFSET 0x204800 +#define SPI5_OFFSET 0x204a00 +#define SPI6_OFFSET 0x204c00 #define BSC0_OFFSET 0x205000 /* BSC0 I2C/TWI */ +#define BSC3_OFFSET 0x205600 +#define BSC4_OFFSET 0x205800 +#define BSC5_OFFSET 0x205a00 +#define BSC6_OFFSET 0x205c00 #define PIXV0_OFFSET 0x206000 #define PIXV1_OFFSET 0x207000 #define DPI_OFFSET 0x208000 @@ -86,6 +98,8 @@ #define DBUS_OFFSET 0x900000 #define AVE0_OFFSET 0x910000 #define USB_OTG_OFFSET 0x980000 /* DTC_OTG USB controller */ +#define USB_XHCI_OFFSET 0x9c0000 /* generic-xhci controller */ +#define ARGON_OFFSET 0xb00000 #define V3D_OFFSET 0xc00000 #define SDRAMC_OFFSET 0xe00000 #define L2CC_OFFSET 0xe01000 /* Level 2 Cache controller */ diff --git a/hw/arm/bcm2835_peripherals.c b/hw/arm/bcm2835_peripherals.c index 46852bc8a6..3856c7d267 100644 --- a/hw/arm/bcm2835_peripherals.c +++ b/hw/arm/bcm2835_peripherals.c @@ -388,15 +388,29 @@ static void bcm2835_peripherals_realize(DeviceState *dev, Error **errp) create_unimp(s, &s->armtmr, "bcm2835-sp804", ARMCTRL_TIMER0_1_OFFSET, 0x40); create_unimp(s, &s->i2s, "bcm2835-i2s", I2S_OFFSET, 0x100); create_unimp(s, &s->smi, "bcm2835-smi", SMI_OFFSET, 0x100); - create_unimp(s, &s->spi[0], "bcm2835-spi0", SPI0_OFFSET, 0x20); + create_unimp(s, &s->uartu[2], "!pl011[2]", UART2_OFFSET, 0x100); + create_unimp(s, &s->uartu[3], "!pl011[3]", UART3_OFFSET, 0x100); + create_unimp(s, &s->uartu[4], "!pl011[4]", UART4_OFFSET, 0x100); + create_unimp(s, &s->uartu[5], "!pl011[5]", UART5_OFFSET, 0x100); + create_unimp(s, &s->spi[0], "bcm2835-spi[0]", SPI0_OFFSET, 0x20); + create_unimp(s, &s->spi[3], "bcm2835-spi[3]", SPI3_OFFSET, 0x20); + create_unimp(s, &s->spi[4], "bcm2835-spi[4]", SPI4_OFFSET, 0x20); + create_unimp(s, &s->spi[5], "bcm2835-spi[5]", SPI5_OFFSET, 0x20); + create_unimp(s, &s->spi[6], "bcm2835-spi[6]", SPI6_OFFSET, 0x20); create_unimp(s, &s->bscsl, "bcm2835-spis", BSC_SL_OFFSET, 0x100); - create_unimp(s, &s->i2c[0], "bcm2835-i2c0", BSC0_OFFSET, 0x20); - create_unimp(s, &s->i2c[1], "bcm2835-i2c1", BSC1_OFFSET, 0x20); - create_unimp(s, &s->i2c[2], "bcm2835-i2c2", BSC2_OFFSET, 0x20); + create_unimp(s, &s->i2c[0], "bcm2835-i2c[0]", BSC0_OFFSET, 0x20); + create_unimp(s, &s->i2c[1], "bcm2835-i2c[1]", BSC1_OFFSET, 0x20); + create_unimp(s, &s->i2c[2], "bcm2835-i2c[2]", BSC2_OFFSET, 0x20); + create_unimp(s, &s->i2c[3], "bcm2835-i2c[3]", BSC3_OFFSET, 0x20); + create_unimp(s, &s->i2c[4], "bcm2835-i2c[4]", BSC4_OFFSET, 0x20); + create_unimp(s, &s->i2c[5], "bcm2835-i2c[5]", BSC5_OFFSET, 0x20); + create_unimp(s, &s->i2c[6], "bcm2835-i2c[6]", BSC6_OFFSET, 0x20); create_unimp(s, &s->otp, "bcm2835-otp", OTP_OFFSET, 0x80); create_unimp(s, &s->dbus, "bcm2835-dbus", DBUS_OFFSET, 0x8000); create_unimp(s, &s->ave0, "bcm2835-ave0", AVE0_OFFSET, 0x8000); - create_unimp(s, &s->v3d, "bcm2835-v3d", V3D_OFFSET, 0x1000); + create_unimp(s, &s->xhci, "bcm2838-xhci", USB_XHCI_OFFSET, 0x100000); + create_unimp(s, &s->argon, "bcm2838-argon", ARGON_OFFSET, 4 * 0x10000); + create_unimp(s, &s->v3d, "bcm2835-v3d", V3D_OFFSET, 0x10000); create_unimp(s, &s->sdramc, "bcm2835-sdramc", SDRAMC_OFFSET, 0x100); } From patchwork Mon Oct 4 13:47:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 515210 Delivered-To: patch@linaro.org Received: by 2002:adf:fbc8:0:0:0:0:0 with SMTP id d8csp4375134wrs; Mon, 4 Oct 2021 06:55:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzmvl6sDHnI2NmWlHTVB97Yc8hMDM/zxntUL6KHprQJb+DSwELNoEBHPdcUxYZIcA9Vbo2q X-Received: by 2002:ab0:4719:: with SMTP id h25mr6879475uac.27.1633355737618; Mon, 04 Oct 2021 06:55:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633355737; cv=none; d=google.com; s=arc-20160816; b=KLvcrPGzLmcPZGnEQZWUfGiTdJaR6cV0SKwfQqX+iMLJbt1QvdhGYzN7JVM4i1oo7N Vj0FFMjg7/DnhXfVuHaSn/CJXM3MNM5qNX/JkfUyMrPdNteOvPsiJBbX7ey2q+H6G9ZC oAwZ0D1ywtrB4Bj5JXi27cprTkOJItrNfj424/s4/YIoSCF7CpY4ZiW2yQwJZ+WIJosh hqvb5KCT94zYZ/ZF3Qdi/GCKySpi12RhfNTmWlAdn32QKcaIgDX9HXGpS9LAWQHX+E21 ZuoI+PwF0UTFU2x70pLlRrY8h2pVdnNBdlscGvxHbSFkf2MEGrhKtAEy2ZuuwmrsjEDG c1iw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=TQBD/OAxUtcSOZmtzcQQpZnmVTcCC159GoHRqZltZ1g=; b=hFujYJrv8G2tJ8ALOiRlpowi+NnN644dA1jBA2dBQt1I8cPQdfGnwqy9RS/XaO8q5H 5cpJTRgAa/oQHvd/9UeOP16ApQ1s1Vi1lkdh3+7sYyqLGCyIIBMyL/Xj2vBB0E/WAskT QiHD3k2nUe8OYY5o5DBiBA0mWHL7uoVS8c5b+V6r2z1pYBHVlnFiccujnnr6OfEAv8SI FfuPxDQZQTFPRbSvWD+DgJcrgcbhdLXwRRVInaEfP/omJIC+o+XRCY8IPbzwiZ4jpUGY U212PIzSCyVhVnuwrfnST7F2XRLWawA4PIB8qnvU3STOqzUzcWq+Ys61txos1WZnuzUJ 25wQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=ov0XfbUN; 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=fail (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 v16si7508166uam.137.2021.10.04.06.55.37 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 04 Oct 2021 06:55:37 -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=fail header.i=@linaro.org header.s=google header.b=ov0XfbUN; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:59218 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mXORM-00024Y-UJ for patch@linaro.org; Mon, 04 Oct 2021 09:55:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38812) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mXOK0-0006PQ-4H for qemu-devel@nongnu.org; Mon, 04 Oct 2021 09:48:00 -0400 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]:44967) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mXOJw-0007Ly-I2 for qemu-devel@nongnu.org; Mon, 04 Oct 2021 09:47:59 -0400 Received: by mail-wr1-x434.google.com with SMTP id s15so2694948wrv.11 for ; Mon, 04 Oct 2021 06:47:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=TQBD/OAxUtcSOZmtzcQQpZnmVTcCC159GoHRqZltZ1g=; b=ov0XfbUN7RWPDxWk7AEa44foB/4d9y8T3IYlzRG7z0rwxxitpBOIBAbMUXr2q1mqcP p6psSNpzErYM63Nd0IFF3HCO3WFnRnwzBysoZ2wte1Ia641hhN9YaycrMRapMdbUlbtF qSv9b+56kjt8S5b/cwXiuI8Z3B6rkQSNMvA2nK2njZTFWR//zJuUV4AH54i+Y9jLBjSr LCqpjCtHVfrf1U2gTvgOTvlZYS36lLOqlHz3+VYGNvhM7PfKXZ8YupzEpd53OLQH4VV0 97nzoLowGVBgMvjuMdJ8ocAjm7lXveXAbrdeTqAWpF+Zie2+toNUx7hvQ4z4Z/zQ4KEe PTbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=TQBD/OAxUtcSOZmtzcQQpZnmVTcCC159GoHRqZltZ1g=; b=1+Vok8Q7J0qEto9LY4R6qzyNp3D2Gqktaf3m2/m7/TRHrnO2p6OD/IGvWBWDPfa9Ln 6eLRz/wUFt06N5gV5carVwuUds+dpv2IqV0qNCfdiyUyrIaQVxpGMu6TtUVtNKMDRCIf pt35BhhByBEj0g/dpmbl685tKEODOdrwfIAxCKiZaxz6FlemzebrRA972+uTW5gsAm02 NJni+PZgy674yN6Xbc3TVhbswKhZUEYXD6X/t2LCURXH/CZttIByop+SjLl72XrvIrcs Puscuvw45h+THbjKZOQJKm4TRurHdA1bghiVYc/mXBkPH50BPNWW0Dl+1SmqqguhlCxw 63Nw== X-Gm-Message-State: AOAM533FmGkiJr/nE2wTCINW9UKc4mSAf2DlXlI+BwMUBwR14U8LUZWP /cQ5vhjjCSYP1xWss5D/1FD5VA== X-Received: by 2002:a5d:4481:: with SMTP id j1mr14797550wrq.6.1633355274037; Mon, 04 Oct 2021 06:47:54 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id v17sm4408981wrm.30.2021.10.04.06.47.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Oct 2021 06:47:46 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 747B51FF9C; Mon, 4 Oct 2021 14:47:42 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 5/7] hw/arm/bcm2836: Add the BCM2711 which uses a GICv2 Date: Mon, 4 Oct 2021 14:47:39 +0100 Message-Id: <20211004134742.2044280-6-alex.bennee@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211004134742.2044280-1-alex.bennee@linaro.org> References: <20211004134742.2044280-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::434; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x434.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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , qemu-arm@nongnu.org, =?utf-8?q?Alex_Benn=C3=A9e?= , f4bug@amsat.org, Andrew Baumann Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé The BCM2711 is improvement of the BCM2837: - Cortex-A72 instead of the A53 - peripheral block and local soc controller are mapped differently, - GICv2 - PCIe block - exhanced MMU to address over 4GiB of SDRAM See https://www.raspberrypi.org/forums/viewtopic.php?t=244479&start=25 and https://patchwork.kernel.org/patch/11053097/ This patch starts mapping the GICv2 but interrupt lines are NOT wired (yet). This is enough to start running the Ubuntu kernel8.img from [1]. Extract the kernel with: $ mkdir bootpart $ guestfish \ --ro \ -a ubuntu-18.04.3-preinstalled-server-arm64+raspi4.img \ -m /dev/sda1 Welcome to guestfish, the guest filesystem shell for editing virtual machine filesystems and disk images. > ls / COPYING.linux LICENCE.broadcom System.map armstub8-gic.bin bcm2710-rpi-3-b-plus.dtb bcm2710-rpi-3-b.dtb bcm2710-rpi-cm3.dtb bcm2711-rpi-4-b.dtb bcm2837-rpi-3-b-plus.dtb bcm2837-rpi-3-b.dtb cmdline.txt config.txt fixup4.dat fixup4cd.dat fixup4db.dat fixup4x.dat kernel8.img overlays start4.elf start4cd.elf start4db.elf start4x.elf > copy-out / bootpart/ > q Then some progress can be noticed running: $ qemu-system-aarch64 -d unimp,guest_errors,int,in_asm \ -M raspi4 \ -kernel bootpart/kernel8.img \ -dtb bootpart/bcm2711-rpi-4-b.dtb \ -initrd bootpart/boot/initrd.img \ -append \ "earlycon=pl011,0xfe201000 console=ttyAMA0 console=tty1 loglevel=8" Not very interesting, but it runs until configuring the GIC. (remove 'in_asm' if too verbose). TODO: - wire IRQs to the GIC :) - map the SPI bootrom from [3] (boot sequence: [4]) - per [2] we could try booting without using the GIC, adding "enable_gic=0" in config.txt. this variable is parsed by the firmware: $ fgrep -r enable_gic bootpart Binary file bootpart/start4x.elf matches Binary file bootpart/start4.elf matches Binary file bootpart/start4db.elf matches Binary file bootpart/start4cd.elf matches bootpart/config.txt:enable_gic=1 the stub [5] doesn't seem to check a register for it. maybe it falls back to kernel7l? - decompile start4.elf to check how 'enable_gic' is used using vc4 toolchain from [6] [1] https://github.com/TheRemote/Ubuntu-Server-raspi4-unofficial/releases [2] https://jamesachambers.com/raspberry-pi-ubuntu-server-18-04-2-installation-guide/ [3] https://www.raspberrypi.org/documentation/hardware/raspberrypi/booteeprom.md [4] https://raspberrypi.stackexchange.com/questions/10442/what-is-the-boot-sequence [5] https://github.com/raspberrypi/tools/commit/7f4a937e1bacbc111a22552169bc890b4bb26a94#diff-8c41083e9fa0c98f1c3015e11b897444 [6] https://github.com/christinaa/rpi-open-firmware Signed-off-by: Philippe Mathieu-Daudé [AJB: QOM fixes and 2711 rename] Signed-off-by: Alex Bennée --- vAJB: - fix QOM operations following refactoring since last post - rename to BCM2711 - use sysbus_realize(SYS_BUS_DEVICE(&s->gic) - move peri_base/ctrl to locations pointed to by DTB (0x7e000000/0x40000000) --- include/hw/arm/bcm2836.h | 3 ++ hw/arm/bcm2836.c | 77 ++++++++++++++++++++++++++++++++++++++++ hw/arm/raspi.c | 2 ++ 3 files changed, 82 insertions(+) -- 2.30.2 diff --git a/include/hw/arm/bcm2836.h b/include/hw/arm/bcm2836.h index 6f90cabfa3..c8f64fa06d 100644 --- a/include/hw/arm/bcm2836.h +++ b/include/hw/arm/bcm2836.h @@ -14,6 +14,7 @@ #include "hw/arm/bcm2835_peripherals.h" #include "hw/intc/bcm2836_control.h" +#include "hw/intc/arm_gic.h" #include "target/arm/cpu.h" #include "qom/object.h" @@ -29,6 +30,7 @@ OBJECT_DECLARE_TYPE(BCM283XState, BCM283XClass, BCM283X) #define TYPE_BCM2835 "bcm2835" #define TYPE_BCM2836 "bcm2836" #define TYPE_BCM2837 "bcm2837" +#define TYPE_BCM2711 "bcm2711" struct BCM283XState { /*< private >*/ @@ -40,6 +42,7 @@ struct BCM283XState { struct { ARMCPU core; } cpu[BCM283X_NCPUS]; + GICState gic; BCM2836ControlState control; BCM2835PeripheralState peripherals; }; diff --git a/hw/arm/bcm2836.c b/hw/arm/bcm2836.c index 255ba8265a..99dc15e6e4 100644 --- a/hw/arm/bcm2836.c +++ b/hw/arm/bcm2836.c @@ -25,6 +25,7 @@ typedef struct BCM283XClass { unsigned core_count; hwaddr peri_base; /* Peripheral base address seen by the CPU */ hwaddr ctrl_base; /* Interrupt controller and mailboxes etc. */ + hwaddr gic_base; int clusterid; } BCM283XClass; @@ -36,6 +37,15 @@ typedef struct BCM283XClass { static Property bcm2836_enabled_cores_property = DEFINE_PROP_UINT32("enabled-cpus", BCM283XState, enabled_cpus, 0); +#define GIC_NUM_IRQS 256 + +#define GIC_BASE_OFS 0x0000 +#define GIC_DIST_OFS 0x1000 +#define GIC_CPU_OFS 0x2000 +#define GIC_VIFACE_THIS_OFS 0x4000 +#define GIC_VIFACE_OTHER_OFS(cpu) (0x5000 + (cpu) * 0x200) +#define GIC_VCPU_OFS 0x6000 + static void bcm2836_init(Object *obj) { BCM283XState *s = BCM283X(obj); @@ -56,6 +66,10 @@ static void bcm2836_init(Object *obj) TYPE_BCM2836_CONTROL); } + if (bc->gic_base) { + object_initialize_child(obj, "gic", &s->gic, TYPE_ARM_GIC); + } + object_initialize_child(obj, "peripherals", &s->peripherals, TYPE_BCM2835_PERIPHERALS); object_property_add_alias(obj, "board-rev", OBJECT(&s->peripherals), @@ -126,6 +140,50 @@ static void bcm2836_realize(DeviceState *dev, Error **errp) sysbus_mmio_map(SYS_BUS_DEVICE(&s->control), 0, bc->ctrl_base); + /* bcm2838 GICv2 */ + if (bc->gic_base) { + if (!object_property_set_uint(OBJECT(&s->gic), "revision", 2, errp)) { + return; + } + + if (!object_property_set_uint(OBJECT(&s->gic), "num-cpu", + BCM283X_NCPUS, errp)) { + return; + } + + if (!object_property_set_uint(OBJECT(&s->gic), "num-irq", + 32 + GIC_NUM_IRQS, errp)) { + return; + } + + if (!object_property_set_bool(OBJECT(&s->gic), + "has-virtualization-extensions", + true, errp)) { + return; + } + + if (!sysbus_realize(SYS_BUS_DEVICE(&s->gic), errp)) { + return; + } + + sysbus_mmio_map(SYS_BUS_DEVICE(&s->gic), 0, + bc->ctrl_base + bc->gic_base + GIC_DIST_OFS); + sysbus_mmio_map(SYS_BUS_DEVICE(&s->gic), 1, + bc->ctrl_base + bc->gic_base + GIC_CPU_OFS); + sysbus_mmio_map(SYS_BUS_DEVICE(&s->gic), 2, + bc->ctrl_base + bc->gic_base + GIC_VIFACE_THIS_OFS); + sysbus_mmio_map(SYS_BUS_DEVICE(&s->gic), 3, + bc->ctrl_base + bc->gic_base + GIC_VCPU_OFS); + + for (n = 0; n < BCM283X_NCPUS; n++) { + sysbus_mmio_map(SYS_BUS_DEVICE(&s->gic), 4 + n, + bc->ctrl_base + bc->gic_base + + GIC_VIFACE_OTHER_OFS(n)); + } + + /* TODO wire IRQs!!! */ + } + sysbus_connect_irq(SYS_BUS_DEVICE(&s->peripherals), 0, qdev_get_gpio_in_named(DEVICE(&s->control), "gpu-irq", 0)); sysbus_connect_irq(SYS_BUS_DEVICE(&s->peripherals), 1, @@ -216,6 +274,21 @@ static void bcm2837_class_init(ObjectClass *oc, void *data) bc->clusterid = 0x0; dc->realize = bcm2836_realize; }; + +static void bcm2711_class_init(ObjectClass *oc, void *data) +{ + DeviceClass *dc = DEVICE_CLASS(oc); + BCM283XClass *bc = BCM283X_CLASS(oc); + + bc->cpu_type = ARM_CPU_TYPE_NAME("cortex-a72"); + bc->core_count = BCM283X_NCPUS; + bc->peri_base = 0x7e000000; + bc->ctrl_base = 0x40000000; + bc->clusterid = 0x0; + bc->gic_base = 0x40000, + dc->realize = bcm2836_realize; +} + #endif static const TypeInfo bcm283x_types[] = { @@ -232,6 +305,10 @@ static const TypeInfo bcm283x_types[] = { .name = TYPE_BCM2837, .parent = TYPE_BCM283X, .class_init = bcm2837_class_init, + }, { + .name = TYPE_BCM2711, + .parent = TYPE_BCM283X, + .class_init = bcm2711_class_init, #endif }, { .name = TYPE_BCM283X, diff --git a/hw/arm/raspi.c b/hw/arm/raspi.c index 3fb1c3138b..03f54887f4 100644 --- a/hw/arm/raspi.c +++ b/hw/arm/raspi.c @@ -71,6 +71,7 @@ typedef enum RaspiProcessorId { PROCESSOR_ID_BCM2835 = 0, PROCESSOR_ID_BCM2836 = 1, PROCESSOR_ID_BCM2837 = 2, + PROCESSOR_ID_BCM2711 = 3, } RaspiProcessorId; static const struct { @@ -80,6 +81,7 @@ static const struct { [PROCESSOR_ID_BCM2835] = {TYPE_BCM2835, 1}, [PROCESSOR_ID_BCM2836] = {TYPE_BCM2836, BCM283X_NCPUS}, [PROCESSOR_ID_BCM2837] = {TYPE_BCM2837, BCM283X_NCPUS}, + [PROCESSOR_ID_BCM2711] = {TYPE_BCM2711, BCM283X_NCPUS}, }; static uint64_t board_ram_size(uint32_t board_rev) From patchwork Mon Oct 4 13:47:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 515208 Delivered-To: patch@linaro.org Received: by 2002:adf:fbc8:0:0:0:0:0 with SMTP id d8csp4372909wrs; Mon, 4 Oct 2021 06:53:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxLZ8boZSFGo+/tCCvN3M46lSdzHZkYNfLa8a5xMBS7pzgaC1/GiaxO8h+PHfF4qLC3V12b X-Received: by 2002:a05:622a:1206:: with SMTP id y6mr13120921qtx.68.1633355590290; Mon, 04 Oct 2021 06:53:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633355590; cv=none; d=google.com; s=arc-20160816; b=DR2LchmShS4SJx33KOCqiQHS03JRhfqsfqPQSwNF1Z+yvA4jAU5szWZmFmC5mOmH0P N1BzbZZljgcACi1EFE/qt/AhYuOOQw8Z/WWNa41eFai/FE079ayj7gJd2pZ+4nAtC9+P 8dUaO9c4d66MB4jaeKOGEkClBTeO/FMjqY1L8upEGkeSyuzgXC9qEq3R09D+uSyLJSCS 6GO6c160yQYkj9EiFUjXBkb52fKlsfgAbTcM1oISewGeBXxDD36NFMY9uNGDgr6B9mQ0 VvPOsuC1LuaagKVC2PXjkX7CK3T1Uy9l3CJG2QxO+B8iff+Bplm3KOBSy0ZgAx5jhevC 63Sw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=1v9TqC347QTL0iy7WAjvcLe/L9RSHF/zcwT3VIh2fdQ=; b=zZl1rxLXRjFx81DHzvwYH/NmhPY5+A4kpo3xiZ+cmm3KQ29MLLUyK+vDcCxYrggfDb 64mprvzmHS/gAYda1jFTBEwPvc6yyBjgRp77nw++VLIEo3YHN7d98xE+6IQLSTl4RHv1 4PrfdzcHS+Bk8oCNua++eIYsUSiH94ar1FkYl8Y6onSHuZv4iHccN63GrK6llyBG5Php 6piUfaH4FrNCFy1aa77DUYIPGXLfQmSAW1HRMlK4k02MZWZwEIJ6MPVYI1gLEyo/ieHB OxbJ+88Pw542sZX0zJLL/GdA5/6NdLveRcOzOOqTAstAGdkSzSZjQAVdIuNiKWE9np+h vszQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=njtQ0dVf; 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=fail (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 i10si2426100vso.410.2021.10.04.06.53.10 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 04 Oct 2021 06:53:10 -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=fail header.i=@linaro.org header.s=google header.b=njtQ0dVf; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:51510 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mXOOz-0005GS-Kx for patch@linaro.org; Mon, 04 Oct 2021 09:53:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38808) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mXOJz-0006Lq-AF for qemu-devel@nongnu.org; Mon, 04 Oct 2021 09:47:59 -0400 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]:45615) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mXOJw-0007K9-ID for qemu-devel@nongnu.org; Mon, 04 Oct 2021 09:47:59 -0400 Received: by mail-wr1-x432.google.com with SMTP id r10so14419072wra.12 for ; Mon, 04 Oct 2021 06:47:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=1v9TqC347QTL0iy7WAjvcLe/L9RSHF/zcwT3VIh2fdQ=; b=njtQ0dVf5j3EEH+pgtVEKnkijA0Oct5X3sPFi+01MybE4XtM8Mcx4c9BmRyc57QA99 cPAC1pgcuD7LG7ex2A33qPvv9AnQ3ieGBOY6cZq4L8zKtWbeikkLeQS1T0Hol1R6Scfm 4KrCYHIN28lJzn6TWaAUfSiak96V5cyd1leFjlPPWusaqXjXgyx5P4aeog647lDkhJHN mu7MDmziS+NPI51qClZ1TX+43nSeDgjsRXpJxZOIhzZLmOZVEO0yaC/vPFMViBUkPaUi HMLvL/QX0f1rDS+b33qeDT+PaWpBDqHld/F/SaCVVeZBJcRiGKgRfeBEIvN8XMPra4TI FLxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=1v9TqC347QTL0iy7WAjvcLe/L9RSHF/zcwT3VIh2fdQ=; b=PJ0Ryca2v2VjzcZIZ4DDAYAB0JtdSoDdPar5MOz4dMaN+f9jWJ3u/iA+0D42qeOXEd IQbBnQeNnqs+nmPJNOQepzN9xxZXnMn7WjNmPqY9I7GWr4QaItiedFV3Xln2RtLClZur aFT7g/pbsThHvFLNcrBFyltPeqsVUpw8pIgzrWyse1yaii498/k9+d1yLq0oqT12KvCo 5nY/aQpY1jYwgCioXAdEybAuZ3P/yOxJ0NsHubYXemiZe0sfDg7uZFYGcgxOvQ0mqJc5 azhUgC+HfQdrAd4sAtrrbRbkbf3nAg3+D9QNh1lLRq3k+nbBXI//28/oilYZPDvUBvaA kRjQ== X-Gm-Message-State: AOAM5325LW7Bcrt9b4F5m4lH4fOolnD/MzMsRNXP0wnd+FUqB26+GJqf xUHP9xQKXXFH1hfBbmv5nm8Alg== X-Received: by 2002:adf:f4c6:: with SMTP id h6mr15086947wrp.397.1633355273021; Mon, 04 Oct 2021 06:47:53 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id l2sm15890463wmi.1.2021.10.04.06.47.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Oct 2021 06:47:46 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 8AFBE1FF9D; Mon, 4 Oct 2021 14:47:42 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 6/7] hw/arm/bcm2838: Map the PCIe memory space Date: Mon, 4 Oct 2021 14:47:40 +0100 Message-Id: <20211004134742.2044280-7-alex.bennee@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211004134742.2044280-1-alex.bennee@linaro.org> References: <20211004134742.2044280-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::432; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x432.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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , qemu-arm@nongnu.org, =?utf-8?q?Alex_Benn=C3=A9e?= , f4bug@amsat.org, Andrew Baumann Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé The BCM2711 has a BCM54213 Gigabit Ethernet block mapped in the PCIe range. Signed-off-by: Philippe Mathieu-Daudé Signed-off-by: Alex Bennée --- FIXME: create the bcm54213-geth in raspi.c? vAJB: - fix for move of gic_base to bc --- hw/arm/bcm2836.c | 10 ++++++++++ 1 file changed, 10 insertions(+) -- 2.30.2 diff --git a/hw/arm/bcm2836.c b/hw/arm/bcm2836.c index 99dc15e6e4..ff62e741ce 100644 --- a/hw/arm/bcm2836.c +++ b/hw/arm/bcm2836.c @@ -15,6 +15,7 @@ #include "hw/arm/bcm2836.h" #include "hw/arm/raspi_platform.h" #include "hw/sysbus.h" +#include "hw/misc/unimp.h" typedef struct BCM283XClass { /*< private >*/ @@ -46,6 +47,8 @@ static Property bcm2836_enabled_cores_property = #define GIC_VIFACE_OTHER_OFS(cpu) (0x5000 + (cpu) * 0x200) #define GIC_VCPU_OFS 0x6000 +#define PCIE_BASE 0x7d500000 + static void bcm2836_init(Object *obj) { BCM283XState *s = BCM283X(obj); @@ -227,6 +230,13 @@ static void bcm2836_realize(DeviceState *dev, Error **errp) qdev_connect_gpio_out(DEVICE(&s->cpu[n].core), GTIMER_SEC, qdev_get_gpio_in_named(DEVICE(&s->control), "cntpsirq", n)); } + + /* bcm2838 kludge to easily create PCIe */ + if (bc->gic_base) { + create_unimplemented_device("bcm2838-pcie", PCIE_BASE, 0x100000); + create_unimplemented_device("bcm54213-geth", + PCIE_BASE + 0x80000, 0x10000); + } } static void bcm283x_class_init(ObjectClass *oc, void *data) From patchwork Mon Oct 4 13:47:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 515203 Delivered-To: patch@linaro.org Received: by 2002:adf:fbc8:0:0:0:0:0 with SMTP id d8csp4369398wrs; Mon, 4 Oct 2021 06:49:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwV7xsSJGuIfJEvu5156BttiH7zhY8iDvspCo2003722PT4qEELLys2flsBtDNd9fAE6fEG X-Received: by 2002:ab0:6c41:: with SMTP id q1mr7078493uas.16.1633355352480; Mon, 04 Oct 2021 06:49:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633355352; cv=none; d=google.com; s=arc-20160816; b=kCPNIg6VLa5vlxnoXnA4MDSjYo1M0f1ffnyNB6tgWT2z5NPIBLAdBv1JERn947FypS 5zgXcc/50ZuFTZSfq/puAyANGnbMXr1lzGPkng69fh44u3I5KGGSasr0SZwIqwQ8N2oq HUz+B4LsdzPL3u9eOqR+CSaceZTRq2+N+3E0mw+hZ/HKugab46tyjfErOB463negixgV Lt3YnV29M55csQjGPrN/pn4fhwlCSdEPRSMzaEiMWUFE5ZzxJHcNd/0maq4CzMa/vbtG q2xmPgNrhpumjCreF5pTeBs70WmCg/2k9MZxEuD7A0HT/GpJMSteDOGZu1WoqCwC5Mob eTag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=2XKksSNJpzNeevRjjy+0RRvABj/O0e/8A0w+HPwQEvE=; b=dbqBfbuCCy9zFienaS9wSF9Rdcb/Vajot1NASr6rRnZ663HxIbSSp5elJJnCc22qsn EqkXPwj9yua0ChW/ir3W3tWCOQvuBAgf16l8HXzkaUa1Y9uzJ89Rgh5obtzSXqITlr3Z dVpSDbhoHj1V5hMcPxrEFy1P8hiphHQID6MUTPJDTNfMNInWbzZqUL11lS24ceIbwdxl Bmtg67FioBaSJfrW3O0sfx5Lc4BeCjcHPRjOixm4FQV8+pSNqn1YJ8j0lIjPoAynQu8M pXz6YtSpJKJ1NyWC8iCYsKvjTfsEhzedASfQqp+RJYVbk3GSlGOsbZ8Rxx9SNiOM07oW 0JxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=f7tmgdTh; 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=fail (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 l13si9516458vsv.319.2021.10.04.06.49.12 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 04 Oct 2021 06:49:12 -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=fail header.i=@linaro.org header.s=google header.b=f7tmgdTh; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:41732 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mXOL9-0006yn-Qo for patch@linaro.org; Mon, 04 Oct 2021 09:49:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38770) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mXOJy-0006Ge-3q for qemu-devel@nongnu.org; Mon, 04 Oct 2021 09:47:58 -0400 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]:55820) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mXOJs-0007Ik-PD for qemu-devel@nongnu.org; Mon, 04 Oct 2021 09:47:57 -0400 Received: by mail-wm1-x32f.google.com with SMTP id v127so13493033wme.5 for ; Mon, 04 Oct 2021 06:47:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=2XKksSNJpzNeevRjjy+0RRvABj/O0e/8A0w+HPwQEvE=; b=f7tmgdThQJhz/46AoxeZAdAwLhUtYZHGEyLZq6KVONi5FNORKwuEXJ/EnGMb5fDf8o QEhe1lt9tAPwVGAofqzFQdXDSKbpCxudOpH7xt0i3YOItlBTVe8DSd+HZ4aycSBVW9DM gLIai21BOTecgVMnWPPmapFOaEqO542CO8spxanY+7v6t6Uk9xgBga6KG+cAFHduWb8t 0kCjYF/TnXZssJlsqUC0DCLGxzVOZunaWf6SY4kN04hBVW+Qdw/nRkGHCdBycm96s04M 9XxET0o9Tc0lyjFz+YIut+ZDyBl9GhSCG2+O2ic4Q+rZEbp44bAlocBzNiSlv5hHTPy5 V5jg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=2XKksSNJpzNeevRjjy+0RRvABj/O0e/8A0w+HPwQEvE=; b=mRJlkeIyRclo9sXYDGkYJ7GZTj5TxYpZamsUD/GWqWHQ/nUlcp8ADNaR3zUg0LqaIu j19g+RMoVbHgdypPzxnTFodp6KBp+5GjC3zcF9nKwI1YGvoQsWmWZtS32r+CltLVG9Hz LeJhvY3C5UmQC4dkIXtqi74MXDYldOP2f7kgwF0k+5tmek2LQhtxpSY9giXiMd7lEbTU InpfG2IosLsypeTWHNc+IE0qac3UoIW0NYQwhAvLFnAxQTqrdqc/fohEV961ZIPVG0zL 40iSTBzoRgjBaOD2DOm21oDob0frVdnCh4Ie+6UQ47O1bjt6XmkinbdCq/rB23UTzWwA ey2g== X-Gm-Message-State: AOAM53140+KRTtk2nJMbwM8PI4Ta33OYSGaKJ6Xps5DgKEH3jifWJIar FNyzthrVv/eg4XW3MwLEqE/zhg== X-Received: by 2002:a1c:f402:: with SMTP id z2mr18783275wma.53.1633355270873; Mon, 04 Oct 2021 06:47:50 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id l2sm15890484wmi.1.2021.10.04.06.47.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Oct 2021 06:47:46 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 9660D1FF9E; Mon, 4 Oct 2021 14:47:42 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 7/7] hw/arm/raspi: Add the Raspberry Pi 4B board Date: Mon, 4 Oct 2021 14:47:41 +0100 Message-Id: <20211004134742.2044280-8-alex.bennee@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211004134742.2044280-1-alex.bennee@linaro.org> References: <20211004134742.2044280-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32f.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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , qemu-arm@nongnu.org, =?utf-8?q?Alex_Benn=C3=A9e?= , f4bug@amsat.org, Andrew Baumann Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé The Raspberry Pi 4 uses a BCM2711 SoC (based on a BCM2838). Signed-off-by: Philippe Mathieu-Daudé Signed-off-by: Alex Bennée --- vAJB: - use 8gb version --- hw/arm/raspi.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) -- 2.30.2 diff --git a/hw/arm/raspi.c b/hw/arm/raspi.c index 03f54887f4..0342aeab03 100644 --- a/hw/arm/raspi.c +++ b/hw/arm/raspi.c @@ -369,6 +369,15 @@ static void raspi3b_machine_class_init(ObjectClass *oc, void *data) rmc->board_rev = 0xa02082; raspi_machine_class_common_init(mc, rmc->board_rev); }; + +static void raspi4b_machine_class_init(ObjectClass *oc, void *data) +{ + MachineClass *mc = MACHINE_CLASS(oc); + RaspiMachineClass *rmc = RASPI_MACHINE_CLASS(oc); + + rmc->board_rev = 0xd03114; + raspi_machine_class_common_init(mc, rmc->board_rev); +}; #endif /* TARGET_AARCH64 */ static const TypeInfo raspi_machine_types[] = { @@ -393,6 +402,10 @@ static const TypeInfo raspi_machine_types[] = { .name = MACHINE_TYPE_NAME("raspi3b"), .parent = TYPE_RASPI_MACHINE, .class_init = raspi3b_machine_class_init, + }, { + .name = MACHINE_TYPE_NAME("raspi4b"), + .parent = TYPE_RASPI_MACHINE, + .class_init = raspi4b_machine_class_init, #endif }, { .name = TYPE_RASPI_MACHINE,