summaryrefslogtreecommitdiff
path: root/include/common.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/common.h')
-rw-r--r--include/common.h29
1 files changed, 28 insertions, 1 deletions
diff --git a/include/common.h b/include/common.h
index d5ebb25..96a45a6 100644
--- a/include/common.h
+++ b/include/common.h
@@ -302,9 +302,16 @@ 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 */
+extern u8 __dtb_dt_begin[]; /* embedded device tree blob */
int set_cpu_clk_info(void);
+#if defined(CONFIG_DISPLAY_CPUINFO)
int print_cpuinfo(void);
+#else
+static inline int print_cpuinfo(void)
+{
+ return 0;
+}
+#endif
int update_flash_size(int flash_size);
/**
@@ -408,6 +415,9 @@ static inline int setenv_addr(const char *varname, const void *addr)
#ifdef CONFIG_MIPS
# include <asm/u-boot-mips.h>
#endif /* CONFIG_MIPS */
+#ifdef CONFIG_ARC
+# include <asm/u-boot-arc.h>
+#endif /* CONFIG_ARC */
#ifdef CONFIG_AUTO_COMPLETE
int env_complete(char *var, int maxv, char *cmdv[], int maxsz, char *buf);
@@ -451,6 +461,7 @@ void api_init (void);
/* common/memsize.c */
long get_ram_size (long *, long);
+phys_size_t get_effective_memsize(void);
/* $(BOARD)/$(BOARD).c */
void reset_phy (void);
@@ -961,6 +972,22 @@ static inline phys_addr_t map_to_sysmem(const void *ptr)
#define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d))
#define roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y))
+/*
+ * Divide positive or negative dividend by positive divisor and round
+ * to closest integer. Result is undefined for negative divisors and
+ * for negative dividends if the divisor variable type is unsigned.
+ */
+#define DIV_ROUND_CLOSEST(x, divisor)( \
+{ \
+ typeof(x) __x = x; \
+ typeof(divisor) __d = divisor; \
+ (((typeof(x))-1) > 0 || \
+ ((typeof(divisor))-1) > 0 || (__x) > 0) ? \
+ (((__x) + ((__d) / 2)) / (__d)) : \
+ (((__x) - ((__d) / 2)) / (__d)); \
+} \
+)
+
#define ALIGN(x,a) __ALIGN_MASK((x),(typeof(x))(a)-1)
#define __ALIGN_MASK(x,mask) (((x)+(mask))&~(mask))