Skip to content

Make vcio (mailbox) driver available on ARCH_BCM2835 #949

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 20 commits into from
May 12, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
cf66494
bcm2835-mmc: Add range of debug options for slowing things down
popcornmix Apr 13, 2015
1d8bcdc
BCM270x: Correct vcio device memory resource and add irq resource
notro Apr 30, 2015
c74a7ed
video: fbdev: bcm2708_fb: Don't panic on error
notro May 2, 2015
78eb51e
BCM2708: vcio: Fix checkpatch issues
notro Apr 30, 2015
569d066
BCM2708: vcio: Remove unused code and compact comments
notro Apr 30, 2015
6863246
BCM2708: vcio: Move character device teardown to driver remove
notro Apr 30, 2015
c7a7c7a
BCM2708: vcio: Restructure error paths
notro Apr 30, 2015
a29c265
BCM2708: vcio: Move some macros from header to driver
notro Apr 30, 2015
754c5e3
BCM2708: vcio: Only store the register base address
notro Apr 30, 2015
c69bb5c
BCM2708: vcio: Do not print messages in module init
notro Apr 30, 2015
cf393a5
BCM2708: vcio: Use device resources
notro Apr 30, 2015
12fefcc
mailbox: bcm2708: Add bcm2708-vcio
notro May 1, 2015
255c6d2
BCM270x: power: Change initcall level to subsys
notro May 1, 2015
12f1ced
BCM270x: Use bcm2708-vcio
notro May 2, 2015
7c554f9
BCM270x: Remove arch driver vcio.c
notro May 2, 2015
ce4b1f4
BCM270x_DT: Add mailbox bcm2708-vcio
notro May 1, 2015
6262efc
bcm2835: bcm2835_defconfig enable BCM2708_MBOX
notro May 1, 2015
6500785
bcm2835: Add mailbox bcm2708-vcio to Device Tree
notro May 1, 2015
90717b4
mailbox: bcm2708-vcio: Allocation does not need to be atomic
notro May 12, 2015
3018d8a
mailbox: bcm2708-vcio: Check the correct status register before writing
notro May 12, 2015
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
6 changes: 6 additions & 0 deletions arch/arm/boot/dts/bcm2708_common.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@
#interrupt-cells = <2>;
};

mailbox: mailbox@7e00b800 {
compatible = "brcm,bcm2708-vcio";
reg = <0x7e00b880 0x40>;
interrupts = <0 1>;
};

gpio: gpio {
compatible = "brcm,bcm2835-gpio";
reg = <0x7e200000 0xb4>;
Expand Down
6 changes: 6 additions & 0 deletions arch/arm/boot/dts/bcm2835.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@
reg = <0x7e104000 0x10>;
};

mailbox: mailbox@7e00b800 {
compatible = "brcm,bcm2708-vcio";
reg = <0x7e00b880 0x40>;
interrupts = <0 1>;
};

