
General information for Marvell LSP
===================================

Contents:
=========
1.  Default kernel configuration.
	1.1 General feature:			
	1.2 Configuring the kernel to work in a BE mode:
2.  Marvell LSP File locations
3.  Kernel command line parameters: 
4.  MTD (Memory Technology Devices) Support
	4.1 For NOR flash only:
	4.2 For SPI flash only: 
	4.3 NAND ECC:
	4.4 Building a UBIFS root file system:
	4.5 Burn the UBIFS image:
	4.6 RootFS on UBIFS:
5.  Network
	5.1 Network driver	
	5.2 ethtool support
6.  SATA 
7.  USB in HOST mode
8.  USB in Device mode 
9.  Real Time Clock
10. CESA
11. LCD & LVDS panel
	11.1 enabling LCD
	11.2 enabling LVDS
12. Power managment.
13. SDIO/MMC.
14. AMP Setup.
15. Procedure for Porting a new Customer Board 
	

1.  Default kernel configuration:
	============================
	The following are the kernel configuration file supported in this release:
    make armada_xp_defconfig       ==> SMP  ARMv7 mode
    make armada_xp_be8_defconfig   ==> BE8  SMP ARMv7 mode
	make armada_xp_v6smp_defconfig ==> SMP  ARMv6 mode

	1.1 General feature:
	--------------------
	1.	All  configuration files support DDR selfrefresh when entering deep Ideal, no user intervention needed, see CPU-Idle section for more info.
		
	1.2 Configuring the kernel to work in a BE mode:
	------------------------------------------------
	To create a BE image, start with a LE image configuration file that matches the desired architecture version ( V6 /V7), see the Default kernel configuration section:
	 If the configuration file Is a V6 mode configuration, modify the following:

	If the configuration file is a V6 mode configuration, enable the following options in the Kernel configuration file:
	System Type -> Build Big-endian Kernel -> Support BE32 mode.

	System Type -> Build Big-endian Kernel -> Enable S/W handling for Unaligned Access

	If the configuration file is a V7 mode configuration, enable the following options in the Kernel configuration file:

	System Type -> Build Big-endian Kernel -> Support BE8 mode.

	System Type -> Build Big-endian Kernel -> Enable S/W handling for Unaligned Access

		
2.  Marvell LSP File locations:
===============================
	-Core directory (Amada XP specific sources): 
       - /arch/arm/mach-armadaxp/...
	-Armada Platform directory (drivers and sources shared across Armada platforms):  
       - /arch/arm/plat-armada/...
	-Location of the Armada XP drivers source:
		-RTC: the driver located under /drivers/rtc/rtc-mv.c.
		-SATA: the driver located under /drivers/ata/sata-mv.c.
		-Temp monitor sensor: arch/arm/mach-armadaxp/hwmon.c.
		-NAND driver: arch/arm/plat-armada/mv_drivers_lsp/mv_mtd/nand_nfc.c.
		-XOR engine: drivers/dma/mv_xor.c.
		-SDIO/MMC: drivers/mmc/host/mvsdio.c.
		-CESA: under arch/arm/plat-armada/mv_drivers_lsp/mv_cesa/.

3.  Kernel command line parameters: 
===================================
	The following kernel command line parameters has special use for Armada-XP, those parameters
	can be added to the kernel's command line that prepared by the U-boot by adding it to
	the U-boot "console" environment variable:

	noL2: If this parameter is passed, the kernel will not initialize the Aurora L2 subsystem.
	nfcConfig: this option can be set to either ganged/8bitecc/12bitecc/16bitecc, is not passed, the ECC support will default to 4 bit ECC.

