Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OS
U-Boot.Mirror
提交
47b8e527
U
U-Boot.Mirror
项目概览
OS
/
U-Boot.Mirror
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
U-Boot.Mirror
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
47b8e527
编写于
6月 07, 2013
作者:
T
Tom Rini
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' of
git://git.denx.de/u-boot-video
上级
38d240dc
ea697ae7
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
139 addition
and
7 deletion
+139
-7
board/raspberrypi/rpi_b/rpi_b.c
board/raspberrypi/rpi_b/rpi_b.c
+13
-1
common/lcd.c
common/lcd.c
+87
-0
doc/device-tree-bindings/video/simple-framebuffer.txt
doc/device-tree-bindings/video/simple-framebuffer.txt
+25
-0
drivers/video/cfb_console.c
drivers/video/cfb_console.c
+9
-6
include/configs/rpi_b.h
include/configs/rpi_b.h
+2
-0
include/lcd.h
include/lcd.h
+3
-0
未找到文件。
board/raspberrypi/rpi_b/rpi_b.c
浏览文件 @
47b8e527
/*
* (C) Copyright 2012 Stephen Warren
* (C) Copyright 2012
-2013
Stephen Warren
*
* See file CREDITS for list of people who contributed to this
* project.
...
...
@@ -15,6 +15,8 @@
*/
#include <common.h>
#include <config.h>
#include <lcd.h>
#include <asm/arch/mbox.h>
#include <asm/arch/sdhci.h>
#include <asm/global_data.h>
...
...
@@ -77,3 +79,13 @@ int board_mmc_init(void)
return
bcm2835_sdhci_init
(
BCM2835_SDHCI_BASE
,
msg_clk
->
get_clock_rate
.
body
.
resp
.
rate_hz
);
}
void
ft_board_setup
(
void
*
blob
,
bd_t
*
bd
)
{
/*
* For now, we simply always add the simplefb DT node. Later, we
* should be more intelligent, and e.g. only do this if no enabled DT
* node exists for the "real" graphics driver.
*/
lcd_dt_simplefb_add_node
(
blob
);
}
common/lcd.c
浏览文件 @
47b8e527
...
...
@@ -57,6 +57,10 @@
#include <atmel_lcdc.h>
#endif
#if defined(CONFIG_LCD_DT_SIMPLEFB)
#include <libfdt.h>
#endif
/************************************************************************/
/* ** FONT DATA */
/************************************************************************/
...
...
@@ -1182,3 +1186,86 @@ int lcd_get_screen_columns(void)
{
return
CONSOLE_COLS
;
}
#if defined(CONFIG_LCD_DT_SIMPLEFB)
static
int
lcd_dt_simplefb_configure_node
(
void
*
blob
,
int
off
)
{
u32
stride
;
fdt32_t
cells
[
2
];
int
ret
;
const
char
format
[]
=
#if LCD_BPP == LCD_COLOR16
"r5g6b5"
;
#else
""
;
#endif
if
(
!
format
[
0
])
return
-
1
;
stride
=
panel_info
.
vl_col
*
2
;
cells
[
0
]
=
cpu_to_fdt32
(
gd
->
fb_base
);
cells
[
1
]
=
cpu_to_fdt32
(
stride
*
panel_info
.
vl_row
);
ret
=
fdt_setprop
(
blob
,
off
,
"reg"
,
cells
,
sizeof
(
cells
[
0
])
*
2
);
if
(
ret
<
0
)
return
-
1
;
cells
[
0
]
=
cpu_to_fdt32
(
panel_info
.
vl_col
);
ret
=
fdt_setprop
(
blob
,
off
,
"width"
,
cells
,
sizeof
(
cells
[
0
]));
if
(
ret
<
0
)
return
-
1
;
cells
[
0
]
=
cpu_to_fdt32
(
panel_info
.
vl_row
);
ret
=
fdt_setprop
(
blob
,
off
,
"height"
,
cells
,
sizeof
(
cells
[
0
]));
if
(
ret
<
0
)
return
-
1
;
cells
[
0
]
=
cpu_to_fdt32
(
stride
);
ret
=
fdt_setprop
(
blob
,
off
,
"stride"
,
cells
,
sizeof
(
cells
[
0
]));
if
(
ret
<
0
)
return
-
1
;
ret
=
fdt_setprop
(
blob
,
off
,
"format"
,
format
,
strlen
(
format
)
+
1
);
if
(
ret
<
0
)
return
-
1
;
ret
=
fdt_delprop
(
blob
,
off
,
"status"
);
if
(
ret
<
0
)
return
-
1
;
return
0
;
}
int
lcd_dt_simplefb_add_node
(
void
*
blob
)
{
const
char
compat
[]
=
"simple-framebuffer"
;
const
char
disabled
[]
=
"disabled"
;
int
off
,
ret
;
off
=
fdt_add_subnode
(
blob
,
0
,
"framebuffer"
);
if
(
off
<
0
)
return
-
1
;
ret
=
fdt_setprop
(
blob
,
off
,
"status"
,
disabled
,
sizeof
(
disabled
));
if
(
ret
<
0
)
return
-
1
;
ret
=
fdt_setprop
(
blob
,
off
,
"compatible"
,
compat
,
sizeof
(
compat
));
if
(
ret
<
0
)
return
-
1
;
return
lcd_dt_simplefb_configure_node
(
blob
,
off
);
}
int
lcd_dt_simplefb_enable_existing_node
(
void
*
blob
)
{
int
off
;
off
=
fdt_node_offset_by_compatible
(
blob
,
-
1
,
"simple-framebuffer"
);
if
(
off
<
0
)
return
-
1
;
return
lcd_dt_simplefb_configure_node
(
blob
,
off
);
}
#endif
doc/device-tree-bindings/video/simple-framebuffer.txt
0 → 100644
浏览文件 @
47b8e527
Simple Framebuffer
A simple frame-buffer describes a raw memory region that may be rendered to,
with the assumption that the display hardware has already been set up to scan
out from that buffer.
Required properties:
- compatible: "simple-framebuffer"
- reg: Should contain the location and size of the framebuffer memory.
- width: The width of the framebuffer in pixels.
- height: The height of the framebuffer in pixels.
- stride: The number of bytes in each line of the framebuffer.
- format: The format of the framebuffer surface. Valid values are:
- r5g6b5 (16-bit pixels, d[15:11]=r, d[10:5]=g, d[4:0]=b).
Example:
framebuffer {
compatible = "simple-framebuffer";
reg = <0x1d385000 (1600 * 1200 * 2)>;
width = <1600>;
height = <1200>;
stride = <(1600 * 2)>;
format = "r5g6b5";
};
drivers/video/cfb_console.c
浏览文件 @
47b8e527
...
...
@@ -572,8 +572,6 @@ static void video_drawchars(int xx, int yy, unsigned char *s, int count)
SWAP32
((
video_font_draw_table32
[
bits
&
15
][
3
]
&
eorx
)
^
bgx
);
}
if
(
cfb_do_flush_cache
)
flush_cache
((
ulong
)
dest0
,
32
);
dest0
+=
VIDEO_FONT_WIDTH
*
VIDEO_PIXEL_SIZE
;
s
++
;
}
...
...
@@ -642,8 +640,6 @@ static void video_invertchar(int xx, int yy)
for
(
x
=
firstx
;
x
<
lastx
;
x
++
)
{
u8
*
dest
=
(
u8
*
)(
video_fb_address
)
+
x
+
y
;
*
dest
=
~*
dest
;
if
(
cfb_do_flush_cache
)
flush_cache
((
ulong
)
dest
,
4
);
}
}
}
...
...
@@ -687,6 +683,8 @@ void console_cursor(int state)
}
cursor_state
=
state
;
}
if
(
cfb_do_flush_cache
)
flush_cache
(
VIDEO_FB_ADRS
,
VIDEO_SIZE
);
}
#endif
...
...
@@ -739,8 +737,6 @@ static void console_clear_line(int line, int begin, int end)
memsetl
(
offset
+
i
*
VIDEO_LINE_LEN
,
size
,
bgx
);
}
#endif
if
(
cfb_do_flush_cache
)
flush_cache
((
ulong
)
CONSOLE_ROW_FIRST
,
CONSOLE_SIZE
);
}
static
void
console_scrollup
(
void
)
...
...
@@ -1146,6 +1142,8 @@ void video_putc(const char c)
#else
parse_putc
(
c
);
#endif
if
(
cfb_do_flush_cache
)
flush_cache
(
VIDEO_FB_ADRS
,
VIDEO_SIZE
);
}
void
video_puts
(
const
char
*
s
)
...
...
@@ -1799,6 +1797,8 @@ int video_display_bitmap(ulong bmp_image, int x, int y)
}
#endif
if
(
cfb_do_flush_cache
)
flush_cache
(
VIDEO_FB_ADRS
,
VIDEO_SIZE
);
return
(
0
);
}
#endif
...
...
@@ -2209,6 +2209,9 @@ static int video_init(void)
console_col
=
0
;
console_row
=
0
;
if
(
cfb_do_flush_cache
)
flush_cache
(
VIDEO_FB_ADRS
,
VIDEO_SIZE
);
return
0
;
}
...
...
include/configs/rpi_b.h
浏览文件 @
47b8e527
...
...
@@ -61,6 +61,7 @@
#define CONFIG_BCM2835_GPIO
/* LCD */
#define CONFIG_LCD
#define CONFIG_LCD_DT_SIMPLEFB
#define LCD_BPP LCD_COLOR16
/*
* Prevent allocation of RAM for FB; the real FB address is queried
...
...
@@ -175,6 +176,7 @@
/* Device tree support for bootm/bootz */
#define CONFIG_OF_LIBFDT
#define CONFIG_OF_BOARD_SETUP
/* ATAGs support for bootm/bootz */
#define CONFIG_SETUP_MEMORY_TAGS
#define CONFIG_CMDLINE_TAG
...
...
include/lcd.h
浏览文件 @
47b8e527
...
...
@@ -324,6 +324,9 @@ void lcd_show_board_info(void);
/* Return the size of the LCD frame buffer, and the line length */
int
lcd_get_size
(
int
*
line_length
);
int
lcd_dt_simplefb_add_node
(
void
*
blob
);
int
lcd_dt_simplefb_enable_existing_node
(
void
*
blob
);
/************************************************************************/
/* ** BITMAP DISPLAY SUPPORT */
/************************************************************************/
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录