summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorMarian Balakowicz <m8@semihalf.com>2005-10-11 19:09:42 +0200
committerMarian Balakowicz <m8@semihalf.com>2005-10-11 19:09:42 +0200
commite6f2e902334d5ee65bab9cf8292cf668243531e9 (patch)
tree9ee0039daaa8161bc282f1af8d3827a5071acbc7 /common
parent3df5bea0b0bddc196bf952c51d1dd54d966b82ba (diff)
downloadu-boot-imx-e6f2e902334d5ee65bab9cf8292cf668243531e9.zip
u-boot-imx-e6f2e902334d5ee65bab9cf8292cf668243531e9.tar.gz
u-boot-imx-e6f2e902334d5ee65bab9cf8292cf668243531e9.tar.bz2
Added support for TQM834x boards.
Diffstat (limited to 'common')
-rw-r--r--common/cmd_bootm.c4
-rw-r--r--common/cmd_flash.c8
-rw-r--r--common/cmd_jffs2.c4
-rw-r--r--common/cmd_mii.c2
-rw-r--r--common/flash.c2
5 files changed, 14 insertions, 6 deletions
diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c
index ab6ccbb..6a5576c 100644
--- a/common/cmd_bootm.c
+++ b/common/cmd_bootm.c
@@ -84,7 +84,7 @@ static int image_info (unsigned long addr);
#if (CONFIG_COMMANDS & CFG_CMD_IMLS)
#include <flash.h>
-extern flash_info_t flash_info[CFG_MAX_FLASH_BANKS]; /* info for FLASH chips */
+extern flash_info_t flash_info[]; /* info for FLASH chips */
static int do_imls (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
#endif
@@ -1082,7 +1082,7 @@ int do_imls (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
for (i=0, info=&flash_info[0]; i<CFG_MAX_FLASH_BANKS; ++i, ++info) {
if (info->flash_id == FLASH_UNKNOWN)
goto next_bank;
- for (j=0; j<CFG_MAX_FLASH_SECT; ++j) {
+ for (j=0; j<info->sector_count; ++j) {
if (!(hdr=(image_header_t *)info->start[j]) ||
(ntohl(hdr->ih_magic) != IH_MAGIC))
diff --git a/common/cmd_flash.c b/common/cmd_flash.c
index d5be30c..0aa4783 100644
--- a/common/cmd_flash.c
+++ b/common/cmd_flash.c
@@ -404,7 +404,11 @@ int flash_sect_erase (ulong addr_first, ulong addr_last)
{
flash_info_t *info;
ulong bank;
+#ifdef CFG_MAX_FLASH_BANKS_DETECT
+ int s_first[CFG_MAX_FLASH_BANKS_DETECT], s_last[CFG_MAX_FLASH_BANKS_DETECT];
+#else
int s_first[CFG_MAX_FLASH_BANKS], s_last[CFG_MAX_FLASH_BANKS];
+#endif
int erased = 0;
int planned;
int rcode = 0;
@@ -617,7 +621,11 @@ int flash_sect_protect (int p, ulong addr_first, ulong addr_last)
{
flash_info_t *info;
ulong bank;
+#ifdef CFG_MAX_FLASH_BANKS_DETECT
+ int s_first[CFG_MAX_FLASH_BANKS_DETECT], s_last[CFG_MAX_FLASH_BANKS_DETECT];
+#else
int s_first[CFG_MAX_FLASH_BANKS], s_last[CFG_MAX_FLASH_BANKS];
+#endif
int protected, i;
int planned;
int rcode;
diff --git a/common/cmd_jffs2.c b/common/cmd_jffs2.c
index fda0c95..34920b1 100644
--- a/common/cmd_jffs2.c
+++ b/common/cmd_jffs2.c
@@ -316,7 +316,7 @@ static int part_validate_nor(struct mtdids *id, struct part_info *part)
{
#if (CONFIG_COMMANDS & CFG_CMD_FLASH)
/* info for FLASH chips */
- extern flash_info_t flash_info[CFG_MAX_FLASH_BANKS];
+ extern flash_info_t flash_info[];
flash_info_t *flash;
int offset_aligned;
u32 end_offset;
@@ -711,7 +711,7 @@ static int device_validate(u8 type, u8 num, u32 *size)
if (type == MTD_DEV_TYPE_NOR) {
#if (CONFIG_COMMANDS & CFG_CMD_FLASH)
if (num < CFG_MAX_FLASH_BANKS) {
- extern flash_info_t flash_info[CFG_MAX_FLASH_BANKS];
+ extern flash_info_t flash_info[];
*size = flash_info[num].size;
return 0;
}
diff --git a/common/cmd_mii.c b/common/cmd_mii.c
index 722b9f0..f93232c 100644
--- a/common/cmd_mii.c
+++ b/common/cmd_mii.c
@@ -91,7 +91,7 @@ int do_mii (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
* Look for any and all PHYs. Valid addresses are 0..31.
*/
if (argc >= 3) {
- start = addr; end = addr + 1;
+ start = addrlo; end = addrhi + 1;
} else {
start = 0; end = 32;
}
diff --git a/common/flash.c b/common/flash.c
index b308413..2fb3319 100644
--- a/common/flash.c
+++ b/common/flash.c
@@ -28,7 +28,7 @@
#if !defined(CFG_NO_FLASH)
-extern flash_info_t flash_info[CFG_MAX_FLASH_BANKS]; /* info for FLASH chips */
+extern flash_info_t flash_info[]; /* info for FLASH chips */
/*-----------------------------------------------------------------------
* Functions