* [PATCH 00/14] ARM: remove unused davinci board & drivers
@ 2022-10-19 15:29 Arnd Bergmann
2022-10-19 15:29 ` [PATCH 02/14] ARM: davinci: drop DAVINCI_DMxxx references Arnd Bergmann
` (16 more replies)
0 siblings, 17 replies; 44+ messages in thread
From: Arnd Bergmann @ 2022-10-19 15:29 UTC (permalink / raw)
To: Sekhar Nori, Bartosz Golaszewski, linux-arm-kernel
Cc: linux-kernel, Kevin Hilman, Arnd Bergmann, Russell King,
Mauro Carvalho Chehab, Damien Le Moal, Sergey Shtylyov,
David Lechner, Michael Turquette, Stephen Boyd, Dmitry Torokhov,
Thomas Gleixner, Marc Zyngier, Lad, Prabhakar, Lee Jones,
Alessandro Zummo, Alexandre Belloni, Greg Kroah-Hartman, Bin Liu,
Peter Ujfalusi, Liam Girdwood, Mark Brown, Jaroslav Kysela,
Takashi Iwai, Laurent Pinchart, Hans Verkuil, Yang Yingliang,
linux-media, linux-ide, linux-clk, linux-input, linux-rtc,
linux-staging, linux-usb, alsa-devel
From: Arnd Bergmann <arnd@arndb.de>
As part of removing all board files that were previously marked as unused,
I looked through the davinci platform and recursively removed everything
that has now become unused.
In particular, this is for all dm3xx support, in addition to the dm64xx
support removed previously. The remaining support is now for da8xx using
devicetree only, which means a lot of the da8xx specific device support
can also go away.
As with the previous series, I can keep patches together in the
soc tree, or subsystem maintainers can pick them up individually
through their subsystems, whichever they prefer.
Arnd Bergmann (14):
ARM: davinci: remove unused board support
ARM: davinci: drop DAVINCI_DMxxx references
ARM: davinci: clean up platform support
clk: remove davinci dm3xx drivers
usb: musb: remove unused davinci support
mfd: remove dm355evm_msp driver
input: remove davinci keyboard driver
rtc: remove davinci rtc driver
ASoC: remove unused davinci support
mfd: remove davinci voicecodec driver
pata: remove palmchip bk3710 driver
irqchip: remove davinci aintc driver
staging: media: remove davinci vpfe_capture driver
media: davinci: remove vpbe support
Cc: Sekhar Nori <nsekhar@ti.com>
Cc: Bartosz Golaszewski <brgl@bgdev.pl>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Cc: Sergey Shtylyov <s.shtylyov@omp.ru>
Cc: David Lechner <david@lechnology.com>
Cc: Michael Turquette <mturquette@baylibre.com>
Cc: Stephen Boyd <sboyd@kernel.org>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Marc Zyngier <maz@kernel.org>
Cc: "Lad, Prabhakar" <prabhakar.csengg@gmail.com>
Cc: Lee Jones <lee@kernel.org>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Bin Liu <b-liu@ti.com>
Cc: Peter Ujfalusi <peter.ujfalusi@gmail.com>
Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Takashi Iwai <tiwai@suse.com>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Cc: Yang Yingliang <yangyingliang@huawei.com>
Cc: linux-media@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-ide@vger.kernel.org
Cc: linux-clk@vger.kernel.org
Cc: linux-input@vger.kernel.org
Cc: linux-rtc@vger.kernel.org
Cc: linux-staging@lists.linux.dev
Cc: linux-usb@vger.kernel.org
Cc: alsa-devel@alsa-project.org
.../admin-guide/media/davinci-vpbe.rst | 65 -
.../admin-guide/media/platform-cardlist.rst | 1 -
.../admin-guide/media/v4l-drivers.rst | 1 -
.../media/drivers/davinci-vpbe-devel.rst | 39 -
.../driver-api/media/drivers/index.rst | 1 -
MAINTAINERS | 1 -
arch/arm/Kconfig.debug | 16 +-
arch/arm/mach-davinci/Kconfig | 142 --
arch/arm/mach-davinci/Makefile | 18 +-
arch/arm/mach-davinci/board-da830-evm.c | 690 ------
arch/arm/mach-davinci/board-da850-evm.c | 1550 --------------
arch/arm/mach-davinci/board-dm355-evm.c | 444 ----
arch/arm/mach-davinci/board-dm355-leopard.c | 278 ---
arch/arm/mach-davinci/board-dm365-evm.c | 855 --------
arch/arm/mach-davinci/board-mityomapl138.c | 638 ------
arch/arm/mach-davinci/board-omapl138-hawk.c | 451 ----
arch/arm/mach-davinci/common.h | 7 +-
arch/arm/mach-davinci/cputype.h | 53 -
arch/arm/mach-davinci/da830.c | 274 ---
arch/arm/mach-davinci/da850.c | 400 +---
arch/arm/mach-davinci/da8xx.h | 95 +-
arch/arm/mach-davinci/davinci.h | 136 --
arch/arm/mach-davinci/devices-da8xx.c | 1094 ----------
arch/arm/mach-davinci/devices.c | 303 ---
arch/arm/mach-davinci/dm355.c | 832 -------
arch/arm/mach-davinci/dm365.c | 1094 ----------
arch/arm/mach-davinci/mux.c | 15 -
arch/arm/mach-davinci/serial.c | 92 -
arch/arm/mach-davinci/serial.h | 15 -
arch/arm/mach-davinci/usb-da8xx.c | 146 --
arch/arm/mach-davinci/usb.c | 87 -
drivers/ata/Kconfig | 10 -
drivers/ata/Makefile | 1 -
drivers/ata/pata_bk3710.c | 380 ----
drivers/clk/davinci/Makefile | 4 -
drivers/clk/davinci/pll-dm355.c | 77 -
drivers/clk/davinci/pll-dm365.c | 146 --
drivers/clk/davinci/pll.c | 8 -
drivers/clk/davinci/pll.h | 5 -
drivers/clk/davinci/psc-dm355.c | 89 -
drivers/clk/davinci/psc-dm365.c | 111 -
drivers/clk/davinci/psc.c | 6 -
drivers/clk/davinci/psc.h | 7 -
drivers/input/keyboard/Kconfig | 10 -
drivers/input/keyboard/Makefile | 1 -
drivers/input/keyboard/davinci_keyscan.c | 315 ---
drivers/input/misc/Kconfig | 11 -
drivers/input/misc/Makefile | 1 -
drivers/input/misc/dm355evm_keys.c | 238 ---
drivers/irqchip/Kconfig | 5 -
drivers/irqchip/Makefile | 1 -
drivers/irqchip/irq-davinci-aintc.c | 163 --
drivers/media/platform/ti/davinci/Kconfig | 16 -
drivers/media/platform/ti/davinci/Makefile | 3 -
drivers/media/platform/ti/davinci/vpbe.c | 840 --------
.../media/platform/ti/davinci/vpbe_display.c | 1510 -------------
drivers/media/platform/ti/davinci/vpbe_osd.c | 1582 --------------
.../media/platform/ti/davinci/vpbe_osd_regs.h | 352 ---
drivers/media/platform/ti/davinci/vpbe_venc.c | 676 ------
.../platform/ti/davinci/vpbe_venc_regs.h | 165 --
drivers/media/platform/ti/davinci/vpss.c | 529 -----
drivers/mfd/Kconfig | 13 -
drivers/mfd/Makefile | 3 -
drivers/mfd/davinci_voicecodec.c | 136 --
drivers/mfd/dm355evm_msp.c | 454 ----
drivers/rtc/Kconfig | 16 -
drivers/rtc/Makefile | 2 -
drivers/rtc/rtc-davinci.c | 512 -----
drivers/rtc/rtc-dm355evm.c | 151 --
drivers/staging/media/Kconfig | 1 -
drivers/staging/media/Makefile | 1 -
.../media/deprecated/vpfe_capture/Kconfig | 58 -
.../media/deprecated/vpfe_capture/Makefile | 4 -
.../media/deprecated/vpfe_capture/TODO | 7 -
.../deprecated/vpfe_capture/ccdc_hw_device.h | 80 -
.../deprecated/vpfe_capture/dm355_ccdc.c | 934 --------
.../deprecated/vpfe_capture/dm355_ccdc.h | 308 ---
.../deprecated/vpfe_capture/dm355_ccdc_regs.h | 297 ---
.../deprecated/vpfe_capture/dm644x_ccdc.c | 879 --------
.../deprecated/vpfe_capture/dm644x_ccdc.h | 171 --
.../vpfe_capture/dm644x_ccdc_regs.h | 140 --
.../media/deprecated/vpfe_capture/isif.c | 1127 ----------
.../media/deprecated/vpfe_capture/isif.h | 518 -----
.../media/deprecated/vpfe_capture/isif_regs.h | 256 ---
.../deprecated/vpfe_capture/vpfe_capture.c | 1902 -----------------
drivers/usb/musb/Kconfig | 12 -
drivers/usb/musb/Makefile | 2 -
drivers/usb/musb/cppi_dma.c | 1547 --------------
drivers/usb/musb/davinci.c | 606 ------
drivers/usb/musb/davinci.h | 103 -
include/linux/clk/davinci.h | 9 -
include/linux/mfd/dm355evm_msp.h | 79 -
include/media/davinci/vpbe.h | 184 --
include/media/davinci/vpbe_display.h | 122 --
include/media/davinci/vpbe_osd.h | 382 ----
include/media/davinci/vpbe_types.h | 74 -
include/media/davinci/vpbe_venc.h | 37 -
include/media/davinci/vpfe_capture.h | 177 --
include/media/davinci/vpss.h | 111 -
sound/soc/ti/Kconfig | 40 -
sound/soc/ti/Makefile | 2 -
sound/soc/ti/davinci-evm.c | 267 +--
sound/soc/ti/davinci-vcif.c | 247 ---
103 files changed, 17 insertions(+), 29049 deletions(-)
delete mode 100644 Documentation/admin-guide/media/davinci-vpbe.rst
delete mode 100644 Documentation/driver-api/media/drivers/davinci-vpbe-devel.rst
delete mode 100644 arch/arm/mach-davinci/board-da830-evm.c
delete mode 100644 arch/arm/mach-davinci/board-da850-evm.c
delete mode 100644 arch/arm/mach-davinci/board-dm355-evm.c
delete mode 100644 arch/arm/mach-davinci/board-dm355-leopard.c
delete mode 100644 arch/arm/mach-davinci/board-dm365-evm.c
delete mode 100644 arch/arm/mach-davinci/board-mityomapl138.c
delete mode 100644 arch/arm/mach-davinci/board-omapl138-hawk.c
delete mode 100644 arch/arm/mach-davinci/davinci.h
delete mode 100644 arch/arm/mach-davinci/devices.c
delete mode 100644 arch/arm/mach-davinci/dm355.c
delete mode 100644 arch/arm/mach-davinci/dm365.c
delete mode 100644 arch/arm/mach-davinci/serial.c
delete mode 100644 arch/arm/mach-davinci/usb-da8xx.c
delete mode 100644 arch/arm/mach-davinci/usb.c
delete mode 100644 drivers/ata/pata_bk3710.c
delete mode 100644 drivers/clk/davinci/pll-dm355.c
delete mode 100644 drivers/clk/davinci/pll-dm365.c
delete mode 100644 drivers/clk/davinci/psc-dm355.c
delete mode 100644 drivers/clk/davinci/psc-dm365.c
delete mode 100644 drivers/input/keyboard/davinci_keyscan.c
delete mode 100644 drivers/input/misc/dm355evm_keys.c
delete mode 100644 drivers/irqchip/irq-davinci-aintc.c
delete mode 100644 drivers/media/platform/ti/davinci/vpbe.c
delete mode 100644 drivers/media/platform/ti/davinci/vpbe_display.c
delete mode 100644 drivers/media/platform/ti/davinci/vpbe_osd.c
delete mode 100644 drivers/media/platform/ti/davinci/vpbe_osd_regs.h
delete mode 100644 drivers/media/platform/ti/davinci/vpbe_venc.c
delete mode 100644 drivers/media/platform/ti/davinci/vpbe_venc_regs.h
delete mode 100644 drivers/media/platform/ti/davinci/vpss.c
delete mode 100644 drivers/mfd/davinci_voicecodec.c
delete mode 100644 drivers/mfd/dm355evm_msp.c
delete mode 100644 drivers/rtc/rtc-davinci.c
delete mode 100644 drivers/rtc/rtc-dm355evm.c
delete mode 100644 drivers/staging/media/deprecated/vpfe_capture/Kconfig
delete mode 100644 drivers/staging/media/deprecated/vpfe_capture/Makefile
delete mode 100644 drivers/staging/media/deprecated/vpfe_capture/TODO
delete mode 100644 drivers/staging/media/deprecated/vpfe_capture/ccdc_hw_device.h
delete mode 100644 drivers/staging/media/deprecated/vpfe_capture/dm355_ccdc.c
delete mode 100644 drivers/staging/media/deprecated/vpfe_capture/dm355_ccdc.h
delete mode 100644 drivers/staging/media/deprecated/vpfe_capture/dm355_ccdc_regs.h
delete mode 100644 drivers/staging/media/deprecated/vpfe_capture/dm644x_ccdc.c
delete mode 100644 drivers/staging/media/deprecated/vpfe_capture/dm644x_ccdc.h
delete mode 100644 drivers/staging/media/deprecated/vpfe_capture/dm644x_ccdc_regs.h
delete mode 100644 drivers/staging/media/deprecated/vpfe_capture/isif.c
delete mode 100644 drivers/staging/media/deprecated/vpfe_capture/isif.h
delete mode 100644 drivers/staging/media/deprecated/vpfe_capture/isif_regs.h
delete mode 100644 drivers/staging/media/deprecated/vpfe_capture/vpfe_capture.c
delete mode 100644 drivers/usb/musb/cppi_dma.c
delete mode 100644 drivers/usb/musb/davinci.c
delete mode 100644 drivers/usb/musb/davinci.h
delete mode 100644 include/linux/mfd/dm355evm_msp.h
delete mode 100644 include/media/davinci/vpbe.h
delete mode 100644 include/media/davinci/vpbe_display.h
delete mode 100644 include/media/davinci/vpbe_osd.h
delete mode 100644 include/media/davinci/vpbe_types.h
delete mode 100644 include/media/davinci/vpbe_venc.h
delete mode 100644 include/media/davinci/vpfe_capture.h
delete mode 100644 include/media/davinci/vpss.h
delete mode 100644 sound/soc/ti/davinci-vcif.c
--
2.29.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 44+ messages in thread
* [PATCH 02/14] ARM: davinci: drop DAVINCI_DMxxx references
2022-10-19 15:29 [PATCH 00/14] ARM: remove unused davinci board & drivers Arnd Bergmann
@ 2022-10-19 15:29 ` Arnd Bergmann
2022-10-19 16:37 ` David Lechner
2022-10-27 1:10 ` Stephen Boyd
2022-10-19 15:29 ` [PATCH 03/14] ARM: davinci: clean up platform support Arnd Bergmann
` (15 subsequent siblings)
16 siblings, 2 replies; 44+ messages in thread
From: Arnd Bergmann @ 2022-10-19 15:29 UTC (permalink / raw)
To: Sekhar Nori, Bartosz Golaszewski, linux-arm-kernel, David Lechner,
Michael Turquette, Stephen Boyd
Cc: linux-kernel, Kevin Hilman, Arnd Bergmann, linux-clk
From: Arnd Bergmann <arnd@arndb.de>
Support for all the dm3xx/dm64xx SoCs is no longer
available, so drop all other references to those.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
arch/arm/mach-davinci/cputype.h | 32 --------------------------------
arch/arm/mach-davinci/serial.c | 4 ----
arch/arm/mach-davinci/usb.c | 13 -------------
drivers/clk/davinci/pll.c | 8 --------
drivers/clk/davinci/pll.h | 5 -----
drivers/clk/davinci/psc.c | 6 ------
drivers/clk/davinci/psc.h | 7 -------
include/linux/clk/davinci.h | 9 ---------
8 files changed, 84 deletions(-)
diff --git a/arch/arm/mach-davinci/cputype.h b/arch/arm/mach-davinci/cputype.h
index 4590afdbe449..87ee56068a16 100644
--- a/arch/arm/mach-davinci/cputype.h
+++ b/arch/arm/mach-davinci/cputype.h
@@ -25,10 +25,6 @@ struct davinci_id {
};
/* Can use lower 16 bits of cpu id for a variant when required */
-#define DAVINCI_CPU_ID_DM6446 0x64460000
-#define DAVINCI_CPU_ID_DM6467 0x64670000
-#define DAVINCI_CPU_ID_DM355 0x03550000
-#define DAVINCI_CPU_ID_DM365 0x03650000
#define DAVINCI_CPU_ID_DA830 0x08300000
#define DAVINCI_CPU_ID_DA850 0x08500000
@@ -38,37 +34,9 @@ static inline int is_davinci_ ##type(void) \
return (davinci_soc_info.cpu_id == (id)); \
}
-IS_DAVINCI_CPU(dm644x, DAVINCI_CPU_ID_DM6446)
-IS_DAVINCI_CPU(dm646x, DAVINCI_CPU_ID_DM6467)
-IS_DAVINCI_CPU(dm355, DAVINCI_CPU_ID_DM355)
-IS_DAVINCI_CPU(dm365, DAVINCI_CPU_ID_DM365)
IS_DAVINCI_CPU(da830, DAVINCI_CPU_ID_DA830)
IS_DAVINCI_CPU(da850, DAVINCI_CPU_ID_DA850)
-#ifdef CONFIG_ARCH_DAVINCI_DM644x
-#define cpu_is_davinci_dm644x() is_davinci_dm644x()
-#else
-#define cpu_is_davinci_dm644x() 0
-#endif
-
-#ifdef CONFIG_ARCH_DAVINCI_DM646x
-#define cpu_is_davinci_dm646x() is_davinci_dm646x()
-#else
-#define cpu_is_davinci_dm646x() 0
-#endif
-
-#ifdef CONFIG_ARCH_DAVINCI_DM355
-#define cpu_is_davinci_dm355() is_davinci_dm355()
-#else
-#define cpu_is_davinci_dm355() 0
-#endif
-
-#ifdef CONFIG_ARCH_DAVINCI_DM365
-#define cpu_is_davinci_dm365() is_davinci_dm365()
-#else
-#define cpu_is_davinci_dm365() 0
-#endif
-
#ifdef CONFIG_ARCH_DAVINCI_DA830
#define cpu_is_davinci_da830() is_davinci_da830()
#else
diff --git a/arch/arm/mach-davinci/serial.c b/arch/arm/mach-davinci/serial.c
index 7f7814807bb5..ac1929bb0ef2 100644
--- a/arch/arm/mach-davinci/serial.c
+++ b/arch/arm/mach-davinci/serial.c
@@ -40,10 +40,6 @@ static void __init davinci_serial_reset(struct plat_serial8250_port *p)
pwremu |= (0x3 << 13);
pwremu |= 0x1;
serial_write_reg(p, UART_DAVINCI_PWREMU, pwremu);
-
- if (cpu_is_davinci_dm646x())
- serial_write_reg(p, UART_DM646X_SCR,
- UART_DM646X_SCR_TX_WATERMARK);
}
int __init davinci_serial_init(struct platform_device *serial_dev)
diff --git a/arch/arm/mach-davinci/usb.c b/arch/arm/mach-davinci/usb.c
index a9e5c6e91e5d..9dc14c7977b3 100644
--- a/arch/arm/mach-davinci/usb.c
+++ b/arch/arm/mach-davinci/usb.c
@@ -41,11 +41,6 @@ static struct resource usb_resources[] = {
.flags = IORESOURCE_IRQ,
.name = "mc"
},
- {
- /* placeholder for the dedicated CPPI IRQ */
- .flags = IORESOURCE_IRQ,
- .name = "dma"
- },
};
static u64 usb_dmamask = DMA_BIT_MASK(32);
@@ -67,14 +62,6 @@ void __init davinci_setup_usb(unsigned mA, unsigned potpgt_ms)
usb_data.power = mA > 510 ? 255 : mA / 2;
usb_data.potpgt = (potpgt_ms + 1) / 2;
- if (cpu_is_davinci_dm646x()) {
- /* Override the defaults as DM6467 uses different IRQs. */
- usb_dev.resource[1].start = DAVINCI_INTC_IRQ(IRQ_DM646X_USBINT);
- usb_dev.resource[2].start = DAVINCI_INTC_IRQ(
- IRQ_DM646X_USBDMAINT);
- } else /* other devices don't have dedicated CPPI IRQ */
- usb_dev.num_resources = 2;
-
platform_device_register(&usb_dev);
}
diff --git a/drivers/clk/davinci/pll.c b/drivers/clk/davinci/pll.c
index f862f5e2b3fc..87bdf8879045 100644
--- a/drivers/clk/davinci/pll.c
+++ b/drivers/clk/davinci/pll.c
@@ -881,14 +881,6 @@ static const struct platform_device_id davinci_pll_id_table[] = {
#ifdef CONFIG_ARCH_DAVINCI_DA850
{ .name = "da850-pll0", .driver_data = (kernel_ulong_t)da850_pll0_init },
{ .name = "da850-pll1", .driver_data = (kernel_ulong_t)da850_pll1_init },
-#endif
-#ifdef CONFIG_ARCH_DAVINCI_DM355
- { .name = "dm355-pll1", .driver_data = (kernel_ulong_t)dm355_pll1_init },
- { .name = "dm355-pll2", .driver_data = (kernel_ulong_t)dm355_pll2_init },
-#endif
-#ifdef CONFIG_ARCH_DAVINCI_DM365
- { .name = "dm365-pll1", .driver_data = (kernel_ulong_t)dm365_pll1_init },
- { .name = "dm365-pll2", .driver_data = (kernel_ulong_t)dm365_pll2_init },
#endif
{ }
};
diff --git a/drivers/clk/davinci/pll.h b/drivers/clk/davinci/pll.h
index 1773277bc690..20bfcec2d3b5 100644
--- a/drivers/clk/davinci/pll.h
+++ b/drivers/clk/davinci/pll.h
@@ -122,13 +122,8 @@ int of_davinci_pll_init(struct device *dev, struct device_node *node,
/* Platform-specific callbacks */
-#ifdef CONFIG_ARCH_DAVINCI_DA850
int da850_pll1_init(struct device *dev, void __iomem *base, struct regmap *cfgchip);
void of_da850_pll0_init(struct device_node *node);
int of_da850_pll1_init(struct device *dev, void __iomem *base, struct regmap *cfgchip);
-#endif
-#ifdef CONFIG_ARCH_DAVINCI_DM355
-int dm355_pll2_init(struct device *dev, void __iomem *base, struct regmap *cfgchip);
-#endif
#endif /* __CLK_DAVINCI_PLL_H___ */
diff --git a/drivers/clk/davinci/psc.c b/drivers/clk/davinci/psc.c
index 42a59dbd49c8..cd85d9f158b0 100644
--- a/drivers/clk/davinci/psc.c
+++ b/drivers/clk/davinci/psc.c
@@ -510,12 +510,6 @@ static const struct platform_device_id davinci_psc_id_table[] = {
#ifdef CONFIG_ARCH_DAVINCI_DA850
{ .name = "da850-psc0", .driver_data = (kernel_ulong_t)&da850_psc0_init_data },
{ .name = "da850-psc1", .driver_data = (kernel_ulong_t)&da850_psc1_init_data },
-#endif
-#ifdef CONFIG_ARCH_DAVINCI_DM355
- { .name = "dm355-psc", .driver_data = (kernel_ulong_t)&dm355_psc_init_data },
-#endif
-#ifdef CONFIG_ARCH_DAVINCI_DM365
- { .name = "dm365-psc", .driver_data = (kernel_ulong_t)&dm365_psc_init_data },
#endif
{ }
};
diff --git a/drivers/clk/davinci/psc.h b/drivers/clk/davinci/psc.h
index 5e382b675518..bd23f6fd56df 100644
--- a/drivers/clk/davinci/psc.h
+++ b/drivers/clk/davinci/psc.h
@@ -104,11 +104,4 @@ extern const struct davinci_psc_init_data da850_psc1_init_data;
extern const struct davinci_psc_init_data of_da850_psc0_init_data;
extern const struct davinci_psc_init_data of_da850_psc1_init_data;
#endif
-#ifdef CONFIG_ARCH_DAVINCI_DM355
-extern const struct davinci_psc_init_data dm355_psc_init_data;
-#endif
-#ifdef CONFIG_ARCH_DAVINCI_DM365
-extern const struct davinci_psc_init_data dm365_psc_init_data;
-#endif
-
#endif /* __CLK_DAVINCI_PSC_H__ */
diff --git a/include/linux/clk/davinci.h b/include/linux/clk/davinci.h
index f6ebab6228c2..e1d37451e03f 100644
--- a/include/linux/clk/davinci.h
+++ b/include/linux/clk/davinci.h
@@ -19,14 +19,5 @@ int da830_pll_init(struct device *dev, void __iomem *base, struct regmap *cfgchi
#ifdef CONFIG_ARCH_DAVINCI_DA850
int da850_pll0_init(struct device *dev, void __iomem *base, struct regmap *cfgchip);
#endif
-#ifdef CONFIG_ARCH_DAVINCI_DM355
-int dm355_pll1_init(struct device *dev, void __iomem *base, struct regmap *cfgchip);
-int dm355_psc_init(struct device *dev, void __iomem *base);
-#endif
-#ifdef CONFIG_ARCH_DAVINCI_DM365
-int dm365_pll1_init(struct device *dev, void __iomem *base, struct regmap *cfgchip);
-int dm365_pll2_init(struct device *dev, void __iomem *base, struct regmap *cfgchip);
-int dm365_psc_init(struct device *dev, void __iomem *base);
-#endif
#endif /* __LINUX_CLK_DAVINCI_PLL_H___ */
--
2.29.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [PATCH 03/14] ARM: davinci: clean up platform support
2022-10-19 15:29 [PATCH 00/14] ARM: remove unused davinci board & drivers Arnd Bergmann
2022-10-19 15:29 ` [PATCH 02/14] ARM: davinci: drop DAVINCI_DMxxx references Arnd Bergmann
@ 2022-10-19 15:29 ` Arnd Bergmann
2022-10-20 11:32 ` Bartosz Golaszewski
2022-10-19 15:29 ` [PATCH 04/14] clk: remove davinci dm3xx drivers Arnd Bergmann
` (14 subsequent siblings)
16 siblings, 1 reply; 44+ messages in thread
From: Arnd Bergmann @ 2022-10-19 15:29 UTC (permalink / raw)
To: Sekhar Nori, Bartosz Golaszewski, linux-arm-kernel
Cc: linux-kernel, Kevin Hilman, Arnd Bergmann
From: Arnd Bergmann <arnd@arndb.de>
With the board file support gone, and the platform using
DT only, a lot of the remaining code is no longer referenced
and can be removed.
Technically, the DT file only references DA850, but since that
is very similar to DA830, I'm leaving the latter.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
arch/arm/mach-davinci/Kconfig | 16 -
arch/arm/mach-davinci/Makefile | 9 +-
arch/arm/mach-davinci/asp.h | 57 --
arch/arm/mach-davinci/common.h | 7 +-
arch/arm/mach-davinci/cputype.h | 21 -
arch/arm/mach-davinci/da830.c | 274 -------
arch/arm/mach-davinci/da850.c | 400 +--------
arch/arm/mach-davinci/da8xx.h | 95 +--
arch/arm/mach-davinci/davinci.h | 136 ---
arch/arm/mach-davinci/devices-da8xx.c | 1095 -------------------------
arch/arm/mach-davinci/irqs.h | 217 -----
arch/arm/mach-davinci/mux.c | 15 -
arch/arm/mach-davinci/mux.h | 315 -------
arch/arm/mach-davinci/psc.h | 64 --
arch/arm/mach-davinci/serial.c | 88 --
arch/arm/mach-davinci/serial.h | 35 -
arch/arm/mach-davinci/usb-da8xx.c | 146 ----
arch/arm/mach-davinci/usb.c | 74 --
18 files changed, 11 insertions(+), 3053 deletions(-)
delete mode 100644 arch/arm/mach-davinci/asp.h
delete mode 100644 arch/arm/mach-davinci/davinci.h
delete mode 100644 arch/arm/mach-davinci/serial.c
delete mode 100644 arch/arm/mach-davinci/serial.h
delete mode 100644 arch/arm/mach-davinci/usb-da8xx.c
delete mode 100644 arch/arm/mach-davinci/usb.c
diff --git a/arch/arm/mach-davinci/Kconfig b/arch/arm/mach-davinci/Kconfig
index 588213583051..4316e1370627 100644
--- a/arch/arm/mach-davinci/Kconfig
+++ b/arch/arm/mach-davinci/Kconfig
@@ -18,8 +18,6 @@ comment "DaVinci Core Type"
config ARCH_DAVINCI_DA830
bool "DA830/OMAP-L137/AM17x based system"
- depends on AUTO_ZRELADDR && ARM_PATCH_PHYS_VIRT
- depends on ATAGS
select ARCH_DAVINCI_DA8XX
# needed on silicon revs 1.0, 1.1:
select CPU_DCACHE_WRITETHROUGH if !CPU_DCACHE_DISABLE
@@ -27,25 +25,11 @@ config ARCH_DAVINCI_DA830
config ARCH_DAVINCI_DA850
bool "DA850/OMAP-L138/AM18x based system"
- depends on AUTO_ZRELADDR && ARM_PATCH_PHYS_VIRT
- depends on ATAGS
- select ARCH_DAVINCI_DA8XX
select DAVINCI_CP_INTC
config ARCH_DAVINCI_DA8XX
bool
-comment "DaVinci Board Type"
-
-config MACH_DA8XX_DT
- bool "Support DA8XX platforms using device tree"
- default y
- depends on ARCH_DAVINCI_DA850
- select PINCTRL
- help
- Say y here to include support for TI DaVinci DA850 based using
- Flattened Device Tree. More information at Documentation/devicetree
-
config DAVINCI_MUX
bool "DAVINCI multiplexing support"
depends on ARCH_DAVINCI
diff --git a/arch/arm/mach-davinci/Makefile b/arch/arm/mach-davinci/Makefile
index 5b15a3bbf909..5ab1766fc306 100644
--- a/arch/arm/mach-davinci/Makefile
+++ b/arch/arm/mach-davinci/Makefile
@@ -5,16 +5,15 @@
#
#
# Common objects
-obj-y := serial.o usb.o common.o sram.o
+obj-y := common.o sram.o devices-da8xx.o
obj-$(CONFIG_DAVINCI_MUX) += mux.o
# Chip specific
-obj-$(CONFIG_ARCH_DAVINCI_DA830) += da830.o devices-da8xx.o usb-da8xx.o
-obj-$(CONFIG_ARCH_DAVINCI_DA850) += da850.o devices-da8xx.o usb-da8xx.o
+obj-$(CONFIG_ARCH_DAVINCI_DA830) += da830.o
+obj-$(CONFIG_ARCH_DAVINCI_DA850) += da850.o
-# Board specific
-obj-$(CONFIG_MACH_DA8XX_DT) += da8xx-dt.o pdata-quirks.o
+obj-y += da8xx-dt.o pdata-quirks.o
# Power Management
obj-$(CONFIG_CPU_IDLE) += cpuidle.o
diff --git a/arch/arm/mach-davinci/asp.h b/arch/arm/mach-davinci/asp.h
deleted file mode 100644
index d0ecd1d0f084..000000000000
--- a/arch/arm/mach-davinci/asp.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-/*
- * TI DaVinci Audio definitions
- */
-#ifndef __ASM_ARCH_DAVINCI_ASP_H
-#define __ASM_ARCH_DAVINCI_ASP_H
-
-/* Bases of dm644x and dm355 register banks */
-#define DAVINCI_ASP0_BASE 0x01E02000
-#define DAVINCI_ASP1_BASE 0x01E04000
-
-/* Bases of dm365 register banks */
-#define DAVINCI_DM365_ASP0_BASE 0x01D02000
-
-/* Bases of dm646x register banks */
-#define DAVINCI_DM646X_MCASP0_REG_BASE 0x01D01000
-#define DAVINCI_DM646X_MCASP1_REG_BASE 0x01D01800
-
-/* Bases of da850/da830 McASP0 register banks */
-#define DAVINCI_DA8XX_MCASP0_REG_BASE 0x01D00000
-
-/* Bases of da830 McASP1 register banks */
-#define DAVINCI_DA830_MCASP1_REG_BASE 0x01D04000
-
-/* Bases of da830 McASP2 register banks */
-#define DAVINCI_DA830_MCASP2_REG_BASE 0x01D08000
-
-/* EDMA channels of dm644x and dm355 */
-#define DAVINCI_DMA_ASP0_TX 2
-#define DAVINCI_DMA_ASP0_RX 3
-#define DAVINCI_DMA_ASP1_TX 8
-#define DAVINCI_DMA_ASP1_RX 9
-
-/* EDMA channels of dm646x */
-#define DAVINCI_DM646X_DMA_MCASP0_AXEVT0 6
-#define DAVINCI_DM646X_DMA_MCASP0_AREVT0 9
-#define DAVINCI_DM646X_DMA_MCASP1_AXEVT1 12
-
-/* EDMA channels of da850/da830 McASP0 */
-#define DAVINCI_DA8XX_DMA_MCASP0_AREVT 0
-#define DAVINCI_DA8XX_DMA_MCASP0_AXEVT 1
-
-/* EDMA channels of da830 McASP1 */
-#define DAVINCI_DA830_DMA_MCASP1_AREVT 2
-#define DAVINCI_DA830_DMA_MCASP1_AXEVT 3
-
-/* EDMA channels of da830 McASP2 */
-#define DAVINCI_DA830_DMA_MCASP2_AREVT 4
-#define DAVINCI_DA830_DMA_MCASP2_AXEVT 5
-
-/* Interrupts */
-#define DAVINCI_ASP0_RX_INT DAVINCI_INTC_IRQ(IRQ_MBRINT)
-#define DAVINCI_ASP0_TX_INT DAVINCI_INTC_IRQ(IRQ_MBXINT)
-#define DAVINCI_ASP1_RX_INT DAVINCI_INTC_IRQ(IRQ_MBRINT)
-#define DAVINCI_ASP1_TX_INT DAVINCI_INTC_IRQ(IRQ_MBXINT)
-
-#endif /* __ASM_ARCH_DAVINCI_ASP_H */
diff --git a/arch/arm/mach-davinci/common.h b/arch/arm/mach-davinci/common.h
index 772b51e0ac5e..b4fd0e9acf6c 100644
--- a/arch/arm/mach-davinci/common.h
+++ b/arch/arm/mach-davinci/common.h
@@ -17,8 +17,8 @@
#include <asm/irq.h>
-#define DAVINCI_INTC_START NR_IRQS
-#define DAVINCI_INTC_IRQ(_irqnum) (DAVINCI_INTC_START + (_irqnum))
+#define DAVINCI_INTC_START NR_IRQS
+#define DAVINCI_INTC_IRQ(_irqnum) (DAVINCI_INTC_START + (_irqnum))
struct davinci_gpio_controller;
@@ -45,9 +45,6 @@ struct davinci_soc_info {
unsigned gpio_num;
unsigned gpio_irq;
unsigned gpio_unbanked;
- struct davinci_gpio_controller *gpio_ctlrs;
- int gpio_ctlrs_num;
- struct emac_platform_data *emac_pdata;
dma_addr_t sram_dma;
unsigned sram_len;
};
diff --git a/arch/arm/mach-davinci/cputype.h b/arch/arm/mach-davinci/cputype.h
index 87ee56068a16..148a738391dc 100644
--- a/arch/arm/mach-davinci/cputype.h
+++ b/arch/arm/mach-davinci/cputype.h
@@ -28,25 +28,4 @@ struct davinci_id {
#define DAVINCI_CPU_ID_DA830 0x08300000
#define DAVINCI_CPU_ID_DA850 0x08500000
-#define IS_DAVINCI_CPU(type, id) \
-static inline int is_davinci_ ##type(void) \
-{ \
- return (davinci_soc_info.cpu_id == (id)); \
-}
-
-IS_DAVINCI_CPU(da830, DAVINCI_CPU_ID_DA830)
-IS_DAVINCI_CPU(da850, DAVINCI_CPU_ID_DA850)
-
-#ifdef CONFIG_ARCH_DAVINCI_DA830
-#define cpu_is_davinci_da830() is_davinci_da830()
-#else
-#define cpu_is_davinci_da830() 0
-#endif
-
-#ifdef CONFIG_ARCH_DAVINCI_DA850
-#define cpu_is_davinci_da850() is_davinci_da850()
-#else
-#define cpu_is_davinci_da850() 0
-#endif
-
#endif
diff --git a/arch/arm/mach-davinci/da830.c b/arch/arm/mach-davinci/da830.c
index eab5fac18806..2e497745b624 100644
--- a/arch/arm/mach-davinci/da830.c
+++ b/arch/arm/mach-davinci/da830.c
@@ -12,7 +12,6 @@
#include <linux/init.h>
#include <linux/io.h>
#include <linux/irqchip/irq-davinci-cp-intc.h>
-#include <linux/platform_data/gpio-davinci.h>
#include <clocksource/timer-davinci.h>
@@ -448,181 +447,6 @@ static const struct mux_config da830_pins[] = {
#endif
};
-const short da830_emif25_pins[] __initconst = {
- DA830_EMA_D_0, DA830_EMA_D_1, DA830_EMA_D_2, DA830_EMA_D_3,
- DA830_EMA_D_4, DA830_EMA_D_5, DA830_EMA_D_6, DA830_EMA_D_7,
- DA830_EMA_D_8, DA830_EMA_D_9, DA830_EMA_D_10, DA830_EMA_D_11,
- DA830_EMA_D_12, DA830_EMA_D_13, DA830_EMA_D_14, DA830_EMA_D_15,
- DA830_EMA_A_0, DA830_EMA_A_1, DA830_EMA_A_2, DA830_EMA_A_3,
- DA830_EMA_A_4, DA830_EMA_A_5, DA830_EMA_A_6, DA830_EMA_A_7,
- DA830_EMA_A_8, DA830_EMA_A_9, DA830_EMA_A_10, DA830_EMA_A_11,
- DA830_EMA_A_12, DA830_EMA_BA_0, DA830_EMA_BA_1, DA830_EMA_CLK,
- DA830_EMA_SDCKE, DA830_NEMA_CS_4, DA830_NEMA_CS_5, DA830_NEMA_WE,
- DA830_NEMA_CS_0, DA830_NEMA_CS_2, DA830_NEMA_CS_3, DA830_NEMA_OE,
- DA830_NEMA_WE_DQM_1, DA830_NEMA_WE_DQM_0, DA830_EMA_WAIT_0,
- -1
-};
-
-const short da830_spi0_pins[] __initconst = {
- DA830_SPI0_SOMI_0, DA830_SPI0_SIMO_0, DA830_SPI0_CLK, DA830_NSPI0_ENA,
- DA830_NSPI0_SCS_0,
- -1
-};
-
-const short da830_spi1_pins[] __initconst = {
- DA830_SPI1_SOMI_0, DA830_SPI1_SIMO_0, DA830_SPI1_CLK, DA830_NSPI1_ENA,
- DA830_NSPI1_SCS_0,
- -1
-};
-
-const short da830_mmc_sd_pins[] __initconst = {
- DA830_MMCSD_DAT_0, DA830_MMCSD_DAT_1, DA830_MMCSD_DAT_2,
- DA830_MMCSD_DAT_3, DA830_MMCSD_DAT_4, DA830_MMCSD_DAT_5,
- DA830_MMCSD_DAT_6, DA830_MMCSD_DAT_7, DA830_MMCSD_CLK,
- DA830_MMCSD_CMD,
- -1
-};
-
-const short da830_uart0_pins[] __initconst = {
- DA830_NUART0_CTS, DA830_NUART0_RTS, DA830_UART0_RXD, DA830_UART0_TXD,
- -1
-};
-
-const short da830_uart1_pins[] __initconst = {
- DA830_UART1_RXD, DA830_UART1_TXD,
- -1
-};
-
-const short da830_uart2_pins[] __initconst = {
- DA830_UART2_RXD, DA830_UART2_TXD,
- -1
-};
-
-const short da830_usb20_pins[] __initconst = {
- DA830_USB0_DRVVBUS, DA830_USB_REFCLKIN,
- -1
-};
-
-const short da830_usb11_pins[] __initconst = {
- DA830_USB_REFCLKIN,
- -1
-};
-
-const short da830_uhpi_pins[] __initconst = {
- DA830_UHPI_HD_0, DA830_UHPI_HD_1, DA830_UHPI_HD_2, DA830_UHPI_HD_3,
- DA830_UHPI_HD_4, DA830_UHPI_HD_5, DA830_UHPI_HD_6, DA830_UHPI_HD_7,
- DA830_UHPI_HD_8, DA830_UHPI_HD_9, DA830_UHPI_HD_10, DA830_UHPI_HD_11,
- DA830_UHPI_HD_12, DA830_UHPI_HD_13, DA830_UHPI_HD_14, DA830_UHPI_HD_15,
- DA830_UHPI_HCNTL0, DA830_UHPI_HCNTL1, DA830_UHPI_HHWIL, DA830_UHPI_HRNW,
- DA830_NUHPI_HAS, DA830_NUHPI_HCS, DA830_NUHPI_HDS1, DA830_NUHPI_HDS2,
- DA830_NUHPI_HINT, DA830_NUHPI_HRDY,
- -1
-};
-
-const short da830_cpgmac_pins[] __initconst = {
- DA830_RMII_TXD_0, DA830_RMII_TXD_1, DA830_RMII_TXEN, DA830_RMII_CRS_DV,
- DA830_RMII_RXD_0, DA830_RMII_RXD_1, DA830_RMII_RXER, DA830_MDIO_CLK,
- DA830_MDIO_D,
- -1
-};
-
-const short da830_emif3c_pins[] __initconst = {
- DA830_EMB_SDCKE, DA830_EMB_CLK_GLUE, DA830_EMB_CLK, DA830_NEMB_CS_0,
- DA830_NEMB_CAS, DA830_NEMB_RAS, DA830_NEMB_WE, DA830_EMB_BA_1,
- DA830_EMB_BA_0, DA830_EMB_A_0, DA830_EMB_A_1, DA830_EMB_A_2,
- DA830_EMB_A_3, DA830_EMB_A_4, DA830_EMB_A_5, DA830_EMB_A_6,
- DA830_EMB_A_7, DA830_EMB_A_8, DA830_EMB_A_9, DA830_EMB_A_10,
- DA830_EMB_A_11, DA830_EMB_A_12, DA830_NEMB_WE_DQM_3,
- DA830_NEMB_WE_DQM_2, DA830_EMB_D_0, DA830_EMB_D_1, DA830_EMB_D_2,
- DA830_EMB_D_3, DA830_EMB_D_4, DA830_EMB_D_5, DA830_EMB_D_6,
- DA830_EMB_D_7, DA830_EMB_D_8, DA830_EMB_D_9, DA830_EMB_D_10,
- DA830_EMB_D_11, DA830_EMB_D_12, DA830_EMB_D_13, DA830_EMB_D_14,
- DA830_EMB_D_15, DA830_EMB_D_16, DA830_EMB_D_17, DA830_EMB_D_18,
- DA830_EMB_D_19, DA830_EMB_D_20, DA830_EMB_D_21, DA830_EMB_D_22,
- DA830_EMB_D_23, DA830_EMB_D_24, DA830_EMB_D_25, DA830_EMB_D_26,
- DA830_EMB_D_27, DA830_EMB_D_28, DA830_EMB_D_29, DA830_EMB_D_30,
- DA830_EMB_D_31, DA830_NEMB_WE_DQM_1, DA830_NEMB_WE_DQM_0,
- -1
-};
-
-const short da830_mcasp0_pins[] __initconst = {
- DA830_AHCLKX0, DA830_ACLKX0, DA830_AFSX0,
- DA830_AHCLKR0, DA830_ACLKR0, DA830_AFSR0, DA830_AMUTE0,
- DA830_AXR0_0, DA830_AXR0_1, DA830_AXR0_2, DA830_AXR0_3,
- DA830_AXR0_4, DA830_AXR0_5, DA830_AXR0_6, DA830_AXR0_7,
- DA830_AXR0_8, DA830_AXR0_9, DA830_AXR0_10, DA830_AXR0_11,
- DA830_AXR0_12, DA830_AXR0_13, DA830_AXR0_14, DA830_AXR0_15,
- -1
-};
-
-const short da830_mcasp1_pins[] __initconst = {
- DA830_AHCLKX1, DA830_ACLKX1, DA830_AFSX1,
- DA830_AHCLKR1, DA830_ACLKR1, DA830_AFSR1, DA830_AMUTE1,
- DA830_AXR1_0, DA830_AXR1_1, DA830_AXR1_2, DA830_AXR1_3,
- DA830_AXR1_4, DA830_AXR1_5, DA830_AXR1_6, DA830_AXR1_7,
- DA830_AXR1_8, DA830_AXR1_9, DA830_AXR1_10, DA830_AXR1_11,
- -1
-};
-
-const short da830_mcasp2_pins[] __initconst = {
- DA830_AHCLKX2, DA830_ACLKX2, DA830_AFSX2,
- DA830_AHCLKR2, DA830_ACLKR2, DA830_AFSR2, DA830_AMUTE2,
- DA830_AXR2_0, DA830_AXR2_1, DA830_AXR2_2, DA830_AXR2_3,
- -1
-};
-
-const short da830_i2c0_pins[] __initconst = {
- DA830_I2C0_SDA, DA830_I2C0_SCL,
- -1
-};
-
-const short da830_i2c1_pins[] __initconst = {
- DA830_I2C1_SCL, DA830_I2C1_SDA,
- -1
-};
-
-const short da830_lcdcntl_pins[] __initconst = {
- DA830_LCD_D_0, DA830_LCD_D_1, DA830_LCD_D_2, DA830_LCD_D_3,
- DA830_LCD_D_4, DA830_LCD_D_5, DA830_LCD_D_6, DA830_LCD_D_7,
- DA830_LCD_D_8, DA830_LCD_D_9, DA830_LCD_D_10, DA830_LCD_D_11,
- DA830_LCD_D_12, DA830_LCD_D_13, DA830_LCD_D_14, DA830_LCD_D_15,
- DA830_LCD_PCLK, DA830_LCD_HSYNC, DA830_LCD_VSYNC, DA830_NLCD_AC_ENB_CS,
- DA830_LCD_MCLK,
- -1
-};
-
-const short da830_pwm_pins[] __initconst = {
- DA830_ECAP0_APWM0, DA830_ECAP1_APWM1, DA830_EPWM0B, DA830_EPWM0A,
- DA830_EPWMSYNCI, DA830_EPWMSYNC0, DA830_ECAP2_APWM2, DA830_EHRPWMGLUETZ,
- DA830_EPWM2B, DA830_EPWM2A, DA830_EPWM1B, DA830_EPWM1A,
- -1
-};
-
-const short da830_ecap0_pins[] __initconst = {
- DA830_ECAP0_APWM0,
- -1
-};
-
-const short da830_ecap1_pins[] __initconst = {
- DA830_ECAP1_APWM1,
- -1
-};
-
-const short da830_ecap2_pins[] __initconst = {
- DA830_ECAP2_APWM2,
- -1
-};
-
-const short da830_eqep0_pins[] __initconst = {
- DA830_EQEP0I, DA830_EQEP0S, DA830_EQEP0A, DA830_EQEP0B,
- -1
-};
-
-const short da830_eqep1_pins[] __initconst = {
- DA830_EQEP1I, DA830_EQEP1S, DA830_EQEP1A, DA830_EQEP1B,
- -1
-};
-
static struct map_desc da830_io_desc[] = {
{
.virtual = IO_VIRT,
@@ -663,30 +487,6 @@ static struct davinci_id da830_ids[] = {
},
};
-static struct davinci_gpio_platform_data da830_gpio_platform_data = {
- .no_auto_base = true,
- .base = 0,
- .ngpio = 128,
-};
-
-int __init da830_register_gpio(void)
-{
- return da8xx_register_gpio(&da830_gpio_platform_data);
-}
-
-/*
- * Bottom half of timer0 is used both for clock even and clocksource.
- * Top half is used by DSP.
- */
-static const struct davinci_timer_cfg da830_timer_cfg = {
- .reg = DEFINE_RES_IO(DA8XX_TIMER64P0_BASE, SZ_4K),
- .irq = {
- DEFINE_RES_IRQ(DAVINCI_INTC_IRQ(IRQ_DA830_T12CMPINT0_0)),
- DEFINE_RES_IRQ(DAVINCI_INTC_IRQ(IRQ_DA8XX_TINT12_0)),
- },
- .cmp_off = DA830_CMP12_0,
-};
-
static const struct davinci_soc_info davinci_soc_info_da830 = {
.io_desc = da830_io_desc,
.io_desc_num = ARRAY_SIZE(da830_io_desc),
@@ -696,7 +496,6 @@ static const struct davinci_soc_info davinci_soc_info_da830 = {
.pinmux_base = DA8XX_SYSCFG0_BASE + 0x120,
.pinmux_pins = da830_pins,
.pinmux_pins_num = ARRAY_SIZE(da830_pins),
- .emac_pdata = &da8xx_emac_pdata,
};
void __init da830_init(void)
@@ -706,76 +505,3 @@ void __init da830_init(void)
da8xx_syscfg0_base = ioremap(DA8XX_SYSCFG0_BASE, SZ_4K);
WARN(!da8xx_syscfg0_base, "Unable to map syscfg0 module");
}
-
-static const struct davinci_cp_intc_config da830_cp_intc_config = {
- .reg = {
- .start = DA8XX_CP_INTC_BASE,
- .end = DA8XX_CP_INTC_BASE + SZ_8K - 1,
- .flags = IORESOURCE_MEM,
- },
- .num_irqs = DA830_N_CP_INTC_IRQ,
-};
-
-void __init da830_init_irq(void)
-{
- davinci_cp_intc_init(&da830_cp_intc_config);
-}
-
-void __init da830_init_time(void)
-{
- void __iomem *pll;
- struct clk *clk;
- int rv;
-
- clk_register_fixed_rate(NULL, "ref_clk", NULL, 0, DA830_REF_FREQ);
-
- pll = ioremap(DA8XX_PLL0_BASE, SZ_4K);
-
- da830_pll_init(NULL, pll, NULL);
-
- clk = clk_get(NULL, "timer0");
- if (WARN_ON(IS_ERR(clk))) {
- pr_err("Unable to get the timer clock\n");
- return;
- }
-
- rv = davinci_timer_register(clk, &da830_timer_cfg);
- WARN(rv, "Unable to register the timer: %d\n", rv);
-}
-
-static struct resource da830_psc0_resources[] = {
- {
- .start = DA8XX_PSC0_BASE,
- .end = DA8XX_PSC0_BASE + SZ_4K - 1,
- .flags = IORESOURCE_MEM,
- },
-};
-
-static struct platform_device da830_psc0_device = {
- .name = "da830-psc0",
- .id = -1,
- .resource = da830_psc0_resources,
- .num_resources = ARRAY_SIZE(da830_psc0_resources),
-};
-
-static struct resource da830_psc1_resources[] = {
- {
- .start = DA8XX_PSC1_BASE,
- .end = DA8XX_PSC1_BASE + SZ_4K - 1,
- .flags = IORESOURCE_MEM,
- },
-};
-
-static struct platform_device da830_psc1_device = {
- .name = "da830-psc1",
- .id = -1,
- .resource = da830_psc1_resources,
- .num_resources = ARRAY_SIZE(da830_psc1_resources),
-};
-
-void __init da830_register_clocks(void)
-{
- /* PLL is registered in da830_init_time() */
- platform_device_register(&da830_psc0_device);
- platform_device_register(&da830_psc1_device);
-}
diff --git a/arch/arm/mach-davinci/da850.c b/arch/arm/mach-davinci/da850.c
index 635e88daf5dd..287dd987908e 100644
--- a/arch/arm/mach-davinci/da850.c
+++ b/arch/arm/mach-davinci/da850.c
@@ -10,19 +10,10 @@
* 2009 (c) MontaVista Software, Inc.
*/
-#include <linux/clk-provider.h>
-#include <linux/clk/davinci.h>
-#include <linux/clkdev.h>
-#include <linux/cpufreq.h>
#include <linux/gpio.h>
#include <linux/init.h>
#include <linux/io.h>
-#include <linux/irqchip/irq-davinci-cp-intc.h>
#include <linux/mfd/da8xx-cfgchip.h>
-#include <linux/platform_data/clk-da8xx-cfgchip.h>
-#include <linux/platform_data/clk-davinci-pll.h>
-#include <linux/platform_data/davinci-cpufreq.h>
-#include <linux/platform_data/gpio-davinci.h>
#include <linux/platform_device.h>
#include <linux/regmap.h>
#include <linux/regulator/consumer.h>
@@ -33,6 +24,7 @@
#include "common.h"
#include "cputype.h"
#include "da8xx.h"
+#include "hardware.h"
#include "pm.h"
#include "irqs.h"
#include "mux.h"
@@ -258,45 +250,6 @@ static const struct mux_config da850_pins[] = {
#endif
};
-const short da850_i2c0_pins[] __initconst = {
- DA850_I2C0_SDA, DA850_I2C0_SCL,
- -1
-};
-
-const short da850_i2c1_pins[] __initconst = {
- DA850_I2C1_SCL, DA850_I2C1_SDA,
- -1
-};
-
-const short da850_lcdcntl_pins[] __initconst = {
- DA850_LCD_D_0, DA850_LCD_D_1, DA850_LCD_D_2, DA850_LCD_D_3,
- DA850_LCD_D_4, DA850_LCD_D_5, DA850_LCD_D_6, DA850_LCD_D_7,
- DA850_LCD_D_8, DA850_LCD_D_9, DA850_LCD_D_10, DA850_LCD_D_11,
- DA850_LCD_D_12, DA850_LCD_D_13, DA850_LCD_D_14, DA850_LCD_D_15,
- DA850_LCD_PCLK, DA850_LCD_HSYNC, DA850_LCD_VSYNC, DA850_NLCD_AC_ENB_CS,
- -1
-};
-
-const short da850_vpif_capture_pins[] __initconst = {
- DA850_VPIF_DIN0, DA850_VPIF_DIN1, DA850_VPIF_DIN2, DA850_VPIF_DIN3,
- DA850_VPIF_DIN4, DA850_VPIF_DIN5, DA850_VPIF_DIN6, DA850_VPIF_DIN7,
- DA850_VPIF_DIN8, DA850_VPIF_DIN9, DA850_VPIF_DIN10, DA850_VPIF_DIN11,
- DA850_VPIF_DIN12, DA850_VPIF_DIN13, DA850_VPIF_DIN14, DA850_VPIF_DIN15,
- DA850_VPIF_CLKIN0, DA850_VPIF_CLKIN1, DA850_VPIF_CLKIN2,
- DA850_VPIF_CLKIN3,
- -1
-};
-
-const short da850_vpif_display_pins[] __initconst = {
- DA850_VPIF_DOUT0, DA850_VPIF_DOUT1, DA850_VPIF_DOUT2, DA850_VPIF_DOUT3,
- DA850_VPIF_DOUT4, DA850_VPIF_DOUT5, DA850_VPIF_DOUT6, DA850_VPIF_DOUT7,
- DA850_VPIF_DOUT8, DA850_VPIF_DOUT9, DA850_VPIF_DOUT10,
- DA850_VPIF_DOUT11, DA850_VPIF_DOUT12, DA850_VPIF_DOUT13,
- DA850_VPIF_DOUT14, DA850_VPIF_DOUT15, DA850_VPIF_CLKO2,
- DA850_VPIF_CLKO3,
- -1
-};
-
static struct map_desc da850_io_desc[] = {
{
.virtual = IO_VIRT,
@@ -330,204 +283,9 @@ static struct davinci_id da850_ids[] = {
},
};
-/*
- * Bottom half of timer 0 is used for clock_event, top half for
- * clocksource.
- */
-static const struct davinci_timer_cfg da850_timer_cfg = {
- .reg = DEFINE_RES_IO(DA8XX_TIMER64P0_BASE, SZ_4K),
- .irq = {
- DEFINE_RES_IRQ(DAVINCI_INTC_IRQ(IRQ_DA8XX_TINT12_0)),
- DEFINE_RES_IRQ(DAVINCI_INTC_IRQ(IRQ_DA8XX_TINT34_0)),
- },
-};
-
-#ifdef CONFIG_CPU_FREQ
-/*
- * Notes:
- * According to the TRM, minimum PLLM results in maximum power savings.
- * The OPP definitions below should keep the PLLM as low as possible.
- *
- * The output of the PLLM must be between 300 to 600 MHz.
- */
-struct da850_opp {
- unsigned int freq; /* in KHz */
- unsigned int prediv;
- unsigned int mult;
- unsigned int postdiv;
- unsigned int cvdd_min; /* in uV */
- unsigned int cvdd_max; /* in uV */
-};
-
-static const struct da850_opp da850_opp_456 = {
- .freq = 456000,
- .prediv = 1,
- .mult = 19,
- .postdiv = 1,
- .cvdd_min = 1300000,
- .cvdd_max = 1350000,
-};
-
-static const struct da850_opp da850_opp_408 = {
- .freq = 408000,
- .prediv = 1,
- .mult = 17,
- .postdiv = 1,
- .cvdd_min = 1300000,
- .cvdd_max = 1350000,
-};
-
-static const struct da850_opp da850_opp_372 = {
- .freq = 372000,
- .prediv = 2,
- .mult = 31,
- .postdiv = 1,
- .cvdd_min = 1200000,
- .cvdd_max = 1320000,
-};
-
-static const struct da850_opp da850_opp_300 = {
- .freq = 300000,
- .prediv = 1,
- .mult = 25,
- .postdiv = 2,
- .cvdd_min = 1200000,
- .cvdd_max = 1320000,
-};
-
-static const struct da850_opp da850_opp_200 = {
- .freq = 200000,
- .prediv = 1,
- .mult = 25,
- .postdiv = 3,
- .cvdd_min = 1100000,
- .cvdd_max = 1160000,
-};
-
-static const struct da850_opp da850_opp_96 = {
- .freq = 96000,
- .prediv = 1,
- .mult = 20,
- .postdiv = 5,
- .cvdd_min = 1000000,
- .cvdd_max = 1050000,
-};
-
-#define OPP(freq) \
- { \
- .driver_data = (unsigned int) &da850_opp_##freq, \
- .frequency = freq * 1000, \
- }
-
-static struct cpufreq_frequency_table da850_freq_table[] = {
- OPP(456),
- OPP(408),
- OPP(372),
- OPP(300),
- OPP(200),
- OPP(96),
- {
- .driver_data = 0,
- .frequency = CPUFREQ_TABLE_END,
- },
-};
-
-#ifdef CONFIG_REGULATOR
-static int da850_set_voltage(unsigned int index);
-static int da850_regulator_init(void);
-#endif
-
-static struct davinci_cpufreq_config cpufreq_info = {
- .freq_table = da850_freq_table,
-#ifdef CONFIG_REGULATOR
- .init = da850_regulator_init,
- .set_voltage = da850_set_voltage,
-#endif
-};
-
-#ifdef CONFIG_REGULATOR
-static struct regulator *cvdd;
-
-static int da850_set_voltage(unsigned int index)
-{
- struct da850_opp *opp;
-
- if (!cvdd)
- return -ENODEV;
-
- opp = (struct da850_opp *) cpufreq_info.freq_table[index].driver_data;
-
- return regulator_set_voltage(cvdd, opp->cvdd_min, opp->cvdd_max);
-}
-
-static int da850_regulator_init(void)
-{
- cvdd = regulator_get(NULL, "cvdd");
- if (WARN(IS_ERR(cvdd), "Unable to obtain voltage regulator for CVDD;"
- " voltage scaling unsupported\n")) {
- return PTR_ERR(cvdd);
- }
-
- return 0;
-}
-#endif
-
-static struct platform_device da850_cpufreq_device = {
- .name = "cpufreq-davinci",
- .dev = {
- .platform_data = &cpufreq_info,
- },
- .id = -1,
-};
-
-unsigned int da850_max_speed = 300000;
-
-int da850_register_cpufreq(char *async_clk)
-{
- int i;
-
- /* cpufreq driver can help keep an "async" clock constant */
- if (async_clk)
- clk_add_alias("async", da850_cpufreq_device.name,
- async_clk, NULL);
- for (i = 0; i < ARRAY_SIZE(da850_freq_table); i++) {
- if (da850_freq_table[i].frequency <= da850_max_speed) {
- cpufreq_info.freq_table = &da850_freq_table[i];
- break;
- }
- }
-
- return platform_device_register(&da850_cpufreq_device);
-}
-#else
-int __init da850_register_cpufreq(char *async_clk)
-{
- return 0;
-}
-#endif
-
/* VPIF resource, platform data */
static u64 da850_vpif_dma_mask = DMA_BIT_MASK(32);
-static struct resource da850_vpif_resource[] = {
- {
- .start = DA8XX_VPIF_BASE,
- .end = DA8XX_VPIF_BASE + 0xfff,
- .flags = IORESOURCE_MEM,
- }
-};
-
-static struct platform_device da850_vpif_dev = {
- .name = "vpif",
- .id = -1,
- .dev = {
- .dma_mask = &da850_vpif_dma_mask,
- .coherent_dma_mask = DMA_BIT_MASK(32),
- },
- .resource = da850_vpif_resource,
- .num_resources = ARRAY_SIZE(da850_vpif_resource),
-};
-
static struct resource da850_vpif_display_resource[] = {
{
.start = DAVINCI_INTC_IRQ(IRQ_DA850_VPIFINT),
@@ -571,11 +329,6 @@ static struct platform_device da850_vpif_capture_dev = {
.num_resources = ARRAY_SIZE(da850_vpif_capture_resource),
};
-int __init da850_register_vpif(void)
-{
- return platform_device_register(&da850_vpif_dev);
-}
-
int __init da850_register_vpif_display(struct vpif_display_config
*display_config)
{
@@ -590,17 +343,6 @@ int __init da850_register_vpif_capture(struct vpif_capture_config
return platform_device_register(&da850_vpif_capture_dev);
}
-static struct davinci_gpio_platform_data da850_gpio_platform_data = {
- .no_auto_base = true,
- .base = 0,
- .ngpio = 144,
-};
-
-int __init da850_register_gpio(void)
-{
- return da8xx_register_gpio(&da850_gpio_platform_data);
-}
-
static const struct davinci_soc_info davinci_soc_info_da850 = {
.io_desc = da850_io_desc,
.io_desc_num = ARRAY_SIZE(da850_io_desc),
@@ -610,7 +352,6 @@ static const struct davinci_soc_info davinci_soc_info_da850 = {
.pinmux_base = DA8XX_SYSCFG0_BASE + 0x120,
.pinmux_pins = da850_pins,
.pinmux_pins_num = ARRAY_SIZE(da850_pins),
- .emac_pdata = &da8xx_emac_pdata,
.sram_dma = DA8XX_SHARED_RAM_BASE,
.sram_len = SZ_128K,
};
@@ -626,142 +367,3 @@ void __init da850_init(void)
da8xx_syscfg1_base = ioremap(DA8XX_SYSCFG1_BASE, SZ_4K);
WARN(!da8xx_syscfg1_base, "Unable to map syscfg1 module");
}
-
-static const struct davinci_cp_intc_config da850_cp_intc_config = {
- .reg = {
- .start = DA8XX_CP_INTC_BASE,
- .end = DA8XX_CP_INTC_BASE + SZ_8K - 1,
- .flags = IORESOURCE_MEM,
- },
- .num_irqs = DA850_N_CP_INTC_IRQ,
-};
-
-void __init da850_init_irq(void)
-{
- davinci_cp_intc_init(&da850_cp_intc_config);
-}
-
-void __init da850_init_time(void)
-{
- void __iomem *pll0;
- struct regmap *cfgchip;
- struct clk *clk;
- int rv;
-
- clk_register_fixed_rate(NULL, "ref_clk", NULL, 0, DA850_REF_FREQ);
-
- pll0 = ioremap(DA8XX_PLL0_BASE, SZ_4K);
- cfgchip = da8xx_get_cfgchip();
-
- da850_pll0_init(NULL, pll0, cfgchip);
-
- clk = clk_get(NULL, "timer0");
- if (WARN_ON(IS_ERR(clk))) {
- pr_err("Unable to get the timer clock\n");
- return;
- }
-
- rv = davinci_timer_register(clk, &da850_timer_cfg);
- WARN(rv, "Unable to register the timer: %d\n", rv);
-}
-
-static struct resource da850_pll1_resources[] = {
- {
- .start = DA850_PLL1_BASE,
- .end = DA850_PLL1_BASE + SZ_4K - 1,
- .flags = IORESOURCE_MEM,
- },
-};
-
-static struct davinci_pll_platform_data da850_pll1_pdata;
-
-static struct platform_device da850_pll1_device = {
- .name = "da850-pll1",
- .id = -1,
- .resource = da850_pll1_resources,
- .num_resources = ARRAY_SIZE(da850_pll1_resources),
- .dev = {
- .platform_data = &da850_pll1_pdata,
- },
-};
-
-static struct resource da850_psc0_resources[] = {
- {
- .start = DA8XX_PSC0_BASE,
- .end = DA8XX_PSC0_BASE + SZ_4K - 1,
- .flags = IORESOURCE_MEM,
- },
-};
-
-static struct platform_device da850_psc0_device = {
- .name = "da850-psc0",
- .id = -1,
- .resource = da850_psc0_resources,
- .num_resources = ARRAY_SIZE(da850_psc0_resources),
-};
-
-static struct resource da850_psc1_resources[] = {
- {
- .start = DA8XX_PSC1_BASE,
- .end = DA8XX_PSC1_BASE + SZ_4K - 1,
- .flags = IORESOURCE_MEM,
- },
-};
-
-static struct platform_device da850_psc1_device = {
- .name = "da850-psc1",
- .id = -1,
- .resource = da850_psc1_resources,
- .num_resources = ARRAY_SIZE(da850_psc1_resources),
-};
-
-static struct da8xx_cfgchip_clk_platform_data da850_async1_pdata;
-
-static struct platform_device da850_async1_clksrc_device = {
- .name = "da850-async1-clksrc",
- .id = -1,
- .dev = {
- .platform_data = &da850_async1_pdata,
- },
-};
-
-static struct da8xx_cfgchip_clk_platform_data da850_async3_pdata;
-
-static struct platform_device da850_async3_clksrc_device = {
- .name = "da850-async3-clksrc",
- .id = -1,
- .dev = {
- .platform_data = &da850_async3_pdata,
- },
-};
-
-static struct da8xx_cfgchip_clk_platform_data da850_tbclksync_pdata;
-
-static struct platform_device da850_tbclksync_device = {
- .name = "da830-tbclksync",
- .id = -1,
- .dev = {
- .platform_data = &da850_tbclksync_pdata,
- },
-};
-
-void __init da850_register_clocks(void)
-{
- /* PLL0 is registered in da850_init_time() */
-
- da850_pll1_pdata.cfgchip = da8xx_get_cfgchip();
- platform_device_register(&da850_pll1_device);
-
- da850_async1_pdata.cfgchip = da8xx_get_cfgchip();
- platform_device_register(&da850_async1_clksrc_device);
-
- da850_async3_pdata.cfgchip = da8xx_get_cfgchip();
- platform_device_register(&da850_async3_clksrc_device);
-
- platform_device_register(&da850_psc0_device);
-
- platform_device_register(&da850_psc1_device);
-
- da850_tbclksync_pdata.cfgchip = da8xx_get_cfgchip();
- platform_device_register(&da850_tbclksync_device);
-}
diff --git a/arch/arm/mach-davinci/da8xx.h b/arch/arm/mach-davinci/da8xx.h
index 382811dbbc3b..54a255b8d8d8 100644
--- a/arch/arm/mach-davinci/da8xx.h
+++ b/arch/arm/mach-davinci/da8xx.h
@@ -9,38 +9,20 @@
#ifndef __ASM_ARCH_DAVINCI_DA8XX_H
#define __ASM_ARCH_DAVINCI_DA8XX_H
-#include <video/da8xx-fb.h>
-
+#include <linux/dma-mapping.h>
#include <linux/platform_device.h>
-#include <linux/davinci_emac.h>
-#include <linux/spi/spi.h>
-#include <linux/platform_data/davinci_asp.h>
+#include <linux/videodev2.h>
#include <linux/reboot.h>
#include <linux/regmap.h>
-#include <linux/videodev2.h>
-#include "serial.h"
+#include "hardware.h"
#include "pm.h"
-#include <linux/platform_data/edma.h>
-#include <linux/platform_data/i2c-davinci.h>
-#include <linux/platform_data/mmc-davinci.h>
-#include <linux/platform_data/usb-davinci.h>
-#include <linux/platform_data/spi-davinci.h>
-#include <linux/platform_data/uio_pruss.h>
-
#include <media/davinci/vpif_types.h>
extern void __iomem *da8xx_syscfg0_base;
extern void __iomem *da8xx_syscfg1_base;
-/*
- * If the DA850/OMAP-L138/AM18x SoC on board is of a higher speed grade
- * (than the regular 300MHz variant), the board code should set this up
- * with the supported speed before calling da850_register_cpufreq().
- */
-extern unsigned int da850_max_speed;
-
/*
* The cp_intc interrupt controller for the da8xx isn't in the same
* chunk of physical memory space as the other registers (like it is
@@ -87,83 +69,14 @@ extern unsigned int da850_max_speed;
#define DA8XX_ARM_RAM_BASE 0xffff0000
void da830_init(void);
-void da830_init_irq(void);
-void da830_init_time(void);
-void da830_register_clocks(void);
void da850_init(void);
-void da850_init_irq(void);
-void da850_init_time(void);
-void da850_register_clocks(void);
-int da830_register_edma(struct edma_rsv_info *rsv);
-int da850_register_edma(struct edma_rsv_info *rsv[2]);
-int da8xx_register_i2c(int instance, struct davinci_i2c_platform_data *pdata);
-int da8xx_register_spi_bus(int instance, unsigned num_chipselect);
-int da8xx_register_watchdog(void);
-int da8xx_register_usb_phy(void);
-int da8xx_register_usb20(unsigned mA, unsigned potpgt);
-int da8xx_register_usb11(struct da8xx_ohci_root_hub *pdata);
-int da8xx_register_usb_phy_clocks(void);
-int da850_register_sata_refclk(int rate);
-int da8xx_register_emac(void);
-int da8xx_register_uio_pruss(void);
-int da8xx_register_lcdc(struct da8xx_lcdc_platform_data *pdata);
-int da8xx_register_mmcsd0(struct davinci_mmc_config *config);
-int da850_register_mmcsd1(struct davinci_mmc_config *config);
-void da8xx_register_mcasp(int id, struct snd_platform_data *pdata);
-int da8xx_register_rtc(void);
-int da8xx_register_gpio(void *pdata);
-int da850_register_cpufreq(char *async_clk);
-int da8xx_register_cpuidle(void);
-void __iomem *da8xx_get_mem_ctlr(void);
-int da850_register_sata(unsigned long refclkpn);
-int da850_register_vpif(void);
int da850_register_vpif_display
(struct vpif_display_config *display_config);
int da850_register_vpif_capture
(struct vpif_capture_config *capture_config);
-void da8xx_rproc_reserve_cma(void);
-int da8xx_register_rproc(void);
-int da850_register_gpio(void);
-int da830_register_gpio(void);
struct regmap *da8xx_get_cfgchip(void);
-
-extern struct platform_device da8xx_serial_device[];
-extern struct emac_platform_data da8xx_emac_pdata;
-extern struct da8xx_lcdc_platform_data sharp_lcd035q3dg01_pdata;
-extern struct da8xx_lcdc_platform_data sharp_lk043t1dg01_pdata;
-
-
-extern const short da830_emif25_pins[];
-extern const short da830_spi0_pins[];
-extern const short da830_spi1_pins[];
-extern const short da830_mmc_sd_pins[];
-extern const short da830_uart0_pins[];
-extern const short da830_uart1_pins[];
-extern const short da830_uart2_pins[];
-extern const short da830_usb20_pins[];
-extern const short da830_usb11_pins[];
-extern const short da830_uhpi_pins[];
-extern const short da830_cpgmac_pins[];
-extern const short da830_emif3c_pins[];
-extern const short da830_mcasp0_pins[];
-extern const short da830_mcasp1_pins[];
-extern const short da830_mcasp2_pins[];
-extern const short da830_i2c0_pins[];
-extern const short da830_i2c1_pins[];
-extern const short da830_lcdcntl_pins[];
-extern const short da830_pwm_pins[];
-extern const short da830_ecap0_pins[];
-extern const short da830_ecap1_pins[];
-extern const short da830_ecap2_pins[];
-extern const short da830_eqep0_pins[];
-extern const short da830_eqep1_pins[];
-extern const short da850_vpif_capture_pins[];
-extern const short da850_vpif_display_pins[];
-
-extern const short da850_i2c0_pins[];
-extern const short da850_i2c1_pins[];
-extern const short da850_lcdcntl_pins[];
+void __iomem *da8xx_get_mem_ctlr(void);
#endif /* __ASM_ARCH_DAVINCI_DA8XX_H */
diff --git a/arch/arm/mach-davinci/davinci.h b/arch/arm/mach-davinci/davinci.h
deleted file mode 100644
index b7172797692b..000000000000
--- a/arch/arm/mach-davinci/davinci.h
+++ /dev/null
@@ -1,136 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-/*
- * This file contains the processor specific definitions
- * of the TI DM644x, DM355, DM365, and DM646x.
- *
- * Copyright (C) 2011 Texas Instruments Incorporated
- * Copyright (c) 2007 Deep Root Systems, LLC
- */
-#ifndef __DAVINCI_H
-#define __DAVINCI_H
-
-#include <linux/clk.h>
-#include <linux/videodev2.h>
-#include <linux/davinci_emac.h>
-#include <linux/platform_device.h>
-#include <linux/spi/spi.h>
-#include <linux/platform_data/davinci_asp.h>
-#include <linux/platform_data/edma.h>
-#include <linux/platform_data/keyscan-davinci.h>
-
-#include "hardware.h"
-
-#include <media/davinci/vpfe_capture.h>
-#include <media/davinci/vpif_types.h>
-#include <media/davinci/vpss.h>
-#include <media/davinci/vpbe_types.h>
-#include <media/davinci/vpbe_venc.h>
-#include <media/davinci/vpbe.h>
-#include <media/davinci/vpbe_osd.h>
-
-#define DAVINCI_PLL1_BASE 0x01c40800
-#define DAVINCI_PLL2_BASE 0x01c40c00
-#define DAVINCI_PWR_SLEEP_CNTRL_BASE 0x01c41000
-
-#define DAVINCI_SYSTEM_MODULE_BASE 0x01c40000
-#define SYSMOD_VDAC_CONFIG 0x2c
-#define SYSMOD_VIDCLKCTL 0x38
-#define SYSMOD_VPSS_CLKCTL 0x44
-#define SYSMOD_VDD3P3VPWDN 0x48
-#define SYSMOD_VSCLKDIS 0x6c
-#define SYSMOD_PUPDCTL1 0x7c
-
-/* VPSS CLKCTL bit definitions */
-#define VPSS_MUXSEL_EXTCLK_ENABLE BIT(1)
-#define VPSS_VENCCLKEN_ENABLE BIT(3)
-#define VPSS_DACCLKEN_ENABLE BIT(4)
-#define VPSS_PLLC2SYSCLK5_ENABLE BIT(5)
-
-extern void __iomem *davinci_sysmod_base;
-#define DAVINCI_SYSMOD_VIRT(x) (davinci_sysmod_base + (x))
-void davinci_map_sysmod(void);
-
-#define DAVINCI_GPIO_BASE 0x01C67000
-int davinci_gpio_register(struct resource *res, int size, void *pdata);
-
-#define DAVINCI_TIMER0_BASE (IO_PHYS + 0x21400)
-#define DAVINCI_WDOG_BASE (IO_PHYS + 0x21C00)
-
-/* DM355 base addresses */
-#define DM355_ASYNC_EMIF_CONTROL_BASE 0x01e10000
-#define DM355_ASYNC_EMIF_DATA_CE0_BASE 0x02000000
-
-#define ASP1_TX_EVT_EN 1
-#define ASP1_RX_EVT_EN 2
-
-/* DM365 base addresses */
-#define DM365_ASYNC_EMIF_CONTROL_BASE 0x01d10000
-#define DM365_ASYNC_EMIF_DATA_CE0_BASE 0x02000000
-#define DM365_ASYNC_EMIF_DATA_CE1_BASE 0x04000000
-
-/* DM644x base addresses */
-#define DM644X_ASYNC_EMIF_CONTROL_BASE 0x01e00000
-#define DM644X_ASYNC_EMIF_DATA_CE0_BASE 0x02000000
-#define DM644X_ASYNC_EMIF_DATA_CE1_BASE 0x04000000
-#define DM644X_ASYNC_EMIF_DATA_CE2_BASE 0x06000000
-#define DM644X_ASYNC_EMIF_DATA_CE3_BASE 0x08000000
-
-/* DM646x base addresses */
-#define DM646X_ASYNC_EMIF_CONTROL_BASE 0x20008000
-#define DM646X_ASYNC_EMIF_CS2_SPACE_BASE 0x42000000
-
-int davinci_init_wdt(void);
-
-/* DM355 function declarations */
-void dm355_init(void);
-void dm355_init_time(void);
-void dm355_init_irq(void);
-void dm355_register_clocks(void);
-void dm355_init_spi0(unsigned chipselect_mask,
- const struct spi_board_info *info, unsigned len);
-void dm355_init_asp1(u32 evt_enable);
-int dm355_init_video(struct vpfe_config *, struct vpbe_config *);
-int dm355_gpio_register(void);
-
-/* DM365 function declarations */
-void dm365_init(void);
-void dm365_init_irq(void);
-void dm365_init_time(void);
-void dm365_register_clocks(void);
-void dm365_init_asp(void);
-void dm365_init_vc(void);
-void dm365_init_ks(struct davinci_ks_platform_data *pdata);
-void dm365_init_rtc(void);
-void dm365_init_spi0(unsigned chipselect_mask,
- const struct spi_board_info *info, unsigned len);
-int dm365_init_video(struct vpfe_config *, struct vpbe_config *);
-int dm365_gpio_register(void);
-
-/* DM644x function declarations */
-void dm644x_init(void);
-void dm644x_init_irq(void);
-void dm644x_init_devices(void);
-void dm644x_init_time(void);
-void dm644x_register_clocks(void);
-void dm644x_init_asp(void);
-int dm644x_init_video(struct vpfe_config *, struct vpbe_config *);
-int dm644x_gpio_register(void);
-
-/* DM646x function declarations */
-void dm646x_init(void);
-void dm646x_init_irq(void);
-void dm646x_init_time(unsigned long ref_clk_rate, unsigned long aux_clkin_rate);
-void dm646x_register_clocks(void);
-void dm646x_init_mcasp0(struct snd_platform_data *pdata);
-void dm646x_init_mcasp1(struct snd_platform_data *pdata);
-int dm646x_init_edma(struct edma_rsv_info *rsv);
-void dm646x_video_init(void);
-void dm646x_setup_vpif(struct vpif_display_config *,
- struct vpif_capture_config *);
-int dm646x_gpio_register(void);
-
-extern struct platform_device dm365_serial_device[];
-extern struct platform_device dm355_serial_device[];
-extern struct platform_device dm644x_serial_device[];
-extern struct platform_device dm646x_serial_device[];
-#endif /*__DAVINCI_H */
diff --git a/arch/arm/mach-davinci/devices-da8xx.c b/arch/arm/mach-davinci/devices-da8xx.c
index ef9593558e5f..6939166c33c2 100644
--- a/arch/arm/mach-davinci/devices-da8xx.c
+++ b/arch/arm/mach-davinci/devices-da8xx.c
@@ -21,7 +21,6 @@
#include "common.h"
#include "cputype.h"
#include "da8xx.h"
-#include "asp.h"
#include "cpuidle.h"
#include "irqs.h"
#include "sram.h"
@@ -57,911 +56,6 @@
void __iomem *da8xx_syscfg0_base;
void __iomem *da8xx_syscfg1_base;
-static struct plat_serial8250_port da8xx_serial0_pdata[] = {
- {
- .mapbase = DA8XX_UART0_BASE,
- .irq = DAVINCI_INTC_IRQ(IRQ_DA8XX_UARTINT0),
- .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST |
- UPF_IOREMAP,
- .iotype = UPIO_MEM,
- .regshift = 2,
- },
- {
- .flags = 0,
- }
-};
-static struct plat_serial8250_port da8xx_serial1_pdata[] = {
- {
- .mapbase = DA8XX_UART1_BASE,
- .irq = DAVINCI_INTC_IRQ(IRQ_DA8XX_UARTINT1),
- .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST |
- UPF_IOREMAP,
- .iotype = UPIO_MEM,
- .regshift = 2,
- },
- {
- .flags = 0,
- }
-};
-static struct plat_serial8250_port da8xx_serial2_pdata[] = {
- {
- .mapbase = DA8XX_UART2_BASE,
- .irq = DAVINCI_INTC_IRQ(IRQ_DA8XX_UARTINT2),
- .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST |
- UPF_IOREMAP,
- .iotype = UPIO_MEM,
- .regshift = 2,
- },
- {
- .flags = 0,
- }
-};
-
-struct platform_device da8xx_serial_device[] = {
- {
- .name = "serial8250",
- .id = PLAT8250_DEV_PLATFORM,
- .dev = {
- .platform_data = da8xx_serial0_pdata,
- }
- },
- {
- .name = "serial8250",
- .id = PLAT8250_DEV_PLATFORM1,
- .dev = {
- .platform_data = da8xx_serial1_pdata,
- }
- },
- {
- .name = "serial8250",
- .id = PLAT8250_DEV_PLATFORM2,
- .dev = {
- .platform_data = da8xx_serial2_pdata,
- }
- },
- {
- }
-};
-
-static s8 da8xx_queue_priority_mapping[][2] = {
- /* {event queue no, Priority} */
- {0, 3},
- {1, 7},
- {-1, -1}
-};
-
-static s8 da850_queue_priority_mapping[][2] = {
- /* {event queue no, Priority} */
- {0, 3},
- {-1, -1}
-};
-
-static struct edma_soc_info da8xx_edma0_pdata = {
- .queue_priority_mapping = da8xx_queue_priority_mapping,
- .default_queue = EVENTQ_1,
-};
-
-static struct edma_soc_info da850_edma1_pdata = {
- .queue_priority_mapping = da850_queue_priority_mapping,
- .default_queue = EVENTQ_0,
-};
-
-static struct resource da8xx_edma0_resources[] = {
- {
- .name = "edma3_cc",
- .start = DA8XX_TPCC_BASE,
- .end = DA8XX_TPCC_BASE + SZ_32K - 1,
- .flags = IORESOURCE_MEM,
- },
- {
- .name = "edma3_tc0",
- .start = DA8XX_TPTC0_BASE,
- .end = DA8XX_TPTC0_BASE + SZ_1K - 1,
- .flags = IORESOURCE_MEM,
- },
- {
- .name = "edma3_tc1",
- .start = DA8XX_TPTC1_BASE,
- .end = DA8XX_TPTC1_BASE + SZ_1K - 1,
- .flags = IORESOURCE_MEM,
- },
- {
- .name = "edma3_ccint",
- .start = DAVINCI_INTC_IRQ(IRQ_DA8XX_CCINT0),
- .flags = IORESOURCE_IRQ,
- },
- {
- .name = "edma3_ccerrint",
- .start = DAVINCI_INTC_IRQ(IRQ_DA8XX_CCERRINT),
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct resource da850_edma1_resources[] = {
- {
- .name = "edma3_cc",
- .start = DA850_TPCC1_BASE,
- .end = DA850_TPCC1_BASE + SZ_32K - 1,
- .flags = IORESOURCE_MEM,
- },
- {
- .name = "edma3_tc0",
- .start = DA850_TPTC2_BASE,
- .end = DA850_TPTC2_BASE + SZ_1K - 1,
- .flags = IORESOURCE_MEM,
- },
- {
- .name = "edma3_ccint",
- .start = DAVINCI_INTC_IRQ(IRQ_DA850_CCINT1),
- .flags = IORESOURCE_IRQ,
- },
- {
- .name = "edma3_ccerrint",
- .start = DAVINCI_INTC_IRQ(IRQ_DA850_CCERRINT1),
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static const struct platform_device_info da8xx_edma0_device __initconst = {
- .name = "edma",
- .id = 0,
- .dma_mask = DMA_BIT_MASK(32),
- .res = da8xx_edma0_resources,
- .num_res = ARRAY_SIZE(da8xx_edma0_resources),
- .data = &da8xx_edma0_pdata,
- .size_data = sizeof(da8xx_edma0_pdata),
-};
-
-static const struct platform_device_info da850_edma1_device __initconst = {
- .name = "edma",
- .id = 1,
- .dma_mask = DMA_BIT_MASK(32),
- .res = da850_edma1_resources,
- .num_res = ARRAY_SIZE(da850_edma1_resources),
- .data = &da850_edma1_pdata,
- .size_data = sizeof(da850_edma1_pdata),
-};
-
-static const struct dma_slave_map da830_edma_map[] = {
- { "davinci-mcasp.0", "rx", EDMA_FILTER_PARAM(0, 0) },
- { "davinci-mcasp.0", "tx", EDMA_FILTER_PARAM(0, 1) },
- { "davinci-mcasp.1", "rx", EDMA_FILTER_PARAM(0, 2) },
- { "davinci-mcasp.1", "tx", EDMA_FILTER_PARAM(0, 3) },
- { "davinci-mcasp.2", "rx", EDMA_FILTER_PARAM(0, 4) },
- { "davinci-mcasp.2", "tx", EDMA_FILTER_PARAM(0, 5) },
- { "spi_davinci.0", "rx", EDMA_FILTER_PARAM(0, 14) },
- { "spi_davinci.0", "tx", EDMA_FILTER_PARAM(0, 15) },
- { "da830-mmc.0", "rx", EDMA_FILTER_PARAM(0, 16) },
- { "da830-mmc.0", "tx", EDMA_FILTER_PARAM(0, 17) },
- { "spi_davinci.1", "rx", EDMA_FILTER_PARAM(0, 18) },
- { "spi_davinci.1", "tx", EDMA_FILTER_PARAM(0, 19) },
-};
-
-int __init da830_register_edma(struct edma_rsv_info *rsv)
-{
- struct platform_device *edma_pdev;
-
- da8xx_edma0_pdata.rsv = rsv;
-
- da8xx_edma0_pdata.slave_map = da830_edma_map;
- da8xx_edma0_pdata.slavecnt = ARRAY_SIZE(da830_edma_map);
-
- edma_pdev = platform_device_register_full(&da8xx_edma0_device);
- return PTR_ERR_OR_ZERO(edma_pdev);
-}
-
-static const struct dma_slave_map da850_edma0_map[] = {
- { "davinci-mcasp.0", "rx", EDMA_FILTER_PARAM(0, 0) },
- { "davinci-mcasp.0", "tx", EDMA_FILTER_PARAM(0, 1) },
- { "davinci-mcbsp.0", "rx", EDMA_FILTER_PARAM(0, 2) },
- { "davinci-mcbsp.0", "tx", EDMA_FILTER_PARAM(0, 3) },
- { "davinci-mcbsp.1", "rx", EDMA_FILTER_PARAM(0, 4) },
- { "davinci-mcbsp.1", "tx", EDMA_FILTER_PARAM(0, 5) },
- { "spi_davinci.0", "rx", EDMA_FILTER_PARAM(0, 14) },
- { "spi_davinci.0", "tx", EDMA_FILTER_PARAM(0, 15) },
- { "da830-mmc.0", "rx", EDMA_FILTER_PARAM(0, 16) },
- { "da830-mmc.0", "tx", EDMA_FILTER_PARAM(0, 17) },
- { "spi_davinci.1", "rx", EDMA_FILTER_PARAM(0, 18) },
- { "spi_davinci.1", "tx", EDMA_FILTER_PARAM(0, 19) },
-};
-
-static const struct dma_slave_map da850_edma1_map[] = {
- { "da830-mmc.1", "rx", EDMA_FILTER_PARAM(1, 28) },
- { "da830-mmc.1", "tx", EDMA_FILTER_PARAM(1, 29) },
-};
-
-int __init da850_register_edma(struct edma_rsv_info *rsv[2])
-{
- struct platform_device *edma_pdev;
-
- if (rsv) {
- da8xx_edma0_pdata.rsv = rsv[0];
- da850_edma1_pdata.rsv = rsv[1];
- }
-
- da8xx_edma0_pdata.slave_map = da850_edma0_map;
- da8xx_edma0_pdata.slavecnt = ARRAY_SIZE(da850_edma0_map);
-
- edma_pdev = platform_device_register_full(&da8xx_edma0_device);
- if (IS_ERR(edma_pdev)) {
- pr_warn("%s: Failed to register eDMA0\n", __func__);
- return PTR_ERR(edma_pdev);
- }
-
- da850_edma1_pdata.slave_map = da850_edma1_map;
- da850_edma1_pdata.slavecnt = ARRAY_SIZE(da850_edma1_map);
-
- edma_pdev = platform_device_register_full(&da850_edma1_device);
- return PTR_ERR_OR_ZERO(edma_pdev);
-}
-
-static struct resource da8xx_i2c_resources0[] = {
- {
- .start = DA8XX_I2C0_BASE,
- .end = DA8XX_I2C0_BASE + SZ_4K - 1,
- .flags = IORESOURCE_MEM,
- },
- {
- .start = DAVINCI_INTC_IRQ(IRQ_DA8XX_I2CINT0),
- .end = DAVINCI_INTC_IRQ(IRQ_DA8XX_I2CINT0),
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct platform_device da8xx_i2c_device0 = {
- .name = "i2c_davinci",
- .id = 1,
- .num_resources = ARRAY_SIZE(da8xx_i2c_resources0),
- .resource = da8xx_i2c_resources0,
-};
-
-static struct resource da8xx_i2c_resources1[] = {
- {
- .start = DA8XX_I2C1_BASE,
- .end = DA8XX_I2C1_BASE + SZ_4K - 1,
- .flags = IORESOURCE_MEM,
- },
- {
- .start = DAVINCI_INTC_IRQ(IRQ_DA8XX_I2CINT1),
- .end = DAVINCI_INTC_IRQ(IRQ_DA8XX_I2CINT1),
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct platform_device da8xx_i2c_device1 = {
- .name = "i2c_davinci",
- .id = 2,
- .num_resources = ARRAY_SIZE(da8xx_i2c_resources1),
- .resource = da8xx_i2c_resources1,
-};
-
-int __init da8xx_register_i2c(int instance,
- struct davinci_i2c_platform_data *pdata)
-{
- struct platform_device *pdev;
-
- if (instance == 0)
- pdev = &da8xx_i2c_device0;
- else if (instance == 1)
- pdev = &da8xx_i2c_device1;
- else
- return -EINVAL;
-
- pdev->dev.platform_data = pdata;
- return platform_device_register(pdev);
-}
-
-static struct resource da8xx_watchdog_resources[] = {
- {
- .start = DA8XX_WDOG_BASE,
- .end = DA8XX_WDOG_BASE + SZ_4K - 1,
- .flags = IORESOURCE_MEM,
- },
-};
-
-static struct platform_device da8xx_wdt_device = {
- .name = "davinci-wdt",
- .id = -1,
- .num_resources = ARRAY_SIZE(da8xx_watchdog_resources),
- .resource = da8xx_watchdog_resources,
-};
-
-int __init da8xx_register_watchdog(void)
-{
- return platform_device_register(&da8xx_wdt_device);
-}
-
-static struct resource da8xx_emac_resources[] = {
- {
- .start = DA8XX_EMAC_CPPI_PORT_BASE,
- .end = DA8XX_EMAC_CPPI_PORT_BASE + SZ_16K - 1,
- .flags = IORESOURCE_MEM,
- },
- {
- .start = DAVINCI_INTC_IRQ(IRQ_DA8XX_C0_RX_THRESH_PULSE),
- .end = DAVINCI_INTC_IRQ(IRQ_DA8XX_C0_RX_THRESH_PULSE),
- .flags = IORESOURCE_IRQ,
- },
- {
- .start = DAVINCI_INTC_IRQ(IRQ_DA8XX_C0_RX_PULSE),
- .end = DAVINCI_INTC_IRQ(IRQ_DA8XX_C0_RX_PULSE),
- .flags = IORESOURCE_IRQ,
- },
- {
- .start = DAVINCI_INTC_IRQ(IRQ_DA8XX_C0_TX_PULSE),
- .end = DAVINCI_INTC_IRQ(IRQ_DA8XX_C0_TX_PULSE),
- .flags = IORESOURCE_IRQ,
- },
- {
- .start = DAVINCI_INTC_IRQ(IRQ_DA8XX_C0_MISC_PULSE),
- .end = DAVINCI_INTC_IRQ(IRQ_DA8XX_C0_MISC_PULSE),
- .flags = IORESOURCE_IRQ,
- },
-};
-
-struct emac_platform_data da8xx_emac_pdata = {
- .ctrl_reg_offset = DA8XX_EMAC_CTRL_REG_OFFSET,
- .ctrl_mod_reg_offset = DA8XX_EMAC_MOD_REG_OFFSET,
- .ctrl_ram_offset = DA8XX_EMAC_RAM_OFFSET,
- .ctrl_ram_size = DA8XX_EMAC_CTRL_RAM_SIZE,
- .version = EMAC_VERSION_2,
-};
-
-static struct platform_device da8xx_emac_device = {
- .name = "davinci_emac",
- .id = 1,
- .dev = {
- .platform_data = &da8xx_emac_pdata,
- },
- .num_resources = ARRAY_SIZE(da8xx_emac_resources),
- .resource = da8xx_emac_resources,
-};
-
-static struct resource da8xx_mdio_resources[] = {
- {
- .start = DA8XX_EMAC_MDIO_BASE,
- .end = DA8XX_EMAC_MDIO_BASE + SZ_4K - 1,
- .flags = IORESOURCE_MEM,
- },
-};
-
-static struct platform_device da8xx_mdio_device = {
- .name = "davinci_mdio",
- .id = 0,
- .num_resources = ARRAY_SIZE(da8xx_mdio_resources),
- .resource = da8xx_mdio_resources,
-};
-
-int __init da8xx_register_emac(void)
-{
- int ret;
-
- ret = platform_device_register(&da8xx_mdio_device);
- if (ret < 0)
- return ret;
-
- return platform_device_register(&da8xx_emac_device);
-}
-
-static struct resource da830_mcasp1_resources[] = {
- {
- .name = "mpu",
- .start = DAVINCI_DA830_MCASP1_REG_BASE,
- .end = DAVINCI_DA830_MCASP1_REG_BASE + (SZ_1K * 12) - 1,
- .flags = IORESOURCE_MEM,
- },
- /* TX event */
- {
- .name = "tx",
- .start = DAVINCI_DA830_DMA_MCASP1_AXEVT,
- .end = DAVINCI_DA830_DMA_MCASP1_AXEVT,
- .flags = IORESOURCE_DMA,
- },
- /* RX event */
- {
- .name = "rx",
- .start = DAVINCI_DA830_DMA_MCASP1_AREVT,
- .end = DAVINCI_DA830_DMA_MCASP1_AREVT,
- .flags = IORESOURCE_DMA,
- },
- {
- .name = "common",
- .start = DAVINCI_INTC_IRQ(IRQ_DA8XX_MCASPINT),
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct platform_device da830_mcasp1_device = {
- .name = "davinci-mcasp",
- .id = 1,
- .num_resources = ARRAY_SIZE(da830_mcasp1_resources),
- .resource = da830_mcasp1_resources,
-};
-
-static struct resource da830_mcasp2_resources[] = {
- {
- .name = "mpu",
- .start = DAVINCI_DA830_MCASP2_REG_BASE,
- .end = DAVINCI_DA830_MCASP2_REG_BASE + (SZ_1K * 12) - 1,
- .flags = IORESOURCE_MEM,
- },
- /* TX event */
- {
- .name = "tx",
- .start = DAVINCI_DA830_DMA_MCASP2_AXEVT,
- .end = DAVINCI_DA830_DMA_MCASP2_AXEVT,
- .flags = IORESOURCE_DMA,
- },
- /* RX event */
- {
- .name = "rx",
- .start = DAVINCI_DA830_DMA_MCASP2_AREVT,
- .end = DAVINCI_DA830_DMA_MCASP2_AREVT,
- .flags = IORESOURCE_DMA,
- },
- {
- .name = "common",
- .start = DAVINCI_INTC_IRQ(IRQ_DA8XX_MCASPINT),
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct platform_device da830_mcasp2_device = {
- .name = "davinci-mcasp",
- .id = 2,
- .num_resources = ARRAY_SIZE(da830_mcasp2_resources),
- .resource = da830_mcasp2_resources,
-};
-
-static struct resource da850_mcasp_resources[] = {
- {
- .name = "mpu",
- .start = DAVINCI_DA8XX_MCASP0_REG_BASE,
- .end = DAVINCI_DA8XX_MCASP0_REG_BASE + (SZ_1K * 12) - 1,
- .flags = IORESOURCE_MEM,
- },
- /* TX event */
- {
- .name = "tx",
- .start = DAVINCI_DA8XX_DMA_MCASP0_AXEVT,
- .end = DAVINCI_DA8XX_DMA_MCASP0_AXEVT,
- .flags = IORESOURCE_DMA,
- },
- /* RX event */
- {
- .name = "rx",
- .start = DAVINCI_DA8XX_DMA_MCASP0_AREVT,
- .end = DAVINCI_DA8XX_DMA_MCASP0_AREVT,
- .flags = IORESOURCE_DMA,
- },
- {
- .name = "common",
- .start = DAVINCI_INTC_IRQ(IRQ_DA8XX_MCASPINT),
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct platform_device da850_mcasp_device = {
- .name = "davinci-mcasp",
- .id = 0,
- .num_resources = ARRAY_SIZE(da850_mcasp_resources),
- .resource = da850_mcasp_resources,
-};
-
-void __init da8xx_register_mcasp(int id, struct snd_platform_data *pdata)
-{
- struct platform_device *pdev;
-
- switch (id) {
- case 0:
- /* Valid for DA830/OMAP-L137 or DA850/OMAP-L138 */
- pdev = &da850_mcasp_device;
- break;
- case 1:
- /* Valid for DA830/OMAP-L137 only */
- if (!cpu_is_davinci_da830())
- return;
- pdev = &da830_mcasp1_device;
- break;
- case 2:
- /* Valid for DA830/OMAP-L137 only */
- if (!cpu_is_davinci_da830())
- return;
- pdev = &da830_mcasp2_device;
- break;
- default:
- return;
- }
-
- pdev->dev.platform_data = pdata;
- platform_device_register(pdev);
-}
-
-static struct resource da8xx_pruss_resources[] = {
- {
- .start = DA8XX_PRUSS_MEM_BASE,
- .end = DA8XX_PRUSS_MEM_BASE + 0xFFFF,
- .flags = IORESOURCE_MEM,
- },
- {
- .start = DAVINCI_INTC_IRQ(IRQ_DA8XX_EVTOUT0),
- .end = DAVINCI_INTC_IRQ(IRQ_DA8XX_EVTOUT0),
- .flags = IORESOURCE_IRQ,
- },
- {
- .start = DAVINCI_INTC_IRQ(IRQ_DA8XX_EVTOUT1),
- .end = DAVINCI_INTC_IRQ(IRQ_DA8XX_EVTOUT1),
- .flags = IORESOURCE_IRQ,
- },
- {
- .start = DAVINCI_INTC_IRQ(IRQ_DA8XX_EVTOUT2),
- .end = DAVINCI_INTC_IRQ(IRQ_DA8XX_EVTOUT2),
- .flags = IORESOURCE_IRQ,
- },
- {
- .start = DAVINCI_INTC_IRQ(IRQ_DA8XX_EVTOUT3),
- .end = DAVINCI_INTC_IRQ(IRQ_DA8XX_EVTOUT3),
- .flags = IORESOURCE_IRQ,
- },
- {
- .start = DAVINCI_INTC_IRQ(IRQ_DA8XX_EVTOUT4),
- .end = DAVINCI_INTC_IRQ(IRQ_DA8XX_EVTOUT4),
- .flags = IORESOURCE_IRQ,
- },
- {
- .start = DAVINCI_INTC_IRQ(IRQ_DA8XX_EVTOUT5),
- .end = DAVINCI_INTC_IRQ(IRQ_DA8XX_EVTOUT5),
- .flags = IORESOURCE_IRQ,
- },
- {
- .start = DAVINCI_INTC_IRQ(IRQ_DA8XX_EVTOUT6),
- .end = DAVINCI_INTC_IRQ(IRQ_DA8XX_EVTOUT6),
- .flags = IORESOURCE_IRQ,
- },
- {
- .start = DAVINCI_INTC_IRQ(IRQ_DA8XX_EVTOUT7),
- .end = DAVINCI_INTC_IRQ(IRQ_DA8XX_EVTOUT7),
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct uio_pruss_pdata da8xx_uio_pruss_pdata = {
- .pintc_base = 0x4000,
-};
-
-static struct platform_device da8xx_uio_pruss_dev = {
- .name = "pruss_uio",
- .id = -1,
- .num_resources = ARRAY_SIZE(da8xx_pruss_resources),
- .resource = da8xx_pruss_resources,
- .dev = {
- .coherent_dma_mask = DMA_BIT_MASK(32),
- .platform_data = &da8xx_uio_pruss_pdata,
- }
-};
-
-int __init da8xx_register_uio_pruss(void)
-{
- da8xx_uio_pruss_pdata.sram_pool = sram_get_gen_pool();
- return platform_device_register(&da8xx_uio_pruss_dev);
-}
-
-static struct lcd_ctrl_config lcd_cfg = {
- .panel_shade = COLOR_ACTIVE,
- .bpp = 16,
-};
-
-struct da8xx_lcdc_platform_data sharp_lcd035q3dg01_pdata = {
- .manu_name = "sharp",
- .controller_data = &lcd_cfg,
- .type = "Sharp_LCD035Q3DG01",
-};
-
-struct da8xx_lcdc_platform_data sharp_lk043t1dg01_pdata = {
- .manu_name = "sharp",
- .controller_data = &lcd_cfg,
- .type = "Sharp_LK043T1DG01",
-};
-
-static struct resource da8xx_lcdc_resources[] = {
- [0] = { /* registers */
- .start = DA8XX_LCD_CNTRL_BASE,
- .end = DA8XX_LCD_CNTRL_BASE + SZ_4K - 1,
- .flags = IORESOURCE_MEM,
- },
- [1] = { /* interrupt */
- .start = DAVINCI_INTC_IRQ(IRQ_DA8XX_LCDINT),
- .end = DAVINCI_INTC_IRQ(IRQ_DA8XX_LCDINT),
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct platform_device da8xx_lcdc_device = {
- .name = "da8xx_lcdc",
- .id = 0,
- .num_resources = ARRAY_SIZE(da8xx_lcdc_resources),
- .resource = da8xx_lcdc_resources,
- .dev = {
- .coherent_dma_mask = DMA_BIT_MASK(32),
- }
-};
-
-int __init da8xx_register_lcdc(struct da8xx_lcdc_platform_data *pdata)
-{
- da8xx_lcdc_device.dev.platform_data = pdata;
- return platform_device_register(&da8xx_lcdc_device);
-}
-
-static struct resource da8xx_gpio_resources[] = {
- { /* registers */
- .start = DA8XX_GPIO_BASE,
- .end = DA8XX_GPIO_BASE + SZ_4K - 1,
- .flags = IORESOURCE_MEM,
- },
- { /* interrupt */
- .start = DAVINCI_INTC_IRQ(IRQ_DA8XX_GPIO0),
- .end = DAVINCI_INTC_IRQ(IRQ_DA8XX_GPIO0),
- .flags = IORESOURCE_IRQ,
- },
- {
- .start = DAVINCI_INTC_IRQ(IRQ_DA8XX_GPIO1),
- .end = DAVINCI_INTC_IRQ(IRQ_DA8XX_GPIO1),
- .flags = IORESOURCE_IRQ,
- },
- {
- .start = DAVINCI_INTC_IRQ(IRQ_DA8XX_GPIO2),
- .end = DAVINCI_INTC_IRQ(IRQ_DA8XX_GPIO2),
- .flags = IORESOURCE_IRQ,
- },
- {
- .start = DAVINCI_INTC_IRQ(IRQ_DA8XX_GPIO3),
- .end = DAVINCI_INTC_IRQ(IRQ_DA8XX_GPIO3),
- .flags = IORESOURCE_IRQ,
- },
- {
- .start = DAVINCI_INTC_IRQ(IRQ_DA8XX_GPIO4),
- .end = DAVINCI_INTC_IRQ(IRQ_DA8XX_GPIO4),
- .flags = IORESOURCE_IRQ,
- },
- {
- .start = DAVINCI_INTC_IRQ(IRQ_DA8XX_GPIO5),
- .end = DAVINCI_INTC_IRQ(IRQ_DA8XX_GPIO5),
- .flags = IORESOURCE_IRQ,
- },
- {
- .start = DAVINCI_INTC_IRQ(IRQ_DA8XX_GPIO6),
- .end = DAVINCI_INTC_IRQ(IRQ_DA8XX_GPIO6),
- .flags = IORESOURCE_IRQ,
- },
- {
- .start = DAVINCI_INTC_IRQ(IRQ_DA8XX_GPIO7),
- .end = DAVINCI_INTC_IRQ(IRQ_DA8XX_GPIO7),
- .flags = IORESOURCE_IRQ,
- },
- {
- .start = DAVINCI_INTC_IRQ(IRQ_DA8XX_GPIO8),
- .end = DAVINCI_INTC_IRQ(IRQ_DA8XX_GPIO8),
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct platform_device da8xx_gpio_device = {
- .name = "davinci_gpio",
- .id = -1,
- .num_resources = ARRAY_SIZE(da8xx_gpio_resources),
- .resource = da8xx_gpio_resources,
-};
-
-int __init da8xx_register_gpio(void *pdata)
-{
- da8xx_gpio_device.dev.platform_data = pdata;
- return platform_device_register(&da8xx_gpio_device);
-}
-
-static struct resource da8xx_mmcsd0_resources[] = {
- { /* registers */
- .start = DA8XX_MMCSD0_BASE,
- .end = DA8XX_MMCSD0_BASE + SZ_4K - 1,
- .flags = IORESOURCE_MEM,
- },
- { /* interrupt */
- .start = DAVINCI_INTC_IRQ(IRQ_DA8XX_MMCSDINT0),
- .end = DAVINCI_INTC_IRQ(IRQ_DA8XX_MMCSDINT0),
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct platform_device da8xx_mmcsd0_device = {
- .name = "da830-mmc",
- .id = 0,
- .num_resources = ARRAY_SIZE(da8xx_mmcsd0_resources),
- .resource = da8xx_mmcsd0_resources,
-};
-
-int __init da8xx_register_mmcsd0(struct davinci_mmc_config *config)
-{
- da8xx_mmcsd0_device.dev.platform_data = config;
- return platform_device_register(&da8xx_mmcsd0_device);
-}
-
-#ifdef CONFIG_ARCH_DAVINCI_DA850
-static struct resource da850_mmcsd1_resources[] = {
- { /* registers */
- .start = DA850_MMCSD1_BASE,
- .end = DA850_MMCSD1_BASE + SZ_4K - 1,
- .flags = IORESOURCE_MEM,
- },
- { /* interrupt */
- .start = DAVINCI_INTC_IRQ(IRQ_DA850_MMCSDINT0_1),
- .end = DAVINCI_INTC_IRQ(IRQ_DA850_MMCSDINT0_1),
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct platform_device da850_mmcsd1_device = {
- .name = "da830-mmc",
- .id = 1,
- .num_resources = ARRAY_SIZE(da850_mmcsd1_resources),
- .resource = da850_mmcsd1_resources,
-};
-
-int __init da850_register_mmcsd1(struct davinci_mmc_config *config)
-{
- da850_mmcsd1_device.dev.platform_data = config;
- return platform_device_register(&da850_mmcsd1_device);
-}
-#endif
-
-static struct resource da8xx_rproc_resources[] = {
- { /* DSP boot address */
- .name = "host1cfg",
- .start = DA8XX_SYSCFG0_BASE + DA8XX_HOST1CFG_REG,
- .end = DA8XX_SYSCFG0_BASE + DA8XX_HOST1CFG_REG + 3,
- .flags = IORESOURCE_MEM,
- },
- { /* DSP interrupt registers */
- .name = "chipsig",
- .start = DA8XX_SYSCFG0_BASE + DA8XX_CHIPSIG_REG,
- .end = DA8XX_SYSCFG0_BASE + DA8XX_CHIPSIG_REG + 7,
- .flags = IORESOURCE_MEM,
- },
- { /* DSP L2 RAM */
- .name = "l2sram",
- .start = DA8XX_DSP_L2_RAM_BASE,
- .end = DA8XX_DSP_L2_RAM_BASE + SZ_256K - 1,
- .flags = IORESOURCE_MEM,
- },
- { /* DSP L1P RAM */
- .name = "l1pram",
- .start = DA8XX_DSP_L1P_RAM_BASE,
- .end = DA8XX_DSP_L1P_RAM_BASE + SZ_32K - 1,
- .flags = IORESOURCE_MEM,
- },
- { /* DSP L1D RAM */
- .name = "l1dram",
- .start = DA8XX_DSP_L1D_RAM_BASE,
- .end = DA8XX_DSP_L1D_RAM_BASE + SZ_32K - 1,
- .flags = IORESOURCE_MEM,
- },
- { /* dsp irq */
- .start = DAVINCI_INTC_IRQ(IRQ_DA8XX_CHIPINT0),
- .end = DAVINCI_INTC_IRQ(IRQ_DA8XX_CHIPINT0),
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct platform_device da8xx_dsp = {
- .name = "davinci-rproc",
- .dev = {
- .coherent_dma_mask = DMA_BIT_MASK(32),
- },
- .num_resources = ARRAY_SIZE(da8xx_rproc_resources),
- .resource = da8xx_rproc_resources,
-};
-
-static bool rproc_mem_inited __initdata;
-
-#if IS_ENABLED(CONFIG_DA8XX_REMOTEPROC)
-
-static phys_addr_t rproc_base __initdata;
-static unsigned long rproc_size __initdata;
-
-static int __init early_rproc_mem(char *p)
-{
- char *endp;
-
- if (p == NULL)
- return 0;
-
- rproc_size = memparse(p, &endp);
- if (*endp == '@')
- rproc_base = memparse(endp + 1, NULL);
-
- return 0;
-}
-early_param("rproc_mem", early_rproc_mem);
-
-void __init da8xx_rproc_reserve_cma(void)
-{
- struct cma *cma;
- int ret;
-
- if (!rproc_base || !rproc_size) {
- pr_err("%s: 'rproc_mem=nn@address' badly specified\n"
- " 'nn' and 'address' must both be non-zero\n",
- __func__);
-
- return;
- }
-
- pr_info("%s: reserving 0x%lx @ 0x%lx...\n",
- __func__, rproc_size, (unsigned long)rproc_base);
-
- ret = dma_contiguous_reserve_area(rproc_size, rproc_base, 0, &cma,
- true);
- if (ret) {
- pr_err("%s: dma_contiguous_reserve_area failed %d\n",
- __func__, ret);
- return;
- }
- da8xx_dsp.dev.cma_area = cma;
- rproc_mem_inited = true;
-}
-#else
-
-void __init da8xx_rproc_reserve_cma(void)
-{
-}
-
-#endif
-
-int __init da8xx_register_rproc(void)
-{
- int ret;
-
- if (!rproc_mem_inited) {
- pr_warn("%s: memory not reserved for DSP, not registering DSP device\n",
- __func__);
- return -ENOMEM;
- }
-
- ret = platform_device_register(&da8xx_dsp);
- if (ret)
- pr_err("%s: can't register DSP device: %d\n", __func__, ret);
-
- return ret;
-};
-
-static struct resource da8xx_rtc_resources[] = {
- {
- .start = DA8XX_RTC_BASE,
- .end = DA8XX_RTC_BASE + SZ_4K - 1,
- .flags = IORESOURCE_MEM,
- },
- { /* timer irq */
- .start = DAVINCI_INTC_IRQ(IRQ_DA8XX_RTC),
- .end = DAVINCI_INTC_IRQ(IRQ_DA8XX_RTC),
- .flags = IORESOURCE_IRQ,
- },
- { /* alarm irq */
- .start = DAVINCI_INTC_IRQ(IRQ_DA8XX_RTC),
- .end = DAVINCI_INTC_IRQ(IRQ_DA8XX_RTC),
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct platform_device da8xx_rtc_device = {
- .name = "da830-rtc",
- .id = -1,
- .num_resources = ARRAY_SIZE(da8xx_rtc_resources),
- .resource = da8xx_rtc_resources,
-};
-
-int da8xx_register_rtc(void)
-{
- return platform_device_register(&da8xx_rtc_device);
-}
-
static void __iomem *da8xx_ddr2_ctlr_base;
void __iomem * __init da8xx_get_mem_ctlr(void)
{
@@ -974,192 +68,3 @@ void __iomem * __init da8xx_get_mem_ctlr(void)
return da8xx_ddr2_ctlr_base;
}
-
-static struct resource da8xx_cpuidle_resources[] = {
- {
- .start = DA8XX_DDR2_CTL_BASE,
- .end = DA8XX_DDR2_CTL_BASE + SZ_32K - 1,
- .flags = IORESOURCE_MEM,
- },
-};
-
-/* DA8XX devices support DDR2 power down */
-static struct davinci_cpuidle_config da8xx_cpuidle_pdata = {
- .ddr2_pdown = 1,
-};
-
-
-static struct platform_device da8xx_cpuidle_device = {
- .name = "cpuidle-davinci",
- .num_resources = ARRAY_SIZE(da8xx_cpuidle_resources),
- .resource = da8xx_cpuidle_resources,
- .dev = {
- .platform_data = &da8xx_cpuidle_pdata,
- },
-};
-
-int __init da8xx_register_cpuidle(void)
-{
- da8xx_cpuidle_pdata.ddr2_ctlr_base = da8xx_get_mem_ctlr();
-
- return platform_device_register(&da8xx_cpuidle_device);
-}
-
-static struct resource da8xx_spi0_resources[] = {
- [0] = {
- .start = DA8XX_SPI0_BASE,
- .end = DA8XX_SPI0_BASE + SZ_4K - 1,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- .start = DAVINCI_INTC_IRQ(IRQ_DA8XX_SPINT0),
- .end = DAVINCI_INTC_IRQ(IRQ_DA8XX_SPINT0),
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct resource da8xx_spi1_resources[] = {
- [0] = {
- .start = DA830_SPI1_BASE,
- .end = DA830_SPI1_BASE + SZ_4K - 1,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- .start = DAVINCI_INTC_IRQ(IRQ_DA8XX_SPINT1),
- .end = DAVINCI_INTC_IRQ(IRQ_DA8XX_SPINT1),
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct davinci_spi_platform_data da8xx_spi_pdata[] = {
- [0] = {
- .version = SPI_VERSION_2,
- .intr_line = 1,
- .dma_event_q = EVENTQ_0,
- .prescaler_limit = 2,
- },
- [1] = {
- .version = SPI_VERSION_2,
- .intr_line = 1,
- .dma_event_q = EVENTQ_0,
- .prescaler_limit = 2,
- },
-};
-
-static struct platform_device da8xx_spi_device[] = {
- [0] = {
- .name = "spi_davinci",
- .id = 0,
- .num_resources = ARRAY_SIZE(da8xx_spi0_resources),
- .resource = da8xx_spi0_resources,
- .dev = {
- .platform_data = &da8xx_spi_pdata[0],
- },
- },
- [1] = {
- .name = "spi_davinci",
- .id = 1,
- .num_resources = ARRAY_SIZE(da8xx_spi1_resources),
- .resource = da8xx_spi1_resources,
- .dev = {
- .platform_data = &da8xx_spi_pdata[1],
- },
- },
-};
-
-int __init da8xx_register_spi_bus(int instance, unsigned num_chipselect)
-{
- if (instance < 0 || instance > 1)
- return -EINVAL;
-
- da8xx_spi_pdata[instance].num_chipselect = num_chipselect;
-
- if (instance == 1 && cpu_is_davinci_da850()) {
- da8xx_spi1_resources[0].start = DA850_SPI1_BASE;
- da8xx_spi1_resources[0].end = DA850_SPI1_BASE + SZ_4K - 1;
- }
-
- return platform_device_register(&da8xx_spi_device[instance]);
-}
-
-#ifdef CONFIG_ARCH_DAVINCI_DA850
-int __init da850_register_sata_refclk(int rate)
-{
- struct clk *clk;
-
- clk = clk_register_fixed_rate(NULL, "sata_refclk", NULL, 0, rate);
- if (IS_ERR(clk))
- return PTR_ERR(clk);
-
- return clk_register_clkdev(clk, "refclk", "ahci_da850");
-}
-
-static struct resource da850_sata_resources[] = {
- {
- .start = DA850_SATA_BASE,
- .end = DA850_SATA_BASE + 0x1fff,
- .flags = IORESOURCE_MEM,
- },
- {
- .start = DA8XX_SYSCFG1_BASE + DA8XX_PWRDN_REG,
- .end = DA8XX_SYSCFG1_BASE + DA8XX_PWRDN_REG + 0x3,
- .flags = IORESOURCE_MEM,
- },
- {
- .start = DAVINCI_INTC_IRQ(IRQ_DA850_SATAINT),
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static u64 da850_sata_dmamask = DMA_BIT_MASK(32);
-
-static struct platform_device da850_sata_device = {
- .name = "ahci_da850",
- .id = -1,
- .dev = {
- .dma_mask = &da850_sata_dmamask,
- .coherent_dma_mask = DMA_BIT_MASK(32),
- },
- .num_resources = ARRAY_SIZE(da850_sata_resources),
- .resource = da850_sata_resources,
-};
-
-int __init da850_register_sata(unsigned long refclkpn)
-{
- int ret;
-
- ret = da850_register_sata_refclk(refclkpn);
- if (ret)
- return ret;
-
- return platform_device_register(&da850_sata_device);
-}
-#endif
-
-static struct regmap *da8xx_cfgchip;
-
-static const struct regmap_config da8xx_cfgchip_config __initconst = {
- .name = "cfgchip",
- .reg_bits = 32,
- .val_bits = 32,
- .reg_stride = 4,
- .max_register = DA8XX_CFGCHIP4_REG - DA8XX_CFGCHIP0_REG,
-};
-
-/**
- * da8xx_get_cfgchip - Lazy gets CFGCHIP as regmap
- *
- * This is for use on non-DT boards only. For DT boards, use
- * syscon_regmap_lookup_by_compatible("ti,da830-cfgchip")
- *
- * Returns: Pointer to the CFGCHIP regmap or negative error code.
- */
-struct regmap * __init da8xx_get_cfgchip(void)
-{
- if (IS_ERR_OR_NULL(da8xx_cfgchip))
- da8xx_cfgchip = regmap_init_mmio(NULL,
- DA8XX_SYSCFG0_VIRT(DA8XX_CFGCHIP0_REG),
- &da8xx_cfgchip_config);
-
- return da8xx_cfgchip;
-}
diff --git a/arch/arm/mach-davinci/irqs.h b/arch/arm/mach-davinci/irqs.h
index 8f9fc7a56ce8..b1ceed81e9fa 100644
--- a/arch/arm/mach-davinci/irqs.h
+++ b/arch/arm/mach-davinci/irqs.h
@@ -27,219 +27,6 @@
#ifndef __ASM_ARCH_IRQS_H
#define __ASM_ARCH_IRQS_H
-/* Base address */
-#define DAVINCI_ARM_INTC_BASE 0x01C48000
-
-/* Interrupt lines */
-#define IRQ_VDINT0 0
-#define IRQ_VDINT1 1
-#define IRQ_VDINT2 2
-#define IRQ_HISTINT 3
-#define IRQ_H3AINT 4
-#define IRQ_PRVUINT 5
-#define IRQ_RSZINT 6
-#define IRQ_VFOCINT 7
-#define IRQ_VENCINT 8
-#define IRQ_ASQINT 9
-#define IRQ_IMXINT 10
-#define IRQ_VLCDINT 11
-#define IRQ_USBINT 12
-#define IRQ_EMACINT 13
-
-#define IRQ_CCINT0 16
-#define IRQ_CCERRINT 17
-#define IRQ_TCERRINT0 18
-#define IRQ_TCERRINT 19
-#define IRQ_PSCIN 20
-
-#define IRQ_IDE 22
-#define IRQ_HPIINT 23
-#define IRQ_MBXINT 24
-#define IRQ_MBRINT 25
-#define IRQ_MMCINT 26
-#define IRQ_SDIOINT 27
-#define IRQ_MSINT 28
-#define IRQ_DDRINT 29
-#define IRQ_AEMIFINT 30
-#define IRQ_VLQINT 31
-#define IRQ_TINT0_TINT12 32
-#define IRQ_TINT0_TINT34 33
-#define IRQ_TINT1_TINT12 34
-#define IRQ_TINT1_TINT34 35
-#define IRQ_PWMINT0 36
-#define IRQ_PWMINT1 37
-#define IRQ_PWMINT2 38
-#define IRQ_I2C 39
-#define IRQ_UARTINT0 40
-#define IRQ_UARTINT1 41
-#define IRQ_UARTINT2 42
-#define IRQ_SPINT0 43
-#define IRQ_SPINT1 44
-
-#define IRQ_DSP2ARM0 46
-#define IRQ_DSP2ARM1 47
-#define IRQ_GPIO0 48
-#define IRQ_GPIO1 49
-#define IRQ_GPIO2 50
-#define IRQ_GPIO3 51
-#define IRQ_GPIO4 52
-#define IRQ_GPIO5 53
-#define IRQ_GPIO6 54
-#define IRQ_GPIO7 55
-#define IRQ_GPIOBNK0 56
-#define IRQ_GPIOBNK1 57
-#define IRQ_GPIOBNK2 58
-#define IRQ_GPIOBNK3 59
-#define IRQ_GPIOBNK4 60
-#define IRQ_COMMTX 61
-#define IRQ_COMMRX 62
-#define IRQ_EMUINT 63
-
-#define DAVINCI_N_AINTC_IRQ 64
-
-#define ARCH_TIMER_IRQ IRQ_TINT1_TINT34
-
-/* DaVinci DM6467-specific Interrupts */
-#define IRQ_DM646X_VP_VERTINT0 0
-#define IRQ_DM646X_VP_VERTINT1 1
-#define IRQ_DM646X_VP_VERTINT2 2
-#define IRQ_DM646X_VP_VERTINT3 3
-#define IRQ_DM646X_VP_ERRINT 4
-#define IRQ_DM646X_RESERVED_1 5
-#define IRQ_DM646X_RESERVED_2 6
-#define IRQ_DM646X_WDINT 7
-#define IRQ_DM646X_CRGENINT0 8
-#define IRQ_DM646X_CRGENINT1 9
-#define IRQ_DM646X_TSIFINT0 10
-#define IRQ_DM646X_TSIFINT1 11
-#define IRQ_DM646X_VDCEINT 12
-#define IRQ_DM646X_USBINT 13
-#define IRQ_DM646X_USBDMAINT 14
-#define IRQ_DM646X_PCIINT 15
-#define IRQ_DM646X_TCERRINT2 20
-#define IRQ_DM646X_TCERRINT3 21
-#define IRQ_DM646X_IDE 22
-#define IRQ_DM646X_HPIINT 23
-#define IRQ_DM646X_EMACRXTHINT 24
-#define IRQ_DM646X_EMACRXINT 25
-#define IRQ_DM646X_EMACTXINT 26
-#define IRQ_DM646X_EMACMISCINT 27
-#define IRQ_DM646X_MCASP0TXINT 28
-#define IRQ_DM646X_MCASP0RXINT 29
-#define IRQ_DM646X_MCASP1TXINT 30
-#define IRQ_DM646X_RESERVED_3 31
-#define IRQ_DM646X_VLQINT 38
-#define IRQ_DM646X_UARTINT2 42
-#define IRQ_DM646X_SPINT0 43
-#define IRQ_DM646X_SPINT1 44
-#define IRQ_DM646X_DSP2ARMINT 45
-#define IRQ_DM646X_RESERVED_4 46
-#define IRQ_DM646X_PSCINT 47
-#define IRQ_DM646X_GPIO0 48
-#define IRQ_DM646X_GPIO1 49
-#define IRQ_DM646X_GPIO2 50
-#define IRQ_DM646X_GPIO3 51
-#define IRQ_DM646X_GPIO4 52
-#define IRQ_DM646X_GPIO5 53
-#define IRQ_DM646X_GPIO6 54
-#define IRQ_DM646X_GPIO7 55
-#define IRQ_DM646X_GPIOBNK0 56
-#define IRQ_DM646X_GPIOBNK1 57
-#define IRQ_DM646X_GPIOBNK2 58
-#define IRQ_DM646X_DDRINT 59
-#define IRQ_DM646X_AEMIFINT 60
-
-/* DaVinci DM355-specific Interrupts */
-#define IRQ_DM355_CCDC_VDINT0 0
-#define IRQ_DM355_CCDC_VDINT1 1
-#define IRQ_DM355_CCDC_VDINT2 2
-#define IRQ_DM355_IPIPE_HST 3
-#define IRQ_DM355_H3AINT 4
-#define IRQ_DM355_IPIPE_SDR 5
-#define IRQ_DM355_IPIPEIFINT 6
-#define IRQ_DM355_OSDINT 7
-#define IRQ_DM355_VENCINT 8
-#define IRQ_DM355_IMCOPINT 11
-#define IRQ_DM355_RTOINT 13
-#define IRQ_DM355_TINT4 13
-#define IRQ_DM355_TINT2_TINT12 13
-#define IRQ_DM355_UARTINT2 14
-#define IRQ_DM355_TINT5 14
-#define IRQ_DM355_TINT2_TINT34 14
-#define IRQ_DM355_TINT6 15
-#define IRQ_DM355_TINT3_TINT12 15
-#define IRQ_DM355_SPINT1_0 17
-#define IRQ_DM355_SPINT1_1 18
-#define IRQ_DM355_SPINT2_0 19
-#define IRQ_DM355_SPINT2_1 21
-#define IRQ_DM355_TINT7 22
-#define IRQ_DM355_TINT3_TINT34 22
-#define IRQ_DM355_SDIOINT0 23
-#define IRQ_DM355_MMCINT0 26
-#define IRQ_DM355_MSINT 26
-#define IRQ_DM355_MMCINT1 27
-#define IRQ_DM355_PWMINT3 28
-#define IRQ_DM355_SDIOINT1 31
-#define IRQ_DM355_SPINT0_0 42
-#define IRQ_DM355_SPINT0_1 43
-#define IRQ_DM355_GPIO0 44
-#define IRQ_DM355_GPIO1 45
-#define IRQ_DM355_GPIO2 46
-#define IRQ_DM355_GPIO3 47
-#define IRQ_DM355_GPIO4 48
-#define IRQ_DM355_GPIO5 49
-#define IRQ_DM355_GPIO6 50
-#define IRQ_DM355_GPIO7 51
-#define IRQ_DM355_GPIO8 52
-#define IRQ_DM355_GPIO9 53
-#define IRQ_DM355_GPIOBNK0 54
-#define IRQ_DM355_GPIOBNK1 55
-#define IRQ_DM355_GPIOBNK2 56
-#define IRQ_DM355_GPIOBNK3 57
-#define IRQ_DM355_GPIOBNK4 58
-#define IRQ_DM355_GPIOBNK5 59
-#define IRQ_DM355_GPIOBNK6 60
-
-/* DaVinci DM365-specific Interrupts */
-#define IRQ_DM365_INSFINT 7
-#define IRQ_DM365_IMXINT1 8
-#define IRQ_DM365_IMXINT0 10
-#define IRQ_DM365_KLD_ARMINT 10
-#define IRQ_DM365_IMCOPINT 11
-#define IRQ_DM365_RTOINT 13
-#define IRQ_DM365_TINT5 14
-#define IRQ_DM365_TINT6 15
-#define IRQ_DM365_SPINT2_1 21
-#define IRQ_DM365_TINT7 22
-#define IRQ_DM365_SDIOINT0 23
-#define IRQ_DM365_MMCINT1 27
-#define IRQ_DM365_PWMINT3 28
-#define IRQ_DM365_RTCINT 29
-#define IRQ_DM365_SDIOINT1 31
-#define IRQ_DM365_SPIINT0_0 42
-#define IRQ_DM365_SPIINT3_0 43
-#define IRQ_DM365_GPIO0 44
-#define IRQ_DM365_GPIO1 45
-#define IRQ_DM365_GPIO2 46
-#define IRQ_DM365_GPIO3 47
-#define IRQ_DM365_GPIO4 48
-#define IRQ_DM365_GPIO5 49
-#define IRQ_DM365_GPIO6 50
-#define IRQ_DM365_GPIO7 51
-#define IRQ_DM365_EMAC_RXTHRESH 52
-#define IRQ_DM365_EMAC_RXPULSE 53
-#define IRQ_DM365_EMAC_TXPULSE 54
-#define IRQ_DM365_EMAC_MISCPULSE 55
-#define IRQ_DM365_GPIO12 56
-#define IRQ_DM365_GPIO13 57
-#define IRQ_DM365_GPIO14 58
-#define IRQ_DM365_GPIO15 59
-#define IRQ_DM365_ADCINT 59
-#define IRQ_DM365_KEYINT 60
-#define IRQ_DM365_TCERRINT2 61
-#define IRQ_DM365_TCERRINT3 62
-#define IRQ_DM365_EMUINT 63
-
/* DA8XX interrupts */
#define IRQ_DA8XX_COMMTX 0
#define IRQ_DA8XX_COMMRX 1
@@ -398,8 +185,4 @@
#define DA850_N_CP_INTC_IRQ 101
-/* da850 currently has the most gpio pins (144) */
-#define DAVINCI_N_GPIO 144
-/* da850 currently has the most irqs so use DA850_N_CP_INTC_IRQ */
-
#endif /* __ASM_ARCH_IRQS_H */
diff --git a/arch/arm/mach-davinci/mux.c b/arch/arm/mach-davinci/mux.c
index 814a6b714010..37de35eb6e8b 100644
--- a/arch/arm/mach-davinci/mux.c
+++ b/arch/arm/mach-davinci/mux.c
@@ -97,18 +97,3 @@ int davinci_cfg_reg(const unsigned long index)
return 0;
}
-EXPORT_SYMBOL(davinci_cfg_reg);
-
-int davinci_cfg_reg_list(const short pins[])
-{
- int i, error = -EINVAL;
-
- if (pins)
- for (i = 0; pins[i] >= 0; i++) {
- error = davinci_cfg_reg(pins[i]);
- if (error)
- break;
- }
-
- return error;
-}
diff --git a/arch/arm/mach-davinci/mux.h b/arch/arm/mach-davinci/mux.h
index b5effe16402c..38f0e427291e 100644
--- a/arch/arm/mach-davinci/mux.h
+++ b/arch/arm/mach-davinci/mux.h
@@ -21,321 +21,6 @@ struct mux_config {
bool debug;
};
-enum davinci_dm644x_index {
- /* ATA and HDDIR functions */
- DM644X_HDIREN,
- DM644X_ATAEN,
- DM644X_ATAEN_DISABLE,
-
- /* HPI functions */
- DM644X_HPIEN_DISABLE,
-
- /* AEAW functions */
- DM644X_AEAW,
- DM644X_AEAW0,
- DM644X_AEAW1,
- DM644X_AEAW2,
- DM644X_AEAW3,
- DM644X_AEAW4,
-
- /* Memory Stick */
- DM644X_MSTK,
-
- /* I2C */
- DM644X_I2C,
-
- /* ASP function */
- DM644X_MCBSP,
-
- /* UART1 */
- DM644X_UART1,
-
- /* UART2 */
- DM644X_UART2,
-
- /* PWM0 */
- DM644X_PWM0,
-
- /* PWM1 */
- DM644X_PWM1,
-
- /* PWM2 */
- DM644X_PWM2,
-
- /* VLYNQ function */
- DM644X_VLYNQEN,
- DM644X_VLSCREN,
- DM644X_VLYNQWD,
-
- /* EMAC and MDIO function */
- DM644X_EMACEN,
-
- /* GPIO3V[0:16] pins */
- DM644X_GPIO3V,
-
- /* GPIO pins */
- DM644X_GPIO0,
- DM644X_GPIO3,
- DM644X_GPIO43_44,
- DM644X_GPIO46_47,
-
- /* VPBE */
- DM644X_RGB666,
-
- /* LCD */
- DM644X_LOEEN,
- DM644X_LFLDEN,
-};
-
-enum davinci_dm646x_index {
- /* ATA function */
- DM646X_ATAEN,
-
- /* AUDIO Clock */
- DM646X_AUDCK1,
- DM646X_AUDCK0,
-
- /* CRGEN Control */
- DM646X_CRGMUX,
-
- /* VPIF Control */
- DM646X_STSOMUX_DISABLE,
- DM646X_STSIMUX_DISABLE,
- DM646X_PTSOMUX_DISABLE,
- DM646X_PTSIMUX_DISABLE,
-
- /* TSIF Control */
- DM646X_STSOMUX,
- DM646X_STSIMUX,
- DM646X_PTSOMUX_PARALLEL,
- DM646X_PTSIMUX_PARALLEL,
- DM646X_PTSOMUX_SERIAL,
- DM646X_PTSIMUX_SERIAL,
-};
-
-enum davinci_dm355_index {
- /* MMC/SD 0 */
- DM355_MMCSD0,
-
- /* MMC/SD 1 */
- DM355_SD1_CLK,
- DM355_SD1_CMD,
- DM355_SD1_DATA3,
- DM355_SD1_DATA2,
- DM355_SD1_DATA1,
- DM355_SD1_DATA0,
-
- /* I2C */
- DM355_I2C_SDA,
- DM355_I2C_SCL,
-
- /* ASP0 function */
- DM355_MCBSP0_BDX,
- DM355_MCBSP0_X,
- DM355_MCBSP0_BFSX,
- DM355_MCBSP0_BDR,
- DM355_MCBSP0_R,
- DM355_MCBSP0_BFSR,
-
- /* SPI0 */
- DM355_SPI0_SDI,
- DM355_SPI0_SDENA0,
- DM355_SPI0_SDENA1,
-
- /* IRQ muxing */
- DM355_INT_EDMA_CC,
- DM355_INT_EDMA_TC0_ERR,
- DM355_INT_EDMA_TC1_ERR,
-
- /* EDMA event muxing */
- DM355_EVT8_ASP1_TX,
- DM355_EVT9_ASP1_RX,
- DM355_EVT26_MMC0_RX,
-
- /* Video Out */
- DM355_VOUT_FIELD,
- DM355_VOUT_FIELD_G70,
- DM355_VOUT_HVSYNC,
- DM355_VOUT_COUTL_EN,
- DM355_VOUT_COUTH_EN,
-
- /* Video In Pin Mux */
- DM355_VIN_PCLK,
- DM355_VIN_CAM_WEN,
- DM355_VIN_CAM_VD,
- DM355_VIN_CAM_HD,
- DM355_VIN_YIN_EN,
- DM355_VIN_CINL_EN,
- DM355_VIN_CINH_EN,
-};
-
-enum davinci_dm365_index {
- /* MMC/SD 0 */
- DM365_MMCSD0,
-
- /* MMC/SD 1 */
- DM365_SD1_CLK,
- DM365_SD1_CMD,
- DM365_SD1_DATA3,
- DM365_SD1_DATA2,
- DM365_SD1_DATA1,
- DM365_SD1_DATA0,
-
- /* I2C */
- DM365_I2C_SDA,
- DM365_I2C_SCL,
-
- /* AEMIF */
- DM365_AEMIF_AR_A14,
- DM365_AEMIF_AR_BA0,
- DM365_AEMIF_A3,
- DM365_AEMIF_A7,
- DM365_AEMIF_D15_8,
- DM365_AEMIF_CE0,
- DM365_AEMIF_CE1,
- DM365_AEMIF_WE_OE,
-
- /* ASP0 function */
- DM365_MCBSP0_BDX,
- DM365_MCBSP0_X,
- DM365_MCBSP0_BFSX,
- DM365_MCBSP0_BDR,
- DM365_MCBSP0_R,
- DM365_MCBSP0_BFSR,
-
- /* SPI0 */
- DM365_SPI0_SCLK,
- DM365_SPI0_SDI,
- DM365_SPI0_SDO,
- DM365_SPI0_SDENA0,
- DM365_SPI0_SDENA1,
-
- /* UART */
- DM365_UART0_RXD,
- DM365_UART0_TXD,
- DM365_UART1_RXD,
- DM365_UART1_TXD,
- DM365_UART1_RTS,
- DM365_UART1_CTS,
-
- /* EMAC */
- DM365_EMAC_TX_EN,
- DM365_EMAC_TX_CLK,
- DM365_EMAC_COL,
- DM365_EMAC_TXD3,
- DM365_EMAC_TXD2,
- DM365_EMAC_TXD1,
- DM365_EMAC_TXD0,
- DM365_EMAC_RXD3,
- DM365_EMAC_RXD2,
- DM365_EMAC_RXD1,
- DM365_EMAC_RXD0,
- DM365_EMAC_RX_CLK,
- DM365_EMAC_RX_DV,
- DM365_EMAC_RX_ER,
- DM365_EMAC_CRS,
- DM365_EMAC_MDIO,
- DM365_EMAC_MDCLK,
-
- /* Key Scan */
- DM365_KEYSCAN,
-
- /* PWM */
- DM365_PWM0,
- DM365_PWM0_G23,
- DM365_PWM1,
- DM365_PWM1_G25,
- DM365_PWM2_G87,
- DM365_PWM2_G88,
- DM365_PWM2_G89,
- DM365_PWM2_G90,
- DM365_PWM3_G80,
- DM365_PWM3_G81,
- DM365_PWM3_G85,
- DM365_PWM3_G86,
-
- /* SPI1 */
- DM365_SPI1_SCLK,
- DM365_SPI1_SDO,
- DM365_SPI1_SDI,
- DM365_SPI1_SDENA0,
- DM365_SPI1_SDENA1,
-
- /* SPI2 */
- DM365_SPI2_SCLK,
- DM365_SPI2_SDO,
- DM365_SPI2_SDI,
- DM365_SPI2_SDENA0,
- DM365_SPI2_SDENA1,
-
- /* SPI3 */
- DM365_SPI3_SCLK,
- DM365_SPI3_SDO,
- DM365_SPI3_SDI,
- DM365_SPI3_SDENA0,
- DM365_SPI3_SDENA1,
-
- /* SPI4 */
- DM365_SPI4_SCLK,
- DM365_SPI4_SDO,
- DM365_SPI4_SDI,
- DM365_SPI4_SDENA0,
- DM365_SPI4_SDENA1,
-
- /* Clock */
- DM365_CLKOUT0,
- DM365_CLKOUT1,
- DM365_CLKOUT2,
-
- /* GPIO */
- DM365_GPIO20,
- DM365_GPIO30,
- DM365_GPIO31,
- DM365_GPIO32,
- DM365_GPIO33,
- DM365_GPIO40,
- DM365_GPIO64_57,
-
- /* Video */
- DM365_VOUT_FIELD,
- DM365_VOUT_FIELD_G81,
- DM365_VOUT_HVSYNC,
- DM365_VOUT_COUTL_EN,
- DM365_VOUT_COUTH_EN,
- DM365_VIN_CAM_WEN,
- DM365_VIN_CAM_VD,
- DM365_VIN_CAM_HD,
- DM365_VIN_YIN4_7_EN,
- DM365_VIN_YIN0_3_EN,
-
- /* IRQ muxing */
- DM365_INT_EDMA_CC,
- DM365_INT_EDMA_TC0_ERR,
- DM365_INT_EDMA_TC1_ERR,
- DM365_INT_EDMA_TC2_ERR,
- DM365_INT_EDMA_TC3_ERR,
- DM365_INT_PRTCSS,
- DM365_INT_EMAC_RXTHRESH,
- DM365_INT_EMAC_RXPULSE,
- DM365_INT_EMAC_TXPULSE,
- DM365_INT_EMAC_MISCPULSE,
- DM365_INT_IMX0_ENABLE,
- DM365_INT_IMX0_DISABLE,
- DM365_INT_HDVICP_ENABLE,
- DM365_INT_HDVICP_DISABLE,
- DM365_INT_IMX1_ENABLE,
- DM365_INT_IMX1_DISABLE,
- DM365_INT_NSF_ENABLE,
- DM365_INT_NSF_DISABLE,
-
- /* EDMA event muxing */
- DM365_EVT2_ASP_TX,
- DM365_EVT3_ASP_RX,
- DM365_EVT2_VC_TX,
- DM365_EVT3_VC_RX,
- DM365_EVT26_MMC0_RX,
-};
-
enum da830_index {
DA830_GPIO7_14,
DA830_RTCK,
diff --git a/arch/arm/mach-davinci/psc.h b/arch/arm/mach-davinci/psc.h
index 68cd9d3fc82b..acfef063295f 100644
--- a/arch/arm/mach-davinci/psc.h
+++ b/arch/arm/mach-davinci/psc.h
@@ -70,70 +70,6 @@
#define DAVINCI_LPSC_GEM 39
#define DAVINCI_LPSC_IMCOP 40
-#define DM355_LPSC_TIMER3 5
-#define DM355_LPSC_SPI1 6
-#define DM355_LPSC_MMC_SD1 7
-#define DM355_LPSC_McBSP1 8
-#define DM355_LPSC_PWM3 10
-#define DM355_LPSC_SPI2 11
-#define DM355_LPSC_RTO 12
-#define DM355_LPSC_VPSS_DAC 41
-
-/* DM365 */
-#define DM365_LPSC_TIMER3 5
-#define DM365_LPSC_SPI1 6
-#define DM365_LPSC_MMC_SD1 7
-#define DM365_LPSC_McBSP1 8
-#define DM365_LPSC_PWM3 10
-#define DM365_LPSC_SPI2 11
-#define DM365_LPSC_RTO 12
-#define DM365_LPSC_TIMER4 17
-#define DM365_LPSC_SPI0 22
-#define DM365_LPSC_SPI3 38
-#define DM365_LPSC_SPI4 39
-#define DM365_LPSC_EMAC 40
-#define DM365_LPSC_VOICE_CODEC 44
-#define DM365_LPSC_DAC_CLK 46
-#define DM365_LPSC_VPSSMSTR 47
-#define DM365_LPSC_MJCP 50
-
-/*
- * LPSC Assignments
- */
-#define DM646X_LPSC_ARM 0
-#define DM646X_LPSC_C64X_CPU 1
-#define DM646X_LPSC_HDVICP0 2
-#define DM646X_LPSC_HDVICP1 3
-#define DM646X_LPSC_TPCC 4
-#define DM646X_LPSC_TPTC0 5
-#define DM646X_LPSC_TPTC1 6
-#define DM646X_LPSC_TPTC2 7
-#define DM646X_LPSC_TPTC3 8
-#define DM646X_LPSC_PCI 13
-#define DM646X_LPSC_EMAC 14
-#define DM646X_LPSC_VDCE 15
-#define DM646X_LPSC_VPSSMSTR 16
-#define DM646X_LPSC_VPSSSLV 17
-#define DM646X_LPSC_TSIF0 18
-#define DM646X_LPSC_TSIF1 19
-#define DM646X_LPSC_DDR_EMIF 20
-#define DM646X_LPSC_AEMIF 21
-#define DM646X_LPSC_McASP0 22
-#define DM646X_LPSC_McASP1 23
-#define DM646X_LPSC_CRGEN0 24
-#define DM646X_LPSC_CRGEN1 25
-#define DM646X_LPSC_UART0 26
-#define DM646X_LPSC_UART1 27
-#define DM646X_LPSC_UART2 28
-#define DM646X_LPSC_PWM0 29
-#define DM646X_LPSC_PWM1 30
-#define DM646X_LPSC_I2C 31
-#define DM646X_LPSC_SPI 32
-#define DM646X_LPSC_GPIO 33
-#define DM646X_LPSC_TIMER0 34
-#define DM646X_LPSC_TIMER1 35
-#define DM646X_LPSC_ARM_INTC 45
-
/* PSC0 defines */
#define DA8XX_LPSC0_TPCC 0
#define DA8XX_LPSC0_TPTC0 1
diff --git a/arch/arm/mach-davinci/serial.c b/arch/arm/mach-davinci/serial.c
deleted file mode 100644
index ac1929bb0ef2..000000000000
--- a/arch/arm/mach-davinci/serial.c
+++ /dev/null
@@ -1,88 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-or-later
-/*
- * TI DaVinci serial driver
- *
- * Copyright (C) 2006 Texas Instruments.
- */
-
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/serial_8250.h>
-#include <linux/serial_reg.h>
-#include <linux/platform_device.h>
-#include <linux/delay.h>
-#include <linux/clk.h>
-#include <linux/io.h>
-
-#include "serial.h"
-#include "cputype.h"
-
-static inline void serial_write_reg(struct plat_serial8250_port *p, int offset,
- int value)
-{
- offset <<= p->regshift;
-
- WARN_ONCE(!p->membase, "unmapped write: uart[%d]\n", offset);
-
- __raw_writel(value, p->membase + offset);
-}
-
-static void __init davinci_serial_reset(struct plat_serial8250_port *p)
-{
- unsigned int pwremu = 0;
-
- serial_write_reg(p, UART_IER, 0); /* disable all interrupts */
-
- /* reset both transmitter and receiver: bits 14,13 = UTRST, URRST */
- serial_write_reg(p, UART_DAVINCI_PWREMU, pwremu);
- mdelay(10);
-
- pwremu |= (0x3 << 13);
- pwremu |= 0x1;
- serial_write_reg(p, UART_DAVINCI_PWREMU, pwremu);
-}
-
-int __init davinci_serial_init(struct platform_device *serial_dev)
-{
- int i, ret = 0;
- struct device *dev;
- struct plat_serial8250_port *p;
- struct clk *clk;
-
- /*
- * Make sure the serial ports are muxed on at this point.
- * You have to mux them off in device drivers later on if not needed.
- */
- for (i = 0; serial_dev[i].dev.platform_data != NULL; i++) {
- dev = &serial_dev[i].dev;
- p = dev->platform_data;
-
- ret = platform_device_register(&serial_dev[i]);
- if (ret)
- continue;
-
- clk = clk_get(dev, NULL);
- if (IS_ERR(clk)) {
- pr_err("%s:%d: failed to get UART%d clock\n",
- __func__, __LINE__, i);
- continue;
- }
-
- clk_prepare_enable(clk);
-
- p->uartclk = clk_get_rate(clk);
-
- if (!p->membase && p->mapbase) {
- p->membase = ioremap(p->mapbase, SZ_4K);
-
- if (p->membase)
- p->flags &= ~UPF_IOREMAP;
- else
- pr_err("uart regs ioremap failed\n");
- }
-
- if (p->membase && p->type != PORT_AR7)
- davinci_serial_reset(p);
- }
- return ret;
-}
diff --git a/arch/arm/mach-davinci/serial.h b/arch/arm/mach-davinci/serial.h
deleted file mode 100644
index c4a4ba553d45..000000000000
--- a/arch/arm/mach-davinci/serial.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-/*
- * DaVinci serial device definitions
- *
- * Author: Kevin Hilman, MontaVista Software, Inc. <source@mvista.com>
- *
- * 2007 (c) MontaVista Software, Inc.
- */
-#ifndef __ASM_ARCH_SERIAL_H
-#define __ASM_ARCH_SERIAL_H
-
-#include <asm/memory.h>
-
-#include "hardware.h"
-
-#define DAVINCI_UART0_BASE (IO_PHYS + 0x20000)
-#define DAVINCI_UART1_BASE (IO_PHYS + 0x20400)
-#define DAVINCI_UART2_BASE (IO_PHYS + 0x20800)
-
-#define DA8XX_UART0_BASE (IO_PHYS + 0x042000)
-#define DA8XX_UART1_BASE (IO_PHYS + 0x10c000)
-#define DA8XX_UART2_BASE (IO_PHYS + 0x10d000)
-
-/* DaVinci UART register offsets */
-#define UART_DAVINCI_PWREMU 0x0c
-#define UART_DM646X_SCR 0x10
-#define UART_DM646X_SCR_TX_WATERMARK 0x08
-
-#ifndef __ASSEMBLY__
-#include <linux/platform_device.h>
-
-extern int davinci_serial_init(struct platform_device *);
-#endif
-
-#endif /* __ASM_ARCH_SERIAL_H */
diff --git a/arch/arm/mach-davinci/usb-da8xx.c b/arch/arm/mach-davinci/usb-da8xx.c
deleted file mode 100644
index 9c8fc5031907..000000000000
--- a/arch/arm/mach-davinci/usb-da8xx.c
+++ /dev/null
@@ -1,146 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * DA8xx USB
- */
-#include <linux/clk-provider.h>
-#include <linux/delay.h>
-#include <linux/dma-mapping.h>
-#include <linux/init.h>
-#include <linux/mfd/da8xx-cfgchip.h>
-#include <linux/mfd/syscon.h>
-#include <linux/phy/phy.h>
-#include <linux/platform_data/clk-da8xx-cfgchip.h>
-#include <linux/platform_data/phy-da8xx-usb.h>
-#include <linux/platform_data/usb-davinci.h>
-#include <linux/platform_device.h>
-#include <linux/usb/musb.h>
-
-#include "common.h"
-#include "cputype.h"
-#include "da8xx.h"
-#include "irqs.h"
-
-#define DA8XX_USB0_BASE 0x01e00000
-#define DA8XX_USB1_BASE 0x01e25000
-
-#ifndef CONFIG_COMMON_CLK
-static struct clk *usb20_clk;
-#endif
-
-static struct da8xx_usb_phy_platform_data da8xx_usb_phy_pdata;
-
-static struct platform_device da8xx_usb_phy = {
- .name = "da8xx-usb-phy",
- .id = -1,
- .dev = {
- /*
- * Setting init_name so that clock lookup will work in
- * da8xx_register_usb11_phy_clk() even if this device is not
- * registered yet.
- */
- .init_name = "da8xx-usb-phy",
- .platform_data = &da8xx_usb_phy_pdata,
- },
-};
-
-int __init da8xx_register_usb_phy(void)
-{
- da8xx_usb_phy_pdata.cfgchip = da8xx_get_cfgchip();
-
- return platform_device_register(&da8xx_usb_phy);
-}
-
-static struct musb_hdrc_config musb_config = {
- .multipoint = true,
- .num_eps = 5,
- .ram_bits = 10,
-};
-
-static struct musb_hdrc_platform_data usb_data = {
- /* OTG requires a Mini-AB connector */
- .mode = MUSB_OTG,
- .clock = "usb20",
- .config = &musb_config,
-};
-
-static struct resource da8xx_usb20_resources[] = {
- {
- .start = DA8XX_USB0_BASE,
- .end = DA8XX_USB0_BASE + SZ_64K - 1,
- .flags = IORESOURCE_MEM,
- },
- {
- .start = DAVINCI_INTC_IRQ(IRQ_DA8XX_USB_INT),
- .flags = IORESOURCE_IRQ,
- .name = "mc",
- },
-};
-
-static u64 usb_dmamask = DMA_BIT_MASK(32);
-
-static struct platform_device da8xx_usb20_dev = {
- .name = "musb-da8xx",
- .id = -1,
- .dev = {
- .platform_data = &usb_data,
- .dma_mask = &usb_dmamask,
- .coherent_dma_mask = DMA_BIT_MASK(32),
- },
- .resource = da8xx_usb20_resources,
- .num_resources = ARRAY_SIZE(da8xx_usb20_resources),
-};
-
-int __init da8xx_register_usb20(unsigned int mA, unsigned int potpgt)
-{
- usb_data.power = mA > 510 ? 255 : mA / 2;
- usb_data.potpgt = (potpgt + 1) / 2;
-
- return platform_device_register(&da8xx_usb20_dev);
-}
-
-static struct resource da8xx_usb11_resources[] = {
- [0] = {
- .start = DA8XX_USB1_BASE,
- .end = DA8XX_USB1_BASE + SZ_4K - 1,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- .start = DAVINCI_INTC_IRQ(IRQ_DA8XX_IRQN),
- .end = DAVINCI_INTC_IRQ(IRQ_DA8XX_IRQN),
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static u64 da8xx_usb11_dma_mask = DMA_BIT_MASK(32);
-
-static struct platform_device da8xx_usb11_device = {
- .name = "ohci-da8xx",
- .id = -1,
- .dev = {
- .dma_mask = &da8xx_usb11_dma_mask,
- .coherent_dma_mask = DMA_BIT_MASK(32),
- },
- .num_resources = ARRAY_SIZE(da8xx_usb11_resources),
- .resource = da8xx_usb11_resources,
-};
-
-int __init da8xx_register_usb11(struct da8xx_ohci_root_hub *pdata)
-{
- da8xx_usb11_device.dev.platform_data = pdata;
- return platform_device_register(&da8xx_usb11_device);
-}
-
-static struct platform_device da8xx_usb_phy_clks_device = {
- .name = "da830-usb-phy-clks",
- .id = -1,
-};
-
-int __init da8xx_register_usb_phy_clocks(void)
-{
- struct da8xx_cfgchip_clk_platform_data pdata;
-
- pdata.cfgchip = da8xx_get_cfgchip();
- da8xx_usb_phy_clks_device.dev.platform_data = &pdata;
-
- return platform_device_register(&da8xx_usb_phy_clks_device);
-}
diff --git a/arch/arm/mach-davinci/usb.c b/arch/arm/mach-davinci/usb.c
deleted file mode 100644
index 9dc14c7977b3..000000000000
--- a/arch/arm/mach-davinci/usb.c
+++ /dev/null
@@ -1,74 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * USB
- */
-#include <linux/dma-mapping.h>
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <linux/platform_data/usb-davinci.h>
-#include <linux/usb/musb.h>
-
-#include "common.h"
-#include "cputype.h"
-#include "irqs.h"
-
-#define DAVINCI_USB_OTG_BASE 0x01c64000
-
-#if IS_ENABLED(CONFIG_USB_MUSB_HDRC)
-static struct musb_hdrc_config musb_config = {
- .multipoint = true,
-
- .num_eps = 5,
- .ram_bits = 10,
-};
-
-static struct musb_hdrc_platform_data usb_data = {
- /* OTG requires a Mini-AB connector */
- .mode = MUSB_OTG,
- .clock = "usb",
- .config = &musb_config,
-};
-
-static struct resource usb_resources[] = {
- {
- /* physical address */
- .start = DAVINCI_USB_OTG_BASE,
- .end = DAVINCI_USB_OTG_BASE + 0x5ff,
- .flags = IORESOURCE_MEM,
- },
- {
- .start = DAVINCI_INTC_IRQ(IRQ_USBINT),
- .flags = IORESOURCE_IRQ,
- .name = "mc"
- },
-};
-
-static u64 usb_dmamask = DMA_BIT_MASK(32);
-
-static struct platform_device usb_dev = {
- .name = "musb-davinci",
- .id = -1,
- .dev = {
- .platform_data = &usb_data,
- .dma_mask = &usb_dmamask,
- .coherent_dma_mask = DMA_BIT_MASK(32),
- },
- .resource = usb_resources,
- .num_resources = ARRAY_SIZE(usb_resources),
-};
-
-void __init davinci_setup_usb(unsigned mA, unsigned potpgt_ms)
-{
- usb_data.power = mA > 510 ? 255 : mA / 2;
- usb_data.potpgt = (potpgt_ms + 1) / 2;
-
- platform_device_register(&usb_dev);
-}
-
-#else
-
-void __init davinci_setup_usb(unsigned mA, unsigned potpgt_ms)
-{
-}
-
-#endif /* CONFIG_USB_MUSB_HDRC */
--
2.29.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [PATCH 04/14] clk: remove davinci dm3xx drivers
2022-10-19 15:29 [PATCH 00/14] ARM: remove unused davinci board & drivers Arnd Bergmann
2022-10-19 15:29 ` [PATCH 02/14] ARM: davinci: drop DAVINCI_DMxxx references Arnd Bergmann
2022-10-19 15:29 ` [PATCH 03/14] ARM: davinci: clean up platform support Arnd Bergmann
@ 2022-10-19 15:29 ` Arnd Bergmann
2022-10-19 16:39 ` David Lechner
` (3 more replies)
2022-10-19 15:29 ` [PATCH 05/14] usb: musb: remove unused davinci support Arnd Bergmann
` (13 subsequent siblings)
16 siblings, 4 replies; 44+ messages in thread
From: Arnd Bergmann @ 2022-10-19 15:29 UTC (permalink / raw)
To: Sekhar Nori, Bartosz Golaszewski, linux-arm-kernel, David Lechner,
Michael Turquette, Stephen Boyd
Cc: linux-kernel, Kevin Hilman, Arnd Bergmann, Lukas Bulwahn,
Linus Walleij, linux-clk
From: Arnd Bergmann <arnd@arndb.de>
The davinci dm3xx machines are all removed, so the clk driver
is no longer needed. The da8xx platforms are now using DT
exclusively, so those drivers remain untouched.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/clk/davinci/Makefile | 4 -
drivers/clk/davinci/pll-dm355.c | 77 -----------------
drivers/clk/davinci/pll-dm365.c | 146 --------------------------------
drivers/clk/davinci/psc-dm355.c | 89 -------------------
drivers/clk/davinci/psc-dm365.c | 111 ------------------------
5 files changed, 427 deletions(-)
delete mode 100644 drivers/clk/davinci/pll-dm355.c
delete mode 100644 drivers/clk/davinci/pll-dm365.c
delete mode 100644 drivers/clk/davinci/psc-dm355.c
delete mode 100644 drivers/clk/davinci/psc-dm365.c
diff --git a/drivers/clk/davinci/Makefile b/drivers/clk/davinci/Makefile
index be6f55d37b49..5d0ae1ee72ec 100644
--- a/drivers/clk/davinci/Makefile
+++ b/drivers/clk/davinci/Makefile
@@ -6,12 +6,8 @@ obj-$(CONFIG_ARCH_DAVINCI_DA8XX) += da8xx-cfgchip.o
obj-y += pll.o
obj-$(CONFIG_ARCH_DAVINCI_DA830) += pll-da830.o
obj-$(CONFIG_ARCH_DAVINCI_DA850) += pll-da850.o
-obj-$(CONFIG_ARCH_DAVINCI_DM355) += pll-dm355.o
-obj-$(CONFIG_ARCH_DAVINCI_DM365) += pll-dm365.o
obj-y += psc.o
obj-$(CONFIG_ARCH_DAVINCI_DA830) += psc-da830.o
obj-$(CONFIG_ARCH_DAVINCI_DA850) += psc-da850.o
-obj-$(CONFIG_ARCH_DAVINCI_DM355) += psc-dm355.o
-obj-$(CONFIG_ARCH_DAVINCI_DM365) += psc-dm365.o
endif
diff --git a/drivers/clk/davinci/pll-dm355.c b/drivers/clk/davinci/pll-dm355.c
deleted file mode 100644
index 505aed80be9a..000000000000
--- a/drivers/clk/davinci/pll-dm355.c
+++ /dev/null
@@ -1,77 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * PLL clock descriptions for TI DM355
- *
- * Copyright (C) 2018 David Lechner <david@lechnology.com>
- */
-
-#include <linux/bitops.h>
-#include <linux/clk/davinci.h>
-#include <linux/clkdev.h>
-#include <linux/init.h>
-#include <linux/types.h>
-
-#include "pll.h"
-
-static const struct davinci_pll_clk_info dm355_pll1_info = {
- .name = "pll1",
- .pllm_mask = GENMASK(7, 0),
- .pllm_min = 92,
- .pllm_max = 184,
- .flags = PLL_HAS_CLKMODE | PLL_HAS_PREDIV | PLL_PREDIV_ALWAYS_ENABLED |
- PLL_PREDIV_FIXED8 | PLL_HAS_POSTDIV |
- PLL_POSTDIV_ALWAYS_ENABLED | PLL_POSTDIV_FIXED_DIV,
-};
-
-SYSCLK(1, pll1_sysclk1, pll1_pllen, 5, SYSCLK_FIXED_DIV | SYSCLK_ALWAYS_ENABLED);
-SYSCLK(2, pll1_sysclk2, pll1_pllen, 5, SYSCLK_FIXED_DIV | SYSCLK_ALWAYS_ENABLED);
-SYSCLK(3, pll1_sysclk3, pll1_pllen, 5, SYSCLK_ALWAYS_ENABLED);
-SYSCLK(4, pll1_sysclk4, pll1_pllen, 5, SYSCLK_ALWAYS_ENABLED);
-
-int dm355_pll1_init(struct device *dev, void __iomem *base, struct regmap *cfgchip)
-{
- struct clk *clk;
-
- davinci_pll_clk_register(dev, &dm355_pll1_info, "ref_clk", base, cfgchip);
-
- clk = davinci_pll_sysclk_register(dev, &pll1_sysclk1, base);
- clk_register_clkdev(clk, "pll1_sysclk1", "dm355-psc");
-
- clk = davinci_pll_sysclk_register(dev, &pll1_sysclk2, base);
- clk_register_clkdev(clk, "pll1_sysclk2", "dm355-psc");
-
- clk = davinci_pll_sysclk_register(dev, &pll1_sysclk3, base);
- clk_register_clkdev(clk, "pll1_sysclk3", "dm355-psc");
-
- clk = davinci_pll_sysclk_register(dev, &pll1_sysclk4, base);
- clk_register_clkdev(clk, "pll1_sysclk4", "dm355-psc");
-
- clk = davinci_pll_auxclk_register(dev, "pll1_auxclk", base);
- clk_register_clkdev(clk, "pll1_auxclk", "dm355-psc");
-
- davinci_pll_sysclkbp_clk_register(dev, "pll1_sysclkbp", base);
-
- return 0;
-}
-
-static const struct davinci_pll_clk_info dm355_pll2_info = {
- .name = "pll2",
- .pllm_mask = GENMASK(7, 0),
- .pllm_min = 92,
- .pllm_max = 184,
- .flags = PLL_HAS_PREDIV | PLL_PREDIV_ALWAYS_ENABLED | PLL_HAS_POSTDIV |
- PLL_POSTDIV_ALWAYS_ENABLED | PLL_POSTDIV_FIXED_DIV,
-};
-
-SYSCLK(1, pll2_sysclk1, pll2_pllen, 5, SYSCLK_FIXED_DIV | SYSCLK_ALWAYS_ENABLED);
-
-int dm355_pll2_init(struct device *dev, void __iomem *base, struct regmap *cfgchip)
-{
- davinci_pll_clk_register(dev, &dm355_pll2_info, "oscin", base, cfgchip);
-
- davinci_pll_sysclk_register(dev, &pll2_sysclk1, base);
-
- davinci_pll_sysclkbp_clk_register(dev, "pll2_sysclkbp", base);
-
- return 0;
-}
diff --git a/drivers/clk/davinci/pll-dm365.c b/drivers/clk/davinci/pll-dm365.c
deleted file mode 100644
index 2d29712753a3..000000000000
--- a/drivers/clk/davinci/pll-dm365.c
+++ /dev/null
@@ -1,146 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * PLL clock descriptions for TI DM365
- *
- * Copyright (C) 2018 David Lechner <david@lechnology.com>
- */
-
-#include <linux/bitops.h>
-#include <linux/clkdev.h>
-#include <linux/clk/davinci.h>
-#include <linux/init.h>
-#include <linux/kernel.h>
-#include <linux/types.h>
-
-#include "pll.h"
-
-#define OCSEL_OCSRC_ENABLE 0
-
-static const struct davinci_pll_clk_info dm365_pll1_info = {
- .name = "pll1",
- .pllm_mask = GENMASK(9, 0),
- .pllm_min = 1,
- .pllm_max = 1023,
- .flags = PLL_HAS_CLKMODE | PLL_HAS_PREDIV | PLL_HAS_POSTDIV |
- PLL_POSTDIV_ALWAYS_ENABLED | PLL_PLLM_2X,
-};
-
-SYSCLK(1, pll1_sysclk1, pll1_pllen, 5, SYSCLK_ALWAYS_ENABLED);
-SYSCLK(2, pll1_sysclk2, pll1_pllen, 5, SYSCLK_ALWAYS_ENABLED);
-SYSCLK(3, pll1_sysclk3, pll1_pllen, 5, SYSCLK_ALWAYS_ENABLED);
-SYSCLK(4, pll1_sysclk4, pll1_pllen, 5, SYSCLK_ALWAYS_ENABLED);
-SYSCLK(5, pll1_sysclk5, pll1_pllen, 5, SYSCLK_ALWAYS_ENABLED);
-SYSCLK(6, pll1_sysclk6, pll1_pllen, 5, SYSCLK_ALWAYS_ENABLED);
-SYSCLK(7, pll1_sysclk7, pll1_pllen, 5, SYSCLK_ALWAYS_ENABLED);
-SYSCLK(8, pll1_sysclk8, pll1_pllen, 5, SYSCLK_ALWAYS_ENABLED);
-SYSCLK(9, pll1_sysclk9, pll1_pllen, 5, SYSCLK_ALWAYS_ENABLED);
-
-/*
- * This is a bit of a hack to make OCSEL[OCSRC] on DM365 look like OCSEL[OCSRC]
- * on DA850. On DM365, OCSEL[OCSRC] is just an enable/disable bit instead of a
- * multiplexer. By modeling it as a single parent mux clock, the clock code will
- * still do the right thing in this case.
- */
-static const char * const dm365_pll_obsclk_parent_names[] = {
- "oscin",
-};
-
-static u32 dm365_pll_obsclk_table[] = {
- OCSEL_OCSRC_ENABLE,
-};
-
-static const struct davinci_pll_obsclk_info dm365_pll1_obsclk_info = {
- .name = "pll1_obsclk",
- .parent_names = dm365_pll_obsclk_parent_names,
- .num_parents = ARRAY_SIZE(dm365_pll_obsclk_parent_names),
- .table = dm365_pll_obsclk_table,
- .ocsrc_mask = BIT(4),
-};
-
-int dm365_pll1_init(struct device *dev, void __iomem *base, struct regmap *cfgchip)
-{
- struct clk *clk;
-
- davinci_pll_clk_register(dev, &dm365_pll1_info, "ref_clk", base, cfgchip);
-
- clk = davinci_pll_sysclk_register(dev, &pll1_sysclk1, base);
- clk_register_clkdev(clk, "pll1_sysclk1", "dm365-psc");
-
- clk = davinci_pll_sysclk_register(dev, &pll1_sysclk2, base);
- clk_register_clkdev(clk, "pll1_sysclk2", "dm365-psc");
-
- clk = davinci_pll_sysclk_register(dev, &pll1_sysclk3, base);
- clk_register_clkdev(clk, "pll1_sysclk3", "dm365-psc");
-
- clk = davinci_pll_sysclk_register(dev, &pll1_sysclk4, base);
- clk_register_clkdev(clk, "pll1_sysclk4", "dm365-psc");
-
- clk = davinci_pll_sysclk_register(dev, &pll1_sysclk5, base);
- clk_register_clkdev(clk, "pll1_sysclk5", "dm365-psc");
-
- davinci_pll_sysclk_register(dev, &pll1_sysclk6, base);
-
- davinci_pll_sysclk_register(dev, &pll1_sysclk7, base);
-
- clk = davinci_pll_sysclk_register(dev, &pll1_sysclk8, base);
- clk_register_clkdev(clk, "pll1_sysclk8", "dm365-psc");
-
- davinci_pll_sysclk_register(dev, &pll1_sysclk9, base);
-
- clk = davinci_pll_auxclk_register(dev, "pll1_auxclk", base);
- clk_register_clkdev(clk, "pll1_auxclk", "dm355-psc");
-
- davinci_pll_sysclkbp_clk_register(dev, "pll1_sysclkbp", base);
-
- davinci_pll_obsclk_register(dev, &dm365_pll1_obsclk_info, base);
-
- return 0;
-}
-
-static const struct davinci_pll_clk_info dm365_pll2_info = {
- .name = "pll2",
- .pllm_mask = GENMASK(9, 0),
- .pllm_min = 1,
- .pllm_max = 1023,
- .flags = PLL_HAS_PREDIV | PLL_HAS_POSTDIV | PLL_POSTDIV_ALWAYS_ENABLED |
- PLL_PLLM_2X,
-};
-
-SYSCLK(1, pll2_sysclk1, pll2_pllen, 5, SYSCLK_ALWAYS_ENABLED);
-SYSCLK(2, pll2_sysclk2, pll2_pllen, 5, SYSCLK_ALWAYS_ENABLED);
-SYSCLK(3, pll2_sysclk3, pll2_pllen, 5, SYSCLK_ALWAYS_ENABLED);
-SYSCLK(4, pll2_sysclk4, pll2_pllen, 5, SYSCLK_ALWAYS_ENABLED);
-SYSCLK(5, pll2_sysclk5, pll2_pllen, 5, SYSCLK_ALWAYS_ENABLED);
-
-static const struct davinci_pll_obsclk_info dm365_pll2_obsclk_info = {
- .name = "pll2_obsclk",
- .parent_names = dm365_pll_obsclk_parent_names,
- .num_parents = ARRAY_SIZE(dm365_pll_obsclk_parent_names),
- .table = dm365_pll_obsclk_table,
- .ocsrc_mask = BIT(4),
-};
-
-int dm365_pll2_init(struct device *dev, void __iomem *base, struct regmap *cfgchip)
-{
- struct clk *clk;
-
- davinci_pll_clk_register(dev, &dm365_pll2_info, "oscin", base, cfgchip);
-
- davinci_pll_sysclk_register(dev, &pll2_sysclk1, base);
-
- clk = davinci_pll_sysclk_register(dev, &pll2_sysclk2, base);
- clk_register_clkdev(clk, "pll1_sysclk2", "dm365-psc");
-
- davinci_pll_sysclk_register(dev, &pll2_sysclk3, base);
-
- clk = davinci_pll_sysclk_register(dev, &pll2_sysclk4, base);
- clk_register_clkdev(clk, "pll1_sysclk4", "dm365-psc");
-
- davinci_pll_sysclk_register(dev, &pll2_sysclk5, base);
-
- davinci_pll_auxclk_register(dev, "pll2_auxclk", base);
-
- davinci_pll_obsclk_register(dev, &dm365_pll2_obsclk_info, base);
-
- return 0;
-}
diff --git a/drivers/clk/davinci/psc-dm355.c b/drivers/clk/davinci/psc-dm355.c
deleted file mode 100644
index ddd250107c4e..000000000000
--- a/drivers/clk/davinci/psc-dm355.c
+++ /dev/null
@@ -1,89 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * PSC clock descriptions for TI DaVinci DM355
- *
- * Copyright (C) 2018 David Lechner <david@lechnology.com>
- */
-
-#include <linux/clk-provider.h>
-#include <linux/clk/davinci.h>
-#include <linux/clk.h>
-#include <linux/clkdev.h>
-#include <linux/init.h>
-#include <linux/kernel.h>
-#include <linux/types.h>
-
-#include "psc.h"
-
-LPSC_CLKDEV1(vpss_master_clkdev, "master", "vpss");
-LPSC_CLKDEV1(vpss_slave_clkdev, "slave", "vpss");
-LPSC_CLKDEV1(spi1_clkdev, NULL, "spi_davinci.1");
-LPSC_CLKDEV1(mmcsd1_clkdev, NULL, "dm6441-mmc.1");
-LPSC_CLKDEV1(mcbsp1_clkdev, NULL, "davinci-mcbsp.1");
-LPSC_CLKDEV1(usb_clkdev, "usb", NULL);
-LPSC_CLKDEV1(spi2_clkdev, NULL, "spi_davinci.2");
-LPSC_CLKDEV1(aemif_clkdev, "aemif", NULL);
-LPSC_CLKDEV1(mmcsd0_clkdev, NULL, "dm6441-mmc.0");
-LPSC_CLKDEV1(mcbsp0_clkdev, NULL, "davinci-mcbsp.0");
-LPSC_CLKDEV1(i2c_clkdev, NULL, "i2c_davinci.1");
-LPSC_CLKDEV1(uart0_clkdev, NULL, "serial8250.0");
-LPSC_CLKDEV1(uart1_clkdev, NULL, "serial8250.1");
-LPSC_CLKDEV1(uart2_clkdev, NULL, "serial8250.2");
-LPSC_CLKDEV1(spi0_clkdev, NULL, "spi_davinci.0");
-/* REVISIT: gpio-davinci.c should be modified to drop con_id */
-LPSC_CLKDEV1(gpio_clkdev, "gpio", NULL);
-LPSC_CLKDEV1(timer0_clkdev, "timer0", NULL);
-LPSC_CLKDEV1(timer2_clkdev, NULL, "davinci-wdt");
-LPSC_CLKDEV1(vpss_dac_clkdev, "vpss_dac", NULL);
-
-static const struct davinci_lpsc_clk_info dm355_psc_info[] = {
- LPSC(0, 0, vpss_master, pll1_sysclk4, vpss_master_clkdev, 0),
- LPSC(1, 0, vpss_slave, pll1_sysclk4, vpss_slave_clkdev, 0),
- LPSC(5, 0, timer3, pll1_auxclk, NULL, 0),
- LPSC(6, 0, spi1, pll1_sysclk2, spi1_clkdev, 0),
- LPSC(7, 0, mmcsd1, pll1_sysclk2, mmcsd1_clkdev, 0),
- LPSC(8, 0, asp1, pll1_sysclk2, mcbsp1_clkdev, 0),
- LPSC(9, 0, usb, pll1_sysclk2, usb_clkdev, 0),
- LPSC(10, 0, pwm3, pll1_auxclk, NULL, 0),
- LPSC(11, 0, spi2, pll1_sysclk2, spi2_clkdev, 0),
- LPSC(12, 0, rto, pll1_auxclk, NULL, 0),
- LPSC(14, 0, aemif, pll1_sysclk2, aemif_clkdev, 0),
- LPSC(15, 0, mmcsd0, pll1_sysclk2, mmcsd0_clkdev, 0),
- LPSC(17, 0, asp0, pll1_sysclk2, mcbsp0_clkdev, 0),
- LPSC(18, 0, i2c, pll1_auxclk, i2c_clkdev, 0),
- LPSC(19, 0, uart0, pll1_auxclk, uart0_clkdev, 0),
- LPSC(20, 0, uart1, pll1_auxclk, uart1_clkdev, 0),
- LPSC(21, 0, uart2, pll1_sysclk2, uart2_clkdev, 0),
- LPSC(22, 0, spi0, pll1_sysclk2, spi0_clkdev, 0),
- LPSC(23, 0, pwm0, pll1_auxclk, NULL, 0),
- LPSC(24, 0, pwm1, pll1_auxclk, NULL, 0),
- LPSC(25, 0, pwm2, pll1_auxclk, NULL, 0),
- LPSC(26, 0, gpio, pll1_sysclk2, gpio_clkdev, 0),
- LPSC(27, 0, timer0, pll1_auxclk, timer0_clkdev, LPSC_ALWAYS_ENABLED),
- LPSC(28, 0, timer1, pll1_auxclk, NULL, 0),
- /* REVISIT: why can't this be disabled? */
- LPSC(29, 0, timer2, pll1_auxclk, timer2_clkdev, LPSC_ALWAYS_ENABLED),
- LPSC(31, 0, arm, pll1_sysclk1, NULL, LPSC_ALWAYS_ENABLED),
- LPSC(40, 0, mjcp, pll1_sysclk1, NULL, 0),
- LPSC(41, 0, vpss_dac, pll1_sysclk3, vpss_dac_clkdev, 0),
- { }
-};
-
-int dm355_psc_init(struct device *dev, void __iomem *base)
-{
- return davinci_psc_register_clocks(dev, dm355_psc_info, 42, base);
-}
-
-static struct clk_bulk_data dm355_psc_parent_clks[] = {
- { .id = "pll1_sysclk1" },
- { .id = "pll1_sysclk2" },
- { .id = "pll1_sysclk3" },
- { .id = "pll1_sysclk4" },
- { .id = "pll1_auxclk" },
-};
-
-const struct davinci_psc_init_data dm355_psc_init_data = {
- .parent_clks = dm355_psc_parent_clks,
- .num_parent_clks = ARRAY_SIZE(dm355_psc_parent_clks),
- .psc_init = &dm355_psc_init,
-};
diff --git a/drivers/clk/davinci/psc-dm365.c b/drivers/clk/davinci/psc-dm365.c
deleted file mode 100644
index c75424f4ea3b..000000000000
--- a/drivers/clk/davinci/psc-dm365.c
+++ /dev/null
@@ -1,111 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * PSC clock descriptions for TI DaVinci DM365
- *
- * Copyright (C) 2018 David Lechner <david@lechnology.com>
- */
-
-#include <linux/clk-provider.h>
-#include <linux/clk/davinci.h>
-#include <linux/clk.h>
-#include <linux/clkdev.h>
-#include <linux/init.h>
-#include <linux/kernel.h>
-#include <linux/types.h>
-
-#include "psc.h"
-
-LPSC_CLKDEV1(vpss_slave_clkdev, "slave", "vpss");
-LPSC_CLKDEV1(spi1_clkdev, NULL, "spi_davinci.1");
-LPSC_CLKDEV1(mmcsd1_clkdev, NULL, "da830-mmc.1");
-LPSC_CLKDEV1(asp0_clkdev, NULL, "davinci-mcbsp");
-LPSC_CLKDEV1(usb_clkdev, "usb", NULL);
-LPSC_CLKDEV1(spi2_clkdev, NULL, "spi_davinci.2");
-LPSC_CLKDEV2(aemif_clkdev, "aemif", NULL,
- NULL, "ti-aemif");
-LPSC_CLKDEV1(mmcsd0_clkdev, NULL, "da830-mmc.0");
-LPSC_CLKDEV1(i2c_clkdev, NULL, "i2c_davinci.1");
-LPSC_CLKDEV1(uart0_clkdev, NULL, "serial8250.0");
-LPSC_CLKDEV1(uart1_clkdev, NULL, "serial8250.1");
-LPSC_CLKDEV1(spi0_clkdev, NULL, "spi_davinci.0");
-/* REVISIT: gpio-davinci.c should be modified to drop con_id */
-LPSC_CLKDEV1(gpio_clkdev, "gpio", NULL);
-LPSC_CLKDEV1(timer0_clkdev, "timer0", NULL);
-LPSC_CLKDEV1(timer2_clkdev, NULL, "davinci-wdt");
-LPSC_CLKDEV1(spi3_clkdev, NULL, "spi_davinci.3");
-LPSC_CLKDEV1(spi4_clkdev, NULL, "spi_davinci.4");
-LPSC_CLKDEV2(emac_clkdev, NULL, "davinci_emac.1",
- "fck", "davinci_mdio.0");
-LPSC_CLKDEV1(voice_codec_clkdev, NULL, "davinci_voicecodec");
-LPSC_CLKDEV1(vpss_dac_clkdev, "vpss_dac", NULL);
-LPSC_CLKDEV1(vpss_master_clkdev, "master", "vpss");
-
-static const struct davinci_lpsc_clk_info dm365_psc_info[] = {
- LPSC(1, 0, vpss_slave, pll1_sysclk5, vpss_slave_clkdev, 0),
- LPSC(5, 0, timer3, pll1_auxclk, NULL, 0),
- LPSC(6, 0, spi1, pll1_sysclk4, spi1_clkdev, 0),
- LPSC(7, 0, mmcsd1, pll1_sysclk4, mmcsd1_clkdev, 0),
- LPSC(8, 0, asp0, pll1_sysclk4, asp0_clkdev, 0),
- LPSC(9, 0, usb, pll1_auxclk, usb_clkdev, 0),
- LPSC(10, 0, pwm3, pll1_auxclk, NULL, 0),
- LPSC(11, 0, spi2, pll1_sysclk4, spi2_clkdev, 0),
- LPSC(12, 0, rto, pll1_sysclk4, NULL, 0),
- LPSC(14, 0, aemif, pll1_sysclk4, aemif_clkdev, 0),
- LPSC(15, 0, mmcsd0, pll1_sysclk8, mmcsd0_clkdev, 0),
- LPSC(18, 0, i2c, pll1_auxclk, i2c_clkdev, 0),
- LPSC(19, 0, uart0, pll1_auxclk, uart0_clkdev, 0),
- LPSC(20, 0, uart1, pll1_sysclk4, uart1_clkdev, 0),
- LPSC(22, 0, spi0, pll1_sysclk4, spi0_clkdev, 0),
- LPSC(23, 0, pwm0, pll1_auxclk, NULL, 0),
- LPSC(24, 0, pwm1, pll1_auxclk, NULL, 0),
- LPSC(25, 0, pwm2, pll1_auxclk, NULL, 0),
- LPSC(26, 0, gpio, pll1_sysclk4, gpio_clkdev, 0),
- LPSC(27, 0, timer0, pll1_auxclk, timer0_clkdev, LPSC_ALWAYS_ENABLED),
- LPSC(28, 0, timer1, pll1_auxclk, NULL, 0),
- /* REVISIT: why can't this be disabled? */
- LPSC(29, 0, timer2, pll1_auxclk, timer2_clkdev, LPSC_ALWAYS_ENABLED),
- LPSC(31, 0, arm, pll2_sysclk2, NULL, LPSC_ALWAYS_ENABLED),
- LPSC(38, 0, spi3, pll1_sysclk4, spi3_clkdev, 0),
- LPSC(39, 0, spi4, pll1_auxclk, spi4_clkdev, 0),
- LPSC(40, 0, emac, pll1_sysclk4, emac_clkdev, 0),
- /*
- * The TRM (ARM Subsystem User's Guide) shows two clocks input into
- * voice codec module (PLL2 SYSCLK4 with a DIV2 and PLL1 SYSCLK4). Its
- * not fully clear from documentation which clock should be considered
- * as parent for PSC. The clock chosen here is to maintain
- * compatibility with existing code in arch/arm/mach-davinci/dm365.c
- */
- LPSC(44, 0, voice_codec, pll2_sysclk4, voice_codec_clkdev, 0),
- /*
- * Its not fully clear from TRM (ARM Subsystem User's Guide) as to what
- * the parent of VPSS DAC LPSC should actually be. PLL1 SYSCLK3 feeds
- * into HDVICP and MJCP. The clock chosen here is to remain compatible
- * with code existing in arch/arm/mach-davinci/dm365.c
- */
- LPSC(46, 0, vpss_dac, pll1_sysclk3, vpss_dac_clkdev, 0),
- LPSC(47, 0, vpss_master, pll1_sysclk5, vpss_master_clkdev, 0),
- LPSC(50, 0, mjcp, pll1_sysclk3, NULL, 0),
- { }
-};
-
-int dm365_psc_init(struct device *dev, void __iomem *base)
-{
- return davinci_psc_register_clocks(dev, dm365_psc_info, 52, base);
-}
-
-static struct clk_bulk_data dm365_psc_parent_clks[] = {
- { .id = "pll1_sysclk1" },
- { .id = "pll1_sysclk3" },
- { .id = "pll1_sysclk4" },
- { .id = "pll1_sysclk5" },
- { .id = "pll1_sysclk8" },
- { .id = "pll2_sysclk2" },
- { .id = "pll2_sysclk4" },
- { .id = "pll1_auxclk" },
-};
-
-const struct davinci_psc_init_data dm365_psc_init_data = {
- .parent_clks = dm365_psc_parent_clks,
- .num_parent_clks = ARRAY_SIZE(dm365_psc_parent_clks),
- .psc_init = &dm365_psc_init,
-};
--
2.29.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [PATCH 05/14] usb: musb: remove unused davinci support
2022-10-19 15:29 [PATCH 00/14] ARM: remove unused davinci board & drivers Arnd Bergmann
` (2 preceding siblings ...)
2022-10-19 15:29 ` [PATCH 04/14] clk: remove davinci dm3xx drivers Arnd Bergmann
@ 2022-10-19 15:29 ` Arnd Bergmann
2022-10-20 11:34 ` Bartosz Golaszewski
2022-10-19 15:29 ` [PATCH 06/14] mfd: remove dm355evm_msp driver Arnd Bergmann
` (12 subsequent siblings)
16 siblings, 1 reply; 44+ messages in thread
From: Arnd Bergmann @ 2022-10-19 15:29 UTC (permalink / raw)
To: Sekhar Nori, Bartosz Golaszewski, linux-arm-kernel, Bin Liu,
Greg Kroah-Hartman
Cc: linux-kernel, Kevin Hilman, Arnd Bergmann, linux-usb
From: Arnd Bergmann <arnd@arndb.de>
The musb-davinci driver was only used on dm644x, which got removed
in linux-6.0. The only remaining davinci machines are da8xx
devicetree based and do not use this hardware.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/usb/musb/Kconfig | 12 -
drivers/usb/musb/Makefile | 2 -
drivers/usb/musb/cppi_dma.c | 1547 -----------------------------------
drivers/usb/musb/davinci.c | 606 --------------
drivers/usb/musb/davinci.h | 103 ---
5 files changed, 2270 deletions(-)
delete mode 100644 drivers/usb/musb/cppi_dma.c
delete mode 100644 drivers/usb/musb/davinci.c
delete mode 100644 drivers/usb/musb/davinci.h
diff --git a/drivers/usb/musb/Kconfig b/drivers/usb/musb/Kconfig
index 6c8f7763e75e..f9eec666103c 100644
--- a/drivers/usb/musb/Kconfig
+++ b/drivers/usb/musb/Kconfig
@@ -70,12 +70,6 @@ config USB_MUSB_SUNXI
select GENERIC_PHY
select SUNXI_SRAM
-config USB_MUSB_DAVINCI
- tristate "DaVinci"
- depends on ARCH_DAVINCI_DMx
- depends on NOP_USB_XCEIV
- depends on BROKEN
-
config USB_MUSB_DA8XX
tristate "DA8xx/OMAP-L1x"
depends on ARCH_DAVINCI_DA8XX
@@ -161,12 +155,6 @@ config USB_INVENTRA_DMA
help
Enable DMA transfers using Mentor's engine.
-config USB_TI_CPPI_DMA
- bool 'TI CPPI (Davinci)'
- depends on USB_MUSB_DAVINCI
- help
- Enable DMA transfers when TI CPPI DMA is available.
-
config USB_TI_CPPI41_DMA
bool 'TI CPPI 4.1'
depends on (ARCH_OMAP || ARCH_DAVINCI_DA8XX) && DMADEVICES
diff --git a/drivers/usb/musb/Makefile b/drivers/usb/musb/Makefile
index 51dd54a8de49..44a9e27b2157 100644
--- a/drivers/usb/musb/Makefile
+++ b/drivers/usb/musb/Makefile
@@ -19,7 +19,6 @@ obj-$(CONFIG_USB_MUSB_OMAP2PLUS) += omap2430.o
obj-$(CONFIG_USB_MUSB_AM35X) += am35x.o
obj-$(CONFIG_USB_MUSB_DSPS) += musb_dsps.o
obj-$(CONFIG_USB_MUSB_TUSB6010) += tusb6010.o
-obj-$(CONFIG_USB_MUSB_DAVINCI) += davinci.o
obj-$(CONFIG_USB_MUSB_DA8XX) += da8xx.o
obj-$(CONFIG_USB_MUSB_UX500) += ux500.o
obj-$(CONFIG_USB_MUSB_JZ4740) += jz4740.o
@@ -33,7 +32,6 @@ obj-$(CONFIG_USB_MUSB_POLARFIRE_SOC) += mpfs.o
# though PIO is always there to back up DMA, and for ep0
musb_hdrc-$(CONFIG_USB_INVENTRA_DMA) += musbhsdma.o
-musb_hdrc-$(CONFIG_USB_TI_CPPI_DMA) += cppi_dma.o
musb_hdrc-$(CONFIG_USB_TUSB_OMAP_DMA) += tusb6010_omap.o
musb_hdrc-$(CONFIG_USB_UX500_DMA) += ux500_dma.o
musb_hdrc-$(CONFIG_USB_TI_CPPI41_DMA) += musb_cppi41.o
diff --git a/drivers/usb/musb/cppi_dma.c b/drivers/usb/musb/cppi_dma.c
deleted file mode 100644
index edb5b63d7063..000000000000
--- a/drivers/usb/musb/cppi_dma.c
+++ /dev/null
@@ -1,1547 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * Copyright (C) 2005-2006 by Texas Instruments
- *
- * This file implements a DMA interface using TI's CPPI DMA.
- * For now it's DaVinci-only, but CPPI isn't specific to DaVinci or USB.
- * The TUSB6020, using VLYNQ, has CPPI that looks much like DaVinci.
- */
-
-#include <linux/module.h>
-#include <linux/platform_device.h>
-#include <linux/slab.h>
-#include <linux/usb.h>
-
-#include "musb_core.h"
-#include "musb_debug.h"
-#include "cppi_dma.h"
-#include "davinci.h"
-
-
-/* CPPI DMA status 7-mar-2006:
- *
- * - See musb_{host,gadget}.c for more info
- *
- * - Correct RX DMA generally forces the engine into irq-per-packet mode,
- * which can easily saturate the CPU under non-mass-storage loads.
- *
- * NOTES 24-aug-2006 (2.6.18-rc4):
- *
- * - peripheral RXDMA wedged in a test with packets of length 512/512/1.
- * evidently after the 1 byte packet was received and acked, the queue
- * of BDs got garbaged so it wouldn't empty the fifo. (rxcsr 0x2003,
- * and RX DMA0: 4 left, 80000000 8feff880, 8feff860 8feff860; 8f321401
- * 004001ff 00000001 .. 8feff860) Host was just getting NAKed on tx
- * of its next (512 byte) packet. IRQ issues?
- *
- * REVISIT: the "transfer DMA" glue between CPPI and USB fifos will
- * evidently also directly update the RX and TX CSRs ... so audit all
- * host and peripheral side DMA code to avoid CSR access after DMA has
- * been started.
- */
-
-/* REVISIT now we can avoid preallocating these descriptors; or
- * more simply, switch to a global freelist not per-channel ones.
- * Note: at full speed, 64 descriptors == 4K bulk data.
- */
-#define NUM_TXCHAN_BD 64
-#define NUM_RXCHAN_BD 64
-
-static inline void cpu_drain_writebuffer(void)
-{
- wmb();
-#ifdef CONFIG_CPU_ARM926T
- /* REVISIT this "should not be needed",
- * but lack of it sure seemed to hurt ...
- */
- asm("mcr p15, 0, r0, c7, c10, 4 @ drain write buffer\n");
-#endif
-}
-
-static inline struct cppi_descriptor *cppi_bd_alloc(struct cppi_channel *c)
-{
- struct cppi_descriptor *bd = c->freelist;
-
- if (bd)
- c->freelist = bd->next;
- return bd;
-}
-
-static inline void
-cppi_bd_free(struct cppi_channel *c, struct cppi_descriptor *bd)
-{
- if (!bd)
- return;
- bd->next = c->freelist;
- c->freelist = bd;
-}
-
-/*
- * Start DMA controller
- *
- * Initialize the DMA controller as necessary.
- */
-
-/* zero out entire rx state RAM entry for the channel */
-static void cppi_reset_rx(struct cppi_rx_stateram __iomem *rx)
-{
- musb_writel(&rx->rx_skipbytes, 0, 0);
- musb_writel(&rx->rx_head, 0, 0);
- musb_writel(&rx->rx_sop, 0, 0);
- musb_writel(&rx->rx_current, 0, 0);
- musb_writel(&rx->rx_buf_current, 0, 0);
- musb_writel(&rx->rx_len_len, 0, 0);
- musb_writel(&rx->rx_cnt_cnt, 0, 0);
-}
-
-/* zero out entire tx state RAM entry for the channel */
-static void cppi_reset_tx(struct cppi_tx_stateram __iomem *tx, u32 ptr)
-{
- musb_writel(&tx->tx_head, 0, 0);
- musb_writel(&tx->tx_buf, 0, 0);
- musb_writel(&tx->tx_current, 0, 0);
- musb_writel(&tx->tx_buf_current, 0, 0);
- musb_writel(&tx->tx_info, 0, 0);
- musb_writel(&tx->tx_rem_len, 0, 0);
- /* musb_writel(&tx->tx_dummy, 0, 0); */
- musb_writel(&tx->tx_complete, 0, ptr);
-}
-
-static void cppi_pool_init(struct cppi *cppi, struct cppi_channel *c)
-{
- int j;
-
- /* initialize channel fields */
- c->head = NULL;
- c->tail = NULL;
- c->last_processed = NULL;
- c->channel.status = MUSB_DMA_STATUS_UNKNOWN;
- c->controller = cppi;
- c->is_rndis = 0;
- c->freelist = NULL;
-
- /* build the BD Free list for the channel */
- for (j = 0; j < NUM_TXCHAN_BD + 1; j++) {
- struct cppi_descriptor *bd;
- dma_addr_t dma;
-
- bd = dma_pool_alloc(cppi->pool, GFP_KERNEL, &dma);
- bd->dma = dma;
- cppi_bd_free(c, bd);
- }
-}
-
-static int cppi_channel_abort(struct dma_channel *);
-
-static void cppi_pool_free(struct cppi_channel *c)
-{
- struct cppi *cppi = c->controller;
- struct cppi_descriptor *bd;
-
- (void) cppi_channel_abort(&c->channel);
- c->channel.status = MUSB_DMA_STATUS_UNKNOWN;
- c->controller = NULL;
-
- /* free all its bds */
- bd = c->last_processed;
- do {
- if (bd)
- dma_pool_free(cppi->pool, bd, bd->dma);
- bd = cppi_bd_alloc(c);
- } while (bd);
- c->last_processed = NULL;
-}
-
-static void cppi_controller_start(struct cppi *controller)
-{
- void __iomem *tibase;
- int i;
-
- /* do whatever is necessary to start controller */
- for (i = 0; i < ARRAY_SIZE(controller->tx); i++) {
- controller->tx[i].transmit = true;
- controller->tx[i].index = i;
- }
- for (i = 0; i < ARRAY_SIZE(controller->rx); i++) {
- controller->rx[i].transmit = false;
- controller->rx[i].index = i;
- }
-
- /* setup BD list on a per channel basis */
- for (i = 0; i < ARRAY_SIZE(controller->tx); i++)
- cppi_pool_init(controller, controller->tx + i);
- for (i = 0; i < ARRAY_SIZE(controller->rx); i++)
- cppi_pool_init(controller, controller->rx + i);
-
- tibase = controller->tibase;
- INIT_LIST_HEAD(&controller->tx_complete);
-
- /* initialise tx/rx channel head pointers to zero */
- for (i = 0; i < ARRAY_SIZE(controller->tx); i++) {
- struct cppi_channel *tx_ch = controller->tx + i;
- struct cppi_tx_stateram __iomem *tx;
-
- INIT_LIST_HEAD(&tx_ch->tx_complete);
-
- tx = tibase + DAVINCI_TXCPPI_STATERAM_OFFSET(i);
- tx_ch->state_ram = tx;
- cppi_reset_tx(tx, 0);
- }
- for (i = 0; i < ARRAY_SIZE(controller->rx); i++) {
- struct cppi_channel *rx_ch = controller->rx + i;
- struct cppi_rx_stateram __iomem *rx;
-
- INIT_LIST_HEAD(&rx_ch->tx_complete);
-
- rx = tibase + DAVINCI_RXCPPI_STATERAM_OFFSET(i);
- rx_ch->state_ram = rx;
- cppi_reset_rx(rx);
- }
-
- /* enable individual cppi channels */
- musb_writel(tibase, DAVINCI_TXCPPI_INTENAB_REG,
- DAVINCI_DMA_ALL_CHANNELS_ENABLE);
- musb_writel(tibase, DAVINCI_RXCPPI_INTENAB_REG,
- DAVINCI_DMA_ALL_CHANNELS_ENABLE);
-
- /* enable tx/rx CPPI control */
- musb_writel(tibase, DAVINCI_TXCPPI_CTRL_REG, DAVINCI_DMA_CTRL_ENABLE);
- musb_writel(tibase, DAVINCI_RXCPPI_CTRL_REG, DAVINCI_DMA_CTRL_ENABLE);
-
- /* disable RNDIS mode, also host rx RNDIS autorequest */
- musb_writel(tibase, DAVINCI_RNDIS_REG, 0);
- musb_writel(tibase, DAVINCI_AUTOREQ_REG, 0);
-}
-
-/*
- * Stop DMA controller
- *
- * De-Init the DMA controller as necessary.
- */
-
-static void cppi_controller_stop(struct cppi *controller)
-{
- void __iomem *tibase;
- int i;
- struct musb *musb;
-
- musb = controller->controller.musb;
-
- tibase = controller->tibase;
- /* DISABLE INDIVIDUAL CHANNEL Interrupts */
- musb_writel(tibase, DAVINCI_TXCPPI_INTCLR_REG,
- DAVINCI_DMA_ALL_CHANNELS_ENABLE);
- musb_writel(tibase, DAVINCI_RXCPPI_INTCLR_REG,
- DAVINCI_DMA_ALL_CHANNELS_ENABLE);
-
- musb_dbg(musb, "Tearing down RX and TX Channels");
- for (i = 0; i < ARRAY_SIZE(controller->tx); i++) {
- /* FIXME restructure of txdma to use bds like rxdma */
- controller->tx[i].last_processed = NULL;
- cppi_pool_free(controller->tx + i);
- }
- for (i = 0; i < ARRAY_SIZE(controller->rx); i++)
- cppi_pool_free(controller->rx + i);
-
- /* in Tx Case proper teardown is supported. We resort to disabling
- * Tx/Rx CPPI after cleanup of Tx channels. Before TX teardown is
- * complete TX CPPI cannot be disabled.
- */
- /*disable tx/rx cppi */
- musb_writel(tibase, DAVINCI_TXCPPI_CTRL_REG, DAVINCI_DMA_CTRL_DISABLE);
- musb_writel(tibase, DAVINCI_RXCPPI_CTRL_REG, DAVINCI_DMA_CTRL_DISABLE);
-}
-
-/* While dma channel is allocated, we only want the core irqs active
- * for fault reports, otherwise we'd get irqs that we don't care about.
- * Except for TX irqs, where dma done != fifo empty and reusable ...
- *
- * NOTE: docs don't say either way, but irq masking **enables** irqs.
- *
- * REVISIT same issue applies to pure PIO usage too, and non-cppi dma...
- */
-static inline void core_rxirq_disable(void __iomem *tibase, unsigned epnum)
-{
- musb_writel(tibase, DAVINCI_USB_INT_MASK_CLR_REG, 1 << (epnum + 8));
-}
-
-static inline void core_rxirq_enable(void __iomem *tibase, unsigned epnum)
-{
- musb_writel(tibase, DAVINCI_USB_INT_MASK_SET_REG, 1 << (epnum + 8));
-}
-
-
-/*
- * Allocate a CPPI Channel for DMA. With CPPI, channels are bound to
- * each transfer direction of a non-control endpoint, so allocating
- * (and deallocating) is mostly a way to notice bad housekeeping on
- * the software side. We assume the irqs are always active.
- */
-static struct dma_channel *
-cppi_channel_allocate(struct dma_controller *c,
- struct musb_hw_ep *ep, u8 transmit)
-{
- struct cppi *controller;
- u8 index;
- struct cppi_channel *cppi_ch;
- void __iomem *tibase;
- struct musb *musb;
-
- controller = container_of(c, struct cppi, controller);
- tibase = controller->tibase;
- musb = c->musb;
-
- /* ep0 doesn't use DMA; remember cppi indices are 0..N-1 */
- index = ep->epnum - 1;
-
- /* return the corresponding CPPI Channel Handle, and
- * probably disable the non-CPPI irq until we need it.
- */
- if (transmit) {
- if (index >= ARRAY_SIZE(controller->tx)) {
- musb_dbg(musb, "no %cX%d CPPI channel", 'T', index);
- return NULL;
- }
- cppi_ch = controller->tx + index;
- } else {
- if (index >= ARRAY_SIZE(controller->rx)) {
- musb_dbg(musb, "no %cX%d CPPI channel", 'R', index);
- return NULL;
- }
- cppi_ch = controller->rx + index;
- core_rxirq_disable(tibase, ep->epnum);
- }
-
- /* REVISIT make this an error later once the same driver code works
- * with the other DMA engine too
- */
- if (cppi_ch->hw_ep)
- musb_dbg(musb, "re-allocating DMA%d %cX channel %p",
- index, transmit ? 'T' : 'R', cppi_ch);
- cppi_ch->hw_ep = ep;
- cppi_ch->channel.status = MUSB_DMA_STATUS_FREE;
- cppi_ch->channel.max_len = 0x7fffffff;
-
- musb_dbg(musb, "Allocate CPPI%d %cX", index, transmit ? 'T' : 'R');
- return &cppi_ch->channel;
-}
-
-/* Release a CPPI Channel. */
-static void cppi_channel_release(struct dma_channel *channel)
-{
- struct cppi_channel *c;
- void __iomem *tibase;
-
- /* REVISIT: for paranoia, check state and abort if needed... */
-
- c = container_of(channel, struct cppi_channel, channel);
- tibase = c->controller->tibase;
- if (!c->hw_ep)
- musb_dbg(c->controller->controller.musb,
- "releasing idle DMA channel %p", c);
- else if (!c->transmit)
- core_rxirq_enable(tibase, c->index + 1);
-
- /* for now, leave its cppi IRQ enabled (we won't trigger it) */
- c->hw_ep = NULL;
- channel->status = MUSB_DMA_STATUS_UNKNOWN;
-}
-
-/* Context: controller irqlocked */
-static void
-cppi_dump_rx(int level, struct cppi_channel *c, const char *tag)
-{
- void __iomem *base = c->controller->mregs;
- struct cppi_rx_stateram __iomem *rx = c->state_ram;
-
- musb_ep_select(base, c->index + 1);
-
- musb_dbg(c->controller->controller.musb,
- "RX DMA%d%s: %d left, csr %04x, "
- "%08x H%08x S%08x C%08x, "
- "B%08x L%08x %08x .. %08x",
- c->index, tag,
- musb_readl(c->controller->tibase,
- DAVINCI_RXCPPI_BUFCNT0_REG + 4 * c->index),
- musb_readw(c->hw_ep->regs, MUSB_RXCSR),
-
- musb_readl(&rx->rx_skipbytes, 0),
- musb_readl(&rx->rx_head, 0),
- musb_readl(&rx->rx_sop, 0),
- musb_readl(&rx->rx_current, 0),
-
- musb_readl(&rx->rx_buf_current, 0),
- musb_readl(&rx->rx_len_len, 0),
- musb_readl(&rx->rx_cnt_cnt, 0),
- musb_readl(&rx->rx_complete, 0)
- );
-}
-
-/* Context: controller irqlocked */
-static void
-cppi_dump_tx(int level, struct cppi_channel *c, const char *tag)
-{
- void __iomem *base = c->controller->mregs;
- struct cppi_tx_stateram __iomem *tx = c->state_ram;
-
- musb_ep_select(base, c->index + 1);
-
- musb_dbg(c->controller->controller.musb,
- "TX DMA%d%s: csr %04x, "
- "H%08x S%08x C%08x %08x, "
- "F%08x L%08x .. %08x",
- c->index, tag,
- musb_readw(c->hw_ep->regs, MUSB_TXCSR),
-
- musb_readl(&tx->tx_head, 0),
- musb_readl(&tx->tx_buf, 0),
- musb_readl(&tx->tx_current, 0),
- musb_readl(&tx->tx_buf_current, 0),
-
- musb_readl(&tx->tx_info, 0),
- musb_readl(&tx->tx_rem_len, 0),
- /* dummy/unused word 6 */
- musb_readl(&tx->tx_complete, 0)
- );
-}
-
-/* Context: controller irqlocked */
-static inline void
-cppi_rndis_update(struct cppi_channel *c, int is_rx,
- void __iomem *tibase, int is_rndis)
-{
- /* we may need to change the rndis flag for this cppi channel */
- if (c->is_rndis != is_rndis) {
- u32 value = musb_readl(tibase, DAVINCI_RNDIS_REG);
- u32 temp = 1 << (c->index);
-
- if (is_rx)
- temp <<= 16;
- if (is_rndis)
- value |= temp;
- else
- value &= ~temp;
- musb_writel(tibase, DAVINCI_RNDIS_REG, value);
- c->is_rndis = is_rndis;
- }
-}
-
-static void cppi_dump_rxbd(const char *tag, struct cppi_descriptor *bd)
-{
- pr_debug("RXBD/%s %08x: "
- "nxt %08x buf %08x off.blen %08x opt.plen %08x\n",
- tag, bd->dma,
- bd->hw_next, bd->hw_bufp, bd->hw_off_len,
- bd->hw_options);
-}
-
-static void cppi_dump_rxq(int level, const char *tag, struct cppi_channel *rx)
-{
- struct cppi_descriptor *bd;
-
- cppi_dump_rx(level, rx, tag);
- if (rx->last_processed)
- cppi_dump_rxbd("last", rx->last_processed);
- for (bd = rx->head; bd; bd = bd->next)
- cppi_dump_rxbd("active", bd);
-}
-
-
-/* NOTE: DaVinci autoreq is ignored except for host side "RNDIS" mode RX;
- * so we won't ever use it (see "CPPI RX Woes" below).
- */
-static inline int cppi_autoreq_update(struct cppi_channel *rx,
- void __iomem *tibase, int onepacket, unsigned n_bds)
-{
- u32 val;
-
-#ifdef RNDIS_RX_IS_USABLE
- u32 tmp;
- /* assert(is_host_active(musb)) */
-
- /* start from "AutoReq never" */
- tmp = musb_readl(tibase, DAVINCI_AUTOREQ_REG);
- val = tmp & ~((0x3) << (rx->index * 2));
-
- /* HCD arranged reqpkt for packet #1. we arrange int
- * for all but the last one, maybe in two segments.
- */
- if (!onepacket) {
-#if 0
- /* use two segments, autoreq "all" then the last "never" */
- val |= ((0x3) << (rx->index * 2));
- n_bds--;
-#else
- /* one segment, autoreq "all-but-last" */
- val |= ((0x1) << (rx->index * 2));
-#endif
- }
-
- if (val != tmp) {
- int n = 100;
-
- /* make sure that autoreq is updated before continuing */
- musb_writel(tibase, DAVINCI_AUTOREQ_REG, val);
- do {
- tmp = musb_readl(tibase, DAVINCI_AUTOREQ_REG);
- if (tmp == val)
- break;
- cpu_relax();
- } while (n-- > 0);
- }
-#endif
-
- /* REQPKT is turned off after each segment */
- if (n_bds && rx->channel.actual_len) {
- void __iomem *regs = rx->hw_ep->regs;
-
- val = musb_readw(regs, MUSB_RXCSR);
- if (!(val & MUSB_RXCSR_H_REQPKT)) {
- val |= MUSB_RXCSR_H_REQPKT | MUSB_RXCSR_H_WZC_BITS;
- musb_writew(regs, MUSB_RXCSR, val);
- /* flush writebuffer */
- val = musb_readw(regs, MUSB_RXCSR);
- }
- }
- return n_bds;
-}
-
-
-/* Buffer enqueuing Logic:
- *
- * - RX builds new queues each time, to help handle routine "early
- * termination" cases (faults, including errors and short reads)
- * more correctly.
- *
- * - for now, TX reuses the same queue of BDs every time
- *
- * REVISIT long term, we want a normal dynamic model.
- * ... the goal will be to append to the
- * existing queue, processing completed "dma buffers" (segments) on the fly.
- *
- * Otherwise we force an IRQ latency between requests, which slows us a lot
- * (especially in "transparent" dma). Unfortunately that model seems to be
- * inherent in the DMA model from the Mentor code, except in the rare case
- * of transfers big enough (~128+ KB) that we could append "middle" segments
- * in the TX paths. (RX can't do this, see below.)
- *
- * That's true even in the CPPI- friendly iso case, where most urbs have
- * several small segments provided in a group and where the "packet at a time"
- * "transparent" DMA model is always correct, even on the RX side.
- */
-
-/*
- * CPPI TX:
- * ========
- * TX is a lot more reasonable than RX; it doesn't need to run in
- * irq-per-packet mode very often. RNDIS mode seems to behave too
- * (except how it handles the exactly-N-packets case). Building a
- * txdma queue with multiple requests (urb or usb_request) looks
- * like it would work ... but fault handling would need much testing.
- *
- * The main issue with TX mode RNDIS relates to transfer lengths that
- * are an exact multiple of the packet length. It appears that there's
- * a hiccup in that case (maybe the DMA completes before the ZLP gets
- * written?) boiling down to not being able to rely on CPPI writing any
- * terminating zero length packet before the next transfer is written.
- * So that's punted to PIO; better yet, gadget drivers can avoid it.
- *
- * Plus, there's allegedly an undocumented constraint that rndis transfer
- * length be a multiple of 64 bytes ... but the chip doesn't act that
- * way, and we really don't _want_ that behavior anyway.
- *
- * On TX, "transparent" mode works ... although experiments have shown
- * problems trying to use the SOP/EOP bits in different USB packets.
- *
- * REVISIT try to handle terminating zero length packets using CPPI
- * instead of doing it by PIO after an IRQ. (Meanwhile, make Ethernet
- * links avoid that issue by forcing them to avoid zlps.)
- */
-static void
-cppi_next_tx_segment(struct musb *musb, struct cppi_channel *tx)
-{
- unsigned maxpacket = tx->maxpacket;
- dma_addr_t addr = tx->buf_dma + tx->offset;
- size_t length = tx->buf_len - tx->offset;
- struct cppi_descriptor *bd;
- unsigned n_bds;
- unsigned i;
- struct cppi_tx_stateram __iomem *tx_ram = tx->state_ram;
- int rndis;
-
- /* TX can use the CPPI "rndis" mode, where we can probably fit this
- * transfer in one BD and one IRQ. The only time we would NOT want
- * to use it is when hardware constraints prevent it, or if we'd
- * trigger the "send a ZLP?" confusion.
- */
- rndis = (maxpacket & 0x3f) == 0
- && length > maxpacket
- && length < 0xffff
- && (length % maxpacket) != 0;
-
- if (rndis) {
- maxpacket = length;
- n_bds = 1;
- } else {
- if (length)
- n_bds = DIV_ROUND_UP(length, maxpacket);
- else
- n_bds = 1;
- n_bds = min(n_bds, (unsigned) NUM_TXCHAN_BD);
- length = min(n_bds * maxpacket, length);
- }
-
- musb_dbg(musb, "TX DMA%d, pktSz %d %s bds %d dma 0x%llx len %u",
- tx->index,
- maxpacket,
- rndis ? "rndis" : "transparent",
- n_bds,
- (unsigned long long)addr, length);
-
- cppi_rndis_update(tx, 0, musb->ctrl_base, rndis);
-
- /* assuming here that channel_program is called during
- * transfer initiation ... current code maintains state
- * for one outstanding request only (no queues, not even
- * the implicit ones of an iso urb).
- */
-
- bd = tx->freelist;
- tx->head = bd;
- tx->last_processed = NULL;
-
- /* FIXME use BD pool like RX side does, and just queue
- * the minimum number for this request.
- */
-
- /* Prepare queue of BDs first, then hand it to hardware.
- * All BDs except maybe the last should be of full packet
- * size; for RNDIS there _is_ only that last packet.
- */
- for (i = 0; i < n_bds; ) {
- if (++i < n_bds && bd->next)
- bd->hw_next = bd->next->dma;
- else
- bd->hw_next = 0;
-
- bd->hw_bufp = tx->buf_dma + tx->offset;
-
- /* FIXME set EOP only on the last packet,
- * SOP only on the first ... avoid IRQs
- */
- if ((tx->offset + maxpacket) <= tx->buf_len) {
- tx->offset += maxpacket;
- bd->hw_off_len = maxpacket;
- bd->hw_options = CPPI_SOP_SET | CPPI_EOP_SET
- | CPPI_OWN_SET | maxpacket;
- } else {
- /* only this one may be a partial USB Packet */
- u32 partial_len;
-
- partial_len = tx->buf_len - tx->offset;
- tx->offset = tx->buf_len;
- bd->hw_off_len = partial_len;
-
- bd->hw_options = CPPI_SOP_SET | CPPI_EOP_SET
- | CPPI_OWN_SET | partial_len;
- if (partial_len == 0)
- bd->hw_options |= CPPI_ZERO_SET;
- }
-
- musb_dbg(musb, "TXBD %p: nxt %08x buf %08x len %04x opt %08x",
- bd, bd->hw_next, bd->hw_bufp,
- bd->hw_off_len, bd->hw_options);
-
- /* update the last BD enqueued to the list */
- tx->tail = bd;
- bd = bd->next;
- }
-
- /* BDs live in DMA-coherent memory, but writes might be pending */
- cpu_drain_writebuffer();
-
- /* Write to the HeadPtr in state RAM to trigger */
- musb_writel(&tx_ram->tx_head, 0, (u32)tx->freelist->dma);
-
- cppi_dump_tx(5, tx, "/S");
-}
-
-/*
- * CPPI RX Woes:
- * =============
- * Consider a 1KB bulk RX buffer in two scenarios: (a) it's fed two 300 byte
- * packets back-to-back, and (b) it's fed two 512 byte packets back-to-back.
- * (Full speed transfers have similar scenarios.)
- *
- * The correct behavior for Linux is that (a) fills the buffer with 300 bytes,
- * and the next packet goes into a buffer that's queued later; while (b) fills
- * the buffer with 1024 bytes. How to do that with CPPI?
- *
- * - RX queues in "rndis" mode -- one single BD -- handle (a) correctly, but
- * (b) loses **BADLY** because nothing (!) happens when that second packet
- * fills the buffer, much less when a third one arrives. (Which makes this
- * not a "true" RNDIS mode. In the RNDIS protocol short-packet termination
- * is optional, and it's fine if peripherals -- not hosts! -- pad messages
- * out to end-of-buffer. Standard PCI host controller DMA descriptors
- * implement that mode by default ... which is no accident.)
- *
- * - RX queues in "transparent" mode -- two BDs with 512 bytes each -- have
- * converse problems: (b) is handled right, but (a) loses badly. CPPI RX
- * ignores SOP/EOP markings and processes both of those BDs; so both packets
- * are loaded into the buffer (with a 212 byte gap between them), and the next
- * buffer queued will NOT get its 300 bytes of data. (It seems like SOP/EOP
- * are intended as outputs for RX queues, not inputs...)
- *
- * - A variant of "transparent" mode -- one BD at a time -- is the only way to
- * reliably make both cases work, with software handling both cases correctly
- * and at the significant penalty of needing an IRQ per packet. (The lack of
- * I/O overlap can be slightly ameliorated by enabling double buffering.)
- *
- * So how to get rid of IRQ-per-packet? The transparent multi-BD case could
- * be used in special cases like mass storage, which sets URB_SHORT_NOT_OK
- * (or maybe its peripheral side counterpart) to flag (a) scenarios as errors
- * with guaranteed driver level fault recovery and scrubbing out what's left
- * of that garbaged datastream.
- *
- * But there seems to be no way to identify the cases where CPPI RNDIS mode
- * is appropriate -- which do NOT include RNDIS host drivers, but do include
- * the CDC Ethernet driver! -- and the documentation is incomplete/wrong.
- * So we can't _ever_ use RX RNDIS mode ... except by using a heuristic
- * that applies best on the peripheral side (and which could fail rudely).
- *
- * Leaving only "transparent" mode; we avoid multi-bd modes in almost all
- * cases other than mass storage class. Otherwise we're correct but slow,
- * since CPPI penalizes our need for a "true RNDIS" default mode.
- */
-
-
-/* Heuristic, intended to kick in for ethernet/rndis peripheral ONLY
- *
- * IFF
- * (a) peripheral mode ... since rndis peripherals could pad their
- * writes to hosts, causing i/o failure; or we'd have to cope with
- * a largely unknowable variety of host side protocol variants
- * (b) and short reads are NOT errors ... since full reads would
- * cause those same i/o failures
- * (c) and read length is
- * - less than 64KB (max per cppi descriptor)
- * - not a multiple of 4096 (g_zero default, full reads typical)
- * - N (>1) packets long, ditto (full reads not EXPECTED)
- * THEN
- * try rx rndis mode
- *
- * Cost of heuristic failing: RXDMA wedges at the end of transfers that
- * fill out the whole buffer. Buggy host side usb network drivers could
- * trigger that, but "in the field" such bugs seem to be all but unknown.
- *
- * So this module parameter lets the heuristic be disabled. When using
- * gadgetfs, the heuristic will probably need to be disabled.
- */
-static bool cppi_rx_rndis = 1;
-
-module_param(cppi_rx_rndis, bool, 0);
-MODULE_PARM_DESC(cppi_rx_rndis, "enable/disable RX RNDIS heuristic");
-
-
-/**
- * cppi_next_rx_segment - dma read for the next chunk of a buffer
- * @musb: the controller
- * @rx: dma channel
- * @onepacket: true unless caller treats short reads as errors, and
- * performs fault recovery above usbcore.
- * Context: controller irqlocked
- *
- * See above notes about why we can't use multi-BD RX queues except in
- * rare cases (mass storage class), and can never use the hardware "rndis"
- * mode (since it's not a "true" RNDIS mode) with complete safety..
- *
- * It's ESSENTIAL that callers specify "onepacket" mode unless they kick in
- * code to recover from corrupted datastreams after each short transfer.
- */
-static void
-cppi_next_rx_segment(struct musb *musb, struct cppi_channel *rx, int onepacket)
-{
- unsigned maxpacket = rx->maxpacket;
- dma_addr_t addr = rx->buf_dma + rx->offset;
- size_t length = rx->buf_len - rx->offset;
- struct cppi_descriptor *bd, *tail;
- unsigned n_bds;
- unsigned i;
- void __iomem *tibase = musb->ctrl_base;
- int is_rndis = 0;
- struct cppi_rx_stateram __iomem *rx_ram = rx->state_ram;
- struct cppi_descriptor *d;
-
- if (onepacket) {
- /* almost every USB driver, host or peripheral side */
- n_bds = 1;
-
- /* maybe apply the heuristic above */
- if (cppi_rx_rndis
- && is_peripheral_active(musb)
- && length > maxpacket
- && (length & ~0xffff) == 0
- && (length & 0x0fff) != 0
- && (length & (maxpacket - 1)) == 0) {
- maxpacket = length;
- is_rndis = 1;
- }
- } else {
- /* virtually nothing except mass storage class */
- if (length > 0xffff) {
- n_bds = 0xffff / maxpacket;
- length = n_bds * maxpacket;
- } else {
- n_bds = DIV_ROUND_UP(length, maxpacket);
- }
- if (n_bds == 1)
- onepacket = 1;
- else
- n_bds = min(n_bds, (unsigned) NUM_RXCHAN_BD);
- }
-
- /* In host mode, autorequest logic can generate some IN tokens; it's
- * tricky since we can't leave REQPKT set in RXCSR after the transfer
- * finishes. So: multipacket transfers involve two or more segments.
- * And always at least two IRQs ... RNDIS mode is not an option.
- */
- if (is_host_active(musb))
- n_bds = cppi_autoreq_update(rx, tibase, onepacket, n_bds);
-
- cppi_rndis_update(rx, 1, musb->ctrl_base, is_rndis);
-
- length = min(n_bds * maxpacket, length);
-
- musb_dbg(musb, "RX DMA%d seg, maxp %d %s bds %d (cnt %d) "
- "dma 0x%llx len %u %u/%u",
- rx->index, maxpacket,
- onepacket
- ? (is_rndis ? "rndis" : "onepacket")
- : "multipacket",
- n_bds,
- musb_readl(tibase,
- DAVINCI_RXCPPI_BUFCNT0_REG + (rx->index * 4))
- & 0xffff,
- (unsigned long long)addr, length,
- rx->channel.actual_len, rx->buf_len);
-
- /* only queue one segment at a time, since the hardware prevents
- * correct queue shutdown after unexpected short packets
- */
- bd = cppi_bd_alloc(rx);
- rx->head = bd;
-
- /* Build BDs for all packets in this segment */
- for (i = 0, tail = NULL; bd && i < n_bds; i++, tail = bd) {
- u32 bd_len;
-
- if (i) {
- bd = cppi_bd_alloc(rx);
- if (!bd)
- break;
- tail->next = bd;
- tail->hw_next = bd->dma;
- }
- bd->hw_next = 0;
-
- /* all but the last packet will be maxpacket size */
- if (maxpacket < length)
- bd_len = maxpacket;
- else
- bd_len = length;
-
- bd->hw_bufp = addr;
- addr += bd_len;
- rx->offset += bd_len;
-
- bd->hw_off_len = (0 /*offset*/ << 16) + bd_len;
- bd->buflen = bd_len;
-
- bd->hw_options = CPPI_OWN_SET | (i == 0 ? length : 0);
- length -= bd_len;
- }
-
- /* we always expect at least one reusable BD! */
- if (!tail) {
- WARNING("rx dma%d -- no BDs? need %d\n", rx->index, n_bds);
- return;
- } else if (i < n_bds)
- WARNING("rx dma%d -- only %d of %d BDs\n", rx->index, i, n_bds);
-
- tail->next = NULL;
- tail->hw_next = 0;
-
- bd = rx->head;
- rx->tail = tail;
-
- /* short reads and other faults should terminate this entire
- * dma segment. we want one "dma packet" per dma segment, not
- * one per USB packet, terminating the whole queue at once...
- * NOTE that current hardware seems to ignore SOP and EOP.
- */
- bd->hw_options |= CPPI_SOP_SET;
- tail->hw_options |= CPPI_EOP_SET;
-
- for (d = rx->head; d; d = d->next)
- cppi_dump_rxbd("S", d);
-
- /* in case the preceding transfer left some state... */
- tail = rx->last_processed;
- if (tail) {
- tail->next = bd;
- tail->hw_next = bd->dma;
- }
-
- core_rxirq_enable(tibase, rx->index + 1);
-
- /* BDs live in DMA-coherent memory, but writes might be pending */
- cpu_drain_writebuffer();
-
- /* REVISIT specs say to write this AFTER the BUFCNT register
- * below ... but that loses badly.
- */
- musb_writel(&rx_ram->rx_head, 0, bd->dma);
-
- /* bufferCount must be at least 3, and zeroes on completion
- * unless it underflows below zero, or stops at two, or keeps
- * growing ... grr.
- */
- i = musb_readl(tibase,
- DAVINCI_RXCPPI_BUFCNT0_REG + (rx->index * 4))
- & 0xffff;
-
- if (!i)
- musb_writel(tibase,
- DAVINCI_RXCPPI_BUFCNT0_REG + (rx->index * 4),
- n_bds + 2);
- else if (n_bds > (i - 3))
- musb_writel(tibase,
- DAVINCI_RXCPPI_BUFCNT0_REG + (rx->index * 4),
- n_bds - (i - 3));
-
- i = musb_readl(tibase,
- DAVINCI_RXCPPI_BUFCNT0_REG + (rx->index * 4))
- & 0xffff;
- if (i < (2 + n_bds)) {
- musb_dbg(musb, "bufcnt%d underrun - %d (for %d)",
- rx->index, i, n_bds);
- musb_writel(tibase,
- DAVINCI_RXCPPI_BUFCNT0_REG + (rx->index * 4),
- n_bds + 2);
- }
-
- cppi_dump_rx(4, rx, "/S");
-}
-
-/**
- * cppi_channel_program - program channel for data transfer
- * @ch: the channel
- * @maxpacket: max packet size
- * @mode: For RX, 1 unless the usb protocol driver promised to treat
- * all short reads as errors and kick in high level fault recovery.
- * For TX, ignored because of RNDIS mode races/glitches.
- * @dma_addr: dma address of buffer
- * @len: length of buffer
- * Context: controller irqlocked
- */
-static int cppi_channel_program(struct dma_channel *ch,
- u16 maxpacket, u8 mode,
- dma_addr_t dma_addr, u32 len)
-{
- struct cppi_channel *cppi_ch;
- struct cppi *controller;
- struct musb *musb;
-
- cppi_ch = container_of(ch, struct cppi_channel, channel);
- controller = cppi_ch->controller;
- musb = controller->controller.musb;
-
- switch (ch->status) {
- case MUSB_DMA_STATUS_BUS_ABORT:
- case MUSB_DMA_STATUS_CORE_ABORT:
- /* fault irq handler should have handled cleanup */
- WARNING("%cX DMA%d not cleaned up after abort!\n",
- cppi_ch->transmit ? 'T' : 'R',
- cppi_ch->index);
- /* WARN_ON(1); */
- break;
- case MUSB_DMA_STATUS_BUSY:
- WARNING("program active channel? %cX DMA%d\n",
- cppi_ch->transmit ? 'T' : 'R',
- cppi_ch->index);
- /* WARN_ON(1); */
- break;
- case MUSB_DMA_STATUS_UNKNOWN:
- musb_dbg(musb, "%cX DMA%d not allocated!",
- cppi_ch->transmit ? 'T' : 'R',
- cppi_ch->index);
- fallthrough;
- case MUSB_DMA_STATUS_FREE:
- break;
- }
-
- ch->status = MUSB_DMA_STATUS_BUSY;
-
- /* set transfer parameters, then queue up its first segment */
- cppi_ch->buf_dma = dma_addr;
- cppi_ch->offset = 0;
- cppi_ch->maxpacket = maxpacket;
- cppi_ch->buf_len = len;
- cppi_ch->channel.actual_len = 0;
-
- /* TX channel? or RX? */
- if (cppi_ch->transmit)
- cppi_next_tx_segment(musb, cppi_ch);
- else
- cppi_next_rx_segment(musb, cppi_ch, mode);
-
- return true;
-}
-
-static bool cppi_rx_scan(struct cppi *cppi, unsigned ch)
-{
- struct cppi_channel *rx = &cppi->rx[ch];
- struct cppi_rx_stateram __iomem *state = rx->state_ram;
- struct cppi_descriptor *bd;
- struct cppi_descriptor *last = rx->last_processed;
- bool completed = false;
- bool acked = false;
- int i;
- dma_addr_t safe2ack;
- void __iomem *regs = rx->hw_ep->regs;
- struct musb *musb = cppi->controller.musb;
-
- cppi_dump_rx(6, rx, "/K");
-
- bd = last ? last->next : rx->head;
- if (!bd)
- return false;
-
- /* run through all completed BDs */
- for (i = 0, safe2ack = musb_readl(&state->rx_complete, 0);
- (safe2ack || completed) && bd && i < NUM_RXCHAN_BD;
- i++, bd = bd->next) {
- u16 len;
-
- /* catch latest BD writes from CPPI */
- rmb();
- if (!completed && (bd->hw_options & CPPI_OWN_SET))
- break;
-
- musb_dbg(musb, "C/RXBD %llx: nxt %08x buf %08x "
- "off.len %08x opt.len %08x (%d)",
- (unsigned long long)bd->dma, bd->hw_next, bd->hw_bufp,
- bd->hw_off_len, bd->hw_options,
- rx->channel.actual_len);
-
- /* actual packet received length */
- if ((bd->hw_options & CPPI_SOP_SET) && !completed)
- len = bd->hw_off_len & CPPI_RECV_PKTLEN_MASK;
- else
- len = 0;
-
- if (bd->hw_options & CPPI_EOQ_MASK)
- completed = true;
-
- if (!completed && len < bd->buflen) {
- /* NOTE: when we get a short packet, RXCSR_H_REQPKT
- * must have been cleared, and no more DMA packets may
- * active be in the queue... TI docs didn't say, but
- * CPPI ignores those BDs even though OWN is still set.
- */
- completed = true;
- musb_dbg(musb, "rx short %d/%d (%d)",
- len, bd->buflen,
- rx->channel.actual_len);
- }
-
- /* If we got here, we expect to ack at least one BD; meanwhile
- * CPPI may completing other BDs while we scan this list...
- *
- * RACE: we can notice OWN cleared before CPPI raises the
- * matching irq by writing that BD as the completion pointer.
- * In such cases, stop scanning and wait for the irq, avoiding
- * lost acks and states where BD ownership is unclear.
- */
- if (bd->dma == safe2ack) {
- musb_writel(&state->rx_complete, 0, safe2ack);
- safe2ack = musb_readl(&state->rx_complete, 0);
- acked = true;
- if (bd->dma == safe2ack)
- safe2ack = 0;
- }
-
- rx->channel.actual_len += len;
-
- cppi_bd_free(rx, last);
- last = bd;
-
- /* stop scanning on end-of-segment */
- if (bd->hw_next == 0)
- completed = true;
- }
- rx->last_processed = last;
-
- /* dma abort, lost ack, or ... */
- if (!acked && last) {
- int csr;
-
- if (safe2ack == 0 || safe2ack == rx->last_processed->dma)
- musb_writel(&state->rx_complete, 0, safe2ack);
- if (safe2ack == 0) {
- cppi_bd_free(rx, last);
- rx->last_processed = NULL;
-
- /* if we land here on the host side, H_REQPKT will
- * be clear and we need to restart the queue...
- */
- WARN_ON(rx->head);
- }
- musb_ep_select(cppi->mregs, rx->index + 1);
- csr = musb_readw(regs, MUSB_RXCSR);
- if (csr & MUSB_RXCSR_DMAENAB) {
- musb_dbg(musb, "list%d %p/%p, last %llx%s, csr %04x",
- rx->index,
- rx->head, rx->tail,
- rx->last_processed
- ? (unsigned long long)
- rx->last_processed->dma
- : 0,
- completed ? ", completed" : "",
- csr);
- cppi_dump_rxq(4, "/what?", rx);
- }
- }
- if (!completed) {
- int csr;
-
- rx->head = bd;
-
- /* REVISIT seems like "autoreq all but EOP" doesn't...
- * setting it here "should" be racey, but seems to work
- */
- csr = musb_readw(rx->hw_ep->regs, MUSB_RXCSR);
- if (is_host_active(cppi->controller.musb)
- && bd
- && !(csr & MUSB_RXCSR_H_REQPKT)) {
- csr |= MUSB_RXCSR_H_REQPKT;
- musb_writew(regs, MUSB_RXCSR,
- MUSB_RXCSR_H_WZC_BITS | csr);
- csr = musb_readw(rx->hw_ep->regs, MUSB_RXCSR);
- }
- } else {
- rx->head = NULL;
- rx->tail = NULL;
- }
-
- cppi_dump_rx(6, rx, completed ? "/completed" : "/cleaned");
- return completed;
-}
-
-irqreturn_t cppi_interrupt(int irq, void *dev_id)
-{
- struct musb *musb = dev_id;
- struct cppi *cppi;
- void __iomem *tibase;
- struct musb_hw_ep *hw_ep = NULL;
- u32 rx, tx;
- int i, index;
- unsigned long flags;
-
- cppi = container_of(musb->dma_controller, struct cppi, controller);
- if (cppi->irq)
- spin_lock_irqsave(&musb->lock, flags);
-
- tibase = musb->ctrl_base;
-
- tx = musb_readl(tibase, DAVINCI_TXCPPI_MASKED_REG);
- rx = musb_readl(tibase, DAVINCI_RXCPPI_MASKED_REG);
-
- if (!tx && !rx) {
- if (cppi->irq)
- spin_unlock_irqrestore(&musb->lock, flags);
- return IRQ_NONE;
- }
-
- musb_dbg(musb, "CPPI IRQ Tx%x Rx%x", tx, rx);
-
- /* process TX channels */
- for (index = 0; tx; tx = tx >> 1, index++) {
- struct cppi_channel *tx_ch;
- struct cppi_tx_stateram __iomem *tx_ram;
- bool completed = false;
- struct cppi_descriptor *bd;
-
- if (!(tx & 1))
- continue;
-
- tx_ch = cppi->tx + index;
- tx_ram = tx_ch->state_ram;
-
- /* FIXME need a cppi_tx_scan() routine, which
- * can also be called from abort code
- */
-
- cppi_dump_tx(5, tx_ch, "/E");
-
- bd = tx_ch->head;
-
- /*
- * If Head is null then this could mean that a abort interrupt
- * that needs to be acknowledged.
- */
- if (NULL == bd) {
- musb_dbg(musb, "null BD");
- musb_writel(&tx_ram->tx_complete, 0, 0);
- continue;
- }
-
- /* run through all completed BDs */
- for (i = 0; !completed && bd && i < NUM_TXCHAN_BD;
- i++, bd = bd->next) {
- u16 len;
-
- /* catch latest BD writes from CPPI */
- rmb();
- if (bd->hw_options & CPPI_OWN_SET)
- break;
-
- musb_dbg(musb, "C/TXBD %p n %x b %x off %x opt %x",
- bd, bd->hw_next, bd->hw_bufp,
- bd->hw_off_len, bd->hw_options);
-
- len = bd->hw_off_len & CPPI_BUFFER_LEN_MASK;
- tx_ch->channel.actual_len += len;
-
- tx_ch->last_processed = bd;
-
- /* write completion register to acknowledge
- * processing of completed BDs, and possibly
- * release the IRQ; EOQ might not be set ...
- *
- * REVISIT use the same ack strategy as rx
- *
- * REVISIT have observed bit 18 set; huh??
- */
- /* if ((bd->hw_options & CPPI_EOQ_MASK)) */
- musb_writel(&tx_ram->tx_complete, 0, bd->dma);
-
- /* stop scanning on end-of-segment */
- if (bd->hw_next == 0)
- completed = true;
- }
-
- /* on end of segment, maybe go to next one */
- if (completed) {
- /* cppi_dump_tx(4, tx_ch, "/complete"); */
-
- /* transfer more, or report completion */
- if (tx_ch->offset >= tx_ch->buf_len) {
- tx_ch->head = NULL;
- tx_ch->tail = NULL;
- tx_ch->channel.status = MUSB_DMA_STATUS_FREE;
-
- hw_ep = tx_ch->hw_ep;
-
- musb_dma_completion(musb, index + 1, 1);
-
- } else {
- /* Bigger transfer than we could fit in
- * that first batch of descriptors...
- */
- cppi_next_tx_segment(musb, tx_ch);
- }
- } else
- tx_ch->head = bd;
- }
-
- /* Start processing the RX block */
- for (index = 0; rx; rx = rx >> 1, index++) {
-
- if (rx & 1) {
- struct cppi_channel *rx_ch;
-
- rx_ch = cppi->rx + index;
-
- /* let incomplete dma segments finish */
- if (!cppi_rx_scan(cppi, index))
- continue;
-
- /* start another dma segment if needed */
- if (rx_ch->channel.actual_len != rx_ch->buf_len
- && rx_ch->channel.actual_len
- == rx_ch->offset) {
- cppi_next_rx_segment(musb, rx_ch, 1);
- continue;
- }
-
- /* all segments completed! */
- rx_ch->channel.status = MUSB_DMA_STATUS_FREE;
-
- hw_ep = rx_ch->hw_ep;
-
- core_rxirq_disable(tibase, index + 1);
- musb_dma_completion(musb, index + 1, 0);
- }
- }
-
- /* write to CPPI EOI register to re-enable interrupts */
- musb_writel(tibase, DAVINCI_CPPI_EOI_REG, 0);
-
- if (cppi->irq)
- spin_unlock_irqrestore(&musb->lock, flags);
-
- return IRQ_HANDLED;
-}
-EXPORT_SYMBOL_GPL(cppi_interrupt);
-
-/* Instantiate a software object representing a DMA controller. */
-struct dma_controller *
-cppi_dma_controller_create(struct musb *musb, void __iomem *mregs)
-{
- struct cppi *controller;
- struct device *dev = musb->controller;
- struct platform_device *pdev = to_platform_device(dev);
- int irq = platform_get_irq_byname(pdev, "dma");
-
- controller = kzalloc(sizeof *controller, GFP_KERNEL);
- if (!controller)
- return NULL;
-
- controller->mregs = mregs;
- controller->tibase = mregs - DAVINCI_BASE_OFFSET;
-
- controller->controller.musb = musb;
- controller->controller.channel_alloc = cppi_channel_allocate;
- controller->controller.channel_release = cppi_channel_release;
- controller->controller.channel_program = cppi_channel_program;
- controller->controller.channel_abort = cppi_channel_abort;
-
- /* NOTE: allocating from on-chip SRAM would give the least
- * contention for memory access, if that ever matters here.
- */
-
- /* setup BufferPool */
- controller->pool = dma_pool_create("cppi",
- controller->controller.musb->controller,
- sizeof(struct cppi_descriptor),
- CPPI_DESCRIPTOR_ALIGN, 0);
- if (!controller->pool) {
- kfree(controller);
- return NULL;
- }
-
- if (irq > 0) {
- if (request_irq(irq, cppi_interrupt, 0, "cppi-dma", musb)) {
- dev_err(dev, "request_irq %d failed!\n", irq);
- musb_dma_controller_destroy(&controller->controller);
- return NULL;
- }
- controller->irq = irq;
- }
-
- cppi_controller_start(controller);
- return &controller->controller;
-}
-EXPORT_SYMBOL_GPL(cppi_dma_controller_create);
-
-/*
- * Destroy a previously-instantiated DMA controller.
- */
-void cppi_dma_controller_destroy(struct dma_controller *c)
-{
- struct cppi *cppi;
-
- cppi = container_of(c, struct cppi, controller);
-
- cppi_controller_stop(cppi);
-
- if (cppi->irq)
- free_irq(cppi->irq, cppi->controller.musb);
-
- /* assert: caller stopped the controller first */
- dma_pool_destroy(cppi->pool);
-
- kfree(cppi);
-}
-EXPORT_SYMBOL_GPL(cppi_dma_controller_destroy);
-
-/*
- * Context: controller irqlocked, endpoint selected
- */
-static int cppi_channel_abort(struct dma_channel *channel)
-{
- struct cppi_channel *cppi_ch;
- struct cppi *controller;
- void __iomem *mbase;
- void __iomem *tibase;
- void __iomem *regs;
- u32 value;
- struct cppi_descriptor *queue;
-
- cppi_ch = container_of(channel, struct cppi_channel, channel);
-
- controller = cppi_ch->controller;
-
- switch (channel->status) {
- case MUSB_DMA_STATUS_BUS_ABORT:
- case MUSB_DMA_STATUS_CORE_ABORT:
- /* from RX or TX fault irq handler */
- case MUSB_DMA_STATUS_BUSY:
- /* the hardware needs shutting down */
- regs = cppi_ch->hw_ep->regs;
- break;
- case MUSB_DMA_STATUS_UNKNOWN:
- case MUSB_DMA_STATUS_FREE:
- return 0;
- default:
- return -EINVAL;
- }
-
- if (!cppi_ch->transmit && cppi_ch->head)
- cppi_dump_rxq(3, "/abort", cppi_ch);
-
- mbase = controller->mregs;
- tibase = controller->tibase;
-
- queue = cppi_ch->head;
- cppi_ch->head = NULL;
- cppi_ch->tail = NULL;
-
- /* REVISIT should rely on caller having done this,
- * and caller should rely on us not changing it.
- * peripheral code is safe ... check host too.
- */
- musb_ep_select(mbase, cppi_ch->index + 1);
-
- if (cppi_ch->transmit) {
- struct cppi_tx_stateram __iomem *tx_ram;
- /* REVISIT put timeouts on these controller handshakes */
-
- cppi_dump_tx(6, cppi_ch, " (teardown)");
-
- /* teardown DMA engine then usb core */
- do {
- value = musb_readl(tibase, DAVINCI_TXCPPI_TEAR_REG);
- } while (!(value & CPPI_TEAR_READY));
- musb_writel(tibase, DAVINCI_TXCPPI_TEAR_REG, cppi_ch->index);
-
- tx_ram = cppi_ch->state_ram;
- do {
- value = musb_readl(&tx_ram->tx_complete, 0);
- } while (0xFFFFFFFC != value);
-
- /* FIXME clean up the transfer state ... here?
- * the completion routine should get called with
- * an appropriate status code.
- */
-
- value = musb_readw(regs, MUSB_TXCSR);
- value &= ~MUSB_TXCSR_DMAENAB;
- value |= MUSB_TXCSR_FLUSHFIFO;
- musb_writew(regs, MUSB_TXCSR, value);
- musb_writew(regs, MUSB_TXCSR, value);
-
- /*
- * 1. Write to completion Ptr value 0x1(bit 0 set)
- * (write back mode)
- * 2. Wait for abort interrupt and then put the channel in
- * compare mode by writing 1 to the tx_complete register.
- */
- cppi_reset_tx(tx_ram, 1);
- cppi_ch->head = NULL;
- musb_writel(&tx_ram->tx_complete, 0, 1);
- cppi_dump_tx(5, cppi_ch, " (done teardown)");
-
- /* REVISIT tx side _should_ clean up the same way
- * as the RX side ... this does no cleanup at all!
- */
-
- } else /* RX */ {
- u16 csr;
-
- /* NOTE: docs don't guarantee any of this works ... we
- * expect that if the usb core stops telling the cppi core
- * to pull more data from it, then it'll be safe to flush
- * current RX DMA state iff any pending fifo transfer is done.
- */
-
- core_rxirq_disable(tibase, cppi_ch->index + 1);
-
- /* for host, ensure ReqPkt is never set again */
- if (is_host_active(cppi_ch->controller->controller.musb)) {
- value = musb_readl(tibase, DAVINCI_AUTOREQ_REG);
- value &= ~((0x3) << (cppi_ch->index * 2));
- musb_writel(tibase, DAVINCI_AUTOREQ_REG, value);
- }
-
- csr = musb_readw(regs, MUSB_RXCSR);
-
- /* for host, clear (just) ReqPkt at end of current packet(s) */
- if (is_host_active(cppi_ch->controller->controller.musb)) {
- csr |= MUSB_RXCSR_H_WZC_BITS;
- csr &= ~MUSB_RXCSR_H_REQPKT;
- } else
- csr |= MUSB_RXCSR_P_WZC_BITS;
-
- /* clear dma enable */
- csr &= ~(MUSB_RXCSR_DMAENAB);
- musb_writew(regs, MUSB_RXCSR, csr);
- csr = musb_readw(regs, MUSB_RXCSR);
-
- /* Quiesce: wait for current dma to finish (if not cleanup).
- * We can't use bit zero of stateram->rx_sop, since that
- * refers to an entire "DMA packet" not just emptying the
- * current fifo. Most segments need multiple usb packets.
- */
- if (channel->status == MUSB_DMA_STATUS_BUSY)
- udelay(50);
-
- /* scan the current list, reporting any data that was
- * transferred and acking any IRQ
- */
- cppi_rx_scan(controller, cppi_ch->index);
-
- /* clobber the existing state once it's idle
- *
- * NOTE: arguably, we should also wait for all the other
- * RX channels to quiesce (how??) and then temporarily
- * disable RXCPPI_CTRL_REG ... but it seems that we can
- * rely on the controller restarting from state ram, with
- * only RXCPPI_BUFCNT state being bogus. BUFCNT will
- * correct itself after the next DMA transfer though.
- *
- * REVISIT does using rndis mode change that?
- */
- cppi_reset_rx(cppi_ch->state_ram);
-
- /* next DMA request _should_ load cppi head ptr */
-
- /* ... we don't "free" that list, only mutate it in place. */
- cppi_dump_rx(5, cppi_ch, " (done abort)");
-
- /* clean up previously pending bds */
- cppi_bd_free(cppi_ch, cppi_ch->last_processed);
- cppi_ch->last_processed = NULL;
-
- while (queue) {
- struct cppi_descriptor *tmp = queue->next;
-
- cppi_bd_free(cppi_ch, queue);
- queue = tmp;
- }
- }
-
- channel->status = MUSB_DMA_STATUS_FREE;
- cppi_ch->buf_dma = 0;
- cppi_ch->offset = 0;
- cppi_ch->buf_len = 0;
- cppi_ch->maxpacket = 0;
- return 0;
-}
-
-/* TBD Queries:
- *
- * Power Management ... probably turn off cppi during suspend, restart;
- * check state ram? Clocking is presumably shared with usb core.
- */
diff --git a/drivers/usb/musb/davinci.c b/drivers/usb/musb/davinci.c
deleted file mode 100644
index 704435526394..000000000000
--- a/drivers/usb/musb/davinci.c
+++ /dev/null
@@ -1,606 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * Copyright (C) 2005-2006 by Texas Instruments
- *
- * This file is part of the Inventra Controller Driver for Linux.
- */
-
-#include <linux/module.h>
-#include <linux/kernel.h>
-#include <linux/sched.h>
-#include <linux/list.h>
-#include <linux/delay.h>
-#include <linux/clk.h>
-#include <linux/err.h>
-#include <linux/io.h>
-#include <linux/gpio/consumer.h>
-#include <linux/platform_device.h>
-#include <linux/dma-mapping.h>
-#include <linux/usb/usb_phy_generic.h>
-
-#include <mach/cputype.h>
-#include <mach/hardware.h>
-
-#include <asm/mach-types.h>
-
-#include "musb_core.h"
-
-#include "davinci.h"
-#include "cppi_dma.h"
-
-
-#define USB_PHY_CTRL IO_ADDRESS(USBPHY_CTL_PADDR)
-#define DM355_DEEPSLEEP IO_ADDRESS(DM355_DEEPSLEEP_PADDR)
-
-struct davinci_glue {
- struct device *dev;
- struct platform_device *musb;
- struct clk *clk;
- bool vbus_state;
- struct gpio_desc *vbus;
- struct work_struct vbus_work;
-};
-
-/* REVISIT (PM) we should be able to keep the PHY in low power mode most
- * of the time (24 MHZ oscillator and PLL off, etc) by setting POWER.D0
- * and, when in host mode, autosuspending idle root ports... PHYPLLON
- * (overriding SUSPENDM?) then likely needs to stay off.
- */
-
-static inline void phy_on(void)
-{
- u32 phy_ctrl = __raw_readl(USB_PHY_CTRL);
-
- /* power everything up; start the on-chip PHY and its PLL */
- phy_ctrl &= ~(USBPHY_OSCPDWN | USBPHY_OTGPDWN | USBPHY_PHYPDWN);
- phy_ctrl |= USBPHY_SESNDEN | USBPHY_VBDTCTEN | USBPHY_PHYPLLON;
- __raw_writel(phy_ctrl, USB_PHY_CTRL);
-
- /* wait for PLL to lock before proceeding */
- while ((__raw_readl(USB_PHY_CTRL) & USBPHY_PHYCLKGD) == 0)
- cpu_relax();
-}
-
-static inline void phy_off(void)
-{
- u32 phy_ctrl = __raw_readl(USB_PHY_CTRL);
-
- /* powerdown the on-chip PHY, its PLL, and the OTG block */
- phy_ctrl &= ~(USBPHY_SESNDEN | USBPHY_VBDTCTEN | USBPHY_PHYPLLON);
- phy_ctrl |= USBPHY_OSCPDWN | USBPHY_OTGPDWN | USBPHY_PHYPDWN;
- __raw_writel(phy_ctrl, USB_PHY_CTRL);
-}
-
-static int dma_off = 1;
-
-static void davinci_musb_enable(struct musb *musb)
-{
- u32 tmp, old, val;
-
- /* workaround: setup irqs through both register sets */
- tmp = (musb->epmask & DAVINCI_USB_TX_ENDPTS_MASK)
- << DAVINCI_USB_TXINT_SHIFT;
- musb_writel(musb->ctrl_base, DAVINCI_USB_INT_MASK_SET_REG, tmp);
- old = tmp;
- tmp = (musb->epmask & (0xfffe & DAVINCI_USB_RX_ENDPTS_MASK))
- << DAVINCI_USB_RXINT_SHIFT;
- musb_writel(musb->ctrl_base, DAVINCI_USB_INT_MASK_SET_REG, tmp);
- tmp |= old;
-
- val = ~MUSB_INTR_SOF;
- tmp |= ((val & 0x01ff) << DAVINCI_USB_USBINT_SHIFT);
- musb_writel(musb->ctrl_base, DAVINCI_USB_INT_MASK_SET_REG, tmp);
-
- if (is_dma_capable() && !dma_off)
- printk(KERN_WARNING "%s %s: dma not reactivated\n",
- __FILE__, __func__);
- else
- dma_off = 0;
-
- /* force a DRVVBUS irq so we can start polling for ID change */
- musb_writel(musb->ctrl_base, DAVINCI_USB_INT_SET_REG,
- DAVINCI_INTR_DRVVBUS << DAVINCI_USB_USBINT_SHIFT);
-}
-
-/*
- * Disable the HDRC and flush interrupts
- */
-static void davinci_musb_disable(struct musb *musb)
-{
- /* because we don't set CTRLR.UINT, "important" to:
- * - not read/write INTRUSB/INTRUSBE
- * - (except during initial setup, as workaround)
- * - use INTSETR/INTCLRR instead
- */
- musb_writel(musb->ctrl_base, DAVINCI_USB_INT_MASK_CLR_REG,
- DAVINCI_USB_USBINT_MASK
- | DAVINCI_USB_TXINT_MASK
- | DAVINCI_USB_RXINT_MASK);
- musb_writel(musb->ctrl_base, DAVINCI_USB_EOI_REG, 0);
-
- if (is_dma_capable() && !dma_off)
- WARNING("dma still active\n");
-}
-
-
-#define portstate(stmt) stmt
-
-/*
- * VBUS SWITCHING IS BOARD-SPECIFIC ... at least for the DM6446 EVM,
- * which doesn't wire DRVVBUS to the FET that switches it. Unclear
- * if that's a problem with the DM6446 chip or just with that board.
- *
- * In either case, the DM355 EVM automates DRVVBUS the normal way,
- * when J10 is out, and TI documents it as handling OTG.
- */
-
-/* I2C operations are always synchronous, and require a task context.
- * With unloaded systems, using the shared workqueue seems to suffice
- * to satisfy the 100msec A_WAIT_VRISE timeout...
- */
-static void evm_deferred_drvvbus(struct work_struct *work)
-{
- struct davinci_glue *glue = container_of(work, struct davinci_glue,
- vbus_work);
-
- gpiod_set_value_cansleep(glue->vbus, glue->vbus_state);
- glue->vbus_state = !glue->vbus_state;
-}
-
-static void davinci_musb_source_power(struct musb *musb, int is_on,
- int immediate)
-{
- struct davinci_glue *glue = dev_get_drvdata(musb->controller->parent);
-
- /* This GPIO handling is entirely optional */
- if (!glue->vbus)
- return;
-
- if (is_on)
- is_on = 1;
-
- if (glue->vbus_state == is_on)
- return;
- /* 0/1 vs "-1 == unknown/init" */
- glue->vbus_state = !is_on;
-
- if (machine_is_davinci_evm()) {
- if (immediate)
- gpiod_set_value_cansleep(glue->vbus, glue->vbus_state);
- else
- schedule_work(&glue->vbus_work);
- }
- if (immediate)
- glue->vbus_state = is_on;
-}
-
-static void davinci_musb_set_vbus(struct musb *musb, int is_on)
-{
- WARN_ON(is_on && is_peripheral_active(musb));
- davinci_musb_source_power(musb, is_on, 0);
-}
-
-
-#define POLL_SECONDS 2
-
-static void otg_timer(struct timer_list *t)
-{
- struct musb *musb = from_timer(musb, t, dev_timer);
- void __iomem *mregs = musb->mregs;
- u8 devctl;
- unsigned long flags;
-
- /* We poll because DaVinci's won't expose several OTG-critical
- * status change events (from the transceiver) otherwise.
- */
- devctl = musb_readb(mregs, MUSB_DEVCTL);
- dev_dbg(musb->controller, "poll devctl %02x (%s)\n", devctl,
- usb_otg_state_string(musb->xceiv->otg->state));
-
- spin_lock_irqsave(&musb->lock, flags);
- switch (musb->xceiv->otg->state) {
- case OTG_STATE_A_WAIT_VFALL:
- /* Wait till VBUS falls below SessionEnd (~0.2V); the 1.3 RTL
- * seems to mis-handle session "start" otherwise (or in our
- * case "recover"), in routine "VBUS was valid by the time
- * VBUSERR got reported during enumeration" cases.
- */
- if (devctl & MUSB_DEVCTL_VBUS) {
- mod_timer(&musb->dev_timer, jiffies + POLL_SECONDS * HZ);
- break;
- }
- musb->xceiv->otg->state = OTG_STATE_A_WAIT_VRISE;
- musb_writel(musb->ctrl_base, DAVINCI_USB_INT_SET_REG,
- MUSB_INTR_VBUSERROR << DAVINCI_USB_USBINT_SHIFT);
- break;
- case OTG_STATE_B_IDLE:
- /*
- * There's no ID-changed IRQ, so we have no good way to tell
- * when to switch to the A-Default state machine (by setting
- * the DEVCTL.SESSION flag).
- *
- * Workaround: whenever we're in B_IDLE, try setting the
- * session flag every few seconds. If it works, ID was
- * grounded and we're now in the A-Default state machine.
- *
- * NOTE setting the session flag is _supposed_ to trigger
- * SRP, but clearly it doesn't.
- */
- musb_writeb(mregs, MUSB_DEVCTL,
- devctl | MUSB_DEVCTL_SESSION);
- devctl = musb_readb(mregs, MUSB_DEVCTL);
- if (devctl & MUSB_DEVCTL_BDEVICE)
- mod_timer(&musb->dev_timer, jiffies + POLL_SECONDS * HZ);
- else
- musb->xceiv->otg->state = OTG_STATE_A_IDLE;
- break;
- default:
- break;
- }
- spin_unlock_irqrestore(&musb->lock, flags);
-}
-
-static irqreturn_t davinci_musb_interrupt(int irq, void *__hci)
-{
- unsigned long flags;
- irqreturn_t retval = IRQ_NONE;
- struct musb *musb = __hci;
- struct usb_otg *otg = musb->xceiv->otg;
- void __iomem *tibase = musb->ctrl_base;
- struct cppi *cppi;
- u32 tmp;
-
- spin_lock_irqsave(&musb->lock, flags);
-
- /* NOTE: DaVinci shadows the Mentor IRQs. Don't manage them through
- * the Mentor registers (except for setup), use the TI ones and EOI.
- *
- * Docs describe irq "vector" registers associated with the CPPI and
- * USB EOI registers. These hold a bitmask corresponding to the
- * current IRQ, not an irq handler address. Would using those bits
- * resolve some of the races observed in this dispatch code??
- */
-
- /* CPPI interrupts share the same IRQ line, but have their own
- * mask, state, "vector", and EOI registers.
- */
- cppi = container_of(musb->dma_controller, struct cppi, controller);
- if (is_cppi_enabled(musb) && musb->dma_controller && !cppi->irq)
- retval = cppi_interrupt(irq, __hci);
-
- /* ack and handle non-CPPI interrupts */
- tmp = musb_readl(tibase, DAVINCI_USB_INT_SRC_MASKED_REG);
- musb_writel(tibase, DAVINCI_USB_INT_SRC_CLR_REG, tmp);
- dev_dbg(musb->controller, "IRQ %08x\n", tmp);
-
- musb->int_rx = (tmp & DAVINCI_USB_RXINT_MASK)
- >> DAVINCI_USB_RXINT_SHIFT;
- musb->int_tx = (tmp & DAVINCI_USB_TXINT_MASK)
- >> DAVINCI_USB_TXINT_SHIFT;
- musb->int_usb = (tmp & DAVINCI_USB_USBINT_MASK)
- >> DAVINCI_USB_USBINT_SHIFT;
-
- /* DRVVBUS irqs are the only proxy we have (a very poor one!) for
- * DaVinci's missing ID change IRQ. We need an ID change IRQ to
- * switch appropriately between halves of the OTG state machine.
- * Managing DEVCTL.SESSION per Mentor docs requires we know its
- * value, but DEVCTL.BDEVICE is invalid without DEVCTL.SESSION set.
- * Also, DRVVBUS pulses for SRP (but not at 5V) ...
- */
- if (tmp & (DAVINCI_INTR_DRVVBUS << DAVINCI_USB_USBINT_SHIFT)) {
- int drvvbus = musb_readl(tibase, DAVINCI_USB_STAT_REG);
- void __iomem *mregs = musb->mregs;
- u8 devctl = musb_readb(mregs, MUSB_DEVCTL);
- int err = musb->int_usb & MUSB_INTR_VBUSERROR;
-
- err = musb->int_usb & MUSB_INTR_VBUSERROR;
- if (err) {
- /* The Mentor core doesn't debounce VBUS as needed
- * to cope with device connect current spikes. This
- * means it's not uncommon for bus-powered devices
- * to get VBUS errors during enumeration.
- *
- * This is a workaround, but newer RTL from Mentor
- * seems to allow a better one: "re"starting sessions
- * without waiting (on EVM, a **long** time) for VBUS
- * to stop registering in devctl.
- */
- musb->int_usb &= ~MUSB_INTR_VBUSERROR;
- musb->xceiv->otg->state = OTG_STATE_A_WAIT_VFALL;
- mod_timer(&musb->dev_timer, jiffies + POLL_SECONDS * HZ);
- WARNING("VBUS error workaround (delay coming)\n");
- } else if (drvvbus) {
- MUSB_HST_MODE(musb);
- musb->xceiv->otg->state = OTG_STATE_A_WAIT_VRISE;
- portstate(musb->port1_status |= USB_PORT_STAT_POWER);
- del_timer(&musb->dev_timer);
- } else {
- musb->is_active = 0;
- MUSB_DEV_MODE(musb);
- musb->xceiv->otg->state = OTG_STATE_B_IDLE;
- portstate(musb->port1_status &= ~USB_PORT_STAT_POWER);
- }
-
- /* NOTE: this must complete poweron within 100 msec
- * (OTG_TIME_A_WAIT_VRISE) but we don't check for that.
- */
- davinci_musb_source_power(musb, drvvbus, 0);
- dev_dbg(musb->controller, "VBUS %s (%s)%s, devctl %02x\n",
- drvvbus ? "on" : "off",
- usb_otg_state_string(musb->xceiv->otg->state),
- err ? " ERROR" : "",
- devctl);
- retval = IRQ_HANDLED;
- }
-
- if (musb->int_tx || musb->int_rx || musb->int_usb)
- retval |= musb_interrupt(musb);
-
- /* irq stays asserted until EOI is written */
- musb_writel(tibase, DAVINCI_USB_EOI_REG, 0);
-
- /* poll for ID change */
- if (musb->xceiv->otg->state == OTG_STATE_B_IDLE)
- mod_timer(&musb->dev_timer, jiffies + POLL_SECONDS * HZ);
-
- spin_unlock_irqrestore(&musb->lock, flags);
-
- return retval;
-}
-
-static int davinci_musb_set_mode(struct musb *musb, u8 mode)
-{
- /* EVM can't do this (right?) */
- return -EIO;
-}
-
-static int davinci_musb_init(struct musb *musb)
-{
- void __iomem *tibase = musb->ctrl_base;
- u32 revision;
- int ret = -ENODEV;
-
- musb->xceiv = usb_get_phy(USB_PHY_TYPE_USB2);
- if (IS_ERR_OR_NULL(musb->xceiv)) {
- ret = -EPROBE_DEFER;
- goto unregister;
- }
-
- musb->mregs += DAVINCI_BASE_OFFSET;
-
- /* returns zero if e.g. not clocked */
- revision = musb_readl(tibase, DAVINCI_USB_VERSION_REG);
- if (revision == 0)
- goto fail;
-
- timer_setup(&musb->dev_timer, otg_timer, 0);
-
- davinci_musb_source_power(musb, 0, 1);
-
- /* dm355 EVM swaps D+/D- for signal integrity, and
- * is clocked from the main 24 MHz crystal.
- */
- if (machine_is_davinci_dm355_evm()) {
- u32 phy_ctrl = __raw_readl(USB_PHY_CTRL);
-
- phy_ctrl &= ~(3 << 9);
- phy_ctrl |= USBPHY_DATAPOL;
- __raw_writel(phy_ctrl, USB_PHY_CTRL);
- }
-
- /* On dm355, the default-A state machine needs DRVVBUS control.
- * If we won't be a host, there's no need to turn it on.
- */
- if (cpu_is_davinci_dm355()) {
- u32 deepsleep = __raw_readl(DM355_DEEPSLEEP);
-
- deepsleep &= ~DRVVBUS_FORCE;
- __raw_writel(deepsleep, DM355_DEEPSLEEP);
- }
-
- /* reset the controller */
- musb_writel(tibase, DAVINCI_USB_CTRL_REG, 0x1);
-
- /* start the on-chip PHY and its PLL */
- phy_on();
-
- msleep(5);
-
- /* NOTE: irqs are in mixed mode, not bypass to pure-musb */
- pr_debug("DaVinci OTG revision %08x phy %03x control %02x\n",
- revision, __raw_readl(USB_PHY_CTRL),
- musb_readb(tibase, DAVINCI_USB_CTRL_REG));
-
- musb->isr = davinci_musb_interrupt;
- return 0;
-
-fail:
- usb_put_phy(musb->xceiv);
-unregister:
- usb_phy_generic_unregister();
- return ret;
-}
-
-static int davinci_musb_exit(struct musb *musb)
-{
- int maxdelay = 30;
- u8 devctl, warn = 0;
-
- del_timer_sync(&musb->dev_timer);
-
- /* force VBUS off */
- if (cpu_is_davinci_dm355()) {
- u32 deepsleep = __raw_readl(DM355_DEEPSLEEP);
-
- deepsleep &= ~DRVVBUS_FORCE;
- deepsleep |= DRVVBUS_OVERRIDE;
- __raw_writel(deepsleep, DM355_DEEPSLEEP);
- }
-
- davinci_musb_source_power(musb, 0 /*off*/, 1);
-
- /*
- * delay, to avoid problems with module reload.
- * if there's no peripheral connected, this can take a
- * long time to fall, especially on EVM with huge C133.
- */
- do {
- devctl = musb_readb(musb->mregs, MUSB_DEVCTL);
- if (!(devctl & MUSB_DEVCTL_VBUS))
- break;
- if ((devctl & MUSB_DEVCTL_VBUS) != warn) {
- warn = devctl & MUSB_DEVCTL_VBUS;
- dev_dbg(musb->controller, "VBUS %d\n",
- warn >> MUSB_DEVCTL_VBUS_SHIFT);
- }
- msleep(1000);
- maxdelay--;
- } while (maxdelay > 0);
-
- /* in OTG mode, another host might be connected */
- if (devctl & MUSB_DEVCTL_VBUS)
- dev_dbg(musb->controller, "VBUS off timeout (devctl %02x)\n", devctl);
-
- phy_off();
-
- usb_put_phy(musb->xceiv);
-
- return 0;
-}
-
-static const struct musb_platform_ops davinci_ops = {
- .quirks = MUSB_DMA_CPPI,
- .init = davinci_musb_init,
- .exit = davinci_musb_exit,
-
-#ifdef CONFIG_USB_TI_CPPI_DMA
- .dma_init = cppi_dma_controller_create,
- .dma_exit = cppi_dma_controller_destroy,
-#endif
- .enable = davinci_musb_enable,
- .disable = davinci_musb_disable,
-
- .set_mode = davinci_musb_set_mode,
-
- .set_vbus = davinci_musb_set_vbus,
-};
-
-static const struct platform_device_info davinci_dev_info = {
- .name = "musb-hdrc",
- .id = PLATFORM_DEVID_AUTO,
- .dma_mask = DMA_BIT_MASK(32),
-};
-
-static int davinci_probe(struct platform_device *pdev)
-{
- struct resource musb_resources[3];
- struct musb_hdrc_platform_data *pdata = dev_get_platdata(&pdev->dev);
- struct platform_device *musb;
- struct davinci_glue *glue;
- struct platform_device_info pinfo;
- struct clk *clk;
-
- int ret = -ENOMEM;
-
- glue = devm_kzalloc(&pdev->dev, sizeof(*glue), GFP_KERNEL);
- if (!glue)
- goto err0;
-
- clk = devm_clk_get(&pdev->dev, "usb");
- if (IS_ERR(clk)) {
- dev_err(&pdev->dev, "failed to get clock\n");
- ret = PTR_ERR(clk);
- goto err0;
- }
-
- ret = clk_enable(clk);
- if (ret) {
- dev_err(&pdev->dev, "failed to enable clock\n");
- goto err0;
- }
-
- glue->dev = &pdev->dev;
- glue->clk = clk;
-
- pdata->platform_ops = &davinci_ops;
-
- glue->vbus = devm_gpiod_get_optional(&pdev->dev, NULL, GPIOD_OUT_LOW);
- if (IS_ERR(glue->vbus)) {
- ret = PTR_ERR(glue->vbus);
- goto err0;
- } else {
- glue->vbus_state = -1;
- INIT_WORK(&glue->vbus_work, evm_deferred_drvvbus);
- }
-
- usb_phy_generic_register();
- platform_set_drvdata(pdev, glue);
-
- memset(musb_resources, 0x00, sizeof(*musb_resources) *
- ARRAY_SIZE(musb_resources));
-
- musb_resources[0].name = pdev->resource[0].name;
- musb_resources[0].start = pdev->resource[0].start;
- musb_resources[0].end = pdev->resource[0].end;
- musb_resources[0].flags = pdev->resource[0].flags;
-
- musb_resources[1].name = pdev->resource[1].name;
- musb_resources[1].start = pdev->resource[1].start;
- musb_resources[1].end = pdev->resource[1].end;
- musb_resources[1].flags = pdev->resource[1].flags;
-
- /*
- * For DM6467 3 resources are passed. A placeholder for the 3rd
- * resource is always there, so it's safe to always copy it...
- */
- musb_resources[2].name = pdev->resource[2].name;
- musb_resources[2].start = pdev->resource[2].start;
- musb_resources[2].end = pdev->resource[2].end;
- musb_resources[2].flags = pdev->resource[2].flags;
-
- pinfo = davinci_dev_info;
- pinfo.parent = &pdev->dev;
- pinfo.res = musb_resources;
- pinfo.num_res = ARRAY_SIZE(musb_resources);
- pinfo.data = pdata;
- pinfo.size_data = sizeof(*pdata);
-
- glue->musb = musb = platform_device_register_full(&pinfo);
- if (IS_ERR(musb)) {
- ret = PTR_ERR(musb);
- dev_err(&pdev->dev, "failed to register musb device: %d\n", ret);
- goto err1;
- }
-
- return 0;
-
-err1:
- clk_disable(clk);
-
-err0:
- return ret;
-}
-
-static int davinci_remove(struct platform_device *pdev)
-{
- struct davinci_glue *glue = platform_get_drvdata(pdev);
-
- platform_device_unregister(glue->musb);
- usb_phy_generic_unregister();
- clk_disable(glue->clk);
-
- return 0;
-}
-
-static struct platform_driver davinci_driver = {
- .probe = davinci_probe,
- .remove = davinci_remove,
- .driver = {
- .name = "musb-davinci",
- },
-};
-
-MODULE_DESCRIPTION("DaVinci MUSB Glue Layer");
-MODULE_AUTHOR("Felipe Balbi <balbi@ti.com>");
-MODULE_LICENSE("GPL v2");
-module_platform_driver(davinci_driver);
diff --git a/drivers/usb/musb/davinci.h b/drivers/usb/musb/davinci.h
deleted file mode 100644
index c8e67d15b510..000000000000
--- a/drivers/usb/musb/davinci.h
+++ /dev/null
@@ -1,103 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-/*
- * Copyright (C) 2005-2006 by Texas Instruments
- */
-
-#ifndef __MUSB_HDRDF_H__
-#define __MUSB_HDRDF_H__
-
-/*
- * DaVinci-specific definitions
- */
-
-/* Integrated highspeed/otg PHY */
-#define USBPHY_CTL_PADDR 0x01c40034
-#define USBPHY_DATAPOL BIT(11) /* (dm355) switch D+/D- */
-#define USBPHY_PHYCLKGD BIT(8)
-#define USBPHY_SESNDEN BIT(7) /* v(sess_end) comparator */
-#define USBPHY_VBDTCTEN BIT(6) /* v(bus) comparator */
-#define USBPHY_VBUSSENS BIT(5) /* (dm355,ro) is vbus > 0.5V */
-#define USBPHY_PHYPLLON BIT(4) /* override pll suspend */
-#define USBPHY_CLKO1SEL BIT(3)
-#define USBPHY_OSCPDWN BIT(2)
-#define USBPHY_OTGPDWN BIT(1)
-#define USBPHY_PHYPDWN BIT(0)
-
-#define DM355_DEEPSLEEP_PADDR 0x01c40048
-#define DRVVBUS_FORCE BIT(2)
-#define DRVVBUS_OVERRIDE BIT(1)
-
-/* For now include usb OTG module registers here */
-#define DAVINCI_USB_VERSION_REG 0x00
-#define DAVINCI_USB_CTRL_REG 0x04
-#define DAVINCI_USB_STAT_REG 0x08
-#define DAVINCI_RNDIS_REG 0x10
-#define DAVINCI_AUTOREQ_REG 0x14
-#define DAVINCI_USB_INT_SOURCE_REG 0x20
-#define DAVINCI_USB_INT_SET_REG 0x24
-#define DAVINCI_USB_INT_SRC_CLR_REG 0x28
-#define DAVINCI_USB_INT_MASK_REG 0x2c
-#define DAVINCI_USB_INT_MASK_SET_REG 0x30
-#define DAVINCI_USB_INT_MASK_CLR_REG 0x34
-#define DAVINCI_USB_INT_SRC_MASKED_REG 0x38
-#define DAVINCI_USB_EOI_REG 0x3c
-#define DAVINCI_USB_EOI_INTVEC 0x40
-
-/* BEGIN CPPI-generic (?) */
-
-/* CPPI related registers */
-#define DAVINCI_TXCPPI_CTRL_REG 0x80
-#define DAVINCI_TXCPPI_TEAR_REG 0x84
-#define DAVINCI_CPPI_EOI_REG 0x88
-#define DAVINCI_CPPI_INTVEC_REG 0x8c
-#define DAVINCI_TXCPPI_MASKED_REG 0x90
-#define DAVINCI_TXCPPI_RAW_REG 0x94
-#define DAVINCI_TXCPPI_INTENAB_REG 0x98
-#define DAVINCI_TXCPPI_INTCLR_REG 0x9c
-
-#define DAVINCI_RXCPPI_CTRL_REG 0xC0
-#define DAVINCI_RXCPPI_MASKED_REG 0xD0
-#define DAVINCI_RXCPPI_RAW_REG 0xD4
-#define DAVINCI_RXCPPI_INTENAB_REG 0xD8
-#define DAVINCI_RXCPPI_INTCLR_REG 0xDC
-
-#define DAVINCI_RXCPPI_BUFCNT0_REG 0xE0
-#define DAVINCI_RXCPPI_BUFCNT1_REG 0xE4
-#define DAVINCI_RXCPPI_BUFCNT2_REG 0xE8
-#define DAVINCI_RXCPPI_BUFCNT3_REG 0xEC
-
-/* CPPI state RAM entries */
-#define DAVINCI_CPPI_STATERAM_BASE_OFFSET 0x100
-
-#define DAVINCI_TXCPPI_STATERAM_OFFSET(chnum) \
- (DAVINCI_CPPI_STATERAM_BASE_OFFSET + ((chnum) * 0x40))
-#define DAVINCI_RXCPPI_STATERAM_OFFSET(chnum) \
- (DAVINCI_CPPI_STATERAM_BASE_OFFSET + 0x20 + ((chnum) * 0x40))
-
-/* CPPI masks */
-#define DAVINCI_DMA_CTRL_ENABLE 1
-#define DAVINCI_DMA_CTRL_DISABLE 0
-
-#define DAVINCI_DMA_ALL_CHANNELS_ENABLE 0xF
-#define DAVINCI_DMA_ALL_CHANNELS_DISABLE 0xF
-
-/* END CPPI-generic (?) */
-
-#define DAVINCI_USB_TX_ENDPTS_MASK 0x1f /* ep0 + 4 tx */
-#define DAVINCI_USB_RX_ENDPTS_MASK 0x1e /* 4 rx */
-
-#define DAVINCI_USB_USBINT_SHIFT 16
-#define DAVINCI_USB_TXINT_SHIFT 0
-#define DAVINCI_USB_RXINT_SHIFT 8
-
-#define DAVINCI_INTR_DRVVBUS 0x0100
-
-#define DAVINCI_USB_USBINT_MASK 0x01ff0000 /* 8 Mentor, DRVVBUS */
-#define DAVINCI_USB_TXINT_MASK \
- (DAVINCI_USB_TX_ENDPTS_MASK << DAVINCI_USB_TXINT_SHIFT)
-#define DAVINCI_USB_RXINT_MASK \
- (DAVINCI_USB_RX_ENDPTS_MASK << DAVINCI_USB_RXINT_SHIFT)
-
-#define DAVINCI_BASE_OFFSET 0x400
-
-#endif /* __MUSB_HDRDF_H__ */
--
2.29.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [PATCH 06/14] mfd: remove dm355evm_msp driver
2022-10-19 15:29 [PATCH 00/14] ARM: remove unused davinci board & drivers Arnd Bergmann
` (3 preceding siblings ...)
2022-10-19 15:29 ` [PATCH 05/14] usb: musb: remove unused davinci support Arnd Bergmann
@ 2022-10-19 15:29 ` Arnd Bergmann
2022-10-20 11:35 ` Bartosz Golaszewski
2022-10-31 15:01 ` Lee Jones
2022-10-19 15:29 ` [PATCH 07/14] input: remove davinci keyboard driver Arnd Bergmann
` (11 subsequent siblings)
16 siblings, 2 replies; 44+ messages in thread
From: Arnd Bergmann @ 2022-10-19 15:29 UTC (permalink / raw)
To: Sekhar Nori, Bartosz Golaszewski, linux-arm-kernel, Lee Jones
Cc: linux-kernel, Kevin Hilman, Arnd Bergmann, Dmitry Torokhov,
Alessandro Zummo, Alexandre Belloni, linux-input, linux-rtc
From: Arnd Bergmann <arnd@arndb.de>
The DaVinci DM355EVM platform is gone after the removal of all
unused board files, so the MTD device along with its sub-devices
can be removed as well.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/input/misc/Kconfig | 11 -
drivers/input/misc/Makefile | 1 -
drivers/input/misc/dm355evm_keys.c | 238 ---------------
drivers/mfd/Kconfig | 8 -
drivers/mfd/Makefile | 1 -
drivers/mfd/dm355evm_msp.c | 454 -----------------------------
drivers/rtc/Kconfig | 6 -
drivers/rtc/Makefile | 1 -
drivers/rtc/rtc-dm355evm.c | 151 ----------
include/linux/mfd/dm355evm_msp.h | 79 -----
10 files changed, 950 deletions(-)
delete mode 100644 drivers/input/misc/dm355evm_keys.c
delete mode 100644 drivers/mfd/dm355evm_msp.c
delete mode 100644 drivers/rtc/rtc-dm355evm.c
delete mode 100644 include/linux/mfd/dm355evm_msp.h
diff --git a/drivers/input/misc/Kconfig b/drivers/input/misc/Kconfig
index 9f088900f863..540633b164d4 100644
--- a/drivers/input/misc/Kconfig
+++ b/drivers/input/misc/Kconfig
@@ -662,17 +662,6 @@ config INPUT_DA9063_ONKEY
To compile this driver as a module, choose M here: the module
will be called da9063_onkey.
-config INPUT_DM355EVM
- tristate "TI DaVinci DM355 EVM Keypad and IR Remote"
- depends on MFD_DM355EVM_MSP
- select INPUT_SPARSEKMAP
- help
- Supports the pushbuttons and IR remote used with
- the DM355 EVM board.
-
- To compile this driver as a module, choose M here: the
- module will be called dm355evm_keys.
-
config INPUT_WM831X_ON
tristate "WM831X ON pin"
depends on MFD_WM831X
diff --git a/drivers/input/misc/Makefile b/drivers/input/misc/Makefile
index 6abefc41037b..156f9c21f53b 100644
--- a/drivers/input/misc/Makefile
+++ b/drivers/input/misc/Makefile
@@ -31,7 +31,6 @@ obj-$(CONFIG_INPUT_DA7280_HAPTICS) += da7280.o
obj-$(CONFIG_INPUT_DA9052_ONKEY) += da9052_onkey.o
obj-$(CONFIG_INPUT_DA9055_ONKEY) += da9055_onkey.o
obj-$(CONFIG_INPUT_DA9063_ONKEY) += da9063_onkey.o
-obj-$(CONFIG_INPUT_DM355EVM) += dm355evm_keys.o
obj-$(CONFIG_INPUT_E3X0_BUTTON) += e3x0-button.o
obj-$(CONFIG_INPUT_DRV260X_HAPTICS) += drv260x.o
obj-$(CONFIG_INPUT_DRV2665_HAPTICS) += drv2665.o
diff --git a/drivers/input/misc/dm355evm_keys.c b/drivers/input/misc/dm355evm_keys.c
deleted file mode 100644
index 397ca7c787cc..000000000000
--- a/drivers/input/misc/dm355evm_keys.c
+++ /dev/null
@@ -1,238 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-or-later
-/*
- * dm355evm_keys.c - support buttons and IR remote on DM355 EVM board
- *
- * Copyright (c) 2008 by David Brownell
- */
-#include <linux/kernel.h>
-#include <linux/slab.h>
-#include <linux/input.h>
-#include <linux/input/sparse-keymap.h>
-#include <linux/platform_device.h>
-#include <linux/interrupt.h>
-
-#include <linux/mfd/dm355evm_msp.h>
-#include <linux/module.h>
-
-
-/*
- * The MSP430 firmware on the DM355 EVM monitors on-board pushbuttons
- * and an IR receptor used for the remote control. When any key is
- * pressed, or its autorepeat kicks in, an event is sent. This driver
- * read those events from the small (32 event) queue and reports them.
- *
- * Note that physically there can only be one of these devices.
- *
- * This driver was tested with firmware revision A4.
- */
-struct dm355evm_keys {
- struct input_dev *input;
- struct device *dev;
-};
-
-/* These initial keycodes can be remapped */
-static const struct key_entry dm355evm_keys[] = {
- /*
- * Pushbuttons on the EVM board ... note that the labels for these
- * are SW10/SW11/etc on the PC board. The left/right orientation
- * comes only from the firmware's documentation, and presumes the
- * power connector is immediately in front of you and the IR sensor
- * is to the right. (That is, rotate the board counter-clockwise
- * by 90 degrees from the SW10/etc and "DM355 EVM" labels.)
- */
- { KE_KEY, 0x00d8, { KEY_OK } }, /* SW12 */
- { KE_KEY, 0x00b8, { KEY_UP } }, /* SW13 */
- { KE_KEY, 0x00e8, { KEY_DOWN } }, /* SW11 */
- { KE_KEY, 0x0078, { KEY_LEFT } }, /* SW14 */
- { KE_KEY, 0x00f0, { KEY_RIGHT } }, /* SW10 */
-
- /*
- * IR buttons ... codes assigned to match the universal remote
- * provided with the EVM (Philips PM4S) using DVD code 0020.
- *
- * These event codes match firmware documentation, but other
- * remote controls could easily send more RC5-encoded events.
- * The PM4S manual was used in several cases to help select
- * a keycode reflecting the intended usage.
- *
- * RC5 codes are 14 bits, with two start bits (0x3 prefix)
- * and a toggle bit (masked out below).
- */
- { KE_KEY, 0x300c, { KEY_POWER } }, /* NOTE: docs omit this */
- { KE_KEY, 0x3000, { KEY_NUMERIC_0 } },
- { KE_KEY, 0x3001, { KEY_NUMERIC_1 } },
- { KE_KEY, 0x3002, { KEY_NUMERIC_2 } },
- { KE_KEY, 0x3003, { KEY_NUMERIC_3 } },
- { KE_KEY, 0x3004, { KEY_NUMERIC_4 } },
- { KE_KEY, 0x3005, { KEY_NUMERIC_5 } },
- { KE_KEY, 0x3006, { KEY_NUMERIC_6 } },
- { KE_KEY, 0x3007, { KEY_NUMERIC_7 } },
- { KE_KEY, 0x3008, { KEY_NUMERIC_8 } },
- { KE_KEY, 0x3009, { KEY_NUMERIC_9 } },
- { KE_KEY, 0x3022, { KEY_ENTER } },
- { KE_KEY, 0x30ec, { KEY_MODE } }, /* "tv/vcr/..." */
- { KE_KEY, 0x300f, { KEY_SELECT } }, /* "info" */
- { KE_KEY, 0x3020, { KEY_CHANNELUP } }, /* "up" */
- { KE_KEY, 0x302e, { KEY_MENU } }, /* "in/out" */
- { KE_KEY, 0x3011, { KEY_VOLUMEDOWN } }, /* "left" */
- { KE_KEY, 0x300d, { KEY_MUTE } }, /* "ok" */
- { KE_KEY, 0x3010, { KEY_VOLUMEUP } }, /* "right" */
- { KE_KEY, 0x301e, { KEY_SUBTITLE } }, /* "cc" */
- { KE_KEY, 0x3021, { KEY_CHANNELDOWN } },/* "down" */
- { KE_KEY, 0x3022, { KEY_PREVIOUS } },
- { KE_KEY, 0x3026, { KEY_SLEEP } },
- { KE_KEY, 0x3172, { KEY_REWIND } }, /* NOTE: docs wrongly say 0x30ca */
- { KE_KEY, 0x3175, { KEY_PLAY } },
- { KE_KEY, 0x3174, { KEY_FASTFORWARD } },
- { KE_KEY, 0x3177, { KEY_RECORD } },
- { KE_KEY, 0x3176, { KEY_STOP } },
- { KE_KEY, 0x3169, { KEY_PAUSE } },
-};
-
-/*
- * Because we communicate with the MSP430 using I2C, and all I2C calls
- * in Linux sleep, we use a threaded IRQ handler. The IRQ itself is
- * active low, but we go through the GPIO controller so we can trigger
- * on falling edges and not worry about enabling/disabling the IRQ in
- * the keypress handling path.
- */
-static irqreturn_t dm355evm_keys_irq(int irq, void *_keys)
-{
- static u16 last_event;
- struct dm355evm_keys *keys = _keys;
- const struct key_entry *ke;
- unsigned int keycode;
- int status;
- u16 event;
-
- /* For simplicity we ignore INPUT_COUNT and just read
- * events until we get the "queue empty" indicator.
- * Reading INPUT_LOW decrements the count.
- */
- for (;;) {
- status = dm355evm_msp_read(DM355EVM_MSP_INPUT_HIGH);
- if (status < 0) {
- dev_dbg(keys->dev, "input high err %d\n",
- status);
- break;
- }
- event = status << 8;
-
- status = dm355evm_msp_read(DM355EVM_MSP_INPUT_LOW);
- if (status < 0) {
- dev_dbg(keys->dev, "input low err %d\n",
- status);
- break;
- }
- event |= status;
- if (event == 0xdead)
- break;
-
- /* Press and release a button: two events, same code.
- * Press and hold (autorepeat), then release: N events
- * (N > 2), same code. For RC5 buttons the toggle bits
- * distinguish (for example) "1-autorepeat" from "1 1";
- * but PCB buttons don't support that bit.
- *
- * So we must synthesize release events. We do that by
- * mapping events to a press/release event pair; then
- * to avoid adding extra events, skip the second event
- * of each pair.
- */
- if (event == last_event) {
- last_event = 0;
- continue;
- }
- last_event = event;
-
- /* ignore the RC5 toggle bit */
- event &= ~0x0800;
-
- /* find the key, or report it as unknown */
- ke = sparse_keymap_entry_from_scancode(keys->input, event);
- keycode = ke ? ke->keycode : KEY_UNKNOWN;
- dev_dbg(keys->dev,
- "input event 0x%04x--> keycode %d\n",
- event, keycode);
-
- /* report press + release */
- input_report_key(keys->input, keycode, 1);
- input_sync(keys->input);
- input_report_key(keys->input, keycode, 0);
- input_sync(keys->input);
- }
-
- return IRQ_HANDLED;
-}
-
-/*----------------------------------------------------------------------*/
-
-static int dm355evm_keys_probe(struct platform_device *pdev)
-{
- struct dm355evm_keys *keys;
- struct input_dev *input;
- int irq;
- int error;
-
- keys = devm_kzalloc(&pdev->dev, sizeof (*keys), GFP_KERNEL);
- if (!keys)
- return -ENOMEM;
-
- input = devm_input_allocate_device(&pdev->dev);
- if (!input)
- return -ENOMEM;
-
- keys->dev = &pdev->dev;
- keys->input = input;
-
- input->name = "DM355 EVM Controls";
- input->phys = "dm355evm/input0";
-
- input->id.bustype = BUS_I2C;
- input->id.product = 0x0355;
- input->id.version = dm355evm_msp_read(DM355EVM_MSP_FIRMREV);
-
- error = sparse_keymap_setup(input, dm355evm_keys, NULL);
- if (error)
- return error;
-
- /* REVISIT: flush the event queue? */
-
- /* set up "threaded IRQ handler" */
- irq = platform_get_irq(pdev, 0);
- if (irq < 0)
- return irq;
-
- error = devm_request_threaded_irq(&pdev->dev, irq,
- NULL, dm355evm_keys_irq,
- IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
- dev_name(&pdev->dev), keys);
- if (error)
- return error;
-
- /* register */
- error = input_register_device(input);
- if (error)
- return error;
-
- return 0;
-}
-
-/* REVISIT: add suspend/resume when DaVinci supports it. The IRQ should
- * be able to wake up the system. When device_may_wakeup(&pdev->dev), call
- * enable_irq_wake() on suspend, and disable_irq_wake() on resume.
- */
-
-/*
- * I2C is used to talk to the MSP430, but this platform device is
- * exposed by an MFD driver that manages I2C communications.
- */
-static struct platform_driver dm355evm_keys_driver = {
- .probe = dm355evm_keys_probe,
- .driver = {
- .name = "dm355evm_keys",
- },
-};
-module_platform_driver(dm355evm_keys_driver);
-
-MODULE_LICENSE("GPL");
diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
index 11c3bd0bd669..31751cd3c4ed 100644
--- a/drivers/mfd/Kconfig
+++ b/drivers/mfd/Kconfig
@@ -1439,14 +1439,6 @@ config MFD_TI_AM335X_TSCADC
To compile this driver as a module, choose M here: the
module will be called ti_am335x_tscadc.
-config MFD_DM355EVM_MSP
- bool "TI DaVinci DM355 EVM microcontroller"
- depends on I2C=y && MACH_DAVINCI_DM355_EVM
- help
- This driver supports the MSP430 microcontroller used on these
- boards. MSP430 firmware manages resets and power sequencing,
- inputs from buttons and the IR remote, LEDs, an RTC, and more.
-
config MFD_LP3943
tristate "TI/National Semiconductor LP3943 MFD Driver"
depends on I2C
diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile
index d74bf111f88e..a3a304f8c762 100644
--- a/drivers/mfd/Makefile
+++ b/drivers/mfd/Makefile
@@ -24,7 +24,6 @@ obj-$(CONFIG_MFD_TI_LP873X) += lp873x.o
obj-$(CONFIG_MFD_TI_LP87565) += lp87565.o
obj-$(CONFIG_MFD_DAVINCI_VOICECODEC) += davinci_voicecodec.o
-obj-$(CONFIG_MFD_DM355EVM_MSP) += dm355evm_msp.o
obj-$(CONFIG_MFD_TI_AM335X_TSCADC) += ti_am335x_tscadc.o
obj-$(CONFIG_MFD_STA2X11) += sta2x11-mfd.o
diff --git a/drivers/mfd/dm355evm_msp.c b/drivers/mfd/dm355evm_msp.c
deleted file mode 100644
index 759c59690680..000000000000
--- a/drivers/mfd/dm355evm_msp.c
+++ /dev/null
@@ -1,454 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-or-later
-/*
- * dm355evm_msp.c - driver for MSP430 firmware on DM355EVM board
- *
- * Copyright (C) 2008 David Brownell
- */
-
-#include <linux/init.h>
-#include <linux/mutex.h>
-#include <linux/platform_device.h>
-#include <linux/clk.h>
-#include <linux/module.h>
-#include <linux/err.h>
-#include <linux/gpio.h>
-#include <linux/gpio/machine.h>
-#include <linux/leds.h>
-#include <linux/i2c.h>
-#include <linux/mfd/dm355evm_msp.h>
-
-
-/*
- * The DM355 is a DaVinci chip with video support but no C64+ DSP. Its
- * EVM board has an MSP430 programmed with firmware for various board
- * support functions. This driver exposes some of them directly, and
- * supports other drivers (e.g. RTC, input) for more complex access.
- *
- * Because this firmware is entirely board-specific, this file embeds
- * knowledge that would be passed as platform_data in a generic driver.
- *
- * This driver was tested with firmware revision A4.
- */
-
-#if IS_ENABLED(CONFIG_INPUT_DM355EVM)
-#define msp_has_keyboard() true
-#else
-#define msp_has_keyboard() false
-#endif
-
-#if IS_ENABLED(CONFIG_LEDS_GPIO)
-#define msp_has_leds() true
-#else
-#define msp_has_leds() false
-#endif
-
-#if IS_ENABLED(CONFIG_RTC_DRV_DM355EVM)
-#define msp_has_rtc() true
-#else
-#define msp_has_rtc() false
-#endif
-
-#if IS_ENABLED(CONFIG_VIDEO_TVP514X)
-#define msp_has_tvp() true
-#else
-#define msp_has_tvp() false
-#endif
-
-
-/*----------------------------------------------------------------------*/
-
-/* REVISIT for paranoia's sake, retry reads/writes on error */
-
-static struct i2c_client *msp430;
-
-/**
- * dm355evm_msp_write - Writes a register in dm355evm_msp
- * @value: the value to be written
- * @reg: register address
- *
- * Returns result of operation - 0 is success, else negative errno
- */
-int dm355evm_msp_write(u8 value, u8 reg)
-{
- return i2c_smbus_write_byte_data(msp430, reg, value);
-}
-EXPORT_SYMBOL(dm355evm_msp_write);
-
-/**
- * dm355evm_msp_read - Reads a register from dm355evm_msp
- * @reg: register address
- *
- * Returns result of operation - value, or negative errno
- */
-int dm355evm_msp_read(u8 reg)
-{
- return i2c_smbus_read_byte_data(msp430, reg);
-}
-EXPORT_SYMBOL(dm355evm_msp_read);
-
-/*----------------------------------------------------------------------*/
-
-/*
- * Many of the msp430 pins are just used as fixed-direction GPIOs.
- * We could export a few more of them this way, if we wanted.
- */
-#define MSP_GPIO(bit, reg) ((DM355EVM_MSP_ ## reg) << 3 | (bit))
-
-static const u8 msp_gpios[] = {
- /* eight leds */
- MSP_GPIO(0, LED), MSP_GPIO(1, LED),
- MSP_GPIO(2, LED), MSP_GPIO(3, LED),
- MSP_GPIO(4, LED), MSP_GPIO(5, LED),
- MSP_GPIO(6, LED), MSP_GPIO(7, LED),
- /* SW6 and the NTSC/nPAL jumper */
- MSP_GPIO(0, SWITCH1), MSP_GPIO(1, SWITCH1),
- MSP_GPIO(2, SWITCH1), MSP_GPIO(3, SWITCH1),
- MSP_GPIO(4, SWITCH1),
- /* switches on MMC/SD sockets */
- /*
- * Note: EVMDM355_ECP_VA4.pdf suggests that Bit 2 and 4 should be
- * checked for card detection. However on the EVM bit 1 and 3 gives
- * this status, for 0 and 1 instance respectively. The pdf also
- * suggests that Bit 1 and 3 should be checked for write protection.
- * However on the EVM bit 2 and 4 gives this status,for 0 and 1
- * instance respectively.
- */
- MSP_GPIO(2, SDMMC), MSP_GPIO(1, SDMMC), /* mmc0 WP, nCD */
- MSP_GPIO(4, SDMMC), MSP_GPIO(3, SDMMC), /* mmc1 WP, nCD */
-};
-
-static struct gpio_led evm_leds[] = {
- { .name = "dm355evm::ds14",
- .default_trigger = "heartbeat", },
- { .name = "dm355evm::ds15",
- .default_trigger = "mmc0", },
- { .name = "dm355evm::ds16",
- /* could also be a CE-ATA drive */
- .default_trigger = "mmc1", },
- { .name = "dm355evm::ds17",
- .default_trigger = "nand-disk", },
- { .name = "dm355evm::ds18", },
- { .name = "dm355evm::ds19", },
- { .name = "dm355evm::ds20", },
- { .name = "dm355evm::ds21", },
-};
-
-static struct gpio_led_platform_data evm_led_data = {
- .num_leds = ARRAY_SIZE(evm_leds),
- .leds = evm_leds,
-};
-
-static struct gpiod_lookup_table evm_leds_gpio_table = {
- .dev_id = "leds-gpio",
- .table = {
- /*
- * These GPIOs are on the dm355evm_msp
- * GPIO chip at index 0..7
- */
- GPIO_LOOKUP_IDX("dm355evm_msp", 0, NULL,
- 0, GPIO_ACTIVE_LOW),
- GPIO_LOOKUP_IDX("dm355evm_msp", 1, NULL,
- 1, GPIO_ACTIVE_LOW),
- GPIO_LOOKUP_IDX("dm355evm_msp", 2, NULL,
- 2, GPIO_ACTIVE_LOW),
- GPIO_LOOKUP_IDX("dm355evm_msp", 3, NULL,
- 3, GPIO_ACTIVE_LOW),
- GPIO_LOOKUP_IDX("dm355evm_msp", 4, NULL,
- 4, GPIO_ACTIVE_LOW),
- GPIO_LOOKUP_IDX("dm355evm_msp", 5, NULL,
- 5, GPIO_ACTIVE_LOW),
- GPIO_LOOKUP_IDX("dm355evm_msp", 6, NULL,
- 6, GPIO_ACTIVE_LOW),
- GPIO_LOOKUP_IDX("dm355evm_msp", 7, NULL,
- 7, GPIO_ACTIVE_LOW),
- { },
- },
-};
-
-#define MSP_GPIO_REG(offset) (msp_gpios[(offset)] >> 3)
-#define MSP_GPIO_MASK(offset) BIT(msp_gpios[(offset)] & 0x07)
-
-static int msp_gpio_in(struct gpio_chip *chip, unsigned offset)
-{
- switch (MSP_GPIO_REG(offset)) {
- case DM355EVM_MSP_SWITCH1:
- case DM355EVM_MSP_SWITCH2:
- case DM355EVM_MSP_SDMMC:
- return 0;
- default:
- return -EINVAL;
- }
-}
-
-static u8 msp_led_cache;
-
-static int msp_gpio_get(struct gpio_chip *chip, unsigned offset)
-{
- int reg, status;
-
- reg = MSP_GPIO_REG(offset);
- status = dm355evm_msp_read(reg);
- if (status < 0)
- return status;
- if (reg == DM355EVM_MSP_LED)
- msp_led_cache = status;
- return !!(status & MSP_GPIO_MASK(offset));
-}
-
-static int msp_gpio_out(struct gpio_chip *chip, unsigned offset, int value)
-{
- int mask, bits;
-
- /* NOTE: there are some other signals that could be
- * packaged as output GPIOs, but they aren't as useful
- * as the LEDs ... so for now we don't.
- */
- if (MSP_GPIO_REG(offset) != DM355EVM_MSP_LED)
- return -EINVAL;
-
- mask = MSP_GPIO_MASK(offset);
- bits = msp_led_cache;
-
- bits &= ~mask;
- if (value)
- bits |= mask;
- msp_led_cache = bits;
-
- return dm355evm_msp_write(bits, DM355EVM_MSP_LED);
-}
-
-static void msp_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
-{
- msp_gpio_out(chip, offset, value);
-}
-
-static struct gpio_chip dm355evm_msp_gpio = {
- .label = "dm355evm_msp",
- .owner = THIS_MODULE,
- .direction_input = msp_gpio_in,
- .get = msp_gpio_get,
- .direction_output = msp_gpio_out,
- .set = msp_gpio_set,
- .base = -EINVAL, /* dynamic assignment */
- .ngpio = ARRAY_SIZE(msp_gpios),
- .can_sleep = true,
-};
-
-/*----------------------------------------------------------------------*/
-
-static struct device *add_child(struct i2c_client *client, const char *name,
- void *pdata, unsigned pdata_len,
- bool can_wakeup, int irq)
-{
- struct platform_device *pdev;
- int status;
-
- pdev = platform_device_alloc(name, -1);
- if (!pdev)
- return ERR_PTR(-ENOMEM);
-
- device_init_wakeup(&pdev->dev, can_wakeup);
- pdev->dev.parent = &client->dev;
-
- if (pdata) {
- status = platform_device_add_data(pdev, pdata, pdata_len);
- if (status < 0) {
- dev_dbg(&pdev->dev, "can't add platform_data\n");
- goto put_device;
- }
- }
-
- if (irq) {
- struct resource r = {
- .start = irq,
- .flags = IORESOURCE_IRQ,
- };
-
- status = platform_device_add_resources(pdev, &r, 1);
- if (status < 0) {
- dev_dbg(&pdev->dev, "can't add irq\n");
- goto put_device;
- }
- }
-
- status = platform_device_add(pdev);
- if (status)
- goto put_device;
-
- return &pdev->dev;
-
-put_device:
- platform_device_put(pdev);
- dev_err(&client->dev, "failed to add device %s\n", name);
- return ERR_PTR(status);
-}
-
-static int add_children(struct i2c_client *client)
-{
- static const struct {
- int offset;
- char *label;
- } config_inputs[] = {
- /* 8 == right after the LEDs */
- { 8 + 0, "sw6_1", },
- { 8 + 1, "sw6_2", },
- { 8 + 2, "sw6_3", },
- { 8 + 3, "sw6_4", },
- { 8 + 4, "NTSC/nPAL", },
- };
-
- struct device *child;
- int status;
- int i;
-
- /* GPIO-ish stuff */
- dm355evm_msp_gpio.parent = &client->dev;
- status = gpiochip_add_data(&dm355evm_msp_gpio, NULL);
- if (status < 0)
- return status;
-
- /* LED output */
- if (msp_has_leds()) {
- gpiod_add_lookup_table(&evm_leds_gpio_table);
- /* NOTE: these are the only fully programmable LEDs
- * on the board, since GPIO-61/ds22 (and many signals
- * going to DC7) must be used for AEMIF address lines
- * unless the top 1 GB of NAND is unused...
- */
- child = add_child(client, "leds-gpio",
- &evm_led_data, sizeof(evm_led_data),
- false, 0);
- if (IS_ERR(child))
- return PTR_ERR(child);
- }
-
- /* configuration inputs */
- for (i = 0; i < ARRAY_SIZE(config_inputs); i++) {
- int gpio = dm355evm_msp_gpio.base + config_inputs[i].offset;
-
- gpio_request_one(gpio, GPIOF_IN, config_inputs[i].label);
-
- /* make it easy for userspace to see these */
- gpio_export(gpio, false);
- }
-
- /* MMC/SD inputs -- right after the last config input */
- if (dev_get_platdata(&client->dev)) {
- void (*mmcsd_setup)(unsigned) = dev_get_platdata(&client->dev);
-
- mmcsd_setup(dm355evm_msp_gpio.base + 8 + 5);
- }
-
- /* RTC is a 32 bit counter, no alarm */
- if (msp_has_rtc()) {
- child = add_child(client, "rtc-dm355evm",
- NULL, 0, false, 0);
- if (IS_ERR(child))
- return PTR_ERR(child);
- }
-
- /* input from buttons and IR remote (uses the IRQ) */
- if (msp_has_keyboard()) {
- child = add_child(client, "dm355evm_keys",
- NULL, 0, true, client->irq);
- if (IS_ERR(child))
- return PTR_ERR(child);
- }
-
- return 0;
-}
-
-/*----------------------------------------------------------------------*/
-
-static void dm355evm_command(unsigned command)
-{
- int status;
-
- status = dm355evm_msp_write(command, DM355EVM_MSP_COMMAND);
- if (status < 0)
- dev_err(&msp430->dev, "command %d failure %d\n",
- command, status);
-}
-
-static void dm355evm_power_off(void)
-{
- dm355evm_command(MSP_COMMAND_POWEROFF);
-}
-
-static void dm355evm_msp_remove(struct i2c_client *client)
-{
- pm_power_off = NULL;
- msp430 = NULL;
-}
-
-static int
-dm355evm_msp_probe(struct i2c_client *client, const struct i2c_device_id *id)
-{
- int status;
- const char *video = msp_has_tvp() ? "TVP5146" : "imager";
-
- if (msp430)
- return -EBUSY;
- msp430 = client;
-
- /* display revision status; doubles as sanity check */
- status = dm355evm_msp_read(DM355EVM_MSP_FIRMREV);
- if (status < 0)
- goto fail;
- dev_info(&client->dev, "firmware v.%02X, %s as video-in\n",
- status, video);
-
- /* mux video input: either tvp5146 or some external imager */
- status = dm355evm_msp_write(msp_has_tvp() ? 0 : MSP_VIDEO_IMAGER,
- DM355EVM_MSP_VIDEO_IN);
- if (status < 0)
- dev_warn(&client->dev, "error %d muxing %s as video-in\n",
- status, video);
-
- /* init LED cache, and turn off the LEDs */
- msp_led_cache = 0xff;
- dm355evm_msp_write(msp_led_cache, DM355EVM_MSP_LED);
-
- /* export capabilities we support */
- status = add_children(client);
- if (status < 0)
- goto fail;
-
- /* PM hookup */
- pm_power_off = dm355evm_power_off;
-
- return 0;
-
-fail:
- /* FIXME remove children ... */
- dm355evm_msp_remove(client);
- return status;
-}
-
-static const struct i2c_device_id dm355evm_msp_ids[] = {
- { "dm355evm_msp", 0 },
- { /* end of list */ },
-};
-MODULE_DEVICE_TABLE(i2c, dm355evm_msp_ids);
-
-static struct i2c_driver dm355evm_msp_driver = {
- .driver.name = "dm355evm_msp",
- .id_table = dm355evm_msp_ids,
- .probe = dm355evm_msp_probe,
- .remove = dm355evm_msp_remove,
-};
-
-static int __init dm355evm_msp_init(void)
-{
- return i2c_add_driver(&dm355evm_msp_driver);
-}
-subsys_initcall(dm355evm_msp_init);
-
-static void __exit dm355evm_msp_exit(void)
-{
- i2c_del_driver(&dm355evm_msp_driver);
-}
-module_exit(dm355evm_msp_exit);
-
-MODULE_DESCRIPTION("Interface to MSP430 firmware on DM355EVM");
-MODULE_LICENSE("GPL");
diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig
index bb63edb507da..35298c651730 100644
--- a/drivers/rtc/Kconfig
+++ b/drivers/rtc/Kconfig
@@ -540,12 +540,6 @@ config RTC_DRV_BQ32K
This driver can also be built as a module. If so, the module
will be called rtc-bq32k.
-config RTC_DRV_DM355EVM
- tristate "TI DaVinci DM355 EVM RTC"
- depends on MFD_DM355EVM_MSP
- help
- Supports the RTC firmware in the MSP430 on the DM355 EVM.
-
config RTC_DRV_TWL92330
bool "TI TWL92330/Menelaus"
depends on MENELAUS
diff --git a/drivers/rtc/Makefile b/drivers/rtc/Makefile
index aab22bc63432..c2d474985919 100644
--- a/drivers/rtc/Makefile
+++ b/drivers/rtc/Makefile
@@ -46,7 +46,6 @@ obj-$(CONFIG_RTC_DRV_DA9055) += rtc-da9055.o
obj-$(CONFIG_RTC_DRV_DA9063) += rtc-da9063.o
obj-$(CONFIG_RTC_DRV_DAVINCI) += rtc-davinci.o
obj-$(CONFIG_RTC_DRV_DIGICOLOR) += rtc-digicolor.o
-obj-$(CONFIG_RTC_DRV_DM355EVM) += rtc-dm355evm.o
obj-$(CONFIG_RTC_DRV_DS1216) += rtc-ds1216.o
obj-$(CONFIG_RTC_DRV_DS1286) += rtc-ds1286.o
obj-$(CONFIG_RTC_DRV_DS1302) += rtc-ds1302.o
diff --git a/drivers/rtc/rtc-dm355evm.c b/drivers/rtc/rtc-dm355evm.c
deleted file mode 100644
index 94fb16ac3e0f..000000000000
--- a/drivers/rtc/rtc-dm355evm.c
+++ /dev/null
@@ -1,151 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
- * rtc-dm355evm.c - access battery-backed counter in MSP430 firmware
- *
- * Copyright (c) 2008 by David Brownell
- */
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/rtc.h>
-#include <linux/platform_device.h>
-
-#include <linux/mfd/dm355evm_msp.h>
-#include <linux/module.h>
-
-
-/*
- * The MSP430 firmware on the DM355 EVM uses a watch crystal to feed
- * a 1 Hz counter. When a backup battery is supplied, that makes a
- * reasonable RTC for applications where alarms and non-NTP drift
- * compensation aren't important.
- *
- * The only real glitch is the inability to read or write all four
- * counter bytes atomically: the count may increment in the middle
- * of an operation, causing trouble when the LSB rolls over.
- *
- * This driver was tested with firmware revision A4.
- */
-union evm_time {
- u8 bytes[4];
- u32 value;
-};
-
-static int dm355evm_rtc_read_time(struct device *dev, struct rtc_time *tm)
-{
- union evm_time time;
- int status;
- int tries = 0;
-
- do {
- /*
- * Read LSB(0) to MSB(3) bytes. Defend against the counter
- * rolling over by re-reading until the value is stable,
- * and assuming the four reads take at most a few seconds.
- */
- status = dm355evm_msp_read(DM355EVM_MSP_RTC_0);
- if (status < 0)
- return status;
- if (tries && time.bytes[0] == status)
- break;
- time.bytes[0] = status;
-
- status = dm355evm_msp_read(DM355EVM_MSP_RTC_1);
- if (status < 0)
- return status;
- if (tries && time.bytes[1] == status)
- break;
- time.bytes[1] = status;
-
- status = dm355evm_msp_read(DM355EVM_MSP_RTC_2);
- if (status < 0)
- return status;
- if (tries && time.bytes[2] == status)
- break;
- time.bytes[2] = status;
-
- status = dm355evm_msp_read(DM355EVM_MSP_RTC_3);
- if (status < 0)
- return status;
- if (tries && time.bytes[3] == status)
- break;
- time.bytes[3] = status;
-
- } while (++tries < 5);
-
- dev_dbg(dev, "read timestamp %08x\n", time.value);
-
- rtc_time64_to_tm(le32_to_cpu(time.value), tm);
- return 0;
-}
-
-static int dm355evm_rtc_set_time(struct device *dev, struct rtc_time *tm)
-{
- union evm_time time;
- unsigned long value;
- int status;
-
- value = rtc_tm_to_time64(tm);
- time.value = cpu_to_le32(value);
-
- dev_dbg(dev, "write timestamp %08x\n", time.value);
-
- /*
- * REVISIT handle non-atomic writes ... maybe just retry until
- * byte[1] sticks (no rollover)?
- */
- status = dm355evm_msp_write(time.bytes[0], DM355EVM_MSP_RTC_0);
- if (status < 0)
- return status;
-
- status = dm355evm_msp_write(time.bytes[1], DM355EVM_MSP_RTC_1);
- if (status < 0)
- return status;
-
- status = dm355evm_msp_write(time.bytes[2], DM355EVM_MSP_RTC_2);
- if (status < 0)
- return status;
-
- status = dm355evm_msp_write(time.bytes[3], DM355EVM_MSP_RTC_3);
- if (status < 0)
- return status;
-
- return 0;
-}
-
-static const struct rtc_class_ops dm355evm_rtc_ops = {
- .read_time = dm355evm_rtc_read_time,
- .set_time = dm355evm_rtc_set_time,
-};
-
-/*----------------------------------------------------------------------*/
-
-static int dm355evm_rtc_probe(struct platform_device *pdev)
-{
- struct rtc_device *rtc;
-
- rtc = devm_rtc_allocate_device(&pdev->dev);
- if (IS_ERR(rtc))
- return PTR_ERR(rtc);
-
- platform_set_drvdata(pdev, rtc);
-
- rtc->ops = &dm355evm_rtc_ops;
- rtc->range_max = U32_MAX;
-
- return devm_rtc_register_device(rtc);
-}
-
-/*
- * I2C is used to talk to the MSP430, but this platform device is
- * exposed by an MFD driver that manages I2C communications.
- */
-static struct platform_driver rtc_dm355evm_driver = {
- .probe = dm355evm_rtc_probe,
- .driver = {
- .name = "rtc-dm355evm",
- },
-};
-
-module_platform_driver(rtc_dm355evm_driver);
-
-MODULE_LICENSE("GPL");
diff --git a/include/linux/mfd/dm355evm_msp.h b/include/linux/mfd/dm355evm_msp.h
deleted file mode 100644
index 372470350fab..000000000000
--- a/include/linux/mfd/dm355evm_msp.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * dm355evm_msp.h - support MSP430 microcontroller on DM355EVM board
- */
-#ifndef __LINUX_I2C_DM355EVM_MSP
-#define __LINUX_I2C_DM355EVM_MSP
-
-/*
- * Written against Spectrum's writeup for the A4 firmware revision,
- * and tweaked to match source and rev D2 schematics by removing CPLD
- * and NOR flash hooks (which were last appropriate in rev B boards).
- *
- * Note that the firmware supports a flavor of write posting ... to be
- * sure a write completes, issue another read or write.
- */
-
-/* utilities to access "registers" emulated by msp430 firmware */
-extern int dm355evm_msp_write(u8 value, u8 reg);
-extern int dm355evm_msp_read(u8 reg);
-
-
-/* command/control registers */
-#define DM355EVM_MSP_COMMAND 0x00
-# define MSP_COMMAND_NULL 0
-# define MSP_COMMAND_RESET_COLD 1
-# define MSP_COMMAND_RESET_WARM 2
-# define MSP_COMMAND_RESET_WARM_I 3
-# define MSP_COMMAND_POWEROFF 4
-# define MSP_COMMAND_IR_REINIT 5
-#define DM355EVM_MSP_STATUS 0x01
-# define MSP_STATUS_BAD_OFFSET BIT(0)
-# define MSP_STATUS_BAD_COMMAND BIT(1)
-# define MSP_STATUS_POWER_ERROR BIT(2)
-# define MSP_STATUS_RXBUF_OVERRUN BIT(3)
-#define DM355EVM_MSP_RESET 0x02 /* 0 bits == in reset */
-# define MSP_RESET_DC5 BIT(0)
-# define MSP_RESET_TVP5154 BIT(2)
-# define MSP_RESET_IMAGER BIT(3)
-# define MSP_RESET_ETHERNET BIT(4)
-# define MSP_RESET_SYS BIT(5)
-# define MSP_RESET_AIC33 BIT(7)
-
-/* GPIO registers ... bit patterns mostly match the source MSP ports */
-#define DM355EVM_MSP_LED 0x03 /* active low (MSP P4) */
-#define DM355EVM_MSP_SWITCH1 0x04 /* (MSP P5, masked) */
-# define MSP_SWITCH1_SW6_1 BIT(0)
-# define MSP_SWITCH1_SW6_2 BIT(1)
-# define MSP_SWITCH1_SW6_3 BIT(2)
-# define MSP_SWITCH1_SW6_4 BIT(3)
-# define MSP_SWITCH1_J1 BIT(4) /* NTSC/PAL */
-# define MSP_SWITCH1_MSP_INT BIT(5) /* active low */
-#define DM355EVM_MSP_SWITCH2 0x05 /* (MSP P6, masked) */
-# define MSP_SWITCH2_SW10 BIT(3)
-# define MSP_SWITCH2_SW11 BIT(4)
-# define MSP_SWITCH2_SW12 BIT(5)
-# define MSP_SWITCH2_SW13 BIT(6)
-# define MSP_SWITCH2_SW14 BIT(7)
-#define DM355EVM_MSP_SDMMC 0x06 /* (MSP P2, masked) */
-# define MSP_SDMMC_0_WP BIT(1)
-# define MSP_SDMMC_0_CD BIT(2) /* active low */
-# define MSP_SDMMC_1_WP BIT(3)
-# define MSP_SDMMC_1_CD BIT(4) /* active low */
-#define DM355EVM_MSP_FIRMREV 0x07 /* not a GPIO (out of order) */
-#define DM355EVM_MSP_VIDEO_IN 0x08 /* (MSP P3, masked) */
-# define MSP_VIDEO_IMAGER BIT(7) /* low == tvp5146 */
-
-/* power supply registers are currently omitted */
-
-/* RTC registers */
-#define DM355EVM_MSP_RTC_0 0x12 /* LSB */
-#define DM355EVM_MSP_RTC_1 0x13
-#define DM355EVM_MSP_RTC_2 0x14
-#define DM355EVM_MSP_RTC_3 0x15 /* MSB */
-
-/* input event queue registers; code == ((HIGH << 8) | LOW) */
-#define DM355EVM_MSP_INPUT_COUNT 0x16 /* decrement by reading LOW */
-#define DM355EVM_MSP_INPUT_HIGH 0x17
-#define DM355EVM_MSP_INPUT_LOW 0x18
-
-#endif /* __LINUX_I2C_DM355EVM_MSP */
--
2.29.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [PATCH 07/14] input: remove davinci keyboard driver
2022-10-19 15:29 [PATCH 00/14] ARM: remove unused davinci board & drivers Arnd Bergmann
` (4 preceding siblings ...)
2022-10-19 15:29 ` [PATCH 06/14] mfd: remove dm355evm_msp driver Arnd Bergmann
@ 2022-10-19 15:29 ` Arnd Bergmann
2022-10-20 8:02 ` Mattijs Korpershoek
2022-10-20 11:17 ` Bartosz Golaszewski
2022-10-19 15:29 ` [PATCH 08/14] rtc: remove davinci rtc driver Arnd Bergmann
` (10 subsequent siblings)
16 siblings, 2 replies; 44+ messages in thread
From: Arnd Bergmann @ 2022-10-19 15:29 UTC (permalink / raw)
To: Sekhar Nori, Bartosz Golaszewski, linux-arm-kernel,
Dmitry Torokhov
Cc: linux-kernel, Kevin Hilman, Arnd Bergmann, Andy Shevchenko,
Mattijs Korpershoek, linux-input
From: Arnd Bergmann <arnd@arndb.de>
The dm365evm board was removed, and no other users of this
device exist.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/input/keyboard/Kconfig | 10 -
drivers/input/keyboard/Makefile | 1 -
drivers/input/keyboard/davinci_keyscan.c | 315 -----------------------
3 files changed, 326 deletions(-)
delete mode 100644 drivers/input/keyboard/davinci_keyscan.c
diff --git a/drivers/input/keyboard/Kconfig b/drivers/input/keyboard/Kconfig
index 00292118b79b..957cc6728f4c 100644
--- a/drivers/input/keyboard/Kconfig
+++ b/drivers/input/keyboard/Kconfig
@@ -657,16 +657,6 @@ config KEYBOARD_SUN4I_LRADC
To compile this driver as a module, choose M here: the
module will be called sun4i-lradc-keys.
-config KEYBOARD_DAVINCI
- tristate "TI DaVinci Key Scan"
- depends on ARCH_DAVINCI_DM365
- help
- Say Y to enable keypad module support for the TI DaVinci
- platforms (DM365).
-
- To compile this driver as a module, choose M here: the
- module will be called davinci_keyscan.
-
config KEYBOARD_IPAQ_MICRO
tristate "Buttons on Micro SoC (iPaq h3100,h3600,h3700)"
depends on MFD_IPAQ_MICRO
diff --git a/drivers/input/keyboard/Makefile b/drivers/input/keyboard/Makefile
index 5f67196bb2c1..5ccfdf5c0222 100644
--- a/drivers/input/keyboard/Makefile
+++ b/drivers/input/keyboard/Makefile
@@ -18,7 +18,6 @@ obj-$(CONFIG_KEYBOARD_CAP11XX) += cap11xx.o
obj-$(CONFIG_KEYBOARD_CLPS711X) += clps711x-keypad.o
obj-$(CONFIG_KEYBOARD_CROS_EC) += cros_ec_keyb.o
obj-$(CONFIG_KEYBOARD_CYPRESS_SF) += cypress-sf.o
-obj-$(CONFIG_KEYBOARD_DAVINCI) += davinci_keyscan.o
obj-$(CONFIG_KEYBOARD_DLINK_DIR685) += dlink-dir685-touchkeys.o
obj-$(CONFIG_KEYBOARD_EP93XX) += ep93xx_keypad.o
obj-$(CONFIG_KEYBOARD_GOLDFISH_EVENTS) += goldfish_events.o
diff --git a/drivers/input/keyboard/davinci_keyscan.c b/drivers/input/keyboard/davinci_keyscan.c
deleted file mode 100644
index f489cd585b33..000000000000
--- a/drivers/input/keyboard/davinci_keyscan.c
+++ /dev/null
@@ -1,315 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-or-later
-/*
- * DaVinci Key Scan Driver for TI platforms
- *
- * Copyright (C) 2009 Texas Instruments, Inc
- *
- * Author: Miguel Aguilar <miguel.aguilar@ridgerun.com>
- *
- * Initial Code: Sandeep Paulraj <s-paulraj@ti.com>
- */
-#include <linux/module.h>
-#include <linux/init.h>
-#include <linux/interrupt.h>
-#include <linux/types.h>
-#include <linux/input.h>
-#include <linux/kernel.h>
-#include <linux/delay.h>
-#include <linux/platform_device.h>
-#include <linux/errno.h>
-#include <linux/slab.h>
-
-#include <linux/platform_data/keyscan-davinci.h>
-
-/* Key scan registers */
-#define DAVINCI_KEYSCAN_KEYCTRL 0x0000
-#define DAVINCI_KEYSCAN_INTENA 0x0004
-#define DAVINCI_KEYSCAN_INTFLAG 0x0008
-#define DAVINCI_KEYSCAN_INTCLR 0x000c
-#define DAVINCI_KEYSCAN_STRBWIDTH 0x0010
-#define DAVINCI_KEYSCAN_INTERVAL 0x0014
-#define DAVINCI_KEYSCAN_CONTTIME 0x0018
-#define DAVINCI_KEYSCAN_CURRENTST 0x001c
-#define DAVINCI_KEYSCAN_PREVSTATE 0x0020
-#define DAVINCI_KEYSCAN_EMUCTRL 0x0024
-#define DAVINCI_KEYSCAN_IODFTCTRL 0x002c
-
-/* Key Control Register (KEYCTRL) */
-#define DAVINCI_KEYSCAN_KEYEN 0x00000001
-#define DAVINCI_KEYSCAN_PREVMODE 0x00000002
-#define DAVINCI_KEYSCAN_CHATOFF 0x00000004
-#define DAVINCI_KEYSCAN_AUTODET 0x00000008
-#define DAVINCI_KEYSCAN_SCANMODE 0x00000010
-#define DAVINCI_KEYSCAN_OUTTYPE 0x00000020
-
-/* Masks for the interrupts */
-#define DAVINCI_KEYSCAN_INT_CONT 0x00000008
-#define DAVINCI_KEYSCAN_INT_OFF 0x00000004
-#define DAVINCI_KEYSCAN_INT_ON 0x00000002
-#define DAVINCI_KEYSCAN_INT_CHANGE 0x00000001
-#define DAVINCI_KEYSCAN_INT_ALL 0x0000000f
-
-struct davinci_ks {
- struct input_dev *input;
- struct davinci_ks_platform_data *pdata;
- int irq;
- void __iomem *base;
- resource_size_t pbase;
- size_t base_size;
- unsigned short keymap[];
-};
-
-/* Initializing the kp Module */
-static int __init davinci_ks_initialize(struct davinci_ks *davinci_ks)
-{
- struct device *dev = &davinci_ks->input->dev;
- struct davinci_ks_platform_data *pdata = davinci_ks->pdata;
- u32 matrix_ctrl;
-
- /* Enable all interrupts */
- __raw_writel(DAVINCI_KEYSCAN_INT_ALL,
- davinci_ks->base + DAVINCI_KEYSCAN_INTENA);
-
- /* Clear interrupts if any */
- __raw_writel(DAVINCI_KEYSCAN_INT_ALL,
- davinci_ks->base + DAVINCI_KEYSCAN_INTCLR);
-
- /* Setup the scan period = strobe + interval */
- __raw_writel(pdata->strobe,
- davinci_ks->base + DAVINCI_KEYSCAN_STRBWIDTH);
- __raw_writel(pdata->interval,
- davinci_ks->base + DAVINCI_KEYSCAN_INTERVAL);
- __raw_writel(0x01,
- davinci_ks->base + DAVINCI_KEYSCAN_CONTTIME);
-
- /* Define matrix type */
- switch (pdata->matrix_type) {
- case DAVINCI_KEYSCAN_MATRIX_4X4:
- matrix_ctrl = 0;
- break;
- case DAVINCI_KEYSCAN_MATRIX_5X3:
- matrix_ctrl = (1 << 6);
- break;
- default:
- dev_err(dev->parent, "wrong matrix type\n");
- return -EINVAL;
- }
-
- /* Enable key scan module and set matrix type */
- __raw_writel(DAVINCI_KEYSCAN_AUTODET | DAVINCI_KEYSCAN_KEYEN |
- matrix_ctrl, davinci_ks->base + DAVINCI_KEYSCAN_KEYCTRL);
-
- return 0;
-}
-
-static irqreturn_t davinci_ks_interrupt(int irq, void *dev_id)
-{
- struct davinci_ks *davinci_ks = dev_id;
- struct device *dev = &davinci_ks->input->dev;
- unsigned short *keymap = davinci_ks->keymap;
- int keymapsize = davinci_ks->pdata->keymapsize;
- u32 prev_status, new_status, changed;
- bool release;
- int keycode = KEY_UNKNOWN;
- int i;
-
- /* Disable interrupt */
- __raw_writel(0x0, davinci_ks->base + DAVINCI_KEYSCAN_INTENA);
-
- /* Reading previous and new status of the key scan */
- prev_status = __raw_readl(davinci_ks->base + DAVINCI_KEYSCAN_PREVSTATE);
- new_status = __raw_readl(davinci_ks->base + DAVINCI_KEYSCAN_CURRENTST);
-
- changed = prev_status ^ new_status;
-
- if (changed) {
- /*
- * It goes through all bits in 'changed' to ensure
- * that no key changes are being missed
- */
- for (i = 0 ; i < keymapsize; i++) {
- if ((changed>>i) & 0x1) {
- keycode = keymap[i];
- release = (new_status >> i) & 0x1;
- dev_dbg(dev->parent, "key %d %s\n", keycode,
- release ? "released" : "pressed");
- input_report_key(davinci_ks->input, keycode,
- !release);
- input_sync(davinci_ks->input);
- }
- }
- /* Clearing interrupt */
- __raw_writel(DAVINCI_KEYSCAN_INT_ALL,
- davinci_ks->base + DAVINCI_KEYSCAN_INTCLR);
- }
-
- /* Enable interrupts */
- __raw_writel(0x1, davinci_ks->base + DAVINCI_KEYSCAN_INTENA);
-
- return IRQ_HANDLED;
-}
-
-static int __init davinci_ks_probe(struct platform_device *pdev)
-{
- struct davinci_ks *davinci_ks;
- struct input_dev *key_dev;
- struct resource *res, *mem;
- struct device *dev = &pdev->dev;
- struct davinci_ks_platform_data *pdata = dev_get_platdata(dev);
- int error, i;
-
- if (pdata->device_enable) {
- error = pdata->device_enable(dev);
- if (error < 0) {
- dev_dbg(dev, "device enable function failed\n");
- return error;
- }
- }
-
- if (!pdata->keymap) {
- dev_dbg(dev, "no keymap from pdata\n");
- return -EINVAL;
- }
-
- davinci_ks = kzalloc(sizeof(struct davinci_ks) +
- sizeof(unsigned short) * pdata->keymapsize, GFP_KERNEL);
- if (!davinci_ks) {
- dev_dbg(dev, "could not allocate memory for private data\n");
- return -ENOMEM;
- }
-
- memcpy(davinci_ks->keymap, pdata->keymap,
- sizeof(unsigned short) * pdata->keymapsize);
-
- key_dev = input_allocate_device();
- if (!key_dev) {
- dev_dbg(dev, "could not allocate input device\n");
- error = -ENOMEM;
- goto fail1;
- }
-
- davinci_ks->input = key_dev;
-
- davinci_ks->irq = platform_get_irq(pdev, 0);
- if (davinci_ks->irq < 0) {
- error = davinci_ks->irq;
- goto fail2;
- }
-
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- if (!res) {
- dev_err(dev, "no mem resource\n");
- error = -EINVAL;
- goto fail2;
- }
-
- davinci_ks->pbase = res->start;
- davinci_ks->base_size = resource_size(res);
-
- mem = request_mem_region(davinci_ks->pbase, davinci_ks->base_size,
- pdev->name);
- if (!mem) {
- dev_err(dev, "key scan registers at %08x are not free\n",
- davinci_ks->pbase);
- error = -EBUSY;
- goto fail2;
- }
-
- davinci_ks->base = ioremap(davinci_ks->pbase, davinci_ks->base_size);
- if (!davinci_ks->base) {
- dev_err(dev, "can't ioremap MEM resource.\n");
- error = -ENOMEM;
- goto fail3;
- }
-
- /* Enable auto repeat feature of Linux input subsystem */
- if (pdata->rep)
- __set_bit(EV_REP, key_dev->evbit);
-
- /* Setup input device */
- __set_bit(EV_KEY, key_dev->evbit);
-
- /* Setup the platform data */
- davinci_ks->pdata = pdata;
-
- for (i = 0; i < davinci_ks->pdata->keymapsize; i++)
- __set_bit(davinci_ks->pdata->keymap[i], key_dev->keybit);
-
- key_dev->name = "davinci_keyscan";
- key_dev->phys = "davinci_keyscan/input0";
- key_dev->dev.parent = dev;
- key_dev->id.bustype = BUS_HOST;
- key_dev->id.vendor = 0x0001;
- key_dev->id.product = 0x0001;
- key_dev->id.version = 0x0001;
- key_dev->keycode = davinci_ks->keymap;
- key_dev->keycodesize = sizeof(davinci_ks->keymap[0]);
- key_dev->keycodemax = davinci_ks->pdata->keymapsize;
-
- error = input_register_device(davinci_ks->input);
- if (error < 0) {
- dev_err(dev, "unable to register davinci key scan device\n");
- goto fail4;
- }
-
- error = request_irq(davinci_ks->irq, davinci_ks_interrupt,
- 0, pdev->name, davinci_ks);
- if (error < 0) {
- dev_err(dev, "unable to register davinci key scan interrupt\n");
- goto fail5;
- }
-
- error = davinci_ks_initialize(davinci_ks);
- if (error < 0) {
- dev_err(dev, "unable to initialize davinci key scan device\n");
- goto fail6;
- }
-
- platform_set_drvdata(pdev, davinci_ks);
- return 0;
-
-fail6:
- free_irq(davinci_ks->irq, davinci_ks);
-fail5:
- input_unregister_device(davinci_ks->input);
- key_dev = NULL;
-fail4:
- iounmap(davinci_ks->base);
-fail3:
- release_mem_region(davinci_ks->pbase, davinci_ks->base_size);
-fail2:
- input_free_device(key_dev);
-fail1:
- kfree(davinci_ks);
-
- return error;
-}
-
-static int davinci_ks_remove(struct platform_device *pdev)
-{
- struct davinci_ks *davinci_ks = platform_get_drvdata(pdev);
-
- free_irq(davinci_ks->irq, davinci_ks);
-
- input_unregister_device(davinci_ks->input);
-
- iounmap(davinci_ks->base);
- release_mem_region(davinci_ks->pbase, davinci_ks->base_size);
-
- kfree(davinci_ks);
-
- return 0;
-}
-
-static struct platform_driver davinci_ks_driver = {
- .driver = {
- .name = "davinci_keyscan",
- },
- .remove = davinci_ks_remove,
-};
-
-module_platform_driver_probe(davinci_ks_driver, davinci_ks_probe);
-
-MODULE_AUTHOR("Miguel Aguilar");
-MODULE_DESCRIPTION("Texas Instruments DaVinci Key Scan Driver");
-MODULE_LICENSE("GPL");
--
2.29.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [PATCH 08/14] rtc: remove davinci rtc driver
2022-10-19 15:29 [PATCH 00/14] ARM: remove unused davinci board & drivers Arnd Bergmann
` (5 preceding siblings ...)
2022-10-19 15:29 ` [PATCH 07/14] input: remove davinci keyboard driver Arnd Bergmann
@ 2022-10-19 15:29 ` Arnd Bergmann
2022-10-20 11:35 ` Bartosz Golaszewski
2022-10-19 15:29 ` [PATCH 09/14] ASoC: remove unused davinci support Arnd Bergmann
` (9 subsequent siblings)
16 siblings, 1 reply; 44+ messages in thread
From: Arnd Bergmann @ 2022-10-19 15:29 UTC (permalink / raw)
To: Sekhar Nori, Bartosz Golaszewski, linux-arm-kernel,
Alessandro Zummo, Alexandre Belloni
Cc: linux-kernel, Kevin Hilman, Arnd Bergmann, linux-rtc
From: Arnd Bergmann <arnd@arndb.de>
The Davinci dm365 SoC support was removed, so the rtc driver
has no remaining users.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/rtc/Kconfig | 10 -
drivers/rtc/Makefile | 1 -
drivers/rtc/rtc-davinci.c | 512 --------------------------------------
3 files changed, 523 deletions(-)
delete mode 100644 drivers/rtc/rtc-davinci.c
diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig
index 35298c651730..ab9a1f814119 100644
--- a/drivers/rtc/Kconfig
+++ b/drivers/rtc/Kconfig
@@ -1345,16 +1345,6 @@ config RTC_DRV_ASM9260
This driver can also be built as a module. If so, the module
will be called rtc-asm9260.
-config RTC_DRV_DAVINCI
- tristate "TI DaVinci RTC"
- depends on ARCH_DAVINCI_DM365 || COMPILE_TEST
- help
- If you say yes here you get support for the RTC on the
- DaVinci platforms (DM365).
-
- This driver can also be built as a module. If so, the module
- will be called rtc-davinci.
-
config RTC_DRV_DIGICOLOR
tristate "Conexant Digicolor RTC"
depends on ARCH_DIGICOLOR || COMPILE_TEST
diff --git a/drivers/rtc/Makefile b/drivers/rtc/Makefile
index c2d474985919..d3c042dcbc73 100644
--- a/drivers/rtc/Makefile
+++ b/drivers/rtc/Makefile
@@ -44,7 +44,6 @@ obj-$(CONFIG_RTC_DRV_CROS_EC) += rtc-cros-ec.o
obj-$(CONFIG_RTC_DRV_DA9052) += rtc-da9052.o
obj-$(CONFIG_RTC_DRV_DA9055) += rtc-da9055.o
obj-$(CONFIG_RTC_DRV_DA9063) += rtc-da9063.o
-obj-$(CONFIG_RTC_DRV_DAVINCI) += rtc-davinci.o
obj-$(CONFIG_RTC_DRV_DIGICOLOR) += rtc-digicolor.o
obj-$(CONFIG_RTC_DRV_DS1216) += rtc-ds1216.o
obj-$(CONFIG_RTC_DRV_DS1286) += rtc-ds1286.o
diff --git a/drivers/rtc/rtc-davinci.c b/drivers/rtc/rtc-davinci.c
deleted file mode 100644
index 6bef0f2353da..000000000000
--- a/drivers/rtc/rtc-davinci.c
+++ /dev/null
@@ -1,512 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-or-later
-/*
- * DaVinci Power Management and Real Time Clock Driver for TI platforms
- *
- * Copyright (C) 2009 Texas Instruments, Inc
- *
- * Author: Miguel Aguilar <miguel.aguilar@ridgerun.com>
- */
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/module.h>
-#include <linux/ioport.h>
-#include <linux/delay.h>
-#include <linux/spinlock.h>
-#include <linux/rtc.h>
-#include <linux/bcd.h>
-#include <linux/platform_device.h>
-#include <linux/io.h>
-#include <linux/slab.h>
-
-/*
- * The DaVinci RTC is a simple RTC with the following
- * Sec: 0 - 59 : BCD count
- * Min: 0 - 59 : BCD count
- * Hour: 0 - 23 : BCD count
- * Day: 0 - 0x7FFF(32767) : Binary count ( Over 89 years )
- */
-
-/* PRTC interface registers */
-#define DAVINCI_PRTCIF_PID 0x00
-#define PRTCIF_CTLR 0x04
-#define PRTCIF_LDATA 0x08
-#define PRTCIF_UDATA 0x0C
-#define PRTCIF_INTEN 0x10
-#define PRTCIF_INTFLG 0x14
-
-/* PRTCIF_CTLR bit fields */
-#define PRTCIF_CTLR_BUSY BIT(31)
-#define PRTCIF_CTLR_SIZE BIT(25)
-#define PRTCIF_CTLR_DIR BIT(24)
-#define PRTCIF_CTLR_BENU_MSB BIT(23)
-#define PRTCIF_CTLR_BENU_3RD_BYTE BIT(22)
-#define PRTCIF_CTLR_BENU_2ND_BYTE BIT(21)
-#define PRTCIF_CTLR_BENU_LSB BIT(20)
-#define PRTCIF_CTLR_BENU_MASK (0x00F00000)
-#define PRTCIF_CTLR_BENL_MSB BIT(19)
-#define PRTCIF_CTLR_BENL_3RD_BYTE BIT(18)
-#define PRTCIF_CTLR_BENL_2ND_BYTE BIT(17)
-#define PRTCIF_CTLR_BENL_LSB BIT(16)
-#define PRTCIF_CTLR_BENL_MASK (0x000F0000)
-
-/* PRTCIF_INTEN bit fields */
-#define PRTCIF_INTEN_RTCSS BIT(1)
-#define PRTCIF_INTEN_RTCIF BIT(0)
-#define PRTCIF_INTEN_MASK (PRTCIF_INTEN_RTCSS \
- | PRTCIF_INTEN_RTCIF)
-
-/* PRTCIF_INTFLG bit fields */
-#define PRTCIF_INTFLG_RTCSS BIT(1)
-#define PRTCIF_INTFLG_RTCIF BIT(0)
-#define PRTCIF_INTFLG_MASK (PRTCIF_INTFLG_RTCSS \
- | PRTCIF_INTFLG_RTCIF)
-
-/* PRTC subsystem registers */
-#define PRTCSS_RTC_INTC_EXTENA1 (0x0C)
-#define PRTCSS_RTC_CTRL (0x10)
-#define PRTCSS_RTC_WDT (0x11)
-#define PRTCSS_RTC_TMR0 (0x12)
-#define PRTCSS_RTC_TMR1 (0x13)
-#define PRTCSS_RTC_CCTRL (0x14)
-#define PRTCSS_RTC_SEC (0x15)
-#define PRTCSS_RTC_MIN (0x16)
-#define PRTCSS_RTC_HOUR (0x17)
-#define PRTCSS_RTC_DAY0 (0x18)
-#define PRTCSS_RTC_DAY1 (0x19)
-#define PRTCSS_RTC_AMIN (0x1A)
-#define PRTCSS_RTC_AHOUR (0x1B)
-#define PRTCSS_RTC_ADAY0 (0x1C)
-#define PRTCSS_RTC_ADAY1 (0x1D)
-#define PRTCSS_RTC_CLKC_CNT (0x20)
-
-/* PRTCSS_RTC_INTC_EXTENA1 */
-#define PRTCSS_RTC_INTC_EXTENA1_MASK (0x07)
-
-/* PRTCSS_RTC_CTRL bit fields */
-#define PRTCSS_RTC_CTRL_WDTBUS BIT(7)
-#define PRTCSS_RTC_CTRL_WEN BIT(6)
-#define PRTCSS_RTC_CTRL_WDRT BIT(5)
-#define PRTCSS_RTC_CTRL_WDTFLG BIT(4)
-#define PRTCSS_RTC_CTRL_TE BIT(3)
-#define PRTCSS_RTC_CTRL_TIEN BIT(2)
-#define PRTCSS_RTC_CTRL_TMRFLG BIT(1)
-#define PRTCSS_RTC_CTRL_TMMD BIT(0)
-
-/* PRTCSS_RTC_CCTRL bit fields */
-#define PRTCSS_RTC_CCTRL_CALBUSY BIT(7)
-#define PRTCSS_RTC_CCTRL_DAEN BIT(5)
-#define PRTCSS_RTC_CCTRL_HAEN BIT(4)
-#define PRTCSS_RTC_CCTRL_MAEN BIT(3)
-#define PRTCSS_RTC_CCTRL_ALMFLG BIT(2)
-#define PRTCSS_RTC_CCTRL_AIEN BIT(1)
-#define PRTCSS_RTC_CCTRL_CAEN BIT(0)
-
-static DEFINE_SPINLOCK(davinci_rtc_lock);
-
-struct davinci_rtc {
- struct rtc_device *rtc;
- void __iomem *base;
- int irq;
-};
-
-static inline void rtcif_write(struct davinci_rtc *davinci_rtc,
- u32 val, u32 addr)
-{
- writel(val, davinci_rtc->base + addr);
-}
-
-static inline u32 rtcif_read(struct davinci_rtc *davinci_rtc, u32 addr)
-{
- return readl(davinci_rtc->base + addr);
-}
-
-static inline void rtcif_wait(struct davinci_rtc *davinci_rtc)
-{
- while (rtcif_read(davinci_rtc, PRTCIF_CTLR) & PRTCIF_CTLR_BUSY)
- cpu_relax();
-}
-
-static inline void rtcss_write(struct davinci_rtc *davinci_rtc,
- unsigned long val, u8 addr)
-{
- rtcif_wait(davinci_rtc);
-
- rtcif_write(davinci_rtc, PRTCIF_CTLR_BENL_LSB | addr, PRTCIF_CTLR);
- rtcif_write(davinci_rtc, val, PRTCIF_LDATA);
-
- rtcif_wait(davinci_rtc);
-}
-
-static inline u8 rtcss_read(struct davinci_rtc *davinci_rtc, u8 addr)
-{
- rtcif_wait(davinci_rtc);
-
- rtcif_write(davinci_rtc, PRTCIF_CTLR_DIR | PRTCIF_CTLR_BENL_LSB | addr,
- PRTCIF_CTLR);
-
- rtcif_wait(davinci_rtc);
-
- return rtcif_read(davinci_rtc, PRTCIF_LDATA);
-}
-
-static inline void davinci_rtcss_calendar_wait(struct davinci_rtc *davinci_rtc)
-{
- while (rtcss_read(davinci_rtc, PRTCSS_RTC_CCTRL) &
- PRTCSS_RTC_CCTRL_CALBUSY)
- cpu_relax();
-}
-
-static irqreturn_t davinci_rtc_interrupt(int irq, void *class_dev)
-{
- struct davinci_rtc *davinci_rtc = class_dev;
- unsigned long events = 0;
- u32 irq_flg;
- u8 alm_irq, tmr_irq;
- u8 rtc_ctrl, rtc_cctrl;
- int ret = IRQ_NONE;
-
- irq_flg = rtcif_read(davinci_rtc, PRTCIF_INTFLG) &
- PRTCIF_INTFLG_RTCSS;
-
- alm_irq = rtcss_read(davinci_rtc, PRTCSS_RTC_CCTRL) &
- PRTCSS_RTC_CCTRL_ALMFLG;
-
- tmr_irq = rtcss_read(davinci_rtc, PRTCSS_RTC_CTRL) &
- PRTCSS_RTC_CTRL_TMRFLG;
-
- if (irq_flg) {
- if (alm_irq) {
- events |= RTC_IRQF | RTC_AF;
- rtc_cctrl = rtcss_read(davinci_rtc, PRTCSS_RTC_CCTRL);
- rtc_cctrl |= PRTCSS_RTC_CCTRL_ALMFLG;
- rtcss_write(davinci_rtc, rtc_cctrl, PRTCSS_RTC_CCTRL);
- } else if (tmr_irq) {
- events |= RTC_IRQF | RTC_PF;
- rtc_ctrl = rtcss_read(davinci_rtc, PRTCSS_RTC_CTRL);
- rtc_ctrl |= PRTCSS_RTC_CTRL_TMRFLG;
- rtcss_write(davinci_rtc, rtc_ctrl, PRTCSS_RTC_CTRL);
- }
-
- rtcif_write(davinci_rtc, PRTCIF_INTFLG_RTCSS,
- PRTCIF_INTFLG);
- rtc_update_irq(davinci_rtc->rtc, 1, events);
-
- ret = IRQ_HANDLED;
- }
-
- return ret;
-}
-
-static int
-davinci_rtc_ioctl(struct device *dev, unsigned int cmd, unsigned long arg)
-{
- struct davinci_rtc *davinci_rtc = dev_get_drvdata(dev);
- u8 rtc_ctrl;
- unsigned long flags;
- int ret = 0;
-
- spin_lock_irqsave(&davinci_rtc_lock, flags);
-
- rtc_ctrl = rtcss_read(davinci_rtc, PRTCSS_RTC_CTRL);
-
- switch (cmd) {
- case RTC_WIE_ON:
- rtc_ctrl |= PRTCSS_RTC_CTRL_WEN | PRTCSS_RTC_CTRL_WDTFLG;
- break;
- case RTC_WIE_OFF:
- rtc_ctrl &= ~PRTCSS_RTC_CTRL_WEN;
- break;
- default:
- ret = -ENOIOCTLCMD;
- }
-
- rtcss_write(davinci_rtc, rtc_ctrl, PRTCSS_RTC_CTRL);
-
- spin_unlock_irqrestore(&davinci_rtc_lock, flags);
-
- return ret;
-}
-
-static void convertfromdays(u16 days, struct rtc_time *tm)
-{
- int tmp_days, year, mon;
-
- for (year = 2000;; year++) {
- tmp_days = rtc_year_days(1, 12, year);
- if (days >= tmp_days)
- days -= tmp_days;
- else {
- for (mon = 0;; mon++) {
- tmp_days = rtc_month_days(mon, year);
- if (days >= tmp_days) {
- days -= tmp_days;
- } else {
- tm->tm_year = year - 1900;
- tm->tm_mon = mon;
- tm->tm_mday = days + 1;
- break;
- }
- }
- break;
- }
- }
-}
-
-static void convert2days(u16 *days, struct rtc_time *tm)
-{
- int i;
- *days = 0;
-
- for (i = 2000; i < 1900 + tm->tm_year; i++)
- *days += rtc_year_days(1, 12, i);
-
- *days += rtc_year_days(tm->tm_mday, tm->tm_mon, 1900 + tm->tm_year);
-}
-
-static int davinci_rtc_read_time(struct device *dev, struct rtc_time *tm)
-{
- struct davinci_rtc *davinci_rtc = dev_get_drvdata(dev);
- u16 days = 0;
- u8 day0, day1;
- unsigned long flags;
-
- spin_lock_irqsave(&davinci_rtc_lock, flags);
-
- davinci_rtcss_calendar_wait(davinci_rtc);
- tm->tm_sec = bcd2bin(rtcss_read(davinci_rtc, PRTCSS_RTC_SEC));
-
- davinci_rtcss_calendar_wait(davinci_rtc);
- tm->tm_min = bcd2bin(rtcss_read(davinci_rtc, PRTCSS_RTC_MIN));
-
- davinci_rtcss_calendar_wait(davinci_rtc);
- tm->tm_hour = bcd2bin(rtcss_read(davinci_rtc, PRTCSS_RTC_HOUR));
-
- davinci_rtcss_calendar_wait(davinci_rtc);
- day0 = rtcss_read(davinci_rtc, PRTCSS_RTC_DAY0);
-
- davinci_rtcss_calendar_wait(davinci_rtc);
- day1 = rtcss_read(davinci_rtc, PRTCSS_RTC_DAY1);
-
- spin_unlock_irqrestore(&davinci_rtc_lock, flags);
-
- days |= day1;
- days <<= 8;
- days |= day0;
-
- convertfromdays(days, tm);
-
- return 0;
-}
-
-static int davinci_rtc_set_time(struct device *dev, struct rtc_time *tm)
-{
- struct davinci_rtc *davinci_rtc = dev_get_drvdata(dev);
- u16 days;
- u8 rtc_cctrl;
- unsigned long flags;
-
- convert2days(&days, tm);
-
- spin_lock_irqsave(&davinci_rtc_lock, flags);
-
- davinci_rtcss_calendar_wait(davinci_rtc);
- rtcss_write(davinci_rtc, bin2bcd(tm->tm_sec), PRTCSS_RTC_SEC);
-
- davinci_rtcss_calendar_wait(davinci_rtc);
- rtcss_write(davinci_rtc, bin2bcd(tm->tm_min), PRTCSS_RTC_MIN);
-
- davinci_rtcss_calendar_wait(davinci_rtc);
- rtcss_write(davinci_rtc, bin2bcd(tm->tm_hour), PRTCSS_RTC_HOUR);
-
- davinci_rtcss_calendar_wait(davinci_rtc);
- rtcss_write(davinci_rtc, days & 0xFF, PRTCSS_RTC_DAY0);
-
- davinci_rtcss_calendar_wait(davinci_rtc);
- rtcss_write(davinci_rtc, (days & 0xFF00) >> 8, PRTCSS_RTC_DAY1);
-
- rtc_cctrl = rtcss_read(davinci_rtc, PRTCSS_RTC_CCTRL);
- rtc_cctrl |= PRTCSS_RTC_CCTRL_CAEN;
- rtcss_write(davinci_rtc, rtc_cctrl, PRTCSS_RTC_CCTRL);
-
- spin_unlock_irqrestore(&davinci_rtc_lock, flags);
-
- return 0;
-}
-
-static int davinci_rtc_alarm_irq_enable(struct device *dev,
- unsigned int enabled)
-{
- struct davinci_rtc *davinci_rtc = dev_get_drvdata(dev);
- unsigned long flags;
- u8 rtc_cctrl = rtcss_read(davinci_rtc, PRTCSS_RTC_CCTRL);
-
- spin_lock_irqsave(&davinci_rtc_lock, flags);
-
- if (enabled)
- rtc_cctrl |= PRTCSS_RTC_CCTRL_DAEN |
- PRTCSS_RTC_CCTRL_HAEN |
- PRTCSS_RTC_CCTRL_MAEN |
- PRTCSS_RTC_CCTRL_ALMFLG |
- PRTCSS_RTC_CCTRL_AIEN;
- else
- rtc_cctrl &= ~PRTCSS_RTC_CCTRL_AIEN;
-
- davinci_rtcss_calendar_wait(davinci_rtc);
- rtcss_write(davinci_rtc, rtc_cctrl, PRTCSS_RTC_CCTRL);
-
- spin_unlock_irqrestore(&davinci_rtc_lock, flags);
-
- return 0;
-}
-
-static int davinci_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alm)
-{
- struct davinci_rtc *davinci_rtc = dev_get_drvdata(dev);
- u16 days = 0;
- u8 day0, day1;
- unsigned long flags;
-
- alm->time.tm_sec = 0;
-
- spin_lock_irqsave(&davinci_rtc_lock, flags);
-
- davinci_rtcss_calendar_wait(davinci_rtc);
- alm->time.tm_min = bcd2bin(rtcss_read(davinci_rtc, PRTCSS_RTC_AMIN));
-
- davinci_rtcss_calendar_wait(davinci_rtc);
- alm->time.tm_hour = bcd2bin(rtcss_read(davinci_rtc, PRTCSS_RTC_AHOUR));
-
- davinci_rtcss_calendar_wait(davinci_rtc);
- day0 = rtcss_read(davinci_rtc, PRTCSS_RTC_ADAY0);
-
- davinci_rtcss_calendar_wait(davinci_rtc);
- day1 = rtcss_read(davinci_rtc, PRTCSS_RTC_ADAY1);
-
- spin_unlock_irqrestore(&davinci_rtc_lock, flags);
- days |= day1;
- days <<= 8;
- days |= day0;
-
- convertfromdays(days, &alm->time);
-
- alm->pending = !!(rtcss_read(davinci_rtc,
- PRTCSS_RTC_CCTRL) &
- PRTCSS_RTC_CCTRL_AIEN);
- alm->enabled = alm->pending && device_may_wakeup(dev);
-
- return 0;
-}
-
-static int davinci_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alm)
-{
- struct davinci_rtc *davinci_rtc = dev_get_drvdata(dev);
- unsigned long flags;
- u16 days;
-
- convert2days(&days, &alm->time);
-
- spin_lock_irqsave(&davinci_rtc_lock, flags);
-
- davinci_rtcss_calendar_wait(davinci_rtc);
- rtcss_write(davinci_rtc, bin2bcd(alm->time.tm_min), PRTCSS_RTC_AMIN);
-
- davinci_rtcss_calendar_wait(davinci_rtc);
- rtcss_write(davinci_rtc, bin2bcd(alm->time.tm_hour), PRTCSS_RTC_AHOUR);
-
- davinci_rtcss_calendar_wait(davinci_rtc);
- rtcss_write(davinci_rtc, days & 0xFF, PRTCSS_RTC_ADAY0);
-
- davinci_rtcss_calendar_wait(davinci_rtc);
- rtcss_write(davinci_rtc, (days & 0xFF00) >> 8, PRTCSS_RTC_ADAY1);
-
- spin_unlock_irqrestore(&davinci_rtc_lock, flags);
-
- return 0;
-}
-
-static const struct rtc_class_ops davinci_rtc_ops = {
- .ioctl = davinci_rtc_ioctl,
- .read_time = davinci_rtc_read_time,
- .set_time = davinci_rtc_set_time,
- .alarm_irq_enable = davinci_rtc_alarm_irq_enable,
- .read_alarm = davinci_rtc_read_alarm,
- .set_alarm = davinci_rtc_set_alarm,
-};
-
-static int __init davinci_rtc_probe(struct platform_device *pdev)
-{
- struct device *dev = &pdev->dev;
- struct davinci_rtc *davinci_rtc;
- int ret = 0;
-
- davinci_rtc = devm_kzalloc(&pdev->dev, sizeof(struct davinci_rtc), GFP_KERNEL);
- if (!davinci_rtc)
- return -ENOMEM;
-
- davinci_rtc->irq = platform_get_irq(pdev, 0);
- if (davinci_rtc->irq < 0)
- return davinci_rtc->irq;
-
- davinci_rtc->base = devm_platform_ioremap_resource(pdev, 0);
- if (IS_ERR(davinci_rtc->base))
- return PTR_ERR(davinci_rtc->base);
-
- platform_set_drvdata(pdev, davinci_rtc);
-
- davinci_rtc->rtc = devm_rtc_allocate_device(&pdev->dev);
- if (IS_ERR(davinci_rtc->rtc))
- return PTR_ERR(davinci_rtc->rtc);
-
- davinci_rtc->rtc->ops = &davinci_rtc_ops;
- davinci_rtc->rtc->range_min = RTC_TIMESTAMP_BEGIN_2000;
- davinci_rtc->rtc->range_max = RTC_TIMESTAMP_BEGIN_2000 + (1 << 16) * 86400ULL - 1;
-
- rtcif_write(davinci_rtc, PRTCIF_INTFLG_RTCSS, PRTCIF_INTFLG);
- rtcif_write(davinci_rtc, 0, PRTCIF_INTEN);
- rtcss_write(davinci_rtc, 0, PRTCSS_RTC_INTC_EXTENA1);
-
- rtcss_write(davinci_rtc, 0, PRTCSS_RTC_CTRL);
- rtcss_write(davinci_rtc, 0, PRTCSS_RTC_CCTRL);
-
- ret = devm_request_irq(dev, davinci_rtc->irq, davinci_rtc_interrupt,
- 0, "davinci_rtc", davinci_rtc);
- if (ret < 0) {
- dev_err(dev, "unable to register davinci RTC interrupt\n");
- return ret;
- }
-
- /* Enable interrupts */
- rtcif_write(davinci_rtc, PRTCIF_INTEN_RTCSS, PRTCIF_INTEN);
- rtcss_write(davinci_rtc, PRTCSS_RTC_INTC_EXTENA1_MASK,
- PRTCSS_RTC_INTC_EXTENA1);
-
- rtcss_write(davinci_rtc, PRTCSS_RTC_CCTRL_CAEN, PRTCSS_RTC_CCTRL);
-
- device_init_wakeup(&pdev->dev, 0);
-
- return devm_rtc_register_device(davinci_rtc->rtc);
-}
-
-static int __exit davinci_rtc_remove(struct platform_device *pdev)
-{
- struct davinci_rtc *davinci_rtc = platform_get_drvdata(pdev);
-
- device_init_wakeup(&pdev->dev, 0);
-
- rtcif_write(davinci_rtc, 0, PRTCIF_INTEN);
-
- return 0;
-}
-
-static struct platform_driver davinci_rtc_driver = {
- .remove = __exit_p(davinci_rtc_remove),
- .driver = {
- .name = "rtc_davinci",
- },
-};
-
-module_platform_driver_probe(davinci_rtc_driver, davinci_rtc_probe);
-
-MODULE_AUTHOR("Miguel Aguilar <miguel.aguilar@ridgerun.com>");
-MODULE_DESCRIPTION("Texas Instruments DaVinci PRTC Driver");
-MODULE_LICENSE("GPL");
--
2.29.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [PATCH 09/14] ASoC: remove unused davinci support
2022-10-19 15:29 [PATCH 00/14] ARM: remove unused davinci board & drivers Arnd Bergmann
` (6 preceding siblings ...)
2022-10-19 15:29 ` [PATCH 08/14] rtc: remove davinci rtc driver Arnd Bergmann
@ 2022-10-19 15:29 ` Arnd Bergmann
2022-10-19 15:52 ` Mark Brown
2022-10-19 15:29 ` [PATCH 10/14] mfd: remove davinci voicecodec driver Arnd Bergmann
` (8 subsequent siblings)
16 siblings, 1 reply; 44+ messages in thread
From: Arnd Bergmann @ 2022-10-19 15:29 UTC (permalink / raw)
To: Sekhar Nori, Bartosz Golaszewski, linux-arm-kernel,
Peter Ujfalusi, Liam Girdwood, Mark Brown, Jaroslav Kysela,
Takashi Iwai
Cc: linux-kernel, Kevin Hilman, Arnd Bergmann, Charles Keepax,
alsa-devel
From: Arnd Bergmann <arnd@arndb.de>
The dm644x and dm3xx SoCs have been removed, as have the
da850_evm/da830_evm machines, the remaining machines all use the
DT based probing and do not use the vcif driver.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
sound/soc/ti/Kconfig | 40 ------
sound/soc/ti/Makefile | 2 -
sound/soc/ti/davinci-evm.c | 267 +-----------------------------------
sound/soc/ti/davinci-vcif.c | 247 ---------------------------------
4 files changed, 3 insertions(+), 553 deletions(-)
delete mode 100644 sound/soc/ti/davinci-vcif.c
diff --git a/sound/soc/ti/Kconfig b/sound/soc/ti/Kconfig
index 40110e9a9e8a..593be22503b5 100644
--- a/sound/soc/ti/Kconfig
+++ b/sound/soc/ti/Kconfig
@@ -40,13 +40,6 @@ config SND_SOC_DAVINCI_MCASP
- Keystone devices
- K3 devices (am654, j721e)
-config SND_SOC_DAVINCI_VCIF
- tristate "daVinci Voice Interface (VCIF) support"
- depends on ARCH_DAVINCI || COMPILE_TEST
- select SND_SOC_TI_EDMA_PCM
- help
- Say Y or M here if you want audio support via daVinci VCIF.
-
config SND_SOC_OMAP_DMIC
tristate "Digital Microphone Module (DMIC) support"
depends on ARCH_OMAP4 || SOC_OMAP5 || COMPILE_TEST && COMMON_CLK
@@ -177,14 +170,6 @@ config SND_SOC_OMAP_OSK5912
config SND_SOC_DAVINCI_EVM
tristate "SoC Audio support for DaVinci EVMs"
depends on ARCH_DAVINCI && I2C
- select SND_SOC_DAVINCI_ASP if MACH_DAVINCI_DM355_EVM
- select SND_SOC_DAVINCI_ASP if SND_SOC_DM365_AIC3X_CODEC
- select SND_SOC_DAVINCI_VCIF if SND_SOC_DM365_VOICE_CODEC
- select SND_SOC_DAVINCI_ASP if MACH_DAVINCI_EVM # DM6446
- select SND_SOC_DAVINCI_MCASP if MACH_DAVINCI_DM6467_EVM
- select SND_SOC_SPDIF if MACH_DAVINCI_DM6467_EVM
- select SND_SOC_DAVINCI_MCASP if MACH_DAVINCI_DA830_EVM
- select SND_SOC_DAVINCI_MCASP if MACH_DAVINCI_DA850_EVM
select SND_SOC_TLV320AIC3X
help
Say Y if you want to add support for SoC audio on the following TI
@@ -196,31 +181,6 @@ config SND_SOC_DAVINCI_EVM
- DM830
- DM850
-choice
- prompt "DM365 codec select"
- depends on SND_SOC_DAVINCI_EVM
- depends on MACH_DAVINCI_DM365_EVM
-
-config SND_SOC_DM365_AIC3X_CODEC
- bool "Audio Codec - AIC3101"
- help
- Say Y if you want to add support for AIC3101 audio codec
-
-config SND_SOC_DM365_VOICE_CODEC
- bool "Voice Codec - CQ93VC"
- help
- Say Y if you want to add support for SoC On-chip voice codec
-endchoice
-
-config SND_SOC_DM365_SELECT_VOICE_CODECS
- def_tristate y
- depends on SND_SOC_DM365_VOICE_CODEC && SND_SOC
- select MFD_DAVINCI_VOICECODEC
- select SND_SOC_CQ0093VC
- help
- The is an internal symbol needed to ensure that the codec
- and MFD driver can be built as loadable modules if necessary.
-
config SND_SOC_J721E_EVM
tristate "SoC Audio support for j721e EVM"
depends on ARCH_K3 || COMPILE_TEST && COMMON_CLK
diff --git a/sound/soc/ti/Makefile b/sound/soc/ti/Makefile
index a21e5b0061de..41cdcaec770d 100644
--- a/sound/soc/ti/Makefile
+++ b/sound/soc/ti/Makefile
@@ -12,14 +12,12 @@ obj-$(CONFIG_SND_SOC_TI_UDMA_PCM) += snd-soc-ti-udma.o
# CPU DAI drivers
snd-soc-davinci-asp-objs := davinci-i2s.o
snd-soc-davinci-mcasp-objs := davinci-mcasp.o
-snd-soc-davinci-vcif-objs := davinci-vcif.o
snd-soc-omap-dmic-objs := omap-dmic.o
snd-soc-omap-mcbsp-objs := omap-mcbsp.o omap-mcbsp-st.o
snd-soc-omap-mcpdm-objs := omap-mcpdm.o
obj-$(CONFIG_SND_SOC_DAVINCI_ASP) += snd-soc-davinci-asp.o
obj-$(CONFIG_SND_SOC_DAVINCI_MCASP) += snd-soc-davinci-mcasp.o
-obj-$(CONFIG_SND_SOC_DAVINCI_VCIF) += snd-soc-davinci-vcif.o
obj-$(CONFIG_SND_SOC_OMAP_DMIC) += snd-soc-omap-dmic.o
obj-$(CONFIG_SND_SOC_OMAP_MCBSP) += snd-soc-omap-mcbsp.o
obj-$(CONFIG_SND_SOC_OMAP_MCPDM) += snd-soc-omap-mcpdm.o
diff --git a/sound/soc/ti/davinci-evm.c b/sound/soc/ti/davinci-evm.c
index 68d69e32681a..983d69b951b0 100644
--- a/sound/soc/ti/davinci-evm.c
+++ b/sound/soc/ti/davinci-evm.c
@@ -138,214 +138,6 @@ static int evm_aic3x_init(struct snd_soc_pcm_runtime *rtd)
return 0;
}
-/* davinci-evm digital audio interface glue - connects codec <--> CPU */
-SND_SOC_DAILINK_DEFS(dm6446,
- DAILINK_COMP_ARRAY(COMP_CPU("davinci-mcbsp")),
- DAILINK_COMP_ARRAY(COMP_CODEC("tlv320aic3x-codec.1-001b",
- "tlv320aic3x-hifi")),
- DAILINK_COMP_ARRAY(COMP_PLATFORM("davinci-mcbsp")));
-
-static struct snd_soc_dai_link dm6446_evm_dai = {
- .name = "TLV320AIC3X",
- .stream_name = "AIC3X",
- .init = evm_aic3x_init,
- .ops = &evm_ops,
- .dai_fmt = SND_SOC_DAIFMT_DSP_B | SND_SOC_DAIFMT_CBM_CFM |
- SND_SOC_DAIFMT_IB_NF,
- SND_SOC_DAILINK_REG(dm6446),
-};
-
-SND_SOC_DAILINK_DEFS(dm355,
- DAILINK_COMP_ARRAY(COMP_CPU("davinci-mcbsp.1")),
- DAILINK_COMP_ARRAY(COMP_CODEC("tlv320aic3x-codec.1-001b",
- "tlv320aic3x-hifi")),
- DAILINK_COMP_ARRAY(COMP_PLATFORM("davinci-mcbsp.1")));
-
-static struct snd_soc_dai_link dm355_evm_dai = {
- .name = "TLV320AIC3X",
- .stream_name = "AIC3X",
- .init = evm_aic3x_init,
- .ops = &evm_ops,
- .dai_fmt = SND_SOC_DAIFMT_DSP_B | SND_SOC_DAIFMT_CBM_CFM |
- SND_SOC_DAIFMT_IB_NF,
- SND_SOC_DAILINK_REG(dm355),
-};
-
-#ifdef CONFIG_SND_SOC_DM365_AIC3X_CODEC
-SND_SOC_DAILINK_DEFS(dm365,
- DAILINK_COMP_ARRAY(COMP_CPU("davinci-mcbsp")),
- DAILINK_COMP_ARRAY(COMP_CODEC("tlv320aic3x-codec.1-0018",
- "tlv320aic3x-hifi")),
- DAILINK_COMP_ARRAY(COMP_PLATFORM("davinci-mcbsp")));
-#elif defined(CONFIG_SND_SOC_DM365_VOICE_CODEC)
-SND_SOC_DAILINK_DEFS(dm365,
- DAILINK_COMP_ARRAY(COMP_CPU("davinci-vcif")),
- DAILINK_COMP_ARRAY(COMP_CODEC("cq93vc-codec", "cq93vc-hifi")),
- DAILINK_COMP_ARRAY(COMP_PLATFORM("davinci-vcif")));
-#endif
-
-static struct snd_soc_dai_link dm365_evm_dai = {
-#ifdef CONFIG_SND_SOC_DM365_AIC3X_CODEC
- .name = "TLV320AIC3X",
- .stream_name = "AIC3X",
- .init = evm_aic3x_init,
- .ops = &evm_ops,
- .dai_fmt = SND_SOC_DAIFMT_DSP_B | SND_SOC_DAIFMT_CBM_CFM |
- SND_SOC_DAIFMT_IB_NF,
- SND_SOC_DAILINK_REG(dm365),
-#elif defined(CONFIG_SND_SOC_DM365_VOICE_CODEC)
- .name = "Voice Codec - CQ93VC",
- .stream_name = "CQ93",
- SND_SOC_DAILINK_REG(dm365),
-#endif
-};
-
-SND_SOC_DAILINK_DEFS(dm6467_aic3x,
- DAILINK_COMP_ARRAY(COMP_CPU("davinci-mcasp.0")),
- DAILINK_COMP_ARRAY(COMP_CODEC("tlv320aic3x-codec.0-001a",
- "tlv320aic3x-hifi")),
- DAILINK_COMP_ARRAY(COMP_PLATFORM("davinci-mcasp.0")));
-
-SND_SOC_DAILINK_DEFS(dm6467_spdif,
- DAILINK_COMP_ARRAY(COMP_CPU("davinci-mcasp.1")),
- DAILINK_COMP_ARRAY(COMP_CODEC("spdif_dit", "dit-hifi")),
- DAILINK_COMP_ARRAY(COMP_PLATFORM("davinci-mcasp.1")));
-
-static struct snd_soc_dai_link dm6467_evm_dai[] = {
- {
- .name = "TLV320AIC3X",
- .stream_name = "AIC3X",
- .init = evm_aic3x_init,
- .ops = &evm_ops,
- .dai_fmt = SND_SOC_DAIFMT_DSP_B | SND_SOC_DAIFMT_CBM_CFM |
- SND_SOC_DAIFMT_IB_NF,
- SND_SOC_DAILINK_REG(dm6467_aic3x),
- },
- {
- .name = "McASP",
- .stream_name = "spdif",
- .dai_fmt = SND_SOC_DAIFMT_DSP_B | SND_SOC_DAIFMT_CBM_CFM |
- SND_SOC_DAIFMT_IB_NF,
- SND_SOC_DAILINK_REG(dm6467_spdif),
- },
-};
-
-SND_SOC_DAILINK_DEFS(da830,
- DAILINK_COMP_ARRAY(COMP_CPU("davinci-mcasp.1")),
- DAILINK_COMP_ARRAY(COMP_CODEC("tlv320aic3x-codec.1-0018",
- "tlv320aic3x-hifi")),
- DAILINK_COMP_ARRAY(COMP_PLATFORM("davinci-mcasp.1")));
-
-static struct snd_soc_dai_link da830_evm_dai = {
- .name = "TLV320AIC3X",
- .stream_name = "AIC3X",
- .init = evm_aic3x_init,
- .ops = &evm_ops,
- .dai_fmt = SND_SOC_DAIFMT_DSP_B | SND_SOC_DAIFMT_CBM_CFM |
- SND_SOC_DAIFMT_IB_NF,
- SND_SOC_DAILINK_REG(da830),
-};
-
-SND_SOC_DAILINK_DEFS(da850,
- DAILINK_COMP_ARRAY(COMP_CPU("davinci-mcasp.0")),
- DAILINK_COMP_ARRAY(COMP_CODEC("tlv320aic3x-codec.1-0018",
- "tlv320aic3x-hifi")),
- DAILINK_COMP_ARRAY(COMP_PLATFORM("davinci-mcasp.0")));
-
-static struct snd_soc_dai_link da850_evm_dai = {
- .name = "TLV320AIC3X",
- .stream_name = "AIC3X",
- .init = evm_aic3x_init,
- .ops = &evm_ops,
- .dai_fmt = SND_SOC_DAIFMT_DSP_B | SND_SOC_DAIFMT_CBM_CFM |
- SND_SOC_DAIFMT_IB_NF,
- SND_SOC_DAILINK_REG(da850),
-};
-
-/* davinci dm6446 evm audio machine driver */
-/*
- * ASP0 in DM6446 EVM is clocked by U55, as configured by
- * board-dm644x-evm.c using GPIOs from U18. There are six
- * options; here we "know" we use a 48 KHz sample rate.
- */
-static struct snd_soc_card_drvdata_davinci dm6446_snd_soc_card_drvdata = {
- .sysclk = 12288000,
-};
-
-static struct snd_soc_card dm6446_snd_soc_card_evm = {
- .name = "DaVinci DM6446 EVM",
- .owner = THIS_MODULE,
- .dai_link = &dm6446_evm_dai,
- .num_links = 1,
- .drvdata = &dm6446_snd_soc_card_drvdata,
-};
-
-/* davinci dm355 evm audio machine driver */
-/* ASP1 on DM355 EVM is clocked by an external oscillator */
-static struct snd_soc_card_drvdata_davinci dm355_snd_soc_card_drvdata = {
- .sysclk = 27000000,
-};
-
-static struct snd_soc_card dm355_snd_soc_card_evm = {
- .name = "DaVinci DM355 EVM",
- .owner = THIS_MODULE,
- .dai_link = &dm355_evm_dai,
- .num_links = 1,
- .drvdata = &dm355_snd_soc_card_drvdata,
-};
-
-/* davinci dm365 evm audio machine driver */
-static struct snd_soc_card_drvdata_davinci dm365_snd_soc_card_drvdata = {
- .sysclk = 27000000,
-};
-
-static struct snd_soc_card dm365_snd_soc_card_evm = {
- .name = "DaVinci DM365 EVM",
- .owner = THIS_MODULE,
- .dai_link = &dm365_evm_dai,
- .num_links = 1,
- .drvdata = &dm365_snd_soc_card_drvdata,
-};
-
-/* davinci dm6467 evm audio machine driver */
-static struct snd_soc_card_drvdata_davinci dm6467_snd_soc_card_drvdata = {
- .sysclk = 27000000,
-};
-
-static struct snd_soc_card dm6467_snd_soc_card_evm = {
- .name = "DaVinci DM6467 EVM",
- .owner = THIS_MODULE,
- .dai_link = dm6467_evm_dai,
- .num_links = ARRAY_SIZE(dm6467_evm_dai),
- .drvdata = &dm6467_snd_soc_card_drvdata,
-};
-
-static struct snd_soc_card_drvdata_davinci da830_snd_soc_card_drvdata = {
- .sysclk = 24576000,
-};
-
-static struct snd_soc_card da830_snd_soc_card = {
- .name = "DA830/OMAP-L137 EVM",
- .owner = THIS_MODULE,
- .dai_link = &da830_evm_dai,
- .num_links = 1,
- .drvdata = &da830_snd_soc_card_drvdata,
-};
-
-static struct snd_soc_card_drvdata_davinci da850_snd_soc_card_drvdata = {
- .sysclk = 24576000,
-};
-
-static struct snd_soc_card da850_snd_soc_card = {
- .name = "DA850/OMAP-L138 EVM",
- .owner = THIS_MODULE,
- .dai_link = &da850_evm_dai,
- .num_links = 1,
- .drvdata = &da850_snd_soc_card_drvdata,
-};
-
-#if defined(CONFIG_OF)
-
/*
* The struct is used as place holder. It will be completely
* filled with data from dt node.
@@ -461,71 +253,18 @@ static struct platform_driver davinci_evm_driver = {
.driver = {
.name = "davinci_evm",
.pm = &snd_soc_pm_ops,
- .of_match_table = of_match_ptr(davinci_evm_dt_ids),
+ .of_match_table = davinci_evm_dt_ids,
},
};
-#endif
-
-static struct platform_device *evm_snd_device;
static int __init evm_init(void)
{
- struct snd_soc_card *evm_snd_dev_data;
- int index;
- int ret;
-
- /*
- * If dtb is there, the devices will be created dynamically.
- * Only register platfrom driver structure.
- */
-#if defined(CONFIG_OF)
- if (of_have_populated_dt())
- return platform_driver_register(&davinci_evm_driver);
-#endif
-
- if (machine_is_davinci_evm()) {
- evm_snd_dev_data = &dm6446_snd_soc_card_evm;
- index = 0;
- } else if (machine_is_davinci_dm355_evm()) {
- evm_snd_dev_data = &dm355_snd_soc_card_evm;
- index = 1;
- } else if (machine_is_davinci_dm365_evm()) {
- evm_snd_dev_data = &dm365_snd_soc_card_evm;
- index = 0;
- } else if (machine_is_davinci_dm6467_evm()) {
- evm_snd_dev_data = &dm6467_snd_soc_card_evm;
- index = 0;
- } else if (machine_is_davinci_da830_evm()) {
- evm_snd_dev_data = &da830_snd_soc_card;
- index = 1;
- } else if (machine_is_davinci_da850_evm()) {
- evm_snd_dev_data = &da850_snd_soc_card;
- index = 0;
- } else
- return -EINVAL;
-
- evm_snd_device = platform_device_alloc("soc-audio", index);
- if (!evm_snd_device)
- return -ENOMEM;
-
- platform_set_drvdata(evm_snd_device, evm_snd_dev_data);
- ret = platform_device_add(evm_snd_device);
- if (ret)
- platform_device_put(evm_snd_device);
-
- return ret;
+ return platform_driver_register(&davinci_evm_driver);
}
static void __exit evm_exit(void)
{
-#if defined(CONFIG_OF)
- if (of_have_populated_dt()) {
- platform_driver_unregister(&davinci_evm_driver);
- return;
- }
-#endif
-
- platform_device_unregister(evm_snd_device);
+ platform_driver_unregister(&davinci_evm_driver);
}
module_init(evm_init);
diff --git a/sound/soc/ti/davinci-vcif.c b/sound/soc/ti/davinci-vcif.c
deleted file mode 100644
index 36fa97e2b9e2..000000000000
--- a/sound/soc/ti/davinci-vcif.c
+++ /dev/null
@@ -1,247 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-or-later
-/*
- * ALSA SoC Voice Codec Interface for TI DAVINCI processor
- *
- * Copyright (C) 2010 Texas Instruments.
- *
- * Author: Miguel Aguilar <miguel.aguilar@ridgerun.com>
- */
-
-#include <linux/init.h>
-#include <linux/module.h>
-#include <linux/device.h>
-#include <linux/delay.h>
-#include <linux/slab.h>
-#include <linux/io.h>
-#include <linux/mfd/davinci_voicecodec.h>
-
-#include <sound/core.h>
-#include <sound/pcm.h>
-#include <sound/pcm_params.h>
-#include <sound/initval.h>
-#include <sound/soc.h>
-#include <sound/dmaengine_pcm.h>
-
-#include "edma-pcm.h"
-#include "davinci-i2s.h"
-
-#define MOD_REG_BIT(val, mask, set) do { \
- if (set) { \
- val |= mask; \
- } else { \
- val &= ~mask; \
- } \
-} while (0)
-
-struct davinci_vcif_dev {
- struct davinci_vc *davinci_vc;
- struct snd_dmaengine_dai_dma_data dma_data[2];
- int dma_request[2];
-};
-
-static void davinci_vcif_start(struct snd_pcm_substream *substream)
-{
- struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
- struct davinci_vcif_dev *davinci_vcif_dev =
- snd_soc_dai_get_drvdata(asoc_rtd_to_cpu(rtd, 0));
- struct davinci_vc *davinci_vc = davinci_vcif_dev->davinci_vc;
- u32 w;
-
- /* Start the sample generator and enable transmitter/receiver */
- w = readl(davinci_vc->base + DAVINCI_VC_CTRL);
-
- if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
- MOD_REG_BIT(w, DAVINCI_VC_CTRL_RSTDAC, 0);
- else
- MOD_REG_BIT(w, DAVINCI_VC_CTRL_RSTADC, 0);
-
- writel(w, davinci_vc->base + DAVINCI_VC_CTRL);
-}
-
-static void davinci_vcif_stop(struct snd_pcm_substream *substream)
-{
- struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
- struct davinci_vcif_dev *davinci_vcif_dev =
- snd_soc_dai_get_drvdata(asoc_rtd_to_cpu(rtd, 0));
- struct davinci_vc *davinci_vc = davinci_vcif_dev->davinci_vc;
- u32 w;
-
- /* Reset transmitter/receiver and sample rate/frame sync generators */
- w = readl(davinci_vc->base + DAVINCI_VC_CTRL);
- if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
- MOD_REG_BIT(w, DAVINCI_VC_CTRL_RSTDAC, 1);
- else
- MOD_REG_BIT(w, DAVINCI_VC_CTRL_RSTADC, 1);
-
- writel(w, davinci_vc->base + DAVINCI_VC_CTRL);
-}
-
-static int davinci_vcif_hw_params(struct snd_pcm_substream *substream,
- struct snd_pcm_hw_params *params,
- struct snd_soc_dai *dai)
-{
- struct davinci_vcif_dev *davinci_vcif_dev = snd_soc_dai_get_drvdata(dai);
- struct davinci_vc *davinci_vc = davinci_vcif_dev->davinci_vc;
- u32 w;
-
- /* Restart the codec before setup */
- davinci_vcif_stop(substream);
- davinci_vcif_start(substream);
-
- /* General line settings */
- writel(DAVINCI_VC_CTRL_MASK, davinci_vc->base + DAVINCI_VC_CTRL);
-
- writel(DAVINCI_VC_INT_MASK, davinci_vc->base + DAVINCI_VC_INTCLR);
-
- writel(DAVINCI_VC_INT_MASK, davinci_vc->base + DAVINCI_VC_INTEN);
-
- w = readl(davinci_vc->base + DAVINCI_VC_CTRL);
-
- /* Determine xfer data type */
- switch (params_format(params)) {
- case SNDRV_PCM_FORMAT_U8:
- MOD_REG_BIT(w, DAVINCI_VC_CTRL_RD_BITS_8 |
- DAVINCI_VC_CTRL_RD_UNSIGNED |
- DAVINCI_VC_CTRL_WD_BITS_8 |
- DAVINCI_VC_CTRL_WD_UNSIGNED, 1);
- break;
- case SNDRV_PCM_FORMAT_S8:
- MOD_REG_BIT(w, DAVINCI_VC_CTRL_RD_BITS_8 |
- DAVINCI_VC_CTRL_WD_BITS_8, 1);
-
- MOD_REG_BIT(w, DAVINCI_VC_CTRL_RD_UNSIGNED |
- DAVINCI_VC_CTRL_WD_UNSIGNED, 0);
- break;
- case SNDRV_PCM_FORMAT_S16_LE:
- MOD_REG_BIT(w, DAVINCI_VC_CTRL_RD_BITS_8 |
- DAVINCI_VC_CTRL_RD_UNSIGNED |
- DAVINCI_VC_CTRL_WD_BITS_8 |
- DAVINCI_VC_CTRL_WD_UNSIGNED, 0);
- break;
- default:
- printk(KERN_WARNING "davinci-vcif: unsupported PCM format");
- return -EINVAL;
- }
-
- writel(w, davinci_vc->base + DAVINCI_VC_CTRL);
-
- return 0;
-}
-
-static int davinci_vcif_trigger(struct snd_pcm_substream *substream, int cmd,
- struct snd_soc_dai *dai)
-{
- int ret = 0;
-
- switch (cmd) {
- case SNDRV_PCM_TRIGGER_START:
- case SNDRV_PCM_TRIGGER_RESUME:
- case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
- davinci_vcif_start(substream);
- break;
- case SNDRV_PCM_TRIGGER_STOP:
- case SNDRV_PCM_TRIGGER_SUSPEND:
- case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
- davinci_vcif_stop(substream);
- break;
- default:
- ret = -EINVAL;
- }
-
- return ret;
-}
-
-#define DAVINCI_VCIF_RATES SNDRV_PCM_RATE_8000_48000
-
-static const struct snd_soc_dai_ops davinci_vcif_dai_ops = {
- .trigger = davinci_vcif_trigger,
- .hw_params = davinci_vcif_hw_params,
-};
-
-static int davinci_vcif_dai_probe(struct snd_soc_dai *dai)
-{
- struct davinci_vcif_dev *dev = snd_soc_dai_get_drvdata(dai);
-
- dai->playback_dma_data = &dev->dma_data[SNDRV_PCM_STREAM_PLAYBACK];
- dai->capture_dma_data = &dev->dma_data[SNDRV_PCM_STREAM_CAPTURE];
-
- return 0;
-}
-
-static struct snd_soc_dai_driver davinci_vcif_dai = {
- .probe = davinci_vcif_dai_probe,
- .playback = {
- .channels_min = 1,
- .channels_max = 2,
- .rates = DAVINCI_VCIF_RATES,
- .formats = SNDRV_PCM_FMTBIT_S16_LE,},
- .capture = {
- .channels_min = 1,
- .channels_max = 2,
- .rates = DAVINCI_VCIF_RATES,
- .formats = SNDRV_PCM_FMTBIT_S16_LE,},
- .ops = &davinci_vcif_dai_ops,
-
-};
-
-static const struct snd_soc_component_driver davinci_vcif_component = {
- .name = "davinci-vcif",
- .legacy_dai_naming = 1,
-};
-
-static int davinci_vcif_probe(struct platform_device *pdev)
-{
- struct davinci_vc *davinci_vc = pdev->dev.platform_data;
- struct davinci_vcif_dev *davinci_vcif_dev;
- int ret;
-
- davinci_vcif_dev = devm_kzalloc(&pdev->dev,
- sizeof(struct davinci_vcif_dev),
- GFP_KERNEL);
- if (!davinci_vcif_dev)
- return -ENOMEM;
-
- /* DMA tx params */
- davinci_vcif_dev->davinci_vc = davinci_vc;
- davinci_vcif_dev->dma_data[SNDRV_PCM_STREAM_PLAYBACK].filter_data =
- &davinci_vc->davinci_vcif.dma_tx_channel;
- davinci_vcif_dev->dma_data[SNDRV_PCM_STREAM_PLAYBACK].addr =
- davinci_vc->davinci_vcif.dma_tx_addr;
-
- /* DMA rx params */
- davinci_vcif_dev->dma_data[SNDRV_PCM_STREAM_CAPTURE].filter_data =
- &davinci_vc->davinci_vcif.dma_rx_channel;
- davinci_vcif_dev->dma_data[SNDRV_PCM_STREAM_CAPTURE].addr =
- davinci_vc->davinci_vcif.dma_rx_addr;
-
- dev_set_drvdata(&pdev->dev, davinci_vcif_dev);
-
- ret = devm_snd_soc_register_component(&pdev->dev,
- &davinci_vcif_component,
- &davinci_vcif_dai, 1);
- if (ret != 0) {
- dev_err(&pdev->dev, "could not register dai\n");
- return ret;
- }
-
- ret = edma_pcm_platform_register(&pdev->dev);
- if (ret) {
- dev_err(&pdev->dev, "register PCM failed: %d\n", ret);
- return ret;
- }
-
- return 0;
-}
-
-static struct platform_driver davinci_vcif_driver = {
- .probe = davinci_vcif_probe,
- .driver = {
- .name = "davinci-vcif",
- },
-};
-
-module_platform_driver(davinci_vcif_driver);
-
-MODULE_AUTHOR("Miguel Aguilar");
-MODULE_DESCRIPTION("Texas Instruments DaVinci ASoC Voice Codec Interface");
-MODULE_LICENSE("GPL");
--
2.29.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [PATCH 10/14] mfd: remove davinci voicecodec driver
2022-10-19 15:29 [PATCH 00/14] ARM: remove unused davinci board & drivers Arnd Bergmann
` (7 preceding siblings ...)
2022-10-19 15:29 ` [PATCH 09/14] ASoC: remove unused davinci support Arnd Bergmann
@ 2022-10-19 15:29 ` Arnd Bergmann
2022-10-20 11:35 ` Bartosz Golaszewski
2022-10-31 15:17 ` Lee Jones
2022-10-19 15:29 ` [PATCH 11/14] pata: remove palmchip bk3710 driver Arnd Bergmann
` (7 subsequent siblings)
16 siblings, 2 replies; 44+ messages in thread
From: Arnd Bergmann @ 2022-10-19 15:29 UTC (permalink / raw)
To: Sekhar Nori, Bartosz Golaszewski, linux-arm-kernel, Lee Jones
Cc: linux-kernel, Kevin Hilman, Arnd Bergmann, Hans de Goede,
Andy Shevchenko
From: Arnd Bergmann <arnd@arndb.de>
The ASoC davinci voicecodec support is no longer used after
the removal of the dm3xx SoC platform, so the MFD driver is never
selected.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/mfd/Kconfig | 5 --
drivers/mfd/Makefile | 2 -
drivers/mfd/davinci_voicecodec.c | 136 -------------------------------
3 files changed, 143 deletions(-)
delete mode 100644 drivers/mfd/davinci_voicecodec.c
diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
index 31751cd3c4ed..e05474ba687c 100644
--- a/drivers/mfd/Kconfig
+++ b/drivers/mfd/Kconfig
@@ -1423,11 +1423,6 @@ config MFD_SYSCON
Select this option to enable accessing system control registers
via regmap.
-config MFD_DAVINCI_VOICECODEC
- tristate
- select MFD_CORE
- select REGMAP_MMIO
-
config MFD_TI_AM335X_TSCADC
tristate "TI ADC / Touch Screen chip support"
select MFD_CORE
diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile
index a3a304f8c762..38d9bf03c249 100644
--- a/drivers/mfd/Makefile
+++ b/drivers/mfd/Makefile
@@ -22,8 +22,6 @@ obj-$(CONFIG_HTC_PASIC3) += htc-pasic3.o
obj-$(CONFIG_MFD_TI_LP873X) += lp873x.o
obj-$(CONFIG_MFD_TI_LP87565) += lp87565.o
-
-obj-$(CONFIG_MFD_DAVINCI_VOICECODEC) += davinci_voicecodec.o
obj-$(CONFIG_MFD_TI_AM335X_TSCADC) += ti_am335x_tscadc.o
obj-$(CONFIG_MFD_STA2X11) += sta2x11-mfd.o
diff --git a/drivers/mfd/davinci_voicecodec.c b/drivers/mfd/davinci_voicecodec.c
deleted file mode 100644
index 965820481f1e..000000000000
--- a/drivers/mfd/davinci_voicecodec.c
+++ /dev/null
@@ -1,136 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-or-later
-/*
- * DaVinci Voice Codec Core Interface for TI platforms
- *
- * Copyright (C) 2010 Texas Instruments, Inc
- *
- * Author: Miguel Aguilar <miguel.aguilar@ridgerun.com>
- */
-
-#include <linux/init.h>
-#include <linux/module.h>
-#include <linux/device.h>
-#include <linux/slab.h>
-#include <linux/delay.h>
-#include <linux/io.h>
-#include <linux/clk.h>
-#include <linux/regmap.h>
-
-#include <sound/pcm.h>
-
-#include <linux/mfd/davinci_voicecodec.h>
-
-static const struct regmap_config davinci_vc_regmap = {
- .reg_bits = 32,
- .val_bits = 32,
-};
-
-static int __init davinci_vc_probe(struct platform_device *pdev)
-{
- struct davinci_vc *davinci_vc;
- struct resource *res;
- struct mfd_cell *cell = NULL;
- dma_addr_t fifo_base;
- int ret;
-
- davinci_vc = devm_kzalloc(&pdev->dev,
- sizeof(struct davinci_vc), GFP_KERNEL);
- if (!davinci_vc)
- return -ENOMEM;
-
- davinci_vc->clk = devm_clk_get(&pdev->dev, NULL);
- if (IS_ERR(davinci_vc->clk)) {
- dev_dbg(&pdev->dev,
- "could not get the clock for voice codec\n");
- return -ENODEV;
- }
- clk_enable(davinci_vc->clk);
-
- davinci_vc->base = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
- if (IS_ERR(davinci_vc->base)) {
- ret = PTR_ERR(davinci_vc->base);
- goto fail;
- }
- fifo_base = (dma_addr_t)res->start;
-
- davinci_vc->regmap = devm_regmap_init_mmio(&pdev->dev,
- davinci_vc->base,
- &davinci_vc_regmap);
- if (IS_ERR(davinci_vc->regmap)) {
- ret = PTR_ERR(davinci_vc->regmap);
- goto fail;
- }
-
- res = platform_get_resource(pdev, IORESOURCE_DMA, 0);
- if (!res) {
- dev_err(&pdev->dev, "no DMA resource\n");
- ret = -ENXIO;
- goto fail;
- }
-
- davinci_vc->davinci_vcif.dma_tx_channel = res->start;
- davinci_vc->davinci_vcif.dma_tx_addr = fifo_base + DAVINCI_VC_WFIFO;
-
- res = platform_get_resource(pdev, IORESOURCE_DMA, 1);
- if (!res) {
- dev_err(&pdev->dev, "no DMA resource\n");
- ret = -ENXIO;
- goto fail;
- }
-
- davinci_vc->davinci_vcif.dma_rx_channel = res->start;
- davinci_vc->davinci_vcif.dma_rx_addr = fifo_base + DAVINCI_VC_RFIFO;
-
- davinci_vc->dev = &pdev->dev;
- davinci_vc->pdev = pdev;
-
- /* Voice codec interface client */
- cell = &davinci_vc->cells[DAVINCI_VC_VCIF_CELL];
- cell->name = "davinci-vcif";
- cell->platform_data = davinci_vc;
- cell->pdata_size = sizeof(*davinci_vc);
-
- /* Voice codec CQ93VC client */
- cell = &davinci_vc->cells[DAVINCI_VC_CQ93VC_CELL];
- cell->name = "cq93vc-codec";
- cell->platform_data = davinci_vc;
- cell->pdata_size = sizeof(*davinci_vc);
-
- ret = mfd_add_devices(&pdev->dev, pdev->id, davinci_vc->cells,
- DAVINCI_VC_CELLS, NULL, 0, NULL);
- if (ret != 0) {
- dev_err(&pdev->dev, "fail to register client devices\n");
- goto fail;
- }
-
- return 0;
-
-fail:
- clk_disable(davinci_vc->clk);
-
- return ret;
-}
-
-static int davinci_vc_remove(struct platform_device *pdev)
-{
- struct davinci_vc *davinci_vc = platform_get_drvdata(pdev);
-
- mfd_remove_devices(&pdev->dev);
-
- clk_disable(davinci_vc->clk);
-
- return 0;
-}
-
-static struct platform_driver davinci_vc_driver = {
- .driver = {
- .name = "davinci_voicecodec",
- },
- .remove = davinci_vc_remove,
-};
-
-module_platform_driver_probe(davinci_vc_driver, davinci_vc_probe);
-
-MODULE_AUTHOR("Miguel Aguilar");
-MODULE_DESCRIPTION("Texas Instruments DaVinci Voice Codec Core Interface");
-MODULE_LICENSE("GPL");
--
2.29.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [PATCH 11/14] pata: remove palmchip bk3710 driver
2022-10-19 15:29 [PATCH 00/14] ARM: remove unused davinci board & drivers Arnd Bergmann
` (8 preceding siblings ...)
2022-10-19 15:29 ` [PATCH 10/14] mfd: remove davinci voicecodec driver Arnd Bergmann
@ 2022-10-19 15:29 ` Arnd Bergmann
2022-10-19 23:17 ` Damien Le Moal
` (3 more replies)
2022-10-19 15:29 ` [PATCH 12/14] irqchip: remove davinci aintc driver Arnd Bergmann
` (6 subsequent siblings)
16 siblings, 4 replies; 44+ messages in thread
From: Arnd Bergmann @ 2022-10-19 15:29 UTC (permalink / raw)
To: Sekhar Nori, Bartosz Golaszewski, linux-arm-kernel,
Damien Le Moal
Cc: linux-kernel, Kevin Hilman, Arnd Bergmann, Sergey Shtylyov,
Hannes Reinecke, linux-ide
From: Arnd Bergmann <arnd@arndb.de>
This device was used only on the davinci dm644x platform that
is now gone, and no references to the device remain in the
kernel.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/ata/Kconfig | 10 -
drivers/ata/Makefile | 1 -
drivers/ata/pata_bk3710.c | 380 --------------------------------------
3 files changed, 391 deletions(-)
delete mode 100644 drivers/ata/pata_bk3710.c
diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig
index 36833a862998..2986fc9c797e 100644
--- a/drivers/ata/Kconfig
+++ b/drivers/ata/Kconfig
@@ -609,16 +609,6 @@ config PATA_ATP867X
If unsure, say N.
-config PATA_BK3710
- tristate "Palmchip BK3710 PATA support"
- depends on ARCH_DAVINCI || COMPILE_TEST
- select PATA_TIMINGS
- help
- This option enables support for the integrated IDE controller on
- the TI DaVinci SoC.
-
- If unsure, say N.
-
config PATA_CMD64X
tristate "CMD64x PATA support"
depends on PCI
diff --git a/drivers/ata/Makefile b/drivers/ata/Makefile
index 34623365d9a6..d2e36d367274 100644
--- a/drivers/ata/Makefile
+++ b/drivers/ata/Makefile
@@ -54,7 +54,6 @@ obj-$(CONFIG_PATA_AMD) += pata_amd.o
obj-$(CONFIG_PATA_ARTOP) += pata_artop.o
obj-$(CONFIG_PATA_ATIIXP) += pata_atiixp.o
obj-$(CONFIG_PATA_ATP867X) += pata_atp867x.o
-obj-$(CONFIG_PATA_BK3710) += pata_bk3710.o
obj-$(CONFIG_PATA_CMD64X) += pata_cmd64x.o
obj-$(CONFIG_PATA_CS5520) += pata_cs5520.o
obj-$(CONFIG_PATA_CS5530) += pata_cs5530.o
diff --git a/drivers/ata/pata_bk3710.c b/drivers/ata/pata_bk3710.c
deleted file mode 100644
index fad95cfecced..000000000000
--- a/drivers/ata/pata_bk3710.c
+++ /dev/null
@@ -1,380 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-
-/*
- * Palmchip BK3710 PATA controller driver
- *
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
- * http://www.samsung.com
- *
- * Based on palm_bk3710.c:
- *
- * Copyright (C) 2006 Texas Instruments.
- * Copyright (C) 2007 MontaVista Software, Inc., <source@mvista.com>
- */
-
-#include <linux/ata.h>
-#include <linux/clk.h>
-#include <linux/delay.h>
-#include <linux/init.h>
-#include <linux/ioport.h>
-#include <linux/kernel.h>
-#include <linux/libata.h>
-#include <linux/module.h>
-#include <linux/platform_device.h>
-#include <linux/types.h>
-
-#define DRV_NAME "pata_bk3710"
-
-#define BK3710_TF_OFFSET 0x1F0
-#define BK3710_CTL_OFFSET 0x3F6
-
-#define BK3710_BMISP 0x02
-#define BK3710_IDETIMP 0x40
-#define BK3710_UDMACTL 0x48
-#define BK3710_MISCCTL 0x50
-#define BK3710_REGSTB 0x54
-#define BK3710_REGRCVR 0x58
-#define BK3710_DATSTB 0x5C
-#define BK3710_DATRCVR 0x60
-#define BK3710_DMASTB 0x64
-#define BK3710_DMARCVR 0x68
-#define BK3710_UDMASTB 0x6C
-#define BK3710_UDMATRP 0x70
-#define BK3710_UDMAENV 0x74
-#define BK3710_IORDYTMP 0x78
-
-static struct scsi_host_template pata_bk3710_sht = {
- ATA_BMDMA_SHT(DRV_NAME),
-};
-
-static unsigned int ideclk_period; /* in nanoseconds */
-
-struct pata_bk3710_udmatiming {
- unsigned int rptime; /* tRP -- Ready to pause time (nsec) */
- unsigned int cycletime; /* tCYCTYP2/2 -- avg Cycle Time (nsec) */
- /* tENV is always a minimum of 20 nsec */
-};
-
-static const struct pata_bk3710_udmatiming pata_bk3710_udmatimings[6] = {
- { 160, 240 / 2 }, /* UDMA Mode 0 */
- { 125, 160 / 2 }, /* UDMA Mode 1 */
- { 100, 120 / 2 }, /* UDMA Mode 2 */
- { 100, 90 / 2 }, /* UDMA Mode 3 */
- { 100, 60 / 2 }, /* UDMA Mode 4 */
- { 85, 40 / 2 }, /* UDMA Mode 5 */
-};
-
-static void pata_bk3710_setudmamode(void __iomem *base, unsigned int dev,
- unsigned int mode)
-{
- u32 val32;
- u16 val16;
- u8 tenv, trp, t0;
-
- /* DMA Data Setup */
- t0 = DIV_ROUND_UP(pata_bk3710_udmatimings[mode].cycletime,
- ideclk_period) - 1;
- tenv = DIV_ROUND_UP(20, ideclk_period) - 1;
- trp = DIV_ROUND_UP(pata_bk3710_udmatimings[mode].rptime,
- ideclk_period) - 1;
-
- /* udmastb Ultra DMA Access Strobe Width */
- val32 = ioread32(base + BK3710_UDMASTB) & (0xFF << (dev ? 0 : 8));
- val32 |= t0 << (dev ? 8 : 0);
- iowrite32(val32, base + BK3710_UDMASTB);
-
- /* udmatrp Ultra DMA Ready to Pause Time */
- val32 = ioread32(base + BK3710_UDMATRP) & (0xFF << (dev ? 0 : 8));
- val32 |= trp << (dev ? 8 : 0);
- iowrite32(val32, base + BK3710_UDMATRP);
-
- /* udmaenv Ultra DMA envelop Time */
- val32 = ioread32(base + BK3710_UDMAENV) & (0xFF << (dev ? 0 : 8));
- val32 |= tenv << (dev ? 8 : 0);
- iowrite32(val32, base + BK3710_UDMAENV);
-
- /* Enable UDMA for Device */
- val16 = ioread16(base + BK3710_UDMACTL) | (1 << dev);
- iowrite16(val16, base + BK3710_UDMACTL);
-}
-
-static void pata_bk3710_setmwdmamode(void __iomem *base, unsigned int dev,
- unsigned short min_cycle,
- unsigned int mode)
-{
- const struct ata_timing *t;
- int cycletime;
- u32 val32;
- u16 val16;
- u8 td, tkw, t0;
-
- t = ata_timing_find_mode(mode);
- cycletime = max_t(int, t->cycle, min_cycle);
-
- /* DMA Data Setup */
- t0 = DIV_ROUND_UP(cycletime, ideclk_period);
- td = DIV_ROUND_UP(t->active, ideclk_period);
- tkw = t0 - td - 1;
- td--;
-
- val32 = ioread32(base + BK3710_DMASTB) & (0xFF << (dev ? 0 : 8));
- val32 |= td << (dev ? 8 : 0);
- iowrite32(val32, base + BK3710_DMASTB);
-
- val32 = ioread32(base + BK3710_DMARCVR) & (0xFF << (dev ? 0 : 8));
- val32 |= tkw << (dev ? 8 : 0);
- iowrite32(val32, base + BK3710_DMARCVR);
-
- /* Disable UDMA for Device */
- val16 = ioread16(base + BK3710_UDMACTL) & ~(1 << dev);
- iowrite16(val16, base + BK3710_UDMACTL);
-}
-
-static void pata_bk3710_set_dmamode(struct ata_port *ap,
- struct ata_device *adev)
-{
- void __iomem *base = (void __iomem *)ap->ioaddr.bmdma_addr;
- int is_slave = adev->devno;
- const u8 xferspeed = adev->dma_mode;
-
- if (xferspeed >= XFER_UDMA_0)
- pata_bk3710_setudmamode(base, is_slave,
- xferspeed - XFER_UDMA_0);
- else
- pata_bk3710_setmwdmamode(base, is_slave,
- adev->id[ATA_ID_EIDE_DMA_MIN],
- xferspeed);
-}
-
-static void pata_bk3710_setpiomode(void __iomem *base, struct ata_device *pair,
- unsigned int dev, unsigned int cycletime,
- unsigned int mode)
-{
- const struct ata_timing *t;
- u32 val32;
- u8 t2, t2i, t0;
-
- t = ata_timing_find_mode(XFER_PIO_0 + mode);
-
- /* PIO Data Setup */
- t0 = DIV_ROUND_UP(cycletime, ideclk_period);
- t2 = DIV_ROUND_UP(t->active, ideclk_period);
-
- t2i = t0 - t2 - 1;
- t2--;
-
- val32 = ioread32(base + BK3710_DATSTB) & (0xFF << (dev ? 0 : 8));
- val32 |= t2 << (dev ? 8 : 0);
- iowrite32(val32, base + BK3710_DATSTB);
-
- val32 = ioread32(base + BK3710_DATRCVR) & (0xFF << (dev ? 0 : 8));
- val32 |= t2i << (dev ? 8 : 0);
- iowrite32(val32, base + BK3710_DATRCVR);
-
- /* FIXME: this is broken also in the old driver */
- if (pair) {
- u8 mode2 = pair->pio_mode - XFER_PIO_0;
-
- if (mode2 < mode)
- mode = mode2;
- }
-
- /* TASKFILE Setup */
- t0 = DIV_ROUND_UP(t->cyc8b, ideclk_period);
- t2 = DIV_ROUND_UP(t->act8b, ideclk_period);
-
- t2i = t0 - t2 - 1;
- t2--;
-
- val32 = ioread32(base + BK3710_REGSTB) & (0xFF << (dev ? 0 : 8));
- val32 |= t2 << (dev ? 8 : 0);
- iowrite32(val32, base + BK3710_REGSTB);
-
- val32 = ioread32(base + BK3710_REGRCVR) & (0xFF << (dev ? 0 : 8));
- val32 |= t2i << (dev ? 8 : 0);
- iowrite32(val32, base + BK3710_REGRCVR);
-}
-
-static void pata_bk3710_set_piomode(struct ata_port *ap,
- struct ata_device *adev)
-{
- void __iomem *base = (void __iomem *)ap->ioaddr.bmdma_addr;
- struct ata_device *pair = ata_dev_pair(adev);
- const struct ata_timing *t = ata_timing_find_mode(adev->pio_mode);
- const u16 *id = adev->id;
- unsigned int cycle_time = 0;
- int is_slave = adev->devno;
- const u8 pio = adev->pio_mode - XFER_PIO_0;
-
- if (id[ATA_ID_FIELD_VALID] & 2) {
- if (ata_id_has_iordy(id))
- cycle_time = id[ATA_ID_EIDE_PIO_IORDY];
- else
- cycle_time = id[ATA_ID_EIDE_PIO];
-
- /* conservative "downgrade" for all pre-ATA2 drives */
- if (pio < 3 && cycle_time < t->cycle)
- cycle_time = 0; /* use standard timing */
- }
-
- if (!cycle_time)
- cycle_time = t->cycle;
-
- pata_bk3710_setpiomode(base, pair, is_slave, cycle_time, pio);
-}
-
-static void pata_bk3710_chipinit(void __iomem *base)
-{
- /*
- * REVISIT: the ATA reset signal needs to be managed through a
- * GPIO, which means it should come from platform_data. Until
- * we get and use such information, we have to trust that things
- * have been reset before we get here.
- */
-
- /*
- * Program the IDETIMP Register Value based on the following assumptions
- *
- * (ATA_IDETIMP_IDEEN , ENABLE ) |
- * (ATA_IDETIMP_PREPOST1 , DISABLE) |
- * (ATA_IDETIMP_PREPOST0 , DISABLE) |
- *
- * DM6446 silicon rev 2.1 and earlier have no observed net benefit
- * from enabling prefetch/postwrite.
- */
- iowrite16(BIT(15), base + BK3710_IDETIMP);
-
- /*
- * UDMACTL Ultra-ATA DMA Control
- * (ATA_UDMACTL_UDMAP1 , 0 ) |
- * (ATA_UDMACTL_UDMAP0 , 0 )
- *
- */
- iowrite16(0, base + BK3710_UDMACTL);
-
- /*
- * MISCCTL Miscellaneous Conrol Register
- * (ATA_MISCCTL_HWNHLD1P , 1 cycle)
- * (ATA_MISCCTL_HWNHLD0P , 1 cycle)
- * (ATA_MISCCTL_TIMORIDE , 1)
- */
- iowrite32(0x001, base + BK3710_MISCCTL);
-
- /*
- * IORDYTMP IORDY Timer for Primary Register
- * (ATA_IORDYTMP_IORDYTMP , DISABLE)
- */
- iowrite32(0, base + BK3710_IORDYTMP);
-
- /*
- * Configure BMISP Register
- * (ATA_BMISP_DMAEN1 , DISABLE ) |
- * (ATA_BMISP_DMAEN0 , DISABLE ) |
- * (ATA_BMISP_IORDYINT , CLEAR) |
- * (ATA_BMISP_INTRSTAT , CLEAR) |
- * (ATA_BMISP_DMAERROR , CLEAR)
- */
- iowrite16(0xE, base + BK3710_BMISP);
-
- pata_bk3710_setpiomode(base, NULL, 0, 600, 0);
- pata_bk3710_setpiomode(base, NULL, 1, 600, 0);
-}
-
-static struct ata_port_operations pata_bk3710_ports_ops = {
- .inherits = &ata_bmdma_port_ops,
- .cable_detect = ata_cable_80wire,
-
- .set_piomode = pata_bk3710_set_piomode,
- .set_dmamode = pata_bk3710_set_dmamode,
-};
-
-static int __init pata_bk3710_probe(struct platform_device *pdev)
-{
- struct clk *clk;
- struct resource *mem;
- struct ata_host *host;
- struct ata_port *ap;
- void __iomem *base;
- unsigned long rate;
- int irq;
-
- clk = devm_clk_get(&pdev->dev, NULL);
- if (IS_ERR(clk))
- return -ENODEV;
-
- clk_enable(clk);
- rate = clk_get_rate(clk);
- if (!rate)
- return -EINVAL;
-
- /* NOTE: round *down* to meet minimum timings; we count in clocks */
- ideclk_period = 1000000000UL / rate;
-
- mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-
- irq = platform_get_irq(pdev, 0);
- if (irq < 0) {
- pr_err(DRV_NAME ": failed to get IRQ resource\n");
- return irq;
- }
-
- base = devm_ioremap_resource(&pdev->dev, mem);
- if (IS_ERR(base))
- return PTR_ERR(base);
-
- /* configure the Palmchip controller */
- pata_bk3710_chipinit(base);
-
- /* allocate host */
- host = ata_host_alloc(&pdev->dev, 1);
- if (!host)
- return -ENOMEM;
- ap = host->ports[0];
-
- ap->ops = &pata_bk3710_ports_ops;
- ap->pio_mask = ATA_PIO4;
- ap->mwdma_mask = ATA_MWDMA2;
- ap->udma_mask = rate < 100000000 ? ATA_UDMA4 : ATA_UDMA5;
- ap->flags |= ATA_FLAG_SLAVE_POSS;
-
- ap->ioaddr.data_addr = base + BK3710_TF_OFFSET;
- ap->ioaddr.error_addr = base + BK3710_TF_OFFSET + 1;
- ap->ioaddr.feature_addr = base + BK3710_TF_OFFSET + 1;
- ap->ioaddr.nsect_addr = base + BK3710_TF_OFFSET + 2;
- ap->ioaddr.lbal_addr = base + BK3710_TF_OFFSET + 3;
- ap->ioaddr.lbam_addr = base + BK3710_TF_OFFSET + 4;
- ap->ioaddr.lbah_addr = base + BK3710_TF_OFFSET + 5;
- ap->ioaddr.device_addr = base + BK3710_TF_OFFSET + 6;
- ap->ioaddr.status_addr = base + BK3710_TF_OFFSET + 7;
- ap->ioaddr.command_addr = base + BK3710_TF_OFFSET + 7;
-
- ap->ioaddr.altstatus_addr = base + BK3710_CTL_OFFSET;
- ap->ioaddr.ctl_addr = base + BK3710_CTL_OFFSET;
-
- ap->ioaddr.bmdma_addr = base;
-
- ata_port_desc(ap, "cmd 0x%lx ctl 0x%lx",
- (unsigned long)base + BK3710_TF_OFFSET,
- (unsigned long)base + BK3710_CTL_OFFSET);
-
- /* activate */
- return ata_host_activate(host, irq, ata_sff_interrupt, 0,
- &pata_bk3710_sht);
-}
-
-/* work with hotplug and coldplug */
-MODULE_ALIAS("platform:palm_bk3710");
-
-static struct platform_driver pata_bk3710_driver = {
- .driver = {
- .name = "palm_bk3710",
- },
-};
-
-static int __init pata_bk3710_init(void)
-{
- return platform_driver_probe(&pata_bk3710_driver, pata_bk3710_probe);
-}
-
-module_init(pata_bk3710_init);
-MODULE_LICENSE("GPL v2");
--
2.29.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [PATCH 12/14] irqchip: remove davinci aintc driver
2022-10-19 15:29 [PATCH 00/14] ARM: remove unused davinci board & drivers Arnd Bergmann
` (9 preceding siblings ...)
2022-10-19 15:29 ` [PATCH 11/14] pata: remove palmchip bk3710 driver Arnd Bergmann
@ 2022-10-19 15:29 ` Arnd Bergmann
2022-10-20 11:33 ` Bartosz Golaszewski
2022-10-19 15:39 ` [PATCH 00/14] ARM: remove unused davinci board & drivers Marc Zyngier
` (5 subsequent siblings)
16 siblings, 1 reply; 44+ messages in thread
From: Arnd Bergmann @ 2022-10-19 15:29 UTC (permalink / raw)
To: Sekhar Nori, Bartosz Golaszewski, linux-arm-kernel,
Thomas Gleixner, Marc Zyngier
Cc: linux-kernel, Kevin Hilman, Arnd Bergmann
From: Arnd Bergmann <arnd@arndb.de>
The aintc driver was used on Davinci DM3xx and DM64xx SoCs, all of
which got dropped from Linux, so this driver is orphaned as well.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/irqchip/Kconfig | 5 -
drivers/irqchip/Makefile | 1 -
drivers/irqchip/irq-davinci-aintc.c | 163 ----------------------------
3 files changed, 169 deletions(-)
delete mode 100644 drivers/irqchip/irq-davinci-aintc.c
diff --git a/drivers/irqchip/Kconfig b/drivers/irqchip/Kconfig
index 7ef9f5e696d3..c9bb2ccf4044 100644
--- a/drivers/irqchip/Kconfig
+++ b/drivers/irqchip/Kconfig
@@ -136,11 +136,6 @@ config BRCMSTB_L2_IRQ
select GENERIC_IRQ_CHIP
select IRQ_DOMAIN
-config DAVINCI_AINTC
- bool
- select GENERIC_IRQ_CHIP
- select IRQ_DOMAIN
-
config DAVINCI_CP_INTC
bool
select GENERIC_IRQ_CHIP
diff --git a/drivers/irqchip/Makefile b/drivers/irqchip/Makefile
index 87b49a10962c..ffd945fe71aa 100644
--- a/drivers/irqchip/Makefile
+++ b/drivers/irqchip/Makefile
@@ -8,7 +8,6 @@ obj-$(CONFIG_ATH79) += irq-ath79-misc.o
obj-$(CONFIG_ARCH_BCM2835) += irq-bcm2835.o
obj-$(CONFIG_ARCH_BCM2835) += irq-bcm2836.o
obj-$(CONFIG_ARCH_ACTIONS) += irq-owl-sirq.o
-obj-$(CONFIG_DAVINCI_AINTC) += irq-davinci-aintc.o
obj-$(CONFIG_DAVINCI_CP_INTC) += irq-davinci-cp-intc.o
obj-$(CONFIG_EXYNOS_IRQ_COMBINER) += exynos-combiner.o
obj-$(CONFIG_FARADAY_FTINTC010) += irq-ftintc010.o
diff --git a/drivers/irqchip/irq-davinci-aintc.c b/drivers/irqchip/irq-davinci-aintc.c
deleted file mode 100644
index 123eb7bfc117..000000000000
--- a/drivers/irqchip/irq-davinci-aintc.c
+++ /dev/null
@@ -1,163 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-or-later
-//
-// Copyright (C) 2006, 2019 Texas Instruments.
-//
-// Interrupt handler for DaVinci boards.
-
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/interrupt.h>
-#include <linux/irq.h>
-#include <linux/irqchip/irq-davinci-aintc.h>
-#include <linux/io.h>
-#include <linux/irqdomain.h>
-
-#include <asm/exception.h>
-
-#define DAVINCI_AINTC_FIQ_REG0 0x00
-#define DAVINCI_AINTC_FIQ_REG1 0x04
-#define DAVINCI_AINTC_IRQ_REG0 0x08
-#define DAVINCI_AINTC_IRQ_REG1 0x0c
-#define DAVINCI_AINTC_IRQ_IRQENTRY 0x14
-#define DAVINCI_AINTC_IRQ_ENT_REG0 0x18
-#define DAVINCI_AINTC_IRQ_ENT_REG1 0x1c
-#define DAVINCI_AINTC_IRQ_INCTL_REG 0x20
-#define DAVINCI_AINTC_IRQ_EABASE_REG 0x24
-#define DAVINCI_AINTC_IRQ_INTPRI0_REG 0x30
-#define DAVINCI_AINTC_IRQ_INTPRI7_REG 0x4c
-
-static void __iomem *davinci_aintc_base;
-static struct irq_domain *davinci_aintc_irq_domain;
-
-static inline void davinci_aintc_writel(unsigned long value, int offset)
-{
- writel_relaxed(value, davinci_aintc_base + offset);
-}
-
-static inline unsigned long davinci_aintc_readl(int offset)
-{
- return readl_relaxed(davinci_aintc_base + offset);
-}
-
-static __init void
-davinci_aintc_setup_gc(void __iomem *base,
- unsigned int irq_start, unsigned int num)
-{
- struct irq_chip_generic *gc;
- struct irq_chip_type *ct;
-
- gc = irq_get_domain_generic_chip(davinci_aintc_irq_domain, irq_start);
- gc->reg_base = base;
- gc->irq_base = irq_start;
-
- ct = gc->chip_types;
- ct->chip.irq_ack = irq_gc_ack_set_bit;
- ct->chip.irq_mask = irq_gc_mask_clr_bit;
- ct->chip.irq_unmask = irq_gc_mask_set_bit;
-
- ct->regs.ack = DAVINCI_AINTC_IRQ_REG0;
- ct->regs.mask = DAVINCI_AINTC_IRQ_ENT_REG0;
- irq_setup_generic_chip(gc, IRQ_MSK(num), IRQ_GC_INIT_MASK_CACHE,
- IRQ_NOREQUEST | IRQ_NOPROBE, 0);
-}
-
-static asmlinkage void __exception_irq_entry
-davinci_aintc_handle_irq(struct pt_regs *regs)
-{
- int irqnr = davinci_aintc_readl(DAVINCI_AINTC_IRQ_IRQENTRY);
-
- /*
- * Use the formula for entry vector index generation from section
- * 8.3.3 of the manual.
- */
- irqnr >>= 2;
- irqnr -= 1;
-
- generic_handle_domain_irq(davinci_aintc_irq_domain, irqnr);
-}
-
-/* ARM Interrupt Controller Initialization */
-void __init davinci_aintc_init(const struct davinci_aintc_config *config)
-{
- unsigned int irq_off, reg_off, prio, shift;
- void __iomem *req;
- int ret, irq_base;
- const u8 *prios;
-
- req = request_mem_region(config->reg.start,
- resource_size(&config->reg),
- "davinci-cp-intc");
- if (!req) {
- pr_err("%s: register range busy\n", __func__);
- return;
- }
-
- davinci_aintc_base = ioremap(config->reg.start,
- resource_size(&config->reg));
- if (!davinci_aintc_base) {
- pr_err("%s: unable to ioremap register range\n", __func__);
- return;
- }
-
- /* Clear all interrupt requests */
- davinci_aintc_writel(~0x0, DAVINCI_AINTC_FIQ_REG0);
- davinci_aintc_writel(~0x0, DAVINCI_AINTC_FIQ_REG1);
- davinci_aintc_writel(~0x0, DAVINCI_AINTC_IRQ_REG0);
- davinci_aintc_writel(~0x0, DAVINCI_AINTC_IRQ_REG1);
-
- /* Disable all interrupts */
- davinci_aintc_writel(0x0, DAVINCI_AINTC_IRQ_ENT_REG0);
- davinci_aintc_writel(0x0, DAVINCI_AINTC_IRQ_ENT_REG1);
-
- /* Interrupts disabled immediately, IRQ entry reflects all */
- davinci_aintc_writel(0x0, DAVINCI_AINTC_IRQ_INCTL_REG);
-
- /* we don't use the hardware vector table, just its entry addresses */
- davinci_aintc_writel(0, DAVINCI_AINTC_IRQ_EABASE_REG);
-
- /* Clear all interrupt requests */
- davinci_aintc_writel(~0x0, DAVINCI_AINTC_FIQ_REG0);
- davinci_aintc_writel(~0x0, DAVINCI_AINTC_FIQ_REG1);
- davinci_aintc_writel(~0x0, DAVINCI_AINTC_IRQ_REG0);
- davinci_aintc_writel(~0x0, DAVINCI_AINTC_IRQ_REG1);
-
- prios = config->prios;
- for (reg_off = DAVINCI_AINTC_IRQ_INTPRI0_REG;
- reg_off <= DAVINCI_AINTC_IRQ_INTPRI7_REG; reg_off += 4) {
- for (shift = 0, prio = 0; shift < 32; shift += 4, prios++)
- prio |= (*prios & 0x07) << shift;
- davinci_aintc_writel(prio, reg_off);
- }
-
- irq_base = irq_alloc_descs(-1, 0, config->num_irqs, 0);
- if (irq_base < 0) {
- pr_err("%s: unable to allocate interrupt descriptors: %d\n",
- __func__, irq_base);
- return;
- }
-
- davinci_aintc_irq_domain = irq_domain_add_legacy(NULL,
- config->num_irqs, irq_base, 0,
- &irq_domain_simple_ops, NULL);
- if (!davinci_aintc_irq_domain) {
- pr_err("%s: unable to create interrupt domain\n", __func__);
- return;
- }
-
- ret = irq_alloc_domain_generic_chips(davinci_aintc_irq_domain, 32, 1,
- "AINTC", handle_edge_irq,
- IRQ_NOREQUEST | IRQ_NOPROBE, 0, 0);
- if (ret) {
- pr_err("%s: unable to allocate generic irq chips for domain\n",
- __func__);
- return;
- }
-
- for (irq_off = 0, reg_off = 0;
- irq_off < config->num_irqs;
- irq_off += 32, reg_off += 0x04)
- davinci_aintc_setup_gc(davinci_aintc_base + reg_off,
- irq_base + irq_off, 32);
-
- set_handle_irq(davinci_aintc_handle_irq);
-}
--
2.29.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 44+ messages in thread
* Re: [PATCH 00/14] ARM: remove unused davinci board & drivers
2022-10-19 15:29 [PATCH 00/14] ARM: remove unused davinci board & drivers Arnd Bergmann
` (10 preceding siblings ...)
2022-10-19 15:29 ` [PATCH 12/14] irqchip: remove davinci aintc driver Arnd Bergmann
@ 2022-10-19 15:39 ` Marc Zyngier
[not found] ` <20221019152947.3857217-2-arnd@kernel.org>
` (4 subsequent siblings)
16 siblings, 0 replies; 44+ messages in thread
From: Marc Zyngier @ 2022-10-19 15:39 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Sekhar Nori, Bartosz Golaszewski, linux-arm-kernel, linux-kernel,
Kevin Hilman, Arnd Bergmann, Russell King, Mauro Carvalho Chehab,
Damien Le Moal, Sergey Shtylyov, David Lechner, Michael Turquette,
Stephen Boyd, Dmitry Torokhov, Thomas Gleixner, Lad, Prabhakar,
Lee Jones, Alessandro Zummo, Alexandre Belloni,
Greg Kroah-Hartman, Bin Liu, Peter Ujfalusi, Liam Girdwood,
Mark Brown, Jaroslav Kysela, Takashi Iwai, Laurent Pinchart,
Hans Verkuil, Yang Yingliang, linux-media, linux-ide, linux-clk,
linux-input, linux-rtc, linux-staging, linux-usb, alsa-devel
On Wed, 19 Oct 2022 16:29:26 +0100,
Arnd Bergmann <arnd@kernel.org> wrote:
>
> From: Arnd Bergmann <arnd@arndb.de>
>
> As part of removing all board files that were previously marked as unused,
> I looked through the davinci platform and recursively removed everything
> that has now become unused.
>
> In particular, this is for all dm3xx support, in addition to the dm64xx
> support removed previously. The remaining support is now for da8xx using
> devicetree only, which means a lot of the da8xx specific device support
> can also go away.
>
> As with the previous series, I can keep patches together in the
> soc tree, or subsystem maintainers can pick them up individually
> through their subsystems, whichever they prefer.
>
> Arnd Bergmann (14):
[...]
> irqchip: remove davinci aintc driver
Acked-by: Marc Zyngier <maz@kernel.org>
M.
--
Without deviation from the norm, progress is not possible.
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 44+ messages in thread
* Re: [PATCH 09/14] ASoC: remove unused davinci support
2022-10-19 15:29 ` [PATCH 09/14] ASoC: remove unused davinci support Arnd Bergmann
@ 2022-10-19 15:52 ` Mark Brown
0 siblings, 0 replies; 44+ messages in thread
From: Mark Brown @ 2022-10-19 15:52 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Sekhar Nori, Bartosz Golaszewski, linux-arm-kernel,
Peter Ujfalusi, Liam Girdwood, Jaroslav Kysela, Takashi Iwai,
linux-kernel, Kevin Hilman, Arnd Bergmann, Charles Keepax,
alsa-devel
[-- Attachment #1.1: Type: text/plain, Size: 332 bytes --]
On Wed, Oct 19, 2022 at 05:29:35PM +0200, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> The dm644x and dm3xx SoCs have been removed, as have the
> da850_evm/da830_evm machines, the remaining machines all use the
> DT based probing and do not use the vcif driver.
Acked-by: Mark Brown <broonie@kernel.org>
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 484 bytes --]
[-- Attachment #2: Type: text/plain, Size: 176 bytes --]
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 44+ messages in thread
* Re: [PATCH 02/14] ARM: davinci: drop DAVINCI_DMxxx references
2022-10-19 15:29 ` [PATCH 02/14] ARM: davinci: drop DAVINCI_DMxxx references Arnd Bergmann
@ 2022-10-19 16:37 ` David Lechner
2022-10-19 20:32 ` Arnd Bergmann
2022-10-27 1:10 ` Stephen Boyd
1 sibling, 1 reply; 44+ messages in thread
From: David Lechner @ 2022-10-19 16:37 UTC (permalink / raw)
To: Arnd Bergmann, Sekhar Nori, Bartosz Golaszewski, linux-arm-kernel,
Michael Turquette, Stephen Boyd
Cc: linux-kernel, Kevin Hilman, Arnd Bergmann, linux-clk
On 10/19/22 10:29 AM, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> Support for all the dm3xx/dm64xx SoCs is no longer
> available, so drop all other references to those.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> int __init davinci_serial_init(struct platform_device *serial_dev)
> diff --git a/arch/arm/mach-davinci/usb.c b/arch/arm/mach-davinci/usb.c
> index a9e5c6e91e5d..9dc14c7977b3 100644
> --- a/arch/arm/mach-davinci/usb.c
> +++ b/arch/arm/mach-davinci/usb.c
> @@ -41,11 +41,6 @@ static struct resource usb_resources[] = {
> .flags = IORESOURCE_IRQ,
> .name = "mc"
> },
> - {
> - /* placeholder for the dedicated CPPI IRQ */
> - .flags = IORESOURCE_IRQ,
> - .name = "dma"
> - },
> };
>
> static u64 usb_dmamask = DMA_BIT_MASK(32);
> @@ -67,14 +62,6 @@ void __init davinci_setup_usb(unsigned mA, unsigned potpgt_ms)
> usb_data.power = mA > 510 ? 255 : mA / 2;
> usb_data.potpgt = (potpgt_ms + 1) / 2;
>
> - if (cpu_is_davinci_dm646x()) {
> - /* Override the defaults as DM6467 uses different IRQs. */
> - usb_dev.resource[1].start = DAVINCI_INTC_IRQ(IRQ_DM646X_USBINT);
> - usb_dev.resource[2].start = DAVINCI_INTC_IRQ(
> - IRQ_DM646X_USBDMAINT);
> - } else /* other devices don't have dedicated CPPI IRQ */
> - usb_dev.num_resources = 2;
> -
> platform_device_register(&usb_dev);
> }
>
Shouldn't the else case be kept since it applies to *all* "other devices"?
(and therfore the usb_resources shouldn't be modified either?)
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 44+ messages in thread
* Re: [PATCH 04/14] clk: remove davinci dm3xx drivers
2022-10-19 15:29 ` [PATCH 04/14] clk: remove davinci dm3xx drivers Arnd Bergmann
@ 2022-10-19 16:39 ` David Lechner
2022-10-20 7:53 ` Linus Walleij
` (2 subsequent siblings)
3 siblings, 0 replies; 44+ messages in thread
From: David Lechner @ 2022-10-19 16:39 UTC (permalink / raw)
To: Arnd Bergmann, Sekhar Nori, Bartosz Golaszewski, linux-arm-kernel,
Michael Turquette, Stephen Boyd
Cc: linux-kernel, Kevin Hilman, Arnd Bergmann, Lukas Bulwahn,
Linus Walleij, linux-clk
On 10/19/22 10:29 AM, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> The davinci dm3xx machines are all removed, so the clk driver
> is no longer needed. The da8xx platforms are now using DT
> exclusively, so those drivers remain untouched.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
Reviewed-by: David Lechner <david@lechnology.com>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 44+ messages in thread
* Re: [PATCH 02/14] ARM: davinci: drop DAVINCI_DMxxx references
2022-10-19 16:37 ` David Lechner
@ 2022-10-19 20:32 ` Arnd Bergmann
0 siblings, 0 replies; 44+ messages in thread
From: Arnd Bergmann @ 2022-10-19 20:32 UTC (permalink / raw)
To: David Lechner, Arnd Bergmann, Sekhar Nori, Bartosz Golaszewski,
linux-arm-kernel, Michael Turquette, Stephen Boyd
Cc: linux-kernel, Kevin Hilman, linux-clk
On Wed, Oct 19, 2022, at 18:37, David Lechner wrote:
> On 10/19/22 10:29 AM, Arnd Bergmann wrote:
>> static u64 usb_dmamask = DMA_BIT_MASK(32);
>> @@ -67,14 +62,6 @@ void __init davinci_setup_usb(unsigned mA, unsigned potpgt_ms)
>> usb_data.power = mA > 510 ? 255 : mA / 2;
>> usb_data.potpgt = (potpgt_ms + 1) / 2;
>>
>> - if (cpu_is_davinci_dm646x()) {
>> - /* Override the defaults as DM6467 uses different IRQs. */
>> - usb_dev.resource[1].start = DAVINCI_INTC_IRQ(IRQ_DM646X_USBINT);
>> - usb_dev.resource[2].start = DAVINCI_INTC_IRQ(
>> - IRQ_DM646X_USBDMAINT);
>> - } else /* other devices don't have dedicated CPPI IRQ */
>> - usb_dev.num_resources = 2;
>> -
>> platform_device_register(&usb_dev);
>> }
>>
>
> Shouldn't the else case be kept since it applies to *all* "other devices"?
> (and therfore the usb_resources shouldn't be modified either?)
.num_resources is already initialized to 2 from ARRAY_SIZE(),
so it does not have to be changed afterwards.
Arnd
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 44+ messages in thread
* Re: [PATCH 11/14] pata: remove palmchip bk3710 driver
2022-10-19 15:29 ` [PATCH 11/14] pata: remove palmchip bk3710 driver Arnd Bergmann
@ 2022-10-19 23:17 ` Damien Le Moal
2022-10-20 7:09 ` Arnd Bergmann
2022-10-20 11:02 ` Sergey Shtylyov
` (2 subsequent siblings)
3 siblings, 1 reply; 44+ messages in thread
From: Damien Le Moal @ 2022-10-19 23:17 UTC (permalink / raw)
To: Arnd Bergmann, Sekhar Nori, Bartosz Golaszewski, linux-arm-kernel
Cc: linux-kernel, Kevin Hilman, Arnd Bergmann, Sergey Shtylyov,
Hannes Reinecke, linux-ide
On 10/20/22 00:29, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> This device was used only on the davinci dm644x platform that
> is now gone, and no references to the device remain in the
> kernel.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Great, one less pata/ide driver !
I can queue this in ata tree. I do have some changes in ata Kconfig queued
already, but they should not conflict.
Cheers.
> ---
> drivers/ata/Kconfig | 10 -
> drivers/ata/Makefile | 1 -
> drivers/ata/pata_bk3710.c | 380 --------------------------------------
> 3 files changed, 391 deletions(-)
> delete mode 100644 drivers/ata/pata_bk3710.c
>
> diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig
> index 36833a862998..2986fc9c797e 100644
> --- a/drivers/ata/Kconfig
> +++ b/drivers/ata/Kconfig
> @@ -609,16 +609,6 @@ config PATA_ATP867X
>
> If unsure, say N.
>
> -config PATA_BK3710
> - tristate "Palmchip BK3710 PATA support"
> - depends on ARCH_DAVINCI || COMPILE_TEST
> - select PATA_TIMINGS
> - help
> - This option enables support for the integrated IDE controller on
> - the TI DaVinci SoC.
> -
> - If unsure, say N.
> -
> config PATA_CMD64X
> tristate "CMD64x PATA support"
> depends on PCI
> diff --git a/drivers/ata/Makefile b/drivers/ata/Makefile
> index 34623365d9a6..d2e36d367274 100644
> --- a/drivers/ata/Makefile
> +++ b/drivers/ata/Makefile
> @@ -54,7 +54,6 @@ obj-$(CONFIG_PATA_AMD) += pata_amd.o
> obj-$(CONFIG_PATA_ARTOP) += pata_artop.o
> obj-$(CONFIG_PATA_ATIIXP) += pata_atiixp.o
> obj-$(CONFIG_PATA_ATP867X) += pata_atp867x.o
> -obj-$(CONFIG_PATA_BK3710) += pata_bk3710.o
> obj-$(CONFIG_PATA_CMD64X) += pata_cmd64x.o
> obj-$(CONFIG_PATA_CS5520) += pata_cs5520.o
> obj-$(CONFIG_PATA_CS5530) += pata_cs5530.o
> diff --git a/drivers/ata/pata_bk3710.c b/drivers/ata/pata_bk3710.c
> deleted file mode 100644
> index fad95cfecced..000000000000
> --- a/drivers/ata/pata_bk3710.c
> +++ /dev/null
> @@ -1,380 +0,0 @@
> -// SPDX-License-Identifier: GPL-2.0
> -
> -/*
> - * Palmchip BK3710 PATA controller driver
> - *
> - * Copyright (c) 2017 Samsung Electronics Co., Ltd.
> - * http://www.samsung.com
> - *
> - * Based on palm_bk3710.c:
> - *
> - * Copyright (C) 2006 Texas Instruments.
> - * Copyright (C) 2007 MontaVista Software, Inc., <source@mvista.com>
> - */
> -
> -#include <linux/ata.h>
> -#include <linux/clk.h>
> -#include <linux/delay.h>
> -#include <linux/init.h>
> -#include <linux/ioport.h>
> -#include <linux/kernel.h>
> -#include <linux/libata.h>
> -#include <linux/module.h>
> -#include <linux/platform_device.h>
> -#include <linux/types.h>
> -
> -#define DRV_NAME "pata_bk3710"
> -
> -#define BK3710_TF_OFFSET 0x1F0
> -#define BK3710_CTL_OFFSET 0x3F6
> -
> -#define BK3710_BMISP 0x02
> -#define BK3710_IDETIMP 0x40
> -#define BK3710_UDMACTL 0x48
> -#define BK3710_MISCCTL 0x50
> -#define BK3710_REGSTB 0x54
> -#define BK3710_REGRCVR 0x58
> -#define BK3710_DATSTB 0x5C
> -#define BK3710_DATRCVR 0x60
> -#define BK3710_DMASTB 0x64
> -#define BK3710_DMARCVR 0x68
> -#define BK3710_UDMASTB 0x6C
> -#define BK3710_UDMATRP 0x70
> -#define BK3710_UDMAENV 0x74
> -#define BK3710_IORDYTMP 0x78
> -
> -static struct scsi_host_template pata_bk3710_sht = {
> - ATA_BMDMA_SHT(DRV_NAME),
> -};
> -
> -static unsigned int ideclk_period; /* in nanoseconds */
> -
> -struct pata_bk3710_udmatiming {
> - unsigned int rptime; /* tRP -- Ready to pause time (nsec) */
> - unsigned int cycletime; /* tCYCTYP2/2 -- avg Cycle Time (nsec) */
> - /* tENV is always a minimum of 20 nsec */
> -};
> -
> -static const struct pata_bk3710_udmatiming pata_bk3710_udmatimings[6] = {
> - { 160, 240 / 2 }, /* UDMA Mode 0 */
> - { 125, 160 / 2 }, /* UDMA Mode 1 */
> - { 100, 120 / 2 }, /* UDMA Mode 2 */
> - { 100, 90 / 2 }, /* UDMA Mode 3 */
> - { 100, 60 / 2 }, /* UDMA Mode 4 */
> - { 85, 40 / 2 }, /* UDMA Mode 5 */
> -};
> -
> -static void pata_bk3710_setudmamode(void __iomem *base, unsigned int dev,
> - unsigned int mode)
> -{
> - u32 val32;
> - u16 val16;
> - u8 tenv, trp, t0;
> -
> - /* DMA Data Setup */
> - t0 = DIV_ROUND_UP(pata_bk3710_udmatimings[mode].cycletime,
> - ideclk_period) - 1;
> - tenv = DIV_ROUND_UP(20, ideclk_period) - 1;
> - trp = DIV_ROUND_UP(pata_bk3710_udmatimings[mode].rptime,
> - ideclk_period) - 1;
> -
> - /* udmastb Ultra DMA Access Strobe Width */
> - val32 = ioread32(base + BK3710_UDMASTB) & (0xFF << (dev ? 0 : 8));
> - val32 |= t0 << (dev ? 8 : 0);
> - iowrite32(val32, base + BK3710_UDMASTB);
> -
> - /* udmatrp Ultra DMA Ready to Pause Time */
> - val32 = ioread32(base + BK3710_UDMATRP) & (0xFF << (dev ? 0 : 8));
> - val32 |= trp << (dev ? 8 : 0);
> - iowrite32(val32, base + BK3710_UDMATRP);
> -
> - /* udmaenv Ultra DMA envelop Time */
> - val32 = ioread32(base + BK3710_UDMAENV) & (0xFF << (dev ? 0 : 8));
> - val32 |= tenv << (dev ? 8 : 0);
> - iowrite32(val32, base + BK3710_UDMAENV);
> -
> - /* Enable UDMA for Device */
> - val16 = ioread16(base + BK3710_UDMACTL) | (1 << dev);
> - iowrite16(val16, base + BK3710_UDMACTL);
> -}
> -
> -static void pata_bk3710_setmwdmamode(void __iomem *base, unsigned int dev,
> - unsigned short min_cycle,
> - unsigned int mode)
> -{
> - const struct ata_timing *t;
> - int cycletime;
> - u32 val32;
> - u16 val16;
> - u8 td, tkw, t0;
> -
> - t = ata_timing_find_mode(mode);
> - cycletime = max_t(int, t->cycle, min_cycle);
> -
> - /* DMA Data Setup */
> - t0 = DIV_ROUND_UP(cycletime, ideclk_period);
> - td = DIV_ROUND_UP(t->active, ideclk_period);
> - tkw = t0 - td - 1;
> - td--;
> -
> - val32 = ioread32(base + BK3710_DMASTB) & (0xFF << (dev ? 0 : 8));
> - val32 |= td << (dev ? 8 : 0);
> - iowrite32(val32, base + BK3710_DMASTB);
> -
> - val32 = ioread32(base + BK3710_DMARCVR) & (0xFF << (dev ? 0 : 8));
> - val32 |= tkw << (dev ? 8 : 0);
> - iowrite32(val32, base + BK3710_DMARCVR);
> -
> - /* Disable UDMA for Device */
> - val16 = ioread16(base + BK3710_UDMACTL) & ~(1 << dev);
> - iowrite16(val16, base + BK3710_UDMACTL);
> -}
> -
> -static void pata_bk3710_set_dmamode(struct ata_port *ap,
> - struct ata_device *adev)
> -{
> - void __iomem *base = (void __iomem *)ap->ioaddr.bmdma_addr;
> - int is_slave = adev->devno;
> - const u8 xferspeed = adev->dma_mode;
> -
> - if (xferspeed >= XFER_UDMA_0)
> - pata_bk3710_setudmamode(base, is_slave,
> - xferspeed - XFER_UDMA_0);
> - else
> - pata_bk3710_setmwdmamode(base, is_slave,
> - adev->id[ATA_ID_EIDE_DMA_MIN],
> - xferspeed);
> -}
> -
> -static void pata_bk3710_setpiomode(void __iomem *base, struct ata_device *pair,
> - unsigned int dev, unsigned int cycletime,
> - unsigned int mode)
> -{
> - const struct ata_timing *t;
> - u32 val32;
> - u8 t2, t2i, t0;
> -
> - t = ata_timing_find_mode(XFER_PIO_0 + mode);
> -
> - /* PIO Data Setup */
> - t0 = DIV_ROUND_UP(cycletime, ideclk_period);
> - t2 = DIV_ROUND_UP(t->active, ideclk_period);
> -
> - t2i = t0 - t2 - 1;
> - t2--;
> -
> - val32 = ioread32(base + BK3710_DATSTB) & (0xFF << (dev ? 0 : 8));
> - val32 |= t2 << (dev ? 8 : 0);
> - iowrite32(val32, base + BK3710_DATSTB);
> -
> - val32 = ioread32(base + BK3710_DATRCVR) & (0xFF << (dev ? 0 : 8));
> - val32 |= t2i << (dev ? 8 : 0);
> - iowrite32(val32, base + BK3710_DATRCVR);
> -
> - /* FIXME: this is broken also in the old driver */
> - if (pair) {
> - u8 mode2 = pair->pio_mode - XFER_PIO_0;
> -
> - if (mode2 < mode)
> - mode = mode2;
> - }
> -
> - /* TASKFILE Setup */
> - t0 = DIV_ROUND_UP(t->cyc8b, ideclk_period);
> - t2 = DIV_ROUND_UP(t->act8b, ideclk_period);
> -
> - t2i = t0 - t2 - 1;
> - t2--;
> -
> - val32 = ioread32(base + BK3710_REGSTB) & (0xFF << (dev ? 0 : 8));
> - val32 |= t2 << (dev ? 8 : 0);
> - iowrite32(val32, base + BK3710_REGSTB);
> -
> - val32 = ioread32(base + BK3710_REGRCVR) & (0xFF << (dev ? 0 : 8));
> - val32 |= t2i << (dev ? 8 : 0);
> - iowrite32(val32, base + BK3710_REGRCVR);
> -}
> -
> -static void pata_bk3710_set_piomode(struct ata_port *ap,
> - struct ata_device *adev)
> -{
> - void __iomem *base = (void __iomem *)ap->ioaddr.bmdma_addr;
> - struct ata_device *pair = ata_dev_pair(adev);
> - const struct ata_timing *t = ata_timing_find_mode(adev->pio_mode);
> - const u16 *id = adev->id;
> - unsigned int cycle_time = 0;
> - int is_slave = adev->devno;
> - const u8 pio = adev->pio_mode - XFER_PIO_0;
> -
> - if (id[ATA_ID_FIELD_VALID] & 2) {
> - if (ata_id_has_iordy(id))
> - cycle_time = id[ATA_ID_EIDE_PIO_IORDY];
> - else
> - cycle_time = id[ATA_ID_EIDE_PIO];
> -
> - /* conservative "downgrade" for all pre-ATA2 drives */
> - if (pio < 3 && cycle_time < t->cycle)
> - cycle_time = 0; /* use standard timing */
> - }
> -
> - if (!cycle_time)
> - cycle_time = t->cycle;
> -
> - pata_bk3710_setpiomode(base, pair, is_slave, cycle_time, pio);
> -}
> -
> -static void pata_bk3710_chipinit(void __iomem *base)
> -{
> - /*
> - * REVISIT: the ATA reset signal needs to be managed through a
> - * GPIO, which means it should come from platform_data. Until
> - * we get and use such information, we have to trust that things
> - * have been reset before we get here.
> - */
> -
> - /*
> - * Program the IDETIMP Register Value based on the following assumptions
> - *
> - * (ATA_IDETIMP_IDEEN , ENABLE ) |
> - * (ATA_IDETIMP_PREPOST1 , DISABLE) |
> - * (ATA_IDETIMP_PREPOST0 , DISABLE) |
> - *
> - * DM6446 silicon rev 2.1 and earlier have no observed net benefit
> - * from enabling prefetch/postwrite.
> - */
> - iowrite16(BIT(15), base + BK3710_IDETIMP);
> -
> - /*
> - * UDMACTL Ultra-ATA DMA Control
> - * (ATA_UDMACTL_UDMAP1 , 0 ) |
> - * (ATA_UDMACTL_UDMAP0 , 0 )
> - *
> - */
> - iowrite16(0, base + BK3710_UDMACTL);
> -
> - /*
> - * MISCCTL Miscellaneous Conrol Register
> - * (ATA_MISCCTL_HWNHLD1P , 1 cycle)
> - * (ATA_MISCCTL_HWNHLD0P , 1 cycle)
> - * (ATA_MISCCTL_TIMORIDE , 1)
> - */
> - iowrite32(0x001, base + BK3710_MISCCTL);
> -
> - /*
> - * IORDYTMP IORDY Timer for Primary Register
> - * (ATA_IORDYTMP_IORDYTMP , DISABLE)
> - */
> - iowrite32(0, base + BK3710_IORDYTMP);
> -
> - /*
> - * Configure BMISP Register
> - * (ATA_BMISP_DMAEN1 , DISABLE ) |
> - * (ATA_BMISP_DMAEN0 , DISABLE ) |
> - * (ATA_BMISP_IORDYINT , CLEAR) |
> - * (ATA_BMISP_INTRSTAT , CLEAR) |
> - * (ATA_BMISP_DMAERROR , CLEAR)
> - */
> - iowrite16(0xE, base + BK3710_BMISP);
> -
> - pata_bk3710_setpiomode(base, NULL, 0, 600, 0);
> - pata_bk3710_setpiomode(base, NULL, 1, 600, 0);
> -}
> -
> -static struct ata_port_operations pata_bk3710_ports_ops = {
> - .inherits = &ata_bmdma_port_ops,
> - .cable_detect = ata_cable_80wire,
> -
> - .set_piomode = pata_bk3710_set_piomode,
> - .set_dmamode = pata_bk3710_set_dmamode,
> -};
> -
> -static int __init pata_bk3710_probe(struct platform_device *pdev)
> -{
> - struct clk *clk;
> - struct resource *mem;
> - struct ata_host *host;
> - struct ata_port *ap;
> - void __iomem *base;
> - unsigned long rate;
> - int irq;
> -
> - clk = devm_clk_get(&pdev->dev, NULL);
> - if (IS_ERR(clk))
> - return -ENODEV;
> -
> - clk_enable(clk);
> - rate = clk_get_rate(clk);
> - if (!rate)
> - return -EINVAL;
> -
> - /* NOTE: round *down* to meet minimum timings; we count in clocks */
> - ideclk_period = 1000000000UL / rate;
> -
> - mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -
> - irq = platform_get_irq(pdev, 0);
> - if (irq < 0) {
> - pr_err(DRV_NAME ": failed to get IRQ resource\n");
> - return irq;
> - }
> -
> - base = devm_ioremap_resource(&pdev->dev, mem);
> - if (IS_ERR(base))
> - return PTR_ERR(base);
> -
> - /* configure the Palmchip controller */
> - pata_bk3710_chipinit(base);
> -
> - /* allocate host */
> - host = ata_host_alloc(&pdev->dev, 1);
> - if (!host)
> - return -ENOMEM;
> - ap = host->ports[0];
> -
> - ap->ops = &pata_bk3710_ports_ops;
> - ap->pio_mask = ATA_PIO4;
> - ap->mwdma_mask = ATA_MWDMA2;
> - ap->udma_mask = rate < 100000000 ? ATA_UDMA4 : ATA_UDMA5;
> - ap->flags |= ATA_FLAG_SLAVE_POSS;
> -
> - ap->ioaddr.data_addr = base + BK3710_TF_OFFSET;
> - ap->ioaddr.error_addr = base + BK3710_TF_OFFSET + 1;
> - ap->ioaddr.feature_addr = base + BK3710_TF_OFFSET + 1;
> - ap->ioaddr.nsect_addr = base + BK3710_TF_OFFSET + 2;
> - ap->ioaddr.lbal_addr = base + BK3710_TF_OFFSET + 3;
> - ap->ioaddr.lbam_addr = base + BK3710_TF_OFFSET + 4;
> - ap->ioaddr.lbah_addr = base + BK3710_TF_OFFSET + 5;
> - ap->ioaddr.device_addr = base + BK3710_TF_OFFSET + 6;
> - ap->ioaddr.status_addr = base + BK3710_TF_OFFSET + 7;
> - ap->ioaddr.command_addr = base + BK3710_TF_OFFSET + 7;
> -
> - ap->ioaddr.altstatus_addr = base + BK3710_CTL_OFFSET;
> - ap->ioaddr.ctl_addr = base + BK3710_CTL_OFFSET;
> -
> - ap->ioaddr.bmdma_addr = base;
> -
> - ata_port_desc(ap, "cmd 0x%lx ctl 0x%lx",
> - (unsigned long)base + BK3710_TF_OFFSET,
> - (unsigned long)base + BK3710_CTL_OFFSET);
> -
> - /* activate */
> - return ata_host_activate(host, irq, ata_sff_interrupt, 0,
> - &pata_bk3710_sht);
> -}
> -
> -/* work with hotplug and coldplug */
> -MODULE_ALIAS("platform:palm_bk3710");
> -
> -static struct platform_driver pata_bk3710_driver = {
> - .driver = {
> - .name = "palm_bk3710",
> - },
> -};
> -
> -static int __init pata_bk3710_init(void)
> -{
> - return platform_driver_probe(&pata_bk3710_driver, pata_bk3710_probe);
> -}
> -
> -module_init(pata_bk3710_init);
> -MODULE_LICENSE("GPL v2");
--
Damien Le Moal
Western Digital Research
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 44+ messages in thread
* Re: [PATCH 11/14] pata: remove palmchip bk3710 driver
2022-10-19 23:17 ` Damien Le Moal
@ 2022-10-20 7:09 ` Arnd Bergmann
0 siblings, 0 replies; 44+ messages in thread
From: Arnd Bergmann @ 2022-10-20 7:09 UTC (permalink / raw)
To: Damien Le Moal, Arnd Bergmann, Sekhar Nori, Bartosz Golaszewski,
linux-arm-kernel
Cc: linux-kernel, Kevin Hilman, Sergey Shtylyov, Hannes Reinecke,
linux-ide
On Thu, Oct 20, 2022, at 01:17, Damien Le Moal wrote:
> On 10/20/22 00:29, Arnd Bergmann wrote:
>> From: Arnd Bergmann <arnd@arndb.de>
>>
>> This device was used only on the davinci dm644x platform that
>> is now gone, and no references to the device remain in the
>> kernel.
>>
>> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>
> Great, one less pata/ide driver !
> I can queue this in ata tree. I do have some changes in ata Kconfig queued
> already, but they should not conflict.
I have two more patches coming today: the palmld and samsung_cf drivers.
You can apply all three as they come in, otherwise I'll
just keep them in my tree along with the arch/arm/ boardfile
removal.
Arnd
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 44+ messages in thread
* Re: [PATCH 04/14] clk: remove davinci dm3xx drivers
2022-10-19 15:29 ` [PATCH 04/14] clk: remove davinci dm3xx drivers Arnd Bergmann
2022-10-19 16:39 ` David Lechner
@ 2022-10-20 7:53 ` Linus Walleij
2022-10-20 11:44 ` Bartosz Golaszewski
2022-10-27 1:10 ` Stephen Boyd
3 siblings, 0 replies; 44+ messages in thread
From: Linus Walleij @ 2022-10-20 7:53 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Sekhar Nori, Bartosz Golaszewski, linux-arm-kernel, David Lechner,
Michael Turquette, Stephen Boyd, linux-kernel, Kevin Hilman,
Arnd Bergmann, Lukas Bulwahn, linux-clk
On Wed, Oct 19, 2022 at 5:33 PM Arnd Bergmann <arnd@kernel.org> wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> The davinci dm3xx machines are all removed, so the clk driver
> is no longer needed. The da8xx platforms are now using DT
> exclusively, so those drivers remain untouched.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Yours,
Linus Walleij
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 44+ messages in thread
* Re: [PATCH 07/14] input: remove davinci keyboard driver
2022-10-19 15:29 ` [PATCH 07/14] input: remove davinci keyboard driver Arnd Bergmann
@ 2022-10-20 8:02 ` Mattijs Korpershoek
2022-10-20 11:17 ` Bartosz Golaszewski
1 sibling, 0 replies; 44+ messages in thread
From: Mattijs Korpershoek @ 2022-10-20 8:02 UTC (permalink / raw)
To: Arnd Bergmann, Sekhar Nori, Bartosz Golaszewski, linux-arm-kernel,
Dmitry Torokhov
Cc: linux-kernel, Kevin Hilman, Arnd Bergmann, Andy Shevchenko,
linux-input
On Wed, Oct 19, 2022 at 17:29, Arnd Bergmann <arnd@kernel.org> wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> The dm365evm board was removed, and no other users of this
> device exist.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
> ---
> drivers/input/keyboard/Kconfig | 10 -
> drivers/input/keyboard/Makefile | 1 -
> drivers/input/keyboard/davinci_keyscan.c | 315 -----------------------
> 3 files changed, 326 deletions(-)
> delete mode 100644 drivers/input/keyboard/davinci_keyscan.c
>
> diff --git a/drivers/input/keyboard/Kconfig b/drivers/input/keyboard/Kconfig
> index 00292118b79b..957cc6728f4c 100644
> --- a/drivers/input/keyboard/Kconfig
> +++ b/drivers/input/keyboard/Kconfig
> @@ -657,16 +657,6 @@ config KEYBOARD_SUN4I_LRADC
> To compile this driver as a module, choose M here: the
> module will be called sun4i-lradc-keys.
>
> -config KEYBOARD_DAVINCI
> - tristate "TI DaVinci Key Scan"
> - depends on ARCH_DAVINCI_DM365
> - help
> - Say Y to enable keypad module support for the TI DaVinci
> - platforms (DM365).
> -
> - To compile this driver as a module, choose M here: the
> - module will be called davinci_keyscan.
> -
> config KEYBOARD_IPAQ_MICRO
> tristate "Buttons on Micro SoC (iPaq h3100,h3600,h3700)"
> depends on MFD_IPAQ_MICRO
> diff --git a/drivers/input/keyboard/Makefile b/drivers/input/keyboard/Makefile
> index 5f67196bb2c1..5ccfdf5c0222 100644
> --- a/drivers/input/keyboard/Makefile
> +++ b/drivers/input/keyboard/Makefile
> @@ -18,7 +18,6 @@ obj-$(CONFIG_KEYBOARD_CAP11XX) += cap11xx.o
> obj-$(CONFIG_KEYBOARD_CLPS711X) += clps711x-keypad.o
> obj-$(CONFIG_KEYBOARD_CROS_EC) += cros_ec_keyb.o
> obj-$(CONFIG_KEYBOARD_CYPRESS_SF) += cypress-sf.o
> -obj-$(CONFIG_KEYBOARD_DAVINCI) += davinci_keyscan.o
> obj-$(CONFIG_KEYBOARD_DLINK_DIR685) += dlink-dir685-touchkeys.o
> obj-$(CONFIG_KEYBOARD_EP93XX) += ep93xx_keypad.o
> obj-$(CONFIG_KEYBOARD_GOLDFISH_EVENTS) += goldfish_events.o
> diff --git a/drivers/input/keyboard/davinci_keyscan.c b/drivers/input/keyboard/davinci_keyscan.c
> deleted file mode 100644
> index f489cd585b33..000000000000
> --- a/drivers/input/keyboard/davinci_keyscan.c
> +++ /dev/null
> @@ -1,315 +0,0 @@
> -// SPDX-License-Identifier: GPL-2.0-or-later
> -/*
> - * DaVinci Key Scan Driver for TI platforms
> - *
> - * Copyright (C) 2009 Texas Instruments, Inc
> - *
> - * Author: Miguel Aguilar <miguel.aguilar@ridgerun.com>
> - *
> - * Initial Code: Sandeep Paulraj <s-paulraj@ti.com>
> - */
> -#include <linux/module.h>
> -#include <linux/init.h>
> -#include <linux/interrupt.h>
> -#include <linux/types.h>
> -#include <linux/input.h>
> -#include <linux/kernel.h>
> -#include <linux/delay.h>
> -#include <linux/platform_device.h>
> -#include <linux/errno.h>
> -#include <linux/slab.h>
> -
> -#include <linux/platform_data/keyscan-davinci.h>
> -
> -/* Key scan registers */
> -#define DAVINCI_KEYSCAN_KEYCTRL 0x0000
> -#define DAVINCI_KEYSCAN_INTENA 0x0004
> -#define DAVINCI_KEYSCAN_INTFLAG 0x0008
> -#define DAVINCI_KEYSCAN_INTCLR 0x000c
> -#define DAVINCI_KEYSCAN_STRBWIDTH 0x0010
> -#define DAVINCI_KEYSCAN_INTERVAL 0x0014
> -#define DAVINCI_KEYSCAN_CONTTIME 0x0018
> -#define DAVINCI_KEYSCAN_CURRENTST 0x001c
> -#define DAVINCI_KEYSCAN_PREVSTATE 0x0020
> -#define DAVINCI_KEYSCAN_EMUCTRL 0x0024
> -#define DAVINCI_KEYSCAN_IODFTCTRL 0x002c
> -
> -/* Key Control Register (KEYCTRL) */
> -#define DAVINCI_KEYSCAN_KEYEN 0x00000001
> -#define DAVINCI_KEYSCAN_PREVMODE 0x00000002
> -#define DAVINCI_KEYSCAN_CHATOFF 0x00000004
> -#define DAVINCI_KEYSCAN_AUTODET 0x00000008
> -#define DAVINCI_KEYSCAN_SCANMODE 0x00000010
> -#define DAVINCI_KEYSCAN_OUTTYPE 0x00000020
> -
> -/* Masks for the interrupts */
> -#define DAVINCI_KEYSCAN_INT_CONT 0x00000008
> -#define DAVINCI_KEYSCAN_INT_OFF 0x00000004
> -#define DAVINCI_KEYSCAN_INT_ON 0x00000002
> -#define DAVINCI_KEYSCAN_INT_CHANGE 0x00000001
> -#define DAVINCI_KEYSCAN_INT_ALL 0x0000000f
> -
> -struct davinci_ks {
> - struct input_dev *input;
> - struct davinci_ks_platform_data *pdata;
> - int irq;
> - void __iomem *base;
> - resource_size_t pbase;
> - size_t base_size;
> - unsigned short keymap[];
> -};
> -
> -/* Initializing the kp Module */
> -static int __init davinci_ks_initialize(struct davinci_ks *davinci_ks)
> -{
> - struct device *dev = &davinci_ks->input->dev;
> - struct davinci_ks_platform_data *pdata = davinci_ks->pdata;
> - u32 matrix_ctrl;
> -
> - /* Enable all interrupts */
> - __raw_writel(DAVINCI_KEYSCAN_INT_ALL,
> - davinci_ks->base + DAVINCI_KEYSCAN_INTENA);
> -
> - /* Clear interrupts if any */
> - __raw_writel(DAVINCI_KEYSCAN_INT_ALL,
> - davinci_ks->base + DAVINCI_KEYSCAN_INTCLR);
> -
> - /* Setup the scan period = strobe + interval */
> - __raw_writel(pdata->strobe,
> - davinci_ks->base + DAVINCI_KEYSCAN_STRBWIDTH);
> - __raw_writel(pdata->interval,
> - davinci_ks->base + DAVINCI_KEYSCAN_INTERVAL);
> - __raw_writel(0x01,
> - davinci_ks->base + DAVINCI_KEYSCAN_CONTTIME);
> -
> - /* Define matrix type */
> - switch (pdata->matrix_type) {
> - case DAVINCI_KEYSCAN_MATRIX_4X4:
> - matrix_ctrl = 0;
> - break;
> - case DAVINCI_KEYSCAN_MATRIX_5X3:
> - matrix_ctrl = (1 << 6);
> - break;
> - default:
> - dev_err(dev->parent, "wrong matrix type\n");
> - return -EINVAL;
> - }
> -
> - /* Enable key scan module and set matrix type */
> - __raw_writel(DAVINCI_KEYSCAN_AUTODET | DAVINCI_KEYSCAN_KEYEN |
> - matrix_ctrl, davinci_ks->base + DAVINCI_KEYSCAN_KEYCTRL);
> -
> - return 0;
> -}
> -
> -static irqreturn_t davinci_ks_interrupt(int irq, void *dev_id)
> -{
> - struct davinci_ks *davinci_ks = dev_id;
> - struct device *dev = &davinci_ks->input->dev;
> - unsigned short *keymap = davinci_ks->keymap;
> - int keymapsize = davinci_ks->pdata->keymapsize;
> - u32 prev_status, new_status, changed;
> - bool release;
> - int keycode = KEY_UNKNOWN;
> - int i;
> -
> - /* Disable interrupt */
> - __raw_writel(0x0, davinci_ks->base + DAVINCI_KEYSCAN_INTENA);
> -
> - /* Reading previous and new status of the key scan */
> - prev_status = __raw_readl(davinci_ks->base + DAVINCI_KEYSCAN_PREVSTATE);
> - new_status = __raw_readl(davinci_ks->base + DAVINCI_KEYSCAN_CURRENTST);
> -
> - changed = prev_status ^ new_status;
> -
> - if (changed) {
> - /*
> - * It goes through all bits in 'changed' to ensure
> - * that no key changes are being missed
> - */
> - for (i = 0 ; i < keymapsize; i++) {
> - if ((changed>>i) & 0x1) {
> - keycode = keymap[i];
> - release = (new_status >> i) & 0x1;
> - dev_dbg(dev->parent, "key %d %s\n", keycode,
> - release ? "released" : "pressed");
> - input_report_key(davinci_ks->input, keycode,
> - !release);
> - input_sync(davinci_ks->input);
> - }
> - }
> - /* Clearing interrupt */
> - __raw_writel(DAVINCI_KEYSCAN_INT_ALL,
> - davinci_ks->base + DAVINCI_KEYSCAN_INTCLR);
> - }
> -
> - /* Enable interrupts */
> - __raw_writel(0x1, davinci_ks->base + DAVINCI_KEYSCAN_INTENA);
> -
> - return IRQ_HANDLED;
> -}
> -
> -static int __init davinci_ks_probe(struct platform_device *pdev)
> -{
> - struct davinci_ks *davinci_ks;
> - struct input_dev *key_dev;
> - struct resource *res, *mem;
> - struct device *dev = &pdev->dev;
> - struct davinci_ks_platform_data *pdata = dev_get_platdata(dev);
> - int error, i;
> -
> - if (pdata->device_enable) {
> - error = pdata->device_enable(dev);
> - if (error < 0) {
> - dev_dbg(dev, "device enable function failed\n");
> - return error;
> - }
> - }
> -
> - if (!pdata->keymap) {
> - dev_dbg(dev, "no keymap from pdata\n");
> - return -EINVAL;
> - }
> -
> - davinci_ks = kzalloc(sizeof(struct davinci_ks) +
> - sizeof(unsigned short) * pdata->keymapsize, GFP_KERNEL);
> - if (!davinci_ks) {
> - dev_dbg(dev, "could not allocate memory for private data\n");
> - return -ENOMEM;
> - }
> -
> - memcpy(davinci_ks->keymap, pdata->keymap,
> - sizeof(unsigned short) * pdata->keymapsize);
> -
> - key_dev = input_allocate_device();
> - if (!key_dev) {
> - dev_dbg(dev, "could not allocate input device\n");
> - error = -ENOMEM;
> - goto fail1;
> - }
> -
> - davinci_ks->input = key_dev;
> -
> - davinci_ks->irq = platform_get_irq(pdev, 0);
> - if (davinci_ks->irq < 0) {
> - error = davinci_ks->irq;
> - goto fail2;
> - }
> -
> - res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> - if (!res) {
> - dev_err(dev, "no mem resource\n");
> - error = -EINVAL;
> - goto fail2;
> - }
> -
> - davinci_ks->pbase = res->start;
> - davinci_ks->base_size = resource_size(res);
> -
> - mem = request_mem_region(davinci_ks->pbase, davinci_ks->base_size,
> - pdev->name);
> - if (!mem) {
> - dev_err(dev, "key scan registers at %08x are not free\n",
> - davinci_ks->pbase);
> - error = -EBUSY;
> - goto fail2;
> - }
> -
> - davinci_ks->base = ioremap(davinci_ks->pbase, davinci_ks->base_size);
> - if (!davinci_ks->base) {
> - dev_err(dev, "can't ioremap MEM resource.\n");
> - error = -ENOMEM;
> - goto fail3;
> - }
> -
> - /* Enable auto repeat feature of Linux input subsystem */
> - if (pdata->rep)
> - __set_bit(EV_REP, key_dev->evbit);
> -
> - /* Setup input device */
> - __set_bit(EV_KEY, key_dev->evbit);
> -
> - /* Setup the platform data */
> - davinci_ks->pdata = pdata;
> -
> - for (i = 0; i < davinci_ks->pdata->keymapsize; i++)
> - __set_bit(davinci_ks->pdata->keymap[i], key_dev->keybit);
> -
> - key_dev->name = "davinci_keyscan";
> - key_dev->phys = "davinci_keyscan/input0";
> - key_dev->dev.parent = dev;
> - key_dev->id.bustype = BUS_HOST;
> - key_dev->id.vendor = 0x0001;
> - key_dev->id.product = 0x0001;
> - key_dev->id.version = 0x0001;
> - key_dev->keycode = davinci_ks->keymap;
> - key_dev->keycodesize = sizeof(davinci_ks->keymap[0]);
> - key_dev->keycodemax = davinci_ks->pdata->keymapsize;
> -
> - error = input_register_device(davinci_ks->input);
> - if (error < 0) {
> - dev_err(dev, "unable to register davinci key scan device\n");
> - goto fail4;
> - }
> -
> - error = request_irq(davinci_ks->irq, davinci_ks_interrupt,
> - 0, pdev->name, davinci_ks);
> - if (error < 0) {
> - dev_err(dev, "unable to register davinci key scan interrupt\n");
> - goto fail5;
> - }
> -
> - error = davinci_ks_initialize(davinci_ks);
> - if (error < 0) {
> - dev_err(dev, "unable to initialize davinci key scan device\n");
> - goto fail6;
> - }
> -
> - platform_set_drvdata(pdev, davinci_ks);
> - return 0;
> -
> -fail6:
> - free_irq(davinci_ks->irq, davinci_ks);
> -fail5:
> - input_unregister_device(davinci_ks->input);
> - key_dev = NULL;
> -fail4:
> - iounmap(davinci_ks->base);
> -fail3:
> - release_mem_region(davinci_ks->pbase, davinci_ks->base_size);
> -fail2:
> - input_free_device(key_dev);
> -fail1:
> - kfree(davinci_ks);
> -
> - return error;
> -}
> -
> -static int davinci_ks_remove(struct platform_device *pdev)
> -{
> - struct davinci_ks *davinci_ks = platform_get_drvdata(pdev);
> -
> - free_irq(davinci_ks->irq, davinci_ks);
> -
> - input_unregister_device(davinci_ks->input);
> -
> - iounmap(davinci_ks->base);
> - release_mem_region(davinci_ks->pbase, davinci_ks->base_size);
> -
> - kfree(davinci_ks);
> -
> - return 0;
> -}
> -
> -static struct platform_driver davinci_ks_driver = {
> - .driver = {
> - .name = "davinci_keyscan",
> - },
> - .remove = davinci_ks_remove,
> -};
> -
> -module_platform_driver_probe(davinci_ks_driver, davinci_ks_probe);
> -
> -MODULE_AUTHOR("Miguel Aguilar");
> -MODULE_DESCRIPTION("Texas Instruments DaVinci Key Scan Driver");
> -MODULE_LICENSE("GPL");
> --
> 2.29.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 44+ messages in thread
* Re: [PATCH 11/14] pata: remove palmchip bk3710 driver
2022-10-19 15:29 ` [PATCH 11/14] pata: remove palmchip bk3710 driver Arnd Bergmann
2022-10-19 23:17 ` Damien Le Moal
@ 2022-10-20 11:02 ` Sergey Shtylyov
2022-10-20 11:18 ` Bartosz Golaszewski
2022-10-20 23:03 ` Damien Le Moal
3 siblings, 0 replies; 44+ messages in thread
From: Sergey Shtylyov @ 2022-10-20 11:02 UTC (permalink / raw)
To: Arnd Bergmann, Sekhar Nori, Bartosz Golaszewski, linux-arm-kernel,
Damien Le Moal
Cc: linux-kernel, Kevin Hilman, Arnd Bergmann, Hannes Reinecke,
linux-ide
On 10/19/22 6:29 PM, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> This device was used only on the davinci dm644x platform that
Well, DM646x too but...
> is now gone, and no references to the device remain in the
> kernel.
... in fact, I'm not seeing davinci_init_ide() called anywhere... :-/
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Sergey Shtylyov <s.shtylyov@omp.ru>
[...]
MBR, Sergey
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 44+ messages in thread
* Re: [PATCH 07/14] input: remove davinci keyboard driver
2022-10-19 15:29 ` [PATCH 07/14] input: remove davinci keyboard driver Arnd Bergmann
2022-10-20 8:02 ` Mattijs Korpershoek
@ 2022-10-20 11:17 ` Bartosz Golaszewski
1 sibling, 0 replies; 44+ messages in thread
From: Bartosz Golaszewski @ 2022-10-20 11:17 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Sekhar Nori, linux-arm-kernel, Dmitry Torokhov, linux-kernel,
Kevin Hilman, Arnd Bergmann, Andy Shevchenko, Mattijs Korpershoek,
linux-input
On Wed, Oct 19, 2022 at 5:36 PM Arnd Bergmann <arnd@kernel.org> wrote:
>
> From: Arnd Bergmann <arnd@arndb.de>
>
> The dm365evm board was removed, and no other users of this
> device exist.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
Acked-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 44+ messages in thread
* Re: [PATCH 11/14] pata: remove palmchip bk3710 driver
2022-10-19 15:29 ` [PATCH 11/14] pata: remove palmchip bk3710 driver Arnd Bergmann
2022-10-19 23:17 ` Damien Le Moal
2022-10-20 11:02 ` Sergey Shtylyov
@ 2022-10-20 11:18 ` Bartosz Golaszewski
2022-10-20 23:03 ` Damien Le Moal
3 siblings, 0 replies; 44+ messages in thread
From: Bartosz Golaszewski @ 2022-10-20 11:18 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Sekhar Nori, linux-arm-kernel, Damien Le Moal, linux-kernel,
Kevin Hilman, Arnd Bergmann, Sergey Shtylyov, Hannes Reinecke,
linux-ide
On Wed, Oct 19, 2022 at 5:38 PM Arnd Bergmann <arnd@kernel.org> wrote:
>
> From: Arnd Bergmann <arnd@arndb.de>
>
> This device was used only on the davinci dm644x platform that
> is now gone, and no references to the device remain in the
> kernel.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
Acked-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 44+ messages in thread
* Re: [PATCH 01/14] ARM: davinci: remove unused board support
[not found] ` <20221019152947.3857217-2-arnd@kernel.org>
@ 2022-10-20 11:27 ` Bartosz Golaszewski
0 siblings, 0 replies; 44+ messages in thread
From: Bartosz Golaszewski @ 2022-10-20 11:27 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Sekhar Nori, linux-arm-kernel, linux-kernel, Kevin Hilman,
Arnd Bergmann
On Wed, Oct 19, 2022 at 5:31 PM Arnd Bergmann <arnd@kernel.org> wrote:
>
> From: Arnd Bergmann <arnd@arndb.de>
>
> All Kconfig entries marked as "depends on UNUSED_BOARD_FILES"
> and their direct dependencies are removed here as planned.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
Acked-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 44+ messages in thread
* Re: [PATCH 03/14] ARM: davinci: clean up platform support
2022-10-19 15:29 ` [PATCH 03/14] ARM: davinci: clean up platform support Arnd Bergmann
@ 2022-10-20 11:32 ` Bartosz Golaszewski
0 siblings, 0 replies; 44+ messages in thread
From: Bartosz Golaszewski @ 2022-10-20 11:32 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Sekhar Nori, linux-arm-kernel, linux-kernel, Kevin Hilman,
Arnd Bergmann
On Wed, Oct 19, 2022 at 5:33 PM Arnd Bergmann <arnd@kernel.org> wrote:
>
> From: Arnd Bergmann <arnd@arndb.de>
>
> With the board file support gone, and the platform using
> DT only, a lot of the remaining code is no longer referenced
> and can be removed.
>
> Technically, the DT file only references DA850, but since that
> is very similar to DA830, I'm leaving the latter.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
Acked-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 44+ messages in thread
* Re: [PATCH 12/14] irqchip: remove davinci aintc driver
2022-10-19 15:29 ` [PATCH 12/14] irqchip: remove davinci aintc driver Arnd Bergmann
@ 2022-10-20 11:33 ` Bartosz Golaszewski
0 siblings, 0 replies; 44+ messages in thread
From: Bartosz Golaszewski @ 2022-10-20 11:33 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Sekhar Nori, linux-arm-kernel, Thomas Gleixner, Marc Zyngier,
linux-kernel, Kevin Hilman, Arnd Bergmann
On Wed, Oct 19, 2022 at 5:38 PM Arnd Bergmann <arnd@kernel.org> wrote:
>
> From: Arnd Bergmann <arnd@arndb.de>
>
> The aintc driver was used on Davinci DM3xx and DM64xx SoCs, all of
> which got dropped from Linux, so this driver is orphaned as well.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
Acked-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 44+ messages in thread
* Re: [PATCH 05/14] usb: musb: remove unused davinci support
2022-10-19 15:29 ` [PATCH 05/14] usb: musb: remove unused davinci support Arnd Bergmann
@ 2022-10-20 11:34 ` Bartosz Golaszewski
0 siblings, 0 replies; 44+ messages in thread
From: Bartosz Golaszewski @ 2022-10-20 11:34 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Sekhar Nori, linux-arm-kernel, Bin Liu, Greg Kroah-Hartman,
linux-kernel, Kevin Hilman, Arnd Bergmann, linux-usb
On Wed, Oct 19, 2022 at 5:34 PM Arnd Bergmann <arnd@kernel.org> wrote:
>
> From: Arnd Bergmann <arnd@arndb.de>
>
> The musb-davinci driver was only used on dm644x, which got removed
> in linux-6.0. The only remaining davinci machines are da8xx
> devicetree based and do not use this hardware.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
Acked-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 44+ messages in thread
* Re: [PATCH 06/14] mfd: remove dm355evm_msp driver
2022-10-19 15:29 ` [PATCH 06/14] mfd: remove dm355evm_msp driver Arnd Bergmann
@ 2022-10-20 11:35 ` Bartosz Golaszewski
2022-10-31 15:01 ` Lee Jones
1 sibling, 0 replies; 44+ messages in thread
From: Bartosz Golaszewski @ 2022-10-20 11:35 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Sekhar Nori, linux-arm-kernel, Lee Jones, linux-kernel,
Kevin Hilman, Arnd Bergmann, Dmitry Torokhov, Alessandro Zummo,
Alexandre Belloni, linux-input, linux-rtc
On Wed, Oct 19, 2022 at 5:35 PM Arnd Bergmann <arnd@kernel.org> wrote:
>
> From: Arnd Bergmann <arnd@arndb.de>
>
> The DaVinci DM355EVM platform is gone after the removal of all
> unused board files, so the MTD device along with its sub-devices
> can be removed as well.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 44+ messages in thread
* Re: [PATCH 08/14] rtc: remove davinci rtc driver
2022-10-19 15:29 ` [PATCH 08/14] rtc: remove davinci rtc driver Arnd Bergmann
@ 2022-10-20 11:35 ` Bartosz Golaszewski
0 siblings, 0 replies; 44+ messages in thread
From: Bartosz Golaszewski @ 2022-10-20 11:35 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Sekhar Nori, linux-arm-kernel, Alessandro Zummo,
Alexandre Belloni, linux-kernel, Kevin Hilman, Arnd Bergmann,
linux-rtc
On Wed, Oct 19, 2022 at 5:36 PM Arnd Bergmann <arnd@kernel.org> wrote:
>
> From: Arnd Bergmann <arnd@arndb.de>
>
> The Davinci dm365 SoC support was removed, so the rtc driver
> has no remaining users.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
Acked-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 44+ messages in thread
* Re: [PATCH 10/14] mfd: remove davinci voicecodec driver
2022-10-19 15:29 ` [PATCH 10/14] mfd: remove davinci voicecodec driver Arnd Bergmann
@ 2022-10-20 11:35 ` Bartosz Golaszewski
2022-10-31 15:17 ` Lee Jones
1 sibling, 0 replies; 44+ messages in thread
From: Bartosz Golaszewski @ 2022-10-20 11:35 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Sekhar Nori, linux-arm-kernel, Lee Jones, linux-kernel,
Kevin Hilman, Arnd Bergmann, Hans de Goede, Andy Shevchenko
On Wed, Oct 19, 2022 at 5:37 PM Arnd Bergmann <arnd@kernel.org> wrote:
>
> From: Arnd Bergmann <arnd@arndb.de>
>
> The ASoC davinci voicecodec support is no longer used after
> the removal of the dm3xx SoC platform, so the MFD driver is never
> selected.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
Acked-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 44+ messages in thread
* Re: [PATCH 04/14] clk: remove davinci dm3xx drivers
2022-10-19 15:29 ` [PATCH 04/14] clk: remove davinci dm3xx drivers Arnd Bergmann
2022-10-19 16:39 ` David Lechner
2022-10-20 7:53 ` Linus Walleij
@ 2022-10-20 11:44 ` Bartosz Golaszewski
2022-10-27 1:10 ` Stephen Boyd
3 siblings, 0 replies; 44+ messages in thread
From: Bartosz Golaszewski @ 2022-10-20 11:44 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Sekhar Nori, linux-arm-kernel, David Lechner, Michael Turquette,
Stephen Boyd, linux-kernel, Kevin Hilman, Arnd Bergmann,
Lukas Bulwahn, Linus Walleij, linux-clk
On Wed, Oct 19, 2022 at 5:33 PM Arnd Bergmann <arnd@kernel.org> wrote:
>
> From: Arnd Bergmann <arnd@arndb.de>
>
> The davinci dm3xx machines are all removed, so the clk driver
> is no longer needed. The da8xx platforms are now using DT
> exclusively, so those drivers remain untouched.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
Acked-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 44+ messages in thread
* Re: [PATCH 13/14] staging: media: remove davinci vpfe_capture driver
[not found] ` <20221019152947.3857217-14-arnd@kernel.org>
@ 2022-10-20 15:39 ` Greg Kroah-Hartman
2022-10-24 11:01 ` Hans Verkuil
2022-10-25 22:21 ` Lad, Prabhakar
2 siblings, 0 replies; 44+ messages in thread
From: Greg Kroah-Hartman @ 2022-10-20 15:39 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Sekhar Nori, Bartosz Golaszewski, linux-arm-kernel,
Mauro Carvalho Chehab, Lad, Prabhakar, linux-kernel, Kevin Hilman,
Arnd Bergmann, linux-media, linux-staging
On Wed, Oct 19, 2022 at 05:29:39PM +0200, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> This driver was for the davinci dm644x and dm3xx platforms that are
> now removed from the kernel, so there are no more users.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 44+ messages in thread
* Re: [PATCH 11/14] pata: remove palmchip bk3710 driver
2022-10-19 15:29 ` [PATCH 11/14] pata: remove palmchip bk3710 driver Arnd Bergmann
` (2 preceding siblings ...)
2022-10-20 11:18 ` Bartosz Golaszewski
@ 2022-10-20 23:03 ` Damien Le Moal
3 siblings, 0 replies; 44+ messages in thread
From: Damien Le Moal @ 2022-10-20 23:03 UTC (permalink / raw)
To: Arnd Bergmann, Sekhar Nori, Bartosz Golaszewski, linux-arm-kernel
Cc: linux-kernel, Kevin Hilman, Arnd Bergmann, Sergey Shtylyov,
Hannes Reinecke, linux-ide
On 10/20/22 00:29, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> This device was used only on the davinci dm644x platform that
> is now gone, and no references to the device remain in the
> kernel.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Applied to libata tree for-6.2 branch (and for-next).
Note that I fixed-up the patch title to:
ata: remove palmchip pata_bk3710 driver
Thanks !
> ---
> drivers/ata/Kconfig | 10 -
> drivers/ata/Makefile | 1 -
> drivers/ata/pata_bk3710.c | 380 --------------------------------------
> 3 files changed, 391 deletions(-)
> delete mode 100644 drivers/ata/pata_bk3710.c
>
> diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig
> index 36833a862998..2986fc9c797e 100644
> --- a/drivers/ata/Kconfig
> +++ b/drivers/ata/Kconfig
> @@ -609,16 +609,6 @@ config PATA_ATP867X
>
> If unsure, say N.
>
> -config PATA_BK3710
> - tristate "Palmchip BK3710 PATA support"
> - depends on ARCH_DAVINCI || COMPILE_TEST
> - select PATA_TIMINGS
> - help
> - This option enables support for the integrated IDE controller on
> - the TI DaVinci SoC.
> -
> - If unsure, say N.
> -
> config PATA_CMD64X
> tristate "CMD64x PATA support"
> depends on PCI
> diff --git a/drivers/ata/Makefile b/drivers/ata/Makefile
> index 34623365d9a6..d2e36d367274 100644
> --- a/drivers/ata/Makefile
> +++ b/drivers/ata/Makefile
> @@ -54,7 +54,6 @@ obj-$(CONFIG_PATA_AMD) += pata_amd.o
> obj-$(CONFIG_PATA_ARTOP) += pata_artop.o
> obj-$(CONFIG_PATA_ATIIXP) += pata_atiixp.o
> obj-$(CONFIG_PATA_ATP867X) += pata_atp867x.o
> -obj-$(CONFIG_PATA_BK3710) += pata_bk3710.o
> obj-$(CONFIG_PATA_CMD64X) += pata_cmd64x.o
> obj-$(CONFIG_PATA_CS5520) += pata_cs5520.o
> obj-$(CONFIG_PATA_CS5530) += pata_cs5530.o
> diff --git a/drivers/ata/pata_bk3710.c b/drivers/ata/pata_bk3710.c
> deleted file mode 100644
> index fad95cfecced..000000000000
> --- a/drivers/ata/pata_bk3710.c
> +++ /dev/null
> @@ -1,380 +0,0 @@
> -// SPDX-License-Identifier: GPL-2.0
> -
> -/*
> - * Palmchip BK3710 PATA controller driver
> - *
> - * Copyright (c) 2017 Samsung Electronics Co., Ltd.
> - * http://www.samsung.com
> - *
> - * Based on palm_bk3710.c:
> - *
> - * Copyright (C) 2006 Texas Instruments.
> - * Copyright (C) 2007 MontaVista Software, Inc., <source@mvista.com>
> - */
> -
> -#include <linux/ata.h>
> -#include <linux/clk.h>
> -#include <linux/delay.h>
> -#include <linux/init.h>
> -#include <linux/ioport.h>
> -#include <linux/kernel.h>
> -#include <linux/libata.h>
> -#include <linux/module.h>
> -#include <linux/platform_device.h>
> -#include <linux/types.h>
> -
> -#define DRV_NAME "pata_bk3710"
> -
> -#define BK3710_TF_OFFSET 0x1F0
> -#define BK3710_CTL_OFFSET 0x3F6
> -
> -#define BK3710_BMISP 0x02
> -#define BK3710_IDETIMP 0x40
> -#define BK3710_UDMACTL 0x48
> -#define BK3710_MISCCTL 0x50
> -#define BK3710_REGSTB 0x54
> -#define BK3710_REGRCVR 0x58
> -#define BK3710_DATSTB 0x5C
> -#define BK3710_DATRCVR 0x60
> -#define BK3710_DMASTB 0x64
> -#define BK3710_DMARCVR 0x68
> -#define BK3710_UDMASTB 0x6C
> -#define BK3710_UDMATRP 0x70
> -#define BK3710_UDMAENV 0x74
> -#define BK3710_IORDYTMP 0x78
> -
> -static struct scsi_host_template pata_bk3710_sht = {
> - ATA_BMDMA_SHT(DRV_NAME),
> -};
> -
> -static unsigned int ideclk_period; /* in nanoseconds */
> -
> -struct pata_bk3710_udmatiming {
> - unsigned int rptime; /* tRP -- Ready to pause time (nsec) */
> - unsigned int cycletime; /* tCYCTYP2/2 -- avg Cycle Time (nsec) */
> - /* tENV is always a minimum of 20 nsec */
> -};
> -
> -static const struct pata_bk3710_udmatiming pata_bk3710_udmatimings[6] = {
> - { 160, 240 / 2 }, /* UDMA Mode 0 */
> - { 125, 160 / 2 }, /* UDMA Mode 1 */
> - { 100, 120 / 2 }, /* UDMA Mode 2 */
> - { 100, 90 / 2 }, /* UDMA Mode 3 */
> - { 100, 60 / 2 }, /* UDMA Mode 4 */
> - { 85, 40 / 2 }, /* UDMA Mode 5 */
> -};
> -
> -static void pata_bk3710_setudmamode(void __iomem *base, unsigned int dev,
> - unsigned int mode)
> -{
> - u32 val32;
> - u16 val16;
> - u8 tenv, trp, t0;
> -
> - /* DMA Data Setup */
> - t0 = DIV_ROUND_UP(pata_bk3710_udmatimings[mode].cycletime,
> - ideclk_period) - 1;
> - tenv = DIV_ROUND_UP(20, ideclk_period) - 1;
> - trp = DIV_ROUND_UP(pata_bk3710_udmatimings[mode].rptime,
> - ideclk_period) - 1;
> -
> - /* udmastb Ultra DMA Access Strobe Width */
> - val32 = ioread32(base + BK3710_UDMASTB) & (0xFF << (dev ? 0 : 8));
> - val32 |= t0 << (dev ? 8 : 0);
> - iowrite32(val32, base + BK3710_UDMASTB);
> -
> - /* udmatrp Ultra DMA Ready to Pause Time */
> - val32 = ioread32(base + BK3710_UDMATRP) & (0xFF << (dev ? 0 : 8));
> - val32 |= trp << (dev ? 8 : 0);
> - iowrite32(val32, base + BK3710_UDMATRP);
> -
> - /* udmaenv Ultra DMA envelop Time */
> - val32 = ioread32(base + BK3710_UDMAENV) & (0xFF << (dev ? 0 : 8));
> - val32 |= tenv << (dev ? 8 : 0);
> - iowrite32(val32, base + BK3710_UDMAENV);
> -
> - /* Enable UDMA for Device */
> - val16 = ioread16(base + BK3710_UDMACTL) | (1 << dev);
> - iowrite16(val16, base + BK3710_UDMACTL);
> -}
> -
> -static void pata_bk3710_setmwdmamode(void __iomem *base, unsigned int dev,
> - unsigned short min_cycle,
> - unsigned int mode)
> -{
> - const struct ata_timing *t;
> - int cycletime;
> - u32 val32;
> - u16 val16;
> - u8 td, tkw, t0;
> -
> - t = ata_timing_find_mode(mode);
> - cycletime = max_t(int, t->cycle, min_cycle);
> -
> - /* DMA Data Setup */
> - t0 = DIV_ROUND_UP(cycletime, ideclk_period);
> - td = DIV_ROUND_UP(t->active, ideclk_period);
> - tkw = t0 - td - 1;
> - td--;
> -
> - val32 = ioread32(base + BK3710_DMASTB) & (0xFF << (dev ? 0 : 8));
> - val32 |= td << (dev ? 8 : 0);
> - iowrite32(val32, base + BK3710_DMASTB);
> -
> - val32 = ioread32(base + BK3710_DMARCVR) & (0xFF << (dev ? 0 : 8));
> - val32 |= tkw << (dev ? 8 : 0);
> - iowrite32(val32, base + BK3710_DMARCVR);
> -
> - /* Disable UDMA for Device */
> - val16 = ioread16(base + BK3710_UDMACTL) & ~(1 << dev);
> - iowrite16(val16, base + BK3710_UDMACTL);
> -}
> -
> -static void pata_bk3710_set_dmamode(struct ata_port *ap,
> - struct ata_device *adev)
> -{
> - void __iomem *base = (void __iomem *)ap->ioaddr.bmdma_addr;
> - int is_slave = adev->devno;
> - const u8 xferspeed = adev->dma_mode;
> -
> - if (xferspeed >= XFER_UDMA_0)
> - pata_bk3710_setudmamode(base, is_slave,
> - xferspeed - XFER_UDMA_0);
> - else
> - pata_bk3710_setmwdmamode(base, is_slave,
> - adev->id[ATA_ID_EIDE_DMA_MIN],
> - xferspeed);
> -}
> -
> -static void pata_bk3710_setpiomode(void __iomem *base, struct ata_device *pair,
> - unsigned int dev, unsigned int cycletime,
> - unsigned int mode)
> -{
> - const struct ata_timing *t;
> - u32 val32;
> - u8 t2, t2i, t0;
> -
> - t = ata_timing_find_mode(XFER_PIO_0 + mode);
> -
> - /* PIO Data Setup */
> - t0 = DIV_ROUND_UP(cycletime, ideclk_period);
> - t2 = DIV_ROUND_UP(t->active, ideclk_period);
> -
> - t2i = t0 - t2 - 1;
> - t2--;
> -
> - val32 = ioread32(base + BK3710_DATSTB) & (0xFF << (dev ? 0 : 8));
> - val32 |= t2 << (dev ? 8 : 0);
> - iowrite32(val32, base + BK3710_DATSTB);
> -
> - val32 = ioread32(base + BK3710_DATRCVR) & (0xFF << (dev ? 0 : 8));
> - val32 |= t2i << (dev ? 8 : 0);
> - iowrite32(val32, base + BK3710_DATRCVR);
> -
> - /* FIXME: this is broken also in the old driver */
> - if (pair) {
> - u8 mode2 = pair->pio_mode - XFER_PIO_0;
> -
> - if (mode2 < mode)
> - mode = mode2;
> - }
> -
> - /* TASKFILE Setup */
> - t0 = DIV_ROUND_UP(t->cyc8b, ideclk_period);
> - t2 = DIV_ROUND_UP(t->act8b, ideclk_period);
> -
> - t2i = t0 - t2 - 1;
> - t2--;
> -
> - val32 = ioread32(base + BK3710_REGSTB) & (0xFF << (dev ? 0 : 8));
> - val32 |= t2 << (dev ? 8 : 0);
> - iowrite32(val32, base + BK3710_REGSTB);
> -
> - val32 = ioread32(base + BK3710_REGRCVR) & (0xFF << (dev ? 0 : 8));
> - val32 |= t2i << (dev ? 8 : 0);
> - iowrite32(val32, base + BK3710_REGRCVR);
> -}
> -
> -static void pata_bk3710_set_piomode(struct ata_port *ap,
> - struct ata_device *adev)
> -{
> - void __iomem *base = (void __iomem *)ap->ioaddr.bmdma_addr;
> - struct ata_device *pair = ata_dev_pair(adev);
> - const struct ata_timing *t = ata_timing_find_mode(adev->pio_mode);
> - const u16 *id = adev->id;
> - unsigned int cycle_time = 0;
> - int is_slave = adev->devno;
> - const u8 pio = adev->pio_mode - XFER_PIO_0;
> -
> - if (id[ATA_ID_FIELD_VALID] & 2) {
> - if (ata_id_has_iordy(id))
> - cycle_time = id[ATA_ID_EIDE_PIO_IORDY];
> - else
> - cycle_time = id[ATA_ID_EIDE_PIO];
> -
> - /* conservative "downgrade" for all pre-ATA2 drives */
> - if (pio < 3 && cycle_time < t->cycle)
> - cycle_time = 0; /* use standard timing */
> - }
> -
> - if (!cycle_time)
> - cycle_time = t->cycle;
> -
> - pata_bk3710_setpiomode(base, pair, is_slave, cycle_time, pio);
> -}
> -
> -static void pata_bk3710_chipinit(void __iomem *base)
> -{
> - /*
> - * REVISIT: the ATA reset signal needs to be managed through a
> - * GPIO, which means it should come from platform_data. Until
> - * we get and use such information, we have to trust that things
> - * have been reset before we get here.
> - */
> -
> - /*
> - * Program the IDETIMP Register Value based on the following assumptions
> - *
> - * (ATA_IDETIMP_IDEEN , ENABLE ) |
> - * (ATA_IDETIMP_PREPOST1 , DISABLE) |
> - * (ATA_IDETIMP_PREPOST0 , DISABLE) |
> - *
> - * DM6446 silicon rev 2.1 and earlier have no observed net benefit
> - * from enabling prefetch/postwrite.
> - */
> - iowrite16(BIT(15), base + BK3710_IDETIMP);
> -
> - /*
> - * UDMACTL Ultra-ATA DMA Control
> - * (ATA_UDMACTL_UDMAP1 , 0 ) |
> - * (ATA_UDMACTL_UDMAP0 , 0 )
> - *
> - */
> - iowrite16(0, base + BK3710_UDMACTL);
> -
> - /*
> - * MISCCTL Miscellaneous Conrol Register
> - * (ATA_MISCCTL_HWNHLD1P , 1 cycle)
> - * (ATA_MISCCTL_HWNHLD0P , 1 cycle)
> - * (ATA_MISCCTL_TIMORIDE , 1)
> - */
> - iowrite32(0x001, base + BK3710_MISCCTL);
> -
> - /*
> - * IORDYTMP IORDY Timer for Primary Register
> - * (ATA_IORDYTMP_IORDYTMP , DISABLE)
> - */
> - iowrite32(0, base + BK3710_IORDYTMP);
> -
> - /*
> - * Configure BMISP Register
> - * (ATA_BMISP_DMAEN1 , DISABLE ) |
> - * (ATA_BMISP_DMAEN0 , DISABLE ) |
> - * (ATA_BMISP_IORDYINT , CLEAR) |
> - * (ATA_BMISP_INTRSTAT , CLEAR) |
> - * (ATA_BMISP_DMAERROR , CLEAR)
> - */
> - iowrite16(0xE, base + BK3710_BMISP);
> -
> - pata_bk3710_setpiomode(base, NULL, 0, 600, 0);
> - pata_bk3710_setpiomode(base, NULL, 1, 600, 0);
> -}
> -
> -static struct ata_port_operations pata_bk3710_ports_ops = {
> - .inherits = &ata_bmdma_port_ops,
> - .cable_detect = ata_cable_80wire,
> -
> - .set_piomode = pata_bk3710_set_piomode,
> - .set_dmamode = pata_bk3710_set_dmamode,
> -};
> -
> -static int __init pata_bk3710_probe(struct platform_device *pdev)
> -{
> - struct clk *clk;
> - struct resource *mem;
> - struct ata_host *host;
> - struct ata_port *ap;
> - void __iomem *base;
> - unsigned long rate;
> - int irq;
> -
> - clk = devm_clk_get(&pdev->dev, NULL);
> - if (IS_ERR(clk))
> - return -ENODEV;
> -
> - clk_enable(clk);
> - rate = clk_get_rate(clk);
> - if (!rate)
> - return -EINVAL;
> -
> - /* NOTE: round *down* to meet minimum timings; we count in clocks */
> - ideclk_period = 1000000000UL / rate;
> -
> - mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -
> - irq = platform_get_irq(pdev, 0);
> - if (irq < 0) {
> - pr_err(DRV_NAME ": failed to get IRQ resource\n");
> - return irq;
> - }
> -
> - base = devm_ioremap_resource(&pdev->dev, mem);
> - if (IS_ERR(base))
> - return PTR_ERR(base);
> -
> - /* configure the Palmchip controller */
> - pata_bk3710_chipinit(base);
> -
> - /* allocate host */
> - host = ata_host_alloc(&pdev->dev, 1);
> - if (!host)
> - return -ENOMEM;
> - ap = host->ports[0];
> -
> - ap->ops = &pata_bk3710_ports_ops;
> - ap->pio_mask = ATA_PIO4;
> - ap->mwdma_mask = ATA_MWDMA2;
> - ap->udma_mask = rate < 100000000 ? ATA_UDMA4 : ATA_UDMA5;
> - ap->flags |= ATA_FLAG_SLAVE_POSS;
> -
> - ap->ioaddr.data_addr = base + BK3710_TF_OFFSET;
> - ap->ioaddr.error_addr = base + BK3710_TF_OFFSET + 1;
> - ap->ioaddr.feature_addr = base + BK3710_TF_OFFSET + 1;
> - ap->ioaddr.nsect_addr = base + BK3710_TF_OFFSET + 2;
> - ap->ioaddr.lbal_addr = base + BK3710_TF_OFFSET + 3;
> - ap->ioaddr.lbam_addr = base + BK3710_TF_OFFSET + 4;
> - ap->ioaddr.lbah_addr = base + BK3710_TF_OFFSET + 5;
> - ap->ioaddr.device_addr = base + BK3710_TF_OFFSET + 6;
> - ap->ioaddr.status_addr = base + BK3710_TF_OFFSET + 7;
> - ap->ioaddr.command_addr = base + BK3710_TF_OFFSET + 7;
> -
> - ap->ioaddr.altstatus_addr = base + BK3710_CTL_OFFSET;
> - ap->ioaddr.ctl_addr = base + BK3710_CTL_OFFSET;
> -
> - ap->ioaddr.bmdma_addr = base;
> -
> - ata_port_desc(ap, "cmd 0x%lx ctl 0x%lx",
> - (unsigned long)base + BK3710_TF_OFFSET,
> - (unsigned long)base + BK3710_CTL_OFFSET);
> -
> - /* activate */
> - return ata_host_activate(host, irq, ata_sff_interrupt, 0,
> - &pata_bk3710_sht);
> -}
> -
> -/* work with hotplug and coldplug */
> -MODULE_ALIAS("platform:palm_bk3710");
> -
> -static struct platform_driver pata_bk3710_driver = {
> - .driver = {
> - .name = "palm_bk3710",
> - },
> -};
> -
> -static int __init pata_bk3710_init(void)
> -{
> - return platform_driver_probe(&pata_bk3710_driver, pata_bk3710_probe);
> -}
> -
> -module_init(pata_bk3710_init);
> -MODULE_LICENSE("GPL v2");
--
Damien Le Moal
Western Digital Research
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 44+ messages in thread
* Re: [PATCH 13/14] staging: media: remove davinci vpfe_capture driver
[not found] ` <20221019152947.3857217-14-arnd@kernel.org>
2022-10-20 15:39 ` [PATCH 13/14] staging: media: remove davinci vpfe_capture driver Greg Kroah-Hartman
@ 2022-10-24 11:01 ` Hans Verkuil
2022-10-25 22:21 ` Lad, Prabhakar
2 siblings, 0 replies; 44+ messages in thread
From: Hans Verkuil @ 2022-10-24 11:01 UTC (permalink / raw)
To: Arnd Bergmann, Sekhar Nori, Bartosz Golaszewski, linux-arm-kernel,
Mauro Carvalho Chehab, Greg Kroah-Hartman, Lad, Prabhakar
Cc: linux-kernel, Kevin Hilman, Arnd Bergmann, linux-media,
linux-staging
Hi Arnd,
On 10/19/22 17:29, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> This driver was for the davinci dm644x and dm3xx platforms that are
> now removed from the kernel, so there are no more users.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
As discussed on irc, it is best if you merge this to due dependencies on
arch/arm/mach-davinci/davinci.h.
Note that there is one more reference to vpfe_capture.h:
Documentation/userspace-api/ioctl/ioctl-number.rst:'V' C0 media/davinci/vpfe_capture.h conflict!
Feel free to fold that in this patch, or make a separate patch removing it.
If you make a separate patch, then you can add my Acked-by for that change.
Regards,
Hans
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 44+ messages in thread
* Re: [PATCH 00/14] ARM: remove unused davinci board & drivers
2022-10-19 15:29 [PATCH 00/14] ARM: remove unused davinci board & drivers Arnd Bergmann
` (13 preceding siblings ...)
[not found] ` <20221019152947.3857217-14-arnd@kernel.org>
@ 2022-10-24 18:25 ` Kevin Hilman
[not found] ` <20221019152947.3857217-15-arnd@kernel.org>
2022-11-14 21:08 ` [PATCH 00/14] ARM: remove unused davinci board & drivers Alexandre Belloni
16 siblings, 0 replies; 44+ messages in thread
From: Kevin Hilman @ 2022-10-24 18:25 UTC (permalink / raw)
To: Arnd Bergmann, Sekhar Nori, Bartosz Golaszewski, linux-arm-kernel
Cc: linux-kernel, Arnd Bergmann, Russell King, Mauro Carvalho Chehab,
Damien Le Moal, Sergey Shtylyov, David Lechner, Michael Turquette,
Stephen Boyd, Dmitry Torokhov, Thomas Gleixner, Marc Zyngier,
Lad, Prabhakar, Lee Jones, Alessandro Zummo, Alexandre Belloni,
Greg Kroah-Hartman, Bin Liu, Peter Ujfalusi, Liam Girdwood,
Mark Brown, Jaroslav Kysela, Takashi Iwai, Laurent Pinchart,
Hans Verkuil, Yang Yingliang, linux-media, linux-ide, linux-clk,
linux-input, linux-rtc, linux-staging, linux-usb, alsa-devel
Arnd Bergmann <arnd@kernel.org> writes:
> From: Arnd Bergmann <arnd@arndb.de>
>
> As part of removing all board files that were previously marked as unused,
> I looked through the davinci platform and recursively removed everything
> that has now become unused.
>
> In particular, this is for all dm3xx support, in addition to the dm64xx
> support removed previously. The remaining support is now for da8xx using
> devicetree only, which means a lot of the da8xx specific device support
> can also go away.
Acked-by: Kevin Hilman <khilman@baylibre.com>
Kevin
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 44+ messages in thread
* Re: [PATCH 13/14] staging: media: remove davinci vpfe_capture driver
[not found] ` <20221019152947.3857217-14-arnd@kernel.org>
2022-10-20 15:39 ` [PATCH 13/14] staging: media: remove davinci vpfe_capture driver Greg Kroah-Hartman
2022-10-24 11:01 ` Hans Verkuil
@ 2022-10-25 22:21 ` Lad, Prabhakar
2 siblings, 0 replies; 44+ messages in thread
From: Lad, Prabhakar @ 2022-10-25 22:21 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Sekhar Nori, Bartosz Golaszewski, linux-arm-kernel,
Mauro Carvalho Chehab, Greg Kroah-Hartman, linux-kernel,
Kevin Hilman, Arnd Bergmann, linux-media, linux-staging
On Wed, Oct 19, 2022 at 4:40 PM Arnd Bergmann <arnd@kernel.org> wrote:>
> From: Arnd Bergmann <arnd@arndb.de>
>
> This driver was for the davinci dm644x and dm3xx platforms that are
> now removed from the kernel, so there are no more users.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> MAINTAINERS | 1 -
> drivers/staging/media/Kconfig | 1 -
> drivers/staging/media/Makefile | 1 -
> .../media/deprecated/vpfe_capture/Kconfig | 58 -
> .../media/deprecated/vpfe_capture/Makefile | 4 -
> .../media/deprecated/vpfe_capture/TODO | 7 -
> .../deprecated/vpfe_capture/ccdc_hw_device.h | 80 -
> .../deprecated/vpfe_capture/dm355_ccdc.c | 934 --------
> .../deprecated/vpfe_capture/dm355_ccdc.h | 308 ---
> .../deprecated/vpfe_capture/dm355_ccdc_regs.h | 297 ---
> .../deprecated/vpfe_capture/dm644x_ccdc.c | 879 --------
> .../deprecated/vpfe_capture/dm644x_ccdc.h | 171 --
> .../vpfe_capture/dm644x_ccdc_regs.h | 140 --
> .../media/deprecated/vpfe_capture/isif.c | 1127 ----------
> .../media/deprecated/vpfe_capture/isif.h | 518 -----
> .../media/deprecated/vpfe_capture/isif_regs.h | 256 ---
> .../deprecated/vpfe_capture/vpfe_capture.c | 1902 -----------------
> include/media/davinci/vpfe_capture.h | 177 --
> 18 files changed, 6861 deletions(-)
> delete mode 100644 drivers/staging/media/deprecated/vpfe_capture/Kconfig
> delete mode 100644 drivers/staging/media/deprecated/vpfe_capture/Makefile
> delete mode 100644 drivers/staging/media/deprecated/vpfe_capture/TODO
> delete mode 100644 drivers/staging/media/deprecated/vpfe_capture/ccdc_hw_device.h
> delete mode 100644 drivers/staging/media/deprecated/vpfe_capture/dm355_ccdc.c
> delete mode 100644 drivers/staging/media/deprecated/vpfe_capture/dm355_ccdc.h
> delete mode 100644 drivers/staging/media/deprecated/vpfe_capture/dm355_ccdc_regs.h
> delete mode 100644 drivers/staging/media/deprecated/vpfe_capture/dm644x_ccdc.c
> delete mode 100644 drivers/staging/media/deprecated/vpfe_capture/dm644x_ccdc.h
> delete mode 100644 drivers/staging/media/deprecated/vpfe_capture/dm644x_ccdc_regs.h
> delete mode 100644 drivers/staging/media/deprecated/vpfe_capture/isif.c
> delete mode 100644 drivers/staging/media/deprecated/vpfe_capture/isif.h
> delete mode 100644 drivers/staging/media/deprecated/vpfe_capture/isif_regs.h
> delete mode 100644 drivers/staging/media/deprecated/vpfe_capture/vpfe_capture.c
> delete mode 100644 include/media/davinci/vpfe_capture.h
>
Acked-by: Lad Prabhakar <prabhakar.csengg@gmail.com>
Cheers,
Prabhakar
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 44+ messages in thread
* Re: [PATCH 14/14] media: davinci: remove vpbe support
[not found] ` <20221019152947.3857217-15-arnd@kernel.org>
@ 2022-10-25 22:22 ` Lad, Prabhakar
0 siblings, 0 replies; 44+ messages in thread
From: Lad, Prabhakar @ 2022-10-25 22:22 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Sekhar Nori, Bartosz Golaszewski, linux-arm-kernel,
Mauro Carvalho Chehab, linux-kernel, Kevin Hilman, Arnd Bergmann,
Hans Verkuil, linux-media
On Wed, Oct 19, 2022 at 4:41 PM Arnd Bergmann <arnd@kernel.org> wrote:
>
> From: Arnd Bergmann <arnd@arndb.de>
>
> The davinci dm3xx/dm644x platforms are gone now, and the remaining
> da8xx platforms do not use the vpbe driver, so the driver can be
> removed as well.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Lad Prabhakar <prabhakar.csengg@gmail.com>
Cheers,
Prabhakar
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 44+ messages in thread
* Re: [PATCH 04/14] clk: remove davinci dm3xx drivers
2022-10-19 15:29 ` [PATCH 04/14] clk: remove davinci dm3xx drivers Arnd Bergmann
` (2 preceding siblings ...)
2022-10-20 11:44 ` Bartosz Golaszewski
@ 2022-10-27 1:10 ` Stephen Boyd
3 siblings, 0 replies; 44+ messages in thread
From: Stephen Boyd @ 2022-10-27 1:10 UTC (permalink / raw)
To: Arnd Bergmann, Bartosz Golaszewski, David Lechner,
Michael Turquette, Sekhar Nori, linux-arm-kernel
Cc: linux-kernel, Kevin Hilman, Arnd Bergmann, Lukas Bulwahn,
Linus Walleij, linux-clk
Quoting Arnd Bergmann (2022-10-19 08:29:30)
> From: Arnd Bergmann <arnd@arndb.de>
>
> The davinci dm3xx machines are all removed, so the clk driver
> is no longer needed. The da8xx platforms are now using DT
> exclusively, so those drivers remain untouched.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
Acked-by: Stephen Boyd <sboyd@kernel.org>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 44+ messages in thread
* Re: [PATCH 02/14] ARM: davinci: drop DAVINCI_DMxxx references
2022-10-19 15:29 ` [PATCH 02/14] ARM: davinci: drop DAVINCI_DMxxx references Arnd Bergmann
2022-10-19 16:37 ` David Lechner
@ 2022-10-27 1:10 ` Stephen Boyd
1 sibling, 0 replies; 44+ messages in thread
From: Stephen Boyd @ 2022-10-27 1:10 UTC (permalink / raw)
To: Arnd Bergmann, Bartosz Golaszewski, David Lechner,
Michael Turquette, Sekhar Nori, linux-arm-kernel
Cc: linux-kernel, Kevin Hilman, Arnd Bergmann, linux-clk
Quoting Arnd Bergmann (2022-10-19 08:29:28)
> From: Arnd Bergmann <arnd@arndb.de>
>
> Support for all the dm3xx/dm64xx SoCs is no longer
> available, so drop all other references to those.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
Acked-by: Stephen Boyd <sboyd@kernel.org>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 44+ messages in thread
* Re: [PATCH 06/14] mfd: remove dm355evm_msp driver
2022-10-19 15:29 ` [PATCH 06/14] mfd: remove dm355evm_msp driver Arnd Bergmann
2022-10-20 11:35 ` Bartosz Golaszewski
@ 2022-10-31 15:01 ` Lee Jones
2022-10-31 15:01 ` Lee Jones
1 sibling, 1 reply; 44+ messages in thread
From: Lee Jones @ 2022-10-31 15:01 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Sekhar Nori, Bartosz Golaszewski, linux-arm-kernel, linux-kernel,
Kevin Hilman, Arnd Bergmann, Dmitry Torokhov, Alessandro Zummo,
Alexandre Belloni, linux-input, linux-rtc
On Wed, 19 Oct 2022, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> The DaVinci DM355EVM platform is gone after the removal of all
> unused board files, so the MTD device along with its sub-devices
> can be removed as well.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> drivers/input/misc/Kconfig | 11 -
> drivers/input/misc/Makefile | 1 -
> drivers/input/misc/dm355evm_keys.c | 238 ---------------
> drivers/mfd/Kconfig | 8 -
> drivers/mfd/Makefile | 1 -
> drivers/mfd/dm355evm_msp.c | 454 -----------------------------
> drivers/rtc/Kconfig | 6 -
> drivers/rtc/Makefile | 1 -
> drivers/rtc/rtc-dm355evm.c | 151 ----------
> include/linux/mfd/dm355evm_msp.h | 79 -----
> 10 files changed, 950 deletions(-)
> delete mode 100644 drivers/input/misc/dm355evm_keys.c
> delete mode 100644 drivers/mfd/dm355evm_msp.c
> delete mode 100644 drivers/rtc/rtc-dm355evm.c
> delete mode 100644 include/linux/mfd/dm355evm_msp.h
Acked-by: Lee Jones <lee@kernel.org>
--
Lee Jones [李琼斯]
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 44+ messages in thread
* Re: [PATCH 06/14] mfd: remove dm355evm_msp driver
2022-10-31 15:01 ` Lee Jones
@ 2022-10-31 15:01 ` Lee Jones
0 siblings, 0 replies; 44+ messages in thread
From: Lee Jones @ 2022-10-31 15:01 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Sekhar Nori, Bartosz Golaszewski, linux-arm-kernel, linux-kernel,
Kevin Hilman, Arnd Bergmann, Dmitry Torokhov, Alessandro Zummo,
Alexandre Belloni, linux-input, linux-rtc
On Mon, 31 Oct 2022, Lee Jones wrote:
> On Wed, 19 Oct 2022, Arnd Bergmann wrote:
>
> > From: Arnd Bergmann <arnd@arndb.de>
> >
> > The DaVinci DM355EVM platform is gone after the removal of all
> > unused board files, so the MTD device along with its sub-devices
> > can be removed as well.
> >
> > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> > ---
> > drivers/input/misc/Kconfig | 11 -
> > drivers/input/misc/Makefile | 1 -
> > drivers/input/misc/dm355evm_keys.c | 238 ---------------
> > drivers/mfd/Kconfig | 8 -
> > drivers/mfd/Makefile | 1 -
> > drivers/mfd/dm355evm_msp.c | 454 -----------------------------
> > drivers/rtc/Kconfig | 6 -
> > drivers/rtc/Makefile | 1 -
> > drivers/rtc/rtc-dm355evm.c | 151 ----------
> > include/linux/mfd/dm355evm_msp.h | 79 -----
> > 10 files changed, 950 deletions(-)
> > delete mode 100644 drivers/input/misc/dm355evm_keys.c
> > delete mode 100644 drivers/mfd/dm355evm_msp.c
> > delete mode 100644 drivers/rtc/rtc-dm355evm.c
> > delete mode 100644 include/linux/mfd/dm355evm_msp.h
>
> Acked-by: Lee Jones <lee@kernel.org>
Any reason not to do this per-subsystem?
--
Lee Jones [李琼斯]
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 44+ messages in thread
* Re: [PATCH 10/14] mfd: remove davinci voicecodec driver
2022-10-19 15:29 ` [PATCH 10/14] mfd: remove davinci voicecodec driver Arnd Bergmann
2022-10-20 11:35 ` Bartosz Golaszewski
@ 2022-10-31 15:17 ` Lee Jones
1 sibling, 0 replies; 44+ messages in thread
From: Lee Jones @ 2022-10-31 15:17 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Sekhar Nori, Bartosz Golaszewski, linux-arm-kernel, linux-kernel,
Kevin Hilman, Arnd Bergmann, Hans de Goede, Andy Shevchenko
On Wed, 19 Oct 2022, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> The ASoC davinci voicecodec support is no longer used after
> the removal of the dm3xx SoC platform, so the MFD driver is never
> selected.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> drivers/mfd/Kconfig | 5 --
> drivers/mfd/Makefile | 2 -
> drivers/mfd/davinci_voicecodec.c | 136 -------------------------------
> 3 files changed, 143 deletions(-)
> delete mode 100644 drivers/mfd/davinci_voicecodec.c
Applied, thanks.
--
Lee Jones [李琼斯]
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 44+ messages in thread
* Re: [PATCH 00/14] ARM: remove unused davinci board & drivers
2022-10-19 15:29 [PATCH 00/14] ARM: remove unused davinci board & drivers Arnd Bergmann
` (15 preceding siblings ...)
[not found] ` <20221019152947.3857217-15-arnd@kernel.org>
@ 2022-11-14 21:08 ` Alexandre Belloni
16 siblings, 0 replies; 44+ messages in thread
From: Alexandre Belloni @ 2022-11-14 21:08 UTC (permalink / raw)
To: Bartosz Golaszewski, Sekhar Nori, Arnd Bergmann, linux-arm-kernel
Cc: linux-staging, Russell King, linux-clk, Marc Zyngier,
Hans Verkuil, Lad, Prabhakar, Lee Jones, linux-media, linux-input,
Mauro Carvalho Chehab, Stephen Boyd, Laurent Pinchart,
Jaroslav Kysela, Alessandro Zummo, Kevin Hilman, David Lechner,
Thomas Gleixner, Mark Brown, linux-rtc, Dmitry Torokhov,
Yang Yingliang, Liam Girdwood, alsa-devel, Arnd Bergmann,
Greg Kroah-Hartman, Damien Le Moal, Peter Ujfalusi, linux-ide,
Sergey Shtylyov, Bin Liu, Takashi Iwai, linux-usb, linux-kernel,
Michael Turquette
On Wed, 19 Oct 2022 17:29:26 +0200, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> As part of removing all board files that were previously marked as unused,
> I looked through the davinci platform and recursively removed everything
> that has now become unused.
>
> In particular, this is for all dm3xx support, in addition to the dm64xx
> support removed previously. The remaining support is now for da8xx using
> devicetree only, which means a lot of the da8xx specific device support
> can also go away.
>
> [...]
Applied, thanks!
[08/14] rtc: remove davinci rtc driver
commit: 6274ef3c7eb5e9792a708c23757e16b444e4267f
Best regards,
--
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 44+ messages in thread
end of thread, other threads:[~2022-11-14 21:09 UTC | newest]
Thread overview: 44+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-19 15:29 [PATCH 00/14] ARM: remove unused davinci board & drivers Arnd Bergmann
2022-10-19 15:29 ` [PATCH 02/14] ARM: davinci: drop DAVINCI_DMxxx references Arnd Bergmann
2022-10-19 16:37 ` David Lechner
2022-10-19 20:32 ` Arnd Bergmann
2022-10-27 1:10 ` Stephen Boyd
2022-10-19 15:29 ` [PATCH 03/14] ARM: davinci: clean up platform support Arnd Bergmann
2022-10-20 11:32 ` Bartosz Golaszewski
2022-10-19 15:29 ` [PATCH 04/14] clk: remove davinci dm3xx drivers Arnd Bergmann
2022-10-19 16:39 ` David Lechner
2022-10-20 7:53 ` Linus Walleij
2022-10-20 11:44 ` Bartosz Golaszewski
2022-10-27 1:10 ` Stephen Boyd
2022-10-19 15:29 ` [PATCH 05/14] usb: musb: remove unused davinci support Arnd Bergmann
2022-10-20 11:34 ` Bartosz Golaszewski
2022-10-19 15:29 ` [PATCH 06/14] mfd: remove dm355evm_msp driver Arnd Bergmann
2022-10-20 11:35 ` Bartosz Golaszewski
2022-10-31 15:01 ` Lee Jones
2022-10-31 15:01 ` Lee Jones
2022-10-19 15:29 ` [PATCH 07/14] input: remove davinci keyboard driver Arnd Bergmann
2022-10-20 8:02 ` Mattijs Korpershoek
2022-10-20 11:17 ` Bartosz Golaszewski
2022-10-19 15:29 ` [PATCH 08/14] rtc: remove davinci rtc driver Arnd Bergmann
2022-10-20 11:35 ` Bartosz Golaszewski
2022-10-19 15:29 ` [PATCH 09/14] ASoC: remove unused davinci support Arnd Bergmann
2022-10-19 15:52 ` Mark Brown
2022-10-19 15:29 ` [PATCH 10/14] mfd: remove davinci voicecodec driver Arnd Bergmann
2022-10-20 11:35 ` Bartosz Golaszewski
2022-10-31 15:17 ` Lee Jones
2022-10-19 15:29 ` [PATCH 11/14] pata: remove palmchip bk3710 driver Arnd Bergmann
2022-10-19 23:17 ` Damien Le Moal
2022-10-20 7:09 ` Arnd Bergmann
2022-10-20 11:02 ` Sergey Shtylyov
2022-10-20 11:18 ` Bartosz Golaszewski
2022-10-20 23:03 ` Damien Le Moal
2022-10-19 15:29 ` [PATCH 12/14] irqchip: remove davinci aintc driver Arnd Bergmann
2022-10-20 11:33 ` Bartosz Golaszewski
2022-10-19 15:39 ` [PATCH 00/14] ARM: remove unused davinci board & drivers Marc Zyngier
[not found] ` <20221019152947.3857217-2-arnd@kernel.org>
2022-10-20 11:27 ` [PATCH 01/14] ARM: davinci: remove unused board support Bartosz Golaszewski
[not found] ` <20221019152947.3857217-14-arnd@kernel.org>
2022-10-20 15:39 ` [PATCH 13/14] staging: media: remove davinci vpfe_capture driver Greg Kroah-Hartman
2022-10-24 11:01 ` Hans Verkuil
2022-10-25 22:21 ` Lad, Prabhakar
2022-10-24 18:25 ` [PATCH 00/14] ARM: remove unused davinci board & drivers Kevin Hilman
[not found] ` <20221019152947.3857217-15-arnd@kernel.org>
2022-10-25 22:22 ` [PATCH 14/14] media: davinci: remove vpbe support Lad, Prabhakar
2022-11-14 21:08 ` [PATCH 00/14] ARM: remove unused davinci board & drivers Alexandre Belloni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).