* "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:
======================================================================
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
. = env_offset;
common/environment.o(.text)
-
*(.text)
*(.fixup)
*(.got1)
.dtors : { *(.dtors) }
/* Read-write section, merged into data segment: */
- . = (. + 0x0FFF) & 0xFFFFF000;
+ . = (. + 0x00FF) & 0xFFFFFF00;
_erotext = .;
PROVIDE (erotext = .);
.reloc :
__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 = .;
ppc/string.o (.text)
ppc/crc32.o (.text)
common/dlmalloc.o (.text)
-
. = env_offset;
common/environment.o(.text)
.dtors : { *(.dtors) }
/* Read-write section, merged into data segment: */
- . = (. + 0x0FFF) & 0xFFFFF000;
+ . = (. + 0x00FF) & 0xFFFFFF00;
_erotext = .;
PROVIDE (erotext = .);
.reloc :
__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 = .;
#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 ********************************************************/
#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 **********************************************************/
#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 */
#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
*/
#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>
#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>
#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>
#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>
#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>
#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>
#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 ) */
#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
# 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
void status_led_tick (unsigned long timestamp);
void status_led_set (int state);
-
#endif /* CONFIG_STATUS_LED */
+
#endif /* _STATUS_LED_H_ */
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 */
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
##########################################################################
#
-# $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
##########################################################################
#
# 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
##########################################################################
#
-# $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
##########################################################################
#
# 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
#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
#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.
#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.
##########################################################################
#
-# $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
##########################################################################
#
# 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
*/
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;
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++;
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++;
}
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 */;
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 */
}
#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. */
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;
}
#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)
#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:
/* 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;
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;
}
*/
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;
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]);
#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.
*/
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();
#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;
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;
#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 */
}
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;
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;
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 ;
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 **/
void
NetSendPacket(volatile uchar * pkt, int len)
{
- eth_send(pkt, len);
+ (void) eth_send(pkt, len);
}
}
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");