• 海思开机画面


    一、开机图像

    方法: 文件系统划分部分空间用来存放图片数据,通过修改内核启动参数进行设置显示图片

    1. 烧录固件

    出厂固件为:1M fastboot、4M kernel、26M rtoofs
    先分出1M用于存储图片数据,由于内存分配的单位必须是M为单位,所以需要根据图片大小向上取整在这里插入图片描述

    2. 设置环境变量

    # 原始
    setenv bootargs 'mem=128M console=ttyAMA0,115200 root=/dev/mtdblock2 rootfstype=jffs2 rw mtdparts=hi_sfc:1M(boot),4M(kernel),25M(rootfs)'
    
    setenv bootcmd 'sf probe 0;sf read 0x96000000 0x100000 0x400000;bootm 0x96000000'
    
    saveenv
    
    # logo可以显示,内核可以启动
    setenv bootargs 'mem=128M console=ttyAMA0,115200 root=/dev/mtdblock2 rootfstype=jffs2 rw mtdparts=hi_sfc:1M(boot),4M(kernel),25M(rootfs),1M(logo)'
    
    setenv bootcmd 'sf probe 0;sf read 0x82000000 0x1E00000 0x100000;setenv jpeg_addr 0x82000000;setenv jpeg_size 0x100000;setenv jpeg_emar_buf 0x82200000;setenv vobuf 0x90000000;decjpg 0;startvo 0 32 10;startvl 0 0x90000000 1920 0 0 1920 1080;sf read 0x96000000 0x100000 0x400000;bootm 0x96000000'
    
    saveenv
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13

    二、开机进度条

    1. 使用内核定时器实现显示进度条实现

    systimer.c

    /* linux/arch/arm/mach-hi3515_v100/systimer.c
    *
    * Copyright (c) 2006 Hisilicon Co., Ltd. 
    *
    * This program is free software; you can redistribute it and/or modify
    * it under the terms of the GNU General Public License as published by
    * the Free Software Foundation; either version 2 of the License, or
    * (at your option) any later version.
    *
    * This program is distributed in the hope that it will be useful,
    * but WITHOUT ANY WARRANTY; without even the implied warranty of
    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    * GNU General Public License for more details.
    *
    * You should have received a copy of the GNU General Public License
    * along with this program; if not, write to the Free Software
    * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
    *
    */
    //#include 
    #include 
    #include 
    //#include 
    #include 
    
    #include 
    #include 
    #include 
    //#include 
    #include 
    
    #include 
    #include 
    #include 
    #include 
    
    #include 
    //#include 
    //#include 
    #include 
    //#include 
    #include 
    
    //#include 
    //#include 
    //#include 
    //#include 
    //#include 
    
    #include 
    #include 
    #include 
    #include 
    
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    
    #include 
    #include 
    
    
    #include 
    #include 
    
    //#include 
    //#include 
    //
    #define BOOTTIME (24)
    #define PRO_WIDTH	960
    #define COORDINATE_SYSTEM
    //
    struct timer_list s_timer;
    void second_timer_handle(unsigned long);
    
    static int count=0;
    static void * pbase_logo=NULL;
    
    #undef COORDINATE_SYSTEM
    static int __init __system_timer_init(void)
    {
    	int i=0,j=0;
    	//映射绘图地址
    	pbase_logo=ioremap_nocache(0x90000000,1920*1080*2);
           
    #if 0
    	//绘制进度条边框
    	for(i=480;i<1440;i++){
    		*((unsigned short*)(pbase_logo)+1920*860+i)=0xe71c;
    		*((unsigned short*)(pbase_logo)+1920*861+i)=0xe71c;
    		*((unsigned short*)(pbase_logo)+1920*880+i)=0xe71c;
    		*((unsigned short*)(pbase_logo)+1920*881+i)=0xe71c;
    	}
    	
    	for(j=860;j<881;j++){
    		*((unsigned short*)(pbase_logo)+480+j*1920)=0xe71c;
    		*((unsigned short*)(pbase_logo)+481+j*1920)=0xe71c;
    		*((unsigned short*)(pbase_logo)+1439+j*1920)=0xe71c;
    		*((unsigned short*)(pbase_logo)+1440+j*1920)=0xe71c;
    	}
    #endif	
    	//开启内核定时器,划线	
           	setup_timer(&s_timer, second_timer_handle, 0);
    	s_timer.expires = jiffies + 20;
    	add_timer(&s_timer);
    	return 0;
    }
    
    static int draw_line(int process)
    {
    	int i,j;
    	int n = 0;	
    	for(i=2;i<process;i++)
    	{
    	   for(j=2;j<40;j++)
    		*((unsigned char*)(pbase_logo)+1920*(850+j)+480+i)=0xff;
    	}
    
    	return 	(int)pbase_logo;
    		
    }
    void second_timer_handle(unsigned long unused)
    {
    #if 1
    	if(++count <= BOOTTIME*1)
    	{
    		if(pbase_logo==NULL)
    		{
    			printk("------------------logo--------123--------------\n");
    		}
    		else
    		{
    			if(count==(BOOTTIME))
    			{
    				draw_line(count*PRO_WIDTH/(BOOTTIME));
    				mod_timer(&s_timer, jiffies + 500);
    				
    			}
    			else
    			{
    				draw_line(count*PRO_WIDTH/(BOOTTIME));
    				mod_timer(&s_timer, jiffies + 50);
    			}
    
    		}
    	}
    	else
    	{
    		del_timer(&s_timer);
    		iounmap(pbase_logo);
    	}
    #endif
    }
    //---------------
    module_init(__system_timer_init);
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50
    • 51
    • 52
    • 53
    • 54
    • 55
    • 56
    • 57
    • 58
    • 59
    • 60
    • 61
    • 62
    • 63
    • 64
    • 65
    • 66
    • 67
    • 68
    • 69
    • 70
    • 71
    • 72
    • 73
    • 74
    • 75
    • 76
    • 77
    • 78
    • 79
    • 80
    • 81
    • 82
    • 83
    • 84
    • 85
    • 86
    • 87
    • 88
    • 89
    • 90
    • 91
    • 92
    • 93
    • 94
    • 95
    • 96
    • 97
    • 98
    • 99
    • 100
    • 101
    • 102
    • 103
    • 104
    • 105
    • 106
    • 107
    • 108
    • 109
    • 110
    • 111
    • 112
    • 113
    • 114
    • 115
    • 116
    • 117
    • 118
    • 119
    • 120
    • 121
    • 122
    • 123
    • 124
    • 125
    • 126
    • 127
    • 128
    • 129
    • 130
    • 131
    • 132
    • 133
    • 134
    • 135
    • 136
    • 137
    • 138
    • 139
    • 140
    • 141
    • 142
    • 143
    • 144
    • 145
    • 146
    • 147
    • 148
    • 149
    • 150
    • 151
    • 152
    • 153
    • 154
    • 155
    • 156
    • 157
    • 158
    • 159
    • 160
    • 161
    • 162

    2. 直接编译进kernel

    1. 进入内核源码目录linux-4.9.y/arch/arm/mach-hibvt/ 下添加systimer.c
      在这里插入图片描述
    2. 修改Makefile, 添加obj-y += systimer.o
      在这里插入图片描述
  • 相关阅读:
    实验5、白盒测试:覆盖测试及测试用例设计
    Oracle19c安装图文教程
    PCDN技术如何适应不同用户的需求和偏好?
    My Sixty-seventh Page - 0-1背包问题理论 - By Nicolas
    前端八股文142-186
    ElementUI的表格设置勾选toggleRowSelection
    [附源码]计算机毕业设计JAVA火车票预订系统2022
    Python文件操作和管理指南:打开、读取、写入和管理文件
    揭秘”智能定投“
    RK3568-74HC595
  • 原文地址:https://blog.csdn.net/weixin_54178481/article/details/135442351