Skip to content
Snippets Groups Projects
Commit d7140351 authored by Otavio Salvador's avatar Otavio Salvador Committed by Stefano Babic
Browse files

cgtqmx6eval: Add SPL support


Congatec has several MX6 boards based on quad, dual, dual-lite and solo.

Add SPL support so that all the variants can be supported

Signed-off-by: default avatarOtavio Salvador <otavio@ossystems.com.br>
Reviewed-by: default avatarFabio Estevam <fabio.estevam@freescale.com>
parent eb76f13a
No related branches found
No related tags found
Loading
...@@ -46,6 +46,9 @@ config TARGET_ARISTAINETOS2B ...@@ -46,6 +46,9 @@ config TARGET_ARISTAINETOS2B
config TARGET_CGTQMX6EVAL config TARGET_CGTQMX6EVAL
bool "cgtqmx6eval" bool "cgtqmx6eval"
select SUPPORT_SPL
select DM
select DM_THERMAL
config TARGET_CM_FX6 config TARGET_CM_FX6
bool "CM-FX6" bool "CM-FX6"
......
U-Boot for the Congatec Conga-QEVAl Evaluation Carrier board with U-Boot for the Congatec QMX6 boards
qmx6 quad module.
This file contains information for the port of U-Boot to the Congatec This file contains information for the port of U-Boot to the Congatec
Conga-QEVAl Evaluation Carrier board with qmx6 quad module. QMX6 boards.
1. Boot source, boot from SD card 1. Building U-boot
------------------
- Build U-boot for Congatec QMX6 boards:
$ make mrproper
$ make cgtqmx6eval_defconfig
$ make
This will generate the following binaries:
- SPL
- u-boot.img
2. Flashing U-boot in the SPI NOR
--------------------------------- ---------------------------------
By default, the Congatec board can boot only from the SPI-NOR. Copy SPL and u-boot.img to the exported TFTP directory of the
But, with the u-boot version provided with the board you can write boot host PC (/tftpboot , for example).
registers to force the board to reboot and boot from the SD slot. If
"bmode" command is not available from your pre-installed u-boot, these => sf probe
instruction will produce the same effect:
=> tftp 0x12000000 SPL
=> sf erase 0x0 0x10000
=> sf write 0x12000000 0x400 0x100
=> tftp 0x12000000 u-boot.img
=> sf erase 0x10000 0x70000
=> sf write 0x12000000 0x10000 0x70000
Reboot the board and the new U-boot should come up.
3. Booting from the SD card
---------------------------
- Flash the SPL image into the SD card:
sudo dd if=SPL of=/dev/mmcblk0 bs=1k seek=1; sync
- Flash the u-boot.img image into the SD card:
sudo dd if=u-boot.img of=/dev/mmcblk0 bs=1k seek=69; sync
- Insert the SD card into the big slot.
The boot medium of Congatec QMX6 boards is the SPI NOR flash, so boot
the board from SPI first.
conga-QMX6 U-Boot > mw.l 0x20d8040 0x3850 It is also possible to boot from the SD card slot by using the 'bmode'
conga-QMX6 U-Boot > mw.l 0x020d8044 0x10000000 command:
conga-QMX6 U-Boot > reset
resetting ...
The the board will reboot and, if you have written your SD correctly => bmode esdhc4
the board will use u-boot that live into the SD
To copy the resulting u-boot.imx to the SD card: And then the U-boot from the big slot will boot.
dd if=u-boot.imx of=/dev/xxx bs=512 seek=2 Note: If the "bmode" command is not available from your pre-installed U-boot,
these instruction will produce the same effect:
Note: Replace xxx with the device representing the SD card in your system. => mw.l 0x20d8040 0x3850
=> mw.l 0x020d8044 0x10000000
=> reset
This diff is collapsed.
/*
* Copyright (C) 2011 Freescale Semiconductor, Inc.
* Jason Liu <r64343@freescale.com>
*
* SPDX-License-Identifier: GPL-2.0+
*
* Refer doc/README.imximage for more details about how-to configure
* and create imximage boot image
*
* The syntax is taken as close as possible with the kwbimage
*/
/* image version */
IMAGE_VERSION 2
/*
* Boot Device : one of
* spi, sd (the board has no nand neither onenand)
*/
BOOT_FROM sd
/*
* Device Configuration Data (DCD)
*
* Each entry must have the format:
* Addr-type Address Value
*
* where:
* Addr-type register length (1,2 or 4 bytes)
* Address absolute address of the register
* value value to be stored in the register
*/
DATA 4 0x020e0798 0x000C0000
DATA 4 0x020e0758 0x00000000
DATA 4 0x020e0588 0x00000030
DATA 4 0x020e0594 0x00000030
DATA 4 0x020e056c 0x00000030
DATA 4 0x020e0578 0x00000030
DATA 4 0x020e074c 0x00000030
DATA 4 0x020e057c 0x000c0030
DATA 4 0x020e058c 0x00000000
DATA 4 0x020e059c 0x00003030
DATA 4 0x020e05a0 0x00003030
DATA 4 0x020e078c 0x00000030
DATA 4 0x020e0750 0x00020000
DATA 4 0x020e05a8 0x00000030
DATA 4 0x020e05b0 0x00000030
DATA 4 0x020e0524 0x00000030
DATA 4 0x020e051c 0x00000030
DATA 4 0x020e0518 0x00000030
DATA 4 0x020e050c 0x00000030
DATA 4 0x020e05b8 0x00000030
DATA 4 0x020e05c0 0x00000030
DATA 4 0x020e0774 0x00020000
DATA 4 0x020e0784 0x00000030
DATA 4 0x020e0788 0x00000030
DATA 4 0x020e0794 0x00000030
DATA 4 0x020e079c 0x00000030
DATA 4 0x020e07a0 0x00000030
DATA 4 0x020e07a4 0x00000030
DATA 4 0x020e07a8 0x00000030
DATA 4 0x020e0748 0x00000030
DATA 4 0x020e05ac 0x00000030
DATA 4 0x020e05b4 0x00000030
DATA 4 0x020e0528 0x00000030
DATA 4 0x020e0520 0x00000030
DATA 4 0x020e0514 0x00000030
DATA 4 0x020e0510 0x00000030
DATA 4 0x020e05bc 0x00000030
DATA 4 0x020e05c4 0x00000030
DATA 4 0x021b0800 0xa1390003
DATA 4 0x021b4800 0xa1390003
DATA 4 0x021b080c 0x00110019
DATA 4 0x021b0810 0x00260019
DATA 4 0x021b480c 0x001A0031
DATA 4 0x021b4810 0x001A0021
DATA 4 0x021b083c 0x43100316
DATA 4 0x021b0840 0x0306027E
DATA 4 0x021b483c 0x43250330
DATA 4 0x021b4840 0x0322027B
DATA 4 0x021b0848 0x47414146
DATA 4 0x021b4848 0x41434048
DATA 4 0x021b0850 0x41444A44
DATA 4 0x021b4850 0x4B444C46
DATA 4 0x021b081c 0x33333333
DATA 4 0x021b0820 0x33333333
DATA 4 0x021b0824 0x33333333
DATA 4 0x021b0828 0x33333333
DATA 4 0x021b481c 0x33333333
DATA 4 0x021b4820 0x33333333
DATA 4 0x021b4824 0x33333333
DATA 4 0x021b4828 0x33333333
DATA 4 0x021b08b8 0x00000800
DATA 4 0x021b48b8 0x00000800
DATA 4 0x021b0004 0x00020036
DATA 4 0x021b0008 0x09444040
DATA 4 0x021b000c 0x555A79A4
DATA 4 0x021b0010 0xDB538F64
DATA 4 0x021b0014 0x01FF00DB
DATA 4 0x021b0018 0x00081740
DATA 4 0x021b001c 0x00008000
DATA 4 0x021b002c 0x000026d2
DATA 4 0x021b0030 0x005A0E21
DATA 4 0x021b0040 0x00000027
DATA 4 0x021b0000 0x831A0000
DATA 4 0x021b001c 0x04888032
DATA 4 0x021b001c 0x00008033
DATA 4 0x021b001c 0x00428031
DATA 4 0x021b001c 0x09308030
DATA 4 0x021b001c 0x04008040
DATA 4 0x021b001c 0x04008048
DATA 4 0x021b0020 0x00005800
DATA 4 0x021b0818 0x00011117
DATA 4 0x021b4818 0x00011117
DATA 4 0x021b0004 0x00025576
DATA 4 0x021b0404 0x00011006
DATA 4 0x021b001c 0x00000000
/* set the default clock gate to save power */
DATA 4 0x020c4068 0x00C03F3F
DATA 4 0x020c406c 0x0030FC03
DATA 4 0x020c4070 0x0FFFC000
DATA 4 0x020c4074 0x3FF00000
DATA 4 0x020c4078 0x00FFF300
DATA 4 0x020c407c 0x0F0000C3
DATA 4 0x020c4080 0x000003FF
/* enable AXI cache for VDOA/VPU/IPU */
DATA 4 0x020e0010 0xF00000CF
/* set IPU AXI-id0 Qos=0xf(bypass) AXI-id1 Qos=0x7 */
DATA 4 0x020e0018 0x007F007F
DATA 4 0x020e001c 0x007F007F
/*
* Setup CCM_CCOSR register as follows:
*
* cko1_en = 1 --> CKO1 enabled
* cko1_div = 111 --> divide by 8
* cko1_sel = 1011 --> ahb_clk_root
*
* This sets CKO1 at ahb_clk_root/8 = 132/8 = 16.5 MHz
*/
DATA 4 0x020c4060 0x000000fb
CONFIG_ARM=y
CONFIG_ARCH_MX6=y
CONFIG_TARGET_CGTQMX6EVAL=y
CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/congatec/cgtqmx6eval/imximage.cfg,MX6Q"
CONFIG_SYS_PROMPT="CGT-QMX6-Quad U-Boot > "
# CONFIG_CMD_IMLS is not set
# CONFIG_CMD_FLASH is not set
CONFIG_CMD_GPIO=y
# CONFIG_CMD_SETEXPR is not set
CONFIG_DM=y
CONFIG_DM_THERMAL=y
...@@ -17,10 +17,21 @@ ...@@ -17,10 +17,21 @@
#define CONFIG_MACH_TYPE 4122 #define CONFIG_MACH_TYPE 4122
#ifdef CONFIG_SPL
#define CONFIG_SPL_LIBCOMMON_SUPPORT
#define CONFIG_SPL_MMC_SUPPORT
#define CONFIG_SPL_SPI_SUPPORT
#define CONFIG_SPL_SPI_FLASH_SUPPORT
#define CONFIG_SYS_SPI_U_BOOT_OFFS (64 * 1024)
#define CONFIG_SPL_SPI_LOAD
#include "imx6_spl.h"
#endif
/* Size of malloc() pool */ /* Size of malloc() pool */
#define CONFIG_SYS_MALLOC_LEN (10 * 1024 * 1024) #define CONFIG_SYS_MALLOC_LEN (10 * 1024 * 1024)
#define CONFIG_BOARD_EARLY_INIT_F #define CONFIG_BOARD_EARLY_INIT_F
#define CONFIG_BOARD_LATE_INIT
#define CONFIG_MISC_INIT_R #define CONFIG_MISC_INIT_R
#define CONFIG_MXC_UART #define CONFIG_MXC_UART
...@@ -144,10 +155,11 @@ ...@@ -144,10 +155,11 @@
#define CONFIG_MMCROOT "/dev/mmcblk0p2" #define CONFIG_MMCROOT "/dev/mmcblk0p2"
#define CONFIG_SYS_MMC_ENV_DEV 0 #define CONFIG_SYS_MMC_ENV_DEV 0
#define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
#define CONFIG_EXTRA_ENV_SETTINGS \ #define CONFIG_EXTRA_ENV_SETTINGS \
"script=boot.scr\0" \ "script=boot.scr\0" \
"image=zImage\0" \ "image=zImage\0" \
"fdtfile=imx6q-qmx6.dtb\0" \ "fdtfile=undefined\0" \
"fdt_addr_r=0x18000000\0" \ "fdt_addr_r=0x18000000\0" \
"boot_fdt=try\0" \ "boot_fdt=try\0" \
"ip_dyn=yes\0" \ "ip_dyn=yes\0" \
...@@ -192,6 +204,13 @@ ...@@ -192,6 +204,13 @@
"else " \ "else " \
"bootz; " \ "bootz; " \
"fi;\0" \ "fi;\0" \
"findfdt="\
"if test $board_rev = MX6Q ; then " \
"setenv fdtfile imx6q-qmx6.dtb; fi; " \
"if test $board_rev = MX6DL ; then " \
"setenv fdtfile imx6dl-qmx6.dtb; fi; " \
"if test $fdtfile = undefined; then " \
"echo WARNING: Could not determine dtb to use; fi; \0" \
"netargs=setenv bootargs console=${console},${baudrate} " \ "netargs=setenv bootargs console=${console},${baudrate} " \
"root=/dev/nfs " \ "root=/dev/nfs " \
"ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \ "ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
...@@ -220,6 +239,7 @@ ...@@ -220,6 +239,7 @@
#define CONFIG_BOOTCOMMAND \ #define CONFIG_BOOTCOMMAND \
"run spilock;" \ "run spilock;" \
"run findfdt; " \
"mmc dev ${mmcdev};" \ "mmc dev ${mmcdev};" \
"if mmc rescan; then " \ "if mmc rescan; then " \
"if run loadbootscript; then " \ "if run loadbootscript; then " \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment