home .. forth .. colorforth mail list archive ..

Re: [colorforth] PCI soundcard (was How is colorForth different from other Forths?)



On Thu, 22 Jan 2004, Howerd Oakford wrote:

> Hi Nick,
>
> Excellent! Progamming actual hardware is so much simpler than programming an
> API, provided you have the info... please give more details....
  And what is the URL of the Wiki?
> Better still, could you post ( or email me ) your actual source?
> ( Or use CFDOS.com and press U to upload the binary from your floppy, press
> F4 to convert to colourblind mode, and copy/paste from a Windows DOS box. )
> I have some gaps in my understanding of the North Bridge chip, and how you
> relate its registers to PCI cards. Any help appreciated...
>
> Regards
>
> Howerd
>
> -------
>
  Dear Howerd

  Thanks for the kind word, but those few lines are all the code I have!
They were only published to show how sweetly CF puts one in touch with PCI
devices.  I gladly pass on my humble store of "tidbits, tricks & tips".

  By following Chuck's instruction to replace  reg  by  dev  in the
definition of  ok  block 2e loads to print every PCI device, its ID
number and configuration address.  On toggling the word  reg  back into
the definition of  ok  and reloading block 2e now prints all the config
registers.  One can learn what these mean from Linux (eg the file
/usr/i386...linux/include/linux/pci.h) or other open sources (eg IEEE Std
1275 PCI Bus Binding to Open Firmware). Chuck has included some named
address variables; these might need changing to your device names and
addresses.  Two important config registers are 0, which holds the ID
and 10, which holds the io base address.

 I guess there are 3 levels of io address:  io to the PCI bus itself (cf8
& cfc); io to the device's configuration register (eg 3800 for sb in
Chuck's case, 5800 in mine); and the "io address" thru which the dev does
its actual work (the address given in config#10).  The words 4@ 4! do the
io; note that 4@ has a  dup   and 4! has a  drop (I guess because pci regs
swallow and regurgitate) and that reads seem to first need a dummy write
(mute 8***).  The word  q   queries a reg; thus  5800 q  prints the ID reg
of my es1371.

 The ENSONIQ Audio PCI 97 specsheet was located via Linux Advanced Sound
ALSA and downloaded from:

 rts-lab.eas.asu.edu/courses/cse494/projects/references/es1371.pdf

 The Audio Codec '97 Component spec v2.3 was from Intel:

 intell.com/labs/media/audio/index.htm#97spec23

 Linux says that the AC97 has a handfull of volume registers which need to
be unmuted, as well as 3 different means of reset.  I only hope that is
all that needs to be done in order to initialise the ac97; and that the es
reg#14 provides an unblocked serial link to the pci bus.

 Howerd, I don't understand your method of transferring code but it
may become clear after studying your posting on cflinks.

 Regards

 Nick


---------------------------------------------------------------------
To unsubscribe, e-mail: colorforth-unsubscribe@xxxxxxxxxxxxxxxxxx
For additional commands, e-mail: colorforth-help@xxxxxxxxxxxxxxxxxx
Main web page - http://www.colorforth.com