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. <er...@us...> - 2001-12-27 18:27:40
|
Update of /cvsroot/blob/blob/include/blob/arch In directory usw-pr-cvs1:/tmp/cvs-serv30527/include/blob/arch Modified Files: Makefile.am system3.h Added Files: badge4.h jornada720.h Log Message: - Add HP Jornada 720 port (Chris Hoover) - Add HP Labs Badge4 port (Chris Hoover) - Slightly change the SA1110 memory setup or otherwise the HP machines won't work - Move SA1111 base address into machine specific include files --- NEW FILE: badge4.h --- /* * badge4.h: Badge4 specific defines * * Copyright (C) 2001 Hewlett-Packard Company * Written by Christopher Hoover <ch...@hp...> * * $Id: badge4.h,v 1.1 2001/12/27 18:27:37 erikm Exp $ * * 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: badge4.h,v 1.1 2001/12/27 18:27:37 erikm Exp $" #ifndef BLOB_ARCH_BADGE4_H #define BLOB_ARCH_BADGE4_H /* boot CPU speed */ #define CPU_SPEED (0x0a) /* serial port */ #define USE_SERIAL3 /* GPIO for the LED */ #define LED_GPIO (0x00000000) /* No LED */ /* the base address were BLOB is loaded by the first stage loader */ #define BLOB_ABS_BASE_ADDR (0xc0200400) /* where do various parts live in RAM */ #define BLOB_RAM_BASE (0xc0100000) #define KERNEL_RAM_BASE (0xC0008000) #define PARAM_RAM_BASE (0xc0110000) #define RAMDISK_RAM_BASE (0xC0400000) /* and where do they live in flash */ #define BLOB_FLASH_BASE (0x00000000) #define BLOB_FLASH_LEN (0x0000A000) #define PARAM_FLASH_BASE (BLOB_FLASH_BASE + BLOB_FLASH_LEN) #define PARAM_FLASH_LEN (0x00006000) #define KERNEL_FLASH_BASE (PARAM_FLASH_BASE + PARAM_FLASH_LEN) #define KERNEL_FLASH_LEN (1 * 1024 * 1024) #define RAMDISK_FLASH_BASE (KERNEL_FLASH_BASE + KERNEL_FLASH_LEN) #define RAMDISK_FLASH_LEN (4 * 1024 * 1024 - KERNEL_FLASH_LEN - PARAM_FLASH_LEN - BLOB_FLASH_LEN) #define PARAM_START PARAM_FLASH_BASE /* 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) /* Memory configuration */ #define BADGE4_MDCNFG \ (MDCNFG_BANK0_ENABLE|MDCNFG_DTIM0_SDRAM|MDCNFG_DWID0_32B|MDCNFG_DRAC0(3)|MDCNFG_TRP0(4)|MDCNFG_TDL0(3)|MDCNFG_TWR0(3)) /* was 0x0000f435 */ /* On CS0: Intel TE28F320C3BA100 Advanced+ Boot Block Flash (4MB) */ #define BADGE4_CS0 \ (MSC_RT_ROMFLASH|MSC_RBW16|MSC_RDF(31)|MSC_RDN(31)|MSC_RRR(7)) /* On CS1: 2 x Toshbia TC55V400 FT-85 (SRAM 256K x 16 bit) [1MB total] */ #define BADGE4_CS1 \ (MSC_RT_SRAM_012|MSC_RBW32|MSC_RDF(31)|MSC_RDN(31)|MSC_RRR(7)) /* On CS2: 2 x Toshbia TC55V400 FT-85 (SRAM 256K x 16 bit) [1MB total] */ #define BADGE4_CS2 \ (MSC_RT_SRAM_012|MSC_RBW32|MSC_RDF(31)|MSC_RDN(31)|MSC_RRR(7)) /* On CS3: Nothing */ #define BADGE4_CS3 0 /* On CS4: Nothing */ #define BADGE4_CS4 0 /* On CS5: SA-1111 */ #define BADGE4_CS5 \ (MSC_RT_VARLAT_345|MSC_RBW16|MSC_RDF(31)|MSC_RDN(31)|MSC_RRR(7)) #define BADGE4_MSC0 (BADGE4_CS0 | (BADGE4_CS1<<16)) /* was: 0xfff9fffc */ #define BADGE4_MSC1 (BADGE4_CS2 | (BADGE4_CS3<<16)) /* was: 0x0000fff9 */ #define BADGE4_MSC2 (BADGE4_CS4 | (BADGE4_CS5<<16)) /* was: 0xfff90000 */ #ifdef BLOB_NEED_MEMCONFIG # define MDCNFG_VALUE BADGE4_MDCNFG /* 0x0 MDCNFG */ # define MDCAS00_VALUE 0xAAAAAAA7 /* 0x04 MDCAS00 */ # define MDCAS01_VALUE 0xAAAAAAAA /* 0x08 MDCAS01 */ # define MDCAS02_VALUE 0xAAAAAAAA /* 0x0c MDCAS02 */ # define MSC0_VALUE BADGE4_MSC0 /* 0x10 MSC0 */ # define MSC1_VALUE BADGE4_MSC1 /* 0x14 MSC1 */ # define MECR_VALUE 0x994a994a /* 0x18 MECR */ # define MDREFR_VALUE DO_NOT_USE_THIS_VALUE__GETS_AUTOMAGICALLY_COMPUTED # define MDCAS20_VALUE 0xAAAAAA7F /* 0x20 MDCAS20 */ # define MDCAS21_VALUE 0xAAAAAAAA /* 0x24 MDCAS21 */ # define MDCAS22_VALUE 0xAAAAAAAA /* 0x28 MDCAS22 */ # define MSC2_VALUE BADGE4_MSC2 /* 0x2C MSC2 */ # define SMCNFG_VALUE 0x00000000 /* 0x30 SMCNFG */ #endif #endif --- NEW FILE: jornada720.h --- /* * jornada720.h: Jornada720 specific defines * * Copyright (C) 2001 Hewlett-Packard Company * Written by Christopher Hoover <ch...@hp...> * * $Id: jornada720.h,v 1.1 2001/12/27 18:27:37 erikm Exp $ * * 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: jornada720.h,v 1.1 2001/12/27 18:27:37 erikm Exp $" #ifndef BLOB_ARCH_JORNADA720_H #define BLOB_ARCH_JORNADA720_H /* boot CPU speed */ #define CPU_SPEED (0x09) /* serial port */ #define USE_SERIAL3 /* GPIO for the LED */ #define LED_GPIO (0x00000000) /* No LED */ /* the base address were BLOB is loaded by the first stage loader */ #define BLOB_ABS_BASE_ADDR (0xc0200400) /* where do various parts live in RAM */ #define BLOB_RAM_BASE (0xc0100000) #define KERNEL_RAM_BASE (0xC0008000) #define PARAM_RAM_BASE (0xc0110000) #define RAMDISK_RAM_BASE (0xC0400000) /* and where do they live in flash */ #define BLOB_FLASH_BASE (0x00000000) #define BLOB_FLASH_LEN (128 * 1024) #define PARAM_FLASH_BASE (BLOB_FLASH_BASE + BLOB_FLASH_LEN) #define PARAM_FLASH_LEN (128 * 1024) #define KERNEL_FLASH_BASE (PARAM_FLASH_BASE + PARAM_FLASH_LEN) #define KERNEL_FLASH_LEN (1 * 1024 * 1024) #define RAMDISK_FLASH_BASE (KERNEL_FLASH_BASE + KERNEL_FLASH_LEN) #define RAMDISK_FLASH_LEN (2 * 1024 * 1024) #define PARAM_START PARAM_RAM_BASE /* 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) /* Memory configuration */ #define JORNADA720_MDCNFG \ (MDCNFG_BANK0_ENABLE|MDCNFG_DTIM0_SDRAM|MDCNFG_DWID0_32B|MDCNFG_DRAC0(5)|MDCNFG_TRP0(2)|MDCNFG_TDL0(3)|MDCNFG_TWR0(1)) /* was 0x00007255 */ /* On CS0: 2 x Intel 28F128J3A StratFlash (8M x 16bit) [32MB total] (was: 0x4f78) */ #define JORNADA720_CS0 \ (MSC_RT_ROMFLASH|MSC_RBW32|MSC_RDF(15)|MSC_RDN(15)|MSC_RRR(2)) /* On CS1 (was: 0xfff0) */ #define JORNADA720_CS1 \ (MSC_RT_ROMFLASH|MSC_RBW32|MSC_RDF(30)|MSC_RDN(31)|MSC_RRR(7)) /* On CS2 (was 0xfff0) */ #define JORNADA720_CS2 \ (MSC_RT_ROMFLASH|MSC_RBW32|MSC_RDF(30)|MSC_RDN(31)|MSC_RRR(7)) /* On CS3: (was 0xfff8) */ #define JORNADA720_CS3 \ (MSC_RT_ROMFLASH|MSC_RBW32|MSC_RDF(31)|MSC_RDN(31)|MSC_RRR(7)) /* On CS4: (was 0x2959) */ #define JORNADA720_CS4 \ (MSC_RT_VARLAT_345|MSC_RBW32|MSC_RDF(11)|MSC_RDN(9)|MSC_RRR(1)) /* On CS5: (was0x201d) */ #define JORNADA720_CS5 \ (MSC_RT_VARLAT_345|MSC_RBW16|MSC_RDF(3)|MSC_RDN(0)|MSC_RRR(1)) #define JORNADA720_MSC0 \ (JORNADA720_CS0 | (JORNADA720_CS1<<16)) /* was: 0xfff04f78 */ #define JORNADA720_MSC1 \ (JORNADA720_CS2 | (JORNADA720_CS3<<16)) /* was: 0xfff8fff0 */ #define JORNADA720_MSC2 \ (JORNADA720_CS4 | (JORNADA720_CS5<<16)) /* was: 0x201d2959 */ #ifdef BLOB_NEED_MEMCONFIG # define MDCNFG_VALUE JORNADA720_MDCNFG /* 0x0 MDCNFG */ # define MDCAS00_VALUE 0x5555557f /* 0x04 MDCAS00 */ # define MDCAS01_VALUE 0x55555555 /* 0x08 MDCAS01 */ # define MDCAS02_VALUE 0x55555555 /* 0x0c MDCAS02 */ # define MSC0_VALUE JORNADA720_MSC0 /* 0x10 MSC0 */ # define MSC1_VALUE JORNADA720_MSC1 /* 0x14 MSC1 */ # define MECR_VALUE 0x98c698c6 /* 0x18 MECR */ # define MDREFR_VALUE DO_NOT_USE_THIS_VALUE__GETS_AUTOMAGICALLY_COMPUTED # define MDCAS20_VALUE 0xd1284142 /* 0x20 MDCAS20 */ # define MDCAS21_VALUE 0x72249529 /* 0x24 MDCAS21 */ # define MDCAS22_VALUE 0x78414351 /* 0x28 MDCAS22 */ # define MSC2_VALUE JORNADA720_MSC2 /* 0x2C MSC2 */ # define SMCNFG_VALUE 0x00000000 /* 0x30 SMCNFG */ #endif #endif Index: Makefile.am =================================================================== RCS file: /cvsroot/blob/blob/include/blob/arch/Makefile.am,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Makefile.am 2001/12/16 04:34:03 1.4 +++ Makefile.am 2001/12/27 18:27:37 1.5 @@ -12,10 +12,12 @@ noinst_HEADERS = \ assabet.h \ + badge4.h \ brutus.h \ clart.h \ h3600.h \ idr.h \ + jornada720.h \ lart.h \ nesa.h \ pleb.h \ Index: system3.h =================================================================== RCS file: /cvsroot/blob/blob/include/blob/arch/system3.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- system3.h 2001/11/05 09:19:24 1.6 +++ system3.h 2001/12/27 18:27:37 1.7 @@ -89,6 +89,7 @@ #ifndef CPU_SPEED_133 // 206 Mhz +# define MDCNFG_VALUE 0x72547254 # define MDCAS00_VALUE 0xAAAAAA9F # define MDCAS01_VALUE 0xAAAAAAAA # define MDCAS02_VALUE 0xAAAAAAAA @@ -102,6 +103,7 @@ # define SMCNFG_VALUE 0 #else // 133 Mhz +# define MDCNFG_VALUE 0x72547254 # define MDCAS00_VALUE 0xAAAAAA9F # define MDCAS01_VALUE 0xAAAAAAAA # define MDCAS02_VALUE 0xAAAAAAAA @@ -127,5 +129,6 @@ # define _DBGU32( x ) #endif +# define SA1111_BASE (0x40000000) #endif |
From: Erik M. <er...@us...> - 2001-12-27 18:27:40
|
Update of /cvsroot/blob/blob/src/blob In directory usw-pr-cvs1:/tmp/cvs-serv30527/src/blob Modified Files: Makefile.am main.c memsetup-sa1110.S Added Files: badge4.c jornada720.c Log Message: - Add HP Jornada 720 port (Chris Hoover) - Add HP Labs Badge4 port (Chris Hoover) - Slightly change the SA1110 memory setup or otherwise the HP machines won't work - Move SA1111 base address into machine specific include files --- NEW FILE: badge4.c --- /* * badge4.c: Badge 4 specific stuff * * Copyright (C) 2001 Hewlett-Packard Company * Written by Christopher Hoover <ch...@hp...> * * 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: badge4.c,v 1.1 2001/12/27 18:27:37 erikm Exp $" #ifdef HAVE_CONFIG_H # include <blob/config.h> #endif #include <blob/flash.h> #include <blob/init.h> #include <blob/sa1100.h> /* flash descriptor for Badge4 flash */ /* 1 x Intel 28F320C3BA100 Advanced+ Boot Block Flash (32 Mbit) */ /* http://developer.intel.com/design/flcomp/datashts/29064512.pdf */ static flash_descriptor_t badge4_flash_descriptors[] = { { /* Eight 4 KW Parameter Bottom Blocks (64K bytes) */ size: 2 * 4 * 1024, num: 8, lockable: 1 }, { /* Sixty three 32 KW Main Blocks (4032K bytes) */ size: 2 * 32 * 1024, num: 63, lockable: 1 }, { /* NULL block */ }, }; static void init_flash_driver(void) { flash_descriptors = badge4_flash_descriptors; flash_driver = &intel16_flash_driver; } __initlist(init_flash_driver, INIT_LEVEL_OTHER_STUFF); static void init_hardware(void) { // GPIO 19 and 20 specify SDRAM "type". // These settings are for 12 row bits, 9 col bits. // ### Incorporate SPD code here. GPDR |= (GPIO_GPIO19 | GPIO_GPIO20); GPSR = GPIO_GPIO19; GPCR = GPIO_GPIO20; } __initlist(init_hardware, INIT_LEVEL_INITIAL_HARDWARE); --- NEW FILE: jornada720.c --- /* * jornada720.c: Jornada 720 with flash board specific stuff * * Copyright (C) 2001 Hewlett-Packard Company * Written by Christopher Hoover <ch...@hp...> * * 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: jornada720.c,v 1.1 2001/12/27 18:27:37 erikm Exp $" #ifdef HAVE_CONFIG_H # include <blob/config.h> #endif #include <blob/flash.h> #include <blob/init.h> #include <blob/sa1100.h> /* flash descriptor for Jornada720 flash */ /* 2 x Intel 28F128J3A StrataFlash (16 MB) [32MB total] */ /* http://developer.intel.com/design/flcomp/datashts/29066709.pdf */ static flash_descriptor_t jornada720_flash_descriptors[] = { { /* One hundred twenty eight 128KB blocks */ size: 2 * 128 * 1024, num: 128, lockable: 1 }, { /* NULL block */ }, }; static int jornada720_enable_vpp(void) { PPSR |= GPIO_GPIO7; PPDR |= GPIO_GPIO7; return 0; } static int jornada720_disable_vpp(void) { PPSR &= ~GPIO_GPIO7; return 0; } static void init_flash_driver(void) { flash_descriptors = jornada720_flash_descriptors; flash_driver = &intel32_flash_driver; flash_driver->enable_vpp = jornada720_enable_vpp; flash_driver->disable_vpp = jornada720_disable_vpp; } __initlist(init_flash_driver, INIT_LEVEL_OTHER_STUFF); static void init_hardware(void) { PPSR &= ~(GPIO_GPIO10 | GPIO_GPIO7); PPDR |= (GPIO_GPIO10 | GPIO_GPIO7); msleep(10 * 1000); /* Take the MCU out of reset mode */ PPSR |= GPIO_GPIO10; } __initlist(init_hardware, INIT_LEVEL_INITIAL_HARDWARE); Index: Makefile.am =================================================================== RCS file: /cvsroot/blob/blob/src/blob/Makefile.am,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- Makefile.am 2001/12/19 22:53:45 1.12 +++ Makefile.am 2001/12/27 18:27:37 1.13 @@ -144,9 +144,11 @@ nullflash.c \ assabet.c \ brutus.c \ + badge4.c \ clart.c \ h3600.c \ idr.c \ + jornada720.c \ lart.c \ nesa.c \ pleb.c \ Index: main.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/main.c,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- main.c 2001/12/20 20:52:40 1.18 +++ main.c 2001/12/27 18:27:37 1.19 @@ -95,7 +95,7 @@ /* call SerialInit() because the default 9k6 speed might not be what the user requested */ -#if defined(H3600) || defined(SHANNON) || defined(IDR) +#if defined(H3600) || defined(SHANNON) || defined(IDR) || defined(BADGE4) || defined(JORNADA720) blob_status.terminalSpeed = baud115k2; /* DEBUG */ #endif SerialInit(blob_status.terminalSpeed); Index: memsetup-sa1110.S =================================================================== RCS file: /cvsroot/blob/blob/src/blob/memsetup-sa1110.S,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- memsetup-sa1110.S 2001/11/04 23:16:26 1.7 +++ memsetup-sa1110.S 2001/12/27 18:27:37 1.8 @@ -54,7 +54,7 @@ MEM_START: .long MEMORY_START MEMORY_CONFIG: - .long 0x72547254 /* 0x0 MDCNFG */ + .long MDCNFG_VALUE /* 0x0 MDCNFG */ .long MDCAS00_VALUE /* 0x04 MDCAS00 */ .long MDCAS01_VALUE /* 0x08 MDCAS01 */ .long MDCAS02_VALUE /* 0x0c MDCAS02 */ |
From: Erik M. <er...@us...> - 2001-12-27 18:27:40
|
Update of /cvsroot/blob/blob In directory usw-pr-cvs1:/tmp/cvs-serv30527 Modified Files: AUTHORS ChangeLog acconfig.h configure.in Log Message: - Add HP Jornada 720 port (Chris Hoover) - Add HP Labs Badge4 port (Chris Hoover) - Slightly change the SA1110 memory setup or otherwise the HP machines won't work - Move SA1111 base address into machine specific include files Index: AUTHORS =================================================================== RCS file: /cvsroot/blob/blob/AUTHORS,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- AUTHORS 2001/09/27 21:42:31 1.3 +++ AUTHORS 2001/12/27 18:27:37 1.4 @@ -57,3 +57,23 @@ * Memory tester =============== - Stefan Eletzhofer <ste...@ww...> + + +* Ipaq H3600 port +================= +- Erik Mouw <J.A...@it...> + + +* Vercel UD-1 port +================== +- Tim Riker <Ti...@Ri...>, <Ti...@De...>, <Ti...@Li...> + + +* Jornada 720 port +================== +- Christopher Hoover <ch...@hp...> + + +* Badge4 +======== +- Christopher Hoover <ch...@hp...> Index: ChangeLog =================================================================== RCS file: /cvsroot/blob/blob/ChangeLog,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- ChangeLog 2001/12/16 16:35:52 1.12 +++ ChangeLog 2001/12/27 18:27:37 1.13 @@ -4,6 +4,8 @@ $Id$ blob-2.0.5-pre2: +- HP Labs Badge4 support Christopher Hoover +- HP Jornada 720 support Christopher Hoover - Vercel UD-1 (IDR) support Tim Riker - New dump command Tim Riker - Fix compile time bug with newer linux kernels Stefan Eletzhofer Index: acconfig.h =================================================================== RCS file: /cvsroot/blob/blob/acconfig.h,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- acconfig.h 2001/12/16 04:34:02 1.9 +++ acconfig.h 2001/12/27 18:27:37 1.10 @@ -62,6 +62,9 @@ /* Define if Neponset board attached to Assabet */ #undef NEPONSET +/* Define for Badge 4 */ +#undef BADGE4 + /* Define for Brutus boards */ #undef BRUTUS @@ -73,6 +76,9 @@ /* Define for Vercel UD-1 (IDR) */ #undef IDR + +/* Define for Jornada 720 */ +#undef JORNADA720 /* Define for LART boards */ #undef LART Index: configure.in =================================================================== RCS file: /cvsroot/blob/blob/configure.in,v retrieving revision 1.30 retrieving revision 1.31 diff -u -d -r1.30 -r1.31 --- configure.in 2001/12/17 00:06:50 1.30 +++ configure.in 2001/12/27 18:27:37 1.31 @@ -76,10 +76,12 @@ Valid names are: assabet Intel Assabet neponset Intel Assabet with Neponset board + badge4 HPL Badge 4 brutus Intel Brutus creditlart CreditLART h3600 Compaq Ipaq H36x0 idr Vercel UD-1 + jornada720 HP Jornada 720 with Flash board lart LART nesa NESA pleb PLEB @@ -187,6 +189,23 @@ DIAG_PLATFORM_OBJ="system3.o" use_cpu="sa1110" use_lcd="yes" + ;; + jornada720) + board_name="Hewlett-Packard Jornada 720 with flash daughter board" + AC_DEFINE(JORNADA720) + BLOB_PLATFORM_OBJ="jornada720.o" + AC_MSG_WARN([Warning: untested platform!]) + BLOB_FLASH_OBJS="intel32.o" + use_cpu="sa1110" + use_lcd="no" + ;; + badge4) + board_name="Hewlett-Packard Laboratories Badge-4" + AC_DEFINE(BADGE4) + BLOB_PLATFORM_OBJ="badge4.o" + BLOB_FLASH_OBJS="intel16.o" + use_cpu="sa1110" + use_lcd="no" ;; *) AC_MSG_RESULT(unknown) |
From: Erik M. <er...@us...> - 2001-12-26 23:38:39
|
Update of /cvsroot/blob/blob/src/blob In directory usw-pr-cvs1:/tmp/cvs-serv14606/src/blob Modified Files: bootldrpart.c Log Message: Construct a bootldr partition block from blob partition information. Index: bootldrpart.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/bootldrpart.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- bootldrpart.c 2001/12/19 22:53:45 1.1 +++ bootldrpart.c 2001/12/26 23:38:36 1.2 @@ -39,13 +39,15 @@ -#define FLASH_PARTITION_NAMELEN 32 +#define BOOTLDR_PARTITION_NAMELEN 32 enum LFR_FLAGS { LFR_SIZE_PREFIX = 1, /* prefix data with 4-byte size */ LFR_PATCH_BOOTLDR = 2, /* patch bootloader's 0th instruction */ LFR_KERNEL = 4, /* add BOOTIMG_MAGIC, imgsize and VKERNEL_BASE to head of programmed region (see bootldr.c) */ + /* LFR_KERNEL is actually never used + * so it's safe to ignore -- Erik */ LFR_EXPAND = 8 /* expand partition size to fit rest of flash */ }; @@ -54,7 +56,7 @@ typedef struct { - char name[FLASH_PARTITION_NAMELEN]; + char name[BOOTLDR_PARTITION_NAMELEN]; unsigned long base; unsigned long size; enum LFR_FLAGS flags; @@ -67,7 +69,11 @@ int magic; /* should be filled with 0x646c7470 (btlp) BOOTLDR_PARTITION_MAGIC */ int npartitions; - FlashRegion partition[0]; + + /* the kernel code uses FlashRegion partition[0] over here, + * but because we want to allocate a partition table we'll + * have to use a certain maximum amount of partitions. */ + FlashRegion partition[PART_MAX_PARTITIONS]; } BootldrFlashPartitionTable; @@ -93,6 +99,12 @@ +/* used for construct_bootldr_partition_table() */ +static BootldrFlashPartitionTable bootldr_ptable; + + + + static BootldrFlashPartitionTable *find_bootldr_partition_table(void) { BootldrFlashPartitionTable *table; @@ -112,8 +124,6 @@ -#define MIN(a, b) ((a) < (b) ? (a) : (b)) - /* returns number of partitions, or negative error number otherwise */ int read_bootldr_partition_table(partition_table_t *ptable) { @@ -139,7 +149,7 @@ strlcpy(ptable->partition[i].name, bootldr->partition[i].name, - MIN(PARTITION_NAMELEN, FLASH_PARTITION_NAMELEN)); + PART_PARTITION_NAMELEN); /* the caller should figure out the real size */ if(bootldr->partition[i].flags & LFR_EXPAND) @@ -147,7 +157,7 @@ /* NOTE: this is a hack -- Erik */ if(strncmp(ptable->partition[i].name, "kernel", - PARTITION_NAMELEN) == 0) { + PART_PARTITION_NAMELEN) == 0) { ptable->partition[i].mem_base = KERNEL_RAM_BASE; ptable->partition[i].entry_point = KERNEL_RAM_BASE; ptable->partition[i].flags |= PART_LOAD; @@ -155,11 +165,41 @@ /* NOTE: and this is a hack as well -- Erik */ if(strncmp(ptable->partition[i].name, "ramdisk", - PARTITION_NAMELEN) == 0) { + PART_PARTITION_NAMELEN) == 0) { ptable->partition[i].mem_base = RAMDISK_RAM_BASE; ptable->partition[i].flags |= PART_LOAD; } } return ptable->numpartitions; +} + + + + +int construct_bootldr_partition_table(const partition_table_t *src, + void** dst, int *len) +{ + int i; + + bootldr_ptable.magic = BOOTLDR_PARTITION_MAGIC; + bootldr_ptable.npartitions = src->numpartitions; + + for(i = 0; i < src->numpartitions; i++) { + bootldr_ptable.partition[i].flags = 0; + + strlcpy(bootldr_ptable.partition[i].name, + src->partition[i].name, BOOTLDR_PARTITION_NAMELEN); + bootldr_ptable.partition[i].base = src->partition[i].offset; + bootldr_ptable.partition[i].size = src->partition[i].size; + + if(src->partition[i].flags & PART_EXPAND) + bootldr_ptable.partition[i].flags |= LFR_EXPAND; + } + + *dst = &bootldr_ptable; + + *len = sizeof(bootldr_ptable); + + return 0; } |
From: Erik M. <er...@us...> - 2001-12-26 23:38:39
|
Update of /cvsroot/blob/blob/include/blob In directory usw-pr-cvs1:/tmp/cvs-serv14606/include/blob Modified Files: partition.h Log Message: Construct a bootldr partition block from blob partition information. Index: partition.h =================================================================== RCS file: /cvsroot/blob/blob/include/blob/partition.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- partition.h 2001/12/19 22:53:45 1.1 +++ partition.h 2001/12/26 23:38:36 1.2 @@ -29,7 +29,7 @@ #include <blob/types.h> -#define PARTITION_NAMELEN (32) +#define PART_PARTITION_NAMELEN (32) typedef struct { u32 offset; /* offset wrt start of flash */ @@ -37,7 +37,7 @@ u32 mem_base; /* load address in RAM */ u32 entry_point; /* entry point in RAM */ u32 flags; - char name[PARTITION_NAMELEN]; + char name[PART_PARTITION_NAMELEN]; } partition_t; #define PART_VALID (1<<0) |
From: Erik M. <er...@us...> - 2001-12-20 20:52:43
|
Update of /cvsroot/blob/blob/src/blob In directory usw-pr-cvs1:/tmp/cvs-serv24002/src/blob Modified Files: main.c Log Message: fix for bogus params size in status command (Christopher Hoover) Index: main.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/main.c,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- main.c 2001/12/19 19:29:24 1.17 +++ main.c 2001/12/20 20:52:40 1.18 @@ -261,7 +261,12 @@ SerialOutputDec(*numRead); SerialOutputString(" (0x"); SerialOutputHex(*numRead); - SerialOutputString(") bytes.\n"); + SerialOutputString(") bytes"); +#ifdef BLOB_DEBUG + SerialOutputString(" at 0x"); + SerialOutputHex((u32) startAddress); +#endif + SerialOutputString(".\n"); SerialInit(blob_status.terminalSpeed); @@ -448,7 +453,7 @@ SerialOutputString("downloaded at "); SerialOutputHex(PARAM_RAM_BASE); SerialOutputString(", "); - SerialOutputDec(blob_status.blobSize); + SerialOutputDec(blob_status.paramSize); SerialOutputString(" bytes\n"); } #else |
From: Erik M. <er...@us...> - 2001-12-19 22:53:48
|
Update of /cvsroot/blob/blob/src/blob In directory usw-pr-cvs1:/tmp/cvs-serv15523/src/blob Modified Files: Makefile.am Added Files: partition.c bootldrpart.c Log Message: This is the initial flash partitioning support. It's not even near finished, but I already commit it as an RFC. Right now it is only able to parse bootldr partition tables, but I want a blob partition table format as well. Just look at the "mem_base" and "entry_point" and you'll understand why. --- NEW FILE: partition.c --- /* * partition.c: flash partitioning * * Copyright (C) 2001 Erik Mouw <J.A...@it...> * * $Id: partition.c,v 1.1 2001/12/19 22:53:45 erikm Exp $ * * 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: partition.c,v 1.1 2001/12/19 22:53:45 erikm Exp $" #ifdef HAVE_CONFIG_H # include <blob/config.h> #endif #include <blob/flash.h> #include <blob/partition.h> #include <blob/serial.h> #include <blob/error.h> static partition_table_t flash_partition_table; /* FIXME: this is for the time being */ extern int read_bootldr_partition_table(partition_table_t *ptable); static int read_partition_table(void) { int rv; int i; /* so far we only know about bootldr flash partitions */ rv = read_bootldr_partition_table(&flash_partition_table); if(rv < 0) { printerror(rv, "can't get partition table\n"); return rv; } SerialOutputString("Flash partition layout:\n"); for(i = 0; i < flash_partition_table.numpartitions; i++) { SerialOutputString(" 0x"); SerialOutputHex(flash_partition_table.partition[i].size); SerialOutputString(" @ 0x"); SerialOutputHex(flash_partition_table.partition[i].offset); if(flash_partition_table.partition[i].flags & PART_LOAD) { SerialOutputString(", load at 0x"); SerialOutputHex(flash_partition_table.partition[i].mem_base); SerialOutputString(", entry point at 0x"); SerialOutputHex(flash_partition_table.partition[i].entry_point); } SerialOutputByte('\n'); } return 0; } --- NEW FILE: bootldrpart.c --- /* * flashpart.c: bootldr compatible flash paritioning * * Copyright (C) 2001 Erik Mouw <J.A...@it...> * * $Id: bootldrpart.c,v 1.1 2001/12/19 22:53:45 erikm Exp $ * * 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 * */ /* * The bootldr partition information comes from the linux kernel * sources, file drivers/mtd/bootldr.c. */ #ident "$Id: bootldrpart.c,v 1.1 2001/12/19 22:53:45 erikm Exp $" #ifdef HAVE_CONFIG_H # include <blob/config.h> #endif #include <blob/arch.h> #include <blob/types.h> #include <blob/partition.h> #include <blob/errno.h> #include <blob/util.h> #define FLASH_PARTITION_NAMELEN 32 enum LFR_FLAGS { LFR_SIZE_PREFIX = 1, /* prefix data with 4-byte size */ LFR_PATCH_BOOTLDR = 2, /* patch bootloader's 0th instruction */ LFR_KERNEL = 4, /* add BOOTIMG_MAGIC, imgsize and VKERNEL_BASE to head of programmed region (see bootldr.c) */ LFR_EXPAND = 8 /* expand partition size to fit rest of flash */ }; typedef struct { char name[FLASH_PARTITION_NAMELEN]; unsigned long base; unsigned long size; enum LFR_FLAGS flags; } FlashRegion; typedef struct { int magic; /* should be filled with 0x646c7470 (btlp) BOOTLDR_PARTITION_MAGIC */ int npartitions; FlashRegion partition[0]; } BootldrFlashPartitionTable; #define BOOTLDR_MAGIC 0x646c7462 /* btld: marks a valid bootldr image */ #define BOOTLDR_PARTITION_MAGIC 0x646c7470 /* btlp: marks a valid bootldr partition table in params sector */ #define BOOTLDR_MAGIC_OFFSET 0x20 /* offset 0x20 into the bootldr */ #define BOOTCAP_OFFSET 0X30 /* offset 0x30 into the bootldr */ #define BOOTCAP_WAKEUP (1<<0) #define BOOTCAP_PARTITIONS (1<<1) /* partition table stored in params sector */ #define BOOTCAP_PARAMS_AFTER_BOOTLDR (1<<2)/* params sector right after bootldr sector(s), else in last sector */ static BootldrFlashPartitionTable *find_bootldr_partition_table(void) { BootldrFlashPartitionTable *table; /* we currently assume that the partition table lives in the * PARAMETER flash block, so we only check if there really is * a partition table. later on we can really search for it. */ table = (BootldrFlashPartitionTable *)PARAM_FLASH_BASE; if(table->magic == BOOTLDR_PARTITION_MAGIC) return table; else return NULL; } #define MIN(a, b) ((a) < (b) ? (a) : (b)) /* returns number of partitions, or negative error number otherwise */ int read_bootldr_partition_table(partition_table_t *ptable) { BootldrFlashPartitionTable *bootldr; int i; /* get partition table */ bootldr = find_bootldr_partition_table(); /* is it real? */ if(bootldr == NULL) return -EMAGIC; ptable->numpartitions = bootldr->npartitions; for(i = 0; i < bootldr->npartitions; i++) { ptable->partition[i].flags = PART_VALID; ptable->partition[i].offset = bootldr->partition[i].base; ptable->partition[i].size = bootldr->partition[i].size; ptable->partition[i].mem_base = 0; ptable->partition[i].entry_point = 0; strlcpy(ptable->partition[i].name, bootldr->partition[i].name, MIN(PARTITION_NAMELEN, FLASH_PARTITION_NAMELEN)); /* the caller should figure out the real size */ if(bootldr->partition[i].flags & LFR_EXPAND) ptable->partition[i].flags |= PART_EXPAND; /* NOTE: this is a hack -- Erik */ if(strncmp(ptable->partition[i].name, "kernel", PARTITION_NAMELEN) == 0) { ptable->partition[i].mem_base = KERNEL_RAM_BASE; ptable->partition[i].entry_point = KERNEL_RAM_BASE; ptable->partition[i].flags |= PART_LOAD; } /* NOTE: and this is a hack as well -- Erik */ if(strncmp(ptable->partition[i].name, "ramdisk", PARTITION_NAMELEN) == 0) { ptable->partition[i].mem_base = RAMDISK_RAM_BASE; ptable->partition[i].flags |= PART_LOAD; } } return ptable->numpartitions; } Index: Makefile.am =================================================================== RCS file: /cvsroot/blob/blob/src/blob/Makefile.am,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- Makefile.am 2001/12/16 04:34:03 1.11 +++ Makefile.am 2001/12/19 22:53:45 1.12 @@ -120,6 +120,7 @@ flashasm.S \ stack.S \ testmem2.S \ + bootldrpart.c \ commands.c \ flash.c \ initcalls.c \ @@ -127,6 +128,7 @@ main.c \ memory.c \ param_block.c \ + partition.c \ reboot.c \ uucodec.c |
From: Erik M. <er...@us...> - 2001-12-19 22:53:48
|
Update of /cvsroot/blob/blob/include/blob In directory usw-pr-cvs1:/tmp/cvs-serv15523/include/blob Modified Files: Makefile.am Added Files: partition.h Log Message: This is the initial flash partitioning support. It's not even near finished, but I already commit it as an RFC. Right now it is only able to parse bootldr partition tables, but I want a blob partition table format as well. Just look at the "mem_base" and "entry_point" and you'll understand why. --- NEW FILE: partition.h --- /* * partition.h: flash paritioning * * Copyright (C) 2001 Erik Mouw (J.A...@it...) * * $Id: partition.h,v 1.1 2001/12/19 22:53:45 erikm Exp $ * * 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: partition.h,v 1.1 2001/12/19 22:53:45 erikm Exp $" #ifndef BLOB_PARTITION_H #define BLOB_PARTITION_H #include <blob/types.h> #define PARTITION_NAMELEN (32) typedef struct { u32 offset; /* offset wrt start of flash */ u32 size; /* partition size */ u32 mem_base; /* load address in RAM */ u32 entry_point; /* entry point in RAM */ u32 flags; char name[PARTITION_NAMELEN]; } partition_t; #define PART_VALID (1<<0) #define PART_LOAD (1<<1) #define PART_EXPAND (1<<2) #define PART_MAGIC (0x50727420) /* "Prt " */ #define PART_MAX_PARTITIONS (16) /* 16 partitions ought to be enough */ typedef struct { int magic; int numpartitions; partition_t partition[PART_MAX_PARTITIONS]; } partition_table_t; #endif Index: Makefile.am =================================================================== RCS file: /cvsroot/blob/blob/include/blob/Makefile.am,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- Makefile.am 2001/10/14 20:24:32 1.10 +++ Makefile.am 2001/12/19 22:53:45 1.11 @@ -30,6 +30,7 @@ memory.h \ memsetup.h \ param_block.h \ + partition.h \ reboot.h \ sa1100.h \ sa1111.h \ |
From: Erik M. <er...@us...> - 2001-12-19 20:00:20
|
Update of /cvsroot/blob/blob/src/diag In directory usw-pr-cvs1:/tmp/cvs-serv30998/src/diag Modified Files: commands.c command_hist.c Log Message: Remove strcpy() in favour of strncpy(). Again, this forces you to think before you copy a string. The changes in the files are trivial again. Index: commands.c =================================================================== RCS file: /cvsroot/blob/blob/src/diag/commands.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- commands.c 2001/10/07 23:32:05 1.3 +++ commands.c 2001/12/19 20:00:15 1.4 @@ -104,7 +104,7 @@ /* display it */ SerialOutputString(cmd); i = numRead = strlen( cmd ); - strcpy( command, cmd ); + strncpy( command, cmd, MAX_COMMANDLINE_LENGTH ); } else if ( c == CMDHIST_KEY_DN ) { char *cmd = NULL; /* get cmd from history */ @@ -119,7 +119,7 @@ /* display it */ SerialOutputString(cmd); i = numRead = strlen( cmd ); - strcpy( command, cmd ); + strncpy( command, cmd, MAX_COMMANDLINE_LENGTH ); } else { command[i++] = c; numRead++; Index: command_hist.c =================================================================== RCS file: /cvsroot/blob/blob/src/diag/command_hist.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- command_hist.c 2001/10/07 23:32:05 1.1 +++ command_hist.c 2001/12/19 20:00:15 1.2 @@ -89,7 +89,7 @@ if ( strlen( cmd ) == 0 ) return 0; - strcpy( cmdhistory[ cmdhist_write ], cmd ); + strlcpy( cmdhistory[ cmdhist_write ], cmd, MAX_COMMANDLINE_LENGTH ); cmdhist_write ++; cmdhist_write = cmdhist_write % MAX_HIST; |
From: Erik M. <er...@us...> - 2001-12-19 20:00:19
|
Update of /cvsroot/blob/blob/src/blob In directory usw-pr-cvs1:/tmp/cvs-serv30998/src/blob Modified Files: linux.c param_block.c Log Message: Remove strcpy() in favour of strncpy(). Again, this forces you to think before you copy a string. The changes in the files are trivial again. Index: linux.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/linux.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- linux.c 2001/11/13 13:27:18 1.6 +++ linux.c 2001/12/19 20:00:15 1.7 @@ -128,20 +128,27 @@ /* copy default commandline from parameter block */ if(blob_status.cmdline[0] != '\0') - strcpy(params->u.cmdline.cmdline, blob_status.cmdline); + strlcpy(params->u.cmdline.cmdline, blob_status.cmdline, + COMMAND_LINE_SIZE); /* copy commandline */ if(argc >= 2) { p = params->u.cmdline.cmdline; for(i = 1; i < argc; i++) { - strcpy(p, argv[i]); - p += strlen(argv[i]); + strlcpy(p, argv[i], COMMAND_LINE_SIZE); + p += strlen(p); *p++ = ' '; } p--; *p = '\0'; + + /* technically spoken we should limit the length of + * the kernel command line to COMMAND_LINE_SIZE + * characters, but the kernel won't copy longer + * strings anyway, so we don't care over here. + */ } if(strlen(params->u.cmdline.cmdline) > 0) { Index: param_block.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/param_block.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- param_block.c 2001/10/31 16:44:18 1.3 +++ param_block.c 2001/12/19 20:00:15 1.4 @@ -77,7 +77,8 @@ static int parse_ptag_cmdline(const struct ptag *ptag) { - strcpy(blob_status.cmdline, ptag->u.cmdline.cmdline); + strlcpy(blob_status.cmdline, ptag->u.cmdline.cmdline, + COMMAND_LINE_SIZE); return 0; } |
From: Erik M. <er...@us...> - 2001-12-19 20:00:18
|
Update of /cvsroot/blob/blob/include/blob In directory usw-pr-cvs1:/tmp/cvs-serv30998/include/blob Modified Files: util.h Log Message: Remove strcpy() in favour of strncpy(). Again, this forces you to think before you copy a string. The changes in the files are trivial again. Index: util.h =================================================================== RCS file: /cvsroot/blob/blob/include/blob/util.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- util.h 2001/12/19 19:03:45 1.5 +++ util.h 2001/12/19 20:00:15 1.6 @@ -44,7 +44,11 @@ int strncmp(const char *s1, const char *s2, int maxlen); int strlen(const char *s); -char *strcpy(char *dest, const char *src); + +char *strncpy(char *dest, const char *src, int n); + +/* same as strncpy(), but also null terminates the string */ +char *strlcpy(char *dest, const char *src, int n); /* convert a string to an u32 value */ int strtou32(const char *str, u32 *value); |
From: Erik M. <er...@us...> - 2001-12-19 20:00:18
|
Update of /cvsroot/blob/blob/src/lib In directory usw-pr-cvs1:/tmp/cvs-serv30998/src/lib Modified Files: Makefile.am Added Files: strncpy.c Removed Files: strcpy.c Log Message: Remove strcpy() in favour of strncpy(). Again, this forces you to think before you copy a string. The changes in the files are trivial again. --- NEW FILE: strncpy.c --- /* * strncpy.c: copy string * * Copyright (C) 2001 Erik Mouw (J.A...@it...) * * $Id: strncpy.c,v 1.1 2001/12/19 20:00:14 erikm Exp $ * * 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: strncpy.c,v 1.1 2001/12/19 20:00:14 erikm Exp $" #ifdef HAVE_CONFIG_H # include <blob/config.h> #endif #include <blob/util.h> char *strncpy(char *dest, const char *src, int n) { while(n > 0) { n--; if((*dest++ = *src++) == '\0') break; } return dest; } /* small variation on strncpy(): null-terminate the destination * string */ char *strlcpy(char *dest, const char *src, int n) { strncpy(dest, src, n); if(n > 0) dest[n-1] = '\0'; return dest; } Index: Makefile.am =================================================================== RCS file: /cvsroot/blob/blob/src/lib/Makefile.am,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- Makefile.am 2001/10/07 22:58:56 1.5 +++ Makefile.am 2001/12/19 20:00:15 1.6 @@ -33,7 +33,7 @@ led.c \ reboot.c \ serial.c \ - strcpy.c \ + strncpy.c \ strlen.c \ strncmp.c \ strtou32.c \ --- strcpy.c DELETED --- |
From: Erik M. <er...@us...> - 2001-12-19 19:29:27
|
Update of /cvsroot/blob/blob/src/blob In directory usw-pr-cvs1:/tmp/cvs-serv22077 Modified Files: main.c Log Message: technically spoken, strncmp() should also compare the null character (right, Russ? :) Index: main.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/main.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- main.c 2001/12/19 19:03:45 1.16 +++ main.c 2001/12/19 19:29:24 1.17 @@ -192,27 +192,27 @@ if(argc < 2) return -ENOPARAMS; - if(strncmp(argv[1], "blob", 4) == 0) { + if(strncmp(argv[1], "blob", 5) == 0) { /* download blob */ startAddress = BLOB_RAM_BASE; bufLen = BLOB_FLASH_LEN; numRead = &blob_status.blobSize; blob_status.blobType = fromDownload; #ifdef PARAM_START - } else if(strncmp(argv[1], "param", 5) == 0) { + } else if(strncmp(argv[1], "param", 6) == 0) { /* download param */ startAddress = PARAM_RAM_BASE; bufLen = PARAM_FLASH_LEN; numRead = &blob_status.paramSize; blob_status.paramType = fromDownload; #endif - } else if(strncmp(argv[1], "kernel", 6) == 0) { + } else if(strncmp(argv[1], "kernel", 7) == 0) { /* download kernel */ startAddress = KERNEL_RAM_BASE; bufLen = KERNEL_FLASH_LEN; numRead = &blob_status.kernelSize; blob_status.kernelType = fromDownload; - } else if(strncmp(argv[1], "ramdisk", 7) == 0) { + } else if(strncmp(argv[1], "ramdisk", 8) == 0) { /* download ramdisk */ startAddress = RAMDISK_RAM_BASE; bufLen = RAMDISK_FLASH_LEN; @@ -290,27 +290,27 @@ if(argc < 2) return -ENOPARAMS; - if(strncmp(argv[1], "blob", 4) == 0) { + if(strncmp(argv[1], "blob", 5) == 0) { src = (u32 *)BLOB_RAM_BASE; dst = (u32 *)BLOB_FLASH_BASE; maxSize = BLOB_FLASH_LEN; numBytes = blob_status.blobSize; type = blob_status.blobType; #ifdef PARAM_START - } else if(strncmp(argv[1], "param", 5) == 0) { + } else if(strncmp(argv[1], "param", 6) == 0) { src = (u32 *)PARAM_RAM_BASE; dst = (u32 *)PARAM_FLASH_BASE; maxSize = PARAM_FLASH_LEN; numBytes = blob_status.paramSize; type = blob_status.paramType; #endif - } else if(strncmp(argv[1], "kernel", 6) == 0) { + } else if(strncmp(argv[1], "kernel", 7) == 0) { src = (u32 *)KERNEL_RAM_BASE; dst = (u32 *)KERNEL_FLASH_BASE; numBytes = blob_status.kernelSize; maxSize = KERNEL_FLASH_LEN; type = blob_status.kernelType; - } else if(strncmp(argv[1], "ramdisk", 7) == 0) { + } else if(strncmp(argv[1], "ramdisk", 8) == 0) { src = (u32 *)RAMDISK_RAM_BASE; dst = (u32 *)RAMDISK_FLASH_BASE; numBytes = blob_status.ramdiskSize; @@ -364,33 +364,33 @@ if(argc < 2) return -ENOPARAMS; - if(strncmp(argv[1], "1200", 4) == 0) { + if(strncmp(argv[1], "1200", 5) == 0) { blob_status.downloadSpeed = baud1k2; - } else if(strncmp(argv[1], "1k2", 3) == 0) { + } else if(strncmp(argv[1], "1k2", 4) == 0) { blob_status.downloadSpeed = baud1k2; - } else if(strncmp(argv[1], "9600", 4) == 0) { + } else if(strncmp(argv[1], "9600", 5) == 0) { blob_status.downloadSpeed = baud9k6; - } else if(strncmp(argv[1], "9k6", 3) == 0) { + } else if(strncmp(argv[1], "9k6", 4) == 0) { blob_status.downloadSpeed = baud9k6; - } else if(strncmp(argv[1], "19200", 5) == 0) { + } else if(strncmp(argv[1], "19200", 6) == 0) { blob_status.downloadSpeed = baud19k2; - } else if(strncmp(argv[1], "19k2", 4) == 0) { + } else if(strncmp(argv[1], "19k2", 5) == 0) { blob_status.downloadSpeed = baud19k2; - } else if(strncmp(argv[1], "38400", 5) == 0) { + } else if(strncmp(argv[1], "38400", 7) == 0) { blob_status.downloadSpeed = baud38k4; - } else if(strncmp(argv[1], "38k4",4 ) == 0) { + } else if(strncmp(argv[1], "38k4", 5) == 0) { blob_status.downloadSpeed = baud38k4; - } else if(strncmp(argv[1], "57600", 5) == 0) { + } else if(strncmp(argv[1], "57600", 6) == 0) { blob_status.downloadSpeed = baud57k6; - } else if(strncmp(argv[1], "57k6", 4) == 0) { + } else if(strncmp(argv[1], "57k6", 5) == 0) { blob_status.downloadSpeed = baud57k6; - } else if(strncmp(argv[1], "115200", 6) == 0) { + } else if(strncmp(argv[1], "115200", 7) == 0) { blob_status.downloadSpeed = baud115k2; - } else if(strncmp(argv[1], "115k2", 5) == 0) { + } else if(strncmp(argv[1], "115k2", 6) == 0) { blob_status.downloadSpeed = baud115k2; - } else if(strncmp(argv[1], "230400", 6) == 0) { + } else if(strncmp(argv[1], "230400", 7) == 0) { blob_status.downloadSpeed = baud230k4; - } else if(strncmp(argv[1], "230k4", 5) == 0) { + } else if(strncmp(argv[1], "230k4", 6) == 0) { blob_status.downloadSpeed = baud230k4; } else { return -EINVAL; @@ -498,7 +498,7 @@ u32 *src = 0; int numWords; - if(strncmp(what, "blob", 4) == 0) { + if(strncmp(what, "blob", 5) == 0) { dst = (u32 *)BLOB_RAM_BASE; src = (u32 *)BLOB_FLASH_BASE; numWords = BLOB_FLASH_LEN / 4; @@ -506,7 +506,7 @@ blob_status.blobType = fromFlash; SerialOutputString("Loading blob from flash "); #ifdef PARAM_START - } else if(strncmp(what, "param", 5) == 0) { + } else if(strncmp(what, "param", 6) == 0) { dst = (u32 *)PARAM_RAM_BASE; src = (u32 *)PARAM_FLASH_BASE; numWords = PARAM_FLASH_LEN / 4; @@ -514,14 +514,14 @@ blob_status.paramType = fromFlash; SerialOutputString("Loading paramater block from flash "); #endif - } else if(strncmp(what, "kernel", 6) == 0) { + } else if(strncmp(what, "kernel", 7) == 0) { dst = (u32 *)KERNEL_RAM_BASE; src = (u32 *)KERNEL_FLASH_BASE; numWords = KERNEL_FLASH_LEN / 4; blob_status.kernelSize = 0; blob_status.kernelType = fromFlash; SerialOutputString("Loading kernel from flash "); - } else if(strncmp(what, "ramdisk", 7) == 0) { + } else if(strncmp(what, "ramdisk", 8) == 0) { dst = (u32 *)RAMDISK_RAM_BASE; src = (u32 *)RAMDISK_FLASH_BASE; numWords = RAMDISK_FLASH_LEN / 4; |
From: Erik M. <J.A...@it...> - 2001-12-19 19:07:46
|
On Wed, Dec 19, 2001 at 11:03:47AM -0800, Erik Mouw wrote: > Update of /cvsroot/blob/blob/include/blob > In directory usw-pr-cvs1:/tmp/cvs-serv14312/include/blob > > Modified Files: > util.h > Log Message: > Remove strncmp(). Ehm, make that "strcmp()" :) 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. <er...@us...> - 2001-12-19 19:03:48
|
Update of /cvsroot/blob/blob/src/lib In directory usw-pr-cvs1:/tmp/cvs-serv14312/src/lib Modified Files: command.c Log Message: Remove strncmp(). This will force you to think before you compare two strings, but I consider that a Good Thing [tm]. All other changes are trivial. Index: command.c =================================================================== RCS file: /cvsroot/blob/blob/src/lib/command.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- command.c 2001/10/31 16:42:03 1.7 +++ command.c 2001/12/19 19:03:45 1.8 @@ -229,7 +229,8 @@ /* help on a command? */ if(argc >= 2) { for(cmd = commands; cmd != NULL; cmd = cmd->next) { - if(strcmp(cmd->name, argv[1]) == 0) { + if(strncmp(cmd->name, argv[1], + MAX_COMMANDLINE_LENGTH) == 0) { SerialOutputString("Help for '"); SerialOutputString(argv[1]); SerialOutputString("':\n\nUsage: "); |
From: Erik M. <er...@us...> - 2001-12-19 19:03:47
|
Update of /cvsroot/blob/blob/src/blob In directory usw-pr-cvs1:/tmp/cvs-serv14312/src/blob Modified Files: main.c Log Message: Remove strncmp(). This will force you to think before you compare two strings, but I consider that a Good Thing [tm]. All other changes are trivial. Index: main.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/main.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- main.c 2001/12/16 18:12:33 1.15 +++ main.c 2001/12/19 19:03:45 1.16 @@ -364,33 +364,33 @@ if(argc < 2) return -ENOPARAMS; - if(strcmp(argv[1], "1200") == 0) { + if(strncmp(argv[1], "1200", 4) == 0) { blob_status.downloadSpeed = baud1k2; - } else if(strcmp(argv[1], "1k2") == 0) { + } else if(strncmp(argv[1], "1k2", 3) == 0) { blob_status.downloadSpeed = baud1k2; - } else if(strcmp(argv[1], "9600") == 0) { + } else if(strncmp(argv[1], "9600", 4) == 0) { blob_status.downloadSpeed = baud9k6; - } else if(strcmp(argv[1], "9k6") == 0) { + } else if(strncmp(argv[1], "9k6", 3) == 0) { blob_status.downloadSpeed = baud9k6; - } else if(strcmp(argv[1], "19200") == 0) { + } else if(strncmp(argv[1], "19200", 5) == 0) { blob_status.downloadSpeed = baud19k2; - } else if(strcmp(argv[1], "19k2") == 0) { + } else if(strncmp(argv[1], "19k2", 4) == 0) { blob_status.downloadSpeed = baud19k2; - } else if(strcmp(argv[1], "38400") == 0) { + } else if(strncmp(argv[1], "38400", 5) == 0) { blob_status.downloadSpeed = baud38k4; - } else if(strcmp(argv[1], "38k4") == 0) { + } else if(strncmp(argv[1], "38k4",4 ) == 0) { blob_status.downloadSpeed = baud38k4; - } else if(strcmp(argv[1], "57600") == 0) { + } else if(strncmp(argv[1], "57600", 5) == 0) { blob_status.downloadSpeed = baud57k6; - } else if(strcmp(argv[1], "57k6") == 0) { + } else if(strncmp(argv[1], "57k6", 4) == 0) { blob_status.downloadSpeed = baud57k6; - } else if(strcmp(argv[1], "115200") == 0) { + } else if(strncmp(argv[1], "115200", 6) == 0) { blob_status.downloadSpeed = baud115k2; - } else if(strcmp(argv[1], "115k2") == 0) { + } else if(strncmp(argv[1], "115k2", 5) == 0) { blob_status.downloadSpeed = baud115k2; - } else if(strcmp(argv[1], "230400") == 0) { + } else if(strncmp(argv[1], "230400", 6) == 0) { blob_status.downloadSpeed = baud230k4; - } else if(strcmp(argv[1], "230k4") == 0) { + } else if(strncmp(argv[1], "230k4", 5) == 0) { blob_status.downloadSpeed = baud230k4; } else { return -EINVAL; @@ -498,7 +498,7 @@ u32 *src = 0; int numWords; - if(strcmp(what, "blob") == 0) { + if(strncmp(what, "blob", 4) == 0) { dst = (u32 *)BLOB_RAM_BASE; src = (u32 *)BLOB_FLASH_BASE; numWords = BLOB_FLASH_LEN / 4; @@ -506,7 +506,7 @@ blob_status.blobType = fromFlash; SerialOutputString("Loading blob from flash "); #ifdef PARAM_START - } else if(strcmp(what, "param") == 0) { + } else if(strncmp(what, "param", 5) == 0) { dst = (u32 *)PARAM_RAM_BASE; src = (u32 *)PARAM_FLASH_BASE; numWords = PARAM_FLASH_LEN / 4; @@ -514,14 +514,14 @@ blob_status.paramType = fromFlash; SerialOutputString("Loading paramater block from flash "); #endif - } else if(strcmp(what, "kernel") == 0) { + } else if(strncmp(what, "kernel", 6) == 0) { dst = (u32 *)KERNEL_RAM_BASE; src = (u32 *)KERNEL_FLASH_BASE; numWords = KERNEL_FLASH_LEN / 4; blob_status.kernelSize = 0; blob_status.kernelType = fromFlash; SerialOutputString("Loading kernel from flash "); - } else if(strcmp(what, "ramdisk") == 0) { + } else if(strncmp(what, "ramdisk", 7) == 0) { dst = (u32 *)RAMDISK_RAM_BASE; src = (u32 *)RAMDISK_FLASH_BASE; numWords = RAMDISK_FLASH_LEN / 4; |
From: Erik M. <er...@us...> - 2001-12-19 19:03:47
|
Update of /cvsroot/blob/blob/include/blob In directory usw-pr-cvs1:/tmp/cvs-serv14312/include/blob Modified Files: util.h Log Message: Remove strncmp(). This will force you to think before you compare two strings, but I consider that a Good Thing [tm]. All other changes are trivial. Index: util.h =================================================================== RCS file: /cvsroot/blob/blob/include/blob/util.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- util.h 2001/10/15 21:47:47 1.4 +++ util.h 2001/12/19 19:03:45 1.5 @@ -43,13 +43,6 @@ int strncmp(const char *s1, const char *s2, int maxlen); -static inline int strcmp(const char *s1, const char *s2) -{ - /* 1024 should be long enough for strings in blob */ - return strncmp(s1, s2, 1024); -} - - int strlen(const char *s); char *strcpy(char *dest, const char *src); |
From: Erik M. <er...@us...> - 2001-12-17 00:07:39
|
Update of /cvsroot/blob/blob/doc In directory usw-pr-cvs1:/tmp/cvs-serv18358 Modified Files: Makefile.am Added Files: commandlist.txt Log Message: Document the command list. --- NEW FILE: commandlist.txt --- (emacs users can use -*- outline -*- mode for this file) The blob commandlist or How to add new commands to blob Copyright (C) 2001 Erik Mouw <J.A...@it...> $Id: commandlist.txt,v 1.1 2001/12/17 00:07:37 erikm Exp $ * Introduction ============== All interactive programs have to deal with the problem of parsing the command line and calling the correct function to execute the command. Most programs use a simple if-then-else ladder for command parsing, which works well for a small and/or fixed number of commands. When the number of commands becomes either large or isn't fixed the if-then-else ladder solution becomes either too long, or becomes cluttered up with ugly #ifdef/#endif statements to selectively compile the wanted commands. Another problem is that the actual implementation of the command is not in the same compilation unit as the command line parser, leaving room for discrepancies between the caller and the actual command. To overcome those difficulties, a modular command parser was introduced in blob-2.0.5. This file documents that command parser. Note that although this document talks about "blob", the same command parser is also used in the "diag" diagnostics utility. * Advantages ============ The modular command parser has the following advantages: - Modular (doh!) - Supports command abbreviation - Simple to use - Easy to extend the number of commands without changing the command parser itself - Integrated help functionality * How it works ============== ** The commandlist ------------------ The key concept in the command parser is the "commandlist", which is defined in src/lib/command.c as commandlist_t *commands. Early in the initialisation of blob this pointer is initialised with the contents of a special ELF section and transformed into a linked list of commands. The actual parser uses this linked list to compare the command on the command line with each of the individual commandlist entries. ** Creating command list entries -------------------------------- Command list entries are created with the __commandlist() macro as defined in include/blob/command.h: #define __commandlist(fn, nm, hlp) \ static commandlist_t __command_##fn __command = { \ magic: COMMAND_MAGIC, \ name: nm, \ help: hlp, \ callback: fn } In other words: it fills out a commandlist_t entry with the callback function, ASCII name, and help text. The __command attribute is again a macro: #define __command __attribute__((unused, __section__(".commandlist"))) This tells the compiler to put the commandlist_t entry in the .commandlist ELF section instead of the default .data section. The "unused" part tells the compiler not to discard the entry although it is unused in this compilation unit (remember the entry is declared as static to avoid name space clashes with other compilation units). ** Fun with linker magic ------------------------ Without a proper linker script the linker would happily discard all ELF sections it doesn't know about, so the carefully crafted command list entries would be lost. To avoid this, blob uses a linker script which (among other things) describes how to deal with the command list entries: . = ALIGN(4); .commandlist : { __commandlist_start = .; *(.commandlist) __commandlist_end = .; } This tells the linker to start an output section called .commandlist at a 4 byte aligned address, defines the __commandlist_start symbol with that address, groups all .commandlist input sections (containing all commandlist_t entries) into the output section, and defines the __commandlist_end symbol with the current address. In this way we have created a list of commands nicely bounded by __commandlist_start and __commandlist_end. During the initialisation of blob those two addresses are used to find the correct number of commands. The advantage is clear: the command parser has been made independent on the number of commands. ** Parsing and executing ------------------------ After all this linker magic, parsing the command list has been made very easy: take the command from the command line, and compare it with commandlist_t->name of all the commands in the command list. If the name matches, we have found our command and can start executing commandlist_t->callback(). * Usage ======= Using this all is very simple. First of all, all commands should be declared as static functions (to avoid name space pollution) and have this format: static int command(int argc, char *argv[]); This looks pretty much like the main() function in normal C programs, and the argc and argv parameters have exactly the same meaning: argc contains the number of arguments to the function, argv is an array with pointers to each argument. The first pointer in argv points to the name of the called command. The command should return 0 in case of success, or a negative error number otherwise (see include/blob/errno.h for error number definitions). To get the function registered into the command list, simply write a line with a brief help text (again static) about the command, and use the __commandlist() macro to register it: static char commandhelp[] = "help on command\n"; __commandlist(command, "command", commandhelp); That's all there is. It's good practice to both the help text and the __commandlist() definition just below the function that implements the command, so there is less chance for them to get discrepancies. * Example ========= Here is a longer example: static int example_command(int argc, char *argv[]) { int i; for(i = 0; i < argc; i++) { SerialOutputString("argv["); SerialOutputDec(i); SerialOutputString("] = \""); SerialOutputString(argv[i]); SerialOutputString("\"\n"); } return 0; } static char examplehelp[] = "example command\n"; __commandlist(example_command, "example", examplehelp); Index: Makefile.am =================================================================== RCS file: /cvsroot/blob/blob/doc/Makefile.am,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Makefile.am 2001/12/13 18:58:31 1.1 +++ Makefile.am 2001/12/17 00:07:37 1.2 @@ -6,4 +6,5 @@ CLEANFILES = *~ EXTRA_DIST = \ - porting.txt + porting.txt \ + commandlist.txt |
From: Erik M. <er...@us...> - 2001-12-17 00:06:54
|
Update of /cvsroot/blob/blob In directory usw-pr-cvs1:/tmp/cvs-serv18082 Modified Files: configure.in Log Message: Show the list of supported boards in the help output Index: configure.in =================================================================== RCS file: /cvsroot/blob/blob/configure.in,v retrieving revision 1.29 retrieving revision 1.30 diff -u -d -r1.29 -r1.30 --- configure.in 2001/12/16 07:37:29 1.29 +++ configure.in 2001/12/17 00:06:50 1.30 @@ -72,7 +72,20 @@ dnl Check board we want to build for -AC_ARG_WITH(board, [ --with-board=NAME Name of the target board], +AC_ARG_WITH(board, [ --with-board=NAME Name of the target board + Valid names are: + assabet Intel Assabet + neponset Intel Assabet with Neponset board + brutus Intel Brutus + creditlart CreditLART + h3600 Compaq Ipaq H36x0 + idr Vercel UD-1 + lart LART + nesa NESA + pleb PLEB + shannon TuxScreen (Shannon) + system3 Prueftechnik Digital Board + Default board is lart], board_name="$withval", board_name="lart") |
From: Erik M. <er...@us...> - 2001-12-16 22:06:02
|
Update of /cvsroot/blob/blob/utils/build In directory usw-pr-cvs1:/tmp/cvs-serv25629 Modified Files: build_Makefile build_all Log Message: Add Neponset to list of targets Index: build_Makefile =================================================================== RCS file: /cvsroot/blob/blob/utils/build/build_Makefile,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- build_Makefile 2001/12/16 04:34:03 1.5 +++ build_Makefile 2001/12/16 22:05:59 1.6 @@ -14,7 +14,7 @@ archs = \ assabet brutus creditlart h3600 idr lart\ - nesa pleb system3 shannon + nesa neponset pleb system3 shannon 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.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- build_all 2001/12/16 04:34:03 1.5 +++ build_all 2001/12/16 22:05:59 1.6 @@ -12,7 +12,7 @@ # published by the Free Software Foundation. # -archs="assabet brutus creditlart h3600 idr lart nesa pleb system3 shannon" +archs="assabet brutus creditlart h3600 idr lart neponset nesa pleb system3 shannon" linux_prefix=~/LART/build/linux/elinux blob_src=~/src/sourceforge/blob extra_flags="--enable-all-features" |
From: Erik M. <J.A...@it...> - 2001-12-16 20:52:53
|
On Sun, Dec 16, 2001 at 10:23:39AM -0800, Erik Mouw wrote: > Update of /cvsroot/blob/blob/src/blob > In directory usw-pr-cvs1:/tmp/cvs-serv11239/src/blob > > Modified Files: > debug.c > Log Message: > This has been sitting in my local CVS sandbox for too long: > - Make all functions static > - Remove debug.h > - Add proper alignment checks for all functions > - Remove redundant barrier()s > - Improve help texts > - Remove address wizardry from Poke() (Poke() and Peek() now use the > same address as one would expect) Forgot one issue: - Use byte/halfword/word types for Peek() and Poke() so it conforms better to ARM speak 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. <er...@us...> - 2001-12-16 18:23:40
|
Update of /cvsroot/blob/blob/src/blob In directory usw-pr-cvs1:/tmp/cvs-serv11239/src/blob Modified Files: debug.c Log Message: This has been sitting in my local CVS sandbox for too long: - Make all functions static - Remove debug.h - Add proper alignment checks for all functions - Remove redundant barrier()s - Improve help texts - Remove address wizardry from Poke() (Poke() and Peek() now use the same address as one would expect) Index: debug.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/debug.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- debug.c 2001/12/08 07:16:47 1.6 +++ debug.c 2001/12/16 18:23:37 1.7 @@ -36,13 +36,12 @@ #include <blob/serial.h> #include <blob/command.h> -#include <blob/debug.h> /********************************************************************** * defines */ -#define CHKMEM_DEBUG 1 +#define CHKMEM_DEBUG BLOB_DEBUG /* this will send a cold shiver through erik's spine ... */ #define ERR( x ) { ret = x; goto DONE; } @@ -51,39 +50,11 @@ #define MEM( x ) (*((u32 *)x)) /********************************************************************** - * program globals - */ - -static char memcpyhelp[] = "memcpy [source] [dest] [len]\n" -"copy memory blocks\n"; - -static char pokehelp[] = "poke address value\n"; - -static char peekhelp[] = "peek address\n"; - -static char bitchghelp[] = "bitchg address value {and|or|xor|set|clear}\n"; - - -/********************************************************************** - * module globals - */ - -/********************************************************************** * prototypes */ static void perror( int errno, char *func ); -/********************************************************************** - * exported functions - */ - -/* Commandlist stuff */ -__commandlist(CmdMemcpy, "memcpy", memcpyhelp); -__commandlist(Poke, "poke", pokehelp ); -__commandlist(Peek, "peek", peekhelp ); -__commandlist(BitChange, "bitchg", bitchghelp ); - /********************************************************************* * CmdMemcpy * @@ -93,7 +64,7 @@ * Command wrapper for memcpy utility function. * */ -int CmdMemcpy( int argc, char *argv[] ) +static int CmdMemcpy( int argc, char *argv[] ) { int ret = 0; u32 src = 0L; @@ -111,6 +82,10 @@ ret = strtou32( argv[3], &len ); if ( ret < 0 ) ERR( -EINVAL ); + /* check alignment of src and dest */ + if((src & 0x03) || (dest & 0x03)) + ERR(-EALIGN); + /* counted in words */ if ( len & 0x00000003 ) { len = ( len >> 2 ) + 1; @@ -138,6 +113,11 @@ return ret; } +static char memcpyhelp[] = "memcpy src dst len\n" +"copy len bytes from src to dst\n"; +__commandlist(CmdMemcpy, "memcpy", memcpyhelp); + + /********************************************************************* * Poke * @@ -147,12 +127,12 @@ * Poke values to memory * */ -int Poke( int argc, char *argv[] ) +static int Poke( int argc, char *argv[] ) { int ret = 0; u32 address; u32 value; - char type = 'l'; + char type = 'w'; if ( argc < 3 ) ERR( -EINVAL ); @@ -173,29 +153,53 @@ SerialOutputHex(value); SerialOutputString(" type="); SerialOutputByte(type); - SerialOutputString("\n"); + SerialOutputByte('\n'); #endif -#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] ) + /* check memory alignment */ + switch(type | 0x20) { + case 'b': + /* bytes don't have alignment restrictions */ + break; + + case 'h': + /* half word accesses should be aligned on half words */ + if(address & 0x01) + ERR(-EALIGN); + + break; + + case 'w': + /* word accesses should be aligned on word boundaries */ + if(address & 0x03) + ERR(-EALIGN); + + break; + default: + /* hmm, invalid type */ + ERR( -EINVAL ); + break; + } + + /* write the value to memory */ switch( type | 0x20 ) { - case 'b': - mem_b( address ) = value & 0xff; - //(*((u8 *)address)) = value & 0xff; - break; - case 'w': - mem_w( address ) = value & 0xffff; - //(*((u16 *)address)) = value & 0xffff; - break; - case 'l': - mem_dw( address ) = value; - //(*((u32 *)address)) = value; - break; - default: - ERR( -EINVAL ); - break; + case 'b': + *((u8 *)address) = (u8)(value & 0xff); + break; + + case 'h': + *((u16 *)address) = (u16)(value & 0xffff); + break; + + case 'w': + *((u32 *)address) = value; + break; + + default: + /* this should not happen */ + ERR( -EINVAL ); + break; } @@ -207,6 +211,10 @@ return ret; } +static char pokehelp[] = "poke address value [b|h|w]\n" +"b = byte, h = half word, w = word (default is w)\n"; +__commandlist(Poke, "poke", pokehelp ); + /********************************************************************* * Peek * @@ -216,12 +224,12 @@ * Peeks values from memory * */ -int Peek( int argc, char *argv[] ) +static int Peek( int argc, char *argv[] ) { int ret = 0; u32 address; u32 value; - char type = 'l'; + char type = 'w'; if ( argc < 2 ) ERR( -EINVAL ); @@ -230,35 +238,60 @@ if ( argc >= 2 ) { type = argv[2][0]; - SerialOutputString("type="); - SerialOutputByte(type); - SerialOutputString("\n"); } #if CHKMEM_DEBUG SerialOutputString("adr=0x"); SerialOutputHex(address); - SerialOutputString("\n"); + SerialOutputString(" type="); + SerialOutputByte(type); + SerialOutputByte('\n'); #endif - value = 0; + /* check memory alignment */ + switch(type | 0x20) { + case 'b': + /* bytes don't have alignment restrictions */ + break; + + case 'h': + /* half word accesses should be aligned on half words */ + if(address & 0x01) + ERR(-EALIGN); + + break; + + case 'w': + /* word accesses should be aligned on word boundaries */ + if(address & 0x03) + ERR(-EALIGN); + + break; + + default: + /* hmm, invalid type */ + ERR( -EINVAL ); + break; + } + + /* read value from memory */ switch( type | 0x20 ) { - case 'b': - value = (*((u8 *)address)) & 0xff; - barrier(); - break; - case 'w': - value = (*((u16 *)address))& 0xffff; - barrier(); - break; - case 'l': - value = (*((u32 *)address)); - barrier(); - break; - default: - ret = -EINVAL; - goto DONE; - break; + case 'b': + value = (*((u8 *)address)) & 0xff; + break; + + case 'h': + value = (*((u16 *)address))& 0xffff; + break; + + case 'w': + value = (*((u32 *)address)); + break; + + default: + /* this should not happen */ + ERR(-EINVAL); + break; } SerialOutputByte(type); @@ -274,6 +307,10 @@ return ret; } +static char peekhelp[] = "peek address [b|h|w]\n" +"b = byte, h = half word, w = word (default is w)\n"; +__commandlist(Peek, "peek", peekhelp ); + /********************************************************************* * dump * @@ -283,7 +320,7 @@ * dumps memory * */ -int dump( int argc, char *argv[] ) +static int dump( int argc, char *argv[] ) { int ret = 0; u32 address; @@ -303,20 +340,24 @@ if ( ret < 0 ) ERR( -EINVAL ); } else - endaddress = address + 0x80; + endaddress = address + 0x80; + + + /* check alignment of address and endaddress */ + if((address & 0x03) || (endaddress & 0x03)) + ERR(-EALIGN); + /* print it */ for ( ; address < endaddress; address += 0x10) { SerialOutputHex(address); SerialOutputString(": "); for (tmpaddress = address; tmpaddress < address + 0x10; tmpaddress += 4) { value = (*((u32 *)tmpaddress)); - barrier(); SerialOutputHex(value); SerialOutputByte(' '); } for (tmpaddress = address; tmpaddress < address + 0x10; tmpaddress++) { value = (*((u8 *)tmpaddress)) & 0xff; - barrier(); if ((value >= ' ') && (value <= '~')) SerialOutputByte(value); else @@ -332,6 +373,7 @@ } return ret; } + static char dumphelp[] = "dump address [endAddress]\n"; __commandlist(dump, "dump", dumphelp ); @@ -344,7 +386,7 @@ * Modifies bits of an given memory location * */ -int BitChange( int argc, char *argv[] ) +static int BitChange( int argc, char *argv[] ) { int ret = 0; u32 adr = 0L; @@ -358,6 +400,10 @@ ret = strtou32( argv[2], &value ); if ( ret < 0 ) ERR( -EINVAL ); + /* check memory alignment */ + if(adr &= 0x03) + ERR(-EALIGN); + SerialOutputHex( MEM( adr ) ); switch ( argv[3][0] & (~0x20) ) { @@ -390,6 +436,9 @@ } return ret; } + +static char bitchghelp[] = "bitchg address value {and|or|xor|set|clear}\n"; +__commandlist(BitChange, "bitchg", bitchghelp ); /********************************************************************** * static functions |
From: Erik M. <er...@us...> - 2001-12-16 18:23:40
|
Update of /cvsroot/blob/blob/include/blob In directory usw-pr-cvs1:/tmp/cvs-serv11239/include/blob Removed Files: debug.h Log Message: This has been sitting in my local CVS sandbox for too long: - Make all functions static - Remove debug.h - Add proper alignment checks for all functions - Remove redundant barrier()s - Improve help texts - Remove address wizardry from Poke() (Poke() and Peek() now use the same address as one would expect) --- debug.h DELETED --- |
From: Erik M. <er...@us...> - 2001-12-16 18:12:36
|
Update of /cvsroot/blob/blob/src/blob In directory usw-pr-cvs1:/tmp/cvs-serv8745 Modified Files: main.c Log Message: Fix typo that prevented Shannon from compiling Index: main.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/main.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- main.c 2001/12/16 08:54:23 1.14 +++ main.c 2001/12/16 18:12:33 1.15 @@ -440,7 +440,7 @@ #ifdef PARAM_START SerialOutputString("param "); - SerialOutputHex(PARAMS_FLASH_BASE); + SerialOutputHex(PARAM_FLASH_BASE); SerialOutputString(": "); if(blob_status.paramType == fromFlash) { SerialOutputString("from flash\n"); |
From: Erik M. <er...@us...> - 2001-12-16 16:35:55
|
Update of /cvsroot/blob/blob In directory usw-pr-cvs1:/tmp/cvs-serv21610 Modified Files: ChangeLog Log Message: Add my accumulated items for the ChangeLog and move Tim's work to 2.0.5-pre2. Index: ChangeLog =================================================================== RCS file: /cvsroot/blob/blob/ChangeLog,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- ChangeLog 2001/12/16 04:34:02 1.11 +++ ChangeLog 2001/12/16 16:35:52 1.12 @@ -3,9 +3,13 @@ $Id$ -blob-2.0.5-pre1: +blob-2.0.5-pre2: - Vercel UD-1 (IDR) support Tim Riker -- new dump command Tim Riker +- New dump command Tim Riker +- Fix compile time bug with newer linux kernels Stefan Eletzhofer +- README update Kevin Lo + +blob-2.0.5-pre1: - New flash ROM program code Erik Mouw - Ipaq H3600 port Erik Mouw - Memory tester Stefan Eletzhofer |