Embedded module TQMa6x - PTXdist Linux BSP documentation
How-to
Boot loader
Barebox
The TQMa6x modules are mainlined in barebox featuring device tree and SPL support.
Please note that TQ systems uses U-Boot for testing and verification. In case
of differences in pin and clock configuration etc. please contact our technical support.
U-Boot
Booting
The default environment is configured to try booting from SD / eMMC card and fall back to booting from net. You can set the environment variable bootcmd, to force either booting from net or from eMMC / SD card:
TQMa6Q[MBa6x] U-Boot > setenv bootcmd run netboot
TQMa6Q[MBa6x] U-Boot > setenv bootcmd run mmcboot
Updating existing firmware over ethernet
Devicetree fit image BSP Rev.0109
update to fit image
With BSP Rev.0109 fdt fit image was introduced, this image contains all devicetree blob files in one file.To select a specific configuration environment variable fitfdt_part
By defailt U-Boot is configured for single devicetree. When fdt fit image should be used then U-Boot must be configured and updated as follows:
set environment variable
fdt_type from
single to
fit
setenv fdt_type fit
set environment variable
fitfdt_file from
imx6q-mba6x.dtb to
mba6-image-dtb.itb
setenv fdt_file mba6-image-dtb.itb
save environment settings
saveenv
set environment variable
autoload to
no
setenv autoload no
setenv
set ip address manually or get the network configuration via dhcp
set environment variable
serverip to the ip address where your TFTP server is running
setenv serverip xxx.xxx.xxx.xxx
run fdt update
run update_fdt
using fit image
These scripts load the files from the configured tftp server. You need a working network connection.
To update parts of the U-Boot environment or the Device Tree during development you can use also the U-Boot tftp command.
Using different interfaces
The use of the interfaces can be found in our tutorial.
Change Device Tree
Instructions on how to change device tree are located in our tutorial section.
Load / Change / Save the Device Tree under U-Boot
Devicetree can be edit with the fdt commands under U-Boot.
For testing purpose only. For bigger changes, please compile the Devicetree.
Therefore you can have a look at the following tutorial.
Tested with TQMa6x BSP Rev.0109
1) At first the fdt file has to be loaded from the current boot medium (mmc) into RAM.
=> run loadfdt
2) Next step is to set the predefined U-Boot environment variable fdt_addr through the fdt addr command.
=> fdt addr $fdt_addr
3) Afterwards the size of the fdt has to be increased (to the next 4K divider) in order to have some space for modifications. This is simply done by entering:
=> fdt resize
4) List device in the tree you want to change to have a look at the default settings.
Example
=> fdt list /gpio_buttons@0
gpio_buttons@0 {
compatible = "gpio-keys";
#address-cells = <0x00000001>;
#size-cells = <0x00000000>;
pinctrl-names = "default";
pinctrl-0 = <0x00000055>;
button@1 {
};
button@2 {
};
button@3 {
};
};
=> fdt print /gpio_buttons@0
gpio_buttons@0 {
compatible = "gpio-keys";
#address-cells = <0x00000001>;
#size-cells = <0x00000000>;
pinctrl-names = "default";
pinctrl-0 = <0x00000055>;
button@1 {
label = "s6";
linux,code = <0x00000040>;
gpios = <0x00000056 0x0000000d 0x00000000>;
};
button@2 {
label = "s7";
linux,code = <0x00000041>;
gpios = <0x00000056 0x0000000c 0x00000000>;
};
button@3 {
label = "s8";
linux,code = <0x00000042>;
gpios = <0x00000011 0x00000008 0x00000000>;
};
};
5) To modify a value of a propertie use the fdt set command.
=> fdt set <path> <property> <value>
Example
=> fdt set /gpio_buttons@0/button@1 label s66
6) Optional: If you want to save your modified Devicetree back to mmc you'll have to run the following command:
=> mmc dev $mmcdev; mmc write $fdt_addr $fdt_start $fdt_size
TQMa6x BSP.0110
<code>⇒ fatwrite mmc $mmcdev:$firmwarepart $fdt_addr $fdt_file <totalsize> </code>
You can find out <totalsize> of the modified fdt by entering the command fdt header
Otherwise you can boot your module with the changed Devicetree right after the modification.
Change / adapt display type
Configuration of display type and display support depends on the kernel version used
since the drivers are at least partly in staging.
When displays or display settings are altered the device tree has to be modified.
See here how to change device tree.
Beginning with Linux 3.16-rc5 (BSP REV.0104) a devicetree with special settings for HDMI is compiled.
Correct working of the HDMI driver depends on the function of the HPD signal of the Monitor.
Beginning with Linux 3.16-rc5 (BSP REV.0104) a devicetree with special settings for parallel display is compiled.
To change the display type, you need to change the default timing and - in case timing is not supplied yet - the
correct display timing has to be entered in device tree.
To use LVDS display with frame buffer support, make sure to disable other displays in the device tree (set the status property of the node to “disabled”).
To enable the LVDS output you have to
Timing examples:
Sharp lq085y3lg13
lq085y3lg13 { /* needs fsl,data-width = <18> */
clock-frequency = <26200000 26600000 27000000>;
hactive = <800>;
vactive = <480>;
hfront-porch = <10>;
hback-porch = <0>;
hsync-len = <255>; /* FIXME: typ < 256!!*/
vback-porch = <0>;
vfront-porch = <2>; /* move 2 lines up */
vsync-len = <40 45 50>;
de-active = <1>;
hsync-active = <0>;
vsync-active = <0>;
};
AUO auo-g156-xw01
auo-g156-xw01 {
clock-frequency = <60000000 76000000 90000000>;
hactive = <1366>;
vactive = <768>;
hfront-porch = <10>;
hback-porch = <10>;
hsync-len = <80 200 570>;
vback-porch = <100>;
vfront-porch = <10>;
vsync-len = <10 38 120>;
de-active = <1>;
hsync-active = <0>;
vsync-active = <0>;
};
CHIMEI g104-x1
chimei-g104-x1 {
clock-frequency = <55000000 65000000 75000000>;
hactive = <1024>;
vactive = <768>;
hfront-porch = <75>;
hback-porch = <10>;
hsync-len = <76 255 776>; /* FIXME: typ < 256!*/
vback-porch = <100>;
vfront-porch = <10>;
vsync-len = <2 38 182>;
de-active = <1>;
hsync-active = <0>;
vsync-active = <0>;
};
CHIMEI g070y2-l01
chimei-g070y2-l01 {
clock-frequency = <27000000 29500000 33000000>;
hactive = <800>;
vactive = <480>;
hfront-porch = <0>;
hback-porch = <0>;
hsync-len = <130 192 290>;
vback-porch = <0>;
vfront-porch = <2>;
vsync-len = <10 20 70>;
de-active = <1>;
hsync-active = <0>;
vsync-active = <0>;
};
TQMa6x BSP REV.0110 Display
With BSP REV.0110 the kmsfb wrapper was introduced for the compability between linux mainline kernel and the Vivante GPU driver. The kmsfb wrapper emulates a framebuffer device from the kernel mode settings and requires a proper configuration file /etc/kmsfb-manage.conf.
To show the current drm information please execute kmsfb-manage -s
in the linux shell. Please see the example output below after executing kmsfb-manage -s
on a Starterkit with HDMI display connected:
root@MBa6x:/usr/lib/qt5/examples/webview/minibrowser kmsfb-manage -s
------------------------ Current Layout ------------------------
CRTCs:
id: 18
fb id: 0
x: 0
y: 0
id: 22
fb id: 0
x: 0
y: 0
Connectors:
id 25
current encoder: 24
type: HDMI-A
mode0: 1680x1050@60
mode1: 1280x1024@75
mode2: 1280x1024@60
mode3: 1152x864@75
mode4: 1024x768@75
mode5: 1024x768@60
mode6: 800x600@75
mode7: 800x600@60
mode8: 800x600@56
mode9: 848x480@60
mode10: 640x480@75
mode11: 640x480@60
mode12: 640x480@60
mode13: 720x400@70
Property: EDID
id : 1
flags : 20
count_values : 0
count_enums : 0
blob is 128 length, FFFFFF00
Property: DPMS
id : 2
flags : 8
count_values : 4
values : 0 1 2 3
count_enums : 4
0 = On
1 = Standby
2 = Suspend
3 = Off
con_value : On
Encoders: 1
id: 24
crtc id: 0
possible crtcs: 0x00000003
possible clones: 0x00000000
Framebuffers: 0
Planes: 1
id: 20
The following values are required to create the kmsfb configuration file:
After determining the appropriate values the file /etc/kmsfb-manage.conf can be edited. Please see the example configuration for a HDMI display below:
-f bpp=32,xres=1680,yres=1050,fill=1,3d=1,vsync=0 -w fbid=0,connector=25,encoder=24,crtc=0
After editing the kmsfb-manage.conf file please reboot the Starterkit to activate the display configuration.
Compile kernel/bootloader outside of the BSP
To compile the kernel/bootloader outside of the BSP, please have a look at the corresponding tutorial.
Setup the Ethernet devices under U-Boot
USB-ETH
1) Set environment variable usbethaddr
No longer necessary for BSP Rev. ≥0109
setenv usbethaddr <MAC address>
2) Start to detect USB device
usb start
3) To use Ethernet device “sms0” under U-Boot you have to change the active Ethernet device
setenv ethact sms0
Available Ethernet devices are “sms0”(X12) and “FEC”(X11)
WEIM bus
The term “wireless” does not imply that the WEIM is literally an interface
without wires. It simply means that this module was originally designed for
wireless and mobile applications that use low-power technology.
The actual devices are instantiated from the child nodes of a WEIM node.
Device tree documentation
Required properties
- compatible:
Should contain one of the following:
“fsl,imx1-weim”
“fsl,imx27-weim”
“fsl,imx51-weim”
“fsl,imx50-weim”
“fsl,imx6q-weim”
- reg:
A resource specifier for the register space
(see the example below)
- clocks:
the clock, see the example below.
- #address-cells:
Must be set to 2 to allow memory address translation
- #size-cells:
Must be set to 1 to allow CS address passing
- ranges:
Must be set up to reflect the memory layout with fourinteger values for each chip-select line in use:
<cs-number> 0 <physical address of mapping> <size>
Optional properties
- fsl,weim-cs-gpr:
For “fsl,imx50-weim” and “fsl,imx6q-weim” type of devices, it should be the phandle to the system General Purpose Register controller that contains WEIM CS GPR register, e.g. IOMUXC_GPR1 on i.MX6Q. IOMUXC_GPR1[11:0] should be set up as one of the following 4 possible values depending on the CS space configuration.
IOMUXC_GPR1 [11:0]] | CS0 | CS1 | CS2 | CS3 |
05 | 128M | 0M | 0M | 0M |
033 | 64M | 64M | 0M | 0M |
0113 | 64M | 32M | 32M | 0M |
01111 | 32M | 32M | 32M | 32M |
In case that the property is absent, the reset value or what bootloader sets up in IOMUXC_GPR1[11:0] will be used.
Timing property for child nodes. It is mandatory, not optional.
- fsl,weim-cs-timing:
The timing array, contains timing values for the child node. We can get the CS index from the child node's “reg” property. The number of registers depends on the selected chip.
For i.MX35 (“fsl,imx27-weim”) there are three registers: CSCRxU, CSCRxL, CSCRxA.
For i.MX53 (“fsl,imx50-weim”) and i.MX6Q(“fsl,imx6q-weim”)and i.MX6DL(“fsl,imx6q-weim”) and there are six registers: CSxGCR1, CSxGCR2, CSxRCR1, CSxRCR2, CSxWCR1, CSxWCR2.
Example for WEIM Bus
Example code for Linux 3.14
Customized pinmuxing
Customized timing
For Linux 3.16 fsl,weim-cs-gpr = <&gpr>; must be added
Line 15 <mainboard-name> must be customized
Line 18 Mainboard xyz must be customized
Line 19 mainboard must be costumized
Device tree example
12 /dts-v1/;
13
14 #include "imx6dl-tqma6s.dtsi"
15 #include "imx6qdl-<mainboard-name>.dtsi"
16
17 / {
18 model = "TQ TQMa6S on Mainnboard xyz";
19 compatible = "tq,mainboard", "tq,tqma6s", "fsl,imx6dl";
20
…
215 &iomuxc {
…
454 weim {
455 pinctrl_weim_1: weim-grp1 {
456 fsl,pins = <
457 /* (PAD_CTL_DSE_80ohm | PAD_CTL_HYS | PAD_CTL_SPEED_MED) */
458 #define PAD_CTL_EIM_ADDR 0x00010098
459 /* (PAD_CTL_DSE_80ohm | PAD_CTL_HYS | PAD_CTL_SPEED_MED | PAD_CTL_PKE) */
460 #define PAD_CTL_EIM_DATA 0x00011098
461 /* (PAD_CTL_DSE_80ohm | PAD_CTL_HYS | PAD_CTL_SPEED_MED | PAD_CTL_PUS_100K_UP) */
462 #define PAD_CTL_EIM_CTRL 0x0001b098
463 /* (PAD_CTL_DSE_80ohm | PAD_CTL_HYS | PAD_CTL_SPEED_MED) */
464 #define PAD_CTL_EIM_RW 0x00010098
465 MX6QDL_PAD_EIM_DA0__EIM_AD00 PAD_CTL_EIM_ADDR
466 MX6QDL_PAD_EIM_DA1__EIM_AD01 PAD_CTL_EIM_ADDR
467 MX6QDL_PAD_EIM_DA2__EIM_AD02 PAD_CTL_EIM_ADDR
468 MX6QDL_PAD_EIM_DA3__EIM_AD03 PAD_CTL_EIM_ADDR
469 MX6QDL_PAD_EIM_DA4__EIM_AD04 PAD_CTL_EIM_ADDR
470 MX6QDL_PAD_EIM_DA5__EIM_AD05 PAD_CTL_EIM_ADDR
471 MX6QDL_PAD_EIM_DA6__EIM_AD06 PAD_CTL_EIM_ADDR
472 MX6QDL_PAD_EIM_DA7__EIM_AD07 PAD_CTL_EIM_ADDR
473 MX6QDL_PAD_EIM_DA8__EIM_AD08 PAD_CTL_EIM_ADDR
474 MX6QDL_PAD_EIM_DA9__EIM_AD09 PAD_CTL_EIM_ADDR
475 MX6QDL_PAD_EIM_DA10__EIM_AD10 PAD_CTL_EIM_ADDR
476 MX6QDL_PAD_EIM_DA11__EIM_AD11 PAD_CTL_EIM_ADDR
477 MX6QDL_PAD_EIM_DA12__EIM_AD12 PAD_CTL_EIM_ADDR
478 MX6QDL_PAD_EIM_DA13__EIM_AD13 PAD_CTL_EIM_ADDR
479 MX6QDL_PAD_EIM_DA14__EIM_AD14 PAD_CTL_EIM_ADDR
480 MX6QDL_PAD_EIM_DA15__EIM_AD15 PAD_CTL_EIM_ADDR
481 MX6QDL_PAD_EIM_A16__EIM_ADDR16 PAD_CTL_EIM_ADDR
482 MX6QDL_PAD_EIM_A17__EIM_ADDR17 PAD_CTL_EIM_ADDR
483 MX6QDL_PAD_EIM_A18__EIM_ADDR18 PAD_CTL_EIM_ADDR
484 MX6QDL_PAD_EIM_CS0__EIM_CS0_B PAD_CTL_EIM_CTRL
485 MX6QDL_PAD_EIM_OE__EIM_OE_B PAD_CTL_EIM_CTRL
486 MX6QDL_PAD_EIM_RW__EIM_RW PAD_CTL_EIM_RW
487 MX6QDL_PAD_CSI0_DATA_EN__EIM_DATA00 PAD_CTL_EIM_DATA
488 MX6QDL_PAD_CSI0_VSYNC__EIM_DATA01 PAD_CTL_EIM_DATA
489 MX6QDL_PAD_CSI0_DAT4__EIM_DATA02 PAD_CTL_EIM_DATA
490 MX6QDL_PAD_CSI0_DAT5__EIM_DATA03 PAD_CTL_EIM_DATA
491 MX6QDL_PAD_CSI0_DAT6__EIM_DATA04 PAD_CTL_EIM_DATA
492 MX6QDL_PAD_CSI0_DAT7__EIM_DATA05 PAD_CTL_EIM_DATA
493 MX6QDL_PAD_CSI0_DAT8__EIM_DATA06 PAD_CTL_EIM_DATA
494 MX6QDL_PAD_CSI0_DAT9__EIM_DATA07 PAD_CTL_EIM_DATA
495 >;
496 };
497 };
498 };
…
&weim {
Example Code for TQMa6S
597 pinctrl-names = "default";
598 pinctrl-0 = <&pinctrl_weim_1>;
599 /* <cs-number> 0 <physical address of mapping> <size> */
600 ranges = <0 0 0x08000000 0x08000000>;
601 #address-cells = <2>;
602 #size-cells = <1>;
603 status = "okay";
604
605 sram@0,0 {
606 compatible = "tq,sram";
607 #address-cells = <1>;
608 #size-cells = <1>;
609 reg = <0 0 0x0080000>;
610 bank-width = <1>;
611 /* optimized settings for device at CS0 */
612 /* CSxGCR1, CSxGCR2, CSxRCR1, CSxRCR2, CSxWCR1, CSxWCR2 */
613 /*
614 * timing for SRAM: we have 8 Bit data and 19 Bit
615 * address
616 */
617 fsl,weim-cs-timing = <
618 0x60240001 0x00001000 0x07f11101
619 0x00000000 0x0f249241 0x00000000
620 >;
621 };
622 };
the following information is based on Linux kernel 3.16
Pins (GPIO,PWM) must be configured
The power-supply property could refer to a logical always-on device
Required Kernel configuration:
PWM support
PWM backlight support
regulator support
Device tree documentation
Required properties
- compatible:“pwm-backlight”
- pwms: OF device-tree PWM specification (see PWM binding[0])
- brightness-levels: Array of distinct brightness levels. Typically these are in the range from 0 to 255, but any
range starting at 0 will do. The actual brightness level (PWM duty cycle) will be interpolated from these values.
0 means a 0% duty cycle (darkest/off), while the last value in the array represents a 100% duty cycle (brightest).
- default-brightness-level: the default brightness level (index into the array defined by the “brightness-levels” property)
- power-supply: regulator for supply voltage
Optional properties
- pwm-names: a list of names for the PWM devices specified in the
“pwms” property (see PWM binding[0])
- enable-gpios: contains a single GPIO specifier for the GPIO which enables
and disables the backlight (see GPIO binding[1])
[0]: Documentation/devicetree/bindings/pwm/pwm.txt
[1]: Documentation/devicetree/bindings/gpio/gpio.txt
Device tree example TQMa6x / MBa6x (BSP0104/Linux kernel 3.16)
51 backlight_ldb: backlight@0 {
52 compatible = "pwm-backlight";
53 pwms = <&pwm1 0 62500>;
54
55 brightness-levels = <0 96 128 160 192 224 255>;
56 default-brightness-level = <5>;
57
58 power-supply = <&vcc3v3>;
59 enable-gpios = <&gpio4 5 GPIO_ACTIVE_HIGH>;
60
61 };
…
152 regulators {
153 compatible = "simple-bus";
154 #address-cells = <1>;
155 #size-cells = <0>;
…
175 vcc3v3: regulator@2 {
176 compatible = "regulator-fixed";
177 reg = <2>;
178 regulator-name = "vcc3v3";
179 regulator-min-microvolt = <3300000>;
180 regulator-max-microvolt = <3300000>;
181 };
…
336 &iomuxc {
337 pinctrl-names = "default";
338 pinctrl-0 = <&pinctrl_hog>;
…
445 hog {
446 pinctrl_hog: hoggrp-1 {
447 fsl,pins = <
…
451 MX6QDL_PAD_GPIO_19__GPIO4_IO05 0x80000000 /* LCD.BLT_EN */
…
486 >;
487 };
488 };
…
637 };
530 pwm1 {
531 pinctrl_pwm1_mba6x: pwm1grp-mba6x-1 {
532 fsl,pins = <
533 /* 100 k PD, DSE 120 OHM, SPPEED LO */
534 MX6QDL_PAD_GPIO_9__PWM1_OUT 0x00003050
535 >;
536 };
537 };
…
732 &pwm1 {
733 status = "okay";
734 pinctrl-names = "default";
735 pinctrl-0 = <&pinctrl_pwm1_mba6x>;
736 };
…
TQMa6x serial downloader