From nobody Thu Nov 13 19:19:15 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1582500701; cv=none; d=zohomail.com; s=zohoarc; b=nFEmnR5YPpA+QGoB9N/pwBI26nhm4sPZ8QFzCNbiaRZWmLy3jmcGfiRBjHsaXPMmdNguWpWd6EUzCTdLl+U/rYnFqfFWFl+lsMfzF2T5R/i60doQPbaqxroyUvXupvCgYDMnRw/GpPOopN4kb3MR+Hyff1r2Fu0GhWA8B4tuIlw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582500701; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=La3cNuySg7AvW4GmOXYMUpGVVY/iiFpjp6iEqmCbx0k=; b=ElqvCwxWfGhX8Ef8gPIl7cYfE+eKRFihgmZcvNKBy+lcSBMXbRelrniHzNcmWiZ7hSRVY/JBPHO00TIoe8VZlhA7gueiiWIs/hF5vTh2Zgtq/8h7uYpKdNz1LvPZP5KcPrAPeRklrZW7WG6YUOXtKmsDIgIkM+yRs40H64pVk/4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1582500701716759.126064171677; Sun, 23 Feb 2020 15:31:41 -0800 (PST) Received: from localhost ([::1]:57828 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j60iq-0002iv-2P for importer@patchew.org; Sun, 23 Feb 2020 18:31:40 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:37948) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j60hs-0001lt-6y for qemu-devel@nongnu.org; Sun, 23 Feb 2020 18:30:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j60hq-0006Zv-Vd for qemu-devel@nongnu.org; Sun, 23 Feb 2020 18:30:40 -0500 Received: from mail-wm1-x344.google.com ([2a00:1450:4864:20::344]:38663) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j60hq-0006ZS-Pc; Sun, 23 Feb 2020 18:30:38 -0500 Received: by mail-wm1-x344.google.com with SMTP id a9so7472584wmj.3; Sun, 23 Feb 2020 15:30:38 -0800 (PST) Received: from localhost.localdomain (47.red-88-21-205.staticip.rima-tde.net. [88.21.205.47]) by smtp.gmail.com with ESMTPSA id j11sm15322117wmi.3.2020.02.23.15.30.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 23 Feb 2020 15:30:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=La3cNuySg7AvW4GmOXYMUpGVVY/iiFpjp6iEqmCbx0k=; b=IjuY+e0S9ggGxJslwi56PZ/GXrgJo7mN5OLotADSFCPd5qSKsNs/w8V45wSyn+wDY2 Z4E9TcRdH2n6yfk/nigU3yTfVDIzs0fLagMhT9EgalqBSCDhDebx6sjzu/ZXvhLl0oBV ZK8OeJik6RyV781WV5RgXKhbvpVNOznZyppd0g53CK6HpcjIKcYbCpaWOYMpjOjeVUFn raKxIMQaxVmGRTkjju1nPEd/gr4J3ZftiYjEh2PXYdUtHyHWCSvYR4JlQpxv2DO/DYoL X3lBLToj89K7sh2ClfOFBm3HR+weEf4W+rH2SSa0aA+w9NWtPXU9F0+NMxie42K5NFv/ EQHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=La3cNuySg7AvW4GmOXYMUpGVVY/iiFpjp6iEqmCbx0k=; b=J4OcE2ByEmInwOg83nX25Prf668pUlOGKAfZxfPJ2s8AmUpZ+2esShTmn4zT0NJGkW IXcouT70gDAtN2sgXz3UpyeSyYjlKiZ9fhse+Se6aNA2x/ktv9J9rOO62LeyZh4dBNwz TCmPHsNLQqIqQrufu1KOydJuTDZVKGgUHZ2cnt92+XFLdzeeu6QS46xeuk6KVG2vrsRw kM1+uNOSlABU1xdVv8OyGyv4nYmQAZ9ZTTVayb2ExyHobzHMM6VauTKKKuF0Qq0S6Rlj mFTHHYbDsxU9rrpPXV2wAoYq0iJ+j09O+dPbBd0WLBWUYkADyHbX4oL6GxCdvCgVeaE4 5gdw== X-Gm-Message-State: APjAAAVML5xu0G5laufowKZqRmuWbqDn1dk5PrqPSJUWuStncB2Lv0ik 34DJVjS7VGBGJkwpKtz4t4GdQ8qo4sY= X-Google-Smtp-Source: APXvYqz8OMcIsqlsWRWxFlekfo2lM7hp/nzV64KA3b0vRMTzk107XZnMlBR3EGNoXb9b6G1PT15n1Q== X-Received: by 2002:a05:600c:291d:: with SMTP id i29mr18830025wmd.39.1582500637568; Sun, 23 Feb 2020 15:30:37 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v2 1/2] hw/arm/integratorcp: Map the audio codec controller Date: Mon, 24 Feb 2020 00:30:32 +0100 Message-Id: <20200223233033.15371-2-f4bug@amsat.org> X-Mailer: git-send-email 2.21.1 In-Reply-To: <20200223233033.15371-1-f4bug@amsat.org> References: <20200223233033.15371-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::344 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?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) The Linux kernel displays errors why trying to detect the PL041 audio interface: Linux version 4.16.0 (linus@genomnajs) (gcc version 7.2.1 20171011 (Linar= o GCC 7.2-2017.11)) #142 PREEMPT Wed May 9 13:24:55 CEST 2018 CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=3D00093177 CPU: VIVT data cache, VIVT instruction cache OF: fdt: Machine model: ARM Integrator/CP ... OF: amba_device_add() failed (-19) for /fpga/aaci@1d000000 Since we have it already modelled, simply plug it. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- v2: Kconfig change was not committed --- hw/arm/integratorcp.c | 1 + hw/arm/Kconfig | 1 + 2 files changed, 2 insertions(+) diff --git a/hw/arm/integratorcp.c b/hw/arm/integratorcp.c index 0cd94d9f09..59804140cd 100644 --- a/hw/arm/integratorcp.c +++ b/hw/arm/integratorcp.c @@ -644,6 +644,7 @@ static void integratorcp_init(MachineState *machine) qdev_get_gpio_in_named(icp, ICP_GPIO_MMC_WPROT, = 0)); qdev_connect_gpio_out(dev, 1, qdev_get_gpio_in_named(icp, ICP_GPIO_MMC_CARDIN,= 0)); + sysbus_create_varargs("pl041", 0x1d000000, pic[25], NULL); =20 if (nd_table[0].used) smc91c111_init(&nd_table[0], 0xc8000000, pic[27]); diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig index 3d86691ae0..61635f52c4 100644 --- a/hw/arm/Kconfig +++ b/hw/arm/Kconfig @@ -69,6 +69,7 @@ config INTEGRATOR select INTEGRATOR_DEBUG select PL011 # UART select PL031 # RTC + select PL041 # audio select PL050 # keyboard/mouse select PL110 # pl111 LCD controller select PL181 # display --=20 2.21.1 From nobody Thu Nov 13 19:19:15 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=amsat.org ARC-Seal: i=1; a=rsa-sha256; t=1582500777; cv=none; d=zohomail.com; s=zohoarc; b=g0e/pV84x31X/a0eAokJe8EWDT5AVS8V3Jtok7lS5avoEB61Q3VkwnRShzgQ3RiSrb4MTx+jKdh5BY1sSGjx4sY++/G6Jv9gotLKytKBfFIpURI2080yZndALeBoqafLv4q1AJ2Vx7KlfvdhI2DxM1MneO0rVAeTF0E+RAY6Esk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582500777; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=mmzX3h5HCvKUNKd1CHnk/esd8YbYWYAXpwuKwHJY+ek=; b=El0DFx1s9gCxNpylvRbKkrmZvJD3EDSj1SvSIJnSZ7UlCRIjIBGufTdhxcdFunhGoP7s9LeN7UICXUPW8pNh/JBJ739EcWc+R9rMzdsg5aelh9khJhpwfkrpsdG1KhVuWQF499xyU71oJKuDSW/64cumeBSV5G35+fRh3wPNb3o= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1582500777356962.6942016391718; Sun, 23 Feb 2020 15:32:57 -0800 (PST) Received: from localhost ([::1]:57850 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j60k4-0004Gx-DZ for importer@patchew.org; Sun, 23 Feb 2020 18:32:56 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:37964) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j60ht-0001m4-93 for qemu-devel@nongnu.org; Sun, 23 Feb 2020 18:30:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j60hs-0006by-58 for qemu-devel@nongnu.org; Sun, 23 Feb 2020 18:30:41 -0500 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]:34749) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j60hr-0006b5-V4; Sun, 23 Feb 2020 18:30:40 -0500 Received: by mail-wr1-x441.google.com with SMTP id n10so8287010wrm.1; Sun, 23 Feb 2020 15:30:39 -0800 (PST) Received: from localhost.localdomain (47.red-88-21-205.staticip.rima-tde.net. [88.21.205.47]) by smtp.gmail.com with ESMTPSA id j11sm15322117wmi.3.2020.02.23.15.30.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 23 Feb 2020 15:30:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=mmzX3h5HCvKUNKd1CHnk/esd8YbYWYAXpwuKwHJY+ek=; b=rOetdeGIusYkzeKGfDglgybHzfkxOhdY0XpSqhWDweL1AzzFgf0D1NFFdbrWBlSNxZ WNX+B+QR+m+dqnopKSR6p0/k1WdYRfC7WfLxACKvn574QE/MxTwj/xblPK6vJ4e+/4eb 4/ujljPj9wo/njOevulI2MdVsouI05B7zELKWIRorCLq9MxuUnEKnDsFzvlAjXWV38of 33g3NsRRLEfya+qNIT7TeczC9GiOx9CBQl/J/WkZmCO263DSxxOqwoCGvDoyRi6XVhwu Dl2kAOTuGHNXLQ1OUnBaDapJAlxF/Kz63x0tm82xk68Thl0joaPvvE7tFIgUOCQBwhCF ujow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=mmzX3h5HCvKUNKd1CHnk/esd8YbYWYAXpwuKwHJY+ek=; b=kDl2/KxejZawn3krIAAlnmhfiDCLf+OaX/cCv97eUwUcq3ndB2EYdraUaC0ZLpyNQe GGmZiLlZw11fxWRQ/NG8okW9s2LcwLTSp/0lvl5WPQdJBfecLonet+B08u2zuEe3GQEZ 4nFP0xIzBAx5e95Q+6kqfYdZnBvGKU1eSJXwqXJN4h/g72vH01UIAVSavH7bxG8uTleU ecXCnacGIeCrjwUJPDbqlRC/pNd6Ipa8k1Yz6dxl1SQOjeL+1yMpOo8cGQeCosbvnIxY +/ZH/UTjs1FLwT1wT9r81WKi3zs5+C8Bn0Nbwe4WAFLIJ3Zj4bTsWVlTgvRcKo7fOhev uEqw== X-Gm-Message-State: APjAAAXd8WkG2LABKVUwT8m18YvbJH4DTrnyrXKydt4COLSvQ1niqIoQ 59AQ/ZgvRN5qz5RtAL2pEh+h5EyVymI= X-Google-Smtp-Source: APXvYqxPkMprcNMloDLoVymPoGO1iE4iDt7D580xVcFy6z1HCjFFfLG+C9W4skzBBQjU4bi9hYUbsg== X-Received: by 2002:adf:f7c6:: with SMTP id a6mr65563822wrq.164.1582500638714; Sun, 23 Feb 2020 15:30:38 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [RFC PATCH v2 2/2] hw/arm/integratorcp: Map a CFI parallel flash Date: Mon, 24 Feb 2020 00:30:33 +0100 Message-Id: <20200223233033.15371-3-f4bug@amsat.org> X-Mailer: git-send-email 2.21.1 In-Reply-To: <20200223233033.15371-1-f4bug@amsat.org> References: <20200223233033.15371-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::441 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?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) The Linux kernel displays errors why trying to detect the flash: Linux version 4.16.0 (linus@genomnajs) (gcc version 7.2.1 20171011 (Linar= o GCC 7.2-2017.11)) #142 PREEMPT Wed May 9 13:24:55 CEST 2018 CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=3D00093177 CPU: VIVT data cache, VIVT instruction cache OF: fdt: Machine model: ARM Integrator/CP ... of-flash 24000000.flash: Integrator/CP flash protection of-flash 24000000.flash: do_map_probe() failed for type cfi_probe of-flash 24000000.flash: do_map_probe() failed Since we have a CFI pflash model available, wire it. The kernel properly detects it: of-flash 24000000.flash: Integrator/CP flash protection 24000000.flash: Found 1 x32 devices at 0x0 in 32-bit bank. Manufacturer I= D 0x000000 Chip ID 0x000000 Intel/Sharp Extended Query Table at 0x0031 Using buffer write method Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- v2: Kconfig change was not committed RFC because I have no idea of the flash model, its ID code, and which default CFI family (1 or 2). --- hw/arm/integratorcp.c | 11 +++++++++++ hw/arm/Kconfig | 1 + 2 files changed, 12 insertions(+) diff --git a/hw/arm/integratorcp.c b/hw/arm/integratorcp.c index 59804140cd..40cedfd55a 100644 --- a/hw/arm/integratorcp.c +++ b/hw/arm/integratorcp.c @@ -8,6 +8,7 @@ */ =20 #include "qemu/osdep.h" +#include "qemu/units.h" #include "qapi/error.h" #include "cpu.h" #include "hw/sysbus.h" @@ -24,6 +25,7 @@ #include "hw/char/pl011.h" #include "hw/hw.h" #include "hw/irq.h" +#include "hw/block/flash.h" =20 #define TYPE_INTEGRATOR_CM "integrator_core" #define INTEGRATOR_CM(obj) \ @@ -589,6 +591,7 @@ static void integratorcp_init(MachineState *machine) MemoryRegion *ram_alias =3D g_new(MemoryRegion, 1); qemu_irq pic[32]; DeviceState *dev, *sic, *icp; + DriveInfo *dinfo; int i; =20 cpuobj =3D object_new(machine->cpu_type); @@ -646,6 +649,14 @@ static void integratorcp_init(MachineState *machine) qdev_get_gpio_in_named(icp, ICP_GPIO_MMC_CARDIN,= 0)); sysbus_create_varargs("pl041", 0x1d000000, pic[25], NULL); =20 + dinfo =3D drive_get(IF_PFLASH, 0, 0); + if (!pflash_cfi01_register(0x24000000, "pflash", 16 * MiB, + dinfo ? blk_by_legacy_dinfo(dinfo) : NULL, + 64 * KiB, 4, 0, 0, 0, 0, 0)) { + error_report("Error registering flash memory"); + exit(1); + } + if (nd_table[0].used) smc91c111_init(&nd_table[0], 0xc8000000, pic[27]); =20 diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig index 61635f52c4..7f179f960f 100644 --- a/hw/arm/Kconfig +++ b/hw/arm/Kconfig @@ -73,6 +73,7 @@ config INTEGRATOR select PL050 # keyboard/mouse select PL110 # pl111 LCD controller select PL181 # display + select PFLASH_CFI01 select SMC91C111 =20 config MAINSTONE --=20 2.21.1