18c2ecf20Sopenharmony_ci/* Copyright (c) 2009 - 2016 Freescale Semiconductor, Inc.
28c2ecf20Sopenharmony_ci *
38c2ecf20Sopenharmony_ci * Redistribution and use in source and binary forms, with or without
48c2ecf20Sopenharmony_ci * modification, are permitted provided that the following conditions are met:
58c2ecf20Sopenharmony_ci *     * Redistributions of source code must retain the above copyright
68c2ecf20Sopenharmony_ci *	 notice, this list of conditions and the following disclaimer.
78c2ecf20Sopenharmony_ci *     * Redistributions in binary form must reproduce the above copyright
88c2ecf20Sopenharmony_ci *	 notice, this list of conditions and the following disclaimer in the
98c2ecf20Sopenharmony_ci *	 documentation and/or other materials provided with the distribution.
108c2ecf20Sopenharmony_ci *     * Neither the name of Freescale Semiconductor nor the
118c2ecf20Sopenharmony_ci *	 names of its contributors may be used to endorse or promote products
128c2ecf20Sopenharmony_ci *	 derived from this software without specific prior written permission.
138c2ecf20Sopenharmony_ci *
148c2ecf20Sopenharmony_ci * ALTERNATIVELY, this software may be distributed under the terms of the
158c2ecf20Sopenharmony_ci * GNU General Public License ("GPL") as published by the Free Software
168c2ecf20Sopenharmony_ci * Foundation, either version 2 of that License or (at your option) any
178c2ecf20Sopenharmony_ci * later version.
188c2ecf20Sopenharmony_ci *
198c2ecf20Sopenharmony_ci * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
208c2ecf20Sopenharmony_ci * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
218c2ecf20Sopenharmony_ci * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
228c2ecf20Sopenharmony_ci * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
238c2ecf20Sopenharmony_ci * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
248c2ecf20Sopenharmony_ci * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
258c2ecf20Sopenharmony_ci * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
268c2ecf20Sopenharmony_ci * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
278c2ecf20Sopenharmony_ci * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
288c2ecf20Sopenharmony_ci * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
298c2ecf20Sopenharmony_ci */
308c2ecf20Sopenharmony_ci
318c2ecf20Sopenharmony_ci#include "bman_priv.h"
328c2ecf20Sopenharmony_ci
338c2ecf20Sopenharmony_ciu16 bman_ip_rev;
348c2ecf20Sopenharmony_ciEXPORT_SYMBOL(bman_ip_rev);
358c2ecf20Sopenharmony_ci
368c2ecf20Sopenharmony_ci/* Register offsets */
378c2ecf20Sopenharmony_ci#define REG_FBPR_FPC		0x0800
388c2ecf20Sopenharmony_ci#define REG_ECSR		0x0a00
398c2ecf20Sopenharmony_ci#define REG_ECIR		0x0a04
408c2ecf20Sopenharmony_ci#define REG_EADR		0x0a08
418c2ecf20Sopenharmony_ci#define REG_EDATA(n)		(0x0a10 + ((n) * 0x04))
428c2ecf20Sopenharmony_ci#define REG_SBEC(n)		(0x0a80 + ((n) * 0x04))
438c2ecf20Sopenharmony_ci#define REG_IP_REV_1		0x0bf8
448c2ecf20Sopenharmony_ci#define REG_IP_REV_2		0x0bfc
458c2ecf20Sopenharmony_ci#define REG_FBPR_BARE		0x0c00
468c2ecf20Sopenharmony_ci#define REG_FBPR_BAR		0x0c04
478c2ecf20Sopenharmony_ci#define REG_FBPR_AR		0x0c10
488c2ecf20Sopenharmony_ci#define REG_SRCIDR		0x0d04
498c2ecf20Sopenharmony_ci#define REG_LIODNR		0x0d08
508c2ecf20Sopenharmony_ci#define REG_ERR_ISR		0x0e00
518c2ecf20Sopenharmony_ci#define REG_ERR_IER		0x0e04
528c2ecf20Sopenharmony_ci#define REG_ERR_ISDR		0x0e08
538c2ecf20Sopenharmony_ci
548c2ecf20Sopenharmony_ci/* Used by all error interrupt registers except 'inhibit' */
558c2ecf20Sopenharmony_ci#define BM_EIRQ_IVCI	0x00000010	/* Invalid Command Verb */
568c2ecf20Sopenharmony_ci#define BM_EIRQ_FLWI	0x00000008	/* FBPR Low Watermark */
578c2ecf20Sopenharmony_ci#define BM_EIRQ_MBEI	0x00000004	/* Multi-bit ECC Error */
588c2ecf20Sopenharmony_ci#define BM_EIRQ_SBEI	0x00000002	/* Single-bit ECC Error */
598c2ecf20Sopenharmony_ci#define BM_EIRQ_BSCN	0x00000001	/* pool State Change Notification */
608c2ecf20Sopenharmony_ci
618c2ecf20Sopenharmony_cistruct bman_hwerr_txt {
628c2ecf20Sopenharmony_ci	u32 mask;
638c2ecf20Sopenharmony_ci	const char *txt;
648c2ecf20Sopenharmony_ci};
658c2ecf20Sopenharmony_ci
668c2ecf20Sopenharmony_cistatic const struct bman_hwerr_txt bman_hwerr_txts[] = {
678c2ecf20Sopenharmony_ci	{ BM_EIRQ_IVCI, "Invalid Command Verb" },
688c2ecf20Sopenharmony_ci	{ BM_EIRQ_FLWI, "FBPR Low Watermark" },
698c2ecf20Sopenharmony_ci	{ BM_EIRQ_MBEI, "Multi-bit ECC Error" },
708c2ecf20Sopenharmony_ci	{ BM_EIRQ_SBEI, "Single-bit ECC Error" },
718c2ecf20Sopenharmony_ci	{ BM_EIRQ_BSCN, "Pool State Change Notification" },
728c2ecf20Sopenharmony_ci};
738c2ecf20Sopenharmony_ci
748c2ecf20Sopenharmony_ci/* Only trigger low water mark interrupt once only */
758c2ecf20Sopenharmony_ci#define BMAN_ERRS_TO_DISABLE BM_EIRQ_FLWI
768c2ecf20Sopenharmony_ci
778c2ecf20Sopenharmony_ci/* Pointer to the start of the BMan's CCSR space */
788c2ecf20Sopenharmony_cistatic u32 __iomem *bm_ccsr_start;
798c2ecf20Sopenharmony_ci
808c2ecf20Sopenharmony_cistatic inline u32 bm_ccsr_in(u32 offset)
818c2ecf20Sopenharmony_ci{
828c2ecf20Sopenharmony_ci	return ioread32be(bm_ccsr_start + offset/4);
838c2ecf20Sopenharmony_ci}
848c2ecf20Sopenharmony_cistatic inline void bm_ccsr_out(u32 offset, u32 val)
858c2ecf20Sopenharmony_ci{
868c2ecf20Sopenharmony_ci	iowrite32be(val, bm_ccsr_start + offset/4);
878c2ecf20Sopenharmony_ci}
888c2ecf20Sopenharmony_ci
898c2ecf20Sopenharmony_cistatic void bm_get_version(u16 *id, u8 *major, u8 *minor)
908c2ecf20Sopenharmony_ci{
918c2ecf20Sopenharmony_ci	u32 v = bm_ccsr_in(REG_IP_REV_1);
928c2ecf20Sopenharmony_ci	*id = (v >> 16);
938c2ecf20Sopenharmony_ci	*major = (v >> 8) & 0xff;
948c2ecf20Sopenharmony_ci	*minor = v & 0xff;
958c2ecf20Sopenharmony_ci}
968c2ecf20Sopenharmony_ci
978c2ecf20Sopenharmony_ci/* signal transactions for FBPRs with higher priority */
988c2ecf20Sopenharmony_ci#define FBPR_AR_RPRIO_HI BIT(30)
998c2ecf20Sopenharmony_ci
1008c2ecf20Sopenharmony_ci/* Track if probe has occurred and if cleanup is required */
1018c2ecf20Sopenharmony_cistatic int __bman_probed;
1028c2ecf20Sopenharmony_cistatic int __bman_requires_cleanup;
1038c2ecf20Sopenharmony_ci
1048c2ecf20Sopenharmony_ci
1058c2ecf20Sopenharmony_cistatic int bm_set_memory(u64 ba, u32 size)
1068c2ecf20Sopenharmony_ci{
1078c2ecf20Sopenharmony_ci	u32 bar, bare;
1088c2ecf20Sopenharmony_ci	u32 exp = ilog2(size);
1098c2ecf20Sopenharmony_ci	/* choke if size isn't within range */
1108c2ecf20Sopenharmony_ci	DPAA_ASSERT(size >= 4096 && size <= 1024*1024*1024 &&
1118c2ecf20Sopenharmony_ci		   is_power_of_2(size));
1128c2ecf20Sopenharmony_ci	/* choke if '[e]ba' has lower-alignment than 'size' */
1138c2ecf20Sopenharmony_ci	DPAA_ASSERT(!(ba & (size - 1)));
1148c2ecf20Sopenharmony_ci
1158c2ecf20Sopenharmony_ci	/* Check to see if BMan has already been initialized */
1168c2ecf20Sopenharmony_ci	bar = bm_ccsr_in(REG_FBPR_BAR);
1178c2ecf20Sopenharmony_ci	if (bar) {
1188c2ecf20Sopenharmony_ci		/* Maker sure ba == what was programmed) */
1198c2ecf20Sopenharmony_ci		bare = bm_ccsr_in(REG_FBPR_BARE);
1208c2ecf20Sopenharmony_ci		if (bare != upper_32_bits(ba) || bar != lower_32_bits(ba)) {
1218c2ecf20Sopenharmony_ci			pr_err("Attempted to reinitialize BMan with different BAR, got 0x%llx read BARE=0x%x BAR=0x%x\n",
1228c2ecf20Sopenharmony_ci			       ba, bare, bar);
1238c2ecf20Sopenharmony_ci			return -ENOMEM;
1248c2ecf20Sopenharmony_ci		}
1258c2ecf20Sopenharmony_ci		pr_info("BMan BAR already configured\n");
1268c2ecf20Sopenharmony_ci		__bman_requires_cleanup = 1;
1278c2ecf20Sopenharmony_ci		return 1;
1288c2ecf20Sopenharmony_ci	}
1298c2ecf20Sopenharmony_ci
1308c2ecf20Sopenharmony_ci	bm_ccsr_out(REG_FBPR_BARE, upper_32_bits(ba));
1318c2ecf20Sopenharmony_ci	bm_ccsr_out(REG_FBPR_BAR, lower_32_bits(ba));
1328c2ecf20Sopenharmony_ci	bm_ccsr_out(REG_FBPR_AR, exp - 1);
1338c2ecf20Sopenharmony_ci	return 0;
1348c2ecf20Sopenharmony_ci}
1358c2ecf20Sopenharmony_ci
1368c2ecf20Sopenharmony_ci/*
1378c2ecf20Sopenharmony_ci * Location and size of BMan private memory
1388c2ecf20Sopenharmony_ci *
1398c2ecf20Sopenharmony_ci * Ideally we would use the DMA API to turn rmem->base into a DMA address
1408c2ecf20Sopenharmony_ci * (especially if iommu translations ever get involved).  Unfortunately, the
1418c2ecf20Sopenharmony_ci * DMA API currently does not allow mapping anything that is not backed with
1428c2ecf20Sopenharmony_ci * a struct page.
1438c2ecf20Sopenharmony_ci */
1448c2ecf20Sopenharmony_cistatic dma_addr_t fbpr_a;
1458c2ecf20Sopenharmony_cistatic size_t fbpr_sz;
1468c2ecf20Sopenharmony_ci
1478c2ecf20Sopenharmony_cistatic int bman_fbpr(struct reserved_mem *rmem)
1488c2ecf20Sopenharmony_ci{
1498c2ecf20Sopenharmony_ci	fbpr_a = rmem->base;
1508c2ecf20Sopenharmony_ci	fbpr_sz = rmem->size;
1518c2ecf20Sopenharmony_ci
1528c2ecf20Sopenharmony_ci	WARN_ON(!(fbpr_a && fbpr_sz));
1538c2ecf20Sopenharmony_ci
1548c2ecf20Sopenharmony_ci	return 0;
1558c2ecf20Sopenharmony_ci}
1568c2ecf20Sopenharmony_ciRESERVEDMEM_OF_DECLARE(bman_fbpr, "fsl,bman-fbpr", bman_fbpr);
1578c2ecf20Sopenharmony_ci
1588c2ecf20Sopenharmony_cistatic irqreturn_t bman_isr(int irq, void *ptr)
1598c2ecf20Sopenharmony_ci{
1608c2ecf20Sopenharmony_ci	u32 isr_val, ier_val, ecsr_val, isr_mask, i;
1618c2ecf20Sopenharmony_ci	struct device *dev = ptr;
1628c2ecf20Sopenharmony_ci
1638c2ecf20Sopenharmony_ci	ier_val = bm_ccsr_in(REG_ERR_IER);
1648c2ecf20Sopenharmony_ci	isr_val = bm_ccsr_in(REG_ERR_ISR);
1658c2ecf20Sopenharmony_ci	ecsr_val = bm_ccsr_in(REG_ECSR);
1668c2ecf20Sopenharmony_ci	isr_mask = isr_val & ier_val;
1678c2ecf20Sopenharmony_ci
1688c2ecf20Sopenharmony_ci	if (!isr_mask)
1698c2ecf20Sopenharmony_ci		return IRQ_NONE;
1708c2ecf20Sopenharmony_ci
1718c2ecf20Sopenharmony_ci	for (i = 0; i < ARRAY_SIZE(bman_hwerr_txts); i++) {
1728c2ecf20Sopenharmony_ci		if (bman_hwerr_txts[i].mask & isr_mask) {
1738c2ecf20Sopenharmony_ci			dev_err_ratelimited(dev, "ErrInt: %s\n",
1748c2ecf20Sopenharmony_ci					    bman_hwerr_txts[i].txt);
1758c2ecf20Sopenharmony_ci			if (bman_hwerr_txts[i].mask & ecsr_val) {
1768c2ecf20Sopenharmony_ci				/* Re-arm error capture registers */
1778c2ecf20Sopenharmony_ci				bm_ccsr_out(REG_ECSR, ecsr_val);
1788c2ecf20Sopenharmony_ci			}
1798c2ecf20Sopenharmony_ci			if (bman_hwerr_txts[i].mask & BMAN_ERRS_TO_DISABLE) {
1808c2ecf20Sopenharmony_ci				dev_dbg(dev, "Disabling error 0x%x\n",
1818c2ecf20Sopenharmony_ci					bman_hwerr_txts[i].mask);
1828c2ecf20Sopenharmony_ci				ier_val &= ~bman_hwerr_txts[i].mask;
1838c2ecf20Sopenharmony_ci				bm_ccsr_out(REG_ERR_IER, ier_val);
1848c2ecf20Sopenharmony_ci			}
1858c2ecf20Sopenharmony_ci		}
1868c2ecf20Sopenharmony_ci	}
1878c2ecf20Sopenharmony_ci	bm_ccsr_out(REG_ERR_ISR, isr_val);
1888c2ecf20Sopenharmony_ci
1898c2ecf20Sopenharmony_ci	return IRQ_HANDLED;
1908c2ecf20Sopenharmony_ci}
1918c2ecf20Sopenharmony_ci
1928c2ecf20Sopenharmony_ciint bman_is_probed(void)
1938c2ecf20Sopenharmony_ci{
1948c2ecf20Sopenharmony_ci	return __bman_probed;
1958c2ecf20Sopenharmony_ci}
1968c2ecf20Sopenharmony_ciEXPORT_SYMBOL_GPL(bman_is_probed);
1978c2ecf20Sopenharmony_ci
1988c2ecf20Sopenharmony_ciint bman_requires_cleanup(void)
1998c2ecf20Sopenharmony_ci{
2008c2ecf20Sopenharmony_ci	return __bman_requires_cleanup;
2018c2ecf20Sopenharmony_ci}
2028c2ecf20Sopenharmony_ci
2038c2ecf20Sopenharmony_civoid bman_done_cleanup(void)
2048c2ecf20Sopenharmony_ci{
2058c2ecf20Sopenharmony_ci	__bman_requires_cleanup = 0;
2068c2ecf20Sopenharmony_ci}
2078c2ecf20Sopenharmony_ci
2088c2ecf20Sopenharmony_cistatic int fsl_bman_probe(struct platform_device *pdev)
2098c2ecf20Sopenharmony_ci{
2108c2ecf20Sopenharmony_ci	int ret, err_irq;
2118c2ecf20Sopenharmony_ci	struct device *dev = &pdev->dev;
2128c2ecf20Sopenharmony_ci	struct device_node *node = dev->of_node;
2138c2ecf20Sopenharmony_ci	struct resource *res;
2148c2ecf20Sopenharmony_ci	u16 id, bm_pool_cnt;
2158c2ecf20Sopenharmony_ci	u8 major, minor;
2168c2ecf20Sopenharmony_ci
2178c2ecf20Sopenharmony_ci	__bman_probed = -1;
2188c2ecf20Sopenharmony_ci
2198c2ecf20Sopenharmony_ci	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
2208c2ecf20Sopenharmony_ci	if (!res) {
2218c2ecf20Sopenharmony_ci		dev_err(dev, "Can't get %pOF property 'IORESOURCE_MEM'\n",
2228c2ecf20Sopenharmony_ci			node);
2238c2ecf20Sopenharmony_ci		return -ENXIO;
2248c2ecf20Sopenharmony_ci	}
2258c2ecf20Sopenharmony_ci	bm_ccsr_start = devm_ioremap(dev, res->start, resource_size(res));
2268c2ecf20Sopenharmony_ci	if (!bm_ccsr_start)
2278c2ecf20Sopenharmony_ci		return -ENXIO;
2288c2ecf20Sopenharmony_ci
2298c2ecf20Sopenharmony_ci	bm_get_version(&id, &major, &minor);
2308c2ecf20Sopenharmony_ci	if (major == 1 && minor == 0) {
2318c2ecf20Sopenharmony_ci		bman_ip_rev = BMAN_REV10;
2328c2ecf20Sopenharmony_ci		bm_pool_cnt = BM_POOL_MAX;
2338c2ecf20Sopenharmony_ci	} else if (major == 2 && minor == 0) {
2348c2ecf20Sopenharmony_ci		bman_ip_rev = BMAN_REV20;
2358c2ecf20Sopenharmony_ci		bm_pool_cnt = 8;
2368c2ecf20Sopenharmony_ci	} else if (major == 2 && minor == 1) {
2378c2ecf20Sopenharmony_ci		bman_ip_rev = BMAN_REV21;
2388c2ecf20Sopenharmony_ci		bm_pool_cnt = BM_POOL_MAX;
2398c2ecf20Sopenharmony_ci	} else {
2408c2ecf20Sopenharmony_ci		dev_err(dev, "Unknown Bman version:%04x,%02x,%02x\n",
2418c2ecf20Sopenharmony_ci			id, major, minor);
2428c2ecf20Sopenharmony_ci		return -ENODEV;
2438c2ecf20Sopenharmony_ci	}
2448c2ecf20Sopenharmony_ci
2458c2ecf20Sopenharmony_ci	/*
2468c2ecf20Sopenharmony_ci	 * If FBPR memory wasn't defined using the qbman compatible string
2478c2ecf20Sopenharmony_ci	 * try using the of_reserved_mem_device method
2488c2ecf20Sopenharmony_ci	 */
2498c2ecf20Sopenharmony_ci	if (!fbpr_a) {
2508c2ecf20Sopenharmony_ci		ret = qbman_init_private_mem(dev, 0, &fbpr_a, &fbpr_sz);
2518c2ecf20Sopenharmony_ci		if (ret) {
2528c2ecf20Sopenharmony_ci			dev_err(dev, "qbman_init_private_mem() failed 0x%x\n",
2538c2ecf20Sopenharmony_ci				ret);
2548c2ecf20Sopenharmony_ci			return -ENODEV;
2558c2ecf20Sopenharmony_ci		}
2568c2ecf20Sopenharmony_ci	}
2578c2ecf20Sopenharmony_ci
2588c2ecf20Sopenharmony_ci	dev_dbg(dev, "Allocated FBPR 0x%llx 0x%zx\n", fbpr_a, fbpr_sz);
2598c2ecf20Sopenharmony_ci
2608c2ecf20Sopenharmony_ci	bm_set_memory(fbpr_a, fbpr_sz);
2618c2ecf20Sopenharmony_ci
2628c2ecf20Sopenharmony_ci	err_irq = platform_get_irq(pdev, 0);
2638c2ecf20Sopenharmony_ci	if (err_irq <= 0) {
2648c2ecf20Sopenharmony_ci		dev_info(dev, "Can't get %pOF IRQ\n", node);
2658c2ecf20Sopenharmony_ci		return -ENODEV;
2668c2ecf20Sopenharmony_ci	}
2678c2ecf20Sopenharmony_ci	ret = devm_request_irq(dev, err_irq, bman_isr, IRQF_SHARED, "bman-err",
2688c2ecf20Sopenharmony_ci			       dev);
2698c2ecf20Sopenharmony_ci	if (ret)  {
2708c2ecf20Sopenharmony_ci		dev_err(dev, "devm_request_irq() failed %d for '%pOF'\n",
2718c2ecf20Sopenharmony_ci			ret, node);
2728c2ecf20Sopenharmony_ci		return ret;
2738c2ecf20Sopenharmony_ci	}
2748c2ecf20Sopenharmony_ci	/* Disable Buffer Pool State Change */
2758c2ecf20Sopenharmony_ci	bm_ccsr_out(REG_ERR_ISDR, BM_EIRQ_BSCN);
2768c2ecf20Sopenharmony_ci	/*
2778c2ecf20Sopenharmony_ci	 * Write-to-clear any stale bits, (eg. starvation being asserted prior
2788c2ecf20Sopenharmony_ci	 * to resource allocation during driver init).
2798c2ecf20Sopenharmony_ci	 */
2808c2ecf20Sopenharmony_ci	bm_ccsr_out(REG_ERR_ISR, 0xffffffff);
2818c2ecf20Sopenharmony_ci	/* Enable Error Interrupts */
2828c2ecf20Sopenharmony_ci	bm_ccsr_out(REG_ERR_IER, 0xffffffff);
2838c2ecf20Sopenharmony_ci
2848c2ecf20Sopenharmony_ci	bm_bpalloc = devm_gen_pool_create(dev, 0, -1, "bman-bpalloc");
2858c2ecf20Sopenharmony_ci	if (IS_ERR(bm_bpalloc)) {
2868c2ecf20Sopenharmony_ci		ret = PTR_ERR(bm_bpalloc);
2878c2ecf20Sopenharmony_ci		dev_err(dev, "bman-bpalloc pool init failed (%d)\n", ret);
2888c2ecf20Sopenharmony_ci		return ret;
2898c2ecf20Sopenharmony_ci	}
2908c2ecf20Sopenharmony_ci
2918c2ecf20Sopenharmony_ci	/* seed BMan resource pool */
2928c2ecf20Sopenharmony_ci	ret = gen_pool_add(bm_bpalloc, DPAA_GENALLOC_OFF, bm_pool_cnt, -1);
2938c2ecf20Sopenharmony_ci	if (ret) {
2948c2ecf20Sopenharmony_ci		dev_err(dev, "Failed to seed BPID range [%d..%d] (%d)\n",
2958c2ecf20Sopenharmony_ci			0, bm_pool_cnt - 1, ret);
2968c2ecf20Sopenharmony_ci		return ret;
2978c2ecf20Sopenharmony_ci	}
2988c2ecf20Sopenharmony_ci
2998c2ecf20Sopenharmony_ci	__bman_probed = 1;
3008c2ecf20Sopenharmony_ci
3018c2ecf20Sopenharmony_ci	return 0;
3028c2ecf20Sopenharmony_ci};
3038c2ecf20Sopenharmony_ci
3048c2ecf20Sopenharmony_cistatic const struct of_device_id fsl_bman_ids[] = {
3058c2ecf20Sopenharmony_ci	{
3068c2ecf20Sopenharmony_ci		.compatible = "fsl,bman",
3078c2ecf20Sopenharmony_ci	},
3088c2ecf20Sopenharmony_ci	{}
3098c2ecf20Sopenharmony_ci};
3108c2ecf20Sopenharmony_ci
3118c2ecf20Sopenharmony_cistatic struct platform_driver fsl_bman_driver = {
3128c2ecf20Sopenharmony_ci	.driver = {
3138c2ecf20Sopenharmony_ci		.name = KBUILD_MODNAME,
3148c2ecf20Sopenharmony_ci		.of_match_table = fsl_bman_ids,
3158c2ecf20Sopenharmony_ci		.suppress_bind_attrs = true,
3168c2ecf20Sopenharmony_ci	},
3178c2ecf20Sopenharmony_ci	.probe = fsl_bman_probe,
3188c2ecf20Sopenharmony_ci};
3198c2ecf20Sopenharmony_ci
3208c2ecf20Sopenharmony_cibuiltin_platform_driver(fsl_bman_driver);
321