AnsweredAssumed Answered

Postponing framebuffer initialization

Question asked by Isaac Nickaein on Apr 17, 2015
Latest reply on May 18, 2015 by Isaac Nickaein
Branched to a new discussion

I am looking for a way to let an application in userspace choose the device driver for framebuffer device display output on Kernel 3.0.35 for i.MX6Q. I currently have two framebuffer drivers available in the kernel, namely "lcd" and "bt656" (thanks to Qiang for BT1120 patch) and each of them can be selected to be used by UBoot *video_mode* parameter).

 

Apparently the framebuffer initialization happens in very early stages of kernel boot where userspace data is not available. Therefore, solutions like reading the video_mode from a file that is written by the user before is not possible as the filesystem is not available yet.

 

I modified drivers/video/mxc/mxc_ipuv3_fb.c to postpone the display driver initialization. Specifically, I am initializing a custom module instead of mxc driver:

 

int __init mxcfb_init(void)

{

     //return platform_driver_register(&mxcfb_driver);

     return init_mymodule();

}

 

where my custom module are supposed to register the desired mxc driver later with the settings feeded by user (e.g. by a command like cat "mxcfb0:640x480MR-24@60,if=RGB24" > /dev/mymodule).

 

The problem I am facing is that the kernel stuck during boot at "Populating dev cache" (not sure that is related or not). In the following you can find the complete kernel log.

 

Is there any other dependency on mxc driver initialization that should be postponed too?

Also, am I taking the right path to solve this problem?

 

 

 

Starting kernel ...

 

Disabling LCD

[    0.000000] Linux version 3.0.35-karo (isaac@ubuntu) (gcc version 4.7.2 (GCC) ) #69 SMP PREEMPT Sat Apr 18 09:42:52 IRDT 2015

[    0.000000] CPU: ARMv7 Processor [412fc09a] revision 10 (ARMv7), cr=10c53c7d

[    0.000000] CPU: VIPT nonaliasing data cache, VIPT aliasing instruction cache

[    0.000000] Machine: Ka-Ro i.MX6 TX6

[    0.000000] Memory policy: ECC disabled, Data cache writealloc

[    0.000000] CPU identified as i.MX6Q, silicon rev 1.2

[    0.000000] On node 0 totalpages: 229376

[    0.000000] free_area_init_node: node 0, pgdat 8062ab20, node_mem_map 8b800000

[    0.000000]   DMA zone: 368 pages used for memmap

[    0.000000]   DMA zone: 0 pages reserved

[    0.000000]   DMA zone: 46736 pages, LIFO batch:15

[    0.000000]   Normal zone: 1680 pages used for memmap

[    0.000000]   Normal zone: 180592 pages, LIFO batch:31

[    0.000000] PERCPU: Embedded 7 pages/cpu @8c008000 s5440 r8192 d15040 u32768

[    0.000000] pcpu-alloc: s5440 r8192 d15040 u32768 alloc=8*4096

[    0.000000] pcpu-alloc: [0] 0 [0] 1 [0] 2 [0] 3

[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 227328

[    0.000000] Kernel command line: console=ttymxc0,115200 ro debug panic=1 video=mxcfb0:dev=lcd,720P60,if=RGB24 init=/linuxrc ubi.mtd=3 root=ubi0:rootfs rootfstype=ubifs rootwait rw mtdparts=gpmi-nand:1m@128k(u-boot),384k(env),6m(linux),96m(rootfs),256k@72192k(dtb),24064k@105984k(userfs),512k@121600k(bbt) gpmi_debug_init

[    0.000000] PID hash table entries: 4096 (order: 2, 16384 bytes)

[    0.000000] Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)

[    0.000000] Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)

[    0.000000] Memory: 640MB 256MB = 896MB total

[    0.000000] Memory: 901616k/901616k available, 146960k reserved, 0K highmem

[    0.000000] Virtual kernel memory layout:

[    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)

[    0.000000]     fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)

[    0.000000]     DMA     : 0xf4600000 - 0xffe00000   ( 184 MB)

[    0.000000]     vmalloc : 0xc0800000 - 0xf2000000   ( 792 MB)

[    0.000000]     lowmem  : 0x80000000 - 0xc0000000   (1024 MB)

[    0.000000]     pkmap   : 0x7fe00000 - 0x80000000   (   2 MB)

[    0.000000]     modules : 0x7f000000 - 0x7fe00000   (  14 MB)

[    0.000000]       .init : 0x80008000 - 0x80034000   ( 176 kB)

