Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question about using lpdd3/ddr4 on h616! #9

Open
sputnik2019 opened this issue Jul 13, 2022 · 16 comments
Open

Question about using lpdd3/ddr4 on h616! #9

sputnik2019 opened this issue Jul 13, 2022 · 16 comments

Comments

@sputnik2019
Copy link

We want to use lpddr/ddr4 on h616, but the mainline u-boot does not support it, is there any other way than using sunxi-uboot?

@jernejsk
Copy link
Contributor

Usually you would work together with Allwinner to determine correct DRAM parameters for your board. Those parameters should allow to make working BSP based images. Once that's done, mainline U-Boot can re-use them and if necessary, reverse engineer additional code, to make it work.

@sputnik2019
Copy link
Author

We use the SDK provided by Allwinner, which can use ddr4 normally, but how can we transplant these parameters to the mainline u-boot?dump all register?

@jernejsk
Copy link
Contributor

Well, in this case, some reverse engineering of AW blob is also needed, because there is no H616 DDR4 support in mainline yet. I'm original author of mainline DDR3 driver for H616, so I can help you with that. Contact me on e-mail in profile for further information.

@apritzel
Copy link
Owner

Yes, dumping the registers would be a start, from a quick check at the driver it's probably (at the U-Boot prompt):
=> md.l 0x047FA000 0x141
=> md.l 0x047FB000 0xca
=> md.l 0x04800000 0x2d8
But please keep in mind that DDR4 is somewhat different, so probably requires a different initialisation sequence, which is impossible to deduct from just the controller register dump.
If you have a boot0 binary, that would help, but is still quite a lot of work, and realistically requires access to the hardware for testing and verification.

@sputnik2019
Copy link
Author

sputnik2019 commented Aug 9, 2022

Sorry to reply to you after so long, we encountered some problems about h313/h616.Allwinnertech recently upgraded h313/h616 (BA->BB version) hardware. We found that the original ac200 was upgraded to ac300! One of the network cards of our hardware did not work (using jernejsk the u-boot patch), and now we are working with fae to fix this problem, but we have not solved this problem yet because Allwinnertech did not provide detailed information there! After this problem is fixed, the next step we are ready to debug the ddr4 module! Thank you for your help, thank you very much!

@sputnik2019
Copy link
Author

sputnik2019 commented Aug 15, 2022

@sputnik2019
Copy link
Author

sputnik2019 commented Aug 22, 2022

@jernejsk
We disassemble boot0.elf by ida, refer to the mainline initialization of ddr3. Now ddr4 can work fine on h313, thanks again for the tip! Next we will start to solve the problem of ac300!
thx

@jernejsk
Copy link
Contributor

@sputnik2019 I didn't have much time to help you, but it seems you figured it on your own. That's always a great thing to see! Do you plan to upstream support for your board? It would be great to have official upstream support for ddr4 board.

@iuncuim
Copy link

iuncuim commented Sep 7, 2022

@sputnik2019
Could you share your solution to the ddr4 issue?

@sputnik2019
Copy link
Author

my mail:[email protected]
my board is h313 and use 16bit ddr4!First you should need to run boot0 (uboot) on your board,and
=> md.l 0x047FA000 0x141
=> md.l 0x047FB000 0xca
=> md.l 0x04800000 0x2d8

@sputnik2019
Copy link
Author

Thanks to jernejsk's mainline uboot source code, we only need to modify it on this basis to use it (at least I am)!!

You just need to modify a few jump branches on the basis of the mainline uboot, and compare which 3 sets of registers and modify it according to the source code of boot0! You can use the ida tool to disassemble the boot0 source code (ida open boot0.elf press the F5 button to see the C source code, parameter a1 is your sys_config.fex in the lpddr4 parameter) If you see the source code I believe you should soon make your lpddr4 work. There's a difference between what I'm using ddr4 not lpddr4, so you can't use my source code
boot0 elf

@smarthobee612
Copy link

感谢 jernejsk 的主线 uboot 源代码,我们只需要在此基础上修改它就可以使用它(至少我是)!!

你只需要在主线uboot的基础上修改几个跳转分支,对比哪3组寄存器,根据boot0的源码进行修改!你可以使用 ida 工具反汇编 boot0 源代码(ida 打开 boot0.elf 按 F5 按钮查看 C 源代码,参数 a1 是 lpddr4 参数中的 sys_config.fex)如果你看到源代码,我相信你应该很快就会让你的 lpddr4 工作。我使用的 ddr4 和 lpddr4 是有区别的,所以你不能使用我的源代码 boot0 elf

我最近也在使用全志H616为自己设计一款便携开发板,想使用LPDDR4/DDR4颗粒,使用你修改U-boot就可以支持LPDDR4/DDR4颗粒是吗?还有最大支持的4GB是吗?谢谢!

@iuncuim
Copy link

iuncuim commented Jun 18, 2023

@smarthobee612, I made initial support for LPDDR4 (you can look u-boot repository in my profile), and @sputnik2019 have something for DDR4. So anything is possible.

P.S.: Next time will be better if you duplicate your request in English (even with a translator)

@smarthobee612
Copy link

ok,thank you for your reply!

@xobs
Copy link

xobs commented Aug 1, 2023

I see this Issue is still open, even though there is a comment on initial support being added. Is there still more work to do, and if so how much?

@Andre-ARM
Copy link
Contributor

@xobs please keep in mind that U-Boot uses a mailing list development approach, so (personal!) github repos are merely a way to contact developers, but not in anyway used to track actual development.
That being said: LPDDR3 support has been merged some days ago, and LPDDR4 support has been posted on the list:
https://lore.kernel.org/u-boot/[email protected]/
Feel free to test and reply on the list, to accelerate the upstreaming process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants