Edit files

Edit: "board/fedevel/mx6openrex/mx6s_2x_mt41k128.cfg"
In case your memory configuration is different from your existing board, you may need to create a memory cfg file. Copy the existing cfg to a new one and edit it:

Update the "mx6s_2x_mt41k128.cfg" file based on *.inc file which you used for calibration in DDR Stress Tool. Here is an example of "OpenRex_512MB_DDR3_register_programming_aid_v0.4.inc" located on my PC machine inside "DDR_Stress_Tester_V1.0.2\Binary\scripts\MX6_series_boards\SabreSD\RevC_and_RevB\MX6Solo\":

Important: When you are changing memory size, double check CS0_END in MDPC register (0x021b0040) and Address width in MDCTL register (0x021b0000). Based on MDCTL settings, uBoot will determine memory size (it's the size you see when uBoot boots up and says like "DRAM: 512 MiB" or "DRAM: 2 GiB")

Edit: "configs/mx6sopenrex_defconfig"
In the next step, create a config file for this board variant. The name of this config file will be used during "bitbake". Let's copy an existing config into a new one:

In defconfig we can specify some parameters about CPU, memory size, board name .... Here is an example how the file may look then:

CONFIG_ARM=y
CONFIG_ARCH_MX6=y
CONFIG_TARGET_MX6OPENREX=y
CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/fedevel/mx6openrex/mx6s_2x_mt41k128.cfg,MX6S,DDR_SIZE=SZ_512M,BOARD_TYPE_PREFIX=\"imx6s-\",BOARD_TYPE_POSTFIX=\"\""
# CONFIG_CMD_IMLS is not set
# CONFIG_CMD_FLASH is not set
CONFIG_SPI_FLASH=y
CONFIG_SYS_PROMPT="OpenRex U-Boot> "

Notice the line 4. In the line we set some parameters which we will use later.

Edit: "include/configs/mx6openrex.h"
Now, we need to update the lines which used the fixed values. Replace them with our parameters from "mx6sopenrex_defconfig".

*Note: Notice, that you need to use "CONFIG_" prefix for the parameters defined in "mx6sopenrex_defconfig".

Edit: "include/configs/mx6openrex.h"
Do not forget to update also existing files and add the new parameters into existing "*_defconfig".

gedit configs/mx6qopenrex_defconfig

Before

CONFIG_ARM=y
CONFIG_ARCH_MX6=y
CONFIG_TARGET_MX6OPENREX=y
CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/fedevel/mx6openrex/mx6q_4x_mt41j256.cfg,MX6Q"
# CONFIG_CMD_IMLS is not set
# CONFIG_CMD_FLASH is not set
CONFIG_SPI_FLASH=y
CONFIG_SYS_PROMPT="OpenRex U-Boot> "

After

CONFIG_ARM=y
CONFIG_ARCH_MX6=y
CONFIG_TARGET_MX6OPENREX=y
CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/fedevel/mx6openrex/mx6q_4x_mt41j256.cfg,MX6Q,DDR_SIZE=SZ_2G,BOARD_TYPE_PREFIX=\"imx6q-\",BOARD_TYPE_POSTFIX=\"\""
# CONFIG_CMD_IMLS is not set
# CONFIG_CMD_FLASH is not set
CONFIG_SPI_FLASH=y
CONFIG_SYS_PROMPT="OpenRex U-Boot> "

Compile uBoot

Compile and test the new board configuration. Use the new "mx6sopenrex_config":

make distclean
make mx6sopenrex_config
make
cp u-boot.imx /tftp/imx6/u-boot-imx6s-openrex.imx

Test uBoot

The best way to test a completely new uBoot is to use MFGTOOL. If you are not sure what it is, have a look at: How to setup MFGTOOL

Once you have MFGTOOL installed, you can continue. Follow these steps:

What next

Press RESET button on your OpenRex board. If your board has eFuses set (it probably has), it will automatically boot up from SPI. If eFuses are not setup, have a look at: How to update eFuses (“fuse” command)

Upload the new uBoot to Github

When you are happy with the new uBoot, run following commands to update uBoot github:

git remote -v #check the origin, should point to your github
#git remote add origin https://github.com/FEDEVEL/openrex-uboot-v2015.10.git #run this if you get error about no origin
git checkout jethro #set the current active branch to jethro
git branch #check if you are on jethro branch
git status #have a look what files were changed
#based on the status command, add the files you would like to upload to github
#you could also use "git add .", but that occasionally cause problems
#sometimes "add ." wants to upload also files which you have not changed, that's why I use "git add filename"
git add filename1
git add filename2
git diff origin/jethro #check if it shows correct differences
#in case differences are not what you expected or you find a mistake, you can use "git reset". Then repeat the procedure again
#if you are happy with the differences, upload the changes to github
git commit -m 'Added support for SOLO' #use a comment describing the changes
#git remote set-url origin https://github.com/FEDEVEL/openrex-uboot-v2015.10.git #run this if you get error, that "git://" is read only
git push origin jethro

Edit Linux Kernel

Get the source code

You have two options to get the source code. You can download it directly from github or you can edit the Kernel files in your YOCTO OpenRex project.

*Note: this will finish with an error. To fully boot up, you also need an SD card with filesystem. See the next steps.

Upload the new Kernel to Github

When you are happy with the new Kernel, run following commands to update Kernel github:

git remote -v #check the origin, should point to your github
#git remote add origin https://github.com/FEDEVEL/openrex-uboot-v2015.10.git #run this if you get error about no origin
git checkout jethro #set the current active branch to jethro
git branch #check if you are on jethro branch
git status #have a look what files were changed
#based on the status, add the files you would like to upload to github
#you could also use "git add .", but that occasionally cause problems
#sometimes "add ." wants to upload also files which you have not changed, that's why I use "git add filename"
git add filename1
git add filename2
git diff origin/jethro #check if it shows correct differences
#in case differences are not what you expected or you find a mistake, you can use "git reset". Then repeat the procedure again
#if you are happy with the differences, upload the changes to github
git commit -m 'Added support for SOLO' #use a comment describing the changes
#git remote set-url origin https://github.com/FEDEVEL/openrex-linux-3.14.git #run this if you get error, that "git://" is read only
git push origin jethro

Upload the new Meta Layer to Github

If everything works oki, upload the new meta layer to github:

git remote -v #check the origin, should point to your github
#git remote add origin https://github.com/FEDEVEL/openrex-uboot-v2015.10.git #run this if you get error about no origin
git checkout jethro #set the current active branch to jethro
git branch #check if you are on jethro branch
git status #have a look what files were changed
#based on the status, add the files you would like to upload to github
#you could also use "git add .", but that occasionally cause problems
#sometimes "add ." wants to upload also files which you have not changed, that's why I use "git add filename"
git add filename1
git add filename2
git diff origin/jethro #check if it shows correct differences
#in case differences are not what you expected or you find a mistake, you can use "git reset". Then repeat the procedure again
#if you are happy with the differences, upload the changes to github
git commit -m 'Added support for SOLO' #use a comment describing the changes
git push origin jethro
#git remote set-url origin https://github.com/FEDEVEL/meta-openrex.git #run this if you get error, that "git://" is read only