Jump to content

Recommended Posts

Posted

Alright, I built the x96q-lpddr3 image using the patches suggested. It booted (partially). Nothing on the screen, but it is starting!
I chose that image because it is H313 and lpddr3 (the android uboot build that worked before detected it as such)
I attached the serial log. It's getting late here and I may not get much more done on this until Monday, but this is a good sign in my opinion.

uboot.txt

Posted

Hmm, according to the config, the X96q lpddr3 uses the AXP313 already. Maybe ram is wrong? Pretty sure it's lpddr3, if there is any way to check that, I can. Gonna do a little digging in android.

Posted

According to Android uboot, DRAM_VCC= 1200mv
DRAM CLK =648 MHZ
DRAM TYPE=7 (lpddr3)
DRAM SIZE =1536 MBytes, para1 = 30fa, para2 = 6001000, dram_tpr13 = 26061
gonna try some of this in the x96q image, see what happens
 

Posted
/sunxi-fw info -v fulldisk.img 
@     0: mbr: DOS MBR
    protective MBR, GPT used
    GPT version 00010000
    usable disk size: 7419 MB
    number of partition entries: 17
@   16: toc0: signed boot image
    2 items
    size: 98304 bytes
@ 321: toc0: signed boot image
    2 items
    size: 98304 bytes
@26812: fit: U-Boot FIT image
    fit:__overlay__: "<no description>"
    fit:__overlay__: "<no description>"
    fit:fragment@2: "<no description>"

So I never dumped just boot0  (and no firmware update available), but I have full emmc dump named fulldisk.img.
I would assume it is the toc0?
Trying to extract does not work , however: (maybe because there are two?)

/sunxi-fw extract -v -n toc0 -o uboot0 /home/Tr/fulldisk.img 
unknown image file

extracting the mbr works fine though.

Posted (edited)

Oh, so it is the devicetree of Linux we want. My bad. Here it is: devicetree.txt
FYI I was able to use binwalk -e on the boot partition dump, nice to see there is another way. Thanks for all the help

Edited by Randlin
Posted (edited)

Actually in that post it was about downloading the boot_a partition. Then extracting the dts.. you can skip the dts extraction part for now. We need your boot_a partition.

 

also that’s not the android dts you posted. It has some info but not all of it.

Edited by Nick A
Posted (edited)

Hmm, I used a different boot.img extractor before to try to get dts, but that spectacularly failed ( https://github.com/anestisb/android-unpackbootimg ). I do have a dump of each of the partitions from root, but there was no boot_a boot_b, just boot (not an a/b system). I'll try that extractor, hopefully that will be better.

everthing is here: https://archive.org/download/G96_Firmware_Dump/Dumped Partitions/
list of partitions dumped: (there are 17 listed in the emmc, but 18 in android for some reason, probably one is a duplicate)

Reserve

boot

bootloader

cache

empty

env

frp

media_data

metadata

misc

mmcblk0boot0

mmcblk0boot1

private

recovery

super

vbmeta

vbmeta_system

vbmeta_vendor

Edited by Randlin
Posted (edited)

Have you tried running sunxi-fw with the boot image you used to extract the dts? The boot image you posted is a U-Boot FIT image. It doesn't have the dram information we are looking for. I believe mmcblk0boot0 is the correct boot image but the one you uploaded didn't work with sunxi-fw. 

 

Also, I found this in your dts. Maybe these settings will work. To make sure these settings are correct I prefer to get the dram settings using the sunxi-fw tool.

 

	dram {
		compatible = "allwinner,dram";
		clocks = <0xda>;
		clock-names = "pll_ddr";
		dram_clk = <0x288>;
		dram_type = <0x07>;
		dram_zq = <0x3f3fdd>;
		dram_odt_en = <0x9988eeee>;
		dram_para1 = <0x30fa>;
		dram_para2 = <0x1000>;
		dram_mr0 = <0x00>;
		dram_mr1 = <0xc3>;
		dram_mr2 = <0x06>;
		dram_mr3 = <0x01>;
		dram_tpr0 = <0x00>;
		dram_tpr1 = <0x00>;
		dram_tpr2 = <0x00>;
		dram_tpr3 = <0x00>;
		dram_tpr4 = <0x00>;
		dram_tpr5 = <0x00>;
		dram_tpr6 = <0x2fc08080>;
		dram_tpr7 = <0x00>;
		dram_tpr8 = <0x00>;
		dram_tpr9 = <0x00>;
		dram_tpr10 = <0x402f3379>;
		dram_tpr11 = <0xd100b0f>;
		dram_tpr12 = <0x11131113>;
		dram_tpr13 = <0x80060>;
		linux,phandle = <0x183>;
		phandle = <0x183>;
		device_type = "dram";
		dram_dx_odt = <0x6060606>;
		dram_dx_dri = <0xd0d0d0d>;
		dram_ca_dri = <0x1919>;
		dram_mr4 = <0x00>;
		dram_mr5 = <0x00>;
		dram_mr6 = <0x00>;
		dram_mr11 = <0x00>;
		dram_mr12 = <0x00>;
		dram_mr13 = <0x00>;
		dram_mr14 = <0x00>;
		dram_mr16 = <0x00>;
		dram_mr17 = <0x00>;
		dram_mr22 = <0x00>;
	};

The dram clock is in hex you'll need to convert this value to decimal. https://www.rapidtables.com/convert/number/hex-to-decimal.html

Edited by Nick A
Posted

Hmm, I tried running it on both mmcblk0boot* and got no output. I'll try running it on the full dump with -a to see if anything comes up. I'll try adding it to the config and go from there, see if it works. I'm not familiar with memory config and a lot of this stuff, but I am trying to learn all kinds of low level stuff and welcome the challenge!

Posted

You can find the dram config options here. 

https://elixir.bootlin.com/u-boot/v2025.07-rc2/source/arch/arm/mach-sunxi/Kconfig

 

if DRAM_SUN50I_H616
config DRAM_SUNXI_DX_ODT
	hex "DRAM DX ODT parameter"
	help
	  DX ODT value from vendor DRAM settings.

config DRAM_SUNXI_DX_DRI
	hex "DRAM DX DRI parameter"
	help
	  DX DRI value from vendor DRAM settings.

config DRAM_SUNXI_CA_DRI
	hex "DRAM CA DRI parameter"
	help
	  CA DRI value from vendor DRAM settings.

config DRAM_SUNXI_ODT_EN
	hex "DRAM ODT EN parameter"
	default 0x1
	help
	  ODT EN value from vendor DRAM settings.

config DRAM_SUNXI_TPR0
	hex "DRAM TPR0 parameter"
	default 0x0
	help
	  TPR0 value from vendor DRAM settings.

config DRAM_SUNXI_TPR2
	hex "DRAM TPR2 parameter"
	default 0x0
	help
	  TPR2 value from vendor DRAM settings.

config DRAM_SUNXI_TPR6
	hex "DRAM TPR6 parameter"
	default 0x3300c080
	help
	  TPR6 value from vendor DRAM settings.

config DRAM_SUNXI_TPR10
	hex "DRAM TPR10 parameter"
	help
	  TPR10 value from vendor DRAM settings. It tells which features
	  should be configured, like write leveling, read calibration, etc.

config DRAM_SUNXI_TPR11
	hex "DRAM TPR11 parameter"
	default 0x0
	help
	  TPR11 value from vendor DRAM settings.

config DRAM_SUNXI_TPR12
	hex "DRAM TPR12 parameter"
	default 0x0
	help
	  TPR12 value from vendor DRAM settings.

 

 

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines