1.下载EVB-KSZ9477文件
$ git clone https://github.com/Microchip-Ethernet/EVB-KSZ9477.git
$ cd EVB-KSZ9477/KSZ
2. 导出KSZ_HOME变量到KSZ文件
$ export KSZ_HOME=home/EVB-KSZ9477/KSZ
3. 下载linux-at91到EVB-KSZ9477/KSZ/kernels/
$ cd $KSZ_HOME/kernels/
$ git clone https://github.com/linux4sam/linux-at91.git
$ cd $KSZ_HOME/kernels/linux-at91
4. 添加一个新的远程仓库并检出需要linux内核版本
$ git remote add linux4sam https://github.com/linux4sam/linux-at91.git
$ git remote update linux4sam
$ git checkout linux4sam-2021.04
5. 拷贝所有的驱动到Linux-at91内核
$ cp -r $KSZ_HOME/linux-drivers/ksz9897/linux-5.10/. $KSZ_HOME/kernels/linux-at91
$ cp -r $KSZ_HOME/linux-drivers/sama5d3/linux-5.10/. $KSZ_HOME/kernels/linux-at91
6. 应用补丁文件
$ patch -p3 < net/bridge/br_device.c.patch -d net/bridge
$ patch -p3 < drivers/ptp/ptp_clock.c.patch -d drivers/ptp
$ patch -p3 < drivers/pinctrl/pinctrl.patch -d drivers/pinctrl
7. 更改目录为Atmel_SOC_SAMA5D3/buildroot
$ cd $KSZ_HOME/Atmel_SOC_SAMA5D3/buildroot
8. 使用SD card的配置文件
$ make atmel_sama5d3_xplained_ung8087_mmc_defconfig
9. Edit the buildroot config file
$ make menuconfig
Toolchain --> Kernel Headers --> Linux 5.10.x kernel headers
Kernel --> Path to the local directory --> $(KSZ_HOME)/kernels/linux-at91
Kernel --> Configuration file path --> $(KSZ_HOME)/kernels/linux-at91/arch/configs/sama5_ksz_defconfig
Kernel --> Device Tree Source file names --> at91-sama5d3_xplained_ung8071 for EVB-KSZ9477
Kernel --> Device Tree Source file names -->at91-sama5d3_xplained_ung8087for SAMA5D3-EDS
10.编译生成SD镜像文件
$ make |