ixp4xx-npe.c (75bf465f0bc33e9b776a46d6a1b9b990f5fb7c37) ixp4xx-npe.c (76f24b4f46b8ca380d6e2c91bd84e0e47a9f4bcd)
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * Intel IXP4xx Network Processor Engine driver for Linux
4 *
5 * Copyright (C) 2007 Krzysztof Halasa <khc@pm.waw.pl>
6 *
7 * The code is based on publicly available information:
8 * - Intel IXP4xx Developer's Manual and other e-papers

--- 4 unchanged lines hidden (view full) ---

13
14#include <linux/delay.h>
15#include <linux/dma-mapping.h>
16#include <linux/firmware.h>
17#include <linux/io.h>
18#include <linux/kernel.h>
19#include <linux/module.h>
20#include <linux/of.h>
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * Intel IXP4xx Network Processor Engine driver for Linux
4 *
5 * Copyright (C) 2007 Krzysztof Halasa <khc@pm.waw.pl>
6 *
7 * The code is based on publicly available information:
8 * - Intel IXP4xx Developer's Manual and other e-papers

--- 4 unchanged lines hidden (view full) ---

13
14#include <linux/delay.h>
15#include <linux/dma-mapping.h>
16#include <linux/firmware.h>
17#include <linux/io.h>
18#include <linux/kernel.h>
19#include <linux/module.h>
20#include <linux/of.h>
21#include <linux/of_platform.h>
21#include <linux/platform_device.h>
22#include <linux/soc/ixp4xx/npe.h>
23
24#define DEBUG_MSG 0
25#define DEBUG_FW 0
26
27#define NPE_COUNT 3
28#define MAX_RETRIES 1000 /* microseconds */

--- 645 unchanged lines hidden (view full) ---

674{
675 module_put(THIS_MODULE);
676}
677
678static int ixp4xx_npe_probe(struct platform_device *pdev)
679{
680 int i, found = 0;
681 struct device *dev = &pdev->dev;
22#include <linux/platform_device.h>
23#include <linux/soc/ixp4xx/npe.h>
24
25#define DEBUG_MSG 0
26#define DEBUG_FW 0
27
28#define NPE_COUNT 3
29#define MAX_RETRIES 1000 /* microseconds */

--- 645 unchanged lines hidden (view full) ---

675{
676 module_put(THIS_MODULE);
677}
678
679static int ixp4xx_npe_probe(struct platform_device *pdev)
680{
681 int i, found = 0;
682 struct device *dev = &pdev->dev;
683 struct device_node *np = dev->of_node;
682 struct resource *res;
683
684 for (i = 0; i < NPE_COUNT; i++) {
685 struct npe *npe = &npe_tab[i];
686
687 res = platform_get_resource(pdev, IORESOURCE_MEM, i);
688 if (!res)
689 return -ENODEV;

--- 16 unchanged lines hidden (view full) ---

706 npe->valid = 1;
707 dev_info(dev, "NPE%d at 0x%08x-0x%08x registered\n",
708 i, res->start, res->end);
709 found++;
710 }
711
712 if (!found)
713 return -ENODEV;
684 struct resource *res;
685
686 for (i = 0; i < NPE_COUNT; i++) {
687 struct npe *npe = &npe_tab[i];
688
689 res = platform_get_resource(pdev, IORESOURCE_MEM, i);
690 if (!res)
691 return -ENODEV;

--- 16 unchanged lines hidden (view full) ---

708 npe->valid = 1;
709 dev_info(dev, "NPE%d at 0x%08x-0x%08x registered\n",
710 i, res->start, res->end);
711 found++;
712 }
713
714 if (!found)
715 return -ENODEV;
716
717 /* Spawn crypto subdevice if using device tree */
718 if (IS_ENABLED(CONFIG_OF) && np)
719 devm_of_platform_populate(dev);
720
714 return 0;
715}
716
717static int ixp4xx_npe_remove(struct platform_device *pdev)
718{
719 int i;
720
721 for (i = 0; i < NPE_COUNT; i++)

--- 38 unchanged lines hidden ---
721 return 0;
722}
723
724static int ixp4xx_npe_remove(struct platform_device *pdev)
725{
726 int i;
727
728 for (i = 0; i < NPE_COUNT; i++)

--- 38 unchanged lines hidden ---