
Hi,
Sorry for cross-posting, I have been asking for helping solving the issue many days ago, but could not get those work.
(1) UBI support
I added NAND and UBIFS support to my Yocto layer machine config file:
UBOOT_CONFIG = "nand" UBOOT_CONFIG[nand] += "mx6ull_14x14_evk_config" UBOOT_CONFIG[nand] += "mx6ull_14x14_evk_nand_config" UBOOT_CONFIG[nand] += "ubi" UBOOT_CONFIG[nand] += "ubifs"
But my u-boot.imx-nand still could not support ubi:
=> ubi part rootfs Unknown command 'ubi' - try 'help'
What I could be missing here?
(2) Patch u-boot parameters
I am not clear how you do to change u-boot parameters, it seems to me I have to create my own u-boot-imx_2017.03.bbappend and patch files to mx6ullevk.h, to change u-boot parameters of mtdparts, NAND_ROOT_UBI, bootcmd, etc based on my configuration.
But Yocto won't allow the patch running unless that the patch is committed to the git repository in https://source.codeaurora.org/external/imx/uboot-imx.git.
Ideally, I thought all u-boot parameters can be changed in a bbappend file, could you advise if it is possible to do that way or not? If so, how to do it?
If not, what is the policy for making parches and commit to the git repository https://source.codeaurora.org/external/imx/uboot-imx.git?
Thank you.
Kind regards,
- jh

