用户工具

站点工具


jaysnote:kernel_compile

差别

这里会显示出您选择的修订版和当前版本之间的差别。

到此差别页面的链接

两侧同时换到之前的修订记录 前一修订版
后一修订版
前一修订版
后一修订版 两侧同时换到之后的修订记录
jaysnote:kernel_compile [2018/11/15 20:25]
jaylee
jaysnote:kernel_compile [2019/12/11 21:37]
lijie
行 1: 行 1:
 <markdown> <markdown>
-# GAC-350 Kernel Compile 
  
-## 命令+xgac sdk usage
  
-* 单独编译Kernel+## compile
  
-    ```shell +* 下载解压 [sdk](/home/lijie/my_project/gac-350)
-    ./build.sh -p sun50iw1p1_debian -m kernel -k linux-3.10 +
-    ```+
  
-* 清除 +    ```bash 
- +    $ tree -L 1 
-    ``` +    ├── brandy                     #boot0、uboot 
-    ./build.sh -p sun50iw1p1_debian -m distclean -k linux-3.10+    ├── buildroot                  #编译相关工具 
 +    ├── build.sh                   #编译、打包脚本 
 +    ├── clean.sh                   #清除编译中间件 
 +    ├── debian                     #debian rootfs 
 +    ├── img_release.sh              
 +    ├── lib                        #allwinner sysconfig 配置脚本 
 +    ├── linux-3.10                 #内核 
 +    ├── out                        #编译输出目录 
 +    ├── readme.txt                 #简要的编译的说明 
 +    └── tools                      #编译依赖工具集
     ```     ```
  
-* menuconfig+    
  
-    ``` +* 解压缩 带上--numeirc-owner 保留数字用户/ 用户权限;
-    sudo make ARCH=arm64 CROSS_COMPILE=../out/sun50iw1p1/debian/common/buildroot/external-toolchain/bin/aarch64-linux-gnu- menuconfig +
-    ```+
  
-拷贝 +解压缩后请确定debian rootfs 用户id/组id,/为0:/home/chen home/pi 用户目录为1000:1000;
- +
-    ``` +
-    scp jay@10.28.3.204:/home/jay/a64/linux-3.10/drivers/net/usb/* ./ +
-    ``` +
- +
-* 更新kernel+
  
     ```bash     ```bash
-    #/bin/bash +    sudo  chown -R 0:0 debian
- +    sudo  chown -R 1000:1000 debian/home/
-    scp jay@10.28.3.204:/home/jay/a64_v4l2/linux-3.10/output/boot.img ./ +
- +
-    [ -f boot.img ] && { +
- +
-            sudo dd if=boot.img of=/dev/mmcblk0p6 bs=1M +
-            sync +
-            echo "update kernel succeed"  +
-            exit 0  +
-    } +
- +
-    echo "update kernel failed" +
-    exit 1+
     ```     ```
  
 +* ramdisk 通过软连接到cpio 目录
  
-## 驱动+  ```bash 
 +  ln -s -f ../../cpio/release/rootfs.cpio.gz rootfs.cpio.gz 
 +  ```
  
-### 摄像头(ov5640.ko vfl2.ko )+* 编译过程
  
-需要修改vfe.c+  暂时地,在root用户下完成操作。
  
-```c +  ```bash 
-//linux-3.10/drivers/media/platform/sunxi-vfe/vfe.c +  #编译步骤 
-static int vidioc_g_input(struct file *file, void *priv, unsigned int *i)  { +  1. 设置XY变量,配置屏幕类型 
-        struct vfe_dev *dev = video_drvdata(file);+   
 +  800X480分辨率屏幕配置 
 +  $ export XY=800x480 
 +   
 +  2. 源码编译 
 +  $ ./build.sh 
 +   
 +  3. 源码打包 
 +  $ ./build.sh pack 
 +   
 +  #可选操作 
 +  4.设置文件系统版本号 
 +  ./debian/home/chen/update_buildtime.sh debian -w 
 +   
 +  5.按照日志版本号重命名镜像 do 表示支持操作,后面表示文件标签 
 +  ./img_release.sh do -cv2_run_2.0.7 
 +  ```
  
