# MTK SDK Release Linux Architecture
- Study document MediaTek_Linux_SDK_Release_Note.pdf
- 這份文件說明了, 拿到 SDK 要怎麼進行相關設置
- Figure. Linux Software Architecture

# Introduction
## Support following Chips:
- RT63368
## The SDK Package contains the following items:
- GNU MIPS toolchain used to compile source code
- Linux bootloader image
- Linux kernel and rootfs images
- Linux kernel source code
- Linux user land applications
- Linux interface drivers for reference board.
- Microsoft Windows Remote NDIS drivers used to connect to the USB port from a Windows PC
# MediaTek SDK Release supported Features
- 說明支援的Chips各自Support哪些功能
- ex: Voice Feature:

# Toolchain Installation
```
Platform TC3182,RT63365, RT63368,RT65168: mips-linux-uclibc
A. Enter “mkdir –p /opt/trendchip” to create a toolchain folder.
B. Enter “cp toolchain/mips-linux-uclibc.tgz /opt/trendchip” to copy compressed
toolchain binary to folder.
C. Enter “tar jxvf mips-linux-uclibc.tgz” to decompress the toolchain binary.
D. Enter “export PATH=/opt/trendchip/mips-linux-uclibc/usr/bin:$PATH” to add
toolchain path to Environment Variable path
```
# Fakeroot Installation
- Fakeroot provides a fake root environment so as you can install and build SDK like root user.
- 判別一般使用者還是Root User
- Root: root@Desktop:~#
- 一般: [jenson_hu@sw6-builder3 ~]$
# Building Software
1. Decompress SDK
2. Create Profile
3. Build Image
# Firmware Upgrade
- 有4種方法, 其中一種是 bootloader mode
## bootloader mode
1. Upload tcboot.bin
2. Power on the CPE and press key in 3 seconds to enter bootloader mode.
3. Upgrade tclinux.bin or tcboot.bin through tftp method
- Wait for few minutes writing the image into flash automatically or enter
command of “flash [20000 if update tclinu.bin or 10000 if tcboo.bin ]
80020000 [hex lenth of tclinux.bin or tcboot.bin]” in serial console
- If your are upgrading tclinux.bin pleaseinput “go” to boot the system, and if
you are upgrading tcboot.bin please restart CPE...
[Tips: the default buffer address for tftp is 0x80020000]
# Load BSP Drivers and Applications
## BSP Drivers
- Use command to load the BSP drivers into system
- PCM(TC3182 only)
> insmod /lib/modules/pcmdriver_slic.ko
- DSP(TC3182 only)
> mkdir -p /var/tmp/osal
> insmod /lib/modules/extern_osal_kernel_gpl.ko
> insmod /lib/modules/osal_kernel.ko
> insmod /lib/modules/tdi.ko
> insmod /lib/modules/ve_vtsp_hw.ko
> insmod/lib/modules/ve_vtsp_rt.ko
- USB 2.0 Device for Ethernet(TC3162U, TC3182,RT63260 Only )
> insmod /lib/modules/tc3162_udc20.ko
> insmod /lib/modules/g_ether.ko
- USB 2.0 Host for Storage(TC3162U)
## The Source Code Directory
- The main folders in SDK is as following:
1. /linux
- Contains the Linux Kernel source code
2. /project/
- Contains profile and configure file for Project Setup and FW build
3. /modules/
- Contains public and private driver modules files.
4. /filesystem/
- Files and Folders for rootfs of tclinux system
5. /apps/
- Contains applications public source code, private source code and binary code
以上就是我們的 /extern/
```
jenson_hu@429577a6be05:~/E7528_230110/PRV33AC225E-B-TE/extern/ecn-bsp$ ls
Makefile MediaTek_Linux_SDK_Release_Notes.pdf Project app_bsp apps bootrom ctromfile.cfg doc filesystem global_inc kernel_ext lib_install linux-3.18.21 linux-ecnt modules tools version windows_rndis_driver
```
- The Modules Source Code Directory
- PUBLIC:
- The modules’ source code under this directory and subdirectories is from “Open Source”. Some of the files contain modification made by MediaTek. All these files can be made available in the source code format.
(1) usb_camera
- This directory contains driver for usb driver
- PRIVATE:
- The modules’ source code under this directory and subdirectories was developed by MediaTek. Some of the files will be released as source code while the others can not be released in the source code format although these modules can be made available in the object format.
(1) ko
- This directory contains the modules implementation in object format
- The APPs Source Code Directory