All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH V2 3/3] SAMSUNG: SMDKC100: Adds ethernet support.
@ 2010-02-10  5:10 Naveen Krishna Ch
  2010-02-10  6:56 ` Minkyu Kang
  0 siblings, 1 reply; 6+ messages in thread
From: Naveen Krishna Ch @ 2010-02-10  5:10 UTC (permalink / raw)
  To: u-boot

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.

Changes since v1:

1. Removed the CONFIG_BOOTP_* and Net config macros from board header file
   as per comments from Ben Warren.

Signed-off-by: Naveen Krishna Ch <ch.naveen <at> samsung.com>
---
 board/samsung/smdkc100/smdkc100.c |   37 +++++++++++++++++++++++++++++++++++++
 include/configs/smdkc100.h        |   13 ++++++++++++-
 2 files changed, 49 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..eceb93f 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,15 @@
 
 #define CONFIG_DOS_PARTITION		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

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH V2 3/3] SAMSUNG: SMDKC100: Adds ethernet support.
  2010-02-10  5:10 [U-Boot] [PATCH V2 3/3] SAMSUNG: SMDKC100: Adds ethernet support Naveen Krishna Ch
@ 2010-02-10  6:56 ` Minkyu Kang
  2010-02-10 10:16   ` Minkyu Kang
  2010-02-10 11:32   ` Naveen Krishna Ch
  0 siblings, 2 replies; 6+ messages in thread
From: Minkyu Kang @ 2010-02-10  6:56 UTC (permalink / raw)
  To: u-boot

Dear Naveen Krishna Ch,

On 10 February 2010 14:10, Naveen Krishna Ch <ch.naveen@samsung.com> wrote:
> 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.
>
> Changes since v1:
>
> 1. Removed the CONFIG_BOOTP_* and Net config macros from board header file
> ? as per comments from Ben Warren.

please move this change log under the --- line.
And if you send next version patch, you must send all of your patch series.

>
> Signed-off-by: Naveen Krishna Ch <ch.naveen <at> samsung.com>
> ---
> ?board/samsung/smdkc100/smdkc100.c | ? 37 +++++++++++++++++++++++++++++++++++++
> ?include/configs/smdkc100.h ? ? ? ?| ? 13 ++++++++++++-
> ?2 files changed, 49 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);

NAK.
Please use the structure (see gpio.h)

