From 8bde7f776c77b343aca29b8c7b58464d915ac245 Mon Sep 17 00:00:00 2001 From: wdenk Date: Fri, 27 Jun 2003 21:31:46 +0000 Subject: * Code cleanup: - remove trailing white space, trailing empty lines, C++ comments, etc. - split cmd_boot.c (separate cmd_bdinfo.c and cmd_load.c) * Patches by Kenneth Johansson, 25 Jun 2003: - major rework of command structure (work done mostly by Michal Cendrowski and Joakim Kristiansen) --- board/eltec/mhpc/Makefile | 2 +- board/eltec/mhpc/config.mk | 16 --- board/eltec/mhpc/flash.c | 34 ++---- board/eltec/mhpc/mhpc.c | 216 +++++++++++++++++++------------------- board/eltec/mhpc/u-boot.lds | 6 +- board/eltec/mhpc/u-boot.lds.debug | 6 +- 6 files changed, 125 insertions(+), 155 deletions(-) (limited to 'board/eltec/mhpc') diff --git a/board/eltec/mhpc/Makefile b/board/eltec/mhpc/Makefile index ef173d0366..13ce9fc9d2 100644 --- a/board/eltec/mhpc/Makefile +++ b/board/eltec/mhpc/Makefile @@ -28,7 +28,7 @@ LIB = lib$(BOARD).a OBJS = $(BOARD).o flash.o $(LIB): .depend $(OBJS) - $(AR) crv $@ $^ + $(AR) crv $@ $(OBJS) ######################################################################### diff --git a/board/eltec/mhpc/config.mk b/board/eltec/mhpc/config.mk index 607ebbcb1f..03934de3f6 100644 --- a/board/eltec/mhpc/config.mk +++ b/board/eltec/mhpc/config.mk @@ -31,19 +31,3 @@ TEXT_BASE = 0xfe000000 /*TEXT_BASE = 0x00200000 */ - - - - - - - - - - - - - - - - diff --git a/board/eltec/mhpc/flash.c b/board/eltec/mhpc/flash.c index e9c8f9862d..4cc66a973d 100644 --- a/board/eltec/mhpc/flash.c +++ b/board/eltec/mhpc/flash.c @@ -193,13 +193,13 @@ static ulong flash_get_size (FPW *addr, flash_info_t *info) switch (value) { case (FPW)INTEL_ID_28F640J5 : - info->flash_id += FLASH_28F640J5 ; - info->sector_count = 64; - info->size = 0x00800000; - break; /* => 8 MB */ + info->flash_id += FLASH_28F640J5 ; + info->sector_count = 64; + info->size = 0x00800000; + break; /* => 8 MB */ - default: - info->flash_id = FLASH_UNKNOWN; + default: + info->flash_id = FLASH_UNKNOWN; break; } @@ -429,25 +429,3 @@ static int write_data (flash_info_t *info, ulong dest, FPW data) return (0); } - - - - - - - - - - - - - - - - - - - - - - diff --git a/board/eltec/mhpc/mhpc.c b/board/eltec/mhpc/mhpc.c index 81f820a8d4..83952d8388 100644 --- a/board/eltec/mhpc/mhpc.c +++ b/board/eltec/mhpc/mhpc.c @@ -40,17 +40,17 @@ extern char console_buffer[CFG_CBSIZE]; extern void eeprom_init (void); extern int eeprom_read (unsigned dev_addr, unsigned offset, - unsigned char *buffer, unsigned cnt); + unsigned char *buffer, unsigned cnt); extern int eeprom_write (unsigned dev_addr, unsigned offset, - unsigned char *buffer, unsigned cnt); + unsigned char *buffer, unsigned cnt); /* globals */ void *video_hw_init(void); void video_set_lut (unsigned int index, /* color number */ - unsigned char r, /* red */ - unsigned char g, /* green */ - unsigned char b /* blue */ - ); + unsigned char r, /* red */ + unsigned char g, /* green */ + unsigned char b /* blue */ + ); GraphicDevice gdev; @@ -153,9 +153,9 @@ int misc_init_r(void) revinfo mhpcRevInfo; char nid[32]; char *mhpcSensorTypes[] = { "OMNIVISON OV7610/7620 color", - "OMNIVISON OV7110 b&w", NULL }; + "OMNIVISON OV7110 b&w", NULL }; char hex[23] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 0, 0, - 0, 0, 0, 0, 10, 11, 12, 13, 14, 15 }; + 0, 0, 0, 0, 10, 11, 12, 13, 14, 15 }; int i; /* check revision data */ @@ -166,62 +166,62 @@ int misc_init_r(void) printf ("Enter revision number (0-9): %c ", mhpcRevInfo.revision[0]); if (0 != readline (NULL)) { - mhpcRevInfo.revision[0] = (char)toupper(console_buffer[0]); + mhpcRevInfo.revision[0] = (char)toupper(console_buffer[0]); } printf ("Enter revision character (A-Z): %c ", mhpcRevInfo.revision[1]); if (1 == readline (NULL)) { - mhpcRevInfo.revision[1] = (char)toupper(console_buffer[0]); + mhpcRevInfo.revision[1] = (char)toupper(console_buffer[0]); } printf("Enter board name (V-XXXX-XXXX): %s ", (char *)&mhpcRevInfo.board); if (11 == readline (NULL)) { - for (i=0; i<11; i++) - { - mhpcRevInfo.board[i] = (char)toupper(console_buffer[i]); - mhpcRevInfo.board[11] = '\0'; - } + for (i=0; i<11; i++) + { + mhpcRevInfo.board[i] = (char)toupper(console_buffer[i]); + mhpcRevInfo.board[11] = '\0'; + } } printf("Supported sensor types:\n"); i=0; do { - printf("\n \'%d\' : %s\n", i, mhpcSensorTypes[i]); + printf("\n \'%d\' : %s\n", i, mhpcSensorTypes[i]); } while ( mhpcSensorTypes[++i] != NULL ); do { - printf("\nEnter sensor number (0-255): %d ", (int)mhpcRevInfo.sensor ); - if (0 != readline (NULL)) - { - mhpcRevInfo.sensor = (unsigned char)simple_strtoul(console_buffer, NULL, 10); - } + printf("\nEnter sensor number (0-255): %d ", (int)mhpcRevInfo.sensor ); + if (0 != readline (NULL)) + { + mhpcRevInfo.sensor = (unsigned char)simple_strtoul(console_buffer, NULL, 10); + } } while ( mhpcRevInfo.sensor >= i ); printf("Enter serial number: %s ", (char *)&mhpcRevInfo.serial ); if (6 == readline (NULL)) { - for (i=0; i<6; i++) - { - mhpcRevInfo.serial[i] = console_buffer[i]; - } - mhpcRevInfo.serial[6] = '\0'; + for (i=0; i<6; i++) + { + mhpcRevInfo.serial[i] = console_buffer[i]; + } + mhpcRevInfo.serial[6] = '\0'; } printf("Enter ether node ID with leading zero (HEX): %02x%02x%02x%02x%02x%02x ", - mhpcRevInfo.etheraddr[0], mhpcRevInfo.etheraddr[1], - mhpcRevInfo.etheraddr[2], mhpcRevInfo.etheraddr[3], - mhpcRevInfo.etheraddr[4], mhpcRevInfo.etheraddr[5] ); + mhpcRevInfo.etheraddr[0], mhpcRevInfo.etheraddr[1], + mhpcRevInfo.etheraddr[2], mhpcRevInfo.etheraddr[3], + mhpcRevInfo.etheraddr[4], mhpcRevInfo.etheraddr[5] ); if (12 == readline (NULL)) { - for (i=0; i<12; i+=2) - { - mhpcRevInfo.etheraddr[i>>1] = (char)(16*hex[toupper(console_buffer[i])-'0'] + - hex[toupper(console_buffer[i+1])-'0']); - } + for (i=0; i<12; i+=2) + { + mhpcRevInfo.etheraddr[i>>1] = (char)(16*hex[toupper(console_buffer[i])-'0'] + + hex[toupper(console_buffer[i+1])-'0']); + } } /* setup new revision data */ @@ -230,16 +230,16 @@ int misc_init_r(void) /* set environment */ sprintf( nid, "%02x:%02x:%02x:%02x:%02x:%02x", - mhpcRevInfo.etheraddr[0], mhpcRevInfo.etheraddr[1], - mhpcRevInfo.etheraddr[2], mhpcRevInfo.etheraddr[3], - mhpcRevInfo.etheraddr[4], mhpcRevInfo.etheraddr[5]); + mhpcRevInfo.etheraddr[0], mhpcRevInfo.etheraddr[1], + mhpcRevInfo.etheraddr[2], mhpcRevInfo.etheraddr[3], + mhpcRevInfo.etheraddr[4], mhpcRevInfo.etheraddr[5]); setenv("ethaddr", nid); /* print actual board identification */ printf("Ident: %s %s Ser %s Rev %c%c\n", - mhpcRevInfo.board, (mhpcRevInfo.sensor==0?"color":"b&w"), - (char *)&mhpcRevInfo.serial, - mhpcRevInfo.revision[0], mhpcRevInfo.revision[1]); + mhpcRevInfo.board, (mhpcRevInfo.sensor==0?"color":"b&w"), + (char *)&mhpcRevInfo.serial, + mhpcRevInfo.revision[0], mhpcRevInfo.revision[1]); return (0); } @@ -308,29 +308,29 @@ static void video_circle (char *center, int radius, int color, int pitch) *(center-x+y*pitch) = color; while(y>x) { - if (d<0) - { - d += dE; - dE += 2; - dSE += 2; - x++; - } - else - { - d += dSE; - dE += 2; - dSE += 4; - x++; - y--; - } - *(center+x+y*pitch) = color; - *(center+y+x*pitch) = color; - *(center+y-x*pitch) = color; - *(center+x-y*pitch) = color; - *(center-x-y*pitch) = color; - *(center-y-x*pitch) = color; - *(center-y+x*pitch) = color; - *(center-x+y*pitch) = color; + if (d<0) + { + d += dE; + dE += 2; + dSE += 2; + x++; + } + else + { + d += dSE; + dE += 2; + dSE += 4; + x++; + y--; + } + *(center+x+y*pitch) = color; + *(center+y+x*pitch) = color; + *(center+y-x*pitch) = color; + *(center+x-y*pitch) = color; + *(center-x-y*pitch) = color; + *(center-y-x*pitch) = color; + *(center-y+x*pitch) = color; + *(center-x+y*pitch) = color; } } @@ -344,31 +344,31 @@ static void video_test_image(void) /* draw raster */ for (i=0; iim_lcd.lcd_lccr = 0x96000866; @@ -433,7 +433,7 @@ void *video_hw_init (void) immr->im_lcd.lcd_lcvcr = 0x900f0024; printf ("Video: 640x480 8Bit Index Lut %s\n", - (clut==1?"240/16 (gray/vga)":"256(gray)")); + (clut==1?"240/16 (gray/vga)":"256(gray)")); video_default_lut (clut); @@ -451,11 +451,11 @@ void *video_hw_init (void) gdev.gdfIndex = GDF__8BIT_INDEX; if (clut > 1) - /* return Graphic Device for console */ - return (void *)&gdev; + /* return Graphic Device for console */ + return (void *)&gdev; else - /* just graphic enabled - draw something beautiful */ - video_test_image(); + /* just graphic enabled - draw something beautiful */ + video_test_image(); return NULL; /* this disabels cfb - console */ } @@ -463,7 +463,7 @@ void *video_hw_init (void) /* ------------------------------------------------------------------------- */ void video_set_lut (unsigned int index, - unsigned char r, unsigned char g, unsigned char b) + unsigned char r, unsigned char g, unsigned char b) { unsigned int lum; unsigned short *pLut = (unsigned short *)(CFG_IMMR + 0x0e00); diff --git a/board/eltec/mhpc/u-boot.lds b/board/eltec/mhpc/u-boot.lds index 7128155f85..526198cc51 100644 --- a/board/eltec/mhpc/u-boot.lds +++ b/board/eltec/mhpc/u-boot.lds @@ -99,6 +99,11 @@ SECTIONS _edata = .; PROVIDE (edata = .); + __u_boot_cmd_start = .; + .u_boot_cmd : { *(.u_boot_cmd) } + __u_boot_cmd_end = .; + + __start___ex_table = .; __ex_table : { *(__ex_table) } __stop___ex_table = .; @@ -121,4 +126,3 @@ SECTIONS _end = . ; PROVIDE (end = .); } - diff --git a/board/eltec/mhpc/u-boot.lds.debug b/board/eltec/mhpc/u-boot.lds.debug index 8dc6d408ca..f6f7cf4fa5 100644 --- a/board/eltec/mhpc/u-boot.lds.debug +++ b/board/eltec/mhpc/u-boot.lds.debug @@ -106,6 +106,11 @@ SECTIONS _edata = .; PROVIDE (edata = .); + __u_boot_cmd_start = .; + .u_boot_cmd : { *(.u_boot_cmd) } + __u_boot_cmd_end = .; + + __start___ex_table = .; __ex_table : { *(__ex_table) } __stop___ex_table = .; @@ -128,4 +133,3 @@ SECTIONS _end = . ; PROVIDE (end = .); } - -- cgit v1.2.3