public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Marek Vasut <marex@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 02/13] M28EVK: Implement support for new board V2.0
Date: Tue,  1 May 2012 23:03:41 +0200	[thread overview]
Message-ID: <1335906232-24549-3-git-send-email-marex@denx.de> (raw)
In-Reply-To: <1335906232-24549-1-git-send-email-marex@denx.de>

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Detlev Zundel <dzu@denx.de>
Cc: Fabio Estevam <fabio.estevam@freescale.com>
Cc: Stefano Babic <sbabic@denxde>
Cc: Wolfgang Denk <wd@denx.de>
---
 board/denx/m28evk/m28evk.c   |   20 +++++++++++++++++++-
 board/denx/m28evk/spl_boot.c |    8 ++++++--
 2 files changed, 25 insertions(+), 3 deletions(-)

diff --git a/board/denx/m28evk/m28evk.c b/board/denx/m28evk/m28evk.c
index 53df476..3d28ea8 100644
--- a/board/denx/m28evk/m28evk.c
+++ b/board/denx/m28evk/m28evk.c
@@ -90,6 +90,8 @@ int board_mmc_init(bd_t *bis)
 {
 	/* Configure WP as input. */
 	gpio_direction_input(MX28_PAD_AUART2_CTS__GPIO_3_10);
+	/* Turn on the power to the card. */
+	gpio_direction_output(MX28_PAD_PWM3__GPIO_3_28, 0);
 
 	return mxsmmc_initialize(bis, 0, m28_mmc_wp);
 }
@@ -103,10 +105,18 @@ int board_mmc_init(bd_t *bis)
 
 int fecmxc_mii_postcall(int phy)
 {
+#if	defined(CONFIG_DENX_M28_V11) || defined(CONFIG_DENX_M28_V10)
+	/* KZ8031 PHY on old boards. */
+	const uint32_t freq = 0x0080;
+#else
+	/* KZ8021 PHY on new boards. */
+	const uint32_t freq = 0x0000;
+#endif
+
 	miiphy_write("FEC1", phy, MII_BMCR, 0x9000);
 	miiphy_write("FEC1", phy, MII_OPMODE_STRAP_OVERRIDE, 0x0202);
 	if (phy == 3)
-		miiphy_write("FEC1", 3, MII_PHY_CTRL2, 0x8180);
+		miiphy_write("FEC1", 3, MII_PHY_CTRL2, 0x8100 | freq);
 	return 0;
 }
 
@@ -123,6 +133,14 @@ int board_eth_init(bd_t *bis)
 		CLKCTRL_ENET_TIME_SEL_MASK | CLKCTRL_ENET_CLK_OUT_EN,
 		CLKCTRL_ENET_TIME_SEL_RMII_CLK);
 
