From patchwork Mon Jul 31 08:45:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: LeoLiu-oc X-Patchwork-Id: 12856 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:918b:0:b0:3e4:2afc:c1 with SMTP id s11csp1889020vqg; Mon, 31 Jul 2023 02:11:27 -0700 (PDT) X-Google-Smtp-Source: APBJJlFP2+J9OC9HalvVMoUYdt5qi6PTnjznNGjYrk291qPLO+MtZ4Auen1WN00qV2nN28DyyIMc X-Received: by 2002:a05:6a20:457:b0:133:656e:fe1e with SMTP id b23-20020a056a20045700b00133656efe1emr8382119pzb.47.1690794687021; Mon, 31 Jul 2023 02:11:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690794687; cv=none; d=google.com; s=arc-20160816; b=GVW7N9sUAtqBqNGJkx0d3iEWdMlif24kuRV+25D+QoGTMv+qlxaUuO+phH1Idqtabq H536xxl1w8IV24M0dfP6oRdNIJZHERVMrlgmV9dq9Fc+Gy39nhsxdyoA37xYTyiuaWrm Hdj9cwszy9psiz4XN15l/vZXjIniNeDvCYPZSc/O0OYU4PVGMD7/Mlwq1U6VThZRYdou 3FotBMbeA4NIpATc8Pawgzlq7JNmGZeSHA/a31b9dnHeLSREfcaKa8yF69ZqnfoPRep0 QxdUR4e5aOjXWUvqOQ8Jy9JoB2dxlYOgabhh7r2E46ykvHVwfidN2EWW20RFeG4HS8d4 gJAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=X7gaRLp0adFA2d89+wwYgtISrMsbWQ0KDel0s9OuG/g=; fh=3ZSPIWnd+HK6Z7GAIKhGwlldu45YVuy58q4HCcukU/M=; b=oxjDe4hHu9e7QDoBstBh4yYgjR/z9odsUuZJpEwM9/50heqy9uTSZvwjO/qzVQC0lw clpPBA5fSe08rkMX0rdaGS3jz64VGkeXcrCsrUdZLHl61rtszbPbYKpYRaKekooPfJUj pav5kyQWG2IHmMG9kYOGzi6YB/IuCNuJrFd5mU4U8HJfZG1ajLQ5LWMXCgXpFTJwS7oF HMEUkL/IqGaV0DW8i/JAmDsdaEgHHQvYdS5Bv4qKsV53z/sXjTa/kDY6/MzidDNGu3mm 9A5NYRGKcjy/iMvSFexAc6gpd9izeEXbfsiT11QUZUHOFHAPAjCc+f0kOtIowlF553Aw ix2w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cd9-20020a056a00420900b00643ba887601si7007984pfb.307.2023.07.31.02.11.14; Mon, 31 Jul 2023 02:11:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232060AbjGaIrU (ORCPT + 99 others); Mon, 31 Jul 2023 04:47:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54762 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230122AbjGaIqk (ORCPT ); Mon, 31 Jul 2023 04:46:40 -0400 Received: from mx1.zhaoxin.com (MX1.ZHAOXIN.COM [210.0.225.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 572BD2111 for ; Mon, 31 Jul 2023 01:45:22 -0700 (PDT) X-ASG-Debug-ID: 1690793117-086e23186a033b0001-xx1T2L Received: from ZXSHMBX1.zhaoxin.com (ZXSHMBX1.zhaoxin.com [10.28.252.163]) by mx1.zhaoxin.com with ESMTP id ajcNKjYAUBEvU9rJ (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO); Mon, 31 Jul 2023 16:45:17 +0800 (CST) X-Barracuda-Envelope-From: LeoLiu-oc@zhaoxin.com X-Barracuda-RBL-Trusted-Forwarder: 10.28.252.163 Received: from ZXBJMBX03.zhaoxin.com (10.29.252.7) by ZXSHMBX1.zhaoxin.com (10.28.252.163) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Mon, 31 Jul 2023 16:45:17 +0800 Received: from xin.lan (10.32.64.1) by ZXBJMBX03.zhaoxin.com (10.29.252.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Mon, 31 Jul 2023 16:45:16 +0800 X-Barracuda-RBL-Trusted-Forwarder: 10.28.252.163 From: LeoLiu-oc X-Barracuda-RBL-Trusted-Forwarder: 10.29.252.7 To: , , , , , , , , CC: , , , , leoliu-oc Subject: [PATCH v2 0/2] Add Zhaoxin HW RNG support Date: Mon, 31 Jul 2023 16:45:13 +0800 X-ASG-Orig-Subj: [PATCH v2 0/2] Add Zhaoxin HW RNG support Message-ID: <20230731084515.2057375-1-LeoLiu-oc@zhaoxin.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Originating-IP: [10.32.64.1] X-ClientProxiedBy: zxbjmbx1.zhaoxin.com (10.29.252.163) To ZXBJMBX03.zhaoxin.com (10.29.252.7) X-Barracuda-Connect: ZXSHMBX1.zhaoxin.com[10.28.252.163] X-Barracuda-Start-Time: 1690793117 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://10.28.252.35:4443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at zhaoxin.com X-Barracuda-Scan-Msg-Size: 811 X-Barracuda-BRTS-Status: 1 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using global scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=9.0 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.112114 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1772926729881976083 X-GMAIL-MSGID: 1772926729881976083 From: leoliu-oc Implemented Zhaoxin rng driver to add support for Zhaoxin HW RNG. Both Zhaoxin-rng and via-rng rely on the XSTORE feature, but the actual implementation is different. So add Vendor ID/Family restrictions in via-rng module. v1->v2: * Modify via-rng in a separate patch. * Fix some formatting issues. leoliu-oc (2): hwrng: via-rng: convert to x86_cpu_id probing hwrng: add Zhaoxin HW RNG driver drivers/char/hw_random/Kconfig | 13 +++++ drivers/char/hw_random/Makefile | 1 + drivers/char/hw_random/via-rng.c | 15 +++-- drivers/char/hw_random/zhaoxin-rng.c | 87 ++++++++++++++++++++++++++++ 4 files changed, 108 insertions(+), 8 deletions(-) create mode 100644 drivers/char/hw_random/zhaoxin-rng.c