going Posted September 19 Share Posted September 19 5 минут назад, sicxnull сказал: Nope. Miniarch installs to EMMC fine. Is there a link to the source code? 0 Quote Link to comment Share on other sites More sharing options...
Nick A Posted September 19 Share Posted September 19 Allwinner h618 (and maybe h626/h313) has an issue reading emmc during boot. The code is noway perfect. The read and write speeds go back to normal when the kernel is loaded. I guess we can add code to prevent other SOC’s from loading the code if not needed. 0 Quote Link to comment Share on other sites More sharing options...
sicxnull Posted September 20 Author Share Posted September 20 On 9/18/2024 at 7:21 PM, Nick A said: Have you tried Miniarch's EMMC patch? https://github.com/warpme/minimyth2/blob/master/script/bootloaders/u-boot-h616/files/107-sunxi_mmc-dec-f_max-to-12MHz-to-get-emmc-reliable.patch This plus a few changes to defconfig works btw. Installed to EMMC and boots fine Thank you! 0 Quote Link to comment Share on other sites More sharing options...
sicxnull Posted September 20 Author Share Posted September 20 7 hours ago, bladyle said: Sound good. Will wait to upload some builds to test them although i need wifi so need stable kernel I guess. i updated to my fork if you wish to use it https://github.com/sicXnull/armbian-build/releases/download/v24.8.0-trunk.425/Armbian-unofficial_24.11.0-trunk_X96q_bookworm_current_6.6.44_mate_desktop.img.xz 2 Quote Link to comment Share on other sites More sharing options...
bladyle Posted September 20 Share Posted September 20 @sicxnull working good for now. 4k resolution still has flickering but I'm using it on different display 0 Quote Link to comment Share on other sites More sharing options...
zra123 Posted September 22 Share Posted September 22 (edited) @sicxnull After you ported the code from Miniarch, I compared the differences in the configs of x96q-lpddr3 and x96q-ddr3-v5.1 and I managed to build and run the image on my TV box. But I did it roughly, replacing the differences in the code, I'm not very friendly with Linux. Could you please format it correctly and upload it to github. I'm attaching the differences in the code. In the file build/patch/kernel/archive/sunxi-6.6/patches.armbian/arm64-dts-sun50i-h313-x96q-lpddr3.patch in line 246-247 I changed regulator-min-microvolt and regulator-max-microvolt to 1360000. and copied the modified file to the sunxi-6.7 and sunxi-6.10 folders along the same path. In the file build/patch/u-boot/u-boot-sunxi/board_x96q/arm64-sun50i-h313-add-x96q-lpddr3-defconfig.patch also in lines 189-190 changed regulator-min-microvolt and regulator-max-microvolt to 1360000. And also replaced the values: Скрытый текст +CONFIG_ARM=y +CONFIG_ARCH_SUNXI=y +CONFIG_DEFAULT_DEVICE_TREE="sun50i-h313-x96q-lpddr3" +CONFIG_SPL=y +CONFIG_SUNXI_DRAM_H616_DDR3_1333=y +CONFIG_DRAM_CLK=600 +CONFIG_DRAM_ODT_EN=y +CONFIG_DRAM_SUN50I_H616_DX_ODT=0x03030303 +CONFIG_DRAM_SUN50I_H616_DX_DRI=0x0e0e0e0e +CONFIG_DRAM_SUN50I_H616_CA_DRI=0x00001c12 +CONFIG_DRAM_SUN50I_H616_ODT_EN=0x1 +CONFIG_DRAM_SUN50I_H616_TPR0=0xc0000a05 +CONFIG_DRAM_SUN50I_H616_TPR2=0x00000000 +CONFIG_DRAM_SUN50I_H616_TPR10=0x002f0006 +CONFIG_DRAM_SUN50I_H616_TPR11=0xddddcccc +CONFIG_DRAM_SUN50I_H616_TPR12=0xeddc7564 +CONFIG_MACH_SUN50I_H616=y +CONFIG_R_I2C_ENABLE=y +CONFIG_SPL_I2C=y +CONFIG_SPL_I2C_SUPPORT=y +CONFIG_SPL_SYS_I2C_LEGACY=y +CONFIG_SYS_I2C_MVTWSI=y +CONFIG_SYS_I2C_SLAVE=0x7f +CONFIG_SYS_I2C_SPEED=100000 +CONFIG_PHY_REALTEK=y +CONFIG_SUN8I_EMAC=y +CONFIG_I2C3_ENABLE=y +CONFIG_AXP313_POWER=y +CONFIG_AXP_DCDC3_VOLT=1360 +CONFIG_USB_EHCI_HCD=y +CONFIG_USB_OHCI_HCD=y +CONFIG_USB_MUSB_GADGET=y Edited September 23 by zra123 0 Quote Link to comment Share on other sites More sharing options...
sicxnull Posted September 22 Author Share Posted September 22 (edited) 29 minutes ago, zra123 said: After you ported the code from Miniarch, I compared the differences in the configs of x96q-lpddr3 and x96q-ddr3-v5.1 and I managed to build and run the image on my TV box. But I did it roughly, replacing the differences in the code, I'm not very friendly with Linux. Could you please format it correctly and upload it to github. I'm attaching the differences in the code. I only have the 1.3 board. I actually need to rename this to x96qv1.3 I was not aware how many versions of this board were out there when i initally made this I'm going to try and order some more and hope the other versions come. If i can get one i'll absolutely upload it after testing. it seems like it's pretty easy after what you just posted Edited September 22 by sicxnull 0 Quote Link to comment Share on other sites More sharing options...
zra123 Posted September 22 Share Posted September 22 @sicxnull I would have handled it myself, but I don't know how to correctly format *.patch so that it would calculate all the amounts and indexes for me. And another question: does the installation work on EMMC? Have you added the patch for EMMC from minimyth to your github? 0 Quote Link to comment Share on other sites More sharing options...
sicxnull Posted September 22 Author Share Posted September 22 52 minutes ago, zra123 said: @sicxnull I would have handled it myself, but I don't know how to correctly format *.patch so that it would calculate all the amounts and indexes for me. And another question: does the installation work on EMMC? Have you added the patch for EMMC from minimyth to your github? My Git boots from EMMC. i haven't sent it over to the main armbian repo because i want to tidy some stuff up first and just do one last pull request 0 Quote Link to comment Share on other sites More sharing options...
rafman Posted September 23 Share Posted September 23 @sicxnull I confirm that I test: https://github.com/sicXnull/armbian-build/releases/download/v24.8.0-trunk.425/Armbian-unofficial_24.11.0-trunk_X96q_bookworm_current_6.6.44_mate_desktop.img.xz boots from eMMC and runs well on my old Z1 (x9q v1.3 lpddr3) variant. Ethernet, Hdmi, CPU Temp is working correctly now. Great job. PS: Unfortunately Z1 manufacturer changed the Hardware configuration on new tv-box version with different eMMC and the firmware requires secure boot TOC0 to boot. the above image is not working with the second newer Z1 device. 0 Quote Link to comment Share on other sites More sharing options...
sicxnull Posted September 23 Author Share Posted September 23 4 hours ago, rafman said: I confirm that I test: https://github.com/sicXnull/armbian-build/releases/download/v24.8.0-trunk.425/Armbian-unofficial_24.11.0-trunk_X96q_bookworm_current_6.6.44_mate_desktop.img.xz boots from eMMC and runs well on my old Z1 (x9q v1.3 lpddr3) variant. Ethernet, Hdmi, CPU Temp is working correctly now. Nice! I just ordered another X96Q off aliexpress, hoping its a different version so we can get all variants on Armbian. 0 Quote Link to comment Share on other sites More sharing options...
rafman Posted September 23 Share Posted September 23 (edited) 13 minutes ago, sicxnull said: Nice! I just ordered another X96Q off aliexpress, hoping its a different version so we can get all variants on Armbian. I solved the issue with Secure Boot today with your github branch (https://github.com/sicXnull/armbian-build.git --branch X96Q-TVBOX-LPDDR3 --single-branch) with an additional patch from @Nick A for SECURE BOOT. Right now i check further the box. NOTE: Take care with X96Q boxes from Alliexpress because you may receive Rockchip BOX (rk322x) that works, but is less powerfull than H313 and they stencil the chip as h313 there are lot of scammers. ( i Already have one ) Thanks again. Edited September 23 by rafman 0 Quote Link to comment Share on other sites More sharing options...
IronIgel Posted September 23 Share Posted September 23 Hello everyone, I got my X96Q "variant" from Aliexpress just some days ago. I almost expected some fake stuff and wasn't disappointed: The chip marked as "H313S" isn't a relabeled Allwinner or Rockchip-soc, but a HiSilicon Hi3798mv300 (at least that is, what the bootlog says). So another warning to anyone thinking about buying this kind of box. 0 Quote Link to comment Share on other sites More sharing options...
K R Posted September 24 Share Posted September 24 (edited) Ive been watching this topic for about a week, and i'll be honest, I've no idea on half of what you're talking about. However, I too have a redundant X96Q box, which i'd like to try and run linux so I can then try and run Home Assistant. I flashed Armbian-unofficial_24.11.0-trunk_X96q_bookworm_current_6.6.44_mate_desktop.img to an SD card with Rufus and then again with Belena Etcher, but the TV box wont start with the SD card inserted, although when I say it doesnt boot.. I see nothing through HDMI and the LED remains red. I know its a long shot. But is it currently possible to run on the V4 board (image attached), i see that youre all working hard in the background, so maybe something for me to come back and look at in a few weeks/months. ? Edited September 24 by K R additional information 0 Quote Link to comment Share on other sites More sharing options...
sicxnull Posted September 24 Author Share Posted September 24 3 hours ago, K R said: Ive been watching this topic for about a week, and i'll be honest, I've no idea on half of what you're talking about. However, I too have a redundant X96Q box, which i'd like to try and run linux so I can then try and run Home Assistant. I flashed Armbian-unofficial_24.11.0-trunk_X96q_bookworm_current_6.6.44_mate_desktop.img to an SD card with Rufus and then again with Belena Etcher, but the TV box wont start with the SD card inserted, although when I say it doesnt boot.. I see nothing through HDMI and the LED remains red. I know its a long shot. But is it currently possible to run on the V4 board (image attached), i see that youre all working hard in the background, so maybe something for me to come back and look at in a few weeks/months. ? hmmm. that's another variant Can you try one of these miniarch images and see if they boot? we know X96Q LPDDR3 does not but there are two other variants to try if one of those boot we will atleast know what we are dealing with, unless someone here is already familiar with that board. https://github.com/warpme/miniarch/releases/tag/v20240916 0 Quote Link to comment Share on other sites More sharing options...
K R Posted September 24 Share Posted September 24 MiniArch-20240715-6.10.10-board-h313.x96_q-SD-Image.img boots with a linux command line prompt. Ill be honest though, ive no idea what to do beyond that. 0 Quote Link to comment Share on other sites More sharing options...
sicxnull Posted September 24 Author Share Posted September 24 (edited) 5 hours ago, K R said: MiniArch-20240715-6.10.10-board-h313.x96_q-SD-Image.img boots with a linux command line prompt. The image that @zra123 built may work for you if you're willing to try it and if he is willing to upload it Edited September 24 by sicxnull 0 Quote Link to comment Share on other sites More sharing options...
K R Posted September 24 Share Posted September 24 im willing to try anything, even if i dont achieve anything at my end, it may help others. 0 Quote Link to comment Share on other sites More sharing options...
rafman Posted September 24 Share Posted September 24 (edited) @Nick A @sicxnull According to device test results with secure boot image bellow. And because Bluetooth and WiFi does not work on both boxes Q1 and Z1 (same hardware except eMMC) I found and extract the Q1 stock android firmware dtb file (same hardware on both devices) and I need to modify or patch my local copy of (https://github.com/sicXnull/armbian-build.git --branch X96Q-TVBOX-LPDDR3 --single-branch) I want to ask if Android DTBs are Compatible with Armbian or they need additional maintenance ? Hardware is the bellow: wifi : SV6256P (Same on Z1 and Q1) Bluetooth: BR8052A01 (Same on Z1 and Q1) The android DTB for Q1 contains the below section information about BT and WiFi/Wlan: wlan { compatible = "allwinner,sunxi-wlan"; clocks = <0x1b>; pinctrl-0 = <0xd3>; pinctrl-names = "default"; wlan_busnum = <0x01>; wlan_power; wlan_io_regulator; wlan_regon = <0x53 0x06 0x12 0x01 0xffffffff 0xffffffff 0x00>; wlan_hostwake = <0x53 0x06 0x0f 0x06 0xffffffff 0xffffffff 0x00>; chip_en; power_en; status = "okay"; linux,phandle = <0x17d>; phandle = <0x17d>; }; bt { compatible = "allwinner,sunxi-bt"; clocks = <0x1b>; bt_power; bt_io_regulator; bt_rst_n = <0x53 0x06 0x13 0x01 0xffffffff 0xffffffff 0x00>; status = "okay"; linux,phandle = <0x17e>; phandle = <0x17e>; }; Were i have to place this information to recompile Armbian ? FYI: I attach bellow the full DTB and decompiled DTS file of Q1 tv-Box from Android stock firmware. Q1_device_tree.dtb.tar.gz Q1_device_tree.dts Edited September 24 by rafman 0 Quote Link to comment Share on other sites More sharing options...
Nick A Posted September 25 Share Posted September 25 (edited) You can't use your android dts. It needs to be converted to mainline linux. But you can use some of the information. For example these are the gpio settings for wifi. Android: wlan_regon = <0x53 0x06 0x12 0x01 0xffffffff 0xffffffff 0x00>; Linux: gpio = <&pio 6 18 GPIO_ACTIVE_HIGH>; /* PG18 WL_REG_ON */ Android: wlan_hostwake = <0x53 0x06 0x0f 0x06 0xffffffff 0xffffffff 0x00>; Linux: interrupts = <6 15 IRQ_TYPE_EDGE_RISING>; /* PG15 WL_HOSTWAKE*/ https://www.rapidtables.com/convert/number/hex-to-binary.html https://github.com/warpme/minimyth2/blob/master/script/kernel/linux-6.10/files/0644-arm64-dts-allwinner-h313-add-x96q-TVbox.patch I think your problem is the wifi driver. SV6256P uses the ssv6x5x driver. Only source I can find is for linux 4.4 kernel. https://github.com/paolosabatino/ssv6x5x/tree/master Edited September 25 by Nick A 0 Quote Link to comment Share on other sites More sharing options...
rafman Posted September 25 Share Posted September 25 @K R 20 hours ago, K R said: Im willing to try anything, even if i dont achieve anything at my end, it may help others. In the meantime you can try a Hack in order to boot Armbian to your box from miniarch image that boots with your box (MiniArch-20240715-6.10.10-board-h313.x96_q-SD-Image.img) i can't give any guarantee that it will succeeds but you can try it. (Warning if you are not familiar with below tools don't attempt to continue because if you make a mistake you may damage your hard drive) You will need : A PC with linux (Debian or ubuntu ) Gparted Disks utility (gnome-disks) An SD card 32GB (minimum) and an SD to USB card reader/adapter Balena Etcher (appimage) Armbian Image: https://github.com/sicXnull/armbian-build/releases/download/v24.8.0-trunk.425/Armbian-unofficial_24.11.0-trunk_X96q_bookworm_current_6.6.44_mate_desktop.img.xz Miniarch Image: MiniArch-20240715-6.10.10-board-h313.x96_q-SD-Image.img (you already have it) Steps: (Warning if you are not familiar with above tools don't attempt to continue because if you make a mistake you may damage your hard drive) 1:> Burn MiniArch-20240715-6.10.10-board-h313.x96_q-SD-Image.img using Balena Etcher to your SD card. 2:> After you Burn the image your SD Card will contain 2 partitions (BOOT, ROOT). 3:> Open gparted select your SD Card and remove/delete the ROOT partition on SD card. (apply all operations) 4:> create a new Ext4 partition on SD card (size at least 6 GB) and label it as ROOT. and (apply all operations) and after close gparted 5> unpack Armbian-unofficial_24.11.0-trunk_X96q_bookworm_current_6.6.44_mate_desktop.img.xz and now you will have --> Armbian-unofficial_24.11.0-trunk_X96q_bookworm_current_6.6.44_mate_desktop.img 5:> open Disks Utility, select your SD card on disks (left panel), and select ROOT partition (make it green on right panel) 6:> click on gear icon and select Restore Partition Image..., choose --> Armbian-unofficial_24.11.0-trunk_X96q_bookworm_current_6.6.44_mate_desktop.img When the process finish you will have BOOT, armbi_root partitions on your SD Card. Unmount/Remove and reinsert you SD Card to your PC. Open BOOT partition on SD card and remove/delete the bellow files: Image Image.gz open armbi_root/boot and copy the bellow files to BOOT/ armbianEnv.txt boot.bmp boot.cmd boot.scr config-6.6.44-current-sunxi64 initrd.img-6.6.44-current-sunxi64 --> rename to Image.gz System.map-6.6.44-current-sunxi64 uInitrd-6.6.44-current-sunxi64 vmlinuz-6.6.44-current-sunxi64 --> rename to Image Unmount the disks --> Insert SD card to your TV-Box and try to boot. With this method you don't need to modify the extlinux.conf, I have used his method to boot armbian when the it was not mature for my devices . Try it with you own risk, No guarantees. (if you encounter problems with Hdmi just wait for an upcoming release for your box) but if the system is booting you may have a working system from SD. 0 Quote Link to comment Share on other sites More sharing options...
K R Posted September 25 Share Posted September 25 You will need : A PC with linux (Debian or ubuntu ) Already failed.😞 unless I can run Ubuntu in a sandbox or emu etc. having said that, I’m now investigating whether or not Home Assistant will run on miniarch 0 Quote Link to comment Share on other sites More sharing options...
sicxnull Posted September 30 Author Share Posted September 30 Update. I just got an X96Q 5.1 in today. Going to start working on an image for it. 0 Quote Link to comment Share on other sites More sharing options...
vok4us Posted September 30 Share Posted September 30 (edited) Hello. I created the image according to the instructions of @sicxnull - Armbian boots from microsd very well. How do I install this image in emmc? Please write the instructions Edited September 30 by vok4us Error arabian 0 Quote Link to comment Share on other sites More sharing options...
going Posted October 1 Share Posted October 1 8 часов назад, vok4us сказал: Please write the instructions sudo armbian-install 0 Quote Link to comment Share on other sites More sharing options...
going Posted October 1 Share Posted October 1 @sicxnull Has there been a health check in your work with u-boot patches if you apply your fixes only to the configuration file and do not apply the patch piece that lowers the eMMC frequency? 0 Quote Link to comment Share on other sites More sharing options...
sicxnull Posted October 1 Author Share Posted October 1 14 hours ago, going said: Has there been a health check in your work with u-boot patches if you apply your fixes only to the configuration file and do not apply the patch piece that lowers the eMMC frequency? haven't tried. 0 Quote Link to comment Share on other sites More sharing options...
sicxnull Posted October 1 Author Share Posted October 1 On 9/24/2024 at 11:37 AM, K R said: MiniArch-20240715-6.10.10-board-h313.x96_q-SD-Image.img boots with a linux command line prompt. i just built a 5.1 image. Should work for you https://github.com/sicXnull/armbian-build/releases/download/v24.8.0-trunk.425/Armbian-unofficial_24.11.0-trunk_X96q-v5-1_bookworm_current_6.6.44_mate_desktop.img.xz https://github.com/sicXnull/armbian-build/tree/X96Q-5.1-DDR3 1 Quote Link to comment Share on other sites More sharing options...
going Posted October 2 Share Posted October 2 10 часов назад, sicxnull сказал: 01.10.2024 в 09:17, going сказал: Has there been a health check in your work with u-boot patches if you apply your fixes only to the configuration file and do not apply the patch piece that lowers the eMMC frequency? haven't tried. https://github.com/sicXnull/armbian-build/commit/333e462466670e9a8609771ccd05977b87800881#diff-60905755e35d9115365c06e07ef492c1e5cfde8cdd018a10496129e19b6b7b2d The first piece affects all devices and will be applied directly in the u-boot code. diff --git a/arch/arm/dts/sun50i-h616.dtsi b/arch/arm/dts/sun50i-h616.dtsi --- a/arch/arm/dts/sun50i-h616.dtsi +++ b/arch/arm/dts/sun50i-h616.dtsi @@ -324,7 +324,7 @@ pinctrl-names = "default"; pinctrl-0 = <&mmc2_pins>; status = "disabled"; - max-frequency = <150000000>; + max-frequency = <12000000>; cap-sd-highspeed; cap-mmc-highspeed; mmc-ddr-3_3v; Instead, you can specify the frequency directly in the device's DTS, if necessary. In any case, the u-boot code is more advanced and it doesn't really matter to him. This part is done in SPL: diff --git a/drivers/mmc/sunxi_mmc.c b/drivers/mmc/sunxi_mmc.c --- a/drivers/mmc/sunxi_mmc.c 2024-01-08 16:37:48.000000000 +0100 +++ b/drivers/mmc/sunxi_mmc.c 2024-03-08 10:51:44.771585037 +0100 @@ -542,7 +542,7 @@ cfg->b_max = CONFIG_SYS_MMC_MAX_BLK_COUNT; cfg->f_min = 400000; - cfg->f_max = 52000000; + cfg->f_max = 12000000; if (mmc_resource_init(sdc_no) != 0) return NULL; Try to exclude it first. If you get a non-bootable system, we will need to think about how to surround this ifdef code with directives so that it does not apply to everyone. 0 Quote Link to comment Share on other sites More sharing options...
sicxnull Posted October 2 Author Share Posted October 2 3 hours ago, going said: The first piece affects all devices and will be applied directly in the u-boot code. correct me if i'm wrong, but the point of a board level patch is so that it does not apply to all devices, no? that's the point of creating the board_x96q subdirectory instead of just adding the patches to the u-boot sunxi directory. You can see this when building armbian. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.