911-mikrotik-rb91x.patch 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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. @@ -368,6 +368,12 @@ config GPIO_IXP4XX
  29. If unsure, say N.
  30. +config GPIO_LATCH
  31. + tristate "MikroTik RouterBOARD GPIO latch support"
  32. + depends on ATH79
  33. + help
  34. + GPIO driver for latch on some MikroTik RouterBOARDs.
  35. +
  36. config GPIO_LOGICVC
  37. tristate "Xylon LogiCVC GPIO support"
  38. depends on MFD_SYSCON && OF
  39. @@ -544,6 +550,10 @@ config GPIO_ROCKCHIP
  40. help
  41. Say yes here to support GPIO on Rockchip SoCs.
  42. +config GPIO_RB91X_KEY
  43. + tristate "MikroTik RB91x board series reset key support"
  44. + depends on ATH79
  45. +
  46. config GPIO_SAMA5D2_PIOBU
  47. tristate "SAMA5D2 PIOBU GPIO support"
  48. depends on MFD_SYSCON
  49. --- a/drivers/gpio/Makefile
  50. +++ b/drivers/gpio/Makefile
  51. @@ -76,6 +76,7 @@ obj-$(CONFIG_GPIO_IT87) += gpio-it87.o
  52. obj-$(CONFIG_GPIO_IXP4XX) += gpio-ixp4xx.o
  53. obj-$(CONFIG_GPIO_JANZ_TTL) += gpio-janz-ttl.o
  54. obj-$(CONFIG_GPIO_KEMPLD) += gpio-kempld.o
  55. +obj-$(CONFIG_GPIO_LATCH) += gpio-latch.o
  56. obj-$(CONFIG_GPIO_LOGICVC) += gpio-logicvc.o
  57. obj-$(CONFIG_GPIO_LOONGSON1) += gpio-loongson1.o
  58. obj-$(CONFIG_GPIO_LOONGSON) += gpio-loongson.o
  59. @@ -124,6 +125,7 @@ obj-$(CONFIG_GPIO_PMIC_EIC_SPRD) += gpio
  60. obj-$(CONFIG_GPIO_PXA) += gpio-pxa.o
  61. obj-$(CONFIG_GPIO_RASPBERRYPI_EXP) += gpio-raspberrypi-exp.o
  62. obj-$(CONFIG_GPIO_RB4XX) += gpio-rb4xx.o
  63. +obj-$(CONFIG_GPIO_RB91X_KEY) += gpio-rb91x-key.o
  64. obj-$(CONFIG_GPIO_RC5T583) += gpio-rc5t583.o
  65. obj-$(CONFIG_GPIO_RCAR) += gpio-rcar.o
  66. obj-$(CONFIG_GPIO_RDA) += gpio-rda.o
  67. --- a/drivers/mtd/nand/raw/Kconfig
  68. +++ b/drivers/mtd/nand/raw/Kconfig
  69. @@ -572,4 +572,10 @@ config MTD_NAND_RB4XX
  70. Enables support for the NAND flash chip on Mikrotik Routerboard
  71. RB4xx series.
  72. +config MTD_NAND_RB91X
  73. + tristate "MikroTik RB91x NAND driver support"
  74. + depends on ATH79 && MTD_RAW_NAND
  75. + help
  76. + Enables support for the NAND flash chip on MikroTik RB91x series.
  77. +
  78. endif # MTD_RAW_NAND
  79. --- a/drivers/mtd/nand/raw/Makefile
  80. +++ b/drivers/mtd/nand/raw/Makefile
  81. @@ -61,6 +61,7 @@ obj-$(CONFIG_MTD_NAND_PL35X) += pl35x-n
  82. obj-$(CONFIG_MTD_NAND_RENESAS) += renesas-nand-controller.o
  83. obj-$(CONFIG_MTD_NAND_AR934X) += ar934x_nand.o
  84. obj-$(CONFIG_MTD_NAND_RB4XX) += nand_rb4xx.o
  85. +obj-$(CONFIG_MTD_NAND_RB91X) += rb91x_nand.o
  86. nand-objs := nand_base.o nand_legacy.o nand_bbt.o nand_timings.o nand_ids.o
  87. nand-objs += nand_onfi.o