Bug 218344 - No more /dev/mmc entry on Raspberry Pi 2
Summary: No more /dev/mmc entry on Raspberry Pi 2
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: arm (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-arm (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-04-04 06:33 UTC by Sylvain Garrigues
Modified: 2017-12-18 20:18 UTC (History)
3 users (show)

See Also:


Attachments
dtb-tree-as-seen-with-4e156d5 (11.83 KB, text/plain)
2017-04-05 09:46 UTC, Sylvain Garrigues
no flags Details
dtb-tree-as-seen-with-bf5201e (11.76 KB, text/plain)
2017-04-05 09:49 UTC, Sylvain Garrigues
no flags Details
DTS fix for mmc missing as well as ethernet address not filled (847 bytes, patch)
2017-08-17 08:55 UTC, Sylvain Garrigues
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sylvain Garrigues 2017-04-04 06:33:18 UTC
Hello,

I have no /dev/mmc entry with vanilla 12-CURRENT GENERIC arm kernel as of today.

I added bootverbose option in config and below is the sdhci output, in case it will help you.

sdhci_bcm0: <Broadcom 2708 SDHCI controller> mem 0x300000-0x3000ff irq 27 on simplebus0
sdhci_bcm0: SDHCI frequency: 250MHz
sdhci_bcm0-slot0: 250MHz HS 4bits VDD: 3.3V 1.8V VCCQ: 3.3V DRV: B PIO
sdhci_bcm0-slot0: ============== REGISTER DUMP ==============
sdhci_bcm0-slot0: Sys addr: 0x00000000 | Version:  0x00009902
sdhci_bcm0-slot0: Blk size: 0x00000000 | Blk cnt:  0x00000000
sdhci_bcm0-slot0: Argument: 0x00000000 | Trn mode: 0x00000000
sdhci_bcm0-slot0: Present:  0x1fff0000 | Host ctl: 0x00000000
sdhci_bcm0-slot0: Power:    0x00000000 | Blk gap:  0x00000000
sdhci_bcm0-slot0: Wake-up:  0x00000000 | Clock:    0x00000000
sdhci_bcm0-slot0: Timeout:  0x00000000 | Int stat: 0x00000040
sdhci_bcm0-slot0: Int enab: 0x01ff00fb | Sig enab: 0x01ff00fb
sdhci_bcm0-slot0: AC12 err: 0x00000000 | Host ctl2: 0x00000000
sdhci_bcm0-slot0: Caps:     0x00000000 | Caps2:    0x00000000
sdhci_bcm0-slot0: Max curr: 0x00000001 | ADMA err: 0x00000000
sdhci_bcm0-slot0: ADMA addr: 0x00000000 | Slot int: 0x00000001
sdhci_bcm0-slot0: ===========================================
Comment 1 Sylvain Garrigues 2017-04-05 09:36:58 UTC
I just realized that it has been introduced by a recent firmware change, more precisely this one: https://github.com/raspberrypi/firmware/commit/bf5201e9682bf36370bc31d26b37fd4d84e1cfca

1/ The MAC address is no longer patched by the firmware, so if you don't use u-boot, you end-up with a 0x0 mac-address which the usb-ethernet address converts to a random MAC address. This will set up any access control or DHCP network system based on MAC address

2/ The recent firmware no longer allows the SDHCI driver to recognize the SD card. So with any FreeBSD image, if you update bootcode.bin, start* and mixup*, you won't boot anymore. Let's be careful if we update the u-boot-rpi* ports then.

3/ They removed the vc_mem DTB entry, not sure what the impacts are.

Attached are the before and after DTBs as seen by kernel, obtained with:
# sysctl -b hw.fdt.dtb | dtc -I dtb
Comment 2 Sylvain Garrigues 2017-04-05 09:46:22 UTC
Created attachment 181505 [details]
dtb-tree-as-seen-with-4e156d5
Comment 3 Sylvain Garrigues 2017-04-05 09:49:58 UTC
Created attachment 181506 [details]
dtb-tree-as-seen-with-bf5201e
Comment 4 Sylvain Garrigues 2017-04-05 09:51:11 UTC
Issue reported here:
https://github.com/raspberrypi/firmware/issues/790
Comment 5 Sylvain Garrigues 2017-08-17 08:55:52 UTC
Created attachment 185518 [details]
DTS fix for mmc missing as well as ethernet address not filled
Comment 6 commit-hook freebsd_committer freebsd_triage 2017-08-19 14:27:53 UTC
A commit references this bug:

Author: manu
Date: Sat Aug 19 14:27:11 UTC 2017
New revision: 322694
URL: https://svnweb.freebsd.org/changeset/base/322694

Log:
  RPI DTS: Add value previously set by VideoCore and DTB links

  Using latest U-Boot for RPI 1 or 2 the DTB loaded by the firmware is discarded.
  The DTB was previously patched by the firmware to contain the DMA channel mask.
  DTB provided by the rpi firmware or DTS in the Linux tree contain the raw value
  directly. Do the same for our DTS as we cannot switch to the upstream ones yet.
  Not having the DMA channel mask setup properly cause mmc not to be detected
  (and probably other problems on driver using DMA).

  Also, add links for rpi dtb to the name used by u-boot. This way the dtb can be
  loaded by ubldr using the U-Boot env variable fdtfile.

  Tested On: RPI B Rev2, RPI Zero, RPI 2 v1.1 RPI 2 v1.2

  Thanks to Sylvain Garrigues <sylvain@sylvaingarrigues.com> for the help.

  PR:		218344

Changes:
  head/sys/boot/fdt/dts/arm/bcm2835.dtsi
  head/sys/boot/fdt/dts/arm/bcm2836.dtsi
  head/sys/modules/dtb/rpi/Makefile
Comment 7 commit-hook freebsd_committer freebsd_triage 2017-12-18 20:18:05 UTC
A commit references this bug:

Author: manu
Date: Mon Dec 18 20:17:54 UTC 2017
New revision: 326951
URL: https://svnweb.freebsd.org/changeset/base/326951

Log:
  MFC r312914, r322694

  r312914 by imp:
  Honor LINKS=x y in dtb modules. We need this for compatibility links
  for old, FreeBSD names.

  r322694:
  RPI DTS: Add value previously set by VideoCore and DTB links

  Using latest U-Boot for RPI 1 or 2 the DTB loaded by the firmware is discarded.
  The DTB was previously patched by the firmware to contain the DMA channel mask.
  DTB provided by the rpi firmware or DTS in the Linux tree contain the raw value
  directly. Do the same for our DTS as we cannot switch to the upstream ones yet.
  Not having the DMA channel mask setup properly cause mmc not to be detected
  (and probably other problems on driver using DMA).

  Also, add links for rpi dtb to the name used by u-boot. This way the dtb can be
  loaded by ubldr using the U-Boot env variable fdtfile.

  Tested On: RPI B Rev2, RPI Zero, RPI 2 v1.1 RPI 2 v1.2

  Thanks to Sylvain Garrigues <sylvain@sylvaingarrigues.com> for the help.

  PR:		218344

Changes:
_U  stable/11/
  stable/11/sys/boot/fdt/dts/arm/bcm2835.dtsi
  stable/11/sys/boot/fdt/dts/arm/bcm2836.dtsi
  stable/11/sys/conf/dtb.mk
  stable/11/sys/modules/dtb/rpi/Makefile