From patchwork Mon Jan 10 17:50:59 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: 530928 Delivered-To: patch@linaro.org Received: by 2002:ad5:544f:0:0:0:0:0 with SMTP id a15csp2814867imp; Mon, 10 Jan 2022 09:53:33 -0800 (PST) X-Google-Smtp-Source: ABdhPJz5r2ArzT+rIdBjNnXfJ132T7UNFkNNSBlITdmuFKFkFaCKTc3RGLHxWIraPsPymVxD5d90 X-Received: by 2002:a05:6638:d01:: with SMTP id q1mr479479jaj.248.1641837213286; Mon, 10 Jan 2022 09:53:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1641837213; cv=none; d=google.com; s=arc-20160816; b=xudifQ2kqkgcf6GbgjxWw0+wjE9tmmXc6GLJC98MOlbeqg6ZgOYOj4VfXDmhEAXH1B 0r4Eq07j0vmd8drFo3QoOr8/vaiMr0xajS2U1cuyr+U11SOSJpiN8kMXYGw5sNhCM3bp BrTz+zcqyqbL/fNYgRaPZd87Z70vdFdQe7HDsnb05ErYluo1VED4vP4jBJJbYZMl/9t9 RvijDRs7Fd7pr1syBQRKbhHgkKsE3mNttB6EZu9iULy26Ccw2obray9j5SzNp8ZR59Y9 gEpZSt+hVwROo08ePHiuhjWLkhuPPf5aSFbAC0/pz2/zPZsBtsM8Fh/GTvh6SBX1qzM7 3orQ== 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=aPlRWwajZty+gYtXe8Pd0Kpsw2MjBegJ1SWvF23bN6c=; b=pCFduKbUUr8s39OyOboYxzFUrgCUgVDZZqfN31KTaZvIkAcmW8rKb8K40tWEVb+PhA fVyujJWZAbBP0CXtJqwJpuHcSt3bQTdpwgB9IyvApX/REvZLx40ujFqi6uMTN8DwT4hp aIqstnCysopJROjp+onpLd279cNM3Nj45cKeUrkUFYJ9MVEiRPUWW+mUgp5LX56lP3zw 7CsDflTdWyvyOtg5GExHpflYKAxIPqU7yC/CTFrpcTZPtZKxsvLmBALTuYs9xj6fLzU9 Hc013FrsTvm7otMJdxvcApBUMmfus3ZcDHORxxA6Br+0zd1Ncc7lE4Krmpwt7fu0v55N byKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=CN0E9jiH; 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 j19si3842977jat.70.2022.01.10.09.53.33 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 10 Jan 2022 09:53:33 -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=fail header.i=@linaro.org header.s=google header.b=CN0E9jiH; 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]:48224 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n6yrM-0007Hd-J8 for patch@linaro.org; Mon, 10 Jan 2022 12:53:32 -0500 Received: from eggs.gnu.org ([209.51.188.92]:48088) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n6yp5-0007GH-0S for qemu-devel@nongnu.org; Mon, 10 Jan 2022 12:51:11 -0500 Received: from [2a00:1450:4864:20::52e] (port=34445 helo=mail-ed1-x52e.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n6yp2-00064w-8K for qemu-devel@nongnu.org; Mon, 10 Jan 2022 12:51:10 -0500 Received: by mail-ed1-x52e.google.com with SMTP id u25so56803601edf.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:in-reply-to:references :mime-version:content-transfer-encoding; bh=aPlRWwajZty+gYtXe8Pd0Kpsw2MjBegJ1SWvF23bN6c=; b=CN0E9jiHXQuhS4PXifguVJu8uLzrxw2a2n+/UfM1sjd7LLENcE0t+CAQnjw+aruWw0 CbblcLlAb/n8cVvsAtyiSkxlSh3rF1K8C8XKke5dJ70LzKfKCMvhiZz+adrADeM+LV/9 TVvMGSPuTolVl7+omOeh5CIrbnZ3OVb18M+FhDMQjLh29ULReEHx8PpKqvD9DvffoUoj QQQl0PJ48RhqRU+Df6tUadXMBQMzFc8EPd7CPc9Qp3PtY+rTIh5rp4eHiqQ4JHhGbYB5 nwTrIczbMAILOgttznXEwIyYVRrlKQzJGWek18N/kCNOKyqWd4iUbOgtYuXh4mtTzsj2 9+qw== 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=aPlRWwajZty+gYtXe8Pd0Kpsw2MjBegJ1SWvF23bN6c=; b=YpK6LNB8r91xJ2gaeVCKvzQ7nWOrpIFgfk9Pg48dJK4i+jYePH0iYqUL8J9p5f/L1Y cwcyzs959pgJHXF/kuxylw22LDrF7MvSSIEyDm5KxM4GJeGr3HMcKhWigVQp6O57yE2B 4DVDmzirzffjO9m+pwbrpvQfF8DYDR8B3DCOp2qh9BdVrTrQ+CaHNPTqqaDDGTK0hgFt zY1JLrTDPLgAkJ6tm0Iz5lcKQbB63Lr8m9X0JfY6QRWQgoUh3zPwenNGM2aHz2w3wTKX HMVKVkOMzhN5G0c5DwkUjXLjQb40WJqnJLzcKSDujjI6eYQC0YSeJU9gCgM1PL4xr1cE npWA== X-Gm-Message-State: AOAM531cbGAduBXVcuLTzGhCpHA4izURNjIyjkabx1D4Lrr08FG4MAs1 6okwWGdYb61aVzvWF/yiMO6ZQA== X-Received: by 2002:a17:907:d07:: with SMTP id gn7mr661622ejc.553.1641837066763; Mon, 10 Jan 2022 09:51:06 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id gn8sm2676578ejc.23.2022.01.10.09.51.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jan 2022 09:51:05 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 6044A1FFB8; 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 1/6] hw/arm: arm initial boilerplate for RP2040 SoC Date: Mon, 10 Jan 2022 17:50:59 +0000 Message-Id: <20220110175104.2908956-2-alex.bennee@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220110175104.2908956-1-alex.bennee@linaro.org> References: <20220110175104.2908956-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::52e (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::52e; envelope-from=alex.bennee@linaro.org; helo=mail-ed1-x52e.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: Peter Maydell , qemu-arm@nongnu.org, =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé --- configs/devices/arm-softmmu/default.mak | 1 + include/hw/arm/rp2040.h | 32 ++++++++++ hw/arm/rp2040.c | 79 +++++++++++++++++++++++++ hw/arm/Kconfig | 3 + hw/arm/meson.build | 1 + 5 files changed, 116 insertions(+) create mode 100644 include/hw/arm/rp2040.h create mode 100644 hw/arm/rp2040.c diff --git a/configs/devices/arm-softmmu/default.mak b/configs/devices/arm-softmmu/default.mak index 6985a25377..dce1c39aad 100644 --- a/configs/devices/arm-softmmu/default.mak +++ b/configs/devices/arm-softmmu/default.mak @@ -32,6 +32,7 @@ CONFIG_NETDUINO2=y CONFIG_NETDUINOPLUS2=y CONFIG_MPS2=y CONFIG_RASPI=y +CONFIG_RP2040=y CONFIG_DIGIC=y CONFIG_SABRELITE=y CONFIG_EMCRAFT_SF2=y diff --git a/include/hw/arm/rp2040.h b/include/hw/arm/rp2040.h new file mode 100644 index 0000000000..6bf4a4e57e --- /dev/null +++ b/include/hw/arm/rp2040.h @@ -0,0 +1,32 @@ +/* + * RP2040 SoC Emulation + * + * Copyright (c) 2021 Linaro Ltd + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#ifndef _RP2040_H_ +#define _RP2040_H_ + +#include "target/arm/cpu.h" +#include "hw/arm/armv7m.h" +#include "qom/object.h" + +#define TYPE_RP2040 "rp2040" +OBJECT_DECLARE_TYPE(RP2040State, RP2040Class, RP2040) + +#define RP2040_NCPUS 2 + +struct RP2040State { + /*< private >*/ + DeviceState parent_obj; + /*< public >*/ + + ARMv7MState armv7m[RP2040_NCPUS]; + + MemoryRegion container; +}; + + +#endif /* _RP2040_H_ */ diff --git a/hw/arm/rp2040.c b/hw/arm/rp2040.c new file mode 100644 index 0000000000..2feedc0da8 --- /dev/null +++ b/hw/arm/rp2040.c @@ -0,0 +1,79 @@ +/* + * RP2040 SoC Emulation + * + * Copyright (c) 2021 Linaro Ltd + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "qemu/osdep.h" +#include "qapi/error.h" +#include "qemu/module.h" +#include "hw/arm/armv7m.h" +#include "hw/arm/rp2040.h" +#include "hw/sysbus.h" +#include "hw/qdev-properties.h" + +typedef struct RP2040Class { + /*< private >*/ + DeviceClass parent_class; + /*< public >*/ + const char *name; + const char *cpu_type; +} RP2040Class; + +#define RP2040_CLASS(klass) \ + OBJECT_CLASS_CHECK(RP2040Class, (klass), TYPE_RP2040) +#define RP2040_GET_CLASS(obj) \ + OBJECT_GET_CLASS(RP2040Class, (obj), TYPE_RP2040) + +static void rp2040_init(Object *obj) +{ + RP2040State *s = RP2040(obj); + int n; + + for (n = 0; n < RP2040_NCPUS; n++) { + g_autofree char *name = g_strdup_printf("cpu[%d]", n); + object_initialize_child(obj, name, &s->armv7m[n], TYPE_ARMV7M); + qdev_prop_set_string(DEVICE(&s->armv7m[n]), "cpu-type", + ARM_CPU_TYPE_NAME("cortex-m0")); + } +} + +static void rp2040_realize(DeviceState *dev, Error **errp) +{ + RP2040State *s = RP2040(dev); + Object *obj = OBJECT(dev); + int n; + + for (n = 0; n < RP2040_NCPUS; n++) { + Object *cpuobj = OBJECT(&s->armv7m[n]); + if (!sysbus_realize(SYS_BUS_DEVICE(cpuobj), errp)) { + return; + } + } +} + +static void rp2040_class_init(ObjectClass *oc, void *data) +{ + DeviceClass *dc = DEVICE_CLASS(oc); + RP2040Class *bc = RP2040_CLASS(oc); + + bc->cpu_type = ARM_CPU_TYPE_NAME("cortex-m0"); + dc->realize = rp2040_realize; + /* any props? */ +}; + +static const TypeInfo rp2040_types[] = { + { + .name = TYPE_RP2040, + /* .parent = TYPE_SYS_BUS_DEVICE, */ + .parent = TYPE_DEVICE, + .instance_size = sizeof(RP2040State), + .instance_init = rp2040_init, + .class_size = sizeof(RP2040Class), + .class_init = rp2040_class_init, + } +}; + +DEFINE_TYPES(rp2040_types) diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig index e652590943..1c5150c180 100644 --- a/hw/arm/Kconfig +++ b/hw/arm/Kconfig @@ -203,6 +203,9 @@ config REALVIEW select DS1338 # I2C RTC+NVRAM select USB_OHCI +config RP2040 + bool + config SBSA_REF bool imply PCI_DEVICES diff --git a/hw/arm/meson.build b/hw/arm/meson.build index 721a8eb8be..9f1b040c57 100644 --- a/hw/arm/meson.build +++ b/hw/arm/meson.build @@ -40,6 +40,7 @@ arm_ss.add(when: 'CONFIG_STRONGARM', if_true: files('strongarm.c')) arm_ss.add(when: 'CONFIG_ALLWINNER_A10', if_true: files('allwinner-a10.c', 'cubieboard.c')) arm_ss.add(when: 'CONFIG_ALLWINNER_H3', if_true: files('allwinner-h3.c', 'orangepi.c')) arm_ss.add(when: 'CONFIG_RASPI', if_true: files('bcm2835_peripherals.c', 'bcm2836.c', 'raspi.c')) +arm_ss.add(when: 'CONFIG_RP2040', if_true: files('rp2040.c')) arm_ss.add(when: 'CONFIG_STM32F100_SOC', if_true: files('stm32f100_soc.c')) arm_ss.add(when: 'CONFIG_STM32F205_SOC', if_true: files('stm32f205_soc.c')) arm_ss.add(when: 'CONFIG_STM32F405_SOC', if_true: files('stm32f405_soc.c')) From patchwork Mon Jan 10 17:51:00 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: 530931 Delivered-To: patch@linaro.org Received: by 2002:ad5:544f:0:0:0:0:0 with SMTP id a15csp2816949imp; Mon, 10 Jan 2022 09:56:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJwzq2f9XgMcLEXlaN7X63yNm+2cf5ejbULe+zhdmu67Tgua7cj7TvQDxXrZz7qOS+S8gjih X-Received: by 2002:a25:8b85:: with SMTP id j5mr917977ybl.558.1641837411319; Mon, 10 Jan 2022 09:56:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1641837411; cv=none; d=google.com; s=arc-20160816; b=Q9Hrvka7K+vUPkfEzH4Lbws4ua62m8WCRf8a9kaiXEWfHgqwqmDh0NgmBmQ2z+FoLm ljqSuGlQXILBtbJ+TFNfu9cLuA/Wrb3GAYy6WYrTCuBD//g0B1mgR83w0WkLIIK9MYvU cjb2GwZYUlgtb5tQCXNS1EyEKEAAspS+WPgQh4m9BMTbM8JxEj0L+FuKkvyYiS32s2/n Ic4cOdJhlKFcacOa3tyvAPmEqLodPo2q4diLd+r3btKq4ORQ0IQ3auUIO2drplOKQXLB mdnItSH+TrimnKWQ7Xl1XOkUq4KAQTqCUdDVPUorDXwkRht8MiEIHhEOeJC+76sTvvod Ct4g== 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=s37pAm4HQOAZRwNJTmM9aAqFUYvQliPZCH6R3Hng4k4=; b=lib4zsSaKX+Wd9iUHDH74yOkZppBuVpM/y8/KwyijF1sEVwlg03sAYfHHmFM5MZhUc aYh3MVFdre/UW7/BbqY/1T+Ntd2nOPPWMr4AhY6QRBQxNu08ekOdWpFFTnt0vtgP7hBA gD+ZjmLoFOBf4fQ8lAfHV+Gyi+nOMB8kfTEd2YEfXIhQ16uTanxevQ1UHEyENUetYZbQ k90PfEN60vrJVF9LUNaFHHDLLoyukjbNKmVehCkKAl35AD4Xrh+CYxt4s8SM45AyqYcm JFN/lx26auRnCHsEJeUB3eG1GsfANRPXrlN/GHgC758Vq2lV8DiIh81meP42ChbGb1aw SafQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=JJd7Q7tD; 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 184si5475757ybq.116.2022.01.10.09.56.51 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 10 Jan 2022 09:56:51 -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=fail header.i=@linaro.org header.s=google header.b=JJd7Q7tD; 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]:55594 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n6yuU-0003vy-Uh for patch@linaro.org; Mon, 10 Jan 2022 12:56:50 -0500 Received: from eggs.gnu.org ([209.51.188.92]:48114) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n6yp5-0007HV-SI for qemu-devel@nongnu.org; Mon, 10 Jan 2022 12:51:11 -0500 Received: from [2a00:1450:4864:20::52b] (port=35776 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 1n6yp4-00065M-3d for qemu-devel@nongnu.org; Mon, 10 Jan 2022 12:51:11 -0500 Received: by mail-ed1-x52b.google.com with SMTP id q25so48134126edb.2 for ; Mon, 10 Jan 2022 09:51:09 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=s37pAm4HQOAZRwNJTmM9aAqFUYvQliPZCH6R3Hng4k4=; b=JJd7Q7tDyTeC6SoIHTKmKWyPLO09P4Y4qmBs2xP5HPajMskS8tPoYxa1yap99gEKYj RiJ6jlltUKDer6Xe9prfgsnMxOhXMIWQZ1wiZCNSHRNg8v6RaRMgDEtCFMSUEvcoxZyA sYoIo14oBihOmjURfYi+1ZRM5LgDh6iOIHqVwgHdXDwtBi7F4R7RnVJOP/U1G/cZgQpr ziy5htp8DvZh6Pf8OaB1HO17DnHDFZom25aGqUFR2xEanOBaD5L3JLbHZW95tYq8KRgF QJh+YLAQMKJdDxkBhNAh/eGXQh6tgU76h41J7WI09AT/ILyWg1rd25Fb9tw8nhPSK4gs sUSg== 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=s37pAm4HQOAZRwNJTmM9aAqFUYvQliPZCH6R3Hng4k4=; b=STN+58BxNY6q+KCTriBK3aInj7qn7DUcEtPgYV6unO856cLXXc9VcF/ppeR2PY5gbv KZIo22e1HtoVXTRNq1OJ1ZyMRV/3Ikah+e6OG15L7Q5E/hfW3ilHxl2jzyj3+aZO4+Y2 aivfBUdToxllVKRKeM1wlnrWZm6BffXoLFGtGXESVAEfSUCqFbS0todeaD/Xz7TKdrIR 0FdQ0AOWrne6wta6JlIvJrvgLyStqYb7X3JQ5/i/ipww4lIcDE9cX+L2y2HnvIjPuWlt RueDQDIZ4F9+Z6u77dZZeYOVyKTWIauTzwiN72CiQ/wlE+kaqHWJKQSGdmT3sx5b9voo nfnQ== X-Gm-Message-State: AOAM531pQDt/Jr7dbGBx+4nVkUGeqcxD6W5h2O+tOWXammoyDwdIw/oy qQZ7/XmYqKwmTCy9TAvJ9hFokg== X-Received: by 2002:a17:907:2d0e:: with SMTP id gs14mr674532ejc.472.1641837068666; Mon, 10 Jan 2022 09:51:08 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id a1sm3828963edu.17.2022.01.10.09.51.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jan 2022 09:51:06 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 7DE8B1FFBA; 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 2/6] hw/arm: add boilerplate for machines based on the RP2040 Date: Mon, 10 Jan 2022 17:51:00 +0000 Message-Id: <20220110175104.2908956-3-alex.bennee@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220110175104.2908956-1-alex.bennee@linaro.org> References: <20220110175104.2908956-1-alex.bennee@linaro.org> 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: Peter Maydell , qemu-arm@nongnu.org, =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Currently we are only targeting the official RaspberryPi Pico although I suspect most RP2040 based boards will look broadly the same. Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé --- configs/devices/arm-softmmu/default.mak | 1 + hw/arm/raspi_pico.c | 77 +++++++++++++++++++++++++ hw/arm/Kconfig | 3 + hw/arm/meson.build | 1 + 4 files changed, 82 insertions(+) create mode 100644 hw/arm/raspi_pico.c diff --git a/configs/devices/arm-softmmu/default.mak b/configs/devices/arm-softmmu/default.mak index dce1c39aad..7322213127 100644 --- a/configs/devices/arm-softmmu/default.mak +++ b/configs/devices/arm-softmmu/default.mak @@ -32,6 +32,7 @@ CONFIG_NETDUINO2=y CONFIG_NETDUINOPLUS2=y CONFIG_MPS2=y CONFIG_RASPI=y +CONFIG_RASPI_PICO=y CONFIG_RP2040=y CONFIG_DIGIC=y CONFIG_SABRELITE=y diff --git a/hw/arm/raspi_pico.c b/hw/arm/raspi_pico.c new file mode 100644 index 0000000000..9826f4d608 --- /dev/null +++ b/hw/arm/raspi_pico.c @@ -0,0 +1,77 @@ +/* + * Raspberry Pi Pico emulation + * + * Copyright (c) 2021 Linaro Ltd + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "qemu/osdep.h" +#include "qemu/units.h" +#include "qemu/cutils.h" +#include "qapi/error.h" +#include "hw/arm/rp2040.h" +#include "qemu/error-report.h" +#include "hw/boards.h" +#include "hw/loader.h" +#include "hw/arm/boot.h" +#include "qom/object.h" + +struct PiPicoMachineState { + /*< private >*/ + MachineState parent_obj; + /*< public >*/ + RP2040State soc; +}; +typedef struct PiPicoMachineState PiPicoMachineState; + +struct PiPicoMachineClass { + /*< private >*/ + MachineClass parent_obj; + /*< public >*/ +}; + +typedef struct PiPicoMachineClass PiPicoMachineClass; + +#define TYPE_PIPICO_MACHINE MACHINE_TYPE_NAME("raspi-pico") +DECLARE_OBJ_CHECKERS(PiPicoMachineState, PiPicoMachineClass, + PIPICO_MACHINE, TYPE_PIPICO_MACHINE) + + +static void pipico_machine_init(MachineState *machine) +{ + PiPicoMachineState *s = PIPICO_MACHINE(machine); + + /* Setup the SOC */ + object_initialize_child(OBJECT(machine), "soc", &s->soc, TYPE_RP2040); + sysbus_realize(SYS_BUS_DEVICE(&s->soc), &error_fatal); +} + +static void pipico_machine_class_init(ObjectClass *oc, void *data) +{ + MachineClass *mc = MACHINE_CLASS(oc); + + mc->desc = g_strdup_printf("Raspberry Pi Pico"); + mc->init = pipico_machine_init; + mc->block_default_type = IF_PFLASH; + mc->no_parallel = 1; + mc->no_floppy = 1; + mc->no_cdrom = 1; + mc->no_sdcard = 1; + mc->min_cpus = 2; + mc->default_cpus = 2; + mc->max_cpus = 2; +}; + + +static const TypeInfo pipico_machine_types[] = { + { + .name = TYPE_PIPICO_MACHINE, + .parent = TYPE_MACHINE, + .instance_size = sizeof(PiPicoMachineState), + .class_size = sizeof(PiPicoMachineClass), + .class_init = pipico_machine_class_init, + } +}; + +DEFINE_TYPES(pipico_machine_types) diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig index 1c5150c180..288a03f428 100644 --- a/hw/arm/Kconfig +++ b/hw/arm/Kconfig @@ -336,6 +336,9 @@ config RASPI select SDHCI select USB_DWC2 +config RASPI_PICO + bool + config STM32F100_SOC bool select ARM_V7M diff --git a/hw/arm/meson.build b/hw/arm/meson.build index 9f1b040c57..4913cd1a50 100644 --- a/hw/arm/meson.build +++ b/hw/arm/meson.build @@ -41,6 +41,7 @@ arm_ss.add(when: 'CONFIG_ALLWINNER_A10', if_true: files('allwinner-a10.c', 'cubi arm_ss.add(when: 'CONFIG_ALLWINNER_H3', if_true: files('allwinner-h3.c', 'orangepi.c')) arm_ss.add(when: 'CONFIG_RASPI', if_true: files('bcm2835_peripherals.c', 'bcm2836.c', 'raspi.c')) arm_ss.add(when: 'CONFIG_RP2040', if_true: files('rp2040.c')) +arm_ss.add(when: 'CONFIG_RASPI_PICO', if_true: files('raspi_pico.c')) arm_ss.add(when: 'CONFIG_STM32F100_SOC', if_true: files('stm32f100_soc.c')) arm_ss.add(when: 'CONFIG_STM32F205_SOC', if_true: files('stm32f205_soc.c')) arm_ss.add(when: 'CONFIG_STM32F405_SOC', if_true: files('stm32f405_soc.c')) From patchwork Mon Jan 10 17:51:01 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: 530933 Delivered-To: patch@linaro.org Received: by 2002:ad5:544f:0:0:0:0:0 with SMTP id a15csp2817943imp; Mon, 10 Jan 2022 09:58:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJxjUwLSJmz9d+i7zKrgCy8Cuw6NfdV3V3xYSg+Lx6bIbIctUK/DDTPGen6b/d7baPDFF7gK X-Received: by 2002:a02:6d05:: with SMTP id m5mr474539jac.238.1641837502514; Mon, 10 Jan 2022 09:58:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1641837502; cv=none; d=google.com; s=arc-20160816; b=aI8qaeEvEKGdokK9qjnGdDw64d5YidVVmyGbqBwulq7deNT9R14e9/3RNB5hMKJavR bocJrmb2N8OZhH0sjuLk6cMaAV+27Bc4c+1pigyzzNF22wLw7I0jjwHPylTqqZZbUAqz DezyKRkic83n7x3Imqf8/1m34r2nAKkmxTRYe4eW9oTQECEk0zdD3UgVNbRky8QLOPA3 vkVhT+RMnTpuSRYCmRUsHEPQZe9eQMBKrohJ/guVXghzVfb3etp8BNGAB/BrcRnty9uC dAgjMnZAbwC5ByKZng1MhwkjLFvWksZxi58M6e2hFf4Oe7nHQUNjS0ppMfC7aNTjCqD0 8iTw== 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=pAztriVYxVoG2QzJ07skul6hi2knt8UFHmQWJ7Gn4yY=; b=hsnnGLgpfU8+1bkOA6RjEuPo/PBh8+pqsRfpPA2ss+cvtdm2dk92R2XpmyEDYBYWbp vPWFhbRCI23oU1N1rbUT0z/CNVelGfhI3E3LcsZY8Wr94HiQSXArqtHP/EhyNzJEqV+A bpQoE77xUOQvNS0peoYZb/UEgptJ0S+C+OFAoWw26gEv53kpU3/iLkr03GGO2955rq9I yy+B2fmw9VYgWK5ubu6inmkTyTgjR+b5GNNDHvOeIJMZUEtT+RwTIQma4A6TesAYmCh0 guz/lmE9axXCaFgWeXbGy6CReV5lcJuFbcG2MAe4qi9D/GF+y7R4fDFY49h+DYT+MqyR tv1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=zEgLh2pS; 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 i6si2960061ila.8.2022.01.10.09.58.22 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 10 Jan 2022 09:58:22 -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=fail header.i=@linaro.org header.s=google header.b=zEgLh2pS; 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]:56640 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n6yw2-0004dn-1h for patch@linaro.org; Mon, 10 Jan 2022 12:58:22 -0500 Received: from eggs.gnu.org ([209.51.188.92]:48178) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n6yp7-0007Is-R9 for qemu-devel@nongnu.org; Mon, 10 Jan 2022 12:51:17 -0500 Received: from [2a00:1450:4864:20::532] (port=33370 helo=mail-ed1-x532.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n6yp5-00065f-3e for qemu-devel@nongnu.org; Mon, 10 Jan 2022 12:51:12 -0500 Received: by mail-ed1-x532.google.com with SMTP id b13so3407220edn.0 for ; Mon, 10 Jan 2022 09:51:10 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=pAztriVYxVoG2QzJ07skul6hi2knt8UFHmQWJ7Gn4yY=; b=zEgLh2pSumSJ1j0gfjG9Upi7PVsbOKL1zwd2F7nqVD002kPhY0FpYO/q3ZvUOhPhsH s9EwR8hRs32GDKEUT/s5c1IzWU8t6Iq0MCSCSE90ULTR/QZBvoI5Y1PI7QdAzZai2eN2 qAzL8ikLax4+hphNEylkky5pNlwqNYN+I6LAQAOuybvs4MaU7si6QOjqVLvXwa4mu4Y4 fF6VcnlaDiB6S7mfjlrrVCDQECAATjp4nBoN4/UBI1/8oR91JhU10xphyF6mlsCdaUsY RdkYijU+gq8bVnO4Iu/Z56Qefxeymma53KFcj0FhMM6uUOinXWNQEuMypReDjlJIk4kV Ip+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=pAztriVYxVoG2QzJ07skul6hi2knt8UFHmQWJ7Gn4yY=; b=tWMhqbi6geOHMCpPASGN26xksMOF3EQZF7QAgL5KUAJrPsMDQRYO89COdyydncgPzX lM9D4os73ORC6zARnThcdn1aT8Keqy6HohxlXh4u5Z3vMtf5hYPu3NoWNq2h32ucWOd9 MelDSiyMQn6zhupdXypWomwa507nqsYt4e2XGfk8UUDBizFNo39EZapjL5jn1xe5vWgS WD6w6OgTjpU39t33RZ6Ty4xpLyM0lMIvEaQjY110b44rhKMGSISwfHVuvBbqMzhv8TPy hcfregsJEUChQHudGDycGpZxOJl7b9kMzJkrM0bQGDCle522NroIzOXOpgSI5OXGSXrW HXRg== X-Gm-Message-State: AOAM533/j7nTQTO6zeioo8GxdadmtQxkvONOmYycWXALIKfA6WzkvCv8 owY/RDhiW9Zv5OkLcgsrhVcw8Co7HRvfIQ== X-Received: by 2002:a17:907:1c08:: with SMTP id nc8mr662908ejc.711.1641837069386; Mon, 10 Jan 2022 09:51:09 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id b4sm2679617ejl.129.2022.01.10.09.51.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jan 2022 09:51:07 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 9A5FB1FFBB; 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 3/6] hw/arm: wire-up memory from the Pico board and the SoC Date: Mon, 10 Jan 2022 17:51:01 +0000 Message-Id: <20220110175104.2908956-4-alex.bennee@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220110175104.2908956-1-alex.bennee@linaro.org> References: <20220110175104.2908956-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::532 (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::532; envelope-from=alex.bennee@linaro.org; helo=mail-ed1-x532.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: Peter Maydell , qemu-arm@nongnu.org, =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" All the memory aside from the external flash is a feature of the SoC itself. However the flash is part of the board and different RP2040 boards can choose to wire up different amounts of it. For now add unimplemented devices for all the rp2040 peripheral blocks. Before we can boot more of the ROM we will need to model at least the SIO and CLOCKS blocks. For now CPU#1 starts disabled as it needs a working CPUID register so it can identify itself before sleeping. Signed-off-by: Alex Bennée --- include/hw/arm/rp2040.h | 9 +++- hw/arm/raspi_pico.c | 20 +++++++ hw/arm/rp2040.c | 113 ++++++++++++++++++++++++++++++++++++++-- 3 files changed, 137 insertions(+), 5 deletions(-) diff --git a/include/hw/arm/rp2040.h b/include/hw/arm/rp2040.h index 6bf4a4e57e..760cef98fc 100644 --- a/include/hw/arm/rp2040.h +++ b/include/hw/arm/rp2040.h @@ -25,7 +25,14 @@ struct RP2040State { ARMv7MState armv7m[RP2040_NCPUS]; - MemoryRegion container; + /* RP2040 regions */ + MemoryRegion *memory; /* from board */ + MemoryRegion memory_alias[RP2040_NCPUS - 1]; + + MemoryRegion rom; /* internal mask rom */ + MemoryRegion sram03; /* shared SRAM0-3 banks */ + MemoryRegion sram4; /* non-stripped SRAM4 */ + MemoryRegion sram5; /* non-stripped SRAM5 */ }; diff --git a/hw/arm/raspi_pico.c b/hw/arm/raspi_pico.c index 9826f4d608..76839e93bf 100644 --- a/hw/arm/raspi_pico.c +++ b/hw/arm/raspi_pico.c @@ -22,6 +22,7 @@ struct PiPicoMachineState { MachineState parent_obj; /*< public >*/ RP2040State soc; + MemoryRegion flash; }; typedef struct PiPicoMachineState PiPicoMachineState; @@ -37,14 +38,33 @@ typedef struct PiPicoMachineClass PiPicoMachineClass; DECLARE_OBJ_CHECKERS(PiPicoMachineState, PiPicoMachineClass, PIPICO_MACHINE, TYPE_PIPICO_MACHINE) +#define RP2040_XIP_BASE 0x10000000 static void pipico_machine_init(MachineState *machine) { PiPicoMachineState *s = PIPICO_MACHINE(machine); + MemoryRegion *sysmem = get_system_memory(); + Error **errp = &error_fatal; /* Setup the SOC */ object_initialize_child(OBJECT(machine), "soc", &s->soc, TYPE_RP2040); + object_property_set_link(OBJECT(&s->soc), "memory", OBJECT(sysmem), errp); + + /* + * The flash device it external to the SoC and mounted on the + * PiPico board itself. We will "load" the actual contents with + * armv7_load_kernel later although we still rely on the SoC's + * mask ROM to get to it. + */ + const uint32_t flash_size = 256 * KiB; + memory_region_init_rom(&s->flash, NULL, "pico.flash0", flash_size, errp); + memory_region_add_subregion(sysmem, RP2040_XIP_BASE, &s->flash); + + sysbus_realize(SYS_BUS_DEVICE(&s->soc), &error_fatal); + + /* This assumes the "kernel" is positioned in the XIP Flash block */ + armv7m_load_kernel(ARM_CPU(first_cpu), machine->kernel_filename, RP2040_XIP_BASE); } static void pipico_machine_class_init(ObjectClass *oc, void *data) diff --git a/hw/arm/rp2040.c b/hw/arm/rp2040.c index 2feedc0da8..c6cc9b7165 100644 --- a/hw/arm/rp2040.c +++ b/hw/arm/rp2040.c @@ -7,10 +7,11 @@ */ #include "qemu/osdep.h" +#include "qemu/units.h" #include "qapi/error.h" -#include "qemu/module.h" #include "hw/arm/armv7m.h" #include "hw/arm/rp2040.h" +#include "hw/misc/unimp.h" #include "hw/sysbus.h" #include "hw/qdev-properties.h" @@ -27,6 +28,11 @@ typedef struct RP2040Class { #define RP2040_GET_CLASS(obj) \ OBJECT_GET_CLASS(RP2040Class, (obj), TYPE_RP2040) +/* See Table 2.2.2 in the RP2040 Datasheet */ +#define RP2040_SRAM_BASE 0x20000000 +#define RP2040_SRAM4_BASE 0x20040000 +#define RP2040_SRAM5_BASE 0x20041000 + static void rp2040_init(Object *obj) { RP2040State *s = RP2040(obj); @@ -37,6 +43,16 @@ static void rp2040_init(Object *obj) object_initialize_child(obj, name, &s->armv7m[n], TYPE_ARMV7M); qdev_prop_set_string(DEVICE(&s->armv7m[n]), "cpu-type", ARM_CPU_TYPE_NAME("cortex-m0")); + /* + * Confusingly ARMv7M creates it's own per-core container so + * we need to alias additional regions to avoid trying to give + * a region two parents. + */ + if (n > 0) { + memory_region_init_alias(&s->memory_alias[n - 1], obj, + "system-memory.alias", s->memory, + 0, -1); + } } } @@ -46,14 +62,104 @@ static void rp2040_realize(DeviceState *dev, Error **errp) Object *obj = OBJECT(dev); int n; + if (!s->memory) { + error_setg(errp, "%s: memory property was not set", __func__); + return; + } + + /* initialize internal 16 KB internal ROM */ + memory_region_init_rom(&s->rom, obj, "rp2040.rom0", 16 * KiB, errp); + memory_region_add_subregion(s->memory, 0, &s->rom); + + /* SRAM (Main 256k bank + two 4k banks)*/ + memory_region_init_ram(&s->sram03, obj, "rp2040.sram03", 256 * KiB, errp); + memory_region_add_subregion(s->memory, RP2040_SRAM_BASE, &s->sram03); + + memory_region_init_ram(&s->sram4, obj, "rp2040.sram4", 4 * KiB, errp); + memory_region_add_subregion(s->memory, RP2040_SRAM4_BASE, &s->sram4); + + memory_region_init_ram(&s->sram5, obj, "rp2040.sram5", 4 * KiB, errp); + memory_region_add_subregion(s->memory, RP2040_SRAM5_BASE, &s->sram5); + + /* Map all the devices - see table 2.2.2 from the datasheet */ + + /* APB Peripherals */ + create_unimplemented_device("rp2040.sysinfo", 0x40000000, 0x4000); + create_unimplemented_device("rp2040.syscfg", 0x40004000, 0x4000); + create_unimplemented_device("rp2040.clocks", 0x40008000, 0x4000); + create_unimplemented_device("rp2040.resets", 0x4000c000, 0x4000); + create_unimplemented_device("rp2040.psm", 0x40010000, 0x4000); + create_unimplemented_device("rp2040.iobnk0", 0x40014000, 0x4000); + create_unimplemented_device("rp2040.ioqspi", 0x40018000, 0x4000); + create_unimplemented_device("rp2040.padsbnk0", 0x4001c000, 0x4000); + create_unimplemented_device("rp2040.padsqspi", 0x40020000, 0x4000); + create_unimplemented_device("rp2040.xosc", 0x40024000, 0x4000); + + create_unimplemented_device("rp2040.pllsys", 0x40028000, 0x4000); + create_unimplemented_device("rp2040.pllusb", 0x4002c000, 0x4000); + create_unimplemented_device("rp2040.busctrl", 0x40030000, 0x4000); + create_unimplemented_device("rp2040.uart0", 0x40034000, 0x4000); + create_unimplemented_device("rp2040.uart1", 0x40038000, 0x4000); + create_unimplemented_device("rp2040.spi0", 0x4003c000, 0x4000); + create_unimplemented_device("rp2040.spi1", 0x40040000, 0x4000); + create_unimplemented_device("rp2040.i2c0", 0x40044000, 0x4000); + create_unimplemented_device("rp2040.i2c1", 0x40048000, 0x4000); + create_unimplemented_device("rp2040.adc", 0x4004c000, 0x4000); + create_unimplemented_device("rp2040.pwm", 0x40050000, 0x4000); + create_unimplemented_device("rp2040.timer", 0x40054000, 0x4000); + create_unimplemented_device("rp2040.watchdog", 0x40058000, 0x4000); + create_unimplemented_device("rp2040.rtc", 0x4005c000, 0x4000); + create_unimplemented_device("rp2040.rosc", 0x40060000, 0x4000); + create_unimplemented_device("rp2040.vreg&reset", 0x40064000, 0x4000); + create_unimplemented_device("rp2040.tbman", 0x4006c000, 0x4000); + + /* AHB-Lite Peripherals */ + create_unimplemented_device("rp2040.dmabase", 0x50000000, 0x1000); + + /* USB */ + create_unimplemented_device("rp2040.usbram", 0x50100000, 0x10000); + create_unimplemented_device("rp2040.usbregs", 0x50110000, 0x10000); + + /* Remaining AHB-Lite peripherals */ + create_unimplemented_device("rp2040.pi00", 0x50200000, 0x10000); + create_unimplemented_device("rp2040.pi01", 0x50300000, 0x10000); + + /* IOPORT Peripherals */ + create_unimplemented_device("rp2040.sio", 0xd0000000, 0x10000000); + + /* + * Cortex-M0+ internal peripherals (PPB_BASE) are handled by + * the v7m model and live at 0xe0000000. + */ + + /* TODO: deal with stripped aliases */ + for (n = 0; n < RP2040_NCPUS; n++) { Object *cpuobj = OBJECT(&s->armv7m[n]); + MemoryRegion *mr = n == 0 ? s->memory : &s->memory_alias[n - 1]; + object_property_set_link(cpuobj, "memory", OBJECT(mr), errp); + + /* + * FIXME: temp hack - until more of the logic is emulated we + * can't let the second CPU run off into the wild. + */ + if (n > 0) { + object_property_set_bool(cpuobj, "start-powered-off", + true, &error_fatal); + } + if (!sysbus_realize(SYS_BUS_DEVICE(cpuobj), errp)) { return; } } } +static Property rp2040_soc_properties[] = { + DEFINE_PROP_LINK("memory", RP2040State, memory, TYPE_MEMORY_REGION, + MemoryRegion *), + DEFINE_PROP_END_OF_LIST(), +}; + static void rp2040_class_init(ObjectClass *oc, void *data) { DeviceClass *dc = DEVICE_CLASS(oc); @@ -61,14 +167,13 @@ static void rp2040_class_init(ObjectClass *oc, void *data) bc->cpu_type = ARM_CPU_TYPE_NAME("cortex-m0"); dc->realize = rp2040_realize; - /* any props? */ + device_class_set_props(dc, rp2040_soc_properties); }; static const TypeInfo rp2040_types[] = { { .name = TYPE_RP2040, - /* .parent = TYPE_SYS_BUS_DEVICE, */ - .parent = TYPE_DEVICE, + .parent = TYPE_SYS_BUS_DEVICE, .instance_size = sizeof(RP2040State), .instance_init = rp2040_init, .class_size = sizeof(RP2040Class), From patchwork Mon Jan 10 17:51:02 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: 530934 Delivered-To: patch@linaro.org Received: by 2002:ad5:544f:0:0:0:0:0 with SMTP id a15csp2819824imp; Mon, 10 Jan 2022 10:00:57 -0800 (PST) X-Google-Smtp-Source: ABdhPJztwqi3kRUy2zEpL6S7Fk/g1PeBOsWn19S/ozuEFj/VBE7b7cD4FIS2rOqUhfD5IgdDPi/Q X-Received: by 2002:a37:6586:: with SMTP id z128mr639469qkb.73.1641837657809; Mon, 10 Jan 2022 10:00:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1641837657; cv=none; d=google.com; s=arc-20160816; b=djlYJ+l9AYuDT23GAmqmUPNF0Aln/rTAOCP2aHZy8QCot5BeGfi/3WBZj1TCXghQ0o K+qXi9IRUWYPFJm3viRfRKvNMIMexBOoZ2Qrs96EWrvCmUV1m7bZfBMYlpV3WgOn84kV QbQHPXdIEAxNCyphQOkI0/aDXf3qN3QB9wrWDDXGP7ci8hh6un1wJSFLKXyCbtVv83ao Q5WA52ioprdEVFdlFEjL7Jri39AQvRI1cexUfw0C//00uv9IeqloF01sh0OiGjfojs1T cgli5Vm7Y6qLgDYsizXEgX+hOgg0VBpLciDp9sx8XCQaaazc0EzrS9L01ddsvAs2eWPX KkuQ== 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=OTMi4ThvYsHdaxRQinDWagkVxuRjT1evPlMWwfqMwCE=; b=j3dPzOss3eM1ueve2/XNI4mH7AD50ByTx2Bb6BCn7pTcfAfeUrhuR1Xky2qjEEPYhs Pq1j+of20zLk2/0ow4az9L5B+zfiovQZ7cgBJJmZCGt6GNU7vTfcbdSWsf7JF2/sVFO3 x5mzfIF7B3CuBwfXoSBOwUQYIx9uxAU9WUKiafQnkMN3MwjCbFp6FfnyYIyq21xd021A UMqCzS5EBMamRVmwcyJdxhTnynuRHNZlxg6O6ts359ImN2TVm2qGPVRwzoTtMbxOfB5K mz6Rz+SXIj1SNi+Ykn1Dk5aT82Pc76ZMi0Pfy37i8NintvKcU6bz21bTI/ijHMP1oMXu YEBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=p5sNVTrV; 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 h20si128510qtb.356.2022.01.10.10.00.57 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 10 Jan 2022 10:00:57 -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=p5sNVTrV; 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]:35110 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n6yyX-0000mH-6S for patch@linaro.org; Mon, 10 Jan 2022 13:00:57 -0500 Received: from eggs.gnu.org ([209.51.188.92]:48266) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n6ypA-0007JI-4l for qemu-devel@nongnu.org; Mon, 10 Jan 2022 12:51:18 -0500 Received: from [2a00:1450:4864:20::530] (port=38412 helo=mail-ed1-x530.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n6yp6-00066C-EX for qemu-devel@nongnu.org; Mon, 10 Jan 2022 12:51:15 -0500 Received: by mail-ed1-x530.google.com with SMTP id u21so34174630edd.5 for ; Mon, 10 Jan 2022 09:51:11 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=OTMi4ThvYsHdaxRQinDWagkVxuRjT1evPlMWwfqMwCE=; b=p5sNVTrVjR8UZZLKgzhhObOyHiTwbED+I/JKxtS3ZEPH63A9WvzdZNoPsJctyCkBIR ouMLdmNLyATCd+B1EOhqn1sdhbecGZHCWtyznCLf8Je+YCT82GPPc27dfUMEeUD1Tvfk 5vveAFcXncmrsPEp5j9EJ+LAMTYN6pb51LvxwIbRHfbmAJkSVP4bNfuIwVH/s99JtGnb kKDh0691SRLOptIjq00Y8p6voTiqWzw0DQ2OTLY+Sin43uD6o2u8OaxSLll6FZLgY9ql 4TOdYOxIBI5KpheVqtV89E52/qFApUjSlpnxYdn5parM0Wc7Y4fK5+LE0D0YVw6NsmZU +rEg== 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=OTMi4ThvYsHdaxRQinDWagkVxuRjT1evPlMWwfqMwCE=; b=oz7wIyfbZcRMMnukn08Uw5iUzJWS3sdhDA4eIn5Y5mwRKnjhhi58z01N2pcBroz9iM 4UUkjRIBfbK/s+S6P+FuDDAc5t4cIdatoqCUjzAKJLSKT9//BoDkQJ01nnkmLjcOy7SH oBgfGEyVlV1edF0/C23ktwTof6WBuHQn5tgqA4f+OkhsQNtfl1gbGe4S2o5FihHtTC72 ORGIACM1BJXRYr4yOoPCAo3xYzhXyt6R4vFk9cN5soGncvXWsIILD5F85KWadlosx0Dq kaTgFThB452r0hED8c3MstLtwm5vsIk6H1c488MFjbCeuucXf2aBic6p6HKrT3epTzBL QMaw== X-Gm-Message-State: AOAM531S+Bp0VU9kssLUh4xUL4U4UoR1bazst8jartJgX41P/Yej3nHH xZwbWbl8iGLx8BU6kph2rwuzRw== X-Received: by 2002:a05:6402:1d84:: with SMTP id dk4mr798024edb.16.1641837070817; Mon, 10 Jan 2022 09:51:10 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id k21sm3826268edo.87.2022.01.10.09.51.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jan 2022 09:51:08 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id A517C1FFBC; 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 4/6] pc-bios: add pipico mask rom (!upstream) Date: Mon, 10 Jan 2022 17:51:02 +0000 Message-Id: <20220110175104.2908956-5-alex.bennee@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220110175104.2908956-1-alex.bennee@linaro.org> References: <20220110175104.2908956-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::530 (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::530; envelope-from=alex.bennee@linaro.org; helo=mail-ed1-x530.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, LOTS_OF_MONEY=0.001, 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" The boot code for the RP2040 is fully open source and can be found at: https://github.com/raspberrypi/pico-bootrom it contains not only the initial boot code but a full USB stack (for programming) and a number of library functions that the user code might use. We really should be able to build this ourselves but until I figure out how to integrate the build this will do. This image was extracted from a B1 pipico by a friendly hardware hacker. Signed-off-by: Alex Bennée --- pc-bios/pipico.rom | Bin 0 -> 16384 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 pc-bios/pipico.rom GIT binary patch literal 16384 zcma)jd0bT2+3<7j?86KUpkWrkJ2Rlbhz{TuaJe%V2WAF0)YP>d7R}%iM{&Uw!~o*#*P z>w$j7!1Lu`B>`6;;&~RoI(YgWD%-sz|7lGoKn|bF7CH-^Y-Lq_sCvzoEj!tTb?lNY zRkd{w+|O2Qt%Zd}mzm0<5vHPOf^13Ak7V-}Um3r6ia35A?;6if$sNDc-I`sx7r5 zc!_uxFPq?*TQRA0@sdfUb5G9#s4pi$$Q>t2(dVSi-pzh((Cj8cLf~*@(}K|ar2jtS zR*B0w&L|fRb7lng+*0p9QpWUuc85K0-FQGf)D>96oqr(RSyolCW`W##Z`BJMtsA}S zq0WRCft8{+C6aR+$Np0KT|kO{A%(HO6ul~u7p3U`O6?xN9^tap5%xU0k;BoBZG@ap zg-{t8Kb`+w8N59hNuJUEAhbcN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9$DWp&kLTD zp4UB_PMq+N3F9!H=7^E$WVUtk9i-*uo_#GeZlN5rjZYZ!Lw*nHw^xl{rNLi1`4ssZ z#yq)0mtv}SaUQSdIcQ2dl$6Im;d;h3+cx}#_y4o+LeKJl_Fd>&j(tDTmZgML*$z9lt&K75drd-dehJ1byvK zUp;veud2bOrAxn)kg-mkJQs=kM>#X zA=9ms|0+Hjw=Ps;9^p;81^m923jQBy(@c<6<?K%s)_xr3t(Yq}L7I#EiYi--r{fFZ@`cZJWTok;zN zOmE-xKqZzL%;IoqD z#kcU5+jxYS@ltPU^gq%T?s9+Q$=}g+q(bxGlfasm0Jr={&VOycW%?h(ypOL9l_fs- z`*V-?zH>nJ(UOUb(es&1;oKWJlRH2%$MyYqt|A6m&$~{)5^jXuY1MPb_RWDW45waU z2FAhuWpkH8ED7E_`HD7-gmT~9rKArD<PnCkczXf9b(rut3*n|bg1>pB)7>R-{ATc54H{-TFa*Mb8tl!el?y?o*v)W& zFNVG}I2uF2R4HUMuTt!zuM}dS!*Y*LLdGM6k>Q;5t_-~+b7STc^A`WWJAcZg0vr*$ z(@6(*BOLT^6c#{w!>4kgH=nKqACGHE!8Cl|h+#P@a)cfahty%YI*d$;{aB2-$q`d; z<9&8mY6s}Z!rv_$0bapH{{i147z2C{&jCeD^ezvgEsmlMo2qKpY+<(-PI7AJZK_?f zp_u)5RI&(w*1f4}OKrZl6stx-(#mCsk+;7;OGMl->?pwOFu@)}YW9w@aO56_%nWYb zxMB9p;F_x1*)un;*;>U0w{8vPui3n0TmNjd)tf>#$*qTibY+duf)>$@Z$x(B(-cohWSn5m_BC7T>oz?wtE#HHx~8VKcFmf# zYbV$y&z?DXaAWnR+MTm2*VNW+SyQu>{?dNyCU)jXBTn|m!0dlKIdgK=$mZ(d^)n|A L-N4^D;otuOn>zy8 literal 0 HcmV?d00001 diff --git a/pc-bios/pipico.rom b/pc-bios/pipico.rom new file mode 100644 index 0000000000000000000000000000000000000000..8eb47ee7873678c8e82aeae8db9157fddf5e9de4 From patchwork Mon Jan 10 17:51:03 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: 530932 Delivered-To: patch@linaro.org Received: by 2002:ad5:544f:0:0:0:0:0 with SMTP id a15csp2817669imp; Mon, 10 Jan 2022 09:57:56 -0800 (PST) X-Google-Smtp-Source: ABdhPJx2dC/AkEhe/kafAEfqppn8TuqVo0l/ceygC10YQwL7MFID7b7caSUGDtjzBAPEcshcze87 X-Received: by 2002:a05:6638:2105:: with SMTP id n5mr475197jaj.227.1641837476753; Mon, 10 Jan 2022 09:57:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1641837476; cv=none; d=google.com; s=arc-20160816; b=xJliVTiq+G+Bcr+32pVld6xjiG8p3Htvxr9Oc55ZRgoOyyDVOR27Otwi7fOF1dlq+d 21EXzEWgSToErM1Ljtypsp/3j16MGwTPPryvM8/YuVoRs8M5Tb+sEtqW5TZWn+65xQVt Rxr8gySj43AFIKDvkrf0d+IhOtfI6OPVspouL+Euy9knXNInQQ11ZVJio9kCYEhiDbjc dY7Ml8og45RlDDfxAxi21/wPtuIgJcoKtf2mOOq13rz8ze8Uq0aHklQ5EoEhexIaIWPv 9xLNmX6SjCaqz0AXWCf1JG3tWAlGecIKg3xKl0wXbDuJgdtbirnyanK5W1s5Df/l+9zK tgBA== 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=wTKy8siX3ZvEgK7yJV+OZiBUEaj+t2LkaHStLMhE7OE=; b=Fk5y+efIJErmLIM83rxAFqDS4AbSSwEs7JYi9Gt1bm2ZkfU7Qvs1wsDgraz3vs5jPK dvq0KqdXVKZpqjRKenBevxI14M4IMTJwDLwsLfh+y3PlSbvSPIYGuYKbz+Y4AsIitR5F 1ly6Q9lITJG8rvau1Aesx8fPp5NjI/VxVzVWFrLDQ35KJXwaf3ujJZ234IkneGNTLxEp ZLUyazbUsQFEAPjkQ8b0TIVfmFlxUFJPV7u4ru49LWEMBtQy77fP/GqAtTSVMDR9t6hR cbuZ3k1wpXTfXHT9swlwfsayFAEzsR/VXvyeJ5Sm+dGonO0Qljd1yTAzset5sqfgkH71 YN8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="Uz1FE/rJ"; 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 d4si2781385ilq.95.2022.01.10.09.57.56 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 10 Jan 2022 09:57:56 -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=fail header.i=@linaro.org header.s=google header.b="Uz1FE/rJ"; 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]:56476 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n6yvc-0004W3-87 for patch@linaro.org; Mon, 10 Jan 2022 12:57:56 -0500 Received: from eggs.gnu.org ([209.51.188.92]:48280) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n6ypA-0007JK-LE for qemu-devel@nongnu.org; Mon, 10 Jan 2022 12:51:18 -0500 Received: from [2a00:1450:4864:20::535] (port=33374 helo=mail-ed1-x535.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n6yp9-000674-0j for qemu-devel@nongnu.org; Mon, 10 Jan 2022 12:51:16 -0500 Received: by mail-ed1-x535.google.com with SMTP id b13so3407988edn.0 for ; Mon, 10 Jan 2022 09:51:14 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=wTKy8siX3ZvEgK7yJV+OZiBUEaj+t2LkaHStLMhE7OE=; b=Uz1FE/rJfxHoK3FIhcQiaDABKgRm4LnBMaochAjNlogvfhMhqAUslBwYbwtysmJ4A8 VgQ2tOiyyyc9wVGvmPMdeZFWzAQqITeBJkJJvTHB6fH0tbFZV1qV0vidLNB+iSZO8fIj y0z8HKRIgIGbT8yPUocMXYMgH/XwYGIEKy0UTn7iO244nfyDDB83Sy979ucuUJpSy+md qMUD2sZbw+u0H82INGGhU/1P1sNoFGbSadVLDbSFrTa0bxCLpstEE38n6BkaBfh2r2Y4 fvA/TDQeIl+fhRSV3vUAi31IAtCDT8GTlG/D5r7hcJYYgC//zQXHgIgNM5qTdc9kG/ff w+Og== 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=wTKy8siX3ZvEgK7yJV+OZiBUEaj+t2LkaHStLMhE7OE=; b=nGMr7LVbDin3Zrx5PhuS5AE6ZWhUQq+1gchLSSLkTWWx46aABsEgntMbC31NxhG5i+ +9WW+at1UOSuf6PnRcqXbh3yhiDu0kAE+bqU1DllQ4pm9cHarF5kueMqCLkwgllCfJ4k PMWN4JvcByDj/5JmVPppp73XB8bDIslBu8UuuifRmHd6yh/o0oGlsMtVFOz86AmLgP+a 0dG4ZeGlqhwoAFMyGo13XAnL5X9VdPQxKJwYYk/jzTewLPTV5iFg1B0I9f/e61GSrt4u fWSgnMi8t6MObZp8NmA9BW1s5HGi33C1h8uyr6sXC0Vn80/y+OuqzQjV69wAiTefummL S6SA== X-Gm-Message-State: AOAM533OhwXW1UyVuHaLDNOCHBxcAQ82w2O11wZTCrUcoF1LEnZSdaiv 3Vz+xFZynyIGzw0AqBI+YEnT8+jIWM/0iw== X-Received: by 2002:aa7:ccc7:: with SMTP id y7mr774786edt.96.1641837073706; Mon, 10 Jan 2022 09:51:13 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id h10sm2686797ejx.115.2022.01.10.09.51.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jan 2022 09:51:10 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id BC7141FFBD; 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 5/6] hw/arm: add mask boot ROM logic Date: Mon, 10 Jan 2022 17:51:03 +0000 Message-Id: <20220110175104.2908956-6-alex.bennee@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220110175104.2908956-1-alex.bennee@linaro.org> References: <20220110175104.2908956-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::535 (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::535; envelope-from=alex.bennee@linaro.org; helo=mail-ed1-x535.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: Peter Maydell , qemu-arm@nongnu.org, =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" The mask ROM contains the initial boot code to start the RP2040. It also contains some common sub-routines as well as the flash programming code for drag and drop programming. As a result we need to ensure the full version is available to any user supplied programs we might want to run. Signed-off-by: Alex Bennée --- hw/arm/rp2040.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/hw/arm/rp2040.c b/hw/arm/rp2040.c index c6cc9b7165..9a5bc20159 100644 --- a/hw/arm/rp2040.c +++ b/hw/arm/rp2040.c @@ -8,10 +8,12 @@ #include "qemu/osdep.h" #include "qemu/units.h" +#include "qemu/datadir.h" #include "qapi/error.h" #include "hw/arm/armv7m.h" #include "hw/arm/rp2040.h" #include "hw/misc/unimp.h" +#include "hw/loader.h" #include "hw/sysbus.h" #include "hw/qdev-properties.h" @@ -33,6 +35,8 @@ typedef struct RP2040Class { #define RP2040_SRAM4_BASE 0x20040000 #define RP2040_SRAM5_BASE 0x20041000 +#define RP2040_MASK_ROM "pipico.rom" + static void rp2040_init(Object *obj) { RP2040State *s = RP2040(obj); @@ -61,6 +65,8 @@ static void rp2040_realize(DeviceState *dev, Error **errp) RP2040State *s = RP2040(dev); Object *obj = OBJECT(dev); int n; + g_autofree char *mask_rom = qemu_find_file(QEMU_FILE_TYPE_BIOS, + RP2040_MASK_ROM); if (!s->memory) { error_setg(errp, "%s: memory property was not set", __func__); @@ -68,9 +74,20 @@ static void rp2040_realize(DeviceState *dev, Error **errp) } /* initialize internal 16 KB internal ROM */ - memory_region_init_rom(&s->rom, obj, "rp2040.rom0", 16 * KiB, errp); + memory_region_init_rom(&s->rom, obj, "rp2040.rom", 16 * KiB, errp); memory_region_add_subregion(s->memory, 0, &s->rom); + if (!mask_rom) { + error_setg(errp, "%s: unable to find mask_rom %s", + __func__, RP2040_MASK_ROM); + return; + } + n = load_image_targphys(mask_rom, 0x0, 16 * KiB); + if (n <= 0) { + error_setg(errp, "%s: failed to load mask rom image: %s", + __func__, RP2040_MASK_ROM); + } + /* SRAM (Main 256k bank + two 4k banks)*/ memory_region_init_ram(&s->sram03, obj, "rp2040.sram03", 256 * KiB, errp); memory_region_add_subregion(s->memory, RP2040_SRAM_BASE, &s->sram03); From patchwork Mon Jan 10 17:51:04 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: 530930 Delivered-To: patch@linaro.org Received: by 2002:ad5:544f:0:0:0:0:0 with SMTP id a15csp2815596imp; Mon, 10 Jan 2022 09:54:38 -0800 (PST) X-Google-Smtp-Source: ABdhPJzN7yzzrNBpiBJtueIb+Xc+kSYmyIwL2oYGIHZdId/AoWv94XAUg2pTaQmm8K+4IPVkRd4E X-Received: by 2002:a02:29c1:: with SMTP id p184mr438159jap.301.1641837278817; Mon, 10 Jan 2022 09:54:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1641837278; cv=none; d=google.com; s=arc-20160816; b=soaS+kQLD2YZ08zv7gPyrzN3RfZQP1Ks/OtAf0X/e3hsekqzsOvljzhPte2r0rJBl5 cC06RoLX54EaOiIBwMPI9fwi9Y9aR8Xsrocw2ilXixnByV2SJvj4IIeDgDj2aMLm/6NT PrPbihlmK0uEIW5HDStm2E1VycQ9ael/L82qV00M/8kpawsnjogXWRpAJcj9hINu8RZG KVcFmOiQiBc6TPWnlJ+hv9Lyxhd+wJcHJLzmOe/grKsq5i4tVib8dchYpsyDCrbKvbcP dLU6I9AZDbQbhUvsNvHRm6fE3Roq2mul5GPabrHpHxnNrTvPhkbHkh4ttuMp4NX9Ew23 iIEQ== 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=P0EjTBLxg+IQMbBIqCClCApA0pdCty/zr/RkYisMT+4=; b=srFHXM5SroMlJFF6CrYdAqS446TXPL34Z9WOMBGSJKibjMbVrD9rc1nF3xKhqOLTIY 2gd7EiyizQdFB8HQWqXcNVQpEp/ym3J+yNWLik4TrQhLB7iSVJhwme7oKqabh56lpvbR c4PIs7Zubyq3007PenMGXyAD90qAKrdAuuh/dseDyf4KIMznzlc0YO80J92i4N+k9jiA z/Cbfo9mS5ZqELQCl0c/QBTqHFftUZ0tWCnSOsBM2vb0b3SW9IOfedlGqqAPn/hdHwTE ed4Vwc5fDWX4IL2sWtkPKdGYyq9jgIpL8tWJ84MWJINt2DXlYt79eXhlcR9s/Zdmw9Fd CcAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AtXl2beT; 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 m17si3417783jat.28.2022.01.10.09.54.38 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 10 Jan 2022 09:54:38 -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=AtXl2beT; 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]:50108 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n6ysQ-0000BE-Bm for patch@linaro.org; Mon, 10 Jan 2022 12:54:38 -0500 Received: from eggs.gnu.org ([209.51.188.92]:48232) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n6yp9-0007JF-E0 for qemu-devel@nongnu.org; Mon, 10 Jan 2022 12:51:18 -0500 Received: from [2a00:1450:4864:20::52c] (port=33365 helo=mail-ed1-x52c.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n6yp7-00066V-GR for qemu-devel@nongnu.org; Mon, 10 Jan 2022 12:51:15 -0500 Received: by mail-ed1-x52c.google.com with SMTP id b13so3407614edn.0 for ; Mon, 10 Jan 2022 09:51:12 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=P0EjTBLxg+IQMbBIqCClCApA0pdCty/zr/RkYisMT+4=; b=AtXl2beTnMBylekHv6y+53XOP7Vjh9MRBk3qXjtDvmNAiUXTh5Rmvo87yAE3qeHMqi blqvJWHtRr/28NUlEAroXgdSSxa/bk2DqadypKWnpwg5w1a9sB8rEDIvfXwXeVH3P+2Q 9WDg9VAngHB5aKywL83qsyvABRjywv1CIeZB27CGK64Ydbk3k1A9oItSbnUZyH39xf34 hk1vcEYP1jw3ypXUPLBQl4jB7lLuCWXesuhQ/N++ihFTPIGg71+R3gjmjKB5c8b408UY Dfg/v2u8izpVYsV6jwFnzKWXgQcbL+RqOefLxhZXSoXZ6HXTUdjj1V8RCr29+/8EQzAT yTCw== 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=P0EjTBLxg+IQMbBIqCClCApA0pdCty/zr/RkYisMT+4=; b=a+h91aW6eSivTGGP21WN/OidkEYFKuN+MPf5iO+HjojwT2pX0O9/HUzIqeu1EutfQS O+55m6YE/jKbbo+LOn1m3h/k74tNb176/+F+Vs+UO+Jtnw0/GUd+ehYWPRpEInEjKDZa U55DhPA83viVlvgYPKX1xifxa7NUFIFDm9D+QQ6HRL8ofjnKdOrLnCR1UIzPakV3YU5k 1vs7nQy5Xjjgzk9p90AIKh96DQoW0VX2/KcR77aRiMA2kcaUEAuuvz+uC/XKWCPb9fqE 3qQiEsPOyetrhswhpd/CocGDoVCLYUb2tV4maLR9D7Zj2ZYiL397jZNVVLjWRiMv7n8w njJA== X-Gm-Message-State: AOAM530xQ1LbCf+EOeogHlLs6AbEuIxxYNZHoQiz0+x5lOKzJpRb4O6w u+URaf5q25eqLXjg/AeqYtJMViMu7ITEpg== X-Received: by 2002:a17:906:9742:: with SMTP id o2mr631067ejy.741.1641837071732; Mon, 10 Jan 2022 09:51:11 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id 21sm2655615ejz.24.2022.01.10.09.51.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jan 2022 09:51:08 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id C80101FFBE; 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 6/6] docs/devel: add some clarifying text for aliases Date: Mon, 10 Jan 2022 17:51:04 +0000 Message-Id: <20220110175104.2908956-7-alex.bennee@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220110175104.2908956-1-alex.bennee@linaro.org> References: <20220110175104.2908956-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::52c (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::52c; envelope-from=alex.bennee@linaro.org; helo=mail-ed1-x52c.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" We do mention the limitation of single parenthood for memory_region_add_subregion but lets also make it clear how aliases help solve that conundrum. Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé --- docs/devel/memory.rst | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/docs/devel/memory.rst b/docs/devel/memory.rst index 5dc8a12682..69c5e3f914 100644 --- a/docs/devel/memory.rst +++ b/docs/devel/memory.rst @@ -67,11 +67,15 @@ MemoryRegion): You initialize a pure container with memory_region_init(). -- alias: a subsection of another region. Aliases allow a region to be - split apart into discontiguous regions. Examples of uses are memory banks - used when the guest address space is smaller than the amount of RAM - addressed, or a memory controller that splits main memory to expose a "PCI - hole". Aliases may point to any type of region, including other aliases, +- alias: a subsection of another region. Aliases allow a region to be + split apart into discontiguous regions. Examples of uses are memory + banks used when the guest address space is smaller than the amount + of RAM addressed, or a memory controller that splits main memory to + expose a "PCI hole". You can also create aliases to avoid trying to + add the original region to multiple parents via + `memory_region_add_subregion`. + + Aliases may point to any type of region, including other aliases, but an alias may not point back to itself, directly or indirectly. You initialize these with memory_region_init_alias().