Skip to content

Commit dc3e1ac

Browse files
committed
Merge tag 'davinci-for-v5.1/soc-part3' of git://git.kernel.org/pub/scm/linux/kernel/git/nsekhar/linux-davinci into arm/late
DaVinci SoC updates for v5.1 (part 3) ------------------------------------- This pull request gets rid of mach-davinci private interrupt controller implmentations (aintc and cp_initc) and moves them to drivers/irqchip. mach/irqs.h usage outside of mach-davinci has been rid of. The driver changes (input and irqchip) have been acked by respective maintainers. * tag 'davinci-for-v5.1/soc-part3' of git://git.kernel.org/pub/scm/linux/kernel/git/nsekhar/linux-davinci: (57 commits) ARM: davinci: remove intc related fields from davinci_soc_info irqchip: davinci-cp-intc: move the driver to drivers/irqchip ARM: davinci: cp-intc: remove redundant comments ARM: davinci: cp-intc: drop GPL license boilerplate ARM: davinci: cp-intc: use readl/writel_relaxed() ARM: davinci: cp-intc: unify error handling ARM: davinci: cp-intc: improve coding style ARM: davinci: cp-intc: request the memory region before remapping it ARM: davinci: cp-intc: use the new-style config structure ARM: davinci: cp-intc: convert all hex numbers to lowercase ARM: davinci: cp-intc: use a common prefix for all symbols ARM: davinci: cp-intc: add the new config structures for da8xx SoCs irqchip: davinci-cp-intc: add a new config structure ARM: davinci: cp-intc: add a wrapper around cp_intc_init() ARM: davinci: cp-intc: remove cp_intc.h irqchip: davinci-aintc: move the driver to drivers/irqchip ARM: davinci: aintc: remove unnecessary includes ARM: davinci: aintc: remove the timer-specific irq_set_handler() ARM: davinci: aintc: request memory region before remapping it ARM: davinci: aintc: unify error handling ... Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2 parents f17b5f0 + 49b654f commit dc3e1ac

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+1018
-1278
lines changed

arch/arm/Kconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -589,11 +589,13 @@ config ARCH_DAVINCI
589589
select GENERIC_ALLOCATOR
590590
select GENERIC_CLOCKEVENTS
591591
select GENERIC_IRQ_CHIP
592+
select GENERIC_IRQ_MULTI_HANDLER
592593
select GPIOLIB
593594
select HAVE_IDE
594595
select PM_GENERIC_DOMAINS if PM
595596
select PM_GENERIC_DOMAINS_OF if PM && OF
596597
select RESET_CONTROLLER
598+
select SPARSE_IRQ
597599
select USE_OF
598600
select ZONE_DMA
599601
help

arch/arm/mach-davinci/Kconfig

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
11
# SPDX-License-Identifier: GPL-2.0
22
if ARCH_DAVINCI
33

4-
config AINTC
5-
bool
6-
7-
config CP_INTC
8-
bool
9-
select IRQ_DOMAIN
10-
114
config ARCH_DAVINCI_DMx
125
bool
136

@@ -17,17 +10,17 @@ comment "DaVinci Core Type"
1710

1811
config ARCH_DAVINCI_DM644x
1912
bool "DaVinci 644x based system"
20-
select AINTC
13+
select DAVINCI_AINTC
2114
select ARCH_DAVINCI_DMx
2215

2316
config ARCH_DAVINCI_DM355
2417
bool "DaVinci 355 based system"
25-
select AINTC
18+
select DAVINCI_AINTC
2619
select ARCH_DAVINCI_DMx
2720

2821
config ARCH_DAVINCI_DM646x
2922
bool "DaVinci 646x based system"
30-
select AINTC
23+
select DAVINCI_AINTC
3124
select ARCH_DAVINCI_DMx
3225

3326
config ARCH_DAVINCI_DA830
@@ -36,20 +29,20 @@ config ARCH_DAVINCI_DA830
3629
select ARCH_DAVINCI_DA8XX
3730
# needed on silicon revs 1.0, 1.1:
3831
select CPU_DCACHE_WRITETHROUGH if !CPU_DCACHE_DISABLE
39-
select CP_INTC
32+
select DAVINCI_CP_INTC
4033

4134
config ARCH_DAVINCI_DA850
4235
bool "DA850/OMAP-L138/AM18x based system"
4336
depends on !ARCH_DAVINCI_DMx || (AUTO_ZRELADDR && ARM_PATCH_PHYS_VIRT)
4437
select ARCH_DAVINCI_DA8XX
45-
select CP_INTC
38+
select DAVINCI_CP_INTC
4639

4740
config ARCH_DAVINCI_DA8XX
4841
bool
4942

