939-mikrotik-rb91x.patch 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. From: Denis Kalashnikov <[email protected]>
  2. Subject: [PATCH] ath79: add support for reset key on MikroTik RB912UAG-2HPnD
  3. On MikroTik RB91x board series a reset key shares SoC gpio
  4. line #15 with NAND ALE and NAND IO7. So we need a custom
  5. gpio driver to manage this non-trivial connection schema.
  6. Also rb91x-nand needs to have an ability to disable a polling
  7. of the key while it works with NAND.
  8. While we've been integrating rb91x-key into a firmware, we've
  9. figured out that:
  10. * In the gpio-latch driver we need to add a "cansleep" suffix to
  11. several gpiolib calls,
  12. * When gpio-latch and rb91x-nand fail to get a gpio and an error
  13. is -EPROBE_DEFER, they shouldn't report about this, since this
  14. actually is not an error and occurs when the gpio-latch probe
  15. function is called before the rb91x-key probe.
  16. We fix these related things here too.
  17. Submitted-by: Denis Kalashnikov <[email protected]>
  18. Reviewed-by: Sergey Ryazanov <[email protected]>
  19. Tested-by: Koen Vandeputte <[email protected]>
  20. ---
  21. drivers/gpio/Kconfig | 11 +++++++++++
  22. drivers/gpio/Makefile | 2 ++
  23. drivers/mtd/nand/raw/Kconfig | 6 ++++++
  24. drivers/mtd/nand/raw/Makefile | 1 +
  25. 7 files changed, 20 insertions(+)
  26. --- a/drivers/gpio/Kconfig
  27. +++ b/drivers/gpio/Kconfig
  28. @@ -353,6 +353,13 @@ config GPIO_IXP4XX
  29. IXP4xx series of chips.
  30. If unsure, say N.
  31. +
  32. +config GPIO_LATCH
  33. + tristate "MikroTik RouterBOARD GPIO latch support"
  34. + depends on ATH79
  35. + help
  36. + GPIO driver for latch on some MikroTik RouterBOARDs.
  37. +
  38. config GPIO_LOGICVC
  39. tristate "Xylon LogiCVC GPIO support"
  40. depends on MFD_SYSCON && OF
  41. @@ -529,6 +536,10 @@ config GPIO_ROCKCHIP
  42. help
  43. Say yes here to support GPIO on Rockchip SoCs.
  44. +config GPIO_RB91X_KEY
  45. + tristate "MikroTik RB91x board series reset key support"
  46. + depends on ATH79
  47. +
  48. config GPIO_SAMA5D2_PIOBU
  49. tristate "SAMA5D2 PIOBU GPIO support"
  50. depends on MFD_SYSCON
  51. --- a/drivers/gpio/Makefile
  52. +++ b/drivers/gpio/Makefile
  53. @@ -75,6 +75,7 @@ obj-$(CONFIG_GPIO_IT87) += gpio-it87.o
  54. obj-$(CONFIG_GPIO_IXP4XX) += gpio-ixp4xx.o
  55. obj-$(CONFIG_GPIO_JANZ_TTL) += gpio-janz-ttl.o
  56. obj-$(CONFIG_GPIO_KEMPLD) += gpio-kempld.o
  57. +obj-$(CONFIG_GPIO_LATCH) += gpio-latch.o
  58. obj-$(CONFIG_GPIO_LOGICVC) += gpio-logicvc.o
  59. obj-$(CONFIG_GPIO_LOONGSON1) += gpio-loongson1.o
  60. obj-$(CONFIG_GPIO_LOONGSON) += gpio-loongson.o
  61. @@ -123,6 +124,7 @@ obj-$(CONFIG_GPIO_PMIC_EIC_SPRD) += gpio
  62. obj-$(CONFIG_GPIO_PXA) += gpio-pxa.o
  63. obj-$(CONFIG_GPIO_RASPBERRYPI_EXP) += gpio-raspberrypi-exp.o
  64. obj-$(CONFIG_GPIO_RB4XX) += gpio-rb4xx.o
  65. +obj-$(CONFIG_GPIO_RB91X_KEY) += gpio-rb91x-key.o
  66. obj-$(CONFIG_GPIO_RC5T583) += gpio-rc5t583.o
  67. obj-$(CONFIG_GPIO_RCAR) += gpio-rcar.o
  68. obj-$(CONFIG_GPIO_RDA) += gpio-rda.o
  69. --- a/drivers/mtd/nand/raw/Kconfig
  70. +++ b/drivers/mtd/nand/raw/Kconfig
  71. @@ -570,4 +570,10 @@ config MTD_NAND_RB4XX
  72. Enables support for the NAND flash chip on Mikrotik Routerboard
  73. RB4xx series.
  74. +config MTD_NAND_RB91X
  75. + tristate "MikroTik RB91x NAND driver support"
  76. + depends on ATH79 && MTD_RAW_NAND
  77. + help
  78. + Enables support for the NAND flash chip on MikroTik RB91x series.
  79. +
  80. endif # MTD_RAW_NAND
  81. --- a/drivers/mtd/nand/raw/Makefile
  82. +++ b/drivers/mtd/nand/raw/Makefile
  83. @@ -60,6 +60,7 @@ obj-$(CONFIG_MTD_NAND_ROCKCHIP) += rock
  84. obj-$(CONFIG_MTD_NAND_PL35X) += pl35x-nand-controller.o
  85. obj-$(CONFIG_MTD_NAND_AR934X) += ar934x_nand.o
  86. obj-$(CONFIG_MTD_NAND_RB4XX) += nand_rb4xx.o
  87. +obj-$(CONFIG_MTD_NAND_RB91X) += rb91x_nand.o
  88. nand-objs := nand_base.o nand_legacy.o nand_bbt.o nand_timings.o nand_ids.o
  89. nand-objs += nand_onfi.o