- Add upstream mvebu/DSA fixes

- Minor ARMv7 fixes
- Boot fix for aarch64 devices with 64K page size requirements (Seattle)
This commit is contained in:
Peter Robinson 2016-03-30 12:45:15 +01:00
parent ed12bfb0f6
commit 2463f3be22
6 changed files with 365 additions and 31 deletions

View File

@ -0,0 +1,32 @@
From 0eebfe3b5ae99d3a825be8e45395cea478fd83d8 Mon Sep 17 00:00:00 2001
From: Patrick Uiterwijk <patrick@puiterwijk.org>
Date: Mon, 28 Mar 2016 21:30:41 +0000
Subject: [PATCH] ARM: mvebu: Correct unit address for linksys
The USB2 port for Armada 38x is defined to be at 58000, not at
50000.
Acked-by: Imre Kaloz <kaloz@openwrt.org>
Cc: <stable@vger.kernel.org>
Fixes: 2d0a7addbd10 ("ARM: Kirkwood: Add support for many Synology NAS devices")
Signed-off-by: Patrick Uiterwijk <patrick@puiterwijk.org>
---
arch/arm/boot/dts/armada-385-linksys.dtsi | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/boot/dts/armada-385-linksys.dtsi b/arch/arm/boot/dts/armada-385-linksys.dtsi
index 3710755..85d2c37 100644
--- a/arch/arm/boot/dts/armada-385-linksys.dtsi
+++ b/arch/arm/boot/dts/armada-385-linksys.dtsi
@@ -117,7 +117,7 @@
};
/* USB part of the eSATA/USB 2.0 port */
- usb@50000 {
+ usb@58000 {
status = "okay";
};
--
2.5.0

View File

@ -0,0 +1,95 @@
From 4d1b08a69350d40e0aa14baba4797ef175295718 Mon Sep 17 00:00:00 2001
From: Peter Robinson <pbrobinson@gmail.com>
Date: Wed, 30 Mar 2016 12:40:54 +0100
Subject: [PATCH 1/2] net: dsa: mv88e6xxx: Introduce
_mv88e6xxx_phy_page_{read,write}
Add versions of the phy_page_read and _write functions to
be used in a context where the SMI mutex is held.
Tested-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Reviewed-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Signed-off-by: Patrick Uiterwijk <patrick@puiterwijk.org>
---
drivers/net/dsa/mv88e6xxx.c | 49 +++++++++++++++++++++++++++++++++------------
1 file changed, 36 insertions(+), 13 deletions(-)
diff --git a/drivers/net/dsa/mv88e6xxx.c b/drivers/net/dsa/mv88e6xxx.c
index 512c8c0..3dcfe13 100644
--- a/drivers/net/dsa/mv88e6xxx.c
+++ b/drivers/net/dsa/mv88e6xxx.c
@@ -1929,6 +1929,38 @@ static void mv88e6xxx_bridge_work(struct work_struct *work)
}
}
+static int _mv88e6xxx_phy_page_write(struct dsa_switch *ds, int port, int page,
+ int reg, int val)
+{
+ int ret;
+
+ ret = _mv88e6xxx_phy_write_indirect(ds, port, 0x16, page);
+ if (ret < 0)
+ goto restore_page_0;
+
+ ret = _mv88e6xxx_phy_write_indirect(ds, port, reg, val);
+restore_page_0:
+ _mv88e6xxx_phy_write_indirect(ds, port, 0x16, 0x0);
+
+ return ret;
+}
+
+static int _mv88e6xxx_phy_page_read(struct dsa_switch *ds, int port, int page,
+ int reg)
+{
+ int ret;
+
+ ret = _mv88e6xxx_phy_write_indirect(ds, port, 0x16, page);
+ if (ret < 0)
+ goto restore_page_0;
+
+ ret = _mv88e6xxx_phy_read_indirect(ds, port, reg);
+restore_page_0:
+ _mv88e6xxx_phy_write_indirect(ds, port, 0x16, 0x0);
+
+ return ret;
+}
+
static int mv88e6xxx_setup_port(struct dsa_switch *ds, int port)
{
struct mv88e6xxx_priv_state *ps = ds_to_priv(ds);
@@ -2383,13 +2415,9 @@ int mv88e6xxx_phy_page_read(struct dsa_switch *ds, int port, int page, int reg)
int ret;
mutex_lock(&ps->smi_mutex);
- ret = _mv88e6xxx_phy_write_indirect(ds, port, 0x16, page);
- if (ret < 0)
- goto error;
- ret = _mv88e6xxx_phy_read_indirect(ds, port, reg);
-error:
- _mv88e6xxx_phy_write_indirect(ds, port, 0x16, 0x0);
+ ret = _mv88e6xxx_phy_page_read(ds, port, page, reg);
mutex_unlock(&ps->smi_mutex);
+
return ret;
}
@@ -2400,14 +2428,9 @@ int mv88e6xxx_phy_page_write(struct dsa_switch *ds, int port, int page,
int ret;
mutex_lock(&ps->smi_mutex);
- ret = _mv88e6xxx_phy_write_indirect(ds, port, 0x16, page);
- if (ret < 0)
- goto error;
-
- ret = _mv88e6xxx_phy_write_indirect(ds, port, reg, val);
-error:
- _mv88e6xxx_phy_write_indirect(ds, port, 0x16, 0x0);
+ ret = _mv88e6xxx_phy_page_write(ds, port, page, reg, val);
mutex_unlock(&ps->smi_mutex);
+
return ret;
}
--
2.7.3