5043
config ARCH_DAVINCI_DM365
5144
bool "DaVinci 365 based system"
52-
select AINTC
45+
select DAVINCI_AINTC
5346
select ARCH_DAVINCI_DMx
5447

5548
comment "DaVinci Board Type"

arch/arm/mach-davinci/Makefile

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@ obj-$(CONFIG_ARCH_DAVINCI_DM365) += dm365.o devices.o
1818
obj-$(CONFIG_ARCH_DAVINCI_DA830) += da830.o devices-da8xx.o usb-da8xx.o
1919
obj-$(CONFIG_ARCH_DAVINCI_DA850) += da850.o devices-da8xx.o usb-da8xx.o
2020

21-
obj-$(CONFIG_AINTC) += irq.o
22-
obj-$(CONFIG_CP_INTC) += cp_intc.o
23-
2421
# Board specific
2522
obj-$(CONFIG_MACH_DA8XX_DT) += da8xx-dt.o pdata-quirks.o
2623
obj-$(CONFIG_MACH_DAVINCI_EVM) += board-dm644x-evm.o

arch/arm/mach-davinci/asp.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@
4949
#define DAVINCI_DA830_DMA_MCASP2_AXEVT 5
5050

5151
/* Interrupts */
52-
#define DAVINCI_ASP0_RX_INT IRQ_MBRINT
53-
#define DAVINCI_ASP0_TX_INT IRQ_MBXINT
54-
#define DAVINCI_ASP1_RX_INT IRQ_MBRINT
55-
#define DAVINCI_ASP1_TX_INT IRQ_MBXINT
52+
#define DAVINCI_ASP0_RX_INT DAVINCI_INTC_IRQ(IRQ_MBRINT)
53+
#define DAVINCI_ASP0_TX_INT DAVINCI_INTC_IRQ(IRQ_MBXINT)
54+
#define DAVINCI_ASP1_RX_INT DAVINCI_INTC_IRQ(IRQ_MBRINT)
55+
#define DAVINCI_ASP1_TX_INT DAVINCI_INTC_IRQ(IRQ_MBXINT)
5656

5757
#endif /* __ASM_ARCH_DAVINCI_ASP_H */

arch/arm/mach-davinci/board-da830-evm.c

Lines changed: 16 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#include <linux/platform_device.h>
1919
#include <linux/i2c.h>
2020
#include <linux/platform_data/pcf857x.h>
21-
#include <linux/platform_data/at24.h>
21+
#include <linux/property.h>
2222
#include <linux/mtd/mtd.h>
2323
#include <linux/mtd/partitions.h>
2424
#include <linux/spi/spi.h>
@@ -36,10 +36,11 @@
3636
#include <asm/mach/arch.h>
3737

3838
#include <mach/common.h>
39-
#include "cp_intc.h"
4039
#include <mach/mux.h>
4140
#include <mach/da8xx.h>
4241

42+
#include "irqs.h"
43+
4344
#define DA830_EVM_PHY_ID ""
4445
/*
4546
* USB1 VBUS is controlled by GPIO1[15], over-current is reported on GPIO2[4].
@@ -52,62 +53,19 @@ static const short da830_evm_usb11_pins[] = {
5253
-1
5354
};
5455

55-
static da8xx_ocic_handler_t da830_evm_usb_ocic_handler;
56-
57-
static int da830_evm_usb_set_power(unsigned port, int on)
58-
{
59-
gpio_set_value(ON_BD_USB_DRV, on);
60-
return 0;
61-
}
62-
63-
static int da830_evm_usb_get_power(unsigned port)
64-
{
65-
return gpio_get_value(ON_BD_USB_DRV);
66-
}
67-
68-
static int da830_evm_usb_get_oci(unsigned port)
69-
{
70-
return !gpio_get_value(ON_BD_USB_OVC);
71-
}
72-
73-
static irqreturn_t da830_evm_usb_ocic_irq(int, void *);
74-
75-
static int da830_evm_usb_ocic_notify(da8xx_ocic_handler_t handler)
76-
{
77-
int irq = gpio_to_irq(ON_BD_USB_OVC);
78-
int error = 0;
79-
80-
if (handler != NULL) {
81-
da830_evm_usb_ocic_handler = handler;
82-
83-
error = request_irq(irq, da830_evm_usb_ocic_irq,
84-
IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
85-
"OHCI over-current indicator", NULL);
86-
if (error)
87-
pr_err("%s: could not request IRQ to watch over-current indicator changes\n",
88-
__func__);
89-
} else
90-
free_irq(irq, NULL);
91-
92-
return error;
93-
}
56+
static struct gpiod_lookup_table da830_evm_usb_gpio_lookup = {
57+
.dev_id = "ohci-da8xx",
58+
.table = {
59+
GPIO_LOOKUP("davinci_gpio", ON_BD_USB_DRV, "vbus", 0),
60+
GPIO_LOOKUP("davinci_gpio", ON_BD_USB_OVC, "oc", 0),
61+
},
62+
};
9463

9564
static struct da8xx_ohci_root_hub da830_evm_usb11_pdata = {
96-
.set_power = da830_evm_usb_set_power,
97-
.get_power = da830_evm_usb_get_power,
98-
.get_oci = da830_evm_usb_get_oci,
99-
.ocic_notify = da830_evm_usb_ocic_notify,
100-
10165
/* TPS2065 switch @ 5V */
10266
.potpgt = (3 + 1) / 2, /* 3 ms max */
10367
};
10468

