ixp4xx-npe.c (76f24b4f46b8ca380d6e2c91bd84e0e47a9f4bcd) | ixp4xx-npe.c (d5d9f7ac58ea1041375a028f143ca5784693ea86) |
---|---|
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> | |
22#include <linux/platform_device.h> 23#include <linux/soc/ixp4xx/npe.h> | 21#include <linux/platform_device.h> 22#include <linux/soc/ixp4xx/npe.h> |
23#include <mach/hardware.h> 24#include <mach/cpu.h> |
|
24 25#define DEBUG_MSG 0 26#define DEBUG_FW 0 27 28#define NPE_COUNT 3 29#define MAX_RETRIES 1000 /* microseconds */ 30#define NPE_42X_DATA_SIZE 0x800 /* in dwords */ 31#define NPE_46X_DATA_SIZE 0x1000 --- 643 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; | 25 26#define DEBUG_MSG 0 27#define DEBUG_FW 0 28 29#define NPE_COUNT 3 30#define MAX_RETRIES 1000 /* microseconds */ 31#define NPE_42X_DATA_SIZE 0x800 /* in dwords */ 32#define NPE_46X_DATA_SIZE 0x1000 --- 643 unchanged lines hidden (view full) --- 676{ 677 module_put(THIS_MODULE); 678} 679 680static int ixp4xx_npe_probe(struct platform_device *pdev) 681{ 682 int i, found = 0; 683 struct device *dev = &pdev->dev; |
683 struct device_node *np = dev->of_node; | |
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; | 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 | |
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 --- | 716 return 0; 717} 718 719static int ixp4xx_npe_remove(struct platform_device *pdev) 720{ 721 int i; 722 723 for (i = 0; i < NPE_COUNT; i++) --- 38 unchanged lines hidden --- |