Device-tree improvements

This is for any ARMv7 device that we do not officially support.

Re: Device-tree improvements

Postby summers » Sat Jul 13, 2019 8:21 pm

Glad most of it has finally gone mainline.

I'd largely forgotten about this thread, now am usually posting on melodeon.net - for my new toy.

IIRC bluetooth needed changes made to drivers to a new system, before the device tree hocks would be added. At least to do everything a modern way, which is what made sense. Don't know if anyone is following changes to the bluetooth drivers, I'm certainly not.

Regards,

David.
summers
 
Posts: 984
Joined: Sat Sep 06, 2014 12:56 pm

Re: Device-tree improvements

Postby TheSaint » Sat Jul 13, 2019 11:24 pm

I'd like to add a little use case when it's needed to address to the GPIO. There's an addition that could make a bit easier to handle with wiringTB.
I'm struggling to use the GPIO, but that's is not accessible in a user space. So the program fails to accomplish the task.

BTW, what's named the new baby :) ?
TheSaint
 
Posts: 346
Joined: Mon Jul 23, 2018 7:57 am

Re: Device-tree improvements

Postby summers » Sun Jul 14, 2019 10:22 am

The new baby is a Hohner 3515, and is actually aged about 90, so a shed load older than I!

Don't recall your cpu, but many arm cpu's pin out are multifunctional. So you need to decide what mode a pin is, maybe GPIO, maybe UART, and so on. Configurations like really shouldn't be done in user space, yes thats been done at times, but generally considered a mess.

So setting up pins as GPIO is normally a device tree activity, either through overlays, or by getting uboot to rewrite the device tree. Yes doing this is a hassle, but that hassle is needed.
summers
 
Posts: 984
Joined: Sat Sep 06, 2014 12:56 pm

Re: Device-tree improvements

Postby TheSaint » Thu Jul 18, 2019 1:38 pm

Mhmm, strangely booting ALarm from SD card, the eMMC is not seen.
TheSaint
 
Posts: 346
Joined: Mon Jul 23, 2018 7:57 am

Re: Device-tree improvements

Postby summers » Sun Jul 21, 2019 10:28 am

Odd. Not really up to speed on this right now. What does $this->bbcode_second_pass_code('', 'dmesg | grep mmc') say?

Also $this->bbcode_second_pass_code('', 'cat /sys/bus/mmc/devices/*/name')
summers
 
Posts: 984
Joined: Sat Sep 06, 2014 12:56 pm

Re: Device-tree improvements

Postby TheSaint » Mon Jul 22, 2019 9:45 am