4.  MTD (Memory Technology Devices) Support:
============================================
	The MTD driver automatically detects the existing Flash devices and maps it into the Linux MTD subsystem. 
	This new driver affect NOR flashes (CFI device bus based o SPI). NAND flashes are supported separately and not part of this map driver.

	The detection of MTD devices depends on the Linux kernel configuration options set (using the 
	"make menuconfig" or "make xconfig" tools).
	To have basic MTD Support the following options should be selected:
		-> Device Drivers                                                                                                   
			  -> Memory Technology Devices (MTD)                                                                                
				-> Memory Technology Device (MTD) support (MTD [=y])                                                            

	For CFI Flashes the following options should be selected
		-> Device Drivers                                                                                                   
			  -> Memory Technology Devices (MTD)                                                                                
				-> Memory Technology Device (MTD) support (MTD [=y])                                                            
				  -> RAM/ROM/Flash chip drivers 
			-> Detect flash chips by Common Flash Interface (CFI) probe

	For Intel (and Intel compatible) Flashes the following options should be selected
		-> Device Drivers                                                                                                   
			  -> Memory Technology Devices (MTD)                                                                                
				-> Memory Technology Device (MTD) support (MTD [=y])                                                            
				  -> RAM/ROM/Flash chip drivers 
			-> Support for Intel/Sharp flash chips

	For AMD (and AMD compatible) Flashes the following options should be selected
		-> Device Drivers                                                                                                   
			  -> Memory Technology Devices (MTD)                                                                                
				-> Memory Technology Device (MTD) support (MTD [=y])                                                            
				  -> RAM/ROM/Flash chip drivers 
			->  Support for AMD/Fujitsu flash chips

	In addition specific flash type kernel configuration is needed:

	4.1 For NOR flash only: 
	-----------------------
	In order to enable the NOR flash in the Armada LSP make sure the NOR Support option is set, the NOR Support is located under:
	System Type - > Armada SOC options -> Armada SOC Include Features -> NOR Support In the kernel configuration, or simply CONFIG_MV_INCLUDE_NOR=y, or to comment this line to disable the NOR support.
	Note: Marvell Armada XP DB needs board modification to be able to work with NOR flash.

	4.2 For SPI flash only: 
	-----------------------
	To enable SPI flash in the Armada LSP make sure the SPI Support option is set, the SPI Support option is located under:
	System Type - > Armada SOC options -> Armada SOC Include Features -> SPI Support.
	Or simply by editing the configuration file to  CONFIG_MV_INCLUDE_SPI=y, or to comment this line to disable the SPI support.


	By default, the map driver maps the whole flash device as single mtd device (/dev/mtd0, /dev/mtd1, ..)
	unless differently specified from the UBoot using the partitioning mechanism.
	To use the flash partitioning you need to have this option selected in the kernel. To do this
	you will need the following option selected:
		-> Device Drivers                                                                                                   
			  -> Memory Technology Devices (MTD)                                                                                
				-> Memory Technology Device (MTD) support (MTD [=y])   
			  -> MTD concatenating support

	The exact partitioning is specified from the UBoot arguments passed to the kernel. The following 
	is the syntax of the string to be added to the UBoot "booatargs" environment variable:

		   'mtdparts=<mtd-id>:7m@0(rootfs),1m@7(uboot)ro' 
		   Where <mtd-id> can be one of options: 
		   1) SPI-Flash => "spi_flash"
		   2) NOR-Flash => "cfi_flash"

	4.3 NAND ECC:
	-------------
	The NAND ECC level is passed to the Kernel via the nfcConfig command line parameter from the U-boot,
	the nfcConfig parameter can be set to either ganged/8bitecc/12bitecc/16bitecc, and default to 4 bit ECC if not passed.

	4.4 Building a UBIFS root file system:
	--------------------------------------
	Important Note: In the following I assume that the root file system is situated in the directory rootfs.
	Several of the parameters appearing in the following example need to be adjusted to the user's needs and only serve as examples:
	Before we can burn a FS to the NAND device, an image file should be prepared first with
	the FS content. This is done using the "mkfs.ubifs" and "ubinize" commands. If you 
	don't have these commands refer to MTD utilities section.
	The following is an example of how to create this FS image:
	- mkfs.ubifs -r ../lucid/ -m 8192 -e 1032192 -c 7800 -o lucidfs.img -v
	- ubinize -o lucid.img -m 8192 -p 1MiB ubinize.cfg -e 0 -v


	The content of the ubinize.cfg file is:
	[ubifs]
	mode=ubi
	image=lucidfs.img
	vol_id=0
	vol_size=7800MiB
	vol_type=dynamic
	vol_name=rootfs
	vol_flags=autoresize
	vol_alignment=1

	Important parameters that should be considered in the "mkfs.ubifs":
	 - "-m" option: specifies the page size ==> 8KiB in ganged mode, or 4KiB in all other options ( assuming using 4KiB NAND parts).
	 - "-e" option: erase block size ==> 1MiB in ganged mode.
	 - "-c" option: maximum LEB (logical erase blocks) count ==> This parameter specifies
					the maximum size of the FS content. This count should be less than the
			total count of LEBs.
	For example: In the 8GiB, we have 8192 LEBs, each is 1MiB in size. Out of the 8192 LEBs, maximum 128 LEBs can be marked bad by the manufacturer, 8 LEBs
			are marked bad for the BBT table (last 8 blocks in the flash), something
			like 80-100 LEBs are reserved/spare blocks, to be used in BB replacement,
			few LEBs are used by the FS to hold its tables.
			Thus a total of 7800 out of the 8192 LEBs is a reasonable number for free
			or user usable LEBs.

	4.5 Burn the UBIFS image:
	-------------------------
	To burn the prepare FS image, you will need to use the following command on the 
	Target board:
		"ubiformat /dev/mtd0 -f lucid.img"

	Note: it is preferable to erase the nand devices from the UBoot using
	the command: " nand erase"
	This command will erase the whole nand device while skipping bad blocks.

	4.6 RootFS on UBIFS:
	--------------------
	To have the root FS on the NAND, you need to pass 3 parameters to the Linux from the
	UBoot using the boot command. The following string should be added to the 
	"bootargs_root" UBoot variable:
	"root=ubi0:rootfs rw ubi.mtd=0 rootfstype=ubifs"

	If the root FS is mounted on other device (sata or NFS) and you need to access the
	UBIFS file for maintenance, you can mount the UBIFS using the commands:
	"ubiattach /dev/ubi_ctrl -m 0"
	"mount -t ubifs ubi0:rootfs /mnt/"

	4.7 MTD utilities:
	-----------------
	Mtd utilities are needed to be able to interact with the MTD devices, the latest release of the mtd-utils can be downloaded from http://www.linux-mtd.infradead.org.
	(The main page has a link to the latest release of the mtd-utils package).
	This package provides a set of sources that can be compiled and used to manage and debug MTD devices. 
	These tools can be used to erase, read and write MTD devices and to retrieve some basic information.

	The mtd utils have to be compiled both for arm and for x86 since typically the
	file system will be generated on a x86 system.o
	The lzo and uuid libraries are needed for compiling and for running the ubi utilities.


	The following utilities should be on the target system:
	- ubiformat, ubinfo, ubimkvol, ubirmvol, ubiupdatevol, ubiattach, ubidetach


	The following is a list of useful commands:
	To see a list of MTD devices detect by the kernel: "cat /proc/mtd"
	To erase the whole MTD device: "./flash_eraseall /dev/mtd0"
	To erase the whole MTD device and format it with jffs2: "./flash_eraseall -j /dev/mtd1"
	To get device info (sectors size and count): "./flash_info /dev/mtd1"
	To create jffs2 image for NAND flash(with eraseblock size 0x20000): 
			   ./mkfs.jffs2 -l -e 0x20000 -n -d <path_to_fs> -o <output_file>


	To protect all sectors: "./flash_lock /dev/mtd1 0x0 -1"
	To unprotect all sectors: "./flash_unlock /dev/mtd1"

