* [ECOS] SMC2 - no interrupts?
@ 1999-11-09 19:36 Jamie Guinan
1999-11-10 0:57 ` Jesper Skov
0 siblings, 1 reply; 2+ messages in thread
From: Jamie Guinan @ 1999-11-09 19:36 UTC (permalink / raw)
To: Ecos Discussion List
Hi all,
[ Note - I'll also send a formal bug report related to this under
my client's support contract, so some Cygnus folks may see this twice. ]
I'm using eCos on an MBX 821 board, and I'm trying to coerce SMC2
into a functioning state. A few weeks ago I got as far as figuring out
I needed a transceiver (duh), and I verified that the port was operational
by sending EPPCBug's console out SMC2.
I've been studying quicc_smc_serial.c, and I'm a bit stumped as to
why nothing is coming out the SMC2 port in my test application.
My simple test app is attached, but in a nutshell, the code goes,
const char *device = "/dev/ser2";
char *msg;
cyg_io_handle_t handle;
int len;
cyg_io_lookup(device, &handle);
msg = "Hello from SMC2\n";
len = strlen(msg);
cyg_io_write(handle, msg, &len);
and nothing comes out the port. Debugging the driver, I found that
after it fills the transmit buffer, it calls quicc_smc_serial_flush(),
which sets the R and I bits (Ready/Interrupt) in the tx buffer descriptor,
so that an interrupt will be generated once the data is sent. It *should*
work, but since nothing was happening I decided to add some counter
variables (see attached patch file) and guess what- neither
quicc_smc_serial_ISR() nor quicc_smc_serial_DSR() seem to get called. :/
I'm working out of CVS at the moment (updated late night, Nov 8th).
My configuration goes,
tclsh .../packages/pkgconf.tcl --target powerpc --platform mbx --startup ram --disable-uitron
Then I manually tweak some pkgconf settings,
hal.h:
#define CYGIMP_HAL_COMMON_INTERRUPTS_USE_INTERRUPT_STACK
#define CYGNUM_HAL_COMMON_INTERRUPTS_STACK_SIZE 4096
#undef CYGSEM_HAL_COMMON_INTERRUPTS_ALLOW_NESTING
#undef CYGDBG_HAL_COMMON_INTERRUPTS_SAVE_MINIMUM_CONTEXT
#undef CYGIMP_HAL_COMMON_INTERRUPTS_CHAIN
#undef CYGIMP_HAL_COMMON_INTERRUPTS_IGNORE_SPURIOUS
#undef CYGDBG_HAL_COMMON_CONTEXT_SAVE_MINIMUM
#define CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS
#define CYGDBG_HAL_DEBUG_GDB_BREAK_SUPPORT
#undef CYGDBG_HAL_DEBUG_GDB_CTRLC_SUPPORT
#define CYGDBG_HAL_DEBUG_GDB_THREAD_SUPPORT
io_serial.h:
#define CYGPKG_IO_SERIAL_POWERPC_QUICC_SMC
#define CYGPKG_IO_SERIAL_POWERPC_QUICC_SMC_SMC1
(defaults, 38400, etc.)
#define CYGPKG_IO_SERIAL_POWERPC_QUICC_SMC_SMC2
(defaults, 38400, etc.)
hal_powerpc_mbx.h:
#define CYGHWR_HAL_POWERPC_BOARD_SPEED 40
infra.h:
#define CYGPKG_INFRA_DEBUG
#define CYGDBG_INFRA_DIAG_USE_DEVICE
Is there anything else I need to do to get the interrupts into
operation? Maybe its a cache issue?
For what its worth, here is a dump of the smc_chan structure passed
to quicc_smc_serial_flush(). It looks Ok to me (pram, txbd, etc. seem
reasonable at least),
(gdb) p *smc_chan
$1 = {channel = 176, int_num = 55, brg = 0xff0009f4, pram = 0xff003f80,
ctl = 0xff000a90,
txbd = 0xff002840, rxbd = 0xff002860, tbase = 0xff002840, rbase =
0xff002860, txsize = 16,
rxsize = 16, serial_interrupt = {vector = 55, priority = 0, isr =
0x130dc <quicc_smc_serial_ISR>,
dsr = 0x12ce0 <quicc_smc_serial_DSR>, data = 322024, dsr_count = 0,
next_dsr = 0x0},
serial_interrupt_handle = 322208, tx_enabled = 0}
Thanks in advance...
-Jamie
================================================================
Jamie Guinan Blue Button Solutions, Inc.
guinan@bluebutton.com http://www.bluebutton.com
================================================================
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [ECOS] SMC2 - no interrupts?
1999-11-09 19:36 [ECOS] SMC2 - no interrupts? Jamie Guinan
@ 1999-11-10 0:57 ` Jesper Skov
0 siblings, 0 replies; 2+ messages in thread
From: Jesper Skov @ 1999-11-10 0:57 UTC (permalink / raw)
To: guinan; +Cc: Ecos Discussion List
>>>>> "Jamie" == Jamie Guinan <guinan@bluebutton.com> writes:
Jamie> Is there anything else I need to do to get the interrupts into
Jamie> operation? Maybe its a cache issue?
It's a long shot, but you may have to prime the transmitter. See the
cogent serial driver:
// Enable the transmitter on the device
static void
cogent_serial_start_xmit(serial_channel *chan)
{
cogent_serial_info *cogent_chan = (cogent_serial_info *)chan->dev_priv;
cyg_addrword_t port = cogent_chan->base;
cyg_uint8 _ier;
HAL_READ_UINT8(port+SER_16550_IER, _ier);
_ier |= IER_XMT; // Enable xmit interrupt
HAL_WRITE_UINT8(port+SER_16550_IER, _ier);
(chan->callbacks->xmt_char)(chan);
}
The last line loads the first character into the transmit
buffer. Reason being that the TX interrupt doesn't happen until the TX
buffer goes from full->empty.
This is also done in the quicc_smc(1?) driver so if your are using the
same sources it's probably something else.
Jesper
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~1999-11-10 0:57 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-11-09 19:36 [ECOS] SMC2 - no interrupts? Jamie Guinan
1999-11-10 0:57 ` Jesper Skov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).