Changeset 1590

Show
Ignore:
Timestamp:
06/27/09 07:10:52 (13 years ago)
Author:
jwoithe
Message:

RME: clarify comments in source code
RME: add explicit define to use when determining DDS status from configuration flash RAM
RME: add TCO information to the RME documentation

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/libffado/doc/rme_notes/rme_config_register_map.txt

    r1589 r1590  
    22============================================ 
    33 
    4 Version: 0.10 
     4Version: 0.11 
    55Author: Jonathan Woithe 
    66Date: 27 June 2009 
     
    378378 
    379379 
     380TCO (TimeCode Option) 
     381--------------------- 
     382 
     383The TCO is an optional card for the FF800 which adds video timecode 
     384generation and clock locking capabilities to the FF800.  It is controlled by 
     385writing a block of 4 quadlets to register 0x810f0020 while its status can be 
     386retrieved by reading a block of 4 quadlets from register 0x801f0000. 
     387 
     388The configuration space is as follows. 
     389 
     390Quadlet 0 (written to register 0x810f0020): 
     391  bit 31: MTC active if set to 1 
     392  bits 30-0: reserved (equal zero) 
     393 
     394Quadlet 1 (written to register 0x810f0024): 
     395  bits 31-12: reserved (equal to zero) 
     396  bits 11-10: LTC format (00=24fps, 01=25fps, 10=29.97fps, 11=30fps) 
     397  bit 9: dropframe active 
     398  bit 8: set timecode request 
     399  bit 7: reserved (set to 0) 
     400  bit 6: PAL format video input 
     401  bit 5: NTSC format video input 
     402  bit 4-3: reserved (set to 0) 
     403  bits 2-1: word clock input rate (00=1x, 01=2x, 10=4x) 
     404  bit 0: reserved (set to 0) 
     405 
     406Quadlet 2 (written to register 0x810f0028): 
     407  bit 31: set sampling frequency from application 
     408  bits 30-29: input select (00=wordclock, 01=video, 10=LTC) 
     409  bit 28: input termination active 
     410  bit 27: Base frequency (0=44.1 kHz, 1=48 kHz) 
     411  bit 26: Pull up flag 
     412  bit 25: Pull down flag 
     413  bit 24: Pull up/down amount (0=0.1%, 1=4.0%) 
     414  bit 23: reserved (set to 0) 
     415  bit 22: Flywheel select 
     416  bit 21: Jam sync select 
     417  bits 20-19: dropframes select (unused, set to 0) 
     418  bits 18-17: word clock conversion (00=1:1, 01=44.1->48, 10=48->44.1) 
     419  bit 16: set TC run 
     420  bits 15-0: reserved, set to 0. 
     421 
     422Quadlet 3: 
     423  bits 31-0: reserved, set to 0 
     424 
     425The 4 quadlets returned by a TCO status query are mapped as follows. 
     426 
     427Quadlet 0: 
     428  bit 31: set to 1 
     429  bits 30-24: LTC, hours field in BCD(*) 
     430  bit 23: set to 1 
     431  bits 22-16: LTC, minutes field in BCD 
     432  bit 15: set to 1 
     433  bits 14-8: LTC, seconds field in BCD 
     434  bit 7: set to 1 
     435  bits 6-0: LTC, frames field in BCD 
     436 
     437Quadlet 1: 
     438  bit 31: set to 1 
     439  bits 30-24: reserved (equal to zero) 
     440  bit 23: set to 1 
     441  bits 22-16: reserved (equal to zero) 
     442  bit 15: set to 1 
     443  bits 14-12: reserved (equal to zero) 
     444  bits 11-10: LTC format (00=24fps, 01=25fps, 10=29.97fps, 11=30fps) 
     445  bit 9: dropframe active 
     446  bit 8: reserved (read as zeros) 
     447  bit 7: set to 1 
     448  bit 6: PAL format video input 
     449  bit 5: NTSC format video input 
     450  bit 4: Word clock input valid (0=invalid, 1=valid) 
     451  bit 3: LTC input valid (0=invalid, 1=valid) 
     452  bits 2-1: reserved (read as zeros) 
     453  bit 0: TCO lock flag (0=no lock, 1=locked) 
     454 
     455Quadlet 2 
     456  bit 31: set to 1 
     457  bits 30-24: reserved (equal to zero) 
     458  bit 23: set to 1 
     459  bits 22-16: reserved (equal to zero) 
     460  bit 15: set to 1 
     461  bits 14-8: upper 7 bits of PLL phase 
     462  bit 7: set to 1 
     463  bits 6-0: the lower 7 bits of the PLL phase 
     464 
     465Quadlet 3: 
     466  bit 31: set to 1 
     467  bits 30-16: reserved 
     468  bit 15: set to 1 
     469  bits 14-0: set to 0 
     470 
     471Notes: 
     472 (*) BCD is Binary Coded Decimal.  The high nibble (which is only 3 bits in 
     473     these cases) contains the "tens" digit while the lower nibble contains 
     474     the "units" digit. 
     475 
     476The calculation of the PLL phase from quadlet 2 (q2) is as follows: 
     477 
     478  phase = (q2 & 0x7f) + ((q2 & 0x7f00) >> 1) 
     479 
     480which then allows the incoming frequency to be calculated using 
     481 
     482  freq = (25000000 * 16) / phase 
     483 
     484To detect the presence of a TCO in a FF800, read the 4 TCO status quadlets.  
     485If a TCO is present: 
     486  - bits 31, 23, 15 and 7 in quadlets 0, 1 and 2 will be 1, AND 
     487  - bits 31 and 15 in quadlet 3 will be 1, AND 
     488  - bits 14 to 0 in quadlet 3 will be 0 
     489 
     490 
    380491Streaming control registers 
    381492--------------------------- 
  • trunk/libffado/src/rme/fireface_def.h

    r1589 r1590  
    326326#define FF_DEV_FLASH_OLEVEL_m10dBV             0x00000003 
    327327#define FF_DEV_FLASH_MIC_PHANTOM_ON            0x00000001 
     328#define FF_DEV_FLASH_SRATE_DDS_INACTIVE        0x00000000 
    328329#define FF_DEV_FLASH_WORD_CLOCK_1x             0x00000001 
    329330#define FF_DEV_FLASH_PLUG_SELECT_FRONT         0x00000001  // To be confirmed 
     
    387388#define FF_SWPARAM_MIC_PHANTOM_ON              FF_DEV_FLASH_MIC_PHANTOM_ON 
    388389#define FF_SWPARAM_WORD_CLOCK_1x               FF_DEV_FLASH_WORD_CLOCK_1x 
     390#define FF_SWPARAM_SRATE_DDS_INACTIVE          FF_DEV_FLASH_SRATE_DDS_INACTIVE 
    389391// 
    390392// The following defines refer to fields in the software parameter record 
     
    410412} FF_TCO_settings_t; 
    411413 
    412 // Defines used to configure selected quadlets of the TCO write space.  The 
    413 // byte indices referenced in the define names are 0-based. 
     414// Defines used to configure selected quadlets of the TCO write space.  Some 
     415// of these are also used when configuring the TCO.  The byte indices 
     416// referenced in the define names are 0-based. 
    414417 
    415418// TCO quadlet 0 
  • trunk/libffado/src/rme/fireface_flash.cpp

    r1589 r1590  
    214214    unsigned int rev; 
    215215 
    216     // FIXME: this is mostly for testing at present.  Still need to interface from 
    217     // hw_settings to the object's "settings" field
     216    // FIXME: the debug output in this function is mostly for testing at 
     217    // present
    218218 
    219219    i = get_revision(&rev); 
     
    241241            debugOutput(DEBUG_LEVEL_VERBOSE, "  Sample rate: not set in device flash\n"); 
    242242        } else 
    243         if (hw_settings.sample_rate == 0) { 
     243        if (hw_settings.sample_rate == FF_DEV_FLASH_SRATE_DDS_INACTIVE) { 
    244244            debugOutput(DEBUG_LEVEL_VERBOSE, "  Sample rate: DDS not active\n"); 
    245245        } else {