Commit f5619f37 authored by Florian Fainelli's avatar Florian Fainelli Committed by Miquel Raynal

mtd: rawnand: brcmnand: Allow working without interrupts

The BCMA devices include the brcmnand controller but they do not wire up
any interrupt line, allow the main interrupt to be optional and update
the completion path to also check for the lack of an interrupt line.
Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20220107184614.2670254-6-f.fainelli@gmail.com
parent 75ac9447
...@@ -216,7 +216,7 @@ struct brcmnand_controller { ...@@ -216,7 +216,7 @@ struct brcmnand_controller {
void __iomem *nand_base; void __iomem *nand_base;
void __iomem *nand_fc; /* flash cache */ void __iomem *nand_fc; /* flash cache */
void __iomem *flash_dma_base; void __iomem *flash_dma_base;
unsigned int irq; int irq;
unsigned int dma_irq; unsigned int dma_irq;
int nand_version; int nand_version;
...@@ -1610,7 +1610,7 @@ static bool brcmstb_nand_wait_for_completion(struct nand_chip *chip) ...@@ -1610,7 +1610,7 @@ static bool brcmstb_nand_wait_for_completion(struct nand_chip *chip)
bool err = false; bool err = false;
int sts; int sts;
if (mtd->oops_panic_write) { if (mtd->oops_panic_write || ctrl->irq < 0) {
/* switch to interrupt polling and PIO mode */ /* switch to interrupt polling and PIO mode */
disable_ctrl_irqs(ctrl); disable_ctrl_irqs(ctrl);
sts = bcmnand_ctrl_poll_status(ctrl, NAND_CTRL_RDY, sts = bcmnand_ctrl_poll_status(ctrl, NAND_CTRL_RDY,
...@@ -3144,13 +3144,8 @@ int brcmnand_probe(struct platform_device *pdev, struct brcmnand_soc *soc) ...@@ -3144,13 +3144,8 @@ int brcmnand_probe(struct platform_device *pdev, struct brcmnand_soc *soc)
} }
/* IRQ */ /* IRQ */
ctrl->irq = platform_get_irq(pdev, 0); ctrl->irq = platform_get_irq_optional(pdev, 0);
if ((int)ctrl->irq < 0) { if (ctrl->irq > 0) {
dev_err(dev, "no IRQ defined\n");
ret = -ENODEV;
goto err;
}
/* /*
* Some SoCs integrate this controller (e.g., its interrupt bits) in * Some SoCs integrate this controller (e.g., its interrupt bits) in
* interesting ways * interesting ways
...@@ -3172,6 +3167,7 @@ int brcmnand_probe(struct platform_device *pdev, struct brcmnand_soc *soc) ...@@ -3172,6 +3167,7 @@ int brcmnand_probe(struct platform_device *pdev, struct brcmnand_soc *soc)
ctrl->irq, ret); ctrl->irq, ret);
goto err; goto err;
} }
}
for_each_available_child_of_node(dn, child) { for_each_available_child_of_node(dn, child) {
if (of_device_is_compatible(child, "brcm,nandcs")) { if (of_device_is_compatible(child, "brcm,nandcs")) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment