Date: Sun, 03 Feb 2013 12:34:28 +0000 From: Iain Young <iain@g7iii.net> To: Tim Kientzle <tim@kientzle.com> Cc: freebsd-arm@freebsd.org, Ian Lepore <ian@freebsd.org> Subject: Re: Beaglebone Serial Ports Message-ID: <510E5954.7000303@g7iii.net> In-Reply-To: <66029B5F-2A19-4683-B589-814932E156A2@kientzle.com> References: <510CE8E0.9070102@g7iii.net> <1359818003.93359.381.camel@revolution.hippie.lan> <66029B5F-2A19-4683-B589-814932E156A2@kientzle.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On 02/02/13 20:03, Tim Kientzle wrote: > > On Feb 2, 2013, at 7:13 AM, Ian Lepore wrote: > >> On Sat, 2013-02-02 at 10:22 +0000, Iain Young wrote: >>> Hi Folks, >>> > It should just be a matter of updating the DTS file with > additional UART entries and updated pinmux. > > Unfortunately, the current BeagleBone builds use a compiled-in > device tree, so you'll have to edit the DTS file at > sys/boot/fdt/dts/beaglebone.dts > and then rebuild the kernel. Thanks both, you gave me the exact hints to go look in the right place. I already have a partial patch written, after I found the register addresses and interrupts in a linux dmesg output :) Is it appropriate to post small(ish) patches here ? It'll probably be next weekend before I get the chance to test it, as it seems I am lacking dtc, so need to buildworld (according to the great google...), but the 8 Gig card isn't due here for a few days. Tim, I've already grabbed your 8G image with the fixed cpsw driver, so I will test that at the same time > I'd like to move that out of the kernel; the loader already > has logic to load a DTS file and pass it to the kernel, > it should just need some tinkering with loader.rc to get > it working. That would make it a lot easier to tweak > settings on a per-system basis without having to rebuild > the kernel. > >> According to the datasheet all the onboard uarts should be supported by >> our standard uart driver (but only uart1 has all the modem-control lines >> wired). Only by default. We just need to set the pinmux appropriately to gain access to CTS and RTS for UARTS 1 thru 5. UART3 only has CTS and RTS exposed, no TX or RX, but then that still has it's uses for things like PPS and testing MSF receivers prior to looking at GPIO interrupts :) http://www.jerome-bernard.com/blog/2012/06/04/beaglebone-serial-ports-and-xbees/ has a list of which serial ports are mapped to which pins, and the pinmux mode they need in order to access them. UART3 CTS is on connector P8 Pin 36, Mode 6. It's RTS is next door on P8 Pin 34 > The pinmux for BeagleBone is in the DTS file, > specifically, the scm@44e10000 section. > The pad-config section is parsed by > general code in sys/arm/ti/ti_scm.c driven from an > SoC-specific table in sys/arm/ti/am335x/am335x_scm_padconf.c. Ah, now that looks easy. I just have to work out if setting them to input_pulldown is enough (for input pins) or if they need telling "mode6" as well. Under linux you set the mode, and get the pulldown mode set automatically. > I don't know offhand if there is currently a mechanism for > changing pinmux at runtime. It would certainly be nice to > have such a mechanism. Indeed it would, and it can be done, as Linux has it. But I will have to leave that to others more experienced in FreeBSD kernel hacking than I. For my uses, the 'bone has more than enough other GPIO pins that it's not a problem to leave them hard wired for the serial ports. Iain
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?510E5954.7000303>