用户工具

站点工具


jaysnote:kernel_compile

差别

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

到此差别页面的链接

后一修订版
前一修订版
后一修订版 两侧同时换到之后的修订记录
jaysnote:kernel_compile [2018/11/14 14:16]
jaylee 创建
jaysnote:kernel_compile [2019/12/11 21:37]
lijie
行 1: 行 1:
-# GAC-350 Kernel Compile+<markdown>
  
-## 命令+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 
-    ./build.sh -p sun50iw1p1_debian -m distclean -k linux-3.10+    $ tree -L 1 
 +    ├── brandy                     #boot0、uboot 
 +    ├── 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:0 /home/chen home/pi 用户目录为1000:1000;
  
-    ``` +    ```bash 
-    scp jay@10.28.3.204:/home/jay/a64/linux-3.10/drivers/net/usb/* ./+    sudo  chown -R 0:0 debian/ 
 +    sudo  chown -R 1000:1000 debian/home/
     ```     ```
  
-完整测试命令+ramdisk 通过软连接到cpio 目录
  
-    ```shell +  ```bash 
-    t/usb/*.ko ./    ~/asix# scp jay@10.28.3.204:/home/jay/a64/linux-3.10/drivers/ne  +  ln --../../cpio/release/rootfs.cpio.gz rootfs.cpio.gz 
-     +  ```
-    asix.ko  cdc_ether.ko  mcs7830.ko  qf9700.ko  rtl8150.ko  usbnet.ko +
-    root@350-c1-emmc ~/asix#     +
-    root@350-c1-emmc ~/asix# ls +
-    asix.ko  cdc_ether.ko  mcs7830.ko  qf9700.ko  rtl8150.ko  usbnet.ko +
-    root@350-c1-emmc ~/asix# lsmod +
-    root@350-c1-emmc ~/asix# rmmod asix +
-    root@350-c1-emmc ~/asix# rmmod usbnet +
-    root@350-c1-emmc ~/asix# lsmod +
-    root@350-c1-emmc ~/asix# dmesg -C +
-    root@350-c1-emmc ~/asix# insmod ./usbnet.ko  +
-    root@350-c1-emmc ~/asix# insmod ./asix.ko    +
-    root@350-c1-emmc ~/asix# dmesg -T +
-    [Thu Jun 14 15:26:27 2018] asix 1-1:1.0 eth0: register 'asix' at usb-sunxi-ehci-1, ASIX AX88772B USB 2.0 Ethernet, 02:00:00:00:00:00 +
-    [Thu Jun 14 15:26:27 2018] usbcore: registered new interface driver asix +
-    root@350-c1-emmc ~/asix#  +
-    ```+
  
-更改boot+编译过程
  
-    ```powershell +  暂时地,在root用户下完成操作。
-    scp jay@10.28.3.204:/home/jay/a64_jay/linux-3.10/output/boot.img ./ +
-    dd if=boot.img of=/dev/mmcblk0p6 bs=1M +
-    ```+
  
 +  ```bash
 +  #编译步骤
 +  1. 设置XY变量,配置屏幕类型
 +  
 +  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
 +  ```
  
-## 驱动+* 内核编译
  
-### 摄像头(ov5640.ko vfl2.ko )+    参考[内核编译] (/jaysnote/kernel_compile
  
-需要修改vfe.c+## download
  
-```c +### windows
-//linux-3.10/drivers/media/platform/sunxi-vfe/vfe.c +
-static int vidioc_g_input(struct file *file, void *priv, unsigned int *i)  { +
-        struct vfe_dev *dev = video_drvdata(file);+
  
-        //*i dev->input; +* 安装 [PhoenixSuit_V1.10.zip](https://doc.mxj360.com/lib/exe/fetch.php?media=projects:gac:gac-350:phoenixsuit_v1.10.zip) 软件;
-        *i = 0; +
-        return 0; +
-+
-```+
  
-```c +* 下载已经编译好镜像[当前最新镜像直接下载](http://mdp-embedded.oss-cn-beijing.aliyuncs.com/gac-350/GAC350_2019-02-18_16-44-2.1.8-online_bug_fix-2.img)
-//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+* 连接micro usb 接口,按住boot 按键(蜂鸣器位置,有丝印)启动系统(上电/或者reset),等待下载完成;
  
-![v4l2 编译选项](images/v4l2.png)+    ![镜像下载](images/img_program_win.png)
  
-### GPIO libc(built in)+### linux 
  
-> Device Drivers > GPIO Support +* 下载 livesuit 源码包;
  
-![GPIO 支持](images/gpio.png)+    ```bash 
 +    $git clone https://github.com/linux-sunxi/sunxi-livesuite.git  
 +    ```
  
-### SMT32 I2C& 开机动画(stm_s103.ko)+    > **提示**:详细说明参考根路径README 
  
->Device Drivers > Staging drivers > Support for MXJ private driver+* bianyi 安装awusb 驱动;
  
-![梦想加私有驱动](images/mdp_driver.png)+    ```bash 
 +    $sudo  apt-get install dkms 
 +    $make 
 +    $sudo  cp awusb.ko /lib/modules/`uname -r`/kernel/ 
 +    $ modprobe awusb 
 +    ```
  
-### USB Net(usbnet.ko asix.ko)+* 运行LiveSuit.sh 工具。
  
-> Device Drivers > Network device support > USB Network Adapters +    ```bash 
- +    $sudo ./LiveSuit.sh 
-![](images/usb_net.png) +    ```
- +
-同时直接干掉无线网卡支持。 +
- +
-### 通过SID 生成mac地址。 +
- +
-```c +
-//linux-3.10/drivers/net/usb/asix_devices.+
-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  +
- +
-![系统信息](images/sys_info.png) +
- +
-### 显示(built-in) +
- +
-> Device Drivers > Graphics support > Support for frame buffer devices > Video support for sunxi +
- +
-![](images/disp2.png) +
- +
- +
- +
- +
- +
- +
- +
-### STM32&I2C更新+
  
-**19:27 2018/7/31**+连接micro usb 接口,按住boot 按键(蜂鸣器位置,有丝印)启动系统(上电/或者reset),等待下载完成;
  
-更新为源码自带i2c通用驱动,并且更新速率为`100k`+    ![linux 下载](images/img_program_linux.png)
  
-> Device Drivers > I2C support+## troubleshooting
  
-![](images/i2c_change.png.)+* 编译错误`awk: line 2: function strtonum never defined`
  
 +  ```bash
 +  sudo apt-get install gawk
 +  ```
  
 +* 编译错误 `-bash: ./mkbootimg: No such file or directory`
  
-## fex+  ```bash 
 +  sudo apt-get install gcc-multilib g++-multilib 
 +  ```
  
-*  http://linux-sunxi.org/Fex_Guide+</markdown>
jaysnote/kernel_compile.txt · 最后更改: 2021/06/22 23:14 (外部编辑)