From patchwork Sun Jul 5 20:46:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 278519 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D23DDC433E0 for ; Sun, 5 Jul 2020 20:47:53 +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 9F6962074F for ; Sun, 5 Jul 2020 20:47:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="kT1j+IAI" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9F6962074F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=amsat.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:38786 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jsBYG-0006Fz-V7 for qemu-devel@archiver.kernel.org; Sun, 05 Jul 2020 16:47:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50658) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jsBX5-0004T8-RU; Sun, 05 Jul 2020 16:46:39 -0400 Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]:38676) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jsBX4-0000pH-6M; Sun, 05 Jul 2020 16:46:39 -0400 Received: by mail-wm1-x343.google.com with SMTP id f18so39594739wml.3; Sun, 05 Jul 2020 13:46:37 -0700 (PDT) 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=6rxTtNzGxZKeUz8u/465WGrq0JGlEJZidTb9y8deq6c=; b=kT1j+IAINJp7ET0x51OC/MutF4L7mkS5pCL+JGPwLNniC8TM6Ri7o5a9xToazhcOTI lzMg36zKQNqHJMib3Cub0vAkeA9bHaKwha7Dccc4Sx0FRjLwN8SBEb/aoXyXa2Lhzf9Q ierLrYARMMXpjWl9S6FDg9xYHNMgsBgo/rl6vlc+hrJbMvaHng+5df1I0S3hmFpJZhy7 RJM43IgBWG8L3VHNG42x2NSKU/YzESwdiR433jvZdfi/uQZArT+kGkt5PHkpxsPVjOnJ Qi3OXVcILGjSqEU5vWIE/gd5advfeCSdlDJLZlto5DotH1CQD/YCFpze6VT4puP2W5Bo yQHg== 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=6rxTtNzGxZKeUz8u/465WGrq0JGlEJZidTb9y8deq6c=; b=qhrx7fhr5T2QLezImpODrq7pWtjSbg82YjSCevbKf3aUo1mdVYd9pi4A4d3BgNzCnw qS003ArLUHDmD5SgktemIkw/P0WHbrem+s2v3YMzfdTaTvSg/PM7u0RUGBUtoBkAV9/o C/tRNFSDXmJfJamCqfBnJH/YkISQ4sL4V84GUZ9Bumlq2JNEnzQkynDUgHmXWJ/8oRvm LRNe4IMVtBgKfKyCFbpaz1snP0ybUl9OIhAqWbeFQmpQEck0Kw+LGCp9G9lI5gRBGMfT W5TJowthVkYlOXvUvkl5evy9xMSTl7IzF9o/0+khiYl+anBP/i+CpiO1MhwKPJWdGhdP 2e/A== X-Gm-Message-State: AOAM531FVuYxRwxshUhsnCp5BX3iRe2hMNLTli8Eix/BsYaxBgfLFF4B aYvmrgjo0tsJrwNixJQnDbxTQ6/TIUU= X-Google-Smtp-Source: ABdhPJyKUKMwKXsEBNjcQ1ADhx/FTh/fF0qzFCVe6Jso5XEsc4jsCxugiJJqCezX0WzWafqrgv9PtQ== X-Received: by 2002:a1c:a986:: with SMTP id s128mr49169383wme.121.1593981996400; Sun, 05 Jul 2020 13:46:36 -0700 (PDT) Received: from localhost.localdomain (1.red-83-51-162.dynamicip.rima-tde.net. [83.51.162.1]) by smtp.gmail.com with ESMTPSA id g144sm51397817wme.2.2020.07.05.13.46.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Jul 2020 13:46:35 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v4 03/10] hw/sd/pl181: Add TODO to use Fifo32 API Date: Sun, 5 Jul 2020 22:46:23 +0200 Message-Id: <20200705204630.4133-4-f4bug@amsat.org> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20200705204630.4133-1-f4bug@amsat.org> References: <20200705204630.4133-1-f4bug@amsat.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::343; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-x343.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: 0 X-Spam_score: 0.0 X-Spam_bar: / X-Spam_report: (0.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=1, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action 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_Mathieu-Daud=C3=A9?= , Alistair Francis Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Add TODO to use Fifo32 API from "qemu/fifo32.h". Signed-off-by: Philippe Mathieu-Daudé --- hw/sd/pl181.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/sd/pl181.c b/hw/sd/pl181.c index 3fc2cdd71a..86219c851d 100644 --- a/hw/sd/pl181.c +++ b/hw/sd/pl181.c @@ -57,7 +57,7 @@ typedef struct PL181State { http://www.arm.linux.org.uk/developer/patches/viewpatch.php?id=4446/1 */ int32_t linux_hack; - uint32_t fifo[PL181_FIFO_LEN]; + uint32_t fifo[PL181_FIFO_LEN]; /* TODO use Fifo32 */ qemu_irq irq[2]; /* GPIO outputs for 'card is readonly' and 'card inserted' */ qemu_irq cardstatus[2]; From patchwork Sun Jul 5 20:46:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 278517 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3BB07C433E0 for ; Sun, 5 Jul 2020 20:50:00 +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 058002073E for ; Sun, 5 Jul 2020 20:50:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="mc2aaxRi" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 058002073E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=amsat.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:47048 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jsBaJ-0001Hf-BL for qemu-devel@archiver.kernel.org; Sun, 05 Jul 2020 16:49:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50672) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jsBX6-0004Wa-Vg; Sun, 05 Jul 2020 16:46:40 -0400 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]:40836) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jsBX5-0000pR-F5; Sun, 05 Jul 2020 16:46:40 -0400 Received: by mail-wr1-x441.google.com with SMTP id f2so10762416wrp.7; Sun, 05 Jul 2020 13:46:38 -0700 (PDT) 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=WxPjkbT1Cf+fTJhIz6EA4Q+a6g7EtjSauXqyKUUtqbs=; b=mc2aaxRiAz5Y+OEAGL+ybYmW+l0Bz0R2Ha60762Wtp6AqE1nSMUAWgkSgzcfZOUWBE or23TPDUpHb4t/cC+k8K7o+tDy8stfHAWygt+CpZ/ExKqIJIkaBGTY1xn5sgytoBFG/U refyFb9/5P+yQK0JEBuTckvRtmyo4dgBOKxPvza5YMh6HSgq+ZrMjs3UNOxWjxYRdsDj fXEX72oVKjWAqGDVEHEtk5Sqg6QOfFj4BXql57UdkBq0Kq8qzalcG4JFXFSPsclNEuI+ HOu49jQHSFE93+ITlUirQHQbGh4w+jzeLOmnQhLZLQqd6pI5a9JLh0oOd/jfg2U2v3H0 0hLg== 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=WxPjkbT1Cf+fTJhIz6EA4Q+a6g7EtjSauXqyKUUtqbs=; b=TIkKK/Tc9lloLNORhMAugF9dYWsFvMYQRV9RJKHgf0016KstBMDbH5gkm8kEd+ma1x 2xi+4K9jrYSwACd1Ika43PFmUFsN/Vtxy5O91hk45DCSHbiYpFtZIpSKi0pM0GXsk9/J Vi3Lp2tO108/TUO8yr1hlcf/dv6DZwe4pHDpE1+Xiod4fz4uqwf+v+hjomsrz2QDz245 oxHnsDGM6CIgb/34jyohzBMJSYX1ZfZNWd1ogkOJ0Vs3OfhpOnFpm2skhgN7hjoJRGwd x/G4bPA1C8u7euadBK9OVzVpY2MQvIxiMoSNEH6a5sSMrDDHwwM1vYLutdyVSPRSVagM fEcA== X-Gm-Message-State: AOAM530q1qIrKl9U8USm+m8twdBPYZm3kTbHRxbJPk0YJ8qDypho1F1a 0VYxCIjJ345du2yYCVqj7RW1zmv4YeM= X-Google-Smtp-Source: ABdhPJw91Wwsgy9yklgukYdN1oyXPDCzUEIFnV6ARwpc631pb89EqxuL+33SqYWbyZ97j4i35SQlbg== X-Received: by 2002:adf:e6c8:: with SMTP id y8mr48495990wrm.40.1593981997457; Sun, 05 Jul 2020 13:46:37 -0700 (PDT) Received: from localhost.localdomain (1.red-83-51-162.dynamicip.rima-tde.net. [83.51.162.1]) by smtp.gmail.com with ESMTPSA id g144sm51397817wme.2.2020.07.05.13.46.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Jul 2020 13:46:36 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v4 04/10] hw/arm/versatilepb: Comment to remember some IRQs lines are left unwired Date: Sun, 5 Jul 2020 22:46:24 +0200 Message-Id: <20200705204630.4133-5-f4bug@amsat.org> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20200705204630.4133-1-f4bug@amsat.org> References: <20200705204630.4133-1-f4bug@amsat.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::441; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x441.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: 0 X-Spam_score: 0.0 X-Spam_bar: / X-Spam_report: (0.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=1, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action 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_Mathieu-Daud=C3=A9?= , Alistair Francis Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" The 'card is readonly' and 'card inserted' IRQs are not wired. Add a comment in case someone know where to wire them. Signed-off-by: Philippe Mathieu-Daudé --- hw/arm/versatilepb.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/arm/versatilepb.c b/hw/arm/versatilepb.c index e596b8170f..45a13ae2b9 100644 --- a/hw/arm/versatilepb.c +++ b/hw/arm/versatilepb.c @@ -310,7 +310,9 @@ static void versatile_init(MachineState *machine, int board_id) qdev_connect_gpio_out(sysctl, 0, qdev_get_gpio_in(dev, 0)); sysbus_create_varargs("pl181", 0x10005000, sic[22], sic[1], NULL); + /* FIXME wire 'card is readonly' and 'card inserted' IRQs? */ sysbus_create_varargs("pl181", 0x1000b000, sic[23], sic[2], NULL); + /* FIXME wire 'card is readonly' and 'card inserted' IRQs? */ /* Add PL031 Real Time Clock. */ sysbus_create_simple("pl031", 0x101e8000, pic[10]); From patchwork Sun Jul 5 20:46:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 278518 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D09AAC433E0 for ; Sun, 5 Jul 2020 20:48:19 +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 9A6BF2073E for ; Sun, 5 Jul 2020 20:48:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Y1KFWg4J" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9A6BF2073E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=amsat.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:39518 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jsBYg-0006ZE-SQ for qemu-devel@archiver.kernel.org; Sun, 05 Jul 2020 16:48:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50700) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jsBXA-0004eh-MV; Sun, 05 Jul 2020 16:46:44 -0400 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]:43107) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jsBX7-0000pk-Pz; Sun, 05 Jul 2020 16:46:43 -0400 Received: by mail-wr1-x441.google.com with SMTP id j4so36312025wrp.10; Sun, 05 Jul 2020 13:46:41 -0700 (PDT) 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=oBbjHGJBucg5THxZq7KR1Jrgf1YjvhSClfXgvgV5JcQ=; b=Y1KFWg4JbGmm5RET/B82Sot6qGMvhQslhwXjX1IOWPnQ8H37mqCIN8Tvwp9DmxQ2J5 IXE2QtsgZrQvwxeEI2KdoORTnuuVOrisUYe4lxso5VH5oe9A/u+3hX/PPnjtXy3lr5y0 Eb5rLbV8jpKvzjdc5LhoTMTjp0dnNuyT/O419mwm4kenSVWsXfp+fDCxftaH1VdjZWOI XyZLlOtmuB6bbDaRyR1QoIuxJ0LNr0x0R4TCF9GV3EuMwRNmhqLHgb8hmdJgnmh1+W3k sJxxAOhO9rXo5NlNYurp3UaA3maaxOx1OCsQQ0Kl/jsaR4i1Z8wSaomp+bYlnl+ObEHH MywQ== 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=oBbjHGJBucg5THxZq7KR1Jrgf1YjvhSClfXgvgV5JcQ=; b=WYRHS2WOlDoNAZRy/zQcOKXEGkkGFgEt/pZlDwBjp4hioMhOvqhJcWKijOnRJi5MWc 506OtuvPl0wZcpJ22PeElOzUVVVGmAcR5hFcXARWDUzjz1jZatS5TpviUC9DzwqbARSJ h0ke2ayNHZIDFVbIPlgsQZi9+wGR7E2b79LWdFg0ONaYbBgJmaPuXhyjjWyy5OK1yQAu 5CfhQJWOyKf+sX4HihUb2xC76vtDgF6dqYF/I5Osf0ovYaH984eZHXC0XjXHnh3v9eWX o6EgyvJXjQFkw5Tg64J5YbJdAwHe6d83C9vIRhMIH3yKfyvvq6bPgQHSIsSzzsGs+tUM wZxw== X-Gm-Message-State: AOAM531oN1YOeVPmXo++KBmZyQgjx3G4+2gEoMweMRAhnuJWcCvzhLQU binmiIokag6P2FHmFwOuKFZC3+1ZaiI= X-Google-Smtp-Source: ABdhPJxOITLXvnAw/Ph5iYXBLAuQjO3e57tDfcvXcUrNup+TxLdjbI2xhRLlLj9tenqWNg7qGtFRfw== X-Received: by 2002:adf:efc9:: with SMTP id i9mr48377933wrp.77.1593981999790; Sun, 05 Jul 2020 13:46:39 -0700 (PDT) Received: from localhost.localdomain (1.red-83-51-162.dynamicip.rima-tde.net. [83.51.162.1]) by smtp.gmail.com with ESMTPSA id g144sm51397817wme.2.2020.07.05.13.46.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Jul 2020 13:46:39 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v4 06/10] hw/sd/pl181: Expose a SDBus and connect the SDCard to it Date: Sun, 5 Jul 2020 22:46:26 +0200 Message-Id: <20200705204630.4133-7-f4bug@amsat.org> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20200705204630.4133-1-f4bug@amsat.org> References: <20200705204630.4133-1-f4bug@amsat.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::441; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x441.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: 0 X-Spam_score: 0.0 X-Spam_bar: / X-Spam_report: (0.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=1, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action 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_Mathieu-Daud=C3=A9?= , Alistair Francis Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Convert the controller to the SDBus API: - add the a TYPE_PL181_BUS object of type TYPE_SD_BUS, - adapt the SDBusClass set_inserted/set_readonly handlers - create the bus in the PL181 controller - switch legacy sd_*() API to the sdbus_*() API. Signed-off-by: Philippe Mathieu-Daudé --- Since v3: Addressed Peter comment, adding TYPE_PL181_BUS: https://www.mail-archive.com/qemu-devel@nongnu.org/msg515866.html --- hw/sd/pl181.c | 67 +++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 51 insertions(+), 16 deletions(-) diff --git a/hw/sd/pl181.c b/hw/sd/pl181.c index ab4cd733a4..f6de06ece8 100644 --- a/hw/sd/pl181.c +++ b/hw/sd/pl181.c @@ -17,6 +17,7 @@ #include "qemu/module.h" #include "qemu/error-report.h" #include "qapi/error.h" +#include "hw/qdev-properties.h" //#define DEBUG_PL181 1 @@ -32,11 +33,13 @@ do { printf("pl181: " fmt , ## __VA_ARGS__); } while (0) #define TYPE_PL181 "pl181" #define PL181(obj) OBJECT_CHECK(PL181State, (obj), TYPE_PL181) +#define TYPE_PL181_BUS "pl181-bus" + typedef struct PL181State { SysBusDevice parent_obj; MemoryRegion iomem; - SDState *card; + SDBus sdbus; uint32_t clock; uint32_t power; uint32_t cmdarg; @@ -183,7 +186,7 @@ static void pl181_do_command(PL181State *s) request.cmd = s->cmd & PL181_CMD_INDEX; request.arg = s->cmdarg; DPRINTF("Command %d %08x\n", request.cmd, request.arg); - rlen = sd_do_command(s->card, &request, response); + rlen = sdbus_do_command(&s->sdbus, &request, response); if (rlen < 0) goto error; if (s->cmd & PL181_CMD_RESPONSE) { @@ -224,12 +227,12 @@ static void pl181_fifo_run(PL181State *s) int is_read; is_read = (s->datactrl & PL181_DATA_DIRECTION) != 0; - if (s->datacnt != 0 && (!is_read || sd_data_ready(s->card)) + if (s->datacnt != 0 && (!is_read || sdbus_data_ready(&s->sdbus)) && !s->linux_hack) { if (is_read) { n = 0; while (s->datacnt && s->fifo_len < PL181_FIFO_LEN) { - value |= (uint32_t)sd_read_data(s->card) << (n * 8); + value |= (uint32_t)sdbus_read_data(&s->sdbus) << (n * 8); s->datacnt--; n++; if (n == 4) { @@ -250,7 +253,7 @@ static void pl181_fifo_run(PL181State *s) } n--; s->datacnt--; - sd_write_data(s->card, value & 0xff); + sdbus_write_data(&s->sdbus, value & 0xff); value >>= 8; } } @@ -456,6 +459,20 @@ static const MemoryRegionOps pl181_ops = { .endianness = DEVICE_NATIVE_ENDIAN, }; +static void pl181_set_readonly(DeviceState *dev, bool level) +{ + PL181State *s = (PL181State *)dev; + + qemu_set_irq(s->card_readonly, level); +} + +static void pl181_set_inserted(DeviceState *dev, bool level) +{ + PL181State *s = (PL181State *)dev; + + qemu_set_irq(s->card_inserted, level); +} + static void pl181_reset(DeviceState *d) { PL181State *s = PL181(d); @@ -479,12 +496,9 @@ static void pl181_reset(DeviceState *d) s->mask[0] = 0; s->mask[1] = 0; - /* We can assume our GPIO outputs have been wired up now */ - sd_set_cb(s->card, s->card_readonly, s->card_inserted); - /* Since we're still using the legacy SD API the card is not plugged - * into any bus, and we must reset it manually. - */ - device_legacy_reset(DEVICE(s->card)); + /* Reset other state based on current card insertion/readonly status */ + pl181_set_inserted(DEVICE(s), sdbus_get_inserted(&s->sdbus)); + pl181_set_readonly(DEVICE(s), sdbus_get_readonly(&s->sdbus)); } static void pl181_init(Object *obj) @@ -499,19 +513,24 @@ static void pl181_init(Object *obj) sysbus_init_irq(sbd, &s->irq[1]); qdev_init_gpio_out_named(dev, &s->card_readonly, "card-read-only", 1); qdev_init_gpio_out_named(dev, &s->card_inserted, "card-inserted", 1); + + qbus_create_inplace(&s->sdbus, sizeof(s->sdbus), + TYPE_PL181_BUS, dev, "sd-bus"); } static void pl181_realize(DeviceState *dev, Error **errp) { - PL181State *s = PL181(dev); + DeviceState *card; DriveInfo *dinfo; /* FIXME use a qdev drive property instead of drive_get_next() */ + card = qdev_new(TYPE_SD_CARD); dinfo = drive_get_next(IF_SD); - s->card = sd_init(dinfo ? blk_by_legacy_dinfo(dinfo) : NULL, false); - if (s->card == NULL) { - error_setg(errp, "sd_init failed"); - } + qdev_prop_set_drive_err(card, "drive", blk_by_legacy_dinfo(dinfo), + &error_fatal); + qdev_realize_and_unref(card, + qdev_get_child_bus(dev, "sd-bus"), + &error_fatal); } static void pl181_class_init(ObjectClass *klass, void *data) @@ -533,9 +552,25 @@ static const TypeInfo pl181_info = { .class_init = pl181_class_init, }; +static void pl181_bus_class_init(ObjectClass *klass, void *data) +{ + SDBusClass *sbc = SD_BUS_CLASS(klass); + + sbc->set_inserted = pl181_set_inserted; + sbc->set_readonly = pl181_set_readonly; +} + +static const TypeInfo pl181_bus_info = { + .name = TYPE_PL181_BUS, + .parent = TYPE_SD_BUS, + .instance_size = sizeof(SDBus), + .class_init = pl181_bus_class_init, +}; + static void pl181_register_types(void) { type_register_static(&pl181_info); + type_register_static(&pl181_bus_info); } type_init(pl181_register_types) From patchwork Sun Jul 5 20:46:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 278516 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DF572C433E0 for ; Sun, 5 Jul 2020 20:51:56 +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 A85CE20724 for ; Sun, 5 Jul 2020 20:51:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="XCFxlx/+" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A85CE20724 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=amsat.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:52448 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jsBcB-0003dO-Vd for qemu-devel@archiver.kernel.org; Sun, 05 Jul 2020 16:51:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50722) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jsBXB-0004kj-Tc; Sun, 05 Jul 2020 16:46:45 -0400 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]:40515) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jsBXA-0000q9-6d; Sun, 05 Jul 2020 16:46:45 -0400 Received: by mail-wm1-x329.google.com with SMTP id f139so39591232wmf.5; Sun, 05 Jul 2020 13:46:43 -0700 (PDT) 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=9r/UuMNriotkB9gXNJa6dykrAj3Jm9YA/tEThvkByFI=; b=XCFxlx/+OKFUTT9H1bSYw9a34DB2DnStTMlRHTeJX+STyC3PCjjO6V4LueXAeuWddy mgVcF+yjl91IJSQbwjl4ibglXO73LXhtdpsigv8VrUe+ksLjdaP0EC+TJgRTS0kFAONO tsW9hgiuz/pZVTGJox/JHUXsbzuyuvOZVO9B1PEINypJs+r3m/X2rOVju6cXQ0ddn5Po ArWyos2HTJ2ZBkrqZIhHYfpvOdiLNQeSSuyvwSkYP+Qa0yCpMVZej4R/0iyLUKQ2wknS 8d6zLwLsVS1NS/XtpDx9ROCM8uhYGuO56ymKVHDafSMsHk1vLYYfUXuHuk8ochExs8+z kfxw== 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=9r/UuMNriotkB9gXNJa6dykrAj3Jm9YA/tEThvkByFI=; b=KAHsc0I3tNmPElpY/MQRvpdfjdB1Kbksx/95jOWRV+/qVyyjsvoGXABddwMcD0sYv7 4X1zxL6DNg6MyXz4w8utfSGQ3T8PwxMrwoBAsHd4iSo2hS4PqLKmevniTH8VZXdU6wmq jZMlsap+uKDDakewP2FK8qXEcCIULHE/nOIBkHvvZm+bMsbVfUW16uS4w78qHiFYnHkI gfDdba2jBj8VmqsYsbwyTUTUN+FC0YvppWYDaTeccQ5frPHsczVi/0PQegBV9t9OR0EE c/oFu4/9l3e0qwTtdOxo7di02megZzv/Tp3UcJAFJXjmWCFAxKmMrRK8RZ3+pjoBAMOg QFIQ== X-Gm-Message-State: AOAM530Q1r846H1F28sV7mM5DJVfmomqx9QiD4FV/feQvoGUg+iTrt8+ i678xVWAdsuDRDiJ+VeCYjDpCEBC5nI= X-Google-Smtp-Source: ABdhPJyE7dTtryLtaSUYdhYaKoVGMGVmflRl2pVmy6IPbvISfh4+5Id0+WwPDEvWgbtN0G0g0KTCPw== X-Received: by 2002:a7b:c956:: with SMTP id i22mr47109373wml.95.1593982002099; Sun, 05 Jul 2020 13:46:42 -0700 (PDT) Received: from localhost.localdomain (1.red-83-51-162.dynamicip.rima-tde.net. [83.51.162.1]) by smtp.gmail.com with ESMTPSA id g144sm51397817wme.2.2020.07.05.13.46.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Jul 2020 13:46:41 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v4 08/10] hw/sd/pl181: Replace disabled fprintf()s by trace events Date: Sun, 5 Jul 2020 22:46:28 +0200 Message-Id: <20200705204630.4133-9-f4bug@amsat.org> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20200705204630.4133-1-f4bug@amsat.org> References: <20200705204630.4133-1-f4bug@amsat.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-x329.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: 0 X-Spam_score: 0.0 X-Spam_bar: / X-Spam_report: (0.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=1, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action 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_Mathieu-Daud=C3=A9?= , Alistair Francis Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Convert disabled DPRINTF() to trace events and remove ifdef'ry. Signed-off-by: Philippe Mathieu-Daudé --- hw/sd/pl181.c | 26 +++++++++----------------- hw/sd/trace-events | 10 ++++++++++ 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/hw/sd/pl181.c b/hw/sd/pl181.c index f69488ebac..574500ce60 100644 --- a/hw/sd/pl181.c +++ b/hw/sd/pl181.c @@ -17,15 +17,7 @@ #include "qemu/module.h" #include "qemu/error-report.h" #include "qapi/error.h" - -//#define DEBUG_PL181 1 - -#ifdef DEBUG_PL181 -#define DPRINTF(fmt, ...) \ -do { printf("pl181: " fmt , ## __VA_ARGS__); } while (0) -#else -#define DPRINTF(fmt, ...) do {} while(0) -#endif +#include "trace.h" #define PL181_FIFO_LEN 16 @@ -158,7 +150,7 @@ static void pl181_fifo_push(PL181State *s, uint32_t value) n = (s->fifo_pos + s->fifo_len) & (PL181_FIFO_LEN - 1); s->fifo_len++; s->fifo[n] = value; - DPRINTF("FIFO push %08x\n", (int)value); + trace_pl181_fifo_push(value); } static uint32_t pl181_fifo_pop(PL181State *s) @@ -172,7 +164,7 @@ static uint32_t pl181_fifo_pop(PL181State *s) value = s->fifo[s->fifo_pos]; s->fifo_len--; s->fifo_pos = (s->fifo_pos + 1) & (PL181_FIFO_LEN - 1); - DPRINTF("FIFO pop %08x\n", (int)value); + trace_pl181_fifo_pop(value); return value; } @@ -184,7 +176,7 @@ static void pl181_do_command(PL181State *s) request.cmd = s->cmd & PL181_CMD_INDEX; request.arg = s->cmdarg; - DPRINTF("Command %d %08x\n", request.cmd, request.arg); + trace_pl181_command_send(request.cmd, request.arg); rlen = sdbus_do_command(&s->sdbus, &request, response); if (rlen < 0) goto error; @@ -201,16 +193,16 @@ static void pl181_do_command(PL181State *s) s->response[2] = ldl_be_p(&response[8]); s->response[3] = ldl_be_p(&response[12]) & ~1; } - DPRINTF("Response received\n"); + trace_pl181_command_response_pending(); s->status |= PL181_STATUS_CMDRESPEND; } else { - DPRINTF("Command sent\n"); + trace_pl181_command_sent(); s->status |= PL181_STATUS_CMDSENT; } return; error: - DPRINTF("Timeout\n"); + trace_pl181_command_timeout(); s->status |= PL181_STATUS_CMDTIMEOUT; } @@ -262,11 +254,11 @@ static void pl181_fifo_run(PL181State *s) s->status |= PL181_STATUS_DATAEND; /* HACK: */ s->status |= PL181_STATUS_DATABLOCKEND; - DPRINTF("Transfer Complete\n"); + trace_pl181_fifo_transfer_complete(); } if (s->datacnt == 0 && s->fifo_len == 0) { s->datactrl &= ~PL181_DATA_ENABLE; - DPRINTF("Data engine idle\n"); + trace_pl181_data_engine_idle(); } else { /* Update FIFO bits. */ bits = PL181_STATUS_TXACTIVE | PL181_STATUS_RXACTIVE; diff --git a/hw/sd/trace-events b/hw/sd/trace-events index 5f09d32eb2..a87d7355fb 100644 --- a/hw/sd/trace-events +++ b/hw/sd/trace-events @@ -62,3 +62,13 @@ milkymist_memcard_memory_write(uint32_t addr, uint32_t value) "addr 0x%08x value # pxa2xx_mmci.c pxa2xx_mmci_read(uint8_t size, uint32_t addr, uint32_t value) "size %d addr 0x%02x value 0x%08x" pxa2xx_mmci_write(uint8_t size, uint32_t addr, uint32_t value) "size %d addr 0x%02x value 0x%08x" + +# pl181.c +pl181_command_send(uint8_t cmd, uint32_t arg) "sending CMD%02d arg 0x%08" PRIx32 +pl181_command_sent(void) "command sent" +pl181_command_response_pending(void) "response received" +pl181_command_timeout(void) "command timeouted" +pl181_fifo_push(uint32_t data) "FIFO push 0x%08" PRIx32 +pl181_fifo_pop(uint32_t data) "FIFO pop 0x%08" PRIx32 +pl181_fifo_transfer_complete(void) "FIFO transfer complete" +pl181_data_engine_idle(void) "data engine idle" From patchwork Sun Jul 5 20:46:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 278515 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D429DC433DF for ; Sun, 5 Jul 2020 20:53:37 +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 9BA3A20724 for ; Sun, 5 Jul 2020 20:53:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="dX9X87CI" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9BA3A20724 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=amsat.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:57230 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jsBdo-0006DE-TM for qemu-devel@archiver.kernel.org; Sun, 05 Jul 2020 16:53:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50742) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jsBXE-0004sY-Eo; Sun, 05 Jul 2020 16:46:48 -0400 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]:37439) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jsBXC-0000qW-No; Sun, 05 Jul 2020 16:46:48 -0400 Received: by mail-wm1-x330.google.com with SMTP id o2so39569814wmh.2; Sun, 05 Jul 2020 13:46:45 -0700 (PDT) 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=ixcXKWbf6cfHfw1IyV/7F3PpTUGdIgNQjxeIJDW6DDw=; b=dX9X87CICh83fMLpy1imMTodQaq6w4CS+Qa/L4TVpg8B8IE3gJ7frwcEVhcIRfaVvV wVIMR22gHAOpnivn6uI9WT7Ngq4Nbz6X0H5s6hS15PWwErB3AXNMYoTQW9RtPQcaJGdc 8Oyu2LP/7YkDCGJcI1siFDU3mIcsrmmuuSjk7+5v1bNVBGyrxp/mkxM2Wxftb4aWUJlr hXaGZnRE17OjSBfmF1v0DviKNeXSttdh8UACH5SRshLFm5OSYTnY13NsyVwUsrJgWFuZ 2xRYWcr62P6+Cy1kaJQCqswNP5r/FulYvUd02Qu9woFqg6M8gL9GIBRnj99W/lhmwmSE FVNQ== 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=ixcXKWbf6cfHfw1IyV/7F3PpTUGdIgNQjxeIJDW6DDw=; b=B1LZUWG3s3mPmsw3sT+rf+J07koIsb3ejVXyNswxUrp6ux91+Ch7RBdq3OfmXOiBj2 um0D7Hldg9mz5JiqXIrl+eNVaBlvBfczbpk6fO6e8u07ohkuM+XiFwj3PtTUYjBfqlqw wkcT8Ygc1v/yqrZP+9aLmcxsDu/SPJ+lfdgRJelzD9mUpgUANCn+mY3a/FU+Dx6rvkNH tzrJfdXgRT5BnDBMXGMjgigXjEAJkKDcqwscBP8m+X7tbQtumDiaqxQOJQhQgQFfhSGb HYm4i4og/xSaJTircfC7CMXs74IjOk6cgm4GzXyYafeDybMwbNdS+fPp/m59Bghimn+g zVoQ== X-Gm-Message-State: AOAM531DGIvqZ44IF3jCWN5nL7xBGVx8JRJ5HdGaCCJonK7c7T79hI8n T/yIFPK/Uu3jNN/xB7rAcleDLBmYgLA= X-Google-Smtp-Source: ABdhPJw24A2SJD5MrIPJGOitkSwr0oyO/ViPWTHib9o0ECClvV45KISmDYxNk/UjWqWdiDIKEV+i/A== X-Received: by 2002:a1c:e4d4:: with SMTP id b203mr17343330wmh.49.1593982004659; Sun, 05 Jul 2020 13:46:44 -0700 (PDT) Received: from localhost.localdomain (1.red-83-51-162.dynamicip.rima-tde.net. [83.51.162.1]) by smtp.gmail.com with ESMTPSA id g144sm51397817wme.2.2020.07.05.13.46.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Jul 2020 13:46:44 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v4 10/10] hw/sd: move sdcard legacy API to 'hw/sd/sdcard_legacy.h' Date: Sun, 5 Jul 2020 22:46:30 +0200 Message-Id: <20200705204630.4133-11-f4bug@amsat.org> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20200705204630.4133-1-f4bug@amsat.org> References: <20200705204630.4133-1-f4bug@amsat.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::330; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-x330.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: 0 X-Spam_score: 0.0 X-Spam_bar: / X-Spam_report: (0.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=1, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action 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 , Alistair Francis , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Alistair Francis , qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" omap_mmc.c is the last device left using the legacy sdcard API. Move the prototype declarations into a separate header, to make it clear this is a legacy API. Reviewed-by: Alistair Francis Message-Id: <20180216022933.10945-8-f4bug@amsat.org> Signed-off-by: Philippe Mathieu-Daudé --- include/hw/sd/sd.h | 16 ----------- include/hw/sd/sdcard_legacy.h | 50 +++++++++++++++++++++++++++++++++++ hw/sd/omap_mmc.c | 2 +- hw/sd/sd.c | 1 + 4 files changed, 52 insertions(+), 17 deletions(-) create mode 100644 include/hw/sd/sdcard_legacy.h diff --git a/include/hw/sd/sd.h b/include/hw/sd/sd.h index ace350e0e8..8767ab817c 100644 --- a/include/hw/sd/sd.h +++ b/include/hw/sd/sd.h @@ -136,22 +136,6 @@ typedef struct { void (*set_readonly)(DeviceState *dev, bool readonly); } SDBusClass; -/* Legacy functions to be used only by non-qdevified callers */ -SDState *sd_init(BlockBackend *bs, bool is_spi); -int sd_do_command(SDState *sd, SDRequest *req, - uint8_t *response); -void sd_write_data(SDState *sd, uint8_t value); -uint8_t sd_read_data(SDState *sd); -void sd_set_cb(SDState *sd, qemu_irq readonly, qemu_irq insert); -/* sd_enable should not be used -- it is only used on the nseries boards, - * where it is part of a broken implementation of the MMC card slot switch - * (there should be two card slots which are multiplexed to a single MMC - * controller, but instead we model it with one card and controller and - * disable the card when the second slot is selected, so it looks like the - * second slot is always empty). - */ -void sd_enable(SDState *sd, bool enable); - /* Functions to be used by qdevified callers (working via * an SDBus rather than directly with SDState) */ diff --git a/include/hw/sd/sdcard_legacy.h b/include/hw/sd/sdcard_legacy.h new file mode 100644 index 0000000000..8681f8089b --- /dev/null +++ b/include/hw/sd/sdcard_legacy.h @@ -0,0 +1,50 @@ +/* + * SD Memory Card emulation (deprecated legacy API) + * + * Copyright (c) 2006 Andrzej Zaborowski + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef HW_SDCARD_LEGACY_H +#define HW_SDCARD_LEGACY_H + +#include "hw/sd/sd.h" + +/* Legacy functions to be used only by non-qdevified callers */ +SDState *sd_init(BlockBackend *blk, bool is_spi); +int sd_do_command(SDState *card, SDRequest *request, uint8_t *response); +void sd_write_data(SDState *card, uint8_t value); +uint8_t sd_read_data(SDState *card); +void sd_set_cb(SDState *card, qemu_irq readonly, qemu_irq insert); + +/* sd_enable should not be used -- it is only used on the nseries boards, + * where it is part of a broken implementation of the MMC card slot switch + * (there should be two card slots which are multiplexed to a single MMC + * controller, but instead we model it with one card and controller and + * disable the card when the second slot is selected, so it looks like the + * second slot is always empty). + */ +void sd_enable(SDState *card, bool enable); + +#endif /* HW_SDCARD_LEGACY_H */ diff --git a/hw/sd/omap_mmc.c b/hw/sd/omap_mmc.c index 4088a8a80b..7d33c59226 100644 --- a/hw/sd/omap_mmc.c +++ b/hw/sd/omap_mmc.c @@ -23,7 +23,7 @@ #include "qemu/log.h" #include "hw/irq.h" #include "hw/arm/omap.h" -#include "hw/sd/sd.h" +#include "hw/sd/sdcard_legacy.h" struct omap_mmc_s { qemu_irq irq; diff --git a/hw/sd/sd.c b/hw/sd/sd.c index 54b1414131..6bd7ed59e7 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -36,6 +36,7 @@ #include "hw/registerfields.h" #include "sysemu/block-backend.h" #include "hw/sd/sd.h" +#include "hw/sd/sdcard_legacy.h" #include "migration/vmstate.h" #include "qapi/error.h" #include "qemu/bitmap.h"