-        //*i = dev->input; +内核编译
-        *i = 0; +
-        return 0; +
-+
-```+
  
-```c +    参考[内核编译] (/jaysnote/kernel_compile
-//linux-3.10/drivers/media/platform/sunxi-vfe/vfe.c +
-static int vidioc_enum_input(struct file *file, void *priv, struct v4l2_input *inp) { +
-         struct vfe_dev *dev = video_drvdata(file); +
-         if (inp->index > dev->dev_qty-1) { +
-                 vfe_err("input index(%d) > dev->dev_qty(%d)-1 invalid!\n", inp->index, dev->dev_qty); +
-                 return -EINVAL; +
-         } +
-         vidioc_s_input(file,priv,inp->index); +
-         if (0 == dev->device_valid_flag[inp->index]) { +
-                 vfe_err("input index(%d) > dev->dev_qty(%d)-1 invalid!, device_valid_flag[%d] = %d\n", +
-                         inp->index, dev->dev_qty,inp->index, dev->device_valid_flag[inp->index])+
-                 return -EINVAL; +
-         } +
-         inp->type = V4L2_INPUT_TYPE_CAMERA; +
-         return 0; +
- } +
-```+
  
-> Device Drivers > Multimedia support > V4L platform devices+## download
  
-![v4l2 编译选项](http://www.leconiot.com/md_res/jaysnote/kernel_compile/images/v4l2.png)+### windows
  
-### GPIO libc(built in)+* 安装 [PhoenixSuit_V1.10.zip](https://doc.mxj360.com/lib/exe/fetch.php?media=projects:gac:gac-350:phoenixsuit_v1.10.zip) 软件;
  
-> Device Drivers > GPIO Support +* 下载已经编译好镜像[当前最新镜像直接下载](http://mdp-embedded.oss-cn-beijing.aliyuncs.com/gac-350/GAC350_2019-02-18_16-44-2.1.8-online_bug_fix-2.img);
  
-![GPIO 支持](http://www.leconiot.com/md_res/jaysnote/kernel_compile/images/gpio.png)+* 连接micro usb 接口,按住boot 按键(蜂鸣器位置,有丝印)启动系统(上电/或者reset),等待下载完成;
  
-### SMT32 I2C& 开机动画(stm_s103.ko)+    ![镜像下载](images/img_program_win.png)
  
->Device Drivers > Staging drivers > Support for MXJ private driver+### linux 
  
-![梦想加私有驱动](http://www.leconiot.com/md_res/jaysnote/kernel_compile/images/mdp_driver.png)+* 下载 livesuit 源码包;
  
-### USB Net(usbnet.ko asix.ko)+    ```bash 
 +    $git clone https://github.com/linux-sunxi/sunxi-livesuite.git  
 +    ```
  
-Device Drivers > Network device support > USB Network Adapters+    **提示**:详细说明参考根路径README 
  
-![](http://www.leconiot.com/md_res/jaysnote/kernel_compile/images/usb_net.png)+* bianyi 安装awusb 驱动;
  
-同时直接干掉无线网卡支持。+    ```bash 
 +    $sudo  apt-get install dkms 
 +    $make 
 +    $sudo  cp awusb.ko /lib/modules/`uname -r`/kernel/ 
 +    $ modprobe awusb 
 +    ```
  
-### 通过SID 生成mac地址+* 运行LiveSuit.sh 工具
  
-```c +    ```bash 
-//linux-3.10/drivers/net/usb/asix_devices.+    $sudo ./LiveSuit.sh 
-extern int sunxi_get_soc_chipid(u8 *chipid); +    ```
-sunxi_get_soc_chipid(chipid); +
-        buf[0] = 0x02; /* Non OUI / registered MAC address */ +
-        buf[1] = chipid[0]; +
-        buf[2] = chipid[12]; +
-        buf[3] = chipid[13]; +
-        buf[4] = chipid[14]; +
-        buf[5] = chipid[15]; +
-        netdev_dbg(dev->net,"MDP MAC from SID: 02:%02x:%02x:%02x:%02x:%02x", +
-                buf[1], buf[2], buf[3], +
-                buf[4], buf[5]); +
- +
-        asix_set_netdev_dev_addr(dev, buf); +
-``` +
- +
-```c +
-//inux-3.10/drivers/char/sunxi_sys_info/chipid-sunxi.c         +
-pr_info("%s,%d: sun50i_sid_base  :%08x \n", __func__, __LINE__,(unsigned int)sun50i_sid_base ); +
-        //sunxi_soc_chipid[1] = readl(sun50i_sid_base + 0x200 + 0x4); +
-        //sunxi_soc_chipid[2] = readl(sun50i_sid_base + 0x200 + 0x8); +
-        //sunxi_soc_chipid[3] = readl(sun50i_sid_base + 0x200 + 0xc); +
-        pr_info("%s,%d: sunxi_soc_chipid  :0x%04x-%04x-%04x-%04x \n", __func__, __LINE__,sunxi_soc_chipid[0],sunxi_soc_chipid[1],sunxi_soc_chipid[2],sunxi_soc_chipid[3]); +
-        sunxi_soc_chipid[0] = readl(sun50i_sid_base ); +
-        sunxi_soc_chipid[1] = readl(sun50i_sid_base + 0x4); +
-        sunxi_soc_chipid[2] = readl(sun50i_sid_base + 0x8); +
-        sunxi_soc_chipid[3] = readl(sun50i_sid_base + 0xc); +
-        pr_info("%s,%d: sunxi_soc_chipid  :0x%04x-%04x-%04x-%04x \n", __func__, __LINE__,sunxi_soc_chipid[0],sunxi_soc_chipid[1],sunxi_soc_chipid[2],sunxi_soc_chipid[3]); +
-``` +
- +
-并且需要使能`system info driver`。 +
- +
-> Device Drivers > Character devices  +
- +
-![系统信息](http://www.leconiot.com/md_res/jaysnote/kernel_compile/images/sys_info.png) +
- +
-### 显示(built-in) +
- +
-> Device Drivers > Graphics support > Support for frame buffer devices > Video support for sunxi +
- +
-![](http://www.leconiot.com/md_res/jaysnote/kernel_compile/images/disp2.png) +
- +
- +
- +
- +
- +
- +
- +
-### STM32&I2C更新 +
- +
-**19:27 2018/7/31**+
  
-更新为源码自带i2c通用驱动,并且更新速率为`100k`+* 连接micro usb 接口,按住boot 按键(蜂鸣器位置,有丝印)启系统(上电/或者reset)等待下载完成;
  
-> Device Drivers > I2C support+    ![linux 下载](images/img_program_linux.png)
  
-![](http://www.leconiot.com/md_res/jaysnote/kernel_compile/images/i2c_change.png)+## troubleshooting
  
 +* 编译错误`awk: line 2: function strtonum never defined`
  
 +  ```bash
 +  sudo apt-get install gawk
 +  ```
  
-## fex+* 编译错误 `-bash: ./mkbootimg: No such file or directory`
  
- http://linux-sunxi.org/Fex_Guide+  ```bash 
 +  sudo apt-get install gcc-multilib g++-multilib 
 +  ```
  
 </markdown> </markdown>
jaysnote/kernel_compile.txt · 最后更改: 2021/06/22 23:14 (外部编辑)