[    0.000000]       .text : 0x80034000 - 0x805d44c4   (5762 kB)

[    0.000000]       .data : 0x805d6000 - 0x8062bc20   ( 344 kB)

[    0.000000]        .bss : 0x8062bc44 - 0x80696c90   ( 429 kB)

[    0.000000] SLUB: Genslabs=13, HWalign=32, Order=0-3, MinObjects=0, CPUs=4, Nodes=1

[    0.000000] Preemptible hierarchical RCU implementation.

[    0.000000]  Verbose stalled-CPUs detection is disabled.

[    0.000000] NR_IRQS:624

[    0.000000] MXC GPIO hardware

[    0.000000] sched_clock: 32 bits at 3000kHz, resolution 333ns, wraps every 1431655ms

[    0.000000] arm_max_freq=1GHz

[    0.000000] MXC_Early serial console at MMIO 0x2020000 (options '115200')

[    0.000000] bootconsole [ttymxc0] enabled

[    0.000000] Console: colour dummy device 80x30

[    0.301052] Calibrating delay loop... 1581.05 BogoMIPS (lpj=7905280)

[    0.389372] pid_max: default: 32768 minimum: 301

[    0.394332] Mount-cache hash table entries: 512

[    0.399674] CPU: Testing write buffer coherency: ok

[    0.505361] CPU1: Booted secondary processor

[    0.635359] CPU2: Booted secondary processor

[    0.715363] CPU3: Booted secondary processor

[    0.754873] Brought up 4 CPUs

[    0.770699] SMP: Total of 4 processors activated (6324.22 BogoMIPS).

[    0.777579] devtmpfs: initialized

[    0.798070] print_constraints: dummy:

[    0.802057] NET: Registered protocol family 16

[    0.810548] print_constraints: vddpu: 725 <--> 1300 mV at 1150 mV fast normal

[    0.818135] print_constraints: vddcore: 725 <--> 1300 mV at 1150 mV fast normal

[    0.825882] print_constraints: vddsoc: 725 <--> 1300 mV at 1200 mV fast normal

[    0.833551] print_constraints: vdd2p5: 2000 <--> 2775 mV at 2400 mV fast normal

[    0.841328] print_constraints: vdd1p1: 800 <--> 1400 mV at 1100 mV fast normal

[    0.848990] print_constraints: vdd3p0: 2625 <--> 3400 mV at 3000 mV fast normal

[    0.869148] L310 cache controller enabled

[    0.873189] l2x0: 16 ways, CACHE_ID 0x410000c7, AUX_CTRL 0x02070000, Cache size: 1048576 B

[    0.898368] bio: create slab <bio-0> at 0

[    0.905841] mxs-dma mxs-dma-apbh: initialized

[    0.910556] print_constraints: VDDA: 2500 mV

[    0.915156] print_constraints: VDDIO: 3300 mV

[    0.919830] print_constraints: VDDD: 1200 mV

[    0.925913] SCSI subsystem initialized

[    0.930065] libata version 3.00 loaded.

[    0.934558] spi_imx imx6q-ecspi.0: probed

[    0.954899] imx-ipuv3 imx-ipuv3.0: IPU DMFC NORMAL mode: 1(0~1), 5B(4,5), 5F(6,7)

[    0.974895] imx-ipuv3 imx-ipuv3.1: IPU DMFC NORMAL mode: 1(0~1), 5B(4,5), 5F(6,7)

[    0.982833] MIPI CSI2 driver module loaded

[    0.987201] Advanced Linux Sound Architecture Driver Version 1.0.24.

[    0.994472] Switching to clocksource mxc_timer1

[    1.014245] NET: Registered protocol family 2

[    1.018805] IP route cache hash table entries: 32768 (order: 5, 131072 bytes)

[    1.026724] TCP established hash table entries: 131072 (order: 8, 1048576 bytes)

[    1.036059] TCP bind hash table entries: 65536 (order: 7, 786432 bytes)

[    1.044122] TCP: Hash tables configured (established 131072 bind 65536)

[    1.050772] TCP reno registered

[    1.053931] UDP hash table entries: 512 (order: 2, 16384 bytes)

[    1.059910] UDP-Lite hash table entries: 512 (order: 2, 16384 bytes)

[    1.066696] NET: Registered protocol family 1

[    1.071461] RPC: Registered named UNIX socket transport module.

[    1.077403] RPC: Registered udp transport module.

[    1.082153] RPC: Registered tcp transport module.

[    1.086873] RPC: Registered tcp NFSv4.1 backchannel transport module.

