From patchwork Mon Jan 10 17:50:58 2022 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: 530929 Delivered-To: patch@linaro.org Received: by 2002:ad5:544f:0:0:0:0:0 with SMTP id a15csp2815265imp; Mon, 10 Jan 2022 09:54:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJzUEv6cA4uNZdM923WlTNixlQLxgDQSS1umDk9GIJAavZAraqT0UmmjlzjJ0Tp1kxU0Fzqe X-Received: by 2002:a25:a061:: with SMTP id x88mr881985ybh.633.1641837249142; Mon, 10 Jan 2022 09:54:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1641837249; cv=none; d=google.com; s=arc-20160816; b=zwn/HC2SG2nJNT2W5hjLJb+gsHE0tUpf4DQwBwk0u1hMlx9QNrr93D/59Dk+YJNev2 cIFSZGxawEIdAvkYqGV1ygEUEYq1sebX4SjUbZ65rn/Nihw1NykQvvZ/Y4qfPIL6ALeu V6ao8uXZpIBujDc/9bYxYvAcYNIKWNVK72/r0zdRV/ftK0zwDaEH7odrH58HL9eJeCD8 yRsnqC6O7G4kgHpmpb+/n6PsXzJxqvbcEg30AKsYB3R9XyHWrBxCTdUt4GRPE2rCSI8B kWTBlw1vz4B0GNHl1t9EByYDflQCqz1Xd+PUnoMI2iB8mwalKyJEVlm4v4s6zxO/P7lv V1cg== 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:message-id:date:subject:to:from:dkim-signature; bh=QCOtE9+v3wBr9409lbw5s1G3XAXvyPfK1PegRWjwFqM=; b=tuR86vzEP/yYwOoS2ZBTFiAx1lzKo6rE91tILMFf8xPwWQ5P1RoO4YQu8/0HasNmXb 6k056t4cDza7Q3HtMZ8Wo1282XvyPhXSnZhJ+uRgHzCMC58pZIxWWyX1kg+BLzbfX4EQ zdt1pFz0v8CyR3chDSjCL0WZDT+3NoX5f/vMNg3EAFSEvumzEy2q/K4pD12bgx79eT22 3ToBppET+fQO2HxOCj7f+tkIWe8/dMW3UBpei3BYXbZIx7Fx8ntfmUaac2oB6I6ogaNc c5blBR12LWUeuXyrPVYq8jj4GRb4d+jIYoXi65OYtPpKoS4frhYTHdIxTokKA1HrzDDi Bfeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hSLMnrRF; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id c8si2232395ybq.765.2022.01.10.09.54.09 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 10 Jan 2022 09:54:09 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hSLMnrRF; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:49070 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n6yrw-0007uy-Li for patch@linaro.org; Mon, 10 Jan 2022 12:54:08 -0500 Received: from eggs.gnu.org ([209.51.188.92]:48050) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n6yp3-0007Fv-R2 for qemu-devel@nongnu.org; Mon, 10 Jan 2022 12:51:09 -0500 Received: from [2a00:1450:4864:20::52b] (port=34442 helo=mail-ed1-x52b.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n6yp1-00064p-NJ for qemu-devel@nongnu.org; Mon, 10 Jan 2022 12:51:09 -0500 Received: by mail-ed1-x52b.google.com with SMTP id u25so56803370edf.1 for ; Mon, 10 Jan 2022 09:51:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=QCOtE9+v3wBr9409lbw5s1G3XAXvyPfK1PegRWjwFqM=; b=hSLMnrRFzLELdh5TCQRRpg0tRVGtOBSsWn/vmKTiy9dFMqxIzNpTHpI3Jk7FWst2iq whLGmoisNGda51cP4edKw1lrlUR7rfwlYz60+fxg/iExScGioX8WJFS8rtOtSy73xlLO Xc1kokKocuv0xouVvHUSppvb+zzPxHftbTP46EXWrpkw9N0NiwHPcfn4O2AwnROugd5Y Zv4mfB8ZPQSygUWzbjR/o9Y8XPG+fiqgYvw0NGht/dY7wEK0DimLyNOThdeA/eDSYFgG eee7yz6+05Feh4MGsbsjVjCVT9Kh3hlrepFhKV6Z9p86yOySDfV5egywjAmclsKEKfvl uFmA== 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:mime-version :content-transfer-encoding; bh=QCOtE9+v3wBr9409lbw5s1G3XAXvyPfK1PegRWjwFqM=; b=Nl7EptvUJWunO510Zvhq8hsKNfo6BCOv66Pg5xrov3NI2O4sL9qCRUJEf78bI5ajyw +1RNgM5+Vhxl5H3LEtqK/ceccg9TOWUsfJuvj3SDjhYMwoJxNKnxDKwOfsYyx+BYpOgz 19aeaaCWRdDXA99bspsyl1+NYaFLmRNpe+KAvCrSrrSCtUGt2LiMqqjSMCeQYdggDGQ6 gqEqM7MVsBRI2vpeXw++8UEvAFJqB8JYZvxpcpjJYO6XuA+WkYNAe3NSJ61+Kvd5V5SQ 6oRICxMO1V9AzGN1YqHrMpTgapfqDcRZyxXMlqk6eEmDGF9+BUPKAHhT+8sMDwMQCBU0 uDLw== X-Gm-Message-State: AOAM533qaYqX90RDEqEcoy09twKGvQtxLltobIzO3vZdl+ALWWfFmNgT MlmifQruptBap5IXuXCLKyeakw== X-Received: by 2002:a17:907:2d27:: with SMTP id gs39mr645060ejc.235.1641837065966; Mon, 10 Jan 2022 09:51:05 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id 3sm2676990ejq.159.2022.01.10.09.51.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jan 2022 09:51:04 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 4AEF41FFB7; Mon, 10 Jan 2022 17:51:04 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [RFC PATCH 0/6] Basic skeleton of RP2040 Raspbery Pi Pico Date: Mon, 10 Jan 2022 17:50:58 +0000 Message-Id: <20220110175104.2908956-1-alex.bennee@linaro.org> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::52b (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::52b; envelope-from=alex.bennee@linaro.org; helo=mail-ed1-x52b.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 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, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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: , Cc: qemu-arm@nongnu.org, =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Hi, This is a rather incomplete and basic model of the Pico Pi that I hacked up over the Christmas break. It took me a bit of faffing about to get it up and running but as it stands it will now run the first few hundred instructions of the RP2040 mask ROM before looping waiting for CLK_SYS_SELECTED to update (which it never will as it is currently unimplemented). I don't know when I'll next get a chance to hack on it but I thought it was worth posting as a reference. If anyone has an inclination to take it further then at least the initial baby steps are done for you. There is no rush to review this although I am curious if anyone has comments about how the model is put together. It uses -kernel to load the user program (although it never gets there at the moment): qemu-system-arm -d unimp,guest_errors -M raspi-pico \ --kernel ~/mysrc/pico-air.rust/pico-air.git/target/thumbv6m-none-eabi/debug/rp2040-project-template \ -display none -serial mon:stdio Alex Bennée (6): hw/arm: arm initial boilerplate for RP2040 SoC hw/arm: add boilerplate for machines based on the RP2040 hw/arm: wire-up memory from the Pico board and the SoC pc-bios: add pipico mask rom (!upstream) hw/arm: add mask boot ROM logic docs/devel: add some clarifying text for aliases docs/devel/memory.rst | 14 +- configs/devices/arm-softmmu/default.mak | 2 + include/hw/arm/rp2040.h | 39 +++++ hw/arm/raspi_pico.c | 97 ++++++++++++ hw/arm/rp2040.c | 201 ++++++++++++++++++++++++ hw/arm/Kconfig | 6 + hw/arm/meson.build | 2 + pc-bios/pipico.rom | Bin 0 -> 16384 bytes 8 files changed, 356 insertions(+), 5 deletions(-) create mode 100644 include/hw/arm/rp2040.h create mode 100644 hw/arm/raspi_pico.c create mode 100644 hw/arm/rp2040.c create mode 100644 pc-bios/pipico.rom