All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/7] staging: mt7621-pci: update to last kernel APIs and other related minor cleanups
@ 2020-11-23  9:36 Sergio Paracuellos
  2020-11-23  9:36 ` [PATCH 1/7] staging: mt7621-pci: remove bus ranges related code Sergio Paracuellos
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Sergio Paracuellos @ 2020-11-23  9:36 UTC (permalink / raw)
  To: gregkh; +Cc: devel, neil

This patch series updates the driver to use last kernel apis and
other minor cleanup changes related with this changes.

LOC decressed a bit which is always a good thing :)

This serias has been tested in GnuBee PC1 boards resulting in a
working platform.

Best regards,
   Sergio Paracuellos

Sergio Paracuellos (7):
  staging: mt7621-pci: remove bus ranges related code
  staging: mt7621-pci: remove 'offset' with mem and io resource sizes
  staging: mt7621-pci: add comment to clarify IO resource in this driver
  staging: mt7621-pci: review 'pci_host_bridge' assigned variables
  staging: mt7621-pci: parse and prepare resources in
    'mt7621_pci_parse_request_of_pci_ranges'
  staging: mt7621-pci: convert to use 'devm_platform_ioremap_resource'
  staging: mt7621-pci: remove 'RALINK_PCI_IMBASEBAR0_ADDR' register

 drivers/staging/mt7621-pci/pci-mt7621.c | 97 ++++++++-----------------
 1 file changed, 30 insertions(+), 67 deletions(-)

-- 
2.25.1

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 1/7] staging: mt7621-pci: remove bus ranges related code
  2020-11-23  9:36 [PATCH 0/7] staging: mt7621-pci: update to last kernel APIs and other related minor cleanups Sergio Paracuellos
@ 2020-11-23  9:36 ` Sergio Paracuellos
  2020-11-23  9:36 ` [PATCH 2/7] staging: mt7621-pci: remove 'offset' with mem and io resource sizes Sergio Paracuellos
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Sergio Paracuellos @ 2020-11-23  9:36 UTC (permalink / raw)
  To: gregkh; +Cc: devel, neil

Bus ranges are now discovered by default. Hence remove
its related code from the driver.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
---
 drivers/staging/mt7621-pci/pci-mt7621.c | 13 -------------
 1 file changed, 13 deletions(-)

diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c b/drivers/staging/mt7621-pci/pci-mt7621.c
index 7b38ef9f8560..3e8dddf5ec79 100644
--- a/drivers/staging/mt7621-pci/pci-mt7621.c
+++ b/drivers/staging/mt7621-pci/pci-mt7621.c
@@ -117,7 +117,6 @@ struct mt7621_pcie_port {
  * @base: IO Mapped Register Base
  * @io: IO resource
  * @mem: non-prefetchable memory resource
- * @busn: bus range
  * @offset: IO / Memory offset
  * @dev: Pointer to PCIe device
  * @io_map_base: virtual memory base address for io
@@ -131,7 +130,6 @@ struct mt7621_pcie {
 	struct device *dev;
 	struct resource io;
 	struct resource mem;
-	struct resource busn;
 	struct {
 		resource_size_t mem;
 		resource_size_t io;
@@ -299,7 +297,6 @@ static int mt7621_pci_parse_request_of_pci_ranges(struct mt7621_pcie *pcie)
 	struct device_node *node = dev->of_node;
 	struct of_pci_range_parser parser;
 	struct of_pci_range range;
-	int err;
 
 	if (of_pci_range_parser_init(&parser, node)) {
 		dev_err(dev, "missing \"ranges\" property\n");
@@ -324,15 +321,6 @@ static int mt7621_pci_parse_request_of_pci_ranges(struct mt7621_pcie *pcie)
 		}
 	}
 
-	err = of_pci_parse_bus_range(node, &pcie->busn);
-	if (err < 0) {
-		dev_err(dev, "failed to parse bus ranges property: %d\n", err);
-		pcie->busn.name = node->name;
-		pcie->busn.start = 0;
-		pcie->busn.end = 0xff;
-		pcie->busn.flags = IORESOURCE_BUS;
-	}
-
 	set_io_port_base(pcie->io_map_base);
 
 	return 0;
@@ -666,7 +654,6 @@ static int mt7621_pcie_register_host(struct pci_host_bridge *host,
 	struct mt7621_pcie *pcie = pci_host_bridge_priv(host);
 
 	list_splice_init(res, &host->windows);
-	host->busnr = pcie->busn.start;
 	host->dev.parent = pcie->dev;
 	host->ops = &mt7621_pci_ops;
 	host->map_irq = mt7621_map_irq;
-- 
2.25.1

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 2/7] staging: mt7621-pci: remove 'offset' with mem and io resource sizes
  2020-11-23  9:36 [PATCH 0/7] staging: mt7621-pci: update to last kernel APIs and other related minor cleanups Sergio Paracuellos
  2020-11-23  9:36 ` [PATCH 1/7] staging: mt7621-pci: remove bus ranges related code Sergio Paracuellos
