mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 10:00:17 +00:00
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 <phil@raspberrypi.org>
This commit is contained in:
@@ -5,17 +5,20 @@
|
|||||||
|
|
||||||
#include <linux/init.h>
|
#include <linux/init.h>
|
||||||
#include <linux/irqchip.h>
|
#include <linux/irqchip.h>
|
||||||
|
#include <linux/mm.h>
|
||||||
#include <linux/of_address.h>
|
#include <linux/of_address.h>
|
||||||
#include <linux/of_fdt.h>
|
#include <linux/of_fdt.h>
|
||||||
#include <asm/system_info.h>
|
#include <asm/system_info.h>
|
||||||
|
|
||||||
#include <asm/mach/arch.h>
|
#include <asm/mach/arch.h>
|
||||||
#include <asm/mach/map.h>
|
#include <asm/mach/map.h>
|
||||||
|
#include <asm/memory.h>
|
||||||
|
#include <asm/pgtable.h>
|
||||||
|
|
||||||
#include "platsmp.h"
|
#include "platsmp.h"
|
||||||
|
|
||||||
#define BCM2835_USB_VIRT_BASE 0xf0980000
|
#define BCM2835_USB_VIRT_BASE (VMALLOC_START)
|
||||||
#define BCM2835_USB_VIRT_MPHI 0xf0006000
|
#define BCM2835_USB_VIRT_MPHI (VMALLOC_START + 0x10000)
|
||||||
|
|
||||||
static void __init bcm2835_init(void)
|
static void __init bcm2835_init(void)
|
||||||
{
|
{
|
||||||
@@ -74,20 +77,26 @@ static int __init bcm2835_map_usb(unsigned long node, const char *uname,
|
|||||||
|
|
||||||
static void __init bcm2835_map_io(void)
|
static void __init bcm2835_map_io(void)
|
||||||
{
|
{
|
||||||
const __be32 *ranges;
|
const __be32 *ranges, *address_cells;
|
||||||
|
unsigned long root, addr_cells;
|
||||||
int soc, len;
|
int soc, len;
|
||||||
unsigned long p2b_offset;
|
unsigned long p2b_offset;
|
||||||
|
|
||||||
debug_ll_io_init();
|
debug_ll_io_init();
|
||||||
|
|
||||||
|
root = of_get_flat_dt_root();
|
||||||
/* Find out how to map bus to physical address first from soc/ranges */
|
/* 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)
|
if (soc < 0)
|
||||||
return;
|
return;
|
||||||
ranges = of_get_flat_dt_prop(soc, "ranges", &len);
|
address_cells = of_get_flat_dt_prop(root, "#address-cells", &len);
|
||||||
if (!ranges || len < (sizeof(unsigned long) * 3))
|
if (!address_cells || len < (sizeof(unsigned long)))
|
||||||
return;
|
return;
|
||||||
p2b_offset = be32_to_cpu(ranges[0]) - be32_to_cpu(ranges[1]);
|
addr_cells = be32_to_cpu(address_cells[0]);
|
||||||
|
ranges = of_get_flat_dt_prop(soc, "ranges", &len);
|
||||||
|
if (!ranges || len < (sizeof(unsigned long) * (2 + addr_cells)))
|
||||||
|
return;
|
||||||
|
p2b_offset = be32_to_cpu(ranges[0]) - be32_to_cpu(ranges[addr_cells]);
|
||||||
|
|
||||||
/* Now search for bcm2708-usb node in device tree */
|
/* Now search for bcm2708-usb node in device tree */
|
||||||
of_scan_flat_dt(bcm2835_map_usb, &p2b_offset);
|
of_scan_flat_dt(bcm2835_map_usb, &p2b_offset);
|
||||||
|
|||||||
Reference in New Issue
Block a user