                                      INSTALL- v1.2
		-------------------------------------------------------


Introduction
============
   This file will show you how to build the RTL8196c linux system. Besides, It
   will guide you how to download the built image to Realtek EV (Evaluation)
   board for testing. PLEASE NOTE, the download image will overwrite the original
   image existed in the flash memory of EV board.

Build Environment
=================
   - RedHat 7.3/9.0
   - Fedora 7.0
   - Assume the SDK files are put at root directory '/root'
      - rtl8196c-bootcode-1.1c.tar.gz
      - rtl8196c-toolchain-1.0.tar.gz
      - rtl8196c-linux-1.2.tar.gz

Install Toolchain
=================
    - Login as root account at RedHat Linux PC
    - Type 'mkdir -p /toolchain'
    - Type 'tar xvfz /root/rtl8196c-toolchain-1.0.tar.gz -C /toolchain'
    - Type 'export PATH=/toolchain/rsdk-96c/linux:$PATH' to add path to the environment path setting
    (you can add the path in your ~/.bash_profile)

Install the SDK (Linux Kernel, AP package and Boot Loader)
==========================================================
    - Type 'cd /root/'
    - Type 'tar xfzv /root/rtl8196c-linux-1.2.tar.gz'
    - Type 'tar xfzv /root/rtl8196c-bootcode-1.1c.tar.gz'

Build boot code and boot code loader 
====================================
   - choose hardware target:
     a. 'cd /root/rtl8196c-bootcode-1.1c'
	   b. 'cp def-rtl8196c-config .config'.

   - 'make menuconfig'
     a. choose the hardware setting (RTL8196c) and memeory setting.
     	- Target Platform Selection  --->  (Dram16M_16Mx1_16bit) is HW Setting for 16MB DDR-RAM.     	
     	- Target Platform Selection  --->  (Dram8M_8Mx1_16bit) is HW Setting for 8MB DDR-RAM.
     	
     b. choose compressing tool(LZMA is default enable).
   
   - 'make' then the boot code image will be located at '/root/rtl8196c-bootcode-1.1c/btcode'
     a. 'boot' is the binary file of boot code (used for flash programmer, but need to do 'byteswap' before burn to flash)
     b. 'boot.bin' is the image file for auto burn by tftp upload (Header is included for checksum checking)    
	
