From owner-freebsd-arm@FreeBSD.ORG Wed May 15 13:46:06 2013 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C1A656B3 for ; Wed, 15 May 2013 13:46:06 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from mail-qa0-x234.google.com (mail-qa0-x234.google.com [IPv6:2607:f8b0:400d:c00::234]) by mx1.freebsd.org (Postfix) with ESMTP id 7E3E5ED0 for ; Wed, 15 May 2013 13:46:06 +0000 (UTC) Received: by mail-qa0-f52.google.com with SMTP id bn16so445907qab.11 for ; Wed, 15 May 2013 06:46:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:sender:subject:mime-version:content-type:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to:x-mailer:x-gm-message-state; bh=2nTuIWr+YzqDf9Bco/zBolQBU3tgj27gYJ9tsdFiX+A=; b=lFUEmLvtAPlMKQtlznkAJeMMPCj1g10ywhShyslQHZI/Wa/XcLwDjXvl5Ue6A43CCy kf7oDkAAV4ZLcFk4gqnD8YucT4lIMEuG63q6OfvZwcF7u3lm/EVJ7leaKxIyaQDSRxE8 OF2OI9doXYhAeo/+95pnq2yfl5yfUZRlIWAKvHaYsW6lXlSrH4te9C5Kz3tNN/37x/fJ Cq7ERwlng5DNsI4UlnKjNKzaFZSHzGMi7VfvsiTs4MTkgYR5ybGaVMWt3K4juAyQK2ok rZ8NzPKheiTdYXvytZ3jPLJgt6TGiZByJXRdlfdfpM6PjCvLxbrx+ct8qKp9DKnt1E75 CGzg== X-Received: by 10.224.80.70 with SMTP id s6mr28346837qak.27.1368625565968; Wed, 15 May 2013 06:46:05 -0700 (PDT) Received: from [10.137.210.141] ([137.122.64.58]) by mx.google.com with ESMTPSA id l13sm3201719qaj.9.2013.05.15.06.46.02 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 15 May 2013 06:46:05 -0700 (PDT) Sender: Warner Losh Subject: Re: RS-232 driver for GPIO Mime-Version: 1.0 (Apple Message framework v1085) Content-Type: text/plain; charset=us-ascii From: Warner Losh In-Reply-To: Date: Wed, 15 May 2013 09:46:01 -0400 Content-Transfer-Encoding: quoted-printable Message-Id: References: <20130514192448.7b48e095.ray@freebsd.org> <20130515021751.8848a996.ray@freebsd.org> <20130515122955.4387631e9969ae460f6500c7@freebsd.org> To: Tom Everett X-Mailer: Apple Mail (2.1085) X-Gm-Message-State: ALoCoQkzpHM8SPnnSTAdxQ9xZaosKsS3zFPgY5lpJ7/rGfEr53DRYfF06BgBShwk8m20zDCAxscH Cc: Aleksandr Rybalko , "freebsd-arm@freebsd.org" X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Porting FreeBSD to the StrongARM Processor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 May 2013 13:46:06 -0000 On May 15, 2013, at 9:40 AM, Tom Everett wrote: > ok, just one further question. It was basically guess work that = enabled me > to decypher that /dev/ttyu0 (sio0) was bound to uart0. I presume = there > must be some simple way from the command line to query the OS and find = out > which hardware devices are bound to which /dev/ entries? The unit numbers generally match the alias names in the FDT. However, we don't note what the names for the nodes we're attaching to = on FDT systems. We really should, but we don't... Warner > On Wed, May 15, 2013 at 3:29 AM, Aleksandr Rybalko = wrote: >=20 >> On Tue, 14 May 2013 20:24:42 -0600 >> Tom Everett wrote: >>=20 >>> Did you mean 14 &15, or 14 & 16? >> Yeah, right. >>=20 >>=20 >>> ok so given this, I've done some reading. I'm by no means a FreeBSD >>> expert, so forgive me if I'm completely wrong. I see this in the = FDT: >>>=20 >>> /* UART0 */ >>> pins_uart0_a: uart0_a { >>> broadcom,pins =3D <14>, <15>; >>> broadcom,function =3D "ALT0"; >>> }; >>=20 >> If you satisfied by single UART, you no need change that. >>=20 >>=20 >>>=20 >>>=20 >>> and this: >>>=20 >>> chosen { >>> bootargs =3D ""; /* Set by VideoCore = */ >>> stdin =3D "uart0"; >>> stdout =3D "uart0"; >>> }; >>>=20 >>=20 >> But that stdin and stdout direct kernel console messages to air by = your >> xbee :) >> So you need comment it or set different in/out device. >>=20 >>=20 >>>=20 >>> So I interpret that to mean that uart0 is bound to pins 14, 15, and >>> furthermore that the serial device bound to uart0 is bound to stdin = and >>> stdout. In my /dev/ I see: >>>=20 >>> crw------- 1 root wheel 0x1f Apr 27 13:42 ttyu0 >>> crw------- 1 root wheel 0x20 Apr 27 21:42 ttyu0.init >>> crw------- 1 root wheel 0x21 Apr 27 21:42 ttyu0.lock >>> crw-rw---- 1 uucp dialer 0x22 Apr 27 21:42 cuau0 >>> crw-rw---- 1 uucp dialer 0x23 Apr 27 21:42 cuau0.init >>> crw-rw---- 1 uucp dialer 0x24 Apr 27 21:42 cuau0.lock >>>=20 >>> So, that is telling me that sio0 is bound to uart0, which is a = serial >>> console? >>=20 >> Yep. >>=20 >>>=20 >>> If so, that means that I could use pins 14 & 15 for rs-232, but I = would >>> have to chose b/t using those pins to talk to another device (xbee), = or a >>> serial console? >>=20 >> if you will disconnect serial console you will have to choose between >> control over network (SSH/telnet/etc) or graphic console (Display = with >> HDMI + USB keyboard). >>=20 >>>=20 >>>=20 >>>=20 >>>=20 >>>=20 >>> On Tue, May 14, 2013 at 5:17 PM, Aleksandr Rybalko >> wrote: >>>=20 >>>> On Tue, 14 May 2013 12:20:08 -0600 >>>> Tom Everett wrote: >>>>=20 >>>>> ok so the FDT definition would have to be added here? >>>>>=20 >>>>>=20 >>>>=20 >> = http://svnweb.freebsd.org/base/head/sys/boot/fdt/dts/bcm2835-rpi-b.dts?vie= w=3Dmarkup >>>>>=20 >>>>=20 >>>> Yeah, right. >>>>=20 >>>> But I have bad news. Both UARTs can be connected to pairs(tx+rx) = 14+16, >>>> 32+33, 40+41 and both UARTs can be connected to any of this pins. >>>> But only 14, 16 and 40(PWM0) wired to ext.pin. >>>>=20 >>>>>=20 >>>>>=20 >>>>> On Tue, May 14, 2013 at 10:24 AM, Aleksandr Rybalko = >>=20 >>>>> wrote: >>>>>=20 >>>>>> On Tue, 14 May 2013 09:06:44 -0700 >>>>>> Adrian Chadd wrote: >>>>>>=20 >>>>>>> ... the r-pi actually has an RS232 port exposed via GPIO. It's >>>>>>> only 3.3v but it's there. >>>>>>>=20 >>>>>>> Someone just needs to write up an SIO driver for it and then put >>>>>>> the GPIO pins in question into RS232 "mode". >>>>>>=20 >>>>>> we have it already :) (console works on uart) >>>>>> only FDT definition is required. >>>>>> And maybe some fixes for boudrate setting and/or format setup >>>>>> (bits/parity/stop bits/etc) >>>>>>=20 >>>>>>>=20 >>>>>>> Yay multi-function GPIO pins! >>>>>>>=20 >>>>>>>=20 >>>>>>>=20 >>>>>>> adrian >>>>>>>=20 >>>>>>>=20 >>>>>>> On 14 May 2013 08:58, Tom Everett wrote: >>>>>>>> Good morning ARM mailing list. >>>>>>>>=20 >>>>>>>> I've been running FreeBSD on my Pi, and I've now got two XBee >>>>>>>> Pros which I hope to connect. XBee's communicate over RS-232. >>>>>>>>=20 >>>>>>>> https://www.sparkfun.com/products/8742 >>>>>>>>=20 >>>>>>>> I see from the source tree that it was possible to attach the >>>>>>>> iic driver to GPIO pins in software: >>>>>>>>=20 >>>>>>>>=20 >>>> = http://svnweb.freebsd.org/base/head/sys/dev/gpio/gpioiic.c?view=3Dmarkup >>>>>>>>=20 >>>>>>>> I'm wondering, it is possible to connect the FreeBSD serial >>>>>>>> driver for RS-2332 to GPIO in a similar way to how iic was >>>>>>>> connected? >>>>>>>>=20 >>>>>>>>=20 >>>>>>>>=20 >>>>>>>> -- >>>>>>>> A better world shall emerge based on faith and understanding - >>>>>>>> Douglas MacArthur >>>>>>>> _______________________________________________ >>>>>>>> freebsd-arm@freebsd.org mailing list >>>>>>>> http://lists.freebsd.org/mailman/listinfo/freebsd-arm >>>>>>>> To unsubscribe, send any mail to >>>>>>>> "freebsd-arm-unsubscribe@freebsd.org" >>>>>>> _______________________________________________ >>>>>>> freebsd-arm@freebsd.org mailing list >>>>>>> http://lists.freebsd.org/mailman/listinfo/freebsd-arm >>>>>>> To unsubscribe, send any mail to >>>>>>> "freebsd-arm-unsubscribe@freebsd.org" >>>>>>=20 >>>>>>=20 >>>>>> -- >>>>>> Aleksandr Rybalko >>>>>>=20 >>>>>=20 >>>>>=20 >>>>>=20 >>>>> -- >>>>> A better world shall emerge based on faith and understanding - >>>>> Douglas MacArthur >>>>=20 >>>>=20 >>>> -- >>>> Aleksandr Rybalko >>>>=20 >>>=20 >>>=20 >>>=20 >>> -- >>> A better world shall emerge based on faith and understanding - = Douglas >>> MacArthur >>=20 >> Good luck! And let us know how things is going :) >>=20 >> WBW >> -- >> Aleksandr Rybalko >>=20 >=20 >=20 >=20 > --=20 > A better world shall emerge based on faith and understanding - = Douglas > MacArthur > _______________________________________________ > freebsd-arm@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-arm > To unsubscribe, send any mail to "freebsd-arm-unsubscribe@freebsd.org"