diff mbox series

[v3,03/10] lib: Makefile: build crc7.c when CONFIG_MMC_SPI

Message ID 20200124055026.30787-4-pragnesh.patel@sifive.com
State New
Headers show
Series RISC-V SiFive FU540 support SPL | expand

Commit Message

Pragnesh Patel Jan. 24, 2020, 5:50 a.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 at sifive.com>
Reviewed-by: Anup Patel <anup.patel at wdc.com>
---
 lib/Makefile | 1 +
 1 file changed, 1 insertion(+)

Comments

Jagan Teki Jan. 24, 2020, 6:27 a.m. UTC | #1
On Fri, Jan 24, 2020 at 11:21 AM Pragnesh Patel
<pragnesh.patel at 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 at sifive.com>
> Reviewed-by: Anup Patel <anup.patel at wdc.com>
> ---
>  lib/Makefile | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/lib/Makefile b/lib/Makefile
> index 51eba80b89..d21e0a6b3a 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_MMC_SPI) += crc7.o

It is invalid to mark crc7 to MMC_SPI, try to add Kconfig option for
CRC7. like this.
https://paste.ubuntu.com/p/kSnkDWpTgS/
Pragnesh Patel Jan. 24, 2020, 8:06 a.m. UTC | #2
>-----Original Message-----
>From: Jagan Teki <jagan at amarulasolutions.com>
>Sent: 24 January 2020 11:58
>To: Pragnesh Patel <pragnesh.patel at sifive.com>
>Cc: U-Boot-Denx <u-boot at lists.denx.de>; Atish Patra
><atish.patra at wdc.com>; palmerdabbelt at google.com; Bin Meng
><bmeng.cn at gmail.com>; Paul Walmsley ( Sifive)
><paul.walmsley at sifive.com>; Troy Benjegerdes ( Sifive)
><troy.benjegerdes at sifive.com>; Anup Patel <anup.patel at wdc.com>; Sagar
>Kadam <sagar.kadam at sifive.com>; Simon Glass <sjg at chromium.org>;
>AKASHI Takahiro <takahiro.akashi at linaro.org>; Marek BehĂșn
><marek.behun at nic.cz>; Philippe Reynes <philippe.reynes at softathome.com>;
>Alexander Graf <agraf at csgraf.de>; Peng Fan <peng.fan at nxp.com>
>Subject: Re: [PATCH v3 03/10] lib: Makefile: build crc7.c when
>CONFIG_MMC_SPI
>
>On Fri, Jan 24, 2020 at 11:21 AM Pragnesh Patel <pragnesh.patel at 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 at sifive.com>
>> Reviewed-by: Anup Patel <anup.patel at wdc.com>
>> ---
>>  lib/Makefile | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/lib/Makefile b/lib/Makefile index 51eba80b89..d21e0a6b3a
>> 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_MMC_SPI) += crc7.o
>
>It is invalid to mark crc7 to MMC_SPI, try to add Kconfig option for CRC7. like
>this.
>https://paste.ubuntu.com/p/kSnkDWpTgS/

Thanks for pointing me. How about if I will add like this:

config SPL_CRC7_SUPPORT
       bool "Support CRC7 hashing drivers"
       default y if MMC_SPI
       help
        Enable CRC7 hashing for drivers which are using in SPL.

Any comments?
Jagan Teki Jan. 27, 2020, 7:58 a.m. UTC | #3
On Fri, Jan 24, 2020 at 1:36 PM Pragnesh Patel
<pragnesh.patel at sifive.com> wrote:
>
>
> >-----Original Message-----
> >From: Jagan Teki <jagan at amarulasolutions.com>
> >Sent: 24 January 2020 11:58
> >To: Pragnesh Patel <pragnesh.patel at sifive.com>
> >Cc: U-Boot-Denx <u-boot at lists.denx.de>; Atish Patra
> ><atish.patra at wdc.com>; palmerdabbelt at google.com; Bin Meng
> ><bmeng.cn at gmail.com>; Paul Walmsley ( Sifive)
> ><paul.walmsley at sifive.com>; Troy Benjegerdes ( Sifive)
> ><troy.benjegerdes at sifive.com>; Anup Patel <anup.patel at wdc.com>; Sagar
> >Kadam <sagar.kadam at sifive.com>; Simon Glass <sjg at chromium.org>;
> >AKASHI Takahiro <takahiro.akashi at linaro.org>; Marek BehĂșn
> ><marek.behun at nic.cz>; Philippe Reynes <philippe.reynes at softathome.com>;
> >Alexander Graf <agraf at csgraf.de>; Peng Fan <peng.fan at nxp.com>
> >Subject: Re: [PATCH v3 03/10] lib: Makefile: build crc7.c when
> >CONFIG_MMC_SPI
> >
> >On Fri, Jan 24, 2020 at 11:21 AM Pragnesh Patel <pragnesh.patel at 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 at sifive.com>
> >> Reviewed-by: Anup Patel <anup.patel at wdc.com>
> >> ---
> >>  lib/Makefile | 1 +
> >>  1 file changed, 1 insertion(+)
> >>
> >> diff --git a/lib/Makefile b/lib/Makefile index 51eba80b89..d21e0a6b3a
> >> 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_MMC_SPI) += crc7.o
> >
> >It is invalid to mark crc7 to MMC_SPI, try to add Kconfig option for CRC7. like
> >this.
> >https://paste.ubuntu.com/p/kSnkDWpTgS/
>
> Thanks for pointing me. How about if I will add like this:
>
> config SPL_CRC7_SUPPORT
>        bool "Support CRC7 hashing drivers"
>        default y if MMC_SPI
>        help
>         Enable CRC7 hashing for drivers which are using in SPL.
>
> Any comments?

Make sense.
diff mbox series

Patch

diff --git a/lib/Makefile b/lib/Makefile
index 51eba80b89..d21e0a6b3a 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_MMC_SPI) += crc7.o
 obj-$(CONFIG_$(SPL_TPL_)HASH_SUPPORT) += crc16.o
 obj-y += net_utils.o
 endif