All of lore.kernel.org
 help / color / mirror / Atom feed
From: Naveen Krishna Ch <ch.naveen@samsung.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 3/3] SAMSUNG: SMDKC100: Adds ethernet support.
Date: Tue,  9 Feb 2010 18:38:22 +0900	[thread overview]
Message-ID: <1265708302-15743-1-git-send-email-ch.naveen@samsung.com> (raw)
In-Reply-To: <1265707341-25956-1-git-send-email-ch.naveen@samsung.com>

From: Naveen Krishna CH <ch.naveen@samsung.com>

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

The preinit function will configure GPIO (GPK0CON) & SROMC to look
for environment in SROM Bank 3.

Signed-off-by: Naveen Krishna Ch <ch.naveen <at> samsung.com>
---
 board/samsung/smdkc100/smdkc100.c |   37 +++++++++++++++++++++++++++++++++++++
 include/configs/smdkc100.h        |   30 +++++++++++++++++++++++++++++-
 2 files changed, 66 insertions(+), 1 deletions(-)

diff --git a/board/samsung/smdkc100/smdkc100.c b/board/samsung/smdkc100/smdkc100.c
index 15a1a27..6e50f14 100644
--- a/board/samsung/smdkc100/smdkc100.c
+++ b/board/samsung/smdkc100/smdkc100.c
@@ -23,10 +23,38 @@
  */
 
 #include <common.h>
+#include <asm/io.h>
+#include <asm/arch/mem.h>
+
+#define GPK0CON_OFFSET          0x2A0
+#define GPK0CON                 (S5PC100_GPIO_BASE + GPK0CON_OFFSET)
+
 DECLARE_GLOBAL_DATA_PTR;
 
+/*
+ * Miscellaneous platform dependent initialisations
+ */
+static void smc9115_pre_init(void)
+{
+	u32 tmp;
+	u32 smc_bw_conf;
+
+	/* gpio configuration */
+	tmp = __raw_readl(GPK0CON);
+	tmp &= ~(0xf << CONFIG_ENV_SROM_BANK * 4);
+	tmp |=  (0x2 << CONFIG_ENV_SROM_BANK * 4);
+	__raw_writel(tmp, GPK0CON);
+
+	/* Ethernet needs bus width of 16 bits */
+	smc_bw_conf = SROM_DATA16_WIDTH(CONFIG_ENV_SROM_BANK);
+
+	/* Select and configure the SROMC bank */
+	config_sromc(CONFIG_ENV_SROM_BANK, smc_bw_conf, SMC_BC_X_CON);
+}
+
 int board_init(void)
 {
+	smc9115_pre_init();
 	gd->bd->bi_arch_number = MACH_TYPE_SMDKC100;
 	gd->bd->bi_boot_params = PHYS_SDRAM_1 + 0x100;
 
@@ -49,3 +77,12 @@ int checkboard(void)
 	return 0;
 }
 #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/include/configs/smdkc100.h b/include/configs/smdkc100.h
index a8ba052..3de9da1 100644
--- a/include/configs/smdkc100.h
+++ b/include/configs/smdkc100.h
@@ -83,7 +83,7 @@
 #undef CONFIG_CMD_FLASH
 #undef CONFIG_CMD_IMLS
 #undef CONFIG_CMD_NAND
-#undef CONFIG_CMD_NET
+#define CONFIG_CMD_NET		/* bootp, tftpboot, rarpboot */
 
 #define CONFIG_CMD_CACHE
 #define CONFIG_CMD_REGINFO
@@ -235,4 +235,32 @@
 
 #define CONFIG_DOS_PARTITION		1
 
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+
+/*
+ * Net Configurations
+ */
+#define CONFIG_ETHADDR          00 : 40 : 5c : 26 : 0a : 5b
+#define CONFIG_NETMASK          255.255.255.0
+#define CONFIG_IPADDR           192.168.0.20
+#define CONFIG_SERVERIP         192.168.0.10
+#define CONFIG_GATEWAYIP        192.168.0.1
+
+/*
+ * Ethernet Contoller driver
+ */
+#ifdef CONFIG_CMD_NET
+#define CONFIG_NET_MULTI
+#define CONFIG_SMC911X   	1	/* we have a SMC9115 on-board	*/
+#define CONFIG_SMC911X_16_BIT	1	/* SMC911X_16_BIT Mode		*/
+#define CONFIG_SMC911X_BASE	0x98800300	/* SMC911X Drive Base	*/
+#define CONFIG_ENV_SROM_BANK	3	/* Select SROM Bank-3 for Ethernet*/
+#endif /* CONFIG_CMD_NET */
+
 #endif	/* __CONFIG_H */
-- 
1.6.6

  parent reply	other threads:[~2010-02-09  9:38 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1234>
2010-02-09  9:22 ` [U-Boot] [PATCH 0/3] SAMSUNG: SMDKC100: Add Ethernet support Naveen Krishna Ch
2010-02-09  9:34   ` [U-Boot] [PATCH 1/3] S5PC100: Memory SubSystem Header file, register description(SROMC) Naveen Krishna Ch
2010-02-10  5:48     ` Minkyu Kang
2010-02-10  6:16       ` Naveen Krishna Ch
2010-02-10 10:34         ` Minkyu Kang
2010-02-11  9:10           ` Naveen Krishna Ch
2010-02-09  9:38   ` [U-Boot] [PATCH 2/3] S5PC100: Function to configure the SROMC registers Naveen Krishna Ch
2010-02-10  6:13     ` Minkyu Kang
2010-02-10  6:31       ` Naveen Krishna Ch
2010-02-10  6:52         ` Minkyu Kang
2010-02-10 10:36           ` Minkyu Kang
2010-02-10 11:32             ` Naveen Krishna Ch
2010-02-09  9:38   ` Naveen Krishna Ch [this message]
2010-02-09 14:52     ` [U-Boot] [PATCH 3/3] SAMSUNG: SMDKC100: Adds ethernet support Ben Warren
2010-02-10  4:53       ` Naveen Krishna Ch
2010-02-10  5:40         ` Ben Warren
2010-02-10  3:16   ` [U-Boot] [PATCH 0/3] SAMSUNG: SMDKC100: Add Ethernet support Minkyu Kang
2010-02-10  3:22     ` Naveen Krishna Ch
2010-02-10 12:46 [U-Boot] [PATCH 3/3] SAMSUNG: SMDKC100: Adds ethernet support Naveen Krishna Ch

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=1265708302-15743-1-git-send-email-ch.naveen@samsung.com \
    --to=ch.naveen@samsung.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 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.