Skip to content

Commit 198eef9

Browse files
William Zhangmiquelraynal
William Zhang
authored andcommitted
mtd: rawnand: brcmnand: Rename bcm63138 nand driver
In preparing to support multiple BCMBCA SoCs, rename bcm63138 to bcmbca in the driver code and driver file name. Signed-off-by: William Zhang <[email protected]> Reviewed-by: David Regan <[email protected]> Acked-by: Florian Fainelli <[email protected]> Signed-off-by: Miquel Raynal <[email protected]> Link: https://lore.kernel.org/linux-mtd/[email protected]
1 parent 0d7760f commit 198eef9

File tree

3 files changed

+100
-100
lines changed

3 files changed

+100
-100
lines changed

drivers/mtd/nand/raw/brcmnand/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# link order matters; don't link the more generic brcmstb_nand.o before the
33
# more specific iproc_nand.o, for instance
44
obj-$(CONFIG_MTD_NAND_BRCMNAND_IPROC) += iproc_nand.o
5-
obj-$(CONFIG_MTD_NAND_BRCMNAND_BCMBCA) += bcm63138_nand.o
5+
obj-$(CONFIG_MTD_NAND_BRCMNAND_BCMBCA) += bcmbca_nand.o
66
obj-$(CONFIG_MTD_NAND_BRCMNAND_BCM63XX) += bcm6368_nand.o
77
obj-$(CONFIG_MTD_NAND_BRCMNAND_BRCMSTB) += brcmstb_nand.o
88
obj-$(CONFIG_MTD_NAND_BRCMNAND) += brcmnand.o

drivers/mtd/nand/raw/brcmnand/bcm63138_nand.c

Lines changed: 0 additions & 99 deletions
This file was deleted.
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
// SPDX-License-Identifier: GPL-2.0-only
2+
/*
3+
* Copyright © 2015 Broadcom Corporation
4+
*/
5+
6+
#include <linux/device.h>
7+
#include <linux/io.h>
8+
#include <linux/ioport.h>
9+
#include <linux/module.h>
10+
#include <linux/of.h>
11+
#include <linux/of_address.h>
12+
#include <linux/platform_device.h>
13+
#include <linux/slab.h>
14+
15+
#include "brcmnand.h"
16+
17+
struct bcmbca_nand_soc {
18+
struct brcmnand_soc soc;
19+
void __iomem *base;
20+
};
21+
22+
#define BCMBCA_NAND_INT_STATUS 0x00
23+
#define BCMBCA_NAND_INT_EN 0x04
24+
25+
enum {
26+
BCMBCA_CTLRDY = BIT(4),
27+
};
28+
29+
static bool bcmbca_nand_intc_ack(struct brcmnand_soc *soc)
30+
{
31+
struct bcmbca_nand_soc *priv =
32+
container_of(soc, struct bcmbca_nand_soc, soc);
33+
void __iomem *mmio = priv->base + BCMBCA_NAND_INT_STATUS;
34+
u32 val = brcmnand_readl(mmio);
35+
36+
if (val & BCMBCA_CTLRDY) {
37+
brcmnand_writel(val & ~BCMBCA_CTLRDY, mmio);
38+
return true;
39+
}
40+
41+
return false;
42+
}
43+
44+
static void bcmbca_nand_intc_set(struct brcmnand_soc *soc, bool en)
45+
{
46+
struct bcmbca_nand_soc *priv =
47+
container_of(soc, struct bcmbca_nand_soc, soc);
48+
void __iomem *mmio = priv->base + BCMBCA_NAND_INT_EN;
49+
u32 val = brcmnand_readl(mmio);
50+
51+
if (en)
52+
val |= BCMBCA_CTLRDY;
53+
else
54+
val &= ~BCMBCA_CTLRDY;
55+
56+
brcmnand_writel(val, mmio);
57+
}
58+
59+
static int bcmbca_nand_probe(struct platform_device *pdev)
60+
{
61+
struct device *dev = &pdev->dev;
62+
struct bcmbca_nand_soc *priv;
63+
struct brcmnand_soc *soc;
64+
65+
priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
66+
if (!priv)
67+
return -ENOMEM;
68+
soc = &priv->soc;
69+
70+
priv->base = devm_platform_ioremap_resource_byname(pdev, "nand-int-base");
71+
if (IS_ERR(priv->base))
72+
return PTR_ERR(priv->base);
73+
74+
soc->ctlrdy_ack = bcmbca_nand_intc_ack;
75+
soc->ctlrdy_set_enabled = bcmbca_nand_intc_set;
76+
77+
return brcmnand_probe(pdev, soc);
78+
}
79+
80+
static const struct of_device_id bcmbca_nand_of_match[] = {
81+
{ .compatible = "brcm,nand-bcm63138" },
82+
{},
83+
};
84+
MODULE_DEVICE_TABLE(of, bcmbca_nand_of_match);
85+
86+
static struct platform_driver bcmbca_nand_driver = {
87+
.probe = bcmbca_nand_probe,
88+
.remove_new = brcmnand_remove,
89+
.driver = {
90+
.name = "bcmbca_nand",
91+
.pm = &brcmnand_pm_ops,
92+
.of_match_table = bcmbca_nand_of_match,
93+
}
94+
};
95+
module_platform_driver(bcmbca_nand_driver);
96+
97+
MODULE_LICENSE("GPL v2");
98+
MODULE_AUTHOR("Brian Norris");
99+
MODULE_DESCRIPTION("NAND driver for BCMBCA");

0 commit comments

Comments
 (0)