Skip to content

Commit ce443ab

Browse files
committed
unicore32 machine related: add frame buffer driver for pkunity-v3 soc
change from original version -- by advice of Paul Mundt 1. remove videomemorysize definitions 2. remove unifb_enable and unifb_setup 3. use dev_warn instead of printk in fb driver 4. remove judgement for FB_ACCEL_PUV3_UNIGFX 5. adjust clk_get and clk_set_rate calls 6. add resources definitions 7. remove unifb_option 8. adjust register for platform_device 9. adjust unifb_ops position and unifb_regs assignment position Signed-off-by: Guan Xuetao <gxt@mprc.pku.edu.cn> Acked-by: Arnd Bergmann <arnd@arndb.de>
1 parent d10e4a6 commit ce443ab

8 files changed

Lines changed: 879 additions & 2 deletions

File tree

‎MAINTAINERS‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4902,6 +4902,7 @@ S: Maintained
49024902
T: git git://git.kernel.org/pub/scm/linux/kernel/git/epip/linux-2.6-unicore32.git
49034903
F: drivers/input/serio/i8042-unicore32io.h
49044904
F: drivers/i2c/busses/i2c-puv3.c
4905+
F: drivers/video/fb-puv3.c
49054906

49064907
PMC SIERRA MaxRAID DRIVER
49074908
M: Anil Ravindranath <anil_ravindranath@pmc-sierra.com>

‎arch/unicore32/configs/debug_defconfig‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ CONFIG_LCD_BACKLIGHT=n
6666

6767
CONFIG_PUV3_RTC=y
6868
CONFIG_PUV3_UMAL=y
69-
CONFIG_PUV3_UNIGFX=y
7069
CONFIG_PUV3_MUSB=n
7170
CONFIG_PUV3_AC97=n
7271
CONFIG_PUV3_NAND=n
@@ -130,6 +129,8 @@ CONFIG_VIDEO_DEV=n
130129
CONFIG_USB_VIDEO_CLASS=n
131130

132131
# Graphics support
132+
CONFIG_FB=y
133+
CONFIG_FB_PUV3_UNIGFX=y
133134
# Console display driver support
134135
CONFIG_VGA_CONSOLE=n
135136
CONFIG_FRAMEBUFFER_CONSOLE=y

‎arch/unicore32/include/mach/memory.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ void puv3_pci_adjust_zones(unsigned long *size, unsigned long *holes);
5050

5151
/* kuser area */
5252
#define KUSER_VECPAGE_BASE (KUSER_BASE + UL(0x3fff0000))
53-
#define KUSER_UNIGFX_BASE (KUSER_BASE + PKUNITY_UNIGFX_MMAP_BASE)
53+
#define KUSER_UNIGFX_BASE (PAGE_OFFSET + PKUNITY_UNIGFX_MMAP_BASE)
5454
/* kuser_vecpage (0xbfff0000) is ro, and vectors page (0xffff0000) is rw */
5555
#define kuser_vecpage_to_vectors(x) ((x) - (KUSER_VECPAGE_BASE) \
5656
+ (VECTORS_BASE))

‎arch/unicore32/kernel/puv3-core.c‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,19 @@ static struct resource puv3_mmc_resources[] = {
9393
},
9494
};
9595

96+
static struct resource puv3_unigfx_resources[] = {
97+
[0] = {
98+
.start = PKUNITY_UNIGFX_BASE,
99+
.end = PKUNITY_UNIGFX_BASE + 0xfff,
100+
.flags = IORESOURCE_MEM,
101+
},
102+
[1] = {
103+
.start = PKUNITY_UNIGFX_MMAP_BASE,
104+
.end = PKUNITY_UNIGFX_MMAP_BASE + PKUNITY_UNIGFX_MMAP_SIZE,
105+
.flags = IORESOURCE_MEM,
106+
},
107+
};
108+
96109
static struct resource puv3_rtc_resources[] = {
97110
[0] = {
98111
.start = PKUNITY_RTC_BASE,
@@ -256,6 +269,8 @@ void __init puv3_core_init(void)
256269
puv3_umal_resources, ARRAY_SIZE(puv3_umal_resources));
257270
platform_device_register_simple("PKUnity-v3-MMC", -1,
258271
puv3_mmc_resources, ARRAY_SIZE(puv3_mmc_resources));
272+
platform_device_register_simple("PKUnity-v3-UNIGFX", -1,
273+
puv3_unigfx_resources, ARRAY_SIZE(puv3_unigfx_resources));
259274
platform_device_register_simple("PKUnity-v3-PWM", -1,
260275
puv3_pwm_resources, ARRAY_SIZE(puv3_pwm_resources));
261276
platform_device_register_simple("PKUnity-v3-UART", 0,

‎drivers/video/Kconfig‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2365,6 +2365,17 @@ config FB_JZ4740
23652365
help
23662366
Framebuffer support for the JZ4740 SoC.
23672367

2368+
config FB_PUV3_UNIGFX
2369+
tristate "PKUnity v3 Unigfx framebuffer support"
2370+
depends on FB && UNICORE32 && ARCH_PUV3
2371+
select FB_SYS_FILLRECT
2372+
select FB_SYS_COPYAREA
2373+
select FB_SYS_IMAGEBLIT
2374+
select FB_SYS_FOPS
2375+
help
2376+
Choose this option if you want to use the Unigfx device as a
2377+
framebuffer device. Without the support of PCI & AGP.
2378+
23682379
source "drivers/video/omap/Kconfig"
23692380
source "drivers/video/omap2/Kconfig"
23702381

‎drivers/video/Makefile‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ obj-$(CONFIG_FB_MB862XX) += mb862xx/
139139
obj-$(CONFIG_FB_MSM) += msm/
140140
obj-$(CONFIG_FB_NUC900) += nuc900fb.o
141141
obj-$(CONFIG_FB_JZ4740) += jz4740_fb.o
142+
obj-$(CONFIG_FB_PUV3_UNIGFX) += fb-puv3.o
142143

143144
# Platform or fallback drivers go here
144145
obj-$(CONFIG_FB_UVESA) += uvesafb.o

0 commit comments

Comments
 (0)