Skip to content

Commit ea708ac

Browse files
robherringbrgl
authored andcommitted
gpio: xlp: Remove Netlogic XLP variants
Netlogic XLP was removed in commit 95b8a5e ("MIPS: Remove NETLOGIC support"). With those gone, the single platform left to support is Cavium ThunderX2. Remove all the Netlogic variants and DT support. For simplicity, the existing kconfig name is retained. Cc: Linus Walleij <[email protected]> Cc: Bartosz Golaszewski <[email protected]> Cc: [email protected] Signed-off-by: Rob Herring <[email protected]> Reviewed-by: Linus Walleij <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
1 parent c61d8b5 commit ea708ac

File tree

2 files changed

+13
-139
lines changed

2 files changed

+13
-139
lines changed

drivers/gpio/Kconfig

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -730,14 +730,12 @@ config GPIO_XILINX
730730
Say yes here to support the Xilinx FPGA GPIO device.
731731

732732
config GPIO_XLP
733-
tristate "Netlogic XLP GPIO support"
734-
depends on OF_GPIO && (CPU_XLP || ARCH_THUNDER2 || COMPILE_TEST)
733+
tristate "Cavium ThunderX2 GPIO support"
734+
depends on ARCH_THUNDER2 || COMPILE_TEST
735735
select GPIOLIB_IRQCHIP
736736
help
737-
This driver provides support for GPIO interface on Netlogic XLP MIPS64
738-
SoCs. Currently supported XLP variants are XLP8XX, XLP3XX, XLP2XX,
739-
XLP9XX and XLP5XX. The same GPIO controller block is also present in
740-
Cavium's ThunderX2 CN99XX SoCs.
737+
This driver provides support for GPIO interface on Cavium's ThunderX2
738+
CN99XX SoCs (Originally from Netlogic XLP).
741739

742740
If unsure, say N.
743741

drivers/gpio/gpio-xlp.c

Lines changed: 9 additions & 133 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
#include <linux/gpio/driver.h>
88
#include <linux/platform_device.h>
9-
#include <linux/of_device.h>
109
#include <linux/module.h>
1110
#include <linux/irq.h>
1211
#include <linux/interrupt.h>
@@ -26,16 +25,6 @@
2625
*
2726
* where addr is base address of the that feature register and gpio is the pin.
2827
*/
29-
#define GPIO_OUTPUT_EN 0x00
30-
#define GPIO_PADDRV 0x08
31-
#define GPIO_INT_EN00 0x18
32-
#define GPIO_INT_EN10 0x20
33-
#define GPIO_INT_EN20 0x28
34-
#define GPIO_INT_EN30 0x30
35-
#define GPIO_INT_POL 0x38
36-
#define GPIO_INT_TYPE 0x40
37-
#define GPIO_INT_STAT 0x48
38-
3928
#define GPIO_9XX_BYTESWAP 0X00
4029
#define GPIO_9XX_CTRL 0X04
4130
#define GPIO_9XX_OUTPUT_EN 0x14
@@ -52,14 +41,6 @@
5241
#define GPIO_9XX_INT_TYPE 0x114
5342
#define GPIO_9XX_INT_STAT 0x124
5443

55-
#define GPIO_3XX_INT_EN00 0x18
56-
#define GPIO_3XX_INT_EN10 0x20
57-
#define GPIO_3XX_INT_EN20 0x28
58-
#define GPIO_3XX_INT_EN30 0x30
59-
#define GPIO_3XX_INT_POL 0x78
60-
#define GPIO_3XX_INT_TYPE 0x80
61-
#define GPIO_3XX_INT_STAT 0x88
62-
6344
/* Interrupt type register mask */
6445
#define XLP_GPIO_IRQ_TYPE_LVL 0x0
6546
#define XLP_GPIO_IRQ_TYPE_EDGE 0x1
@@ -72,16 +53,6 @@
7253
#define XLP_GPIO_IRQ_BASE 768
7354
#define XLP_MAX_NR_GPIO 96
7455

