User avatar
JoanTheSpark
Posts: 33
Joined: Sun Feb 21, 2016 5:36 am

RPi 3, Jessie, SDIO.dtbo, problems

Mon Oct 03, 2016 2:41 pm

Aim:
I would like to have 2 SD cards on a RPi 2B/3 with the OS on the normal card and the extra SD slot for data storage, which can be swapped out/in.
For this I'm trying to get the extra SDIO port working (as many others have before), but have no success. :cry:

Sources:
I added this line to config.txt:

Code: Select all

dtoverlay=sdio,poll_once=off
and also tried this:

Code: Select all

dtoverlay=sdio,poll_once=no
If I boot the pi with an empty SD card (4GB, fat16) in that extra slot there is a permanent 41.66MHz clock signal on the CLK line (pin #15) and the kernel or loader never get's past these error messages (appears under the 4 raspberries at top left):

Code: Select all

usb1-1: device descriptor read/64, error - 110
mmc0: timeout waiting for hardware interrupt
mmclbk0: error - 110 transferring data, sector ..., nr96, cmd response 0x900, card status 0xb00
..
There is a also variation of it that looks like this:

Code: Select all

usb1-1: device descriptor read/64, error - 110
INFO: rcn_shed detected stalls on CPUs/tasks:
..
The messages repeat/update forever and nothing happens. Powercycle is needed and removal of the mepty card to get the pi to boot.

If I don't put the SD card into the additional slot the pi boots just fine, but besides during start there never again is a clock signal on CLK, although there should be one, as the poll_once had been disabled, no?

I did use

Code: Select all

fdtdump sdio.dtbo
To see what my sdio.dtbo looks like (as there was some hint to remove the 'non-removable;' piece in [email protected] and I did that.
Then I used dtc (up to date, checked it twice) to recreate the dtb(o) and still nothing useful - instead both fdtdump and dtc moan about some problems, which I assume can be ignored.

Code: Select all

> dtc [email protected] -I dts -O dtb sdio.dts -o sdio.dtb
Warning (unit_address_vs_reg): Node /[email protected] has a unit name, but no reg property
Warning (unit_address_vs_reg): Node /[email protected] has a unit name, but no reg property
Warning (unit_address_vs_reg): Node /[email protected] has a unit name, but no reg property
Warning (unit_address_vs_reg): Node /[email protected] has a unit name, but no reg property
Warning (unit_address_vs_reg): Node /__local_fixups__/[email protected] has a unit name, but no reg property
Anyhow, the overlay now looks like this

Code: Select all

/dts-v1/;

/ {
	compatible = "brcm,bcm2708";

	[email protected] {
		target = <0xdeadbeef>;

		__overlay__ {
			brcm,overclock-50 = <0x0>;
			brcm,pio-limit = <0x1>;
			brcm,debug-flags = <0x0>;
			status = "okay";
			phandle = <0x1>;
		};
	};

	[email protected] {
		target = <0xdeadbeef>;

		__overlay__ {
			status = "disabled";
		};
	};

	__overrides__ {
		overclock_50 = <0x1 0x6272636d 0x2c6f7665 0x72636c6f 0x636b2d35 0x303a3000>;
		force_pio = <0x1 0x6272636d 0x2c666f72 0x63652d70 0x696f3f00>;
		pio_limit = [00 00 00 01 62 72 63 6d 2c 70 69 6f 2d 6c 69 6d 69 74 3a 30 00];
		debug = <0x1 0x6272636d 0x2c646562 0x75673f00>;
		poll_once = [00 00 00 02 6e 6f 6e 2d 72 65 6d 6f 76 61 62 6c 65 3f 00];
		bus_width = <0x2 0x6275732d 0x77696474 0x683a3000>;
		sdio_overclock = <0x2 0x6272636d 0x2c6f7665 0x72636c6f 0x636b2d35 0x303a3000>;
	};

	[email protected] {
		target = <0xdeadbeef>;

		__overlay__ {
			pinctrl-names = "default";
			pinctrl-0 = <0x3>;
			/* non-removable; */
			bus-width = <0x4>;
			brcm,overclock-50 = <0x0>;
			status = "okay";
			phandle = <0x2>;
		};
	};

	[email protected] {
		target = <0xdeadbeef>;

		__overlay__ {

			sdio_pins {
				brcm,pins = <0x16 0x17 0x18 0x19 0x1a 0x1b>;
				brcm,function = <0x7 0x7 0x7 0x7 0x7 0x7>;
				brcm,pull = <0x0 0x2 0x2 0x2 0x2 0x2>;
				phandle = <0x3>;
			};
		};
	};

	__symbols__ {
		frag0 = "/[email protected]/__overlay__";
		sdio_mmc = "/[email protected]/__overlay__";
		sdio_pins = "/[email protected]/__overlay__/sdio_pins";
	};

	__local_fixups__ {

		__overrides__ {
			overclock_50 = <0x0>;
			force_pio = <0x0>;
			pio_limit = <0x0>;
			debug = <0x0>;
			poll_once = <0x0>;
			bus_width = <0x0>;
			sdio_overclock = <0x0>;
		};

		[email protected] {

			__overlay__ {
				pinctrl-0 = <0x0>;
			};
		};
	};

	__fixups__ {
		sdhost = "/[email protected]:target:0";
		mmc = "/[email protected]:target:0", "/[email protected]:target:0";
		gpio = "/[email protected]:target:0";
	};
};
What the hell am I missing?
I'm working on this for 2 days now, but I get nowhere.

Hard & Software info..

Code: Select all

Hardware	: BCM2709
Revision	: a02082
Serial		: 000000006572961b

Code: Select all

PRETTY_NAME="Raspbian GNU/Linux 8 (jessie)"
NAME="Raspbian GNU/Linux"
VERSION_ID="8"
VERSION="8 (jessie)"
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 2656
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: RPi 3, Jessie, SDIO.dtbo, problems

Mon Oct 03, 2016 4:37 pm

1) It isn't clear whether you get USB errors without the overlay or do they only appear when you use it. If so, I'd be concerned about voltage levels etc. It's probably also worth using "raspi-gpio get" with and without the overlay to confirm that it is doing what you expect.

2) It makes a difference whether you are using a Pi2B or Pi3B - on a Pi3B the MMC/SDIO is already being used for WiFi. Although this the sdio overlay will cause the pin usage to be changed as expected, there is a problem with "non-removable", which is a boolean property. The value of a boolean property is determined by its presence or absence, not the value assigned to it, and the base dtb for a Pi3B is expecting to use the MMC interface for WiFi, so the "non-removable" property is set (defined).

