Re: [U-Boot] [PATCH 2/2 v3] arm: suen3, suen3_v1, mgcoge2_arm_p1a support

2010-02-09 Thread Prafulla Wadaskar
 

> -Original Message-
> From: Heiko Schocher [mailto:h...@denx.de] 
> Sent: Wednesday, February 10, 2010 12:39 PM
> To: Prafulla Wadaskar
> Cc: U-Boot user list
> Subject: Re: [PATCH 2/2 v3] arm: suen3, suen3_v1, 
> mgcoge2_arm_p1a support
> 
> Hello Prafulla,
> 
> do you have some comments on the following 2 points?
> (If they are clarified, I can post v4 of the patch ...)
> 
> Heiko Schocher wrote:
> > Prafulla Wadaskar wrote:
> >>> -Original Message-
> >>> From: Heiko Schocher [mailto:h...@denx.de] 
> >>> Sent: Monday, February 01, 2010 1:07 PM
> >>> To: U-Boot user list
> >>> Cc: Wolfgang Denk; Prafulla Wadaskar; Tom
> >>> Subject: [PATCH 2/2 v3] arm: suen3, suen3_v1, 
> mgcoge2_arm_p1a support
...snip...
> >> the include/config files indicates that there are five 
> board supports.
> >> Please provide one patch for each board, may be first will 
> be master one.
> > 
> > This question also asked Tom, see:
> > 
> > http://lists.denx.de/pipermail/u-boot/2010-January/067182.html
> > 
> > But if you prefer to split this in 5 patches, I can do it.
> 
> Is it OK in one patch, or should I split it in 4 patches?

Dear Heiko

You should split it in patches as per boards supported, if you are supporting 
four board then there should be four different patches.

> 
> [...]
> >>> diff --git a/board/keymile/km_arm/sdramregs.txt 
> >>> b/board/keymile/km_arm/sdramregs.txt
> >>> new file mode 100644
> >>> index 000..68c53a7
> >>> --- /dev/null
> >>> +++ b/board/keymile/km_arm/sdramregs.txt
> >>> @@ -0,0 +1,31 @@
> >> What is this file?
> >> Which license?
> >> Who is using it?
> > 
> > Ok, you are right, some comments are here necessary.
> > 
> > On this boards is a preloader, which initializes
> > the RAM. Therefore the preloader reads the RAM settings
> > from the image he should load, through an hear. This
> > header is created with a tool doimage (I think it is
> > from marvell), and this tool needs this file ...

Marvell Kirkwood has internal bootROM and it may be active through h/w 
configuration on you board.
In such case bootROM tries to read Kirkwood boot image (i.e. kwbimage) from 
boot media (i.e. NAND/SPI/Sata etc).

So kwbimage.cfg (the above file that you have created) should be present in 
board folder and this will be used by mkimage tool if you create u-boot.kwb 
target.

> > 
> > So, I have no idea where to put this files, and think
> > they are in the board directory on the right place ...

Please refer docs/README.kwbimage

> > 
> > I found something similiar in current mainline:
> > 
> > board/Marvell/mv88f6281gtw_ge/dramregs_333h.txt

There is kwbimage.cfg and not dramregs_333h.txt, may be you are referring very 
early post

> > 
> > This file is also without comments, license info ...
> > Maybe this tool don;t accept comments?
> 
> What should I do with this file?

Please see sheevaplug implementation in latest release

Regards..
Prafulla . .

> 
> bye
> Heiko
> -- 
> DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
> 
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 2/2 v3] arm: suen3, suen3_v1, mgcoge2_arm_p1a support

2010-02-09 Thread Heiko Schocher
Hello Prafulla,

do you have some comments on the following 2 points?
(If they are clarified, I can post v4 of the patch ...)

Heiko Schocher wrote:
> Prafulla Wadaskar wrote:
>>> -Original Message-
>>> From: Heiko Schocher [mailto:h...@denx.de] 
>>> Sent: Monday, February 01, 2010 1:07 PM
>>> To: U-Boot user list
>>> Cc: Wolfgang Denk; Prafulla Wadaskar; Tom
>>> Subject: [PATCH 2/2 v3] arm: suen3, suen3_v1, mgcoge2_arm_p1a support
>>>
>>> This patch adds support for the Keymile SUEN3 board variants which
>>> are based on the Marvell Kirkwood (88F6281) SoC. All variants
>>> uses common code stored in board/keymile/km_arm/km_arm.c
>>>
>>> mgcoge2_arm_p1a board:
>>> This adds support for the ARM part of the mgcoge2. The suen3
>>> target was moved to the correct suen3 p1b version. There is a
>>> difference between the GPIO configuration between suen3 and mgcoge2.
>>>
>>> Signed-off-by: Holger Brunck 
>>> Signed-off-by: Stefan Roese 
>>> Signed-off-by: Heiko Schocher 
>>> ---
>>> - changes since v1:
>>>   added comments from Wolfgang Denk:
>>>   get rid of flash_info_t define in board config
>>>   (to get this working patch 1/2 is introduced/needed)
>>> - changes since v2:
>>>   added comments from Wolfgang Denk
>>>   - rearranged if/else in do_spi_toggle()
>>>   - added I/O accessor functions for bootcounter
>>>
>>>  MAINTAINERS   |2 +
>>>  MAKEALL   |4 +
>>>  Makefile  |8 +
>>>  board/keymile/common/common.c |   23 ++-
>>>  board/keymile/km_arm/Makefile |   51 +
>>>  board/keymile/km_arm/config.mk|   25 +++
>>>  board/keymile/km_arm/km_arm.c |  343 
>>> +
>>>  board/keymile/km_arm/sdramregs.txt|   31 +++
>>>  board/keymile/km_arm/sdramregs_v1.txt |   28 +++
>>>  include/configs/km-arm.h  |  189 ++
[...]
>>>  include/configs/mgcoge2_arm_p1a.h |   96 +
>>>  include/configs/suen3.h   |  103 ++
>>>  include/configs/suen3_p1a.h   |   82 
>>>  include/configs/suen3_p1b_p1c.h   |  110 +++
>> ...snip...
>>
>> the include/config files indicates that there are five board supports.
>> Please provide one patch for each board, may be first will be master one.
> 
> This question also asked Tom, see:
> 
> http://lists.denx.de/pipermail/u-boot/2010-January/067182.html
> 
> But if you prefer to split this in 5 patches, I can do it.

Is it OK in one patch, or should I split it in 4 patches?

[...]
>>> diff --git a/board/keymile/km_arm/sdramregs.txt 
>>> b/board/keymile/km_arm/sdramregs.txt
>>> new file mode 100644
>>> index 000..68c53a7
>>> --- /dev/null
>>> +++ b/board/keymile/km_arm/sdramregs.txt
>>> @@ -0,0 +1,31 @@
>> What is this file?
>> Which license?
>> Who is using it?
> 
> Ok, you are right, some comments are here necessary.
> 
> On this boards is a preloader, which initializes
> the RAM. Therefore the preloader reads the RAM settings
> from the image he should load, through an header. This
> header is created with a tool doimage (I think it is
> from marvell), and this tool needs this file ...
> 
> So, I have no idea where to put this files, and think
> they are in the board directory on the right place ...
> 
> I found something similiar in current mainline:
> 
> board/Marvell/mv88f6281gtw_ge/dramregs_333h.txt
> 
> This file is also without comments, license info ...
> Maybe this tool don;t accept comments?

What should I do with this file?

bye
Heiko
-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2] [PATCH] doc: add README for CONFIG_HWCONFIG option

2010-02-09 Thread Heiko Schocher
Signed-off-by: Heiko Schocher 
---
changes since v1:
- spelling check from Mike Frysinger, thanks!

 doc/README.hwconfig |   51 +++
 1 files changed, 51 insertions(+), 0 deletions(-)
 create mode 100644 doc/README.hwconfig

diff --git a/doc/README.hwconfig b/doc/README.hwconfig
new file mode 100644
index 000..a4f489a
--- /dev/null
+++ b/doc/README.hwconfig
@@ -0,0 +1,51 @@
+To enable this feature just define CONFIG_HWCONFIG in your board
+config file.
+
+This implements a simple hwconfig infrastructure: an
+interface for software knobs to control hardware.
+
+This a is very simple implementation, i.e. it is implemented
+via the `hwconfig' environment variable. Later we could write
+some "hwconfig " commands, ncurses
+interface for Award BIOS-like interface, and frame-buffer
+interface for AMI GUI[1] BIOS-like interface with mouse
+support[2].
+
+Current implementation details/limitations:
+
+1. Doesn't support options dependencies and mutual exclusion.
+   We can implement this by integrating apt-get[3] into Das
+   U-Boot. But I haven't bother yet.
+
+2. Since we don't implement a hwconfig command, i.e. we're working
+   with the environement directly, there is no way to tell that
+   toggling a particular option will need a reboot to take
+   effect. So, for now it's advised to always reboot the
+   target after modifying the hwconfig variable.
+
+3. We support hwconfig options with arguments. For example,
+
+   set hwconfig "dr_usb:mode=peripheral,phy_type=ulpi"
+
+   This selects three hwconfig options:
+   1. dr_usb - enable Dual-Role USB controller;
+   2. dr_usb_mode:peripheral - USB in Function mode;
+   3. dr_usb_phy_type:ulpi - USB should work with ULPI PHYs.
+
+The purpose of this simple implementation is to refine the
+internal API and then we can continue improving the user
+experience by adding more mature interfaces, like a hwconfig
+command with bells and whistles. Or not adding, if we feel
+that the current interface fits people's needs.
+
+[1] http://en.wikipedia.org/wiki/American_Megatrends
+[2] Regarding ncurses and GUI with mouse support -- I'm just
+kidding.
+[3] The comment regarding apt-get is also a joke, meaning that
+dependency tracking could be non-trivial. For example, for
+enabling HW feature X we may need to disable Y, and turn Z
+into reduced mode (like RMII-only interface for ethernet,
+no MII).
+
+It's quite trivial to implement simple cases though.
+
-- 
1.6.2.5

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH V2 3/3] SAMSUNG: SMDKC100: Adds ethernet support.

2010-02-09 Thread Minkyu Kang
Dear Naveen Krishna Ch,

On 10 February 2010 14:10, Naveen Krishna Ch  wrote:
> From: Naveen Krishna CH 
>
> 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  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 
> +#include 
> +#include 
> +
> +#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@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@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 2/3] S5PC100: Function to configure the SROMC registers.

2010-02-09 Thread Minkyu Kang
Dear

On 10 February 2010 15:31, Naveen Krishna Ch  wrote:
> Hi Kang,
>
> On 10 February 2010 11:43, Minkyu Kang  wrote:
>>
>> Dear Naveen Krishna Ch,
>>
>> On 9 February 2010 18:38, Naveen Krishna Ch  wrote:
>> > From: Naveen Krishna CH 
>> >
>> > Nand Flash, Ethernet, other features might need to configure the
>> > SROMC registers accordingly.
>> > The config_sromc() functions helps with this.
>> >
>> > Signed-off-by: Naveen Krishna Ch  samsung.com>
>>
>> please fix ur e-mail address.
>
> The Email ID is correct.

ch.naveen  samsung.com is correct?
Please modify it to ch.nav...@samsung.com

>>
>> > ---
>> >  cpu/arm_cortexa8/s5pc1xx/Makefile  |    1 +
>> >  cpu/arm_cortexa8/s5pc1xx/sromc.c   |   49
>> > 
>> >  include/asm-arm/arch-s5pc1xx/mem.h |    3 ++
>> >  3 files changed, 53 insertions(+), 0 deletions(-)
>> >  create mode 100644 cpu/arm_cortexa8/s5pc1xx/sromc.c
>> >
>> > diff --git a/cpu/arm_cortexa8/s5pc1xx/Makefile
>> > b/cpu/arm_cortexa8/s5pc1xx/Makefile
>> > index 4f922e6..0a6a9b4 100644
>> > --- a/cpu/arm_cortexa8/s5pc1xx/Makefile
>> > +++ b/cpu/arm_cortexa8/s5pc1xx/Makefile
>> > @@ -34,6 +34,7 @@ SOBJS += reset.o
>> >  COBJS  += clock.o
>> >  COBJS  += cpu_info.o
>> >  COBJS  += timer.o
>> > +COBJS  += sromc.o
>> >
>> >  SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
>> >  OBJS   := $(addprefix $(obj),$(COBJS) $(SOBJS))
>> > diff --git a/cpu/arm_cortexa8/s5pc1xx/sromc.c
>> > b/cpu/arm_cortexa8/s5pc1xx/sromc.c
>> > new file mode 100644
>> > index 000..96ca9e0
>> > --- /dev/null
>> > +++ b/cpu/arm_cortexa8/s5pc1xx/sromc.c
>> > @@ -0,0 +1,49 @@
>> > +/*
>> > + * Copyright (C) 2010 Samsung Electronics
>> > + * Naveen Krishna Ch 
>> > + *
>> > + * See file CREDITS for list of people who contributed to this
>> > + * project.
>> > + *
>> > + * This program is free software; you can redistribute it and/or
>> > + * modify it under the terms of the GNU General Public License as
>> > + * published by the Free Software Foundation; either version 2 of
>> > + * the License, or (at your option) any later version.
>> > + *
>> > + * This program is distributed in the hope that it will be useful,
>> > + * but WITHOUT ANY WARRANTY; without even the implied warranty of
>> > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
>> > + * GNU General Public License for more details.
>> > + *
>> > + * You should have received a copy of the GNU General Public License
>> > + * along with this program; if not, write to the Free Software
>> > + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
>> > + * MA 02111-1307 USA
>> > + */
>> > +
>> > +#include 
>> > +#include 
>> > +#include 
>> > +
>> > +/*
>> > + * config_sromc() - select the proper SROMC Bank and configure the
>> > + *                 band width control and bank control registers
>> > + * srom_bank   - SROM Bank 0 to 5
>> > + * smc_bw_conf  - SMC Band witdh reg configuration value
>> > + * smc_bc_conf  - SMC Bank Control reg configuration value
>> > + */
>> > +void config_sromc(u32 srom_bank, u32 smc_bw_conf, u32 smc_bc_conf)
>> > +{
>> > +       u32 tmp;
>> > +       struct s5pc1xx_sromc *const srom =
>> > +               (struct s5pc1xx_sromc *)S5PC100_SROMC_BASE;
>>
>> Please adds support S5PC110 together.
>
> I wil add this and resend the patch.
>>
>> > +
>> > +       /* Configure SMC_BW register to handle proper SROMC bank */
>> > +       tmp = srom->smc_bw;
>> > +       tmp &= ~(0xF << (srom_bank * 4));
>> > +       tmp |= smc_bw_conf;
>> > +       srom->smc_bw = tmp;
>> > +
>> > +       /* Configure SMC_BC register */
>> > +       srom->smc_bc[srom_bank] = smc_bc_conf;
>> > +}
>> > diff --git a/include/asm-arm/arch-s5pc1xx/mem.h
>> > b/include/asm-arm/arch-s5pc1xx/mem.h
>> > index 66272ff..99b2d2e 100644
>> > --- a/include/asm-arm/arch-s5pc1xx/mem.h
>> > +++ b/include/asm-arm/arch-s5pc1xx/mem.h
>> > @@ -52,4 +52,7 @@ struct s5pc1xx_sromc {
>> >  };
>> >  #endif /* __ASSEMBLY__ */
>> >
>> > +/* Configure the Band Width and Bank Control Regs for required SROMC
>> > Bank */
>> > +void config_sromc(u32 srom_bank, u32 smc_bw_conf, u32 smc_bc_conf);
>> > +
>> >  #endif /* __ASM_ARCH_MEM_H_ */
>> > --
>> > 1.6.6
>> >
>> > ___
>> > U-Boot mailing list
>> > U-Boot@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@lists.denx.de
>> http://lists.denx.de/mailman/listinfo/u-boot
>
>
>
> --
> Shine bright,
> (: Naveen Krishna Ch :)
>

Thanks
Minkyu Kang
-- 
from. prom.
www.promsoft.net
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 2/3] S5PC100: Function to configure the SROMC registers.

2010-02-09 Thread Naveen Krishna Ch
Hi Kang,

On 10 February 2010 11:43, Minkyu Kang  wrote:

> Dear Naveen Krishna Ch,
>
> On 9 February 2010 18:38, Naveen Krishna Ch  wrote:
> > From: Naveen Krishna CH 
> >
> > Nand Flash, Ethernet, other features might need to configure the
> > SROMC registers accordingly.
> > The config_sromc() functions helps with this.
> >
> > Signed-off-by: Naveen Krishna Ch  samsung.com>
>
> please fix ur e-mail address.
>
The Email ID is correct.

>
> > ---
> >  cpu/arm_cortexa8/s5pc1xx/Makefile  |1 +
> >  cpu/arm_cortexa8/s5pc1xx/sromc.c   |   49
> 
> >  include/asm-arm/arch-s5pc1xx/mem.h |3 ++
> >  3 files changed, 53 insertions(+), 0 deletions(-)
> >  create mode 100644 cpu/arm_cortexa8/s5pc1xx/sromc.c
> >
> > diff --git a/cpu/arm_cortexa8/s5pc1xx/Makefile
> b/cpu/arm_cortexa8/s5pc1xx/Makefile
> > index 4f922e6..0a6a9b4 100644
> > --- a/cpu/arm_cortexa8/s5pc1xx/Makefile
> > +++ b/cpu/arm_cortexa8/s5pc1xx/Makefile
> > @@ -34,6 +34,7 @@ SOBJS += reset.o
> >  COBJS  += clock.o
> >  COBJS  += cpu_info.o
> >  COBJS  += timer.o
> > +COBJS  += sromc.o
> >
> >  SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
> >  OBJS   := $(addprefix $(obj),$(COBJS) $(SOBJS))
> > diff --git a/cpu/arm_cortexa8/s5pc1xx/sromc.c
> b/cpu/arm_cortexa8/s5pc1xx/sromc.c
> > new file mode 100644
> > index 000..96ca9e0
> > --- /dev/null
> > +++ b/cpu/arm_cortexa8/s5pc1xx/sromc.c
> > @@ -0,0 +1,49 @@
> > +/*
> > + * Copyright (C) 2010 Samsung Electronics
> > + * Naveen Krishna Ch 
> > + *
> > + * See file CREDITS for list of people who contributed to this
> > + * project.
> > + *
> > + * This program is free software; you can redistribute it and/or
> > + * modify it under the terms of the GNU General Public License as
> > + * published by the Free Software Foundation; either version 2 of
> > + * the License, or (at your option) any later version.
> > + *
> > + * This program is distributed in the hope that it will be useful,
> > + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> > + * GNU General Public License for more details.
> > + *
> > + * You should have received a copy of the GNU General Public License
> > + * along with this program; if not, write to the Free Software
> > + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
> > + * MA 02111-1307 USA
> > + */
> > +
> > +#include 
> > +#include 
> > +#include 
> > +
> > +/*
> > + * config_sromc() - select the proper SROMC Bank and configure the
> > + * band width control and bank control registers
> > + * srom_bank   - SROM Bank 0 to 5
> > + * smc_bw_conf  - SMC Band witdh reg configuration value
> > + * smc_bc_conf  - SMC Bank Control reg configuration value
> > + */
> > +void config_sromc(u32 srom_bank, u32 smc_bw_conf, u32 smc_bc_conf)
> > +{
> > +   u32 tmp;
> > +   struct s5pc1xx_sromc *const srom =
> > +   (struct s5pc1xx_sromc *)S5PC100_SROMC_BASE;
>
> Please adds support S5PC110 together.
>
I wil add this and resend the patch.

>
> > +
> > +   /* Configure SMC_BW register to handle proper SROMC bank */
> > +   tmp = srom->smc_bw;
> > +   tmp &= ~(0xF << (srom_bank * 4));
> > +   tmp |= smc_bw_conf;
> > +   srom->smc_bw = tmp;
> > +
> > +   /* Configure SMC_BC register */
> > +   srom->smc_bc[srom_bank] = smc_bc_conf;
> > +}
> > diff --git a/include/asm-arm/arch-s5pc1xx/mem.h
> b/include/asm-arm/arch-s5pc1xx/mem.h
> > index 66272ff..99b2d2e 100644
> > --- a/include/asm-arm/arch-s5pc1xx/mem.h
> > +++ b/include/asm-arm/arch-s5pc1xx/mem.h
> > @@ -52,4 +52,7 @@ struct s5pc1xx_sromc {
> >  };
> >  #endif /* __ASSEMBLY__ */
> >
> > +/* Configure the Band Width and Bank Control Regs for required SROMC
> Bank */
> > +void config_sromc(u32 srom_bank, u32 smc_bw_conf, u32 smc_bc_conf);
> > +
> >  #endif /* __ASM_ARCH_MEM_H_ */
> > --
> > 1.6.6
> >
> > ___
> > U-Boot mailing list
> > U-Boot@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@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
>



-- 
Shine bright,
(: Naveen Krishna Ch :)
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/3] S5PC100: Memory SubSystem Header file, register description(SROMC).

2010-02-09 Thread Naveen Krishna Ch
Hi Kang,

On 10 February 2010 11:18, Minkyu Kang  wrote:

> Dear Naveen Krishna Ch,
>
> On 9 February 2010 18:34, Naveen Krishna Ch  wrote:
> > From: Naveen Krishna CH 
> >
> > Memory subsystem of S5PC100 handles SROM, SRAM, OneDRAM, OneNand,
> > NAND Flash, DDRs.
> > mem.h is a common place for the register description of Memory subsystem
> > of S5PC100.
> > Note: Only SROM related registers are descibed now.
> >
> > Signed-off-by: Naveen Krishna Ch  samsung.com>
> > ---
> >  include/asm-arm/arch-s5pc1xx/mem.h |   55
> 
> >  1 files changed, 55 insertions(+), 0 deletions(-)
> >  create mode 100644 include/asm-arm/arch-s5pc1xx/mem.h
> >
> > diff --git a/include/asm-arm/arch-s5pc1xx/mem.h
> b/include/asm-arm/arch-s5pc1xx/mem.h
> > new file mode 100644
> > index 000..66272ff
> > --- /dev/null
> > +++ b/include/asm-arm/arch-s5pc1xx/mem.h
>
> I think srom.h is better than mem.h.
>
As the SMC of S5PC100 is supporting several memories SRAM, SROM, NAND, NOR,
DDR. I kept it as mem.h

>
> > @@ -0,0 +1,55 @@
> > +/*
> > + * (C) Copyright 2010 Samsung Electronics
> > + * Naveen Krishna Ch 
> > + *
> > + * This program is free software; you can redistribute it and/or
> > + * modify it under the terms of the GNU General Public License as
> > + * published by the Free Software Foundation; either version 2 of
> > + * the License, or (at your option) any later version.
> > + *
> > + * This program is distributed in the hope that it will be useful,
> > + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> > + * GNU General Public License for more details.
> > + *
> > + * You should have received a copy of the GNU General Public License
> > + * along with this program; if not, write to the Free Software
> > + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
> > + * MA 02111-1307 USA
> > + *
> > + * Note: This file contains the register description for Memory
> subsystem
> > + *  (SROM, NAND Flash, OneNand, DDR, OneDRAM) on S5PC1XX.
> > + *
> > + *  Only SROMC is defined as of now
> > + */
> > +
> > +#ifndef __ASM_ARCH_MEM_H_
> > +#define __ASM_ARCH_MEM_H_
> > +
> > +#define SROM_DATA16_WIDTH(x)(1<<((x*4)+0))
> > +#define SROM_BYTE_ADDR_MODE(x)  (1<<((x*4)+1))  /* 0-> Half-word base
> address*/
> > +   /* 1-> Byte base
> address*/
> > +#define SROM_WAIT_ENABLE(x) (1<<((x*4)+2))
> > +#define SROM_BYTE_ENABLE(x) (1<<((x*4)+3))
>
> Do you use all of these defines?
>
For Net support i use only  SROM_DATA16_WIDTH
But for NAND support we may need SROM_BYTE_ADDR_MODE
These Macros can serve for generic pupose.

>
> > +
> > +#define SMCBC_X_Tacs(0x0)   /* 0clk address set-up */
> > +#define SMCBC_X_Tcos(0x4)   /* 4clk chip selection set-up */
> > +#define SMCBC_X_Tacc(0xe)   /* 14clkaccess cycle */
> > +#define SMCBC_X_Tcoh(0x1)   /* 1clk chip selection hold */
> > +#define SMCBC_X_Tah (0x4)   /* 4clk address holding time */
> > +#define SMCBC_X_Tacp(0x6)   /* 6clk page mode access cycle
> */
> > +#define SMCBC_X_PMC (0x0)   /* normal(1data)page mode configuration
> */
>
> Please don't use lowercase at define
>
I will change it.

> and () is unnecessary.
>
Should remove it

> and.. what mean X is?

The SROM has 6 banks, I used "X" to indicate that

>
> > +
> > +#define SMC_BC_X_CON((SMCBC_X_Tacs<<28)|(SMCBC_X_Tcos<<24)| \
> > +(SMCBC_X_Tacc<<16)|(SMCBC_X_Tcoh<<12)| \
> > +(SMCBC_X_Tah<<8)|(SMCBC_X_Tacp<<4)|\
> > +(SMCBC_X_PMC))
> > +
> > +#ifndef __ASSEMBLY__
> > +struct s5pc1xx_sromc {
> > +   unsigned intsmc_bw;
> > +   unsigned intsmc_bc[6];
> > +};
> > +#endif /* __ASSEMBLY__ */
>
> smc_bw and smc_bc are already belong to sromc structure.
> is "smc_" really need?
> Please modify it to bw and bc or srom_bw and srom_bc (according to TRM)
>
I named it according to TRM. there it mentioned smc_bc.
I wil change it if u insist on srom_bc or so.

>
> > +
> > +#endif /* __ASM_ARCH_MEM_H_ */
> > --
> > 1.6.6
> >
> > ___
> > U-Boot mailing list
> > U-Boot@lists.denx.de
> > http://lists.denx.de/mailman/listinfo/u-boot
> >
>
> Let me know your opinion

> Thanks,
> Minkyu Kang.

--
> from. prom.
> www.promsoft.net
> ___
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
>



-- 
Shine bright,
(: Naveen Krishna Ch :)
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 2/3] S5PC100: Function to configure the SROMC registers.

2010-02-09 Thread Minkyu Kang
Dear Naveen Krishna Ch,

On 9 February 2010 18:38, Naveen Krishna Ch  wrote:
> From: Naveen Krishna CH 
>
> Nand Flash, Ethernet, other features might need to configure the
> SROMC registers accordingly.
> The config_sromc() functions helps with this.
>
> Signed-off-by: Naveen Krishna Ch  samsung.com>

please fix ur e-mail address.

> ---
>  cpu/arm_cortexa8/s5pc1xx/Makefile  |    1 +
>  cpu/arm_cortexa8/s5pc1xx/sromc.c   |   49 
> 
>  include/asm-arm/arch-s5pc1xx/mem.h |    3 ++
>  3 files changed, 53 insertions(+), 0 deletions(-)
>  create mode 100644 cpu/arm_cortexa8/s5pc1xx/sromc.c
>
> diff --git a/cpu/arm_cortexa8/s5pc1xx/Makefile 
> b/cpu/arm_cortexa8/s5pc1xx/Makefile
> index 4f922e6..0a6a9b4 100644
> --- a/cpu/arm_cortexa8/s5pc1xx/Makefile
> +++ b/cpu/arm_cortexa8/s5pc1xx/Makefile
> @@ -34,6 +34,7 @@ SOBJS += reset.o
>  COBJS  += clock.o
>  COBJS  += cpu_info.o
>  COBJS  += timer.o
> +COBJS  += sromc.o
>
>  SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
>  OBJS   := $(addprefix $(obj),$(COBJS) $(SOBJS))
> diff --git a/cpu/arm_cortexa8/s5pc1xx/sromc.c 
> b/cpu/arm_cortexa8/s5pc1xx/sromc.c
> new file mode 100644
> index 000..96ca9e0
> --- /dev/null
> +++ b/cpu/arm_cortexa8/s5pc1xx/sromc.c
> @@ -0,0 +1,49 @@
> +/*
> + * Copyright (C) 2010 Samsung Electronics
> + * Naveen Krishna Ch 
> + *
> + * See file CREDITS for list of people who contributed to this
> + * project.
> + *
> + * This program is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU General Public License as
> + * published by the Free Software Foundation; either version 2 of
> + * the License, or (at your option) any later version.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License
> + * along with this program; if not, write to the Free Software
> + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
> + * MA 02111-1307 USA
> + */
> +
> +#include 
> +#include 
> +#include 
> +
> +/*
> + * config_sromc() - select the proper SROMC Bank and configure the
> + *                 band width control and bank control registers
> + * srom_bank   - SROM Bank 0 to 5
> + * smc_bw_conf  - SMC Band witdh reg configuration value
> + * smc_bc_conf  - SMC Bank Control reg configuration value
> + */
> +void config_sromc(u32 srom_bank, u32 smc_bw_conf, u32 smc_bc_conf)
> +{
> +       u32 tmp;
> +       struct s5pc1xx_sromc *const srom =
> +               (struct s5pc1xx_sromc *)S5PC100_SROMC_BASE;

Please adds support S5PC110 together.

> +
> +       /* Configure SMC_BW register to handle proper SROMC bank */
> +       tmp = srom->smc_bw;
> +       tmp &= ~(0xF << (srom_bank * 4));
> +       tmp |= smc_bw_conf;
> +       srom->smc_bw = tmp;
> +
> +       /* Configure SMC_BC register */
> +       srom->smc_bc[srom_bank] = smc_bc_conf;
> +}
> diff --git a/include/asm-arm/arch-s5pc1xx/mem.h 
> b/include/asm-arm/arch-s5pc1xx/mem.h
> index 66272ff..99b2d2e 100644
> --- a/include/asm-arm/arch-s5pc1xx/mem.h
> +++ b/include/asm-arm/arch-s5pc1xx/mem.h
> @@ -52,4 +52,7 @@ struct s5pc1xx_sromc {
>  };
>  #endif /* __ASSEMBLY__ */
>
> +/* Configure the Band Width and Bank Control Regs for required SROMC Bank */
> +void config_sromc(u32 srom_bank, u32 smc_bw_conf, u32 smc_bc_conf);
> +
>  #endif /* __ASM_ARCH_MEM_H_ */
> --
> 1.6.6
>
> ___
> U-Boot mailing list
> U-Boot@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@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/3] S5PC100: Memory SubSystem Header file, register description(SROMC).

2010-02-09 Thread Minkyu Kang
Dear Naveen Krishna Ch,

On 9 February 2010 18:34, Naveen Krishna Ch  wrote:
> From: Naveen Krishna CH 
>
> Memory subsystem of S5PC100 handles SROM, SRAM, OneDRAM, OneNand,
> NAND Flash, DDRs.
> mem.h is a common place for the register description of Memory subsystem
> of S5PC100.
> Note: Only SROM related registers are descibed now.
>
> Signed-off-by: Naveen Krishna Ch  samsung.com>
> ---
>  include/asm-arm/arch-s5pc1xx/mem.h |   55 
> 
>  1 files changed, 55 insertions(+), 0 deletions(-)
>  create mode 100644 include/asm-arm/arch-s5pc1xx/mem.h
>
> diff --git a/include/asm-arm/arch-s5pc1xx/mem.h 
> b/include/asm-arm/arch-s5pc1xx/mem.h
> new file mode 100644
> index 000..66272ff
> --- /dev/null
> +++ b/include/asm-arm/arch-s5pc1xx/mem.h

I think srom.h is better than mem.h.

> @@ -0,0 +1,55 @@
> +/*
> + * (C) Copyright 2010 Samsung Electronics
> + * Naveen Krishna Ch 
> + *
> + * This program is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU General Public License as
> + * published by the Free Software Foundation; either version 2 of
> + * the License, or (at your option) any later version.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License
> + * along with this program; if not, write to the Free Software
> + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
> + * MA 02111-1307 USA
> + *
> + * Note: This file contains the register description for Memory subsystem
> + *      (SROM, NAND Flash, OneNand, DDR, OneDRAM) on S5PC1XX.
> + *
> + *      Only SROMC is defined as of now
> + */
> +
> +#ifndef __ASM_ARCH_MEM_H_
> +#define __ASM_ARCH_MEM_H_
> +
> +#define SROM_DATA16_WIDTH(x)    (1<<((x*4)+0))
> +#define SROM_BYTE_ADDR_MODE(x)  (1<<((x*4)+1))  /* 0-> Half-word base 
> address*/
> +                                               /* 1-> Byte base address*/
> +#define SROM_WAIT_ENABLE(x)     (1<<((x*4)+2))
> +#define SROM_BYTE_ENABLE(x)     (1<<((x*4)+3))

Do you use all of these defines?

> +
> +#define SMCBC_X_Tacs    (0x0)   /* 0clk         address set-up */
> +#define SMCBC_X_Tcos    (0x4)   /* 4clk         chip selection set-up */
> +#define SMCBC_X_Tacc    (0xe)   /* 14clk        access cycle */
> +#define SMCBC_X_Tcoh    (0x1)   /* 1clk         chip selection hold */
> +#define SMCBC_X_Tah     (0x4)   /* 4clk         address holding time */
> +#define SMCBC_X_Tacp    (0x6)   /* 6clk         page mode access cycle */
> +#define SMCBC_X_PMC     (0x0)   /* normal(1data)page mode configuration */

Please don't use lowercase at define
and () is unnecessary.
and.. what mean X is?

> +
> +#define SMC_BC_X_CON    ((SMCBC_X_Tacs<<28)|(SMCBC_X_Tcos<<24)| \
> +                        (SMCBC_X_Tacc<<16)|(SMCBC_X_Tcoh<<12)| \
> +                        (SMCBC_X_Tah<<8)|(SMCBC_X_Tacp<<4)|    \
> +                        (SMCBC_X_PMC))
> +
> +#ifndef __ASSEMBLY__
> +struct s5pc1xx_sromc {
> +       unsigned int    smc_bw;
> +       unsigned int    smc_bc[6];
> +};
> +#endif /* __ASSEMBLY__ */

smc_bw and smc_bc are already belong to sromc structure.
is "smc_" really need?
Please modify it to bw and bc or srom_bw and srom_bc (according to TRM)

> +
> +#endif /* __ASM_ARCH_MEM_H_ */
> --
> 1.6.6
>
> ___
> U-Boot mailing list
> U-Boot@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@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 3/3] SAMSUNG: SMDKC100: Adds ethernet support.

2010-02-09 Thread Ben Warren
Hi Naveen,

On 2/9/2010 8:53 PM, Naveen Krishna Ch wrote:
> Hi Ben,
>
> I think you wanted me to remove the CONFIG_BOOTP_* macros.
> But the gmail is showing some other code under ur comments.
>
> Any how i wil remove the CONFIG_BOOTP_* macros and submit a
> V2 version of the patch.
>
I don't have a problem with the CONFIG_BOOTP macros as long as you put 
them there intentionally rather than as a cut&paste.  My quarrel was 
with the MAC and IP address assignments.  It looks like you've removed 
those, so it's all OK.

regards,
Ben
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH V2 3/3] SAMSUNG: SMDKC100: Adds ethernet support.

2010-02-09 Thread Naveen Krishna Ch
From: Naveen Krishna CH 

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  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 
+#include 
+#include 
+
+#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_BASE0x98800300  /* 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@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 3/3] SAMSUNG: SMDKC100: Adds ethernet support.

2010-02-09 Thread Naveen Krishna Ch
Hi Ben,

I think you wanted me to remove the CONFIG_BOOTP_* macros.
But the gmail is showing some other code under ur comments.

Any how i wil remove the CONFIG_BOOTP_* macros and submit a
V2 version of the patch.

On 9 February 2010 20:22, Ben Warren  wrote:

> Naveen,
>
> On Tue, Feb 9, 2010 at 1:38 AM, Naveen Krishna Ch  >wrote:
>
> > From: Naveen Krishna CH 
> >
> > 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  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 
> > +#include 
> > +#include 
> > +
> > +#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_GATEWAYIP192.168.0.1
> > +
> >
> Please remove all of these.  If you don't know why, search the archives.
>  It's only been discussed 1 times or so.
>
I think you want me to remove macros starting from CONFIG_BOOTP_* macros
till CONFIG_GATWAYIP

>
> > +/*
> > + * 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_BASE0x98800300  /* SMC911X Drive Base
> */
> > +#define CONFIG_ENV_SROM_BANK   3   /* Select SROM Bank-3 for
> > Ethernet*/
> > +#endif /* CONFIG_CMD_NET */
> > +
> >  #endif /* __CONFIG_H */
>
This is code is needed to enable the ethernet driver and tftp command.

Thank You Ben,

>  >
> regards,
> Ben
>
> ___
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
>
>


-- 
Shine bright,
(: Naveen Krishna Ch :)
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 0/3] SAMSUNG: SMDKC100: Add Ethernet support.

2010-02-09 Thread Naveen Krishna Ch
Hi Kang,

On 10 February 2010 08:46, Minkyu Kang  wrote:

> Dear Naveen Krishna Ch,
>
> On 9 February 2010 18:22, Naveen Krishna Ch  wrote:
> > From: Naveen Krishna CH 
> >
> > This patch set Adds
> > A. A header file which contains the register description for
> >memory subsystem in S5PC1XX based baords.
> > B. A function to configure SROMC registers
> > A. Net support for SMDKC100 board.
> >
> > This patch set consists of the following patches.
> >
> > [PATCH 1/3] S5PC100: Memory SubSystem Header file, register
> description(SROMC).
> > [PATCH 2/3] S5PC100: Function to configure the SROMC registers.
> > [PATCH 3/3] SAMSUNG-SMDKC100-Adds-ethernet-support.
> >
> > TODO: Proper GPIO interface to be implemented.
> >
> I will post the GPIO Interface soon.
> And patch0 is unnecessary.

I thought of giving a description of patch set before posting them.,

>
> Thanks
> Minkyu Kang.
> --
> from. prom.
> www.promsoft.net
> ___
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
>



-- 
Shine bright,
(: Naveen Krishna Ch :)
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 0/3] SAMSUNG: SMDKC100: Add Ethernet support.

2010-02-09 Thread Minkyu Kang
Dear Naveen Krishna Ch,

On 9 February 2010 18:22, Naveen Krishna Ch  wrote:
> From: Naveen Krishna CH 
>
> This patch set Adds
> A. A header file which contains the register description for
>        memory subsystem in S5PC1XX based baords.
> B. A function to configure SROMC registers
> A. Net support for SMDKC100 board.
>
> This patch set consists of the following patches.
>
> [PATCH 1/3] S5PC100: Memory SubSystem Header file, register 
> description(SROMC).
> [PATCH 2/3] S5PC100: Function to configure the SROMC registers.
> [PATCH 3/3] SAMSUNG-SMDKC100-Adds-ethernet-support.
>
> TODO: Proper GPIO interface to be implemented.
>
I will post the GPIO Interface soon.
And patch0 is unnecessary.

Thanks
Minkyu Kang.
-- 
from. prom.
www.promsoft.net
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] SMSC LAN8720 support

2010-02-09 Thread Ben Warren
On 2/9/2010 1:04 PM, Maxim Podbereznyi wrote:
> Hi Ben!
>
> I've made LAN8720 work with AT91SAM9G45 MPU. The problem was in a 
> wrong address assigning during the PHY reset. The PHY has internal 
> pull-down on the PHYAD0 line but the init code for AT91 turns off 
> processor's pull-up during PHY reset only for a few lines and they are 
> not PHYAD0. So I disabled also the processor's pull-up to the right 
> line and the PHY got alive. I've tested tftp - works perfect!
>
> Thank you for the help!
>
You're welcome.  Congratulations!

--Ben
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v3] SPI: Fix 32 bit transfers in mxc_spi.c

2010-02-09 Thread Magnus Lilja
Commit f9b6a1575d9f1ca192e4cb60e547aa66f08baa3f,  "i.MX31: fix SPI
driver for shorter than 32 bit" broke 32 bit transfers. This patch
makes single 32 bit transfer work again.

Transfer lengths that are known not to work will abort and print
an error message.

Tested on i.MX31 Litekit and i.MX31 PDK using 32 bit transfers to
the MC13783/ATLAS chip (using the 'date' command).

Signed-off-by: Magnus Lilja 
---
Changes since v2: Changed bitlen != 32 to (bitlen % 32).

 drivers/spi/mxc_spi.c |9 +
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/drivers/spi/mxc_spi.c b/drivers/spi/mxc_spi.c
index fad9840..3a45200 100644
--- a/drivers/spi/mxc_spi.c
+++ b/drivers/spi/mxc_spi.c
@@ -131,6 +131,13 @@ int spi_xfer(struct spi_slave *slave, unsigned int bitlen, 
const void *dout,
return 1;
}
 
+   /* This driver is currently partly broken, alert the user */
+   if (bitlen > 16 && (bitlen % 32)) {
+   printf("Error: SPI transfer with bitlen=%d is broken.\n",
+  bitlen);
+   return 1;
+   }
+
for (i = 0, in_l = (u32 *)din, out_l = (u32 *)dout;
 i < n_blks;
 i++, in_l++, out_l++, bitlen -= 32) {
@@ -142,6 +149,8 @@ int spi_xfer(struct spi_slave *slave, unsigned int bitlen, 
const void *dout,
*(u8 *)din = data;
else if (bitlen < 17)
*(u16 *)din = data;
+   else
+   *in_l = data;
}
}
 
-- 
1.6.4.2

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] SMSC LAN8720 support

2010-02-09 Thread Maxim Podbereznyi
Hi Ben!

I've made LAN8720 work with AT91SAM9G45 MPU. The problem was in a wrong
address assigning during the PHY reset. The PHY has internal pull-down on
the PHYAD0 line but the init code for AT91 turns off processor's pull-up
during PHY reset only for a few lines and they are not PHYAD0. So I disabled
also the processor's pull-up to the right line and the PHY got alive. I've
tested tftp - works perfect!

Thank you for the help!

2010/2/8 Ben Warren 

> Hi Maxim,
>
> On 2/7/2010 1:32 PM, Maxim Podbereznyi wrote:
>
>> Hi all!
>>
>> I need enable the support of the new SMSC Ethernet PHY LAN8720 in
>> AT91SAM based system. Can anybody give me a piece of advice how I can
>> do it?
>>
>>
>>
>  I don't have any direct experience with either this PHY or AT91SAM, but a
> cursory glance of the PHY datasheet makes it seem that there's nothing
> special here, so it might just work without modification.  Do you have a
> working reference board that has a different PHY that this can be compared
> to?
>
>> Any help is appreciated!
>>
>> Regards,
>> Max
>> _
>>
>>
> regards,
> Ben
>
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] SMSC LAN8720 support

2010-02-09 Thread Ben Warren
Hi Maxim,

Two housekeeping items:
1. Please don't top-post
2. Please CC the mailing list.  There are others that may be able to 
help you.

On 2/9/2010 12:11 PM, Maxim Podbereznyi wrote:
> Hi Ben!
>
> Thank you for answering!
>
> Unfortunately I don't have any other board to check the Ethernet. I
> began to check sources and found that PHY ID is not read well.
>
> In the following code I have "No PHY present" on the console:
> /* Check if the PHY is up to snuff... */
>  phy_id = macb_mdio_read(macb, MII_PHYSID1);
>  if (phy_id == 0x) {
>  printf("%s: No PHY present\n", netdev->name);
>  return 0;
>  }
> }
>
> I think at least ID must be read well. Bad luck :(
>
>
Are you passing the correct PHY address as parameter 3 to 
macb_eth_initialize()?  You should know the address from the board 
schematic.  Alternatively, it appears that MACB has an option called 
CONFIG_MACB_SEARCH_PHY that will probe the MDIO bus.  You might wish to 
enable that option.

The MII_PHYSID1 is an IEEE 802.3-specified register.  If you can't read 
it, it's not anything peculiar to the new type of PHY, but more likely a 
hardware/bootstrap issue.   Any incompatibilities with this PHY will 
come later when you try to configure some of the less-standard things 
such as RGMII etc.

regards,
Ben
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] Support for the Calao USB-A9260/USB-A9G20 boards

2010-02-09 Thread Wolfgang Denk
Dear Gregory Hermant,

In message 
<1265637776-21295-1-git-send-email-gregory.herm...@calao-systems.com> you wrote:
> The Calao USB-A9260 and USB-9G20 boards are manufactured and sold by Calao 
> Systems
> . They are built around an AT91SAM9260 ARM SoC
> running at 180MHz and an AT91SAM9G20 ARM SoC running at 400MHz respectively.
> They feature an Ethernet port, 64Mo of SDRAM, 256Mo of NAND flash, two USB 
> host ports,
> and an USB device port. They also feature a FTDI2232 converter which provides 
> the ability
> to use the DBGU serial port & the JTAG port over a USB interface.
> 
> Signed-off-by: Gregory Hermant 
> ---
...
> +#include 
> +#undef CONFIG_CMD_BDI
> +#undef CONFIG_CMD_FPGA
> +#undef CONFIG_CMD_IMI
> +#undef CONFIG_CMD_IMLS
> +#undef CONFIG_CMD_LOADS
> +#undef CONFIG_CMD_SOURCE

Is there any special reason for disabling these commands? They are
usually considered pretty useful, and from the rest of your
configuration I don't believe you try to minimize the memory footprint
of the U-Boot image?



Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
Time is a drug. Too much of it kills you.
  - Terry Pratchett, _Small Gods_
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] doc: add README for CONFIG_HWCONFIG option

2010-02-09 Thread Mike Frysinger
On Tuesday 09 February 2010 09:50:30 Heiko Schocher wrote:
> +Enable this feature just define CONFIG_HWCONFIG in your board
> +config file.

To enable ...

> +This implements simple hwconfig infrastructure: an
> +interface for software knobs to control a hardware.

... a simple ...
... control hardware.

> +This is very simple implementation, i.e. it is implemented

... is a very ...

> +via `hwconfig' environment variable. Later we could write

