Show
Ignore:
Timestamp:
11/15/09 14:54:26 (13 years ago)
Author:
arnonym
Message:

Print the hexdump of the quadlets to stderr.

Print the stuff from show() as normal messages, not as debug.
And print the first 512 bytes of the application space of the dice-chip. Trying to figure out which bits to set to control line/instrument and high/low switches.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/libffado/src/dice/dice_eap.cpp

    r1655 r1713  
    398398{ 
    399399    printMessage("== DICE EAP ==\n"); 
    400     debugOutput(DEBUG_LEVEL_VERBOSE, "Parameter Space info:\n"); 
    401     debugOutput(DEBUG_LEVEL_VERBOSE, " Capability        : offset=%04X size=%06d\n", m_capability_offset, m_capability_size); 
    402     debugOutput(DEBUG_LEVEL_VERBOSE, " Command           : offset=%04X size=%06d\n", m_cmd_offset, m_cmd_size); 
    403     debugOutput(DEBUG_LEVEL_VERBOSE, " Mixer             : offset=%04X size=%06d\n", m_mixer_offset, m_mixer_size); 
    404     debugOutput(DEBUG_LEVEL_VERBOSE, " Peak              : offset=%04X size=%06d\n", m_peak_offset, m_peak_size); 
    405     debugOutput(DEBUG_LEVEL_VERBOSE, " New Routing Cfg   : offset=%04X size=%06d\n", m_new_routing_offset, m_new_routing_size); 
    406     debugOutput(DEBUG_LEVEL_VERBOSE, " New Stream Cfg    : offset=%04X size=%06d\n", m_new_stream_cfg_offset, m_new_stream_cfg_size); 
    407     debugOutput(DEBUG_LEVEL_VERBOSE, " Current Cfg       : offset=%04X size=%06d\n", m_curr_cfg_offset, m_curr_cfg_size); 
    408     debugOutput(DEBUG_LEVEL_VERBOSE, " Standalone Cfg    : offset=%04X size=%06d\n", m_standalone_offset, m_standalone_size); 
    409     debugOutput(DEBUG_LEVEL_VERBOSE, " Application Space : offset=%04X size=%06d\n", m_app_offset, m_app_size); 
    410  
    411     debugOutput(DEBUG_LEVEL_VERBOSE, "Capabilities:\n"); 
    412     debugOutput(DEBUG_LEVEL_VERBOSE, " Router: %sexposed, %swritable, %sstored, %d routes\n", 
     400    printMessage("Parameter Space info:\n"); 
     401    printMessage(" Capability        : offset=%04X size=%06d\n", m_capability_offset, m_capability_size); 
     402    printMessage(" Command           : offset=%04X size=%06d\n", m_cmd_offset, m_cmd_size); 
     403    printMessage(" Mixer             : offset=%04X size=%06d\n", m_mixer_offset, m_mixer_size); 
     404    printMessage(" Peak              : offset=%04X size=%06d\n", m_peak_offset, m_peak_size); 
     405    printMessage(" New Routing Cfg   : offset=%04X size=%06d\n", m_new_routing_offset, m_new_routing_size); 
     406    printMessage(" New Stream Cfg    : offset=%04X size=%06d\n", m_new_stream_cfg_offset, m_new_stream_cfg_size); 
     407    printMessage(" Current Cfg       : offset=%04X size=%06d\n", m_curr_cfg_offset, m_curr_cfg_size); 
     408    printMessage(" Standalone Cfg    : offset=%04X size=%06d\n", m_standalone_offset, m_standalone_size); 
     409    printMessage(" Application Space : offset=%04X size=%06d\n", m_app_offset, m_app_size); 
     410 
     411    printMessage("Capabilities:\n"); 
     412    printMessage(" Router: %sexposed, %swritable, %sstored, %d routes\n", 
    413413                                     (m_router_exposed?"":"not "), 
    414414                                     (m_router_readonly?"not ":""), 
    415415                                     (m_router_flashstored?"":"not "), 
    416416                                     m_router_nb_entries); 
    417     debugOutput(DEBUG_LEVEL_VERBOSE, " Mixer : %sexposed, %swritable, %sstored\n", 
     417    printMessage(" Mixer : %sexposed, %swritable, %sstored\n", 
    418418                                     (m_mixer_exposed?"":"not "), 
    419419                                     (m_mixer_readonly?"not ":""), 
    420420                                     (m_mixer_flashstored?"":"not ")); 
    421     debugOutput(DEBUG_LEVEL_VERBOSE, "         tx id: %s [%d], rx id: %s [%d]\n",  
     421    printMessage("         tx id: %s [%d], rx id: %s [%d]\n",  
    422422                                     dstBlockToString(m_mixer_tx_id), m_mixer_tx_id, 
    423423                                     srcBlockToString(m_mixer_rx_id), m_mixer_rx_id); 
    424     debugOutput(DEBUG_LEVEL_VERBOSE, "         nb tx channels: %d, nb rx channels: %d\n", m_mixer_nb_tx, m_mixer_nb_rx); 
    425     debugOutput(DEBUG_LEVEL_VERBOSE, " General: dynamic stream config %ssupported\n", 
     424    printMessage("         nb tx channels: %d, nb rx channels: %d\n", m_mixer_nb_tx, m_mixer_nb_rx); 
     425    printMessage(" General: dynamic stream config %ssupported\n", 
    426426                                     (m_general_support_dynstream?"":"not ")); 
    427     debugOutput(DEBUG_LEVEL_VERBOSE, "          flash load and store %ssupported\n", 
     427    printMessage("          flash load and store %ssupported\n", 
    428428                                     (m_general_support_flash?"":"not ")); 
    429     debugOutput(DEBUG_LEVEL_VERBOSE, "          peak metering %s\n", 
     429    printMessage("          peak metering %s\n", 
    430430                                     (m_general_peak_enabled?"enabled":"disabled")); 
    431     debugOutput(DEBUG_LEVEL_VERBOSE, "          stream config %sstored\n", 
     431    printMessage("          stream config %sstored\n", 
    432432                                     (m_general_stream_cfg_stored?"":"not ")); 
    433     debugOutput(DEBUG_LEVEL_VERBOSE, "          max TX streams: %d, max RX streams: %d\n", 
     433    printMessage("          max TX streams: %d, max RX streams: %d\n", 
    434434                                     m_general_max_tx, m_general_max_rx); 
    435435 
    436436    if(m_general_chip == DICE_EAP_CAP_GENERAL_CHIP_DICEII) { 
    437         debugOutput(DEBUG_LEVEL_VERBOSE, "          Chip: DICE-II\n"); 
     437        printMessage("          Chip: DICE-II\n"); 
    438438    } else if(m_general_chip == DICE_EAP_CAP_GENERAL_CHIP_DICEMINI) { 
    439         debugOutput(DEBUG_LEVEL_VERBOSE, "          Chip: DICE Mini (TCD2210)\n"); 
     439        printMessage("          Chip: DICE Mini (TCD2210)\n"); 
    440440    } else if(m_general_chip == DICE_EAP_CAP_GENERAL_CHIP_DICEJR) { 
    441         debugOutput(DEBUG_LEVEL_VERBOSE, "          Chip: DICE Junior (TCD2220)\n"); 
    442     } 
    443  
    444     debugOutput(DEBUG_LEVEL_VERBOSE, "--- Mixer configuration ---\n"); 
     441        printMessage("          Chip: DICE Junior (TCD2220)\n"); 
     442    } 
     443 
     444    printMessage("--- Mixer configuration ---\n"); 
    445445    if(m_mixer) { 
    446446        m_mixer->show(); 
    447447    } 
    448     debugOutput(DEBUG_LEVEL_VERBOSE, "--- Router/Peak space ---\n"); 
     448    printMessage("--- Router/Peak space ---\n"); 
    449449    if(m_router) { 
    450450        m_router->show(); 
    451451    } 
    452452 
     453    printMessage("--- Active Router/Stream ---\n"); 
    453454    RouterConfig *rcfg = getActiveRouterConfig(); 
    454455    if(rcfg) { 
     
    458459    if(scfg) { 
    459460        scfg->show(); 
     461    } 
     462 
     463    printMessage("--- Application space ---\n"); 
     464    fb_quadlet_t* tmp = (fb_quadlet_t *)calloc(128, sizeof(fb_quadlet_t)); 
     465    unsigned int appsize = 512; //m_app_size; /// m_app_size is rather big. Start with the first four block of 128 quadlets... 
     466    unsigned int offset = 0; 
     467    while ( appsize > 0 ) { 
     468        if ( ! readRegBlock( eRT_Application, offset, tmp, (appsize<128)?appsize:128 ) ) 
     469            appsize = 0; 
     470        else { 
     471            hexDumpQuadlets(tmp, 128); 
     472            offset += 128; 
     473            appsize -= 128; 
     474        } 
    460475    } 
    461476