Overlays are powerful tools, but there is no mechanism for removing a property in the base dtb with an overlay - the best you can do is conditionaly choose not to add it (which is what the "poll_once" parameter does). As a result using that overlay on a Pi3B always leaves non-removable set.

This is a rather knotty problem, and aside from hacking the base dtbs (which you don't want to do except to verify that that is indeed the cause of the problem), the only way I can think of to get around it is to create a clone of the "mmc" node in your overlay that has all the same properties except "non-removable" but with a slightly different name, then to set/leave the status of the original mmc node as "disabled".

3) That overlay you posted is the result of running ftddump on the .dtbo - that isn't a very helpful thing to do since it obfuscates the strings and makes it harder to identify the targets of the fragments.

User avatar
JoanTheSpark
Posts: 33
Joined: Sun Feb 21, 2016 5:36 am

Re: RPi 3, Jessie, SDIO.dtbo, problems

Tue Oct 04, 2016 12:11 am

The RPi is powered through a bench top power supply on pin 2 and 6 with 5V and uses about 360mA when running. I didn't check the value when the SD card is inserted, but the mas is about 3A, so I should be fine, no?

Thanks for the list.

to 1)
I think the overlay does what it's supposed to do, output of raspi_gpio get:

Code: Select all

BANK0 (GPIO 0 to 27):
  GPIO 00: level=1 fsel=0 alt=  func=INPUT
  GPIO 01: level=1 fsel=0 alt=  func=INPUT
  GPIO 02: level=1 fsel=0 alt=  func=INPUT
  GPIO 03: level=1 fsel=0 alt=  func=INPUT
  GPIO 04: level=1 fsel=0 alt=  func=INPUT
  GPIO 05: level=1 fsel=0 alt=  func=INPUT
  GPIO 06: level=1 fsel=0 alt=  func=INPUT
  GPIO 07: level=1 fsel=0 alt=  func=INPUT
  GPIO 08: level=1 fsel=0 alt=  func=INPUT
  GPIO 09: level=0 fsel=0 alt=  func=INPUT
  GPIO 10: level=0 fsel=0 alt=  func=INPUT
  GPIO 11: level=0 fsel=0 alt=  func=INPUT
  GPIO 12: level=0 fsel=0 alt=  func=INPUT
  GPIO 13: level=0 fsel=0 alt=  func=INPUT
  GPIO 14: level=0 fsel=0 alt=  func=INPUT
  GPIO 15: level=1 fsel=0 alt=  func=INPUT
  GPIO 16: level=0 fsel=0 alt=  func=INPUT
  GPIO 17: level=0 fsel=0 alt=  func=INPUT
  GPIO 18: level=0 fsel=0 alt=  func=INPUT
  GPIO 19: level=0 fsel=0 alt=  func=INPUT
  GPIO 20: level=0 fsel=0 alt=  func=INPUT
  GPIO 21: level=0 fsel=0 alt=  func=INPUT
[b]  GPIO 22: level=0 fsel=7 alt=3 func=SD1_CLK
  GPIO 23: level=1 fsel=7 alt=3 func=SD1_CMD
  GPIO 24: level=1 fsel=7 alt=3 func=SD1_DAT0
  GPIO 25: level=1 fsel=7 alt=3 func=SD1_DAT1
  GPIO 26: level=1 fsel=7 alt=3 func=SD1_DAT2
  GPIO 27: level=1 fsel=7 alt=3 func=SD1_DAT3[/b]
BANK1 (GPIO 28 to 45):
  GPIO 28: level=0 fsel=0 alt=  func=INPUT
  GPIO 29: level=1 fsel=0 alt=  func=INPUT
  GPIO 30: level=0 fsel=0 alt=  func=INPUT
  GPIO 31: level=0 fsel=0 alt=  func=INPUT
  GPIO 32: level=1 fsel=7 alt=3 func=TXD0
  GPIO 33: level=1 fsel=7 alt=3 func=RXD0
  GPIO 34: level=1 fsel=0 alt=  func=INPUT
  GPIO 35: level=1 fsel=0 alt=  func=INPUT
  GPIO 36: level=1 fsel=0 alt=  func=INPUT
  GPIO 37: level=1 fsel=0 alt=  func=INPUT
  GPIO 38: level=1 fsel=0 alt=  func=INPUT
  GPIO 39: level=1 fsel=0 alt=  func=INPUT
  GPIO 40: level=1 fsel=4 alt=0 func=PWM0
  GPIO 41: level=0 fsel=4 alt=0 func=PWM1
  GPIO 42: level=1 fsel=4 alt=0 func=GPCLK1
  GPIO 43: level=0 fsel=4 alt=0 func=GPCLK2
  GPIO 44: level=1 fsel=0 alt=  func=INPUT
  GPIO 45: level=1 fsel=0 alt=  func=INPUT
BANK2 (GPIO 46 to 53):
  GPIO 46: level=1 fsel=4 alt=0 func=SDA0
  GPIO 47: level=1 fsel=4 alt=0 func=SCL0
 [b] GPIO 48: level=0 fsel=4 alt=0 func=SD0_CLK
  GPIO 49: level=1 fsel=4 alt=0 func=SD0_CMD
  GPIO 50: level=1 fsel=4 alt=0 func=SD0_DAT0
  GPIO 51: level=1 fsel=4 alt=0 func=SD0_DAT1
  GPIO 52: level=1 fsel=4 alt=0 func=SD0_DAT2
  GPIO 53: level=1 fsel=4 alt=0 func=SD0_DAT3[/b]
