File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -561,6 +561,28 @@ int uboot_overlay_enabled(void) {
561561 }
562562}
563563
564+ /*
565+ PocketBeagle has everything built-in to the main dtb
566+ */
567+ int pocketbeagle (void ) {
568+ const char * cmd = "/bin/grep -c 'TI AM335x PocketBeagle' /proc/device-tree/model" ;
569+ char pocketbeagle ;
570+ FILE * file = NULL ;
571+
572+ file = popen (cmd , "r" );
573+ if (file == NULL ) {
574+ fprintf (stderr , "error: pocketbeagle() failed to run cmd=%s\n" , cmd );
575+ return -1 ;
576+ }
577+ pocketbeagle = fgetc (file );
578+ pclose (file );
579+
580+ if (pocketbeagle == '1' ) {
581+ return 1 ;
582+ } else {
583+ return 0 ;
584+ }
585+ }
564586
565587BBIO_err load_device_tree (const char * name )
566588{
@@ -583,6 +605,10 @@ BBIO_err load_device_tree(const char *name)
583605 return BBIO_OK ;
584606 }
585607
608+ if (pocketbeagle ()) {
609+ return BBIO_OK ;
610+ }
611+
586612 snprintf (slots , sizeof (slots ), "%s/slots" , ctrl_dir );
587613
588614 file = fopen (slots , "r+" );
You can’t perform that action at this time.
0 commit comments