Can't control GPIO pins after update to kernel 5.17.4 May 24, 2022 02:23AM |
Registered: 10 years ago Posts: 226 |
Re: Can't control GPIO pins after update to kernel 5.17.4 May 24, 2022 03:11PM |
Admin Registered: 13 years ago Posts: 18,821 |
Re: Can't control GPIO pins after update to kernel 5.17.4 May 24, 2022 03:31PM |
Registered: 10 years ago Posts: 226 |
Re: Can't control GPIO pins after update to kernel 5.17.4 May 24, 2022 04:29PM |
Admin Registered: 13 years ago Posts: 18,821 |
Quote
Package: gpiod (1.6.2-1)
Tools for interacting with Linux GPIO character device - binary
libgpiod encapsulates the ioctl calls and data structures behind a straightforward API. This new character device interface guarantees all allocated resources are freed after closing the device file descriptor and adds several new features that are not present in the obsolete sysfs interface (like event polling, setting/reading multiple values at once or open-source and open-drain GPIOs).
This package contains the gpiod binary tools.
Re: Can't control GPIO pins after update to kernel 5.17.4 May 24, 2022 09:04PM |
Registered: 10 years ago Posts: 226 |
Re: Can't control GPIO pins after update to kernel 5.17.4 May 24, 2022 10:16PM |
Admin Registered: 13 years ago Posts: 18,821 |
Quote
I removed all references to the LEDs from the dtb and I am able to control them via gpioset and /sys/class in both kernels, but not TxD/RxD. Maybe it has something to do with GPIO10/11 being used by the UART, but I even tried removing all references to the UART from the DTB and that didn't seem to help.
Re: Can't control GPIO pins after update to kernel 5.17.4 May 24, 2022 11:37PM |
Registered: 10 years ago Posts: 226 |
Re: Can't control GPIO pins after update to kernel 5.17.4 May 25, 2022 02:54AM |
Registered: 10 years ago Posts: 226 |
Re: Can't control GPIO pins after update to kernel 5.17.4 May 26, 2022 07:35PM |
Registered: 10 years ago Posts: 226 |
Re: Can't control GPIO pins after update to kernel 5.17.4 May 27, 2022 11:58PM |
Registered: 9 years ago Posts: 451 |
Re: Can't control GPIO pins after update to kernel 5.17.4 May 28, 2022 01:27AM |
Admin Registered: 13 years ago Posts: 18,821 |
Re: Can't control GPIO pins after update to kernel 5.17.4 May 28, 2022 02:46AM |
Registered: 10 years ago Posts: 226 |
Re: Can't control GPIO pins after update to kernel 5.17.4 May 28, 2022 03:16PM |
Admin Registered: 13 years ago Posts: 18,821 |
Re: Can't control GPIO pins after update to kernel 5.17.4 May 28, 2022 03:52PM |
Registered: 10 years ago Posts: 226 |
Re: Can't control GPIO pins after update to kernel 5.17.4 June 01, 2022 11:41PM |
Registered: 10 years ago Posts: 226 |
Re: Can't control GPIO pins after update to kernel 5.17.4 June 03, 2022 01:53AM |
Registered: 9 years ago Posts: 451 |
Re: Can't control GPIO pins after update to kernel 5.17.4 June 03, 2022 05:43PM |
Registered: 10 years ago Posts: 226 |
Re: Can't control GPIO pins after update to kernel 5.17.4 June 04, 2022 02:37AM |
Registered: 10 years ago Posts: 226 |
Re: Can't control GPIO pins after update to kernel 5.17.4 June 04, 2022 08:50PM |
Registered: 9 years ago Posts: 451 |
Re: Can't control GPIO pins after update to kernel 5.17.4 June 05, 2022 03:54PM |
Registered: 10 years ago Posts: 226 |
int gpiochip_generic_request(struct gpio_chip *chip, unsigned offset) { #ifdef CONFIG_PINCTRL if (list_empty(&chip->gpiodev->pin_ranges)) return 0; #endif return pinctrl_gpio_request(chip->gpiodev->base + offset); }The old procedure was only the return statement. CONFIG_PINCTRL is absolutely necessary, so you can't just not set that in your .config file. Trying to follow the three structure references is beyond my patience. Just tracking them all down requires going through several header files. After going through the thousands of CONFIG options I don't think it has to do with the config. I'm leaning to something needing to be in the DTS possibly if you want to use GPIOs. A lot of the setup for the pin controller happens in the Kirkwood and/or MVEBU specific code, for example that pin ranges list that appears to be empty.
Re: Can't control GPIO pins after update to kernel 5.17.4 June 05, 2022 04:45PM |
Admin Registered: 13 years ago Posts: 18,821 |
Quote
I figured out why this only affects the first bank of GPIOs. The second bank (MPP32-49) is already configured to have every pin set as a GPIO. The pin ranges list for that bank is also empty, so this procedure accomplishes nothing for that bank either. I love how this routine doesn't return any error.
Quote
I'm leaning to something needing to be in the DTS possibly if you want to use GPIOs
Re: Can't control GPIO pins after update to kernel 5.17.4 June 05, 2022 06:35PM |
Registered: 10 years ago Posts: 226 |
Re: Can't control GPIO pins after update to kernel 5.17.4 June 05, 2022 06:38PM |
Admin Registered: 13 years ago Posts: 18,821 |
/* * Default UART pinctrl setting without RTS/CTS, * overwrite marvell,pins on board level if required. */ pmx_uart0: pmx-uart0 { marvell,pins = "mpp10", "mpp11"; marvell,function = "uart0"; }; pmx_uart1: pmx-uart1 { marvell,pins = "mpp13", "mpp14"; marvell,function = "uart1"; };
Re: Can't control GPIO pins after update to kernel 5.17.4 June 05, 2022 06:40PM |
Admin Registered: 13 years ago Posts: 18,821 |
Re: Can't control GPIO pins after update to kernel 5.17.4 June 05, 2022 07:20PM |
Admin Registered: 13 years ago Posts: 18,821 |
/* * Default UART pinctrl setting without RTS/CTS, * overwrite marvell,pins on board level if required. */ pmx_uart0: pmx-uart0 { marvell,pins = "mpp10", "mpp11"; marvell,function = "uart0"; }; pmx_uart1: pmx-uart1 { marvell,pins = "mpp13", "mpp14"; marvell,function = "uart1"; };Compile the DTS.
Re: Can't control GPIO pins after update to kernel 5.17.4 June 07, 2022 10:35PM |
Registered: 10 years ago Posts: 226 |
pmx-uart0 { marvell,pins = "mpp5\0mpp4"; marvell,function = "uart0"; phandle = <0x08>; }; pmx-uart1 { marvell,pins = "mpp13\0mpp14"; marvell,function = "uart1"; phandle = <0x09>; }; pmx-sata0 { marvell,pins = "mpp15\0mpp21\0mpp23"; marvell,function = "sata0"; }; pmx-sata1 { marvell,pins = "mpp16\0mpp20\0mpp22"; marvell,function = "sata1"; };It boots, but had no effect on mpp10/11 - they're still configured as UART pins and I don't think that's their default configuration. Using gpioset still doesn't change their configuration to a GPIO. Interestingly, it did have an effect on mpp4/5 which are also configured as UART pins (which the data sheet says you shouldn't do). MPP10/11 no longer appear in the DTS/DTB, so something is configuring them.