Skip to content

Commit 9112b62

Browse files
committed
Merge pull request #970 from notro/fb
bcm2708_fb: Add ARCH_BCM2835 support
2 parents 3048b2e + 1828274 commit 9112b62

File tree

12 files changed

+39
-12
lines changed

12 files changed

+39
-12
lines changed

arch/arm/boot/dts/bcm2708-rpi-b-plus.dts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@
4949
bus-width = <4>;
5050
};
5151

52+
&fb {
53+
status = "okay";
54+
};
55+
5256
&spi0 {
5357
pinctrl-names = "default";
5458
pinctrl-0 = <&spi0_pins>;

arch/arm/boot/dts/bcm2708-rpi-b.dts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@
4949
bus-width = <4>;
5050
};
5151

52+
&fb {
53+
status = "okay";
54+
};
55+
5256
&spi0 {
5357
pinctrl-names = "default";
5458
pinctrl-0 = <&spi0_pins>;

arch/arm/boot/dts/bcm2708_common.dtsi

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,11 @@
109109
leds: leds {
110110
compatible = "gpio-leds";
111111
};
112+
113+
fb: fb {
114+
compatible = "brcm,bcm2708-fb";
115+
status = "disabled";
116+
};
112117
};
113118

114119
clocks {

arch/arm/boot/dts/bcm2709-rpi-2-b.dts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@
4949
bus-width = <4>;
5050
};
5151

52+
&fb {
53+
status = "okay";
54+
};
55+
5256
&spi0 {
5357
pinctrl-names = "default";
5458
pinctrl-0 = <&spi0_pins>;

arch/arm/boot/dts/bcm2835-rpi.dtsi

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,7 @@
4949
status = "okay";
5050
bus-width = <4>;
5151
};
52+
53+
&fb {
54+
status = "okay";
55+
};

arch/arm/boot/dts/bcm2835.dtsi

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#address-cells = <1>;
1515
#size-cells = <1>;
1616
ranges = <0x7e000000 0x20000000 0x02000000>;
17+
dma-ranges = <0x40000000 0x00000000 0x20000000>;
1718

1819
timer@7e003000 {
1920
compatible = "brcm,bcm2835-system-timer";
@@ -158,6 +159,11 @@
158159
arm-pmu {
159160
compatible = "arm,arm1176-pmu";
160161
};
162+
163+
fb: fb {
164+
compatible = "brcm,bcm2708-fb";
165+
status = "disabled";
166+
};
161167
};
162168

163169
clocks {

arch/arm/configs/bcm2835_defconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ CONFIG_SPI_BCM2835=y
7272
CONFIG_GPIO_SYSFS=y
7373
# CONFIG_HWMON is not set
7474
CONFIG_FB=y
75-
CONFIG_FB_SIMPLE=y
75+
CONFIG_FB_BCM2708=y
7676
CONFIG_FRAMEBUFFER_CONSOLE=y
7777
CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y
7878
CONFIG_USB=y

arch/arm/mach-bcm2708/bcm2708.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -928,7 +928,7 @@ void __init bcm2708_init(void)
928928
bcm_register_device_dt(&w1_device);
929929
#endif
930930
bcm_register_device(&bcm2708_systemtimer_device);
931-
bcm_register_device(&bcm2708_fb_device);
931+
bcm_register_device_dt(&bcm2708_fb_device);
932932
bcm_register_device(&bcm2708_usb_device);
933933
bcm_register_device(&bcm2708_uart1_device);
934934
bcm_register_device(&bcm2708_powerman_device);

arch/arm/mach-bcm2708/include/mach/dma.h

Lines changed: 0 additions & 2 deletions
This file was deleted.

arch/arm/mach-bcm2709/bcm2709.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -951,7 +951,7 @@ void __init bcm2709_init(void)
951951
#ifdef SYSTEM_TIMER
952952
bcm_register_device(&bcm2708_systemtimer_device);
953953
#endif
954-
bcm_register_device(&bcm2708_fb_device);
954+
bcm_register_device_dt(&bcm2708_fb_device);
955955
bcm_register_device(&bcm2708_usb_device);
956956
bcm_register_device(&bcm2708_uart1_device);
957957
bcm_register_device(&bcm2708_powerman_device);

arch/arm/mach-bcm2709/include/mach/dma.h

Lines changed: 0 additions & 2 deletions
This file was deleted.

drivers/video/fbdev/bcm2708_fb.c

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,13 @@
2424
#include <linux/interrupt.h>
2525
#include <linux/ioport.h>
2626
#include <linux/list.h>
27+
#include <linux/platform_data/dma-bcm2708.h>
2728
#include <linux/platform_data/mailbox-bcm2708.h>
2829
#include <linux/platform_device.h>
2930
#include <linux/clk.h>
3031
#include <linux/printk.h>
3132
#include <linux/console.h>
3233
#include <linux/debugfs.h>
33-
34-
#include <mach/dma.h>
35-
#include <mach/platform.h>
36-
3734
#include <asm/sizes.h>
3835
#include <linux/io.h>
3936
#include <linux/dma-mapping.h>
@@ -628,7 +625,7 @@ static int bcm2708_fb_register(struct bcm2708_fb *fb)
628625
void *mem;
629626

630627
mem =
631-
dma_alloc_coherent(NULL, PAGE_ALIGN(sizeof(*fb->info)), &dma,
628+
dma_alloc_coherent(&fb->dev->dev, PAGE_ALIGN(sizeof(*fb->info)), &dma,
632629
GFP_KERNEL);
633630

634631
if (NULL == mem) {
@@ -783,12 +780,19 @@ static int bcm2708_fb_remove(struct platform_device *dev)
783780
return 0;
784781
}
785782

783+
static const struct of_device_id bcm2708_fb_of_match_table[] = {
784+
{ .compatible = "brcm,bcm2708-fb", },
785+
{},
786+
};
787+
MODULE_DEVICE_TABLE(of, bcm2708_fb_of_match_table);
788+
786789
static struct platform_driver bcm2708_fb_driver = {
787790
.probe = bcm2708_fb_probe,
788791
.remove = bcm2708_fb_remove,
789792
.driver = {
790793
.name = DRIVER_NAME,
791794
.owner = THIS_MODULE,
795+
.of_match_table = bcm2708_fb_of_match_table,
792796
},
793797
};
794798

0 commit comments

Comments
 (0)