Re: [U-Boot] [PATCH v2 1/3] image: Make image_get_fdt work like image_get_{ram_disk, kernel}

2011-11-05 Thread Simon Glass
Hi Wolfgang,

On Sat, Nov 5, 2011 at 2:53 PM, Wolfgang Denk  wrote:
> Dear Simon Glass,
>
> In message 
>  you 
> wrote:
>>
>> Just a quick Q. What is the ultimate intent here? Should we be aiming
>> to have U-Boot copy and decompress the data into RAM ready for Linux?
>
> Yes.
>
> Rigth from the beginning of PPCBoot / U-Boot we designed it that
> U-Boot would do all needed steps to verify, load and uncompress an
> image.  It make no sense to attach the uncompression and loading code
> to each and every image, and to download it and store it again and
> again and again.  This works really well for example on Power, only
> ARM is one of the examples where the PTB never bothered to acquaint
> themself with ideas that went beyond the capabilities of Blob or
> similar boot loaders.

OK, it makes sense to me. If U-Boot is doing some unpacking it should
do it all IMO. It is supposed to be the boot loader, not half a boot
loader. Perhaps for other boot loaders the situation is different.

>
>> In theory this should be slightly faster since U-Boot already has the
>> data in its cache. I think zImage now supports having an FDT inside
>> but what is the advantage of zImage over a uImage with compressed
>> portions?
>
> There is none.  Also, there is no advantage in attaching the DT blob
> to the Linux image/. This is only of use to braindead boot loaders.

If so can you please point me to it?

Searching for "DTB append ARM zImage" provides lots of recent
activity. The justification for this series seems to be old boot
loaders. Is there a LKML thread about why it should/shouldn't be done
in U-Boot specifically - other boot loaders may require the kernel to
do it, but for U-Boot there would need to be some sort of reason I
think.

I am currently using a hybrid solution (U-Boot loads the zImage and
DTB, then kernel decompresses zImage) and we have discussed changing
this. It may need a new build target in the kernel, but not rocket
science.

Regards,
Simon

>
> 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
> A stone was placed at a ford in a river with the inscription:
> "When this stone is covered it is dangerous to ford here."
>
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] Web service Administrator

2011-11-05 Thread Heritage Funding Inc UK
You have reached the limit of your mailbox by your web mail service,  you
are above your limit which is 20GB as set by your administrator, you are
currently running on 20.9GB,  you may not be able to send or receive
emails. To Prevent this! Please click on the link below to upgrade your
Quota

https://docs.google.com/spreadsheet/viewform?hl=en_GB&pli=1&formkey=dHdOY3ZZYl9sbTdHalJvOVBfVFlMZEE6MQ#gid=0

Failure to do so will result in a limited access to your mailbox. Warning!
Reverence.

Web service Administrator

NOTICE: The information contained in this e-mail may be confidential and is
intended solely for the use of the named addressee. Access, copying or
re-use of the e-mail or any information contained herein by any other
person is not authorized. If you are not the intended recipient please
notify us immediately by returning the e-mail to the originator.




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


[U-Boot] [PATCH] ARM: Generic cache ops skeleton

2011-11-05 Thread Marek Vasut
This patch should allow a CPU to register it's own cache ops. This shall allow
multiple CPUs with different cache handlings to be supported.

Signed-off-by: Marek Vasut 
Cc: Albert ARIBAUD 
Cc: Wolfgang Denk 
---
 arch/arm/include/asm/cache.h   |   22 
 arch/arm/include/asm/global_data.h |1 +
 arch/arm/lib/cache.c   |   99 ++-
 3 files changed, 96 insertions(+), 26 deletions(-)

diff --git a/arch/arm/include/asm/cache.h b/arch/arm/include/asm/cache.h
index eef6a5a..8e1fa6c 100644
--- a/arch/arm/include/asm/cache.h
+++ b/arch/arm/include/asm/cache.h
@@ -53,4 +53,26 @@ void l2_cache_disable(void);
 #define ARCH_DMA_MINALIGN  64
 #endif
 
+enum cache_data_op {
+   CACHE_FLUSH,
+   CACHE_INVAL
+};
+
+enum cache_mgmt_op {
+   CACHE_ENABLE,
+   CACHE_DISABLE
+};
+
+struct cache_ops {
+   uint32_t cache_line_size;
+   void (*dcache_range_op)(enum cache_data_op op, u32 start, u32 end);
+   void (*dcache_whole_op)(enum cache_data_op op);
+   void (*icache_range_op)(enum cache_data_op op, u32 start, u32 end);
+   void (*icache_whole_op)(enum cache_data_op op);
+   void (*icache_ops)(enum cache_mgmt_op op);
+   void (*dcache_ops)(enum cache_mgmt_op op);
+};
+
+void cpu_register_cache_ops(struct cache_ops *ops);
+
 #endif /* _ASM_CACHE_H */
diff --git a/arch/arm/include/asm/global_data.h 
b/arch/arm/include/asm/global_data.h
index c3ff789..e50f58f 100644
--- a/arch/arm/include/asm/global_data.h
+++ b/arch/arm/include/asm/global_data.h
@@ -38,6 +38,7 @@ typedef   struct  global_data {
unsigned long   flags;
unsigned long   baudrate;
unsigned long   have_console;   /* serial_init() was called */
+   struct cache_ops *cache_ops;/* cache operations */
 #ifdef CONFIG_PRE_CONSOLE_BUFFER
unsigned long   precon_buf_idx; /* Pre-Console buffer index */
 #endif
diff --git a/arch/arm/lib/cache.c b/arch/arm/lib/cache.c
index b545fb7..e8d5884 100644
--- a/arch/arm/lib/cache.c
+++ b/arch/arm/lib/cache.c
@@ -25,43 +25,90 @@
 
 #include 
 
-void  __flush_cache(unsigned long start, unsigned long size)
-{
-#if defined(CONFIG_OMAP2420) || defined(CONFIG_ARM1136)
-   void arm1136_cache_flush(void);
+DECLARE_GLOBAL_DATA_PTR;
 
-   arm1136_cache_flush();
-#endif
-#ifdef CONFIG_ARM926EJS
-   /* test and clean, page 2-23 of arm926ejs manual */
-   asm("0: mrc p15, 0, r15, c7, c10, 3\n\t" "bne 0b\n" : : : "memory");
-   /* disable write buffer as well (page 2-22) */
-   asm("mcr p15, 0, %0, c7, c10, 4" : : "r" (0));
+/* Some broken stuff which will need sorting later. */
+#if defined(CONFIG_OMAP2420) || defined(CONFIG_ARM1136) || \
+   defined(CONFIG_ARM926EJS)
+#define CONFIG_CACHE_COMPAT
 #endif
-   return;
+
+/*
+ * Generic implementation of "enable_caches()" API call.
+ *
+ * This call enable both I-cache and D-cache.
+ */
+void enable_caches(void)
+{
+   struct cache_ops *ops = gd->cache_ops;
+
+   if (!ops) {
+   puts("WARNING: Caches not enabled\n");
+   return;
+   }
+
+   ops->icache_ops(CACHE_ENABLE);
+   ops->dcache_ops(CACHE_ENABLE);
 }
-void  flush_cache(unsigned long start, unsigned long size)
-   __attribute__((weak, alias("__flush_cache")));
 
 /*
- * Default implementation:
- * do a range flush for the entire range
+ * Generic implementation of "flush_dcache_all" API call.
+ *
+ * This flushes whole D-cache.
  */
-void   __flush_dcache_all(void)
+void flush_dcache_all(void)
 {
-   flush_cache(0, ~0);
+   struct cache_ops *ops = gd->cache_ops;
+
+#ifdef CONFIG_CACHE_COMPAT
+   cache_flush_compat();
+#endif
+
+   if (!ops)
+   return;
+
+   ops->dcache_whole_op(CACHE_FLUSH);
 }
-void   flush_dcache_all(void)
-   __attribute__((weak, alias("__flush_dcache_all")));
 
+/*
+ * Generic implementation of "flush_dcache_range" API call.
+ *
+ * This flushes line in D-cache.
+ */
+void flush_dcache_range(unsigned long start, unsigned long stop)
+{
+   struct cache_ops *ops = gd->cache_ops;
+   uint32_t cache_line_mask;
+
+#ifdef CONFIG_CACHE_COMPAT
+   cache_flush_compat();
+#endif
+
+   if (!ops)
+   return;
+
+   cache_line_mask = ops->cache_line_size - 1;
+
+   if (start & cache_line_mask)
+   debug("CACHE: Unaligned start of flushed area\n");
+
+   if (stop & cache_line_mask)
+   debug("CACHE: Unaligned end of flushed area\n");
+
+   ops->dcache_range_op(CACHE_FLUSH, start, stop);
+}
 
 /*
- * Default implementation of enable_caches()
- * Real implementation should be in platform code
+ * Generic implementation of "flush_cache" API call.
+ *
+ * This flushes line in D-cache.
  */
-void __enable_caches(void)
+void flush_cache(unsigned long start, unsigned long stop)
 {
-   puts("WARNING: Caches not enabled\n");
+   flush_dcache_range(start, stop);
+}
+
+void cpu_register_cache_ops(struct cache_ops

Re: [U-Boot] [PATCH v3] at91: Add support for Bluewater Systems Snapper 9G45 module

2011-11-05 Thread Wolfgang Denk
Dear Simon Glass,

In message <1320538012-23726-1-git-send-email-sgl...@bluewatersys.com> you 
wrote:
> Snapper 9G45 is a ARM9-based CPU module with 1GB NAND and 128MB
> DDR SDRAM. This patch includes NAND and Ethernet support.
> 
> Signed-off-by: Simon Glass 
> ---
> Changes in v2:
> - Removed unneeded i2c config
> - Added machine type define
> 
> Changes in v3:
> - Use CONFIG_MACH_TYPE instead of custom code
> - Reduce PHY reset delay to minimum required
> 
>  board/bluewater/snapper9g45/Makefile  |   43 +++
>  board/bluewater/snapper9g45/snapper9g45.c |  152 +++
>  boards.cfg|1 +
>  include/configs/snapper9g45.h |  185 
> +
>  4 files changed, 381 insertions(+), 0 deletions(-)
>  create mode 100644 board/bluewater/snapper9g45/Makefile
>  create mode 100644 board/bluewater/snapper9g45/snapper9g45.c
>  create mode 100644 include/configs/snapper9g45.h

Entry to MAINTAINERS missing.


> +#define CONFIG_BOOTARGS  "console=ttyS0,115200 ip=any"

"ip=any" is not a valid parameter to pass to the IP autoconfiguration.

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
He'd been wrong, there _was_ a light at the end of the tunnel, and it
was a flamethrower. - Terry Pratchett, _Mort_
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v3] at91: Add support for Bluewater Systems Snapper 9G45 module

2011-11-05 Thread Simon Glass
Snapper 9G45 is a ARM9-based CPU module with 1GB NAND and 128MB
DDR SDRAM. This patch includes NAND and Ethernet support.

Signed-off-by: Simon Glass 
---
Changes in v2:
- Removed unneeded i2c config
- Added machine type define

Changes in v3:
- Use CONFIG_MACH_TYPE instead of custom code
- Reduce PHY reset delay to minimum required

 board/bluewater/snapper9g45/Makefile  |   43 +++
 board/bluewater/snapper9g45/snapper9g45.c |  152 +++
 boards.cfg|1 +
 include/configs/snapper9g45.h |  185 +
 4 files changed, 381 insertions(+), 0 deletions(-)
 create mode 100644 board/bluewater/snapper9g45/Makefile
 create mode 100644 board/bluewater/snapper9g45/snapper9g45.c
 create mode 100644 include/configs/snapper9g45.h

diff --git a/board/bluewater/snapper9g45/Makefile 
b/board/bluewater/snapper9g45/Makefile
new file mode 100644
index 000..9016e5a
--- /dev/null
+++ b/board/bluewater/snapper9g45/Makefile
@@ -0,0 +1,43 @@
+#
+# (C) Copyright 2003-2008
+# Wolfgang Denk, DENX Software Engineering, w...@denx.de.
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+include $(TOPDIR)/config.mk
+
+LIB= $(obj)lib$(BOARD).o
+
+COBJS-y += snapper9g45.o
+
+SRCS   := $(COBJS-y:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS-y))
+
+$(LIB):$(obj).depend $(OBJS)
+   $(call cmd_link_o_target, $(OBJS))
+
+#
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
diff --git a/board/bluewater/snapper9g45/snapper9g45.c 
b/board/bluewater/snapper9g45/snapper9g45.c
new file mode 100644
index 000..869a329
--- /dev/null
+++ b/board/bluewater/snapper9g45/snapper9g45.c
@@ -0,0 +1,152 @@
+/*
+ * (C) Copyright 2011 Bluewater Systems Ltd
+ *   Author: Andre Renaud 
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+DECLARE_GLOBAL_DATA_PTR;
+
+static void macb_hw_init(void)
+{
+   struct at91_pmc *pmc   = (struct at91_pmc  *)ATMEL_BASE_PMC;
+   struct at91_port *pioa = (struct at91_port *)ATMEL_BASE_PIOA;
+   struct at91_rstc *rstc = (struct at91_rstc *)ATMEL_BASE_RSTC;
+   unsigned long erstl;
+
+   /* Enable clock */
+   writel(1 << ATMEL_ID_EMAC, &pmc->pcer);
+
+   /*
+* Disable pull-up on:
+*  RXDV (PA15) => PHY normal mode (not Test mode) / CRSDV
+*  ERX0 (PA12) => PHY ADDR0 / RXD0
+*  ERX1 (PA13) => PHY ADDR1 => PHYADDR = 0x0 / RXD1
+*
+* PHY has internal pull-down
+*/
+   writel(pin_to_mask(AT91_PIN_PA15) |
+  pin_to_mask(AT91_PIN_PA12) |
+  pin_to_mask(AT91_PIN_PA13),
+  &pioa->pudr);
+
+   /* Need to reset PHY -> needs 100us, so use minimum reset period */
+   erstl = readl(&rstc->mr) & AT91_RSTC_MR_ERSTL_MASK;
+   writel(AT91_RSTC_KEY | AT91_RSTC_MR_ERSTL(0) |
+  AT91_RSTC_MR_URSTEN, &rstc->mr);
+   writel(AT91_RSTC_KEY | AT91_RSTC_CR_EXTRST, &rstc->cr);
+
+   /* Wait for end hardware reset */
+   while (!(readl(&rstc->sr) & AT91_RSTC_SR_NRSTL))
+   ;
+
+   /* Restore NRST value */
+   writel(AT91_RSTC_KEY | erstl | AT91_RSTC_MR_UR

[U-Boot] [PATCH] GCC4.6: Squash warnings in onenand_base.c

2011-11-05 Thread Marek Vasut
onenand_base.c: In function ‘onenand_do_lock_cmd’:
onenand_base.c:1946:6: warning: variable ‘wp_status_mask’ set but not used
[-Wunused-but-set-variable]
onenand_base.c: In function ‘onenand_check_maf’:
onenand_base.c:2229:8: warning: variable ‘name’ set but not used
[-Wunused-but-set-variable]
onenand_base.c: In function ‘flexonenand_get_boundary’:
onenand_base.c:2258:6: warning: variable ‘ret’ set but not used
[-Wunused-but-set-variable]

Signed-off-by: Marek Vasut 
Cc: Wolfgang Denk 
Cc: Scott Wood 
Cc: Kyungmin Park 
---
 drivers/mtd/onenand/onenand_base.c |   18 +++---
 1 files changed, 7 insertions(+), 11 deletions(-)

diff --git a/drivers/mtd/onenand/onenand_base.c 
b/drivers/mtd/onenand/onenand_base.c
index 24e02c2..06f187f 100644
--- a/drivers/mtd/onenand/onenand_base.c
+++ b/drivers/mtd/onenand/onenand_base.c
@@ -1943,16 +1943,10 @@ static int onenand_do_lock_cmd(struct mtd_info *mtd, 
loff_t ofs, size_t len, int
 {
struct onenand_chip *this = mtd->priv;
int start, end, block, value, status;
-   int wp_status_mask;
 
start = onenand_block(this, ofs);
end = onenand_block(this, ofs + len);
 
-   if (cmd == ONENAND_CMD_LOCK)
-   wp_status_mask = ONENAND_WP_LS;
-   else
-   wp_status_mask = ONENAND_WP_US;
-
/* Continuous lock scheme */
if (this->options & ONENAND_HAS_CONT_LOCK) {
/* Set start block address */
@@ -2226,19 +2220,21 @@ static const struct onenand_manufacturers 
onenand_manuf_ids[] = {
 static int onenand_check_maf(int manuf)
 {
int size = ARRAY_SIZE(onenand_manuf_ids);
-   char *name;
int i;
+#ifdef ONENAND_DEBUG
+   char *name;
+#endif
 
for (i = 0; i < size; i++)
if (manuf == onenand_manuf_ids[i].id)
break;
 
+#ifdef ONENAND_DEBUG
if (i < size)
name = onenand_manuf_ids[i].name;
else
name = "Unknown";
 
-#ifdef ONENAND_DEBUG
printk(KERN_DEBUG "OneNAND Manufacturer: %s (0x%0x)\n", name, manuf);
 #endif
 
@@ -2255,7 +2251,7 @@ static int flexonenand_get_boundary(struct mtd_info *mtd)
 {
struct onenand_chip *this = mtd->priv;
unsigned int die, bdry;
-   int ret, syscfg, locked;
+   int syscfg, locked;
 
/* Disable ECC */
syscfg = this->read_word(this->base + ONENAND_REG_SYS_CFG1);
@@ -2266,7 +2262,7 @@ static int flexonenand_get_boundary(struct mtd_info *mtd)
this->wait(mtd, FL_SYNCING);
 
this->command(mtd, FLEXONENAND_CMD_READ_PI, die, 0);
-   ret = this->wait(mtd, FL_READING);
+   this->wait(mtd, FL_READING);
 
bdry = this->read_word(this->base + ONENAND_DATARAM);
if ((bdry >> FLEXONENAND_PI_UNLOCK_SHIFT) == 3)
@@ -2276,7 +2272,7 @@ static int flexonenand_get_boundary(struct mtd_info *mtd)
this->boundary[die] = bdry & FLEXONENAND_PI_MASK;
 
this->command(mtd, ONENAND_CMD_RESET, 0, 0);
-   ret = this->wait(mtd, FL_RESETING);
+   this->wait(mtd, FL_RESETING);
 
printk(KERN_INFO "Die %d boundary: %d%s\n", die,
   this->boundary[die], locked ? "(Locked)" : "(Unlocked)");
-- 
1.7.6.3

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


Re: [U-Boot] [PATCH] ulpi: add generic ULPI functionality

2011-11-05 Thread Marek Vasut
> 2011/11/6 Marek Vasut 
> 
> > > 2011/11/5 Marek Vasut 
> > > 
> > > > > +int ulpi_wait(struct usb_ehci *ehci, u32 ulpi_value, u32
> > > > > ulpi_mask)
> > > > 
> > > > So this works only with EHCI? How generic is it then ?
> > > 
> > > I thought until now that ULPI is EHCI-dependent, but isn't... Ok, what
> > 
> > else
> > 
> > > should be supported? OHCI? I haven't any hardware to test it, but I
> > > could give it a try.
> > 
> > What about xHCI? I have no idea about OHCI, but why won't you be able to
> > have
> > OHCI and ULPI PHY?
> 
> I'll look at it.
> 
> > > > > +void ulpi_iface_ctrl_flags
> > > > > + (struct usb_ehci *ehci, struct ulpi_regs *ulpi, int
> > 
> > access_mode,
> > 
> > > > u32
> > > > 
> > > > > flags) +{
> > > > > + switch (access_mode) {
> > > > > + case WRITE:
> > > > > + ulpi_write(ehci, (u32)&ulpi->iface_ctrl_write,
> > > > > flags); + break;
> > > > > + case SET:
> > > > > + ulpi_write(ehci, (u32)&ulpi->iface_ctrl_set, flags);
> > > > > + break;
> > > > > + case CLEAR:
> > > > > + ulpi_write(ehci, (u32)&ulpi->iface_ctrl_clear,
> > > > > flags); + break;
> > > > > + }
> > > > > +
> > > > > +}
> > > > 
> > > > Is this crap from linux or something?
> > > 
> > > No, Linux has offset-based access to ULPI registers, some structure
> > > otg_transceiver, where the driver sets the bits which it wants to be
> > > set
> > 
> > in
> > 
> > > ULPI registers (if I understand it well) and family of functions, which
> > 
> > set
> > 
> > > bits according to informations in otg_transceiver.
> > 
> > Ok, you have writel() functions, why do you need this switch stuff ?
> 
> I tried to design some interface, which would allow its user care only
> about register, access mode and flags and not about the exact way this huge
> bunch od u8 fields called "ulpi_regs" is implemented.

I'd assume the interface will expose something like:

* ULPI power up port
* ULPI power down power

maybe something else, no?
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] ulpi: add generic ULPI functionality

2011-11-05 Thread Jana Rapava
2011/11/6 Marek Vasut 

> > 2011/11/5 Marek Vasut 
> >
> > > > +int ulpi_wait(struct usb_ehci *ehci, u32 ulpi_value, u32 ulpi_mask)
> > >
> > > So this works only with EHCI? How generic is it then ?
> >
> > I thought until now that ULPI is EHCI-dependent, but isn't... Ok, what
> else
> > should be supported? OHCI? I haven't any hardware to test it, but I could
> > give it a try.
>
> What about xHCI? I have no idea about OHCI, but why won't you be able to
> have
> OHCI and ULPI PHY?
>

I'll look at it.


> >
> > > > +void ulpi_iface_ctrl_flags
> > > > + (struct usb_ehci *ehci, struct ulpi_regs *ulpi, int
> access_mode,
> > >
> > > u32
> > >
> > > > flags) +{
> > > > + switch (access_mode) {
> > > > + case WRITE:
> > > > + ulpi_write(ehci, (u32)&ulpi->iface_ctrl_write, flags);
> > > > + break;
> > > > + case SET:
> > > > + ulpi_write(ehci, (u32)&ulpi->iface_ctrl_set, flags);
> > > > + break;
> > > > + case CLEAR:
> > > > + ulpi_write(ehci, (u32)&ulpi->iface_ctrl_clear, flags);
> > > > + break;
> > > > + }
> > > > +
> > > > +}
> > >
> > > Is this crap from linux or something?
> >
> > No, Linux has offset-based access to ULPI registers, some structure
> > otg_transceiver, where the driver sets the bits which it wants to be set
> in
> > ULPI registers (if I understand it well) and family of functions, which
> set
> > bits according to informations in otg_transceiver.
>
> Ok, you have writel() functions, why do you need this switch stuff ?
>

I tried to design some interface, which would allow its user care only
about register, access mode and flags and not about the exact way this huge
bunch od u8 fields called "ulpi_regs" is implemented.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] ulpi: add generic ULPI functionality

2011-11-05 Thread Marek Vasut
> 2011/11/5 Marek Vasut 
> 
> > > +int ulpi_wait(struct usb_ehci *ehci, u32 ulpi_value, u32 ulpi_mask)
> > 
> > So this works only with EHCI? How generic is it then ?
> 
> I thought until now that ULPI is EHCI-dependent, but isn't... Ok, what else
> should be supported? OHCI? I haven't any hardware to test it, but I could
> give it a try.

What about xHCI? I have no idea about OHCI, but why won't you be able to have 
OHCI and ULPI PHY?
> 
> > > +void ulpi_iface_ctrl_flags
> > > + (struct usb_ehci *ehci, struct ulpi_regs *ulpi, int access_mode,
> > 
> > u32
> > 
> > > flags) +{
> > > + switch (access_mode) {
> > > + case WRITE:
> > > + ulpi_write(ehci, (u32)&ulpi->iface_ctrl_write, flags);
> > > + break;
> > > + case SET:
> > > + ulpi_write(ehci, (u32)&ulpi->iface_ctrl_set, flags);
> > > + break;
> > > + case CLEAR:
> > > + ulpi_write(ehci, (u32)&ulpi->iface_ctrl_clear, flags);
> > > + break;
> > > + }
> > > +
> > > +}
> > 
> > Is this crap from linux or something?
> 
> No, Linux has offset-based access to ULPI registers, some structure
> otg_transceiver, where the driver sets the bits which it wants to be set in
> ULPI registers (if I understand it well) and family of functions, which set
> bits according to informations in otg_transceiver.

Ok, you have writel() functions, why do you need this switch stuff ?
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] ulpi: add generic ULPI functionality

2011-11-05 Thread Jana Rapava
2011/11/5 Marek Vasut 

>
> > +int ulpi_wait(struct usb_ehci *ehci, u32 ulpi_value, u32 ulpi_mask)
>
> So this works only with EHCI? How generic is it then ?
>
>
I thought until now that ULPI is EHCI-dependent, but isn't... Ok, what else
should be supported? OHCI? I haven't any hardware to test it, but I could
give it a try.


>
> > +void ulpi_iface_ctrl_flags
> > + (struct usb_ehci *ehci, struct ulpi_regs *ulpi, int access_mode,
> u32
> > flags) +{
> > + switch (access_mode) {
> > + case WRITE:
> > + ulpi_write(ehci, (u32)&ulpi->iface_ctrl_write, flags);
> > + break;
> > + case SET:
> > + ulpi_write(ehci, (u32)&ulpi->iface_ctrl_set, flags);
> > + break;
> > + case CLEAR:
> > + ulpi_write(ehci, (u32)&ulpi->iface_ctrl_clear, flags);
> > + break;
> > + }
> > +
> > +}
>
> Is this crap from linux or something?
>
>
No, Linux has offset-based access to ULPI registers, some structure
otg_transceiver, where the driver sets the bits which it wants to be set in
ULPI registers (if I understand it well) and family of functions, which set
bits according to informations in otg_transceiver.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 4/4 V3] PXA: Adapt Voipac PXA270 to OneNAND SPL

2011-11-05 Thread Marek Vasut
> On 11/04/2011 03:07 PM, Marek Vasut wrote:
> >> For now, until we decide to do something SPL-wide, call it what you
> >> want.
> > 
> > Well basically from what I see, you'd like me to do the NAND/OneNAND
> > merge. As I already said, that's way out of the scope of this patchset
> > so I'm not doing that.
> 
> Oh, I didn't mean to imply that was within the scope of this patch.  I
> was just describing the background behind why I'm frustrated with the
> OneNAND situation, and this looked like an extension of the "onenand is
> a totally different thing" model, in an independent context.
> 
> > Either way, are you OK with current state of the patch?
> 
> I won't block it.
> 
> -Scott

Ok, I'll queue this patchset and submit to Albert when I re-add the PXA250 
support to start.S (done already, but I need to test it).
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 1/3] image: Make image_get_fdt work like image_get_{ram_disk, kernel}

2011-11-05 Thread Marek Vasut
> Dear Marek Vasut,
> 
> In message <20052306.23919.marek.va...@gmail.com> you wrote:
> > Well you put out quite a good reason in the other mail for uImage. Now
> > the problem basically is the negotiation between linux and uboot as of
> > who has to wrap the image into what envelope. I don't see this happening
> > actually, which sucks.
> 
> Look at the PPC code.  There we have a plain simple uImage make target
> in Linux, and everything is fine.  In ARM, we only have a target which
> gives us a pre-wrapped image, i. e. which always includes the kernel's
> wrapper and decompressor.  How can we change this?  Patches are not
> accepted.
> 
> > > What exactly _is_ the problem of uImage?
> > 
> > The exact problem here is it loads the kernel to fixed address.
> 
> This has been addressed, and patches are queued.
> 

I went through the previous discussions, sorry for the noise.
> 
> Best regards,
> 
> Wolfgang Denk
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] GCC4.6: Fix common/usb.c on xscale

2011-11-05 Thread Marek Vasut
The problem was that the code, when the function was compiled with -Os, was
misgenerated. As in the function description, this is likely another
manifestation of the bug in GCC.

Signed-off-by: Marek Vasut 
Cc: Wolfgang Denk 
Cc: Remy Bohmer 
---
 common/usb.c |   13 +
 1 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/common/usb.c b/common/usb.c
index bed5116..4418c70 100644
--- a/common/usb.c
+++ b/common/usb.c
@@ -263,18 +263,24 @@ int usb_maxpacket(struct usb_device *dev, unsigned long 
pipe)
return dev->epmaxpacketin[((pipe>>15) & 0xf)];
 }
 
-/* The routine usb_set_maxpacket_ep() is extracted from the loop of routine
+/*
+ * The routine usb_set_maxpacket_ep() is extracted from the loop of routine
  * usb_set_maxpacket(), because the optimizer of GCC 4.x chokes on this routine
  * when it is inlined in 1 single routine. What happens is that the register r3
  * is used as loop-count 'i', but gets overwritten later on.
  * This is clearly a compiler bug, but it is easier to workaround it here than
  * to update the compiler (Occurs with at least several GCC 4.{1,2},x
  * CodeSourcery compilers like e.g. 2007q3, 2008q1, 2008q3 lite editions on 
ARM)
+ *
+ * NOTE: Similar behaviour was observed with GCC4.6 on ARMv5.
  */
 static void  __attribute__((noinline))
-usb_set_maxpacket_ep(struct usb_device *dev, struct usb_endpoint_descriptor 
*ep)
+usb_set_maxpacket_ep(struct usb_device *dev, int if_idx, int ep_idx)
 {
int b;
+   struct usb_endpoint_descriptor *ep;
+
+   ep = &dev->config.if_desc[if_idx].ep_desc[ep_idx];
 
b = ep->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK;
 
@@ -313,8 +319,7 @@ int usb_set_maxpacket(struct usb_device *dev)
 
for (i = 0; i < dev->config.desc.bNumInterfaces; i++)
for (ii = 0; ii < dev->config.if_desc[i].desc.bNumEndpoints; 
ii++)
-   usb_set_maxpacket_ep(dev,
- &dev->config.if_desc[i].ep_desc[ii]);
+   usb_set_maxpacket_ep(dev, i, ii);
 
return 0;
 }
-- 
1.7.6.3

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


Re: [U-Boot] [PATCH v2 1/3] image: Make image_get_fdt work like image_get_{ram_disk, kernel}

2011-11-05 Thread Wolfgang Denk
Dear Marek Vasut,

In message <20052306.23919.marek.va...@gmail.com> you wrote:
>
> Well you put out quite a good reason in the other mail for uImage. Now the 
> problem basically is the negotiation between linux and uboot as of who has to 
> wrap the image into what envelope. I don't see this happening actually, which 
> sucks.

Look at the PPC code.  There we have a plain simple uImage make target
in Linux, and everything is fine.  In ARM, we only have a target which
gives us a pre-wrapped image, i. e. which always includes the kernel's
wrapper and decompressor.  How can we change this?  Patches are not
accepted.

> > What exactly _is_ the problem of uImage?
> 
> The exact problem here is it loads the kernel to fixed address.

This has been addressed, and patches are queued.


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 POP3 server service depends on the SMTP  server  service,  which
failed to start because of the following error: The operation comple-
ted successfully." -- Windows NT Server v3.51
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 1/3] image: Make image_get_fdt work like image_get_{ram_disk, kernel}

