1 From 51559154375fff4a94bbbc249fdd9248a80827b3 Mon Sep 17 00:00:00 2001
2 From: Jonas Gorski <jonas.gorski@gmail.com>
3 Date: Tue, 18 Dec 2018 10:19:02 +0100
4 Subject: [PATCH] MIPS: BCM63XX: drop unused and broken DSP platform device
6 Trying to register the DSP platform device results in a null pointer
9 [ 0.124184] CPU 0 Unable to handle kernel paging request at virtual address 00000000, epc == 804e305c, ra == 804e6f20
11 [ 0.137514] CPU: 0 PID: 1 Comm: swapper Not tainted 4.14.87
13 [ 0.197117] epc : 804e305c bcm63xx_dsp_register+0x80/0xa4
14 [ 0.202838] ra : 804e6f20 board_register_devices+0x258/0x390
17 This happens because it tries to copy the passed platform data over the
18 platform_device's unpopulated platform_data.
20 Since this code has been broken since its submission, no driver was ever
21 submitted for it, and apparently nobody was using it, just remove it
22 instead of trying to fix it.
24 Fixes: e7300d04bd08 ("MIPS: BCM63xx: Add support for the Broadcom BCM63xx family of SOCs.")
25 Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
27 arch/mips/bcm63xx/Makefile | 6 +--
28 arch/mips/bcm63xx/boards/board_bcm963xx.c | 20 --------
29 arch/mips/bcm63xx/dev-dsp.c | 56 ----------------------
30 .../include/asm/mach-bcm63xx/bcm63xx_dev_dsp.h | 14 ------
31 .../mips/include/asm/mach-bcm63xx/board_bcm963xx.h | 5 --
32 5 files changed, 3 insertions(+), 98 deletions(-)
33 delete mode 100644 arch/mips/bcm63xx/dev-dsp.c
34 delete mode 100644 arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_dsp.h
36 --- a/arch/mips/bcm63xx/Makefile
37 +++ b/arch/mips/bcm63xx/Makefile
39 # SPDX-License-Identifier: GPL-2.0
40 obj-y += clk.o cpu.o cs.o gpio.o irq.o nvram.o prom.o reset.o \
41 - setup.o timer.o dev-dsp.o dev-enet.o dev-flash.o \
42 - dev-pcmcia.o dev-rng.o dev-spi.o dev-hsspi.o dev-uart.o \
43 - dev-wdt.o dev-usb-usbd.o
44 + setup.o timer.o dev-enet.o dev-flash.o dev-pcmcia.o \
45 + dev-rng.o dev-spi.o dev-hsspi.o dev-uart.o dev-wdt.o \
47 obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
50 --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
51 +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
53 #include <bcm63xx_nvram.h>
54 #include <bcm63xx_dev_pci.h>
55 #include <bcm63xx_dev_enet.h>
56 -#include <bcm63xx_dev_dsp.h>
57 #include <bcm63xx_dev_flash.h>
58 #include <bcm63xx_dev_hsspi.h>
59 #include <bcm63xx_dev_pcmcia.h>
60 @@ -289,14 +288,6 @@ static struct board_info __initdata boar
75 @@ -401,14 +392,6 @@ static struct board_info __initdata boar
90 @@ -898,9 +881,6 @@ int __init board_register_devices(void)
92 bcm63xx_usbd_register(&board.usbd);
95 - bcm63xx_dsp_register(&board.dsp);
97 /* Generate MAC address for WLAN and register our SPROM,
98 * do this after registering enet devices
100 --- a/arch/mips/bcm63xx/dev-dsp.c
104 - * Broadcom BCM63xx VoIP DSP registration
106 - * This file is subject to the terms and conditions of the GNU General Public
107 - * License. See the file "COPYING" in the main directory of this archive
108 - * for more details.
110 - * Copyright (C) 2009 Florian Fainelli <florian@openwrt.org>
113 -#include <linux/init.h>
114 -#include <linux/kernel.h>
115 -#include <linux/platform_device.h>
117 -#include <bcm63xx_cpu.h>
118 -#include <bcm63xx_dev_dsp.h>
119 -#include <bcm63xx_regs.h>
120 -#include <bcm63xx_io.h>
122 -static struct resource voip_dsp_resources[] = {
124 - .start = -1, /* filled at runtime */
125 - .end = -1, /* filled at runtime */
126 - .flags = IORESOURCE_MEM,
129 - .start = -1, /* filled at runtime */
130 - .flags = IORESOURCE_IRQ,
134 -static struct platform_device bcm63xx_voip_dsp_device = {
135 - .name = "bcm63xx-voip-dsp",
137 - .num_resources = ARRAY_SIZE(voip_dsp_resources),
138 - .resource = voip_dsp_resources,
141 -int __init bcm63xx_dsp_register(const struct bcm63xx_dsp_platform_data *pd)
143 - struct bcm63xx_dsp_platform_data *dpd;
146 - /* Get the memory window */
147 - val = bcm_mpi_readl(MPI_CSBASE_REG(pd->cs - 1));
148 - val &= MPI_CSBASE_BASE_MASK;
149 - voip_dsp_resources[0].start = val;
150 - voip_dsp_resources[0].end = val + 0xFFFFFFF;
151 - voip_dsp_resources[1].start = pd->ext_irq;
153 - /* copy given platform data */
154 - dpd = bcm63xx_voip_dsp_device.dev.platform_data;
155 - memcpy(dpd, pd, sizeof (*pd));
157 - return platform_device_register(&bcm63xx_voip_dsp_device);
159 --- a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_dsp.h
162 -/* SPDX-License-Identifier: GPL-2.0 */
163 -#ifndef __BCM63XX_DSP_H
164 -#define __BCM63XX_DSP_H
166 -struct bcm63xx_dsp_platform_data {
173 -int __init bcm63xx_dsp_register(const struct bcm63xx_dsp_platform_data *pd);
175 -#endif /* __BCM63XX_DSP_H */
176 --- a/arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h
177 +++ b/arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h
179 #include <linux/leds.h>
180 #include <bcm63xx_dev_enet.h>
181 #include <bcm63xx_dev_usb_usbd.h>
182 -#include <bcm63xx_dev_dsp.h>
186 @@ -31,7 +30,6 @@ struct board_info {
187 unsigned int has_ohci0:1;
188 unsigned int has_ehci0:1;
189 unsigned int has_usbd:1;
190 - unsigned int has_dsp:1;
191 unsigned int has_uart0:1;
192 unsigned int has_uart1:1;
194 @@ -43,9 +41,6 @@ struct board_info {
196 struct bcm63xx_usbd_platform_data usbd;
199 - struct bcm63xx_dsp_platform_data dsp;
202 struct gpio_led leds[5];