105-
static irqreturn_t da830_evm_usb_ocic_irq(int irq, void *dev_id)
106-
{
107-
da830_evm_usb_ocic_handler(&da830_evm_usb11_pdata, 1);
108-
return IRQ_HANDLED;
109-
}
110-
11169
static __init void da830_evm_usb_init(void)
11270
{
11371
int ret;
@@ -142,21 +100,7 @@ static __init void da830_evm_usb_init(void)
142100
return;
143101
}
144102

145-
ret = gpio_request(ON_BD_USB_DRV, "ON_BD_USB_DRV");
146-
if (ret) {
147-
pr_err("%s: failed to request GPIO for USB 1.1 port power control: %d\n",
148-
__func__, ret);
149-
return;
150-
}
151-
gpio_direction_output(ON_BD_USB_DRV, 0);
152-
153-
ret = gpio_request(ON_BD_USB_OVC, "ON_BD_USB_OVC");
154-
if (ret) {
155-
pr_err("%s: failed to request GPIO for USB 1.1 port over-current indicator: %d\n",
156-
__func__, ret);
157-
return;
158-
}
159-
gpio_direction_input(ON_BD_USB_OVC);
103+
gpiod_add_lookup_table(&da830_evm_usb_gpio_lookup);
160104

161105
ret = da8xx_register_usb11(&da830_evm_usb11_pdata);
162106
if (ret)
@@ -457,12 +401,9 @@ static struct nvmem_cell_lookup da830_evm_nvmem_cell_lookup = {
457401
.con_id = "mac-address",
458402
};
459403

