Siflower IOMUX Table
目录
1. 介绍
Siflower的芯片提供一些PAD脚,这些PAD脚可以配置为不同的功能,本文提供了Siflower sf19a2890 fullmaks芯片的IOMUX Table
1.1. 适用人员
- 有查看Siflower IOMUX Table的需求的人员
1.2. 开发环境
- 可以正常编译通过的Siflower SDK环境 该环境的搭建请参考快速入门
2. SF19A2890 fullmask IOMUX Table
下面的表格就是Siflower的SF19A2890 fullmask的IOMUX表格, 在该表格中会说明Siflowr的每一个可以配置的PAD的支持配置成那些模式.
Index | Pin Name | Default Mode | GPIO_MODE | FUNC_MODE0 | FUNC_MODE1 | FUNC_MODE2 | FUNC_MODE3 |
---|---|---|---|---|---|---|---|
0 | JTAG_TDO | FUNC_MODE0 | GPIO0 | JTAG_TDO | UART1_TXD | ETH_LED0 | CATIP_SCLK |
1 | JTAG_TDI | FUNC_MODE0 | GPIO1 | JTAG_TDI | UART1_RXD | ETH_LED1 | CATIP_SS |
2 | JTAG_TMS | FUNC_MODE0 | GPIO2 | JTAG_TMS | UART1_CTS | ETH_LED2 | CATIP_MOSI |
3 | JTAG_TCK | FUNC_MODE0 | GPIO3 | JTAG_TCK | UART1_RTS | ETH_LED3 | PWM0 |
4 | JTAG_RST | FUNC_MODE0 | GPIO4 | JTAG_RST | NC | PWM5 | CATIP_MISO |
5 | SPI_TXD | FUNC_MODE0 | GPIO5 | SPI2_TXD | NC | NC | NC |
6 | SPI_RXD | FUNC_MODE0 | GPIO6 | SPI2_RXD | NC | NC | NC |
7 | SPI_CLK | FUNC_MODE0 | GPIO7 | SPI2_CLK | NC | NC | NC |
8 | SPI_CSN | FUNC_MODE0 | GPIO8 | SPI2_CSN | NC | NC | NC |
9 | UART_TX | FUNC_MODE0 | GPIO9 | UART0_TXD | NC | NC | NC |
10 | UART_RX | FUNC_MODE0 | GPIO10 | UART0_RXD | NC | NC | NC |
11 | I2C_DAT | FUNC_MODE0 | GPIO11 | UART0_CTS | UART2_RXD | I2C0_DAT | NC |
12 | I2C_CLK | FUNC_MODE0 | GPIO12 | UART0_RTS | UART2_TXD | I2C0_CLK | NC |
13 | RGMII_GTX_CLK | GPIO_MODE | GPIO13 | RGMII0_GTX_CLK / RMII_REF_CLK | NC | NC | |
14 | RGMII_TXCLK | GPIO_MODE | GPIO14 | RGMII0_TXCLK | NC | NC | NC |
15 | RGMII_TXD0 | GPIO_MODE | GPIO15 | RGMII0_TXD0 / RMII_TXD0 | NC | NC | NC |
16 | RGMII_TXD1 | GPIO_MODE | GPIO16 | RGMII0_TXD1 / RMII_TXD1 | NC | NC | NC |
17 | RGMII_TXD2 | GPIO_MODE | GPIO17 | RGMII0_TXD2 | NC | NC | NC |
18 | RGMII_TXD3 | GPIO_MODE | GPIO18 | RGMII0_TXD3 | NC | NC | NC |
19 | RGMII_TXCTL | GPIO_MODE | GPIO19 | RGMII0_TXCTL / RMII_TX_EN | NC | NC | NC |
20 | RGMII_RXCLK | GPIO_MODE | GPIO20 | RGMII0_RXCLK | NC | NC | NC |
21 | RGMII_RXD0 | GPIO_MODE | GPIO21 | RGMII0_RXD0 / RMII_RXD0 | NC | NC | NC |
22 | RGMII_RXD1 | GPIO_MODE | GPIO22 | RGMII0_RXD1 / RMII_RXD1 | NC | NC | NC |
23 | RGMII_RXD2 | GPIO_MODE | GPIO23 | RGMII0_RXD2 | NC | NC | NC |
24 | RGMII_RXD3 | GPIO_MODE | GPIO24 | RGMII0_RXD3 | NC | NC | NC |
25 | RGMII_RXCTL | GPIO_MODE | GPIO25 | RGMII0_RXCTL / RMII_CRS_DV | NC | NC | NC |
26 | RGMII_COL | GPIO_MODE | GPIO26 | RGMII0_COL | NC | NC | NC |
27 | RGMII_CRS | GPIO_MODE | GPIO27 | RGMII0_CRS | NC | NC | NC |
28 | RGMII_MDC | GPIO_MODE | GPIO28 | RGMII0_MDC / RMII_MDC | NC | NC | NC |
29 | RGMII_MDIO | GPIO_MODE | GPIO29 | RGMII0_MDIO / RMII_MDIO | NC | NC | NC |
30 | HB0_PA_EN | GPIO_MODE | GPIO30 | HB0_PA_EN | NC | NC | CATIP_DEBUG_IO0 |
31 | HB0_LNA_EN | GPIO_MODE | GPIO31 | HB0_LNA_EN | NC | NC | CATIP_DEBUG_IO1 |
32 | HB0_SW_CTRL0 | GPIO_MODE | GPIO32 | HB0_SW_CTRL0 | NC | NC | CATIP_DEBUG_IO2 |
33 | HB0_SW_CTRL1 | GPIO_MODE | GPIO33 | HB0_SW_CTRL1 | NC | NC | CATIP_DEBUG_IO3 |
34 | HB1_PA_EN | GPIO_MODE | GPIO34 | HB1_PA_EN | NC | NC | CATIP_DEBUG_IO4 |
35 | HB1_LNA_EN | GPIO_MODE | GPIO35 | HB1_LNA_EN | NC | NC | CATIP_DEBUG_IO5 |
36 | HB1_SW_CTRL0 | GPIO_MODE | GPIO36 | HB1_SW_CTRL0 | NC | NC | CATIP_DEBUG_IO6 |
37 | HB1_SW_CTRL1 | GPIO_MODE | GPIO37 | HB1_SW_CTRL1 | NC | NC | CATIP_DEBUG_IO7 |
38 | LB0_PA_EN | GPIO_MODE | GPIO38 | LB0_PA_EN | NC | NC | CATIP_DEBUG_IO8 |
39 | LB0_LNA_EN | GPIO_MODE | GPIO39 | LB0_LNA_EN | NC | NC | CATIP_DEBUG_IO9 |
40 | LB0_SW_CTRL0 | GPIO_MODE | GPIO40 | LB0_SW_CTRL0 | NC | NC | CATIP_DEBUG_IO10 |
41 | LB0_SW_CTRL1 | GPIO_MODE | GPIO41 | LB0_SW_CTRL1 | NC | NC | CATIP_DEBUG_IO11 |
42 | LB1_PA_EN | GPIO_MODE | GPIO42 | LB1_PA_EN | NC | NC | CATIP_DEBUG_IO12 |
43 | LB1_LNA_EN | GPIO_MODE | GPIO43 | LB1_LNA_EN | NC | NC | CATIP_DEBUG_IO13 |
44 | LB1_SW_CTRL0 | GPIO_MODE | GPIO44 | LB1_SW_CTRL0 | NC | NC | CATIP_DEBUG_IO14 |
45 | LB1_SW_CTRL1 | GPIO_MODE | GPIO45 | LB1_SW_CTRL1 | NC | NC | CATIP_DEBUG_IO15 |
46 | CLK_OUT | GPIO_MODE | GPIO46 | CLK_OUT | NC | NC | NC |
47 | EXT_CLK_IN | FUNC_MODE0 | GPIO47 | EXT_CLK_IN | NC | NC | NC |
48 | DRVVBUS0 | GPIO_MODE | GPIO48 | DRVVBUS0 | NC | NC | NC |
3. 如何在shell命令行获取PAD脚的状态
3.1. kernel选择DEBUG_FS配置
可以通过make kernel_menuconfig选择, 然后编译镜像. 如何编译烧录镜像参考快速入门
DEBUG_FS的位置如下:
Kernel hacking --->
Compile-time checks and compiler options --->
[*]Debug Filesystem
也可以通过直接修改修改target/linux/siflower/sf19a28-fullmask/config-3.18_$(board)文件,添加如下内容 CONFIG_DEBUG_FS=y
3.2. 命令
烧录选择了CONFIG_DEBUG_FS的镜像,在运行的时候就可以通过命令cat /sys/kernel/debug/pinctrl/pinctrl/pins
,在结合IOMUX Table即可知道每一个PAD所处的模式, 该命令的显示结果如下所示:
root@OpenWrt:/# cat /sys/kernel/debug/pinctrl/pinctrl/pins
registered pins: 51
pin 0 (gpio-0) function func0 in lo; irq 31 (none)
pin 1 (gpio-1) function func0 in lo; irq 32 (none)
pin 2 (gpio-2) function func0 in lo; irq 33 (none)
pin 3 (gpio-3) function func0 in lo; irq 34 (none)
pin 4 (gpio-4) function func0 in lo; irq 35 (none)
pin 5 (gpio-5) function func0 in lo; irq 36 (none)
pin 6 (gpio-6) function func0 in lo; irq 37 (none)
pin 7 (gpio-7) function func0 in lo; irq 38 (none)
pin 8 (gpio-8) function gpio_in in hi; irq 39 (none)
pin 9 (gpio-9) function func0 in lo; irq 40 (none)
pin 10 (gpio-10) function func0 in lo; irq 41 (none)
pin 11 (gpio-11) function gpio_out in hi; irq 42 (edge-both)
pin 12 (gpio-12) function func0 in lo; irq 43 (none)
pin 13 (gpio-13) function func0 in lo; irq 44 (none)
pin 14 (gpio-14) function func0 in lo; irq 45 (none)
pin 15 (gpio-15) function func0 in lo; irq 46 (none)
pin 16 (gpio-16) function func0 in lo; irq 47 (none)
pin 17 (gpio-17) function func0 in lo; irq 48 (none)
pin 18 (gpio-18) function func0 in lo; irq 49 (none)
pin 19 (gpio-19) function func0 in lo; irq 50 (none)
pin 20 (gpio-20) function func0 in lo; irq 51 (none)
pin 21 (gpio-21) function func0 in lo; irq 52 (none)
pin 22 (gpio-22) function func0 in lo; irq 53 (none)
pin 23 (gpio-23) function func0 in lo; irq 54 (none)
pin 24 (gpio-24) function func0 in lo; irq 55 (none)
pin 25 (gpio-25) function func0 in lo; irq 56 (none)
pin 26 (gpio-26) function func0 in lo; irq 57 (none)
pin 27 (gpio-27) function func0 in lo; irq 58 (none)
pin 28 (gpio-28) function func0 in lo; irq 59 (none)
pin 29 (gpio-29) function func0 in lo; irq 60 (none)
pin 30 (gpio-30) function func0 in lo; irq 61 (none)
pin 31 (gpio-31) function func0 in lo; irq 62 (none)
pin 32 (gpio-32) function func0 in lo; irq 63 (none)
pin 33 (gpio-33) function func0 in lo; irq 64 (none)
pin 34 (gpio-34) function func0 in lo; irq 65 (none)
pin 35 (gpio-35) function func0 in lo; irq 66 (none)
pin 36 (gpio-36) function func0 in lo; irq 67 (none)
pin 37 (gpio-37) function func0 in lo; irq 68 (none)
pin 38 (gpio-38) function func0 in lo; irq 69 (none)
pin 39 (gpio-39) function func0 in lo; irq 70 (none)
pin 40 (gpio-40) function func0 in lo; irq 71 (none)
pin 41 (gpio-41) function func0 in lo; irq 72 (none)
pin 42 (gpio-42) function func0 in lo; irq 73 (none)
pin 43 (gpio-43) function func0 in lo; irq 74 (none)
pin 44 (gpio-44) function func0 in lo; irq 75 (none)
pin 45 (gpio-45) function func0 in lo; irq 76 (none)
pin 46 (gpio-46) function func0 in lo; irq 77 (none)
pin 47 (gpio-47) function func0 in lo; irq 78 (none)
pin 48 (gpio-48) function gpio_out in lo; irq 79 (none)
pin 49 (gpio-49) function func0 in lo; irq 80 (none)
pin 50 (gpio-50) function func0 in lo; irq 81 (none)
root@OpenWrt:/#
其中pin 0 (gpio-0)
代表的就是index为0, 而且是gpio-0; function func0
代表的就是function的模式为func0; in lo
代表的就是该pin的状态(是高电平还是低电平);irq 42 (edge-both)
代表的是该pin注册的中断号是42, 且为edge-both触发方式(边沿触发).
中断的触发方式有:
Interrupt trigger mode | Description |
---|---|
none | 触发方式未知 |
edge-rising | 上升沿触发 |
edge-falling | 下降压触发 |
edge-both | 边沿触发 |
level-high | 高电平触发 |
level-low | 低电平触发 |
Function有如下
Function | Description |
---|---|
func0 | 对应IOMUX Tabel查看 |
func1 | 对应IOMUX Tabel查看 |
func2 | 对应IOMUX Tabel查看 |
func3 | 对应IOMUX Tabel查看 |
gpio_in | GPIO的Input模式 |
gpio_out | GPIO的Output模式 |
in Pin脚的电平状态有如下
status | Description |
---|---|
lo | 低电平 |
hi | 高电平 |
FAQ
本文主要是提供Siflower的IOMUX Table, 关于IOMUX的具体应用请参考Pinctrl 和 GPIO 使用手册
文档信息
- 本文作者:Phoenix
- 本文链接:https://siflower.github.io/2020/09/03/iomux_table/
- 版权声明:自由转载-非商用-非衍生-保持署名(创意共享3.0许可证)