View File

@ -0,0 +1,104 @@
From a878e3fa9657646ff85468075823870fbbd5745f Mon Sep 17 00:00:00 2001
From: Peter Robinson <pbrobinson@gmail.com>
Date: Wed, 30 Mar 2016 12:41:22 +0100
Subject: [PATCH 2/2] net: dsa: mv88e6xxx: Clear the PDOWN bit on setup
Some of the vendor-specific bootloaders set up this part
of the initialization for us, so this was never added.
However, since upstream bootloaders don't initialize the
chip specifically, they leave the fiber MII's PDOWN flag
set, which means that the CPU port doesn't connect.
This patch checks whether this flag has been clear prior
by something else, and if not make us clear it.
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Patrick Uiterwijk <patrick@puiterwijk.org>
---
drivers/net/dsa/mv88e6xxx.c | 36 ++++++++++++++++++++++++++++++++++++
drivers/net/dsa/mv88e6xxx.h | 8 ++++++++
2 files changed, 44 insertions(+)
diff --git a/drivers/net/dsa/mv88e6xxx.c b/drivers/net/dsa/mv88e6xxx.c
index 3dcfe13..a4e3750 100644
--- a/drivers/net/dsa/mv88e6xxx.c
+++ b/drivers/net/dsa/mv88e6xxx.c
@@ -1961,6 +1961,25 @@ restore_page_0:
return ret;
}
+static int mv88e6xxx_power_on_serdes(struct dsa_switch *ds)
+{
+ int ret;
+
+ ret = _mv88e6xxx_phy_page_read(ds, REG_FIBER_SERDES, PAGE_FIBER_SERDES,
+ MII_BMCR);
+ if (ret < 0)
+ return ret;
+
+ if (ret & BMCR_PDOWN) {
+ ret &= ~BMCR_PDOWN;
+ ret = _mv88e6xxx_phy_page_write(ds, REG_FIBER_SERDES,
+ PAGE_FIBER_SERDES, MII_BMCR,
+ ret);
+ }
+
+ return ret;
+}
+
static int mv88e6xxx_setup_port(struct dsa_switch *ds, int port)
{
struct mv88e6xxx_priv_state *ps = ds_to_priv(ds);
@@ -2064,6 +2083,23 @@ static int mv88e6xxx_setup_port(struct dsa_switch *ds, int port)
goto abort;
}
+ /* If this port is connected to a SerDes, make sure the SerDes is not
+ * powered down.
+ */
+ if (mv88e6xxx_6352_family(ds)) {
+ ret = _mv88e6xxx_reg_read(ds, REG_PORT(port), PORT_STATUS);
+ if (ret < 0)
+ goto abort;
+ ret &= PORT_STATUS_CMODE_MASK;
+ if ((ret == PORT_STATUS_CMODE_100BASE_X) ||
+ (ret == PORT_STATUS_CMODE_1000BASE_X) ||
+ (ret == PORT_STATUS_CMODE_SGMII)) {
+ ret = mv88e6xxx_power_on_serdes(ds);
+ if (ret < 0)
+ goto abort;
+ }
+ }
+
/* Port Control 2: don't force a good FCS, set the maximum frame size to
* 10240 bytes, enable secure 802.1q tags, don't discard tagged or
* untagged frames on this port, do a destination address lookup on all
diff --git a/drivers/net/dsa/mv88e6xxx.h b/drivers/net/dsa/mv88e6xxx.h
index ca08f91..adc7f0d 100644
--- a/drivers/net/dsa/mv88e6xxx.h
+++ b/drivers/net/dsa/mv88e6xxx.h
@@ -28,6 +28,10 @@
#define SMI_CMD_OP_45_READ_DATA_INC ((3 << 10) | SMI_CMD_BUSY)
#define SMI_DATA 0x01
+/* Fiber/SERDES Registers are located at SMI address F, page 1 */
+#define REG_FIBER_SERDES 0x0f
+#define PAGE_FIBER_SERDES 0x01
+
#define REG_PORT(p) (0x10 + (p))
#define PORT_STATUS 0x00
#define PORT_STATUS_PAUSE_EN BIT(15)
@@ -45,6 +49,10 @@
#define PORT_STATUS_MGMII BIT(6) /* 6185 */
#define PORT_STATUS_TX_PAUSED BIT(5)
#define PORT_STATUS_FLOW_CTRL BIT(4)
+#define PORT_STATUS_CMODE_MASK 0x0f
+#define PORT_STATUS_CMODE_100BASE_X 0x8
+#define PORT_STATUS_CMODE_1000BASE_X 0x9
+#define PORT_STATUS_CMODE_SGMII 0xa
#define PORT_PCS_CTRL 0x01
#define PORT_PCS_CTRL_RGMII_DELAY_RXCLK BIT(15)
#define PORT_PCS_CTRL_RGMII_DELAY_TXCLK BIT(14)
--
2.7.3