460-
static struct at24_platform_data da830_evm_i2c_eeprom_info = {
461-
.byte_len = SZ_256K / 8,
462-
.page_size = 64,
463-
.flags = AT24_FLAG_ADDR16,
464-
.setup = davinci_get_mac_addr,
465-
.context = (void *)0x7f00,
404+
static const struct property_entry da830_evm_i2c_eeprom_properties[] = {
405+
PROPERTY_ENTRY_U32("pagesize", 64),
406+
{ }
466407
};
467408

468409
static int __init da830_evm_ui_expander_setup(struct i2c_client *client,
@@ -496,7 +437,7 @@ static struct pcf857x_platform_data __initdata da830_evm_ui_expander_info = {
496437
static struct i2c_board_info __initdata da830_evm_i2c_devices[] = {
497438
{
498439
I2C_BOARD_INFO("24c256", 0x50),
499-
.platform_data = &da830_evm_i2c_eeprom_info,
440+
.properties = da830_evm_i2c_eeprom_properties,
500441
},
501442
{
502443
I2C_BOARD_INFO("tlv320aic3x", 0x18),
@@ -693,7 +634,7 @@ static void __init da830_evm_map_io(void)
693634
MACHINE_START(DAVINCI_DA830_EVM, "DaVinci DA830/OMAP-L137/AM17x EVM")
694635
.atag_offset = 0x100,
695636
.map_io = da830_evm_map_io,
696-
.init_irq = cp_intc_init,
637+
.init_irq = da830_init_irq,
697638
.init_time = da830_init_time,
698639
.init_machine = da830_evm_init,
699640
.init_late = davinci_init_late,

arch/arm/mach-davinci/board-da850-evm.c

Lines changed: 17 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,10 @@
4343
#include <linux/spi/flash.h>
4444

4545
#include <mach/common.h>
46-
#include "cp_intc.h"
4746
#include <mach/da8xx.h>
4847
#include <mach/mux.h>
48+
49+
#include "irqs.h"
4950
#include "sram.h"
5051

5152
#include <asm/mach-types.h>
@@ -150,32 +151,6 @@ static struct spi_board_info da850evm_spi_info[] = {
150151
},
151152
};
152153

153-
#ifdef CONFIG_MTD
154-
static void da850_evm_m25p80_notify_add(struct mtd_info *mtd)
155-
{
156-
char *mac_addr = davinci_soc_info.emac_pdata->mac_addr;
157-
size_t retlen;
158-
159-
if (!strcmp(mtd->name, "MAC-Address")) {
160-
mtd_read(mtd, 0, ETH_ALEN, &retlen, mac_addr);
161-
if (retlen == ETH_ALEN)
162-
pr_info("Read MAC addr from SPI Flash: %pM\n",
163-
mac_addr);
164-
}
165-
}
166-
167-
static struct mtd_notifier da850evm_spi_notifier = {
168-
.add = da850_evm_m25p80_notify_add,
169-
};
170-
171-
static void da850_evm_setup_mac_addr(void)
172-
{
173-
register_mtd_user(&da850evm_spi_notifier);
174-
}
175-
#else
176-
static void da850_evm_setup_mac_addr(void) { }
177-
#endif
178-
179154
static struct mtd_partition da850_evm_norflash_partition[] = {
180155
{
181156
.name = "bootloaders + env",
@@ -1064,6 +1039,17 @@ static const short da850_evm_rmii_pins[] = {
10641039
-1
10651040
};
10661041

1042+
static struct gpiod_hog da850_evm_emac_gpio_hogs[] = {
1043+
{
1044+
.chip_label = "davinci_gpio",
1045+
.chip_hwnum = DA850_MII_MDIO_CLKEN_PIN,
1046+
.line_name = "mdio_clk_en",
1047+
.lflags = 0,
1048+
/* dflags set in da850_evm_config_emac() */
1049+
},
1050+
{ }
1051+
};
1052+
10671053
static int __init da850_evm_config_emac(void)
10681054
{
10691055
void __iomem *cfg_chip3_base;
@@ -1102,14 +1088,9 @@ static int __init da850_evm_config_emac(void)
11021088
if (ret)
11031089
pr_warn("%s:GPIO(2,6) mux setup failed\n", __func__);
11041090

1105-
ret = gpio_request(DA850_MII_MDIO_CLKEN_PIN, "mdio_clk_en");
1106-
if (ret) {
1107-
pr_warn("Cannot open GPIO %d\n", DA850_MII_MDIO_CLKEN_PIN);
1108-
return ret;
1109-
}
1110-
1111-
/* Enable/Disable MII MDIO clock */
1112-
gpio_direction_output(DA850_MII_MDIO_CLKEN_PIN, rmii_en);
1091+
da850_evm_emac_gpio_hogs[0].dflags = rmii_en ? GPIOD_OUT_HIGH
1092+
: GPIOD_OUT_LOW;
1093+
gpiod_add_hogs(da850_evm_emac_gpio_hogs);
11131094

11141095
soc_info->emac_pdata->phy_id = DA850_EVM_PHY_ID;
11151096

@@ -1494,8 +1475,6 @@ static __init void da850_evm_init(void)
14941475
if (ret)
14951476
pr_warn("%s: SATA registration failed: %d\n", __func__, ret);
14961477

1497-
da850_evm_setup_mac_addr();
1498-
14991478
ret = da8xx_register_rproc();
15001479
if (ret)
15011480
pr_warn("%s: dsp/rproc registration failed: %d\n",
@@ -1521,7 +1500,7 @@ static void __init da850_evm_map_io(void)
15211500
MACHINE_START(DAVINCI_DA850_EVM, "DaVinci DA850/OMAP-L138/AM18x EVM")
15221501
.atag_offset = 0x100,
15231502
.map_io = da850_evm_map_io,
1524-
.init_irq = cp_intc_init,
1503+
.init_irq = da850_init_irq,
15251504
.init_time = da850_init_time,
15261505
.init_machine = da850_evm_init,
15271506
.init_late = davinci_init_late,

arch/arm/mach-davinci/board-dm355-evm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ static __init void dm355_evm_init(void)
438438
MACHINE_START(DAVINCI_DM355_EVM, "DaVinci DM355 EVM")
439439
.atag_offset = 0x100,
440440
.map_io = dm355_evm_map_io,
441-
.init_irq = davinci_irq_init,
441+
.init_irq = dm355_init_irq,
442442
.init_time = dm355_init_time,
443443
.init_machine = dm355_evm_init,
444444
.init_late = davinci_init_late,

arch/arm/mach-davinci/board-dm355-leopard.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ static __init void dm355_leopard_init(void)
273273
MACHINE_START(DM355_LEOPARD, "DaVinci DM355 leopard")
274274
.atag_offset = 0x100,
275275
.map_io = dm355_leopard_map_io,
276-
.init_irq = davinci_irq_init,
276+
.init_irq = dm355_init_irq,
277277
.init_time = dm355_init_time,
278278
.init_machine = dm355_leopard_init,
279279
.init_late = davinci_init_late,

0 commit comments

Comments
 (0)