You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(79) |
Aug
(27) |
Sep
(64) |
Oct
(202) |
Nov
(31) |
Dec
(59) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(125) |
Feb
(173) |
Mar
(13) |
Apr
(140) |
May
(75) |
Jun
(1) |
Jul
(37) |
Aug
(14) |
Sep
|
Oct
(20) |
Nov
(9) |
Dec
(2) |
2003 |
Jan
(51) |
Feb
(12) |
Mar
(18) |
Apr
(24) |
May
(1) |
Jun
|
Jul
|
Aug
(72) |
Sep
(12) |
Oct
(18) |
Nov
(60) |
Dec
(26) |
2004 |
Jan
(1) |
Feb
(40) |
Mar
(3) |
Apr
(3) |
May
|
Jun
(1) |
Jul
(4) |
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
(1) |
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
(1) |
Dec
(5) |
2006 |
Jan
(13) |
Feb
(5) |
Mar
(8) |
Apr
(13) |
May
(7) |
Jun
(6) |
Jul
(10) |
Aug
(6) |
Sep
(6) |
Oct
(35) |
Nov
(20) |
Dec
(10) |
2007 |
Jan
(13) |
Feb
(9) |
Mar
(2) |
Apr
(1) |
May
(1) |
Jun
(2) |
Jul
(2) |
Aug
(3) |
Sep
(1) |
Oct
|
Nov
(1) |
Dec
(1) |
2008 |
Jan
|
Feb
|
Mar
(1) |
Apr
(4) |
May
(1) |
Jun
|
Jul
|
Aug
(2) |
Sep
(1) |
Oct
|
Nov
|
Dec
|
2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(54) |
Jun
(78) |
Jul
(35) |
Aug
(21) |
Sep
(21) |
Oct
(29) |
Nov
(10) |
Dec
(5) |
2010 |
Jan
|
Feb
|
Mar
(26) |
Apr
(55) |
May
(73) |
Jun
(63) |
Jul
(38) |
Aug
(39) |
Sep
(19) |
Oct
(2) |
Nov
(1) |
Dec
(1) |
2011 |
Jan
(2) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2013 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
From: Stefan E. <se...@us...> - 2004-02-17 10:49:02
|
Update of /cvsroot/blob/blob/src/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21025 Modified Files: pcmcia.c Log Message: cosmetics Index: pcmcia.c =================================================================== RCS file: /cvsroot/blob/blob/src/lib/pcmcia.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- pcmcia.c 9 Feb 2004 19:25:12 -0000 1.9 +++ pcmcia.c 17 Feb 2004 10:40:16 -0000 1.10 @@ -49,7 +49,7 @@ #define PCMCIA_DEBUG 1 #ifdef PCMCIA_DEBUG -# define _DBG( x, fmt, args... ) do { if ( dbg>=x ) printf( "%s:" fmt "\n", __FUNCTION__, ## args ); }while(0) +# define _DBG( x, fmt, args... ) do { if ( dbg>=x ) printf( "%s: " fmt "\n", __FUNCTION__, ## args ); }while(0) # define _DBGERR( x, code ) do { if ( dbg>=x ) printf( "%s(%d): ERROR %d.\n", __FUNCTION__, __LINE__, code ); ret = code; goto DONE; } while(0) #else # define _DBG( x, fmt, args... ) do { } while(0) @@ -134,8 +134,8 @@ printf((iface == CISTPL_IDE_INTERFACE) ? " IDE" : " unknown"); printf(" interface "); - break; - } + break; + } case CISTPL_FUNCE_IDE_MASTER: case CISTPL_FUNCE_IDE_SLAVE: { u8 f1 = *(p+2); @@ -361,7 +361,7 @@ ret = pcmcia_sock_enable( sock ); if ( ret ) continue; _DBG( 1, "enabled socket %d", nr ); - + /* reset */ ret = pcmcia_sock_reset( sock ); if ( ret ) _DBGERR( dbg, ret ); @@ -376,7 +376,8 @@ ret = detected; DONE: return ret; - } +} +__initlist(pcmcia_init, INIT_LEVEL_OTHER_STUFF); /********************************************************************* * pcmcia_sock_dump_status - dump socket status @@ -392,7 +393,7 @@ ret = pcmcia_sock_get( nr, &sock ); if ( ret ) _DBGERR( dbg, ret ); - + ret = pcmcia_driver->sock_status_dump( sock ); DONE: return ret; @@ -415,7 +416,7 @@ } DONE: return ret; - } +} /********************************************************************* * pcmcia_sock_detect - detect socket @@ -463,7 +464,7 @@ sock->state |= PCMCIA_SS_ENABLED; DONE: return ret; - } +} /********************************************************************* * pcmcia_sock_disable - disable socket @@ -517,13 +518,12 @@ *value = MEMb( pcmcia_driver->sock[sock].attr_base + offset ); - _DBG( 1, "%s: ATTR_REG(0x%02x) => 0x%02x\n", __FUNCTION__, - offset, *value ); + _DBG( 1, "ATTR_REG(0x%02x) => 0x%02x", offset, *value ); ret = 0; DONE: return ret; - } +} int pcmcia_sock_attr_write( int sock, u16 offset, u8 value ) { @@ -531,8 +531,7 @@ if ( !PCMCIA_SOCK_NR_VALID( sock ) ) _DBGERR( dbg, -EINVAL ); - _DBG( 1, "%s: ATTR_REG(0x%02x) <= 0x%02x\n", __FUNCTION__, - offset, value ); + _DBG( 1, "ATTR_REG(0x%02x) <= 0x%02x", offset, value ); MEMb( pcmcia_driver->sock[sock].attr_base + offset) = value; @@ -552,8 +551,7 @@ *value = MEMb( pcmcia_driver->sock[sock].io_base + offset); - _DBG( 1, "%s: IO_REG(0x%02x) => 0x%02x\n", __FUNCTION__, - offset, *value ); + _DBG( 1, "IO_REG(0x%02x) => 0x%02x\n", offset, *value ); ret = 0; DONE: @@ -566,14 +564,13 @@ if ( !PCMCIA_SOCK_NR_VALID( sock ) ) _DBGERR( dbg, -EINVAL ); - _DBG( 1, "%s: IO_REG(0x%02x) <= 0x%02x\n", __FUNCTION__, - offset, value ); + _DBG( 1, "IO_REG(0x%02x) <= 0x%02x\n", offset, value ); MEMb( pcmcia_driver->sock[sock].io_base + value ); ret = 0; DONE: return ret; - } +} /****************************************************************************** * MEMORY SPACE ACCESS @@ -586,8 +583,7 @@ *value = MEMb( pcmcia_driver->sock[sock].mem_base + offset); - _DBG( 1, "%s: MEM_REG(0x%02x) => 0x%02x\n", __FUNCTION__, - offset, *value ); + _DBG( 1, "MEM_REG(0x%02x) => 0x%02x", offset, *value ); ret = 0; DONE: @@ -600,8 +596,7 @@ if ( !PCMCIA_SOCK_NR_VALID( sock ) ) _DBGERR( dbg, -EINVAL ); - _DBG( 1, "%s: MEM_REG(0x%02x) <= 0x%02x\n", __FUNCTION__, - offset, value ); + _DBG( 1, "MEM_REG(0x%02x) <= 0x%02x", offset, value ); MEMb( pcmcia_driver->sock[sock].mem_base + value ); ret = 0; @@ -651,11 +646,11 @@ printf( "Socket %d: IO [ 0x%08X ], ATTR [ 0x%08X ], MEM [ 0x%08X ]\n", nr, sock->io_base, sock->attr_base, sock->mem_base ); -} + } ret = pcmcia_init(); printf( "detected %d cards.\n", ret ); - + ret = 0; DONE: return ret; |
From: Stefan E. <se...@us...> - 2004-02-17 10:45:26
|
Update of /cvsroot/blob/blob/src/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20452/src/lib Modified Files: tar.c Log Message: tar init in initcalls Index: tar.c =================================================================== RCS file: /cvsroot/blob/blob/src/lib/tar.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- tar.c 25 Jul 2002 14:08:00 -0000 1.5 +++ tar.c 17 Feb 2004 10:36:40 -0000 1.6 @@ -89,7 +89,7 @@ /********************************************************************** * io driver for tar archives */ -static void init_tar_default_io( void ) +void init_tar_io( void ) { int ret; static io_driver_t def_tar_io_driver; @@ -104,7 +104,6 @@ ret = io_register( &def_tar_io_driver, "TAR" ); if ( ret ) return; } -__initlist(init_tar_default_io, INIT_LEVEL_OTHER_STUFF + 2); int tar_io_init( io_driver_t *io, tar_arch_t *arch ) { @@ -114,6 +113,7 @@ DBG( 5, "%s: io=%p, arch=%p\n", __FUNCTION__, io, arch ); + io->flags = GIO_FLAG_R; io->conf = tar_io_conf; io->read = tar_io_read; io->write = tar_io_write; |
From: Stefan E. <se...@us...> - 2004-02-17 10:45:26
|
Update of /cvsroot/blob/blob/src/blob In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20452/src/blob Modified Files: initcalls.c Log Message: tar init in initcalls Index: initcalls.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/initcalls.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- initcalls.c 10 Nov 2003 20:58:35 -0000 1.8 +++ initcalls.c 17 Feb 2004 10:36:40 -0000 1.9 @@ -51,6 +51,7 @@ __initlist(init_flash_io, INIT_LEVEL_OTHER_STUFF + 2); __initlist(init_part_io, INIT_LEVEL_OTHER_STUFF + 2); __initlist(init_ram_io, INIT_LEVEL_OTHER_STUFF + 2); +__initlist(init_tar_io, INIT_LEVEL_OTHER_STUFF + 2); #endif /* exit calls */ |
From: Stefan E. <se...@us...> - 2004-02-17 10:45:25
|
Update of /cvsroot/blob/blob/include/blob In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20452/include/blob Modified Files: gio_drivers.h Log Message: tar init in initcalls Index: gio_drivers.h =================================================================== RCS file: /cvsroot/blob/blob/include/blob/gio_drivers.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- gio_drivers.h 3 Apr 2003 14:50:54 -0000 1.1 +++ gio_drivers.h 17 Feb 2004 10:36:39 -0000 1.2 @@ -25,5 +25,6 @@ extern void init_flash_io(void); extern void init_part_io(void); extern void init_ram_io(void); +extern void init_tar_io(void); #endif |
From: Stefan E. <se...@us...> - 2004-02-16 13:06:30
|
Update of /cvsroot/blob/blob/src/blob In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29460 Modified Files: memsetup-pxa.S Log Message: Actually do the frequency change after configuring CCCR. Optionally enter TURBO mode. This _really_ matters a _lot_ ;) Index: memsetup-pxa.S =================================================================== RCS file: /cvsroot/blob/blob/src/blob/memsetup-pxa.S,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- memsetup-pxa.S 9 Feb 2004 16:32:57 -0000 1.4 +++ memsetup-pxa.S 16 Feb 2004 12:58:26 -0000 1.5 @@ -73,6 +73,13 @@ ldr r0, =CCCR_VALUE str r0, [r1, #0] wait + /* Do frequency change, enter TURBO mode */ + mov r0, #2 /* FCS */ +#ifdef CONFIG_TURBO_MODE + orr r0, r0, #1 /* TURBO */ +#endif + /* Write CP14 CCLKCFG */ + mcr p14, 0, r0, c6, c0, 0 #endif ldr r1, =0x48000000 |
From: Stefan E. <se...@us...> - 2004-02-10 03:52:24
|
Update of /cvsroot/blob/blob/src/blob In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12562 Modified Files: memsetup-pxa.S Log Message: ra alpha runs memory at full speed. Index: memsetup-pxa.S =================================================================== RCS file: /cvsroot/blob/blob/src/blob/memsetup-pxa.S,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- memsetup-pxa.S 7 Dec 2003 21:08:51 -0000 1.3 +++ memsetup-pxa.S 9 Feb 2004 16:32:57 -0000 1.4 @@ -171,8 +171,14 @@ /* set K1RUN if bank 0 installed */ orr r4, r4, #(MDREFR_K1RUN|MDREFR_K0RUN|MDREFR_E0PIN) +#ifndef RA_ALPHA /* set K1DB2 (SDClk[1] = MemClk/2) */ orreq r4, r4, #(MDREFR_K1DB2) +#else + /* Full speed memory clock */ + bic r4, r4, #(MDREFR_K1DB2) + orr r4, r4, #(MDREFR_K2DB2) +#endif /* write back MDREFR */ str r4, [r1, #MDREFR_OFFSET] |
From: Stefan E. <se...@us...> - 2004-02-10 03:26:54
|
Update of /cvsroot/blob/blob/src/blob In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12321 Modified Files: ra_alpha.c Log Message: Update ra alpha support. Index: ra_alpha.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/ra_alpha.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- ra_alpha.c 10 Nov 2003 20:54:25 -0000 1.2 +++ ra_alpha.c 9 Feb 2004 16:32:01 -0000 1.3 @@ -29,6 +29,7 @@ #include <blob/arch.h> #include <blob/errno.h> #include <blob/error.h> +#include <blob/debug.h> #include <blob/util.h> #include <blob/reboot.h> #include <blob/serial.h> @@ -39,6 +40,7 @@ #include <blob/led.h> #include <blob/partition.h> #include <blob/time.h> +#include <net/ether.h> static void rt_alpha_init_driver (void) { @@ -126,6 +128,8 @@ flash_driver = &intel32_flash_driver; led_driver = &pxa_gpio_led_driver; timer_driver = &intelarm_timer_driver; + ether_driver = &smc9196_ether_driver; + ether_driver->base = PXA_CS3_PHYS; default_partition_table = partitions; flash_partition_table = (blob_partition_t *) 0x00000000; @@ -133,3 +137,122 @@ __initlist (rt_alpha_init_driver,INIT_LEVEL_DRIVER_SELECTION); +static void ra_alpha_init_hardware(void) +{ + /* init on-board CPLD */ + MEM(RA_CTRL0) = 0x00; + MEM(RA_CTRL1) = 0x00; + + printf( "MDREFR_VALUE=0x%08x\n", MDREFR_VALUE ); + printf( "MDCNFG_VALUE=0x%08x\n", MDCNFG_VALUE ); + printf( "CCCR_VALUE=0x%08x\n", CCCR_VALUE ); + + printf( "MDREFR=0x%08x\n", MDREFR ); + printf( "MDCNFG=0x%08x\n", MDCNFG ); + printf( "CCCR=0x%08x\n", CCCR ); + + printf( "RA_CTRL0=0x%08x\n", MEM(RA_CTRL0)); + printf( "RA_CTRL1=0x%08x\n", MEM(RA_CTRL1)); + + MEM(0x9708) = 0x00600060; + MEM(0x9708) = 0x00030003; + SXCNFG = 0x60f1; + + /* tweak blob config */ + blob_status.boot_delay = 1; +} +__initlist(ra_alpha_init_hardware, INIT_LEVEL_OTHER_HARDWARE); + +/**********************************************************************/ +void * my_memcpy(void * dest,const void *src,size_t count) +{ + u32 *tmp=dest, *s=src; + + count>>=4; + while (count--) { + *tmp++ = *s++; + *tmp++ = *s++; + *tmp++ = *s++; + *tmp++ = *s++; + } + + return dest; +} + +int mtest_cmd(int argc, char *argv[]) +{ + u32 start, end, tps; + unsigned long src=0x00300000; + unsigned long dst=0xa2000000; + size_t size=4272128; + + int ret = EINVAL; + + tps = timer_tps(); + + start = timer_read(); + memcpy( dst, src, size ); + end = timer_read(); + printf( "memcpy( %d bytes ): %ld ms\n", size, (end - start)/tps*1000 ); + + start = timer_read(); + my_memcpy( dst, src, size ); + end = timer_read(); + printf( "my_memcpy( %d bytes ): %ld ms\n", size, (end - start)/tps*1000 ); + + ret = 0; +DONE: + return ret; +} +char mtest_help[] = "memcpy timing test\n"; +__commandlist(mtest_cmd, "mtest", mtest_help); + +int mtest8_cmd(int argc, char *argv[]) +{ + u32 start, end, tps; + unsigned long src=0x00300000; + unsigned long dst=0xa2000000; + size_t size=4272128; + + int ret = EINVAL; + + tps = timer_tps(); + + while ( 1 ) { + start = timer_read(); + memcpy( dst, src, size ); + end = timer_read(); + printf( "memcpy( %d bytes ): %ld ms\n", size, (end - start)/tps*1000 ); + } + + ret = 0; +DONE: + return ret; +} +char mtest8_help[] = "memcpy test 8\n"; +__commandlist(mtest8_cmd, "mtest8", mtest8_help); + +int mtest32_cmd(int argc, char *argv[]) +{ + u32 start, end, tps; + unsigned long src=0x00300000; + unsigned long dst=0xa2000000; + size_t size=4272128; + + int ret = EINVAL; + + tps = timer_tps(); + + while ( 1 ) { + start = timer_read(); + my_memcpy( dst, src, size ); + end = timer_read(); + printf( "my_memcpy( %d bytes ): %ld ms\n", size, (end - start)/tps*1000); + } + + ret = 0; +DONE: + return ret; +} +char mtest32_help[] = "memcpy test 32\n"; +__commandlist(mtest32_cmd, "mtest32", mtest32_help); |
From: Stefan E. <se...@us...> - 2004-02-10 03:01:31
|
Update of /cvsroot/blob/blob/include/blob In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20308/include/blob Modified Files: pcmcia.h Log Message: PCMCIA CLEANUP Remove PCMCIA mess and do it like the ethernet driver stuff. Probably breaks SA1111 PCMCIA stuff, but I'm the only one who uses that anyway, and I'll fix. The SA11x0 stuff is still missing. Index: pcmcia.h =================================================================== RCS file: /cvsroot/blob/blob/include/blob/pcmcia.h,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- pcmcia.h 6 Feb 2004 10:32:19 -0000 1.9 +++ pcmcia.h 9 Feb 2004 19:25:12 -0000 1.10 @@ -23,76 +23,97 @@ #include <blob/pcmcia-cis.h> -/********************************************************************** - * Arch dependent defines (should be pretty much the same everywhere, - * tough) - */ -#define PCMCIA_MAX_SLOTS 2 - -#if defined(BADGE4) || defined(IDR) || defined(PT_SYSTEM3) || defined(SHANNON) || \ - defined(PT_DAFIT) -# define PCMCIA_S0_BASE 0x20000000 -# define PCMCIA_S0_IO_BASE 0x20000000 -# define PCMCIA_S0_ATTR_BASE 0x28000000 -# define PCMCIA_S0_MEM_BASE 0x2C000000 -# define PCMCIA_S1_BASE 0x30000000 -# define PCMCIA_S1_IO_BASE 0x30000000 -# define PCMCIA_S1_ATTR_BASE 0x38000000 -# define PCMCIA_S1_MEM_BASE 0x3C000000 -#else -# error "Please add PCMCIA HW defines for your board here" -#endif - -/* some slot stati */ +/* some sock stati */ #define PCMCIA_SS_DETECT (1<<0) #define PCMCIA_SS_ENABLED (1<<1) #define PCMCIA_SS_POWER (1<<2) #define PCMCIA_SS_IDENT (1<<3) -/********************************************************************** - * the following symbols can be overwritten by arch dependent code - * (weak symbols) +/****************************************************************************** + * PCMCIA driver definitions */ -/* do whatever is needed to get pcmcia initialized */ -int pcmcia_init(); -/* set pcmcia slot voltage levels */ -int pcmcia_voltage_set( int slot, int vcc, int vpp ); +/* a PCMCIA socket + */ +struct pcmcia_sock { + int nr; /* socket number */ + int state; /* socket state DETECT,ENABLE,POWER,IDENT */ + int vcc; /* socket power voltage */ + int vpp; -/* detect slot */ -int pcmcia_slot_detect( int slot ); + /* Memory windows */ + u32 io_base; + u32 attr_base; + u32 mem_base; -/* enable slot */ -int pcmcia_slot_enable( int slot ); + /* CIS stuff */ + volatile u8 *ident; + volatile u8 *feature_p[PCMCIA_MAX_FEATURES]; + int n_features; + u16 config_base; -/* disable slot */ -int pcmcia_slot_disable( int slot ); + void *priv; /* per-socket private data used by HW implementations */ +}; -/* reset pcmcia slot */ -int pcmcia_slot_reset(int slot); +typedef int (*pcmcia_init_func_t)( void ); +typedef int (*pcmcia_power_func_t)( struct pcmcia_sock *sock, int vcc, int vpp ); +typedef int (*pcmcia_sock_detect_func_t)( struct pcmcia_sock *sock ); +typedef int (*pcmcia_sock_enable_func_t)( struct pcmcia_sock *sock ); +typedef int (*pcmcia_sock_disable_func_t)( struct pcmcia_sock *sock ); +typedef int (*pcmcia_sock_reset_func_t)( struct pcmcia_sock *sock ); +typedef int (*pcmcia_sock_status_dump_func_t)( struct pcmcia_sock *sock ); -/* dump slot stati */ -int pcmcia_dump_stati( void ); +typedef struct { + int nr; + int first; + struct pcmcia_sock *sock; + pcmcia_init_func_t init; + pcmcia_power_func_t power; + pcmcia_sock_detect_func_t sock_detect; + pcmcia_sock_enable_func_t sock_enable; + pcmcia_sock_reset_func_t sock_reset; + pcmcia_sock_disable_func_t sock_disable; + pcmcia_sock_status_dump_func_t sock_status_dump; + char *name; +} pcmcia_driver_t; -/********************************************************************** - * following symbols cannot be overwritten +#define PCMCIA_SOCK_NR_VALID( n ) ( pcmcia_driver && (n<(pcmcia_driver->nr+pcmcia_driver->first)) \ + && (n>=pcmcia_driver->first) ) + +/* implemented pcmcia drivers */ +extern pcmcia_driver_t sa1111_pcmcia_driver; +extern pcmcia_driver_t pxa_pcmcia_driver; + +/* filled out by board specific code */ +extern pcmcia_driver_t *pcmcia_driver; + +/****************************************************************************** + * exported functions */ + /* set debug verbosity */ void pcmcia_dbg_set( int level ); -/* identify pcmcia card */ -int pcmcia_identify( volatile unsigned char *p ); +int pcmcia_init( void ); +int pcmcia_sock_dump_status( int nr ); -/* parse cis tuples of card in slot <slot> */ -int pcmcia_cis_parse( int slot ); +/* these are kinda low-level, pcmcia_init() should do + * the work for you already + */ +int pcmcia_sock_get( int nr, struct pcmcia_sock **sock ); +int pcmcia_sock_reset( struct pcmcia_sock *sock ); +int pcmcia_sock_enable( struct pcmcia_sock *sock ); +int pcmcia_sock_disable( struct pcmcia_sock *sock ); -/* get base adress and attribute space address of slot <slot> */ -int pcmcia_slot_address_get( int slot, u32 *base, u32 *attr ); +/* read/write attribute space */ +int pcmcia_sock_attr_read( int sock, u16 offset, u8 *value ); +int pcmcia_sock_attr_write( int sock, u16 offset, u8 value ); -/* get config register */ -int pcmcia_slot_cfg_reg_get( int slot, u16 *cfg_base ); +/* read/write io space */ +int pcmcia_sock_io_read( int sock, u16 offset, u8 *value ); +int pcmcia_sock_io_write( int sock, u16 offset, u8 value ); -/* read/write attribute space */ -int pcmcia_slot_attr_read( int slot, u16 offset, u8 *value ); -int pcmcia_slot_attr_write( int slot, u16 offset, u8 value ); +/* read/write mem space */ +int pcmcia_sock_mem_read( int sock, u16 offset, u8 *value ); +int pcmcia_sock_mem_write( int sock, u16 offset, u8 value ); #endif |
From: Stefan E. <se...@us...> - 2004-02-10 01:41:16
|
Update of /cvsroot/blob/blob In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20308 Modified Files: configure.in Log Message: PCMCIA CLEANUP Remove PCMCIA mess and do it like the ethernet driver stuff. Probably breaks SA1111 PCMCIA stuff, but I'm the only one who uses that anyway, and I'll fix. The SA11x0 stuff is still missing. Index: configure.in =================================================================== RCS file: /cvsroot/blob/blob/configure.in,v retrieving revision 1.79 retrieving revision 1.80 diff -u -d -r1.79 -r1.80 --- configure.in 4 Dec 2003 21:51:23 -0000 1.79 +++ configure.in 9 Feb 2004 19:25:12 -0000 1.80 @@ -197,6 +197,7 @@ BLOB_NETWORK_DRIVER_OBJS="ether-smc9196.o" BLOB_LED_STARTCODE="ledasm-sa11x0.o" BLOB_FLASH_OBJS="intel32.o" + BLOB_PCMCIA_DRIVER_OBJS="pcmcia-sa11x0.o" DIAG_PLATFORM_OBJS="dafit.o" use_cpu="sa1110" use_lcd="yes" @@ -205,10 +206,11 @@ board_name="Prueftechnik RotAlign Alpha" AC_DEFINE(RA_ALPHA,1,[PT RotAlign Alpha]) BLOB_PLATFORM_OBJS="ra_alpha.o" - dnl BLOB_NETWORK_DRIVER_OBJS="ether-smc9196.o" + BLOB_NETWORK_DRIVER_OBJS="ether-smc9196.o" BLOB_LED_DRIVER_OBJS="led-pxa.o" BLOB_LED_STARTCODE="ledasm-pxa.o" BLOB_FLASH_OBJS="intel32.o" + BLOB_PCMCIA_DRIVER_OBJS="pcmcia-pxa.o" DIAG_PLATFORM_OBJS="ra_alpha.o" use_cpu="pxa250" use_lcd="no" @@ -378,6 +380,7 @@ BLOB_LED_STARTCODE="ledasm-sa11x0.o" BLOB_FLASH_OBJS="intel32.o" DIAG_PLATFORM_OBJS="system3.o" + BLOB_PCMCIA_DRIVER_OBJS="pcmcia-sa1111.o" use_cpu="sa1110" use_lcd="yes" ;; @@ -735,7 +738,7 @@ dnl Check wether or not pcmcia support is wanted if test "x$pcmcia_flag" = "xyes" ; then - BLOB_PCMCIA_OBJS="pcmcia.o" + BLOB_PCMCIA_OBJS="pcmcia.o $BLOB_PCMCIA_DRIVER_OBJS" AC_DEFINE(CONFIG_PCMCIA_SUPPORT,no,"PCMCIA support") fi |
From: Stefan E. <se...@us...> - 2004-02-10 00:40:06
|
Update of /cvsroot/blob/blob/src/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20308/src/lib Modified Files: pcmcia.c Makefile.am Added Files: pcmcia-pxa.c pcmcia-sa1111.c Log Message: PCMCIA CLEANUP Remove PCMCIA mess and do it like the ethernet driver stuff. Probably breaks SA1111 PCMCIA stuff, but I'm the only one who uses that anyway, and I'll fix. The SA11x0 stuff is still missing. --- NEW FILE: pcmcia-pxa.c --- /********************************************************************** * pcmcia-pxa.c - pxa pcmcia functions * * (C) by Stefan Eletzhofer <ste...@el...> * * 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 */ #ifdef HAVE_CONFIG_H # include <blob/config.h> #endif #include <blob/types.h> #include <blob/errno.h> #include <blob/util.h> #include <blob/command.h> #include <blob/time.h> #include <blob/serial.h> #include <blob/arch.h> #include <blob/pcmcia.h> //#include <blob/pcmcia-pxa.h> /********************************************************************** * defines */ #ifdef DEBUG # define _DBG( x, fmt, args... ) do { if ( dbg>=x ) printf( "%s:" fmt "\n", __FUNCTION__, ## args ) }while(0); # define _DBGERR( x, code ) do { if ( dbg>=x ) printf( "%s(%d): ERROR %d.\n", __FUNCTION__, __LINE__, code ); ret = code; goto DONE; }while(0); #else # define _DBG( x, fmt, args... ) do { } while(0); # define _DBGERR( x, code ) do { ret = code; goto DONE; } while(0); #endif /********************************************************************** * globals */ /********************************************************************** * module globals */ static char *version = "$Id: pcmcia-pxa.c,v 1.1 2004/02/09 19:25:12 seletz Exp $"; #ifdef DEBUG static int dbg = 1; #else static int dbg = 0; #endif static struct pcmcia_sock pxa_sockets[2] = { { .nr = 0, .state = 0, .vcc = 0, .vpp = 0, .io_base = _PCMCIA0IO, .attr_base = _PCMCIA0Attr, .mem_base = _PCMCIA0Mem, }, { .nr = 1, .state = 0, .vcc = 0, .vpp = 0, .io_base = _PCMCIA1IO, .attr_base = _PCMCIA1Attr, .mem_base = _PCMCIA1Mem, } }; /********************************************************************** * statics */ /********************************************************************* * pxa_gpio_mode * @gpio_mode: desc * * Set GPIO alternate functions * * FIXME this function should'nt be static */ static void pxa_gpio_mode(int gpio_mode) { int gpio = gpio_mode & GPIO_MD_MASK_NR; int fn = (gpio_mode & GPIO_MD_MASK_FN) >> 8; int gafr; if (gpio_mode & GPIO_MD_MASK_DIR) GPDR(gpio) |= GPIO_bit(gpio); else GPDR(gpio) &= ~GPIO_bit(gpio); gafr = GAFR(gpio) & ~(0x3 << (((gpio) & 0xf)*2)); GAFR(gpio) = gafr | (fn << (((gpio) & 0xf)*2)); } /********************************************************************* * pcmcia_pxa_init - short desc * @void: desc * * Long desc */ int pcmcia_pxa_init( void ) { int ret = 0; /* setup GPIO */ GPSR(GPIO48_nPOE) = GPIO_bit(GPIO48_nPOE) | GPIO_bit(GPIO49_nPWE) | GPIO_bit(GPIO50_nPIOR) | GPIO_bit(GPIO51_nPIOW) | GPIO_bit(GPIO52_nPCE_1) | GPIO_bit(GPIO53_nPCE_2); /* setup AFR */ pxa_gpio_mode(GPIO48_nPOE_MD); pxa_gpio_mode(GPIO49_nPWE_MD); pxa_gpio_mode(GPIO50_nPIOR_MD); pxa_gpio_mode(GPIO51_nPIOW_MD); pxa_gpio_mode(GPIO52_nPCE_1_MD); pxa_gpio_mode(GPIO53_nPCE_2_MD); pxa_gpio_mode(GPIO54_pSKTSEL_MD); /* REVISIT: s/b dependent on num sockets */ pxa_gpio_mode(GPIO55_nPREG_MD); pxa_gpio_mode(GPIO56_nPWAIT_MD); pxa_gpio_mode(GPIO57_nIOIS16_MD); DONE: return ret; } /********************************************************************** * exported */ pcmcia_driver_t pxa_pcmcia_driver = { .name = "PXA PCMCIA", .first = 0, .nr = 2, .sock = pxa_sockets, .init = pcmcia_pxa_init, .power = NULL, .sock_detect = NULL, .sock_enable = NULL, .sock_disable = NULL, .sock_reset = NULL, .sock_status_dump= NULL, }; /* vim: set ts=8 sw=8 tw=75: */ --- NEW FILE: pcmcia-sa1111.c --- /********************************************************************** * pcmcia-sa1111.c - sa1111 pcmcia functions * * (C) by Stefan Eletzhofer <ste...@el...> * * 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 */ #ifdef HAVE_CONFIG_H # include <blob/config.h> #endif #include <blob/types.h> #include <blob/errno.h> #include <blob/util.h> #include <blob/command.h> #include <blob/time.h> #include <blob/serial.h> #include <blob/arch.h> #include <blob/pcmcia.h> #include <blob/pcmcia-sa11x0.h> #ifdef SA1111_BASE #include <blob/proc/sa1111.h> #endif /********************************************************************** * defines */ #ifdef DEBUG # define _DBG( x, fmt, args... ) do { if ( dbg>=x ) printf( "%s:" fmt "\n", __FUNCTION__, ## args ) }while(0); # define _DBGERR( x, code ) do { if ( dbg>=x ) printf( "%s(%d): ERROR %d.\n", __FUNCTION__, __LINE__, code ); ret = code; goto DONE; }while(0); #else # define _DBG( x, fmt, args... ) do { } while(0); # define _DBGERR( x, code ) do { ret = code; goto DONE; } while(0); #endif /********************************************************************** * globals */ /********************************************************************** * module globals */ static char *version = "$Id: pcmcia-sa1111.c,v 1.1 2004/02/09 19:25:12 seletz Exp $"; #ifdef DEBUG static int dbg = 1; #else static int dbg = 0; #endif static struct pcmcia_sock sa1111_sockets[2] = { { .nr = 0, .state = 0, .vcc = 0, .vpp = 0, .io_base = PCMCIA_S0_IO_BASE, .attr_base = PCMCIA_S0_ATTR_BASE, .mem_base = PCMCIA_S0_MEM_BASE, }, { .nr = 1, .state = 0, .vcc = 0, .vpp = 0, .io_base = PCMCIA_S1_IO_BASE, .attr_base = PCMCIA_S1_ATTR_BASE, .mem_base = PCMCIA_S1_MEM_BASE, } }; /********************************************************************** * statics */ /********************************************************************* * pcmcia_sa1111_init - short desc * @void: desc * * Long desc */ int pcmcia_sa1111_init( void ) { int ret = 0; DONE: return ret; } /********************************************************************* * pcmcia_sa1111_voltage_set - set socket voltage * @sock: the socket * @vcc: voltage * @vpp: voltage * * This function should set socket voltage for <sock>. */ int pcmcia_sa1111_voltage_set( struct pcmcia_sock *sock, int vcc, int vpp ) { int ret = 0; if ( !sock ) _DBGERR( dbg, -EINVAL ); DONE: return ret; } /********************************************************************* * pcmcia_sa1111_sock_detect - detect socket * @sock: desc * * setect if a card is inserted in socket <sock>. * -1 error, 0 no card, 1 card in. */ int pcmcia_sa1111_sock_detect( struct pcmcia_sock *sock ) { int ret = 0; int detect = 0; unsigned int flags = PCSR; if ( !sock ) _DBGERR( dbg, -EINVAL ); switch ( sock->nr ) { case 0: detect = (flags & PCSR_S0_DETECT) == 0; break; case 1: detect = (flags & PCSR_S1_DETECT) == 0; break; default: detect = -1; break; } ret = detect; DONE: return ret; } /********************************************************************* * pcmcia_sa1111_sock_enable - short desc * @sock: desc * * Enable socket */ int pcmcia_sa1111_sock_enable( struct pcmcia_sock *sock ) { int ret = 0; if ( !sock ) _DBGERR( dbg, -EINVAL ); switch ( sock->nr ) { case 0: PCCR = (PCCR & ~PCCR_S0_PSE) | PCCR_S0_FLT | PCCR_S0_PWAITEN; break; case 1: PCCR = (PCCR & ~PCCR_S1_PSE) | PCCR_S1_FLT | PCCR_S1_PWAITEN; break; default: ret = -1; break; } DONE: return ret; } /********************************************************************* * pcmcia_sa1111_sock_disable - short desc * @sock: desc * * Long desc */ int pcmcia_sa1111_sock_disable( struct pcmcia_sock *sock ) { int ret = 0; if ( !sock ) _DBGERR( dbg, -EINVAL ); switch ( sock->nr ) { case 0: PCCR = PCCR | PCCR_S0_PSE; break; case 1: PCCR = PCCR | PCCR_S1_PSE; break; default: ret = -1; break; } DONE: return ret; } /********************************************************************* * pcmcia_sa1111_sock_reset - short desc * @sock: desc * * Long desc */ int pcmcia_sa1111_sock_reset( struct pcmcia_sock *sock ) { int ret = 0; if ( !sock ) _DBGERR( dbg, -EINVAL ); switch ( sock->nr ) { case 0: PCCR |= PCCR_S0_RST; msleep(20); PCCR &= ~PCCR_S0_RST; msleep(20); break; case 1: PCCR |= PCCR_S1_RST; msleep(20); PCCR &= ~PCCR_S1_RST; msleep(20); break; default: ret = -1; break; } DONE: return ret; } /********************************************************************* * pcmcia_sa1111_sock_status_dump * @sock: desc */ int pcmcia_sa1111_sock_status_dump( struct pcmcia_sock *sock ) { int ret = 0; int status = PCSR; if ( !sock ) _DBGERR( dbg, -EINVAL ); switch ( sock->nr ) { case 0: printf("s0: "); if (status & PCSR_S0_READY) printf("ready "); else printf(" "); if (status & PCSR_S0_DETECT) printf("detect "); else printf(" "); if (status & PCSR_S0_VS1) printf("vs1 "); else printf(" "); if (status & PCSR_S0_VS2) printf("vs2 "); else printf(" "); if (status & PCSR_S0_WP) printf("wp "); else printf(" "); if (status & PCSR_S0_BVD1) printf("bvd1 "); else printf(" "); if (status & PCSR_S0_BVD2) printf("bvd2 "); else printf(" "); printf( "\n" ); break; case 1: printf("s1: "); if (status & PCSR_S1_READY) printf("ready "); else printf(" "); if (status & PCSR_S1_DETECT) printf("detect "); else printf(" "); if (status & PCSR_S1_VS1) printf("vs1 "); else printf(" "); if (status & PCSR_S1_VS2) printf("vs2 "); else printf(" "); if (status & PCSR_S1_WP) printf("wp "); else printf(" "); if (status & PCSR_S1_BVD1) printf("bvd1 "); else printf(" "); if (status & PCSR_S1_BVD2) printf("bvd2 "); else printf(" "); printf( "\n" ); break; default: ret = -1; break; } DONE: return ret; } /********************************************************************** * exported */ pcmcia_driver_t sa1111_pcmcia_driver = { .name = "SA1111 PCMCIA", .first = 0, .nr = 2, .sock = sa1111_sockets, .init = pcmcia_sa1111_init, .power = pcmcia_sa1111_voltage_set, .sock_detect = pcmcia_sa1111_sock_detect, .sock_enable = pcmcia_sa1111_sock_enable, .sock_disable = pcmcia_sa1111_sock_disable, .sock_reset = pcmcia_sa1111_sock_reset, .sock_status_dump= pcmcia_sa1111_sock_status_dump, }; /* vim: set ts=8 sw=8 tw=75: */ Index: pcmcia.c =================================================================== RCS file: /cvsroot/blob/blob/src/lib/pcmcia.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- pcmcia.c 20 Aug 2003 23:12:22 -0000 1.8 +++ pcmcia.c 9 Feb 2004 19:25:12 -0000 1.9 @@ -5,7 +5,7 @@ * work from Brad Parker. * * Copyright (C) 2001, Brad Parker (br...@he...) - * Copyright (C) 2002, Stefan Eletzhofer <ste...@el...> + * Copyright (C) 2002-4, Stefan Eletzhofer <ste...@el...> * * 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 @@ -41,70 +41,30 @@ #include <blob/arch.h> #include <blob/pcmcia.h> -#ifdef SA1111_BASE -#include <blob/proc/sa1111.h> -#endif - /********************************************************************** * Defines / Makros */ -#define WEAK_SYM __attribute__ (( weak )) - #define MEMb(adr) (*((u8 *)(adr))) #define PCMCIA_DEBUG 1 #ifdef PCMCIA_DEBUG -# define DBG( x, args... ) if ( pcmcia_dbg>x ) printf( args ); +# define _DBG( x, fmt, args... ) do { if ( dbg>=x ) printf( "%s:" fmt "\n", __FUNCTION__, ## args ); }while(0) +# define _DBGERR( x, code ) do { if ( dbg>=x ) printf( "%s(%d): ERROR %d.\n", __FUNCTION__, __LINE__, code ); ret = code; goto DONE; } while(0) #else -# define DBG( x, args... ) +# define _DBG( x, fmt, args... ) do { } while(0) +# define _DBGERR( x, code ) do { ret = code; goto DONE; } while(0) #endif /********************************************************************** - * types - */ -typedef struct { - u16 status; - int vcc; - int vpp; - u32 attr_base; - u32 base; - volatile u8 *ident; - volatile u8 *feature_p[PCMCIA_MAX_FEATURES]; - int n_features; - u16 config_base; -} pcmcia_slot_t; - -/********************************************************************** - * program globals - */ - -pcmcia_slot_t pcmcia_slots[ PCMCIA_MAX_SLOTS ] = { - { - status: 0, - vcc: 0, - vpp: 0, - attr_base: PCMCIA_S0_ATTR_BASE, - base: PCMCIA_S0_BASE, - },{ - status: 0, - vcc: 0, - vpp: 0, - attr_base: PCMCIA_S1_ATTR_BASE, - base: PCMCIA_S1_BASE, - }, -}; - - -/********************************************************************** * module globals */ #ident "$Id$" #ifdef PCMCIA_DEBUG -static int pcmcia_dbg = 1; +static int dbg = 1; #else -static int pcmcia_dbg = 0; +static int dbg = 0; #endif /********************************************************************** @@ -112,185 +72,114 @@ */ static int pcmcia_print_fixed(volatile u8 *p); static int pcmcia_print_funcid(int func); +static int pcmcia_identify( volatile unsigned char *p ); +static int pcmcia_cis_parse( struct pcmcia_sock *sock ); /********************************************************************** - * exported functions + * static functions */ -void pcmcia_dbg_set( int level ) -{ - pcmcia_dbg = level; -} - -/* do whatever is needed to get pcmcia initialized */ -int WEAK_SYM pcmcia_init() -{ - return 0; -} - -/* set pcmcia slot voltage levels */ -int WEAK_SYM pcmcia_voltage_set( int slot, int vcc, int vpp ) -{ - return 0; -} - -/* detect slot */ -int WEAK_SYM pcmcia_slot_detect( int slot ) +/* print function id strings */ +static int pcmcia_print_funcid(int func) { - int detect = 0; -#ifdef SA1111_BASE - unsigned int flags = PCSR; - - switch ( slot ) { - case 0: - detect = (flags & PCSR_S0_DETECT) == 0; + printf("\t "); + switch (func) { + case CISTPL_FUNCID_MULTI: + printf("Multi-Function"); break; - case 1: - detect = (flags & PCSR_S1_DETECT) == 0; + case CISTPL_FUNCID_MEMORY: + printf("Memory"); break; - default: - detect = -1; - goto DONE; + case CISTPL_FUNCID_SERIAL: + printf("Serial Port"); break; - } - - if ( detect ) { - pcmcia_slots[slot].status |= PCMCIA_SS_DETECT; - } else { - pcmcia_slots[slot].status &= ~PCMCIA_SS_DETECT; - } - - DBG( 1, "%s: slot %d status: %x\n", __FUNCTION__, slot, pcmcia_slots[slot].status ); -DONE: -#else -#warning "FIXME: non sa1111 systems not yet supported" -#endif - return detect; -} - -/* enable slot */ -int WEAK_SYM pcmcia_slot_enable( int slot ) -{ - int ret = 0; - -#ifdef SA1111_BASE - switch ( slot ) { - case 0: - PCCR = (PCCR & ~PCCR_S0_PSE) | PCCR_S0_FLT | PCCR_S0_PWAITEN; + case CISTPL_FUNCID_PARALLEL: + printf("Parallel Port"); break; - case 1: - PCCR = (PCCR & ~PCCR_S1_PSE) | PCCR_S1_FLT | PCCR_S1_PWAITEN; + case CISTPL_FUNCID_FIXED: + printf("Fixed Disk"); + break; + case CISTPL_FUNCID_VIDEO: + printf("Video Adapter"); + break; + case CISTPL_FUNCID_NETWORK: + printf("Network Adapter"); + break; + case CISTPL_FUNCID_AIMS: + printf("AIMS Card"); + break; + case CISTPL_FUNCID_SCSI: + printf("SCSI Adapter"); break; default: - ret = -1; - goto DONE; + printf("Unknown"); break; } + printf(" Card\n"); - pcmcia_slots[slot].status |= PCMCIA_SS_ENABLED; - - DBG( 1, "%s: slot %d status: %x\n", __FUNCTION__, slot, pcmcia_slots[slot].status ); -DONE: -#else -#warning "FIXME: non sa1111 systems not yet supported" -#endif - return ret; + return 0; } -/* disable slot */ -int WEAK_SYM pcmcia_slot_disable( int slot ) +/* print info for FIXED_DISK function type card */ +static int pcmcia_print_fixed(volatile u8 *p) { - int ret = 0; + if (p == NULL) + return -1; -#ifdef SA1111_BASE - switch ( slot ) { - case 0: - PCCR = PCCR | PCCR_S0_PSE; - break; - case 1: - PCCR = PCCR | PCCR_S1_PSE; - break; - default: - ret = -1; - goto DONE; + printf("\t "); + + switch (*p) { + case CISTPL_FUNCE_IDE_IFACE: + { u8 iface = *(p+2); + + printf((iface == CISTPL_IDE_INTERFACE) ? " IDE" : " unknown"); + printf(" interface "); break; } + case CISTPL_FUNCE_IDE_MASTER: + case CISTPL_FUNCE_IDE_SLAVE: + { u8 f1 = *(p+2); + u8 f2 = *(p+4); - pcmcia_slots[slot].status &= ~PCMCIA_SS_ENABLED; + printf((f1 & CISTPL_IDE_SILICON) ? " [silicon]" : " [rotating]"); - DBG( 1, "%s: slot %d status: %x\n", __FUNCTION__, slot, pcmcia_slots[slot].status ); -DONE: -#else -#warning "FIXME: non sa1111 systems not yet supported" -#endif - return ret; -} + if (f1 & CISTPL_IDE_UNIQUE) + printf(" [unique]"); -/* reset pcmcia slot */ -int WEAK_SYM pcmcia_slot_reset(int slot) -{ - int ret = 0; + printf((f1 & CISTPL_IDE_DUAL) ? " [dual]" : " [single]"); -#ifdef SA1111_BASE - switch ( slot ) { - case 0: - PCCR |= PCCR_S0_RST; - msleep(20); - PCCR &= ~PCCR_S0_RST; - msleep(20); - break; - case 1: - PCCR |= PCCR_S1_RST; - msleep(20); - PCCR &= ~PCCR_S1_RST; - msleep(20); - break; - default: - ret = -1; - break; - } + if (f2 & CISTPL_IDE_HAS_SLEEP) + printf(" [sleep]"); - DBG( 1, "%s: slot %d reset\n", __FUNCTION__, slot ); -#else -#warning "FIXME: non sa1111 systems not yet supported" -#endif - return ret; -} + if (f2 & CISTPL_IDE_HAS_STANDBY) + printf(" [standby]"); -/* dump slot HW line stati */ -int pcmcia_dump_stati( void ) -{ -#ifdef SA1111_BASE - int status = PCSR; + if (f2 & CISTPL_IDE_HAS_IDLE) + printf(" [idle]"); - printf("s0: "); - if (status & PCSR_S0_READY) printf("ready "); else printf(" "); - if (status & PCSR_S0_DETECT) printf("detect "); else printf(" "); - if (status & PCSR_S0_VS1) printf("vs1 "); else printf(" "); - if (status & PCSR_S0_VS2) printf("vs2 "); else printf(" "); - if (status & PCSR_S0_WP) printf("wp "); else printf(" "); - if (status & PCSR_S0_BVD1) printf("bvd1 "); else printf(" "); - if (status & PCSR_S0_BVD2) printf("bvd2 "); else printf(" "); - printf("; "); + if (f2 & CISTPL_IDE_LOW_POWER) + printf(" [low power]"); - printf("s1: "); - if (status & PCSR_S1_READY) printf("ready "); else printf(" "); - if (status & PCSR_S1_DETECT) printf("detect "); else printf(" "); - if (status & PCSR_S1_VS1) printf("vs1 "); else printf(" "); - if (status & PCSR_S1_VS2) printf("vs2 "); else printf(" "); - if (status & PCSR_S1_WP) printf("wp "); else printf(" "); - if (status & PCSR_S1_BVD1) printf("bvd1 "); else printf(" "); - if (status & PCSR_S1_BVD2) printf("bvd2 "); else printf(" "); + if (f2 & CISTPL_IDE_REG_INHIBIT) + printf(" [reg inhibit]"); + + if (f2 & CISTPL_IDE_HAS_INDEX) + printf(" [index]"); + + if (f2 & CISTPL_IDE_IOIS16) + printf(" [IOis16]"); + + break; + } + } printf("\n"); -#else -#warning "FIXME: non sa1111 systems not yet supported" -#endif return 0; } + /* identify pcmcia card */ -int pcmcia_identify( volatile unsigned char *p ) +static int pcmcia_identify( volatile unsigned char *p ) { unsigned char id_str[PCMCIA_MAX_IDENT_CHARS]; unsigned char data; @@ -326,53 +215,36 @@ else break; } - DBG( 1, "%s: id_str='%s'\n", __FUNCTION__, id_str); + _DBG( 1, "%s: id_str='%s'\n", __FUNCTION__, id_str); return (1); /* don't know */ } -/* parse cis tuples of card in slot <slot> */ -int pcmcia_cis_parse( int slot ) +/* parse cis tuples of card in sock <sock> */ +static int pcmcia_cis_parse( struct pcmcia_sock *sock ) { - int ret = 0; - void *cfg_mem_addr = NULL; - volatile u8 *ident = NULL; + int ret = 0; + void *cfg_mem_addr = NULL; volatile u8 *p = NULL; volatile u8 *start = NULL; - int n_features = 0; - u8 func_id = ~0; - u8 len = 0; - u8 code = 0; - u16 config_base = 0; - int found = 0; - int i = 0; + int n_features = 0; + u8 func_id = ~0; + u8 len = 0; + u8 code = 0; + u16 config_base = 0; + int found = 0; + int i = 0; volatile u8 **feature_p; - /* sanity check */ - if ( slot < 0 ) { - printf( "pcmcia: invalid slot slot %d\n", slot ); - ret = -1; - goto DONE; - } - if ( slot > PCMCIA_MAX_SLOTS ) { - printf( "pcmcia: invalid slot slot %d\n", slot ); - ret = -1; - goto DONE; - } - - if ( !( pcmcia_slots[slot].status & PCMCIA_SS_ENABLED ) || - !( pcmcia_slots[slot].status & PCMCIA_SS_DETECT )) { - printf( "pcmcia: slot %d not detected and enabled\n", slot ); - ret = -1; - goto DONE; + if ( !( sock->state & PCMCIA_SS_ENABLED ) || !( sock->state & PCMCIA_SS_DETECT )) { + _DBG( 1, "pcmcia: sock %d not detected and enabled\n", sock ); + _DBGERR( dbg, -1 ); } - cfg_mem_addr = (void *)pcmcia_slots[slot].attr_base; - feature_p = pcmcia_slots[slot].feature_p; - ident = pcmcia_slots[slot].ident; - + cfg_mem_addr = (void *)sock->attr_base; + feature_p = sock->feature_p; - DBG( 1, "%s: PCMCIA MEM: %p\n", __FUNCTION__, cfg_mem_addr); + _DBG( 1, "%s: PCMCIA MEM: %p\n", __FUNCTION__, cfg_mem_addr); start = p = (volatile u8 *)cfg_mem_addr; @@ -386,7 +258,7 @@ len = *p; p += 2; #if PCMCIA_DEBUG - if (pcmcia_dbg > 10) { + if (dbg > 10) { volatile u8 *q = p; printf("\nTuple code %2x length %d\n\tData:", code, len); @@ -400,12 +272,12 @@ switch (code) { case CISTPL_VERS_1: - ident = p + 4; - DBG( 1, "%s: ident=%p\n", __FUNCTION__, ident ); + sock->ident = p + 4; + _DBG( 1, "%s: ident=%p\n", __FUNCTION__, sock->ident ); break; case CISTPL_FUNCID: func_id = *p; - DBG( 1, "%s: func_id=%d\n", __FUNCTION__, func_id ); + _DBG( 1, "%s: func_id=%d\n", __FUNCTION__, func_id ); break; case CISTPL_FUNCE: if (n_features < PCMCIA_MAX_FEATURES) @@ -413,15 +285,15 @@ break; case CISTPL_CONFIG: config_base = (*(p+6) << 8) + (*(p+4)); - pcmcia_slots[slot].config_base = config_base; - DBG( 1, "%s: config_base=0x%04x\n", __FUNCTION__, config_base ); + sock->config_base = config_base; + _DBG( 1, "%s: config_base=0x%04x\n", __FUNCTION__, config_base ); default: break; } p += 2 * len; } - found = pcmcia_identify( ident ); + found = pcmcia_identify( sock->ident ); if (func_id != ((u8)~0)) { pcmcia_print_funcid(func_id); @@ -441,249 +313,352 @@ return ret; } -int pcmcia_slot_address_get( int slot, u32 *base, u32 *attr ) +/********************************************************************** + * exported functions + */ + +pcmcia_driver_t *pcmcia_driver = NULL; + +void pcmcia_dbg_set( int level ) +{ + dbg = level; +} + +/********************************************************************* + * pcmcia_init - init pcmcia subsystem + * + * Initializes lowlevel driver. Each detected card is reset and identified. + */ +int pcmcia_init( void ) { int ret = 0; + int nr, start, end; + int detected = 0; + struct pcmcia_sock *sockets; - /* sanity check */ - if ( slot < 0 ) { - printf( "pcmcia: invalid slot slot %d\n", slot ); - ret = -1; - goto DONE; + if ( !pcmcia_driver ) _DBGERR( dbg, -EINVAL ); + + /* init subsystem */ + if ( pcmcia_driver->init ) { + ret = pcmcia_driver->init(); + if ( ret ) _DBGERR( dbg, ret ); } - if ( slot > PCMCIA_MAX_SLOTS ) { - printf( "pcmcia: invalid slot slot %d\n", slot ); - ret = -1; - goto DONE; + + sockets = pcmcia_driver->sock; + + /* for each sock starting with first */ + start = pcmcia_driver->first; + end = start + pcmcia_driver->nr; + for ( nr=start; nr<end; nr++ ) { + struct pcmcia_sock *sock = sockets + nr; + + /* detect */ + ret = pcmcia_sock_detect( sock ); + if ( ret <= 0 ) continue; + _DBG( 1, "detected socket %d", nr ); + + /* enable */ + ret = pcmcia_sock_enable( sock ); + if ( ret ) continue; + _DBG( 1, "enabled socket %d", nr ); + + /* reset */ + ret = pcmcia_sock_reset( sock ); + if ( ret ) _DBGERR( dbg, ret ); + _DBG( 1, "reset socket %d", nr ); + + /* identify */ + ret = pcmcia_cis_parse( sock ); + if ( ret ) _DBGERR( dbg, ret ); + detected ++; } - if ( !( pcmcia_slots[slot].status & PCMCIA_SS_ENABLED ) || - !( pcmcia_slots[slot].status & PCMCIA_SS_DETECT )) { - printf( "pcmcia: slot %d not detected and enabled\n", slot ); - ret = -1; - goto DONE; + ret = detected; +DONE: + return ret; } - DBG( 1, "%s: base=%p\n", __FUNCTION__, (void *)pcmcia_slots[slot].base); - DBG( 1, "%s: attr_base=%p\n", __FUNCTION__, (void *)pcmcia_slots[slot].attr_base); +/********************************************************************* + * pcmcia_sock_dump_status - dump socket status + * @nr: desc + */ +int pcmcia_sock_dump_status( nr ) +{ + int ret = 0; + struct pcmcia_sock *sock = NULL; - if ( base ) *base = pcmcia_slots[slot].base; - if ( attr ) *attr = pcmcia_slots[slot].attr_base; + if ( !pcmcia_driver ) _DBGERR( dbg, -EINVAL ); + if ( !PCMCIA_SOCK_NR_VALID( nr ) ) _DBGERR( dbg, -EINVAL ); - ret = 0; + ret = pcmcia_sock_get( nr, &sock ); + if ( ret ) _DBGERR( dbg, ret ); + + ret = pcmcia_driver->sock_status_dump( sock ); DONE: return ret; } -int pcmcia_slot_cfg_reg_get( int slot, u16 *cfg_base ) +/********************************************************************* + * pcmcia_sock_reset - reset socket + * @sock: desc + */ +int pcmcia_sock_reset( struct pcmcia_sock *sock ) { int ret = 0; - /* sanity check */ - if ( slot < 0 ) { - printf( "pcmcia: invalid slot slot %d\n", slot ); - ret = -1; - goto DONE; + if ( !sock ) _DBGERR( dbg, -EINVAL ); + if ( !pcmcia_driver ) _DBGERR( dbg, -EINVAL ); + + if ( pcmcia_driver->sock_reset ) { + ret = pcmcia_driver->sock_reset( sock ); + _DBG( 1, "sock_reset() = %d", ret ); } - if ( slot > PCMCIA_MAX_SLOTS ) { - printf( "pcmcia: invalid slot slot %d\n", slot ); - ret = -1; - goto DONE; +DONE: + return ret; } - if ( !( pcmcia_slots[slot].status & PCMCIA_SS_ENABLED ) || - !( pcmcia_slots[slot].status & PCMCIA_SS_DETECT )) { - printf( "pcmcia: slot %d not detected and enabled\n", slot ); - ret = -1; - goto DONE; - } +/********************************************************************* + * pcmcia_sock_detect - detect socket + * @sock: desc + */ +int pcmcia_sock_detect( struct pcmcia_sock *sock ) +{ + int ret = 1; - DBG( 1, "%s: cfg_base=0x%03x\n", __FUNCTION__, pcmcia_slots[slot].config_base); + if ( !sock ) _DBGERR( dbg, -EINVAL ); + if ( !pcmcia_driver ) _DBGERR( dbg, -EINVAL ); - if ( cfg_base ) *cfg_base = pcmcia_slots[slot].config_base; + if ( pcmcia_driver->sock_detect ) { + ret = pcmcia_driver->sock_detect( sock ); + if ( ret < 0 ) _DBGERR( dbg, ret ); + } - ret = 0; + _DBG( 1, "detect = %d", ret ); + + if ( ret ) { + sock->state |= PCMCIA_SS_DETECT; + } else { + sock->state &= ~PCMCIA_SS_DETECT; + } DONE: return ret; } -int pcmcia_slot_attr_read( int slot, u16 offset, u8 *value ) +/********************************************************************* + * pcmcia_sock_enable - enable socket + * @sock: desc + */ +int pcmcia_sock_enable( struct pcmcia_sock *sock ) { int ret = 0; - /* sanity check */ - if ( slot < 0 ) { - printf( "pcmcia: invalid slot slot %d\n", slot ); - ret = -1; - goto DONE; - } - if ( slot > PCMCIA_MAX_SLOTS ) { - printf( "pcmcia: invalid slot slot %d\n", slot ); - ret = -1; - goto DONE; + if ( !sock ) _DBGERR( dbg, -EINVAL ); + if ( !pcmcia_driver ) _DBGERR( dbg, -EINVAL ); + + if ( pcmcia_driver->sock_enable ) { + ret = pcmcia_driver->sock_enable( sock ); + if ( ret ) _DBGERR( dbg, ret ); } - if ( !value ) { - printf( "pcmcia: value==NULL\n" ); - ret = -1; - goto DONE; + + sock->state |= PCMCIA_SS_ENABLED; +DONE: + return ret; } - if ( !( pcmcia_slots[slot].status & PCMCIA_SS_ENABLED ) || - !( pcmcia_slots[slot].status & PCMCIA_SS_DETECT )) { - printf( "pcmcia: slot %d not detected and enabled\n", slot ); - ret = -1; - goto DONE; +/********************************************************************* + * pcmcia_sock_disable - disable socket + * @sock: desc + */ +int pcmcia_sock_disable( struct pcmcia_sock *sock ) +{ + int ret = 0; + + if ( !sock ) _DBGERR( dbg, -EINVAL ); + if ( !pcmcia_driver ) _DBGERR( dbg, -EINVAL ); + + if ( pcmcia_driver->sock_disable ) { + ret = pcmcia_driver->sock_disable( sock ); + if ( ret ) _DBGERR( dbg, ret ); } - *value = MEMb( - pcmcia_slots[slot].attr_base + - pcmcia_slots[slot].config_base + - offset - ); + sock->state &= ~PCMCIA_SS_ENABLED; +DONE: + return ret; +} - DBG( 1, "%s: ATTR_REG(0x%02x) => 0x%02x\n", __FUNCTION__, - offset, *value ); +/********************************************************************* + * pcmcia_sock_get - short desc + * @nr: desc + * @sock: desc + * + * Long desc + */ +int pcmcia_sock_get( int nr, struct pcmcia_sock **sock ) +{ + int ret = 0; - ret = 0; + if ( !pcmcia_driver ) _DBGERR( dbg, -EINVAL ); + if ( !PCMCIA_SOCK_NR_VALID( nr ) ) _DBGERR( dbg, -EINVAL ); + + if ( sock ) + *sock = pcmcia_driver->sock + nr; DONE: return ret; } -int pcmcia_slot_attr_write( int slot, u16 offset, u8 value ) +/****************************************************************************** + * ATTRIBUTE SPACE ACCESS + */ +int pcmcia_sock_attr_read( int sock, u16 offset, u8 *value ) { int ret = 0; - /* sanity check */ - if ( slot < 0 ) { - printf( "pcmcia: invalid slot slot %d\n", slot ); - ret = -1; - goto DONE; - } - if ( slot > PCMCIA_MAX_SLOTS ) { - printf( "pcmcia: invalid slot slot %d\n", slot ); - ret = -1; - goto DONE; - } + if ( !PCMCIA_SOCK_NR_VALID( sock ) ) _DBGERR( dbg, -EINVAL ); - if ( !( pcmcia_slots[slot].status & PCMCIA_SS_ENABLED ) || - !( pcmcia_slots[slot].status & PCMCIA_SS_DETECT )) { - printf( "pcmcia: slot %d not detected and enabled\n", slot ); - ret = -1; - goto DONE; + *value = MEMb( pcmcia_driver->sock[sock].attr_base + offset ); + + _DBG( 1, "%s: ATTR_REG(0x%02x) => 0x%02x\n", __FUNCTION__, + offset, *value ); + + ret = 0; +DONE: + return ret; } - DBG( 1, "%s: ATTR_REG(0x%02x) <= 0x%02x\n", __FUNCTION__, +int pcmcia_sock_attr_write( int sock, u16 offset, u8 value ) +{ + int ret = 0; + + if ( !PCMCIA_SOCK_NR_VALID( sock ) ) _DBGERR( dbg, -EINVAL ); + + _DBG( 1, "%s: ATTR_REG(0x%02x) <= 0x%02x\n", __FUNCTION__, offset, value ); - MEMb( pcmcia_slots[slot].attr_base + - pcmcia_slots[slot].config_base + - offset - ) = value; + MEMb( pcmcia_driver->sock[sock].attr_base + offset) = value; ret = 0; DONE: return ret; } -/********************************************************************** - * static functions +/****************************************************************************** + * IO SPACE ACCESS */ - -/* print function id strings */ -static int pcmcia_print_funcid(int func) +int pcmcia_sock_io_read( int sock, u16 offset, u8 *value ) { - printf("\t "); - switch (func) { - case CISTPL_FUNCID_MULTI: - printf("Multi-Function"); - break; - case CISTPL_FUNCID_MEMORY: - printf("Memory"); - break; - case CISTPL_FUNCID_SERIAL: - printf("Serial Port"); - break; - case CISTPL_FUNCID_PARALLEL: - printf("Parallel Port"); - break; - case CISTPL_FUNCID_FIXED: - printf("Fixed Disk"); - break; - case CISTPL_FUNCID_VIDEO: - printf("Video Adapter"); - break; - case CISTPL_FUNCID_NETWORK: - printf("Network Adapter"); - break; - case CISTPL_FUNCID_AIMS: - printf("AIMS Card"); - break; - case CISTPL_FUNCID_SCSI: - printf("SCSI Adapter"); - break; - default: - printf("Unknown"); - break; - } - printf(" Card\n"); + int ret = 0; - return 0; + if ( !PCMCIA_SOCK_NR_VALID( sock ) ) _DBGERR( dbg, -EINVAL ); + + *value = MEMb( pcmcia_driver->sock[sock].io_base + offset); + + _DBG( 1, "%s: IO_REG(0x%02x) => 0x%02x\n", __FUNCTION__, + offset, *value ); + + ret = 0; +DONE: + return ret; } -/* print info for FIXED_DISK function type card */ -static int pcmcia_print_fixed(volatile u8 *p) +int pcmcia_sock_io_write( int sock, u16 offset, u8 value ) { - if (p == NULL) - return -1; + int ret = 0; - printf("\t "); + if ( !PCMCIA_SOCK_NR_VALID( sock ) ) _DBGERR( dbg, -EINVAL ); - switch (*p) { - case CISTPL_FUNCE_IDE_IFACE: - { u8 iface = *(p+2); + _DBG( 1, "%s: IO_REG(0x%02x) <= 0x%02x\n", __FUNCTION__, + offset, value ); - printf((iface == CISTPL_IDE_INTERFACE) ? " IDE" : " unknown"); - printf(" interface "); - break; + MEMb( pcmcia_driver->sock[sock].io_base + value ); + ret = 0; +DONE: + return ret; } - case CISTPL_FUNCE_IDE_MASTER: - case CISTPL_FUNCE_IDE_SLAVE: - { u8 f1 = *(p+2); - u8 f2 = *(p+4); - printf((f1 & CISTPL_IDE_SILICON) ? " [silicon]" : " [rotating]"); +/****************************************************************************** + * MEMORY SPACE ACCESS + */ +int pcmcia_sock_mem_read( int sock, u16 offset, u8 *value ) +{ + int ret = 0; - if (f1 & CISTPL_IDE_UNIQUE) - printf(" [unique]"); + if ( !PCMCIA_SOCK_NR_VALID( sock ) ) _DBGERR( dbg, -EINVAL ); - printf((f1 & CISTPL_IDE_DUAL) ? " [dual]" : " [single]"); + *value = MEMb( pcmcia_driver->sock[sock].mem_base + offset); - if (f2 & CISTPL_IDE_HAS_SLEEP) - printf(" [sleep]"); + _DBG( 1, "%s: MEM_REG(0x%02x) => 0x%02x\n", __FUNCTION__, + offset, *value ); - if (f2 & CISTPL_IDE_HAS_STANDBY) - printf(" [standby]"); + ret = 0; +DONE: + return ret; +} - if (f2 & CISTPL_IDE_HAS_IDLE) - printf(" [idle]"); +int pcmcia_sock_mem_write( int sock, u16 offset, u8 value ) +{ + int ret = 0; - if (f2 & CISTPL_IDE_LOW_POWER) - printf(" [low power]"); + if ( !PCMCIA_SOCK_NR_VALID( sock ) ) _DBGERR( dbg, -EINVAL ); - if (f2 & CISTPL_IDE_REG_INHIBIT) - printf(" [reg inhibit]"); + _DBG( 1, "%s: MEM_REG(0x%02x) <= 0x%02x\n", __FUNCTION__, + offset, value ); - if (f2 & CISTPL_IDE_HAS_INDEX) - printf(" [index]"); + MEMb( pcmcia_driver->sock[sock].mem_base + value ); + ret = 0; +DONE: + return ret; +} - if (f2 & CISTPL_IDE_IOIS16) - printf(" [IOis16]"); +/****************************************************************************** + * Test commands + */ - break; - } +/********************************************************************* + * test_pcmcia_cmd - short desc + * @argc: desc + * @char *argv[]: desc + * + * Long desc + */ +int test_pcmcia_cmd( int argc, char *argv[] ) +{ + int ret = 0; + int nr, start, end; + + pcmcia_dbg_set( 100 ); + + if ( !pcmcia_driver ) { + printf( "No pcmcia driver!\n" ); + ret = -EINVAL; goto DONE; } + + printf( "Testing BLOB PCMCIA\n" ); + printf( "-------------------\n" ); + printf("\n"); + printf( "driver: '%s'\n", pcmcia_driver->name?pcmcia_driver->name:"UNKNOWN" ); + + printf( "\n" ); + printf( "%d sockets configured, starting at %d\n", pcmcia_driver->nr, pcmcia_driver->first ); + + start = pcmcia_driver->first; + end = start + pcmcia_driver->nr; + for ( nr=start; nr<end; nr++ ) { + struct pcmcia_sock *sock; + ret = pcmcia_sock_get( nr, &sock ); + if ( ret ) _DBGERR( dbg, ret ); + + printf( "Socket %d: IO [ 0x%08X ], ATTR [ 0x%08X ], MEM [ 0x%08X ]\n", + nr, sock->io_base, sock->attr_base, sock->mem_base ); - return 0; } + ret = pcmcia_init(); + printf( "detected %d cards.\n", ret ); + + ret = 0; +DONE: + return ret; +} +char pcmciatest_help[] = "pcmcia_test command\n"; +__commandlist(test_pcmcia_cmd, "pcmcia_test", pcmciatest_help ); Index: Makefile.am =================================================================== RCS file: /cvsroot/blob/blob/src/lib/Makefile.am,v retrieving revision 1.35 retrieving revision 1.36 diff -u -d -r1.35 -r1.36 --- Makefile.am 27 Nov 2003 08:02:31 -0000 1.35 +++ Makefile.am 9 Feb 2004 19:25:12 -0000 1.36 @@ -75,6 +75,8 @@ ip_bits.c\ ide.c \ pcmcia.c \ + pcmcia-sa1111.c \ + pcmcia-pxa.c \ cf.c \ generic_io.c \ gio_part_blob.c \ |
From: Stefan E. <se...@us...> - 2004-02-06 10:35:06
|
Update of /cvsroot/blob/blob/include/blob In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27649 Modified Files: Makefile.am pcmcia.h Added Files: pcmcia-cis.h Log Message: PCMCIA CLEANUP remove CIS definitions from generic pcmcia header --- NEW FILE: pcmcia-cis.h --- /********************************************************************** * pcmcia-cis.h - CIS tuple definitions for PCMCIA * * (C) by Stefan Eletzhofer <ste...@el...> * * 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 */ #ifndef INC_PCMCIA_CIS_H #define INC_PCMCIA_CIS_H 1 /* defines for PCMCIA configuration information */ #define PCMCIA_MAX_TUPEL_SZ 512 #define PCMCIA_MAX_FEATURES 4 #define PCMCIA_MAX_IDENT_CHARS 64 #define PCMCIA_MAX_IDENT_FIELDS 4 #define PCMCIA_MAX_FEATURES 4 #define CISTPL_VERS_1 0x15 #define CISTPL_FUNCID 0x21 #define CISTPL_FUNCE 0x22 #define CISTPL_CONFIG 0x1a /* * CIS Function ID codes */ #define CISTPL_FUNCID_MULTI 0x00 #define CISTPL_FUNCID_MEMORY 0x01 #define CISTPL_FUNCID_SERIAL 0x02 #define CISTPL_FUNCID_PARALLEL 0x03 #define CISTPL_FUNCID_FIXED 0x04 #define CISTPL_FUNCID_VIDEO 0x05 #define CISTPL_FUNCID_NETWORK 0x06 #define CISTPL_FUNCID_AIMS 0x07 #define CISTPL_FUNCID_SCSI 0x08 /* * Fixed Disk FUNCE codes */ #define CISTPL_IDE_INTERFACE 0x01 #define CISTPL_FUNCE_IDE_IFACE 0x01 #define CISTPL_FUNCE_IDE_MASTER 0x02 #define CISTPL_FUNCE_IDE_SLAVE 0x03 /* First feature byte */ #define CISTPL_IDE_SILICON 0x04 #define CISTPL_IDE_UNIQUE 0x08 #define CISTPL_IDE_DUAL 0x10 /* Second feature byte */ #define CISTPL_IDE_HAS_SLEEP 0x01 #define CISTPL_IDE_HAS_STANDBY 0x02 #define CISTPL_IDE_HAS_IDLE 0x04 #define CISTPL_IDE_LOW_POWER 0x08 #define CISTPL_IDE_REG_INHIBIT 0x10 #define CISTPL_IDE_HAS_INDEX 0x20 #define CISTPL_IDE_IOIS16 0x40 #endif Index: Makefile.am =================================================================== RCS file: /cvsroot/blob/blob/include/blob/Makefile.am,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- Makefile.am 5 Feb 2004 18:07:27 -0000 1.23 +++ Makefile.am 6 Feb 2004 10:32:19 -0000 1.24 @@ -50,6 +50,7 @@ param_block.h \ partition.h \ pcmcia.h \ + pcmcia-cis.h \ reboot.h \ serial.h \ tar.h \ Index: pcmcia.h =================================================================== RCS file: /cvsroot/blob/blob/include/blob/pcmcia.h,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- pcmcia.h 3 Apr 2003 15:06:28 -0000 1.8 +++ pcmcia.h 6 Feb 2004 10:32:19 -0000 1.9 @@ -21,54 +21,7 @@ #ifndef BLOB_PCMCIA_H #define BLOB_PCMCIA_H 1 -/* defines for PCMCIA configuration information */ -#define PCMCIA_MAX_TUPEL_SZ 512 -#define PCMCIA_MAX_FEATURES 4 - -#define PCMCIA_MAX_IDENT_CHARS 64 -#define PCMCIA_MAX_IDENT_FIELDS 4 -#define PCMCIA_MAX_FEATURES 4 - -#define CISTPL_VERS_1 0x15 -#define CISTPL_FUNCID 0x21 -#define CISTPL_FUNCE 0x22 -#define CISTPL_CONFIG 0x1a - -/* - * CIS Function ID codes - */ -#define CISTPL_FUNCID_MULTI 0x00 -#define CISTPL_FUNCID_MEMORY 0x01 -#define CISTPL_FUNCID_SERIAL 0x02 -#define CISTPL_FUNCID_PARALLEL 0x03 -#define CISTPL_FUNCID_FIXED 0x04 -#define CISTPL_FUNCID_VIDEO 0x05 -#define CISTPL_FUNCID_NETWORK 0x06 -#define CISTPL_FUNCID_AIMS 0x07 -#define CISTPL_FUNCID_SCSI 0x08 - -/* - * Fixed Disk FUNCE codes - */ -#define CISTPL_IDE_INTERFACE 0x01 - -#define CISTPL_FUNCE_IDE_IFACE 0x01 -#define CISTPL_FUNCE_IDE_MASTER 0x02 -#define CISTPL_FUNCE_IDE_SLAVE 0x03 - -/* First feature byte */ -#define CISTPL_IDE_SILICON 0x04 -#define CISTPL_IDE_UNIQUE 0x08 -#define CISTPL_IDE_DUAL 0x10 - -/* Second feature byte */ -#define CISTPL_IDE_HAS_SLEEP 0x01 -#define CISTPL_IDE_HAS_STANDBY 0x02 -#define CISTPL_IDE_HAS_IDLE 0x04 -#define CISTPL_IDE_LOW_POWER 0x08 -#define CISTPL_IDE_REG_INHIBIT 0x10 -#define CISTPL_IDE_HAS_INDEX 0x20 -#define CISTPL_IDE_IOIS16 0x40 +#include <blob/pcmcia-cis.h> /********************************************************************** * Arch dependent defines (should be pretty much the same everywhere, |
From: Russ D. <Rus...@as...> - 2004-02-06 10:29:46
|
> But I got link errors. The above macro ended up un a call to unsave_strcmp_call(). Thats > why I noticed, and thus converted the whole mess. I didnt notice this macro, I thought erik > removed strcmp() altogether. > > (This was gcc 2.95.3) > If you get link errors, then I need to fix the macro. Any clue why gcc 2.95.3 isn't return true on __builtin_constant_p("blob")? -- Russ Dill <Rus...@as...> |
From: <ste...@el...> - 2004-02-06 10:07:29
|
On Thu, Feb 05, 2004 at 03:16:21PM -0700, Russ Dill wrote: > On Thu, 2004-02-05 at 11:49, Stefan Eletzhofer wrote: > > Update of /cvsroot/blob/blob/src/lib > > In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25457/lib > > > > Modified Files: > > download.c > > Log Message: > > Remove strcmp() calls, use strncmp(). > > the strncmp calls were removed on purpose. Making you sit there and > count the characters is error prone. strcmp in blob is just a macro: > > #define strcmp(s1, s2) \ > (__builtin_constant_p(s1) ? strncmp(s1, s2, sizeof(s1)) : \ > (__builtin_constant_p(s2) ? strncmp(s1, s2, sizeof(s2)) : \ > unsafe_strcmp_call(s1, s2))) But I got link errors. The above macro ended up un a call to unsave_strcmp_call(). Thats why I noticed, and thus converted the whole mess. I didnt notice this macro, I thought erik removed strcmp() altogether. (This was gcc 2.95.3) > > If one of the arguments is not a constant, then it will cause a link error. > Otherwise, it will count the number of characters for you, and replace the > call with strncmp > > -- > Russ Dill <Rus...@as...> -- Eletztrick Computing - Customized Linux Development Stefan Eletzhofer, Marktstrasse 43, DE-88214 Ravensburg http://www.eletztrick.de |
From: Russ D. <Rus...@as...> - 2004-02-05 22:16:06
|
On Thu, 2004-02-05 at 11:49, Stefan Eletzhofer wrote: > Update of /cvsroot/blob/blob/src/lib > In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25457/lib > > Modified Files: > download.c > Log Message: > Remove strcmp() calls, use strncmp(). the strncmp calls were removed on purpose. Making you sit there and count the characters is error prone. strcmp in blob is just a macro: #define strcmp(s1, s2) \ (__builtin_constant_p(s1) ? strncmp(s1, s2, sizeof(s1)) : \ (__builtin_constant_p(s2) ? strncmp(s1, s2, sizeof(s2)) : \ unsafe_strcmp_call(s1, s2))) If one of the arguments is not a constant, then it will cause a link error. Otherwise, it will count the number of characters for you, and replace the call with strncmp -- Russ Dill <Rus...@as...> |
From: Stefan E. <se...@us...> - 2004-02-05 19:00:53
|
Update of /cvsroot/blob/blob/src/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27742 Modified Files: serial.c Log Message: Stupid me. Used old timer code. Index: serial.c =================================================================== RCS file: /cvsroot/blob/blob/src/lib/serial.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- serial.c 5 Feb 2004 18:16:03 -0000 1.13 +++ serial.c 5 Feb 2004 18:58:17 -0000 1.14 @@ -262,12 +262,12 @@ int skipNewline = 1; int maxRead = len - 1; - startTime = TimerGetTime(); + startTime = timer_read(); for(numRead = 0, i = 0; numRead < maxRead;) { /* try to get a byte from the serial port */ while(serial_poll() == 0) { - currentTime = TimerGetTime(); + currentTime = timer_read(); /* check timeout value */ if((currentTime - startTime) > |
From: Stefan E. <se...@us...> - 2004-02-05 18:51:54
|
Update of /cvsroot/blob/blob/src/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25457/lib Modified Files: download.c Log Message: Remove strcmp() calls, use strncmp(). Index: download.c =================================================================== RCS file: /cvsroot/blob/blob/src/lib/download.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- download.c 4 Dec 2003 21:45:19 -0000 1.4 +++ download.c 5 Feb 2004 18:49:19 -0000 1.5 @@ -52,13 +52,13 @@ { blob_item_t *ret = NULL; - if (!strcmp(what, "blob")) + if (!strncmp(what, "blob", 4)) ret = &blob_status.blob; - else if (!strcmp(what, "param")) + else if (!strncmp(what, "param", 5)) ret = &blob_status.param; - else if (!strcmp(what, "kernel")) + else if (!strncmp(what, "kernel", 6 )) ret = &blob_status.kernel; - else if (!strcmp(what, "ramdisk")) + else if (!strncmp(what, "ramdisk", 7 )) ret = &blob_status.ramdisk; return ret; @@ -128,7 +128,7 @@ #if defined(CONFIG_CRAMFS_SUPPORT) || \ defined(CONFIG_ZIMAGE_SUPPORT) || \ defined(CONFIG_JFFS2_SUPPORT) - if (!strcmp("kernel", what)) { + if (!strncmp("kernel", what, 6 )) { item->size = 0; load_kernel(&blob_status); } else @@ -159,33 +159,33 @@ if(argc < 2) return -ENOPARAMS; - if(strcmp(argv[1], "1200") == 0) { + if(strncmp(argv[1], "1200", 4) == 0) { blob_status.downloadSpeed = baud_1200; - } else if(strcmp(argv[1], "1k2") == 0) { + } else if(strncmp(argv[1], "1k2", 3) == 0) { blob_status.downloadSpeed = baud_1200; - } else if(strcmp(argv[1], "9600") == 0) { + } else if(strncmp(argv[1], "9600", 4) == 0) { blob_status.downloadSpeed = baud_9600; - } else if(strcmp(argv[1], "9k6") == 0) { + } else if(strncmp(argv[1], "9k6", 3) == 0) { blob_status.downloadSpeed = baud_9600; - } else if(strcmp(argv[1], "19200") == 0) { + } else if(strncmp(argv[1], "19200", 5) == 0) { blob_status.downloadSpeed = baud_19200; - } else if(strcmp(argv[1], "19k2") == 0) { + } else if(strncmp(argv[1], "19k2", 4) == 0) { blob_status.downloadSpeed = baud_19200; - } else if(strcmp(argv[1], "38400") == 0) { + } else if(strncmp(argv[1], "38400", 5) == 0) { blob_status.downloadSpeed = baud_38400; - } else if(strcmp(argv[1], "38k4") == 0) { + } else if(strncmp(argv[1], "38k4", 4) == 0) { blob_status.downloadSpeed = baud_38400; - } else if(strcmp(argv[1], "57600") == 0) { + } else if(strncmp(argv[1], "57600", 5) == 0) { blob_status.downloadSpeed = baud_57600; - } else if(strcmp(argv[1], "57k6") == 0) { + } else if(strncmp(argv[1], "57k6", 4) == 0) { blob_status.downloadSpeed = baud_57600; - } else if(strcmp(argv[1], "115200") == 0) { + } else if(strncmp(argv[1], "115200", 6) == 0) { blob_status.downloadSpeed = baud_115200; - } else if(strcmp(argv[1], "115k2") == 0) { + } else if(strncmp(argv[1], "115k2", 5) == 0) { blob_status.downloadSpeed = baud_115200; - } else if(strcmp(argv[1], "230400") == 0) { + } else if(strncmp(argv[1], "230400", 6) == 0) { blob_status.downloadSpeed = baud_230400; - } else if(strcmp(argv[1], "230k4") == 0) { + } else if(strncmp(argv[1], "230k4", 5) == 0) { blob_status.downloadSpeed = baud_230400; } else { return -EINVAL; |
From: Stefan E. <se...@us...> - 2004-02-05 18:29:49
|
Update of /cvsroot/blob/blob/src/blob In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20035 Modified Files: dafit.c Log Message: Dafit autoboot handler. MSP processor reset. Index: dafit.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/dafit.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- dafit.c 10 Nov 2003 20:59:35 -0000 1.6 +++ dafit.c 5 Feb 2004 18:27:13 -0000 1.7 @@ -45,6 +45,7 @@ #include <blob/time.h> #include <blob/partition.h> #include <blob/led.h> +#include <blob/autoboot.h> #include <blob/arch.h> #include <blob/proc/sa1111.h> @@ -66,12 +67,12 @@ #define SET(reg,bit) ((reg) |= (1<<(bit))) #define RST(reg,bit) ((reg) &= ~(1<<(bit))) -#define DAFIT_DEBUG 1 +#undef DAFIT_DEBUG 1 #if DAFIT_DEBUG -# define DBG( x, args... ) if ( dbg>=x ) printf( args ) +# define _DBG( x, args... ) if ( dbg>=x ) printf( args ) #else -# define DBG( x, args... ) +# define _DBG( x, args... ) #endif /********************************************************************** @@ -87,7 +88,7 @@ #if DAFIT_DEBUG static int dbg = 1; #else -static int sys3_dbg = 0; +static int dbg = 0; #endif /* flash descriptor for System3 flash. */ @@ -234,6 +235,7 @@ GPSR |= GPIO_GPIO13 | GPIO_GPIO15 | + GPIO_GPIO25 | GPIO_GPIO26; GPCR |= GPIO_GPIO7 | @@ -248,8 +250,7 @@ GPIO_GPIO21 | GPIO_GPIO22 | GPIO_GPIO23 | - GPIO_GPIO24 | - GPIO_GPIO25; + GPIO_GPIO24; /* activate SYSCLCK for keyboard controller */ RST( MEM(TUCR), 31 ); @@ -265,14 +266,34 @@ /* tweak blob config */ blob_status.boot_delay = 1; +} +__initlist(dafit_init_hardware, INIT_LEVEL_INITIAL_HARDWARE+5); + +/********************************************************************** + * dafit autoboot + * + * autoboot if we dont get "BlobStop" during the first 100 ms after we say + * "BlobStop". + */ +int dafit_check_autoboot( void *unused ) +{ + /* quick boot */ + char buffer[20] = {0}; + int ret = 1; + + printf( "BlobStop\n" ); + ret = SerialInputStringMs( buffer, 9, 100 ); /* 100 ms to */ + if ( ret == 8 && strncmp( buffer, "BlobStop", 8 ) == 0 ) { + ret = 0; /* stop autoboot */ + } + return ret; } -__initlist(dafit_init_hardware, INIT_LEVEL_OTHER_HARDWARE); /********************************************************************** - * dafit default partition table + * dafit other hw stuff */ -static void dafit_set_partition_table(void) +static void dafit_other_stuff(void) { /* the default partition table */ default_partition_table = dafit_default_partition_table; @@ -282,12 +303,21 @@ * parser figure out. */ flash_partition_table = (blob_partition_t*)0x00000000; -} -__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 */ + msleep(50); + /* reset MSP */ + GPCR |= GPIO_GPIO25; + msleep(5); + GPSR |= GPIO_GPIO25; + + if ( (MEM(DAFIT_CTRL_IRQSR1) & (1<<5)) == 0 ) { + /* quick boot */ + blob_autoboot_fn = dafit_check_autoboot; + blob_autoboot_priv = NULL; + } +} +__initlist(dafit_other_stuff, INIT_LEVEL_OTHER_STUFF); /***************************************************************** * sysver - print system version @@ -353,10 +383,10 @@ printf( "setdbg: debug level set to %d\n", dbg ); return 0; } + static char setdbg_help[] = "setdbg level\n"; __commandlist(setdbg_cmd, "setdbg", setdbg_help); - #if defined(CONFIG_PCMCIA_SUPPORT) /***************************************************************** * pcmcia_init - initialize PCMCIA @@ -368,8 +398,6 @@ } #endif - - /***************************************************************** * misc utility funcs */ @@ -378,12 +406,6 @@ * manually reference flash and download commands until they * are in libblob. */ -#if 0 -extern int cf_test_module( int argc, char *argv[] ); -extern char cf_help[]; -__commandlist(cf_test_module, "cftest", cf_help); -#endif - #if 1 extern int fwrite_cmd(int argc, char *argv[]); extern char fwrite_help[]; @@ -397,5 +419,3 @@ extern int dlfile_cmd(int argc, char *argv[]); extern char dlfile_help[]; __commandlist(dlfile_cmd, "dlfile", dlfile_help); - - |
From: Stefan E. <se...@us...> - 2004-02-05 18:18:38
|
Update of /cvsroot/blob/blob/include/blob In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17799/include/blob Modified Files: time.h Log Message: SerialInputString with millisecond timeout option. Index: time.h =================================================================== RCS file: /cvsroot/blob/blob/include/blob/time.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- time.h 4 Sep 2003 18:03:09 -0000 1.4 +++ time.h 5 Feb 2004 18:16:03 -0000 1.5 @@ -43,6 +43,7 @@ #define TICKS_PER_SECOND 3686400 +#define TICKS_PER_MILLI 3686 typedef void (*timer_init_func_t)(void); typedef u32 (*timer_read_func_t)(void); |
From: Stefan E. <se...@us...> - 2004-02-05 18:18:38
|
Update of /cvsroot/blob/blob/src/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17799/src/lib Modified Files: serial.c Log Message: SerialInputString with millisecond timeout option. Index: serial.c =================================================================== RCS file: /cvsroot/blob/blob/src/lib/serial.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- serial.c 4 Sep 2003 17:42:56 -0000 1.12 +++ serial.c 5 Feb 2004 18:16:03 -0000 1.13 @@ -250,6 +250,67 @@ * len is the length of array s _including_ the trailing zero, * the function returns the number of bytes read _excluding_ * the trailing zero + * + * MILLISECOND TIMEOUT + */ +int SerialInputStringMs(char *s, const int len, const int timeout) +{ + u32 startTime, currentTime; + int c; + int i; + int numRead; + int skipNewline = 1; + int maxRead = len - 1; + + startTime = TimerGetTime(); + + for(numRead = 0, i = 0; numRead < maxRead;) { + /* try to get a byte from the serial port */ + while(serial_poll() == 0) { + currentTime = TimerGetTime(); + + /* check timeout value */ + if((currentTime - startTime) > + (timeout * (TICKS_PER_MILLI))) { + /* timeout */ + s[i++] = '\0'; + return(numRead); + } + } + + c = serial_read(); + + /* check for errors */ + if(c < 0) { + s[i++] = '\0'; + return c; + } + + /* eat newline characters at start of string */ + if((skipNewline == 1) && (c != '\r') && (c != '\n')) + skipNewline = 0; + + if(skipNewline == 0) { + if((c == '\r') || (c == '\n')) { + s[i++] = '\0'; + return(numRead); + } else { + s[i++] = (char)c; + numRead++; + } + } + } + + return(numRead); +} + +/* + * read a string with maximum length len from the serial port + * using a timeout of timeout seconds + * + * len is the length of array s _including_ the trailing zero, + * the function returns the number of bytes read _excluding_ + * the trailing zero */ int SerialInputString(char *s, const int len, int timeout) { @@ -304,7 +365,6 @@ - /* * SerialInputBlock(): almost the same as SerialInputString(), but * this one just reads a block of characters without looking at |
From: Stefan E. <se...@us...> - 2004-02-05 18:18:06
|
Update of /cvsroot/blob/blob/include/blob In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17671/include/blob Modified Files: linux.h Log Message: DAFIT has its own arch type now. Index: linux.h =================================================================== RCS file: /cvsroot/blob/blob/include/blob/linux.h,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- linux.h 27 Nov 2003 03:24:31 -0000 1.18 +++ linux.h 5 Feb 2004 18:15:32 -0000 1.19 @@ -72,8 +72,10 @@ # define ARCH_NUMBER (97) #elif defined SMDK2500 # define ARCH_NUMBER (166) -#elif defined PT_SYSTEM3 || defined PT_DAFIT +#elif defined PT_SYSTEM3 # define ARCH_NUMBER (112) +#elif defined PT_DAFIT +# define ARCH_NUMBER (307) #elif defined TRIZEPS # define ARCH_NUMBER (74) #elif defined CSIR_IMS |
From: Stefan E. <se...@us...> - 2004-02-05 18:10:03
|
Update of /cvsroot/blob/blob/src/blob In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15926/src/blob Modified Files: Makefile.am main.c Added Files: autoboot.c Log Message: Factor out autoboot function. This is useful for boards which want to do autoboot unless some special condition is met, such as a GPIO tied to ground or similar. Boards can set a callback for autoboot checking. This callback is initially set to a default function which implements the "old" way of autobooting. --- NEW FILE: autoboot.c --- /********************************************************************** * autoboot.c - check whether or not we have to do an autoboot * * Copyright (C) 1999 2000 2001 * Jan-Derk Bakker (J.D...@it...) and * Erik Mouw (J.A...@it...) * * (C) 2003 by Stefan Eletzhofer <ste...@el...> * * 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: autoboot.c,v 1.1 2004/02/05 18:07:29 seletz Exp $" #ifdef HAVE_CONFIG_H # include <blob/config.h> #endif #include <blob/arch.h> #include <blob/debug.h> #include <blob/errno.h> #include <blob/error.h> #include <blob/init.h> #include <blob/main.h> #include <blob/serial.h> #include <blob/time.h> #include <blob/util.h> #include <blob/autoboot.h> /********************************************************************** * defines */ /********************************************************************** * globals */ /********************************************************************** * module globals */ static char *version = "$Id: autoboot.c,v 1.1 2004/02/05 18:07:29 seletz Exp $"; #ifdef DEBUG static int dbg = 1; #else static int dbg = 0; #endif check_autoboot_fn blob_autoboot_fn = NULL; void *blob_autoboot_priv = NULL; /********************************************************************* * default_check_autoboot - blobs default autoboot sequence * @priv: here the commandline gets passed */ int default_check_autoboot( void *priv ) { int ret = 1; char *commandline = (char *)priv; if (blob_status.boot_delay > -1) { int i; int retval = 0; /* wait boot_delay seconds before starting autoboot */ printf("Autoboot (%i seconds) in progress, press any key to stop ", blob_status.boot_delay); if (blob_status.boot_delay == 0) { retval = SerialInputBlock(commandline, 1, 0); } else { for(i = 0; i < blob_status.boot_delay; i++) { serial_write('.'); retval = SerialInputBlock(commandline, 1, 1); if(retval > 0) break; } } if ( retval ) { ret = 0; /* command loop */ } } return ret; } /* vim: set ts=8 sw=8 tw=75: */ Index: Makefile.am =================================================================== RCS file: /cvsroot/blob/blob/src/blob/Makefile.am,v retrieving revision 1.48 retrieving revision 1.49 diff -u -d -r1.48 -r1.49 --- Makefile.am 10 Nov 2003 17:06:41 -0000 1.48 +++ Makefile.am 5 Feb 2004 18:07:29 -0000 1.49 @@ -60,6 +60,7 @@ trampoline.S \ flashasm.S \ testmem2.S \ + autoboot.c \ bootldrpart.c \ commands.c \ flash.c \ Index: main.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/main.c,v retrieving revision 1.55 retrieving revision 1.56 diff -u -d -r1.55 -r1.56 --- main.c 4 Dec 2003 21:45:19 -0000 1.55 +++ main.c 5 Feb 2004 18:07:29 -0000 1.56 @@ -54,6 +54,7 @@ #include <blob/util.h> #include <blob/load_kernel.h> #include <blob/partition.h> +#include <blob/autoboot.h> #include <blob/download.h> @@ -62,14 +63,17 @@ blob_status_t blob_status; + static char *version_str = PACKAGE " version " VERSION " for " BOARD_NAME "\n"; + int main(void) { int numRead = 0; char commandline[MAX_COMMANDLINE_LENGTH]; u32 conf = 0; void *params; + int ret; /* initialise status */ blob_status.param.type = fromFlash; @@ -81,6 +85,10 @@ blob_status.cmdline[0] = '\0'; blob_status.boot_delay = 10; + /* default autoboot checker */ + blob_autoboot_fn= default_check_autoboot; + blob_autoboot_priv= commandline; + /* call subsystems (blob_status.* may change) */ init_subsystems(); @@ -128,38 +136,17 @@ if(blob_status.load_ramdisk) do_reload("ramdisk"); - if (blob_status.boot_delay > -1) { - int i; - int retval = 0; - - /* wait boot_delay seconds before starting autoboot */ - printf("Autoboot (%i seconds) in progress, press any key to stop ", - blob_status.boot_delay); - - - if (blob_status.boot_delay == 0) { - retval = SerialInputBlock(commandline, 1, 0); - } else { - for(i = 0; i < blob_status.boot_delay; i++) { - serial_write('.'); - - retval = SerialInputBlock(commandline, 1, 1); - - if(retval > 0) - break; - } - } - + /* check whether or not we should autoboot */ + ret = (*blob_autoboot_fn)( blob_autoboot_priv ); + if ( ret ) { /* no key was pressed, so proceed booting the kernel */ - if(retval == 0) { - commandline[0] = '\0'; - parse_command("boot"); - } - - printf("\nAutoboot aborted\n"); - printf("Type \"help\" to get a list of commands\n"); + commandline[0] = '\0'; + parse_command("boot"); } + printf("\nAutoboot aborted\n"); + printf("Type \"help\" to get a list of commands\n"); + /* the command loop. endless, of course */ for(;;) { DisplayPrompt(NULL); |
From: Stefan E. <se...@us...> - 2004-02-05 18:10:03
|
Update of /cvsroot/blob/blob/include/blob In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15926/include/blob Modified Files: Makefile.am Added Files: autoboot.h Log Message: Factor out autoboot function. This is useful for boards which want to do autoboot unless some special condition is met, such as a GPIO tied to ground or similar. Boards can set a callback for autoboot checking. This callback is initially set to a default function which implements the "old" way of autobooting. --- NEW FILE: autoboot.h --- /* * autoboot.h * * Copyright (C) 2003 * Stefan Eletzhofer <ste...@el...> * * 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 * */ #ifndef INC_BLOB_AUTOBOOT #define INC_BLOB_AUTOBOOT 1 /********************************************************************* * check_autoboot_fn - autoboot check function * @priv: private pointer * * Platform dep. autoboot checker * * return 0 => no autoboot, enter command loop * return 1 => autoboot * * Platforms may for example check a jumper on a GPIO to enable/disable * autoboot for production boards. */ typedef int (*check_autoboot_fn)( void *priv ); /* Overwrite these in initcalls on arch dep. setup */ extern check_autoboot_fn blob_autoboot_fn; extern void *blob_autoboot_priv; /********************************************************************* * default_check_autoboot - blobs default autoboot sequence * @priv: here the commandline gets passed */ int default_check_autoboot( void *priv ); #endif Index: Makefile.am =================================================================== RCS file: /cvsroot/blob/blob/include/blob/Makefile.am,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- Makefile.am 27 Nov 2003 08:02:31 -0000 1.22 +++ Makefile.am 5 Feb 2004 18:07:27 -0000 1.23 @@ -16,6 +16,7 @@ noinst_HEADERS = \ + autoboot.h \ arch.h \ cf.h \ cfi.h \ |
From: Stefan E. <se...@us...> - 2004-02-04 19:15:45
|
Update of /cvsroot/blob/blob/src/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17493 Modified Files: command.c Log Message: fixed the annoying "ambiguous command" errors one got even an exact match was possible. Index: command.c =================================================================== RCS file: /cvsroot/blob/blob/src/lib/command.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- command.c 4 Sep 2003 17:39:01 -0000 1.14 +++ command.c 4 Feb 2004 19:13:19 -0000 1.15 @@ -133,12 +133,24 @@ -/* return the number of commands that match */ -static int get_num_command_matches(char *cmdline) +/* get_command - get command for matching argv[0] + * + * Search through whole list. Only accept exact matches if + * we have more than one match. + */ +static int get_command(char *cmdline, commandlist_t **command ) { + int ret = 0; commandlist_t *cmd; + commandlist_t *match = NULL; + commandlist_t *exact = NULL; + int nr_match = 0; int len; - int num_matches = 0; + + if ( !cmdline || !command ) { + ret = -EINVAL; + goto DONE; + } len = strlen(cmdline); @@ -150,11 +162,33 @@ return -EMAGIC; } - if(strncmp(cmd->name, cmdline, len) == 0) - num_matches++; + if (strncmp(cmd->name, cmdline, len) == 0) { + dprintf( "match for cmd=%p: %s\n", cmd, cmd->name ); + nr_match++; + match = cmd; + if ( strlen( cmd->name ) == len ) + exact = cmd; + } } - return num_matches; + if ( !match ) + ret = -EINVAL; + + dprintf( "%d matches\n", nr_match ); + if ( nr_match > 1 ) { + if ( exact ) { + match = exact; + dprintf( "choosing exact match '%s'\n", exact->name ); + } else { + dprintf( "no exact match, -EAMBIGCMD.\n" ); + match = NULL; + ret = -EAMBIGCMD; + } + } + + *command = match; +DONE: + return ret; } @@ -162,8 +196,10 @@ int parse_command(char *cmdline) { + int ret; commandlist_t *cmd; int argc, num_commands, len; + int exact = 0, found = 0;; char *argv[MAX_ARGS]; parse_args(cmdline, &argc, argv); @@ -172,38 +208,13 @@ if(argc == 0) return 0; - num_commands = get_num_command_matches(argv[0]); - - /* error */ - if(num_commands < 0) - return num_commands; - - /* no command matches */ - if(num_commands == 0) - return -ECOMMAND; - - /* ambiguous command */ - if(num_commands > 1) - return -EAMBIGCMD; - - len = strlen(argv[0]); - - /* single command, go for it */ - for(cmd = commands; cmd != NULL; cmd = cmd->next) { - if(cmd->magic != COMMAND_MAGIC) { - deprintf("command magic failed at 0x%08x\n", - (unsigned int)cmd); - - return -EMAGIC; - } + ret = get_command( argv[0], &cmd ); + if ( ret ) + return ret; - if(strncmp(cmd->name, argv[0], len) == 0) { - /* call function */ - return cmd->callback(argc, argv); - } - } + dprintf( "got cmd=%p: %s\n", cmd, cmd->name ); - return -ECOMMAND; + return cmd->callback( argc, argv ); } |
From: Noreen A. <wul...@al...> - 2004-01-24 01:37:06
|
FUEL SAVER PRO This revolutionary device Boosts Gas Mileage 27%+ by helping fuel burn bet= ter using three patented processes from General Motors. www.xnue.biz?axel=3D49 PROVEN TECHNOLOGY A certified U.S. Environmental Protection Agency (EPA) laboratory recently= completed tests on the new Fuel Saver. The results were astounding! Maste= r Service, a subsidiary of Ford Motor Company, also conducted extensive em= issions testing and obtained similar, unheard of results. The achievements= of the Fuel Saver is so noteworthy to the environmental community, that C= ommercial News has featured it as their cover story in their June, 2000 ed= ition. Take a test drive Today - www.xnue.biz?axel=3D49 No more advertisements, thanks - www.sftwre.biz/gh/r/r.asp bdf m a hbuv ir lal |
From: Marjorie K. <lf...@ya...> - 2003-12-19 11:55:26
|
TECHNOLOGY SECTOR - TECHNOLOGY BREAKTHROUGH - PATENTS FILED Symbol: NMMG Market: OTC.BB Sector: L.E.D. TECHNOLOGY Barcharts Rate NMMG an 80% BUY - http://quotes.barchart.com/texpert.asp?sy= m=3DNMMG BREAKING NEWS in technology - New Millennium Media International (OTCBB: N= MMG) announces that it has officially filed its patents---with over 50 cla= ims---protecting its revolutionary technology, a breakthrough in (LED) arc= hitecture. The OnScreen=99 LED Display Architecture is a radical new type= of Bright LED video display architecture that is expected to revolutioniz= e the 1.5 billion dollar LED display market. This breakthrough technology= will give NMMG great potential to capture significant market share in the= the 19 billion dollar outdoor advertising market. With all the new initiatives in Homeland Security and the Amber Alert, Int= elligent Message Signs (IMS) are the future, and with the recent signing o= f new laws and federally mandated funds in the billions of dollars, NMMG a= nd its patent-pending OnScreen technology is poised to lead the way. NMMG= currently has the only technology that allows it to build onto exisiting = infrastructure, i.e. road signs, billboards, etc. Imagine one day you are= driving home on the freeway past a road sign you have seen a thousand tim= es before--but this time you notice something different. This time you se= e a WARNING lit up--truck overturned 1 mile ahead--hazardous chemicals spi= lled. The sign advises you to exit immediately and to safety. Such a war= ning was broadcast instantly and using NMMG's OnScreen technology. You ne= ver noticed, as you drove by the roadside every day, that OnScreen was dra= ped over the sign all this time. Now it has sprung into action by the pun= ch of a button on a PC from a central station--instantly and just in the n= ick of time. You have just experienced OnScreen technology. And that is = just one example. The possibilities are limitless. And because OnScreen = can be applied to existing structures like road signs or billboards, its c= ost-effectiveness makes it far and away the technology choice. NMMG will unveil its breakthrough technology at the STRATEGIES IN LIGHT co= nference on February 2-4, 2004 at the San Mateo Marriott Hotel in San Mate= o, California. This unique event is considered to be the premier annual fo= rum for addressing commercial developments in high-brightness LEDs, as wel= l as an unparalleled networking opportunity for suppliers and users of the= se devices. The growing interest in, and expanding attendance at, this eve= nt, reflects the excitement associated with a market that has grown by 50= % since 2000, while other semiconductor and optical component industries h= ave stagnated or experienced large declines. ON-SCREEN=99 TECHNOLOGY OnScreen=99 is expected to create a broad-range of products with much bett= er resolution and brighter pictures than the current generation of display= s. OnScreen=99 will be visible in direct sunlight yet avoid many of the is= sues associated with current displays including sun-loading, wind-loading = and excessive weight. In addition, the new LED architecture produces an a= dvantage that is not available in today's marketplace: a more lightweight,= pliable display that can fit any application. These are important advant= ages as the High Brightness LED market is expected to grow from 1.2 billio= n dollars in 2000 to 4 billion in 2006. In addition, according to Stanfor= d Resources, the LED sign market value alone is expected to exceed 1 billi= on by 2006. These projections are made based on existing technology and do= not take into account emerging technologies, such as OnScreen=99, that ca= n rapidly alter the size and shape of this market. COMMERCIAL MARKET & STRATEGY NMMG's initial marketing strategy revolves around licensing intellectual p= roperty (IP) to worldwide manufacturers of LED display products and compon= ents. The LED sign market is projected to reach over 1 billion dollars by = 2006. Lumiled's projects that high brightness LED's, used in LED signs alo= ne, will exceed 1.2 billion by 2007. If these projections hold, the fully = manufactured signs would represent a $5 billion market. Whichever number i= s accurate, they both point towards a robust market for these new LED disp= lays. Many projections don't take into account emerging high growth applic= ations such as the Amber Alert project, Homeland Security and roadway =93i= ntelligent message transfer=94. THE MARKET An article in Media Post's Media Daily News in March of 2003 noted that th= e outdoor industry has successfully weathered the recession and that =93ou= r large members say they're having a great first quarter=94 in 2003. They = go on to note that technology is expected to transform both the display an= d measurement of outdoor advertising. According to Media Daily the most ex= citing news is coming on the display side, where =93Lamar Advertising is c= onverting their key boards to LED units whose messages can be changed at w= ill and sold in day-parts by the hour or even the minute.=94 They added th= at =93Clear Channel's backlit subway panels in stairwells are being conver= ted to LED as well=94. Together these companies represent two of the three= largest outdoor US advertisers. Recent Federal Government legislation has also placed a spotlight on expan= ding the =93Amber Alert=94 network nationwide. The highly publicized succe= ss in locating a number of kidnapped children shortly after their abductio= n in California has now triggered federal funding for U.S.-wide expansion = of these variable-message signs. Homeland Security issues have also incre= ased the number of early warning signs being planned and funded as part of= an overall information sharing network. Traffic safety is also becoming a= much higher priority in the U.S.. It is estimated that just over 60,000 r= oadway dynamic message signs are in operation in the United States. In Jap= an alone there are over 1.5 million of these signs. The United States repr= esents a huge growth market for LED displays. GROWTH OPPORTUNITES In addition to the outdoor television market, another interesting and exci= ting application for OnScreen=99 arrays is artistic lighting in dramatic c= urved and shaped displays in places like Las Vegas, New York City or reall= y virtually any venue. The tensile, flexible structure of OnScreen=99 prov= ides unlimited opportunity for creativity. The anticipated cost reductions of OnScreen=99 will also provide ample opp= ortunity for growth of the large-scale LED display market itself. OnScreen= =99's unique architecture opens the door for new applications such as curv= ed implementations, billboards on the sides of buildings where tenants can= still see out, and lower cost mobile applications on the sides of existin= g vehicles. Homeland Security, Amber Alert variable message signage and instant messag= e transfer applications can also benefit significantly from the advantages= of OnScreen=99. Reduced wind-loading and weight can significantly lower t= he cost of the superstructures required to support these signs and also re= duce the cost to install and maintain them. JUST LOOK WHO IS ALREADY ON BOARD New Millennium has established a Technology Breakthroughsentific Advisory = Board comprised of leading experts in key categories in the research and m= arketing of LED technology. David Pelka, Ph.D.- Chairman =96 Well known expert in physics, founded TIR= Technologies Inc. to pursue patents for his LED lighting systems and LCD = backlits. Dr. Pelka secured more than $2 million in venture capital and l= icensing for TIR before it was acquired by Teledyne Electronic Technologie= s (NYSE:TDY). Since the buyout, Dr. Pelka has served as Director of Produ= ct Development for Teledyne Lighting and Display Products. Dr. Pelka's ac= colades include fellowships and awards from the Smithsonian, National Defe= nse, Northrop University and Ebell Fellowship, as well as countless articl= es published in both classified (the U.S. Air Force and Army) publications= and various non-classified publications. He has founded several technolo= gy companies, which he successfully expanded by building strong revenue st= reams and securing venture capital investments and government contracts. Robert V. Steele, Ph.D. =96 Director of Optoelectronics Programs and Chair= man of the annual conference =93Strategies in Light=94 for Strategies Unli= mited. Steele is responsible for all of Strategies Unlimited's activities= in the area of optoelectronic components, for which the 23-year-old marke= t research firm has specialized in providing market research reports and c= onsulting services. Co-author of =93Solid-State Lighting: New Growth Oppo= rtunities for High-Brightness LED's=94, Dr. Steele writes regularly for in= dustry publications on high-brightness LED markets and applications such a= s Forbes, The Wall Street Journal, The Economist and more. John Biondo =96 Owner and President of Silicon Robotics Corporation, which= provides various product development services including electronic and el= ectromechanical design, software development, optics, and project manageme= nt. Biondo also has extensive patent-process experience. In 1980, Biondo= launched Electric Filmworks, which produced computer-generated visual eff= ects for the television and motion picture industry. He also designed an = apparatus using newly available and inexpensive microcomputers, which allo= wed the company to compete successful against older, more established firm= s. To transfer from the service-sector into manufacturing, Biondo sold El= ectric Filmworks in 1989 and co-founded Amazing Photos. Amazing Photos de= signed, manufactured and sold a variety of innovative coin-operated photo = booths. Polaroid Corporation licensed and marketed the two most popular a= nd cost effective booths under their own name. Richard Reis, Ph.D. =96 Executive Director of the Alliance for Innovative = Manufacturing at Stanford and Director for Academic Partnerships in the St= anford Learning Laboratory. Dr. Reis' impressive career includes serving = as; the Executive director of the Stanford Center for integrated Systems, = a major research partnership between Stanford and 15 industrial companies;= a Consulting Professor in both the Stanford University Electrical and Mec= hanical Engineering departments; professor of a year-round seminar that is= part of the Stanford University Future Professors of Manufacturing progra= m; a professor of astronomy at the College of San Mateo, Calif.; and a cur= riculum consultant at Menlo College, Calif. Ben Jacobson, Ph.D. =96 Dr. Jacobson has worked on numerous impressive LED= projects that have exponentially increased beam density and brightness an= d reduced system costs. Additionally, these projects have improved power r= equirements, heat load and LED count, while improving compactness, efficie= ncy and performance over competitors' products. Dr. Jacobson was instrume= ntal in positioning Illumitech as a new company developing high-performanc= e LED lighting systems with thermal packaging. Dr. Jacobson has over a de= cade of experience developing and marketing new technology for the display= industry, both in his previous positions and currently at Illumitech. Pr= ior to Illumitech, Dr. Jacobson held various executive and research direct= orial positions at EG Controls Inc., ARCH Venture Partners, NiOptics Corpo= ration and the University of Chicago. He has seven U.S. patents, and has = published 13 research articles and seven conference presentations. Joseph D. Tajnai, Ph.D. =96 Dr. Tajnai is a consultant in Optical Radiatio= n Safety, LED's & Applications and Optics & Optical Measurement Training. = He was an engineer, Technology Breakthroughsentist and technical manager f= or 23 years at Hewlett-Packard and Agilent Technologies. He has focused on= fiber optic development, LED development and measurements, new product pr= ocesses, mathematical modeling and international and US standards and regu= lations. He also worked with GE Sylvania for nine years and contributed he= avily to their YAG laser development. Dr. Tajnai received his BS, MS and P= h.D. from California Institute of Technology in Electrical Engineering and= Applied Physics. Please note that NMMG had absolutley nothing to do with this report and is= not a participant in any way. No more advertisements: www.inet-notification.com/away.html Technology Breakthroughs is an independent research firm. This report is b= ased on Technology Breakthroughs's independent analysis but also relies on= information supplied by sources believed to be reliable. This report may = not be the opinion of NMMG management. Technology Breakthroughs has also b= een retained to research and issue reports on NMMG. Technology Breakthroug= hs may from time to time purchase or sell NMMG common shares in the open m= arket without notice. The information contained in this report shall not c= onstitute, an offer to sell or solicitation of any offer to purchase any s= ecurity. It is intended for information only. Some statements may contain = so-called "forward-looking statements". Many factors could cause actual re= sults to differ. Investors should consult with their Investment Advisor co= ncerning NMMG. Copyright 2003 =A9 Technology Breakthroughs. All Rights Res= erved. Technology Breakthroughs was paid eight thousand dollars to distrib= ute this report. Technology Breakthroughs is not affiiated with Technology= Breakthroughs and is not responsible for newsletter content. All informa= tion in this report can be obtained on the world wide web at www.nmmimedia= com. New Millenimum Media was not a participant in this newsletter in an= y way. q qsq wkphswfvg yneuj f xhsxuisuhcnapfqnubwes jj |