1

I'm working on raspberry, with raspbian wheezy, for a fun embedded project. For this project, i need to display the project logo on the integrated touchscreen (tontec mz61561) as soon as it is powered.

I managed to do this by working with a custom initramfs, made for launching 1) plymouth, 2) the touchscreen modules (spi_bcm2708) and 3) a program that copy the display from HDMI output to the embeded screen (fbcp). Proudly displaying the logo in a couple of seconds after powering =)

Sadly, i had to dist-upgrade my system (from 4.0.7 to 4.4.27-v7+), and then the trick stopped to work : the touchscreen is loaded after initramfs, so fbcp exit, giving us a black screen.

Here is my former initramfs scripts, placed in init-top section, executable.

#!/bin/sh
PREREQ=""
prereqs()
{
echo "$PREREQ"
}
case $1 in
prereqs)
prereqs
exit 0
;;
esac
modprobe spi_bcm2708
cat /etc/image640.raw >/dev/fb0
/etc/fbcp &
exit 0

Here was the former /initramfs-tools/modules content:

spi_bcm2708
fbtft
fb_s6d02a1

here was the call in config.txt to the touchscreen dtoverlay and to launch the initramfs :

dtoverlay=mz61581,speed=68000000
initramfs initrd.img-4.0.7-v7+
#Now : initramfs initrd.img-4.4.27-v7+

I found by myself that spi_bcm2708 is no more available, lsmod hinted me that spi_bcm2835 seems to be the new module to use. Replacing every occurence of spi_bcm2708 by spi_bcm2835 on my system and on initramfs content didn't solve the issue.

I also checked that no related module was blacklisted, and that no error where logged on deviceTree logs.

Here is how the touchscreen is loaded :

[    4.873550] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[    6.176518] udevd[377]: starting version 175
[    6.631417] bcm2835-wdt 3f100000.watchdog: Broadcom BCM2835 watchdog timer
[    6.800118] bcm2708_i2c 3f804000.i2c: BSC1 Controller at 0x3f804000 (irq 83) (baudrate 100000)
[    6.868206] gpiomem-bcm2835 3f200000.gpiomem: Initialised: Registers at 0x3f200000
[    7.027694] fbtft: module is from the staging directory, the quality is unknown, you have been warned.
[    7.035284] fb_s6d02a1: module is from the staging directory, the quality is unknown, you have been warned.
[    7.036436] fbtft_of_value: width = 320
[    7.036463] fbtft_of_value: height = 480
[    7.036481] fbtft_of_value: buswidth = 8
[    7.036496] fbtft_of_value: debug = 3
[    7.036510] fbtft_of_value: rotate = 270
[    7.036523] fbtft_of_value: fps = 30
[    7.036536] fbtft_of_value: txbuflen = 32768
[    7.037182] fb_s6d02a1 spi0.0: fbtft_request_one_gpio: 'reset-gpios' = GPIO15
[    7.037273] fb_s6d02a1 spi0.0: fbtft_request_one_gpio: 'dc-gpios' = GPIO25
[    7.037357] fb_s6d02a1 spi0.0: fbtft_request_one_gpio: 'led-gpios' = GPIO18
[    7.037577] fb_s6d02a1 spi0.0: fbtft_verify_gpios()
[    7.037614] fb_s6d02a1 spi0.0: fbtft_reset()
[    7.157731] fb_s6d02a1 spi0.0: init: write_register:
[    7.157763] fb_s6d02a1 spi0.0: buf[0] = B0
[    7.157779] fb_s6d02a1 spi0.0: buf[1] = 00
[    7.157950] fb_s6d02a1 spi0.0: init: write_register:
[    7.157974] fb_s6d02a1 spi0.0: buf[0] = 11
[    7.158014] fb_s6d02a1 spi0.0: init: msleep(255)
[    7.418607] fb_s6d02a1 spi0.0: init: write_register:
[    7.418637] fb_s6d02a1 spi0.0: buf[0] = B3
[    7.418654] fb_s6d02a1 spi0.0: buf[1] = 02
[    7.418669] fb_s6d02a1 spi0.0: buf[2] = 00
[    7.418685] fb_s6d02a1 spi0.0: buf[3] = 00
[    7.418700] fb_s6d02a1 spi0.0: buf[4] = 00
[    7.418797] fb_s6d02a1 spi0.0: init: write_register:
[    7.418815] fb_s6d02a1 spi0.0: buf[0] = C0
[    7.418831] fb_s6d02a1 spi0.0: buf[1] = 13
[    7.418846] fb_s6d02a1 spi0.0: buf[2] = 3B
[    7.418861] fb_s6d02a1 spi0.0: buf[3] = 00
[    7.418876] fb_s6d02a1 spi0.0: buf[4] = 02
[    7.418891] fb_s6d02a1 spi0.0: buf[5] = 00
[    7.418906] fb_s6d02a1 spi0.0: buf[6] = 01
[    7.418921] fb_s6d02a1 spi0.0: buf[7] = 00
[    7.418936] fb_s6d02a1 spi0.0: buf[8] = 43
[    7.418993] fb_s6d02a1 spi0.0: init: write_register:
[    7.419010] fb_s6d02a1 spi0.0: buf[0] = C1
[    7.419025] fb_s6d02a1 spi0.0: buf[1] = 08
[    7.419041] fb_s6d02a1 spi0.0: buf[2] = 16
[    7.419056] fb_s6d02a1 spi0.0: buf[3] = 08
[    7.419071] fb_s6d02a1 spi0.0: buf[4] = 08
[    7.419121] fb_s6d02a1 spi0.0: init: write_register:
[    7.419138] fb_s6d02a1 spi0.0: buf[0] = C4
[    7.419153] fb_s6d02a1 spi0.0: buf[1] = 11
[    7.419168] fb_s6d02a1 spi0.0: buf[2] = 07
[    7.419183] fb_s6d02a1 spi0.0: buf[3] = 03
[    7.419198] fb_s6d02a1 spi0.0: buf[4] = 03
[    7.419249] fb_s6d02a1 spi0.0: init: write_register:
[    7.419265] fb_s6d02a1 spi0.0: buf[0] = C6
[    7.419281] fb_s6d02a1 spi0.0: buf[1] = 00
[    7.419329] fb_s6d02a1 spi0.0: init: write_register:
[    7.419345] fb_s6d02a1 spi0.0: buf[0] = C8
[    7.419361] fb_s6d02a1 spi0.0: buf[1] = 03
[    7.419376] fb_s6d02a1 spi0.0: buf[2] = 03
[    7.419392] fb_s6d02a1 spi0.0: buf[3] = 13
[    7.419407] fb_s6d02a1 spi0.0: buf[4] = 5C
[    7.419422] fb_s6d02a1 spi0.0: buf[5] = 03
[    7.419437] fb_s6d02a1 spi0.0: buf[6] = 07
[    7.419452] fb_s6d02a1 spi0.0: buf[7] = 14
[    7.419467] fb_s6d02a1 spi0.0: buf[8] = 08
[    7.419482] fb_s6d02a1 spi0.0: buf[9] = 00
[    7.419497] fb_s6d02a1 spi0.0: buf[10] = 21
[    7.419512] fb_s6d02a1 spi0.0: buf[11] = 08
[    7.419528] fb_s6d02a1 spi0.0: buf[12] = 14
[    7.419543] fb_s6d02a1 spi0.0: buf[13] = 07
[    7.419558] fb_s6d02a1 spi0.0: buf[14] = 53
[    7.419573] fb_s6d02a1 spi0.0: buf[15] = 0C
[    7.419588] fb_s6d02a1 spi0.0: buf[16] = 13
[    7.419603] fb_s6d02a1 spi0.0: buf[17] = 03
[    7.419618] fb_s6d02a1 spi0.0: buf[18] = 03
[    7.419633] fb_s6d02a1 spi0.0: buf[19] = 21
[    7.419648] fb_s6d02a1 spi0.0: buf[20] = 00
[    7.419709] fb_s6d02a1 spi0.0: init: write_register:
[    7.419726] fb_s6d02a1 spi0.0: buf[0] = 35
[    7.419741] fb_s6d02a1 spi0.0: buf[1] = 00
[    7.419788] fb_s6d02a1 spi0.0: init: write_register:
[    7.419805] fb_s6d02a1 spi0.0: buf[0] = 36
[    7.419821] fb_s6d02a1 spi0.0: buf[1] = A0
[    7.419868] fb_s6d02a1 spi0.0: init: write_register:
[    7.419885] fb_s6d02a1 spi0.0: buf[0] = 3A
[    7.419900] fb_s6d02a1 spi0.0: buf[1] = 55
[    7.419948] fb_s6d02a1 spi0.0: init: write_register:
[    7.419965] fb_s6d02a1 spi0.0: buf[0] = 44
[    7.419980] fb_s6d02a1 spi0.0: buf[1] = 00
[    7.419995] fb_s6d02a1 spi0.0: buf[2] = 01
[    7.420043] fb_s6d02a1 spi0.0: init: write_register:
[    7.420060] fb_s6d02a1 spi0.0: buf[0] = D0
[    7.420076] fb_s6d02a1 spi0.0: buf[1] = 07
[    7.420091] fb_s6d02a1 spi0.0: buf[2] = 07
[    7.420106] fb_s6d02a1 spi0.0: buf[3] = 1D
[    7.420122] fb_s6d02a1 spi0.0: buf[4] = 03
[    7.420179] fb_s6d02a1 spi0.0: init: write_register:
[    7.420196] fb_s6d02a1 spi0.0: buf[0] = D1
[    7.420212] fb_s6d02a1 spi0.0: buf[1] = 03
[    7.420227] fb_s6d02a1 spi0.0: buf[2] = 30
[    7.420242] fb_s6d02a1 spi0.0: buf[3] = 10
[    7.420290] fb_s6d02a1 spi0.0: init: write_register:
[    7.420307] fb_s6d02a1 spi0.0: buf[0] = D2
[    7.420322] fb_s6d02a1 spi0.0: buf[1] = 03
[    7.420337] fb_s6d02a1 spi0.0: buf[2] = 14
[    7.420353] fb_s6d02a1 spi0.0: buf[3] = 04
[    7.420401] fb_s6d02a1 spi0.0: init: write_register:
[    7.420417] fb_s6d02a1 spi0.0: buf[0] = 29
[    7.420451] fb_s6d02a1 spi0.0: init: write_register:
[    7.420467] fb_s6d02a1 spi0.0: buf[0] = 2C
[    7.504691] fb_s6d02a1 spi0.0: Display update: 3565 kB/s, fps=0
[    7.505815] graphics fb1: fb_s6d02a1 frame buffer, 480x320, 300 KiB video memory, 32 KiB DMA buffer memory, fps=33, spi0.0 at 68 MHz
[    7.505842] fb_s6d02a1 spi0.0: fbtft_backlight_update_status: polarity=0, power=0, fb_blank=0
[    7.507039] ads7846 spi0.1: touchscreen, irq 170
[    7.507764] input: ADS7846 Touchscreen as /devices/platform/soc/3f204000.spi/spi_master/spi0/spi0.1/input/input1

