TonyMac32 Posted June 25, 2017 Posted June 25, 2017 *Updated 7-23* ~~All kernels should be fixed at this point, Legacy, Next, and Dev.~~ The ASUS Tinker Board has a big problem with rebooting properly, centered around the SD card power supplies. Upon issuing a shutdown request, the kernel is turning everything off , including the vmmc regulator. To make matters worse, vqmmc is set to 1.8 Volts if you use a UHS SD card, and the kernel is not switching it back to 3.3 volts before rebooting, which is required if the Rockchip boot ROM is to communicate with the device. The result is a hung board in MaskROM mode. For the Default kernel (4.4), a patch was carried over from the vendor software (quite literally tagged as "HACK" which added a shutdown routine to the rk mmc driver. It powers vmmc back up, switches vqmmc back to 3.3 volts, then delays for 20 uS or so. It works on default. 7-22: Need to add fix for " echo b > /proc/sysrq-trigger " ETA: 7-22 or 7-23 7-22: Adding device check to make certain there are no complications with the MiQi. Concurrent with sysrq fiq. Complete and uploaded. For Next/Dev kernels, however, it does not work. I don't know the full system that well, so I can't comment as to why just yet. It is also important to note that testing the patch on kernel 4.11/4.12 resulted in a MiQi crash on reboot, wheras I've had confirmed this doesn't appear to be an issue on 4.4. 7-22: It was determined a day or so ago that the issue was the mmc not being powered down before the hack happened. Now that is commanded. 7-22: Initial patch broke MiQi, myself and @Myy worked today on figuring it out, trading kernels and patches. We thought it a good idea to use the device tree platform to discriminate. Fix is now known, adapting patches and moving them from Dev to Next. Implemented 7-23: Rockchip-DEV is now kernel 4.13, reboot patch tested and works. Any expertise in this area would be welcome, I'll update this post as things go on. 1
Myy Posted June 27, 2017 Posted June 27, 2017 When looking for 'reboot' hooks on the platform_driver structure, I stumbled into this : https://groups.google.com/forum/?_escaped_fragment_=topic/linux.kernel/QFt8UL8WgxQ#!topic/linux.kernel/QFt8UL8WgxQ I don't know if that could be related to this issue. It talks about setting up special registers on reboot, to tell the Rockchip boot system which mode should be used for the next cycle.
TonyMac32 Posted June 27, 2017 Author Posted June 27, 2017 I've seen reference to reboot modes from the dts side, don't have a lot of data, thanks for the additional info.
Tido Posted July 16, 2017 Posted July 16, 2017 Hi @Myy, I would like to test, but compiling and such is new to me. I saw this in another forum: Quote The kernel 4.12.0, with Mali r17p0 drivers and various RK3288 patcheshttps://github.com/Miouyouyou/MyyQi/releases This so called release is not an image but all you need to create a Kernel, right ? I saw your posting with: Quote If you use the Tinkering branch, here: https://github.com/Miouyouyou/MyyQi/tree/Tinkering Add the following boot option to your boot loader : rockchip_tinkerrebootfix=on Then try to get a serial output, shutdown the machine and paste the serial output here, directly or through a pastebin/ghostbin link. This will help me understand what's happening during the shutdown phase, and maybe resolve the issue altogether. For someone like me who knows quite a bit but not as much as you do Can or must I compile this on my x86 PC and burn it on the SDcard or ..which is the correct way to proceed? Hmm, or is this just the Kernel and DeviceTree that need to be compiled and copied into an armbian 4.12 as example? 1
Myy Posted July 16, 2017 Posted July 16, 2017 2 hours ago, Tido said: This so called release is not an image but all you need to create a Kernel, right ? It's both actually ! In the boot, lib and usr directories for the release, you'll have the appropriate files you need to copy in your system's /boot, /usr and /lib directories. That said, I haven't generate any release for the Tinkering branch, so you'll have to clone it through Git. Basically, you could do something like this to generate a kernel archive that you can unpack elsewhere : git clone -b Tinkering --depth 1 https://github.com/Miouyouyou/MyyQi cd MyyQi tar cJpvf kernel.tar.xz boot lib usr Then you can copy the kernel.tar.xz in the MyyQi folder on your RK3288 board, unpack it in tmp, mount your /boot partition if it's on a specific partition, and copy the each folder like this : tar xJpvf kernel.tar.xz cp -r usr/* /usr/ cp -r lib/* /lib/ Then copy the zImage in boot/ in your boot partition, along with the rk3288-tinker.dtb or rk3288-miniarm.dtb. On Armbian, DTB files should be placed in /boot/dtb . You might also have to play with your bootloader, in order to boot this specific image. If you know what you're doing, you could just copy the kernel.tar.xz in / and unpack it directly, though. I'll try to make this clearer for the next release. Now, concerning the kernel compilation, you just need to copy the compilation script somewhere, edit the export CROSS_COMPILE=armv7a-hardfloat-linux-gnueabi- So that it matches your cross-compiler prefix. If you don't know what is a cross-compiler prefix, it's basically what's prefixed to cross-compiling binaries names. In my case, the cross-compiling gcc is actually : armv7a-hardfloat-linux-gnueabi-gcc and the cross-compiling ld is actually : armv7a-hardfloat-linux-gnueabi-ld , etc...
Tido Posted July 16, 2017 Posted July 16, 2017 (edited) Well, I guess it already fits as it is - so there is no need for me to compile the Kernel? Burned the SDcard with armbian 4.12 nightly (unfortunately desktop image, quite large). What I did: git clone -b Tinkering --depth 1 https://github.com/Miouyouyou/MyyQi cd MyyQi tar cJpvf kernel.tar.xz boot lib usr Followed by: sudo dolphin create a folder on the SDcard (home directory) copy the kernel.tar.xz into that. Connect the UART cable. Insert the SDcard in tinker board, Power. Boot the tinker board (reboot doesn't work so while extending the SDcard it 'dies'). Power off - Power on - login as root. cd /home/tido/ Unpack all the files: tar xJpvf kernel.tar.xz open a second SSH look into the folder: cd /usr/ ls -la copy the files cp -r usr/* /usr/ cp -r lib/* /lib/ in the second SSH cd /boot ls -la cd /home/tido/boot/ ls -la cp -r zImage /boot/ cp -r rk3288-tinker.dtb /boot/dtb/ Armbian uses currently not the dtb called: tinker. Instead rk3288-miniarm.dtb rk3288-miqi.dtb. cp -r rk3288-miniarm.dtb /boot/dtb/ cp -r rk3288-miqi.dtb It is actually an easy instruction for everyone uname -a Linux tinkerboard 4.12.0-rc6-The-Twelve-MyyQi+ #1 SMP PREEMPT Fri Jun 30 19:37:05 UTC 2017 armv7l armv7l armv7l GNU/Linux UART connection reboot, it died at: [ OK ] Started Session c2 of user tido. reboot - now I can login armbianmonitor -u /var/log/armhwinfo.log has been uploaded to http://sprunge.us/NAFa Is this already in the file ? Add the following boot option to your boot loader : rockchip_tinkerrebootfix=on Just the shutdown Spoiler root@tinkerboard:~# init 0 [ OK Stopping Session c5 of user root. [ OK ] Stopped target Timers. [ OK ] Stopped target Multi-User System. Stopping LSB: Start/stop sysstat's sadc... [ OK ] Stopped target Login Prompts. Stopping Getty on tty1... Stopping Serial Getty on ttyS2... Stopping Avahi mDNS/DNS-SD Stack... Stopping LSB: Set sysfs variables from /etc/sysfs.conf... Stopping Regular background program processing daemon... Stopping LSB: Armbian gathering hardware information... Stopping LSB: No Display Manager... Stopping LSB: Starts LIRC daemon.... Stopping LSB: Start NTP daemon... Stopping Unattended Upgrades Shutdown... Stopping OpenBSD Secure Shell server... Stopping Authenticate and Authorize Users to Run Privileged Tasks... [ OK ] Stopped target Sound Card. [ OK ] Stopped Daily Cleanup of Temporary Directories. [ OK ] Stopped Daily apt activities. Stopping LSB: Advanced IEEE 802.11 management daemon... [ OK ] Stopped target System Time Synchronized. Stopping Save/Restore Sound Card State... Stopping LSB: disk temperature monitoring daemon... Stopping System Logging Service... Stopping Accounts Service... [ OK ] Closed Load/Save RF Kill Switch Status /dev/rfkill Watch. [ OK ] Stopped System Logging Service. [ OK ] Stopped Regular background program processing daemon. [ OK ] Stopped Accounts Service. [ OK ] Stopped Avahi mDNS/DNS-SD Stack. [ OK ] Stopped Authenticate and Authorize Users to Run Privileged Tasks. [ OK ] Stopped OpenBSD Secure Shell server. [ OK ] Stopped Getty on tty1. [ OK ] Stopped Serial Getty on ttyS2. [ OK ] Stopped User Manager for UID 0. [ OK ] Stopped Session c5 of user root. [ OK ] Stopped LSB: Advanced IEEE 802.11 management daemon. [ OK ] Stopped Save/Restore Sound Card State. [ OK ] Stopped LSB: Start/stop sysstat's sadc. [ OK ] Stopped LSB: Set sysfs variables from /etc/sysfs.conf. [ OK ] Stopped LSB: No Display Manager. [ OK ] Stopped LSB: Starts LIRC daemon.. [ OK ] Stopped LSB: Start NTP daemon. [ OK ] Stopped LSB: disk temperature monitoring daemon. Stopping LSB: set CPUFreq kernel parameters... [ OK ] Removed slice User Slice of root. Stopping Login Service... [ OK ] Removed slice system-serial\x2dgetty.slice. [ OK ] Removed slice system-getty.slice. [ OK ] Stopped /etc/rc.local Compatibility. [ OK ] Stopped target Network is Online. [ OK ] Stopped Network Manager Wait Online. Stopping Permit User Sessions... [ OK ] Stopped Login Service. [ OK ] Stopped Permit User Sessions. [ OK ] Stopped LSB: set CPUFreq kernel parameters. Stopping LSB: Load kernel modules needed to enable cpufreq scaling... [ OK ] Stopped target User and Group Name Lookups. [ OK ] Stopped LSB: Load kernel modules needed to enable cpufreq scaling. [ OK ] Stopped target Remote File Systems. [ OK ] Stopped target Remote File Systems (Pre). [ OK ] Stopped LSB: Armbian gathering hardware information. [ OK ] Stopped Unattended Upgrades Shutdown. [ OK ] Stopped target Network. Stopping Raise network interfaces... Stopping Network Manager... Stopping WPA supplicant... [ OK ] Stopped WPA supplicant. [ OK ] Stopped Network Manager. Stopping D-Bus System Message Bus... [ OK ] Stopped D-Bus System Message Bus. [ OK ] Stopped Raise network interfaces. [ OK ] Stopped target Network (Pre). [ OK ] Stopped target Basic System. [ OK ] Stopped target Paths. [ OK ] Stopped Dispatch Password Requests to Console Directory Watch. [ OK ] Stopped Forward Password Requests to Wall Directory Watch. [ OK ] Stopped target Slices. [ OK ] Removed slice User and Session Slice. [ OK ] Stopped target Sockets. [ OK ] Closed Avahi mDNS/DNS-SD Stack Activation Socket. [ OK ] Closed Syslog Socket. [ OK ] Closed D-Bus System Message Bus Socket. [ OK ] Stopped target System Initialization. [ OK ] Stopped target Swap. Deactivating swap /var/swap... Stopping Armbian enhanced Log2Ram... [ OK ] Stopped Apply Kernel Variables. [ OK ] Stopped Load Kernel Modules. [ OK ] Stopped target Encrypted Volumes. Stopping Update UTMP about System Boot/Shutdown... Stopping Entropy daemon using the HAVEGE algorithm... Stopping Restore / save the current clock... [ OK ] Stopped Entropy daemon using the HAVEGE algorithm. [ OK ] Deactivated swap /var/swap. [ OK ] Stopped Restore / save the current clock. [ OK ] Stopped Update UTMP about System Boot/Shutdown. [ OK ] Stopped Create Volatile Files and Directories. Stopping Load/Save Random Seed... [ OK ] Stopped Load/Save Random Seed. [ OK ] Unmounted /var/log. [ OK ] Unmounted /var/log.hdd. [ OK ] Stopped Armbian enhanced Log2Ram. [ OK ] Stopped target Local File Systems. Unmounting /tmp... Unmounting /sys/kernel/debug/tracing... Unmounting /run/user/0... [ OK ] Unmounted /tmp. [ OK ] Unmounted /sys/kernel/debug/tracing. [ OK ] Unmounted /run/user/0. [ OK ] Reached target Unmount All Filesystems. [ OK ] Stopped target Local File Systems (Pre). [ OK ] Stopped Create Static Device Nodes in /dev. [ OK ] Stopped Remount Root and Kernel File Systems. [ OK ] Reached target Shutdown. [ 602.927753] reboot: Power down reboot command: Spoiler root@tinkerboard:~# init 6 Stopping Authenticate and Authorize Users to Run Privileged Tasks... [ OK ] Stopped target Sound Card. [ OK ] Stopped target Graphical Interface. Stopping Accounts Service... [ OK ] Stopped target Multi-User System. Stopping LSB: Armbian gathering hardware information... Stopping LSB: Advanced IEEE 802.11 management daemon... Stopping LSB: Set sysfs variables from /etc/sysfs.conf... Stopping Avahi mDNS/DNS-SD Stack... Stopping LSB: No Display Manager... Stopping OpenBSD Secure Shell server... Stopping LSB: disk temperature monitoring daemon... Stopping LSB: Starts LIRC daemon.... Stopping LSB: Start NTP daemon... Stopping Hostname Service... Stopping Unattended Upgrades Shutdown... [ OK ] Stopped target Timers. [ OK ] Stopped Daily apt activities. [ OK ] Stopped target System Time Synchronized. [ OK ] Stopped Daily Cleanup of Temporary Directories. Stopping Regular background program processing daemon... Stopping LSB: Start/stop sysstat's sadc... Stopping User Manager for UID 0... Stopping System Logging Service... [ OK ] Stopped target Login Prompts. Stopping Serial Getty on ttyS2... Stopping Getty on tty1... [ OK ] Stopped Regular background program processing daemon. [ OK ] Stopped Avahi mDNS/DNS-SD Stack. [ OK ] Stopped System Logging Service. [ OK ] Stopped Accounts Service. [ OK ] Stopped Authenticate and Authorize Users to Run Privileged Tasks. [ OK ] Stopped OpenBSD Secure Shell server. [ OK ] Stopped Hostname Service. [ OK ] Stopped Serial Getty on ttyS2. [ OK ] Stopped Getty on tty1. [ OK ] Stopped User Manager for UID 0. [ OK ] Stopped Save/Restore Sound Card State. [ OK ] Stopped Session c3 of user root. [ OK ] Stopped LSB: Advanced IEEE 802.11 management daemon. [ OK ] Stopped LSB: Set sysfs variables from /etc/sysfs.conf. [ OK ] Stopped LSB: No Display Manager. [ OK ] Stopped LSB: disk temperature monitoring daemon. [ OK ] Stopped Unattended Upgrades Shutdown. [ OK ] Stopped LSB: Starts LIRC daemon.. [ OK ] Stopped LSB: Start NTP daemon. [ OK ] Stopped LSB: Start/stop sysstat's sadc. Stopping LSB: set CPUFreq kernel parameters... [ OK ] Removed slice User Slice of root. Stopping Login Service... [ OK ] Removed slice system-getty.slice. [ OK ] Stopped /etc/rc.local Compatibility. [ OK ] Stopped target Network is Online. [ OK ] Stopped Network Manager Wait Online. Stopping Permit User Sessions... [ OK ] Removed slice system-serial\x2dgetty.slice. [ OK ] Stopped target Network. Stopping Raise network interfaces... Stopping WPA supplicant... Stopping Network Manager... [ OK ] Stopped Login Service. [ OK ] Stopped WPA supplicant. [ OK ] Stopped Network Manager. [ OK ] Stopped Permit User Sessions. [ OK ] Stopped LSB: set CPUFreq kernel parameters. Stopping LSB: Load kernel modules needed to enable cpufreq scaling... Stopping D-Bus System Message Bus... [ OK ] Stopped target User and Group Name Lookups. [ OK ] Stopped LSB: Load kernel modules needed to enable cpufreq scaling. [ OK ] Stopped target Remote File Systems. [ OK ] Stopped target Remote File Systems (Pre). [ OK ] Stopped LSB: Armbian gathering hardware information. [ OK ] Stopped D-Bus System Message Bus. [ OK ] Stopped target Basic System. [ OK ] Stopped target Paths. [ OK ] Stopped Forward Password Requests to Wall Directory Watch. [ OK ] Stopped Dispatch Password Requests to Console Directory Watch. [ OK ] Stopped target Sockets. [ OK ] Closed Syslog Socket. [ OK ] Closed Avahi mDNS/DNS-SD Stack Activation Socket. [ OK ] Closed D-Bus System Message Bus Socket. [ OK ] Stopped target System Initialization. [ OK ] Stopped target Encrypted Volumes. Stopping Restore / save the current clock... Stopping Armbian enhanced Log2Ram... [ OK ] Stopped target Swap. Deactivating swap /var/swap... Stopping Entropy daemon using the HAVEGE algorithm... [ OK ] Stopped Create Volatile Files and Directories. [ OK ] Stopped target Slices. [ OK ] Removed slice User and Session Slice. [ OK ] Stopped Entropy daemon using the HAVEGE algorithm. [ OK ] Stopped Raise network interfaces. [ OK ] Stopped Restore / save the current clock. [ OK ] Stopped target Network (Pre). [ OK ] Stopped Apply Kernel Variables. [ OK ] Stopped Load Kernel Modules. Stopping Load/Save Random Seed... [ OK ] Stopped Load/Save Random Seed. [ OK ] Deactivated swap /var/swap. [ OK ] Unmounted /var/log. [ OK ] Unmounted /var/log.hdd. [ OK ] Stopped Armbian enhanced Log2Ram. [ OK ] Stopped target Local File Systems. Unmounting /tmp... Unmounting /run/user/0... Unmounting /sys/kernel/debug/tracing... [ OK ] Unmounted /tmp. [ OK ] Unmounted /run/user/0. [ OK ] Unmounted /sys/kernel/debug/tracing. [ OK ] Reached target Unmount All Filesystems. [ OK ] Stopped target Local File Systems (Pre). [ OK ] Stopped Remount Root and Kernel File Systems. [ OK ] Stopped Create Static Device Nodes in /dev. [ OK ] Reached target Shutdown. [ 29.317738] reboot: Restarting system Edited October 30, 2017 by Tido added information about different dtb name being used 2
Myy Posted July 16, 2017 Posted July 16, 2017 Glad you made it ! The option is not automatically enabled though. You'll have to edit the right bootloader configuration file. It should be /boot/extlinux.conf if I'm not mistaken (I've kinda butchered my ARMbian installation, so I'm not totally sure). So edit the right bootloader configuration file in order to add rockchip_tinkerrebootfix=on to the command line. If you're using an extlinux.conf file, add it to the end of the the 'append' line. Now, the thing is, the first dmesg included in the armhwinfo.log give me some idea of what's going on, but I really need the messages output by the kernel, during the shutdown phase. The same ones displayed by dmesg. If you can configure journald somehow to be more verbose and show kernel messages, this might do the trick. The information I need to get is whether the shutdown fix gets executed or not, and whether the suspend system is disabling the power sent to the MMC hardware before letting the drivers execute the .shutdown phase.
Tido Posted July 17, 2017 Posted July 17, 2017 (edited) /boot/ /boot/dtb/ /boot/dtb-4.12.0-rockchip/ Spoiler root@tinkerboard:~# cd /boot/ root@tinkerboard:/boot# ls -la total 20452 drwxr-xr-x 3 root root 4096 Jun 13 06:46 . drwxr-xr-x 22 root root 4096 Jun 13 06:38 .. -rw-r--r-- 1 root root 0 Jun 13 06:39 .next -rw-r--r-- 1 root root 3530095 Jun 13 03:01 System.map-4.12.0-rockchip -rw-r--r-- 1 root root 106 Jun 13 06:46 armbianEnv.txt -rw-r--r-- 1 root root 1557 Jun 13 06:44 armbian_first_run.txt -rw-r--r-- 1 root root 4882 Jun 13 06:44 boot-desktop.png -rw-r--r-- 1 root root 38518 Jun 13 06:44 boot.bmp -rw-r--r-- 1 root root 1374 Jun 13 06:38 boot.cmd -rw-r--r-- 1 root root 1446 Jun 13 06:46 boot.scr -rw-r--r-- 1 root root 134967 Jun 13 03:01 config-4.12.0-rockchip lrwxrwxrwx 1 root root 19 Jun 13 06:43 dtb -> dtb-4.12.0-rockchip drwxr-xr-x 2 root root 4096 Jun 13 06:43 dtb-4.12.0-rockchip -rw-r--r-- 1 root root 4436144 Jun 13 06:43 initrd.img-4.12.0-rockchip lrwxrwxrwx 1 root root 23 Jun 13 06:43 uInitrd -> uInitrd-4.12.0-rockchip -rw-r--r-- 1 root root 4436208 Jun 13 06:43 uInitrd-4.12.0-rockchip -rwxr-xr-x 1 root root 8318864 Jul 16 18:14 vmlinuz-4.12.0-rockchip lrwxrwxrwx 1 root root 23 Jun 13 06:39 zImage -> vmlinuz-4.12.0-rockchip root@tinkerboard:/boot# cd /boot/dtb root@tinkerboard:/boot/dtb# ls -la total 1068 drwxr-xr-x 2 root root 4096 Jun 13 06:43 . drwxr-xr-x 3 root root 4096 Jun 13 06:46 .. -rw-r--r-- 1 root root 7153 Jun 13 03:02 rk1108-evb.dtb -rw-r--r-- 1 root root 14174 Jun 13 03:02 rk3036-evb.dtb -rw-r--r-- 1 root root 19252 Jun 13 03:02 rk3036-kylin.dtb -rw-r--r-- 1 root root 21069 Jun 13 03:02 rk3066a-bqcurie2.dtb -rw-r--r-- 1 root root 21150 Jun 13 03:02 rk3066a-marsboard.dtb -rw-r--r-- 1 root root 20327 Jun 13 03:02 rk3066a-mk808.dtb -rw-r--r-- 1 root root 24907 Jun 13 03:02 rk3066a-rayeager.dtb -rw-r--r-- 1 root root 20205 Jun 13 03:02 rk3188-px3-evb.dtb -rw-r--r-- 1 root root 21416 Jun 13 03:02 rk3188-radxarock.dtb -rw-r--r-- 1 root root 12314 Jun 13 03:02 rk3228-evb.dtb -rw-r--r-- 1 root root 12993 Jun 13 03:02 rk3229-evb.dtb -rw-r--r-- 1 root root 39561 Jun 13 03:02 rk3288-evb-act8846.dtb -rw-r--r-- 1 root root 39958 Jun 13 03:02 rk3288-evb-rk808.dtb -rw-r--r-- 1 root root 36644 Jun 13 03:02 rk3288-fennec.dtb -rw-r--r-- 1 root root 40121 Jun 13 03:02 rk3288-firefly-beta.dtb -rw-r--r-- 1 root root 41359 Jun 13 03:02 rk3288-firefly-reload.dtb -rw-r--r-- 1 root root 40113 Jun 13 03:02 rk3288-firefly.dtb -rw-r--r-- 1 root root 39994 Jun 13 03:02 rk3288-miniarm.dtb -rw-r--r-- 1 root root 39730 Jun 13 03:02 rk3288-miqi.dtb -rw-r--r-- 1 root root 41021 Jun 13 03:02 rk3288-phycore-rdk.dtb -rw-r--r-- 1 root root 39281 Jun 13 03:02 rk3288-popmetal.dtb -rw-r--r-- 1 root root 36971 Jun 13 03:02 rk3288-r89.dtb -rw-r--r-- 1 root root 39878 Jun 13 03:02 rk3288-rock2-square.dtb -rw-r--r-- 1 root root 40004 Jul 16 18:17 rk3288-tinker.dtb -rw-r--r-- 1 root root 38921 Jun 13 03:02 rk3288-veyron-brain.dtb -rw-r--r-- 1 root root 47063 Jun 13 03:02 rk3288-veyron-jaq.dtb -rw-r--r-- 1 root root 47116 Jun 13 03:02 rk3288-veyron-jerry.dtb -rw-r--r-- 1 root root 39526 Jun 13 03:02 rk3288-veyron-mickey.dtb -rw-r--r-- 1 root root 47935 Jun 13 03:02 rk3288-veyron-minnie.dtb -rw-r--r-- 1 root root 45483 Jun 13 03:02 rk3288-veyron-pinky.dtb -rw-r--r-- 1 root root 46891 Jun 13 03:02 rk3288-veyron-speedy.dtb root@tinkerboard:/boot/dtb# cd /boot/dtb-4.12.0-rockchip/ root@tinkerboard:/boot/dtb-4.12.0-rockchip# ls -la total 1068 drwxr-xr-x 2 root root 4096 Jun 13 06:43 . drwxr-xr-x 3 root root 4096 Jun 13 06:46 .. -rw-r--r-- 1 root root 7153 Jun 13 03:02 rk1108-evb.dtb -rw-r--r-- 1 root root 14174 Jun 13 03:02 rk3036-evb.dtb -rw-r--r-- 1 root root 19252 Jun 13 03:02 rk3036-kylin.dtb -rw-r--r-- 1 root root 21069 Jun 13 03:02 rk3066a-bqcurie2.dtb -rw-r--r-- 1 root root 21150 Jun 13 03:02 rk3066a-marsboard.dtb -rw-r--r-- 1 root root 20327 Jun 13 03:02 rk3066a-mk808.dtb -rw-r--r-- 1 root root 24907 Jun 13 03:02 rk3066a-rayeager.dtb -rw-r--r-- 1 root root 20205 Jun 13 03:02 rk3188-px3-evb.dtb -rw-r--r-- 1 root root 21416 Jun 13 03:02 rk3188-radxarock.dtb -rw-r--r-- 1 root root 12314 Jun 13 03:02 rk3228-evb.dtb -rw-r--r-- 1 root root 12993 Jun 13 03:02 rk3229-evb.dtb -rw-r--r-- 1 root root 39561 Jun 13 03:02 rk3288-evb-act8846.dtb -rw-r--r-- 1 root root 39958 Jun 13 03:02 rk3288-evb-rk808.dtb -rw-r--r-- 1 root root 36644 Jun 13 03:02 rk3288-fennec.dtb -rw-r--r-- 1 root root 40121 Jun 13 03:02 rk3288-firefly-beta.dtb -rw-r--r-- 1 root root 41359 Jun 13 03:02 rk3288-firefly-reload.dtb -rw-r--r-- 1 root root 40113 Jun 13 03:02 rk3288-firefly.dtb -rw-r--r-- 1 root root 39994 Jun 13 03:02 rk3288-miniarm.dtb -rw-r--r-- 1 root root 39730 Jun 13 03:02 rk3288-miqi.dtb -rw-r--r-- 1 root root 41021 Jun 13 03:02 rk3288-phycore-rdk.dtb -rw-r--r-- 1 root root 39281 Jun 13 03:02 rk3288-popmetal.dtb -rw-r--r-- 1 root root 36971 Jun 13 03:02 rk3288-r89.dtb -rw-r--r-- 1 root root 39878 Jun 13 03:02 rk3288-rock2-square.dtb -rw-r--r-- 1 root root 40004 Jul 16 18:17 rk3288-tinker.dtb -rw-r--r-- 1 root root 38921 Jun 13 03:02 rk3288-veyron-brain.dtb -rw-r--r-- 1 root root 47063 Jun 13 03:02 rk3288-veyron-jaq.dtb -rw-r--r-- 1 root root 47116 Jun 13 03:02 rk3288-veyron-jerry.dtb -rw-r--r-- 1 root root 39526 Jun 13 03:02 rk3288-veyron-mickey.dtb -rw-r--r-- 1 root root 47935 Jun 13 03:02 rk3288-veyron-minnie.dtb -rw-r--r-- 1 root root 45483 Jun 13 03:02 rk3288-veyron-pinky.dtb -rw-r--r-- 1 root root 46891 Jun 13 03:02 rk3288-veyron-speedy.dtb I guess armbian doing the boot in a different way ? Shall I edit the file according to this? So I have just changed from 1 to 7 verbosity=7 fdt_file=rk3288-miniarm.dtb rootdev=UUID=e8d35e52-8539-441f-be02-6161addf3bd3 rootfstype=ext4 armbianEnv.txt (END) ================================ # This is /boot/boot.cmd # setenv rootdev "/dev/mmcblk0p1" setenv fdt_file "rk3288-miqi.dtb" setenv ramdisk_addr_r "0x21000000" setenv console "ttyS2,115200n8" setenv verbosity "1" itest.b ${devnum} == 0 && echo "U-boot loaded from SD" itest.b ${devnum} == 1 && echo "U-boot loaded from eMMC" if load ${devtype} ${devnum}:1 ${ramdisk_addr_r} /boot/armbianEnv.txt || load ${devtype} ${devnum}:1 ${ramdisk_addr_r} armbianEnv.txt; then env import -t ${ramdisk_addr_r} ${filesize} fi setenv bootargs "consoleblank=0 scandelay root=${rootdev} rw console=${console} rootfstype=ext4 loglevel=${verbosity} rootwait ${extraargs}" ext4load ${devtype} ${devnum}:1 ${fdt_addr_r} /boot/dtb/${fdt_file} || fatload ${devtype} ${devnum}:1 ${fdt_addr_r} dtb/${fdt_file} || ext4load ${devtype} ${devnum}:1 ${fdt_addr_r} dtb/${fdt_file} ext4load ${devtype} ${devnum}:1 ${ramdisk_addr_r} /boot/uInitrd || fatload ${devtype} ${devnum}:1 ${ramdisk_addr_r} uInitrd || ext4load ${devtype} ${devnum}:1 ${ramdisk_addr_r} uInitrd ext4load ${devtype} ${devnum}:1 ${kernel_addr_r} /boot/zImage || fatload ${devtype} ${devnum}:1 ${kernel_addr_r} zImage || ext4load ${devtype} ${devnum}:1 ${kernel_addr_r} zImage bootz ${kernel_addr_r} ${ramdisk_addr_r} ${fdt_addr_r} # mkimage -C none -A arm -T script -d /boot/boot.cmd /boot/boot.scr boot.cmd (END) as it refers above to: rk3288-miniarm I will copy that one over as well from your source. cp -r rk3288-miniarm.dtb /boot/dtb/ /var/log/armhwinfo.log has been uploaded to http://sprunge.us/CPIV Edited July 17, 2017 by Tido added hw log, added boot.cmd
Myy Posted July 17, 2017 Posted July 17, 2017 You might have to append it to at the end of the setenv bootargs command of the boot.cmd command, and then run mkimage -C none -A arm -T script -d /boot/boot.cmd /boot/boot.scr again. Note that whether you use rk3288-miniarm.dtb or rk3288-tinker.dtb, be sure to adapt the fdt_file variable in consequence. Currently it seems to refer to the MiQi dtb. I don't know which one has priority though. the armbianEnv one or the boot.cmd one.
Tido Posted July 17, 2017 Posted July 17, 2017 23 hours ago, Myy said: I really need the messages output by the kernel, during the shutdown phase. The same ones displayed by dmesg. If you can configure journald somehow to be more verbose and show kernel messages, this might do the trick. I searched and came across this 1. How to get kernel boot log with journalctl? I guess this is what we already have I have done: journalctl -k > dmesg.log and this 2. Diagnosing Shutdown Problems done this but there is no file after shutdown, maybe I have to change the folder? #!/bin/sh mount -o remount,rw / dmesg > /shutdown-log.txt mount -o remount,ro / Any suggestion is welcome
Myy Posted July 17, 2017 Posted July 17, 2017 If you have an UART cable, it might easier to connect it to the Tinkerboard, open a serial console on the host and, then, power on the Tinkerboard by plugging the micro-USB cable on. The serial console will get all the messages in real time. The issue with writing on the SD card is that, the reboot issue is related to the MMC driver lowering the voltage of the SD/MMC hardware during the shutdown phase, to a point that it does not get up again (for reasons I don't understand, since I guess that it gets up automatically during a cold boot...). So, that might be the reason why you're getting issues with writing the shutdown messages to the filesystem. That said, I wonder if that reboot issue also occurs with official Android images and what happen if you tell the system to reboot in recovery mode.
Tido Posted July 18, 2017 Posted July 18, 2017 (edited) This is easy Spoiler root@tinkerboard:~# uname -a Linux tinkerboard 4.12.0-rc6-The-Twelve-MyyQi+ #1 SMP PREEMPT Fri Jun 30 19:37:05 UTC 2017 armv7l armv7l armv7l GNU/Linux root@tinkerboard:~# lsmod Module Size Used by r8723bs 552960 0 mali_kbase 520192 0 rfkill_bt 16384 0 dw_hdmi_i2s_audio 16384 0 [ OK ] Stopped Stopping Session c9 of user root. [ OK ] Closed Load/Save RF Kill Switch Status /dev/rfkill Watch. [ OK ] Stopped target Graphical Interface. Stopping Accounts Service... [ OK ] Stopped target Multi-User System. Stopping LSB: Armbian gathering hardware information... Stopping System Logging Service... Stopping LSB: No Display Manager... Stopping LSB: Advanced IEEE 802.11 management daemon... Stopping Avahi mDNS/DNS-SD Stack... [ OK ] Stopped target Login Prompts. Stopping Getty on tty1... Stopping LSB: Set sysfs variables from /etc/sysfs.conf... Stopping LSB: Start/stop sysstat's sadc... Stopping LSB: Start NTP daemon... Stopping LSB: Starts LIRC daemon.... Stopping Unattended Upgrades Shutdown... Stopping LSB: disk temperature monitoring daemon... Stopping OpenBSD Secure Shell server... [ OK ] Stopped target Sound Card. [ OK ] Stopped Daily apt activities. [ OK ] Stopped target System Time Synchronized. Stopping Authenticate and Authorize Users to Run Privileged Tasks... Stopping Regular background program processing daemon... Stopping Serial Getty on ttyS2... [ OK ] Stopped Regular background program processing daemon. [ OK ] Stopped System Logging Service. [ OK ] Stopped Avahi mDNS/DNS-SD Stack. [ OK ] Stopped Accounts Service. [ OK ] Stopped Authenticate and Authorize Users to Run Privileged Tasks. [ OK ] Stopped OpenBSD Secure Shell server. [ OK ] Stopped Serial Getty on ttyS2. [ OK ] Stopped Getty on tty1. [ OK ] Stopped User Manager for UID 0. [ OK ] Stopped Save/Restore Sound Card State. [ OK ] Stopped Session c9 of user root. [ OK ] Stopped LSB: Advanced IEEE 802.11 management daemon. [ OK ] Stopped Unattended Upgrades Shutdown. [ OK ] Stopped LSB: No Display Manager. [ OK ] Stopped LSB: Set sysfs variables from /etc/sysfs.conf. [ OK ] Stopped LSB: Start/stop sysstat's sadc. [ OK ] Stopped LSB: Start NTP daemon. [ OK ] Stopped LSB: Starts LIRC daemon.. [ OK ] Stopped LSB: disk temperature monitoring daemon. [ OK ] Stopped LSB: Armbian gathering hardware information. Stopping LSB: set CPUFreq kernel parameters... [ OK ] Removed slice User Slice of root. Stopping Login Service... [ OK ] Removed slice system-getty.slice. [ OK ] Stopped /etc/rc.local Compatibility. [ OK ] Stopped target Network is Online. [ OK ] Stopped Network Manager Wait Online. Stopping Permit User Sessions... [ OK ] Removed slice system-serial\x2dgetty.slice. [ OK ] Stopped target Network. Stopping WPA supplicant... Stopping Network Manager... Stopping Raise network interfaces... [ OK ] Stopped Login Service. [ OK ] Stopped Network Manager. [ OK ] Stopped WPA supplicant. [ OK ] Stopped Permit User Sessions. [ OK ] Stopped LSB: set CPUFreq kernel parameters. Stopping LSB: Load kernel modules needed to enable cpufreq scaling... Stopping D-Bus System Message Bus... [ OK ] Stopped target User and Group Name Lookups. [ OK ] Stopped Raise network interfaces. [ OK ] Stopped D-Bus System Message Bus. [ OK ] Stopped LSB: Load kernel modules needed to enable cpufreq scaling. [ OK ] Stopped target Remote File Systems. [ OK ] Stopped target Remote File Systems (Pre). [ OK ] Stopped target Basic System. [ OK ] Stopped target Slices. [ OK ] Removed slice User and Session Slice. [ OK ] Stopped target Sockets. [ OK ] Closed Syslog Socket. [ OK ] Closed Avahi mDNS/DNS-SD Stack Activation Socket. [ OK ] Stopped target Paths. [ OK ] Stopped Forward Password Requests to Wall Directory Watch. [ OK ] Stopped Dispatch Password Requests to Console Directory Watch. [ OK ] Closed D-Bus System Message Bus Socket. [ OK ] Stopped target System Initialization. Stopping Restore / save the current clock... Stopping Armbian enhanced Log2Ram... Stopping Update UTMP about System Boot/Shutdown... [ OK ] Stopped target Encrypted Volumes. Stopping Entropy daemon using the HAVEGE algorithm... [ OK ] Stopped target Swap. Deactivating swap /var/swap... [ OK ] Stopped Apply Kernel Variables. [ OK ] Stopped Load Kernel Modules. [ OK ] Stopped target Network (Pre). [ OK ] Stopped Entropy daemon using the HAVEGE algorithm. [ OK ] Stopped Restore / save the current clock. [ OK ] Stopped Update UTMP about System Boot/Shutdown. [ OK ] Deactivated swap /var/swap. [ OK ] Stopped Create Volatile Files and Directories. Stopping Load/Save Random Seed... [ OK ] Stopped Load/Save Random Seed. [ OK ] Unmounted /var/log. [ OK ] Unmounted /var/log.hdd. [ OK ] Stopped Armbian enhanced Log2Ram. [ OK ] Stopped target Local File Systems. Unmounting /tmp... Unmounting /sys/kernel/debug/tracing... Unmounting /run/user/0... [ OK ] Unmounted /tmp. [ OK ] Unmounted /sys/kernel/debug/tracing. [ OK ] Unmounted /run/user/0. [ OK ] Reached target Unmount All Filesystems. [ OK ] Stopped target Local File Systems (Pre). [ OK ] Stopped Create Static Device Nodes in /dev. [ OK ] Stopped Remount Root and Kernel File Systems. [ OK ] Reached target Shutdown. [ 616.164534] reboot: Restarting system and in one of the posts above (unfortunately they have no numbers) you find the shutdown from UART without your patch. 7 hours ago, Myy said: That said, I wonder if that reboot issue also occurs with official Android images and what happen if you tell the system to reboot in recovery mode. I downloaded it a while ago, but never installed it. Beside that it might be also interesting how they solved it on Chromebooks? Edited July 18, 2017 by Tido added Android, Chromebook
Myy Posted July 18, 2017 Posted July 18, 2017 Well, it is a Tinkerboard specific issue, so I'm unsure whether Chromebooks had the same exact issue. I have a RK3288 MiQi board which does not present such issues. Anyway, concerning the logs, it looks like the system is not outputting the kernel messages directly on the console, except when journald dies I guess. The only kernel message visible being : [ 616.164534] reboot: Restarting system IIRC Armbian is already configured to output kernel messages to the console displayed with ALT+F12, so I'll try to look around, see if I can find how to configure systemd to output the kernel messages on the serial console. Meanwhile, you can try to change ttyS2 to ttyS1 in boot.cmd, rerun the commands shown in boot.cmd comments and give it a try.
Tido Posted July 18, 2017 Posted July 18, 2017 6 hours ago, Myy said: to change ttyS2 to ttyS1 in boot.cmd what happend sounds like this -> squelches the Kernel so I turned it back to ttyS2. The red LED is on when I do init 6, if I do init 0 the LED is off. from 1 to 7 setenv verbosity "7" If specified, overrides both the kernel command line setting systemd.show_status= (see below) and the configuration file option ShowStatus=no root@tinkerboard:~# cd /etc/systemd/ root@tinkerboard:/etc/systemd# ls -la total 48 drwxr-xr-x 5 root root 4096 Jun 6 13:55 . drwxr-xr-x 119 root root 4096 Jul 18 21:28 .. -rw-r--r-- 1 root root 720 Apr 12 2016 bootchart.conf -rw-r--r-- 1 root root 1011 Apr 12 2016 journald.conf -rw-r--r-- 1 root root 986 Apr 12 2016 logind.conf drwxr-xr-x 2 root root 4096 Apr 12 2016 network -rw-r--r-- 1 root root 610 Apr 12 2016 resolved.conf drwxr-xr-x 16 root root 4096 Jun 13 08:44 system -rw-r--r-- 1 root root 1537 Feb 15 16:27 system.conf -rw-r--r-- 1 root root 534 Apr 12 2016 timesyncd.conf drwxr-xr-x 2 root root 4096 Apr 12 2016 user -rw-r--r-- 1 root root 1127 Apr 12 2016 user.conf actions above led to: I deleted old stuff just things from today has been uploaded to http://sprunge.us/KaMN How to get systemd boot messages on serial console and screen? https://lists.freedesktop.org/archives/systemd-devel/2015-April/030804.html Kernel Debugging Tricks https://wiki.ubuntu.com/Kernel/KernelDebuggingTricks#Serial_Console 7 hours ago, Myy said: displayed with ALT+F12, I am just connected headless, is this helpful if a screen is connected? I guess it would fly by way too fast anyway.
Myy Posted July 18, 2017 Posted July 18, 2017 No, a screen won't be of any use, unless you try to record the screen with a 60fps+ video camera. That's insane. Instead, could you paste the content of : cat /proc/cmdline In order to know if the bootloader gets configured correctly or not.
Myy Posted July 19, 2017 Posted July 19, 2017 I've generated a new test build that incorporates an alternative (ugly) reboot hack. You'll still need to add rockchip_tinkerrebootfix=on to the boot command line to use it, though. If you're unsure whether the kernel was booted with this option, do a `cat /proc/cmdline` and check the output. https://github.com/Miouyouyou/RockMyy-Build/tree/Tinkering
TonyMac32 Posted July 19, 2017 Author Posted July 19, 2017 Thank you @Myy, I compiled the fix into a Dev kernel, but haven't had opportunity to test yet, I'll be doing that in around 6-8 hours after work. This is where I complain about wishing I knew more so we could simply not shut off the vmmc and set vqmmc to the proper level without it being an amazingly sketchy hack. As for the commercial RK3288 devices on the market:. They boot from SPI and/or eMMC, not from SD. The SD is handled as a peripheral drive, not as a boot drive by the kernel.
Myy Posted July 19, 2017 Posted July 19, 2017 Indeed. No virtual platform representing this device really makes things difficult. The schematics won't lead us far in knowing what's going on exactly. And systemd seems to love shunting kernel messages logging on the serial console, making things harder to analyze. And contrary to what the StackOverflow guys said, not putting any loglevel on the command line makes no difference when it comes to not displaying kernel messages, beside the emergency ones, on the serial console. Maybe the journald developers thought that people would like to use serial consoles every day, because, you know, DVI and HDMI are so overrated. Well, the last issue can be alleviated by just spouting log messages with printk using the "emergency" log level. It's ugly but everything is ugly on test kernels anyway. I really need to investigate this issue however. If I have some time this week, I'll see if I can force the Rockchip system to reboot in various modes, and test if one of this mode just resolve the issue automagically. Anyway, I'm not in a hurry. Take your time.
zador.blood.stained Posted July 19, 2017 Posted July 19, 2017 18 hours ago, Myy said: And systemd seems to love shunting kernel messages logging on the serial console, making things harder to analyze. And contrary to what the StackOverflow guys said, not putting any loglevel on the command line makes no difference when it comes to not displaying kernel messages, beside the emergency ones, on the serial console. AFAIK it's not related to systemd. Some loglevel overrides come from Debian/ubuntu default, i.e. on Xenial it's caused by /etc/sysctl.d/10-console-messages.conf (added by the "procps" package), and lack of kernel messages on any console can be caused by multiple console= defines on the kernel command line, since without explicit forwarding (i.e. by journald) kernel will print its boot log only on one console. 1
Myy Posted July 19, 2017 Posted July 19, 2017 I missed the target then, I guess. My cmdline is earlyprintk console=ttyS2,115200n8 rw root=/dev/mmcblk1p5 rootfstype=ext4 init=/sbin/init Which is the same I used on my Gentoo system, however I got the kernel messages on Gentoo. So, yeah, that might be 10-console-messages.conf # the following stops low-level messages on console kernel.printk = 4 4 1 7 I guess that setting this to 7 4 1 7 will allow kernel messages on... the console ? Like every console ? I'll give it a try.
Myy Posted July 19, 2017 Posted July 19, 2017 Yeah, that seems to do the trick, thanks for the information. So, in order to display all the kernel messages on the serial console : open up /etc/sysctl/10-console-messages.conf replace kernel.printk values with 7 4 1 7 Save the file, reboot and enjoy a serial console acting like a serial console ! To see even the debug messages, you might need to set it up to 8 4 1 7. The meaning of the values are defined in syslog(2)
TonyMac32 Posted July 20, 2017 Author Posted July 20, 2017 I used echo b > /proc/sysrq-trigger to trigger reboot on 4.12.2 with the ugly hack installed, and it worked. Without the hack it does not. Let me see if I can apply it to the normal reboot process. 1
Myy Posted July 20, 2017 Posted July 20, 2017 The emergency reboot one or the rockchip_tinkerbootfix one ? Anyway, glad to see some progress !
TonyMac32 Posted July 20, 2017 Author Posted July 20, 2017 Emergency reboot. I haven't applied those to the other shutdown path yet. I was researching the shutdown process to see if a cleaner method could be conceived of... I need to save up my pocket change and get an oscilloscope so I can do some better hardware debugging. So I'll get back to you in 5 years or so... :-P
Myy Posted July 20, 2017 Posted July 20, 2017 By that time, ASUS will already be using 4.9 kernels ! That said, if echo b > /proc/sysrq-trigger works, one workaround will be to put this as the last action before rebooting. 1
TonyMac32 Posted July 21, 2017 Author Posted July 21, 2017 *EDIT* I'm holding "Dev" back at 4.12 until we get this reboot tested. @Igor, if you can try it out on your MiQi and make sure there weren't any unexpected collateral damages. I don't know who else besides @Myy has one. "DEV" is now 4.13 and is having build errors. I'm going to strip some patches and see if that takes care of it. Meanwhile, the patch will work on "Rockchip Next" for anyone able to test it's effect on MiQi. Once we verify MiQi is OK, I can stuff it in there and let it go free. I added the "mmc_power_off()" call to the platform shutdown hack, to make certain the card was "dead" before restarting the supply and resetting 3.3Volts and, well... It works! So I will put the patch into Dev, if MiQi owners can test if it breaks then we'll have to do something else, decided by the build system wizards. ;-)
Igor Posted July 21, 2017 Posted July 21, 2017 1 hour ago, TonyMac32 said: if you can try it out on your MiQi and make sure there weren't any unexpected collateral damages. I don't know who else besides @Myy has one. Out until 2.8.
cyberk Posted July 21, 2017 Posted July 21, 2017 Just saw this https://github.com/TinkerBoard/debian_kernel/issues/2#issuecomment-316919436 thanks all!
Tido Posted July 22, 2017 Posted July 22, 2017 On 19.7.2017 at 11:42 PM, Myy said: So, in order to display all the kernel messages on the serial console : open up /etc/sysctl/10-console-messages.conf replace kernel.printk values with 7 4 1 7 Save the file, reboot and enjoy a serial console acting like a serial console ! In armbian it is: cd /etc/sysctl.d/ && ls -la nano 10-console-messages.conf # the following stops low-level messages on console #kernel.printk = 4 4 1 7 kernel.printk = 7 4 1 7 I have added this to all the steps I have done above, but there is not more text, while rebooting even less: root@tinkerboard:~# init 6 [ 33.846618] reboot: Restarting system
Recommended Posts