+#if !defined(CONFIG_DENX_M28_V11) && !defined(CONFIG_DENX_M28_V10)
+	/* Reset the new PHY */
+	gpio_direction_output(MX28_PAD_AUART2_RTS__GPIO_3_11, 0);
+	udelay(10000);
+	gpio_set_value(MX28_PAD_AUART2_RTS__GPIO_3_11, 1);
+	udelay(10000);
+#endif
+
 	ret = fecmxc_initialize_multi(bis, 0, 0, MXS_ENET0_BASE);
 	if (ret) {
 		printf("FEC MXS: Unable to init FEC0\n");
diff --git a/board/denx/m28evk/spl_boot.c b/board/denx/m28evk/spl_boot.c
index a04fe18..7a12592 100644
--- a/board/denx/m28evk/spl_boot.c
+++ b/board/denx/m28evk/spl_boot.c
@@ -109,8 +109,9 @@ const iomux_cfg_t iomux_setup[] = {
 		(MXS_PAD_3V3 | MXS_PAD_12MA | MXS_PAD_NOPULL),
 	MX28_PAD_SSP0_SCK__SSP0_SCK |
 		(MXS_PAD_3V3 | MXS_PAD_12MA | MXS_PAD_NOPULL),
-	MX28_PAD_PWM3__GPIO_3_28 | MUX_CONFIG_SSP0,	/* Power .. FIXME */
-	MX28_PAD_AUART2_CTS__GPIO_3_10,	/* WP ... FIXME */
+	MX28_PAD_PWM3__GPIO_3_28 | MUX_CONFIG_SSP0 |
+		(MXS_PAD_3V3 | MXS_PAD_12MA | MXS_PAD_NOPULL),	/* Power */
+	MX28_PAD_AUART2_CTS__GPIO_3_10,	/* WP */
 
 	/* GPMI NAND */
 	MX28_PAD_GPMI_D00__GPMI_D0 | MUX_CONFIG_GPMI,
@@ -147,6 +148,9 @@ const iomux_cfg_t iomux_setup[] = {
 	MX28_PAD_ENET0_RXD3__ENET1_RXD1 | MUX_CONFIG_ENET,
 	MX28_PAD_ENET0_TXD2__ENET1_TXD0 | MUX_CONFIG_ENET,
 	MX28_PAD_ENET0_TXD3__ENET1_TXD1 | MUX_CONFIG_ENET,
+#if !defined(CONFIG_DENX_M28_V11) && !defined(CONFIG_DENX_M28_V10)
+	MX28_PAD_AUART2_RTS__GPIO_3_11,	/* PHY reset */
+#endif
 
 	/* I2C */
 	MX28_PAD_I2C0_SCL__I2C0_SCL,
-- 
1.7.10

  parent reply	other threads:[~2012-05-01 21:03 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-01 21:03 [U-Boot] [PATCH 00/13] M28EVK/i.MX28 improvements Marek Vasut
2012-05-01 21:03 ` [U-Boot] [PATCH 01/13] FEC: Abstract out register setup Marek Vasut
2012-05-01 21:03 ` Marek Vasut [this message]
2012-05-01 21:03 ` [U-Boot] [PATCH 03/13] M28EVK: Add SD update command Marek Vasut
2012-05-01 21:03 ` [U-Boot] [PATCH 04/13] i.MX28: Improve passing of data from SPL to U-Boot Marek Vasut
2012-05-01 21:03 ` [U-Boot] [PATCH 05/13] i.MX28: Implement boot pads sampling and reporting Marek Vasut
2012-05-01 21:03 ` [U-Boot] [PATCH 06/13] i.MX28: Add LCDIF register definitions Marek Vasut
2012-05-01 21:03 ` [U-Boot] [PATCH 07/13] i.MX28: Shut down the LCD controller before reset Marek Vasut
2012-05-01 21:03 ` [U-Boot] [PATCH 08/13] i.MX28: Add LRADC register definitions Marek Vasut
2012-05-01 21:03 ` [U-Boot] [PATCH 09/13] i.MX28: Add LRADC init to i.MX28 SPL Marek Vasut
2012-05-01 21:03 ` [U-Boot] [PATCH 10/13] i.MX28: Reorder battery status functions in SPL Marek Vasut
2012-05-01 21:03 ` [U-Boot] [PATCH 11/13] i.MX28: Add battery boot components to SPL Marek Vasut
2012-05-01 21:03 ` [U-Boot] [PATCH 12/13] i.MX28: Check if WP detection is implemented at all Marek Vasut
2012-05-01 21:03 ` [U-Boot] [PATCH 13/13] i.MX28: Avoid redefining serial_put[cs]() Marek Vasut
2012-05-01 21:05 ` [U-Boot] [PATCH 00/13] M28EVK/i.MX28 improvements Marek Vasut
  -- strict thread matches above, loose matches on Subject: below --
2012-05-01 21:09 Marek Vasut
2012-05-01 21:09 ` [U-Boot] [PATCH 02/13] M28EVK: Implement support for new board V2.0 Marek Vasut
2012-05-09 10:22   ` Stefano Babic
2012-05-09 10:31     ` Marek Vasut

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=1335906232-24549-3-git-send-email-marex@denx.de \
    --to=marex@denx.de \
    --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