From patchwork Fri Sep 6 06:11:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 11134539 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D9B2C76 for ; Fri, 6 Sep 2019 06:19:39 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B78372075C for ; Fri, 6 Sep 2019 06:19:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=alistair23.me header.i=@alistair23.me header.b="TuIPp8Uf"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="hCImHbbY" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B78372075C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=alistair23.me Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:52492 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i67as-00011z-Tj for patchwork-qemu-devel@patchwork.kernel.org; Fri, 06 Sep 2019 02:19:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40044) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i67Sr-0002hf-2v for qemu-devel@nongnu.org; Fri, 06 Sep 2019 02:11:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i67Sp-0003tQ-PE for qemu-devel@nongnu.org; Fri, 06 Sep 2019 02:11:20 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:35689) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1i67Sp-0003tK-Lc for qemu-devel@nongnu.org; Fri, 06 Sep 2019 02:11:19 -0400 Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 2907620CB1; Fri, 6 Sep 2019 02:11:19 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute7.internal (MEProxy); Fri, 06 Sep 2019 02:11:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alistair23.me; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm2; bh=rH9HN90l0DkIZ 8oRDIrruzZS+xV4QJi52UZ0IPBbxzA=; b=TuIPp8Uf8NnlQ4GEm76E8Tz811J5E Gb6BxGgmIT33XMyN3PKS5tffUBqaNZ/bRGMjm+BSilW8FHwJ2jLN8ZCWB0GFhqgW eLD3V6qDHZ5QVL2LYf3KBO7mOl/YUgsrlXne/+oEWhQg9W6yev4ig6MQEzThA5HQ ensIeM+XC/FlKx+VnnzeFy2BBdSvX6PtrFnwkyNS4tqObcXX5XcOnGtLz8rIMDHL 0eg0bKnbCc0TpAlWZrLSVJtMb9Y0hP9o7tbwyL5LGYCHRlxMjjQ4F8xJVHF6cZ6X AV9PoQ+Ow5+0i3Wgubc6lSjS+ppteswlXsYxVUjDk2Up59nkNhuWZPNDw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=rH9HN90l0DkIZ8oRDIrruzZS+xV4QJi52UZ0IPBbxzA=; b=hCImHbbY rEOm6CEZY67C8JZX8K9z9uWQDxDfkgmgjT1ZoS1NZ7QVZkm53KAOpQS89lvg7uIs q5IqChNuAMeFFdjVC+Uz3Swwf4iFuVDU/NuJ3FRQXm8MsBlRaNOzsHqO1HfyjJUd Y6edqDblw8wx2WP+XuloYTRG5ncUhxZFBfDzH392ZzmC8ErlFhtJ/efSk4uxqeU5 VLYKpVtQjMSl3KxWa6zlQjKqHi9uUOd9azaADUgKiEZouvi9rby5aVcB9lwp6oKn 4JYzMI3IWfnZbGuklJMC21o2YxzxWDdvCYB8lYt7AQgsNoT1OABj1Jma3r33kLrO 99Vmd2Op9U0+1g== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddrudejkedgheelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomheptehlihhsthgrihhrucfhrhgrnhgtihhsuceorghlihhsthgr ihhrsegrlhhishhtrghirhdvfedrmhgvqeenucfkphepjeefrdelfedrkeegrddvtdekne curfgrrhgrmhepmhgrihhlfhhrohhmpegrlhhishhtrghirhesrghlihhsthgrihhrvdef rdhmvgenucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: from alistair-xps-14z.alistair23.me (c-73-93-84-208.hsd1.ca.comcast.net [73.93.84.208]) by mail.messagingengine.com (Postfix) with ESMTPA id 65509D6005D; Fri, 6 Sep 2019 02:11:18 -0400 (EDT) From: Alistair Francis To: qemu-devel@nongnu.org, peter.maydell@linaro.org Date: Thu, 5 Sep 2019 23:11:17 -0700 Message-Id: <29bce768ca12da6bab0b35865917f4094380cf50.1567750222.git.alistair@alistair23.me> X-Mailer: git-send-email 2.22.0 In-Reply-To: References: MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 66.111.4.25 Subject: [Qemu-devel] [PATCH v4 6/6] hw/arm: Add the Netduino Plus 2 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: alistair23@gmail.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Alistair Francis --- MAINTAINERS | 6 +++++ hw/arm/Kconfig | 3 +++ hw/arm/Makefile.objs | 1 + hw/arm/netduinoplus2.c | 58 ++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 68 insertions(+) create mode 100644 hw/arm/netduinoplus2.c diff --git a/MAINTAINERS b/MAINTAINERS index 4aea8cb3fa..5f23865ce3 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -828,6 +828,12 @@ M: Peter Maydell S: Maintained F: hw/arm/netduino2.c +Netduino Plus 2 +M: Alistair Francis +M: Peter Maydell +S: Maintained +F: hw/arm/netduinoplus2.c + SmartFusion2 M: Subbaraya Sundeep M: Peter Maydell diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig index 46a4f052e9..c153ac0975 100644 --- a/hw/arm/Kconfig +++ b/hw/arm/Kconfig @@ -101,6 +101,9 @@ config NETDUINOPLUS2 bool select STM32F405_SOC +config NETDUINOPLUS2 + bool + config NSERIES bool select OMAP diff --git a/hw/arm/Makefile.objs b/hw/arm/Makefile.objs index 0191c22c4f..4267805dc9 100644 --- a/hw/arm/Makefile.objs +++ b/hw/arm/Makefile.objs @@ -11,6 +11,7 @@ obj-$(CONFIG_MAINSTONE) += mainstone.o obj-$(CONFIG_MICROBIT) += microbit.o obj-$(CONFIG_MUSICPAL) += musicpal.o obj-$(CONFIG_NETDUINO2) += netduino2.o +obj-$(CONFIG_NETDUINOPLUS2) += netduinoplus2.o obj-$(CONFIG_NSERIES) += nseries.o obj-$(CONFIG_SX1) += omap_sx1.o obj-$(CONFIG_CHEETAH) += palm.o diff --git a/hw/arm/netduinoplus2.c b/hw/arm/netduinoplus2.c new file mode 100644 index 0000000000..4a75da8543 --- /dev/null +++ b/hw/arm/netduinoplus2.c @@ -0,0 +1,58 @@ +/* + * Netduino Plus 2 Machine Model + * + * Copyright (c) 2014 Alistair Francis + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "qemu/osdep.h" +#include "qapi/error.h" +#include "hw/boards.h" +#include "qemu/error-report.h" +#include "hw/arm/stm32f405_soc.h" +#include "hw/arm/boot.h" + +static void netduinoplus2_init(MachineState *machine) +{ + DeviceState *dev; + uint32_t kernel_entry; + + dev = qdev_create(NULL, TYPE_STM32F405_SOC); + qdev_prop_set_string(dev, "cpu-type", ARM_CPU_TYPE_NAME("cortex-m4")); + object_property_set_bool(OBJECT(dev), true, "realized", &error_fatal); + + kernel_entry = armv7m_load_kernel(ARM_CPU(first_cpu), + machine->kernel_filename, + FLASH_SIZE); + + object_property_set_int(OBJECT(first_cpu), kernel_entry, + "init-entry", &error_fatal); + object_property_set_int(OBJECT(first_cpu), + SRAM_BASE_ADDRESS + (SRAM_SIZE * 2) / 3, + "init-sp", &error_fatal); +} + +static void netduinoplus2_machine_init(MachineClass *mc) +{ + mc->desc = "Netduino Plus 2 Machine"; + mc->init = netduinoplus2_init; +} + +DEFINE_MACHINE("netduinoplus2", netduinoplus2_machine_init)