Linux 3.10.17 on your Rex Module

Answered
1
0

Do you want to try out the new Linux kernel 3.10.17 released from Freescale without changing the current u-boot ?

Normally you would have to port a new u-boot to the rex module, because this kernel needs a device tree blob loaded in the memory before the kernel start.

But, as always, Linux has a solution for systems with an old u-boot ….

Maybe someone is interested, so … here are the instructions to accomplish this :

  • First of all : Download the new Manufacturing Toolkit from Freescale with version 3.10.17
  • Follow the instructions until “Building an image” in the “Freescale_Yocto_Project_User’s_Guide.pdf”
  • For the Pro-Module i have built a configuration described there in 5.6.1 -> X-11 image on i.mx6 Quad SabreSD

For this task you will need a lot of time .. depending on the speed of the internet connection and the processing power
of your Host … be prepared to have at least 50 GB free space …..and it would be a wise idea to run this task
over night … otherwise it is just annoying ;)

So, at the and, you will receive in the /tmp/deploy/images/imx6qsabresd directory all the released image files
for the sabresd …… the interesting part for us currently is only the filesystem … and the build environment.

I flashed the resulting fsl-image-x11-imx6sabresd.sdcard with a plain “dd if=./fsl-image-x11-imx6sabresd.sdcard of=/dev/sd to a sd card.

If you execute “bitbake -c devshell” inside your build directory you are now able to build an change your kernel.

Then :

  • make menuconfig
  • Go to the boot options
  • Add the following options : “Use appended device tree blob to zImage” and “Supplement the appended DTB with traditional ATAG information”

So in basic … your kernel is now looking for a location in the kernel image and not in a certain memory area.
The shame is, the make for the kernel is not supporting this kind of kernel, so you have to create a little shell script for building

#!/bin/sh 
LOADADDR=0x10008000 make zImage dtbs
cat arch/arm/boot/zImage arch/arm/boot/dts/rex-imx6q.dtb > zImage-dtb
mkimage -A arm -O linux -T kernel -C none -a 0x10008000 -e 0x10008000 -n "Linux" -d zImage-dtb uImage-dtb

So, the only thing missing is a dtb file for your rex board …. just go to the “arch/arm/boot/dts” directory of your kernel.
There you have to change the makefile to add your dts file for compile .. just open the Makefile and add ( according to the
shell script) “rex-imx6q.dbt” to the “CONFIG_ARCH_MXC” section.

So, as a starting point i have chosen imx6qdl-sabresd.dtsi and changed it according to the diff below :


--- imx6qdl-rex.dtsi    2014-05-22 13:14:28.567910007 -0700
+++ imx6qdl-sabresd.dtsi    2014-05-20 12:44:59.161243668 -0700
@@ -22,19 +22,18 @@
        reg = ;
    };
 
-       battery: max8903@0 {
-                compatible = "fsl,max8903-charger";
-                pinctrl-names = "default";
-                dok_input = ;
-                uok_input = ;
-                chg_input = ;
-                flt_input = ;
-                fsl,dcm_always_high;
-                fsl,dc_valid;
-                fsl,usb_valid;
-                status = "okay";
-        };
-
+   battery: max8903@0 {
+       compatible = "fsl,max8903-charger";
+       pinctrl-names = "default";
+       dok_input = ;
+       uok_input = ;
+       chg_input = ;
+       flt_input = ;
+       fsl,dcm_always_high;
+       fsl,dc_valid;
+       fsl,usb_valid;
+       status = "okay";
+   };
 
    hannstar_cabc {
        compatible = "hannstar,cabc";
@@ -75,26 +74,16 @@
            regulator-name = "usb_h1_vbus";
            regulator-min-microvolt = ;
            regulator-max-microvolt = ;
-           gpio = ;
+           gpio = ;
            enable-active-high;
        };
 