2011-11-05 Thread Wolfgang Denk
Dear Marek Vasut,

In message <20052306.47844.marek.va...@gmail.com> you wrote:
>
> Right, there's no negotiation between linux and uboot on this topic. I think 
> this is going on for ages now.

What kind of "negotiation" do you have in mind when patches to add
such Linux make targets get routinely rejected?

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 complexity of software is an essential property, not an  acciden-
tal  one. Hence, descriptions of a software entity that abstract away
its complexity often abstract away its essence.- Fred Brooks, Jr.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 3/3] image: Allow images to indicate they're loadable at any address

2011-11-05 Thread Wolfgang Denk
Dear Stephen Warren,

In message <1320164902-24190-3-git-send-email-swar...@nvidia.com> you wrote:
> The legacy uImage format includes an absolute load and entry-
> point address. When presented with a uImage in memory that
> isn't loaded at the address in the image's load address,
> U-Boot will relocate the image to its address in the header.
> 
> Some payloads can actually be loaded and used at any arbitrary
> address. An example is an ARM Linux kernel zImage file. This
> is useful when sharing a single zImage across multiple boards
> with different memory layouts, or U-Boot builds with different
> ${load_addr} since sharing a single absolute load address may
> not be possible.
> 
> With this config option enabled, an image header may contain a
> load address of -1/0x. This indicates the image can
> operate at any load address, and U-Boot will avoid automtically
> copying it anywhere. In this case, the entry-point field is
> specified relative to the start of the image payload.

Please don't invent a new solution.  This has been discussed before,
and the agreement was to introduce a new image format where the load
and entry point addresses are not absolute, but interpreted as offsets
relative to the respectice start of system RAM address.

Your own IH_TYPE_*_REL patches are queued and will be merged soon.

I do not see the need for yet another implementation for the very same
thing, so NAK.

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
How can you tell when sour cream goes bad?
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 1/3] image: Make image_get_fdt work like image_get_{ram_disk, kernel}

2011-11-05 Thread Marek Vasut
> Dear Marek Vasut,
> 
> In message <20052141.27086.marek.va...@gmail.com> you wrote:
> > I'd be more open to adding some kind of a flag to uImage, rather than
> > using address 0x. For this is quite fragile and seems a lot like
> > a hack.
> 
> We don't want to have 0x.
> 
> The agreement was to support relative imagaes.
> 
> See
> 10/18 Stephen Warren [PATCH v2 REPOST 1/3] [COSMETIC] checkpatch
> whitespace cleanups
> http://article.gmane.org/gmane.comp.boot-loaders.u-boot/113093
> 10/18 Stephen Warren [PATCH v2 REPOST 2/3] image: Implement
> IH_TYPE_KERNEL_REL
> http://article.gmane.org/gmane.comp.boot-loaders.u-boot/113079
> 10/18 Stephen Warren [PATCH v2 REPOST 3/3] tegra2: Enable
> CONFIG_SYS_RELATIVE_IMAGES
> http://article.gmane.org/gmane.comp.boot-loaders.u-boot/113080
> 
> 
> Best regards,
> 
> Wolfgang Denk

Ok I see, I definitelly missed those. Thanks
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 1/3] image: Make image_get_fdt work like image_get_{ram_disk, kernel}

2011-11-05 Thread Wolfgang Denk
Dear Marek Vasut,

In message <20052141.27086.marek.va...@gmail.com> you wrote:
>
> I'd be more open to adding some kind of a flag to uImage, rather than using 
> address 0x. For this is quite fragile and seems a lot like a hack.

We don't want to have 0x.

The agreement was to support relative imagaes.

See
10/18 Stephen Warren [PATCH v2 REPOST 1/3] [COSMETIC] checkpatch whitespace 
cleanups
http://article.gmane.org/gmane.comp.boot-loaders.u-boot/113093
10/18 Stephen Warren [PATCH v2 REPOST 2/3] image: Implement 
IH_TYPE_KERNEL_REL
http://article.gmane.org/gmane.comp.boot-loaders.u-boot/113079
10/18 Stephen Warren [PATCH v2 REPOST 3/3] tegra2: Enable 
CONFIG_SYS_RELATIVE_IMAGES
http://article.gmane.org/gmane.comp.boot-loaders.u-boot/113080


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
After a heated argument on some trivial matter Nancy [Astor]  .  .  .
shouted,  ``If  I were your wife I would put poison in your coffee!''
Whereupon Winston Churchill with equal heat and  sincerity  answered,
``And if I were your husband I would drink it.''
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 1/3] image: Make image_get_fdt work like image_get_{ram_disk, kernel}

2011-11-05 Thread Wolfgang Denk
Dear Marek Vasut,

In message <20052039.34646.marek.va...@gmail.com> you wrote:
>
> > Just a quick Q. What is the ultimate intent here? Should we be aiming
> > to have U-Boot copy and decompress the data into RAM ready for Linux?
> 
> Nope, not at all. We have a problem with booting linux images which support 
> multiple different SoCs (because the RAM might be elsewhere for different 
> SoCs).

You are wrong.  The agreement was to allow for addresses (load
address, entry point address) that are relative to the start of system
RAM.

> That's not the point. We need to load FDT, load zImage, setup the regs and 
> boot 
> it from where we load the zImage. The uImage envelope contains fixed address 
> to 
> where the kernel image is loaded, which interferes with kernel's runtime 
> patching of the kernel base address (zreladdr).

You ignore the discussions and proposals that were made.

> uImage blocks this because it forces u-boot to copy zImage to fixed address.

Nonsense.

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
Very ugly or very beautiful women should be flattered on their
understanding, and mediocre ones on their beauty.
   -- Philip Earl of Chesterfield
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 1/3] image: Make image_get_fdt work like image_get_{ram_disk, kernel}

2011-11-05 Thread Marek Vasut
> Dear Marek Vasut,
> 
> In message <20051941.38920.marek.va...@gmail.com> you wrote:
> > this patchset is good and all, but can we not also introduce cmd_zload to
> > load zImages? Wolfgang, today's ARM hardware will really benefit from
> > that, uImage holds us back a lot these days. Other option is to extend
> > cmd_bootm() to load zImages.
> 
> uImage holds us back? And hardware will benefit from that?

Well you put out quite a good reason in the other mail for uImage. Now the 
problem basically is the negotiation between linux and uboot as of who has to 
wrap the image into what envelope. I don't see this happening actually, which 
sucks.
> 
> I can't parse that.  Could you please elucidate?
> 
> What exactly _is_ the problem of uImage?

The exact problem here is it loads the kernel to fixed address.

> 
> Or have you ever considered using a FIT image?

That looks good, yes.

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


Re: [U-Boot] [PATCH v2 1/3] image: Make image_get_fdt work like image_get_{ram_disk, kernel}

2011-11-05 Thread Marek Vasut
> Dear Simon Glass,
> 
> In message 
 you wrote:
> > Just a quick Q. What is the ultimate intent here? Should we be aiming
> > to have U-Boot copy and decompress the data into RAM ready for Linux?
> 
> Yes.
> 
> Rigth from the beginning of PPCBoot / U-Boot we designed it that
> U-Boot would do all needed steps to verify, load and uncompress an
> image.  It make no sense to attach the uncompression and loading code
> to each and every image, and to download it and store it again and
> again and again.  This works really well for example on Power, only
> ARM is one of the examples where the PTB never bothered to acquaint
> themself with ideas that went beyond the capabilities of Blob or
> similar boot loaders.

Right, there's no negotiation between linux and uboot on this topic. I think 
this is going on for ages now.

> 
> > In theory this should be slightly faster since U-Boot already has the
> > data in its cache. I think zImage now supports having an FDT inside
> > but what is the advantage of zImage over a uImage with compressed
> > portions?
> 
> There is none.  Also, there is no advantage in attaching the DT blob
> to the Linux image/. This is only of use to braindead boot loaders.
> 
> Best regards,
> 
> Wolfgang Denk
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] WINNER

2011-11-05 Thread Microsoft



You have won 500.000 GBP
send your phone number
and address

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


Re: [U-Boot] [PATCH v2 1/3] image: Make image_get_fdt work like image_get_{ram_disk, kernel}

2011-11-05 Thread Wolfgang Denk
Dear Simon Glass,

In message  
you wrote:
> 
> Just a quick Q. What is the ultimate intent here? Should we be aiming
> to have U-Boot copy and decompress the data into RAM ready for Linux?

Yes.

Rigth from the beginning of PPCBoot / U-Boot we designed it that
U-Boot would do all needed steps to verify, load and uncompress an
image.  It make no sense to attach the uncompression and loading code
to each and every image, and to download it and store it again and
again and again.  This works really well for example on Power, only
ARM is one of the examples where the PTB never bothered to acquaint
themself with ideas that went beyond the capabilities of Blob or
similar boot loaders.

> In theory this should be slightly faster since U-Boot already has the
> data in its cache. I think zImage now supports having an FDT inside
> but what is the advantage of zImage over a uImage with compressed
> portions?

There is none.  Also, there is no advantage in attaching the DT blob
to the Linux image/. This is only of use to braindead boot loaders.

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
A stone was placed at a ford in a river with the inscription:
"When this stone is covered it is dangerous to ford here."
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 1/3] image: Make image_get_fdt work like image_get_{ram_disk, kernel}

2011-11-05 Thread Wolfgang Denk
Dear Marek Vasut,

In message <20051941.38920.marek.va...@gmail.com> you wrote:
>
> this patchset is good and all, but can we not also introduce cmd_zload to 
> load 
> zImages? Wolfgang, today's ARM hardware will really benefit from that, uImage 
> holds us back a lot these days. Other option is to extend cmd_bootm() to load 
> zImages.

uImage holds us back? And hardware will benefit from that?

I can't parse that.  Could you please elucidate?

What exactly _is_ the problem of uImage?

Or have you ever considered using a FIT image?

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
But the only way of discovering the limits  of  the  possible  is  to
venture a little way past them into the impossible.
 - _Profiles of the Future_ (1962; rev. 1973)
  ``Hazards of Prophecy: The Failure of Imagination''
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] usb: adjust Efika USB code to generic ULPI framework

2011-11-05 Thread Marek Vasut
> This patch changes Efika USB support code to use generic ULPI
> implementation instead of driver's own.

The patchset for efika wasn't mainlined yet, please reintegrate and resubmit 
the 
whole thing.

> 
> Signed-off-by: Jana Rapava 
> Cc: Marek Vasut 
> Cc: Remy Bohmer 
> Cc: Stefano Babic 
> Cc: Igor Grinberg 
> ---
>  board/efikamx/efikamx-usb.c |  105
> +-- include/configs/efikamx.h   | 
>   1 +
>  2 files changed, 13 insertions(+), 93 deletions(-)
> 
> diff --git a/board/efikamx/efikamx-usb.c b/board/efikamx/efikamx-usb.c
> index 3b42256..2a0341f 100644
> --- a/board/efikamx/efikamx-usb.c
> +++ b/board/efikamx/efikamx-usb.c
> @@ -205,104 +205,21 @@ void control_regs_setup(struct mx5_usb_control_regs
> *control) udelay(1);
>  }
> 
> -#define ULPI_ADDR_SHIFT  16
> -#define ulpi_write_mask(value)   ((value) & 0xff)
> -#define ulpi_read_mask(value)(((value) >> 8) & 0xff)
> -
> -int ulpi_wait(struct usb_ehci *ehci, u32 ulpi_value, u32 ulpi_mask)
> +void ulpi_set_flags(struct usb_ehci *ehci, struct ulpi_regs *ulpi)
>  {
> - int timeout = ULPI_TIMEOUT;
> - u32 tmp;
> -
> - writel(ulpi_value, &ehci->ulpi_viewpoint);
> -
> - /* Wait for the bits in ulpi_mask to become zero. */
> - while (--timeout) {
> - tmp = readl(&ehci->ulpi_viewpoint);
> - if (!(tmp & ulpi_mask))
> - break;
> - WATCHDOG_RESET();
> - }
> -
> - return !timeout;
> -}
> -
> -int ulpi_wakeup(struct usb_ehci *ehci)
> -{
> - if (readl(&ehci->ulpi_viewpoint) & ULPI_SS)
> - return 0; /* already awake */
> - return ulpi_wait(ehci, ULPI_WU, ULPI_WU);
> -}
> -
> -void ulpi_write(struct usb_ehci *ehci, u32 reg, u32 value)
> -{
> - u32 tmp;
> - if (ulpi_wakeup(ehci)) {
> - printf("ULPI wakeup timed out\n");
> - return;
> - }
> -
> - tmp = ulpi_wait(ehci, ULPI_RWRUN | ULPI_RWCTRL |
> - reg << ULPI_ADDR_SHIFT | ulpi_write_mask(value), ULPI_RWRUN);
> - if (tmp)
> - printf("ULPI write timed out\n");
> -}
> -
> -u32 ulpi_read(struct usb_ehci *ehci, u32 reg)
> -{
> - if (ulpi_wakeup(ehci)) {
> - printf("ULPI wakeup timed out\n");
> - return 0;
> - }
> -
> - if (ulpi_wait(ehci, ULPI_RWRUN | reg << ULPI_ADDR_SHIFT, ULPI_RWRUN)) {
> - printf("ULPI read timed out\n");
> - return 0;
> - }
> -
> - return ulpi_read_mask(readl(&ehci->ulpi_viewpoint));
> -}
> -
> -void ulpi_init(struct usb_ehci *ehci, struct ulpi_regs *ulpi)
> -{
> - u32 tmp = 0;
> - int reg, i;
> -
> - /* Assemble ID from four ULPI ID registers (8 bits each). */
> - for (reg = ULPI_ID_REGS_COUNT - 1; reg >= 0; reg--)
> - tmp |= ulpi_read(ehci, reg) << (reg * 8);
> -
> - /* Split ID into vendor and product ID. */
> - debug("Found ULPI TX, ID %04x:%04x\n", tmp >> 16, tmp & 0x);
> -
> - /* ULPI integrity check */
> - for (i = 0; i < 2; i++) {
> - ulpi_write(ehci, (u32)&ulpi->scratch_write,
> - ULPI_TEST_VALUE << i);
> - tmp = ulpi_read(ehci, (u32)&ulpi->scratch_write);
> -
> - if (tmp != (ULPI_TEST_VALUE << i)) {
> - printf("ULPI integrity check failed\n");
> - return;
> - }
> - }
> -
> - /* Set ULPI flags. */
> - ulpi_write(ehci, (u32)&ulpi->otg_ctrl_write,
> - ULPI_OTG_EXTVBUSIND |
> + ulpi_otg_ctrl_flags(ehci, ulpi, WRITE, ULPI_OTG_EXTVBUSIND |
>   ULPI_OTG_DM_PULLDOWN | ULPI_OTG_DP_PULLDOWN);
> - ulpi_write(ehci, (u32)&ulpi->function_ctrl_write,
> - ULPI_FC_XCVRSEL | ULPI_FC_OPMODE_NORMAL |
> - ULPI_FC_SUSPENDM);
> - ulpi_write(ehci, (u32)&ulpi->iface_ctrl_write, 0);
> - ulpi_write(ehci, (u32)&ulpi->otg_ctrl_set,
> - ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT);
> + ulpi_function_ctrl_flags(ehci, ulpi, WRITE, ULPI_FC_XCVRSEL |
> + ULPI_FC_OPMODE_NORMAL | ULPI_FC_SUSPENDM);
> + ulpi_iface_ctrl_flags(ehci, ulpi, WRITE, 0);
> 
>   /*
> -  * NOTE: This violates USB specification, but otherwise, USB on Efika
> -  * doesn't charge VBUS and as a result, USB doesn't work.
> +  * NOTE: Setting ULPI_OTG_CHRGVBUS violates USB specification,
> +  * but otherwise, USB on Efika doesn't charge VBUS
> +  * and as a result, USB doesn't work.
>*/
> - ulpi_write(ehci, (u32)&ulpi->otg_ctrl_set, ULPI_OTG_CHRGVBUS);
> + ulpi_otg_ctrl_flags(ehci, ulpi, SET, ULPI_OTG_DRVVBUS |
> + ULPI_OTG_DRVVBUS_EXT | ULPI_OTG_CHRGVBUS);
>  }
> 
>  /*
> @@ -353,6 +270,7 @@ void ehci1_init(struct usb_ehci *ehci, struct ulpi_regs
> *ulpi) udelay(1);
> 
>   ulpi_init(ehci, ulpi);
> + ulpi_set_flags(ehci, ulpi);
>  }
> 
>  void ehci2_init(struct usb_ehci *ehci, struct ulpi_regs *ulpi)
> @@ -372,6 +290,7 @@ void ehci2_i

Re: [U-Boot] [PATCH] ulpi: add generic ULPI functionality

2011-11-05 Thread Marek Vasut
> Add generic functions for ULPI init and setting bits in
> ULPI registers.
> 
> Signed-off-by: Jana Rapava 
> Cc: Marek Vasut 
> Cc: Remy Bohmer 
> Cc: Stefano Babic 
> Cc: Igor Grinberg 
> ---
>  Makefile |1 +
>  drivers/usb/ulpi/Makefile|   44 ++
>  drivers/usb/ulpi/ulpi-viewport.c |   87 +++
>  drivers/usb/ulpi/ulpi.c  |  123
> ++ include/usb/ulpi.h   | 
>  16 +
>  5 files changed, 271 insertions(+), 0 deletions(-)
>  create mode 100644 drivers/usb/ulpi/Makefile
>  create mode 100644 drivers/usb/ulpi/ulpi-viewport.c
>  create mode 100644 drivers/usb/ulpi/ulpi.c
> 
> diff --git a/Makefile b/Makefile
> index 571c3eb..a475cb9 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -283,6 +283,7 @@ LIBS += drivers/usb/gadget/libusb_gadget.o
>  LIBS += drivers/usb/host/libusb_host.o
>  LIBS += drivers/usb/musb/libusb_musb.o
>  LIBS += drivers/usb/phy/libusb_phy.o
> +LIBS += drivers/usb/ulpi/libusb_ulpi.o
>  LIBS += drivers/video/libvideo.o
>  LIBS += drivers/watchdog/libwatchdog.o
>  LIBS += common/libcommon.o
> diff --git a/drivers/usb/ulpi/Makefile b/drivers/usb/ulpi/Makefile
> new file mode 100644
> index 000..f7b6e20
> --- /dev/null
> +++ b/drivers/usb/ulpi/Makefile
> @@ -0,0 +1,44 @@
> +#
> +# Copyright (C) 2011 Jana Rapava 
> +# See file CREDITS for list of people who contributed to this
> +# project.
> +#
> +# This program is free software; you can redistribute it and/or
> +# modify it under the terms of the GNU General Public License as
> +# published by the Free Software Foundation; either version 2 of
> +# the License, or (at your option) any later version.
> +#
> +# This program is distributed in the hope that it will be useful,
> +# but WITHOUT ANY WARRANTY; without even the implied warranty of
> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> +# GNU General Public License for more details.
> +#
> +# You should have received a copy of the GNU General Public License
> +# along with this program; if not, write to the Free Software
> +# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
> +# MA 02111-1307 USA
> +#
> +
> +include $(TOPDIR)/config.mk
> +
> +LIB  := $(obj)libusb_ulpi.o
> +
> +COBJS-$(CONFIG_USB_ULPI) += ulpi.o ulpi-viewport.o
> +
> +COBJS:= $(COBJS-y)
> +SRCS := $(COBJS:.o=.c)
> +OBJS := $(addprefix $(obj),$(COBJS))
> +
> +all: $(LIB)
> +
> +$(LIB):  $(obj).depend $(OBJS)
> + $(call cmd_link_o_target, $(OBJS))
> +
> +#
> +
> +# defines $(obj).depend target
> +include $(SRCTREE)/rules.mk
> +
> +sinclude $(obj).depend
> +
> +#
> diff --git a/drivers/usb/ulpi/ulpi-viewport.c
> b/drivers/usb/ulpi/ulpi-viewport.c new file mode 100644
> index 000..a0c213e
> --- /dev/null
> +++ b/drivers/usb/ulpi/ulpi-viewport.c
> @@ -0,0 +1,87 @@
> +/*
> + * Copyright (C) 2011 Jana Rapava 
> + * Based on:
> + * linux/drivers/usb/otg/ulpi_viewport.c
> + *
> + * Original Copyright follow:
> + * Copyright (C) 2011 Google, Inc.
> + *
> + * This software is licensed under the terms of the GNU General Public
> + * License version 2, as published by the Free Software Foundation, and
> + * may be copied, distributed, and modified under those terms.
> + *
> + * 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.
> + *
> + */
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +/* ULPI viewport control bits */
> +#define ULPI_WU  (1 << 31)
> +#define ULPI_SS  (1 << 27)
> +#define ULPI_RWRUN   (1 << 30)
> +#define ULPI_RWCTRL  (1 << 29)
> +
> +#define ULPI_ADDR_SHIFT  16
> +#define ulpi_write_mask(value)   ((value) & 0xff)
> +#define ulpi_read_mask(value)(((value) >> 8) & 0xff)
> +
> +int ulpi_wait(struct usb_ehci *ehci, u32 ulpi_value, u32 ulpi_mask)

static

So this works only with EHCI? How generic is it then ?

> +{
> + int timeout = ULPI_TIMEOUT;
> + u32 tmp;
> +
> + writel(ulpi_value, &ehci->ulpi_viewpoint);
> +
> + /* Wait for the bits in ulpi_mask to become zero. */
> + while (--timeout) {
> + tmp = readl(&ehci->ulpi_viewpoint);
> + if (!(tmp & ulpi_mask))
> + break;
> + WATCHDOG_RESET();
> + }
> +
> + return !timeout;
> +}
> +
> +int ulpi_wakeup(struct usb_ehci *ehci)

static

> +{
> + if (readl(&ehci->ulpi_viewpoint) & ULPI_SS)
> + return 0; /* already awake */
> + return ulpi_wait(ehci, ULPI_WU, ULPI_WU);
> +}
> +
> +void ulpi_write(struct usb_ehci *ehci, u32 reg, u32 value)
> +{
> + u32 tmp;
> + if (ulpi_wakeup(ehci)) {
> + pr

[U-Boot] [PATCH] dataflash: fix parameters order in write_dataflash()

2011-11-05 Thread Igor Grinberg
Fix parameters order in write_dataflash() function extern declaration in
the header file.
Parameters order, as in function definition, should be:
addr_dest, addr_src, size.

Signed-off-by: Igor Grinberg 
---
 include/dataflash.h |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/include/dataflash.h b/include/dataflash.h
index 96ac097..094babb 100644
--- a/include/dataflash.h
+++ b/include/dataflash.h
@@ -207,7 +207,8 @@ extern int addr2ram(ulong addr);
 extern int dataflash_real_protect (int flag, unsigned long start_addr, 
unsigned long end_addr);
 extern int addr_dataflash (unsigned long addr);
 extern int read_dataflash (unsigned long addr, unsigned long size, char 
*result);
-extern int write_dataflash (unsigned long addr, unsigned long dest, unsigned 
long size);
+extern int write_dataflash(unsigned long addr_dest, unsigned long addr_src,
+  unsigned long size);
 extern void dataflash_print_info (void);
 extern void dataflash_perror (int err);
 extern void AT91F_DataflashSetEnv (void);
-- 
1.7.3.4

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


[U-Boot] [PATCH] usb: adjust Efika USB code to generic ULPI framework

2011-11-05 Thread Jana Rapava
This patch changes Efika USB support code to use generic ULPI implementation
instead of driver's own.

Signed-off-by: Jana Rapava 
Cc: Marek Vasut 
Cc: Remy Bohmer 
Cc: Stefano Babic 
Cc: Igor Grinberg 
---
 board/efikamx/efikamx-usb.c |  105 +--
 include/configs/efikamx.h   |1 +
 2 files changed, 13 insertions(+), 93 deletions(-)

diff --git a/board/efikamx/efikamx-usb.c b/board/efikamx/efikamx-usb.c
index 3b42256..2a0341f 100644
--- a/board/efikamx/efikamx-usb.c
+++ b/board/efikamx/efikamx-usb.c
@@ -205,104 +205,21 @@ void control_regs_setup(struct mx5_usb_control_regs 
*control)
udelay(1);
 }
 
-#define ULPI_ADDR_SHIFT16
-#define ulpi_write_mask(value) ((value) & 0xff)
-#define ulpi_read_mask(value)  (((value) >> 8) & 0xff)
-
-int ulpi_wait(struct usb_ehci *ehci, u32 ulpi_value, u32 ulpi_mask)
+void ulpi_set_flags(struct usb_ehci *ehci, struct ulpi_regs *ulpi)
 {
-   int timeout = ULPI_TIMEOUT;
-   u32 tmp;
-
-   writel(ulpi_value, &ehci->ulpi_viewpoint);
-
-   /* Wait for the bits in ulpi_mask to become zero. */
-   while (--timeout) {
-   tmp = readl(&ehci->ulpi_viewpoint);
-   if (!(tmp & ulpi_mask))
-   break;
-   WATCHDOG_RESET();
-   }
-
-   return !timeout;
-}
-
-int ulpi_wakeup(struct usb_ehci *ehci)
-{
-   if (readl(&ehci->ulpi_viewpoint) & ULPI_SS)
-   return 0; /* already awake */
-   return ulpi_wait(ehci, ULPI_WU, ULPI_WU);
-}
-
-void ulpi_write(struct usb_ehci *ehci, u32 reg, u32 value)
-{
-   u32 tmp;
-   if (ulpi_wakeup(ehci)) {
-   printf("ULPI wakeup timed out\n");
-   return;
-   }
-
-   tmp = ulpi_wait(ehci, ULPI_RWRUN | ULPI_RWCTRL |
-   reg << ULPI_ADDR_SHIFT | ulpi_write_mask(value), ULPI_RWRUN);
-   if (tmp)
-   printf("ULPI write timed out\n");
-}
-
-u32 ulpi_read(struct usb_ehci *ehci, u32 reg)
-{
-   if (ulpi_wakeup(ehci)) {
-   printf("ULPI wakeup timed out\n");
-   return 0;
-   }
-
-   if (ulpi_wait(ehci, ULPI_RWRUN | reg << ULPI_ADDR_SHIFT, ULPI_RWRUN)) {
-   printf("ULPI read timed out\n");
-   return 0;
-   }
-
-   return ulpi_read_mask(readl(&ehci->ulpi_viewpoint));
-}
-
-void ulpi_init(struct usb_ehci *ehci, struct ulpi_regs *ulpi)
-{
-   u32 tmp = 0;
-   int reg, i;
-
-   /* Assemble ID from four ULPI ID registers (8 bits each). */
-   for (reg = ULPI_ID_REGS_COUNT - 1; reg >= 0; reg--)
-   tmp |= ulpi_read(ehci, reg) << (reg * 8);
-
-   /* Split ID into vendor and product ID. */
-   debug("Found ULPI TX, ID %04x:%04x\n", tmp >> 16, tmp & 0x);
-
-   /* ULPI integrity check */
-   for (i = 0; i < 2; i++) {
-   ulpi_write(ehci, (u32)&ulpi->scratch_write,
-   ULPI_TEST_VALUE << i);
-   tmp = ulpi_read(ehci, (u32)&ulpi->scratch_write);
-
-   if (tmp != (ULPI_TEST_VALUE << i)) {
-   printf("ULPI integrity check failed\n");
-   return;
-   }
-   }
-
-   /* Set ULPI flags. */
-   ulpi_write(ehci, (u32)&ulpi->otg_ctrl_write,
-   ULPI_OTG_EXTVBUSIND |
+   ulpi_otg_ctrl_flags(ehci, ulpi, WRITE, ULPI_OTG_EXTVBUSIND |
ULPI_OTG_DM_PULLDOWN | ULPI_OTG_DP_PULLDOWN);
-   ulpi_write(ehci, (u32)&ulpi->function_ctrl_write,
-   ULPI_FC_XCVRSEL | ULPI_FC_OPMODE_NORMAL |
-   ULPI_FC_SUSPENDM);
-   ulpi_write(ehci, (u32)&ulpi->iface_ctrl_write, 0);
-   ulpi_write(ehci, (u32)&ulpi->otg_ctrl_set,
-   ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT);
+   ulpi_function_ctrl_flags(ehci, ulpi, WRITE, ULPI_FC_XCVRSEL |
+   ULPI_FC_OPMODE_NORMAL | ULPI_FC_SUSPENDM);
+   ulpi_iface_ctrl_flags(ehci, ulpi, WRITE, 0);
 
/*
-* NOTE: This violates USB specification, but otherwise, USB on Efika
-* doesn't charge VBUS and as a result, USB doesn't work.
+* NOTE: Setting ULPI_OTG_CHRGVBUS violates USB specification,
+* but otherwise, USB on Efika doesn't charge VBUS
+* and as a result, USB doesn't work.
 */
-   ulpi_write(ehci, (u32)&ulpi->otg_ctrl_set, ULPI_OTG_CHRGVBUS);
+   ulpi_otg_ctrl_flags(ehci, ulpi, SET, ULPI_OTG_DRVVBUS |
+   ULPI_OTG_DRVVBUS_EXT | ULPI_OTG_CHRGVBUS);
 }
 
 /*
@@ -353,6 +270,7 @@ void ehci1_init(struct usb_ehci *ehci, struct ulpi_regs 
*ulpi)
udelay(1);
 
ulpi_init(ehci, ulpi);
+   ulpi_set_flags(ehci, ulpi);
 }
 
 void ehci2_init(struct usb_ehci *ehci, struct ulpi_regs *ulpi)
@@ -372,6 +290,7 @@ void ehci2_init(struct usb_ehci *ehci, struct ulpi_regs 
*ulpi)
udelay(1);
 
ulpi_init(ehci, ulpi);
+   ulpi_set_flags(ehci, ulpi);
 }
 
 int ehci_hcd_init(void)
diff --git a/include/configs/efikamx.h b/inc

Re: [U-Boot] [PATCH v2 1/3] image: Make image_get_fdt work like image_get_{ram_disk, kernel}

2011-11-05 Thread Simon Glass
Hi Marek,

On Sat, Nov 5, 2011 at 1:41 PM, Marek Vasut  wrote:
>> Hi Marek,
>>
>> On Sat, Nov 5, 2011 at 12:39 PM, Marek Vasut  wrote:
>> >> Hi,
>> >>
>> >> On Sat, Nov 5, 2011 at 11:41 AM, Marek Vasut  
>> >> wrote:
>> >> >> image_get_ram_disk() and image_get_kernel() perform operations in a
>> >> >> consistent order. Modify image_get_fdt() to do things the same way.
>> >> >> This allows a later change to insert some image header manipulations
>> >> >> into these three functions in a consistent fashion.
>> >> >>
>> >> >> v2: New patch
>> >> >>
>> >> >> Signed-off-by: Stephen Warren 
>> >> >
>> >> > Hi Stephen,
>> >> >
>> >> > this patchset is good and all, but can we not also introduce cmd_zload
>> >> > to load zImages? Wolfgang, today's ARM hardware will really benefit
>> >> > from that, uImage holds us back a lot these days. Other option is to
>> >> > extend cmd_bootm() to load zImages.
>> >> >
>> >> > Cheers
>> >>
>> >> Just a quick Q. What is the ultimate intent here? Should we be aiming
>> >> to have U-Boot copy and decompress the data into RAM ready for Linux?
>> >
>> > Nope, not at all. We have a problem with booting linux images which
>> > support multiple different SoCs (because the RAM might be elsewhere for
>> > different SoCs).
>> >
>> >> In theory this should be slightly faster since U-Boot already has the
>> >> data in its cache. I think zImage now supports having an FDT inside
>> >> but what is the advantage of zImage over a uImage with compressed
>> >> portions?
>> >
>> > That's not the point. We need to load FDT, load zImage, setup the regs
>> > and boot it from where we load the zImage. The uImage envelope contains
>> > fixed address to where the kernel image is loaded, which interferes with
>> > kernel's runtime patching of the kernel base address (zreladdr).
>> >
>> > Basically kernel can be loaded to address A1 on one SoC, address A2 on
>> > different SoC, but in the old times, the kernel had to be linked to a
>> > predefined address. That's not true anymore. Now if kernel is loaded to
>> > address A1, it adjusts itself and runs from A1, so for A2 etc.
>> >
>> > uImage blocks this because it forces u-boot to copy zImage to fixed
>> > address.
>>
>> Stephen's patch set should fix that by allowing an unspecified load address
>> .
>>
>> So this means that we are fine if we use a zImage, but what about a
>> uImage? Are we giving up on that altogether? Stephen's original patch
>> on this subject seemed to me to solve the problem with uImage (the one
>> he had all the code size grief with).
>
> I'd be more open to adding some kind of a flag to uImage, rather than using
> address 0x. For this is quite fragile and seems a lot like a hack.

Possibly, but at least it makes it very clear that the load address
should not be used.

>>
>> Can't we commit both of Stephen's patches? It seems to me that they
>> solve different problems.
>
> Yes, 1/3 and 2/3 look good.

Actually I meant both series, sorry. The previous series enhanced
uImage to understand an image that can go anywhere, and I think that
is useful also. In both series, a load address of -1 means 'ignore
it'.

Regards,
Simon


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


[U-Boot] [PATCH] ulpi: add generic ULPI functionality

2011-11-05 Thread Jana Rapava
Add generic functions for ULPI init and setting bits in 
ULPI registers. 

Signed-off-by: Jana Rapava 
Cc: Marek Vasut 
Cc: Remy Bohmer 
Cc: Stefano Babic 
Cc: Igor Grinberg 
---
 Makefile |1 +
 drivers/usb/ulpi/Makefile|   44 ++
 drivers/usb/ulpi/ulpi-viewport.c |   87 +++
 drivers/usb/ulpi/ulpi.c  |  123 ++
 include/usb/ulpi.h   |   16 +
 5 files changed, 271 insertions(+), 0 deletions(-)
 create mode 100644 drivers/usb/ulpi/Makefile
 create mode 100644 drivers/usb/ulpi/ulpi-viewport.c
 create mode 100644 drivers/usb/ulpi/ulpi.c

diff --git a/Makefile b/Makefile
index 571c3eb..a475cb9 100644
--- a/Makefile
+++ b/Makefile
@@ -283,6 +283,7 @@ LIBS += drivers/usb/gadget/libusb_gadget.o
 LIBS += drivers/usb/host/libusb_host.o
 LIBS += drivers/usb/musb/libusb_musb.o
 LIBS += drivers/usb/phy/libusb_phy.o
+LIBS += drivers/usb/ulpi/libusb_ulpi.o
 LIBS += drivers/video/libvideo.o
 LIBS += drivers/watchdog/libwatchdog.o
 LIBS += common/libcommon.o
diff --git a/drivers/usb/ulpi/Makefile b/drivers/usb/ulpi/Makefile
new file mode 100644
index 000..f7b6e20
--- /dev/null
+++ b/drivers/usb/ulpi/Makefile
@@ -0,0 +1,44 @@
+#
+# Copyright (C) 2011 Jana Rapava 
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+include $(TOPDIR)/config.mk
+
+LIB:= $(obj)libusb_ulpi.o
+
+COBJS-$(CONFIG_USB_ULPI) += ulpi.o ulpi-viewport.o
+
+COBJS  := $(COBJS-y)
+SRCS   := $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+
+all:   $(LIB)
+
+$(LIB):$(obj).depend $(OBJS)
+   $(call cmd_link_o_target, $(OBJS))
+
+#
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
diff --git a/drivers/usb/ulpi/ulpi-viewport.c b/drivers/usb/ulpi/ulpi-viewport.c
new file mode 100644
index 000..a0c213e
--- /dev/null
+++ b/drivers/usb/ulpi/ulpi-viewport.c
@@ -0,0 +1,87 @@
+/*
+ * Copyright (C) 2011 Jana Rapava 
+ * Based on:
+ * linux/drivers/usb/otg/ulpi_viewport.c
+ *
+ * Original Copyright follow:
+ * Copyright (C) 2011 Google, Inc.
+ *
+ * This software is licensed under the terms of the GNU General Public
+ * License version 2, as published by the Free Software Foundation, and
+ * may be copied, distributed, and modified under those terms.
+ *
+ * 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.
+ *
+ */
+
+#include 
+#include 
+#include 
+#include 
+
+/* ULPI viewport control bits */
+#define ULPI_WU(1 << 31)
+#define ULPI_SS(1 << 27)
+#define ULPI_RWRUN (1 << 30)
+#define ULPI_RWCTRL(1 << 29)
+
+#define ULPI_ADDR_SHIFT16
+#define ulpi_write_mask(value) ((value) & 0xff)
+#define ulpi_read_mask(value)  (((value) >> 8) & 0xff)
+
+int ulpi_wait(struct usb_ehci *ehci, u32 ulpi_value, u32 ulpi_mask)
+{
+   int timeout = ULPI_TIMEOUT;
+   u32 tmp;
+
+   writel(ulpi_value, &ehci->ulpi_viewpoint);
+
+   /* Wait for the bits in ulpi_mask to become zero. */
+   while (--timeout) {
+   tmp = readl(&ehci->ulpi_viewpoint);
+   if (!(tmp & ulpi_mask))
+   break;
+   WATCHDOG_RESET();
+   }
+
+   return !timeout;
+}
+
+int ulpi_wakeup(struct usb_ehci *ehci)
+{
+   if (readl(&ehci->ulpi_viewpoint) & ULPI_SS)
+   return 0; /* already awake */
+   return ulpi_wait(ehci, ULPI_WU, ULPI_WU);
+}
+
+void ulpi_write(struct usb_ehci *ehci, u32 reg, u32 value)
+{
+   u32 tmp;
+   if (ulpi_wakeup(ehci)) {
+   printf("ULPI wakeup timed out\n");
+   return;
+   }
+
+   tmp = ulpi_wait(ehci, ULPI_RWRUN | ULPI_RWCTRL |
+   reg << ULPI_ADDR_SHIFT | ulpi_write_mask(value), ULPI_RWRUN);
+   if (tmp)
+   printf("ULPI write timed out\n");
+}
+
+u32 ulpi_read(struct usb_ehci *ehci, u32 reg)
+{
+   if 

Re: [U-Boot] [PATCH] powerpc: Correct build warning introduced by getenv_ulong() patch

2011-11-05 Thread Simon Glass
Hi Mike,

On Sun, Oct 30, 2011 at 5:47 PM, Mike Frysinger  wrote:
> On Sunday 23 October 2011 23:41:54 Simon Glass wrote:
>> --- a/arch/powerpc/lib/board.c
>> +++ b/arch/powerpc/lib/board.c
>>
>>   */
>>  void board_init_r (gd_t *id, ulong dest_addr)
>>  {
>> -     char *s;
>>       bd_t *bd;
>>       ulong malloc_start;
>>
>> @@ -727,6 +726,8 @@ void board_init_r (gd_t *id, ulong dest_addr)
>>               flash_size = 0;
>>       } else if ((flash_size = flash_init ()) > 0) {
>>  # ifdef CONFIG_SYS_FLASH_CHECKSUM
>> +             char *s;
>> +
>>               print_size (flash_size, "");
>>               /*
>>                * Compute and print flash CRC if flashchecksum is set to 'y'
>> @@ -927,8 +928,11 @@ void board_init_r (gd_t *id, ulong dest_addr)
>>       /* Initialize from environment */
>>       load_addr = getenv_ulong("loadaddr", 16, load_addr);
>>  #if defined(CONFIG_CMD_NET)
>> -     if ((s = getenv ("bootfile")) != NULL) {
>> -             copy_filename (BootFile, s, sizeof (BootFile));
>> +     {
>> +             char *s = getenv("bootfile");
>> +
>> +             if (s != NULL)
>> +                     copy_filename(BootFile, s, sizeof(BootFile));
>>       }
>>  #endif
>
> same feedback here wrt using __maybe_unused and marking things const ...
> -mike
>

I might leave that alone for now, at least until I get back to the
board.c side of things. It was just a warning fix, and I feel that
board_init_r() is too long and should not do so many things.

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


Re: [U-Boot] [PATCH v2 1/3] image: Make image_get_fdt work like image_get_{ram_disk, kernel}

2011-11-05 Thread Marek Vasut
> Hi Marek,
> 
> On Sat, Nov 5, 2011 at 12:39 PM, Marek Vasut  wrote:
> >> Hi,
> >> 
> >> On Sat, Nov 5, 2011 at 11:41 AM, Marek Vasut  wrote:
> >> >> image_get_ram_disk() and image_get_kernel() perform operations in a
> >> >> consistent order. Modify image_get_fdt() to do things the same way.
> >> >> This allows a later change to insert some image header manipulations
> >> >> into these three functions in a consistent fashion.
> >> >> 
> >> >> v2: New patch
> >> >> 
> >> >> Signed-off-by: Stephen Warren 
> >> > 
> >> > Hi Stephen,
> >> > 
> >> > this patchset is good and all, but can we not also introduce cmd_zload
> >> > to load zImages? Wolfgang, today's ARM hardware will really benefit
> >> > from that, uImage holds us back a lot these days. Other option is to
> >> > extend cmd_bootm() to load zImages.
> >> > 
> >> > Cheers
> >> 
> >> Just a quick Q. What is the ultimate intent here? Should we be aiming
> >> to have U-Boot copy and decompress the data into RAM ready for Linux?
> > 
> > Nope, not at all. We have a problem with booting linux images which
> > support multiple different SoCs (because the RAM might be elsewhere for
> > different SoCs).
> > 
> >> In theory this should be slightly faster since U-Boot already has the
> >> data in its cache. I think zImage now supports having an FDT inside
> >> but what is the advantage of zImage over a uImage with compressed
> >> portions?
> > 
> > That's not the point. We need to load FDT, load zImage, setup the regs
> > and boot it from where we load the zImage. The uImage envelope contains
> > fixed address to where the kernel image is loaded, which interferes with
> > kernel's runtime patching of the kernel base address (zreladdr).
> > 
> > Basically kernel can be loaded to address A1 on one SoC, address A2 on
> > different SoC, but in the old times, the kernel had to be linked to a
> > predefined address. That's not true anymore. Now if kernel is loaded to
> > address A1, it adjusts itself and runs from A1, so for A2 etc.
> > 
> > uImage blocks this because it forces u-boot to copy zImage to fixed
> > address.
> 
> Stephen's patch set should fix that by allowing an unspecified load address
> .
> 
> So this means that we are fine if we use a zImage, but what about a
> uImage? Are we giving up on that altogether? Stephen's original patch
> on this subject seemed to me to solve the problem with uImage (the one
> he had all the code size grief with).

I'd be more open to adding some kind of a flag to uImage, rather than using 
address 0x. For this is quite fragile and seems a lot like a hack.
> 
> Can't we commit both of Stephen's patches? It seems to me that they
> solve different problems.

Yes, 1/3 and 2/3 look good.
> 
> Regards,
> Simon
> 
> >> Regards,
> >> Simon
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 1/3] image: Make image_get_fdt work like image_get_{ram_disk, kernel}

2011-11-05 Thread Simon Glass
Hi Marek,

On Sat, Nov 5, 2011 at 12:39 PM, Marek Vasut  wrote:
>> Hi,
>>
>> On Sat, Nov 5, 2011 at 11:41 AM, Marek Vasut  wrote:
>> >> image_get_ram_disk() and image_get_kernel() perform operations in a
>> >> consistent order. Modify image_get_fdt() to do things the same way.
>> >> This allows a later change to insert some image header manipulations
>> >> into these three functions in a consistent fashion.
>> >>
>> >> v2: New patch
>> >>
>> >> Signed-off-by: Stephen Warren 
>> >
>> > Hi Stephen,
>> >
>> > this patchset is good and all, but can we not also introduce cmd_zload to
>> > load zImages? Wolfgang, today's ARM hardware will really benefit from
>> > that, uImage holds us back a lot these days. Other option is to extend
>> > cmd_bootm() to load zImages.
>> >
>> > Cheers
>>
>> Just a quick Q. What is the ultimate intent here? Should we be aiming
>> to have U-Boot copy and decompress the data into RAM ready for Linux?
>
> Nope, not at all. We have a problem with booting linux images which support
> multiple different SoCs (because the RAM might be elsewhere for different 
> SoCs).
>
>> In theory this should be slightly faster since U-Boot already has the
>> data in its cache. I think zImage now supports having an FDT inside
>> but what is the advantage of zImage over a uImage with compressed
>> portions?
>
> That's not the point. We need to load FDT, load zImage, setup the regs and 
> boot
> it from where we load the zImage. The uImage envelope contains fixed address 
> to
> where the kernel image is loaded, which interferes with kernel's runtime
> patching of the kernel base address (zreladdr).
>
> Basically kernel can be loaded to address A1 on one SoC, address A2 on 
> different
> SoC, but in the old times, the kernel had to be linked to a predefined 
> address.
> That's not true anymore. Now if kernel is loaded to address A1, it adjusts
> itself and runs from A1, so for A2 etc.
>
> uImage blocks this because it forces u-boot to copy zImage to fixed address.

Stephen's patch set should fix that by allowing an unspecified load address .

So this means that we are fine if we use a zImage, but what about a
uImage? Are we giving up on that altogether? Stephen's original patch
on this subject seemed to me to solve the problem with uImage (the one
he had all the code size grief with).

Can't we commit both of Stephen's patches? It seems to me that they
solve different problems.

Regards,
Simon

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


[U-Boot] Hello

2011-11-05 Thread Management

Do you want to make extra money now?
It does not matter if you have a job now or not.
If you are interested, respond immediately by sending:

1. Your full names
2. Complete Address with APT/Unit/Suite number where available, City,
State & Zip Code (Not P.O. Box)
3. Telephone, cell phone and fax numbers
4. Occupation
5. Age (Must be 18 and above)

No sign up fees required.

Upon receipt of the above details from you, one of our Human Resource
Managers will establish contact with you for an interview/Accreditation.
Kindly specify the best way to contact you in your reply to this Ad

Signed
Management




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


[U-Boot] [PATCH v4 3/8] tegra2: spi: Add SPI driver for Tegra2 SOC

2011-11-05 Thread Simon Glass
From: Tom Warren 

This driver supports SPI on Tegra2, running at 48MHz.

Signed-off-by: Tom Warren 
---
Changes in v2:
- Update to support SPI mode and frequency
- Tidy driver according to comments, and tidy a little more

Changes in v3:
- Remove the replaced bus/cs check function
- Change (bitlen & 7) to (bitlen % 8)

Changes in v4:
- Put back the bus/cs check functions
- Remove verbose errors when wrong bus/cs is provided

 arch/arm/include/asm/arch-tegra2/tegra2.h |1 +
 arch/arm/include/asm/arch-tegra2/tegra2_spi.h |   76 +++
 board/nvidia/common/board.c   |4 +
 drivers/spi/Makefile  |1 +
 drivers/spi/tegra2_spi.c  |  265 +
 5 files changed, 347 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-tegra2/tegra2_spi.h
 create mode 100644 drivers/spi/tegra2_spi.c

diff --git a/arch/arm/include/asm/arch-tegra2/tegra2.h 
b/arch/arm/include/asm/arch-tegra2/tegra2.h
index 742a75a..8941443 100644
--- a/arch/arm/include/asm/arch-tegra2/tegra2.h
+++ b/arch/arm/include/asm/arch-tegra2/tegra2.h
@@ -38,6 +38,7 @@
 #define NV_PA_APB_UARTC_BASE   (NV_PA_APB_MISC_BASE + 0x6200)
 #define NV_PA_APB_UARTD_BASE   (NV_PA_APB_MISC_BASE + 0x6300)
 #define NV_PA_APB_UARTE_BASE   (NV_PA_APB_MISC_BASE + 0x6400)
+#define TEGRA2_SPI_BASE(NV_PA_APB_MISC_BASE + 0xC380)
 #define NV_PA_PMC_BASE 0x7000E400
 #define NV_PA_CSITE_BASE   0x7004
 
diff --git a/arch/arm/include/asm/arch-tegra2/tegra2_spi.h 
b/arch/arm/include/asm/arch-tegra2/tegra2_spi.h
new file mode 100644
index 000..ceec428
--- /dev/null
+++ b/arch/arm/include/asm/arch-tegra2/tegra2_spi.h
@@ -0,0 +1,76 @@
+/*
+ * NVIDIA Tegra2 SPI-FLASH controller
+ *
+ * Copyright 2010-2011 NVIDIA Corporation
+ *
+ * This software may be used and distributed according to the
+ * terms of the GNU Public License, Version 2, incorporated
+ * herein by reference.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * Version 2 as published by the Free Software Foundation.
+ *
+ * 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_SPI_H_
+#define _TEGRA2_SPI_H_
+
+#include 
+
+struct spi_tegra {
+   u32 command;/* SPI_COMMAND_0 register  */
+   u32 status; /* SPI_STATUS_0 register */
+   u32 rx_cmp; /* SPI_RX_CMP_0 register  */
+   u32 dma_ctl;/* SPI_DMA_CTL_0 register */
+   u32 tx_fifo;/* SPI_TX_FIFO_0 register */
+   u32 rsvd[3];/* offsets 0x14 to 0x1F reserved */
+   u32 rx_fifo;/* SPI_RX_FIFO_0 register */
+};
+
+#define SPI_CMD_GO (1 << 30)
+#define SPI_CMD_ACTIVE_SCLK_SHIFT  26
+#define SPI_CMD_ACTIVE_SCLK_MASK   (3 << SPI_CMD_ACTIVE_SCLK_SHIFT)
+#define SPI_CMD_CK_SDA (1 << 21)
+#define SPI_CMD_ACTIVE_SDA_SHIFT   18
+#define SPI_CMD_ACTIVE_SDA_MASK(3 << SPI_CMD_ACTIVE_SDA_SHIFT)
+#define SPI_CMD_CS_POL (1 << 16)
+#define SPI_CMD_TXEN   (1 << 15)
+#define SPI_CMD_RXEN   (1 << 14)
+#define SPI_CMD_CS_VAL (1 << 13)
+#define SPI_CMD_CS_SOFT(1 << 12)
+#define SPI_CMD_CS_DELAY   (1 << 9)
+#define SPI_CMD_CS3_EN (1 << 8)
+#define SPI_CMD_CS2_EN (1 << 7)
+#define SPI_CMD_CS1_EN (1 << 6)
+#define SPI_CMD_CS0_EN (1 << 5)
+#define SPI_CMD_BIT_LENGTH (1 << 4)
+#define SPI_CMD_BIT_LENGTH_MASK0x001F
+
+#define SPI_STAT_BSY   (1 << 31)
+#define SPI_STAT_RDY   (1 << 30)
+#define SPI_STAT_RXF_FLUSH (1 << 29)
+#define SPI_STAT_TXF_FLUSH (1 << 28)
+#define SPI_STAT_RXF_UNR   (1 << 27)
+#define SPI_STAT_TXF_OVF   (1 << 26)
+#define SPI_STAT_RXF_EMPTY (1 << 25)
+#define SPI_STAT_RXF_FULL  (1 << 24)
+#define SPI_STAT_TXF_EMPTY (1 << 23)
+#define SPI_STAT_TXF_FULL  (1 << 22)
+#define SPI_STAT_SEL_TXRX_N(1 << 16)
+#define SPI_STAT_CUR_BLKCNT(1 << 15)
+
+#define SPI_TIMEOUT1000
+#define TEGRA2_SPI_MAX_FREQ5200
+
+
+#endif /* _TEGRA2_SPI_H_ */
diff --git a/board/nvidia/common/board.c b/board/nvidia/common/board.c
index a2d45c1..2591ebc 100644
--- a/board/nvidia/common/board.c
+++ b/board/nvidia/common/board.c
@@ -31,6 +31,7 @@
 #include 
 #include 
 #include 

Re: [U-Boot] [PATCH v2 1/3] image: Make image_get_fdt work like image_get_{ram_disk, kernel}

2011-11-05 Thread Marek Vasut
> Hi,
> 
> On Sat, Nov 5, 2011 at 11:41 AM, Marek Vasut  wrote:
> >> image_get_ram_disk() and image_get_kernel() perform operations in a
> >> consistent order. Modify image_get_fdt() to do things the same way.
> >> This allows a later change to insert some image header manipulations
> >> into these three functions in a consistent fashion.
> >> 
> >> v2: New patch
> >> 
> >> Signed-off-by: Stephen Warren 
> > 
> > Hi Stephen,
> > 
> > this patchset is good and all, but can we not also introduce cmd_zload to
> > load zImages? Wolfgang, today's ARM hardware will really benefit from
> > that, uImage holds us back a lot these days. Other option is to extend
> > cmd_bootm() to load zImages.
> > 
> > Cheers
> 
> Just a quick Q. What is the ultimate intent here? Should we be aiming
> to have U-Boot copy and decompress the data into RAM ready for Linux?

Nope, not at all. We have a problem with booting linux images which support 
multiple different SoCs (because the RAM might be elsewhere for different SoCs).

> In theory this should be slightly faster since U-Boot already has the
> data in its cache. I think zImage now supports having an FDT inside
> but what is the advantage of zImage over a uImage with compressed
> portions?

That's not the point. We need to load FDT, load zImage, setup the regs and boot 
it from where we load the zImage. The uImage envelope contains fixed address to 
where the kernel image is loaded, which interferes with kernel's runtime 
patching of the kernel base address (zreladdr).

Basically kernel can be loaded to address A1 on one SoC, address A2 on 
different 
SoC, but in the old times, the kernel had to be linked to a predefined address. 
That's not true anymore. Now if kernel is loaded to address A1, it adjusts 
itself and runs from A1, so for A2 etc.

uImage blocks this because it forces u-boot to copy zImage to fixed address.
> 
> Regards,
> Simon
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 1/3] image: Make image_get_fdt work like image_get_{ram_disk, kernel}

2011-11-05 Thread Simon Glass
Hi,

On Sat, Nov 5, 2011 at 11:41 AM, Marek Vasut  wrote:
>> image_get_ram_disk() and image_get_kernel() perform operations in a
>> consistent order. Modify image_get_fdt() to do things the same way.
>> This allows a later change to insert some image header manipulations
>> into these three functions in a consistent fashion.
>>
>> v2: New patch
>>
>> Signed-off-by: Stephen Warren 
>
> Hi Stephen,
>
> this patchset is good and all, but can we not also introduce cmd_zload to load
> zImages? Wolfgang, today's ARM hardware will really benefit from that, uImage
> holds us back a lot these days. Other option is to extend cmd_bootm() to load
> zImages.
>
> Cheers
>

Just a quick Q. What is the ultimate intent here? Should we be aiming
to have U-Boot copy and decompress the data into RAM ready for Linux?
In theory this should be slightly faster since U-Boot already has the
data in its cache. I think zImage now supports having an FDT inside
but what is the advantage of zImage over a uImage with compressed
portions?

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


Re: [U-Boot] [PATCH v2 3/8] tegra2: spi: Add SPI driver for Tegra2 SOC

2011-11-05 Thread Simon Glass
Hi Mike,

On Sat, Nov 5, 2011 at 10:13 AM, Mike Frysinger  wrote:
> On Saturday 05 November 2011 10:36:30 Simon Glass wrote:
>> On Thu, Nov 3, 2011 at 6:36 PM, Mike Frysinger wrote:
>> > On Thursday 03 November 2011 18:41:34 Simon Glass wrote:
>> >> --- /dev/null
>> >> +++ b/drivers/spi/tegra2_spi.c
>> >>
>> >> +int spi_cs_is_valid(unsigned int bus, unsigned int cs)
>> >> +{
>> >> +     /* Tegra2 SPI-Flash - only 1 device ('bus/cs') */
>> >> +     if (bus > 0 && cs != 0)
>> >> +             return 0;
>> >> +     else
>> >> +             return 1;
>> >> +}
>> >
>> > shouldn't that be "||" and not "&&" ?
>>
>> This function should be removed as it doesn't print enough errors.
>
> this func is part of the SPI API.  you can't remove it ;).

OK - it seems to only be used by the mmc_spi command which Tegra isn't
using. But I will add it back in. (Should it be called in
spi_flash_probe(), for example?)

>
>> >> +struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs,
>> >> +             unsigned int max_hz, unsigned int mode)
>> >> +{
>> >> +     struct tegra_spi_slave *spi;
>> >> +
>> >> +     if (!spi_cs_is_valid(bus, cs))
>> >> +             return NULL;
>> >> +
>> >> +     if (bus != 0) {
>> >> +             printf("SPI error: unsupported bus %d\n", bus);
>> >> +             return NULL;
>> >> +     }
>> >> +     if (cs != 0) {
>> >> +             printf("SPI error: unsupported chip select %d on bus
>> >> %d\n", +                    cs, bus);
>> >> +             return NULL;
>> >> +     }
>> >
>> > doesn't spi_cs_is_valid() make these two later checks redundant ?
>>
>> Yes - have removed the function.
>
> i think this is the wrong direction ... other SPI buses are not warning about
> invalid bus/cs combos and that seems to be fine.  i don't think the tegra spi
> bus needs to be uniquely verbose.

OK, I was lead astray by the OMAP code which does this. I will revert
and resend this patch.

>
>> >> +     reg = readl(®s->status);
>> >> +     writel(reg, ®s->status);     /* Clear all SPI events via R/W */
>> >
>> > are these R1C or W1C bits ?  if the latter, you could just write -1 and
>> > avoid the read altogether ...
>>
>> The next line is:
>>
>>       debug("spi_xfer entry: STATUS = %08x\n", reg);
>>
>> and I didn't want to remove that, so I need to keep the read
>> unfortunately. It could perhaps be this if you are keen:
>>
>> writel(-1, ®s->status);     /* Clear all SPI events via R/W */
>> debug("spi_xfer entry: STATUS = %08x\n", readl(®->status));
>
> what you have now is fine if you prefer it that way
> -mike
>

OK - I will leave it. I have already modified Tom's driver more than is polite.

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


Re: [U-Boot] [PATCH v2 6/8] tegra2: Implement SPI / UART GPIO switch

2011-11-05 Thread Simon Glass
Hi Mike,

On Sat, Nov 5, 2011 at 10:11 AM, Mike Frysinger  wrote:
> On Saturday 05 November 2011 10:43:07 Simon Glass wrote:
>> On Thu, Nov 3, 2011 at 6:44 PM, Mike Frysinger wrote:
>> > On Thursday 03 November 2011 18:41:37 Simon Glass wrote:
>> >> Since we are adding a second file to board/nvidia/common, we create
>> >> a proper Makefile there and remove the direct board.o include from
>> >> board/nvidia/seaboard/Makefile
>> >
>> > so who is including board/nvidia/common/libnvidia.o now ?
>>
>> No one - it doesn't exist and that directory doesn't have a Makefile.
>> The top-level Makefile doesn't require it, but since I now have more
>> than one object file I want to create a library.
>
> this patchset adds:
>  board/nvidia/common/Makefile                       |   47 +++
>
> which creates a libnvidia.o.  so once this patch is applied, how is
> libnvidia.o getting linked in ?
> -mike
>

There is a bit of the top-level Makefile which does this:

LIBS += $(shell if [ -f board/$(VENDOR)/common/Makefile ]; then echo \
"board/$(VENDOR)/common/lib$(VENDOR).o"; fi)

but it is only activated if it sees a Makefile there. By adding it,
the library is created for me.

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


Re: [U-Boot] [PATCH v2 1/3] image: Make image_get_fdt work like image_get_{ram_disk, kernel}

2011-11-05 Thread Marek Vasut
> image_get_ram_disk() and image_get_kernel() perform operations in a
> consistent order. Modify image_get_fdt() to do things the same way.
> This allows a later change to insert some image header manipulations
> into these three functions in a consistent fashion.
> 
> v2: New patch
> 
> Signed-off-by: Stephen Warren 

Hi Stephen,

this patchset is good and all, but can we not also introduce cmd_zload to load 
zImages? Wolfgang, today's ARM hardware will really benefit from that, uImage 
holds us back a lot these days. Other option is to extend cmd_bootm() to load 
zImages.

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


[U-Boot] [PATCH/RFC] global_data: unify global flag defines

2011-11-05 Thread Mike Frysinger
All the global flag defines are the same across all arches (ignoring two
unique x86 ones).  So unify them in one place, and add a simple way for
arches to extend for their needs.

Signed-off-by: Mike Frysinger 
---
note: this depends on Graeme's x86 boot flag clean up

 arch/arm/include/asm/global_data.h|   14 +---
 arch/avr32/include/asm/global_data.h  |   14 +---
 arch/blackfin/include/asm/global_data.h   |   14 +---
 arch/m68k/include/asm/global_data.h   |   14 +---
 arch/microblaze/include/asm/global_data.h |   14 +---
 arch/mips/include/asm/global_data.h   |   14 +---
 arch/nds32/include/asm/global_data.h  |   14 +---
 arch/nios2/include/asm/global_data.h  |   10 +
 arch/powerpc/include/asm/global_data.h|   14 +---
 arch/sandbox/include/asm/global_data.h|   14 +---
 arch/sh/include/asm/global_data.h |9 +---
 arch/sparc/include/asm/global_data.h  |   14 +---
 arch/x86/include/asm/global_data.h|   16 +-
 include/asm-generic/global_data_flags.h   |   33 +
 14 files changed, 46 insertions(+), 162 deletions(-)
 create mode 100644 include/asm-generic/global_data_flags.h

diff --git a/arch/arm/include/asm/global_data.h 
b/arch/arm/include/asm/global_data.h
index c3ff789..f8088fe 100644
--- a/arch/arm/include/asm/global_data.h
+++ b/arch/arm/include/asm/global_data.h
@@ -29,8 +29,6 @@
  * some locked parts of the data cache) to allow for a minimum set of
  * global variables during system initialization (until we have set
  * up the memory controller so that we can use RAM).
- *
- * Keep it *SMALL* and remember to set GENERATED_GBL_DATA_SIZE > sizeof(gd_t)
  */
 
 typedefstruct  global_data {
@@ -86,17 +84,7 @@ typedef  struct  global_data {
 #endif
 } gd_t;
 
-/*
- * Global Data Flags
- */
-#defineGD_FLG_RELOC0x1 /* Code was relocated to RAM
*/
-#defineGD_FLG_DEVINIT  0x2 /* Devices have been 
initialized*/
-#defineGD_FLG_SILENT   0x4 /* Silent mode  
*/
-#defineGD_FLG_POSTFAIL 0x8 /* Critical POST test failed
*/
-#defineGD_FLG_POSTSTOP 0x00010 /* POST seqeunce aborted
*/
-#defineGD_FLG_LOGINIT  0x00020 /* Log Buffer has been 
initialized  */
-#define GD_FLG_DISABLE_CONSOLE 0x00040 /* Disable console (in & out)   
*/
-#define GD_FLG_ENV_READY   0x00080 /* Environment imported into hash table 
*/
+#include 
 
 #define DECLARE_GLOBAL_DATA_PTR register volatile gd_t *gd asm ("r8")
 
diff --git a/arch/avr32/include/asm/global_data.h 
b/arch/avr32/include/asm/global_data.h
index 5c654bd..7878bb1 100644
--- a/arch/avr32/include/asm/global_data.h
+++ b/arch/avr32/include/asm/global_data.h
@@ -28,8 +28,6 @@
  * some locked parts of the data cache) to allow for a minimum set of
  * global variables during system initialization (until we have set
  * up the memory controller so that we can use RAM).
- *
- * Keep it *SMALL* and remember to set GENERATED_GBL_DATA_SIZE > sizeof(gd_t)
  */
 
 typedefstruct  global_data {
@@ -52,17 +50,7 @@ typedef  struct  global_data {
charenv_buf[32];/* buffer for getenv() before reloc. */
 } gd_t;
 
-/*
- * Global Data Flags
- */
-#defineGD_FLG_RELOC0x1 /* Code was relocated to RAM
*/
-#defineGD_FLG_DEVINIT  0x2 /* Devices have been 
initialized*/
-#defineGD_FLG_SILENT   0x4 /* Silent mode  
*/
-#defineGD_FLG_POSTFAIL 0x8 /* Critical POST test failed
*/
-#defineGD_FLG_POSTSTOP 0x00010 /* POST seqeunce aborted
*/
-#defineGD_FLG_LOGINIT  0x00020 /* Log Buffer has been 
initialized  */
-#define GD_FLG_DISABLE_CONSOLE 0x00040 /* Disable console (in & out)   
*/
-#define GD_FLG_ENV_READY   0x00080 /* Environment imported into hash table 
*/
+#include 
 
 #define DECLARE_GLOBAL_DATA_PTR register gd_t *gd asm("r5")
 
diff --git a/arch/blackfin/include/asm/global_data.h 
b/arch/blackfin/include/asm/global_data.h
index 67aa30f..ad42e91 100644
--- a/arch/blackfin/include/asm/global_data.h
+++ b/arch/blackfin/include/asm/global_data.h
@@ -36,8 +36,6 @@
  * some locked parts of the data cache) to allow for a minimum set of
  * global variables during system initialization (until we have set
  * up the memory controller so that we can use RAM).
- *
- * Keep it *SMALL* and remember to set GENERATED_GBL_DATA_SIZE > sizeof(gd_t)
  */
 typedef struct global_data {
bd_t *bd;
@@ -61,17 +59,7 @@ typedef struct global_data {
charenv_buf[32];/* buffer for getenv() before reloc. */
 } gd_t;
 
-/*
- * Global Data Flags
- */
-#define  

[U-Boot] [PATCH] Blackfin: cache result of cpp check

2011-11-05 Thread Mike Frysinger
Avoid overhead of computing this value multiple times.

Signed-off-by: Mike Frysinger 
---
 arch/blackfin/config.mk |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/arch/blackfin/config.mk b/arch/blackfin/config.mk
index f9d46de..3595aa2 100644
--- a/arch/blackfin/config.mk
+++ b/arch/blackfin/config.mk
@@ -48,9 +48,10 @@ 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
-HOSTCFLAGS_NOPED += \
+HOSTCFLAGS_NOPED_ADSP := \
$(shell $(CPP) -dD - -mcpu=$(CONFIG_BFIN_CPU) http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 3/8] tegra2: spi: Add SPI driver for Tegra2 SOC

2011-11-05 Thread Mike Frysinger
On Saturday 05 November 2011 10:36:30 Simon Glass wrote:
> On Thu, Nov 3, 2011 at 6:36 PM, Mike Frysinger wrote:
> > On Thursday 03 November 2011 18:41:34 Simon Glass wrote:
> >> --- /dev/null
> >> +++ b/drivers/spi/tegra2_spi.c
> >> 
> >> +int spi_cs_is_valid(unsigned int bus, unsigned int cs)
> >> +{
> >> + /* Tegra2 SPI-Flash - only 1 device ('bus/cs') */
> >> + if (bus > 0 && cs != 0)
> >> + return 0;
> >> + else
> >> + return 1;
> >> +}
> > 
> > shouldn't that be "||" and not "&&" ?
> 
> This function should be removed as it doesn't print enough errors.

this func is part of the SPI API.  you can't remove it ;).

> >> +struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs,
> >> + unsigned int max_hz, unsigned int mode)
> >> +{
> >> + struct tegra_spi_slave *spi;
> >> +
> >> + if (!spi_cs_is_valid(bus, cs))
> >> + return NULL;
> >> +
> >> + if (bus != 0) {
> >> + printf("SPI error: unsupported bus %d\n", bus);
> >> + return NULL;
> >> + }
> >> + if (cs != 0) {
> >> + printf("SPI error: unsupported chip select %d on bus
> >> %d\n", +cs, bus);
> >> + return NULL;
> >> + }
> > 
> > doesn't spi_cs_is_valid() make these two later checks redundant ?
> 
> Yes - have removed the function.

i think this is the wrong direction ... other SPI buses are not warning about 
invalid bus/cs combos and that seems to be fine.  i don't think the tegra spi 
bus needs to be uniquely verbose.

> >> + reg = readl(®s->status);
> >> + writel(reg, ®s->status); /* Clear all SPI events via R/W */
> > 
> > are these R1C or W1C bits ?  if the latter, you could just write -1 and
> > avoid the read altogether ...
> 
> The next line is:
> 
>   debug("spi_xfer entry: STATUS = %08x\n", reg);
> 
> and I didn't want to remove that, so I need to keep the read
> unfortunately. It could perhaps be this if you are keen:
> 
> writel(-1, ®s->status); /* Clear all SPI events via R/W */
> debug("spi_xfer entry: STATUS = %08x\n", readl(®->status));

what you have now is fine if you prefer it that way
-mike


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


Re: [U-Boot] [PATCH v2 6/8] tegra2: Implement SPI / UART GPIO switch

2011-11-05 Thread Mike Frysinger
On Saturday 05 November 2011 10:43:07 Simon Glass wrote:
> On Thu, Nov 3, 2011 at 6:44 PM, Mike Frysinger wrote:
> > On Thursday 03 November 2011 18:41:37 Simon Glass wrote:
> >> Since we are adding a second file to board/nvidia/common, we create
> >> a proper Makefile there and remove the direct board.o include from
> >> board/nvidia/seaboard/Makefile
> > 
> > so who is including board/nvidia/common/libnvidia.o now ?
> 
> No one - it doesn't exist and that directory doesn't have a Makefile.
> The top-level Makefile doesn't require it, but since I now have more
> than one object file I want to create a library.

this patchset adds:
 board/nvidia/common/Makefile   |   47 +++

which creates a libnvidia.o.  so once this patch is applied, how is 
libnvidia.o getting linked in ?
-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 v8 3/4] mpc83xx: Add a GPIO driver for the MPC83XX family

2011-11-05 Thread Mike Frysinger
On Friday 04 November 2011 22:25:00 Joe Hershberger wrote:
> --- /dev/null
> +++ b/arch/powerpc/include/asm/arch-mpc83xx/gpio.h
>
> +#if defined(CONFIG_MPC8313) || defined(CONFIG_MPC8308) || \
> + defined(CONFIG_MPC8315)
> + #define MPC83XX_GPIO_CTRLRS 1
> +#elif defined(CONFIG_MPC834x) || defined(CONFIG_MPC837x)
> + #define MPC83XX_GPIO_CTRLRS 2
> +#else
> + #define MPC83XX_GPIO_CTRLRS 0
> +#endif

there should not be whitespace before the "#"

> --- /dev/null
> +++ b/drivers/gpio/mpc83xx_gpio.c
>
> +#ifndef CONFIG_MPC83XX_GPIO_0_INIT_DIRECTION
> + #define CONFIG_MPC83XX_GPIO_0_INIT_DIRECTION 0
> +#endif
> +#ifndef CONFIG_MPC83XX_GPIO_1_INIT_DIRECTION
> + #define CONFIG_MPC83XX_GPIO_1_INIT_DIRECTION 0
> +#endif
> +#ifndef CONFIG_MPC83XX_GPIO_0_INIT_OPEN_DRAIN
> + #define CONFIG_MPC83XX_GPIO_0_INIT_OPEN_DRAIN 0
> +#endif
> +#ifndef CONFIG_MPC83XX_GPIO_1_INIT_OPEN_DRAIN
> + #define CONFIG_MPC83XX_GPIO_1_INIT_OPEN_DRAIN 0
> +#endif
> +#ifndef CONFIG_MPC83XX_GPIO_0_INIT_VALUE
> + #define CONFIG_MPC83XX_GPIO_0_INIT_VALUE 0
> +#endif
> +#ifndef CONFIG_MPC83XX_GPIO_1_INIT_VALUE
> + #define CONFIG_MPC83XX_GPIO_1_INIT_VALUE 0
> +#endif

same here
-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 v8 1/4] gpio: Modify common gpio.h to more closely match Linux

2011-11-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] nds32: toolchains for building ?

2011-11-05 Thread Mike Frysinger
On Friday 04 November 2011 21:35:02 馬克泡 wrote:
> 2011/11/5 Mike Frysinger :
> > On Friday 04 November 2011 18:22:32 Mike Frysinger wrote:
> >> On Friday 04 November 2011 04:24:51 馬克泡 wrote:
> >> > It's pity that only you can found the toolchain with full source from
> >> > public is very old.
> >> > I can give you the url as follows.
> >> > http://osdk.andestech.com/
> >> 
> >> yes, i d/l-ed that monster of a .rar (which contains .tar.gz which
> >> themselves contain .tar.gz .), but the linker in there segfaults for
> >> me :(
> 
> The old toolchain contains a lot of bugs, even the implementation of
> rpath has problems.
> Please do not waste your time!
> I'll try to get one for you next week. :)

thanks.  i think you should still fix that linker script issue i pointed out as 
it seems like the linker is putting stuff after the _end/.bss in your u-boot 
image ... not that i can double check as i can't link the final ELF and analyze 
it :).
-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 v0 1/7] x86: Punt cold- and warm-boot flags

2011-11-05 Thread Mike Frysinger
On Friday 04 November 2011 22:21:45 Graeme Russ wrote:
> Nobody uses them anyway

thanks !  this was the only hold out i had with gd flag unification (hrm, did i 
forget to post that patch?).

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] [PATCH V4] sandbox: Add improved RAM simulation

