Hardware

Official product page: IMX53QSB: i.MX53 Quick Start Board.

/proc/cpuinfo:

processor       : 0
model name      : ARMv7 Processor rev 5 (v7l)
BogoMIPS        : 66.66
Features        : half thumb fastmult vfp edsp thumbee neon vfpv3 tls vfpd32
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x2
CPU part        : 0xc08
CPU revision    : 5

Hardware        : Freescale i.MX53 (Device Tree Support)
Revision        : 0000
Serial          : 0000000000000000

Board revisions

Freescale kit name is "IMX53QSB" and another names are "IMX53Loco" and "MX53 LOCO".

Actually there are two boards:

MCIMX53-START

This is an older version. PCB with yellow lines, PMIC Dialog DA9053.

Has 6 revisions: A, B, C, D, E, F.

The Device tree file is imx53-qsb.dtb

MCIMX53-START-R

The new one, with PMIC MC34708.

Also you can see revision letter on Ethernet socket, it looks like "700-27104 REV C".

The Device tree file is imx53-qsrb.dtb

Install Debian with debootstrap

To install, you need:

You have to install qemu-user-static if your computer architecture is not armhf.

   1 sudo apt update
   2 sudo apt install qemu-user-static debootstrap

Disk partitions

Use gparted, cfdisk, Parted of fdisk (see Partition for more info about utils).

Create partitions on your microSD card:

Check free space before partitions

You need at least 500 KB free space before first partition. It is better to check this before next steps:

 % sudo fdisk -l /dev/sdX
Disk /dev/sdb: 7,52 GiB, 8064598016 bytes, 15751168 sectors
Disk model: Card  Reader
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x8a275704

Device     Boot   Start      End  Sectors Size Id Type
/dev/sdb1  *       2048  2099199  2097152   1G 83 Linux
/dev/sdb2       2099200 12584959 10485760   5G 83 Linux

Here, first partition starts on 2048*512 = 1048576, ~1MB, it is OK to write u-boot in this free space.

Or, check first partition align by parted:

 % sudo parted /dev/sdb align-check optimal 1
1 aligned

Or, check sudo sfdisk --list-free.

Create filesystem and mount

In commands below, replace /dev/sdX with your path to SD-card device. Use lsblk to view full list.

   1 sudo mkfs.ext2 -L MX53_BOOT /dev/sdX1
   2 sudo mkfs.ext4 -T small -L MX53_ROOT /dev/sdX2
   3 sudo mkdir -pv /mnt/debinst
   4 sudo mount LABEL="MX53_ROOT" /mnt/debinst
   5 sudo mkdir -pv /mnt/debinst/boot
   6 sudo mount LABEL="MX53_BOOT" /mnt/debinst/boot

Setup u-boot

Here is two option: install u-boot image precompiled by Debian or compile your own.

Precompiled by Debian

No support for GPT.

In commands below, replace /dev/sdX with your path to SD-card device. Use lsblk to view full list.

   1 wget "http://ftp.us.debian.org/debian/dists/buster/main/installer-armhf/current/images/u-boot/MX53LOCO/u-boot.imx.gz"
   2 zcat u-boot.imx.gz > u-boot.imx
   3 sudo dd if=u-boot.imx of=/dev/sdX seek=2 bs=512

(as an alternative. you can try fresh u-boot image from https://d-i.debian.org/daily-images/armhf/daily/u-boot/MX53LOCO/u-boot.imx.gz)

Check partition table is not corrupted by u-boot image and wrong partition align:

 % sudo sfdisk --verify /dev/sdb
/dev/sdb:
Remaining 8409088 unallocated 512-byte sectors.

Here no errors found.

Just for information, RS232 console output of u-boot from latest step (to see version and variables):

U-Boot 2019.01+dfsg-7 (May 14 2019 - 02:07:44 +0000)

CPU:   Freescale i.MX53 rev2.1 at 800 MHz
Reset cause: POR
Board: MX53 LOCO
I2C:   ready
DRAM:  1 GiB
MMC:   FSL_SDHC: 0, FSL_SDHC: 1
Loading Environment from MMC... *** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Net:   FEC
Hit any key to stop autoboot:  0
=> printenv
baudrate=115200
boot_fdt=try
bootcmd=mmc dev ${mmcdev}; if mmc rescan; then if run loadbootscript; then run bootscript; else if run loadimage; then run mmcboot; else run netboot; fi; fi; else run netboot; fi
bootdelay=2
bootscript=echo Running bootscript from mmc ...; source
ethact=FEC
ethaddr=00:04:9f:02:3e:73
ethprime=FEC0
fdt_addr=0x71000000
fdt_file=imx53-qsrb.dtb
image=zImage
ip_dyn=yes
loadaddr=0x72000000
loadbootscript=load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};
loadfdt=load mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}
loadimage=load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}
mmcargs=setenv bootargs console=ttymxc0,${baudrate} root=${mmcroot}
mmcboot=echo Booting from mmc ...; run mmcargs; if test ${boot_fdt} = yes || test ${boot_fdt} = try; then if run loadfdt; then bootz ${loadaddr} - ${fdt_addr}; else if test ${boot_fdt} = try; then bootz; else echo WARN: Cannot load the DT; fi; fi; else bootz; fi;
mmcdev=0
mmcpart=1
mmcroot=/dev/mmcblk0p2 rw rootwait
netargs=setenv bootargs console=ttymxc0,${baudrate} root=/dev/nfs ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp
netboot=echo Booting from net ...; run netargs; if test ${ip_dyn} = yes; then setenv get_cmd dhcp; else setenv get_cmd tftp; fi; ${get_cmd} ${image}; if test ${boot_fdt} = yes ||  test ${boot_fdt} = try; then if ${get_cmd} ${fdt_addr} ${fdt_file}; then bootz ${loadaddr} - ${fdt_addr}; else if test ${boot_fdt} = try; then bootz; else echo ERROR: Cannot load the DT; exit; fi; fi; else bootz; fi;
script=boot.scr

