Repository navigation
imx-defconfig: Add support to build SOF for imx8 - #13
Conversation
|
@dbaluta shouldn't we start with the baseline for compilation on ARM in general. |
|
@plbossart By reading the README I understood that the baseline for each architecture is the defconfig file (e.g arch/arm64/configfs/defconfig). As far as I understand from defconfig we generate initial .config then merge it with base-defconfig then with imx-defconfig. So, the final .config used for compilation would be:
In the case of arm64 this is far from ideal because defconfig on arm64 contains all arm64 based boards and the compilation takes around 10 minutes on a 8 core Xeon(R) CPU E5-1620 machine. I have a reduced config for arm and the combination:
takes under 2 minutes. How can we propagate my reduced config to the CI server? |
Sorry I don't get your point. The two options look identical to me, it's the same set of defconfig+base+imx, and the defconfig is arch-specific. What I am missing? Is there a typo in your explanation or a concept I am missing?
Once we agree on the default, we'd need @xiulipan to reflect the changes but I understand he's taking personal time off. |
You are right it is confusing. Both options look identical with a minor difference. See below: First test:
This takes 10 mintues. Second test: Everything as above but reduce 1) defconfig by removing all other arm64 boards except imx. This takes under 1 minute. Does this make sense? The problem is that starting with a plain arm64 vanilla defconfig would be a pain because by default arm64 enables all supported platforms (and they are a lot!). |
|
right, so we'd need an arm64-lite-defconfig where you remove all the unsupported boards, right? |
|
@plbossart @dbaluta So for the IMX kconfig Here are few question before adding arm64 linux build into CI.
|
@plbossart @xiulipan sorry for delayed response I'm not in the office these days. I have updated this PR with imx lite config and with instruction how to cross compile the kernel image. @xiulipan i am using the default cross compiler aarch64-linux-gnu- in Ubuntu 18.04 (gcc 7.4). Please find all the instruction in the commit above. |
lgirdwood
left a comment
There was a problem hiding this comment.
Feel free to add these instruction on sof-docs too.
|
@dbaluta isn't it easier if you take a defconfig and remove what you don't need with a fragment? the last fragment overrides the initial ones, so you don't need to keep track of everything, e.g. selecting stuff like CONFIG_HZ is a bit too much in the details? |
|
@plbossart, to remove what I don't need with a fragment means that I create a fragment where options from the initial defconfig that I do not need are marked as =n right? |
yes, or commented out (as for HDaudio) |
OK, let me give it a try. |
|
e.g. is enough to remove the default in defconfig. |
|
@plbossart thanks for your comments. I have added a kconfig fragment named nobloat-imx-defconfig this should remove most of unrelated to imx8 config options. |
|
@xiulipan, out of curiosity how long does it take to compile arm64 with default config on your machines? i just checked now and on our side the bottleneck actually is the disk + weird combination of network backed fs |
|
@plbossart @xiulipan i think the commit now it's a good first start for compiling support for arm64 targeted for imx8 platform. |
|
@dbaluta I just tried on my Skylake NUC (i7+1TB SSB), I can compile the defconfig+no_bloat config in about 6mn. You still have quite a few things in there that are probably useless such Nouveau drivers and other DRM things. With the ARM64 defconfig the time is about 7mn30, so the speed-up is limited. Also I wasn't able to select iMX in SOF with the merge_config script, I have to go in and select them manually. Not sure if this is because of the kconfig files or rather the kernel PR that's still WIP. |
|
@dbaluta @plbossart |
|
@plbossart drm + nouveau are first suspect indeed, even with them out i don't think we can go under 5 mins. There are tons of not useful drivers regarding i.MX board. Will try to do more experiments, but as you said i will try to keep nobloat-imx config super small because it will be hard to maintain in the future. For imx SOF did you try merge of .config + no_bloat + sof-defconfig right? Because on my side the merge actually selects IMX SOF configs? |
yep. Can you send me the exact commands you tried? |
|
@plbossart i have used the following commands. Please mind that i also have the imx8 patches applied thesofproject/linux#1048. Without these patches indeed there is no IMX8 SOF config to select. the resulted .config file has I will try to send asap a next version of the patches your feedback applied. |
|
On 7/30/19 1:11 PM, Daniel Baluta wrote:
@plbossart <https://github.com/plbossart> i have used the following
commands. Please mind that i also have the imx8 patches applied
thesofproject/linux#1048
<thesofproject/linux#1048>. Without these
patches indeed there is no IMX8 SOF config to select.
|# setup crosscompiler for arm64 $ make defconfig $
./scripts/kconfig/merge_config.sh .config
/work/repos/kconfig/base-defconfig
Ah yes, I was not using the base-config. That may have been the issue,
will check.
/work/repos/kconfig/nobloat-imx-defconfig /work/repos/kconfig/sof-defconfig |
the resulted .config file has
|CONFIG_SND_SOC_SOF_IMX_TOPLEVEL=y CONFIG_SND_SOC_SOF_IMX8=m |
I will try to send asap a next version of the patches your feedback applied.
Doesn't work for me. I use make.cross and tools used by 0day:
$ ../make.cross ARCH=arm64 defconfig
make -C source O=/data/pbossart/ktest/sof-dev-build
CROSS_COMPILE=/opt/gcc-4.9.1/aarch64-linux-gnu/bin/aarch64-linux-gnu-
--jobs=16 ARCH=arm64 defconfig
make: Entering directory '/data/pbossart/ktest/sof-dev'
make[1]: Entering directory '/data/pbossart/ktest/sof-dev-build'
GEN Makefile
*** Default configuration is based on 'defconfig'
#
# configuration written to .config
#
make[1]: Leaving directory '/data/pbossart/ktest/sof-dev-build'
make: Leaving directory '/data/pbossart/ktest/sof-dev'
./sof-dev/scripts/kconfig/merge_config.sh .config
/data/pbossart/GIT/kconfig/nobloat-imx-defconfig
/data/pbossart/GIT/kconfig/base-defconfig
/data/pbossart/GIT/kconfig/sof-defconfig
Value requested for CONFIG_SND_SOC_SOF_IMX_TOPLEVEL not in final .config
Requested value: CONFIG_SND_SOC_SOF_IMX_TOPLEVEL=y
Actual value:
Value requested for CONFIG_SND_SOC_SOF_IMX8 not in final .config
Requested value: CONFIG_SND_SOC_SOF_IMX8=y
Actual value:
|
|
@plbossart strange. Will try to reproduce your setup on my side. Sorry for wasting your time. |
no worries, it could be a bug that needs to be fixed in the scripts. If this helps maybe we can have a first pass with the changes to sof-defconfig and you add the optimized defconfig later in a followup PR |
|
@plbossart @dbaluta I can get the right kconfig with both PR. |
|
@xiulipan can you let us know the commands you used to get the right Kconfig? As mentioned above I do also get them correctly but on @plbossart it seems there are some problems. So, I'm trying to find some time to look at this but I am also working on new version of thesofproject/linux#1048 |
|
@dbaluta the same command with you, but in the linux kernel with thesofproject/linux#1048 You defined in thesofproject/linux#1048, if you do not use the right source code. The Kconfig option you mentioned is invalid for the make system. |
|
@xiulipan thanks! It means that @plbossart is not working on this branch but on topic/sof-dev. Let me test this again with the new patches incoming and perhaps then we can agree on merging this PR. |
no, I did test with pr1048. That's why I don't get why the options are not selected. |
|
@plbossart |
|
@plbossart I think I missed to select an option, it seems that merge doesn't resolve dependencies. So, I think it should work now. |
|
On another look I have a compilation error. Will fix it in few hours and let you know. |
|
@plbossart I think frag config are OK now. Can you give it another try? |
|
@xiulipan let me know if you get some spare time to pull my patches in the CI so that we can have a minimum compilation for the ARM platform :) |
|
@dbaluta Will try and update the result here. |
|
@lgirdwood @xiulipan did you get a chance to look into this? I think @Mihaix can provide some help if you guide us what to do |
|
|
||
| #SOF i.MX platform drivers | ||
| CONFIG_SND_SOC_SOF_IMX_TOPLEVEL=y | ||
| CONFIG_SND_SOC_SOF_IMX8=y |
There was a problem hiding this comment.
I think this will have to be changed, see the PR to fix the Kconfigs thesofproject/linux#1382
There was a problem hiding this comment.
@plbossart all right, will handle this asap. I'm now at ELCE :).
There was a problem hiding this comment.
no worries, I probably broke a number of eggs with my Kconfig changes, so it can wait next week. Enjoy ELC!
Signed-off-by: Daniel Baluta <[email protected]>
…n time arm64 world uses a huge defconfig which compiles support for all arm64 boards. This results in huge compilation times not suitable for a CI. Introduce nobloat-imx-defconfig kconfig frament which removes as much config options as possible. How to compile a kernel for i.MX8QXP (Ubuntu 18.04): 1) Download cross compiler $ sudo apt-get install gcc-aarch64-linux-gnu 2) Build .config based on defconfig $ ARCH=arm64 CROSS_COMPILE=/usr/bin/aarch64-linux-gnu- make defconfig 4) Reduce defconfig (by merging with imx-no-bloat) and add support for compiling SOF by merging sof-defconfig kconfig fragment. $ ARCH=arm64 CROSS_COMPILE=/usr/bin/aarch64-linux-gnu- ./scripts/kconfig/merge_config.sh .config <>/kconfig/nobloat-imx-defconfig <>/kconfig/sof-defconfig 5) Build kernel $ ARCH=arm64 CROSS_COMPILE=/usr/bin/aarch64-linux-gnu- make -j8 Signed-off-by: Daniel Baluta <[email protected]>
|
@xiulipan @plbossart we are ready to go with arm64 build :) |
Signed-off-by: Daniel Baluta [email protected]