/*
 * Send Abort current processing command.
 */
static void
_ipmi_kcs_get_abort (ipmi_kcs_ctx_t ctx)
{
  assert (ctx);
  assert (ctx->magic == IPMI_KCS_CTX_MAGIC);

  _OUTB (IPMI_KCS_CTRL_GET_ABORT,
         IPMI_KCS_REG_CMD (ctx->driver_address, ctx->register_spacing));
}
/*
 * Set up channel to end write.
 */
static void
_ipmi_kcs_end_write (ipmi_kcs_ctx_t ctx)
{
  assert (ctx);
  assert (ctx->magic == IPMI_KCS_CTX_MAGIC);

  _OUTB (IPMI_KCS_CTRL_WRITE_END,
         IPMI_KCS_REG_CMD (ctx->driver_address, ctx->register_spacing));
}
/*
 * Write byte to inound data port.
 */
static void
_ipmi_kcs_write_byte (ipmi_kcs_ctx_t ctx, uint8_t byte)
{
  assert (ctx);
  assert (ctx->magic == IPMI_KCS_CTX_MAGIC);

  _OUTB (byte,
         IPMI_KCS_REG_DATAIN (ctx->driver_address));
}
/*
 * Bump channel into sending next byte.
 */
static void
_ipmi_kcs_read_next (ipmi_kcs_ctx_t ctx)
{
  assert (ctx);
  assert (ctx->magic == IPMI_KCS_CTX_MAGIC);

  _OUTB (IPMI_KCS_CTRL_READ,
         IPMI_KCS_REG_DATAIN (ctx->driver_address));
}
Beispiel #5
0
int sdla_mapmem (sdlahw_t* hw, unsigned long addr)
{
	unsigned port = hw->port;
	register int tmp;

	switch (hw->type)
	{
	case SDLA_S502A:
	case SDLA_S502E:
		if (addr < S502_MAXMEM)	/* verify parameter */
		{
			tmp = addr >> 13;	/* convert to register mask */
			_OUTB(port + 2, tmp);
			hw->regs[2] = tmp;
		}
		else return -EINVAL;
Beispiel #6
0
int sdla_down (sdlahw_t* hw)
{
	unsigned port = hw->port;
	int i;

	if (!port) return -EFAULT;

	switch (hw->type)
	{
	case SDLA_S502A:
		_OUTB(port, 0x08);		/* halt CPU */
		_OUTB(port, 0x08);
		_OUTB(port, 0x08);
		hw->regs[0] = 0x08;
		_OUTB(port + 1, 0xFF);		/* close memory window */
		hw->regs[1] = 0xFF;
		break;

	case SDLA_S502E:
		_OUTB(port + 3, 0);		/* stop CPU */
		_OUTB(port, 0);			/* reset board */
		for (i = 0; i < S502E_IORANGE; ++i)
			hw->regs[i] = 0
		;
		break;

	case SDLA_S503:
	case SDLA_S507:
	case SDLA_S508:
		_OUTB(port, 0);			/* reset board logic */
		hw->regs[0] = 0;
		break;

	default:
		return -EINVAL;
	}
	return 0;
}