|
From: Erik M. <er...@us...> - 2001-08-06 22:44:55
|
Update of /cvsroot/blob/blob/include
In directory usw-pr-cvs1:/tmp/cvs-serv26030/include
Modified Files:
Makefile.am flash.h main.h time.h types.h util.h
Added Files:
led.h linux.h memory.h sa1100.h
Log Message:
Here we go: merge the blob_1_0_9_hack branch back into the HEAD branch
Index: led.h
===================================================================
RCS file: led.h
diff -N led.h
--- /dev/null Thu May 24 22:33:05 2001
+++ /tmp/cvs0ZNj3i Mon Aug 6 15:44:54 2001
@@ -0,0 +1,54 @@
+/*
+ * led.h: header file for memory.c
+ *
+ * Copyright (C) 2001 Erik Mouw (J.A...@it...)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#ident "$Id$"
+
+#ifndef BLOB_LED_H
+#define BLOB_LED_H
+
+
+
+
+/* define the GPIO pin for the LED */
+#if defined ASSABET
+# define LED_GPIO 0x00020000 /* GPIO 17 */
+#elif (defined CLART) || (defined LART) || (defined NESA)
+# define LED_GPIO 0x00800000 /* GPIO 23 */
+#elif defined PLEB
+# define LED_GPIO 0x00010000 /* GPIO 16 */
+#else
+#warning "FIXME: Include code to turn on one of the LEDs on your board"
+# define LED_GPIO 0x00000000 /* safe mode: no GPIO, so no LED */
+#endif
+
+
+
+#ifndef ASSEMBLY
+
+void led_on(void);
+void led_off(void);
+void led_toggle(void);
+
+#endif
+
+
+
+#endif
Index: linux.h
===================================================================
RCS file: linux.h
diff -N linux.h
--- /dev/null Thu May 24 22:33:05 2001
+++ /tmp/cvsZtddDk Mon Aug 6 15:44:54 2001
@@ -0,0 +1,58 @@
+/*
+ * linux.h: header file for linux.c
+ *
+ * Copyright (C) 2001 Erik Mouw (J.A...@it...)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#ident "$Id$"
+
+#ifndef BLOB_LINUX_H
+#define BLOB_LINUX_H
+
+
+/* FIXME:
+ * these numbers should be generated from arch/arm/tools/mach-types
+ * with a hacked up version of arch/arm/tools/gen-mach-types
+ *
+ * -- Erik
+ */
+
+#if defined ASSABET
+# define ARCH_NUMBER (25)
+#elif defined BRUTUS
+# define ARCH_NUMBER (16)
+#elif defined CLART
+# define ARCH_NUMBER (68)
+#elif defined LART
+# define ARCH_NUMBER (27)
+#elif defined NESA
+# define ARCH_NUMBER (75)
+#elif defined PLEB
+# define ARCH_NUMBER (20)
+#elif defined SHANNON
+# define ARCH_NUMBER (97)
+#else
+#warning "FIXME: Calling the kernel with a generic SA1100 architecture code. YMMV!"
+#define ARCH_NUMBER (18)
+#endif
+
+
+void boot_linux(char *commandline);
+
+
+#endif
Index: memory.h
===================================================================
RCS file: memory.h
diff -N memory.h
--- /dev/null Thu May 24 22:33:05 2001
+++ /tmp/cvskgolek Mon Aug 6 15:44:54 2001
@@ -0,0 +1,52 @@
+/*
+ * memory.h: header file for memory.c
+ *
+ * Copyright (C) 2001 Erik Mouw (J.A...@it...)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#ident "$Id$"
+
+#ifndef BLOB_MEMORY_H
+#define BLOB_MEMORY_H
+
+#include "types.h"
+
+/* The number of memory areas. Needs to be large to be able to detect
+ * aliases.
+ */
+#define NUM_MEM_AREAS (32)
+
+typedef struct {
+ u32 start;
+ u32 len;
+ int used;
+} memory_area_t;
+
+
+
+
+extern memory_area_t memory_map[NUM_MEM_AREAS];
+
+
+
+void get_memory_map(void);
+
+
+
+
+#endif
Index: sa1100.h
===================================================================
RCS file: sa1100.h
diff -N sa1100.h
--- /dev/null Thu May 24 22:33:05 2001
+++ /tmp/cvsXxzPAj Mon Aug 6 15:44:54 2001
@@ -0,0 +1,37 @@
+/*
+ * sa1100.h: wrapper file to include asm/arch-sa1100/SA-1100.h
+ *
+ * Copyright (C) 2001 Erik Mouw (J.A...@it...)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#ident "$Id$"
+
+#ifndef BLOB_SA1100_H
+#define BLOB_SA1100_H
+
+
+
+
+/* Tell SA-1100.h to shut up; we're including it anyway. Nyah nyah ;-) */
+#define __ASM_ARCH_HARDWARE_H
+#include <asm/arch-sa1100/SA-1100.h>
+
+
+
+
+#endif
Index: Makefile.am
===================================================================
RCS file: /cvsroot/blob/blob/include/Makefile.am,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- Makefile.am 2001/06/27 19:47:41 1.1.1.1
+++ Makefile.am 2001/08/06 22:44:52 1.2
@@ -15,8 +15,12 @@
clock.h \
command.h \
flash.h \
+ led.h \
+ linux.h \
main.h \
+ memory.h \
registers.h \
+ sa1100.h \
serial.h \
time.h \
types.h \
Index: flash.h
===================================================================
RCS file: /cvsroot/blob/blob/include/flash.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- flash.h 2001/06/27 19:47:42 1.1.1.1
+++ flash.h 2001/08/06 22:44:52 1.2
@@ -39,15 +39,17 @@
#define NUM_FLASH_BLOCKS (31)
#define FLASH_BLOCK_BASE ((u32 *) 0x020000)
#define FLASH_BLOCK_SIZE ((u32) 0x020000)
-#define BLOCK_NAME_LEN (64)
-#define NO_BLOCK ((u8) 0xFF)
-#define BLOCK_HDR_SIG ((u32) 'LART')
-#define BLOCK_EMPTY_SIG ((u32) 0xFFFFFFFF)
+#define BLOCK_NAME_LEN (64)
+#define NO_BLOCK ((u8) 0xFF)
+#define BLOCK_HDR_SIG ((u32) 'LART')
+#define BLOCK_EMPTY_SIG ((u32) 0xFFFFFFFF)
#define BLOCK_IN_USE(x) (x.signature == BLOCK_HDR_SIG)
typedef enum {
- blRamdisk, blKernel
+ blBlob,
+ blKernel,
+ blRamdisk
} tBlockType;
static inline int RunningFromInternal(void) {
@@ -61,21 +63,37 @@
#define MAIN_BLOCK_SIZE (32768 * 4)
#define CS0_BASE (0x00000000)
-#define CS1_BASE (0x08000000)
+#define CS1_BASE (0x08000000)
#define INT_FLASH_BASE (RunningFromInternal() ? CS0_BASE : CS1_BASE)
#ifdef ASSABET // Assabet settings come from linux/drivers/block/flash_mem.h
-#define KERNEL_START 0x10000
-#define KERNEL_LEN 0xc0000
+#define BLOB_START 0x00000
+#define BLOB_LEN 0x10000
+#define NUM_BLOB_BLOCKS (BLOB_LEN / MAIN_BLOCK_SIZE)
+#define KERNEL_START 0x10000
+#define KERNEL_LEN 0xc0000
#define NUM_KERNEL_BLOCKS (KERNEL_LEN / MAIN_BLOCK_SIZE)
#define INITRD_START (KERNEL_START + KERNEL_LEN)
#define INITRD_LEN 0x280000
#define NUM_INITRD_BLOCKS (INITRD_LEN / MAIN_BLOCK_SIZE)
+#elif defined SHANNON
+#define BLOB_START (INT_FLASH_BASE)
+#define NUM_BLOB_BLOCKS (1)
+#define BLOB_LEN (NUM_BLOB_BLOCKS * MAIN_BLOCK_SIZE)
+#define KERNEL_START (INT_FLASH_BASE + MAIN_BLOCK_SIZE)
+#define NUM_KERNEL_BLOCKS (7)
+#define KERNEL_LEN (NUM_KERNEL_BLOCKS * MAIN_BLOCK_SIZE)
+#define INITRD_START (KERNEL_START + KERNEL_LEN)
+#define NUM_INITRD_BLOCKS (24)
+#define INITRD_LEN (NUM_INITRD_BLOCKS * MAIN_BLOCK_SIZE)
#else
-#define KERNEL_START (INT_FLASH_BASE + MAIN_BLOCK_SIZE)
+#define BLOB_START (INT_FLASH_BASE)
+#define NUM_BLOB_BLOCKS (1)
+#define BLOB_LEN (NUM_BLOB_BLOCKS * MAIN_BLOCK_SIZE)
+#define KERNEL_START (INT_FLASH_BASE + MAIN_BLOCK_SIZE)
#define NUM_KERNEL_BLOCKS (7)
-#define KERNEL_LEN (NUM_KERNEL_BLOCKS * MAIN_BLOCK_SIZE)
+#define KERNEL_LEN (NUM_KERNEL_BLOCKS * MAIN_BLOCK_SIZE)
#define INITRD_START (KERNEL_START + KERNEL_LEN)
#define NUM_INITRD_BLOCKS (24)
#define INITRD_LEN (NUM_INITRD_BLOCKS * MAIN_BLOCK_SIZE)
Index: main.h
===================================================================
RCS file: /cvsroot/blob/blob/include/main.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- main.h 2001/06/27 19:47:42 1.1.1.1
+++ main.h 2001/08/06 22:44:52 1.2
@@ -34,22 +34,79 @@
#ifndef BLOB_MAIN_H
#define BLOB_MAIN_H
+/* memory start and end */
+#define MEMORY_START (0xc0000000)
+#define MEMORY_END (0xe0000000)
+/* where does blob live when we download it */
+#if defined SHANNON
+#define BLOB_RAM_BASE (0xc0100000)
+#else
+#define BLOB_RAM_BASE (0xc1000000)
+#endif
-#define KERNEL_RAM_BASE (0xC0008000)
+#define BLOB_BLOCK_OFFSET (0x00000000)
-#ifdef ASSABET
-#define RAMDISK_RAM_BASE (0xC0800000)
-#else
-#define RAMDISK_RAM_BASE (0xC0400000)
-#endif
+/* where does the kernel live in RAM */
+#define KERNEL_RAM_BASE (0xC0008000)
+
#define KERNEL_BLOCK_OFFSET (0x00008000)
+
-#ifdef ASSABET
-#define RAMDISK_BLOCK_OFFSET (0x00800000)
+/* where does the ramdisk live in RAM */
+#if defined ASSABET
+# define RAMDISK_RAM_BASE (0xC0800000)
+#elif defined SHANNON
+# define RAMDISK_RAM_BASE (0xC8000000)
#else
-#define RAMDISK_BLOCK_OFFSET (0x00400000)
+# define RAMDISK_RAM_BASE (0xC0400000)
#endif
+
+#if defined ASSABET
+# define RAMDISK_BLOCK_OFFSET (0x00800000)
+#elif defined SHANNON
+# define RAMDISK_BLOCK_OFFSET (0x00200000)
+#else
+# define RAMDISK_BLOCK_OFFSET (0x00400000)
+#endif
+
+/* where does the command block live in memory */
+/* As far as I know all architectures have this at the same address */
+#define BOOT_PARAMS (0xc0000100)
+
+/* the size to which the compressed ramdisk expands */
+#define RAMDISK_SIZE (8 * 1024 * 1024)
+
+
+#include "types.h"
+#include "serial.h"
+
+
+typedef enum {
+ fromFlash = 0,
+ fromDownload = 1
+} block_source_t;
+
+
+typedef struct {
+ int kernelSize;
+ block_source_t kernelType;
+
+ int ramdiskSize;
+ block_source_t ramdiskType;
+
+ int blobSize;
+ block_source_t blobType;
+
+ u32 blockSize;
+
+ eBauds downloadSpeed;
+} blob_status_t;
+
+
+extern blob_status_t blob_status;
+
+
#endif
Index: time.h
===================================================================
RCS file: /cvsroot/blob/blob/include/time.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- time.h 2001/06/27 19:47:42 1.1.1.1
+++ time.h 2001/08/06 22:44:52 1.2
@@ -9,9 +9,9 @@
* Modified at: Tue Sep 28 23:44:11 1999
*-----------------------------------------------------------------------*/
/*
- * timer.c: Timer functions for blob
+ * time.h: header file for time.c
*
- * Copyright (C) 1999 Erik Mouw (J.A...@it...)
+ * Copyright (C) 1999 2000 2001 Erik Mouw (J.A...@it...)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -42,17 +42,22 @@
-#define TICKS_PER_SECOND 32768
+#define TICKS_PER_SECOND 3686400
-
/* initialise timer */
void TimerInit(void);
-/* returns the time in 1/32768 seconds */
+/* returns the time in 1/TICKS_PER_SECOND seconds */
u32 TimerGetTime(void);
+int TimerDetectOverflow(void);
+
+void TimerClearOverflow(void);
+
+/* suspend execution for interval of milliseconds */
+void msleep(unsigned int msec);
Index: types.h
===================================================================
RCS file: /cvsroot/blob/blob/include/types.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- types.h 2001/06/27 19:47:42 1.1.1.1
+++ types.h 2001/08/06 22:44:52 1.2
@@ -34,21 +34,15 @@
#ifndef BLOB_TYPES_H
#define BLOB_TYPES_H
-
-
-
typedef unsigned long u32;
typedef unsigned short u16;
typedef unsigned char u8;
-
+/* number of nibbles in a word */
+#define NIBBLES_PER_WORD (8)
-
#ifndef NULL
#define NULL (void *)0
#endif
-
-
-
#endif
Index: util.h
===================================================================
RCS file: /cvsroot/blob/blob/include/util.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- util.h 2001/06/27 19:47:42 1.1.1.1
+++ util.h 2001/08/06 22:44:52 1.2
@@ -45,4 +45,7 @@
int MyToUpper(int c);
int MyToLower(int c);
+int strlen(const char *s);
+char *strcpy(char *dest, const char *src);
+
#endif
|