Hi JH,
have you tried what we suggested you in your last thread? More specifically adding your defconfig and tweaking it through menuconfig. and then specify the UBOOT_MACHINE.
However you should be able to create and apply patches for external repo without any problem and the needs to push your changes to public repos (unless them are useful for others).
BR Gabriele
On Thu, Feb 6, 2020 at 7:35 AM JH jupiter.hce@gmail.com wrote:
Hi,
Sorry for cross-posting, I have been asking for helping solving the issue many days ago, but could not get those work.
(1) UBI support
I added NAND and UBIFS support to my Yocto layer machine config file:
UBOOT_CONFIG = "nand" UBOOT_CONFIG[nand] += "mx6ull_14x14_evk_config" UBOOT_CONFIG[nand] += "mx6ull_14x14_evk_nand_config" UBOOT_CONFIG[nand] += "ubi" UBOOT_CONFIG[nand] += "ubifs"
But my u-boot.imx-nand still could not support ubi:
=> ubi part rootfs Unknown command 'ubi' - try 'help'
What I could be missing here?
(2) Patch u-boot parameters
I am not clear how you do to change u-boot parameters, it seems to me I have to create my own u-boot-imx_2017.03.bbappend and patch files to mx6ullevk.h, to change u-boot parameters of mtdparts, NAND_ROOT_UBI, bootcmd, etc based on my configuration.
But Yocto won't allow the patch running unless that the patch is committed to the git repository in https://source.codeaurora.org/external/imx/uboot-imx.git.
Ideally, I thought all u-boot parameters can be changed in a bbappend file, could you advise if it is possible to do that way or not? If so, how to do it?
If not, what is the policy for making parches and commit to the git repository https://source.codeaurora.org/external/imx/uboot-imx.git?
Thank you.
Kind regards,
- jh
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group.
View/Reply Online (#48284): https://lists.yoctoproject.org/g/yocto/message/48284 Mute This Topic: https://lists.yoctoproject.org/mt/71016973/3618237 Group Owner: yocto+owner@lists.yoctoproject.org Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [ gabbla.malist@gmail.com] -=-=-=-=-=-=-=-=-=-=-=-

Thanks Gabriele and Andy,
On 2/6/20, Gabriele Zampieri gabbla.malist@gmail.com wrote:
Hi JH,
have you tried what we suggested you in your last thread? More specifically adding your defconfig and tweaking it through menuconfig. and then specify the UBOOT_MACHINE.
Yes, as I posted in another thread, the MTD, UBI are all set in my Linux kernel defconfig, I have also added UBOOT_CONFIG = "nand" in my layer machine config.
What I missed is u-boot overlay, as you and Andy alluded. I added UBOOT_CONFIG[nand] += "mx6ull_14x14_evk_nand_config", but strange enough, that mx6ull_14x14_evk_nand_config, did not set CONFIG_CMD_UBI in its config.
I think I need to add an appended recipes-bsp to my layer just like I added the recipes-kernel to my layer to overwrite kernel defconfig, I need to overwrite u-boot defconfig.
In kernel, to overwrite defconfig, I run bitbake -c menuconfig virtual/kernel, how can I generate u-boot defconfig, to run bitbake -c menuconfig u-boot?
Thank you.
Kind regards,
- jh

On 2/6/20, JH jupiter.hce@gmail.com wrote:
I think I need to add an appended recipes-bsp to my layer just like I added the recipes-kernel to my layer to overwrite kernel defconfig, I need to overwrite u-boot defconfig.
In kernel, to overwrite defconfig, I run bitbake -c menuconfig virtual/kernel, how can I generate u-boot defconfig, to run bitbake -c menuconfig u-boot?
Hmm, more complicated than I thought, it does not have defconfig in u-boot like kernel does, how do you overwrite u-boot config in Yocto?

Hi,
On Thu, Feb 6, 2020 at 11:07 AM JH jupiter.hce@gmail.com wrote:
Thanks Gabriele and Andy,
On 2/6/20, Gabriele Zampieri gabbla.malist@gmail.com wrote:
Hi JH,
have you tried what we suggested you in your last thread? More
specifically
adding your defconfig and tweaking it through menuconfig. and then
specify
the UBOOT_MACHINE.
Yes, as I posted in another thread, the MTD, UBI are all set in my Linux kernel defconfig, I have also added UBOOT_CONFIG = "nand" in my layer machine config.
What I missed is u-boot overlay, as you and Andy alluded. I added
UBOOT_CONFIG[nand] += "mx6ull_14x14_evk_nand_config", but strange enough, that mx6ull_14x14_evk_nand_config, did not set CONFIG_CMD_UBI in its config.
Sorry, I never tried that approach.
I think I need to add an appended recipes-bsp to my layer just like I added the recipes-kernel to my layer to overwrite kernel defconfig, I need to overwrite u-boot defconfig.
In kernel, to overwrite defconfig, I run bitbake -c menuconfig virtual/kernel, how can I generate u-boot defconfig, to run bitbake -c menuconfig u-boot?
As far as I know uboot (usually virtual/bootloader) does not have a task to run menuconfig directly from bitbake. I usually have a local clone of uboot and I simply run `make [...] menuconfig|savedefconfig` , then I create a patch to add my defconfig (custom_defconfig) to configs/ and specify UBOOT_MACHINE = "custom_defconfig"
Thank you.
Kind regards,
- jh
Gabriele

Hi Gabriele,
On 2/6/20, Gabriele Zampieri gabbla.malist@gmail.com wrote:
As far as I know uboot (usually virtual/bootloader) does not have a task to run menuconfig directly from bitbake. I usually have a local clone of uboot and I simply run `make [...] menuconfig|savedefconfig` , then I create a patch to add my defconfig (custom_defconfig) to configs/ and specify UBOOT_MACHINE = "custom_defconfig"
Are there any document to use cross compiler tools to build u-boot-imx on Ubuntu 18 host machine? It seems that build environment will not be the same as the Yocto build environment I am currently running on Ubuntu 18 host.
Thank you Gabriele for great helps.
Kind regards,
- jh

Hi,
On Fri, Feb 7, 2020 at 2:55 AM JH jupiter.hce@gmail.com wrote:
Hi Gabriele,
On 2/6/20, Gabriele Zampieri gabbla.malist@gmail.com wrote:
As far as I know uboot (usually virtual/bootloader) does not have a task
to
run menuconfig directly from bitbake. I usually have a local clone of uboot and I simply run `make [...] menuconfig|savedefconfig` , then I create a patch to add my defconfig (custom_defconfig) to configs/ and specify UBOOT_MACHINE = "custom_defconfig"
Are there any document to use cross compiler tools to build u-boot-imx on Ubuntu 18 host machine? It seems that build environment will not be the same as the Yocto build environment I am currently running on Ubuntu 18 host.
I compile uboot using the Yocto generated SDK. Simply
source /opt/poky/.../env-script make -j4
If you just want to run the menuconfig run make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- menuconfig and make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- savedefconfig In any environment.
Thank you Gabriele for great helps.
Kind regards,
- jh
Gabriele

Hi Gabriele,
Thanks for the help.
On 2/8/20, Gabriele Zampieri gabbla.malist@gmail.com wrote:
If you just want to run the menuconfig run make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- menuconfig and make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- savedefconfig In any environment.
It does not seem the OE / Yocto build issue, rather than the u-boot build issue.
I can build OE / Yocto to load my mx6ull_14x14_evk_nand_defconfig to replace the original source git/configs/mx6ull_14x14_evk_nand_defconfig.
The git/scripts/kconfig was able to run defconfig mode that git/scripts/kconfig/conf.c and git/scripts/kconfig/confdata.c was able to enable CONFIG_CMD_UBI and to write to the .config based on my mx6ull_14x14_evk_nand_defconfig, but git/scripts/kconfig/conf.c and git/scripts/kconfig/confdata.c were not able to generate CONFIG_CMD_MTDPARTS (I could not find CONFIG_CMD_MTDPARTS when I made menuconig from menu config either).
The git/cmd/Makefile requires CONFIG_CMD_MTDPARTS set up to run mtdparts.c, without CONFIG_CMD_MTDPARTS, mtdparts.c was not compiled, and other cmd source files were not compiled, thus missing all dependencies for ubi (undefined reference).
Is it buggy in u-boot source downloaded from https://source.codeaurora.org/external/imx/uboot-imx.git (commit "8be98e9322040c655b9e5c9fb2c494e002e3fad9"), or is just my silly stupidity to miss things?
Could anyone in u-boot source development help to comment our if https://source.codeaurora.org/external/imx/uboot-imx.git (commit "8be98e9322040c655b9e5c9fb2c494e002e3fad9") works for ubi or not? Or what I could be missing?
Apologize to cc source contributors.
Thank you.
Kind regards,
- jh

Changed to https://source.codeaurora.org/external/imx/uboot-imx.git branch imx_v2018.03_4.14.98_2.0.0_ga, it can now support CONFIG_CMD_MTDPARTS ind defconfg, all MTDPARTS error gone, but then 2018.03-r0/git/cmd/ubi.c missed dependencies of del_mtd_partitions, add_mtd_partitions, mtd_get_device_size all in mtdpart.c which can only be enabled by CONFIG_MTD_PARTITIONS:
obj-$(CONFIG_MTD_PARTITIONS) += mtdpart.o
But that CONFIG_MTD_PARTITIONS is not supported in defconfig.
Could anyone advise which branch works for UBI?
Thank you.
Kind regards,
- jh

Anyway, hacked the Makefile and mtdpart.c, finally got it compiled to support UBI. I think some latest branch might fix the problems I haven't tested, if not, I am happy to make patches.
Thank you all.
Kind regards,
- jh
On 2/9/20, JH jupiter.hce@gmail.com wrote:
Changed to https://source.codeaurora.org/external/imx/uboot-imx.git branch imx_v2018.03_4.14.98_2.0.0_ga, it can now support CONFIG_CMD_MTDPARTS ind defconfg, all MTDPARTS error gone, but then 2018.03-r0/git/cmd/ubi.c missed dependencies of del_mtd_partitions, add_mtd_partitions, mtd_get_device_size all in mtdpart.c which can only be enabled by CONFIG_MTD_PARTITIONS:
obj-$(CONFIG_MTD_PARTITIONS) += mtdpart.o
But that CONFIG_MTD_PARTITIONS is not supported in defconfig.
Could anyone advise which branch works for UBI?
Thank you.
Kind regards,
- jh

Hi JH,
On Sun, Feb 09, 2020 at 08:01:15PM +1100, JH wrote:
Changed to https://source.codeaurora.org/external/imx/uboot-imx.git branch imx_v2018.03_4.14.98_2.0.0_ga, it can now support CONFIG_CMD_MTDPARTS ind defconfg, all MTDPARTS error gone, but then 2018.03-r0/git/cmd/ubi.c missed dependencies of del_mtd_partitions, add_mtd_partitions, mtd_get_device_size all in mtdpart.c which can only be enabled by CONFIG_MTD_PARTITIONS:
obj-$(CONFIG_MTD_PARTITIONS) += mtdpart.o
But that CONFIG_MTD_PARTITIONS is not supported in defconfig.
Could anyone advise which branch works for UBI?
FYI, U-boot was still slowly migrating to Kconfig only back then (maybe still is). There was for a long time a mix between Kconfig options and options in what I call board header files (include/configs/<board>.h).
Most likely CONFIG_MTD_PARTITIONS had to be defined there.
Biased recommendation: https://www.youtube.com/watch?v=5E0sdYkvq-Q
BR, Quentin

JH wrote...
I added NAND and UBIFS support to my Yocto layer machine config file:
UBOOT_CONFIG = "nand" UBOOT_CONFIG[nand] += "mx6ull_14x14_evk_config" UBOOT_CONFIG[nand] += "mx6ull_14x14_evk_nand_config" UBOOT_CONFIG[nand] += "ubi" UBOOT_CONFIG[nand] += "ubifs"
But my u-boot.imx-nand still could not support ubi:
=> ubi part rootfs Unknown command 'ubi' - try ‘help’
You need to start to read through the various sources to figure out for yourself what is going on!
Starting from the bottom, in U-Boot 2017.03 all of the command sources are in the “cmd” directory. The “ubi …” command are all in ubi.c. Reading cmd/Makefile shows that file gets added into the build if CONFIG_CMD_UBI is enabled.
The next place to look is whether or not that is set in your defconfig for U-Boot or overwritten somewhere in a recipe in your Yocto build environment.
-Andy.

Hi Andy,
On 2/6/20, Andy Pont andy.pont@sdcsystems.com wrote:
JH wrote...
I added NAND and UBIFS support to my Yocto layer machine config file:
UBOOT_CONFIG = "nand" UBOOT_CONFIG[nand] += "mx6ull_14x14_evk_config" UBOOT_CONFIG[nand] += "mx6ull_14x14_evk_nand_config" UBOOT_CONFIG[nand] += "ubi" UBOOT_CONFIG[nand] += "ubifs"
But my u-boot.imx-nand still could not support ubi:
=> ubi part rootfs Unknown command 'ubi' - try ‘help’
You need to start to read through the various sources to figure out for yourself what is going on!
Starting from the bottom, in U-Boot 2017.03 all of the command sources are in the “cmd” directory. The “ubi …” command are all in ubi.c. Reading cmd/Makefile shows that file gets added into the build if CONFIG_CMD_UBI is enabled.
You are right, that CONFIG_CMD_UBI is not enabled, but I could not find any conf or bb files I could change or enable CONFIG_CMD_UBI in meta-freescale layer.
Desperately, I hacked to run "make menuconfig" at U-Boot 2017.03 build directory, selected and enabled CONFIG_CMD_UBI and saved to .config file in that build directory, but then to run bitbake to build u-boot again, the .config was removed and replaced by an old one disabled CONFIG_CMD_UBI again.
Other people recommended to build u-boot in a standalone environment out of OE / Yocto build system. Since I have set up everything in OE / Yocto environment, I thought it could be easier if I could modify one line of u-boot config file in a recipe.
Any idea where is the recipe in meta-freescale to allow me to change / enable CONFIG_CMD_UBI?
Am I the only one unable to change u-boot config file in OE / Yoctu build? That makes me very sad :-(.
The next place to look is whether or not that is set in your defconfig for U-Boot or overwritten somewhere in a recipe in your Yocto build environment.
Yeah, I'll been searched all day, could not find a recipe Yocto build environment, I was told OE / Yocto does not have that stack and mechanism to set and change u-boot config, is it true?
Thank you very much.
Kind regards,
- jh
participants (4)
-
Andy Pont
-
Gabriele Zampieri
-
JH
-
Quentin Schulz