瑞芯微Rockchip开发者社区
直播中

陈静

7年用户 1303经验值
私信 关注
[问答]

如何移除uboot和kernel开机logo?

如何移除uboot和kernel开机logo?

回帖(1)

萧登水

2022-3-2 17:40:31
                    
Platform: Rockchip

OS: Android 6.0

Kernel: 3.10.92

diff --git a/arch/arm/boot/dts/rk3288-b.dts b/arch/arm/boot/dts/rk3288-b.dts

index ad3bc1a..f000e29 100644

--- a/arch/arm/boot/dts/rk3288-b.dts

+++ b/arch/arm/boot/dts/rk3288-b.dts

@@ -353,7 +353,7 @@

&fb {

rockchip,disp-mode = ;

-       rockchip,uboot-logo-on = <1>;

+       rockchip,uboot-logo-on = <0>;

};

在移除了uboot logo之后还是会显示kernel logo(kerne自带而并非rk显示logo机制),所有需要关闭.

diff --git a/arch/arm/configs/rockchip_b_defconfig b/arch/arm/configs/rockchip_b_defconfig

index 092dc3c..b699f96 100644

--- a/arch/arm/configs/rockchip_b_defconfig

+++ b/arch/arm/configs/rockchip_b_defconfig

@@ -439,7 +439,7 @@ CONFIG_RK1000_TVOUT_CVBS=y

CONFIG_RK3036_TV_ENCODER=y

CONFIG_ROCKCHIP_RGA=y

CONFIG_ROCKCHIP_RGA2=y

-CONFIG_LOGO=y

+#CONFIG_LOGO=y

CONFIG_SOUND=y

CONFIG_SND=y

# CONFIG_SND_SUPPORT_OLD_API is not set

uboot logo显示可参考:

http://blog.csdn.net/kris_fei/article/details/52584903

kernel logo是根据是否开启了uboot logo display来决定是否要显示的,在函数rk_fb_register()中,

并且kernel logo的图片大小要和uboot一直,否则就无法显示。

#if !defined(CONFIG_FRAMEBUFFER_CONSOLE)