View File

@ -1,8 +1,7 @@
From 59fb5b800868d984e836ab4a38d8ba1598dc675a Mon Sep 17 00:00:00 2001
From 1039ba1b91421a9018312f5901855fe03fbb0d1f Mon Sep 17 00:00:00 2001
From: Peter Robinson <pbrobinson@gmail.com>
Date: Fri, 18 Mar 2016 19:18:51 +0000
Subject: [PATCH] bcm283x: add aux uart support, extra DT bits, initial rpi3,
VC4 fixes and VC4 DT bindings
Date: Wed, 30 Mar 2016 10:32:41 +0100
Subject: [PATCH] bcm283x: Pull upstream fixes
---
.../devicetree/bindings/arm/bcm/brcm,bcm2835.txt | 4 +
@ -13,7 +12,7 @@ Subject: [PATCH] bcm283x: add aux uart support, extra DT bits, initial rpi3,
arch/arm/boot/dts/bcm2835-rpi-b-plus.dts | 4 +
arch/arm/boot/dts/bcm2835-rpi-b-rev2.dts | 4 +
arch/arm/boot/dts/bcm2835-rpi-b.dts | 4 +
arch/arm/boot/dts/bcm2835-rpi.dtsi | 25 +
arch/arm/boot/dts/bcm2835-rpi.dtsi | 21 +
arch/arm/boot/dts/bcm2836-rpi-2-b.dts | 4 +
arch/arm/boot/dts/bcm2837-rpi-3-b.dts | 22 +
arch/arm/boot/dts/bcm2837.dtsi | 68 +++
@ -31,7 +30,7 @@ Subject: [PATCH] bcm283x: add aux uart support, extra DT bits, initial rpi3,
drivers/tty/serial/8250/8250_bcm2835aux.c | 146 +++++
drivers/tty/serial/8250/Kconfig | 24 +
drivers/tty/serial/8250/Makefile | 1 +
26 files changed, 1365 insertions(+), 122 deletions(-)
26 files changed, 1361 insertions(+), 122 deletions(-)
create mode 100644 Documentation/devicetree/bindings/serial/brcm,bcm2835-aux-uart.txt
create mode 100644 arch/arm/boot/dts/bcm2835-rpi-a.dts
create mode 100644 arch/arm/boot/dts/bcm2837-rpi-3-b.dts
@ -178,7 +177,7 @@ index 4859e9d..8b15f9c 100644
+ hpd-gpios = <&gpio 46 GPIO_ACTIVE_HIGH>;
+};
diff --git a/arch/arm/boot/dts/bcm2835-rpi.dtsi b/arch/arm/boot/dts/bcm2835-rpi.dtsi
index 3afb9fe..40510df 100644
index 3afb9fe..b1e8145 100644
--- a/arch/arm/boot/dts/bcm2835-rpi.dtsi
+++ b/arch/arm/boot/dts/bcm2835-rpi.dtsi
@@ -1,3 +1,5 @@
@ -200,15 +199,11 @@ index 3afb9fe..40510df 100644
};
};
@@ -58,3 +66,20 @@
@@ -58,3 +66,16 @@
status = "okay";
bus-width = <4>;
};
+
+&usb {
+ power-domains = <&power RPI_POWER_DOMAIN_USB>;
+};
+
+&pwm {
+ status = "okay";
+};
@ -2151,5 +2146,5 @@ index b9b9bca..5c1869f 100644
obj-$(CONFIG_SERIAL_8250_FOURPORT) += 8250_fourport.o
obj-$(CONFIG_SERIAL_8250_ACCENT) += 8250_accent.o
--
2.5.0
2.7.3

