diff options
author | Florian Fainelli <f.fainelli@gmail.com> | 2019-12-18 03:56:35 +0300 |
---|---|---|
committer | Miquel Raynal <miquel.raynal@bootlin.com> | 2020-01-21 22:00:33 +0300 |
commit | 393947e5823fdfe96bd290e5d6311d5b08d03aa7 (patch) | |
tree | 799e0808c6e86fe8821562baf2345f4801b37ef9 | |
parent | 0e7ca83e82d021c928dadf4c13c137d57337540d (diff) | |
download | linux-393947e5823fdfe96bd290e5d6311d5b08d03aa7.tar.xz |
mtd: rawnand: brcmnand: Set appropriate DMA mask
NAND controllers >= 7.0 with FLASH_DMA support physical addresses up to
40-bit, set an appropriate DMA mask for that purpose.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
-rw-r--r-- | drivers/mtd/nand/raw/brcmnand/brcmnand.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/mtd/nand/raw/brcmnand/brcmnand.c b/drivers/mtd/nand/raw/brcmnand/brcmnand.c index 1a66b1cd51c0..44518dada75b 100644 --- a/drivers/mtd/nand/raw/brcmnand/brcmnand.c +++ b/drivers/mtd/nand/raw/brcmnand/brcmnand.c @@ -2635,6 +2635,16 @@ int brcmnand_probe(struct platform_device *pdev, struct brcmnand_soc *soc) /* initialize the dma version */ brcmnand_flash_dma_revision_init(ctrl); + ret = -EIO; + if (ctrl->nand_version >= 0x0700) + ret = dma_set_mask_and_coherent(&pdev->dev, + DMA_BIT_MASK(40)); + if (ret) + ret = dma_set_mask_and_coherent(&pdev->dev, + DMA_BIT_MASK(32)); + if (ret) + goto err; + /* linked-list and stop on error */ flash_dma_writel(ctrl, FLASH_DMA_MODE, FLASH_DMA_MODE_MASK); flash_dma_writel(ctrl, FLASH_DMA_ERROR_STATUS, 0); |