summaryrefslogtreecommitdiffstats
path: root/cfe/cfe/applets
diff options
context:
space:
mode:
authorroot <root@lamia.panaceas.james.local>2015-12-19 13:13:57 +0000
committerroot <root@lamia.panaceas.james.local>2015-12-19 14:18:03 +0000
commit1a2238d1bddc823df06f67312d96ccf9de2893cc (patch)
treec58a3944d674a667f133ea5a730f5037e57d3d2e /cfe/cfe/applets
downloadbootloader-1a2238d1bddc823df06f67312d96ccf9de2893cc.tar.gz
bootloader-1a2238d1bddc823df06f67312d96ccf9de2893cc.tar.bz2
bootloader-1a2238d1bddc823df06f67312d96ccf9de2893cc.zip
CFE from danitool [without hostTools dir]: https://mega.nz/#!mwZyFK7a!CPT3BKC8dEw29kubtdYxhB91G9vIIismTkgzQ3iUy3k
Diffstat (limited to 'cfe/cfe/applets')
-rw-r--r--cfe/cfe/applets/Makefile64
-rw-r--r--cfe/cfe/applets/README21
-rw-r--r--cfe/cfe/applets/cfe_applet.lds37
-rw-r--r--cfe/cfe/applets/download.c163
-rw-r--r--cfe/cfe/applets/download.lds12
-rw-r--r--cfe/cfe/applets/minicrt0.S95
-rw-r--r--cfe/cfe/applets/test.c211
-rw-r--r--cfe/cfe/applets/vapitest.S96
8 files changed, 699 insertions, 0 deletions
diff --git a/cfe/cfe/applets/Makefile b/cfe/cfe/applets/Makefile
new file mode 100644
index 0000000..42e1e4f
--- /dev/null
+++ b/cfe/cfe/applets/Makefile
@@ -0,0 +1,64 @@
+
+CFG_MLONG64=0
+
+CFE_DIRS = ../include ../arch/mips/cpu/sb1250/include ../lib ../verif ../api
+CFE_INCLUDES = $(patsubst %,-I%,$(subst :, ,$(CFE_DIRS)))
+
+VPATH = $(CFE_DIRS)
+
+INCLUDES = -I. $(CFE_INCLUDES)
+COMFLAGS = -g -c -mcpu=sb1 -ffreestanding
+CFLAGS = $(INCLUDES) $(COMFLAGS) -O -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes -G 0 -DCFE_API_ALL
+
+GCC = $(TOOLS)sb1-elf-gcc
+GLD = $(TOOLS)sb1-elf-ld
+OBJCOPY = $(TOOLS)sb1-elf-objcopy
+
+ifeq (${CFG_MLONG64},1)
+CFLAGS += -mlong64 -D__long64
+endif
+
+LDFLAGS = --script cfe_applet.lds -g
+
+ifeq (CFG_LITTLE,1)
+CFLAGS += -EL
+LDFLAGS += -EL
+else
+CFLAGS += -EB
+LDFLAGS += -EB
+endif
+
+
+%.o : %.c
+ $(GCC) $(CFLAGS) -o $@ $<
+
+%.o : %.S
+ $(GCC) $(CFLAGS) -o $@ $<
+
+
+LIBOBJS = lib_printf.o lib_string.o cfe_api.o
+
+all : test vapitest
+ echo done
+
+test : test.o minicrt0.o $(LIBOBJS)
+ $(GLD) -o test.elfraw -Map test.mapraw $(LDFLAGS) minicrt0.o test.o $(LIBOBJS)
+ $(GLD) -o test.elf -Ttext 0x20000000 -Map test.map $(LDFLAGS) minicrt0.o test.o $(LIBOBJS)
+ $(OBJCOPY) -O binary test.elfraw test
+ $(OBJCOPY) -O srec test.elfraw test.srec
+
+download : download.o minicrt0.o $(LIBOBJS)
+ $(GLD) -o download.elf -Ttext 0x80001000 -Map download.map $(LDFLAGS) minicrt0.o download.o $(LIBOBJS)
+ $(OBJCOPY) --strip-unneeded download.elf s.download.elf
+ gzip --best -c s.download.elf > download.elf.gz
+ $(GLD) -Tdownload.lds -bbinary -o download.data download.elf.gz
+
+vapitest : vapitest.o
+ $(GLD) -o vapitest -Ttext 0x80020000 -Map vapitest.map vapitest.o
+ $(OBJCOPY) -O srec vapitest vapitest.srec
+
+clean :
+ rm -f *.o *~ *.map *.mapraw
+ rm -f test test.elf test.srec test.elfraw
+ rm -f *download.elf *.gz
+ rm -f vapitest vapitest.srec
diff --git a/cfe/cfe/applets/README b/cfe/cfe/applets/README
new file mode 100644
index 0000000..b622997
--- /dev/null
+++ b/cfe/cfe/applets/README
@@ -0,0 +1,21 @@
+
+This directory contains "applets" - simple programs to let
+us test the callbacks into CFE.
+
+You should be able to compile these programs and load them
+via the TFTP loader in CFE, and when run, they will call
+the APIs in CFE to display messages and such.
+
+The files cfe_api.c, cfe_api.h, and cfe_api_int.h are versions
+of the same files from ../applets, customized to build with this
+stand-alone build environment. Typically you won't want to copy
+these. Instead, you'll want to copy the versions in ../applets and
+customize them as needed.
+
+Pay particular attention to the MIPS calling conventions
+you are using. In particular, CFE uses 64-bit register
+values. If you compile your program with -mips1 or -mips2,
+the 64-bit arguments will be passed as 2 32-bt registers.
+
+In most cases, CFE only uses the lower 32 bits, since
+it can be called from either 32 or 64-bit applications.
diff --git a/cfe/cfe/applets/cfe_applet.lds b/cfe/cfe/applets/cfe_applet.lds
new file mode 100644
index 0000000..e1b33e9
--- /dev/null
+++ b/cfe/cfe/applets/cfe_applet.lds
@@ -0,0 +1,37 @@
+OUTPUT_ARCH(mips)
+ENTRY(__start)
+SECTIONS
+{
+ . = 0x20000000;
+/* . = 0x81000000; */
+ .text :
+ {
+ _ftext = . ;
+ *(.init)
+ eprol = .;
+ *(.text)
+ *(.fini)
+ *(.rodata)
+ _etext = .;
+ }
+
+ .data :
+ {
+ _gp = ALIGN(16) + 0x8000;
+ _fdata = . ;
+ *(.data)
+ CONSTRUCTORS
+ *(.sdata)
+ }
+ _edata = .;
+ _fbss = .;
+ .sbss : {
+ *(.sbss)
+ *(.scommon)
+ }
+ .bss : {
+ *(.bss)
+ *(COMMON)
+ }
+ _end = .;
+}
diff --git a/cfe/cfe/applets/download.c b/cfe/cfe/applets/download.c
new file mode 100644
index 0000000..911c649
--- /dev/null
+++ b/cfe/cfe/applets/download.c
@@ -0,0 +1,163 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * Null device mode driver File: download.c
+ *
+ * Small program (placeholder) to download to a 1250 in PCI Device Mode
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+#include "lib_types.h"
+#include "lib_printf.h"
+#include "lib_string.h"
+#include "cfe_api.h"
+
+int conhandle;
+
+
+void appletmain(long handle,long vector,
+ long reserved,long seal);
+
+
+
+
+/* *********************************************************************
+ * console_write(buffer,length)
+ *
+ * Write text to the console. If the console is not open and
+ * we're "saving" text, put the text on the in-memory queue
+ *
+ * Input parameters:
+ * buffer - pointer to data
+ * length - number of characters to write
+ *
+ * Return value:
+ * number of characters written or <0 if error
+ ********************************************************************* */
+
+static int console_write(unsigned char *buffer,int length)
+{
+ int res;
+
+ /*
+ * Do nothing if no console
+ */
+
+ if (conhandle == -1) return -1;
+
+ /*
+ * Write text to device
+ */
+
+ for (;;) {
+ res = cfe_write(conhandle,buffer,length);
+ if (res < 0) break;
+ buffer += res;
+ length -= res;
+ if (length == 0) break;
+ }
+
+ if (res < 0) return -1;
+ return 0;
+}
+
+
+/* *********************************************************************
+ * console_xprint(str)
+ *
+ * printf callback for the console device. the "xprintf"
+ * routine ends up calling this. This routine also cooks the
+ * output, turning "\n" into "\r\n"
+ *
+ * Input parameters:
+ * str - string to write
+ *
+ * Return value:
+ * number of characters written
+ ********************************************************************* */
+
+static int console_xprint(const char *str)
+{
+ int count = 0;
+ int len;
+ const char *p;
+
+ /* Convert CR to CRLF as we write things out */
+
+ while ((p = strchr(str,'\n'))) {
+ console_write((char *) str,p-str);
+ console_write("\r\n",2);
+ count += (p-str);
+ str = p + 1;
+ }
+
+ len = strlen(str);
+ console_write((char *) str, len);
+ count += len;
+
+ return count;
+}
+
+
+void appletmain(long handle,long vector,
+ long ept,long seal)
+{
+ void (*reboot)(void) = (void *) (uintptr_t) (int) 0xBFC00000;
+ char str[100];
+
+ xprinthook = console_xprint;
+
+ cfe_init(handle,ept);
+
+ conhandle = cfe_getstdhandle(CFE_STDHANDLE_CONSOLE);
+
+ str[0] = 0;
+ cfe_getenv("BOOT_CONSOLE",str,sizeof(str));
+
+ xprintf("\nHello, world. Console = %s\n",str);
+
+ xprintf("\nThis is a null device driver that just restarts CFE\n");
+ xprintf("Rebuild the host's CFE to replace it with your driver.\n\n");
+
+ xprintf("Exiting to CFE\n\n");
+
+ cfe_exit(CFE_FLG_WARMSTART,0);
+
+ (*reboot)();
+}
diff --git a/cfe/cfe/applets/download.lds b/cfe/cfe/applets/download.lds
new file mode 100644
index 0000000..7f6e6be
--- /dev/null
+++ b/cfe/cfe/applets/download.lds
@@ -0,0 +1,12 @@
+OUTPUT_FORMAT("elf32-bigmips")
+OUTPUT_ARCH("mipssb1")
+
+SECTIONS
+{
+ .rodata :
+ {
+ download_start = .;
+ *(.data);
+ download_end = .;
+ }
+}
diff --git a/cfe/cfe/applets/minicrt0.S b/cfe/cfe/applets/minicrt0.S
new file mode 100644
index 0000000..937f240
--- /dev/null
+++ b/cfe/cfe/applets/minicrt0.S
@@ -0,0 +1,95 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * Mini startup module for CFE apps File: minicrt0.S
+ *
+ * About the most minimal startup routine you can get.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+#include "sbmips.h"
+
+/*
+ * This module should be linked first!
+ */
+
+#define STACK_SIZE 8192
+
+ .bss
+ .comm stack_bottom,STACK_SIZE
+ .comm __junk,4
+
+ .text
+
+ .extern appletmain
+ .globl __start
+
+__start:
+
+ /*
+ * Set up our GP (in case we're using it)
+ * Set up the stack pointer (don't use CFE's stack)
+ */
+
+ la gp,_gp
+ la sp,stack_bottom+STACK_SIZE-32
+
+ /*
+ * Zero BSS. No need to do this very efficiently, do it
+ * 32 bits at a time to ensure we can compile this
+ * with -mips1.
+ */
+
+ la t0,_fbss
+ la t1,_end
+
+1: sw zero,0(t0)
+ add t0,4
+ blt t0,t1,1b
+
+ /*
+ * Jump to main program. Note that we didn't trash A0..A3,
+ * our application will need them. So, if you add stuff here,
+ * be sure to preserve the A0..A3 registers for the C code.
+ */
+
+ j appletmain
+
diff --git a/cfe/cfe/applets/test.c b/cfe/cfe/applets/test.c
new file mode 100644
index 0000000..9122456
--- /dev/null
+++ b/cfe/cfe/applets/test.c
@@ -0,0 +1,211 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * API test program File: test.c
+ *
+ * Small program to test CFE's external API
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+#include "lib_types.h"
+#include "lib_printf.h"
+#include "lib_string.h"
+#include "cfe_api.h"
+
+int conhandle;
+
+
+void appletmain(unsigned long handle,unsigned long vector,
+ unsigned long reserved,unsigned long seal);
+
+
+
+
+/* *********************************************************************
+ * console_write(buffer,length)
+ *
+ * Write text to the console. If the console is not open and
+ * we're "saving" text, put the text on the in-memory queue
+ *
+ * Input parameters:
+ * buffer - pointer to data
+ * length - number of characters to write
+ *
+ * Return value:
+ * number of characters written or <0 if error
+ ********************************************************************* */
+
+static int console_write(unsigned char *buffer,int length)
+{
+ int res;
+
+ /*
+ * Do nothing if no console
+ */
+
+ if (conhandle == -1) return -1;
+
+ /*
+ * Write text to device
+ */
+
+ for (;;) {
+ res = cfe_write(conhandle,buffer,length);
+ if (res < 0) break;
+ buffer += res;
+ length -= res;
+ if (length == 0) break;
+ }
+
+ if (res < 0) return -1;
+ return 0;
+}
+
+
+/* *********************************************************************
+ * console_xprint(str)
+ *
+ * printf callback for the console device. the "xprintf"
+ * routine ends up calling this. This routine also cooks the
+ * output, turning "\n" into "\r\n"
+ *
+ * Input parameters:
+ * str - string to write
+ *
+ * Return value:
+ * number of characters written
+ ********************************************************************* */
+
+static int console_xprint(const char *str)
+{
+ int count = 0;
+ int len;
+ const char *p;
+
+ /* Convert CR to CRLF as we write things out */
+
+ while ((p = strchr(str,'\n'))) {
+ console_write((char *) str,p-str);
+ console_write("\r\n",2);
+ count += (p-str);
+ str = p + 1;
+ }
+
+ len = strlen(str);
+ console_write((char *) str, len);
+ count += len;
+
+ return count;
+}
+
+
+#if 0
+static int myxprinthook(const char *str)
+{
+ int count = 0;
+ int len;
+ const char *p;
+
+ /* Convert CR to CRLF as we write things out */
+
+ while ((p = strchr(str,'\r'))) {
+ cfe_write(conhandle,(char *) str,p-str+1);
+ cfe_write(conhandle,"\n",1);
+ count += (p-str);
+ str = p + 1;
+ }
+
+ len = strlen(str);
+ cfe_write(conhandle,(char *) str, len);
+ count += len;
+
+ return count;
+}
+#endif
+
+void appletmain(unsigned long handle,unsigned long vector,
+ unsigned long ept,unsigned long seal)
+{
+ void (*reboot)(void) = (void *) (uintptr_t) (int) 0xBFC00000;
+ char str[100];
+ cfe_fwinfo_t info;
+ int idx;
+ int res;
+ uint64_t start,length,type;
+
+ xprinthook = console_xprint;
+
+ cfe_init(handle,ept);
+
+ conhandle = cfe_getstdhandle(CFE_STDHANDLE_CONSOLE);
+
+ str[0] = 0;
+ cfe_getenv("BOOT_CONSOLE",str,sizeof(str));
+
+ xprintf("Hello, world. Console = %s\n",str);
+ xprintf("API Seal = %08X\n",(int)seal);
+ xprintf("Entrypoint=%08X Handle=%08X\n",(int)ept,(int)handle);
+ idx = 0;
+
+ cfe_getfwinfo(&info);
+ xprintf("CFE version: %08llX\n",info.fwi_version);
+ xprintf("Flags: %08llX\n",info.fwi_flags);
+ xprintf("Total memory: %08llX\n",info.fwi_totalmem);
+ xprintf("Board ID: %08llX\n",info.fwi_boardid);
+ xprintf("Bootarea VA: %08llX\n",info.fwi_bootarea_va);
+ xprintf("Bootarea PA: %08llX\n",info.fwi_bootarea_pa);
+ xprintf("Bootarea Size: %08llX\n",info.fwi_bootarea_size);
+
+ xprintf("Memory map:\n");
+ for (;;) {
+ if ((res = cfe_enummem(idx,1,&start,&length,&type) != 0)) break;
+ xprintf("Memory at %016llX length %016llX type %ld\n",
+ start,length,type);
+ idx++;
+ }
+
+ xprintf("Exiting to CFE\n\n");
+
+ cfe_exit(CFE_FLG_WARMSTART,0);
+
+ (*reboot)();
+
+}
diff --git a/cfe/cfe/applets/vapitest.S b/cfe/cfe/applets/vapitest.S
new file mode 100644
index 0000000..a57a563
--- /dev/null
+++ b/cfe/cfe/applets/vapitest.S
@@ -0,0 +1,96 @@
+/* *********************************************************************
+ * Broadcom Common Firmware Environment (CFE)
+ *
+ * Verification Test APIs File: vapitest.S
+ *
+ * This module contains special low-level routines for use
+ * by verification programs.
+ *
+ * Author: Mitch Lichtenberg (mpl@broadcom.com)
+ *
+ *********************************************************************
+ *
+ * Copyright 2000,2001,2002,2003
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and
+ * copied only in accordance with the following terms and
+ * conditions. Subject to these conditions, you may download,
+ * copy, install, use, modify and distribute modified or unmodified
+ * copies of this software in source and/or binary form. No title
+ * or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce
+ * and retain this copyright notice and list of conditions
+ * as they appear in the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or
+ * logo of Broadcom Corporation. The "Broadcom Corporation"
+ * name may not be used to endorse or promote products derived
+ * from this software without the prior written permission of
+ * Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
+ * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
+ * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ ********************************************************************* */
+
+
+#include "sbmips.h"
+
+
+#include "vapi.h"
+
+/* *********************************************************************
+ * Constants
+ ********************************************************************* */
+ .text
+
+LEAF(_start)
+
+ VAPI_LOG_SETBUF(0x80030000,0x80040000)
+
+
+ VAPI_LOG_CONST(0x100,0xABCDEF)
+ VAPI_LOG_REG(0x101,sp)
+ VAPI_LOG_BUFFER(0x102,testbuf,10)
+ VAPI_PUTS("Hello world.\n")
+ VAPI_LOG_SOCSTATE(0x103,SOC_AGENT_DUART)
+ VAPI_PRINTGPRS();
+ VAPI_LOG_CONST(0x1EE,0xEEEEEEEE)
+ VAPI_LOG_GPRS(0x199)
+ VAPI_SETLEDS('V','A','P','I')
+
+ VAPI_EXIT_CONST(0)
+
+
+END(_start)
+
+testbuf: .dword 0x123456789ABCDEF0
+ .dword 0xAABBCCDD
+ .dword 0xAABBCCDD
+ .dword 0xAABBCCDD
+ .dword 0xAABBCCDD
+ .dword 0xAABBCCDD
+ .dword 0xAABBCCDD
+ .dword 0xAABBCCDD
+ .dword 0xAABBCCDD
+ .dword 0xFEDCBA9876543210
+
+
+
+/* *********************************************************************
+ * End
+ ********************************************************************* */
+
+