Embedded module TQMa28 - PTXdist Linux BSP documentation
How-to
How to compile a (experimental) mainline Linux Kernel for the TQMa28
The i.MX28 is well supported in the mainline kernel. To build a experimental Kernel from git you can do:
make mx28evk_defconfig make menuconfig # make sure to add MXS_AUART and SERIAL_MXS_AUART_CONSOLE make uImagemmc dev
Rescue mode without DIP switches
In case a complete new firmware image (U-Boot, linux kernel, root filesystem) is to be installed, but the the rescue mode cannot be enabled because the DIP switches are not accessible, a workaround is to invalidate the master boot record (MBR) of the eMMC flash:
- using Linux
dd if=/dev/zero of=/dev/mmcblk0 bs=1024 count=4
- using U-Boot
TQMa28 U-Boot > mmc dev 0 TQMa28 U-Boot > mw.b $loadaddr 0 1000; mmc write $loadaddr 0 8
These commands erase the MBR and the system is not bootable anymore afterwards!
The system detects this and switches to rescue mode after a short while, thus a new firmware image can be installed using the MFG-Tool.
U-Boot 2013.04 | MMC timeouts
MMC: MXS MMC: 0, MXS MMC: 1 MMC0: Command 8 timeout (status 0xe03c4020) MMC0: Command 55 timeout (status 0xe02c4020)
These timeouts are no errors and totally normal U-Boot behaviour.
U-Boot probes the device connected to the Synchronous Serial Port. In order to identify eMMC or SD cards U-Boot sends these two commands. A timeout on both commands identifies the eMMC.
U-Boot | Warning: FECx MAC addresses don't match
FEC0 [PRIME] Warning: FEC0 MAC addresses don't match: Address in SROM is 00:d0:00:00:00:00 Address in environment is 02:00:01:00:00:01 , FEC1
In U-Boot the MAC address for networking tasks (tftp, ping, dhcp, etc) and to pass to the kernel is stored in the variable ethaddr. This variable is defined in the default environment (this is the one used, when environment on e-MMC can't be loaded) with a generic “local-only” MAC address (i.e. first byte, bit 1 “U/L” = 1)
During ethernet initialisation U-Boot checks MAC address stored in OTP and compares both addresses. Hence the warning.
To disable the warning you need to set ethaddr to your OTP-saved MAC:
TQMa28 U-Boot > setenv ethaddr 00:0d:xx:xx:xx:xx; saveenv
Using U-Boot 2013.04 you can also simply use the command otp_mxs:
TQMa28 U-Boot > print ethaddr ethaddr=02:00:01:00:00:01 TQMa28 U-Boot > otp_mxs getmac; saveenv TQMa28 U-Boot > print ethaddr ethaddr=00:D0:00:00:00:00
Linux | Error: no PHY found or Segmentation fault when ifconfig up
BSP0106 changed the default source of ENET_CLK to external oscillator. Previously the source was FEC unit inside the CPU. The source is selected in U-Boot, which provides the setting to kernel via device tree (TQMa28/28L) or command-line (TQMa28-fsl).
U-Boot informs about the selected clock on boot:
- Net: [FEC MXS: Using external ENET_CLK]
- Net: [FEC MXS: Using internal ENET_CLK]
To switch ENET_CLK source to internal FEC unit:
TQMa28 U-Boot > setenv enet_clk_internal 1; saveenv; reset
Switching back is easy:
TQMa28 U-Boot > setenv enet_clk_internal; saveenv; reset # notice that setenv assigns no value to delete the variable
U-Boot selects the internal ENET_CLK source upon presence of this environment variable with a positive value (y/yes/1). The variable is evaluated during ethernet initialisation and therefore a change in the variable takes place upon next boot.
PTXdist | Error: Couldn't allocate a block (no free space)
Creating root.ext2 from working dir…<BSP project path>/platform-<platform_name>/sysroot-host/bin/genext2fs: couldn't allocate a block (no free space)
The error signals that the filesystem is too small for the content that should be installed. Increase size.
=> go to ptxdist menu => platformconfig => image creation options => Generate images/root.ext2 -> Size in kilobytes: increase to reasonable size (65536 should be enough for most cases)
PTXdist | Download packages through proxy authentication
In case you have a proxy server in your local network that requires user authentication before going online, you have several ways to have ptxdist perform the authentication for you when downloading packages.
Because ptxdist relies on the program wget to download sources, we need to tell wget about the authentication:
(tested) => edit /etc/wgetc (needs sudo privileges) => Add lines anywhere in the file: http_proxy = http://<proxy address>:<proxy port>/ ftp_proxy = ftp://<proxy address>:<proxy port>/ proxy_user = <your proxy username> proxy_password = <your proxy password> use_proxy = on
(untested - please tell us if one of these works for you) > Change ptxdist setting at "User Properties" - "Proxies" -> Set http proxy to this format: http://<username>:<password>@<proxy address>:<port>/ -> Adapt for the ftp proxy > Or export http_proxy and ftp_proxy environment variables alike
U-Boot | "MMC: block number ... exceeds max (...)"
The reason for this error is that the saved environment belongs to a different U-Boot version. TQ provides U-Boot in versions 2009.08 and 2012.10, because the kernels can't run both on 2009.08. The syntax of some commands changed between U-Boot versions and thus their environment (which holds scripts using these commands) are incompatible.
⇒ To resolve this error please delete the saved environment as follows depending on your current U-Boot version:
- U-Boot 2009.08
mw.b $loadaddr 0 512 mmc write 0 $loadaddr 2 1
- U-Boot 2012.10
mw.b $loadaddr 0 512 mmc dev 0 mmc write $loadaddr 2 1
Please consider a known issue where the environment gets always saved to e-MMC
even when booting the SD card.
U-Boot | "set read bl len failed" on access to SD card
⇒ After being plugged in the sd card must be initialised prior to any access. The command
mmc rescan 1
does that.
U-Boot | Usage messages for the command "setenv"
U-Boot prints the following error message at boot time:
setenv - set environment variables Usage: setenv name value ... - set environment variable 'name' to 'value ...' setenv name - delete environment variable 'name'
⇒ Amongst others a reason for this is that the U-Boot environment variable bootargs has been accidentally stored in the flash environment and already contains a value. The error occurs because the final value (string) to be stored in this variable eventually becomes too long.
To remedy just clear the variable bootargs und save the environment to flash:
setenv bootargs saveenv
Errormessage "can't access tty" at login
If you use a precompiled rootfs you probably encounter following error message:
generic-armv5te login: root -sh: can't access tty; job control turned off root@generic-armv5te:~#
To resolve this issue specify your real console in /etc/inittab
#change following line S:2345:respawn:/sbin/getty 115200 console #to i.e. (depending on your console, see your kernel command line arguments) S:2345:respawn:/sbin/getty 115200 ttyAPP3
and reboot.
Linux boot Kernel panic Unable to mount root fs
Error message:
[ 1.090000] VFS: Cannot open root device "mmcblk0p3" or unknown-block(0,0): error -6 [ 1.100000] Please append a correct "root=" boot option; here are the available partitions: [ 1.110000] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0) [ 1.110000] [<c00139f8>] (unwind_backtrace+0x0/0xf0) from [<c02f87fc>] (panic+0x98/0x1f4) [ 1.110000] [<c02f87fc>] (panic+0x98/0x1f4) from [<c042cbf4>] (mount_block_root+0x178/0x22c) [ 1.110000] [<c042cbf4>] (mount_block_root+0x178/0x22c) from [<c042cd8c>] (mount_root+0xe4/0x10c) [ 1.110000] [<c042cd8c>] (mount_root+0xe4/0x10c) from [<c042ced0>] (prepare_namespace+0x11c/0x180) [ 1.110000] [<c042ced0>] (prepare_namespace+0x11c/0x180) from [<c042c8b0>] (kernel_init+0x170/0x1ac) [ 1.110000] [<c042c8b0>] (kernel_init+0x170/0x1ac) from [<c000f8b4>] (kernel_thread_exit+0x0/0x8) [ 1.110000] Rebooting in 1 seconds..
Kernel command line:
[ 0.000000] Kernel command line: fec_mac=02:00:01:00:00:01 ip=:::::eth0:off root=/dev/mmcblk0p3 ro console=ttyAPP3,115200 lcd_panel=fg0700 ssp1 panic=1
U-Boot mmc part lists the partition:
TQMa28 U-Boot > mmc part Partition Map for MMC device 0 -- Partition Type: DOS Partition Start Sector Num Sectors Type 1 16384 16384 53 2 32768 16384 83 3 49152 3784704 83
Solution: add the rootwait
option to the command line:
TQMa28 U-Boot > setenv addmmc 'setenv bootargs $bootargs root=/dev/mmcblk0p3 ro rootwait'