Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

pinctrl/rockchip: add rk3588 support

Add pinctrl support for RK3588.

[merged in downstream fixes, simplified register lookup logic for better
maintanence at the cost of a bit more static const memory and fixed some
incorrect registers]

Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Link: https://lore.kernel.org/r/20220422170920.401914-14-sebastian.reichel@collabora.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

authored by

Jianqun Xu and committed by
Linus Walleij
fdc33eba 42573ab3

+465 -1
+299 -1
drivers/pinctrl/pinctrl-rockchip.c
··· 103 103 }, \ 104 104 } 105 105 106 + #define PIN_BANK_IOMUX_FLAGS_PULL_FLAGS(id, pins, label, iom0, iom1, \ 107 + iom2, iom3, pull0, pull1, \ 108 + pull2, pull3) \ 109 + { \ 110 + .bank_num = id, \ 111 + .nr_pins = pins, \ 112 + .name = label, \ 113 + .iomux = { \ 114 + { .type = iom0, .offset = -1 }, \ 115 + { .type = iom1, .offset = -1 }, \ 116 + { .type = iom2, .offset = -1 }, \ 117 + { .type = iom3, .offset = -1 }, \ 118 + }, \ 119 + .pull_type[0] = pull0, \ 120 + .pull_type[1] = pull1, \ 121 + .pull_type[2] = pull2, \ 122 + .pull_type[3] = pull3, \ 123 + } 124 + 106 125 #define PIN_BANK_DRV_FLAGS_PULL_FLAGS(id, pins, label, drv0, drv1, \ 107 126 drv2, drv3, pull0, pull1, \ 108 127 pull2, pull3) \ ··· 215 196 216 197 #define RK_MUXROUTE_PMU(ID, PIN, FUNC, REG, VAL) \ 217 198 PIN_BANK_MUX_ROUTE_FLAGS(ID, PIN, FUNC, REG, VAL, ROCKCHIP_ROUTE_PMU) 199 + 200 + #define RK3588_PIN_BANK_FLAGS(ID, PIN, LABEL, M, P) \ 201 + PIN_BANK_IOMUX_FLAGS_PULL_FLAGS(ID, PIN, LABEL, M, M, M, M, P, P, P, P) 218 202 219 203 static struct regmap_config rockchip_regmap_config = { 220 204 .reg_bits = 32, ··· 844 822 static int rockchip_get_mux(struct rockchip_pin_bank *bank, int pin) 845 823 { 846 824 struct rockchip_pinctrl *info = bank->drvdata; 825 + struct rockchip_pin_ctrl *ctrl = info->ctrl; 847 826 int iomux_num = (pin / 8); 848 827 struct regmap *regmap; 849 828 unsigned int val; ··· 885 862 886 863 if (bank->recalced_mask & BIT(pin)) 887 864 rockchip_get_recalced_mux(bank, pin, &reg, &bit, &mask); 865 + 866 + if (ctrl->type == RK3588) { 867 + if (bank->bank_num == 0) { 868 + if ((pin >= RK_PB4) && (pin <= RK_PD7)) { 869 + u32 reg0 = 0; 870 + 871 + reg0 = reg + 0x4000 - 0xC; /* PMU2_IOC_BASE */ 872 + ret = regmap_read(regmap, reg0, &val); 873 + if (ret) 874 + return ret; 875 + 876 + if (!(val & BIT(8))) 877 + return ((val >> bit) & mask); 878 + 879 + reg = reg + 0x8000; /* BUS_IOC_BASE */ 880 + regmap = info->regmap_base; 881 + } 882 + } else if (bank->bank_num > 0) { 883 + reg += 0x8000; /* BUS_IOC_BASE */ 884 + } 885 + } 888 886 889 887 ret = regmap_read(regmap, reg, &val); 890 888 if (ret) ··· 955 911 static int rockchip_set_mux(struct rockchip_pin_bank *bank, int pin, int mux) 956 912 { 957 913 struct rockchip_pinctrl *info = bank->drvdata; 914 + struct rockchip_pin_ctrl *ctrl = info->ctrl; 958 915 struct device *dev = info->dev; 959 916 int iomux_num = (pin / 8); 960 917 struct regmap *regmap; ··· 995 950 996 951 if (bank->recalced_mask & BIT(pin)) 997 952 rockchip_get_recalced_mux(bank, pin, &reg, &bit, &mask); 953 + 954 + if (ctrl->type == RK3588) { 955 + if (bank->bank_num == 0) { 956 + if ((pin >= RK_PB4) && (pin <= RK_PD7)) { 957 + if (mux < 8) { 958 + reg += 0x4000 - 0xC; /* PMU2_IOC_BASE */ 959 + data = (mask << (bit + 16)); 960 + rmask = data | (data >> 16); 961 + data |= (mux & mask) << bit; 962 + ret = regmap_update_bits(regmap, reg, rmask, data); 963 + } else { 964 + u32 reg0 = 0; 965 + 966 + reg0 = reg + 0x4000 - 0xC; /* PMU2_IOC_BASE */ 967 + data = (mask << (bit + 16)); 968 + rmask = data | (data >> 16); 969 + data |= 8 << bit; 970 + ret = regmap_update_bits(regmap, reg0, rmask, data); 971 + 972 + reg0 = reg + 0x8000; /* BUS_IOC_BASE */ 973 + data = (mask << (bit + 16)); 974 + rmask = data | (data >> 16); 975 + data |= mux << bit; 976 + regmap = info->regmap_base; 977 + ret |= regmap_update_bits(regmap, reg0, rmask, data); 978 + } 979 + } else { 980 + data = (mask << (bit + 16)); 981 + rmask = data | (data >> 16); 982 + data |= (mux & mask) << bit; 983 + ret = regmap_update_bits(regmap, reg, rmask, data); 984 + } 985 + return ret; 986 + } else if (bank->bank_num > 0) { 987 + reg += 0x8000; /* BUS_IOC_BASE */ 988 + } 989 + } 990 + 991 + if (mux > mask) 992 + return -EINVAL; 998 993 999 994 if (bank->route_mask & BIT(pin)) { 1000 995 if (rockchip_get_mux_route(bank, pin, mux, &route_location, ··· 1687 1602 return 0; 1688 1603 } 1689 1604 1605 + #define RK3588_PMU1_IOC_REG (0x0000) 1606 + #define RK3588_PMU2_IOC_REG (0x4000) 1607 + #define RK3588_BUS_IOC_REG (0x8000) 1608 + #define RK3588_VCCIO1_4_IOC_REG (0x9000) 1609 + #define RK3588_VCCIO3_5_IOC_REG (0xA000) 1610 + #define RK3588_VCCIO2_IOC_REG (0xB000) 1611 + #define RK3588_VCCIO6_IOC_REG (0xC000) 1612 + #define RK3588_EMMC_IOC_REG (0xD000) 1613 + 1614 + static const u32 rk3588_ds_regs[][2] = { 1615 + {RK_GPIO0_A0, RK3588_PMU1_IOC_REG + 0x0010}, 1616 + {RK_GPIO0_A4, RK3588_PMU1_IOC_REG + 0x0014}, 1617 + {RK_GPIO0_B0, RK3588_PMU1_IOC_REG + 0x0018}, 1618 + {RK_GPIO0_B4, RK3588_PMU2_IOC_REG + 0x0014}, 1619 + {RK_GPIO0_C0, RK3588_PMU2_IOC_REG + 0x0018}, 1620 + {RK_GPIO0_C4, RK3588_PMU2_IOC_REG + 0x001C}, 1621 + {RK_GPIO0_D0, RK3588_PMU2_IOC_REG + 0x0020}, 1622 + {RK_GPIO0_D4, RK3588_PMU2_IOC_REG + 0x0024}, 1623 + {RK_GPIO1_A0, RK3588_VCCIO1_4_IOC_REG + 0x0020}, 1624 + {RK_GPIO1_A4, RK3588_VCCIO1_4_IOC_REG + 0x0024}, 1625 + {RK_GPIO1_B0, RK3588_VCCIO1_4_IOC_REG + 0x0028}, 1626 + {RK_GPIO1_B4, RK3588_VCCIO1_4_IOC_REG + 0x002C}, 1627 + {RK_GPIO1_C0, RK3588_VCCIO1_4_IOC_REG + 0x0030}, 1628 + {RK_GPIO1_C4, RK3588_VCCIO1_4_IOC_REG + 0x0034}, 1629 + {RK_GPIO1_D0, RK3588_VCCIO1_4_IOC_REG + 0x0038}, 1630 + {RK_GPIO1_D4, RK3588_VCCIO1_4_IOC_REG + 0x003C}, 1631 + {RK_GPIO2_A0, RK3588_EMMC_IOC_REG + 0x0040}, 1632 + {RK_GPIO2_A4, RK3588_VCCIO3_5_IOC_REG + 0x0044}, 1633 + {RK_GPIO2_B0, RK3588_VCCIO3_5_IOC_REG + 0x0048}, 1634 + {RK_GPIO2_B4, RK3588_VCCIO3_5_IOC_REG + 0x004C}, 1635 + {RK_GPIO2_C0, RK3588_VCCIO3_5_IOC_REG + 0x0050}, 1636 + {RK_GPIO2_C4, RK3588_VCCIO3_5_IOC_REG + 0x0054}, 1637 + {RK_GPIO2_D0, RK3588_EMMC_IOC_REG + 0x0058}, 1638 + {RK_GPIO2_D4, RK3588_EMMC_IOC_REG + 0x005C}, 1639 + {RK_GPIO3_A0, RK3588_VCCIO3_5_IOC_REG + 0x0060}, 1640 + {RK_GPIO3_A4, RK3588_VCCIO3_5_IOC_REG + 0x0064}, 1641 + {RK_GPIO3_B0, RK3588_VCCIO3_5_IOC_REG + 0x0068}, 1642 + {RK_GPIO3_B4, RK3588_VCCIO3_5_IOC_REG + 0x006C}, 1643 + {RK_GPIO3_C0, RK3588_VCCIO3_5_IOC_REG + 0x0070}, 1644 + {RK_GPIO3_C4, RK3588_VCCIO3_5_IOC_REG + 0x0074}, 1645 + {RK_GPIO3_D0, RK3588_VCCIO3_5_IOC_REG + 0x0078}, 1646 + {RK_GPIO3_D4, RK3588_VCCIO3_5_IOC_REG + 0x007C}, 1647 + {RK_GPIO4_A0, RK3588_VCCIO6_IOC_REG + 0x0080}, 1648 + {RK_GPIO4_A4, RK3588_VCCIO6_IOC_REG + 0x0084}, 1649 + {RK_GPIO4_B0, RK3588_VCCIO6_IOC_REG + 0x0088}, 1650 + {RK_GPIO4_B4, RK3588_VCCIO6_IOC_REG + 0x008C}, 1651 + {RK_GPIO4_C0, RK3588_VCCIO6_IOC_REG + 0x0090}, 1652 + {RK_GPIO4_C2, RK3588_VCCIO3_5_IOC_REG + 0x0090}, 1653 + {RK_GPIO4_C4, RK3588_VCCIO3_5_IOC_REG + 0x0094}, 1654 + {RK_GPIO4_D0, RK3588_VCCIO2_IOC_REG + 0x0098}, 1655 + {RK_GPIO4_D4, RK3588_VCCIO2_IOC_REG + 0x009C}, 1656 + }; 1657 + 1658 + static const u32 rk3588_p_regs[][2] = { 1659 + {RK_GPIO0_A0, RK3588_PMU1_IOC_REG + 0x0020}, 1660 + {RK_GPIO0_B0, RK3588_PMU1_IOC_REG + 0x0024}, 1661 + {RK_GPIO0_B5, RK3588_PMU2_IOC_REG + 0x0028}, 1662 + {RK_GPIO0_C0, RK3588_PMU2_IOC_REG + 0x002C}, 1663 + {RK_GPIO0_D0, RK3588_PMU2_IOC_REG + 0x0030}, 1664 + {RK_GPIO1_A0, RK3588_VCCIO1_4_IOC_REG + 0x0110}, 1665 + {RK_GPIO1_B0, RK3588_VCCIO1_4_IOC_REG + 0x0114}, 1666 + {RK_GPIO1_C0, RK3588_VCCIO1_4_IOC_REG + 0x0118}, 1667 + {RK_GPIO1_D0, RK3588_VCCIO1_4_IOC_REG + 0x011C}, 1668 + {RK_GPIO2_A0, RK3588_EMMC_IOC_REG + 0x0120}, 1669 + {RK_GPIO2_A6, RK3588_VCCIO3_5_IOC_REG + 0x0120}, 1670 + {RK_GPIO2_B0, RK3588_VCCIO3_5_IOC_REG + 0x0124}, 1671 + {RK_GPIO2_C0, RK3588_VCCIO3_5_IOC_REG + 0x0128}, 1672 + {RK_GPIO2_D0, RK3588_EMMC_IOC_REG + 0x012C}, 1673 + {RK_GPIO3_A0, RK3588_VCCIO3_5_IOC_REG + 0x0130}, 1674 + {RK_GPIO3_B0, RK3588_VCCIO3_5_IOC_REG + 0x0134}, 1675 + {RK_GPIO3_C0, RK3588_VCCIO3_5_IOC_REG + 0x0138}, 1676 + {RK_GPIO3_D0, RK3588_VCCIO3_5_IOC_REG + 0x013C}, 1677 + {RK_GPIO4_A0, RK3588_VCCIO6_IOC_REG + 0x0140}, 1678 + {RK_GPIO4_B0, RK3588_VCCIO6_IOC_REG + 0x0144}, 1679 + {RK_GPIO4_C0, RK3588_VCCIO6_IOC_REG + 0x0148}, 1680 + {RK_GPIO4_C2, RK3588_VCCIO3_5_IOC_REG + 0x0148}, 1681 + {RK_GPIO4_D0, RK3588_VCCIO2_IOC_REG + 0x014C}, 1682 + }; 1683 + 1684 + static const u32 rk3588_smt_regs[][2] = { 1685 + {RK_GPIO0_A0, RK3588_PMU1_IOC_REG + 0x0030}, 1686 + {RK_GPIO0_B0, RK3588_PMU1_IOC_REG + 0x0034}, 1687 + {RK_GPIO0_B5, RK3588_PMU2_IOC_REG + 0x0040}, 1688 + {RK_GPIO0_C0, RK3588_PMU2_IOC_REG + 0x0044}, 1689 + {RK_GPIO0_D0, RK3588_PMU2_IOC_REG + 0x0048}, 1690 + {RK_GPIO1_A0, RK3588_VCCIO1_4_IOC_REG + 0x0210}, 1691 + {RK_GPIO1_B0, RK3588_VCCIO1_4_IOC_REG + 0x0214}, 1692 + {RK_GPIO1_C0, RK3588_VCCIO1_4_IOC_REG + 0x0218}, 1693 + {RK_GPIO1_D0, RK3588_VCCIO1_4_IOC_REG + 0x021C}, 1694 + {RK_GPIO2_A0, RK3588_EMMC_IOC_REG + 0x0220}, 1695 + {RK_GPIO2_A6, RK3588_VCCIO3_5_IOC_REG + 0x0220}, 1696 + {RK_GPIO2_B0, RK3588_VCCIO3_5_IOC_REG + 0x0224}, 1697 + {RK_GPIO2_C0, RK3588_VCCIO3_5_IOC_REG + 0x0228}, 1698 + {RK_GPIO2_D0, RK3588_EMMC_IOC_REG + 0x022C}, 1699 + {RK_GPIO3_A0, RK3588_VCCIO3_5_IOC_REG + 0x0230}, 1700 + {RK_GPIO3_B0, RK3588_VCCIO3_5_IOC_REG + 0x0234}, 1701 + {RK_GPIO3_C0, RK3588_VCCIO3_5_IOC_REG + 0x0238}, 1702 + {RK_GPIO3_D0, RK3588_VCCIO3_5_IOC_REG + 0x023C}, 1703 + {RK_GPIO4_A0, RK3588_VCCIO6_IOC_REG + 0x0240}, 1704 + {RK_GPIO4_B0, RK3588_VCCIO6_IOC_REG + 0x0244}, 1705 + {RK_GPIO4_C0, RK3588_VCCIO6_IOC_REG + 0x0248}, 1706 + {RK_GPIO4_C2, RK3588_VCCIO3_5_IOC_REG + 0x0248}, 1707 + {RK_GPIO4_D0, RK3588_VCCIO2_IOC_REG + 0x024C}, 1708 + }; 1709 + 1710 + #define RK3588_PULL_BITS_PER_PIN 2 1711 + #define RK3588_PULL_PINS_PER_REG 8 1712 + 1713 + static int rk3588_calc_pull_reg_and_bit(struct rockchip_pin_bank *bank, 1714 + int pin_num, struct regmap **regmap, 1715 + int *reg, u8 *bit) 1716 + { 1717 + struct rockchip_pinctrl *info = bank->drvdata; 1718 + u8 bank_num = bank->bank_num; 1719 + u32 pin = bank_num * 32 + pin_num; 1720 + int i; 1721 + 1722 + for (i = ARRAY_SIZE(rk3588_p_regs) - 1; i >= 0; i--) { 1723 + if (pin >= rk3588_p_regs[i][0]) { 1724 + *reg = rk3588_p_regs[i][1]; 1725 + *regmap = info->regmap_base; 1726 + *bit = pin_num % RK3588_PULL_PINS_PER_REG; 1727 + *bit *= RK3588_PULL_BITS_PER_PIN; 1728 + return 0; 1729 + } 1730 + } 1731 + 1732 + return -EINVAL; 1733 + } 1734 + 1735 + #define RK3588_DRV_BITS_PER_PIN 4 1736 + #define RK3588_DRV_PINS_PER_REG 4 1737 + 1738 + static int rk3588_calc_drv_reg_and_bit(struct rockchip_pin_bank *bank, 1739 + int pin_num, struct regmap **regmap, 1740 + int *reg, u8 *bit) 1741 + { 1742 + struct rockchip_pinctrl *info = bank->drvdata; 1743 + u8 bank_num = bank->bank_num; 1744 + u32 pin = bank_num * 32 + pin_num; 1745 + int i; 1746 + 1747 + for (i = ARRAY_SIZE(rk3588_ds_regs) - 1; i >= 0; i--) { 1748 + if (pin >= rk3588_ds_regs[i][0]) { 1749 + *reg = rk3588_ds_regs[i][1]; 1750 + *regmap = info->regmap_base; 1751 + *bit = pin_num % RK3588_DRV_PINS_PER_REG; 1752 + *bit *= RK3588_DRV_BITS_PER_PIN; 1753 + return 0; 1754 + } 1755 + } 1756 + 1757 + return -EINVAL; 1758 + } 1759 + 1760 + #define RK3588_SMT_BITS_PER_PIN 1 1761 + #define RK3588_SMT_PINS_PER_REG 8 1762 + 1763 + static int rk3588_calc_schmitt_reg_and_bit(struct rockchip_pin_bank *bank, 1764 + int pin_num, 1765 + struct regmap **regmap, 1766 + int *reg, u8 *bit) 1767 + { 1768 + struct rockchip_pinctrl *info = bank->drvdata; 1769 + u8 bank_num = bank->bank_num; 1770 + u32 pin = bank_num * 32 + pin_num; 1771 + int i; 1772 + 1773 + for (i = ARRAY_SIZE(rk3588_smt_regs) - 1; i >= 0; i--) { 1774 + if (pin >= rk3588_smt_regs[i][0]) { 1775 + *reg = rk3588_smt_regs[i][1]; 1776 + *regmap = info->regmap_base; 1777 + *bit = pin_num % RK3588_SMT_PINS_PER_REG; 1778 + *bit *= RK3588_SMT_BITS_PER_PIN; 1779 + return 0; 1780 + } 1781 + } 1782 + 1783 + return -EINVAL; 1784 + } 1785 + 1690 1786 static int rockchip_perpin_drv_list[DRV_TYPE_MAX][8] = { 1691 1787 { 2, 4, 8, 12, -1, -1, -1, -1 }, 1692 1788 { 3, 6, 9, 12, -1, -1, -1, -1 }, ··· 1973 1707 ret = ctrl->drv_calc_reg(bank, pin_num, &regmap, &reg, &bit); 1974 1708 if (ret) 1975 1709 return ret; 1976 - if (ctrl->type == RK3568) { 1710 + if (ctrl->type == RK3588) { 1711 + rmask_bits = RK3588_DRV_BITS_PER_PIN; 1712 + ret = strength; 1713 + goto config; 1714 + } else if (ctrl->type == RK3568) { 1977 1715 rmask_bits = RK3568_DRV_BITS_PER_PIN; 1978 1716 ret = (1 << (strength + 1)) - 1; 1979 1717 goto config; ··· 2110 1840 case RK3308: 2111 1841 case RK3368: 2112 1842 case RK3399: 1843 + case RK3588: 2113 1844 pull_type = bank->pull_type[pin_num / 8]; 2114 1845 data >>= bit; 2115 1846 data &= (1 << RK3188_PULL_BITS_PER_PIN) - 1; ··· 2159 1888 case RK3368: 2160 1889 case RK3399: 2161 1890 case RK3568: 1891 + case RK3588: 2162 1892 pull_type = bank->pull_type[pin_num / 8]; 2163 1893 ret = -EINVAL; 2164 1894 for (i = 0; i < ARRAY_SIZE(rockchip_pull_list[pull_type]); ··· 2407 2135 case RK3368: 2408 2136 case RK3399: 2409 2137 case RK3568: 2138 + case RK3588: 2410 2139 return (pull != PIN_CONFIG_BIAS_PULL_PIN_DEFAULT); 2411 2140 } 2412 2141 ··· 3525 3252 .schmitt_calc_reg = rk3568_calc_schmitt_reg_and_bit, 3526 3253 }; 3527 3254 3255 + static struct rockchip_pin_bank rk3588_pin_banks[] = { 3256 + RK3588_PIN_BANK_FLAGS(0, 32, "gpio0", 3257 + IOMUX_WIDTH_4BIT, PULL_TYPE_IO_1V8_ONLY), 3258 + RK3588_PIN_BANK_FLAGS(1, 32, "gpio1", 3259 + IOMUX_WIDTH_4BIT, PULL_TYPE_IO_1V8_ONLY), 3260 + RK3588_PIN_BANK_FLAGS(2, 32, "gpio2", 3261 + IOMUX_WIDTH_4BIT, PULL_TYPE_IO_1V8_ONLY), 3262 + RK3588_PIN_BANK_FLAGS(3, 32, "gpio3", 3263 + IOMUX_WIDTH_4BIT, PULL_TYPE_IO_1V8_ONLY), 3264 + RK3588_PIN_BANK_FLAGS(4, 32, "gpio4", 3265 + IOMUX_WIDTH_4BIT, PULL_TYPE_IO_1V8_ONLY), 3266 + }; 3267 + 3268 + static struct rockchip_pin_ctrl rk3588_pin_ctrl = { 3269 + .pin_banks = rk3588_pin_banks, 3270 + .nr_banks = ARRAY_SIZE(rk3588_pin_banks), 3271 + .label = "RK3588-GPIO", 3272 + .type = RK3588, 3273 + .pull_calc_reg = rk3588_calc_pull_reg_and_bit, 3274 + .drv_calc_reg = rk3588_calc_drv_reg_and_bit, 3275 + .schmitt_calc_reg = rk3588_calc_schmitt_reg_and_bit, 3276 + }; 3277 + 3528 3278 static const struct of_device_id rockchip_pinctrl_dt_match[] = { 3529 3279 { .compatible = "rockchip,px30-pinctrl", 3530 3280 .data = &px30_pin_ctrl }, ··· 3579 3283 .data = &rk3399_pin_ctrl }, 3580 3284 { .compatible = "rockchip,rk3568-pinctrl", 3581 3285 .data = &rk3568_pin_ctrl }, 3286 + { .compatible = "rockchip,rk3588-pinctrl", 3287 + .data = &rk3588_pin_ctrl }, 3582 3288 {}, 3583 3289 }; 3584 3290
+166
drivers/pinctrl/pinctrl-rockchip.h
··· 18 18 #ifndef _PINCTRL_ROCKCHIP_H 19 19 #define _PINCTRL_ROCKCHIP_H 20 20 21 + #define RK_GPIO0_A0 0 22 + #define RK_GPIO0_A1 1 23 + #define RK_GPIO0_A2 2 24 + #define RK_GPIO0_A3 3 25 + #define RK_GPIO0_A4 4 26 + #define RK_GPIO0_A5 5 27 + #define RK_GPIO0_A6 6 28 + #define RK_GPIO0_A7 7 29 + #define RK_GPIO0_B0 8 30 + #define RK_GPIO0_B1 9 31 + #define RK_GPIO0_B2 10 32 + #define RK_GPIO0_B3 11 33 + #define RK_GPIO0_B4 12 34 + #define RK_GPIO0_B5 13 35 + #define RK_GPIO0_B6 14 36 + #define RK_GPIO0_B7 15 37 + #define RK_GPIO0_C0 16 38 + #define RK_GPIO0_C1 17 39 + #define RK_GPIO0_C2 18 40 + #define RK_GPIO0_C3 19 41 + #define RK_GPIO0_C4 20 42 + #define RK_GPIO0_C5 21 43 + #define RK_GPIO0_C6 22 44 + #define RK_GPIO0_C7 23 45 + #define RK_GPIO0_D0 24 46 + #define RK_GPIO0_D1 25 47 + #define RK_GPIO0_D2 26 48 + #define RK_GPIO0_D3 27 49 + #define RK_GPIO0_D4 28 50 + #define RK_GPIO0_D5 29 51 + #define RK_GPIO0_D6 30 52 + #define RK_GPIO0_D7 31 53 + 54 + #define RK_GPIO1_A0 32 55 + #define RK_GPIO1_A1 33 56 + #define RK_GPIO1_A2 34 57 + #define RK_GPIO1_A3 35 58 + #define RK_GPIO1_A4 36 59 + #define RK_GPIO1_A5 37 60 + #define RK_GPIO1_A6 38 61 + #define RK_GPIO1_A7 39 62 + #define RK_GPIO1_B0 40 63 + #define RK_GPIO1_B1 41 64 + #define RK_GPIO1_B2 42 65 + #define RK_GPIO1_B3 43 66 + #define RK_GPIO1_B4 44 67 + #define RK_GPIO1_B5 45 68 + #define RK_GPIO1_B6 46 69 + #define RK_GPIO1_B7 47 70 + #define RK_GPIO1_C0 48 71 + #define RK_GPIO1_C1 49 72 + #define RK_GPIO1_C2 50 73 + #define RK_GPIO1_C3 51 74 + #define RK_GPIO1_C4 52 75 + #define RK_GPIO1_C5 53 76 + #define RK_GPIO1_C6 54 77 + #define RK_GPIO1_C7 55 78 + #define RK_GPIO1_D0 56 79 + #define RK_GPIO1_D1 57 80 + #define RK_GPIO1_D2 58 81 + #define RK_GPIO1_D3 59 82 + #define RK_GPIO1_D4 60 83 + #define RK_GPIO1_D5 61 84 + #define RK_GPIO1_D6 62 85 + #define RK_GPIO1_D7 63 86 + 87 + #define RK_GPIO2_A0 64 88 + #define RK_GPIO2_A1 65 89 + #define RK_GPIO2_A2 66 90 + #define RK_GPIO2_A3 67 91 + #define RK_GPIO2_A4 68 92 + #define RK_GPIO2_A5 69 93 + #define RK_GPIO2_A6 70 94 + #define RK_GPIO2_A7 71 95 + #define RK_GPIO2_B0 72 96 + #define RK_GPIO2_B1 73 97 + #define RK_GPIO2_B2 74 98 + #define RK_GPIO2_B3 75 99 + #define RK_GPIO2_B4 76 100 + #define RK_GPIO2_B5 77 101 + #define RK_GPIO2_B6 78 102 + #define RK_GPIO2_B7 79 103 + #define RK_GPIO2_C0 80 104 + #define RK_GPIO2_C1 81 105 + #define RK_GPIO2_C2 82 106 + #define RK_GPIO2_C3 83 107 + #define RK_GPIO2_C4 84 108 + #define RK_GPIO2_C5 85 109 + #define RK_GPIO2_C6 86 110 + #define RK_GPIO2_C7 87 111 + #define RK_GPIO2_D0 88 112 + #define RK_GPIO2_D1 89 113 + #define RK_GPIO2_D2 90 114 + #define RK_GPIO2_D3 91 115 + #define RK_GPIO2_D4 92 116 + #define RK_GPIO2_D5 93 117 + #define RK_GPIO2_D6 94 118 + #define RK_GPIO2_D7 95 119 + 120 + #define RK_GPIO3_A0 96 121 + #define RK_GPIO3_A1 97 122 + #define RK_GPIO3_A2 98 123 + #define RK_GPIO3_A3 99 124 + #define RK_GPIO3_A4 100 125 + #define RK_GPIO3_A5 101 126 + #define RK_GPIO3_A6 102 127 + #define RK_GPIO3_A7 103 128 + #define RK_GPIO3_B0 104 129 + #define RK_GPIO3_B1 105 130 + #define RK_GPIO3_B2 106 131 + #define RK_GPIO3_B3 107 132 + #define RK_GPIO3_B4 108 133 + #define RK_GPIO3_B5 109 134 + #define RK_GPIO3_B6 110 135 + #define RK_GPIO3_B7 111 136 + #define RK_GPIO3_C0 112 137 + #define RK_GPIO3_C1 113 138 + #define RK_GPIO3_C2 114 139 + #define RK_GPIO3_C3 115 140 + #define RK_GPIO3_C4 116 141 + #define RK_GPIO3_C5 117 142 + #define RK_GPIO3_C6 118 143 + #define RK_GPIO3_C7 119 144 + #define RK_GPIO3_D0 120 145 + #define RK_GPIO3_D1 121 146 + #define RK_GPIO3_D2 122 147 + #define RK_GPIO3_D3 123 148 + #define RK_GPIO3_D4 124 149 + #define RK_GPIO3_D5 125 150 + #define RK_GPIO3_D6 126 151 + #define RK_GPIO3_D7 127 152 + 153 + #define RK_GPIO4_A0 128 154 + #define RK_GPIO4_A1 129 155 + #define RK_GPIO4_A2 130 156 + #define RK_GPIO4_A3 131 157 + #define RK_GPIO4_A4 132 158 + #define RK_GPIO4_A5 133 159 + #define RK_GPIO4_A6 134 160 + #define RK_GPIO4_A7 135 161 + #define RK_GPIO4_B0 136 162 + #define RK_GPIO4_B1 137 163 + #define RK_GPIO4_B2 138 164 + #define RK_GPIO4_B3 139 165 + #define RK_GPIO4_B4 140 166 + #define RK_GPIO4_B5 141 167 + #define RK_GPIO4_B6 142 168 + #define RK_GPIO4_B7 143 169 + #define RK_GPIO4_C0 144 170 + #define RK_GPIO4_C1 145 171 + #define RK_GPIO4_C2 146 172 + #define RK_GPIO4_C3 147 173 + #define RK_GPIO4_C4 148 174 + #define RK_GPIO4_C5 149 175 + #define RK_GPIO4_C6 150 176 + #define RK_GPIO4_C7 151 177 + #define RK_GPIO4_D0 152 178 + #define RK_GPIO4_D1 153 179 + #define RK_GPIO4_D2 154 180 + #define RK_GPIO4_D3 155 181 + #define RK_GPIO4_D4 156 182 + #define RK_GPIO4_D5 157 183 + #define RK_GPIO4_D6 158 184 + #define RK_GPIO4_D7 159 185 + 21 186 enum rockchip_pinctrl_type { 22 187 PX30, 23 188 RV1108, ··· 195 30 RK3368, 196 31 RK3399, 197 32 RK3568, 33 + RK3588, 198 34 }; 199 35 200 36 /**