* [PATCH] fpga: define dummy fpga_load function for debug build [not found] <CGME20230816065448epcas2p3bf66892f15a6dc8e082a5f296b307bec@epcas2p3.samsung.com> @ 2023-08-16 6:54 ` Chanho Park 2023-08-25 7:22 ` Michal Simek 2023-08-29 11:10 ` Michal Simek 0 siblings, 2 replies; 9+ messages in thread From: Chanho Park @ 2023-08-16 6:54 UTC (permalink / raw) To: Michal Simek, u-boot; +Cc: Chanho Park This fixes below build error when CC_OPTIMIZE_FOR_DEBUG is enabled and CONFIG_SPL_FPGA is not enabled. ../common/spl/spl_fit.c:591: undefined reference to `fpga_load' collect2: error: ld returned 1 exit status Signed-off-by: Chanho Park <chanho61.park@samsung.com> --- include/fpga.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/fpga.h b/include/fpga.h index ed688cc0fa3b..44f2755a3f10 100644 --- a/include/fpga.h +++ b/include/fpga.h @@ -60,8 +60,16 @@ int fpga_add(fpga_type devtype, void *desc); int fpga_count(void); const fpga_desc *const fpga_get_desc(int devnum); int fpga_is_partial_data(int devnum, size_t img_len); +#if CONFIG_IS_ENABLED(FPGA) int fpga_load(int devnum, const void *buf, size_t bsize, bitstream_type bstype, int flags); +#else +static inline int fpga_load(int devnum, const void *buf, size_t bsize, + bitstream_type bstype, int flags) +{ + return FPGA_FAIL; +} +#endif int fpga_fsload(int devnum, const void *buf, size_t size, fpga_fs_info *fpga_fsinfo); int fpga_loads(int devnum, const void *buf, size_t size, -- 2.39.2 ^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH] fpga: define dummy fpga_load function for debug build 2023-08-16 6:54 ` [PATCH] fpga: define dummy fpga_load function for debug build Chanho Park @ 2023-08-25 7:22 ` Michal Simek 2023-08-28 0:21 ` Chanho Park 2023-08-29 11:10 ` Michal Simek 1 sibling, 1 reply; 9+ messages in thread From: Michal Simek @ 2023-08-25 7:22 UTC (permalink / raw) To: Chanho Park, u-boot Hi, On 8/16/23 08:54, Chanho Park wrote: > This fixes below build error when CC_OPTIMIZE_FOR_DEBUG is enabled and > CONFIG_SPL_FPGA is not enabled. > > ../common/spl/spl_fit.c:591: undefined reference to `fpga_load' > collect2: error: ld returned 1 exit status > > Signed-off-by: Chanho Park <chanho61.park@samsung.com> > --- > include/fpga.h | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/include/fpga.h b/include/fpga.h > index ed688cc0fa3b..44f2755a3f10 100644 > --- a/include/fpga.h > +++ b/include/fpga.h > @@ -60,8 +60,16 @@ int fpga_add(fpga_type devtype, void *desc); > int fpga_count(void); > const fpga_desc *const fpga_get_desc(int devnum); > int fpga_is_partial_data(int devnum, size_t img_len); > +#if CONFIG_IS_ENABLED(FPGA) > int fpga_load(int devnum, const void *buf, size_t bsize, > bitstream_type bstype, int flags); > +#else > +static inline int fpga_load(int devnum, const void *buf, size_t bsize, > + bitstream_type bstype, int flags) > +{ > + return FPGA_FAIL; > +} > +#endif > int fpga_fsload(int devnum, const void *buf, size_t size, > fpga_fs_info *fpga_fsinfo); > int fpga_loads(int devnum, const void *buf, size_t size, There is another patch targeting the same code. Please take a look at https://lore.kernel.org/r/20230808102227.34233-1-eugen.hristev@collabora.com and work together to come up with the patch which covers both cases. Thanks, Michal ^ permalink raw reply [flat|nested] 9+ messages in thread
* RE: [PATCH] fpga: define dummy fpga_load function for debug build 2023-08-25 7:22 ` Michal Simek @ 2023-08-28 0:21 ` Chanho Park 2023-08-28 8:46 ` Eugen Hristev 0 siblings, 1 reply; 9+ messages in thread From: Chanho Park @ 2023-08-28 0:21 UTC (permalink / raw) To: 'Michal Simek', u-boot, eugen.hristev Hi, > -----Original Message----- > From: Michal Simek <michal.simek@amd.com> > Sent: Friday, August 25, 2023 4:23 PM > To: Chanho Park <chanho61.park@samsung.com>; u-boot@lists.denx.de > Subject: Re: [PATCH] fpga: define dummy fpga_load function for debug build > > Hi, > > On 8/16/23 08:54, Chanho Park wrote: > > This fixes below build error when CC_OPTIMIZE_FOR_DEBUG is enabled and > > CONFIG_SPL_FPGA is not enabled. > > > > ../common/spl/spl_fit.c:591: undefined reference to `fpga_load' > > collect2: error: ld returned 1 exit status > > > > Signed-off-by: Chanho Park <chanho61.park@samsung.com> > > --- > > include/fpga.h | 8 ++++++++ > > 1 file changed, 8 insertions(+) > > > > diff --git a/include/fpga.h b/include/fpga.h index > > ed688cc0fa3b..44f2755a3f10 100644 > > --- a/include/fpga.h > > +++ b/include/fpga.h > > @@ -60,8 +60,16 @@ int fpga_add(fpga_type devtype, void *desc); > > int fpga_count(void); > > const fpga_desc *const fpga_get_desc(int devnum); > > int fpga_is_partial_data(int devnum, size_t img_len); > > +#if CONFIG_IS_ENABLED(FPGA) > > int fpga_load(int devnum, const void *buf, size_t bsize, > > bitstream_type bstype, int flags); > > +#else > > +static inline int fpga_load(int devnum, const void *buf, size_t bsize, > > + bitstream_type bstype, int flags) { > > + return FPGA_FAIL; > > +} > > +#endif > > int fpga_fsload(int devnum, const void *buf, size_t size, > > fpga_fs_info *fpga_fsinfo); > > int fpga_loads(int devnum, const void *buf, size_t size, > > There is another patch targeting the same code. > Please take a look at > https://lore.kernel.org/r/20230808102227.34233-1- > eugen.hristev@collabora.com I wasn't aware that there was an attempt to fix the issue. If I knew it, I would reply the patch... > > and work together to come up with the patch which covers both cases. Yes. I also tried to make the patch with CONFIG_CC_OPTIMIZE_FOR_DEBUG guard but I couldn't find any codes that uses the guard. And I was also worried about the CC_OPTIMIZE_FOR_DEBUG's behavior. It could be related with the optimization level of the compiler. That's why I put the guard with #if CONFIG_IS_ENABLED(FPGA). Best Regards, Chanho Park ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] fpga: define dummy fpga_load function for debug build 2023-08-28 0:21 ` Chanho Park @ 2023-08-28 8:46 ` Eugen Hristev 2023-08-28 10:00 ` Chanho Park 0 siblings, 1 reply; 9+ messages in thread From: Eugen Hristev @ 2023-08-28 8:46 UTC (permalink / raw) To: Chanho Park, 'Michal Simek', u-boot; +Cc: Simon Glass On 8/28/23 03:21, Chanho Park wrote: > Hi, > >> -----Original Message----- >> From: Michal Simek <michal.simek@amd.com> >> Sent: Friday, August 25, 2023 4:23 PM >> To: Chanho Park <chanho61.park@samsung.com>; u-boot@lists.denx.de >> Subject: Re: [PATCH] fpga: define dummy fpga_load function for debug build >> >> Hi, >> >> On 8/16/23 08:54, Chanho Park wrote: >>> This fixes below build error when CC_OPTIMIZE_FOR_DEBUG is enabled and >>> CONFIG_SPL_FPGA is not enabled. >>> >>> ../common/spl/spl_fit.c:591: undefined reference to `fpga_load' >>> collect2: error: ld returned 1 exit status >>> >>> Signed-off-by: Chanho Park <chanho61.park@samsung.com> >>> --- >>> include/fpga.h | 8 ++++++++ >>> 1 file changed, 8 insertions(+) >>> >>> diff --git a/include/fpga.h b/include/fpga.h index >>> ed688cc0fa3b..44f2755a3f10 100644 >>> --- a/include/fpga.h >>> +++ b/include/fpga.h >>> @@ -60,8 +60,16 @@ int fpga_add(fpga_type devtype, void *desc); >>> int fpga_count(void); >>> const fpga_desc *const fpga_get_desc(int devnum); >>> int fpga_is_partial_data(int devnum, size_t img_len); >>> +#if CONFIG_IS_ENABLED(FPGA) >>> int fpga_load(int devnum, const void *buf, size_t bsize, >>> bitstream_type bstype, int flags); >>> +#else >>> +static inline int fpga_load(int devnum, const void *buf, size_t bsize, >>> + bitstream_type bstype, int flags) { >>> + return FPGA_FAIL; >>> +} >>> +#endif >>> int fpga_fsload(int devnum, const void *buf, size_t size, >>> fpga_fs_info *fpga_fsinfo); >>> int fpga_loads(int devnum, const void *buf, size_t size, >> >> There is another patch targeting the same code. >> Please take a look at >> https://lore.kernel.org/r/20230808102227.34233-1- >> eugen.hristev@collabora.com > > I wasn't aware that there was an attempt to fix the issue. If I knew it, I would reply the patch... > >> >> and work together to come up with the patch which covers both cases. > > Yes. I also tried to make the patch with CONFIG_CC_OPTIMIZE_FOR_DEBUG guard but I couldn't find any codes that uses the guard. > And I was also worried about the CC_OPTIMIZE_FOR_DEBUG's behavior. It could be related with the optimization level of the compiler. > That's why I put the guard with #if CONFIG_IS_ENABLED(FPGA). > > Best Regards, > Chanho Park > Hi Chanho, Simon suggested to use CONFIG_CC_OPTIMIZE_FOR_DEBUG in this case here: https://patchwork.ozlabs.org/project/uboot/patch/20230619102839.277902-1-eugen.hristev@collabora.com/ As I told Michal, basically your patch and my patch do the same thing. I suggested him to pick the one that he thinks it's best. (or even suggest another way) Eugen ^ permalink raw reply [flat|nested] 9+ messages in thread
* RE: [PATCH] fpga: define dummy fpga_load function for debug build 2023-08-28 8:46 ` Eugen Hristev @ 2023-08-28 10:00 ` Chanho Park 2023-08-28 10:44 ` Michal Simek 0 siblings, 1 reply; 9+ messages in thread From: Chanho Park @ 2023-08-28 10:00 UTC (permalink / raw) To: 'Eugen Hristev', 'Michal Simek', u-boot Cc: 'Simon Glass' Hi, > -----Original Message----- > From: Eugen Hristev <eugen.hristev@collabora.com> > Sent: Monday, August 28, 2023 5:47 PM > To: Chanho Park <chanho61.park@samsung.com>; 'Michal Simek' > <michal.simek@amd.com>; u-boot@lists.denx.de > Cc: Simon Glass <sjg@chromium.org> > Subject: Re: [PATCH] fpga: define dummy fpga_load function for debug build > > On 8/28/23 03:21, Chanho Park wrote: > > Hi, > > > >> -----Original Message----- > >> From: Michal Simek <michal.simek@amd.com> > >> Sent: Friday, August 25, 2023 4:23 PM > >> To: Chanho Park <chanho61.park@samsung.com>; u-boot@lists.denx.de > >> Subject: Re: [PATCH] fpga: define dummy fpga_load function for debug > >> build > >> > >> Hi, > >> > >> On 8/16/23 08:54, Chanho Park wrote: > >>> This fixes below build error when CC_OPTIMIZE_FOR_DEBUG is enabled > >>> and CONFIG_SPL_FPGA is not enabled. > >>> > >>> ../common/spl/spl_fit.c:591: undefined reference to `fpga_load' > >>> collect2: error: ld returned 1 exit status > >>> > >>> Signed-off-by: Chanho Park <chanho61.park@samsung.com> > >>> --- > >>> include/fpga.h | 8 ++++++++ > >>> 1 file changed, 8 insertions(+) > >>> > >>> diff --git a/include/fpga.h b/include/fpga.h index > >>> ed688cc0fa3b..44f2755a3f10 100644 > >>> --- a/include/fpga.h > >>> +++ b/include/fpga.h > >>> @@ -60,8 +60,16 @@ int fpga_add(fpga_type devtype, void *desc); > >>> int fpga_count(void); > >>> const fpga_desc *const fpga_get_desc(int devnum); > >>> int fpga_is_partial_data(int devnum, size_t img_len); > >>> +#if CONFIG_IS_ENABLED(FPGA) > >>> int fpga_load(int devnum, const void *buf, size_t bsize, > >>> bitstream_type bstype, int flags); > >>> +#else > >>> +static inline int fpga_load(int devnum, const void *buf, size_t bsize, > >>> + bitstream_type bstype, int flags) { > >>> + return FPGA_FAIL; > >>> +} > >>> +#endif > >>> int fpga_fsload(int devnum, const void *buf, size_t size, > >>> fpga_fs_info *fpga_fsinfo); > >>> int fpga_loads(int devnum, const void *buf, size_t size, > >> > >> There is another patch targeting the same code. > >> Please take a look at > >> https://lore.kernel.org/r/20230808102227.34233-1- > >> eugen.hristev@collabora.com > > > > I wasn't aware that there was an attempt to fix the issue. If I knew it, > I would reply the patch... > > > >> > >> and work together to come up with the patch which covers both cases. > > > > Yes. I also tried to make the patch with CONFIG_CC_OPTIMIZE_FOR_DEBUG > guard but I couldn't find any codes that uses the guard. > > And I was also worried about the CC_OPTIMIZE_FOR_DEBUG's behavior. It > could be related with the optimization level of the compiler. > > That's why I put the guard with #if CONFIG_IS_ENABLED(FPGA). > > > > Best Regards, > > Chanho Park > > > > > Hi Chanho, > > Simon suggested to use CONFIG_CC_OPTIMIZE_FOR_DEBUG in this case here: > > https://protect2.fireeye.com/v1/url?k=a911b2cb-c86a1843-a9103984- > 74fe4860018a-146c33e2b586dc8a&q=1&e=e288ab48-75e8-400b-91c9- > e8bd95520918&u=https%3A%2F%2Fpatchwork.ozlabs.org%2Fproject%2Fuboot%2Fpatc > h%2F20230619102839.277902-1-eugen.hristev%40collabora.com%2F > > As I told Michal, basically your patch and my patch do the same thing. > I suggested him to pick the one that he thinks it's best. (or even suggest > another way) I agree. Either way, I'm fine with it. Best Regards, Chanho Park ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] fpga: define dummy fpga_load function for debug build 2023-08-28 10:00 ` Chanho Park @ 2023-08-28 10:44 ` Michal Simek 0 siblings, 0 replies; 9+ messages in thread From: Michal Simek @ 2023-08-28 10:44 UTC (permalink / raw) To: Chanho Park, 'Eugen Hristev', u-boot; +Cc: 'Simon Glass' Hi, On 8/28/23 12:00, Chanho Park wrote: > Hi, > >> -----Original Message----- >> From: Eugen Hristev <eugen.hristev@collabora.com> >> Sent: Monday, August 28, 2023 5:47 PM >> To: Chanho Park <chanho61.park@samsung.com>; 'Michal Simek' >> <michal.simek@amd.com>; u-boot@lists.denx.de >> Cc: Simon Glass <sjg@chromium.org> >> Subject: Re: [PATCH] fpga: define dummy fpga_load function for debug build >> >> On 8/28/23 03:21, Chanho Park wrote: >>> Hi, >>> >>>> -----Original Message----- >>>> From: Michal Simek <michal.simek@amd.com> >>>> Sent: Friday, August 25, 2023 4:23 PM >>>> To: Chanho Park <chanho61.park@samsung.com>; u-boot@lists.denx.de >>>> Subject: Re: [PATCH] fpga: define dummy fpga_load function for debug >>>> build >>>> >>>> Hi, >>>> >>>> On 8/16/23 08:54, Chanho Park wrote: >>>>> This fixes below build error when CC_OPTIMIZE_FOR_DEBUG is enabled >>>>> and CONFIG_SPL_FPGA is not enabled. >>>>> >>>>> ../common/spl/spl_fit.c:591: undefined reference to `fpga_load' >>>>> collect2: error: ld returned 1 exit status >>>>> >>>>> Signed-off-by: Chanho Park <chanho61.park@samsung.com> >>>>> --- >>>>> include/fpga.h | 8 ++++++++ >>>>> 1 file changed, 8 insertions(+) >>>>> >>>>> diff --git a/include/fpga.h b/include/fpga.h index >>>>> ed688cc0fa3b..44f2755a3f10 100644 >>>>> --- a/include/fpga.h >>>>> +++ b/include/fpga.h >>>>> @@ -60,8 +60,16 @@ int fpga_add(fpga_type devtype, void *desc); >>>>> int fpga_count(void); >>>>> const fpga_desc *const fpga_get_desc(int devnum); >>>>> int fpga_is_partial_data(int devnum, size_t img_len); >>>>> +#if CONFIG_IS_ENABLED(FPGA) >>>>> int fpga_load(int devnum, const void *buf, size_t bsize, >>>>> bitstream_type bstype, int flags); >>>>> +#else >>>>> +static inline int fpga_load(int devnum, const void *buf, size_t bsize, >>>>> + bitstream_type bstype, int flags) { >>>>> + return FPGA_FAIL; >>>>> +} >>>>> +#endif >>>>> int fpga_fsload(int devnum, const void *buf, size_t size, >>>>> fpga_fs_info *fpga_fsinfo); >>>>> int fpga_loads(int devnum, const void *buf, size_t size, >>>> >>>> There is another patch targeting the same code. >>>> Please take a look at >>>> https://lore.kernel.org/r/20230808102227.34233-1- >>>> eugen.hristev@collabora.com >>> >>> I wasn't aware that there was an attempt to fix the issue. If I knew it, >> I would reply the patch... >>> >>>> >>>> and work together to come up with the patch which covers both cases. >>> >>> Yes. I also tried to make the patch with CONFIG_CC_OPTIMIZE_FOR_DEBUG >> guard but I couldn't find any codes that uses the guard. >>> And I was also worried about the CC_OPTIMIZE_FOR_DEBUG's behavior. It >> could be related with the optimization level of the compiler. >>> That's why I put the guard with #if CONFIG_IS_ENABLED(FPGA). >>> >>> Best Regards, >>> Chanho Park >>> >> >> >> Hi Chanho, >> >> Simon suggested to use CONFIG_CC_OPTIMIZE_FOR_DEBUG in this case here: >> >> https://protect2.fireeye.com/v1/url?k=a911b2cb-c86a1843-a9103984- >> 74fe4860018a-146c33e2b586dc8a&q=1&e=e288ab48-75e8-400b-91c9- >> e8bd95520918&u=https%3A%2F%2Fpatchwork.ozlabs.org%2Fproject%2Fuboot%2Fpatc >> h%2F20230619102839.277902-1-eugen.hristev%40collabora.com%2F >> >> As I told Michal, basically your patch and my patch do the same thing. >> I suggested him to pick the one that he thinks it's best. (or even suggest >> another way) > > I agree. Either way, I'm fine with it. ok. I prefer Eugen patch and Chanho please send your tag against that patch. And let me comment Eugen one. Thanks, Michal ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] fpga: define dummy fpga_load function for debug build 2023-08-16 6:54 ` [PATCH] fpga: define dummy fpga_load function for debug build Chanho Park 2023-08-25 7:22 ` Michal Simek @ 2023-08-29 11:10 ` Michal Simek 2023-08-31 2:21 ` Chanho Park 1 sibling, 1 reply; 9+ messages in thread From: Michal Simek @ 2023-08-29 11:10 UTC (permalink / raw) To: Chanho Park, u-boot On 8/16/23 08:54, Chanho Park wrote: > This fixes below build error when CC_OPTIMIZE_FOR_DEBUG is enabled and > CONFIG_SPL_FPGA is not enabled. I would rewrite this because the connection to SPL_FPGA is just one part of it. It is also taken when CONFIG_FPGA is not enabled. > > ../common/spl/spl_fit.c:591: undefined reference to `fpga_load' > collect2: error: ld returned 1 exit status > > Signed-off-by: Chanho Park <chanho61.park@samsung.com> > --- > include/fpga.h | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/include/fpga.h b/include/fpga.h > index ed688cc0fa3b..44f2755a3f10 100644 > --- a/include/fpga.h > +++ b/include/fpga.h > @@ -60,8 +60,16 @@ int fpga_add(fpga_type devtype, void *desc); > int fpga_count(void); > const fpga_desc *const fpga_get_desc(int devnum); > int fpga_is_partial_data(int devnum, size_t img_len); > +#if CONFIG_IS_ENABLED(FPGA) > int fpga_load(int devnum, const void *buf, size_t bsize, > bitstream_type bstype, int flags); > +#else > +static inline int fpga_load(int devnum, const void *buf, size_t bsize, > + bitstream_type bstype, int flags) > +{ > + return FPGA_FAIL; > +} > +#endif > int fpga_fsload(int devnum, const void *buf, size_t size, > fpga_fs_info *fpga_fsinfo); > int fpga_loads(int devnum, const void *buf, size_t size, Thanks, Michal ^ permalink raw reply [flat|nested] 9+ messages in thread
* RE: [PATCH] fpga: define dummy fpga_load function for debug build 2023-08-29 11:10 ` Michal Simek @ 2023-08-31 2:21 ` Chanho Park 2023-08-31 6:33 ` Michal Simek 0 siblings, 1 reply; 9+ messages in thread From: Chanho Park @ 2023-08-31 2:21 UTC (permalink / raw) To: 'Michal Simek', u-boot > On 8/16/23 08:54, Chanho Park wrote: > > This fixes below build error when CC_OPTIMIZE_FOR_DEBUG is enabled and > > CONFIG_SPL_FPGA is not enabled. > > I would rewrite this because the connection to SPL_FPGA is just one part > of it. > It is also taken when CONFIG_FPGA is not enabled. Sure. Will you rewrite while you pick this patch in your tree or do you want me to post v2 patch? Best Regards, Chanho Park ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] fpga: define dummy fpga_load function for debug build 2023-08-31 2:21 ` Chanho Park @ 2023-08-31 6:33 ` Michal Simek 0 siblings, 0 replies; 9+ messages in thread From: Michal Simek @ 2023-08-31 6:33 UTC (permalink / raw) To: Chanho Park, u-boot On 8/31/23 04:21, Chanho Park wrote: >> On 8/16/23 08:54, Chanho Park wrote: >>> This fixes below build error when CC_OPTIMIZE_FOR_DEBUG is enabled and >>> CONFIG_SPL_FPGA is not enabled. >> >> I would rewrite this because the connection to SPL_FPGA is just one part >> of it. >> It is also taken when CONFIG_FPGA is not enabled. > > Sure. Will you rewrite while you pick this patch in your tree or do you want me to post v2 patch? Please send v2. Thanks, Michal ^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2023-08-31 6:33 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <CGME20230816065448epcas2p3bf66892f15a6dc8e082a5f296b307bec@epcas2p3.samsung.com>
2023-08-16 6:54 ` [PATCH] fpga: define dummy fpga_load function for debug build Chanho Park
2023-08-25 7:22 ` Michal Simek
2023-08-28 0:21 ` Chanho Park
2023-08-28 8:46 ` Eugen Hristev
2023-08-28 10:00 ` Chanho Park
2023-08-28 10:44 ` Michal Simek
2023-08-29 11:10 ` Michal Simek
2023-08-31 2:21 ` Chanho Park
2023-08-31 6:33 ` Michal Simek
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox