Add LED indication for IDE activity on KUP4K board

This commit is contained in:
wdenk 2002-12-04 23:39:58 +00:00
parent a6c7ad2f65
commit 1f53a41603
5 changed files with 211 additions and 219 deletions

View file

@ -2,6 +2,8 @@
Changes since for U-Boot 0.1.0:
======================================================================
* Add LED indication for IDE activity on KUP4K board
* Fix startup problems with VFD display on TRAB
* Patch by Pierre Aubert, 20 Nov 2002

View file

@ -288,12 +288,22 @@ int misc_init_r (void)
{
DECLARE_GLOBAL_DATA_PTR;
#ifdef CONFIG_STATUS_LED
volatile immap_t *immap = (immap_t *)CFG_IMMR;
#endif
#ifdef CONFIG_KUP4K_LOGO
bd_t *bd = gd->bd;
lcd_logo(bd);
#endif /* CONFIG_KUP4K_LOGO */
#ifdef CONFIG_IDE_LED
/* Configure PA8 as output port */
immap->im_ioport.iop_padir |= 0x80;
immap->im_ioport.iop_paodr |= 0x80;
immap->im_ioport.iop_papar &= ~0x80;
immap->im_ioport.iop_padat |= 0x80; /* turn it off */
#endif
return(0);
}
@ -422,3 +432,15 @@ void lcd_logo(bd_t *bd){
}
#endif /* CONFIG_KUP4K_LOGO */
#ifdef CONFIG_IDE_LED
void ide_led (uchar led, uchar status)
{
volatile immap_t *immap = (immap_t *)CFG_IMMR;
/* We have one led for both pcmcia slots */
if (status) { /* led on */
immap->im_ioport.iop_padat &= ~0x80;
} else {
immap->im_ioport.iop_padat |= 0x80;
}
}
#endif

View file

@ -132,8 +132,12 @@ static block_dev_desc_t ide_dev_desc[CFG_IDE_MAXDEVICE];
/* ------------------------------------------------------------------------- */
#ifdef CONFIG_IDE_LED
#ifndef CONFIG_KUP4K
static void ide_led (uchar led, uchar status);
#else
extern void ide_led (uchar led, uchar status);
#endif
#else
#ifndef CONFIG_AMIGAONEG3SE
#define ide_led(a,b) /* dummy */
#else
@ -1347,7 +1351,7 @@ static void ide_reset (void)
/* ------------------------------------------------------------------------- */
#if defined(CONFIG_IDE_LED) && !defined(CONFIG_AMIGAONEG3SE)
#if defined(CONFIG_IDE_LED) && !defined(CONFIG_AMIGAONEG3SE) && !defined(CONFIG_KUP4K)
static uchar led_buffer = 0; /* Buffer for current LED status */

View file