$this->bbcode_second_pass_code('', '$ dmesg | grep mmc
[ 0.000000] rockchip_mmc_get_phase: invalid clk rate
[ 0.000000] rockchip_mmc_get_phase: invalid clk rate
[ 0.000000] rockchip_mmc_get_phase: invalid clk rate
[ 0.000000] rockchip_mmc_get_phase: invalid clk rate
[ 0.000000] rockchip_mmc_get_phase: invalid clk rate
[ 0.000000] rockchip_mmc_get_phase: invalid clk rate
[ 0.000000] rockchip_mmc_get_phase: invalid clk rate
[ 0.000000] rockchip_mmc_get_phase: invalid clk rate
[ 1.510540] sdmmc-regulator GPIO handle specifies active low - ignored
[ 3.814296] dwmmc_rockchip ff0c0000.dwmmc: IDMAC supports 32-bit address mode.
[ 3.822488] dwmmc_rockchip ff0c0000.dwmmc: Using internal DMA controller.
[ 3.830083] dwmmc_rockchip ff0c0000.dwmmc: Version ID is 270a
[ 3.836530] dwmmc_rockchip ff0c0000.dwmmc: DW MMC controller at irq 30,32 bit host data width,256 deep fifo
[ 3.847548] mmc_host mmc0: card is polling.
[ 3.864865] mmc_host mmc0: Bus speed (slot 0) = 400000Hz (slot req 400000Hz, actual 400000HZ div = 0)
[ 3.888054] dwmmc_rockchip ff0d0000.dwmmc: IDMAC supports 32-bit address mode.
[ 3.896233] dwmmc_rockchip ff0d0000.dwmmc: Using internal DMA controller.
[ 3.903841] dwmmc_rockchip ff0d0000.dwmmc: Version ID is 270a
[ 3.910281] dwmmc_rockchip ff0d0000.dwmmc: DW MMC controller at irq 31,32 bit host data width,256 deep fifo
[ 3.921302] dwmmc_rockchip ff0d0000.dwmmc: allocated mmc-pwrseq
[ 3.927941] mmc_host mmc1: card is non-removable.
[ 3.949812] mmc_host mmc1: Bus speed (slot 0) = 400000Hz (slot req 400000Hz, actual 400000HZ div = 0)
[ 3.961433] mmc_host mmc0: Bus speed (slot 0) = 50000000Hz (slot req 50000000Hz, actual 50000000HZ div = 0)
[ 3.972352] mmc0: new high speed SDHC card at address 0007
[ 3.972996] dwmmc_rockchip ff0f0000.dwmmc: IDMAC supports 32-bit address mode.
[ 3.979189] mmcblk0: mmc0:0007 SD16G 14.4 GiB
[ 3.991681] dwmmc_rockchip ff0f0000.dwmmc: Using internal DMA controller.
[ 3.992876] mmcblk0: p1 p2
[ 3.999288] dwmmc_rockchip ff0f0000.dwmmc: Version ID is 270a
[ 4.008850] dwmmc_rockchip ff0f0000.dwmmc: DW MMC controller at irq 32,32 bit host data width,256 deep fifo
[ 4.018304] mmc_host mmc1: Bus speed (slot 0) = 50000000Hz (slot req 50000000Hz, actual 50000000HZ div = 0)
[ 4.019821] mmc_host mmc2: card is non-removable.
[ 4.031222] mmc1: new high speed SDIO card at address 0001
[ 4.051217] mmc_host mmc2: Bus speed (slot 0) = 400000Hz (slot req 400000Hz, actual 400000HZ div = 0)
[ 4.123353] mmc_host mmc2: Bus speed (slot 0) = 300000Hz (slot req 300000Hz, actual 300000HZ div = 0)
[ 4.176014] mmc_host mmc2: Bus speed (slot 0) = 200000Hz (slot req 200000Hz, actual 200000HZ div = 0)
[ 4.236030] mmc_host mmc2: Bus speed (slot 0) = 187500Hz (slot req 100000Hz, actual 93750HZ div = 1)
[ 9.717507] EXT4-fs (mmcblk0p1): mounted filesystem with ordered data mode. Opts: (null)
[ 11.428083] EXT4-fs (mmcblk0p1): re-mounted. Opts: data=ordered
[ 12.275969] dwmmc_rockchip ff0c0000.dwmmc: Unexpected interrupt latency
[ 14.382024] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: data=ordered

$ cat /sys/bus/mmc/devices/*/name
SD16G

$ sudo fdisk -l
Disk /dev/mmcblk0: 14.44 GiB, 15489564672 bytes, 30253056 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x35807033

Device Boot Start End Sectors Size Id Type
/dev/mmcblk0p1 * 8192 8396799 8388608 4G 83 Linux
/dev/mmcblk0p2 8396800 30253055 21856256 10.4G 83 Linux

')

As you may note, the fdisk doesn't list the eMMC.
TheSaint
 
Posts: 346
Joined: Mon Jul 23, 2018 7:57 am

Re: Device-tree improvements

Postby summers » Mon Jul 22, 2019 2:59 pm

Confusing. in Boot you have the various ff0{c,d,e,f} messages, one of which is emmc, I forget which.

But yes when boot only a 16 GB card is seen, which I guess is external SD card. Guess need to remember which address is the eMMC chip, and examine closer. Guess you could check if the device tree has the correct listing. Other than that look for errors.
summers
 
Posts: 984
Joined: Sat Sep 06, 2014 12:56 pm

Re: Device-tree improvements

Postby TheSaint » Tue Jul 23, 2019 5:37 am

Please, don't go beyond the comfort line, I don't bother much about, since I moved the root to eMMC.
In the case anybody else is looking to get a fix, I'll resume the matter and proceed the investigation.

I achieved my goal, installed Arch and using Home Assistant on it, with very little drawback. The only one is the bluetooth, but I plugged a USB dongle.
TheSaint
 
Posts: 346
Joined: Mon Jul 23, 2018 7:57 am

Re: Device-tree improvements

Postby summers » Wed Jul 24, 2019 9:37 am

Its not that its difficult, just lack of time.

All it should take is finding in the device tree the memory address of the eMMC. Then booting both from the eMMC and from the SD and noting the kernel messes connected to the eMMC and its memory address. The difference should explain whats going wrong, the solution may be more complicated ...

With bluetooth, that would be easiest when the bluetooth driver for your device is updated to use the modern serdev. Once thats done its fairly simple to add it to the device tree, and it should work fine. I don't know if anyone is working on making the h4/h5 bluetooth driver serdev compliant, or anyone here is monitoring if its happening ...
summers
 
Posts: 984
Joined: Sat Sep 06, 2014 12:56 pm

Re: Device-tree improvements

Postby TheSaint » Thu Jul 25, 2019 5:43 am

I think that Armbian is the only one that keeps fixes on the tinkerboard world.
TheSaint
 
Posts: 346
Joined: Mon Jul 23, 2018 7:57 am

PreviousNext

Return to Community Supported

Who is online

Users browsing this forum: No registered users and 6 guests