1088-mtd-spi-nor-fsl-quadspi-add-support-for-ls1021a.patch 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. From da44c1517526822e73642fc71b034de8fc7d2b43 Mon Sep 17 00:00:00 2001
  2. From: Yuan Yao <yao.yuan@freescale.com>
  3. Date: Tue, 17 Nov 2015 16:44:45 +0800
  4. Subject: [PATCH 088/113] mtd: spi-nor: fsl-quadspi: add support for ls1021a
  5. [context adjustment]
  6. LS1021a also support Freescale Quad SPI controller.
  7. Add fsl-quadspi support for ls1021a chip and make SPI_FSL_QUADSPI
  8. selectable for LS1021A SOC hardwares.
  9. Signed-off-by: Yuan Yao <yao.yuan@nxp.com>
  10. Acked-by: Han xu <han.xu@freescale.com>
  11. Integrated-by: Jiang Yutang <yutang.jiang@nxp.com>
  12. ---
  13. drivers/mtd/spi-nor/Kconfig | 2 +-
  14. drivers/mtd/spi-nor/fsl-quadspi.c | 10 ++++++++++
  15. 2 files changed, 11 insertions(+), 1 deletion(-)
  16. --- a/drivers/mtd/spi-nor/Kconfig
  17. +++ b/drivers/mtd/spi-nor/Kconfig
  18. @@ -23,7 +23,7 @@ config MTD_SPI_NOR_USE_4K_SECTORS
  19. config SPI_FSL_QUADSPI
  20. tristate "Freescale Quad SPI controller"
  21. - depends on ARCH_MXC || COMPILE_TEST
  22. + depends on ARCH_MXC || SOC_LS1021A || COMPILE_TEST
  23. depends on HAS_IOMEM
  24. help
  25. This enables support for the Quad SPI controller in master mode.
  26. --- a/drivers/mtd/spi-nor/fsl-quadspi.c
  27. +++ b/drivers/mtd/spi-nor/fsl-quadspi.c
  28. @@ -213,6 +213,7 @@ enum fsl_qspi_devtype {
  29. FSL_QUADSPI_IMX6SX,
  30. FSL_QUADSPI_IMX7D,
  31. FSL_QUADSPI_IMX6UL,
  32. + FSL_QUADSPI_LS1021A,
  33. };
  34. struct fsl_qspi_devtype_data {
  35. @@ -258,6 +259,14 @@ static struct fsl_qspi_devtype_data imx6
  36. | QUADSPI_QUIRK_4X_INT_CLK,
  37. };
  38. +static struct fsl_qspi_devtype_data ls1021a_data = {
  39. + .devtype = FSL_QUADSPI_LS1021A,
  40. + .rxfifo = 128,
  41. + .txfifo = 64,
  42. + .ahb_buf_size = 1024,
  43. + .driver_data = 0,
  44. +};
  45. +
  46. #define FSL_QSPI_MAX_CHIP 4
  47. struct fsl_qspi {
  48. struct spi_nor nor[FSL_QSPI_MAX_CHIP];
  49. @@ -812,6 +821,7 @@ static const struct of_device_id fsl_qsp
  50. { .compatible = "fsl,imx6sx-qspi", .data = (void *)&imx6sx_data, },
  51. { .compatible = "fsl,imx7d-qspi", .data = (void *)&imx7d_data, },
  52. { .compatible = "fsl,imx6ul-qspi", .data = (void *)&imx6ul_data, },
  53. + { .compatible = "fsl,ls1021a-qspi", .data = (void *)&ls1021a_data, },
  54. { /* sentinel */ }
  55. };
  56. MODULE_DEVICE_TABLE(of, fsl_qspi_dt_ids);