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...> - 2002-05-27 10:08:02
|
Update of /cvsroot/blob/blob/src/diag In directory usw-pr-cvs1:/tmp/cvs-serv10621/src/diag Modified Files: Makefile.am Log Message: - FGAG miniprint port by Urs Kaufmann Index: Makefile.am =================================================================== RCS file: /cvsroot/blob/blob/src/diag/Makefile.am,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- Makefile.am 23 Apr 2002 12:36:20 -0000 1.15 +++ Makefile.am 27 May 2002 10:01:53 -0000 1.16 @@ -66,6 +66,7 @@ idr.c \ jornada720.c \ lart.c \ + miniprint.c \ nesa.c \ pleb.c \ shannon.c \ |
From: Stefan E. <se...@us...> - 2002-05-27 10:08:02
|
Update of /cvsroot/blob/blob/utils/build In directory usw-pr-cvs1:/tmp/cvs-serv10621/utils/build Modified Files: build_Makefile build_all Log Message: - FGAG miniprint port by Urs Kaufmann Index: build_Makefile =================================================================== RCS file: /cvsroot/blob/blob/utils/build/build_Makefile,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- build_Makefile 23 Apr 2002 12:36:20 -0000 1.11 +++ build_Makefile 27 May 2002 10:01:54 -0000 1.12 @@ -14,7 +14,7 @@ archs = \ accelent_sa assabet badge4 brutus creditlart h3600 idr\ - jornada720 lart neponset nesa pleb shannon\ + jornada720 lart miniprint neponset nesa pleb shannon\ system3 frodo trizeps debug-archs = $(foreach a, $(archs), $(a)-debug) all-archs = $(archs) $(debug-archs) Index: build_all =================================================================== RCS file: /cvsroot/blob/blob/utils/build/build_all,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- build_all 23 Apr 2002 12:36:20 -0000 1.12 +++ build_all 27 May 2002 10:01:54 -0000 1.13 @@ -12,7 +12,7 @@ # published by the Free Software Foundation. # -archs="accelent_sa assabet badge4 brutus creditlart h3600 idr jornada720 lart neponset nesa pleb shannon system3 frodo trizeps" +archs="accelent_sa assabet badge4 brutus creditlart h3600 idr jornada720 lart miniprint neponset nesa pleb shannon system3 frodo trizeps" linux_prefix=~/LART/build/linux/elinux blob_src=~/src/sourceforge/blob extra_flags="--enable-all-features --with-commands=all" |
From: Stefan E. <se...@us...> - 2002-05-27 09:59:37
|
Update of /cvsroot/blob/blob/src/diag In directory usw-pr-cvs1:/tmp/cvs-serv9560 Modified Files: lcd.c Log Message: - lcd_fill(), lcd_set_pixel() by Urs Kaufmann Index: lcd.c =================================================================== RCS file: /cvsroot/blob/blob/src/diag/lcd.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- lcd.c 11 Feb 2002 16:53:16 -0000 1.6 +++ lcd.c 27 May 2002 09:59:33 -0000 1.7 @@ -1,11 +1,11 @@ /********************************************************************** * lcd.c * - * AUTOR: SELETZ - * * Generic lcd framework * - * Copyright (C) 2001 Stefan Eletzhofer <ste...@ww...> + * Copyright (C) 2001,2002 Stefan Eletzhofer + * <ste...@ww...> + * Copyright (C) 2002 Urs Kaufmann <u_k...@bl...> * * 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 @@ -53,6 +53,10 @@ SerialOutputHex( val ); \ serial_write( '\n' ); +#ifdef MINIPRINT +# define LCD_GRADIENT +#endif + /********************************************************************** * program globals */ @@ -133,15 +137,20 @@ int WEAK_SYM lcd_palette_setup( void ) { - int n; + unsigned int n; +#ifdef LCD_GRADIENT + for ( n = 0 ; n < 256 ; n++ ) { + lcd_palette_set(n, 0x1000+(n<<4) ); + } +#else for ( n = 0 ; n < 128 ; n++ ) { lcd_palette_set(n, 0x1FFF ); } for ( n = 128 ; n < 256 ; n++ ) { lcd_palette_set(n, 0x1000 ); } - +#endif return 0; } @@ -155,6 +164,52 @@ return 0; } +int WEAK_SYM lcd_fill (int color) +{ + int i = 0; + + if (color>0xFF)return -EINVAL; + + color += (color<<8) + (color<<16) + (color<<24); + for(; i<(LCD_COLS*LCD_ROWS/4);i++) + lcd_vram[i] = color; + + return 0; +} + +int WEAK_SYM lcd_set_pixel (unsigned int x, unsigned int y, unsigned int color) +{ + +#ifdef LCD_REVERSE + x = LCD_COLS - 1 - x; + y = LCD_ROWS - 1 - y; +#endif + + if ((color>0xFF)||(y>=LCD_ROWS)||(x>=LCD_COLS)) return -EINVAL; + + switch(x%4) + { + case 0: + lcd_vram[(x>>2)+y*(LCD_COLS>>2)] = + (lcd_vram[(x>>2)+((y*LCD_COLS)>>2)]&0xFFFFFF00)|color; + break; + case 1: + lcd_vram[(x>>2)+y*(LCD_COLS>>2)] = + (lcd_vram[(x>>2)+((y*LCD_COLS)>>2)]&0xFFFF00FF)|(color<<8); + break; + case 2: + lcd_vram[(x>>2)+y*(LCD_COLS>>2)] = + (lcd_vram[(x>>2)+((y*LCD_COLS)>>2)]&0xFF00FFFF)|(color<<16); + break; + case 3: + lcd_vram[(x>>2)+y*(LCD_COLS>>2)] = + (lcd_vram[(x>>2)+((y*LCD_COLS)>>2)]&0x00FFFFFF)|(color<<24); + break; + } + + return 0; +} + /********************************************************************** * Statische Funktionen */ @@ -214,7 +269,14 @@ if ( ret != 0 ) return ret; SerialOutputString( "done\n" ); - +#ifdef LCD_GRADIENT + /* Gradient (bastel-code weil fixe aufloesung) */ + SerialOutputString( "LCD: Gradient test pattern ..." ); + lcd_fill(0x00); + for ( y=0; y<240; y++ ) + for ( x=0; x<320; x++ ) + lcd_set_pixel(x,y,(x/20)+((y/15)*16)); +#else /* vertical lines */ SerialOutputString( "LCD: vertical lines test pattern ..." ); for ( y=0; y<LCD_ROWS; y++ ) { @@ -226,7 +288,7 @@ } } } - +#endif SerialOutputString( "done\n" ); SerialOutputString( "LCD: press any key to proceed\n" ); |
From: Erik M. <er...@us...> - 2002-05-25 17:12:11
|
Update of /cvsroot/blob/blob/utils/mkparamblock In directory usw-pr-cvs1:/tmp/cvs-serv23079/utils/mkparamblock Modified Files: Makefile.am Log Message: Typo. Index: Makefile.am =================================================================== RCS file: /cvsroot/blob/blob/utils/mkparamblock/Makefile.am,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Makefile.am 25 May 2002 17:09:57 -0000 1.3 +++ Makefile.am 25 May 2002 17:12:08 -0000 1.4 @@ -24,4 +24,4 @@ mkparamblock.c -CLEANFILE = ${srcdir}/*~ +CLEANFILES = ${srcdir}/*~ |
From: Erik M. <er...@us...> - 2002-05-25 17:10:01
|
Update of /cvsroot/blob/blob/utils In directory usw-pr-cvs1:/tmp/cvs-serv22349/utils Modified Files: Makefile.am Log Message: Solve the problems with utils/mkparamblock/ and utils/test/ in such a way that we still can take advantage of autoconf+automake. Index: Makefile.am =================================================================== RCS file: /cvsroot/blob/blob/utils/Makefile.am,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- Makefile.am 27 Apr 2002 00:55:04 -0000 1.6 +++ Makefile.am 25 May 2002 17:09:57 -0000 1.7 @@ -5,9 +5,12 @@ SUBDIRS = \ build \ - mkparamblock + mkparamblock \ + test + CLEANFILES = *~ + EXTRA_DIST = \ README \ |
From: Erik M. <er...@us...> - 2002-05-25 17:10:01
|
Update of /cvsroot/blob/blob/utils/mkparamblock In directory usw-pr-cvs1:/tmp/cvs-serv22349/utils/mkparamblock Modified Files: Makefile.am mkparamblock.c Log Message: Solve the problems with utils/mkparamblock/ and utils/test/ in such a way that we still can take advantage of autoconf+automake. Index: Makefile.am =================================================================== RCS file: /cvsroot/blob/blob/utils/mkparamblock/Makefile.am,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Makefile.am 18 Sep 2001 19:45:29 -0000 1.2 +++ Makefile.am 25 May 2002 17:09:57 -0000 1.3 @@ -3,13 +3,25 @@ # $Id$ # +CC = gcc + + +CFLAGS = -g -O2 -Wall \ + -DHAVE_CONFIG_H -DUSER_SPACE_TEST -DUSE_BLOB_TOGETHER_WITH_LIBC \ + -I${top_builddir}/include \ + -I${top_srcdir}/include \ + -I@LINUX_INCLUDE@ + + +LDFLAGS = + + bin_PROGRAMS = \ mkparamblock + mkparamblock_SOURCES = \ mkparamblock.c -mkparamblock: mkparamblock.c - gcc -Wall -O2 -I${top_builddir}/include -I${top_srcdir}/include -o $@ $< -CLEANFILE = mkparamblock *~ +CLEANFILE = ${srcdir}/*~ Index: mkparamblock.c =================================================================== RCS file: /cvsroot/blob/blob/utils/mkparamblock/mkparamblock.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- mkparamblock.c 21 Jan 2002 20:15:54 -0000 1.11 +++ mkparamblock.c 25 May 2002 17:09:57 -0000 1.12 @@ -5,7 +5,6 @@ #include <stdlib.h> #include <limits.h> #include <sys/stat.h> -#define USE_BLOB_TOGETHER_WITH_LIBC #include <blob/param_block.h> #include <blob/serial.h> |
From: Erik M. <er...@us...> - 2002-05-25 17:10:01
|
Update of /cvsroot/blob/blob/include/blob In directory usw-pr-cvs1:/tmp/cvs-serv22349/include/blob Modified Files: types.h Log Message: Solve the problems with utils/mkparamblock/ and utils/test/ in such a way that we still can take advantage of autoconf+automake. Index: types.h =================================================================== RCS file: /cvsroot/blob/blob/include/blob/types.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- types.h 13 Feb 2002 00:02:30 -0000 1.4 +++ types.h 25 May 2002 17:09:57 -0000 1.5 @@ -44,6 +44,8 @@ #ifndef USE_BLOB_TOGETHER_WITH_LIBC typedef u32 size_t; +#else +#include <stdlib.h> #endif /* number of nibbles in a word */ |
From: Erik M. <er...@us...> - 2002-05-25 17:10:01
|
Update of /cvsroot/blob/blob/utils/test In directory usw-pr-cvs1:/tmp/cvs-serv22349/utils/test Modified Files: Makefile.am Log Message: Solve the problems with utils/mkparamblock/ and utils/test/ in such a way that we still can take advantage of autoconf+automake. Index: Makefile.am =================================================================== RCS file: /cvsroot/blob/blob/utils/test/Makefile.am,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- Makefile.am 2 May 2002 04:16:58 -0000 1.6 +++ Makefile.am 25 May 2002 17:09:57 -0000 1.7 @@ -2,58 +2,48 @@ # # $Id$ # +# This is a special Makefile because it plays with a CC and CFLAGS +# to compile with the native C compiler (which we assume is gcc). +# The manipulation of the VPATH is needed to be able to compile +# sources from other directories. -- Erik +# -load_kernel_test_OBJECTS = \ -load_kernel_test.o \ -load_kernel.o \ -md5.o \ -md5support.o \ -mini_inflate.o \ -error.o \ -flash.o \ -util.o \ -jffs2.o \ -compr_rtime.o \ -compr_rubin.o \ -cramfs.o \ -zImage.o \ -crc32.o - -EXTRA_load_kernel_test_SOURCES = \ -load_kernel.c \ -md5.c \ -md5support.c \ -mini_inflate.c \ -error.c \ -flash.c \ -util.c \ -jffs2.c \ -compr_rtime.c \ -compr_rubin.c \ -cramfs.c \ -zImage.c \ -crc32.c -bin_PROGRAMS = \ - load_kernel_test +VPATH = $(top_srcdir)/utils/test:$(top_srcdir)/src/blob:$(top_srcdir)/src/lib -CFLAGS = -g -Wall -DHAVE_CONFIG_H -DUSER_SPACE_TEST -I${top_builddir}/include \ - -I${top_srcdir}/include -I@LINUX_INCLUDE@ CC = gcc -LDFLAGS = -LINK = $(CC) $(CFLAGS) $(LDFLAGS) -o $@ +CFLAGS = -g -O2 -Wall \ + -DHAVE_CONFIG_H -DUSER_SPACE_TEST -DUSE_BLOB_TOGETHER_WITH_LIBC \ + -I${top_builddir}/include \ + -I${top_srcdir}/include \ + -I@LINUX_INCLUDE@ -load_kernel_test_SOURCES = \ - load_kernel_test.c \ - $(load_kernel_test_extra_SOURCES) -load_kernel_test: $(load_kernel_test_OBJECTS) - gcc $(CFLAGS) -o $@ $(load_kernel_test_OBJECTS) +LDFLAGS = -$(EXTRA_load_kernel_test_SOURCES): - ln -s ../../src/*/$@ -CLEANFILE = load_kernel_test *~ +bin_PROGRAMS = \ + load_kernel_test + + +load_kernel_test_SOURCES = \ + load_kernel_test.c \ + load_kernel.c \ + md5.c \ + md5support.c \ + mini_inflate.c \ + error.c \ + flash.c \ + util.c \ + jffs2.c \ + compr_rtime.c \ + compr_rubin.c \ + cramfs.c \ + zImage.c \ + crc32.c + + +CLEANFILES = ${srcdir}/*~ |
From: Erik M. <er...@us...> - 2002-05-25 14:45:06
|
Update of /cvsroot/blob/blob/src/blob In directory usw-pr-cvs1:/tmp/cvs-serv14069 Modified Files: linux.c Log Message: Add support for linux-2.4.18-pre6 and later by putting the physical address of the boot parameters in r2. Backward compatible with older kernel versions cause they will completely ignore r2. (yes, of course blob is the first boot loader to support this feature :) Index: linux.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/linux.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- linux.c 9 Apr 2002 12:01:28 -0000 1.14 +++ linux.c 25 May 2002 14:45:02 -0000 1.15 @@ -1,7 +1,9 @@ /* * linux.c: support functions for booting a kernel * - * Copyright (C) 2001 Erik Mouw (J.A...@it...) + * $Id$ + * + * Copyright (C) 2001 2002 Erik Mouw (J.A...@it...) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -49,7 +51,8 @@ static int boot_linux(int argc, char *argv[]) { - void (*theKernel)(int zero, int arch) = (void (*)(int, int))KERNEL_RAM_BASE; + void (*theKernel)(int zero, int arch, u32 params) = + (void (*)(int, int, u32))KERNEL_RAM_BASE; setup_start_tag(); setup_memory_tags(); @@ -66,7 +69,7 @@ exit_subsystems(); /* start kernel */ - theKernel(0, ARCH_NUMBER); + theKernel(0, ARCH_NUMBER, BOOT_PARAMS); printf("Hey, the kernel returned! This should not happen.\n"); |
From: Christopher H. <ch...@us...> - 2002-05-13 20:08:09
|
Update of /cvsroot/blob/blob In directory usw-pr-cvs1:/tmp/cvs-serv6481 Modified Files: AUTHORS Log Message: updated Index: AUTHORS =================================================================== RCS file: /cvsroot/blob/blob/AUTHORS,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- AUTHORS 8 May 2002 15:37:39 -0000 1.8 +++ AUTHORS 13 May 2002 19:54:31 -0000 1.9 @@ -42,12 +42,13 @@ - Tim Riker <Ti...@Ri...>, <Ti...@De...>, <Ti...@Li...> -* Various fixes -=============== +* Various fixes and additions +============================= - Mark Huang <mh...@li...>, RTC fix - Justin M. Seger <jus...@in...>, Assabet fixes - Wookey <wo...@al...>, run-from-RAM - +- Christopher Hoover <ch...@hp...> intel{16,32} flash re-write, xmodem, + md5, i2c * PT system 3 port ================== |
From: Christopher H. <ch...@us...> - 2002-05-13 20:08:08
|
Update of /cvsroot/blob/blob/include/blob/arch In directory usw-pr-cvs1:/tmp/cvs-serv6801/include/blob/arch Modified Files: jornada720.h Log Message: Jornada 720 can do 206MHz; so do that. Index: jornada720.h =================================================================== RCS file: /cvsroot/blob/blob/include/blob/arch/jornada720.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- jornada720.h 27 Feb 2002 18:41:48 -0000 1.5 +++ jornada720.h 13 May 2002 19:55:13 -0000 1.6 @@ -31,7 +31,7 @@ /* boot CPU speed */ -#define CPU_SPEED (0x09) +#define CPU_SPEED CPU_CORE_SPEED_206mhz /* serial port */ |
From: Stefan E. <se...@us...> - 2002-05-13 09:39:02
|
Update of /cvsroot/blob/blob/include/blob/arch In directory usw-pr-cvs1:/tmp/cvs-serv30752 Modified Files: system3.h Log Message: - RAM pool for newer revision boards Index: system3.h =================================================================== RCS file: /cvsroot/blob/blob/include/blob/arch/system3.h,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- system3.h 8 May 2002 19:14:10 -0000 1.16 +++ system3.h 13 May 2002 09:38:59 -0000 1.17 @@ -30,8 +30,8 @@ #undef CPU_SPEED_133 /* SYSTEM3 with 64 MB SDRAM, all on bank0 */ -#undef CONFIG_SYSTEM3_REV0802 -//#define CONFIG_SYSTEM3_REV0802 +//#undef CONFIG_SYSTEM3_REV0802 +#define CONFIG_SYSTEM3_REV0802 /* boot CPU speed */ #ifdef CPU_SPEED_133 @@ -73,6 +73,15 @@ #define RAMDISK_FLASH_LEN (1536 * 1024) #define CRAMFS_FLASH_BASE (0x00300000) #define CRAMFS_FLASH_LEN (13312 * 1024) + +/* system3 RAM pool for up/downloading */ +#if !defined(CONFIG_SYSTEM3_REV0802) +#define RAM_START (0xd0000000) +#define RAM_SIZE (16*1024*1024) +#else +#define RAM_START (0xc1000000) +#define RAM_SIZE (16*1024*1024) +#endif /* the position of the kernel boot parameters */ |
From: Stefan E. <se...@us...> - 2002-05-13 09:37:44
|
Update of /cvsroot/blob/blob/src/lib In directory usw-pr-cvs1:/tmp/cvs-serv29824 Modified Files: generic_io.c Log Message: - output progress during io_copy() unless IO_QUIET is defined Index: generic_io.c =================================================================== RCS file: /cvsroot/blob/blob/src/lib/generic_io.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- generic_io.c 10 May 2002 15:36:24 -0000 1.5 +++ generic_io.c 13 May 2002 09:37:41 -0000 1.6 @@ -47,6 +47,7 @@ #define IO_MODULE_TEST 0 #define IO_DEBUG 1 +#undef IO_QUIET #if IO_DEBUG # define DBG( x, args... ) if ( io_dbg>x ) printf( args ) @@ -276,7 +277,9 @@ } else { to_copy = amount; } - DBG( 1, "%s: block %d/%d (%d bytes)\n", __FUNCTION__, block+1, blocks, to_copy ); +#if !defined(IO_QUIET) + printf( "%s: block %d/%d (%d bytes to go) \r", __FUNCTION__, block+1, blocks, amount ); +#endif /* read from source */ ret = io_read( buffer, adr, to_copy, src ); |
From: Stefan E. <se...@us...> - 2002-05-13 09:36:25
|
Update of /cvsroot/blob/blob/src/blob In directory usw-pr-cvs1:/tmp/cvs-serv29406 Modified Files: system3.c Log Message: - sysupd command updated Index: system3.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/system3.c,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- system3.c 10 May 2002 16:04:23 -0000 1.20 +++ system3.c 13 May 2002 09:36:22 -0000 1.21 @@ -51,6 +51,7 @@ #include <blob/generic_io.h> #include <blob/pcmcia.h> +#include <blob/cf.h> #include <blob/ide.h> #include <blob/tar.h> @@ -72,21 +73,6 @@ #define SET(reg,bit) ((reg) |= (1<<(bit))) #define RST(reg,bit) ((reg) &= ~(1<<(bit))) -/***************************************************************** - * CF Flash register definitions - */ -/* config register - offset 0 */ -#define CF_REG_CFG (0x00) -#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) - -/* config status register - offset 2 */ -#define CF_REG_CFGSTAT (0x02) - #define SYSTEM3_DEBUG 1 #if SYSTEM3_DEBUG @@ -112,7 +98,7 @@ */ #if SYSTEM3_DEBUG -static int sys3_dbg = 2; +static int sys3_dbg = 1; #else static int sys3_dbg = 0; #endif @@ -177,7 +163,7 @@ next: sizeof(blob_partition_t), offset: CONFIG_FLASH_BASE, size: CONFIG_FLASH_LEN, - name: "config", + name: "config.tar", flags: 0 }, { @@ -412,127 +398,53 @@ //sa1111_init(); return 0; } +#endif +#if defined(CONFIG_CMD_SYSUPDATE) +/********************************************************************** + * sysupd - update complete system. Flashes + * blob, config, kernel, initrd and cramfs images. + */ -#if 0 -/***************************************************************** - * pcmcia_test - test PCMCIA, CF and IDE +/* update_umage - Read image "image" from TAR io driver and flash it + * into a BLOB partition */ -static int pcmcia_test( int argc, char *argv[] ) +static int update_image( char *image ) { - int ret = 0; - int slot = 1; /* default CF */ - u32 slot_base; - u32 slot_attr; - u16 cfg_reg; - ide_drive_t drive; - int sec; - u8 cfgvalue; - u8 value; - - char buffer[4096]; + int ret; - ret = pcmcia_init(); - if ( ret != 0 ) ERR( -EINVAL ); + if ( !image ) + return -EINVAL; - if ( argc > 1 ) { - switch ( argv[1][0] ) { - case '0': - slot = 0; - break; - case '1': - slot = 1; - break; - } + /* select tar file */ + ret = io_configure( "TAR", image ); + if ( ret ) { + printf( "sysupd: can't find image '%s'. Skipping.\n", image ); + return -EINVAL; } - 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 ); - - ret = pcmcia_cis_parse( slot ); - if ( ret != 0 ) ERR( -EINVAL ); - - ret = pcmcia_slot_cfg_reg_get( slot, &cfg_reg ); - if ( ret != 0 ) ERR( -EINVAL ); - printf( "slot %d config register: 0x%03x\n", slot, cfg_reg ); - - pcmcia_slot_attr_read( slot, CF_REG_CFG, &cfgvalue ); - printf( "slot %d config register: 0x%02x = 0x%02x\n", slot, CF_REG_CFG, cfgvalue ); - - pcmcia_slot_attr_read( slot, CF_REG_CFGSTAT, &value ); - printf( "slot %d config status register: 0x%02x = 0x%02x\n", slot, CF_REG_CFGSTAT, value ); - - /* reset CF card */ - pcmcia_slot_attr_write( slot, CF_REG_CFG, cfgvalue | CF_CFG_SRST ); - msleep(1); - pcmcia_slot_attr_write( slot, CF_REG_CFG, cfgvalue & (~CF_CFG_SRST) ); - pcmcia_slot_attr_read( slot, CF_REG_CFG, &cfgvalue ); - printf( "slot %d config register: 0x%02x = 0x%02x\n", slot, CF_REG_CFG, cfgvalue ); - - - /* configure for true ide mode */ - pcmcia_slot_attr_write( slot, CF_REG_CFG, cfgvalue | CF_CFG_IO_IDE0 ); - pcmcia_slot_attr_read( slot, CF_REG_CFG, &cfgvalue ); - printf( "slot %d config register: 0x%02x = 0x%02x\n", slot, CF_REG_CFG, cfgvalue ); - - pcmcia_slot_attr_read( slot, CF_REG_CFGSTAT, &value ); - printf( "slot %d config status register: 0x%02x = 0x%02x\n", slot, CF_REG_CFGSTAT, value ); - - printf( "slot %d enabled\n", slot ); - - 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 ); + /* select partition */ + ret = io_configure( "BLOB_PART", image ); + if ( ret ) { + printf( "sysupd: can't find flash partition '%s'. Skipping.\n", image ); + return -EINVAL; + } #if 1 - for ( sec=0; sec<10; sec++ ) { - ret = hd_read_mapped( &drive, sec, buffer ); - if ( ret != 0 ) ERR( -EINVAL ); - dumpmem( buffer, 512 ); + /* flash tha image, man! */ + ret = io_copy( "BLOB_PART", "TAR", 0 ); + if ( ret ) { + /* ouch! */ + printf( "sysupd: error updating image %s (%d).\n", image, ret ); + return ret; } +#else + DBG( 1, "%s: io_copy( BLOB_PART, TAR, 0 )\n", __FUNCTION__ ); #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; + return 0; } -static char pcmciahelp[] = "pcmcia test\n"; -__commandlist(pcmcia_test, "pcmciatest", pcmciahelp); -#endif -#endif -#if defined(CONFIG_CMD_SYSUPDATE) -/********************************************************************** - * sysupd - update complete system. Flashes - * blob, config, kernel, initrd and cramfs images. - */ static int sysupd_cmd( int argc, char *argv[] ) { int ret; @@ -542,9 +454,31 @@ int i=0; char *source = "CF"; - if ( argc>1 ) - source = argv[1]; + argv++; + /* source io param */ + if ( argc>1 ) { + source = *argv; + argv++; + argc--; + } + + /* image list */ + if ( argc>1 ) { + char **ptr; + ptr = update_files; + while (argc && ptr ) { + *ptr = *argv; + DBG( 1, "image += '%s'\n", *ptr ); + + argc -= 1; + argv++; + ptr++; + } + *ptr = NULL; + } + + /* configure CF card if CF is source */ if ( strncmp( source, "CF", 2 ) == 0 ) { /* CF card is on slot 1 */ ret = io_configure( "CF", (void *)1 ); @@ -568,44 +502,22 @@ return ret; } + /* update all images in list */ while ( (image=update_files[i++]) != NULL ) { - /* select tar file */ - ret = io_configure( "TAR", image ); - if ( ret ) { - printf( "sysupd: can't find image '%s'. Skipping.\n", image ); - continue; - } - - /* select partition */ - ret = io_configure( "BLOB_PART", image ); - if ( ret ) { - printf( "sysupd: can't find flash partition '%s'. Skipping.\n", image ); - continue; - } - -#if 1 - /* flash tha image, man! */ - ret = io_copy( "BLOB_PART", "TAR", 0 ); - if ( ret ) { - /* ouch! */ - printf( "sysupd: error updating image %s (%d).\n", image, ret ); - return ret; - } -#else - DBG( 1, "%s: io_copy( BLOB_PART, TAR, 0 )\n", __FUNCTION__ ); -#endif - - printf( "sysupd: flashed image '%s'\n", image ); + ret = update_image( image ); + if ( ret == 0 ) + printf( "sysupd: flashed image '%s'\n", image ); } return 0; } -static char sysupd_help[] = "sysupd [CF|RAM]\n\nUpdate board firmware from CF card or RAM.\n" +static char sysupd_help[] = "sysupd [CF|RAM] [image [image]...]\n\nUpdate board firmware from CF card or RAM.\n" "You have to have a update CF card inserted (for CF updates) _or_ uploaded a\n" "update image to ram."; __commandlist(sysupd_cmd, "sysupd", sysupd_help); #endif +#if defined(IO_TEST) int io_cmd( int argc, char *argv[] ) { int ret; @@ -648,6 +560,7 @@ } static char io_help[] = "io test function\n"; __commandlist(io_cmd, "iotest", io_help); +#endif #if defined(CONFIG_GIO_BLOB_PARTITION) /********************************************************************** @@ -842,7 +755,7 @@ { u32 offset; - DBG( 1, "%s: dest=%p, src=%p, amount=%d, io=%p\n", __FUNCTION__, + DBG( 5, "%s: dest=%p, src=%p, amount=%d, io=%p\n", __FUNCTION__, dest, src, amount, io ); if ( !io || !dest ) @@ -851,7 +764,7 @@ offset = (u32)io->private_data; - DBG( 1, "%s: using offset %x.\n", __FUNCTION__, offset ); + DBG( 5, "%s: using offset %x.\n", __FUNCTION__, offset ); memcpy( dest, (unsigned char *)(offset + (u32)src), amount ); @@ -864,7 +777,7 @@ u32 offset; u32 adr; - DBG( 1, "%s: dest=%p, src=%p, amount=%d, io=%p\n", __FUNCTION__, + DBG( 5, "%s: dest=%p, src=%p, amount=%d, io=%p\n", __FUNCTION__, dest, src, amount, io ); if ( !io || !src ) @@ -872,7 +785,7 @@ offset = (u32)io->private_data; - DBG( 1, "%s: using offset %x.\n", __FUNCTION__, offset ); + DBG( 5, "%s: using offset %x.\n", __FUNCTION__, offset ); adr = (u32)dest + offset; @@ -887,7 +800,7 @@ __FUNCTION__, amount ); } - DBG( 1, "%s: adr=0x%08x, nwords=%d.\n", __FUNCTION__, + DBG( 5, "%s: adr=0x%08x, nwords=%d.\n", __FUNCTION__, adr, amount/4 + (amount%4?1:0)); return flash_write_region( (u32 *)adr, (u32*)src, amount/4 + (amount%4?1:0)); @@ -897,6 +810,7 @@ /***************************************************************** * misc utility funcs */ +#if 0 static char tohex(char b) { b = b & 0xf; @@ -904,7 +818,6 @@ return 'a' + (b - 10); } -#if 0 static void dumpmem(char *ptr, int len) { char line[80], chars[80], *p, b, *c, *end; |
From: Stefan E. <se...@us...> - 2002-05-10 16:04:25
|
Update of /cvsroot/blob/blob/src/blob In directory usw-pr-cvs1:/tmp/cvs-serv22822 Modified Files: system3.c Log Message: - system update command. Reads images from CF card (stored in a tar file), and flashes them into blob partitions. Index: system3.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/system3.c,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- system3.c 10 May 2002 14:01:47 -0000 1.19 +++ system3.c 10 May 2002 16:04:23 -0000 1.20 @@ -58,6 +58,11 @@ * defines */ #define CONFIG_PCMCIA_SUPPORT +#define CONFIG_BLOB_PARTITION +#define CONFIG_GIO_RAM +#define CONFIG_GIO_FLASH +#define CONFIG_GIO_BLOB_PARTITION +#define CONFIG_CMD_SYSUPDATE /* this will send a cold shiver through erik's spine ... */ #define ERR( x ) { ret = x; goto DONE; } @@ -290,28 +295,17 @@ void init_ram_default_io( void ) { int ret; - static ram_io_t ram0, ram1; - static io_driver_t io_ram0, io_ram1; + static ram_io_t ram0; + static io_driver_t io_ram0; - /* define 2 pools to play with, each 8 Mb */ - ram0.start=0xd0000000; - ram0.len=8*1024*1024; + ram0.start=RAM_START; + ram0.len=RAM_SIZE; ram0.pos=0; - ram1.start=0xd0800000; - ram1.len=8*1024*1024; - ram1.pos=0; - ret = ram_io_init( &io_ram0, &ram0 ); if ( ret ) return; - ret = ram_io_init( &io_ram1, &ram1 ); - if ( ret ) return; - - ret = io_register( &io_ram0, "RAM0" ); - if ( ret ) return; - - ret = io_register( &io_ram1, "RAM1" ); + ret = io_register( &io_ram0, "RAM" ); if ( ret ) return; } __initlist(init_ram_default_io, INIT_LEVEL_OTHER_STUFF + 2); @@ -344,6 +338,22 @@ sys3_dbg = lvl; printf( "sys3dbg: debug level set to %d\n", sys3_dbg ); + if ( lvl>5 ) { + cf_dbg_set( 5 ); + tar_dbg_set( 5 ); + } else { + cf_dbg_set( 0 ); + tar_dbg_set( 0 ); + } + + if ( lvl>10 ) { + io_dbg_set( 5 ); + pcmcia_dbg_set( 5 ); + } else { + io_dbg_set( 0 ); + pcmcia_dbg_set( 0 ); + } + return 0; } static char sys3dbg_help[] = "sys3dbg level\n"; @@ -404,6 +414,7 @@ } +#if 0 /***************************************************************** * pcmcia_test - test PCMCIA, CF and IDE */ @@ -515,64 +526,98 @@ static char pcmciahelp[] = "pcmcia test\n"; __commandlist(pcmcia_test, "pcmciatest", pcmciahelp); #endif +#endif - -int tar_cmd( int argc, char *argv[] ) -{ - /* FIXME: rewrite using io drivers */ - return -EINVAL; -} -static char tar_help[] = "tar [t|x] src [filename dest]\n"; -__commandlist(tar_cmd, "tar", tar_help); - -#if 0 -extern int io_test(void); -int io_cmd( int argc, char *argv[] ) +#if defined(CONFIG_CMD_SYSUPDATE) +/********************************************************************** + * sysupd - update complete system. Flashes + * blob, config, kernel, initrd and cramfs images. + */ +static int sysupd_cmd( int argc, char *argv[] ) { int ret; - io_driver_t *iotar, *ioram1, *iocf, *iopart; - char buffer[1024]; - - io_dbg_set( 100 ); - tar_dbg_set( 100 ); - - ioram1 = io_get_byname( "RAM1" ); - if ( !ioram1 ) return -EINVAL; - printf( "found 'RAM1': %p\n", ioram1 ); + char *update_files[] = { "blob", "config.tar", "zImage", "initrd.gz", + "cramfs.img", NULL }; + char *image = NULL; + int i=0; + char *source = "CF"; - iopart = io_get_byname( "BLOB_PART" ); - if ( !iopart ) return -EINVAL; - printf( "found 'BLOB_PART': %p\n", iopart ); + if ( argc>1 ) + source = argv[1]; - iotar = io_get_byname( "TAR" ); - if ( !iotar ) return -EINVAL; - printf( "found 'TAR': %p\n", iotar ); + if ( strncmp( source, "CF", 2 ) == 0 ) { + /* CF card is on slot 1 */ + ret = io_configure( "CF", (void *)1 ); + if ( ret ) { + printf( "io_configure() error %d\n", ret ); + return -EINVAL; + } + } - iocf = io_get_byname( "CF" ); - if ( !iocf ) return -EINVAL; - printf( "found 'CF': %p\n", iocf ); + /* write chain: --->blob partition->flash */ + ret = io_chain_driver( "BLOB_PART", "FLASH" ); + if ( ret ) { + DBG( 1, "%s: io_chain_driver() = %d.", __FUNCTION__, ret ); + return ret; + } - /* CF card is on slot 1 */ - ret = io_configure( iocf, (void *)1 ); + /* read chain: <---TAR<--source(CF or RAM) */ + ret = io_chain_driver( "TAR", source ); if ( ret ) { - printf( "io_configure() error %d\n", ret ); - return -EINVAL; + DBG( 1, "%s: io_chain_driver( TAR, %s ) = %d.", __FUNCTION__, source, ret ); + return ret; } - { - /* just a test: read first two sectors ("virtual address" - 0x00000000-0x00001000) into a buffer */ - ret = io_read( buffer, (unsigned char *)0, 1024, iocf ); + while ( (image=update_files[i++]) != NULL ) { + /* select tar file */ + ret = io_configure( "TAR", image ); if ( ret ) { - printf( "io_read() error %d\n", ret ); - return -EINVAL; + printf( "sysupd: can't find image '%s'. Skipping.\n", image ); + continue; } - /* same as above, just use generic io to pool 1 */ - ret = io_copy( ioram1, iocf, 1024 ); + + /* select partition */ + ret = io_configure( "BLOB_PART", image ); if ( ret ) { - printf( "io_copy() error %d\n", ret ); - return -EINVAL; + printf( "sysupd: can't find flash partition '%s'. Skipping.\n", image ); + continue; } + +#if 1 + /* flash tha image, man! */ + ret = io_copy( "BLOB_PART", "TAR", 0 ); + if ( ret ) { + /* ouch! */ + printf( "sysupd: error updating image %s (%d).\n", image, ret ); + return ret; + } +#else + DBG( 1, "%s: io_copy( BLOB_PART, TAR, 0 )\n", __FUNCTION__ ); +#endif + + printf( "sysupd: flashed image '%s'\n", image ); + } + + return 0; +} +static char sysupd_help[] = "sysupd [CF|RAM]\n\nUpdate board firmware from CF card or RAM.\n" + "You have to have a update CF card inserted (for CF updates) _or_ uploaded a\n" + "update image to ram."; +__commandlist(sysupd_cmd, "sysupd", sysupd_help); +#endif + +int io_cmd( int argc, char *argv[] ) +{ + int ret; + + io_dbg_set( 1 ); + tar_dbg_set( 1 ); + + /* CF card is on slot 1 */ + ret = io_configure( "CF", (void *)1 ); + if ( ret ) { + printf( "io_configure() error %d\n", ret ); + return -EINVAL; } /* have tar io driver reading from CF card io driver */ @@ -584,17 +629,17 @@ if ( ret ) return -EINVAL; /* select a file */ - ret = io_configure( iotar, "system3.c" ); + ret = io_configure( "TAR", "blob" ); if ( ret ) return -EINVAL; printf( "selected file\n" ); /* select a partition */ - ret = io_configure( iopart, "config" ); + ret = io_configure( "BLOB_PART", "config" ); if ( ret ) return -EINVAL; printf( "selected partition\n" ); /* copy a file */ - ret = io_copy( iopart, iotar, io_get_size( iotar ) ); + ret = io_copy( "BLOB_PART", "TAR", 0 ); if ( ret ) return -EINVAL; printf( "flashed file\n" ); @@ -603,7 +648,6 @@ } static char io_help[] = "io test function\n"; __commandlist(io_cmd, "iotest", io_help); -#endif #if defined(CONFIG_GIO_BLOB_PARTITION) /********************************************************************** @@ -751,7 +795,7 @@ ret = io_register( &io_flash, "FLASH" ); if ( ret ) return; - ret = io_configure( &io_flash, 0 ); + ret = io_configure( "FLASH", 0 ); if ( ret ) return; return; @@ -860,6 +904,7 @@ return 'a' + (b - 10); } +#if 0 static void dumpmem(char *ptr, int len) { char line[80], chars[80], *p, b, *c, *end; @@ -886,6 +931,8 @@ serial_write('\n'); } } +#endif + /***************************************************************** * manually reference flash and download commands until they * are in libblob. @@ -894,6 +941,7 @@ extern char cf_help[]; __commandlist(cf_test_module, "cftest", cf_help); +#if 0 extern int fwrite_cmd(int argc, char *argv[]); extern char fwrite_help[]; __commandlist(fwrite_cmd, "fwrite", fwrite_help); @@ -901,6 +949,7 @@ extern int ferase_cmd(int argc, char *argv[]); extern char ferase_help[]; __commandlist(ferase_cmd, "ferase", ferase_help); +#endif extern int dlfile_cmd(int argc, char *argv[]); extern char dlfile_help[]; |
From: Stefan E. <se...@us...> - 2002-05-10 15:41:18
|
Update of /cvsroot/blob/blob/src/lib In directory usw-pr-cvs1:/tmp/cvs-serv13862 Modified Files: cf.c Log Message: - CF cards want LBA addressing mode. sigh. - names instead of pointers to io_driver_t - fixed some warnings Index: cf.c =================================================================== RCS file: /cvsroot/blob/blob/src/lib/cf.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- cf.c 8 May 2002 19:18:40 -0000 1.4 +++ cf.c 10 May 2002 15:41:16 -0000 1.5 @@ -46,7 +46,7 @@ #define CF_DEBUG 1 /* define this to activate module test cmd */ -#define CF_TEST_MODULE 1 +#define CF_TEST_MODULE 0 #if CF_DEBUG # define DBG( x, args... ) if ( cf_dbg>x ) printf( args ); @@ -98,6 +98,8 @@ u8 cfgvalue; u8 value; + DBG( 1, "%s: %s\n", __FUNCTION__, module_version ); + ret = pcmcia_init(); if ( ret != 0 ) return -EINVAL; @@ -180,12 +182,7 @@ if ( ret ) return -EINVAL; - ret = 0; -DONE: - if ( ret != 0 ) { - printf( "cf: error (%d).\n", ret ); - } - return ret; + return 0; } /********************************************************************** @@ -248,7 +245,7 @@ io->private_data = (void *)cf_slot; /* FIXME: is this ok? How to calculate the correct size? */ - io->io_size = (drive.driveid.vendor0 | (drive.driveid.vendor1 << 16)) * IDE_BLOCK_SIZE; + io->io_size = (drive.driveid.vendor1 | (drive.driveid.vendor0 << 16)) * IDE_BLOCK_SIZE; DBG( 1, "%s: io_size=%d\n", __FUNCTION__, io_get_size( io ) ); return 0; @@ -277,7 +274,8 @@ block = start_block; while ( amount > 0 ) { /* read block into buffer */ - ret = hd_read_mapped( &drive, block, buffer ); + //ret = hd_read_mapped( &drive, block, buffer ); + ret = hd_read_lba( &drive, block, buffer ); if ( ret != 0 ) return -EINVAL; @@ -348,7 +346,7 @@ return ret; } - ret = io_configure( &cf_def_io, (void *)1 ); + ret = io_configure( "CF", (void *)1 ); if ( ret ) { DBG( 1, "%s: cf_io_configure: %d\n", __FUNCTION__, ret ); return ret; |
From: Stefan E. <se...@us...> - 2002-05-10 15:36:26
|
Update of /cvsroot/blob/blob/src/lib In directory usw-pr-cvs1:/tmp/cvs-serv12796 Modified Files: generic_io.c Log Message: - names instead of pointers in ide_copy() and ide_configure() Index: generic_io.c =================================================================== RCS file: /cvsroot/blob/blob/src/lib/generic_io.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- generic_io.c 9 May 2002 11:42:23 -0000 1.4 +++ generic_io.c 10 May 2002 15:36:24 -0000 1.5 @@ -45,7 +45,7 @@ * Defines / Makros */ -#define IO_MODULE_TEST 1 +#define IO_MODULE_TEST 0 #define IO_DEBUG 1 #if IO_DEBUG @@ -132,11 +132,17 @@ return 0; } -int io_configure( io_driver_t *io, void *conf_data ) +int io_configure( char *io_name, void *conf_data ) { - DBG( 1, "%s: io=%p, conf_data=%p\n", __FUNCTION__, - io, conf_data ); + io_driver_t *io; + + DBG( 1, "%s: io_name=%p, conf_data=%p\n", __FUNCTION__, + io_name, conf_data ); + if ( !io_name ) + return -EINVAL; + + io = io_get_byname( io_name ); if ( !io ) return -EINVAL; @@ -155,13 +161,6 @@ if ( !name ) return NULL; -#if IO_DEBUG - for ( i=0; i<IO_MAX_DRIVER;i++) { - DBG( 1, "%s: #%d %p: '%s'\n", __FUNCTION__, - i, drivers[i], drivers[i]?io_get_name( drivers[i] ):"(NULL)" ); - } -#endif - for ( i=0; i<IO_MAX_DRIVER;i++) { if (drivers[i]) { if ( strncmp( io_get_name( drivers[i] ), name, IO_NAME_LEN ) == 0 ) @@ -201,16 +200,16 @@ int io_read( unsigned char *dest, unsigned char *src, size_t amount, io_driver_t *rd ) { - DBG( 1, "%s: dest=%p, src=%p, amount=%d, rd=%p\n", __FUNCTION__, + DBG( 1, "%s: dest=%p, src=%p, amount=%d, io_name=%p\n", __FUNCTION__, dest, src, amount, rd ); - DBGIO( 5, rd ); - if ( !rd || !rd->read ) return -EINVAL; + DBGIO( 5, rd ); + /* check bounds */ - if ( (io_get_size( rd ) - (size_t)src) < amount ) { + if ( (rd->io_size - (size_t)src) < amount ) { DBG( 1, "%s: out of bounds!\n", __FUNCTION__ ); return -ERANGE; } @@ -220,16 +219,17 @@ int io_write( unsigned char *dest, unsigned char *src, size_t amount, io_driver_t *rd ) { - DBG( 1, "%s: dest=%p, src=%p, amount=%d, rd=%p\n", __FUNCTION__, - dest, src, amount, rd ); - DBGIO( 5, rd ); + DBG( 1, "%s: dest=%p, src=%p, amount=%d, io_name=%p\n", __FUNCTION__, + dest, src, amount, rd ); - if ( !rd|| !rd->write ) + if ( !rd || !rd->write ) return -EINVAL; + DBGIO( 5, rd ); + /* check bounds */ - if ( (io_get_size( rd ) - (size_t)dest) < amount ) { + if ( (rd->io_size - (size_t)dest) < amount ) { DBG( 1, "%s: out of bounds!\n", __FUNCTION__ ); return -ERANGE; } @@ -237,21 +237,34 @@ return rd->write( dest, src, amount, rd ); } -int io_copy( io_driver_t *dest, io_driver_t *src, size_t amount ) +int io_copy( char *dest_name, char *src_name, size_t amount ) { static unsigned char buffer[512]; int ret = 0; int blocks, block, to_copy; unsigned char *adr = NULL; + io_driver_t *dest, *src; - DBG( 1, "%s: dest=%p, src=%p, amount=%d\n", __FUNCTION__, - dest, src, amount ); + DBG( 1, "%s: dest_name=%p, src_name=%p, amount=%d\n", __FUNCTION__, + dest_name, src_name, amount ); + + if ( !src_name || !dest_name ) + return -EINVAL; + + src = io_get_byname( src_name ); + if ( !src ) + return -EINVAL; + + dest = io_get_byname( dest_name ); + if ( !dest ) + return -EINVAL; DBGIO( 5, src ); DBGIO( 5, dest ); - if ( !dest || !src ) - return -EINVAL; + if ( amount == 0 ) { + amount = io_get_size( src ); + } blocks = amount / 512 + (amount%512?1:0); DBG( 1, "%s: %d blocks (%d bytes) to copy.\n", __FUNCTION__, @@ -263,7 +276,7 @@ } else { to_copy = amount; } - DBG( 1, "%s: block %d/%d (%d bytes)\n", __FUNCTION__, block, blocks, to_copy ); + DBG( 1, "%s: block %d/%d (%d bytes)\n", __FUNCTION__, block+1, blocks, to_copy ); /* read from source */ ret = io_read( buffer, adr, to_copy, src ); @@ -384,17 +397,10 @@ int io_test( void ) { int ret = 0; - io_driver_t *io0, *io1; DBG( 1, "%s: version %s\n", __FUNCTION__, module_version ); - io0 = io_get_byname( "RAM0" ); - if ( ret ) return -EINVAL; - - io1 = io_get_byname( "RAM1" ); - if ( ret ) return -EINVAL; - - ret = io_copy( io1, io0, 768 ); + ret = io_copy( "RAM1", "RAM0", 768 ); if ( ret ) return -EINVAL; return 0; |
From: Stefan E. <se...@us...> - 2002-05-10 15:35:39
|
Update of /cvsroot/blob/blob/include/blob In directory usw-pr-cvs1:/tmp/cvs-serv12377 Modified Files: generic_io.h Log Message: - use names instead of pointers in io_configure() and io_copy() Index: generic_io.h =================================================================== RCS file: /cvsroot/blob/blob/include/blob/generic_io.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- generic_io.h 2 May 2002 15:22:36 -0000 1.1 +++ generic_io.h 10 May 2002 15:35:37 -0000 1.2 @@ -169,10 +169,10 @@ /* io_configure - configures io driver * - * io: the io "driver" + * io_name: the io "driver" name * conf_data: the configuration data */ -int io_configure( io_driver_t *io, void *conf_data ); +int io_configure( char *io_name, void *conf_data ); /* io_get_byname - get a io by its name * @@ -196,25 +196,26 @@ int io_read( unsigned char *dest, unsigned char *src, size_t amount, io_driver_t *rd ); -/* io_write - write data using io rd +/* io_write - write data using io wr * * dest: destination address * src: source address * amount: amount to read */ int io_write( unsigned char *dest, unsigned char *src, - size_t amount, io_driver_t *rd ); + size_t amount, io_driver_t *wr ); /* io_copy - copy data * * Copy data from io driver "src" to io driver "dest". Copy - * "amount" bytes of data. + * "amount" bytes of data. If amount is 0, then copy all + * available data from "src". * - * dest: destination io driver - * src: source io driver + * dest: destination io driver name + * src: source io driver name * amount: amount to copy */ -int io_copy( io_driver_t *dest, io_driver_t *src, size_t amount ); +int io_copy( char *dest, char *src, size_t amount ); /* FIXME: static inline functions instead of macros */ #define io_get_name( io ) ((io)->name) @@ -231,7 +232,5 @@ } ram_io_t; int ram_io_init( io_driver_t *io, ram_io_t *ram ); -int ram_io_conf( io_driver_t *io, void *conf ); -#define BLOB_GENERIC_IO_H 1 #endif |
From: Stefan E. <se...@us...> - 2002-05-10 15:33:42
|
Update of /cvsroot/blob/blob/src/lib In directory usw-pr-cvs1:/tmp/cvs-serv11822 Modified Files: ide.c Log Message: - lba read Index: ide.c =================================================================== RCS file: /cvsroot/blob/blob/src/lib/ide.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- ide.c 8 May 2002 19:16:04 -0000 1.6 +++ ide.c 10 May 2002 15:33:39 -0000 1.7 @@ -345,6 +345,69 @@ } /********************************************************************** + * hd_read_lba + * - read using LBA mode + */ +int hd_read_lba( ide_drive_t *drive, u32 lba, char *buffer) +{ + int i, hd_drive; + 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; + + lba &= 0x0fffffff; + + hd_drive = 0; + + hd_cmd[1] = 0; + hd_cmd[2] = 1; /* # sectors */ + hd_cmd[3] = lba&0xff; + hd_cmd[4] = (lba>>8)&0xff; + hd_cmd[5] = (lba>>16)&0xff; + hd_cmd[6] = (lba>>24)&0xff; + hd_cmd[6] |= ((hd_drive&1) << 4) | 0xe0; + + hd_busy_wait(port); + + for (i = 1; i < 7; i++) { + port[i] = hd_cmd[i]; + barrier(); + } + + port[7] = HDC_READ; + barrier(); + + hd_busy_wait(port); + + for (i = 0; i < IDE_BLOCK_SIZE; i++) { + buffer[i] = port[0]; + barrier(); + } + + drive->last_status = status = port[7]; + + if (status & ERROR) { + printf("hd_read_lba: read status: %2x\n", status); + + printf("hd_read_lba: lba=%08x\n", lba&0x0fffffff ); + for (i = 1; i < 7; i++) { + printf("hd_cmd[%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> |
From: Stefan E. <se...@us...> - 2002-05-10 15:33:26
|
Update of /cvsroot/blob/blob/include/blob In directory usw-pr-cvs1:/tmp/cvs-serv11600 Modified Files: ide.h Log Message: - lba read Index: ide.h =================================================================== RCS file: /cvsroot/blob/blob/include/blob/ide.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- ide.h 8 May 2002 19:14:57 -0000 1.5 +++ ide.h 10 May 2002 15:33:23 -0000 1.6 @@ -192,6 +192,9 @@ /* read, mapping abs [0..max] sector # into head, sector, cylinder */ int hd_read_mapped( ide_drive_t *drive, int sector_num, char *buffer); +/* read in lba mode */ +int hd_read_lba( ide_drive_t *drive, u32 lba, char *buffer); + int hd_map_sector( ide_drive_t *drive, int sector, int *head, int *sec, int *cyl ); #endif |
From: Stefan E. <se...@us...> - 2002-05-10 14:01:51
|
Update of /cvsroot/blob/blob/src/blob In directory usw-pr-cvs1:/tmp/cvs-serv11461 Modified Files: system3.c Log Message: - conditionally compile parts Index: system3.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/system3.c,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- system3.c 9 May 2002 13:29:16 -0000 1.18 +++ system3.c 10 May 2002 14:01:47 -0000 1.19 @@ -126,6 +126,7 @@ }, }; +#if defined(CONFIG_BLOB_PARTITION) /* default partition table for SYSTEM3 System3 flash layout @@ -209,6 +210,7 @@ magic: BLOB_PART_LAST_MAGIC } }; +#endif /********************************************************************** * static functions @@ -252,16 +254,15 @@ 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); +#if defined(CONFIG_BLOB_PARTITION) /********************************************************************** * system3 default partition table */ @@ -280,7 +281,9 @@ __initlist(system3_set_partition_table, INIT_LEVEL_OTHER_STUFF); /* FIXME: need to think if this is the correct init level, we might * want to have this before the param list stuff starts running */ +#endif +#if defined(CONFIG_GIO_RAM) /********************************************************************** * init system3 ram pools */ @@ -312,7 +315,7 @@ if ( ret ) return; } __initlist(init_ram_default_io, INIT_LEVEL_OTHER_STUFF + 2); - +#endif /***************************************************************** * sysver - print system version @@ -522,6 +525,7 @@ static char tar_help[] = "tar [t|x] src [filename dest]\n"; __commandlist(tar_cmd, "tar", tar_help); +#if 0 extern int io_test(void); int io_cmd( int argc, char *argv[] ) { @@ -599,7 +603,9 @@ } static char io_help[] = "io test function\n"; __commandlist(io_cmd, "iotest", io_help); +#endif +#if defined(CONFIG_GIO_BLOB_PARTITION) /********************************************************************** * blob partition io driver * @@ -722,7 +728,9 @@ /* defer writing to our child */ return io_write((void *)((u32)dest + part->offset), src, amount, child); } +#endif +#if defined(CONFIG_GIO_FLASH) /********************************************************************** * flash io driver */ @@ -840,6 +848,7 @@ return flash_write_region( (u32 *)adr, (u32*)src, amount/4 + (amount%4?1:0)); } +#endif /***************************************************************** * misc utility funcs |
From: Stefan E. <se...@us...> - 2002-05-10 08:30:33
|
Update of /cvsroot/blob/blob/src/lib In directory usw-pr-cvs1:/tmp/cvs-serv5900 Modified Files: Makefile.am Log Message: - remove ide.c and pcmcia.c until integration with configure is done Index: Makefile.am =================================================================== RCS file: /cvsroot/blob/blob/src/lib/Makefile.am,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- Makefile.am 27 Apr 2002 04:59:59 -0000 1.20 +++ Makefile.am 10 May 2002 08:30:28 -0000 1.21 @@ -33,7 +33,6 @@ i2c.c \ i2c-gpio.c \ icache.c \ - ide.c \ init.c \ led.c \ md5.c \ @@ -41,7 +40,6 @@ memcpy.c \ memset.c \ mini_inflate.c \ - pcmcia.c \ printf.c \ reboot.c \ serial.c \ |
From: Stefan E. <se...@us...> - 2002-05-10 08:26:19
|
Update of /cvsroot/blob/blob/src/lib In directory usw-pr-cvs1:/tmp/cvs-serv4757 Modified Files: pcmcia.c Log Message: - removed dead code - cosmetic changes Index: pcmcia.c =================================================================== RCS file: /cvsroot/blob/blob/src/lib/pcmcia.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- pcmcia.c 30 Apr 2002 19:00:29 -0000 1.6 +++ pcmcia.c 10 May 2002 08:26:15 -0000 1.7 @@ -23,32 +23,6 @@ * * $Id$ * - * $Log$ - * Revision 1.6 2002/04/30 19:00:29 seletz - * - BUGFIX: MEMb() macro was using u16 instead of u8. - * - corrected the previous checked in fixes - * - * Revision 1.5 2002/04/29 18:13:36 choover - * fix -Wall warnings - * - * Revision 1.4 2002/04/27 04:59:59 timriker - * turn on ide and pcmcia again, fix pcmcia compiles (but not features) for non sa1111 systems - * - * Revision 1.3 2002/04/26 09:22:05 seletz - * - added original copyright from Brad Parker - * - corrected EMAIL addr - * - * Revision 1.2 2002/04/24 14:27:08 seletz - * - first round of bugfixing. Now at last one can read 512 byte sectors - * of a CF in true-ide mode. See system3.c::pcmciatest(). - * - * Still WIP. YMMV, and so on.... - * - * 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) - * */ /********************************************************************** @@ -76,21 +50,18 @@ */ #define WEAK_SYM __attribute__ (( weak )) -#define MEM(adr) (*((u32 *)(adr))) #define MEMb(adr) (*((u8 *)(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 ) +# define DBG( x, args... ) if ( pcmcia_dbg>x ) printf( args ); #else -# define _DBG( args... ) +# define DBG( x, args... ) #endif /********************************************************************** - * Typen + * types */ typedef struct { u16 status; @@ -105,7 +76,7 @@ } pcmcia_slot_t; /********************************************************************** - * Programmglobale Variable + * program globals */ pcmcia_slot_t pcmcia_slots[ PCMCIA_MAX_SLOTS ] = { @@ -126,30 +97,29 @@ /********************************************************************** - * Modulglobale Variable + * module globals */ #ident "$Id$" #ifdef PCMCIA_DEBUG -static int dbg = 1; +static int pcmcia_dbg = 1; #else -static int dbg = 0; +static int pcmcia_dbg = 0; #endif /********************************************************************** - * Prototypen + * prototypes */ static int pcmcia_print_fixed(volatile u8 *p); static int pcmcia_print_funcid(int func); /********************************************************************** - * Exportierte Funktionen + * exported functions */ void pcmcia_dbg_set( int level ) { - printf( "pcmcia: debug level set to %d\n", level ); - dbg = level; + pcmcia_dbg = level; } /* do whatever is needed to get pcmcia initialized */ @@ -190,7 +160,7 @@ pcmcia_slots[slot].status &= ~PCMCIA_SS_DETECT; } - _DBG( "%s: slot %d status: %x\n", __FUNCTION__, slot, pcmcia_slots[slot].status ); + DBG( 1, "%s: slot %d status: %x\n", __FUNCTION__, slot, pcmcia_slots[slot].status ); DONE: #else #warning "FIXME: non sa1111 systems not yet supported" @@ -219,7 +189,7 @@ pcmcia_slots[slot].status |= PCMCIA_SS_ENABLED; - _DBG( "%s: slot %d status: %x\n", __FUNCTION__, slot, pcmcia_slots[slot].status ); + DBG( 1, "%s: slot %d status: %x\n", __FUNCTION__, slot, pcmcia_slots[slot].status ); DONE: #else #warning "FIXME: non sa1111 systems not yet supported" @@ -248,7 +218,7 @@ pcmcia_slots[slot].status &= ~PCMCIA_SS_ENABLED; - _DBG( "%s: slot %d status: %x\n", __FUNCTION__, slot, pcmcia_slots[slot].status ); + DBG( 1, "%s: slot %d status: %x\n", __FUNCTION__, slot, pcmcia_slots[slot].status ); DONE: #else #warning "FIXME: non sa1111 systems not yet supported" @@ -280,7 +250,7 @@ break; } - _DBG( "%s: slot %d reset\n", __FUNCTION__, slot ); + DBG( 1, "%s: slot %d reset\n", __FUNCTION__, slot ); #else #warning "FIXME: non sa1111 systems not yet supported" #endif @@ -356,7 +326,7 @@ else break; } - printf("%s\n", id_str); + DBG( 1, "%s: id_str='%s'\n", __FUNCTION__, id_str); return (1); /* don't know */ } @@ -402,7 +372,7 @@ ident = pcmcia_slots[slot].ident; - if (dbg > 0) printf("PCMCIA MEM: %p\n", cfg_mem_addr); + DBG( 1, "%s: PCMCIA MEM: %p\n", __FUNCTION__, cfg_mem_addr); start = p = (volatile u8 *)cfg_mem_addr; @@ -415,9 +385,10 @@ } len = *p; p += 2; - if (dbg > 10) { +#if PCMCIA_DEBUG + if (pcmcia_dbg > 10) { volatile u8 *q = p; - printf ("\nTuple code %2x length %d\n\tData:", + printf("\nTuple code %2x length %d\n\tData:", code, len); for (i = 0; i < len; ++i) { @@ -425,15 +396,16 @@ q+= 2; } } +#endif switch (code) { case CISTPL_VERS_1: ident = p + 4; - _DBG( "%s: ident=%p\n", __FUNCTION__, ident ); + DBG( 1, "%s: ident=%p\n", __FUNCTION__, ident ); break; case CISTPL_FUNCID: func_id = *p; - _DBG( "%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) @@ -442,7 +414,7 @@ case CISTPL_CONFIG: config_base = (*(p+6) << 8) + (*(p+4)); pcmcia_slots[slot].config_base = config_base; - _DBG( "%s: config_base=0x%04x\n", __FUNCTION__, config_base ); + DBG( 1, "%s: config_base=0x%04x\n", __FUNCTION__, config_base ); default: break; } @@ -464,15 +436,6 @@ } } -#if 0 - /* hmmm, should this happen here? - * FIXME: provide extra function? - */ -#define COR_FUNC_ENA 0x01 - /* set configuration option register to enable card */ - *((u8 *)(cfg_mem_addr + config_base)) = COR_FUNC_ENA; -#endif - ret = 0; DONE: return ret; @@ -501,8 +464,8 @@ goto DONE; } - _DBG( "%s: base=%p\n", __FUNCTION__, (void *)pcmcia_slots[slot].base); - _DBG( "%s: attr_base=%p\n", __FUNCTION__, (void *)pcmcia_slots[slot].attr_base); + 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); if ( base ) *base = pcmcia_slots[slot].base; if ( attr ) *attr = pcmcia_slots[slot].attr_base; @@ -535,7 +498,7 @@ goto DONE; } - _DBG( "%s: cfg_base=0x%03x\n", __FUNCTION__, pcmcia_slots[slot].config_base); + DBG( 1, "%s: cfg_base=0x%03x\n", __FUNCTION__, pcmcia_slots[slot].config_base); if ( cfg_base ) *cfg_base = pcmcia_slots[slot].config_base; @@ -578,7 +541,7 @@ offset ); - _DBG( "%s: ATTR_REG(0x%02x) => 0x%02x\n", __FUNCTION__, + DBG( 1, "%s: ATTR_REG(0x%02x) => 0x%02x\n", __FUNCTION__, offset, *value ); ret = 0; @@ -609,7 +572,7 @@ goto DONE; } - _DBG( "%s: ATTR_REG(0x%02x) <= 0x%02x\n", __FUNCTION__, + DBG( 1, "%s: ATTR_REG(0x%02x) <= 0x%02x\n", __FUNCTION__, offset, value ); MEMb( pcmcia_slots[slot].attr_base + @@ -623,7 +586,7 @@ } /********************************************************************** - * Statische Funktionen + * static functions */ /* print function id strings */ |
From: Stefan E. <se...@us...> - 2002-05-09 13:29:19
|
Update of /cvsroot/blob/blob/src/blob In directory usw-pr-cvs1:/tmp/cvs-serv10359 Modified Files: system3.c Log Message: - flash io driver Now one can write using io drivers to blob flash partitions. Next step ist the system update function. See io_cmd(). Index: system3.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/system3.c,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- system3.c 8 May 2002 19:23:16 -0000 1.17 +++ system3.c 9 May 2002 13:29:16 -0000 1.18 @@ -107,7 +107,7 @@ */ #if SYSTEM3_DEBUG -static int sys3_dbg = 1; +static int sys3_dbg = 2; #else static int sys3_dbg = 0; #endif @@ -248,7 +248,7 @@ msleep( 1 ); - //sa1111_init(); + sa1111_init(); MEM(SYSTEM3_CTRL_1) = 0x04; @@ -396,7 +396,7 @@ int pcmcia_init() { printf( "PT Digital Board PCMCIA init\n" ); - sa1111_init(); + //sa1111_init(); return 0; } @@ -575,8 +575,8 @@ ret = io_chain_driver( "TAR", "CF" ); if ( ret ) return -EINVAL; - /* chain blob partition io driver to ram1 (simulate flash) */ - ret = io_chain_driver( "BLOB_PART", "RAM1" ); + /* chain blob partition io driver to flash */ + ret = io_chain_driver( "BLOB_PART", "FLASH" ); if ( ret ) return -EINVAL; /* select a file */ @@ -584,21 +584,8 @@ if ( ret ) return -EINVAL; printf( "selected file\n" ); - { - /* NOTE: partition.c code is buggy. The call below - * finds th "config" partition (which is next to the - * "blob" partition). I'm investigating ... - */ - const blob_partition_t *part; - part = pt_find_by_name( "blob" ); - DBG( 1, "%s: part=%p\n", __FUNCTION__, part ); - if ( part ) { - DBG( 1, "part->name=%s\n", part->name ); - } - } - /* select a partition */ - ret = io_configure( iopart, "blob" ); + ret = io_configure( iopart, "config" ); if ( ret ) return -EINVAL; printf( "selected partition\n" ); @@ -606,31 +593,8 @@ ret = io_copy( iopart, iotar, io_get_size( iotar ) ); if ( ret ) return -EINVAL; - printf( "copied file\n" ); - -/* - Future uses/extensions: - - raw flash access: - iofl = io_get_byname( "FLASH" ); - ret = io_configure( iofl, 0x00300000 ); // base offset to r/w - - filesystem access: - iocramfs = io_get_byname( "CRAMFS" ); or - ioext2 = io_get_byname( "EXT2FS" ); or - iofat = io_get_byname( "FAT32" ); - - Partitioning: - iopart = io_get_byname( "BLOBPART" ); - io_configure( iopart, "kernel" ); + printf( "flashed file\n" ); - Flash kernel coming from a cramfs file on CF: - io_chain_driver( "BLOB_PART", "FLASH" ); // write chain - io_chain_driver( "CRAMFS", "CF" ); // read chain - io_configure( iocramfs, "zImage" ); // select "zImage" file - io_configure( iopart, "kernel" ); // select "kernel" partition - io_copy( iopart, iocramfs, io_get_size( iocramfs ) ); - */ return 0; } static char io_help[] = "io test function\n"; @@ -757,6 +721,124 @@ /* defer writing to our child */ return io_write((void *)((u32)dest + part->offset), src, amount, child); +} + +/********************************************************************** + * flash io driver + */ +int flash_io_init( io_driver_t *io ); +static int flash_io_conf( io_driver_t * io, void *conf ); +static int flash_io_read( unsigned char *dest, unsigned char *src, size_t amount, io_driver_t *io ); +static int flash_io_write( unsigned char *dest, unsigned char *src, size_t amount, io_driver_t *io ); + +/* register flash io driver */ +void init_flash_default_io( void ) +{ + int ret; + static io_driver_t io_flash; + + ret = flash_io_init( &io_flash ); + if ( ret ) return ; + + ret = io_register( &io_flash, "FLASH" ); + if ( ret ) return; + + ret = io_configure( &io_flash, 0 ); + if ( ret ) return; + + return; +} +__initlist(init_flash_default_io, INIT_LEVEL_OTHER_STUFF + 3); + +/* initialize driver struct */ +int flash_io_init( io_driver_t *io ) +{ + if ( !io ) + return -EINVAL; + + io->private_data = NULL; + io->io_size = 0; + io->conf = flash_io_conf; + io->read = flash_io_read; + io->write = flash_io_write; + io->child_io = NULL; + + return 0; +} + +/* configure: select a base offset within the flash */ +static int flash_io_conf( io_driver_t * io, void *conf ) +{ + u32 offset; + + if ( !io ) + return -EINVAL; + + offset = (u32)conf; + + io->io_size = flash_get_size(); + + if ( offset > io->io_size ) + return -ERANGE; + + io->private_data=(void *)offset; + + return 0; +} + +static int flash_io_read( unsigned char *dest, unsigned char *src, size_t amount, io_driver_t *io ) +{ + u32 offset; + + DBG( 1, "%s: dest=%p, src=%p, amount=%d, io=%p\n", __FUNCTION__, + dest, src, amount, io ); + + if ( !io || !dest ) + return -EINVAL; + + + offset = (u32)io->private_data; + + DBG( 1, "%s: using offset %x.\n", __FUNCTION__, offset ); + + memcpy( dest, (unsigned char *)(offset + (u32)src), amount ); + + return 0; +} + +/* flash write: only on word boundaries! */ +static int flash_io_write( unsigned char *dest, unsigned char *src, size_t amount, io_driver_t *io ) +{ + u32 offset; + u32 adr; + + DBG( 1, "%s: dest=%p, src=%p, amount=%d, io=%p\n", __FUNCTION__, + dest, src, amount, io ); + + if ( !io || !src ) + return -EINVAL; + + + offset = (u32)io->private_data; + DBG( 1, "%s: using offset %x.\n", __FUNCTION__, offset ); + + adr = (u32)dest + offset; + + /* check alignment */ + if ( adr%4 ) { + printf( "%s: misaligned destination address (%x).\n", + __FUNCTION__, adr ); + return -EALIGN; + } + if ( amount%4 ) { + printf( "%s: warning: misaligned amount to write (%d).\n", + __FUNCTION__, amount ); + } + + DBG( 1, "%s: adr=0x%08x, nwords=%d.\n", __FUNCTION__, + adr, amount/4 + (amount%4?1:0)); + + return flash_write_region( (u32 *)adr, (u32*)src, amount/4 + (amount%4?1:0)); } /***************************************************************** |
From: Stefan E. <se...@us...> - 2002-05-09 13:27:29
|
Update of /cvsroot/blob/blob/include/blob In directory usw-pr-cvs1:/tmp/cvs-serv10221 Modified Files: flash.h Log Message: - flash_get_size() added Index: flash.h =================================================================== RCS file: /cvsroot/blob/blob/include/blob/flash.h,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- flash.h 2 May 2002 04:16:58 -0000 1.11 +++ flash.h 9 May 2002 13:27:26 -0000 1.12 @@ -97,5 +97,6 @@ int flash_get_first_block_address(u32 *addr); int flash_get_next_block_address(u32* addr, u32 current); int flash_get_block_size(u32 address); +u32 flash_get_size( void ); #endif |