summaryrefslogtreecommitdiff
path: root/board/tqm8xx
diff options
context:
space:
mode:
authorwdenk <wdenk>2003-06-05 19:27:42 +0000
committerwdenk <wdenk>2003-06-05 19:27:42 +0000
commit73a8b27c574f5ec1c8fdd9d8d065bb845d8743d3 (patch)
treef409359364776e565b9484337a0620388041b456 /board/tqm8xx
parent08eaea9c9fa4e8ea25325610c512cb90b6bea1dd (diff)
downloadu-boot-imx-73a8b27c574f5ec1c8fdd9d8d065bb845d8743d3.zip
u-boot-imx-73a8b27c574f5ec1c8fdd9d8d065bb845d8743d3.tar.gz
u-boot-imx-73a8b27c574f5ec1c8fdd9d8d065bb845d8743d3.tar.bz2
* Add support for RMU board
* Add support for TQM862L at 100/50 MHz * Patch by Pantelis Antoniou, 02 Jun 2003: major reconstruction of networking code; add "ping" support (outgoing only!)
Diffstat (limited to 'board/tqm8xx')
-rw-r--r--board/tqm8xx/flash.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/board/tqm8xx/flash.c b/board/tqm8xx/flash.c
index 6b4ea7d..98bea0e 100644
--- a/board/tqm8xx/flash.c
+++ b/board/tqm8xx/flash.c
@@ -21,6 +21,8 @@
* MA 02111-1307 USA
*/
+/* #define DEBUG */
+
#include <common.h>
#include <mpc8xx.h>
@@ -53,8 +55,12 @@ unsigned long flash_init (void)
/* Static FLASH Bank configuration here - FIXME XXX */
+ debug ("\n## Get flash bank 1 size @ 0x%08x\n",FLASH_BASE0_PRELIM);
+
size_b0 = flash_get_size((vu_long *)FLASH_BASE0_PRELIM, &flash_info[0]);
+ debug ("## Get flash bank 2 size @ 0x%08x\n",FLASH_BASE1_PRELIM);
+
if (flash_info[0].flash_id == FLASH_UNKNOWN) {
printf ("## Unknown FLASH on Bank 0 - Size = 0x%08lx = %ld MB\n",
size_b0, size_b0<<20);
@@ -62,6 +68,8 @@ unsigned long flash_init (void)
size_b1 = flash_get_size((vu_long *)FLASH_BASE1_PRELIM, &flash_info[1]);
+ debug ("## Prelim. Flash bank sizes: %08lx + 0x%08lx\n",size_b0,size_b1);
+
if (size_b1 > size_b0) {
printf ("## ERROR: "
"Bank 1 (0x%08lx = %ld MB) > Bank 0 (0x%08lx = %ld MB)\n",
@@ -77,10 +85,19 @@ unsigned long flash_init (void)
return (0);
}
+ debug ("## Before remap: "
+ "BR0: 0x%08x OR0: 0x%08x "
+ "BR1: 0x%08x OR1: 0x%08x\n",
+ memctl->memc_br0, memctl->memc_or0,
+ memctl->memc_br1, memctl->memc_or1);
+
/* Remap FLASH according to real size */
memctl->memc_or0 = CFG_OR_TIMING_FLASH | (-size_b0 & OR_AM_MSK);
memctl->memc_br0 = (CFG_FLASH_BASE & BR_BA_MSK) | BR_MS_GPCM | BR_V;
+ debug ("## BR0: 0x%08x OR0: 0x%08x\n",
+ memctl->memc_br0, memctl->memc_or0);
+
/* Re-do sizing to get full correct info */
size_b0 = flash_get_size((vu_long *)CFG_FLASH_BASE, &flash_info[0]);
@@ -105,6 +122,9 @@ unsigned long flash_init (void)
memctl->memc_br1 = ((CFG_FLASH_BASE + size_b0) & BR_BA_MSK) |
BR_MS_GPCM | BR_V;
+ debug ("## BR1: 0x%08x OR1: 0x%08x\n",
+ memctl->memc_br1, memctl->memc_or1);
+
/* Re-do sizing to get full correct info */
size_b1 = flash_get_size((vu_long *)(CFG_FLASH_BASE + size_b0),
&flash_info[1]);
@@ -129,8 +149,14 @@ unsigned long flash_init (void)
flash_info[1].flash_id = FLASH_UNKNOWN;
flash_info[1].sector_count = -1;
+ flash_info[1].size = 0;
+
+ debug ("## DISABLE BR1: 0x%08x OR1: 0x%08x\n",
+ memctl->memc_br1, memctl->memc_or1);
}
+ debug ("## Final Flash bank sizes: %08lx + 0x%08lx\n",size_b0,size_b1);
+
flash_info[0].size = size_b0;
flash_info[1].size = size_b1;
@@ -215,6 +241,8 @@ static ulong flash_get_size (vu_long *addr, flash_info_t *info)
value = addr[0];
+ debug ("Manuf. ID @ 0x%08lx: 0x%08lx\n", (ulong)addr, value);
+
switch (value) {
case AMD_MANUFACT:
info->flash_id = FLASH_MAN_AMD;
@@ -231,6 +259,8 @@ static ulong flash_get_size (vu_long *addr, flash_info_t *info)
value = addr[1]; /* device ID */
+ debug ("Device ID @ 0x%08lx: 0x%08lx\n", (ulong)(&addr[1]), value);
+
switch (value) {
case AMD_ID_LV400T:
info->flash_id += FLASH_AM400T;
@@ -278,6 +308,12 @@ static ulong flash_get_size (vu_long *addr, flash_info_t *info)
info->sector_count = 71;
info->size = 0x00800000;
break; /* => 8 MB */
+ case AMD_ID_DL640:
+debug ("## oops - same ID used for AM29LV128ML/H mirror bit flash ???\n");
+ info->flash_id += FLASH_AMDL640;
+ info->sector_count = 142;
+ info->size = 0x00800000;
+ break;
default:
info->flash_id = FLASH_UNKNOWN;
return (0); /* => no or unknown flash */
@@ -368,6 +404,8 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
int flag, prot, sect, l_sect;
ulong start, now, last;
+ debug ("flash_erase: first: %d last: %d\n", s_first, s_last);
+
if ((s_first < 0) || (s_first > s_last)) {
if (info->flash_id == FLASH_UNKNOWN) {
printf ("- missing\n");