> +
> + ? ? ? /* 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..eceb93f 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,15 @@
>
> ?#define CONFIG_DOS_PARTITION ? ? ? ? ? 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
>
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
>

Thanks
Minkyu Kang
-- 
from. prom.
www.promsoft.net

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH V2 3/3] SAMSUNG: SMDKC100: Adds ethernet support.
  2010-02-10  6:56 ` Minkyu Kang
@ 2010-02-10 10:16   ` Minkyu Kang
  2010-02-10 11:31     ` Naveen Krishna Ch
  2010-02-10 11:32   ` Naveen Krishna Ch
  1 sibling, 1 reply; 6+ messages in thread
From: Minkyu Kang @ 2010-02-10 10:16 UTC (permalink / raw)
  To: u-boot

Dear Naveen Krishna Ch,

On 10 February 2010 15:56, Minkyu Kang <promsoft@gmail.com> wrote:
> Dear Naveen Krishna Ch,
>
> On 10 February 2010 14:10, Naveen Krishna Ch <ch.naveen@samsung.com> wrote:
>> 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.
>>
>> Changes since v1:
>>
>> 1. Removed the CONFIG_BOOTP_* and Net config macros from board header file
>> ? as per comments from Ben Warren.
>
> please move this change log under the --- line.
> And if you send next version patch, you must send all of your patch series.
>
>>
>> Signed-off-by: Naveen Krishna Ch <ch.naveen <at> samsung.com>
>> ---
>> ?board/samsung/smdkc100/smdkc100.c | ? 37 +++++++++++++++++++++++++++++++++++++
>> ?include/configs/smdkc100.h ? ? ? ?| ? 13 ++++++++++++-
>> ?2 files changed, 49 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);
>
> NAK.
> Please use the structure (see gpio.h)
>
>> +
>> + ? ? ? /* 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);
>> +}

sorry, one more thing
I think smc_bw_conf is unnecessary.
please do it in config_sromc.


>> +
>> ?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..eceb93f 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,15 @@
>>
>> ?#define CONFIG_DOS_PARTITION ? ? ? ? ? 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
>>
>> _______________________________________________
>> U-Boot mailing list
>> U-Boot at lists.denx.de
>> http://lists.denx.de/mailman/listinfo/u-boot
>>
>
> Thanks
> Minkyu Kang
> --
> from. prom.
> www.promsoft.net
>

Thanks.
Minkyu Kang
-- 
from. prom.
www.promsoft.net

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH V2 3/3] SAMSUNG: SMDKC100: Adds ethernet support.
  2010-02-10 10:16   ` Minkyu Kang
@ 2010-02-10 11:31     ` Naveen Krishna Ch
  0 siblings, 0 replies; 6+ messages in thread
From: Naveen Krishna Ch @ 2010-02-10 11:31 UTC (permalink / raw)
  To: u-boot

Hi kang,

On 10 February 2010 15:46, Minkyu Kang <promsoft@gmail.com> wrote:

> Dear Naveen Krishna Ch,
>
> On 10 February 2010 15:56, Minkyu Kang <promsoft@gmail.com> wrote:
> > Dear Naveen Krishna Ch,
> >
> > On 10 February 2010 14:10, Naveen Krishna Ch <ch.naveen@samsung.com>
> wrote:
> >> 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.
> >>
> >> Changes since v1:
> >>
> >> 1. Removed the CONFIG_BOOTP_* and Net config macros from board header
> file
> >>   as per comments from Ben Warren.
> >
> > please move this change log under the --- line.
> > And if you send next version patch, you must send all of your patch
> series.
> >
> >>
> >> Signed-off-by: Naveen Krishna Ch <ch.naveen <at> samsung.com>
> >> ---
> >>  board/samsung/smdkc100/smdkc100.c |   37
> +++++++++++++++++++++++++++++++++++++
> >>  include/configs/smdkc100.h        |   13 ++++++++++++-
> >>  2 files changed, 49 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);
> >
> > NAK.
> > Please use the structure (see gpio.h)
> >
> >> +
> >> +       /* 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);
> >> +}
>
> sorry, one more thing
> I think smc_bw_conf is unnecessary.
> please do it in config_sromc.

The config_sromc() is a dumb/generic function which takes the configuration
values for BandWidth and BankControl register and the SROM Bank number
and accordingly programs the registers.
So, its better the caller send the value to be configured.

>
>
> >> +
> >>  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..eceb93f 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,15 @@
> >>
> >>  #define CONFIG_DOS_PARTITION           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
> >>
> >> _______________________________________________
> >> U-Boot mailing list
> >> U-Boot at lists.denx.de
> >> http://lists.denx.de/mailman/listinfo/u-boot
> >>
> >
> > Thanks
> > Minkyu Kang
> > --
> > from. prom.
> > www.promsoft.net
> >
>
> Thanks.
> Minkyu Kang
> --
> from. prom.
> www.promsoft.net
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
>



-- 
Shine bright,
(: Naveen Krishna Ch :)

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH V2 3/3] SAMSUNG: SMDKC100: Adds ethernet support.
  2010-02-10  6:56 ` Minkyu Kang
  2010-02-10 10:16   ` Minkyu Kang
@ 2010-02-10 11:32   ` Naveen Krishna Ch
  1 sibling, 0 replies; 6+ messages in thread
From: Naveen Krishna Ch @ 2010-02-10 11:32 UTC (permalink / raw)
  To: u-boot

Hi Kang,

On 10 February 2010 12:26, Minkyu Kang <promsoft@gmail.com> wrote:

> Dear Naveen Krishna Ch,
>
> On 10 February 2010 14:10, Naveen Krishna Ch <ch.naveen@samsung.com>
> wrote:
> > 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.
> >
> > Changes since v1:
> >
> > 1. Removed the CONFIG_BOOTP_* and Net config macros from board header
> file
> >   as per comments from Ben Warren.
>
> please move this change log under the --- line.
> And if you send next version patch, you must send all of your patch series.
>
My Bad i will change it

>
> >
> > Signed-off-by: Naveen Krishna Ch <ch.naveen <at> samsung.com>
> > ---
> >  board/samsung/smdkc100/smdkc100.c |   37
> +++++++++++++++++++++++++++++++++++++
> >  include/configs/smdkc100.h        |   13 ++++++++++++-
> >  2 files changed, 49 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);
>
> NAK.
> Please use the structure (see gpio.h)
>
I wil resend the patches V2.

>
> > +
> > +       /* 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..eceb93f 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,15 @@
> >
> >  #define CONFIG_DOS_PARTITION           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
> >
> > _______________________________________________
> > U-Boot mailing list
> > U-Boot at lists.denx.de
> > http://lists.denx.de/mailman/listinfo/u-boot
> >
>
> Thanks
> Minkyu Kang
> --
> from. prom.
> www.promsoft.net
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
>



-- 
Shine bright,
(: Naveen Krishna Ch :)

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH v2 3/3] SAMSUNG: SMDKC100: Adds ethernet support.
@ 2010-02-11  2:48 Naveen Krishna Ch
  0 siblings, 0 replies; 6+ messages in thread
From: Naveen Krishna Ch @ 2010-02-11  2:48 UTC (permalink / raw)
  To: u-boot

From: Naveen Krishna CH <chnaveen@chnaveen.localdomain>

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@samsung.com>
---

Changes since V1: 

1. The CONFIG_BOOTP* and Net config Macros are removed from config header.
Comments from Ben Warren are fixed
2. The GPIO configuration is modified & Macro and Function are renamed.
Comments from Minkyu Kang are fixed

 board/samsung/smdkc100/smdkc100.c |   38 +++++++++++++++++++++++++++++++++++++
 include/configs/smdkc100.h        |   13 +++++++++++-
 2 files changed, 50 insertions(+), 1 deletions(-)

diff --git a/board/samsung/smdkc100/smdkc100.c b/board/samsung/smdkc100/smdkc100.c
index 15a1a27..43af5ea 100644
--- a/board/samsung/smdkc100/smdkc100.c
+++ b/board/samsung/smdkc100/smdkc100.c
@@ -23,10 +23,39 @@
  */
 
 #include <common.h>
