Bug#911443: raspi3-firmware | Add board-specific firmware files for RPi 3B+ WiFi (!1)

2018-12-02 Thread Matthias Luescher
Hi Stefan


> So after fixing the polarity of the wifi-reset everything works as
> expected.
>
> - reset-gpios = <&expgpio 1 GPIO_ACTIVE_HIGH>;
> + reset-gpios = <&expgpio 1 GPIO_ACTIVE_LOW>;
>
> I think this should be acceptable as a stable fix for 4.19 LTS.
>

Great!

I applied the same change to arch/arm/boot/dts/bcm2837-rpi-3-b-plus.dts and
now it also works on the Raspberry Pi 3 B+.

Many thanks!!!

Best regards
Matthias


Bug#911443: raspi3-firmware | Add board-specific firmware files for RPi 3B+ WiFi (!1)

2018-12-01 Thread Matthias Luescher
Hi Stefan

> i want to play safe. Could you please check the Rev of your 3 B board?
> You can find it on the upside of the PCB below the GPIO pin header (e.g.
i have Rev 1.2).

Mine is also a "Raspberry Pi 3 Model B V1.2".

> Could you please provide a complete dmesg in case wlan0 is absent?

Here is the dmesg without wlan0:
https://drive.google.com/open?id=1O-aYZreN_7ziHiVsxMc-zNoMAwKLB-UV

And here is one with wlan0:
https://drive.google.com/open?id=1rD2BcEbxjxrpyrXqRglkyS3t1VkCXJ6l

> Could you please change your config to:
> CONFIG_MMC_SDHCI_IPROC=y

This change does indeed make wlan0 appear! Unfortunately this is probably
not a viable solution for the (generic) arm64 Debian kernel.

Many thanks already for your great support!

Best regards
Matthias


Bug#911443: raspi3-firmware | Add board-specific firmware files for RPi 3B+ WiFi (!1)

2018-11-30 Thread Matthias Luescher
Hi Stefan

> Which RPi 3 variant do you use (B or B+)?

Today I have tested on the Raspberry Pi 3 B with arm64.

I was able to reproduce it also with kernel 4.19.5. wlan0 remains absent
with this newer kernel version.
Based on 4.19.5 I reverted commit b1b8f45b3130dbd8704e5ea0d82b49b1d929498e
and then wlan0 was back.

 > Could you please provide a reduced kernel config?

Here is more information:

Kernel configuration:
https://drive.google.com/open?id=1ZI3MeGB2fkYMsEjzGQYXUk2wqr0h9h7R

linux-image-4.19.5-v8_4.19.5-v8-1_arm64.deb (wlan0 is absent):
https://drive.google.com/open?id=1QCNZcpxeeCBGNb0dsZBBZD9i2Y1kCeib

dtb with b1b8f45b3130dbd8704e5ea0d82b49b1d929498e reverted (wlan0 is back):
https://drive.google.com/open?id=11O0c-StAUvV7IXFIs1UBlzeu-CTP3KVt

 > Is armhf (32 bit) affected, too?

I think so - but I did not test it yet.

Best regards
Matthias


Bug#911443: raspi3-firmware | Add board-specific firmware files for RPi 3B+ WiFi (!1)

2018-11-29 Thread Matthias Luescher
Hi Gunnar

I must say, I have not been able to find WiFi (not even a "firmware
> required" message). Could you help me find it, so it makes its way into
> raspi3-image-spec ? Thanks -
> I'm closing this MR.
>

I have also struggled with WiFi. Could the "missing WiFi" issue be related
to https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=911443?
The WiFi (wlan0) reappears if I combine the 4.18 kernel with the device
tree binary of the 4.17 kernel.
The device tree change causing the absence of wlan0 might be this one:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/arch/arm/boot/dts/bcm2837-rpi-3-b.dts?h=v4.20-rc4&id=b1b8f45b3130dbd8704e5ea0d82b49b1d929498e

@Stefan and @Eric: As you are the experts here: Can you give us a clue why
the wlan0 interface disappears if we take the latest device tree binary
from 4.18 vanilla kernel?

Best regards
Matthias

>


Bug#910790: [Pkg-raspi-maintainers] Bug#910790: Bug#910790: Testing the proposal

2018-10-16 Thread Matthias Luescher
Hi

I have updated the proposal according to your findings:
https://salsa.debian.org/lueschem-guest/raspi3-firmware/tree/bugfix/hook_ordering

Best regards
Matthias


Bug#910790: [Pkg-raspi-maintainers] Bug#910790: Testing the proposal

2018-10-16 Thread Matthias Luescher
Very good point - I should rather move the hook files instead of deleting
the old ones. I will try it later today.

Furthermore it would eventually be possible to separate such customization
into a separate hook file (e.g. z55-.).

Best regards
Matthias


Bug#910790: [Pkg-raspi-maintainers] Bug#910790: Acknowledgement (new initrd file was not found)

2018-10-11 Thread Matthias Luescher
Hi

Here is my proposal to fix the issue:
https://salsa.debian.org/lueschem-guest/raspi3-firmware/commit/58d7fec1a6e695371f0ed15b82560421e82f0d94

Best regards
Matthias

Am Do., 11. Okt. 2018 um 12:45 Uhr schrieb Santiago Garcia Mantinan <
ma...@debian.org>:

> Hi again!
>
> After that install of the kernel I tried a reinstall via...
> # apt-get install --reinstall linux-image-4.18.0-2-arm64
> Lendo as listas de paquetes... Feito
> Construindo a árbore de dependencias
> Lendo a información do estado... Feito
> 0 anovados, 0 instalados, 1 reinstalados, Vanse retirar 0 e deixar 51
> sen anovar.
> Ten que recibir 0 B/36,5 MB de arquivos.
> Despois desta operación ocuparanse 0 B de disco adicionais.
> (A ler a base de datos ... 31785 files and directories currently
> installed.)
> Preparing to unpack .../linux-image-4.18.0-2-arm64_4.18.10-2_arm64.deb ...
> Unpacking linux-image-4.18.0-2-arm64 (4.18.10-2) over (4.18.10-2) ...
> A configurar linux-image-4.18.0-2-arm64 (4.18.10-2) ...
> /etc/kernel/postinst.d/initramfs-tools:
> update-initramfs: Generating /boot/initrd.img-4.18.0-2-arm64
> raspi3-firmware: deferring update via initramfs-tools (hook will be
> called later by the kernel
>
> What I saw there was that the propagation to /boot/firmware had been
> done by raspi3-firmware before the update-initramfs had built the new
> initrd and later the new initrd is not propagated to firmware, so I
> ended up with an older -2 initrd on the firmware dir.
>
> Regards.
> --
> Manty/BestiaTester -> http://manty.net
>
> ___
> Pkg-raspi-maintainers mailing list
> pkg-raspi-maintain...@alioth-lists.debian.net
>
> https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/pkg-raspi-maintainers
>


Bug#848101: [Pkg-raspi-maintainers] Bug#848101: Bug#848101: cmdline.txt and config.txt overwritten with each initramfs update

2018-03-20 Thread Matthias Luescher
Hi

I think we should rename our hook from “raspi3-firmware” to
> “50raspi3-firmware”. update-initramfs uses run-parts(8) to invoke hooks, so
> you could then ship a hook with a higher number which would be guaranteed
> to run after the raspi3-firmware hook.
>
> Let me know if that sounds good, and I’ll prepare a package upload.
>

This sounds like a good option. I was also thinking of solutions and my
idea was the following:

Put a template for cmdline.txt and config.txt (e.g cmdline.txt.in and
config.txt.in) somewhere in the /etc folder (e.g. /etc/raspi3-firmware).
Within the template there are keywords that the raspi3-firmware hook (or
better 50-raspi3-firmware) will replace (sed) when it generates the files
for /boot/firmware.

An advanced user can then customize the templates in the /etc folder and
since those are config files the modified templates will not get
overwritten during a package update. Upon the next generation of the config
files the new templates will get applied.

This is still a bit cumbersome compared to the offerings of e.g. grub2. But
I guess it is a (too) big effort to reach the level of grub2.

Best regards
Matthias


Bug#887062: raspi3-firmware: postinst fails, makes bad assumption about existence of /boot/firmware/

2018-01-19 Thread Matthias Luescher
I also came across that issue when building images using my tool called edi
using the edi-pi project configuration:
https://github.com/lueschem/edi-pi

I suggest the following fix (it also covers the case where a container is
taken instead of a chroot):

>From 73d8a0c4a6cbe082ae31f81dc6af7031b5007c54 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Matthias=20L=C3=BCscher?= 
Date: Sun, 14 Jan 2018 17:27:48 +0100
Subject: [PATCH 1/5] Do not check mount point if virtualization gets
detected.

---
 debian/kernel/postinst.d/raspi3-firmware | 12 +++-
 debian/raspi3-firmware.postinst  | 14 +-
 2 files changed, 16 insertions(+), 10 deletions(-)

diff --git a/debian/kernel/postinst.d/raspi3-firmware
b/debian/kernel/postinst.d/raspi3-firmware
index fe89560..deacec9 100755
--- a/debian/kernel/postinst.d/raspi3-firmware
+++ b/debian/kernel/postinst.d/raspi3-firmware
@@ -31,11 +31,13 @@ case "$1" in
 ;;
 esac

-if ! ischroot; then
-  if ! mountpoint -q /boot/firmware; then
-echo "raspi3-firmware: missing /boot/firmware, did you forget to mount
it?" >&2
-exit 1
-  fi
+if ischroot ; then
+  : chroot detected - skip mount point check
+elif test -e /usr/bin/systemd-detect-virt && systemd-detect-virt -q ; then
+  : virtualization detected - skip mount point check
+elif ! mountpoint -q /boot/firmware; then
+  echo "raspi3-firmware: missing /boot/firmware, did you forget to mount
it?" >&2
+  exit 1
 fi

 latest_kernel=$(ls -1 /boot/vmlinuz-* | grep -v '\.dpkg-bak$' | sort -V -r
| head -1)
diff --git a/debian/raspi3-firmware.postinst
b/debian/raspi3-firmware.postinst
index 236b389..01bdcf8 100644
--- a/debian/raspi3-firmware.postinst
+++ b/debian/raspi3-firmware.postinst
@@ -6,11 +6,15 @@ set -e
 case "$1" in
   configure)

-if ! ischroot; then
-  if ! mountpoint -q /boot/firmware; then
-echo "Error: missing /boot/firmware, did you forget to mount it?"
>&2
-exit 1
-  fi
+if ischroot ; then
+  # chroot detected - skip mount point check
+  mkdir -p /boot/firmware
+elif test -e /usr/bin/systemd-detect-virt && systemd-detect-virt -q ;
then
+  # virtualization detected - skip mount point check
+  mkdir -p /boot/firmware
+elif ! mountpoint -q /boot/firmware; then
+  echo "Error: missing /boot/firmware, did you forget to mount it?" >&2
+  exit 1
 fi

 for file in /usr/lib/raspi3-firmware/*
-- 
2.7.4


Bug#884601: "console=ttyAMA0,115200" --> "console=tty0"

2018-01-05 Thread Matthias Luescher
Hi Michael


> I just uploaded a new raspi3-firmware package which uses ttyS1 on Linux
> ≥ 4.14, which is the new device name for the UART on the pin header:
> https://anonscm.debian.org/cgit/pkg-raspi/raspi3-firmware.git/commit/?id=
> 4da2e6b1576f0a7513bffe7f95882693fdadd7ae


Many thanks - this works great!

I just verified it by fetching raspi3-firmware (1.20171201-1) from sid:
https://github.com/lueschem/edi-pi/commit/d3a1b5055fa4441b7ce42d6827868bdf8e46fdda

Best regards
Matthias


Bug#884601: "console=ttyAMA0,115200" --> "console=tty0"

2017-12-27 Thread Matthias Luescher
Hi

I just faced a similar issue with the arm64 kernel
(linux-image-4.14.0-0.bpo.2-arm64). It booted fine with the 4.13 based
kernel but it failed after the upgrade to the above mentioned kernel. Since
I wanted to debug the stuff I took a closer look at the cmdline.txt file:
There I found the config "console=ttyAMA0,115200". This looked wrong to me
since ttyAMA0 is the bluetooth device on the Raspberry Pi 3. Therefore I
changed it to "console=tty0" and all of a sudden my system booted again
with the 4.14 kernel.

Another remark: My setup also worked with the 4.14 kernel combined with the
device tree binary from the 4.13 kernel. However, I do not like this hack.

My full setup is here: https://github.com/lueschem/edi-pi

Good luck
Matthias


Bug#882053: Additional investigations

2017-11-24 Thread Matthias Luescher
Dear maintainers

I have just taken a look at
https://anonscm.debian.org/cgit/kernel/linux.git/:
CONFIG_CMA will be switched to yes as soon as commit
ed497f3cb706d0e0f63844b064d9ebbf6f33b052
gets released on the respective branches.

For armhf CONFIG_CMA=y is anyway set since a longer time ago.

Therefore it looks like no additional code change is needed.

Many thanks and best regards
Matthias


Bug#882053: linux-image-4.13.0-0.bpo.1-arm64: feature request: enable contiguous memory allocator (CMA) for arm64 (CONFIG_CMA=y)

2017-11-18 Thread Matthias Luescher
Package: src:linux
Version: 4.13.4-2~bpo9+1
Severity: wishlist

Dear Maintainer,

*** Reporter, please consider answering these questions, where appropriate ***

   * What led up to the situation?
 
 My goal is to generate a pure Debian arm64 image for the Raspberry
 Pi 3. 

   * What exactly did you do (or not do) that was effective (or
 ineffective)?

 I took the latest kernel from stretch-backports and discovered that
 the vc4 graphics driver complains about missing CMA support.

   * What was the outcome of this action?

 The vc4 graphics driver will probably not work.

   * What outcome did you expect instead?

 It would be great if the arm64 (and probably also the armmp and
 armmp-lpae) kernels would work out of the box on the Raspberry Pi.

*** End of the template - remove these template lines ***


-- Package-specific info:
** Version:
Linux version 4.13.0-0.bpo.1-arm64 (debian-ker...@lists.debian.org) (gcc 
version 6.3.0 20170516 (Debian 6.3.0-18)) #1 SMP Debian 4.13.4-2~bpo9+1 
(2017-10-17)

** Command line:
earlyprintk console=ttyAMA0 dma.dmachans=0x7f35 bcm2708_fb.fbwidth=656 
bcm2708_fb.fbheight=416 bcm2709.boardrev=0xa02082 bcm2709.serial=0x6b00c92d 
smsc95xx.macaddr=B8:27:EB:00:C9:2D bcm2708_fb.fbswap=1 
bcm2709.uart_clock=4800 vc_mem.mem_base=0x3dc0 
vc_mem.mem_size=0x3f00  console=ttyS0,115200 root=/dev/mmcblk0p2 
elevator=deadline fsck.repair=yes rootwait

** Not tainted

** Kernel log:
[   12.332235] bcm2835-rng 3f104000.rng: hwrng registered
[   12.549340] smsc95xx: unknown parameter 'macaddr' ignored
[   12.571543] smsc95xx v1.0.6
[   12.651572] smsc95xx 1-1.1:1.0 eth0: register 'smsc95xx' at 
usb-3f98.usb-1.1, smsc95xx USB 2.0 Ethernet, 62:45:be:82:9f:3e
[   12.671097] vc4_hdmi 3f902000.hdmi: vc4-hdmi-hifi <-> 3f902000.hdmi mapping 
ok
[   12.67] vc4_hdmi 3f902000.hdmi: ASoC: no DMI vendor name!
[   12.672032] vc4-drm soc:gpu: bound 3f902000.hdmi (ops vc4_hdmi_ops [vc4])
[   12.672280] vc4-drm soc:gpu: bound 3f806000.vec (ops vc4_vec_ops [vc4])
[   12.672397] vc4-drm soc:gpu: bound 3f40.hvs (ops vc4_hvs_ops [vc4])
[   12.672700] vc4-drm soc:gpu: bound 3f206000.pixelvalve (ops vc4_crtc_ops 
[vc4])
[   12.672929] vc4-drm soc:gpu: bound 3f207000.pixelvalve (ops vc4_crtc_ops 
[vc4])
[   12.673157] vc4-drm soc:gpu: bound 3f807000.pixelvalve (ops vc4_crtc_ops 
[vc4])
[   12.673222] vc4-drm soc:gpu: Cannot do DMA to address 0x
[   12.673229] swiotlb: coherent allocation failed for device soc:gpu 
size=16777216
[   12.673241] CPU: 2 PID: 207 Comm: systemd-udevd Not tainted 
4.13.0-0.bpo.1-arm64 #1 Debian 4.13.4-2~bpo9+1
[   12.673244] Hardware name: Raspberry Pi 3 Model B Rev 1.2 (DT)
[   12.673249] Call trace:
[   12.673270] [] dump_backtrace+0x0/0x2a0
[   12.673280] [] show_stack+0x24/0x30
[   12.673293] [] dump_stack+0x98/0xbc
[   12.673306] [] swiotlb_alloc_coherent+0x17c/0x190
[   12.673316] [] __dma_alloc+0x78/0x160
[   12.673493] [] drm_gem_cma_create+0xac/0x138 [drm]
[   12.673578] [] vc4_bo_create+0x104/0x160 [vc4]
[   12.673664] [] vc4_allocate_bin_bo+0x9c/0x198 [vc4]
[   12.673749] [] vc4_v3d_bind+0x100/0x288 [vc4]
[   12.673766] [] component_bind_all+0x140/0x2c8
[   12.673850] [] vc4_drm_bind+0x84/0x168 [vc4]
[   12.673860] [] try_to_bring_up_master+0x290/0x2e0
[   12.673868] [] component_master_add_with_match+0xb4/0x108
[   12.673955] [] vc4_platform_drm_probe+0xd0/0x130 [vc4]
[   12.673967] [] platform_drv_probe+0x60/0xc8
[   12.673975] [] driver_probe_device+0x2e4/0x460
[   12.673983] [] __driver_attach+0x124/0x128
[   12.673990] [] bus_for_each_dev+0x88/0xe8
[   12.673997] [] driver_attach+0x30/0x40
[   12.674004] [] bus_add_driver+0x1f8/0x2b0
[   12.674011] [] driver_register+0x68/0x100
[   12.674020] [] __platform_driver_register+0x54/0x60
[   12.674106] [] vc4_drm_register+0x34/0x58 [vc4]
[   12.674117] [] do_one_initcall+0x5c/0x168
[   12.674128] [] do_init_module+0x64/0x1cc
[   12.674134] [] load_module+0x2074/0x2718
[   12.674141] [] SyS_finit_module+0x128/0x140
[   12.674149] [] __sys_trace_return+0x0/0x4
[   12.674202] vc4-drm soc:gpu: failed to allocate buffer with size 16777216
[   12.674247] vc4-drm soc:gpu: Cannot do DMA to address 0x
[   12.674252] swiotlb: coherent allocation failed for device soc:gpu 
size=16777216
[   12.674263] CPU: 2 PID: 207 Comm: systemd-udevd Not tainted 
4.13.0-0.bpo.1-arm64 #1 Debian 4.13.4-2~bpo9+1
[   12.674266] Hardware name: Raspberry Pi 3 Model B Rev 1.2 (DT)
[   12.674268] Call trace:
[   12.674282] [] dump_backtrace+0x0/0x2a0
[   12.674292] [] show_stack+0x24/0x30
[   12.674302] [] dump_stack+0x98/0xbc
[   12.674312] [] swiotlb_alloc_coherent+0x17c/0x190
[   12.674321] [] __dma_alloc+0x78/0x160
[   12.674493] [] drm_gem_cma_create+0xac/0x138 [drm]
[   12.674581] [] vc4_bo_create+0x128/0x160 [vc4]
[   12.674668] [] vc4_allocate_bin_bo+0x9c/0x198 [vc4]
[   12.674754] [] vc4_v3d_bind+0x100/0x288 [vc4]
[   12.674765] [] component_bind_all+0x140