@ 2020-11-23  9:36 ` Sergio Paracuellos
  2020-11-23  9:36 ` [PATCH 3/7] staging: mt7621-pci: add comment to clarify IO resource in this driver Sergio Paracuellos
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Sergio Paracuellos @ 2020-11-23  9:36 UTC (permalink / raw)
  To: gregkh; +Cc: devel, neil

Offset contains resources size for both io and memory resources.
Those fields are directly initialized to zero and set up using
'pci_add_resource_offset' function. Instead of doing that remove
them and use directly function 'pci_add_resource' where zero is
passed directly to its internal call to 'pci_add_resource_offset'.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
---
 drivers/staging/mt7621-pci/pci-mt7621.c | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c b/drivers/staging/mt7621-pci/pci-mt7621.c
index 3e8dddf5ec79..219b35937285 100644
--- a/drivers/staging/mt7621-pci/pci-mt7621.c
+++ b/drivers/staging/mt7621-pci/pci-mt7621.c
@@ -117,7 +117,6 @@ struct mt7621_pcie_port {
  * @base: IO Mapped Register Base
  * @io: IO resource
  * @mem: non-prefetchable memory resource
- * @offset: IO / Memory offset
  * @dev: Pointer to PCIe device
  * @io_map_base: virtual memory base address for io
  * @ports: pointer to PCIe port information
@@ -130,10 +129,6 @@ struct mt7621_pcie {
 	struct device *dev;
 	struct resource io;
 	struct resource mem;
-	struct {
-		resource_size_t mem;
-		resource_size_t io;
-	} offset;
 	unsigned long io_map_base;
 	struct list_head ports;
 	int irq_map[PCIE_P2P_CNT];
@@ -312,11 +307,9 @@ static int mt7621_pci_parse_request_of_pci_ranges(struct mt7621_pcie *pcie)
 			of_pci_range_to_resource(&range, node, &pcie->io);
 			pcie->io.start = range.cpu_addr;
 			pcie->io.end = range.cpu_addr + range.size - 1;
-			pcie->offset.io = 0x00000000UL;
 			break;
 		case IORESOURCE_MEM:
 			of_pci_range_to_resource(&range, node, &pcie->mem);
-			pcie->offset.mem = 0x00000000UL;
 			break;
 		}
 	}
@@ -644,8 +637,8 @@ static int mt7621_pcie_init_virtual_bridges(struct mt7621_pcie *pcie)
 static void mt7621_pcie_add_resources(struct mt7621_pcie *pcie,
 				      struct list_head *res)
 {
-	pci_add_resource_offset(res, &pcie->io, pcie->offset.io);
-	pci_add_resource_offset(res, &pcie->mem, pcie->offset.mem);
+	pci_add_resource(res, &pcie->io);
+	pci_add_resource(res, &pcie->mem);
 }
 
 static int mt7621_pcie_register_host(struct pci_host_bridge *host,
-- 
2.25.1

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 3/7] staging: mt7621-pci: add comment to clarify IO resource in this driver
  2020-11-23  9:36 [PATCH 0/7] staging: mt7621-pci: update to last kernel APIs and other related minor cleanups Sergio Paracuellos
  2020-11-23  9:36 ` [PATCH 1/7] staging: mt7621-pci: remove bus ranges related code Sergio Paracuellos
  2020-11-23  9:36 ` [PATCH 2/7] staging: mt7621-pci: remove 'offset' with mem and io resource sizes Sergio Paracuellos
@ 2020-11-23  9:36 ` Sergio Paracuellos
  2020-11-23  9:36 ` [PATCH 4/7] staging: mt7621-pci: review 'pci_host_bridge' assigned variables Sergio Paracuellos
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Sergio Paracuellos @ 2020-11-23  9:36 UTC (permalink / raw)
  To: gregkh; +Cc: devel, neil

