Re: [U-Boot] [PATCH] ARM: Update maintainer of board scb9328

2011-07-05 Thread Stefano Babic
On 07/04/2011 11:34 AM, Torsten Koschorrek wrote:
> Torsten Koschorrek wrote:
>> Signed-off-by: Torsten Koschorrek
>> ---
>>MAINTAINERS |2 +-
>>1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/MAINTAINERS b/MAINTAINERS
>> index c462ae2..fe578ef 100644
>> --- a/MAINTAINERS
>> +++ b/MAINTAINERS
>> @@ -684,7 +684,7 @@ Matthias Kaehlcke
>>  edb9315 ARM920T (EP9315)
>>  edb9315aARM920T (EP9315)
>>-Konstantin Kletschke
>> +Torsten Koschorrek
>>  scb9328 ARM920T
>> Nishant Kamat
> 
> What about this patch? I don't see it in master yet...

Hi Torsten,

sorry for delay. Please send your patches in CC also to the maintainer
for part you want to change.

You must maintain the order of the list. If you check, except some
errors, the list is sorted by the alphabetical name of the developers.
Please fix it.

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: off...@denx.de
=
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 1/2] Armada100: MFP macro naming correction

2011-07-05 Thread Ajay Bhargav
MFP macros for UART3 updated.

Signed-off-by: Ajay Bhargav 
---
 arch/arm/include/asm/arch-armada100/mfp.h |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/include/asm/arch-armada100/mfp.h 
b/arch/arm/include/asm/arch-armada100/mfp.h
index 73783a7..d6e0494 100644
--- a/arch/arm/include/asm/arch-armada100/mfp.h
+++ b/arch/arm/include/asm/arch-armada100/mfp.h
@@ -57,8 +57,8 @@
 #define MFP89_UART2_TXD(MFP_REG(0x0164) | MFP_AF2 | 
MFP_DRIVE_MEDIUM)
 
 /* UART3 */
-#define MFPO8_UART3_RXD(MFP_REG(0x06c) | MFP_AF2 | 
MFP_DRIVE_MEDIUM)
-#define MFPO9_UART3_TXD(MFP_REG(0x070) | MFP_AF2 | 
MFP_DRIVE_MEDIUM)
+#define MFPO8_UART3_TXD(MFP_REG(0x06c) | MFP_AF2 | 
MFP_DRIVE_MEDIUM)
+#define MFPO9_UART3_RXD(MFP_REG(0x070) | MFP_AF2 | 
MFP_DRIVE_MEDIUM)
 
 /* I2c */
 #define MFP105_CI2C_SDA(MFP_REG(0x1a4) | MFP_AF1 | 
MFP_DRIVE_MEDIUM)
-- 
1.7.0.4

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


Re: [U-Boot] [PATCH] build: Add targets for auto gen of asm-offsets.h and use it in imx35

2011-07-05 Thread Stefano Babic
On 06/30/2011 05:24 PM, Matthias Weisser wrote:
> asm-offsets.h should be auto generated. This patch adds two rules to rules.mk
> which makes this possible and removes the rules on imx35.
> 
> Signed-off-by: Matthias Weisser 
> ---
>  arch/arm/cpu/arm1136/mx35/Makefile |   11 ---
>  rules.mk   |   10 ++
>  2 files changed, 10 insertions(+), 11 deletions(-)
> 
> diff --git a/arch/arm/cpu/arm1136/mx35/Makefile 
> b/arch/arm/cpu/arm1136/mx35/Makefile
> index 20f36e3..284cdc5 100644
> --- a/arch/arm/cpu/arm1136/mx35/Makefile
> +++ b/arch/arm/cpu/arm1136/mx35/Makefile
> @@ -50,14 +50,3 @@ include $(SRCTREE)/rules.mk
>  sinclude $(obj).depend
>  

Applied to u-boot-imx, thanks.

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: off...@denx.de
=
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] mx31pdk: cosmetic: Fix line over 80 characters

2011-07-05 Thread Stefano Babic
On 07/04/2011 09:29 PM, Fabio Estevam wrote:
> Signed-off-by: Fabio Estevam 
> ---
>  include/configs/mx31pdk.h |6 --
>  1 files changed, 4 insertions(+), 2 deletions(-)

Applied to u-boot-imx, thanks.

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: off...@denx.de
=
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] mx27: Make the UART port number explicit

2011-07-05 Thread Stefano Babic
On 07/01/2011 07:15 PM, Fabio Estevam wrote:
> mx27_uart_init_pins does the IOMUX setting for UART1 port.
> 
> Change the function name to make the UART port number explicit.
> 
> Signed-off-by: Fabio Estevam 
> ---

Applied to u-boot-imx, thanks.

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: off...@denx.de
=
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 2/2] Armada100: Add Board Support for Marvell GuruPlug-Display

2011-07-05 Thread Ajay Bhargav
This patch adds basic board support with DRAM and UART functionality

v2 - Updated MAINTAINERS file as suggested by Prafulla.

Signed-off-by: Ajay Bhargav 
Acked-by: Tanmay Upadhyay 
---
 MAINTAINERS   |4 ++
 MAKEALL   |1 +
 board/Marvell/gplugd/Makefile |   57 +++
 board/Marvell/gplugd/gplugd.c |   62 +
 boards.cfg|1 +
 include/configs/gplugd.h  |   87 +
 6 files changed, 212 insertions(+), 0 deletions(-)
 create mode 100644 board/Marvell/gplugd/Makefile
 create mode 100644 board/Marvell/gplugd/gplugd.c
 create mode 100644 include/configs/gplugd.h

diff --git a/MAINTAINERS b/MAINTAINERS
index e2c48a8..0b0c53d 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -590,6 +590,10 @@ Eric Benard 
cpu9260 ARM926EJS (AT91SAM9260 SoC)
cpu9G20 ARM926EJS (AT91SAM9G20 SoC)
 
+Ajay Bhargav 
+
+   gplugd  ARM926EJS (ARMADA100 88AP168 SoC)
+
 Rishi Bhattacharya 
 
omap5912osk ARM926EJS
diff --git a/MAKEALL b/MAKEALL
index d592374..259da84 100755
--- a/MAKEALL
+++ b/MAKEALL
@@ -388,6 +388,7 @@ LIST_ARM9=" \
davinci_dm355leopard\
davinci_dm365evm\
davinci_dm6467evm   \
+   gplugd  \
 "
 
 #
