On Saturday, November 4, 2017 at 12:16:52 AM UTC+5:30, José Castro wrote:
>
> Hello everyone.
> I've been lurking here and googling around looking for answers but found 
> no one doing what I'm trying.
>
> My main objective is to be able to use 16 pins as PRU inputs, on a single 
> PRU, without board modification or additional hardware.
>
> PRU1 has most of the pins available and there are two that are really good 
> candidates for reassigning: PR1_PRU1_PRU_R31_14 and PR1_PRU1_PRU_R31_15, 
> which go out on pins E15 and E16.
> The pins E15 and E16, named UART0_TXD and UART0_RXD respectively, are by 
> default assigned to a uart0 device with parts of its definition in two 
> files: *am33xx.dtsi* and *am335x-bone-common.dtsi*.
> I currently set *dtb=am335x-boneblack-emmc-overlay.dtb* inside uEnv.txt 
> and do not know what is the default DTB used when nothing is set there. I 
> guess it is *am335x-boneblack.dts*, but both include the above mentioned 
> DTSIs, so that should not matter.
>
> I'm guessing that removing the uart0 device inside the ocp (*am33xx.dtsi*) 
> and the phandle (*am335x-bone-common.dtsi*), then changing the mux 
> settings for the pins from this:
>
> uart0_pins: pinmux_uart0_pins {
> pinctrl-single,pins = <
> AM33XX_IOPAD(0x970, PIN_INPUT_PULLUP | MUX_MODE0) /* uart0_rxd.uart0_rxd 
> */
> AM33XX_IOPAD(0x974, PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* 
> uart0_txd.uart0_txd */
> >;
> };
>
> To something like this:
>
> uart0_pins: pinmux_uart0_pins {
> pinctrl-single,pins = <
> AM33XX_IOPAD(0x970, PIN_INPUT_PULLDOWN | MUX_MODE6) /* 
> uart0_rxd.uart0_rxd */
> AM33XX_IOPAD(0x974, PIN_INPUT_PULLDOWN | MUX_MODE6) /* 
> uart0_txd.uart0_txd */
> >;
> };
>
> ...would do the trick.
>
> I'm aware that there is a SN74LVC2G241 and a pulldown in the way, but they 
> seem harmless for what I'm trying to achieve.
>
> Now the questions:
>
>    1. Will that work?
>    
> Yes 

>
>    1. Besides losing that serial port, what other side effects I will 
>    have by doing that?
>
> u-boot (the bootloader) also uses UART0 to output messages before Linux is 
booted. You need to shift it to a different UART by recompiling the 
bootloader with CONFIG_CONS_INDEX set to whichever UART you want to use for 
serial console. Also need to update the update the kernel command line for 
which you will have to update the bootloader again.

>
>    1. Is that SN74LVC2G241 a problem?
>    
> If you see the schematics, 74LVC2G241 directs traffic one way on the 
RX pin and the other way on the TX pin. You will have to bypass the buffer 
if you want to use both the pins as inputs.

>
>    1. Is there a way to disable uart0 (the driver, device, etc), change 
>    the mux and use it on the PRU after booting to linux? The idea here is to 
>    retain as much functionality as possible and still get to use the pin as 
>    PRU input when needed.
>    
> Once you update the pinmux and the console kernel command line Linux won't 
use it, so you're free to use the pins however you like.

>
>    1. Any other alternatives?
>
> I solved the exact same problem that you have (wanting to use 16 PRU 
inputs). It's a hardware solution called BeagleLogic standalone 
<https://standalone.beaglelogic.net/> (also a blog post 
<http://theembeddedkitchen.net/announcing-beaglelogic-standalone/694> on 
the design of it) that implements a 16-channel logic analyzer using the 
PRUs on the AM335x SoC. The serial console (what UART0 did) is moved to 
UART4. Let me know if you're interested in a board.
 

> Bonus question: What is the default DTB and where is it set?
>

The default DTB depends on the board EEPROM. If you connect a USB-Serial 
cable to the 6-pin header (configuration 115200-8-N-1) and see the output, 
you will know which DTB was loaded.

Best Regards.
 

>
> Thanks for your time,
>

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/2449985e-3aef-4ba0-93b3-fcbe74751236%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to