[    1.094233] PMU: registered new PMU device of type 0

[    1.099586] IMX usb wakeup probe

[    1.102904] the wakeup pdata is 0xbfe8bcc0

[    1.107021] Static Power Management for Freescale i.MX6

[    1.112286] wait mode is enabled for i.MX6

[    1.116581] cpaddr = c0880000 suspend_iram_base=c08ec000

[    1.122028] PM driver module loaded

[    1.125531] cpu regulator mode:ldo_enable

[    1.129759] i.MXC CPU frequency driver

[    1.157316] Registering the id_resolver key type

[    1.163332] JFFS2 version 2.2. (NAND) © 2001-2006 Red Hat, Inc.

[    1.170385] msgmni has been set to 1760

[    1.174780] io scheduler noop registered

[    1.178718] io scheduler deadline registered

[    1.183080] io scheduler cfq registered (default)

[    1.188600] MIPI DSI driver module loaded

[    1.193290] imx-sdma imx-sdma: loaded firmware 1.1

[    1.202622] imx-sdma imx-sdma: initialized

[    1.212324] Serial: IMX driver

[    1.215471] imx-uart.0: ttymxc0 at MMIO 0x2020000 (irq = 58) is a IMX

[    1.221974] console [ttymxc0] enabled, bootconsole disabled

[    1.221974] console [ttymxc0] enabled, bootconsole disabled

[    1.233369] imx-uart.1: ttymxc1 at MMIO 0x21e8000 (irq = 59) is a IMX

[    1.240097] imx-uart.2: ttymxc2 at MMIO 0x21ec000 (irq = 60) is a IMX

[    1.248355] [drm] Initialized drm 1.1.0 20060810

[    1.253483] [drm] Initialized vivante 1.0.0 20120216 on minor 0

[    1.262781] loop: module loaded

[    1.267911] NAND device: Manufacturer ID: 0xec, Chip ID: 0xf1 (Samsung NAND 128MiB 3,3V 8-bit)

[    1.277287] Bad block table found at page 65472, version 0x01

[    1.283703] Bad block table found at page 65408, version 0x01

[    1.290095] nand_read_bbt: Bad block at 0x000000720000

[    1.295236] nand_read_bbt: Bad block at 0x000000f20000

[    1.300396] nand_read_bbt: Bad block at 0x000002d20000

[    1.305539] nand_read_bbt: Bad block at 0x000004d00000

[    1.310753] 7 cmdlinepart partitions found on MTD device gpmi-nand

[    1.316939] Creating 7 MTD partitions on "gpmi-nand":

[    1.322014] 0x000000020000-0x000000120000 : "u-boot"

[    1.327908] 0x000000120000-0x000000180000 : "env"

[    1.333448] 0x000000180000-0x000000780000 : "linux"

[    1.339190] 0x000000780000-0x000006780000 : "rootfs"

[    1.345044] 0x000004680000-0x0000046c0000 : "dtb"

[    1.350619] 0x000006780000-0x000007f00000 : "userfs"

[    1.356462] 0x0000076c0000-0x000007740000 : "bbt"

[    1.362145] GPMI NAND driver registered. (IMX)

[    1.366920] UBI: attaching mtd3 to ubi0

[    1.370780] UBI: physical eraseblock size:   131072 bytes (128 KiB)

[    1.377051] UBI: logical eraseblock size:    126976 bytes

[    1.382463] UBI: smallest flash I/O unit:    2048

[    1.387171] UBI: VID header offset:          2048 (aligned 2048)

[    1.393190] UBI: data offset:                4096

[    2.356245] UBI: max. sequence number:       84

[    2.375744] UBI: attached mtd3 to ubi0

[    2.379515] UBI: MTD device name:            "rootfs"

[    2.384594] UBI: MTD device size:            96 MiB

[    2.389490] UBI: number of good PEBs:        765

[    2.394109] UBI: number of bad PEBs:         3

[    2.398559] UBI: number of corrupted PEBs:   0

[    2.403015] UBI: max. allowed volumes:       128

[    2.407634] UBI: wear-leveling threshold:    4096

[    2.412351] UBI: number of internal volumes: 1

[    2.416796] UBI: number of user volumes:     1

[    2.421254] UBI: available PEBs:             0

[    2.425700] UBI: total number of reserved PEBs: 765

[    2.430589] UBI: number of PEBs reserved for bad PEB handling: 7

[    2.436597] UBI: max/mean erase counter: 2/0

[    2.440878] UBI: image sequence number:  996879656

[    2.445681] UBI: background thread "ubi_bgt0d" started, PID 647