Because IO_SPACE_LIMIT for mips is 0xFFFF but this platform uses
PĈI IO resource at 0x001e160000. Hence instead of directly use
some more accurate functions from the PCI kernel for this driver
some things must be done in a different way to make things work.
Add this explanation as a comment where the IO resource is parsed
and virtually mapped into memory.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
---
 drivers/staging/mt7621-pci/pci-mt7621.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c b/drivers/staging/mt7621-pci/pci-mt7621.c
index 219b35937285..1f9e75db5298 100644
--- a/drivers/staging/mt7621-pci/pci-mt7621.c
+++ b/drivers/staging/mt7621-pci/pci-mt7621.c
@@ -298,6 +298,13 @@ static int mt7621_pci_parse_request_of_pci_ranges(struct mt7621_pcie *pcie)
 		return -EINVAL;
 	}
 
+	/*
+	 * IO_SPACE_LIMIT for MIPS is 0xffff but this platform uses IO at
+	 * upper address 0x001e160000 so we have to get the resource from
+	 * the DT because when it has been requested it failed and has been
+	 * removed from bridge->dma_ranges and bridge->windows. So parse it
+	 * and remap it manually to make things work.
+	 */
 	for_each_of_pci_range(&parser, &range) {
 		switch (range.flags & IORESOURCE_TYPE_BITS) {
 		case IORESOURCE_IO:
-- 
2.25.1

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 4/7] staging: mt7621-pci: review 'pci_host_bridge' assigned variables
  2020-11-23  9:36 [PATCH 0/7] staging: mt7621-pci: update to last kernel APIs and other related minor cleanups Sergio Paracuellos
                   ` (2 preceding siblings ...)
  2020-11-23  9:36 ` [PATCH 3/7] staging: mt7621-pci: add comment to clarify IO resource in this driver Sergio Paracuellos
@ 2020-11-23  9:36 ` Sergio Paracuellos
  2020-11-23  9:36 ` [PATCH 5/7] staging: mt7621-pci: parse and prepare resources in 'mt7621_pci_parse_request_of_pci_ranges' Sergio Paracuellos
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Sergio Paracuellos @ 2020-11-23  9:36 UTC (permalink / raw)
  To: gregkh; +Cc: devel, neil

PCI kernel apis now set some variables related with pci_host_bridge
by default and it is not necessary to setup them in driver code.
Host bridge parent device is set by default to the platform device
and 'swizzle_irq' is also set to its default function. These two
are not necessary to be set here. Hence remove them.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
---
 drivers/staging/mt7621-pci/pci-mt7621.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c b/drivers/staging/mt7621-pci/pci-mt7621.c
index 1f9e75db5298..98569d9b70f2 100644
--- a/drivers/staging/mt7621-pci/pci-mt7621.c
+++ b/drivers/staging/mt7621-pci/pci-mt7621.c
@@ -654,10 +654,8 @@ static int mt7621_pcie_register_host(struct pci_host_bridge *host,
 	struct mt7621_pcie *pcie = pci_host_bridge_priv(host);
 
 	list_splice_init(res, &host->windows);
-	host->dev.parent = pcie->dev;
 	host->ops = &mt7621_pci_ops;
 	host->map_irq = mt7621_map_irq;
-	host->swizzle_irq = pci_common_swizzle;
 	host->sysdata = pcie;
 
 	return pci_host_probe(host);
-- 
2.25.1

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 5/7] staging: mt7621-pci: parse and prepare resources in 'mt7621_pci_parse_request_of_pci_ranges'
  2020-11-23  9:36 [PATCH 0/7] staging: mt7621-pci: update to last kernel APIs and other related minor cleanups Sergio Paracuellos
                   ` (3 preceding siblings ...)
  2020-11-23  9:36 ` [PATCH 4/7] staging: mt7621-pci: review 'pci_host_bridge' assigned variables Sergio Paracuellos
@ 2020-11-23  9:36 ` Sergio Paracuellos
  2020-11-23  9:36 ` [PATCH 6/7] staging: mt7621-pci: convert to use 'devm_platform_ioremap_resource' Sergio Paracuellos
  2020-11-23  9:36 ` [PATCH 7/7] staging: mt7621-pci: remove 'RALINK_PCI_IMBASEBAR0_ADDR' register Sergio Paracuellos
  6 siblings, 0 replies; 8+ messages in thread
From: Sergio Paracuellos @ 2020-11-23  9:36 UTC (permalink / raw)
  To: gregkh; +Cc: devel, neil

Remove 'mt7621_pcie_add_resources' where resources are added to the host
windows moving this code into the function where all the parsing and
preparing code is being done: 'mt7621_pci_parse_request_of_pci_ranges'.
The memory resource has been properly parsed for the PCI APIs so we
only need to retrieve it and use it in those places we need.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
---
 drivers/staging/mt7621-pci/pci-mt7621.c | 44 ++++++++++++-------------
 1 file changed, 21 insertions(+), 23 deletions(-)

diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c b/drivers/staging/mt7621-pci/pci-mt7621.c
index 98569d9b70f2..a0b3ec51c7d9 100644
--- a/drivers/staging/mt7621-pci/pci-mt7621.c
+++ b/drivers/staging/mt7621-pci/pci-mt7621.c
@@ -116,7 +116,7 @@ struct mt7621_pcie_port {
  * struct mt7621_pcie - PCIe host information
  * @base: IO Mapped Register Base
  * @io: IO resource
- * @mem: non-prefetchable memory resource
+ * @mem: pointer to non-prefetchable memory resource
  * @dev: Pointer to PCIe device
  * @io_map_base: virtual memory base address for io
  * @ports: pointer to PCIe port information
@@ -128,7 +128,7 @@ struct mt7621_pcie {
 	void __iomem *base;
 	struct device *dev;
 	struct resource io;
-	struct resource mem;
+	struct resource *mem;
 	unsigned long io_map_base;
 	struct list_head ports;
 	int irq_map[PCIE_P2P_CNT];
@@ -256,7 +256,7 @@ static inline void mt7621_control_deassert(struct mt7621_pcie_port *port)
 
 static void setup_cm_memory_region(struct mt7621_pcie *pcie)
 {
-	struct resource *mem_resource = &pcie->mem;
+	struct resource *mem_resource = pcie->mem;
 	struct device *dev = pcie->dev;
 	resource_size_t mask;
 
@@ -286,12 +286,15 @@ static int mt7621_map_irq(const struct pci_dev *pdev, u8 slot, u8 pin)
 	return irq;
 }
 
-static int mt7621_pci_parse_request_of_pci_ranges(struct mt7621_pcie *pcie)
+static int mt7621_pci_parse_request_of_pci_ranges(struct pci_host_bridge *host)
 {
+	struct mt7621_pcie *pcie = pci_host_bridge_priv(host);
 	struct device *dev = pcie->dev;
 	struct device_node *node = dev->of_node;
 	struct of_pci_range_parser parser;
+	struct resource_entry *entry;
 	struct of_pci_range range;
+	LIST_HEAD(res);
 
 	if (of_pci_range_parser_init(&parser, node)) {
 		dev_err(dev, "missing \"ranges\" property\n");
@@ -314,14 +317,21 @@ static int mt7621_pci_parse_request_of_pci_ranges(struct mt7621_pcie *pcie)
 			of_pci_range_to_resource(&range, node, &pcie->io);
 			pcie->io.start = range.cpu_addr;
 			pcie->io.end = range.cpu_addr + range.size - 1;
-			break;
-		case IORESOURCE_MEM:
-			of_pci_range_to_resource(&range, node, &pcie->mem);
+			set_io_port_base(pcie->io_map_base);
 			break;
 		}
 	}
 
-	set_io_port_base(pcie->io_map_base);
+	entry = resource_list_first_type(&host->windows, IORESOURCE_MEM);
+	if (!entry) {
+		dev_err(dev, "Cannot get memory resource");
+		return -EINVAL;
+	}
+
+	pcie->mem = entry->res;
+	pci_add_resource(&res, &pcie->io);
+	pci_add_resource(&res, entry->res);
+	list_splice_init(&res, &host->windows);
 
 	return 0;
 }
@@ -641,19 +651,10 @@ static int mt7621_pcie_init_virtual_bridges(struct mt7621_pcie *pcie)
 	return 0;
 }
 
-static void mt7621_pcie_add_resources(struct mt7621_pcie *pcie,
-				      struct list_head *res)
-{
-	pci_add_resource(res, &pcie->io);
-	pci_add_resource(res, &pcie->mem);
-}
-
-static int mt7621_pcie_register_host(struct pci_host_bridge *host,
-				     struct list_head *res)
+static int mt7621_pcie_register_host(struct pci_host_bridge *host)
 {
 	struct mt7621_pcie *pcie = pci_host_bridge_priv(host);
 
-	list_splice_init(res, &host->windows);
 	host->ops = &mt7621_pci_ops;
 	host->map_irq = mt7621_map_irq;
 	host->sysdata = pcie;
@@ -672,7 +673,6 @@ static int mt7621_pci_probe(struct platform_device *pdev)
 	struct mt7621_pcie *pcie;
 	struct pci_host_bridge *bridge;
 	int err;
-	LIST_HEAD(res);
 
 	if (!dev->of_node)
 		return -ENODEV;
@@ -696,7 +696,7 @@ static int mt7621_pci_probe(struct platform_device *pdev)
 		return err;
 	}
 
-	err = mt7621_pci_parse_request_of_pci_ranges(pcie);
+	err = mt7621_pci_parse_request_of_pci_ranges(bridge);
 	if (err) {
 		dev_err(dev, "Error requesting pci resources from ranges");
 		return err;
@@ -718,9 +718,7 @@ static int mt7621_pci_probe(struct platform_device *pdev)
 
 	setup_cm_memory_region(pcie);
 
-	mt7621_pcie_add_resources(pcie, &res);
-
-	err = mt7621_pcie_register_host(bridge, &res);
+	err = mt7621_pcie_register_host(bridge);
 	if (err) {
 		dev_err(dev, "Error registering host\n");
 		return err;
-- 
2.25.1

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 6/7] staging: mt7621-pci: convert to use 'devm_platform_ioremap_resource'
  2020-11-23  9:36 [PATCH 0/7] staging: mt7621-pci: update to last kernel APIs and other related minor cleanups Sergio Paracuellos
                   ` (4 preceding siblings ...)
  2020-11-23  9:36 ` [PATCH 5/7] staging: mt7621-pci: parse and prepare resources in 'mt7621_pci_parse_request_of_pci_ranges' Sergio Paracuellos
@ 2020-11-23  9:36 ` Sergio Paracuellos
  2020-11-23  9:36 ` [PATCH 7/7] staging: mt7621-pci: remove 'RALINK_PCI_IMBASEBAR0_ADDR' register Sergio Paracuellos
  6 siblings, 0 replies; 8+ messages in thread
From: Sergio Paracuellos @ 2020-11-23  9:36 UTC (permalink / raw)
  To: gregkh; +Cc: devel, neil

Instead of getting resources parsing from DT first and remaping
afterwards, this can be done in one step using the kernel function
'devm_platform_ioremap_resource'. Hence, update to use it.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
---
 drivers/staging/mt7621-pci/pci-mt7621.c | 24 ++++--------------------
 1 file changed, 4 insertions(+), 20 deletions(-)

diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c b/drivers/staging/mt7621-pci/pci-mt7621.c
index a0b3ec51c7d9..4cdaccbcc97c 100644
--- a/drivers/staging/mt7621-pci/pci-mt7621.c
+++ b/drivers/staging/mt7621-pci/pci-mt7621.c
@@ -337,28 +337,18 @@ static int mt7621_pci_parse_request_of_pci_ranges(struct pci_host_bridge *host)
 }
 
 static int mt7621_pcie_parse_port(struct mt7621_pcie *pcie,
-				  struct device_node *node,
 				  int slot)
 {
 	struct mt7621_pcie_port *port;
 	struct device *dev = pcie->dev;
 	struct platform_device *pdev = to_platform_device(dev);
-	struct device_node *pnode = dev->of_node;
-	struct resource regs;
 	char name[10];
-	int err;
 
 	port = devm_kzalloc(dev, sizeof(*port), GFP_KERNEL);
 	if (!port)
 		return -ENOMEM;
 
-	err = of_address_to_resource(pnode, slot + 1, &regs);
-	if (err) {
-		dev_err(dev, "missing \"reg\" property\n");
-		return err;
-	}
-
-	port->base = devm_ioremap_resource(dev, &regs);
+	port->base = devm_platform_ioremap_resource(pdev, slot + 1);
 	if (IS_ERR(port->base))
 		return PTR_ERR(port->base);
 
@@ -399,17 +389,11 @@ static int mt7621_pcie_parse_port(struct mt7621_pcie *pcie,
 static int mt7621_pcie_parse_dt(struct mt7621_pcie *pcie)
 {
 	struct device *dev = pcie->dev;
+	struct platform_device *pdev = to_platform_device(dev);
 	struct device_node *node = dev->of_node, *child;
-	struct resource regs;
 	int err;
 
-	err = of_address_to_resource(node, 0, &regs);
-	if (err) {
-		dev_err(dev, "missing \"reg\" property\n");
-		return err;
-	}
-
-	pcie->base = devm_ioremap_resource(dev, &regs);
+	pcie->base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(pcie->base))
 		return PTR_ERR(pcie->base);
 
@@ -425,7 +409,7 @@ static int mt7621_pcie_parse_dt(struct mt7621_pcie *pcie)
 
 		slot = PCI_SLOT(err);
 
-		err = mt7621_pcie_parse_port(pcie, child, slot);
+		err = mt7621_pcie_parse_port(pcie, slot);
 		if (err) {
 			of_node_put(child);
 			return err;
-- 
2.25.1

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 7/7] staging: mt7621-pci: remove 'RALINK_PCI_IMBASEBAR0_ADDR' register
  2020-11-23  9:36 [PATCH 0/7] staging: mt7621-pci: update to last kernel APIs and other related minor cleanups Sergio Paracuellos
                   ` (5 preceding siblings ...)
  2020-11-23  9:36 ` [PATCH 6/7] staging: mt7621-pci: convert to use 'devm_platform_ioremap_resource' Sergio Paracuellos
@ 2020-11-23  9:36 ` Sergio Paracuellos
  6 siblings, 0 replies; 8+ messages in thread
From: Sergio Paracuellos @ 2020-11-23  9:36 UTC (permalink / raw)
  To: gregkh; +Cc: devel, neil

Register 'RALINK_PCI_IMBASEBAR0_ADDR' contains internal memory
base address for BAR0. We don't really need to write anything
there at all since its initial value contains always a desired
valid value. Hence remove register definition and related code.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
---
 drivers/staging/mt7621-pci/pci-mt7621.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c b/drivers/staging/mt7621-pci/pci-mt7621.c
index 4cdaccbcc97c..c3532bc138fb 100644
--- a/drivers/staging/mt7621-pci/pci-mt7621.c
+++ b/drivers/staging/mt7621-pci/pci-mt7621.c
@@ -68,7 +68,6 @@
 #define MT7621_NEXT_PORT		0x1000
 
 #define RALINK_PCI_BAR0SETUP_ADDR	0x0010
-#define RALINK_PCI_IMBASEBAR0_ADDR	0x0018
 #define RALINK_PCI_ID			0x0030
 #define RALINK_PCI_CLASS		0x0034
 #define RALINK_PCI_SUBID		0x0038
@@ -83,7 +82,6 @@
 #define PCIE_PORT_CLK_EN(x)		BIT(24 + (x))
 #define PCIE_PORT_LINKUP		BIT(0)
 
-#define MEMORY_BASE			0x0
 #define PERST_MODE_MASK			GENMASK(11, 10)
 #define PERST_MODE_GPIO			BIT(10)
 #define PERST_DELAY_MS			100
@@ -543,8 +541,6 @@ static void mt7621_pcie_enable_port(struct mt7621_pcie_port *port)
 	/* map 2G DDR region */
 	pcie_write(pcie, PCIE_BAR_MAP_MAX | PCIE_BAR_ENABLE,
 		   offset + RALINK_PCI_BAR0SETUP_ADDR);
-	pcie_write(pcie, MEMORY_BASE,
-		   offset + RALINK_PCI_IMBASEBAR0_ADDR);
 
 	/* configure class code and revision ID */
 	pcie_write(pcie, PCIE_CLASS_CODE | PCIE_REVISION_ID,
-- 
2.25.1

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-11-23  9:37 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-23  9:36 [PATCH 0/7] staging: mt7621-pci: update to last kernel APIs and other related minor cleanups Sergio Paracuellos
2020-11-23  9:36 ` [PATCH 1/7] staging: mt7621-pci: remove bus ranges related code Sergio Paracuellos
2020-11-23  9:36 ` [PATCH 2/7] staging: mt7621-pci: remove 'offset' with mem and io resource sizes Sergio Paracuellos
2020-11-23  9:36 ` [PATCH 3/7] staging: mt7621-pci: add comment to clarify IO resource in this driver Sergio Paracuellos
2020-11-23  9:36 ` [PATCH 4/7] staging: mt7621-pci: review 'pci_host_bridge' assigned variables Sergio Paracuellos
2020-11-23  9:36 ` [PATCH 5/7] staging: mt7621-pci: parse and prepare resources in 'mt7621_pci_parse_request_of_pci_ranges' Sergio Paracuellos
2020-11-23  9:36 ` [PATCH 6/7] staging: mt7621-pci: convert to use 'devm_platform_ioremap_resource' Sergio Paracuellos
2020-11-23  9:36 ` [PATCH 7/7] staging: mt7621-pci: remove 'RALINK_PCI_IMBASEBAR0_ADDR' register Sergio Paracuellos

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.