kernel: bump 5.15 to 5.15.100
[openwrt/openwrt.git] / target / linux / ath79 / patches-5.15 / 920-mikrotik-rb4xx.patch
1 From: Christopher Hill <ch6574@gmail.com>
2 Subject: [PATCH] ath79: add Mikrotik rb4xx series drivers
3
4 This adds 3 Mikrotik rb4xx series drivers as follows:
5
6 rb4xx-cpld: This is in the mfd subsystem, and is the parent CPLD device
7 that interfaces between the SoC SPI bus and its two children below.
8 rb4xx-gpio: This is the GPIO expander.
9 rb4xx-nand: This is the NAND driver.
10
11 The history of this code comes in three phases.
12
13 1. The first is a May 2015 attempt to push the equivalient ar71xx rb4xx
14 drivers upstream. See https://lore.kernel.org/patchwork/patch/940880/.
15
16 Module-author: Gabor Juhos <juhosg@openwrt.org>
17 Module-author: Imre Kaloz <kaloz@openwrt.org>
18 Module-author: Bert Vermeulen <bert@biot.com>
19
20 2. Next several ar71xx patches were applied bringing the code current.
21
22 commit 7bbf4117c6fe4b764d9d7c62fb2bcf6dd93bff2c
23 Submitted-by: Hauke Mehrtens <hauke@hauke-m.de>
24
25 commit af79fdbe4af32a287798b579141204bda056b8aa
26 commit 889272d92db689fd9c910243635e44c9d8323095
27 commit e21cb649a235180563363b8af5ba8296b9ac0baa
28 commit 7c09fa4a7492ca436f2c94bd9a465b7c5bbeed6f
29 Submitted-by: Felix Fietkau <nbd@nbd.name>
30
31 3. Finally a heavy refactor to split the driver into the three new
32 subsystems, and updated to work with the device tree configuration, plus
33 updates and review feedback incorporated
34
35 Reviewed-by: Thibaut VARĂˆNE <hacks@slashdirt.org>
36 Submitted-by: Christopher Hill <ch6574@gmail.com>
37 ---
38 drivers/mfd/Kconfig | 8 ++++++++
39 drivers/mfd/Makefile | 1 +
40 drivers/gpio/Kconfig | 6 ++++++
41 drivers/gpio/Makefile | 1 +
42 drivers/mtd/nand/raw/Kconfig | 7 +++++++
43 drivers/mtd/nand/raw/Makefile | 1 +
44 6 files changed, 24 insertions(+)
45
46 --- a/drivers/mfd/Kconfig
47 +++ b/drivers/mfd/Kconfig
48 @@ -2176,6 +2176,14 @@ config RAVE_SP_CORE
49 Select this to get support for the Supervisory Processor
50 device found on several devices in RAVE line of hardware.
51
52 +config MFD_RB4XX_CPLD
53 + tristate "CPLD driver for Mikrotik RB4xx series boards"
54 + select MFD_CORE
55 + depends on ATH79 || COMPILE_TEST
56 + help
57 + Enables support for the CPLD chip (NAND & GPIO) on Mikrotik
58 + Routerboard RB4xx series.
59 +
60 config SGI_MFD_IOC3
61 bool "SGI IOC3 core driver"
62 depends on PCI && MIPS && 64BIT
63 --- a/drivers/mfd/Makefile
64 +++ b/drivers/mfd/Makefile
65 @@ -267,6 +267,7 @@ obj-$(CONFIG_MFD_KHADAS_MCU) += khadas-
66 obj-$(CONFIG_MFD_ACER_A500_EC) += acer-ec-a500.o
67 obj-$(CONFIG_MFD_QCOM_PM8008) += qcom-pm8008.o
68
69 +obj-$(CONFIG_MFD_RB4XX_CPLD) += rb4xx-cpld.o
70 obj-$(CONFIG_SGI_MFD_IOC3) += ioc3.o
71 obj-$(CONFIG_MFD_SIMPLE_MFD_I2C) += simple-mfd-i2c.o
72 obj-$(CONFIG_MFD_INTEL_M10_BMC) += intel-m10-bmc.o
73 --- a/drivers/gpio/Kconfig
74 +++ b/drivers/gpio/Kconfig
75 @@ -1574,6 +1574,12 @@ config GPIO_SODAVILLE
76 help
77 Say Y here to support Intel Sodaville GPIO.
78
79 +config GPIO_RB4XX
80 + tristate "GPIO expander for Mikrotik RB4xx series boards"
81 + depends on MFD_RB4XX_CPLD
82 + help
83 + GPIO driver for Mikrotik Routerboard RB4xx series.
84 +
85 endmenu
86
87 menu "SPI GPIO expanders"
88 --- a/drivers/gpio/Makefile
89 +++ b/drivers/gpio/Makefile
90 @@ -122,6 +122,7 @@ obj-$(CONFIG_GPIO_PL061) += gpio-pl061.
91 obj-$(CONFIG_GPIO_PMIC_EIC_SPRD) += gpio-pmic-eic-sprd.o
92 obj-$(CONFIG_GPIO_PXA) += gpio-pxa.o
93 obj-$(CONFIG_GPIO_RASPBERRYPI_EXP) += gpio-raspberrypi-exp.o
94 +obj-$(CONFIG_GPIO_RB4XX) += gpio-rb4xx.o
95 obj-$(CONFIG_GPIO_RC5T583) += gpio-rc5t583.o
96 obj-$(CONFIG_GPIO_RCAR) += gpio-rcar.o
97 obj-$(CONFIG_GPIO_RDA) += gpio-rda.o
98 --- a/drivers/mtd/nand/raw/Kconfig
99 +++ b/drivers/mtd/nand/raw/Kconfig
100 @@ -563,4 +563,11 @@ config MTD_NAND_AR934X
101 Enables support for NAND controller on Qualcomm Atheros SoCs.
102 This controller is found on AR934x and QCA955x SoCs.
103
104 +config MTD_NAND_RB4XX
105 + tristate "Support for NAND driver for Mikrotik RB4xx series boards"
106 + depends on MFD_RB4XX_CPLD
107 + help
108 + Enables support for the NAND flash chip on Mikrotik Routerboard
109 + RB4xx series.
110 +
111 endif # MTD_RAW_NAND
112 --- a/drivers/mtd/nand/raw/Makefile
113 +++ b/drivers/mtd/nand/raw/Makefile
114 @@ -59,6 +59,7 @@ obj-$(CONFIG_MTD_NAND_INTEL_LGM) += inte
115 obj-$(CONFIG_MTD_NAND_ROCKCHIP) += rockchip-nand-controller.o
116 obj-$(CONFIG_MTD_NAND_PL35X) += pl35x-nand-controller.o
117 obj-$(CONFIG_MTD_NAND_AR934X) += ar934x_nand.o
118 +obj-$(CONFIG_MTD_NAND_RB4XX) += nand_rb4xx.o
119
120 nand-objs := nand_base.o nand_legacy.o nand_bbt.o nand_timings.o nand_ids.o
121 nand-objs += nand_onfi.o