Merge git://git.denx.de/u-boot-imx
- changes in pico-* boards - fix imx6ull pinmux
This commit is contained in:
@@ -52,7 +52,7 @@ fi;"
|
||||
#
|
||||
# Provide 'boot_tftp_kernel' command
|
||||
#------------------------------------------------------------
|
||||
setenv download_kernel "tftpboot ${loadaddr} ${kernel_file}"
|
||||
setenv download_kernel "dhcp ${loadaddr} ${kernel_file}"
|
||||
|
||||
setenv boot_tftp_kernel "
|
||||
if run download_kernel; then
|
||||
@@ -65,18 +65,14 @@ fi"
|
||||
#
|
||||
# Provide 'boot_nfs' command
|
||||
#------------------------------------------------------------
|
||||
setenv rootpath "/srv/tftp/KP/rootfs"
|
||||
setenv nfsargs "setenv bootargs root=/dev/nfs rw \
|
||||
nfsroot=${serverip}:${rootpath},nolock,nfsvers=3"
|
||||
setenv addip "setenv bootargs ${bootargs} \
|
||||
ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:\
|
||||
${hostname}:eth0:on"
|
||||
setenv nfsargs "setenv bootargs root=/dev/nfs rw nfsroot='${rootpath}',nolock,nfsvers=3"
|
||||
setenv addip "setenv bootargs '${bootargs}' ip='${ipaddr}':'${serverip}':'${gatewayip}':'${netmask}':'${hostname}':eth0:on"
|
||||
|
||||
setenv boot_nfs "
|
||||
if run download_kernel; then
|
||||
run nfsargs;
|
||||
run addip;
|
||||
setenv bootargs ${bootargs} console=${console};
|
||||
setenv bootargs '${bootargs}' console=${console};
|
||||
|
||||
run boot_fitImage;
|
||||
fi"
|
||||
|
||||
@@ -1,7 +1,17 @@
|
||||
Technexion PICO-IMX6UL board
|
||||
TechNexion PICO-IMX6UL board
|
||||
M: Richard Hu <richard.hu@technexion.com>
|
||||
M: Fabio Estevam <fabio.estevam@nxp.com>
|
||||
S: Maintained
|
||||
F: board/technexion/pico-imx6ul/
|
||||
F: include/configs/pico-imx6ul.h
|
||||
F: configs/pico-imx6ul_defconfig
|
||||
|
||||
TechNexion PICO-HOBBIT-IMX6UL
|
||||
M: Otavio Salvador <otavio@ossystems.com.br>
|
||||
S: Maintained
|
||||
F: configs/pico-hobbit-imx6ul_defconfig
|
||||
|
||||
TechNexion PICO-PI-IMX6UL
|
||||
M: Otavio Salvador <otavio@ossystems.com.br>
|
||||
S: Maintained
|
||||
F: configs/pico-pi-imx6ul_defconfig
|
||||
|
||||
@@ -2,4 +2,4 @@
|
||||
# (C) Copyright 2015 Technexion Ltd.
|
||||
# (C) Copyright 2015 Freescale Semiconductor, Inc.
|
||||
|
||||
obj-y := pico-imx6ul.o
|
||||
obj-y := pico-imx6ul.o spl.o
|
||||
|
||||
@@ -13,45 +13,147 @@ $ make mrproper
|
||||
$ make pico-imx6ul_defconfig
|
||||
$ make
|
||||
|
||||
This will generate the U-Boot binary called u-boot.imx.
|
||||
This generates the SPL and u-boot.img binaries.
|
||||
|
||||
1. Loading U-Boot via USB Serial Download Protocol
|
||||
|
||||
Note: This method is convenient for development purposes.
|
||||
If the eMMC has already a U-Boot flashed with DFU support then
|
||||
the user can go to step 2 below in order to update U-Boot.
|
||||
|
||||
Put pico board in USB download mode (refer to the document
|
||||
http://www.wandboard.org/images/hobbit/hobbitboard-imx6ul-reva1.pdf page 15)
|
||||
http://www.wandboard.org/images/hobbit/hobbitboard-imx6ul-reva1.pdf
|
||||
page 15).
|
||||
|
||||
Connect a USB to serial adapter between the host PC and pico
|
||||
Connect a USB to serial adapter between the host PC and pico.
|
||||
|
||||
Connect a USB cable between the OTG pico port and the host PC
|
||||
Connect a USB cable between the OTG pico port and the host PC.
|
||||
|
||||
Open a terminal program such as minicom
|
||||
Open a terminal program such as minicom.
|
||||
|
||||
Copy u-boot.imx to the imx_usb_loader folder.
|
||||
Copy SPL and u-boot.img to the imx_usb_loader folder.
|
||||
|
||||
Load u-boot.imx via USB:
|
||||
Load the SPL binary via USB:
|
||||
|
||||
$ sudo ./imx_usb u-boot.imx
|
||||
$ sudo ./imx_usb SPL
|
||||
|
||||
Then U-Boot should start and its messages will appear in the console program.
|
||||
Load the u-boot.img binary via USB:
|
||||
|
||||
$ sudo ./imx_usb u-boot.img
|
||||
|
||||
Then U-Boot starts and its messages appear in the console program.
|
||||
|
||||
Use the default environment variables:
|
||||
|
||||
=> env default -f -a
|
||||
=> saveenv
|
||||
|
||||
Run the DFU command:
|
||||
2. Flashing U-Boot into the eMMC
|
||||
|
||||
Run the DFU agent so we can flash the new images using dfu-util tool:
|
||||
|
||||
=> dfu 0 mmc 0
|
||||
|
||||
Transfer u-boot.imx that will be flashed into the eMMC:
|
||||
Flash SPL and u-boot.img into the eMMC running the following commands on a PC:
|
||||
|
||||
$ sudo dfu-util -D u-boot.imx -a boot
|
||||
$ sudo dfu-util -D SPL -a spl
|
||||
|
||||
Then on the U-Boot prompt the following message should be seen after a
|
||||
successful upgrade:
|
||||
|
||||
#DOWNLOAD ... OK
|
||||
Ctrl+C to exit ...
|
||||
$ sudo dfu-util -D u-boot.img -a u-boot
|
||||
|
||||
Remove power from the pico board.
|
||||
|
||||
Put pico board into normal boot mode
|
||||
Put pico board into normal boot mode.
|
||||
|
||||
Power up the board and the new updated U-Boot should boot from eMMC.
|
||||
|
||||
Booting in Falcon mode
|
||||
======================
|
||||
|
||||
Generate a uImage kernel:
|
||||
|
||||
$ make imx_v6_v7_defconfig (Using the default imx_v6_v7_defconfig configuration
|
||||
just for an example. In order to boot faster the user should customize the
|
||||
defconfig by only enabling the minimal required drivers).
|
||||
|
||||
$ make -j4 uImage LOADADDR=0x80800000
|
||||
|
||||
$ cp arch/arm/boot/uImage /tftpboot
|
||||
$ cp arch/arm/boot/dts/imx6ul-pico-hobbit.dtb /tftpboot
|
||||
|
||||
In the U-Boot prompt:
|
||||
|
||||
Setup the server and board IP addresses:
|
||||
=> setenv serverip 192.168.0.10
|
||||
=> setenv ipaddr 192.168.0.11
|
||||
|
||||
Get the dtb file:
|
||||
=> tftp ${fdt_addr} imx6ul-pico-hobbit.dtb
|
||||
|
||||
Get the kernel:
|
||||
=> tftp ${loadaddr} uImage
|
||||
|
||||
Write the kernel at 2MB offset:
|
||||
=> mmc write ${loadaddr} 0x1000 0x4000
|
||||
|
||||
Setup the bootargs:
|
||||
=> setenv bootargs 'console=ttymxc5,115200 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait rw'
|
||||
|
||||
Prepare args:
|
||||
=> spl export fdt ${loadaddr} - ${fdt_addr}
|
||||
## Booting kernel from Legacy Image at 82000000 ...
|
||||
Image Name: Linux-4.19.0-rc2-next-20180905-0
|
||||
Image Type: ARM Linux Kernel Image (uncompressed)
|
||||
Data Size: 8365608 Bytes = 8 MiB
|
||||
Load Address: 80800000
|
||||
Entry Point: 80800000
|
||||
Verifying Checksum ... OK
|
||||
## Flattened Device Tree blob at 83000000
|
||||
Booting using the fdt blob at 0x83000000
|
||||
Loading Kernel Image ... OK
|
||||
Using Device Tree in place at 83000000, end 83009c63
|
||||
subcommand not supported
|
||||
subcommand not supported
|
||||
Using Device Tree in place at 83000000, end 8300cc63
|
||||
Argument image is now in RAM: 0x83000000
|
||||
|
||||
Write 1MB of args data (0x800 sectors) to 1MB offset (0x800 sectors):
|
||||
|
||||
=> mmc write ${fdt_addr} 0x800 0x800
|
||||
|
||||
In order to boot with Falcon mode, activate the CONFIG_SPL_OS_BOOT
|
||||
option in the defconfig
|
||||
|
||||
--- a/configs/pico-hobbit-imx6ul_defconfig
|
||||
+++ b/configs/pico-hobbit-imx6ul_defconfig
|
||||
@@ -53,3 +53,4 @@ CONFIG_USB_GADGET_VENDOR_NUM=0x0525
|
||||
CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
|
||||
CONFIG_CI_UDC=y
|
||||
CONFIG_OF_LIBFDT=y
|
||||
+CONFIG_SPL_OS_BOOT=y
|
||||
|
||||
Then rebuild U-Boot:
|
||||
|
||||
$ make pico-hobbit-imx6ul_defconfig
|
||||
$ make -j4
|
||||
|
||||
Launch UMS:
|
||||
=> ums 0 mmc 0
|
||||
|
||||
Flash the new binaries:
|
||||
|
||||
$ sudo dd if=SPL of=/dev/sdX bs=1k seek=1; sync
|
||||
$ sudo dd if=u-boot.img of=/dev/sdX bs=1k seek=69; sync
|
||||
|
||||
And then SPL binary will load and jump directly to the kernel:
|
||||
|
||||
U-Boot SPL 2018.09-rc2-00156-g8c46f15-dirty (Sep 05 2018 - 16:24:05 -0300)
|
||||
Trying to boot from MMC1
|
||||
[ 0.000000] Booting Linux on physical CPU 0x0
|
||||
[ 0.000000] Linux version 4.19.0-rc2-next-20180905-00001-gb805e2d (fabio@fabio-Latitude-E5450) (gcc version 5.4.0 20160609 (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.9)) #533 SMP Wed Sep 5 16:21:03 -03 2018
|
||||
[ 0.000000] CPU: ARMv7 Processor [410fc075] revision 5 (ARMv7), cr=10c5387d
|
||||
[ 0.000000] CPU: div instructions available: patching division code
|
||||
[ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
|
||||
[ 0.000000] OF: fdt: Machine model: Technexion Pico i.MX6UL Board
|
||||
[ 0.000000] Memory policy: Data cache writealloc
|
||||
[ 0.000000] cma: Reserved 64 MiB at 0x8c000000
|
||||
...
|
||||
|
||||
144
board/technexion/pico-imx6ul/spl.c
Normal file
144
board/technexion/pico-imx6ul/spl.c
Normal file
@@ -0,0 +1,144 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
|
||||
#include <asm/arch/clock.h>
|
||||
#include <asm/arch/iomux.h>
|
||||
#include <asm/arch/imx-regs.h>
|
||||
#include <asm/arch/crm_regs.h>
|
||||
#include <asm/arch/mx6ul_pins.h>
|
||||
#include <asm/arch/mx6-pins.h>
|
||||
#include <asm/arch/sys_proto.h>
|
||||
#include <asm/gpio.h>
|
||||
#include <asm/mach-imx/iomux-v3.h>
|
||||
#include <asm/mach-imx/boot_mode.h>
|
||||
#include <linux/libfdt.h>
|
||||
#include <spl.h>
|
||||
|
||||
#if defined(CONFIG_SPL_BUILD)
|
||||
|
||||
#ifdef CONFIG_SPL_OS_BOOT
|
||||
int spl_start_uboot(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
#include <asm/arch/mx6-ddr.h>
|
||||
|
||||
static struct mx6ul_iomux_grp_regs mx6_grp_ioregs = {
|
||||
.grp_addds = 0x00000030,
|
||||
.grp_ddrmode_ctl = 0x00020000,
|
||||
.grp_b0ds = 0x00000030,
|
||||
.grp_ctlds = 0x00000030,
|
||||
.grp_b1ds = 0x00000030,
|
||||
.grp_ddrpke = 0x00000000,
|
||||
.grp_ddrmode = 0x00020000,
|
||||
.grp_ddr_type = 0x00080000,
|
||||
};
|
||||
|
||||
static struct mx6ul_iomux_ddr_regs mx6_ddr_ioregs = {
|
||||
.dram_dqm0 = 0x00000030,
|
||||
.dram_dqm1 = 0x00000030,
|
||||
.dram_ras = 0x00000030,
|
||||
.dram_cas = 0x00000030,
|
||||
.dram_odt0 = 0x00000030,
|
||||
.dram_odt1 = 0x00000030,
|
||||
.dram_sdba2 = 0x00000000,
|
||||
.dram_sdclk_0 = 0x00000030,
|
||||
.dram_sdqs0 = 0x00000030,
|
||||
.dram_sdqs1 = 0x00000030,
|
||||
.dram_reset = 0x00000030,
|
||||
};
|
||||
|
||||
static struct mx6_mmdc_calibration mx6_mmcd_calib = {
|
||||
.p0_mpwldectrl0 = 0x00000000,
|
||||
.p0_mpdgctrl0 = 0x01380134,
|
||||
.p0_mprddlctl = 0x40404244,
|
||||
.p0_mpwrdlctl = 0x40405050,
|
||||
};
|
||||
|
||||
static struct mx6_ddr_sysinfo ddr_sysinfo = {
|
||||
.dsize = 0,
|
||||
.cs1_mirror = 0,
|
||||
.cs_density = 32,
|
||||
.ncs = 1,
|
||||
.bi_on = 1,
|
||||
.rtt_nom = 1,
|
||||
.rtt_wr = 0,
|
||||
.ralat = 5,
|
||||
.walat = 0,
|
||||
.mif3_mode = 3,
|
||||
.rst_to_cke = 0x23,
|
||||
.sde_to_rst = 0x10,
|
||||
.refsel = 1,
|
||||
.refr = 3,
|
||||
};
|
||||
|
||||
static struct mx6_ddr3_cfg mem_ddr = {
|
||||
.mem_speed = 1333,
|
||||
.density = 2,
|
||||
.width = 16,
|
||||
.banks = 8,
|
||||
.coladdr = 10,
|
||||
.pagesz = 2,
|
||||
.trcd = 1350,
|
||||
.trcmin = 4950,
|
||||
.trasmin = 3600,
|
||||
};
|
||||
|
||||
static void ccgr_init(void)
|
||||
{
|
||||
struct mxc_ccm_reg *ccm = (struct mxc_ccm_reg *)CCM_BASE_ADDR;
|
||||
|
||||
writel(0xFFFFFFFF, &ccm->CCGR0);
|
||||
writel(0xFFFFFFFF, &ccm->CCGR1);
|
||||
writel(0xFFFFFFFF, &ccm->CCGR2);
|
||||
writel(0xFFFFFFFF, &ccm->CCGR3);
|
||||
writel(0xFFFFFFFF, &ccm->CCGR4);
|
||||
writel(0xFFFFFFFF, &ccm->CCGR5);
|
||||
writel(0xFFFFFFFF, &ccm->CCGR6);
|
||||
}
|
||||
|
||||
static void imx6ul_spl_dram_cfg_size(u32 ram_size)
|
||||
{
|
||||
if (ram_size == SZ_256M)
|
||||
mem_ddr.rowaddr = 14;
|
||||
else
|
||||
mem_ddr.rowaddr = 15;
|
||||
|
||||
mx6ul_dram_iocfg(mem_ddr.width, &mx6_ddr_ioregs, &mx6_grp_ioregs);
|
||||
mx6_dram_cfg(&ddr_sysinfo, &mx6_mmcd_calib, &mem_ddr);
|
||||
}
|
||||
|
||||
static void imx6ul_spl_dram_cfg(void)
|
||||
{
|
||||
ulong ram_size_test, ram_size = 0;
|
||||
|
||||
for (ram_size = SZ_512M; ram_size >= SZ_256M; ram_size >>= 1) {
|
||||
imx6ul_spl_dram_cfg_size(ram_size);
|
||||
ram_size_test = get_ram_size((long int *)PHYS_SDRAM, ram_size);
|
||||
if (ram_size_test == ram_size)
|
||||
break;
|
||||
}
|
||||
|
||||
if (ram_size < SZ_256M) {
|
||||
puts("ERROR: DRAM size detection failed\n");
|
||||
hang();
|
||||
}
|
||||
}
|
||||
|
||||
void board_init_f(ulong dummy)
|
||||
{
|
||||
ccgr_init();
|
||||
arch_cpu_init();
|
||||
board_early_init_f();
|
||||
timer_init();
|
||||
preloader_console_init();
|
||||
imx6ul_spl_dram_cfg();
|
||||
memset(__bss_start, 0, __bss_end - __bss_start);
|
||||
board_init_r(NULL, 0);
|
||||
}
|
||||
|
||||
void reset_cpu(ulong addr)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
@@ -1,11 +1,16 @@
|
||||
Technexion PICO-IMX7D board
|
||||
TechNexion PICO-IMX7D board
|
||||
M: Vanessa Maegima <vanessa.maegima@nxp.com>
|
||||
S: Maintained
|
||||
F: board/technexion/pico-imx7d/
|
||||
F: include/configs/pico-imx7d.h
|
||||
F: configs/pico-imx7d_defconfig
|
||||
|
||||
Technexion PICO-PI-IMX7
|
||||
TechNexion PICO-HOBBIT-IMX7
|
||||
M: Otavio Salvador <otavio@ossystems.com.br>
|
||||
S: Maintained
|
||||
F: configs/pico-hobbit-imx7d_defconfig
|
||||
|
||||
TechNexion PICO-PI-IMX7
|
||||
M: Otavio Salvador <otavio@ossystems.com.br>
|
||||
S: Maintained
|
||||
F: configs/pico-pi-imx7d_defconfig
|
||||
|
||||
@@ -4,7 +4,7 @@ U-Boot for Wandboard
|
||||
This file contains information for the port of U-Boot to the Wandboard.
|
||||
|
||||
Wandboard is a development board that has three variants based on the following
|
||||
SoCs: mx6 quad, mx6 dual lite and mx6 solo.
|
||||
SoCs: mx6 quad, mx6 quad plus, mx6 dual lite and mx6 solo.
|
||||
|
||||
For more details about Wandboard, please refer to:
|
||||
http://www.wandboard.org/
|
||||
|
||||
Reference in New Issue
Block a user