Add Customer's Linux applications
=================================
  - Please refer to SDK_Guide\Add_User_Space_Application. (if you want to use default applications, don't need to edit the 'Makefile' here.)

Edit script file for system initialization
==========================================
   -Please refer to SDK_Guide\System_Initial_Script. (if you want to use default script file, don't need to edit the 'profile.*' here.)

  	  
Build Linux kernel image and Make application image
===================================================
- GW version 
   - HW at least with 16M/2M SDRAM/SPI-Flash
   - 'cd /root/rtl8196c-linux-1.2/linux-2.4.18'
   - 'make clean'
   - 'make distclean'
   - 'cp arch/mips/defconfig-rtl8196c-gw .config'.
   - 'make menuconfig'
   - exit and save
   - 'make dep;make'   
   - 'cd /root/rtl8196c-linux-1.2/AP'
   - 'make clean'
 **- edit 'mkimg' to add in application program or create any entry
     in target file system when system is up, you can refer to SDK_Guide\Add_User_Space_Application
 **Note: if you want to keep default config, don't need to edit the 'mkimg' here.
   - 'make gw' will build the root file system for gw platform
   - ==> 'root.bin' is the rootfs image located at '/root/rtl8196c-linux-1.2/AP'
   - ==> 'webpages-gw.bin' is the rootfs image located at '/root/rtl8196c-linux-1.2/AP/goahead-2.1.1/LINUX'
   - 'cd /root/rtl8196c-linux-1.2/linux-2.4.18/rtkload/'
   - 'make' then linux kernel image will be built at the same directory.
   - ==> 'nfjrom' is the linux image
     ==> 'linux.bin' is the image, which could be booted by Realtek boot code.
     
- Pocket GW version 
   - HW at least with 16M/2M SDRAM/SPI-Flash
   - 'cd /root/rtl8196c-linux-1.2/linux-2.4.18'
   - 'make clean'
   - 'make distclean'
   - 'cp arch/mips/defconfig-rtl8196c-gw-pocket .config'.
   - 'make menuconfig'
   - exit and save
   - 'make dep;make'   
   - 'cd /root/rtl8196c-linux-1.2/AP'
   - 'make clean'
 **- edit 'mkimg' to add in application program or create any entry
     in target file system when system is up, you can refer to SDK_Guide\Add_User_Space_Application
 **Note: if you want to keep default config, don't need to edit the 'mkimg' here.
   - 'make gw' will build the root file system for gw platform
   - ==> 'root.bin' is the rootfs image located at '/root/rtl8196c-linux-1.2/AP'
   - ==> 'webpages-gw.bin' is the rootfs image located at '/root/rtl8196c-linux-1.2/AP/goahead-2.1.1/LINUX'
   - 'cd /root/rtl8196c-linux-1.2/linux-2.4.18/rtkload/'
   - 'make' then linux kernel image will be built at the same directory.
   - ==> 'nfjrom' is the linux image
     ==> 'linux.bin' is the image, which could be booted by Realtek boot code.
          
	- GW-8m version 	 
   - HW at least with 8M/2M SDRAM/SPI-Flash
   - 'cd /root/rtl8196c-linux-1.2/linux-2.4.18'
   - 'make clean'
   - 'make distclean'
   - 'cp arch/mips/defconfig-rtl8196c-gw-8m .config'.
   - 'make menuconfig'
   - exit and save
   - 'make dep;make'   
   - 'cd /root/rtl8196c-linux-1.2/AP'
   - 'make clean'
 **- edit 'mkimg' to add in application program or create any entry
     in target file system when system is up, you can refer to SDK_Guide\Add_User_Space_Application
 **Note: if you want to keep default config, don't need to edit the 'mkimg' here.
   - 'make gw' will build the root file system for gw platform
   - ==> 'root.bin' is the rootfs image with webpage image located at '/root/rtl8196c-linux-1.2/AP'
   - 'cd /root/rtl8196c-linux-1.2/linux-2.4.18/rtkload/'
   - 'make' then linux kernel image will be built at the same directory.
   - ==> 'nfjrom' is the linux image
     ==> 'linux.bin' is the image, which could be booted by Realtek boot code.     
     
- AP-8m version 	 
   - HW at least with 8M/2M SDRAM/SPI-Flash
   - 'cd /root/rtl8196c-linux-1.2/linux-2.4.18'
   - 'make clean'
   - 'make distclean'
   - 'cp arch/mips/defconfig-rtl8196c-ap .config'.
   - 'make menuconfig'
   - exit and save
   - 'make dep;make'   
   - 'cd /root/rtl8196c-linux-1.2/AP'
   - 'make clean'
 **- edit 'mkimg' to add in application program or create any entry
     in target file system when system is up, you can refer to SDK_Guide\Add_User_Space_Application
 **Note: if you want to keep default config, don't need to edit the 'mkimg' here.
   - 'make ap' will build the root file system for gw platform
   - ==> 'root.bin' is the rootfs image with webpage image located at '/root/rtl8196c-linux-1.2/AP'
   - 'cd /root/rtl8196c-linux-1.2/linux-2.4.18/rtkload/'
   - 'make' then linux kernel image will be built at the same directory.
   - ==> 'nfjrom' is the linux image
     ==> 'linux.bin' is the image, which could be booted by Realtek boot code.     
          
  -MP version (Used for MP Tools Testing only)
   - 'cd /root/rtl8196c-linux-1.2/linux-2.4.18'
   - 'rm -f arch/mips/ramdisk/ramdisk.img'
   - 'make distclean'
   - 'cp arch/mips/defconfig-rtl8196c-mp .config'
   - 'make menuconfig'
   - exit and save
   - 'make dep;make' then will show error msg 'make: *** [_dir_arch/mips/ramdisk] Error 2' 
     cause lack of 'ramdisk.img'. This is the normal procedure. Go next step !
   - 'cd /root/rtl8196c-linux-1.2/AP'
   - 'make clean'
   - 'make mp-gw' will build the ramdisk for GW platform
   - ==> 'ramdisk.img' application image will also be put into directory below for mp 'nfjrom' built.
   	 '/root/rtl8196c-linux-1.2/linux-2.4.18/arch/mips/ramdisk'
   - 'cd ../linux-2.4.18'
   - 'make'	 
   - 'cd rtkload/'
   - 'make' then mp linux image will be built at the same directory.
   - ==> 'nfjrom' is the linux image for mp

Download image to Realtek EV (evaluation) board for testing
===========================================================
   - Use a RS232 cable to connect COM port between a LINUX PC and EV board.
   - Connect LINUX PC Ethernet port to the LAN port of EV board. Set PC IP
     address to 192.168.1.x (e.g., type 'ifconfig eth0 192.168.1.1').
   - Start a COM port console (e.g., minicom), and set COM port setting to
     38400, 8N1 and no flow control.
   - Power on EV board, and press 'ESC' key in COM port console to escape the
     booting process. If ok, you may see "<RealTek>" prompt in the console.

Burn boot code image
====================
   - Start a TFTP client in LINUX PC, and connect to 192.168.1.6. Set file 
     type to binary mode, and put boot file (boot.bin) to TFTP server of EV 
     board.
   - After 'boot.bin' file download had finished, boot code will be burned 
     and auto booting. Then the new boot code will be effective.  
     
Burn linux/AP image
===================
   - Start a TFTP client in LINUX PC, and connect to 192.168.1.6. Set file
     type to binary mode, and put web page file ('/AP/goahead-2.1.1/LINUX/webpages-xx.bin') 
     to TFTP server of EV board, put 'root.bin' (if gw platform) to TFTP 
     server, and put linux image file('/linux-2.4.18/rtkload/linux.bin') 
     to TFTP server. After 'linux.bin' file download had finished, boot 
     code will be auto booting.

04/26/2010
