aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/Makefile8
-rw-r--r--common/cmd_mp.c5
-rw-r--r--common/fdt_support.c26
-rw-r--r--common/usb.c4
-rw-r--r--common/usb_storage.c2
5 files changed, 35 insertions, 10 deletions
diff --git a/common/Makefile b/common/Makefile
index 2edbd7147..371a0d99b 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -162,7 +162,13 @@ COBJS-$(CONFIG_CMD_XIMG) += cmd_ximg.o
COBJS-$(CONFIG_YAFFS2) += cmd_yaffs2.o
# others
-COBJS-$(CONFIG_DDR_SPD) += ddr_spd.o
+ifdef CONFIG_DDR_SPD
+SPD := y
+endif
+ifdef CONFIG_SPD_EEPROM
+SPD := y
+endif
+COBJS-$(SPD) += ddr_spd.o
COBJS-$(CONFIG_HWCONFIG) += hwconfig.o
COBJS-$(CONFIG_CONSOLE_MUX) += iomux.o
COBJS-y += flash.o
diff --git a/common/cmd_mp.c b/common/cmd_mp.c
index f19bf41f8..b115b5913 100644
--- a/common/cmd_mp.c
+++ b/common/cmd_mp.c
@@ -32,9 +32,8 @@ cpu_cmd(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
return cmd_usage(cmdtp);
cpuid = simple_strtoul(argv[1], NULL, 10);
- if (cpuid >= cpu_numcores()) {
- printf ("Core num: %lu is out of range[0..%d]\n",
- cpuid, cpu_numcores() - 1);
+ if (!is_core_valid(cpuid)) {
+ printf ("Core num: %lu is not valid\n", cpuid);
return 1;
}
diff --git a/common/fdt_support.c b/common/fdt_support.c
index 19b2ef6ea..46aa84220 100644
--- a/common/fdt_support.c
+++ b/common/fdt_support.c
@@ -1196,13 +1196,13 @@ int fdt_alloc_phandle(void *blob)
}
/*
- * fdt_create_phandle: Create a phandle property for the given node
+ * fdt_set_phandle: Create a phandle property for the given node
*
* @fdt: ptr to device tree
* @nodeoffset: node to update
* @phandle: phandle value to set (must be unique)
-*/
-int fdt_create_phandle(void *fdt, int nodeoffset, uint32_t phandle)
+ */
+int fdt_set_phandle(void *fdt, int nodeoffset, uint32_t phandle)
{
int ret;
@@ -1235,6 +1235,26 @@ int fdt_create_phandle(void *fdt, int nodeoffset, uint32_t phandle)
return ret;
}
+/*
+ * fdt_create_phandle: Create a phandle property for the given node
+ *
+ * @fdt: ptr to device tree
+ * @nodeoffset: node to update
+ */
+int fdt_create_phandle(void *fdt, int nodeoffset)
+{
+ /* see if there is a phandle already */
+ int phandle = fdt_get_phandle(fdt, nodeoffset);
+
+ /* if we got 0, means no phandle so create one */
+ if (phandle == 0) {
+ phandle = fdt_alloc_phandle(fdt);
+ fdt_set_phandle(fdt, nodeoffset, phandle);
+ }
+
+ return phandle;
+}
+
#if defined(CONFIG_VIDEO)
int fdt_add_edid(void *blob, const char *compat, unsigned char *edid_buf)
{
diff --git a/common/usb.c b/common/usb.c
index a5f9e9f5b..a401c0919 100644
--- a/common/usb.c
+++ b/common/usb.c
@@ -63,7 +63,7 @@
#ifdef USB_DEBUG
#define USB_PRINTF(fmt, args...) printf(fmt , ##args)
#else
-static inline void USB_PRINTF(const char *fmt, ...) {}
+#define USB_PRINTF(fmt, args...)
#endif
#define USB_BUFSIZ 512
@@ -970,7 +970,7 @@ void usb_scan_devices(void)
#ifdef USB_HUB_DEBUG
#define USB_HUB_PRINTF(fmt, args...) printf(fmt , ##args)
#else
-static inline void USB_HUB_PRINTF(const char *fmt, ...) {}
+#define USB_HUB_PRINTF(fmt, args...)
#endif
diff --git a/common/usb_storage.c b/common/usb_storage.c
index 5c56918e2..16667f394 100644
--- a/common/usb_storage.c
+++ b/common/usb_storage.c
@@ -63,7 +63,7 @@
#ifdef USB_STOR_DEBUG
#define USB_STOR_PRINTF(fmt, args...) printf(fmt , ##args)
#else
-static inline void USB_STOR_PRINTF(const char *fmt, ...) {}
+#define USB_STOR_PRINTF(fmt, args...)
#endif
#include <scsi.h>