Re: [yocto] How to config kernel in my own meta layer?

2017-12-23 Thread Patrick Ohly
On Thu, 2017-12-21 at 10:32 -0500, Fan Zhang wrote:
> Greetings,
> 
> I have a recipes that requires 128MB of CMA allocation for DMA. I
> followed the instruction in  http://www.yoctoproject.org/docs/1.6/ker
> nel-dev/kernel-dev.html#changing-the-configuration and did the
> following:
> 
> My recipes structure: 
> 
> 
> meta-mylayer\recipes-my\uio-test\
> 
> 1. Then in uio-test folder, I have uio-test.bb 
> 
[...]

> My question: I think the cfg file is being parsed because if I change
> the folder name files to something else, bitbake will complaint about
> not being able to find uio-test.cfg. However, the final .config in
> built do not have the CMA allocated.

I suspect there's a fundamental misunderstanding. Your uio-test.bb is a
separate recipe, and therefore its content has no effect whatsoever on
the kernel configuration.

The right place to add your "file://uio-test.cfg" is in a .bbappend for
the kernel that you are building. But as Bruce said, that kernel must
be derived from linux-yocto.

-- 
Best Regards, Patrick Ohly

The content of this message is my personal opinion only and although
I am an employee of Intel, the statements I make here in no way
represent Intel's position on the issue, nor am I authorized to speak
on behalf of Intel on this matter.


-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


Re: [yocto] Kernel configuration problem/confusion

2017-12-23 Thread Bruce Ashfield



On 12/22/2017 6:17 PM, Greg Wilson-Lindberg wrote:

Hi Bruce,
First, thanks for the unbelievably quick response.

I searched the Yocto sources and didn't find anything that was trying to 
manipulate either of the variables except my .cfg.


The memuconfig search for MAX9768 results in:
Symbol: SND_SOC_MAX9768 [=n]
     Type  : tristate
       Defined at sound/soc/codecs/Kconfig:917
       Depends on: SOUND [=y] && !M68K && !UML && SND [=m] && SND_SOC [=m]
       Selected by: SND_SOC_ALL_CODECS [=n] && SOUND [=y] && !M68K && 
!UML && SND [=m] && SND_SOC [=m] && COMPILE_TEST [=n] && I2C [=y]
To my (untrained) eye it seems that I need SND_SOC_ALL_CODECS 
& COMPILE_TEST. I tried setting them but I get a similar error 
for COMPILE_TEST. A search for it yields:

  Symbol: COMPILE_TEST [=n]
     Type  : boolean
     Prompt: Compile also drivers which will not load
       Location:
     (1) -> General setup
       Defined at init/Kconfig:56
Which doesn't seem to suggest that there should be any problems setting it.



True, but since SND_SOC_MAX9768 doesn't have any help text (aka
a prompt in Kconfig speak) then it isn't something that you can
actually reach by menuconfig and by extension .. it must be selected
by other code. So you are on the right track. Either those symbols
are also missing dependencies, or MAX9768 itself is missing a
dependency.



The search for MAX1363 yields:
  Symbol: MAX1363 [=n]
     Type  : tristate
      Prompt: Maxim max1363 ADC driver
       Location:
         -> Device Drivers
           -> Industrial I/O support (IIO [=m])
     (1)     -> Analog to digital converters
       Defined at drivers/iio/adc/Kconfig:218
       Depends on: IIO [=m] && I2C [=y]
       Selects: IIO_BUFFER [=y] && IIO_TRIGGERED_BUFFER [=n]
Which doesn't seem to mereveal any reason that I shouldn't be able to 
set it.


At a glance, I'm also not seeing the reason. Did you try forcing
IIO=y and seeing if there's a difference ? =m should satisfy that
Kconfig dependency, but it is worth checking.

Is this a mainline kernel ? or something else that I could build ?
Maybe with a quick test here, it would be more obvious.

Bruce



Regards,
Greg

*From:* Bruce Ashfield 
*Sent:* Friday, December 22, 2017 12:27:22 PM
*To:* Greg Wilson-Lindberg; yocto@yoctoproject.org
*Subject:* Re: [yocto] Kernel configuration problem/confusion


On 12/22/2017 3:51 PM, Greg Wilson-Lindberg wrote:
I'm trying to add some kernel configuration to a Raspberry pi3 yocto 
build.  I've got the .cfg fragment being read in, but I'm getting 
warnings that indicate that they are not making the desired changes.



The first one is CONFIG_SND_SOC_MAX9768. This is a sound codec and the 
Kconfig file has it in a long list of select's. the one for the MAX9768 is:


      select CONFIG_SND_SOC_MAX9768 if I2C

I2C is set, but CONFIG_SND_SOC_MAX9768 ends up undefined. the warning 
I'm getting is:


-- CONFIG_SND_SOC_MAX9768 -
Config: CONFIG_SND_SOC_MAX9768
From: 
/home/gwilson/Qt-5.9/Yocto-build-RPi3/build-raspberrypi3/tmp/work-shared/raspberrypi3/kernel-source/.kernel-meta/configs/Scribe.cfg

Requested value:  CONFIG_SND_SOC_MAX9768=y
Actual value:

Config 'SND_SOC_MAX9768' has the following conditionals:
Dependency values are:

SND_SOC_MAX9768 ends up not being selected even though I try to set it 
ti 'y'



The second one is CONFIG_MAX1363, this is an ADC that I'm trying to set, 
the warning is:


-- CONFIG_MAX1363 -
Config: CONFIG_MAX1363
From: 
/home/gwilson/Qt-5.9/Yocto-build-RPi3/build-raspberrypi3/tmp/work-shared/raspberrypi3/kernel-source/.kernel-meta/configs/Scribe.cfg

Requested value:  CONFIG_MAX1363=y
Actual value:     # CONFIG_MAX1363 is not set

Config 'MAX1363' has the following conditionals:
    I2C (value: "y")
Dependency values are:
    I2C [y]

It ends up being not set. In both cases the value that I'm trying to set 
is ignored. Any insight would be greatly appreciated.


The python library that tries to detangle the Kconfig dependencies
isn't perfect (but I do have an update for it pending), so you might
not be getting the entire story in that information dumb.

Two things to check:

   - there are no other fragments that are disabling the same option
   - use menuconfig in the kernel to search the option and see what it
     reports for the dependencies.

There's some constraint or overriding command that is not allowing the
option into the final config, we just need to track it down.

Bruce




Regards,

Greg




--
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto