diff options
author | Kumar Gala <galak@kernel.crashing.org> | 2006-02-22 14:15:41 -0600 |
---|---|---|
committer | Kumar Gala <galak@kernel.crashing.org> | 2006-02-22 14:15:41 -0600 |
commit | 79582020313e6d992a3bac71cf3a9b337f9ac7f7 (patch) | |
tree | 5eefe0c7b244ffd0798e64f9a83ec7084032a816 /board/esd/common | |
parent | 230b31febf39f9d9f19679cf0112d9e30415122d (diff) | |
parent | 6624b687bc2b747233090e67628df37d1c84ed17 (diff) | |
download | u-boot-imx-79582020313e6d992a3bac71cf3a9b337f9ac7f7.zip u-boot-imx-79582020313e6d992a3bac71cf3a9b337f9ac7f7.tar.gz u-boot-imx-79582020313e6d992a3bac71cf3a9b337f9ac7f7.tar.bz2 |
Merge rsync://rsync.denx.de/git/u-boot
Diffstat (limited to 'board/esd/common')
-rw-r--r-- | board/esd/common/auto_update.c | 2 | ||||
-rw-r--r-- | board/esd/common/cmd_loadpci.c | 123 | ||||
-rw-r--r-- | board/esd/common/lcd.c | 3 |
3 files changed, 127 insertions, 1 deletions
diff --git a/board/esd/common/auto_update.c b/board/esd/common/auto_update.c index d48e972..1decc0e 100644 --- a/board/esd/common/auto_update.c +++ b/board/esd/common/auto_update.c @@ -283,7 +283,7 @@ int au_do_update(int i, long sz) */ if (au_image[i].type != AU_NAND) { debug ("flash_write(%p, %lx %x)\n", addr, start, nbytes); - rc = flash_write((uchar *)addr, start, nbytes); + rc = flash_write((char *)addr, start, nbytes); } else { #if (CONFIG_COMMANDS & CFG_CMD_NAND) debug ("nand_rw(%p, %lx %x)\n", addr, start, nbytes); diff --git a/board/esd/common/cmd_loadpci.c b/board/esd/common/cmd_loadpci.c new file mode 100644 index 0000000..3478f82 --- /dev/null +++ b/board/esd/common/cmd_loadpci.c @@ -0,0 +1,123 @@ +/* + * (C) Copyright 2005 + * Matthias Fuchs, esd GmbH Germany, matthias.fuchs@esd-electronics.com + * + * See file CREDITS for list of people who contributed to this + * project. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + */ + +#include <common.h> +#include <command.h> + +#if (CONFIG_COMMANDS & CFG_CMD_BSP) + +extern int do_bootm (cmd_tbl_t *, int, int, char *[]); +extern int do_autoscript (cmd_tbl_t *, int, int, char *[]); + +#define ADDRMASK 0xfffff000 + +/* + * Command loadpci: wait for signal from host and boot image. + */ +int do_loadpci(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +{ + unsigned int *ptr = 0; + int count = 0; + int count2 = 0; + char addr[16]; + char str[] = "\\|/-"; + char *local_args[2]; + + while(1) { + /* + * Mark sync address + */ + ptr = 0; + memset(ptr, 0, 0x20); + + *ptr = 0xffffffff; + puts("\nWaiting for action from pci host -"); + + /* + * Wait for host to write the start address + */ + while (*ptr == 0xffffffff) { + count++; + if (!(count % 100)) { + count2++; + putc(0x08); /* backspace */ + putc(str[count2 % 4]); + } + + /* Abort if ctrl-c was pressed */ + if (ctrlc()) { + puts("\nAbort\n"); + return 0; + } + + udelay(1000); + } + + printf("\nGot bootcode %08x: ", *ptr); + sprintf(addr, "%08x", *ptr & ADDRMASK); + + switch (*ptr & ~ADDRMASK) { + case 0: + /* + * Boot image via bootm + */ + printf("booting image at addr 0x%s ...\n", addr); + setenv("loadaddr", addr); + + do_bootm (cmdtp, 0, 0, NULL); + break; + + case 1: + /* + * Boot image via autoscr + */ + printf("executing script at addr 0x%s ...\n", addr); + + local_args[0] = addr; + local_args[1] = NULL; + do_autoscript(cmdtp, 0, 1, local_args); + break; + + case 2: + /* + * Call run_cmd + */ + printf("running command at addr 0x%s ...\n", addr); + run_command ((char*)(*ptr & ADDRMASK), 0); + break; + + default: + printf("unhandled boot method\n"); + break; + } + } +} + +U_BOOT_CMD( + loadpci, 1, 1, do_loadpci, + "loadpci - Wait for pci bootcmd and boot it\n", + NULL + ); + +#endif + diff --git a/board/esd/common/lcd.c b/board/esd/common/lcd.c index 0edc083..196171c 100644 --- a/board/esd/common/lcd.c +++ b/board/esd/common/lcd.c @@ -229,6 +229,9 @@ void lcd_init(uchar *lcd_reg, uchar *lcd_mem, S1D_REGS *regs, int reg_count, /* * Detect epson */ + lcd_reg[0] = 0x00; + lcd_reg[1] = 0x00; + if (lcd_reg[0] == 0x1c) { /* * Big epson detected |