... via the ...

> +1. Doesn't support options dependencies and mutual exclusion.
> +   We can implement this by integrating apt-get[3] into the
> +   u-boot. But I didn't bother yet.

... into Das U-Boot.
didn't -> haven't

> +2. Since we don't implement hwconfig command, i.e. we're working

... implement a hwconfig ...

> +   toggling a particular option will need a reboot to take
> +   an effect. So, for now it's advised to always reboot the

... take effect.

> +   target after modifying hwconfig variable.

... modifying the hwconfig ...

> +3. We support hwconfig options with arguments. For example,
> +
> +   set hwconfig "dr_usb:mode=peripheral,phy_type=ulpi"
> +
> +   There are three hwconfig options selected:

This selects three hwconfig options:

> +The purpose of this simple implementation is to define some
> +internal API and

... to refine the internal ...

> +and then we can continue improving user experience

... improving the user ...

> +by adding more mature interface, like hwconfig command with

interfaces
... like a hwconfig ...

> +bells and whistles. Or not adding, if we feel that current

... that the current ...

> +interface fits its needs.

... fits people's needs.
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2] da830evm: Add support for TI EMAC

2010-02-09 Thread Nick Thompson
On 09/02/10 16:47, Paulraj, Sandeep wrote:
>> Adds support for ethernet networking on the da830evm platform.
>>
>> This platform uses an SoC EMAC interface and a 3 port ethernet
>> switch as a PHY with an RMII interface. The PHY also has a i2c
>> interface for configuring the switch functions.
>>
>> Signed-off-by: Nick Thompson 
>> ---
>>  board/davinci/da830evm/da830evm.c|   65
>> +-
>>  include/asm-arm/arch-davinci/emac_defs.h |1 +
>>  include/configs/da830evm.h   |1 +
>>  3 files changed, 65 insertions(+), 2 deletions(-)
> 
> 
> Did you test this after integrating the EMAC driver patch in your tree?
> That patch ack'ed by Ben is not yet in my tree.
> 
> I've not yet done a rebase with wd's tree as most of the TI patches are only 
> in the ARM tree.

