From 62820516a6305e4183efe0ac2d0fb994a4af17f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Wed, 19 Oct 2016 16:16:48 +0200 Subject: [PATCH] bcm270x: Drop NEED_MACH_MEMORY_H and use DT dma-ranges MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Drop NEED_MACH_MEMORY_H and use dma-ranges from the Device Tree to get the bus address, like ARCH_BCM2835 does. This means that we go from this: arch/arm/mach-bcm270x/include/mach/memory.h: define __virt_to_bus(x) ((x) + (BUS_OFFSET - PAGE_OFFSET)) define __bus_to_virt(x) ((x) - (BUS_OFFSET - PAGE_OFFSET)) define __pfn_to_bus(x) (__pfn_to_phys(x) + BUS_OFFSET) define __bus_to_pfn(x) __phys_to_pfn((x) - BUS_OFFSET To this: arch/arm/include/asm/memory.h: define __virt_to_bus __virt_to_phys define __bus_to_virt __phys_to_virt define __pfn_to_bus(x) __pfn_to_phys(x) define __bus_to_pfn(x) __phys_to_pfn(x) Drivers now have to use the DMA API to get to the bus address. Signed-off-by: Noralf Trønnes --- arch/arm/Kconfig | 2 - arch/arm/boot/dts/bcm2708.dtsi | 3 -- arch/arm/boot/dts/bcm2709.dtsi | 1 - arch/arm/mach-bcm2708/Kconfig | 8 --- arch/arm/mach-bcm2708/include/mach/memory.h | 57 --------------------- arch/arm/mach-bcm2709/Kconfig | 7 --- arch/arm/mach-bcm2709/include/mach/memory.h | 57 --------------------- 7 files changed, 135 deletions(-) delete mode 100644 arch/arm/mach-bcm2708/include/mach/memory.h delete mode 100644 arch/arm/mach-bcm2709/include/mach/memory.h diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 962d632c2af85..82cbd045d7894 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -334,7 +334,6 @@ config ARCH_BCM2708 select CLKSRC_OF if OF select HAVE_SCHED_CLOCK select NEED_MACH_GPIO_H - select NEED_MACH_MEMORY_H select COMMON_CLK select ARCH_HAS_CPUFREQ select GENERIC_CLOCKEVENTS @@ -354,7 +353,6 @@ config ARCH_BCM2709 select ARM_AMBA select MIGHT_HAVE_CACHE_L2X0 select HAVE_SCHED_CLOCK - select NEED_MACH_MEMORY_H select COMMON_CLK select ARCH_HAS_CPUFREQ select GENERIC_CLOCKEVENTS diff --git a/arch/arm/boot/dts/bcm2708.dtsi b/arch/arm/boot/dts/bcm2708.dtsi index 1bd2a707ef5c0..663843965027d 100644 --- a/arch/arm/boot/dts/bcm2708.dtsi +++ b/arch/arm/boot/dts/bcm2708.dtsi @@ -7,9 +7,6 @@ model = "BCM2708"; soc { - ranges = <0x7e000000 0x20000000 0x01000000>; - /delete-property/ dma-ranges; - timer@7e003000 { compatible = "brcm,bcm2835-system-timer"; reg = <0x7e003000 0x1000>; diff --git a/arch/arm/boot/dts/bcm2709.dtsi b/arch/arm/boot/dts/bcm2709.dtsi index 757d0053c1c07..b1d82f9026d02 100644 --- a/arch/arm/boot/dts/bcm2709.dtsi +++ b/arch/arm/boot/dts/bcm2709.dtsi @@ -9,7 +9,6 @@ soc { ranges = <0x7e000000 0x3f000000 0x01000000>, <0x40000000 0x40000000 0x00040000>; - /delete-property/ dma-ranges; syscon@40000000 { compatible = "brcm,bcm2836-arm-local", "syscon"; diff --git a/arch/arm/mach-bcm2708/Kconfig b/arch/arm/mach-bcm2708/Kconfig index e93df839ab8c6..265c3fb90f3de 100644 --- a/arch/arm/mach-bcm2708/Kconfig +++ b/arch/arm/mach-bcm2708/Kconfig @@ -3,7 +3,6 @@ menu "Broadcom BCM2708 Implementations" config MACH_BCM2708 bool "Broadcom BCM2708 Development Platform" - select NEED_MACH_MEMORY_H select CPU_V6 select USE_OF select ARCH_REQUIRE_GPIOLIB @@ -12,11 +11,4 @@ config MACH_BCM2708 help Include support for the Broadcom(R) BCM2708 platform. -config BCM2708_NOL2CACHE - bool "Videocore L2 cache disable" - depends on MACH_BCM2708 - default n - help - Do not allow ARM to use GPU's L2 cache. Requires disable_l2cache in config.txt. - endmenu diff --git a/arch/arm/mach-bcm2708/include/mach/memory.h b/arch/arm/mach-bcm2708/include/mach/memory.h deleted file mode 100644 index 7548a52dcf84a..0000000000000 --- a/arch/arm/mach-bcm2708/include/mach/memory.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * arch/arm/mach-bcm2708/include/mach/memory.h - * - * Copyright (C) 2010 Broadcom - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#ifndef __ASM_ARCH_MEMORY_H -#define __ASM_ARCH_MEMORY_H - -/* Memory overview: - - [ARMcore] <--virtual addr--> - [ARMmmu] <--physical addr--> - [GERTmap] <--bus add--> - [VCperiph] - -*/ - -/* - * Physical DRAM offset. - */ -#define BCM_PLAT_PHYS_OFFSET UL(0x00000000) -#define VC_ARMMEM_OFFSET UL(0x00000000) /* offset in VC of ARM memory */ - -#ifdef CONFIG_BCM2708_NOL2CACHE - #define _REAL_BUS_OFFSET UL(0xC0000000) /* don't use L1 or L2 caches */ -#else - #define _REAL_BUS_OFFSET UL(0x40000000) /* use L2 cache */ -#endif - -/* We're using the memory at 64M in the VideoCore for Linux - this adjustment - * will provide the offset into this area as well as setting the bits that - * stop the L1 and L2 cache from being used - * - * WARNING: this only works because the ARM is given memory at a fixed location - * (ARMMEM_OFFSET) - */ -#define BUS_OFFSET (VC_ARMMEM_OFFSET + _REAL_BUS_OFFSET) -#define __virt_to_bus(x) ((x) + (BUS_OFFSET - PAGE_OFFSET)) -#define __bus_to_virt(x) ((x) - (BUS_OFFSET - PAGE_OFFSET)) -#define __pfn_to_bus(x) (__pfn_to_phys(x) + (BUS_OFFSET - BCM_PLAT_PHYS_OFFSET)) -#define __bus_to_pfn(x) __phys_to_pfn((x) - (BUS_OFFSET - BCM_PLAT_PHYS_OFFSET)) - -#endif diff --git a/arch/arm/mach-bcm2709/Kconfig b/arch/arm/mach-bcm2709/Kconfig index 643b4b984512a..41f407ac1db3a 100644 --- a/arch/arm/mach-bcm2709/Kconfig +++ b/arch/arm/mach-bcm2709/Kconfig @@ -6,11 +6,4 @@ config MACH_BCM2709 help Include support for the Broadcom(R) BCM2709 platform. -config BCM2708_NOL2CACHE - bool "Videocore L2 cache disable" - depends on MACH_BCM2709 - default y - help - Do not allow ARM to use GPU's L2 cache. Requires disable_l2cache in config.txt. - endmenu diff --git a/arch/arm/mach-bcm2709/include/mach/memory.h b/arch/arm/mach-bcm2709/include/mach/memory.h deleted file mode 100644 index 7548a52dcf84a..0000000000000 --- a/arch/arm/mach-bcm2709/include/mach/memory.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * arch/arm/mach-bcm2708/include/mach/memory.h - * - * Copyright (C) 2010 Broadcom - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#ifndef __ASM_ARCH_MEMORY_H -#define __ASM_ARCH_MEMORY_H - -/* Memory overview: - - [ARMcore] <--virtual addr--> - [ARMmmu] <--physical addr--> - [GERTmap] <--bus add--> - [VCperiph] - -*/ - -/* - * Physical DRAM offset. - */ -#define BCM_PLAT_PHYS_OFFSET UL(0x00000000) -#define VC_ARMMEM_OFFSET UL(0x00000000) /* offset in VC of ARM memory */ - -#ifdef CONFIG_BCM2708_NOL2CACHE - #define _REAL_BUS_OFFSET UL(0xC0000000) /* don't use L1 or L2 caches */ -#else - #define _REAL_BUS_OFFSET UL(0x40000000) /* use L2 cache */ -#endif - -/* We're using the memory at 64M in the VideoCore for Linux - this adjustment - * will provide the offset into this area as well as setting the bits that - * stop the L1 and L2 cache from being used - * - * WARNING: this only works because the ARM is given memory at a fixed location - * (ARMMEM_OFFSET) - */ -#define BUS_OFFSET (VC_ARMMEM_OFFSET + _REAL_BUS_OFFSET) -#define __virt_to_bus(x) ((x) + (BUS_OFFSET - PAGE_OFFSET)) -#define __bus_to_virt(x) ((x) - (BUS_OFFSET - PAGE_OFFSET)) -#define __pfn_to_bus(x) (__pfn_to_phys(x) + (BUS_OFFSET - BCM_PLAT_PHYS_OFFSET)) -#define __bus_to_pfn(x) __phys_to_pfn((x) - (BUS_OFFSET - BCM_PLAT_PHYS_OFFSET)) - -#endif