5.  Network:
============
  5.1 Network driver:
  -------------------
    The Network driver supports creating Linux network interfaces over
    Marvell SoC GbE ports.
 
   
    - Configure whether a GbE port is "connected" to Linux (a Linux network
      interface eth<i> is created) or "disconnected" from Linux (a Linux network
      interface eth<i> is not created) using kernel command line parameters
      which can be appended to the console parameter in U-Boot:
        - mv_port0_config=disconnected
        - mv_port1_config=disconnected
        - mv_port2_config=disconnected
        - mv_port3_config=disconnected
      The default (if no parameter is passed) is that the port is connected.
	 Running "ifconfig -a" will show all available interfaces.

	  
	- Runtime driver configuration and debug is supported via
      sysfs:
        
        - cd /sys/devices/platform/neta/gbe
        - cat help to display options
			
  5.2 ethtool support:
  --------------------
  This release introduces support for a standard ethtool. 
  The ethtool support should be enabled in kernel configuration:
   CONFIG_MV_ETH_TOOL:                                                                                                        
   -> System Type
     -> Armada SoC options   
       -> SoC Networking support 
         -> Networking Support
            -> Control and Statistics               

    The following ethtool commands are supported in current release:

	  - ethtool DEVNAME                               Display standard information about device

	  - ethtool -s |--change DEVNAME             Change generic options
				[ speed 10|100|1000 ]
				[ duplex half|full ]
				[ autoneg on|off ]

	  - ethtool -c|--show-coalesce DEVNAME     Show coalesce options

	  - ethtool -C|--coalesce DEVNAME             Set coalesce options
				[rx-usecs N]
				[tx-usecs N]

	  - ethtool -i|--driver DEVNAME                    Show driver information

	  - ethtool -d|--register-dump DEVNAME       Do a register dump
				[ raw on|off ]

	  - ethtool -r|--negotiate DEVNAME              Restart N-WAY negotiation

	  - ethtool -p|--identify DEVNAME                Show visible port identification (e.g. blinking)
				[ TIME-IN-SECONDS ]

	  - ethtool -S|--statistics DEVNAME             Show adapter statistics
	  - ethtool -k eth0      	                    Show offload parameters on eth0.
	  - ethtool -K eth0 rx off						Turn off rx-checksum
	  - ethtool -K eth0 rx on                       Turn on rx-checksum
	  - ethtool -K eth0 tx off						Turn off tx-checksum
	  - ethtool -K eth0 tx on                       Turn on tx-checksum
	  - ethtool -K eth0 tso off						Turn off TSO
	  - ethtool -K eth0 tso on                      Turn on TSO
	  - ethtool -K eth0 gro off						Turn off GRO
	  - ethtool -K eth0 gro on                      Turn on GRO

