[PATCH 0/2] [SRU] [X/raspi2] Overlay files don't get applied

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[PATCH 0/2] [SRU] [X/raspi2] Overlay files don't get applied

Paolo Pisati-5
BugLink: https://bugs.launchpad.net/bugs/1703802

Impact:

While working on a bug that involved loading an overlay dtb files upon boot, i
noticed that, no matter what i put in config.txt::dtoverlay=..., no overlay was
loaded at all.

After further investigation i found that recently (~April 2017), the raspberry
BSP changed the overlay files suffix from -overlay.dtb to .dtbo, and while the
upstream bootloader was updated to accept the new scheme, we keep shipping an
older bootloader in the the archive that didn't know about this change.

To make this bug more annoying, the bootloader doesn't emit an error or a
warning if it fails to load an overlay, it silently ignores it and keep going.

Ubuntu core #stable isn't affected by this bug since it's shipping it's own
overlay files in a static tarball (using the old scheme), and #edge (that is
where new daily images are built) is shipping an older kernel with the old
scheme.

While #beta and #candidates should be affected.

Fix:

A way to fix this bug would be to update the raspi2 bootloader to a more recent
version, but since updating it has proven challenging in the past (multiple
images from multiple sources, #updates vs #security, different boot configs,
etc), i'm taking a more straightforward approach by reverting the dtb overlay
files rename back to the previous scheme.

With that said, i'm concurrently opening another LP bug (1703799) because we
must update the bootloader and revert this fix as soon as the new bootloader
lands in the archive.

How to test:

The are different ways you can test this (like modifying the
config.txt::dtoverlay=... parameter and then checking that the corresponding
hardware started to work, but then you would never know if it's a kernel driver
problem, a dtb merge problem, wrong wiring, failing hardware, etc), but the best
way is to use the dtc to dump out the dts structure before and after the
dtoverlay modification and then diff the two:

vanilla image:

$ dtc -I fs -O dts /proc/device-tree > pi3-vanilla.dts

now install the new kernel with the revert (dpkg -i ... or snap install ...),
modify dtoverlay, reboot and dump again:

# echo "dtoverlay=vc4-kms-v3d" >> /boot/firmware/config.txt
# reboot

$ dtc -I fs -O dts /proc/device-tree > pi3-vc4.dts

check if the dtb passed to the kernel has changed:

$ diff -du pi3-vanilla.dts pi3-vc4.dts
[check that there's actually a diff and something sensible was applied]

if you are doing this on ubuntu-core, config.txt is located in
/boot/uboot/config.txt, while if you are doing this in ubuntu classic, remember
to manually copy the overlay files that are shipped with the new kernel:

# rm -rf /boot/firmware/overlays
# cp /lib/firmware/`uname -r`/device-tree/overlays /boot/firmware

Paolo Pisati (2):
  Revert "dts, kbuild: dtbs_install installs .dtbo files too"
  UBUNTU: [SAUCE] Revert "BCM270X_DT: Add a .dtbo target, use for
    overlays" and subsequent

 arch/arm/boot/.gitignore            |   2 +-
 arch/arm/boot/dts/overlays/Makefile | 207 ++++++++++++++++++------------------
 scripts/Makefile.dtbinst            |  10 +-
 scripts/Makefile.lib                |  10 --
 4 files changed, 110 insertions(+), 119 deletions(-)

--
2.7.4


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[PATCH 1/2] Revert "dts, kbuild: dtbs_install installs .dtbo files too"

Paolo Pisati-5
BugLink: https://bugs.launchpad.net/bugs/1703802

This reverts commit 4833c0343531aee507e80771c83c086da7488a71.

Once we land a recent boot firmware in the archive, this commit can be reverted.

Signed-off-by: Paolo Pisati <[hidden email]>
---
 scripts/Makefile.dtbinst | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/scripts/Makefile.dtbinst b/scripts/Makefile.dtbinst
index 43647b3..1c15717 100644
--- a/scripts/Makefile.dtbinst
+++ b/scripts/Makefile.dtbinst
@@ -29,7 +29,6 @@ ifeq ("$(dtbinst-root)", "$(obj)")
 endif
 
 dtbinst-files := $(dtb-y)
-dtboinst-files := $(dtbo-y)
 dtbinst-dirs := $(dts-dirs)
 
 # Helper targets for Installing DTBs into the boot directory
@@ -38,18 +37,15 @@ quiet_cmd_dtb_install = INSTALL $<
 
 install-dir = $(patsubst $(dtbinst-root)%,$(INSTALL_DTBS_PATH)%,$(obj))
 
-$(dtbinst-files) $(dtboinst-files) $(dtbinst-dirs): | __dtbs_install_prep
+$(dtbinst-files) $(dtbinst-dirs): | __dtbs_install_prep
 
 $(dtbinst-files): %.dtb: $(obj)/%.dtb
  $(call cmd,dtb_install,$(install-dir))
 
-$(dtboinst-files): %.dtbo: $(obj)/%.dtbo
- $(call cmd,dtb_install,$(install-dir))
-
 $(dtbinst-dirs):
  $(Q)$(MAKE) $(dtbinst)=$(obj)/$@
 
-PHONY += $(dtbinst-files) $(dtboinst-files) $(dtbinst-dirs)
-__dtbs_install: $(dtbinst-files) $(dtboinst-files) $(dtbinst-dirs)
+PHONY += $(dtbinst-files) $(dtbinst-dirs)
+__dtbs_install: $(dtbinst-files) $(dtbinst-dirs)
 
 .PHONY: $(PHONY)
--
2.7.4


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[PATCH 2/2] UBUNTU: [SAUCE] Revert "BCM270X_DT: Add a .dtbo target, use for overlays" and subsequent

Paolo Pisati-5
In reply to this post by Paolo Pisati-5
BugLink: https://bugs.launchpad.net/bugs/1703802

This is a manual revert of 5b0fbf3a78a4ac18a2f78cdd0f85dc5ddeda31fa, and all
the subsequent modifications to the dtb overlay list - it renames the dtb
overlay files to their previous scheme: .dtbo -> -overlay.dtb - this patch
doesn't introduce any functional change other than this rename.

Once we land a recent boot firmware in the archive, this commit can be reverted.

Signed-off-by: Paolo Pisati <[hidden email]>
---
 arch/arm/boot/.gitignore            |   2 +-
 arch/arm/boot/dts/overlays/Makefile | 207 ++++++++++++++++++------------------
 scripts/Makefile.lib                |  10 --
 3 files changed, 107 insertions(+), 112 deletions(-)

diff --git a/arch/arm/boot/.gitignore b/arch/arm/boot/.gitignore
index eaaeb17..3c79f85 100644
--- a/arch/arm/boot/.gitignore
+++ b/arch/arm/boot/.gitignore
@@ -3,4 +3,4 @@ zImage
 xipImage
 bootpImage
 uImage
-*.dtb*
+*.dtb
diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile
index b13e340..6c41284 100644
--- a/arch/arm/boot/dts/overlays/Makefile
+++ b/arch/arm/boot/dts/overlays/Makefile
@@ -12,109 +12,114 @@ ifeq ($(CONFIG_ARCH_BCM2835),y)
    RPI_DT_OVERLAYS=y
 endif
 
-dtbo-$(RPI_DT_OVERLAYS) += adau1977-adc.dtbo
-dtbo-$(RPI_DT_OVERLAYS) += ads1015.dtbo
-dtbo-$(RPI_DT_OVERLAYS) += ads7846.dtbo
-dtbo-$(RPI_DT_OVERLAYS) += akkordion-iqdacplus.dtbo
-dtbo-$(RPI_DT_OVERLAYS) += allo-piano-dac-pcm512x-audio.dtbo
-dtbo-$(RPI_DT_OVERLAYS) += at86rf233.dtbo
-dtbo-$(RPI_DT_OVERLAYS) += audioinjector-wm8731-audio.dtbo
-dtbo-$(RPI_DT_OVERLAYS) += audremap.dtbo
-dtbo-$(RPI_DT_OVERLAYS) += bmp085_i2c-sensor.dtbo
-dtbo-$(RPI_DT_OVERLAYS) += dht11.dtbo
-dtbo-$(RPI_DT_OVERLAYS) += dionaudio-loco.dtbo
-dtbo-$(RPI_DT_OVERLAYS) += dpi18.dtbo
-dtbo-$(RPI_DT_OVERLAYS) += dpi24.dtbo
-dtbo-$(RPI_DT_OVERLAYS) += dwc-otg.dtbo
-dtbo-$(RPI_DT_OVERLAYS) += dwc2.dtbo
-dtbo-$(RPI_DT_OVERLAYS) += enc28j60.dtbo
-dtbo-$(RPI_DT_OVERLAYS) += enc28j60-spi2.dtbo
-dtbo-$(RPI_DT_OVERLAYS) += gpio-ir.dtbo
-dtbo-$(RPI_DT_OVERLAYS) += gpio-poweroff.dtbo
-dtbo-$(RPI_DT_OVERLAYS) += hifiberry-amp.dtbo
-dtbo-$(RPI_DT_OVERLAYS) += hifiberry-dac.dtbo
-dtbo-$(RPI_DT_OVERLAYS) += hifiberry-dacplus.dtbo
-dtbo-$(RPI_DT_OVERLAYS) += hifiberry-digi.dtbo
-dtbo-$(RPI_DT_OVERLAYS) += hifiberry-digi-pro.dtbo
-dtbo-$(RPI_DT_OVERLAYS) += hy28a.dtbo
-dtbo-$(RPI_DT_OVERLAYS) += hy28b.dtbo
-dtbo-$(RPI_DT_OVERLAYS) += i2c-gpio.dtbo
-dtbo-$(RPI_DT_OVERLAYS) += i2c-mux.dtbo
-dtbo-$(RPI_DT_OVERLAYS) += i2c-pwm-pca9685a.dtbo
-dtbo-$(RPI_DT_OVERLAYS) += i2c-rtc.dtbo
-dtbo-$(RPI_DT_OVERLAYS) += i2c-sensor.dtbo
-dtbo-$(RPI_DT_OVERLAYS) += i2c0-bcm2708.dtbo
-dtbo-$(RPI_DT_OVERLAYS) += i2c1-bcm2708.dtbo
-dtbo-$(RPI_DT_OVERLAYS) += i2s-gpio28-31.dtbo
-dtbo-$(RPI_DT_OVERLAYS) += i2s-mmap.dtbo
-dtbo-$(RPI_DT_OVERLAYS) += iqaudio-dac.dtbo
-dtbo-$(RPI_DT_OVERLAYS) += iqaudio-dacplus.dtbo
-dtbo-$(RPI_DT_OVERLAYS) += iqaudio-digi-wm8804-audio.dtbo
-dtbo-$(RPI_DT_OVERLAYS) += justboom-dac.dtbo
-dtbo-$(RPI_DT_OVERLAYS) += justboom-digi.dtbo
-dtbo-$(RPI_DT_OVERLAYS) += lirc-rpi.dtbo
-dtbo-$(RPI_DT_OVERLAYS) += mcp23017.dtbo
-dtbo-$(RPI_DT_OVERLAYS) += mcp23s17.dtbo
-dtbo-$(RPI_DT_OVERLAYS) += mcp2515-can0.dtbo
-dtbo-$(RPI_DT_OVERLAYS) += mcp2515-can1.dtbo
-dtbo-$(RPI_DT_OVERLAYS) += mcp3008.dtbo
-dtbo-$(RPI_DT_OVERLAYS) += mmc.dtbo
-dtbo-$(RPI_DT_OVERLAYS) += mz61581.dtbo
-dtbo-$(RPI_DT_OVERLAYS) += pi3-act-led.dtbo
-dtbo-$(RPI_DT_OVERLAYS) += pi3-disable-bt.dtbo
-dtbo-$(RPI_DT_OVERLAYS) += pi3-disable-wifi.dtbo
-dtbo-$(RPI_DT_OVERLAYS) += pi3-miniuart-bt.dtbo
-dtbo-$(RPI_DT_OVERLAYS) += piscreen.dtbo
-dtbo-$(RPI_DT_OVERLAYS) += piscreen2r.dtbo
-dtbo-$(RPI_DT_OVERLAYS) += pisound.dtbo
-dtbo-$(RPI_DT_OVERLAYS) += pitft22.dtbo
-dtbo-$(RPI_DT_OVERLAYS) += pitft28-capacitive.dtbo
-dtbo-$(RPI_DT_OVERLAYS) += pitft28-resistive.dtbo
-dtbo-$(RPI_DT_OVERLAYS) += pitft35-resistive.dtbo
-dtbo-$(RPI_DT_OVERLAYS) += pps-gpio.dtbo
-dtbo-$(RPI_DT_OVERLAYS) += pwm.dtbo
-dtbo-$(RPI_DT_OVERLAYS) += pwm-2chan.dtbo
-dtbo-$(RPI_DT_OVERLAYS) += qca7000.dtbo
-dtbo-$(RPI_DT_OVERLAYS) += raspidac3.dtbo
-dtbo-$(RPI_DT_OVERLAYS) += rpi-backlight.dtbo
-dtbo-$(RPI_DT_OVERLAYS) += rpi-dac.dtbo
-dtbo-$(RPI_DT_OVERLAYS) += rpi-display.dtbo
-dtbo-$(RPI_DT_OVERLAYS) += rpi-ft5406.dtbo
-dtbo-$(RPI_DT_OVERLAYS) += rpi-proto.dtbo
-dtbo-$(RPI_DT_OVERLAYS) += rpi-sense.dtbo
-dtbo-$(RPI_DT_OVERLAYS) += rra-digidac1-wm8741-audio.dtbo
-dtbo-$(RPI_DT_OVERLAYS) += sc16is750-i2c.dtbo
-dtbo-$(RPI_DT_OVERLAYS) += sc16is752-spi1.dtbo
-dtbo-$(RPI_DT_OVERLAYS) += sdhost.dtbo
-dtbo-$(RPI_DT_OVERLAYS) += sdio.dtbo
-dtbo-$(RPI_DT_OVERLAYS) += sdio-1bit.dtbo
-dtbo-$(RPI_DT_OVERLAYS) += sdtweak.dtbo
-dtbo-$(RPI_DT_OVERLAYS) += smi.dtbo
-dtbo-$(RPI_DT_OVERLAYS) += smi-dev.dtbo
-dtbo-$(RPI_DT_OVERLAYS) += smi-nand.dtbo
-dtbo-$(RPI_DT_OVERLAYS) += spi-gpio35-39.dtbo
-dtbo-$(RPI_DT_OVERLAYS) += spi-rtc.dtbo
-dtbo-$(RPI_DT_OVERLAYS) += spi0-cs.dtbo
-dtbo-$(RPI_DT_OVERLAYS) += spi0-hw-cs.dtbo
-dtbo-$(RPI_DT_OVERLAYS) += spi1-1cs.dtbo
-dtbo-$(RPI_DT_OVERLAYS) += spi1-2cs.dtbo
-dtbo-$(RPI_DT_OVERLAYS) += spi1-3cs.dtbo
-dtbo-$(RPI_DT_OVERLAYS) += spi2-1cs.dtbo
-dtbo-$(RPI_DT_OVERLAYS) += spi2-2cs.dtbo
-dtbo-$(RPI_DT_OVERLAYS) += spi2-3cs.dtbo
-dtbo-$(RPI_DT_OVERLAYS) += tinylcd35.dtbo
-dtbo-$(RPI_DT_OVERLAYS) += uart1.dtbo
-dtbo-$(RPI_DT_OVERLAYS) += vc4-fkms-v3d.dtbo
-dtbo-$(RPI_DT_OVERLAYS) += vc4-kms-v3d.dtbo
-dtbo-$(RPI_DT_OVERLAYS) += vga666.dtbo
-dtbo-$(RPI_DT_OVERLAYS) += w1-gpio.dtbo
-dtbo-$(RPI_DT_OVERLAYS) += w1-gpio-pullup.dtbo
-dtbo-$(RPI_DT_OVERLAYS) += wittypi.dtbo
+dtb-$(RPI_DT_OVERLAYS) += adau1977-adc-overlay.dtb
+dtb-$(RPI_DT_OVERLAYS) += ads1015-overlay.dtb
+dtb-$(RPI_DT_OVERLAYS) += ads7846-overlay.dtb
+dtb-$(RPI_DT_OVERLAYS) += akkordion-iqdacplus-overlay.dtb
+dtb-$(RPI_DT_OVERLAYS) += allo-piano-dac-pcm512x-audio-overlay.dtb
+dtb-$(RPI_DT_OVERLAYS) += at86rf233-overlay.dtb
+dtb-$(RPI_DT_OVERLAYS) += audioinjector-wm8731-audio-overlay.dtb
+dtb-$(RPI_DT_OVERLAYS) += audremap-overlay.dtb
+dtb-$(RPI_DT_OVERLAYS) += bmp085_i2c-sensor-overlay.dtb
+dtb-$(RPI_DT_OVERLAYS) += dht11-overlay.dtb
+dtb-$(RPI_DT_OVERLAYS) += dionaudio-loco-overlay.dtb
+dtb-$(RPI_DT_OVERLAYS) += dpi18-overlay.dtb
+dtb-$(RPI_DT_OVERLAYS) += dpi24-overlay.dtb
+dtb-$(RPI_DT_OVERLAYS) += dwc-otg-overlay.dtb
+dtb-$(RPI_DT_OVERLAYS) += dwc2-overlay.dtb
+dtb-$(RPI_DT_OVERLAYS) += enc28j60-overlay.dtb
+dtb-$(RPI_DT_OVERLAYS) += enc28j60-spi2-overlay.dtb
+dtb-$(RPI_DT_OVERLAYS) += gpio-ir-overlay.dtb
+dtb-$(RPI_DT_OVERLAYS) += gpio-poweroff-overlay.dtb
+dtb-$(RPI_DT_OVERLAYS) += hifiberry-amp-overlay.dtb
+dtb-$(RPI_DT_OVERLAYS) += hifiberry-dac-overlay.dtb
+dtb-$(RPI_DT_OVERLAYS) += hifiberry-dacplus-overlay.dtb
+dtb-$(RPI_DT_OVERLAYS) += hifiberry-digi-overlay.dtb
+dtb-$(RPI_DT_OVERLAYS) += hifiberry-digi-pro-overlay.dtb
+dtb-$(RPI_DT_OVERLAYS) += hy28a-overlay.dtb
+dtb-$(RPI_DT_OVERLAYS) += hy28b-overlay.dtb
+dtb-$(RPI_DT_OVERLAYS) += i2c-gpio-overlay.dtb
+dtb-$(RPI_DT_OVERLAYS) += i2c-mux-overlay.dtb
+dtb-$(RPI_DT_OVERLAYS) += i2c-pwm-pca9685a-overlay.dtb
+dtb-$(RPI_DT_OVERLAYS) += i2c-rtc-overlay.dtb
+dtb-$(RPI_DT_OVERLAYS) += i2c-sensor-overlay.dtb
+dtb-$(RPI_DT_OVERLAYS) += i2c0-bcm2708-overlay.dtb
+dtb-$(RPI_DT_OVERLAYS) += i2c1-bcm2708-overlay.dtb
+dtb-$(RPI_DT_OVERLAYS) += i2s-gpio28-31-overlay.dtb
+dtb-$(RPI_DT_OVERLAYS) += i2s-mmap-overlay.dtb
+dtb-$(RPI_DT_OVERLAYS) += iqaudio-dac-overlay.dtb
+dtb-$(RPI_DT_OVERLAYS) += iqaudio-dacplus-overlay.dtb
+dtb-$(RPI_DT_OVERLAYS) += iqaudio-digi-wm8804-audio-overlay.dtb
+dtb-$(RPI_DT_OVERLAYS) += justboom-dac-overlay.dtb
+dtb-$(RPI_DT_OVERLAYS) += justboom-digi-overlay.dtb
+dtb-$(RPI_DT_OVERLAYS) += lirc-rpi-overlay.dtb
+dtb-$(RPI_DT_OVERLAYS) += mcp23017-overlay.dtb
+dtb-$(RPI_DT_OVERLAYS) += mcp23s17-overlay.dtb
+dtb-$(RPI_DT_OVERLAYS) += mcp2515-can0-overlay.dtb
+dtb-$(RPI_DT_OVERLAYS) += mcp2515-can1-overlay.dtb
+dtb-$(RPI_DT_OVERLAYS) += mcp3008-overlay.dtb
+dtb-$(RPI_DT_OVERLAYS) += mmc-overlay.dtb
+dtb-$(RPI_DT_OVERLAYS) += mz61581-overlay.dtb
+dtb-$(RPI_DT_OVERLAYS) += pi3-act-led-overlay.dtb
+dtb-$(RPI_DT_OVERLAYS) += pi3-disable-bt-overlay.dtb
+dtb-$(RPI_DT_OVERLAYS) += pi3-disable-wifi-overlay.dtb
+dtb-$(RPI_DT_OVERLAYS) += pi3-miniuart-bt-overlay.dtb
+dtb-$(RPI_DT_OVERLAYS) += piscreen-overlay.dtb
+dtb-$(RPI_DT_OVERLAYS) += piscreen2r-overlay.dtb
+dtb-$(RPI_DT_OVERLAYS) += pisound-overlay.dtb
+dtb-$(RPI_DT_OVERLAYS) += pitft22-overlay.dtb
+dtb-$(RPI_DT_OVERLAYS) += pitft28-capacitive-overlay.dtb
+dtb-$(RPI_DT_OVERLAYS) += pitft28-resistive-overlay.dtb
+dtb-$(RPI_DT_OVERLAYS) += pitft35-resistive-overlay.dtb
+dtb-$(RPI_DT_OVERLAYS) += pps-gpio-overlay.dtb
+dtb-$(RPI_DT_OVERLAYS) += pwm-overlay.dtb
+dtb-$(RPI_DT_OVERLAYS) += pwm-2chan-overlay.dtb
+dtb-$(RPI_DT_OVERLAYS) += qca7000-overlay.dtb
+dtb-$(RPI_DT_OVERLAYS) += raspidac3-overlay.dtb
+dtb-$(RPI_DT_OVERLAYS) += rpi-backlight-overlay.dtb
+dtb-$(RPI_DT_OVERLAYS) += rpi-dac-overlay.dtb
+dtb-$(RPI_DT_OVERLAYS) += rpi-display-overlay.dtb
+dtb-$(RPI_DT_OVERLAYS) += rpi-ft5406-overlay.dtb
+dtb-$(RPI_DT_OVERLAYS) += rpi-proto-overlay.dtb
+dtb-$(RPI_DT_OVERLAYS) += rpi-sense-overlay.dtb
+dtb-$(RPI_DT_OVERLAYS) += rra-digidac1-wm8741-audio-overlay.dtb
+dtb-$(RPI_DT_OVERLAYS) += sc16is750-i2c-overlay.dtb
+dtb-$(RPI_DT_OVERLAYS) += sc16is752-spi1-overlay.dtb
+dtb-$(RPI_DT_OVERLAYS) += sdhost-overlay.dtb
+dtb-$(RPI_DT_OVERLAYS) += sdio-overlay.dtb
+dtb-$(RPI_DT_OVERLAYS) += sdio-1bit-overlay.dtb
+dtb-$(RPI_DT_OVERLAYS) += sdtweak-overlay.dtb
+dtb-$(RPI_DT_OVERLAYS) += smi-overlay.dtb
+dtb-$(RPI_DT_OVERLAYS) += smi-dev-overlay.dtb
+dtb-$(RPI_DT_OVERLAYS) += smi-nand-overlay.dtb
+dtb-$(RPI_DT_OVERLAYS) += spi-gpio35-39-overlay.dtb
+dtb-$(RPI_DT_OVERLAYS) += spi-rtc-overlay.dtb
+dtb-$(RPI_DT_OVERLAYS) += spi0-cs-overlay.dtb
+dtb-$(RPI_DT_OVERLAYS) += spi0-hw-cs-overlay.dtb
+dtb-$(RPI_DT_OVERLAYS) += spi1-1cs-overlay.dtb
+dtb-$(RPI_DT_OVERLAYS) += spi1-2cs-overlay.dtb
+dtb-$(RPI_DT_OVERLAYS) += spi1-3cs-overlay.dtb
+dtb-$(RPI_DT_OVERLAYS) += spi2-1cs-overlay.dtb
+dtb-$(RPI_DT_OVERLAYS) += spi2-2cs-overlay.dtb
+dtb-$(RPI_DT_OVERLAYS) += spi2-3cs-overlay.dtb
+dtb-$(RPI_DT_OVERLAYS) += tinylcd35-overlay.dtb
+dtb-$(RPI_DT_OVERLAYS) += uart1-overlay.dtb
+dtb-$(RPI_DT_OVERLAYS) += vc4-fkms-v3d-overlay.dtb
+dtb-$(RPI_DT_OVERLAYS) += vc4-kms-v3d-overlay.dtb
+dtb-$(RPI_DT_OVERLAYS) += vga666-overlay.dtb
+dtb-$(RPI_DT_OVERLAYS) += w1-gpio-overlay.dtb
+dtb-$(RPI_DT_OVERLAYS) += w1-gpio-pullup-overlay.dtb
+dtb-$(RPI_DT_OVERLAYS) += wittypi-overlay.dtb
 
 targets += dtbs dtbs_install
-targets += $(dtbo-y)
+targets += $(dtb-y)
 
 endif
 
-always := $(dtbo-y)
-clean-files := *.dtbo
+always := $(dtb-y)
+clean-files := *.dtb
+
+# Enable fixups to support overlays on BCM2708 platforms
+ifeq ($(RPI_DT_OVERLAYS),y)
+ DTC_FLAGS ?= -@
+endif
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 3079c4fd..79e8661 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -292,16 +292,6 @@ cmd_dtc = mkdir -p $(dir ${dtc-tmp}) ; \
 $(obj)/%.dtb: $(src)/%.dts FORCE
  $(call if_changed_dep,dtc)
 
-quiet_cmd_dtco = DTCO    $@
-cmd_dtco = $(CPP) $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) $< ; \
- $(objtree)/scripts/dtc/dtc -@ -H epapr -O dtb -o $@ -b 0 \
- -i $(dir $<) $(DTC_FLAGS) \
- -d $(depfile).dtc.tmp $(dtc-tmp) ; \
- cat $(depfile).pre.tmp $(depfile).dtc.tmp > $(depfile)
-
-$(obj)/%.dtbo: $(src)/%-overlay.dts FORCE
- $(call if_changed_dep,dtco)
-
 dtc-tmp = $(subst $(comma),_,$(dot-target).dts.tmp)
 
 # Bzip2
--
2.7.4


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

ACK: [PATCH 0/2] [SRU] [X/raspi2] Overlay files don't get applied

Stefan Bader-2
In reply to this post by Paolo Pisati-5
On 12.07.2017 12:41, Paolo Pisati wrote:

> BugLink: https://bugs.launchpad.net/bugs/1703802
>
> Impact:
>
> While working on a bug that involved loading an overlay dtb files upon boot, i
> noticed that, no matter what i put in config.txt::dtoverlay=..., no overlay was
> loaded at all.
>
> After further investigation i found that recently (~April 2017), the raspberry
> BSP changed the overlay files suffix from -overlay.dtb to .dtbo, and while the
> upstream bootloader was updated to accept the new scheme, we keep shipping an
> older bootloader in the the archive that didn't know about this change.
>
> To make this bug more annoying, the bootloader doesn't emit an error or a
> warning if it fails to load an overlay, it silently ignores it and keep going.
>
> Ubuntu core #stable isn't affected by this bug since it's shipping it's own
> overlay files in a static tarball (using the old scheme), and #edge (that is
> where new daily images are built) is shipping an older kernel with the old
> scheme.
>
> While #beta and #candidates should be affected.
>
> Fix:
>
> A way to fix this bug would be to update the raspi2 bootloader to a more recent
> version, but since updating it has proven challenging in the past (multiple
> images from multiple sources, #updates vs #security, different boot configs,
> etc), i'm taking a more straightforward approach by reverting the dtb overlay
> files rename back to the previous scheme.
>
> With that said, i'm concurrently opening another LP bug (1703799) because we
> must update the bootloader and revert this fix as soon as the new bootloader
> lands in the archive.
>
> How to test:
>
> The are different ways you can test this (like modifying the
> config.txt::dtoverlay=... parameter and then checking that the corresponding
> hardware started to work, but then you would never know if it's a kernel driver
> problem, a dtb merge problem, wrong wiring, failing hardware, etc), but the best
> way is to use the dtc to dump out the dts structure before and after the
> dtoverlay modification and then diff the two:
>
> vanilla image:
>
> $ dtc -I fs -O dts /proc/device-tree > pi3-vanilla.dts
>
> now install the new kernel with the revert (dpkg -i ... or snap install ...),
> modify dtoverlay, reboot and dump again:
>
> # echo "dtoverlay=vc4-kms-v3d" >> /boot/firmware/config.txt
> # reboot
>
> $ dtc -I fs -O dts /proc/device-tree > pi3-vc4.dts
>
> check if the dtb passed to the kernel has changed:
>
> $ diff -du pi3-vanilla.dts pi3-vc4.dts
> [check that there's actually a diff and something sensible was applied]
>
> if you are doing this on ubuntu-core, config.txt is located in
> /boot/uboot/config.txt, while if you are doing this in ubuntu classic, remember
> to manually copy the overlay files that are shipped with the new kernel:
>
> # rm -rf /boot/firmware/overlays
> # cp /lib/firmware/`uname -r`/device-tree/overlays /boot/firmware
>
> Paolo Pisati (2):
>   Revert "dts, kbuild: dtbs_install installs .dtbo files too"
>   UBUNTU: [SAUCE] Revert "BCM270X_DT: Add a .dtbo target, use for
>     overlays" and subsequent
>
>  arch/arm/boot/.gitignore            |   2 +-
>  arch/arm/boot/dts/overlays/Makefile | 207 ++++++++++++++++++------------------
>  scripts/Makefile.dtbinst            |  10 +-
>  scripts/Makefile.lib                |  10 --
>  4 files changed, 110 insertions(+), 119 deletions(-)
>
Acked-by: Stefan Bader <[hidden email]>



--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team

signature.asc (836 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

ACK: [PATCH 0/2] [SRU] [X/raspi2] Overlay files don't get applied

Kleber Souza
In reply to this post by Paolo Pisati-5
On 07/12/17 12:41, Paolo Pisati wrote:

> BugLink: https://bugs.launchpad.net/bugs/1703802
>
> Impact:
>
> While working on a bug that involved loading an overlay dtb files upon boot, i
> noticed that, no matter what i put in config.txt::dtoverlay=..., no overlay was
> loaded at all.
>
> After further investigation i found that recently (~April 2017), the raspberry
> BSP changed the overlay files suffix from -overlay.dtb to .dtbo, and while the
> upstream bootloader was updated to accept the new scheme, we keep shipping an
> older bootloader in the the archive that didn't know about this change.
>
> To make this bug more annoying, the bootloader doesn't emit an error or a
> warning if it fails to load an overlay, it silently ignores it and keep going.
>
> Ubuntu core #stable isn't affected by this bug since it's shipping it's own
> overlay files in a static tarball (using the old scheme), and #edge (that is
> where new daily images are built) is shipping an older kernel with the old
> scheme.
>
> While #beta and #candidates should be affected.
>
> Fix:
>
> A way to fix this bug would be to update the raspi2 bootloader to a more recent
> version, but since updating it has proven challenging in the past (multiple
> images from multiple sources, #updates vs #security, different boot configs,
> etc), i'm taking a more straightforward approach by reverting the dtb overlay
> files rename back to the previous scheme.
>
> With that said, i'm concurrently opening another LP bug (1703799) because we
> must update the bootloader and revert this fix as soon as the new bootloader
> lands in the archive.
>
> How to test:
>
> The are different ways you can test this (like modifying the
> config.txt::dtoverlay=... parameter and then checking that the corresponding
> hardware started to work, but then you would never know if it's a kernel driver
> problem, a dtb merge problem, wrong wiring, failing hardware, etc), but the best
> way is to use the dtc to dump out the dts structure before and after the
> dtoverlay modification and then diff the two:
>
> vanilla image:
>
> $ dtc -I fs -O dts /proc/device-tree > pi3-vanilla.dts
>
> now install the new kernel with the revert (dpkg -i ... or snap install ...),
> modify dtoverlay, reboot and dump again:
>
> # echo "dtoverlay=vc4-kms-v3d" >> /boot/firmware/config.txt
> # reboot
>
> $ dtc -I fs -O dts /proc/device-tree > pi3-vc4.dts
>
> check if the dtb passed to the kernel has changed:
>
> $ diff -du pi3-vanilla.dts pi3-vc4.dts
> [check that there's actually a diff and something sensible was applied]
>
> if you are doing this on ubuntu-core, config.txt is located in
> /boot/uboot/config.txt, while if you are doing this in ubuntu classic, remember
> to manually copy the overlay files that are shipped with the new kernel:
>
> # rm -rf /boot/firmware/overlays
> # cp /lib/firmware/`uname -r`/device-tree/overlays /boot/firmware
>
> Paolo Pisati (2):
>   Revert "dts, kbuild: dtbs_install installs .dtbo files too"
>   UBUNTU: [SAUCE] Revert "BCM270X_DT: Add a .dtbo target, use for
>     overlays" and subsequent
>
>  arch/arm/boot/.gitignore            |   2 +-
>  arch/arm/boot/dts/overlays/Makefile | 207 ++++++++++++++++++------------------
>  scripts/Makefile.dtbinst            |  10 +-
>  scripts/Makefile.lib                |  10 --
>  4 files changed, 110 insertions(+), 119 deletions(-)
>

Acked-by: Kleber Sacilotto de Souza <[hidden email]>

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

APPLIED: [PATCH 0/2] [SRU] [X/raspi2] Overlay files don't get applied

Kleber Souza
In reply to this post by Paolo Pisati-5
Applied on xenial/raspi2 branch.

Thanks,
Kleber

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Loading...