mx6ullevk

package
v0.0.0-...-d73fcdd Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 7, 2022 License: BSD-3-Clause Imports: 6 Imported by: 0

README

TamaGo - bare metal Go for ARM SoCs - MCIMX6ULL-EVK support

tamago | https://github.com/f-secure-foundry/tamago

Copyright (c) F-Secure Corporation
https://foundry.f-secure.com

TamaGo gopher

Authors

Andrea Barisani
andrea.barisani@f-secure.com | andrea@inversepath.com

Andrej Rosano
andrej.rosano@f-secure.com | andrej@inversepath.com

Introduction

TamaGo is a framework that enables compilation and execution of unencumbered Go applications on bare metal ARM System-on-Chip (SoC) components.

The mx6ullevk package provides support for the MCIMX6ULL-EVK development board.

Documentation

For more information about TamaGo see its repository and project wiki.

For the underlying driver support for this board see package imx6.

The package API documentation can be found on pkg.go.dev.

Supported hardware

SoC Board SoC package Board package
NXP i.MX6ULL MCIMX6ULL-EVK imx6 mx6ullevk

Compiling

Go applications are simply required to import, the relevant board package to ensure that hardware initialization and runtime support takes place:

import (
	_ "github.com/f-secure-foundry/tamago/board/nxp/mx6ullevk"
)

Build the TamaGo compiler (or use the latest binary release):

wget https://github.com/f-secure-foundry/tamago-go/archive/refs/tags/latest.zip
unzip latest.zip
cd tamago-go-latest/src && ./all.bash
cd ../bin && export TAMAGO=`pwd`/go

Go applications can be compiled as usual, using the compiler built in the previous step, but with the addition of the following flags/variables and ensuring that the required SoC and board packages are available in GOPATH:

GO_EXTLINK_ENABLED=0 CGO_ENABLED=0 GOOS=tamago GOARM=7 GOARCH=arm \
  ${TAMAGO} build -ldflags "-T 0x80010000  -E _rt0_arm_tamago -R 0x1000"

An example application, targeting the MCIMX6ULL-EVK platform, is available.

Executing and debugging

The example application provides reference usage and a Makefile target for automatic creation of an ELF as well as imx image for flashing.

Native hardware: imx image on microSD

Copy the built imx image to a microSD as follows:

sudo dd if=<path to imx file> of=/dev/sdX bs=1M conv=fsync

IMPORTANT: /dev/sdX must be replaced with your microSD device (not eventual microSD partitions), ensure that you are specifying the correct one. Errors in target specification will result in disk corruption.

Ensure the SW601 boot switches on the processor board are set to microSD boot mode:

switch position
1 OFF
2 OFF
3 ON
4 OFF

Native hardware: existing bootloader

Copy the built ELF binary on an external microSD card then launch it from the U-Boot console as follows:

ext2load mmc 1:1 0x90000000 example
bootelf -p 0x90000000

For non-interactive execution modify the U-Boot configuration accordingly.

Standard output

The standard output can be accessed through the debug console found on micro USB connector J1901 and the following picocom configuration:

picocom -b 115200 -eb /dev/ttyUSB0 --imap lfcrlf

Debugging

The application can be debugged with GDB over JTAG using openocd (version > 0.11.0) and the gdbinit debugging helper published here.

# start openocd daemon
openocd -f interface/ftdi/jtagkey.cfg -f target/imx6ul.cfg -c "adapter speed 1000"

# connect to the OpenOCD command line
telnet localhost 4444

# debug with GDB
arm-none-eabi-gdb -x gdbinit example

Hardware breakpoints can be set in the usual way:

hb ecdsa.Verify
continue

QEMU

The target can be executed under emulation as follows:

qemu-system-arm \
	-machine mcimx6ul-evk -cpu cortex-a7 -m 512M \
	  -nographic -monitor none -serial null -serial stdio -net none \
	  -kernel example -semihosting -d unimp

The emulated target can be debugged with GDB by adding the -S -s flags to the previous execution command, this will make qemu waiting for a GDB connection that can be launched as follows:

arm-none-eabi-gdb -ex "target remote 127.0.0.1:1234" example

Breakpoints can be set in the usual way:

b ecdsa.Verify
continue

License

tamago | https://github.com/f-secure-foundry/tamago
Copyright (c) F-Secure Corporation

These source files are distributed under the BSD-style license found in the LICENSE file.

The TamaGo logo is adapted from the Go gopher designed by Renee French and licensed under the Creative Commons 3.0 Attributions license. Go Gopher vector illustration by Hugo Arganda.

Documentation

Overview

Package mx6ullevk provides hardware initialization, automatically on import, for the NXP MCIMX6ULL-EVK evaluation board.

This package is only meant to be used with `GOOS=tamago GOARCH=arm` as supported by the TamaGo framework for bare metal Go on ARM SoCs, see https://github.com/f-secure-foundry/tamago.

Index

Constants

View Source
const (
	IOMUXC_SW_MUX_CTL_PAD_LCD_RESET = 0x020e0114
	IOMUXC_SW_PAD_CTL_PAD_LCD_RESET = 0x020e03a0

	WDOG1_WDOG_ANY_MODE = 4
)

On the MCIMX6ULL-EVK the SoC LCD_RESET output signal, which is tied to the global watchdog, is connected to power reset logic (p4081, Table 59-1. WDOG External Signals, IMX6ULLRM).

View Source
const (
	IOMUXC_SW_MUX_CTL_PAD_CSI_DATA04 = 0x020e01f4
	IOMUXC_SW_PAD_CTL_PAD_CSI_DATA04 = 0x020e0480
	IOMUXC_USDHC1_WP_SELECT_INPUT    = 0x020e066c

	USDHC1_WP_MODE   = 8
	DAISY_CSI_DATA04 = 0b10

	IOMUXC_SW_MUX_CTL_PAD_CSI_PIXCLK = 0x020e01d8
	IOMUXC_SW_PAD_CTL_PAD_CSI_PIXCLK = 0x020e0464
	IOMUXC_USDHC2_WP_SELECT_INPUT    = 0x020e069c

	USDHC2_WP_MODE   = 1
	DAISY_CSI_PIXCLK = 0b10

	SD1_BUS_WIDTH = 4
	SD2_BUS_WIDTH = 4
)

SD1/SD2 configuration constants.

On the MCIMX6ULL-EVK the following uSDHC interfaces are connected:

  • uSDHC1: base board full size SD slot (SD1)
  • uSDHC2: CPU board microSD slot (SD2)

Variables

SD1 is the base board full size SD instance

SD2 is the CPU board microSD instance

Functions

func Init

func Init()

Init takes care of the lower level SoC initialization triggered early in runtime setup.

func Reset

func Reset()

Reset deasserts the global watchdog signal which causes the MCIMX6ULL-EVK board to power cycle (cold reset).

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL