lkml.org 
[lkml]   [2022]   [May]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: Queries: Using ifdef CONFIG condition in dts files
On Fri, 27 May 2022 at 15:34, Pintu Agarwal <pintu.ping@gmail.com> wrote:
>
> Hi,
>
> On Thu, 26 May 2022 at 19:53, T.Michael Turney <quic_mturney@quicinc.com> wrote:
> >
> > Kernel developers correct me where I go astray, but this seems like the
> > CONFIG_XYZ value is not available in this file. This would explain why
> > the disable case works.
> >
> > At top of dtsi file are you #include <config.h> or whatever the correct
> > syntax is to see the CONFIG values?
>
> Thanks for your comments.
> No, I could not find any specific config,h to be included to make the
> CONFIG values visible to dts.
>

BTW, I tried another approach but this also doesn't work when CONFIG is enabled.
a) I have created a new header file such as myxyz.h and defined a new
macro with config check.
=> myxyz.h
+#ifdef CONFIG_XYZ
+#define XYZ_CMA
+#endif

b) Then I included the header file in my dtsi file and used ifdef with
the new macro.

#include "myxyz.h"

#ifdef CONFIG_XYZ
&reserved_mem {
xyz_region: xyz_region {
compatible = "shared-dma-pool";
reusable;
size = <0x600000>;
};
};
#endif

But unfortunately this approach also did not work when CONFIG is
enabled. So, when config enable/disable its same behavior.
However, if I put the #define in the dtsi file itself then it works as expected.


Thanks,
Pintu

\
 
 \ /
  Last update: 2022-05-27 13:37    [W:0.056 / U:0.088 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site