这里会显示出您选择的修订版和当前版本之间的差别。
两侧同时换到之前的修订记录 前一修订版 后一修订版 | 前一修订版 后一修订版 两侧同时换到之后的修订记录 | ||
jaysnote:kernel_compile [2018/11/15 20:25] jaylee |
jaysnote:kernel_compile [2019/12/11 21:37] lijie |
||
---|---|---|---|
行 1: | 行 1: | ||
< | < | ||
- | # GAC-350 Kernel Compile | ||
- | ## 命令 | + | # xgac sdk usage |
- | * 单独编译Kernel | + | ## compile |
- | ```shell | + | * 下载解压 [sdk](/home/ |
- | ./build.sh -p sun50iw1p1_debian -m kernel -k linux-3.10 | + | |
- | ``` | + | |
- | * 清除 | + | |
- | + | | |
- | | + | ├── brandy |
- | | + | ├── buildroot |
+ | ├── | ||
+ | ├── clean.sh | ||
+ | ├── debian | ||
+ | ├── img_release.sh | ||
+ | ├── lib #allwinner sysconfig 配置脚本 | ||
+ | ├── | ||
+ | ├── out # | ||
+ | ├── readme.txt | ||
+ | └── tools # | ||
``` | ``` | ||
- | * menuconfig | + | |
- | ``` | + | * 解压缩 带上--numeirc-owner 保留数字用户/ |
- | sudo make ARCH=arm64 CROSS_COMPILE=../ | + | |
- | ``` | + | |
- | * 拷贝 | + | * 解压缩后请确定debian rootfs 用户id/ |
- | + | ||
- | ``` | + | |
- | scp jay@10.28.3.204:/home/jay/a64/ | + | |
- | ``` | + | |
- | + | ||
- | * 更新kernel | + | |
```bash | ```bash | ||
- | | + | |
- | + | | |
- | | + | |
- | + | ||
- | [ -f boot.img ] && { | + | |
- | + | ||
- | sudo dd if=boot.img of=/ | + | |
- | sync | + | |
- | echo " | + | |
- | exit 0 | + | |
- | } | + | |
- | + | ||
- | echo " | + | |
- | exit 1 | + | |
``` | ``` | ||
+ | * ramdisk 通过软连接到cpio 目录 | ||
- | ## 驱动 | + | ```bash |
+ | ln -s -f ../ | ||
+ | ``` | ||
- | ### 摄像头(ov5640.ko vfl2.ko ) | + | * 编译过程 |
- | 需要修改vfe.c | + | 暂时地,在root用户下完成操作。 |
- | ```c | + | |
- | //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变量,配置屏幕类型 |
- | | + | |
+ | 800X480分辨率屏幕配置 | ||
+ | $ export XY=800x480 | ||
+ | |||
+ | 2. 源码编译 | ||
+ | $ ./build.sh | ||
+ | |||
+ | | ||
+ | $ ./build.sh pack | ||
+ | |||
+ | # | ||
+ | 4.设置文件系统版本号 | ||
+ | ./debian/home/chen/update_buildtime.sh debian -w | ||
+ | |||
+ | | ||
+ | ./ | ||
+ | ``` | ||
- | //*i = dev-> | + | * 内核编译 |
- | *i = 0; | + | |
- | return 0; | + | |
- | } | + | |
- | ``` | + | |
- | ```c | + | 参考[内核编译] (/ |
- | // | + | |
- | static int vidioc_enum_input(struct file *file, void *priv, struct v4l2_input *inp) { | + | |
- | | + | |
- | if (inp-> | + | |
- | | + | |
- | | + | |
- | } | + | |
- | | + | |
- | if (0 == dev-> | + | |
- | | + | |
- | | + | |
- | | + | |
- | } | + | |
- | | + | |
- | | + | |
- | } | + | |
- | ``` | + | |
- | > Device Drivers > Multimedia support > V4L platform devices | + | ## download |
- | ![v4l2 编译选项](http:// | + | ### windows |
- | ### GPIO libc(built in) | + | * 安装 [PhoenixSuit_V1.10.zip](https:// |
- | > Device Drivers > GPIO Support | + | * 下载已经编译好镜像[当前最新镜像直接下载](http:// |
- | ![GPIO 支持](http: | + | * 连接micro usb 接口,按住boot 按键(蜂鸣器位置,有丝印)启动系统(上电/或者reset),等待下载完成; |
- | ### SMT32 I2C& 开机动画(stm_s103.ko) | + | ![镜像下载](images/ |
- | >Device Drivers > Staging drivers > Support for MXJ private driver | + | ### linux |
- | ![梦想加私有驱动](http:// | + | * 下载 livesuit 源码包; |
- | ### USB Net(usbnet.ko asix.ko) | + | ```bash |
+ | $git clone https:// | ||
+ | ``` | ||
- | > Device Drivers > Network device support > USB Network Adapters | + | |
- | ![](http:// | + | * bianyi 安装awusb 驱动; |
- | 同时直接干掉无线网卡支持。 | + | ```bash |
+ | $sudo apt-get install dkms | ||
+ | $make | ||
+ | $sudo cp awusb.ko / | ||
+ | $ modprobe awusb | ||
+ | ``` | ||
- | ### 通过SID 生成mac地址。 | + | * 运行LiveSuit.sh 工具。 |
- | ```c | + | |
- | //linux-3.10/drivers/ | + | |
- | 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-> | + | |
- | buf[1], buf[2], buf[3], | + | |
- | buf[4], buf[5]); | + | |
- | + | ||
- | asix_set_netdev_dev_addr(dev, | + | |
- | ``` | + | |
- | + | ||
- | ```c | + | |
- | // | + | |
- | pr_info(" | + | |
- | // | + | |
- | // | + | |
- | // | + | |
- | pr_info(" | + | |
- | 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(" | + | |
- | ``` | + | |
- | + | ||
- | 并且需要使能`system info driver`。 | + | |
- | + | ||
- | > Device Drivers > Character devices | + | |
- | + | ||
- | ![系统信息](http:// | + | |
- | + | ||
- | ### 显示(built-in) | + | |
- | + | ||
- | > Device Drivers > Graphics support > Support for frame buffer devices > Video support for sunxi | + | |
- | + | ||
- | ![](http:// | + | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | ### STM32& | + | |
- | + | ||
- | **19:27 2018/7/31** | + | |
- | 更新为源码自带i2c通用驱动,并且更新速率为`100k` | + | * 连接micro usb 接口,按住boot 按键(蜂鸣器位置,有丝印)启动系统(上电/ |
- | > Device Drivers > I2C support | + | ![linux 下载](images/ |
- | ![](http:// | + | ## troubleshooting |
+ | * 编译错误`awk: | ||
+ | ```bash | ||
+ | sudo apt-get install gawk | ||
+ | ``` | ||
- | ## fex | + | * 编译错误 `-bash: ./ |
- | * http:// | + | ```bash |
+ | sudo apt-get install gcc-multilib g++-multilib | ||
+ | ``` | ||
</ | </ |