From patchwork Sun Jan 20 14:34:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 1028171 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43jHLM1QzXz9sBn for ; Mon, 21 Jan 2019 01:36:27 +1100 (AEDT) Received: from localhost ([127.0.0.1]:40592 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1glED3-0002pq-39 for incoming@patchwork.ozlabs.org; Sun, 20 Jan 2019 09:36:25 -0500 Received: from eggs.gnu.org ([209.51.188.92]:58730) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1glECI-0002pg-78 for qemu-devel@nongnu.org; Sun, 20 Jan 2019 09:35:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1glECG-0002Tm-9u for qemu-devel@nongnu.org; Sun, 20 Jan 2019 09:35:38 -0500 Received: from mx1.redhat.com ([209.132.183.28]:48234) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1glECC-0002On-2T for qemu-devel@nongnu.org; Sun, 20 Jan 2019 09:35:33 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9ABE181F0E; Sun, 20 Jan 2019 14:35:26 +0000 (UTC) Received: from localhost (ovpn-116-40.ams2.redhat.com [10.36.116.40]) by smtp.corp.redhat.com (Postfix) with ESMTP id B8C2A19C7D; Sun, 20 Jan 2019 14:35:25 +0000 (UTC) From: Stefan Hajnoczi To: qemu-devel@nongnu.org Date: Sun, 20 Jan 2019 14:34:48 +0000 Message-Id: <20190120143452.21683-1-stefanha@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Sun, 20 Jan 2019 14:35:26 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 0/4] arm: microbit Non-Volatile Memory Controller X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , jim@groklearning.com, =?utf-8?q?Steffen_G=C3=B6rtz?= , qemu-arm@nongnu.org, Joel Stanley , Paolo Bonzini , jusual@mail.ru Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" This series adds the Non-Volatile Memory Controller, which controls access to the User Information Control Registers (UICR), Factory Information Control Registers (FICR), and flash memory. This is the last piece of microbit work needed to make basic programs like Micropython "Hello world" work under QEMU. Originally sent as part of Steffen's longer microbit device emulation series, I extracted this and deferred it until later because cleanups were necessary: * Use memory_region_flush_rom_device() to dirty/invalidate memory [Peter] ^--- Paolo: I CCed you on this new memory API * Fix device-introspect-test segfault due to missing owner when initializing FICR and UICR memory regions [Peter] * Fix off-by-one assertion checks [Peter] * Fix missing whitespace at end of comment [Peter] * Clear UICR on reset - we'd need a block device for true non-volatility [Peter] Stefan Hajnoczi (1): memory: add memory_region_flush_rom_device() Steffen Görtz (3): hw/nvram/nrf51_nvm: Add nRF51 non-volatile memories arm: Instantiate NRF51 special NVM's and NVMC tests/microbit-test: Add tests for nRF51 NVMC hw/nvram/Makefile.objs | 1 + include/exec/memory.h | 18 ++ include/hw/arm/nrf51_soc.h | 2 + include/hw/nvram/nrf51_nvm.h | 64 ++++++ exec.c | 12 ++ hw/arm/nrf51_soc.c | 41 ++-- hw/nvram/nrf51_nvm.c | 381 +++++++++++++++++++++++++++++++++++ tests/microbit-test.c | 97 +++++++++ 8 files changed, 604 insertions(+), 12 deletions(-) create mode 100644 include/hw/nvram/nrf51_nvm.h create mode 100644 hw/nvram/nrf51_nvm.c