-               reg_2p5v: 2p5v {
-                        compatible = "regulator-fixed";
-                        regulator-name = "2P5V";
-                        regulator-min-microvolt = ;
-                        regulator-max-microvolt = ;
-                        regulator-always-on;
-                };
-
-                reg_3p3v: 3p3v {
-                        compatible = "regulator-fixed";
-                        regulator-name = "3P3V";
-                        regulator-min-microvolt = ;
-                        regulator-max-microvolt = ;
-                        regulator-always-on;
-                };
-
+       reg_audio: wm8962_supply {
+           compatible = "regulator-fixed";
+           regulator-name = "wm8962-supply";
+           gpio = ;
+           enable-active-high;
+       };
 
        reg_mipi_dsi_pwr_on: mipi_dsi_pwr_on {
            compatible = "regulator-fixed";
@@ -137,17 +126,24 @@
    };
 
    sound {
-                compatible = "fsl,imx6q-sabrelite-sgtl5000",
-                             "fsl,imx-audio-sgtl5000";
-                model = "imx6q-sabrelite-sgtl5000";
-                ssi-controller = ;
-                audio-codec = ;
-                audio-routing =
-                        "MIC_IN", "Mic Jack",
-                        "Mic Jack", "Mic Bias",
-                        "Headphone Jack", "HP_OUT";
-                mux-int-port = ;
-                mux-ext-port = ;
+       compatible = "fsl,imx6q-sabresd-wm8962",
+              "fsl,imx-audio-wm8962";
+       model = "wm8962-audio";
+       ssi-controller = ;
+       audio-codec = ;
+       audio-routing =
+           "Headphone Jack", "HPOUTL",
+           "Headphone Jack", "HPOUTR",
+           "Ext Spk", "SPKOUTL",
+           "Ext Spk", "SPKOUTR",
+           "MICBIAS", "AMIC",
+           "IN3R", "MICBIAS",
+           "DMIC", "MICBIAS",
+           "DMICDAT", "DMIC";
+       mux-int-port = ;
+       mux-ext-port = ;
+       hp-det-gpios = ;
+       mic-det-gpios = ;
    };
 
    sound-hdmi {
@@ -160,9 +156,9 @@
    mxcfb1: fb@0 {
        compatible = "fsl,mxc_sdc_fb";
        disp_dev = "ldb";
-       interface_pix_fmt = "RGB24";
+       interface_pix_fmt = "RGB666";
        mode_str ="LDB-XGA";
-       default_bpp = ;
+       default_bpp = ;
        int_clk = ;
        late_init = ;
        status = "disabled";
@@ -256,6 +252,7 @@
 &cpu0 {
    arm-supply = ;
    soc-supply = ;
+   pu-supply = ; /* use pu_dummy if VDDSOC share with VDDPU */
 };
 
 &ecspi1 {
@@ -281,6 +278,19 @@
    status = "okay";
 };
 
+&gpc {
+   fsl,cpu_pupscr_sw2iso = ;
+   fsl,cpu_pupscr_sw = ;
+   fsl,cpu_pdnscr_iso2sw = ;
+   fsl,cpu_pdnscr_iso = ;
+   fsl,ldo-bypass = ; /* use ldo-bypass, u-boot will check it and configure */
+   fsl,wdog-reset = ; /* watchdog select of reset source */
+   pu-supply = ; /* ldo-bypass:use pu_dummy if VDDSOC share with VDDPU */
+};
+
+&gpu {
+   pu-supply = ; /* ldo-bypass:use pu_dummy if VDDSOC share with VDDPU */
+};
 
 &hdmi_audio {
    status = "okay";
@@ -310,14 +320,46 @@
    pinctrl-0 = ;
    status = "okay";
 
-        codec: sgtl5000@0a {
-                compatible = "fsl,sgtl5000";
-                reg = ;
-                clocks = ;
-                VDDA-supply = ;
-                VDDIO-supply = ;
-        };
+   codec: wm8962@1a {
+       compatible = "wlf,wm8962";
+       reg = ;
+       clocks = ;
+       DCVDD-supply = ;
+       DBVDD-supply = ;
+       AVDD-supply = ;
+       CPVDD-supply = ;
+       MICVDD-supply = ;
+       PLLVDD-supply = ;
+       SPKVDD1-supply = ;
+       SPKVDD2-supply = ;
+       amic-mono;
+       gpio-cfg = ;
+       };
 
+   ov564x: ov564x@3c {
+       compatible = "ovti,ov564x";
+       reg = ;
+       pinctrl-names = "default";
+       pinctrl-0 = ;
+       clocks = ;
+       clock-names = "csi_mclk";
+       DOVDD-supply = ; /* 1.8v */
+       AVDD-supply = ;  /* 2.8v, on rev C board is VGEN3,
+                       on rev B board is VGEN5 */
+       DVDD-supply = ;  /* 1.5v*/
+       pwn-gpios = ;   /* active low: SD1_DAT0 */
+       rst-gpios = ;   /* active high: SD1_DAT1 */
+       csi_id = ;
+       mclk = ;
+       mclk_source = ;
+   };
 
    mma8451@1c {
        compatible = "fsl,mma8451";
@@ -551,6 +593,7 @@
                MX6QDL_PAD_EIM_D29__GPIO3_IO29 0x80000000
                MX6QDL_PAD_SD3_RST__GPIO7_IO08 0x80000000
                MX6QDL_PAD_GPIO_9__GPIO1_IO09 0x80000000
+               MX6QDL_PAD_GPIO_1__WDOG2_B 0x80000000
                MX6QDL_PAD_GPIO_2__GPIO1_IO02 0x80000000
            >;
        };
@@ -610,20 +653,17 @@
 
 &usbh1 {
    vbus-supply = ;
-        pinctrl-names = "default";
    status = "okay";
-
 };
 
 &usbotg {
    vbus-supply = ;
    pinctrl-names = "default";
-   pinctrl-0 = ;
+   pinctrl-0 = ;
    disable-over-current;
    status = "okay";
 };
 
-
 &usdhc2 {
    pinctrl-names = "default";
    pinctrl-0 = ;
@@ -656,3 +696,6 @@
         status = "okay";
 };
 
+&vpu {
+   pu-supply = ; /* ldo-bypass:use pu_dummy if VDDSOC share with VDDPU */
+};


The final rex-imx6q.dts file looks like :


 /*
  * Copyright 2012 Freescale Semiconductor, Inc
  * Copyright 2011 Linaro Ltd.
  *
  */

 /dts-v1/;

 #include "imx6q.dtsi"
 #include "imx6qdl-rex.dtsi"

 / {
           model = "REXi.mx6 Board";
           compatible = "fsl,imx6q-sabresd", "fsl,imx6q";
 };

 &i2c1 {
        status = "okay";
        clock-frequency = ;
        pinctrl-names = "default";
        pinctrl-0 = ;

        codec: sgtl5000@0a {
                compatible = "fsl,sgtl5000";
                reg = ;
                clocks = ;
                VDDA-supply = ;
                VDDIO-supply = ;
        };
};


&usdhc4 {
    status = "disable";
};

&battery {
    status = "disable";
};

&mxcfb1 {
    status = "okay";
};

&mxcfb2 {
    status = "okay";
};

&mxcfb3 {
    status = "okay";
};

&mxcfb4 {
    status = "okay";
};


&ssi1 {
        fsl,mode = "i2s-slave";
        status = "okay";
};

Now you are able to execute the Shell-script to build the kernel with the attached dtb …..
You now just have to exchange the kernel on the sd card from the Freescale yocto build ….
change your bootparameters in the uboot ( fatload instead of ext2load, root device is partition 2, not one )
And your kernel will hopefully start up without changing the uboot on the system.

Hope someone finds this usefull ….. took me a few days to figure everything out . so maybe someone will get to this point
faster than me ;)

Kind regards,

  • You must to post comments
Best Answer
0
0

Thank you so much Robert!

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.