Hmm, yes. Maybe it's too early to put this in yet. I have the EMAC
patch here as Ben added to his tree, so it is tested correctly, but
there is no way it will work for anybody else :(

Since I only just submitted, its too early to add this to your tree
anyway, but feel free to wait until you tree is updated with the
EMAC patch, or else just NAK it and I'll resubmit later.

Its a minor point really: the da830 build is not broken by this
patch, but its presence implies functionality that doesn't
yet work and it might cause undefined behaviour.

Nick.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2] da830evm: Add support for TI EMAC

2010-02-09 Thread Nick Thompson
Adds support for ethernet networking on the da830evm platform.

This platform uses an SoC EMAC interface and a 3 port ethernet
switch as a PHY with an RMII interface. The PHY also has a i2c
interface for configuring the switch functions.

Signed-off-by: Nick Thompson 
---
 board/davinci/da830evm/da830evm.c|   65 +-
 include/asm-arm/arch-davinci/emac_defs.h |1 +
 include/configs/da830evm.h   |1 +
 3 files changed, 65 insertions(+), 2 deletions(-)

diff --git a/board/davinci/da830evm/da830evm.c 
b/board/davinci/da830evm/da830evm.c
index aac5c5c..ed668af 100644
--- a/board/davinci/da830evm/da830evm.c
+++ b/board/davinci/da830evm/da830evm.c
@@ -34,8 +34,11 @@
 
 #include 
 #include 
+#include 
+#include 
 #include 
 #include 
+#include 
 #include 
 #include "../common/misc.h"
 
@@ -69,6 +72,20 @@ static const struct pinmux_config emifa_nand_pins[] = {
{ pinmux[18], 1, 5 },
 };
 