Environment size: 1518/8188 bytes

Compile your u-boot image

Run debootstrap

See official Debian guide Installing Debian GNU/Linux from a Unix/Linux System for more information.

Run debootstrap (replace ftp.us.debian.org with your nearest Debian mirror):

   1 sudo debootstrap --arch armhf --foreign buster /mnt/debinst http://ftp.us.debian.org/debian

It will use about 190MB of space.

Run chroot

More information about chroot is in separate page: chroot.

   1 sudo cp -pv /usr/bin/qemu-arm-static /mnt/debinst/usr/bin/
   2 sudo chroot /mnt/debinst qemu-arm-static /bin/bash
   3 env -i bash   # Cleanup all environment variables
   4 export TERM=xterm-color
   5 export HOME=/root
   6 export LANG=C.UTF-8

Finish debootstrap

Commands for chroot (execution is slow, because of architecture emulation by qemu):

   1 /debootstrap/debootstrap --second-stage

System setup

More details about steps below see in Installing Debian GNU/Linux from a Unix/Linux System.

Commands for chroot:

   1 apt install ncurses-term # to avoid `dpkg` warnings about Dialog
   2 update-alternatives --config editor
   3 editor /etc/fstab
   4 # /dev/mmcblk0p2        /       auto    errors=remount-ro       0 1
   5 # /dev/mmcblk0p1        /boot   auto    ro,nosuid,nodev         0 2
   6 editor /etc/adjtime
   7 dpkg-reconfigure tzdata
   8 editor /etc/network/interfaces
   9 editor /etc/resolv.conf
  10 echo imx53 > /etc/hostname
  11 apt install locales
  12 dpkg-reconfigure locales
  13 apt install console-setup
  14 dpkg-reconfigure keyboard-configuration
  15 apt search linux-image
  16 apt install linux-image-armmp u-boot-imx
  17 apt install init

User account setup

Commands for chroot:

   1 apt install ssh
   2 passwd
   3 useradd -m -G users,audio,adm,sudo newuser
   4 passwd newuser

Configure flash-kernel

Commands for chroot:

   1 apt install flash-kernel

flash-kernel uses /proc/device-tree/model, but it is wrong in chroot, so fill

   1 echo "Freescale i.MX53 Quick Start-R Board" > /etc/flash-kernel/machine   # To substitute instead of `/proc/device-tree/model` which not accessible under chroot after debootstrap
   2 

Also, add manually to /usr/share/flash-kernel/db/all.db:

Machine: Freescale i.MX53 Quick Start-R Board
Machine: Freescale MX53 LOCO Board
Kernel-Flavors: armmp mx5
DTB-Id: imx53-qsrb.dtb
Boot-DTB-Path: /boot/board.dtb
U-Boot-Kernel-Address: 0x70008000
U-Boot-Initrd-Address: 0x72000000
Boot-Kernel-Path: /boot/uImage
Boot-Initrd-Path: /boot/uInitrd
Required-Packages: u-boot-tools
Bootloader-Sets-Incorrect-Root: no
U-Boot-Script-Name: bootscr.mx5-my
Boot-Script-Path: /boot/boot.scr

   1 cp -pv /etc/flash-kernel/bootscript/bootscr.uboot-generic /etc/flash-kernel/bootscript/bootscr.mx5-my

Add to the beginning of /etc/flash-kernel/bootscript/bootscr.mx5-my:

setenv distro_bootpart ${mmcpart}
setenv boot_targets mmc
setenv fdtfile ${fdt_file}
setenv bootpart ${mmcpart}
setenv devnum ${mmcdev}
setenv console ttymxc0
setenv devtype mmc
setenv fdt_addr_r ${fdt_addr}
setenv ramdisk_addr_r ${loadaddr}
setenv kernel_addr_r 0x70008000
setenv prefix /

Edit file /etc/default/flash-kernel:

LINUX_KERNEL_CMDLINE="root=/dev/mmcblk0p2 ro rootfstype=ext4 rootwait fixrtc"

Run flash-kernel:

   1 flash-kernel

Check files in /boot/:

# ls -lAF /boot/
total 51020
-rw-r--r-- 1 root root  3138658 Apr 29 12:38 System.map-4.19.0-9-armmp
-rw-r--r-- 1 root root    21932 Jun  6 21:14 board.dtb
-rw-r--r-- 1 root root     3267 Jun  6 21:14 boot.scr
-rw-r--r-- 1 root root   209315 Apr 29 12:38 config-4.19.0-9-armmp
lrwxrwxrwx 1 root root       36 Jun  6 21:13 dtb -> dtbs/4.19.0-9-armmp/./imx53-qsrb.dtb
lrwxrwxrwx 1 root root       36 Jun  6 21:13 dtb-4.19.0-9-armmp -> dtbs/4.19.0-9-armmp/./imx53-qsrb.dtb
drwxr-xr-x 3 root root     4096 Jun  6 21:13 dtbs/
-rw-r--r-- 1 root root 20112393 Jun  6 19:07 initrd.img-4.19.0-9-armmp
drwx------ 2 root root    16384 Jun  6 16:22 lost+found/
-rw-r--r-- 1 root root  4260416 Jun  6 21:14 uImage
-rw-r--r-- 1 root root 20112457 Jun  6 21:14 uInitrd
-rw-r--r-- 1 root root  4260352 Apr 29 12:38 vmlinuz-4.19.0-9-armmp

Prepare to boot

Exit from chroot:

   1 service ssh stop
   2 exit

Umount partitions:

   1 sudo umount /mnt/debinst/boot /mnt/debinst
   2 sudo sync

First boot

Insert microSD card and power on the board.

RS232 output:

U-Boot 2019.01+dfsg-7 (May 14 2019 - 02:07:44 +0000)

CPU:   Freescale i.MX53 rev2.1 at 800 MHz
Reset cause: POR
Board: MX53 LOCO
I2C:   ready
DRAM:  1 GiB
MMC:   FSL_SDHC: 0, FSL_SDHC: 1
Loading Environment from MMC... *** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Net:   FEC
Hit any key to stop autoboot:  0
switch to partitions #0, OK
mmc0 is current device
3267 bytes read in 83 ms (38.1 KiB/s)
Running bootscript from mmc ...
## Executing script at 72000000
4260352 bytes read in 390 ms (10.4 MiB/s)
21932 bytes read in 89 ms (240.2 KiB/s)
20111945 bytes read in 1583 ms (12.1 MiB/s)
Booting Debian 4.19.0-9-armmp from mmc 0:1...
Kernel image @ 0x70008000 [ 0x000000 - 0x410200 ]
## Flattened Device Tree blob at 71000000
   Booting using the fdt blob at 0x71000000
   Loading Ramdisk to 8e23a000, end 8f568249 ... OK
   Loading Device Tree to 8e231000, end 8e2395ab ... OK

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 4.19.0-9-armmp (debian-kernel@lists.debian.org) (gcc version 8.3.0 (Debian 8.3.0-6)) #1 SMP Debian 4.19.118-2 (2020-04-29)
[    0.000000] CPU: ARMv7 Processor [412fc085] revision 5 (ARMv7), cr=10c5387d
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] OF: fdt: Machine model: Freescale i.MX53 Quick Start-R Board
[    0.000000] Memory policy: Data cache writeback
[    0.000000] efi: Getting EFI parameters from FDT:
[    0.000000] efi: UEFI not found.
[    0.000000] cma: Reserved 16 MiB at 0xcf000000
[    0.000000] CPU: All CPU(s) started in SVC mode.
[    0.000000] random: get_random_bytes called from start_kernel+0xa0/0x504 with crng_init=0
[    0.000000] percpu: Embedded 17 pages/cpu s39756 r8192 d21684 u69632
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 260992
[    0.000000] Kernel command line:   console=ttymxc0,115200 root=/dev/mmcblk0p2 ro rootfstype=ext4 rootwait fixrtc
[    0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
[    0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
[    0.000000] Memory: 985968K/1048576K available (9216K kernel code, 1111K rwdata, 2588K rodata, 2048K init, 311K bss, 46224K reserved, 16384K cma-reserved, 507904K highmem)
[    0.000000] Virtual kernel memory layout:
[    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
[    0.000000]     fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
[    0.000000]     vmalloc : 0xe0800000 - 0xff800000   ( 496 MB)
[    0.000000]     lowmem  : 0xc0000000 - 0xe0000000   ( 512 MB)
[    0.000000]     pkmap   : 0xbfe00000 - 0xc0000000   (   2 MB)
[    0.000000]     modules : 0xbf000000 - 0xbfe00000   (  14 MB)
[    0.000000]       .text : 0x(ptrval) - 0x(ptrval)   (10208 kB)
[    0.000000]       .init : 0x(ptrval) - 0x(ptrval)   (2048 kB)
[    0.000000]       .data : 0x(ptrval) - 0x(ptrval)   (1112 kB)
[    0.000000]        .bss : 0x(ptrval) - 0x(ptrval)   ( 312 kB)
Debian GNU/Linux 10 imx53 ttymxc0
imx53 login:

Known issues, TODO

Nice to have:

See also

License

https://i.creativecommons.org/l/by/4.0/88x31.png This work is licensed under a Creative Commons Attribution 4.0 International License or newer.