This is dmesg output right after boot with the overlay active and no SD card inserted (with SD card inserted I don't get further as I wrote in the OT, as the pi essentially hangs). I can't see any USB errors there:

Code: Select all

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Initializing cgroup subsys cpuset
[    0.000000] Initializing cgroup subsys cpu
[    0.000000] Initializing cgroup subsys cpuacct
[    0.000000] Linux version 4.4.21-v7+ ([email protected]) (gcc version 4.9.3 (crosstool-NG crosstool-ng-1.22.0-88-g8460611) ) #911 SMP Thu Sep 15 14:22:38 BST 2016
[    0.000000] CPU: ARMv7 Processor [410fd034] revision 4 (ARMv7), cr=10c5383d
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] Machine model: Raspberry Pi 3 Model B Rev 1.2
[    0.000000] cma: Reserved 8 MiB at 0x3a800000
[    0.000000] Memory policy: Data cache writealloc
[    0.000000] On node 0 totalpages: 241664
[    0.000000] free_area_init_node: node 0, pgdat 808c2f40, node_mem_map b9fa6000
[    0.000000]   Normal zone: 2124 pages used for memmap
[    0.000000]   Normal zone: 0 pages reserved
[    0.000000]   Normal zone: 241664 pages, LIFO batch:31
[    0.000000] [bcm2709_smp_init_cpus] enter (9520->f3003010)
[    0.000000] [bcm2709_smp_init_cpus] ncores=4
[    0.000000] PERCPU: Embedded 13 pages/cpu @b9f62000 s22592 r8192 d22464 u53248
[    0.000000] pcpu-alloc: s22592 r8192 d22464 u53248 alloc=13*4096
[    0.000000] pcpu-alloc: [0] 0 [0] 1 [0] 2 [0] 3 
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 239540
[    0.000000] Kernel command line: 8250.nr_uarts=0 dma.dmachans=0x7f35 bcm2708_fb.fbwidth=656 bcm2708_fb.fbheight=416 bcm2709.boardrev=0xa02082 bcm2709.serial=0x6572961b smsc95xx.macaddr=B8:27:EB:72:96:1B bcm2708_fb.fbswap=1 bcm2709.uart_clock=48000000 vc_mem.mem_base=0x3dc00000 vc_mem.mem_size=0x3f000000  dwc_otg.lpm_enable=0 console=ttyS0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait quiet splash plymouth.ignore-serial-consoles
[    0.000000] PID hash table entries: 4096 (order: 2, 16384 bytes)
[    0.000000] Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
[    0.000000] Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
[    0.000000] Memory: 939072K/966656K available (6348K kernel code, 432K rwdata, 1716K rodata, 476K init, 764K bss, 19392K reserved, 8192K cma-reserved)
[    0.000000] Virtual kernel memory layout:
    vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
    vmalloc : 0xbb800000 - 0xff800000   (1088 MB)
    lowmem  : 0x80000000 - 0xbb000000   ( 944 MB)
    modules : 0x7f000000 - 0x80000000   (  16 MB)
      .text : 0x80008000 - 0x807e854c   (8066 kB)
      .init : 0x807e9000 - 0x80860000   ( 476 kB)
      .data : 0x80860000 - 0x808cc250   ( 433 kB)
       .bss : 0x808cf000 - 0x8098e1ec   ( 765 kB)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
