Efika MX Smartbook, your first run

Since FreeBSD port currently not require any special features, then it’s possible to boot kernel from original (first) uboot.

  1. Fetch U-Boot image here http://people.freebsd.org/~ray/u-boot_efiks_mx_smartbook.imx
  2. Insert unused SD card
  3. WARNING! Check your /dev/da devices first, to not damage other cards, of SCSI HDD, or USB flash stick. Assuming your unused SD is /dev/da0 dd if=u-boot_efiks_mx_smartbook.imx of=/dev/da0 bs=1k seek=1 conv=sync
  4. Invert DIP switch under keyboard (1-OFF, 2-OFF, 3-OFF, 4-ON)
  5. Power up device (Press power button)

If you connect ASIX based USB Ethernet adapter and type “run bsd”, U-Boot will try to assign IP 192.168.10.88 to axe0 and ask efika_mx/kernel.uboot by TFTP on host 192.168.10.90.

My build script (it’s updated version https://raw.github.com/rayddteam/efika_mx/master/MAKE_EFIKA_MX.sh)

#!/bin/sh

SRCDIR=/usr/home/ray/work/FreeBSD/Projects/Efika_MX/src/efika_mx/
OBJDIR=/usr/obj/
TARGET=arm
TARGET_ARCH=armv6
TARGET_CPUTYPE=armv6
KERNCONF=EFIKA_MX
KERNOBJDIR="${OBJDIR}/${TARGET}.
${TARGET_ARCH}/${SRCDIR}/sys/${KERNCONF}"

TFTPDIR="/tftpboot/efika_mx/"

DSTDIR=${OBJDIR}/ARMV6

export TARGET
export TARGET_ARCH
export TARGET_CPUTYPE
export WITHOUT_AICASM=yes

echo -n "Start at "
date
FLAGS=-DNO_CLEAN

make KERNCONF=${KERNCONF} ${FLAGS} toolchain || exit 1
make KERNCONF=${KERNCONF} ${FLAGS} buildworld || exit 1
make KERNCONF=${KERNCONF} ${FLAGS} buildkernel || exit 1
echo uboot_mkimage -A ARM -O Linux -T kernel -C none -a 0x90100000 -e 0x90100100 -n "FreeBSD kernel" -d "${KERNOBJDIR}/kernel" "${TFTPDIR}/kernel.uboot"
uboot_mkimage -A ARM -O Linux -T kernel -C none -a 0x90100000 -e 0x90100100 -n "FreeBSD kernel" -d "${KERNOBJDIR}/kernel" "${TFTPDIR}/kernel.uboot"

echo -n "Done at "
date

Preparing card Assuming you have connected to your PC SD card and it have device name /dev/da0.

# Create MBR partitioning scheme
gpart create -s MBR da0
# Create 128MB fat32 slice
gpart add -t fat32 -i 1 -s 128m da0
# Create space for swap (better at least 1G)
gpart add -t freebsd -i 2 -s 512M da0
# Anything left for FreeBSD filesystems
gpart add -t freebsd -i 3 da0
# BSD partitioning
gpart create -s BSD da0s3
# Give everything to rootfs
gpart add -t freebsd-ufs da0s3
# Done, now mount filesystems
mount -t msdosfs /dev/da0s1 /mnt/imx/dos
mount -t ufs /dev/da0s3a /mnt/imx/ufs

Preparing files for boot No fill with data. We need boot script and kernel.

boot script Create file boot and add following lines to it:

echo Initialize MMC subsystemmmcinit
echo Loading kernel ...
fatload mmc 0 0x91000000 kernel.uboot
echo Start kernel
bootm 0x91000000
Pack script into U-Boot image:
mkimage -T script -d boot boot.scr
Oleksandr Rybalko a.k.a. Ray
Oleksandr Rybalko a.k.a. Ray
SRE/DevOps/Engineer SW/HW

The man who love HW and SW. And know!