Skip to content

Commit

Permalink
Add i.MX6ULL u-boot and u-boot-reloc scripts
Browse files Browse the repository at this point in the history
Designed for TEKVOX, Inc.
https://www.tekvox.com/

Signed-off-by: Giulio Benetti <giulio.benetti@tekvox.com>
  • Loading branch information
giuliobenetti committed Nov 9, 2022
1 parent 2b11842 commit 064e882
Show file tree
Hide file tree
Showing 3 changed files with 253 additions and 0 deletions.
73 changes: 73 additions & 0 deletions imx6ull-evk/imx6ull-evk-uboot-reloc.cmm
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
; --------------------------------------------------------------------------------
; @Title: IMX6ULL-EVK U-Boot debugging NXP i.MX6ULL
; @Description:
; The example is generated for * boards using an ICD.
; It will NOT run on any other board, but may be used as a template
; for others.
; @Keywords: uboot, Nxp, imx6ull*, IMX6ULL*
; @Author: Giulio Benetti <giulio.benetti@benettiengineering.com>
; @Board: IMX6ULL-EVK*
; @Chip: IMX6ULL*
; @Copyright: (C) 1981-2022 Benetti Engineering sas, licensed for use with TRACE32(R) only
; --------------------------------------------------------------------------------

LOCAL &uboot_path
LOCAL &ka_path
LOCAL &awareness

&uboot_path="/home/giuliobenetti/git/tekvox/output-tekvox/build/uboot-2022.10"

; Debugger Reset
WinPAGE.RESet
AREA.RESet
WinPOS 0. 25. 75. 9. 0. 0. W000
AREA.view

PRINT "resetting..."

RESet
SYStem.RESet
SYStem.CPU IMX6ULL

SYStem.Option DACR ON ; give Debugger global write permissions
TrOnchip.Set DABORT OFF ; used by Linux for page miss!
TrOnchip.Set PABORT OFF ; used by Linux for page miss!
TrOnchip.Set UNDEF OFF ; my be used by Linux for FPU detection
SYStem.Option MMUSPACES OFF ; enable space ids to virtual addresses
SYStem.Option ResBreak OFF

SETUP.IMASKASM ON ; lock interrupts while single stepping
SETUP.IMASKHLL ON ; lock interrupts while single stepping in HLL

IF VERSION.BUILD()<92177.
(
; adjust WaitReset time if a different bootmode is used
SYStem.Option WaitReset 10ms
)
ELSE
(
; poll till BootROM enables JTAG Pins
SYStem.Option WaitIDCODE 1.5s
)
SYStem.JtagClock CTCK 20MHz
SYStem.Up

DO ~~/demo/arm/hardware/imx6ultralite/scripts/dcd_interpreter "imximage.cfg"

; Load u-boot in ddr
Data.LOAD.Binary &uboot_path/u-boot.bin 0x87800000 /NoClear
data.load.auto &uboot_path/u-boot /NoCODE
Register.Init
r.s pc 0x87800000

Go.direct relocate_done
WAIT !run()

; Load symbols to relocate memory pointed by R4 register
data.load.auto &uboot_path/u-boot Register(R4) /NoCODE
step

Mode.Hll
List

enddo
66 changes: 66 additions & 0 deletions imx6ull-evk/imx6ull-evk-uboot.cmm
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
; --------------------------------------------------------------------------------
; @Title: IMX6ULL-EVK U-Boot debugging NXP i.MX6ULL
; @Description:
; The example is generated for * boards using an ICD.
; It will NOT run on any other board, but may be used as a template
; for others.
; @Keywords: uboot, Nxp, imx6ull*, IMX6ULL*
; @Author: Giulio Benetti <giulio.benetti@benettiengineering.com>
; @Board: IMX6ULL-EVK*
; @Chip: IMX6ULL*
; @Copyright: (C) 1981-2022 Benetti Engineering sas, licensed for use with TRACE32(R) only
; --------------------------------------------------------------------------------

LOCAL &uboot_path
LOCAL &ka_path
LOCAL &awareness

&uboot_path="/home/giuliobenetti/git/tekvox/output-tekvox/build/uboot-2022.10"

; Debugger Reset
WinPAGE.RESet
AREA.RESet
WinPOS 0. 25. 75. 9. 0. 0. W000
AREA.view

PRINT "resetting..."

RESet
SYStem.RESet
SYStem.CPU IMX6ULL

SYStem.Option DACR ON ; give Debugger global write permissions
TrOnchip.Set DABORT OFF ; used by Linux for page miss!
TrOnchip.Set PABORT OFF ; used by Linux for page miss!
TrOnchip.Set UNDEF OFF ; my be used by Linux for FPU detection
SYStem.Option MMUSPACES OFF ; enable space ids to virtual addresses
SYStem.Option ResBreak OFF

SETUP.IMASKASM ON ; lock interrupts while single stepping
SETUP.IMASKHLL ON ; lock interrupts while single stepping in HLL

