summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/cmd_bdinfo.c2
-rw-r--r--common/cmd_bootm.c18
-rw-r--r--common/cmd_fdc.c4
-rw-r--r--common/cmd_flash.c10
-rw-r--r--common/cmd_fpga.c8
-rw-r--r--common/cmd_ide.c4
-rw-r--r--common/cmd_jffs2.c12
-rw-r--r--common/cmd_mfsl.c6
-rw-r--r--common/cmd_mp.c2
-rw-r--r--common/cmd_nand.c4
-rw-r--r--common/cmd_nvedit.c3
-rw-r--r--common/cmd_onenand.c4
-rw-r--r--common/cmd_reginfo.c22
-rw-r--r--common/cmd_scsi.c2
-rw-r--r--common/cmd_usb.c2
-rw-r--r--common/devices.c2
-rw-r--r--common/env_onenand.c2
-rw-r--r--common/fdt_support.c87
-rw-r--r--common/flash.c2
-rw-r--r--common/hush.c6
-rw-r--r--common/image.c16
-rw-r--r--common/lcd.c4
-rw-r--r--common/usb.c6
-rw-r--r--common/usb_kbd.c4
-rw-r--r--common/usb_storage.c6
25 files changed, 172 insertions, 66 deletions
diff --git a/common/cmd_bdinfo.c b/common/cmd_bdinfo.c
index caa467d026..24ff9b9956 100644
--- a/common/cmd_bdinfo.c
+++ b/common/cmd_bdinfo.c
@@ -205,7 +205,7 @@ int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
puts ("\nip_addr = ");
print_IPaddr (bd->bi_ip_addr);
#endif
- printf ("\nbaudrate = %d bps\n", (ulong)bd->bi_baudrate);
+ printf ("\nbaudrate = %ld bps\n", (ulong)bd->bi_baudrate);
return 0;
}
diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c
index f701ab6f7c..1c0a4161d0 100644
--- a/common/cmd_bootm.c
+++ b/common/cmd_bootm.c
@@ -36,6 +36,10 @@
#include <lmb.h>
#include <asm/byteorder.h>
+#if (CONFIG_COMMANDS & CFG_CMD_USB)
+#include <usb.h>
+#endif
+
#ifdef CFG_HUSH_PARSER
#include <hush.h>
#endif
@@ -213,6 +217,20 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
*/
iflag = disable_interrupts();
+#if (CONFIG_COMMANDS & CFG_CMD_USB)
+ /*
+ * turn off USB to prevent the host controller from writing to the
+ * SDRAM while Linux is booting. This could happen (at least for OHCI
+ * controller), because the HCCA (Host Controller Communication Area)
+ * lies within the SDRAM and the host controller writes continously to
+ * this area (as busmaster!). The HccaFrameNumber is for example
+ * updated every 1 ms within the HCCA structure in SDRAM! For more
+ * details see the OpenHCI specification.
+ */
+ usb_stop();
+#endif
+
+
#ifdef CONFIG_AMIGAONEG3SE
/*
* We've possible left the caches enabled during
diff --git a/common/cmd_fdc.c b/common/cmd_fdc.c
index e4fbf29a22..8493defe93 100644
--- a/common/cmd_fdc.c
+++ b/common/cmd_fdc.c
@@ -512,7 +512,7 @@ int fdc_read_data(unsigned char *buffer, unsigned long blocks,FDC_COMMAND_STRUCT
if(readblk>blocks) /* is end within 1st track */
readblk=blocks; /* yes, correct it */
PRINTF("we read %ld blocks start %ld\n",readblk,pCMD->blnr);
- bufferw=&buffer[0]; /* setup working buffer */
+ bufferw = &buffer[0]; /* setup working buffer */
do {
retryrw:
len=sect_size * readblk;
@@ -566,7 +566,7 @@ retryrw:
* we need to get the results */
fdc_terminate(pCMD);
offset+=(sect_size*readblk); /* set up buffer pointer */
- bufferw=&buffer[offset];
+ bufferw = &buffer[offset];
pCMD->blnr+=readblk; /* update current block nr */
blocks-=readblk; /* update blocks */
if(blocks==0)
diff --git a/common/cmd_flash.c b/common/cmd_flash.c
index db5dec9049..a7f66ddbfa 100644
--- a/common/cmd_flash.c
+++ b/common/cmd_flash.c
@@ -210,7 +210,7 @@ flash_fill_sect_ranges (ulong addr_first, ulong addr_last,
s_last [bank] = -1; /* last sector to erase */
}
- for (bank=0,info=&flash_info[0];
+ for (bank=0,info = &flash_info[0];
(bank < CFG_MAX_FLASH_BANKS) && (addr_first <= addr_last);
++bank, ++info) {
ulong b_end;
@@ -360,7 +360,7 @@ int do_flerase (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
addr_last = addr_first + part->size - 1;
printf ("Erase Flash Parition %s, "
- "bank %d, 0x%08lx - 0x%08lx ",
+ "bank %ld, 0x%08lx - 0x%08lx ",
argv[1], bank, addr_first,
addr_last);
@@ -427,7 +427,7 @@ int flash_sect_erase (ulong addr_first, ulong addr_last)
s_first, s_last, &planned );
if (planned && (rcode == 0)) {
- for (bank=0,info=&flash_info[0];
+ for (bank=0,info = &flash_info[0];
(bank < CFG_MAX_FLASH_BANKS) && (rcode == 0);
++bank, ++info) {
if (s_first[bank]>=0) {
@@ -566,7 +566,7 @@ int do_protect (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
addr_last = addr_first + part->size - 1;
printf ("%sProtect Flash Parition %s, "
- "bank %d, 0x%08lx - 0x%08lx\n",
+ "bank %ld, 0x%08lx - 0x%08lx\n",
p ? "" : "Un", argv[1],
bank, addr_first, addr_last);
@@ -651,7 +651,7 @@ int flash_sect_protect (int p, ulong addr_first, ulong addr_last)
protected = 0;
if (planned && (rcode == 0)) {
- for (bank=0,info=&flash_info[0]; bank < CFG_MAX_FLASH_BANKS; ++bank, ++info) {
+ for (bank=0,info = &flash_info[0]; bank < CFG_MAX_FLASH_BANKS; ++bank, ++info) {
if (info->flash_id == FLASH_UNKNOWN) {
continue;
}
diff --git a/common/cmd_fpga.c b/common/cmd_fpga.c
index 9141dcce92..dcbbc993dd 100644
--- a/common/cmd_fpga.c
+++ b/common/cmd_fpga.c
@@ -85,7 +85,7 @@ int fpga_loadbitstream(unsigned long dev, char* fpgadata, size_t size)
length = (*dataptr << 8) + *(dataptr+1);
dataptr+=2;
for(i=0;i<length;i++)
- buffer[i]=*dataptr++;
+ buffer[i] = *dataptr++;
printf(" design filename = \"%s\"\n", buffer);
@@ -99,7 +99,7 @@ int fpga_loadbitstream(unsigned long dev, char* fpgadata, size_t size)
length = (*dataptr << 8) + *(dataptr+1);
dataptr+=2;
for(i=0;i<length;i++)
- buffer[i]=*dataptr++;
+ buffer[i] = *dataptr++;
printf(" part number = \"%s\"\n", buffer);
/* get date (identifier, length, string) */
@@ -112,7 +112,7 @@ int fpga_loadbitstream(unsigned long dev, char* fpgadata, size_t size)
length = (*dataptr << 8) + *(dataptr+1);
dataptr+=2;
for(i=0;i<length;i++)
- buffer[i]=*dataptr++;
+ buffer[i] = *dataptr++;
printf(" date = \"%s\"\n", buffer);
/* get time (identifier, length, string) */
@@ -124,7 +124,7 @@ int fpga_loadbitstream(unsigned long dev, char* fpgadata, size_t size)
length = (*dataptr << 8) + *(dataptr+1);
dataptr+=2;
for(i=0;i<length;i++)
- buffer[i]=*dataptr++;
+ buffer[i] = *dataptr++;
printf(" time = \"%s\"\n", buffer);
/* get fpga data length (identifier, length) */
diff --git a/common/cmd_ide.c b/common/cmd_ide.c
index 97a873d1c9..56db433024 100644
--- a/common/cmd_ide.c
+++ b/common/cmd_ide.c
@@ -298,7 +298,7 @@ int do_ide (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
ulong addr = simple_strtoul(argv[2], NULL, 16);
ulong cnt = simple_strtoul(argv[4], NULL, 16);
ulong n;
-#ifdef CFG_64BIT_STRTOUL
+#ifdef CFG_64BIT_LBA
lbaint_t blk = simple_strtoull(argv[3], NULL, 16);
printf ("\nIDE read: device %d block # %qd, count %ld ... ",
@@ -327,7 +327,7 @@ int do_ide (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
ulong addr = simple_strtoul(argv[2], NULL, 16);
ulong cnt = simple_strtoul(argv[4], NULL, 16);
ulong n;
-#ifdef CFG_64BIT_STRTOUL
+#ifdef CFG_64BIT_LBA
lbaint_t blk = simple_strtoull(argv[3], NULL, 16);
printf ("\nIDE write: device %d block # %qd, count %ld ... ",
diff --git a/common/cmd_jffs2.c b/common/cmd_jffs2.c
index 1b67e73f11..b4698bee47 100644
--- a/common/cmd_jffs2.c
+++ b/common/cmd_jffs2.c
@@ -241,13 +241,13 @@ static void memsize_format(char *buf, u32 size)
#define SIZE_KB ((u32)1024)
if ((size % SIZE_GB) == 0)
- sprintf(buf, "%lug", size/SIZE_GB);
+ sprintf(buf, "%ug", size/SIZE_GB);
else if ((size % SIZE_MB) == 0)
- sprintf(buf, "%lum", size/SIZE_MB);
+ sprintf(buf, "%um", size/SIZE_MB);
else if (size % SIZE_KB == 0)
- sprintf(buf, "%luk", size/SIZE_KB);
+ sprintf(buf, "%uk", size/SIZE_KB);
else
- sprintf(buf, "%lu", size);
+ sprintf(buf, "%u", size);
}
/**
@@ -416,7 +416,7 @@ static int part_validate(struct mtdids *id, struct part_info *part)
part->size = id->size - part->offset;
if (part->offset > id->size) {
- printf("%s: offset %08lx beyond flash size %08lx\n",
+ printf("%s: offset %08x beyond flash size %08x\n",
id->mtd_id, part->offset, id->size);
return 1;
}
@@ -1288,7 +1288,7 @@ static void list_partitions(void)
if (current_dev) {
part = jffs2_part_info(current_dev, current_partnum);
if (part) {
- printf("\nactive partition: %s%d,%d - (%s) 0x%08lx @ 0x%08lx\n",
+ printf("\nactive partition: %s%d,%d - (%s) 0x%08x @ 0x%08x\n",
MTD_DEV_TYPE(current_dev->id->type),
current_dev->id->num, current_partnum,
part->name, part->size, part->offset);
diff --git a/common/cmd_mfsl.c b/common/cmd_mfsl.c
index 5982b76e6e..c2442eed13 100644
--- a/common/cmd_mfsl.c
+++ b/common/cmd_mfsl.c
@@ -183,7 +183,7 @@ int do_frd (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
return 1;
}
- printf ("%01x: 0x%08lx - %s %s read\n", fslnum, num,
+ printf ("%01x: 0x%08x - %s %s read\n", fslnum, num,
blocking < 2 ? "non blocking" : "blocking",
((blocking == 1) || (blocking == 3)) ? "control" : "data" );
return 0;
@@ -341,7 +341,7 @@ int do_fwr (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
return 1;
}
- printf ("%01x: 0x%08lx - %s %s write\n", fslnum, num,
+ printf ("%01x: 0x%08x - %s %s write\n", fslnum, num,
blocking < 2 ? "non blocking" : "blocking",
((blocking == 1) || (blocking == 3)) ? "control" : "data" );
return 0;
@@ -382,7 +382,7 @@ int do_rspr (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
puts ("Unsupported register\n");
return 1;
}
- printf (": 0x%08lx\n", val);
+ printf (": 0x%08x\n", val);
return 0;
}
diff --git a/common/cmd_mp.c b/common/cmd_mp.c
index 26a57c5e96..b2a397cdfb 100644
--- a/common/cmd_mp.c
+++ b/common/cmd_mp.c
@@ -35,7 +35,7 @@ cpu_cmd(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
cpuid = simple_strtoul(argv[1], NULL, 10);
if (cpuid >= CONFIG_NR_CPUS) {
- printf ("Core num: %d is out of range[0..%d]\n",
+ printf ("Core num: %lu is out of range[0..%d]\n",
cpuid, CONFIG_NR_CPUS - 1);
return 1;
}
diff --git a/common/cmd_nand.c b/common/cmd_nand.c
index cc7c5ba241..9e38bf768f 100644
--- a/common/cmd_nand.c
+++ b/common/cmd_nand.c
@@ -886,9 +886,9 @@ int do_nand (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
return 1;
}
- printf ("\nNAND %s: device %d offset %ld, size %ld ...\n",
+ printf ("\nNAND %s: device %d offset %ld, size %lu ...\n",
(cmd & NANDRW_READ) ? "read" : "write",
- curr_device, off, size);
+ curr_device, off, (ulong)size);
ret = nand_legacy_rw (nand_dev_desc + curr_device,
cmd, off, size,
diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c
index 85a0f94f0f..70897062a6 100644
--- a/common/cmd_nvedit.c
+++ b/common/cmd_nvedit.c
@@ -99,7 +99,8 @@ int do_printenv (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
}
}
- printf("\nEnvironment size: %d/%d bytes\n", i, ENV_SIZE);
+ printf("\nEnvironment size: %d/%ld bytes\n",
+ i, (ulong)ENV_SIZE);
return 0;
}
diff --git a/common/cmd_onenand.c b/common/cmd_onenand.c
index aff11d15c9..ce99a38ca5 100644
--- a/common/cmd_onenand.c
+++ b/common/cmd_onenand.c
@@ -70,14 +70,14 @@ int do_onenand(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
if (!end || end < 0)
end = start;
- printf("Erase block from %d to %d\n", start, end);
+ printf("Erase block from %lu to %lu\n", start, end);
for (block = start; block <= end; block++) {
instr.addr = block << onenand_chip.erase_shift;
instr.len = 1 << onenand_chip.erase_shift;
ret = onenand_erase(&onenand_mtd, &instr);
if (ret) {
- printf("erase failed %d\n", block);
+ printf("erase failed %lu\n", block);
break;
}
}
diff --git a/common/cmd_reginfo.c b/common/cmd_reginfo.c
index 1669d74962..0657e4b1f1 100644
--- a/common/cmd_reginfo.c
+++ b/common/cmd_reginfo.c
@@ -282,54 +282,54 @@ int do_reginfo (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
puts ("\nMPC5200 registers\n");
printf ("MBAR=%08x\n", CFG_MBAR);
puts ("Memory map registers\n");
- printf ("\tCS0: start %08X\tstop %08X\tconfig %08X\ten %d\n",
+ printf ("\tCS0: start %08lX\tstop %08lX\tconfig %08lX\ten %d\n",
*(volatile ulong*)MPC5XXX_CS0_START,
*(volatile ulong*)MPC5XXX_CS0_STOP,
*(volatile ulong*)MPC5XXX_CS0_CFG,
(*(volatile ulong*)MPC5XXX_ADDECR & 0x00010000) ? 1 : 0);
- printf ("\tCS1: start %08X\tstop %08X\tconfig %08X\ten %d\n",
+ printf ("\tCS1: start %08lX\tstop %08lX\tconfig %08lX\ten %d\n",
*(volatile ulong*)MPC5XXX_CS1_START,
*(volatile ulong*)MPC5XXX_CS1_STOP,
*(volatile ulong*)MPC5XXX_CS1_CFG,
(*(volatile ulong*)MPC5XXX_ADDECR & 0x00020000) ? 1 : 0);
- printf ("\tCS2: start %08X\tstop %08X\tconfig %08X\ten %d\n",
+ printf ("\tCS2: start %08lX\tstop %08lX\tconfig %08lX\ten %d\n",
*(volatile ulong*)MPC5XXX_CS2_START,
*(volatile ulong*)MPC5XXX_CS2_STOP,
*(volatile ulong*)MPC5XXX_CS2_CFG,
(*(volatile ulong*)MPC5XXX_ADDECR & 0x00040000) ? 1 : 0);
- printf ("\tCS3: start %08X\tstop %08X\tconfig %08X\ten %d\n",
+ printf ("\tCS3: start %08lX\tstop %08lX\tconfig %08lX\ten %d\n",
*(volatile ulong*)MPC5XXX_CS3_START,
*(volatile ulong*)MPC5XXX_CS3_STOP,
*(volatile ulong*)MPC5XXX_CS3_CFG,
(*(volatile ulong*)MPC5XXX_ADDECR & 0x00080000) ? 1 : 0);
- printf ("\tCS4: start %08X\tstop %08X\tconfig %08X\ten %d\n",
+ printf ("\tCS4: start %08lX\tstop %08lX\tconfig %08lX\ten %d\n",
*(volatile ulong*)MPC5XXX_CS4_START,
*(volatile ulong*)MPC5XXX_CS4_STOP,
*(volatile ulong*)MPC5XXX_CS4_CFG,
(*(volatile ulong*)MPC5XXX_ADDECR & 0x00100000) ? 1 : 0);
- printf ("\tCS5: start %08X\tstop %08X\tconfig %08X\ten %d\n",
+ printf ("\tCS5: start %08lX\tstop %08lX\tconfig %08lX\ten %d\n",
*(volatile ulong*)MPC5XXX_CS5_START,
*(volatile ulong*)MPC5XXX_CS5_STOP,
*(volatile ulong*)MPC5XXX_CS5_CFG,
(*(volatile ulong*)MPC5XXX_ADDECR & 0x00200000) ? 1 : 0);
- printf ("\tCS6: start %08X\tstop %08X\tconfig %08X\ten %d\n",
+ printf ("\tCS6: start %08lX\tstop %08lX\tconfig %08lX\ten %d\n",
*(volatile ulong*)MPC5XXX_CS6_START,
*(volatile ulong*)MPC5XXX_CS6_STOP,
*(volatile ulong*)MPC5XXX_CS6_CFG,
(*(volatile ulong*)MPC5XXX_ADDECR & 0x04000000) ? 1 : 0);
- printf ("\tCS7: start %08X\tstop %08X\tconfig %08X\ten %d\n",
+ printf ("\tCS7: start %08lX\tstop %08lX\tconfig %08lX\ten %d\n",
*(volatile ulong*)MPC5XXX_CS7_START,
*(volatile ulong*)MPC5XXX_CS7_STOP,
*(volatile ulong*)MPC5XXX_CS7_CFG,
(*(volatile ulong*)MPC5XXX_ADDECR & 0x08000000) ? 1 : 0);
- printf ("\tBOOTCS: start %08X\tstop %08X\tconfig %08X\ten %d\n",
+ printf ("\tBOOTCS: start %08lX\tstop %08lX\tconfig %08lX\ten %d\n",
*(volatile ulong*)MPC5XXX_BOOTCS_START,
*(volatile ulong*)MPC5XXX_BOOTCS_STOP,
*(volatile ulong*)MPC5XXX_BOOTCS_CFG,
(*(volatile ulong*)MPC5XXX_ADDECR & 0x02000000) ? 1 : 0);
- printf ("\tSDRAMCS0: %08X\n",
+ printf ("\tSDRAMCS0: %08lX\n",
*(volatile ulong*)MPC5XXX_SDRAM_CS0CFG);
- printf ("\tSDRAMCS1: %08X\n",
+ printf ("\tSDRAMCS1: %08lX\n",
*(volatile ulong*)MPC5XXX_SDRAM_CS1CFG);
#elif defined(CONFIG_MPC86xx)
mpc86xx_reginfo();
diff --git a/common/cmd_scsi.c b/common/cmd_scsi.c
index e648f7d601..f3574650ce 100644
--- a/common/cmd_scsi.c
+++ b/common/cmd_scsi.c
@@ -171,7 +171,7 @@ removable:
if(scsi_max_devs>0)
scsi_curr_dev=0;
else
- scsi_curr_dev=-1;
+ scsi_curr_dev = -1;
}
diff --git a/common/cmd_usb.c b/common/cmd_usb.c
index 30caa98ea7..c62ca9769c 100644
--- a/common/cmd_usb.c
+++ b/common/cmd_usb.c
@@ -32,7 +32,7 @@
#include <usb.h>
#ifdef CONFIG_USB_STORAGE
-static int usb_stor_curr_dev=-1; /* current device */
+static int usb_stor_curr_dev = -1; /* current device */
#endif
/* some display routines (info command) */
diff --git a/common/devices.c b/common/devices.c
index ddf8f8ee2d..9cc963ac20 100644
--- a/common/devices.c
+++ b/common/devices.c
@@ -125,7 +125,7 @@ int device_deregister(char *devname)
device_t *dev = NULL;
char temp_names[3][8];
- dev_index=-1;
+ dev_index = -1;
for (i=1; i<=ListNumItems(devlist); i++) {
dev = ListGetPtrToItem (devlist, i);
if(strcmp(dev->name,devname)==0) {
diff --git a/common/env_onenand.c b/common/env_onenand.c
index ac8a8c15e7..ad5b1d7aa9 100644
--- a/common/env_onenand.c
+++ b/common/env_onenand.c
@@ -103,7 +103,7 @@ int saveenv(void)
instr.addr = env_addr;
instr.addr -= (unsigned long)onenand_chip.base;
if (onenand_erase(&onenand_mtd, &instr)) {
- printf("OneNAND: erase failed at 0x%08x\n", env_addr);
+ printf("OneNAND: erase failed at 0x%08lx\n", env_addr);
return 1;
}
diff --git a/common/fdt_support.c b/common/fdt_support.c
index 3828228204..93b144e64c 100644
--- a/common/fdt_support.c
+++ b/common/fdt_support.c
@@ -442,3 +442,90 @@ void fdt_fixup_dr_usb(void *blob, bd_t *bd)
prop, compat, fdt_strerror(err));
}
#endif /* CONFIG_HAS_FSL_DR_USB */
+
+#if defined(CONFIG_MPC83XX) || defined(CONFIG_MPC85xx)
+/*
+ * update crypto node properties to a specified revision of the SEC
+ * called with sec_rev == 0 if not on an mpc8xxxE processor
+ */
+void fdt_fixup_crypto_node(void *blob, int sec_rev)
+{
+ const struct sec_rev_prop {
+ u32 sec_rev;
+ u32 num_channels;
+ u32 channel_fifo_len;
+ u32 exec_units_mask;
+ u32 descriptor_types_mask;
+ } sec_rev_prop_list [] = {
+ { 0x0200, 4, 24, 0x07e, 0x01010ebf }, /* SEC 2.0 */
+ { 0x0201, 4, 24, 0x0fe, 0x012b0ebf }, /* SEC 2.1 */
+ { 0x0202, 1, 24, 0x04c, 0x0122003f }, /* SEC 2.2 */
+ { 0x0204, 4, 24, 0x07e, 0x012b0ebf }, /* SEC 2.4 */
+ { 0x0300, 4, 24, 0x9fe, 0x03ab0ebf }, /* SEC 3.0 */
+ { 0x0303, 4, 24, 0x97c, 0x03ab0abf }, /* SEC 3.3 */
+ };
+ char compat_strlist[ARRAY_SIZE(sec_rev_prop_list) *
+ sizeof("fsl,secX.Y")];
+ int crypto_node, sec_idx, err;
+ char *p;
+ u32 val;
+
+ /* locate crypto node based on lowest common compatible */
+ crypto_node = fdt_node_offset_by_compatible(blob, -1, "fsl,sec2.0");
+ if (crypto_node == -FDT_ERR_NOTFOUND)
+ return;
+
+ /* delete it if not on an E-processor */
+ if (crypto_node > 0 && !sec_rev) {
+ fdt_del_node(blob, crypto_node);
+ return;
+ }
+
+ /* else we got called for possible uprev */
+ for (sec_idx = 0; sec_idx < ARRAY_SIZE(sec_rev_prop_list); sec_idx++)
+ if (sec_rev_prop_list[sec_idx].sec_rev == sec_rev)
+ break;
+
+ if (sec_idx == ARRAY_SIZE(sec_rev_prop_list)) {
+ puts("warning: unknown SEC revision number\n");
+ return;
+ }
+
+ val = cpu_to_fdt32(sec_rev_prop_list[sec_idx].num_channels);
+ err = fdt_setprop(blob, crypto_node, "fsl,num-channels", &val, 4);
+ if (err < 0)
+ printf("WARNING: could not set crypto property: %s\n",
+ fdt_strerror(err));
+
+ val = cpu_to_fdt32(sec_rev_prop_list[sec_idx].descriptor_types_mask);
+ err = fdt_setprop(blob, crypto_node, "fsl,descriptor-types-mask", &val, 4);
+ if (err < 0)
+ printf("WARNING: could not set crypto property: %s\n",
+ fdt_strerror(err));
+
+ val = cpu_to_fdt32(sec_rev_prop_list[sec_idx].exec_units_mask);
+ err = fdt_setprop(blob, crypto_node, "fsl,exec-units-mask", &val, 4);
+ if (err < 0)
+ printf("WARNING: could not set crypto property: %s\n",
+ fdt_strerror(err));
+
+ val = cpu_to_fdt32(sec_rev_prop_list[sec_idx].channel_fifo_len);
+ err = fdt_setprop(blob, crypto_node, "fsl,channel-fifo-len", &val, 4);
+ if (err < 0)
+ printf("WARNING: could not set crypto property: %s\n",
+ fdt_strerror(err));
+
+ val = 0;
+ while (sec_idx >= 0) {
+ p = compat_strlist + val;
+ val += sprintf(p, "fsl,sec%d.%d",
+ (sec_rev_prop_list[sec_idx].sec_rev & 0xff00) >> 8,
+ sec_rev_prop_list[sec_idx].sec_rev & 0x00ff) + 1;
+ sec_idx--;
+ }
+ err = fdt_setprop(blob, crypto_node, "compatible", &compat_strlist, val);
+ if (err < 0)
+ printf("WARNING: could not set crypto property: %s\n",
+ fdt_strerror(err));
+}
+#endif /* defined(CONFIG_MPC83XX) || defined(CONFIG_MPC85xx) */
diff --git a/common/flash.c b/common/flash.c
index 888ff9c67c..fe39d55ef6 100644
--- a/common/flash.c
+++ b/common/flash.c
@@ -104,7 +104,7 @@ addr2info (ulong addr)
flash_info_t *info;
int i;
- for (i=0, info=&flash_info[0]; i<CFG_MAX_FLASH_BANKS; ++i, ++info) {
+ for (i=0, info = &flash_info[0]; i<CFG_MAX_FLASH_BANKS; ++i, ++info) {
if (info->flash_id != FLASH_UNKNOWN &&
addr >= info->start[0] &&
/* WARNING - The '- 1' is needed if the flash
diff --git a/common/hush.c b/common/hush.c
index b43f6185ac..75c18ce8ae 100644
--- a/common/hush.c
+++ b/common/hush.c
@@ -953,7 +953,7 @@ static int b_adduint(o_string *o, unsigned int i)
static int static_get(struct in_str *i)
{
- int ch=*i->p++;
+ int ch = *i->p++;
if (ch=='\0') return EOF;
return ch;
}
@@ -1104,7 +1104,7 @@ static int file_get(struct in_str *i)
ch = 0;
/* If there is data waiting, eat it up */
if (i->p && *i->p) {
- ch=*i->p++;
+ ch = *i->p++;
} else {
/* need to double check i->file because we might be doing something
* more complicated by now, like sourcing or substituting. */
@@ -1121,7 +1121,7 @@ static int file_get(struct in_str *i)
i->__promptme = 0;
#endif
if (i->p && *i->p) {
- ch=*i->p++;
+ ch = *i->p++;
}
#ifndef __U_BOOT__
} else {
diff --git a/common/image.c b/common/image.c
index ddd9e8ba04..535c302d4e 100644
--- a/common/image.c
+++ b/common/image.c
@@ -827,13 +827,13 @@ int boot_get_ramdisk (int argc, char *argv[], bootm_headers_t *images,
cfg_noffset = fit_conf_get_node (fit_hdr, fit_uname_config);
if (cfg_noffset < 0) {
debug ("* ramdisk: no such config\n");
- return 0;
+ return 1;
}
rd_noffset = fit_conf_get_ramdisk_node (fit_hdr, cfg_noffset);
if (rd_noffset < 0) {
debug ("* ramdisk: no ramdisk in config\n");
- return 0;
+ return 1;
}
}
#endif
@@ -872,7 +872,7 @@ int boot_get_ramdisk (int argc, char *argv[], bootm_headers_t *images,
if (!fit_check_format (fit_hdr)) {
puts ("Bad FIT ramdisk image format!\n");
show_boot_progress (-120);
- return 0;
+ return 1;
}
show_boot_progress (121);
@@ -887,7 +887,7 @@ int boot_get_ramdisk (int argc, char *argv[], bootm_headers_t *images,
if (cfg_noffset < 0) {
puts ("Could not find configuration node\n");
show_boot_progress (-122);
- return 0;
+ return 1;
}
fit_uname_config = fdt_get_name (fit_hdr, cfg_noffset, NULL);
printf (" Using '%s' configuration\n", fit_uname_config);
@@ -902,20 +902,20 @@ int boot_get_ramdisk (int argc, char *argv[], bootm_headers_t *images,
if (rd_noffset < 0) {
puts ("Could not find subimage node\n");
show_boot_progress (-124);
- return 0;
+ return 1;
}
printf (" Trying '%s' ramdisk subimage\n", fit_uname_ramdisk);
show_boot_progress (125);
if (!fit_check_ramdisk (fit_hdr, rd_noffset, arch, images->verify))
- return 0;
+ return 1;
/* get ramdisk image data address and length */
if (fit_image_get_data (fit_hdr, rd_noffset, &data, &size)) {
puts ("Could not find ramdisk subimage data!\n");
show_boot_progress (-127);
- return 0;
+ return 1;
}
show_boot_progress (128);
@@ -925,7 +925,7 @@ int boot_get_ramdisk (int argc, char *argv[], bootm_headers_t *images,
if (fit_image_get_load (fit_hdr, rd_noffset, &rd_load)) {
puts ("Can't get ramdisk subimage load address!\n");
show_boot_progress (-129);
- return 0;
+ return 1;
}
show_boot_progress (129);
diff --git a/common/lcd.c b/common/lcd.c
index ebf377aa89..eec1f53b0a 100644
--- a/common/lcd.c
+++ b/common/lcd.c
@@ -539,7 +539,7 @@ void bitmap_plot (int x, int y)
debug ("Logo: width %d height %d colors %d cmap %d\n",
BMP_LOGO_WIDTH, BMP_LOGO_HEIGHT, BMP_LOGO_COLORS,
- sizeof(bmp_logo_palette)/(sizeof(ushort)));
+ (int)(sizeof(bmp_logo_palette)/(sizeof(ushort))));
bmap = &bmp_logo_bitmap[0];
fb = (uchar *)(lcd_base + y * lcd_line_length + x);
@@ -728,7 +728,7 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y)
WATCHDOG_RESET();
for (j = 0; j < width ; j++)
#if defined(CONFIG_PXA250)
- *(fb++)=*(bmap++);
+ *(fb++) = *(bmap++);
#elif defined(CONFIG_MPC823) || defined(CONFIG_MCC200)
*(fb++)=255-*(bmap++);
#endif
diff --git a/common/usb.c b/common/usb.c
index a0107dca53..a45d113a74 100644
--- a/common/usb.c
+++ b/common/usb.c
@@ -252,7 +252,7 @@ int usb_set_maxpacket(struct usb_device *dev)
for(i=0; i<dev->config.bNumInterfaces;i++) {
for(ii=0; ii<dev->config.if_desc[i].bNumEndpoints; ii++) {
- ep=&dev->config.if_desc[i].ep_desc[ii];
+ ep = &dev->config.if_desc[i].ep_desc[ii];
b=ep->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK;
if((ep->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK)==USB_ENDPOINT_XFER_CONTROL) { /* Control => bidirectional */
@@ -627,7 +627,7 @@ int usb_string(struct usb_device *dev, int index, char *buf, size_t size)
if (size <= 0 || !buf || !index)
return -1;
buf[0] = 0;
- tbuf=&mybuf[0];
+ tbuf = &mybuf[0];
/* get langid for strings if it's not yet known */
if (!dev->have_langid) {
@@ -857,7 +857,7 @@ void usb_scan_devices(void)
/* first make all devices unknown */
for(i=0;i<USB_MAX_DEVICE;i++) {
memset(&usb_dev[i],0,sizeof(struct usb_device));
- usb_dev[i].devnum=-1;
+ usb_dev[i].devnum = -1;
}
dev_index=0;
/* device 0 is always present (root hub, so let it analyze) */
diff --git a/common/usb_kbd.c b/common/usb_kbd.c
index 1e79208d7c..c8764952ec 100644
--- a/common/usb_kbd.c
+++ b/common/usb_kbd.c
@@ -730,8 +730,8 @@ static int usb_kbd_get_hid_desc(struct usb_device *dev)
return -1;
}
printf(" report descriptor (size %u, read %d)\n", len, index);
- start=&buffer[0];
- end=&buffer[len];
+ start = &buffer[0];
+ end = &buffer[len];
i=0;
do {
index=fetch_item(start,end,&item);
diff --git a/common/usb_storage.c b/common/usb_storage.c
index 3e113b4084..d8fbb69a36 100644
--- a/common/usb_storage.c
+++ b/common/usb_storage.c
@@ -731,7 +731,7 @@ int usb_stor_CB_transport(ccb *srb, struct us_data *us)
ccb reqsrb;
int retry,notready;
- psrb=&reqsrb;
+ psrb = &reqsrb;
status=USB_STOR_TRANSPORT_GOOD;
retry=0;
notready=0;
@@ -776,7 +776,7 @@ do_retry:
psrb->cmd[1]=srb->lun<<5;
psrb->cmd[4]=18;
psrb->datalen=18;
- psrb->pdata=&srb->sense_buf[0];
+ psrb->pdata = &srb->sense_buf[0];
psrb->cmdlen=12;
/* issue the command */
result=usb_stor_CB_comdat(psrb,us);
@@ -858,7 +858,7 @@ static int usb_request_sense(ccb *srb,struct us_data *ss)
srb->cmd[1]=srb->lun<<5;
srb->cmd[4]=18;
srb->datalen=18;
- srb->pdata=&srb->sense_buf[0];
+ srb->pdata = &srb->sense_buf[0];
srb->cmdlen=12;
ss->transport(srb,ss);
USB_STOR_PRINTF("Request Sense returned %02X %02X %02X\n",srb->sense_buf[2],srb->sense_buf[12],srb->sense_buf[13]);
OpenPOWER on IntegriCloud