From patchwork Fri Jun 16 06:58:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeuk Kim X-Patchwork-Id: 13282129 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 999A6EB64D7 for ; Fri, 16 Jun 2023 06:59:23 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qA3Pp-0005mx-Le; Fri, 16 Jun 2023 02:58:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qA3Pn-0005mI-6g for qemu-devel@nongnu.org; Fri, 16 Jun 2023 02:58:35 -0400 Received: from mailout4.samsung.com ([203.254.224.34]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qA3Pi-0003uG-6N for qemu-devel@nongnu.org; Fri, 16 Jun 2023 02:58:34 -0400 Received: from epcas2p2.samsung.com (unknown [182.195.41.54]) by mailout4.samsung.com (KnoxPortal) with ESMTP id 20230616065818epoutp04049722b171e4e95bee42253e5a636f85~pEW3HWF5O2921129211epoutp04S for ; Fri, 16 Jun 2023 06:58:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout4.samsung.com 20230616065818epoutp04049722b171e4e95bee42253e5a636f85~pEW3HWF5O2921129211epoutp04S DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1686898698; bh=RxGYrgVRkzjOO/SsxvyEPKNzopiSDoHglnyKJlYmbBY=; h=Subject:Reply-To:From:To:CC:Date:References:From; b=JCOnOwOsHKsA/oxCrgC7FCNdOzRhhUo3Vf3Og2qfl6e6fDupspy+Z6ApU/pATjV2V r5rM+heTzcVcr5X0omSRH2+aRcNkISXJaBnzMR9XeLF3FVtG+7HglOWF/yn3xaCvEo 3idfcHyuXbW2bV+w6Onl9ZGQtAByGaIA04Aar5m4= Received: from epsnrtp4.localdomain (unknown [182.195.42.165]) by epcas2p3.samsung.com (KnoxPortal) with ESMTP id 20230616065818epcas2p3900437ec62da02fac3bc3bbc3b8dcc72~pEW2qstDK1613416134epcas2p3H; Fri, 16 Jun 2023 06:58:18 +0000 (GMT) Received: from epsmges2p1.samsung.com (unknown [182.195.36.91]) by epsnrtp4.localdomain (Postfix) with ESMTP id 4Qj93X5Nk6z4x9QD; Fri, 16 Jun 2023 06:58:16 +0000 (GMT) X-AuditID: b6c32a45-445fd70000022cba-15-648c0808940e Received: from epcas2p3.samsung.com ( [182.195.41.55]) by epsmges2p1.samsung.com (Symantec Messaging Gateway) with SMTP id F4.20.11450.8080C846; Fri, 16 Jun 2023 15:58:16 +0900 (KST) Mime-Version: 1.0 Subject: [PATCH v2 0/3] hw/ufs: Add Universal Flash Storage (UFS) support From: Jeuk Kim To: "qemu-devel@nongnu.org" CC: "kwolf@redhat.com" , "hreitz@redhat.com" , "pbonzini@redhat.com" , "fam@euphon.net" , "qemu-block@nongnu.org" , Klaus Birkelund Jensen , "stefanha@redhat.com" X-Priority: 3 X-Content-Kind-Code: NORMAL X-CPGS-Detection: blocking_info_exchange X-Drm-Type: N,general X-Msg-Generator: Mail X-Msg-Type: PERSONAL X-Reply-Demand: N Message-ID: <20230616065816epcms2p82787f1aeb410ec4b8ab6ffedb6edf4d2@epcms2p8> Date: Fri, 16 Jun 2023 15:58:16 +0900 X-CMS-MailID: 20230616065816epcms2p82787f1aeb410ec4b8ab6ffedb6edf4d2 X-Sendblock-Type: AUTO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hPB/7csThFau7I4yP3b73ImVl5rN9BVfOUwUuVyiavI09URU8sLsH/nlty78NJnq88FS /a9znmBJlIDCpNPcnFfCpm2e7ZnAKjz3wT6D3U59j37PMJ7N6BlYaX2Z5a/6fR2Vt98Tvp/X 2L+Mx/epOO+9TZm/3v2YK/rZQs9Mmdk81OW93j05cQfzp5czdZPVBHZ8ONl+vVnowmQ35swY ViWW4oxEQy3mouJEADGQt38cBAAA DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20230616065816epcms2p82787f1aeb410ec4b8ab6ffedb6edf4d2 References: Received-SPF: pass client-ip=203.254.224.34; envelope-from=jeuk20.kim@samsung.com; helo=mailout4.samsung.com X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham 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: , Reply-To: jeuk20.kim@samsung.com Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Since v1: - use macros of "hw/registerfields.h" (Addressed Philippe's review comments) This patch series adds support for a new PCI-based UFS device. The UFS pci device id (PCI_DEVICE_ID_REDHAT_UFS) is not registered in the Linux kernel yet, so it does not work right away, but I confirmed that it works with Linux when the UFS pci device id is registered. I have also verified that it works with Windows 10. Jeuk Kim (3): hw/ufs: Initial commit for emulated Universal-Flash-Storage hw/ufs: Support for Query Transfer Requests hw/ufs: Support for UFS logical unit MAINTAINERS | 6 + hw/Kconfig | 1 + hw/meson.build | 1 + hw/ufs/Kconfig | 4 + hw/ufs/lu.c | 1441 ++++++++++++++++++++++++++++++++++++ hw/ufs/meson.build | 1 + hw/ufs/trace-events | 58 ++ hw/ufs/trace.h | 1 + hw/ufs/ufs.c | 1511 ++++++++++++++++++++++++++++++++++++++ hw/ufs/ufs.h | 130 ++++ include/block/ufs.h | 1048 ++++++++++++++++++++++++++ include/hw/pci/pci.h | 1 + include/hw/pci/pci_ids.h | 1 + include/scsi/constants.h | 1 + meson.build | 1 + 15 files changed, 4206 insertions(+) create mode 100644 hw/ufs/Kconfig create mode 100644 hw/ufs/lu.c create mode 100644 hw/ufs/meson.build create mode 100644 hw/ufs/trace-events create mode 100644 hw/ufs/trace.h create mode 100644 hw/ufs/ufs.c create mode 100644 hw/ufs/ufs.h create mode 100644 include/block/ufs.h