From patchwork Wed Mar 3 07:03:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Stanley X-Patchwork-Id: 392034 Delivered-To: patch@linaro.org Received: by 2002:a02:290e:0:0:0:0:0 with SMTP id p14csp4897873jap; Tue, 2 Mar 2021 23:04:45 -0800 (PST) X-Google-Smtp-Source: ABdhPJwY2+ze4QGaoTruafQWaI+askBGUcj6urZejgtmDOvS3gbpDti/78ZzL09EMMiHTmFIbe9o X-Received: by 2002:a25:105:: with SMTP id 5mr35516281ybb.133.1614755084998; Tue, 02 Mar 2021 23:04:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614755084; cv=none; d=google.com; s=arc-20160816; b=VFLf0BktqZjT3kTioGr2V0X+pf1UoyC5jvhuVCsAb/RYSSVmS8pojT73dqr/60jFtT bQFb6ltDTGsZ9l0ek3bcsX/zfpQsoA22uhAdCvocGzEPKu7RC6aw0N58o22kxGDVj87K kAzFdqP01Y6v+s3xGOMgVvvVQiK36OHkOLj7CMANoJyI5ViYhIJwPr9Vmi+YgrY27iq3 CHgv0MHNbUUBTL7dTfwfIM04mL6OZ7jGQKG0mjaQDcXaoJYVUKCvkg21NPlAF0x/dxHl OF4oOqMEEeeG3Lx2Y5Ympi429BriKHrA6Igi2vdXB4vIMFLqAhKBr6hvaAtDjPPBpwxN Ei1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:to:from:dkim-signature; bh=h8K8eTWje5tNK4YJ0OoQ9oKrWVNXVUYvkKK/tjQS2Ag=; b=eQ9saXBT6pbOcNvg6kYgVPp6UmCDprQ9+6VKabxf2EebAcGHICEmk3RZnUv2HJbGED dJQX30DgNYcF8te1E2MudzFAN7vsbIt09gTpdqdjq70sHLjy4jYXYsgcYrA/a55nyjPc VlNqIggazzDJ+glLsMLJ5S1kSdQgGZQ1o2AC2hlN+FLw5WMWuesYkS1ZjJG0VdVnxO6P N/N74yu3no0Ob8v2y25GlM4Sr6JwSVFdca91YewU/OEEv4l4KB7h2eow6r1t0j67uPp5 S/pp3ee+fZWCiSm+GLyb7EBRhQzfgEyhuD+Icb4Cw2yQsH9G/vtCo2YDywnuI7DgtOZu 4q5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=r663nW48; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id v12si22423929ybi.129.2021.03.02.23.04.44 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 02 Mar 2021 23:04:44 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=r663nW48; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([::1]:43680 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lHLYq-0004y3-BY for patch@linaro.org; Wed, 03 Mar 2021 02:04:44 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:49494) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lHLY1-0004xQ-35; Wed, 03 Mar 2021 02:03:53 -0500 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]:37447) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lHLXz-0007gN-I1; Wed, 03 Mar 2021 02:03:52 -0500 Received: by mail-pl1-x631.google.com with SMTP id p5so13523000plo.4; Tue, 02 Mar 2021 23:03:50 -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:mime-version :content-transfer-encoding; bh=h8K8eTWje5tNK4YJ0OoQ9oKrWVNXVUYvkKK/tjQS2Ag=; b=r663nW4810/l3feTZOyhArOFtZw31pyxe1o1manjMleYQ7oElPWJ5U0ENsvL3kO+uv Boz7fCEHHpzbV5evwf2UpoaGHDHN2RdXgQ4WaUgxhB2fTi2dN+vk1LBhDDPDoK9P0Xc9 qryR7k8r7KpJXwxC1ooXSUG1qke6RNL111whHo7VtNgk8XY+xuUMc+y6Ou51CrjfkTyN PvsDhwlDMSf4sBbzHcuNzgkfw0YtYQFCUepVsDAHWAfSrH9dEH7+naJLlDzwYPToxfc+ pAVH1uL8+NERT/MtOtwKnQ3yAiHgGw4I2jwJ+c/L/Wr8MkcfGnmDI7ambCE1d3Lqy/5e oSNA== 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 :mime-version:content-transfer-encoding; bh=h8K8eTWje5tNK4YJ0OoQ9oKrWVNXVUYvkKK/tjQS2Ag=; b=uHoB7R6POZJJUvCmThInLlu8c/ZMFlDybym62+pmxY4CZjnVb8Kek1i4HRHgoTiYtQ 3heaOeTorLw/QIC07wImW+s3tturwzffdVZ2JGkPOKi6WNp0EbjHgztXvZivFHZKIPU+ T4C2dLWWYv6LeSalGbtPRbUedrKnqP0fXvxMpsjZjU6GEVJJGy9Blr1SgNdGaNE0OcyT V9YH6UQnYj2Vt7zyvpLXwVlSZ/HOULtltUuNDz5zA6i7yHLYtgrBkT0Z9yiaVhIYiN+j XlewnVTRQ5AmJFh9isb80trnESHMj97/Zk1PSL5fjIsffv+DiEoT6dx0ocbFVahOaTT1 ITLg== X-Gm-Message-State: AOAM533Oms/4WmQisiHSkIOLJaqo2H597UxVMOWk3MbQKgyqg0Dhhgu/ E5uxxF7R/18J+19QLKCiTeI= X-Received: by 2002:a17:90a:e616:: with SMTP id j22mr8323602pjy.190.1614755029585; Tue, 02 Mar 2021 23:03:49 -0800 (PST) Received: from localhost.localdomain ([45.124.203.14]) by smtp.gmail.com with ESMTPSA id bb24sm5855703pjb.5.2021.03.02.23.03.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Mar 2021 23:03:48 -0800 (PST) From: Joel Stanley To: =?utf-8?q?C=C3=A9dric_Le_Goater?= Subject: [PATCH 0/2] hw/misc: Model ASPEED hash and crpyto engine Date: Wed, 3 Mar 2021 17:33:29 +1030 Message-Id: <20210303070331.70744-1-joel@jms.id.au> X-Mailer: git-send-email 2.30.1 MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::631; envelope-from=joel.stan@gmail.com; helo=mail-pl1-x631.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no 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: Andrew Jeffery , Peter Maydell , qemu-arm@nongnu.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This adds a model for the ASPEED hash and crypto engine (HACE) found on all supported ASPEED SoCs. The model uses Qemu's gcrypto API to perform the SHA and MD5 hashing directly in the machine's emulated memory space, which I found a neat use of Qemu's features. It has been tested using u-boot and from Linux userspace. Joel Stanley (2): hw: Model ASPEED's Hash and Crypto Engine aspeed: Integrate HACE docs/system/arm/aspeed.rst | 2 +- include/hw/arm/aspeed_soc.h | 3 + include/hw/misc/aspeed_hace.h | 33 ++++ hw/arm/aspeed_ast2600.c | 14 ++ hw/arm/aspeed_soc.c | 15 ++ hw/misc/aspeed_hace.c | 302 ++++++++++++++++++++++++++++++++++ hw/misc/meson.build | 2 +- 7 files changed, 369 insertions(+), 2 deletions(-) create mode 100644 include/hw/misc/aspeed_hace.h create mode 100644 hw/misc/aspeed_hace.c -- 2.30.1