All of lore.kernel.org
 help / color / mirror / Atom feed
From: Olof Johansson <olof@lixom.net>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2] TI: OMAP3: Overo Tobi ethernet support
Date: Wed, 23 Sep 2009 09:55:56 -0500	[thread overview]
Message-ID: <20090923145556.GA28659@lixom.net> (raw)
In-Reply-To: <20090911204750.GA22246@lixom.net>

Add setup for ethernet on Tobi, allowing kernel/ramdisk to be loaded
over tftp.

Based on the omap3 evm code. I added a new highlevel define for Tobi
to avoid having it dependent on CMD_NET (which would seem backward in
this case).

Signed-off-by: Olof Johansson <olof@lixom.net>
---

This version of the patch fixes whitespace comments from WD, and includes
fixes for the build warnings that Dirk's patch also silenced.


 board/overo/overo.c           |   62 +++++++++++++++++++++++++++++++++++++++++
 board/overo/overo.h           |   37 ++++++++++++++++++++++++
 include/configs/omap3_overo.h |   23 ++++++++++++++-
 3 files changed, 120 insertions(+), 2 deletions(-)

diff --git a/board/overo/overo.c b/board/overo/overo.c
index dd6d286..7d87e52 100644
--- a/board/overo/overo.c
+++ b/board/overo/overo.c
@@ -29,13 +29,19 @@
  * MA 02111-1307 USA
  */
 #include <common.h>
+#include <netdev.h>
 #include <twl4030.h>
 #include <asm/io.h>
 #include <asm/arch/mux.h>
+#include <asm/arch/mem.h>
 #include <asm/arch/sys_proto.h>
 #include <asm/mach-types.h>
 #include "overo.h"
 
+#if defined(CONFIG_OMAP3_OVERO_TOBI)
+static void setup_net_chip(void);
+#endif
+
 /*
  * Routine: board_init
  * Description: Early hardware init.
@@ -62,6 +68,10 @@ int misc_init_r(void)
 	twl4030_power_init();
 	twl4030_led_init();
 
+#if defined(CONFIG_OMAP3_OVERO_TOBI)
+	setup_net_chip();
+#endif
+
 	dieid_num_r();
 
 	return 0;
@@ -76,4 +86,56 @@ int misc_init_r(void)
 void set_muxconf_regs(void)
 {
 	MUX_OVERO();
+#if defined(CONFIG_OMAP3_OVERO_TOBI)
+	MUX_OVERO_TOBI();
+#endif
+}
+
+#if defined(CONFIG_OMAP3_OVERO_TOBI)
+/*
+ * Routine: setup_net_chip
+ * Description: Setting up the configuration GPMC registers specific to the
+ *	      Ethernet hardware.
+ */
+static void setup_net_chip(void)
+{
+	struct gpio *gpio3_base = (struct gpio *)OMAP34XX_GPIO3_BASE;
+	struct ctrl *ctrl_base = (struct ctrl *)OMAP34XX_CTRL_BASE;
+
+	/* Configure GPMC registers */
+	writel(NET_GPMC_CONFIG1, &gpmc_cfg->cs[5].config1);
+	writel(NET_GPMC_CONFIG2, &gpmc_cfg->cs[5].config2);
+	writel(NET_GPMC_CONFIG3, &gpmc_cfg->cs[5].config3);
+	writel(NET_GPMC_CONFIG4, &gpmc_cfg->cs[5].config4);
+	writel(NET_GPMC_CONFIG5, &gpmc_cfg->cs[5].config5);
+	writel(NET_GPMC_CONFIG6, &gpmc_cfg->cs[5].config6);
+	writel(NET_GPMC_CONFIG7, &gpmc_cfg->cs[5].config7);
+
+	/* Enable off mode for NWE in PADCONF_GPMC_NWE register */
+	writew(readw(&ctrl_base ->gpmc_nwe) | 0x0E00, &ctrl_base->gpmc_nwe);
+	/* Enable off mode for NOE in PADCONF_GPMC_NADV_ALE register */
+	writew(readw(&ctrl_base->gpmc_noe) | 0x0E00, &ctrl_base->gpmc_noe);
+	/* Enable off mode for ALE in PADCONF_GPMC_NADV_ALE register */
+	writew(readw(&ctrl_base->gpmc_nadv_ale) | 0x0E00,
+		&ctrl_base->gpmc_nadv_ale);
+
+	/* Make GPIO 64 as output pin */
+	writel(readl(&gpio3_base->oe) & ~(GPIO0), &gpio3_base->oe);
+
+	/* Now send a pulse on the GPIO pin */
+	writel(GPIO0, &gpio3_base->setdataout);
+	udelay(1);
+	writel(GPIO0, &gpio3_base->cleardataout);
+	udelay(1);
+	writel(GPIO0, &gpio3_base->setdataout);
+}
+#endif
+
+int board_eth_init(bd_t *bis)
+{
+	int rc = 0;
+#ifdef CONFIG_SMC911X
+	rc = smc911x_initialize(0, CONFIG_SMC911X_BASE);
+#endif
+	return rc;
 }
