Custom Kernel Build on IMX6 Sabrelite (Ubuntu 14.04.5 LTS)

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Custom Kernel Build on IMX6 Sabrelite (Ubuntu 14.04.5 LTS)

Jump to solution
4,286 Views
tengri
Contributor IV

Hi all,

I have built a custom kernel (3.14.52 ga) and integrate it into a prebuilt (ubuntunizing) SD card image as stated in following BD post. 

https://boundarydevices.com/ubuntunizing-i-mx6-kernels/ 

 

Now I am having a trouble of getting the video output enabled from BDSL board. My primary requirement is to get the RGB port to work, but after the kernel update (everything works fine with prebuilt original ubuntu image) now even the hdmi video does not seem to work. I tried passing bootargs commands to uboot for hdmi output configuration. Here is my uboot environment print :

U-Boot 2015.07-15001-g440d481 (Oct 07 2015 - 12:30:57 -0700)
CPU: Freescale i.MX6Q rev1.2 996 MHz (running at 792 MHz)
Reset cause: POR
Board: SABRE Lite
I2C: ready
DRAM: 1 GiB
MMC: FSL_SDHC: 0, FSL_SDHC: 1
SF: Detected SST25VF016B with page size 256 Bytes, erase size 4 KiB, total 2 MiB
auto-detected panel 1280x720M@60
Display: hdmi:1280x720M@60 (1280x720)
In: serial
Out: serial
Err: serial
Net: using phy at 6
FEC [PRIME], usb_ether
Error: usb_ether address not set.
Hit any key to stop autoboot: 0
=> print
baudrate=115200
board=sabrelite
bootargs=video=mxcfb0:dev=hdmi,1280x720M@60,if=RGB24
bootcmd=for dtype in ${bootdevs}; do if itest.s "xusb" == "x${dtype}" ; then usb start ;fi; for disk in 0 1 ; do ${dtype} dev ${disk} ;load ${dtype} ${disk}:1 10008000 /6x_bootscript&& source 10008000 ; done ; done; setenv stdout serial,vga ; echo ; echo 6x_bootscript not found ; echo ; echo serial console at 115200, 8N1 ; echo ; echo details at http://boundarydevices.com/6q_bootscript ; setenv stdout serial;setenv stdin serial,usbkbd;for dtype in ${umsdevs} ; do if itest.s sata == ${dtype}; then initcmd='sata init' ;else initcmd='mmc rescan' ;fi; for disk in 0 1 ; do if $initcmd && $dtype dev $disk ; then setenv stdout serial,vga; echo expose ${dtype} ${disk} over USB; ums 0 $dtype $disk ;fi; done; done ;setenv stdout serial,vga; echo no block devices found;
bootdelay=3
bootdevs=sata mmc usb
clearenv=if sf probe || sf probe || sf probe 1 ; then sf erase 0xc0000 0x2000 && echo restored environment to factory default ; fi
cmd_hdmi=fdt set fb_hdmi status okay;fdt set fb_hdmi mode_str 1280x720M@60;
cmd_lcd=fdt set fb_lcd status disabled
cmd_lvds=fdt set fb_lvds status disabled
console=ttymxc1
cpu=6Q
dfu_alt_info=u-boot raw 0x0 0xc0000
ethact=FEC
ethaddr=00:19:b8:02:79:6c
ethprime=FEC
fdt_addr=0x13000000
fdt_high=0xffffffff
initrd_high=0xffffffff
loadaddr=0x12000000
loadsplash=if sf probe ; then sf read ${splashimage} c2000 ${splashsize} ; fi
reset_cause=1
rundfu=dfu 0 sf 0:0:25000000:0
uboot_defconfig=nitrogen6q
umsdevs=sata mmc
upgradeu=for dtype in ${bootdevs}; do for disk in 0 1 ; do ${dtype} dev ${disk} ;load ${dtype} ${disk}:1 10008000 /6x_upgrade && source 10008000 ; done ; done
usbnet_devaddr=00:19:b8:00:00:02
usbnet_hostaddr=00:19:b8:00:00:01
usbrecover=setenv ethact usb_ether; setenv ipaddr 10.0.0.2; setenv netmask 255.255.255.0; setenv serverip 10.0.0.1; setenv bootargs console=ttymxc1,115200; tftpboot 10800000 10.0.0.1:uImage-${board}-recovery&& tftpboot 12800000 10.0.0.1:uramdisk-${board}-recovery.img && bootm 10800000 12800000
Environment size: 2172/8188 bytes

 

 And the kernel boot log is shown below :

