]> www.infradead.org Git - users/rw/ppcboot.git/commitdiff
* Fix Bug in Boot File Size calculation
authorwdenk <wdenk>
Thu, 23 Nov 2000 00:46:20 +0000 (00:46 +0000)
committerwdenk <wdenk>
Thu, 23 Nov 2000 00:46:20 +0000 (00:46 +0000)
* Fix MPC8xxFADS configuration (don't clobber unused port lines;
  thanks to Dave Ellis).

* Remove incorrect change history from some files.

30 files changed:
CHANGELOG
common/board.c
etx094/ppcboot.lds
etx094/ppcboot.lds.debug
include/commproc.h
include/config_ETX094.h
include/config_IVMS8.h
include/config_SPD823TS.h
include/config_TQM823L.h
include/config_TQM850L.h
include/config_TQM855L.h
include/config_TQM860L.h
include/flash.h
include/status_led.h
ivms8/ivms8.c
mpc8240/drivers/dma/Makefile
mpc8240/drivers/dma/Makefile_pc
mpc8240/drivers/i2c/Makefile
mpc8240/drivers/i2c/Makefile_pc
mpc8240/drivers/i2c/i2c.h
mpc8240/drivers/i2c/i2c_export.h
mpc8240/drivers/i2c_export.h
mpc8240/drivers/i2o/Makefile
mpc8240/drivers/i2o/Makefile_pc
mpc8xx/fec.c
mpc8xx/scc.c
mpc8xx/status_led.c
net/bootp.c
net/net.c
net/tftp.c

index 294e31ed5da62e6602099fd19a0f18b4ce98ef9f..f9372ff9391a727a8be3ebbbcba420b49a2d14cf 100644 (file)
--- 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:
 ======================================================================
index 6540fcaa13accd721f4bdd92c55e3621e41f2233..d01f06ed71a3a353eb2f743c89c40f222001319f 100644 (file)
@@ -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
 
index 045ecacc1cea8d78605592622e4d97506bf1036a..c516d76ba302ca63f4398247585b582edd9be9e2 100644 (file)
@@ -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 = .;
index 3bae091b467d9c32fd55b6c3a6d58eaa867ea130..2f3b2e26a0bdaa416203d4837383ef86cf1e69ba 100644 (file)
@@ -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 = .;
index e6ba1fc5425356ef93664d09f0b2aee5f5008c64..b76471af95a83c4cfb32db3705c407fd0fe0afe9 100644 (file)
@@ -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  **********************************************************/
index 5324169638dfad3a4490a6e9162c30626a1df8c2..2206b7b29464a10d380292564a87a807012f0cc3 100644 (file)
@@ -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
 #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 <cmd_confdefs.h>
  * 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
  */
index b038861466c085feb0b61d56e23c7e960312689b..204381cb51453941726f0bb6728e2eff2913cc75 100644 (file)
 #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 <cmd_confdefs.h>
index f467da5e6686a152f6a0aac2c7bdc59eb95be021..3fb80e2a56915e68e45549a0bfe161c0dd68f6a9 100644 (file)
@@ -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 <cmd_confdefs.h>
index 072a1dccbe74b001bceaa97702485d736944251d..35847a908e262e101035f7176d675ef5baace688 100644 (file)
@@ -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 <cmd_confdefs.h>
index 9f01771b29a6b6e574bc3c1325a02c9a2d4ac3db..fdf004879b447e2bbc9c5cb433e213446164a803 100644 (file)
@@ -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 <cmd_confdefs.h>
index c3376238ab5f8a9d17f7edd4b909b623a8c0ceaf..c2735def53e58c48cbadfe9855252ea9c806ec9d 100644 (file)
@@ -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 <cmd_confdefs.h>
index 21e081a3085c785b86f628044bc16e8f16c903a0..d453d7c776879d90d07443b658313ef95107e96c 100644 (file)
@@ -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 <cmd_confdefs.h>
index 088dfd31cdfcdd7b262d454ccda73d00007fc46b..cf96554e1a824d51244400673bcba675b1d5c158 100644 (file)
@@ -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 )   */
index 8c97cb67b4f525b6271c6f7e26b245eabab80fcf..14e9560f89f9e147f6f0495f1c8ddeecb9fe2a96 100644 (file)
 
 #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_ */
index 4e77c6e5094cdb682b8b028d6fbfd4d70f835df6..9d16f0e5eb7cc43532df9a874a784826c76bda38 100644 (file)
@@ -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
index ae2df2f96ebb00b254f28ac47798a1109fe70744..3e72c7d21f003999a651e15c422463d4c2c159f6 100644 (file)
@@ -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
 #       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
 
index 8d8c9b908a950fe5f88c987f21bfd0581afd0822..8ccd38630c41b231806481c734e3250dbe81daeb 100644 (file)
@@ -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
 #
 #       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
 
index faf599b32b47d1e3ef20dddff1ba29b0681f1134..6c21f6a33ec28547a3f25ee633944112af7e67ad 100644 (file)
@@ -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
 #       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
 
index 5fe9f7e324eba9b46eaafacc9060db9203c7e71e..071e2025e4e1081d535a4bcb70b65443bfdf45f3 100644 (file)
@@ -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
 #       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
 
index 24820334aed6e075ae47379d0ea822d77f1af26c..ef6a183ef6d575795998da25deae3c4fc7d2cace 100644 (file)
@@ -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
index 14a6f09654de3d4e93f9d22e5eb8d069257be414..2c3d22a4006dfbd6be7419c3bfab0d0db7609ef2 100644 (file)
@@ -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.
index 93a4e9d0dee776c408476d9dacd27fcc9041478d..2c3d22a4006dfbd6be7419c3bfab0d0db7609ef2 100644 (file)
@@ -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.
index b409f0b4817c3ea03328b2d02adae3e92135ba57..6d6146f20a7855e8a17dcce3dd795b596f27590f 100644 (file)
@@ -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
 #       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
 
index 5fd13b6bf68d910f8f9a40846748848615c705d2..0fb1f58ccfefb6ea1144bbeeb5d8e89eeb211d67 100644 (file)
@@ -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
 #       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
 
index 36de2e9f196a49cf74310b88f5350f4d4f5fcdb3..7c2e0618f110769562046a8b4493040835043776 100644 (file)
@@ -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) && (j<TOUT_LOOP)) {
                udelay(1);
                j++;
@@ -110,14 +88,20 @@ if (rtx->txbd[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) && (j<TOUT_LOOP)) {
+printf("%s[%d] %s: tx_bd[%d] @ %p: sc=%04x\n",
+__FILE__,__LINE__,__FUNCTION__,txIdx,&(rtx->txbd[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;
 }
index e3b94d36c7a21622620d62dbb4896faefd2d9f7d..f2ebdb194b991476d4e527a3fae9c447b502ca08 100644 (file)
@@ -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();
index 6b8d88aed5a6b9b48fb76534a22deebf9d294187..759fb097b5587c36f62b1a2562cbb4fca80eafb5 100644 (file)
@@ -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;
index 7711c96c7e471175cf5a6ed975ecae061453699b..30a9e04a81dd8c434b5be4aa352cb61a719e5de4 100644 (file)
@@ -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 ;
index b3e2eb23521782f74c35f3d9075ef397d81e3e79..9fd82dfb54599e656b1a9861c6cb625dfc5b6111 100644 (file)
--- 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);
 }
 
 
index 9e60d27a29bfc183e6c01c48bfdffe10ef60685b..aa7d76d409eb373a15eb902ad6bc68aa3e6f8879 100644 (file)
@@ -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");