aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/bmips/files
diff options
context:
space:
mode:
authorÁlvaro Fernández Rojas <noltari@gmail.com>2022-05-18 22:52:06 +0200
committerÁlvaro Fernández Rojas <noltari@gmail.com>2022-05-20 12:21:03 +0200
commit6a1e7c767f197b80385f4be9ac7a4b5af27cb4ec (patch)
tree61c2f6077baf9dbdc058815d49c5f211984a3f4f /target/linux/bmips/files
parent810eac8c7ffad958345f8fd02f83636afecf7fcd (diff)
downloadupstream-6a1e7c767f197b80385f4be9ac7a4b5af27cb4ec.tar.gz
upstream-6a1e7c767f197b80385f4be9ac7a4b5af27cb4ec.tar.bz2
upstream-6a1e7c767f197b80385f4be9ac7a4b5af27cb4ec.zip
bmips: add linux v5.15 support
Build system: x86_64 Build-tested: generic, nand Run-tested: generic/AR-5387un, nand/VR-3032u Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Diffstat (limited to 'target/linux/bmips/files')
-rw-r--r--target/linux/bmips/files/arch/mips/bmips/ath9k-fixup.c8
-rw-r--r--target/linux/bmips/files/drivers/pci/controller/pci-bcm6348.c9
-rw-r--r--target/linux/bmips/files/drivers/pci/controller/pcie-bcm6318.c11
-rw-r--r--target/linux/bmips/files/drivers/pci/controller/pcie-bcm6328.c11
4 files changed, 35 insertions, 4 deletions
diff --git a/target/linux/bmips/files/arch/mips/bmips/ath9k-fixup.c b/target/linux/bmips/files/arch/mips/bmips/ath9k-fixup.c
index fc03416507..03ebd20fa7 100644
--- a/target/linux/bmips/files/arch/mips/bmips/ath9k-fixup.c
+++ b/target/linux/bmips/files/arch/mips/bmips/ath9k-fixup.c
@@ -46,6 +46,7 @@ static void ath9k_pci_fixup(struct pci_dev *dev)
u32 bar0;
u32 val;
unsigned i;
+ int rc;
for (i = 0; i < ath9k_num_fixups; i++) {
if (ath9k_fixups[i]->pci_dev != PCI_SLOT(dev->devfn))
@@ -74,8 +75,11 @@ static void ath9k_pci_fixup(struct pci_dev *dev)
return;
}
- if (bridge)
- pci_enable_device(bridge);
+ if (bridge) {
+ rc = pci_enable_device(bridge);
+ if (rc < 0)
+ pr_err("pci %s: bridge enable error\n", pci_name(dev));
+ }
pci_read_config_dword(dev, PCI_BASE_ADDRESS_0, &bar0);
pci_read_config_dword(dev, PCI_BASE_ADDRESS_0, &bar0);
diff --git a/target/linux/bmips/files/drivers/pci/controller/pci-bcm6348.c b/target/linux/bmips/files/drivers/pci/controller/pci-bcm6348.c
index c1d3bde5df..085cc30eba 100644
--- a/target/linux/bmips/files/drivers/pci/controller/pci-bcm6348.c
+++ b/target/linux/bmips/files/drivers/pci/controller/pci-bcm6348.c
@@ -21,6 +21,7 @@
#include <linux/pci.h>
#include <linux/reset.h>
#include <linux/types.h>
+#include <linux/version.h>
#include <linux/vmalloc.h>
#include "../pci.h"
@@ -346,7 +347,9 @@ static struct pci_controller bcm6348_pci_controller = {
.pci_ops = &bcm6348_pci_ops,
.io_resource = &bcm6348_pci_io_resource,
.mem_resource = &bcm6348_pci_mem_resource,
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5,13,0)
.busn_resource = &bcm6348_pci_busn_resource,
+#endif
};
#ifdef CONFIG_CARDBUS
@@ -729,6 +732,9 @@ static int bcm6348_pci_probe(struct platform_device *pdev)
struct device_node *np = dev->of_node;
struct bcm6348_pci *priv = &bcm6348_pci;
struct resource *res;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,13,0)
+ LIST_HEAD(resources);
+#endif
of_pci_check_probe_only();
@@ -771,6 +777,9 @@ static int bcm6348_pci_probe(struct platform_device *pdev)
return -EINVAL;
of_pci_parse_bus_range(np, &bcm6348_pci_busn_resource);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,13,0)
+ pci_add_resource(&resources, &bcm6348_pci_busn_resource);
+#endif
/*
* Configuration accesses are done through IO space, remap 4
diff --git a/target/linux/bmips/files/drivers/pci/controller/pcie-bcm6318.c b/target/linux/bmips/files/drivers/pci/controller/pcie-bcm6318.c
index 1df67b8389..21d8e50063 100644
--- a/target/linux/bmips/files/drivers/pci/controller/pcie-bcm6318.c
+++ b/target/linux/bmips/files/drivers/pci/controller/pcie-bcm6318.c
@@ -19,6 +19,7 @@
#include <linux/pci.h>
#include <linux/reset.h>
#include <linux/types.h>
+#include <linux/version.h>
#include <linux/vmalloc.h>
#include "../pci.h"
@@ -168,7 +169,7 @@ static int bcm6318_pcie_can_access(struct pci_bus *bus, int devfn)
if (PCI_SLOT(devfn) == 0)
return __raw_readl(priv->base + PCIE_DLSTATUS_REG)
& DLSTATUS_PHYLINKUP;
- /* else, fall through */
+ fallthrough;
default:
return false;
}
@@ -226,7 +227,9 @@ static struct pci_controller bcm6318_pcie_controller = {
.pci_ops = &bcm6318_pcie_ops,
.io_resource = &bcm6318_pcie_io_resource,
.mem_resource = &bcm6318_pcie_mem_resource,
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5,13,0)
.busn_resource = &bcm6318_pcie_busn_resource,
+#endif
};
static void bcm6318_pcie_reset(struct bcm6318_pcie *priv)
@@ -305,6 +308,9 @@ static int bcm6318_pcie_probe(struct platform_device *pdev)
struct bcm6318_pcie *priv = &bcm6318_pcie;
struct resource *res;
int ret;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,13,0)
+ LIST_HEAD(resources);
+#endif
of_pci_check_probe_only();
@@ -370,6 +376,9 @@ static int bcm6318_pcie_probe(struct platform_device *pdev)
return -EINVAL;
of_pci_parse_bus_range(np, &bcm6318_pcie_busn_resource);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,13,0)
+ pci_add_resource(&resources, &bcm6318_pcie_busn_resource);
+#endif
bcm6318_pcie_reset(priv);
bcm6318_pcie_setup(priv);
diff --git a/target/linux/bmips/files/drivers/pci/controller/pcie-bcm6328.c b/target/linux/bmips/files/drivers/pci/controller/pcie-bcm6328.c
index 4c0d3723b8..4c032cf3d9 100644
--- a/target/linux/bmips/files/drivers/pci/controller/pcie-bcm6328.c
+++ b/target/linux/bmips/files/drivers/pci/controller/pcie-bcm6328.c
@@ -23,6 +23,7 @@
#include <linux/reset.h>
#include <linux/regmap.h>
#include <linux/types.h>
+#include <linux/version.h>
#include <linux/vmalloc.h>
#include "../pci.h"
@@ -151,7 +152,7 @@ static int bcm6328_pcie_can_access(struct pci_bus *bus, int devfn)
if (PCI_SLOT(devfn) == 0)
return __raw_readl(priv->base + PCIE_DLSTATUS_REG)
& DLSTATUS_PHYLINKUP;
- /* else, fall through */
+ fallthrough;
default:
return false;
}
@@ -209,7 +210,9 @@ static struct pci_controller bcm6328_pcie_controller = {
.pci_ops = &bcm6328_pcie_ops,
.io_resource = &bcm6328_pcie_io_resource,
.mem_resource = &bcm6328_pcie_mem_resource,
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5,13,0)
.busn_resource = &bcm6328_pcie_busn_resource,
+#endif
};
static void bcm6328_pcie_reset(struct bcm6328_pcie *priv)
@@ -294,6 +297,9 @@ static int bcm6328_pcie_probe(struct platform_device *pdev)
struct resource *res;
unsigned int i;
int ret;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,13,0)
+ LIST_HEAD(resources);
+#endif
pm_runtime_enable(dev);
pm_runtime_no_callbacks(dev);
@@ -380,6 +386,9 @@ static int bcm6328_pcie_probe(struct platform_device *pdev)
return -EINVAL;
of_pci_parse_bus_range(np, &bcm6328_pcie_busn_resource);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,13,0)
+ pci_add_resource(&resources, &bcm6328_pcie_busn_resource);
+#endif
bcm6328_pcie_reset(priv);
bcm6328_pcie_setup(priv);