ramips: Add support for Mikrotik RouterBOARD RBM33g
[oweals/openwrt.git] / target / linux / brcm63xx / patches-4.9 / 390-MIPS-BCM63XX-do-not-register-SPI-controllers.patch
1 From 39d2882058345b5994680b8731848a0343878019 Mon Sep 17 00:00:00 2001
2 From: Jonas Gorski <jonas.gorski@gmail.com>
3 Date: Sat, 4 Feb 2017 12:58:50 +0100
4 Subject: [PATCH 7/8] MIPS: BCM63XX: do not register SPI controllers
5
6 We now register them through DT, so no need to keep them here.
7
8 Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
9 ---
10  arch/mips/bcm63xx/boards/board_bcm963xx.c | 7 -------
11  1 file changed, 7 deletions(-)
12
13 --- a/arch/mips/bcm63xx/boards/board_common.c
14 +++ b/arch/mips/bcm63xx/boards/board_common.c
15 @@ -28,9 +28,7 @@
16  #include <bcm63xx_dev_enet.h>
17  #include <bcm63xx_dev_dsp.h>
18  #include <bcm63xx_dev_flash.h>
19 -#include <bcm63xx_dev_hsspi.h>
20  #include <bcm63xx_dev_pcmcia.h>
21 -#include <bcm63xx_dev_spi.h>
22  #include <bcm63xx_dev_usb_ehci.h>
23  #include <bcm63xx_dev_usb_ohci.h>
24  #include <bcm63xx_dev_usb_usbd.h>
25 @@ -240,10 +238,6 @@ int __init board_register_devices(void)
26              bcm63xx_register_fallback_sprom(&board.fallback_sprom)))
27                 pr_err(PFX "failed to register fallback SPROM\n");
28  
29 -       bcm63xx_spi_register();
30 -
31 -       bcm63xx_hsspi_register();
32 -
33         bcm63xx_flash_register();
34  
35         bcm63xx_led_data.num_leds = ARRAY_SIZE(board.leds);
36 --- a/arch/mips/bcm63xx/Makefile
37 +++ b/arch/mips/bcm63xx/Makefile
38 @@ -1,6 +1,6 @@
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-pcmcia.o dev-rng.o dev-uart.o \
43                    dev-wdt.o dev-usb-ehci.o dev-usb-ohci.o dev-usb-usbd.o \
44                    usb-common.o sprom.o
45  obj-$(CONFIG_EARLY_PRINTK)     += early_printk.o
46 --- a/arch/mips/bcm63xx/dev-hsspi.c
47 +++ /dev/null
48 @@ -1,48 +0,0 @@
49 -/*
50 - * This file is subject to the terms and conditions of the GNU General Public
51 - * License.  See the file "COPYING" in the main directory of this archive
52 - * for more details.
53 - *
54 - * Copyright (C) 2012 Jonas Gorski <jonas.gorski@gmail.com>
55 - */
56 -
57 -#include <linux/init.h>
58 -#include <linux/kernel.h>
59 -#include <linux/platform_device.h>
60 -
61 -#include <bcm63xx_cpu.h>
62 -#include <bcm63xx_dev_hsspi.h>
63 -#include <bcm63xx_regs.h>
64 -
65 -static struct resource spi_resources[] = {
66 -       {
67 -               .start          = -1, /* filled at runtime */
68 -               .end            = -1, /* filled at runtime */
69 -               .flags          = IORESOURCE_MEM,
70 -       },
71 -       {
72 -               .start          = -1, /* filled at runtime */
73 -               .flags          = IORESOURCE_IRQ,
74 -       },
75 -};
76 -
77 -static struct platform_device bcm63xx_hsspi_device = {
78 -       .name           = "bcm63xx-hsspi",
79 -       .id             = 0,
80 -       .num_resources  = ARRAY_SIZE(spi_resources),
81 -       .resource       = spi_resources,
82 -};
83 -
84 -int __init bcm63xx_hsspi_register(void)
85 -{
86 -       if (!BCMCPU_IS_6318() && !BCMCPU_IS_6328() && !BCMCPU_IS_6362() &&
87 -               !BCMCPU_IS_63268())
88 -               return -ENODEV;
89 -
90 -       spi_resources[0].start = bcm63xx_regset_address(RSET_HSSPI);
91 -       spi_resources[0].end = spi_resources[0].start;
92 -       spi_resources[0].end += RSET_HSSPI_SIZE - 1;
93 -       spi_resources[1].start = bcm63xx_get_irq_number(IRQ_HSSPI);
94 -
95 -       return platform_device_register(&bcm63xx_hsspi_device);
96 -}
97 --- a/arch/mips/bcm63xx/dev-spi.c
98 +++ /dev/null
99 @@ -1,60 +0,0 @@
100 -/*
101 - * This file is subject to the terms and conditions of the GNU General Public
102 - * License.  See the file "COPYING" in the main directory of this archive
103 - * for more details.
104 - *
105 - * Copyright (C) 2009-2011 Florian Fainelli <florian@openwrt.org>
106 - * Copyright (C) 2010 Tanguy Bouzeloc <tanguy.bouzeloc@efixo.com>
107 - */
108 -
109 -#include <linux/init.h>
110 -#include <linux/kernel.h>
111 -#include <linux/export.h>
112 -#include <linux/platform_device.h>
113 -#include <linux/err.h>
114 -#include <linux/clk.h>
115 -
116 -#include <bcm63xx_cpu.h>
117 -#include <bcm63xx_dev_spi.h>
118 -#include <bcm63xx_regs.h>
119 -
120 -static struct resource spi_resources[] = {
121 -       {
122 -               .start          = -1, /* filled at runtime */
123 -               .end            = -1, /* filled at runtime */
124 -               .flags          = IORESOURCE_MEM,
125 -       },
126 -       {
127 -               .start          = -1, /* filled at runtime */
128 -               .flags          = IORESOURCE_IRQ,
129 -       },
130 -};
131 -
132 -static struct platform_device bcm63xx_spi_device = {
133 -       .id             = -1,
134 -       .num_resources  = ARRAY_SIZE(spi_resources),
135 -       .resource       = spi_resources,
136 -};
137 -
138 -int __init bcm63xx_spi_register(void)
139 -{
140 -       if (BCMCPU_IS_6318() || BCMCPU_IS_6328() || BCMCPU_IS_6345())
141 -               return -ENODEV;
142 -
143 -       spi_resources[0].start = bcm63xx_regset_address(RSET_SPI);
144 -       spi_resources[0].end = spi_resources[0].start;
145 -       spi_resources[1].start = bcm63xx_get_irq_number(IRQ_SPI);
146 -
147 -       if (BCMCPU_IS_6338() || BCMCPU_IS_6348()) {
148 -               bcm63xx_spi_device.name = "bcm6348-spi",
149 -               spi_resources[0].end += BCM_6348_RSET_SPI_SIZE - 1;
150 -       }
151 -
152 -       if (BCMCPU_IS_3368() || BCMCPU_IS_6358() || BCMCPU_IS_6362() ||
153 -               BCMCPU_IS_6368() || BCMCPU_IS_63268()) {
154 -               bcm63xx_spi_device.name = "bcm6358-spi",
155 -               spi_resources[0].end += BCM_6358_RSET_SPI_SIZE - 1;
156 -       }
157 -
158 -       return platform_device_register(&bcm63xx_spi_device);
159 -}
160 --- a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_hsspi.h
161 +++ /dev/null
162 @@ -1,8 +0,0 @@
163 -#ifndef BCM63XX_DEV_HSSPI_H
164 -#define BCM63XX_DEV_HSSPI_H
165 -
166 -#include <linux/types.h>
167 -
168 -int bcm63xx_hsspi_register(void);
169 -
170 -#endif /* BCM63XX_DEV_HSSPI_H */