if (dev_drv->prop == PRMRY) {

u16 xact, yact;

int format;

u32 dsp_addr;

struct fb_info *main_fbi = rk_fb->fb[0];

main_fbi->fbops->fb_open(main_fbi, 1);

main_fbi->var.pixclock = dev_drv->pixclock;

if (dev_drv->iommu_enabled) {

if (dev_drv->mmu_dev)

rockchip_iovmm_set_fault_handler(dev_drv->dev,

rk_fb_sysmmu_fault_handler);

}

rk_fb_alloc_buffer(main_fbi);/* only alloc memory for main fb */

dev_drv->uboot_logo = support_uboot_display(); //是否支持uboot logo display

if (dev_drv->uboot_logo &&

uboot_logo_offset && uboot_logo_base) {

int width, height, bits, xvir;

phys_addr_t start = uboot_logo_base + uboot_logo_offset;

unsigned int size = uboot_logo_size - uboot_logo_offset;

unsigned int nr_pages;

int ymirror = 0;

struct page **pages;

char *vaddr;

int i = 0;

if (dev_drv->ops->get_dspbuf_info)

dev_drv->ops->get_dspbuf_info(dev_drv, &xact,

&yact, &format,&dsp_addr, &ymirror);

nr_pages = size >> PAGE_SHIFT;

pages = kzalloc(sizeof(struct page) * nr_pages,

GFP_KERNEL);

while (i < nr_pages) {

pages = phys_to_page(start);

start += PAGE_SIZE;

i++;

}

vaddr = vmap(pages, nr_pages, VM_MAP,

pgprot_writecombine(PAGE_KERNEL));

if (!vaddr) {

pr_err("failed to vmap phy addr 0x%lxn",

(long)(uboot_logo_base +

uboot_logo_offset));

return -1;

}

//bmp图片解压

if (bmpdecoder(vaddr, main_fbi->screen_base, &width,

&height, &bits)) {

kfree(pages);

vunmap(vaddr);

return 0;

}

kfree(pages);

vunmap(vaddr);

if (dev_drv->uboot_logo &&

(width != xact || height != yact)) {

pr_err("can't support uboot kernel logo use different size [%dx%d] != [%dx%d]n",

xact, yact, width, height);

return 0;

}

xvir = ALIGN(width * bits, 1 << 5) >> 5;

ymirror = 0;

local_irq_save(flags);

if (dev_drv->ops->wait_frame_start)

dev_drv->ops->wait_frame_start(dev_drv, 0);

if (dev_drv->ops->post_dspbuf) {

dev_drv->ops->post_dspbuf(dev_drv,

main_fbi->fix.smem_start,

rk_fb_data_fmt(0, bits),

width, height, xvir,

ymirror);

}

if (dev_drv->iommu_enabled) {

rk_fb_poll_wait_frame_complete();

if (dev_drv->ops->mmu_en)

dev_drv->ops->mmu_en(dev_drv);

freed_index = 0;

}

local_irq_restore(flags);

return 0;

} else if (dev_drv->uboot_logo && uboot_logo_base) {

u32 start = uboot_logo_base;

int logo_len, i = 0;

int y_mirror = 0;

unsigned int nr_pages;

struct page **pages;

char *vaddr;

int align = 0, xvir;

dev_drv->ops->get_dspbuf_info(dev_drv, &xact,

&yact, &format,

&start,

&y_mirror);

logo_len = rk_fb_pixel_width(format) * xact * yact >> 3;

if (logo_len > uboot_logo_size ||

logo_len > main_fbi->fix.smem_len) {

pr_err("logo size > uboot reserve buffer sizen");

return -1;

}

if (y_mirror)

start -= logo_len;

align = start % PAGE_SIZE;

start -= align;

nr_pages = PAGE_ALIGN(logo_len + align) >> PAGE_SHIFT;

pages = kzalloc(sizeof(struct page) * nr_pages,

GFP_KERNEL);

while (i < nr_pages) {

pages = phys_to_page(start);

start += PAGE_SIZE;

i++;

}

vaddr = vmap(pages, nr_pages, VM_MAP,

pgprot_writecombine(PAGE_KERNEL));

if (!vaddr) {

pr_err("failed to vmap phy addr 0x%xn",

start);

return -1;

}

memcpy(main_fbi->screen_base, vaddr + align, logo_len);

kfree(pages);

vunmap(vaddr);

xvir = ALIGN(xact * rk_fb_pixel_width(format),

1 << 5) >> 5;

local_irq_save(flags);

if (dev_drv->ops->wait_frame_start)

dev_drv->ops->wait_frame_start(dev_drv, 0);

dev_drv->ops->post_dspbuf(dev_drv,

main_fbi->fix.smem_start +

(y_mirror ? logo_len : 0),

format,xact, yact,

xvir,

y_mirror);

if (dev_drv->iommu_enabled) {

rk_fb_poll_wait_frame_complete();

if (dev_drv->ops->mmu_en)

dev_drv->ops->mmu_en(dev_drv);

freed_index = 0;

}

local_irq_restore(flags);

return 0;

} else {

if (dev_drv->iommu_enabled) {

if (dev_drv->ops->mmu_en)

dev_drv->ops->mmu_en(dev_drv);

freed_index = 0;

}

}

#if defined(CONFIG_LOGO)

main_fbi->fbops->fb_set_par(main_fbi);

#if defined(CONFIG_LOGO_LINUX_BMP)

if (fb_prewine_bmp_logo(main_fbi, FB_ROTATE_UR)) {

fb_set_cmap(&main_fbi->cmap, main_fbi);

fb_show_bmp_logo(main_fbi, FB_ROTATE_UR);

}

#else

if (fb_prepare_logo(main_fbi, FB_ROTATE_UR)) {

fb_set_cmap(&main_fbi->cmap, main_fbi);

fb_show_logo(main_fbi, FB_ROTATE_UR);

}

#endif

main_fbi->fbops->fb_pan_display(&main_fbi->var, main_fbi);

#endif

} else {

struct fb_info *extend_fbi = rk_fb->fb[dev_drv->fb_index_base];

extend_fbi->var.pixclock = rk_fb->fb[0]->var.pixclock;

extend_fbi->fbops->fb_open(extend_fbi, 1);

if (dev_drv->iommu_enabled) {

if (dev_drv->mmu_dev)

rockchip_iovmm_set_fault_handler(dev_drv->dev,

rk_fb_sysmmu_fault_handler);

}

rk_fb_alloc_buffer(extend_fbi);

}

#endif
举报

更多回帖

发帖
×
20
完善资料,
赚取积分