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: Erik M. <J.A...@it...> - 2002-04-18 22:37:22
|
On Wed, Apr 17, 2002 at 12:39:53PM -0700, Stefan Eletzhofer wrote: > Update of /cvsroot/blob/blob/src/commands > In directory usw-pr-cvs1:/tmp/cvs-serv6904 > > Modified Files: > Makefile.am md5chk.c > Added Files: > dlfile.c ferase.c fwrite.c > Log Message: > - commands for: > * flashing arbitary flash regions > * erasing arbitary flash regions > * downloading files to arbitary memory Erasing arbitrary flash regions is dangerous. I think you'd rather want to erase a flash partition instead of a region. Flash commands belong in src/blob, not in src/commands. Diag can't write to flash anyway, so there is no point in sharing the commands. > /********************************************************************* > * dlfile > * > * AUTOR: Stefan Eletzhofer > * REVISED: > * > * download a file to a memory location. Does also print a md5 > * checksum of the downloaded data. Don't do wild MD5 checks, only do it if the user explicitly asked for MD5 support with --enable-md5. Erik -- J.A.K. (Erik) Mouw, Information and Communication Theory Group, Faculty of Information Technology and Systems, Delft University of Technology, PO BOX 5031, 2600 GA Delft, The Netherlands Phone: +31-15-2783635 Fax: +31-15-2781843 Email: J.A...@it... WWW: http://www-ict.its.tudelft.nl/~erik/ |
From: Tim R. <Ti...@Ri...> - 2002-04-18 20:42:49
|
cept you missed blob/ide.h so CVS is broken -- Tim Riker - http://rikers.org/ - short SIGs! <g> All I need to know I could have learned in Kindergarten ... if I'd just been paying attention. |
From: Stefan E. <se...@us...> - 2002-04-18 19:55:44
|
Update of /cvsroot/blob/blob/src/blob In directory usw-pr-cvs1:/tmp/cvs-serv14277 Modified Files: system3.c Log Message: - pcmcia stuff. This is all a mess, i know. I'll remove dead code and clean all up next week. This is just that Tim Riker has something to look at :) Index: system3.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/system3.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- system3.c 13 Feb 2002 00:08:54 -0000 1.10 +++ system3.c 18 Apr 2002 19:55:34 -0000 1.11 @@ -42,22 +42,61 @@ #include <blob/command.h> #include <blob/uucodec.h> #include <blob/serial.h> +#include <blob/time.h> + +#include <blob/sa1100.h> +#include <blob/sa1111.h> +#include <blob/pcmcia.h> +#include <blob/ide.h> /********************************************************************** * defines */ +#define CONFIG_PCMCIA_SUPPORT /* this will send a cold shiver through erik's spine ... */ #define ERR( x ) { ret = x; goto DONE; } /* more readable IMHO */ #define MEM( x ) (*((u32 *)x)) +#define SET(reg,bit) ((reg) |= (1<<(bit))) +#define RST(reg,bit) ((reg) &= ~(1<<(bit))) + +#define mem_b(adr) ( ((volatile unsigned char*)0)[adr] ) +#define mem_w(adr) ( ((volatile unsigned short int*)0)[(adr)/2] ) +#define mem_dw(adr) ( ((volatile unsigned long*)(0)) [(adr)/4] ) + +#if 0 +#define GPDR (0x90040004) +#define GPSR (0x90040008) +#define GPCR (0x9004000c) +#define GAFR (0x9004001c) +#define TUCR (0x90030008) /* Test Unit Control Reg. */ +#endif + +#define CF_REG_CFG (0x200) +#define CF_CFG_SRST (0x80) +#define CF_CFG_LVLREQ (0x40) +#define CF_CFG_MMAP (0x00) +#define CF_CFG_IOMAP (0x01) +#define CF_CFG_IO_IDE0 (0x02) +#define CF_CFG_IO_IDE1 (0x03) + +#define CF_REG_CFGSTAT (0x202) + +#define SYSTEM3_DEBUG 1 + +#if SYSTEM3_DEBUG +# define _DBG( fmt, args... ) printf("%s(): " fmt, __FUNCTION__ , ## args) +#endif + /********************************************************************** * globals */ extern blob_status_t blob_status; +static void sa1111_init(); /********************************************************************** * module globals @@ -95,23 +134,230 @@ flash_descriptors = system3_flash_descriptors; flash_driver = &intel32_flash_driver; } - __initlist(init_system3_flash_driver, INIT_LEVEL_DRIVER_SELECTION); +static void system3_init_hardware(void) +{ + /* init on-board CPLD */ + MEM(SYSTEM3_CTRL_0) = 0x0b; + MEM(SYSTEM3_CTRL_1) = 0x00; + MEM(SYSTEM3_CTRL_2) = 0x00; +#if 0 + /* activate SYSCLCK for keyboard controller */ + SET( MEM(GAFR), 27 ); + SET( MEM(GPDR), 27 ); + /* 3.6864 MHz SYSCLK */ + SET( MEM(TUCR), 29 ); + RST( MEM(TUCR), 30 ); + RST( MEM(TUCR), 31 ); -static void system3_init_hardware(void) -{ + msleep( 1 ); +#endif + + //sa1111_init(); + + MEM(SYSTEM3_CTRL_1) = 0x04; + + + /* tweak blob config */ + blob_status.boot_delay = 1; + + /* select serial driver */ serial_driver = &sa11x0_serial_driver; } - __initlist(system3_init_hardware, INIT_LEVEL_DRIVER_SELECTION); +static void sa1111_init() +{ + + _DBG( "%s", "START\n" ); + _DBG( "%s", "Switch on SYSCLCK 3.6864 MHz\n" ); + + /* switch on clock for sa1111 */ + GAFR |= GPIO_32_768kHz; + GPDR |= GPIO_32_768kHz; + TUCR = TUCR_3_6864MHz; + + /* Now, set up the PLL and RCLK in the SA-1111: */ + SBI_SKCR = SKCR_PLL_BYPASS | SKCR_RDYEN | SKCR_OE_EN; + msleep(100); + SBI_SKCR = SKCR_PLL_BYPASS | SKCR_RCLKEN | SKCR_RDYEN | SKCR_OE_EN; + + printf( "SA1111 ID: %08x\n", SBI_SKID ); + + /* + * SA-1111 Register Access Bus should now be available. Clocks for + * any other SA-1111 functional blocks must be enabled separately + * using the SKPCR. + */ + SKPCR |= SKPCR_DCLKEN | SKPCR_PWMCLKEN; + + /* + * If the system is going to use the SA-1111 DMA engines, set up + * the memory bus request/grant pins. Also configure the shared + * memory controller on the SA-1111 (SA-1111 Developer's Manual, + * section 3.2.3) and power up the DMA bus clock: + */ + GAFR |= (GPIO_MBGNT | GPIO_MBREQ); + GPDR |= GPIO_MBGNT; + GPDR &= ~GPIO_MBREQ; + TUCR |= TUCR_MR; + + SBI_SMCR = (SMCR_DTIM | SMCR_MBGE | + FInsrt(FExtr(MDCNFG, MDCNFG_SA1110_DRAC0), SMCR_DRAC) | + ((FExtr(MDCNFG, MDCNFG_SA1110_TDL0)==3) ? SMCR_CLAT : 0)); + + _DBG( "%s", "DONE\n" ); +} + +#if defined(CONFIG_PCMCIA_SUPPORT) +int pcmcia_init() +{ + printf( "PT Digital Board PCMCIA init\n" ); + /* nothing to do ATM */ + sa1111_init(); + printf( "MECR=0x%08x\n", MECR ); + printf( "MSC0=0x%08x\n", MSC0 ); + printf( "MSC1=0x%08x\n", MSC1 ); + printf( "MSC2=0x%08x\n", MSC2 ); + return 0; +} + +static int pcmcia_test( int argc, char *argv[] ) +{ + int ret = 0; + int slot = 0; + u32 *slot_base; + u32 *slot_attr; + u16 cfg_reg; + ide_drive_t drive; + int numDev; + int sec; + + unsigned char * devTypeStr[] + = { "no device found", "unknown type", "ATA", "ATAPI" }; + char buffer[4096]; + + /* set ata debg level high */ + //ataio_dbg_set( 5 ); + + ret = pcmcia_init(); + if ( ret != 0 ) ERR( -EINVAL ); + + if ( argc > 1 ) { + switch ( argv[1][0] ) { + case '0': + slot = 0; + break; + case '1': + slot = 1; + break; + } + } + + pcmcia_dbg_set( 5 ); + //ide_dbg_set( 5 ); + + ret = pcmcia_slot_detect( slot ); + if ( !ret ) ERR( -EINVAL ); + + printf( "slot %d detected\n", slot ); + + ret = pcmcia_slot_enable( slot ); + if ( ret != 0 ) ERR( -EINVAL ); + + ret = pcmcia_slot_address_get( slot, &slot_base, &slot_attr ); + if ( ret != 0 ) ERR( -EINVAL ); + + ret = pcmcia_slot_reset( slot ); + if ( ret != 0 ) ERR( -EINVAL ); + + mem_b( (u32)slot_attr + CF_REG_CFG ) = ( mem_b( (u32)slot_attr + CF_REG_CFG ) & 0xC0 ) | CF_CFG_IO_IDE0; + + printf( "CF CFG REG = 0x%x\n", mem_b( (u32)slot_attr + CF_REG_CFG ) ); + + printf( "slot %d enabled\n", slot ); + + ret = pcmcia_cis_parse( slot ); + if ( ret != 0 ) ERR( -EINVAL ); + +#if 0 + ret = pcmcia_slot_cfg_reg_get( slot, &cfg_reg ); + if ( ret != 0 ) ERR( -EINVAL ); + + ret = ide_init( &drive, (u32)slot_base ); + if ( ret != 0 ) ERR( -EINVAL ); + + ret = ide_reset( &drive ); + + ret = ide_identify_drive( &drive ); + if ( ret != 0 ) ERR( -EINVAL ); + + ret = ide_status_dump( &drive ); + if ( ret != 0 ) ERR( -EINVAL ); + + for ( sec=0; sec<10; sec++ ) { + ret = hd_read_mapped( &drive, sec, buffer ); + if ( ret != 0 ) ERR( -EINVAL ); + dumpmem( buffer, 512 ); + } +#endif + +#if 0 + printf( "slot %d base address: %x\n", slot, (u32)slot_base ); + printf( "slot %d config register: %x\n", slot, 0x1f0 ); + + pio_set_iobase_addr( (u32)slot_base, (u32)slot_base + 0x1f0 ); + printf( "\nUsing I/O base addresses %x and %x.\n", + (u32)slot_base, (u32)slot_base + 0x1f0 ); + + /* 2) find out what devices are present -- this is the step */ + /* many driver writers ignore. You really can't just do */ + /* resets and commands without first knowing what is out there. */ + /* Even if you don't care the driver does care. */ + numDev = reg_config(); + printf( "\nFound %d devices on this ATA interface:\n", numDev ); + printf( " Device 0 type is %s.\n", devTypeStr[ reg_config_info[0] ] ); + printf( " Device 1 type is %s.\n", devTypeStr[ reg_config_info[1] ] ); + /* that's the basics, now do some stuff in polling mode */ + /* do an ATA soft reset (SRST) and return the command block */ + /* regs for device 0 in struct reg_cmd_info */ + printf( "Soft Reset...\n" ); + ret = reg_reset( 0, 0 ); + if ( ret ) ERR( -EINVAL ); + ret = reg_pio_data_in( + 0, CMD_IDENTIFY_DEVICE, + 0, 0, + 0, 0, 0, + buffer, + 1, 0 + ); + if ( ret != 0 ) ERR( -EINVAL ); + dumpmem( buffer, 512 ); +#endif + + ret = pcmcia_dump_stati(); + if ( ret != 0 ) ERR( -EINVAL ); + + ret = 0; +DONE: + if ( ret != 0 ) { + printf( "pcmciatest: ERROR: code %d\n", ret ); + } + return ret; +} +static char pcmciahelp[] = "pcmcia test\n"; +__commandlist(pcmcia_test, "pcmciatest", pcmciahelp); +#endif + + +#if 0 /********************************************************************* * cmd_download_file * @@ -135,6 +381,12 @@ ret = strtou32( argv[2], &len ); if ( ret < 0 ) ERR( -EINVAL ); +#if defined(CONFIG_XMODEM_SUPPORT) + printf( "XMODEM download\n" ); +#else + printf( "UUENCODE download\n" ); +#endif + if (blob_status.terminalSpeed != blob_status.downloadSpeed) { SerialOutputString("Switching to download speed\n"); SerialOutputString("You have 60 seconds to switch your terminal emulator to the same speed and\n"); @@ -144,8 +396,11 @@ } else { SerialOutputString("You have 60 seconds to start downloading.\n"); } - +#if defined(CONFIG_XMODEM_SUPPORT) + ret = XModemReceive( (char *)dest, len ); +#else ret = UUDecode((char *)dest, len); +#endif if ( ret == len ) { SerialOutputString("Received "); SerialOutputDec(ret); @@ -154,7 +409,7 @@ SerialOutputString(") bytes.\n"); ret = 0; } else { - SerialOutputString("error during uudecode\n"); + SerialOutputString("error during download\n"); } if (blob_status.terminalSpeed != blob_status.downloadSpeed) { @@ -250,3 +505,4 @@ static char flasherasehelp[] = "ferase adr size(bytes)\n" "erase a flash region\n"; __commandlist( cmd_flash_erase, "ferase", flasherasehelp ); +#endif |
From: Stefan E. <se...@us...> - 2002-04-18 19:52:59
|
Update of /cvsroot/blob/blob/src/lib In directory usw-pr-cvs1:/tmp/cvs-serv13514 Modified Files: Makefile.am Added Files: ide.c pcmcia.c Log Message: - Added PCMCIA and IDE framework. Based on Brad Parker's code. NOTE NOTE NOTE: This is all Work-In-Progress (you have been warned) --- NEW FILE: ide.c --- /********************************************************************** * ide.c * * Basic ide drive framework. Based on Brad Parkers work. * * Copyright (C) 2001 Stefan Eletzhofer <ste...@ww...> * * 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 * * $Id: ide.c,v 1.1 2002/04/18 19:52:49 seletz Exp $ * * $Log: ide.c,v $ * Revision 1.1 2002/04/18 19:52:49 seletz * - Added PCMCIA and IDE framework. Based on Brad Parker's code. * NOTE NOTE NOTE: * This is all Work-In-Progress (you have been warned) * */ /********************************************************************** * Includes */ #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/sa1100.h> #include <blob/sa1111.h> #include <blob/ide.h> /********************************************************************** * Defines / Makros */ #define WEAK_SYM __attribute__ (( weak )) #define IDE_DEBUG 1 #ifdef IDE_DEBUG # define _DBG( args... ) printf( args ) #else # define _DBG( args... ) #endif #define IDE_DELAY 10 /********************************************************************** * Typen */ /********************************************************************** * Programmglobale Variable */ /********************************************************************** * Modulglobale Variable */ static char *version = "$Id: ide.c,v 1.1 2002/04/18 19:52:49 seletz Exp $"; #ifdef IDE_DEBUG static int dbg = 1; #else static int dbg = 0; #endif /********************************************************************** * Prototypen */ static int hd_identify(volatile u8 *port, volatile u8 *reg, char *buffer); static int hd_recal(volatile u8 *port); static int hd_busy_wait(volatile u8 *port); static void ide_fixstring (u8 *s, const int bytecount, const int byteswap); /********************************************************************** * Exported functions */ /********************************************************************** * ide_init * * - Initialize ide drive struct * - calculatees and sets HD_PORT and HD_REG_RORT from a base address */ int ide_init( ide_drive_t *drive, u32 *base_addr ) { if ( !base_addr ) return -1; if ( !drive ) return -1; if ( dbg > 0 ) { printf( "ide: %s\n", version ); } drive->ide_port = (u8 *)(base_addr + HD_PORT); drive->ide_reg = (u8 *)(base_addr + HD_REG_PORT); drive->last_status = 0; return 0; } /********************************************************************** * ide_status_dump * * - Dump IDE ports */ int ide_status_dump( ide_drive_t *drive ) { u8 status; int i; if ( !drive || !drive->ide_port ) return -1; for (i = 0; i < 8; i++) { status = drive->ide_port[i]; printf("port[ %d ] %x\n", i, status); } return 0; } /********************************************************************** * ide_reset * * - reset ide controller * * FIXME: resolve those magic numbers */ int ide_reset( ide_drive_t *drive ) { volatile u8 *port = NULL; volatile u8 *reg = NULL; if ( !drive || !drive->ide_port ) return -1; port = drive->ide_port; reg = drive->ide_reg; #if 1 /* reset hd controller */ reg[0] = 0x04; msleep(IDE_DELAY); reg[0] = 0x00; msleep(IDE_DELAY); #else msleep(5*IDE_DELAY); #endif port[1] = 0; port[2] = 0; port[3] = 0; port[4] = 0; port[5] = 0; port[6] = 0xa0; msleep(IDE_DELAY); return 0; } /********************************************************************** * ide_identify_drive * * - Try to identify hd * - Stores hd_driveid struct in ide drive struct * - gets sectors per track and heads of disk */ int ide_identify_drive( ide_drive_t *drive ) { struct hd_driveid *id; volatile u8 *port = NULL; volatile u8 *reg = NULL; static char id_buffer[512]; if ( !drive || !drive->ide_port ) return -1; port = drive->ide_port; reg = drive->ide_reg; if (hd_identify(port, reg, id_buffer)) { return -1; } id = (struct hd_driveid *)id_buffer; ide_fixstring (id->model, sizeof(id->model), 1); printf("ide: model: %s\n", id->model); printf("ide: CHS: %d/%d/%d\n", id->cyls, id->heads, id->sectors); if (id->sectors && id->heads) { drive->disk_sectors_per_track = id->sectors; drive->disk_heads = id->heads; } else { drive->disk_sectors_per_track = 0; drive->disk_heads = 0; } drive->driveid = *id; return 0; } /********************************************************************** * hd_read * * - read head/sector/cyl of drive to a buffer. Reads 1 block (512 bytes) of * data. */ int hd_read( ide_drive_t *drive, int head, int sector, int cyl, char *buffer) { int i, hd_drive, hd_cyl, hd_head, hd_sector; u8 status, hd_cmd[8]; volatile u8 *port = NULL; volatile u8 *reg = NULL; if ( !drive || !drive->ide_port ) return -1; port = drive->ide_port; reg = drive->ide_reg; hd_drive = 0; hd_cyl = cyl; hd_head = head; hd_sector = sector; hd_cmd[1] = 0; hd_cmd[2] = 1; /* # sectors */ hd_cmd[3] = hd_sector; /* starting sector */ hd_cmd[4] = cyl & 0xff; /* cylinder low byte */ hd_cmd[5] = (cyl >> 8) & 0xff; /* cylinder hi byte */ hd_cmd[6] = (hd_drive << 4) | (hd_head & 0x0f) | 0xa0; if (dbg > 2) printf("hd_read() h=%d s=%d c=%d\n", hd_head, hd_sector, hd_cyl); #if 0 if (hd_head > 7) { // hd_control |= 0x08; // reg[0] = hd_control; // hd_control &= 0xf7; reg[0] = 0x08; } #endif /* --- */ hd_busy_wait(port); for (i = 1; i < 7; i++) { hd_busy_wait(port); port[i] = hd_cmd[i]; } port[7] = HDC_READ; hd_busy_wait(port); for (i = 0; i < 512; i++) { buffer[i] = port[0]; } drive->last_status = status = port[7]; if (status & ERROR) { printf("read status: %2x\n", status); printf("h=%d s=%d c=%d\n", hd_head, hd_sector, hd_cyl); for (i = 1; i < 7; i++) { printf("set reg[%d] %2x\n", i, hd_cmd[i]); } } if (status & ERROR) return -1; return 0; } /********************************************************************** * hd_read_mapped * * - reads 512 bytes from sector <sector_num> from drive <drive> * - <sector_num> gets mapped to CHS, then hd_read() is called. */ int hd_read_mapped( ide_drive_t *drive, int sector_num, char *buffer) { int head, sector, cyl; if ( !drive || !drive->ide_port ) return -1; if (dbg > 2) printf("hd_read_mapped(sector_num=%d, buffer=%x)\n", sector_num, buffer); #if 0 sector = (sector_num % disk_sectors_per_track) + 1; sector_num /= disk_sectors_per_track; head = sector_num % disk_heads; sector_num /= disk_heads; cyl = sector_num; #endif hd_map_sector( drive, sector_num, &head, §or, &cyl ); return hd_read( drive, head, sector, cyl, buffer); } /********************************************************************** * hd_map_sector * * - map continguous sector numbers to CHS values of <drive> */ int hd_map_sector( ide_drive_t *drive, int sector, int *head, int *sec, int *cyl ) { int _cyl, _head, _sec; if ( !drive ) return -1; _sec = (sector % drive->disk_sectors_per_track) + 1; sector /= drive->disk_sectors_per_track; _head = sector % drive->disk_heads; sector /= drive->disk_heads; _cyl = sector; _DBG( "%s: => (h:%d, s:%d, c:%d)\n", __FUNCTION__, _head, _sec, _cyl ); if ( head ) *head = _head; if ( sec ) *sec = _sec; if ( cyl ) *cyl = _cyl; return 0; } /********************************************************************** * Statische Funktionen */ /********************************************************************** * hd_identify * * - performs HDC_IDENTIFY command and reads result to buffer */ static int hd_identify(volatile u8 *port, volatile u8 *reg, char *buffer) { int i; unsigned char status; hd_busy_wait(port); port[1] = 0; port[2] = 1; port[3] = 0; port[4] = 0; port[5] = 0; port[6] = 0xa0; port[7] = HDC_IDENTIFY; hd_busy_wait(port); for (i = 0; i < 512; i++) { buffer[i] = port[0]; } status = port[7]; if (status & ERROR) { printf("ide: identify status: %2x\n", status); return -1; } return 0; } static int hd_recal(volatile u8 *port) { int i, hd_drive, hd_head, sector; u8 hd_cmd[8]; hd_drive = 0; sector = 0; hd_head = sector & 0xffff; hd_cmd[1] = 0; hd_cmd[2] = 1; /* # sectors */ hd_cmd[3] = 0; hd_cmd[4] = 0; hd_cmd[5] = 0; hd_cmd[6] = (hd_drive << 4) | (hd_head & 0x0f) | 0xa0; hd_busy_wait(port); for (i = 1; i < 7; i++) { hd_busy_wait(port); port[i] = hd_cmd[i]; } port[7] = HDC_RECAL; if (hd_busy_wait(port)) return -1; return 0; } static int hd_busy_wait(volatile u8 *port) { int count; u8 status, err; count = 0; while (count++ < 2500) { status = port[7]; if ((status & BUSY) == 0) break; msleep(1); } _DBG( "ide: %s: port=%x, count=%d, status=%x\n", __FUNCTION__, port, count, status ); if (status & 0x01) { err = port[1]; printf( "ide: busy_wait: err = %2x\n", err ); return -1; } return 0; } static void ide_fixstring (u8 *s, const int bytecount, const int byteswap) { u8 *p = s, *end = &s[bytecount & ~1]; /* bytecount must be even */ if (byteswap) { /* convert from big-endian to host byte order */ for (p = end ; p != s;) { unsigned short *pp = (unsigned short *) (p -= 2); // *pp = ntohs(*pp); *pp = ((*pp >> 8) & 0xff) | ((*pp & 0xff) << 8); } } /* strip leading blanks */ while (s != end && *s == ' ') ++s; /* compress internal blanks and strip trailing blanks */ while (s != end && *s) { if (*s++ != ' ' || (s != end && *s && *s != ' ')) *p++ = *(s-1); } /* wipe out trailing garbage */ while (p != end) *p++ = '\0'; } --- NEW FILE: pcmcia.c --- /********************************************************************** * pcmcia framework * * Provides an raw pcmcia/cf framework for blob. Based on original * work from Brad Parker. * * Copyright (C) 2001 Stefan Eletzhofer <ste...@ww...> * * 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 * * $Id: pcmcia.c,v 1.1 2002/04/18 19:52:49 seletz Exp $ * * $Log: pcmcia.c,v $ * Revision 1.1 2002/04/18 19:52:49 seletz * - Added PCMCIA and IDE framework. Based on Brad Parker's code. * NOTE NOTE NOTE: * This is all Work-In-Progress (you have been warned) * */ /********************************************************************** * Includes */ #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/sa1100.h> #include <blob/sa1111.h> #include <blob/pcmcia.h> /********************************************************************** * Defines / Makros */ #define WEAK_SYM __attribute__ (( weak )) #define MEM(adr) (*((u32 *)adr)) #define SET(reg,bit) ((reg) |= (1<<(bit))) #define CLR(reg,bit) ((reg) &= ~(1<<(bit))) #define PCMCIA_DEBUG 1 #ifdef PCMCIA_DEBUG # define _DBG( args... ) printf( args ) #else # define _DBG( args... ) #endif /********************************************************************** * Typen */ typedef unsigned char uchar; typedef struct { u16 status; int vcc; int vpp; u32 attr_base; u32 base; volatile uchar *ident; volatile uchar *feature_p[PCMCIA_MAX_FEATURES]; int n_features; u16 config_base; } pcmcia_slot_t; /********************************************************************** * Programmglobale Variable */ 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, }, }; /********************************************************************** * Modulglobale Variable */ static char *module_version = "$Id: pcmcia.c,v 1.1 2002/04/18 19:52:49 seletz Exp $"; #ifdef PCMCIA_DEBUG static int dbg = 1; #else static int dbg = 0; #endif /********************************************************************** * Prototypen */ static int pcmcia_print_fixed(volatile uchar *p); static int pcmcia_print_funcid(int func); /********************************************************************** * Exportierte Funktionen */ void pcmcia_dbg_set( int level ) { printf( "pcmcia: debug level set to %d\n", level ); 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 ) { int detect = 0; unsigned int flags = PCSR; switch ( slot ) { case 0: detect = (flags & PCSR_S0_DETECT) == 0; break; case 1: detect = (flags & PCSR_S1_DETECT) == 0; break; default: detect = -1; goto DONE; break; } if ( detect ) { pcmcia_slots[slot].status |= PCMCIA_SS_DETECT; } else { pcmcia_slots[slot].status &= ~PCMCIA_SS_DETECT; } _DBG( "%s: slot %d status: %x\n", __FUNCTION__, slot, pcmcia_slots[slot].status ); DONE: return detect; } /* enable slot */ int WEAK_SYM pcmcia_slot_enable( int slot ) { int ret = 0; switch ( slot ) { 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; goto DONE; break; } pcmcia_slots[slot].status |= PCMCIA_SS_ENABLED; _DBG( "%s: slot %d status: %x\n", __FUNCTION__, slot, pcmcia_slots[slot].status ); DONE: return ret; } /* disable slot */ int WEAK_SYM pcmcia_slot_disable( int slot ) { int ret = 0; switch ( slot ) { case 0: PCCR = PCCR | PCCR_S0_PSE; break; case 1: PCCR = PCCR | PCCR_S1_PSE; break; default: ret = -1; goto DONE; break; } pcmcia_slots[slot].status &= ~PCMCIA_SS_ENABLED; _DBG( "%s: slot %d status: %x\n", __FUNCTION__, slot, pcmcia_slots[slot].status ); DONE: return ret; } /* reset pcmcia slot */ int WEAK_SYM pcmcia_slot_reset(int slot) { int ret = 0; 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; } _DBG( "%s: slot %d reset\n", __FUNCTION__, slot ); return ret; } /* dump slot HW line stati */ int pcmcia_dump_stati( void ) { int status = PCSR; 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("; "); 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"); return 0; } /* identify pcmcia card */ int pcmcia_identify( volatile unsigned char *p ) { unsigned char id_str[PCMCIA_MAX_IDENT_CHARS]; unsigned char data; unsigned char *t; int i, done; if (p == NULL) return (0); /* Don't know */ t = id_str; done =0; for (i=0; i<=4 && !done; ++i, p+=2) { while ((data = *p) != '\0') { if (data == 0xFF) { done = 1; break; } *t++ = data; if (t == &id_str[PCMCIA_MAX_IDENT_CHARS-1]) { done = 1; break; } p += 2; } if (!done) *t++ = ' '; } *t = '\0'; while (--t > id_str) { if (*t == ' ') *t = '\0'; else break; } printf("%s\n", id_str); return (0); /* don't know */ } /* parse cis tuples of card in slot <slot> */ int pcmcia_cis_parse( int slot ) { int ret = 0; void *cfg_mem_addr = NULL; volatile uchar *ident = NULL; volatile uchar *p = NULL; volatile uchar *start = NULL; int n_features = 0; uchar func_id = ~0; uchar len = 0; uchar code = 0; u16 config_base = 0; int found = 0; int i = 0; volatile uchar **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; } cfg_mem_addr = (void *)pcmcia_slots[slot].attr_base; feature_p = pcmcia_slots[slot].feature_p; ident = pcmcia_slots[slot].ident; if (dbg > 0) printf("PCMCIA MEM: %p\n", cfg_mem_addr); start = p = (volatile uchar *)cfg_mem_addr; while ((p - start) < PCMCIA_MAX_TUPEL_SZ) { code = *p; p += 2; if (code == 0xFF) { /* End of chain */ break; } len = *p; p += 2; if (dbg > 1) { volatile uchar *q = p; printf ("\nTuple code %2x length %d\n\tData:", code, len); for (i = 0; i < len; ++i) { printf (" %2x", *q); q+= 2; } } switch (code) { case CISTPL_VERS_1: ident = p + 4; break; case CISTPL_FUNCID: func_id = *p; break; case CISTPL_FUNCE: if (n_features < PCMCIA_MAX_FEATURES) feature_p[n_features++] = p; break; case CISTPL_CONFIG: config_base = (*(p+6) << 8) + (*(p+4)); printf("\n## Config_base = %x ###\n", config_base); default: break; } p += 2 * len; } found = pcmcia_identify( ident ); if (func_id != ((uchar)~0)) { pcmcia_print_funcid(func_id); if (func_id == CISTPL_FUNCID_FIXED) found = 1; } if ( found ) { for (i=0; i<n_features; ++i) { pcmcia_print_fixed (feature_p[i]); } } #if 1 /* hmmm, should this happen here? * FIXME: provide extra function? */ #define COR_FUNC_ENA 0x01 /* set configuration option register to enable card */ *((uchar *)(cfg_mem_addr + config_base)) = COR_FUNC_ENA; #endif ret = 0; DONE: return ret; } int pcmcia_slot_address_get( int slot, u32 **base, u32 **attr ) { 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_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 ( base ) *base = (u32 *)pcmcia_slots[slot].base; if ( attr ) *attr = (u32 *)pcmcia_slots[slot].attr_base; ret = 0; DONE: return ret; } /********************************************************************** * Statische Funktionen */ /* print function id strings */ static int pcmcia_print_funcid(int func) { 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"); return 0; } /* print info for FIXED_DISK function type card */ static int pcmcia_print_fixed(volatile uchar *p) { if (p == NULL) return -1; printf("\t "); switch (*p) { case CISTPL_FUNCE_IDE_IFACE: { uchar iface = *(p+2); printf((iface == CISTPL_IDE_INTERFACE) ? " IDE" : " unknown"); printf(" interface "); break; } case CISTPL_FUNCE_IDE_MASTER: case CISTPL_FUNCE_IDE_SLAVE: { uchar f1 = *(p+2); uchar f2 = *(p+4); printf((f1 & CISTPL_IDE_SILICON) ? " [silicon]" : " [rotating]"); if (f1 & CISTPL_IDE_UNIQUE) printf(" [unique]"); printf((f1 & CISTPL_IDE_DUAL) ? " [dual]" : " [single]"); if (f2 & CISTPL_IDE_HAS_SLEEP) printf(" [sleep]"); if (f2 & CISTPL_IDE_HAS_STANDBY) printf(" [standby]"); if (f2 & CISTPL_IDE_HAS_IDLE) printf(" [idle]"); if (f2 & CISTPL_IDE_LOW_POWER) printf(" [low power]"); 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"); return 0; } Index: Makefile.am =================================================================== RCS file: /cvsroot/blob/blob/src/lib/Makefile.am,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- Makefile.am 17 Feb 2002 19:54:47 -0000 1.14 +++ Makefile.am 18 Apr 2002 19:52:49 -0000 1.15 @@ -30,6 +30,7 @@ crc32.c \ error.c \ icache.c \ + ide.c \ init.c \ led.c \ md5.c \ @@ -37,6 +38,7 @@ memcpy.c \ memset.c \ mini_inflate.c \ + pcmcia.c \ printf.c \ reboot.c \ serial.c \ |
From: Tim R. <Ti...@Ri...> - 2002-04-17 23:17:00
|
erikm, I can't seem to find the rmk netcode. Anyone know where I can get this? I'm back to having some time for blob work and intend to work on cf ide flashing and hopefully tftp code. -- Tim Riker - http://rikers.org/ - short SIGs! <g> All I need to know I could have learned in Kindergarten ... if I'd just been paying attention. |
From: Tim R. <Ti...@Ri...> - 2002-04-17 22:57:53
|
agreed. watchdog off at boot. sw can turn it on. only a reset can turn it off. "J.D. Bakker" wrote: > > At 14:55 +0200 17-04-2002, Abraham vd Merwe wrote: > > > crap watchdog hardware on the market. If you have an option to change > >> the hardware, consider using a better watchdog. > > > >Hehe, if you can convince me that it's not necessary I can change it, but > >you still haven't convinced me that being able to disable a watchdog is a > >good thing. > > A sane watchdog is off after reset/power-on, and will only turn on at > (the rising edge of) the first trigger pulse. If the system doesn't > manage to produce the first trigger pulse, resetting the machine to > run the exact same firmware usually makes little sense. > > JDB. > -- > In protocol design, perfection has been reached not when there is > nothing left to add, but when there is nothing left to take away. > -- RFC 1925, "Fundamental Truths of Networking" > > _______________________________________________ > blob-cvs-commit mailing list > blo...@li... > https://lists.sourceforge.net/lists/listinfo/blob-cvs-commit -- Tim Riker - http://rikers.org/ - short SIGs! <g> All I need to know I could have learned in Kindergarten ... if I'd just been paying attention. |
From: Stefan E. <se...@us...> - 2002-04-17 19:39:59
|
Update of /cvsroot/blob/blob/src/commands In directory usw-pr-cvs1:/tmp/cvs-serv6904 Modified Files: Makefile.am md5chk.c Added Files: dlfile.c ferase.c fwrite.c Log Message: - commands for: * flashing arbitary flash regions * erasing arbitary flash regions * downloading files to arbitary memory --- NEW FILE: dlfile.c --- /* * dlfile.c: command wrapper for xmodem/uuencode download to * arbitary memory loc * * Copyright (C) 2002 Stefan Eletzhofer <ste...@ww...> * * 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: dlfile.c,v 1.1 2002/04/17 19:39:51 seletz Exp $" /********************************************************************** * Includes */ #ifdef HAVE_CONFIG_H # include <blob/config.h> #endif #include <blob/main.h> #include <blob/errno.h> #include <blob/debug.h> #include <blob/types.h> #include <blob/serial.h> #include <blob/util.h> #include <blob/uucodec.h> #include <blob/xmodem.h> #include <blob/md5.h> #include <blob/md5support.h> /********************************************************************** * defines */ /* this will send a cold shiver through erik's spine ... */ #define ERR( x ) { ret = x; goto DONE; } extern blob_status_t blob_status; /********************************************************************* * dlfile * * AUTOR: Stefan Eletzhofer * REVISED: * * download a file to a memory location. Does also print a md5 * checksum of the downloaded data. * */ int dlfile_cmd( int argc, char *argv[] ) { int ret = 0; u32 address, len; u32 digest; if ( argc < 3 ) ERR( -EINVAL ); ret = strtou32(argv[1], &address); if ( ret < 0 ) ERR( -EINVAL ); ret = strtou32(argv[2], &len); if ( ret < 0 ) ERR( -EINVAL ); dprintf("adr=0x%08x, len=0x%08x\n", address, len ); #if defined(CONFIG_XMODEM_SUPPORT) printf( "XMODEM download\n" ); #else printf( "UUENCODE download\n" ); #endif /* switch terminal speed if necessary */ if (blob_status.terminalSpeed != blob_status.downloadSpeed) { SerialOutputString( "Switch to download speed, please.\n" ); SerialOutputString("You have 60 seconds to start downloading.\n"); serial_init(blob_status.downloadSpeed); } else { SerialOutputString("You have 60 seconds to start downloading.\n"); } /* download the data */ #if defined(CONFIG_XMODEM_SUPPORT) ret = XModemReceive( (char *)address, len ); #else ret = UUDecode((char *)address, len); #endif if ( ret == len ) { SerialOutputString("Received "); SerialOutputDec(ret); SerialOutputString(" (0x"); SerialOutputHex(ret); SerialOutputString(") bytes.\n"); ret = 0; } else { SerialOutputString("error during download\n"); } if (blob_status.terminalSpeed != blob_status.downloadSpeed) { SerialOutputString("\n(Please switch your terminal emulator back to terminal speed\n"); serial_init(blob_status.terminalSpeed); } /* do a md5 sum of the downloaded data */ md5_buffer( (const char *)address, len, &digest ); SerialOutputString("md5 checksum: "); print_md5_digest(&digest); serial_write( '\n' ); ret = 0; DONE: return ret; } char dlfile_help[] = "dlfile destination_address len\n\ndownload a file to memory\n"; --- NEW FILE: ferase.c --- /* * ferase.c: command wrapper for erasing arbitary flash * regions * * Copyright (C) 2002 Stefan Eletzhofer <ste...@ww...> * * 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: ferase.c,v 1.1 2002/04/17 19:39:51 seletz Exp $" /********************************************************************** * Includes */ #ifdef HAVE_CONFIG_H # include <blob/config.h> #endif #include <blob/errno.h> #include <blob/debug.h> #include <blob/types.h> #include <blob/serial.h> #include <blob/util.h> #include <blob/flash.h> /********************************************************************** * defines */ /* this will send a cold shiver through erik's spine ... */ #define ERR( x ) { ret = x; goto DONE; } /********************************************************************* * ferase_cmd * * AUTOR: SELETZ * REVISED: * * Command wrapper for low-level flash erase * */ int ferase_cmd( int argc, char *argv[] ) { int ret = 0; u32 dest = 0L; u32 len = 0L; if ( argc < 3 ) ERR( -EINVAL ); ret = strtou32( argv[1], &dest ); if ( ret < 0 ) ERR( -EINVAL ); ret = strtou32( argv[2], &len ); if ( ret < 0 ) ERR( -EINVAL ); if ( len & (0x3) ) { len = (len>>2) + 1; } else { len = len>>2; } dprintf( "start=0x%08x, len=0x%08x words\n", dest, len ); ret = flash_erase_region( (u32 *)dest, len ); DONE: return ret; } char ferase_help[] = "ferase srcadr destadr size(bytes)\n" "flash a memory region\n"; --- NEW FILE: fwrite.c --- /* * fwrite.c: command wrapper for writing arbitary flash * regions * * Copyright (C) 2002 Stefan Eletzhofer <ste...@ww...> * * 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: fwrite.c,v 1.1 2002/04/17 19:39:51 seletz Exp $" /********************************************************************** * Includes */ #ifdef HAVE_CONFIG_H # include <blob/config.h> #endif #include <blob/errno.h> #include <blob/debug.h> #include <blob/types.h> #include <blob/serial.h> #include <blob/util.h> #include <blob/flash.h> /********************************************************************** * defines */ /* this will send a cold shiver through erik's spine ... */ #define ERR( x ) { ret = x; goto DONE; } /********************************************************************* * fwrite_cmd * * AUTOR: SELETZ * REVISED: * * Command wrapper for low-level flash write access * */ int fwrite_cmd( int argc, char *argv[] ) { int ret = 0; u32 src = 0L; u32 dest = 0L; u32 len = 0L; if ( argc < 4 ) ERR( -EINVAL ); ret = strtou32( argv[1], &src ); if ( ret < 0 ) ERR( -EINVAL ); ret = strtou32( argv[2], &dest ); if ( ret < 0 ) ERR( -EINVAL ); ret = strtou32( argv[3], &len ); if ( ret < 0 ) ERR( -EINVAL ); if ( len & (0x3) ) { len = (len>>2) + 1; } else { len = len>>2; } ret = flash_write_region( (u32 *)dest, (u32*)src, len ); DONE: return ret; } char fwrite_help[] = "fwrite srcadr destadr size(bytes)\n" "flash a memory region\n"; Index: Makefile.am =================================================================== RCS file: /cvsroot/blob/blob/src/commands/Makefile.am,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Makefile.am 17 Apr 2002 18:36:07 -0000 1.4 +++ Makefile.am 17 Apr 2002 19:39:50 -0000 1.5 @@ -30,6 +30,9 @@ changebit.c \ dummy.c \ dump.c \ + dlfile.c \ + ferase.c \ + fwrite.c \ memcpy.c \ md5chk.c \ peek.c \ Index: md5chk.c =================================================================== RCS file: /cvsroot/blob/blob/src/commands/md5chk.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- md5chk.c 17 Apr 2002 18:35:35 -0000 1.1 +++ md5chk.c 17 Apr 2002 19:39:51 -0000 1.2 @@ -1,7 +1,7 @@ /* * md5chk.c: command wrapper for md5 checks * - * Copyright (C) 2001 Stefan Eletzhofer <ste...@ww...> + * Copyright (C) 2002 Stefan Eletzhofer <ste...@ww...> * * 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 @@ -48,12 +48,12 @@ /********************************************************************* - * Poke + * md5chk * * AUTOR: Stefan Eletzhofer * REVISED: * - * Poke values to memory + * calculate md5 hash of a memory region * */ int md5chk_cmd( int argc, char *argv[] ) |
From: Stefan E. <se...@us...> - 2002-04-17 18:41:50
|
Update of /cvsroot/blob/blob/src/blob In directory usw-pr-cvs1:/tmp/cvs-serv17552 Modified Files: main.c Log Message: - initialize subsystem _after_ initialization of blob status struct to allow subsystem to alter blob status struct Index: main.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/main.c,v retrieving revision 1.41 retrieving revision 1.42 diff -u -d -r1.41 -r1.42 --- main.c 9 Apr 2002 12:40:11 -0000 1.41 +++ main.c 17 Apr 2002 18:41:48 -0000 1.42 @@ -78,9 +78,6 @@ u32 conf = 0; #endif - /* call subsystems */ - init_subsystems(); - /* initialise status */ blob_status.paramType = fromFlash; blob_status.kernelType = fromFlash; @@ -90,6 +87,9 @@ blob_status.load_ramdisk = LOAD_RAMDISK; blob_status.cmdline[0] = '\0'; blob_status.boot_delay = 10; + + /* call subsystems */ + init_subsystems(); /* call serial_init() because the default 9k6 speed might not be what the user requested */ |
From: Stefan E. <se...@us...> - 2002-04-17 18:38:05
|
Update of /cvsroot/blob/blob In directory usw-pr-cvs1:/tmp/cvs-serv15899 Modified Files: configure.in Log Message: - added md5chk command to the "all commands" list - added board revision number Index: configure.in =================================================================== RCS file: /cvsroot/blob/blob/configure.in,v retrieving revision 1.46 retrieving revision 1.47 diff -u -d -r1.46 -r1.47 --- configure.in 17 Feb 2002 20:03:40 -0000 1.46 +++ configure.in 17 Apr 2002 18:38:00 -0000 1.47 @@ -231,7 +231,7 @@ use_lcd="no" ;; system3) - board_name="Prueftechnik Digital Board" + board_name="Prueftechnik Digital Board REV 0802" AC_DEFINE(PT_SYSTEM3) BLOB_PLATFORM_OBJS="system3.o" BLOB_FLASH_OBJS="intel32.o" @@ -313,12 +313,12 @@ commands may be separated with commas; 'all' compiles all commands; Valid commands are: - call, chgbit, dummy, dump, memcpy, poke, peek], + call, chgbit, dummy, dump, md5chk, memcpy, poke, peek], blob_commands="$withval", blob_commands="") default_commands="reset, reboot" -all_commands="call, chgbit, dummy, dump, memcpy, poke, peek" +all_commands="call, chgbit, dummy, dump, md5chk, memcpy, poke, peek" if test "$blob_commands" = "all" ; then blob_commands="$all_commands" |
From: Stefan E. <se...@us...> - 2002-04-17 18:36:12
|
Update of /cvsroot/blob/blob/src/commands In directory usw-pr-cvs1:/tmp/cvs-serv15384 Modified Files: Makefile.am Log Message: - add md5chk Index: Makefile.am =================================================================== RCS file: /cvsroot/blob/blob/src/commands/Makefile.am,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Makefile.am 17 Feb 2002 20:01:31 -0000 1.3 +++ Makefile.am 17 Apr 2002 18:36:07 -0000 1.4 @@ -31,6 +31,7 @@ dummy.c \ dump.c \ memcpy.c \ + md5chk.c \ peek.c \ poke.c \ reboot.c \ |
From: Stefan E. <se...@us...> - 2002-04-17 18:35:39
|
Update of /cvsroot/blob/blob/src/commands In directory usw-pr-cvs1:/tmp/cvs-serv15096 Added Files: md5chk.c Log Message: - command wrapper for MD5 checks --- NEW FILE: md5chk.c --- /* * md5chk.c: command wrapper for md5 checks * * Copyright (C) 2001 Stefan Eletzhofer <ste...@ww...> * * 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: md5chk.c,v 1.1 2002/04/17 18:35:35 seletz Exp $" /********************************************************************** * Includes */ #ifdef HAVE_CONFIG_H # include <blob/config.h> #endif #include <blob/errno.h> #include <blob/debug.h> #include <blob/types.h> #include <blob/serial.h> #include <blob/util.h> #include <blob/md5.h> #include <blob/md5support.h> /********************************************************************** * defines */ /* this will send a cold shiver through erik's spine ... */ #define ERR( x ) { ret = x; goto DONE; } /********************************************************************* * Poke * * AUTOR: Stefan Eletzhofer * REVISED: * * Poke values to memory * */ int md5chk_cmd( int argc, char *argv[] ) { int ret = 0; u32 address, len; u32 digest; if ( argc < 3 ) ERR( -EINVAL ); ret = strtou32(argv[1], &address); if ( ret < 0 ) ERR( -EINVAL ); ret = strtou32(argv[2], &len); if ( ret < 0 ) ERR( -EINVAL ); dprintf("adr=0x%08x, len=0x%08x\n", address, len ); md5_buffer( (const char *)address, len, &digest ); print_md5_digest(&digest); serial_write( '\n' ); ret = 0; DONE: return ret; } char md5chk_help[] = "md5chk adress len\n\ncalculate md5 hash value\n"; |
From: J.D. B. <ba...@th...> - 2002-04-17 13:33:24
|
At 14:55 +0200 17-04-2002, Abraham vd Merwe wrote: > > crap watchdog hardware on the market. If you have an option to change >> the hardware, consider using a better watchdog. > >Hehe, if you can convince me that it's not necessary I can change it, but >you still haven't convinced me that being able to disable a watchdog is a >good thing. A sane watchdog is off after reset/power-on, and will only turn on at (the rising edge of) the first trigger pulse. If the system doesn't manage to produce the first trigger pulse, resetting the machine to run the exact same firmware usually makes little sense. JDB. -- In protocol design, perfection has been reached not when there is nothing left to add, but when there is nothing left to take away. -- RFC 1925, "Fundamental Truths of Networking" |
From: Abraham vd M. <ab...@2d...> - 2002-04-17 12:55:31
|
Hi Erik! > > At the moment, I've just added a hook in my hardware initialization rou= tine > > to setup my interrupt handler at 0x0018 and program the OS timer to tri= gger > > irq 26 every 400ms. That way I don't mess around with the generic stuff. >=20 > The generic code is pretty easy, and the interrupt system works the > same on all ARM CPUs anyway, so I'd rather think it belonged there :) Ok, I'll take a look at start.S > > > blob. All watchdog devices I know have an option that they aren't > > > enabled at boot time, but only start working after you first use them. > >=20 > > This one can't be disabled which is as it should be. If you can disable= it > > in software the whole idea of a watchdog is flawed... >=20 > No, the watchdog you're using right now is brain damaged. Every > watchdog I know is disabled at hardware reset and should be enabled by > the OS. The OS just can't *disable* the watchdog, though. This > enable-but-can't-disable feature was made exactly because it allows the > system to initialise itself. So how do you prevent the OS from disabling the watchdog. If there is a way to disable the watchdog during boot time it is theoretically possible that something in the OS can disable it again by mistake - this is obviously not likely to happen, but possible. We have a watchdog exactly to prevent this, so I think a watchdog that can be disabled during startup is brain damaged. > > > It's not that I am against adding features in blob, it's just that I > > > don't see a point in adding useless features. > >=20 > > I totally agree, but in this case it's kind of necessary in order to ge= t a > > functional board. >=20 > Please double check the data sheet. I just can't believe there is such Its a Dallas DS1832 chip - it has to be strobed periodically once it receives power. > crap watchdog hardware on the market. If you have an option to change > the hardware, consider using a better watchdog. Hehe, if you can convince me that it's not necessary I can change it, but you still haven't convinced me that being able to disable a watchdog is a good thing. --=20 Regards Abraham Love tells us many things that are not so. -- Krainian Proverb __________________________________________________________ Abraham vd Merwe - 2d3D, Inc. Device Driver Development, Outsourcing, Embedded Systems Cell: +27 82 565 4451 Snailmail: Tel: +27 21 761 7549 Block C, Aintree Park Fax: +27 21 761 7648 Doncaster Road Email: ab...@2d... Kenilworth, 7700 Http: http://www.2d3d.com South Africa |
From: Erik M. <J.A...@it...> - 2002-04-17 12:22:47
|
On Wed, Apr 17, 2002 at 12:51:38PM +0200, Abraham vd Merwe wrote: > > > I have a watchdog on my board which needs to be strobed at least every > > > 500ms, otherwise it resets the board. Therefore I need to use a timer > > > interrupt. I have a couple of questions to ask though: > > > > > > 1) Interrupts are disabled in blob at the moment right? So I won't be > > > interfering with something else if I setup an interrupt handler? > > > > No. Might be tricky, though. Best way is to modify the irq/firq entries > > in start.S to jump to a known location in trampoline.S, which on its > > turn can do the dirty work and call a C interrupt handling function. > > At the moment, I've just added a hook in my hardware initialization routine > to setup my interrupt handler at 0x0018 and program the OS timer to trigger > irq 26 every 400ms. That way I don't mess around with the generic stuff. The generic code is pretty easy, and the interrupt system works the same on all ARM CPUs anyway, so I'd rather think it belonged there :) > > blob. All watchdog devices I know have an option that they aren't > > enabled at boot time, but only start working after you first use them. > > This one can't be disabled which is as it should be. If you can disable it > in software the whole idea of a watchdog is flawed... No, the watchdog you're using right now is brain damaged. Every watchdog I know is disabled at hardware reset and should be enabled by the OS. The OS just can't *disable* the watchdog, though. This enable-but-can't-disable feature was made exactly because it allows the system to initialise itself. > > It's not that I am against adding features in blob, it's just that I > > don't see a point in adding useless features. > > I totally agree, but in this case it's kind of necessary in order to get a > functional board. Please double check the data sheet. I just can't believe there is such crap watchdog hardware on the market. If you have an option to change the hardware, consider using a better watchdog. Erik -- J.A.K. (Erik) Mouw, Information and Communication Theory Group, Faculty of Information Technology and Systems, Delft University of Technology, PO BOX 5031, 2600 GA Delft, The Netherlands Phone: +31-15-2783635 Fax: +31-15-2781843 Email: J.A...@it... WWW: http://www-ict.its.tudelft.nl/~erik/ |
From: Abraham vd M. <ab...@2d...> - 2002-04-17 10:51:34
|
Hi Erik! > > I have a watchdog on my board which needs to be strobed at least every > > 500ms, otherwise it resets the board. Therefore I need to use a timer > > interrupt. I have a couple of questions to ask though: > >=20 > > 1) Interrupts are disabled in blob at the moment right? So I won't be > > interfering with something else if I setup an interrupt handler? >=20 > No. Might be tricky, though. Best way is to modify the irq/firq entries > in start.S to jump to a known location in trampoline.S, which on its > turn can do the dirty work and call a C interrupt handling function. At the moment, I've just added a hook in my hardware initialization routine to setup my interrupt handler at 0x0018 and program the OS timer to trigger irq 26 every 400ms. That way I don't mess around with the generic stuff. > I *hope* that the kernel boots fast enough before the watchdog kicks > in. However, I wonder if you really need to keep the watchdog busy in There's more than enough time. The minimum timeout is 500ms which is longer than what blob takes to boot, but it just makes it and during development, it obviously times out if I have a delay. In the kernel, I can just add a hook to the timer interrupt which gets iniialized pretty early on in the boot process, so that's not a problem either... > blob. All watchdog devices I know have an option that they aren't > enabled at boot time, but only start working after you first use them. This one can't be disabled which is as it should be. If you can disable it in software the whole idea of a watchdog is flawed... > It's not that I am against adding features in blob, it's just that I > don't see a point in adding useless features. I totally agree, but in this case it's kind of necessary in order to get a functional board. --=20 Regards Abraham The verdict of a jury is the a priori opinion of that juror who smokes the worst cigars. -- H. L. Mencken __________________________________________________________ Abraham vd Merwe - 2d3D, Inc. Device Driver Development, Outsourcing, Embedded Systems Cell: +27 82 565 4451 Snailmail: Tel: +27 21 761 7549 Block C, Aintree Park Fax: +27 21 761 7648 Doncaster Road Email: ab...@2d... Kenilworth, 7700 Http: http://www.2d3d.com South Africa |
From: Erik M. <J.A...@it...> - 2002-04-17 10:13:11
|
On Mon, Apr 15, 2002 at 04:04:57PM +0200, Abraham vd Merwe wrote: > I have a watchdog on my board which needs to be strobed at least every > 500ms, otherwise it resets the board. Therefore I need to use a timer > interrupt. I have a couple of questions to ask though: > > 1) Interrupts are disabled in blob at the moment right? So I won't be > interfering with something else if I setup an interrupt handler? No. Might be tricky, though. Best way is to modify the irq/firq entries in start.S to jump to a known location in trampoline.S, which on its turn can do the dirty work and call a C interrupt handling function. > 2) If I setup an interrupt handler, then I obviously need to uninstall the > interrupt handler (or at least disable interrupts) before I load the kernel > (or anything else for that matter). Where is the best/least intrusive place > to do that in blob? As for the best place to do it: look at how the icache gets disabled: code is in lib/icache.c, and in blob/initcalls.c the functions enable_icache() and disable_icache() are registered in the init and exitlist. I *hope* that the kernel boots fast enough before the watchdog kicks in. However, I wonder if you really need to keep the watchdog busy in blob. All watchdog devices I know have an option that they aren't enabled at boot time, but only start working after you first use them. So for as long as you don't touch the watchdog in blob, you also won't need any driver for it in blob. If you are affraid about a broken blob, think twice: the normal way of operation is that blob initialises the system and immediately boots the kernel. This even works with an unattended system. It can be tested in the lab that a normal unattended boot always succeeds, and the path through the blob code is completely repeatable every time. If there goes something wrong in blob, it's most probable that it is because something has been overwriting the flash. If that happens and there is no watchdog, blob will just crash and the system will be unusable. With a watchdog, the system will be rebooted, blob will crash again, the watchdog will kick in again, the system will be rebooted ... (ad nauseam). Anyway, in both cases it will result in a broken system that needs manual intervention, and no watchdog is more intelligent than a human being. So unless you have a brain damaged watchdog that simply needs to be kept happy, I don't think we need a watchdog driver in blob. It's not that I am against adding features in blob, it's just that I don't see a point in adding useless features. Erik -- J.A.K. (Erik) Mouw, Information and Communication Theory Group, Faculty of Information Technology and Systems, Delft University of Technology, PO BOX 5031, 2600 GA Delft, The Netherlands Phone: +31-15-2783635 Fax: +31-15-2781843 Email: J.A...@it... WWW: http://www-ict.its.tudelft.nl/~erik/ |
From: Erik M. <J.A...@it...> - 2002-04-17 09:40:54
|
On Tue, Apr 09, 2002 at 05:21:56PM +0200, Abraham van der Merwe wrote: > > >Update of /cvsroot/blob/blob/src/blob > > >In directory usw-pr-cvs1:/tmp/cvs-serv18273 > > > > > >Modified Files: > > > main.c > > >Log Message: > > >Changed the "Consider yourself LARTed" message to "Consider yourself BLOBed" > > > > Hm. > > > > I see the argument for changing this, however from a historical POV I > > would like to keep this string, if only for the LART. And then > > there's the fact that larting actually is a verb, as opposed to > > blobing (sic) ;-) > > I actually had a feeling that you or Erik might object (: What about having > a platform dependant message? The string for each platform could be defined > in the architecture headers... I agree with Jan-Derk, I'd like to have LARTed for the reasons he mentioned but also because it's a nice pun for the Unix/sysadmin scene. We can of course put it in the machine specific header file, but to be honest I'm not sure if it's worth the issue. I can imagine that you don't want your customers to be LARTed, but because blob is GPL'ed you are completely free to ship blob with a nicer^Wmore appropriate welcome text to your customers. Erik -- J.A.K. (Erik) Mouw, Information and Communication Theory Group, Faculty of Information Technology and Systems, Delft University of Technology, PO BOX 5031, 2600 GA Delft, The Netherlands Phone: +31-15-2783635 Fax: +31-15-2781843 Email: J.A...@it... WWW: http://www-ict.its.tudelft.nl/~erik/ |
From: Tim R. <tim...@us...> - 2002-04-17 05:32:43
|
Update of /cvsroot/blob/blob/include/blob/arch In directory usw-pr-cvs1:/tmp/cvs-serv12711/include/blob/arch Modified Files: shannon.h Log Message: checked Index: shannon.h =================================================================== RCS file: /cvsroot/blob/blob/include/blob/arch/shannon.h,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- shannon.h 4 Apr 2002 09:07:25 -0000 1.10 +++ shannon.h 17 Apr 2002 05:32:40 -0000 1.11 @@ -26,19 +26,13 @@ #ifndef BLOB_ARCH_SHANNON_H #define BLOB_ARCH_SHANNON_H - - - - /* boot CPU speed */ #define CPU_SPEED CPU_CORE_SPEED_191mhz - /* serial port */ #define USE_SERIAL3 #define TERMINAL_SPEED baud_115200 - /* GPIO for the LED */ #define LED_GPIO (0x00040000) /* GPIO 18, codec (ucb1300) reset */ @@ -86,7 +80,6 @@ /* the base address were blob-rest is loaded by the first stage loader */ #define BLOB_ABS_BASE_ADDR (0xc8000400) - /* where do various parts live in RAM */ #define BLOB_RAM_BASE (0xc0120000) #define KERNEL_RAM_BASE (0xc0008000) @@ -104,18 +97,13 @@ #define RAMDISK_FLASH_BASE (KERNEL_FLASH_BASE + KERNEL_FLASH_LEN) #define RAMDISK_FLASH_LEN (4 * 1024 * 1024 - BLOB_FLASH_LEN - PARAM_FLASH_LEN - KERNEL_FLASH_LEN) -#warning "check these defines" #define PARAM_START PARAM_FLASH_BASE #define PARAM_LEN PARAM_FLASH_LEN /* the position of the kernel boot parameters */ #define BOOT_PARAMS (0xc0000100) - /* the size (in kbytes) to which the compressed ramdisk expands */ #define RAMDISK_SIZE (8 * 1024) - - - #endif |
From: Abraham vd M. <ab...@2d...> - 2002-04-15 14:04:44
|
Hi! I have a watchdog on my board which needs to be strobed at least every 500ms, otherwise it resets the board. Therefore I need to use a timer interrupt. I have a couple of questions to ask though: 1) Interrupts are disabled in blob at the moment right? So I won't be interfering with something else if I setup an interrupt handler? 2) If I setup an interrupt handler, then I obviously need to uninstall the interrupt handler (or at least disable interrupts) before I load the kernel (or anything else for that matter). Where is the best/least intrusive place to do that in blob? --=20 Regards Abraham Vulcans worship peace above all. -- McCoy, "Return to Tomorrow", stardate 4768.3 __________________________________________________________ Abraham vd Merwe - 2d3D, Inc. Device Driver Development, Outsourcing, Embedded Systems Cell: +27 82 565 4451 Snailmail: Tel: +27 21 761 7549 Block C, Aintree Park Fax: +27 21 761 7648 Doncaster Road Email: ab...@2d... Kenilworth, 7700 Http: http://www.2d3d.com South Africa |
From: Christopher H. <ch...@mu...> - 2002-04-14 21:13:35
|
> - strange flash error messages. > > lock a block, write to it, you get errors. Unlock it, still error > messages. flash to it, still error messages. check it, it all worked. > The first write fails, the unlock and the second write succeed, but give > error messages. (I think) I fixed this for intel16 and intel32 a few weeks ago. AFAIK the intel16 and intel32 flash support is bug free. If you are having trouble with the code on the CVS trunk, please send details. I don't have any devices with amd flash, otherwise I'd tackle that. -ch mailto:ch...@hp... mailto:ch...@mu... http://www.murgatroid.com/ |
From: Erik M. <J.A...@it...> - 2002-04-13 17:46:45
|
On Fri, Apr 12, 2002 at 04:13:32AM -0600, Tim Riker wrote: > - Unexplained occasional slow erases for AMD flash - Russ? Haven't seen it happening on my Tux. > - occasional erases of the wrong partition! > > once in a while when I flash a root image and a kernel image on a > shannon the blob partition is erased. I don't know why this happens. It > does not seem to happen nearly as often if I soft reboot between each > flash. Never seen it, but it shouldn't happen. I think it can be because we left the flash not in read array mode. Might be related to the previour problem. > - strange flash error messages. > > lock a block, write to it, you get errors. Unlock it, still error > messages. flash to it, still error messages. check it, it all worked. > The first write fails, the unlock and the second write succeed, but give > error messages. With what kind of flash? Intel or AMD? > - xmodem padding. > > jffs2 uploads appear to be padded with 0x1a and so mess up jffs2 when it > tries to mark the rest of the upload block. Don't know if 0x1a can be > relied on. Perhaps we can search for 8 or more of the same byte at the > end of the last block and change them all to 0xff if found? then set the > length to this guess value and perhaps md5sums would work again? Perhaps > an upgraded protocol with length info should be implemented instead? That's because xmodem has no way to tell the receiver the exact filesize. It only sends complete blocks, and pads them with whatever it likes. Either we have to implement ymodem (which is basically xmodem with 1k blocks, multiple files, and file attributes like name and length), or you have to pad the file you want to upload with dd (dd if=orig of=new bs=1k conv=sync). > I'd like to see a faster boot unless keypress option (if not the > default) That's easy to change in the param block. > Erik Mouw wrote: > > I usually release a new version when there are no knowm major bugs. > > Right now we have the following issues still open: > > - serial-typeahead bug fixed > > fixed? or needs to be? Needs to be. Erik -- J.A.K. (Erik) Mouw, Information and Communication Theory Group, Faculty of Information Technology and Systems, Delft University of Technology, PO BOX 5031, 2600 GA Delft, The Netherlands Phone: +31-15-2783635 Fax: +31-15-2781843 Email: J.A...@it... WWW: http://www-ict.its.tudelft.nl/~erik/ |
From: Tim R. <Ti...@Ri...> - 2002-04-12 11:20:55
|
- Unexplained occasional slow erases for AMD flash - Russ? - occasional erases of the wrong partition! once in a while when I flash a root image and a kernel image on a shannon the blob partition is erased. I don't know why this happens. It does not seem to happen nearly as often if I soft reboot between each flash. - strange flash error messages. lock a block, write to it, you get errors. Unlock it, still error messages. flash to it, still error messages. check it, it all worked. The first write fails, the unlock and the second write succeed, but give error messages. - xmodem padding. jffs2 uploads appear to be padded with 0x1a and so mess up jffs2 when it tries to mark the rest of the upload block. Don't know if 0x1a can be relied on. Perhaps we can search for 8 or more of the same byte at the end of the last block and change them all to 0xff if found? then set the length to this guess value and perhaps md5sums would work again? Perhaps an upgraded protocol with length info should be implemented instead? I'd like to see a faster boot unless keypress option (if not the default) Erik Mouw wrote: > I usually release a new version when there are no knowm major bugs. > Right now we have the following issues still open: > - serial-typeahead bug fixed fixed? or needs to be? > - flash partitioning > - parameter block support -- Tim Riker - http://rikers.org/ - short SIGs! <g> All I need to know I could have learned in Kindergarten ... if I'd just been paying attention. |
From: Abraham v. d. M. <ab...@fr...> - 2002-04-09 15:28:16
|
Hi J.D.! > >Update of /cvsroot/blob/blob/src/blob > >In directory usw-pr-cvs1:/tmp/cvs-serv18273 > > > >Modified Files: > > main.c > >Log Message: > >Changed the "Consider yourself LARTed" message to "Consider yourself BLO= Bed" >=20 > Hm. >=20 > I see the argument for changing this, however from a historical POV I=20 > would like to keep this string, if only for the LART. And then=20 > there's the fact that larting actually is a verb, as opposed to=20 > blobing (sic) ;-) I actually had a feeling that you or Erik might object (: What about having a platform dependant message? The string for each platform could be defined in the architecture headers... --=20 Regards Abraham Am I elected yet? ___________________________________________________ Abraham vd Merwe [ZR1BBQ] - Frogfoot Networks P.O. Box 3472, Matieland, Stellenbosch, 7602 Cell: +27 82 565 4451 Http: http://www.frogfoot.net Email: ab...@fr... |
From: Abraham vd M. <ab...@us...> - 2002-04-09 12:40:17
|
Update of /cvsroot/blob/blob/src/blob In directory usw-pr-cvs1:/tmp/cvs-serv18273 Modified Files: main.c Log Message: Changed the "Consider yourself LARTed" message to "Consider yourself BLOBed" Index: main.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/main.c,v retrieving revision 1.40 retrieving revision 1.41 diff -u -d -r1.40 -r1.41 --- main.c 27 Feb 2002 17:21:47 -0000 1.40 +++ main.c 9 Apr 2002 12:40:11 -0000 1.41 @@ -101,7 +101,7 @@ #endif /* Print the required GPL string */ - printf("\nConsider yourself LARTed!\n\n"); + printf("\nConsider yourself BLOBed!\n\n"); printf("%sCopyright (C) 1999 2000 2001 2002 " "Jan-Derk Bakker and Erik Mouw\n", version_str); printf(PACKAGE " comes with ABSOLUTELY NO WARRANTY; " |
From: Abraham vd M. <ab...@us...> - 2002-04-09 12:36:03
|
Update of /cvsroot/blob/blob/include/blob/arch In directory usw-pr-cvs1:/tmp/cvs-serv16765 Modified Files: frodo.h Log Message: Slowed down the timings on nCS4 a bit so that the ethernet controller can work (will probably move the ethernet chip to another chip select anyway) and removed the timings for < 200mhz (not using that anyway) Index: frodo.h =================================================================== RCS file: /cvsroot/blob/blob/include/blob/arch/frodo.h,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- frodo.h 3 Apr 2002 05:05:47 -0000 1.9 +++ frodo.h 9 Apr 2002 12:35:57 -0000 1.10 @@ -27,7 +27,7 @@ #define BLOB_ARCH_FRODO_H /* boot CPU speed */ -#define CPU_SPEED (CPU_CORE_SPEED_221mhz) +#define CPU_SPEED (CPU_CORE_SPEED_206mhz) /* * Serial port 1 is used for the Serial port w/ flow control. @@ -69,39 +69,19 @@ /* Memory configuration */ #ifdef BLOB_NEED_MEMCONFIG -#define SMCNFG_VALUE 0x00000000 - -#if (CPU_SPEED >= CPU_CORE_SPEED_206mhz) - -# define MDCNFG_VALUE 0x0000a265 - -#ifdef MDRFER_DONT_BELIEVE_IN_MAGIC -# define MDREFR_VALUE 0x00700061 -#endif /* #ifdef MDRFER_DONT_BELIEVE_IN_MAGIC */ - -# define MDCAS00_VALUE 0x5555557f -# define MDCAS01_VALUE 0x55555555 -# define MDCAS02_VALUE 0x55555555 -# define MSC0_VALUE 0x00004770 /* nCS[1:0] 32-bit, flash */ -# define MSC1_VALUE 0x4f710000 /* nCS[3:2] 32-bit, daughter card */ -# define MSC2_VALUE 0x00004f75 /* nCS[5:4] 16-bit, CPLDs, etc. */ - -#else /* #if (CPU_SPEED >= CPU_CORE_SPEED_206mhz) */ - -# define MDCNFG_VALUE 0x0000a165 +#define SMCNFG_VALUE 0x00000000 +#define MDCNFG_VALUE 0x0000a265 #ifdef MDRFER_DONT_BELIEVE_IN_MAGIC -# define MDREFR_VALUE 0x00300051 +#define MDREFR_VALUE 0x00700061 #endif /* #ifdef MDRFER_DONT_BELIEVE_IN_MAGIC */ -# define MDCAS00_VALUE 0xaaaaaaa7 -# define MDCAS01_VALUE 0xaaaaaaaa -# define MDCAS02_VALUE 0xaaaaaaaa -# define MSC0_VALUE 0x00004668 /* nCS[1:0] 32-bit, flash */ -# define MSC1_VALUE 0x4e6d0000 /* nCS[3:2] 32-bit, daughter card */ -# define MSC2_VALUE 0x00004e69 /* nCS[5:4] 16-bit, CPLDs, etc. */ - -#endif /* #if (CPU_SPEED >= CPU_CORE_SPEED_206mhz) */ +#define MDCAS00_VALUE 0x5555557f +#define MDCAS01_VALUE 0x55555555 +#define MDCAS02_VALUE 0x55555555 +#define MSC0_VALUE 0x00004f70 /* nCS[1:0] 32-bit, flash */ +#define MSC1_VALUE 0x4f710000 /* nCS[3:2] 32-bit, daughter card */ +#define MSC2_VALUE 0x0000ef75 /* nCS[5:4] 16-bit, CPLDs, etc. */ /* * These are currently unused: |