public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/7] powerpc/mpc8xxx: Enable entering DDR debugging by key press
@ 2013-01-04 18:13 York Sun
  2013-01-04 18:14 ` [U-Boot] [PATCH 2/7] Move DDR command parsing to separate function York Sun
                   ` (6 more replies)
  0 siblings, 7 replies; 14+ messages in thread
From: York Sun @ 2013-01-04 18:13 UTC (permalink / raw)
  To: u-boot

Using environmental variable "ddr_interactive" to activate interactive DDR
debugging seomtiems is not enough. For example, after updating SPD with a
valid but wrong image, u-boot won't come up due to wrong DDR configuration.
By enabling key press method, we can enter debug mode to have a chance to
boot without using other tools to recover the board.

CONFIG_FSL_DDR_INTERACTIVE needs to be defined in header file. To enter the
debug mode by key press, press key 'd' shortly after reset, like one would
do to abort auto booting. It is fixed to lower case 'd' at this moment.

Signed-off-by: York Sun <yorksun@freescale.com>
---
 arch/powerpc/cpu/mpc8xxx/ddr/main.c |    6 ++++--
 doc/README.fsl-ddr                  |    7 +++++++
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/cpu/mpc8xxx/ddr/main.c b/arch/powerpc/cpu/mpc8xxx/ddr/main.c
index d6b73c7..a33c9e2 100644
--- a/arch/powerpc/cpu/mpc8xxx/ddr/main.c
+++ b/arch/powerpc/cpu/mpc8xxx/ddr/main.c
@@ -532,9 +532,11 @@ phys_size_t fsl_ddr_sdram(void)
 
 	/* Compute it once normally. */
 #ifdef CONFIG_FSL_DDR_INTERACTIVE
-	if (getenv("ddr_interactive"))
+	if (getenv("ddr_interactive")) {
 		total_memory = fsl_ddr_interactive(&info);
-	else
+	} else if (tstc() && (getc() == 'd')) {	/* we got a key press of 'd' */
+		total_memory = fsl_ddr_interactive(&info);
+	} else
 #endif
 		total_memory = fsl_ddr_compute(&info, STEP_GET_SPD, 0);
 
diff --git a/doc/README.fsl-ddr b/doc/README.fsl-ddr
index 3992640..59583b3 100644
--- a/doc/README.fsl-ddr
+++ b/doc/README.fsl-ddr
@@ -268,6 +268,13 @@ be activated by saving an environment variable "ddr_interactive". The value
 doesn't matter. Once activated, U-boot prompts "FSL DDR>" before enabling DDR
 controller. The available commands can be seen by typing "help".
 
+Another way to enter debug mode without using environment variable is to send
+a key press during boot, like one would do to abort auto boot. To save booting
+time, no additioal delay is added so the window to send the key press is very
+short. For example, user can send the key press using reset command followed by
+hitting enter key twice. In case of power on reset, user can keep hitting any
+key while applying the power.
+
 The example flow of using interactive debugging is
 type command "compute" to calculate the parameters from the default
 type command "print" with arguments to show SPD, options, registers
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2013-01-08 19:24 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-04 18:13 [U-Boot] [PATCH 1/7] powerpc/mpc8xxx: Enable entering DDR debugging by key press York Sun
2013-01-04 18:14 ` [U-Boot] [PATCH 2/7] Move DDR command parsing to separate function York Sun
2013-01-04 18:14 ` [U-Boot] [PATCH 3/7] Fix data stage name matching issue York Sun
2013-01-04 18:14 ` [U-Boot] [PATCH 4/7] Add copy command to FSL DDR interactive York Sun
2013-01-04 18:14 ` [U-Boot] [PATCH 5/7] README.fsl-ddr typos and update to reflect hotkey York Sun
2013-01-04 18:14 ` [U-Boot] [PATCH 6/7] getenv_f() env variable exist w/o needing a buffer York Sun
2013-01-04 22:06   ` Wolfgang Denk
2013-01-04 23:08     ` James Yang
2013-01-05  6:23       ` Wolfgang Denk
2013-01-07 17:46   ` [U-Boot] [u-boot-release] " Timur Tabi
2013-01-04 18:14 ` [U-Boot] [PATCH 7/7] powerpc/mpc8xxx: FSL DDR debugger auto run of stored commands York Sun
2013-01-08  6:35 ` [U-Boot] [PATCH 1/7] powerpc/mpc8xxx: Enable entering DDR debugging by key press Wolfgang Denk
2013-01-08  6:39   ` sun york-R58495
2013-01-08 19:24   ` York Sun

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox