ARM: davinci: fixes for cam_enc_4xx board
- change CONFIG_ENV_RANGE to contain 2 nand erase blocks,
one for bad block reserve.
- remove from the envvariable "img_writeramdisk" the
ubifsmount command, as it is not needed.
- erase the hole mtd partition containing u-boot
- save environment variable "dvn_app_vers" and "dvn_boot_vers"
only after installing the new image.
changes requested from Marek Vasut:
- arm, davinci: fix eldk-4.2 warnings for cam_enc_4xx board
- get rid of run_command2 usage
needed since patch:
commit 009dde1955
Author: Simon Glass <sjg@chromium.org>
Date: Tue Feb 14 19:59:20 2012 +0000
Rename run_command2() to run_command()
is now in mainline.
- add CONFIG_SPL_LIBGENERIC_SUPPORT support
- remove CONFIG_CMD_PXE support
- fix warning:
cam_enc_4xx.c: In function 'menu_handle':
cam_enc_4xx.c:609: warning: dereferencing type-punned pointer
will break strict-aliasing rules
- fix error:
arm-linux-ld: u-boot-spl: Not enough room for program headers,
try linking with -N
Signed-off-by: Heiko Schocher <hs@denx.de>
Cc: Marek Vasut <marex@denx.de>
Cc: Tom Rini <tom.rini@gmail.com>
Cc: Fletzer Martin <Martin.Fletzer@ait.ac.at>
Cc: Wolfgang Denk <wd@denx.de>
This commit is contained in:
parent
08b5ab073d
commit
24efef90c4
|
@ -21,6 +21,7 @@
|
||||||
|
|
||||||
#include <common.h>
|
#include <common.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
#include <hush.h>
|
||||||
#include <linux/mtd/nand.h>
|
#include <linux/mtd/nand.h>
|
||||||
#include <nand.h>
|
#include <nand.h>
|
||||||
#include <miiphy.h>
|
#include <miiphy.h>
|
||||||
|
@ -554,7 +555,7 @@ static char *menu_handle(struct menu_display *display)
|
||||||
{
|
{
|
||||||
struct menu *m;
|
struct menu *m;
|
||||||
int i;
|
int i;
|
||||||
char *choice = NULL;
|
void *choice = NULL;
|
||||||
char key[2];
|
char key[2];
|
||||||
int ret;
|
int ret;
|
||||||
char *s;
|
char *s;
|
||||||
|
@ -606,7 +607,7 @@ static char *menu_handle(struct menu_display *display)
|
||||||
sprintf(key, "%d", 1);
|
sprintf(key, "%d", 1);
|
||||||
menu_default_set(m, key);
|
menu_default_set(m, key);
|
||||||
|
|
||||||
if (menu_get_choice(m, (void **)&choice) != 1)
|
if (menu_get_choice(m, &choice) != 1)
|
||||||
debug("Problem picking a choice!\n");
|
debug("Problem picking a choice!\n");
|
||||||
|
|
||||||
menu_destroy(m);
|
menu_destroy(m);
|
||||||
|
@ -653,7 +654,7 @@ static int ait_writeublheader(void)
|
||||||
sprintf(s, "%lx", i);
|
sprintf(s, "%lx", i);
|
||||||
ret = setenv("header_addr", s);
|
ret = setenv("header_addr", s);
|
||||||
if (ret == 0)
|
if (ret == 0)
|
||||||
ret = run_command2("run img_writeheader", 0);
|
ret = run_command("run img_writeheader", 0);
|
||||||
if (ret != 0)
|
if (ret != 0)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -697,7 +698,7 @@ static int ait_menu_install_images(void)
|
||||||
setenv("filesize", s);
|
setenv("filesize", s);
|
||||||
switch (imgs[count].subtype) {
|
switch (imgs[count].subtype) {
|
||||||
case FIT_SUBTYPE_DF_ENV_IMAGE:
|
case FIT_SUBTYPE_DF_ENV_IMAGE:
|
||||||
ret = run_command2("run img_writedfenv", 0);
|
ret = run_command("run img_writedfenv", 0);
|
||||||
break;
|
break;
|
||||||
case FIT_SUBTYPE_RAMDISK_IMAGE:
|
case FIT_SUBTYPE_RAMDISK_IMAGE:
|
||||||
t = getenv("img_volume");
|
t = getenv("img_volume");
|
||||||
|
@ -713,16 +714,16 @@ static int ait_menu_install_images(void)
|
||||||
if (ret != 0)
|
if (ret != 0)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
ret = run_command2("run img_writeramdisk", 0);
|
ret = run_command("run img_writeramdisk", 0);
|
||||||
break;
|
break;
|
||||||
case FIT_SUBTYPE_SPL_IMAGE:
|
case FIT_SUBTYPE_SPL_IMAGE:
|
||||||
ret = run_command2("run img_writespl", 0);
|
ret = run_command("run img_writespl", 0);
|
||||||
break;
|
break;
|
||||||
case FIT_SUBTYPE_UBL_HEADER:
|
case FIT_SUBTYPE_UBL_HEADER:
|
||||||
ret = ait_writeublheader();
|
ret = ait_writeublheader();
|
||||||
break;
|
break;
|
||||||
case FIT_SUBTYPE_UBOOT_IMAGE:
|
case FIT_SUBTYPE_UBOOT_IMAGE:
|
||||||
ret = run_command2("run img_writeuboot", 0);
|
ret = run_command("run img_writeuboot", 0);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
/* not supported type */
|
/* not supported type */
|
||||||
|
@ -731,8 +732,19 @@ static int ait_menu_install_images(void)
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
/* now save dvn_* and img_volume env vars to new values */
|
/* now save dvn_* and img_volume env vars to new values */
|
||||||
if (ret == 0)
|
if (ret == 0) {
|
||||||
ret = run_command2("run savenewvers", 0);
|
t = getenv("x_dvn_boot_vers");
|
||||||
|
if (t)
|
||||||
|
setenv("dvn_boot_vers", t);
|
||||||
|
|
||||||
|
t = getenv("x_dvn_app_vers");
|
||||||
|
if (t)
|
||||||
|
setenv("dvn_boot_vers", t);
|
||||||
|
|
||||||
|
setenv("x_dvn_boot_vers", NULL);
|
||||||
|
setenv("x_dvn_app_vers", NULL);
|
||||||
|
ret = run_command("run savenewvers", 0);
|
||||||
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -749,6 +761,8 @@ static int ait_menu_evaluate_load(char *choice)
|
||||||
break;
|
break;
|
||||||
case '2':
|
case '2':
|
||||||
/* cancel, back to main */
|
/* cancel, back to main */
|
||||||
|
setenv("x_dvn_boot_vers", NULL);
|
||||||
|
setenv("x_dvn_app_vers", NULL);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -961,7 +975,7 @@ static int ait_menu_check_image(void)
|
||||||
if (s) {
|
if (s) {
|
||||||
ret = strcmp(s, imgs[found_uboot].desc);
|
ret = strcmp(s, imgs[found_uboot].desc);
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
setenv("dvn_boot_vers",
|
setenv("x_dvn_boot_vers",
|
||||||
imgs[found_uboot].desc);
|
imgs[found_uboot].desc);
|
||||||
} else {
|
} else {
|
||||||
found_uboot = -1;
|
found_uboot = -1;
|
||||||
|
@ -976,7 +990,7 @@ static int ait_menu_check_image(void)
|
||||||
if (s) {
|
if (s) {
|
||||||
ret = strcmp(s, imgs[found_ramdisk].desc);
|
ret = strcmp(s, imgs[found_ramdisk].desc);
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
setenv("dvn_app_vers",
|
setenv("x_dvn_app_vers",
|
||||||
imgs[found_ramdisk].desc);
|
imgs[found_ramdisk].desc);
|
||||||
} else {
|
} else {
|
||||||
found_ramdisk = -1;
|
found_ramdisk = -1;
|
||||||
|
@ -1005,7 +1019,7 @@ static int ait_menu_evaluate_update(char *choice)
|
||||||
break;
|
break;
|
||||||
case '2':
|
case '2':
|
||||||
/* load image */
|
/* load image */
|
||||||
ret = run_command2("run load_img", 0);
|
ret = run_command("run load_img", 0);
|
||||||
printf("ret: %d\n", ret);
|
printf("ret: %d\n", ret);
|
||||||
if (ret)
|
if (ret)
|
||||||
return MENU_UPDATE;
|
return MENU_UPDATE;
|
||||||
|
@ -1073,9 +1087,9 @@ int menu_show(int bootdelay)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
run_command2("run saveparms", 0);
|
run_command("run saveparms", 0);
|
||||||
ret = ait_menu_show(&ait_main, bootdelay);
|
ret = ait_menu_show(&ait_main, bootdelay);
|
||||||
run_command2("run restoreparms", 0);
|
run_command("run restoreparms", 0);
|
||||||
|
|
||||||
if (ret == MENU_EXIT_BOOTCMD)
|
if (ret == MENU_EXIT_BOOTCMD)
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -1085,8 +1099,17 @@ int menu_show(int bootdelay)
|
||||||
|
|
||||||
void menu_display_statusline(struct menu *m)
|
void menu_display_statusline(struct menu *m)
|
||||||
{
|
{
|
||||||
printf("State: dvn_boot_vers: %s dvn_app_vers: %s\n",
|
char *s1, *s2;
|
||||||
getenv("dvn_boot_vers"), getenv("dvn_app_vers"));
|
|
||||||
|
s1 = getenv("x_dvn_boot_vers");
|
||||||
|
if (!s1)
|
||||||
|
s1 = getenv("dvn_boot_vers");
|
||||||
|
|
||||||
|
s2 = getenv("x_dvn_app_vers");
|
||||||
|
if (!s2)
|
||||||
|
s2 = getenv("dvn_app_vers");
|
||||||
|
|
||||||
|
printf("State: dvn_boot_vers: %s dvn_app_vers: %s\n", s1, s2);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -12,4 +12,11 @@ PAD_TO := 12320
|
||||||
UBL_CONFIG = $(SRCTREE)/board/$(BOARDDIR)/ublimage.cfg
|
UBL_CONFIG = $(SRCTREE)/board/$(BOARDDIR)/ublimage.cfg
|
||||||
ifndef CONFIG_SPL_BUILD
|
ifndef CONFIG_SPL_BUILD
|
||||||
ALL-y += $(obj)u-boot.ubl
|
ALL-y += $(obj)u-boot.ubl
|
||||||
|
else
|
||||||
|
# as SPL_TEXT_BASE is not page-aligned, we need for some
|
||||||
|
# linkers the -n flag (Do not page align data), to prevent
|
||||||
|
# the following error message:
|
||||||
|
# arm-linux-ld: u-boot-spl: Not enough room for program headers, try linking
|
||||||
|
# with -N
|
||||||
|
LDFLAGS_u-boot-spl += -n
|
||||||
endif
|
endif
|
||||||
|
|
|
@ -32,7 +32,7 @@ OUTPUT_ARCH(arm)
|
||||||
ENTRY(_start)
|
ENTRY(_start)
|
||||||
SECTIONS
|
SECTIONS
|
||||||
{
|
{
|
||||||
. = 0x00000000;
|
. = CONFIG_SPL_TEXT_BASE;
|
||||||
|
|
||||||
. = ALIGN(4);
|
. = ALIGN(4);
|
||||||
.text :
|
.text :
|
||||||
|
|
|
@ -161,15 +161,14 @@
|
||||||
#define CONFIG_MENU
|
#define CONFIG_MENU
|
||||||
#define CONFIG_MENU_SHOW
|
#define CONFIG_MENU_SHOW
|
||||||
#define CONFIG_FIT
|
#define CONFIG_FIT
|
||||||
#define CONFIG_CMD_PXE
|
|
||||||
#define CONFIG_BOARD_IMG_ADDR_R 0x80000000
|
#define CONFIG_BOARD_IMG_ADDR_R 0x80000000
|
||||||
|
|
||||||
#ifdef CONFIG_NAND_DAVINCI
|
#ifdef CONFIG_NAND_DAVINCI
|
||||||
#define CONFIG_ENV_SIZE (16 << 10)
|
#define CONFIG_ENV_SIZE (16 << 10)
|
||||||
#define CONFIG_ENV_IS_IN_NAND
|
#define CONFIG_ENV_IS_IN_NAND
|
||||||
#define CONFIG_ENV_OFFSET 0x180000
|
#define CONFIG_ENV_OFFSET 0x180000
|
||||||
|
#define CONFIG_ENV_RANGE 0x040000
|
||||||
#define CONFIG_ENV_OFFSET_REDUND 0x1c0000
|
#define CONFIG_ENV_OFFSET_REDUND 0x1c0000
|
||||||
#define CONFIG_ENV_RANGE 0x020000
|
|
||||||
#undef CONFIG_ENV_IS_IN_FLASH
|
#undef CONFIG_ENV_IS_IN_FLASH
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -220,6 +219,7 @@
|
||||||
|
|
||||||
/* Defines for SPL */
|
/* Defines for SPL */
|
||||||
#define CONFIG_SPL
|
#define CONFIG_SPL
|
||||||
|
#define CONFIG_SPL_LIBGENERIC_SUPPORT
|
||||||
#define CONFIG_SPL_NAND_SUPPORT
|
#define CONFIG_SPL_NAND_SUPPORT
|
||||||
#define CONFIG_SPL_NAND_SIMPLE
|
#define CONFIG_SPL_NAND_SIMPLE
|
||||||
#define CONFIG_SPL_NAND_LOAD
|
#define CONFIG_SPL_NAND_LOAD
|
||||||
|
@ -229,7 +229,7 @@
|
||||||
#define CONFIG_SPL_LDSCRIPT "$(BOARDDIR)/u-boot-spl.lds"
|
#define CONFIG_SPL_LDSCRIPT "$(BOARDDIR)/u-boot-spl.lds"
|
||||||
#define CONFIG_SPL_STACK (0x00010000 + 0x7f00)
|
#define CONFIG_SPL_STACK (0x00010000 + 0x7f00)
|
||||||
|
|
||||||
#define CONFIG_SPL_TEXT_BASE 0x0000020 /*CONFIG_SYS_SRAM_START*/
|
#define CONFIG_SPL_TEXT_BASE 0x00000020 /*CONFIG_SYS_SRAM_START*/
|
||||||
#define CONFIG_SPL_MAX_SIZE 12320
|
#define CONFIG_SPL_MAX_SIZE 12320
|
||||||
|
|
||||||
#ifndef CONFIG_SPL_BUILD
|
#ifndef CONFIG_SPL_BUILD
|
||||||
|
@ -274,6 +274,7 @@
|
||||||
|
|
||||||
#define CONFIG_SYS_NAND_U_BOOT_OFFS 0x80000
|
#define CONFIG_SYS_NAND_U_BOOT_OFFS 0x80000
|
||||||
#define CONFIG_SYS_NAND_U_BOOT_SIZE 0xa0000
|
#define CONFIG_SYS_NAND_U_BOOT_SIZE 0xa0000
|
||||||
|
#define CONFIG_SYS_NAND_U_BOOT_ERA_SIZE 0x100000
|
||||||
|
|
||||||
/* for UBL header */
|
/* for UBL header */
|
||||||
#define CONFIG_SYS_UBL_BLOCK (CONFIG_SYS_NAND_PAGE_SIZE)
|
#define CONFIG_SYS_UBL_BLOCK (CONFIG_SYS_NAND_PAGE_SIZE)
|
||||||
|
@ -429,7 +430,7 @@
|
||||||
" 0 3000;nandrbl uboot\0" \
|
" 0 3000;nandrbl uboot\0" \
|
||||||
"writeuboot=nandrbl uboot;" \
|
"writeuboot=nandrbl uboot;" \
|
||||||
"nand erase " xstr(CONFIG_SYS_NAND_U_BOOT_OFFS) " " \
|
"nand erase " xstr(CONFIG_SYS_NAND_U_BOOT_OFFS) " " \
|
||||||
xstr(CONFIG_SYS_NAND_U_BOOT_SIZE) \
|
xstr(CONFIG_SYS_NAND_U_BOOT_ERA_SIZE) \
|
||||||
";nand write " xstr(DVN4XX_UBOOT_ADDR_R_UBOOT) \
|
";nand write " xstr(DVN4XX_UBOOT_ADDR_R_UBOOT) \
|
||||||
" " xstr(CONFIG_SYS_NAND_U_BOOT_OFFS) " " \
|
" " xstr(CONFIG_SYS_NAND_U_BOOT_OFFS) " " \
|
||||||
xstr(CONFIG_SYS_NAND_U_BOOT_SIZE) "\0" \
|
xstr(CONFIG_SYS_NAND_U_BOOT_SIZE) "\0" \
|
||||||
|
@ -466,14 +467,14 @@
|
||||||
"nand write ${img_addr_r} 0 3000;nandrbl uboot\0" \
|
"nand write ${img_addr_r} 0 3000;nandrbl uboot\0" \
|
||||||
"img_writeuboot=nandrbl uboot;" \
|
"img_writeuboot=nandrbl uboot;" \
|
||||||
"nand erase " xstr(CONFIG_SYS_NAND_U_BOOT_OFFS) " " \
|
"nand erase " xstr(CONFIG_SYS_NAND_U_BOOT_OFFS) " " \
|
||||||
xstr(CONFIG_SYS_NAND_U_BOOT_SIZE) \
|
xstr(CONFIG_SYS_NAND_U_BOOT_ERA_SIZE) \
|
||||||
";nand write ${img_addr_r} " \
|
";nand write ${img_addr_r} " \
|
||||||
xstr(CONFIG_SYS_NAND_U_BOOT_OFFS) " " \
|
xstr(CONFIG_SYS_NAND_U_BOOT_OFFS) " " \
|
||||||
xstr(CONFIG_SYS_NAND_U_BOOT_SIZE) "\0" \
|
xstr(CONFIG_SYS_NAND_U_BOOT_SIZE) "\0" \
|
||||||
"img_writedfenv=ubi part ubi 2048;" \
|
"img_writedfenv=ubi part ubi 2048;" \
|
||||||
"ubi write ${img_addr_r} default ${filesize}\0" \
|
"ubi write ${img_addr_r} default ${filesize}\0" \
|
||||||
"img_volume=rootfs1\0" \
|
"img_volume=rootfs1\0" \
|
||||||
"img_writeramdisk=ubi part ubi 2048;ubifsmount ${img_volume};" \
|
"img_writeramdisk=ubi part ubi 2048;" \
|
||||||
"ubi write ${img_addr_r} ${img_volume} ${filesize}\0" \
|
"ubi write ${img_addr_r} ${img_volume} ${filesize}\0" \
|
||||||
"load_img=tftp ${fit_addr_r} ${img_file}\0" \
|
"load_img=tftp ${fit_addr_r} ${img_file}\0" \
|
||||||
"net_nfs=run load_kernel; " \
|
"net_nfs=run load_kernel; " \
|
||||||
|
|
Loading…
Reference in New Issue