Skip to content
Snippets Groups Projects
Commit a4d2636f authored by Wolfgang Denk's avatar Wolfgang Denk
Browse files

Adapt board configuration and fix kernel crash on MCC200 board.


The update procedure was modified to turn off the USB subsystem
before exit for MCC200 and TRAB. This is necessary as otherwise the
USB controller continues to write periodically to system memory!

MCC200-specific notes:
- the patch disables the magic key check for MCC200
- the patch contains the configuration changes made
  for the new revision of the board.

Signed-off-by: default avatarSergei Poselenov <sposelenov@emcraft.com>
Signed-off-by: default avatarWolfgang Denk <wd@denx.de>
parent 308e2b3a
Branches
Tags
No related merge requests found
...@@ -330,6 +330,8 @@ int do_auto_update(void) ...@@ -330,6 +330,8 @@ int do_auto_update(void)
int i, res = 0, bitmap_first, cnt, old_ctrlc, got_ctrlc; int i, res = 0, bitmap_first, cnt, old_ctrlc, got_ctrlc;
char *env; char *env;
long start, end; long start, end;
#if 0 /* disable key-press detection to speed up boot-up time */
uchar keypad_status1[2] = {0,0}, keypad_status2[2] = {0,0}; uchar keypad_status1[2] = {0,0}, keypad_status2[2] = {0,0};
/* /*
...@@ -347,6 +349,7 @@ int do_auto_update(void) ...@@ -347,6 +349,7 @@ int do_auto_update(void)
return 0; return 0;
} }
#endif
au_usb_stor_curr_dev = -1; au_usb_stor_curr_dev = -1;
/* start USB */ /* start USB */
if (usb_stop() < 0) { if (usb_stop() < 0) {
...@@ -364,18 +367,21 @@ int do_auto_update(void) ...@@ -364,18 +367,21 @@ int do_auto_update(void)
au_usb_stor_curr_dev = usb_stor_scan(0); au_usb_stor_curr_dev = usb_stor_scan(0);
if (au_usb_stor_curr_dev == -1) { if (au_usb_stor_curr_dev == -1) {
debug ("No device found. Not initialized?\n"); debug ("No device found. Not initialized?\n");
return -1; res = -1;
goto xit;
} }
/* check whether it has a partition table */ /* check whether it has a partition table */
stor_dev = get_dev("usb", 0); stor_dev = get_dev("usb", 0);
if (stor_dev == NULL) { if (stor_dev == NULL) {
debug ("uknown device type\n"); debug ("uknown device type\n");
return -1; res = -1;
goto xit;
} }
if (fat_register_device(stor_dev, 1) != 0) { if (fat_register_device(stor_dev, 1) != 0) {
debug ("Unable to use USB %d:%d for fatls\n", debug ("Unable to use USB %d:%d for fatls\n",
au_usb_stor_curr_dev, 1); au_usb_stor_curr_dev, 1);
return -1; res = -1;
goto xit;
} }
if (file_fat_detectfs() != 0) { if (file_fat_detectfs() != 0) {
debug ("file_fat_detectfs failed\n"); debug ("file_fat_detectfs failed\n");
...@@ -504,7 +510,7 @@ int do_auto_update(void) ...@@ -504,7 +510,7 @@ int do_auto_update(void)
} while (res < 0); } while (res < 0);
#endif #endif
} }
usb_stop();
/* restore the old state */ /* restore the old state */
disable_ctrlc(old_ctrlc); disable_ctrlc(old_ctrlc);
#ifdef CONFIG_PROGRESSBAR #ifdef CONFIG_PROGRESSBAR
...@@ -517,6 +523,8 @@ int do_auto_update(void) ...@@ -517,6 +523,8 @@ int do_auto_update(void)
lcd_enable(); lcd_enable();
} }
#endif #endif
return 0; xit:
usb_stop();
return res;
} }
#endif /* CONFIG_AUTO_UPDATE */ #endif /* CONFIG_AUTO_UPDATE */
...@@ -450,7 +450,7 @@ do_auto_update(void) ...@@ -450,7 +450,7 @@ do_auto_update(void)
{ {
block_dev_desc_t *stor_dev; block_dev_desc_t *stor_dev;
long sz; long sz;
int i, res, bitmap_first, cnt, old_ctrlc, got_ctrlc; int i, res = 0, bitmap_first, cnt, old_ctrlc, got_ctrlc;
char *env; char *env;
long start, end; long start, end;
...@@ -477,18 +477,21 @@ do_auto_update(void) ...@@ -477,18 +477,21 @@ do_auto_update(void)
au_usb_stor_curr_dev = usb_stor_scan(0); au_usb_stor_curr_dev = usb_stor_scan(0);
if (au_usb_stor_curr_dev == -1) { if (au_usb_stor_curr_dev == -1) {
debug ("No device found. Not initialized?\n"); debug ("No device found. Not initialized?\n");
return -1; res = -1;
goto xit;
} }
/* check whether it has a partition table */ /* check whether it has a partition table */
stor_dev = get_dev("usb", 0); stor_dev = get_dev("usb", 0);
if (stor_dev == NULL) { if (stor_dev == NULL) {
debug ("uknown device type\n"); debug ("uknown device type\n");
return -1; res = -1;
goto xit;
} }
if (fat_register_device(stor_dev, 1) != 0) { if (fat_register_device(stor_dev, 1) != 0) {
debug ("Unable to use USB %d:%d for fatls\n", debug ("Unable to use USB %d:%d for fatls\n",
au_usb_stor_curr_dev, 1); au_usb_stor_curr_dev, 1);
return -1; res = -1;
goto xit;
} }
if (file_fat_detectfs() != 0) { if (file_fat_detectfs() != 0) {
debug ("file_fat_detectfs failed\n"); debug ("file_fat_detectfs failed\n");
...@@ -648,9 +651,10 @@ do_auto_update(void) ...@@ -648,9 +651,10 @@ do_auto_update(void)
/* enable the power switch */ /* enable the power switch */
*CPLD_VFD_BK &= ~POWER_OFF; *CPLD_VFD_BK &= ~POWER_OFF;
} }
usb_stop();
/* restore the old state */ /* restore the old state */
disable_ctrlc(old_ctrlc); disable_ctrlc(old_ctrlc);
return 0; xit:
usb_stop();
return res;
} }
#endif /* CONFIG_AUTO_UPDATE */ #endif /* CONFIG_AUTO_UPDATE */
...@@ -111,11 +111,13 @@ ...@@ -111,11 +111,13 @@
#define CONFIG_CMD_I2C #define CONFIG_CMD_I2C
#define CONFIG_CMD_USB #define CONFIG_CMD_USB
#undef CONFIG_CMD_NET
/* /*
* Autobooting * Autobooting
*/ */
#define CONFIG_BOOTDELAY 5 /* autoboot after 5 seconds */ #define CONFIG_BOOTDELAY 1 /* autoboot after 1 second */
#define CONFIG_PREBOOT "echo;" \ #define CONFIG_PREBOOT "echo;" \
"echo Type \"run flash_nfs\" to mount root filesystem over NFS;" \ "echo Type \"run flash_nfs\" to mount root filesystem over NFS;" \
...@@ -131,20 +133,30 @@ ...@@ -131,20 +133,30 @@
# define CFG__LINUX_CONSOLE "ttyS0" # define CFG__LINUX_CONSOLE "ttyS0"
#else #else
# define CFG__BOARDNAME "mcc200" # define CFG__BOARDNAME "mcc200"
# define CFG__LINUX_CONSOLE "ttyEU7" # define CFG__LINUX_CONSOLE "ttyEU5"
#endif #endif
/* Network */
#define CONFIG_ETHADDR 00:17:17:ff:00:00
#define CONFIG_IPADDR 10.76.9.29
#define CONFIG_SERVERIP 10.76.9.1
#include <version.h> /* For U-Boot version */
#define CONFIG_EXTRA_ENV_SETTINGS \ #define CONFIG_EXTRA_ENV_SETTINGS \
"ubootver=" U_BOOT_VERSION "\0" \
"netdev=eth0\0" \ "netdev=eth0\0" \
"hostname=" CFG__BOARDNAME "\0" \ "hostname=" CFG__BOARDNAME "\0" \
"nfsargs=setenv bootargs root=/dev/nfs rw " \ "nfsargs=setenv bootargs root=/dev/nfs rw " \
"nfsroot=${serverip}:${rootpath}\0" \ "nfsroot=${serverip}:${rootpath}\0" \
"ramargs=setenv bootargs root=/dev/ram rw\0" \ "ramargs=setenv bootargs root=/dev/mtdblock2 " \
"rootfstype=cramfs\0" \
"addip=setenv bootargs ${bootargs} " \ "addip=setenv bootargs ${bootargs} " \
"ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}" \ "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}" \
":${hostname}:${netdev}:off panic=1\0" \ ":${hostname}:${netdev}:off panic=1\0" \
"addcons=setenv bootargs ${bootargs} " \ "addcons=setenv bootargs ${bootargs} " \
"console=${console},${baudrate}\0" \ "console=${console},${baudrate} " \
"ubootver=${ubootver} board=${board}\0" \
"flash_nfs=run nfsargs addip addcons;" \ "flash_nfs=run nfsargs addip addcons;" \
"bootm ${kernel_addr}\0" \ "bootm ${kernel_addr}\0" \
"flash_self=run ramargs addip addcons;" \ "flash_self=run ramargs addip addcons;" \
...@@ -156,6 +168,7 @@ ...@@ -156,6 +168,7 @@
"bootfile=/tftpboot/" CFG__BOARDNAME "/uImage\0" \ "bootfile=/tftpboot/" CFG__BOARDNAME "/uImage\0" \
"load=tftp 200000 /tftpboot/" CFG__BOARDNAME "/u-boot.bin\0" \ "load=tftp 200000 /tftpboot/" CFG__BOARDNAME "/u-boot.bin\0" \
"text_base=" MK_STR(TEXT_BASE) "\0" \ "text_base=" MK_STR(TEXT_BASE) "\0" \
"kernel_addr=0xFC0C0000\0" \
"update=protect off ${text_base} +${filesize};" \ "update=protect off ${text_base} +${filesize};" \
"era ${text_base} +${filesize};" \ "era ${text_base} +${filesize};" \
"cp.b 200000 ${text_base} ${filesize}\0" \ "cp.b 200000 ${text_base} ${filesize}\0" \
...@@ -256,7 +269,7 @@ ...@@ -256,7 +269,7 @@
/* /*
* Ethernet configuration * Ethernet configuration
*/ */
#define CONFIG_MPC5xxx_FEC 1 /*#define CONFIG_MPC5xxx_FEC 1*/
/* /*
* Define CONFIG_FEC_10MBIT to force FEC at 10Mb * Define CONFIG_FEC_10MBIT to force FEC at 10Mb
*/ */
...@@ -337,6 +350,13 @@ ...@@ -337,6 +350,13 @@
#define CFG_CS1_SIZE 0x00001000 #define CFG_CS1_SIZE 0x00001000
#define CFG_CS1_CFG 0x1d300 #define CFG_CS1_CFG 0x1d300
/* Leica - build revision resistors */
/*
#define CFG_CS3_START 0x80020000
#define CFG_CS3_SIZE 0x00000004
#define CFG_CS3_CFG 0x1d300
*/
/* /*
* Select one of quarts as a default * Select one of quarts as a default
* console. If undefined - PSC console * console. If undefined - PSC console
...@@ -392,4 +412,8 @@ ...@@ -392,4 +412,8 @@
#define CONFIG_USB_CLOCK 0x0001BBBB #define CONFIG_USB_CLOCK 0x0001BBBB
#define CONFIG_USB_CONFIG 0x00005000 #define CONFIG_USB_CONFIG 0x00005000
#define CONFIG_AUTOBOOT_KEYED /* use key strings to stop autoboot */
#define CONFIG_AUTOBOOT_STOP_STR "432"
#define CONFIG_SILENT_CONSOLE 1
#endif /* __CONFIG_H */ #endif /* __CONFIG_H */
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment