X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;ds=sidebyside;f=include%2Fcommon.h;h=5ca8820898b2939b0f5edea8dbe80043b5cdccd1;hb=6f681b734942036d538a61fdcc9989328515cfa2;hp=9166ca1ed6a616db681d6940f8c9054388dc445f;hpb=d67f10ce0f5a4c114437ac6fb5891ae38e3054f8;p=u-boot diff --git a/include/common.h b/include/common.h index 9166ca1ed6..5ca8820898 100644 --- a/include/common.h +++ b/include/common.h @@ -116,20 +116,26 @@ typedef volatile unsigned char vu_char; #include #include -#ifdef DEBUG -#define debug(fmt,args...) printf (fmt ,##args) -#define debugX(level,fmt,args...) if (DEBUG>=level) printf(fmt,##args); -#else -#define debug(fmt,args...) -#define debugX(level,fmt,args...) -#endif /* DEBUG */ - #ifdef DEBUG -# define _DEBUG 1 +#define _DEBUG 1 #else -# define _DEBUG 0 +#define _DEBUG 0 #endif +/* + * Output a debug text when condition "cond" is met. The "cond" should be + * computed by a preprocessor in the best case, allowing for the best + * optimization. + */ +#define debug_cond(cond, fmt, args...) \ + do { \ + if (cond) \ + printf(fmt, ##args); \ + } while (0) + +#define debug(fmt, args...) \ + debug_cond(_DEBUG, fmt, ##args) + /* * An assertion is run-time check done in debug mode only. If DEBUG is not * defined then it is skipped. If DEBUG is defined and the assertion fails, @@ -276,6 +282,7 @@ int checkdram (void); int last_stage_init(void); extern ulong monitor_flash_len; int mac_read_from_eeprom(void); +extern u8 _binary_dt_dtb_start[]; /* embedded device tree blob */ /* common/flash.c */ void flash_perror (int); @@ -284,6 +291,8 @@ void flash_perror (int); int source (ulong addr, const char *fit_uname); extern ulong load_addr; /* Default Load Address */ +extern ulong save_addr; /* Default Save Address */ +extern ulong save_size; /* Default Save Size */ /* common/cmd_doc.c */ void doc_probe(unsigned long physadr);