1 From f395eddcb1dad5b6b2905efa3ccb3916f91cadb9 Mon Sep 17 00:00:00 2001
2 From: popcornmix <popcornmix@gmail.com>
3 Date: Sun, 12 May 2013 12:24:19 +0100
4 Subject: [PATCH 039/725] Main bcm2708/bcm2709 linux port
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
9 Signed-off-by: popcornmix <popcornmix@gmail.com>
10 Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
12 bcm2709: Drop platform smp and timer init code
14 irq-bcm2836 handles this through these functions:
15 bcm2835_init_local_timer_frequency()
16 bcm2836_arm_irqchip_smp_init()
18 Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
20 bcm270x: Use watchdog for reboot/poweroff
22 The watchdog driver already has support for reboot/poweroff.
23 Make use of this and remove the code from the platform files.
25 Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
27 board_bcm2835: Remove coherent dma pool increase - API has gone
29 arch/arm/mach-bcm/Kconfig | 1 +
30 arch/arm/mm/proc-v6.S | 15 ++++++++++++---
31 drivers/irqchip/irq-bcm2835.c | 7 ++++++-
32 drivers/mailbox/bcm2835-mailbox.c | 18 ++++++++++++++++--
33 4 files changed, 35 insertions(+), 6 deletions(-)
35 --- a/arch/arm/mach-bcm/Kconfig
36 +++ b/arch/arm/mach-bcm/Kconfig
37 @@ -168,6 +168,7 @@ config ARCH_BCM2835
40 select PINCTRL_BCM2835
41 + select MFD_SYSCON if ARCH_MULTI_V7
43 This enables support for the Broadcom BCM2835 and BCM2836 SoCs.
44 This SoC is used in the Raspberry Pi and Roku 2 devices.
45 --- a/arch/arm/mm/proc-v6.S
46 +++ b/arch/arm/mm/proc-v6.S
47 @@ -73,10 +73,19 @@ ENDPROC(cpu_v6_reset)
49 * IRQs are already disabled.
52 +/* See jira SW-5991 for details of this workaround */
55 - mcr p15, 0, r1, c7, c10, 4 @ DWB - WFI may enter a low-power mode
56 - mcr p15, 0, r1, c7, c0, 4 @ wait for interrupt
61 + mcreq p15, 0, r1, c7, c10, 4 @ DWB - WFI may enter a low-power mode
62 + mcreq p15, 0, r1, c7, c0, 4 @ wait for interrupt
69 ENTRY(cpu_v6_dcache_clean_area)
70 --- a/drivers/irqchip/irq-bcm2835.c
71 +++ b/drivers/irqchip/irq-bcm2835.c
73 #include <linux/irqdomain.h>
75 #include <asm/exception.h>
77 #include <asm/mach/irq.h>
80 /* Put the bank and irq (32 bits) into the hwirq */
81 #define MAKE_HWIRQ(b, n) (((b) << 5) | (n))
84 #define IRQS_PER_BANK 32
85 #define NUMBER_IRQS MAKE_HWIRQ(NR_BANKS, 0)
87 #define FIQ_START (NR_IRQS_BANK0 + MAKE_HWIRQ(NR_BANKS - 1, 0))
89 static const int reg_pending[] __initconst = { 0x00, 0x04, 0x08 };
90 @@ -247,10 +250,12 @@ static int __init armctrl_of_init(struct
91 MAKE_HWIRQ(b, i) + NUMBER_IRQS);
93 irq_set_chip(irq, &armctrl_chip);
94 - set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
104 --- a/drivers/mailbox/bcm2835-mailbox.c
105 +++ b/drivers/mailbox/bcm2835-mailbox.c
107 #define MAIL1_WRT (ARM_0_MAIL1 + 0x00)
108 #define MAIL1_STA (ARM_0_MAIL1 + 0x18)
110 +/* On ARCH_BCM270x these come through <linux/interrupt.h> (arm_control.h ) */
112 /* Status register: FIFO state. */
113 #define ARM_MS_FULL BIT(31)
114 #define ARM_MS_EMPTY BIT(30)
116 /* Configuration register: Enable interrupts. */
117 #define ARM_MC_IHAVEDATAIRQEN BIT(0)
120 struct bcm2835_mbox {
122 @@ -151,7 +154,7 @@ static int bcm2835_mbox_probe(struct pla
124 spin_lock_init(&mbox->lock);
126 - ret = devm_request_irq(dev, irq_of_parse_and_map(dev->of_node, 0),
127 + ret = devm_request_irq(dev, platform_get_irq(pdev, 0),
128 bcm2835_mbox_irq, 0, dev_name(dev), mbox);
130 dev_err(dev, "Failed to register a mailbox IRQ handler: %d\n",
131 @@ -209,7 +212,18 @@ static struct platform_driver bcm2835_mb
132 .probe = bcm2835_mbox_probe,
133 .remove = bcm2835_mbox_remove,
135 -module_platform_driver(bcm2835_mbox_driver);
137 +static int __init bcm2835_mbox_init(void)
139 + return platform_driver_register(&bcm2835_mbox_driver);
141 +arch_initcall(bcm2835_mbox_init);
143 +static void __init bcm2835_mbox_exit(void)
145 + platform_driver_unregister(&bcm2835_mbox_driver);
147 +module_exit(bcm2835_mbox_exit);
149 MODULE_AUTHOR("Lubomir Rintel <lkundrak@v3.sk>");
150 MODULE_DESCRIPTION("BCM2835 mailbox IPC driver");