From fa70b3a4bbc65d372d735004d9df894bd1c89c81 Mon Sep 17 00:00:00 2001 From: Christopher Hill Date: Mon, 25 May 2020 21:05:00 -0400 Subject: ath79: add Mikrotik rb4xx series drivers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This adds 3 Mikrotik rb4xx series drivers as follows: rb4xx-cpld: This is in the mfd subsystem, and is the parent CPLD device that interfaces between the SoC SPI bus and its two children below. rb4xx-gpio: This is the GPIO expander. rb4xx-nand: This is the NAND driver. The history of this code comes in three phases. 1. The first is a May 2015 attempt to push the equivalient ar71xx rb4xx drivers upstream. See https://lore.kernel.org/patchwork/patch/940880/. Module-author: Gabor Juhos Module-author: Imre Kaloz Module-author: Bert Vermeulen 2. Next several ar71xx patches were applied bringing the code current. commit 7bbf4117c6fe4b764d9d7c62fb2bcf6dd93bff2c Signed-off-by: Hauke Mehrtens commit af79fdbe4af32a287798b579141204bda056b8aa commit 889272d92db689fd9c910243635e44c9d8323095 commit e21cb649a235180563363b8af5ba8296b9ac0baa commit 7c09fa4a7492ca436f2c94bd9a465b7c5bbeed6f Signed-off-by: Felix Fietkau 3. Finally a heavy refactor to split the driver into the three new subsystems, and updated to work with the device tree configuration, plus updates and review feedback incorporated Reviewed-by: Thibaut VARĂˆNE Signed-off-by: Christopher Hill --- .../ath79/patches-4.19/920-mikrotik-rb4xx.patch | 69 ++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 target/linux/ath79/patches-4.19/920-mikrotik-rb4xx.patch (limited to 'target/linux/ath79/patches-4.19') diff --git a/target/linux/ath79/patches-4.19/920-mikrotik-rb4xx.patch b/target/linux/ath79/patches-4.19/920-mikrotik-rb4xx.patch new file mode 100644 index 0000000000..8d84b9e1cd --- /dev/null +++ b/target/linux/ath79/patches-4.19/920-mikrotik-rb4xx.patch @@ -0,0 +1,69 @@ +--- a/drivers/mfd/Kconfig ++++ b/drivers/mfd/Kconfig +@@ -1899,5 +1899,13 @@ config RAVE_SP_CORE + Select this to get support for the Supervisory Processor + device found on several devices in RAVE line of hardware. + ++config MFD_RB4XX_CPLD ++ tristate "CPLD driver for Mikrotik RB4xx series boards ++ select MFD_CORE ++ depends on ATH79 || COMPILE_TEST ++ help ++ Enables support for the CPLD chip (NAND & GPIO) on Mikrotik ++ Routerboard RB4xx series. ++ + endmenu + endif +--- a/drivers/mfd/Makefile ++++ b/drivers/mfd/Makefile +@@ -241,3 +241,4 @@ obj-$(CONFIG_MFD_SC27XX_PMIC) += sprd-sc + obj-$(CONFIG_RAVE_SP_CORE) += rave-sp.o + obj-$(CONFIG_MFD_ROHM_BD718XX) += rohm-bd718x7.o + ++obj-$(CONFIG_MFD_RB4XX_CPLD) += rb4xx-cpld.o +--- a/drivers/gpio/Kconfig ++++ b/drivers/gpio/Kconfig +@@ -1371,6 +1371,12 @@ config GPIO_XRA1403 + help + GPIO driver for EXAR XRA1403 16-bit SPI-based GPIO expander. + ++config GPIO_RB4XX ++ tristate "GPIO expander for Mikrotik RB4xx series boards" ++ depends on MFD_RB4XX_CPLD ++ help ++ GPIO driver for Mikrotik Routerboard RB4xx series. ++ + endmenu + + menu "USB GPIO expanders" +--- a/drivers/gpio/Makefile ++++ b/drivers/gpio/Makefile +@@ -159,3 +159,4 @@ obj-$(CONFIG_GPIO_ZEVIO) += gpio-zevio.o + obj-$(CONFIG_GPIO_ZYNQ) += gpio-zynq.o + obj-$(CONFIG_GPIO_ZX) += gpio-zx.o + obj-$(CONFIG_GPIO_LOONGSON1) += gpio-loongson1.o ++obj-$(CONFIG_GPIO_RB4XX) += gpio-rb4xx.o +--- a/drivers/mtd/nand/raw/Kconfig ++++ b/drivers/mtd/nand/raw/Kconfig +@@ -569,4 +569,11 @@ config MTD_NAND_AR934X + Enables support for NAND controller on Qualcomm Atheros SoCs. + This controller is found on AR934x and QCA955x SoCs. + ++config MTD_NAND_RB4XX ++ tristate "Support for NAND driver for Mikrotik RB4xx series boards" ++ depends on MFD_RB4XX_CPLD ++ help ++ Enables support for the NAND flash chip on Mikrotik Routerboard ++ RB4xx series. ++ + endif # MTD_NAND +--- a/drivers/mtd/nand/raw/Makefile ++++ b/drivers/mtd/nand/raw/Makefile +@@ -58,6 +58,7 @@ obj-$(CONFIG_MTD_NAND_QCOM) += qcom_nan + obj-$(CONFIG_MTD_NAND_MTK) += mtk_ecc.o mtk_nand.o + obj-$(CONFIG_MTD_NAND_TEGRA) += tegra_nand.o + obj-$(CONFIG_MTD_NAND_AR934X) += ar934x_nand.o ++obj-$(CONFIG_MTD_NAND_RB4XX) += nand_rb4xx.o + + nand-objs := nand_base.o nand_bbt.o nand_timings.o nand_ids.o + nand-objs += nand_amd.o -- cgit v1.2.3