+#include <asm/io.h>
+#include <asm/arch/smc.h>
+#include <asm/arch/gpio.h>
+
 DECLARE_GLOBAL_DATA_PTR;
 
+/*
+ * Miscellaneous platform dependent initialisations
+ */
+static void smc9115_pre_init(void)
+{
+	u32 tmp;
+	u32 smc_bw_conf;
+	struct s5pc100_gpio *const gpio =
+		(struct s5pc100_gpio *)S5PC100_GPIO_BASE;
+
+	/* gpio configuration GPK0CON */
+	tmp = __raw_readl(&gpio->gpio_k0.con);
+	tmp &= ~(0xf << CONFIG_ENV_SROM_BANK * 4);
+	tmp |=  (0x2 << CONFIG_ENV_SROM_BANK * 4);
+	__raw_writel(tmp, &gpio->gpio_k0.con);
+
+	/* Ethernet needs bus width of 16 bits */
+	smc_bw_conf = SMC_DATA16_WIDTH(CONFIG_ENV_SROM_BANK);
+
+	/* Select and configure the SROMC bank */
+	s5pc1xx_config_sromc(CONFIG_ENV_SROM_BANK, smc_bw_conf, SMC_BC_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 +78,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..f7cfc5e 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,15 @@
 
 #define CONFIG_DOS_PARTITION		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

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-02-11  2:48 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-10  5:10 [U-Boot] [PATCH V2 3/3] SAMSUNG: SMDKC100: Adds ethernet support Naveen Krishna Ch
2010-02-10  6:56 ` Minkyu Kang
2010-02-10 10:16   ` Minkyu Kang
2010-02-10 11:31     ` Naveen Krishna Ch
2010-02-10 11:32   ` Naveen Krishna Ch
2010-02-11  2:48 [U-Boot] [PATCH v2 " Naveen Krishna Ch

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.