Device-tree improvements

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

Re: Device-tree improvements

Postby TheSaint » Sat Mar 02, 2019 9:45 am

In brief : no differences, even starting whit broken-cd enabled. Anyways there's the report ;)
Also when the card is inserted during boot, the boot appears smooth.
Attachments
cd-broken.report.7z
(33.1 KiB) Downloaded 2036 times
TheSaint
 
Posts: 346
Joined: Mon Jul 23, 2018 7:57 am

Re: Device-tree improvements

Postby summers » Mon Mar 04, 2019 11:37 am

Finally managed to un7zip the file at home ...

Not sure I could see the question answered. I'm following up this post: http://lists.infradead.org/pipermail/linux-rockchip/2019-February/023062.html

My understanding is when you do a $this->bbcode_second_pass_code('', 'systemctl reboot') is that during kernel going down, the vccio_sd regulator is switched off, and this stays off when warm rebooting into uboot - and so the sd card can't be detected - and so can't be booted from a second time. So it takes a full power down, to get vccio_sd to switch back on again.

This sounds strange to me, I understood the uboot configuration to explicitly say enable the sd card slot, which I'd expect would also enable the regulator.

So thats where I'm confused, its a very specific order of things that needs to happen.
summers
 
Posts: 995
Joined: Sat Sep 06, 2014 12:56 pm

Re: Device-tree improvements

Postby TheSaint » Tue Mar 05, 2019 12:37 am

I've read all the discussion on infradead ;)
Now I just tried a cold boot with the card inserted. My apologizes to use the 7zip, but really it gives about 30% smaller result.
Honestly I lost the faith about TBS, so it's laying in a drawer for a future decision to make an use of it. Sorry.
Attachments
report.zip
(22.94 KiB) Downloaded 1849 times
TheSaint
 
Posts: 346
Joined: Mon Jul 23, 2018 7:57 am

Re: Device-tree improvements

Postby summers » Tue Mar 05, 2019 10:46 am

Yes know what you mean about compressed files, I usually use xz compressed these days, and lzma compression like 7z; xz is more native on linux desktops, whereas 7z tends to be on windows. This said 7zip will uncompress .xz files, and there are unix applications for 7z (https://wiki.archlinux.org/index.php/p7zip).

Think the problem with the reports is I can't see whats a warm reboot, and what is cold.

First check the regulator functions. I think thats shown in:

$this->bbcode_second_pass_code('', 'ls /proc/device-tree/i2c@ff650000/rk808/regulators/vccio_sd')

Or maybe the cryptic
$this->bbcode_second_pass_code('', 'ls /proc/device-tree/i2c@ff650000/pmic@1b/regulators/LDO_REG5')
where @ will need to be escaped ....

and what you need to look for is:

$this->bbcode_second_pass_code('', 'regulator-always-on;
regulator-boot-on;')

Trying to work out what minimal test of the problem as described is. Think if from arch you do
$this->bbcode_second_pass_code('', 'systemctl reboot')
Then interrupt uboot. Then
$this->bbcode_second_pass_code('', 'mmc list')
Should show both the rk3288 sd (dwmmc@ff0c0000) and emmc (dwmmc@ff0f0000) interfaces (I think), but you won't be able to access the sd interface. Looks like the sd card is on devnum=1

Should be enough just to show access in uboot.

So theory is when in a warm reboot you won't be able to access the sd card (mmc 1) unless "regulator-boot-on;" is shown in the first step of this process ...

At some level, these arm boards are a learning experience, e.g. that the ref design for rk3288 has strange pull up on the sd card. At some level its then a case of just getting enough to work so you can do your use case.

Talking of which, did you ever get the various interfaces working that you needed? I forget what you wanted to talk to, iirc an i2c/sdio device, and some motor control?
summers
 
Posts: 995
Joined: Sat Sep 06, 2014 12:56 pm

Re: Device-tree improvements

Postby TheSaint » Wed Mar 06, 2019 1:15 am

I installed linux 5.0.0 :)
Warm boot I get$this->bbcode_second_pass_code('', '$ => <INTERRUPT>
=> mmc list
dwmmc@ff0c0000: 1
dwmmc@ff0f0000: 0 (eMMC)')
This isn't viable$this->bbcode_second_pass_code('', '$ s /proc/device-tree/i2c@ff650000/rk808/regulators/vccio_sd
ls: cannot access '/proc/device-tree/i2c@ff650000/rk808/regulators/vccio_sd': No such file or directory
myself@alarm-~> ls /proc/device-tree/i2c@ff650000
'#address-cells' clock-names interrupts pinctrl-names status
'#size-cells' clocks name pmic@1b
clock-frequency compatible pinctrl-0 reg')
This is there$this->bbcode_second_pass_code('', '$ls /proc/device-tree/i2c\@ff650000/
'#address-cells' clock-names interrupts pinctrl-names status
'#size-cells' clocks name pmic@1b
clock-frequency compatible pinctrl-0 reg

#=========================================================

$ ls /proc/device-tree/i2c@ff650000/pmic@1b/regulators/LDO_REG5
name regulator-max-microvolt regulator-name
phandle regulator-min-microvolt regulator-state-mem')
to avoid misunderstanding$this->bbcode_second_pass_code('', '$ md5sum /boot/dtb/rk3288-tinker-s.dtb
06c9056b1b51d6bd02450b6c00f6da09 /boot/dtb/rk3288-tinker-s.dtb')
I suppose I'm using the correct dtb, am I ?

EDIT
I discovered that the stock dtb from linux 5.0.0 now is working similar to yours. But broken-CD cause some warning$this->bbcode_second_pass_code('', '[ 1285.559891] mmc0: card 0007 removed
[ 1285.596445] mmc_host mmc0: Bus speed (slot 0) = 400000Hz (slot req 400000Hz, actual 400000HZ div = 0)
[ 1285.647760] mmc_host mmc0: Bus speed (slot 0) = 300000Hz (slot req 300000Hz, actual 300000HZ div = 0)
[ 1285.702473] mmc_host mmc0: Bus speed (slot 0) = 200000Hz (slot req 200000Hz, actual 200000HZ div = 0)
[ 1285.763881] mmc_host mmc0: Bus speed (slot 0) = 187500Hz (slot req 100000Hz, actual 93750HZ div = 1)
[ 1314.921896] mmc0: new high speed SDHC card at address 0007
[ 1314.928817] mmcblk0: mmc0:0007 SD16G 14.4 GiB
[ 1314.935031] mmcblk0: p1 p2 p3
[ 1357.943540] mmc0: card 0007 removed
[ 1443.209201] mmc0: new high speed SDHC card at address 0007
[ 1443.217399] mmcblk0: mmc0:0007 SD16G 14.4 GiB
[ 1443.223628] mmcblk0: p1 p2 p3')

So to complete the adventure, I'd like to get bluetooth working and perhaps to arrange for overlays, which can help beginners to imitate the RPi, as Asus conceived its TBS.
Attachments
report.zip
(23.04 KiB) Downloaded 1817 times
TheSaint
 
Posts: 346
Joined: Mon Jul 23, 2018 7:57 am

Re: Device-tree improvements

Postby summers » Wed Mar 06, 2019 2:52 pm

Ta, Thanks. Its good that $this->bbcode_second_pass_code('', 'ls /proc/device-tree/i2c\@ff650000/pmic\@1b/regulators/LDO_REG5') works - gives an easy way to see whats set in the regulator - as (I don't know about you) but I'm loosing track of all these device trees, with many names used several times.

Alas I didn't give you all the uboot mmc commands needed. $this->bbcode_second_pass_code('', 'mmc list') shows you what uboot think are sdio/mmc devices. So running that command checks that uboot has been configured correctly for your machine. Alas though it just goes as far as the memory mapped location in the cpu, so its really just checking that you have the right sdio connections.

Now for us the problem is that the sd card isn't getting powered, possibly in a warm reboot. Only way I know to test that is to try and access the sd card. Probably easiest is listing the partitions on the sd card. Alas I'm only in uboot rarely - and doing these commands from memory is a nightmare - all I can do is browse the source code:http://git.denx.de/?p=u-boot.git;a=blob;f=cmd/mmc.c; so if I had to guess commands its
$this->bbcode_second_pass_code('', 'mmc dev 1
mmc part')
First sets the mmc device to the sd slot, and the second says list partitions. Now if the sd card isn't powered, we won't be able to list the partitions and so the second should fail.

So what is underlying this theory, is that uboot doesn't know that the sd card io is powered by a regulator on the rk808 device, which can be talked to across i2c0.

So alas needs another warm reboot - sorry. If the $this->bbcode_second_pass_code('', 'mmc part') fails - then we'll need to see if setting regulator-boot-on cures that problem.

Sorry this is so involved, and its a bit of dance between the kernel and uboot.

Oh yes - fairly sure that the mainline TBS dtb is still the old one: https://github.com/torvalds/linux/commits/master/arch/arm/boot/dts/rk3288-tinker.dtsi. Changes being discussed here, are probably already too late for the 5.1 kernel - so aim would be now for 5.2. Alas the hoops in the kernel are this slow ...
summers
 
Posts: 995
Joined: Sat Sep 06, 2014 12:56 pm

Re: Device-tree improvements

Postby TheSaint » Thu Mar 07, 2019 8:25 am

My test after rebooting with card inserted, don't shows the detection$this->bbcode_second_pass_code('', '=> mmc list
dwmmc@ff0c0000: 1
dwmmc@ff0f0000: 0 (eMMC)
=> ls mmc 1:1
Card did not respond to voltage select!
## Reinserting the card
=> mmc list
dwmmc@ff0c0000: 1
dwmmc@ff0f0000: 0 (eMMC)
=> ls mmc 1
## empty ##
=> ls mmc 0
<DIR> 4096 .
<DIR> 4096 ..
<DIR> 16384 lost+found
<DIR> 4096 etc
<SYM> 7 bin
<DIR> 4096 tmp
<SYM> 7 lib
<DIR> 4096 home
<DIR> 4096 srv
<DIR> 4096 usr
<DIR> 4096 run
<DIR> 4096 var
<DIR> 4096 root
<DIR> 4096 boot
<DIR> 4096 proc
<DIR> 4096 mnt
<DIR> 4096 sys
<DIR> 4096 dev
<DIR> 4096 opt
<SYM> 7 sbin')
Whereas a cold boot gives$this->bbcode_second_pass_code('', '
##Booting with inserted card
=> ls mmc 1
dtbs/
overlays/
extlinux/
5124674 initramfs-linux.img
6311112 zImage
7697472 zImage.TBos
7697472 vmlinuz
68823 rk3288-miniarm.dtb
305 hw_intf.conf

6 file(s), 3 dir(s)
##Cold boot without card inserted
=> mmc list
dwmmc@ff0c0000: 1
dwmmc@ff0f0000: 0 (eMMC)
=> ls mmc 1
Card did not respond to voltage select!
## inserting the card
=> ls mmc 1
dtbs/
overlays/
extlinux/
5124674 initramfs-linux.img
6311112 zImage
7697472 zImage.TBos
7697472 vmlinuz
68823 rk3288-miniarm.dtb
305 hw_intf.conf

6 file(s), 3 dir(s)
## removing the card
=> ls mmc 1:2
** fs_devread read error - block
Failed to mount ext2 filesystem...
** Unrecognized filesystem type **
=> ls mmc 1
dtbs/
overlays/
extlinux/
5124674 initramfs-linux.img
6311112 zImage
7697472 zImage.TBos
7697472 vmlinuz

4 file(s), 3 dir(s)
##reinserting the card
=> ls mmc 1:2
** fs_devread read error - block
Failed to mount ext2 filesystem...
** Unrecognized filesystem type **')
After a reset from u-boot$this->bbcode_second_pass_code('', '=> <INTERRUPT>
=> mmc dev 1
switch to partitions #0, OK
mmc1 is current device
=> mmc part

Partition Map for MMC device 1 -- Partition Type: DOS

Part Start Sector Num Sectors UUID Type
1 8192 131072 58bc1052-01 0c
2 139264 8192000 58bc1052-02 83
3 8331264 21921792 58bc1052-03 83
## removed the card
=> ls mmc 1:2
** fs_devread read error - block
Failed to mount ext2 filesystem...
** Unrecognized filesystem type **
## reinserted the card
=> mmc dev 1
switch to partitions #0, OK
mmc1 is current device
=> mmc part

Partition Map for MMC device 1 -- Partition Type: DOS

Part Start Sector Num Sectors UUID Type
1 8192 131072 58bc1052-01 0c
2 139264 8192000 58bc1052-02 83
3 8331264 21921792 58bc1052-03 83
=> ls mmc 1:2
<DIR> 4096 .
<DIR> 4096 ..
<DIR> 16384 lost+found
<DIR> 4096 opt
<DIR> 4096 tmp
<DIR> 4096 var
<DIR> 4096 mnt
<DIR> 4096 srv
<DIR> 4096 run
<DIR> 4096 usr
<SYM> 7 bin
<DIR> 4096 proc
<DIR> 4096 home
<SYM> 7 sbin
<DIR> 4096 dev
<DIR> 4096 etc
<DIR> 4096 sys
<DIR> 4096 root
<DIR> 4096 boot
<SYM> 7 lib')
It's evident that a mmc dev 1 triggers to reread the partition table, so the partitions and the card is recognized.
Definitely, the cached file list is misleading, but might be similar from other cases whilst used with the kernel.
TheSaint
 
Posts: 346
Joined: Mon Jul 23, 2018 7:57 am

Re: Device-tree improvements

Postby summers » Thu Mar 07, 2019 9:39 am

Excellent - so we can see the problem.

When you boot on the power dtb; then go through the same test after warm reboot; does the problem get cured?

Actually if I get time today, I'll do a broken-cd + regulator on boot dtb. As thats the theory for what should solve this problem.

And yes the command $this->bbcode_second_pass_code('', 'ls mmc 1:1') is the kind of test we need to see if the card is power - so good thought on your part.
summers
 
Posts: 995
Joined: Sat Sep 06, 2014 12:56 pm

Re: Device-tree improvements

Postby summers » Thu Mar 07, 2019 9:24 pm

OK try [url]davidjohnsummers.uk/rk3288-tinker-s-bcd+pob.dtb[/url]

Boot into it, then do:
$this->bbcode_second_pass_code('', 'ls /proc/device-tree/i2c\@ff650000/pmic\@1b/regulators/LDO_REG5')
It should show that you have regulator-boot-on

Then warm reboot, and see if you can access the sd card from uboot as before.

Hopefully this will fix that, it has broken-cd in there - so shouldn't give all the errors. Also has probably final wifi code; so wifi should work.
summers
 
Posts: 995
Joined: Sat Sep 06, 2014 12:56 pm

Re: Device-tree improvements

Postby TheSaint » Fri Mar 08, 2019 1:23 am

$this->bbcode_second_pass_quote('', 'W')hen you boot on the power dtb; then go through the same test after warm reboot; does the problem get cured?

Forgive me I don't get it clearly.
Now I try a cold boot: Logged in :) .
$this->bbcode_second_pass_code('', '$ ls /proc/device-tree/i2c\@ff650000/pmic\@1b/regulators/LDO_REG5
name regulator-boot-on regulator-min-microvolt regulator-state-mem
phandle regulator-max-microvolt regulator-name')
Now reboot ;)
$this->bbcode_second_pass_code('', '=> <INTERRUPT>
=> <INTERRUPT>
=> <INTERRUPT>
=> setenv devtype mmc
=> setenv devnum 0
=> setenv bootpart 1
=> setenv rootcmd "LABEL=TB-MM-root"
=> setenv fdtfile rk3288-tinker-s-bcd+pob.dtb
=> setenv bootargs "console=ttyS2,115200n8 root=${rootcmd} rw rootwait"
=>
=> load ${devtype} ${devnum}:${bootpart} ${kernel_addr_r} /boot/zImage
6623480 bytes read in 155 ms (40.8 MiB/s)
=> mmc list
dwmmc@ff0c0000: 1
dwmmc@ff0f0000: 0 (eMMC)
## REMOVED CARD
=> ls mmc 1
Card did not respond to voltage select!
## INSERTED CARD
=> ls mmc 1
dtbs/
overlays/
extlinux/
5124674 initramfs-linux.img
6311112 zImage
7697472 zImage.TBos
7697472 vmlinuz
68823 rk3288-miniarm.dtb
305 hw_intf.conf

6 file(s), 3 dir(s)

=> ls mmc 1
dtbs/
overlays/
extlinux/
5124674 initramfs-linux.img
6311112 zImage
7697472 zImage.TBos
7697472 vmlinuz

4 file(s), 3 dir(s)
## REMOVED CARD
=> ls mmc 1:2
** fs_devread read error - block
Failed to mount ext2 filesystem...
** Unrecognized filesystem type **')
Booted$this->bbcode_second_pass_code('', 'ls /proc/device-tree/i2c\@ff650000/pmic\@1b/regulators/LDO_REG5
name regulator-boot-on regulator-min-microvolt regulator-state-mem
phandle regulator-max-microvolt regulator-name

## card insertion, report on dmesg TTY2

[ 150.914659] mmc0: new high speed SDHC card at address 0007
[ 150.921591] mmcblk0: mmc0:0007 SD16G 14.4 GiB
[ 150.927790] mmcblk0: p1 p2 p3

### on the terminal
$ dmesg |tail
<audit snipped>
[ 150.914659] mmc0: new high speed SDHC card at address 0007
[ 150.921591] mmcblk0: mmc0:0007 SD16G 14.4 GiB
[ 150.927790] mmcblk0: p1 p2 p3
[ 209.257504] mmc0: card 0007 removed')
It looks like the card works for the kernel and for the u-boot (Armbian one ;) )
My feeling is that is cooked finely :) It might be my new default :P
Attachments
report.zip
(35.65 KiB) Downloaded 1904 times
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 25 guests