raspberrypi / linux

Kernel source tree for Raspberry Pi-provided kernel builds. Issues unrelated to the linux kernel should be posted on the community forum at https://forums.raspberrypi.com/
Other
11.1k stars 4.97k forks source link

Bootloader UART setup #18

Closed bootc closed 12 years ago

bootc commented 12 years ago

Could the bootloader set up the PL011 UART before it hands over to the kernel? Currently I have code in https://github.com/bootc/linux/commit/a91fe13824cde1187bb1acfdea7140c9ee0ba66c that sets up the serial port during the kernel decompression stage so that it can be used during decompression and then during early printk.

It would really be ideal if that was done outside the kernel as is more customary, and would mean you could boot compressed or uncompressed kernels and get the same behaviour.

popcornmix commented 12 years ago

You would like the code inside your arch_decomp_setup (5 peripheral writes) to be done by GPU before kernel starts? Sounds okay.

bootc commented 12 years ago

Yep, just so the UART is good to go. Perhaps even have a config.txt option to change the baud rate if someone wants a different speed.

popcornmix commented 12 years ago

This link is no longer valid: https://github.com/bootc/linux/commit/a91fe13824cde1187bb1acfdea7140c9ee0ba66c

I'd quite like to see the code in that commit.

bootc commented 12 years ago

Ahh sorry I had a bit of a reorganisation on github so it's moved to: https://github.com/bootc/linux-rpi-orig/commit/a91fe13824cde1187bb1acfdea7140c9ee0ba66c

bootc commented 12 years ago

I should add, I will happily provide you with the generated ARM assembly if that's any help.

popcornmix commented 12 years ago

Can you try: http://dl.dropbox.com/u/3669512/start.elf

which should set up UART to 115200 with a 3MHz clock as requested elsewhere. You can modify these: CONFIG(init_uart_baud) CONFIG(init_uart_clock)

nomis commented 12 years ago

This is the same start.elf from #16 and writes to the UART without prior initialisation by the kernel worked too.

popcornmix commented 12 years ago

Firmware now pushed to github. Please close issue if happy.

bootc commented 12 years ago

I haven't actually managed to test this myself yet, but Simon has and assures me it's fine. So I'll close it for now and reopen it if I run into any trouble.

Thanks! Chris

Stonie commented 12 years ago

This is not working for me, please see: https://github.com/raspberrypi/linux/issues/105