Ruediger Posted November 30, 2019 Posted November 30, 2019 I have an H96 Max 4k , RK3328, 4GB RAM, 32GB ROM, Android 7.1 originally. Going over this thread I see several people ponder over the Maskrom pins and reflashing UBoot, but most don't. Do I _have_ to reflash uboot to be able to start from SD Card? Or do I _have_ to short the Maskrom pads? So far, the box doesn't start using the buster legacy image from https://yadi.sk/d/DSO6euzB3ahemo/ARMBIAN/19.11.3 . Again, most people seem to use easyb's DTB file with good results. Which, again, I do not see in the image . At least not named easyb. But I know that after poring over this thread for 6 hours I am not exactly at my best and most attentive. I don't need / want to install the Debian OS onto the internal memory when possible. I really enjoyed the purely sdcard based os on my Sunvell R96 so far, but need more ram after four years of usage. Or would I - as a rather noobish person that does not look forward banging config files into ROM using the serial port - be better advised to get myself an Allwinner H6 based box to avoid all that uboot trouble?
VoidOPv Posted November 30, 2019 Posted November 30, 2019 2 minutes ago, Ruediger said: I have an H96 Max 4k , RK3328, 4GB RAM, 32GB ROM, Android 7.1 originally. Going over this thread I see several people ponder over the Maskrom pins and reflashing UBoot, but most don't. Do I _have_ to reflash uboot to be able to start from SD Card? Or do I _have_ to short the Maskrom pads? So far, the box doesn't start using the buster legacy image from https://yadi.sk/d/DSO6euzB3ahemo/ARMBIAN/19.11.3 . Again, most people seem to use easyb's DTB file with good results. Which, again, I do not see in the image . At least not named easyb. But I know that after poring over this thread for 6 hours I am not exactly at my best and most attentive. I don't need / want to install the Debian OS onto the internal memory when possible. I really enjoyed the purely sdcard based os on my Sunvell R96 so far, but need more ram after four years of usage. Or would I - as a rather noobish person that does not look forward banging config files into ROM using the serial port - be better advised to get myself an Allwinner H6 based box to avoid all that uboot trouble? This f..ing android 7.1 rk3328 TV boards are UBoot "boot secured". The only way I found booting debían was flashing vía maskrom points mode replacing entire UBoot and emmc. I think is not posible booting them vía SD/USB. I did not try booting SD now but I am gonna try It tomorrow and posting the results here.
DigitalDaz Posted November 30, 2019 Posted November 30, 2019 I'm new to this but I can assure you, and it was a pleasant surprise to find, you can just flash the image to a USB SSD and it will just boot straight off it. That is on the H96 Max+ with the RK3328.
Ruediger Posted November 30, 2019 Posted November 30, 2019 2 hours ago, DigitalDaz said: I'm new to this but I can assure you, and it was a pleasant surprise to find, you can just flash the image to a USB SSD and it will just boot straight off it. That is on the H96 Max+ with the RK3328. Then I'll try with a USB-Stick, otherwise waiting for @VoidOPv feedback. If neither works, I'll maybe wait for the Allwinner H6 to become more mainstream for Armbian, or go with a S922X based board instead. I can't afford wrecking my H96 Max 4k Android installation.
balbes150 Posted November 30, 2019 Author Posted November 30, 2019 Now tested the latest version of LE (20191130) with kernel 5 on MX10 with USB flash drive. Works quite well with HW decoding with multiple formats. It would be interesting to test HW performance on other models with RK3328.
Digit97 Posted November 30, 2019 Posted November 30, 2019 @amirul i can't unpack your image with android tool. I used Android Tool for unpacking firmware, and ResTool to unpack resource.img
Ruediger Posted November 30, 2019 Posted November 30, 2019 36 minutes ago, balbes150 said: Now tested the latest version of LE (20191130) with kernel 5 on MX10 with USB flash drive. Works quite well with HW decoding with multiple formats. It would be interesting to test HW performance on other models with RK3328. I'm happy to try, but I don't get the images from https://yadi.sk/d/DSO6euzB3ahemo/ARMBIAN/19.11.3 to boot from either USB or SDcard. And I am too timid to duke it out by flashing uBoot via Serial or how this Maskrom mode is utilized.
balbes150 Posted November 30, 2019 Author Posted November 30, 2019 22 minutes ago, Ruediger said: I'm happy to try, but I don't get the images from https://yadi.sk/d/DSO6euzB3ahemo/ARMBIAN/19.11.3 to boot from either USB or SDcard. And I am too timid to duke it out by flashing uBoot via Serial or how this Maskrom mode is utilized. Maskrom not needed (this is an extreme measure, when or what else is not working). Some TV boxes do not support working with SD cards, so you can use the most secure version of SD+USB to start (it is described in this topic earlier). It is important to configure the DTB correctly.
wdtz Posted December 2, 2019 Posted December 2, 2019 I hope you don't expect me to do it for you? I am going to assume that you have broken that image up into the partition images I don't know if you are using win or linux, no matter There are hexeditors for both, a gui vesion is my recommendation, wxHex or okteta or ghex, I tend to use okteta load kernel.img into hexeditor, control f , make sure the hex button is selected, enter the signature above. It will be a good sign if it is found at the begining of the line, make a note of the address, keep searching. Then, in calculator, set decimal , address/1024, should be even, no remainder If so,, try dd if=kernel.img of=test bs=1024 skip=(above number) count=70 (Input file, output file, block size) Check test, load into hexeditor, should begin with signature, if not, you screwed up Then try to decompile, as usual If you don't find it appended to kernel, search in other images
wdtz Posted December 2, 2019 Posted December 2, 2019 understand, uboot and kernel have different dtb, that is why h96max+ starts, with uboot as seen by serial cable, but then when hands over to kernel dtb does not power uSD slot, something non-standard with regulators. So, it can't find its root filesystem, because slot is dead, no power You see no hdmi display until quite late in the boot, so it seems dead, just can't read uSD slot It there is a usb stick ALSO plugged in, will find root fs on usb stick.. uSD slot continues dead, unpowered easyb and hexdump have made dtb for h96max+/T9 that make regulators work. I don't know about other models ----edit---- For my h96max+ there is a problem with usb2 port, in dmesg late in boot and periodically (with hexdumps' dtb, not with easyb's) genirq: Flags mismatch irq 13. 00000080 (serial) vs. 00004000 (debug) Quickly, the usb2 port 'locks up' there is no easy way to revive,, I am sure a suitable unbind,bind would make it work for a bit, a bit esoteric But now, I am using easyb's dtb, a 5hr power out forced a shutdown (47d uptime) No problem with usb2 port
wdtz Posted December 8, 2019 Posted December 8, 2019 So, Digit97 , you never 'got back' to us to say how it worked out and what you found
balbes150 Posted December 20, 2019 Author Posted December 20, 2019 New image 20191216 kernel 5.3 for rk3328
balbes150 Posted December 24, 2019 Author Posted December 24, 2019 Test image for rk3328 with kernel 5.5.0. Fixed working with HDMI. Proven to work on MX10 and MVR9. The request of the owners of other models of TV boxes to write the result of running with the model.https://yadi.sk/d/CR8cTo4fojcJjg
Aleksejs Posted December 26, 2019 Posted December 26, 2019 @balbes150 Hi, could you please guide me how to compile this dts: https://github.com/torvalds/linux/blob/master/arch/arm64/boot/dts/rockchip/rk3328-a1.dts to dtb? Or where I could get already compiled dtb? Thank you! P.S. I've tried to run noble@lnx01:~$ dtc -O dtb -o rk3328-a1.dtb rk3328-a1.dts Error: rk3328-a1.dts:5.1-9 syntax error FATAL ERROR: Unable to parse input tree
wdtz Posted December 27, 2019 Posted December 27, 2019 OK, i'll make an attempt, please correct me where wrong dtc is kind of stupid, and device trees could definitely be improved I'll bet you don't have a compiler environment and that's the problem an example line, still symbolic,,, gpios = <&gpio2 RK_PA2 GPIO_ACTIVE_HIGH>; The <&something,,> is an internal (only?) pointer in the dtb The next 2 elements are probably populated from an appropriate .h (header) file (specific to that hardware) So it becomes,,, gpios = < 0x3e 0x02 0x01 >; ( a random example) The dtc compiler can only deal with numbers There is also an include at the top, has to be merged in It would be a REAL improvement if the pointers, wherever possible had the same numbers as linux devices they represent (Probably that would be half, to differentiate the "made up" ones, add F0 00 00 00, so f0000001,f0000002, ... There could be a standard..... a device tree number standard) The &numbers seem to be somewhat random, 1st come I think All source dts are not written is same order and have different numbers of stanza's so, in 6 dts's for example for 3328, only 2 will almost match (&numbers) most confusing, pages of notes, a real pain
Aleksejs Posted December 27, 2019 Posted December 27, 2019 So the task was pretty easy, just cloned repo locally and run "make dtbs", the thing is box is not booting with this new dtb (beelink A1) Guess I need matching kernel version?
slaven Posted January 4, 2020 Posted January 4, 2020 I wanted to test rk3328 with kernel 5.5.0 on A5X Max, but the Link is not working. @balbes, when you correct the link I will test on my box.
caruso Posted January 4, 2020 Posted January 4, 2020 Hi everyone, I would like to share my work which leads to boot from sdcard device based on RK3318 to desktop armbian. I've was using Armbian_19.11.3_Rk3328-tv_eoan_legacy_4.4.154_desktop_20191126.img and end up with booting to desktop What doesn't work for me: onboard wifi (usb dongle works, old tp-link tl-wn725N) onboard bluetooth My box is same as picture below: https://androidpctv.com/review-h96-max-opinion/ I've burned image with rufus on windows and my first boot trial finished with boot hang up: I've solved this issue by invoking following code where /dev/mmcblk0 is sdcard device in linux, and trust.img was extracted from rk3318_9.0_hcy_20191114_v002 updage image. dd if=trust.img of=/dev/mmcblk0 seek=24576 sync After that boot sequence went further. I'm not sure but I guess that debug vs release version of bl31 might be problem here. Also, I've used rk3318-t9.dtb file prepared based on rk3328-t9.dtb posted in this thread, with removing cpu freqencies > 1.1GHz, as box was unstable with such high frequencies. I didn't find option here to attach file so temporaraly you can find my modified file here rk3318-t9.dtb and other useful files here: https://freeshell.de/~tiloc/armbian/ I hope it will be useful for somebody 1
hexdump Posted January 4, 2020 Posted January 4, 2020 @caruso - this is very cool that you found a way to get armbian up and running on rk3318 too now finally! thanks a lot for sharing this and best wishes - hexdump
hexdump Posted January 4, 2020 Posted January 4, 2020 @caruso - do you have a download link for the rk3318_9.0_hcy_20191114_v002 firmware? update: ok - found it - how did you extract its contents? all linux cmdline tools to unpack the update.img file seem to fail for me ...
caruso Posted January 5, 2020 Posted January 5, 2020 12 hours ago, hexdump said: @caruso - do you have a download link for the rk3318_9.0_hcy_20191114_v002 firmware? update: ok - found it - how did you extract its contents? all linux cmdline tools to unpack the update.img file seem to fail for me ... @hexdump I think I took firmware from: https://www.h96tvbox.com/content/6-Firmware-upgrade I've unpacked with img_unpack and afptool tools available in git repo: https://github.com/TeeFirefly/rk2918_tools.git I took instructions from http://wiki.t-firefly.com/ROC-RK3328-CC/fw_pack_unpack.html unzip rk3318_9.0_hcy_20191114_v002.zip to update.img git clone https://github.com/TeeFirefly/rk2918_tools.git cd rk2918_tools make sudo cp afptool img_unpack img_maker mkkrnlimg /usr/local/bin Unpack update.img, which creates img folder with update.img and loader.img img_unpack update.img img rom version: 9.0.0 build time: 2019-11-14 13:59:46 chip: 33323248 checking md5sum....OK Unpack update.img cd img afptool -unpack update.img update Check file...OK ------- UNPACK ------- package-file 0x00000800 0x000002C0 Image/MiniLoaderAll.bin 0x00001000 0x0002E94E Image/parameter.txt 0x00030000 0x00000372 Image/trust.img 0x00030800 0x00400000 Image/uboot.img 0x00431000 0x00400000 Image/misc.img 0x00831800 0x0000C000 Image/baseparameter.img 0x0083E000 0x00100000 Image/dtbo.img 0x0093E800 0x00000133 Image/boot.img 0x0093F000 0x01E81000 Image/recovery.img 0x027C0800 0x0285E800 Image/system.img 0x0501F800 0x78DBA0E8 Image/vendor.img 0x7DDDA000 0x08DAB064 Image/oem.img 0x86B85800 0x0002704C Image/vbmeta.img 0x86BAD000 0x00001000 RESERVED 0x00000000 0x00000000 UnPack OK! rk3318-t9.dtb dtb based on rk3328-t9.dtb with removed cpu freqencies > 1.1GHz rk3318-t9.dts - text version for above device-tree-copy.tar.gz - taked from running android environment rk3318_org_android.dts - dts for above rk3318_org_android.dtb - dtb for above - for me this version doesn't work, which was strange for me trust.img - extracted trust.img from firmware update
hexdump Posted January 5, 2020 Posted January 5, 2020 @caruso - thanks a lot, i was missing the img_unpack step, as the image was already called update.img
hexdump Posted January 6, 2020 Posted January 6, 2020 @caruso - i can confirm that your trust.img approach ist bringing the boot forward and the main part of u-boot is properly loaded, but for my box (2gb) sadly hangs quite early on: ... U-Boot 2019.10-armbian (Nov 29 2019 - 09:50:19 +0300) Model: Rockchip RK3328 EVB DRAM: looks like a memory timing issue to me ( @jernej - maybe any idea here too, although this is rockchip?). @caruso - on you website you have a file write_dd.txt in which you are writing more than just the trust.img - i assume that was just some intermediate step of your tries maybe? best wishes - hexdump
martos Posted January 6, 2020 Posted January 6, 2020 Hello, Just for information , the boot log of on RK3328 (H96 MAX h2 ) who can't boot on sdcard. rk3328_1.txt
jernej Posted January 6, 2020 Posted January 6, 2020 @hexdump not really, DRAM initialization is pretty SoC specific.
caruso Posted January 6, 2020 Posted January 6, 2020 2 hours ago, hexdump said: @caruso - i can confirm that your trust.img approach ist bringing the boot forward and the main part of u-boot is properly loaded, but for my box (2gb) sadly hangs quite early on: ... U-Boot 2019.10-armbian (Nov 29 2019 - 09:50:19 +0300) Model: Rockchip RK3328 EVB DRAM: looks like a memory timing issue to me ( @jernej - maybe any idea here too, although this is rockchip?). @caruso - on you website you have a file write_dd.txt in which you are writing more than just the trust.img - i assume that was just some intermediate step of your tries maybe? best wishes - hexdump Regarding write_dd.txt - indeed, there were many trials but I was able to reproduce working scenario with minimum dd'ing trust.img only. My box is 4GB/64GB, not sure maybe some changes are needed in dts/dtb for 2GB versions. Maybe post whole log up to hang moment.
hexdump Posted January 6, 2020 Posted January 6, 2020 @caruso - the dtb is not relevant here, as it still fails in u-boot ... here is the full boot log: DDR version 1.16 20190713 ID:0xFFF In DDR3 333MHz Bus Width=32 Col=11 Bank=8 Row=15 CS=1 Die Bus-Width=16 Size=2048MB ddrconfig:2 OUT Boot1 Release Time: May 13 2019 17:34:36, version: 2.50 ChipType = 0x11, 232 mmc2:cmd19,100 SdmmcInit=2 0 BootCapSize=2000 UserCapSize=15028MB FwPartOffset=2000 , 2000 mmc0:cmd5,20 SdmmcInit=0 0 BootCapSize=0 UserCapSize=15279MB FwPartOffset=2000 , 0 StorageInit ok = 169710 Raw SecureMode = 0 SecureInit read PBA: 0x4 SecureInit read PBA: 0x404 SecureInit read PBA: 0x804 SecureInit read PBA: 0xc04 SecureInit read PBA: 0x1004 SecureInit ret = 0, SecureMode = 0 atags_set_bootdev: ret:(0) GPT 0x337a9f0 signature is wrong recovery gpt... GPT 0x337a9f0 signature is wrong recovery gpt fail! LoadTrust Addr:0x4000 No find bl30.bin Load uboot, ReadLba = 2000 Load OK, addr=0x200000, size=0xa2ad8 RunBL31 0x10000 NOTICE: BL31: v1.3(release):0e7a845e NOTICE: BL31: Built : 16:24:22, Apr 29 2019 NOTICE: BL31:Rockchip release version: v1.3 INFO: ARM GICv2 driver initialized INFO: Using opteed sec cpu_context! INFO: boot cpu mask: 1 INFO: plat_rockchip_pmu_init: pd status 0xe INFO: BL31: Initializing runtime services INFO: BL31: Initializing BL32 INF [0x0] TEE-CORE:init_primary_helper:337: Initializing (1.1.0-221-gda2bcfdc #137 Mon Jun 17 03:00:04 UTC 2019) INF [0x0] TEE-CORE:init_primary_helper:338: Release version: 1.4 INF [0x0] TEE-CORE:init_teecore:83: teecore inits done INFO: BL31: Preparing for EL3 exit to normal world INFO: Entry point address = 0x200000 INFO: SPSR = 0x3c9 U-Boot 2019.10-armbian (Nov 29 2019 - 09:50:19 +0300) Model: Rockchip RK3328 EVB DRAM: could you maybe post yours too for comparision? best wishes - hexdump
mkosta Posted January 6, 2020 Posted January 6, 2020 On 1/4/2020 at 9:36 PM, caruso said: Hi everyone, I would like to share my work which leads to boot from sdcard device based on RK3318 to desktop armbian. I've was using Armbian_19.11.3_Rk3328-tv_eoan_legacy_4.4.154_desktop_20191126.img and end up with booting to desktop What doesn't work for me: onboard wifi (usb dongle works, old tp-link tl-wn725N) onboard bluetooth My box is same as picture below: https://androidpctv.com/review-h96-max-opinion/ I've burned image with rufus on windows and my first boot trial finished with boot hang up: I've solved this issue by invoking following code where /dev/mmcblk0 is sdcard device in linux, and trust.img was extracted from rk3318_9.0_hcy_20191114_v002 updage image. dd if=trust.img of=/dev/mmcblk0 seek=24576 sync After that boot sequence went further. I'm not sure but I guess that debug vs release version of bl31 might be problem here. Also, I've used rk3318-t9.dtb file prepared based on rk3328-t9.dtb posted in this thread, with removing cpu freqencies > 1.1GHz, as box was unstable with such high frequencies. I didn't find option here to attach file so temporaraly you can find my modified file here rk3318-t9.dtb and other useful files here: https://freeshell.de/~tiloc/armbian/ I hope it will be useful for somebody Using this tutorial I manage to start armbian on X88 PRO 4G/64G using SD card https://www.aliexpress.com/item/33020223072.html I also manage to install it on eMMC memory using /root/install.sh script. Thanks.
caruso Posted January 6, 2020 Posted January 6, 2020 14 minutes ago, hexdump said: @caruso - the dtb is not relevant here, as it still fails in u-boot ... here is the full boot log: DDR version 1.16 20190713 ID:0xFFF In DDR3 333MHz Bus Width=32 Col=11 Bank=8 Row=15 CS=1 Die Bus-Width=16 Size=2048MB ddrconfig:2 OUT Boot1 Release Time: May 13 2019 17:34:36, version: 2.50 ChipType = 0x11, 232 mmc2:cmd19,100 SdmmcInit=2 0 BootCapSize=2000 UserCapSize=15028MB FwPartOffset=2000 , 2000 mmc0:cmd5,20 SdmmcInit=0 0 BootCapSize=0 UserCapSize=15279MB FwPartOffset=2000 , 0 StorageInit ok = 169710 Raw SecureMode = 0 SecureInit read PBA: 0x4 SecureInit read PBA: 0x404 SecureInit read PBA: 0x804 SecureInit read PBA: 0xc04 SecureInit read PBA: 0x1004 SecureInit ret = 0, SecureMode = 0 atags_set_bootdev: ret:(0) GPT 0x337a9f0 signature is wrong recovery gpt... GPT 0x337a9f0 signature is wrong recovery gpt fail! LoadTrust Addr:0x4000 No find bl30.bin Load uboot, ReadLba = 2000 Load OK, addr=0x200000, size=0xa2ad8 RunBL31 0x10000 NOTICE: BL31: v1.3(release):0e7a845e NOTICE: BL31: Built : 16:24:22, Apr 29 2019 NOTICE: BL31:Rockchip release version: v1.3 INFO: ARM GICv2 driver initialized INFO: Using opteed sec cpu_context! INFO: boot cpu mask: 1 INFO: plat_rockchip_pmu_init: pd status 0xe INFO: BL31: Initializing runtime services INFO: BL31: Initializing BL32 INF [0x0] TEE-CORE:init_primary_helper:337: Initializing (1.1.0-221-gda2bcfdc #137 Mon Jun 17 03:00:04 UTC 2019) INF [0x0] TEE-CORE:init_primary_helper:338: Release version: 1.4 INF [0x0] TEE-CORE:init_teecore:83: teecore inits done INFO: BL31: Preparing for EL3 exit to normal world INFO: Entry point address = 0x200000 INFO: SPSR = 0x3c9 U-Boot 2019.10-armbian (Nov 29 2019 - 09:50:19 +0300) Model: Rockchip RK3328 EVB DRAM: could you maybe post yours too for comparision? best wishes - hexdump Yes, sure - please find in attachment. teraterm.log
Recommended Posts