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 obj-y += clk.o cpu.o cs.o gpio.o irq.o nvram.o prom.o reset.o \
40 - setup.o timer.o dev-dsp.o dev-enet.o dev-flash.o \
41 - dev-pcmcia.o dev-rng.o dev-spi.o dev-hsspi.o dev-uart.o \
42 - dev-wdt.o dev-usb-usbd.o
43 + setup.o timer.o dev-enet.o dev-flash.o dev-pcmcia.o \
44 + dev-rng.o dev-spi.o dev-hsspi.o dev-uart.o dev-wdt.o \
46 obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
49 --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
50 +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
52 #include <bcm63xx_nvram.h>
53 #include <bcm63xx_dev_pci.h>
54 #include <bcm63xx_dev_enet.h>
55 -#include <bcm63xx_dev_dsp.h>
56 #include <bcm63xx_dev_flash.h>
57 #include <bcm63xx_dev_hsspi.h>
58 #include <bcm63xx_dev_pcmcia.h>
59 @@ -289,14 +288,6 @@ static struct board_info __initdata boar
74 @@ -401,14 +392,6 @@ static struct board_info __initdata boar
89 @@ -898,9 +881,6 @@ int __init board_register_devices(void)
91 bcm63xx_usbd_register(&board.usbd);
94 - bcm63xx_dsp_register(&board.dsp);
96 /* Generate MAC address for WLAN and register our SPROM,
97 * do this after registering enet devices
99 --- a/arch/mips/bcm63xx/dev-dsp.c
103 - * Broadcom BCM63xx VoIP DSP registration
105 - * This file is subject to the terms and conditions of the GNU General Public
106 - * License. See the file "COPYING" in the main directory of this archive
107 - * for more details.
109 - * Copyright (C) 2009 Florian Fainelli <florian@openwrt.org>
112 -#include <linux/init.h>
113 -#include <linux/kernel.h>
114 -#include <linux/platform_device.h>
116 -#include <bcm63xx_cpu.h>
117 -#include <bcm63xx_dev_dsp.h>
118 -#include <bcm63xx_regs.h>
119 -#include <bcm63xx_io.h>
121 -static struct resource voip_dsp_resources[] = {
123 - .start = -1, /* filled at runtime */
124 - .end = -1, /* filled at runtime */
125 - .flags = IORESOURCE_MEM,
128 - .start = -1, /* filled at runtime */
129 - .flags = IORESOURCE_IRQ,
133 -static struct platform_device bcm63xx_voip_dsp_device = {
134 - .name = "bcm63xx-voip-dsp",
136 - .num_resources = ARRAY_SIZE(voip_dsp_resources),
137 - .resource = voip_dsp_resources,
140 -int __init bcm63xx_dsp_register(const struct bcm63xx_dsp_platform_data *pd)
142 - struct bcm63xx_dsp_platform_data *dpd;
145 - /* Get the memory window */
146 - val = bcm_mpi_readl(MPI_CSBASE_REG(pd->cs - 1));
147 - val &= MPI_CSBASE_BASE_MASK;
148 - voip_dsp_resources[0].start = val;
149 - voip_dsp_resources[0].end = val + 0xFFFFFFF;
150 - voip_dsp_resources[1].start = pd->ext_irq;
152 - /* copy given platform data */
153 - dpd = bcm63xx_voip_dsp_device.dev.platform_data;
154 - memcpy(dpd, pd, sizeof (*pd));
156 - return platform_device_register(&bcm63xx_voip_dsp_device);
158 --- a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_dsp.h
161 -#ifndef __BCM63XX_DSP_H
162 -#define __BCM63XX_DSP_H
164 -struct bcm63xx_dsp_platform_data {
171 -int __init bcm63xx_dsp_register(const struct bcm63xx_dsp_platform_data *pd);
173 -#endif /* __BCM63XX_DSP_H */
174 --- a/arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h
175 +++ b/arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h
177 #include <linux/leds.h>
178 #include <bcm63xx_dev_enet.h>
179 #include <bcm63xx_dev_usb_usbd.h>
180 -#include <bcm63xx_dev_dsp.h>
184 @@ -30,7 +29,6 @@ struct board_info {
185 unsigned int has_ohci0:1;
186 unsigned int has_ehci0:1;
187 unsigned int has_usbd:1;
188 - unsigned int has_dsp:1;
189 unsigned int has_uart0:1;
190 unsigned int has_uart1:1;
192 @@ -42,9 +40,6 @@ struct board_info {
194 struct bcm63xx_usbd_platform_data usbd;
197 - struct bcm63xx_dsp_platform_data dsp;
200 struct gpio_led leds[5];