910-mikrotik-rb4xx.patch 4.4 KB

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