From 662394fb30fdbcc89ec387918714aebee6868a9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= Date: Wed, 4 Sep 2019 19:01:23 +0200 Subject: brcm2708: update to latest patches from RPi foundation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Álvaro Fernández Rojas --- ...50-0525-arm-bcm2835-Fix-FIQ-early-ioremap.patch | 73 ++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 target/linux/brcm2708/patches-4.19/950-0525-arm-bcm2835-Fix-FIQ-early-ioremap.patch (limited to 'target/linux/brcm2708/patches-4.19/950-0525-arm-bcm2835-Fix-FIQ-early-ioremap.patch') diff --git a/target/linux/brcm2708/patches-4.19/950-0525-arm-bcm2835-Fix-FIQ-early-ioremap.patch b/target/linux/brcm2708/patches-4.19/950-0525-arm-bcm2835-Fix-FIQ-early-ioremap.patch new file mode 100644 index 0000000000..48fe48b041 --- /dev/null +++ b/target/linux/brcm2708/patches-4.19/950-0525-arm-bcm2835-Fix-FIQ-early-ioremap.patch @@ -0,0 +1,73 @@ +From d04fee15737ffb8dcc7ebbb4f0a48887c6e39d71 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Wed, 20 Feb 2019 08:49:39 +0000 +Subject: [PATCH 525/782] arm: bcm2835: Fix FIQ early ioremap + +The ioremapping creates mappings within the vmalloc area. The +equivalent early function, create_mapping, now checks that the +requested explicit virtual address is between VMALLOC_START and +VMALLOC_END. As there is no reason to have any correlation between +the physical and virtual addresses, put the required mappings at +VMALLOC_START and above. + +Signed-off-by: Phil Elwell +--- + arch/arm/mach-bcm/board_bcm2835.c | 21 +++++++++++++++------ + 1 file changed, 15 insertions(+), 6 deletions(-) + +--- a/arch/arm/mach-bcm/board_bcm2835.c ++++ b/arch/arm/mach-bcm/board_bcm2835.c +@@ -14,17 +14,20 @@ + + #include + #include ++#include + #include + #include + #include + + #include + #include ++#include ++#include + + #include "platsmp.h" + +-#define BCM2835_USB_VIRT_BASE 0xf0980000 +-#define BCM2835_USB_VIRT_MPHI 0xf0006000 ++#define BCM2835_USB_VIRT_BASE (VMALLOC_START) ++#define BCM2835_USB_VIRT_MPHI (VMALLOC_START + 0x10000) + + static void __init bcm2835_init(void) + { +@@ -83,20 +86,26 @@ static int __init bcm2835_map_usb(unsign + + static void __init bcm2835_map_io(void) + { +- const __be32 *ranges; ++ const __be32 *ranges, *address_cells; ++ unsigned long root, addr_cells; + int soc, len; + unsigned long p2b_offset; + + debug_ll_io_init(); + ++ root = of_get_flat_dt_root(); + /* Find out how to map bus to physical address first from soc/ranges */ +- soc = of_get_flat_dt_subnode_by_name(of_get_flat_dt_root(), "soc"); ++ soc = of_get_flat_dt_subnode_by_name(root, "soc"); + if (soc < 0) + return; ++ address_cells = of_get_flat_dt_prop(root, "#address-cells", &len); ++ if (!address_cells || len < (sizeof(unsigned long))) ++ return; ++ addr_cells = be32_to_cpu(address_cells[0]); + ranges = of_get_flat_dt_prop(soc, "ranges", &len); +- if (!ranges || len < (sizeof(unsigned long) * 3)) ++ if (!ranges || len < (sizeof(unsigned long) * (2 + addr_cells))) + return; +- p2b_offset = be32_to_cpu(ranges[0]) - be32_to_cpu(ranges[1]); ++ p2b_offset = be32_to_cpu(ranges[0]) - be32_to_cpu(ranges[addr_cells]); + + /* Now search for bcm2708-usb node in device tree */ + of_scan_flat_dt(bcm2835_map_usb, &p2b_offset); -- cgit v1.2.3