summaryrefslogtreecommitdiff
path: root/arch/powerpc
diff options
context:
space:
mode:
authorYork Sun <yorksun@freescale.com>2013-01-04 08:13:59 +0000
committerAndy Fleming <afleming@freescale.com>2013-01-30 11:25:12 -0600
commite750cfaa01f195be3f3bf16d7f1be7b99b587351 (patch)
tree661c0094c6aa2668b3f0030facabad59c9f5883f /arch/powerpc
parentb38181fa833b123144752eca554888d8da7e27cf (diff)
downloadu-boot-imx-e750cfaa01f195be3f3bf16d7f1be7b99b587351.zip
u-boot-imx-e750cfaa01f195be3f3bf16d7f1be7b99b587351.tar.gz
u-boot-imx-e750cfaa01f195be3f3bf16d7f1be7b99b587351.tar.bz2
powerpc/mpc8xxx: Enable entering DDR debugging by key press
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> Signed-off-by: Andy Fleming <afleming@freescale.com>
Diffstat (limited to 'arch/powerpc')
-rw-r--r--arch/powerpc/cpu/mpc8xxx/ddr/main.c6
1 files changed, 4 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);