[    0.000000] Hierarchical RCU implementation.
[    0.000000] 	Build-time adjustment of leaf fanout to 32.
[    0.000000] NR_IRQS:16 nr_irqs:16 16
[    0.000000] Architected cp15 timer(s) running at 19.20MHz (phys).
[    0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x46d987e47, max_idle_ns: 440795202767 ns
[    0.000008] sched_clock: 56 bits at 19MHz, resolution 52ns, wraps every 4398046511078ns
[    0.000025] Switching to timer-based delay loop, resolution 52ns
[    0.000281] Console: colour dummy device 80x30
[    0.000482] console [tty1] enabled
[    0.000507] Calibrating delay loop (skipped), value calculated using timer frequency.. 38.40 BogoMIPS (lpj=192000)
[    0.000527] pid_max: default: 32768 minimum: 301
[    0.000839] Mount-cache hash table entries: 2048 (order: 1, 8192 bytes)
[    0.000854] Mountpoint-cache hash table entries: 2048 (order: 1, 8192 bytes)
[    0.001787] Disabling cpuset control group subsystem
[    0.001819] Initializing cgroup subsys io
[    0.001847] Initializing cgroup subsys memory
[    0.001892] Initializing cgroup subsys devices
[    0.001912] Initializing cgroup subsys freezer
[    0.001931] Initializing cgroup subsys net_cls
[    0.001977] CPU: Testing write buffer coherency: ok
[    0.002040] ftrace: allocating 21220 entries in 63 pages
[    0.050249] CPU0: update cpu_capacity 1024
[    0.050279] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[    0.050293] [bcm2709_smp_prepare_cpus] enter
[    0.050434] Setting up static identity map for 0x8240 - 0x8274
[    0.052058] [bcm2709_boot_secondary] cpu:1 started (0) 18
[    0.052272] [bcm2709_secondary_init] enter cpu:1
[    0.052316] CPU1: update cpu_capacity 1024
[    0.052322] CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
[    0.052695] [bcm2709_boot_secondary] cpu:2 started (0) 18
[    0.052859] [bcm2709_secondary_init] enter cpu:2
[    0.052879] CPU2: update cpu_capacity 1024
[    0.052885] CPU2: thread -1, cpu 2, socket 0, mpidr 80000002
[    0.053240] [bcm2709_boot_secondary] cpu:3 started (0) 16
[    0.053370] [bcm2709_secondary_init] enter cpu:3
[    0.053390] CPU3: update cpu_capacity 1024
[    0.053396] CPU3: thread -1, cpu 3, socket 0, mpidr 80000003
[    0.053456] Brought up 4 CPUs
[    0.053479] SMP: Total of 4 processors activated (153.60 BogoMIPS).
[    0.053487] CPU: All CPU(s) started in HYP mode.
[    0.053494] CPU: Virtualization extensions available.
[    0.054111] devtmpfs: initialized
[    0.065230] VFP support v0.3: implementor 41 architecture 3 part 40 variant 3 rev 4
[    0.065557] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.066271] pinctrl core: initialized pinctrl subsystem
[    0.066782] NET: Registered protocol family 16
[    0.072032] DMA: preallocated 4096 KiB pool for atomic coherent allocations
[    0.078993] hw-breakpoint: found 5 (+1 reserved) breakpoint and 4 watchpoint registers.
[    0.079004] hw-breakpoint: maximum watchpoint size is 8 bytes.
[    0.079157] Serial: AMBA PL011 UART driver
[    0.079288] uart-pl011 3f201000.uart: could not find pctldev for node /soc/[email protected]/uart0_pins, deferring probe
[    0.079446] bcm2835-mbox 3f00b880.mailbox: mailbox enabled
[    0.142369] bcm2835-dma 3f007000.dma: DMA legacy API manager at f3007000, dmachans=0x1
[    0.142928] SCSI subsystem initialized
[    0.143115] usbcore: registered new interface driver usbfs
[    0.143205] usbcore: registered new interface driver hub
[    0.143303] usbcore: registered new device driver usb
[    0.149794] raspberrypi-firmware soc:firmware: Attached to firmware from 2016-09-21 13:13
[    0.177000] clocksource: Switched to clocksource arch_sys_counter
[    0.221600] FS-Cache: Loaded
[    0.221871] CacheFiles: Loaded
[    0.234090] NET: Registered protocol family 2
[    0.234941] TCP established hash table entries: 8192 (order: 3, 32768 bytes)
[    0.235054] TCP bind hash table entries: 8192 (order: 4, 65536 bytes)
[    0.235243] TCP: Hash tables configured (established 8192 bind 8192)
[    0.235336] UDP hash table entries: 512 (order: 2, 16384 bytes)
[    0.235382] UDP-Lite hash table entries: 512 (order: 2, 16384 bytes)
[    0.235606] NET: Registered protocol family 1
[    0.235924] RPC: Registered named UNIX socket transport module.
[    0.235934] RPC: Registered udp transport module.
[    0.235942] RPC: Registered tcp transport module.
[    0.235951] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.237122] hw perfevents: enabled with armv7_cortex_a7 PMU driver, 7 counters available
[    0.238421] futex hash table entries: 1024 (order: 4, 65536 bytes)
[    0.251622] VFS: Disk quotas dquot_6.6.0
[    0.251933] VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[    0.254149] FS-Cache: Netfs 'nfs' registered for caching
[    0.255045] NFS: Registering the id_resolver key type
[    0.255092] Key type id_resolver registered
[    0.255102] Key type id_legacy registered
[    0.257417] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 252)
[    0.257545] io scheduler noop registered
[    0.257566] io scheduler deadline registered (default)
[    0.257619] io scheduler cfq registered
[    0.260110] BCM2708FB: allocated DMA memory fac00000
[    0.260136] BCM2708FB: allocated DMA channel 0 @ f3007000
[    0.268847] Console: switching to colour frame buffer device 82x26
[    1.085801] bcm2835-rng 3f104000.rng: hwrng registered
[    1.085957] vc-cma: Videocore CMA driver
[    1.085969] vc-cma: vc_cma_base      = 0x00000000
[    1.085978] vc-cma: vc_cma_size      = 0x00000000 (0 MiB)
[    1.085987] vc-cma: vc_cma_initial   = 0x00000000 (0 MiB)
[    1.086212] vc-mem: phys_addr:0x00000000 mem_base=0x3dc00000 mem_size:0x3f000000(1008 MiB)
[    1.100866] brd: module loaded
[    1.109400] loop: module loaded
[    1.110305] vchiq: vchiq_init_state: slot_zero = 0xbac80000, is_master = 0
[    1.111712] Loading iSCSI transport class v2.0-870.
[    1.112348] usbcore: registered new interface driver smsc95xx
[    1.112397] dwc_otg: version 3.00a 10-AUG-2012 (platform bus)
[    1.312638] Core Release: 2.80a
[    1.312656] Setting default values for core params
[    1.312690] Finished setting default values for core params
[    1.513052] Using Buffer DMA mode
[    1.513063] Periodic Transfer Interrupt Enhancement - disabled
[    1.513071] Multiprocessor Interrupt Enhancement - disabled
[    1.513080] OTG VER PARAM: 0, OTG VER FLAG: 0
[    1.513094] Dedicated Tx FIFOs mode
[    1.513382] WARN::dwc_otg_hcd_init:1047: FIQ DMA bounce buffers: virt = 0xbac14000 dma = 0xfac14000 len=9024
[    1.513411] FIQ FSM acceleration enabled for :
Non-periodic Split Transactions
Periodic Split Transactions
High-Speed Isochronous Endpoints
Interrupt/Control Split Transaction hack enabled
[    1.513434] dwc_otg: Microframe scheduler enabled
[    1.513483] WARN::hcd_init_fiq:413: FIQ on core 1 at 0x80447364
[    1.513498] WARN::hcd_init_fiq:414: FIQ ASM at 0x804476d4 length 36
[    1.513514] WARN::hcd_init_fiq:439: MPHI regs_base at 0xbb9a8000
[    1.513577] dwc_otg 3f980000.usb: DWC OTG Controller
[    1.513614] dwc_otg 3f980000.usb: new USB bus registered, assigned bus number 1
[    1.513647] dwc_otg 3f980000.usb: irq 62, io mem 0x00000000
[    1.513697] Init: Port Power? op_state=1
[    1.513705] Init: Power Port (0)
[    1.513901] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
[    1.513916] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    1.513928] usb usb1: Product: DWC OTG Controller
[    1.513940] usb usb1: Manufacturer: Linux 4.4.21-v7+ dwc_otg_hcd
[    1.513952] usb usb1: SerialNumber: 3f980000.usb
[    1.514726] hub 1-0:1.0: USB hub found
[    1.514768] hub 1-0:1.0: 1 port detected
[    1.515348] dwc_otg: FIQ enabled
[    1.515357] dwc_otg: NAK holdoff enabled
[    1.515365] dwc_otg: FIQ split-transaction FSM enabled
[    1.515403] Module dwc_common_port init
[    1.515655] usbcore: registered new interface driver usb-storage
[    1.515916] mousedev: PS/2 mouse device common for all mice
[    1.516618] bcm2835-cpufreq: min=600000 max=1200000
[    1.516908] sdhci: Secure Digital Host Controller Interface driver
[    1.516917] sdhci: Copyright(c) Pierre Ossman
[    1.517253] sdhost: log_buf @ bac13000 (fac13000)
[    1.577029] mmc0: sdhost-bcm2835 loaded - DMA enabled (>1)
[    1.579259] mmc-bcm2835 3f300000.mmc: mmc_debug:0 mmc_debug2:0
[    1.579272] mmc-bcm2835 3f300000.mmc: DMA channel allocated
[    1.637113] sdhci-pltfm: SDHCI platform and OF driver helper
[    1.637500] ledtrig-cpu: registered to indicate activity on CPUs
[    1.637618] hidraw: raw HID events driver (C) Jiri Kosina
[    1.637800] usbcore: registered new interface driver usbhid
[    1.637808] usbhid: USB HID core driver
[    1.638323] Initializing XFRM netlink socket
[    1.638359] NET: Registered protocol family 17
[    1.638494] Key type dns_resolver registered
[    1.639096] Registering SWP/SWPB emulation handler
[    1.639897] registered taskstats version 1
[    1.640074] vc-sm: Videocore shared memory driver
[    1.640087] [vc_sm_connected_init]: start
[    1.640535] [vc_sm_connected_init]: end - returning 0
[    1.641889] 3f201000.uart: ttyAMA0 at MMIO 0x3f201000 (irq = 87, base_baud = 0) is a PL011 rev2
[    1.642265] of_cfs_init
[    1.642344] of_cfs_init: OK
[    1.643189] Waiting for root device /dev/mmcblk0p2...
[    1.676292] mmc0: host does not support reading read-only switch, assuming write-enable
[    1.680016] mmc0: new high speed SDHC card at address aaaa
[    1.680580] mmcblk0: mmc0:aaaa SL08G 7.40 GiB
[    1.682031]  mmcblk0: p1 p2
[    1.707117] Indeed it is in host mode hprt0 = 00021501
[    1.764884] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[    1.764929] VFS: Mounted root (ext4 filesystem) readonly on device 179:2.
[    1.772946] devtmpfs: mounted
[    1.775766] Freeing unused kernel memory: 476K (807e9000 - 80860000)
[    1.887050] usb 1-1: new high-speed USB device number 2 using dwc_otg
[    1.887199] Indeed it is in host mode hprt0 = 00001101
[    2.067216] random: systemd: uninitialized urandom read (16 bytes read, 33 bits of entropy available)
[    2.070911] systemd[1]: systemd 215 running in system mode. (+PAM +AUDIT +SELINUX +IMA +SYSVINIT +LIBCRYPTSETUP +GCRYPT +ACL +XZ -SECCOMP -APPARMOR)
[    2.071250] systemd[1]: Detected architecture 'arm'.
[    2.087345] usb 1-1: New USB device found, idVendor=0424, idProduct=9514
[    2.087367] usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[    2.088123] hub 1-1:1.0: USB hub found
[    2.088220] hub 1-1:1.0: 5 ports detected
[    2.177403] NET: Registered protocol family 10
[    2.178777] systemd[1]: Inserted module 'ipv6'
[    2.180440] systemd[1]: Set hostname to <raspberrypi3>.
[    2.287437] random: systemd-sysv-ge: uninitialized urandom read (16 bytes read, 62 bits of entropy available)
[    2.367048] usb 1-1.1: new high-speed USB device number 3 using dwc_otg
[    2.376225] random: systemd: uninitialized urandom read (16 bytes read, 64 bits of entropy available)
[    2.377569] random: systemd: uninitialized urandom read (16 bytes read, 64 bits of entropy available)
[    2.379038] random: systemd: uninitialized urandom read (16 bytes read, 64 bits of entropy available)
[    2.394013] random: systemd: uninitialized urandom read (16 bytes read, 64 bits of entropy available)
[    2.394750] random: systemd: uninitialized urandom read (16 bytes read, 64 bits of entropy available)
[    2.394919] random: systemd: uninitialized urandom read (16 bytes read, 64 bits of entropy available)
[    2.426856] random: systemd: uninitialized urandom read (16 bytes read, 65 bits of entropy available)
[    2.429425] random: systemd: uninitialized urandom read (16 bytes read, 65 bits of entropy available)
[    2.467358] usb 1-1.1: New USB device found, idVendor=0424, idProduct=ec00
[    2.467380] usb 1-1.1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[    2.470249] smsc95xx v1.0.4
[    2.530700] smsc95xx 1-1.1:1.0 eth0: register 'smsc95xx' at usb-3f980000.usb-1.1, smsc95xx USB 2.0 Ethernet, b8:27:eb:72:96:1b
[    2.536149] systemd[1]: Starting Forward Password Requests to Wall Directory Watch.
[    2.536539] systemd[1]: Started Forward Password Requests to Wall Directory Watch.
[    2.536617] systemd[1]: Starting Remote File Systems (Pre).
[    2.536768] systemd[1]: Reached target Remote File Systems (Pre).
[    2.536909] systemd[1]: Starting Arbitrary Executable File Formats File System Automount Point.
[    2.537443] systemd[1]: Set up automount Arbitrary Executable File Formats File System Automount Point.
[    2.537524] systemd[1]: Starting Encrypted Volumes.
[    2.537594] systemd[1]: Reached target Encrypted Volumes.
[    2.537677] systemd[1]: Starting Swap.
[    2.537744] systemd[1]: Reached target Swap.
[    2.537817] systemd[1]: Expecting device dev-mmcblk0p1.device...
[    2.537888] systemd[1]: Starting Root Slice.
[    2.538028] systemd[1]: Created slice Root Slice.
[    2.538097] systemd[1]: Starting User and Session Slice.
[    2.538324] systemd[1]: Created slice User and Session Slice.
[    2.538398] systemd[1]: Starting Delayed Shutdown Socket.
[    2.538566] systemd[1]: Listening on Delayed Shutdown Socket.
[    2.538637] systemd[1]: Starting /dev/initctl Compatibility Named Pipe.
[    2.538817] systemd[1]: Listening on /dev/initctl Compatibility Named Pipe.
[    2.538887] systemd[1]: Starting Journal Socket (/dev/log).
[    2.539065] systemd[1]: Listening on Journal Socket (/dev/log).
[    2.539158] systemd[1]: Starting udev Control Socket.
[    2.539309] systemd[1]: Listening on udev Control Socket.
[    2.539393] systemd[1]: Starting udev Kernel Socket.
[    2.539510] systemd[1]: Listening on udev Kernel Socket.
[    2.539604] systemd[1]: Starting Journal Socket.
[    2.539783] systemd[1]: Listening on Journal Socket.
[    2.539913] systemd[1]: Starting System Slice.
[    2.540115] systemd[1]: Created slice System Slice.
[    2.540230] systemd[1]: Starting File System Check on Root Device...
[    2.577596] systemd[1]: Starting system-systemd\x2dfsck.slice.
[    2.578016] systemd[1]: Created slice system-systemd\x2dfsck.slice.
[    2.578140] systemd[1]: Starting system-getty.slice.
[    2.578417] systemd[1]: Created slice system-getty.slice.
[    2.578624] systemd[1]: Starting Increase datagram queue length...
[    2.581175] systemd[1]: Starting Restore / save the current clock...
[    2.587617] systemd[1]: Mounted Huge Pages File System.
[    2.587814] systemd[1]: Starting udev Coldplug all Devices...
[    2.591052] systemd[1]: Mounting Debug File System...
[    2.603276] systemd[1]: Started Set Up Additional Binary Formats.
[    2.603756] systemd[1]: Starting Create list of required static device nodes for the current kernel...
[    2.606467] systemd[1]: Mounting POSIX Message Queue File System...
[    2.638300] systemd[1]: Starting Load Kernel Modules...
[    2.641922] systemd[1]: Starting Slices.
[    2.642047] systemd[1]: Reached target Slices.
[    2.662941] systemd[1]: Started Create list of required static device nodes for the current kernel.
[    2.683051] systemd[1]: Starting Create Static Device Nodes in /dev...
[    2.722645] fuse init (API version 7.23)
[    2.729188] systemd[1]: Mounted POSIX Message Queue File System.
[    2.729777] systemd[1]: Mounted Debug File System.
[    2.733960] systemd[1]: Started Increase datagram queue length.
[    2.736543] systemd[1]: Started udev Coldplug all Devices.
[    2.759769] i2c /dev entries driver
[    2.766077] systemd[1]: Started Load Kernel Modules.
[    2.796430] systemd[1]: Started Restore / save the current clock.
[    2.799279] systemd[1]: Time has been changed
[    2.862201] systemd[1]: Mounting FUSE Control File System...
[    2.887903] systemd[1]: Mounting Configuration File System...
[    2.890496] systemd[1]: Starting Apply Kernel Variables...
[    2.893597] systemd[1]: Starting Syslog Socket.
[    2.893921] systemd[1]: Listening on Syslog Socket.
[    2.894074] systemd[1]: Starting Journal Service...
[    2.897368] systemd[1]: Started Journal Service.
[    3.016376] systemd-udevd[136]: starting version 215
[    3.398165] gpiomem-bcm2835 3f200000.gpiomem: Initialised: Registers at 0x3f200000
[    3.398909] bcm2835-wdt 3f100000.watchdog: Broadcom BCM2835 watchdog timer
[    3.592634] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
[    4.013668] systemd-journald[132]: Received request to flush runtime journal from PID 1
[    5.570453] uart-pl011 3f201000.uart: no DMA platform data
[    6.204179] cfg80211: World regulatory domain updated:
[    6.204205] cfg80211:  DFS Master region: unset
[    6.204215] cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time)
[    6.204230] cfg80211:   (2402000 KHz - 2472000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A)
[    6.204243] cfg80211:   (2457000 KHz - 2482000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A)
[    6.204255] cfg80211:   (2474000 KHz - 2494000 KHz @ 20000 KHz), (N/A, 2000 mBm), (N/A)
[    6.204269] cfg80211:   (5170000 KHz - 5250000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (N/A)
[    6.204283] cfg80211:   (5250000 KHz - 5330000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (0 s)
[    6.204296] cfg80211:   (5490000 KHz - 5730000 KHz @ 160000 KHz), (N/A, 2000 mBm), (0 s)
[    6.204308] cfg80211:   (5735000 KHz - 5835000 KHz @ 80000 KHz), (N/A, 2000 mBm), (N/A)
[    6.204320] cfg80211:   (57240000 KHz - 63720000 KHz @ 2160000 KHz), (N/A, 0 mBm), (N/A)
[    6.719190] smsc95xx 1-1.1:1.0 eth0: hardware isn't capable of remote wakeup
[    6.719400] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[    7.204854] random: nonblocking pool is initialized
[    7.256412] Adding 102396k swap on /var/swap.  Priority:-1 extents:4 across:192508k SSFS
[    8.346666] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[    8.347591] smsc95xx 1-1.1:1.0 eth0: link up, 100Mbps, full-duplex, lpa 0xCDE1
[   10.229251] Bluetooth: Core ver 2.21
[   10.229335] NET: Registered protocol family 31
[   10.229345] Bluetooth: HCI device and connection manager initialized
[   10.229366] Bluetooth: HCI socket layer initialized
[   10.229384] Bluetooth: L2CAP socket layer initialized
[   10.229417] Bluetooth: SCO socket layer initialized
[   10.243061] Bluetooth: HCI UART driver ver 2.3
[   10.243083] Bluetooth: HCI UART protocol H4 registered
[   10.243092] Bluetooth: HCI UART protocol Three-wire (H5) registered
[   10.243350] Bluetooth: HCI UART protocol BCM registered
[   10.505486] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[   10.505505] Bluetooth: BNEP filters: protocol multicast
[   10.505527] Bluetooth: BNEP socket layer initialized
to 2)
This is a rather knotty problem, and aside from hacking the base dtbs (which you don't want to do except to verify that that is indeed the cause of the problem), the only way I can think of to get around it is to create a clone of the "mmc" node in your overlay that has all the same properties except "non-removable" but with a slightly different name, then to set/leave the status of the original mmc node as "disabled".
Ok, so how do I do that please?
- Do I copy the fragment which refers to "mmc" and put it into the overlay as [email protected]?
- How do I disable the mmc fragment?
- What name should I give the other fragment?

Also, if this works, how do I go about disabling the Wifi part inclusive the boolean property to make this work of the pi3 in that dtb you talk about?
I really don't need it, I need the 2nd SD card.

to 3)
I also did the conversion to dts via dtc, but that output doesn't look different really.
dtc_sdio-overlay-to-dts_new.jpg
RPi, convert sdio overlay with dtc to dts
dtc_sdio-overlay-to-dts_new.jpg (62.34 KiB) Viewed 9903 times
What am I supposed to do differently there? The dtc result does create the unnecessary clutter in that file.. I'd rather work from a more readable file..

Thanks for helping.

User avatar
JoanTheSpark
Posts: 33
Joined: Sun Feb 21, 2016 5:36 am

Re: RPi 3, Jessie, SDIO.dtbo, problems

Tue Oct 04, 2016 1:38 am

One more question - do you think it possible to use Wifi and the 2nd SDIO interface interchangeably?
Would it 'only' take a reboot for setting up the use of the other feature in some automatic way (software controlled)?
So the Pi, before shutting down can decide with what it 'wakes up' the next time it's booted?
Would that be possible with the abilities I got?
I don't suppose the overlays who control that can be unloaded during run-time, can they?

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 2656
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: RPi 3, Jessie, SDIO.dtbo, problems

Tue Oct 04, 2016 11:09 am

The source to the sdio overlay can be found here. It includes the sdhost overlay (here). All the other overlays are in the same directory (arch/arm/boot/dts/overlays) in the kernel tree.

If you combine the two into one for clarity it looks like this:

Code: Select all

/* Enable SDIO from MMC interface via GPIOs 22-27. Includes sdhost overlay. */

/dts-v1/;
/plugin/;

/* Provide backwards compatible aliases for the old sdhost dtparams. */

/{
	compatible = "brcm,bcm2708";

	[email protected] {
		target = <&sdhost>;
		frag0: __overlay__ {
			brcm,overclock-50 = <0>;
			brcm,pio-limit = <1>;
			brcm,debug-flags = <0>;
			status = "okay";
		};
	};

	[email protected] {
		target = <&mmc>;
		__overlay__ {
			status = "disabled";
		};
	};

	[email protected] {
		target = <&mmc>;
		sdio_mmc: __overlay__ {
			pinctrl-names = "default";
			pinctrl-0 = <&sdio_pins>;
			non-removable;
			bus-width = <4>;
			brcm,overclock-50 = <0>;
			status = "okay";
		};
	};

	[email protected] {
		target = <&gpio>;
		__overlay__ {
			sdio_pins: sdio_pins {
				brcm,pins = <22 23 24 25 26 27>;
				brcm,function = <7 7 7 7 7 7>; /* ALT3 = SD1 */
				brcm,pull = <0 2 2 2 2 2>;
			};
		};
	};

	__overrides__ {
		poll_once = <&sdio_mmc>,"non-removable?";
		bus_width = <&sdio_mmc>,"bus-width:0";
		sdio_overclock = <&sdio_mmc>,"brcm,overclock-50:0";
		overclock_50     = <&frag0>,"brcm,overclock-50:0";
		force_pio        = <&frag0>,"brcm,force-pio?";
		pio_limit        = <&frag0>,"brcm,pio-limit:0";
		debug            = <&frag0>,"brcm,debug?";
	};
};
Fragment 1 is completely unnecessary, since the status property is overwritten by fragment 3.
There is a gap in the fragment numbers caused by the sdhost overlay being updated, but this is no longer fatal.

In order to completely understand the overlay you need to locate the nodes labelled "mmc" and "sdhost" in the base dtb. Reading the source is complicated by the layered nature of the .dts files - this is done to avoid duplication (as much as possible) between the sources for the different Pi models, but by combining bcm2708_common.dtsi and bcm2710-rpi-3-b.dts you get:

Code: Select all

	sdhost: [email protected] {
		compatible = "brcm,bcm2835-sdhost";
		reg = <0x7e202000 0x100>;
		interrupts = <2 24>;
		clocks = <&clk_core>;
		dmas = <&dma 13>;
		dma-names = "rx-tx";
		brcm,overclock-50 = <0>;
		brcm,pio-limit = <1>;
		pinctrl-names = "default";
		pinctrl-0 = <&sdhost_pins>;
		bus-width = <4>;
		status = "okay";
	};

	mmc: [email protected] {
		compatible = "brcm,bcm2835-mmc";
		reg = <0x7e300000 0x100>;
		interrupts = <2 30>;
		clocks = <&clk_mmc>;
		dmas = <&dma 11>;
		dma-names = "rx-tx";
		brcm,overclock-50 = <0>;
		pinctrl-names = "default";
		pinctrl-0 = <&sdio_pins>;
		non-removable;
		bus-width = <4>;
		status = "okay";
	};
What I am suggesting is that your overlay disables the original mmc node and adds one which is identical but without the non-removable property. Avoiding the file inclusion for clarity and omitting the bits of the sdhost overlay you don't need, you get something like this (untried):

Code: Select all

/dts-v1/;
/plugin/;

/{
	compatible = "brcm,bcm2708";

	[email protected] {
		target = <&mmc>;
		__overlay__ {
			status = "disabled";
		};
	};

	[email protected] {
		target = <&soc>;
		__overlay__ {
			mymmc: [email protected] {
				compatible = "brcm,bcm2835-mmc";
				reg = <0x7e300000 0x100>;
				interrupts = <2 30>;
				clocks = <&clk_mmc>;
				dmas = <&dma 11>;
				dma-names = "rx-tx";
				brcm,overclock-50 = <0>;
				pinctrl-names = "default";
				pinctrl-0 = <&mymmc_pins>;
				bus-width = <4>;
				status = "okay";
		};
	};

	[email protected] {
		target = <&gpio>;
		__overlay__ {
			mymmc_pins: mymmc_pins {
				brcm,pins = <22 23 24 25 26 27>;
				brcm,function = <7 7 7 7 7 7>; /* ALT3 = SD1 */
				brcm,pull = <0 2 2 2 2 2>;
			};
		};
	};
I'm not keen on replicating the base DTS in this way because it risks getting out-of-step if there are changes, but I can't think of an alternative.

I think it is ambitious to think of trying to timeshare the MMC interface between SD and WiFi - I don't know how the upper layers are going to react. Wouldn't it be easier to use a USB-connected card reader or WiFi dongle?

gregeric
Posts: 1509
Joined: Mon Nov 28, 2011 10:08 am

Re: RPi 3, Jessie, SDIO.dtbo, problems

Tue Oct 04, 2016 11:26 am

PhilE wrote:I think it is ambitious to think of trying to timeshare the MMC interface between SD and WiFi - I don't know how the upper layers are going to react. Wouldn't it be easier to use a USB-connected card reader or WiFi dongle?
Such time-share does appear to work, at least it does on my SDIO WiFi expansion board. There, on inserting the SD card, I'm holding the WiFi module in reset state, which by luck appears to put the pins tri-state. The WiFi drops out cleanly, and up pops the SD card insert message on the desktop - much like pulling a USB dongle & inserting a mass storage device. WiFi comes back up OK too after pulling the SD card.

Remuxing the SDIO interface pin mapping on the fly should have the same effect, I suppose.

User avatar
JoanTheSpark
Posts: 33
Joined: Sun Feb 21, 2016 5:36 am

Re: RPi 3, Jessie, SDIO.dtbo, problems

Wed Oct 05, 2016 12:00 pm

Hi Phil and Greg, thanks for the replies. Will be working through them now.

@Phil
One question - the link to github with the readable overlay files (dts) still has the old naming convention (xy-overlay.dts). Are those the latest ones then or is there more current ones I shall rather be using?

@Greg
Do you mind giving me a glimpse on your SD card electrical interface, that you used for the SHABPi ?
I found that I forgot the EMI resistors for my test thingy here which might be one of the reasons I have problems - though the signals from the Pi don't look too noisy to me. I got 47k as pull ups for all lines to 3.3V except for CLK and a 100n cap for the supply. The 3.3V come from the RPi, which is fed 5V via the GPIO pins. I might need the 22R series resitors and will add a 10u cap to the 3.3V supply tomorrow.
Just want to make sure I cover all bases regarding bug-hunting on my end.

gregeric
Posts: 1509
Joined: Mon Nov 28, 2011 10:08 am

Re: RPi 3, Jessie, SDIO.dtbo, problems

Wed Oct 05, 2016 12:10 pm

My early prototype was wired directly to the GPIO pins without apparent issue. Thereafter I copied the schematics of the Pi1 & included a 33R series termination resistor for all six lines, with no pullups.

Like you, I'm using the Pi's 3V3 supply with extra decoupling caps close to the socket.

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 2656
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: RPi 3, Jessie, SDIO.dtbo, problems

Wed Oct 05, 2016 12:19 pm

The source naming convention has not changed - there is no ".dtso", so we use "-overlay.dts" instead.

User avatar
JoanTheSpark
Posts: 33
Joined: Sun Feb 21, 2016 5:36 am

Re: RPi 3, Jessie, SDIO.dtbo, problems

Mon Oct 10, 2016 1:52 pm

OK, little update.
Finally got the normal overlay (sdio.dtbo) working for the RPi A+ and 2B. Card pops right up as you said. Really nice to finally see this working. :)
Had some cold reflow solder joints on the SD card slot on the carrier-board and the wires on the flying-test-lead SD card slot must have been to long, the Pi's could see the card, but no access got established.
Now that that is working I'm shooting for the RPi 3B and see if I can get that special overlay working.
Will keep you posted.

User avatar
JoanTheSpark
Posts: 33
Joined: Sun Feb 21, 2016 5:36 am

Re: RPi 3, Jessie, SDIO.dtbo, problems

Wed Oct 12, 2016 2:12 pm

OK, that one works as well.
There were some brackets need to make it work and I'm not really sure if mymmc could use an alias for &mymmc but as I have no clue what I'm doing I leave it as is I guess until problems appear.

Code: Select all

/* Enable SDIO from MMC interface via GPIOs 22-27 for RPi 3B while disabling Wifi */

/dts-v1/;
/plugin/;

/{

   compatible = "brcm,bcm2708";

   [email protected] {
      target = <&mmc>;
      __overlay__ {
         status = "disabled";
      };
   };

   [email protected] {
      target = <&soc>;
      __overlay__ {
         mymmc: [email protected] {
            compatible = "brcm,bcm2835-mmc";
            reg = <0x7e300000 0x100>;
            interrupts = <2 30>;
            clocks = <&clk_mmc>;
            dmas = <&dma 11>;
            dma-names = "rx-tx";
            brcm,overclock-50 = <0>;
            pinctrl-names = "default";
            pinctrl-0 = <&mymmc_pins>;
            bus-width = <4>;
            status = "okay";
         };
      };
   };

   [email protected] {
      target = <&gpio>;
      __overlay__ {
         mymmc_pins: mymmc_pins {
            brcm,pins = <22 23 24 25 26 27>;
            brcm,function = <7 7 7 7 7 7>; /* ALT3 = SD1 */
            brcm,pull = <0 2 2 2 2 2>;
         };
      };
   };
};
That being said, dtc had some qualms with that dts, here is the message:
Warning (reg_format): "reg" property in /[email protected]/__overlay__/[email protected] has invalid length (8 bytes) (#address-cells == 2, #size-cells == 1)
Warning (unit_address_vs_reg): Node /[email protected] has a unit name, but no reg property
Warning (unit_address_vs_reg): Node /[email protected] has a unit name, but no reg property
Warning (unit_address_vs_reg): Node /[email protected] has a unit name, but no reg property
Warning (avoid_default_addr_size): Relying on default #address-cells value for /[email protected]/__overlay__/[email protected]
Warning (avoid_default_addr_size): Relying on default #size-cells value for /[email protected]/__overlay__/[email protected]
Anything I should be worried about?

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 2656
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: RPi 3, Jessie, SDIO.dtbo, problems

Wed Oct 12, 2016 2:22 pm

Three of those warnings can be squashed by adding #address-cells and #size-cells, like this:

Code: Select all

/* Enable SDIO from MMC interface via GPIOs 22-27 for RPi 3B while disabling Wifi */

/dts-v1/;
/plugin/;

/{
   compatible = "brcm,bcm2708";

   [email protected] {
      target = <&mmc>;
      __overlay__ {
         status = "disabled";
      };
   };

   [email protected] {
      target = <&soc>;
      __overlay__ {
         #address-cells = <1>;
         #size-cells = <1>;

         mymmc: [email protected] {
            compatible = "brcm,bcm2835-mmc";
            reg = <0x7e300000 0x100>;
            interrupts = <2 30>;
            clocks = <&clk_mmc>;
            dmas = <&dma 11>;
            dma-names = "rx-tx";
            brcm,overclock-50 = <0>;
            pinctrl-names = "default";
            pinctrl-0 = <&mymmc_pins>;
            bus-width = <4>;
            status = "okay";
         };
      };
   };

   [email protected] {
      target = <&gpio>;
      __overlay__ {
         mymmc_pins: mymmc_pins {
            brcm,pins = <22 23 24 25 26 27>;
            brcm,function = <7 7 7 7 7 7>; /* ALT3 = SD1 */
            brcm,pull = <0 2 2 2 2 2>;
         };
      };
   };
};
The others ("Warning (unit_address_vs_reg): Node /[email protected] has a unit name, but no reg property") you'll have to live with until dtc support for overlays is properly upstreamed. The kernel makefiles add "-W no-unit_address_vs_reg" to the dtc command line, but that is too much to type unless you're writing a script.

User avatar
JoanTheSpark
Posts: 33
Joined: Sun Feb 21, 2016 5:36 am

Re: RPi 3, Jessie, SDIO.dtbo, problems

Thu Oct 13, 2016 12:58 pm

Thanks, that helped.

Return to “Device Tree”