6.  SATA:
=========

	The SATA functionality on the Armada XP can utilize two different underlying driver implementation, 
	the standard libATA or the Marvell implementation. The standard libATA is enabled by default, to work 
	with the MARVELL implementation follow these steps:
	1)	Disable the Serial ATA and Parallel ATA drivers option under the Device Drivers in the menuconfig, 
	or simply comment the CONFIG_ATA=y line in the configuration file.

	2)	Enable the Marvell implementation that can be found:
	System Type-> Armada SoC options -> Support for Marvell Sata Adapters -> Enable the Support ATAPI (CR-ROM/DVD-ROM) devices 
	and the Enable 1 MByte requests options or  
	CONFIG_SCSI_MVSATA=y 
	CONFIG_MV_SATA_SUPPORT_ATAPI=y
	CONFIG_MV_SATA_ENABLE_1MB_IOS=y

	Recommendation is to keep the setting at default.

7.  USB in HOST mode:
=====================
	The mode of the USB controller (device or host) is configured using the UBoot environment variables. 
	To work in USB HOST mode, set the UBoot variable "usb0Mode"/"usb1Mode"/"usb2Mode" to "host".
	The USB driver uses the standard Linux ehci driver.

8. USB in Device mode:
======================
	The mode of the USB controller (device or host) is configured using the UBoot environment variables. 
	To work in USB Device mode, set the UBoot variable "usb0Mode"/"usb1Mode"/"usb2Mode" to "device".
	Marvell tests the mass storage functionality and the driver is located in: arch/arm/plat-armada/mv_drivers_lsp/mv_udc/mv_udc_main.c

	Please refer to the arch/arm/plat-armada/mv_drivers_lsp/mv_udc/README for full step on the procedure used to test the usb mass storage gadget.
	
9.  Real Time Clock:
====================

	The driver is found under  /drivers/rtc/rtc-mv.c
	To set the time in the RTC from the current Linux clock, use the hwclock set command  for example:
	hwclock --set --date="3/14/2007 21:00:00"
	To read the date and time from the integrated RTC unit, use the command hwclock.
	Trying to read clock before it was set for the first might return an error message.

10.  CESA:
==========
	OpenSSL:
	--------
	  See  cesa/openssl/README

	IPsec:
	------
	  see cesa/openswan/README

11. LCD: 
========
	11.1 enabling LCD:
	-------------------
	To enable/ use a LCD screen, the u-boot must set the following parameters:
	lcd0_params  the appropriate LCD parameters in the following format 480x272-24@60
	lcd0_enable: set to 1.
	lcd_panel: set to 0.

	11.2 enabling LVDS:
	------------------
	To enable/ use a LVDS panel, the u-boot must set the following parameters:
	lcd0_params  the appropriate LCD parameters in the following format 480x272-24@60
	lcd0_enable: set to 1.
	lcd_panel: set to 1.

12. Power managment:
=======================
     12.1 power modes
	 ============
	AXP has support for power management using the OS governor in SMP and UP modes.
	Power states supported: wfi, deep idle, snooze (deep deep idle  L2 shut down)
	To enable Add pm_level=X to the console variable in the U-boot(X = wfi/idle/snooze/off).
	For example:
	console=console=ttyS0,115200 pm_level=snooze
	if the parameter is not defined  power management is enabled with snooze support.
	To manually disable the power management:
	console=console=ttyS0,115200 pm_level=off


	-To modify configurations during OS run-time:
	See the menu: cat /proc/cpu_idle
	Enable:                 echo "enable" > /proc/cpu_idle
	Disable:                echo "disable" > /proc/cpu_idle

	-For UP or when rest of the CPUs are unplugged:
	Set X state for CPU0:      echo X > /proc/cpu_idle
	(Where X = wfi/deep/snooze)

	-For statistics regarding the power management states for each of the CPUs, use /sys/devices/system/cpu/cpu0/cpuidle/
	For additional information see attached sysfstxt file from the kernels cpu_idle documentation.

	-To enter standby mode:
	echo standby > /sys/power/state
	any Uart character will bring back the system

	Hotplug CPU:
	To hot plug a CPU use the following commands (X = cpu number != 0):
	Unplug:                echo 0 > /sys/devices/system/cpu/cpuX/online                
	Plug:                      echo 1 > /sys/devices/system/cpu/cpuX/online             
		

	12.2. WOL: 
	==========
	In order to operate this feature, the following instructions should be followed:
		1. Compile the kernel with the WoL enabled (check next sub-section 12.1).
		2. Enter the necessary wakeup rules (check sub-sections 12.3 and 12.4)	
		3. Trigger the standby mode "echo standby > /sys/power/state"
		4. The system halt all operation and enters Low Power mode
		5. Generate a wakeup packet to the port specified in the WOL rule.
		6. The system reusmes normal operations
		
	12.2.1. How to build the kernel
	==========================
		To enable this feature in the kernel, the following should be added on top of the defconfig:
		   -> System Type
			 -> Armada SoC options
			   -> SoC Networking support
				 -> PnC support
				   -> Use PNC for Wake On LAN support: Should be selected.
	

	12.2.2. WoL APIs:
	===============
	The implementation for the Standby WoL Mode provides the following API:
			File arch/arm/plat-armada/mv_hal/neta/pnc/mvPncWol.c
			- Add new WoL rule
			int mv_pnc_wol_rule_set(int port, char *data, char *mask, int size);

			- Delete existing WoL rule - Not supported
			int mv_pnc_wol_rule_del(int idx);

			- Delete all existing WoL rule
			int mv_pnc_wol_rule_del_all(int port);
			Note: argument <port> is ignored and all WoL rules created for all ports are deleted

			- Print out existing WoL rule accordingly with unique identifier returned by mv_pnc_wol_rule_set()
			int mv_pnc_wol_rule_dump(int idx);

			- Print out all existing WoL rules
			void mv_pnc_wol_dump(void);

		File arch/arm/plat-armada/mv_drivers_lsp/mv_neta/net_dev/mv_netdev.c
			- Enter WoL filtering mode on specific port
			int mv_eth_wol_sleep(int port);
			Note: In this drop enter WoL filtering mode done by sysfs command "sleep" (see below)
				  Later it will be done via standard "suspend" function of the driver

			- Exit WoL filtering mode on specific port
			void mv_eth_wol_wakeup(int port);
			Note: In this drop exit WoL filtering mode and return to Active filtering mode done 
				  by special callback function from Giga driver ISR routine. 
				  Later it will be done via standard "resume" function of the driver

	12.2.3. WoL sysfs commands
	=====================
	(under directory: /sys/devices/platform/neta/wol)
		cat                  dump_all      - dump all wol rules
		echo idx           > dump          - dump rule <idx>
		echo port          > sleep         - enter WoL mode on <port>
		echo port          > wakeup        - exit WoL mode on <port>
		echo str           > data          - set data string
		echo str           > mask          - set mask string
		echo port          > add           - add new rule with <data> and <mask> on <port>
		echo idx           > del           - delete existing WoL rule <idx> (Not supported)
		echo port          > del_all       - delete all WoL rules added to <port>

	Note: More useful sysfs commands can be found under "neta/pnc" and "neta/gbe" subdirectories.
		For example:
		- Print out all valid TCAM entires
		=> cat                  pnc/hw_dump
		- Print out PNC registers
		=> cat                  pnc/hw_regs
		- Print out Giga port MIB HW counters
		=> echo port          > gbe/cntrs
		- Print out Giga driver port statistics
			=> echo port          > gbe/stats

	12.2.4. WoL rule examples:
	=====================

			- Add first WoL rule 42 bytes size on giga port 1. Two TCAM entires created are used: 39 and 40.
		=> echo 0000ffffffffffff00000000003908004500004E0000000000110000c0a801FA0000000000890089003A > wol/data
		=> echo 0000ffffffffffffffffffffffffffffffffffff0000000000ff0000ffffffff00000000ffffffffffff > wol/mask
		=> echo 1 > wol/add
		=> cat wol/dump_all
		=> cat wol/dump_all
		WoL rules table
		[  0]: id=0, port_mask=0x2, size=42, tids=[ 39 40]
		 offs: 000102030405060708091011121314151617181920212223
		 data: 0000ffffffffffff00000000003908004500004e00000000
			   00110000c0a801fa0000000000890089003a
		 mask: 0000ffffffffffffffffffffffffffffffffffff00000000
			   00ff0000ffffffff00000000ffffffffffff

			- Add second WoL rule of 42 byte size on giga port 1. The second rule is equal to first rule on first 
			24 bytes, but different on byte #25. One TCAM entry (39) is reused from first rule and new TCAM entry
			is used: 41.
		=> echo 00000050434d702a00000000003908004500004E0000000000000000c0a801FA0000000000890089003A > wol/data
		=> echo 0000ffffffffffffffffffffffffffffffffffff0000000000000000ffffffff00000000ffffffffffff > wol/mask
		=> echo 1 > wol/add
		=> cat wol/dump_all
		WoL rules table
		[  0]: id=0, port_mask=0x2, size=42, tids=[ 39 40]
		 offs: 000102030405060708091011121314151617181920212223
		 data: 0000ffffffffffff00000000003908004500004e00000000
			   00110000c0a801fa0000000000890089003a
		 mask: 0000ffffffffffffffffffffffffffffffffffff00000000
			   00ff0000ffffffff00000000ffffffffffff

		[  1]: id=1, port_mask=0x1, size=42, tids=[ 39 41]
		 offs: 000102030405060708091011121314151617181920212223
		 data: 0000ffffffffffff00000000003908004500004e00000000
			   00000000c0a801fa0000000000890089003a
		 mask: 0000ffffffffffffffffffffffffffffffffffff00000000
			   00000000ffffffff00000000ffffffffffff

			- Add third WoL rule of 42 byte size on giga port 1. The third rule is different from first and second rules
				on first 24 bytes. Two new TCAM entries are used for third WoL rule (39) is reused from first rule and new TCAM entry
				is used: 42 and 43.
		=> echo 00000050434d702a00000000003908004500004E0000000000000000c0a801FA0000000000890089003A > wol/data
		=> echo 0000ffffffffffffffffffffffffffffffffffff0000000000000000ffffffff00000000ffffffffffff > wol/mask
		=> echo $1 > wol/add
		=> cat wol/dump_all
		WoL rules table
		[  0]: id=0, port_mask=0x2, size=42, tids=[ 39 40]
		 offs: 000102030405060708091011121314151617181920212223
		 data: 0000ffffffffffff00000000003908004500004e00000000
			   00110000c0a801fa0000000000890089003a
		 mask: 0000ffffffffffffffffffffffffffffffffffff00000000
			   00ff0000ffffffff00000000ffffffffffff

		[  1]: id=1, port_mask=0x1, size=42, tids=[ 39 41]
		 offs: 000102030405060708091011121314151617181920212223
		 data: 0000ffffffffffff00000000003908004500004e00000000
			   00000000c0a801fa0000000000890089003a
		 mask: 0000ffffffffffffffffffffffffffffffffffff00000000
			   00000000ffffffff00000000ffffffffffff

		[  2]: id=2, port_mask=0x1, size=42, tids=[ 42 43]
		 offs: 000102030405060708091011121314151617181920212223
		 data: 00000050434d702a00000000003908004500004e00000000
			   00000000c0a801fa0000000000890089003a
		 mask: 0000ffffffffffffffffffffffffffffffffffff00000000
			   00000000ffffffff00000000ffffffffffff

13. SDIO/MMC:
=============
	To enable this subsystem, the SDIO Support should be enabled in the LSP configuration file which can found under:
	System Type-> Armada SoC options-> Armada SoC Included Features- SDIO Support.

	Or by simply the configuration file to include the CONFIG_MV_INCLUDE_SDIO=y.
	Once an image is compiled with the above configuration options, and loaded on the target, the SDIO/MMC is enabled / disabled ( as desired).

	Interacting with the MMC/SDIO device is done via the device created dynamicly under the /dev directory (i.e. /dev/mmcblk01,  /dev/mmcblk02).

14. AMP Setup:
==============
This release includes AMP support for running 2 Linux OS on Armada-XP. to setup an AMP system, follow these steps:
 
    o Linux
      -----
	1. Setup a build environment as specified in section 5 "HowTo Build". 
	2. enable SMP under "Kernel Features"->"Symmetric multi processing"
	3. open menu config (make menuconfig) and set the following under "System Type"->"Armada Soc options"->"Armada AMP options"
		3.1 Enable AMP support = enable
		3.2 "Image 0 - base address ..."  = base address of Linux 0
		3.3 "Image 1 - base address ..."  = base address of Linux 1
		3.4 "Image 0 - UART port ..."     = uart port of of Linux 0 (0 or 1)
		3.5 "Image 1 - UART port ..."     = uart port of of Linux 1 (0 or 1)
	NOTE: please don't change the value of "Base address of physical memory" /" UART port for prints"
	4. Disable the Buffer manager module at  "System Type"->"Armada Soc options"->Networking support"->"BM configuration"->Buffer Management 
	   support (BM)"
	5. build both images by calling tools\amp\amp_make.pl [output_dir]. the output 2 AMP images will be
	   named uImage_g0 and uImage_g1.

    o U-BOOT
      ------
	 NOTE: must use Uboot release >= 2.1.2.
	1. At U-BOOT prompt type "setenv amp_enable yes; saveenv" 
	2. Reset the board
	3. Create boot group 0 and 1 using the command amp_config as follows
	     amp_config <group_id>  <cpu_count>  <master_cpu> <mem_base> <mem_size> <resources> 
        		<group_id>   - which AMP group to config
	        	<cpu_count>  - how many cpus to use in the group. 
		        <master_cpu> - cpu id of first cpu in the group. 
		        <mem_base>   - base physical address of group's image - must match compile value !
		        <mem_size>   - physical space size of group's image 
	        	<resources>  - resource string 
	4. The following boot parameters are duplicated to be used by the second group.
		they are created when amp_config is called. 

		must be different between groups
		--------------------------------
		* ipaddr_gX
		* rootpath_gX
		
		Can be left to default
		----------------------
		* image_name_gX
		* console_gX	    
		* mtdparts_gX 
		* serverip_gX
		* bootargs_end_gX
		* bootargs_root_gX
		* rootpath_gX
		* mvNetConfig_gX
		* mvPhoneConfig_gX		
		
	5.  Example 0:  "amp_config 0 2 0 0x00000000 0x20000000 uart0:pex0:eth0"
	    Example 1:  "amp_config 1 2 2 0x20000000 0x20000000 uart1:pex2:eth1:nand"
		setenv image_name    uImage_g0
		setenv image_name_g1 uImage_g1
		setenv ipaddr		 X.X.X.X
		setenv ipaddr_g1	 Y.Y.Y.Y
		setenv rootpath          <root path to NFS>
		setenv rootpath_gX       <root path to NFS for gX>
		
		
	6. Keep the following constraints: 
		6.1 cpu 0 must be part of group 0
	 	6.2 No resource (e.g. eth0) can be allocated to both groups at the same time.
	7. To view the derived env variables run "amp_printenv". you can change individul values using setenv
	8. To verify that the amp configuration is valid run "amp_verify"
	9. Save the env variables using saveenv
	10. Boot both AMP groups run "amp_boot"
	