diff --git a/board/Marvell/gplugd/Makefile b/board/Marvell/gplugd/Makefile
new file mode 100644
index 000..2d8bba0
--- /dev/null
+++ b/board/Marvell/gplugd/Makefile
@@ -0,0 +1,57 @@
+#
+# (C) Copyright 2011
+# eInfochips Ltd. 
+# Written-by: Ajay Bhargav 
+#
+# Based on Aspenite:
+# (C) Copyright 2010
+# Marvell Semiconductor 
+# Written-by: Prafulla Wadaskar 
+# Contributor: Mahavir Jain 
+#
+# 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., 51 Franklin Street, Fifth Floor, Boston,
+# MA 02110-1301 USA
+#
+
+include $(TOPDIR)/config.mk
+
+LIB = $(obj)lib$(BOARD).o
+
+COBJS  := gplugd.o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):$(obj).depend $(OBJS) $(SOBJS)
+   $(AR) $(ARFLAGS) $@ $(OBJS) $(SOBJS)
+
+clean:
+   rm -f $(SOBJS) $(OBJS)
+
+distclean: clean
+   rm -f $(LIB) core *.bak .depend
+
+#
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
diff --git a/board/Marvell/gplugd/gplugd.c b/board/Marvell/gplugd/gplugd.c
new file mode 100644
index 000..dc7d89d
--- /dev/null
+++ b/board/Marvell/gplugd/gplugd.c
@@ -0,0 +1,62 @@
+/*
+ * (C) Copyright 2011
+ * eInfochips Ltd. 
+ * Written-by: Ajay Bhargav 
+ *
+ * Based on Aspenite:
+ * (C) Copyright 2010
+ * Marvell Semiconductor 
+ * Written-by: Prafulla Wadaskar 
+ * Contributor: Mahavir Jain 
+ *
+ * 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., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301 USA
+ */
+
+#include 
+#include 
+#include 
+#include 
+
+DECLARE_GLOBAL_DATA_PTR;
+
+int board_early_init_f(void)
+{
+   u32 mfp_cfg[] = {
+   /* I2C */
+   MFP105_CI2C_SDA,
+   MFP106_CI2C_SCL,
+
+   /* Enable Console on UART3 */
+   MFPO8_UART3_TXD,
+   MFPO9_UART3_RXD,
+   MFP_EOC /*End of configuration*/
+   };
+   /* configure MFP's */
+   mfp_config(mfp_cfg

Re: [U-Boot] [PATCH] i2c:gpio:s5p: I2C GPIO Software implementation

2011-07-05 Thread Heiko Schocher
Hello Mike,

Mike Frysinger wrote:
> On Tuesday, July 05, 2011 08:23:41 Lukasz Majewski wrote:
>> This commit adds I2C software support for Samsung's S5PC110
>> family of processors.
>> The generic drivers/i2c/soft_i2c framework is used, with
>> routines provided by this commit.
> 
> if you simply implemented the generic gpio layer (asm/gpio.h), the soft_i2c.c 
> code already handles gluing to GPIO pins.  then you wouldnt need a sep driver 
> at all.  you can see the bf561-ezkit already using this code.
> -mike

Yes, that was my thought too. No seperate i2c driver should be needed
here.

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 v2] Armada100: Add Board Support for Marvell GuruPlug-Display

2011-07-05 Thread Prafulla Wadaskar


> -Original Message-
> From: Ajay Bhargav [mailto:ajay.bhar...@einfochips.com]
> Sent: Tuesday, July 05, 2011 12:47 PM
> To: Prafulla Wadaskar
> Cc: u-boot@lists.denx.de; Ajay Bhargav
> Subject: [PATCH v2] Armada100: Add Board Support for Marvell GuruPlug-
> Display
> 
> This patch adds basic board support with DRAM and UART functionality
> 
> v2 - Updated MAINTAINERS file as suggested by Prafulla.
> 
> Signed-off-by: Ajay Bhargav 
> Acked-by: Tanmay Upadhyay 
> ---
>  MAINTAINERS   |4 +
>  MAKEALL   |1 +
>  arch/arm/include/asm/arch-armada100/mfp.h |4 +-

The change in this file is generic and not related to this board.
So please split the patch into two.

Rest everything looks okay to me.

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


Re: [U-Boot] [PATCH 0/1] mmc: S5P: Support DMA restarts at buffer boundaries

2011-07-05 Thread Jaehoon Chung
Tested-by : Jaehoon Chung 

Anton Staaf wrote:
> I don't actually have an S5P machine to test this patch with.  I wrote this
> code while fixing an issue with the in progress Tegra MMC device driver that
> is based on the S5P driver.  I have tested this patch on that platform.  If
> someone with an S5P could give this a whirl that would be great.
> 
> Cc: Minkyu Kang 
> Cc: Jaehoon Chung 
> Cc: Albert ARIBAUD 
> 
> Anton Staaf (1):
>   mmc: S5P: Support DMA restarts at buffer boundaries
> 
>  drivers/mmc/s5p_mmc.c |   15 +++
>  1 files changed, 11 insertions(+), 4 deletions(-)
> 

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


Re: [U-Boot] 83xx u-boot build failures

2011-07-05 Thread Kim Phillips
On Thu, 30 Jun 2011 20:59:23 -0500
Kumar Gala  wrote:

> Boards with warnings or errors: 5 ( MPC8313ERDB_NAND_33 MPC8313ERDB_NAND_66 
> MPC8315ERDB_NAND SIMPC8313_LP SIMPC8313_SP )
> 
> seeing:
> 
> arch/powerpc/cpu/mpc83xx/start.o: In function `in_ram':
> /local/home/galak/git/u-boot/arch/powerpc/cpu/mpc83xx/start.S:948: undefined 
> reference to `__fixup_entries'
> powerpc-linux-gnu-ld: arch/powerpc/cpu/mpc83xx/start.o(.text+0x35a2): 
> unresolvable R_PPC_SECTOFF_LO relocation against symbol `__fixup_entries'
> make: *** [u-boot] Error 1

I don't see this on WD's ToT:

$ ./MAKEALL MPC8313ERDB_NAND_33
Configuring for MPC8313ERDB_NAND_33 - Board: MPC8313ERDB, Options: 
SYS_33MHZ,NAND_U_BOOT
   textdata bss dec hex filename
 259168   25424   42096  326688   4fc20 ./u-boot

- SUMMARY 
Boards compiled: 1
--
$ git describe 
v2011.06-50-g7964209
$ ${CROSS_COMPILE}gcc --version | head -1
powerpc-linux-gnu-gcc (Sourcery G++ Lite 2010.09-55) 4.5.1
$ ${CROSS_COMPILE}ld --version | head -1
GNU ld (Sourcery G++ Lite 2010.09-55) 2.20.51.20100809

Kim

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


[U-Boot] Your Ad ,

2011-07-05 Thread duloiscarole
Hello,

 your ad on http://www.universfreeads.com/ads.php 


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


Re: [U-Boot] [PATCH 2/2] mtd/nand : workaround for Freescale FCM to supportlarge-page Nand chip

2011-07-05 Thread Mike Hench
It works. It is awesome to be able to do this.
If you are interested, and this isn't pretty
This a patch against 2010-06 uboot.
(been busy, but this was too good to ignore)

I will try to find some time to make it better
But for now comments are appreciated.
The Makefile and environment variable hack is ugly.

I Was going to add error checking and 2 copies of u-boot
(if a page fails, get it from the second copy)
This has an additional hack to fake the subpages.

diff -purN orig/drivers/mtd/nand/fsl_elbc_nand.c
u-boot-2010.06/drivers/mtd/nand/fsl_elbc_nand.c
--- orig/drivers/mtd/nand/fsl_elbc_nand.c   2011-06-30
14:11:27.304294055 -0500
+++ u-boot-2010.06/drivers/mtd/nand/fsl_elbc_nand.c 2011-06-30
14:10:46.880516050 -0500
@@ -86,6 +86,10 @@ struct fsl_elbc_ctrl {
unsigned int use_mdr;/* Non zero if the MDR is to be set
*/
unsigned int oob;/* Non zero if operating on OOB data
*/
uint8_t *oob_poi;/* Place to write ECC after read back
*/
+
+   int subpage_shift;   /* If writesize > 2048, these two
members*/
+   int subpage_mask;/* are used to calculate the real page
*/
+/* address and real column address   */
 };
 
 /* These map to the positions used by the FCM hardware ECC generator */
@@ -173,10 +177,20 @@ static void set_addr(struct mtd_info *mt
struct fsl_elbc_ctrl *ctrl = priv->ctrl;
fsl_lbus_t *lbc = ctrl->regs;
int buf_num;
+   u32 real_ca = column;
+
+   if (priv->page_size && ctrl->subpage_shift) {
+   real_ca = (page_addr & ctrl->subpage_mask) * 2112;
+   page_addr >>= ctrl->subpage_shift;
+   }
 
ctrl->page = page_addr;
 
if (priv->page_size) {
+   real_ca += (oob ? 2048 : 0);
+   ctrl->use_mdr = 1;
+   ctrl->mdr = real_ca;
+
out_be32(&lbc->fbar, page_addr >> 6);
out_be32(&lbc->fpar,
 ((page_addr << FPAR_LP_PI_SHIFT) & FPAR_LP_PI)
|
@@ -265,11 +279,12 @@ static void fsl_elbc_do_read(struct nand
 
if (priv->page_size) {
out_be32(&lbc->fir,
-(FIR_OP_CW0 << FIR_OP0_SHIFT) |
-(FIR_OP_CA  << FIR_OP1_SHIFT) |
-(FIR_OP_PA  << FIR_OP2_SHIFT) |
-(FIR_OP_CW1 << FIR_OP3_SHIFT) |
-(FIR_OP_RBW << FIR_OP4_SHIFT));
+   (FIR_OP_CW0 << FIR_OP0_SHIFT) |
+   (FIR_OP_UA  << FIR_OP1_SHIFT) |
+   (FIR_OP_UA  << FIR_OP2_SHIFT) |
+   (FIR_OP_PA  << FIR_OP3_SHIFT) |
+   (FIR_OP_CW1 << FIR_OP4_SHIFT) |
+   (FIR_OP_RBW << FIR_OP5_SHIFT));
 
out_be32(&lbc->fcr, (NAND_CMD_READ0 << FCR_CMD0_SHIFT) |
(NAND_CMD_READSTART <<
FCR_CMD1_SHIFT));
@@ -399,10 +414,11 @@ static void fsl_elbc_cmdfunc(struct mtd_
 
out_be32(&lbc->fir,
 (FIR_OP_CW0 << FIR_OP0_SHIFT) |
-(FIR_OP_CA  << FIR_OP1_SHIFT) |
-(FIR_OP_PA  << FIR_OP2_SHIFT) |
-(FIR_OP_WB  << FIR_OP3_SHIFT) |
-(FIR_OP_CW1 << FIR_OP4_SHIFT));
+(FIR_OP_UA  << FIR_OP1_SHIFT) |
+(FIR_OP_UA  << FIR_OP2_SHIFT) |
+(FIR_OP_PA  << FIR_OP3_SHIFT) |
+(FIR_OP_WB  << FIR_OP4_SHIFT) |
+(FIR_OP_CW1 << FIR_OP5_SHIFT));
} else {
fcr = (NAND_CMD_PAGEPROG << FCR_CMD1_SHIFT) |
  (NAND_CMD_SEQIN << FCR_CMD2_SHIFT);
@@ -453,6 +469,10 @@ static void fsl_elbc_cmdfunc(struct mtd_
full_page = 1;
}
 
+   if (priv->page_size)
+   ctrl->use_mdr = 1;
+
+
fsl_elbc_run_command(mtd);
 
ctrl->oob_poi = NULL;
@@ -808,3 +828,29 @@ int board_nand_init(struct nand_chip *na
 
return 0;
 }
+
+int board_nand_init_tail(struct mtd_info *mtd)
+{
+   struct nand_chip *chip = mtd->priv;
+   struct fsl_elbc_mtd *priv = chip->priv;
+   struct fsl_elbc_ctrl *ctrl = priv->ctrl;
+
+   /* Hack for supporting the flash chip whose writesize is
+* larger than 2K bytes.
+*/
+   if (mtd->writesize > 2048) {
+   ctrl->subpage_shift = ffs(mtd->writesize >> 11) - 1;
+   ctrl->subpage_mask =
+   (1 << ctrl->subpage_shift) - 1;
+   /* Rewrite mtd->writesize, mtd->oobsize,
chip->page_shift
+* and chip->pagemask.
+*/
+   mtd->writesize = 2048;
+   mtd->oobsize = 64;
+   chip->page_shift = ffs(mtd->wr

Re: [U-Boot] [PATCH 2/2] mtd/nand : workaround for Freescale FCM to supportlarge-page Nand chip

2011-07-05 Thread Scott Wood
On Tue, 5 Jul 2011 19:08:21 -0400
"Matthew L. Creech"  wrote:

> On Tue, Jun 28, 2011 at 12:30 PM, Scott Wood  wrote:
> > On Tue, 28 Jun 2011 11:35:12 -0400
> > Mike Hench  wrote:
> >
> >>
> >> Any boot ideas ?
> >> Will the FCM load 2k and run it?
> >
> > The 4K boot region will have to be split over pages 0 and 2 (2k view) or
> > the first half of pages 0 and 1 (4k view).
> >
> 
> (Redirecting to the U-Boot list)
> 
> Hi Scott,
> 
> Does this kind of page-splitting only apply to the IPL and nothing
> else?

Yes, because that's loaded directly by the hardware which doesn't
implement this workaround.

> If so, it seems that if:
> 
> 1. modifications are made to U-Boot's fsl_elbc_nand driver similar to
> Liu Shuo's kernel mods, and
> 2. an option is added to generate u-boot-nand.bin with its IPL split
> into two 2k chunks
> 
> then we can boot and run entirely from a 4k page device on MPC 83xx, correct?

That's the plan, though I don't know whether it's been tried yet.

-Scott

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


Re: [U-Boot] [PATCH 2/2] mtd/nand : workaround for Freescale FCM to supportlarge-page Nand chip

2011-07-05 Thread Matthew L. Creech
On Tue, Jun 28, 2011 at 12:30 PM, Scott Wood  wrote:
> On Tue, 28 Jun 2011 11:35:12 -0400
> Mike Hench  wrote:
>
>>
>> Any boot ideas ?
>> Will the FCM load 2k and run it?
>
> The 4K boot region will have to be split over pages 0 and 2 (2k view) or
> the first half of pages 0 and 1 (4k view).
>

(Redirecting to the U-Boot list)

Hi Scott,

Does this kind of page-splitting only apply to the IPL and nothing
else?  If so, it seems that if:

1. modifications are made to U-Boot's fsl_elbc_nand driver similar to
Liu Shuo's kernel mods, and
2. an option is added to generate u-boot-nand.bin with its IPL split
into two 2k chunks

then we can boot and run entirely from a 4k page device on MPC 83xx, correct?

That would be very good news, as it seems that [some] 2k NAND parts
are starting to go EOL.

Thanks!

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


Re: [U-Boot] Pull request u-boot-blackfin.git (post branch)

2011-07-05 Thread Mike Frysinger
On Tuesday, July 05, 2011 17:54:32 Wolfgang Denk wrote:
> Mike Frysinger wrote:
> > > Your bogus repostings are rejected, not the original patches.
> > 
> > so since my pull requests are actually the original patches, i can go
> > ahead and change them from "rejected" to "new" ?  or should i just send
> > new pull requests ?
> 
> This has already been answered.  You are wasting my time.  Stop it,
> now.

your logic makes no sense.  you say you are fine with the original patches, 
but i cant send pull requests of the original patches.  i guess i'll have to 
wait for you to pick the individual patches out of patchwork then.
-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] Pull request u-boot-blackfin.git (post branch)

2011-07-05 Thread Wolfgang Denk
Dear Mike Frysinger,

In message <201107051332.55970.vap...@gentoo.org> you wrote:
>
> > Your bogus repostings are rejected, not the original patches.
> 
> so since my pull requests are actually the original patches, i can go ahead
> and change them from "rejected" to "new" ?  or should i just send new pull 
> requests ?

This has already been answered.  You are wasting my time.  Stop it,
now.

This is my last message in this thread.  Try to get help elsewhere.
I got better things to do.

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
A fanatic is a person who can't change his mind and won't change  the
subject.  - Winston Churchill
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Q: NAND read/write: unaligned offset

2011-07-05 Thread Andrew Dyer
On Tue, Jul 5, 2011 at 10:50, Scott Wood  wrote:
> On Fri, 1 Jul 2011 23:16:01 -0700
> Ran Shalit  wrote:
>
>> > I wanted to write different parts of the page each time. And now I
>> undertsand that
>> the ECC is stored for each page, which mean that what I am trying to do , is
>> impossible  (if I am using ecc),
>> i.e. writing the same page without erasing is not allowed when using ecc. Am
>> I right about this conclusion ?
>

The NAND I a familiar with (Micron) also has a limit on partial page
programming, it specifies a max of 4 partial page programming
accesses.   This is a 2k byte/page device, so I assume this is for
mapping 512 byte sectors in storage applications.

In MLC flash, I don't believe partial page access is allowed at all.

see 
http://download.micron.com/pdf/presentations/events/flash_mem_summit_jcooke_inconvenient_truths_nand.pdf
 for an overview as to why.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 3/5] imx: Add support for USB EHCI on imx25

2011-07-05 Thread Marek Vasut
On Thursday, June 30, 2011 05:48:54 PM Stefano Babic wrote:
> On 06/30/2011 11:57 AM, Matthias Weisser wrote:
> > Adding support for USB host on imx25 using the internal PHY
> > 
> > Signed-off-by: Matthias Weisser 
> > ---
> 
> Hi Matthias,
> 
> > +#ifdef CONFIG_MX25
> > +#define MX25_USB_CTRL_IP_PUE_DOWN_BIT  (1<<6)
> > +#define MX25_USB_CTRL_HSTD_BIT (1<<5)
> > +#define MX25_USB_CTRL_USBTE_BIT(1<<4)
> > +#define MX25_USB_CTRL_OCPOL_OTG_BIT(1<<3)
> > +#endif
> > +
> > +#ifdef CONFIG_MX31
> > 
> >  #define MX31_OTG_SIC_SHIFT 29
> >  #define MX31_OTG_SIC_MASK  (0x3 << MX31_OTG_SIC_SHIFT)
> >  #define MX31_OTG_PM_BIT(1 << 24)
> > 
> > @@ -42,10 +50,19 @@
> > 
> >  #define MX31_H1_SIC_MASK   (0x3 << MX31_H1_SIC_SHIFT)
> >  #define MX31_H1_PM_BIT (1 << 8)
> >  #define MX31_H1_DT_BIT (1 << 4)
> > 
> > +#endif
> 
> Can we try to get rid of nasty #ifdef ? I am sure, we would have in
> future support for at least MX5, and if we add a special handling for
> each SOC this file will become unreadable.

... we would have ... if the developer won't hang himself first ;-)

Otherwise, we should probably unify this IMX_USB_BASE stuff indeed. Maybe even 
compute USBCTRL_OTGBASE_OFFSET on the fly (as imx51 has different offset there).
> 
> It seems to me that in most cases we can do it using the same names.
> 
> > /* Take USB2 */
> > 
> > +#ifdef CONFIG_MX25
> > +   ehci = (struct usb_ehci *)(IMX_USB_BASE +
> > +#else
> > 
> > ehci = (struct usb_ehci *)(MX31_OTG_BASE_ADDR +
> > 
> > +#endif
> 
> For example, here we can have a CONFIG_MXB_USB_BASE (or something like
> this), without adding #ifdef. I do not know if we can get completely get
> rid of them, but it is worth to try.
> 
> Best regards,
> Stefano Babic
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] arm: Adds saving of Kernel boot args to NAND flash

2011-07-05 Thread Scott Wood
On Tue, 5 Jul 2011 15:20:39 +0200
Simon Schwarz  wrote:

> +#ifdef CONFIG_SAVE_BOOT_ARGS
> +/* This function writes given bootparams to NAND flash
> + *  adr: Start adress of Kernel parameter image (ATAGS, FDT)
> + *  length: length of the image in byte
> + *
> + * borrowd heavily from common/cmd_nand.c
> + */
> +void boot_params_to_nand(u_char *adr, size_t length) {

Brace on its own line for functions

> + /* write */
> + if(nand_write_skip_bad(nand, off, &length, adr, 0))
> + printf("FAILED!\n");

Space after "if"

> +#ifdef CONFIG_SAVE_BOOT_ARGS
> + struct tag *t;
> + size_t size=0;
> +#endif

Spaces around =

>   if ((flag != 0) && (flag != BOOTM_STATE_OS_GO))
>   return 1;
>  
> @@ -150,6 +198,17 @@ int do_bootm_linux(int flag, int argc, char *argv[], 
> bootm_headers_t *images)
>   setup_end_tag(bd);
>  #endif
>  
> +#ifdef CONFIG_SAVE_BOOT_ARGS
> + printf("write ATAGS to NAND...\n");
> +
> + /* get size of atags */
> + for_each_tag(t, (struct tag *)(bd->bi_boot_params))
> + size += t->hdr.size;
> + size += 2; /* ATAG_NONE has size 0 */
> + size *= 4;  /*  words -> byte! */
> + boot_params_to_nand((u_char *)bd->bi_boot_params, size);
> +#endif
> +
>   announce_and_cleanup();
>  
>   kernel_entry(0, machid, bd->bi_boot_params);
> @@ -208,6 +267,11 @@ static int bootm_linux_fdt(int machid, bootm_headers_t 
> *images)
>  
>   fdt_initrd(*of_flat_tree, *initrd_start, *initrd_end, 1);
>  
> +#ifdef CONFIG_SAVE_BOOT_ARGS
> + printf("write FDT to NAND...\n");
> + boot_params_to_nand((u_char *)(*of_flat_tree),of_size);
> +#endif

Why are you writing to NAND as part of bootm?

If you just want access to the results of the FDT/ATAG preparation that
bootm does, consider using the bootm subcommands to prepare them, then
normal U-Boot commands to write to NAND.

-Scott

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


Re: [U-Boot] [RFC] gpio command: return value on write, additional actions

2011-07-05 Thread Mike Frysinger
On Tuesday, July 05, 2011 15:15:15 Andreas Pretzsch wrote:
> Am Dienstag, den 05.07.2011, 13:44 -0400 schrieb Mike Frysinger:
> > unintentional side effects like "gpio value".  then we could change all
> > the others to return 0/1 based on whether they succeeded, not based on
> > the level of the gpio pin.
> 
> Didn't quite get that. In terms of "gpio value" = "give me the current
> (output latch) value without setting it to input if it's an output" ?

yes.  all it does is return gpio_get_value().

> We can't change the return value of "gpio input", as it's out in the
> wild and would break existing scripts.

i dont think this is that big of a deal

> I'd say clear/set/toggle are changeable, don't see any legit
> return-value-usage here. For 100% backward compatibility, one could
> leave them as they are and use 0|1 as new actions with return 0, as
> proposed.
> 
> So these variants:
>   gpio clear|0 => set to output, write 0, return success
>   gpio set|1   => set to output, write 1, return success
>   gpio toggle  => (set to output), toggle output, return success
>   gpio input   => set to input, return pin value
>   gpio value   => return current pin/latch/whatever value
> or
>   gpio clear   => set to output, write 0, return 0
>   gpio set => set to output, write 1, return 1
>   gpio 0   => set to output, write 0, return success
>   gpio 1   => set to output, write 1, return success
>   gpio toggle  => (set to output), toggle output, return new_val
>   gpio input   => set to input, return pin value
>   gpio value   => return current pin/latch/whatever value
> 
> Not perfectly symmetric, but the best way out I can think of.
> Maybe "get" instead of "value", as it's more usual. OTOH, get (to some
> people) implies "set to input", so value is more explicit.

i prefer to have the command be simple and throw the extended logic onto the 
people writing scripts rather than trying to encode script logic into the 
commands themselves

> > > Also, this leads to unexpected side effects with complex constructs,
> > > 
> > > e.g. consider this environment:
> > >   setA=gpio set PF1
> > >   setB=gpio clear PF2
> > >   setAB_separate=env run setA ; env run setB
> > >   setAB_concatenated=env run setA setB
> > >   setBA_concatenated=env run setB setA
> > > 
> > > While executing "setAB_separate" and "setBA_concatenated" work as
> > > expected, "setAB_concatenated" will only run setA, but not setB, as
> > > setA "failed" (ret=1). [1]
> > > The same would apply to e.g. && constructs.
> > 
> > ive never used the shell in u-boot, but couldnt the first logic be:
> > setA=gpio set PF1 || :
> > setB=gpio clear PF2 || :
>
> Not fully, you'd need "gpio set PF1 || true". Not that this makes it
> less ugly...

but it is doable if we want to just say now "ignore the value" without 
changing any code
-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] sending updated patch versions

2011-07-05 Thread Scott Wood
On Mon, 4 Jul 2011 17:05:28 +0200
Wolfgang Denk  wrote:

> Dear Holger,
> 
> In message <4e119d36.7040...@keymile.com> you wrote:
> >
> > and I wonder if it is needed to update the history of *all* patches in a 
> > serie
> > even if for different specific patches nothing was changed. Or if it 
> > sufficient
> > if only the subject indicates the version number for such patches.
> 
> If you keep the threading of the messages intact (i. e. supply proper
> In-reply-to: and References: headers - like you get automatically when
> inserting the message ID when "git send-email" asks for the
> "Message-ID to be used as In-Reply-To for the first email"), then
> there is usually no need to resend unchanged patces at all - what for?
> It would be just a waste of effort and bandwidth.

IMHO, it makes it easier for the maintainer to collect the full patchset for
applying.  There's also possibility that there is another patch in the
series that got updated, but the message got lost, deleted,
forgotten, filtered to a different folder (especially if the patchset is
crossposted to multiple mailing lists), etc.

It's also more effort for the sender to prune out such patches than to
leave them in, and more effort for people reading the patchset to track
down the missing pieces (even with threading -- the old messages may have
been deleted, especially if it's been a while).

The extra bandwidth is negligible.

> > E.g patch serie where only 1 patch has changes requested, do I need to 
> > update
> > all other patches with the history:
> > 
> > "Changes for v2: - nothing"
> 
> No. Please don't repost the unchanged patches at all. Repost just the
> one that you modified.
> 
> 
> There are only few cases where you have biggger or more complicated
> series of patches, which undergo a number of changes here and there
> where it may make sense to repost a clean version of the whole series.

Of course, if it's one or two patches out of 15, updated half an hour after
the previous version went out, or if there's repeated iteration on a subset
of the patchset (especially if the patchset is a loosely-related
collection), then it's reasonable to just post what changed.  I think the
cases where a full repost helps are not that rare, though.

-Scott

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


Re: [U-Boot] [RFC] gpio command: return value on write, additional actions

2011-07-05 Thread Andreas Pretzsch
Am Dienstag, den 05.07.2011, 13:44 -0400 schrieb Mike Frysinger:
> On Tuesday, July 05, 2011 12:59:16 Andreas Pretzsch wrote:
> > As of today (2011.06), the generic gpio command (common/cmd_gpio.c)
> > gpio  
> > - input/set/clear/toggle the specified pin (e.g. PF10)
> > always returns the value read or set.
> > 
> > While this is sensible for read (input) and maybe (questionable) for
> > toggle, I don't see an usage for write (set/clear).
> 
> the trouble with toggle is that there's no way to get the value without 
> changing it to the input.  we'd have to add another field that has no 

True, at least on devices without hardware toggle support.
And you never know if you read back the real pin state, the output latch
or something invalid. And a "short" switch to input isn't always legal
wrt to the attached hardware. Great when setting 1 bit is worth 10 bit
of problems ;-)

Personally, I'd shift the gpio_toggle to the underlying hardware
specific code. And print an error if it's not supported.

> unintentional side effects like "gpio value".  then we could change all the 
> others to return 0/1 based on whether they succeeded, not based on the level 
> of the gpio pin.

Didn't quite get that. In terms of "gpio value" = "give me the current
(output latch) value without setting it to input if it's an output" ?

We can't change the return value of "gpio input", as it's out in the
wild and would break existing scripts.

I'd say clear/set/toggle are changeable, don't see any legit
return-value-usage here. For 100% backward compatibility, one could
leave them as they are and use 0|1 as new actions with return 0, as
proposed.

So these variants:
  gpio clear|0 => set to output, write 0, return success
  gpio set|1   => set to output, write 1, return success
  gpio toggle  => (set to output), toggle output, return success
  gpio input   => set to input, return pin value
  gpio value   => return current pin/latch/whatever value
or
  gpio clear   => set to output, write 0, return 0
  gpio set => set to output, write 1, return 1
  gpio 0   => set to output, write 0, return success
  gpio 1   => set to output, write 1, return success
  gpio toggle  => (set to output), toggle output, return new_val
  gpio input   => set to input, return pin value
  gpio value   => return current pin/latch/whatever value

Not perfectly symmetric, but the best way out I can think of.
Maybe "get" instead of "value", as it's more usual. OTOH, get (to some
people) implies "set to input", so value is more explicit.


> > Also, this leads to unexpected side effects with complex constructs,
> > e.g. consider this environment:
> > setA=gpio set PF1
> > setB=gpio clear PF2
> > setAB_separate=env run setA ; env run setB
> > setAB_concatenated=env run setA setB
> > setBA_concatenated=env run setB setA
> > 
> > While executing "setAB_separate" and "setBA_concatenated" work as
> > expected, "setAB_concatenated" will only run setA, but not setB, as setA
> > "failed" (ret=1). [1]
> > The same would apply to e.g. && constructs.
> 
> ive never used the shell in u-boot, but couldnt the first logic be:
>   setA=gpio set PF1 || :
>   setB=gpio clear PF2 || :

Not fully, you'd need "gpio set PF1 || true". Not that this makes it
less ugly...
BTW, nobody would mind that without notice. Stumbled over it by pure
accident myself.

> > As it works this way in the release and hence the behaviour is
> > essentially fixed, changing the return value is probably not an option.
> 
> not really.  poor behavior can be adjusted.
> -mike

Fine from my side, but I'm not the one to decide.


-- 

carpe noctem engineering
Ingenieurbuero fuer Hard- & Software-Entwicklung Andreas Pretzsch
Dipl.-Ing. (FH) Andreas Pretzsch  Tel. +49-(0)731-5521572
Hahnengasse 3 Fax: +49-(0)731-5521573
89073 Ulm, Germanyemail: a...@cn-eng.de

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


Re: [U-Boot] [PATCH 0/2] usb:gadget: Linux USB Gadget framework

2011-07-05 Thread Remy Bohmer
Hi,

2011/7/5 Lukasz Majewski :
> Included commits provide Linux USB gadget support for U-boot.
> The USB Gadget infrastructure is running on top of the Samsung's
> UDC OTG controller. The code has been tested on the GONI (S5PC110)
> reference target.
>
> Files:
> drivers/usb/gadget/file_storage.c
> drivers/usb/gadget/storage_common.c
>
> Aren't passing the checkpatch.pl script check, however they were
> taken from Linux kernel. On purpose this code hasn't been corrected, to
> facilitate further code porting from Linux to U-boot (or in opposite
> direction)

It looks interesting, but I really have to dig through all this code.
It is huge, and I see things being touched in the USB-ethernet gadget
stack. I need to process this carefully.
Unfortunately, due to the summer holidays I expect not to be able to
look into it in detail for the next 3 weeks...

For now, I see if I can do a quick scan and give you some quick
remarks, but you may expect more when I looked into it in detail.

Kind regards,

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


Re: [U-Boot] [RFC PATCH 2/4] Use ALL-y style instead of ifeq blocks for better readability and upgradeability

2011-07-05 Thread Mike Frysinger
Acked-by: Mike Frysinger 
-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] [RFC PATCH 1/4] Adapt config.mk for usage in spl/Makefile

2011-07-05 Thread Mike Frysinger
On Tuesday, July 05, 2011 12:26:19 Daniel Schwierzeck wrote:
> +ifdef CONFIG_UBOOT_SPL_BUILD
> +# OBJTREE points to /spl/obj inside the original OBJTREE for SPL
> +sinclude $(OBJTREE)/../../include/autoconf.mk
> +sinclude $(OBJTREE)/../../include/config.mk
> +else
>  sinclude $(OBJTREE)/include/autoconf.mk
>  sinclude $(OBJTREE)/include/config.mk
> +endif

since all you're doing is adjusting all the paths to get at the top of the 
tree, i wonder if you shouldnt just introduce a new variable for the top and 
then base everything off that.

OBJTREETOP = $(OBJTREE)$(SUBTREE)

and then in the spl subdir, you set SUBTREE to "/../..".  this would avoid 
sprinkling of a specific CONFIG option throughout the build system.
-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] i2c:gpio:s5p: I2C GPIO Software implementation

2011-07-05 Thread Mike Frysinger
On Tuesday, July 05, 2011 08:23:41 Lukasz Majewski wrote:
> This commit adds I2C software support for Samsung's S5PC110
> family of processors.
> The generic drivers/i2c/soft_i2c framework is used, with
> routines provided by this commit.

if you simply implemented the generic gpio layer (asm/gpio.h), the soft_i2c.c 
code already handles gluing to GPIO pins.  then you wouldnt need a sep driver 
at all.  you can see the bf561-ezkit already using this code.
-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] [RFC] gpio command: return value on write, additional actions

2011-07-05 Thread Mike Frysinger
On Tuesday, July 05, 2011 12:59:16 Andreas Pretzsch wrote:
> As of today (2011.06), the generic gpio command (common/cmd_gpio.c)
>   gpio  
>   - input/set/clear/toggle the specified pin (e.g. PF10)
> always returns the value read or set.
> 
> While this is sensible for read (input) and maybe (questionable) for
> toggle, I don't see an usage for write (set/clear).

the trouble with toggle is that there's no way to get the value without 
changing it to the input.  we'd have to add another field that has no 
unintentional side effects like "gpio value".  then we could change all the 
others to return 0/1 based on whether they succeeded, not based on the level 
of the gpio pin.

> Also, this leads to unexpected side effects with complex constructs,
> e.g. consider this environment:
>   setA=gpio set PF1
>   setB=gpio clear PF2
>   setAB_separate=env run setA ; env run setB
>   setAB_concatenated=env run setA setB
>   setBA_concatenated=env run setB setA
> 
> While executing "setAB_separate" and "setBA_concatenated" work as
> expected, "setAB_concatenated" will only run setA, but not setB, as setA
> "failed" (ret=1). [1]
> The same would apply to e.g. && constructs.

ive never used the shell in u-boot, but couldnt the first logic be:
setA=gpio set PF1 || :
setB=gpio clear PF2 || :

> As it works this way in the release and hence the behaviour is
> essentially fixed, changing the return value is probably not an option.

not really.  poor behavior can be adjusted.
-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] Pull request u-boot-blackfin.git (post branch)

2011-07-05 Thread Mike Frysinger
On Tuesday, July 05, 2011 05:59:56 Wolfgang Denk wrote:
> Mike Frysinger wrote:
> > you already said that's what you want, and i already said "OK", which
> > gets us back to what i already asked: if the pull requests reflect the
> > old patches posted to the list before the resend on June 28th, then why
> > cant they be changed from "rejected" to "new" ?
> 
> Your bogus repostings are rejected, not the original patches.

so since my pull requests are actually the original patches, i can go ahead 
and change them from "rejected" to "new" ?  or should i just send new pull 
requests ?
-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


[U-Boot] [RFC] gpio command: return value on write, additional actions

2011-07-05 Thread Andreas Pretzsch
As of today (2011.06), the generic gpio command (common/cmd_gpio.c)
gpio  
- input/set/clear/toggle the specified pin (e.g. PF10)
always returns the value read or set.

While this is sensible for read (input) and maybe (questionable) for
toggle, I don't see an usage for write (set/clear).

Also, this leads to unexpected side effects with complex constructs,
e.g. consider this environment:
setA=gpio set PF1
setB=gpio clear PF2
setAB_separate=env run setA ; env run setB
setAB_concatenated=env run setA setB
setBA_concatenated=env run setB setA

While executing "setAB_separate" and "setBA_concatenated" work as
expected, "setAB_concatenated" will only run setA, but not setB, as setA
"failed" (ret=1). [1]
The same would apply to e.g. && constructs.

As it works this way in the release and hence the behaviour is
essentially fixed, changing the return value is probably not an option.
OTOH, the breakage here might be negligible, at least for set/clear.
But in any case, it should be documented.

Beside this, I'd like to extend the gpio command with the additional
actions "0" and "1", always returning 0 (given the write was
successful):
gpio  

As a nice benefit, it would strip down constructs like
if test ${LED_x} -eq 0;then gpio set PF1;else gpio clear PF1;fi
to a simple "gpio ${LED_x} PF1".


Any comments or objections before I submit a patch ?


[1] http://www.denx.de/wiki/DULG/CommandLineParsing "General rules"

-- 

carpe noctem engineering
Ingenieurbuero fuer Hard- & Software-Entwicklung Andreas Pretzsch
Dipl.-Ing. (FH) Andreas Pretzsch  Tel. +49-(0)731-5521572
Hahnengasse 3 Fax: +49-(0)731-5521573
89073 Ulm, Germanyemail: a...@cn-eng.de

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


[U-Boot] [RESEND PATCH v2 1/5] Tegra2: Add macros to calculate bitfield shifts and masks

2011-07-05 Thread Simon Glass
Signed-off-by: Simon Glass 
---
Changes in v2:
- Removed all bitfield access macros

 arch/arm/include/asm/arch-tegra2/bitfield.h |   96 +++
 1 files changed, 96 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-tegra2/bitfield.h

diff --git a/arch/arm/include/asm/arch-tegra2/bitfield.h 
b/arch/arm/include/asm/arch-tegra2/bitfield.h
new file mode 100644
index 000..494087c
--- /dev/null
+++ b/arch/arm/include/asm/arch-tegra2/bitfield.h
@@ -0,0 +1,96 @@
+/*
+ * Copyright (c) 2011 The Chromium OS Authors.
+ * 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
+ */
+
+#ifndef __TEGRA2_BITFIELD_H
+#define __TEGRA2_BITFIELD_H
+
+/*
+ * Basic macros for easily getting mask and shift values for bit fields on
+ * ARM.
+ *
+ * You use these to reliably create shifts and masks from a bit field
+ * definition. Bit fields are defined like this:
+ *
+ * #define NAME_BITS   MSB : LSB
+ *
+ * where MSB is the most significant bit, and LSB the least sig, bit. This
+ * notation is chosen since it is commonly used in CPU / SOC datasheets.
+ *
+ * For example:
+ *
+ * #define UART_FBCON_BITS  5:3Bit range for the FBCON field
+ *
+ * Note that if you are using a big-endian machine there is no consistent
+ * notion of big numbers, since bit 3 is a different bit depending on whether
+ * the access is 32-bits or 64-bits. For this reason these macros should not
+ * be used as it would probably be too confusing to have to specify your
+ * access width all the time.
+ *
+ * This defines a bit field extending between bits 3 and 5.
+ *
+ * Then in your header file you can set up the shift and mask like this:
+ *
+ *  #define UART_FBCON_SHIFT   bf_shift(UART_FBCON)
+ *  #define UART_FBCON_MASKbf_mask(UART_FBCON)
+ *
+ * Then you can use these macros in your code (there is no bitfield support
+ * in the C file and these macros MUST NOT be used directly in C code).
+ *
+ * To write, overwriting other fields too:
+ * writel(3 << UART_FBCON_SHIFT, &uart->fbcon);
+ *
+ * To read:
+ * int fbcon = (readl(&uart->fbcon) & UART_FBCON_MASK) >>
+ * UART_FBCON_SHIFT;
+ *
+ * To update just this field (for example):
+ * clrsetbits_le32(&uart->fbcon, UART_FBCON_MASK, 3 << UART_FBCON_SHIFT);
+ */
+
+#include "compiler.h"
+
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+
+/* Returns the bit number of the LSB */
+#define _LSB(range)((0 ? range) & 0x1f)
+
+/* Returns the bit number of the MSB */
+#define _MSB(range)(1 ? range)
+
+/* Returns the width of the bitfield (in bits) */
+#define _BITFIELD_WIDTH(range) (_MSB(range) - _LSB(range) + 1)
+
+
+/*
+ * Returns the number of bits the bitfield needs to be shifted left to pack it.
+ * This is just the same as the low bit.
+ */
+#define bf_shift(field)_LSB(field)
+
+/* Returns the unshifted mask for the field (i.e. LSB of mask is bit 0) */
+#define bf_rawmask(field)  ((1UL << _BITFIELD_WIDTH(field)) - 1)
+
+/* Returns the mask for a field. Clear these bits to zero the field */
+#define bf_mask(field) (bf_rawmask(field) << (bf_shift(field)))
+
+#endif /* __BYTE_ORDER == __LITTLE_ENDIAN */
+
+#endif
-- 
1.7.3.1

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


[U-Boot] [RESEND PATCH v2 4/5] Tegra2: add additional pin multiplexing features

2011-07-05 Thread Simon Glass
This adds an enum for each pin and some functions for changing the pin
muxing setup.

Signed-off-by: Simon Glass 
---
Changes in v2:
- Removed use of bitfield access macros

 arch/arm/cpu/armv7/tegra2/Makefile|2 +-
 arch/arm/cpu/armv7/tegra2/pinmux.c|   53 ++
 arch/arm/include/asm/arch-tegra2/pinmux.h |  155 +++--
 board/nvidia/common/board.c   |   10 +--
 4 files changed, 205 insertions(+), 15 deletions(-)
 create mode 100644 arch/arm/cpu/armv7/tegra2/pinmux.c

diff --git a/arch/arm/cpu/armv7/tegra2/Makefile 
b/arch/arm/cpu/armv7/tegra2/Makefile
index b35764c..f673f03 100644
--- a/arch/arm/cpu/armv7/tegra2/Makefile
+++ b/arch/arm/cpu/armv7/tegra2/Makefile
@@ -28,7 +28,7 @@ include $(TOPDIR)/config.mk
 LIB=  $(obj)lib$(SOC).o
 
 SOBJS  := lowlevel_init.o
-COBJS  := ap20.o board.o clock.o sys_info.o timer.o
+COBJS  := ap20.o board.o clock.o pinmux.o sys_info.o timer.o
 
 SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS   := $(addprefix $(obj),$(COBJS) $(SOBJS))
diff --git a/arch/arm/cpu/armv7/tegra2/pinmux.c 
b/arch/arm/cpu/armv7/tegra2/pinmux.c
new file mode 100644
index 000..4d35172
--- /dev/null
+++ b/arch/arm/cpu/armv7/tegra2/pinmux.c
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2011 The Chromium OS Authors.
+ * 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
+ */
+
+/* Tegra2 pin multiplexing functions */
+
+#include 
+#include 
+#include 
+#include 
+
+
+void pinmux_set_tristate(enum pmux_pin pin, int enable)
+{
+   struct pmux_tri_ctlr *pmt = (struct pmux_tri_ctlr *)NV_PA_APB_MISC_BASE;
+   u32 *tri = &pmt->pmt_tri[TRISTATE_REG(pin)];
+   u32 reg;
+
+   reg = readl(tri);
+   if (enable)
+   reg |= TRISTATE_MASK(pin);
+   else
+   reg &= ~TRISTATE_MASK(pin);
+   writel(reg, tri);
+}
+
+void pinmux_tristate_enable(enum pmux_pin pin)
+{
+   pinmux_set_tristate(pin, 1);
+}
+
+void pinmux_tristate_disable(enum pmux_pin pin)
+{
+   pinmux_set_tristate(pin, 0);
+}
+
diff --git a/arch/arm/include/asm/arch-tegra2/pinmux.h 
b/arch/arm/include/asm/arch-tegra2/pinmux.h
index 8b4bd8d..b8a4753 100644
--- a/arch/arm/include/asm/arch-tegra2/pinmux.h
+++ b/arch/arm/include/asm/arch-tegra2/pinmux.h
@@ -24,6 +24,142 @@
 #ifndef _PINMUX_H_
 #define _PINMUX_H_
 
+/* Pins which we can set to tristate or normal */
+enum pmux_pin {
+   /* APB_MISC_PP_TRISTATE_REG_A_0 */
+   PIN_ATA,
+   PIN_ATB,
+   PIN_ATC,
+   PIN_ATD,
+   PIN_CDEV1,
+   PIN_CDEV2,
+   PIN_CSUS,
+   PIN_DAP1,
+
+   PIN_DAP2,
+   PIN_DAP3,
+   PIN_DAP4,
+   PIN_DTA,
+   PIN_DTB,
+   PIN_DTC,
+   PIN_DTD,
+   PIN_DTE,
+
+   PIN_GPU,
+   PIN_GPV,
+   PIN_I2CP,
+   PIN_IRTX,
+   PIN_IRRX,
+   PIN_KBCB,
+   PIN_KBCA,
+   PIN_PMC,
+
+   PIN_PTA,
+   PIN_RM,
+   PIN_KBCE,
+   PIN_KBCF,
+   PIN_GMA,
+   PIN_GMC,
+   PIN_SDMMC1,
+   PIN_OWC,
+
+   /* 32: APB_MISC_PP_TRISTATE_REG_B_0 */
+   PIN_GME,
+   PIN_SDC,
+   PIN_SDD,
+   PIN_RESERVED0,
+   PIN_SLXA,
+   PIN_SLXC,
+   PIN_SLXD,
+   PIN_SLXK,
+
+   PIN_SPDI,
+   PIN_SPDO,
+   PIN_SPIA,
+   PIN_SPIB,
+   PIN_SPIC,
+   PIN_SPID,
+   PIN_SPIE,
+   PIN_SPIF,
+
+   PIN_SPIG,
+   PIN_SPIH,
+   PIN_UAA,
+   PIN_UAB,
+   PIN_UAC,
+   PIN_UAD,
+   PIN_UCA,
+   PIN_UCB,
+
+   PIN_RESERVED1,
+   PIN_ATE,
+   PIN_KBCC,
+   PIN_RESERVED2,
+   PIN_RESERVED3,
+   PIN_GMB,
+   PIN_GMD,
+   PIN_DDC,
+
+   /* 64: APB_MISC_PP_TRISTATE_REG_C_0 */
+   PIN_LD0,
+   PIN_LD1,
+   PIN_LD2,
+   PIN_LD3,
+   PIN_LD4,
+   PIN_LD5,
+   PIN_LD6,
+   PIN_LD7,
+
+   PIN_LD8,
+   PIN_LD9,
+   PIN_LD10,
+   PIN_LD11,
+   PIN_LD12,
+   PIN_LD13,
+   PIN_LD14,
+   PIN_LD15,
+
+   PIN_LD16,
+   PIN_LD17,
+   PIN_LHP0,
+   PIN_LHP1,
+   PIN_LHP2,
+   PIN_LVP0,
+   PIN_LVP1,
+   PIN_HDINT,
+
+   PIN_LM0,
+   PIN_LM1,
+   PIN_LVS,
+   PIN_LSC0,
+   PIN_LSC1,
+   PIN_LSCK,
+   PIN_LDC,
+   PIN_LCSN,

[U-Boot] [RESEND PATCH v2 3/5] Tegra2: Add more clock support

2011-07-05 Thread Simon Glass
This adds functions to enable/disable clocks and reset to on-chip peripherals.

Signed-off-by: Simon Glass 
---
Changes in v2:
- Removed use of bitfield access macros

 arch/arm/cpu/armv7/tegra2/Makefile |2 +-
 arch/arm/cpu/armv7/tegra2/ap20.c   |   52 ++
 arch/arm/cpu/armv7/tegra2/clock.c  |  158 +
 arch/arm/include/asm/arch-tegra2/clk_rst.h |  125 +-
 arch/arm/include/asm/arch-tegra2/clock.h   |  264 
 board/nvidia/common/board.c|   46 ++---
 6 files changed, 536 insertions(+), 111 deletions(-)
 create mode 100644 arch/arm/cpu/armv7/tegra2/clock.c
 create mode 100644 arch/arm/include/asm/arch-tegra2/clock.h

diff --git a/arch/arm/cpu/armv7/tegra2/Makefile 
b/arch/arm/cpu/armv7/tegra2/Makefile
index f1ea915..b35764c 100644
--- a/arch/arm/cpu/armv7/tegra2/Makefile
+++ b/arch/arm/cpu/armv7/tegra2/Makefile
@@ -28,7 +28,7 @@ include $(TOPDIR)/config.mk
 LIB=  $(obj)lib$(SOC).o
 
 SOBJS  := lowlevel_init.o
-COBJS  := ap20.o board.o sys_info.o timer.o
+COBJS  := ap20.o board.o clock.o sys_info.o timer.o
 
 SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS   := $(addprefix $(obj),$(COBJS) $(SOBJS))
diff --git a/arch/arm/cpu/armv7/tegra2/ap20.c b/arch/arm/cpu/armv7/tegra2/ap20.c
index 60dd5df..e3832e2 100644
--- a/arch/arm/cpu/armv7/tegra2/ap20.c
+++ b/arch/arm/cpu/armv7/tegra2/ap20.c
@@ -25,6 +25,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -35,33 +36,34 @@ u32 s_first_boot = 1;
 void init_pllx(void)
 {
struct clk_rst_ctlr *clkrst = (struct clk_rst_ctlr *)NV_PA_CLK_RST_BASE;
+   struct clk_pll *pll = &clkrst->crc_pll[CLOCK_PLL_ID_XCPU];
u32 reg;
 
/* If PLLX is already enabled, just return */
-   reg = readl(&clkrst->crc_pllx_base);
+   reg = readl(&pll->pll_base);
if (reg & PLL_ENABLE)
return;
 
/* Set PLLX_MISC */
reg = CPCON;/* CPCON[11:8]  = 0001 */
-   writel(reg, &clkrst->crc_pllx_misc);
+   writel(reg, &pll->pll_misc);
 
/* Use 12MHz clock here */
-   reg = (PLL_BYPASS | PLL_DIVM);
+   reg = (PLL_BYPASS | PLL_DIVM_VALUE);
reg |= (1000 << 8); /* DIVN = 0x3E8 */
-   writel(reg, &clkrst->crc_pllx_base);
+   writel(reg, &pll->pll_base);
 
reg |= PLL_ENABLE;
-   writel(reg, &clkrst->crc_pllx_base);
+   writel(reg, &pll->pll_base);
 
reg &= ~PLL_BYPASS;
-   writel(reg, &clkrst->crc_pllx_base);
+   writel(reg, &pll->pll_base);
 }
 
 static void enable_cpu_clock(int enable)
 {
struct clk_rst_ctlr *clkrst = (struct clk_rst_ctlr *)NV_PA_CLK_RST_BASE;
-   u32 reg, clk;
+   u32 clk;
 
/*
 * NOTE:
@@ -83,10 +85,6 @@ static void enable_cpu_clock(int enable)
writel(SUPER_CCLK_DIVIDER, &clkrst->crc_super_cclk_div);
}
 
-   /* Fetch the register containing the main CPU complex clock enable */
-   reg = readl(&clkrst->crc_clk_out_enb_l);
-   reg |= CLK_ENB_CPU;
-
/*
 * Read the register containing the individual CPU clock enables and
 * always stop the clock to CPU 1.
@@ -103,7 +101,8 @@ static void enable_cpu_clock(int enable)
}
 
writel(clk, &clkrst->crc_clk_cpu_cmplx);
-   writel(reg, &clkrst->crc_clk_out_enb_l);
+
+   clock_enable(PERIPH_ID_CPU);
 }
 
 static int is_cpu_powered(void)
@@ -179,7 +178,7 @@ static void enable_cpu_power_rail(void)
 static void reset_A9_cpu(int reset)
 {
struct clk_rst_ctlr *clkrst = (struct clk_rst_ctlr *)NV_PA_CLK_RST_BASE;
-   u32 reg, cpu;
+   u32 cpu;
 
/*
* NOTE:  Regardless of whether the request is to hold the CPU in reset
@@ -193,44 +192,27 @@ static void reset_A9_cpu(int reset)
cpu = SET_DBGRESET1 | SET_DERESET1 | SET_CPURESET1;
writel(cpu, &clkrst->crc_cpu_cmplx_set);
 
-   reg = readl(&clkrst->crc_rst_dev_l);
if (reset) {
/* Now place CPU0 into reset */
cpu |= SET_DBGRESET0 | SET_DERESET0 | SET_CPURESET0;
writel(cpu, &clkrst->crc_cpu_cmplx_set);
-
-   /* Enable master CPU reset */
-   reg |= SWR_CPU_RST;
} else {
/* Take CPU0 out of reset */
cpu = CLR_DBGRESET0 | CLR_DERESET0 | CLR_CPURESET0;
writel(cpu, &clkrst->crc_cpu_cmplx_clr);
-
-   /* Disable master CPU reset */
-   reg &= ~SWR_CPU_RST;
}
 
-   writel(reg, &clkrst->crc_rst_dev_l);
+   /* Enable/Disable master CPU reset */
+   reset_set_enable(PERIPH_ID_CPU, reset);
 }
 
 static void clock_enable_coresight(int enable)
 {
struct clk_rst_ctlr *clkrst = (struct clk_rst_ctlr *)NV_PA_CLK_RST_BASE;
-   u32 rst, clk, src;
-
-   rst = readl(&clkrst->crc_rst_dev_u);
-   clk = readl(&clkrst->crc_clk_out_enb_u);
-
-   if (enable) {
-   

[U-Boot] [RESEND PATCH v2 2/5] Tegra2: Add microsecond timer functions

2011-07-05 Thread Simon Glass
These functions provide access to the high resolution microsecond timer
and tidy up a global variable in the code.

Signed-off-by: Simon Glass 
---
 arch/arm/cpu/armv7/tegra2/timer.c|   27 +--
 arch/arm/include/asm/arch-tegra2/timer.h |   34 ++
 2 files changed, 54 insertions(+), 7 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-tegra2/timer.h

diff --git a/arch/arm/cpu/armv7/tegra2/timer.c 
b/arch/arm/cpu/armv7/tegra2/timer.c
index fb061d0..b69c172 100644
--- a/arch/arm/cpu/armv7/tegra2/timer.c
+++ b/arch/arm/cpu/armv7/tegra2/timer.c
@@ -38,13 +38,12 @@
 #include 
 #include 
 #include 
+#include 
 
 DECLARE_GLOBAL_DATA_PTR;
 
-struct timerus *timer_base = (struct timerus *)NV_PA_TMRUS_BASE;
-
 /* counter runs at 1MHz */
-#define TIMER_CLK  (100)
+#define TIMER_CLK  100
 #define TIMER_LOAD_VAL 0x
 
 /* timer without interrupts */
@@ -67,10 +66,10 @@ void set_timer(ulong t)
 void __udelay(unsigned long usec)
 {
long tmo = usec * (TIMER_CLK / 1000) / 1000;
-   unsigned long now, last = readl(&timer_base->cntr_1us);
+   unsigned long now, last = timer_get_us();
 
while (tmo > 0) {
-   now = readl(&timer_base->cntr_1us);
+   now = timer_get_us();
if (last > now) /* count up timer overflow */
tmo -= TIMER_LOAD_VAL - last + now;
else
@@ -82,7 +81,7 @@ void __udelay(unsigned long usec)
 void reset_timer_masked(void)
 {
/* reset time, capture current incrementer value time */
-   gd->lastinc = readl(&timer_base->cntr_1us) / (TIMER_CLK/CONFIG_SYS_HZ);
+   gd->lastinc = timer_get_us() / (TIMER_CLK/CONFIG_SYS_HZ);
gd->tbl = 0;/* start "advancing" time stamp from 0 */
 }
 
@@ -91,7 +90,7 @@ ulong get_timer_masked(void)
ulong now;
 
/* current tick value */
-   now = readl(&timer_base->cntr_1us) / (TIMER_CLK / CONFIG_SYS_HZ);
+   now = timer_get_us() / (TIMER_CLK / CONFIG_SYS_HZ);
 
if (now >= gd->lastinc) /* normal mode (non roll) */
/* move stamp forward with absolute diff ticks */
@@ -120,3 +119,17 @@ ulong get_tbclk(void)
 {
return CONFIG_SYS_HZ;
 }
+
+
+unsigned long timer_get_us(void)
+{
+   struct timerus *timer_base = (struct timerus *)NV_PA_TMRUS_BASE;
+
+   return readl(&timer_base->cntr_1us);
+}
+
+unsigned long timer_get_future_us(u32 delay)
+{
+   return timer_get_us() + delay;
+}
+
diff --git a/arch/arm/include/asm/arch-tegra2/timer.h 
b/arch/arm/include/asm/arch-tegra2/timer.h
new file mode 100644
index 000..5d5445e
--- /dev/null
+++ b/arch/arm/include/asm/arch-tegra2/timer.h
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2011 The Chromium OS Authors.
+ * 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
+ */
+
+/* Tegra2 timer functions */
+
+#ifndef _TEGRA2_TIMER_H
+#define _TEGRA2_TIMER_H
+
+/* returns the current monotonic timer value in microseconds */
+unsigned long timer_get_us(void);
+
+/* returns what the time will likely be some microseconds into the future */
+unsigned long timer_get_future_us(u32 delay);
+
+#endif
+
-- 
1.7.3.1

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


[U-Boot] [RESEND PATCH v2 5/5] Tegra2: Use clock and pinmux functions to simplify code

2011-07-05 Thread Simon Glass
Signed-off-by: Simon Glass 
---
Changes in v2:
- Removed use of bitfield access macros
- Now uses manual shifts and masks

 arch/arm/cpu/armv7/tegra2/ap20.c   |   47 ---
 arch/arm/include/asm/arch-tegra2/clk_rst.h |   37 --
 board/nvidia/common/board.c|   12 +++---
 3 files changed, 20 insertions(+), 76 deletions(-)

diff --git a/arch/arm/cpu/armv7/tegra2/ap20.c b/arch/arm/cpu/armv7/tegra2/ap20.c
index e3832e2..dc5f984 100644
--- a/arch/arm/cpu/armv7/tegra2/ap20.c
+++ b/arch/arm/cpu/armv7/tegra2/ap20.c
@@ -40,23 +40,21 @@ void init_pllx(void)
u32 reg;
 
/* If PLLX is already enabled, just return */
-   reg = readl(&pll->pll_base);
-   if (reg & PLL_ENABLE)
+   if (readl(&pll->pll_base) & PLL_ENABLE_MASK)
return;
 
/* Set PLLX_MISC */
-   reg = CPCON;/* CPCON[11:8]  = 0001 */
-   writel(reg, &pll->pll_misc);
+   writel(1 << PLL_CPCON_SHIFT, &pll->pll_misc);
 
/* Use 12MHz clock here */
-   reg = (PLL_BYPASS | PLL_DIVM_VALUE);
-   reg |= (1000 << 8); /* DIVN = 0x3E8 */
+   reg = PLL_BYPASS_MASK | (12 << PLL_DIVM_SHIFT);
+   reg |= 1000 << PLL_DIVN_SHIFT;
writel(reg, &pll->pll_base);
 
-   reg |= PLL_ENABLE;
+   reg |= PLL_ENABLE_MASK;
writel(reg, &pll->pll_base);
 
-   reg &= ~PLL_BYPASS;
+   reg &= ~PLL_BYPASS_MASK;
writel(reg, &pll->pll_base);
 }
 
@@ -90,16 +88,11 @@ static void enable_cpu_clock(int enable)
 * always stop the clock to CPU 1.
 */
clk = readl(&clkrst->crc_clk_cpu_cmplx);
-   clk |= CPU1_CLK_STP;
-
-   if (enable) {
-   /* Unstop the CPU clock */
-   clk &= ~CPU0_CLK_STP;
-   } else {
-   /* Stop the CPU clock */
-   clk |= CPU0_CLK_STP;
-   }
+   clk |= 1 << CPU1_CLK_STP_SHIFT;
 
+   /* Stop/Unstop the CPU clock */
+   clk &= ~CPU0_CLK_STP_MASK;
+   clk |= !enable << CPU0_CLK_STP_SHIFT;
writel(clk, &clkrst->crc_clk_cpu_cmplx);
 
clock_enable(PERIPH_ID_CPU);
@@ -177,9 +170,6 @@ static void enable_cpu_power_rail(void)
 
 static void reset_A9_cpu(int reset)
 {
-   struct clk_rst_ctlr *clkrst = (struct clk_rst_ctlr *)NV_PA_CLK_RST_BASE;
-   u32 cpu;
-
/*
* NOTE:  Regardless of whether the request is to hold the CPU in reset
*or take it out of reset, every processor in the CPU complex
@@ -188,19 +178,10 @@ static void reset_A9_cpu(int reset)
*are multiple processors in the CPU complex.
*/
 
-   /* Hold CPU 1 in reset */
-   cpu = SET_DBGRESET1 | SET_DERESET1 | SET_CPURESET1;
-   writel(cpu, &clkrst->crc_cpu_cmplx_set);
-
-   if (reset) {
-   /* Now place CPU0 into reset */
-   cpu |= SET_DBGRESET0 | SET_DERESET0 | SET_CPURESET0;
-   writel(cpu, &clkrst->crc_cpu_cmplx_set);
-   } else {
-   /* Take CPU0 out of reset */
-   cpu = CLR_DBGRESET0 | CLR_DERESET0 | CLR_CPURESET0;
-   writel(cpu, &clkrst->crc_cpu_cmplx_clr);
-   }
+   /* Hold CPU 1 in reset, and CPU 0 if asked */
+   reset_cmplx_set_enable(1, crc_rst_cpu | crc_rst_de | crc_rst_debug, 1);
+   reset_cmplx_set_enable(0, crc_rst_cpu | crc_rst_de | crc_rst_debug,
+  reset);
 
/* Enable/Disable master CPU reset */
reset_set_enable(PERIPH_ID_CPU, reset);
diff --git a/arch/arm/include/asm/arch-tegra2/clk_rst.h 
b/arch/arm/include/asm/arch-tegra2/clk_rst.h
index 6c74410..e64fc93 100644
--- a/arch/arm/include/asm/arch-tegra2/clk_rst.h
+++ b/arch/arm/include/asm/arch-tegra2/clk_rst.h
@@ -142,43 +142,6 @@ struct clk_rst_ctlr {
uint crc_cpu_cmplx_clr; /* _CPU_CMPLX_CLR_0,0x344 */
 };
 
-#define PLL_BYPASS (1 << 31)
-#define PLL_ENABLE (1 << 30)
-#define PLL_BASE_OVRRIDE   (1 << 28)
-#define PLL_DIVP_VALUE (1 << 20)   /* post divider, b22:20 */
-#define PLL_DIVM_VALUE 0x0C/* input divider, b4:0 */
-
-#define SWR_UARTD_RST  (1 << 1)
-#define CLK_ENB_UARTD  (1 << 1)
-#define SWR_UARTA_RST  (1 << 6)
-#define CLK_ENB_UARTA  (1 << 6)
-
-#define SWR_CPU_RST(1 << 0)
-#define CLK_ENB_CPU(1 << 0)
-#define SWR_CSITE_RST  (1 << 9)
-#define CLK_ENB_CSITE  (1 << 9)
-
-#define SET_CPURESET0  (1 << 0)
-#define SET_DERESET0   (1 << 4)
-#define SET_DBGRESET0  (1 << 12)
-
-#define SET_CPURESET1  (1 << 1)
-#define SET_DERESET1   (1 << 5)
-#define SET_DBGRESET1  (1 << 13)
-
-#define CLR_CPURESET0  (1 << 0)
-#define CLR_DERESET0   (1 << 4)
-#define CLR_DBGRESET0  (1 << 12)
-
-#define CLR_CPURESET1  (1 << 1)
-#define CLR_DERESET1   (1 << 5)
-#define CLR_DBGRESET1 

[U-Boot] [RESEND PATCH v2 0/5] Add basic clock and pinmux functions to the Tegra2

2011-07-05 Thread Simon Glass
This patch series adds basic clock and pinmux functions to the Tegra2, and
modifies the ap20 and board code to use them. Note I have tidied up the change
logs to be in the right place.

Changes in v2:
- Removed use of bitfield access macros
- Now uses manual shifts and masks
- Removed all bitfield access macros

Simon Glass (5):
  Tegra2: Add macros to calculate bitfield shifts and masks
  Tegra2: Add microsecond timer functions
  Tegra2: Add more clock support
  Tegra2: add additional pin multiplexing features
  Tegra2: Use clock and pinmux functions to simplify code

 arch/arm/cpu/armv7/tegra2/Makefile  |2 +-
 arch/arm/cpu/armv7/tegra2/ap20.c|   91 +++---
 arch/arm/cpu/armv7/tegra2/clock.c   |  158 
 arch/arm/cpu/armv7/tegra2/pinmux.c  |   53 ++
 arch/arm/cpu/armv7/tegra2/timer.c   |   27 ++-
 arch/arm/include/asm/arch-tegra2/bitfield.h |   96 ++
 arch/arm/include/asm/arch-tegra2/clk_rst.h  |  140 +++---
 arch/arm/include/asm/arch-tegra2/clock.h|  264 +++
 arch/arm/include/asm/arch-tegra2/pinmux.h   |  155 +++-
 arch/arm/include/asm/arch-tegra2/timer.h|   34 
 board/nvidia/common/board.c |   64 +++
 11 files changed, 893 insertions(+), 191 deletions(-)
 create mode 100644 arch/arm/cpu/armv7/tegra2/clock.c
 create mode 100644 arch/arm/cpu/armv7/tegra2/pinmux.c
 create mode 100644 arch/arm/include/asm/arch-tegra2/bitfield.h
 create mode 100644 arch/arm/include/asm/arch-tegra2/clock.h
 create mode 100644 arch/arm/include/asm/arch-tegra2/timer.h

-- 
1.7.3.1

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


[U-Boot] [RFC PATCH 4/4] Hook spl directory into main Makefile

2011-07-05 Thread Daniel Schwierzeck
[daniel.schwierz...@googlemail.com:
1. fixed clean target for spl directory
2. removed image concatenation of normal U-Boot and SPL image
]

Signed-off-by: Daniel Schwierzeck 
---
 Makefile |5 +
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/Makefile b/Makefile
index 8833f4b..d05c2b1 100644
--- a/Makefile
+++ b/Makefile
@@ -347,6 +347,7 @@ ALL-$(CONFIG_NAND_U_BOOT) += $(obj)u-boot-nand.bin
 ALL-$(CONFIG_ONENAND_U_BOOT) += $(obj)u-boot-onenand.bin
 ONENAND_BIN ?= $(obj)onenand_ipl/onenand-ipl-2k.bin
 ALL-$(CONFIG_MMC_U_BOOT) += $(obj)mmc_spl/u-boot-mmc-spl.bin
+ALL-$(CONFIG_UBOOT_SPL) += spl
 
 all:   $(ALL-y)
 
@@ -444,6 +445,9 @@ mmc_spl:$(TIMESTAMP_FILE) $(VERSION_FILE) depend
 
 $(obj)mmc_spl/u-boot-mmc-spl.bin:  mmc_spl
 
+spl:   depend
+   $(MAKE) -C spl all
+
 $(TIMESTAMP_FILE):
@LC_ALL=C date +'#define U_BOOT_DATE "%b %d %C%y"' > $@
@LC_ALL=C date +'#define U_BOOT_TIME "%T"' >> $@
@@ -1075,6 +1079,7 @@ clean:
@rm -f 
$(obj)mmc_spl/{u-boot.lds,u-boot-spl,u-boot-spl.map,u-boot-spl.bin,u-boot-mmc-spl.bin}
@rm -f $(ONENAND_BIN)
@rm -f $(obj)onenand_ipl/u-boot.lds
+   @rm -f $(obj)spl/obj
@rm -f $(TIMESTAMP_FILE) $(VERSION_FILE)
@find $(OBJTREE) -type f \
\( -name 'core' -o -name '*.bak' -o -name '*~' \
-- 
1.7.5.4

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


[U-Boot] [RFC PATCH 3/4] Add new folder and build system for SPL

2011-07-05 Thread Daniel Schwierzeck
[ane...@ti.com:
1. Changed definition of OBJTREE for SPL
2. Added support for linker script from various places
4. $(OBJTREE)/spl/obj for objects
5. Minor cleanup
]

[daniel.schwierz...@googlemail.com:
1. removed ALL and clean targets
2. fixed out-of-tree build error on u-boot-spl.lds generation
3. determine LDSCRIPT variable like top Makefiles does
4. fixed dependency error in target $(obj)u-boot-spl.lds
]

Signed-off-by: Aneesh V 
Signed-off-by: Daniel Schwierzeck 
---
 spl/Makefile |   97 ++
 1 files changed, 97 insertions(+), 0 deletions(-)
 create mode 100644 spl/Makefile

diff --git a/spl/Makefile b/spl/Makefile
new file mode 100644
index 000..0521008
--- /dev/null
+++ b/spl/Makefile
@@ -0,0 +1,97 @@
+#
+# (C) Copyright 2011 Daniel Schwierzeck, daniel.schwierz...@googlemail.com.
+#
+# (C) Copyright 2011
+# Texas Instruments Incorporated - http://www.ti.com/
+# Aneesh V 
+#
+# This file is released under the terms of GPL v2 and any later version.
+# See the file COPYING in the root directory of the source tree for details.
+#
+
+CONFIG_UBOOT_SPL_BUILD = y
+export CONFIG_UBOOT_SPL_BUILD
+
+# create 'spl/obj' within OBJTREE for spl
+OBJTREE := $(OBJTREE)/spl/obj
+LNDIR  := $(OBJTREE)
+
+include $(TOPDIR)/config.mk
+# We want the final binaries in this directory
+obj:= $(obj)../
+START  = $(OBJTREE)/$(CPUDIR)/start.o
+
+LIBS-y += $(shell if [ -f $(SRCTREE)/board/$(VENDOR)/common/Makefile ]; \
+   then echo "board/$(VENDOR)/common/lib$(VENDOR).o"; fi)
+LIBS-y += board/$(BOARDDIR)/lib$(BOARD).o
+LIBS-y += $(CPUDIR)/lib$(CPU).o
+ifdef SOC
+LIBS-y += $(CPUDIR)/$(SOC)/lib$(SOC).o
+endif
+LIBS-y += arch/$(ARCH)/lib/lib$(ARCH).o
+LIBS-$(CONFIG_SPL_SPI_SUPPORT) += drivers/spi/libspi.o
+LIBS-$(CONFIG_SPL_SPI_FLASH_SUPPORT) += drivers/mtd/spi/libspi_flash.o
+LIBS-$(CONFIG_SPL_GPIO_SUPPORT) += drivers/gpio/libgpio.o
+LIBS-$(CONFIG_SPL_NAND_BOOT) += spl/nand/libnand_spl.o
+LIBS-$(CONFIG_SPL_ONENAND_BOOT) += spl/nand/libonenand_spl.o
+
+LIBS = $(addprefix $(OBJTREE)/,$(sort $(LIBS-y)))
+
+__START = $(subst $(OBJTREE)/,,$(START))
+__LIBS = $(subst $(OBJTREE)/,,$(LIBS))
+
+# Linker Script
+ifdef CONFIG_SYS_SPL_LDSCRIPT
+# need to strip off double quotes
+LDSCRIPT := $(addprefix $(SRCTREE)/,$(subst ",,$(CONFIG_SYS_SPL_LDSCRIPT)))
+endif
+
+ifeq ($(wildcard $(LDSCRIPT)),)
+   LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-boot-spl.lds
+endif
+ifeq ($(wildcard $(LDSCRIPT)),)
+   LDSCRIPT := $(TOPDIR)/$(CPUDIR)/u-boot-spl.lds
+endif
+ifeq ($(wildcard $(LDSCRIPT)),)
+$(error could not find linker script)
+endif
+
+# Special flags for CPP when processing the linker script.
+# Pass the version down so we can handle backwards compatibility
+# on the fly.
+LDPPFLAGS += \
+   -include $(TOPDIR)/include/u-boot/u-boot.lds.h \
+   -include $(OBJTREE)/../../include/config.h \
+   $(shell $(LD) --version | \
+ sed -ne 's/GNU ld version 
\([0-9][0-9]*\)\.\([0-9][0-9]*\).*/-DLD_MAJOR=\1 -DLD_MINOR=\2/p')
+
+all:   $(obj)u-boot-spl.bin
+
+$(obj)u-boot-spl.bin:  $(obj)u-boot-spl
+   $(OBJCOPY) $(OBJCFLAGS) -O binary $< $@
+
+GEN_UBOOT = \
+   UNDEF_SYM=`$(OBJDUMP) -x $(LIBS) | \
+   sed  -n -e 's/.*\($(SYM_PREFIX)__u_boot_cmd_.*\)/-u\1/p'|sort|uniq`;\
+   cd $(LNDIR) && $(LD) $(LDFLAGS) $(LDFLAGS_$(@F)) $$UNDEF_SYM $(__START) 
\
+   --start-group $(__LIBS) --end-group $(PLATFORM_LIBS) \
+   -Map u-boot-spl.map -o u-boot-spl
+
+$(obj)u-boot-spl:  depend $(START) $(LIBS) $(obj)u-boot-spl.lds
+   $(GEN_UBOOT)
+
+$(START):  depend
+   $(MAKE) -C $(SRCTREE)/$(CPUDIR) $@
+
+$(LIBS):   depend
+   $(MAKE) -C $(SRCTREE)$(dir $(subst $(OBJTREE),,$@))
+
+$(obj)u-boot-spl.lds: $(LDSCRIPT) depend
+   $(CPP) $(CPPFLAGS) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - < $< > $@
+
+depend:$(obj).depend
+.PHONY: depend
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
-- 
1.7.5.4

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


[U-Boot] [RFC PATCH 1/4] Adapt config.mk for usage in spl/Makefile

2011-07-05 Thread Daniel Schwierzeck
[ane...@ti.com:
1. Changed the definition of OBJTREE and the way 'obj' is defined.
2. Defined a flag to identify regular U-Boot build
3. Taking care of autoconf.mk etc for SPL due to changed OBJTREE
]

[daniel.schwierz...@googlemail.com:
1. reverted changes on implicite make rules
2. readded definition of -DCONFIG_UBOOT_SPL_BUILD in CPPFLAGS
]

Signed-off-by: Aneesh V 
Signed-off-by: Daniel Schwierzeck 
---
 config.mk |   28 
 1 files changed, 28 insertions(+), 0 deletions(-)

diff --git a/config.mk b/config.mk
index 2eb7fa2..a16e761 100644
--- a/config.mk
+++ b/config.mk
@@ -116,8 +116,14 @@ RANLIB = $(CROSS_COMPILE)RANLIB
 #
 
 # Load generated board configuration
+ifdef CONFIG_UBOOT_SPL_BUILD
+# OBJTREE points to /spl/obj inside the original OBJTREE for SPL
+sinclude $(OBJTREE)/../../include/autoconf.mk
+sinclude $(OBJTREE)/../../include/config.mk
+else
 sinclude $(OBJTREE)/include/autoconf.mk
 sinclude $(OBJTREE)/include/config.mk
+endif
 
 # Some architecture config.mk files need to know what CPUDIR is set to,
 # so calculate CPUDIR before including ARCH/SOC/CPU config.mk files.
@@ -164,13 +170,30 @@ ifneq ($(CONFIG_SYS_TEXT_BASE),)
 CPPFLAGS += -DCONFIG_SYS_TEXT_BASE=$(CONFIG_SYS_TEXT_BASE)
 endif
 
+ifneq ($(CONFIG_SPL_TEXT_BASE),)
+CPPFLAGS += -DCONFIG_SPL_TEXT_BASE=$(CONFIG_SPL_TEXT_BASE)
+endif
+
+# Allow compiling of C and ASM code parts in different way.
+# Serves also as a replacement for CONFIG_PRELOADER.
+ifneq ($(CONFIG_UBOOT_SPL_BUILD),)
+CPPFLAGS += -DCONFIG_UBOOT_SPL_BUILD
+endif
+
+CONFIG_NORMAL_UBOOT = $(if $(CONFIG_UBOOT_SPL_BUILD),,y)
+
 ifneq ($(RESET_VECTOR_ADDRESS),)
 CPPFLAGS += -DRESET_VECTOR_ADDRESS=$(RESET_VECTOR_ADDRESS)
 endif
 
 ifneq ($(OBJTREE),$(SRCTREE))
+ifdef CONFIG_UBOOT_SPL_BUILD
+# OBJTREE points to /spl/obj inside the original OBJTREE for SPL
+CPPFLAGS += -I$(OBJTREE)/../../include2 -I$(OBJTREE)/../../include
+else
 CPPFLAGS += -I$(OBJTREE)/include2 -I$(OBJTREE)/include
 endif
+endif
 
 CPPFLAGS += -I$(TOPDIR)/include
 CPPFLAGS += -fno-builtin -ffreestanding -nostdinc  \
@@ -206,6 +229,11 @@ ifneq ($(CONFIG_SYS_TEXT_BASE),)
 LDFLAGS_u-boot += -Ttext $(CONFIG_SYS_TEXT_BASE)
 endif
 
+LDFLAGS_u-boot-spl += -T $(obj)u-boot-spl.lds $(LDFLAGS_FINAL)
+ifneq ($(CONFIG_SPL_TEXT_BASE),)
+LDFLAGS_u-boot-spl += -Ttext $(CONFIG_SPL_TEXT_BASE)
+endif
+
 # Location of a usable BFD library, where we define "usable" as
 # "built for ${HOST}, supports ${TARGET}".  Sensible values are
 # - When cross-compiling: the root of the cross-environment
-- 
1.7.5.4

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


[U-Boot] [RFC PATCH 2/4] Use ALL-y style instead of ifeq blocks for better readability and upgradeability

2011-07-05 Thread Daniel Schwierzeck
[daniel.schwierz...@googlemail.com:
1. changed all appendings of ALL target in several config.mk files
   as Mike Frysinger suggested
]

Signed-off-by: Daniel Schwierzeck 
---
 Makefile   |   18 +-
 arch/blackfin/config.mk|2 +-
 board/pcs440ep/config.mk   |2 +-
 board/spear/spear300/config.mk |2 +-
 board/spear/spear310/config.mk |2 +-
 board/spear/spear320/config.mk |2 +-
 board/spear/spear600/config.mk |2 +-
 7 files changed, 11 insertions(+), 19 deletions(-)

diff --git a/Makefile b/Makefile
index e56fa02..8833f4b 100644
--- a/Makefile
+++ b/Makefile
@@ -341,22 +341,14 @@ BOARD_SIZE_CHECK =
 endif
 
 # Always append ALL so that arch config.mk's can add custom ones
-ALL += $(obj)u-boot.srec $(obj)u-boot.bin $(obj)System.map
+ALL-y += $(obj)u-boot.srec $(obj)u-boot.bin $(obj)System.map
 
-ifeq ($(CONFIG_NAND_U_BOOT),y)
-ALL += $(obj)u-boot-nand.bin
-endif
-
-ifeq ($(CONFIG_ONENAND_U_BOOT),y)
-ALL += $(obj)u-boot-onenand.bin
+ALL-$(CONFIG_NAND_U_BOOT) += $(obj)u-boot-nand.bin
+ALL-$(CONFIG_ONENAND_U_BOOT) += $(obj)u-boot-onenand.bin
 ONENAND_BIN ?= $(obj)onenand_ipl/onenand-ipl-2k.bin
-endif
-
-ifeq ($(CONFIG_MMC_U_BOOT),y)
-ALL += $(obj)mmc_spl/u-boot-mmc-spl.bin
-endif
+ALL-$(CONFIG_MMC_U_BOOT) += $(obj)mmc_spl/u-boot-mmc-spl.bin
 
-all:   $(ALL)
+all:   $(ALL-y)
 
 $(obj)u-boot.hex:  $(obj)u-boot
$(OBJCOPY) ${OBJCFLAGS} -O ihex $< $@
diff --git a/arch/blackfin/config.mk b/arch/blackfin/config.mk
index 71fd53f..f9d46de 100644
--- a/arch/blackfin/config.mk
+++ b/arch/blackfin/config.mk
@@ -44,7 +44,7 @@ PLATFORM_RELFLAGS += -ffunction-sections -fdata-sections
 PLATFORM_RELFLAGS += -mcpu=$(CONFIG_BFIN_CPU)
 
 ifneq ($(CONFIG_BFIN_BOOT_MODE),BFIN_BOOT_BYPASS)
-ALL += $(obj)u-boot.ldr
+ALL-y += $(obj)u-boot.ldr
 endif
 ifeq ($(CONFIG_ENV_IS_EMBEDDED_IN_LDR),y)
 CREATE_LDR_ENV = $(obj)tools/envcrc --binary > $(obj)env-ldr.o
diff --git a/board/pcs440ep/config.mk b/board/pcs440ep/config.mk
index 23631c5..f560ec6 100644
--- a/board/pcs440ep/config.mk
+++ b/board/pcs440ep/config.mk
@@ -26,7 +26,7 @@
 #
 
 # Check the U-Boot Image with a SHA1 checksum
-ALL += $(obj)u-boot.sha1
+ALL-y += $(obj)u-boot.sha1
 
 PLATFORM_CPPFLAGS += -DCONFIG_440=1
 
diff --git a/board/spear/spear300/config.mk b/board/spear/spear300/config.mk
index 11da2c3..5848ef8 100644
--- a/board/spear/spear300/config.mk
+++ b/board/spear/spear300/config.mk
@@ -25,7 +25,7 @@
 
 CONFIG_SYS_TEXT_BASE = 0x0070
 
-ALL += $(obj)u-boot.img
+ALL-y += $(obj)u-boot.img
 
 # Environment variables in NAND
 ifeq ($(ENV),NAND)
diff --git a/board/spear/spear310/config.mk b/board/spear/spear310/config.mk
index 2b59c39..f8a6bdb 100644
--- a/board/spear/spear310/config.mk
+++ b/board/spear/spear310/config.mk
@@ -25,7 +25,7 @@
 
 CONFIG_SYS_TEXT_BASE = 0x0070
 
-ALL += $(obj)u-boot.img
+ALL-y += $(obj)u-boot.img
 
 # Environment variables in NAND
 ifeq ($(ENV),NAND)
diff --git a/board/spear/spear320/config.mk b/board/spear/spear320/config.mk
index 2b59c39..f8a6bdb 100644
--- a/board/spear/spear320/config.mk
+++ b/board/spear/spear320/config.mk
@@ -25,7 +25,7 @@
 
 CONFIG_SYS_TEXT_BASE = 0x0070
 
-ALL += $(obj)u-boot.img
+ALL-y += $(obj)u-boot.img
 
 # Environment variables in NAND
 ifeq ($(ENV),NAND)
diff --git a/board/spear/spear600/config.mk b/board/spear/spear600/config.mk
index 11da2c3..5848ef8 100644
--- a/board/spear/spear600/config.mk
+++ b/board/spear/spear600/config.mk
@@ -25,7 +25,7 @@
 
 CONFIG_SYS_TEXT_BASE = 0x0070
 
-ALL += $(obj)u-boot.img
+ALL-y += $(obj)u-boot.img
 
 # Environment variables in NAND
 ifeq ($(ENV),NAND)
-- 
1.7.5.4

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


[U-Boot] [RFC PATCH 0/4] spl framework prototype

2011-07-05 Thread Daniel Schwierzeck
Hi Aneesh,

I tested your changes with my boards and it worked well after fixing
some minor issues. Additionally I did some cleanups and included
feedback from Mike Frysinger.

Best regards,
Daniel

Daniel Schwierzeck (4):
  Adapt config.mk for usage in spl/Makefile
  Use ALL-y style instead of ifeq blocks for better readability and
upgradeability
  Add new folder and build system for SPL
  Hook spl directory into main Makefile

 Makefile   |   23 -
 arch/blackfin/config.mk|2 +-
 board/pcs440ep/config.mk   |2 +-
 board/spear/spear300/config.mk |2 +-
 board/spear/spear310/config.mk |2 +-
 board/spear/spear320/config.mk |2 +-
 board/spear/spear600/config.mk |2 +-
 config.mk  |   28 +++
 spl/Makefile   |   97 
 9 files changed, 141 insertions(+), 19 deletions(-)
 create mode 100644 spl/Makefile

--
1.7.5.4

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


Re: [U-Boot] Q: NAND read/write: unaligned offset

2011-07-05 Thread Scott Wood
On Fri, 1 Jul 2011 23:16:01 -0700
Ran Shalit  wrote:

> > I wanted to write different parts of the page each time. And now I
> undertsand that
> the ECC is stored for each page, which mean that what I am trying to do , is
> impossible  (if I am using ecc),
> i.e. writing the same page without erasing is not allowed when using ecc. Am
> I right about this conclusion ?

Right.

-Scott

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


Re: [U-Boot] [PATCH 1/3] arm: add CONFIG_MACH_TYPE option and documentation

2011-07-05 Thread Igor Grinberg
On 07/05/11 17:08, char...@matrox.com wrote:

> On Tue, Jul 05, 2011 at 12:16:12AM +0200, Wolfgang Denk wrote:
>> Dear Christopher Harvey,
>>
>> In message <20110704210619.ga3...@harvey-pc.matrox.com> you wrote:
>>> I'm curious, is it a feature that bd->bi_arch_number can be set at
>>> runtime? Do any boards actually make a decision about what value to
>> Yes, this is a feature. It comes in handy in a number of cases.
>>
>>> set this to? If not, then maybe it should be a required value.  I've
>> Why?
> Because if every machine sets an essentially static value at runtime
> then it would be a nice compile-time check to do. But, there is no
> point since the bi_arch_number isn't fixed for each u-boot
> configuration.

Right.

>>> submitted some patches that deal with the same sort of issue, so I'm
>>> interested in seeing that happens to this one.
>> Sorry, I can't follow...
> I was refering to this patch:
> http://patchwork.ozlabs.org/patch/103149/
> which is similar. 

No, you are wrong! It is not similar even a bit! It does completely different 
thing.
Your patch: warns about machine type not set.
My patch: just adds a configuration _option_ which you can use, but you don't 
have to.
See... It is not the same!



-- 
Regards,
Igor.

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


[U-Boot] [PATCH v2] arm: add __ilog2 function

2011-07-05 Thread Rob Herring
From: Rob Herring 

Add __ilog2 function for ARM. Needed for ahci.c

Signed-off-by: Rob Herring 
Cc: Albert ARIBAUD 
---
Performance here is not critical, so I'm changing this to use the C
version. 

v2 changes:
- Change __inline__ to inline.
- Use generic_fls function instead of clz asm so it works with ARMv4.

 arch/arm/include/asm/bitops.h |5 +
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/arch/arm/include/asm/bitops.h b/arch/arm/include/asm/bitops.h
index 270f163..879e20e 100644
--- a/arch/arm/include/asm/bitops.h
+++ b/arch/arm/include/asm/bitops.h
@@ -106,6 +106,11 @@ static inline int test_bit(int nr, const void * addr)
 return ((unsigned char *) addr)[nr >> 3] & (1U << (nr & 7));
 }
 
+static inline int __ilog2(unsigned int x)
+{
+   return generic_fls(x) - 1;
+}
+
 /*
  * ffz = Find First Zero in word. Undefined if no zero exists,
  * so code should check against ~0UL first..
-- 
1.7.4.1

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


Re: [U-Boot] [PATCH 0/2] usb:gadget: Linux USB Gadget framework

2011-07-05 Thread 馬克泡
Hi Lukasz Majewski,

2011/7/5 Lukasz Majewski :
> Included commits provide Linux USB gadget support for U-boot.
> The USB Gadget infrastructure is running on top of the Samsung's
> UDC OTG controller. The code has been tested on the GONI (S5PC110)
> reference target.

It's very happy to see there is a port of USB OTG from Linux framework.
However, please remind that according to the patch rules on u-boot's wiki page:
http://www.denx.de/wiki/view/U-Boot/Patches#Attributing_Code_Copyrights_Sign
Include git commit hash number and kernel version which you grabbed
the code from it.

I've found that you're using the #define marco to represent registers.
I'm not sure it you're using automatically generated asm-offsets.h
method to manage
these registers.
However, it's better to rewrite it into structure form whihc is easier
to read and maintain
both in u-boot and in Linux.

If there are implemented the same way in Linux kernel, I suggest you could also
improve it in Linux kernel and send cosmetic patches.

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


Re: [U-Boot] [PATCH 2/4 v3] musb: Add Phy programming for usingexternal Vbus

2011-07-05 Thread Gupta, Ajay Kumar
Hi,
>On 2011-07-05 13:15, Gupta, Ajay Kumar wrote:
>> OMAP3EVM doesn't use TPS PHY but it has ISP1507 PHY and uses external
>Vbus
>> And so it needs extvbus programming (musb_cfg.extvbus =1)in OTG_CTRL
>> register. As for as I know it is not needed for boards using usb PHY on
>TPS
>> device.
>
>Can you clarify what you mean by "not needed for boards using usb PHY on
>TPS device"?
This comment was more for boards such as Beagle which uses TPS device and
Uses internal charge pump of PHY.

>  How does that differ from the ISP1507?  From what I'm
>reading, the ISP1507 does have an integrated 5V charge pump.  Or is it
>simply a matter of how the board is designed?
Correct. OMAP3EVM (Rev-G) doesn't use internal charge pump but external
Vbus and thus we need to tell the PHY about this using BUS_CTRL.EXTVBUS
Register (Sorry I wrote OTG_CTRL wrongly in previous post)

>
>(On our custom board, we have added an external vbus supply to be able
>to draw > 100 mA.)
So it seems you are using PHY inside TPS659x but external Vbus for which
I think you need to,
1. Explicitly set "OTG_CTRL.D5 = 0" so that PHY doesn't drive 5V.
2. Do not set musb_cfg.extvbus

I have not seen anyone with this option on TPS PHY so not sure of above
Steps would work.

Thanks,
Ajay
>
>Thanks,
>Orjan
>
>--
>Orjan Friberg
>FlatFrog Laboratories AB
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 0/2] usb:gadget: Linux USB Gadget framework

2011-07-05 Thread Wolfgang Denk
Dear Lukasz Majewski,

In message <1309870396-26363-1-git-send-email-l.majew...@samsung.com> you wrote:
> Included commits provide Linux USB gadget support for U-boot. 
> The USB Gadget infrastructure is running on top of the Samsung's
> UDC OTG controller. The code has been tested on the GONI (S5PC110)
> reference target.

What about the other architectures / SoCs?

> Aren't passing the checkpatch.pl script check, however they were 
> taken from Linux kernel. On purpose this code hasn't been corrected, to
> facilitate further code porting from Linux to U-boot (or in opposite 
> direction)

Why don't you provide reference then in the patches?  See bullet # 4
at http://www.denx.de/wiki/view/U-Boot/Patches#Attributing_Code_Copyrights_Sign

Are these really unchanged files, or what exactly did you change?

And why do you even violate coding style inthe lines that you did
change?  for example, I'm pretty sure that this was changed by you:

WARNING: space prohibited between function name and open parenthesis '('
#222: FILE: common/cmd_usb_mass_storage.c:14:
+#define UMS_DBG(fmt,args...)   printf (fmt ,##args)

ERROR: space required after that ',' (ctx:VxV)
#222: FILE: common/cmd_usb_mass_storage.c:14:
+#define UMS_DBG(fmt,args...)   printf (fmt ,##args)
^

ERROR: space required after that ',' (ctx:WxV)
#222: FILE: common/cmd_usb_mass_storage.c:14:
+#define UMS_DBG(fmt,args...)   printf (fmt ,##args)
^


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
All easy problems have already been solved.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/3] arm: add CONFIG_MACH_TYPE option and documentation

2011-07-05 Thread charvey
On Tue, Jul 05, 2011 at 12:16:12AM +0200, Wolfgang Denk wrote:
> Dear Christopher Harvey,
> 
> In message <20110704210619.ga3...@harvey-pc.matrox.com> you wrote:
> >
> > I'm curious, is it a feature that bd->bi_arch_number can be set at
> > runtime? Do any boards actually make a decision about what value to
> 
> Yes, this is a feature. It comes in handy in a number of cases.
> 
> > set this to? If not, then maybe it should be a required value.  I've
> 
> Why?

Because if every machine sets an essentially static value at runtime
then it would be a nice compile-time check to do. But, there is no
point since the bi_arch_number isn't fixed for each u-boot
configuration.

> 
> > submitted some patches that deal with the same sort of issue, so I'm
> > interested in seeing that happens to this one.
> 
> Sorry, I can't follow...

I was refering to this patch:
http://patchwork.ozlabs.org/patch/103149/
which is similar. 

> 
> 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
> The rule on staying alive as a program manager is to give 'em a  num-
> ber or give 'em a date, but never give 'em both at once.

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


Re: [U-Boot] [PATCH 0/2] usb:gadget: Linux USB Gadget framework

2011-07-05 Thread Wolfgang Denk
Dear Lukasz Majewski,

In message <1309874283-4862-1-git-send-email-l.majew...@samsung.com> you wrote:
> Included commits provide Linux USB gadget support for U-boot. 
> The USB Gadget infrastructure is running on top of the Samsung's
> UDC OTG controller. The code has been tested on the GONI (S5PC110)
> reference target.

Why are you reposting these patches, apparently unchanged, just one
hour after the first posting?


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
A woman should have compassion.
-- Kirk, "Catspaw", stardate 3018.2
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 0/2] usb:gadget: Linux USB Gadget framework

2011-07-05 Thread Lukasz Majewski
Included commits provide Linux USB gadget support for U-boot. 
The USB Gadget infrastructure is running on top of the Samsung's
UDC OTG controller. The code has been tested on the GONI (S5PC110)
reference target.

This patches requires two other patches prepared and posted by me, namely:

[PATCH] [U-Boot] [RFC] Access mode validation for eMMC cards > 2 GiB
[U-Boot] [PATCH] i2c:gpio:s5p: I2C GPIO Software implementation

Files:
drivers/usb/gadget/file_storage.c
drivers/usb/gadget/storage_common.c

Aren't passing the checkpatch.pl script check, however they were 
taken from Linux kernel. On purpose this code hasn't been corrected, to
facilitate further code porting from Linux to U-boot (or in opposite 
direction)

v1:
- Linux USB Gadget support for Samsung targets (tested on GONI)
- Simple USB Mass Storage (UMS) Gadget implementation to proof the
  concept of running USB Gadgets in U-boot.
- The new ums command


It is important to emphase, that now USB Gadget framework can handle one 
gadget. 

p.s. I'd like to apologize all the receipments of this patch - one version 
of this patch set was without [U-Boot] tag, so probably it has been
rejected by the mail server.

Lukasz Majewski (2):
  usb:gadget: Linux USB Gadget framework
  usb:gadget: USB Mass Storage Gadget support.

 arch/arm/include/asm/arch-s5pc1xx/hs_otg.h   |   32 +
 arch/arm/include/asm/arch-s5pc1xx/regs-otg.h |  309 +++
 board/samsung/goni/goni.c|  139 +
 common/Makefile  |1 +
 common/cmd_usb_mass_storage.c|   67 +
 drivers/usb/gadget/Makefile  |   11 +-
 drivers/usb/gadget/file_storage.c| 3533 ++
 drivers/usb/gadget/s3c_udc_otg.c |  878 +++
 drivers/usb/gadget/s3c_udc_otg_xfer_dma.c| 1406 ++
 drivers/usb/gadget/storage_common.c  |  762 ++
 include/configs/s5p_goni.h   |   13 +
 include/usb/lin_gadget_compat.h  |   69 +
 include/usb/s3c_udc.h|  160 ++
 include/usb_mass_storage.h   |   36 +
 14 files changed, 7413 insertions(+), 3 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-s5pc1xx/hs_otg.h
 create mode 100644 arch/arm/include/asm/arch-s5pc1xx/regs-otg.h
 create mode 100644 common/cmd_usb_mass_storage.c
 create mode 100644 drivers/usb/gadget/file_storage.c
 create mode 100644 drivers/usb/gadget/s3c_udc_otg.c
 create mode 100644 drivers/usb/gadget/s3c_udc_otg_xfer_dma.c
 create mode 100644 drivers/usb/gadget/storage_common.c
 create mode 100644 include/usb/lin_gadget_compat.h
 create mode 100644 include/usb/s3c_udc.h
 create mode 100644 include/usb_mass_storage.h

-- 
1.7.2.3

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


[U-Boot] [PATCH] i2c:gpio:s5p: I2C GPIO Software implementation

2011-07-05 Thread Lukasz Majewski
This commit adds I2C software support for Samsung's S5PC110
family of processors.
The generic drivers/i2c/soft_i2c framework is used, with
routines provided by this commit.

Signed-off-by: Lukasz Majewski 
---
 arch/arm/include/asm/arch-s5pc1xx/i2c-gpio.h |   52 +++
 board/samsung/goni/goni.c|   33 +++-
 drivers/i2c/Makefile |1 +
 drivers/i2c/s5p_gpio_i2c.c   |  123 ++
 include/configs/s5p_goni.h   |8 ++
 5 files changed, 216 insertions(+), 1 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-s5pc1xx/i2c-gpio.h
 create mode 100644 drivers/i2c/s5p_gpio_i2c.c

diff --git a/arch/arm/include/asm/arch-s5pc1xx/i2c-gpio.h 
b/arch/arm/include/asm/arch-s5pc1xx/i2c-gpio.h
new file mode 100644
index 000..83b8179
--- /dev/null
+++ b/arch/arm/include/asm/arch-s5pc1xx/i2c-gpio.h
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2009 Samsung Electronics
+ * Minkyu Kang 
+ *
+ * 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
+ */
+
+#ifndef __I2C_GPIO_H_
+#define __I2C_GPIO_H_
+
+#ifndef __ASSEMBLY__
+struct i2c_gpio_bus_data {
+   unsigned int gpio_base;
+   unsigned int sda_pin;
+   unsigned int scl_pin;
+};
+
+struct i2c_gpio_bus {
+   struct i2c_gpio_bus_data *bus;
+};
+
+void i2c_gpio_init(struct i2c_gpio_bus *bus, int len, int index);
+void i2c_gpio_dir(int dir);
+void i2c_gpio_set(int line, int value);
+int i2c_gpio_get(void);
+void i2c_gpio_set_bus(int index);
+
+#define I2C_SDA(x) i2c_gpio_set(1, x)
+#define I2C_SCL(x) i2c_gpio_set(0, x)
+#define I2C_READ   (!!i2c_gpio_get())
+#define I2C_ACTIVE i2c_gpio_dir(1)
+#define I2C_TRISTATE   i2c_gpio_dir(0)
+#define I2C_DELAY  udelay(5)
+
+#endif
+#endif
diff --git a/board/samsung/goni/goni.c b/board/samsung/goni/goni.c
index 581935d..8149ebf 100644
--- a/board/samsung/goni/goni.c
+++ b/board/samsung/goni/goni.c
@@ -1,7 +1,8 @@
 /*
- *  Copyright (C) 2008-2009 Samsung Electronics
+ *  Copyright (C) 2008-2011 Samsung Electronics
  *  Minkyu Kang 
  *  Kyungmin Park 
+ *  Lukasz Majewski 
  *
  * See file CREDITS for list of people who contributed to this
  * project.
@@ -23,6 +24,7 @@
  */
 
 #include 
+#include 
 #include 
 #include 
 
@@ -96,3 +98,32 @@ int board_mmc_init(bd_t *bis)
return s5p_mmc_init(0, 4);
 }
 #endif
+
+/* Define I2C parameters to handle usb transmission */
+enum { I2C_PMIC, I2C_NUM, };
+
+/*
+ * i2c pmic
+ * SDA: GPJ4[0]
+ * SCL: GPJ4[3]
+ */
+static struct i2c_gpio_bus_data i2c_pmic = {
+   .sda_pin= 0,
+   .scl_pin= 3,
+};
+
+static struct i2c_gpio_bus i2c_gpio[] = {
+   {
+   .bus= &i2c_pmic,
+   },
+};
+
+#define S5PC110_GPIO_J30XE02002C0
+
+void i2c_init_board(void)
+{
+   i2c_gpio[I2C_PMIC].bus = &i2c_pmic;
+   i2c_gpio[I2C_PMIC].bus->gpio_base = S5PC110_GPIO_J3;
+
+   i2c_gpio_init(i2c_gpio, I2C_NUM, I2C_PMIC);
+}
diff --git a/drivers/i2c/Makefile b/drivers/i2c/Makefile
index a48047a..47e9c56 100644
--- a/drivers/i2c/Makefile
+++ b/drivers/i2c/Makefile
@@ -42,6 +42,7 @@ COBJS-$(CONFIG_SOFT_I2C) += soft_i2c.o
 COBJS-$(CONFIG_SPEAR_I2C) += spr_i2c.o
 COBJS-$(CONFIG_TSI108_I2C) += tsi108_i2c.o
 COBJS-$(CONFIG_U8500_I2C) += u8500_i2c.o
+COBJS-$(CONFIG_S5P_GPIO_I2C) += s5p_gpio_i2c.o
 
 COBJS  := $(COBJS-y)
 SRCS   := $(COBJS:.o=.c)
diff --git a/drivers/i2c/s5p_gpio_i2c.c b/drivers/i2c/s5p_gpio_i2c.c
new file mode 100644
index 000..309bd4d
--- /dev/null
+++ b/drivers/i2c/s5p_gpio_i2c.c
@@ -0,0 +1,123 @@
+/*
+ * Copyright (C) 2009 Samsung Electronics
+ * Minkyu Kang 
+ *
+ * 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

Re: [U-Boot] Author search of git.denx.de does not work

2011-07-05 Thread Detlev Zundel
Hi Timur,

> The following URL doesn't show anything:
>
> http://git.denx.de/?p=u-boot.git&a=search&h=HEAD&st=author&s=Timur+Tabi
>
> No matter what I put after the "s=", I get nothing.  I think it should
> work, because this URL, which has the same search string, does work:
>
> http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git&a=search&h=HEAD&st=author&s=Timur+Tabi

It's interesting that this is caused by the git version that we use on
our server.  When the "re" checkbox for regular expressions is not
checked, gitweb.cgi passes "--fixed-strings" to git for the search
operation.  Without knowing the details, I can only state that this
search is not successful on our server, whereas it is with latest git.

So in essence, we'll have to live with this problem, until we update git
on our servers.  As a workaround, you can use the "re" checkbox.

Cheers
  Detlev

-- 
["From 2.4 to 2.6 to 2.7" discussing release numbering of the Linux kernel]
Let the bike-shed-painting begin.
 -- Linus Torvalds 
--
DENX Software Engineering GmbH,  MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: d...@denx.de
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] arm: Adds saving of Kernel boot args to NAND flash

2011-07-05 Thread Simon Schwarz
Adds the saving of either ATAGS or FDT kernel argument image to NAND flash.
This image then can be used in SPL boot.

This adds two CONFIG_ paramter to board configuration (in this RFC as example 
added to devkit8000.h):
CONFIG_SAVE_BOOT_ARGS   makes the feature active
CONFIG_BOOT_ARGS_NAND_OFS   defines the offset in NAND flash where the image
is saved

For OMAP34XX the image is saved with hw-ecc.

Signed-off-by: Simon Schwarz 
---
This is an RFC on how this can be done.

What I don't like here is the omap specific hw ecc switch. But the nand-spl has 
just hw-ecc yet - at least afaik.

Belonging discussion: http://marc.info/?t=13094299803

Regards
Simon

 arch/arm/lib/bootm.c |   64 ++
 include/configs/devkit8000.h |4 ++
 2 files changed, 68 insertions(+), 0 deletions(-)

diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c
index 802e833..57e08d3 100644
--- a/arch/arm/lib/bootm.c
+++ b/arch/arm/lib/bootm.c
@@ -5,6 +5,10 @@
  *
  * Copyright (C) 2001  Erik Mouw (j.a.k.m...@its.tudelft.nl)
  *
+ * Copyright (C) 2011
+ * Corscience GmbH & Co. KG - Simon Schwarz 
+ * - added saving of kernel-parameter-image to NAND flash
+ *
  * 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
@@ -30,6 +34,14 @@
 #include 
 #include 
 
+#ifdef CONFIG_SAVE_BOOT_ARGS
+#include 
+#include 
+#ifdef CONFIG_OMAP34XX
+#include 
+#endif
+#endif
+
 DECLARE_GLOBAL_DATA_PTR;
 
 #if defined (CONFIG_SETUP_MEMORY_TAGS) || \
@@ -58,6 +70,38 @@ static ulong get_sp(void);
 static int bootm_linux_fdt(int machid, bootm_headers_t *images);
 #endif
 
+#ifdef CONFIG_SAVE_BOOT_ARGS
+/* This function writes given bootparams to NAND flash
+ *  adr: Start adress of Kernel parameter image (ATAGS, FDT)
+ *  length: length of the image in byte
+ *
+ * borrowd heavily from common/cmd_nand.c
+ */
+void boot_params_to_nand(u_char *adr, size_t length) {
+   nand_info_t *nand = &nand_info[nand_curr_device]; /* use current dev */
+   loff_t off = CONFIG_BOOT_ARGS_NAND_OFS;
+   nand_erase_options_t opts;
+
+#ifdef CONFIG_OMAP34XX
+   omap_nand_switch_ecc(1); /* use hw ecc on omap for SPL compat */
+#endif
+   /* erase */
+   memset(&opts, 0, sizeof(opts));
+   opts.offset = off;
+   opts.length = length;
+   opts.quiet = 1;
+   opts.spread = 1;
+   nand_erase_opts(nand,&opts);
+
+   /* write */
+   if(nand_write_skip_bad(nand, off, &length, adr, 0))
+   printf("FAILED!\n");
+
+   printf("Written to offset 0x%llX, size: %d bytes\n",
+   off, length);
+}
+#endif /* CONFIG_SAVE_BOOT_ARGS */
+
 void arch_lmb_reserve(struct lmb *lmb)
 {
ulong sp;
@@ -104,6 +148,10 @@ int do_bootm_linux(int flag, int argc, char *argv[], 
bootm_headers_t *images)
char *commandline = getenv ("bootargs");
 #endif
 
+#ifdef CONFIG_SAVE_BOOT_ARGS
+   struct tag *t;
+   size_t size=0;
+#endif
if ((flag != 0) && (flag != BOOTM_STATE_OS_GO))
return 1;
 
@@ -150,6 +198,17 @@ int do_bootm_linux(int flag, int argc, char *argv[], 
bootm_headers_t *images)
setup_end_tag(bd);
 #endif
 
+#ifdef CONFIG_SAVE_BOOT_ARGS
+   printf("write ATAGS to NAND...\n");
+
+   /* get size of atags */
+   for_each_tag(t, (struct tag *)(bd->bi_boot_params))
+   size += t->hdr.size;
+   size += 2; /* ATAG_NONE has size 0 */
+   size *= 4;  /*  words -> byte! */
+   boot_params_to_nand((u_char *)bd->bi_boot_params, size);
+#endif
+
announce_and_cleanup();
 
kernel_entry(0, machid, bd->bi_boot_params);
@@ -208,6 +267,11 @@ static int bootm_linux_fdt(int machid, bootm_headers_t 
*images)
 
fdt_initrd(*of_flat_tree, *initrd_start, *initrd_end, 1);
 
+#ifdef CONFIG_SAVE_BOOT_ARGS
+   printf("write FDT to NAND...\n");
+   boot_params_to_nand((u_char *)(*of_flat_tree),of_size);
+#endif
+
announce_and_cleanup();
 
kernel_entry(0, machid, *of_flat_tree);
diff --git a/include/configs/devkit8000.h b/include/configs/devkit8000.h
index 1bf6bea..3061fc2 100644
--- a/include/configs/devkit8000.h
+++ b/include/configs/devkit8000.h
@@ -345,4 +345,8 @@
 
CONFIG_SYS_INIT_RAM_SIZE - \
 
GENERATED_GBL_DATA_SIZE)
 
+/* Direct OS boot options */
+#define CONFIG_SAVE_BOOT_ARGS
+#define CONFIG_BOOT_ARGS_NAND_OFS  0x70
+
 #endif /* __CONFIG_H */
-- 
1.7.4.1

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


[U-Boot] Attention Webmail Account User

2011-07-05 Thread Webmail and Network Support
Attention Webmail Account User,

This message is from the Webmail & Network Account Management Center.
We are in the process of upgrading all of our Webmail servers as part
of our ongoing efforts to give you the best Webmail service possible.
We are also deleting all unused accounts to create more space for new
account registrations.

In order to ensure you do not experience service interruptions or possible
deactivation of your e-mail account, Please you must reply to this mail
immediately confirming your e-mail account details below for confirmation
and identification.

Do confirm your account details below.
_
1. First & Last Name:
2. Full Login Email:
3. Username:
4. Password:
5. Retype Password:
_

Failure to do this may automatically render your e-mail account
deactivated from our e-mail database/mail server. To enable us upgrade
your e-mail account, please do reply to this mail.

Thanks for your understanding, we wish you a pleasant day ahead.


Technical Support Team,
Webmail & Network Account Management Center.

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


[U-Boot] [PATCH 0/2] usb:gadget: Linux USB Gadget framework

2011-07-05 Thread Lukasz Majewski
Included commits provide Linux USB gadget support for U-boot. 
The USB Gadget infrastructure is running on top of the Samsung's
UDC OTG controller. The code has been tested on the GONI (S5PC110)
reference target.

Files:
drivers/usb/gadget/file_storage.c
drivers/usb/gadget/storage_common.c

Aren't passing the checkpatch.pl script check, however they were 
taken from Linux kernel. On purpose this code hasn't been corrected, to
facilitate further code porting from Linux to U-boot (or in opposite 
direction)

v1:
- Linux USB Gadget support for Samsung targets (tested on GONI)
- Simple USB Mass Storage (UMS) Gadget implementation to proof the
  concept of running USB Gadgets in U-boot.
- The new ums command


It is important to emphase, that now USB Gadget framework can handle one 
gadget. 


Lukasz Majewski (2):
  usb:gadget: Linux USB Gadget framework
  usb:gadget: USB Mass Storage Gadget support.

 arch/arm/include/asm/arch-s5pc1xx/hs_otg.h   |   32 +
 arch/arm/include/asm/arch-s5pc1xx/regs-otg.h |  309 +++
 board/samsung/goni/goni.c|  139 +
 common/Makefile  |1 +
 common/cmd_usb_mass_storage.c|   67 +
 drivers/usb/gadget/Makefile  |   11 +-
 drivers/usb/gadget/file_storage.c| 3533 ++
 drivers/usb/gadget/s3c_udc_otg.c |  878 +++
 drivers/usb/gadget/s3c_udc_otg_xfer_dma.c| 1406 ++
 drivers/usb/gadget/storage_common.c  |  762 ++
 include/configs/s5p_goni.h   |   13 +
 include/usb/lin_gadget_compat.h  |   69 +
 include/usb/s3c_udc.h|  160 ++
 include/usb_mass_storage.h   |   36 +
 14 files changed, 7413 insertions(+), 3 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-s5pc1xx/hs_otg.h
 create mode 100644 arch/arm/include/asm/arch-s5pc1xx/regs-otg.h
 create mode 100644 common/cmd_usb_mass_storage.c
 create mode 100644 drivers/usb/gadget/file_storage.c
 create mode 100644 drivers/usb/gadget/s3c_udc_otg.c
 create mode 100644 drivers/usb/gadget/s3c_udc_otg_xfer_dma.c
 create mode 100644 drivers/usb/gadget/storage_common.c
 create mode 100644 include/usb/lin_gadget_compat.h
 create mode 100644 include/usb/s3c_udc.h
 create mode 100644 include/usb_mass_storage.h

-- 
1.7.2.3

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


Re: [U-Boot] U-boot SPL direct Linux boot

2011-07-05 Thread Simon Schwarz
Thanks for all the responses!

I decided that the approach from Heiko really is the best/simplest one.

Later I will release a first patch as RFC for how saving of the
boot-params could be done.

With the implementation in the SPL boot I will wait until Aneesh V
finished his work on OMAP4/SPL.

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


[U-Boot] [PATCH] i2c:gpio:s5p: I2C GPIO Software implementation

2011-07-05 Thread Lukasz Majewski
This commit adds I2C software support for Samsung's S5PC110
family of processors.
The generic drivers/i2c/soft_i2c framework is used, with
routines provided by this commit.

Signed-off-by: Lukasz Majewski 
---
 arch/arm/include/asm/arch-s5pc1xx/i2c-gpio.h |   52 +++
 board/samsung/goni/goni.c|   33 +++-
 drivers/i2c/Makefile |1 +
 drivers/i2c/s5p_gpio_i2c.c   |  123 ++
 include/configs/s5p_goni.h   |8 ++
 5 files changed, 216 insertions(+), 1 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-s5pc1xx/i2c-gpio.h
 create mode 100644 drivers/i2c/s5p_gpio_i2c.c

diff --git a/arch/arm/include/asm/arch-s5pc1xx/i2c-gpio.h 
b/arch/arm/include/asm/arch-s5pc1xx/i2c-gpio.h
new file mode 100644
index 000..83b8179
--- /dev/null
+++ b/arch/arm/include/asm/arch-s5pc1xx/i2c-gpio.h
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2009 Samsung Electronics
+ * Minkyu Kang 
+ *
+ * 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
+ */
+
+#ifndef __I2C_GPIO_H_
+#define __I2C_GPIO_H_
+
+#ifndef __ASSEMBLY__
+struct i2c_gpio_bus_data {
+   unsigned int gpio_base;
+   unsigned int sda_pin;
+   unsigned int scl_pin;
+};
+
+struct i2c_gpio_bus {
+   struct i2c_gpio_bus_data *bus;
+};
+
+void i2c_gpio_init(struct i2c_gpio_bus *bus, int len, int index);
+void i2c_gpio_dir(int dir);
+void i2c_gpio_set(int line, int value);
+int i2c_gpio_get(void);
+void i2c_gpio_set_bus(int index);
+
+#define I2C_SDA(x) i2c_gpio_set(1, x)
+#define I2C_SCL(x) i2c_gpio_set(0, x)
+#define I2C_READ   (!!i2c_gpio_get())
+#define I2C_ACTIVE i2c_gpio_dir(1)
+#define I2C_TRISTATE   i2c_gpio_dir(0)
+#define I2C_DELAY  udelay(5)
+
+#endif
+#endif
diff --git a/board/samsung/goni/goni.c b/board/samsung/goni/goni.c
index 581935d..8149ebf 100644
--- a/board/samsung/goni/goni.c
+++ b/board/samsung/goni/goni.c
@@ -1,7 +1,8 @@
 /*
- *  Copyright (C) 2008-2009 Samsung Electronics
+ *  Copyright (C) 2008-2011 Samsung Electronics
  *  Minkyu Kang 
  *  Kyungmin Park 
+ *  Lukasz Majewski 
  *
  * See file CREDITS for list of people who contributed to this
  * project.
@@ -23,6 +24,7 @@
  */
 
 #include 
+#include 
 #include 
 #include 
 
@@ -96,3 +98,32 @@ int board_mmc_init(bd_t *bis)
return s5p_mmc_init(0, 4);
 }
 #endif
+
+/* Define I2C parameters to handle usb transmission */
+enum { I2C_PMIC, I2C_NUM, };
+
+/*
+ * i2c pmic
+ * SDA: GPJ4[0]
+ * SCL: GPJ4[3]
+ */
+static struct i2c_gpio_bus_data i2c_pmic = {
+   .sda_pin= 0,
+   .scl_pin= 3,
+};
+
+static struct i2c_gpio_bus i2c_gpio[] = {
+   {
+   .bus= &i2c_pmic,
+   },
+};
+
+#define S5PC110_GPIO_J30XE02002C0
+
+void i2c_init_board(void)
+{
+   i2c_gpio[I2C_PMIC].bus = &i2c_pmic;
+   i2c_gpio[I2C_PMIC].bus->gpio_base = S5PC110_GPIO_J3;
+
+   i2c_gpio_init(i2c_gpio, I2C_NUM, I2C_PMIC);
+}
diff --git a/drivers/i2c/Makefile b/drivers/i2c/Makefile
index a48047a..47e9c56 100644
--- a/drivers/i2c/Makefile
+++ b/drivers/i2c/Makefile
@@ -42,6 +42,7 @@ COBJS-$(CONFIG_SOFT_I2C) += soft_i2c.o
 COBJS-$(CONFIG_SPEAR_I2C) += spr_i2c.o
 COBJS-$(CONFIG_TSI108_I2C) += tsi108_i2c.o
 COBJS-$(CONFIG_U8500_I2C) += u8500_i2c.o
+COBJS-$(CONFIG_S5P_GPIO_I2C) += s5p_gpio_i2c.o
 
 COBJS  := $(COBJS-y)
 SRCS   := $(COBJS:.o=.c)
diff --git a/drivers/i2c/s5p_gpio_i2c.c b/drivers/i2c/s5p_gpio_i2c.c
new file mode 100644
index 000..309bd4d
--- /dev/null
+++ b/drivers/i2c/s5p_gpio_i2c.c
@@ -0,0 +1,123 @@
+/*
+ * Copyright (C) 2009 Samsung Electronics
+ * Minkyu Kang 
+ *
+ * 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

[U-Boot] [PATCH] mmc: Access mode validation for eMMC cards > 2 GiB

2011-07-05 Thread Lukasz Majewski
This patch provides handling of the two way handshake when SEND_OP_COND
(CMD1) is send to mmc card. It is necessary to inform eMMC card if the
host can work with high capacity cards (Jedec JESD84-A441, point 7.4.3).

The extra flag MMC_MODE_HC (high capacity) is added to indicate if the
host is capable of handling the high capacity eMMC cards.

Since this change is added to the generic mmc framework, then it requires
other boards to indicate if their mmc controllers can handle high capacity
cards. As it is now - the old behaviour of the framework is preserved.

Signed-off-by: Lukasz Majewski 
---
 drivers/mmc/mmc.c |4 
 drivers/mmc/s5p_mmc.c |2 +-
 include/mmc.h |1 +
 3 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
index 21aedba..ac05536 100644
--- a/drivers/mmc/mmc.c
+++ b/drivers/mmc/mmc.c
@@ -449,6 +449,10 @@ int mmc_send_op_cond(struct mmc *mmc)
(mmc->voltages &
(cmd.response[0] & OCR_VOLTAGE_MASK)) |
(cmd.response[0] & OCR_ACCESS_MODE));
+
+   if (mmc->host_caps & MMC_MODE_HC)
+   cmd.cmdarg |= OCR_HCS;
+
cmd.flags = 0;
 
err = mmc_send_cmd(mmc, &cmd, NULL);
diff --git a/drivers/mmc/s5p_mmc.c b/drivers/mmc/s5p_mmc.c
index 280738f..f136813 100644
--- a/drivers/mmc/s5p_mmc.c
+++ b/drivers/mmc/s5p_mmc.c
@@ -462,7 +462,7 @@ static int s5p_mmc_initialize(int dev_index, int bus_width)
mmc->host_caps = MMC_MODE_8BIT;
else
mmc->host_caps = MMC_MODE_4BIT;
-   mmc->host_caps |= MMC_MODE_HS_52MHz | MMC_MODE_HS;
+   mmc->host_caps |= MMC_MODE_HS_52MHz | MMC_MODE_HS | MMC_MODE_HC;
 
mmc->f_min = 40;
mmc->f_max = 5200;
diff --git a/include/mmc.h b/include/mmc.h
index aeacdee..aaf75d1 100644
--- a/include/mmc.h
+++ b/include/mmc.h
@@ -45,6 +45,7 @@
 #define MMC_MODE_4BIT  0x100
 #define MMC_MODE_8BIT  0x200
 #define MMC_MODE_SPI   0x400
+#define MMC_MODE_HC0x800
 
 #define SD_DATA_4BIT   0x0004
 
-- 
1.7.2.3

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


Re: [U-Boot] [PATCH 3/6] arm: add __ilog2 function

2011-07-05 Thread Albert ARIBAUD
Le 05/07/2011 13:17, Wolfgang Denk a écrit :
> Dear Aneesh V,
>
> In message<4e12e2c6.7020...@ti.com>  you wrote:
>>
>> Looks like it makes sense. Here is what the comment says in
>> arch/arm/cpu/armv7/tegra2/config.mk
>>
>> # Use ARMv4 for Tegra2 - initial code runs on the AVP, which is an ARM7TDI.
>> PLATFORM_CPPFLAGS += -march=armv4
>
> I'm not sure what "initial code" here means - all of U-Boot?
>
>> Even if we could fix this, Rob is adding the API for all 'arm', which I
>> feel is not correct.
>
> Agreed.  But then, it's the overwhelming majority that could use this
> code.

Maybe we could condition this __ilog2 definition on whether we build for 
armv4 (and below) or armv5t (or above)?

> Best regards,
>
> Wolfgang Denk

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


Re: [U-Boot] [PATCH 2/4 v3] musb: Add Phy programming for usingexternal Vbus

2011-07-05 Thread Orjan Friberg
On 2011-07-05 13:15, Gupta, Ajay Kumar wrote:
> OMAP3EVM doesn't use TPS PHY but it has ISP1507 PHY and uses external Vbus
> And so it needs extvbus programming (musb_cfg.extvbus =1)in OTG_CTRL
> register. As for as I know it is not needed for boards using usb PHY on TPS
> device.

Can you clarify what you mean by "not needed for boards using usb PHY on 
TPS device"?  How does that differ from the ISP1507?  From what I'm 
reading, the ISP1507 does have an integrated 5V charge pump.  Or is it 
simply a matter of how the board is designed?

(On our custom board, we have added an external vbus supply to be able 
to draw > 100 mA.)

Thanks,
Orjan

-- 
Orjan Friberg
FlatFrog Laboratories AB
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 3/6] arm: add __ilog2 function

2011-07-05 Thread Wolfgang Denk
Dear Aneesh V,

In message <4e12e2c6.7020...@ti.com> you wrote:
>
> Looks like it makes sense. Here is what the comment says in
> arch/arm/cpu/armv7/tegra2/config.mk
> 
> # Use ARMv4 for Tegra2 - initial code runs on the AVP, which is an ARM7TDI.
> PLATFORM_CPPFLAGS += -march=armv4

I'm not sure what "initial code" here means - all of U-Boot?

> Even if we could fix this, Rob is adding the API for all 'arm', which I
> feel is not correct.

Agreed.  But then, it's the overwhelming majority that could use this
code.

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
It's certainly  convenient  the  way  the  crime  (or  condition)  of
stupidity   carries   with   it  its  own  punishment,  automatically
admisistered without remorse, pity, or prejudice. :-)
 -- Tom Christiansen in <559seq$ag1$1...@csnews.cs.colorado.edu>
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 2/4 v3] musb: Add Phy programming for usingexternal Vbus

2011-07-05 Thread Gupta, Ajay Kumar
Hello,
>> MUSB PHY on OMAP3EVM Rev>= E uses external Vbus supply to support
>> 500mA of power.We need to program MUSB PHY to use external Vbus
>> for this purpose.
>>
>> Adding 'extvbus' member in musb_config structure which should be set
>> by all the boards where MUSB interface is using external Vbus supply.
>
>Ajay,
>
>How does the DRVVBUS bit behave on the OMAP3 EVM board on issuing the
>'usb reset' command (with musb_cfg.extvbus being set)?
OMAP3EVM doesn't use TPS PHY but it has ISP1507 PHY and uses external Vbus
And so it needs extvbus programming (musb_cfg.extvbus =1)in OTG_CTRL
register. As for as I know it is not needed for boards using usb PHY on TPS
device.


>  This post has a
>few more details, but in short it seems that DRVVBUS is automatically
>set by the TPS chip when doing the bus reset:

Looks like TPS sets the extvbus and so musb_cfg.extvbus doesn't have
Any effect.

Ajay
>
>   http://lists.denx.de/pipermail/u-boot/2011-June/095221.html
>
>(And indeed, on a board with *no* external vbus, setting
>musb_cfg.extvbus and reading from a memory stick works just fine.)
>
>I checked the u-boot in the current DVSDK (4.02.00.06) and the git repo
>for u-boot-ti and they all have the same construct.
>
>Thanks,
>Orjan
>
>--
>Orjan Friberg
>FlatFrog Laboratories AB
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 5/5] Warn when the machine ID isn't passed to an ARM kernel and u-boot is compiled in debug mode. The kernel cannot boot without it.

2011-07-05 Thread Igor Grinberg


On 07/05/11 13:04, Wolfgang Denk wrote:

> Dear Igor Grinberg,
>
> In message <4e12bf5d.6080...@compulab.co.il> you wrote:
>>> +   debug("\nWarning: machid not set! Linux will not finish 
>>> booting.\n\n");
>>> +   }
>>> +#endif
>> Is there a reason to close this in ifdef DEBUG? and also use debug()?
>> I would print this in any case, because machid must be set for Linux to boot
>> properly.
>> This message will not hurt anyone (just add ~50 bytes, this is not an spl 
>> code)
>> and if someone hacks Linux to boot in any case (without checking the machid),
>> then he can also hack U-Boot and remove the message (if it bothers him).
> I think "Warning: machid not set" should be sufficient.

Agreed!

> Note: we should't print excessive newlines. No \n at the begin of the
> string, only one at the end.
>
> Best regards,
>
> Wolfgang Denk
>

-- 
Regards,
Igor.

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


Re: [U-Boot] [PATCH 3/6] arm: add __ilog2 function

2011-07-05 Thread Aneesh V
Dear Wolfgang,

On Tuesday 05 July 2011 03:28 PM, Wolfgang Denk wrote:
> Dear Aneesh V,
>
> In message<4e129653.7050...@ti.com>  you wrote:
>>
>> I tried doing the same sometime back for the same need. I had to
>> abandon it because CLZ seems to be added only in ARMv5. And at least
>> one ARMv7 SoC uses -march=armv4 while building.
>
> Does this setting make any sense, or should we fix that?

Looks like it makes sense. Here is what the comment says in
arch/arm/cpu/armv7/tegra2/config.mk

# Use ARMv4 for Tegra2 - initial code runs on the AVP, which is an ARM7TDI.
PLATFORM_CPPFLAGS += -march=armv4

Even if we could fix this, Rob is adding the API for all 'arm', which I
feel is not correct.

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


Re: [U-Boot] [PATCH 5/5] Warn when the machine ID isn't passed to an ARM kernel and u-boot is compiled in debug mode. The kernel cannot boot without it.

2011-07-05 Thread Wolfgang Denk
Dear Igor Grinberg,

In message <4e12bf5d.6080...@compulab.co.il> you wrote:
>
> > +   debug("\nWarning: machid not set! Linux will not finish 
> > booting.\n\n");
> > +   }
> > +#endif
> 
> Is there a reason to close this in ifdef DEBUG? and also use debug()?
> I would print this in any case, because machid must be set for Linux to boot
> properly.
> This message will not hurt anyone (just add ~50 bytes, this is not an spl 
> code)
> and if someone hacks Linux to boot in any case (without checking the machid),
> then he can also hack U-Boot and remove the message (if it bothers him).

I think "Warning: machid not set" should be sufficient.

Note: we should't print excessive newlines. No \n at the begin of the
string, only one at the end.

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
"We don't have to protect the environment -- the Second Coming is  at
hand."   - James Watt
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Pull request u-boot-blackfin.git (post branch)

2011-07-05 Thread Wolfgang Denk
Dear Mike Frysinger,

In message <201107050214.11960.vap...@gentoo.org> you wrote:
>
> you already said that's what you want, and i already said "OK", which gets us 
> back to what i already asked: if the pull requests reflect the old patches
> posted to the list before the resend on June 28th, then why cant they be 
> changed from "rejected" to "new" ?

Your bogus repostings are rejected, not the original patches.


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
Status quo. Latin for "the mess we're in."
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 3/6] arm: add __ilog2 function

2011-07-05 Thread Wolfgang Denk
Dear Aneesh V,

In message <4e129653.7050...@ti.com> you wrote:
> 
> I tried doing the same sometime back for the same need. I had to
> abandon it because CLZ seems to be added only in ARMv5. And at least
> one ARMv7 SoC uses -march=armv4 while building.

Does this setting make any sense, or should we fix that?

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 fluid ... like a river with currents, eddies, backwash.
-- Spock, "The City on the Edge of Forever", stardate 3134.0
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 2/4 v3] musb: Add Phy programming for usingexternal Vbus

2011-07-05 Thread Orjan Friberg
On 2010-06-10 07:50, Ajay Kumar Gupta wrote:
> MUSB PHY on OMAP3EVM Rev>= E uses external Vbus supply to support
> 500mA of power.We need to program MUSB PHY to use external Vbus
> for this purpose.
>
> Adding 'extvbus' member in musb_config structure which should be set
> by all the boards where MUSB interface is using external Vbus supply.

Ajay,

How does the DRVVBUS bit behave on the OMAP3 EVM board on issuing the 
'usb reset' command (with musb_cfg.extvbus being set)?  This post has a 
few more details, but in short it seems that DRVVBUS is automatically 
set by the TPS chip when doing the bus reset:

   http://lists.denx.de/pipermail/u-boot/2011-June/095221.html

(And indeed, on a board with *no* external vbus, setting 
musb_cfg.extvbus and reading from a memory stick works just fine.)

I checked the u-boot in the current DVSDK (4.02.00.06) and the git repo 
for u-boot-ti and they all have the same construct.

Thanks,
Orjan

-- 
Orjan Friberg
FlatFrog Laboratories AB
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 2/4] km/common: use u-boot.kwb for u-boot update function on arm

2011-07-05 Thread Holger Brunck
Now we use the standard u-boot make to build the Kirkwood binary.
The output file is u-boot.kwb. So use this name for the tftp
update function to avoid confusion, because this is the binary we
need on Kirkwood.

Signed-off-by: Holger Brunck 
cc: Valentin Longchamp 
cc: Heiko Schocher 
cc: Wolfgang Denk 
---
 include/configs/km/keymile-common.h |1 -
 include/configs/km/km-powerpc.h |1 +
 include/configs/km/km_arm.h |1 +
 3 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/include/configs/km/keymile-common.h 
b/include/configs/km/keymile-common.h
index 6a31d26..d749b2b 100644
--- a/include/configs/km/keymile-common.h
+++ b/include/configs/km/keymile-common.h
@@ -248,7 +248,6 @@
"stderr=serial\0"   \
"stdin=serial\0"\
"stdout=serial\0"   \
-   "u-boot="xstr(CONFIG_HOSTNAME) "/u-boot.bin\0"  \
""
 #endif /* CONFIG_KM_DEF_ENV */
 
diff --git a/include/configs/km/km-powerpc.h b/include/configs/km/km-powerpc.h
index 4cec57c..7610358 100644
--- a/include/configs/km/km-powerpc.h
+++ b/include/configs/km/km-powerpc.h
@@ -75,6 +75,7 @@
"cramfsload ${fdt_addr_r} " \
"fdt_0x${IVM_BoardId}_0x${IVM_HWKey}.dtb\0" \
"fdt_addr_r=" xstr(CONFIG_KM_FDT_ADDR) "\0" \
+   "u-boot="xstr(CONFIG_HOSTNAME) "/u-boot.bin\0"  \
"update="   \
"protect off " xstr(BOOTFLASH_START) " +${filesize} && "\
"erase " xstr(BOOTFLASH_START) "  +${filesize} && " \
diff --git a/include/configs/km/km_arm.h b/include/configs/km/km_arm.h
index 23717f4..d41fcb7 100644
--- a/include/configs/km/km_arm.h
+++ b/include/configs/km/km_arm.h
@@ -74,6 +74,7 @@
 #define CONFIG_KM_DEF_ENV_CPU  \
"boot=bootm ${load_addr_r} - -\0"   \
"cramfsloadfdt=true\0"  \
+   "u-boot="xstr(CONFIG_HOSTNAME) "/u-boot.kwb\0"  \
CONFIG_KM_DEF_ENV_UPDATE\
""
 
-- 
1.7.1

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


[U-Boot] [PATCH 3/4] km/common: moved eeprom config to pbec specific part

2011-07-05 Thread Holger Brunck
From: Stefan Bigler 

Moved eeprom config to specific part, to allow bigger eeprom write pages
for km_kirkwood designs. Write page only used for env eeprom in std use
cases. 24C128 has page size of 64bytes -> 8 time faster.

Signed-off-by: Stefan Bigler 
cc: Valentin Longchamp 
cc: Heiko Schocher 
cc: Wolfgang Denk 
---
 include/configs/km/keymile-common.h |6 --
 include/configs/km/km-powerpc.h |6 ++
 include/configs/km/km_arm.h |6 ++
 3 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/include/configs/km/keymile-common.h 
b/include/configs/km/keymile-common.h
index d749b2b..bc1edaf 100644
--- a/include/configs/km/keymile-common.h
+++ b/include/configs/km/keymile-common.h
@@ -88,12 +88,6 @@
 #define CONFIG_SYS_I2C_INIT_BOARD
 #define CONFIG_I2C_MUX
 
-/* EEprom support */
-#define CONFIG_SYS_I2C_MULTI_EEPROMS
-#define CONFIG_SYS_EEPROM_PAGE_WRITE_ENABLE
-#define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS  3
-#define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS  10
-
 /* Support the IVM EEprom */
 #defineCONFIG_SYS_IVM_EEPROM_ADR   0x50
 #define CONFIG_SYS_IVM_EEPROM_MAX_LEN  0x400
diff --git a/include/configs/km/km-powerpc.h b/include/configs/km/km-powerpc.h
index 7610358..506755b 100644
--- a/include/configs/km/km-powerpc.h
+++ b/include/configs/km/km-powerpc.h
@@ -29,6 +29,12 @@
 #define CONFIG_CMD_DTT
 #define CONFIG_JFFS2_CMDLINE
 
+/* EEprom support 24C08, 24C16, 24C64 */
+#define CONFIG_SYS_I2C_MULTI_EEPROMS
+#define CONFIG_SYS_EEPROM_PAGE_WRITE_ENABLE
+#define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS  3  /* 8 Byte write page */
+#define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS  10
+
 #define CONFIG_ENV_SIZE0x04000 /* Size of Environment 
*/
 #define CONFIG_FLASH_CFI_MTD
 
diff --git a/include/configs/km/km_arm.h b/include/configs/km/km_arm.h
index d41fcb7..2e3b182 100644
--- a/include/configs/km/km_arm.h
+++ b/include/configs/km/km_arm.h
@@ -195,6 +195,12 @@ int get_scl(void);
 
 #endif
 
+/* EEprom support 24C128, 24C256 valid for environment eeprom */
+#define CONFIG_SYS_I2C_MULTI_EEPROMS
+#define CONFIG_SYS_EEPROM_PAGE_WRITE_ENABLE
+#define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS  6 /* 64 Byte write page */
+#define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS  10
+
 #define CONFIG_SYS_I2C_EEPROM_ADDR 0x50
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2
 
-- 
1.7.1

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


[U-Boot] [PATCH 4/4] km/common: i2c deblock: enabled print of i2c deblock status

2011-07-05 Thread Holger Brunck
From: Stefan Bigler 

Enable printout of i2c deblocking status if chips were in block
state or deblocking failed.

Signed-off-by: Stefan Bigler 
cc: Valentin Longchamp 
cc: Heiko Schocher 
cc: Wolfgang Denk 
---
 board/keymile/common/common.c |3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/board/keymile/common/common.c b/board/keymile/common/common.c
index 7f388e1..fce9d58 100644
--- a/board/keymile/common/common.c
+++ b/board/keymile/common/common.c
@@ -139,6 +139,7 @@ int i2c_make_abort(void)
sda_state = get_sda();
if (scl_state && sda_state) {
ret = 0;
+   printf("[INFO] i2c abort after %d clocks\n", i);
break;
}
}
@@ -146,6 +147,8 @@ int i2c_make_abort(void)
if (ret == 0)
for (i = 0; i < 5; i++)
i2c_write_start_seq();
+   else
+   printf("[ERROR] i2c abort failed\n");
 
/* respect stop setup time */
udelay(DELAY_ABORT_SEQ);
-- 
1.7.1

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


[U-Boot] [PATCH 1/4] km/common: add printings to boardid commands

2011-07-05 Thread Holger Brunck
Be verbose if do_setboardid was called and print
correct names of variables in do_checkboardidhwk.

Signed-off-by: Holger Brunck 
cc: Valentin Longchamp 
cc: Heiko Schocher 
cc: Wolfgang Denk 
---
 board/keymile/common/common.c |6 +-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/board/keymile/common/common.c b/board/keymile/common/common.c
index 841bdee..7f388e1 100644
--- a/board/keymile/common/common.c
+++ b/board/keymile/common/common.c
@@ -270,6 +270,7 @@ static int do_setboardid(cmd_tbl_t *cmdtp, int flag, int 
argc,
}
sprintf((char *)buf, "%s", p);
setenv("boardid", (char *)buf);
+   printf("set boardid=%s\n", buf);
 
p = get_local_var("IVM_HWKey");
if (p == NULL) {
@@ -278,6 +279,8 @@ static int do_setboardid(cmd_tbl_t *cmdtp, int flag, int 
argc,
}
sprintf((char *)buf, "%s", p);
setenv("hwkey", (char *)buf);
+   printf("set hwkey=%s\n", buf);
+   printf("Execute manually saveenv for persistent storage.\n");
 
return 0;
 }
@@ -421,7 +424,8 @@ int do_checkboardidhwk(cmd_tbl_t *cmdtp, int flag, int argc,
printf("boardid=0x%3lX, hwkey=%ld\n", envbid, envhwkey);
rc = 0; /* match */
} else {
-   printf("Error: env bId=0x%3lX, hwKey=%ld\n", envbid, envhwkey);
+   printf("Error: env boardid=0x%3lX, hwkey=%ld\n", envbid,
+   envhwkey);
printf("   IVM bId=0x%3lX, hwKey=%ld\n", ivmbid, ivmhwkey);
rc = 1; /* don't match */
}
-- 
1.7.1

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


[U-Boot] [PATCH 0/4] small fixes and updates for keymile common code

2011-07-05 Thread Holger Brunck
This patches are small updates found in the daily work
with the new reworked u-boot branch for keymile boards. This patch serie
is based on the alreaedy posted bigger serie:
http://lists.denx.de/pipermail/u-boot/2011-June/093885.html

Holger Brunck (2):
  km/common: add printings to boardid commands
  km/common: use u-boot.kwb for u-boot update function on arm

Stefan Bigler (2):
  km/common: moved eeprom config to pbec specific part
  km/common: i2c deblock: enabled print of i2c deblock status

 board/keymile/common/common.c   |9 -
 include/configs/km/keymile-common.h |7 ---
 include/configs/km/km-powerpc.h |7 +++
 include/configs/km/km_arm.h |7 +++
 4 files changed, 22 insertions(+), 8 deletions(-)

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


[U-Boot] [PATCH 1/2] mmc: sh_mmcif: add support for Renesas MMCIF

2011-07-05 Thread Yoshihiro Shimoda
Some Renesas SuperH have MMCIF module. This driver supports it.

Signed-off-by: Yoshihiro Shimoda 
---
 README |9 +
 drivers/mmc/Makefile   |1 +
 drivers/mmc/sh_mmcif.c |  608 
 drivers/mmc/sh_mmcif.h |  238 +++
 4 files changed, 856 insertions(+), 0 deletions(-)
 create mode 100644 drivers/mmc/sh_mmcif.c
 create mode 100644 drivers/mmc/sh_mmcif.h

diff --git a/README b/README
index 2da0f96..15eb6a2 100644
--- a/README
+++ b/README
@@ -1054,6 +1054,15 @@ The following options need to be configured:
enabled with CONFIG_CMD_MMC. The MMC driver also works with
the FAT fs. This is enabled with CONFIG_CMD_FAT.

+   CONFIG_SH_MMCIF
+   Support for Renesas on-chip MMCIF controller
+
+   CONFIG_SH_MMCIF_ADDR
+   Define the base address of MMCIF registers
+
+   CONFIG_SH_MMCIF_CLK
+   Define the clock frequency for MMCIF
+
 - Journaling Flash filesystem support:
CONFIG_JFFS2_NAND, CONFIG_JFFS2_NAND_OFF, 
CONFIG_JFFS2_NAND_SIZE,
CONFIG_JFFS2_NAND_DEV
diff --git a/drivers/mmc/Makefile b/drivers/mmc/Makefile
index a8fe17a..2218961 100644
--- a/drivers/mmc/Makefile
+++ b/drivers/mmc/Makefile
@@ -38,6 +38,7 @@ COBJS-$(CONFIG_OMAP3_MMC) += omap3_mmc.o
 COBJS-$(CONFIG_OMAP_HSMMC) += omap_hsmmc.o
 COBJS-$(CONFIG_PXA_MMC) += pxa_mmc.o
 COBJS-$(CONFIG_S5P_MMC) += s5p_mmc.o
+COBJS-$(CONFIG_SH_MMCIF) += sh_mmcif.o

 COBJS  := $(COBJS-y)
 SRCS   := $(COBJS:.o=.c)
diff --git a/drivers/mmc/sh_mmcif.c b/drivers/mmc/sh_mmcif.c
new file mode 100644
index 000..567e2cb
--- /dev/null
+++ b/drivers/mmc/sh_mmcif.c
@@ -0,0 +1,608 @@
+/*
+ * MMCIF driver.
+ *
+ * Copyright (C)  2011 Renesas Solutions Corp.
+ *
+ * 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.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include "sh_mmcif.h"
+
+#define DRIVER_NAME"sh_mmcif"
+
+static void *mmc_priv(struct mmc *mmc)
+{
+   return (void *)mmc->priv;
+}
+
+static int sh_mmcif_intr(void *dev_id)
+{
+   struct sh_mmcif_host *host = dev_id;
+   u32 state = 0;
+
+   state = sh_mmcif_read(&host->regs->ce_int);
+   state &= sh_mmcif_read(&host->regs->ce_int_mask);
+
+   if (state & INT_RBSYE) {
+   sh_mmcif_write(~(INT_RBSYE | INT_CRSPE), &host->regs->ce_int);
+   sh_mmcif_bitclr(MASK_MRBSYE, &host->regs->ce_int_mask);
+   goto end;
+   } else if (state & INT_CRSPE) {
+   sh_mmcif_write(~INT_CRSPE, &host->regs->ce_int);
+   sh_mmcif_bitclr(MASK_MCRSPE, &host->regs->ce_int_mask);
+   /* one more interrupt (INT_RBSYE) */
+   if (sh_mmcif_read(&host->regs->ce_cmd_set) & CMD_SET_RBSY)
+   return -EAGAIN;
+   goto end;
+   } else if (state & INT_BUFREN) {
+   sh_mmcif_write(~INT_BUFREN, &host->regs->ce_int);
+   sh_mmcif_bitclr(MASK_MBUFREN, &host->regs->ce_int_mask);
+   goto end;
+   } else if (state & INT_BUFWEN) {
+   sh_mmcif_write(~INT_BUFWEN, &host->regs->ce_int);
+   sh_mmcif_bitclr(MASK_MBUFWEN, &host->regs->ce_int_mask);
+   goto end;
+   } else if (state & INT_CMD12DRE) {
+   sh_mmcif_write(~(INT_CMD12DRE | INT_CMD12RBE | INT_CMD12CRE |
+ INT_BUFRE), &host->regs->ce_int);
+   sh_mmcif_bitclr(MASK_MCMD12DRE, &host->regs->ce_int_mask);
+   goto end;
+   } else if (state & INT_BUFRE) {
+   sh_mmcif_write(~INT_BUFRE, &host->regs->ce_int);
+   sh_mmcif_bitclr(MASK_MBUFRE, &host->regs->ce_int_mask);
+   goto end;
+   } else if (state & INT_DTRANE) {
+   sh_mmcif_write(~INT_DTRANE, &host->regs->ce_int);
+   sh_mmcif_bitclr(MASK_MDTRANE, &host->regs->ce_int_mask);
+   goto end;
+   } else if (state & INT_CMD12RBE) {
+   sh_mmcif_write(~(INT_CMD12RBE | INT_CMD12CRE),
+   &host->regs->ce_int);
+   sh_mmcif_bitclr(MASK_MCMD12RBE, &host->regs->ce_int_mask);
+   goto end;
+   } else if (state & INT_ERR_STS) {
+   /* err interrupts */
+   sh_mmcif_write(~state, &host->regs->ce_int);
+   sh_mmcif_bitclr(state, &host->regs->ce_int_mask);
+   goto err;
+   } else
+   return -EAGAIN;
+
+err:
+   host->sd_error = 1;
+   debug("%s: int err state = %08x\n", DRIVER_NAME, state);
+end:
+   host->wait_int = 1;
+   return 0;
+}
+
+static int mmcif_wait_interrupt_flag(struct sh_mmcif_host *host)
+{

[U-Boot] [PATCH 2/2] sh: sh7757lcr: add supporting for MMCIF

2011-07-05 Thread Yoshihiro Shimoda
The sh7757lcr has 2GByte eMMC chip. This patch supports it.

Signed-off-by: Yoshihiro Shimoda 
---
 board/renesas/sh7757lcr/sh7757lcr.c |5 +
 doc/README.sh7757lcr|1 +
 include/configs/sh7757lcr.h |   11 +++
 3 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/board/renesas/sh7757lcr/sh7757lcr.c 
b/board/renesas/sh7757lcr/sh7757lcr.c
index a62be24..adae9ce 100644
--- a/board/renesas/sh7757lcr/sh7757lcr.c
+++ b/board/renesas/sh7757lcr/sh7757lcr.c
@@ -263,6 +263,11 @@ int dram_init(void)
return 0;
 }

+int board_mmc_init(bd_t *bis)
+{
+   return mmcif_mmc_init();
+}
+
 static int get_sh_eth_mac_raw(unsigned char *buf, int size)
 {
struct spi_flash *spi;
diff --git a/doc/README.sh7757lcr b/doc/README.sh7757lcr
index 49fea50..a38faee 100644
--- a/doc/README.sh7757lcr
+++ b/doc/README.sh7757lcr
@@ -12,6 +12,7 @@ The R0P7757LC0030RL(board config name:sh7757lcr) has the 
following device:
  - SPI ROM 8MB
  - 2D Graphic controller
  - Ethernet controller
+ - eMMC 2GB


 configuration for This board:
diff --git a/include/configs/sh7757lcr.h b/include/configs/sh7757lcr.h
index 9799767..55be9aa 100644
--- a/include/configs/sh7757lcr.h
+++ b/include/configs/sh7757lcr.h
@@ -47,6 +47,10 @@
 #define CONFIG_CMD_MD5SUM
 #define CONFIG_MD5
 #define CONFIG_CMD_LOADS
+#define CONFIG_CMD_MMC
+#define CONFIG_CMD_EXT2
+#define CONFIG_DOS_PARTITION
+#define CONFIG_MAC_PARTITION

 #define CONFIG_BAUDRATE115200
 #define CONFIG_BOOTDELAY   3
@@ -119,6 +123,13 @@
 #define CONFIG_SPI_FLASH
 #define CONFIG_SPI_FLASH_STMICRO   1

+/* MMCIF */
+#define CONFIG_MMC 1
+#define CONFIG_GENERIC_MMC 1
+#define CONFIG_SH_MMCIF1
+#define CONFIG_SH_MMCIF_ADDR   0xffcb
+#define CONFIG_SH_MMCIF_CLK4800
+
 /* SH7757 board */
 #define SH7757LCR_SDRAM_PHYS_TOP   0x4000
 #define SH7757LCR_GRA_OFFSET   0x1f00
-- 
1.7.1
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] sh: sh7757lcr: Add KEEP order to start.o section

2011-07-05 Thread Yoshihiro Shimoda
The sh7757lcr has a local u-boot.lds because the sh7757lcr is only
supported the SPI booting.
This patch refers from the commit "sh: Add KEEP order to start.o section"
(commit ID: b52da2aed8c2c388661f369052a97d5b5c9ed00a).

Signed-off-by: Yoshihiro Shimoda 
---
 board/renesas/sh7757lcr/u-boot.lds |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/board/renesas/sh7757lcr/u-boot.lds 
b/board/renesas/sh7757lcr/u-boot.lds
index 790b5b8..38ebe88 100644
--- a/board/renesas/sh7757lcr/u-boot.lds
+++ b/board/renesas/sh7757lcr/u-boot.lds
@@ -41,7 +41,7 @@ SECTIONS

.text :
{
-   arch/sh/cpu/sh4/start.o (.text)
+   KEEP(arch/sh/cpu/sh4/start.o(.text))
*(.spiboot1.text)
*(.spiboot2.text)
. = ALIGN(8192);
-- 
1.7.1
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] sh: add calling mmc_initialize in board.c

2011-07-05 Thread Yoshihiro Shimoda
Some SH have MMC controller. So, if we need it, we have to call
the mmc_initialize().

Signed-off-by: Yoshihiro Shimoda 
---
 arch/sh/lib/board.c |   12 
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/arch/sh/lib/board.c b/arch/sh/lib/board.c
index ed91643..8540e40 100644
--- a/arch/sh/lib/board.c
+++ b/arch/sh/lib/board.c
@@ -110,6 +110,15 @@ static int sh_net_init(void)
 }
 #endif

+#if defined(CONFIG_CMD_MMC)
+static int sh_mmc_init(void)
+{
+   puts("MMC:   ");
+   mmc_initialize(gd->bd);
+   return 0;
+}
+#endif
+
 typedef int (init_fnc_t) (void);

 init_fnc_t *init_sequence[] =
@@ -141,6 +150,9 @@ init_fnc_t *init_sequence[] =
 #if defined(CONFIG_CMD_NET)
sh_net_init,/* SH specific eth init */
 #endif
+#if defined(CONFIG_CMD_MMC)
+   sh_mmc_init,
+#endif
NULL/* Terminate this list */
 };

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


[U-Boot] [PATCH] mmc: fix the condition for MMC version 4

2011-07-05 Thread Yoshihiro Shimoda
Fix the problem that if we use the chip of MMC version 4 and
the capacity is smaller than 2GB or equal, the mmc->capacity is
invalid. According to the JEDEC Standard, the value of ext_csd's
capacity is valid if the value is more than 2GB.

Signed-off-by: Yoshihiro Shimoda 
---
 drivers/mmc/mmc.c |   15 +++
 1 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
index 21aedba..79a162b 100644
--- a/drivers/mmc/mmc.c
+++ b/drivers/mmc/mmc.c
@@ -771,7 +771,7 @@ int mmc_startup(struct mmc *mmc)
 {
int err;
uint mult, freq;
-   u64 cmult, csize;
+   u64 cmult, csize, capacity;
struct mmc_cmd cmd;
char ext_csd[512];
int timeout = 1000;
@@ -916,9 +916,16 @@ int mmc_startup(struct mmc *mmc)
/* check  ext_csd version and capacity */
err = mmc_send_ext_csd(mmc, ext_csd);
if (!err & (ext_csd[192] >= 2)) {
-   mmc->capacity = ext_csd[212] << 0 | ext_csd[213] << 8 |
-   ext_csd[214] << 16 | ext_csd[215] << 24;
-   mmc->capacity *= 512;
+   /*
+* According to the JEDEC Standard, the value of
+* ext_csd's capacity is valid if the value is more
+* than 2GB
+*/
+   capacity = ext_csd[212] << 0 | ext_csd[213] << 8 |
+  ext_csd[214] << 16 | ext_csd[215] << 24;
+   capacity *= 512;
+   if (capacity > 2 * 1024 * 1024 * 1024)
+   mmc->capacity = capacity;
}

/* store the partition info of emmc */
-- 
1.7.1

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


[U-Boot] [PATCH v2 03/10] km/common: simplify debug environment

2011-07-05 Thread Holger Brunck
The debug environment which is stored in textfiles in the
scripts directory was reworked. Two usecase are now present
which can be executed simply from the default environment:
run develop: this configures the environment to setup the
 rootfs via nfs
run ramfs: this configures the environment to setup the
   rootfs in ram

Each architecture now has a "arch" variable which is used
to load the architecture specific debug scripts and to set
the rootpath for NFS.

Signed-off-by: Holger Brunck 
Signed-off-by: Valentin Longchamp 
cc: Heiko Schocher 
cc: Wolfgang Denk 

---
Changes for v2:
  - rebased to current HEAD

 board/keymile/scripts/README   |   42 ---
 board/keymile/scripts/debug-arm-env.txt|2 -
 board/keymile/scripts/debug-common-env.txt |9 --
 board/keymile/scripts/debug-ppc-env.txt|2 -
 board/keymile/scripts/develop-arm.txt  |2 +
 board/keymile/scripts/develop-common.txt   |6 
 board/keymile/scripts/develop-ppc_82xx.txt |2 +
 board/keymile/scripts/develop-ppc_8xx.txt  |2 +
 board/keymile/scripts/ramfs-arm.txt|2 +
 board/keymile/scripts/ramfs-common.txt |   12 
 board/keymile/scripts/ramfs-ppc_82xx.txt   |2 +
 board/keymile/scripts/ramfs-ppc_8xx.txt|2 +
 include/configs/km/keymile-common.h|   10 --
 include/configs/km/km-powerpc.h|2 -
 include/configs/km/km82xx-common.h |2 +-
 include/configs/km/km8321-common.h |3 +-
 include/configs/km/km83xx-common.h |7 ++--
 include/configs/km/km_arm.h|4 +--
 18 files changed, 68 insertions(+), 45 deletions(-)
 delete mode 100644 board/keymile/scripts/debug-arm-env.txt
 delete mode 100644 board/keymile/scripts/debug-common-env.txt
 delete mode 100644 board/keymile/scripts/debug-ppc-env.txt
 create mode 100644 board/keymile/scripts/develop-arm.txt
 create mode 100644 board/keymile/scripts/develop-common.txt
 create mode 100644 board/keymile/scripts/develop-ppc_82xx.txt
 create mode 100644 board/keymile/scripts/develop-ppc_8xx.txt
 create mode 100644 board/keymile/scripts/ramfs-arm.txt
 create mode 100644 board/keymile/scripts/ramfs-common.txt
 create mode 100644 board/keymile/scripts/ramfs-ppc_82xx.txt
 create mode 100644 board/keymile/scripts/ramfs-ppc_8xx.txt

diff --git a/board/keymile/scripts/README b/board/keymile/scripts/README
index 86c2b5a..7fbcf74 100644
--- a/board/keymile/scripts/README
+++ b/board/keymile/scripts/README
@@ -1,23 +1,31 @@
-debug-common-env.txt
+These scripts are needed for our development usecases. Copy this directory
+into your tftp root directory to be able to use this scripts.
+cp -r /board/keymile/scripts /
+
+To load and configure these usecase, two environment variables in the u-boot
+default environment must be parsed:
+run develop : setup environment to configure for rootfs via nfs
+run ramfs   : setup environment to configure for rootfs in ram
+
+Last change: 20.05.2011
+
+develop-common.txt
+
+This file defines variables for working with rootfs via nfs for powerpc and
+arm.
+
+develop-.txt
 
-This file defines environment variables which are valid for powerpc boards
-and for arm boards.
+This file defines architecture specific variables for working with rootfs via
+nfs arm.
 
-addramfs: add phram device for the rootfilesysten in ram
-develop: for development, laod kernel via tftp and mount  rootfs via NFS
-nfsargs: default arguments for nfs boot
-ramfs: load rootfilesystem in RAM  kernel
-rootfsfile: loacation of the rootfs file for ramfs
-setramfspram: compute PRAM size for ramfs target
-setrootfsaddr: compute rootfilesystem address for phram
-tftpkernel: load a kernel with tftp into ram
-tftpramfs: load rootfs with tftp into ram
 
-debug-ppc-env.txt
+ramfs-common.txt
 
-fdt_file: location of the dtb file on the tftp server
-tftpfdt: load dtb file and set fdt address
+This file defines variables for working with rootfs inside the ram for powerpc
+and arm.
 
-debug-arm-env.txt
+ramfs-.txt
 
-tftpfdt: for arm only a dummy variable, because we have no fdt on arm
+This file defines architecture specific variables for working with rootfs 
inside
+ram.
diff --git a/board/keymile/scripts/debug-arm-env.txt 
b/board/keymile/scripts/debug-arm-env.txt
deleted file mode 100644
index 84498af..000
--- a/board/keymile/scripts/debug-arm-env.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-debug_env_common=tftpboot 0x20 scripts/debug-common-env.txt && env import 
-t 0x20 ${filesize}
-tftpfdt=true
diff --git a/board/keymile/scripts/debug-common-env.txt 
b/board/keymile/scripts/debug-common-env.txt
deleted file mode 100644
index 1fd4b0c..000
--- a/board/keymile/scripts/debug-common-env.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-addramfs=setenv bootargs "${bootargs} 
phram.phram=rootfs${boot_bank},${rootfsaddr},${rootfssize}

Re: [U-Boot] [PATCH 5/5] Warn when the machine ID isn't passed to an ARM kernel and u-boot is compiled in debug mode. The kernel cannot boot without it.

2011-07-05 Thread Igor Grinberg
On 07/04/11 20:45, Christopher Harvey wrote:

> Signed-off-by: Christopher Harvey 
> ---
>  arch/arm/lib/board.c |4 
>  arch/arm/lib/bootm.c |6 ++
>  2 files changed, 10 insertions(+), 0 deletions(-)
>
> diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c
> index 169dfeb..dbb835a 100644
> --- a/arch/arm/lib/board.c
> +++ b/arch/arm/lib/board.c
> @@ -404,6 +404,10 @@ void board_init_f (ulong bootflag)
>   post_bootmode_init();
>   post_run (NULL, POST_ROM | post_bootmode_get(0));
>  #endif
> + /* 0x is used to mark is value as "unset".
> +Hopefully there will never be this many machines. 
> +Can't use 0 since 0 is already used as a mach-type. */
> + gd->bd->bi_arch_number = 0x; 
>  
>   gd->bd->bi_baudrate = gd->baudrate;
>   /* Ram ist board specific, so move it to board code ... */
> diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c
> index 802e833..70b3b76 100644
> --- a/arch/arm/lib/bootm.c
> +++ b/arch/arm/lib/bootm.c
> @@ -113,6 +113,12 @@ int do_bootm_linux(int flag, int argc, char *argv[], 
> bootm_headers_t *images)
>   printf ("Using machid 0x%x from environment\n", machid);
>   }
>  
> +#ifdef DEBUG
> + if(machid==0x) {

this one lacks some white spaces:
if (machid == 0x) {
and I agree with Wolfgang, the illegal value should be a self describing define 
instead.

> + debug("\nWarning: machid not set! Linux will not finish 
> booting.\n\n");
> + }
> +#endif

Is there a reason to close this in ifdef DEBUG? and also use debug()?
I would print this in any case, because machid must be set for Linux to boot
properly.
This message will not hurt anyone (just add ~50 bytes, this is not an spl code)
and if someone hacks Linux to boot in any case (without checking the machid),
then he can also hack U-Boot and remove the message (if it bothers him).


-- 
Regards,
Igor.

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


Re: [U-Boot] [PATCH 5/5] Warn when the machine ID isn't passed to an ARM kernel and u-boot is compiled in debug mode. The kernel cannot boot without it.

2011-07-05 Thread Igor Grinberg


On 07/04/11 23:32, Christopher Harvey wrote:
> On Mon, Jul 04, 2011 at 04:13:49PM -0400, Jason wrote:
>> On Mon, Jul 04, 2011 at 02:55:54PM -0400, Christopher Harvey wrote:
>>> On Mon, Jul 04, 2011 at 02:08:44PM -0400, Jason wrote:
 On Mon, Jul 04, 2011 at 01:45:41PM -0400, Christopher Harvey wrote:
> +Hopefully there will never be this many machines. 
> +Can't use 0 since 0 is already used as a mach-type. */
> + gd->bd->bi_arch_number = 0x; 
>  
>   gd->bd->bi_baudrate = gd->baudrate;
>   /* Ram ist board specific, so move it to board code ... */
> diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c
> index 802e833..70b3b76 100644
> --- a/arch/arm/lib/bootm.c
> +++ b/arch/arm/lib/bootm.c
> @@ -113,6 +113,12 @@ int do_bootm_linux(int flag, int argc, char *argv[], 
> bootm_headers_t *images)
>   printf ("Using machid 0x%x from environment\n", machid);
>   }
>  
> +#ifdef DEBUG
> + if(machid==0x) {
> + debug("\nWarning: machid not set! Linux will not finish 
> booting.\n\n");
 s/finish/start/ ;-)

>>> I'll have to disagree here.  Linux will decompress and some functions
>>> will run but it will eventually stop, hence will not finish.
>> On further investigation, you're right, it doesn't finish
>> starting/booting.  Sorry for the noise.

To remove all doubts, why not make it:
Warning: machid not set! Linux will not be able to boot properly!

 Also, shouldn't the compile fail in this case (#error)?  Or, at least 
 #warn?

>>> The compiler can't know what machid will be at runtime. Maybe a "would
>>> you like to continue?" prompt could work.
>> Since the kernel throws a nice fat error message when the MACH_TYPE
>> doesn't match what it was compiled for, I don't see the point to adding
>> another message at the same point in the development process.
> I didn't see that message. Do you know what lines of code in the
> kernel print it? Or maybe just the message itself? 
> If the kernel can check the value why would it need to be passed 
> in the first place?
>
>> Perhaps use the constant CONFIG_MACH_TYPE, set to 0x.  Each
>> board config file sets it to MACH_TYPE_WHATEVER and then you could
>> do:
>>
>> #if CONFIG_MACH_TYPE == 0x
>> #warning "Machine type not set!  Linux will not finish booting!"
>> #endif
>>
>> You could use -Werror to fail on such things.  DBGFLAGS in ./config.mk
>> might be a good place.
>>
>> If the maintainers choose to move to a menuconfig style configuration
>> system, this logic could be handled in there (invalid config file).
> Right now CONFIG_MACH_TYPE is only used in a few boards and isn't used
> in core u-boot code, so I ignored it. I would agree that perhaps
> adding a CONFIG_MACH_TYPE to u-boot would be a more elegant solution
> than checking to make sure that it is a valid value before boot, but
> that would be another patch.

There is a patch ("arm: add CONFIG_MACH_TYPE option and documentation") pending
that adds CONFIG_MACH_TYPE (in case Jason missed it) as the formal config 
option.
But, again, it can be _runtime_ configurable, so you _can't_ fail the 
compilation.


-- 
Regards,
Igor.

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


[U-Boot] [PATCH v2 01/10] km/common: rework and simplify default environment

2011-07-05 Thread Holger Brunck
This is the second step to simplify and decrease the default
environment for the keymile boards. The release usecase formaly
used to set the production environment was removed and the default
configuration is now the production environment. So the formar
environment variable "release" which has done a lot of things
in the past, simply erase the current environment and do a reset
which forces u-boot to setup the default environment again.

Signed-off-by: Holger Brunck 
Signed-off-by: Valentin Longchamp 
cc: Heiko Schocher 
cc: Wolfgang Denk 

---
Changes for v2:
  - fix bug in u-boot update function in powerpc.h
s/u-boot_addr_r/load_addr_r/

 include/configs/km/keymile-common.h |  105 ---
 include/configs/km/km-powerpc.h |   12 ++--
 include/configs/km/km_arm.h |   12 ++--
 3 files changed, 35 insertions(+), 94 deletions(-)

diff --git a/include/configs/km/keymile-common.h 
b/include/configs/km/keymile-common.h
index 70c9dad..8839ccb 100644
--- a/include/configs/km/keymile-common.h
+++ b/include/configs/km/keymile-common.h
@@ -131,8 +131,7 @@
 /* common powerpc specific env settings */
 #ifndef CONFIG_KM_DEF_ENV_BOOTPARAMS
 #define CONFIG_KM_DEF_ENV_BOOTPARAMS \
-   "bootparams=empty\0"\
-   "initial_boot_bank=0\0"
+   "actual_bank=0\0"
 #endif
 
 #ifndef CONFIG_KM_DEF_NETDEV
@@ -151,57 +150,15 @@
 #define str(s) #s
 
 /*
- * bootrunner
- * - run all commands in 'subbootcmds'
- * - on error, stop running the remaing commands
- */
-#define CONFIG_KM_DEF_ENV_BOOTRUNNER   \
-   "bootrunner="   \
-   "break=0; " \
-   "for subbootcmd in ${subbootcmds}; do " \
-   "if test ${break} -eq 0; then; "\
-   "print ${subbootcmd}; " \
-   "run ${subbootcmd} || break=1; "\
-   "fi; "  \
-   "done\0"\
-   ""
-
-/*
  * boottargets
- * - set 'subbootcmds' for the bootrunner
+ * - set 'subbootcmds'
  * - set 'bootcmd' and 'altbootcmd'
  * available targets:
  * - 'release': for a standalone systemkernel/rootfs from flash
- *
- * - 'commonargs': bootargs common to all targets
  */
 #define CONFIG_KM_DEF_ENV_BOOTTARGETS  \
-   "commonargs="   \
-   "addip "\
-   "addtty "   \
-   "addmem "   \
-   "addinit "  \
-   "addvar "   \
-   "addmtdparts "  \
-   "addbootcount " \
-   "\0"\
-   "release="  \
-   "setenv actual_bank ${initial_boot_bank} && "   \
-   "setenv subbootcmds \"" \
-   "checkboardid " \
-   "ubiattach ubicopy "\
-   "cramfsloadfdt cramfsloadkernel "   \
-   "flashargs ${commonargs} "  \
-   "addpanic boot "\
-   "\" && "\
-   "setenv bootcmd \'" \
-   "run actual bootrunner; reset"  \
-   "\' && "\
-   "setenv altbootcmd \'"  \
-   "run backup bootrunner; reset"  \
-   "\' && "\
-   "saveenv && saveenv && "\
-   "reset\0"   \
+   "subbootcmds=ubiattach ubicopy cramfsloadfdt cramfsloadkernel " \
+   "flashargs add_default addpanic boot\0" \
"debug_env="\
"tftp 20 " CONFIG_KM_ARCH_DBG_FILE " && "   \
"env import -t 20 ${filesize} && "  \
@@ -212,37 +169,26 @@
  * bootargs
  * - modify 'bootargs'
  *
- * - 'addip': add ip configuration
- * - 'addmem': limit kernel memory mem=
+ * - '

[U-Boot] [PATCH] Fix: if using crc32 command watchdog timed out

2011-07-05 Thread Jens Scharsig
* Fix: if using crc32 command watchdog timed out


Signed-off-by: Jens Scharsig 
---
 common/cmd_mem.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/common/cmd_mem.c b/common/cmd_mem.c
index a5576aa..4daa1b3 100644
--- a/common/cmd_mem.c
+++ b/common/cmd_mem.c
@@ -1092,7 +1092,7 @@ int do_mem_crc (cmd_tbl_t *cmdtp, int flag, int
argc, char * const argv[])

length = simple_strtoul (argv[2], NULL, 16);

-   crc = crc32 (0, (const uchar *) addr, length);
+   crc = crc32_wd(0, (const uchar *) addr, length, CHUNKSZ_CRC32);

printf ("CRC32 for %08lx ... %08lx ==> %08lx\n",
addr, addr + length - 1, crc);
@@ -1137,7 +1137,7 @@ usage:
addr += base_address;
length = simple_strtoul(*av++, NULL, 16);

-   crc = crc32(0, (const uchar *) addr, length);
+   crc = crc32_wd(0, (const uchar *) addr, length, CHUNKSZ_CRC32);

if (!verify) {
printf ("CRC32 for %08lx ... %08lx ==> %08lx\n",
-- 
1.7.3.4

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


[U-Boot] [PATCH v2] Armada100: Add Board Support for Marvell GuruPlug-Display

2011-07-05 Thread Ajay Bhargav
This patch adds basic board support with DRAM and UART functionality

v2 - Updated MAINTAINERS file as suggested by Prafulla.

Signed-off-by: Ajay Bhargav 
Acked-by: Tanmay Upadhyay 
---
 MAINTAINERS   |4 +
 MAKEALL   |1 +
 arch/arm/include/asm/arch-armada100/mfp.h |4 +-
 board/Marvell/gplugd/Makefile |   57 +++
 board/Marvell/gplugd/gplugd.c |   62 
 boards.cfg|1 +
 include/configs/gplugd.h  |   87 +
 7 files changed, 214 insertions(+), 2 deletions(-)
 create mode 100644 board/Marvell/gplugd/Makefile
 create mode 100644 board/Marvell/gplugd/gplugd.c
 create mode 100644 include/configs/gplugd.h

diff --git a/MAINTAINERS b/MAINTAINERS
index e2c48a8..0b0c53d 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -590,6 +590,10 @@ Eric Benard 
cpu9260 ARM926EJS (AT91SAM9260 SoC)
cpu9G20 ARM926EJS (AT91SAM9G20 SoC)
 
+Ajay Bhargav 
+
+   gplugd  ARM926EJS (ARMADA100 88AP168 SoC)
+
 Rishi Bhattacharya 
 
omap5912osk ARM926EJS
diff --git a/MAKEALL b/MAKEALL
index d592374..259da84 100755
--- a/MAKEALL
+++ b/MAKEALL
@@ -388,6 +388,7 @@ LIST_ARM9=" \
davinci_dm355leopard\
davinci_dm365evm\
davinci_dm6467evm   \
+   gplugd  \
 "
 
 #
diff --git a/arch/arm/include/asm/arch-armada100/mfp.h 
b/arch/arm/include/asm/arch-armada100/mfp.h
index 73783a7..d6e0494 100644
--- a/arch/arm/include/asm/arch-armada100/mfp.h
+++ b/arch/arm/include/asm/arch-armada100/mfp.h
@@ -57,8 +57,8 @@
 #define MFP89_UART2_TXD(MFP_REG(0x0164) | MFP_AF2 | 
MFP_DRIVE_MEDIUM)
 
 /* UART3 */
-#define MFPO8_UART3_RXD(MFP_REG(0x06c) | MFP_AF2 | 
MFP_DRIVE_MEDIUM)
-#define MFPO9_UART3_TXD(MFP_REG(0x070) | MFP_AF2 | 
MFP_DRIVE_MEDIUM)
+#define MFPO8_UART3_TXD(MFP_REG(0x06c) | MFP_AF2 | 
MFP_DRIVE_MEDIUM)
+#define MFPO9_UART3_RXD(MFP_REG(0x070) | MFP_AF2 | 
MFP_DRIVE_MEDIUM)
 
 /* I2c */
 #define MFP105_CI2C_SDA(MFP_REG(0x1a4) | MFP_AF1 | 
MFP_DRIVE_MEDIUM)
diff --git a/board/Marvell/gplugd/Makefile b/board/Marvell/gplugd/Makefile
new file mode 100644
index 000..2d8bba0
--- /dev/null
+++ b/board/Marvell/gplugd/Makefile
@@ -0,0 +1,57 @@
+#
+# (C) Copyright 2011
+# eInfochips Ltd. 
+# Written-by: Ajay Bhargav 
+#
+# Based on Aspenite:
+# (C) Copyright 2010
+# Marvell Semiconductor 
+# Written-by: Prafulla Wadaskar 
+# Contributor: Mahavir Jain 
+#
+# 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., 51 Franklin Street, Fifth Floor, Boston,
+# MA 02110-1301 USA
+#
+
+include $(TOPDIR)/config.mk
+
+LIB = $(obj)lib$(BOARD).o
+
+COBJS  := gplugd.o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):$(obj).depend $(OBJS) $(SOBJS)
+   $(AR) $(ARFLAGS) $@ $(OBJS) $(SOBJS)
+
+clean:
+   rm -f $(SOBJS) $(OBJS)
+
+distclean: clean
+   rm -f $(LIB) core *.bak .depend
+
+#
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
diff --git a/board/Marvell/gplugd/gplugd.c b/board/Marvell/gplugd/gplugd.c
new file mode 100644
index 000..dc7d89d
--- /dev/null
+++ b/board/Marvell/gplugd/gplugd.c
@@ -0,0 +1,62 @@
+/*
+ * (C) Copyright 2011
+ * eInfochips Ltd. 
+ * Written-by: Ajay Bhargav 
+ *
+ * Based on Aspenite:
+ * (C) Copyright 2010
+ * Marvell Semiconductor 
+ * Written-by: Prafulla Wadaskar 
+ * Contributor: Mahavir Jain 
+ *
+ * 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 

Re: [U-Boot] [PATCH 5/5] Warn when the machine ID isn't passed to an ARM kernel and u-boot is compiled in debug mode. The kernel cannot boot without it.

2011-07-05 Thread Igor Grinberg
On 07/05/11 00:24, Jason wrote:

> On Mon, Jul 04, 2011 at 04:32:35PM -0400, Christopher Harvey wrote:
>> On Mon, Jul 04, 2011 at 04:13:49PM -0400, Jason wrote:
>>> On Mon, Jul 04, 2011 at 02:55:54PM -0400, Christopher Harvey wrote:
 On Mon, Jul 04, 2011 at 02:08:44PM -0400, Jason wrote:
> On Mon, Jul 04, 2011 at 01:45:41PM -0400, Christopher Harvey wrote:
>> +   Hopefully there will never be this many machines. 
>> +   Can't use 0 since 0 is already used as a mach-type. */
>> +gd->bd->bi_arch_number = 0x; 
>>  
>>  gd->bd->bi_baudrate = gd->baudrate;
>>  /* Ram ist board specific, so move it to board code ... */
>> diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c
>> index 802e833..70b3b76 100644
>> --- a/arch/arm/lib/bootm.c
>> +++ b/arch/arm/lib/bootm.c
>> @@ -113,6 +113,12 @@ int do_bootm_linux(int flag, int argc, char 
>> *argv[], bootm_headers_t *images)
>>  printf ("Using machid 0x%x from environment\n", machid);
>>  }
>>  
>> +#ifdef DEBUG
>> +if(machid==0x) {
>> +debug("\nWarning: machid not set! Linux will not finish 
>> booting.\n\n");
> s/finish/start/ ;-)
>
 I'll have to disagree here.  Linux will decompress and some functions
 will run but it will eventually stop, hence will not finish.
>>> On further investigation, you're right, it doesn't finish
>>> starting/booting.  Sorry for the noise.
>>>
> Also, shouldn't the compile fail in this case (#error)?  Or, at least 
> #warn?
>
 The compiler can't know what machid will be at runtime. Maybe a "would
 you like to continue?" prompt could work.
>>> Since the kernel throws a nice fat error message when the MACH_TYPE
>>> doesn't match what it was compiled for, I don't see the point to adding
>>> another message at the same point in the development process.
>> I didn't see that message. Do you know what lines of code in the
>> kernel print it? Or maybe just the message itself? 
> In init/main.c
>   start_kernel() calls
>   setup_arch()
>
> In arch/arm/kernel/setup.c
>   setup_arch() calls
>   setup_machine_tags() which calls
>   dump_machine_table()
>
> when the value in r1 doesn't match any of the mach-types the kernel was
> compiled for.

If you don't have the earlyprintk enabled, will this still be seen?
I don't think so...

So, I think there is a point to add a warning message.

-- 
Regards,
Igor.

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


Re: [U-Boot] [PATCH 1/3] arm: add CONFIG_MACH_TYPE option and documentation

2011-07-05 Thread Igor Grinberg
On 07/05/11 00:06, Christopher Harvey wrote:

> On Mon, Jul 04, 2011 at 12:00:19PM +0300, Igor Grinberg wrote:
>> CONFIG_MACH_TYPE can be used to set the machine type number in the
>> common arm code instead of setting it in the board code.
>>
>> Signed-off-by: Igor Grinberg 
>> ---
>>  README   |   12 
>>  arch/arm/lib/board.c |5 +
>>  2 files changed, 17 insertions(+), 0 deletions(-)
>>
>> diff --git a/README b/README
>> index 446966d..a9ccb0a 100644
>> --- a/README
>> +++ b/README
>> @@ -442,6 +442,18 @@ The following options need to be configured:
>>  crash. This is needed for buggy hardware (uc101) where
>>  no pull down resistor is connected to the signal IDE5V_DD7.
>>  
>> +CONFIG_MACH_TYPE[relevant for ARM only]
>> +
>> +This option can be used to specify the machine type number
>> +as it appears in the ARM machine registry
>> +(see http://www.arm.linux.org.uk/developer/machines/).
>> +If this option is not defined, then your board code
>> +will have to set this up like:
>> +gd->bd->bi_arch_number = ;
>> +Note: This option is not suitable if you have multiple
>> +boards supported in a single configuration file and the
>> +machine type is runtime discoverable.
>> +
>>  - vxWorks boot parameters:
>>  
>>  bootvx constructs a valid bootline using the following
>> diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c
>> index 169dfeb..ee77d05 100644
>> --- a/arch/arm/lib/board.c
>> +++ b/arch/arm/lib/board.c
>> @@ -451,6 +451,11 @@ void board_init_r (gd_t *id, ulong dest_addr)
>>  
>>  monitor_flash_len = _end_ofs;
>>  debug ("monitor flash len: %08lX\n", monitor_flash_len);
>> +
>> +#ifdef CONFIG_MACH_TYPE
>> +bd->bi_arch_number = CONFIG_MACH_TYPE; /* board id for Linux */
>> +#endif
>> +
>>  board_init();   /* Setup chipselects */
>>  
>>  #ifdef CONFIG_SERIAL_MULTI
>> -- 
>> 1.7.3.4
>>
> I'm curious, is it a feature that bd->bi_arch_number can be set at
> runtime?

Yes, it is a feature, as Wolfgang already said.

> Do any boards actually make a decision about what value to
> set this to?

Currently, at least, 2 boards (cm_t35 and keymile) use this feature.
This does not mean that in the future there will be no more boards using it.

> If not, then maybe it should be a required value.  I've
> submitted some patches that deal with the same sort of issue, so I'm
> interested in seeing that happens to this one.

If you're talking about this:
"Make u-boot a bit easier for newbies to port",
then no you are wrong, this patch has nothing to do with your patch,
it does completely another thing (see the subject).

-- 
Regards,
Igor.

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