+/* EMAC PHY interface pins */
+static const struct pinmux_config emac_pins[] = {
+   { pinmux[9], 0, 5 },
+   { pinmux[10], 2, 1 },
+   { pinmux[10], 2, 2 },
+   { pinmux[10], 2, 3 },
+   { pinmux[10], 2, 4 },
+   { pinmux[10], 2, 5 },
+   { pinmux[10], 2, 6 },
+   { pinmux[10], 2, 7 },
+   { pinmux[11], 2, 0 },
+   { pinmux[11], 2, 1 },
+};
+
 /* UART pin muxer settings */
 static const struct pinmux_config uart_pins[] = {
{ pinmux[8], 2, 7 },
@@ -77,8 +94,8 @@ static const struct pinmux_config uart_pins[] = {
 
 /* I2C pin muxer settings */
 static const struct pinmux_config i2c_pins[] = {
-   { pinmux[9], 2, 3 },
-   { pinmux[9], 2, 4 }
+   { pinmux[8], 2, 3 },
+   { pinmux[8], 2, 4 }
 };
 
 /* USB0_DRVVBUS pin muxer settings */
@@ -98,6 +115,9 @@ static const struct pinmux_resource pinmuxes[] = {
 #ifdef CONFIG_USE_NAND
PINMUX_ITEM(emifa_nand_pins),
 #endif
+#if defined(CONFIG_DRIVER_TI_EMAC)
+   PINMUX_ITEM(emac_pins),
+#endif
 };
 
 int board_init(void)
@@ -169,3 +189,44 @@ int board_init(void)
 
return(0);
 }
+
+#if defined(CONFIG_DRIVER_TI_EMAC)
+
+#define PHY_SW_I2C_ADDR0x5f /* Address of PHY on i2c bus */
+
+/*
+ * Initializes on-board ethernet controllers.
+ */
+int board_eth_init(bd_t *bis)
+{
+   u_int8_t mac_addr[6];
+   u_int8_t switch_start_cmd[2] = { 0x01, 0x23 };
+
+   /* Read Ethernet MAC address from EEPROM */
+   if (dvevm_read_mac_address(mac_addr))
+   /* set address env if not already set */
+   dv_configure_mac_address(mac_addr);
+
+   /* read the address back from env */
+   if (!eth_getenv_enetaddr("ethaddr", mac_addr))
+   return -1;
+
+   /* provide the resulting addr to the driver */
+   davinci_eth_set_mac_addr(mac_addr);
+
+   /* enable the Ethernet switch in the 3 port PHY */
+   if (i2c_write(PHY_SW_I2C_ADDR, 0, 0,
+   switch_start_cmd, sizeof(switch_start_cmd))) {
+   printf("Ethernet switch start failed!\n");
+   return -1;
+   }
+
+   /* finally, initialise the driver */
+   if (!davinci_emac_initialize()) {
+   printf("Error: Ethernet init failed!\n");
+   return -1;
+   }
+
+   return 0;
+}
+#endif /* CONFIG_DRIVER_TI_EMAC */
diff --git a/include/asm-arm/arch-davinci/emac_defs.h 
b/include/asm-arm/arch-davinci/emac_defs.h
index 96bc80e..75b8bf6 100644
--- a/include/asm-arm/arch-davinci/emac_defs.h
+++ b/include/asm-arm/arch-davinci/emac_defs.h
@@ -316,6 +316,7 @@ typedef struct  {
 
 int davinci_eth_phy_read(u_int8_t phy_addr, u_int8_t reg_num, u_int16_t *data);
 int davinci_eth_phy_write(u_int8_t phy_addr, u_int8_t reg_num, u_int16_t data);
+void davinci_eth_set_mac_addr(const u_int8_t *addr);
 
 typedef struct
 {
diff --git a/include/configs/da830evm.h b/include/configs/da830evm.h
index 65747fb..0f58e11 100644
--- a/include/configs/da830evm.h
+++ b/include/configs/da830evm.h
@@ -27,6 +27,7 @@
 /*
  * Board
  */
+#define CONFIG_DRIVER_TI_EMAC
 
 /*
  * SoC Configuration
-- 
1.6.3.3

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2] da830evm: Add support for TI EMAC

2010-02-09 Thread Paulraj, Sandeep


> 
> Adds support for ethernet networking on the da830evm platform.
> 
> This platform uses an SoC EMAC interface and a 3 port ethernet
> switch as a PHY with an RMII interface. The PHY also has a i2c
> interface for configuring the switch functions.
> 
> Signed-off-by: Nick Thompson 
> ---
>  board/davinci/da830evm/da830evm.c|   65
> +-
>  include/asm-arm/arch-davinci/emac_defs.h |1 +
>  include/configs/da830evm.h   |1 +
>  3 files changed, 65 insertions(+), 2 deletions(-)


Did you test this after integrating the EMAC driver patch in your tree?
That patch ack'ed by Ben is not yet in my tree.

I've not yet done a rebase with wd's tree as most of the TI patches are only in 
the ARM tree.


___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] da830evm: Add support for TI EMAC

2010-02-09 Thread Nick Thompson
On 09/02/10 16:20, Nick Thompson wrote:
> Adds support for ethernet networking on the da830evm platform.
> 
> This platform uses an SoC EMAC interface and a 3 port ethernet
> switch as a PHY with an RMII interface. The PHY also has a i2c
> interface for configuring the switch functions.
> 
> Signed-off-by: Nick Thompson 

This patch adds a new warning - sorry missed that during testing

A V2 patch is on the way
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] da830evm: Add support for TI EMAC

2010-02-09 Thread Nick Thompson
Adds support for ethernet networking on the da830evm platform.

This platform uses an SoC EMAC interface and a 3 port ethernet
switch as a PHY with an RMII interface. The PHY also has a i2c
interface for configuring the switch functions.

Signed-off-by: Nick Thompson 
---
 board/davinci/da830evm/da830evm.c|   64 +-
 include/asm-arm/arch-davinci/emac_defs.h |1 +
 include/configs/da830evm.h   |1 +
 3 files changed, 64 insertions(+), 2 deletions(-)

diff --git a/board/davinci/da830evm/da830evm.c 
b/board/davinci/da830evm/da830evm.c
index aac5c5c..389753c 100644
--- a/board/davinci/da830evm/da830evm.c
+++ b/board/davinci/da830evm/da830evm.c
@@ -34,6 +34,8 @@
 
 #include 
 #include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -69,6 +71,20 @@ static const struct pinmux_config emifa_nand_pins[] = {
{ pinmux[18], 1, 5 },
 };
 
+/* EMAC PHY interface pins */
+static const struct pinmux_config emac_pins[] = {
+   { pinmux[9], 0, 5 },
+   { pinmux[10], 2, 1 },
+   { pinmux[10], 2, 2 },
+   { pinmux[10], 2, 3 },
+   { pinmux[10], 2, 4 },
+   { pinmux[10], 2, 5 },
+   { pinmux[10], 2, 6 },
+   { pinmux[10], 2, 7 },
+   { pinmux[11], 2, 0 },
+   { pinmux[11], 2, 1 },
+};
+
 /* UART pin muxer settings */
 static const struct pinmux_config uart_pins[] = {
{ pinmux[8], 2, 7 },
@@ -77,8 +93,8 @@ static const struct pinmux_config uart_pins[] = {
 
 /* I2C pin muxer settings */
 static const struct pinmux_config i2c_pins[] = {
-   { pinmux[9], 2, 3 },
-   { pinmux[9], 2, 4 }
+   { pinmux[8], 2, 3 },
+   { pinmux[8], 2, 4 }
 };
 
 /* USB0_DRVVBUS pin muxer settings */
@@ -98,6 +114,9 @@ static const struct pinmux_resource pinmuxes[] = {
 #ifdef CONFIG_USE_NAND
PINMUX_ITEM(emifa_nand_pins),
 #endif
+#if defined(CONFIG_DRIVER_TI_EMAC)
+   PINMUX_ITEM(emac_pins),
+#endif
 };
 
 int board_init(void)
@@ -169,3 +188,44 @@ int board_init(void)
 
return(0);
 }
+
+#if defined(CONFIG_DRIVER_TI_EMAC)
+
+#define PHY_SW_I2C_ADDR0x5f /* Address of PHY on i2c bus */
+
+/*
+ * Initializes on-board ethernet controllers.
+ */
+int board_eth_init(bd_t *bis)
+{
+   u_int8_t mac_addr[6];
+   u_int8_t switch_start_cmd[2] = { 0x01, 0x23 };
+
+   /* Read Ethernet MAC address from EEPROM */
+   if (dvevm_read_mac_address(mac_addr))
+   /* set address env if not already set */
+   dv_configure_mac_address(mac_addr);
+
+   /* read the address back from env */
+   if (!eth_getenv_enetaddr("ethaddr", mac_addr))
+   return -1;
+
+   /* provide the resulting addr to the driver */
+   davinci_eth_set_mac_addr(mac_addr);
+
+   /* enable the Ethernet switch in the 3 port PHY */
+   if (i2c_write(PHY_SW_I2C_ADDR, 0, 0,
+   switch_start_cmd, sizeof(switch_start_cmd))) {
+   printf("Ethernet switch start failed!\n");
+   return -1;
+   }
+
+   /* finally, initialise the driver */
+   if (!davinci_emac_initialize()) {
+   printf("Error: Ethernet init failed!\n");
+   return -1;
+   }
+
+   return 0;
+}
+#endif /* CONFIG_DRIVER_TI_EMAC */
diff --git a/include/asm-arm/arch-davinci/emac_defs.h 
b/include/asm-arm/arch-davinci/emac_defs.h
index 96bc80e..75b8bf6 100644
--- a/include/asm-arm/arch-davinci/emac_defs.h
+++ b/include/asm-arm/arch-davinci/emac_defs.h
@@ -316,6 +316,7 @@ typedef struct  {
 
 int davinci_eth_phy_read(u_int8_t phy_addr, u_int8_t reg_num, u_int16_t *data);
 int davinci_eth_phy_write(u_int8_t phy_addr, u_int8_t reg_num, u_int16_t data);
+void davinci_eth_set_mac_addr(const u_int8_t *addr);
 
 typedef struct
 {
diff --git a/include/configs/da830evm.h b/include/configs/da830evm.h
index 65747fb..0f58e11 100644
--- a/include/configs/da830evm.h
+++ b/include/configs/da830evm.h
@@ -27,6 +27,7 @@
 /*
  * Board
  */
+#define CONFIG_DRIVER_TI_EMAC
 
 /*
  * SoC Configuration
-- 
1.6.3.3

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Problem linking u-boot-2009.11.1 with arm_v5t_le-ld

2010-02-09 Thread Wolfgang Denk
Dear "Andy Hawkins",

In message <002e01caa995$b5f42ca0$21dc85...@hawkins@cabletime.com> you wrote:
> Hi all,
> 
> Trying to compile the latest u-boot (u-boot-2009.11.1) for the
> davinci_dm6467evm, using a MontaVista toolset. We're getting the
> following error at the end of the compilation process:
> 
> arm_v5t_le-ld: /bin/sh: line 1:  2424 Segmentation fault

A segmentation fauls is always a severe error that should never
happen.

> arm_v5t_le-gcc --version
> arm_v5t_le-gcc (GCC) 3.4.3 (MontaVista 3.4.3-25.0.104.0600975
> 2006-07-06)
...
> Can anyone offer any assistance?

Please contact MontaVista technical support and ask for a fix for
their broken tools.

Or use free, working tools instead.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
Wisdom is one of the few things that looks bigger the further away it
is.   - Terry Pratchett, _Witches Abroad_
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] Problem linking u-boot-2009.11.1 with arm_v5t_le-ld

2010-02-09 Thread Andy Hawkins
Hi all,

Trying to compile the latest u-boot (u-boot-2009.11.1) for the
davinci_dm6467evm, using a MontaVista toolset. We're getting the
following error at the end of the compilation process:

arm_v5t_le-ld: /bin/sh: line 1:  2424 Segmentation fault
arm_v5t_le-ld -Bstatic -T u-boot.lds -Ttext 0x8108
cpu/arm926ejs/start.o --start-group lib_generic/libgeneric.a
lib_generic/lzma/liblzma.a lib_generic/lzo/liblzo.a
board/davinci/common/libdavinci.a cpu/arm926ejs/libarm926ejs.a
cpu/arm926ejs/davinci/libdavinci.a lib_arm/libarm.a
fs/cramfs/libcramfs.a fs/fat/libfat.a fs/fdos/libfdos.a
fs/jffs2/libjffs2.a fs/reiserfs/libreiserfs.a fs/ext2/libext2fs.a
fs/yaffs2/libyaffs2.a fs/ubifs/libubifs.a net/libnet.a disk/libdisk.a
drivers/bios_emulator/libatibiosemu.a drivers/block/libblock.a
drivers/dma/libdma.a drivers/fpga/libfpga.a drivers/gpio/libgpio.a
drivers/hwmon/libhwmon.a drivers/i2c/libi2c.a drivers/input/libinput.a
drivers/misc/libmisc.a drivers/mmc/libmmc.a drivers/mtd/libmtd.a
drivers/mtd/nand/libnand.a drivers/mtd/onenand/libonenand.a
drivers/mtd/ubi/libubi.a drivers/mtd/spi/libspi_flash.a
drivers/net/libnet.a drivers/net/phy/libphy.a
drivers/net/sk98lin/libsk98lin.a drivers/pci/libpci.a
drivers/pcmcia/libpcmcia.a drivers/power/libpower.a
drivers/spi/libspi.a drivers/rtc/librtc.a drivers/serial/libserial.a
drivers/twserial/libtws.a drivers/usb/gadget/libusb_gadget.a
drivers/usb/host/libusb_host.a drivers/usb/musb/libusb_musb.a
drivers/video/libvideo.a drivers/watchdog/libwatchdog.a
common/libcommon.a libfdt/libfdt.a api/libapi.a post/libpost.a
board/davinci/dm6467evm/libdm6467evm.a --end-group -L
/opt/montavista-arm/pro/devkit/arm/v5t_le/bin/../lib/gcc/armv5tl-monta
vista-linuxeabi/3.4.3 -lgcc -o u-boot
make: *** [u-boot] Error 139

I found a message from back in June of 2004 about an issue with
binutils 2.15
(http://lists.denx.de/pipermail/u-boot/2004-June/005482.html), so I
removed the map file creation from the Makefile. However, this hasn't
helped.

Relevant versions:

arm_v5t_le-gcc --version
arm_v5t_le-gcc (GCC) 3.4.3 (MontaVista 3.4.3-25.0.104.0600975
2006-07-06)

arm_v5t_le-ld --version
GNU ld version 2.15.94 20041215

Using the same toolchain, I can successfully compile u-boot-1.2.0
using the davinci_dm646x configuration.

Can anyone offer any assistance?

Thanks

Andy


___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 3/3] SAMSUNG: SMDKC100: Adds ethernet support.

2010-02-09 Thread Ben Warren
Naveen,

On Tue, Feb 9, 2010 at 1:38 AM, Naveen Krishna Ch wrote:

> From: Naveen Krishna CH 
>
> 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  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 
> +#include 
> +#include 
> +
> +#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_GATEWAYIP192.168.0.1
> +
>
Please remove all of these.  If you don't know why, search the archives.
 It's only been discussed 1 times or so.

> +/*
> + * 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_BASE0x98800300  /* SMC911X Drive Base   */
> +#define CONFIG_ENV_SROM_BANK   3   /* Select SROM Bank-3 for
> Ethernet*/
> +#endif /* CONFIG_CMD_NET */
> +
>  #endif /* __CONFIG_H */
>
regards,
Ben
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] doc: add README for CONFIG_HWCONFIG option

2010-02-09 Thread Heiko Schocher
Signed-off-by: Heiko Schocher 
---
 doc/README.hwconfig |   51 +++
 1 files changed, 51 insertions(+), 0 deletions(-)
 create mode 100644 doc/README.hwconfig

diff --git a/doc/README.hwconfig b/doc/README.hwconfig
new file mode 100644
index 000..dd5bdd8
--- /dev/null
+++ b/doc/README.hwconfig
@@ -0,0 +1,51 @@
+Enable this feature just define CONFIG_HWCONFIG in your board
+config file.
+
+This implements simple hwconfig infrastructure: an
+interface for software knobs to control a hardware.
+
+This is very simple implementation, i.e. it is implemented
+via `hwconfig' environment variable. Later we could write
+some "hwconfig " commands, ncurses
+interface for Award BIOS-like interface, and frame-buffer
+interface for AMI GUI[1] BIOS-like interface with mouse
+support[2].
+
+Current implementation details/limitations:
+
+1. Doesn't support options dependencies and mutual exclusion.
+   We can implement this by integrating apt-get[3] into the
+   u-boot. But I didn't bother yet.
+
+2. Since we don't implement hwconfig command, i.e. we're working
+   with the environement directly, there is no way to tell that
+   toggling a particular option will need a reboot to take
+   an effect. So, for now it's advised to always reboot the
+   target after modifying hwconfig variable.
+
+3. We support hwconfig options with arguments. For example,
+
+   set hwconfig "dr_usb:mode=peripheral,phy_type=ulpi"
+
+   There are three hwconfig options selected:
+   1. dr_usb - enable Dual-Role USB controller;
+   2. dr_usb_mode:peripheral - USB in Function mode;
+   3. dr_usb_phy_type:ulpi - USB should work with ULPI PHYs.
+
+The purpose of this simple implementation is to define some
+internal API and then we can continue improving user experience
+by adding more mature interface, like hwconfig command with
+bells and whistles. Or not adding, if we feel that current
+interface fits its needs.
+
+[1] http://en.wikipedia.org/wiki/American_Megatrends
+[2] Regarding ncurses and GUI with mouse support -- I'm just
+kidding.
+[3] The comment regarding apt-get is also a joke, meaning that
+dependency tracking could be non-trivial. For example, for
+enabling HW feature X we may need to disable Y, and turn Z
+into reduced mode (like RMII-only interface for ethernet,
+no MII).
+
+It's quite trivial to implement simple cases though.
+
-- 
1.6.2.5

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 2/2] TQM8xx: enable device tree support on all TQM8xx based boards.

2010-02-09 Thread Heiko Schocher
also enable support for CONFIG_HWCONFIG, because we use this
feature for configuring, if this hardware has an fec or not.
So we can adjust the DTS, if there is a fec or not.

syntax:

hwconfig=fec:on   if hardware has an fec
hwconfig=fec:off  if hardware has no fec

Signed-off-by: Heiko Schocher 
Signed-off-by: Wolfgang Denk 
---
 include/configs/FPS850L.h  |5 +
 include/configs/FPS860L.h  |5 +
 include/configs/HMI10.h|5 +
 include/configs/NSCU.h |5 +
 include/configs/SM850.h|5 +
 include/configs/TK885D.h   |5 +
 include/configs/TQM823L.h  |5 +
 include/configs/TQM823M.h  |5 +
 include/configs/TQM850L.h  |5 +
 include/configs/TQM850M.h  |5 +
 include/configs/TQM855L.h  |5 +
 include/configs/TQM855M.h  |5 +
 include/configs/TQM860L.h  |5 +
 include/configs/TQM860M.h  |5 +
 include/configs/TQM862L.h  |5 +
 include/configs/TQM862M.h  |5 +
 include/configs/TQM866M.h  |5 +
 include/configs/TQM885D.h  |5 +
 include/configs/virtlab2.h |6 ++
 19 files changed, 96 insertions(+), 0 deletions(-)

diff --git a/include/configs/FPS850L.h b/include/configs/FPS850L.h
index 1190656..addca2f 100644
--- a/include/configs/FPS850L.h
+++ b/include/configs/FPS850L.h
@@ -437,4 +437,9 @@
 #defineBOOTFLAG_COLD   0x01/* Normal Power-On: Boot from 
FLASH */
 #define BOOTFLAG_WARM  0x02/* Software reboot  
*/

+/* pass open firmware flat tree */
+#define CONFIG_OF_LIBFDT   1
+#define CONFIG_OF_BOARD_SETUP  1
+#define CONFIG_HWCONFIG1
+
 #endif /* __CONFIG_H */
diff --git a/include/configs/FPS860L.h b/include/configs/FPS860L.h
index 73b..ec9000d 100644
--- a/include/configs/FPS860L.h
+++ b/include/configs/FPS860L.h
@@ -439,4 +439,9 @@

 #define CONFIG_SCC1_ENET

+/* pass open firmware flat tree */
+#define CONFIG_OF_LIBFDT   1
+#define CONFIG_OF_BOARD_SETUP  1
+#define CONFIG_HWCONFIG1
+
 #endif /* __CONFIG_H */
diff --git a/include/configs/HMI10.h b/include/configs/HMI10.h
index 88e1946..2747d8c 100644
--- a/include/configs/HMI10.h
+++ b/include/configs/HMI10.h
@@ -496,4 +496,9 @@
 #define BOOTFLAG_COLD  0x01/* Normal Power-On: Boot from FLASH 
*/
 #define BOOTFLAG_WARM  0x02/* Software reboot  
*/

+/* pass open firmware flat tree */
+#define CONFIG_OF_LIBFDT   1
+#define CONFIG_OF_BOARD_SETUP  1
+#define CONFIG_HWCONFIG1
+
 #endif /* __CONFIG_H */
diff --git a/include/configs/NSCU.h b/include/configs/NSCU.h
index 5dd72ff..5724f45 100644
--- a/include/configs/NSCU.h
+++ b/include/configs/NSCU.h
@@ -487,4 +487,9 @@
 #define CONFIG_FEC_ENET
 /* #define CONFIG_ETHPRIME "FEC ETHERNET" */

+/* pass open firmware flat tree */
+#define CONFIG_OF_LIBFDT   1
+#define CONFIG_OF_BOARD_SETUP  1
+#define CONFIG_HWCONFIG1
+
 #endif /* __CONFIG_H */
diff --git a/include/configs/SM850.h b/include/configs/SM850.h
index 7266f9a..56f03e2 100644
--- a/include/configs/SM850.h
+++ b/include/configs/SM850.h
@@ -372,4 +372,9 @@
 #defineBOOTFLAG_COLD   0x01/* Normal Power-On: Boot from 
FLASH */
 #define BOOTFLAG_WARM  0x02/* Software reboot  
*/

+/* pass open firmware flat tree */
+#define CONFIG_OF_LIBFDT   1
+#define CONFIG_OF_BOARD_SETUP  1
+#define CONFIG_HWCONFIG1
+
 #endif /* __CONFIG_H */
diff --git a/include/configs/TK885D.h b/include/configs/TK885D.h
index 1e6d9ce..0df1b6e 100644
--- a/include/configs/TK885D.h
+++ b/include/configs/TK885D.h
@@ -516,4 +516,9 @@
 #define CONFIG_NET_RETRY_COUNT 3
 #define CONFIG_ETHPRIME"FEC ETHERNET"

+/* pass open firmware flat tree */
+#define CONFIG_OF_LIBFDT   1
+#define CONFIG_OF_BOARD_SETUP  1
+#define CONFIG_HWCONFIG1
+
 #endif /* __CONFIG_H */
diff --git a/include/configs/TQM823L.h b/include/configs/TQM823L.h
index 966beae..372c76d 100644
--- a/include/configs/TQM823L.h
+++ b/include/configs/TQM823L.h
@@ -490,4 +490,9 @@
 #defineBOOTFLAG_COLD   0x01/* Normal Power-On: Boot from 
FLASH */
 #define BOOTFLAG_WARM  0x02/* Software reboot  
*/

+/* pass open firmware flat tree */
+#define CONFIG_OF_LIBFDT   1
+#define CONFIG_OF_BOARD_SETUP  1
+#define CONFIG_HWCONFIG1
+
 #endif /* __CONFIG_H */
diff --git a/include/configs/TQM823M.h b/include/configs/TQM823M.h
index cfa693d..64c9707 100644
--- a/include/configs/TQM823M.h
+++ b/include/configs/TQM823M.h
@@ -486,4 +486,9 @@
 #defineBOOTFLAG_COLD   0x01/* Normal Power-On: Boot from 
FLASH */
 #define BOOTFLAG_WARM  0x02/* Software reboot  
*/

+/* pass open firmware flat tree */
+#define CONFIG_OF_LIBFDT   1
+#define CONFIG_OF_BOARD_SETUP  1
+#define CONFIG_HWCONFIG

[U-Boot] [PATCH 1/2] TQM8xx: add device tree support for TQM8xx based boards.

2010-02-09 Thread Heiko Schocher
also use hwconfig feature for configuring, if this hardware
has an fec or not. So we can adjust the DTS, if there is a fec
or not.

syntax:

hwconfig=fec:on   if hardware has an fec
hwconfig=fec:off  if hardware has no fec

Signed-off-by: Heiko Schocher 
Signed-off-by: Wolfgang Denk 
---
 board/tqc/tqm8xx/tqm8xx.c |  119 +
 1 files changed, 119 insertions(+), 0 deletions(-)

diff --git a/board/tqc/tqm8xx/tqm8xx.c b/board/tqc/tqm8xx/tqm8xx.c
index f92c598..53f79e8 100644
--- a/board/tqc/tqm8xx/tqm8xx.c
+++ b/board/tqc/tqm8xx/tqm8xx.c
@@ -22,11 +22,16 @@
  */

 #include 
+#include 
 #include 
 #ifdef CONFIG_PS2MULT
 #include 
 #endif

+#if defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_OF_LIBFDT)
+#include 
+#endif
+
 extern flash_info_t flash_info[];  /* FLASH chips info */

 DECLARE_GLOBAL_DATA_PTR;
@@ -599,6 +604,120 @@ void lcd_show_board_info(void)
 }
 #endif /* CONFIG_LCD_INFO */

+/*
+ * Device Tree Support
+ */
+#if defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_OF_LIBFDT)
+int fdt_set_node_and_value (void *blob,
+   char *nodename,
+   char *regname,
+   void *var,
+   int size)
+{
+   int ret = 0;
+   int nodeoffset = 0;
+
+   nodeoffset = fdt_path_offset (blob, nodename);
+   if (nodeoffset >= 0) {
+   ret = fdt_setprop (blob, nodeoffset, regname, var,
+   size);
+   if (ret < 0) {
+   printf("ft_blob_update(): "
+   "cannot set %s/%s property; err: %s\n",
+   nodename, regname, fdt_strerror (ret));
+   }
+   } else {
+   printf("ft_blob_update(): "
+   "cannot find %s node err:%s\n",
+   nodename, fdt_strerror (nodeoffset));
+   }
+   return ret;
+}
+
+int fdt_del_node_name (void *blob, char *nodename)
+{
+   int ret = 0;
+   int nodeoffset = 0;
+
+   nodeoffset = fdt_path_offset (blob, nodename);
+   if (nodeoffset >= 0) {
+   ret = fdt_del_node (blob, nodeoffset);
+   if (ret < 0) {
+   printf("%s: cannot delete %s; err: %s\n",
+   __func__, nodename, fdt_strerror (ret));
+   }
+   } else {
+   printf("%s: cannot find %s node err:%s\n",
+   __func__, nodename, fdt_strerror (nodeoffset));
+   }
+   return ret;
+}
+
+int fdt_del_prop_name (void *blob, char *nodename, char *propname)
+{
+   int ret = 0;
+   int nodeoffset = 0;
+
+   nodeoffset = fdt_path_offset (blob, nodename);
+   if (nodeoffset >= 0) {
+   ret = fdt_delprop (blob, nodeoffset, propname);
+   if (ret < 0) {
+   printf("%s: cannot delete %s %s; err: %s\n",
+   __func__, nodename, propname,
+   fdt_strerror (ret));
+   }
+   } else {
+   printf("%s: cannot find %s node err:%s\n",
+   __func__, nodename, fdt_strerror (nodeoffset));
+   }
+   return ret;
+}
+
+/*
+ * update "brg" property in the blob
+ */
+void ft_blob_update (void *blob, bd_t *bd)
+{
+   uchar enetaddr[6];
+   ulong brg_data = 0;
+
+   /* BRG */
+   brg_data = cpu_to_be32(bd->bi_busfreq);
+   fdt_set_node_and_value(blob,
+   "/soc/cpm", "brg-frequency",
+   &brg_data, sizeof(brg_data));
+
+   /* MAC addr */
+   if (eth_getenv_enetaddr("ethaddr", enetaddr)) {
+   fdt_set_node_and_value(blob,
+   "ethernet0", "local-mac-address",
+   enetaddr, sizeof(u8) * 6);
+   }
+
+   if (hwconfig_arg_cmp("fec", "off")) {
+   /* no FEC on this plattform, delete DTS nodes */
+   fdt_del_node_name (blob, "ethernet1");
+   fdt_del_node_name (blob, "mdio1");
+   /* also the aliases entries */
+   fdt_del_prop_name (blob, "/aliases", "ethernet1");
+   fdt_del_prop_name (blob, "/aliases", "mdio1");
+   } else {
+   /* adjust local-mac-address for FEC ethernet */
+   if (eth_getenv_enetaddr("eth1addr", enetaddr)) {
+   fdt_set_node_and_value(blob,
+   "ethernet1", "local-mac-address",
+   enetaddr, sizeof(u8) * 6);
+   }
+   }
+}
+
+void ft_board_setup(void *blob, bd_t *bd)
+{
+   ft_cpu_setup(blob, bd);
+   ft_blob_update(blob, bd);
+}
+#endif /* defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_OF_LIBFDT) */
+
 /* 
 */
 /* TK885D spe

[U-Boot] [PATCH] VoiceBlue: limit line lenght to 80 characters

2010-02-09 Thread Ladislav Michl
From: Ladislav Michl 

Reindent configuration header to limit line lenght to 80 characters by
removing obvious and sometimes misleading comments.

Signed-off-by: Ladislav Michl 
---
 voiceblue.h |  164 +---
 1 file changed, 80 insertions(+), 84 deletions(-)

diff --git a/include/configs/voiceblue.h b/include/configs/voiceblue.h
index 0dde65d..d46717c 100644
--- a/include/configs/voiceblue.h
+++ b/include/configs/voiceblue.h
@@ -31,8 +31,8 @@
 #define CONFIG_OMAP1510 1  /* which is in a 5910 */
 
 /* Input clock of PLL */
-#define CONFIG_SYS_CLK_FREQ15000   /* 150MHz input clock */
-#define CONFIG_XTAL_FREQ   1200
+#define CONFIG_SYS_CLK_FREQ15000   /* 150MHz */
+#define CONFIG_XTAL_FREQ   1200/*  12MHz */
 
 #undef CONFIG_USE_IRQ  /* we don't need IRQ/FIQ stuff */
 
@@ -48,55 +48,53 @@
 /*
  * Physical Memory Map
  */
-#define CONFIG_NR_DRAM_BANKS   1   /* we have 1 bank of DRAM */
-#define PHYS_SDRAM_1   0x1000  /* SDRAM Bank #1 */
-#define PHYS_SDRAM_1_SIZE  (64 * 1024 * 1024)
+#define CONFIG_NR_DRAM_BANKS   1
+#define PHYS_SDRAM_1   0x1000
+#define PHYS_SDRAM_1_SIZE  (64 * 1024 * 1024)
+#define PHYS_FLASH_1   0x000
 
-#define PHYS_FLASH_1   0x  /* Flash Bank #1 */
-
-#define CONFIG_SYS_LOAD_ADDR   PHYS_SDRAM_1 + 0x40 /* default load 
address */
-
-/*
- * FLASH organization
- */
-#define CONFIG_SYS_FLASH_CFI   /* Flash is CFI conformant */
-#define CONFIG_FLASH_CFI_DRIVER/* Use the common driver */
-#define CONFIG_SYS_MAX_FLASH_BANKS 1
-#define CONFIG_SYS_FLASH_BASE  PHYS_FLASH_1
-
-/* FIXME: Does not work on AMD flash */
-/* #define CONFIG_SYS_FLASH_USE_BUFFER_WRITE 1 */  /* use buffered writes 
(20x faster) */
-#define CONFIG_SYS_MAX_FLASH_SECT  512 /* max # of sectors on one chip 
*/
-
-#define CONFIG_SYS_MONITOR_BASEPHYS_FLASH_1
+#define CONFIG_SYS_MONITOR_BASEPHYS_FLASH_1
 #define CONFIG_SYS_MONITOR_LEN (256 * 1024)
 
 /*
  * Environment settings
  */
 #define CONFIG_ENV_IS_IN_FLASH
-#define CONFIG_ENV_ADDR(PHYS_FLASH_1 + CONFIG_SYS_MONITOR_LEN)
-#define CONFIG_ENV_SIZE(8 * 1024)
-#define CONFIG_ENV_SECT_SIZE   (64 * 1024)
-#define CONFIG_ENV_ADDR_REDUND (CONFIG_ENV_ADDR + CONFIG_ENV_SECT_SIZE)
-#define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE
+#define CONFIG_ENV_ADDR(PHYS_FLASH_1 + 
CONFIG_SYS_MONITOR_LEN)
+#define CONFIG_ENV_SIZE(8 * 1024)
+#define CONFIG_ENV_SECT_SIZE   (64 * 1024)
+#define CONFIG_ENV_ADDR_REDUND (CONFIG_ENV_ADDR + CONFIG_ENV_SECT_SIZE)
+#define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE
 
 #define CONFIG_ENV_OVERWRITE
 
 /*
  * Size of malloc() pool and stack
  */
-#define CONFIG_SYS_GBL_DATA_SIZE   128 /* size in bytes reserved for 
initial data */
+#define CONFIG_SYS_GBL_DATA_SIZE   128
 #define CONFIG_SYS_MALLOC_LEN  (4 * 1024 * 1024)
-#define CONFIG_STACKSIZE   (1 * 1024 * 1024)
-#define PHYS_SDRAM_1_RESERVED  (CONFIG_SYS_MONITOR_LEN + CONFIG_SYS_MALLOC_LEN 
+ CONFIG_STACKSIZE)
+#define CONFIG_STACKSIZE   (1 * 1024 * 1024)
 
 /*
  * Hardware drivers
  */
+#define CONFIG_SYS_NS16550
+#define CONFIG_SYS_NS16550_SERIAL
+#define CONFIG_SYS_NS16550_REG_SIZE(-4)
+#define CONFIG_SYS_NS16550_CLK (CONFIG_XTAL_FREQ)
+#define CONFIG_SYS_NS16550_COM1OMAP1510_UART1_BASE
+
 #define CONFIG_NET_MULTI
 #define CONFIG_SMC9
-#define CONFIG_SMC9_BASE   0x08000300
+#define CONFIG_SMC9_BASE   0x08000300
+
+#define CONFIG_SYS_FLASH_BASE  PHYS_FLASH_1
+#define CONFIG_SYS_MAX_FLASH_BANKS 1
+#define CONFIG_SYS_MAX_FLASH_SECT  512
+
+#define CONFIG_SYS_FLASH_CFI
+#define CONFIG_FLASH_CFI_DRIVER
+#define CONFIG_SYS_FLASH_USE_BUFFER_WRITE
 
 #define CONFIG_HARD_I2C
 #define CONFIG_SYS_I2C_SPEED   10
@@ -104,24 +102,16 @@
 #define CONFIG_DRIVER_OMAP1510_I2C
 
 #define CONFIG_RTC_DS1307
-#define CONFIG_SYS_I2C_RTC_ADDR0x68
+#define CONFIG_SYS_I2C_RTC_ADDR0x68
 
-/*
- * NS16550 Configuration
- */
-#define CONFIG_SYS_NS16550
-#define CONFIG_SYS_NS16550_SERIAL
-#define CONFIG_SYS_NS16550_REG_SIZE(-4)
-#define CONFIG_SYS_NS16550_CLK (CONFIG_XTAL_FREQ)  /* can be 
12M/32Khz or 48Mhz  */
-#define CONFIG_SYS_NS16550_COM1OMAP1510_UART1_BASE /* uart1 */
 
-#define CONFIG_CONS_INDEX  1
-#define CONFIG_BAUDRATE115200
+#define CONFIG_CONS_INDEX  1
+#define CONFIG_BAUDRATE115200
 #define CONFIG_SYS_BAUDRATE_TABLE  { 9600, 19200, 38400, 57600, 115200 }
 
 
 /*
- * Command line configuration.
+ * Command line configuration
  */
 #include 
 
@@ -138,7 

[U-Boot] [PATCH] VoiceBlue: fix linker errors

2010-02-09 Thread Ladislav Michl
From: Ladislav Michl 

linking eeprom with libgeneric.a is not really needed and causes following
error:
../../lib_generic/libgeneric.a(string.o): In function `strcmp':
/home/ladis/src/u-boot-ti/lib_generic/string.c:152: multiple definition of 
`strcmp'
../../examples/standalone/libstubs.a(stubs.o):include/_exports.h:24: first 
defined here
make[1]: *** [eeprom.srec] Error 1

Fix undefined reference to memset generated by some versions of gcc
to zero out initialized structure on the stack:
eeprom.o: In function `eeprom':
board/voiceblue/eeprom.c:152: undefined reference to `memset'
make[1]: *** [eeprom] Error 1

Signed-off-by: Ladislav Michl 
---
 board/voiceblue/Makefile   |   33 ++---
 board/voiceblue/eeprom.c   |   97 ---
 board/voiceblue/eeprom.lds |   51 -
 board/voiceblue/eeprom_start.S |   11 -
 4 files changed, 65 insertions(+), 127 deletions(-)
 delete mode 100644 board/voiceblue/eeprom.lds
 delete mode 100644 board/voiceblue/eeprom_start.S

diff --git a/board/voiceblue/Makefile b/board/voiceblue/Makefile
index 121c717..0067f05 100644
--- a/board/voiceblue/Makefile
+++ b/board/voiceblue/Makefile
@@ -29,40 +29,37 @@ LIB = $(obj)lib$(BOARD).a
 COBJS  := voiceblue.o
 SOBJS  := setup.o
 
-SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c) eeprom.c eeprom_start.S
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS   := $(addprefix $(obj),$(COBJS))
 SOBJS  := $(addprefix $(obj),$(SOBJS))
 
-gcclibdir := $(shell dirname `$(CC) -print-libgcc-file-name`)
-
 LOAD_ADDR = 0x1040
-LDSCRIPT = $(TOPDIR)/board/$(BOARDDIR)/eeprom.lds
-lnk = $(if $(obj),$(obj),.)
+
+#
 
 all:   $(obj).depend $(LIB) $(obj)eeprom.srec $(obj)eeprom.bin
 
 $(LIB):$(OBJS) $(SOBJS)
-   $(AR) $(ARFLAGS) $@ $(OBJS) $(SOBJS)
+   $(AR) $(ARFLAGS) $@ $^
+
+$(obj)eeprom_start.o:
+   echo "b eeprom" | $(CC) $(AFLAGS) -c -x assembler -o $@ -
 
-$(obj)eeprom.srec: $(obj)eeprom.o $(obj)eeprom_start.o $(obj)u-boot.lds
-   cd $(lnk) && $(LD) -T $(obj)u-boot.lds -g -Ttext $(LOAD_ADDR) \
-   -o $(<:.o=) -e eeprom eeprom.o eeprom_start.o \
+$(obj)eeprom:  $(obj)eeprom_start.o $(obj)eeprom.o
+   $(LD) -Ttext $(LOAD_ADDR) -e eeprom -o $@ $^ \
-L$(obj)../../examples/standalone -lstubs \
-   -L$(obj)../../lib_generic -lgeneric \
-   -L$(gcclibdir) -lgcc
-   $(OBJCOPY) -O srec $(<:.o=) $@
+   $(PLATFORM_LIBS)
 
-$(obj)eeprom.bin:  $(obj)eeprom.srec
-   $(OBJCOPY) -I srec -O binary $< $@ 2>/dev/null
+$(obj)eeprom.srec: $(obj)eeprom
+   $(OBJCOPY) -S -O srec $(<:.o=) $@
 
-$(obj)u-boot.lds: $(LDSCRIPT)
-   $(CPP) $(CPPFLAGS) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - <$^ >$@
+$(obj)eeprom.bin:  $(obj)eeprom
+   $(OBJCOPY) -S -O binary $< $@
 
 clean:
rm -f $(SOBJS) $(OBJS) $(obj)eeprom \
$(obj)eeprom.srec $(obj)eeprom.bin \
-   $(obj)eeprom.o $(obj)eeprom_start.o \
-$(obj)u-boot.lds
+   $(obj)eeprom.o $(obj)eeprom_start.o
 
 distclean: clean
rm -f $(LIB) core *.bak $(obj).depend
diff --git a/board/voiceblue/eeprom.c b/board/voiceblue/eeprom.c
index 2ae46d1..f7e0ba5 100644
--- a/board/voiceblue/eeprom.c
+++ b/board/voiceblue/eeprom.c
@@ -22,75 +22,82 @@
  * Some code shamelessly stolen back from Robin Getz.
  */
 
-#define DEBUG
-
 #include 
 #include 
 #include 
 #include 
 #include "../drivers/net/smc9.h"
 
-static u16 read_eeprom_reg(struct eth_device *dev, u16 reg)
+static struct eth_device dev = {
+   .iobase = CONFIG_SMC9_BASE
+};
+
+static u16 read_eeprom_reg(u16 reg)
 {
int timeout;
 
-   SMC_SELECT_BANK(dev, 2);
-   SMC_outw(dev, reg, PTR_REG);
+   SMC_SELECT_BANK(&dev, 2);
+   SMC_outw(&dev, reg, PTR_REG);
+
+   SMC_SELECT_BANK(&dev, 1);
+   SMC_outw(&dev, SMC_inw(&dev, CTL_REG) | CTL_EEPROM_SELECT |
+   CTL_RELOAD, CTL_REG);
 
-   SMC_SELECT_BANK(dev, 1);
-   SMC_outw(dev, SMC_inw (dev, CTL_REG) | CTL_EEPROM_SELECT | CTL_RELOAD,
-CTL_REG);
timeout = 100;
-   while((SMC_inw (dev, CTL_REG) & CTL_RELOAD) && --timeout)
+
+   while ((SMC_inw(&dev, CTL_REG) & CTL_RELOAD) && --timeout)
udelay(100);
if (timeout == 0) {
-   printf("Timeout Reading EEPROM register %02x\n", reg);
+   printf("Timeout reading register %02x\n", reg);
return 0;
}
 
-   return SMC_inw (dev, GP_REG);
+   return SMC_inw(&dev, GP_REG);
 }
 
-static int write_eeprom_reg(struct eth_device *dev, u16 value, u16 reg)
+static int write_eeprom_reg(u16 value, u16 reg)
 {
int timeout;
 
-   SMC_SELECT_BANK(dev, 2);
-   SMC_outw(dev, reg, PTR_REG);
+   SMC_SELECT_BANK(&dev, 2);
+   SMC_outw(&dev, reg, PTR_REG);
+
+   SMC_SELECT_BANK(&dev, 1);
+
+   

[U-Boot] [PATCH 3/3] SAMSUNG: SMDKC100: Adds ethernet support.

2010-02-09 Thread Naveen Krishna Ch
From: Naveen Krishna CH 

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  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 
+#include 
+#include 
+
+#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_GATEWAYIP192.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_BASE0x98800300  /* 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@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 2/3] S5PC100: Function to configure the SROMC registers.

2010-02-09 Thread Naveen Krishna Ch
From: Naveen Krishna CH 

Nand Flash, Ethernet, other features might need to configure the
SROMC registers accordingly.
The config_sromc() functions helps with this.

Signed-off-by: Naveen Krishna Ch  samsung.com>
---
 cpu/arm_cortexa8/s5pc1xx/Makefile  |1 +
 cpu/arm_cortexa8/s5pc1xx/sromc.c   |   49 
 include/asm-arm/arch-s5pc1xx/mem.h |3 ++
 3 files changed, 53 insertions(+), 0 deletions(-)
 create mode 100644 cpu/arm_cortexa8/s5pc1xx/sromc.c

diff --git a/cpu/arm_cortexa8/s5pc1xx/Makefile 
b/cpu/arm_cortexa8/s5pc1xx/Makefile
index 4f922e6..0a6a9b4 100644
--- a/cpu/arm_cortexa8/s5pc1xx/Makefile
+++ b/cpu/arm_cortexa8/s5pc1xx/Makefile
@@ -34,6 +34,7 @@ SOBJS += reset.o
 COBJS  += clock.o
 COBJS  += cpu_info.o
 COBJS  += timer.o
+COBJS  += sromc.o
 
 SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS   := $(addprefix $(obj),$(COBJS) $(SOBJS))
diff --git a/cpu/arm_cortexa8/s5pc1xx/sromc.c b/cpu/arm_cortexa8/s5pc1xx/sromc.c
new file mode 100644
index 000..96ca9e0
--- /dev/null
+++ b/cpu/arm_cortexa8/s5pc1xx/sromc.c
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2010 Samsung Electronics
+ * Naveen Krishna Ch 
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include 
+#include 
+#include 
+
+/*
+ * config_sromc() - select the proper SROMC Bank and configure the
+ * band width control and bank control registers
+ * srom_bank   - SROM Bank 0 to 5
+ * smc_bw_conf  - SMC Band witdh reg configuration value
+ * smc_bc_conf  - SMC Bank Control reg configuration value
+ */
+void config_sromc(u32 srom_bank, u32 smc_bw_conf, u32 smc_bc_conf)
+{
+   u32 tmp;
+   struct s5pc1xx_sromc *const srom =
+   (struct s5pc1xx_sromc *)S5PC100_SROMC_BASE;
+
+   /* Configure SMC_BW register to handle proper SROMC bank */
+   tmp = srom->smc_bw;
+   tmp &= ~(0xF << (srom_bank * 4));
+   tmp |= smc_bw_conf;
+   srom->smc_bw = tmp;
+
+   /* Configure SMC_BC register */
+   srom->smc_bc[srom_bank] = smc_bc_conf;
+}
diff --git a/include/asm-arm/arch-s5pc1xx/mem.h 
b/include/asm-arm/arch-s5pc1xx/mem.h
index 66272ff..99b2d2e 100644
--- a/include/asm-arm/arch-s5pc1xx/mem.h
+++ b/include/asm-arm/arch-s5pc1xx/mem.h
@@ -52,4 +52,7 @@ struct s5pc1xx_sromc {
 };
 #endif /* __ASSEMBLY__ */
 
+/* Configure the Band Width and Bank Control Regs for required SROMC Bank */
+void config_sromc(u32 srom_bank, u32 smc_bw_conf, u32 smc_bc_conf);
+
 #endif /* __ASM_ARCH_MEM_H_ */
-- 
1.6.6

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 1/3] S5PC100: Memory SubSystem Header file, register description(SROMC).

2010-02-09 Thread Naveen Krishna Ch
From: Naveen Krishna CH 

Memory subsystem of S5PC100 handles SROM, SRAM, OneDRAM, OneNand,
NAND Flash, DDRs.
mem.h is a common place for the register description of Memory subsystem
of S5PC100.
Note: Only SROM related registers are descibed now.

Signed-off-by: Naveen Krishna Ch  samsung.com>
---
 include/asm-arm/arch-s5pc1xx/mem.h |   55 
 1 files changed, 55 insertions(+), 0 deletions(-)
 create mode 100644 include/asm-arm/arch-s5pc1xx/mem.h

diff --git a/include/asm-arm/arch-s5pc1xx/mem.h 
b/include/asm-arm/arch-s5pc1xx/mem.h
new file mode 100644
index 000..66272ff
--- /dev/null
+++ b/include/asm-arm/arch-s5pc1xx/mem.h
@@ -0,0 +1,55 @@
+/*
+ * (C) Copyright 2010 Samsung Electronics
+ * Naveen Krishna Ch 
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ * Note: This file contains the register description for Memory subsystem
+ *  (SROM, NAND Flash, OneNand, DDR, OneDRAM) on S5PC1XX.
+ *
+ *  Only SROMC is defined as of now
+ */
+
+#ifndef __ASM_ARCH_MEM_H_
+#define __ASM_ARCH_MEM_H_
+
+#define SROM_DATA16_WIDTH(x)(1<<((x*4)+0))
+#define SROM_BYTE_ADDR_MODE(x)  (1<<((x*4)+1))  /* 0-> Half-word base address*/
+   /* 1-> Byte base address*/
+#define SROM_WAIT_ENABLE(x) (1<<((x*4)+2))
+#define SROM_BYTE_ENABLE(x) (1<<((x*4)+3))
+
+#define SMCBC_X_Tacs(0x0)   /* 0clk address set-up */
+#define SMCBC_X_Tcos(0x4)   /* 4clk chip selection set-up */
+#define SMCBC_X_Tacc(0xe)   /* 14clkaccess cycle */
+#define SMCBC_X_Tcoh(0x1)   /* 1clk chip selection hold */
+#define SMCBC_X_Tah (0x4)   /* 4clk address holding time */
+#define SMCBC_X_Tacp(0x6)   /* 6clk page mode access cycle */
+#define SMCBC_X_PMC (0x0)   /* normal(1data)page mode configuration */
+
+#define SMC_BC_X_CON((SMCBC_X_Tacs<<28)|(SMCBC_X_Tcos<<24)| \
+(SMCBC_X_Tacc<<16)|(SMCBC_X_Tcoh<<12)| \
+(SMCBC_X_Tah<<8)|(SMCBC_X_Tacp<<4)|\
+(SMCBC_X_PMC))
+
+#ifndef __ASSEMBLY__
+struct s5pc1xx_sromc {
+   unsigned intsmc_bw;
+   unsigned intsmc_bc[6];
+};
+#endif /* __ASSEMBLY__ */
+
+#endif /* __ASM_ARCH_MEM_H_ */
-- 
1.6.6

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 0/3] SAMSUNG: SMDKC100: Add Ethernet support.

2010-02-09 Thread Naveen Krishna Ch
From: Naveen Krishna CH 

This patch set Adds
A. A header file which contains the register description for
memory subsystem in S5PC1XX based baords.
B. A function to configure SROMC registers
A. Net support for SMDKC100 board.

This patch set consists of the following patches.

[PATCH 1/3] S5PC100: Memory SubSystem Header file, register description(SROMC).
[PATCH 2/3] S5PC100: Function to configure the SROMC registers.
[PATCH 3/3] SAMSUNG-SMDKC100-Adds-ethernet-support.

TODO: Proper GPIO interface to be implemented.

Thanks & Best regards. 
Naveen
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 0/2] SAMSUNG: SMDKC100: Add Ethernet support.

2010-02-09 Thread Naveen Krishna Ch
From: Naveen Krishna CH 

This patch set Adds
A. A header file which contains the register description for
memory subsystem in S5PC1XX based baords.
B. A function to configure SROMC registers
A. Net support for SMDKC100 board.

This patch set consists of the following patches.

[PATCH 1/3] S5PC100: Memory SubSystem Header file, register description(SROMC).
[PATCH 2/3] S5PC100: Function to configure the SROMC registers.
[PATCH 3/3] SAMSUNG-SMDKC100-Adds-ethernet-support.

TODO: Proper GPIO interface to be implemented.

Thanks & Best regards. 
Naveen
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2] s3c64xx: Add ifdef at the S3C64XX only codes

2010-02-09 Thread Minkyu Kang
Dear Joonyoung Shim,

On 8 February 2010 22:00, Joonyoung Shim  wrote:
> The s3c6400.h file is only for S3C64XX cpu and the pheripheral port
> address(0x7000 - 0x7fff) exists at only S3C64XX cpu, so they
> should be included by only S3C64XX cpu.
>
> Signed-off-by: Joonyoung Shim 
> ---
>  cpu/arm1176/cpu.c   |    2 ++
>  cpu/arm1176/start.S |    4 
>  2 files changed, 6 insertions(+), 0 deletions(-)
>

applied to u-boot-samsung

Thanks
Minkyu Kang
-- 
from. prom.
www.promsoft.net
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] netstar.h: do not exceed 80 columns

2010-02-09 Thread Ladislav Michl
From: Ladislav Michl 

Limit line length to 80 characters mostly by removing obvious and sometimes
misleading comments. Fix indentation, too.

Signed-off-by: Ladislav Michl 
---
 netstar.h |   65 +-
 1 file changed, 31 insertions(+), 34 deletions(-)

diff --git a/include/configs/netstar.h b/include/configs/netstar.h
index edda3ce..c63c846 100644
--- a/include/configs/netstar.h
+++ b/include/configs/netstar.h
@@ -27,17 +27,13 @@
 
 #include 
 
-/*
- * High Level Configuration Options
- * (easy to change)
- */
 #define CONFIG_ARM925T 1   /* This is an arm925t CPU */
 #define CONFIG_OMAP1   /* in a TI OMAP core */
 #define CONFIG_OMAP1510 1  /* which is in a 5910 */
 
 /* Input clock of PLL */
-#define CONFIG_SYS_CLK_FREQ15000   /* 150MHz input clock */
-#define CONFIG_XTAL_FREQ   1200
+#define CONFIG_SYS_CLK_FREQ15000   /* 150MHz */
+#define CONFIG_XTAL_FREQ   1200/*  12MHz */
 
 #undef CONFIG_USE_IRQ  /* we don't need IRQ/FIQ stuff */
 
@@ -54,10 +50,10 @@
 /*
  * Physical Memory Map
  */
-#define CONFIG_NR_DRAM_BANKS   1   /* we have 1 bank of DRAM */
-#define PHYS_SDRAM_1   0x1000  /* SDRAM Bank #1 */
-#define PHYS_SDRAM_1_SIZE  (64 * 1024 * 1024)
-#define PHYS_FLASH_1   0x  /* Flash Bank #1 */
+#define CONFIG_NR_DRAM_BANKS   1
+#define PHYS_SDRAM_1   0x1000
+#define PHYS_SDRAM_1_SIZE  (64 * 1024 * 1024)
+#define PHYS_FLASH_1   0x
 
 #define CONFIG_SYS_MONITOR_BASEPHYS_FLASH_1
 #define CONFIG_SYS_MONITOR_LEN (256 * 1024)
@@ -66,23 +62,23 @@
  * Environment settings
  */
 #define CONFIG_ENV_IS_IN_FLASH
-#define CONFIG_ENV_ADDR0x4000
-#define CONFIG_ENV_SIZE(8 * 1024)
-#define CONFIG_ENV_SECT_SIZE   (8 * 1024)
-#define CONFIG_ENV_ADDR_REDUND 0x6000
-#define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE
+#define CONFIG_ENV_ADDR0x4000
+#define CONFIG_ENV_SIZE(8 * 1024)
+#define CONFIG_ENV_SECT_SIZE   (8 * 1024)
+#define CONFIG_ENV_ADDR_REDUND 0x6000
+#define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE
 #define CONFIG_ENV_OVERWRITE
 
 /*
  * Size of malloc() pool
  */
-#define CONFIG_SYS_GBL_DATA_SIZE   128 /* size in bytes reserved for 
initial data */
+#define CONFIG_SYS_GBL_DATA_SIZE   128
 #define CONFIG_SYS_MALLOC_LEN  (4 * 1024 * 1024)
 
 /*
  * The stack size is set up in start.S using the settings below
  */
-#define CONFIG_STACKSIZE   (1 * 1024 * 1024)   /* regular stack */
+#define CONFIG_STACKSIZE   (1 * 1024 * 1024)
 
 /*
  * Hardware drivers
@@ -90,8 +86,8 @@
 #define CONFIG_SYS_NS16550
 #define CONFIG_SYS_NS16550_SERIAL
 #define CONFIG_SYS_NS16550_REG_SIZE(-4)
-#define CONFIG_SYS_NS16550_CLK (CONFIG_XTAL_FREQ)  /* can be 
12M/32Khz or 48Mhz  */
-#define CONFIG_SYS_NS16550_COM1OMAP1510_UART1_BASE /* 
uart1 */
+#define CONFIG_SYS_NS16550_CLK (CONFIG_XTAL_FREQ)
+#define CONFIG_SYS_NS16550_COM1OMAP1510_UART1_BASE
 
 #define CONFIG_NET_MULTI
 #define CONFIG_SMC9
@@ -128,10 +124,10 @@
 /*#define CONFIG_SKIP_LOWLEVEL_INIT */
 
 /*
- * partitions (mtdparts command line support)
+ * Partitions (mtdparts command line support)
  */
 #define CONFIG_CMD_MTDPARTS
-#define CONFIG_MTD_DEVICE  /* needed for mtdparts commands */
+#define CONFIG_MTD_DEVICE
 #define CONFIG_FLASH_CFI_MTD
 #define MTDIDS_DEFAULT "nor0=physmap-flash.0,nand0=gen_nand.0"
 #define MTDPARTS_DEFAULT   "mtdparts=" \
@@ -139,7 +135,7 @@
"gen_nand.0:4M(kernel0),40M(rootfs0),4M(kernel1),40M(rootfs1),-(data)"
 
 /*
- * Command line configuration.
+ * Command line configuration
  */
 #define CONFIG_CMD_BDI
 #define CONFIG_CMD_BOOTD
@@ -204,12 +200,13 @@
 /*
  * Miscellaneous configurable options
  */
-#define CONFIG_SYS_LONGHELP/* undef to save memory 
*/
-#define CONFIG_SYS_PROMPT  "# "/* Monitor Command 
Prompt   */
-#define CONFIG_SYS_CBSIZE  256 /* Console I/O Buffer 
Size  */
-#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE+sizeof(CONFIG_SYS_PROMPT)+16) /* 
Print Buffer Size */
-#define CONFIG_SYS_MAXARGS 16  /* max number of 
command args   */
-#define CONFIG_SYS_BARGSIZECONFIG_SYS_CBSIZE   /* Boot 
Argument Buffer Size*/
+#define CONFIG_SYS_LONGHELP
+#define CONFIG_SYS_PROMPT  "# "
+#define CONFIG_SYS_CBSIZE  256
+#define CONFIG_SYS_PBSIZE  (CONFIG_SYS_CBSIZE + \
+sizeof(CONFIG_SYS_PROMPT) + 16)
+#define CONFIG_SYS_MAXARGS 16
+#define CONFIG_SYS_BARGSIZECONFIG_SYS_CBSIZE
 
 #define CONFIG_SYS_HUSH_PARSER