AHCI 0001.0300 32 slots 1 ports 3 Gbps 0x1 impl SATA mode
flags: ncq stag pm led clo only pmp pio slum part
No port device detected!
** Bad device size - sata 0 **
SATA device 1: unknown device
** Bad device sata 1 **
MMC: no card present
MMC: no card present
** Bad device mmc 0 **
switch to partitions #0, OK
mmc1 is current device
4437 bytes read in 39 ms (110.4 KiB/s)
## Executing script at 10008000
74 bytes read in 230 ms (0 Bytes/s)
43588 bytes read in 107 ms (397.5 KiB/s)
only CEA modes allowed on HDMI port
----------- trying to load /initrd.img
2318305 bytes read in 1416 ms (1.6 MiB/s)
5119232 bytes read in 1063 ms (4.6 MiB/s)
Kernel image @ 0x10800000 [ 0x000000 - 0x4e1d00 ]
## Flattened Device Tree blob at 13000000
 Booting using the fdt blob at 0x13000000
 reserving fdt memory region: addr=13000000 size=b000
 Using Device Tree in place at 13000000, end 1300dfff
Starting kernel ...
egalax_ts 2-0004: Failed to read firmware version
ft5x06-ts 2-0038: Could not detect touch screen -19.
ili210x_i2c 2-0041: i2c transfer failed
ili210x_i2c 2-0041: Failed to get firmware version, err: -5
imx6q-pinctrl 20e0000.iomuxc: pin MX6Q_PAD_DI0_PIN4 already requested by lcd.21; cannot claim for 2-0048
imx6q-pinctrl 20e0000.iomuxc: pin-91 (2-0048) status -22
imx6q-pinctrl 20e0000.iomuxc: could not request pin 91 (MX6Q_PAD_DI0_PIN4) from group i2c3-tsc2004grp on device 20e0000.iomuxc
tsc2004 2-0048: Error applying setting, reverse things back
tsc2004_reset: write_cmd -5
tsc2004 2-0048: Failed to reset TSC -5
snvs_rtc 20cc034.snvs-rtc-lp: can't get snvs-rtc clock
imx6q-pcie 1ffc000.pcie: phy link never came up
imx6q-pcie 1ffc000.pcie: Failed to bring link up!
imx6q-pcie 1ffc000.pcie: failed to initialize host
adv7180 2-0020: adv7180_read:read reg error: reg=11 ret=-5
mxc_v4l_open: Mxc Camera no sensor ipu0/csi0
mxc_v4l_open: Mxc Camera no sensor ipu1/csi1
mxc_v4l_open: Mxc Camera no sensor ipu1/csi0
mxc_v4l_open: Mxc Camera no sensor ipu0/csi0
update_device_addr: ov5642 ret=-5
ov5642_read_reg:write reg error:reg=300a
update_device_addr: ov5640_mipi ret=-5
ov5640_read_reg(mipi):reg=300a ret=-5
 * Setting sysfs variables... * unknown attribute class/rfkill/rfkill0/state
 * unknown attribute class/rfkill/rfkill0/type
 * unknown attribute class/rfkill/rfkill0/state
 * unknown attribute class/rfkill/rfkill0/type
 [ OK ]
 * Attaching UART to Bluez stack [ OK ]
saned disabled; edit /etc/default/saned
Ubuntu 14.04.5 LTS tengri ttymxc1
tengri login:

 

I have checked the 6x_bootscript file for a possible mistake, but the image having the original 6x script worked fine. The script has been attached herewith. WHat might cause this issue ?

Original Attachment has been moved to: 6x_bootscript.txt.zip

Labels (3)
1 Solution
3,232 Views
gary_bisson
Senior Contributor III

Hi,

The segfault is clearly a galcore issue (mismatch between kernel and libraries). Can you try with the driver inside the kernel but built as a module?

Otherwise, can you try with the Xenial image instead, that is the one I am using with no problem with the external module.

Regards,

Gary

View solution in original post

17 Replies
3,232 Views
tengri
Contributor IV

