案子需要,搞起f1c100s来,这货稳定性如何还没底,开始尝试一把吧
翻出以前做的板子,折腾了一下,点起屏来了,查看色数是32bit,想弄成RGB565,不知怎么下手
# cat /sys/class/graphics/fb0/bits_per_pixel
32
4.3寸屏是定的800x480的,比较细腻,放在120的工控盒子里
核心板上放了颗AGM1280,有空了折腾一下,买了熊猫老司机的agm1280板,有空了上上手
最近编辑记录 zhenfanhei (2019-05-07 12:39:40)
离线
@晕哥, 这个去年做的,一直没动
dts:
panel: panel {
compatible = "lg,lb070wv8", "simple-panel";
drivers/gpu/drm/panel/panel-simple.c
static const struct panel_desc lg_lb070wv8 = {
.modes = &lg_lb070wv8_mode,
.num_modes = 1,
.bpc = 6,
.size = {
.width = 151,
.height = 91,
},
.bus_format = MEDIA_BUS_FMT_RGB565_1X16,
};
这么改的,还是32bit,有点浪费内存带宽哪,晕哥,还要改哪里呢
离线
离线
嗯,改成16bit之后是BGR的,
将framebuffer改成16bit
drivers/gpu/drm/sun4i/sun4i_framebuffer.c
sun4i_framebuffer_init->drm_fbdev_cma_init(drm, 16, drm->mode_config.num_connector);
发现uboot的io无法获得申请和控制
uboot中无法分配gpio,修改drivers/gpio/sunxi_gpio.c
static const struct udevice_id sunxi_gpio_ids[] = {
....
ID("allwinner,suniv-pinctrl", a_all),
uboot上电清除字符显示
uboot LCD不打印std信息
#ifdef CONFIG_VIDEO
#define CONSOLE_STDOUT_SETTINGS \
"stdout=serial\0" \
"stderr=serial\0"
uboot LCD不显示版本信息, defconfig文件添加 include文件添加 ,都无效
CONFIG_HIDE_LOGO_VERSION
最终 drivers/video/cfb_console.c 中修改
//#ifndef CONFIG_HIDE_LOGO_VERSION
#if 0
要是uboot启动后能显示gif就爽了
最近编辑记录 zhenfanhei (2019-05-08 08:58:54)
离线
f1c100s的Framebuffer真是BGR的,在uboot里面显示bmp图片也是个反的,怎么办呢,
离线
可以在驱动里面反过来吗?
离线
https://github.com/torvalds/linux/blob/master/drivers/gpu/drm/vc4/vc4_plane.c
static const struct hvs_format {
u32 drm; /* DRM_FORMAT_* */
u32 hvs; /* HVS_FORMAT_* */
u32 pixel_order;
} hvs_formats[] = {
{
.drm = DRM_FORMAT_XRGB8888, .hvs = HVS_PIXEL_FORMAT_RGBA8888,
.pixel_order = HVS_PIXEL_ORDER_ABGR,
},
{
.drm = DRM_FORMAT_ARGB8888, .hvs = HVS_PIXEL_FORMAT_RGBA8888,
.pixel_order = HVS_PIXEL_ORDER_ABGR,
},
{
.drm = DRM_FORMAT_ABGR8888, .hvs = HVS_PIXEL_FORMAT_RGBA8888,
.pixel_order = HVS_PIXEL_ORDER_ARGB,
},
{
.drm = DRM_FORMAT_XBGR8888, .hvs = HVS_PIXEL_FORMAT_RGBA8888,
.pixel_order = HVS_PIXEL_ORDER_ARGB,
},
{
.drm = DRM_FORMAT_RGB565, .hvs = HVS_PIXEL_FORMAT_RGB565,
.pixel_order = HVS_PIXEL_ORDER_XRGB,
},
{
.drm = DRM_FORMAT_BGR565, .hvs = HVS_PIXEL_FORMAT_RGB565,
.pixel_order = HVS_PIXEL_ORDER_XBGR,
},
{
.drm = DRM_FORMAT_ARGB1555, .hvs = HVS_PIXEL_FORMAT_RGBA5551,
.pixel_order = HVS_PIXEL_ORDER_ABGR,
},
{
.drm = DRM_FORMAT_XRGB1555, .hvs = HVS_PIXEL_FORMAT_RGBA5551,
.pixel_order = HVS_PIXEL_ORDER_ABGR,
},
{
.drm = DRM_FORMAT_RGB888, .hvs = HVS_PIXEL_FORMAT_RGB888,
.pixel_order = HVS_PIXEL_ORDER_XRGB,
},
{
.drm = DRM_FORMAT_BGR888, .hvs = HVS_PIXEL_FORMAT_RGB888,
.pixel_order = HVS_PIXEL_ORDER_XBGR,
},
{
.drm = DRM_FORMAT_YUV422,
.hvs = HVS_PIXEL_FORMAT_YCBCR_YUV422_3PLANE,
.pixel_order = HVS_PIXEL_ORDER_XYCBCR,
},
{
.drm = DRM_FORMAT_YVU422,
.hvs = HVS_PIXEL_FORMAT_YCBCR_YUV422_3PLANE,
.pixel_order = HVS_PIXEL_ORDER_XYCRCB,
},
{
.drm = DRM_FORMAT_YUV420,
.hvs = HVS_PIXEL_FORMAT_YCBCR_YUV420_3PLANE,
.pixel_order = HVS_PIXEL_ORDER_XYCBCR,
},
{
.drm = DRM_FORMAT_YVU420,
.hvs = HVS_PIXEL_FORMAT_YCBCR_YUV420_3PLANE,
.pixel_order = HVS_PIXEL_ORDER_XYCRCB,
},
{
.drm = DRM_FORMAT_NV12,
.hvs = HVS_PIXEL_FORMAT_YCBCR_YUV420_2PLANE,
.pixel_order = HVS_PIXEL_ORDER_XYCBCR,
},
{
.drm = DRM_FORMAT_NV21,
.hvs = HVS_PIXEL_FORMAT_YCBCR_YUV420_2PLANE,
.pixel_order = HVS_PIXEL_ORDER_XYCRCB,
},
{
.drm = DRM_FORMAT_NV16,
.hvs = HVS_PIXEL_FORMAT_YCBCR_YUV422_2PLANE,
.pixel_order = HVS_PIXEL_ORDER_XYCBCR,
},
{
.drm = DRM_FORMAT_NV61,
.hvs = HVS_PIXEL_FORMAT_YCBCR_YUV422_2PLANE,
.pixel_order = HVS_PIXEL_ORDER_XYCRCB,
},
};
ret = drm_universal_plane_init(dev, plane, 0,
&vc4_plane_funcs,
formats, ARRAY_SIZE(formats),
modifiers, type, NULL);
改这里或许有用 ?
在线
关注学习
离线
现在已经是16bit了, RGB565了,发现uboot里面也是用的ARGB8888的,浪费啊,==都试下改成16bit
离线
现在已经是16bit了, RGB565了,发现uboot里面也是用的ARGB8888的,浪费啊,==都试下改成16bit
请教是怎么搞定的?
离线
哦,有点忙,uboot搞成16位还没搞,得搞寄存器,
顺便问下,全志的pcie要怎么配,H6弄了个pcie转sata板回来,想接上去看看
离线
mark下。
离线
离线
今天和mokemars聊天到他有个f1c200s的屏,别人给的,说是f1c100s的源码完全不用改,于是乎,换起片子来,一片不行,存储初始化不通过,再三确认,再换一片,于是乎,启动了,64M,供应商说,掌机出货的客户超频到800M跑的,下次仔细看下论坛也超一个,
换片后的老板
uboot启动显示64M,
linux中内存大小
最近编辑记录 zhenfanhei (2019-05-16 21:15:39)
离线
u-boot不用改, 自动识别 64M DRAM ?
离线
高大上,AG1280
离线
@smartcar 是的,不用改,超到900M,启动时间加快了0.1s而已, uboot 中 menuconfig 从408M 配成900M就行,温度没怎么变化,内核不用动
@阿黄, RSB好像看到能到40MHz???, 所以cpld接的RSB上,还不会用,需要时再调吧
clock_sun6i.c中
/*
* sun6i: PLL1 rate = ((24000000 * n * k) >> 0) / m (p is ignored)
* sun8i: PLL1 rate = ((24000000 * n * k) >> p) / m
*/
n = clk / (24000000 * k / m); // 24*3/2=36MHz *25=900MHz
writel(CCM_PLL1_CTRL_EN | CCM_PLL1_CTRL_P(p) |
CCM_PLL1_CTRL_N(n) | CCM_PLL1_CTRL_K(k) | CCM_PLL1_CTRL_M(m), &ccm->pll1_cfg);
printf("cpu-pll1: n:%d k:%d m%d --> %dMHz\n", n, k, m, 24*k*n/m);
uboot输出
U-Boot SPL 2018.01 (May 16 2019 - 22:30:17)
DRAM: 64 MiB
cpu-pll1: n:25 k:3 m2 --> 900MHz
内核ccu-suniv.c还碰到个问题,请教下各位,这么写是ok的,
val = readl(reg + SUNIV_PLL_CPU_REG);
n = val>>8;
n &= 0x1f;
n += 1;
k = val>>4;
k &= 0x03;
k += 1;
m = val;
m &= 0x1f;
m += 1;
freq = (24*n*k/m);
//printk("CPU_PLL: 0x%x n:%d k:%d m:%d p:%d --> %dMHz\n", val, n, k, m, p, freq);
printk("CPU_PLL: 0x%x %dMHz\n", val, freq); //zengfh
这么写是不OK的,kernel启动会算出来为0,何解? 难道语法还错了?
n = (val>>8) & 0x1f + 1;
k = (val>>4) & 0x03 + 1;
m = val & 0x03 + 1;
p = (val>>16) & 0x03;
freq = (24*n*k/m);
内核打印是
CPU_PLL: 0x90001821 900MHz
最近编辑记录 zhenfanhei (2019-05-16 23:20:23)
离线
dram_suniv.c中改
struct dram_para suniv_dram_para = {
.size = 32,
.clk = 240, //156-->312 240->480
启动时间变短了0.06s, 静态电流好像增大了30mA @5V
[ 0.892477] devtmpfs: mounted
[ 0.898275] Freeing unused kernel memory: 1024K
[ 0.993475] EXT4-fs (mmcblk0p2): Filesystem with huge files cannot be mounted RDWR without CONFIG_LBDAF
[ 1.003388] EXT4-fs (mmcblk0p2): re-mounted. Opts: data=ordered
Starting syslogd: OK
Starting klogd: OK
read-only file system detected...done
Welcome to Buildroot
buildroot login:
最近编辑记录 zhenfanhei (2019-05-16 23:35:24)
离线
@晕哥 ,我对着f1c600s来看的,m是bit1, bit0
是我写错了,是&0x03,现在改过来是ok的,前面那咱写法还是算不出来,所有都为0,有点奇怪
[ 0.000000] [<c010dd04>] (unwind_backtrace) from [<c010b494>] (show_stack+0x10/0x14)
[ 0.000000] [<c010b494>] (show_stack) from [<c044c9cc>] (Ldiv0+0x8/0x1c)
[ 0.000000] [<c044c9cc>] (Ldiv0) from [<c0612458>] (suniv_ccu_setup+0xa4/0xe8)
[ 0.000000] [<c0612458>] (suniv_ccu_setup) from [<c060fb7c>] (of_clk_init+0x164/0x1f8)
[ 0.000000] [<c060fb7c>] (of_clk_init) from [<c06023a4>] (time_init+0x20/0x2c)
[ 0.000000] [<c06023a4>] (time_init) from [<c0600b64>] (start_kernel+0x214/0x330)
[ 0.000000] [<c0600b64>] (start_kernel) from [<00000000>] ( (null))
[ 0.000000] CPU_PLL: 0x90001821 n:0 k:0 m:0 p:0 --> 0MHz
最近编辑记录 zhenfanhei (2019-05-16 23:40:45)
离线
@晕哥
和编译器有关吗? gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabi 的,
s3前面uboot也有点怪,gpio模拟spi初始化液晶寄存器,while(delay--),不起效果
离线
在线
离线
f1c200s贴出来了,有案子上用,内存大的确爽一些,RSB还不行,后面还是接上AGM AG1280来做点应用电路,弄了个核心板方式,兼容S3的,可放底板上,5" IPS屏和电容触摸能用了
本来要在嘉立创做黑色的,结果他们不能做4边的邮票孔,只要好华强做了绿色的
离线
跑起来awtk,新风系统那个demo,都是800x480的界面,所以用4.3寸800x480的屏来带,只是电容触摸分辨率不对,等2天液晶转接板好了用7寸屏+电容屏跑一下
最近编辑记录 zhenfanhei (2019-06-10 23:30:04)
离线
离线
离线
关注关注...
离线
awtk 不错不错哦!
离线
离线
源码没有。
放个.bin文件也可以啊。
离线
awtk支持旋转,在5寸IPS上没横着显,看来要摸索下
https://whycan.cn/files/members/428/f1c200s_awtk_5_0_480x854.jpg
那个屏的盒子哪找的!有联接么
离线
我记得应该是楼主自己设计的。
离线
这是非常好的LCD TFT。请提供源代码
离线
现在已经是16bit了, RGB565了,发现uboot里面也是用的ARGB8888的,浪费啊,==都试下改成16bit
请教ubooot如何修改RGB565
离线
zhenfanhei 说:现在已经是16bit了, RGB565了,发现uboot里面也是用的ARGB8888的,浪费啊,==都试下改成16bit
请教ubooot如何修改RGB565
请教下如何修改ARGB565
离线
3年了,楼主不知还玩不玩了,哈哈。怎么把BGR改成RGB呢?
离线
3年了,楼主不知还玩不玩了,哈哈。怎么把BGR改成RGB呢?
坛里有个帖子,说是修改TCON0的控制寄存器的值,第23位是对R-B顺序进行交换的。在手册的第5.1.5.15章节:
5.1.5.15. TCON0 Control Register
Offset: 0x040 Register Name: TCON0_CTRL_REG
BIT-23 R/W SWAP: TCON0 data manipulation
0: default
1: swap RED and BLUE data at FIFO1
--第23bit = 1,就可以交换R-G
离线