From: Jason Jin <Jason.jin@freescale.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 4/4] Do not init SATA when disabled on 8536DS.
Date: Fri, 10 Oct 2008 11:41:01 +0800 [thread overview]
Message-ID: <1223610061-5348-4-git-send-email-Jason.jin@freescale.com> (raw)
In-Reply-To: <1223610061-5348-3-git-send-email-Jason.jin@freescale.com>
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>
---
board/freescale/mpc8536ds/mpc8536ds.c | 12 ++++++++++++
lib_ppc/board.c | 16 ++++++++++++++--
2 files changed, 26 insertions(+), 2 deletions(-)
diff --git a/board/freescale/mpc8536ds/mpc8536ds.c b/board/freescale/mpc8536ds/mpc8536ds.c
index 3401133..37d4b61 100644
--- a/board/freescale/mpc8536ds/mpc8536ds.c
+++ b/board/freescale/mpc8536ds/mpc8536ds.c
@@ -651,6 +651,18 @@ int board_eth_init(bd_t *bis)
return pci_eth_init(bis);
}
+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)
diff --git a/lib_ppc/board.c b/lib_ppc/board.c
index c02ac62..564faf2 100644
--- a/lib_ppc/board.c
+++ b/lib_ppc/board.c
@@ -635,6 +635,16 @@ void board_init_f (ulong bootflag)
/* 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
@@ -1105,8 +1115,10 @@ void board_init_r (gd_t *id, ulong dest_addr)
#endif
#if defined(CONFIG_CMD_SATA)
- puts ("SATA: ");
- sata_initialize ();
+ if (is_sata_supported()) {
+ puts("SATA: ");
+ sata_initialize();
+ }
#endif
#ifdef CONFIG_LAST_STAGE_INIT
--
1.5.4
next prev parent reply other threads:[~2008-10-10 3:41 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-10 3:40 [U-Boot] [PATCH 1/4] Make pixis_set_sgmii more general to support MPC85xx boards Jason Jin
2008-10-10 3:40 ` [U-Boot] [PATCH 2/4] Enabled the Freescale SGMII riser card on 8572DS Jason Jin
2008-10-10 3:41 ` [U-Boot] [PATCH 3/4] Enabled the Freescale SGMII riser card on 8536DS Jason Jin
2008-10-10 3:41 ` Jason Jin [this message]
2008-10-14 1:49 ` [U-Boot] [PATCH 4/4] Do not init SATA when disabled " Kumar Gala
2008-10-14 1:52 ` Andy Fleming
2008-10-14 14:06 ` Wolfgang Denk
2008-10-14 14:07 ` Wolfgang Denk
2008-10-14 16:01 ` Wolfgang Denk
2008-10-13 23:11 ` [U-Boot] [PATCH 3/4] Enabled the Freescale SGMII riser card " Andy Fleming
2008-10-13 22:59 ` [U-Boot] [PATCH 2/4] Enabled the Freescale SGMII riser card on 8572DS Andy Fleming
2008-10-13 22:47 ` [U-Boot] [PATCH 1/4] Make pixis_set_sgmii more general to support MPC85xx boards Andy Fleming
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1223610061-5348-4-git-send-email-Jason.jin@freescale.com \
--to=jason.jin@freescale.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox