From: wdenk Date: Thu, 23 Nov 2000 00:46:20 +0000 (+0000) Subject: * Fix Bug in Boot File Size calculation X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=02239fb66f02791dce869eaa990a3a9c1e43b61c;p=users%2Frw%2Fppcboot.git * Fix Bug in Boot File Size calculation * Fix MPC8xxFADS configuration (don't clobber unused port lines; thanks to Dave Ellis). * Remove incorrect change history from some files. --- diff --git a/CHANGELOG b/CHANGELOG index 294e31e..f9372ff 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -57,6 +57,15 @@ To do: * "last user address" is set even if bootp is used without parameters (and it uses default address). +====================================================================== +Modifications since 0.6.3: +====================================================================== + +* Fix Bug in Boot File Size calculation + +* Fix MPC8xxFADS configuration (don't clobber unused port lines; + thanks to Dave Ellis). + ====================================================================== Modifications for 0.6.3: ====================================================================== diff --git a/common/board.c b/common/board.c index 6540fca..d01f06e 100644 --- a/common/board.c +++ b/common/board.c @@ -451,7 +451,10 @@ void board_init_r (bd_t *bd, ulong dest_addr) misc_init_r(bd); #endif -#ifdef CONFIG_SPD823TS +#if defined(CONFIG_SPD823TS) || defined(CONFIG_IVMS8) +# ifdef DEBUG + printf("Reset Ethernet PHY\n"); +# endif reset_phy (); #endif diff --git a/etx094/ppcboot.lds b/etx094/ppcboot.lds index 045ecac..c516d76 100644 --- a/etx094/ppcboot.lds +++ b/etx094/ppcboot.lds @@ -68,7 +68,6 @@ SECTIONS . = env_offset; common/environment.o(.text) - *(.text) *(.fixup) *(.got1) @@ -85,7 +84,7 @@ SECTIONS .dtors : { *(.dtors) } /* Read-write section, merged into data segment: */ - . = (. + 0x0FFF) & 0xFFFFF000; + . = (. + 0x00FF) & 0xFFFFFF00; _erotext = .; PROVIDE (erotext = .); .reloc : @@ -115,11 +114,11 @@ SECTIONS __ex_table : { *(__ex_table) } __stop___ex_table = .; - . = ALIGN(4096); + . = ALIGN(256); __init_begin = .; .text.init : { *(.text.init) } .data.init : { *(.data.init) } - . = ALIGN(4096); + . = ALIGN(256); __init_end = .; __bss_start = .; diff --git a/etx094/ppcboot.lds.debug b/etx094/ppcboot.lds.debug index 3bae091..2f3b2e2 100644 --- a/etx094/ppcboot.lds.debug +++ b/etx094/ppcboot.lds.debug @@ -68,7 +68,6 @@ SECTIONS ppc/string.o (.text) ppc/crc32.o (.text) common/dlmalloc.o (.text) - . = env_offset; common/environment.o(.text) @@ -88,7 +87,7 @@ SECTIONS .dtors : { *(.dtors) } /* Read-write section, merged into data segment: */ - . = (. + 0x0FFF) & 0xFFFFF000; + . = (. + 0x00FF) & 0xFFFFFF00; _erotext = .; PROVIDE (erotext = .); .reloc : @@ -118,11 +117,11 @@ SECTIONS __ex_table : { *(__ex_table) } __stop___ex_table = .; - . = ALIGN(4096); + . = ALIGN(256); __init_begin = .; .text.init : { *(.text.init) } .data.init : { *(.data.init) } - . = ALIGN(4096); + . = ALIGN(256); __init_end = .; __bss_start = .; diff --git a/include/commproc.h b/include/commproc.h index e6ba1fc..b76471a 100644 --- a/include/commproc.h +++ b/include/commproc.h @@ -472,12 +472,6 @@ typedef struct scc_enet { #define SICR_ENET_MASK ((uint)0x0000ff00) #define SICR_ENET_CLKRT ((uint)0x00002e00) -/* 68160 PHY control */ - -#define PC_ENET_ETHLOOP ((ushort)0x0800) -#define PC_ENET_TPFLDL ((ushort)0x0400) -#define PC_ENET_TPSQEL ((ushort)0x0200) - #endif /* CONFIG_FADS823FADS */ /*** GENIETV ********************************************************/ @@ -551,13 +545,38 @@ typedef struct scc_enet { #define SICR_ENET_MASK ((uint)0x000000ff) #define SICR_ENET_CLKRT ((uint)0x0000002c) +#endif /* CONFIG_FADS860T */ + +/*** MPC860ADS ********************************************************/ + +#if defined(CONFIG_MPC860) && defined(CONFIG_ADS) +/* This ENET stuff is for the MPC860ADS with ethernet on SCC1. + */ + +#define PROFF_ENET PROFF_SCC1 +#define CPM_CR_ENET CPM_CR_CH_SCC1 +#define SCC_ENET 0 + +#define PA_ENET_RXD ((ushort)0x0001) +#define PA_ENET_TXD ((ushort)0x0002) +#define PA_ENET_TCLK ((ushort)0x0100) +#define PA_ENET_RCLK ((ushort)0x0200) + +#define PB_ENET_TENA ((uint)0x00001000) + +#define PC_ENET_CLSN ((ushort)0x0010) +#define PC_ENET_RENA ((ushort)0x0020) + +#define SICR_ENET_MASK ((uint)0x000000ff) +#define SICR_ENET_CLKRT ((uint)0x0000002c) + /* 68160 PHY control */ #define PC_ENET_ETHLOOP ((ushort)0x0800) #define PC_ENET_TPFLDL ((ushort)0x0400) #define PC_ENET_TPSQEL ((ushort)0x0200) -#endif /* CONFIG_FADS860T */ +#endif /* MPC860ADS */ /*** BSEIP **********************************************************/ diff --git a/include/config_ETX094.h b/include/config_ETX094.h index 5324169..2206b7b 100644 --- a/include/config_ETX094.h +++ b/include/config_ETX094.h @@ -36,8 +36,8 @@ #define CONFIG_MPC850 1 /* This is a MPC850 CPU */ #define CONFIG_ETX094 1 /* ...on a ETX_094 board */ -#define CONFIG_8xx_CONS_SMC1 1 /* Console is on SMC1 */ -#undef CONFIG_8xx_CONS_SMC2 +#undef CONFIG_8xx_CONS_SMC1 +#define CONFIG_8xx_CONS_SMC2 1 /* Console is on SMC2 */ #undef CONFIG_8xx_CONS_NONE #define CONFIG_BAUDRATE 115200 #if 0 @@ -45,11 +45,13 @@ #else #define CONFIG_BOOTDELAY 5 /* autoboot after 5 seconds */ #endif -#define CONFIG_BOOTCOMMAND "bootm 40020000" /* autoboot command */ -#define CONFIG_BOOTARGS "root=/dev/nfs rw " \ - "nfsroot=10.0.0.2:/LinuxPPC " \ - "nfsaddrs=10.0.0.99:10.0.0.2" +#undef CONFIG_BOOTARGS +#define CONFIG_BOOTCOMMAND \ + "bootp; " \ + "setenv bootargs root=/dev/nfs rw nfsroot=$(serverip):$(rootpath) " \ + "ip=$(ipaddr):$(serverip):$(gatewayip):$(netmask):$(hostname)::off; " \ + "bootm" #define CONFIG_LOADS_ECHO 1 /* echo on for serial download */ #undef CFG_LOADS_BAUD_CHANGE /* don't allow baudrate change */ @@ -58,7 +60,7 @@ #define CONFIG_STATUS_LED 1 /* Status LED enabled */ -#define CONFIG_BOOTP_MASK CONFIG_BOOTP_ALL +#define CONFIG_BOOTP_MASK (CONFIG_BOOTP_DEFAULT | CONFIG_BOOTP_BOOTFILESIZE) /* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */ #include @@ -128,13 +130,13 @@ * FLASH organization */ #define CFG_MAX_FLASH_BANKS 1 /* max number of memory banks */ -#define CFG_MAX_FLASH_SECT 256 /* max number of sectors on one chip */ +#define CFG_MAX_FLASH_SECT 32 /* max number of sectors on one chip */ #define CFG_FLASH_ERASE_TOUT 120000 /* Timeout for Flash Erase (in ms) */ #define CFG_FLASH_WRITE_TOUT 500 /* Timeout for Flash Write (in ms) */ -#define CFG_FLASH_ENV_OFFSET 0x8000 /* Offset of Environment Sector */ -#define CFG_FLASH_ENV_SIZE 0x2000 /* Total Size of Environment Sector */ +#define CFG_FLASH_ENV_OFFSET 0x8000 /* Offset of Environment Sector */ +#define CFG_FLASH_ENV_SIZE 0x4000 /* Total Size of Environment Sector */ /*----------------------------------------------------------------------- * Cache Configuration */ diff --git a/include/config_IVMS8.h b/include/config_IVMS8.h index b038861..204381c 100644 --- a/include/config_IVMS8.h +++ b/include/config_IVMS8.h @@ -61,11 +61,13 @@ #define CONFIG_COMMANDS \ ((CONFIG_CMD_DFL & ~(CFG_CMD_FLASH)) | CFG_CMD_IDE) /* no Flash, but IDE */ #define CONFIG_COMMANDS ((CONFIG_CMD_DFL | CFG_CMD_IDE) & ~(CFG_CMD_NET)) -#else #define CONFIG_COMMANDS (CONFIG_CMD_DFL | CFG_CMD_IDE) +#else +#define CONFIG_COMMANDS (CONFIG_CMD_DFL) #endif /* 0 */ -#define CONFIG_BOOTP_MASK CONFIG_BOOTP_DEFAULT +#define CONFIG_BOOTP_MASK \ + ((CONFIG_BOOTP_DEFAULT | CONFIG_BOOTP_BOOTFILESIZE) & ~CONFIG_BOOTP_GATEWAY) /* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */ #include diff --git a/include/config_SPD823TS.h b/include/config_SPD823TS.h index f467da5..3fb80e2 100644 --- a/include/config_SPD823TS.h +++ b/include/config_SPD823TS.h @@ -59,7 +59,7 @@ #define CONFIG_COMMANDS \ ((CONFIG_CMD_DFL & ~(CFG_CMD_FLASH)) | CFG_CMD_IDE) /* no Flash, but IDE */ -#define CONFIG_BOOTP_MASK CONFIG_BOOTP_DEFAULT +#define CONFIG_BOOTP_MASK (CONFIG_BOOTP_DEFAULT | CONFIG_BOOTP_BOOTFILESIZE) /* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */ #include diff --git a/include/config_TQM823L.h b/include/config_TQM823L.h index 072a1dc..35847a9 100644 --- a/include/config_TQM823L.h +++ b/include/config_TQM823L.h @@ -60,7 +60,7 @@ #undef CONFIG_WATCHDOG /* watchdog disabled */ -#define CONFIG_BOOTP_MASK CONFIG_BOOTP_DEFAULT +#define CONFIG_BOOTP_MASK (CONFIG_BOOTP_DEFAULT | CONFIG_BOOTP_BOOTFILESIZE) /* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */ #include diff --git a/include/config_TQM850L.h b/include/config_TQM850L.h index 9f01771..fdf0048 100644 --- a/include/config_TQM850L.h +++ b/include/config_TQM850L.h @@ -62,7 +62,7 @@ #define CONFIG_STATUS_LED 1 /* Status LED enabled */ -#define CONFIG_BOOTP_MASK CONFIG_BOOTP_DEFAULT +#define CONFIG_BOOTP_MASK (CONFIG_BOOTP_DEFAULT | CONFIG_BOOTP_BOOTFILESIZE) /* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */ #include diff --git a/include/config_TQM855L.h b/include/config_TQM855L.h index c337623..c2735de 100644 --- a/include/config_TQM855L.h +++ b/include/config_TQM855L.h @@ -60,7 +60,7 @@ #undef CONFIG_WATCHDOG /* watchdog disabled */ -#define CONFIG_BOOTP_MASK CONFIG_BOOTP_DEFAULT +#define CONFIG_BOOTP_MASK (CONFIG_BOOTP_DEFAULT | CONFIG_BOOTP_BOOTFILESIZE) /* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */ #include diff --git a/include/config_TQM860L.h b/include/config_TQM860L.h index 21e081a..d453d7c 100644 --- a/include/config_TQM860L.h +++ b/include/config_TQM860L.h @@ -60,7 +60,7 @@ #undef CONFIG_WATCHDOG /* watchdog disabled */ -#define CONFIG_BOOTP_MASK CONFIG_BOOTP_DEFAULT +#define CONFIG_BOOTP_MASK (CONFIG_BOOTP_DEFAULT | CONFIG_BOOTP_BOOTFILESIZE) /* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */ #include diff --git a/include/flash.h b/include/flash.h index 088dfd3..cf96554 100644 --- a/include/flash.h +++ b/include/flash.h @@ -96,7 +96,7 @@ void flash_erase (flash_info_t *, int, int); #define FLASH_SST800A 0x000C /* SST 39xF800A ID ( 8M = 512K x 16 ) */ #define FLASH_SST160A 0x000D /* SST 39xF160A ID (16M = 1M x 16 ) */ -#define FLASH_STM800AB 0x0010 /* STM M29WF800AB ID ( 8M = 512K x 16 ) */ +#define FLASH_STM800AB 0x0011 /* STM M29WF800AB ID ( 8M = 512K x 16 ) */ #define FLASH_28F400_T 0x0022 /* MT 28F400B3 ID ( 4M = 256K x 16 ) */ #define FLASH_28F400_B 0x0023 /* MT 28F400B3 ID ( 4M = 256K x 16 ) */ diff --git a/include/status_led.h b/include/status_led.h index 8c97cb6..14e9560 100644 --- a/include/status_led.h +++ b/include/status_led.h @@ -35,16 +35,21 @@ #ifdef CONFIG_STATUS_LED - #if defined(CONFIG_TQM823L) || defined(CONFIG_TQM850L) || \ defined(CONFIG_TQM855L) || defined(CONFIG_TQM860L) +# ifndef CONFIG_TQM8xxL +# define CONFIG_TQM8xxL +# endif +#endif +#if defined(CONFIG_TQM8xxL) # define STATUS_LED_PAR im_cpm.cp_pbpar # define STATUS_LED_DIR im_cpm.cp_pbdir # define STATUS_LED_ODR im_cpm.cp_pbodr # define STATUS_LED_DAT im_cpm.cp_pbdat # define STATUS_LED_BIT 0x00000001 +# define STATUS_LED_ACTIVE 1 /* LED on for bit == 1 */ # define STATUS_LED_PERIOD 500 @@ -56,6 +61,7 @@ # define STATUS_LED_DAT im_ioport.iop_pddat # define STATUS_LED_BIT 0x00000001 +# define STATUS_LED_ACTIVE 1 /* LED on for bit == 0 */ # define STATUS_LED_PERIOD 500 @@ -70,6 +76,6 @@ void status_led_tick (unsigned long timestamp); void status_led_set (int state); - #endif /* CONFIG_STATUS_LED */ + #endif /* _STATUS_LED_H_ */ diff --git a/ivms8/ivms8.c b/ivms8/ivms8.c index 4e77c6e..9d16f0e 100644 --- a/ivms8/ivms8.c +++ b/ivms8/ivms8.c @@ -159,7 +159,7 @@ initdram (int board_type) volatile memctl8xx_t *memctl = &immr->im_memctl; long int size_b0; - /* enable SDRAM clock ("switch on" SDRAM */ + /* enable SDRAM clock ("switch on" SDRAM) */ immr->im_cpm.cp_pbpar &= ~(CFG_PB_SDRAM_CLKE); /* GPIO */ immr->im_cpm.cp_pbodr &= ~(CFG_PB_SDRAM_CLKE); /* active output */ immr->im_cpm.cp_pbdir |= CFG_PB_SDRAM_CLKE ; /* output */ @@ -284,8 +284,8 @@ void reset_phy(void) immr->im_cpm.cp_pbpar &= ~(CFG_PB_ETH_POWERDOWN); /* GPIO */ immr->im_cpm.cp_pbodr &= ~(CFG_PB_ETH_POWERDOWN); /* active output */ immr->im_cpm.cp_pbdir |= CFG_PB_ETH_POWERDOWN ; /* output */ - immr->im_cpm.cp_pbdat &= ~(CFG_PB_ETH_POWERDOWN); /* assert SDRAM CLKE */ - udelay(1); + immr->im_cpm.cp_pbdat &= ~(CFG_PB_ETH_POWERDOWN); /* Enable PHY power */ + udelay(1000); /* * RESET is implemented by a positive pulse of at least 1 us diff --git a/mpc8240/drivers/dma/Makefile b/mpc8240/drivers/dma/Makefile index ae2df2f..3e72c7d 100644 --- a/mpc8240/drivers/dma/Makefile +++ b/mpc8240/drivers/dma/Makefile @@ -1,6 +1,6 @@ ########################################################################## # -# $Id: Makefile,v 1.1 2000/11/20 17:22:32 wdenk Exp $ +# $Id: Makefile,v 1.2 2000/11/23 00:46:21 wdenk Exp $ # # Copyright Motorola, Inc. 1997 # ALL RIGHTS RESERVED @@ -27,52 +27,6 @@ # INFORMATION, OR OTHER PECUNIARY LOSS) ARISING OF THE USE OR # INABILITY TO USE THE SOFTWARE. # -# $Log: Makefile,v $ -# Revision 1.1 2000/11/20 17:22:32 wdenk -# -# * Added support for MBX860T (thanks to Rob Taylor) -# -# * Added support for Sandpoint8240 (thanks to Rob Taylor); this is -# Work In Progress (TM); current status: boots to command line input. -# EPIC code non-functional (interrupts disabled), No net, No IDE. -# -# * Add support for Status LED -# -# * Optionally panic() to reboot instead of hanging -# -# * Misc bug fixes -# -# * All frequencies in HZ now (internally) -# -# * Add support for BOOTP Domain Name Server Option -# -# Revision 1.1.1.1 2000/11/14 16:54:07 robt -# no message -# -# Revision 1.1.1.1 2000/11/14 14:49:39 robt -# no message -# -# Revision 1.4 1999/05/28 21:23:18 charliem -# First pass at cleaning up DMA interface. This version is verified with -# transfers from and to local memory (M2M). -# -# Revision 1.3 1999/02/13 02:21:02 wyin -# Added DMAStatus enum type for better information exchange. -# -# Revision 1.2 1999/02/05 01:54:51 wyin -# modified to set up soft line for hearder files -# -# Revision 1.1 1999/02/03 18:56:13 wyin -# Base line -# -# Revision 1.12 1998/11/20 01:34:55 wyin -# Added INTMEM function and data structure. -# Enabled DCACHE. -# There is a minor problem with DCACHE, the cache policy had to be write-through. -# Otherwise, when power-on-reset, BlackBox cannot measure the scan chain length. -# But consequence measurement is fine. -# -# ############################################################################ TARGET = libdma.a diff --git a/mpc8240/drivers/dma/Makefile_pc b/mpc8240/drivers/dma/Makefile_pc index 8d8c9b9..8ccd386 100644 --- a/mpc8240/drivers/dma/Makefile_pc +++ b/mpc8240/drivers/dma/Makefile_pc @@ -1,7 +1,7 @@ ########################################################################## # # makefile_pc for use with mksnt tools drivers/dma -# $Id: Makefile_pc,v 1.1 2000/11/20 17:22:32 wdenk Exp $ +# $Id: Makefile_pc,v 1.2 2000/11/23 00:46:21 wdenk Exp $ # Copyright Motorola, Inc. 1997 # ALL RIGHTS RESERVED # @@ -27,55 +27,6 @@ # INFORMATION, OR OTHER PECUNIARY LOSS) ARISING OF THE USE OR # INABILITY TO USE THE SOFTWARE. # -# $Log: Makefile_pc,v $ -# Revision 1.1 2000/11/20 17:22:32 wdenk -# -# * Added support for MBX860T (thanks to Rob Taylor) -# -# * Added support for Sandpoint8240 (thanks to Rob Taylor); this is -# Work In Progress (TM); current status: boots to command line input. -# EPIC code non-functional (interrupts disabled), No net, No IDE. -# -# * Add support for Status LED -# -# * Optionally panic() to reboot instead of hanging -# -# * Misc bug fixes -# -# * All frequencies in HZ now (internally) -# -# * Add support for BOOTP Domain Name Server Option -# -# Revision 1.1.1.1 2000/11/14 16:54:07 robt -# no message -# -# Revision 1.1.1.1 2000/11/14 14:49:39 robt -# no message -# -# Revision 1.1 1999/06/11 20:04:36 maurie -# support for compiling dink on PC -# -# Revision 1.4 1999/05/28 21:23:18 charliem -# First pass at cleaning up DMA interface. This version is verified with -# transfers from and to local memory (M2M). -# -# Revision 1.3 1999/02/13 02:21:02 wyin -# Added DMAStatus enum type for better information exchange. -# -# Revision 1.2 1999/02/05 01:54:51 wyin -# modified to set up soft line for hearder files -# -# Revision 1.1 1999/02/03 18:56:13 wyin -# Base line -# -# Revision 1.12 1998/11/20 01:34:55 wyin -# Added INTMEM function and data structure. -# Enabled DCACHE. -# There is a minor problem with DCACHE, the cache policy had to be write-through. -# Otherwise, when power-on-reset, BlackBox cannot measure the scan chain length. -# But consequence measurement is fine. -# -# ############################################################################ TARGET = libdma.a diff --git a/mpc8240/drivers/i2c/Makefile b/mpc8240/drivers/i2c/Makefile index faf599b..6c21f6a 100644 --- a/mpc8240/drivers/i2c/Makefile +++ b/mpc8240/drivers/i2c/Makefile @@ -1,6 +1,6 @@ ########################################################################## # -# $Id: Makefile,v 1.1 2000/11/20 17:22:33 wdenk Exp $ +# $Id: Makefile,v 1.2 2000/11/23 00:46:21 wdenk Exp $ # # Copyright Motorola, Inc. 1997 # ALL RIGHTS RESERVED @@ -27,54 +27,6 @@ # INFORMATION, OR OTHER PECUNIARY LOSS) ARISING OF THE USE OR # INABILITY TO USE THE SOFTWARE. # -# $Log: Makefile,v $ -# Revision 1.1 2000/11/20 17:22:33 wdenk -# -# * Added support for MBX860T (thanks to Rob Taylor) -# -# * Added support for Sandpoint8240 (thanks to Rob Taylor); this is -# Work In Progress (TM); current status: boots to command line input. -# EPIC code non-functional (interrupts disabled), No net, No IDE. -# -# * Add support for Status LED -# -# * Optionally panic() to reboot instead of hanging -# -# * Misc bug fixes -# -# * All frequencies in HZ now (internally) -# -# * Add support for BOOTP Domain Name Server Option -# -# Revision 1.1.1.1 2000/11/14 16:54:07 robt -# no message -# -# Revision 1.1.1.1 2000/11/14 14:49:39 robt -# no message -# -# Revision 1.4 1999/04/29 13:41:07 charliem -# Capture first pass at modifications to the I2C interface. This version is -# correct, but there are some additional modifications to be implemented. -# Nothing but I2C should be affected. -# -# Revision 1.3 1999/02/11 23:14:58 wyin -# Added MasterRcvAddress variable to handle master receiver address phase -# -# Revision 1.2 1999/02/05 01:55:47 wyin -# modified to set up soft link for hearder files -# compilable version with dink -# -# Revision 1.1 1999/02/03 18:58:32 wyin -# Base line -# -# Revision 1.12 1998/11/20 01:34:55 wyin -# Added INTMEM function and data structure. -# Enabled DCACHE. -# There is a minor problem with DCACHE, the cache policy had to be write-through. -# Otherwise, when power-on-reset, BlackBox cannot measure the scan chain length. -# But consequence measurement is fine. -# -# ############################################################################ TARGET = libi2c.a diff --git a/mpc8240/drivers/i2c/Makefile_pc b/mpc8240/drivers/i2c/Makefile_pc index 5fe9f7e..071e202 100644 --- a/mpc8240/drivers/i2c/Makefile_pc +++ b/mpc8240/drivers/i2c/Makefile_pc @@ -1,7 +1,7 @@ ########################################################################## # # makefile_pc for use with PC mksnt tools dink32/drivers/i2c -# $Id: Makefile_pc,v 1.1 2000/11/20 17:22:33 wdenk Exp $ +# $Id: Makefile_pc,v 1.2 2000/11/23 00:46:21 wdenk Exp $ # # Copyright Motorola, Inc. 1997 # ALL RIGHTS RESERVED @@ -28,57 +28,6 @@ # INFORMATION, OR OTHER PECUNIARY LOSS) ARISING OF THE USE OR # INABILITY TO USE THE SOFTWARE. # -# $Log: Makefile_pc,v $ -# Revision 1.1 2000/11/20 17:22:33 wdenk -# -# * Added support for MBX860T (thanks to Rob Taylor) -# -# * Added support for Sandpoint8240 (thanks to Rob Taylor); this is -# Work In Progress (TM); current status: boots to command line input. -# EPIC code non-functional (interrupts disabled), No net, No IDE. -# -# * Add support for Status LED -# -# * Optionally panic() to reboot instead of hanging -# -# * Misc bug fixes -# -# * All frequencies in HZ now (internally) -# -# * Add support for BOOTP Domain Name Server Option -# -# Revision 1.1.1.1 2000/11/14 16:54:07 robt -# no message -# -# Revision 1.1.1.1 2000/11/14 14:49:39 robt -# no message -# -# Revision 1.1 1999/06/11 20:05:13 maurie -# support for compiling dink on PC -# -# Revision 1.4 1999/04/29 13:41:07 charliem -# Capture first pass at modifications to the I2C interface. This version is -# correct, but there are some additional modifications to be implemented. -# Nothing but I2C should be affected. -# -# Revision 1.3 1999/02/11 23:14:58 wyin -# Added MasterRcvAddress variable to handle master receiver address phase -# -# Revision 1.2 1999/02/05 01:55:47 wyin -# modified to set up soft link for hearder files -# compilable version with dink -# -# Revision 1.1 1999/02/03 18:58:32 wyin -# Base line -# -# Revision 1.12 1998/11/20 01:34:55 wyin -# Added INTMEM function and data structure. -# Enabled DCACHE. -# There is a minor problem with DCACHE, the cache policy had to be write-through. -# Otherwise, when power-on-reset, BlackBox cannot measure the scan chain length. -# But consequence measurement is fine. -# -# ############################################################################ TARGET = libi2c.a diff --git a/mpc8240/drivers/i2c/i2c.h b/mpc8240/drivers/i2c/i2c.h index 2482033..ef6a183 100644 --- a/mpc8240/drivers/i2c/i2c.h +++ b/mpc8240/drivers/i2c/i2c.h @@ -2,65 +2,10 @@ #define I2C_H /**************************************************** - * $Id: i2c.h,v 1.1 2000/11/20 17:22:33 wdenk Exp $ + * $Id: i2c.h,v 1.2 2000/11/23 00:46:21 wdenk Exp $ * * Copyright Motrola 1999 * - * $Log: i2c.h,v $ - * Revision 1.1 2000/11/20 17:22:33 wdenk - * - * * Added support for MBX860T (thanks to Rob Taylor) - * - * * Added support for Sandpoint8240 (thanks to Rob Taylor); this is - * Work In Progress (TM); current status: boots to command line input. - * EPIC code non-functional (interrupts disabled), No net, No IDE. - * - * * Add support for Status LED - * - * * Optionally panic() to reboot instead of hanging - * - * * Misc bug fixes - * - * * All frequencies in HZ now (internally) - * - * * Add support for BOOTP Domain Name Server Option - * - * Revision 1.1.1.1 2000/11/14 16:54:07 robt - * no message - * - * Revision 1.1.1.1 2000/11/14 14:49:39 robt - * no message - * - * Revision 1.7 1999/04/30 16:25:50 charliem - * Change the DINK to I2C_do_transaction interface to allow the application - * to specify the data address as a parameter to I2C_do_transaction, rather - * than putting the data address into the first byte of the buffer. - * There is a work-around in I2C_do_transaction in this version, see comments - * in the i2c1.c code. - * - * Revision 1.6 1999/04/29 13:41:03 charliem - * Capture first pass at modifications to the I2C interface. This version is - * correct, but there are some additional modifications to be implemented. - * Nothing but I2C should be affected. - * - * Revision 1.5 1999/02/12 20:08:28 wyin - * Use I2C's offset as the I2CStatus base value - * - * Revision 1.4 1999/02/12 15:02:23 wyin - * Added I2CADDRESS constant for better information - * exchange to apps. - * - * Revision 1.3 1999/02/10 01:48:27 wyin - * Modified the way of Master Rcv generating STOP. Setting TXAK bit to 1 will - * not automatically generat STOP. BOOK VI is wrong. - * - * Revision 1.2 1999/02/05 01:55:44 wyin - * modified to set up soft link for hearder files - * compilable version with dink - * - * Revision 1.1 1999/02/03 18:58:30 wyin - * Base line - * ****************************************************/ #define I2CADR 0x00003000 diff --git a/mpc8240/drivers/i2c/i2c_export.h b/mpc8240/drivers/i2c/i2c_export.h index 14a6f09..2c3d22a 100644 --- a/mpc8240/drivers/i2c/i2c_export.h +++ b/mpc8240/drivers/i2c/i2c_export.h @@ -2,54 +2,10 @@ #define I2C_EXPORT_H /**************************************************** - * $Id: i2c_export.h,v 1.1 2000/11/20 17:22:33 wdenk Exp $ + * $Id: i2c_export.h,v 1.2 2000/11/23 00:46:21 wdenk Exp $ * * Copyright Motrola 1999 * - * $Log: i2c_export.h,v $ - * Revision 1.1 2000/11/20 17:22:33 wdenk - * - * * Added support for MBX860T (thanks to Rob Taylor) - * - * * Added support for Sandpoint8240 (thanks to Rob Taylor); this is - * Work In Progress (TM); current status: boots to command line input. - * EPIC code non-functional (interrupts disabled), No net, No IDE. - * - * * Add support for Status LED - * - * * Optionally panic() to reboot instead of hanging - * - * * Misc bug fixes - * - * * All frequencies in HZ now (internally) - * - * * Add support for BOOTP Domain Name Server Option - * - * Revision 1.1.1.1 2000/11/14 16:54:07 robt - * no message - * - * Revision 1.1.1.1 2000/11/14 14:49:39 robt - * no message - * - * Revision 1.3 1999/05/03 14:57:54 charliem - * Decouple the I2C library from DINK application source by making the PRINT - * function an optional parameter that is passed to I2C_Inititalize. If the - * function pointer is passed, it is used by the library; otherwise, no print - * output is performed. - * - * Revision 1.2 1999/04/30 16:25:53 charliem - * Change the DINK to I2C_do_transaction interface to allow the application - * to specify the data address as a parameter to I2C_do_transaction, rather - * than putting the data address into the first byte of the buffer. - * There is a work-around in I2C_do_transaction in this version, see comments - * in the i2c1.c code. - * - * Revision 1.1 1999/04/29 13:41:07 charliem - * Capture first pass at modifications to the I2C interface. This version is - * correct, but there are some additional modifications to be implemented. - * Nothing but I2C should be affected. - * - * ****************************************************/ /* These are the defined return values for the I2C_do_transaction function. diff --git a/mpc8240/drivers/i2c_export.h b/mpc8240/drivers/i2c_export.h index 93a4e9d..2c3d22a 100644 --- a/mpc8240/drivers/i2c_export.h +++ b/mpc8240/drivers/i2c_export.h @@ -2,54 +2,10 @@ #define I2C_EXPORT_H /**************************************************** - * $Id: i2c_export.h,v 1.1 2000/11/20 17:22:32 wdenk Exp $ + * $Id: i2c_export.h,v 1.2 2000/11/23 00:46:21 wdenk Exp $ * * Copyright Motrola 1999 * - * $Log: i2c_export.h,v $ - * Revision 1.1 2000/11/20 17:22:32 wdenk - * - * * Added support for MBX860T (thanks to Rob Taylor) - * - * * Added support for Sandpoint8240 (thanks to Rob Taylor); this is - * Work In Progress (TM); current status: boots to command line input. - * EPIC code non-functional (interrupts disabled), No net, No IDE. - * - * * Add support for Status LED - * - * * Optionally panic() to reboot instead of hanging - * - * * Misc bug fixes - * - * * All frequencies in HZ now (internally) - * - * * Add support for BOOTP Domain Name Server Option - * - * Revision 1.1.1.1 2000/11/14 16:54:07 robt - * no message - * - * Revision 1.1.1.1 2000/11/14 14:49:39 robt - * no message - * - * Revision 1.3 1999/05/03 14:57:54 charliem - * Decouple the I2C library from DINK application source by making the PRINT - * function an optional parameter that is passed to I2C_Inititalize. If the - * function pointer is passed, it is used by the library; otherwise, no print - * output is performed. - * - * Revision 1.2 1999/04/30 16:25:53 charliem - * Change the DINK to I2C_do_transaction interface to allow the application - * to specify the data address as a parameter to I2C_do_transaction, rather - * than putting the data address into the first byte of the buffer. - * There is a work-around in I2C_do_transaction in this version, see comments - * in the i2c1.c code. - * - * Revision 1.1 1999/04/29 13:41:07 charliem - * Capture first pass at modifications to the I2C interface. This version is - * correct, but there are some additional modifications to be implemented. - * Nothing but I2C should be affected. - * - * ****************************************************/ /* These are the defined return values for the I2C_do_transaction function. diff --git a/mpc8240/drivers/i2o/Makefile b/mpc8240/drivers/i2o/Makefile index b409f0b..6d6146f 100644 --- a/mpc8240/drivers/i2o/Makefile +++ b/mpc8240/drivers/i2o/Makefile @@ -1,6 +1,6 @@ ########################################################################## # -# $Id: Makefile,v 1.1 2000/11/20 17:22:33 wdenk Exp $ +# $Id: Makefile,v 1.2 2000/11/23 00:46:50 wdenk Exp $ # # Copyright Motorola, Inc. 1997 # ALL RIGHTS RESERVED @@ -27,46 +27,6 @@ # INFORMATION, OR OTHER PECUNIARY LOSS) ARISING OF THE USE OR # INABILITY TO USE THE SOFTWARE. # -# $Log: Makefile,v $ -# Revision 1.1 2000/11/20 17:22:33 wdenk -# -# * Added support for MBX860T (thanks to Rob Taylor) -# -# * Added support for Sandpoint8240 (thanks to Rob Taylor); this is -# Work In Progress (TM); current status: boots to command line input. -# EPIC code non-functional (interrupts disabled), No net, No IDE. -# -# * Add support for Status LED -# -# * Optionally panic() to reboot instead of hanging -# -# * Misc bug fixes -# -# * All frequencies in HZ now (internally) -# -# * Add support for BOOTP Domain Name Server Option -# -# Revision 1.1.1.1 2000/11/14 16:54:07 robt -# no message -# -# Revision 1.1.1.1 2000/11/14 14:49:39 robt -# no message -# -# Revision 1.2 1999/02/05 01:55:54 wyin -# modified to set up soft link for hearder files -# compilable version with dink -# -# Revision 1.1 1999/02/03 18:57:23 wyin -# Base line -# -# Revision 1.12 1998/11/20 01:34:55 wyin -# Added INTMEM function and data structure. -# Enabled DCACHE. -# There is a minor problem with DCACHE, the cache policy had to be write-through. -# Otherwise, when power-on-reset, BlackBox cannot measure the scan chain length. -# But consequence measurement is fine. -# -# ############################################################################ TARGET = libi2o.a diff --git a/mpc8240/drivers/i2o/Makefile_pc b/mpc8240/drivers/i2o/Makefile_pc index 5fd13b6..0fb1f58 100644 --- a/mpc8240/drivers/i2o/Makefile_pc +++ b/mpc8240/drivers/i2o/Makefile_pc @@ -1,7 +1,7 @@ ########################################################################## # # makefile_pc for use with PC mksnt tools dink32/drivers/i2o -# $Id: Makefile_pc,v 1.1 2000/11/20 17:22:33 wdenk Exp $ +# $Id: Makefile_pc,v 1.2 2000/11/23 00:46:50 wdenk Exp $ # # Copyright Motorola, Inc. 1997 # ALL RIGHTS RESERVED @@ -28,49 +28,6 @@ # INFORMATION, OR OTHER PECUNIARY LOSS) ARISING OF THE USE OR # INABILITY TO USE THE SOFTWARE. # -# $Log: Makefile_pc,v $ -# Revision 1.1 2000/11/20 17:22:33 wdenk -# -# * Added support for MBX860T (thanks to Rob Taylor) -# -# * Added support for Sandpoint8240 (thanks to Rob Taylor); this is -# Work In Progress (TM); current status: boots to command line input. -# EPIC code non-functional (interrupts disabled), No net, No IDE. -# -# * Add support for Status LED -# -# * Optionally panic() to reboot instead of hanging -# -# * Misc bug fixes -# -# * All frequencies in HZ now (internally) -# -# * Add support for BOOTP Domain Name Server Option -# -# Revision 1.1.1.1 2000/11/14 16:54:07 robt -# no message -# -# Revision 1.1.1.1 2000/11/14 14:49:39 robt -# no message -# -# Revision 1.1 1999/06/11 20:05:26 maurie -# support for compiling dink on PC -# -# Revision 1.2 1999/02/05 01:55:54 wyin -# modified to set up soft link for hearder files -# compilable version with dink -# -# Revision 1.1 1999/02/03 18:57:23 wyin -# Base line -# -# Revision 1.12 1998/11/20 01:34:55 wyin -# Added INTMEM function and data structure. -# Enabled DCACHE. -# There is a minor problem with DCACHE, the cache policy had to be write-through. -# Otherwise, when power-on-reset, BlackBox cannot measure the scan chain length. -# But consequence measurement is fine. -# -# ############################################################################ TARGET = libi2o.a diff --git a/mpc8xx/fec.c b/mpc8xx/fec.c index 36de2e9..7c2e061 100644 --- a/mpc8xx/fec.c +++ b/mpc8xx/fec.c @@ -57,8 +57,8 @@ static uint txIdx; /* index of the current TX buffer */ */ typedef volatile struct CommonBufferDescriptor { - cbd_t rxbd[PKTBUFSRX]; /* Rx BD */ - cbd_t txbd[TX_BUF_CNT]; /* Tx BD */ + cbd_t rxbd[PKTBUFSRX]; /* Rx BD */ + cbd_t txbd[TX_BUF_CNT]; /* Tx BD */ } RTXBD; static RTXBD *rtx; @@ -69,34 +69,12 @@ int eth_send(volatile void *packet, int length) int i, j=0; volatile immap_t *immr = (immap_t *) CFG_IMMR; volatile fec_t *fecp = &(immr->im_cpm.cp_fec); -#if 0 - volatile char *in, *out; -#endif +printf("%s[%d] %s: addr %p, len %d -- txIdx=%d\n", +__FILE__,__LINE__,__FUNCTION__,packet,length,txIdx); /* section 16.9.23.3 * Wait for ready */ -#if 0 - while (rtx->txbd[txIdx].cbd_sc & BD_ENET_TX_READY); - out = (char *)(rtx->txbd[txIdx].cbd_bufaddr); - in = packet; - for(i = 0; i < length; i++) { - *out++ = *in++; - } - rtx->txbd[txIdx].cbd_datlen = length; - rtx->txbd[txIdx].cbd_sc |= (BD_ENET_TX_READY | BD_ENET_TX_LAST); - while (rtx->txbd[txIdx].cbd_sc & BD_ENET_TX_READY) j++; - -#ifdef ET_DEBUG - printf("%s[%d] %s: cycles: %d status: %x\n", - __FILE__,__LINE__,__FUNCTION__,j,rtx->txbd[txIdx].cbd_sc); -#endif - i = (rtx->txbd[txIdx++].cbd_sc & BD_ENET_TX_STATS) /* return only status bits */; - - /* wrap around buffer index when necessary */ - if (txIdx >= TX_BUF_CNT) txIdx = 0; -#endif - while ((rtx->txbd[txIdx].cbd_sc & BD_ENET_TX_READY) && (jtxbd[txIdx].cbd_sc & BD_ENET_TX_UN) printf("- Underrun\n"); if (rtx->txbd[txIdx].cbd_sc & BD_ENET_TX_CSL) printf("- Carrier lost\n"); if (rtx->txbd[txIdx].cbd_sc & BD_ENET_TX_DEF) printf("- Deferred\n"); } + +printf("%s[%d] %s: tx_bd[%d] @ %p: addr %p len %d\n", +__FILE__,__LINE__,__FUNCTION__,txIdx,&(rtx->txbd[txIdx]), packet, length); rtx->txbd[txIdx].cbd_bufaddr = (uint)packet; rtx->txbd[txIdx].cbd_datlen = length; rtx->txbd[txIdx].cbd_sc |= (BD_ENET_TX_READY | BD_ENET_TX_LAST |BD_ENET_TX_WRAP); + __asm__ ("eieio"); /* Activate transmit Buffer Descriptor polling */ fecp->fec_x_des_active = 0x01000000; /* Descriptor polling active */ while ((rtx->txbd[txIdx].cbd_sc & BD_ENET_TX_READY) && (jtxbd[txIdx]),rtx->txbd[txIdx].cbd_sc); udelay(1); j++; } @@ -131,8 +115,9 @@ if (rtx->txbd[txIdx].cbd_sc & BD_ENET_TX_CSL) printf("- Carrier lost\n"); if (rtx->txbd[txIdx].cbd_sc & BD_ENET_TX_DEF) printf("- Deferred\n"); } #ifdef ET_DEBUG - printf("%s[%d] %s: cycles: %d status: %x\n", - __FILE__,__LINE__,__FUNCTION__,j,rtx->txbd[txIdx].cbd_sc); + printf("%s[%d] %s: cycles: %d status: %x retry cnt: %d\n", + __FILE__,__LINE__,__FUNCTION__,j,rtx->txbd[txIdx].cbd_sc, + (rtx->txbd[txIdx].cbd_sc & 0x003C)>>2); #endif i = (rtx->txbd[txIdx].cbd_sc & BD_ENET_TX_STATS) /* return only status bits */; @@ -146,13 +131,14 @@ int eth_rx(void) volatile immap_t *immr = (immap_t *) CFG_IMMR; volatile fec_t *fecp = &(immr->im_cpm.cp_fec); - /* Try to fill Buffer Descriptors */ - fecp->fec_r_des_active = 0x01000000; /* Descriptor polling active */ - for (;;) { /* section 16.9.23.2 */ if (rtx->rxbd[rxIdx].cbd_sc & BD_ENET_RX_EMPTY) { +#if 0 + printf("%s[%d] %s: status: %x ==> return (-1)\n", + __FILE__,__LINE__,__FUNCTION__,rtx->rxbd[rxIdx].cbd_sc); +#endif length = -1; break; /* nothing received - leave for() loop */ } @@ -163,6 +149,13 @@ int eth_rx(void) #ifdef ET_DEBUG printf("%s[%d] %s: err: %x\n", __FILE__,__LINE__,__FUNCTION__,rtx->rxbd[rxIdx].cbd_sc); +if ((rtx->rxbd[rxIdx].cbd_sc & (BD_ENET_RX_LAST | BD_ENET_RX_OV)) == (BD_ENET_RX_LAST | BD_ENET_RX_OV)) printf("- RX overrun\n"); +if (rtx->rxbd[rxIdx].cbd_sc & BD_ENET_RX_MISS) printf("- MISS flag set\n"); +if (rtx->rxbd[rxIdx].cbd_sc & BD_ENET_RX_LG) printf("- frame too long\n"); +if (rtx->rxbd[rxIdx].cbd_sc & BD_ENET_RX_NO) printf("- nonocted-aligned frame\n"); +if (rtx->rxbd[rxIdx].cbd_sc & BD_ENET_RX_SH) printf("- frame too short\n"); +if (rtx->rxbd[rxIdx].cbd_sc & BD_ENET_RX_CR) printf("- CRC error\n"); +if (rtx->rxbd[rxIdx].cbd_sc & BD_ENET_RX_CL) printf("- frame truncated\n"); #endif } else { /* Pass the packet up to the protocol layers. */ @@ -181,11 +174,13 @@ int eth_rx(void) rtx->rxbd[rxIdx].cbd_sc = BD_ENET_RX_EMPTY; rxIdx++; } + + __asm__ ("eieio"); + + /* Try to fill Buffer Descriptors */ + fecp->fec_r_des_active = 0x01000000; /* Descriptor polling active */ } - /* Try to fill Buffer Descriptors */ - fecp->fec_r_des_active = 0x01000000; /* Descriptor polling active */ -printf("%s[%d] %s: len=%d\n",__FILE__,__LINE__,__FUNCTION__,length); return length; } @@ -199,6 +194,16 @@ printf("%s[%d] %s: len=%d\n",__FILE__,__LINE__,__FUNCTION__,length); #define FEC_ECNTRL_ETHER_EN 0x00000002 #define FEC_ECNTRL_RESET 0x00000001 +#define FEC_RCNTRL_BC_REJ 0x00000010 +#define FEC_RCNTRL_PROM 0x00000008 +#define FEC_RCNTRL_MII_MODE 0x00000004 +#define FEC_RCNTRL_DRT 0x00000002 +#define FEC_RCNTRL_LOOP 0x00000001 + +#define FEC_TCNTRL_FDEN 0x00000004 +#define FEC_TCNTRL_HBC 0x00000002 +#define FEC_TCNTRL_GTS 0x00000001 + #define FEC_RESET_DELAY 50 int eth_init (bd_t * bd) @@ -242,13 +247,15 @@ printf ("Start FEC init\n"); #define ea bd->bi_enetaddr fecp->fec_addr_low = (ea[0] << 24) | (ea[1] << 16) | (ea[2] << 8) | (ea[3] ) ; - fecp->fec_addr_high = (ea[4] << 24) | (ea[5] << 16) ; + fecp->fec_addr_high = (ea[4] << 8) | (ea[5] ) ; #undef ea rxIdx = 0; txIdx = 0; rtx = (RTXBD *) (immr->im_cpm.cp_dpmem + m8xx_cpm_dpbase_align(8)); +printf("%s[%d] %s: rtx = %p\n",__FILE__,__LINE__,__FUNCTION__,rtx); + /* * Setup Receiver Buffer Descriptors (13.14.24.18) * Settings: @@ -294,18 +301,22 @@ printf ("Start FEC init\n"); /* Enable MII mode */ -#if 0 /* Full duplex mode */ - fecp->fec_r_cntrl = 0x04; /* MII enable */ - fecp->fec_x_cntrl = 0x04; /* FD enable */ +#if 1 /* Full duplex mode */ + fecp->fec_r_cntrl = FEC_RCNTRL_MII_MODE; + fecp->fec_x_cntrl = FEC_TCNTRL_FDEN; #else /* Half duplex mode */ - fecp->fec_r_cntrl = 0x06; /* MII enable | No Rcv on Xmit */ - fecp->fec_x_cntrl = 0x00; + fecp->fec_r_cntrl = FEC_RCNTRL_MII_MODE | FEC_RCNTRL_DRT; + fecp->fec_x_cntrl = 0; #endif /* Enable big endian and don't care about SDMA FC. */ fecp->fec_fun_code = 0x78000000; + /* Set MII speed to 2.5 MHz + */ + fecp->fec_mii_speed = ((bd->bi_busfreq * 1000000) / 2500000) & 0x7e; + /* Configure all of port D for MII. */ immr->im_ioport.iop_pdpar = 0x1fff; @@ -317,18 +328,17 @@ printf ("Start FEC init\n"); immr->im_ioport.iop_pddir = 0x1fff; /* Rev. D and later */ } - /* Set MII speed to 2.5 MHz - */ - fecp->fec_mii_speed = ((bd->bi_busfreq * 1000000) / 2500000) & 0x7e; - rxIdx = 0; txIdx = 0; /* And last, enable the transmit and receive processing */ - fecp->fec_ecntrl = 6; + fecp->fec_ecntrl = FEC_ECNTRL_PINMUX | FEC_ECNTRL_ETHER_EN; fecp->fec_r_des_active = 0x01000000; + /* Try to fill Rx Buffer Descriptors */ + fecp->fec_r_des_active = 0x01000000; /* Descriptor polling active */ + printf ("FEC init done\n"); return 1; } diff --git a/mpc8xx/scc.c b/mpc8xx/scc.c index e3b94d3..f2ebdb1 100644 --- a/mpc8xx/scc.c +++ b/mpc8xx/scc.c @@ -71,8 +71,8 @@ static uint txIdx; /* index of the current TX buffer */ */ typedef volatile struct CommonBufferDescriptor { - cbd_t rxbd[PKTBUFSRX]; /* Rx BD */ - cbd_t txbd[TX_BUF_CNT]; /* Tx BD */ + cbd_t rxbd[PKTBUFSRX]; /* Rx BD */ + cbd_t txbd[TX_BUF_CNT]; /* Tx BD */ } RTXBD; static RTXBD *rtx; @@ -179,10 +179,17 @@ int eth_init(bd_t *bis) volatile immap_t *immr = (immap_t *)CFG_IMMR; -#if defined(CONFIG_FADS) && !defined(CONFIG_MPC860T) - *((uint *) BCSR4) &= ~(BCSR4_ETHLOOP|BCSR4_MODEM_EN); - *((uint *) BCSR4) |= BCSR4_TFPLDL|BCSR4_TPSQEL|BCSR4_DATA_VOICE; - *((uint *) BCSR1) &= ~BCSR1_ETHEN; +#if defined(CONFIG_FADS) +#if defined(CONFIG_MPC860T) + /* The FADS860T doesn't use the MODEM_EN or DATA_VOICE signals. */ + *((uint *) BCSR4) &= ~BCSR4_ETHLOOP; + *((uint *) BCSR4) |= BCSR4_TFPLDL|BCSR4_TPSQEL; + *((uint *) BCSR1) &= ~BCSR1_ETHEN; +#else + *((uint *) BCSR4) &= ~(BCSR4_ETHLOOP|BCSR4_MODEM_EN); + *((uint *) BCSR4) |= BCSR4_TFPLDL|BCSR4_TPSQEL|BCSR4_DATA_VOICE; + *((uint *) BCSR1) &= ~BCSR1_ETHEN; +#endif #endif pram_ptr = (scc_enet_t *)&(immr->im_cpm.cp_dparam[PROFF_ENET]); @@ -421,7 +428,7 @@ int eth_init(bd_t *bis) #error Configuration Error: exactly ONE of PB_ENET_TENA, PC_ENET_TENA must be defined #endif -#if defined(CONFIG_FADS) && defined(CONFIG_MPC860T) +#if defined(CONFIG_ADS) && defined(CONFIG_MPC860) /* * Port C is used to control the PHY,MC68160. */ @@ -431,7 +438,7 @@ int eth_init(bd_t *bis) immr->im_ioport.iop_pcdat |= PC_ENET_TPFLDL; immr->im_ioport.iop_pcdat &= ~(PC_ENET_ETHLOOP | PC_ENET_TPSQEL); *((uint *) BCSR1) &= ~BCSR1_ETHEN; -#endif /* FADS860T */ +#endif /* MPC860ADS */ #ifdef CONFIG_MBX board_ether_init(); diff --git a/mpc8xx/status_led.c b/mpc8xx/status_led.c index 6b8d88a..759fb09 100644 --- a/mpc8xx/status_led.c +++ b/mpc8xx/status_led.c @@ -49,7 +49,11 @@ static void status_led_init (void) #ifdef STATUS_LED_ODR immr->STATUS_LED_ODR &= ~(STATUS_LED_BIT); #endif - immr->STATUS_LED_DAT &= ~(STATUS_LED_BIT); /* start with off */ +#if (STATUS_LED_ACTIVE == 0) /* start with LED off */ + immr->STATUS_LED_DAT |= STATUS_LED_BIT ; +#else + immr->STATUS_LED_DAT &= ~(STATUS_LED_BIT); +#endif immr->STATUS_LED_DIR |= STATUS_LED_BIT ; status_led_state = STATUS_LED_BLINKING; status_led_init_done = 1; @@ -83,10 +87,18 @@ void status_led_set (int state) case STATUS_LED_BLINKING: break; case STATUS_LED_ON: - immr->STATUS_LED_DAT |= STATUS_LED_BIT; +#if (STATUS_LED_ACTIVE == 0) + immr->STATUS_LED_DAT &= ~(STATUS_LED_BIT); +#else + immr->STATUS_LED_DAT |= STATUS_LED_BIT ; +#endif break; case STATUS_LED_OFF: +#if (STATUS_LED_ACTIVE == 0) + immr->STATUS_LED_DAT |= STATUS_LED_BIT ; +#else immr->STATUS_LED_DAT &= ~(STATUS_LED_BIT); +#endif break; } status_led_state = state; diff --git a/net/bootp.c b/net/bootp.c index 7711c96..30a9e04 100644 --- a/net/bootp.c +++ b/net/bootp.c @@ -41,7 +41,9 @@ static void BootpVendorFieldProcess(u8 *ext) #ifdef DEBUG_BOOTP_EXT printf("[BOOTP] Processing extension %d... (%d bytes)\n", *ext, *(ext+1)); #endif - + + NetBootFileSize = 0; + switch (*ext) { /* Fixed length fields */ case 1: /* Subnet mask */ @@ -82,8 +84,7 @@ static void BootpVendorFieldProcess(u8 *ext) } break; case 13: /* Boot file size */ - if (NetBootFileSize == 0) - memcpy(&NetBootFileSize, ext+2, size); + memcpy(&NetBootFileSize, ext+2, size); break; case 14: /* Merit dump file - Not yet supported */ break; @@ -271,6 +272,12 @@ static int BootpExtended (u8 *e) e += 32; #endif +#if (CONFIG_BOOTP_MASK & CONFIG_BOOTP_BOOTFILESIZE) + *e++ = 13; /* Boot file size */ + *e++ = 2; + e += 2; +#endif + #if (CONFIG_BOOTP_MASK & CONFIG_BOOTP_NISDOMAIN) *e++ = 40; /* NIS Domain name request */ *e++ = 32; @@ -283,12 +290,6 @@ static int BootpExtended (u8 *e) e += 32; #endif -#if (CONFIG_BOOTP_MASK & CONFIG_BOOTP_BOOTFILESIZE) - *e++ = 13; /* Boot file size */ - *e++ = 4; - e += 4; -#endif - *e = 255; /* End of the list */ return e - start ; diff --git a/net/net.c b/net/net.c index b3e2eb2..9fd82df 100644 --- a/net/net.c +++ b/net/net.c @@ -27,7 +27,7 @@ IPaddr_t NetOurDNSIP=0; /* Our DNS IP address */ char NetOurNISDomain[32]={0,}; /* Our NIS domain */ char NetOurHostName[32]={0,}; /* Our hostname */ char NetOurRootPath[32]={0,}; /* Our bootpath */ -int NetBootFileSize=0; /* Out bootfile size */ +ushort NetBootFileSize=0; /* Out bootfile size in blocks */ /** END OF BOOTP EXTENTIONS **/ @@ -232,7 +232,7 @@ NetSetTimeout(int iv, thand_f * f) void NetSendPacket(volatile uchar * pkt, int len) { - eth_send(pkt, len); + (void) eth_send(pkt, len); } diff --git a/net/tftp.c b/net/tftp.c index 9e60d27..aa7d76d 100644 --- a/net/tftp.c +++ b/net/tftp.c @@ -248,9 +248,10 @@ TftpStart (ulong loadAdr) } if (NetBootFileSize) - printf (" Size is %d%s kB", - NetBootFileSize, - (NetBootFileSize%2) ? ".5" : ""); + printf (" Size is %d%s kB => %x Bytes", + NetBootFileSize/2, + (NetBootFileSize%2) ? ".5" : "", + NetBootFileSize<<9); printf ("\n");