/*
 ******************************************************************************
 * Copyright (c) 2011 Marvell International, Ltd. All Rights Reserved
 *
 *                         Marvell Confidential
 ******************************************************************************
 *
 *  Portions of this may contain copyrighted or confidential materials from
 *  Marvell and/or Marvell's suppliers. Copying and distribution of such
 *  materials for any other purpose except in conjunction with a Marvell
 *  Product, is expressly prohibited.
 *   
 *  DISCLAIMER OF WARRANTIES. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE
 *  LAW, THE SOURCE CODE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND.
 *  MARVELL AND ITS SUPPLIERS DISCLAIM ANY WARRANTY OR OBLIGATION TO PROVIDE
 *  SUPPORT, UPDATES OR BUG FIXES FOR THE SOURCE CODE. NEITHER MARVELL NOR ITS
 *  SUPPLIERS MAKE ANY WARRANTY AS TO THE ACCURACY, SUFFICIENCY OR SUITABILITY
 *  FOR ANY PURPOSES WHAT-SO-EVER OF THE SOURCE CODE. NEITHER MARVELL NOR ITS
 *  SUPPLIERS MAKE ANY WARRANTIES OR REPRE-SENTATIONS HEREUNDER, WHETHER
 *  EXPRESS OR IMPLIED, EITHER IN FACT OR BY OPERATION OF LAW, STATUTORY OR
 *  OTHERWISE, INCLUDING, WITHOUT LIMITATION, WARRANTIES, TERMS OR CONDITIONS
 *  OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, SATISFACTORY QUALITY,
 *  CORRESPONDENCE WITH DESCRIPTION, QUIET ENJOYMENT OR NON-INFRINGEMENT OF
 *  THIRD PARTY INTELLECTUAL PROPERTY RIGHTS.
 *  
 ******************************************************************************
*/

The upc_tools directory contains simple upc programming samples.

To build the upc sample code, run build.sh (see ***NOTE*** below
before building).  This creates 5 arm-executable files:
upc_start_stop, upctalk0.bin,upctalk1.bin, upc_uart.bin, upc_wait.bin

The upctalk0.bin, upctalk1.bin, upc_uart.bin, and upc_wait,bin files are
programs that run on the upc processors.

The upc_start_stop file is a program that runs on the main ARM
processor and communicates with the upc processors.

(note that at this point you build and download the entire system
as you normally do to get this code onto the target device, along with the rest
of the system).

When you are running on the target, first install the upc kernel module:
  modprobe upc

Then write the arm executables to the appropriate upc processor:
  cd /tools

  cat upctalk0.bin > /dev/upc0
  cat upctalk1.bin > /dev/upc1

            or

  cat upc_uart.bin > /dev/upc0
  cat upc_wait.bin > /dev/upc1

Then execute the ARM program:
  ./upc_start_stop -o start

You should now observe the 2 upc processors running.  The upctalk
proccesses alternate outputing their status on Uart0, while the upc_uart
process receives and transmits on Uart3, while outputing any debug
information to Uart0.

NOTE: Both UPCs must be loaded with code!  The upc_wait process simply
puts UPC1 to sleep indefinetly.

To stop the upc programs from running:
  ./upc_start_stop -o stop

***NOTE*** that the build script assumes you have the eabi compiler installed
(e.g. arm-marvell-eabi-linux-2009q4-9-4.2.0-le.tar.bz2) in the /opt
directory, and that you have created a symbolic link to
/opt/arm-marvell-gcc:
  cd /opt
  ln -s /opt/arm-marvell-eabi arm-marvell-gcc
And that you have this compiler in your PATH:
  export PATH=$PATH:/opt/arm-marvell-gcc/bin

The Marvell gnueabi cross-compiler is used for code that runs under
Linux on the target device.  Since normally code running on the upc is
not running under Linux, the eabi cross-compiler (also known as a
bare-metal compiler) is required to build upc code.

