]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
Do not init SATA when disabled on 8536DS.
authorJason Jin <Jason.jin@freescale.com>
Fri, 10 Oct 2008 03:41:01 +0000 (11:41 +0800)
committerWolfgang Denk <wd@denx.de>
Tue, 14 Oct 2008 15:57:27 +0000 (17:57 +0200)
SGMII and SATA share the serdes on MPC8536 CPU, When SATA disabled and the
driver still try to access the SATA registers, the cpu will hangup.
This patch try to fix this by reading the serdes status before the SATA
initialize.

Signed-off-by: Jason Jin <Jason.jin@freescale.com>
Acked-by: Andy Fleming <afleming@freescale.com>
board/freescale/mpc8536ds/mpc8536ds.c
lib_ppc/board.c

index 8216c70cae24defdb21dfc874c398cd09eb46976..3cf12fda5651accec061495e07e1e4f32c92e0ec 100644 (file)
@@ -608,6 +608,18 @@ get_board_ddr_clk(ulong dummy)
 }
 #endif
 
 }
 #endif
 
+int is_sata_supported()
+{
+       volatile ccsr_gur_t *gur = (void *)(CFG_MPC85xx_GUTS_ADDR);
+       uint devdisr = gur->devdisr;
+       uint sdrs2_io_sel =
+               (gur->pordevsr & MPC85xx_PORDEVSR_SRDS2_IO_SEL) >> 27;
+       if (sdrs2_io_sel & 0x04)
+               return 0;
+
+       return 1;
+}
+
 #if defined(CONFIG_OF_BOARD_SETUP)
 void
 ft_board_setup(void *blob, bd_t *bd)
 #if defined(CONFIG_OF_BOARD_SETUP)
 void
 ft_board_setup(void *blob, bd_t *bd)
index c02ac62b37ecc33e2fe99456a7fb0dd46fbb8552..564faf2c651b1a93ad41a99746572f63e9c90456 100644 (file)
@@ -635,6 +635,16 @@ void board_init_f (ulong bootflag)
        /* NOTREACHED - relocate_code() does not return */
 }
 
        /* NOTREACHED - relocate_code() does not return */
 }
 
+int __is_sata_supported()
+{
+       /* For some boards, when sata disabled by the switch, and the
+        * driver still access the sata registers, the cpu will hangup.
+        * please define platform specific is_sata_supported() if your
+        * board have such issue.*/
+       return 1;
+}
+int is_sata_supported() __attribute__((weak, alias("__is_sata_supported")));
+
 /************************************************************************
  *
  * This is the next part if the initialization sequence: we are now
 /************************************************************************
  *
  * This is the next part if the initialization sequence: we are now
@@ -1105,8 +1115,10 @@ void board_init_r (gd_t *id, ulong dest_addr)
 #endif
 
 #if defined(CONFIG_CMD_SATA)
 #endif
 
 #if defined(CONFIG_CMD_SATA)
-       puts ("SATA:  ");
-       sata_initialize ();
+       if (is_sata_supported()) {
+               puts("SATA:  ");
+               sata_initialize();
+       }
 #endif
 
 #ifdef CONFIG_LAST_STAGE_INIT
 #endif
 
 #ifdef CONFIG_LAST_STAGE_INIT