diff mbox series

[v6,04/17] lib: Makefile: build crc7.c when CONFIG_MMC_SPI

Message ID 20200329170538.25449-5-pragnesh.patel@sifive.com
State Superseded
Delegated to: Andes
Headers show
Series RISC-V SiFive FU540 support SPL | expand

Commit Message

Pragnesh Patel March 29, 2020, 5:05 p.m. UTC
When build U-Boot SPL, meet an issue of undefined reference to
'crc7' for drivers/mmc/mmc_spi.c, so let's compile crc7.c when
CONFIG_MMC_SPI selected.

Signed-off-by: Pragnesh Patel <pragnesh.patel@sifive.com>
---
 common/spl/Kconfig  | 6 ++++++
 drivers/mmc/Kconfig | 1 +
 lib/Makefile        | 1 +
 3 files changed, 8 insertions(+)

Comments

Jagan Teki April 2, 2020, 9:20 a.m. UTC | #1
On Sun, Mar 29, 2020 at 10:36 PM Pragnesh Patel
<pragnesh.patel@sifive.com> wrote:
>
> When build U-Boot SPL, meet an issue of undefined reference to
> 'crc7' for drivers/mmc/mmc_spi.c, so let's compile crc7.c when
> CONFIG_MMC_SPI selected.
>
> Signed-off-by: Pragnesh Patel <pragnesh.patel@sifive.com>
> ---

Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
Bin Meng April 20, 2020, 8:05 a.m. UTC | #2
On Mon, Mar 30, 2020 at 1:06 AM Pragnesh Patel
<pragnesh.patel@sifive.com> wrote:
>
> When build U-Boot SPL, meet an issue of undefined reference to
> 'crc7' for drivers/mmc/mmc_spi.c, so let's compile crc7.c when
> CONFIG_MMC_SPI selected.
>
> Signed-off-by: Pragnesh Patel <pragnesh.patel@sifive.com>
> ---
>  common/spl/Kconfig  | 6 ++++++
>  drivers/mmc/Kconfig | 1 +
>  lib/Makefile        | 1 +
>  3 files changed, 8 insertions(+)
>

Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
diff mbox series

Patch

diff --git a/common/spl/Kconfig b/common/spl/Kconfig
index b03a476b9f..07eee56219 100644
--- a/common/spl/Kconfig
+++ b/common/spl/Kconfig
@@ -401,6 +401,12 @@  config SPL_CRC32_SUPPORT
 	  for detected accidental image corruption. For secure applications you
 	  should consider SHA1 or SHA256.
 
+config SPL_CRC7_SUPPORT
+	bool "Support CRC7"
+	help
+	  Enable CRC7 hashing for drivers which are using in SPL.
+	  This is a 32-bit checksum value that can be used to verify images.
+
 config SPL_MD5_SUPPORT
 	bool "Support MD5"
 	depends on SPL_FIT
diff --git a/drivers/mmc/Kconfig b/drivers/mmc/Kconfig
index 2f0eedc22f..f23a3242b3 100644
--- a/drivers/mmc/Kconfig
+++ b/drivers/mmc/Kconfig
@@ -49,6 +49,7 @@  if MMC
 config MMC_SPI
 	bool "Support for SPI-based MMC controller"
 	depends on DM_MMC && DM_SPI
+	select SPL_CRC7_SUPPORT if SPL
 	help
 	  This selects SPI-based MMC controllers.
 	  If you have an MMC controller on a SPI bus, say Y here.
diff --git a/lib/Makefile b/lib/Makefile
index 15259d0473..7a50aa56ef 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -78,6 +78,7 @@  endif
 
 ifdef CONFIG_SPL_BUILD
 obj-$(CONFIG_SPL_YMODEM_SUPPORT) += crc16.o
+obj-$(CONFIG_SPL_CRC7_SUPPORT) += crc7.o
 obj-$(CONFIG_$(SPL_TPL_)HASH_SUPPORT) += crc16.o
 obj-y += net_utils.o
 endif