void main() { int mo, day, yr, noDays, i, c; mo = -1; while (mo < 1 || mo > 12) { PRINTS("Enter desired month: \0"); SCANN(mo); PRINTS("\r\n\0"); } PRINTS("Enter desired year: \0"); SCANN(yr); PRINTS("\r\n\0"); if (yr < 100) yr += 2000; day = firstOfMonth(mo,yr); PRINTS("\r\n\0"); switch(mo) { case 1: PRINTS("January \0"); noDays = 31; break; case 2: PRINTS("February \0"); noDays = 28 + isLeapYear(yr); break; case 3: PRINTS("March \0"); noDays = 31; break; case 4: PRINTS("April \0"); noDays = 30; break; case 5: PRINTS("May \0"); noDays = 31; break; case 6: PRINTS("June \0"); noDays = 30; break; case 7: PRINTS("July \0"); noDays = 31; break; case 8: PRINTS("August \0"); noDays = 31; break; case 9: PRINTS("September \0"); noDays = 30; break; case 10: PRINTS("October \0"); noDays = 31; break; case 11: PRINTS("November \0"); noDays = 30; break; default: PRINTS("December \0"); noDays = 31; } PRINTN(yr); PRINTS("\r\n\0"); PRINTS("Su Mo Tu We Th Fr Sa\r\n\0"); PRINTS("====================\r\n\0"); for (i = 1; i <= day; i++) PRINTS(" \0"); c = day; for (i = 1; i <= noDays; i++) { if (i < 10) PRINTS(" \0"); PRINTN(i); PRINTS(" \0"); c = c + 1; if (c == 7) { c = 0; PRINTS("\r\n\0"); } } PRINTS("\r\n\0"); END; }
void dir() { char buffer[512]; char fname[512]; int index = 0; int i; int runs = 0; int size = 0; int total = 0; READS(buffer,2); while(buffer[index] != 0x0) { for (i = 0; i < 6; ++i) { fname[i] = buffer[index + i]; } for (i = 6; i<32; ++i) { if (buffer[index + i] == 0x0) { break; } else { ++size; } } total = total + size; /* CHeck if filename starts with a capital */ if(fname[0] >= 'A' && fname[0] <= 'Z') { } else { PRINTS("File name: \0"); PRINTS(fname); PRINTS(" File size: \0"); PRINTN(size); PRINTS("\r\n\0"); } size = 0; runs = runs + 6; index = index + 32; } PRINTS("\r\nTotal Sectors used: \0"); PRINTN(total); PRINTS("\r\nSectors free: \0"); PRINTN(48-total); }
/* --------------------------------------------------------------------- * TermShowLine * Show a terminal text line * --------------------------------------------------------------------- */ static void TerminalShowLine(CUIWINDOW* win, int ypos, int line, CUIRECT* rc) { TERMINALDATA* data = win->InstData; WINDOW* w = win->Win; int x, attr; wchar_t* text = data->Lines[line]; BYTE* cols = data->Colors[line]; attr = cols[0]; SetColor(w,attr >> 4,attr & 0x0F,FALSE); MOVEYX(w, ypos, 0); for (x = 0; x < rc->W; x++) { if (x < MAX_TERMCOLS) { if (cols[x] != attr) { attr = cols[x]; SetColor(w,attr >> 4,attr & 0x0F,FALSE); } PRINTN(w, &text[x], 1); } else { break;
static void StopDsiTest() { PRINT("shut down DSI traffic from test app.... "); RE_TimerStop(Dsi_tmr); RE_TimerDelete(Dsi_tmr); PRINT("DSI timer deleted"); //tickUsed=ReadRtcWhole()-rtcTicksBefore; //SHOW_MEMORY("tickUsed is:", &tickUsed, 8); //@@@@ //SHOW_MEMORY("totalTick is:", &totalTick, 8); //@@@@ //SHOW_MEMORY("rtcTicksBefore is:", &rtcTicksBefore, 8); //@@@@ PRINTN("Totoal DSI Tx SoF is %d",cntPtr->dsiStats[CurrentDsiId].dsiDispSof); //total frame received PRINTN("Totoal DSI Tx EoF is %d",cntPtr->dsiStats[CurrentDsiId].dsiDispEof); //total frame received PRINT2N("Display Image Resolution is %d x %d",lcdData.height, lcdData.width); Throughput=(((lcdData.height*lcdData.width>>10)*cntPtr->dsiStats[CurrentDsiId].dsiDispEof)>>10)*8*3/cfgPtr->dsiConfig[CurrentDsiId].activeLanes; //RBG24 PRINTN("Traffic throughput in this test case is %d Mbits per lane ", Throughput); if((cntPtr->dsiStats[CurrentDsiId].dsiDispSof-cntPtr->dsiStats[CurrentDsiId].dsiDispEof)>10) { //test_result = 1; WARN("DSI SoF and EoF mismatch!!"); } if(cntPtr->dsiStats[CurrentDsiId].dsiRtnAckSotErr!=0 || cntPtr->dsiStats[CurrentDsiId].dsiRtnAckSotSyncErr!=0 || cntPtr->dsiStats[CurrentDsiId].dsiRtnEcc1BitErr!=0 || cntPtr->dsiStats[CurrentDsiId].dsiRtnEccBitsErr!=0 || cntPtr->dsiStats[CurrentDsiId].dsiRtnChecksumErr!=0 ) { test_result = 1; WARN("Error detected!!"); } //DrvDisable( drv, 0 ); //disable drv and stop traffic DrvControl( drv, DISP_CNTRL_DSI_STOP_TRAFFIC, CurrentDsiId); //test_duration=(ReadRtcWhole()-rtcTicksBefore)/32760/60; PRINT2N("DB_HW_TEST: DSI[%d] Link Speed setting is %d (0->52Mbps;1->104Mbps;2->156Mbps;3->208Mbps;4->312Mbps;5->400Mbps;6->624Mbps)",CurrentDsiId,cfgPtr->dsiConfig[CurrentDsiId].dsiLinkClock); PRINT2N("DB_HW_TEST: DSI[%d] active Lane Number is %d", CurrentDsiId, cfgPtr->dsiConfig[CurrentDsiId].activeLanes); PRINTN("DB_HW_TEST: Totoal test duration for this test case is %d minutes", Counter_1m); //real test duaration ShowRxErrors(); //PRINTN("DB_HW_TEST: SoT error number is %d", cntPtr->csiStatis.csiErrSoT); if (test_result == 0) { PRINT("DB_HW_TEST: ###################DSI test PASS ############################"); DsitestResult = DSI_TEST_PASSED; } else { WARN("DB_HW_TEST: ####################DSI test FAIL###########################"); DsitestResult = DSI_TEST_FAILED; } }
/* --------------------------------------------------------------------- * ListboxNcPaintHook * Handle PAINT events by redrawing the groupbox control * --------------------------------------------------------------------- */ static void ListboxNcPaintHook(void* w, int size_x, int size_y) { CUIWINDOW* win = (CUIWINDOW*) w; CUIRECT rc; int len; rc.W = size_x; rc.H = size_y; rc.X = 0; rc.Y = 0; if ((rc.W <= 0)||(rc.H <= 0)) return; if (win->HasBorder) { box(win->Frame, 0, 0); if (win->HasVScroll && (size_y > 2)) { WindowPaintVScroll(win, 1, size_y - 2); } } else if (win->HasVScroll) { WindowPaintVScroll(win, 0, size_y - 1); } if (win->IsEnabled) { SetColor(win->Frame, win->Color.HilightColor, win->Color.WndColor, FALSE); } else { SetColor(win->Frame, win->Color.InactTxtColor, win->Color.WndColor, FALSE); } if (!win->Text || (win->Text[0] == 0) || (!win->HasBorder)) return; len = wcslen(win->Text); if (len > rc.W - 4) { len = rc.W - 4; } MOVEYX(win->Frame, 0, 2); PRINTN(win->Frame, win->Text, len); if (rc.W > 2) { MOVEYX(win->Frame, 0, 1); PRINT(win->Frame, _T(" ")); MOVEYX(win->Frame, 0, len + 2); PRINT(win->Frame, _T(" ")); } }
void main() { int i, a = 1, b = 1, c, n; PRINTS("How many terms? \0"); SCANN(n); if (n < 3) n = 3; PRINTN(n); PRINTS(" terms: \0"); PRINTN(a); PRINTS(" \0"); PRINTN(b); PRINTS(" \0"); for (i = 0; i < n - 2; i++) { c = a + b; PRINTN(c); PRINTS(" \0"); a = b; b = c; } PRINTS("\r\n\0"); END; }
void LinkCheckColorBar() //visual inspection on coloar bar switching { //DWORD SeedSize=sizeof(PatternSeed); DWORD i=0; //repeat should <64 //BYTE *p=&Pilot[0]; //BYTE *pr=&PilotReturn[0]; //PRINTN("SeedSize is %d bytes",sizeof(PatternSeed)); BOOL test=FALSE; cfgPtr->dsiConfig[CurrentDsiId].powerMode = DSI_POWERMODE_HS_NORIHS; //lcdData.lcdPanelId = DispVirtChan; //lcdData.dataType = DISP_TEST_COLOR_BAR; lcdData.pixelFormat = DISP_PIXELFRT_RGB24; lcdDataBTA.dataAddr = (DWORD) NULL; if(TestDevice==TPO) { lcdData.height = 480; //TPO lcdData.width = 864; //TPO PRINT("MG LPDT Speed set to default 52M to match up TPO Tlpx"); } else if (TestDevice==Proteus) { lcdData.height = 440; //TPO lcdData.width = 480; //TPO PRINT("MG LPDT Speed set to default 52M to match up Proteus Tlpx"); } //lcdData.length = sizeof(PatternSeed)*repeat/sizeof(DWORD); //cast to DWORD lcdData.length = PATTERN_SIZE*repeat; //cast to DWORD lcdData.yPos = 0; lcdData.xPos = 0; lcdData.repeatTimes = 0x0; PRINTN("lcdData.length is %d bytes",lcdData.length); //PRINTN("lcdData1 is %8x bytes",lcdData.dataAddr); DispSmartPanelInit( TestDevice );//enable TPO RE_HwDelay(1000*RE_MILLISECOND); //DrvEnable( drv, 0 ); DispSmartPanelTransmit( &lcdData ); RE_HwDelay(1000*RE_MILLISECOND); //DrvDisable( drv, 0 ); DrvControl( drv, DISP_CNTRL_DSI_STOP_TRAFFIC, CurrentDsiId); }
/* --------------------------------------------------------------------- * CbDropdownPaintHook * Handle PAINT events by redrawing the control * --------------------------------------------------------------------- */ static void CbDropdownPaintHook(void* w) { CUIWINDOW* win = (CUIWINDOW*) w; CUIRECT rc; COMBOBOXDATA* data; COMBOBOXITEM* item; int pos; int cursor; int index; int len; int x,y; data = (COMBOBOXDATA*) win->InstData; if (!data) return; WindowGetClientRect(win, &rc); if ((rc.W <= 0)||(rc.H <= 0)) return; pos = WindowGetVScrollPos(win); index = 0; y = 0; cursor = 0; item = data->FirstItem; while(item) { if ((index >= pos) && (index < pos + rc.H)) { len = wcslen(item->ItemText); if (index == data->SelIndex) { SetColor(win->Win, win->Color.SelTxtColor, win->Color.WndSelColor, TRUE); cursor = y; } else { if (win->IsEnabled) { SetColor(win->Win, win->Color.WndTxtColor, win->Color.WndColor, FALSE); } else { SetColor(win->Win, win->Color.InactTxtColor, win->Color.WndColor, FALSE); } } MOVEYX(win->Win, y, 0); for (x = 0; x < rc.W; x++) { if ((x > 0) && (x <= len)) { PRINTN(win->Win, &item->ItemText[x - 1], 1); } else { PRINT(win->Win, _T(" ")); } } y ++; } else if (index >= pos + rc.H) { break; } index++; item = (COMBOBOXITEM*) item->Next; } WindowSetCursor(win, 0, cursor); }
/* --------------------------------------------------------------------- * ComboboxPaintHook * Handle PAINT events by redrawing the edit control * --------------------------------------------------------------------- */ static void ComboboxPaintHook(void* w) { CUIWINDOW* win = (CUIWINDOW*) w; CUIRECT rc; COMBOBOXDATA* data; int x; int len; int index; const wchar_t* text = _T(""); data = win->InstData; if (!data) return; WindowGetClientRect(win, &rc); if (rc.W <= 0) return; index = data->DropdownState ? data->SelIndex : data->CtrlSelIndex; if (index >= 0) { COMBOBOXITEM* item = ComboboxGetItem(data, index); if (item) { text = item->ItemText; } } len = wcslen(text); if (win->IsEnabled) { SetColor(win->Win, win->Color.SelTxtColor, win->Color.WndSelColor, TRUE); } else { SetColor(win->Win, win->Color.InactTxtColor, win->Color.WndSelColor, TRUE); } MOVEYX(win->Win, 0, 0); for(x = 0; x < rc.W - 3; x++) { if (x < len) { PRINTN(win->Win, &text[x], 1); } else { PRINT(win->Win, _T(" ")); } } if (win->IsEnabled) { SetColor(win->Win, win->Color.WndTxtColor, win->Color.WndColor, TRUE); } else { SetColor(win->Win, win->Color.InactTxtColor, win->Color.WndSelColor, TRUE); } if (rc.W > 3) { MOVEYX(win->Win, 0, x); PRINT(win->Win, _T("[v]")); } WindowSetCursor(win, 0, 0); }
void gpioBugdispCmd (char * cmd, DWORD arg1, DWORD arg2) { RE_Line line; line = getGpio( arg1 ); if ( line == INVALID_LINE ) { WARN ("! Invalid gpio line specified!"); return; } if(strcmp(cmd, "setdir") == 0) { // if arg2==0 set output direction if( arg2 == 0 ){ RE_PadConfigure( line, &gpioOutput, NULL ); PRINTN("GPIO_%d direction set to OUTPUT", arg1); } // if arg2==1 set input direction else if( arg2 == 1 ) { RE_PadConfigure( line, &gpioInput, NULL ); PRINTN("GPIO_%d direction set to INPUT", arg1); } else { PRINT("Invalid argument"); } } else if (strcmp(cmd, "setlvl") == 0) { // if arg2==0 set low if ( arg2 == 0 ){ RE_PadClear(line, PAD_OUTPUT); PRINTN("GPIO_%d level set to 0", arg1); } // if arg2==1 set high else if ( arg2 == 1 ) { RE_PadSet(line, PAD_OUTPUT); PRINTN("GPIO_%d level set to 1", arg1); } else { PRINT("Invalid argument"); } //RimSleep(5); } else if (strcmp(cmd, "read") == 0) { if( RE_PadRead(line, PAD_OUTPUT) ) { PRINTN("GPIO_%d value is 1", arg1); } else { PRINTN("GPIO_%d value is 0", arg1); } } else if (strcmp(cmd, "dump") == 0) { PRINT ("GPIO dump Not yet implemented."); } else { PRINT("***************************************************************"); PRINT("REI GPIO Bugdisp Commands:"); PRINT("pf.gpio.setdir XX Y XX = GPIO number"); PRINT(" Y = 0 for output, 1 for input"); PRINT("pf.gpio.setlvl XX Y XX = GPIO number"); PRINT(" Y = 0 for low, 1 for high"); PRINT("pf.gpio.read XX XX = GPIO number "); PRINT("pf.gpio.dump dump status of all gpios (not implemented) "); PRINT("(Note: Should run setdir first to initially configure gpio pad."); PRINT("***************************************************************"); } return; }
void MemorySystem::addressMapping( uint64_t physicalAddress, unsigned &chan, unsigned &rank, unsigned &bank, unsigned &row, unsigned &col) { uint64_t tempA, tempB; uint64_t transactionMask = TRANS_DATA_BYTES - 1; //ex: (64 bit bus width) x (8 Burst Length) - 1 = 64 bytes - 1 = 63 = 0x3f mask unsigned channelBitWidth = dramsim_log2(NUM_CHANS); unsigned rankBitWidth = dramsim_log2(NUM_RANKS); unsigned bankBitWidth = dramsim_log2(NUM_BANKS); unsigned rowBitWidth = dramsim_log2(NUM_ROWS); unsigned colBitWidth = dramsim_log2(NUM_COLS); // this forces the alignment to the width of a single burst (64 bits = 8 bytes = 3 address bits for DDR parts) unsigned byteOffsetWidth = dramsim_log2(TRANS_DATA_BYTES/BL); // Since we're assuming that a request is for BL*BUS_WIDTH(=TRANS_DATA_BYTES/BL), the bottom bits // of this address *should* be all zeros if it's not, issue a warning if ((physicalAddress & transactionMask) != 0) { PRINTN("WARNING: address 0x"<<std::hex<<physicalAddress<<std::dec<<" is not aligned to the request size of "<<TRANS_DATA_BYTES<<" bytes."); } // each burst will contain BUS_DATA_BITS/8 bytes of data, so the bottom bits (3 bits for a single channel DDR system) are // thrown away before mapping the other bits physicalAddress >>= byteOffsetWidth; // The next thing we have to consider is that when a request is made for a // we've taken into account the granulaity of a single burst by shifting // off the bottom 3 bits, but a transaction has to take into account the // burst length (i.e. the requests will be aligned to cache line sizes which // should be equal to transactionSize above). // // Since the column address increments internally on bursts, the bottom n // bits of the column (colLow) have to be zero in order to account for the // total size of the transaction. These n bits should be shifted off the // address and also subtracted from the total column width. // // I am having a hard time explaining the reasoning here, but it comes down // this: for a 64 byte transaction, the bottom 6 bits of the address must be // zero. These zero bits must be made up of the byte offset (3 bits) and also // from the bottom bits of the column // // For example: cowLowBits = log2(64bytes) - 3 bits = 3 bits unsigned colLowBitWidth = dramsim_log2(TRANS_DATA_BYTES) - byteOffsetWidth; physicalAddress >>= colLowBitWidth; unsigned colHighBitWidth = colBitWidth - colLowBitWidth; if (DEBUG_ADDR_MAP) { DEBUG("Bit widths: channel:"<<channelBitWidth<< " rank:"<<rankBitWidth<< " bank:"<<bankBitWidth<< " row:"<<rowBitWidth<< " colLow:"<<colLowBitWidth<< " colHigh:"<<colHighBitWidth<< " off:"<<byteOffsetWidth<< " Total:"<< (channelBitWidth + rankBitWidth + bankBitWidth + rowBitWidth + colLowBitWidth + colHighBitWidth + byteOffsetWidth)); } //perform various address mapping schemes if (addressMappingScheme == Scheme1) { //chan:rank:row:col:bank tempA = physicalAddress; physicalAddress = physicalAddress >> bankBitWidth; tempB = physicalAddress << bankBitWidth; bank = tempA ^ tempB; tempA = physicalAddress; physicalAddress = physicalAddress >> colHighBitWidth; tempB = physicalAddress << colHighBitWidth; col = tempA ^ tempB; tempA = physicalAddress; physicalAddress = physicalAddress >> rowBitWidth; tempB = physicalAddress << rowBitWidth; row = tempA ^ tempB; tempA = physicalAddress; physicalAddress = physicalAddress >> rankBitWidth; tempB = physicalAddress << rankBitWidth; rank = tempA ^ tempB; tempA = physicalAddress; physicalAddress = physicalAddress >> channelBitWidth; tempB = physicalAddress << channelBitWidth; chan = tempA ^ tempB; }
static void disTestDebug(char * cmd, DWORD arg1, DWORD arg2) { //Driver_t * drv = DrvGetHandle(IODRV_ID_CAMERA); if(strcmp(cmd, "cfg") == 0) { //Config * cfgPtr = DrvGetConfig(drv); if(cfgPtr == NULL) { WARN("Invalid display driver config pointer"); return; } if(arg1 == 1) { /* DSI BER test duration # */ if(arg2!=0) DSI_BER_Duration_minutes = arg2; PRINTN("Display VerifApp: BER Test Duration is set to to %d minutes", DSI_BER_Duration_minutes); } else if(arg1 == 2) { if(arg2!=0) { if(arg2==1) { CurrentDsiId=DSI_CHN_0; PRINT("Verfication: Set to DSI port 0"); } if(arg2==2) { CurrentDsiId=DSI_CHN_1; PRINT("Verfication: Set to DSI port 1"); } } } else if(arg1 == 3) { if(arg2!=0) { if(arg2==1) { cfgPtr->dsiConfig[CurrentDsiId].dsiLinkClock = DSI_LINK_CLK_52M; PRINTN("Verfication: Set DSI[%d] speed to 52M", CurrentDsiId); } else if(arg2==2) { cfgPtr->dsiConfig[CurrentDsiId].dsiLinkClock = DSI_LINK_CLK_104M; PRINTN("Verfication: Set DSI[%d] speed to 104M", CurrentDsiId); } else if(arg2==3) { cfgPtr->dsiConfig[CurrentDsiId].dsiLinkClock = DSI_LINK_CLK_156M; PRINTN("Verfication: Set DSI[%d] speed to 156M", CurrentDsiId); } else if(arg2==4) { cfgPtr->dsiConfig[CurrentDsiId].dsiLinkClock = DSI_LINK_CLK_208M; PRINTN("Verfication: Set DSI[%d] speed to 208M", CurrentDsiId); } else if(arg2==5) { cfgPtr->dsiConfig[CurrentDsiId].dsiLinkClock = DSI_LINK_CLK_312M; PRINTN("Verfication: Set DSI[%d] speed to 312M", CurrentDsiId); } else if(arg2==6) { cfgPtr->dsiConfig[CurrentDsiId].dsiLinkClock = DSI_LINK_CLK_DDR2; PRINTN("Verfication: Set DSI[%d] speed to 400M(DDR2)", CurrentDsiId); } else if(arg2==7) { cfgPtr->dsiConfig[CurrentDsiId].dsiLinkClock = DSI_LINK_CLK_624M; PRINTN("Verfication: Set DSI[%d] speed to 624M", CurrentDsiId); } else PRINT("unknown speed setting"); } } else if(arg1 == 4) { if(arg2!=0) { if(arg2==1) { cfgPtr->dsiConfig[CurrentDsiId].activeLanes = 1; } else if(arg2==2) { cfgPtr->dsiConfig[CurrentDsiId].activeLanes = 2; } else if(arg2==3) { cfgPtr->dsiConfig[CurrentDsiId].activeLanes = 3; } else PRINT("unknown active lane setting"); PRINT2N("Verfication: Set DSI[%d] active lane number to %d", CurrentDsiId, cfgPtr->dsiConfig[CurrentDsiId].activeLanes); } } else if(arg1 == 5) { PRINT("current unavailabe"); } else if(arg1 == 6) { if(arg2!=0) /* Set control option for DSI errors: 1 -continue or 2 - stop */ { if(arg2==1)//continue Err_Ctrl=1; else Err_Ctrl=2;//stop cfgPtr->dsiConfig[CurrentDsiId].errControl = (DsiErrControl)arg2; PRINT2N("Verfication: Set DSI[%d] Error control to %d", CurrentDsiId, cfgPtr->dsiConfig[CurrentDsiId].errControl); } } else if(arg1 == 7) { if(arg2!=0) { if(arg2==1) heartbeat=TRUE; if(arg2==2) heartbeat=FALSE; } } else if(arg1 == 8) { DrvDisable( drv, 0 ); PRINT("DSI driver disabled"); } else if(arg1 == 9) { if(arg2!=0) { if(arg2==1) { testRunningMode=Disp_Loopbuf; PRINTN("Verfication: Set DSI[%d] to colorbar test", CurrentDsiId); } else if(arg2==2) { testRunningMode=Disp_Pipeline; testPattern=WorstCase; PRINTN("Verfication: Set DSI[%d] to worstcase pattern test", CurrentDsiId); } else if(arg2==3) { testRunningMode=Disp_Pipeline; testPattern=BestCase; PRINTN("Verfication: Set DSI[%d] to bestcase pattern test", CurrentDsiId); } } } else if(arg1 == 21) { if(arg2!=0) { if(lcdData.pixelFormat == DISP_PIXELFRT_RGB24) repeat=arg2*3; else if(lcdData.pixelFormat == DISP_PIXELFRT_RGB16) repeat=arg2*2; else if(lcdData.pixelFormat == DISP_PIXELFRT_RGB32) repeat=arg2*4; else PRINT("unknown pixel format to repeat"); PRINTN("Verfication: seed repeat set to %d", repeat); } } else if(arg1 == 22) { if(arg2!=0) { if(arg2==1) DisplayTraffic=TRUE; if(arg2==2) DisplayTraffic=FALSE; } } else if(arg1 == 23) { if(arg2!=0) { if(arg2==1) { TestDevice=TPO; PRINT("Verfication: to test TPO"); } else if(arg2==2) { TestDevice=eDISCO; PRINT("Verfication: to test eDISCO"); } else if(arg2==3) { TestDevice=Proteus; PRINT("Verfication: to test Proteus"); } else if(arg2==0xff) { TestDevice=National; PRINT("Verfication: to test National"); } else if(arg2 < 0xff) { TestDevice=arg2; PRINTN("Verfication: to test Panel: 0x%02x", TestDevice); } else PRINT("unkonwn DSI device"); } } else { PRINT("===== Display VerifApp Help ====="); PRINT("x vf.dis.cfg 1 N : Specify test duration for DSI interface"); PRINT("x vf.dis.cfg 2 N : Specify DSI port: 1->port0;2->port1(currently not availabe)"); PRINT("x vf.dis.cfg 3 N : Specify DSI link speed: 1->52M;2->104M;3->156M;4->208M;5->312M;6->400M(DDR);7->624M"); PRINT("x vf.dis.cfg 4 N : Specify DSI active lane number: 1->1_lane; 2->2_lanes;3->3_lanes"); PRINT("x vf.dis.cfg 5 N : Specify DSI test pattern"); PRINT("x vf.dis.cfg 6 N : Set control option for DSI errors where N = 1(continue) or 2(stop)"); PRINT("x vf.dis.cfg 7 N : N=1 enable heartbeat 2: disable heartbeat"); PRINT("x vf.dis.cfg 8 : stop traffic"); PRINT("x vf.dis.cfg 9 N : N=1 cmd fifo test colorbar, pipeline N=2 load worstcase pattern, N=3 load bestcase pattern"); PRINT("x vf.dis.cfg 21 N: N link check pattern seed pixel repeat number"); PRINT("x vf.dis.cfg 22 N: N=1 display traffic N=2 no traffic display"); PRINT("x vf.dis.cfg 23 N: N=1 TPO N=2 eDISCO"); } } else if(strcmp(cmd, "para") == 0) { if(arg1 == 1) { PRINT("Display VerifApp: Running LPDT test"); LPDT_TEST=TRUE; if(LPDT_LinkCheck()==FALSE) { WARNN("DSI port[%d] failed LPDT check",CurrentDsiId); } else PRINTN("DSI port[%d] passed LPDT check",CurrentDsiId); } else if(arg1 == 2) { PRINT("Display VerifApp: BTA(with Data) tranactions through link check, setup scope for timing measurement"); PRINT("Display VerifApp: manual BTAs were inserted every 5 seconds in DSI BER test"); if(LinkCheck()==FALSE) { WARNN("DSI port[%d] failed BTA check",CurrentDsiId); } else PRINTN("DSI port[%d] passed BTA check",CurrentDsiId); } else if(arg1 == 3) { PRINT("Display VerifApp: Running ULPS testing in HS mode"); ULPS_TEST=TRUE; if(LinkCheck()==FALSE) { WARNN("DSI port[%d] failed HS ULPS check",CurrentDsiId); } else PRINTN("DSI port[%d] passed HS ULPS check",CurrentDsiId); PRINT("Display VerifApp: Running ULPS testing in LPDT mode"); ULPS_TEST=TRUE; if(LPDT_LinkCheck()==FALSE) { WARNN("DSI port[%d] failed LPDT ULPS check",CurrentDsiId); } else PRINTN("DSI port[%d] passed LPDT ULPS check",CurrentDsiId); ULPS_TEST=FALSE; } else { PRINT("===== Display VerifApp Help ====="); PRINT("x vf.dis.para 1 : LPDT test"); PRINT("x vf.dis.para 2 : BTAs test"); PRINT("x vf.dis.para 3 : ULPS test"); } } else if(strcmp(cmd, "func") == 0) { if(arg1 == 1) { PRINT("display VerifApp: DSI stress test started"); DSI_BER_Test(); } else if(arg1 == 2) { PRINT("display VerifApp: LinkCheck with current settings"); disMsg.Event = (DWORD) PLATFORM_MSG_DIS_TEST_APP; disMsg.SubMsg = (DWORD) DSI_MSG_LC_START; RE_RimPostMessage( PLATFORM_THREAD_ID_APP0, &disMsg ); } else { PRINT("===== Display VerifApp Help ====="); PRINT("x vf.dis.func 1 : run DSI stress test"); PRINT("x vf.dis.func 2 : run DSI link check test"); } } else if(strcmp(cmd, "stat") == 0) { //Config * cfgPtr = DrvGetConfig(drv); if(arg1 == 1) { PRINT("Listing DSI panel receiver errors"); ShowRxErrors(); } else { PRINT("===== Display VerifApp Help ====="); PRINT("x vf.dis.stat 1 : Show DSI Registers"); PRINT("place holder"); } } else if(strcmp(cmd, "help") == 0) { PRINT("===== Display VerifApp Help ====="); PRINT("x vf.dis.cfg: configuration command help "); PRINT("x vf.dis.para: parametric measurement command help"); PRINT("x vf.dis.func: functional test command help"); PRINT("x vf.dis.stat: status check command help"); } }
void VfDsiTestProcessMsg(MESSAGE * msg) //test thread { DWORD subMsg, eventId; DWORD i=0; subMsg = msg->SubMsg; eventId = msg->Event; //data1=msg->Data[1]; if(heartbeat==TRUE) PRINT2N("DSI Testapp: ****** Received message - %d, %d", msg->Event, msg->SubMsg); if(((lcdMsg) subMsg ==LCD_MSG_DSI_ERR)&&(eventId==PLATFORM_MSG_DISP_DRV)) { if( (cntPtr->dsiStats[CurrentDsiId].dsiRtnChecksumErr==0) && \ (cntPtr->dsiStats[CurrentDsiId].dsiRtnEcc1BitErr==0 ) && \ //(cntPtr->dsiStats[CurrentDsiId].dsiRtnEccBitsErr==0) && \ (cntPtr->dsiStats[CurrentDsiId].dsiRtnAckSotErr==0) && \ (cntPtr->dsiStats[CurrentDsiId].dsiRtnAckSotSyncErr==0) && \ (cntPtr->dsiStats[CurrentDsiId].dsiRtnAckEotSyncErr==0) && \ //(cntPtr->dsiStats[CurrentDsiId].dsiRtnHsRcvTimeoutErr==0) && \ //(cntPtr->dsiStats[CurrentDsiId].dsiRtnEscModEntryCmdErr==0) && \ //(cntPtr->dsiStats[CurrentDsiId].dsiRtnLpTransSyncErr==0) && \ //(cntPtr->dsiStats[CurrentDsiId].dsiRtnFalseCtlErr ==0) && \ //(cntPtr->dsiStats[CurrentDsiId].dsiRtnTransLenErr==0) && (cntPtr->dsiStats[CurrentDsiId].dsiRtnDsiProErr==1)) { WARN("DSI Protocol Violation Error captured"); // suspect only read two bytes from TPO causing protocol violaiton, remove this once Marvell got this issue fixed on MG B0 } else { WARN("DSI Error captured"); test_result = 1; if(Err_Ctrl==2) { WARN("Packet Error captured, stop streaming"); //test_result = 1; StopDsiTest(); //return; } } } else if(((DsiTestMsg)subMsg ==DIS_MSG_TEST_TIMER_START)&&(eventId==PLATFORM_MSG_DIS_TEST_APP)) { PRINT("enter start msg..."); Dsi_tmr = RE_TimerCreate(); RE_TimerStart(Dsi_tmr, msg->Data[0] * RE_TicksPerSecond(), (msg->Data[1] == 0) ? TIMER_ONE_SHOT : TIMER_PERIODIC, PLATFORM_MSG_DIS_TEST_APP); PRINT2N("timer started: %d, %d", msg->Data[0], msg->Data[1]); Counter_5s=0; Counter_1m=0; Throughput=0; test_result = 0; SoF=0; EoF=0; //DrvDisable( drv, 0 ); DrvControl( drv, DISP_CNTRL_DSI_STOP_TRAFFIC, CurrentDsiId); if(staPtr ->dsiStatus[CurrentDsiId].enabled==TRUE) { WARN("display driver already enabled..."); //WARN("display driver already enabled, this test is not running.."); //test_result = 1; //return; } DrvControl(drv, DISP_CNTRL_DSI_RESET_STATISTICS,CurrentDsiId); PRINTN("Init Number of frames transmitted at DSI panel now is %d", cntPtr->dsiStats[CurrentDsiId].dsiDispEof); PRINT( "DSI Testapp: Initialize Samsung Chip" ); DispSetDsiId(CurrentDsiId); if(testRunningMode ==Disp_Pipeline) { lcdData.dataType = DISP_DATA_PIXELS; PRINT( "DSI Testapp: Running at pipeline mode" ); } else if(testRunningMode ==Disp_Loopbuf) { lcdData.dataType = DISP_TEST_COLOR_BAR; PRINT( "DSI Testapp: Running at loop buffer mode" ); } if(LinkCheck()==FALSE) { WARN("PilotCheck fails, quitting this test.."); test_result = 1; StopDsiTest(); return; } DispSetDsiId(CurrentDsiId); //DrvDisable( drv, 0 ); // //BTA lcdData init lcdDataBTA.dataAddr = (DWORD) NULL; lcdDataBTA.dataType = DISP_DATA_DSI_BTA; cfgPtr->dsiConfig[CurrentDsiId].powerMode = DSI_POWERMODE_HS_NORIHS; lcdData.lcdPanelId = DispVirtChan; //lcdData.dataType = DISP_DATA_PIXELS; lcdData.pixelFormat = DISP_PIXELFRT_RGB24; if(testPattern==WorstCase) { for(i=0;i<PATTERN_SIZE*repeat;i++) { //Pilot[i]=PatternSeed[0][i/repeat]; Pilot[i]=PatternSeed[0][rand()%(PATTERN_SIZE)]; PRINT2N("Pilot[%d] is 0x%x ",i,Pilot[i]); } } else if(testPattern==BestCase) { for(i=0;i<PATTERN_SIZE*repeat;i++) { Pilot[i]=PatternSeed[1][i/repeat]; PRINT2N("Pilot[%d] is 0x%x ",i,Pilot[i]); } } //lcdData.dataAddr = (DWORD) NULL; if(lcdData.dataType == DISP_TEST_COLOR_BAR) lcdData.dataAddr = (DWORD) NULL; else lcdData.dataAddr = (DWORD)&Pilot[0]; lcdData.length = PATTERN_SIZE*repeat; if(TestDevice==TPO) { lcdData.height = 480; //TPO lcdData.width = 864; //TPO } else if (TestDevice==eDISCO) { lcdData.height = 480; //eDisco lcdData.width = 640; //eDisco } else if (TestDevice==Proteus) { lcdData.height = 440; //eDisco lcdData.width = 480; //eDisco } lcdData.yPos = 0; lcdData.xPos = 0; lcdData.repeatTimes = (0xFFFFFFFF-10); //DrvEnable( drv, 0 ); // DispSmartPanelInit( 0 );//enable TPO //RE_HwDelay(100*RE_MILLISECOND); //DrvEnable( drv, 0 ); RE_HwDelay(100*RE_MILLISECOND); DispSmartPanelTransmit( &lcdData ); //start transmitting.. RimSleep(4000); if(staPtr ->dsiStatus[CurrentDsiId].enabled==TRUE) //staPtr ->dsiStatus[CurrentDsiId].enabled==DSI_ENABLED { PRINT("DSI enabled, you should see me"); } //pf.cam.show 0 1 for counters PRINTN("Number of frames transmitted at DSI panel SoF now is %d",cntPtr->dsiStats[CurrentDsiId].dsiDispSof); //total frame received PRINTN("Number of frames transmitted at DSI panel now is %d",cntPtr->dsiStats[CurrentDsiId].dsiDispEof); //total frame received if(cntPtr->dsiStats[CurrentDsiId].dsiDispEof==0) { //WARNN("Number of frames transmitted at DSI panel now is %d", cntPtr->dsiStats[CurrentDsiId].dsiDispEof); //total frame received WARN("No Frame transmitted in current setting, this test is not running"); test_result = 1; PRINT2N("DSI[%d] Link Speed setting is %d 0->52Mbps;1->104Mbps;2->156Mbps;3->208Mbps;4->312Mbps;6->624Mbps",CurrentDsiId,cfgPtr->dsiConfig[CurrentDsiId].dsiLinkClock); return; } } else if(((DsiTestMsg)subMsg ==DIS_MSG_TEST_TIMER_EXPIRED)&&(eventId==PLATFORM_MSG_DIS_TEST_APP)) { Counter_5s++; if(Counter_5s%12==0) { Counter_1m++; PRINTN("%d Minutes elapsed..",Counter_1m); PRINTN("Totoal DSI Tx SoF is %d",cntPtr->dsiStats[CurrentDsiId].dsiDispSof); //total frame received PRINTN("Totoal DSI Tx EoF is %d",cntPtr->dsiStats[CurrentDsiId].dsiDispEof); //total frame received if((SoF==cntPtr->dsiStats[CurrentDsiId].dsiDispSof)||(EoF==cntPtr->dsiStats[CurrentDsiId].dsiDispEof)) { WARN("Frame freezing"); test_result = 1; StopDsiTest(); return; } SoF=cntPtr->dsiStats[CurrentDsiId].dsiDispSof; cntPtr->dsiStats[CurrentDsiId].dsiDispEof; } if((Counter_1m <DSI_BER_Duration_minutes) && (cfgPtr->dsiConfig[CurrentDsiId].status==DSI_ENABLED)) { //RimSleep(5000); //if(heartbeat==TRUE) //DrvDisable( drv, 0 ); //stop traffic //DrvControl( drv, DISP_CNTRL_DSI_STOP_TRAFFIC, CurrentDsiId); //RE_HwDelay(10*RE_MILLISECOND); //DrvEnable( drv, 0 ); //start bta if(heartbeat==TRUE) { PRINT("Checking Rx error"); } //RE_HwDelay(50*RE_MILLISECOND); //RimSleep(100); //RE_HwDelay(10*RE_MILLISECOND); DrvControl( drv, DISP_CNTRL_DSI_STOP_TRAFFIC, CurrentDsiId); // DrvDisable( drv, 0 ); RimSleep(100); lcdData.repeatTimes = (0xFFFFFFFF-10); //DrvEnable( drv, 0 ); //RE_HwDelay(10*RE_MILLISECOND); DispSmartPanelTransmit( &lcdData ); //start transmitting.. } else { StopDsiTest(); } } else if(((DsiTestMsg)subMsg ==DSI_MSG_LC_START)&&(eventId==PLATFORM_MSG_DIS_TEST_APP)) { /* if(TestDevice==TPO&&LinkCheckTPO()==TRUE) PRINTN("TPO DSI port[%d] passed link check",CurrentDsiId); else if(TestDevice==eDISCO&&LinkCheck()==TRUE) PRINTN("DSI port[%d] passed link check",CurrentDsiId); else WARNN("DSI port[%d] failed link check",CurrentDsiId); */ if(LinkCheck()==FALSE) { WARNN("DSI port[%d] failed link check",CurrentDsiId); } else PRINTN("DSI port[%d] passed link check",CurrentDsiId); } else WARN("undefiend message"); RimSleep(500); }
BOOL LPDT_LinkCheck() { DWORD i=0; //repeat should <64 BOOL test=FALSE; for(i=0;i<PATTERN_SIZE*repeat;i++) { Pilot[i]=PatternSeed[0][i/repeat]; } for(i=0;i<PATTERN_SIZE*repeat;i++) { PilotReturn[i]=0; } cfgPtr->dsiConfig[CurrentDsiId].powerMode = DSI_POWERMODE_LPDT; if(TestDevice==TPO) { lcdData.height = 480; //TPO lcdData.width = 864; //TPO PRINT("MG LPDT Speed set to default 52M to match up TPO Tlpx"); } else if (TestDevice==Proteus) { lcdData.height = 440; //TPO lcdData.width = 480; //TPO PRINT("MG LPDT Speed set to default 52M to match up Proteus Tlpx"); } lcdData.dataType = DISP_DATA_PIXELS; lcdData.pixelFormat = DISP_PIXELFRT_RGB24; lcdData.dataAddr = (DWORD)&Pilot[0]; lcdData.length = PATTERN_SIZE*repeat; //cast to DWORD lcdData.yPos = 0; lcdData.xPos = 0; lcdData.repeatTimes = 0x0; PRINTN("lcdData.length is %d bytes",lcdData.length); DispSetDsiId( CurrentDsiId ); DispSmartPanelInit( TestDevice );//enable TPO DispSmartPanelTransmit( &lcdData ); RimSleep(2000); lcdData.dataAddr = (DWORD)&PilotReturn[0]; DispSmartPanelReceive( &lcdData ); RimSleep(2000); if(ULPS_TEST==TRUE) { PRINT("Entering ULPS..."); DrvControl( drv, DISP_CNTRL_DSI_ENTER_ULPS, CurrentDsiId); RimSleep(1000); PRINT("Exiting ULPS..."); DrvControl( drv, DISP_CNTRL_DSI_EXIT_ULPS, CurrentDsiId); //RE_HwDelay(1000*RE_MILLISECOND); } //DrvDisable( drv, 0 ); if(DisplayTraffic==TRUE) { for(i=0;i<PATTERN_SIZE*repeat;i++) { PRINT2N("Pilot[%d] is 0x%x ",i,Pilot[i]); } for(i=0;i<PATTERN_SIZE*repeat;i++) { PRINT2N("PilotReturn[%d] is 0x%x ",i,PilotReturn[i]); } } for(i=0;i<(PATTERN_SIZE*repeat);i++) { if(Pilot[i]!=PilotReturn[i]) { PRINT3N("Pilot[%d] is 0x%x, but PilotReturn is 0x%x ",i,Pilot[i],PilotReturn[i]); test=FALSE; break; } test=TRUE; } if(test==TRUE) return TRUE; else return FALSE; }
static void ShowRxErrors() { PRINTN("DB_HW_TEST: Error Status for DSI port[%d].... ",CurrentDsiId); PRINTN("DB_HW_TEST: CRC error number is %d", cntPtr->dsiStats[CurrentDsiId].dsiRtnChecksumErr); PRINTN("DB_HW_TEST: 1b ECC error number is %d", cntPtr->dsiStats[CurrentDsiId].dsiRtnEcc1BitErr); PRINTN("DB_HW_TEST: 2b ECC error number is %d", cntPtr->dsiStats[CurrentDsiId].dsiRtnEccBitsErr); PRINTN("DB_HW_TEST: SoT error number is %d", cntPtr->dsiStats[CurrentDsiId].dsiRtnAckSotErr); PRINTN("DB_HW_TEST: SoT Sync error number is %d", cntPtr->dsiStats[CurrentDsiId].dsiRtnAckSotSyncErr); PRINTN("DB_HW_TEST: EoT error number is %d", cntPtr->dsiStats[CurrentDsiId].dsiRtnAckEotSyncErr); PRINTN("DB_HW_TEST: HS Rx timeout error number is %d", cntPtr->dsiStats[CurrentDsiId].dsiRtnHsRcvTimeoutErr); PRINTN("DB_HW_TEST: Escape mode entry error number is %d", cntPtr->dsiStats[CurrentDsiId].dsiRtnEscModEntryCmdErr); PRINTN("DB_HW_TEST: LP transmit error number is %d", cntPtr->dsiStats[CurrentDsiId].dsiRtnLpTransSyncErr); PRINTN("DB_HW_TEST: Flase control error number is %d", cntPtr->dsiStats[CurrentDsiId].dsiRtnFalseCtlErr); PRINTN("DB_HW_TEST: Invalid transmission length error number is %d", cntPtr->dsiStats[CurrentDsiId].dsiRtnTransLenErr); PRINTN("DB_HW_TEST: DSI protocol violation error number is %d", cntPtr->dsiStats[CurrentDsiId].dsiRtnDsiProErr); }
/* * DrvFwkHdmiTxDebug * * Provides debugging hooks for use with either the BugDisp * or serial debugger. * * @param cmd - Pointer to debug command string. * @param arg1 - The first argument to the debug command. * @param arg2 - The second argument to the debug command. * * @return None. */ void DrvFwkHdmiTxDebug(char *cmd, DWORD arg1, DWORD arg2) { char *dmStr[] = { "Graphics Mode", "Video Mode" }; char *pfStr[] = { "RGB565", "RGB1555", "RGB888P", "RGB888UP", "RGBA888", "YUV422P", "YUV422PL", "YUV420PL", "", "PALETTE4", "PALETTE8", "RGB888A" }; char *alStr[] = { "Stream Header", "2 Channels", "3 Channels", "4 Channels", "5 Channels", "6 Channels", "7 Channels", "8 Channels" }; char *afStr[] = { "Stream Header", "32 KHz", "44.1 KHz", "48 KHz", "88.2 KHz", "96 KHz", "176.4 KHz", "192 KHz" }; char *asStr[] = { "Stream Header", "16 Bits", "20 Bits", "24 Bits" }; Driver_t *hdmitx = DrvGetHandle( IODRV_ID_DISPLAY ); HdmiTxConfig_t *config = DrvGetConfig( hdmitx ); if( strcmp(cmd, "cfg") == 0 ) { PRINT( "HDMI TX Driver Configuration Data:" ); PRINTN( " Display Mode : %s", dmStr[config->DispMode] ); PRINTN( " Video Format : %d", config->DestFormat ); PRINTN( " Source Pixel Format : %s", pfStr[config->SrcFormat] ); PRINTN( " Audio Channel Count : %s", alStr[config->AudChanCount] ); PRINTN( " Sampling Frequency : %s", afStr[config->SampleFreq] ); PRINTN( " Sampling Size : %s", asStr[config->SampleSize] ); } else if( strcmp(cmd, "dm") == 0 ) { config->DispMode = (DisplayMode_t)arg1; PRINTN( "Display %s configured.", dmStr[config->DispMode] ); } else if( strcmp(cmd, "vf") == 0 ) { config->DestFormat = (VideoFormat_t)arg1; PRINTN( "Deep color mode %d configured.", config->DestFormat ); } else if( strcmp(cmd, "pf") == 0 ) { if ( arg1 == 0) config->SrcFormat = PF_RGB565; else if ( arg1 == 1) config->SrcFormat = PF_RGB1555; else if ( arg1 == 2) config->SrcFormat = PF_RGB888P; else if ( arg1 == 3) config->SrcFormat = PF_RGB888UP; else if ( arg1 == 4) config->SrcFormat = PF_RGBA888; else if ( arg1 == 5) config->SrcFormat = PF_YUV422P; else if ( arg1 == 6) config->SrcFormat = PF_YUV422PL; else if ( arg1 == 7) config->SrcFormat = PF_YUV420PL; else if ( arg1 == 9) config->SrcFormat = PF_PALETTE4; else if ( arg1 == 10) config->SrcFormat = PF_PALETTE8; else if ( arg1 == 11) config->SrcFormat = PF_RGB888A; else WARNN( "Invalid source pixel format %d.", arg1 ); PRINTN( "Color Indicator %s configured.", pfStr[config->SrcFormat] ); } else if( strcmp(cmd, "al") == 0 ) { if ( arg1 == 0) config->AudChanCount = AL_STREAM; else if ( arg1 == 2) config->AudChanCount = AL_2CH; else if ( arg1 == 3) config->AudChanCount = AL_3CH; else if ( arg1 == 4) config->AudChanCount = AL_4CH; else if ( arg1 == 5) config->AudChanCount = AL_5CH; else if ( arg1 == 6) config->AudChanCount = AL_6CH; else if ( arg1 == 7) config->AudChanCount = AL_7CH; else if ( arg1 == 8) config->AudChanCount = AL_8CH; else WARNN( "Invalid audio channel count %d.", arg1 ); PRINTN( "Audio channel count %s configured.", alStr[config->AudChanCount] ); } else if( strcmp(cmd, "af") == 0 ) { if ( arg1 == 0) config->SampleFreq = AF_STREAM; else if ( arg1 == 1) config->SampleFreq = AF_32KHZ; else if ( arg1 == 2) config->SampleFreq = AF_44P1KHZ; else if ( arg1 == 3) config->SampleFreq = AF_48KHZ; else if ( arg1 == 4) config->SampleFreq = AF_88P2KHZ; else if ( arg1 == 5) config->SampleFreq = AF_96KHZ; else if ( arg1 == 6) config->SampleFreq = AF_176P4KHZ; else if ( arg1 == 7) config->SampleFreq = AF_192KHZ; else WARNN( "Invalid sampling frequency %d.", arg1 ); PRINTN( "Sampling frequency %s configured.", afStr[config->SampleFreq] ); } else if( strcmp(cmd, "as") == 0 ) { if ( arg1 == 0) config->SampleSize = AS_STREAM; else if ( arg1 == 1) config->SampleSize = AS_16BIT; else if ( arg1 == 2) config->SampleSize = AS_20BIT; else if ( arg1 == 3) config->SampleSize = AS_24BIT; else WARNN( "Invalid sampling size %d.", arg1 ); PRINTN( "Sampling size %s configured.", asStr[config->SampleSize] ); } else if( strcmp(cmd, "con") == 0 ) { int ret; if( arg1 ) { ret = DrvControl( hdmitx, HDMITX_CMD_CONNECT ); PRINTN( "HDMI TX controller connect %s.", (ret==0)?"completed":"failed" ); } else { ret = DrvControl( hdmitx, HDMITX_CMD_DISCONNECT ); PRINTN( "HDMI TX controller disconnect %s.", (ret==0)?"completed":"failed" ); } } else if( strcmp(cmd, "en") == 0 ) { int ret; if( arg1 ) { ret = DrvEnable( hdmitx, 0 ); PRINTN( "HDMI TX controller enable operation %s.", (ret==0)?"completed":"failed" ); } else { ret = DrvDisable( hdmitx, 0 ); PRINTN( "HDMI TX controller disable operation %s.", (ret==0)?"completed":"failed" ); } } else if( strcmp(cmd, "st") == 0 ) { int ret; if( arg1 ) { ret = DrvControl( hdmitx, HDMITX_CMD_START_TRANSMIT ); PRINTN( "HDMI TX controller start transmission %s.", (ret==0)?"completed":"failed" ); } else { ret = DrvControl( hdmitx, HDMITX_CMD_STOP_TRANSMIT ); PRINTN( "HDMI TX controller stop transmission %s.", (ret==0)?"completed":"failed" ); } } else if( strcmp(cmd, "reg") == 0 ) { DrvControl( hdmitx, HDMITX_CMD_SHOW_REGS ); } else if( strcmp(cmd, "stat") == 0 ) { PRINTN( "admaCh0Ctr = 0x%08x", admaCh0Ctr ); PRINTN( "admaCh1Ctr = 0x%08x", admaCh1Ctr ); PRINTN( "sspaTxCtr = 0x%08x", sspaTxCtr ); PRINTN( "sspaRxCtr = 0x%08x", sspaRxCtr ); } else { PRINT("----------------------------------------------------------------------"); PRINT( "HDMI TX Driver Debug Commands:"); PRINT( " x pf.hdmi.cfg : Show current configuration data " ); PRINT( " x pf.hdmi.dm X : Configure display mode " ); PRINT( " [0] Graphics Mode " ); PRINT( " [1] Video Mode " ); PRINT( " x pf.hdmi.vf X : Configure video output format " ); PRINT( " (Please refer to CEA-861 for video " ); PRINT( " identification codes) " ); PRINT( " x pf.hdmi.ci X : Configure source pixel format " ); PRINT( " [0] RGB565 " ); PRINT( " [1] RGB1555 " ); PRINT( " [2] RGB888P " ); PRINT( " [3] RGB888UP " ); PRINT( " [4] RGBA888 " ); PRINT( " [5] YUV422P " ); PRINT( " [6] YUV422PL " ); PRINT( " [7] YUV420PL " ); PRINT( " [9] PALETTE4 " ); PRINT( " [10] PALETTE8 " ); PRINT( " [11] RGB888A " ); PRINT( " x pf.hdmi.al X : Configure audio channnel count " ); PRINT( " [0] Stream Header " ); PRINT( " [2] 2 Channels " ); PRINT( " [3] 3 Channels " ); PRINT( " [4] 4 Channels " ); PRINT( " [5] 5 Channels " ); PRINT( " [6] 6 Channels " ); PRINT( " [7] 7 Channels " ); PRINT( " [8] 8 Channels " ); PRINT( " x pf.hdmi.af X : Configure sampling frequency " ); PRINT( " [0] Stream Header " ); PRINT( " [1] 32 KHz " ); PRINT( " [2] 44.1 KHz " ); PRINT( " [3] 48 KHz " ); PRINT( " [4] 88.2 KHz " ); PRINT( " [5] 96 KHz " ); PRINT( " [6] 176.4 KHz " ); PRINT( " [7] 192 KHz " ); PRINT( " x pf.hdmi.as X : Configure sampling size " ); PRINT( " [0] Stream Header " ); PRINT( " [1] 16 Bits " ); PRINT( " [2] 20 Bits " ); PRINT( " [3] 24 Bits " ); PRINT( " x pf.hdmi.con X : Connect/disconnect an HDMI receiver " ); PRINT( " [0] Disconnect " ); PRINT( " [1] Connect " ); PRINT( " x pf.hdmi.en X : Enable/disable the HDMI transmitter " ); PRINT( " [0] Disable " ); PRINT( " [1] Enable " ); PRINT( " x pf.hdmi.st X : Start/stop the HDMI transmitter " ); PRINT( " [0] Start " ); PRINT( " [1] Stop " ); PRINT( " x pf.hdmi.reg : Dumps all HDMI transmitter registers" ); } }