# HG changeset patch # User msalter # Date 1049470876 0 # Node ID a289defa82f03e0e5a1aba055738557e61c4116a # Parent 371979c5cc1ed017696ecc5bb97c80a4404dbeba go command enhancements diff --git a/packages/redboot/current/ChangeLog b/packages/redboot/current/ChangeLog --- a/packages/redboot/current/ChangeLog +++ b/packages/redboot/current/ChangeLog @@ -1,3 +1,9 @@ +2003-04-04 Mark Salter + + * src/main.c (do_go): Add -n switch to optionally stop network + device. Mask interrupts on all comm channels. + * doc/redboot_cmds.sgml: Update go command info. + 2003-04-03 Gary Thomas * src/load.c: Better handling of default download mode. Also diff --git a/packages/redboot/current/doc/redboot_cmds.sgml b/packages/redboot/current/doc/redboot_cmds.sgml --- a/packages/redboot/current/doc/redboot_cmds.sgml +++ b/packages/redboot/current/doc/redboot_cmds.sgml @@ -10,7 +10,7 @@ - + @@ -124,7 +124,7 @@ Manage flash images Manage configuration kept in FLASH memory fconfig [-i] [-l] [-n] [-f] [-d] | [-d] nickname [value] Execute code at a location - go [-w <timeout>] [entry] + go [-w <timeout>] [-c] [-n] [entry] Help about help? help [<topic>] Set/change IP addresses @@ -2705,6 +2705,8 @@ or a Linux kernel. go -w timeout + -c + -n start_address @@ -2732,6 +2734,18 @@ or a Linux kernel. 0 + -c + Boolean + Go with caches enabled. + caches off + + + -n + Boolean + Go with network interface stopped. + network enabled + + start_address Number Address in memory to begin execution. diff --git a/packages/redboot/current/src/main.c b/packages/redboot/current/src/main.c --- a/packages/redboot/current/src/main.c +++ b/packages/redboot/current/src/main.c @@ -61,6 +61,10 @@ #include #include CYGHWR_MEMORY_LAYOUT_H +#ifdef CYGPKG_IO_ETH_DRIVERS +#include // Logical driver interfaces +#endif + #include #ifdef CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS @@ -420,21 +424,25 @@ return_to_redboot(int status) void do_go(int argc, char *argv[]) { + int i, cur; unsigned long entry; unsigned long oldints; bool wait_time_set; int wait_time, res; bool cache_enabled = false; - struct option_info opts[2]; + bool stop_net = false; + struct option_info opts[3]; char line[8]; - hal_virtual_comm_table_t *__chan = CYGACC_CALL_IF_CONSOLE_PROCS(); + hal_virtual_comm_table_t *__chan; entry = entry_address; // Default from last 'load' operation init_opts(&opts[0], 'w', true, OPTION_ARG_TYPE_NUM, (void **)&wait_time, (bool *)&wait_time_set, "wait timeout"); init_opts(&opts[1], 'c', false, OPTION_ARG_TYPE_FLG, (void **)&cache_enabled, (bool *)0, "go with caches enabled"); - if (!scan_opts(argc, argv, 1, opts, 2, (void *)&entry, OPTION_ARG_TYPE_NUM, "starting address")) + init_opts(&opts[2], 'n', false, OPTION_ARG_TYPE_FLG, + (void **)&stop_net, (bool *)0, "go with network driver stopped"); + if (!scan_opts(argc, argv, 1, opts, 3, (void *)&entry, OPTION_ARG_TYPE_NUM, "starting address")) { return; } @@ -457,8 +465,24 @@ do_go(int argc, char *argv[]) script_timeout_ms -= CYGNUM_REDBOOT_CLI_IDLE_TIMEOUT; } } + + // Mask interrupts on all channels + cur = CYGACC_CALL_IF_SET_CONSOLE_COMM(CYGNUM_CALL_IF_SET_COMM_ID_QUERY_CURRENT); + for (i = 0; i < CYGNUM_HAL_VIRTUAL_VECTOR_NUM_CHANNELS; i++) { + CYGACC_CALL_IF_SET_CONSOLE_COMM(i); + __chan = CYGACC_CALL_IF_CONSOLE_PROCS(); + CYGACC_COMM_IF_CONTROL( *__chan, __COMMCTL_IRQ_DISABLE ); + } + CYGACC_CALL_IF_SET_CONSOLE_COMM(cur); + + __chan = CYGACC_CALL_IF_CONSOLE_PROCS(); CYGACC_COMM_IF_CONTROL(*__chan, __COMMCTL_ENABLE_LINE_FLUSH); +#ifdef CYGPKG_IO_ETH_DRIVERS + if (stop_net) + eth_drv_stop(); +#endif + HAL_DISABLE_INTERRUPTS(oldints); HAL_DCACHE_SYNC(); if (!cache_enabled) {