summaryrefslogtreecommitdiff
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
3 files changed, 32 insertions, 7 deletions
diff --git a/common/Makefile b/common/Makefile
index 2edbd71..371a0d9 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 f19bf41..b115b59 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 19b2ef6..46aa842 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)
{