Beaglebone Serial Ports Progress

Damjan Marion dmarion at
Fri Feb 15 16:46:55 UTC 2013

On Feb 15, 2013, at 12:20 PM, Iain Young <iain at> wrote:

> Hi Folks,
> After waiting for deliveries, and a few false starts, I have made
> -some- progress on adding support for the Beaglebone's serial ports
> (UARTS1-5) to FreeBSD
> First thing I did was add the pinmux stuff, having worked out exactly
> what I needed to add to the DTS, and recompile. This seems to have
> worked out well, and on a reboot I see:
> setting internal 28 for uart1_rxd
> setting internal 0 for uart1_txd
> This is good. kernel comes up,curiously though, I don't see lines
> output for the RTS and CTS lines (which I do set to the correct mode,
> yet I do for UART3 CTS and UART4 CTS, which I added as a test.
> I then proceeded to add  the uart1 device itself to the DTS, and
> added the following:
> 	uart1: serial at 48022000 {
>                        compatible = "ns16550";
>                        reg = <0x48022000 0x1000>;
>                        reg-shift = <2>;
>                        interrupts = < 73 >;
>                        interrupt-parent = <&AINTC>;
>                        clock-frequency = < 48000000 >;
>                };
> This caused the kernel to dump me in db (debugger I guess). I figured
> out that 't' gave me a trace, and it looked like it was in the middle
> of probing for UARTS. (This is about as much knowledge I have about the
> kernel debugger)
> I tried changing 0x1000 for 0x2000, as it seems the next reg is also
> reserved for UART1. No more luck. So, thinking I needed to add it as an
> alias (as UART0 is), I added that, but it still dumped me at the
> debugger on boot.
> The only other thing is reg-shift. I must confess, I am a bit blind
> here. Not knowing what it actually did I left it as with UART0. I'm
> hoping it essentially includes the next register up for UART1, as
> while that's listed as "Reserved" in the memory map [Yes, I consulted
> SPRUH73G :)] , it seems to be reserved for UART1, but I am just
> guessing (Yes, I know, not good practice when kernel hacking...)
> I've attached the latest version of my patch, the output from the
> kernel until it blows up, as well as the trace. Patch is based on
> r246610
> Anyone able to point me in the right direction ? I can't be too far
> away, and I can then add UART2-5, and submit an actual working patch!

It is very likely that clock is disabled for USART1. Problem is that usart uses
standard serial driver which is not requesting clock to be enabled during the attach
by invoking ti_prcm_clk_enable().

Can you try to put following at the end of am335x_prcm_attach()?

	prcm_write_4(6c, 2);

This should be register CM_PER_UART1_CLKCTRL.


More information about the freebsd-arm mailing list