[PATCH v2 00/10] rockchip: pinctrl: Add support for pinmux status cmd

Kever Yang kever.yang at rock-chips.com
Mon Aug 12 08:30:32 CEST 2024


Hi Jonas,

On 2024/8/3 06:56, Jonas Karlman wrote:
> This series includes some cleanup, add support for using the pinmux
> status cmd and add support for the gpio request ops.
>
> Following is an example on a Radxa ROCK 5A (RK3588S):
>
>    => pinmux dev pinctrl
>    dev: pinctrl
>    => pinmux status
>    GPIO0_A0  : gpio
>    GPIO0_A1  : func-2
>    GPIO0_A2  : gpio
>    GPIO0_A3  : gpio
>    GPIO0_A4  : func-1
>    GPIO0_A5  : func-2
>    GPIO0_A6  : gpio
>    GPIO0_A7  : gpio
>    GPIO0_B0  : gpio
>    GPIO0_B1  : gpio
>    GPIO0_B2  : gpio
>    GPIO0_B3  : gpio
>    GPIO0_B4  : gpio
>    GPIO0_B5  : func-10
>    GPIO0_B6  : func-10
>    GPIO0_B7  : gpio
>    [...]
>
> and on a ASUS TinkerBoard R2.0 (RK3288W):
>
>    => pinmux dev pinctrl
>    dev: pinctrl
>    => pinmux status
>    [...]
>    GPIO2_C6  : gpio
>    GPIO2_C7  : gpio
>    GPIO2_D0  : unrouted
>    GPIO2_D1  : unrouted
>    GPIO2_D2  : unrouted
>    GPIO2_D3  : unrouted
>    GPIO2_D4  : unrouted
>    GPIO2_D5  : unrouted
>    GPIO2_D6  : unrouted
>    GPIO2_D7  : unrouted
>    GPIO3_A0  : func-2
>    GPIO3_A1  : func-2
>    [...]
>
> Patch 1 refactor to use syscon_regmap_lookup_by_phandle() helper.
> Patch 6 refactor to get pinctrl device from gpio-ranges prop.
>
> Patch 2, 3 and 7 change to use pinctrl pin offset instead of bank num to
> get current pinmux.
> Patch 4 add required ops for use of the pinmux status cmd.
>
> Patch 5 and 8 add gpio_request_enable() and request() ops.
>
> Patch 9 add gpio-ranges props for remaining RK SoCs, this is strictly
> not needed for pinmux status cmd to function. However, the change to not
> require the pin controller offset to be 32 aligned was required to add
> gpio-ranges props for RK3288.
>
> Patch 10 add gpio aliases for RK SoCs that is missing alias for gpio
> controllers.
>
> Changes in v2:
> - Drop fixes patches already applied
> - Split adding pin_to_bank() helper into own patch
> - Add gpio_request_enable() and request() ops patch from the "rockchip:
>    Add gpio request() ops" series
> - Add missing gpio aliases
> - Collect r-b tags
>
> Jonas Karlman (10):
>    pinctrl: rockchip: Use syscon_regmap_lookup_by_phandle()
>    pinctrl: rockchip: Add a pin_to_bank() helper
>    pinctrl: rockchip: Update get_gpio_mux() ops
>    pinctrl: rockchip: Add pinmux status related ops
>    pinctrl: rockchip: Add gpio_request_enable() ops
>    gpio: rockchip: Get pinctrl device from gpio-ranges prop
>    gpio: rockchip: Use pinctrl pin offset to get_gpio_mux()
>    gpio: rockchip: Add request() ops
>    rockchip: gpio: Add gpio-ranges props
>    rockchip: gpio: Add missing gpio aliases
>
>   arch/arm/dts/px30-u-boot.dtsi                 |   4 +
>   arch/arm/dts/rk3036-u-boot.dtsi               |  12 ++
>   arch/arm/dts/rk3066a-u-boot.dtsi              |  10 +-
>   arch/arm/dts/rk3128-u-boot.dtsi               |  16 ++
>   arch/arm/dts/rk322x-u-boot.dtsi               |  16 ++
>   arch/arm/dts/rk3288-u-boot.dtsi               |  42 ++++--

This series extend the pinctrl driver size and cause a board 
"miqi-rk3288" build fail:

binman: Error 1 running 'mkimage -d 
./mkimage-in-simple-bin.mkimage-u-boot-spl -n rk3288 -T rksd 
./idbloader.img': Error: SPL image is too large (size 0x8800 than 0x8000)

We use to met this kind of issue very frequently, and add 
"CONFIG_SPL_BUILD" to limit the SPL size in driver, we may need to do 
this again for this feature.


Thanks,

- Kever

>   arch/arm/dts/rk3308-u-boot.dtsi               |  20 +++
>   arch/arm/dts/rk3328-u-boot.dtsi               |  13 ++
>   arch/arm/dts/rk3368-u-boot.dtsi               |  16 ++
>   arch/arm/dts/rk3399-u-boot.dtsi               |  20 +++
>   arch/arm/dts/rk3xxx-u-boot.dtsi               |   7 +
>   arch/arm/dts/rv1108-u-boot.dtsi               |  25 +++
>   arch/arm/dts/rv1126-u-boot.dtsi               |  22 +++
>   drivers/gpio/rk_gpio.c                        |  54 +++++--
>   .../pinctrl/rockchip/pinctrl-rockchip-core.c  | 142 ++++++++++++++----
>   15 files changed, 364 insertions(+), 55 deletions(-)
>


More information about the U-Boot mailing list