Skip to content

Commit 2edaa24

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 899ebde commit 2edaa24

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
@@ -162,6 +162,7 @@ config ARCH_BCM2835
162162
select PINCTRL
163163
select PINCTRL_BCM2835
164164
select MFD_CORE
165+
select MFD_SYSCON if ARCH_MULTI_V7
165166
help
166167
This enables support for the Broadcom BCM2711 and BCM283x SoCs.
167168
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
@@ -75,10 +75,19 @@ SYM_FUNC_END(cpu_v6_reset)
7575
*
7676
* IRQs are already disabled.
7777
*/
78+
79+
/* See jira SW-5991 for details of this workaround */
7880
SYM_TYPED_FUNC_START(cpu_v6_do_idle)
79-
mov r1, #0
80-
mcr p15, 0, r1, c7, c10, 4 @ DWB - WFI may enter a low-power mode
81-
mcr p15, 0, r1, c7, c0, 4 @ wait for interrupt
81+
.align 5
82+
mov r1, #2
83+
1: subs r1, #1
84+
nop
85+
mcreq p15, 0, r1, c7, c10, 4 @ DWB - WFI may enter a low-power mode
86+
mcreq p15, 0, r1, c7, c0, 4 @ wait for interrupt
87+
nop
88+
nop
89+
nop
90+
bne 1b
8291
ret lr
8392
SYM_FUNC_END(cpu_v6_do_idle)
8493

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))
@@ -72,6 +74,7 @@
7274
#define NR_BANKS 3
7375
#define IRQS_PER_BANK 32
7476
#define NUMBER_IRQS MAKE_HWIRQ(NR_BANKS, 0)
77+
#undef FIQ_START
7578
#define FIQ_START (NR_IRQS_BANK0 + MAKE_HWIRQ(NR_BANKS - 1, 0))
7679

7780
static const int reg_pending[] __initconst = { 0x00, 0x04, 0x08 };
@@ -255,10 +258,12 @@ static int __init armctrl_of_init(struct device_node *node,
255258
MAKE_HWIRQ(b, i) + NUMBER_IRQS);
256259
BUG_ON(irq <= 0);
257260
irq_set_chip(irq, &armctrl_chip);
258-
set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
261+
irq_set_probe(irq);
259262
}
260263
}
264+
#ifndef CONFIG_ARM64
261265
init_FIQ(FIQ_START);
266+
#endif
262267

263268
return 0;
264269
}

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;
@@ -144,7 +147,7 @@ static int bcm2835_mbox_probe(struct platform_device *pdev)
144147
return -ENOMEM;
145148
spin_lock_init(&mbox->lock);
146149

147-
ret = devm_request_irq(dev, irq_of_parse_and_map(dev->of_node, 0),
150+
ret = devm_request_irq(dev, platform_get_irq(pdev, 0),
148151
bcm2835_mbox_irq, IRQF_NO_SUSPEND, dev_name(dev),
149152
mbox);
150153
if (ret) {
@@ -193,7 +196,18 @@ static struct platform_driver bcm2835_mbox_driver = {
193196
},
194197
.probe = bcm2835_mbox_probe,
195198
};
196-
module_platform_driver(bcm2835_mbox_driver);
199+
200+
static int __init bcm2835_mbox_init(void)
201+
{
202+
return platform_driver_register(&bcm2835_mbox_driver);
203+
}
204+
arch_initcall(bcm2835_mbox_init);
205+
206+
static void __init bcm2835_mbox_exit(void)
207+
{
208+
platform_driver_unregister(&bcm2835_mbox_driver);
209+
}
210+
module_exit(bcm2835_mbox_exit);
197211

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

0 commit comments

Comments
 (0)