summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorMichael Brandt <Michael.Brandt@stericsson.com>2009-10-26 10:23:13 +0100
committerMichael Brandt <Michael.Brandt@stericsson.com>2009-10-26 10:23:13 +0100
commitdd037f7a4f779bdfa9984b0db74a1bcdf7170fe9 (patch)
treeca7e06ab2c6ebd83269d24542b0881e622f314da /common
parent4bd4413ae52e40d8e4c4e801b8d6bc3daf3229e3 (diff)
parentf3ee25859e3920ee7c7cc519a3e6f60d70d7a53f (diff)
Merge branch 'master' of http://git.denx.de/u-boot
Conflicts: Makefile
Diffstat (limited to 'common')
-rw-r--r--common/cmd_sf.c2
-rw-r--r--common/fdt_support.c49
-rw-r--r--common/serial.c18
3 files changed, 67 insertions, 2 deletions
diff --git a/common/cmd_sf.c b/common/cmd_sf.c
index d571f60c0..d69ae6a1b 100644
--- a/common/cmd_sf.c
+++ b/common/cmd_sf.c
@@ -2,7 +2,9 @@
* Command for accessing SPI flash.
*
* Copyright (C) 2008 Atmel Corporation
+ * Licensed under the GPL-2 or later.
*/
+
#include <common.h>
#include <spi_flash.h>
diff --git a/common/fdt_support.c b/common/fdt_support.c
index 89164a12d..9adaeb3db 100644
--- a/common/fdt_support.c
+++ b/common/fdt_support.c
@@ -604,10 +604,11 @@ int fdt_resize(void *blob)
/*
* Calculate the actual size of the fdt
- * plus the size needed for fdt_add_mem_rsv
+ * plus the size needed for two fdt_add_mem_rsv, one
+ * for the fdt itself and one for a possible initrd
*/
actualsize = fdt_off_dt_strings(blob) +
- fdt_size_dt_strings(blob) + sizeof(struct fdt_reserve_entry);
+ fdt_size_dt_strings(blob) + 2*sizeof(struct fdt_reserve_entry);
/* Make it so the fdt ends on a page boundary */
actualsize = ALIGN(actualsize + ((uint)blob & 0xfff), 0x1000);
@@ -692,3 +693,47 @@ int fdt_pci_dma_ranges(void *blob, int phb_off, struct pci_controller *hose) {
return 0;
}
#endif
+
+#ifdef CONFIG_FDT_FIXUP_NOR_FLASH_SIZE
+/*
+ * This function can be used to update the size in the "reg" property
+ * of the NOR FLASH device nodes. This is necessary for boards with
+ * non-fixed NOR FLASH sizes.
+ */
+int fdt_fixup_nor_flash_size(void *blob, int cs, u32 size)
+{
+ char compat[][16] = { "cfi-flash", "jedec-flash" };
+ int off;
+ int len;
+ struct fdt_property *prop;
+ u32 *reg;
+ int i;
+
+ for (i = 0; i < 2; i++) {
+ off = fdt_node_offset_by_compatible(blob, -1, compat[i]);
+ while (off != -FDT_ERR_NOTFOUND) {
+ /*
+ * Found one compatible node, now check if this one
+ * has the correct CS
+ */
+ prop = fdt_get_property_w(blob, off, "reg", &len);
+ if (prop) {
+ reg = (u32 *)&prop->data[0];
+ if (reg[0] == cs) {
+ reg[2] = size;
+ fdt_setprop(blob, off, "reg", reg,
+ 3 * sizeof(u32));
+
+ return 0;
+ }
+ }
+
+ /* Move to next compatible node */
+ off = fdt_node_offset_by_compatible(blob, off,
+ compat[i]);
+ }
+ }
+
+ return -1;
+}
+#endif
diff --git a/common/serial.c b/common/serial.c
index b4db46b16..5f9ffd7e4 100644
--- a/common/serial.c
+++ b/common/serial.c
@@ -69,6 +69,18 @@ struct serial_device *__default_serial_console (void)
#else
#error "CONFIG_SERIAL? missing."
#endif
+#elif defined(CONFIG_S5PC1XX)
+#if defined(CONFIG_SERIAL0)
+ return &s5pc1xx_serial0_device;
+#elif defined(CONFIG_SERIAL1)
+ return &s5pc1xx_serial1_device;
+#elif defined(CONFIG_SERIAL2)
+ return &s5pc1xx_serial2_device;
+#elif defined(CONFIG_SERIAL3)
+ return &s5pc1xx_serial3_device;
+#else
+#error "CONFIG_SERIAL? missing."
+#endif
#elif defined(CONFIG_OMAP3_ZOOM2)
return ZOOM2_DEFAULT_SERIAL_DEVICE;
#else
@@ -141,6 +153,12 @@ void serial_initialize (void)
serial_register(&s3c24xx_serial1_device);
serial_register(&s3c24xx_serial2_device);
#endif
+#if defined(CONFIG_S5PC1XX)
+ serial_register(&s5pc1xx_serial0_device);
+ serial_register(&s5pc1xx_serial1_device);
+ serial_register(&s5pc1xx_serial2_device);
+ serial_register(&s5pc1xx_serial3_device);
+#endif
serial_assign (default_serial_console ()->name);
}