NOTE: power managment must be disabled when running in AMP mode on both groups.

15.  Procedure for Porting a new Customer Board:
================================================
The following are the steps for porting a new customer board to the Marvell LSP:

    o Add the Board Specific configuration definitions:
	File location:
	~/arch/arm/mach-armadaxp/armada_xp_family/boardEnv/mvBoardEnvSpec.h

	- MPP pin configuration. Each pin is represented by a nibble. Refer the
	  SoC Datasheet for detailed information about the options and values
	  per pin.
	    
	- MPP pin level (default level, high or low) if the MPP pin is a GPIO
	  and configured to output.

    o Add the Board Specific configuration tables:
	File location:
	~/arch/arm/mach-armadaxp/armada_xp_family/boardEnv/mvBoardEnvSpec.c

	The following configuration options are listed in the order they are
	presented in the "MV_BOARD_INFO" structure.

	- boardName: Set the board name string. This is displayed by both Uboot and Linux
	  during the boot process.

	- pBoardMppConfigValue (MV_BOARD_MPP_INFO): This structure arranges the MPP pins
	  configuration. This is usually not modified.
	  
	- pBoardSerdesConfigValue: this structure reflect the value to be written to the
  	   shared serdes 0-7 selectors register, and the shared serdes 8-15 selectors register
	   in addition to the desired configuration mode of the PEX interfaces.
	  refer to the serdes section of the functional specification for configuration
	  options and consideration 
	- intsGppMask: Select MPP pins that are supposed to operate as
	  interrupt lines.	  
	  intsGppMaskLow	- maps of the register that controls the interrupt to the lower 32 GPIO lines.
	  intsGppMaskMid	- maps of the register that controls the interrupt to the mid 32 GPIO lines.
	  intsGppMaskHigh	- maps of the register that controls the interrupt to the highest 32 GPIO lines.
			
	- pDevCsInfo (MV_DEV_CS_INFO):Specify the devices connected on the device bus 
	  with the Chip select configuration.

	- pBoardTwsiDev (): List of I2C devices connected on the TWSI
	  interface with the device ID Addressing mode (10 or 7 bit).
	  
	- pBoardMacInfo (MV_BOARD_MAC_INFO): Specifies the MAC speed and the Phy address
  	  per Ethernet interface.

	- pBoardGppInfo (): List of MPP pins configured as GPIO pins with special functionality.

	- pLedGppPin (MV_U8): array of the MPP pins connected to LEDs.

	- ledsPolarity: Bitmap specifying the MPP pins to be configured with
	  reverse polarity.

	- gppOutEnVal: This is usually defined in the mvCustomerBoardEnv.h
	  specifying the direction of all MPP pins.
	  gppOutEnValMid  - this filed specifies the direction of the lowest 32 MPP pins directions.
	  gppOutEnValHigh - this filed specifies the direction of the mid 32 MPP pins directions.
	  gppOutEnValLow  - this filed specifies the direction of the rest of the MPP pins.
	 

    o Note: memory map is located in  /arch/arm/mach-armadaxp/sysmap.c  in the MEM_TABLE, this is a static mapping of the internal register to virtual address. No need to change this table for typical use.
	
