Many times some GPIOs cannot be controlled by the kernel because they are multiplexed,​ and they are not acting as GPIOs. It might be possible to undo the multiplexing by writing some particular software programmable register settings, and then recover the GPIO functionality. But probably on most cases those GPIOs were multiplexed for some good reason, like using a [[doc/​hardware/​soc|SoC]] pin for a signal on an ethernet phy, SPI, PCI, UART or another purpose.

Many times some GPIOs cannot be controlled by the kernel because they are multiplexed,​ and they are not acting as GPIOs. It might be possible to undo the multiplexing by writing some particular software programmable register settings, and then recover the GPIO functionality. But probably on most cases those GPIOs were multiplexed for some good reason, like using a [[doc/​hardware/​soc|SoC]] pin for a signal on an ethernet phy, SPI, PCI, UART or another purpose.

-

* Example 1: on the Broadcom BCM6328 SoC, GPIO pins 25, 26, 27 and 28 are used to indicate the LAN activity with hardware controlled LEDs. The memory register for setting this multiplexing is at 0x1000009C address, 64bits wide. Let's read it in Openwrt\\ ''<​color grey>​root@OpenWrt:/#​ devmem 0x1000009C 64

+

* Example 1: on the Broadcom BCM6328 SoC, GPIO pins 25, 26, 27 and 28 are used to indicate the LAN activity with hardware controlled LEDs. The memory register for setting this multiplexing is at 0x1000009C address, 64bits wide. Let's read it in OpenWrt\\ ''<​color grey>​root@OpenWrt:/#​ devmem 0x1000009C 64

0x0154000000000000</​color>''​\\ {{:​media:​doc:​hardware:​bcm6328-lan-led_pinmux-bits.png?​nolink|}}\\ These enabled bits are enabling every LAN LED to be controlled by hardware, therefore they cannot be controlled as regular GPIO'​s\\ ​ Let's disable this multiplexing for all LEDs\\ ''<​color grey>​root@OpenWrt:/#​ devmem 0x1000009C 64 0x0</​color>''​\\ Now we can export these GPIOs and control them via software.

0x0154000000000000</​color>''​\\ {{:​media:​doc:​hardware:​bcm6328-lan-led_pinmux-bits.png?​nolink|}}\\ These enabled bits are enabling every LAN LED to be controlled by hardware, therefore they cannot be controlled as regular GPIO'​s\\ ​ Let's disable this multiplexing for all LEDs\\ ''<​color grey>​root@OpenWrt:/#​ devmem 0x1000009C 64 0x0</​color>''​\\ Now we can export these GPIOs and control them via software.