summaryrefslogtreecommitdiff
path: root/board/keymile/kmeter1/kmeter1.c
diff options
context:
space:
mode:
authorWolfgang Denk <wd@denx.de>2009-07-23 00:48:20 +0200
committerWolfgang Denk <wd@denx.de>2009-07-23 00:48:20 +0200
commit46edbc545d1d0ae166271488e89c9967fb54393f (patch)
tree90da2f5ff33a6fb194d83bea8a8ce4efd1f74e61 /board/keymile/kmeter1/kmeter1.c
parentf15f14e52879711be1d1bba2634dec684eda722e (diff)
parentcaf72ff329759b4da71352ab098537c7698c0e9f (diff)
downloadu-boot-imx-46edbc545d1d0ae166271488e89c9967fb54393f.zip
u-boot-imx-46edbc545d1d0ae166271488e89c9967fb54393f.tar.gz
u-boot-imx-46edbc545d1d0ae166271488e89c9967fb54393f.tar.bz2
Merge branch 'master' of /home/wd/git/u-boot/master/
Diffstat (limited to 'board/keymile/kmeter1/kmeter1.c')
-rw-r--r--board/keymile/kmeter1/kmeter1.c51
1 files changed, 51 insertions, 0 deletions
diff --git a/board/keymile/kmeter1/kmeter1.c b/board/keymile/kmeter1/kmeter1.c
index 3d1b941..8cac2c4 100644
--- a/board/keymile/kmeter1/kmeter1.c
+++ b/board/keymile/kmeter1/kmeter1.c
@@ -187,9 +187,60 @@ int checkboard (void)
}
#if defined(CONFIG_OF_BOARD_SETUP)
+/*
+ * update "/localbus/ranges" property in the blob
+ */
+void ft_blob_update (void *blob, bd_t *bd)
+{
+ ulong *flash_data = NULL;
+ flash_info_t *info;
+ ulong flash_reg[6] = {0};
+ int len;
+ int size = 0;
+ int i = 0;
+
+ len = fdt_get_node_and_value (blob, "/localbus", "ranges",
+ (void *)&flash_data);
+
+ if (flash_data == NULL) {
+ printf ("%s: error /localbus/ranges entry\n", __FUNCTION__);
+ return;
+ }
+
+ /* update Flash addr, size */
+ while ( i < (len / 4)) {
+ switch (flash_data[i]) {
+ case 0:
+ info = flash_get_info(CONFIG_SYS_FLASH_BASE);
+ size = info->size;
+ info = flash_get_info(CONFIG_SYS_FLASH_BASE_1);
+ size += info->size;
+ flash_data[i + 1] = 0;
+ flash_data[i + 2] = cpu_to_be32 (CONFIG_SYS_FLASH_BASE);
+ flash_data[i + 3] = cpu_to_be32 (size);
+ break;
+ default:
+ break;
+ }
+ i += 4;
+ }
+ fdt_set_node_and_value (blob, "/localbus", "ranges", flash_data,
+ len);
+
+ info = flash_get_info(CONFIG_SYS_FLASH_BASE);
+ flash_reg[2] = cpu_to_be32 (size);
+ flash_reg[4] = flash_reg[2];
+ info = flash_get_info(CONFIG_SYS_FLASH_BASE_1);
+ flash_reg[5] = cpu_to_be32 (info->size);
+ fdt_set_node_and_value (blob, "/localbus/flash@f0000000,0", "reg", flash_reg,
+ sizeof (flash_reg));
+}
+
+
void ft_board_setup (void *blob, bd_t *bd)
{
ft_cpu_setup (blob, bd);
+ ft_blob_update (blob, bd);
}
#endif