Quantcast
Channel: Forum - Recent Threads
Viewing all articles
Browse latest Browse all 1583

RZA1 RSK GPIO Issue with SysFs

$
0
0

On the RZA1 RSK dev kit, we removed the ethernet chip and we were able to use the ETH_IRQ as IRQ6 by pinmuxing pin P4_14 in the kernel board file, board-rskrza1.c:

r7s72100_pfc_pin_assign(P4_14, ALT8, DIIO_PBDC_DIS);

Additionally, without pinmuxing in the kernel, we were able to drive P7_1 ( GPIO 98 ) high and low using the Linux sysfs entry for gpio:

$ cd /sys/class/gpio/
$ echo 98 > export
$ echo out > P7_1/direction
$ echo 1 > P7_1/value
$ echo 0 > P7_1/value
$ echo 1 > P7_1/value

Now we want to use another Pin ( P2_0 ) as a GPIO. Page 1-20 in the hardware manual shows the General Purpose I/Os available on the RZA1H, and P2_0 is one of them.

$ echo 22 > export
$ ls
P2_0       P7_1       export     gpiochip0  unexport
$ echo out > P2_0/direction
$ echo 0 > P2_0/value
$ echo 1 > P2_0/value
$ echo 0 > P2_0/value

The problem is that the scope never shows a level change on this pin ( or several others in the GPIO range ).

We've also tried the various pfc_direction values from the enumeration below in the boardfile to pinmux these GPIO. How can we use P2_0 as a GPIO? What is different between P7_1 and P_20? Thank you.

In the Renesas Kernel, the file pfc-rza1.c contains the function used for pinmuxing:
/*
* @pinnum: a pin number.
* @mode:   port mode or alternative N mode.
* @dir:    Kind of I/O mode and data direction and PBDC and Output Level.
*          PIPC enable SoC IP to control a direction.
*/
int r7s72100_pfc_pin_assign(enum pfc_pin_number pinnum, enum pfc_mode mode,
                                             enum pfc_direction dir)
In the Renesas Kernel, the file r7s72100.h contains the following enumerations that are used when pinmuxing:
enum pfc_mode {
               PMODE = 0,
               ALT1, ALT2, ALT3, ALT4, ALT5, ALT6, ALT7, ALT8,
               PINMUX_STATE_NUM,
};
 
enum pfc_direction {
               DIIO_PBDC_DIS = 0,         /* Direct I/O Mode & PBDC Disable */
               DIIO_PBDC_EN,                /* Direct I/O Mode & PBDC Enable */
               SWIO_OUT_PBDCDIS,     /* Software I/O Mode & Output direction PBDC Disable */
               SWIO_OUT_PBDCEN,      /* Software I/O Mode & Output direction PBDC Enable */
               PORT_OUT_HIGH,                           /* Port Mode & Output direction & High Level Output Pn = 1 */
               PORT_OUT_LOW,                           /* Port Mode & Output direction & Low Level Output Pn = 0 */
               DIR_OUT,
               DIR_IN,                               /* Port Mode or Software I/O Mode is Direction IN */
               DIR_LVDS,
};


Viewing all articles
Browse latest Browse all 1583

Trending Articles