用户工具

站点工具


jaysnote:kernel_compile

差别

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

到此差别页面的链接

jaysnote:kernel_compile [2018/11/14 14:16]
jaylee
jaysnote:kernel_compile [2021/06/22 23:14]
行 1: 行 1:
-<markdown> 
-# GAC-350 Kernel Compile 
  
-## 命令 
- 
-* 单独编译Kernel 
- 
-    ```shell 
-    ./build.sh -p sun50iw1p1_debian -m kernel -k linux-3.10 
-    ``` 
- 
-* 清除 
- 
-    ``` 
-    ./build.sh -p sun50iw1p1_debian -m distclean -k linux-3.10 
-    ``` 
- 
-* menuconfig 
- 
-    ``` 
-    sudo make ARCH=arm64 CROSS_COMPILE=../out/sun50iw1p1/debian/common/buildroot/external-toolchain/bin/aarch64-linux-gnu- menuconfig 
-    ``` 
- 
-* 拷贝 
- 
-    ``` 
-    scp jay@10.28.3.204:/home/jay/a64/linux-3.10/drivers/net/usb/* ./ 
-    ``` 
- 
-* 完整测试命令 
- 
-    ```shell 
-    t/usb/*.ko ./    ~/asix# scp jay@10.28.3.204:/home/jay/a64/linux-3.10/drivers/ne  
-     
-    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 
-    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 
-    ``` 
- 
- 
-## 驱动 
- 
-### 摄像头(ov5640.ko vfl2.ko ) 
- 
-需要修改vfe.c 
- 
-```c 
-//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; 
-        *i = 0; 
-        return 0; 
-} 
-``` 
- 
-```c 
-//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 
- 
-![v4l2 编译选项](images/v4l2.png) 
- 
-### GPIO libc(built in) 
- 
-> Device Drivers > GPIO Support  
- 
-![GPIO 支持](images/gpio.png) 
- 
-### SMT32 I2C& 开机动画(stm_s103.ko) 
- 
->Device Drivers > Staging drivers > Support for MXJ private driver 
- 
-![梦想加私有驱动](images/mdp_driver.png) 
- 
-### USB Net(usbnet.ko asix.ko) 
- 
-> Device Drivers > Network device support > USB Network Adapters 
- 
-![](images/usb_net.png) 
- 
-同时直接干掉无线网卡支持。 
- 
-### 通过SID 生成mac地址。 
- 
-```c 
-//linux-3.10/drivers/net/usb/asix_devices.c 
-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** 
- 
-更新为源码自带i2c通用驱动,并且更新速率为`100k` 
- 
-> Device Drivers > I2C support 
- 
-![](images/i2c_change.png.) 
- 
- 
- 
-## fex 
- 
-*  http://linux-sunxi.org/Fex_Guide 
- 
-</markdown> 
jaysnote/kernel_compile.txt · 最后更改: 2021/06/22 23:14 (外部编辑)