On Fri, 2008-09-19 at 02:54 -0400, Steven Toth wrote:
> > 
> > It's my even longer term plan to replace the real firmware in the
> > Z8F0811 with some home grown open source stuff and liberate myself (and
> > others) from Zilog's proprietary API,
> 
> Let's talk about this, I'd like to support you as much as I can.

Well as a first step I need to write a soft UART driver to:

1. Present an interface to the Z8 Encore On Chip Debugger to user space
for each Z8 chip behind a host CX2341[568] chip.

2. Develop an application to issue commands and data to a Z8 OCD and
receive data.


Then I can think about how to implement the interfaces for firmware
running inside of a Z8 and then an event loop for the Z8 to handle all
of the interface requirements.

I'm not up to speed on IR protocols either, and I'm sure there's some
hurdles there I may not be aware of.  There are also some decisions that
need to made there I'm sure.


Anyway, for High Level Requirement #1 above, I've got some more derived
requirements:

1a. present a "standard" linux tty interface to user space support as
much of termios, et. al that is needed or makes sense.

1b. implement a line discipline to unburden a user space app from the
needing to know too much about the simplex nature of the interface to
the Z8, the crystal freq, the autobaud sequence for the Z8, etc.

1c. A soft uart implementation should try to use interrupts if supported
by the underlying host chip (e.g. if the CX23418 supports interrupts on
GPIO changes)

1d. Host chip drivers like ivtv and cx18 should probe for Z8's if
possible (or use tveeprom hints) and register their Z8 chip and Z8
hardware line manipulation callbacks (set/get_DBG(), set_RST()).

1e. the soft uart tty driver must support and manage multiple Z8 chips
in a system.


To satisfy some of these requirements I have a high level design mapped
out in my head.  I'll need a soft UART tty_driver (z8ocd) to interface
to the linux tty layer.  I'll need a tty_ldisc (z8ocd-ldisc) to deal
with the quirks of Z8's simplex DBG line interfacing to userspace and
for setting baud rate.  The tty_driver module (z8ocd) will need to
support host drivers calling a registration function to register their
DBG and RST line manipulation callbacks and crystal freq (the I2C system
can act as a guide here, but I need something much lighter weight).

I hear the tty subsystem just got a bit of an overhaul in the latest
kernel, but I'd already done the research for my current, older kernel
version *sigh* .....


I've also dug up a thesis on the performance of soft UARTs and the pros
and cons of various implementation choices:

"Universal Asynchronous Receiver/Transmitters: A Software Implementation
Approach"

Diploma Thesis by Herbert Valerio Riedel

Submitted to the Faculty of Computer Science Vienna University of
Technology

7 Dec 2005


Zilog makes their datasheets and errata publicly available, so that's
not a hurdle.


Of course all of the above is predicated on me having large blocks of
uninterrupted time to do all this.  (The kids :] and my other
responsibilities at home make this really, really hard to obtain.)



But, if you'll still indulge me in answering some quick questions if you
may:

The Z8 DBG pin is open collector/drain

1. Is there a pull-up wired to it on the HVR-1600MCE and PVR-150MCE?

2. Is the DBG pin wired to the GPIO pin referred to as the "Zilog
programming pin" in the cx18 source code comments?

3. What are the GPIO pins for Z8 DBG and RST lines for the different
boards (PVR-150, PVR-500, whatever)?  I can probably guess from the code
to reset Z8 in ivtv, if I have to do so.


Regards,
Andy

> - Steve



_______________________________________________
ivtv-devel mailing list
[email protected]
http://ivtvdriver.org/mailman/listinfo/ivtv-devel

Reply via email to