View File

@ -0,0 +1,92 @@
From patchwork Wed Mar 30 07:46:23 2016
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: efi/arm64: don't apply MEMBLOCK_NOMAP to UEFI memory map mapping
From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
X-Patchwork-Id: 8693271
Message-Id: <1459323983-9120-1-git-send-email-ard.biesheuvel@linaro.org>
To: linux-efi@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
matt@codeblueprint.co.uk
Cc: mark.rutland@arm.com, mlangsdo@redhat.com,
Ard Biesheuvel <ard.biesheuvel@linaro.org>, leif.lindholm@linaro.org,
jeremy.linton@arm.com, msalter@redhat.com
Date: Wed, 30 Mar 2016 09:46:23 +0200
Hi Matt,
Could we queue this as a fix for v4.6 with a cc:stable for v4.5, please?
(assuming no objections from any of the cc'ees)
Thanks,
Ard.
----------8<--------------
Commit 4dffbfc48d65 ("arm64/efi: mark UEFI reserved regions as
MEMBLOCK_NOMAP") updated the mapping logic of both the RuntimeServices
regions as well as the kernel's copy of the UEFI memory map to set the
MEMBLOCK_NOMAP flag, which causes these regions to be omitted from the
kernel direct mapping, and from being covered by a struct page.
For the RuntimeServices regions, this is an obvious win, since the contents
of these regions have significance to the firmware executable code itself,
and are mapped in the EFI page tables using attributes that are described in
the UEFI memory map, and which may differ from the attributes we use for
mapping system RAM. It also prevents the contents from being modified
inadvertently, since the EFI page tables are only live during runtime
service invocations.
None of these concerns apply to the allocation that covers the UEFI memory
map, since it is entirely owned by the kernel. Setting the MEMBLOCK_NOMAP on
the region did allow us to use ioremap_cache() to map it both on arm64 and
on ARM, since the latter does not allow ioremap_cache() to be used on
regions that are covered by a struct page.
The ioremap_cache() on ARM restriction will be lifted in the v4.7 timeframe,
but in the mean time, it has been reported that commit 4dffbfc48d65 causes
a regression on 64k granule kernels. This is due to the fact that, given
the 64 KB page size, the region that we end up removing from the kernel
direct mapping is rounded up to 64 KB, and this 64 KB page frame may be
shared with the initrd when booting via GRUB (which does not align its
EFI_LOADER_DATA allocations to 64 KB like the stub does). This will crash
the kernel as soon as it tries to access the initrd.
Since the issue is specific to arm64, revert back to memblock_reserve()'ing
the UEFI memory map when running on arm64. This is a temporary fix for v4.5
and v4.6, and will be superseded in the v4.7 timeframe when we will be able
to move back to memblock_reserve() unconditionally.
Fixes: 4dffbfc48d65 ("arm64/efi: mark UEFI reserved regions as MEMBLOCK_NOMAP")
Reported-by: Mark Salter <msalter@redhat.com>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
---
drivers/firmware/efi/arm-init.c | 18 +++++++++++++++---
1 file changed, 15 insertions(+), 3 deletions(-)
diff --git a/drivers/firmware/efi/arm-init.c b/drivers/firmware/efi/arm-init.c
index aa1f743152a2..8714f8c271ba 100644
--- a/drivers/firmware/efi/arm-init.c
+++ b/drivers/firmware/efi/arm-init.c
@@ -203,7 +203,19 @@ void __init efi_init(void)
reserve_regions();
early_memunmap(memmap.map, params.mmap_size);
- memblock_mark_nomap(params.mmap & PAGE_MASK,
- PAGE_ALIGN(params.mmap_size +
- (params.mmap & ~PAGE_MASK)));
+
+ if (IS_ENABLED(CONFIG_ARM)) {
+ /*
+ * ARM currently does not allow ioremap_cache() to be called on
+ * memory regions that are covered by struct page. So remove the
+ * UEFI memory map from the linear mapping.
+ */
+ memblock_mark_nomap(params.mmap & PAGE_MASK,
+ PAGE_ALIGN(params.mmap_size +
+ (params.mmap & ~PAGE_MASK)));
+ } else {
+ memblock_reserve(params.mmap & PAGE_MASK,
+ PAGE_ALIGN(params.mmap_size +
+ (params.mmap & ~PAGE_MASK)));
+ }
}

View File

@ -497,33 +497,44 @@ Source5005: kbuild-AFTER_LINK.patch
# Standalone patches
# http://www.spinics.net/lists/netdev/msg369442.html
Patch452: revert-stmmac-Fix-eth0-No-PHY-found-regression.patch
Patch453: stmmac-fix-MDIO-settings.patch
Patch420: arm64-avoid-needing-console-to-enable-serial-console.patch
Patch454: bcm283x-add-aux-uart-support-extra-DT-bits-initial-r.patch
Patch455: arm64-avoid-needing-console-to-enable-serial-console.patch
Patch456: arm64-acpi-drop-expert-patch.patch
# http://patchwork.ozlabs.org/patch/587554/
Patch457: ARM-tegra-usb-no-reset.patch
Patch458: ARM-mvebu-change-order-of-ethernet-DT-nodes-on-Armada-38x.patch
Patch421: arm64-acpi-drop-expert-patch.patch
# http://www.spinics.net/lists/arm-kernel/msg490981.html
Patch459: geekbox-v4-device-tree-support.patch
Patch422: geekbox-v4-device-tree-support.patch
# http://www.spinics.net/lists/arm-kernel/msg483898.html
Patch460: Initial-AllWinner-A64-and-PINE64-support.patch
Patch423: Initial-AllWinner-A64-and-PINE64-support.patch
# http://www.spinics.net/lists/arm-kernel/msg493431.html
Patch424: efi-arm64-don-t-apply-MEMBLOCK_NOMAP-to-UEFI-memory-map-mapping.patch
# http://patchwork.ozlabs.org/patch/587554/
Patch430: ARM-tegra-usb-no-reset.patch
Patch431: arm-i.MX6-Utilite-device-dtb.patch
# http://www.spinics.net/lists/linux-tegra/msg25152.html
Patch461: Fix-tegra-to-use-stdout-path-for-serial-console.patch
Patch432: Fix-tegra-to-use-stdout-path-for-serial-console.patch
Patch463: arm-i.MX6-Utilite-device-dtb.patch
Patch433: bcm283x-Pull-upstream-fixes.patch
Patch465: lib-cpumask-Make-CPUMASK_OFFSTACK-usable-without-deb.patch
# http://www.spinics.net/lists/netdev/msg369442.html
Patch434: revert-stmmac-Fix-eth0-No-PHY-found-regression.patch
Patch435: stmmac-fix-MDIO-settings.patch
Patch436: ARM-mvebu-change-order-of-ethernet-DT-nodes-on-Armada-38x.patch
# mvebu usb fixes http://www.spinics.net/lists/arm-kernel/msg493305.html
Patch437: 0001-ARM-mvebu-Correct-unit-address-for-linksys.patch
# mvebu DSA switch fixes
# http://www.spinics.net/lists/netdev/msg370841.html http://www.spinics.net/lists/netdev/msg370842.html
Patch438: 0001-net-dsa-mv88e6xxx-Introduce-_mv88e6xxx_phy_page_-rea.patch
Patch439: 0002-net-dsa-mv88e6xxx-Clear-the-PDOWN-bit-on-setup.patch
Patch460: lib-cpumask-Make-CPUMASK_OFFSTACK-usable-without-deb.patch
Patch466: input-kill-stupid-messages.patch
@ -2195,6 +2206,11 @@ fi
#
#
%changelog
* Wed Mar 30 2016 Peter Robinson <pbrobinson@fedoraproject.org>
- Add upstream mvebu/DSA fixes
- Minor ARMv7 fixes
- Boot fix for aarch64 devices with 64K page size requirements (Seattle)
* Tue Mar 29 2016 Josh Boyer <jwboyer@fedoraproject.org>
- CVE-2016-3157 xen: priv escalation on 64bit PV domains with io port access (rhbz 1315711 1321948)