Welcome, Guest

Author Topic: Changing pinmux for rt5350f  (Read 3953 times)

mike_s

  • Newbie
  • *
  • Posts: 9
  • Karma: +0/-0
Changing pinmux for rt5350f
« on: July 06, 2015, 06:11:34 AM »
Hi all,

Im a bit green at configuring the system using device tree.  I'm attempting to use the pinmux to change the uartf pinmux to be i2s - uartf instead of the default setting which is uartf (with hardware handshake).  I see in arch/mips/ralink/rt305x.c that there is a setting for doing so but I'm not sure exactly how I set that up without modifying the driver itself which would break the dynamic aspect of the driver.  It seems like there might be some way to modify OLINUXINO-RT5350F.dts to include that setting.  I'm just not familiar enough with the relationship of the device tree with the driver.

Thanks

Daniel

  • Newbie
  • *
  • Posts: 10
  • Karma: +1/-0
Re: Changing pinmux for rt5350f
« Reply #1 on: July 06, 2015, 09:34:09 AM »
Hi Mike,

Change in "rt5350.dtsi"

uartf_pins: uartf {
         uartf {
            ralink,group = "uartf";
            ralink,function = "uartf";
         };
to:   

uartf_pins: uartf {
      uartf {
         ralink,group = "uartf";
         ralink,function = "i2s uartf";
      };

Remove the "status = "disabled";" in:

uart@500 {
         compatible = "ralink,rt5350-uart", "ralink,rt2880-uart", "ns16550a";
         reg = <0x500 0x100>;

         resets = <&rstctrl 12>;
         reset-names = "uart";

         interrupt-parent = <&intc>;
         interrupts = <5>;

         reg-shift = <2>;

         pinctrl-names = "default";
         pinctrl-0 = <&uartf_pins>;

         status = "disabled";
      };

and move "uart@500" after "uartlite@c00" to make it /dev/ttyS1 and not /dev/ttyS0 to still get the UART debug on UARTLITE.

Tell me if it works.  :)

mike_s

  • Newbie
  • *
  • Posts: 9
  • Karma: +0/-0
Re: Changing pinmux for rt5350f
« Reply #2 on: July 07, 2015, 08:01:29 AM »
I cant verify the i2s change but i will say that i didnt need to rearrange the blocks.  Uart still works correctly without changing the order.

Thanks for your help.

t35tB0t

  • Newbie
  • *
  • Posts: 10
  • Karma: +0/-0
Re: Changing pinmux for rt5350f
« Reply #3 on: September 18, 2015, 08:09:59 AM »
I highly recommend you follow the advice on the serial port sequencing in the DTSI file. The assignment of ttyNNN numbers will follow the order they are processed.  Also, for your reference, the valid RALINK pin group names are as shown below.  Hopefully this makes pin-remapping more fun (I just wish it could be done nicely at run-time from user-land, the hardware certainly supports that...).

+Definition of mux function groups:
+
+Required subnode-properties:
+- ralink,group : An array of strings. Each string contains the name of a group.
+  Valid values for these names are listed below.
+- ralink,function: A string containing the name of the function to mux to the
+  group. Valid values for function names are listed below.
+
+   mux groups (rt5350):
+    i2c, spi, uartf, uartlite, jtag, pna, led, spi cs1
+
+   mux functions (rt5350):
+    gpio, i2c, spi, uartf, pcm uartf, pcm i2s, i2s uartf, pcm gpio, gpio uartf,
+    gpio i2s, uartlite, jtag, spi_cs1, wdg