From 672a8cd6ba72820f24a02dd237edaec3cd8973c5 Mon Sep 17 00:00:00 2001 From: Luka Perkov Date: Wed, 30 Oct 2013 23:31:26 +0000 Subject: imx6: update patches Changes include PCI fixes and various upstream pending patches. Signed-off-by: Luka Perkov SVN-Revision: 38624 --- .../0029-pfuze100-allow-misprogrammed-id.patch | 20 ------- ...regulator-pfuze100-allow-misprogrammed-ID.patch | 32 ++++++++++ ...0034-PCI-imx6-add-support-for-legacy-irqs.patch | 43 ++++++++++++++ .../0034-PCI-imx6-swizzle-interrupts.patch | 26 -------- .../0050-sky2-allow-mac-to-come-from-dt.patch | 69 ++++++++++++++++++++++ .../imx6/patches-3.10/020-marvell-sky2-macdt.patch | 57 ------------------ 6 files changed, 144 insertions(+), 103 deletions(-) delete mode 100644 target/linux/imx6/patches-3.10/0029-pfuze100-allow-misprogrammed-id.patch create mode 100644 target/linux/imx6/patches-3.10/0029-regulator-pfuze100-allow-misprogrammed-ID.patch create mode 100644 target/linux/imx6/patches-3.10/0034-PCI-imx6-add-support-for-legacy-irqs.patch delete mode 100644 target/linux/imx6/patches-3.10/0034-PCI-imx6-swizzle-interrupts.patch create mode 100644 target/linux/imx6/patches-3.10/0050-sky2-allow-mac-to-come-from-dt.patch delete mode 100644 target/linux/imx6/patches-3.10/020-marvell-sky2-macdt.patch (limited to 'target/linux/imx6/patches-3.10') diff --git a/target/linux/imx6/patches-3.10/0029-pfuze100-allow-misprogrammed-id.patch b/target/linux/imx6/patches-3.10/0029-pfuze100-allow-misprogrammed-id.patch deleted file mode 100644 index a9399a9297..0000000000 --- a/target/linux/imx6/patches-3.10/0029-pfuze100-allow-misprogrammed-id.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- a/drivers/regulator/pfuze100-regulator.c -+++ b/drivers/regulator/pfuze100-regulator.c -@@ -308,9 +308,14 @@ static int pfuze_identify(struct pfuze_c - if (ret) - return ret; - -- if (value & 0x0f) { -- dev_warn(pfuze_chip->dev, "Illegal ID: %x\n", value); -- return -ENODEV; -+ switch (value & 0xf) { -+ case 0x0: -+ /* Freescale misprogrammed 1-3% of parts prior to week 8 of 2013 as ID=8 */ -+ case 0x8: -+ break; -+ default: -+ dev_warn(pfuze_chip->dev, "Illegal ID: %x\n", value); -+ return -ENODEV; - } - - ret = regmap_read(pfuze_chip->regmap, PFUZE100_REVID, &value); diff --git a/target/linux/imx6/patches-3.10/0029-regulator-pfuze100-allow-misprogrammed-ID.patch b/target/linux/imx6/patches-3.10/0029-regulator-pfuze100-allow-misprogrammed-ID.patch new file mode 100644 index 0000000000..8c0a92bb7a --- /dev/null +++ b/target/linux/imx6/patches-3.10/0029-regulator-pfuze100-allow-misprogrammed-ID.patch @@ -0,0 +1,32 @@ +From: Tim Harvey +Subject: [PATCH] regulator: pfuze100: allow misprogrammed ID + +prior to week 08 of 2013 Freescale misprogrammed between 1 and 3% of +PFUZE1000 parts with a ID=0x8 instead of the expected ID=0x0 + +Signed-off-by: Tim Harvey +--- + drivers/regulator/pfuze100-regulator.c | 12 +++++++++--- + 1 file changed, 9 insertions(+), 3 deletions(-) + +--- a/drivers/regulator/pfuze100-regulator.c ++++ b/drivers/regulator/pfuze100-regulator.c +@@ -308,9 +308,15 @@ static int pfuze_identify(struct pfuze_c + if (ret) + return ret; + +- if (value & 0x0f) { +- dev_warn(pfuze_chip->dev, "Illegal ID: %x\n", value); +- return -ENODEV; ++ switch (value & 0x0f) { ++ /* Freescale misprogrammed 1-3% of parts prior to week 8 of 2013 as ID=8 */ ++ case 0x8: ++ dev_info(pfuze_chip->dev, "Assuming misprogrammed ID=0x8"); ++ case 0x0: ++ break; ++ default: ++ dev_warn(pfuze_chip->dev, "Illegal ID: %x\n", value); ++ return -ENODEV; + } + + ret = regmap_read(pfuze_chip->regmap, PFUZE100_REVID, &value); diff --git a/target/linux/imx6/patches-3.10/0034-PCI-imx6-add-support-for-legacy-irqs.patch b/target/linux/imx6/patches-3.10/0034-PCI-imx6-add-support-for-legacy-irqs.patch new file mode 100644 index 0000000000..1f81e4338c --- /dev/null +++ b/target/linux/imx6/patches-3.10/0034-PCI-imx6-add-support-for-legacy-irqs.patch @@ -0,0 +1,43 @@ +From: Tim Harvey +Subject: [PATCH] PCI: imx6: add support for legacy irqs + +The i.MX6 supports legacy IRQ's via 155,154,153,152. When devices +are behind a PCIe-to-PCIe switch (at least for the TI XIO2001) the +mapping is reversed from when they are behind a PCIe switch. + +This patch still needs some review and clarification before going +upstream. +--- + drivers/pci/host/pcie-designware.c | 21 ++++++++++++++++++++- + 1 file changed, 20 insertions(+), 1 deletion(-) + +--- a/drivers/pci/host/pcie-designware.c ++++ b/drivers/pci/host/pcie-designware.c +@@ -447,7 +447,26 @@ int dw_pcie_map_irq(const struct pci_dev + { + struct pcie_port *pp = sys_to_pcie(dev->bus->sysdata); + +- return pp->irq; ++ /* TI XIO2001 PCIe-to-PCI bridge IRQs are flipped it seems */ ++ if ( dev->bus && dev->bus->self ++ && (dev->bus->self->vendor == 0x104c) ++ && (dev->bus->self->device == 0x8240)) { ++ switch (pin) { ++ case 1: return pp->irq - 3; ++ case 2: return pp->irq - 2; ++ case 3: return pp->irq - 1; ++ case 4: return pp->irq; ++ default: return -1; ++ } ++ } else { ++ switch (pin) { ++ case 1: return pp->irq; ++ case 2: return pp->irq - 1; ++ case 3: return pp->irq - 2; ++ case 4: return pp->irq - 3; ++ default: return -1; ++ } ++ } + } + + static struct hw_pci dw_pci = { diff --git a/target/linux/imx6/patches-3.10/0034-PCI-imx6-swizzle-interrupts.patch b/target/linux/imx6/patches-3.10/0034-PCI-imx6-swizzle-interrupts.patch deleted file mode 100644 index d716fe4b6e..0000000000 --- a/target/linux/imx6/patches-3.10/0034-PCI-imx6-swizzle-interrupts.patch +++ /dev/null @@ -1,26 +0,0 @@ -From: Tim Harvey -Subject: [PATCH 1/5] PCI: imx6: swizzle interrupts - - -Signed-off-by: Tim Harvey ---- - drivers/pci/host/pcie-designware.c | 8 +++++++- - 1 file changed, 7 insertions(+), 1 deletion(-) - ---- a/drivers/pci/host/pcie-designware.c -+++ b/drivers/pci/host/pcie-designware.c -@@ -447,7 +447,13 @@ int dw_pcie_map_irq(const struct pci_dev - { - struct pcie_port *pp = sys_to_pcie(dev->bus->sysdata); - -- return pp->irq; -+ switch (pin) { -+ case 1: return pp->irq - 3; -+ case 2: return pp->irq - 2; -+ case 3: return pp->irq - 1; -+ case 4: return pp->irq; -+ default: return -1; -+ } - } - - static struct hw_pci dw_pci = { diff --git a/target/linux/imx6/patches-3.10/0050-sky2-allow-mac-to-come-from-dt.patch b/target/linux/imx6/patches-3.10/0050-sky2-allow-mac-to-come-from-dt.patch new file mode 100644 index 0000000000..54743a5d99 --- /dev/null +++ b/target/linux/imx6/patches-3.10/0050-sky2-allow-mac-to-come-from-dt.patch @@ -0,0 +1,69 @@ +From: Tim Harvey +Subject: [PATCH] sky2: allow mac to come from dt + +The driver reads the mac address from the device registers which would +need to have been programmed by the bootloader. This patch adds +the ability to pull the mac from devicetree via the aliases/sky2 node. + +Signed-off-by: Tim Harvey +--- + drivers/net/ethernet/marvell/sky2.c | 33 ++++++++++++++++++++++++++++++++- + 1 file changed, 32 insertions(+), 1 deletion(-) + +--- a/drivers/net/ethernet/marvell/sky2.c ++++ b/drivers/net/ethernet/marvell/sky2.c +@@ -44,6 +44,8 @@ + #include + #include + #include ++#include ++#include + + #include + +@@ -4748,6 +4750,7 @@ static struct net_device *sky2_init_netd + { + struct sky2_port *sky2; + struct net_device *dev = alloc_etherdev(sizeof(*sky2)); ++ unsigned char *iap, tmpaddr[ETH_ALEN]; + + if (!dev) + return NULL; +@@ -4802,8 +4805,36 @@ static struct net_device *sky2_init_netd + + dev->features |= dev->hw_features; + ++ /* ++ * try to get mac address in the following order: ++ * 1) from device tree data ++ * 2) from internal registers set by bootloader ++ */ ++ iap = NULL; ++ if (IS_ENABLED(CONFIG_OF)) { ++ struct device_node *np; ++ np = of_find_node_by_path("/aliases"); ++ if (np) { ++ const char *path = of_get_property(np, "sky2", NULL); ++ if (path) ++ np = of_find_node_by_path(path); ++ if (np) ++ path = of_get_mac_address(np); ++ if (path) ++ iap = (unsigned char *) path; ++ } ++ } ++ ++ /* ++ * 2) mac registers set by bootloader ++ */ ++ if (!iap || !is_valid_ether_addr(iap)) { ++ memcpy_fromio(&tmpaddr, hw->regs + B2_MAC_1 + port * 8, ETH_ALEN); ++ iap = &tmpaddr[0]; ++ } ++ + /* read the mac address */ +- memcpy_fromio(dev->dev_addr, hw->regs + B2_MAC_1 + port * 8, ETH_ALEN); ++ memcpy(dev->dev_addr, iap, ETH_ALEN); + + return dev; + } diff --git a/target/linux/imx6/patches-3.10/020-marvell-sky2-macdt.patch b/target/linux/imx6/patches-3.10/020-marvell-sky2-macdt.patch deleted file mode 100644 index e1639d6223..0000000000 --- a/target/linux/imx6/patches-3.10/020-marvell-sky2-macdt.patch +++ /dev/null @@ -1,57 +0,0 @@ ---- a/drivers/net/ethernet/marvell/sky2.c -+++ b/drivers/net/ethernet/marvell/sky2.c -@@ -44,6 +44,8 @@ - #include - #include - #include -+#include -+#include - - #include - -@@ -4748,6 +4750,7 @@ static struct net_device *sky2_init_netd - { - struct sky2_port *sky2; - struct net_device *dev = alloc_etherdev(sizeof(*sky2)); -+ unsigned char *iap, tmpaddr[ETH_ALEN]; - - if (!dev) - return NULL; -@@ -4802,8 +4805,36 @@ static struct net_device *sky2_init_netd - - dev->features |= dev->hw_features; - -+ /* -+ * try to get mac address in the following order: -+ * 1) from device tree data -+ * 2) from internal registers set by bootloader -+ */ -+ iap = NULL; -+#ifdef CONFIG_OF -+ struct device_node *np; -+ np = of_find_node_by_path("/aliases"); -+ if (np) { -+ const char *path = of_get_property(np, "sky2", NULL); -+ if (path) -+ np = of_find_node_by_path(path); -+ if (np) -+ path = of_get_mac_address(np); -+ if (path) -+ iap = (unsigned char *) path; -+ } -+#endif -+ -+ /* -+ * 2) mac registers set by bootloader -+ */ -+ if (!iap || !is_valid_ether_addr(iap)) { -+ memcpy_fromio(&tmpaddr, hw->regs + B2_MAC_1 + port * 8, ETH_ALEN); -+ iap = &tmpaddr[0]; -+ } -+ - /* read the mac address */ -- memcpy_fromio(dev->dev_addr, hw->regs + B2_MAC_1 + port * 8, ETH_ALEN); -+ memcpy(dev->dev_addr, iap, ETH_ALEN); - - return dev; - } -- cgit v1.2.3