summaryrefslogtreecommitdiff
path: root/cleopatre/u-boot-1.1.6/common
diff options
context:
space:
mode:
authorsave2009-07-16 16:54:35 +0000
committersave2009-07-16 16:54:35 +0000
commit2d04f712f42480423a2b64f55d003db6633a50b1 (patch)
tree77c1118c6d2c070395dc86fe2de390b677a0b99c /cleopatre/u-boot-1.1.6/common
parent69f005d9f0ae5ac843c4896b44b31a5171f91e34 (diff)
[CLEO][U-BOOT]Suppressed warning during compilation + Changed configs of Malika
git-svn-id: svn+ssh://pessac/svn/cesar/trunk@4998 017c9cb6-072f-447c-8318-d5b54f68fe89
Diffstat (limited to 'cleopatre/u-boot-1.1.6/common')
-rw-r--r--cleopatre/u-boot-1.1.6/common/cmd_bootm.c8
-rw-r--r--cleopatre/u-boot-1.1.6/common/cmd_misc.c31
-rw-r--r--cleopatre/u-boot-1.1.6/common/cmd_mmuon.c32
-rw-r--r--cleopatre/u-boot-1.1.6/common/cmd_net.c2
-rw-r--r--cleopatre/u-boot-1.1.6/common/cmd_spidboot.c78
5 files changed, 42 insertions, 109 deletions
diff --git a/cleopatre/u-boot-1.1.6/common/cmd_bootm.c b/cleopatre/u-boot-1.1.6/common/cmd_bootm.c
index ecb8679a51..a61d774839 100644
--- a/cleopatre/u-boot-1.1.6/common/cmd_bootm.c
+++ b/cleopatre/u-boot-1.1.6/common/cmd_bootm.c
@@ -1369,7 +1369,9 @@ static int image_info (ulong addr)
{
ulong data, len, checksum;
image_header_t *hdr = &header;
+#ifdef USE_SPI_FLASH
int hack_spi = 0;
+#endif
printf ("\n## Checking Image at %08lx ...\n", addr);
@@ -1550,7 +1552,9 @@ int do_imls (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
ulong data, len, checksum;
image_header_t *hdr_spi = &header;
+#ifdef USE_SPI_FLASH
int hack_spi = 0;
+#endif
ulong addr = 0;
for (i=0, info=&flash_info[0]; i<CFG_MAX_FLASH_BANKS; ++i, ++info) {
@@ -1564,7 +1568,7 @@ int do_imls (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
hdr=(image_header_t *)info->start[j];
#if defined(USE_SPI_FLASH) && defined(CONFIG_ARCH_ARIZONA)
- /* in arizona, hdr will point to addr 0x0,
+ /* in arizona, hdr will point to addr 0x0,
* although it will not be NULL pointer, but valid pointer.
* we must skip the NULL-pointer check
*/
@@ -1583,7 +1587,7 @@ int do_imls (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
addr = (ulong)hdr;
//printf("\nChecking sector at addr %#x\t", addr);
- if ( flash_read_spi ((char *)addr, &header, sizeof(image_header_t), 1, 0) != ERR_OK )
+ if ( flash_read_spi ((volatile unsigned char *)addr, (volatile unsigned char*)&header, sizeof(image_header_t), 1, 0) != ERR_OK )
{
printf("ERROR : loading image from SPI flash failed.\n");
return -1;
diff --git a/cleopatre/u-boot-1.1.6/common/cmd_misc.c b/cleopatre/u-boot-1.1.6/common/cmd_misc.c
index 67ee9e8a83..dbdafc67e5 100644
--- a/cleopatre/u-boot-1.1.6/common/cmd_misc.c
+++ b/cleopatre/u-boot-1.1.6/common/cmd_misc.c
@@ -29,6 +29,33 @@
#if (CONFIG_COMMANDS & CFG_CMD_MISC)
+#if defined(CONFIG_ARCH_SPC300) && !defined(CONFIG_ARCH_ARIZONA)
+#include <asm/arch/spc300_nvram.h>
+
+static ulong get_timer_clock(void)
+{
+ DECLARE_GLOBAL_DATA_PTR;
+ bd_t *bd = gd->bd;
+ spc300_nvram_t *nvram = (spc300_nvram_t*)bd->bi_nvram_addr;
+ ulong timerclk;
+
+ switch(nvram->pkg_cfg & 0x03)
+ {
+ case 1:
+ timerclk = 25000000;
+ break;
+ case 2:
+ timerclk = 37500000;
+ break;
+ default:
+ timerclk = 18750000;
+ break;
+ }
+ /* MARIA_TIMER_CLOCK/timer_prescaler == Xclk/timer_prescaler (timer_prescaler == 2) */
+ return (timerclk/2);
+}
+#endif
+
int do_sleep (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
{
ulong start = get_timer(0);
@@ -39,7 +66,11 @@ int do_sleep (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
return 1;
}
+#if defined(CONFIG_ARCH_SPC300) && !defined(CONFIG_ARCH_ARIZONA)
+ delay = simple_strtoul(argv[1], NULL, 10) * get_timer_clock();
+#else
delay = simple_strtoul(argv[1], NULL, 10) * CFG_HZ;
+#endif
while (get_timer(start) < delay) {
if (ctrlc ()) {
diff --git a/cleopatre/u-boot-1.1.6/common/cmd_mmuon.c b/cleopatre/u-boot-1.1.6/common/cmd_mmuon.c
index 396794102d..c95e60a177 100644
--- a/cleopatre/u-boot-1.1.6/common/cmd_mmuon.c
+++ b/cleopatre/u-boot-1.1.6/common/cmd_mmuon.c
@@ -317,6 +317,7 @@ static void flushCaches(void)
: "memory");
}
+#if 0
static void cleanInvalDCache(void)
{
unsigned int c7format = 0;
@@ -328,35 +329,8 @@ static void cleanInvalDCache(void)
:
: "r" (c7format)
: "memory");
-
-#if 0
-cp_delay ();
-
- __asm__ __volatile__(
- "mcr p15, 0, %0, c7, c10, 4 @ drain write and fill buffer\n\t"
- :
- : "r" (c7format)
- : "memory");
-
-
-cp_delay ();
-
- __asm__ __volatile__(
- "mcr p15, 0, %0, c7, c5, 4 @ Flush Prefetch Buffer\n\t"
- :
- : "r" (c7format)
- : "memory");
-
-cp_delay ();
-
- __asm__ __volatile__(
- "mcr p15, 0, %0, c7, c5, 6 @ Flush Entire Branch Target Cache\n\t"
- :
- : "r" (c7format)
- : "memory");
-#endif
-
}
+#endif
void controlSet(unsigned int value, unsigned int mask)
{
@@ -418,7 +392,7 @@ void readFAR(void)
/* putting it all together */
-static int do_mmuon(void)
+int do_mmuon (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
{
unsigned int enable, change;
diff --git a/cleopatre/u-boot-1.1.6/common/cmd_net.c b/cleopatre/u-boot-1.1.6/common/cmd_net.c
index 01c291f415..d2fcc1da91 100644
--- a/cleopatre/u-boot-1.1.6/common/cmd_net.c
+++ b/cleopatre/u-boot-1.1.6/common/cmd_net.c
@@ -221,7 +221,7 @@ netboot_common (proto_t proto, cmd_tbl_t *cmdtp, int argc, char *argv[])
}
#if (CONFIG_COMMANDS & CFG_CMD_SPIDUPD)
-int do_spidupd (void)
+int do_spidupd (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
{
if (NetLoop(SPIDUPD) < 0) {
printf("Image not updated.\n");
diff --git a/cleopatre/u-boot-1.1.6/common/cmd_spidboot.c b/cleopatre/u-boot-1.1.6/common/cmd_spidboot.c
index f94178489e..4d9e6cd938 100644
--- a/cleopatre/u-boot-1.1.6/common/cmd_spidboot.c
+++ b/cleopatre/u-boot-1.1.6/common/cmd_spidboot.c
@@ -212,38 +212,6 @@ print_img_desc (spidcom_image_desc_t *hdr)
size, size / 1024, size / 1048576 );
}
-/*
- * MD5 functions
- */
-
-/* Prints a message digest in hexadecimal.
-*/
-static void md5_print (md5_byte_t digest[16])
-{
- unsigned int i;
-
- for (i = 0; i < 16; i++)
- printf ("%02x", digest[i]);
-}
-
-/*
- * Digests update image and prints the result.
- */
-static void md5_calculate (md5_byte_t md5_sum[16], unsigned long addr, unsigned int len)
-{
- md5_state_t state;
-
- md5_init(&state);
- md5_append( &state, (const md5_byte_t *)addr, len );
- md5_finish(&state, md5_sum);
-
-#if 0
- printf ("MD5 (Linux image) = ");
- md5_print (md5_sum);
- printf ("\n");
-#endif
-}
-
/* --- SPiDBOOT --- */
static int load_header(spidcom_image_desc_t *desc, char *addr)
{
@@ -268,6 +236,7 @@ static int load_header(spidcom_image_desc_t *desc, char *addr)
{
memmove (desc, (char *)addr, sizeof(spidcom_image_desc_t));
}
+ return 0;
}
static int check_img(spidcom_image_desc_t *desc, char *addr)
@@ -569,51 +538,6 @@ int do_spidboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
data = (ulong)(img_load_addr); /* we are positioned at image load addr */
len = hdr->size;
-
-#if 0
-
- /* verify image MD5 sum comparing it to what we have in the header */
- if (verify)
- {
- md5_byte_t md5_image[16];
-
-#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)
- md5_state_t state;
- ulong bdata = data, edata = bdata + len;
-#endif /* CONFIG_HW_WATCHDOG || CONFIG_WATCHDOG */
-
- puts (" Verifying MD5 Checksum ... ");
-
-#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)
- md5_init(&state);
- while (bdata < edata)
- {
- ulong chunk = edata - bdata;
-
- if (chunk > CHUNKSZ)
- {
- chunk = CHUNKSZ;
- }
- md5_append(&state, (const md5_byte_t *)bdata, chunk);
- bdata += chunk;
-
- WATCHDOG_RESET();
- }
- md5_finish(&state, md5_image);
-#else /* !(CONFIG_HW_WATCHDOG || CONFIG_WATCHDOG) */
- md5_calculate(md5_image, data, hdr->size);
-#endif /* CONFIG_HW_WATCHDOG || CONFIG_WATCHDOG */
-
- if ( memcmp(md5_image, hdr->md5_sum, 16) != 0 )
- {
- printf ("Bad Data MD5\n");
- return 1;
- }
- puts ("OK\n");
- }
-
-#endif /* commented out MD5 code */
-
len_ptr = (ulong *)data;
/* for now, there is only one valid type,