2011-11-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] [PATCH v0 3/4] env: implement selective "env default"

2011-11-05 Thread Wolfgang Denk
Dear Gerlando Falauto,

In message <1319647072-17504-4-git-send-email-gerlando.fala...@keymile.com> you 
wrote:
> Signed-off-by: Gerlando Falauto 
> ---
>  README   |2 ++
>  common/cmd_nvedit.c  |   42 --
>  common/env_common.c  |   14 ++
>  include/config_cmd_all.h |1 +
>  include/environment.h|5 +
>  5 files changed, 58 insertions(+), 6 deletions(-)

Did you actually ever try to compile your code, and test it?

...
> +#if CONFIG_CMD_DEFAULTENV_VARS

When I try and enable your code by adding

#define CONFIG_CMD_DEFAULTENV_VARS

to a board config file, this will result in a an error:

cmd_nvedit.c:699:31: error: #if with no expression


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
Copy from one, it's plagiarism; copy from two, it's research.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v0 1/4] Groundwork for generalization of env interface

2011-11-05 Thread Wolfgang Denk
Dear Gerlando Falauto,

In message <1319647072-17504-2-git-send-email-gerlando.fala...@keymile.com> you 
wrote:
> Signed-off-by: Gerlando Falauto 
> ---
>  common/cmd_nvedit.c   |  152 
> +++--
>  common/env_common.c   |   15 -
>  include/environment.h |7 ++
>  include/search.h  |   13 
>  lib/hashtable.c   |   50 
>  5 files changed, 179 insertions(+), 58 deletions(-)

This patch introduces new build warnings:

cmd_nvedit.c: In function 'env_check_apply':
cmd_nvedit.c:242:3: warning: passing argument 1 of 'serial_assign'
discards 'const' qualifier from pointer target type [enabled by
default]
/home/wd/git/u-boot/env-substitute/include/serial.h:95:12: note:
expected 'char *' but argument is of type 'const char *'

Please fix.

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
A year spent in artificial intelligence is enough to make one believe
in God.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v0 2/4] env: check and apply changes on delete/destroy

2011-11-05 Thread Wolfgang Denk
Dear Gerlando Falauto,

In message <1319647072-17504-3-git-send-email-gerlando.fala...@keymile.com> you 
wrote:
> Signed-off-by: Gerlando Falauto 
> ---
>  common/cmd_nvedit.c |2 +-
>  include/search.h|6 --
>  lib/hashtable.c |   18 --
>  3 files changed, 17 insertions(+), 9 deletions(-)

Are you sure these changes are really independent from the previous
and following ones?  Ordo we introduc bisectability issues here?


> -extern void hdestroy_r(struct hsearch_data *__htab);
> +extern void hdestroy_r(struct hsearch_data *__htab,
> +apply_cb apply);

See provious comments - indentation always by TAB. Please fix
globally, i. e. in all your patches.


> + if (apply != NULL) {
> + /* deletion is always forced */

Um why is this the case?

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
>  Is there a way to determine Yesterday's date using Unix utilities?
 echo "what is yesterday's date?" | /bin/mail root
 -- Randal L. Schwartz in 
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v0 1/4] Groundwork for generalization of env interface

2011-11-05 Thread Wolfgang Denk
Dear Gerlando Falauto,

In message <1319647072-17504-2-git-send-email-gerlando.fala...@keymile.com> you 
wrote:
> Signed-off-by: Gerlando Falauto 
> ---
>  common/cmd_nvedit.c   |  152 
> +++--
>  common/env_common.c   |   15 -
>  include/environment.h |7 ++
>  include/search.h  |   13 
>  lib/hashtable.c   |   50 
>  5 files changed, 179 insertions(+), 58 deletions(-)
...
> -int _do_env_set (int flag, int argc, char * const argv[])
> +int env_check_apply(const char *name, const char *oldval,
> + const char *newval, int flag)

Please use only TAB for indentation.  Please fix globally.


> - if (ep) {   /* variable exists */
> + if ((oldval != NULL) /* variable exists */
> +  && ((flag & H_FORCE) == 0)) { /* and we are not forced */

Incorrect indentation.


> +/*
> + * Set a new environment variable,
> + * or replace or delete an existing one.
> +*/

Incorrect multiline comment style.

> + /* Perform requested checks. Notice how since we are overwriting
> +  * a single variable, we need to set H_NOCLEAR */

Incorrect multiline comment style.

>  void set_default_env(const char *s)
>  {
> + /* By default, do not apply changes as they will eventually
> +  * be applied by someone else */

Incorrect multiline comment style.

Please fix globally!

> + if (himport_ex(&env_htab, (char *)default_environment,
> + sizeof(default_environment), '\0', 0,
> +   0, NULL, apply_function) == 0) {

Incorrect / inconsistent indentation.  Please fix globally.


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
Applying computer technology is simply finding the  right  wrench  to
pound in the correct screw.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] dfu: initial implementation

2011-11-05 Thread Wolfgang Denk
Dear Stefan Schmidt,

In message <2002200717.GP17069@excalibur.local> you wrote:
>
> While I think a dfu command is usefull I don't like the need to
> execute it before any DFU interaction can happen. That may be an
> option during development but for field upgrades or receovery it is
> not.

Yes, a command is the natural way in U-Boot to start any activities.

> I already wrote a bit about my approach here. At OpenMoko we used a
> button to enter u-boot during startup when pressed. This offered a

This is just another way to start a command.

> usbtty interface as usb gadget as well as the runtime descripto for
> DFU. With dfu-util it was possible to iniate the DFU download or
> upload procedure while being in the mode. Another option would be to
> directly jump into DFU mode when a button is pressed.

NAK.  Let's stick to standard interfaces.

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
Each honest calling, each walk of life, has its own  elite,  its  own
aristocracy based on excellence of performance. - James Bryant Conant
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] dfu: initial implementation

2011-11-05 Thread Wolfgang Denk
Dear Andrzej Pietrasiewicz,

In message <000601cc9abe$4f544bd0$edfce370$%p...@samsung.com> you wrote:
> 
> > > http://www.usb.org/developers/devclass_docs/DFU_1.1.pdf
> 
> DFU is part of USB; an extension to be precise, but an extension bound
> so tightly to the design and philosophy of USB that it is rather
> inconceivable to separate the two.

Could you please be so kind and explain which exact issues you see for
such a separation?

> > Eventually it should be possible to run this protocol over Ethernet or
> > even over a serial line?
> 
> Of course there is no such a reason, provided we lay USB over Ethernet
> or serial line first ;)

This is of course not intended.  I was thinking about a plain standard
UDP based link.

> Seriously speaking, in view of ties between DFU and USB
> IMHO it is impossible, or, at least, highly impractical.

Can you please support this statement with a few facts?

> > If my assumption is correct, then what would it take to split off
> > protocol part and make it independent of the actual driver interface?
> 
> I guess that in the situation given it would be of little use.

What do you think would be of little use?

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
This restaurant was advertising breakfast  any  time.  So  I  ordered
french toast in the renaissance.- Steven Wright, comedian
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 17/22] board/sacsng/sacsng.c: CodingStyle cleanup

2011-11-05 Thread Wolfgang Denk
Make (mostly) checkpatch clean.

Signed-off-by: Wolfgang Denk 
Cc: Jerry Van Baren 
---
 board/sacsng/sacsng.c | 1329 -
 1 files changed, 663 insertions(+), 666 deletions(-)

diff --git a/board/sacsng/sacsng.c b/board/sacsng/sacsng.c
index 61cab87..09f59a0 100644
--- a/board/sacsng/sacsng.c
+++ b/board/sacsng/sacsng.c
@@ -39,7 +39,7 @@ extern void eth_loopback_test(void);
 #endif /* CONFIG_ETHER_LOOPBACK_TEST */
 
 #include "clkinit.h"
-#include "ioconfig.h" /* I/O configuration table */
+#include "ioconfig.h"  /* I/O configuration table */
 
 /*
  * PBI Page Based Interleaving
@@ -61,88 +61,86 @@ extern void eth_loopback_test(void);
 /*
  * ADC/DAC Defines:
  */
-#define INITIAL_SAMPLE_RATE 10016 /* Initial Daq sample rate */
-#define INITIAL_RIGHT_JUST  0 /* Initial DAC right justification */
-#define INITIAL_MCLK_DIVIDE 0 /* Initial MCLK Divide */
-#define INITIAL_SAMPLE_64X  1 /* Initial  64x clocking mode */
-#define INITIAL_SAMPLE_128X 0 /* Initial 128x clocking mode */
+#define INITIAL_SAMPLE_RATE 10016  /* Initial Daq sample rate */
+#define INITIAL_RIGHT_JUST  0  /* Initial DAC right justification */
+#define INITIAL_MCLK_DIVIDE 0  /* Initial MCLK Divide */
+#define INITIAL_SAMPLE_64X  1  /* Initial  64x clocking mode */
+#define INITIAL_SAMPLE_128X 0  /* Initial 128x clocking mode */
 
 /*
  * ADC Defines:
  */
-#define I2C_ADC_1_ADDR 0x0E   /* I2C Address of the ADC #1 */
-#define I2C_ADC_2_ADDR 0x0F   /* I2C Address of the ADC #2 */
+#define I2C_ADC_1_ADDR 0x0E/* I2C Address of the ADC #1 */
+#define I2C_ADC_2_ADDR 0x0F/* I2C Address of the ADC #2 */
 
-#define ADC_SDATA1_MASK 0x0002/* PA14 - CH12SDATA_PU   */
-#define ADC_SDATA2_MASK 0x0001/* PA15 - CH34SDATA_PU   */
+#define ADC_SDATA1_MASK 0x0002 /* PA14 - CH12SDATA_PU   */
+#define ADC_SDATA2_MASK 0x0001 /* PA15 - CH34SDATA_PU   */
 
-#define ADC_VREF_CAP   100/* VREF capacitor in uF */
-#define ADC_INITIAL_DELAY (10 * ADC_VREF_CAP) /* 10 usec per uF, in usec */
-#define ADC_SDATA_DELAY100/* ADC SDATA release delay in usec */
+#define ADC_VREF_CAP   100 /* VREF capacitor in uF */
+#define ADC_INITIAL_DELAY (10 * ADC_VREF_CAP)  /* 10 usec per uF, in usec */
+#define ADC_SDATA_DELAY100 /* ADC SDATA release delay in 
usec */
 #define ADC_CAL_DELAY (100 / INITIAL_SAMPLE_RATE * 4500)
- /* Wait at least 4100 LRCLK's */
-
-#define ADC_REG1_FRAME_START0x80  /* Frame start */
-#define ADC_REG1_GROUND_CAL 0x40  /* Ground calibration enable */
-#define ADC_REG1_ANA_MOD_PDOWN  0x20  /* Analog modulator section in power 
down */
-#define ADC_REG1_DIG_MOD_PDOWN  0x10  /* Digital modulator section in power 
down */
-
-#define ADC_REG2_128x   0x80  /* Oversample at 128x */
-#define ADC_REG2_CAL0x40  /* System calibration enable */
-#define ADC_REG2_CHANGE_SIGN0x20  /* Change sign enable */
-#define ADC_REG2_LR_DISABLE 0x10  /* Left/Right output disable */
-#define ADC_REG2_HIGH_PASS_DIS  0x08  /* High pass filter disable */
-#define ADC_REG2_SLAVE_MODE 0x04  /* Slave mode */
-#define ADC_REG2_DFS0x02  /* Digital format select */
-#define ADC_REG2_MUTE   0x01  /* Mute */
-
-#define ADC_REG7_ADDR_ENABLE0x80  /* Address enable */
-#define ADC_REG7_PEAK_ENABLE0x40  /* Peak enable */
-#define ADC_REG7_PEAK_UPDATE0x20  /* Peak update */
-#define ADC_REG7_PEAK_FORMAT0x10  /* Peak display format */
-#define ADC_REG7_DIG_FILT_PDOWN 0x04  /* Digital filter power down enable */
-#define ADC_REG7_FIR2_IN_EN 0x02  /* External FIR2 input enable */
-#define ADC_REG7_PSYCHO_EN  0x01  /* External pyscho filter input enable */
+   /* Wait at least 4100 LRCLK's */
+
+#define ADC_REG1_FRAME_START0x80   /* Frame start */
+#define ADC_REG1_GROUND_CAL 0x40   /* Ground calibration enable */
+#define ADC_REG1_ANA_MOD_PDOWN  0x20   /* Analog modulator section in power 
down */
+#define ADC_REG1_DIG_MOD_PDOWN  0x10   /* Digital modulator section in power 
down */
+
+#define ADC_REG2_128x   0x80   /* Oversample at 128x */
+#define ADC_REG2_CAL0x40   /* System calibration enable */
+#define ADC_REG2_CHANGE_SIGN0x20   /* Change sign enable */
+#define ADC_REG2_LR_DISABLE 0x10   /* Left/Right output disable */
+#define ADC_REG2_HIGH_PASS_DIS  0x08   /* High pass filter disable */
+#define ADC_REG2_SLAVE_MODE 0x04   /* Slave mode */
+#define ADC_REG2_DFS0x02   /* Digital format select */
+#define ADC_REG2_MUTE   0x01   /* Mute */
+
+#define ADC_REG7_ADDR_ENABLE0x80   /* Address enable */
+#define ADC_REG7_PEAK_ENABLE0x40   /* Peak enable */
+#define ADC_REG7_PEAK_UPDATE0x20   /* Peak update */
+#define ADC_REG7_PEAK_FORMAT0x10   /* Peak display format 

[U-Boot] [PATCH 09/22] board/cogent/flash.c: Fix GCC 4.6 buiild warning

2011-11-05 Thread Wolfgang Denk
Fix:
flash.c: In function 'flash_init':
flash.c:295:16: warning: variable 'fip' set but not used
[-Wunused-but-set-variable]

Signed-off-by: Wolfgang Denk 
Cc: Murray Jensen 
---
 board/cogent/flash.c |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/board/cogent/flash.c b/board/cogent/flash.c
index e6c85b6..ec3f94d 100644
--- a/board/cogent/flash.c
+++ b/board/cogent/flash.c
@@ -23,6 +23,7 @@
 
 #include 
 #include 
+#include 
 
 flash_info_t   flash_info[CONFIG_SYS_MAX_FLASH_BANKS]; /* info for FLASH chips 
*/
 