75-
/* XLP variants supported by this driver */
76-
enum {
77-
XLP_GPIO_VARIANT_XLP832 = 1,
78-
XLP_GPIO_VARIANT_XLP316,
79-
XLP_GPIO_VARIANT_XLP208,
80-
XLP_GPIO_VARIANT_XLP980,
81-
XLP_GPIO_VARIANT_XLP532,
82-
GPIO_VARIANT_VULCAN
83-
};
84-
8556
struct xlp_gpio_priv {
8657
struct gpio_chip chip;
8758
DECLARE_BITMAP(gpio_enabled_mask, XLP_MAX_NR_GPIO);
@@ -257,44 +228,13 @@ static void xlp_gpio_set(struct gpio_chip *gc, unsigned gpio, int state)
257228
xlp_gpio_set_reg(priv->gpio_paddrv, gpio, state);
258229
}
259230

260-
static const struct of_device_id xlp_gpio_of_ids[] = {
261-
{
262-
.compatible = "netlogic,xlp832-gpio",
263-
.data = (void *)XLP_GPIO_VARIANT_XLP832,
264-
},
265-
{
266-
.compatible = "netlogic,xlp316-gpio",
267-
.data = (void *)XLP_GPIO_VARIANT_XLP316,
268-
},
269-
{
270-
.compatible = "netlogic,xlp208-gpio",
271-
.data = (void *)XLP_GPIO_VARIANT_XLP208,
272-
},
273-
{
274-
.compatible = "netlogic,xlp980-gpio",
275-
.data = (void *)XLP_GPIO_VARIANT_XLP980,
276-
},
277-
{
278-
.compatible = "netlogic,xlp532-gpio",
279-
.data = (void *)XLP_GPIO_VARIANT_XLP532,
280-
},
281-
{
282-
.compatible = "brcm,vulcan-gpio",
283-
.data = (void *)GPIO_VARIANT_VULCAN,
284-
},
285-
{ /* sentinel */ },
286-
};
287-
MODULE_DEVICE_TABLE(of, xlp_gpio_of_ids);
288-
289231
static int xlp_gpio_probe(struct platform_device *pdev)
290232
{
291233
struct gpio_chip *gc;
292234
struct gpio_irq_chip *girq;
293235
struct xlp_gpio_priv *priv;
294236
void __iomem *gpio_base;
295-
int irq_base, irq, err;
296-
int ngpio;
297-
u32 soc_type;
237+
int irq, err;
298238

299239
priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
300240
if (!priv)
@@ -308,62 +248,12 @@ static int xlp_gpio_probe(struct platform_device *pdev)
308248
if (irq < 0)
309249
return irq;
310250

311-
if (pdev->dev.of_node) {
312-
soc_type = (uintptr_t)of_device_get_match_data(&pdev->dev);
313-
} else {
314-
const struct acpi_device_id *acpi_id;
315-
316-
acpi_id = acpi_match_device(pdev->dev.driver->acpi_match_table,
317-
&pdev->dev);
318-
if (!acpi_id || !acpi_id->driver_data) {
319-
dev_err(&pdev->dev, "Unable to match ACPI ID\n");
320-
return -ENODEV;
321-
}
322-
soc_type = (uintptr_t) acpi_id->driver_data;
323-
}
324-
325-
switch (soc_type) {
326-
case XLP_GPIO_VARIANT_XLP832:
327-
priv->gpio_out_en = gpio_base + GPIO_OUTPUT_EN;
328-
priv->gpio_paddrv = gpio_base + GPIO_PADDRV;
329-
priv->gpio_intr_stat = gpio_base + GPIO_INT_STAT;
330-
priv->gpio_intr_type = gpio_base + GPIO_INT_TYPE;
331-
priv->gpio_intr_pol = gpio_base + GPIO_INT_POL;
332-
priv->gpio_intr_en = gpio_base + GPIO_INT_EN00;
333-
ngpio = 41;
334-
break;
335-
case XLP_GPIO_VARIANT_XLP208:
336-
case XLP_GPIO_VARIANT_XLP316:
337-
priv->gpio_out_en = gpio_base + GPIO_OUTPUT_EN;
338-
priv->gpio_paddrv = gpio_base + GPIO_PADDRV;
339-
priv->gpio_intr_stat = gpio_base + GPIO_3XX_INT_STAT;
340-
priv->gpio_intr_type = gpio_base + GPIO_3XX_INT_TYPE;
341-
priv->gpio_intr_pol = gpio_base + GPIO_3XX_INT_POL;
342-
priv->gpio_intr_en = gpio_base + GPIO_3XX_INT_EN00;
343-
344-
ngpio = (soc_type == XLP_GPIO_VARIANT_XLP208) ? 42 : 57;
345-
break;
346-
case XLP_GPIO_VARIANT_XLP980:
347-
case XLP_GPIO_VARIANT_XLP532:
348-
case GPIO_VARIANT_VULCAN:
349-
priv->gpio_out_en = gpio_base + GPIO_9XX_OUTPUT_EN;
350-
priv->gpio_paddrv = gpio_base + GPIO_9XX_PADDRV;
351-
priv->gpio_intr_stat = gpio_base + GPIO_9XX_INT_STAT;
352-
priv->gpio_intr_type = gpio_base + GPIO_9XX_INT_TYPE;
353-
priv->gpio_intr_pol = gpio_base + GPIO_9XX_INT_POL;
354-
priv->gpio_intr_en = gpio_base + GPIO_9XX_INT_EN00;
355-
356-
if (soc_type == XLP_GPIO_VARIANT_XLP980)
357-
ngpio = 66;
358-
else if (soc_type == XLP_GPIO_VARIANT_XLP532)
359-
ngpio = 67;
360-
else
361-
ngpio = 70;
362-
break;
363-
default:
364-
dev_err(&pdev->dev, "Unknown Processor type!\n");
365-
return -ENODEV;
366-
}
251+
priv->gpio_out_en = gpio_base + GPIO_9XX_OUTPUT_EN;
252+
priv->gpio_paddrv = gpio_base + GPIO_9XX_PADDRV;
253+
priv->gpio_intr_stat = gpio_base + GPIO_9XX_INT_STAT;
254+
priv->gpio_intr_type = gpio_base + GPIO_9XX_INT_TYPE;
255+
priv->gpio_intr_pol = gpio_base + GPIO_9XX_INT_POL;
256+
priv->gpio_intr_en = gpio_base + GPIO_9XX_INT_EN00;
367257

368258
bitmap_zero(priv->gpio_enabled_mask, XLP_MAX_NR_GPIO);
369259

@@ -373,7 +263,7 @@ static int xlp_gpio_probe(struct platform_device *pdev)
373263
gc->label = dev_name(&pdev->dev);
374264
gc->base = 0;
375265
gc->parent = &pdev->dev;
376-
gc->ngpio = ngpio;
266+
gc->ngpio = 70;
377267
gc->of_node = pdev->dev.of_node;
378268
gc->direction_output = xlp_gpio_dir_output;
379269
gc->direction_input = xlp_gpio_dir_input;
@@ -382,19 +272,6 @@ static int xlp_gpio_probe(struct platform_device *pdev)
382272

383273
spin_lock_init(&priv->lock);
384274

385-
/* XLP(MIPS) has fixed range for GPIO IRQs, Vulcan(ARM64) does not */
386-
if (soc_type != GPIO_VARIANT_VULCAN) {
387-
irq_base = devm_irq_alloc_descs(&pdev->dev, -1,
388-
XLP_GPIO_IRQ_BASE,
389-
gc->ngpio, 0);
390-
if (irq_base < 0) {
391-
dev_err(&pdev->dev, "Failed to allocate IRQ numbers\n");
392-
return irq_base;
393-
}
394-
} else {
395-
irq_base = 0;
396-
}
397-
398275
girq = &gc->irq;
399276
girq->chip = &xlp_gpio_irq_chip;
400277
girq->parent_handler = xlp_gpio_generic_handler;
@@ -405,7 +282,7 @@ static int xlp_gpio_probe(struct platform_device *pdev)
405282
if (!girq->parents)
406283
return -ENOMEM;
407284
girq->parents[0] = irq;
408-
girq->first = irq_base;
285+
girq->first = 0;
409286
girq->default_type = IRQ_TYPE_NONE;
410287
girq->handler = handle_level_irq;
411288

@@ -430,7 +307,6 @@ MODULE_DEVICE_TABLE(acpi, xlp_gpio_acpi_match);
430307
static struct platform_driver xlp_gpio_driver = {
431308
.driver = {
432309
.name = "xlp-gpio",
433-
.of_match_table = xlp_gpio_of_ids,
434310
.acpi_match_table = ACPI_PTR(xlp_gpio_acpi_match),
435311
},
436312
.probe = xlp_gpio_probe,

0 commit comments

Comments
 (0)