X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=include%2Fcommon.h;h=a8d833b9891fe09c7121c637a7f1f84a8b764d2b;hb=1df182ddf700de49fb4400ba67c3029278ea88e7;hp=1317f9b9e78e1b42c9780421a48d18d4ad27bceb;hpb=4101f6879256720b30df712089a3df18565f9203;p=platform%2Fkernel%2Fu-boot.git diff --git a/include/common.h b/include/common.h index 1317f9b..a8d833b 100644 --- a/include/common.h +++ b/include/common.h @@ -16,6 +16,7 @@ typedef volatile unsigned short vu_short; typedef volatile unsigned char vu_char; #include +#include #include #include #include @@ -100,6 +101,13 @@ typedef volatile unsigned char vu_char; #define _DEBUG 0 #endif +#ifdef CONFIG_SPL_BUILD +#define _SPL_BUILD 1 +#else +#define _SPL_BUILD 0 +#endif + +/* Define this at the top of a file to add a prefix to debug messages */ #ifndef pr_fmt #define pr_fmt(fmt) fmt #endif @@ -115,9 +123,14 @@ typedef volatile unsigned char vu_char; printf(pr_fmt(fmt), ##args); \ } while (0) +/* Show a message if DEBUG is defined in a file */ #define debug(fmt, args...) \ debug_cond(_DEBUG, fmt, ##args) +/* Show a message if not in SPL */ +#define warn_non_spl(fmt, args...) \ + debug_cond(!_SPL_BUILD, 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, @@ -596,12 +609,8 @@ void upmconfig (unsigned int, unsigned int *, unsigned int); ulong get_tbclk (void); void reset_misc (void); void reset_cpu (ulong addr); -#if defined (CONFIG_OF_LIBFDT) && defined (CONFIG_OF_BOARD_SETUP) void ft_cpu_setup(void *blob, bd_t *bd); -#ifdef CONFIG_PCI void ft_pci_setup(void *blob, bd_t *bd); -#endif -#endif void smp_set_core_boot_addr(unsigned long addr, int corenr); void smp_kick_all_cpus(void); @@ -660,10 +669,8 @@ int get_serial_clock(void); #if defined(CONFIG_MPC85xx) typedef MPC85xx_SYS_INFO sys_info_t; void get_sys_info ( sys_info_t * ); -# if defined(CONFIG_OF_LIBFDT) - void ft_fixup_cpu(void *, u64); - void ft_fixup_num_cores(void *); -# endif +void ft_fixup_cpu(void *, u64); +void ft_fixup_num_cores(void *); #endif #if defined(CONFIG_MPC86xx) typedef MPC86xx_SYS_INFO sys_info_t; @@ -859,17 +866,20 @@ int getc(void); int tstc(void); /* stdout */ -#if defined(CONFIG_SPL_BUILD) && !defined(CONFIG_SPL_SERIAL_SUPPORT) -#define putc(...) do { } while (0) -#define puts(...) do { } while (0) -#define printf(...) do { } while (0) -#define vprintf(...) do { } while (0) -#else +#if !defined(CONFIG_SPL_BUILD) || \ + (defined(CONFIG_TPL_BUILD) && defined(CONFIG_TPL_SERIAL_SUPPORT)) || \ + (defined(CONFIG_SPL_BUILD) && !defined(CONFIG_TPL_BUILD) && \ + defined(CONFIG_SPL_SERIAL_SUPPORT)) void putc(const char c); void puts(const char *s); int printf(const char *fmt, ...) __attribute__ ((format (__printf__, 1, 2))); int vprintf(const char *fmt, va_list args); +#else +#define putc(...) do { } while (0) +#define puts(...) do { } while (0) +#define printf(...) do { } while (0) +#define vprintf(...) do { } while (0) #endif /* stderr */