Ingenic-community / uboot-xburst

U-Boot for Ingenic XBurst SoCs
Other
3 stars 1 forks source link

x2000e uboot serial console has output, but no input #1

Open ballaswag opened 5 months ago

ballaswag commented 5 months ago

Thought I try my luck asking here. Seems like the only place where newer ingenic boards are discussed at all.

I've been playing with with the X2000E SoC from the creality K1 printer, got uboot/spl etc. to bootstrap and such. But I'm not able to get keyboard input to work at the uboot prompt via serial. I'm able to build a uboot that prompts and execute the initial bootcmd, but no input works after that. https://github.com/ballaswag/ingenic-usbboot?tab=readme-ov-file#splu-boot

The same serial connection/adapter and all works on the same board when linux is booted.

ReimuNotMoe commented 5 months ago

The pinmux may be incorrect?

X2000 support of this repo is outdated for more than 1 year, I can ask Ingenic for their latest X2000 uboot source package after the Spring Festival

ReimuNotMoe commented 5 months ago

When you're in Linux, try dumping GPIO registers (busybox devmem 0x1001xxxx) and see which physical pins are mapped to UART signals. You can find the register addresses in X2000_PM.pdf (in the datasheets repo of this org).

ballaswag commented 5 months ago

Thank you so much for the hint! I figured it out after revisiting this again after sometime.

Some context, I'm bootstrapping this via the usb debug port and the tool I linked above, essentially the usbboot tool but with load and jump addresses added for the x2000. From memory I probably never actually built a SPL that successfully initialized the board. So I grab and augmented the SPL from their cloner tool for the x2000. From there I was able to init the board and load my uboot. But input never worked.

I was confused even though I checked and double checked the uart/func/pin configuration in uboot. It properly configures the desire port/func/pin. Building and rebuilding didn't help.

Then it occurred to me that the uart init actually happens in the SPL and not uboot. Since I'm using their SPL, the changes didn't apply. However, looking at their global_info struct, I was able to map out the uart configs in their SPL binary. Turns out their SPL only configured the TX pin and not the RX pin. Editing the RX bit in the SPL got input and output to work!

I guess it'll be nice if I can figure out how to build a proper SPL for this board and not have to edit bits in the binary blob.

ballaswag commented 5 months ago

Also saw that you got Debian running on one of these mips boards. By any chance you can document the process? Will be helpful for people trying to run Debian on these Creality 3D printers.

LazyCoderOZ commented 4 months ago

Was there any progress on this one?

ballaswag commented 4 months ago

Was there any progress on this one?

If you're asking about a working uboot via usbboot for x2000 specifically, then you can use the one from my repository. I have patched so serial in/out work as expected.