Here is the result of lsmod, once the screen is loaded :

uvcvideo               72430  0
videobuf2_vmalloc       5187  1 uvcvideo
videobuf2_memops        1268  1 videobuf2_vmalloc
videobuf2_v4l2         16535  1 uvcvideo
videobuf2_core         20861  2 uvcvideo,videobuf2_v4l2
v4l2_common             3929  1 videobuf2_v4l2
videodev              132913  4 uvcvideo,v4l2_common,videobuf2_core,videobuf2_v4l2
media                  11573  2 uvcvideo,videodev
evdev                  11396  0
ads7846                11390  0
fb_s6d02a1              3367  0
hwmon                   2840  1 ads7846
fbtft                  26084  1 fb_s6d02a1
syscopyarea             2945  1 fbtft
sysfillrect             3443  1 fbtft
sysimgblt               2069  1 fbtft
fb_sys_fops             1309  1 fbtft
bcm2835_gpiomem         3040  0
spi_bcm2835             6678  0
i2c_bcm2708             4834  0
bcm2835_wdt             3225  0
uio_pdrv_genirq         3164  0
uio                     8000  1 uio_pdrv_genirq

Am I missing something obvious to make it work, or some method to trace initramfs/deviceTree/Modules errors ?

Thank you :)

Edit relative to comments :

The initramfs is succefully generated via update-initramfs -c -k 'uname -r' -v. Thanks @Rui F Ribeiro for pointing me the other included folder for initramfs, i was sticking to /etc/initramfs-tools.

  • 1
    Have a look at the initramfs-tools package and /usr/share/initramfs-tools. If you edit directly initrd, it will be rewritten next time you regenerate it, as you have already found out. – Rui F Ribeiro Nov 8 '16 at 16:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.