From: wdenk Date: Sun, 1 Apr 2001 23:35:03 +0000 (+0000) Subject: * Cleanup of 8xx specific #includes, Makefiles, ... X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=0594e39e578929e86fe9f1a20dc8411038217130;p=users%2Frw%2Fppcboot.git * Cleanup of 8xx specific #includes, Makefiles, ... * Fix console on SCC3 for MPC850 systems (Patch by Dr. Bruno Achauer, 31 Mar 2001) * Work in progress on LWMON board --- diff --git a/CHANGELOG b/CHANGELOG index e49a3b9..16393ba 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -61,6 +61,11 @@ To do: Modifications for 0.9.0: ====================================================================== +* Cleanup of 8xx specific #includes, Makefiles, ... + +* Fix console on SCC3 for MPC850 systems + (Patch by Dr. Bruno Achauer, 31 Mar 2001) + * Added support for DOS partitions * Fix get_bus_freq() for ppc4xx - returned MHz instead of Hz diff --git a/MAKEALL b/MAKEALL index 2d63506..c8eff6f 100755 --- a/MAKEALL +++ b/MAKEALL @@ -23,11 +23,13 @@ LIST="$LIST \ FADS823 FADS850SAR FADS860T ADS860 \ cogent_mpc8xx \ GENIETV \ - MBX MBX860T \ + MBX \ RPXlite \ GTH \ " +# MBX860T disabled for now, file `include/config_MBX860T.h' is missing + ######################################################################### ## PPC4xx Systems ######################################################################### diff --git a/Makefile b/Makefile index ad19514..a17d5bb 100644 --- a/Makefile +++ b/Makefile @@ -109,6 +109,14 @@ unconfig: ## MPC8xx Systems ######################################################################### +LANTEC_config : unconfig + @echo "Configuring for $(@:_config=) Board..." ; \ + cd include ; \ + echo "ARCH = ppc" > config.mk ; \ + echo "BOARD = lantec" >>config.mk ; \ + echo "CPU = mpc8xx" >>config.mk ; \ + echo "#include " >config.h + TQM823L_config \ TQM850L_config \ FPS850L_config \ @@ -142,24 +150,24 @@ SPD823TS_config: unconfig cd include ; \ echo "ARCH = ppc" > config.mk ; \ echo "BOARD = spd8xx" >>config.mk ; \ - echo "CPU = mpc8xx" >>config.mk ; \ - echo "#include " >config.h + echo "CPU = mpc8xx" >>config.mk ; \ + echo "#include " >config.h IVMS8_config: unconfig @echo "Configuring for $(@:_config=) Board..." ; \ cd include ; \ echo "ARCH = ppc" > config.mk ; \ echo "BOARD = ivms8" >>config.mk ; \ - echo "CPU = mpc8xx" >>config.mk ; \ - echo "#include " >config.h + echo "CPU = mpc8xx" >>config.mk ; \ + echo "#include " >config.h IVML24_config: unconfig @echo "Configuring for $(@:_config=) Board..." ; \ cd include ; \ echo "ARCH = ppc" > config.mk ; \ echo "BOARD = ivms8" >>config.mk ; \ - echo "CPU = mpc8xx" >>config.mk ; \ - echo "#include " >config.h + echo "CPU = mpc8xx" >>config.mk ; \ + echo "#include " >config.h hermes_config : unconfig @echo "Configuring for $(@:_config=) Board..." ; \ @@ -371,7 +379,7 @@ GTH_config: unconfig clean: rm -f `find . -type f \ - \( -name 'core' -o -name '*.bak' \ + \( -name 'core' -o -name '*.bak' -o -name '*~' \ -o -name '*.o' -o -name '*.a' \) -print` rm -f examples/hello_world examples/timer rm -f tools/img2srec tools/mkimage tools/envcrc tools/gen_eth_addr @@ -385,6 +393,7 @@ clobber: clean rm -f $(OBJS) *.bak tags rm -fr *.*~ rm -f ppcboot ppcboot.bin ppcboot.elf ppcboot.srec ppcboot.map + rm -f tools/crc32.c tools/environment.S distclean: clobber unconfig diff --git a/board/lwmon/eeprom.c b/board/lwmon/eeprom.c index 56c2ecf..b756441 100644 --- a/board/lwmon/eeprom.c +++ b/board/lwmon/eeprom.c @@ -298,19 +298,19 @@ void eeprom_read (unsigned offset, uchar *buffer, unsigned cnt) #ifndef CONFIG_I2C_X blk_num = (offset + i) >> 8; blk_off = (offset + i) & 0xFF; - write_addr (CFG_EEPROM_ADDR, blk_num); + write_addr (CFG_I2C_EEPROM_ADDR, blk_num); write_byte (blk_off); #else blk_num = (offset + i) >> 16; /* addr selectors */ blk_off = (offset + i) & 0xFFFF;/* 16-bit address in EEPROM */ - write_addr (CFG_EEPROM_ADDR, blk_num); + write_addr (CFG_I2C_EEPROM_ADDR, blk_num); write_byte (blk_off >> 8); /* upper address octet */ write_byte (blk_off & 0xff); /* lower address octet */ #endif /* CONFIG_I2C_X */ send_start (); - read_addr (CFG_EEPROM_ADDR, blk_num); + read_addr (CFG_I2C_EEPROM_ADDR, blk_num); /* Read data until done or would cross a page boundary. * We must write the address again when changing pages @@ -343,13 +343,13 @@ void eeprom_write (unsigned offset, uchar *buffer, unsigned cnt) blk_num = (offset + i) >> 8; blk_off = (offset + i) & 0xFF; - write_addr (CFG_EEPROM_ADDR, blk_num); + write_addr (CFG_I2C_EEPROM_ADDR, blk_num); write_byte (blk_off); #else blk_num = (offset + i) >> 16; /* addr selectors */ blk_off = (offset + i) & 0xFFFF;/* 16-bit address in EEPROM */ - write_addr (CFG_EEPROM_ADDR, blk_num); + write_addr (CFG_I2C_EEPROM_ADDR, blk_num); write_byte (blk_off >> 8); /* upper address octet */ write_byte (blk_off & 0xff); /* lower address octet */ #endif /* CONFIG_I2C_X */ @@ -375,28 +375,50 @@ void eeprom_write (unsigned offset, uchar *buffer, unsigned cnt) /*----------------------------------------------------------------------- * Test: Enable Ethernet */ -#define CFG_PICIO_ADDR 0x57 uchar pic_read (uchar reg) { uchar c; eeprom_init (); - write_addr (CFG_PICIO_ADDR, 0); + write_addr (CFG_I2C_PICIO_ADDR, 0); write_byte (reg); send_start (); - read_addr (CFG_PICIO_ADDR, 0); + read_addr (CFG_I2C_PICIO_ADDR, 0); c = read_byte(1); send_stop (); return (c); } void pic_write (uchar reg, uchar val) { - write_addr (CFG_PICIO_ADDR, 0); + write_addr (CFG_I2C_PICIO_ADDR, 0); write_byte (reg); write_byte (val); send_stop (); } +/*----------------------------------------------------------------------- + * Test: + */ +uchar x_i2c_read (uchar addr) +{ + uchar c; + + eeprom_init (); + + send_start (); + read_addr (addr, 0); + c = read_byte(1); + send_stop (); + return (c); +} + +void x_i2c_write (uchar addr, uchar val) +{ + write_addr (addr, 0); + write_byte (val); + send_stop (); +} + /*----------------------------------------------------------------------- */ diff --git a/common/cmd_eeprom.c b/common/cmd_eeprom.c index fa4ec7b..78859dc 100644 --- a/common/cmd_eeprom.c +++ b/common/cmd_eeprom.c @@ -22,11 +22,9 @@ * */ -#include #include #include #include -#include #if (CONFIG_COMMANDS & CFG_CMD_EEPROM) diff --git a/common/cmd_ide.c b/common/cmd_ide.c index a91091d..50f9343 100644 --- a/common/cmd_ide.c +++ b/common/cmd_ide.c @@ -25,22 +25,23 @@ /* * IDE support */ -#include #include #include #include #include #ifdef CONFIG_IDE_PCMCIA -#include +# include +# ifdef CONFIG_8xx +# include +# endif #endif #include #include #include #include #include -#include #ifdef CONFIG_STATUS_LED -#include +# include #endif /* stdlib.h causes some compatibility problems; should fixe these! -- wd */ diff --git a/common/cmd_pcmcia.c b/common/cmd_pcmcia.c index 1069785..2e49fc1 100644 --- a/common/cmd_pcmcia.c +++ b/common/cmd_pcmcia.c @@ -51,13 +51,14 @@ /* * PCMCIA support */ -#include #include #include #include #include #include +#if defined(CONFIG_IDE_PCCARD) && defined(CONFIG_8xx) #include +#endif #if (CONFIG_COMMANDS & CFG_CMD_PCMCIA) || \ ((CONFIG_COMMANDS & CFG_CMD_IDE) && defined(CONFIG_IDE_PCCARD)) @@ -97,6 +98,8 @@ const char *indent = "\t "; /* ------------------------------------------------------------------------- */ +#undef DEBUG + #ifdef DEBUG #define PCMCIA_DEBUG(fmt,args...) do { printf (fmt ,##args); } while (0) #else @@ -129,6 +132,12 @@ void do_pinit (cmd_tbl_t *cmdtp, bd_t *bd, int flag, int argc, char *argv[]) /* ------------------------------------------------------------------------- */ +#if defined(CONFIG_LWMON) +# define CFG_PCMCIA_TIMING (PCMCIA_SHT(9) | PCMCIA_SST(3) | PCMCIA_SL(12)) +#else +# define CFG_PCMCIA_TIMING (PCMCIA_SHT(2) | PCMCIA_SST(4) | PCMCIA_SL(9)) +#endif + int pcmcia_on (void) { int i; @@ -158,7 +167,7 @@ int pcmcia_on (void) | PCMCIA_PRS_ATTR | PCMCIA_SLOT_x | PCMCIA_PV - | 0x00024480 ); /* fixed access timing */ + | CFG_PCMCIA_TIMING ); break; } @@ -168,7 +177,7 @@ int pcmcia_on (void) | PCMCIA_PRS_IO | PCMCIA_SLOT_x | PCMCIA_PV - | 0x00024480 ); /* fixed access timing */ + | CFG_PCMCIA_TIMING ); break; } @@ -178,16 +187,17 @@ int pcmcia_on (void) | PCMCIA_PRS_IO | PCMCIA_SLOT_x | PCMCIA_PV - | 0x00024480 ); /* fixed access timing */ + | CFG_PCMCIA_TIMING ); break; } -#endif +#endif /* CONFIG_IDE_PCCARD */ default: /* set to not valid */ win->or = 0; break; } - PCMCIA_DEBUG ("MemWin %d: Base 0x%08lX\n", i, base); + PCMCIA_DEBUG ("MemWin %d: PBR 0x%08lX POR %08lX\n", + i, win->br, win->or); base += CFG_PCMCIA_MEM_SIZE; ++win; } @@ -263,7 +273,7 @@ static int check_ide_device (void) int found = 0; int i; - PCMCIA_DEBUG ("PCMCIA MEM: %08lX\n", CFG_PCMCIA_MEM_ADDR); + PCMCIA_DEBUG ("PCMCIA MEM: %08X\n", CFG_PCMCIA_MEM_ADDR); start = p = (volatile uchar *) CFG_PCMCIA_MEM_ADDR; @@ -500,10 +510,11 @@ static int hardware_disable(int slot) # endif #endif -#ifdef CONFIG_TQM8xxL +#if defined(CONFIG_TQM8xxL) #define PCMCIA_BOARD_MSG "TQM8xxL" + static int hardware_enable(int slot) { volatile immap_t *immap; @@ -512,7 +523,9 @@ static int hardware_enable(int slot) volatile sysconf8xx_t *sysp; uint reg, mask; - PCMCIA_DEBUG ("hardware_enable: TQM8xxL Slot %c\n", 'A'+slot); + PCMCIA_DEBUG ("hardware_enable: " PCMCIA_BOARD_MSG " Slot %c\n", 'A'+slot); + + udelay(10000); immap = (immap_t *)CFG_IMMR; sysp = (sysconf8xx_t *)(&(((immap_t *)CFG_IMMR)->im_siu_conf)); @@ -610,7 +623,7 @@ static int hardware_disable(int slot) volatile pcmconf8xx_t *pcmp; u_long reg; - PCMCIA_DEBUG ("hardware_disable: TQM8xxL Slot %c\n", 'A'+slot); + PCMCIA_DEBUG ("hardware_disable: " PCMCIA_BOARD_MSG " Slot %c\n", 'A'+slot); immap = (immap_t *)CFG_IMMR; pcmp = (pcmconf8xx_t *)(&(((immap_t *)CFG_IMMR)->im_pcmcia)); @@ -627,6 +640,8 @@ static int hardware_disable(int slot) reg |= __MY_PCMCIA_GCRX_CXOE; /* active low */ PCMCIA_PGCRX(_slot_) = reg; + udelay(10000); + return (0); } #endif /* CFG_CMD_PCMCIA */ @@ -639,7 +654,9 @@ static int voltage_set(int slot, int vcc, int vpp) volatile pcmconf8xx_t *pcmp; u_long reg; - PCMCIA_DEBUG ("voltage_set: TQM8xxL Slot %c, Vcc=%d.%d, Vpp=%d.%d\n", + PCMCIA_DEBUG ("voltage_set: " \ + PCMCIA_BOARD_MSG \ + " Slot %c, Vcc=%d.%d, Vpp=%d.%d\n", 'A'+slot, vcc/10, vcc%10, vpp/10, vcc%10); immap = (immap_t *)CFG_IMMR; @@ -696,12 +713,247 @@ done: PCMCIA_PGCRX(_slot_) = reg; udelay(500); - PCMCIA_DEBUG ("voltage_set: TQM8xxL Slot %c, DONE\n", slot+'A'); + PCMCIA_DEBUG ("voltage_set: " PCMCIA_BOARD_MSG " Slot %c, DONE\n", + slot+'A'); return (0); } #endif /* TQM8xxL */ + +/* ---------------------------------------------------------------------------- */ +/* LWMON Board */ +/* ---------------------------------------------------------------------------- */ + +#if defined(CONFIG_LWMON) + +#define PCMCIA_BOARD_MSG "LWMON" + +/* #define's for MAX1604 Power Switch */ +#define MAX1604_OP_SUS 0x80 +#define MAX1604_VCCBON 0x40 +#define MAX1604_VCC_35 0x20 +#define MAX1604_VCCBHIZ 0x10 +#define MAX1604_VPPBON 0x08 +#define MAX1604_VPPBPBPGM 0x04 +#define MAX1604_VPPBHIZ 0x02 +/* reserved 0x01 */ + +extern void x_i2c_write (uchar, uchar); + +static int hardware_enable(int slot) +{ + volatile immap_t *immap; + volatile cpm8xx_t *cp; + volatile pcmconf8xx_t *pcmp; + volatile sysconf8xx_t *sysp; + uint reg, mask; + uchar val; + + + PCMCIA_DEBUG ("hardware_enable: " PCMCIA_BOARD_MSG " Slot %c\n", 'A'+slot); + + /* Switch on PCMCIA port in PIC register 0x60 */ + reg = pic_read (0x60); + PCMCIA_DEBUG ("[%d] PIC read: reg_60 = 0x%02x\n", __LINE__, reg); + reg &= ~0x10; + /* reg |= 0x08; Vpp not needed */ + pic_write (0x60, reg); +#ifdef DEBUG + reg = pic_read (0x60); + printf ("[%d] PIC read: reg_60 = 0x%02x\n", __LINE__, reg); +#endif + udelay(10000); + + immap = (immap_t *)CFG_IMMR; + sysp = (sysconf8xx_t *)(&(((immap_t *)CFG_IMMR)->im_siu_conf)); + pcmp = (pcmconf8xx_t *)(&(((immap_t *)CFG_IMMR)->im_pcmcia)); + cp = (cpm8xx_t *)(&(((immap_t *)CFG_IMMR)->im_cpm)); + + /* + * Configure SIUMCR to enable PCMCIA port B + * (VFLS[0:1] are not used for debugging, we connect FRZ# instead) + */ + sysp->sc_siumcr &= ~SIUMCR_DBGC11; /* set DBGC to 00 */ + + /* clear interrupt state, and disable interrupts */ + pcmp->pcmc_pscr = PCMCIA_MASK(_slot_); + pcmp->pcmc_per &= ~PCMCIA_MASK(_slot_); + + /* disable interrupts & DMA */ + PCMCIA_PGCRX(_slot_) = 0; + + /* + * Disable PCMCIA buffers (isolate the interface) + * and assert RESET signal + */ + PCMCIA_DEBUG ("Disable PCMCIA buffers and assert RESET\n"); + reg = PCMCIA_PGCRX(_slot_); + reg |= __MY_PCMCIA_GCRX_CXRESET; /* active high */ + reg |= __MY_PCMCIA_GCRX_CXOE; /* active low */ + PCMCIA_PGCRX(_slot_) = reg; + udelay(500); + + /* + * Make sure there is a card in the slot, then configure the interface. + */ + udelay(10000); + PCMCIA_DEBUG ("[%d] %s: PIPR(%p)=0x%x\n", + __LINE__,__FUNCTION__, + &(pcmp->pcmc_pipr),pcmp->pcmc_pipr); + if (pcmp->pcmc_pipr & 0x00001800) { + printf (" No Card found\n"); + return (1); + } + + /* + * Power On. + */ + mask = PCMCIA_VS1(slot) | PCMCIA_VS2(slot); + reg = pcmp->pcmc_pipr; + PCMCIA_DEBUG ("PIPR: 0x%x ==> VS1=o%s, VS2=o%s\n", + reg, + (reg&PCMCIA_VS1(slot))?"n":"ff", + (reg&PCMCIA_VS2(slot))?"n":"ff"); + if ((reg & mask) == mask) { + val = 0; /* VCCB3/5 = 0 ==> use Vx = 5.0 V */ + puts (" 5.0V card found: "); + } else { + val = MAX1604_VCC_35; /* VCCB3/5 = 1 ==> use Vy = 3.3 V */ + puts (" 3.3V card found: "); + } + + /* switch VCC on */ + val |= MAX1604_OP_SUS | MAX1604_VCCBON; + x_i2c_write (CFG_I2C_POWER_A_ADDR, val); + + udelay(500000); + + PCMCIA_DEBUG ("Enable PCMCIA buffers and stop RESET\n"); + reg = PCMCIA_PGCRX(_slot_); + reg &= ~__MY_PCMCIA_GCRX_CXRESET; /* active high */ + reg &= ~__MY_PCMCIA_GCRX_CXOE; /* active low */ + PCMCIA_PGCRX(_slot_) = reg; + + udelay(250000); /* some cards need >150 ms to come up :-( */ + + PCMCIA_DEBUG ("# hardware_enable done\n"); + + return (0); +} + + + +#if (CONFIG_COMMANDS & CFG_CMD_PCMCIA) +static int hardware_disable(int slot) +{ + volatile immap_t *immap; + volatile pcmconf8xx_t *pcmp; + u_long reg; + + PCMCIA_DEBUG ("hardware_disable: " PCMCIA_BOARD_MSG " Slot %c\n", 'A'+slot); + + immap = (immap_t *)CFG_IMMR; + pcmp = (pcmconf8xx_t *)(&(((immap_t *)CFG_IMMR)->im_pcmcia)); + + /* remove all power, put output in high impedance state */ + x_i2c_write (CFG_I2C_POWER_A_ADDR, MAX1604_VCCBHIZ | MAX1604_VPPBHIZ); + + /* Configure PCMCIA General Control Register */ + PCMCIA_PGCRX(_slot_) = 0; + + PCMCIA_DEBUG ("Disable PCMCIA buffers and assert RESET\n"); + reg = PCMCIA_PGCRX(_slot_); + reg |= __MY_PCMCIA_GCRX_CXRESET; /* active high */ + reg |= __MY_PCMCIA_GCRX_CXOE; /* active low */ + PCMCIA_PGCRX(_slot_) = reg; + + /* Switch off PCMCIA port in PIC register 0x60 */ + reg = pic_read (0x60); + PCMCIA_DEBUG ("[%d] PIC read: reg_60 = 0x%02x\n", __LINE__, reg); + reg |= 0x10; + reg &= ~0x08; + pic_write (0x60, reg); +#ifdef DEBUG + reg = pic_read (0x60); + printf ("[%d] PIC read: reg_60 = 0x%02x\n", __LINE__, reg); +#endif + udelay(10000); + + return (0); +} +#endif /* CFG_CMD_PCMCIA */ + + + +static int voltage_set(int slot, int vcc, int vpp) +{ + volatile immap_t *immap; + volatile pcmconf8xx_t *pcmp; + u_long reg; + uchar val; + + PCMCIA_DEBUG ("voltage_set: " \ + PCMCIA_BOARD_MSG \ + " Slot %c, Vcc=%d.%d, Vpp=%d.%d\n", + 'A'+slot, vcc/10, vcc%10, vpp/10, vcc%10); + + immap = (immap_t *)CFG_IMMR; + pcmp = (pcmconf8xx_t *)(&(((immap_t *)CFG_IMMR)->im_pcmcia)); + /* + * Disable PCMCIA buffers (isolate the interface) + * and assert RESET signal + */ + PCMCIA_DEBUG ("Disable PCMCIA buffers and assert RESET\n"); + reg = PCMCIA_PGCRX(_slot_); + reg |= __MY_PCMCIA_GCRX_CXRESET; /* active high */ + reg |= __MY_PCMCIA_GCRX_CXOE; /* active low */ + PCMCIA_PGCRX(_slot_) = reg; + udelay(500); + + /* + * Turn off all power (switch to high impedance) + */ + PCMCIA_DEBUG ("PCMCIA power OFF\n"); + x_i2c_write (CFG_I2C_POWER_A_ADDR, MAX1604_VCCBHIZ | MAX1604_VPPBHIZ); + + val = 0; + switch(vcc) { + case 0: break; + case 33: val = MAX1604_VCC_35; break; + case 50: break; + default: goto done; + } + + /* Checking supported voltages */ + + PCMCIA_DEBUG ("PIPR: 0x%x --> %s\n", + pcmp->pcmc_pipr, + (pcmp->pcmc_pipr & 0x00008000) ? "only 5 V" : "can do 3.3V"); + + x_i2c_write (CFG_I2C_POWER_A_ADDR, val); + if (val) { + PCMCIA_DEBUG ("PCMCIA powered at %sV\n", + (val & MAX1604_VCC_35) ? "3.3" : "5.0"); + } else { + PCMCIA_DEBUG ("PCMCIA powered down\n"); + } + +done: + PCMCIA_DEBUG ("Enable PCMCIA buffers and stop RESET\n"); + reg = PCMCIA_PGCRX(_slot_); + reg &= ~__MY_PCMCIA_GCRX_CXRESET; /* active high */ + reg &= ~__MY_PCMCIA_GCRX_CXOE; /* active low */ + PCMCIA_PGCRX(_slot_) = reg; + udelay(500); + + PCMCIA_DEBUG ("voltage_set: " PCMCIA_BOARD_MSG " Slot %c, DONE\n", + slot+'A'); + return (0); +} + +#endif /* LWMON */ + /* ---------------------------------------------------------------------------- */ /* GTH board by Corelatus AB */ /* ---------------------------------------------------------------------------- */ diff --git a/common/cmd_reginfo.c b/common/cmd_reginfo.c index 74a8dc3..f7c7f6f 100644 --- a/common/cmd_reginfo.c +++ b/common/cmd_reginfo.c @@ -24,7 +24,9 @@ #include #include #include +#if defined(CONFIG_8xx) #include +#endif #if defined(CONFIG_8xx) && (CONFIG_COMMANDS & CFG_CMD_REGINFO) diff --git a/cpu/mpc8260/commproc.c b/cpu/mpc8260/commproc.c index 04fc9a2..0077436 100644 --- a/cpu/mpc8260/commproc.c +++ b/cpu/mpc8260/commproc.c @@ -62,6 +62,7 @@ m8260_cpm_reset(void) uint m8260_cpm_dpalloc(uint size, uint align) { + volatile immap_t *immr = (immap_t *)CFG_IMMR; uint retloc; uint align_mask, off; uint savebase; @@ -86,7 +87,7 @@ m8260_cpm_dpalloc(uint size, uint align) retloc = idata->dp_alloc_base; idata->dp_alloc_base += size; - memset((void *)retloc, 0, size); + memset((void *)&immr->im_dprambase[retloc], 0, size); return(retloc); } diff --git a/cpu/mpc8xx/cpu_init.c b/cpu/mpc8xx/cpu_init.c index 9f0cad3..24d9196 100644 --- a/cpu/mpc8xx/cpu_init.c +++ b/cpu/mpc8xx/cpu_init.c @@ -135,6 +135,9 @@ cpu_init_f (volatile immap_t *immr) #if defined(CFG_OR1_REMAP) memctl->memc_or1 = CFG_OR1_REMAP; #endif +#if defined(CFG_OR5_REMAP) + memctl->memc_or5 = CFG_OR5_REMAP; +#endif /* now restrict to preliminary range */ memctl->memc_br0 = CFG_BR0_PRELIM; @@ -144,6 +147,10 @@ cpu_init_f (volatile immap_t *immr) memctl->memc_or1 = CFG_OR1_PRELIM; memctl->memc_br1 = CFG_BR1_PRELIM; #endif +#if (defined(CFG_OR5_PRELIM) && defined(CFG_BR5_PRELIM)) + memctl->memc_or5 = CFG_OR5_PRELIM; + memctl->memc_br5 = CFG_BR5_PRELIM; +#endif #if defined(CONFIG_IP860) /* disable CS0 now that Flash is mapped on CS1 */ memctl->memc_br0 = 0; diff --git a/cpu/mpc8xx/fec.c b/cpu/mpc8xx/fec.c index db99dc2..f004e2e 100644 --- a/cpu/mpc8xx/fec.c +++ b/cpu/mpc8xx/fec.c @@ -26,14 +26,14 @@ #include #include -#ifdef CFG_DISCOVER_PHY -static void mii_discover_phy(void); -#endif - #undef ET_DEBUG #if (CONFIG_COMMANDS & CFG_CMD_NET) && defined(FEC_ENET) +#ifdef CFG_DISCOVER_PHY +static void mii_discover_phy(void); +#endif + /* Ethernet Transmit and Receive Buffers */ #define DBUF_LENGTH 1520 diff --git a/cpu/mpc8xx/serial.c b/cpu/mpc8xx/serial.c index fc1366b..14281c7 100644 --- a/cpu/mpc8xx/serial.c +++ b/cpu/mpc8xx/serial.c @@ -344,9 +344,17 @@ serial_init (ulong cpu_clock, int baudrate) */ im->im_siu_conf.sc_sdcr = 1; -#if (SCC_INDEX < 2) || !defined(CONFIG_IP860) +#if (SCC_INDEX == 2) && defined(CONFIG_MPC850) /* - * Standard configuration for SCC's in on Part A + * The MPC850 has SCC3 on Port B + */ + cp->cp_pbpar |= 0x06; + cp->cp_pbdir &= ~0x06; + cp->cp_pbodr &= ~0x06; + +#elif (SCC_INDEX < 2) || !defined(CONFIG_IP860) + /* + * Standard configuration for SCC's is on Part A */ ip->iop_papar |= ((3 << (2 * SCC_INDEX))); ip->iop_padir &= ~((3 << (2 * SCC_INDEX))); diff --git a/disk/part.c b/disk/part.c index 28281fb..2da47eb 100644 --- a/disk/part.c +++ b/disk/part.c @@ -59,7 +59,9 @@ int get_partition_info (int dev, int part, disk_partition_t *info) #ifdef CONFIG_MAC_PARTITION case PART_TYPE_MAC: if (get_partition_info_mac(dev,part,info) == 0) { -printf ("## Valid MAC partition found ##\n"); +#ifdef DEBUG + printf ("## Valid MAC partition found ##\n"); +#endif return (0); } break; @@ -68,7 +70,9 @@ printf ("## Valid MAC partition found ##\n"); #ifdef CONFIG_DOS_PARTITION case PART_TYPE_DOS: if (get_partition_info_dos(dev,part,info) == 0) { -printf ("## Valid DOS partition found ##\n"); +#ifdef DEBUG + printf ("## Valid DOS partition found ##\n"); +#endif return (0); } break; @@ -90,14 +94,18 @@ void print_part (int dev) switch (part_type[dev]) { #ifdef CONFIG_MAC_PARTITION case PART_TYPE_MAC: -printf ("## Testing for valid MAC partition ##\n"); +#ifdef DEBUG + printf ("## Testing for valid MAC partition ##\n"); +#endif print_part_header ("MAC", dev); print_part_mac (dev); return; #endif #ifdef CONFIG_DOS_PARTITION case PART_TYPE_DOS: -printf ("## Testing for valid DOS partition ##\n"); +#ifdef DEBUG + printf ("## Testing for valid DOS partition ##\n"); +#endif print_part_header ("DOS", dev); print_part_dos (dev); return; diff --git a/include/commproc.h b/include/commproc.h index 68e00d0..5209823 100644 --- a/include/commproc.h +++ b/include/commproc.h @@ -701,7 +701,10 @@ typedef struct scc_enet { /*** TQM823L, TQM850L, ETX094 ***************************************/ -#if defined(CONFIG_TQM823L) || defined(CONFIG_TQM850L) || defined(CONFIG_ETX094) +#if defined(CONFIG_TQM823L) || \ + defined(CONFIG_TQM850L) || \ + defined(CONFIG_ETX094) || \ + defined(CONFIG_LANTEC) /* Bits in parallel I/O port registers that have to be set/cleared * to configure the pins for SCC2 use. */ @@ -723,7 +726,7 @@ typedef struct scc_enet { */ #define SICR_ENET_MASK ((uint)0x0000ff00) #define SICR_ENET_CLKRT ((uint)0x00002600) -#endif /* CONFIG_TQM823L, CONFIG_TQM850L, CONFIG_ETX094 */ +#endif /* CONFIG_TQM823L, CONFIG_TQM850L, CONFIG_ETX094, CONFIG_LANTEC */ /*** FPS850L *********************************************************/ diff --git a/include/config_CPCI405.h b/include/config_CPCI405.h index 6e3bd2a..4a9dede 100644 --- a/include/config_CPCI405.h +++ b/include/config_CPCI405.h @@ -66,6 +66,8 @@ #if 1 #define CONFIG_COMMANDS \ (CONFIG_CMD_DFL | CFG_CMD_PCI | CFG_CMD_IRQ | CFG_CMD_IDE) +#define CONFIG_MAC_PARTITION +#define CONFIG_DOS_PARTITION #else #define CONFIG_COMMANDS \ (CONFIG_CMD_DFL | CFG_CMD_PCI | CFG_CMD_IRQ) diff --git a/include/config_GTH.h b/include/config_GTH.h index 4235f9b..01615fe 100644 --- a/include/config_GTH.h +++ b/include/config_GTH.h @@ -97,6 +97,8 @@ #endif #define CONFIG_COMMANDS (CONFIG_CMD_DFL | CFG_CMD_IDE) +#define CONFIG_MAC_PARTITION +#define CONFIG_DOS_PARTITION /* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */ #include diff --git a/include/config_IVML24.h b/include/config_IVML24.h index 3a37720..2468396 100644 --- a/include/config_IVML24.h +++ b/include/config_IVML24.h @@ -59,6 +59,8 @@ #define CONFIG_STATUS_LED 1 /* Status LED enabled */ #define CONFIG_COMMANDS (CONFIG_CMD_DFL | CFG_CMD_IDE) +#define CONFIG_MAC_PARTITION +#define CONFIG_DOS_PARTITION #define CONFIG_BOOTP_MASK \ ((CONFIG_BOOTP_DEFAULT | CONFIG_BOOTP_BOOTFILESIZE) & ~CONFIG_BOOTP_GATEWAY) diff --git a/include/config_IVMS8.h b/include/config_IVMS8.h index e3cb02d..bcfa573 100644 --- a/include/config_IVMS8.h +++ b/include/config_IVMS8.h @@ -59,6 +59,8 @@ #define CONFIG_STATUS_LED 1 /* Status LED enabled */ #define CONFIG_COMMANDS (CONFIG_CMD_DFL | CFG_CMD_IDE) +#define CONFIG_MAC_PARTITION +#define CONFIG_DOS_PARTITION #define CONFIG_BOOTP_MASK \ ((CONFIG_BOOTP_DEFAULT | CONFIG_BOOTP_BOOTFILESIZE) & ~CONFIG_BOOTP_GATEWAY) diff --git a/include/config_SPD823TS.h b/include/config_SPD823TS.h index e20c8a0..c8e8093 100644 --- a/include/config_SPD823TS.h +++ b/include/config_SPD823TS.h @@ -58,6 +58,8 @@ #define CONFIG_COMMANDS \ ((CONFIG_CMD_DFL & ~(CFG_CMD_FLASH)) | CFG_CMD_IDE) /* no Flash, but IDE */ +#define CONFIG_MAC_PARTITION +#define CONFIG_DOS_PARTITION #define CONFIG_BOOTP_MASK (CONFIG_BOOTP_DEFAULT | CONFIG_BOOTP_BOOTFILESIZE) diff --git a/include/config_lwmon.h b/include/config_lwmon.h index 120584f..b3256ff 100644 --- a/include/config_lwmon.h +++ b/include/config_lwmon.h @@ -60,7 +60,9 @@ // #define CONFIG_I2C /* I2C support enabled */ -#define CONFIG_COMMANDS (CONFIG_CMD_DFL | CFG_CMD_EEPROM /*| CFG_CMD_I2C|CFG_CMD_IDE*/) +#define CONFIG_COMMANDS (CONFIG_CMD_DFL | CFG_CMD_EEPROM | CFG_CMD_IDE /*|CFG_CMD_I2C*/) +#define CONFIG_MAC_PARTITION +#define CONFIG_DOS_PARTITION #define CONFIG_BOOTP_MASK \ ((CONFIG_BOOTP_DEFAULT | CONFIG_BOOTP_BOOTFILESIZE) & ~CONFIG_BOOTP_GATEWAY) @@ -121,7 +123,7 @@ */ #define CFG_SDRAM_BASE 0x00000000 #define CFG_FLASH_BASE 0x40000000 -#ifdef DEBUG +#if defined(DEBUG) || (CONFIG_COMMANDS & CFG_CMD_IDE) #define CFG_MONITOR_LEN (256 << 10) /* Reserve 256 kB for Monitor */ #else #define CFG_MONITOR_LEN (128 << 10) /* Reserve 128 kB for Monitor */ @@ -154,7 +156,14 @@ */ #define CFG_I2C_CLOCK 33000 /* I²C Clock Rate in kHz */ -#define CFG_EEPROM_ADDR 0x58 +#define CFG_I2C_AUDIO_ADDR 0x28 /* Audio volume control */ +#define CFG_I2C_SYSMON_ADDR 0x2E /* LM87 System Monitor */ +#define CFG_I2C_RTC_ADDR 0x51 /* PCF8563 RTC */ +#define CFG_I2C_POWER_A_ADDR 0x52 /* PCMCIA/USB power switch, channel A */ +#define CFG_I2C_POWER_B_ADDR 0x53 /* PCMCIA/USB power switch, channel B */ +#define CFG_I2C_KEYBD_ADDR 0x56 /* PIC LWE keyboard */ +#define CFG_I2C_PICIO_ADDR 0x57 /* PIC IO Expander */ +#define CFG_I2C_EEPROM_ADDR 0x58 /* EEPROM AT24C164 */ /*----------------------------------------------------------------------- * Cache Configuration @@ -184,7 +193,8 @@ */ /* EARB, DBGC and DBPC are initialised by the HCW */ /* => 0x000000C0 */ -#define CFG_SIUMCR (SIUMCR_BSC | SIUMCR_GB5E) +#define CFG_SIUMCR (SIUMCR_GB5E) +//#define CFG_SIUMCR (SIUMCR_DBGC00 | SIUMCR_DBPC00 | SIUMCR_MLRC01) /*----------------------------------------------------------------------- * TBSCR - Time Base Status and Control 11-26 @@ -275,7 +285,7 @@ SCCR_EBDF01 /**** SCCR_EBDF00 ****/ | SCCR_DFSYNC00 | \ #define CFG_PCMCIA_IO_SIZE ( 64 << 20 ) /*----------------------------------------------------------------------- - * IDE/ATA stuff + * IDE/ATA stuff (Supports IDE harddisk on PCMCIA Adapter) *----------------------------------------------------------------------- */ diff --git a/include/pcmcia.h b/include/pcmcia.h index 2172b71..0f4bc96 100644 --- a/include/pcmcia.h +++ b/include/pcmcia.h @@ -56,6 +56,8 @@ # define CONFIG_PCMCIA_SLOT_B #elif defined(CONFIG_IVMS8) || defined(CONFIG_IVML24) /* The IVM* use SLOT_A */ # define CONFIG_PCMCIA_SLOT_A +#elif defined(CONFIG_LWMON) /* The LWMON use SLOT_B */ +# define CONFIG_PCMCIA_SLOT_B #else # error "PCMCIA Slot not configured" #endif diff --git a/include/status_led.h b/include/status_led.h index b84fa93..cf1d328 100644 --- a/include/status_led.h +++ b/include/status_led.h @@ -138,6 +138,22 @@ void status_led_set (int led, int state); # define STATUS_LED_GREEN 1 # define STATUS_LED_BOOT 2 /* IDE LED used for boot status */ +/***** LANTEC *********************************************************/ +#elif defined(CONFIG_LANTEC) + +# define STATUS_LED_PAR im_ioport.iop_pdpar +# define STATUS_LED_DIR im_ioport.iop_pddir +# undef STATUS_LED_ODR +# define STATUS_LED_DAT im_ioport.iop_pddat + +# define STATUS_LED_BIT 0x1000 +# define STATUS_LED_PERIOD (CFG_HZ / 2) +# define STATUS_LED_STATE STATUS_LED_BLINKING + +# define STATUS_LED_ACTIVE 0 /* LED on for bit == 0 */ + +# define STATUS_LED_BOOT 0 /* LED 0 used for boot status */ + /************************************************************************/ #else # error Status LED configuration missing diff --git a/net/net.c b/net/net.c index 71de54a..ac5fab8 100644 --- a/net/net.c +++ b/net/net.c @@ -599,6 +599,7 @@ void copy_filename (uchar *dst, uchar *src, int size) { if (*src && (*src == '"')) { ++src; + --size; } while ((--size > 0) && *src && (*src != '"')) { diff --git a/tools/img2srec.c b/tools/img2srec.c index 7cf4b7f..084ea24 100644 --- a/tools/img2srec.c +++ b/tools/img2srec.c @@ -61,7 +61,7 @@ #include #include -#ifdef __BEOS__ +#if defined(__BEOS__) || defined(__NetBSD__) #include #endif diff --git a/tools/mkimage.c b/tools/mkimage.c index 6adf7b7..6c86916 100644 --- a/tools/mkimage.c +++ b/tools/mkimage.c @@ -16,6 +16,10 @@ #include #include +#if defined(__BEOS__) || defined(__NetBSD__) +#include +#endif + #include extern int errno;