@ -88,7 +88,7 @@ static u_int m8xx_get_graycode(u_int size);
static u_int m8xx_get_speed(u_int ns, u_int is_io);
#endif
/* ------------------------------------------------------------------------- */
/* -------------------------------------------------------------------- */
/* look up table for pgcrx registers */
@ -101,7 +101,7 @@ static u_int *pcmcia_pgcrx[2] = {
const char *indent = "\t ";
/* ------------------------------------------------------------------------- */
/* -------------------------------------------------------------------- */
#if (CONFIG_COMMANDS & CFG_CMD_PCMCIA)
@ -126,7 +126,7 @@ int do_pinit (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
}
#endif /* CFG_CMD_PCMCIA */
/* ------------------------------------------------------------------------- */
/* -------------------------------------------------------------------- */
#if defined(CONFIG_LWMON)
# define CFG_PCMCIA_TIMING (PCMCIA_SHT(9) | PCMCIA_SST(3) | PCMCIA_SL(12))
@ -185,7 +185,7 @@ int pcmcia_on (void)
break;
}
case 6:
case 2: { /* map I/O window for command/ctrl reg block */
case 2: { /* map I/O window for cmd/ctrl reg block */
win->or = ( PCMCIA_BSIZE_1K
| PCMCIA_PPS_8
| PCMCIA_PRS_IO
@ -223,7 +223,7 @@ int pcmcia_on (void)
return (rc);
}
/* ------------------------------------------------------------------------- */
/* -------------------------------------------------------------------- */
#if (CONFIG_COMMANDS & CFG_CMD_PCMCIA)
@ -261,7 +261,7 @@ static int pcmcia_off (void)
#endif /* CFG_CMD_PCMCIA */
/* ------------------------------------------------------------------------- */
/* -------------------------------------------------------------------- */
#ifdef CONFIG_IDE_8xx_PCCARD
@ -354,17 +354,17 @@ static int check_ide_device (int slot)
}
#endif /* CONFIG_IDE_8xx_PCCARD */
/* ------------------------------------------------------------------------- */
/* -------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------- */
/* -------------------------------------------------------------------- */
/* board specific stuff: */
/* voltage_set(), hardware_enable() and hardware_disable() */
/* ---------------------------------------------------------------------------- */
/* -------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------- */
/* -------------------------------------------------------------------- */
/* RPX Boards from Embedded Planet */
/* ---------------------------------------------------------------------------- */
/* -------------------------------------------------------------------- */
#if defined(CONFIG_RPXCLASSIC) || defined(CONFIG_RPXLITE)
@ -431,9 +431,9 @@ static int hardware_disable(int slot)
#endif /* CFG_CMD_PCMCIA */
#endif /* CONFIG_RPXCLASSIC */
/* ---------------------------------------------------------------------------- */
/* -------------------------------------------------------------------- */
/* (F)ADS Boards from Motorola */
/* ---------------------------------------------------------------------------- */
/* -------------------------------------------------------------------- */
#if defined(CONFIG_ADS) || defined(CONFIG_FADS)
@ -509,9 +509,9 @@ static int hardware_disable(int slot)
#endif /* (F)ADS */
/* ---------------------------------------------------------------------------- */
/* -------------------------------------------------------------------- */
/* TQM8xxL Boards by TQ Components */
/* ---------------------------------------------------------------------------- */
/* -------------------------------------------------------------------- */
#if defined(CONFIG_TQM8xxL)
@ -545,15 +545,12 @@ static int hardware_enable(int slot)
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
* Disable interrupts, DMA, and PCMCIA buffers
* (isolate the interface) and assert RESET signal
*/
debug ("Disable PCMCIA buffers and assert RESET\n");
reg = PCMCIA_PGCRX(_slot_);
reg = 0;
reg |= __MY_PCMCIA_GCRX_CXRESET; /* active high */
reg |= __MY_PCMCIA_GCRX_CXOE; /* active low */
PCMCIA_PGCRX(_slot_) = reg;
@ -635,11 +632,8 @@ static int hardware_disable(int slot)
/* remove all power */
immap->im_ioport.iop_pcdat &= ~(0x0002 | 0x0004);
/* Configure PCMCIA General Control Register */
PCMCIA_PGCRX(_slot_) = 0;
debug ("Disable PCMCIA buffers and assert RESET\n");
reg = PCMCIA_PGCRX(_slot_);
reg = 0;
reg |= __MY_PCMCIA_GCRX_CXRESET; /* active high */
reg |= __MY_PCMCIA_GCRX_CXOE; /* active low */
PCMCIA_PGCRX(_slot_) = reg;
@ -725,9 +719,9 @@ done:
#endif /* TQM8xxL */
/* ---------------------------------------------------------------------------- */
/* -------------------------------------------------------------------- */
/* LWMON Board */
/* ---------------------------------------------------------------------------- */
/* -------------------------------------------------------------------- */
#if defined(CONFIG_LWMON)
@ -782,15 +776,12 @@ static int hardware_enable(int slot)
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
* Disable interrupts, DMA, and PCMCIA buffers
* (isolate the interface) and assert RESET signal
*/
debug ("Disable PCMCIA buffers and assert RESET\n");
reg = PCMCIA_PGCRX(_slot_);
reg = 0;
reg |= __MY_PCMCIA_GCRX_CXRESET; /* active high */
reg |= __MY_PCMCIA_GCRX_CXOE; /* active low */
PCMCIA_PGCRX(_slot_) = reg;
@ -866,10 +857,8 @@ static int hardware_disable(int slot)
i2c_write (CFG_I2C_POWER_A_ADDR, 0, 0, &val, 1);
/* Configure PCMCIA General Control Register */
PCMCIA_PGCRX(_slot_) = 0;
debug ("Disable PCMCIA buffers and assert RESET\n");
reg = PCMCIA_PGCRX(_slot_);
reg = 0;
reg |= __MY_PCMCIA_GCRX_CXRESET; /* active high */
reg |= __MY_PCMCIA_GCRX_CXOE; /* active low */
PCMCIA_PGCRX(_slot_) = reg;
@ -962,9 +951,9 @@ done:
#endif /* LWMON */
/* ---------------------------------------------------------------------------- */
/* -------------------------------------------------------------------- */
/* GTH board by Corelatus AB */
/* ---------------------------------------------------------------------------- */
/* -------------------------------------------------------------------- */
#if defined(CONFIG_GTH)
#define PCMCIA_BOARD_MSG "GTH COMPACT FLASH"
@ -993,22 +982,20 @@ static int hardware_enable (int slot)
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
* Disable interrupts, DMA, and PCMCIA buffers
* (isolate the interface) and assert RESET signal
*/
debug ("Disable PCMCIA buffers and assert RESET\n");
reg = PCMCIA_PGCRX(_slot_);
reg = 0;
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.
* Make sure there is a card in the slot,
* then configure the interface.
*/
udelay (10000);
debug ("[%d] %s: PIPR(%p)=0x%x\n",
@ -1046,9 +1033,9 @@ static int hardware_disable(int slot)
#endif /* CFG_CMD_PCMCIA */
#endif /* CONFIG_GTH */
/* ---------------------------------------------------------------------------- */
/* -------------------------------------------------------------------- */
/* ICU862 Boards by Cambridge Broadband Ltd. */
/* ---------------------------------------------------------------------------- */
/* -------------------------------------------------------------------- */
#if defined(CONFIG_ICU862)
@ -1087,15 +1074,12 @@ static int hardware_enable(int slot)
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
* Disable interrupts, DMA, and PCMCIA buffers
* (isolate the interface) and assert RESET signal
*/
debug ("Disable PCMCIA buffers and assert RESET\n");
reg = PCMCIA_PGCRX(_slot_);
reg = 0;
reg |= __MY_PCMCIA_GCRX_CXRESET; /* active high */
reg |= __MY_PCMCIA_GCRX_CXOE; /* active low */
PCMCIA_PGCRX(_slot_) = reg;
@ -1188,10 +1172,8 @@ static int hardware_disable(int slot)
cp->cp_pbdat &= ~(TPS2205_SHDN);
/* Configure PCMCIA General Control Register */
PCMCIA_PGCRX(_slot_) = 0;
debug ("Disable PCMCIA buffers and assert RESET\n");
reg = PCMCIA_PGCRX(_slot_);
reg = 0;
reg |= __MY_PCMCIA_GCRX_CXRESET; /* active high */
reg |= __MY_PCMCIA_GCRX_CXOE; /* active low */
PCMCIA_PGCRX(_slot_) = reg;
@ -1315,9 +1297,9 @@ static void cfg_port_B (void)
#endif /* ICU862 */
/* ---------------------------------------------------------------------------- */
/* -------------------------------------------------------------------- */
/* C2MON Boards by TTTech Computertechnik AG */
/* ---------------------------------------------------------------------------- */
/* -------------------------------------------------------------------- */
#if defined(CONFIG_C2MON)
@ -1357,15 +1339,12 @@ static int hardware_enable(int slot)
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
* Disable interrupts, DMA, and PCMCIA buffers
* (isolate the interface) and assert RESET signal
*/
debug ("Disable PCMCIA buffers and assert RESET\n");
reg = PCMCIA_PGCRX(_slot_);
reg = 0;
reg |= __MY_PCMCIA_GCRX_CXRESET; /* active high */
reg |= __MY_PCMCIA_GCRX_CXOE; /* active low */
PCMCIA_PGCRX(_slot_) = reg;
@ -1453,10 +1432,8 @@ static int hardware_disable(int slot)
pcmp = (pcmconf8xx_t *)(&(((immap_t *)CFG_IMMR)->im_pcmcia));
/* Configure PCMCIA General Control Register */
PCMCIA_PGCRX(_slot_) = 0;
debug ("Disable PCMCIA buffers and assert RESET\n");
reg = PCMCIA_PGCRX(_slot_);
reg = 0;
reg |= __MY_PCMCIA_GCRX_CXRESET; /* active high */
reg |= __MY_PCMCIA_GCRX_CXOE; /* active low */
PCMCIA_PGCRX(_slot_) = reg;
@ -1599,9 +1576,9 @@ static void cfg_ports (void)
#endif /* C2MON */
/* ----------------------------------------------------------------------------
MBX board from Morotola
---------------------------------------------------------------------------- */
/* -------------------------------------------------------------------- */
/* MBX board from Morotola */
/* -------------------------------------------------------------------- */
#if defined( CONFIG_MBX )
#include <../board/mbx8xx/csr.h>
@ -1687,15 +1664,12 @@ static int hardware_enable (int slot)
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
* Disable interrupts, DMA, and PCMCIA buffers
* (isolate the interface) and assert RESET signal
*/
debug ("Disable PCMCIA buffers and assert RESET\n");
reg = PCMCIA_PGCRX (_slot_);
reg = 0;
reg |= __MY_PCMCIA_GCRX_CXRESET; /* active high */
reg |= __MY_PCMCIA_GCRX_CXOE; /* active low */
PCMCIA_PGCRX (_slot_) = reg;
@ -1752,9 +1726,9 @@ static int hardware_disable (int slot)
}
#endif /* CFG_CMD_PCMCIA */
#endif /* CONFIG_MBX */
/* ---------------------------------------------------------------------------- */
/* -------------------------------------------------------------------- */
/* R360MPI Board */
/* ---------------------------------------------------------------------------- */
/* -------------------------------------------------------------------- */
#if defined(CONFIG_R360MPI)
@ -1788,15 +1762,12 @@ static int hardware_enable(int slot)
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
* Disable interrupts, DMA, and PCMCIA buffers
* (isolate the interface) and assert RESET signal
*/
debug ("Disable PCMCIA buffers and assert RESET\n");
reg = PCMCIA_PGCRX(_slot_);
reg = 0;
reg |= __MY_PCMCIA_GCRX_CXRESET; /* active high */
reg |= __MY_PCMCIA_GCRX_CXOE; /* active low */
PCMCIA_PGCRX(_slot_) = reg;
@ -1889,10 +1860,8 @@ static int hardware_disable(int slot)
immap->im_ioport.iop_padat |= 0x0200;
/* Configure PCMCIA General Control Register */
PCMCIA_PGCRX(_slot_) = 0;
debug ("Disable PCMCIA buffers and assert RESET\n");
reg = PCMCIA_PGCRX(_slot_);
reg = 0;
reg |= __MY_PCMCIA_GCRX_CXRESET; /* active high */
reg |= __MY_PCMCIA_GCRX_CXOE; /* active low */
PCMCIA_PGCRX(_slot_) = reg;
@ -1987,9 +1956,9 @@ done:
#endif /* R360MPI */
/* ---------------------------------------------------------------------------- */
/* -------------------------------------------------------------------- */
/* KUP4K Board */
/* ---------------------------------------------------------------------------- */
/* -------------------------------------------------------------------- */
#if defined(CONFIG_KUP4K)
#define PCMCIA_BOARD_MSG "KUP4K"
@ -2023,15 +1992,12 @@ static int hardware_enable(int slot)
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
* Disable interrupts, DMA, and PCMCIA buffers
* (isolate the interface) and assert RESET signal
*/
debug ("Disable PCMCIA buffers and assert RESET\n");
reg = PCMCIA_PGCRX(slot);
reg = 0;
reg |= __MY_PCMCIA_GCRX_CXRESET; /* active high */
reg |= __MY_PCMCIA_GCRX_CXOE; /* active low */
PCMCIA_PGCRX(slot) = reg;
@ -2116,10 +2082,8 @@ static int hardware_disable(int slot)
cp->cp_pbdat |= KUP4K_PCMCIA_B_3V3;
/* Configure PCMCIA General Control Register */
PCMCIA_PGCRX(slot) = 0;
debug ("Disable PCMCIA buffers and assert RESET\n");
reg = PCMCIA_PGCRX(slot);
reg = 0;
reg |= __MY_PCMCIA_GCRX_CXRESET; /* active high */
reg |= __MY_PCMCIA_GCRX_CXOE; /* active low */
PCMCIA_PGCRX(slot) = reg;
@ -2213,14 +2177,14 @@ static int voltage_set(int slot, int vcc, int vpp)
/* ---------------------------------------------------------------------------- */
/* -------------------------------------------------------------------- */
/* End of Board Specific Stuff */
/* ---------------------------------------------------------------------------- */
/* -------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------- */
/* -------------------------------------------------------------------- */
/* MPC8xx Specific Stuff - should go to MPC8xx directory */
/* ---------------------------------------------------------------------------- */
/* -------------------------------------------------------------------- */
/*
* Search this table to see if the windowsize is
@ -2241,7 +2205,7 @@ static const u_int m8xx_size_to_gray[M8XX_SIZES_NO] =
0x00800000, 0x00400000, 0x00100000, 0x00200000 };
/* ---------------------------------------------------------------------------- */
/* -------------------------------------------------------------------- */
static u_int m8xx_get_graycode(u_int size)
{
@ -2258,7 +2222,7 @@ static u_int m8xx_get_graycode(u_int size)
return k;
}
/* ------------------------------------------------------------------------- */
/* -------------------------------------------------------------------- */
#if 0
static u_int m8xx_get_speed(u_int ns, u_int is_io)
@ -2311,7 +2275,7 @@ static u_int m8xx_get_speed(u_int ns, u_int is_io)
}
#endif
/* ------------------------------------------------------------------------- */
/* -------------------------------------------------------------------- */
#ifdef CONFIG_IDE_8xx_PCCARD
static void print_funcid (int func)
@ -2353,7 +2317,7 @@ static void print_funcid (int func)
}
#endif /* CONFIG_IDE_8xx_PCCARD */
/* ------------------------------------------------------------------------- */
/* -------------------------------------------------------------------- */
#ifdef CONFIG_IDE_8xx_PCCARD
static void print_fixed (volatile uchar *p)
@ -2411,7 +2375,7 @@ static void print_fixed (volatile uchar *p)
}
#endif /* CONFIG_IDE_8xx_PCCARD */
/* ------------------------------------------------------------------------- */
/* -------------------------------------------------------------------- */
#ifdef CONFIG_IDE_8xx_PCCARD
@ -2475,6 +2439,6 @@ static int identify (volatile uchar *p)
}
#endif /* CONFIG_IDE_8xx_PCCARD */
/* ------------------------------------------------------------------------- */
/* -------------------------------------------------------------------- */
#endif /* CFG_CMD_PCMCIA || (CFG_CMD_IDE && CONFIG_IDE_8xx_PCCARD) */

View file

@ -292,7 +292,7 @@
#define CONFIG_IDE_8xx_PCCARD 1 /* Use IDE with PC Card Adapter */
#undef CONFIG_IDE_8xx_DIRECT /* Direct IDE not supported */
#undef CONFIG_IDE_LED /* LED for ide not supported */
#define CONFIG_IDE_LED 1 /* LED for ide supported */
#undef CONFIG_IDE_RESET /* reset for ide not supported */
#define CFG_IDE_MAXBUS 2