gpio: gpio@7e200000 {
compatible = "brcm,bcm2835-gpio";
reg = <0x7e200000 0xb4>;
Expand Down
2 changes: 2 additions & 0 deletions arch/arm/configs/bcm2709_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1052,6 +1052,8 @@ CONFIG_FB_TFT_UPD161704=m
CONFIG_FB_TFT_WATTEROTT=m
CONFIG_FB_FLEX=m
CONFIG_FB_TFT_FBTFT_DEVICE=m
CONFIG_MAILBOX=y
CONFIG_BCM2708_MBOX=y
# CONFIG_IOMMU_SUPPORT is not set
CONFIG_EXTCON=m
CONFIG_EXTCON_ARIZONA=m
Expand Down
2 changes: 2 additions & 0 deletions arch/arm/configs/bcm2835_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ CONFIG_LEDS_TRIGGER_CAMERA=y
CONFIG_DMADEVICES=y
CONFIG_DMA_BCM2708=y
CONFIG_STAGING=y
CONFIG_MAILBOX=y
CONFIG_BCM2708_MBOX=y
# CONFIG_IOMMU_SUPPORT is not set
CONFIG_EXT2_FS=y
CONFIG_EXT2_FS_XATTR=y
Expand Down
2 changes: 2 additions & 0 deletions arch/arm/configs/bcmrpi_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1045,6 +1045,8 @@ CONFIG_FB_TFT_UPD161704=m
CONFIG_FB_TFT_WATTEROTT=m
CONFIG_FB_FLEX=m
CONFIG_FB_TFT_FBTFT_DEVICE=m
CONFIG_MAILBOX=y
CONFIG_BCM2708_MBOX=y
# CONFIG_IOMMU_SUPPORT is not set
CONFIG_EXTCON=m
CONFIG_EXTCON_ARIZONA=m
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-bcm2708/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
# Makefile for the linux kernel.
#

obj-$(CONFIG_MACH_BCM2708) += bcm2708.o armctrl.o vcio.o power.o
obj-$(CONFIG_MACH_BCM2708) += bcm2708.o armctrl.o power.o
obj-$(CONFIG_BCM2708_GPIO) += bcm2708_gpio.o
obj-$(CONFIG_BCM2708_VCMEM) += vc_mem.o
19 changes: 11 additions & 8 deletions arch/arm/mach-bcm2708/bcm2708.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
#include <asm/mach/map.h>

#include <mach/timex.h>
#include <mach/vcio.h>
#include <mach/system.h>

#include <linux/delay.h>
Expand Down Expand Up @@ -414,17 +413,21 @@ static struct platform_device bcm2708_usb_device = {
};

static struct resource bcm2708_vcio_resources[] = {
[0] = { /* mailbox/semaphore/doorbell access */
.start = MCORE_BASE,
.end = MCORE_BASE + SZ_4K - 1,
.flags = IORESOURCE_MEM,
},
{
.start = ARMCTRL_0_MAIL0_BASE,
.end = ARMCTRL_0_MAIL0_BASE + SZ_64 - 1,
.flags = IORESOURCE_MEM,
}, {
.start = IRQ_ARM_MAILBOX,
.end = IRQ_ARM_MAILBOX,
.flags = IORESOURCE_IRQ,
},
};

static u64 vcio_dmamask = DMA_BIT_MASK(DMA_MASK_BITS_COMMON);

static struct platform_device bcm2708_vcio_device = {
.name = BCM_VCIO_DRIVER_NAME,
.name = "bcm2708_vcio",
.id = -1, /* only one VideoCore I/O area */
.resource = bcm2708_vcio_resources,
.num_resources = ARRAY_SIZE(bcm2708_vcio_resources),
Expand Down Expand Up @@ -905,7 +908,7 @@ void __init bcm2708_init(void)
bcm2708_dt_init();

bcm_register_device_dt(&bcm2708_dmaengine_device);
bcm_register_device(&bcm2708_vcio_device);
bcm_register_device_dt(&bcm2708_vcio_device);
#ifdef CONFIG_BCM2708_GPIO
bcm_register_device_dt(&bcm2708_gpio_device);
#endif
Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-bcm2708/include/mach/platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
#define ARMCTRL_IC_BASE (ARM_BASE + 0x200) /* ARM interrupt controller */
#define ARMCTRL_TIMER0_1_BASE (ARM_BASE + 0x400) /* Timer 0 and 1 */
#define ARMCTRL_0_SBM_BASE (ARM_BASE + 0x800) /* User 0 (ARM)'s Semaphores Doorbells and Mailboxes */
#define ARMCTRL_0_MAIL0_BASE (ARMCTRL_0_SBM_BASE + 0x80) /* User 0 (ARM)'s Mailbox 0 */


/*
Expand Down
8 changes: 6 additions & 2 deletions arch/arm/mach-bcm2708/power.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
#include <linux/module.h>
#include <linux/semaphore.h>
#include <linux/bug.h>
#include <linux/platform_data/mailbox-bcm2708.h>
#include <mach/power.h>
#include <mach/vcio.h>
#include <mach/arm_power.h>

#define DRIVER_NAME "bcm2708_power"
Expand Down Expand Up @@ -189,7 +189,11 @@ static void __exit bcm_power_exit(void)
bcm_mailbox_write(MBOX_CHAN_POWER, 0);
}

arch_initcall(bcm_power_init); /* Initialize early */
/*
* Load after the mailbox driver is initialized (arch_initcall),
* but before depending drivers (module_init).
*/
subsys_initcall(bcm_power_init);
module_exit(bcm_power_exit);

MODULE_AUTHOR("Phil Elwell");
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-bcm2708/vc_mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include <linux/debugfs.h>
#include <asm/uaccess.h>
#include <linux/dma-mapping.h>
#include <linux/platform_data/mailbox-bcm2708.h>

#ifdef CONFIG_ARCH_KONA
#include <chal/chal_ipc.h>
Expand All @@ -31,7 +32,6 @@
#endif

#include "mach/vc_mem.h"
#include <mach/vcio.h>

#define DRIVER_NAME "vc-mem"

Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-bcm2709/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
# Makefile for the linux kernel.
#

obj-$(CONFIG_MACH_BCM2709) += bcm2709.o armctrl.o vcio.o power.o
obj-$(CONFIG_MACH_BCM2709) += bcm2709.o armctrl.o power.o
obj-$(CONFIG_BCM2708_GPIO) += bcm2708_gpio.o
obj-$(CONFIG_BCM2708_VCMEM) += vc_mem.o
19 changes: 11 additions & 8 deletions arch/arm/mach-bcm2709/bcm2709.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@
#include <asm/mach/map.h>

#include <mach/timex.h>
#include <mach/vcio.h>
#include <mach/system.h>

#include <linux/delay.h>
Expand Down Expand Up @@ -433,17 +432,21 @@ static struct platform_device bcm2708_usb_device = {
};

static struct resource bcm2708_vcio_resources[] = {
[0] = { /* mailbox/semaphore/doorbell access */
.start = MCORE_BASE,
.end = MCORE_BASE + SZ_4K - 1,
.flags = IORESOURCE_MEM,
},
{
.start = ARMCTRL_0_MAIL0_BASE,
.end = ARMCTRL_0_MAIL0_BASE + SZ_64 - 1,
.flags = IORESOURCE_MEM,
}, {
.start = IRQ_ARM_MAILBOX,
.end = IRQ_ARM_MAILBOX,
.flags = IORESOURCE_IRQ,
},
};

static u64 vcio_dmamask = DMA_BIT_MASK(DMA_MASK_BITS_COMMON);

static struct platform_device bcm2708_vcio_device = {
.name = BCM_VCIO_DRIVER_NAME,
.name = "bcm2708_vcio",
.id = -1, /* only one VideoCore I/O area */
.resource = bcm2708_vcio_resources,
.num_resources = ARRAY_SIZE(bcm2708_vcio_resources),
Expand Down Expand Up @@ -926,7 +929,7 @@ void __init bcm2709_init(void)
bcm2709_dt_init();

bcm_register_device_dt(&bcm2708_dmaengine_device);
bcm_register_device(&bcm2708_vcio_device);
bcm_register_device_dt(&bcm2708_vcio_device);
#ifdef CONFIG_BCM2708_GPIO
bcm_register_device_dt(&bcm2708_gpio_device);
#endif
Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-bcm2709/include/mach/platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
#define ARMCTRL_IC_BASE (ARM_BASE + 0x200) /* ARM interrupt controller */
#define ARMCTRL_TIMER0_1_BASE (ARM_BASE + 0x400) /* Timer 0 and 1 */
#define ARMCTRL_0_SBM_BASE (ARM_BASE + 0x800) /* User 0 (ARM)'s Semaphores Doorbells and Mailboxes */
#define ARMCTRL_0_MAIL0_BASE (ARMCTRL_0_SBM_BASE + 0x80) /* User 0 (ARM)'s Mailbox 0 */


/*
Expand Down
165 changes: 0 additions & 165 deletions arch/arm/mach-bcm2709/include/mach/vcio.h

This file was deleted.

Loading