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 phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9D392C54EBC for ; Sat, 7 Jan 2023 21:57:52 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 25237854DF; Sat, 7 Jan 2023 22:57:46 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="UsZV+MmH"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 708A785369; Sat, 7 Jan 2023 22:57:44 +0100 (CET) Received: from mail-io1-xd33.google.com (mail-io1-xd33.google.com [IPv6:2607:f8b0:4864:20::d33]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 8D667854DF for ; Sat, 7 Jan 2023 22:57:40 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd33.google.com with SMTP id g20so2741953iob.2 for ; Sat, 07 Jan 2023 13:57:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=1opLf/KsUCuD1387giw+/s82N38/zKuNlv6J7+p7h8U=; b=UsZV+MmHQbUnSXLDD3nNvihiWPZ4OoWCGwTqtDR2IJGP00/1+ge2pyYo+LNqCIX+jO KhaJ0C8doH8GEOJc5/pYABP11217c8RQpUpDuj8V8cIutqQkVpV8n8M2XpohbG8XPOiT DoIKIiRPJsQr/cDaDPbsGk6PqXGrZCUnBEp9s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=1opLf/KsUCuD1387giw+/s82N38/zKuNlv6J7+p7h8U=; b=fHwoVvNI8bLgB/HNojDqj7SE4Q5W+mYjLp+K/d5zU7iq/bGWlHBXHd7b3kr4WzMeZI qHd5BTZe7LqH/AVm9qp/JvrNJnXp8Ax0LGdvhwjohpfsrND6HrxBoonk3w3VY6zRC98f xbt5fTC0k+cg8RopzSr6yGOl0YIYgQwmtBO038M2r0xK667vUk8Phd9Bl6ifNTKdX9fn E7hXOSOX9q68EysxhW/OEcnKfB4iMJwjzXAZWeVWpiBKLDbyb7x2XFsN4AJO6IOEMpI7 JadHsX/+xS+ImRFbAlOTcvv+HMBshZfGXGLIPzQLzEf183eGDn13jqZVV8u7aGdIb9mg oTsQ== X-Gm-Message-State: AFqh2koyQL1hDl+3Cg/h3Nya3jakP480lgZ3NLalwAKjaKJAM0jhGJTX XLicPd9AgA6qukmsQEOaNS6SobylvAgIZi9x X-Google-Smtp-Source: AMrXdXtV/xnd2YBERcUqVaS+b4jYi/v25k4bgWs/ObxPGOmOaXBHyf/DTqo263AjZHLzk/fg0MftLQ== X-Received: by 2002:a6b:d117:0:b0:6e0:3184:db21 with SMTP id l23-20020a6bd117000000b006e03184db21mr39188158iob.3.1673128659134; Sat, 07 Jan 2023 13:57:39 -0800 (PST) Received: from sjg1.roam.corp.google.com (c-71-56-217-229.hsd1.co.comcast.net. [71.56.217.229]) by smtp.gmail.com with ESMTPSA id o13-20020a0566022e0d00b006bb5af55ddfsm1659164iow.19.2023.01.07.13.57.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Jan 2023 13:57:38 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Simon Glass Subject: [PATCH v2 03/14] tpm: Add a proper Kconfig option for crc8 in SPL Date: Sat, 7 Jan 2023 14:57:20 -0700 Message-Id: <20230107215731.484317-4-sjg@chromium.org> X-Mailer: git-send-email 2.39.0.314.g84b9a713c41-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean The current approach is a bit of a hack and only works for the tpm subsystem. Add a Kconfig so that crc8 can be enabled in SPL for other purposes. Signed-off-by: Simon Glass --- Changes in v2: - Add an SPL dependency in the Kconfig lib/Kconfig | 18 ++++++++++++++++++ lib/Makefile | 3 ++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/lib/Kconfig b/lib/Kconfig index def36f275ce..36d3cf99c3c 100644 --- a/lib/Kconfig +++ b/lib/Kconfig @@ -422,6 +422,7 @@ config TPM config SPL_TPM bool "Trusted Platform Module (TPM) Support in SPL" depends on SPL_DM + imply SPL_CRC8 help This enables support for TPMs which can be used to provide security features for your board. The TPM can be connected via LPC or I2C @@ -617,6 +618,23 @@ config SPL_MD5 security applications, but it can be useful for providing a quick checksum of a block of data. +config CRC8 + def_bool y + help + Enables CRC8 support in U-Boot. This is normally required. CRC8 is + a simple and fast checksumming algorithm which does a bytewise + checksum with feedback to produce an 8-bit result. The code is small + and it does not require a lookup table (unlike CRC32). + +config SPL_CRC8 + bool "Support CRC8 in SPL" + depends on SPL + help + Enables CRC8 support in SPL. This is not normally required. CRC8 is + a simple and fast checksumming algorithm which does a bytewise + checksum with feedback to produce an 8-bit result. The code is small + and it does not require a lookup table (unlike CRC32). + config CRC32 def_bool y help diff --git a/lib/Makefile b/lib/Makefile index d77b33e7f48..a282e40258c 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -57,12 +57,13 @@ endif obj-$(CONFIG_$(SPL_TPL_)TPM) += tpm-common.o ifeq ($(CONFIG_$(SPL_TPL_)TPM),y) -obj-y += crc8.o obj-$(CONFIG_TPM) += tpm_api.o obj-$(CONFIG_TPM_V1) += tpm-v1.o obj-$(CONFIG_TPM_V2) += tpm-v2.o endif +obj-$(CONFIG_$(SPL_TPL_)CRC8) += crc8.o + obj-y += crypto/ obj-$(CONFIG_$(SPL_TPL_)GENERATE_ACPI_TABLE) += acpi/ -- 2.39.0.314.g84b9a713c41-goog