diff --git a/board/overo/overo.h b/board/overo/overo.h
index d9fe74e..48d58f2 100644
--- a/board/overo/overo.h
+++ b/board/overo/overo.h
@@ -378,4 +378,41 @@ const omap3_sysinfo sysinfo = {
 	MUX_VAL(CP(SDRC_CKE0),		(IDIS | PTU | EN  | M0)) /*sdrc_cke0*/\
 	MUX_VAL(CP(SDRC_CKE1),		(IDIS | PTU | EN  | M0)) /*sdrc_cke1*/
 
+#if defined(CONFIG_OMAP3_OVERO_TOBI)
+#define MUX_OVERO_TOBI() \
+	MUX_VAL(CP(GPMC_A1),		(IDIS | PTU | EN  | M0)) /*GPMC_A1*/\
+	MUX_VAL(CP(GPMC_A2),		(IDIS | PTU | EN  | M0)) /*GPMC_A2*/\
+	MUX_VAL(CP(GPMC_A3),		(IDIS | PTU | EN  | M0)) /*GPMC_A3*/\
+	MUX_VAL(CP(GPMC_A4),		(IDIS | PTU | EN  | M0)) /*GPMC_A4*/\
+	MUX_VAL(CP(GPMC_A5),		(IDIS | PTU | EN  | M0)) /*GPMC_A5*/\
+	MUX_VAL(CP(GPMC_A6),		(IDIS | PTU | EN  | M0)) /*GPMC_A6*/\
+	MUX_VAL(CP(GPMC_A7),		(IDIS | PTU | EN  | M0)) /*GPMC_A7*/\
+	MUX_VAL(CP(GPMC_A8),		(IDIS | PTU | EN  | M0)) /*GPMC_A8*/\
+	MUX_VAL(CP(GPMC_A9),		(IDIS | PTU | EN  | M0)) /*GPMC_A9*/\
+	MUX_VAL(CP(GPMC_A10),		(IDIS | PTU | EN  | M0)) /*GPMC_A10*/\
+	MUX_VAL(CP(GPMC_D0),		(IEN  | PTU | EN  | M0)) /*GPMC_D0*/\
+	MUX_VAL(CP(GPMC_D1),		(IEN  | PTU | EN  | M0)) /*GPMC_D1*/\
+	MUX_VAL(CP(GPMC_D2),		(IEN  | PTU | EN  | M0)) /*GPMC_D2*/\
+	MUX_VAL(CP(GPMC_D3),		(IEN  | PTU | EN  | M0)) /*GPMC_D3*/\
+	MUX_VAL(CP(GPMC_D4),		(IEN  | PTU | EN  | M0)) /*GPMC_D4*/\
+	MUX_VAL(CP(GPMC_D5),		(IEN  | PTU | EN  | M0)) /*GPMC_D5*/\
+	MUX_VAL(CP(GPMC_D6),		(IEN  | PTU | EN  | M0)) /*GPMC_D6*/\
+	MUX_VAL(CP(GPMC_D7),		(IEN  | PTU | EN  | M0)) /*GPMC_D7*/\
+	MUX_VAL(CP(GPMC_D8),		(IEN  | PTU | EN  | M0)) /*GPMC_D8*/\
+	MUX_VAL(CP(GPMC_D9),		(IEN  | PTU | EN  | M0)) /*GPMC_D9*/\
+	MUX_VAL(CP(GPMC_D10),		(IEN  | PTU | EN  | M0)) /*GPMC_D10*/\
+	MUX_VAL(CP(GPMC_D11),		(IEN  | PTU | EN  | M0)) /*GPMC_D11*/\
+	MUX_VAL(CP(GPMC_D12),		(IEN  | PTU | EN  | M0)) /*GPMC_D12*/\
+	MUX_VAL(CP(GPMC_D13),		(IEN  | PTU | EN  | M0)) /*GPMC_D13*/\
+	MUX_VAL(CP(GPMC_D14),		(IEN  | PTU | EN  | M0)) /*GPMC_D14*/\
+	MUX_VAL(CP(GPMC_D15),		(IEN  | PTU | EN  | M0)) /*GPMC_D15*/\
+	MUX_VAL(CP(GPMC_NCS5),		(IDIS | PTU | EN  | M0)) /*GPMC_nCS5*/\
+	MUX_VAL(CP(GPMC_CLK),		(IDIS | PTU | EN  | M0)) /*GPMC_CLK*/\
+	MUX_VAL(CP(GPMC_WAIT2),		(IEN  | PTU | EN  | M4)) /*GPIO_64*/\
+								 /* - SMSC911X_NRES*/\
+	MUX_VAL(CP(MCSPI1_CS2),		(IEN  | PTU | DIS | M4)) /*GPIO_176 */\
+								 /* - LAN_INTR */
+
+#endif
+
 #endif
diff --git a/include/configs/omap3_overo.h b/include/configs/omap3_overo.h
index 07a031b..3faf756 100644
--- a/include/configs/omap3_overo.h
+++ b/include/configs/omap3_overo.h
@@ -28,7 +28,10 @@
 #define CONFIG_OMAP		1	/* in a TI OMAP core */
 #define CONFIG_OMAP34XX		1	/* which is a 34XX */
 #define CONFIG_OMAP3430		1	/* which is in a 3430 */
-#define CONFIG_OMAP3_OVERO		1	/* working with overo */
+#define CONFIG_OMAP3_OVERO	1	/* working with overo */
+
+/* Change the below line to define 1 if you want ethernet on Tobi */
+#undef CONFIG_OMAP3_OVERO_TOBI		/* overo mounted on tobi */
 
 #include <asm/arch/cpu.h>	/* get chip and board defs */
 #include <asm/arch/omap3.h>
@@ -105,9 +108,12 @@
 #undef CONFIG_CMD_FPGA		/* FPGA configuration Support	*/
 #undef CONFIG_CMD_IMI		/* iminfo			*/
 #undef CONFIG_CMD_IMLS		/* List all found images	*/
-#undef CONFIG_CMD_NET		/* bootp, tftpboot, rarpboot	*/
 #undef CONFIG_CMD_NFS		/* NFS support			*/
 
+#if !defined(CONFIG_OMAP3_OVERO_TOBI)
+#undef CONFIG_CMD_NET		/* bootp, tftpboot, rarpboot	*/
+#endif
+
 #define CONFIG_SYS_NO_FLASH
 #define CONFIG_SYS_I2C_SPEED		100000
 #define CONFIG_SYS_I2C_SLAVE		1
@@ -293,4 +299,17 @@ extern unsigned int boot_flash_sec;
 extern unsigned int boot_flash_type;
 #endif
 
+#if defined(CONFIG_OMAP3_OVERO_TOBI)
+/*----------------------------------------------------------------------------
+ * SMSC9115 Ethernet from SMSC9118 family
+ *----------------------------------------------------------------------------
+ */
+
+#define CONFIG_NET_MULTI
+#define CONFIG_SMC911X		1
+#define CONFIG_SMC911X_32_BIT
+#define CONFIG_SMC911X_BASE     0x2C000000
+
+#endif /* (CONFIG_CMD_NET) */
+
 #endif				/* __CONFIG_H */
-- 
1.6.0.4

  parent reply	other threads:[~2009-09-23 14:55 UTC|newest]

Thread overview: 74+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-11 20:47 [U-Boot] [PATCH] TI: OMAP3: Overo Tobi ethernet support Olof Johansson
2009-09-12  5:25 ` Dirk Behme
2009-09-12 15:16   ` Paulraj, Sandeep
2009-09-12 17:18     ` Olof Johansson
2009-09-12 17:33       ` Paulraj, Sandeep
2009-09-13 17:22         ` Ben Warren
2009-09-13 19:11           ` Paulraj, Sandeep
2009-09-22 19:51             ` Wolfgang Denk
2009-09-22 19:50           ` Wolfgang Denk
2009-09-22 20:12             ` Olof Johansson
2009-09-22 21:28               ` Wolfgang Denk
2009-09-22 21:33                 ` Olof Johansson
2009-09-22 21:42                   ` Wolfgang Denk
2009-09-22 19:48       ` Wolfgang Denk
2009-09-22 20:13         ` Olof Johansson
2009-09-22 21:32           ` Wolfgang Denk
2009-09-22 21:34             ` Olof Johansson
2009-09-22 21:45               ` Wolfgang Denk
2009-09-22 21:37             ` Jean-Christian de Rivaz
2009-09-22 21:47         ` Tom
2009-09-22 19:44     ` Wolfgang Denk
2009-09-13 19:41 ` Steve Sakoman
2009-09-22 19:41 ` Wolfgang Denk
2009-09-22 20:34   ` Olof Johansson
2009-09-22 21:34     ` Wolfgang Denk
2009-09-22 21:36       ` Olof Johansson
2009-09-22 21:49         ` Wolfgang Denk
2009-09-22 21:52           ` Olof Johansson
2009-09-23 14:55 ` Olof Johansson [this message]
2009-09-23 18:39   ` [U-Boot] [PATCH v2] " Tom
2009-09-23 18:43     ` Olof Johansson
2009-09-23 19:16       ` Wolfgang Denk
2009-09-23 20:29         ` Olof Johansson
2009-09-23 21:00           ` Tom
2009-09-23 23:35             ` Olof Johansson
2009-09-24  0:34       ` Nishanth Menon
2009-09-24  0:38         ` Olof Johansson
2009-09-24  1:03           ` Tom
2009-09-24  1:05           ` Nishanth Menon
2009-09-24 17:32   ` Tom
2009-09-24 17:42     ` Paulraj, Sandeep
2009-09-28  6:02       ` [U-Boot] Applying u-boot-ti patches (was: [PATCH v2] TI: OMAP3: Overo Tobi ethernet support) Dirk Behme
2009-09-28 11:29         ` Paulraj, Sandeep
2009-09-28 17:37           ` [U-Boot] Applying u-boot-ti patches Dirk Behme
2009-09-28 17:45             ` Paulraj, Sandeep
2009-09-24 17:48     ` [U-Boot] [PATCH v2] TI: OMAP3: Overo Tobi ethernet support Paulraj, Sandeep
2009-09-24 17:51       ` Dirk Behme
2009-09-24 17:55       ` Olof Johansson
2009-09-26  6:13   ` [U-Boot] smc911x runtime detection (was: TI: OMAP3: Overo Tobi ethernet support) Dirk Behme
2009-09-26 11:21     ` Mike Frysinger
2009-09-26 12:36     ` [U-Boot] smc911x runtime detection Tom
2009-09-26 15:53     ` [U-Boot] smc911x runtime detection (was: TI: OMAP3: Overo Tobi ethernet support) Olof Johansson
2009-09-26 16:02       ` Ben Warren
     [not found]         ` <5e088bd90909261213j1512c83erb9665bccc102fc42@mail.gmail.com>
2009-09-26 19:19           ` Ben Warren
2009-09-26 19:23             ` Mike Frysinger
2009-09-26 21:09         ` Olof Johansson
2009-09-27  8:38           ` [U-Boot] smc911x runtime detection Dirk Behme
2009-09-26 21:14   ` [U-Boot] [PATCH v3] TI: OMAP3: Overo Tobi ethernet support Olof Johansson
2009-09-28 18:51     ` Ben Warren
2009-09-28 19:32       ` Paulraj, Sandeep
2009-10-05 13:56     ` Steve Sakoman
2009-10-05 14:07       ` Olof Johansson
2009-10-06  0:52         ` Paulraj, Sandeep
2009-10-08  4:50         ` Dirk Behme
2009-10-08  4:56           ` Steve Sakoman
2009-10-08  5:05             ` Dirk Behme
2009-10-08  6:59               ` Olof Johansson
2009-10-08 14:42                 ` Paulraj, Sandeep
2009-10-08 17:08                   ` Ben Warren
2009-10-08 17:19                     ` Paulraj, Sandeep
2009-10-08 19:21                     ` Olof Johansson
2009-10-10 16:42                       ` Paulraj, Sandeep
2009-10-10 17:58                         ` Dirk Behme
2009-10-10 18:24                           ` Paulraj, Sandeep

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=20090923145556.GA28659@lixom.net \
    --to=olof@lixom.net \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.