SDK Directory Structure
After extracting the SDK release package, the directory structure is as follows:
GK7206/
├── build # Core build system
│ ├── base.mk # Base Make rules; defines common variables such as SDK_KO_DIR and the compiler
│ ├── root.mk # Top-level Make rules; symlinked as the Makefile at the SDK root
│ ├── kernel.mk # Linux kernel build rules
│ ├── bootloader.mk # U-Boot build rules
│ ├── rootfs_image.mk # rootfs image packaging rules (JFFS2/YAFFS2/EXT4)
│ ├── sdk_ko_rules.mk # .ko driver module build output rules
│ ├── sdk_lib_rules.mk # SDK shared library build output rules
│ ├── env.sh # Build environment variable script
│ └── load # Common load function for the build process
│
├── run.sh # One-click build entry script (wraps make all)
│ # Usage: ./run.sh [chip_type] [options]
│
├── cfg.mk # Currently active SDK configuration file
│ # Defines chip model, toolchain, kernel version, flash type, etc.
│ # Generated by menuconfig, similar to Linux's .config
│
├── configs # Board/chip configuration directory
│ ├── xm7206v11a/ # xm7206v11a chip configuration
│ │ ├── prebuilts/ # Prebuilt files (partition table XML, bootargs.bin, etc.)
│ │ ├── reg/ # Register configuration files
│ │ └ *_cfg.mk # Configuration Makefiles for each EVB board variant
│ ├── xm7206v12a/ # xm7206v12a chip configuration (same structure)
│ ├── xm7206v11/ # Other chip variant configurations...
│ └── ...
│
├── develop_env.sh # Development environment initialization script
│ # Installs Ubuntu build dependencies (gperf, automake, etc.)
│ # Requires sudo to run
│
├── env_tools # Environment tool sources
│ ├── gperf-3.1/ # gperf hash generator
│ └ automake-1.15.1/ # automake build tool
│ # develop_env.sh builds and installs these two
│
├── Makefile -> ./build/root.mk # Top-level Makefile (symlink)
│ # Invoking make actually calls build/root.mk
│
├── mcu # MCU/RISC-V subsystem
│ ├── media/ # MCU media processing
│ └ riscv/ # RISC-V core code
│ # Used for low-power mode, AOV, and similar features
│
├── open_source # Third-party open-source components
│ ├── busybox/ # BusyBox (embedded Linux toolset)
│ ├── dropbear/ # SSH server
│ ├── mtd-utils/ # Flash tools (flashcp, nanddump, etc.)
│ ├── e2fsprogs/ # ext2/3/4 file system tools
│ ├── zlib/ lz4/ zstd/ # Compression libraries
│ ├── gdb/ # GDB debugger
│ └── ... # Other 20+ open-source components
│
├── out # Build output directory (grouped by chip model)
│ ├── xm7206v11a/ # xm7206v11a build output
│ │ ├── ko/ # All .ko driver modules (packaged into rootfs/opt/ko)
│ │ ├── lib/ # SDK shared libraries
│ │ ├── rootfs/ # Final rootfs directory structure
│ │ ├── image/ # Flash images
│ │ │ ├── spi_image/ # SPI-NOR image
│ │ │ ├── emmc_image/ # eMMC image
│ │ │ └── nand_image/ # NAND image
│ │ ├── linux-5.10.y/ # Kernel build directory
│ │ └ boot_builddir/ # U-Boot build directory
│ ├── xm7206v12a/ # xm7206v12a build output (same structure)
│ └── spidev_test/ # SPI device test tool
│
├── sample # Official SDK sample programs
│ ├── common/ # Common code (sample_comm_*.c)
│ ├── vio/ # Video input/output samples
│ ├── venc/ # Video encoding samples
│ ├── audio/ # Audio samples
│ ├── npu/ # NPU neural network samples
│ ├── vo/ # Video output/HDMI samples
│ ├── fb/ # Framebuffer samples
│ ├── tde/ # TDE graphics acceleration samples
│ ├── ive/ # IVE image processing samples
│ ├── cipher/ # Encryption module samples
│ ├── pm/ # Power management samples
│ ├── quickstart/ # Quick start samples
│ └── ...
│
├── app_sample # Application-layer samples (your custom applications)
│ ├── face_recognize/ # Face recognition application
│ └ rpi_detector/ # Raspberry Pi detector
│
├── source # Core source directory
│ ├── bootloader/ # U-Boot source
│ │ ├── u-boot-2020.01/ # U-Boot 2020.01 version
│ │ ├── product/ # XMEDIA product customization
│ │ └ secureboot/ # Secure boot related
│ ├── kernel/ # Linux kernel source
│ │ ├── linux-4.9.y/ # Kernel 4.9 version
│ │ ├── linux-5.10.y/ # Kernel 5.10 version (currently used)
│ ├── gmp/ # XMEDIA Media Platform SDK (core!)
│ │ ├── drv/ # Driver sources (compiled to .ko)
│ │ ├── usr/ # User-space library sources (compiled to .so)
│ │ ├── include/ # SDK header files
│ │ └ ko/ # Prebuilt ko directory
│ ├── rootfs/ # rootfs build scripts
│ │ ├── scripts/ # rootfs.tgz source package, Makefile
│ │ ├── busybox/ # BusyBox build configuration
│ │ ├── dropbear/ # SSH build configuration
│ │ └── ...
│ ├── trusted-firmware/ # ARM Trusted Firmware (ATF)
│ ├── initramdisk/ # Initial ramdisk
│ └── app/ # Application source
│ └ factory_test/ # Factory test program
│
├── tools # Tool scripts directory
│ ├── linux/ # Linux platform tools
│ │ ├── toolchains/ # Cross-compilation toolchains
│ │ ├── pq_board/ # PQ image quality tuning tool
│ │ ├── aq_board/ # AQ audio quality tuning tool
│ │ ├── kconfig/ # menuconfig tool
│ │ └ utils/ # Other auxiliary tools
│ └── windows/ # Windows platform tools
│
├── version_config # SDK version/configuration management
│ ├── main_config # menuconfig main menu entry
│ ├── config.base # Base configuration options
│ ├── config.board # Board-level configuration options
│ ├── config.bootloader # Bootloader configuration options
│ ├── config.kernel # Kernel configuration options
│ ├── config.system # System configuration options
│ └ config.filesystem # File system configuration
│ └ config.flash # Flash type configuration
│ └ config.tools # Tools configuration
│
└── tar_rootfs.sh # Helper script to manually package rootfs.tgzTip
The out/ directory is generated only after the first build and holds all build artifacts. cfg.mk is the currently selected board configuration file and determines the target hardware for the build.
