From ed9cd08e8d3eb99f67f7a026dd00d5112bcd1b9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Wed, 19 Oct 2016 16:25:41 +0200 Subject: [PATCH 01/10] bcm270x: Remove bcm2708_reboot_mode parameter MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This isn't used anymore now that the watchdog driver does restart/poweroff. Signed-off-by: Noralf Trønnes --- arch/arm/kernel/process.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c index 0a0332cb13a747..612eb530f33fcd 100644 --- a/arch/arm/kernel/process.c +++ b/arch/arm/kernel/process.c @@ -91,16 +91,6 @@ void arch_cpu_idle_exit(void) ledtrig_cpu(CPU_LED_IDLE_END); } -char bcm2708_reboot_mode = 'h'; - -int __init reboot_setup(char *str) -{ - bcm2708_reboot_mode = str[0]; - return 1; -} - -__setup("reboot=", reboot_setup); - void __show_regs(struct pt_regs *regs) { unsigned long flags; From f63a922e514ab430cdf589faa615ede8903c13b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Wed, 19 Oct 2016 15:54:41 +0200 Subject: [PATCH 02/10] bcm270x: Remove NEED_MACH_IO_H MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit NEED_MACH_IO_H isn't necessary since we don't have PC card/PCI/ISA IO space. The __io macro is only used in the {in,out}[bwl] macros. arch/arm/include/asm/io.h will give these defaults now: define __io(a) __typesafe_io((a) & IO_SPACE_LIMIT) define IO_SPACE_LIMIT ((resource_size_t)0) This is the same as ARCH_BCM2835. Signed-off-by: Noralf Trønnes --- arch/arm/Kconfig | 1 - arch/arm/mach-bcm2708/Kconfig | 1 - arch/arm/mach-bcm2708/include/mach/io.h | 27 ------------------------- arch/arm/mach-bcm2709/include/mach/io.h | 27 ------------------------- 4 files changed, 56 deletions(-) delete mode 100644 arch/arm/mach-bcm2708/include/mach/io.h delete mode 100644 arch/arm/mach-bcm2709/include/mach/io.h diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 018ee76322d9e0..962d632c2af85c 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -355,7 +355,6 @@ config ARCH_BCM2709 select MIGHT_HAVE_CACHE_L2X0 select HAVE_SCHED_CLOCK select NEED_MACH_MEMORY_H - select NEED_MACH_IO_H select COMMON_CLK select ARCH_HAS_CPUFREQ select GENERIC_CLOCKEVENTS diff --git a/arch/arm/mach-bcm2708/Kconfig b/arch/arm/mach-bcm2708/Kconfig index 6eabe844767f7f..e93df839ab8c6c 100644 --- a/arch/arm/mach-bcm2708/Kconfig +++ b/arch/arm/mach-bcm2708/Kconfig @@ -4,7 +4,6 @@ menu "Broadcom BCM2708 Implementations" config MACH_BCM2708 bool "Broadcom BCM2708 Development Platform" select NEED_MACH_MEMORY_H - select NEED_MACH_IO_H select CPU_V6 select USE_OF select ARCH_REQUIRE_GPIOLIB diff --git a/arch/arm/mach-bcm2708/include/mach/io.h b/arch/arm/mach-bcm2708/include/mach/io.h deleted file mode 100644 index e6eb84d71006db..00000000000000 --- a/arch/arm/mach-bcm2708/include/mach/io.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - * arch/arm/mach-bcm2708/include/mach/io.h - * - * Copyright (C) 2003 ARM Limited - * - * 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_ARM_ARCH_IO_H -#define __ASM_ARM_ARCH_IO_H - -#define IO_SPACE_LIMIT 0xffffffff - -#define __io(a) __typesafe_io(a) - -#endif diff --git a/arch/arm/mach-bcm2709/include/mach/io.h b/arch/arm/mach-bcm2709/include/mach/io.h deleted file mode 100644 index e6eb84d71006db..00000000000000 --- a/arch/arm/mach-bcm2709/include/mach/io.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - * arch/arm/mach-bcm2708/include/mach/io.h - * - * Copyright (C) 2003 ARM Limited - * - * 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_ARM_ARCH_IO_H -#define __ASM_ARM_ARCH_IO_H - -#define IO_SPACE_LIMIT 0xffffffff - -#define __io(a) __typesafe_io(a) - -#endif From 8a0e2e50d2ffdac2cd9136fea47da34221ede16a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Wed, 19 Oct 2016 16:01:01 +0200 Subject: [PATCH 03/10] dwc_otg: Pass struct device to dma_alloc*() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This makes it possible to get the bus address from Device Tree. Signed-off-by: Noralf Trønnes --- .../host/dwc_common_port/dwc_common_linux.c | 19 +--- drivers/usb/host/dwc_common_port/dwc_os.h | 18 ++-- drivers/usb/host/dwc_otg/dwc_otg_hcd.c | 13 +-- drivers/usb/host/dwc_otg/dwc_otg_hcd.h | 6 ++ drivers/usb/host/dwc_otg/dwc_otg_hcd_ddma.c | 23 +++-- drivers/usb/host/dwc_otg/dwc_otg_hcd_linux.c | 2 +- drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c | 3 +- drivers/usb/host/dwc_otg/dwc_otg_pcd.c | 87 +++++++++++-------- drivers/usb/host/dwc_otg/dwc_otg_pcd.h | 7 ++ drivers/usb/host/dwc_otg/dwc_otg_pcd_if.h | 3 +- drivers/usb/host/dwc_otg/dwc_otg_pcd_intr.c | 3 +- drivers/usb/host/dwc_otg/dwc_otg_pcd_linux.c | 2 +- 12 files changed, 105 insertions(+), 81 deletions(-) diff --git a/drivers/usb/host/dwc_common_port/dwc_common_linux.c b/drivers/usb/host/dwc_common_port/dwc_common_linux.c index 46646841dda96f..0d641e6da24bee 100644 --- a/drivers/usb/host/dwc_common_port/dwc_common_linux.c +++ b/drivers/usb/host/dwc_common_port/dwc_common_linux.c @@ -337,27 +337,12 @@ void DWC_DMA_POOL_FREE(dwc_pool_t *pool, void *vaddr, void *daddr) void *__DWC_DMA_ALLOC(void *dma_ctx, uint32_t size, dwc_dma_t *dma_addr) { -#ifdef xxCOSIM /* Only works for 32-bit cosim */ - void *buf = dma_alloc_coherent(dma_ctx, (size_t)size, dma_addr, GFP_KERNEL); -#else - void *buf = dma_alloc_coherent(dma_ctx, (size_t)size, dma_addr, GFP_KERNEL | GFP_DMA32); -#endif - if (!buf) { - return NULL; - } - - memset(buf, 0, (size_t)size); - return buf; + return dma_zalloc_coherent(dma_ctx, size, dma_addr, GFP_KERNEL | GFP_DMA32); } void *__DWC_DMA_ALLOC_ATOMIC(void *dma_ctx, uint32_t size, dwc_dma_t *dma_addr) { - void *buf = dma_alloc_coherent(NULL, (size_t)size, dma_addr, GFP_ATOMIC); - if (!buf) { - return NULL; - } - memset(buf, 0, (size_t)size); - return buf; + return dma_zalloc_coherent(dma_ctx, size, dma_addr, GFP_ATOMIC); } void __DWC_DMA_FREE(void *dma_ctx, uint32_t size, void *virt_addr, dwc_dma_t dma_addr) diff --git a/drivers/usb/host/dwc_common_port/dwc_os.h b/drivers/usb/host/dwc_common_port/dwc_os.h index a2bbe232ffc3b5..9a86d299403bd1 100644 --- a/drivers/usb/host/dwc_common_port/dwc_os.h +++ b/drivers/usb/host/dwc_common_port/dwc_os.h @@ -675,9 +675,9 @@ extern void __DWC_FREE(void *mem_ctx, void *addr); #define DWC_FREE(_addr_) __DWC_FREE(NULL, _addr_) # ifdef DWC_LINUX -#define DWC_DMA_ALLOC(_size_,_dma_) __DWC_DMA_ALLOC(NULL, _size_, _dma_) -#define DWC_DMA_ALLOC_ATOMIC(_size_,_dma_) __DWC_DMA_ALLOC_ATOMIC(NULL, _size_,_dma_) -#define DWC_DMA_FREE(_size_,_virt_,_dma_) __DWC_DMA_FREE(NULL, _size_, _virt_, _dma_) +#define DWC_DMA_ALLOC(_dev, _size_, _dma_) __DWC_DMA_ALLOC(_dev, _size_, _dma_) +#define DWC_DMA_ALLOC_ATOMIC(_dev, _size_, _dma_) __DWC_DMA_ALLOC_ATOMIC(_dev, _size_, _dma_) +#define DWC_DMA_FREE(_dev, _size_,_virt_, _dma_) __DWC_DMA_FREE(_dev, _size_, _virt_, _dma_) # endif # if defined(DWC_FREEBSD) || defined(DWC_NETBSD) @@ -708,12 +708,12 @@ extern void dwc_memory_debug_report(void); #define DWC_FREE(_addr_) dwc_free_debug(NULL, _addr_, __func__, __LINE__) # ifdef DWC_LINUX -#define DWC_DMA_ALLOC(_size_,_dma_) dwc_dma_alloc_debug(NULL, _size_, \ - _dma_, __func__, __LINE__) -#define DWC_DMA_ALLOC_ATOMIC(_size_,_dma_) dwc_dma_alloc_atomic_debug(NULL, _size_, \ - _dma_, __func__, __LINE__) -#define DWC_DMA_FREE(_size_,_virt_,_dma_) dwc_dma_free_debug(NULL, _size_, \ - _virt_, _dma_, __func__, __LINE__) +#define DWC_DMA_ALLOC(_dev, _size_, _dma_) \ + dwc_dma_alloc_debug(_dev, _size_, _dma_, __func__, __LINE__) +#define DWC_DMA_ALLOC_ATOMIC(_dev, _size_, _dma_) \ + dwc_dma_alloc_atomic_debug(_dev, _size_, _dma_, __func__, __LINE__) +#define DWC_DMA_FREE(_dev, _size_, _virt_, _dma_) \ + dwc_dma_free_debug(_dev, _size_, _virt_, _dma_, __func__, __LINE__) # endif # if defined(DWC_FREEBSD) || defined(DWC_NETBSD) diff --git a/drivers/usb/host/dwc_otg/dwc_otg_hcd.c b/drivers/usb/host/dwc_otg/dwc_otg_hcd.c index 135b611abe08e1..027414bb2bf9fc 100644 --- a/drivers/usb/host/dwc_otg/dwc_otg_hcd.c +++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd.c @@ -884,6 +884,7 @@ void dwc_otg_cleanup_fiq_channel(dwc_otg_hcd_t *hcd, uint32_t num) */ static void dwc_otg_hcd_free(dwc_otg_hcd_t * dwc_otg_hcd) { + struct device *dev = dwc_otg_hcd_to_dev(dwc_otg_hcd); int i; DWC_DEBUGPL(DBG_HCD, "DWC OTG HCD FREE\n"); @@ -916,7 +917,7 @@ static void dwc_otg_hcd_free(dwc_otg_hcd_t * dwc_otg_hcd) if (dwc_otg_hcd->core_if->dma_enable) { if (dwc_otg_hcd->status_buf_dma) { - DWC_DMA_FREE(DWC_OTG_HCD_STATUS_BUF_SIZE, + DWC_DMA_FREE(dev, DWC_OTG_HCD_STATUS_BUF_SIZE, dwc_otg_hcd->status_buf, dwc_otg_hcd->status_buf_dma); } @@ -946,6 +947,7 @@ int init_hcd_usecs(dwc_otg_hcd_t *_hcd); int dwc_otg_hcd_init(dwc_otg_hcd_t * hcd, dwc_otg_core_if_t * core_if) { + struct device *dev = dwc_otg_hcd_to_dev(hcd); int retval = 0; int num_channels; int i; @@ -1041,7 +1043,7 @@ int dwc_otg_hcd_init(dwc_otg_hcd_t * hcd, dwc_otg_core_if_t * core_if) * for use as transaction bounce buffers in a 2-D array. Our access into this chunk is done by some * moderately readable array casts. */ - hcd->fiq_dmab = DWC_DMA_ALLOC((sizeof(struct fiq_dma_channel) * num_channels), &hcd->fiq_state->dma_base); + hcd->fiq_dmab = DWC_DMA_ALLOC(dev, (sizeof(struct fiq_dma_channel) * num_channels), &hcd->fiq_state->dma_base); DWC_WARN("FIQ DMA bounce buffers: virt = 0x%08x dma = 0x%08x len=%d", (unsigned int)hcd->fiq_dmab, (unsigned int)hcd->fiq_state->dma_base, sizeof(struct fiq_dma_channel) * num_channels); @@ -1092,7 +1094,7 @@ int dwc_otg_hcd_init(dwc_otg_hcd_t * hcd, dwc_otg_core_if_t * core_if) */ if (hcd->core_if->dma_enable) { hcd->status_buf = - DWC_DMA_ALLOC(DWC_OTG_HCD_STATUS_BUF_SIZE, + DWC_DMA_ALLOC(dev, DWC_OTG_HCD_STATUS_BUF_SIZE, &hcd->status_buf_dma); } else { hcd->status_buf = DWC_ALLOC(DWC_OTG_HCD_STATUS_BUF_SIZE); @@ -1187,6 +1189,7 @@ static void assign_and_init_hc(dwc_otg_hcd_t * hcd, dwc_otg_qh_t * qh) uint32_t intr_enable; unsigned long flags; gintmsk_data_t gintmsk = { .d32 = 0, }; + struct device *dev = dwc_otg_hcd_to_dev(hcd); qtd = DWC_CIRCLEQ_FIRST(&qh->qtd_list); @@ -1381,7 +1384,7 @@ static void assign_and_init_hc(dwc_otg_hcd_t * hcd, dwc_otg_qh_t * qh) buf_size = 4096; } if (!qh->dw_align_buf) { - qh->dw_align_buf = DWC_DMA_ALLOC_ATOMIC(buf_size, + qh->dw_align_buf = DWC_DMA_ALLOC_ATOMIC(dev, buf_size, &qh->dw_align_buf_dma); if (!qh->dw_align_buf) { DWC_ERROR @@ -1432,7 +1435,7 @@ static void assign_and_init_hc(dwc_otg_hcd_t * hcd, dwc_otg_qh_t * qh) fiq_fsm_spin_unlock(&hcd->fiq_state->lock); local_fiq_enable(); } - + local_irq_restore(flags); hc->qh = qh; } diff --git a/drivers/usb/host/dwc_otg/dwc_otg_hcd.h b/drivers/usb/host/dwc_otg/dwc_otg_hcd.h index 43dbed9fddbf54..4539cd7b802d3e 100644 --- a/drivers/usb/host/dwc_otg/dwc_otg_hcd.h +++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd.h @@ -41,6 +41,7 @@ #include "dwc_list.h" #include "dwc_otg_cil.h" #include "dwc_otg_fiq_fsm.h" +#include "dwc_otg_driver.h" /** @@ -613,6 +614,11 @@ struct dwc_otg_hcd { #endif }; +static inline struct device *dwc_otg_hcd_to_dev(struct dwc_otg_hcd *hcd) +{ + return &hcd->otg_dev->os_dep.platformdev->dev; +} + /** @name Transaction Execution Functions */ /** @{ */ extern dwc_otg_transaction_type_e dwc_otg_hcd_select_transactions(dwc_otg_hcd_t diff --git a/drivers/usb/host/dwc_otg/dwc_otg_hcd_ddma.c b/drivers/usb/host/dwc_otg/dwc_otg_hcd_ddma.c index ee920c4d8f4a29..126e99ab2fc43f 100644 --- a/drivers/usb/host/dwc_otg/dwc_otg_hcd_ddma.c +++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd_ddma.c @@ -75,12 +75,12 @@ static inline uint16_t frame_incr_val(dwc_otg_qh_t * qh) : qh->interval); } -static int desc_list_alloc(dwc_otg_qh_t * qh) +static int desc_list_alloc(struct device *dev, dwc_otg_qh_t * qh) { int retval = 0; qh->desc_list = (dwc_otg_host_dma_desc_t *) - DWC_DMA_ALLOC(sizeof(dwc_otg_host_dma_desc_t) * max_desc_num(qh), + DWC_DMA_ALLOC(dev, sizeof(dwc_otg_host_dma_desc_t) * max_desc_num(qh), &qh->desc_list_dma); if (!qh->desc_list) { @@ -106,10 +106,10 @@ static int desc_list_alloc(dwc_otg_qh_t * qh) } -static void desc_list_free(dwc_otg_qh_t * qh) +static void desc_list_free(struct device *dev, dwc_otg_qh_t * qh) { if (qh->desc_list) { - DWC_DMA_FREE(max_desc_num(qh), qh->desc_list, + DWC_DMA_FREE(dev, max_desc_num(qh), qh->desc_list, qh->desc_list_dma); qh->desc_list = NULL; } @@ -122,11 +122,13 @@ static void desc_list_free(dwc_otg_qh_t * qh) static int frame_list_alloc(dwc_otg_hcd_t * hcd) { + struct device *dev = dwc_otg_hcd_to_dev(hcd); int retval = 0; + if (hcd->frame_list) return 0; - hcd->frame_list = DWC_DMA_ALLOC(4 * MAX_FRLIST_EN_NUM, + hcd->frame_list = DWC_DMA_ALLOC(dev, 4 * MAX_FRLIST_EN_NUM, &hcd->frame_list_dma); if (!hcd->frame_list) { retval = -DWC_E_NO_MEMORY; @@ -140,10 +142,12 @@ static int frame_list_alloc(dwc_otg_hcd_t * hcd) static void frame_list_free(dwc_otg_hcd_t * hcd) { + struct device *dev = dwc_otg_hcd_to_dev(hcd); + if (!hcd->frame_list) return; - DWC_DMA_FREE(4 * MAX_FRLIST_EN_NUM, hcd->frame_list, hcd->frame_list_dma); + DWC_DMA_FREE(dev, 4 * MAX_FRLIST_EN_NUM, hcd->frame_list, hcd->frame_list_dma); hcd->frame_list = NULL; } @@ -321,6 +325,7 @@ static void release_channel_ddma(dwc_otg_hcd_t * hcd, dwc_otg_qh_t * qh) */ int dwc_otg_hcd_qh_init_ddma(dwc_otg_hcd_t * hcd, dwc_otg_qh_t * qh) { + struct device *dev = dwc_otg_hcd_to_dev(hcd); int retval = 0; if (qh->do_split) { @@ -328,7 +333,7 @@ int dwc_otg_hcd_qh_init_ddma(dwc_otg_hcd_t * hcd, dwc_otg_qh_t * qh) return -1; } - retval = desc_list_alloc(qh); + retval = desc_list_alloc(dev, qh); if ((retval == 0) && (qh->ep_type == UE_ISOCHRONOUS || qh->ep_type == UE_INTERRUPT)) { @@ -355,7 +360,9 @@ int dwc_otg_hcd_qh_init_ddma(dwc_otg_hcd_t * hcd, dwc_otg_qh_t * qh) */ void dwc_otg_hcd_qh_free_ddma(dwc_otg_hcd_t * hcd, dwc_otg_qh_t * qh) { - desc_list_free(qh); + struct device *dev = dwc_otg_hcd_to_dev(hcd); + + desc_list_free(dev, qh); /* * Channel still assigned due to some reasons. diff --git a/drivers/usb/host/dwc_otg/dwc_otg_hcd_linux.c b/drivers/usb/host/dwc_otg/dwc_otg_hcd_linux.c index 2ceed4212980f0..74cd5fa54aed52 100644 --- a/drivers/usb/host/dwc_otg/dwc_otg_hcd_linux.c +++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd_linux.c @@ -517,6 +517,7 @@ int hcd_init(dwc_bus_dev_t *_dev) ((struct wrapper_priv_data *)(hcd->hcd_priv))->dwc_otg_hcd = dwc_otg_hcd; otg_dev->hcd = dwc_otg_hcd; + otg_dev->hcd->otg_dev = otg_dev; if (dwc_otg_hcd_init(dwc_otg_hcd, otg_dev->core_if)) { goto error2; @@ -531,7 +532,6 @@ int hcd_init(dwc_bus_dev_t *_dev) } } - otg_dev->hcd->otg_dev = otg_dev; hcd->self.otg_port = dwc_otg_hcd_otg_port(dwc_otg_hcd); #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33) //don't support for LM(with 2.6.20.1 kernel) #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35) //version field absent later diff --git a/drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c b/drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c index 3b2a60763b92fb..c2dff94e8e6edd 100644 --- a/drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c +++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c @@ -59,6 +59,7 @@ void dwc_otg_hcd_qh_free(dwc_otg_hcd_t * hcd, dwc_otg_qh_t * qh) uint32_t buf_size = 0; uint8_t *align_buf_virt = NULL; dwc_dma_t align_buf_dma; + struct device *dev = dwc_otg_hcd_to_dev(hcd); /* Free each QTD in the QTD list */ DWC_SPINLOCK_IRQSAVE(hcd->lock, &flags); @@ -82,7 +83,7 @@ void dwc_otg_hcd_qh_free(dwc_otg_hcd_t * hcd, dwc_otg_qh_t * qh) DWC_FREE(qh); DWC_SPINUNLOCK_IRQRESTORE(hcd->lock, flags); if (align_buf_virt) - DWC_DMA_FREE(buf_size, align_buf_virt, align_buf_dma); + DWC_DMA_FREE(dev, buf_size, align_buf_virt, align_buf_dma); return; } diff --git a/drivers/usb/host/dwc_otg/dwc_otg_pcd.c b/drivers/usb/host/dwc_otg/dwc_otg_pcd.c index ae0c72d02d007d..9dabbe5c9791c5 100644 --- a/drivers/usb/host/dwc_otg/dwc_otg_pcd.c +++ b/drivers/usb/host/dwc_otg/dwc_otg_pcd.c @@ -237,20 +237,22 @@ static dwc_otg_cil_callbacks_t pcd_callbacks = { * This function allocates a DMA Descriptor chain for the Endpoint * buffer to be used for a transfer to/from the specified endpoint. */ -dwc_otg_dev_dma_desc_t *dwc_otg_ep_alloc_desc_chain(dwc_dma_t * dma_desc_addr, +dwc_otg_dev_dma_desc_t *dwc_otg_ep_alloc_desc_chain(struct device *dev, + dwc_dma_t * dma_desc_addr, uint32_t count) { - return DWC_DMA_ALLOC_ATOMIC(count * sizeof(dwc_otg_dev_dma_desc_t), + return DWC_DMA_ALLOC_ATOMIC(dev, count * sizeof(dwc_otg_dev_dma_desc_t), dma_desc_addr); } /** * This function frees a DMA Descriptor chain that was allocated by ep_alloc_desc. */ -void dwc_otg_ep_free_desc_chain(dwc_otg_dev_dma_desc_t * desc_addr, +void dwc_otg_ep_free_desc_chain(struct device *dev, + dwc_otg_dev_dma_desc_t * desc_addr, uint32_t dma_desc_addr, uint32_t count) { - DWC_DMA_FREE(count * sizeof(dwc_otg_dev_dma_desc_t), desc_addr, + DWC_DMA_FREE(dev, count * sizeof(dwc_otg_dev_dma_desc_t), desc_addr, dma_desc_addr); } @@ -1105,8 +1107,10 @@ static void start_xfer_tasklet_func(void *data) * This function initialized the PCD portion of the driver. * */ -dwc_otg_pcd_t *dwc_otg_pcd_init(dwc_otg_core_if_t * core_if) +dwc_otg_pcd_t *dwc_otg_pcd_init(dwc_otg_device_t *otg_dev) { + struct device *dev = &otg_dev->os_dep.platformdev->dev; + dwc_otg_core_if_t *core_if = otg_dev->core_if; dwc_otg_pcd_t *pcd = NULL; dwc_otg_dev_if_t *dev_if; int i; @@ -1163,7 +1167,7 @@ dwc_otg_pcd_t *dwc_otg_pcd_init(dwc_otg_core_if_t * core_if) */ if (GET_CORE_IF(pcd)->dma_enable) { pcd->setup_pkt = - DWC_DMA_ALLOC(sizeof(*pcd->setup_pkt) * 5, + DWC_DMA_ALLOC(dev, sizeof(*pcd->setup_pkt) * 5, &pcd->setup_pkt_dma_handle); if (pcd->setup_pkt == NULL) { DWC_FREE(pcd); @@ -1171,10 +1175,10 @@ dwc_otg_pcd_t *dwc_otg_pcd_init(dwc_otg_core_if_t * core_if) } pcd->status_buf = - DWC_DMA_ALLOC(sizeof(uint16_t), + DWC_DMA_ALLOC(dev, sizeof(uint16_t), &pcd->status_buf_dma_handle); if (pcd->status_buf == NULL) { - DWC_DMA_FREE(sizeof(*pcd->setup_pkt) * 5, + DWC_DMA_FREE(dev, sizeof(*pcd->setup_pkt) * 5, pcd->setup_pkt, pcd->setup_pkt_dma_handle); DWC_FREE(pcd); return NULL; @@ -1182,17 +1186,17 @@ dwc_otg_pcd_t *dwc_otg_pcd_init(dwc_otg_core_if_t * core_if) if (GET_CORE_IF(pcd)->dma_desc_enable) { dev_if->setup_desc_addr[0] = - dwc_otg_ep_alloc_desc_chain - (&dev_if->dma_setup_desc_addr[0], 1); + dwc_otg_ep_alloc_desc_chain(dev, + &dev_if->dma_setup_desc_addr[0], 1); dev_if->setup_desc_addr[1] = - dwc_otg_ep_alloc_desc_chain - (&dev_if->dma_setup_desc_addr[1], 1); + dwc_otg_ep_alloc_desc_chain(dev, + &dev_if->dma_setup_desc_addr[1], 1); dev_if->in_desc_addr = - dwc_otg_ep_alloc_desc_chain - (&dev_if->dma_in_desc_addr, 1); + dwc_otg_ep_alloc_desc_chain(dev, + &dev_if->dma_in_desc_addr, 1); dev_if->out_desc_addr = - dwc_otg_ep_alloc_desc_chain - (&dev_if->dma_out_desc_addr, 1); + dwc_otg_ep_alloc_desc_chain(dev, + &dev_if->dma_out_desc_addr, 1); pcd->data_terminated = 0; if (dev_if->setup_desc_addr[0] == 0 @@ -1201,26 +1205,26 @@ dwc_otg_pcd_t *dwc_otg_pcd_init(dwc_otg_core_if_t * core_if) || dev_if->out_desc_addr == 0) { if (dev_if->out_desc_addr) - dwc_otg_ep_free_desc_chain - (dev_if->out_desc_addr, + dwc_otg_ep_free_desc_chain(dev, + dev_if->out_desc_addr, dev_if->dma_out_desc_addr, 1); if (dev_if->in_desc_addr) - dwc_otg_ep_free_desc_chain - (dev_if->in_desc_addr, + dwc_otg_ep_free_desc_chain(dev, + dev_if->in_desc_addr, dev_if->dma_in_desc_addr, 1); if (dev_if->setup_desc_addr[1]) - dwc_otg_ep_free_desc_chain - (dev_if->setup_desc_addr[1], + dwc_otg_ep_free_desc_chain(dev, + dev_if->setup_desc_addr[1], dev_if->dma_setup_desc_addr[1], 1); if (dev_if->setup_desc_addr[0]) - dwc_otg_ep_free_desc_chain - (dev_if->setup_desc_addr[0], + dwc_otg_ep_free_desc_chain(dev, + dev_if->setup_desc_addr[0], dev_if->dma_setup_desc_addr[0], 1); - DWC_DMA_FREE(sizeof(*pcd->setup_pkt) * 5, + DWC_DMA_FREE(dev, sizeof(*pcd->setup_pkt) * 5, pcd->setup_pkt, pcd->setup_pkt_dma_handle); - DWC_DMA_FREE(sizeof(*pcd->status_buf), + DWC_DMA_FREE(dev, sizeof(*pcd->status_buf), pcd->status_buf, pcd->status_buf_dma_handle); @@ -1302,7 +1306,9 @@ dwc_otg_pcd_t *dwc_otg_pcd_init(dwc_otg_core_if_t * core_if) void dwc_otg_pcd_remove(dwc_otg_pcd_t * pcd) { dwc_otg_dev_if_t *dev_if = GET_CORE_IF(pcd)->dev_if; + struct device *dev = dwc_otg_pcd_to_dev(pcd); int i; + if (pcd->core_if->core_params->dev_out_nak) { for (i = 0; i < MAX_EPS_CHANNELS; i++) { DWC_TIMER_CANCEL(pcd->core_if->ep_xfer_timer[i]); @@ -1311,20 +1317,24 @@ void dwc_otg_pcd_remove(dwc_otg_pcd_t * pcd) } if (GET_CORE_IF(pcd)->dma_enable) { - DWC_DMA_FREE(sizeof(*pcd->setup_pkt) * 5, pcd->setup_pkt, + DWC_DMA_FREE(dev, sizeof(*pcd->setup_pkt) * 5, pcd->setup_pkt, pcd->setup_pkt_dma_handle); - DWC_DMA_FREE(sizeof(uint16_t), pcd->status_buf, + DWC_DMA_FREE(dev, sizeof(uint16_t), pcd->status_buf, pcd->status_buf_dma_handle); if (GET_CORE_IF(pcd)->dma_desc_enable) { - dwc_otg_ep_free_desc_chain(dev_if->setup_desc_addr[0], + dwc_otg_ep_free_desc_chain(dev, + dev_if->setup_desc_addr[0], dev_if->dma_setup_desc_addr [0], 1); - dwc_otg_ep_free_desc_chain(dev_if->setup_desc_addr[1], + dwc_otg_ep_free_desc_chain(dev, + dev_if->setup_desc_addr[1], dev_if->dma_setup_desc_addr [1], 1); - dwc_otg_ep_free_desc_chain(dev_if->in_desc_addr, + dwc_otg_ep_free_desc_chain(dev, + dev_if->in_desc_addr, dev_if->dma_in_desc_addr, 1); - dwc_otg_ep_free_desc_chain(dev_if->out_desc_addr, + dwc_otg_ep_free_desc_chain(dev, + dev_if->out_desc_addr, dev_if->dma_out_desc_addr, 1); } @@ -1463,6 +1473,7 @@ int dwc_otg_pcd_ep_enable(dwc_otg_pcd_t * pcd, gdfifocfg_data_t gdfifocfgbase = {.d32 = 0 }; int retval = 0; int i, epcount; + struct device *dev = dwc_otg_pcd_to_dev(pcd); desc = (const usb_endpoint_descriptor_t *)ep_desc; @@ -1571,9 +1582,9 @@ int dwc_otg_pcd_ep_enable(dwc_otg_pcd_t * pcd, if (ep->dwc_ep.type != UE_ISOCHRONOUS) { #endif ep->dwc_ep.desc_addr = - dwc_otg_ep_alloc_desc_chain(&ep-> - dwc_ep.dma_desc_addr, - MAX_DMA_DESC_CNT); + dwc_otg_ep_alloc_desc_chain(dev, + &ep->dwc_ep.dma_desc_addr, + MAX_DMA_DESC_CNT); if (!ep->dwc_ep.desc_addr) { DWC_WARN("%s, can't allocate DMA descriptor\n", __func__); @@ -1624,6 +1635,7 @@ int dwc_otg_pcd_ep_disable(dwc_otg_pcd_t * pcd, void *ep_handle) gdfifocfg_data_t gdfifocfgbase = {.d32 = 0 }; gdfifocfg_data_t gdfifocfg = {.d32 = 0 }; fifosize_data_t dptxfsiz = {.d32 = 0 }; + struct device *dev = dwc_otg_pcd_to_dev(pcd); ep = get_ep_from_handle(pcd, ep_handle); @@ -1678,7 +1690,7 @@ int dwc_otg_pcd_ep_disable(dwc_otg_pcd_t * pcd, void *ep_handle) /* Cannot call dma_free_coherent() with IRQs disabled */ DWC_SPINUNLOCK_IRQRESTORE(pcd->lock, flags); - dwc_otg_ep_free_desc_chain(desc_addr, dma_desc_addr, + dwc_otg_ep_free_desc_chain(dev, desc_addr, dma_desc_addr, MAX_DMA_DESC_CNT); goto out_unlocked; @@ -2079,6 +2091,7 @@ int dwc_otg_pcd_ep_queue(dwc_otg_pcd_t * pcd, void *ep_handle, uint8_t * buf, dwc_dma_t dma_buf, uint32_t buflen, int zero, void *req_handle, int atomic_alloc) { + struct device *dev = dwc_otg_pcd_to_dev(pcd); dwc_irqflags_t flags; dwc_otg_pcd_request_t *req; dwc_otg_pcd_ep_t *ep; @@ -2115,7 +2128,7 @@ int dwc_otg_pcd_ep_queue(dwc_otg_pcd_t * pcd, void *ep_handle, req->dw_align_buf = NULL; if ((dma_buf & 0x3) && GET_CORE_IF(pcd)->dma_enable && !GET_CORE_IF(pcd)->dma_desc_enable) - req->dw_align_buf = DWC_DMA_ALLOC(buflen, + req->dw_align_buf = DWC_DMA_ALLOC(dev, buflen, &req->dw_align_buf_dma); DWC_SPINLOCK_IRQSAVE(pcd->lock, &flags); diff --git a/drivers/usb/host/dwc_otg/dwc_otg_pcd.h b/drivers/usb/host/dwc_otg/dwc_otg_pcd.h index 8ef7ba648ad92b..a70ebd049d2cca 100644 --- a/drivers/usb/host/dwc_otg/dwc_otg_pcd.h +++ b/drivers/usb/host/dwc_otg/dwc_otg_pcd.h @@ -38,6 +38,8 @@ #include "usb.h" #include "dwc_otg_cil.h" #include "dwc_otg_pcd_if.h" +#include "dwc_otg_driver.h" + struct cfiobject; /** @@ -253,6 +255,11 @@ struct dwc_otg_pcd { }; +static inline struct device *dwc_otg_pcd_to_dev(struct dwc_otg_pcd *pcd) +{ + return &pcd->otg_dev->os_dep.platformdev->dev; +} + //FIXME this functions should be static, and this prototypes should be removed extern void dwc_otg_request_nuke(dwc_otg_pcd_ep_t * ep); extern void dwc_otg_request_done(dwc_otg_pcd_ep_t * ep, diff --git a/drivers/usb/host/dwc_otg/dwc_otg_pcd_if.h b/drivers/usb/host/dwc_otg/dwc_otg_pcd_if.h index c8d2e0e0c99486..4c1d591fbc098b 100644 --- a/drivers/usb/host/dwc_otg/dwc_otg_pcd_if.h +++ b/drivers/usb/host/dwc_otg/dwc_otg_pcd_if.h @@ -37,6 +37,7 @@ //#include "dwc_os.h" #include "dwc_otg_core_if.h" +#include "dwc_otg_driver.h" /** @file * This file defines DWC_OTG PCD Core API. @@ -139,7 +140,7 @@ struct dwc_otg_pcd_function_ops { * * @param core_if The DWC_OTG Core */ -extern dwc_otg_pcd_t *dwc_otg_pcd_init(dwc_otg_core_if_t * core_if); +extern dwc_otg_pcd_t *dwc_otg_pcd_init(dwc_otg_device_t *otg_dev); /** Frees PCD allocated by dwc_otg_pcd_init * diff --git a/drivers/usb/host/dwc_otg/dwc_otg_pcd_intr.c b/drivers/usb/host/dwc_otg/dwc_otg_pcd_intr.c index c8590b52711075..e55ea9c74be461 100644 --- a/drivers/usb/host/dwc_otg/dwc_otg_pcd_intr.c +++ b/drivers/usb/host/dwc_otg/dwc_otg_pcd_intr.c @@ -2144,6 +2144,7 @@ static inline int cfi_calc_desc_residue(dwc_otg_pcd_ep_t * ep) static void complete_ep(dwc_otg_pcd_ep_t * ep) { dwc_otg_core_if_t *core_if = GET_CORE_IF(ep->pcd); + struct device *dev = dwc_otg_pcd_to_dev(ep->pcd); dwc_otg_dev_if_t *dev_if = core_if->dev_if; dwc_otg_dev_in_ep_regs_t *in_ep_regs = dev_if->in_ep_regs[ep->dwc_ep.num]; @@ -2484,7 +2485,7 @@ static void complete_ep(dwc_otg_pcd_ep_t * ep) if (!ep->dwc_ep.is_in) { dwc_memcpy(req->buf, req->dw_align_buf, req->length); } - DWC_DMA_FREE(req->length, req->dw_align_buf, + DWC_DMA_FREE(dev, req->length, req->dw_align_buf, req->dw_align_buf_dma); } diff --git a/drivers/usb/host/dwc_otg/dwc_otg_pcd_linux.c b/drivers/usb/host/dwc_otg/dwc_otg_pcd_linux.c index 5624f32c9ea911..50aaeacdd12fff 100644 --- a/drivers/usb/host/dwc_otg/dwc_otg_pcd_linux.c +++ b/drivers/usb/host/dwc_otg/dwc_otg_pcd_linux.c @@ -1206,7 +1206,7 @@ int pcd_init(dwc_bus_dev_t *_dev) DWC_DEBUGPL(DBG_PCDV, "%s(%p) otg_dev=%p\n", __func__, _dev, otg_dev); - otg_dev->pcd = dwc_otg_pcd_init(otg_dev->core_if); + otg_dev->pcd = dwc_otg_pcd_init(otg_dev); if (!otg_dev->pcd) { DWC_ERROR("dwc_otg_pcd_init failed\n"); From 210b709f73c994b443f5036061ccd3721a3e720d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Wed, 19 Oct 2016 16:05:36 +0200 Subject: [PATCH 04/10] mmc: bcm2835-sdhost: Pass struct device to dma_alloc*() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This makes it possible to get the bus address from Device Tree. At the same time move the call to log_init() after getting the clock to avoid allocating twice due to deferred probing. Signed-off-by: Noralf Trønnes --- drivers/mmc/host/bcm2835-sdhost.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/mmc/host/bcm2835-sdhost.c b/drivers/mmc/host/bcm2835-sdhost.c index 9e55d5ac08b580..a9bc79bfdbb718 100644 --- a/drivers/mmc/host/bcm2835-sdhost.c +++ b/drivers/mmc/host/bcm2835-sdhost.c @@ -235,10 +235,10 @@ static void __iomem *timer_base; #define LOG_ENTRIES (256*1) #define LOG_SIZE (sizeof(LOG_ENTRY_T)*LOG_ENTRIES) -static void log_init(u32 bus_to_phys) +static void log_init(struct device *dev, u32 bus_to_phys) { spin_lock_init(&log_lock); - sdhost_log_buf = dma_zalloc_coherent(NULL, LOG_SIZE, &sdhost_log_addr, + sdhost_log_buf = dma_zalloc_coherent(dev, LOG_SIZE, &sdhost_log_addr, GFP_KERNEL); if (sdhost_log_buf) { pr_info("sdhost: log_buf @ %p (%x)\n", @@ -2037,7 +2037,6 @@ static int bcm2835_sdhost_probe(struct platform_device *pdev) return -ENODEV; } host->bus_addr = be32_to_cpup(addr); - log_init(iomem->start - host->bus_addr); pr_debug(" - ioaddr %lx, iomem->start %lx, bus_addr %lx\n", (unsigned long)host->ioaddr, (unsigned long)iomem->start, @@ -2110,6 +2109,8 @@ static int bcm2835_sdhost_probe(struct platform_device *pdev) (unsigned long)host->max_clk, (int)host->irq); + log_init(dev, iomem->start - host->bus_addr); + if (node) mmc_of_parse(mmc); else 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 05/10] 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 962d632c2af85c..82cbd045d7894e 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 1bd2a707ef5c0d..663843965027da 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 757d0053c1c074..b1d82f9026d02e 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 e93df839ab8c6c..265c3fb90f3deb 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 7548a52dcf84af..00000000000000 --- 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 643b4b984512a5..41f407ac1db3a8 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 7548a52dcf84af..00000000000000 --- 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 From 153cfa590fc53f425f57a60797550c9b48bb2b9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Tue, 25 Oct 2016 15:55:09 +0200 Subject: [PATCH 06/10] dts: Remove bcm2835-rpi-cm.dts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This file doesn't build anymore and isn't used so remove it. It was added as part of my ARCH_BCM2835 work last year, but the future didn't pan out as expected. Signed-off-by: Noralf Trønnes --- arch/arm/boot/dts/Makefile | 1 - arch/arm/boot/dts/bcm2835-rpi-cm.dts | 93 --------------------------- arch/arm/boot/dts/bcm2835-rpi-cm.dtsi | 30 --------- 3 files changed, 124 deletions(-) delete mode 100644 arch/arm/boot/dts/bcm2835-rpi-cm.dts delete mode 100644 arch/arm/boot/dts/bcm2835-rpi-cm.dtsi diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile index 71f794ecc710ac..0cb86b7a5ab212 100644 --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile @@ -3,7 +3,6 @@ ifeq ($(CONFIG_OF),y) dtb-$(CONFIG_ARCH_BCM2708) += bcm2708-rpi-b.dtb dtb-$(CONFIG_ARCH_BCM2708) += bcm2708-rpi-b-plus.dtb dtb-$(CONFIG_ARCH_BCM2708) += bcm2708-rpi-cm.dtb -dtb-$(CONFIG_ARCH_BCM2835) += bcm2835-rpi-cm.dtb dtb-$(CONFIG_ARCH_BCM2709) += bcm2709-rpi-2-b.dtb dtb-$(CONFIG_ARCH_BCM2709) += bcm2710-rpi-3-b.dtb dtb-$(CONFIG_ARCH_BCM2709) += bcm2710-rpi-cm3.dtb diff --git a/arch/arm/boot/dts/bcm2835-rpi-cm.dts b/arch/arm/boot/dts/bcm2835-rpi-cm.dts deleted file mode 100644 index c6e6860a6d4356..00000000000000 --- a/arch/arm/boot/dts/bcm2835-rpi-cm.dts +++ /dev/null @@ -1,93 +0,0 @@ -/dts-v1/; - -#include "bcm2835-rpi-cm.dtsi" - -/ { - model = "Raspberry Pi Compute Module"; -}; - -&uart0 { - status = "okay"; -}; - -&gpio { - spi0_pins: spi0_pins { - brcm,pins = <7 8 9 10 11>; - brcm,function = <4>; /* alt0 */ - }; - - i2c0_pins: i2c0 { - brcm,pins = <0 1>; - brcm,function = <4>; - }; - - i2c1_pins: i2c1 { - brcm,pins = <2 3>; - brcm,function = <4>; - }; - - i2s_pins: i2s { - brcm,pins = <18 19 20 21>; - brcm,function = <4>; /* alt0 */ - }; -}; - -&spi0 { - pinctrl-names = "default"; - pinctrl-0 = <&spi0_pins>; - - spidev@0{ - compatible = "spidev"; - reg = <0>; /* CE0 */ - #address-cells = <1>; - #size-cells = <0>; - spi-max-frequency = <500000>; - }; - - spidev@1{ - compatible = "spidev"; - reg = <1>; /* CE1 */ - #address-cells = <1>; - #size-cells = <0>; - spi-max-frequency = <500000>; - }; -}; - -&i2c0 { - pinctrl-names = "default"; - pinctrl-0 = <&i2c0_pins>; - clock-frequency = <100000>; -}; - -&i2c1 { - pinctrl-names = "default"; - pinctrl-0 = <&i2c1_pins>; - clock-frequency = <100000>; -}; - -&i2c2 { - clock-frequency = <100000>; -}; - -&i2s { - #sound-dai-cells = <0>; - pinctrl-names = "default"; - pinctrl-0 = <&i2s_pins>; -}; - -/ { - __overrides__ { - uart0 = <&uart0>,"status"; - uart0_clkrate = <&clk_uart0>,"clock-frequency:0"; - uart1_clkrate = <&uart1>,"clock-frequency:0"; - i2s = <&i2s>,"status"; - spi = <&spi0>,"status"; - i2c0 = <&i2c0>,"status"; - i2c1 = <&i2c1>,"status"; - i2c2_iknowwhatimdoing = <&i2c2>,"status"; - i2c0_baudrate = <&i2c0>,"clock-frequency:0"; - i2c1_baudrate = <&i2c1>,"clock-frequency:0"; - i2c2_baudrate = <&i2c2>,"clock-frequency:0"; - core_freq = <&clk_core>,"clock-frequency:0"; - }; -}; diff --git a/arch/arm/boot/dts/bcm2835-rpi-cm.dtsi b/arch/arm/boot/dts/bcm2835-rpi-cm.dtsi deleted file mode 100644 index 9c4000fc686a98..00000000000000 --- a/arch/arm/boot/dts/bcm2835-rpi-cm.dtsi +++ /dev/null @@ -1,30 +0,0 @@ -#include "bcm2835.dtsi" - -&leds { - act_led: act { - label = "led0"; - linux,default-trigger = "mmc0"; - gpios = <&gpio 47 0>; - }; -}; - -&mmc { - status = "okay"; - bus-width = <4>; -}; - -&fb { - status = "okay"; -}; - -/ { - __overrides__ { - act_led_gpio = <&act_led>,"gpios:4"; - act_led_activelow = <&act_led>,"gpios:8"; - act_led_trigger = <&act_led>,"linux,default-trigger"; - - audio = <&audio>,"status"; - watchdog = <&watchdog>,"status"; - random = <&random>,"status"; - }; -}; From 3cd6950ea72714ff73243d669a1841aa24914be0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Tue, 25 Oct 2016 16:00:07 +0200 Subject: [PATCH 07/10] bcm2708: Convert to ARCH_MULTIPLATFORM MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Convert to multi platform and base it on ARCH_BCM2835. Signed-off-by: Noralf Trønnes --- arch/arm/Kconfig | 21 ----------- arch/arm/Makefile | 1 - arch/arm/configs/bcmrpi_defconfig | 6 ++- arch/arm/mach-bcm/Kconfig | 14 +++++++ arch/arm/mach-bcm/board_bcm2835.c | 21 +++++++++++ arch/arm/mach-bcm2708/Kconfig | 14 ------- arch/arm/mach-bcm2708/Makefile | 5 --- arch/arm/mach-bcm2708/Makefile.boot | 3 -- arch/arm/mach-bcm2708/bcm2708.c | 57 ----------------------------- drivers/clk/bcm/Makefile | 4 +- drivers/clocksource/Makefile | 2 +- drivers/irqchip/Makefile | 1 - 12 files changed, 42 insertions(+), 107 deletions(-) delete mode 100644 arch/arm/mach-bcm2708/Kconfig delete mode 100644 arch/arm/mach-bcm2708/Makefile delete mode 100644 arch/arm/mach-bcm2708/Makefile.boot delete mode 100644 arch/arm/mach-bcm2708/bcm2708.c diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 82cbd045d7894e..4578b06fda5870 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -326,26 +326,6 @@ choice default ARM_SINGLE_ARMV7M if !MMU default ARCH_MULTIPLATFORM if MMU -config ARCH_BCM2708 - bool "Broadcom BCM2708 family" - select CPU_V6 - select ARM_AMBA - select CLKSRC_MMIO - select CLKSRC_OF if OF - select HAVE_SCHED_CLOCK - select NEED_MACH_GPIO_H - select COMMON_CLK - select ARCH_HAS_CPUFREQ - select GENERIC_CLOCKEVENTS - select ARM_ERRATA_411920 - select MACH_BCM2708 - select MULTI_IRQ_HANDLER - select SPARSE_IRQ - select VC4 - select FIQ - help - This enables support for Broadcom BCM2708 boards. - config ARCH_BCM2709 bool "Broadcom BCM2709 family" select CPU_V7 @@ -754,7 +734,6 @@ config ARCH_VIRT # Kconfigs may be included either alphabetically (according to the # plat- suffix) or along side the corresponding mach-* source. # -source "arch/arm/mach-bcm2708/Kconfig" source "arch/arm/mach-bcm2709/Kconfig" source "arch/arm/mach-mvebu/Kconfig" diff --git a/arch/arm/Makefile b/arch/arm/Makefile index 275c53561cd7c3..ca1877e0c75d53 100644 --- a/arch/arm/Makefile +++ b/arch/arm/Makefile @@ -152,7 +152,6 @@ textofs-$(CONFIG_ARCH_AXXIA) := 0x00308000 # Machine directory name. This list is sorted alphanumerically # by CONFIG_* macro name. -machine-$(CONFIG_ARCH_BCM2708) += bcm2708 machine-$(CONFIG_ARCH_BCM2709) += bcm2709 machine-$(CONFIG_ARCH_ALPINE) += alpine machine-$(CONFIG_ARCH_ARTPEC) += artpec diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig index 46b91678fef473..27c61471a12a38 100644 --- a/arch/arm/configs/bcmrpi_defconfig +++ b/arch/arm/configs/bcmrpi_defconfig @@ -1,5 +1,3 @@ -# CONFIG_ARM_PATCH_PHYS_VIRT is not set -CONFIG_PHYS_OFFSET=0 # CONFIG_LOCALVERSION_AUTO is not set CONFIG_SYSVIPC=y CONFIG_POSIX_MQUEUE=y @@ -38,7 +36,11 @@ CONFIG_BLK_DEV_THROTTLING=y CONFIG_PARTITION_ADVANCED=y CONFIG_MAC_PARTITION=y CONFIG_CFQ_GROUP_IOSCHED=y +CONFIG_ARCH_MULTI_V6=y +# CONFIG_ARCH_MULTI_V7 is not set +CONFIG_ARCH_BCM=y CONFIG_ARCH_BCM2708=y +# CONFIG_CACHE_L2X0 is not set CONFIG_PREEMPT_VOLUNTARY=y CONFIG_AEABI=y CONFIG_OABI_COMPAT=y diff --git a/arch/arm/mach-bcm/Kconfig b/arch/arm/mach-bcm/Kconfig index 5f6ab16792a93b..9461147888e20c 100644 --- a/arch/arm/mach-bcm/Kconfig +++ b/arch/arm/mach-bcm/Kconfig @@ -160,6 +160,20 @@ config ARCH_BCM2835 This enables support for the Broadcom BCM2835 and BCM2836 SoCs. This SoC is used in the Raspberry Pi and Roku 2 devices. +config MACH_BCM2708 + bool "Enable optimized __copy_to_user and __copy_from_user" + depends on ARCH_BCM2708 + default y + help + Optimized versions of __copy_to_user and __copy_from_user for Pi1. + +config ARCH_BCM2708 + bool "Broadcom BCM2708 family" + depends on ARCH_MULTI_V6 + select ARCH_BCM2835 + help + This enables support for Broadcom BCM2708 boards. + config ARCH_BCM_63XX bool "Broadcom BCM63xx DSL SoC" depends on ARCH_MULTI_V7 diff --git a/arch/arm/mach-bcm/board_bcm2835.c b/arch/arm/mach-bcm/board_bcm2835.c index 8f152266ba9b47..309a336df05191 100644 --- a/arch/arm/mach-bcm/board_bcm2835.c +++ b/arch/arm/mach-bcm/board_bcm2835.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include @@ -27,6 +28,7 @@ static void __init bcm2835_init(void) u32 val; u64 val64; + vc_cma_early_init(); bcm2835_init_clocks(); if (!of_property_read_u32(np, "linux,revision", &val)) @@ -35,6 +37,11 @@ static void __init bcm2835_init(void) system_serial_low = val64; } +static void __init bcm2835_board_reserve(void) +{ + vc_cma_reserve(); +} + static const char * const bcm2835_compat[] = { #ifdef CONFIG_ARCH_MULTI_V6 "brcm,bcm2835", @@ -47,5 +54,19 @@ static const char * const bcm2835_compat[] = { DT_MACHINE_START(BCM2835, "BCM2835") .init_machine = bcm2835_init, + .reserve = bcm2835_board_reserve, .dt_compat = bcm2835_compat MACHINE_END + +#ifdef CONFIG_ARCH_BCM2708 +static const char * const bcm2708_compat[] = { + "brcm,bcm2708", + NULL +}; + +DT_MACHINE_START(BCM2708, "BCM2708") + .init_machine = bcm2835_init, + .reserve = bcm2835_board_reserve, + .dt_compat = bcm2708_compat, +MACHINE_END +#endif diff --git a/arch/arm/mach-bcm2708/Kconfig b/arch/arm/mach-bcm2708/Kconfig deleted file mode 100644 index 265c3fb90f3deb..00000000000000 --- a/arch/arm/mach-bcm2708/Kconfig +++ /dev/null @@ -1,14 +0,0 @@ -menu "Broadcom BCM2708 Implementations" - depends on ARCH_BCM2708 - -config MACH_BCM2708 - bool "Broadcom BCM2708 Development Platform" - select CPU_V6 - select USE_OF - select ARCH_REQUIRE_GPIOLIB - select PINCTRL - select PINCTRL_BCM2835 - help - Include support for the Broadcom(R) BCM2708 platform. - -endmenu diff --git a/arch/arm/mach-bcm2708/Makefile b/arch/arm/mach-bcm2708/Makefile deleted file mode 100644 index 3da1a1b4ea1fb0..00000000000000 --- a/arch/arm/mach-bcm2708/Makefile +++ /dev/null @@ -1,5 +0,0 @@ -# -# Makefile for the linux kernel. -# - -obj-$(CONFIG_MACH_BCM2708) += bcm2708.o diff --git a/arch/arm/mach-bcm2708/Makefile.boot b/arch/arm/mach-bcm2708/Makefile.boot deleted file mode 100644 index 67039c3e0c48fa..00000000000000 --- a/arch/arm/mach-bcm2708/Makefile.boot +++ /dev/null @@ -1,3 +0,0 @@ - zreladdr-y := 0x00008000 -params_phys-y := 0x00000100 -initrd_phys-y := 0x00800000 diff --git a/arch/arm/mach-bcm2708/bcm2708.c b/arch/arm/mach-bcm2708/bcm2708.c deleted file mode 100644 index 06b078569006a6..00000000000000 --- a/arch/arm/mach-bcm2708/bcm2708.c +++ /dev/null @@ -1,57 +0,0 @@ -/* - * linux/arch/arm/mach-bcm2708/bcm2708.c - * - * 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 - */ - -#include -#include - -#include -#include - -static void __init bcm2708_init(void) -{ - struct device_node *np = of_find_node_by_path("/system"); - u32 val; - u64 val64; - - vc_cma_early_init(); - - if (!of_property_read_u32(np, "linux,revision", &val)) - system_rev = val; - if (!of_property_read_u64(np, "linux,serial", &val64)) - system_serial_low = val64; -} - -static void __init board_reserve(void) -{ - vc_cma_reserve(); -} - -static const char * const bcm2708_compat[] = { - "brcm,bcm2708", - NULL -}; - -DT_MACHINE_START(BCM2708, "BCM2708") - /* Maintainer: Broadcom Europe Ltd. */ - .init_machine = bcm2708_init, - .reserve = board_reserve, - .dt_compat = bcm2708_compat, -MACHINE_END - diff --git a/drivers/clk/bcm/Makefile b/drivers/clk/bcm/Makefile index fcf1bb5d792111..84dc055849c0ce 100644 --- a/drivers/clk/bcm/Makefile +++ b/drivers/clk/bcm/Makefile @@ -4,8 +4,8 @@ obj-$(CONFIG_CLK_BCM_KONA) += clk-kona-setup.o obj-$(CONFIG_CLK_BCM_KONA) += clk-bcm281xx.o obj-$(CONFIG_CLK_BCM_KONA) += clk-bcm21664.o obj-$(CONFIG_COMMON_CLK_IPROC) += clk-iproc-armpll.o clk-iproc-pll.o clk-iproc-asiu.o -obj-$(CONFIG_ARCH_BCM2835)$(CONFIG_ARCH_BCM2708)$(CONFIG_ARCH_BCM2709) += clk-bcm2835.o -obj-$(CONFIG_ARCH_BCM2835)$(CONFIG_ARCH_BCM2708)$(CONFIG_ARCH_BCM2709) += clk-bcm2835-aux.o +obj-$(CONFIG_ARCH_BCM2835)$(CONFIG_ARCH_BCM2709) += clk-bcm2835.o +obj-$(CONFIG_ARCH_BCM2835)$(CONFIG_ARCH_BCM2709) += clk-bcm2835-aux.o obj-$(CONFIG_COMMON_CLK_IPROC) += clk-ns2.o obj-$(CONFIG_ARCH_BCM_CYGNUS) += clk-cygnus.o obj-$(CONFIG_ARCH_BCM_NSP) += clk-nsp.o diff --git a/drivers/clocksource/Makefile b/drivers/clocksource/Makefile index a60aa840b28f0f..fd9d6df0bbc099 100644 --- a/drivers/clocksource/Makefile +++ b/drivers/clocksource/Makefile @@ -19,7 +19,7 @@ obj-$(CONFIG_CLKSRC_NOMADIK_MTU) += nomadik-mtu.o obj-$(CONFIG_CLKSRC_DBX500_PRCMU) += clksrc-dbx500-prcmu.o obj-$(CONFIG_ARMADA_370_XP_TIMER) += time-armada-370-xp.o obj-$(CONFIG_ORION_TIMER) += time-orion.o -obj-$(CONFIG_BCM2835_TIMER)$(CONFIG_ARCH_BCM2708) += bcm2835_timer.o +obj-$(CONFIG_BCM2835_TIMER) += bcm2835_timer.o obj-$(CONFIG_CLPS711X_TIMER) += clps711x-timer.o obj-$(CONFIG_ATLAS7_TIMER) += timer-atlas7.o obj-$(CONFIG_MOXART_TIMER) += moxart_timer.o diff --git a/drivers/irqchip/Makefile b/drivers/irqchip/Makefile index 75da978fac0e06..662790c8fa9c97 100644 --- a/drivers/irqchip/Makefile +++ b/drivers/irqchip/Makefile @@ -5,7 +5,6 @@ obj-$(CONFIG_ATH79) += irq-ath79-cpu.o obj-$(CONFIG_ATH79) += irq-ath79-misc.o obj-$(CONFIG_ARCH_BCM2835) += irq-bcm2835.o obj-$(CONFIG_ARCH_BCM2835) += irq-bcm2836.o -obj-$(CONFIG_ARCH_BCM2708) += irq-bcm2835.o obj-$(CONFIG_ARCH_BCM2709) += irq-bcm2835.o obj-$(CONFIG_ARCH_BCM2709) += irq-bcm2836.o obj-$(CONFIG_ARCH_EXYNOS) += exynos-combiner.o From 73d6a39951195009380c7a43f4928789685a9733 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Tue, 25 Oct 2016 16:02:39 +0200 Subject: [PATCH 08/10] bcm2709: Convert to ARCH_MULTIPLATFORM MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Convert to multi platform and base it on ARCH_BCM2835. Signed-off-by: Noralf Trønnes --- arch/arm/Kconfig | 25 ------------- arch/arm/Makefile | 1 - arch/arm/configs/bcm2709_defconfig | 4 +-- arch/arm/mach-bcm/Kconfig | 9 +++++ arch/arm/mach-bcm/board_bcm2835.c | 13 +++++++ arch/arm/mach-bcm2709/Kconfig | 9 ----- arch/arm/mach-bcm2709/Makefile | 5 --- arch/arm/mach-bcm2709/Makefile.boot | 3 -- arch/arm/mach-bcm2709/bcm2709.c | 56 ----------------------------- drivers/clk/bcm/Makefile | 4 +-- drivers/irqchip/Makefile | 2 -- 11 files changed, 25 insertions(+), 106 deletions(-) delete mode 100644 arch/arm/mach-bcm2709/Kconfig delete mode 100644 arch/arm/mach-bcm2709/Makefile delete mode 100644 arch/arm/mach-bcm2709/Makefile.boot delete mode 100644 arch/arm/mach-bcm2709/bcm2709.c diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 4578b06fda5870..a9c4e48bb7ec99 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -326,29 +326,6 @@ choice default ARM_SINGLE_ARMV7M if !MMU default ARCH_MULTIPLATFORM if MMU -config ARCH_BCM2709 - bool "Broadcom BCM2709 family" - select CPU_V7 - select HAVE_SMP - select ARM_AMBA - select MIGHT_HAVE_CACHE_L2X0 - select HAVE_SCHED_CLOCK - select COMMON_CLK - select ARCH_HAS_CPUFREQ - select GENERIC_CLOCKEVENTS - select MACH_BCM2709 - select MULTI_IRQ_HANDLER - select SPARSE_IRQ - select MFD_SYSCON - select VC4 - select FIQ - select USE_OF - select ARCH_REQUIRE_GPIOLIB - select PINCTRL - select PINCTRL_BCM2835 - help - This enables support for Broadcom BCM2709 boards. - config ARCH_MULTIPLATFORM bool "Allow multiple platforms to be selected" depends on MMU @@ -734,8 +711,6 @@ config ARCH_VIRT # Kconfigs may be included either alphabetically (according to the # plat- suffix) or along side the corresponding mach-* source. # -source "arch/arm/mach-bcm2709/Kconfig" - source "arch/arm/mach-mvebu/Kconfig" source "arch/arm/mach-alpine/Kconfig" diff --git a/arch/arm/Makefile b/arch/arm/Makefile index ca1877e0c75d53..5eb5aef84c1953 100644 --- a/arch/arm/Makefile +++ b/arch/arm/Makefile @@ -152,7 +152,6 @@ textofs-$(CONFIG_ARCH_AXXIA) := 0x00308000 # Machine directory name. This list is sorted alphanumerically # by CONFIG_* macro name. -machine-$(CONFIG_ARCH_BCM2709) += bcm2709 machine-$(CONFIG_ARCH_ALPINE) += alpine machine-$(CONFIG_ARCH_ARTPEC) += artpec machine-$(CONFIG_ARCH_AT91) += at91 diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig index 40841d8421e44f..d246dd91b12d40 100644 --- a/arch/arm/configs/bcm2709_defconfig +++ b/arch/arm/configs/bcm2709_defconfig @@ -1,5 +1,3 @@ -# CONFIG_ARM_PATCH_PHYS_VIRT is not set -CONFIG_PHYS_OFFSET=0 CONFIG_LOCALVERSION="-v7" # CONFIG_LOCALVERSION_AUTO is not set CONFIG_SYSVIPC=y @@ -39,10 +37,10 @@ CONFIG_BLK_DEV_THROTTLING=y CONFIG_PARTITION_ADVANCED=y CONFIG_MAC_PARTITION=y CONFIG_CFQ_GROUP_IOSCHED=y +CONFIG_ARCH_BCM=y CONFIG_ARCH_BCM2709=y # CONFIG_CACHE_L2X0 is not set CONFIG_SMP=y -CONFIG_HAVE_ARM_ARCH_TIMER=y CONFIG_VMSPLIT_2G=y CONFIG_PREEMPT_VOLUNTARY=y CONFIG_AEABI=y diff --git a/arch/arm/mach-bcm/Kconfig b/arch/arm/mach-bcm/Kconfig index 9461147888e20c..929a5fa241fa94 100644 --- a/arch/arm/mach-bcm/Kconfig +++ b/arch/arm/mach-bcm/Kconfig @@ -174,6 +174,15 @@ config ARCH_BCM2708 help This enables support for Broadcom BCM2708 boards. +config ARCH_BCM2709 + bool "Broadcom BCM2709 family" + depends on ARCH_MULTI_V7 + select ARCH_BCM2835 + select HAVE_SMP + select MFD_SYSCON + help + This enables support for Broadcom BCM2709 boards. + config ARCH_BCM_63XX bool "Broadcom BCM63xx DSL SoC" depends on ARCH_MULTI_V7 diff --git a/arch/arm/mach-bcm/board_bcm2835.c b/arch/arm/mach-bcm/board_bcm2835.c index 309a336df05191..6ce49dea7856b2 100644 --- a/arch/arm/mach-bcm/board_bcm2835.c +++ b/arch/arm/mach-bcm/board_bcm2835.c @@ -70,3 +70,16 @@ DT_MACHINE_START(BCM2708, "BCM2708") .dt_compat = bcm2708_compat, MACHINE_END #endif + +#ifdef CONFIG_ARCH_BCM2709 +static const char * const bcm2709_compat[] = { + "brcm,bcm2709", + NULL +}; + +DT_MACHINE_START(BCM2709, "BCM2709") + .init_machine = bcm2835_init, + .reserve = bcm2835_board_reserve, + .dt_compat = bcm2709_compat, +MACHINE_END +#endif diff --git a/arch/arm/mach-bcm2709/Kconfig b/arch/arm/mach-bcm2709/Kconfig deleted file mode 100644 index 41f407ac1db3a8..00000000000000 --- a/arch/arm/mach-bcm2709/Kconfig +++ /dev/null @@ -1,9 +0,0 @@ -menu "Broadcom BCM2709 Implementations" - depends on ARCH_BCM2709 - -config MACH_BCM2709 - bool "Broadcom BCM2709 Development Platform" - help - Include support for the Broadcom(R) BCM2709 platform. - -endmenu diff --git a/arch/arm/mach-bcm2709/Makefile b/arch/arm/mach-bcm2709/Makefile deleted file mode 100644 index 26cd67d3dc343d..00000000000000 --- a/arch/arm/mach-bcm2709/Makefile +++ /dev/null @@ -1,5 +0,0 @@ -# -# Makefile for the linux kernel. -# - -obj-$(CONFIG_MACH_BCM2709) += bcm2709.o diff --git a/arch/arm/mach-bcm2709/Makefile.boot b/arch/arm/mach-bcm2709/Makefile.boot deleted file mode 100644 index 67039c3e0c48fa..00000000000000 --- a/arch/arm/mach-bcm2709/Makefile.boot +++ /dev/null @@ -1,3 +0,0 @@ - zreladdr-y := 0x00008000 -params_phys-y := 0x00000100 -initrd_phys-y := 0x00800000 diff --git a/arch/arm/mach-bcm2709/bcm2709.c b/arch/arm/mach-bcm2709/bcm2709.c deleted file mode 100644 index 9f113736627175..00000000000000 --- a/arch/arm/mach-bcm2709/bcm2709.c +++ /dev/null @@ -1,56 +0,0 @@ -/* - * linux/arch/arm/mach-bcm2709/bcm2709.c - * - * 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 - */ - -#include -#include - -#include -#include - -static void __init bcm2709_init(void) -{ - struct device_node *np = of_find_node_by_path("/system"); - u32 val; - u64 val64; - - vc_cma_early_init(); - - if (!of_property_read_u32(np, "linux,revision", &val)) - system_rev = val; - if (!of_property_read_u64(np, "linux,serial", &val64)) - system_serial_low = val64; -} - -static void __init board_reserve(void) -{ - vc_cma_reserve(); -} - -static const char * const bcm2709_compat[] = { - "brcm,bcm2709", - NULL -}; - -DT_MACHINE_START(BCM2709, "BCM2709") - /* Maintainer: Broadcom Europe Ltd. */ - .init_machine = bcm2709_init, - .reserve = board_reserve, - .dt_compat = bcm2709_compat, -MACHINE_END diff --git a/drivers/clk/bcm/Makefile b/drivers/clk/bcm/Makefile index 84dc055849c0ce..1d79bd2c36f004 100644 --- a/drivers/clk/bcm/Makefile +++ b/drivers/clk/bcm/Makefile @@ -4,8 +4,8 @@ obj-$(CONFIG_CLK_BCM_KONA) += clk-kona-setup.o obj-$(CONFIG_CLK_BCM_KONA) += clk-bcm281xx.o obj-$(CONFIG_CLK_BCM_KONA) += clk-bcm21664.o obj-$(CONFIG_COMMON_CLK_IPROC) += clk-iproc-armpll.o clk-iproc-pll.o clk-iproc-asiu.o -obj-$(CONFIG_ARCH_BCM2835)$(CONFIG_ARCH_BCM2709) += clk-bcm2835.o -obj-$(CONFIG_ARCH_BCM2835)$(CONFIG_ARCH_BCM2709) += clk-bcm2835-aux.o +obj-$(CONFIG_ARCH_BCM2835) += clk-bcm2835.o +obj-$(CONFIG_ARCH_BCM2835) += clk-bcm2835-aux.o obj-$(CONFIG_COMMON_CLK_IPROC) += clk-ns2.o obj-$(CONFIG_ARCH_BCM_CYGNUS) += clk-cygnus.o obj-$(CONFIG_ARCH_BCM_NSP) += clk-nsp.o diff --git a/drivers/irqchip/Makefile b/drivers/irqchip/Makefile index 662790c8fa9c97..4c203b6b816357 100644 --- a/drivers/irqchip/Makefile +++ b/drivers/irqchip/Makefile @@ -5,8 +5,6 @@ obj-$(CONFIG_ATH79) += irq-ath79-cpu.o obj-$(CONFIG_ATH79) += irq-ath79-misc.o obj-$(CONFIG_ARCH_BCM2835) += irq-bcm2835.o obj-$(CONFIG_ARCH_BCM2835) += irq-bcm2836.o -obj-$(CONFIG_ARCH_BCM2709) += irq-bcm2835.o -obj-$(CONFIG_ARCH_BCM2709) += irq-bcm2836.o obj-$(CONFIG_ARCH_EXYNOS) += exynos-combiner.o obj-$(CONFIG_ARCH_HIP04) += irq-hip04.o obj-$(CONFIG_ARCH_LPC32XX) += irq-lpc32xx.o From 920ff4448e4c970a6919fc523e343bf73d683007 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Tue, 25 Oct 2016 17:32:02 +0200 Subject: [PATCH 09/10] kconfig: Just use ARCH_BCM2835 for depends on MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ARCH_BCM2708 and ARCH_BCM2709 selects ARCH_BCM2835 now, so the dependencies can be simplified. Signed-off-by: Noralf Trønnes --- arch/arm/Kconfig.debug | 10 ++++------ drivers/char/broadcom/Kconfig | 2 +- drivers/char/hw_random/Kconfig | 2 +- drivers/dma/Kconfig | 2 +- drivers/gpio/Kconfig | 2 +- drivers/gpu/drm/vc4/Kconfig | 2 +- drivers/i2c/busses/Kconfig | 4 ++-- drivers/mailbox/Kconfig | 2 +- drivers/media/platform/bcm2835/Kconfig | 2 +- drivers/misc/Kconfig | 2 +- drivers/mmc/host/Kconfig | 4 ++-- drivers/mtd/nand/Kconfig | 2 +- drivers/pwm/Kconfig | 2 +- drivers/soc/bcm/Kconfig | 2 +- drivers/spi/Kconfig | 4 ++-- drivers/tty/serial/8250/Kconfig | 2 +- drivers/watchdog/Kconfig | 2 +- sound/arm/Kconfig | 3 +-- sound/soc/bcm/Kconfig | 2 +- 19 files changed, 25 insertions(+), 28 deletions(-) diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug index 11aa81fcaaa8e4..a9693b6987a6e4 100644 --- a/arch/arm/Kconfig.debug +++ b/arch/arm/Kconfig.debug @@ -147,12 +147,12 @@ choice config DEBUG_BCM2835 bool "Kernel low-level debugging on BCM2835 PL011 UART" - depends on (ARCH_BCM2835 && ARCH_MULTI_V6) || ARCH_BCM2708 + depends on ARCH_BCM2835 && ARCH_MULTI_V6 select DEBUG_UART_PL01X config DEBUG_BCM2836 bool "Kernel low-level debugging on BCM2836 PL011 UART" - depends on (ARCH_BCM2835 && ARCH_MULTI_V7) || ARCH_BCM2709 + depends on ARCH_BCM2835 && ARCH_MULTI_V7 select DEBUG_UART_PL01X config DEBUG_BCM_5301X @@ -1695,8 +1695,7 @@ config DEBUG_UART_8250_FLOW_CONTROL config DEBUG_UNCOMPRESS bool - depends on ARCH_MULTIPLATFORM || PLAT_SAMSUNG || ARM_SINGLE_ARMV7M || \ - ARCH_BCM2708 || ARCH_BCM2709 + depends on ARCH_MULTIPLATFORM || PLAT_SAMSUNG || ARM_SINGLE_ARMV7M default y if DEBUG_LL && !DEBUG_OMAP2PLUS_UART && \ (!DEBUG_TEGRA_UART || !ZBOOT_ROM) help @@ -1713,8 +1712,7 @@ config DEBUG_UNCOMPRESS config UNCOMPRESS_INCLUDE string default "debug/uncompress.h" if ARCH_MULTIPLATFORM || ARCH_MSM || \ - PLAT_SAMSUNG || ARM_SINGLE_ARMV7M || \ - ARCH_BCM2708 || ARCH_BCM2709 + PLAT_SAMSUNG || ARM_SINGLE_ARMV7M default "mach/uncompress.h" config EARLY_PRINTK diff --git a/drivers/char/broadcom/Kconfig b/drivers/char/broadcom/Kconfig index 5489f19f05c620..032164919350db 100644 --- a/drivers/char/broadcom/Kconfig +++ b/drivers/char/broadcom/Kconfig @@ -49,7 +49,7 @@ config BCM2835_DEVGPIOMEM config BCM2835_SMI_DEV tristate "Character device driver for BCM2835 Secondary Memory Interface" - depends on (MACH_BCM2708 || MACH_BCM2709 || ARCH_BCM2835) && BCM2835_SMI + depends on BCM2835_SMI default m help This driver provides a character device interface (ioctl + read/write) to diff --git a/drivers/char/hw_random/Kconfig b/drivers/char/hw_random/Kconfig index 205b6b34d32c66..8c0770bf888135 100644 --- a/drivers/char/hw_random/Kconfig +++ b/drivers/char/hw_random/Kconfig @@ -90,7 +90,7 @@ config HW_RANDOM_BCM63XX config HW_RANDOM_BCM2835 tristate "Broadcom BCM2835 Random Number Generator support" - depends on ARCH_BCM2835 || ARCH_BCM2708 || ARCH_BCM2709 || ARCH_BCM_NSP || ARCH_BCM_5301X + depends on ARCH_BCM2835 || ARCH_BCM_NSP || ARCH_BCM_5301X default HW_RANDOM ---help--- This driver provides kernel-side support for the Random Number diff --git a/drivers/dma/Kconfig b/drivers/dma/Kconfig index 2a2108062687ff..61c3318e8c88e1 100644 --- a/drivers/dma/Kconfig +++ b/drivers/dma/Kconfig @@ -108,7 +108,7 @@ config COH901318 config DMA_BCM2835 tristate "BCM2835 DMA engine support" - depends on ARCH_BCM2835 || ARCH_BCM2708 || ARCH_BCM2709 + depends on ARCH_BCM2835 select DMA_ENGINE select DMA_VIRTUAL_CHANNELS diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig index 343adff44f82b7..71d7754587afbb 100644 --- a/drivers/gpio/Kconfig +++ b/drivers/gpio/Kconfig @@ -146,7 +146,7 @@ config GPIO_BCM_KONA config GPIO_BCM_VIRT bool "Broadcom Virt GPIO" - depends on OF_GPIO && RASPBERRYPI_FIRMWARE && (ARCH_BCM2835 || ARCH_BCM2708 || ARCH_BCM2709 || COMPILE_TEST) + depends on OF_GPIO && RASPBERRYPI_FIRMWARE && (ARCH_BCM2835 || COMPILE_TEST) help Turn on virtual GPIO support for Broadcom BCM283X chips. diff --git a/drivers/gpu/drm/vc4/Kconfig b/drivers/gpu/drm/vc4/Kconfig index f6e938208b7351..e53df59cb139f2 100644 --- a/drivers/gpu/drm/vc4/Kconfig +++ b/drivers/gpu/drm/vc4/Kconfig @@ -1,6 +1,6 @@ config DRM_VC4 tristate "Broadcom VC4 Graphics" - depends on ARCH_BCM2835 || ARCH_BCM2708 || ARCH_BCM2709 || COMPILE_TEST + depends on ARCH_BCM2835 || COMPILE_TEST depends on DRM select DRM_KMS_HELPER select DRM_KMS_CMA_HELPER diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig index 37f463232d6db9..9cd5735259276c 100644 --- a/drivers/i2c/busses/Kconfig +++ b/drivers/i2c/busses/Kconfig @@ -10,7 +10,7 @@ comment "PC SMBus host controller drivers" config I2C_BCM2708 tristate "BCM2708 BSC" - depends on MACH_BCM2708 || MACH_BCM2709 || ARCH_BCM2835 + depends on ARCH_BCM2835 help Enabling this option will add BSC (Broadcom Serial Controller) support for the BCM2708. BSC is a Broadcom proprietary bus compatible @@ -385,7 +385,7 @@ config I2C_AXXIA config I2C_BCM2835 tristate "Broadcom BCM2835 I2C controller" - depends on ARCH_BCM2835 || ARCH_BCM2708 || ARCH_BCM2709 + depends on ARCH_BCM2835 help If you say yes to this option, support will be included for the BCM2835 I2C controller. diff --git a/drivers/mailbox/Kconfig b/drivers/mailbox/Kconfig index dc46b41705af8e..7817d40d81e74a 100644 --- a/drivers/mailbox/Kconfig +++ b/drivers/mailbox/Kconfig @@ -74,7 +74,7 @@ config ALTERA_MBOX config BCM2835_MBOX tristate "BCM2835 Mailbox" - depends on ARCH_BCM2835 || ARCH_BCM2708 || ARCH_BCM2709 + depends on ARCH_BCM2835 help An implementation of the BCM2385 Mailbox. It is used to invoke the services of the Videocore. Say Y here if you want to use the diff --git a/drivers/media/platform/bcm2835/Kconfig b/drivers/media/platform/bcm2835/Kconfig index 99a5cbccf0f3fa..58d5f9600d726c 100644 --- a/drivers/media/platform/bcm2835/Kconfig +++ b/drivers/media/platform/bcm2835/Kconfig @@ -2,7 +2,7 @@ config VIDEO_BCM2835 bool "Broadcom BCM2835 camera interface driver" - depends on VIDEO_V4L2 && (ARCH_BCM2708 || ARCH_BCM2709 || ARCH_BCM2835) + depends on VIDEO_V4L2 && ARCH_BCM2835 ---help--- Say Y here to enable camera host interface devices for Broadcom BCM2835 SoC. This operates over the VCHIQ interface diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig index cff8c3df50c4b1..f34254bc14de8a 100644 --- a/drivers/misc/Kconfig +++ b/drivers/misc/Kconfig @@ -12,7 +12,7 @@ config SENSORS_LIS3LV02D config BCM2835_SMI tristate "Broadcom 283x Secondary Memory Interface driver" - depends on MACH_BCM2708 || MACH_BCM2709 || ARCH_BCM2835 + depends on ARCH_BCM2835 default m help Driver for enabling and using Broadcom's Secondary/Slow Memory Interface. diff --git a/drivers/mmc/host/Kconfig b/drivers/mmc/host/Kconfig index 205d836b52e3bb..87d251e93913b2 100644 --- a/drivers/mmc/host/Kconfig +++ b/drivers/mmc/host/Kconfig @@ -6,7 +6,7 @@ comment "MMC/SD/SDIO Host Controller Drivers" config MMC_BCM2835 tristate "MMC support on BCM2835" - depends on MACH_BCM2708 || MACH_BCM2709 || ARCH_BCM2835 + depends on ARCH_BCM2835 help This selects the MMC Interface on BCM2835. @@ -35,7 +35,7 @@ config MMC_BCM2835_PIO_DMA_BARRIER config MMC_BCM2835_SDHOST tristate "Support for the SDHost controller on BCM2708/9" - depends on MACH_BCM2708 || MACH_BCM2709 || ARCH_BCM2835 + depends on ARCH_BCM2835 help This selects the SDHost controller on BCM2835/6. diff --git a/drivers/mtd/nand/Kconfig b/drivers/mtd/nand/Kconfig index b6a0529b2c15f3..7825a51f7a4fee 100644 --- a/drivers/mtd/nand/Kconfig +++ b/drivers/mtd/nand/Kconfig @@ -43,7 +43,7 @@ config MTD_SM_COMMON config MTD_NAND_BCM2835_SMI tristate "Use Broadcom's Secondary Memory Interface as a NAND controller (BCM283x)" - depends on (MACH_BCM2708 || MACH_BCM2709 || ARCH_BCM2835) && BCM2835_SMI && MTD_NAND + depends on BCM2835_SMI default m help Uses the BCM2835's SMI peripheral as a NAND controller. diff --git a/drivers/pwm/Kconfig b/drivers/pwm/Kconfig index 549cf7a786e27e..80a566a00d0437 100644 --- a/drivers/pwm/Kconfig +++ b/drivers/pwm/Kconfig @@ -95,7 +95,7 @@ config PWM_BCM_KONA config PWM_BCM2835 tristate "BCM2835 PWM support" - depends on ARCH_BCM2835 || ARCH_BCM2708 || ARCH_BCM2709 + depends on ARCH_BCM2835 help PWM framework driver for BCM2835 controller (Raspberry Pi) diff --git a/drivers/soc/bcm/Kconfig b/drivers/soc/bcm/Kconfig index 7d11a44f36d2e6..a39b0d58ddd0fd 100644 --- a/drivers/soc/bcm/Kconfig +++ b/drivers/soc/bcm/Kconfig @@ -2,7 +2,7 @@ menu "Broadcom SoC drivers" config RASPBERRYPI_POWER bool "Raspberry Pi power domain driver" - depends on ARCH_BCM2835 || ARCH_BCM2708 || ARCH_BCM2709 || (COMPILE_TEST && OF) + depends on ARCH_BCM2835 || (COMPILE_TEST && OF) depends on RASPBERRYPI_FIRMWARE=y select PM_GENERIC_DOMAINS if PM help diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig index 4b09be74af155c..d6fb8d4b778672 100644 --- a/drivers/spi/Kconfig +++ b/drivers/spi/Kconfig @@ -94,7 +94,7 @@ config SPI_AXI_SPI_ENGINE config SPI_BCM2835 tristate "BCM2835 SPI controller" depends on GPIOLIB - depends on ARCH_BCM2835 || ARCH_BCM2708 || ARCH_BCM2709 || COMPILE_TEST + depends on ARCH_BCM2835 || COMPILE_TEST help This selects a driver for the Broadcom BCM2835 SPI master. @@ -105,7 +105,7 @@ config SPI_BCM2835 config SPI_BCM2835AUX tristate "BCM2835 SPI auxiliary controller" - depends on ((ARCH_BCM2835 || ARCH_BCM2708 || ARCH_BCM2709) && GPIOLIB) || COMPILE_TEST + depends on (ARCH_BCM2835 && GPIOLIB) || COMPILE_TEST help This selects a driver for the Broadcom BCM2835 SPI aux master. diff --git a/drivers/tty/serial/8250/Kconfig b/drivers/tty/serial/8250/Kconfig index 748098f900d347..7c6f7afca5ddee 100644 --- a/drivers/tty/serial/8250/Kconfig +++ b/drivers/tty/serial/8250/Kconfig @@ -291,7 +291,7 @@ config SERIAL_8250_ACORN config SERIAL_8250_BCM2835AUX tristate "BCM2835 auxiliar mini UART support" - depends on ARCH_BCM2708 || ARCH_BCM2709 || ARCH_BCM2835 || COMPILE_TEST + depends on ARCH_BCM2835 || COMPILE_TEST depends on SERIAL_8250 && SERIAL_8250_SHARE_IRQ help Support for the BCM2835 auxiliar mini UART. diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig index 9a28f1fdf93a79..1bffe006ca9a84 100644 --- a/drivers/watchdog/Kconfig +++ b/drivers/watchdog/Kconfig @@ -1440,7 +1440,7 @@ config BCM63XX_WDT config BCM2835_WDT tristate "Broadcom BCM2835 hardware watchdog" - depends on ARCH_BCM2835 || ARCH_BCM2708 || ARCH_BCM2709 + depends on ARCH_BCM2835 select WATCHDOG_CORE help Watchdog driver for the built in watchdog hardware in Broadcom diff --git a/sound/arm/Kconfig b/sound/arm/Kconfig index 8883c2f3a32697..02b6d263035ca1 100644 --- a/sound/arm/Kconfig +++ b/sound/arm/Kconfig @@ -34,8 +34,7 @@ config SND_PXA2XX_AC97 config SND_BCM2835 tristate "BCM2835 ALSA driver" - depends on (ARCH_BCM2708 || ARCH_BCM2709 || ARCH_BCM2835) \ - && BCM2708_VCHIQ && SND + depends on ARCH_BCM2835 && BCM2708_VCHIQ && SND select SND_PCM help Say Y or M if you want to support BCM2835 Alsa pcm card driver diff --git a/sound/soc/bcm/Kconfig b/sound/soc/bcm/Kconfig index aed7b47d8736ea..d024377e8450fb 100644 --- a/sound/soc/bcm/Kconfig +++ b/sound/soc/bcm/Kconfig @@ -1,6 +1,6 @@ config SND_BCM2835_SOC_I2S tristate "SoC Audio support for the Broadcom BCM2835 I2S module" - depends on ARCH_BCM2835 || MACH_BCM2708 || MACH_BCM2709 || COMPILE_TEST + depends on ARCH_BCM2835 || COMPILE_TEST select SND_SOC_GENERIC_DMAENGINE_PCM select REGMAP_MMIO help From e95a5918b0d6eba3f5689aa1c01266ade1b36674 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 28 Oct 2016 13:55:36 +0100 Subject: [PATCH 10/10] bcm270x: Use dma-ranges unconditionally on bcm2710 See: https://github.com/raspberrypi/linux/pull/1699 Signed-off-by: Phil Elwell --- arch/arm/boot/dts/bcm2710.dtsi | 4 ---- 1 file changed, 4 deletions(-) diff --git a/arch/arm/boot/dts/bcm2710.dtsi b/arch/arm/boot/dts/bcm2710.dtsi index 491594c918cf5d..df1a4ce1cd4e57 100644 --- a/arch/arm/boot/dts/bcm2710.dtsi +++ b/arch/arm/boot/dts/bcm2710.dtsi @@ -9,9 +9,7 @@ soc { ranges = <0x7e000000 0x3f000000 0x01000000>, <0x40000000 0x40000000 0x00040000>; -#ifdef RPI364 dma-ranges = <0xc0000000 0x00000000 0x3f000000>; -#endif local_intc: local_intc { compatible = "brcm,bcm2836-l1-intc"; @@ -143,9 +141,7 @@ &intc { compatible = "brcm,bcm2836-armctrl-ic"; -#ifdef RPI364 reg = <0x7e00b200 0x200>; -#endif interrupt-parent = <&local_intc>; interrupts = <8>; };