IF VERSION.BUILD()<92177.
(
; adjust WaitReset time if a different bootmode is used
SYStem.Option WaitReset 10ms
)
ELSE
(
; poll till BootROM enables JTAG Pins
SYStem.Option WaitIDCODE 1.5s
)
SYStem.JtagClock CTCK 20MHz
SYStem.Up

DO ~~/demo/arm/hardware/imx6ultralite/scripts/dcd_interpreter "imximage.cfg"

; Load u-boot in ddr
Data.LOAD.Binary &uboot_path/u-boot.bin 0x87800000 /NoClear
data.load.auto &uboot_path/u-boot /NoCODE
Register.Init
r.s pc 0x87800000

Mode.Hll
List

enddo
114 changes: 114 additions & 0 deletions imx6ull-evk/imximage.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
/* SPDX-License-Identifier: GPL-2.0+ */
/*
* Copyright (C) 2016 Freescale Semiconductor, Inc.
*
* Refer doc/imx/mkimage/imximage.txt for more details about how-to configure
* and create imximage boot image
*
* The syntax is taken as close as possible with the kwbimage
*/

#include <config.h>

/* image version */

IMAGE_VERSION 2

/*
* Boot Device : one of
* spi/sd/nand/onenand, qspi/nor
*/

#ifdef CONFIG_QSPI_BOOT
BOOT_FROM qspi
#elif defined(CONFIG_NOR_BOOT)
BOOT_FROM nor
#else
BOOT_FROM sd
#endif

#ifdef CONFIG_USE_IMXIMG_PLUGIN
/*PLUGIN plugin-binary-file IRAM_FREE_START_ADDR*/
PLUGIN board/freescale/mx6ullevk/plugin.bin 0x00907000
#else

#ifdef CONFIG_IMX_HAB
CSF CONFIG_CSF_SIZE
#endif

/*
* 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
*/

/* Enable all clocks */
DATA 4 0x020c4068 0xffffffff
DATA 4 0x020c406c 0xffffffff
DATA 4 0x020c4070 0xffffffff
DATA 4 0x020c4074 0xffffffff
DATA 4 0x020c4078 0xffffffff
DATA 4 0x020c407c 0xffffffff
DATA 4 0x020c4080 0xffffffff

DATA 4 0x020E04B4 0x000C0000
DATA 4 0x020E04AC 0x00000000
DATA 4 0x020E027C 0x00000030
DATA 4 0x020E0250 0x00000030
DATA 4 0x020E024C 0x00000030
DATA 4 0x020E0490 0x00000030
DATA 4 0x020E0288 0x000C0030
DATA 4 0x020E0270 0x00000000
DATA 4 0x020E0260 0x00000030
DATA 4 0x020E0264 0x00000030
DATA 4 0x020E04A0 0x00000030
DATA 4 0x020E0494 0x00020000
DATA 4 0x020E0280 0x00000030
DATA 4 0x020E0284 0x00000030
DATA 4 0x020E04B0 0x00020000
DATA 4 0x020E0498 0x00000030
DATA 4 0x020E04A4 0x00000030
DATA 4 0x020E0244 0x00000030
DATA 4 0x020E0248 0x00000030
DATA 4 0x021B001C 0x00008000
DATA 4 0x021B0800 0xA1390003
DATA 4 0x021B080C 0x00000004
DATA 4 0x021B083C 0x41640158
DATA 4 0x021B0848 0x40403237
DATA 4 0x021B0850 0x40403C33
DATA 4 0x021B081C 0x33333333
DATA 4 0x021B0820 0x33333333
DATA 4 0x021B082C 0xf3333333
DATA 4 0x021B0830 0xf3333333
DATA 4 0x021B08C0 0x00944009
DATA 4 0x021B08b8 0x00000800
DATA 4 0x021B0004 0x0002002D
DATA 4 0x021B0008 0x1B333030
DATA 4 0x021B000C 0x676B52F3
DATA 4 0x021B0010 0xB66D0B63
DATA 4 0x021B0014 0x01FF00DB
DATA 4 0x021B0018 0x00201740
DATA 4 0x021B001C 0x00008000
DATA 4 0x021B002C 0x000026D2
DATA 4 0x021B0030 0x006B1023
DATA 4 0x021B0040 0x0000004F
DATA 4 0x021B0000 0x84180000
DATA 4 0x021B0890 0x00400000
DATA 4 0x021B001C 0x02008032
DATA 4 0x021B001C 0x00008033
DATA 4 0x021B001C 0x00048031
DATA 4 0x021B001C 0x15208030
DATA 4 0x021B001C 0x04008040
DATA 4 0x021B0020 0x00000800
DATA 4 0x021B0818 0x00000227
DATA 4 0x021B0004 0x0002552D
DATA 4 0x021B0404 0x00011006
DATA 4 0x021B001C 0x00000000

#endif

0 comments on commit 064e882

Please sign in to comment.