gary_bisson‌ : Hi thanks very much for all your answers, you've been really helpful throughout the kernel build process. I got the issue solved on the same kernel I am using. As you stated the issue was on galcore. When I build the module, I didn't clone the full repo, instead downloaded the zip package and built it without the checkout of v5.0...... Apart from your input, the comments of the following post were also helpful (Laci Tele's hints):

https://boundarydevices.com/ubuntu-xenial-mx67-boards-august-2016-kernel-4-1-15/ 

Cheers

Anuradha

0 Kudos
Reply
3,232 Views
gary_bisson
Senior Contributor III

Hi,

Our Ubuntu releases use the latest Vivante libraries in order to get of the latest bug fixes and better performances.

The problem is that the built-in Vivante driver doesn't match the latest libraries so it should NOT be used anymore, instead the external module should be built against your kernel.
https://github.com/Freescale/kernel-module-imx-gpu-viv

Regards,

Gary

0 Kudos
Reply
3,232 Views
tengri
Contributor IV

Hello Gary, I cross-compiled the vivant driver (the one in that link) and tried to add it to my running kernel as an external module. This is what I did :

> compiled the vivante driver (galcore.ko)

> moved the build folder to the current (ubuntunized) BDSL board /lib/modules folder and modeprobed it.

cp kernel-module-imx-gpu-viv-src /lib/modules/3.14.52-g952e91e-dirty/kernel/drivers/
ls
Kbuild built-in.o galcore.ko galcore.mod.o hal
Module.symvers config galcore.mod.c galcore.o modules.order
modprobe galcore‍‍‍‍‍‍‍‍‍‍

> nothing appears on the terminal, and the lsmod shows :

Module Size Used by
ov5640_camera_mipi_int 52539 0
ov5642_camera 121573 0
mxc_v4l2_capture 24783 2 ov5642_camera,ov5640_camera_mipi_int
ipu_bg_overlay_sdc 4001 1 mxc_v4l2_capture
ipu_still 1723 1 mxc_v4l2_capture
ipu_prp_enc 4767 1 mxc_v4l2_capture
ipu_csi_enc 2971 1 mxc_v4l2_capture
ipu_fg_overlay_sdc 4881 1 mxc_v4l2_capture
adv7180_tvin 8271 0
v4l2_int_device 1796 4 ov5642_camera,ov5640_camera_mipi_int,adv7180_tvin,mxc_v4l2_capture
gpio_keys 7777 0
usb_f_ecm 5393 1
g_ether 1742 0
usb_f_rndis 11373 2 g_ether
u_ether 8764 3 usb_f_ecm,usb_f_rndis,g_ether
libcomposite 27580 3 usb_f_ecm,usb_f_rndis,g_ether‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

but no record on the galcore.

> I tried with insmod, but the terminal's saying 'the module is already loaded'. rmmod galcore says it's a prebuilt one. So this sounds like I have to disable the built-in vivante driver when kernel is built, doesn't it ? which means a re-building is needed ? 

Thanks

Anuradha

0 Kudos
Reply
3,232 Views
gary_bisson
Senior Contributor III

Hi,

You just need to copy the .ko file, then you need to issue a 'depmod -a' command in order to generate a new list of available module so that the modprobe command works.

We will update the ubuntunizing post to explain how to use modules_install instead of the hack above.

Regards,

Gary

3,232 Views
tengri
Contributor IV

Hi, I checked the galcore version of the prebuilt image (the one works) and it is 5.0.11.33433, while the one in newly built kernel (ubuntunized) is 5.0.11.41671. So it's a newer version of it.

0 Kudos
Reply
3,232 Views
gary_bisson
Senior Contributor III

Hi,

Yes you're right. I thought you were using the 4.1.15 kernel but since it is Trusty it is still 3.14.52, the built-in driver should work.

A couple of remarks:

- You should use the boundary_defconfig, the nitrogen6x one if for kernel 3.10 and below. I'll update the post.

- The boundary_defconfig has the galcore driver unselected, you can try enabling it or leave it unselected and add the driver from the kernel module repo.

Regards,

Gary

0 Kudos
Reply
3,232 Views
tengri
Contributor IV

Hi, I re-built the kernel with boundary_defconfig to see whether I can get one of these displays up. Kernel version is same (3.14.52) and it is with the built in galcore module. It's very strange to notice that at the middle of kernel boot process the 'Ubuntu' logo appears on hdmi display and oscilloscope captures RGB signals (DRDY) for a very short time, after that everything disappears when the OS login comes (in serial console). is it somehow related to the entries in dts ? I am using the same dts and 6x_bootscript which work on prebuilt image. Moreover I don't think the modification appended to mxc_lcdif cause this issue. To be more specific, it is just adding a new lcdif interface with VSYNC and HSYNC modes.

Thanks

0 Kudos
Reply
3,232 Views
gary_bisson
Senior Contributor III

Hi,

Please try with the galcore module instead. Do you see some X11 errors in the X11 log?

Regards,

Gary

0 Kudos
Reply
3,232 Views
tengri
Contributor IV

Hi, the Xorg.0.log looks like this (a pastebian link):

[Bash] Xorg Log in SabreLite IMX6 - Pastebin.com 

Certainly this is different to the one I have noticed in pre-built kernel image. The RGB weight of the fb0 looks incorrect.

[ 24.554] (II) VIVANTE(0): Device preferred mode 'fb0':U:1280x720p-60
[ 24.555] (II) VIVANTE(0): Creating default Display subsection in Screen section
 "Default Screen Section" for depth/fbbpp 16/16
[ 24.555] (==) VIVANTE(0): Depth 16, (==) framebuffer bpp 16
[ 24.555] (==) VIVANTE(0): RGB weight 565

so is this an issue from X11 drivers or from galcore ?

0 Kudos
Reply
3,232 Views
gary_bisson
Senior Contributor III

Hi,

Are you trying with HDMI or LCD now? For the LCD, I can't help you if you have modified the source code. BTW, you can add the timings/interface for any display from U-Boot using the fb_lcd variable.

Regards,

Gary

0 Kudos
Reply
3,232 Views
tengri
Contributor IV

For now getting the HDMI output is more important, so I'd be grateful if you can give some hints on it. I'll take care of the timing issue of the lcd, and the mxc_lcdif modification shouldn't cause any problem to the hdmi functionality. According to your idea, is the issue likely from X11 forwarding ?

Thanks....

0 Kudos
Reply
3,232 Views
gary_bisson
Senior Contributor III

Ok, so please revert all your changes for now and please try with the module instead of the built-in driver.

Regards,

Gary

0 Kudos
Reply
3,232 Views
tengri
Contributor IV

To confirm the make menuconfig settings, here is my .conf content :

[Bash] .conf Content - Pastebin.com 

and specifically on mxc_vivante_gpu :

#
# MXC Vivante GPU support
#
# CONFIG_MXC_GPU_VIV is not set
CONFIG_MXC_IPU_V3=y
# CONFIG_MXC_IPU_V3_PRE is not set

thanks 

0 Kudos
Reply
3,232 Views
tengri
Contributor IV

Here is the startx log, having the same segmentation fault error :

[Bash] startx log - Pastebin.com 

0 Kudos
Reply
3,233 Views
gary_bisson
Senior Contributor III

Hi,

The segfault is clearly a galcore issue (mismatch between kernel and libraries). Can you try with the driver inside the kernel but built as a module?

Otherwise, can you try with the Xenial image instead, that is the one I am using with no problem with the external module.

Regards,

Gary

3,232 Views
tengri
Contributor IV

Hi,

So I did it in two attempts :

1. Build a fresh kernel with modifications in source codes and without built-in galcore. It was installed later as an external module, so the lsmod looks like this :

Module                                        Size          Used by
ov5642_camera                         128537       0
ov5640_camera_mipi_int            54723        0 
mxc_v4l2_capture                       34395        2    ov5642_camera,ov5640_camera_mipi_int
ipu_bg_overlay_sdc                    12697        1    mxc_v4l2_capture
ipu_still                                        12571        1    mxc_v4l2_capture
ipu_prp_enc                                12723        1    mxc_v4l2_capture
tsc2004 12717 0
ov5640_subdev_camera 25610 0
ft5x06_ts 12856 0
ili210x 12677 0
ipu_csi_enc 12723 1 mxc_v4l2_capture
tc358743_h2c_bridge 48224 0
adv7180_tvin 17403 0
ipu_fg_overlay_sdc 12793 1 mxc_v4l2_capture
galcore 213736 0
v4l2_int_device 12688 5 ov5642_camera,ov5640_camera_mipi_int,tc358743_h2c_bridge,adv7180_tvin,mxc_v4l2_capture
egalax_ts 12604 0
gpio_keys 17525 0
usb_f_ecm 13209 1
g_ether 12406 0
usb_f_rndis 18201 2 g_ether
u_ether 17392 3 usb_f_ecm,usb_f_rndis,g_ether
libcomposite 33852 3 usb_f_ecm,usb_f_rndis,g_ether

2. Reverting all the modifications in sources and build kernel without built-in galcore. Added it later to the system and has the same lsmod result. 

In both attempts the Xorg.0.log looks similar and has the segmentation fault error at the end as in the pesbian link. So this doesn't sound like a problem of the galcore, or source modifications. 

Thanks

Anuradha

0 Kudos
Reply
3,232 Views
tengri
Contributor IV

Hi thanks for your input Gary, I did depmod too. But I remember when I built the kernel, in make menuconfig there was an option for vivante gccore and it was already selected (Because of the nitrogen6q defconfig - default configurations I guess). I didn't make any changes to it. So this module must have been created as a prebuilt module to the kernel. So if I am to apply the new external module (galcore in your link) I should disable the default one before the kernel build, am I right ?

I think the blacklisting of the prebuilt module won't also help...... would it ?

Anuradha

0 Kudos
Reply