SDK Directory Guide¶
1. SDK Directory Structure¶
Figure 1: SDK Directory Structure
Source Code Description:
sdk: Source code for sensor drivers and sample code, as well as SDK source code that depends on the Linux kernel.
boot: Source code and build environment for U-Boot.
kernel: Source code and build environment for the Linux kernel.
project: Configuration files and environment for building the entire project.
optee: Source code and build environment for OP-TEE (if the chip supports a secure world).
2. Content Details¶
2.1. boot¶
The directory layout is basically the same as upstream U-Boot. The following is a generic example (actual file names follow the project configuration):
.
├── ...
├── common
│ └── sgs_android_bootreason.c // Example of sgs‑platform boot reason handling logic
├── drivers
│ └── sgs_common // sgs‑provided peripheral/OS wrapper drivers
├── configs
│ └── <UBOOT_DEFCONFIG> // Project U-Boot defconfig,
│ // see CONFIG_UBOOT_CONFIG in the project defconfig
└── ...
2.2. kernel¶
The directory layout is basically the same as upstream Linux kernel. Users mainly need to pay attention to the following (generic form):
.
├── ...
├── arch
│ └── <arch> // arm or arm64, etc.
│ ├── boot
│ │ └── dts
│ │ └── <chip>-<board>.dts // Device tree file
│ └── configs
│ └── <KERNEL_DEFCONFIG> // Kernel defconfig,
│ // see CONFIG_KERNEL_CONFIG in the project defconfig
├── drivers
│ └── sgs_common // sgs‑provided common peripheral drivers
└── ...
2.3. sdk¶
sdk
├── verify // Sample / verification projects
│ ├── sample_code // Linux‑side sample code
│ └── system_app / bsp_demo // System / board‑level verification (slight variation by version)
├── driver
│ └── ... // Various driver sources (for example PspiDriver, etc.)
└── linux // Linux‑side adaptation code when SDK is decoupled from kernel
2.4. project¶
.
├── board // Board‑related resources
│ ├── mhera
│ │ ├── SSM004A-S01A // For example, SSM004A-S01A, SSC029A-S01A, etc.
│ │ │ └── config
│ │ │ ├── config_board.json // Board‑level configuration
│ │ │ ├── config_fb.json // Display configuration
│ │ │ └── config.json // Other board parameters (if present)
│ │ ├── boot
│ │ │ ├── <media>/ipl/partition // IPL and partition configs for different boot media
│ │ │ ├── optee // TEE‑related images
│ │ │ └── tf_a // TF‑A (BL31 etc.) images
│ │ ├── dla_file // IPU FW / model binaries
│ │ ├── iqfile // ISP IQ files
│ │ ├── screen_param // Panel / screen parameters
│ │ └── ... // Other board resources
│ └── json // Legacy location for MI external json parameters
│ // (in newer versions these may be merged into board configs)
├── configs
│ └── verify
│ └── defconfigs
│ └── nvr_mhera.spinand.glibc-12.4.0-arm64-squashfs.ssm004a.s01a.1024x1024.fccsp16_ddr4_defconfig // Project defconfig; controls KERNEL/MMA/SENSOR IQ/partitions, etc.
├── image // Image creation configs/scripts/tools
│ ├── build // Prebuilt image tools (e.g. lfs/fwfs)
│ ├── busybox // Prebuilt busybox
│ ├── configs
│ │ └── general
│ │ ├── customer.mk // Files to pack into customer partition (UBI)
│ │ ├── misc.mk // Files to pack into misc partition (FWFS)
│ │ ├── miservice.mk // Files to pack into miservice partition (UBI), usually MI so/dynamic libs and kernel ko
│ │ ├── ramdisk.mk // Files and startup scripts for ramdisk; ramdisk is the first rootfs
│ │ ├── rootfs_fastboot.mk // fastboot rootfs configuration
│ │ ├── rootfs.mk // Second rootfs packaging information
│ │ ├── nor-ramdisk.rtos.partition.config
│ │ └── spinand-ramdisk.rtos.partition.config // Partition scripts for different media
│ ├── image.mk // Partition creation script; generates bin images and PARTINFO.pni
│ ├── ota.mk // OTA bin generation script (when using sgs OTA tools)
│ ├── script.mk // Flash‑burning script generator (outputs to images/scripts)
│ ├── etc/init.d // System initialization scripts
│ ├── firmwarefs-fuse // FWFS tools/applications
│ ├── littlefs-fuse // LFS tools/applications
│ ├── fuse // Libraries required by LFS/FWFS tools
│ ├── makefiletools // Rootfs creation tools
│ ├── rootfs // Rootfs packages
│ └── systemtap // Kernel debugging tools
├── kbuild
│ └── customize
│ └── 6.1
│ └── mhera // Scripts deciding which ko are copied from kernel to project/ramdisk
├── release
│ ├── chip
│ │ └── mhera // SDK libraries for each chip
│ │ ├── nvr // Prebuilt libraries for different product lines
│ │ └── sgs_common_libs // Common libraries (grouped by toolchain, glibc/uclibc etc.)
│ └── include // SDK header files
├── scripts // Project scripts
└── tools // Debugging tools (e.g. iqtool)