Skip to content

BCM2708: use pinctrl-bcm2835 #748

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jan 2, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion arch/arm/boot/dts/bcm2708.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,15 @@
};

gpio: gpio {
compatible = "brcm,bcm2708-pinctrl";
compatible = "brcm,bcm2835-gpio";
reg = <0x7e200000 0xb4>;
interrupts = <2 17>, <2 18>;

gpio-controller;
#gpio-cells = <2>;

interrupt-controller;
#interrupt-cells = <2>;
};

i2s: i2s@7e203000 {
Expand Down
4 changes: 2 additions & 2 deletions arch/arm/mach-bcm2708/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ config BCM2708_DT
depends on MACH_BCM2708
default n
select USE_OF
select ARCH_REQUIRE_GPIOLIB
select PINCTRL
select PINCTRL_BCM2708
select BCM2708_GPIO
select PINCTRL_BCM2835
help
Enable Device Tree support for BCM2708

Expand Down
11 changes: 5 additions & 6 deletions arch/arm/mach-bcm2708/armctrl.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ static void armctrl_unmask_irq(struct irq_data *d)
#ifdef CONFIG_OF

#define NR_IRQS_BANK0 21
#define NR_BANKS 3 + 1 /* bank 3 is used for GPIO interrupts */
#define NR_BANKS 3
#define IRQS_PER_BANK 32

/* from drivers/irqchip/irq-bcm2835.c */
Expand All @@ -108,10 +108,8 @@ static int armctrl_xlate(struct irq_domain *d, struct device_node *ctrlr,
*out_hwirq = ARM_IRQ0_BASE + intspec[1];
else if (intspec[0] == 1)
*out_hwirq = ARM_IRQ1_BASE + intspec[1];
else if (intspec[0] == 2)
*out_hwirq = ARM_IRQ2_BASE + intspec[1];
else
*out_hwirq = GPIO_IRQ_START + intspec[1];
*out_hwirq = ARM_IRQ2_BASE + intspec[1];

/* reverse remap_irqs[] */
switch (*out_hwirq) {
Expand Down Expand Up @@ -167,7 +165,8 @@ void __init armctrl_dt_init(void)
if (!np)
return;

domain = irq_domain_add_legacy(np, NR_IRQS, IRQ_ARMCTRL_START, 0,
domain = irq_domain_add_legacy(np, BCM2708_ALLOC_IRQS,
IRQ_ARMCTRL_START, 0,
&armctrl_ops, NULL);
WARN_ON(!domain);
}
Expand Down Expand Up @@ -298,7 +297,7 @@ int __init armctrl_init(void __iomem * base, unsigned int irq_start,
{
unsigned int irq;

for (irq = 0; irq < NR_IRQS; irq++) {
for (irq = 0; irq < BCM2708_ALLOC_IRQS; irq++) {
unsigned int data = irq;
if (irq >= INTERRUPT_JPEG && irq <= INTERRUPT_ARASANSDIO)
data = remap_irqs[irq - INTERRUPT_JPEG];
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-bcm2708/bcm2708.c
Original file line number Diff line number Diff line change
Expand Up @@ -838,7 +838,7 @@ void __init bcm2708_init(void)
bcm_register_device(&bcm2708_dmaman_device);
bcm_register_device(&bcm2708_vcio_device);
#ifdef CONFIG_BCM2708_GPIO
bcm_register_device(&bcm2708_gpio_device);
bcm_register_device_dt(&bcm2708_gpio_device);
#endif
#if defined(CONFIG_W1_MASTER_GPIO) || defined(CONFIG_W1_MASTER_GPIO_MODULE)
w1_gpio_pdata.pin = w1_gpio_pin;
Expand Down
6 changes: 4 additions & 2 deletions arch/arm/mach-bcm2708/include/mach/irqs.h
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,9 @@
#define FIQ_IRQS (64 + 21)
#define GPIO_IRQ_START (HARD_IRQS + FIQ_IRQS)
#define GPIO_IRQS (32*5)
#define SPARE_IRQS (64)
#define NR_IRQS (HARD_IRQS+FIQ_IRQS+GPIO_IRQS+SPARE_IRQS)
#define SPARE_ALLOC_IRQS 64
#define BCM2708_ALLOC_IRQS (HARD_IRQS+FIQ_IRQS+GPIO_IRQS+SPARE_ALLOC_IRQS)
#define FREE_IRQS 128
#define NR_IRQS (BCM2708_ALLOC_IRQS+FREE_IRQS)

#endif /* _BCM2708_IRQS_H_ */
5 changes: 0 additions & 5 deletions drivers/pinctrl/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,6 @@ config PINCTRL_BAYTRAIL

Requires ACPI device enumeration code to set up a platform device.

config PINCTRL_BCM2708
bool
select PINMUX
select PINCONF

config PINCTRL_BCM2835
bool
select PINMUX
Expand Down
1 change: 0 additions & 1 deletion drivers/pinctrl/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ obj-$(CONFIG_PINCTRL_AS3722) += pinctrl-as3722.o
obj-$(CONFIG_PINCTRL_BF54x) += pinctrl-adi2-bf54x.o
obj-$(CONFIG_PINCTRL_BF60x) += pinctrl-adi2-bf60x.o
obj-$(CONFIG_PINCTRL_AT91) += pinctrl-at91.o
obj-$(CONFIG_PINCTRL_BCM2708) += pinctrl-bcm2708.o
obj-$(CONFIG_PINCTRL_BCM2835) += pinctrl-bcm2835.o
obj-$(CONFIG_PINCTRL_BAYTRAIL) += pinctrl-baytrail.o
obj-$(CONFIG_PINCTRL_BCM281XX) += pinctrl-bcm281xx.o
Expand Down
Loading