hypriot / rpi-kernel

Build a Linux kernel for Raspberry Pi 0/1/2/3/3B+
MIT License
134 stars 46 forks source link

LIRC Overlay not loaded - Dynamic Device Tree flag (DDTK) not set #27

Closed flochtililoch closed 7 years ago

flochtililoch commented 8 years ago

This is a follow up on this issue: https://github.com/raspberrypi/firmware/issues/655

From a fresh install of HypriotOS 1.0, and after running the knlinfo script (https://raw.githubusercontent.com/raspberrypi/linux/rpi-4.4.y/scripts/knlinfo), I get:

Kernel trailer found at 9322496/0x8e4000:
  KVer: "Linux version 4.4.15-hypriotos-v7+ (ubuntu@box211) (gcc version 4.8.3 20140303 (prerelease) (crosstool-NG linaro-1.13.1+bzr2650 - Linaro GCC 2014.03) ) #1 SMP PREEMPT Mon Jul 25 08:46:52 UTC 2016"
  DTOK: y
  DDTK: n
  270X: y
  283X: n
  283x: n

In order for .dtbo overlays to be loaded (as opposed to -overlay.dtb), DDTK should be y Not sure if this is the right place to open this issue, I quickly scoped out the scripts from this repo and haven't found references to a kernel trailer.

StefanScherer commented 8 years ago

@flochtililoch Thank you for investigating the problem. As mentioned in raspberrypi/firmware#655 we should check the arguments for mkknlimg in https://github.com/hypriot/rpi-kernel/blob/2c0172bd2c5c1d626f6734f3dab8e48152db8334/scripts/compile_kernel.sh#L142

StefanScherer commented 8 years ago

Some documentation https://github.com/raspberrypi/documentation/blob/228fb7155665405d3586b581cc3c329d14b4c0fd/configuration/device-tree.md#31-overlays-and-configtxt

and

https://github.com/raspberrypi/tools/blob/648a6eeb1e3c2b40af4eb34d88941ee0edeb3e9a/mkimage/README

Haven't found a script that uses arguments to mkknlimg, but it seems that we need to use --ddtk https://github.com/raspberrypi/linux/blob/12d5fa2dc64a11ac0d2faefeee501f6ed97dbc3b/scripts/mkknlimg#L39-L42

mariuspod commented 7 years ago

hi, I had the same issue with several DS18B20 thermal sensors with dtoverlay=w1-gpio in /boot/config. The kernel modules got loaded without any errors but no devices had shown up in /sys/bus/w1/devices at all, no error messages in the logs.

I've fixed it with the proposed workaround from here to truncate the kernel images so it doesn't contain the trailer anymore since DT should be activated by default on latest kernels and if there's no trailer in it would just activate it.

So now I can query all my 5 thermal sensors 🐼 The hypriot kernel I'm running is: Linux black-pearl 4.4.39-hypriotos+ #2 PREEMPT Sun Dec 18 15:33:58 UTC 2016 armv6l GNU/Linux

@StefanScherer I think the --ddtk flag would fix it as well and I'm happy to test it.

one more thing: hypriot is great! Thanks for that! 👍

StefanScherer commented 7 years ago

ping @DieterReuter PTAL

StefanScherer commented 7 years ago

I have prepared a pull request #36 and some artifacts at https://circleci.com/gh/hypriot/rpi-kernel/45#artifacts/containers/0

After installing them the DDTK shows y.

$ ./knlinfo /boot/kernel.img 
Kernel trailer found at 9546780/0x91ac1c:
  KVer: "Linux version 4.4.50-hypriotos+ (ubuntu@box1211) (gcc version 4.8.3 20140303 (prerelease) (crosstool-NG linaro-1.13.1+bzr2650 - Linaro GCC 2014.03) ) #2 PREEMPT Sun Mar 19 16:08:02 UTC 2017"
  DTOK: y
  DDTK: y
  270X: y
  283X: n
  283x: n

@mariuspod would you like to install the kernel deb files from the CircleCI build and test it if it works for you?

I have tested it with these steps

mkdir ddtk
cd ddtk
wget https://45-32913687-gh.circle-artifacts.com/0/tmp/circle-artifacts.3ba4vbR/libraspberrypi-bin_20170319-145049_armhf.deb
wget https://45-32913687-gh.circle-artifacts.com/0/tmp/circle-artifacts.3ba4vbR/libraspberrypi-dev_20170319-145049_armhf.deb
wget https://45-32913687-gh.circle-artifacts.com/0/tmp/circle-artifacts.3ba4vbR/raspberrypi-bootloader_20170319-145049_armhf.deb
wget https://45-32913687-gh.circle-artifacts.com/0/tmp/circle-artifacts.3ba4vbR/libraspberrypi0_20170319-145049_armhf.deb
wget https://45-32913687-gh.circle-artifacts.com/0/tmp/circle-artifacts.3ba4vbR/raspberrypi-kernel_20170319-145049_armhf.deb

sudo dpkg -i raspberrypi-bootloader_20170319-145049_armhf.deb 
sudo dpkg -i raspberrypi-kernel_20170319-145049_armhf.deb 
sudo dpkg -i libraspberrypi0_20170319-145049_armhf.deb 
sudo dpkg -i libraspberrypi-bin_20170319-145049_armhf.deb 
sudo dpkg -i libraspberrypi-dev_20170319-145049_armhf.deb 
sudo reboot && exit
mariuspod commented 7 years ago

The kernel trailer is looking good 👍

$ ./knlinfo /boot/kernel.img
Kernel trailer found at 9546780/0x91ac1c:
  KVer: "Linux version 4.4.50-hypriotos+ (ubuntu@box1211) (gcc version 4.8.3 20140303 (prerelease) (crosstool-NG linaro-1.13.1+bzr2650 - Linaro GCC 2014.03) ) #2 PREEMPT Sun Mar 19 16:08:02 UTC 2017"
  DTOK: y
  DDTK: y
  270X: y
  283X: n
  283x: n

Will have to test with my temp sensors later this week. Thanks for the fix! 😄

mariuspod commented 7 years ago

@StefanScherer successfully tested with a I2C OLED display with two DT flags in /boot/config.txt:

dtparam=i2c1=on
dtparam=i2c_arm=on
DieterReuter commented 7 years ago

@mariuspod if this is resolved for you now, you could close the issue. 😏

mariuspod commented 7 years ago

not sure I can do it, I wasn't the original issue creator and there's no button. @flochtililoch can you close it ? From me there's a 👍