root/trunk/libfreebob/src/bebob/bebob_dl_mgr.cpp

Revision 365, 21.1 kB (checked in by wagi, 17 years ago)

src/libfreebobavc/serialize* moved to src/libfreebob/avc_serialize*, all includes adapted
src/bebob/bebob_serialize* moved to src/libutil/serialize*
src/libutil/serialize: use Glib::ustring instead of std::string.
src/configrom: serialize and deserialize added (not finished)
src/devicemanager: load and save cached functionality added (not finished)

various small whitespace updates (emacs lässt grüssen :))

Line 
1 /* bebob_dl_mgr.cpp
2  * Copyright (C) 2006 by Daniel Wagner
3  *
4  * This file is part of FreeBoB.
5  *
6  * FreeBoB is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  * FreeBoB is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with FreeBoB; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
18  * MA 02111-1307 USA.
19  */
20
21 #include "bebob_dl_mgr.h"
22 #include "bebob_dl_codes.h"
23 #include "bebob_dl_bcd.h"
24
25 #include "configrom.h"
26 #include "libfreebobavc/ieee1394service.h"
27 #include "libfreebobavc/avc_serialize.h"
28
29 #include <netinet/in.h>
30
31 #include <cstdio>
32
33 namespace BeBoB {
34     enum {
35         AddrRegInfo    = 0xffffc8020000ULL,
36         AddrRegReq     = 0xffffc8021000ULL,
37         AddrRegReqBuf  = 0xffffc8021040ULL,
38         AddrRegResp    = 0xffffc8029000ULL,
39         AddrRegRespBuf = 0xffffc8029040ULL,
40     };
41
42     enum {
43         RegInfoManufactorIdOffset =      0x00,
44         RegInfoProtocolVersionOffset =   0x08,
45         RegInfoBootloaderVersionOffset = 0x0c,
46         RegInfoGUID =                    0x10,
47         RegInfoHardwareModelId =         0x18,
48         RegInfoHardwareRevision =        0x1c,
49         RegInfoSoftwareDate =            0x20,
50         RegInfoSoftwareTime =            0x28,
51         RegInfoSoftwareId =              0x30,
52         RegInfoSoftwareVersion =         0x34,
53         RegInfoBaseAddress =             0x38,
54         RegInfoMaxImageLen =             0x3c,
55         RegInfoBootloaderDate =          0x40,
56         RegInfoBootloaderTime =          0x48,
57         RegInfoDebuggerDate =            0x50,
58         RegInfoDebuggerTime =            0x58,
59         RegInfoDebuggerId =              0x60,
60         RegInfoDebuggerVersion =         0x64
61     };
62
63     enum {
64         MaxRetries = 10,
65     };
66
67     IMPL_DEBUG_MODULE( BootloaderManager, BootloaderManager, DEBUG_LEVEL_NORMAL );
68 }
69
70 BeBoB::BootloaderManager::BootloaderManager(Ieee1394Service& ieee1349service,
71                                             fb_nodeid_t nodeId )
72     : m_ieee1394service( &ieee1349service )
73     , m_protocolVersion( eBPV_Unknown )
74     , m_isAppRunning( false )
75     , m_forceEnabled( false )
76     , m_bStartBootloader( true )
77 {
78     memset( &m_cachedInfoRegs, 0, sizeof( m_cachedInfoRegs ) );
79
80     m_configRom = new ConfigRom( *m_ieee1394service, nodeId );
81     // XXX throw exception if initialize fails!
82     m_configRom->initialize();
83     if ( !cacheInfoRegisters() ) {
84         debugError( "BootloaderManager: could not cache info registers\n" );
85     }
86
87     switch(  m_cachedInfoRegs.m_protocolVersion ) {
88     case 1:
89         m_protocolVersion = eBPV_V1;
90         break;
91     case 3:
92         m_protocolVersion = eBPV_V3;
93         break;
94     default:
95         // exception?
96         break;
97     }
98
99     pthread_mutex_init( &m_mutex, 0 );
100     pthread_cond_init( &m_cond, 0 );
101
102     m_functor = new MemberFunctor0< BeBoB::BootloaderManager*,
103                 void (BeBoB::BootloaderManager::*)() >
104                 ( this, &BeBoB::BootloaderManager::busresetHandler, false );
105     m_ieee1394service->addBusResetHandler( m_functor );
106 }
107
108 BeBoB::BootloaderManager::~BootloaderManager()
109 {
110     m_ieee1394service->remBusResetHandler( m_functor );
111     delete( m_functor );
112
113     delete m_configRom;
114
115     pthread_cond_destroy( &m_cond );
116     pthread_mutex_destroy( &m_mutex );
117 }
118
119 bool
120 BeBoB::BootloaderManager::cacheInfoRegisters()
121 {
122     if ( !m_configRom->updatedNodeId() ) {
123         debugError( "cacheInfoRegisters: did not find device anymore\n" );
124         return false;
125     }
126
127     if ( !m_ieee1394service->read(
128              0xffc0 | m_configRom->getNodeId(),
129              AddrRegInfo,
130              sizeof( m_cachedInfoRegs )/4,
131              reinterpret_cast<fb_quadlet_t*>( &m_cachedInfoRegs ) ) )
132     {
133         return false;
134     }
135
136     if ( m_cachedInfoRegs.m_bootloaderVersion != 0x0 ) {
137         m_isAppRunning = false;
138     } else {
139         m_isAppRunning = true;
140     }
141
142     m_cachedInfoRegs.m_guid = ( m_cachedInfoRegs.m_guid >> 32 )
143                               | ( m_cachedInfoRegs.m_guid << 32 );
144
145     return true;
146 }
147
148 bool
149 BeBoB::BootloaderManager::cacheInfoRegisters( int retries )
150 {
151     for ( int i = 0; i < retries; ++i ) {
152         if ( cacheInfoRegisters() ) {
153             return true;
154         }
155         sleep( 1 );
156     }
157
158     return false;
159 }
160
161 void
162 BeBoB::BootloaderManager::printInfoRegisters()
163 {
164     using namespace std;
165
166     if ( !cacheInfoRegisters() ) {
167         debugError( "Could not read info registers\n" );
168         return;
169     }
170
171     printf( "Info Registers\n" );
172     printf( "\tManufactors Id:\t\t%s\n",
173             makeString( m_cachedInfoRegs.m_manId ).c_str() );
174     printf( "\tProtocol Version:\t0x%08x\n",
175             m_cachedInfoRegs.m_protocolVersion );
176     printf( "\tBootloader Version:\t0x%08x\n",
177             m_cachedInfoRegs.m_bootloaderVersion );
178     printf( "\tGUID:\t\t\t0x%08x%08x\n",
179             ( unsigned int )( m_cachedInfoRegs.m_guid >> 32 ),
180             ( unsigned int )( m_cachedInfoRegs.m_guid & 0xffffffff ) );
181     printf( "\tHardware Model ID:\t0x%08x\n",
182             m_cachedInfoRegs.m_hardwareModelId );
183     printf( "\tHardware Revision:\t0x%08x\n",
184             m_cachedInfoRegs.m_hardwareRevision );
185     if (  m_cachedInfoRegs.m_softwareDate
186           && m_cachedInfoRegs.m_softwareTime )
187     {
188         printf( "\tSoftware Date:\t\t%s, %s\n",
189                 makeDate( m_cachedInfoRegs.m_softwareDate ).c_str(),
190                 makeTime( m_cachedInfoRegs.m_softwareTime ).c_str() );
191     }
192     printf( "\tSoftware Id:\t\t0x%08x\n", m_cachedInfoRegs.m_softwareId );
193     printf( "\tSoftware Version:\t0x%08x\n",
194             m_cachedInfoRegs.m_softwareVersion );
195     printf( "\tBase Address:\t\t0x%08x\n", m_cachedInfoRegs.m_baseAddress );
196     printf( "\tMax. Image Len:\t\t0x%08x\n", m_cachedInfoRegs.m_maxImageLen );
197     if ( m_cachedInfoRegs.m_bootloaderDate
198          && m_cachedInfoRegs.m_bootloaderTime )
199     {
200         printf( "\tBootloader Date:\t%s, %s\n",
201                 makeDate( m_cachedInfoRegs.m_bootloaderDate ).c_str(),
202                 makeTime( m_cachedInfoRegs.m_bootloaderTime ).c_str() );
203     }
204     if ( m_cachedInfoRegs.m_debuggerDate
205          && m_cachedInfoRegs.m_debuggerTime )
206     {
207         printf( "\tDebugger Date:\t\t%s, %s\n",
208                 makeDate( m_cachedInfoRegs.m_debuggerDate ).c_str(),
209                 makeTime( m_cachedInfoRegs.m_debuggerTime ).c_str() );
210     }
211     printf( "\tDebugger Id:\t\t0x%08x\n", m_cachedInfoRegs.m_debuggerId );
212     printf( "\tDebugger Version:\t0x%08x\n",
213             m_cachedInfoRegs.m_debuggerVersion );
214 }
215
216 bool
217 BeBoB::BootloaderManager::downloadFirmware( std::string filename )
218 {
219     using namespace std;
220
221     printf( "parse BCD file\n" );
222     std::auto_ptr<BCD> bcd = std::auto_ptr<BCD>( new BCD( filename ) );
223     if ( !bcd.get() ) {
224         debugError( "downloadFirmware: Could not open or parse BCD '%s'\n",
225                     filename.c_str() );
226         return false;
227     }
228     if ( !bcd->parse() ) {
229         debugError( "downloadFirmware: BCD parsing failed\n" );
230         return false;
231     }
232
233     printf( "check firmware device compatibility... " );
234     if ( !m_forceEnabled ) {
235         if ( !checkDeviceCompatibility( *bcd ) ) {
236             printf( "failed.\n" );
237             return false;
238         }
239         printf( "ok\n" );
240     } else {
241         printf( "forced\n" );
242     }
243
244     if ( m_bStartBootloader ) {
245         printf( "prepare for download (start bootloader)\n" );
246         if ( !startBootloaderCmd() ) {
247             debugError( "downloadFirmware: Could not start bootloader\n" );
248             return false;
249         }
250     }
251
252     printf( "start downloading protocol for application image\n" );
253     if ( !downloadObject( *bcd, eOT_Application ) ) {
254         debugError( "downloadFirmware: Firmware download failed\n" );
255         return false;
256     }
257
258     printf( "start downloading protocol for CnE\n" );
259     if ( !downloadObject( *bcd, eOT_CnE ) ) {
260         debugError( "downloadFirmware: CnE download failed\n" );
261         return false;
262     }
263
264     printf( "setting CnE to factory default settings\n" );
265     if ( !initializeConfigToFactorySettingCmd() ) {
266         debugError( "downloadFirmware: Could not reinitalize CnE\n" );
267         return false;
268     }
269
270     printf( "start application\n" );
271     if ( !startApplicationCmd() ) {
272         debugError( "downloadFirmware: Could not restart application\n" );
273         return false;
274     }
275
276     return true;
277 }
278
279 bool
280 BeBoB::BootloaderManager::downloadCnE( std::string filename )
281 {
282     using namespace std;
283
284     printf( "parse BCD file\n" );
285     std::auto_ptr<BCD> bcd = std::auto_ptr<BCD>( new BCD( filename ) );
286     if ( !bcd.get() ) {
287         debugError( "downloadCnE: Could not open or parse BCD '%s'\n",
288                     filename.c_str() );
289         return false;
290     }
291     if ( !bcd->parse() ) {
292         debugError( "downloadCnE: BCD parsing failed\n" );
293         return false;
294     }
295
296     printf( "check firmware device compatibility... " );
297     if ( !m_forceEnabled ) {
298         if ( !checkDeviceCompatibility( *bcd ) ) {
299             printf( "failed.\n" );
300             return false;
301         }
302         printf( "ok\n" );
303     } else {
304         printf( "forced\n" );
305     }
306
307     if ( m_bStartBootloader ) {
308         printf( "prepare for download (start bootloader)\n" );
309         if ( !startBootloaderCmd() ) {
310             debugError( "downloadCnE: Could not start bootloader\n" );
311             return false;
312         }
313     }
314
315     printf( "start downloading protocol for CnE\n" );
316     if ( !downloadObject( *bcd, eOT_CnE ) ) {
317         debugError( "downloadCnE: CnE download failed\n" );
318         return false;
319     }
320
321     printf( "setting CnE to factory default settings\n" );
322     if ( !initializeConfigToFactorySettingCmd() ) {
323         debugError( "downloadFirmware: Could not reinitalize CnE\n" );
324         return false;
325     }
326
327     printf( "start application\n" );
328     if ( !startApplicationCmd() ) {
329         debugError( "downloadCnE: Could not restart application\n" );
330         return false;
331     }
332
333     return true;
334 }
335
336
337 bool
338 BeBoB::BootloaderManager::downloadObject( BCD& bcd, EObjectType eObject )
339 {
340     using namespace std;
341
342     CommandCodesDownloadStart::EObject eCCDSObject;
343     fb_quadlet_t baseAddress;
344     fb_quadlet_t imageLength;
345     fb_quadlet_t crc;
346     fb_quadlet_t offset;
347
348     switch ( eObject ) {
349     case eOT_Application:
350         eCCDSObject = CommandCodesDownloadStart::eO_Application;
351         baseAddress = bcd.getImageBaseAddress();
352         imageLength = bcd.getImageLength();
353         crc = bcd.getImageCRC();
354         offset = bcd.getImageOffset();
355         break;
356     case eOT_CnE:
357         eCCDSObject = CommandCodesDownloadStart::eO_Config;
358         baseAddress = 0;
359         imageLength = bcd.getCnELength();
360         crc = bcd.getCnECRC();
361         offset = bcd.getCnEOffset();
362         break;
363     default:
364         return false;
365     }
366
367     CommandCodesDownloadStart ccDStart ( m_protocolVersion, eCCDSObject );
368     ccDStart.setDate( bcd.getSoftwareDate() );
369     ccDStart.setTime( bcd.getSoftwareTime() );
370     ccDStart.setId( bcd.getSoftwareId() );
371     ccDStart.setVersion( bcd.getSoftwareVersion() );
372     ccDStart.setBaseAddress( baseAddress );
373     ccDStart.setLength( imageLength );
374     ccDStart.setCRC( crc );
375
376     if ( !writeRequest( ccDStart ) ) {
377         debugError( "downloadObject: start command write request failed\n" );
378         return false;
379     }
380
381     // bootloader erases the flash, have to wait until is ready
382     // to answer our next request
383     printf( "wait until flash ereasing has terminated\n" );
384     sleep( 30 );
385
386     if ( !readResponse( ccDStart ) ) {
387         debugError( "downloadObject: (start) command read request failed\n" );
388         return false;
389     }
390
391     if ( ccDStart.getMaxBlockSize() < 0 ) {
392         debugError( "downloadObject: (start) command reported error %d\n",
393                     ccDStart.getMaxBlockSize() );
394         return false;
395     }
396
397     unsigned int maxBlockSize = m_configRom->getAsyMaxPayload();
398     unsigned int i = 0;
399     fb_quadlet_t address = 0;
400     bool result = true;
401     int totalBytes = imageLength;
402     int downloadedBytes = 0;
403     while ( imageLength > 0 ) {
404         unsigned int blockSize = imageLength > maxBlockSize ?
405                         maxBlockSize  : imageLength;
406
407         fb_byte_t block[blockSize];
408         if ( !bcd.read( offset, block, blockSize ) ) {
409             result = false;
410             break;
411         }
412
413         if ( !get1394Serivce()->write(
414                  0xffc0 | getConfigRom()->getNodeId(),
415                  AddrRegReqBuf,
416                  ( blockSize + 3 ) / 4,
417                  reinterpret_cast<fb_quadlet_t*>( block ) ) )
418         {
419             debugError( "downloadObject: Could not write to node %d\n",
420                         getConfigRom()->getNodeId() );
421             return false;
422         }
423
424         CommandCodesDownloadBlock ccBlock( m_protocolVersion );
425         ccBlock.setSeqNumber( i );
426         ccBlock.setAddress( baseAddress + address );
427         ccBlock.setNumberBytes( blockSize );
428
429         if ( !writeRequest( ccBlock ) ) {
430             debugError( "downloadObject: (block) write request failed" );
431             result = false;
432             break;
433         }
434         usleep( 100 );
435
436         if ( !readResponse( ccBlock ) ) {
437             debugError( "downloadObject: (block) read request failed\n" );
438             result = false;
439             break;
440         }
441
442         if ( i != ccBlock.getRespSeqNumber() ) {
443             debugError( "downloadObject: (block) wrong sequence number "
444                         "reported. %d expected, %d reported\n",
445                         i, ccBlock.getRespSeqNumber() );
446             result = false;
447             break;
448         }
449         if ( ccBlock.getRespErrorCode() != 0 ) {
450             debugError( "downloadObject: (block) failed download with "
451                         "error code 0x%08x\n", ccBlock.getRespErrorCode() );
452             result = false;
453             break;
454         }
455
456         downloadedBytes += blockSize;
457         if ( ( i % 100 ) == 0 ) {
458            printf( "%10d/%d bytes downloaded\n",
459                    downloadedBytes, totalBytes );
460         }
461
462         imageLength -= blockSize;
463         address += blockSize;
464         offset += blockSize;
465         i++;
466     }
467     printf( "%10d/%d bytes downloaded\n",
468             downloadedBytes, totalBytes );
469
470     if ( !result ) {
471         debugError( "downloadObject: seqNumber = %d, "
472                     "address = 0%08x, offset = 0x%08x, "
473                     "restImageLength = 0x%08x\n",
474                     i, address, offset, imageLength );
475     }
476
477     CommandCodesDownloadEnd ccEnd( m_protocolVersion );
478     if ( !writeRequest( ccEnd ) ) {
479         debugError( "downloadObject: (end) command write failed\n" );
480     }
481
482     printf( "wait for transaction completion\n" );
483     sleep( 10 );
484
485     if ( !readResponse( ccEnd ) ) {
486         debugError( "downloadObject: (end) command read failed\n" );
487     }
488
489     if ( result ) {
490         if ( ccEnd.getRespIsValid() ) {
491             if ( ccEnd.getRespCrc32() == crc ) {
492                 debugOutput( DebugModule::eDL_Normal,
493                              "downloadObject: CRC match\n" );
494             } else {
495                 debugError( "downloadObject: CRC mismatch. 0x%08x expected, "
496                             "0x%08x reported",
497                             crc, ccEnd.getRespCrc32() );
498                 result = false;
499             }
500         } else {
501             debugError( "downloadObject: (end) object is not valid\n" );
502             result = false;
503         }
504     }
505     printf( "download protocol successfuly completed\n" );
506     return result;
507 }
508
509 bool
510 BeBoB::BootloaderManager::programGUID( fb_octlet_t guid )
511 {
512     if ( m_bStartBootloader ) {
513         if ( !startBootloaderCmd() ) {
514             debugError( "programGUID: Could not start bootloader\n" );
515             return false;
516         }
517     }
518
519     if ( !programGUIDCmd( guid ) ) {
520         debugError( "programGUID: Could not program guid\n" );
521         return false;
522     }
523
524     if ( !startApplicationCmd() ) {
525         debugError( "Could not restart application\n");
526         return false;
527     }
528
529     return true;
530 }
531
532 void
533 BeBoB::BootloaderManager::busresetHandler()
534 {
535     pthread_cond_signal( &m_cond );
536 }
537
538 void
539 BeBoB::BootloaderManager::waitForBusReset()
540 {
541     pthread_cond_wait( &m_cond, &m_mutex );
542 }
543
544 bool
545 BeBoB::BootloaderManager::writeRequest( CommandCodes& cmd )
546 {
547     unsigned char buf[ ( ( cmd.getMaxSize()+3 )/4 ) * 4 ];
548     memset( buf, 0, sizeof( buf ) );
549
550     BufferSerialize se( buf,  sizeof( buf ) );
551     if ( !cmd.serialize( se ) ) {
552         debugError( "writeRequest: Could not serialize command code %d\n",
553                     cmd.getCommandCode() );
554         return false;
555     }
556
557     if ( !get1394Serivce()->write(
558              0xffc0 | getConfigRom()->getNodeId(),
559              AddrRegReq,
560              sizeof( buf )/4,
561              reinterpret_cast<fb_quadlet_t*>( buf ) ) )
562     {
563         debugError( "writeRequest: Could not ARM write to node %d\n",
564                     getConfigRom()->getNodeId() );
565         return false;
566     }
567
568     return true;
569 }
570
571 bool
572 BeBoB::BootloaderManager::readResponse( CommandCodes& writeRequestCmd )
573 {
574     const size_t buf_length = 0x40;
575     unsigned char raw[buf_length];
576     if ( !get1394Serivce()->read(
577              0xffc0 | getConfigRom()->getNodeId(),
578              AddrRegResp,
579              writeRequestCmd.getRespSizeInQuadlets(),
580              reinterpret_cast<fb_quadlet_t*>( raw ) ) )
581     {
582         return false;
583     }
584
585     BufferDeserialize de( raw, buf_length );
586     if ( !writeRequestCmd.deserialize( de ) ) {
587         debugError( "readResponse: deserialize failed\n" );
588         return false;
589     }
590
591     bool result =
592         writeRequestCmd.getProtocolVersion()
593         == writeRequestCmd.getRespProtocolVersion();
594     result &=
595         writeRequestCmd.getCommandId()
596         == writeRequestCmd.getRespCommandId();
597     result &=
598         writeRequestCmd.getCommandCode()
599         == writeRequestCmd.getRespCommandCode();
600     #ifdef DEBUG
601        if ( !result ) {
602            debugError( "readResponse: protocol version: %d expected, "
603                        " %d reported\n",
604                        writeRequestCmd.getProtocolVersion(),
605                        writeRequestCmd.getRespProtocolVersion() );
606            debugError( "readResponse: command id: %d expected, "
607                        " %d reported\n",
608                        writeRequestCmd.getCommandId(),
609                        writeRequestCmd.getRespCommandId() );
610            debugError( "readResponse: command code: %d expected, "
611                        " %d reported\n",
612                        writeRequestCmd.getCommandCode(),
613                        writeRequestCmd.getRespCommandCode() );
614        }
615     #endif
616     return result;
617 }
618
619 bool
620 BeBoB::BootloaderManager::startBootloaderCmd()
621 {
622     CommandCodesReset cmd( m_protocolVersion,
623                            CommandCodesReset::eSM_Bootloader ) ;
624     if ( !writeRequest( cmd ) ) {
625         debugError( "startBootloaderCmd: writeRequest failed\n" );
626         return false;
627     }
628
629     waitForBusReset();
630     if ( !cacheInfoRegisters( MaxRetries ) ) {
631         debugError( "startBootloaderCmd: Could not read info registers\n" );
632         return false;
633     }
634
635     // wait for bootloader finish startup sequence
636     // there is no way to find out when it has finished
637     sleep( 10 );
638
639     return true;
640 }
641
642 bool
643 BeBoB::BootloaderManager::startApplicationCmd()
644 {
645     CommandCodesGo cmd( m_protocolVersion,
646                            CommandCodesGo::eSM_Application ) ;
647     if ( !writeRequest( cmd ) ) {
648         debugError( "startApplicationCmd: writeRequest failed\n" );
649         return false;
650     }
651
652     return true;
653 }
654
655 bool
656 BeBoB::BootloaderManager::programGUIDCmd( fb_octlet_t guid )
657 {
658     CommandCodesProgramGUID cmd( m_protocolVersion, guid );
659     if ( !writeRequest( cmd ) ) {
660         debugError( "programGUIDCmd: writeRequest failed\n" );
661         return false;
662     }
663
664     sleep( 1 );
665
666     return true;
667 }
668
669 bool
670 BeBoB::BootloaderManager::initializePersParamCmd()
671 {
672     CommandCodesInitializePersParam cmd( m_protocolVersion );
673     if ( !writeRequest( cmd ) ) {
674         debugError( "initializePersParamCmd: writeRequest failed\n" );
675         return false;
676     }
677
678     sleep( 1 );
679
680     return true;
681 }
682
683 bool
684 BeBoB::BootloaderManager::initializeConfigToFactorySettingCmd()
685 {
686     CommandCodesInitializeConfigToFactorySetting cmd( m_protocolVersion );
687     if ( !writeRequest( cmd ) ) {
688         debugError( "initializeConfigToFactorySettingCmd: writeRequest failed\n" );
689         return false;
690     }
691
692     sleep( 5 );
693
694     return true;
695 }
696
697 bool
698 BeBoB::BootloaderManager::checkDeviceCompatibility( BCD& bcd )
699 {
700     fb_quadlet_t vendorOUI = (  m_cachedInfoRegs.m_guid >> 40 );
701
702
703     if ( ( vendorOUI == bcd.getVendorOUI() )
704          && ( m_cachedInfoRegs.m_softwareId == bcd.getSoftwareId() ) )
705     {
706         return true;
707     }
708
709     printf( "vendorOUI = 0x%08x\n", vendorOUI );
710     printf( "BCD vendorOUI = 0x%08x\n", bcd.getVendorOUI() );
711     printf( "software ID = 0x%08x\n", m_cachedInfoRegs.m_softwareId );
712     printf( "BCD software ID = 0x%08x\n", bcd.getSoftwareId() );
713
714     return false;
715 }
Note: See TracBrowser for help on using the browser.