Skip to content

Commit 78e59a9

Browse files
committed
Main bcm2708/bcm2709 linux port
Signed-off-by: popcornmix <[email protected]> Signed-off-by: Noralf Trønnes <[email protected]> bcm2709: Drop platform smp and timer init code irq-bcm2836 handles this through these functions: bcm2835_init_local_timer_frequency() bcm2836_arm_irqchip_smp_init() Signed-off-by: Noralf Trønnes <[email protected]> bcm270x: Use watchdog for reboot/poweroff The watchdog driver already has support for reboot/poweroff. Make use of this and remove the code from the platform files. Signed-off-by: Noralf Trønnes <[email protected]> board_bcm2835: Remove coherent dma pool increase - API has gone
1 parent 3fe0cdc commit 78e59a9

File tree

4 files changed

+35
-6
lines changed

4 files changed

+35
-6
lines changed

arch/arm/mach-bcm/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ config ARCH_BCM2835
169169
select PINCTRL
170170
select PINCTRL_BCM2835
171171
select MFD_CORE
172+
select MFD_SYSCON if ARCH_MULTI_V7
172173
help
173174
This enables support for the Broadcom BCM2835 and BCM2836 SoCs.
174175
This SoC is used in the Raspberry Pi and Roku 2 devices.

arch/arm/mm/proc-v6.S

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,19 @@ ENDPROC(cpu_v6_reset)
7373
*
7474
* IRQs are already disabled.
7575
*/
76+
77+
/* See jira SW-5991 for details of this workaround */
7678
ENTRY(cpu_v6_do_idle)
77-
mov r1, #0
78-
mcr p15, 0, r1, c7, c10, 4 @ DWB - WFI may enter a low-power mode
79-
mcr p15, 0, r1, c7, c0, 4 @ wait for interrupt
79+
.align 5
80+
mov r1, #2
81+
1: subs r1, #1
82+
nop
83+
mcreq p15, 0, r1, c7, c10, 4 @ DWB - WFI may enter a low-power mode
84+
mcreq p15, 0, r1, c7, c0, 4 @ wait for interrupt
85+
nop
86+
nop
87+
nop
88+
bne 1b
8089
ret lr
8190

8291
ENTRY(cpu_v6_dcache_clean_area)

drivers/irqchip/irq-bcm2835.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@
4343
#include <linux/irqdomain.h>
4444

4545
#include <asm/exception.h>
46+
#ifndef CONFIG_ARM64
4647
#include <asm/mach/irq.h>
48+
#endif
4749

4850
/* Put the bank and irq (32 bits) into the hwirq */
4951
#define MAKE_HWIRQ(b, n) (((b) << 5) | (n))
@@ -71,6 +73,7 @@
7173
#define NR_BANKS 3
7274
#define IRQS_PER_BANK 32
7375
#define NUMBER_IRQS MAKE_HWIRQ(NR_BANKS, 0)
76+
#undef FIQ_START
7477
#define FIQ_START (NR_IRQS_BANK0 + MAKE_HWIRQ(NR_BANKS - 1, 0))
7578

7679
static const int reg_pending[] __initconst = { 0x00, 0x04, 0x08 };
@@ -238,10 +241,12 @@ static int __init armctrl_of_init(struct device_node *node,
238241
MAKE_HWIRQ(b, i) + NUMBER_IRQS);
239242
BUG_ON(irq <= 0);
240243
irq_set_chip(irq, &armctrl_chip);
241-
set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
244+
irq_set_probe(irq);
242245
}
243246
}
247+
#ifndef CONFIG_ARM64
244248
init_FIQ(FIQ_START);
249+
#endif
245250

246251
return 0;
247252
}

drivers/mailbox/bcm2835-mailbox.c

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,15 @@
4545
#define MAIL1_WRT (ARM_0_MAIL1 + 0x00)
4646
#define MAIL1_STA (ARM_0_MAIL1 + 0x18)
4747

48+
/* On ARCH_BCM270x these come through <linux/interrupt.h> (arm_control.h ) */
49+
#ifndef ARM_MS_FULL
4850
/* Status register: FIFO state. */
4951
#define ARM_MS_FULL BIT(31)
5052
#define ARM_MS_EMPTY BIT(30)
5153

5254
/* Configuration register: Enable interrupts. */
5355
#define ARM_MC_IHAVEDATAIRQEN BIT(0)
56+
#endif
5457

5558
struct bcm2835_mbox {
5659
void __iomem *regs;
@@ -145,7 +148,7 @@ static int bcm2835_mbox_probe(struct platform_device *pdev)
145148
return -ENOMEM;
146149
spin_lock_init(&mbox->lock);
147150

148-
ret = devm_request_irq(dev, irq_of_parse_and_map(dev->of_node, 0),
151+
ret = devm_request_irq(dev, platform_get_irq(pdev, 0),
149152
bcm2835_mbox_irq, 0, dev_name(dev), mbox);
150153
if (ret) {
151154
dev_err(dev, "Failed to register a mailbox IRQ handler: %d\n",
@@ -195,7 +198,18 @@ static struct platform_driver bcm2835_mbox_driver = {
195198
},
196199
.probe = bcm2835_mbox_probe,
197200
};
198-
module_platform_driver(bcm2835_mbox_driver);
201+
202+
static int __init bcm2835_mbox_init(void)
203+
{
204+
return platform_driver_register(&bcm2835_mbox_driver);
205+
}
206+
arch_initcall(bcm2835_mbox_init);
207+
208+
static void __init bcm2835_mbox_exit(void)
209+
{
210+
platform_driver_unregister(&bcm2835_mbox_driver);
211+
}
212+
module_exit(bcm2835_mbox_exit);
199213

200214
MODULE_AUTHOR("Lubomir Rintel <[email protected]>");
201215
MODULE_DESCRIPTION("BCM2835 mailbox IPC driver");

0 commit comments

Comments
 (0)