[    2.446702] vcan: Virtual CAN interface driver

[    2.446711] CAN device driver interface

[    2.446716] flexcan netdevice driver

[    2.447586] flexcan imx6q-flexcan.0: device registered (reg_base=c09a8000, irq=142)

[    2.448375] flexcan imx6q-flexcan.1: device registered (reg_base=c09b0000, irq=143)

[    2.448507] FEC Ethernet Driver

[    2.450771] fec_enet_mii_bus: probed

[    2.455345] rtc-ds1307 0-0068: rtc core: registered ds1339 as rtc0

[    2.455940] snvs_rtc snvs_rtc.0: rtc core: registered snvs_rtc as rtc1

[    2.456082] i2c /dev entries driver

[    2.456530] Linux video capture interface: v2.00

[    2.457663] imx2-wdt imx2-wdt.0: IMX2+ Watchdog Timer enabled. timeout=60s (nowayout=1)

[    2.457771] cpuidle: using governor ladder

[    2.457778] cpuidle: using governor menu

[    2.457880] sdhci: Secure Digital Host Controller Interface driver

[    2.457887] sdhci: Copyright(c) Pierre Ossman

[    2.457977] sdhci sdhci-esdhc-imx.0: no write-protect pin available!

[    2.458829] mmc0: no vmmc regulator found

[    2.460740] mmc0: SDHCI controller on platform [sdhci-esdhc-imx.0] using DMA

[    2.460794] sdhci sdhci-esdhc-imx.1: no write-protect pin available!

[    2.461623] mmc1: no vmmc regulator found

[    2.573381] mmc1: SDHCI controller on platform [sdhci-esdhc-imx.1] using DMA

[    2.580821] mxc_vdoa mxc_vdoa: i.MX Video Data Order Adapter(VDOA) driver probed

[    2.588763] VPU initialized

[    2.592517] mxc_asrc registered

[    2.609674] Thermal calibration data is 0x5a351969

[    2.614470] Thermal sensor with ratio = 188

[    2.629084] Anatop Thermal registered as thermal_zone0

[    2.634386] anatop_thermal_probe: default cooling device is cpufreq!

[    2.641049] Registered led device: heartbeat

[    2.648290] sgtl5000 2-000a: sgtl5000 revision 17

[    2.653190] print_constraints: 2-000a: 850 <--> 1600 mV at 1200 mV normal

[    2.712443] asoc: sgtl5000 <-> imx-ssi.1 mapping ok

[    2.717983] ALSA device list:

[    2.720970]   #0: sgtl5000-audio

[    2.724866] TCP cubic registered

[    2.728103] NET: Registered protocol family 17

[    2.732578] can: controller area network core (rev 20090105 abi 8)

[    2.738829] NET: Registered protocol family 29

[    2.743301] can: raw protocol (rev 20090105)

[    2.747574] can: broadcast manager protocol (rev 20090105 t)

[    2.753272] Registering the dns_resolver key type

[    2.759009] VFP support v0.3: implementor 41 architecture 3 part 30 variant 9 rev 4

[    2.767035] Bus freq driver module loaded

[    2.771062] Bus freq driver Enabled

[    2.774610] mxc_dvfs_core_probe

[    2.777911] DVFS driver module loaded

[    2.782570] regulator_init_complete: VDDD: incomplete constraints, leaving on

[    2.791026] rtc-ds1307 0-0068: setting system clock to 2015-04-14 11:39:19 UTC (1429011559)

[    2.875916] UBIFS: recovery needed

[    3.064603] UBIFS: recovery completed

[    3.068489] UBIFS: mounted UBI device 0, volume 0, name "rootfs"

[    3.074516] UBIFS: file system size:   94343168 bytes (92132 KiB, 89 MiB, 743 LEBs)

[    3.082188] UBIFS: journal size:       9023488 bytes (8812 KiB, 8 MiB, 72 LEBs)

[    3.089508] UBIFS: media format:       w4/r0 (latest is w4/r0)

[    3.095363] UBIFS: default compressor: lzo

[    3.099500] UBIFS: reserved for root:  0 bytes (0 KiB)

[    3.108301] VFS: Mounted root (ubifs filesystem) on device 0:12.

[    3.118645] devtmpfs: mounted

[    3.121765] Freeing init memory: 176K

[    3.126197] Failed to execute /linuxrc.  Attempting defaults...

INIT: version 2.88 booting

Starting udev

[    4.509189] udevd[771]: starting version 182

Populating dev cache

Outcomes