|
From: Stefan E. <se...@us...> - 2003-04-11 21:24:16
|
Update of /cvsroot/blob/blob/src/blob
In directory sc8-pr-cvs1:/tmp/cvs-serv3541
Modified Files:
dafit.c
Log Message:
- init GPIO levels properly for DAFIT
Index: dafit.c
===================================================================
RCS file: /cvsroot/blob/blob/src/blob/dafit.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- dafit.c 3 Apr 2003 15:02:58 -0000 1.1
+++ dafit.c 11 Apr 2003 21:24:12 -0000 1.2
@@ -61,15 +61,6 @@
* defines
*/
-#if 0
-#define CONFIG_PCMCIA_SUPPORT
-#define CONFIG_BLOB_PARTITION
-#define CONFIG_GIO_RAM
-#define CONFIG_GIO_FLASH
-#define CONFIG_GIO_BLOB_PARTITION
-#define CONFIG_CMD_SYSUPDATE
-#endif
-
/* more readable IMHO */
#define MEM( x ) (*((u32 *)(x)))
#define SET(reg,bit) ((reg) |= (1<<(bit)))
@@ -93,7 +84,7 @@
* module globals
*/
-#if SYSTEM3_DEBUG
+#if DAFIT_DEBUG
static int dbg = 1;
#else
static int sys3_dbg = 0;
@@ -101,7 +92,7 @@
/* flash descriptor for System3 flash. */
/* System 3 uses 2xINTEL e28F640 Chips */
-static const flash_descriptor_t system3_flash_descriptors[] =
+static const flash_descriptor_t dafit_flash_descriptors[] =
{
{
size: 2 * 128 * 1024,
@@ -113,8 +104,7 @@
},
};
-#if defined(CONFIG_BLOB_PARTITION)
-/* default partition table for SYSTEM3
+/* default partition table for DAFIT
System3 flash layout
~~~~~~~~~~~~~~~~~~~~
@@ -131,13 +121,13 @@
0x01000000 total 16M
Note:
- - system3 partitions are named like the files they're flashed
+ - dafit partitions are named like the files they're flashed
with. This is to keep updating easy: Just loop through all
files that are on our update media and flash them on the partition
named like the file.
*/
-static const blob_partition_t system3_default_partition_table[] = {
+static const blob_partition_t dafit_default_partition_table[] = {
{
/* start of table */
magic: BLOB_DEFAULT_PART_TABLE_MAGIC,
@@ -207,7 +197,6 @@
magic: BLOB_PART_LAST_MAGIC
}
};
-#endif
/**********************************************************************
* static functions
@@ -215,29 +204,46 @@
static char module_version[] = "$Id$";
/*********************************************************************
- * init_system3_flash - inits system 3 flash driver
+ * init_dafit_flash - inits system 3 flash driver
*/
-static void init_system3_flash_driver(void)
+static void init_dafit_flash_driver(void)
{
- flash_descriptors = system3_flash_descriptors;
+ flash_descriptors = dafit_flash_descriptors;
flash_driver = &intel32_flash_driver;
}
-__initlist(init_system3_flash_driver, INIT_LEVEL_DRIVER_SELECTION);
+__initlist(init_dafit_flash_driver, INIT_LEVEL_DRIVER_SELECTION);
/*********************************************************************
- * system3_init_hardware - inits system 3 LL hardware stuff
+ * dafit_init_hardware - inits system 3 LL hardware stuff
*/
-static void system3_init_hardware(void)
+static void dafit_init_hardware(void)
{
/* init on-board CPLD */
- MEM(SYSTEM3_CTRL_0) = 0x03;
- MEM(SYSTEM3_CTRL_1) = 0x00;
- MEM(SYSTEM3_CTRL_2) = 0x00;
+ MEM(DAFIT_CTRL_0) = 0x03;
+ MEM(DAFIT_CTRL_1) = 0x00;
+ MEM(DAFIT_CTRL_2) = 0x00;
/* initialize GPIO states */
- GPDR = 0x0f35a7fc;
- GPSR |= GPIO_GPIO15 | GPIO_GPIO20; /* 15: core fast, 20: SCL */
- GPCR |= 0x070527fc;
+ GPDR = 0x0ffdbb80;
+ GPSR |=
+ GPIO_GPIO13 |
+ GPIO_GPIO15 |
+ GPIO_GPIO26;
+ GPCR |=
+ GPIO_GPIO7 |
+ GPIO_GPIO8 |
+ GPIO_GPIO9 |
+ GPIO_GPIO11 |
+ GPIO_GPIO12 |
+ GPIO_GPIO16 |
+ GPIO_GPIO18 |
+ GPIO_GPIO19 |
+ GPIO_GPIO20 |
+ GPIO_GPIO21 |
+ GPIO_GPIO22 |
+ GPIO_GPIO23 |
+ GPIO_GPIO24 |
+ GPIO_GPIO25;
/* activate SYSCLCK for keyboard controller */
RST( MEM(TUCR), 31 );
@@ -249,7 +255,7 @@
msleep( 1 );
- MEM(SYSTEM3_CTRL_1) = 0x04;
+ MEM(DAFIT_CTRL_1) = 0x04;
/* tweak blob config */
blob_status.boot_delay = 1;
@@ -259,16 +265,15 @@
serial_driver = &sa11x0_serial_driver;
led_driver = &sa11x0_gpio_led_driver;
}
-__initlist(system3_init_hardware, INIT_LEVEL_DRIVER_SELECTION);
+__initlist(dafit_init_hardware, INIT_LEVEL_DRIVER_SELECTION);
-#if defined(CONFIG_BLOB_PARTITION)
/**********************************************************************
- * system3 default partition table
+ * dafit default partition table
*/
-static void system3_set_partition_table(void)
+static void dafit_set_partition_table(void)
{
/* the default partition table */
- default_partition_table = system3_default_partition_table;
+ default_partition_table = dafit_default_partition_table;
/* we don't know where the flash partition table will live, so
* put the pointer at 0x0000000 and let the partition table
@@ -277,10 +282,9 @@
flash_partition_table = (blob_partition_t*)0x00000000;
}
-__initlist(system3_set_partition_table, INIT_LEVEL_OTHER_STUFF);
+__initlist(dafit_set_partition_table, INIT_LEVEL_OTHER_STUFF);
/* FIXME: need to think if this is the correct init level, we might
* want to have this before the param list stuff starts running */
-#endif
/*****************************************************************
@@ -307,7 +311,7 @@
printf( " revision 0x%02X.\n", PT_ID_REVISION );
return 0;
}
-static char sysver_help[] = "print BLOB and system3 version number\n";
+static char sysver_help[] = "print BLOB and dafit version number\n";
__commandlist(sysver_cmd, "sysver", sysver_help);
/**********************************************************************
@@ -357,7 +361,7 @@
*/
int pcmcia_init()
{
- printf( "PT Digital Board PCMCIA init\n" );
+ printf( "PT VibXpert CF init\n" );
return 0;
}
#endif
@@ -414,121 +418,3 @@
char bootp_help[] = "bootp test command. No args.\n";;
__commandlist(bootp_cmd, "net_bootp", bootp_help);
-int arp_cmd(int argc, char *argv[])
-{
- int ret = 0;
- extern int do_arp( u8 *, u8 *);
- u8 serverip[4] = { 192, 168, 1, 11 };
- u8 servereth[6];
-
- ret = smc_init( 0x18000000 );
- if ( ret ) {
- printf( "smc_init failed: %d\n", ret );
- return ret;
- }
-
- ret = do_arp( servereth, serverip );
-
- printf( "%s: got eth addr %02x:%02x:%02x:%02x:%02x:%02x\n", __FUNCTION__,
- servereth[0], servereth[1], servereth[2], servereth[3], servereth[4],
- servereth[5] );
-
- return 0;
-}
-char arp_help[] = "arp test command. No args.\n";;
-__commandlist(arp_cmd, "arp", arp_help);
-
-
-int setip_cmd( int argc, char *argv[] )
-{
- extern u8 clientipaddress[4];
- extern u8 serveripaddress[4];
- u8 *ip;
- char *ptr, *num;
- int i, fini;
-
- if ( argc < 3 )
- return -EINVAL;
-
- switch ( argv[1][0] ) {
- case 'c':
- case 'C':
- ip = clientipaddress;
- break;
- case 's':
- case 'S':
- ip = serveripaddress;
- break;
- default:
- return -EINVAL;
- break;
- }
-
- num = ptr = argv[2];
- fini=0;
- for ( i=0; i<4 || !fini; i++ ) {
- u32 n;
-
- while ( *ptr != '\0' && *ptr != '.' )
- ptr++;
-
- if ( *ptr == '\0' )
- fini = 1;
-
- *ptr = 0;
-
- strtou32( num, &n );
- ip[i]=n;
-
- num = ++ptr;
- }
-
- if ( fini && i<4 ) {
- printf( "error parsing ip.\n" );
- return -EINVAL;
- }
-
- printf( "Set IP to %d.%d.%d.%d\n",
- ip[0], ip[1], ip[2], ip[3] );
-
- return 0;
-}
-char setip_help[] = "setip command. Set IP addresses for tftp.\n"
-"usage: setip {client|server} ip\n"
-"\tip in usual dotted-quad format please.\n";;
-__commandlist(setip_cmd, "setip", setip_help);
-
-int tftp_cmd(int argc, char *argv[])
-{
- int ret = 0;
- extern int do_tftp(char *file, unsigned long addr, unsigned long *size);
- unsigned long size = 0;
- char *tftp_file = "update.tar";
-
- if ( argc>1 ) {
- tftp_file = argv[1];
- } else {
- printf( "No filename given, using '%s'\n",
- tftp_file );
- }
-
- ret = smc_init( 0x18000000 );
- if ( ret ) {
- printf( "smc_init failed: %d\n", ret );
- return ret;
- }
-
- ret = do_tftp( tftp_file, RAM_START, &size );
- if ( ret ) {
- return -EINVAL;
- }
-
- printf( "%s: file '%s' loaded via tftp to address 0x%08x.\n",
- __FUNCTION__, tftp_file, RAM_START );
- return 0;
-}
-char tftp_help[] = "tftp command.\n"
-"usage: tftp filename\n"
-"\tdownloads file over TFTP to RAM.\n"
-"\tUse setip to set client and server IP addresses\n";
-__commandlist(tftp_cmd, "tftp", tftp_help);
|