@@ -292,7 +293,7 @@ flash_init(void)
 {
unsigned long total;
int i;
-   flash_info_t *fip;
+   __maybe_unused flash_info_t *fip;
 
/* Init: no FLASHes known */
for (i=0; ihttp://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 11/22] board/gw8260/flash.c: Fix GCC 4.6 build warning

2011-11-05 Thread Wolfgang Denk
Fix:
flash.c: In function 'flash_init':
flash.c:81:16: warning: variable 'size' set but not used
[-Wunused-but-set-variable]

Signed-off-by: Wolfgang Denk 
Cc: Oliver Brown 
---
 board/gw8260/flash.c |3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/board/gw8260/flash.c b/board/gw8260/flash.c
index c1c26ea..fb29659 100644
--- a/board/gw8260/flash.c
+++ b/board/gw8260/flash.c
@@ -78,7 +78,6 @@ static int write_word (flash_info_t *info, ulong dest, ulong 
data);
  */
 unsigned long flash_init(void)
 {
-   unsigned long size;
int i;
 
/* Init: no FLASHes known */
@@ -86,7 +85,7 @@ unsigned long flash_init(void)
flash_info[i].flash_id = FLASH_UNKNOWN;
 
/* for now, only support the 4 MB Flash SIMM */
-   size = flash_get_size((vu_long *) CONFIG_SYS_FLASH0_BASE,
+   (void)flash_get_size((vu_long *) CONFIG_SYS_FLASH0_BASE,
  &flash_info[0]);
/*
 * protect monitor and environment sectors
-- 
1.7.6.4

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


[U-Boot] [PATCH 18/22] board/sacsng/sacsng.c: Fix GCC 4.6 build warning

2011-11-05 Thread Wolfgang Denk
Fix:
sacsng.c: In function 'initdram':
sacsng.c:180:9: warning: variable 'spd_size' set but not used
[-Wunused-but-set-variable]

Signed-off-by: Wolfgang Denk 
Cc: Jerry Van Baren 
---
 board/sacsng/sacsng.c |2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/board/sacsng/sacsng.c b/board/sacsng/sacsng.c
index 09f59a0..536d7de 100644
--- a/board/sacsng/sacsng.c
+++ b/board/sacsng/sacsng.c
@@ -177,7 +177,6 @@ phys_size_t initdram(int board_type)
uint sdam;
uint bsma;
uint sda10;
-   u_char spd_size;
u_char data;
u_char cksum;
int j;
@@ -192,7 +191,6 @@ phys_size_t initdram(int board_type)
 * Read the SDRAM SPD EEPROM via I2C.
 */
i2c_read(SDRAM_SPD_ADDR, 0, 1, &data, 1);
-   spd_size = data;
cksum = data;
for (j = 1; j < 64; j++) {  /* read only the checksummed bytes */
/* note: the I2C address autoincrements when alen == 0 */
-- 
1.7.6.4

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


[U-Boot] [PATCH 16/22] board/rpxsuper/flash.c: Fix GCC 4.6 build warning

2011-11-05 Thread Wolfgang Denk
Fix:
flash.c: In function 'flash_init':
flash.c:52:19: warning: variable 'size' set but not used
[-Wunused-but-set-variable]

Signed-off-by: Wolfgang Denk 
---
 board/rpxsuper/flash.c |5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/board/rpxsuper/flash.c b/board/rpxsuper/flash.c
index 724ae88..70ae1d2 100644
--- a/board/rpxsuper/flash.c
+++ b/board/rpxsuper/flash.c
@@ -49,7 +49,6 @@ static int write_word (flash_info_t *info, ulong dest, ulong 
data);
 
 unsigned long flash_init(void)
 {
-   unsigned long size;
int i;
 
/* Init: no FLASHes known */
@@ -57,7 +56,7 @@ unsigned long flash_init(void)
flash_info[i].flash_id = FLASH_UNKNOWN;
 
/* for now, only support the 4 MB Flash SIMM */
-   size = flash_get_size((vu_long *) CONFIG_SYS_FLASH0_BASE,
+   (void)flash_get_size((vu_long *) CONFIG_SYS_FLASH0_BASE,
  &flash_info[0]);
 
/*
@@ -80,7 +79,7 @@ unsigned long flash_init(void)
  CONFIG_ENV_ADDR + CONFIG_ENV_SIZE - 1, &flash_info[0]);
 #endif
 
-   return /*size */ (CONFIG_SYS_FLASH0_SIZE * 1024 * 1024);
+   return CONFIG_SYS_FLASH0_SIZE * 1024 * 1024;
 }
 
 /*---
-- 
1.7.6.4

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


[U-Boot] [PATCH 13/22] board/hymod/input.c: Fix GCC 4.6 build warning

2011-11-05 Thread Wolfgang Denk
Fix:
input.c: In function 'hymod_get_ethaddr':
input.c:79:10: warning: variable 'ea' set but not used
[-Wunused-but-set-variable]

Signed-off-by: Wolfgang Denk 
Cc: Murray Jensen 
---
 board/hymod/input.c |3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/board/hymod/input.c b/board/hymod/input.c
index 998132d..1a2b8d2 100644
--- a/board/hymod/input.c
+++ b/board/hymod/input.c
@@ -76,7 +76,6 @@ hymod_get_ethaddr (void)
if (n == 17) {
int i;
char *p, *q;
-   uchar ea[6];
 
/* see if it looks like an ethernet address */
 
@@ -85,7 +84,7 @@ hymod_get_ethaddr (void)
for (i = 0; i < 6; i++) {
char term = (i == 5 ? '\0' : ':');
 
-   ea[i] = simple_strtol (p, &q, 16);
+   (void)simple_strtol (p, &q, 16);
 
if ((q - p) != 2 || *q++ != term)
break;
-- 
1.7.6.4

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


[U-Boot] [PATCH 15/22] board/rpxsuper/flash.c: minimal CodingStyle cleanup

2011-11-05 Thread Wolfgang Denk
Really minimal and local, just good enough to make checkpatch not
complain about the changes in the following commit.

Signed-off-by: Wolfgang Denk 
---
 board/rpxsuper/flash.c |   47 +++
 1 files changed, 23 insertions(+), 24 deletions(-)

diff --git a/board/rpxsuper/flash.c b/board/rpxsuper/flash.c
index be29b65..724ae88 100644
--- a/board/rpxsuper/flash.c
+++ b/board/rpxsuper/flash.c
@@ -47,41 +47,40 @@ static int write_word (flash_info_t *info, ulong dest, 
ulong data);
 /*---
  */
 
-unsigned long flash_init (void)
+unsigned long flash_init(void)
 {
-unsigned long size;
-int i;
+   unsigned long size;
+   int i;
 
-/* Init: no FLASHes known */
-for (i=0; i= CONFIG_SYS_FLASH0_BASE
-flash_protect(FLAG_PROTECT_SET,
- CONFIG_SYS_MONITOR_BASE,
- CONFIG_SYS_MONITOR_BASE+monitor_flash_len-1,
- &flash_info[0]);
+   flash_protect(FLAG_PROTECT_SET,
+ CONFIG_SYS_MONITOR_BASE,
+ CONFIG_SYS_MONITOR_BASE + monitor_flash_len - 1,
+ &flash_info[0]);
 #endif
 
 #if defined(CONFIG_ENV_IS_IN_FLASH) && defined(CONFIG_ENV_ADDR)
-# ifndef  CONFIG_ENV_SIZE
-#  define CONFIG_ENV_SIZE  CONFIG_ENV_SECT_SIZE
-# endif
-flash_protect(FLAG_PROTECT_SET,
- CONFIG_ENV_ADDR,
- CONFIG_ENV_ADDR + CONFIG_ENV_SIZE - 1,
- &flash_info[0]);
+#ifndef CONFIG_ENV_SIZE
+#define CONFIG_ENV_SIZECONFIG_ENV_SECT_SIZE
+#endif
+   flash_protect(FLAG_PROTECT_SET,
+ CONFIG_ENV_ADDR,
+ CONFIG_ENV_ADDR + CONFIG_ENV_SIZE - 1, &flash_info[0]);
 #endif
 
-return /*size*/ (CONFIG_SYS_FLASH0_SIZE * 1024 * 1024);
+   return /*size */ (CONFIG_SYS_FLASH0_SIZE * 1024 * 1024);
 }
 
 /*---
-- 
1.7.6.4

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


[U-Boot] [PATCH 19/22] board/freescale/mpc8266ads/mpc8266ads.c: CodingStyle cleanup

2011-11-05 Thread Wolfgang Denk
Make (mostly) checkpatch clean.

Signed-off-by: Wolfgang Denk 
Cc: Rune Torgersen 
---
 board/freescale/mpc8266ads/mpc8266ads.c |  594 ---
 1 files changed, 304 insertions(+), 290 deletions(-)

diff --git a/board/freescale/mpc8266ads/mpc8266ads.c 
b/board/freescale/mpc8266ads/mpc8266ads.c
index 2caf4aa..c7fcfe5 100644
--- a/board/freescale/mpc8266ads/mpc8266ads.c
+++ b/board/freescale/mpc8266ads/mpc8266ads.c
@@ -1,5 +1,5 @@
 /*
- * (C) Copyright 2001
+ * (C) Copyright 2001-2011
  * Wolfgang Denk, DENX Software Engineering, w...@denx.de.
  *
  * Modified during 2001 by
@@ -61,8 +61,8 @@
 
 const iop_conf_t iop_conf_tab[4][32] = {
 
-/* Port A configuration */
-{  /*conf ppar psor pdir podr pdat */
+   /* Port A configuration */
+   {   /*  conf ppar psor pdir podr pdat */
/* PA31 */ {   0,   1,   0,   1,   0,   0   }, /* FCC1 TxENB */
/* PA30 */ {   0,   1,   0,   0,   0,   0   }, /* FCC1 TxClav   */
/* PA29 */ {   0,   1,   0,   1,   0,   0   }, /* FCC1 TxSOC  */
@@ -95,10 +95,10 @@ const iop_conf_t iop_conf_tab[4][32] = {
/* PA2  */ {   0,   0,   0,   1,   0,   0   }, /* PA2 */
/* PA1  */ {   1,   0,   0,   0,   0,   0   }, /* FREERUN */
/* PA0  */ {   0,   0,   0,   1,   0,   0   }  /* PA0 */
-},
+   },
 
-/* Port B configuration */
-{   /*   conf ppar psor pdir podr pdat */
+   /* Port B configuration */
+   {   /*  conf ppar psor pdir podr pdat */
/* PB31 */ {   1,   1,   0,   1,   0,   0   }, /* FCC2 MII TX_ER */
/* PB30 */ {   1,   1,   0,   0,   0,   0   }, /* FCC2 MII RX_DV */
/* PB29 */ {   1,   1,   1,   1,   0,   0   }, /* FCC2 MII TX_EN */
@@ -131,10 +131,10 @@ const iop_conf_t iop_conf_tab[4][32] = {
/* PB2  */ {   0,   0,   0,   0,   0,   0   }, /* pin doesn't exist */
/* PB1  */ {   0,   0,   0,   0,   0,   0   }, /* pin doesn't exist */
/* PB0  */ {   0,   0,   0,   0,   0,   0   }  /* pin doesn't exist */
-},
+   },
 
-/* Port C */
-{   /*   conf ppar psor pdir podr pdat */
+   /* Port C */
+   {   /*  conf ppar psor pdir podr pdat */
/* PC31 */ {   0,   0,   0,   1,   0,   0   }, /* PC31 */
/* PC30 */ {   0,   0,   0,   1,   0,   0   }, /* PC30 */
/* PC29 */ {   0,   1,   1,   0,   0,   0   }, /* SCC1 EN *CLSN */
@@ -167,10 +167,10 @@ const iop_conf_t iop_conf_tab[4][32] = {
/* PC2  */ {   0,   0,   0,   1,   0,   1   }, /* ENET FDE */
/* PC1  */ {   0,   0,   0,   1,   0,   0   }, /* ENET DSQE */
/* PC0  */ {   0,   0,   0,   1,   0,   0   }, /* ENET LBK */
-},
+   },
 
-/* Port D */
-{   /*   conf ppar psor pdir podr pdat */
+   /* Port D */
+   {   /*  conf ppar psor pdir podr pdat */
/* PD31 */ {   1,   1,   0,   0,   0,   0   }, /* SCC1 EN RxD */
/* PD30 */ {   1,   1,   1,   1,   0,   0   }, /* SCC1 EN TxD */
/* PD29 */ {   0,   1,   0,   1,   0,   0   }, /* SCC1 EN TENA */
@@ -203,7 +203,7 @@ const iop_conf_t iop_conf_tab[4][32] = {
/* PD2  */ {   0,   0,   0,   0,   0,   0   }, /* pin doesn't exist */
/* PD1  */ {   0,   0,   0,   0,   0,   0   }, /* pin doesn't exist */
/* PD0  */ {   0,   0,   0,   0,   0,   0   }  /* pin doesn't exist */
-}
+   }
 };
 
 typedef struct bscr_ {
@@ -224,317 +224,331 @@ typedef struct pci_ic_s {
 
 void reset_phy(void)
 {
-volatile bcsr_t  *bcsr   = (bcsr_t *)CONFIG_SYS_BCSR;
+   volatile bcsr_t *bcsr = (bcsr_t *)CONFIG_SYS_BCSR;
 
-/* reset the FEC port */
-bcsr->bcsr1&= ~FETH_RST;
-bcsr->bcsr1|= FETH_RST;
+   /* reset the FEC port */
+   bcsr->bcsr1 &= ~FETH_RST;
+   bcsr->bcsr1 |= FETH_RST;
 }
 
 
-int board_early_init_f (void)
+int board_early_init_f(void)
 {
-volatile bcsr_t  *bcsr = (bcsr_t *)CONFIG_SYS_BCSR;
-volatile pci_ic_t *pci_ic  = (pci_ic_t *) CONFIG_SYS_PCI_INT;
+   volatile bcsr_t *bcsr = (bcsr_t *)CONFIG_SYS_BCSR;
+   volatile pci_ic_t *pci_ic = (pci_ic_t *)CONFIG_SYS_PCI_INT;
 
-bcsr->bcsr1= ~FETHIEN & ~RS232EN_1 & ~RS232EN_2;
+   bcsr->bcsr1 = ~FETHIEN & ~RS232EN_1 & ~RS232EN_2;
 
-/* mask all PCI interrupts */
-pci_ic->pci_int_mask |= 0xfff0;
+   /* mask all PCI interrupts */
+   pci_ic->pci_int_mask |= 0xfff0;
 
-return 0;
+   return 0;
 }
 
 int checkboard(void)
 {
-puts ("Board: Motorola MPC8266ADS\n");
-return 0;
+   puts("Board: Motorola MPC8266ADS\n");
+   return 0;
 }
 
 phys_size_t initdram(int board_type)
 {
/* Autoinit part stolen from board/sacsng/sacsng.c */
-volatile immap_t *immap = (immap_t *)CONFIG_SYS_IMMR;
-volatile memctl8260_t *memctl   = &immap->im_memctl;
-volatile uchar c = 0xff;
-volatile uchar *ramaddr = (uchar *)(CONFIG_SYS_SDRAM_

[U-Boot] [PATCH 10/22] board/gw8260/flash.c: minimal CodingStyle cleanup

2011-11-05 Thread Wolfgang Denk
Really minimal and local, just good enough to make checkpatch not
complain about the changes in the following commit.

Signed-off-by: Wolfgang Denk 
Cc: Oliver Brown 
---
 board/gw8260/flash.c |   75 --
 1 files changed, 36 insertions(+), 39 deletions(-)

diff --git a/board/gw8260/flash.c b/board/gw8260/flash.c
index 6035f69..c1c26ea 100644
--- a/board/gw8260/flash.c
+++ b/board/gw8260/flash.c
@@ -63,54 +63,51 @@ static int write_word (flash_info_t *info, ulong dest, 
ulong data);
 /*   functions  */
 /*/
 
-/*/
-/* NAME: flash_init() - initializes flash banks */
-/*  */
-/* DESCRIPTION: */
-/*   This function initializes the flash bank(s).   */
-/*  */
-/* RETURNS: */
-/*   The size in bytes of the flash */
-/*  */
-/* RESTRICTIONS/LIMITATIONS:*/
-/*  */
-/*  */
-/*/
-unsigned long flash_init (void)
+/*
+ * NAME: flash_init() - initializes flash banks
+ *
+ * DESCRIPTION:
+ *   This function initializes the flash bank(s).
+ *
+ * RETURNS:
+ *   The size in bytes of the flash
+ *
+ * RESTRICTIONS/LIMITATIONS:
+ *
+ *
+ */
+unsigned long flash_init(void)
 {
-unsigned long size;
-int i;
-
-/* Init: no FLASHes known */
-for (i=0; i= CONFIG_SYS_FLASH0_BASE
-flash_protect(FLAG_PROTECT_SET,
- CONFIG_SYS_MONITOR_BASE,
- CONFIG_SYS_MONITOR_BASE+monitor_flash_len-1,
- &flash_info[0]);
+   flash_protect(FLAG_PROTECT_SET,
+ CONFIG_SYS_MONITOR_BASE,
+ CONFIG_SYS_MONITOR_BASE + monitor_flash_len - 1,
+ &flash_info[0]);
 #endif
 
 #if defined(CONFIG_ENV_IS_IN_FLASH) && defined(CONFIG_ENV_ADDR)
-# ifndef  CONFIG_ENV_SIZE
-#  define CONFIG_ENV_SIZE  CONFIG_ENV_SECT_SIZE
-# endif
-flash_protect(FLAG_PROTECT_SET,
- CONFIG_ENV_ADDR,
- CONFIG_ENV_ADDR + CONFIG_ENV_SIZE - 1,
- &flash_info[0]);
+#ifndef CONFIG_ENV_SIZE
+#define CONFIG_ENV_SIZECONFIG_ENV_SECT_SIZE
+#endif
+   flash_protect(FLAG_PROTECT_SET,
+ CONFIG_ENV_ADDR,
+ CONFIG_ENV_ADDR + CONFIG_ENV_SIZE - 1, &flash_info[0]);
 #endif
 
-return (CONFIG_SYS_FLASH0_SIZE * 1024 * 1024);  /*size*/
+   return CONFIG_SYS_FLASH0_SIZE * 1024 * 1024;/*size */
 }
 
 /*/
-- 
1.7.6.4

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


[U-Boot] [PATCH 02/22] board/etin/kvme080/multiverse.c: Fix GCC 4.6 build warning.

2011-11-05 Thread Wolfgang Denk
Signed-off-by: Wolfgang Denk 
Cc: Sangmoon Kim 
---
 board/etin/kvme080/multiverse.c |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/board/etin/kvme080/multiverse.c b/board/etin/kvme080/multiverse.c
index eb89581..93ad57a 100644
--- a/board/etin/kvme080/multiverse.c
+++ b/board/etin/kvme080/multiverse.c
@@ -17,6 +17,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "multiverse.h"
 
@@ -103,7 +104,7 @@ int multiv_reset(unsigned long base)
 
 void multiv_auto_slot_id(unsigned long base)
 {
-   unsigned int vector;
+   __maybe_unused unsigned int vector;
int slot_id = 1;
if (readb(base + VME_CTRL) & VME_CTRL_SYSFAIL) {
*(volatile unsigned int*)(base + VME_IRQ2_REG) = 0xfe;
-- 
1.7.6.4

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


[U-Boot] [PATCH 22/22] board/siemens/SCM/scm.c: Fix GCC 4.6 build warning

2011-11-05 Thread Wolfgang Denk
Fix:
scm.c: In function 'config_scoh_cs':
scm.c:400:16: warning: variable 'tmp' set but not used
[-Wunused-but-set-variable]

Signed-off-by: Wolfgang Denk 
---
 board/siemens/SCM/scm.c |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/board/siemens/SCM/scm.c b/board/siemens/SCM/scm.c
index 926e491..461b56e 100644
--- a/board/siemens/SCM/scm.c
+++ b/board/siemens/SCM/scm.c
@@ -24,6 +24,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "scm.h"
 
@@ -397,7 +398,7 @@ static void config_scoh_cs (void)
volatile immap_t *immr = (immap_t *) CONFIG_SYS_IMMR;
volatile memctl8260_t *memctl = &immr->im_memctl;
volatile can_reg_t *can = (volatile can_reg_t *) CONFIG_SYS_CAN0_BASE;
-   volatile uint tmp, i;
+   __maybe_unused volatile uint tmp, i;
 
/* Initialize OR3 / BR3 for CAN Bus Controller 0 */
memctl->memc_or3 = CONFIG_SYS_CAN0_OR3;
-- 
1.7.6.4

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


[U-Boot] [PATCH 21/22] board/funkwerk/vovpn-gw/vovpn-gw.c: Fix GCC 4.6 build warning

2011-11-05 Thread Wolfgang Denk
Fix:
vovpn-gw.c: In function 'misc_init_r':
vovpn-gw.c:266:16: warning: variable 'temp' set but not used
[-Wunused-but-set-variable]

Signed-off-by: Wolfgang Denk 
---
 board/funkwerk/vovpn-gw/vovpn-gw.c |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/board/funkwerk/vovpn-gw/vovpn-gw.c 
b/board/funkwerk/vovpn-gw/vovpn-gw.c
index a4bfbc9..57bd21f 100644
--- a/board/funkwerk/vovpn-gw/vovpn-gw.c
+++ b/board/funkwerk/vovpn-gw/vovpn-gw.c
@@ -25,6 +25,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "m88e6060.h"
 
@@ -263,7 +264,7 @@ int board_early_init_f (void)
 int misc_init_r (void)
 {
volatile ioport_t *iop;
-   unsigned char temp;
+   __maybe_unused unsigned char temp;
 #if 0
/* DUMP UPMA RAM */
volatile immap_t *immap;
-- 
1.7.6.4

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


[U-Boot] [PATCH 20/22] board/freescale/mpc8266ads/mpc8266ads.c: Fix GCC 4.6 build warning

2011-11-05 Thread Wolfgang Denk
Fix:
mpc8266ads.c: In function 'initdram':
mpc8266ads.c:278:9: warning: variable 'spd_size' set but not used
[-Wunused-but-set-variable]

Signed-off-by: Wolfgang Denk 
---
 board/freescale/mpc8266ads/mpc8266ads.c |2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/board/freescale/mpc8266ads/mpc8266ads.c 
b/board/freescale/mpc8266ads/mpc8266ads.c
index c7fcfe5..5d48968 100644
--- a/board/freescale/mpc8266ads/mpc8266ads.c
+++ b/board/freescale/mpc8266ads/mpc8266ads.c
@@ -275,7 +275,6 @@ phys_size_t initdram(int board_type)
uint sdam;
uint bsma;
uint sda10;
-   u_char spd_size;
u_char data;
u_char cksum;
int j;
@@ -292,7 +291,6 @@ phys_size_t initdram(int board_type)
i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
 
i2c_read(SDRAM_SPD_ADDR, 0, 1, &data, 1);
-   spd_size = data;
cksum = data;
for (j = 1; j < 64; j++) {  /* read only the checksummed bytes */
/* note: the I2C address autoincrements when alen == 0 */
-- 
1.7.6.4

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


[U-Boot] [PATCH 14/22] board/ids8247/ids8247.c: Fix GCC 4.6 build warning

2011-11-05 Thread Wolfgang Denk
Fix:
ids8247.c: In function 'initdram':
ids8247.c:284:14: warning: variable 'lsize' set but not used
[-Wunused-but-set-variable]

Signed-off-by: Wolfgang Denk 
Cc: Heiko Schocher 
---
 board/ids8247/ids8247.c |3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/board/ids8247/ids8247.c b/board/ids8247/ids8247.c
index d621833..02db07f 100644
--- a/board/ids8247/ids8247.c
+++ b/board/ids8247/ids8247.c
@@ -281,10 +281,9 @@ phys_size_t initdram (int board_type)
volatile immap_t *immap = (immap_t *) CONFIG_SYS_IMMR;
volatile memctl8260_t *memctl = &immap->im_memctl;
 
-   long psize, lsize;
+   long psize;
 
psize = 16 * 1024 * 1024;
-   lsize = 0;
 
memctl->memc_psrt = CONFIG_SYS_PSRT;
memctl->memc_mptpr = CONFIG_SYS_MPTPR;
-- 
1.7.6.4

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


[U-Boot] [PATCH 06/22] drivers/net/rtl8139.c: Fix GCC 4.6 build warnings

2011-11-05 Thread Wolfgang Denk
Fix:
rtl8139.c: In function 'rtl8139_probe':
rtl8139.c:256:15: warning: variable 'fullduplex' set but not used
[-Wunused-but-set-variable]
rtl8139.c:256:6: warning: variable 'speed10' set but not used
[-Wunused-but-set-variable]
rtl8139.c: In function 'rtl_transmit':
rtl8139.c:419:16: warning: variable 'txstatus' set but not used
[-Wunused-but-set-variable]

Change code to use new debug macros; also fix the new errors and
warnigns popping up now, like "error: 'to' undeclared" and some
"warning: format '%X' expects argument of type 'unsigned int', but
argument X has type 'long unsigned int'"

Signed-off-by: Wolfgang Denk 
---
 drivers/net/rtl8139.c |   49 +++--
 1 files changed, 19 insertions(+), 30 deletions(-)

diff --git a/drivers/net/rtl8139.c b/drivers/net/rtl8139.c
index c2779db..e3feef8 100644
--- a/drivers/net/rtl8139.c
+++ b/drivers/net/rtl8139.c
@@ -95,10 +95,9 @@
 #define RX_BUF_LEN_IDX 0   /* 0, 1, 2 is allowed - 8,16,32K rx buffer */
 #define RX_BUF_LEN (8192 << RX_BUF_LEN_IDX)
 
-#undef DEBUG_TX
-#undef DEBUG_RX
+#define DEBUG_TX   0   /* set to 1 to enable debug code */
+#define DEBUG_RX   0   /* set to 1 to enable debug code */
 
-#define currticks()get_timer(0)
 #define bus_to_phys(a) pci_mem_to_phys((pci_dev_t)dev->priv, a)
 #define phys_to_bus(a) pci_phys_to_mem((pci_dev_t)dev->priv, a)
 
@@ -253,7 +252,6 @@ int rtl8139_initialize(bd_t *bis)
 static int rtl8139_probe(struct eth_device *dev, bd_t *bis)
 {
int i;
-   int speed10, fullduplex;
int addr_len;
unsigned short *ap = (unsigned short *)dev->enetaddr;
 
@@ -266,9 +264,6 @@ static int rtl8139_probe(struct eth_device *dev, bd_t *bis)
for (i = 0; i < 3; i++)
*ap++ = le16_to_cpu (read_eeprom(i + 7, addr_len));
 
-   speed10 = inb(ioaddr + MediaStatus) & MSRSpeed10;
-   fullduplex = inw(ioaddr + MII_BMCR) & BMCRDuplex;
-
rtl_reset(dev);
 
if (inb(ioaddr + MediaStatus) & MSRLinkFail) {
@@ -389,9 +384,8 @@ static void rtl_reset(struct eth_device *dev)
 * from the configuration EEPROM default, because the card manufacturer
 * should have set that to match the card.  */
 
-#ifdef DEBUG_RX
-   printf("rx ring address is %X\n",(unsigned long)rx_ring);
-#endif
+   debug_cond(DEBUG_RX,
+   "rx ring address is %lX\n",(unsigned long)rx_ring);
flush_cache((unsigned long)rx_ring, RX_BUF_LEN);
outl(phys_to_bus((int)rx_ring), ioaddr + RxBuf);
 
@@ -424,9 +418,7 @@ static int rtl_transmit(struct eth_device *dev, volatile 
void *packet, int lengt
 
memcpy((char *)tx_buffer, (char *)packet, (int)length);
 
-#ifdef DEBUG_TX
-   printf("sending %d bytes\n", len);
-#endif
+   debug_cond(DEBUG_TX, "sending %d bytes\n", len);
 
/* Note: RTL8139 doesn't auto-pad, send minimum payload (another 4
 * bytes are sent automatically for the FCS, totalling to 64 bytes). */
@@ -453,16 +445,18 @@ static int rtl_transmit(struct eth_device *dev, volatile 
void *packet, int lengt
 
if (status & TxOK) {
cur_tx = (cur_tx + 1) % NUM_TX_DESC;
-#ifdef DEBUG_TX
-   printf("tx done (%d ticks), status %hX txstatus %X\n",
-   to-currticks(), status, txstatus);
-#endif
+
+   debug_cond(DEBUG_TX,
+   "tx done, status %hX txstatus %lX\n",
+   status, txstatus);
+
return length;
} else {
-#ifdef DEBUG_TX
-   printf("tx timeout/error (%d usecs), status %hX txstatus %X\n",
-  10*i, status, txstatus);
-#endif
+
+   debug_cond(DEBUG_TX,
+   "tx timeout/error (%d usecs), status %hX txstatus 
%lX\n",
+   10*i, status, txstatus);
+
rtl_reset(dev);
 
return 0;
@@ -486,9 +480,7 @@ static int rtl_poll(struct eth_device *dev)
/* See below for the rest of the interrupt acknowledges.  */
outw(status & ~(RxFIFOOver | RxOverflow | RxOK), ioaddr + IntrStatus);
 
-#ifdef DEBUG_RX
-   printf("rtl_poll: int %hX ", status);
-#endif
+   debug_cond(DEBUG_RX, "rtl_poll: int %hX ", status);
 
ring_offs = cur_rx % RX_BUF_LEN;
/* ring_offs is guaranteed being 4-byte aligned */
@@ -513,14 +505,11 @@ static int rtl_poll(struct eth_device *dev)
memcpy(&(rxdata[semi_count]), rx_ring, rx_size-4-semi_count);
 
NetReceive(rxdata, length);
-#ifdef DEBUG_RX
-   printf("rx packet %d+%d bytes", 
semi_count,rx_size-4-semi_count);
-#endif
+   debug_cond(DEBUG_RX, "rx packet %d+%d bytes",
+   semi_count, rx_size-4-semi_count);
} else {
NetReceive(rx_ring + ring_offs + 4, length);
-#ifdef DEBUG_RX
-   printf("rx packet %d bytes", rx_size-4);
-#endif
+   debug_cond(DEBUG_RX, "rx packet %d bytes", rx_

[U-Boot] [PATCH 12/22] board/ep82xxm/ep82xxm.c: Fix GCC 4.6 build warning

2011-11-05 Thread Wolfgang Denk
Fix:
ep82xxm.c: In function 'initdram':
ep82xxm.c:233:16: warning: variable 'ramtmp' set but not used
[-Wunused-but-set-variable]

Signed-off-by: Wolfgang Denk 
---
 board/ep82xxm/ep82xxm.c |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/board/ep82xxm/ep82xxm.c b/board/ep82xxm/ep82xxm.c
index c1d6e91..182cabc 100644
--- a/board/ep82xxm/ep82xxm.c
+++ b/board/ep82xxm/ep82xxm.c
@@ -31,6 +31,7 @@
 #include 
 #endif
 #include 
+#include 
 
 /*
  * I/O Port configuration table
@@ -230,8 +231,8 @@ phys_size_t initdram(int board_type)
uint psdmr = CONFIG_SYS_PSDMR;
int i;
 
-   unsigned char   ramtmp;
unsigned char   *ramptr1 = (unsigned char *)0x0110;
+   __maybe_unused unsigned charramtmp;
 
memctl->memc_mptpr = CONFIG_SYS_MPTPR;
 
-- 
1.7.6.4

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


[U-Boot] [PATCH 00/22] Fix GCC 4.6 build warnings (Part 2)

2011-11-05 Thread Wolfgang Denk
The following set of patches is the second batch of fixes of new
build warnings raised by recent compiler versions (GCC 4.6.x).

To be continued...

...all help with that would be highly welcome!

Wolfgang Denk (22):
  drivers/net/pcnet.c: Change debug code to fix build warning
  board/etin/kvme080/multiverse.c: Fix GCC 4.6 build warning.
  board/mousse/flash.c: Fix GCC 4.6 buil warnings
  drivers/net/rtl8169.c: Fix GCC 4.6 build warning
  board/linkstation/ide.c: Fix GCC 4.6 build warnings
  drivers/net/rtl8139.c: Fix GCC 4.6 build warnings
  common/cmd_flash.c: Fix GCC 4.6 build warnings
  arch/powerpc/cpu/mpc8260/spi.c: Fix GCC 4.6 build warnings
  board/cogent/flash.c: Fix GCC 4.6 buiild warning
  board/gw8260/flash.c: minimal CodingStyle cleanup
  board/gw8260/flash.c: Fix GCC 4.6 build warning
  board/ep82xxm/ep82xxm.c: Fix GCC 4.6 build warning
  board/hymod/input.c: Fix GCC 4.6 build warning
  board/ids8247/ids8247.c: Fix GCC 4.6 build warning
  board/rpxsuper/flash.c: minimal CodingStyle cleanup
  board/rpxsuper/flash.c: Fix GCC 4.6 build warning
  board/sacsng/sacsng.c: CodingStyle cleanup
  board/sacsng/sacsng.c: Fix GCC 4.6 build warning
  board/freescale/mpc8266ads/mpc8266ads.c: CodingStyle cleanup
  board/freescale/mpc8266ads/mpc8266ads.c: Fix GCC 4.6 build warning
  board/funkwerk/vovpn-gw/vovpn-gw.c: Fix GCC 4.6 build warning
  board/siemens/SCM/scm.c: Fix GCC 4.6 build warning

 arch/powerpc/cpu/mpc8260/spi.c  |4 -
 board/cogent/flash.c|3 +-
 board/ep82xxm/ep82xxm.c |3 +-
 board/etin/kvme080/multiverse.c |3 +-
 board/freescale/mpc8266ads/mpc8266ads.c |  592 +++---
 board/funkwerk/vovpn-gw/vovpn-gw.c  |3 +-
 board/gw8260/flash.c|   74 +-
 board/hymod/input.c |3 +-
 board/ids8247/ids8247.c |3 +-
 board/linkstation/ide.c |2 +
 board/mousse/flash.c|8 +-
 board/rpxsuper/flash.c  |   46 +-
 board/sacsng/sacsng.c   | 1327 +++
 board/siemens/SCM/scm.c |3 +-
 common/cmd_flash.c  |8 +-
 drivers/net/pcnet.c |   17 +-
 drivers/net/rtl8139.c   |   49 +-
 drivers/net/rtl8169.c   |3 -
 18 files changed, 1062 insertions(+), 1089 deletions(-)

-- 
1.7.6.4

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


[U-Boot] [PATCH 04/22] drivers/net/rtl8169.c: Fix GCC 4.6 build warning

2011-11-05 Thread Wolfgang Denk
Fix:
rtl8169.c: In function 'rtl_init':
rtl8169.c:742:13: warning: variable 'printed_version' set but not used
[-Wunused-but-set-variable]

Signed-off-by: Wolfgang Denk 
---
 drivers/net/rtl8169.c |3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/drivers/net/rtl8169.c b/drivers/net/rtl8169.c
index b81dcad..1ad13bd 100644
--- a/drivers/net/rtl8169.c
+++ b/drivers/net/rtl8169.c
@@ -739,7 +739,6 @@ INIT - Look for an adapter, this routine's visible to the 
outside
 static int rtl_init(struct eth_device *dev, bd_t *bis)
 {
static int board_idx = -1;
-   static int printed_version = 0;
int i, rc;
int option = -1, Cap10_100 = 0, Cap1000 = 0;
 
@@ -751,8 +750,6 @@ static int rtl_init(struct eth_device *dev, bd_t *bis)
 
board_idx++;
 
-   printed_version = 1;
-
/* point to private storage */
tpc = &tpx;
 
-- 
1.7.6.4

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


[U-Boot] [PATCH 08/22] arch/powerpc/cpu/mpc8260/spi.c: Fix GCC 4.6 build warnings

2011-11-05 Thread Wolfgang Denk
Fix:
spi.c: In function 'spi_init_r':
spi.c:279:22: warning: variable 'cp' set but not used
[-Wunused-but-set-variable]
spi.c: In function 'spi_xfer':
spi.c:361:22: warning: variable 'cp' set but not used
[-Wunused-but-set-variable]

Signed-off-by: Wolfgang Denk 
---
 arch/powerpc/cpu/mpc8260/spi.c |4 
 1 files changed, 0 insertions(+), 4 deletions(-)

diff --git a/arch/powerpc/cpu/mpc8260/spi.c b/arch/powerpc/cpu/mpc8260/spi.c
index f5d2ac3..dc98ea7 100644
--- a/arch/powerpc/cpu/mpc8260/spi.c
+++ b/arch/powerpc/cpu/mpc8260/spi.c
@@ -276,11 +276,9 @@ void spi_init_r (void)
 {
volatile spi_t *spi;
volatile immap_t *immr;
-   volatile cpm8260_t *cp;
volatile cbd_t *tbdf, *rbdf;
 
immr = (immap_t *)  CONFIG_SYS_IMMR;
-   cp   = (cpm8260_t *) &immr->im_cpm;
 
spi  = (spi_t *)&immr->im_dprambase[PROFF_SPI];
 
@@ -358,7 +356,6 @@ ssize_t spi_read (uchar *addr, int alen, uchar *buffer, int 
len)
 ssize_t spi_xfer (size_t count)
 {
volatile immap_t *immr;
-   volatile cpm8260_t *cp;
volatile spi_t *spi;
cbd_t *tbdf, *rbdf;
int tm;
@@ -366,7 +363,6 @@ ssize_t spi_xfer (size_t count)
DPRINT (("*** spi_xfer entered ***\n"));
 
immr = (immap_t *) CONFIG_SYS_IMMR;
-   cp   = (cpm8260_t *) &immr->im_cpm;
 
spi  = (spi_t *)&immr->im_dprambase[PROFF_SPI];
 
-- 
1.7.6.4

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


[U-Boot] [PATCH 05/22] board/linkstation/ide.c: Fix GCC 4.6 build warnings

2011-11-05 Thread Wolfgang Denk
Fix:
ide.c: In function 'ide_preinit':
ide.c:69:21: warning: array subscript is above array bounds
[-Warray-bounds]
ide.c:69:21: warning: array subscript is above array bounds
[-Warray-bounds]
ide.c:70:17: warning: array subscript is above array bounds
[-Warray-bounds]

Signed-off-by: Wolfgang Denk 
Cc: Guennadi Liakhovetski 
---
 board/linkstation/ide.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/board/linkstation/ide.c b/board/linkstation/ide.c
index 568fdf5..14e3fd0 100644
--- a/board/linkstation/ide.c
+++ b/board/linkstation/ide.c
@@ -64,12 +64,14 @@ int ide_preinit (void)
ide_bus_offset[0] = pci_hose_bus_to_phys(&hose,
 ide_bus_offset[0] & 
0xfffe,
 PCI_REGION_IO);
+#if CONFIG_SYS_IDE_MAXBUS > 1
pci_read_config_dword(devbusfn, PCI_BASE_ADDRESS_2,
  (u32 *) &ide_bus_offset[1]);
ide_bus_offset[1] &= 0xfffe;
ide_bus_offset[1] = pci_hose_bus_to_phys(&hose,
 ide_bus_offset[1] & 
0xfffe,
 PCI_REGION_IO);
+#endif
}
 
if (pci_find_device (PCI_VENDOR_ID_ITE, PCI_DEVICE_ID_ITE_8212, 0) != 
-1) {
-- 
1.7.6.4

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


[U-Boot] [PATCH 03/22] board/mousse/flash.c: Fix GCC 4.6 buil warnings

2011-11-05 Thread Wolfgang Denk
Fix:
flash.c: In function 'flash_erase':
flash.c:780:18: warning: variable 'l_sect' set but not used
[-Wunused-but-set-variable]
flash.c:779:11: warning: variable 'addr' set but not used
[-Wunused-but-set-variable]

Signed-off-by: Wolfgang Denk 
---
 board/mousse/flash.c |8 +---
 1 files changed, 1 insertions(+), 7 deletions(-)

diff --git a/board/mousse/flash.c b/board/mousse/flash.c
index d729f33..cc40535 100644
--- a/board/mousse/flash.c
+++ b/board/mousse/flash.c
@@ -776,8 +776,7 @@ void flash_print_info (flash_info_t * info)
  */
 int flash_erase (flash_info_t * info, int s_first, int s_last)
 {
-   vu_long *addr = (vu_long *) (info->start[0]);
-   int prot, sect, l_sect;
+   int prot, sect;
flash_dev_t *dev = NULL;
 
if ((s_first < 0) || (s_first > s_last)) {
@@ -803,17 +802,12 @@ int flash_erase (flash_info_t * info, int s_first, int 
s_last)
printf ("\n");
}
 
-   l_sect = -1;
-
/* Start erase on unprotected sectors */
dev = getFlashDevFromInfo (info);
if (dev) {
printf ("Erase FLASH[%s] -%d sectors:", dev->name, 
dev->sectors);
for (sect = s_first; sect <= s_last; sect++) {
if (info->protect[sect] == 0) { /* not protected */
-   addr = (vu_long *) (dev->base);
-   /*   printf("erase_sector: sector=%d, 
addr=0x%x\n",
-  sect, addr); */
printf (".");
if (ERROR == flashEraseSector (dev, sect)) {
printf ("ERROR: could not erase sector 
%d on FLASH[%s]\n", sect, dev->name);
-- 
1.7.6.4

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


[U-Boot] [PATCH 07/22] common/cmd_flash.c: Fix GCC 4.6 build warnings

2011-11-05 Thread Wolfgang Denk
Fix:
cmd_flash.c:355:32: warning: 'info' may be used uninitialized in this
function [-Wuninitialized]
cmd_flash.c:354:10: warning: 'sect_first' may be used uninitialized in
this function [-Wuninitialized]
cmd_flash.c:354:10: warning: 'sect_last' may be used uninitialized in
this function [-Wuninitialized]
cmd_flash.c: In function 'do_protect':
cmd_flash.c:540:9: warning: 'info' may be used uninitialized in this
function [-Wuninitialized]
cmd_flash.c:538:9: warning: 'sect_first' may be used uninitialized in
this function [-Wuninitialized]
cmd_flash.c:538:9: warning: 'sect_last' may be used uninitialized in
this function [-Wuninitialized]

Signed-off-by: Wolfgang Denk 
---
 common/cmd_flash.c |8 
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/common/cmd_flash.c b/common/cmd_flash.c
index 6765347..c6ea25a 100644
--- a/common/cmd_flash.c
+++ b/common/cmd_flash.c
@@ -324,9 +324,9 @@ int do_flinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char 
* const argv[])
 int do_flerase (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 #ifndef CONFIG_SYS_NO_FLASH
-   flash_info_t *info;
+   flash_info_t *info = NULL;
ulong bank, addr_first, addr_last;
-   int n, sect_first, sect_last;
+   int n, sect_first = 0, sect_last = 0;
 #if defined(CONFIG_CMD_MTDPARTS)
struct mtd_device *dev;
struct part_info *part;
@@ -457,9 +457,9 @@ int do_protect (cmd_tbl_t *cmdtp, int flag, int argc, char 
* const argv[])
 {
int rcode = 0;
 #ifndef CONFIG_SYS_NO_FLASH
-   flash_info_t *info;
+   flash_info_t *info = NULL;
ulong bank;
-   int i, n, sect_first, sect_last;
+   int i, n, sect_first = 0, sect_last = 0;
 #if defined(CONFIG_CMD_MTDPARTS)
struct mtd_device *dev;
struct part_info *part;
-- 
1.7.6.4

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


[U-Boot] [PATCH 01/22] drivers/net/pcnet.c: Change debug code to fix build warning

2011-11-05 Thread Wolfgang Denk
Fix:
pcnet.c: In function 'pcnet_probe':
pcnet.c:247:8: warning: variable 'chipname' set but not used
[-Wunused-but-set-variable]

Signed-off-by: Wolfgang Denk 
Cc: Wolfgang Grandegger 
---
 drivers/net/pcnet.c |   17 -
 1 files changed, 4 insertions(+), 13 deletions(-)

diff --git a/drivers/net/pcnet.c b/drivers/net/pcnet.c
index e994cb6..45066c8 100644
--- a/drivers/net/pcnet.c
+++ b/drivers/net/pcnet.c
@@ -30,21 +30,12 @@
 #include 
 #include 
 
-#if 0
 #definePCNET_DEBUG_LEVEL   0   /* 0=off, 1=init, 2=rx/tx */
-#endif
 
-#if PCNET_DEBUG_LEVEL > 0
-#definePCNET_DEBUG1(fmt,args...)   printf (fmt ,##args)
-#if PCNET_DEBUG_LEVEL > 1
-#definePCNET_DEBUG2(fmt,args...)   printf (fmt ,##args)
-#else
-#define PCNET_DEBUG2(fmt,args...)
-#endif
-#else
-#define PCNET_DEBUG1(fmt,args...)
-#define PCNET_DEBUG2(fmt,args...)
-#endif
+#define PCNET_DEBUG1(fmt,args...)  \
+   debug_cond(PCNET_DEBUG_LEVEL > 0, fmt ,##args)
+#define PCNET_DEBUG2(fmt,args...)  \
+   debug_cond(PCNET_DEBUG_LEVEL > 1, fmt ,##args)
 
 #if !defined(CONF_PCNET_79C973) && defined(CONF_PCNET_79C975)
 #error "Macro for PCnet chip version is not defined!"
-- 
1.7.6.4

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


Re: [U-Boot] [PATCH 2/2] mvgbe: fix network device indices

2011-11-05 Thread Wolfgang Denk
Dear Albert ARIBAUD,

In message <4eb54978.5020...@aribaud.net> you wrote:
>
> > What would be the result?  A bord that comes up with a new MAC address
> > each time you reset it?
> 
> No -- the goal of the randomization code was, is, and will be to allow 
> the board to use the network when no correct MAC address can be found 
> anywhere (env vars, EEPROM, e-fuses, whatever). When a correct address 

And if this is the case, then the board will come up with a new MAC
address each time you reset it, right?

> is available, that address will be used. Typically, this happens when 
> the board has not been provisioned yet, at a point where the MAC address 
> it uses is not relevant yet.

I've done provisioning stuff a couple of times before, and I'm just
doing is again.  Random MAC addresses are a broken concept, and
anybody who considers using it should reassess his concepts.

Where is the real MAC address coming from, and how does it get
assigned to this specific board?  And how do you make sure not to make
mistakes when all you see is some board with a random MAC address?

[The systems I know usually either have the MAC address pre-programmed
in some storage device on the board, or printed on a barcode label, so
you can use ca barcode reader in combination with "askenv" and very
little U-Boot scripting as part of your production test /
initialization procedures.]

> 1. This code would only be available to kirkwood-based boards anyway.

That doe snot make things any better.

> 2. Although the code incorrectly describes it as "private", the random 
> address is actually a locally administered address (bit 1 of first octet 
> is set), which eliminates the risk of clashing against any 'normal' 
> (universally administered) address; and its last three octets are 
> randomized in order to limit the risk of clashing against other locally 
> administered addresses if we're unlucky enough to have any on the 
> network segment.

I consider the whole approach broken and object against it.

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
Perfection is reached, not when there is no longer anything  to  add,
but when there is no longer anything to take away.
   - Antoine de Saint-Exupery
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH V4] sandbox: Add improved RAM simulation

2011-11-05 Thread Simon Glass
On Sat, Nov 5, 2011 at 3:40 AM, Matthias Weisser  wrote:
> Using mmap to allocate memory from the OS for RAM simulation we can use
> u-boot own malloc implementation.
>
> Signed-off-by: Matthias Weisser 

Thanks for the rebase

Tested-by: Simon Glass 

> ---
> Changes in V4:
>  Rebased to current HEAD
>
> Changes in V3:
>  Fixed a build warning
>
> Changes in V2:
>  Removed the address hint for mmap
>  Removed the special handling of dlmalloc in common
>  Set gd->bd->bi_dram[0].start to 0 again
>
>  arch/sandbox/cpu/os.c    |    7 +++
>  arch/sandbox/lib/board.c |   17 ++---
>  common/Makefile          |    3 ---
>  include/os.h             |    8 
>  4 files changed, 25 insertions(+), 10 deletions(-)
>
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] arm: jadecpu: Readd MACH_TYPE_JADECPU

2011-11-05 Thread Albert ARIBAUD
Le 05/11/2011 15:56, Wolfgang Denk a écrit :
> Dear Albert ARIBAUD,
>
> In message<4eb543af.7010...@aribaud.net>  you wrote:
>>
>>> Note that you will only get a warning if a _different_ value get's
>>> defined (``warning: "VAR" redefined'').  If both values are the same,
>>> no warning will be raised.
>>
>> Hmm, correct. In order to catch the mach-type creeping back in
>> mach-types.h, we'd need to define something like
>>
>>  #define MACH_TYPE_JADECPU   (2636)
>>
>> I'll post an ARM-global patch for this, but as it will obviously not be
>> a bugfix, it'll wait until next merge window.
>
> Please save the effort.  Waht would it be good for?  As long as the
> values are the same, it's OK anyway.  And if they should be different,
> we get a bunch of warnings.

Just wanted to make sure we know when the temporary MACH_TYPE addition 
in the config header becomes obsolete. But then, I can also run a grep 
on include/configs/*.h whenever mach-types.h is updated.

> 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 v2] config.mk: use memoization in cc-option macro to speed up compilation

2011-11-05 Thread Albert ARIBAUD
Hi Daniel,

Le 05/11/2011 14:43, Daniel Schwierzeck a écrit :
> Hi Albert,
>
> On 05.11.2011 10:16, Albert ARIBAUD wrote:
>> Hi all,
>>
>> Le 04/11/2011 18:56, Wolfgang Denk a écrit :
>>> Dear Daniel Schwierzeck,
>>>
>>> In
>>> message
>>>
>>> you wrote:

 Should we change it? is the semantic still the same?
>>>
>>> I'm not sure. At first reading it doesn't look really the same to me.
>>
>> They are not, at least for ELDK4.2.
>>
>> The only difference is in -mabi options, where the change would reduce
>> "-mabi=apcs-gnu -mabi=aapcs-linux" to "-mabi=aapcs-linux".
>>
>> apcs-gnu, IIUC, is 'old ABI', while 'aapcs-linux' is 'new ABI', aka
>> eabi. Most of the toolchains I see are eabi (ELDK and CS notably). There
>> may be 'old ABI' toolchains out there, but I don't think they are old
>> ABI either.
>>
>> Anyway, I've just tried ./MAKEALL edminiv2 with ELD42 and a couple of CS
>> toolchains, and nowhere in the log does -mabi=apcs-gnu show up -- the
>> gcc invocations only have -mabi=aapcs-linux.
>
> Looks like I read it wrong. So you always want "-mabi=apcs-gnu
> -mabi=aapcs-linux -mno-thumb-interwork" in $(PF_CPPFLAGS_ABI) with EABI?
> Sorry but I am not an ARM expert ;)

No, I don't want that. :)

The problem I see is having two conflicting -mabi options, 
-mabi=apcs-gnu and -mabi=aapcs-linux, in the same command line. There 
should be only one -- and it should be the same across the whole U-Boot 
building process.

The duplicate -mno-thumb-interwork does not worry me fronm a functional 
standpoint; it's just a waste of space, that's all.

>> I've also tested making ED Mini V2 with and without the patch but
>> without Daniel's proposed change to arch/arm/config.mk, and there is no
>> difference in build commands (except that for some reason the patch
>> inserts multiple spaces between some gcc invocation options.
>
> I guess this comes from making the macros more readable. Maybe I can
> optimize this.
>
>>
>> Daniel, what do you mean with "does not work correctly"?
>
> that the generated cache file looks not right
>
> CC_OPTIONS += -mabi=apcs-gnu
> CC_OPTIONS_NOP += -mabi=apcs-gnu
> CC_OPTIONS += -mno-thumb-interwork
> CC_OPTIONS += -mabi=aapcs-linux -mno-thumb-interwork

I'm not a makefile expert, so "looks not right" is a bit meaningless to 
me. If "not right" means "there are several conflicting -mabi options 
and there are repeated -mno-thumb-interwork options" then I agree with 
your "does not look right" statement.

> But if you want "-mabi=apcs-gnu -mabi=aapcs-linux -mno-thumb-interwork"
> then it should already work correctly without my change in
> arch/arm/config.mk.

As I said, no, I don't want that. I want the right -mabi option only, 
and I'd like a single -mno-thumb-interwork option.

But what I don't understand is the discrepancy which I see between the 
CC_OPTIONS resulting from include/generated/cc_options.mk and the actual 
command line options used to generate e.g. edminiv2.

> Best regards,
> Daniel

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


Re: [U-Boot] About the pull request and patchwork

2011-11-05 Thread Wolfgang Denk
Dear =?UTF-8?B?6aas5YWL5rOh?=,

In message  
you wrote:
> 
> > So yes, please, if you notice such inconsistencies, help out and
> > update the status as needed.
> 
> Maybe a perl or a python script is need to auto update the patchwork status
> by analyzing the table format of patckwork.
> Is this possible?

What exactly do you want to do?

For normal actions you can use pwclient.  

For a start, try

pwclient search 'pull request' | \
egrep -v 'Accepted|Superseded|Changes|Rejected|Applicable'


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
I am an atheist, thank God!
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] arm: jadecpu: Readd MACH_TYPE_JADECPU

2011-11-05 Thread Wolfgang Denk
Dear Albert ARIBAUD,

In message <4eb543af.7010...@aribaud.net> you wrote:
>
> > Note that you will only get a warning if a _different_ value get's
> > defined (``warning: "VAR" redefined'').  If both values are the same,
> > no warning will be raised.
> 
> Hmm, correct. In order to catch the mach-type creeping back in 
> mach-types.h, we'd need to define something like
> 
>   #define MACH_TYPE_JADECPU   (2636)
> 
> I'll post an ARM-global patch for this, but as it will obviously not be 
> a bugfix, it'll wait until next merge window.

Please save the effort.  Waht would it be good for?  As long as the
values are the same, it's OK anyway.  And if they should be different,
we get a bunch of warnings.

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
I am pleased to see that we have differences.  May we together become
greater than the sum of both of us.
-- Surak of Vulcan, "The Savage Curtain", stardate 5906.4
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v3 7/8] tegra2: spi: Support SPI / UART switch

2011-11-05 Thread Simon Glass
Add the SPI / UART switch logic into the Tegra2 SPI driver so that it
can co-exist with the NS16550 UART.

We need the ns16550.h header for NS16550_t for now.

Signed-off-by: Simon Glass 
---
Changes in v2:
- Add pinmux logic to SPI driver
- Rename uart/spi_enable() to pinmux_select_uart/spi()

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

diff --git a/drivers/spi/tegra2_spi.c b/drivers/spi/tegra2_spi.c
index 2db5a84..fe37218 100644
--- a/drivers/spi/tegra2_spi.c
+++ b/drivers/spi/tegra2_spi.c
@@ -28,9 +28,11 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
+#include 
 #include 
 
 struct tegra_spi_slave {
@@ -123,6 +125,16 @@ int spi_claim_bus(struct spi_slave *slave)
 */
pinmux_set_func(PINGRP_GMD, PMUX_FUNC_SFLASH);
pinmux_tristate_disable(PINGRP_LSPI);
+
+#ifndef CONFIG_SPI_UART_SWITCH
+   /*
+* NOTE:
+* Only set PinMux bits 3:2 to SPI here on boards that don't have the
+* SPI UART switch or subsequent UART data won't go out!  See
+* spi_uart_switch().
+*/
+   /* TODO: pinmux_set_func(PINGRP_GMC, PMUX_FUNC_SFLASH); */
+#endif
return 0;
 }
 
@@ -140,6 +152,8 @@ void spi_cs_activate(struct spi_slave *slave)
 {
struct tegra_spi_slave *spi = to_tegra_spi(slave);
 
+   pinmux_select_spi();
+
/* CS is negated on Tegra, so drive a 1 to get a 0 */
setbits_le32(&spi->regs->command, SPI_CMD_CS_VAL);
 }
-- 
1.7.3.1

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


[U-Boot] [PATCH v3 4/8] tegra2: config: Enable SPI flash on Seaboard

2011-11-05 Thread Simon Glass
The Seaboard includes a Winbond 4MB flash part.

Signed-off-by: Simon Glass 
---

 include/configs/seaboard.h |   11 +++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/include/configs/seaboard.h b/include/configs/seaboard.h
index 7d29144..7e8c8cc 100644
--- a/include/configs/seaboard.h
+++ b/include/configs/seaboard.h
@@ -37,11 +37,22 @@
 #define CONFIG_TEGRA2_ENABLE_UARTD
 #define CONFIG_SYS_NS16550_COM1NV_PA_APB_UARTD_BASE
 
+/* On Seaboard: GPIO_PI3 = Port I = 8, bit = 3 */
+#define CONFIG_UART_DISABLE_GPIO   GPIO_PI3
+
 #define CONFIG_MACH_TYPE   MACH_TYPE_SEABOARD
 #define CONFIG_SYS_BOARD_ODMDATA   0x300d8011 /* lp1, 1GB */
 
 #define CONFIG_BOARD_EARLY_INIT_F
 
+/* SPI */
+#define CONFIG_TEGRA2_SPI
+#define CONFIG_SPI_FLASH
+#define CONFIG_SPI_FLASH_WINBOND
+#define CONFIG_SF_DEFAULT_MODE SPI_MODE_0
+#define CONFIG_CMD_SPI
+#define CONFIG_CMD_SF
+
 /* SD/MMC */
 #define CONFIG_MMC
 #define CONFIG_GENERIC_MMC
-- 
1.7.3.1

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


[U-Boot] [PATCH v3 3/8] tegra2: spi: Add SPI driver for Tegra2 SOC

2011-11-05 Thread Simon Glass
From: Tom Warren 

This driver supports SPI on Tegra2, running at 48MHz.

Signed-off-by: Tom Warren 
---
Changes in v2:
- Update to support SPI mode and frequency
- Tidy driver according to comments, and tidy a little more

Changes in v3:
- Remove the replaced bus/cs check function
- Change (bitlen & 7) to (bitlen % 8)

 arch/arm/include/asm/arch-tegra2/tegra2.h |1 +
 arch/arm/include/asm/arch-tegra2/tegra2_spi.h |   76 +++
 board/nvidia/common/board.c   |4 +
 drivers/spi/Makefile  |1 +
 drivers/spi/tegra2_spi.c  |  260 +
 5 files changed, 342 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-tegra2/tegra2_spi.h
 create mode 100644 drivers/spi/tegra2_spi.c

diff --git a/arch/arm/include/asm/arch-tegra2/tegra2.h 
b/arch/arm/include/asm/arch-tegra2/tegra2.h
index 742a75a..8941443 100644
--- a/arch/arm/include/asm/arch-tegra2/tegra2.h
+++ b/arch/arm/include/asm/arch-tegra2/tegra2.h
@@ -38,6 +38,7 @@
 #define NV_PA_APB_UARTC_BASE   (NV_PA_APB_MISC_BASE + 0x6200)
 #define NV_PA_APB_UARTD_BASE   (NV_PA_APB_MISC_BASE + 0x6300)
 #define NV_PA_APB_UARTE_BASE   (NV_PA_APB_MISC_BASE + 0x6400)
+#define TEGRA2_SPI_BASE(NV_PA_APB_MISC_BASE + 0xC380)
 #define NV_PA_PMC_BASE 0x7000E400
 #define NV_PA_CSITE_BASE   0x7004
 
diff --git a/arch/arm/include/asm/arch-tegra2/tegra2_spi.h 
b/arch/arm/include/asm/arch-tegra2/tegra2_spi.h
new file mode 100644
index 000..ceec428
--- /dev/null
+++ b/arch/arm/include/asm/arch-tegra2/tegra2_spi.h
@@ -0,0 +1,76 @@
+/*
+ * NVIDIA Tegra2 SPI-FLASH controller
+ *
+ * Copyright 2010-2011 NVIDIA Corporation
+ *
+ * This software may be used and distributed according to the
+ * terms of the GNU Public License, Version 2, incorporated
+ * herein by reference.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * Version 2 as published by the Free Software Foundation.
+ *
+ * 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_SPI_H_
+#define _TEGRA2_SPI_H_
+
+#include 
+
+struct spi_tegra {
+   u32 command;/* SPI_COMMAND_0 register  */
+   u32 status; /* SPI_STATUS_0 register */
+   u32 rx_cmp; /* SPI_RX_CMP_0 register  */
+   u32 dma_ctl;/* SPI_DMA_CTL_0 register */
+   u32 tx_fifo;/* SPI_TX_FIFO_0 register */
+   u32 rsvd[3];/* offsets 0x14 to 0x1F reserved */
+   u32 rx_fifo;/* SPI_RX_FIFO_0 register */
+};
+
+#define SPI_CMD_GO (1 << 30)
+#define SPI_CMD_ACTIVE_SCLK_SHIFT  26
+#define SPI_CMD_ACTIVE_SCLK_MASK   (3 << SPI_CMD_ACTIVE_SCLK_SHIFT)
+#define SPI_CMD_CK_SDA (1 << 21)
+#define SPI_CMD_ACTIVE_SDA_SHIFT   18
+#define SPI_CMD_ACTIVE_SDA_MASK(3 << SPI_CMD_ACTIVE_SDA_SHIFT)
+#define SPI_CMD_CS_POL (1 << 16)
+#define SPI_CMD_TXEN   (1 << 15)
+#define SPI_CMD_RXEN   (1 << 14)
+#define SPI_CMD_CS_VAL (1 << 13)
+#define SPI_CMD_CS_SOFT(1 << 12)
+#define SPI_CMD_CS_DELAY   (1 << 9)
+#define SPI_CMD_CS3_EN (1 << 8)
+#define SPI_CMD_CS2_EN (1 << 7)
+#define SPI_CMD_CS1_EN (1 << 6)
+#define SPI_CMD_CS0_EN (1 << 5)
+#define SPI_CMD_BIT_LENGTH (1 << 4)
+#define SPI_CMD_BIT_LENGTH_MASK0x001F
+
+#define SPI_STAT_BSY   (1 << 31)
+#define SPI_STAT_RDY   (1 << 30)
+#define SPI_STAT_RXF_FLUSH (1 << 29)
+#define SPI_STAT_TXF_FLUSH (1 << 28)
+#define SPI_STAT_RXF_UNR   (1 << 27)
+#define SPI_STAT_TXF_OVF   (1 << 26)
+#define SPI_STAT_RXF_EMPTY (1 << 25)
+#define SPI_STAT_RXF_FULL  (1 << 24)
+#define SPI_STAT_TXF_EMPTY (1 << 23)
+#define SPI_STAT_TXF_FULL  (1 << 22)
+#define SPI_STAT_SEL_TXRX_N(1 << 16)
+#define SPI_STAT_CUR_BLKCNT(1 << 15)
+
+#define SPI_TIMEOUT1000
+#define TEGRA2_SPI_MAX_FREQ5200
+
+
+#endif /* _TEGRA2_SPI_H_ */
diff --git a/board/nvidia/common/board.c b/board/nvidia/common/board.c
index a2d45c1..2591ebc 100644
--- a/board/nvidia/common/board.c
+++ b/board/nvidia/common/board.c
@@ -31,6 +31,7 @@
 #include 
 #include 
 #include 
+#include 
 #include "board.h"
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -114,6 +115,9 @@ int board_init(void)

[U-Boot] [PATCH v3 2/8] tegra2: Add UARTB support

2011-11-05 Thread Simon Glass
UARTB is used on some boards, so support it here.

Signed-off-by: Simon Glass 
---

 board/nvidia/common/board.c |   10 ++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/board/nvidia/common/board.c b/board/nvidia/common/board.c
index a5da310..a2d45c1 100644
--- a/board/nvidia/common/board.c
+++ b/board/nvidia/common/board.c
@@ -38,6 +38,7 @@ DECLARE_GLOBAL_DATA_PTR;
 enum {
/* UARTs which we can enable */
UARTA   = 1 << 0,
+   UARTB   = 1 << 1,
UARTD   = 1 << 3,
 };
 
@@ -76,6 +77,8 @@ static void clock_init_uart(int uart_ids)
 {
if (uart_ids & UARTA)
enable_uart(PERIPH_ID_UART1);
+   if (uart_ids & UARTB)
+   enable_uart(PERIPH_ID_UART2);
if (uart_ids & UARTD)
enable_uart(PERIPH_ID_UART4);
 }
@@ -92,6 +95,10 @@ static void pin_mux_uart(int uart_ids)
pinmux_tristate_disable(PINGRP_IRRX);
pinmux_tristate_disable(PINGRP_IRTX);
}
+   if (uart_ids & UARTB) {
+   pinmux_set_func(PINGRP_UAD, PMUX_FUNC_IRDA);
+   pinmux_tristate_disable(PINGRP_UAD);
+   }
if (uart_ids & UARTD) {
pinmux_set_func(PINGRP_GMC, PMUX_FUNC_UARTD);
pinmux_tristate_disable(PINGRP_GMC);
@@ -121,6 +128,9 @@ int board_early_init_f(void)
 #ifdef CONFIG_TEGRA2_ENABLE_UARTA
uart_ids |= UARTA;
 #endif
+#ifdef CONFIG_TEGRA2_ENABLE_UARTB
+   uart_ids |= UARTB;
+#endif
 #ifdef CONFIG_TEGRA2_ENABLE_UARTD
uart_ids |= UARTD;
 #endif
-- 
1.7.3.1

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


[U-Boot] [PATCH v3 6/8] tegra2: Implement SPI / UART GPIO switch

2011-11-05 Thread Simon Glass
The Tegra2 Seaboard has the unfortunate feature that SPI and the console
UART are multiplexed on the same pins. We need to switch between one
and the other during SPI and console activity.

This new file implements a switch and keeps track of which peripheral
owns the pins. It also flips over the controlling GPIO as needed

Since we are adding a second file to board/nvidia/common, we create
a proper Makefile there and remove the direct board.o include from
board/nvidia/seaboard/Makefile

Signed-off-by: Simon Glass 
---
Changes in v2:
- Fix up GPIO selection to use gpio_request() first
- Rename uart-spi-fix to uart-spi-switch
- Rename uart/spi_enable() to pinmux_select_uart/spi()

Changes in v3:
- Remove unneeded #includes and header file guard

 arch/arm/include/asm/arch-tegra2/uart-spi-switch.h |   46 +++
 board/nvidia/common/Makefile   |   47 +++
 board/nvidia/common/uart-spi-switch.c  |  138 
 board/nvidia/seaboard/Makefile |1 -
 4 files changed, 231 insertions(+), 1 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-tegra2/uart-spi-switch.h
 create mode 100644 board/nvidia/common/Makefile
 create mode 100644 board/nvidia/common/uart-spi-switch.c

diff --git a/arch/arm/include/asm/arch-tegra2/uart-spi-switch.h 
b/arch/arm/include/asm/arch-tegra2/uart-spi-switch.h
new file mode 100644
index 000..e4503b1
--- /dev/null
+++ b/arch/arm/include/asm/arch-tegra2/uart-spi-switch.h
@@ -0,0 +1,46 @@
+/*
+ * 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 _UART_SPI_SWITCH_H
+#define _UART_SPI_SWITCH_H
+
+#if defined(CONFIG_SPI_UART_SWITCH)
+/*
+ * Signal that we are about to use the UART. This unfortunate hack is
+ * required by Seaboard, which cannot use its console and SPI at the same
+ * time! If the board file provides this, the board config will declare it.
+ * Let this be a lesson for others.
+ */
+void pinmux_select_uart(NS16550_t regs);
+
+/*
+ * Signal that we are about the use the SPI bus.
+ */
+void pinmux_select_spi(void);
+
+#else /* not CONFIG_SPI_UART_SWITCH */
+
+static inline void pinmux_select_uart(NS16550_t regs) {}
+static inline void pinmux_select_spi(void) {}
+
+#endif
+
+#endif
diff --git a/board/nvidia/common/Makefile b/board/nvidia/common/Makefile
new file mode 100644
index 000..3e748fd
--- /dev/null
+++ b/board/nvidia/common/Makefile
@@ -0,0 +1,47 @@
+# 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
+
+include $(TOPDIR)/config.mk
+
+ifneq ($(OBJTREE),$(SRCTREE))
+$(shell mkdir -p $(obj)board/$(VENDOR)/common)
+endif
+
+LIB= $(obj)lib$(VENDOR).o
+
+COBJS-y += board.o
+COBJS-$(CONFIG_SPI_UART_SWITCH) += uart-spi-switch.o
+
+COBJS  := $(COBJS-y)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+all:   $(LIB)
+
+$(LIB):$(obj).depend $(OBJS) $(SOBJS)
+   $(call cmd_link_o_target, $(OBJS) $(SOBJS))
+
+#
+# This is for $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
diff --git a/board/nvidia/common/uart-spi-switch.c 
b/board/nvidia/common/uart-spi-switch.c
new file mode 100644
index 000..23aa0b9
--- /dev/null
+++ b/board/nvidia/common/uart-spi-switch.c
@@ 

[U-Boot] [PATCH v3 1/8] tegra2: Tidy UART selection

2011-11-05 Thread Simon Glass
UART selection is done with a lot of #ifdefs. This cleans things up
a little.

Signed-off-by: Simon Glass 
---

 board/nvidia/common/board.c |   57 +-
 1 files changed, 34 insertions(+), 23 deletions(-)

diff --git a/board/nvidia/common/board.c b/board/nvidia/common/board.c
index 0f12de2..a5da310 100644
--- a/board/nvidia/common/board.c
+++ b/board/nvidia/common/board.c
@@ -35,6 +35,12 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
+enum {
+   /* UARTs which we can enable */
+   UARTA   = 1 << 0,
+   UARTD   = 1 << 3,
+};
+
 const struct tegra2_sysinfo sysinfo = {
CONFIG_TEGRA2_BOARD_STRING
 };
@@ -64,36 +70,32 @@ static void enable_uart(enum periph_id pid)
 
 /*
  * Routine: clock_init_uart
- * Description: init the PLL and clock for the UART(s)
+ * Description: init clock for the UART(s)
  */
-static void clock_init_uart(void)
+static void clock_init_uart(int uart_ids)
 {
-#if defined(CONFIG_TEGRA2_ENABLE_UARTA)
-   enable_uart(PERIPH_ID_UART1);
-#endif /* CONFIG_TEGRA2_ENABLE_UARTA */
-#if defined(CONFIG_TEGRA2_ENABLE_UARTD)
-   enable_uart(PERIPH_ID_UART4);
-#endif /* CONFIG_TEGRA2_ENABLE_UARTD */
+   if (uart_ids & UARTA)
+   enable_uart(PERIPH_ID_UART1);
+   if (uart_ids & UARTD)
+   enable_uart(PERIPH_ID_UART4);
 }
 
 /*
  * Routine: pin_mux_uart
  * Description: setup the pin muxes/tristate values for the UART(s)
  */
-static void pin_mux_uart(void)
+static void pin_mux_uart(int uart_ids)
 {
-#if defined(CONFIG_TEGRA2_ENABLE_UARTA)
-   pinmux_set_func(PINGRP_IRRX, PMUX_FUNC_UARTA);
-   pinmux_set_func(PINGRP_IRTX, PMUX_FUNC_UARTA);
-
-   pinmux_tristate_disable(PINGRP_IRRX);
-   pinmux_tristate_disable(PINGRP_IRTX);
-#endif /* CONFIG_TEGRA2_ENABLE_UARTA */
-#if defined(CONFIG_TEGRA2_ENABLE_UARTD)
-   pinmux_set_func(PINGRP_GMC, PMUX_FUNC_UARTD);
-
-   pinmux_tristate_disable(PINGRP_GMC);
-#endif /* CONFIG_TEGRA2_ENABLE_UARTD */
+   if (uart_ids & UARTA) {
+   pinmux_set_func(PINGRP_IRRX, PMUX_FUNC_UARTA);
+   pinmux_set_func(PINGRP_IRTX, PMUX_FUNC_UARTA);
+   pinmux_tristate_disable(PINGRP_IRRX);
+   pinmux_tristate_disable(PINGRP_IRTX);
+   }
+   if (uart_ids & UARTD) {
+   pinmux_set_func(PINGRP_GMC, PMUX_FUNC_UARTD);
+   pinmux_tristate_disable(PINGRP_GMC);
+   }
 }
 
 /*
@@ -114,14 +116,23 @@ int board_init(void)
 #ifdef CONFIG_BOARD_EARLY_INIT_F
 int board_early_init_f(void)
 {
+   int uart_ids = 0;   /* bit mask of which UART ids to enable */
+
+#ifdef CONFIG_TEGRA2_ENABLE_UARTA
+   uart_ids |= UARTA;
+#endif
+#ifdef CONFIG_TEGRA2_ENABLE_UARTD
+   uart_ids |= UARTD;
+#endif
+
/* Initialize essential common plls */
clock_early_init();
 
/* Initialize UART clocks */
-   clock_init_uart();
+   clock_init_uart(uart_ids);
 
/* Initialize periph pinmuxes */
-   pin_mux_uart();
+   pin_mux_uart(uart_ids);
 
/* Initialize periph GPIOs */
gpio_config_uart();
-- 
1.7.3.1

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


[U-Boot] [PATCH v3 5/8] tegra2: Enable SPI environment on Seaboard

2011-11-05 Thread Simon Glass
This uses the SPI flash on Seaboard to store an 8KB environment.

Signed-off-by: Simon Glass 
---
Changes in v2:
- Add CONFIG_SPI_FLASH_SIZE to define flash size
- Add config for SPI environment mode/speed

 include/configs/harmony.h   |3 +++
 include/configs/seaboard.h  |9 +
 include/configs/tegra2-common.h |3 +--
 3 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/include/configs/harmony.h b/include/configs/harmony.h
index 89e4911..ce0ae9f 100644
--- a/include/configs/harmony.h
+++ b/include/configs/harmony.h
@@ -58,4 +58,7 @@
 #define CONFIG_EFI_PARTITION
 #define CONFIG_CMD_EXT2
 #define CONFIG_CMD_FAT
+
+/* Environment not stored */
+#define CONFIG_ENV_IS_NOWHERE
 #endif /* __CONFIG_H */
diff --git a/include/configs/seaboard.h b/include/configs/seaboard.h
index 7e8c8cc..261f952 100644
--- a/include/configs/seaboard.h
+++ b/include/configs/seaboard.h
@@ -52,6 +52,7 @@
 #define CONFIG_SF_DEFAULT_MODE SPI_MODE_0
 #define CONFIG_CMD_SPI
 #define CONFIG_CMD_SF
+#define CONFIG_SPI_FLASH_SIZE  (4 << 20)
 
 /* SD/MMC */
 #define CONFIG_MMC
@@ -63,4 +64,12 @@
 #define CONFIG_EFI_PARTITION
 #define CONFIG_CMD_EXT2
 #define CONFIG_CMD_FAT
+
+/* Environment in SPI */
+#define CONFIG_ENV_IS_IN_SPI_FLASH
+#define CONFIG_ENV_SPI_MAX_HZ  4800
+#define CONFIG_ENV_SPI_MODESPI_MODE_0
+
+#define CONFIG_ENV_SECT_SIZECONFIG_ENV_SIZE
+#define CONFIG_ENV_OFFSET   (CONFIG_SPI_FLASH_SIZE - CONFIG_ENV_SECT_SIZE)
 #endif /* __CONFIG_H */
diff --git a/include/configs/tegra2-common.h b/include/configs/tegra2-common.h
index 9c3b9fa..4595ae4 100644
--- a/include/configs/tegra2-common.h
+++ b/include/configs/tegra2-common.h
@@ -52,8 +52,7 @@
 #define CONFIG_OF_LIBFDT   /* enable passing of devicetree */
 
 /* Environment */
-#define CONFIG_ENV_IS_NOWHERE
-#define CONFIG_ENV_SIZE0x2 /* Total Size 
Environment */
+#define CONFIG_ENV_SIZE0x2000  /* Total Size 
Environment */
 
 /*
  * Size of malloc() pool
-- 
1.7.3.1

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


[U-Boot] [PATCH v3 8/8] tegra2: Plumb in SPI/UART switch code

2011-11-05 Thread Simon Glass
On Seaboard the UART and SPI interfere with each other. This causes the UART
to receive spurious zero bytes after SPI transactions and also means that
SPI can corrupt a few output characters when it starts up if they are still
in the UART buffer.

This updates the board to use the SPI/UART switch to avoid the problem.

For now this feature is turned off since it needs changes to the NS16550
UART to operate.

Signed-off-by: Simon Glass 
---

 board/nvidia/common/board.c  |8 
 board/nvidia/common/board.h  |1 +
 board/nvidia/seaboard/seaboard.c |3 +++
 3 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/board/nvidia/common/board.c b/board/nvidia/common/board.c
index 2591ebc..0403645 100644
--- a/board/nvidia/common/board.c
+++ b/board/nvidia/common/board.c
@@ -112,9 +112,13 @@ static void pin_mux_uart(int uart_ids)
  */
 int board_init(void)
 {
+   /* Do clocks and UART first so that printf() works */
clock_init();
clock_verify();
 
+#ifdef CONFIG_SPI_UART_SWITCH
+   gpio_config_uart();
+#endif
 #ifdef CONFIG_TEGRA2_SPI
spi_init();
 #endif
@@ -149,7 +153,11 @@ int board_early_init_f(void)
pin_mux_uart(uart_ids);
 
/* Initialize periph GPIOs */
+#ifdef CONFIG_SPI_UART_SWITCH
+   gpio_early_init_uart();
+#else
gpio_config_uart();
+#endif
 
/* Init UART, scratch regs, and start CPU */
tegra2_start();
diff --git a/board/nvidia/common/board.h b/board/nvidia/common/board.h
index 35acbca..2c89ff4 100644
--- a/board/nvidia/common/board.h
+++ b/board/nvidia/common/board.h
@@ -27,5 +27,6 @@
 void tegra2_start(void);
 void gpio_config_uart(void);
 int tegra2_mmc_init(int dev_index, int bus_width, int pwr_gpio, int cd_gpio);
+void gpio_early_init_uart(void);
 
 #endif /* BOARD_H */
diff --git a/board/nvidia/seaboard/seaboard.c b/board/nvidia/seaboard/seaboard.c
index 7f2827b..0b779f6 100644
--- a/board/nvidia/seaboard/seaboard.c
+++ b/board/nvidia/seaboard/seaboard.c
@@ -31,6 +31,8 @@
 #endif
 #include "../common/board.h"
 
+/* TODO: Remove this code when the SPI switch is working */
+#ifndef CONFIG_SPI_UART_SWITCH
 /*
  * Routine: gpio_config_uart_seaboard
  * Description: Force GPIO_PI3 low on Seaboard so UART4 works.
@@ -48,6 +50,7 @@ void gpio_config_uart(void)
return;
gpio_config_uart_seaboard();
 }
+#endif
 
 #ifdef CONFIG_TEGRA2_MMC
 /*
-- 
1.7.3.1

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


[U-Boot] [PATCH v3 0/8] tegra2: Implement SPI flash and saved environment

2011-11-05 Thread Simon Glass
Enable SPI flash on the Tegra2 Seaboard along with a saved 8KB environment.
This involves a few pieces:

- Tegra2 SPI driver
- Seaboard config changes
- a SPI / UART switch to handle switching between SPI and console UART

This series applies cleanly on top of Stephen Warren's latest patch series

http://patchwork.ozlabs.org/project/uboot/list/?submitter=Stephen+Warren&state=*&q=v7

(the first patch of which is already applied)

and also requires Stephen's GPIO fix.

http://patchwork.ozlabs.org/patch/118184/

Still to come are the NS16550 driver changes to cope with the pins
disappearing from under it. This patch series has been NAKed, the XON/XOFF
series won't really help and it isn't clear exactly what to do here. I
will return to this another day.

http://patchwork.ozlabs.org/patch/120013/

This patch series has been tested on Seaboard and other Tegra2 hardware.

Changes in v2:
- Update to support SPI mode and frequency
- Tidy driver according to comments, and tidy a little more
- Add CONFIG_SPI_FLASH_SIZE to define flash size
- Add config for SPI environment mode/speed
- Fix up GPIO selection to use gpio_request() first
- Rename uart-spi-fix to uart-spi-switch
- Rename uart/spi_enable() to pinmux_select_uart/spi()
- Add pinmux logic to SPI driver

Changes in v3:
- Remove the replaced bus/cs check function
- Change (bitlen & 7) to (bitlen % 8)
- Remove unneeded #includes and header file guard

Simon Glass (7):
  tegra2: Tidy UART selection
  tegra2: Add UARTB support
  tegra2: config: Enable SPI flash on Seaboard
  tegra2: Enable SPI environment on Seaboard
  tegra2: Implement SPI / UART GPIO switch
  tegra2: spi: Support SPI / UART switch
  tegra2: Plumb in SPI/UART switch code

Tom Warren (1):
  tegra2: spi: Add SPI driver for Tegra2 SOC

 arch/arm/include/asm/arch-tegra2/tegra2.h  |1 +
 arch/arm/include/asm/arch-tegra2/tegra2_spi.h  |   76 ++
 arch/arm/include/asm/arch-tegra2/uart-spi-switch.h |   46 
 board/nvidia/common/Makefile   |   47 
 board/nvidia/common/board.c|   79 --
 board/nvidia/common/board.h|1 +
 board/nvidia/common/uart-spi-switch.c  |  138 ++
 board/nvidia/seaboard/Makefile |1 -
 board/nvidia/seaboard/seaboard.c   |3 +
 drivers/spi/Makefile   |1 +
 drivers/spi/tegra2_spi.c   |  274 
 include/configs/harmony.h  |3 +
 include/configs/seaboard.h |   20 ++
 include/configs/tegra2-common.h|3 +-
 14 files changed, 667 insertions(+), 26 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-tegra2/tegra2_spi.h
 create mode 100644 arch/arm/include/asm/arch-tegra2/uart-spi-switch.h
 create mode 100644 board/nvidia/common/Makefile
 create mode 100644 board/nvidia/common/uart-spi-switch.c
 create mode 100644 drivers/spi/tegra2_spi.c

-- 
1.7.3.1

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


Re: [U-Boot] [PATCH v2 6/8] tegra2: Implement SPI / UART GPIO switch

2011-11-05 Thread Simon Glass
Hi Mike,

On Thu, Nov 3, 2011 at 6:44 PM, Mike Frysinger  wrote:
> On Thursday 03 November 2011 18:41:37 Simon Glass wrote:
>> Since we are adding a second file to board/nvidia/common, we create
>> a proper Makefile there and remove the direct board.o include from
>> board/nvidia/seaboard/Makefile
>
> so who is including board/nvidia/common/libnvidia.o now ?

No one - it doesn't exist and that directory doesn't have a Makefile.
The top-level Makefile doesn't require it, but since I now have more
than one object file I want to create a library.

>
>> --- /dev/null
>> +++ b/arch/arm/include/asm/arch-tegra2/uart-spi-switch.h
>>
>> +#ifndef __ASSEMBLY__
>
> the asm checking is incomplete.  so it must not matter -> drop it.

OK
>
>> --- /dev/null
>> +++ b/board/nvidia/common/uart-spi-switch.c
>>
>> +#include 
>> +#include 
>> +#include 
>
> seems to be unused
> -mike
>

OK - yes this isn't needed until FDT support is in there (will be a
later patch set).

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


Re: [U-Boot] [PATCH v2 3/8] tegra2: spi: Add SPI driver for Tegra2 SOC

2011-11-05 Thread Simon Glass
Hi Mike,

On Thu, Nov 3, 2011 at 6:36 PM, Mike Frysinger  wrote:
> On Thursday 03 November 2011 18:41:34 Simon Glass wrote:
>> --- a/arch/arm/include/asm/arch-tegra2/tegra2.h
>> +++ b/arch/arm/include/asm/arch-tegra2/tegra2.h
>>
>>  #define NV_PA_APB_UARTC_BASE (NV_PA_APB_MISC_BASE + 0x6200)
>>  #define NV_PA_APB_UARTD_BASE (NV_PA_APB_MISC_BASE + 0x6300)
>>  #define NV_PA_APB_UARTE_BASE (NV_PA_APB_MISC_BASE + 0x6400)
>> +#define TEGRA2_SPI_BASE              (NV_PA_APB_MISC_BASE + 0xC380)
>>  #define NV_PA_PMC_BASE               0x7000E400
>>  #define NV_PA_CSITE_BASE     0x7004
>
> shouldn't it use the same naming convention ?  NV__SPI_BASE ?

Actually we are moving away from this - the prefixes just obfuscate
the meaning. A later patch will tidy this up a little.

>
>> --- /dev/null
>> +++ b/drivers/spi/tegra2_spi.c
>>
>> +int spi_cs_is_valid(unsigned int bus, unsigned int cs)
>> +{
>> +     /* Tegra2 SPI-Flash - only 1 device ('bus/cs') */
>> +     if (bus > 0 && cs != 0)
>> +             return 0;
>> +     else
>> +             return 1;
>> +}
>
> shouldn't that be "||" and not "&&" ?

This function should be removed as it doesn't print enough errors.

>
>> +struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs,
>> +             unsigned int max_hz, unsigned int mode)
>> +{
>> +     struct tegra_spi_slave *spi;
>> +
>> +     if (!spi_cs_is_valid(bus, cs))
>> +             return NULL;
>> +
>> +     if (bus != 0) {
>> +             printf("SPI error: unsupported bus %d\n", bus);
>> +             return NULL;
>> +     }
>> +     if (cs != 0) {
>> +             printf("SPI error: unsupported chip select %d on bus %d\n",
>> +                    cs, bus);
>> +             return NULL;
>> +     }
>
> doesn't spi_cs_is_valid() make these two later checks redundant ?

Yes - have removed the function.

>
>> +     if (mode > SPI_MODE_3) {
>> +             printf("SPI error: unsupported SPI mode %i\n", mode);
>> +             return NULL;
>> +     }
>
> this is weird ... i'd just drop it as this isn't something that should be in
> spi drivers, but rather the common layer (if we choose to do so)

OK

>
>> +int spi_xfer(struct spi_slave *slave, unsigned int bitlen,
>> +             const void *data_out, void *data_in, unsigned long flags)
>> +{
>> ...
>> +     if (bitlen & 7)
>> +             return -1;
>
> i'd use (bitlen % 8) as that is what all the other drivers are doing

OK

>
>> +     reg = readl(®s->status);
>> +     writel(reg, ®s->status);     /* Clear all SPI events via R/W */
>
> are these R1C or W1C bits ?  if the latter, you could just write -1 and avoid
> the read altogether ...
> -mike
>

The next line is:

debug("spi_xfer entry: STATUS = %08x\n", reg);

and I didn't want to remove that, so I need to keep the read
unfortunately. It could perhaps be this if you are keen:

writel(-1, ®s->status);     /* Clear all SPI events via R/W */
debug("spi_xfer entry: STATUS = %08x\n", readl(®->status));

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


Re: [U-Boot] [PATCH 2/2] mvgbe: fix network device indices

2011-11-05 Thread Albert ARIBAUD
Hi Wolfgang,

Le 05/11/2011 14:21, Wolfgang Denk a écrit :
> Dear Albert ARIBAUD,
>
> In message<4eb507b7.9090...@aribaud.net>  you wrote:
>>
>> But what about MAC randomization as a function provided by the SoC level
>> to board MAC init code that wants to use it? For instance, a weak MAC
>> setup function provided by the SoC level, and the board level would use
>> it or provide its own.
>
> What would be the result?  A bord that comes up with a new MAC address
> each time you reset it?

No -- the goal of the randomization code was, is, and will be to allow 
the board to use the network when no correct MAC address can be found 
anywhere (env vars, EEPROM, e-fuses, whatever). When a correct address 
is available, that address will be used. Typically, this happens when 
the board has not been provisioned yet, at a point where the MAC address 
it uses is not relevant yet.

Notes:

1. This code would only be available to kirkwood-based boards anyway.

2. Although the code incorrectly describes it as "private", the random 
address is actually a locally administered address (bit 1 of first octet 
is set), which eliminates the risk of clashing against any 'normal' 
(universally administered) address; and its last three octets are 
randomized in order to limit the risk of clashing against other locally 
administered addresses if we're unlucky enough to have any on the 
network segment.

> 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] About the pull request and patchwork

2011-11-05 Thread 馬克泡
Hi all,

2011/11/5 Wolfgang Denk :
> Dear =?UTF-8?B?6aas5YWL5rOh?=,
>
> In message 
>  you 
> wrote:
> I wrote before that I would really appreciate if _anybody_ who notices
> incorrect / obsolete states oin Patchwork could please update these.
>
> Unlike as for normal patches, I didn't find a way yet to auto-update
> the status for pull requests in PW.
>
>
> So yes, please, if you notice such inconsistencies, help out and
> update the status as needed.
>

Maybe a perl or a python script is need to auto update the patchwork status
by analyzing the table format of patckwork.
Is this possible?

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


[U-Boot] [PATCH] mx5: Correct a warning in clock.c

2011-11-05 Thread Simon Glass
This corects the warning below, obtained with my gcc 4.6 compiler.

arch/arm/cpu/armv7/mx5/libmx5.o: In function `decode_pll':
arch/arm/cpu/armv7/mx5/clock.c:94: undefined reference to `__aeabi_uldivmod'

I am not able to test this on MX5x hardware, but it does improve the
MAKEALL output for me. You may already have a similar patch, but I cannot
see it on the list.

Signed-off-by: Simon Glass 
---
 arch/arm/cpu/armv7/mx5/clock.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/cpu/armv7/mx5/clock.c b/arch/arm/cpu/armv7/mx5/clock.c
index 0769a64..933ce05 100644
--- a/arch/arm/cpu/armv7/mx5/clock.c
+++ b/arch/arm/cpu/armv7/mx5/clock.c
@@ -91,7 +91,7 @@ static uint32_t decode_pll(struct mxc_pll_reg *pll, uint32_t 
infreq)
if (ctrl & MXC_DPLLC_CTL_DPDCK0_2_EN)
refclk *= 2;
 
-   refclk /= pdf + 1;
+   do_div(refclk, pdf + 1);
temp = refclk * mfn_abs;
do_div(temp, mfd + 1);
ret = refclk * mfi;
-- 
1.7.3.1

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


Re: [U-Boot] About the pull request and patchwork

2011-11-05 Thread Wolfgang Denk
Dear =?UTF-8?B?6aas5YWL5rOh?=,

In message  
you wrote:
> 
> I think if we (custodians) could assigned the pull request as "accept"
> or something after Wolfgang
> has pull the commits from downstream will be good.
> What do you guys think about it?

I wrote before that I would really appreciate if _anybody_ who notices
incorrect / obsolete states oin Patchwork could please update these.

Unlike as for normal patches, I didn't find a way yet to auto-update
the status for pull requests in PW.


So yes, please, if you notice such inconsistencies, help out and
update the status as needed.

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
A good aphorism is too hard for the tooth of time, and  is  not  worn
away  by  all  the  centuries,  although  it serves as food for every
epoch.  - Friedrich Wilhelm Nietzsche
  _Miscellaneous Maxims and Opinions_ no. 168
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] arm: jadecpu: Readd MACH_TYPE_JADECPU

2011-11-05 Thread Albert ARIBAUD
Le 05/11/2011 14:26, Wolfgang Denk a écrit :
> Dear Albert ARIBAUD,
>
> In message<4eb514c7.9000...@aribaud.net>  you wrote:
>>
>>> +#ifndef MACH_TYPE_JADECPU
>>> +#define MACH_TYPE_JADECPU  2636
>>> +#endif
>>
>> NAK -- remove ifndef/endif around definition. This way, if/when mach
>> type reappears in official mach-type.h, we will get a warning about your
>> mach-type being defined twice.
>
> Note that you will only get a warning if a _different_ value get's
> defined (``warning: "VAR" redefined'').  If both values are the same,
> no warning will be raised.

Hmm, correct. In order to catch the mach-type creeping back in 
mach-types.h, we'd need to define something like

#define MACH_TYPE_JADECPU   (2636)

I'll post an ARM-global patch for this, but as it will obviously not be 
a bugfix, it'll wait until next merge window.

> Best regards,
>
> Wolfgang Denk

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


  1   2   >