Re: [U-Boot] [PATCH 3/5] Add fuse API and commands

2012-12-03 Thread Stefano Babic
On 14/08/2012 14:52, Benoît Thébaudeau wrote:
 This can be useful for fuse-like hardware, OTP SoC options, etc.
 
 Signed-off-by: Benoît Thébaudeau benoit.thebaud...@advansee.com
 Cc: Wolfgang Denk w...@denx.de
 Cc: Stefano Babic sba...@denx.de
 ---

Hi Benoît,

I agree with you that same code can be used then for i.MX6. There is no
need of a parallel development.

I am thinking about if we need some kind of protection to avoid to
destroy very easy the SOC. Running a fuse command can be much more
dangerous as scrubbing NAND or erasing flash.

What about to add at least a -y option when we write the fuses, in the
same way we have for the nand scrub command ? This does not forbid to
use the command in scripts, but it can maybe avoid to destroy the SOC
when the command is wrong tipped on the console.

What do you think ?

Best regards,
Stefano Babic

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


Re: [U-Boot] [PATCH V4 01/11] imximage: mx53 needs transfer length a multiple of 512

2012-12-03 Thread Stefano Babic
On 28/11/2012 22:35, Wolfgang Denk wrote:
 Dear Troy Kisky,
 
 In message 50b67c99.8080...@boundarydevices.com you wrote:

 But the reason I didn't include common.h is because of the target specific
 files that it also includes. Would you mind if I moved
 
 Why would these hurt?  They don't anywhere else.

Personally, I think that mkimage as generic tool should not include
common.h. Doing that, it does not allow to compile mkimage without
running config, and let's think that we need a different mkimage for
each target, and that is not true. This will break also support from
distros, because their packages (for example, u-boot-tools,
uboot-mkimage under Ubuntu) are compiled without configuring u-boot -
and I think it is correct.

IMHO we are discussing about a single macro. We can let it in mkimage as
in patch and move it in a general file only if we will have a use case
with a bunch of macros.

Best regards,
Stefano Babic

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


Re: [U-Boot] [PATCH V4 01/11] imximage: mx53 needs transfer length a multiple of 512

2012-12-03 Thread Stefano Babic
On 29/11/2012 06:28, Wolfgang Denk wrote:
 Dear Troy Kisky,
 
 In message 50b6cb79.4030...@boundarydevices.com you wrote:

 Would you like to see the Linux way of ALIGN, or ROUND?
 
 Do you align some buffer or similar, or do you round (up) a size?
 
 Now, back to the other topic you raised. Should I apply the bug work-around
 for all version 2 headers, or find a way to distinguish mx53/mx6?

 
 I cannot tell.  Stefano, what do you think?

Well, I am thinking about which are the real benefits. If we always
round up the size to 512 bytes for V2 header, *maybe* we constrain the
i.MX6 to load some bytes more, but it is the only drawback. And this if
the i.MX6 does not suffer of the same problem found on i.MX53.

On the other side, having two different versions of V2 header is
confusing. It is then undocumented by Freescale, and maybe it is
possible to find a note in some errata. Having the same interface
without special hacking for each SOC overcomes the increment in the
footprint for the i.MX6 (in worst case 511 bytes - and not a lot
compared to current size of U-Boot for MX5/MX6, usually several hundred
of KB).

Best regards,
Stefano Babic

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


Re: [U-Boot] U-Boot for MIPS AR7161

2012-12-03 Thread Dmytro
Greetings
In general that's the last variant
http://dioptimizer.narod.ru/files/ap96/u-boot.bin (160 Kb)
It is advisable to flash original bootloader, and only then something
is seriously flash on the router.
If something does not work, see the file:
ap96/boot/u-boot/include/configs/ap96.h
(here the main SETUP platform)

How to compile the source code:
1. Extract the archive to the rights
2. Go to the folder ./build
3. Run make BOARD_TYPE=ap96 uboot
After build, compiled variants of uoot's will be in:
./ap96/boot/u-boot/ (elf, bin, srec, etc. format)
and
./images/ap96/  (only bin format)
http://www.mediafire.com/?5rljo2y95dypd8z (109 Mb)

P.S.
Notify, wakes it work flinfo for the second bank of flash memory.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] U-Boot for MIPS AR7161

2012-12-03 Thread Drassal, Allan
Dear Dmytro,

Thank you, with this I was able to rewrite the flash!
I now have been able to restore the original boot loader, and I still have 
interest in developing a bootloader that has additional features, however, with 
this I believe I can recover the device back to its original configuraration.

Thank you for the source for this, I will attempt to resolve the remaining 
issues.
When I have resolved them, I would be happy to share the results.

Allan

From: Dmytro [dioptimi...@gmail.com]
Sent: Monday, December 03, 2012 01:28
To: Drassal, Allan
Cc: U-Boot Mailing List
Subject: Re: [U-Boot] U-Boot for MIPS AR7161

Greetings
In general that's the last variant
http://dioptimizer.narod.ru/files/ap96/u-boot.bin (160 Kb)
It is advisable to flash original bootloader, and only then something
is seriously flash on the router.
If something does not work, see the file:
ap96/boot/u-boot/include/configs/ap96.h
(here the main SETUP platform)

How to compile the source code:
1. Extract the archive to the rights
2. Go to the folder ./build
3. Run make BOARD_TYPE=ap96 uboot
After build, compiled variants of uoot's will be in:
./ap96/boot/u-boot/ (elf, bin, srec, etc. format)
and
./images/ap96/  (only bin format)
http://www.mediafire.com/?5rljo2y95dypd8z (109 Mb)

P.S.
Notify, wakes it work flinfo for the second bank of flash memory.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] usb: Fix bug when both DFU ETHER are defined

2012-12-03 Thread Pantelis Antoniou
When both CONFIG_USB_GADGET  CONFIG_USB_ETHER are defined
the makefile links objects twice.

This patch uses a Makefile specific idiom of
'if defined(CONFIG_USB_GADGET) || defined(CONFIG_USB_ETHER)'
to handle the case.

Signed-off-by: Pantelis Antoniou pa...@antoniou-consulting.com
---
 drivers/usb/gadget/Makefile | 10 --
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/gadget/Makefile b/drivers/usb/gadget/Makefile
index 040eaba..e545b6b 100644
--- a/drivers/usb/gadget/Makefile
+++ b/drivers/usb/gadget/Makefile
@@ -25,15 +25,21 @@ include $(TOPDIR)/config.mk
 
 LIB:= $(obj)libusb_gadget.o
 
+# if defined(CONFIG_USB_GADGET) || defined(CONFIG_USB_ETHER)
+#   Everytime you forget how crufty makefiles can get things like
+#   this remind you...
+ifneq (,$(CONFIG_USB_GADGET)$(CONFIG_USB_ETHER))
+COBJS-y += epautoconf.o config.o usbstring.o
+endif
+
 # new USB gadget layer dependencies
 ifdef CONFIG_USB_GADGET
-COBJS-y += epautoconf.o config.o usbstring.o
 COBJS-$(CONFIG_USB_GADGET_S3C_UDC_OTG) += s3c_udc_otg.o
 COBJS-$(CONFIG_USBDOWNLOAD_GADGET) += g_dnl.o
 COBJS-$(CONFIG_DFU_FUNCTION) += f_dfu.o
 endif
 ifdef CONFIG_USB_ETHER
-COBJS-y += ether.o epautoconf.o config.o usbstring.o
+COBJS-y += ether.o
 COBJS-$(CONFIG_USB_ETH_RNDIS) += rndis.o
 COBJS-$(CONFIG_MV_UDC) += mv_udc.o
 COBJS-$(CONFIG_CPU_PXA25X) += pxa25x_udc.o
-- 
1.7.12

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


Re: [U-Boot] [PATCH v3 1/9] usb: Fix bug when both DFU ETHER are defined

2012-12-03 Thread Pantelis Antoniou
Hi Marek,

On Dec 1, 2012, at 7:30 AM, Marek Vasut wrote:

 Dear Pantelis Antoniou,
 
 When both CONFIG_USB_GADGET  CONFIG_USB_ETHER are defined
 the makefile links objects twice.
 
 The cleanest way to fix is to use a new define, CONFIG_USB_UTIL
 which must be defined when either CONFIG_USB_ETHER or
 CONFIG_USB_GADGET are defined.
 
 All affected boards have been modified as well.
 
 Signed-off-by: Pantelis Antoniou pa...@antoniou-consulting.com
 
 Quick google [1]
 
 http://old.nabble.com/if-defined%28a%29-||-defined%28b%29-td26806006.html
 
 This won't work?
 

Somehow I missed that. Makes some kind of (awful) sense.
Updated patch incoming...

 Best regards,
 Marek Vasut

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


[U-Boot] [PATCH 2/4] EXYNOS5 : FDT: Add Aliases for SPI device

2012-12-03 Thread Rajeshwari Shinde
This patch adds aliases for SPI.

Signed-off-by: Rajeshwari Shinde rajeshwar...@samsung.com
---
 board/samsung/dts/exynos5250-smdk5250.dts |3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/board/samsung/dts/exynos5250-smdk5250.dts 
b/board/samsung/dts/exynos5250-smdk5250.dts
index 1562721..4d51d98 100644
--- a/board/samsung/dts/exynos5250-smdk5250.dts
+++ b/board/samsung/dts/exynos5250-smdk5250.dts
@@ -25,6 +25,9 @@
i2c5 = /i2c@12cb;
i2c6 = /i2c@12cc;
i2c7 = /i2c@12cd;
+   spi0 = /spi@12d2;
+   spi1 = /spi@12d3;
+   spi2 = /spi@12d4;
};
 
sromc@1225 {
-- 
1.7.4.4

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


[U-Boot] [PATCH 0/4] EXYNOS5: Add FDT support to SPI

2012-12-03 Thread Rajeshwari Shinde
This patch set adds FDT support to SPI driver.

This patch set is based on top of
EXYNOS5: FDT support for Sound

Rajeshwari Shinde (4):
  EXYNOS5: FDT: Add compatible strings for SPI
  EXYNOS5 : FDT: Add Aliases for SPI device
  EXYNOS5: FDT: Add SPI device node data
  SPI: EXYNOS: Add FDT support to driver.

 arch/arm/dts/exynos5250.dtsi  |   25 
 board/samsung/dts/exynos5250-smdk5250.dts |3 +
 drivers/spi/exynos_spi.c  |   96 +++--
 include/fdtdec.h  |1 +
 lib/fdtdec.c  |1 +
 5 files changed, 120 insertions(+), 6 deletions(-)

-- 
1.7.4.4

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


[U-Boot] [PATCH 3/4] EXYNOS5: FDT: Add SPI device node data

2012-12-03 Thread Rajeshwari Shinde
Add SPI device node data for exynos.

Signed-off-by: Rajeshwari Shinde rajeshwar...@samsung.com
---
 arch/arm/dts/exynos5250.dtsi |   25 +
 1 files changed, 25 insertions(+), 0 deletions(-)

diff --git a/arch/arm/dts/exynos5250.dtsi b/arch/arm/dts/exynos5250.dtsi
index 3f750f0..e8ecf3f 100644
--- a/arch/arm/dts/exynos5250.dtsi
+++ b/arch/arm/dts/exynos5250.dtsi
@@ -102,4 +102,29 @@
compatible = samsung,exynos-sound;
reg = 0x12d6 0x20;
};
+
+   spi@12d2 {
+   #address-cells = 1;
+   #size-cells = 0;
+   compatible = samsung,exynos-spi;
+   reg = 0x12d2 0x30;
+   interrupts = 0 68 0;
+   };
+
+   spi@12d3 {
+   #address-cells = 1;
+   #size-cells = 0;
+   compatible = samsung,exynos-spi;
+   reg = 0x12d3 0x30;
+   interrupts = 0 69 0;
+   };
+
+   spi@12d4 {
+   #address-cells = 1;
+   #size-cells = 0;
+   compatible = samsung,exynos-spi;
+   reg = 0x12d4 0x30;
+   clock-frequency = 5000;
+   interrupts = 0 70 0;
+};
 };
-- 
1.7.4.4

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


[U-Boot] [PATCH 1/4] EXYNOS5: FDT: Add compatible strings for SPI

2012-12-03 Thread Rajeshwari Shinde
Add required compatible information for SPI driver.

Signed-off-by: Rajeshwari Shinde rajeshwar...@samsung.com
---
 include/fdtdec.h |1 +
 lib/fdtdec.c |1 +
 2 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/include/fdtdec.h b/include/fdtdec.h
index 0c195f3..d1279f4 100644
--- a/include/fdtdec.h
+++ b/include/fdtdec.h
@@ -72,6 +72,7 @@ enum fdt_compat_id {
COMPAT_SAMSUNG_S3C2440_I2C, /* Exynos I2C Controller */
COMPAT_SAMSUNG_EXYNOS5_SOUND,   /* Exynos Sound */
COMPAT_WOLFSON_WM8994_CODEC,/* Wolfson WM8994 Sound Codec */
+   COMPAT_SAMSUNG_EXYNOS_SPI,  /* Exynos SPI */
 
COMPAT_COUNT,
 };
diff --git a/lib/fdtdec.c b/lib/fdtdec.c
index 29766dc..1dbb892 100644
--- a/lib/fdtdec.c
+++ b/lib/fdtdec.c
@@ -49,6 +49,7 @@ static const char * const compat_names[COMPAT_COUNT] = {
COMPAT(SAMSUNG_S3C2440_I2C, samsung,s3c2440-i2c),
COMPAT(SAMSUNG_EXYNOS5_SOUND, samsung,exynos-sound),
COMPAT(WOLFSON_WM8994_CODEC, wolfson,wm8994-codec),
+   COMPAT(SAMSUNG_EXYNOS_SPI, samsung,exynos-spi),
 };
 
 const char *fdtdec_get_compatible(enum fdt_compat_id id)
-- 
1.7.4.4

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


[U-Boot] [PATCH 4/4] SPI: EXYNOS: Add FDT support to driver.

2012-12-03 Thread Rajeshwari Shinde
This patch adds FDT support to the SPI driver.

Signed-off-by: Simon Glass s...@chromium.org
Signed-off-by: Rajeshwari Shinde rajeshwar...@samsung.com
---
 drivers/spi/exynos_spi.c |   96 +++---
 1 files changed, 90 insertions(+), 6 deletions(-)

diff --git a/drivers/spi/exynos_spi.c b/drivers/spi/exynos_spi.c
index 3e6c18f..7ecc566 100644
--- a/drivers/spi/exynos_spi.c
+++ b/drivers/spi/exynos_spi.c
@@ -20,6 +20,7 @@
 #include common.h
 #include malloc.h
 #include spi.h
+#include fdtdec.h
 #include asm/arch/clk.h
 #include asm/arch/clock.h
 #include asm/arch/cpu.h
@@ -28,16 +29,20 @@
 #include asm/arch-exynos/spi.h
 #include asm/io.h
 
+DECLARE_GLOBAL_DATA_PTR;
+
 /* Information about each SPI controller */
 struct spi_bus {
enum periph_id periph_id;
s32 frequency;  /* Default clock frequency, -1 for none */
struct exynos_spi *regs;
int inited; /* 1 if this bus is ready for use */
+   int node;
 };
 
 /* A list of spi buses that we know about */
 static struct spi_bus spi_bus[EXYNOS5_SPI_NUM_CONTROLLERS];
+static unsigned int bus_count;
 
 struct exynos_spi_slave {
struct spi_slave slave;
@@ -50,7 +55,7 @@ struct exynos_spi_slave {
 
 static struct spi_bus *spi_get_bus(unsigned dev_index)
 {
-   if (dev_index  EXYNOS5_SPI_NUM_CONTROLLERS)
+   if (dev_index  bus_count)
return spi_bus[dev_index];
debug(%s: invalid bus %d, __func__, dev_index);
 
@@ -347,21 +352,100 @@ static inline struct exynos_spi *get_spi_base(int 
dev_index)
(dev_index - 3);
 }
 
+/*
+ * Read the SPI config from the device tree node.
+ *
+ * @param blob  FDT blob to read from
+ * @param node  Node offset to read from
+ * @param bus   SPI bus structure to fill with information
+ * @return 0 if ok, or -FDT_ERR_NOTFOUND if something was missing
+ */
+static int spi_get_config(const void *blob, int node, struct spi_bus *bus)
+{
+   bus-node = node;
+   bus-regs = (struct exynos_spi *)fdtdec_get_addr(blob, node, reg);
+   bus-periph_id = pinmux_decode_periph_id(blob, node);
+   if (bus-periph_id == PERIPH_ID_NONE) {
+   debug(%s: Invalid peripheral ID %d\n, __func__,
+   bus-periph_id);
+   return -FDT_ERR_NOTFOUND;
+   }
+
+   /* Use 500KHz as a suitable default */
+   bus-frequency = fdtdec_get_int(blob, node, spi-max-frequency,
+   50);
+
+   return 0;
+}
+
+
+/*
+ * Process a list of nodes, adding them to our list of SPI ports.
+ *
+ * @param blob  fdt blob
+ * @param node_list list of nodes to process (any =0 are ignored)
+ * @param count number of nodes to process
+ * @param is_dvc1 if these are DVC ports, 0 if standard I2C
+ * @return 0 if ok, -1 on error
+ */
+static int process_nodes(const void *blob, int node_list[], int count)
+{
+   int i;
+
+   /* build the i2c_controllers[] for each controller */
+   for (i = 0; i  count; i++) {
+   int node = node_list[i];
+   struct spi_bus *bus;
+
+   if (node = 0)
+   continue;
+
+   bus = spi_bus[i];
+   if (spi_get_config(blob, node, bus)) {
+   printf(exynos spi_init: failed to decode bus %d\n,
+   i);
+   return -1;
+   }
+
+   debug(spi: controller bus %d at %p, periph_id %d\n,
+ i, bus-regs, bus-periph_id);
+   bus-inited = 1;
+   bus_count++;
+   }
+
+   return 0;
+}
+
 /* Sadly there is no error return from this function */
 void spi_init(void)
 {
-   int i;
+   int count;
+
+#ifdef CONFIG_OF_CONTROL
+   int node_list[EXYNOS5_SPI_NUM_CONTROLLERS];
+   const void *blob = gd-fdt_blob;
+
+   count = fdtdec_find_aliases_for_id(blob, spi,
+   COMPAT_SAMSUNG_EXYNOS_SPI, node_list,
+   EXYNOS5_SPI_NUM_CONTROLLERS);
+   if (process_nodes(blob, node_list, count))
+   return;
+
+#else
struct spi_bus *bus;
 
-   for (i = 0; i  EXYNOS5_SPI_NUM_CONTROLLERS; i++) {
-   bus = spi_bus[i];
-   bus-regs = get_spi_base(i);
-   bus-periph_id = PERIPH_ID_SPI0 + i;
+   for (count = 0; i  EXYNOS5_SPI_NUM_CONTROLLERS; i++) {
+   bus = spi_bus[count];
+   bus-regs = get_spi_base(count);
+   bus-periph_id = PERIPH_ID_SPI0 + count;
 
/* Although Exynos5 supports upto 50Mhz speed,
 * we are setting it to 10Mhz for safe side
 */
bus-frequency = 1000;
bus-inited = 1;
+   bus-node = 0;
+   bus_count = EXYNOS5_SPI_NUM_CONTROLLERS;
}
+#endif
 }
-- 
1.7.4.4


Re: [U-Boot] [PATCH 3/5] Add fuse API and commands

2012-12-03 Thread Benoît Thébaudeau
Hi Stefano,

On Monday, December 3, 2012 10:03:22 AM, Stefano Babic wrote:
 I am thinking about if we need some kind of protection to avoid to
 destroy very easy the SOC. Running a fuse command can be much more
 dangerous as scrubbing NAND or erasing flash.
 
 What about to add at least a -y option when we write the fuses, in
 the
 same way we have for the nand scrub command ? This does not forbid
 to
 use the command in scripts, but it can maybe avoid to destroy the SOC
 when the command is wrong tipped on the console.
 
 What do you think ?

That makes sense. There could be the same kind of warning confirmation
defaulting to no that would repeat which fuse is about to be programmed.

As to the value passed for fuse row programming or overriding, do you think that
it's fine to force it to be hex, or that choice should be given with '0x'? I
don't really like implicit base selection, but it's clear in the help message,
and it is handy for writing MAC addresses without repeating the '0x' for each
byte.

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


Re: [U-Boot] [PATCH 3/5] Add fuse API and commands

2012-12-03 Thread Stefano Babic
On 03/12/2012 12:25, Benoît Thébaudeau wrote:
 Hi Stefano,
 
 On Monday, December 3, 2012 10:03:22 AM, Stefano Babic wrote:
 I am thinking about if we need some kind of protection to avoid to
 destroy very easy the SOC. Running a fuse command can be much more
 dangerous as scrubbing NAND or erasing flash.

 What about to add at least a -y option when we write the fuses, in
 the
 same way we have for the nand scrub command ? This does not forbid
 to
 use the command in scripts, but it can maybe avoid to destroy the SOC
 when the command is wrong tipped on the console.

 What do you think ?
 
 That makes sense. There could be the same kind of warning confirmation
 defaulting to no that would repeat which fuse is about to be programmed.
 
 As to the value passed for fuse row programming or overriding, do you think 
 that
 it's fine to force it to be hex, or that choice should be given with '0x'? I
 don't really like implicit base selection, but it's clear in the help message,
 and it is handy for writing MAC addresses without repeating the '0x' for each
 byte.

U-boot uses as default hex as base for numbers, not decimals, and if you
use hex as default you are consistent with the rest of code.

Best regards,
Stefano

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


[U-Boot] [PATCH 0/3] EXYNOS5: MAX77686 add FDT support.

2012-12-03 Thread Rajeshwari Shinde
Add FDT support to PMIC MAX77686 chip.

This patch set is based on top of:
EXYNOS5: Add FDT support to SPI

Rajeshwari Shinde (3):
  EXYNOS5: FDT: Add compatible strings for PMIC
  EXYNOS5: Add device node for PMIC
  PMIC: MAX77686: Add FDT Support

 board/samsung/dts/exynos5250-smdk5250.dts |7 ++
 drivers/misc/pmic_max77686.c  |   34 
 include/fdtdec.h  |1 +
 lib/fdtdec.c  |1 +
 4 files changed, 38 insertions(+), 5 deletions(-)

-- 
1.7.4.4

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


[U-Boot] [PATCH 1/3] EXYNOS5: FDT: Add compatible strings for PMIC

2012-12-03 Thread Rajeshwari Shinde
Add required compatible information for PMIC

Signed-off-by: Rajeshwari Shinde rajeshwar...@samsung.com
---
 include/fdtdec.h |1 +
 lib/fdtdec.c |1 +
 2 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/include/fdtdec.h b/include/fdtdec.h
index d1279f4..976e6af 100644
--- a/include/fdtdec.h
+++ b/include/fdtdec.h
@@ -73,6 +73,7 @@ enum fdt_compat_id {
COMPAT_SAMSUNG_EXYNOS5_SOUND,   /* Exynos Sound */
COMPAT_WOLFSON_WM8994_CODEC,/* Wolfson WM8994 Sound Codec */
COMPAT_SAMSUNG_EXYNOS_SPI,  /* Exynos SPI */
+   COMPAT_MAXIM_MAX77686_PMIC, /* MAX77686 PMIC */ 
 
COMPAT_COUNT,
 };
diff --git a/lib/fdtdec.c b/lib/fdtdec.c
index 1dbb892..3a6b679 100644
--- a/lib/fdtdec.c
+++ b/lib/fdtdec.c
@@ -50,6 +50,7 @@ static const char * const compat_names[COMPAT_COUNT] = {
COMPAT(SAMSUNG_EXYNOS5_SOUND, samsung,exynos-sound),
COMPAT(WOLFSON_WM8994_CODEC, wolfson,wm8994-codec),
COMPAT(SAMSUNG_EXYNOS_SPI, samsung,exynos-spi),
+   COMPAT(MAXIM_MAX77686_PMIC,maxim,MAX77686_PMIC),
 };
 
 const char *fdtdec_get_compatible(enum fdt_compat_id id)
-- 
1.7.4.4

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


[U-Boot] [PATCH 2/3] EXYNOS5: Add device node for PMIC

2012-12-03 Thread Rajeshwari Shinde
Add device node for MAX77686

Signed-off-by: Rajeshwari Shinde rajeshwar...@samsung.com
---
 board/samsung/dts/exynos5250-smdk5250.dts |7 +++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/board/samsung/dts/exynos5250-smdk5250.dts 
b/board/samsung/dts/exynos5250-smdk5250.dts
index 4d51d98..6072a6a 100644
--- a/board/samsung/dts/exynos5250-smdk5250.dts
+++ b/board/samsung/dts/exynos5250-smdk5250.dts
@@ -70,4 +70,11 @@
compatible = wolfson,wm8994-codec;
};
};
+
+   i2c@12c6 {
+   pmic@06 {
+   reg = 0x06;
+   compatible = maxim,MAX77686_PMIC;
+   };
+   };
 };
-- 
1.7.4.4

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


[U-Boot] [PATCH 3/3] PMIC: MAX77686: Add FDT Support

2012-12-03 Thread Rajeshwari Shinde
This patch adds fdt support to MAX77686.

Signed-off-by: Rajeshwari Shinde rajeshwar...@samsung.com
---
 drivers/misc/pmic_max77686.c |   34 +-
 1 files changed, 29 insertions(+), 5 deletions(-)

diff --git a/drivers/misc/pmic_max77686.c b/drivers/misc/pmic_max77686.c
index 36f7f4d..113d038 100644
--- a/drivers/misc/pmic_max77686.c
+++ b/drivers/misc/pmic_max77686.c
@@ -22,21 +22,45 @@
  */
 
 #include common.h
+#include fdtdec.h
+#include i2c.h
 #include pmic.h
 #include max77686_pmic.h
 
+DECLARE_GLOBAL_DATA_PTR;
+
 int pmic_init(void)
 {
struct pmic *p = get_pmic();
static const char name[] = MAX77686_PMIC;
 
-   puts(Board PMIC init\n);
+   #ifdef CONFIG_OF_CONTROL
+   const void *blob = gd-fdt_blob;
+   int node, parent;
+
+   node = fdtdec_next_compatible(blob, 0, COMPAT_MAXIM_MAX77686_PMIC);
+if (node = 0) {
+debug(EXYNOS_SOUND: No node for codec in device tree\n);
+debug(node = %d\n, node);
+return -1;
+}
+   parent = fdt_parent_offset(blob, node);
+if (parent  0) {
+debug(%s: Cannot find node parent\n, __func__);
+return -1;
+}
+   p-bus = i2c_get_bus_num_fdt(parent);
+   p-hw.i2c.addr = fdtdec_get_int(blob, node,
+   reg, 0);
+   #else
+   p-bus = I2C_PMIC;
+   p-hw.i2c.addr = MAX77686_I2C_ADDR;
+   #endif
+
p-name = name;
+   p-hw.i2c.tx_num = 1;
p-interface = PMIC_I2C;
p-number_of_regs = PMIC_NUM_OF_REGS;
-   p-hw.i2c.addr = MAX77686_I2C_ADDR;
-   p-hw.i2c.tx_num = 1;
-   p-bus = I2C_PMIC;
-
+   puts(Board PMIC init MAX77686\n);
return 0;
 }
-- 
1.7.4.4

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


Re: [U-Boot] Please pull u-boot-x86.git

2012-12-03 Thread Otavio Salvador
On Sat, Dec 1, 2012 at 5:42 PM, Simon Glass s...@chromium.org wrote:

 Hi Tom,

 On Sat, Dec 1, 2012 at 10:32 AM, Tom Rini tr...@ti.com wrote:
  -BEGIN PGP SIGNED MESSAGE-
  Hash: SHA1
 
  On 12/01/12 09:38, Simon Glass wrote:
  The following changes since commit
  b8715d8def240014da5614a4f940130ec06d9ebf:
 
  Merge branch 'master' of git://git.denx.de/u-boot-fdt (2012-11-29
  06:41:56 -0700)
 
  are available in the git repository at:
 
  git://git.denx.de/u-boot-x86.git master
 
  Gabe Black (6): x86: Allow compiling out realmode/bios code x86:
  Add an fdt pointer to the global data structure x86: Add a minimal
   device tree for alex x86 x86: Add a default implementation for
  cleanup_before_linux() x86: Add a dummy implementation for
  timer_get_us x86: Include types.h explicitly in the i386 version of
  io.h
 
  Simon Glass (4): x86: coreboot: Decode additional coreboot sysinfo
   tags x86: Select stdio devices for coreboot x86: Remove coreboot
  start16 code x86: Define CONFIG_SYS_VSNPRINTF for coreboot
 
  Stefan Reinauer (4): x86: coreboot: Drop sysinfo.c x86: video: Add
   coreboot framebuffer support x86: Fix typo in pcat_timer.c x86:
  Don't spam POST80 codes with slow IO functions
 
  Vadim Bendebury (2): x86: Add CBMEM console driver for coreboot
  x86: Add console command to display CBMEM console buffer
 
  I know there's outstanding x86 work, but was all of this in some
  series that was posted before the merge window closed?  Thanks!

 This set of patches was posted between 13th and 20th October. I
 actually have more patches in my todo list on patchwork (mostly newer
 ones to 3 November, but a few very old like 4 of those in the first
 pull request this week).

 I took over as maintainer right near the end of the merge window and
 sorted out repo access 10 days ago, so I am definitely playing catch
 up. All going well I should work through the rest next week.

 While talking about patches I see that the patman patches are assigned
 to me. I will of course review them, but what should I do after that,
 as they are not x86? Also they are outside the merge window for this
 release, but will you accept 'next' pull requests at some point?


Maybe it is the time to move patman to another git repository?

patman is nice for many projects so maybe it could live outside U-Boot git?

-- 
Otavio Salvador O.S. Systems
E-mail: ota...@ossystems.com.br  http://www.ossystems.com.br
Mobile: +55 53 9981-7854  http://projetos.ossystems.com.br
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 3/7] omap_hsmmc: introduce omap_hsmmc_data struct

2012-12-03 Thread Nikita Kiryanov
Currently there's no appropriate place to store driver specific data
because the pointer that is meant for that (priv) is being used to
store the base address of mmc registers.

Introduce a new struct for storing driver specific data.

Signed-off-by: Nikita Kiryanov nik...@compulab.co.il
---
 drivers/mmc/omap_hsmmc.c |   28 ++--
 1 file changed, 18 insertions(+), 10 deletions(-)

diff --git a/drivers/mmc/omap_hsmmc.c b/drivers/mmc/omap_hsmmc.c
index 23dcebd..0fdbac3 100644
--- a/drivers/mmc/omap_hsmmc.c
+++ b/drivers/mmc/omap_hsmmc.c
@@ -38,6 +38,10 @@
 #define SYSCTL_SRC (1  25)
 #define SYSCTL_SRD (1  26)
 
+struct omap_hsmmc_data {
+   struct hsmmc *base_addr;
+};
+
 /* If we fail after 1 second wait, something is really bad */
 #define MAX_RETRY_MS   1000
 
@@ -45,6 +49,7 @@ static int mmc_read_data(struct hsmmc *mmc_base, char *buf, 
unsigned int size);
 static int mmc_write_data(struct hsmmc *mmc_base, const char *buf,
unsigned int siz);
 static struct mmc hsmmc_dev[3];
+static struct omap_hsmmc_data hsmmc_dev_data[3];
 
 #if defined(CONFIG_OMAP44XX)  defined(CONFIG_TWL6030_POWER)
 static void omap4_vmmc_pbias_config(struct mmc *mmc)
@@ -177,11 +182,12 @@ void mmc_init_stream(struct hsmmc *mmc_base)
 
 static int mmc_init_setup(struct mmc *mmc)
 {
-   struct hsmmc *mmc_base = (struct hsmmc *)mmc-priv;
+   struct hsmmc *mmc_base;
unsigned int reg_val;
unsigned int dsor;
ulong start;
 
+   mmc_base = ((struct omap_hsmmc_data *)mmc-priv)-base_addr;
mmc_board_init(mmc);
 
writel(readl(mmc_base-sysconfig) | MMC_SOFTRESET,
@@ -262,10 +268,11 @@ static void mmc_reset_controller_fsm(struct hsmmc 
*mmc_base, u32 bit)
 static int mmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd,
struct mmc_data *data)
 {
-   struct hsmmc *mmc_base = (struct hsmmc *)mmc-priv;
+   struct hsmmc *mmc_base;
unsigned int flags, mmc_stat;
ulong start;
 
+   mmc_base = ((struct omap_hsmmc_data *)mmc-priv)-base_addr;
start = get_timer(0);
while ((readl(mmc_base-pstate)  (DATI_MASK | CMDI_MASK)) != 0) {
if (get_timer(0) - start  MAX_RETRY_MS) {
@@ -489,10 +496,11 @@ static int mmc_write_data(struct hsmmc *mmc_base, const 
char *buf,
 
 static void mmc_set_ios(struct mmc *mmc)
 {
-   struct hsmmc *mmc_base = (struct hsmmc *)mmc-priv;
+   struct hsmmc *mmc_base;
unsigned int dsor = 0;
ulong start;
 
+   mmc_base = ((struct omap_hsmmc_data *)mmc-priv)-base_addr;
/* configue bus width */
switch (mmc-bus_width) {
case 8:
@@ -542,32 +550,32 @@ static void mmc_set_ios(struct mmc *mmc)
 
 int omap_mmc_init(int dev_index, uint host_caps_mask, uint f_max)
 {
-   struct mmc *mmc;
-
-   mmc = hsmmc_dev[dev_index];
+   struct mmc *mmc = hsmmc_dev[dev_index];
+   struct omap_hsmmc_data *priv_data = hsmmc_dev_data[dev_index];
 
sprintf(mmc-name, OMAP SD/MMC);
mmc-send_cmd = mmc_send_cmd;
mmc-set_ios = mmc_set_ios;
mmc-init = mmc_init_setup;
mmc-getcd = NULL;
+   mmc-priv = priv_data;
 
switch (dev_index) {
case 0:
-   mmc-priv = (struct hsmmc *)OMAP_HSMMC1_BASE;
+   priv_data-base_addr = (struct hsmmc *)OMAP_HSMMC1_BASE;
break;
 #ifdef OMAP_HSMMC2_BASE
case 1:
-   mmc-priv = (struct hsmmc *)OMAP_HSMMC2_BASE;
+   priv_data-base_addr = (struct hsmmc *)OMAP_HSMMC2_BASE;
break;
 #endif
 #ifdef OMAP_HSMMC3_BASE
case 2:
-   mmc-priv = (struct hsmmc *)OMAP_HSMMC3_BASE;
+   priv_data-base_addr = (struct hsmmc *)OMAP_HSMMC3_BASE;
break;
 #endif
default:
-   mmc-priv = (struct hsmmc *)OMAP_HSMMC1_BASE;
+   priv_data-base_addr = (struct hsmmc *)OMAP_HSMMC1_BASE;
return 1;
}
mmc-voltages = MMC_VDD_32_33 | MMC_VDD_33_34 | MMC_VDD_165_195;
-- 
1.7.10.4

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


[U-Boot] [PATCH 2/7] omap_hsmmc: fix out of bounds array access

2012-12-03 Thread Nikita Kiryanov
There are 3 MMC/SD/SDIO controllers in OMAP SoCs, but only 2 structs
are defined for devices. This leads to data being written outside of
array bounds on systems that use all 3 controllers.

Update hsmmc_dev array to the correct size.

Signed-off-by: Nikita Kiryanov nik...@compulab.co.il
---
 drivers/mmc/omap_hsmmc.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mmc/omap_hsmmc.c b/drivers/mmc/omap_hsmmc.c
index afd9b30..23dcebd 100644
--- a/drivers/mmc/omap_hsmmc.c
+++ b/drivers/mmc/omap_hsmmc.c
@@ -44,7 +44,7 @@
 static int mmc_read_data(struct hsmmc *mmc_base, char *buf, unsigned int size);
 static int mmc_write_data(struct hsmmc *mmc_base, const char *buf,
unsigned int siz);
-static struct mmc hsmmc_dev[2];
+static struct mmc hsmmc_dev[3];
 
 #if defined(CONFIG_OMAP44XX)  defined(CONFIG_TWL6030_POWER)
 static void omap4_vmmc_pbias_config(struct mmc *mmc)
-- 
1.7.10.4

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


[U-Boot] [PATCH 5/7] cm-t35: implement board specific card detect check

2012-12-03 Thread Nikita Kiryanov
Implement a card detection check for cm-t35.

Signed-off-by: Nikita Kiryanov nik...@compulab.co.il
Signed-off-by: Igor Grinberg grinb...@compulab.co.il
---
 board/cm_t35/cm_t35.c |   11 +++
 1 file changed, 11 insertions(+)

diff --git a/board/cm_t35/cm_t35.c b/board/cm_t35/cm_t35.c
index 87a18c0..50c0990 100644
--- a/board/cm_t35/cm_t35.c
+++ b/board/cm_t35/cm_t35.c
@@ -32,6 +32,7 @@
 #include netdev.h
 #include net.h
 #include i2c.h
+#include mmc.h
 #include twl4030.h
 #include linux/compiler.h
 
@@ -344,6 +345,16 @@ void set_muxconf_regs(void)
 }
 
 #ifdef CONFIG_GENERIC_MMC
+int board_mmc_getcd(struct mmc *mmc)
+{
+   u8 val;
+
+   if (twl4030_i2c_read_u8(TWL4030_CHIP_GPIO, val, TWL4030_BASEADD_GPIO))
+   return -1;
+
+   return !(val  1);
+}
+
 int board_mmc_init(bd_t *bis)
 {
return omap_mmc_init(0, 0, 0, -1);
-- 
1.7.10.4

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


[U-Boot] [PATCH 0/7] omap mmc: implement card detect and write protection

2012-12-03 Thread Nikita Kiryanov
This patchset implements card detection and write protection check for omap mmc.
The write protect implementation also adds generic code that is usable by other
mmc drivers.

The first 3 patches are preparation patches that contain general maintenance
for omap mmc driver.

This patchset depends on http://patchwork.ozlabs.org/patch/202384/

Nikita Kiryanov (7):
  omap: consolidate common mmc definitions
  omap_hsmmc: fix out of bounds array access
  omap_hsmmc: introduce omap_hsmmc_data struct
  omap_hsmmc: implement driver check for card detection
  cm-t35: implement board specific card detect check
  mmc: add support for write protection
  omap_hsmmc: add driver check for write protection

 arch/arm/cpu/armv7/am33xx/board.c   |4 +-
 arch/arm/cpu/armv7/omap-common/boot-common.c|4 +-
 arch/arm/cpu/armv7/omap3/board.c|4 +-
 arch/arm/include/asm/arch-am33xx/mmc_host_def.h |  140 +--
 arch/arm/include/asm/arch-omap3/mmc_host_def.h  |  139 +--
 arch/arm/include/asm/arch-omap4/mmc_host_def.h  |  140 +--
 arch/arm/include/asm/arch-omap5/mmc_host_def.h  |  140 +--
 arch/arm/include/asm/omap_mmc.h |  168 +++
 board/cm_t35/cm_t35.c   |   13 +-
 board/comelit/dig297/dig297.c   |3 +-
 board/corscience/tricorder/tricorder.c  |2 +-
 board/htkw/mcx/mcx.c|2 +-
 board/isee/igep0020/igep0020.c  |3 +-
 board/isee/igep0030/igep0030.c  |3 +-
 board/logicpd/am3517evm/am3517evm.c |3 +-
 board/logicpd/omap3som/omap3logic.c |2 +-
 board/logicpd/zoom1/zoom1.c |3 +-
 board/logicpd/zoom2/zoom2.c |3 +-
 board/matrix_vision/mvblx/mvblx.c   |4 +-
 board/nokia/rx51/rx51.c |4 +-
 board/overo/overo.c |3 +-
 board/pandora/pandora.c |3 +-
 board/technexion/twister/twister.c  |2 +-
 board/teejet/mt_ventoux/mt_ventoux.c|2 +-
 board/ti/am3517crane/am3517crane.c  |3 +-
 board/ti/beagle/beagle.c|3 +-
 board/ti/evm/evm.c  |3 +-
 board/ti/omap5_evm/evm.c|4 +-
 board/ti/panda/panda.c  |3 +-
 board/ti/sdp3430/sdp.c  |3 +-
 board/ti/sdp4430/sdp.c  |4 +-
 board/timll/devkit8000/devkit8000.c |3 +-
 common/cmd_mmc.c|7 +
 drivers/mmc/arm_pl180_mmci.c|1 +
 drivers/mmc/bfin_sdh.c  |1 +
 drivers/mmc/davinci_mmc.c   |1 +
 drivers/mmc/fsl_esdhc.c |1 +
 drivers/mmc/ftsdc010_esdhc.c|1 +
 drivers/mmc/gen_atmel_mci.c |1 +
 drivers/mmc/mmc.c   |   17 +++
 drivers/mmc/mmc_spi.c   |1 +
 drivers/mmc/mxcmmc.c|1 +
 drivers/mmc/mxsmmc.c|1 +
 drivers/mmc/omap_hsmmc.c|   78 +--
 drivers/mmc/sdhci.c |1 +
 drivers/mmc/sh_mmcif.c  |1 +
 drivers/mmc/tegra_mmc.c |1 +
 include/mmc.h   |2 +
 48 files changed, 324 insertions(+), 612 deletions(-)
 create mode 100644 arch/arm/include/asm/omap_mmc.h

-- 
1.7.10.4

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


[U-Boot] [PATCH 4/7] omap_hsmmc: implement driver check for card detection

2012-12-03 Thread Nikita Kiryanov
Implement driver check for card detection.

Signed-off-by: Nikita Kiryanov nik...@compulab.co.il
Signed-off-by: Igor Grinberg grinb...@compulab.co.il
---
 arch/arm/cpu/armv7/am33xx/board.c|4 +--
 arch/arm/cpu/armv7/omap-common/boot-common.c |4 +--
 arch/arm/cpu/armv7/omap3/board.c |4 +--
 arch/arm/include/asm/omap_mmc.h  |2 +-
 board/cm_t35/cm_t35.c|2 +-
 board/comelit/dig297/dig297.c|3 +--
 board/corscience/tricorder/tricorder.c   |2 +-
 board/htkw/mcx/mcx.c |2 +-
 board/isee/igep0020/igep0020.c   |3 +--
 board/isee/igep0030/igep0030.c   |3 +--
 board/logicpd/am3517evm/am3517evm.c  |3 +--
 board/logicpd/omap3som/omap3logic.c  |2 +-
 board/logicpd/zoom1/zoom1.c  |3 +--
 board/logicpd/zoom2/zoom2.c  |3 +--
 board/matrix_vision/mvblx/mvblx.c|4 +--
 board/nokia/rx51/rx51.c  |4 +--
 board/overo/overo.c  |3 +--
 board/pandora/pandora.c  |3 +--
 board/technexion/twister/twister.c   |2 +-
 board/teejet/mt_ventoux/mt_ventoux.c |2 +-
 board/ti/am3517crane/am3517crane.c   |3 +--
 board/ti/beagle/beagle.c |3 +--
 board/ti/evm/evm.c   |3 +--
 board/ti/omap5_evm/evm.c |4 +--
 board/ti/panda/panda.c   |3 +--
 board/ti/sdp3430/sdp.c   |3 +--
 board/ti/sdp4430/sdp.c   |4 +--
 board/timll/devkit8000/devkit8000.c  |3 +--
 drivers/mmc/omap_hsmmc.c |   37 --
 29 files changed, 70 insertions(+), 51 deletions(-)

diff --git a/arch/arm/cpu/armv7/am33xx/board.c 
b/arch/arm/cpu/armv7/am33xx/board.c
index e4c123c..928ff9f 100644
--- a/arch/arm/cpu/armv7/am33xx/board.c
+++ b/arch/arm/cpu/armv7/am33xx/board.c
@@ -50,11 +50,11 @@ int cpu_mmc_init(bd_t *bis)
 {
int ret;
 
-   ret = omap_mmc_init(0, 0, 0);
+   ret = omap_mmc_init(0, 0, 0, -1);
if (ret)
return ret;
 
-   return omap_mmc_init(1, 0, 0);
+   return omap_mmc_init(1, 0, 0, -1);
 }
 #endif
 
diff --git a/arch/arm/cpu/armv7/omap-common/boot-common.c 
b/arch/arm/cpu/armv7/omap-common/boot-common.c
index 0f19141..dc2ee0d 100644
--- a/arch/arm/cpu/armv7/omap-common/boot-common.c
+++ b/arch/arm/cpu/armv7/omap-common/boot-common.c
@@ -60,11 +60,11 @@ int board_mmc_init(bd_t *bis)
 {
switch (spl_boot_device()) {
case BOOT_DEVICE_MMC1:
-   omap_mmc_init(0, 0, 0);
+   omap_mmc_init(0, 0, 0, -1);
break;
case BOOT_DEVICE_MMC2:
case BOOT_DEVICE_MMC2_2:
-   omap_mmc_init(1, 0, 0);
+   omap_mmc_init(1, 0, 0, -1);
break;
}
return 0;
diff --git a/arch/arm/cpu/armv7/omap3/board.c b/arch/arm/cpu/armv7/omap3/board.c
index f3cd81a..e95cc50 100644
--- a/arch/arm/cpu/armv7/omap3/board.c
+++ b/arch/arm/cpu/armv7/omap3/board.c
@@ -98,11 +98,11 @@ int board_mmc_init(bd_t *bis)
 {
switch (spl_boot_device()) {
case BOOT_DEVICE_MMC1:
-   omap_mmc_init(0, 0, 0);
+   omap_mmc_init(0, 0, 0, -1);
break;
case BOOT_DEVICE_MMC2:
case BOOT_DEVICE_MMC2_2:
-   omap_mmc_init(1, 0, 0);
+   omap_mmc_init(1, 0, 0, -1);
break;
}
return 0;
diff --git a/arch/arm/include/asm/omap_mmc.h b/arch/arm/include/asm/omap_mmc.h
index 83726ee..8d86de1 100644
--- a/arch/arm/include/asm/omap_mmc.h
+++ b/arch/arm/include/asm/omap_mmc.h
@@ -161,7 +161,7 @@ struct hsmmc {
 #define mmc_reg_out(addr, mask, val)\
writel((readl(addr)  (~(mask))) | ((val)  (mask)), (addr))
 
-int omap_mmc_init(int dev_index, uint host_caps_mask, uint f_max);
+int omap_mmc_init(int dev_index, uint host_caps_mask, uint f_max, int cd_gpio);
 
 
 #endif /* OMAP_MMC_H_ */
diff --git a/board/cm_t35/cm_t35.c b/board/cm_t35/cm_t35.c
index 6c2e95b..87a18c0 100644
--- a/board/cm_t35/cm_t35.c
+++ b/board/cm_t35/cm_t35.c
@@ -346,7 +346,7 @@ void set_muxconf_regs(void)
 #ifdef CONFIG_GENERIC_MMC
 int board_mmc_init(bd_t *bis)
 {
-   return omap_mmc_init(0, 0, 0);
+   return omap_mmc_init(0, 0, 0, -1);
 }
 #endif
 
diff --git a/board/comelit/dig297/dig297.c b/board/comelit/dig297/dig297.c
index c6c1071..2a55cb8 100644
--- a/board/comelit/dig297/dig297.c
+++ b/board/comelit/dig297/dig297.c
@@ -147,8 +147,7 @@ void set_muxconf_regs(void)
 #ifdef CONFIG_GENERIC_MMC
 int board_mmc_init(bd_t *bis)
 {
-   omap_mmc_init(0, 0, 0);
-   return 0;
+   return omap_mmc_init(0, 0, 0, -1);
 }
 #endif
 
diff --git a/board/corscience/tricorder/tricorder.c 
b/board/corscience/tricorder/tricorder.c
index 

[U-Boot] [PATCH 7/7] omap_hsmmc: add driver check for write protection

2012-12-03 Thread Nikita Kiryanov
Add check for write protection in omap mmc driver.

Signed-off-by: Nikita Kiryanov nik...@compulab.co.il
Signed-off-by: Igor Grinberg grinb...@compulab.co.il
---
 arch/arm/cpu/armv7/am33xx/board.c|4 ++--
 arch/arm/cpu/armv7/omap-common/boot-common.c |4 ++--
 arch/arm/cpu/armv7/omap3/board.c |4 ++--
 arch/arm/include/asm/omap_mmc.h  |3 ++-
 board/cm_t35/cm_t35.c|2 +-
 board/comelit/dig297/dig297.c|2 +-
 board/corscience/tricorder/tricorder.c   |2 +-
 board/htkw/mcx/mcx.c |2 +-
 board/isee/igep0020/igep0020.c   |2 +-
 board/isee/igep0030/igep0030.c   |2 +-
 board/logicpd/am3517evm/am3517evm.c  |2 +-
 board/logicpd/omap3som/omap3logic.c  |2 +-
 board/logicpd/zoom1/zoom1.c  |2 +-
 board/logicpd/zoom2/zoom2.c  |2 +-
 board/matrix_vision/mvblx/mvblx.c|4 ++--
 board/nokia/rx51/rx51.c  |4 ++--
 board/overo/overo.c  |2 +-
 board/pandora/pandora.c  |2 +-
 board/technexion/twister/twister.c   |2 +-
 board/teejet/mt_ventoux/mt_ventoux.c |2 +-
 board/ti/am3517crane/am3517crane.c   |2 +-
 board/ti/beagle/beagle.c |2 +-
 board/ti/evm/evm.c   |2 +-
 board/ti/omap5_evm/evm.c |4 ++--
 board/ti/panda/panda.c   |2 +-
 board/ti/sdp3430/sdp.c   |2 +-
 board/ti/sdp4430/sdp.c   |4 ++--
 board/timll/devkit8000/devkit8000.c  |2 +-
 drivers/mmc/omap_hsmmc.c |   14 --
 29 files changed, 48 insertions(+), 37 deletions(-)

diff --git a/arch/arm/cpu/armv7/am33xx/board.c 
b/arch/arm/cpu/armv7/am33xx/board.c
index 928ff9f..99325c4 100644
--- a/arch/arm/cpu/armv7/am33xx/board.c
+++ b/arch/arm/cpu/armv7/am33xx/board.c
@@ -50,11 +50,11 @@ int cpu_mmc_init(bd_t *bis)
 {
int ret;
 
-   ret = omap_mmc_init(0, 0, 0, -1);
+   ret = omap_mmc_init(0, 0, 0, -1, -1);
if (ret)
return ret;
 
-   return omap_mmc_init(1, 0, 0, -1);
+   return omap_mmc_init(1, 0, 0, -1, -1);
 }
 #endif
 
diff --git a/arch/arm/cpu/armv7/omap-common/boot-common.c 
b/arch/arm/cpu/armv7/omap-common/boot-common.c
index dc2ee0d..25253b6 100644
--- a/arch/arm/cpu/armv7/omap-common/boot-common.c
+++ b/arch/arm/cpu/armv7/omap-common/boot-common.c
@@ -60,11 +60,11 @@ int board_mmc_init(bd_t *bis)
 {
switch (spl_boot_device()) {
case BOOT_DEVICE_MMC1:
-   omap_mmc_init(0, 0, 0, -1);
+   omap_mmc_init(0, 0, 0, -1, -1);
break;
case BOOT_DEVICE_MMC2:
case BOOT_DEVICE_MMC2_2:
-   omap_mmc_init(1, 0, 0, -1);
+   omap_mmc_init(1, 0, 0, -1, -1);
break;
}
return 0;
diff --git a/arch/arm/cpu/armv7/omap3/board.c b/arch/arm/cpu/armv7/omap3/board.c
index e95cc50..84e3bcb 100644
--- a/arch/arm/cpu/armv7/omap3/board.c
+++ b/arch/arm/cpu/armv7/omap3/board.c
@@ -98,11 +98,11 @@ int board_mmc_init(bd_t *bis)
 {
switch (spl_boot_device()) {
case BOOT_DEVICE_MMC1:
-   omap_mmc_init(0, 0, 0, -1);
+   omap_mmc_init(0, 0, 0, -1, -1);
break;
case BOOT_DEVICE_MMC2:
case BOOT_DEVICE_MMC2_2:
-   omap_mmc_init(1, 0, 0, -1);
+   omap_mmc_init(1, 0, 0, -1, -1);
break;
}
return 0;
diff --git a/arch/arm/include/asm/omap_mmc.h b/arch/arm/include/asm/omap_mmc.h
index 8d86de1..617e22f 100644
--- a/arch/arm/include/asm/omap_mmc.h
+++ b/arch/arm/include/asm/omap_mmc.h
@@ -161,7 +161,8 @@ struct hsmmc {
 #define mmc_reg_out(addr, mask, val)\
writel((readl(addr)  (~(mask))) | ((val)  (mask)), (addr))
 
-int omap_mmc_init(int dev_index, uint host_caps_mask, uint f_max, int cd_gpio);
+int omap_mmc_init(int dev_index, uint host_caps_mask, uint f_max, int cd_gpio,
+   int wp_gpio);
 
 
 #endif /* OMAP_MMC_H_ */
diff --git a/board/cm_t35/cm_t35.c b/board/cm_t35/cm_t35.c
index 50c0990..6b3617c 100644
--- a/board/cm_t35/cm_t35.c
+++ b/board/cm_t35/cm_t35.c
@@ -357,7 +357,7 @@ int board_mmc_getcd(struct mmc *mmc)
 
 int board_mmc_init(bd_t *bis)
 {
-   return omap_mmc_init(0, 0, 0, -1);
+   return omap_mmc_init(0, 0, 0, -1, 59);
 }
 #endif
 
diff --git a/board/comelit/dig297/dig297.c b/board/comelit/dig297/dig297.c
index 2a55cb8..2dca275 100644
--- a/board/comelit/dig297/dig297.c
+++ b/board/comelit/dig297/dig297.c
@@ -147,7 +147,7 @@ void set_muxconf_regs(void)
 #ifdef CONFIG_GENERIC_MMC
 int board_mmc_init(bd_t *bis)
 {
-   return omap_mmc_init(0, 0, 0, -1);
+   return omap_mmc_init(0, 0, 0, -1, -1);
 }
 #endif
 
diff --git 

[U-Boot] [PATCH 1/7] omap: consolidate common mmc definitions

2012-12-03 Thread Nikita Kiryanov
The various mmc_host_def.h files are almost identical.
Reduce code duplication by moving the similar definitions to a common
header file.

Signed-off-by: Nikita Kiryanov nik...@compulab.co.il
Signed-off-by: Igor Grinberg grinb...@compulab.co.il
---
 arch/arm/include/asm/arch-am33xx/mmc_host_def.h |  140 +--
 arch/arm/include/asm/arch-omap3/mmc_host_def.h  |  139 +--
 arch/arm/include/asm/arch-omap4/mmc_host_def.h  |  140 +--
 arch/arm/include/asm/arch-omap5/mmc_host_def.h  |  140 +--
 arch/arm/include/asm/omap_mmc.h |  167 +++
 5 files changed, 175 insertions(+), 551 deletions(-)
 create mode 100644 arch/arm/include/asm/omap_mmc.h

diff --git a/arch/arm/include/asm/arch-am33xx/mmc_host_def.h 
b/arch/arm/include/asm/arch-am33xx/mmc_host_def.h
index 1f597c0..33c9c83 100644
--- a/arch/arm/include/asm/arch-am33xx/mmc_host_def.h
+++ b/arch/arm/include/asm/arch-am33xx/mmc_host_def.h
@@ -16,148 +16,12 @@
 #ifndef MMC_HOST_DEF_H
 #define MMC_HOST_DEF_H
 
+#include asm/omap_mmc.h
+
 /*
  * OMAP HSMMC register definitions
  */
 #define OMAP_HSMMC1_BASE   0x48060100
 #define OMAP_HSMMC2_BASE   0x481D8100
 
-typedef struct hsmmc {
-   unsigned char res1[0x10];
-   unsigned int sysconfig; /* 0x10 */
-   unsigned int sysstatus; /* 0x14 */
-   unsigned char res2[0x14];
-   unsigned int con;   /* 0x2C */
-   unsigned char res3[0xD4];
-   unsigned int blk;   /* 0x104 */
-   unsigned int arg;   /* 0x108 */
-   unsigned int cmd;   /* 0x10C */
-   unsigned int rsp10; /* 0x110 */
-   unsigned int rsp32; /* 0x114 */
-   unsigned int rsp54; /* 0x118 */
-   unsigned int rsp76; /* 0x11C */
-   unsigned int data;  /* 0x120 */
-   unsigned int pstate;/* 0x124 */
-   unsigned int hctl;  /* 0x128 */
-   unsigned int sysctl;/* 0x12C */
-   unsigned int stat;  /* 0x130 */
-   unsigned int ie;/* 0x134 */
-   unsigned char res4[0x8];
-   unsigned int capa;  /* 0x140 */
-} hsmmc_t;
-
-/*
- * OMAP HS MMC Bit definitions
- */
-#define MMC_SOFTRESET  (0x1  1)
-#define RESETDONE  (0x1  0)
-#define NOOPENDRAIN(0x0  0)
-#define OPENDRAIN  (0x1  0)
-#define OD (0x1  0)
-#define INIT_NOINIT(0x0  1)
-#define INIT_INITSTREAM(0x1  1)
-#define HR_NOHOSTRESP  (0x0  2)
-#define STR_BLOCK  (0x0  3)
-#define MODE_FUNC  (0x0  4)
-#define DW8_1_4BITMODE (0x0  5)
-#define MIT_CTO(0x0  6)
-#define CDP_ACTIVEHIGH (0x0  7)
-#define WPP_ACTIVEHIGH (0x0  8)
-#define RESERVED_MASK  (0x3  9)
-#define CTPL_MMC_SD(0x0  11)
-#define BLEN_512BYTESLEN   (0x200  0)
-#define NBLK_STPCNT(0x0  16)
-#define DE_DISABLE (0x0  0)
-#define BCE_DISABLE(0x0  1)
-#define BCE_ENABLE (0x1  1)
-#define ACEN_DISABLE   (0x0  2)
-#define DDIR_OFFSET(4)
-#define DDIR_MASK  (0x1  4)
-#define DDIR_WRITE (0x0  4)
-#define DDIR_READ  (0x1  4)
-#define MSBS_SGLEBLK   (0x0  5)
-#define MSBS_MULTIBLK  (0x1  5)
-#define RSP_TYPE_OFFSET(16)
-#define RSP_TYPE_MASK  (0x3  16)
-#define RSP_TYPE_NORSP (0x0  16)
-#define RSP_TYPE_LGHT136   (0x1  16)
-#define RSP_TYPE_LGHT48(0x2  16)
-#define RSP_TYPE_LGHT48B   (0x3  16)
-#define CCCE_NOCHECK   (0x0  19)
-#define CCCE_CHECK (0x1  19)
-#define CICE_NOCHECK   (0x0  20)
-#define CICE_CHECK (0x1  20)
-#define DP_OFFSET  (21)
-#define DP_MASK(0x1  21)
-#define DP_NO_DATA (0x0  21)
-#define DP_DATA(0x1  21)
-#define CMD_TYPE_NORMAL(0x0  22)
-#define INDEX_OFFSET   (24)
-#define INDEX_MASK (0x3f  24)
-#define INDEX(i)   (i  24)
-#define DATI_MASK  (0x1  1)
-#define CMDI_MASK  (0x1  0)
-#define DTW_1_BITMODE  (0x0  1)
-#define DTW_4_BITMODE  (0x1  1)
-#define DTW_8_BITMODE   (0x1  5) /* CON[DW8]*/
-#define SDBP_PWROFF(0x0  8)
-#define SDBP_PWRON (0x1  

Re: [U-Boot] [PATCH 05/10] pxe: use bootz instead of bootm when enabled

2012-12-03 Thread Wolfgang Denk
Dear Rob Herring,

In message 1354503629-25621-6-git-send-email-robherri...@gmail.com you wrote:
 From: Rob Herring rob.herr...@calxeda.com
 
 Standard pxelinux servers would use zImage rather than u-boot image
 format, so use bootz instead of bootm if enabled.

Why would this be the case?  We should encourage the use of a
checksum-protected image format, i. e. the default setting should be
for FIT images, followed by legacy U-Boot images, and fall back on
archaic formats like zImage only when there is really no other way.


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
On a clear disk you can seek forever.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] fix linker generated lists on non-C locales

2012-12-03 Thread Wolfgang Denk
Dear Marek Vasut,

In message 201212030457.11755.ma...@denx.de you wrote:
 
  IMHO it would make more sense to just make sure that LC_ALL is not set
  at all, i. e. to explicitly unset it.
 
 Hrm ... shall we introduce a patch that sanitizes the env then? Maybe we can 
 fix 
 the LDFLAGS/yocto issue that way too?

Except for LC_ALL, what else do you have in mind?


I would leave out the LDFLAGS thing here; it is unrelated, and it
bites also for all older versions of U-Boot, and we cannot fix the
past.

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
8 Catfish   = 1 Octo-puss
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Please pull u-boot-x86.git

2012-12-03 Thread Simon Glass
Hi Otavio,

On Mon, Dec 3, 2012 at 4:12 AM, Otavio Salvador ota...@ossystems.com.br wrote:
[snip]

 Maybe it is the time to move patman to another git repository?

 patman is nice for many projects so maybe it could live outside U-Boot git?

Maybe one day, but we still have a number of things to sort out - e.g.
the threading issue Wolfgang raised. Also I don't think patman is
widely used even in U-Boot, and having it here promotes its use. What
other projects actually use it at this stage? (yes I see Doug's
patches aimed at supporting Linux better).

Regards,
Simon


 --
 Otavio Salvador O.S. Systems
 E-mail: ota...@ossystems.com.br  http://www.ossystems.com.br
 Mobile: +55 53 9981-7854  http://projetos.ossystems.com.br

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


[U-Boot] [PATCH 0/2] EXYNOS5: Add VBus init required for USB

2012-12-03 Thread Rajeshwari Shinde
This patch sets adds pinmux for USB and function to init VBus.

Rajeshwari Shinde (2):
  EXYNOS5: Add pinmux for VBus
  SMDK5250: Enable VBus for USB

 arch/arm/cpu/armv7/exynos/pinmux.c|   10 ++
 arch/arm/include/asm/arch-exynos/periph.h |1 +
 board/samsung/smdk5250/smdk5250.c |   17 +
 3 files changed, 28 insertions(+), 0 deletions(-)

-- 
1.7.4.4

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


[U-Boot] [PATCH 1/2] EXYNOS5: Add pinmux for VBus

2012-12-03 Thread Rajeshwari Shinde
This patch sets pinmux for VBus of USB.

Signed-off-by: Vivek Gautam gautam.vi...@samsung.com
Signed-off-by: Rajeshwari Shinde rajeshwar...@samsung.com
---
 arch/arm/cpu/armv7/exynos/pinmux.c|   10 ++
 arch/arm/include/asm/arch-exynos/periph.h |1 +
 2 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/arch/arm/cpu/armv7/exynos/pinmux.c 
b/arch/arm/cpu/armv7/exynos/pinmux.c
index f9f6911..d65ffc7 100644
--- a/arch/arm/cpu/armv7/exynos/pinmux.c
+++ b/arch/arm/cpu/armv7/exynos/pinmux.c
@@ -285,6 +285,14 @@ void exynos5_spi_config(int peripheral)
}
 }
 
+void exynos5_usb20_config(void)
+{
+   struct exynos5_gpio_part1 *gpio1 =
+   (struct exynos5_gpio_part1 *) samsung_get_base_gpio_part1();
+   /* Enable VBUS power switch */
+   s5p_gpio_direction_output(gpio1-x2,6, 1);
+}
+
 static int exynos5_pinmux_config(int peripheral, int flags)
 {
switch (peripheral) {
@@ -322,6 +330,8 @@ static int exynos5_pinmux_config(int peripheral, int flags)
case PERIPH_ID_SPI4:
exynos5_spi_config(peripheral);
break;
+   case PERIPH_ID_USB20:
+   exynos5_usb20_config();
default:
debug(%s: invalid peripheral %d, __func__, peripheral);
return -1;
diff --git a/arch/arm/include/asm/arch-exynos/periph.h 
b/arch/arm/include/asm/arch-exynos/periph.h
index 783b77c..84593f6 100644
--- a/arch/arm/include/asm/arch-exynos/periph.h
+++ b/arch/arm/include/asm/arch-exynos/periph.h
@@ -46,6 +46,7 @@ enum periph_id {
PERIPH_ID_SPI0 = 68,
PERIPH_ID_SPI1,
PERIPH_ID_SPI2,
+   PERIPH_ID_USB20,
PERIPH_ID_SDMMC0 = 75,
PERIPH_ID_SDMMC1,
PERIPH_ID_SDMMC2,
-- 
1.7.4.4

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


[U-Boot] [PATCH 2/2] SMDK5250: Enable VBus for USB

2012-12-03 Thread Rajeshwari Shinde
This patch enables Vbus required for USB.

Signed-off-by: Vivek Gautam gautam.vi...@samsung.com
Signed-off-by: Rajeshwari Shinde rajeshwar...@samsung.com
---
 board/samsung/smdk5250/smdk5250.c |   17 +
 1 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/board/samsung/smdk5250/smdk5250.c 
b/board/samsung/smdk5250/smdk5250.c
index 5ebc665..fb4c70e 100644
--- a/board/samsung/smdk5250/smdk5250.c
+++ b/board/samsung/smdk5250/smdk5250.c
@@ -63,6 +63,19 @@ void board_poll_devices(void)
 #endif
 }
 
+int board_usb_vbus_init(void)
+{
+   int err;
+   err = exynos_pinmux_config(PERIPH_ID_USB20, PINMUX_FLAG_NONE);
+   if (err) {
+   debug(VBUS not configured\n);
+   return err;
+   }
+   /* VBUS turn ON time */
+   mdelay(3);
+return 0;
+}
+
 int board_init(void)
 {
gd-bd-bi_boot_params = (PHYS_SDRAM_1 + 0x100UL);
@@ -80,6 +93,10 @@ int board_init(void)
 #ifdef CONFIG_EXYNOS_SPI
spi_init();
 #endif
+
+#ifdef CONFIG_USB_EHCI_EXYNOS
+   board_usb_vbus_init();
+#endif
return 0;
 }
 
-- 
1.7.4.4

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


[U-Boot] [PATCH] Change e-mail address of Luka Perkov

2012-12-03 Thread Luka Perkov
Change e-mail address of Luka Perkov.

Signed-off-by: Luka Perkov l...@openwrt.org
CC: Luka Perkov ub...@lukaperkov.net
---

 MAINTAINERS | 2 +-
 board/iomega/iconnect/iconnect.c| 2 +-
 board/iomega/iconnect/iconnect.h| 2 +-
 board/iomega/iconnect/kwbimage.cfg  | 2 +-
 board/raidsonic/ib62x0/ib62x0.c | 2 +-
 board/raidsonic/ib62x0/ib62x0.h | 2 +-
 board/raidsonic/ib62x0/kwbimage.cfg | 2 +-
 doc/kwboot.1| 2 +-
 include/configs/ib62x0.h| 2 +-
 include/configs/iconnect.h  | 2 +-
 10 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index c430574..aa8bfb2 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -799,7 +799,7 @@ Veli-Pekka Peltola veli-pekka.pelt...@bluegiga.com
 
apx4devkit  i.MX28
 
-Luka Perkov ub...@lukaperkov.net
+Luka Perkov l...@openwrt.org
 
ib62x0  ARM926EJS
iconnectARM926EJS
diff --git a/board/iomega/iconnect/iconnect.c b/board/iomega/iconnect/iconnect.c
index 6ee2128..8cfb4e6 100644
--- a/board/iomega/iconnect/iconnect.c
+++ b/board/iomega/iconnect/iconnect.c
@@ -1,7 +1,7 @@
 /*
  * Copyright (C) 2009-2012
  * Wojciech Dubowik wojciech.dubo...@neratec.com
- * Luka Perkov ub...@lukaperkov.net
+ * Luka Perkov l...@openwrt.org
  *
  * See file CREDITS for list of people who contributed to this
  * project.
diff --git a/board/iomega/iconnect/iconnect.h b/board/iomega/iconnect/iconnect.h
index 2fb3e5e..8b6fe1b 100644
--- a/board/iomega/iconnect/iconnect.h
+++ b/board/iomega/iconnect/iconnect.h
@@ -1,7 +1,7 @@
 /*
  * Copyright (C) 2009-2012
  * Wojciech Dubowik wojciech.dubo...@neratec.com
- * Luka Perkov ub...@lukaperkov.net
+ * Luka Perkov l...@openwrt.org
  *
  * See file CREDITS for list of people who contributed to this
  * project.
diff --git a/board/iomega/iconnect/kwbimage.cfg 
b/board/iomega/iconnect/kwbimage.cfg
index 6c9dfe3..4b64dab 100644
--- a/board/iomega/iconnect/kwbimage.cfg
+++ b/board/iomega/iconnect/kwbimage.cfg
@@ -1,7 +1,7 @@
 #
 # (C) Copyright 2009-2012
 # Wojciech Dubowik wojciech.dubo...@neratec.com
-# Luka Perkov ub...@lukaperkov.net
+# Luka Perkov l...@openwrt.org
 #
 # See file CREDITS for list of people who contributed to this
 # project.
diff --git a/board/raidsonic/ib62x0/ib62x0.c b/board/raidsonic/ib62x0/ib62x0.c
index b7e6e41..5f0f396 100644
--- a/board/raidsonic/ib62x0/ib62x0.c
+++ b/board/raidsonic/ib62x0/ib62x0.c
@@ -1,7 +1,7 @@
 /*
  * Copyright (C) 2011-2012
  * Gerald Kerma drea...@doukki.net
- * Luka Perkov ub...@lukaperkov.net
+ * Luka Perkov l...@openwrt.org
  * Simon Baatz gmbno...@gmail.com
  *
  * See file CREDITS for list of people who contributed to this
diff --git a/board/raidsonic/ib62x0/ib62x0.h b/board/raidsonic/ib62x0/ib62x0.h
index 0118c2b..3315696 100644
--- a/board/raidsonic/ib62x0/ib62x0.h
+++ b/board/raidsonic/ib62x0/ib62x0.h
@@ -2,7 +2,7 @@
  * Copyright (C) 2011-2012
  * Gerald Kerma drea...@doukki.net
  * Simon Baatz gmbno...@gmail.com
- * Luka Perkov ub...@lukaperkov.net
+ * Luka Perkov l...@openwrt.org
  *
  * See file CREDITS for list of people who contributed to this
  * project.
diff --git a/board/raidsonic/ib62x0/kwbimage.cfg 
b/board/raidsonic/ib62x0/kwbimage.cfg
index bd594eb..bade627 100644
--- a/board/raidsonic/ib62x0/kwbimage.cfg
+++ b/board/raidsonic/ib62x0/kwbimage.cfg
@@ -2,7 +2,7 @@
 # Copyright (C) 2011-2012
 # Gerald Kerma drea...@doukki.net
 # Simon Baatz gmbno...@gmail.com
-# Luka Perkov ub...@lukaperkov.net
+# Luka Perkov l...@openwrt.org
 #
 # See file CREDITS for list of people who contributed to this
 # project.
diff --git a/doc/kwboot.1 b/doc/kwboot.1
index ed08398..25fe69a 100644
--- a/doc/kwboot.1
+++ b/doc/kwboot.1
@@ -79,6 +79,6 @@ Adjust the baud rate on \fITTY\fP. Default rate is 115200.
 
 Daniel Stodden daniel.stod...@gmail.com
 .br
-Luka Perkov ub...@lukaperkov.net
+Luka Perkov l...@openwrt.org
 .br
 David Purdy david.c.pu...@gmail.com
diff --git a/include/configs/ib62x0.h b/include/configs/ib62x0.h
index 85856f2..f646ae5 100644
--- a/include/configs/ib62x0.h
+++ b/include/configs/ib62x0.h
@@ -1,7 +1,7 @@
 /*
  * Copyright (C) 2011-2012
  * Gerald Kerma drea...@doukki.net
- * Luka Perkov ub...@lukaperkov.net
+ * Luka Perkov l...@openwrt.org
  *
  * See file CREDITS for list of people who contributed to this
  * project.
diff --git a/include/configs/iconnect.h b/include/configs/iconnect.h
index 2b523c9..ba57849 100644
--- a/include/configs/iconnect.h
+++ b/include/configs/iconnect.h
@@ -1,7 +1,7 @@
 /*
  * (C) Copyright 2009-2012
  * Wojciech Dubowik wojciech.dubo...@neratec.com
- * Luka Perkov ub...@lukaperkov.net
+ * Luka Perkov l...@openwrt.org
  *
  * See file CREDITS for list of people who contributed to this
  * project.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 0/3] EXYNOS5: Add FDT support for USB

2012-12-03 Thread Rajeshwari Shinde
This patch set adds FDT support for USB device.

Rajeshwari Shinde (3):
  EHCI: Exynos: Add fdt support
  EXYNOS5: Add device node for USB.
  EXYNOS5: FDT: Add compatible strings for USB

 arch/arm/dts/exynos5250.dtsi   |6 
 drivers/usb/host/ehci-exynos.c |   57 ---
 include/fdtdec.h   |1 +
 lib/fdtdec.c   |1 +
 4 files changed, 60 insertions(+), 5 deletions(-)

-- 
1.7.4.4

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


[U-Boot] [PATCH 1/3] EHCI: Exynos: Add fdt support

2012-12-03 Thread Rajeshwari Shinde
Adding fdt support to ehci-exynos in order to parse
register base addresses from the device node.

Signed-off-by: Vivek Gautam gautam.vi...@samsung.com
---
 drivers/usb/host/ehci-exynos.c |   57 ---
 1 files changed, 52 insertions(+), 5 deletions(-)

diff --git a/drivers/usb/host/ehci-exynos.c b/drivers/usb/host/ehci-exynos.c
index 9f0ed06..f4c873f 100644
--- a/drivers/usb/host/ehci-exynos.c
+++ b/drivers/usb/host/ehci-exynos.c
@@ -21,6 +21,8 @@
  */
 
 #include common.h
+#include fdtdec.h
+#include libfdt.h
 #include usb.h
 #include asm/arch/cpu.h
 #include asm/arch/ehci.h
@@ -28,6 +30,9 @@
 #include asm/arch/power.h
 #include ehci.h
 
+/* Declare global data pointer */
+DECLARE_GLOBAL_DATA_PTR;
+
 /* Setup the EHCI host controller. */
 static void setup_usb_phy(struct exynos_usb_phy *usb)
 {
@@ -86,12 +91,38 @@ static void reset_usb_phy(struct exynos_usb_phy *usb)
  */
 int ehci_hcd_init(int index, struct ehci_hccr **hccr, struct ehci_hcor **hcor)
 {
-   struct exynos_usb_phy *usb;
+   struct exynos_usb_phy *usb = NULL;
+   unsigned int *hcd = NULL;
+   unsigned int node;
+
+   node = fdtdec_next_compatible(gd-fdt_blob, 0,
+   COMPAT_SAMSUNG_EXYNOS_EHCI);
+   if (node = 0) {
+   debug(EHCI: Can't get device tree node for ehci\n);
+   return -1;
+   }
+
+   /*
+* Get the base address for usbphy from the device node
+*/
+   usb = (struct exynos_usb_phy *)fdtdec_get_addr(gd-fdt_blob, node, 
phyreg);
+   if (usb == NULL) {
+   debug(Can't get the usbphy register address\n);
+   return -1;
+   }
 
-   usb = (struct exynos_usb_phy *)samsung_get_base_usb_phy();
setup_usb_phy(usb);
 
-   *hccr = (struct ehci_hccr *)samsung_get_base_usb_ehci();
+   /*
+* Get the base address for XHCI controller from the device node
+*/
+   hcd = (unsigned int *)fdtdec_get_addr(gd-fdt_blob, node, reg);
+   if (hcd == NULL) {
+   debug(Can't get the XHCI registere address\n);
+   return -1;
+   }
+
+   *hccr = (struct ehci_hccr *)hcd;
*hcor = (struct ehci_hcor *)((uint32_t) *hccr
+ HC_LENGTH(ehci_readl((*hccr)-cr_capbase)));
 
@@ -108,9 +139,25 @@ int ehci_hcd_init(int index, struct ehci_hccr **hccr, 
struct ehci_hcor **hcor)
  */
 int ehci_hcd_stop(int index)
 {
-   struct exynos_usb_phy *usb;
+   struct exynos_usb_phy *usb = NULL;
+   unsigned int node;
+
+   node = fdtdec_next_compatible(gd-fdt_blob, 0,
+   COMPAT_SAMSUNG_EXYNOS_EHCI);
+   if (node = 0) {
+   debug(EHCI: Can't get device tree node for ehci\n);
+   return -1;
+   }
+
+   /*
+* Get the base address for usbphy from the device node
+*/
+   usb = (struct exynos_usb_phy *)fdtdec_get_addr(gd-fdt_blob, node, 
phyreg);
+   if (usb == NULL) {
+   debug(Can't get the usbphy register address\n);
+   return -1;
+   }
 
-   usb = (struct exynos_usb_phy *)samsung_get_base_usb_phy();
reset_usb_phy(usb);
 
return 0;
-- 
1.7.4.4

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


[U-Boot] [PATCH 2/3] EXYNOS5: Add device node for USB.

2012-12-03 Thread Rajeshwari Shinde
This patch adds the device node required for USB

Signed-off-by: Vivek Gautam gautam.vi...@samsung.com
---
 arch/arm/dts/exynos5250.dtsi |6 ++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/arch/arm/dts/exynos5250.dtsi b/arch/arm/dts/exynos5250.dtsi
index e8ecf3f..dd2c6ac 100644
--- a/arch/arm/dts/exynos5250.dtsi
+++ b/arch/arm/dts/exynos5250.dtsi
@@ -127,4 +127,10 @@
clock-frequency = 5000;
interrupts = 0 70 0;
 };
+
+   ehci@1211 {
+   compatible = samsung,exynos-ehci;
+   reg = 0x1211 0x100;
+   phyreg = 0x1213;
+   };
 };
-- 
1.7.4.4

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


[U-Boot] [PATCH 3/3] EXYNOS5: FDT: Add compatible strings for USB

2012-12-03 Thread Rajeshwari Shinde
Add required compatible information for USB

Signed-off-by: Vivek Gautam gautam.vi...@samsung.com
---
 include/fdtdec.h |1 +
 lib/fdtdec.c |1 +
 2 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/include/fdtdec.h b/include/fdtdec.h
index 976e6af..09d1d38 100644
--- a/include/fdtdec.h
+++ b/include/fdtdec.h
@@ -74,6 +74,7 @@ enum fdt_compat_id {
COMPAT_WOLFSON_WM8994_CODEC,/* Wolfson WM8994 Sound Codec */
COMPAT_SAMSUNG_EXYNOS_SPI,  /* Exynos SPI */
COMPAT_MAXIM_MAX77686_PMIC, /* MAX77686 PMIC */ 
+   COMPAT_SAMSUNG_EXYNOS_EHCI, /* Exynos EHCI controller */
 
COMPAT_COUNT,
 };
diff --git a/lib/fdtdec.c b/lib/fdtdec.c
index 3a6b679..5666d89 100644
--- a/lib/fdtdec.c
+++ b/lib/fdtdec.c
@@ -51,6 +51,7 @@ static const char * const compat_names[COMPAT_COUNT] = {
COMPAT(WOLFSON_WM8994_CODEC, wolfson,wm8994-codec),
COMPAT(SAMSUNG_EXYNOS_SPI, samsung,exynos-spi),
COMPAT(MAXIM_MAX77686_PMIC,maxim,MAX77686_PMIC),
+   COMPAT(SAMSUNG_EXYNOS_EHCI, samsung,exynos-ehci),
 };
 
 const char *fdtdec_get_compatible(enum fdt_compat_id id)
-- 
1.7.4.4

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


Re: [U-Boot] [PATCH 1/2] EXYNOS5: Add pinmux for VBus

2012-12-03 Thread Kyungmin Park
On Mon, Dec 3, 2012 at 10:18 PM, Rajeshwari Shinde
rajeshwar...@samsung.com wrote:
 This patch sets pinmux for VBus of USB.

 Signed-off-by: Vivek Gautam gautam.vi...@samsung.com
 Signed-off-by: Rajeshwari Shinde rajeshwar...@samsung.com
 ---
  arch/arm/cpu/armv7/exynos/pinmux.c|   10 ++
  arch/arm/include/asm/arch-exynos/periph.h |1 +
  2 files changed, 11 insertions(+), 0 deletions(-)

 diff --git a/arch/arm/cpu/armv7/exynos/pinmux.c 
 b/arch/arm/cpu/armv7/exynos/pinmux.c
 index f9f6911..d65ffc7 100644
 --- a/arch/arm/cpu/armv7/exynos/pinmux.c
 +++ b/arch/arm/cpu/armv7/exynos/pinmux.c
 @@ -285,6 +285,14 @@ void exynos5_spi_config(int peripheral)
 }
  }

 +void exynos5_usb20_config(void)
 +{
 +   struct exynos5_gpio_part1 *gpio1 =
 +   (struct exynos5_gpio_part1 *) samsung_get_base_gpio_part1();
 +   /* Enable VBUS power switch */
 +   s5p_gpio_direction_output(gpio1-x2,6, 1);
it seems to be board specific GPIO value. doesn't it?

Thank you,
Kyungmin Park
 +}
 +
  static int exynos5_pinmux_config(int peripheral, int flags)
  {
 switch (peripheral) {
 @@ -322,6 +330,8 @@ static int exynos5_pinmux_config(int peripheral, int 
 flags)
 case PERIPH_ID_SPI4:
 exynos5_spi_config(peripheral);
 break;
 +   case PERIPH_ID_USB20:
 +   exynos5_usb20_config();
 default:
 debug(%s: invalid peripheral %d, __func__, peripheral);
 return -1;
 diff --git a/arch/arm/include/asm/arch-exynos/periph.h 
 b/arch/arm/include/asm/arch-exynos/periph.h
 index 783b77c..84593f6 100644
 --- a/arch/arm/include/asm/arch-exynos/periph.h
 +++ b/arch/arm/include/asm/arch-exynos/periph.h
 @@ -46,6 +46,7 @@ enum periph_id {
 PERIPH_ID_SPI0 = 68,
 PERIPH_ID_SPI1,
 PERIPH_ID_SPI2,
 +   PERIPH_ID_USB20,
 PERIPH_ID_SDMMC0 = 75,
 PERIPH_ID_SDMMC1,
 PERIPH_ID_SDMMC2,
 --
 1.7.4.4

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


Re: [U-Boot] [PATCH 1/2] ARM: add wfi assembly macro

2012-12-03 Thread Rob Herring


On 12/02/2012 10:58 PM, Marek Vasut wrote:
 Dear Rob Herring,
 
 From: Rob Herring rob.herr...@calxeda.com

 Since wfi instruction is only available on ARMv7, add a conditional
 macro for it.

 Signed-off-by: Rob Herring rob.herr...@calxeda.com
 ---
  arch/arm/include/asm/system.h |6 ++
  1 file changed, 6 insertions(+)

 diff --git a/arch/arm/include/asm/system.h b/arch/arm/include/asm/system.h
 index 2b28a26..2f6aecd 100644
 --- a/arch/arm/include/asm/system.h
 +++ b/arch/arm/include/asm/system.h
 @@ -61,6 +61,12 @@

  #define nop() __asm__ __volatile__(mov\tr0,r0\t@ nop\n\t);

 +#ifdef __ARM_ARCH_7A__
 +#define wfi() __asm__ __volatile__ (wfi : : : memory)
 +#else
 +#define wfi()
 +#endif
 
 Won't this break other (non-arm) systems? Moreover, maybe you can make this 
 an 
 (inline) function instead?

How? It is in an ARM specific header and empty on anything but ARMv7
enabled compiler. This follows the kernel implementation and the nop above.

Rob

 
  static inline unsigned int get_cr(void)
  {
  unsigned int val;
 
 Best regards,
 Marek Vasut
 
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/2] EXYNOS5: Add pinmux for VBus

2012-12-03 Thread Rajeshwari Birje
Hi Kyungmin Park,

On Mon, Dec 3, 2012 at 7:00 PM, Kyungmin Park kmp...@infradead.org wrote:
 On Mon, Dec 3, 2012 at 10:18 PM, Rajeshwari Shinde
 rajeshwar...@samsung.com wrote:
 This patch sets pinmux for VBus of USB.

 Signed-off-by: Vivek Gautam gautam.vi...@samsung.com
 Signed-off-by: Rajeshwari Shinde rajeshwar...@samsung.com
 ---
  arch/arm/cpu/armv7/exynos/pinmux.c|   10 ++
  arch/arm/include/asm/arch-exynos/periph.h |1 +
  2 files changed, 11 insertions(+), 0 deletions(-)

 diff --git a/arch/arm/cpu/armv7/exynos/pinmux.c 
 b/arch/arm/cpu/armv7/exynos/pinmux.c
 index f9f6911..d65ffc7 100644
 --- a/arch/arm/cpu/armv7/exynos/pinmux.c
 +++ b/arch/arm/cpu/armv7/exynos/pinmux.c
 @@ -285,6 +285,14 @@ void exynos5_spi_config(int peripheral)
 }
  }

 +void exynos5_usb20_config(void)
 +{
 +   struct exynos5_gpio_part1 *gpio1 =
 +   (struct exynos5_gpio_part1 *) samsung_get_base_gpio_part1();
 +   /* Enable VBUS power switch */
 +   s5p_gpio_direction_output(gpio1-x2,6, 1);
 it seems to be board specific GPIO value. doesn't it?
Yes it is smdk5250 specific.

 Thank you,
 Kyungmin Park
 +}
 +
  static int exynos5_pinmux_config(int peripheral, int flags)
  {
 switch (peripheral) {
 @@ -322,6 +330,8 @@ static int exynos5_pinmux_config(int peripheral, int 
 flags)
 case PERIPH_ID_SPI4:
 exynos5_spi_config(peripheral);
 break;
 +   case PERIPH_ID_USB20:
 +   exynos5_usb20_config();
 default:
 debug(%s: invalid peripheral %d, __func__, peripheral);
 return -1;
 diff --git a/arch/arm/include/asm/arch-exynos/periph.h 
 b/arch/arm/include/asm/arch-exynos/periph.h
 index 783b77c..84593f6 100644
 --- a/arch/arm/include/asm/arch-exynos/periph.h
 +++ b/arch/arm/include/asm/arch-exynos/periph.h
 @@ -46,6 +46,7 @@ enum periph_id {
 PERIPH_ID_SPI0 = 68,
 PERIPH_ID_SPI1,
 PERIPH_ID_SPI2,
 +   PERIPH_ID_USB20,
 PERIPH_ID_SDMMC0 = 75,
 PERIPH_ID_SDMMC1,
 PERIPH_ID_SDMMC2,
 --
 1.7.4.4

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

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


Re: [U-Boot] [PATCH v2] include/linux/byteorder: Always defines __fswab64, __swab64p and __swab64s

2012-12-03 Thread Tom Rini
On Thu, Nov 15, 2012 at 04:35:26PM +0900, Nobuhiro Iwamatsu wrote:

 When __BYTEORDER_HAS_U64__ is not defined, we got warning following:
 
 -
 /tmp/include/linux/byteorder/little_endian.h: In function 
 ???__cpu_to_be64p???:
 /tmp/include/linux/byteorder/little_endian.h:71:2: warning: implicit 
 declaration of function ???__swab64p???
   [-Wimplicit-function-declaration]
 -
 
 Usually, __arch__swab64* required for __fswab64,  __swab64p and __swab64s
 is defined.  Therefore, __BYTEORDER_HAS_U64__ is unnecessary.
 This removes __BYTEORDER_HAS_U64__.
 
 Signed-off-by: Nobuhiro Iwamatsu nobuhiro.iwamatsu...@renesas.com
 CC: Kim Phillips kim.phill...@freescale.com
 ---
 v2: Fix mail address.
 
  include/linux/byteorder/swab.h |2 --
  1 file changed, 2 deletions(-)
 
 diff --git a/include/linux/byteorder/swab.h b/include/linux/byteorder/swab.h
 index bb4a046..4334fa7 100644
 --- a/include/linux/byteorder/swab.h
 +++ b/include/linux/byteorder/swab.h
 @@ -122,7 +122,6 @@ static __inline__ void __swab32s(__u32 *addr)
   __arch__swab32s(addr);
  }
  
 -#ifdef __BYTEORDER_HAS_U64__
  static __inline__ __attribute__((const)) __u64 __fswab64(__u64 x)
  {
  #  ifdef __SWAB_64_THRU_32__
 @@ -141,7 +140,6 @@ static __inline__ void __swab64s(__u64 *addr)
  {
   __arch__swab64s(addr);
  }
 -#endif /* __BYTEORDER_HAS_U64__ */
  
  #if defined(__KERNEL__)
  #define swab16 __swab16

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] Pull request: u-boot-sh/master

2012-12-03 Thread Tom Rini
On Fri, Nov 30, 2012 at 03:07:05PM +0900, Nobuhiro Iwamatsu wrote:

 Hi Tom,
 
 Please pull u-boot-sh master branch.
 
 Best regards,
   Nobuhiro
 
 The following changes since commit b8715d8def240014da5614a4f940130ec06d9ebf:
 
   Merge branch 'master' of git://git.denx.de/u-boot-fdt (2012-11-29
 06:41:56 -0700)
 
 are available in the git repository at:
 
 
   git://git.denx.de/u-boot-sh master
 
 for you to fetch changes up to 7c791b3f0a8e42f8012f782ef56ad6e88858e7c4:
 
   serial: serial_sh: bugfix: autoboot fails if serial console is not
 connected (2012-11-30 15:06:05 +0900)
 
 
 Tetsuyuki Kobayashi (1):
   serial: serial_sh: bugfix: autoboot fails if serial console is
 not connected
 
 Yoshihiro Shimoda (1):
   sh: fix trigger_address_error()
 
  arch/sh/include/asm/system.h |2 +-
  drivers/serial/serial_sh.c   |   20 +---
  2 files changed, 14 insertions(+), 8 deletions(-)

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [PATCH v2 14/15] Introduce arch_phys_memset which works like memset but on physical memory

2012-12-03 Thread Tom Rini
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 12/02/12 09:55, Simon Glass wrote:
 From: Gabe Black gabebl...@chromium.org
 
 The default implementation of this function is just memset, but
 other implementations will be needed when physical memory isn't
 accessible by U-Boot using normal addressing mechanisms.
 
 Signed-off-by: Gabe Black gabebl...@chromium.org Signed-off-by:
 Che-Liang Chiou clch...@chromium.org Signed-off-by: Simon Glass
 s...@chromium.org

We've supported PowerPC platforms with 36bit memory ranges for ages.
Part of that however I believe is just not touching that high memory
range.  So why do we need to touch the range here, rather than just
configuring the memory controller and booting Linux?  Is this for some
hardware tester for example?

- -- 
Tom
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iQIcBAEBAgAGBQJQvLBWAAoJENk4IS6UOR1WS3oP/3OslD0jJzixbYNn35N+4KjY
dgnkNuLYwiXPhsw9sRttNihf7C2XLfPtbJfQo97hAVSgULLgBjjRN4HtoB9Yx3M1
hMtPcWzt/JxOOzgKwUBF1RdFwQ8ENmD0AYQ3F6D3uNq/3Tez9/VkrrXpbMnNvNyh
cw1fKT0aFDJgTdoK6KWRvXd1Z/cQk0+aWDFXhi1Y1yBag80PKXoiEATrd3hg1Tig
MVFu3QFxjGcYWkZiFtEpn4fpFLzhZVbmxzOzq/JTT33fH60ZJewCkUTVw3zfqBHE
bGyGiNhzZa4Se7cgtL4mkWEGyAmapfMwowM7SPqw3gew5G8lFZdpIKTe+4ECGEdH
dcHaXb28KghE8XUdcA02cWd0COhyFpdsJxuzqzKg3J8S/b4DMLMFcJRalBfTMcm3
T9fSDxa5DwiEoJd0/HTF5ZBR4QQoAp9EOrNU+y2zjF9U7y5USA1smoXSBKQGtZTL
sCB3FFfrGoDHiVks4lhEDqGT+eFPK2cYZzi8RCG3sP8MhfNzaw7ZjUfwi2zjdu/D
scIAh8RexrAvuIG5svqTun7YppRFbTINSIB2Z3WVievJGCUa72ke5eC9cSAaW5Uv
MNoURhgp4lqXLNPiYyKMtJEgyQQrSQVT4Ty0MfxSEWwZVKrU6AQ2OGe/xCHiejSw
0QqmDjrlA/4ntaimuw14
=ahxh
-END PGP SIGNATURE-
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Please pull u-boot-x86.git

2012-12-03 Thread Tom Rini
On Sat, Dec 01, 2012 at 06:38:43AM -0800, Simon Glass wrote:

 The following changes since commit b8715d8def240014da5614a4f940130ec06d9ebf:
 
   Merge branch 'master' of git://git.denx.de/u-boot-fdt (2012-11-29
 06:41:56 -0700)
 
 are available in the git repository at:
 
   git://git.denx.de/u-boot-x86.git master
 
 Gabe Black (6):
   x86: Allow compiling out realmode/bios code
   x86: Add an fdt pointer to the global data structure
   x86: Add a minimal device tree for alex x86
   x86: Add a default implementation for cleanup_before_linux()
   x86: Add a dummy implementation for timer_get_us
   x86: Include types.h explicitly in the i386 version of io.h
 
 Simon Glass (4):
   x86: coreboot: Decode additional coreboot sysinfo tags
   x86: Select stdio devices for coreboot
   x86: Remove coreboot start16 code
   x86: Define CONFIG_SYS_VSNPRINTF for coreboot
 
 Stefan Reinauer (4):
   x86: coreboot: Drop sysinfo.c
   x86: video: Add coreboot framebuffer support
   x86: Fix typo in pcat_timer.c
   x86: Don't spam POST80 codes with slow IO functions
 
 Vadim Bendebury (2):
   x86: Add CBMEM console driver for coreboot
   x86: Add console command to display CBMEM console buffer
 
  README   |6 +
  arch/x86/cpu/Makefile|2 +-
  arch/x86/cpu/coreboot/Makefile   |1 -
  arch/x86/cpu/coreboot/sysinfo.c  |   39 ---
  arch/x86/cpu/coreboot/tables.c   |  117 
 ++
  arch/x86/cpu/cpu.c   |5 +
  arch/x86/cpu/timer.c |   17 +++
  arch/x86/include/asm/arch-coreboot/sysinfo.h |   34 +--
  arch/x86/include/asm/arch-coreboot/tables.h  |   74 ++
  arch/x86/include/asm/global_data.h   |1 +
  arch/x86/include/asm/io.h|4 +-
  arch/x86/include/asm/u-boot-x86.h|1 +
  arch/x86/lib/Makefile|9 +-
  arch/x86/lib/pcat_timer.c|2 +-
  arch/x86/lib/video.c |2 +
  arch/x86/lib/zimage.c|4 +-
  board/chromebook-x86/coreboot/Makefile   |1 -
  board/chromebook-x86/coreboot/coreboot_start16.S |   33 --
  board/chromebook-x86/dts/x86-alex.dts|   30 ++
  common/stdio.c   |4 +-
  drivers/misc/Makefile|1 +
  drivers/misc/cbmem_console.c |   67 
  drivers/video/Makefile   |1 +
  drivers/video/coreboot_fb.c  |  101 +++
  include/configs/coreboot.h   |   13 +++
  include/stdio_dev.h  |3 +
  26 files changed, 460 insertions(+), 112 deletions(-)
  delete mode 100644 arch/x86/cpu/coreboot/sysinfo.c
  create mode 100644 arch/x86/cpu/timer.c
  delete mode 100644 board/chromebook-x86/coreboot/coreboot_start16.S
  create mode 100644 board/chromebook-x86/dts/x86-alex.dts
  create mode 100644 drivers/misc/cbmem_console.c
  create mode 100644 drivers/video/coreboot_fb.c

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [PATCH 1/2] EXYNOS5: Add pinmux for VBus

2012-12-03 Thread Kyungmin Park
On Mon, Dec 3, 2012 at 10:38 PM, Rajeshwari Birje
rajeshwari.bi...@gmail.com wrote:
 Hi Kyungmin Park,

 On Mon, Dec 3, 2012 at 7:00 PM, Kyungmin Park kmp...@infradead.org wrote:
 On Mon, Dec 3, 2012 at 10:18 PM, Rajeshwari Shinde
 rajeshwar...@samsung.com wrote:
 This patch sets pinmux for VBus of USB.

 Signed-off-by: Vivek Gautam gautam.vi...@samsung.com
 Signed-off-by: Rajeshwari Shinde rajeshwar...@samsung.com
 ---
  arch/arm/cpu/armv7/exynos/pinmux.c|   10 ++
  arch/arm/include/asm/arch-exynos/periph.h |1 +
  2 files changed, 11 insertions(+), 0 deletions(-)

 diff --git a/arch/arm/cpu/armv7/exynos/pinmux.c 
 b/arch/arm/cpu/armv7/exynos/pinmux.c
 index f9f6911..d65ffc7 100644
 --- a/arch/arm/cpu/armv7/exynos/pinmux.c
 +++ b/arch/arm/cpu/armv7/exynos/pinmux.c
 @@ -285,6 +285,14 @@ void exynos5_spi_config(int peripheral)
 }
  }

 +void exynos5_usb20_config(void)
 +{
 +   struct exynos5_gpio_part1 *gpio1 =
 +   (struct exynos5_gpio_part1 *) samsung_get_base_gpio_part1();
 +   /* Enable VBUS power switch */
 +   s5p_gpio_direction_output(gpio1-x2,6, 1);
 it seems to be board specific GPIO value. doesn't it?
 Yes it is smdk5250 specific.
So it's not proper place to add.
 Thank you,
 Kyungmin Park
 +}
 +
  static int exynos5_pinmux_config(int peripheral, int flags)
  {
 switch (peripheral) {
 @@ -322,6 +330,8 @@ static int exynos5_pinmux_config(int peripheral, int 
 flags)
 case PERIPH_ID_SPI4:
 exynos5_spi_config(peripheral);
 break;
 +   case PERIPH_ID_USB20:
 +   exynos5_usb20_config();
 default:
 debug(%s: invalid peripheral %d, __func__, peripheral);
 return -1;
 diff --git a/arch/arm/include/asm/arch-exynos/periph.h 
 b/arch/arm/include/asm/arch-exynos/periph.h
 index 783b77c..84593f6 100644
 --- a/arch/arm/include/asm/arch-exynos/periph.h
 +++ b/arch/arm/include/asm/arch-exynos/periph.h
 @@ -46,6 +46,7 @@ enum periph_id {
 PERIPH_ID_SPI0 = 68,
 PERIPH_ID_SPI1,
 PERIPH_ID_SPI2,
 +   PERIPH_ID_USB20,
 PERIPH_ID_SDMMC0 = 75,
 PERIPH_ID_SDMMC1,
 PERIPH_ID_SDMMC2,
 --
 1.7.4.4

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

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


Re: [U-Boot] [PATCH 05/10] pxe: use bootz instead of bootm when enabled

2012-12-03 Thread Rob Herring
On 12/03/2012 06:22 AM, Wolfgang Denk wrote:
 Dear Rob Herring,
 
 In message 1354503629-25621-6-git-send-email-robherri...@gmail.com you 
 wrote:
 From: Rob Herring rob.herr...@calxeda.com

 Standard pxelinux servers would use zImage rather than u-boot image
 format, so use bootz instead of bootm if enabled.
 
 Why would this be the case?  We should encourage the use of a
 checksum-protected image format, i. e. the default setting should be
 for FIT images, followed by legacy U-Boot images, and fall back on
 archaic formats like zImage only when there is really no other way.
 

There is no way for the client to tell the server what kind of client it
is and therefore what kind of image to serve. There is the dhcp client
id string, but that can't be used in situations were you don't control
the dhcp server setup. That problem is also the reason for patch 9 where
you can't distinguish between x86 and ARM for default.

When we have systems that boot from UEFI, they will certainly not use
u-boot image formats and we don't want to have different setup based on
the client/bootloader type.

I can actually just make this run-time rather than compile time. When
do_bootm returns when it fails to find a valid u-boot image, I can just
call do_bootz.

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


[U-Boot] [PATCH] cm_t35: use new low level interface for usb ehci

2012-12-03 Thread Nikita Kiryanov
Update usb host support to use new version of omap_ehci_hcd_init.

Signed-off-by: Nikita Kiryanov nik...@compulab.co.il
---
Explanation: apparently there was a failed remote update and I did not have
the latest version of the code.
@Marek: If it's possible to fold this into commit cm-t35: add USB host support
that would be greatly appreciated.

 board/cm_t35/cm_t35.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/board/cm_t35/cm_t35.c b/board/cm_t35/cm_t35.c
index 19367df..dd55d47 100644
--- a/board/cm_t35/cm_t35.c
+++ b/board/cm_t35/cm_t35.c
@@ -503,7 +503,7 @@ struct omap_usbhs_board_data usbhs_bdata = {
 };
 
 #define SB_T35_USB_HUB_RESET_GPIO  167
-int ehci_hcd_init(void)
+int ehci_hcd_init(int index, struct ehci_hccr **hccr, struct ehci_hcor **hcor)
 {
u8 val;
int offset;
@@ -529,7 +529,7 @@ int ehci_hcd_init(void)
twl4030_i2c_write_u8(TWL4030_CHIP_GPIO, 0xC0, offset);
udelay(1);
 
-   return omap_ehci_hcd_init(usbhs_bdata);
+   return omap_ehci_hcd_init(usbhs_bdata, hccr, hcor);
 }
 
 int ehci_hcd_stop(void)
-- 
1.7.10.4

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


Re: [U-Boot] Please pull u-boot-x86.git

2012-12-03 Thread Otavio Salvador
On Mon, Dec 3, 2012 at 10:27 AM, Simon Glass s...@chromium.org wrote:

 Hi Otavio,

 On Mon, Dec 3, 2012 at 4:12 AM, Otavio Salvador ota...@ossystems.com.br
 wrote:
 [snip]

  Maybe it is the time to move patman to another git repository?
 
  patman is nice for many projects so maybe it could live outside U-Boot
 git?

 Maybe one day, but we still have a number of things to sort out - e.g.
 the threading issue Wolfgang raised. Also I don't think patman is
 widely used even in U-Boot, and having it here promotes its use. What
 other projects actually use it at this stage? (yes I see Doug's
 patches aimed at supporting Linux better).


I've been using it a lot! It is your call about moving it outside U-Boot
git or not but I do believe it would be easier to find users (specially
among other projects) if it were in a standalone tree. It would also allow
for independent release cycle (which would be good).

(this is my point of view)

-- 
Otavio Salvador O.S. Systems
E-mail: ota...@ossystems.com.br  http://www.ossystems.com.br
Mobile: +55 53 9981-7854  http://projetos.ossystems.com.br
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Please pull u-boot-x86.git

2012-12-03 Thread Tom Rini
On Sat, Dec 01, 2012 at 11:42:28AM -0800, Simon Glass wrote:
 Hi Tom,
 
 On Sat, Dec 1, 2012 at 10:32 AM, Tom Rini tr...@ti.com wrote:
  -BEGIN PGP SIGNED MESSAGE-
  Hash: SHA1
 
  On 12/01/12 09:38, Simon Glass wrote:
  The following changes since commit
  b8715d8def240014da5614a4f940130ec06d9ebf:
 
  Merge branch 'master' of git://git.denx.de/u-boot-fdt (2012-11-29
  06:41:56 -0700)
 
  are available in the git repository at:
 
  git://git.denx.de/u-boot-x86.git master
 
  Gabe Black (6): x86: Allow compiling out realmode/bios code x86:
  Add an fdt pointer to the global data structure x86: Add a minimal
   device tree for alex x86 x86: Add a default implementation for
  cleanup_before_linux() x86: Add a dummy implementation for
  timer_get_us x86: Include types.h explicitly in the i386 version of
  io.h
 
  Simon Glass (4): x86: coreboot: Decode additional coreboot sysinfo
   tags x86: Select stdio devices for coreboot x86: Remove coreboot
  start16 code x86: Define CONFIG_SYS_VSNPRINTF for coreboot
 
  Stefan Reinauer (4): x86: coreboot: Drop sysinfo.c x86: video: Add
   coreboot framebuffer support x86: Fix typo in pcat_timer.c x86:
  Don't spam POST80 codes with slow IO functions
 
  Vadim Bendebury (2): x86: Add CBMEM console driver for coreboot
  x86: Add console command to display CBMEM console buffer
 
  I know there's outstanding x86 work, but was all of this in some
  series that was posted before the merge window closed?  Thanks!
 
 This set of patches was posted between 13th and 20th October. I
 actually have more patches in my todo list on patchwork (mostly newer
 ones to 3 November, but a few very old like 4 of those in the first
 pull request this week).
 
 I took over as maintainer right near the end of the merge window and
 sorted out repo access 10 days ago, so I am definitely playing catch
 up. All going well I should work through the rest next week.

OK, thanks.

 While talking about patches I see that the patman patches are assigned
 to me. I will of course review them, but what should I do after that,
 as they are not x86? Also they are outside the merge window for this
 release, but will you accept 'next' pull requests at some point?

For patman patches that you didn't author/post, I think I assigned them
to you to review and then pass back to me to pickup.

For the next branch, I would like to see custodians take things in that
they're happy with, but came in post merge window.  How it gets into the
main tree, I'm still thinking about.  Having a lot of people using a
rebased tree was shown to be a pain last time around.  I'm tempted to
say we should try something more Linux Kernel like and say put patches
that are ready into a branch against what they're tested / posted
against, and send pull requests once the merge window opens.  But I know
there's a lot of nuance to the process there too.

-- 
Tom


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


Re: [U-Boot] [PATCH] fix linker generated lists on non-C locales

2012-12-03 Thread Marek Vasut
Dear Wolfgang Denk,

 Dear Marek Vasut,
 
 In message 201212030457.11755.ma...@denx.de you wrote:
   IMHO it would make more sense to just make sure that LC_ALL is not set
   at all, i. e. to explicitly unset it.
  
  Hrm ... shall we introduce a patch that sanitizes the env then? Maybe we
  can fix the LDFLAGS/yocto issue that way too?
 
 Except for LC_ALL, what else do you have in mind?

If that's the only issue, then only LC_ALL.

 I would leave out the LDFLAGS thing here; it is unrelated, and it
 bites also for all older versions of U-Boot, and we cannot fix the
 past.

That's right.

 Best regards,
 
 Wolfgang Denk

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


Re: [U-Boot] [PATCH 0/2] EXYNOS5: Add VBus init required for USB

2012-12-03 Thread Marek Vasut
Dear Rajeshwari Shinde,

 This patch sets adds pinmux for USB and function to init VBus.
 
 Rajeshwari Shinde (2):
   EXYNOS5: Add pinmux for VBus
   SMDK5250: Enable VBus for USB
 
  arch/arm/cpu/armv7/exynos/pinmux.c|   10 ++
  arch/arm/include/asm/arch-exynos/periph.h |1 +
  board/samsung/smdk5250/smdk5250.c |   17 +
  3 files changed, 28 insertions(+), 0 deletions(-)

I'll not apply this until you sort out the issue with Kyungmin .

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


Re: [U-Boot] [PATCH 1/2] ARM: add wfi assembly macro

2012-12-03 Thread Marek Vasut
Dear Rob Herring,

 On 12/02/2012 10:58 PM, Marek Vasut wrote:
  Dear Rob Herring,
  
  From: Rob Herring rob.herr...@calxeda.com
  
  Since wfi instruction is only available on ARMv7, add a conditional
  macro for it.
  
  Signed-off-by: Rob Herring rob.herr...@calxeda.com
  ---
  
   arch/arm/include/asm/system.h |6 ++
   1 file changed, 6 insertions(+)
  
  diff --git a/arch/arm/include/asm/system.h
  b/arch/arm/include/asm/system.h index 2b28a26..2f6aecd 100644
  --- a/arch/arm/include/asm/system.h
  +++ b/arch/arm/include/asm/system.h
  @@ -61,6 +61,12 @@
  
   #define nop() __asm__ __volatile__(mov\tr0,r0\t@ nop\n\t);
  
  +#ifdef __ARM_ARCH_7A__
  +#define wfi() __asm__ __volatile__ (wfi : : : memory)
  +#else
  +#define wfi()
  +#endif
  
  Won't this break other (non-arm) systems? Moreover, maybe you can make
  this an (inline) function instead?
 
 How? It is in an ARM specific header and empty on anything but ARMv7
 enabled compiler. This follows the kernel implementation and the nop above.

Ok, I missed the arch/arm. It's ok then, sorry for the noise.
[...]

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


Re: [U-Boot] [PATCH 1/3] EHCI: Exynos: Add fdt support

2012-12-03 Thread Marek Vasut
Dear Rajeshwari Shinde,

 Adding fdt support to ehci-exynos in order to parse
 register base addresses from the device node.
 
 Signed-off-by: Vivek Gautam gautam.vi...@samsung.com
[...]

$ ./tools/checkpatch.pl \[PATCH\ 1_3\]\ EHCI_Exynos_Add\ fdt\ support.mbox 
WARNING: line over 80 characters
#136: FILE: drivers/usb/host/ehci-exynos.c:108:
+   usb = (struct exynos_usb_phy *)fdtdec_get_addr(gd-fdt_blob, node, 
phyreg);

WARNING: line over 80 characters
#177: FILE: drivers/usb/host/ehci-exynos.c:155:
+   usb = (struct exynos_usb_phy *)fdtdec_get_addr(gd-fdt_blob, node, 
phyreg);

total: 0 errors, 2 warnings, 85 lines checked

NOTE: Ignored message types: COMPLEX_MACRO CONSIDER_KSTRTO MINMAX 
MULTISTATEMENT_MACRO_USE_DO_WHILE

/tmp/[PATCH 1_3] EHCI_Exynos_Add fdt support.mbox has style problems, please 
review.

If any of these errors are false positives, please report
them to the maintainer, see CHECKPATCH in MAINTAINERS.

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


Re: [U-Boot] [PATCH 0/3] EXYNOS5: Add FDT support for USB

2012-12-03 Thread Marek Vasut
Dear Rajeshwari Shinde,

 This patch set adds FDT support for USB device.
 
 Rajeshwari Shinde (3):
   EHCI: Exynos: Add fdt support
   EXYNOS5: Add device node for USB.
   EXYNOS5: FDT: Add compatible strings for USB
 
  arch/arm/dts/exynos5250.dtsi   |6 
  drivers/usb/host/ehci-exynos.c |   57
 --- include/fdtdec.h   |  
  1 +
  lib/fdtdec.c   |1 +
  4 files changed, 60 insertions(+), 5 deletions(-)

I'll not apply this, run this all via checkpatch and repost please. Thanks!

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


Re: [U-Boot] [PATCH] cm_t35: use new low level interface for usb ehci

2012-12-03 Thread Marek Vasut
Dear Nikita Kiryanov,

 Update usb host support to use new version of omap_ehci_hcd_init.
 
 Signed-off-by: Nikita Kiryanov nik...@compulab.co.il
 ---
 Explanation: apparently there was a failed remote update and I did not have
 the latest version of the code.
 @Marek: If it's possible to fold this into commit cm-t35: add USB host
 support that would be greatly appreciated.
 
  board/cm_t35/cm_t35.c |4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
 
[...]

Applied, thanks

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


Re: [U-Boot] [PATCH] usb: Fix bug when both DFU ETHER are defined

2012-12-03 Thread Marek Vasut
Dear Pantelis Antoniou,

 When both CONFIG_USB_GADGET  CONFIG_USB_ETHER are defined
 the makefile links objects twice.
 
 This patch uses a Makefile specific idiom of
 'if defined(CONFIG_USB_GADGET) || defined(CONFIG_USB_ETHER)'
 to handle the case.
 
 Signed-off-by: Pantelis Antoniou pa...@antoniou-consulting.com
[...]

Applied, thanks

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


Re: [U-Boot] [PATCH 0/57] RFC: Move arch-specific global data into its own structure

2012-12-03 Thread Tom Rini
On Tue, Nov 20, 2012 at 06:06:30AM -0800, Simon Glass wrote:
 Hi Wolfgang,
 
 On Mon, Nov 19, 2012 at 11:25 PM, Wolfgang Denk w...@denx.de wrote:
  Dear Simon Glass,
 
  In message 1353100842-20126-1-git-send-email-...@chromium.org you wrote:
  The previous generic board series hit a snag in that we needed generic
  code to access some of the architecture-specific fields in global_data.
[snip]
  - The change makes the code less readable.  Reading gd-arch.
instead of plain gd- is no improvements, but rather vice versa.
If we really go this way, this should be improved.
 
 Yes it would be nice. Are you suggesting some sort of macro, or
 something else?

Wolfgang?  global data, architecture specific goo, ... reads fine and
helpful to me, honestly.

-- 
Tom


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


[U-Boot] Patches to add some more omap24xx_i2c/twl6035 error handling

2012-12-03 Thread Vincent Stehlé
Hi,

I am encountering the following i2c error on OMAP5 with mainline u-boot:

  OMAP5430 EVM # mmc rescan
  timed out in wait_for_bb: I2C_STAT=1410

It seems the first call to i2c_write for bus I2C1 will fail and will leave the
bus with SCL stuck low, preventing further i2c operations.

While still debugging this issue, I would like to propose the following
patches, which add some more error handling in this error case already:

  [PATCH 1/2] omap24xx_i2c: Handle wait_for_bb error
  [PATCH 2/2] power: twl6035: complain on LDO9 error

Best regards,

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


[U-Boot] [PATCH 1/2] omap24xx_i2c: Handle wait_for_bb error

2012-12-03 Thread Vincent Stehlé
We add a return code to wait_for_bb() to be able to report errors to the
callers properly. We in turn handle this new error code in i2c_read, i2c_write
and i2c_probe.

Signed-off-by: Vincent Stehlé v-ste...@ti.com
---
 drivers/i2c/omap24xx_i2c.c |   20 ++--
 1 file changed, 14 insertions(+), 6 deletions(-)

diff --git a/drivers/i2c/omap24xx_i2c.c b/drivers/i2c/omap24xx_i2c.c
index 094305f..1bbb2ca 100644
--- a/drivers/i2c/omap24xx_i2c.c
+++ b/drivers/i2c/omap24xx_i2c.c
@@ -31,7 +31,7 @@ DECLARE_GLOBAL_DATA_PTR;
 
 #define I2C_TIMEOUT1000
 
-static void wait_for_bb(void);
+static int wait_for_bb(void);
 static u16 wait_for_pin(void);
 static void flush_fifo(void);
 
@@ -159,7 +159,8 @@ static int i2c_read_byte(u8 devaddr, u16 regoffset, u8 
alen, u8 *value)
u16 w;
 
/* wait until bus not busy */
-   wait_for_bb();
+   if (wait_for_bb())
+   return 1;
 
/* one byte only */
writew(alen, i2c_base-cnt);
@@ -260,7 +261,8 @@ int i2c_probe(uchar chip)
return res;
 
/* wait until bus not busy */
-   wait_for_bb();
+   if (wait_for_bb())
+   return res;
 
/* try to read one byte */
writew(1, i2c_base-cnt);
@@ -279,7 +281,10 @@ int i2c_probe(uchar chip)
res = 1;
writew(0xff, i2c_base-stat);
writew (readw (i2c_base-con) | I2C_CON_STP, 
i2c_base-con);
-   wait_for_bb ();
+
+   if (wait_for_bb())
+   res = 1;
+
break;
}
if (status  I2C_STAT_ARDY) {
@@ -351,7 +356,8 @@ int i2c_write(uchar chip, uint addr, int alen, uchar 
*buffer, int len)
}
 
/* wait until bus not busy */
-   wait_for_bb();
+   if (wait_for_bb())
+   return 1;
 
/* start address phase - will write regoffset + len bytes data */
/* TODO consider case when !CONFIG_OMAP243X/34XX/44XX */
@@ -394,7 +400,7 @@ write_exit:
return i2c_error;
 }
 
-static void wait_for_bb(void)
+static int wait_for_bb(void)
 {
int timeout = I2C_TIMEOUT;
u16 stat;
@@ -408,8 +414,10 @@ static void wait_for_bb(void)
if (timeout = 0) {
printf(timed out in wait_for_bb: I2C_STAT=%x\n,
readw(i2c_base-stat));
+   return 1;
}
writew(0x, i2c_base-stat); /* clear delayed stuff*/
+   return 0;
 }
 
 static u16 wait_for_pin(void)
-- 
1.7.9.5

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


[U-Boot] [PATCH 2/2] power: twl6035: complain on LDO9 error

2012-12-03 Thread Vincent Stehlé
We handle i2c_write return code and complain in case of error. We propagate the
error, too, to allow better handling at the upper level in the future.

Signed-off-by: Vincent Stehlé v-ste...@ti.com
---
 drivers/power/twl6035.c |   17 +
 include/twl6035.h   |2 +-
 2 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/drivers/power/twl6035.c b/drivers/power/twl6035.c
index 624c09e..d3de698 100644
--- a/drivers/power/twl6035.c
+++ b/drivers/power/twl6035.c
@@ -50,16 +50,25 @@ void twl6035_init_settings(void)
return;
 }
 
-void twl6035_mmc1_poweron_ldo(void)
+int twl6035_mmc1_poweron_ldo(void)
 {
u8 val = 0;
 
/* set LDO9 TWL6035 to 3V */
val = 0x2b; /* (3 -.9)*28 +1 */
-   palmas_write_u8(0x48, LDO9_VOLTAGE, val);
+
+   if (palmas_write_u8(0x48, LDO9_VOLTAGE, val)) {
+   printf(twl6035: could not set LDO9 voltage.\n);
+   return 1;
+   }
 
/* TURN ON LDO9 */
val = LDO_ON | LDO_MODE_SLEEP | LDO_MODE_ACTIVE;
-   palmas_write_u8(0x48, LDO9_CTRL, val);
-   return;
+
+   if (palmas_write_u8(0x48, LDO9_CTRL, val)) {
+   printf(twl6035: could not turn on LDO9.\n);
+   return 1;
+   }
+
+   return 0;
 }
diff --git a/include/twl6035.h b/include/twl6035.h
index e21ddba..ce74348 100644
--- a/include/twl6035.h
+++ b/include/twl6035.h
@@ -39,4 +39,4 @@
 int twl6035_i2c_write_u8(u8 chip_no, u8 val, u8 reg);
 int twl6035_i2c_read_u8(u8 chip_no, u8 *val, u8 reg);
 void twl6035_init_settings(void);
-void twl6035_mmc1_poweron_ldo(void);
+int twl6035_mmc1_poweron_ldo(void);
-- 
1.7.9.5

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


[U-Boot] [PATCH] cmd_time: merge run_command_and_time_it with cmd_process

2012-12-03 Thread Richard Genoud
As far as every arch has a get_timer function,
run_command_and_time_it code can now disappear.

Signed-off-by: Richard Genoud richard.gen...@gmail.com
---
 common/cmd_time.c |   33 ++---
 common/command.c  |4 +++-
 common/hush.c |2 +-
 common/main.c |2 +-
 include/command.h |4 +++-
 5 files changed, 10 insertions(+), 35 deletions(-)

diff --git a/common/cmd_time.c b/common/cmd_time.c
index 6dbdbbf..9808cd6 100644
--- a/common/cmd_time.c
+++ b/common/cmd_time.c
@@ -22,36 +22,6 @@
 #include common.h
 #include command.h
 
-/*
- * TODO(clchiou): This function actually minics the bottom-half of the
- * run_command() function.  Since this function has ARM-dependent timer
- * codes, we cannot merge it with the run_command() for now.
- */
-static int run_command_and_time_it(int flag, int argc, char * const argv[],
-   ulong *cycles)
-{
-   cmd_tbl_t *cmdtp = find_cmd(argv[0]);
-   int retval = 0;
-
-   if (!cmdtp) {
-   printf(%s: command not found\n, argv[0]);
-   return 1;
-   }
-   if (argc  cmdtp-maxargs)
-   return CMD_RET_USAGE;
-
-   /*
-* TODO(clchiou): get_timer_masked() is only defined in certain ARM
-* boards.  We could use the new timer API that Graeme is proposing
-* so that this piece of code would be arch-independent.
-*/
-   *cycles = get_timer_masked();
-   retval = cmdtp-cmd(cmdtp, flag, argc, argv);
-   *cycles = get_timer_masked() - *cycles;
-
-   return retval;
-}
-
 static void report_time(ulong cycles)
 {
ulong minutes, seconds, milliseconds;
@@ -75,11 +45,12 @@ static int do_time(cmd_tbl_t *cmdtp, int flag, int argc, 
char * const argv[])
 {
ulong cycles = 0;
int retval = 0;
+   int repeatable;
 
if (argc == 1)
return CMD_RET_USAGE;
 
-   retval = run_command_and_time_it(0, argc - 1, argv + 1, cycles);
+   retval = cmd_process(0, argc - 1, argv + 1, repeatable, cycles);
report_time(cycles);
 
return retval;
diff --git a/common/command.c b/common/command.c
index 50c8429..a58dca6 100644
--- a/common/command.c
+++ b/common/command.c
@@ -513,7 +513,7 @@ static int cmd_call(cmd_tbl_t *cmdtp, int flag, int argc, 
char * const argv[])
 }
 
 enum command_ret_t cmd_process(int flag, int argc, char * const argv[],
-  int *repeatable)
+  int *repeatable, ulong *ticks)
 {
enum command_ret_t rc = CMD_RET_SUCCESS;
cmd_tbl_t *cmdtp;
@@ -543,7 +543,9 @@ enum command_ret_t cmd_process(int flag, int argc, char * 
const argv[],
 
/* If OK so far, then do the command */
if (!rc) {
+   if (ticks) *ticks = get_timer(0);
rc = cmd_call(cmdtp, flag, argc, argv);
+   if (ticks) *ticks = get_timer(*ticks);
*repeatable = cmdtp-repeatable;
}
if (rc == CMD_RET_USAGE)
diff --git a/common/hush.c b/common/hush.c
index eb6c879..cc81c9c 100644
--- a/common/hush.c
+++ b/common/hush.c
@@ -1665,7 +1665,7 @@ static int run_pipe_real(struct pipe *pi)
}
/* Process the command */
return cmd_process(flag, child-argc, child-argv,
-  flag_repeat);
+  flag_repeat, NULL);
 #endif
}
 #ifndef __U_BOOT__
diff --git a/common/main.c b/common/main.c
index 5362781..7bdba3e 100644
--- a/common/main.c
+++ b/common/main.c
@@ -1442,7 +1442,7 @@ static int builtin_run_command(const char *cmd, int flag)
continue;
}
 
-   if (cmd_process(flag, argc, argv, repeatable))
+   if (cmd_process(flag, argc, argv, repeatable, NULL))
rc = -1;
 
/* Did the user stop this? */
diff --git a/include/command.h b/include/command.h
index 10bc260..1344d71 100644
--- a/include/command.h
+++ b/include/command.h
@@ -139,10 +139,12 @@ enum command_ret_t {
  * @param repeatable   This function sets this to 0 if the command is not
  * repeatable. If the command is repeatable, the value
  * is left unchanged.
+ * @param ticksIf ticks is not null, this function set it to 
the
+ * number of ticks the command took to complete.
  * @return 0 if the command succeeded, 1 if it failed
  */
 int cmd_process(int flag, int argc, char * const argv[],
-  int *repeatable);
+  int *repeatable, ulong *ticks);
 
 #endif /* __ASSEMBLY__ */
 
-- 
1.7.2.5

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


Re: [U-Boot] [PATCH] cmd_time: merge run_command_and_time_it with cmd_process

2012-12-03 Thread Stefan Roese
On 12/03/2012 04:28 PM, Richard Genoud wrote:
 As far as every arch has a get_timer function,
 run_command_and_time_it code can now disappear.
 
 Signed-off-by: Richard Genoud richard.gen...@gmail.com
 ---
  common/cmd_time.c |   33 ++---
  common/command.c  |4 +++-
  common/hush.c |2 +-
  common/main.c |2 +-
  include/command.h |4 +++-
  5 files changed, 10 insertions(+), 35 deletions(-)
 
 diff --git a/common/cmd_time.c b/common/cmd_time.c
 index 6dbdbbf..9808cd6 100644
 --- a/common/cmd_time.c
 +++ b/common/cmd_time.c
 @@ -22,36 +22,6 @@
  #include common.h
  #include command.h
  
 -/*
 - * TODO(clchiou): This function actually minics the bottom-half of the
 - * run_command() function.  Since this function has ARM-dependent timer
 - * codes, we cannot merge it with the run_command() for now.
 - */
 -static int run_command_and_time_it(int flag, int argc, char * const argv[],
 - ulong *cycles)
 -{
 - cmd_tbl_t *cmdtp = find_cmd(argv[0]);
 - int retval = 0;
 -
 - if (!cmdtp) {
 - printf(%s: command not found\n, argv[0]);
 - return 1;
 - }
 - if (argc  cmdtp-maxargs)
 - return CMD_RET_USAGE;
 -
 - /*
 -  * TODO(clchiou): get_timer_masked() is only defined in certain ARM
 -  * boards.  We could use the new timer API that Graeme is proposing
 -  * so that this piece of code would be arch-independent.
 -  */
 - *cycles = get_timer_masked();
 - retval = cmdtp-cmd(cmdtp, flag, argc, argv);
 - *cycles = get_timer_masked() - *cycles;
 -
 - return retval;
 -}
 -
  static void report_time(ulong cycles)
  {
   ulong minutes, seconds, milliseconds;
 @@ -75,11 +45,12 @@ static int do_time(cmd_tbl_t *cmdtp, int flag, int argc, 
 char * const argv[])
  {
   ulong cycles = 0;
   int retval = 0;
 + int repeatable;
  
   if (argc == 1)
   return CMD_RET_USAGE;
  
 - retval = run_command_and_time_it(0, argc - 1, argv + 1, cycles);
 + retval = cmd_process(0, argc - 1, argv + 1, repeatable, cycles);
   report_time(cycles);
  
   return retval;
 diff --git a/common/command.c b/common/command.c
 index 50c8429..a58dca6 100644
 --- a/common/command.c
 +++ b/common/command.c
 @@ -513,7 +513,7 @@ static int cmd_call(cmd_tbl_t *cmdtp, int flag, int argc, 
 char * const argv[])
  }
  
  enum command_ret_t cmd_process(int flag, int argc, char * const argv[],
 -int *repeatable)
 +int *repeatable, ulong *ticks)
  {
   enum command_ret_t rc = CMD_RET_SUCCESS;
   cmd_tbl_t *cmdtp;
 @@ -543,7 +543,9 @@ enum command_ret_t cmd_process(int flag, int argc, char * 
 const argv[],
  
   /* If OK so far, then do the command */
   if (!rc) {
 + if (ticks) *ticks = get_timer(0);

Newline please:

if (ticks)
*ticks = get_timer(0);


   rc = cmd_call(cmdtp, flag, argc, argv);
 + if (ticks) *ticks = get_timer(*ticks);

Here as well.

Thanks,
Stefan

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


[U-Boot] [PATCH] omap24xx_i2c: Handle OMAP5 like OMAP2,3,4

2012-12-03 Thread Vincent Stehlé
OMAP5 has 8b i2c data register field, like OMAP2, 3 and 4. Handle in the same
way. This fixes the following error on OMAP5:

  OMAP5430 EVM # mmc rescan
  timed out in wait_for_bb: I2C_STAT=1410
  twl6035: could not turn on LDO9.

Signed-off-by: Vincent Stehlé v-ste...@ti.com
---
 drivers/i2c/omap24xx_i2c.c |   15 ++-
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/drivers/i2c/omap24xx_i2c.c b/drivers/i2c/omap24xx_i2c.c
index 1bbb2ca..54e9b15 100644
--- a/drivers/i2c/omap24xx_i2c.c
+++ b/drivers/i2c/omap24xx_i2c.c
@@ -180,7 +180,8 @@ static int i2c_read_byte(u8 devaddr, u16 regoffset, u8 
alen, u8 *value)
if (status  I2C_STAT_XRDY) {
w = tmpbuf[i++];
 #if !(defined(CONFIG_OMAP243X) || defined(CONFIG_OMAP34XX) || \
-   defined(CONFIG_OMAP44XX) || defined(CONFIG_AM33XX))
+   defined(CONFIG_OMAP44XX) || defined(CONFIG_AM33XX) || \
+   defined(CONFIG_OMAP54XX))
w |= tmpbuf[i++]  8;
 #endif
writew(w, i2c_base-data);
@@ -210,7 +211,8 @@ static int i2c_read_byte(u8 devaddr, u16 regoffset, u8 
alen, u8 *value)
}
if (status  I2C_STAT_RRDY) {
 #if defined(CONFIG_OMAP243X) || defined(CONFIG_OMAP34XX) || \
-   defined(CONFIG_OMAP44XX) || defined(CONFIG_AM33XX)
+   defined(CONFIG_OMAP44XX) || defined(CONFIG_AM33XX) || \
+   defined(CONFIG_OMAP54XX)
*value = readb(i2c_base-data);
 #else
*value = readw(i2c_base-data);
@@ -240,7 +242,8 @@ static void flush_fifo(void)
stat = readw(i2c_base-stat);
if (stat == I2C_STAT_RRDY) {
 #if defined(CONFIG_OMAP243X) || defined(CONFIG_OMAP34XX) || \
-   defined(CONFIG_OMAP44XX) || defined(CONFIG_AM33XX)
+   defined(CONFIG_OMAP44XX) || defined(CONFIG_AM33XX) || \
+   defined(CONFIG_OMAP54XX)
readb(i2c_base-data);
 #else
readw(i2c_base-data);
@@ -294,7 +297,8 @@ int i2c_probe(uchar chip)
if (status  I2C_STAT_RRDY) {
res = 0;
 #if defined(CONFIG_OMAP243X) || defined(CONFIG_OMAP34XX) || \
-defined(CONFIG_OMAP44XX) || defined(CONFIG_AM33XX)
+   defined(CONFIG_OMAP44XX) || defined(CONFIG_AM33XX) || \
+   defined(CONFIG_OMAP54XX)
readb(i2c_base-data);
 #else
readw(i2c_base-data);
@@ -382,7 +386,8 @@ int i2c_write(uchar chip, uint addr, int alen, uchar 
*buffer, int len)
if (status  I2C_STAT_XRDY) {
w = (i  0) ? tmpbuf[2+i] : buffer[i];
 #if !(defined(CONFIG_OMAP243X) || defined(CONFIG_OMAP34XX) || \
-   defined(CONFIG_OMAP44XX) || defined(CONFIG_AM33XX))
+   defined(CONFIG_OMAP44XX) || defined(CONFIG_AM33XX) || \
+   defined(CONFIG_OMAP54XX))
w |= ((++i  0) ? tmpbuf[2+i] : buffer[i])  8;
 #endif
writew(w, i2c_base-data);
-- 
1.7.9.5

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


Re: [U-Boot] [PATCH] cmd_time: merge run_command_and_time_it with cmd_process

2012-12-03 Thread Richard Genoud
2012/12/3 Stefan Roese s...@denx.de:
 @@ -543,7 +543,9 @@ enum command_ret_t cmd_process(int flag, int argc, char 
 * const argv[],

   /* If OK so far, then do the command */
   if (!rc) {
 + if (ticks) *ticks = get_timer(0);

 Newline please:

 if (ticks)
 *ticks = get_timer(0);


   rc = cmd_call(cmdtp, flag, argc, argv);
 + if (ticks) *ticks = get_timer(*ticks);

 Here as well.

 Thanks,
 Stefan

Ok, I'll resend it with new lines (I thought it was a little bit more
readable without new lines).
Thanks !

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


[U-Boot] [PATCHv2] cmd_time: merge run_command_and_time_it with cmd_process

2012-12-03 Thread Richard Genoud
As far as every arch has a get_timer function,
run_command_and_time_it code can now disappear.

Signed-off-by: Richard Genoud richard.gen...@gmail.com
---
 common/cmd_time.c |   33 ++---
 common/command.c  |6 +-
 common/hush.c |2 +-
 common/main.c |2 +-
 include/command.h |4 +++-
 5 files changed, 12 insertions(+), 35 deletions(-)

diff --git a/common/cmd_time.c b/common/cmd_time.c
index 6dbdbbf..9808cd6 100644
--- a/common/cmd_time.c
+++ b/common/cmd_time.c
@@ -22,36 +22,6 @@
 #include common.h
 #include command.h
 
-/*
- * TODO(clchiou): This function actually minics the bottom-half of the
- * run_command() function.  Since this function has ARM-dependent timer
- * codes, we cannot merge it with the run_command() for now.
- */
-static int run_command_and_time_it(int flag, int argc, char * const argv[],
-   ulong *cycles)
-{
-   cmd_tbl_t *cmdtp = find_cmd(argv[0]);
-   int retval = 0;
-
-   if (!cmdtp) {
-   printf(%s: command not found\n, argv[0]);
-   return 1;
-   }
-   if (argc  cmdtp-maxargs)
-   return CMD_RET_USAGE;
-
-   /*
-* TODO(clchiou): get_timer_masked() is only defined in certain ARM
-* boards.  We could use the new timer API that Graeme is proposing
-* so that this piece of code would be arch-independent.
-*/
-   *cycles = get_timer_masked();
-   retval = cmdtp-cmd(cmdtp, flag, argc, argv);
-   *cycles = get_timer_masked() - *cycles;
-
-   return retval;
-}
-
 static void report_time(ulong cycles)
 {
ulong minutes, seconds, milliseconds;
@@ -75,11 +45,12 @@ static int do_time(cmd_tbl_t *cmdtp, int flag, int argc, 
char * const argv[])
 {
ulong cycles = 0;
int retval = 0;
+   int repeatable;
 
if (argc == 1)
return CMD_RET_USAGE;
 
-   retval = run_command_and_time_it(0, argc - 1, argv + 1, cycles);
+   retval = cmd_process(0, argc - 1, argv + 1, repeatable, cycles);
report_time(cycles);
 
return retval;
diff --git a/common/command.c b/common/command.c
index 50c8429..305a236 100644
--- a/common/command.c
+++ b/common/command.c
@@ -513,7 +513,7 @@ static int cmd_call(cmd_tbl_t *cmdtp, int flag, int argc, 
char * const argv[])
 }
 
 enum command_ret_t cmd_process(int flag, int argc, char * const argv[],
-  int *repeatable)
+  int *repeatable, ulong *ticks)
 {
enum command_ret_t rc = CMD_RET_SUCCESS;
cmd_tbl_t *cmdtp;
@@ -543,7 +543,11 @@ enum command_ret_t cmd_process(int flag, int argc, char * 
const argv[],
 
/* If OK so far, then do the command */
if (!rc) {
+   if (ticks)
+   *ticks = get_timer(0);
rc = cmd_call(cmdtp, flag, argc, argv);
+   if (ticks)
+   *ticks = get_timer(*ticks);
*repeatable = cmdtp-repeatable;
}
if (rc == CMD_RET_USAGE)
diff --git a/common/hush.c b/common/hush.c
index eb6c879..cc81c9c 100644
--- a/common/hush.c
+++ b/common/hush.c
@@ -1665,7 +1665,7 @@ static int run_pipe_real(struct pipe *pi)
}
/* Process the command */
return cmd_process(flag, child-argc, child-argv,
-  flag_repeat);
+  flag_repeat, NULL);
 #endif
}
 #ifndef __U_BOOT__
diff --git a/common/main.c b/common/main.c
index 5362781..7bdba3e 100644
--- a/common/main.c
+++ b/common/main.c
@@ -1442,7 +1442,7 @@ static int builtin_run_command(const char *cmd, int flag)
continue;
}
 
-   if (cmd_process(flag, argc, argv, repeatable))
+   if (cmd_process(flag, argc, argv, repeatable, NULL))
rc = -1;
 
/* Did the user stop this? */
diff --git a/include/command.h b/include/command.h
index 10bc260..1344d71 100644
--- a/include/command.h
+++ b/include/command.h
@@ -139,10 +139,12 @@ enum command_ret_t {
  * @param repeatable   This function sets this to 0 if the command is not
  * repeatable. If the command is repeatable, the value
  * is left unchanged.
+ * @param ticksIf ticks is not null, this function set it to 
the
+ * number of ticks the command took to complete.
  * @return 0 if the command succeeded, 1 if it failed
  */
 int cmd_process(int flag, int argc, char * const argv[],
-  int *repeatable);
+  int *repeatable, ulong *ticks);
 
 #endif /* __ASSEMBLY__ */
 
-- 
1.7.2.5

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


Re: [U-Boot] [PATCH v2 14/15] Introduce arch_phys_memset which works like memset but on physical memory

2012-12-03 Thread Simon Glass
Hi Tom,

On Mon, Dec 3, 2012 at 5:59 AM, Tom Rini tr...@ti.com wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 On 12/02/12 09:55, Simon Glass wrote:
 From: Gabe Black gabebl...@chromium.org

 The default implementation of this function is just memset, but
 other implementations will be needed when physical memory isn't
 accessible by U-Boot using normal addressing mechanisms.

 Signed-off-by: Gabe Black gabebl...@chromium.org Signed-off-by:
 Che-Liang Chiou clch...@chromium.org Signed-off-by: Simon Glass
 s...@chromium.org

 We've supported PowerPC platforms with 36bit memory ranges for ages.
 Part of that however I believe is just not touching that high memory
 range.  So why do we need to touch the range here, rather than just
 configuring the memory controller and booting Linux?  Is this for some
 hardware tester for example?

We need to clear all memory as part of the secure boot, to avoid
attacks which involve leaving code around over a reboot, etc. For x86
also we avoid touching memory above 4GB during normal operation, but
it isn't enough to just ignore it, since there might be something
lurking there that someone can invoke. The support is minimal (just
clearing it) and we don't want to start using it in any other way.

Regards,
Simon


 - --
 Tom
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.11 (GNU/Linux)
 Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

 iQIcBAEBAgAGBQJQvLBWAAoJENk4IS6UOR1WS3oP/3OslD0jJzixbYNn35N+4KjY
 dgnkNuLYwiXPhsw9sRttNihf7C2XLfPtbJfQo97hAVSgULLgBjjRN4HtoB9Yx3M1
 hMtPcWzt/JxOOzgKwUBF1RdFwQ8ENmD0AYQ3F6D3uNq/3Tez9/VkrrXpbMnNvNyh
 cw1fKT0aFDJgTdoK6KWRvXd1Z/cQk0+aWDFXhi1Y1yBag80PKXoiEATrd3hg1Tig
 MVFu3QFxjGcYWkZiFtEpn4fpFLzhZVbmxzOzq/JTT33fH60ZJewCkUTVw3zfqBHE
 bGyGiNhzZa4Se7cgtL4mkWEGyAmapfMwowM7SPqw3gew5G8lFZdpIKTe+4ECGEdH
 dcHaXb28KghE8XUdcA02cWd0COhyFpdsJxuzqzKg3J8S/b4DMLMFcJRalBfTMcm3
 T9fSDxa5DwiEoJd0/HTF5ZBR4QQoAp9EOrNU+y2zjF9U7y5USA1smoXSBKQGtZTL
 sCB3FFfrGoDHiVks4lhEDqGT+eFPK2cYZzi8RCG3sP8MhfNzaw7ZjUfwi2zjdu/D
 scIAh8RexrAvuIG5svqTun7YppRFbTINSIB2Z3WVievJGCUa72ke5eC9cSAaW5Uv
 MNoURhgp4lqXLNPiYyKMtJEgyQQrSQVT4Ty0MfxSEWwZVKrU6AQ2OGe/xCHiejSw
 0QqmDjrlA/4ntaimuw14
 =ahxh
 -END PGP SIGNATURE-
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2] pxe: try bootz if bootm fails to find a valid image

2012-12-03 Thread Rob Herring
From: Rob Herring rob.herr...@calxeda.com

Standard pxelinux servers will typically use a zImage rather than u-boot
image format, so fallback to bootz if bootm fails.

Signed-off-by: Rob Herring rob.herr...@calxeda.com
---
v2:
- Only fall back to bootz when bootm fails instead of being either or
  option.

 common/cmd_pxe.c |   11 ++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/common/cmd_pxe.c b/common/cmd_pxe.c
index 02ed645..4bfacf3 100644
--- a/common/cmd_pxe.c
+++ b/common/cmd_pxe.c
@@ -579,6 +579,7 @@ static int label_localboot(struct pxe_label *label)
 static int label_boot(struct pxe_label *label)
 {
char *bootm_argv[] = { bootm, NULL, NULL, NULL, NULL };
+   char initrd_str[22];
int bootm_argc = 3;
 
label_print(label);
@@ -604,7 +605,10 @@ static int label_boot(struct pxe_label *label)
return 1;
}
 
-   bootm_argv[2] = getenv(ramdisk_addr_r);
+   bootm_argv[2] = initrd_str;
+   strcpy(bootm_argv[2], getenv(ramdisk_addr_r));
+   strcat(bootm_argv[2], :);
+   strcat(bootm_argv[2], getenv(filesize));
} else {
bootm_argv[2] = -;
}
@@ -649,6 +653,11 @@ static int label_boot(struct pxe_label *label)
bootm_argc = 4;
 
do_bootm(NULL, 0, bootm_argc, bootm_argv);
+
+#ifdef CONFIG_CMD_BOOTZ
+   /* Try booting a zImage if do_bootm returns */
+   do_bootz(NULL, 0, bootm_argc, bootm_argv);
+#endif
return 1;
 }
 
-- 
1.7.10.4

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


Re: [U-Boot] Please pull u-boot-mpc85xx.git

2012-12-03 Thread Tabi Timur-B04825
On Wed, Nov 28, 2012 at 1:39 AM, Andy Fleming aflem...@freescale.com wrote:

 Timur Tabi (5):
   powerpc/85xx/p5040: add CONFIG_SYS_PPC64, del 
 CONFIG_SYS_FSL_ELBC_MULTIBIT_ECC
   powerpc/85xx: add support for the Freescale P5040DS Superhydra 
 reference board
   powerpc/85xx: implement check for erratum A-004849 work-around
   powerpc/85xx: implement check for erratum A-004580 work-around
   powerpc/85xx: update the work-around for P4080 erratum SERDES-9

You forgot this patch again:

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

-- 
Timur Tabi
Linux kernel developer at Freescale
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] cmd_time: merge run_command_and_time_it with cmd_process

2012-12-03 Thread Che-liang Chiou
Acked-by: Che-Liang Chiou clch...@chromium.org

On Mon, Dec 3, 2012 at 8:23 AM, Richard Genoud richard.gen...@gmail.com wrote:
 2012/12/3 Stefan Roese s...@denx.de:
 @@ -543,7 +543,9 @@ enum command_ret_t cmd_process(int flag, int argc, char 
 * const argv[],

   /* If OK so far, then do the command */
   if (!rc) {
 + if (ticks) *ticks = get_timer(0);

 Newline please:

 if (ticks)
 *ticks = get_timer(0);


   rc = cmd_call(cmdtp, flag, argc, argv);
 + if (ticks) *ticks = get_timer(*ticks);

 Here as well.

 Thanks,
 Stefan

 Ok, I'll resend it with new lines (I thought it was a little bit more
 readable without new lines).
 Thanks !

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


Re: [U-Boot] [PATCHv2] cmd_time: merge run_command_and_time_it with cmd_process

2012-12-03 Thread Che-liang Chiou
Acked-By: Che-Liang Chiou clch...@chromium.org

On Mon, Dec 3, 2012 at 8:28 AM, Richard Genoud richard.gen...@gmail.com wrote:
 As far as every arch has a get_timer function,
 run_command_and_time_it code can now disappear.

 Signed-off-by: Richard Genoud richard.gen...@gmail.com
 ---
  common/cmd_time.c |   33 ++---
  common/command.c  |6 +-
  common/hush.c |2 +-
  common/main.c |2 +-
  include/command.h |4 +++-
  5 files changed, 12 insertions(+), 35 deletions(-)

 diff --git a/common/cmd_time.c b/common/cmd_time.c
 index 6dbdbbf..9808cd6 100644
 --- a/common/cmd_time.c
 +++ b/common/cmd_time.c
 @@ -22,36 +22,6 @@
  #include common.h
  #include command.h

 -/*
 - * TODO(clchiou): This function actually minics the bottom-half of the
 - * run_command() function.  Since this function has ARM-dependent timer
 - * codes, we cannot merge it with the run_command() for now.
 - */
 -static int run_command_and_time_it(int flag, int argc, char * const argv[],
 -   ulong *cycles)
 -{
 -   cmd_tbl_t *cmdtp = find_cmd(argv[0]);
 -   int retval = 0;
 -
 -   if (!cmdtp) {
 -   printf(%s: command not found\n, argv[0]);
 -   return 1;
 -   }
 -   if (argc  cmdtp-maxargs)
 -   return CMD_RET_USAGE;
 -
 -   /*
 -* TODO(clchiou): get_timer_masked() is only defined in certain ARM
 -* boards.  We could use the new timer API that Graeme is proposing
 -* so that this piece of code would be arch-independent.
 -*/
 -   *cycles = get_timer_masked();
 -   retval = cmdtp-cmd(cmdtp, flag, argc, argv);
 -   *cycles = get_timer_masked() - *cycles;
 -
 -   return retval;
 -}
 -
  static void report_time(ulong cycles)
  {
 ulong minutes, seconds, milliseconds;
 @@ -75,11 +45,12 @@ static int do_time(cmd_tbl_t *cmdtp, int flag, int argc, 
 char * const argv[])
  {
 ulong cycles = 0;
 int retval = 0;
 +   int repeatable;

 if (argc == 1)
 return CMD_RET_USAGE;

 -   retval = run_command_and_time_it(0, argc - 1, argv + 1, cycles);
 +   retval = cmd_process(0, argc - 1, argv + 1, repeatable, cycles);
 report_time(cycles);

 return retval;
 diff --git a/common/command.c b/common/command.c
 index 50c8429..305a236 100644
 --- a/common/command.c
 +++ b/common/command.c
 @@ -513,7 +513,7 @@ static int cmd_call(cmd_tbl_t *cmdtp, int flag, int argc, 
 char * const argv[])
  }

  enum command_ret_t cmd_process(int flag, int argc, char * const argv[],
 -  int *repeatable)
 +  int *repeatable, ulong *ticks)
  {
 enum command_ret_t rc = CMD_RET_SUCCESS;
 cmd_tbl_t *cmdtp;
 @@ -543,7 +543,11 @@ enum command_ret_t cmd_process(int flag, int argc, char 
 * const argv[],

 /* If OK so far, then do the command */
 if (!rc) {
 +   if (ticks)
 +   *ticks = get_timer(0);
 rc = cmd_call(cmdtp, flag, argc, argv);
 +   if (ticks)
 +   *ticks = get_timer(*ticks);
 *repeatable = cmdtp-repeatable;
 }
 if (rc == CMD_RET_USAGE)
 diff --git a/common/hush.c b/common/hush.c
 index eb6c879..cc81c9c 100644
 --- a/common/hush.c
 +++ b/common/hush.c
 @@ -1665,7 +1665,7 @@ static int run_pipe_real(struct pipe *pi)
 }
 /* Process the command */
 return cmd_process(flag, child-argc, child-argv,
 -  flag_repeat);
 +  flag_repeat, NULL);
  #endif
 }
  #ifndef __U_BOOT__
 diff --git a/common/main.c b/common/main.c
 index 5362781..7bdba3e 100644
 --- a/common/main.c
 +++ b/common/main.c
 @@ -1442,7 +1442,7 @@ static int builtin_run_command(const char *cmd, int 
 flag)
 continue;
 }

 -   if (cmd_process(flag, argc, argv, repeatable))
 +   if (cmd_process(flag, argc, argv, repeatable, NULL))
 rc = -1;

 /* Did the user stop this? */
 diff --git a/include/command.h b/include/command.h
 index 10bc260..1344d71 100644
 --- a/include/command.h
 +++ b/include/command.h
 @@ -139,10 +139,12 @@ enum command_ret_t {
   * @param repeatable   This function sets this to 0 if the command is not
   * repeatable. If the command is repeatable, the value
   * is left unchanged.
 + * @param ticksIf ticks is not null, this function set it to 
 the
 + * number of ticks the command took to complete.
   * @return 0 if the command succeeded, 1 if it failed
   */
  int cmd_process(int flag, int argc, char * const argv[],
 -  int *repeatable);
 +  int *repeatable, ulong *ticks);

  #endif /* __ASSEMBLY__ */

 --
 

Re: [U-Boot] [PATCH 0/57] RFC: Move arch-specific global data into its own structure

2012-12-03 Thread Graeme Russ
Hi Tom, Simon, Wolfgang,

On Tue, Dec 4, 2012 at 1:54 AM, Tom Rini tr...@ti.com wrote:
 On Tue, Nov 20, 2012 at 06:06:30AM -0800, Simon Glass wrote:
 Hi Wolfgang,

 On Mon, Nov 19, 2012 at 11:25 PM, Wolfgang Denk w...@denx.de wrote:
  Dear Simon Glass,
 
  In message 1353100842-20126-1-git-send-email-...@chromium.org you wrote:
  The previous generic board series hit a snag in that we needed generic
  code to access some of the architecture-specific fields in global_data.
 [snip]
  - The change makes the code less readable.  Reading gd-arch.
instead of plain gd- is no improvements, but rather vice versa.
If we really go this way, this should be improved.

 Yes it would be nice. Are you suggesting some sort of macro, or
 something else?

 Wolfgang?  global data, architecture specific goo, ... reads fine and
 helpful to me, honestly.

I've mentioned this before - I think gd is being abused. To me, gd
should contain only data members that are explicitly required prior to
SDRAM being initialised and BSS being available. It has become a bit
of a 'well I need this variable everywhere, I'll dump it in gd'.

To be honest, I think gd should only be a temporary structure used to
carry specific data through the initialisation process up to the point
BSS becomes available. With the 'early malloc' patches in the
pipeline, it might even be possible to malloc the gd structure early
and then when BSS is available, copy the data into the final global
data structure in BSS. I think that would be complicated by functions
that need to use gd both before and after BSS becomes available.

Regards,

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


[U-Boot] [PATCH v2 0/7] Add support for NVIDIA Tegra30 SoC

2012-12-03 Thread Tom Warren
This patch series adds basic (boot to cmd prompt) support for Tegra30.
This is based on the Tegra20 SPL, which initializes the AVP (ARM7TDMI)
boot proc) first, then control is transferred to the CPU (A9 quad cluster).
It is based on current u-boot-tegra/next. Some Tegra20 files were
changed or moved to enable use of common code/headers.

Future patches will add support/drivers for MMC, USB, I2C, SPI, NAND
and other peripherals. The Cardhu T30 boards is supported initially.

Tom Warren (7):
  Tegra30: Add arch-tegra30 include files
  Tegra30: Add AVP (arm720t) files
  Tegra30: Add CPU (armv7) files
  Tegra30: Add common CPU (shared) files
  Tegra30: Cardhu: Add DT files
  Tegra30: Add generic Tegra30 build support
  Tegra30: Add/enable Cardhu build (T30 reference board)

 Makefile |6 +-
 arch/arm/cpu/arm720t/tegra-common/Makefile   |1 +
 arch/arm/cpu/arm720t/tegra-common/cpu.c  |  342 +++
 arch/arm/cpu/arm720t/tegra-common/cpu.h  |   64 +-
 arch/arm/cpu/arm720t/tegra-common/spl.c  |3 +-
 arch/arm/cpu/arm720t/tegra20/cpu.c   |  216 +
 arch/arm/cpu/arm720t/tegra30/Makefile|   41 +
 arch/arm/cpu/arm720t/tegra30/config.mk   |   19 +
 arch/arm/cpu/arm720t/tegra30/cpu.c   |  176 
 arch/arm/cpu/armv7/Makefile  |2 +-
 arch/arm/cpu/armv7/start.S   |4 +-
 arch/arm/cpu/armv7/tegra30/Makefile  |   40 +
 arch/arm/cpu/armv7/tegra30/config.mk |   19 +
 arch/arm/cpu/tegra-common/ap.c   |   22 +-
 arch/arm/cpu/tegra-common/board.c|   41 +-
 arch/arm/cpu/tegra-common/sys_info.c |5 +-
 arch/arm/cpu/tegra20-common/warmboot.c   |2 +-
 arch/arm/cpu/tegra30-common/Makefile |   44 +
 arch/arm/cpu/tegra30-common/clock.c  | 1092 ++
 arch/arm/cpu/tegra30-common/funcmux.c|   57 ++
 arch/arm/cpu/tegra30-common/pinmux.c |  506 ++
 arch/arm/dts/tegra30.dtsi|6 +
 arch/arm/include/asm/arch-tegra/ap.h |   50 +-
 arch/arm/include/asm/arch-tegra/clk_rst.h|  148 +++-
 arch/arm/include/asm/arch-tegra/clock.h  |8 +-
 arch/arm/include/asm/arch-tegra/funcmux.h|   39 +
 arch/arm/include/asm/arch-tegra/gp_padctrl.h |   39 +
 arch/arm/include/asm/arch-tegra/tegra.h  |   13 +-
 arch/arm/include/asm/arch-tegra20/funcmux.h  |   26 +-
 arch/arm/include/asm/arch-tegra20/gp_padctrl.h   |   17 +-
 arch/arm/include/asm/arch-tegra30/clock-tables.h |  378 
 arch/arm/include/asm/arch-tegra30/clock.h|   24 +
 arch/arm/include/asm/arch-tegra30/flow.h |   35 +
 arch/arm/include/asm/arch-tegra30/funcmux.h  |   31 +
 arch/arm/include/asm/arch-tegra30/gp_padctrl.h   |   59 ++
 arch/arm/include/asm/arch-tegra30/gpio.h |  304 ++
 arch/arm/include/asm/arch-tegra30/hardware.h |   22 +
 arch/arm/include/asm/arch-tegra30/pinmux.h   |  604 
 arch/arm/include/asm/arch-tegra30/pmu.h  |   23 +
 arch/arm/include/asm/arch-tegra30/spl.h  |   28 +
 arch/arm/include/asm/arch-tegra30/tegra.h|   26 +
 board/nvidia/cardhu/Makefile |   44 +
 board/nvidia/cardhu/cardhu.c |   39 +
 board/nvidia/cardhu/pinmux-config-cardhu.h   |  339 +++
 board/nvidia/common/board.c  |   17 +-
 board/nvidia/dts/tegra30-cardhu.dts  |   14 +
 boards.cfg   |1 +
 include/configs/cardhu.h |   52 +
 include/configs/tegra-common.h   |  163 
 include/configs/tegra20-common.h |  171 +---
 include/configs/tegra30-common.h |   54 ++
 include/serial.h |2 +-
 spl/Makefile |2 +-
 53 files changed, 4973 insertions(+), 507 deletions(-)
 create mode 100644 arch/arm/cpu/arm720t/tegra-common/cpu.c
 create mode 100644 arch/arm/cpu/arm720t/tegra30/Makefile
 create mode 100644 arch/arm/cpu/arm720t/tegra30/config.mk
 create mode 100644 arch/arm/cpu/arm720t/tegra30/cpu.c
 create mode 100644 arch/arm/cpu/armv7/tegra30/Makefile
 create mode 100644 arch/arm/cpu/armv7/tegra30/config.mk
 create mode 100644 arch/arm/cpu/tegra30-common/Makefile
 create mode 100644 arch/arm/cpu/tegra30-common/clock.c
 create mode 100644 arch/arm/cpu/tegra30-common/funcmux.c
 create mode 100644 arch/arm/cpu/tegra30-common/pinmux.c
 create mode 100644 arch/arm/dts/tegra30.dtsi
 create mode 100644 arch/arm/include/asm/arch-tegra/funcmux.h
 create mode 100644 arch/arm/include/asm/arch-tegra/gp_padctrl.h
 create mode 100644 arch/arm/include/asm/arch-tegra30/clock-tables.h
 create mode 100644 arch/arm/include/asm/arch-tegra30/clock.h
 create mode 100644 

Re: [U-Boot] [PATCH 0/57] RFC: Move arch-specific global data into its own structure

2012-12-03 Thread Simon Glass
Hi Graeme,

On Mon, Dec 3, 2012 at 2:02 PM, Graeme Russ graeme.r...@gmail.com wrote:
 Hi Tom, Simon, Wolfgang,

 On Tue, Dec 4, 2012 at 1:54 AM, Tom Rini tr...@ti.com wrote:
 On Tue, Nov 20, 2012 at 06:06:30AM -0800, Simon Glass wrote:
 Hi Wolfgang,

 On Mon, Nov 19, 2012 at 11:25 PM, Wolfgang Denk w...@denx.de wrote:
  Dear Simon Glass,
 
  In message 1353100842-20126-1-git-send-email-...@chromium.org you wrote:
  The previous generic board series hit a snag in that we needed generic
  code to access some of the architecture-specific fields in global_data.
 [snip]
  - The change makes the code less readable.  Reading gd-arch.
instead of plain gd- is no improvements, but rather vice versa.
If we really go this way, this should be improved.

 Yes it would be nice. Are you suggesting some sort of macro, or
 something else?

 Wolfgang?  global data, architecture specific goo, ... reads fine and
 helpful to me, honestly.

 I've mentioned this before - I think gd is being abused. To me, gd
 should contain only data members that are explicitly required prior to
 SDRAM being initialised and BSS being available. It has become a bit
 of a 'well I need this variable everywhere, I'll dump it in gd'.

 To be honest, I think gd should only be a temporary structure used to
 carry specific data through the initialisation process up to the point
 BSS becomes available. With the 'early malloc' patches in the
 pipeline, it might even be possible to malloc the gd structure early
 and then when BSS is available, copy the data into the final global
 data structure in BSS. I think that would be complicated by functions
 that need to use gd both before and after BSS becomes available.

I mostly agree, but that sounds like an exercise in removing fields
from the gd one by one in the source code. The bit I am not sure of is
whether it is useful for gd to hang around post relocation to provide
access to the data that was decided on early in boot (after all, the
position in memory of gd changes post relocation, so why maintain two
structures for the same info?).


 Regards,

 Graeme

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


Re: [U-Boot] [PATCH v2 0/7] Add support for NVIDIA Tegra30 SoC

2012-12-03 Thread Tom Warren
Sorry - hit send too soon. A couple of minor edits and I'll resend.

 -Original Message-
 From: Tom Warren [mailto:twarren.nvi...@gmail.com]
 Sent: Monday, December 03, 2012 3:18 PM
 To: u-boot@lists.denx.de
 Cc: twarren.nvi...@gmail.com; s...@chromium.org; Stephen Warren;
 albert.u.b...@aribaud.net; w...@denx.de; Tom Warren
 Subject: [PATCH v2 0/7] Add support for NVIDIA Tegra30 SoC
 
 This patch series adds basic (boot to cmd prompt) support for Tegra30.
 This is based on the Tegra20 SPL, which initializes the AVP (ARM7TDMI) boot
 proc) first, then control is transferred to the CPU (A9 quad cluster).
 It is based on current u-boot-tegra/next. Some Tegra20 files were changed or
 moved to enable use of common code/headers.
 
 Future patches will add support/drivers for MMC, USB, I2C, SPI, NAND and
 other peripherals. The Cardhu T30 boards is supported initially.
 
 Tom Warren (7):
   Tegra30: Add arch-tegra30 include files
   Tegra30: Add AVP (arm720t) files
   Tegra30: Add CPU (armv7) files
   Tegra30: Add common CPU (shared) files
   Tegra30: Cardhu: Add DT files
   Tegra30: Add generic Tegra30 build support
   Tegra30: Add/enable Cardhu build (T30 reference board)
 
  Makefile |6 +-
  arch/arm/cpu/arm720t/tegra-common/Makefile   |1 +
  arch/arm/cpu/arm720t/tegra-common/cpu.c  |  342 +++
  arch/arm/cpu/arm720t/tegra-common/cpu.h  |   64 +-
  arch/arm/cpu/arm720t/tegra-common/spl.c  |3 +-
  arch/arm/cpu/arm720t/tegra20/cpu.c   |  216 +
  arch/arm/cpu/arm720t/tegra30/Makefile|   41 +
  arch/arm/cpu/arm720t/tegra30/config.mk   |   19 +
  arch/arm/cpu/arm720t/tegra30/cpu.c   |  176 
  arch/arm/cpu/armv7/Makefile  |2 +-
  arch/arm/cpu/armv7/start.S   |4 +-
  arch/arm/cpu/armv7/tegra30/Makefile  |   40 +
  arch/arm/cpu/armv7/tegra30/config.mk |   19 +
  arch/arm/cpu/tegra-common/ap.c   |   22 +-
  arch/arm/cpu/tegra-common/board.c|   41 +-
  arch/arm/cpu/tegra-common/sys_info.c |5 +-
  arch/arm/cpu/tegra20-common/warmboot.c   |2 +-
  arch/arm/cpu/tegra30-common/Makefile |   44 +
  arch/arm/cpu/tegra30-common/clock.c  | 1092
 ++
  arch/arm/cpu/tegra30-common/funcmux.c|   57 ++
  arch/arm/cpu/tegra30-common/pinmux.c |  506 ++
  arch/arm/dts/tegra30.dtsi|6 +
  arch/arm/include/asm/arch-tegra/ap.h |   50 +-
  arch/arm/include/asm/arch-tegra/clk_rst.h|  148 +++-
  arch/arm/include/asm/arch-tegra/clock.h  |8 +-
  arch/arm/include/asm/arch-tegra/funcmux.h|   39 +
  arch/arm/include/asm/arch-tegra/gp_padctrl.h |   39 +
  arch/arm/include/asm/arch-tegra/tegra.h  |   13 +-
  arch/arm/include/asm/arch-tegra20/funcmux.h  |   26 +-
  arch/arm/include/asm/arch-tegra20/gp_padctrl.h   |   17 +-
  arch/arm/include/asm/arch-tegra30/clock-tables.h |  378 
  arch/arm/include/asm/arch-tegra30/clock.h|   24 +
  arch/arm/include/asm/arch-tegra30/flow.h |   35 +
  arch/arm/include/asm/arch-tegra30/funcmux.h  |   31 +
  arch/arm/include/asm/arch-tegra30/gp_padctrl.h   |   59 ++
  arch/arm/include/asm/arch-tegra30/gpio.h |  304 ++
  arch/arm/include/asm/arch-tegra30/hardware.h |   22 +
  arch/arm/include/asm/arch-tegra30/pinmux.h   |  604 
  arch/arm/include/asm/arch-tegra30/pmu.h  |   23 +
  arch/arm/include/asm/arch-tegra30/spl.h  |   28 +
  arch/arm/include/asm/arch-tegra30/tegra.h|   26 +
  board/nvidia/cardhu/Makefile |   44 +
  board/nvidia/cardhu/cardhu.c |   39 +
  board/nvidia/cardhu/pinmux-config-cardhu.h   |  339 +++
  board/nvidia/common/board.c  |   17 +-
  board/nvidia/dts/tegra30-cardhu.dts  |   14 +
  boards.cfg   |1 +
  include/configs/cardhu.h |   52 +
  include/configs/tegra-common.h   |  163 
  include/configs/tegra20-common.h |  171 +---
  include/configs/tegra30-common.h |   54 ++
  include/serial.h |2 +-
  spl/Makefile |2 +-
  53 files changed, 4973 insertions(+), 507 deletions(-)  create mode 100644
 arch/arm/cpu/arm720t/tegra-common/cpu.c
  create mode 100644 arch/arm/cpu/arm720t/tegra30/Makefile
  create mode 100644 arch/arm/cpu/arm720t/tegra30/config.mk
  create mode 100644 arch/arm/cpu/arm720t/tegra30/cpu.c
  create mode 100644 arch/arm/cpu/armv7/tegra30/Makefile
  create mode 100644 arch/arm/cpu/armv7/tegra30/config.mk
  create mode 100644 arch/arm/cpu/tegra30-common/Makefile
  create mode 100644 

Re: [U-Boot] [PATCH 1/2] patman: Cache the CC list from MakeCcFile() for use in ShowActions()

2012-12-03 Thread Simon Glass
On Fri, Nov 30, 2012 at 4:25 PM, Doug Anderson diand...@chromium.org wrote:
 Currently we go through and generate the CC list for patches twice.
 This gets slow when (in a future CL) we add a call to
 get_maintainer.pl on Linux.  Instead of doing things twice, just cache
 the CC list when it is first generated.

 Signed-off-by: Doug Anderson diand...@chromium.org\

Acked-by: Simon Glass s...@chromium.org
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 2/2] patman: Add all CC addresses to the cover letter

2012-12-03 Thread Simon Glass
On Fri, Nov 30, 2012 at 4:25 PM, Doug Anderson diand...@chromium.org wrote:
 If we're sending a cover letter make sure to CC everyone that we're
 CCing on each of the individual patches.

 Signed-off-by: Doug Anderson diand...@chromium.org

Looks good, but can you please add a note to the README under the
'Where Patches Are Sent' header which mentions where the cover letter
is sent?

 ---
  tools/patman/patman.py |2 +-
  tools/patman/series.py |   12 +++-
  2 files changed, 12 insertions(+), 2 deletions(-)

 diff --git a/tools/patman/patman.py b/tools/patman/patman.py
 index de8314a..4181d80 100755
 --- a/tools/patman/patman.py
 +++ b/tools/patman/patman.py
 @@ -140,7 +140,7 @@ else:
  options.count + options.start):
  ok = False

 -cc_file = series.MakeCcFile(options.process_tags)
 +cc_file = series.MakeCcFile(options.process_tags, cover_fname)

  # Email the patches out (giving the user time to check / cancel)
  cmd = ''
 diff --git a/tools/patman/series.py b/tools/patman/series.py
 index ad8288d..083af0f 100644
 --- a/tools/patman/series.py
 +++ b/tools/patman/series.py
 @@ -19,6 +19,7 @@
  # MA 02111-1307 USA
  #

 +import itertools
  import os

  import gitutil
 @@ -138,6 +139,9 @@ class Series(dict):
  print 'Prefix:\t ', self.get('prefix')
  if self.cover:
  print 'Cover: %d lines' % len(self.cover)
 +all_ccs = itertools.chain(*self._generated_cc.values())
 +for email in set(all_ccs):
 +print '  Cc: ',email
  if cmd:
  print 'Git command: %s' % cmd

 @@ -201,27 +205,33 @@ class Series(dict):
  str = 'Change log exists, but no version is set'
  print col.Color(col.RED, str)

 -def MakeCcFile(self, process_tags):
 +def MakeCcFile(self, process_tags, cover_fname):
  Make a cc file for us to use for per-commit Cc automation

  Also stores in self._generated_cc to make ShowActions() faster.

  Args:
  process_tags: Process tags as if they were aliases
 +cover_fname: If non-None the name of the cover letter.
  Return:
  Filename of temp file created
  
  # Look for commit tags (of the form 'xxx:' at the start of the 
 subject)
  fname = '/tmp/patman.%d' % os.getpid()
  fd = open(fname, 'w')
 +all_ccs = []
  for commit in self.commits:
  list = []
  if process_tags:
  list += gitutil.BuildEmailList(commit.tags)
  list += gitutil.BuildEmailList(commit.cc_list)
 +all_ccs += list
  print fd, commit.patch, ', '.join(list)
  self._generated_cc[commit.patch] = list

 +if cover_fname:
 +print fd, cover_fname, ', '.join(set(all_ccs))
 +
  fd.close()
  return fname

 --
 1.7.7.3


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


Re: [U-Boot] [PATCH 1/4] patman: Add a call to get_maintainer.pl if it exists

2012-12-03 Thread Simon Glass
On Fri, Nov 30, 2012 at 4:29 PM, Doug Anderson diand...@chromium.org wrote:
 For Linux the best way to figure out where to send a patch is with the
 get_maintainer.pl script.  Add support for calling it from patman.
 Support is added unconditionally for scripts/get_maintainer.pl in
 case it is helpful for any other projects.

 Signed-off-by: Doug Anderson diand...@chromium.org

Acked-by: Simon Glass s...@chromium.org
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 2/4] patman: Add support for settings in .patman

2012-12-03 Thread Simon Glass
On Fri, Nov 30, 2012 at 4:29 PM, Doug Anderson diand...@chromium.org wrote:
 This patch adds support for a [settings] section in the .patman file.
 In this section you can add settings that will affect the default
 values for command-line options.

 Support is added in a generic way such that any setting can be updated
 by just referring to the dest of the option that is passed to the
 option parser.  At the moment options that would make sense to put in
 settings are ignore_errors, process_tags, and verbose.  You
 could override them like:

  [settings]
  ignore_errors: True
  process_tags: False
  verbose: True

 The settings functionality is also used in a future change which adds
 support for per-project settings.

 Signed-off-by: Doug Anderson diand...@chromium.org
 ---

Acked-by: Simon Glass s...@chromium.org

  tools/patman/README  |   16 
  tools/patman/gitutil.py  |2 --
  tools/patman/patman.py   |3 +++
  tools/patman/settings.py |   39 +++
  4 files changed, 54 insertions(+), 6 deletions(-)

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


Re: [U-Boot] [PATCH 3/4] patman: Add the concept of multiple projects

2012-12-03 Thread Simon Glass
Hi Doug,

On Fri, Nov 30, 2012 at 4:29 PM, Doug Anderson diand...@chromium.org wrote:
 There are cases that we want to support different settings (or maybe
 even different aliases) for different projects.  Add support for this
 by:
 * Adding detection for two big projects: U-Boot and Linux.
 * Adding default settings for Linux (U-Boot is already good with the
   standard patman defaults).
 * Extend the new settings feature in .patman to specify per-project
   settings.

 Signed-off-by: Doug Anderson diand...@chromium.org
 ---
  tools/patman/README  |   13 
  tools/patman/patman.py   |9 +++-
  tools/patman/project.py  |   43 +
  tools/patman/settings.py |  147 
 +-
  4 files changed, 208 insertions(+), 4 deletions(-)
  create mode 100644 tools/patman/project.py

 diff --git a/tools/patman/README b/tools/patman/README
 index 6ca5b5b..d294f3d 100644
 --- a/tools/patman/README
 +++ b/tools/patman/README
 @@ -114,6 +114,19 @@ verbose: True
  


 +If you want to adjust settings (or aliases) that affect just a single
 +project you can add a section that looks like [project_settings] or
 +[project_alias].  If you want to use tags for your linux work, you could
 +do:
 +
 +
 +
 +[linux_settings]
 +process_tags: True
 +
 +
 +
 +
  How to run it
  =

 diff --git a/tools/patman/patman.py b/tools/patman/patman.py
 index b327c67..54a252e 100755
 --- a/tools/patman/patman.py
 +++ b/tools/patman/patman.py
 @@ -34,6 +34,7 @@ import checkpatch
  import command
  import gitutil
  import patchstream
 +import project
  import settings
  import terminal
  import test
 @@ -59,6 +60,9 @@ parser.add_option('--cc-cmd', dest='cc_cmd', type='string', 
 action='store',
 default=None, help='Output cc list for patch file (used by git)')
  parser.add_option('--no-tags', action='store_false', dest='process_tags',
default=True, help=Don't process subject tags as aliaes)
 +parser.add_option('--project', default=project.DetectProject(),
 +  help=Project name; affects default option values and 
 +  aliases [default: %default])

Can you please add a short option also - perhaps -p?

[snip]

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


Re: [U-Boot] [PATCH 4/4] patman: Add settings to the list of modules to doctest

2012-12-03 Thread Simon Glass
On Fri, Nov 30, 2012 at 4:29 PM, Doug Anderson diand...@chromium.org wrote:
 The settings modules now has doctests, so run them.

 Signed-off-by: Doug Anderson diand...@chromium.org

Acked-by: Simon Glass s...@chromium.org

 ---
  tools/patman/patman.py |5 +++--
  1 files changed, 3 insertions(+), 2 deletions(-)

 diff --git a/tools/patman/patman.py b/tools/patman/patman.py
 index 54a252e..6825de4 100755
 --- a/tools/patman/patman.py
 +++ b/tools/patman/patman.py
 @@ -85,8 +85,9 @@ if options.test:
  result = unittest.TestResult()
  suite.run(result)

 -suite = doctest.DocTestSuite('gitutil')
 -suite.run(result)
 +for module in ['gitutil', 'settings']:
 +suite = doctest.DocTestSuite(module)
 +suite.run(result)

  # TODO: Surely we can just 'print' result?
  print result
 --
 1.7.7.3

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


Re: [U-Boot] [PATCH 0/57] RFC: Move arch-specific global data into its own structure

2012-12-03 Thread Tom Rini
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 12/03/12 17:19, Simon Glass wrote:
 Hi Graeme,
 
 On Mon, Dec 3, 2012 at 2:02 PM, Graeme Russ graeme.r...@gmail.com
 wrote:
 Hi Tom, Simon, Wolfgang,
 
 On Tue, Dec 4, 2012 at 1:54 AM, Tom Rini tr...@ti.com wrote:
 On Tue, Nov 20, 2012 at 06:06:30AM -0800, Simon Glass wrote:
 Hi Wolfgang,
 
 On Mon, Nov 19, 2012 at 11:25 PM, Wolfgang Denk w...@denx.de
 wrote:
 Dear Simon Glass,
 
 In message
 1353100842-20126-1-git-send-email-...@chromium.org you
 wrote:
 The previous generic board series hit a snag in that we
 needed generic code to access some of the
 architecture-specific fields in global_data.
 [snip]
 - The change makes the code less readable.  Reading
 gd-arch. instead of plain gd- is no improvements, but
 rather vice versa. If we really go this way, this should be
 improved.
 
 Yes it would be nice. Are you suggesting some sort of macro,
 or something else?
 
 Wolfgang?  global data, architecture specific goo, ... reads
 fine and helpful to me, honestly.
 
 I've mentioned this before - I think gd is being abused. To me,
 gd should contain only data members that are explicitly required
 prior to SDRAM being initialised and BSS being available. It has
 become a bit of a 'well I need this variable everywhere, I'll
 dump it in gd'.
 
 To be honest, I think gd should only be a temporary structure
 used to carry specific data through the initialisation process up
 to the point, BSS becomes available. With the 'early malloc'
 patches in the pipeline, it might even be possible to malloc the
 gd structure early and then when BSS is available, copy the data
 into the final global data structure in BSS. I think that would
 be complicated by functions that need to use gd both before and
 after BSS becomes available.
 
 I mostly agree, but that sounds like an exercise in removing
 fields from the gd one by one in the source code. The bit I am not
 sure of is whether it is useful for gd to hang around post
 relocation to provide access to the data that was decided on early
 in boot (after all, the position in memory of gd changes post
 relocation, so why maintain two structures for the same info?).

At the high level, yes, such a cleaning of gd and perhaps even a
re-evaluation of what kind of global data structure we need to keep
around for the whole run time is warranted.  And the gd-arch-foo
would be a good place to start looking for shouldn't be in gd at all
candidates.  But that's not a blocker, to me, for this series, since
it will help show the problems.

- -- 
Tom

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iQIcBAEBAgAGBQJQvThOAAoJENk4IS6UOR1WWowQALLMLDuRC+YnfTDy0AMPhMCo
iasdqmyQRBBKXU/3o3D6EbOiiYxmmwrWEElJ6E1L3MiJknHz+P0vXJ0ec3DOo1BR
2B7hTMZewiDPGnJ7oREQAFXL2pW1hWKkYPwy/EQwz7RLncKM5+lAfwyuc4c2BFSH
oRYEKglQYCj/VO0H85vuS6BrBKrhdUOzq0AHebaxUnxPX0ZsBCqDesYjxViWVKZy
5Hw3ukqQYFTjl4P3/Ss9IcPkctbp/LWtRpq+vCNLuNee6UHuICz0Ws5wRySsoMpw
AE14EfVXn+N0QsMzm5fWQtCoXDe2J0+UD5qUXnMBUjf3VvlA0OnosHkYl/jOeuu0
oumHcf/YfHvoJpGDuwf2potshB5dlhzLRi4p86Gm/EPpL53zeqKvNJZJEmH70JPd
tKGEMN3RKwPUKzjM8TmaNlGl4HOlxnG4u3qe0DQsAB4rz39z86J/GS0xPzXcuDXO
MFOx+R6bpDtHk6I8YoqiERAReS20ppVi6ktMOUYpysdJjlyIqQ9qUvZChdm7Xx/J
7H7KW3W12z09k+IbexX4Bmv/2m+HNeeN1NgiD10erzFrLxeXZgxSoJ7P+II07aOm
tv483hTErPR0kPS4/oHrfxg1SGEQfCP9c9020RFspVl8ZcoRIuPam8H1RO+Hlzxl
Jhw9kwC54Dlcrthbk9/F
=3MpI
-END PGP SIGNATURE-
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 0/57] RFC: Move arch-specific global data into its own structure

2012-12-03 Thread Graeme Russ
Hi Tom,

On Tue, Dec 4, 2012 at 10:39 AM, Tom Rini tr...@ti.com wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 On 12/03/12 17:19, Simon Glass wrote:
 Hi Graeme,

 On Mon, Dec 3, 2012 at 2:02 PM, Graeme Russ graeme.r...@gmail.com
 wrote:
 Hi Tom, Simon, Wolfgang,

 On Tue, Dec 4, 2012 at 1:54 AM, Tom Rini tr...@ti.com wrote:
 On Tue, Nov 20, 2012 at 06:06:30AM -0800, Simon Glass wrote:
 Hi Wolfgang,

 On Mon, Nov 19, 2012 at 11:25 PM, Wolfgang Denk w...@denx.de
 wrote:
 Dear Simon Glass,

 In message
 1353100842-20126-1-git-send-email-...@chromium.org you
 wrote:
 The previous generic board series hit a snag in that we
 needed generic code to access some of the
 architecture-specific fields in global_data.
 [snip]
 - The change makes the code less readable.  Reading
 gd-arch. instead of plain gd- is no improvements, but
 rather vice versa. If we really go this way, this should be
 improved.

 Yes it would be nice. Are you suggesting some sort of macro,
 or something else?

 Wolfgang?  global data, architecture specific goo, ... reads
 fine and helpful to me, honestly.

 I've mentioned this before - I think gd is being abused. To me,
 gd should contain only data members that are explicitly required
 prior to SDRAM being initialised and BSS being available. It has
 become a bit of a 'well I need this variable everywhere, I'll
 dump it in gd'.

 To be honest, I think gd should only be a temporary structure
 used to carry specific data through the initialisation process up
 to the point, BSS becomes available. With the 'early malloc'
 patches in the pipeline, it might even be possible to malloc the
 gd structure early and then when BSS is available, copy the data
 into the final global data structure in BSS. I think that would
 be complicated by functions that need to use gd both before and
 after BSS becomes available.

 I mostly agree, but that sounds like an exercise in removing
 fields from the gd one by one in the source code. The bit I am not
 sure of is whether it is useful for gd to hang around post
 relocation to provide access to the data that was decided on early
 in boot (after all, the position in memory of gd changes post
 relocation, so why maintain two structures for the same info?).

 At the high level, yes, such a cleaning of gd and perhaps even a
 re-evaluation of what kind of global data structure we need to keep
 around for the whole run time is warranted.  And the gd-arch-foo
 would be a good place to start looking for shouldn't be in gd at all
 candidates.  But that's not a blocker, to me, for this series, since
 it will help show the problems.

I agree. While gd-arch does look a bit 'ugly', it immediately unlocks
the path forward to unifying the init loop. The x86 board.c would be a
good start (IMNSHO) by simply making the init sequence arrays extern.
From there we can tackle what really needs to be in gd and what can
simply be run of the mill global variables. I think most of what is
under gd-arch may just 'fall out'

Regards,

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


[U-Boot] [PATCH v2 0/7] Add support for NVIDIA Tegra30 SoC

2012-12-03 Thread Tom Warren
This patch series adds basic (boot to cmd prompt) support for Tegra30.
This is based on the Tegra20 SPL, which initializes the AVP (ARM7TDMI)
boot proc) first, then control is transferred to the CPU (A9 quad cluster).
It is based on current u-boot-tegra/next. Some Tegra20 files were
changed or moved to enable use of common code/headers.

Future patches will add support/drivers for MMC, USB, I2C, SPI, NAND
and other peripherals. The Cardhu T30 boards is supported initially.

V2: Rework patchset as per feedback from Stephen and Simon.

Tom Warren (7):
  Tegra30: Add arch-tegra30 include files
  Tegra30: Add AVP (arm720t) files
  Tegra30: Add CPU (armv7) files
  Tegra30: Add common CPU (shared) files
  Tegra30: Cardhu: Add DT files
  Tegra30: Add generic Tegra30 build support
  Tegra30: Add/enable Cardhu build (T30 reference board)

 Makefile |6 +-
 arch/arm/cpu/arm720t/tegra-common/Makefile   |1 +
 arch/arm/cpu/arm720t/tegra-common/cpu.c  |  342 +++
 arch/arm/cpu/arm720t/tegra-common/cpu.h  |   64 +-
 arch/arm/cpu/arm720t/tegra-common/spl.c  |3 +-
 arch/arm/cpu/arm720t/tegra20/cpu.c   |  216 +
 arch/arm/cpu/arm720t/tegra30/Makefile|   41 +
 arch/arm/cpu/arm720t/tegra30/config.mk   |   19 +
 arch/arm/cpu/arm720t/tegra30/cpu.c   |  176 
 arch/arm/cpu/armv7/Makefile  |2 +-
 arch/arm/cpu/armv7/start.S   |4 +-
 arch/arm/cpu/armv7/tegra30/Makefile  |   40 +
 arch/arm/cpu/armv7/tegra30/config.mk |   19 +
 arch/arm/cpu/tegra-common/ap.c   |   22 +-
 arch/arm/cpu/tegra-common/board.c|   41 +-
 arch/arm/cpu/tegra-common/sys_info.c |5 +-
 arch/arm/cpu/tegra20-common/warmboot.c   |2 +-
 arch/arm/cpu/tegra30-common/Makefile |   44 +
 arch/arm/cpu/tegra30-common/clock.c  | 1092 ++
 arch/arm/cpu/tegra30-common/funcmux.c|   57 ++
 arch/arm/cpu/tegra30-common/pinmux.c |  506 ++
 arch/arm/dts/tegra30.dtsi|6 +
 arch/arm/include/asm/arch-tegra/ap.h |   50 +-
 arch/arm/include/asm/arch-tegra/clk_rst.h|  148 +++-
 arch/arm/include/asm/arch-tegra/clock.h  |8 +-
 arch/arm/include/asm/arch-tegra/funcmux.h|   39 +
 arch/arm/include/asm/arch-tegra/gp_padctrl.h |   39 +
 arch/arm/include/asm/arch-tegra/tegra.h  |   13 +-
 arch/arm/include/asm/arch-tegra20/funcmux.h  |   26 +-
 arch/arm/include/asm/arch-tegra20/gp_padctrl.h   |   17 +-
 arch/arm/include/asm/arch-tegra30/clock-tables.h |  378 
 arch/arm/include/asm/arch-tegra30/clock.h|   24 +
 arch/arm/include/asm/arch-tegra30/flow.h |   35 +
 arch/arm/include/asm/arch-tegra30/funcmux.h  |   31 +
 arch/arm/include/asm/arch-tegra30/gp_padctrl.h   |   59 ++
 arch/arm/include/asm/arch-tegra30/gpio.h |  304 ++
 arch/arm/include/asm/arch-tegra30/hardware.h |   22 +
 arch/arm/include/asm/arch-tegra30/pinmux.h   |  604 
 arch/arm/include/asm/arch-tegra30/pmu.h  |   23 +
 arch/arm/include/asm/arch-tegra30/spl.h  |   28 +
 arch/arm/include/asm/arch-tegra30/tegra.h|   26 +
 board/nvidia/cardhu/Makefile |   44 +
 board/nvidia/cardhu/cardhu.c |   39 +
 board/nvidia/cardhu/pinmux-config-cardhu.h   |  339 +++
 board/nvidia/common/board.c  |   17 +-
 board/nvidia/dts/tegra30-cardhu.dts  |   14 +
 boards.cfg   |1 +
 include/configs/cardhu.h |   52 +
 include/configs/tegra-common.h   |  163 
 include/configs/tegra20-common.h |  171 +---
 include/configs/tegra30-common.h |   54 ++
 include/serial.h |2 +-
 spl/Makefile |2 +-
 53 files changed, 4973 insertions(+), 507 deletions(-)
 create mode 100644 arch/arm/cpu/arm720t/tegra-common/cpu.c
 create mode 100644 arch/arm/cpu/arm720t/tegra30/Makefile
 create mode 100644 arch/arm/cpu/arm720t/tegra30/config.mk
 create mode 100644 arch/arm/cpu/arm720t/tegra30/cpu.c
 create mode 100644 arch/arm/cpu/armv7/tegra30/Makefile
 create mode 100644 arch/arm/cpu/armv7/tegra30/config.mk
 create mode 100644 arch/arm/cpu/tegra30-common/Makefile
 create mode 100644 arch/arm/cpu/tegra30-common/clock.c
 create mode 100644 arch/arm/cpu/tegra30-common/funcmux.c
 create mode 100644 arch/arm/cpu/tegra30-common/pinmux.c
 create mode 100644 arch/arm/dts/tegra30.dtsi
 create mode 100644 arch/arm/include/asm/arch-tegra/funcmux.h
 create mode 100644 arch/arm/include/asm/arch-tegra/gp_padctrl.h
 create mode 100644 arch/arm/include/asm/arch-tegra30/clock-tables.h
 create mode 100644 

[U-Boot] [PATCH v2 1/7] Tegra30: Add arch-tegra30 include files

2012-12-03 Thread Tom Warren
Common Tegra files are in arch-tegra, shared between T20 and T30.
Tegra30-specific headers are in arch-tegra30. Note that some of
these will be filled in as more T30 support is added (drivers,
WB/LP0 support, etc.). A couple of Tegra20 files were changed
to support common headers in arch-tegra, also.

Signed-off-by: Tom Warren twar...@nvidia.com
---
V2:
* Created common header files in arch-tegra.
* Reworked pmux func name enums, RSVDx values to end of list.
* Added spl.h for T30, removed emc.h.

 arch/arm/include/asm/arch-tegra/clk_rst.h|  148 +-
 arch/arm/include/asm/arch-tegra/clock.h  |8 +-
 arch/arm/include/asm/arch-tegra/funcmux.h|   39 ++
 arch/arm/include/asm/arch-tegra/gp_padctrl.h |   39 ++
 arch/arm/include/asm/arch-tegra/tegra.h  |   13 +-
 arch/arm/include/asm/arch-tegra20/funcmux.h  |   26 +-
 arch/arm/include/asm/arch-tegra20/gp_padctrl.h   |   17 +-
 arch/arm/include/asm/arch-tegra30/clock-tables.h |  378 ++
 arch/arm/include/asm/arch-tegra30/clock.h|   24 +
 arch/arm/include/asm/arch-tegra30/flow.h |   35 ++
 arch/arm/include/asm/arch-tegra30/funcmux.h  |   31 ++
 arch/arm/include/asm/arch-tegra30/gp_padctrl.h   |   59 +++
 arch/arm/include/asm/arch-tegra30/gpio.h |  304 +++
 arch/arm/include/asm/arch-tegra30/hardware.h |   22 +
 arch/arm/include/asm/arch-tegra30/pinmux.h   |  604 ++
 arch/arm/include/asm/arch-tegra30/pmu.h  |   23 +
 arch/arm/include/asm/arch-tegra30/spl.h  |   28 +
 arch/arm/include/asm/arch-tegra30/tegra.h|   26 +
 18 files changed, 1776 insertions(+), 48 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-tegra/funcmux.h
 create mode 100644 arch/arm/include/asm/arch-tegra/gp_padctrl.h
 create mode 100644 arch/arm/include/asm/arch-tegra30/clock-tables.h
 create mode 100644 arch/arm/include/asm/arch-tegra30/clock.h
 create mode 100644 arch/arm/include/asm/arch-tegra30/flow.h
 create mode 100644 arch/arm/include/asm/arch-tegra30/funcmux.h
 create mode 100644 arch/arm/include/asm/arch-tegra30/gp_padctrl.h
 create mode 100644 arch/arm/include/asm/arch-tegra30/gpio.h
 create mode 100644 arch/arm/include/asm/arch-tegra30/hardware.h
 create mode 100644 arch/arm/include/asm/arch-tegra30/pinmux.h
 create mode 100644 arch/arm/include/asm/arch-tegra30/pmu.h
 create mode 100644 arch/arm/include/asm/arch-tegra30/spl.h
 create mode 100644 arch/arm/include/asm/arch-tegra30/tegra.h

diff --git a/arch/arm/include/asm/arch-tegra/clk_rst.h 
b/arch/arm/include/asm/arch-tegra/clk_rst.h
index 7b548c2..6a6e507 100644
--- a/arch/arm/include/asm/arch-tegra/clk_rst.h
+++ b/arch/arm/include/asm/arch-tegra/clk_rst.h
@@ -21,8 +21,8 @@
  * MA 02111-1307 USA
  */
 
-#ifndef _CLK_RST_H_
-#define _CLK_RST_H_
+#ifndef _TEGRA_CLK_RST_H_
+#define _TEGRA_CLK_RST_H_
 
 /* PLL registers - there are several PLLs in the clock controller */
 struct clk_pll {
@@ -37,6 +37,12 @@ struct clk_pll_simple {
uint pll_misc;  /* other misc things */
 };
 
+/* RST_DEV_(L,H,U,V,W)_(SET,CLR) and CLK_ENB_(L,H,U,V,W)_(SET,CLR) */
+struct clk_set_clr {
+   uint set;
+   uint clr;
+};
+
 /*
  * Most PLLs use the clk_pll structure, but some have a simpler two-member
  * structure for which we use clk_pll_simple. The reason for this non-
@@ -45,8 +51,10 @@ struct clk_pll_simple {
 enum {
TEGRA_CLK_PLLS  = 6,/* Number of normal PLLs */
TEGRA_CLK_SIMPLE_PLLS   = 3,/* Number of simple PLLs */
-   TEGRA_CLK_REGS  = 3,/* Number of clock enable registers */
-   TEGRA_CLK_SOURCES   = 64,   /* Number of peripheral clock sources */
+   TEGRA_CLK_REGS  = 3,/* Number of clock enable regs L/H/U */
+   TEGRA_CLK_SOURCES   = 64,   /* Number of ppl clock sources L/H/U */
+   TEGRA_CLK_REGS_VW   = 2,/* Number of clock enable regs V/W */
+   TEGRA_CLK_SOURCES_VW= 32,   /* Number of ppl clock sources V/W*/
 };
 
 /* Clock/Reset Controller (CLK_RST_CONTROLLER_) regs */
@@ -82,14 +90,53 @@ struct clk_rst_ctlr {
uint crc_reserved11;/* _reserved_11,0xFC */
 
uint crc_clk_src[TEGRA_CLK_SOURCES]; /*_I2S1_0...   0x100-1fc */
-   uint crc_reserved20[80];/*  0x200-33C */
-   uint crc_cpu_cmplx_set; /* _CPU_CMPLX_SET_0,0x340 */
-   uint crc_cpu_cmplx_clr; /* _CPU_CMPLX_CLR_0,0x344 */
+
+   uint crc_reserved20[64];/* _reserved_20,0x200-2fc */
+
+   /* _RST_DEV_L/H/U_SET_0 0x300 ~ 0x314 */
+   struct clk_set_clr crc_rst_dev_ex[TEGRA_CLK_REGS];
+
+   uint crc_reserved30[2]; /* _reserved_30,0x318, 0x31c */
+
+   /* _CLK_ENB_L/H/U_CLR_0 0x320 ~ 0x334 */
+   struct clk_set_clr crc_clk_enb_ex[TEGRA_CLK_REGS];
+
+   uint crc_reserved31[2]; /* _reserved_31,0x338, 0x33c */
+
+   uint crc_cpu_cmplx_set;   

[U-Boot] [PATCH v2 2/7] Tegra30: Add AVP (arm720t) files

2012-12-03 Thread Tom Warren
This provides SPL support for T30 boards - AVP early init, plus
CPU (A9) init/jump to main U-Boot.

Some changes were made to Tegra20 cpu.c to move common routines
into tegra-common/cpu.c and reduce code duplication.

Signed-off-by: Tom Warren twar...@nvidia.com
---
V2: Move common CPU init code to tegra-common/cpu.c

 arch/arm/cpu/arm720t/tegra-common/Makefile |1 +
 arch/arm/cpu/arm720t/tegra-common/cpu.c|  342 
 arch/arm/cpu/arm720t/tegra-common/cpu.h|   64 ++
 arch/arm/cpu/arm720t/tegra-common/spl.c|3 +-
 arch/arm/cpu/arm720t/tegra20/cpu.c |  216 ++
 arch/arm/cpu/arm720t/tegra30/Makefile  |   41 
 arch/arm/cpu/arm720t/tegra30/config.mk |   19 ++
 arch/arm/cpu/arm720t/tegra30/cpu.c |  176 ++
 8 files changed, 615 insertions(+), 247 deletions(-)
 create mode 100644 arch/arm/cpu/arm720t/tegra-common/cpu.c
 create mode 100644 arch/arm/cpu/arm720t/tegra30/Makefile
 create mode 100644 arch/arm/cpu/arm720t/tegra30/config.mk
 create mode 100644 arch/arm/cpu/arm720t/tegra30/cpu.c

diff --git a/arch/arm/cpu/arm720t/tegra-common/Makefile 
b/arch/arm/cpu/arm720t/tegra-common/Makefile
index febd2e3..6cbc6ad 100644
--- a/arch/arm/cpu/arm720t/tegra-common/Makefile
+++ b/arch/arm/cpu/arm720t/tegra-common/Makefile
@@ -28,6 +28,7 @@ include $(TOPDIR)/config.mk
 LIB= $(obj)libtegra-common.o
 
 COBJS-$(CONFIG_SPL_BUILD) += spl.o
+COBJS-y+= cpu.o
 
 SRCS   := $(COBJS-y:.o=.c)
 OBJS   := $(addprefix $(obj),$(COBJS-y))
diff --git a/arch/arm/cpu/arm720t/tegra-common/cpu.c 
b/arch/arm/cpu/arm720t/tegra-common/cpu.c
new file mode 100644
index 000..2fbe02b
--- /dev/null
+++ b/arch/arm/cpu/arm720t/tegra-common/cpu.c
@@ -0,0 +1,342 @@
+/*
+ * Copyright (c) 2010-2012, NVIDIA CORPORATION.  All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope 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, see http://www.gnu.org/licenses/.
+ */
+
+#include common.h
+#include asm/io.h
+#include asm/arch/clock.h
+#include asm/arch/gp_padctrl.h
+#include asm/arch/pinmux.h
+#include asm/arch/tegra.h
+#include asm/arch-tegra/clk_rst.h
+#include asm/arch-tegra/pmc.h
+#include asm/arch-tegra/scu.h
+#include cpu.h
+
+enum tegra_family_t {
+   TEGRA_FAMILY_T2x,
+   TEGRA_FAMILY_T3x,
+};
+
+
+enum tegra_family_t get_family(void)
+{
+   u32 reg, chip_id;
+
+   reg = readl(NV_PA_APB_MISC_BASE + GP_HIDREV);
+
+   chip_id = reg  8;
+   chip_id = 0xff;
+   debug(  tegra_get_family: chip_id = %x\n, chip_id);
+   if (chip_id == 0x30)
+   return TEGRA_FAMILY_T3x;
+   else
+   return TEGRA_FAMILY_T2x;
+}
+
+int get_num_cpus(void)
+{
+   return get_family() == TEGRA_FAMILY_T3x ? 4 : 2;
+}
+
+/*
+ * Timing tables for each SOC for all four oscillator options.
+ */
+struct clk_pll_table tegra_pll_x_table[TEGRA_SOC_CNT][CLOCK_OSC_FREQ_COUNT] = {
+   /* T20: 1 GHz */
+   {{ 1000, 13, 0, 12},/* OSC 13M */
+{ 625,  12, 0, 8}, /* OSC 19.2M */
+{ 1000, 12, 0, 12},/* OSC 12M */
+{ 1000, 26, 0, 12},/* OSC 26M */
+   },
+
+   /* T25: 1.2 GHz */
+   {{ 923, 10, 0, 12},
+{ 750, 12, 0, 8},
+{ 600,  6, 0, 12},
+{ 600, 13, 0, 12},
+   },
+
+   /* T30(slow): 1.0 GHz */
+   {{ 1000,  13, 0, 8},
+{ 625,  12, 0, 4},
+{ 1000, 12, 0, 8},
+{ 1000,  26, 0, 8},
+   },
+
+   /* T30(high): 1.4 GHz */
+   {{ 862, 8, 0, 8},
+{ 583, 8, 0, 4},
+{ 700, 6, 0, 8},
+{ 700, 13, 0, 8},
+   },
+
+   /* TEGRA_SOC2_SLOW: 312 MHz */
+   {{ 312, 13, 0, 12}, /* OSC 13M */
+{ 260, 16, 0, 8},  /* OSC 19.2M */
+{ 312, 12, 0, 12}, /* OSC 12M */
+{ 312, 26, 0, 12}, /* OSC 26M */
+   },
+};
+
+void adjust_pllp_out_freqs(void)
+{
+   struct clk_rst_ctlr *clkrst = (struct clk_rst_ctlr *)NV_PA_CLK_RST_BASE;
+   struct clk_pll *pll = clkrst-crc_pll[CLOCK_ID_PERIPH];
+   u32 reg;
+
+   /* Set T30 PLLP_OUT1, 2, 3  4 freqs to 9.6, 48, 102  204MHz */
+   reg = readl(pll-pll_out[0]); /* OUTA, contains OUT2 / OUT1 */
+   reg |= (IN_408_OUT_48_DIVISOR  PLLP_OUT2_RATIO) | PLLP_OUT2_OVR
+   | (IN_408_OUT_9_6_DIVISOR  PLLP_OUT1_RATIO) | PLLP_OUT1_OVR;
+   writel(reg, pll-pll_out[0]);
+
+   reg = readl(pll-pll_out[1]);   /* OUTB, contains OUT4 / OUT3 */
+   reg |= (IN_408_OUT_204_DIVISOR  PLLP_OUT4_RATIO) | 

[U-Boot] [PATCH v2 3/7] Tegra30: Add CPU (armv7) files

2012-12-03 Thread Tom Warren
These files are for code that runs on the CPU (A9) on T30 boards.
At this time, it's only the RCM (Recovery Mode) cmd file, which
is in tegra-common. As T30-specific run-time code is added, it'll
go here.

Signed-off-by: Tom Warren twar...@nvidia.com
---
V2: Cleanup whitespace issues

 arch/arm/cpu/armv7/tegra30/Makefile  |   40 ++
 arch/arm/cpu/armv7/tegra30/config.mk |   19 
 2 files changed, 59 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/cpu/armv7/tegra30/Makefile
 create mode 100644 arch/arm/cpu/armv7/tegra30/config.mk

diff --git a/arch/arm/cpu/armv7/tegra30/Makefile 
b/arch/arm/cpu/armv7/tegra30/Makefile
new file mode 100644
index 000..04adb52
--- /dev/null
+++ b/arch/arm/cpu/armv7/tegra30/Makefile
@@ -0,0 +1,40 @@
+#
+# Copyright (c) 2010-2012, NVIDIA CORPORATION.  All rights reserved.
+#
+# (C) Copyright 2000-2003
+# Wolfgang Denk, DENX Software Engineering, w...@denx.de.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms and conditions of the GNU General Public License,
+# version 2, as published by the Free Software Foundation.
+#
+# This program is distributed in the hope 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, see http://www.gnu.org/licenses/.
+#
+
+include $(TOPDIR)/config.mk
+
+LIB= $(obj)lib$(SOC).o
+
+COBJS  := $(COBJS-y)
+SRCS   := $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+
+all:   $(obj).depend $(LIB)
+
+$(LIB):$(OBJS)
+   $(call cmd_link_o_target, $(OBJS))
+
+#
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
diff --git a/arch/arm/cpu/armv7/tegra30/config.mk 
b/arch/arm/cpu/armv7/tegra30/config.mk
new file mode 100644
index 000..719ca81
--- /dev/null
+++ b/arch/arm/cpu/armv7/tegra30/config.mk
@@ -0,0 +1,19 @@
+#
+# Copyright (c) 2010-2012, NVIDIA CORPORATION.  All rights reserved.
+#
+# (C) Copyright 2002
+# Gary Jennejohn, DENX Software Engineering, ga...@denx.de
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms and conditions of the GNU General Public License,
+# version 2, as published by the Free Software Foundation.
+#
+# This program is distributed in the hope 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, see http://www.gnu.org/licenses/.
+#
+CONFIG_ARCH_DEVICE_TREE := tegra30
-- 
1.7.0.4

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


[U-Boot] [PATCH V2 4/7] Tegra30: Add common CPU (shared) files

2012-12-03 Thread Tom Warren
These files are used by both SPL and main U-Boot.
Also made minor changes to shared Tegra code to support
T30 differences.

Signed-off-by: Tom Warren twar...@nvidia.com
---
V2:
* Differentiate between T20 and T30 in ODMDATA and query_sdram_size.
* Fix numerous func entries in pingroup table as per Stephen.
* Added warning about LOCK bit in pinmux_set_lock.

 arch/arm/cpu/tegra-common/ap.c |   22 +-
 arch/arm/cpu/tegra-common/board.c  |   41 ++-
 arch/arm/cpu/tegra-common/sys_info.c   |5 +-
 arch/arm/cpu/tegra20-common/warmboot.c |2 +-
 .../{arm720t/tegra30 = tegra30-common}/Makefile   |   11 +-
 .../cpu/{tegra20-common = tegra30-common}/clock.c |  508 +---
 arch/arm/cpu/tegra30-common/funcmux.c  |   57 +++
 arch/arm/cpu/tegra30-common/pinmux.c   |  506 +++
 arch/arm/include/asm/arch-tegra/ap.h   |   50 +--
 9 files changed, 873 insertions(+), 329 deletions(-)
 copy arch/arm/cpu/{arm720t/tegra30 = tegra30-common}/Makefile (80%)
 copy arch/arm/cpu/{tegra20-common = tegra30-common}/clock.c (75%)
 create mode 100644 arch/arm/cpu/tegra30-common/funcmux.c
 create mode 100644 arch/arm/cpu/tegra30-common/pinmux.c

diff --git a/arch/arm/cpu/tegra-common/ap.c b/arch/arm/cpu/tegra-common/ap.c
index c4eb137..e1a400c 100644
--- a/arch/arm/cpu/tegra-common/ap.c
+++ b/arch/arm/cpu/tegra-common/ap.c
@@ -20,10 +20,14 @@
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 * MA 02111-1307 USA
 */
+
+/* Tegra AP (Application Processor) code */
+
 #include common.h
 #include asm/io.h
 #include asm/arch/gp_padctrl.h
 #include asm/arch-tegra/ap.h
+#include asm/arch-tegra/clock.h
 #include asm/arch-tegra/fuse.h
 #include asm/arch-tegra/pmc.h
 #include asm/arch-tegra/scu.h
@@ -58,6 +62,20 @@ int tegra_get_chip_type(void)
return TEGRA_SOC_T25;
}
break;
+   case CHIPID_TEGRA30:
+   switch (tegra_sku_id) {
+   case SKU_ID_T30:
+   /*
+* T30 has two options. We will return TEGRA_SOC_T30
+* until we have the fdt set up when it may change to
+* TEGRA_SOC_T30_408MHZ depending on the PLLP freq.
+*/
+   if (clock_get_rate(CLOCK_ID_PERIPH) == 40800)
+   return TEGRA_SOC_T30_408MHZ;
+   else
+   return TEGRA_SOC_T30;
+   }
+   break;
}
/* unknown sku id */
return TEGRA_SOC_UNKNOWN;
@@ -93,7 +111,7 @@ static u32 get_odmdata(void)
 
u32 bct_start, odmdata;
 
-   bct_start = readl(AP20_BASE_PA_SRAM + NVBOOTINFOTABLE_BCTPTR);
+   bct_start = readl(NV_PA_BASE_SRAM + NVBOOTINFOTABLE_BCTPTR);
odmdata = readl(bct_start + BCT_ODMDATA_OFFSET);
 
return odmdata;
@@ -127,5 +145,5 @@ void s_init(void)
orrr0, r0, #0x41\n
mcrp15, 0, r0, c1, c0, 1\n);
 
-   /* FIXME: should have ap20's L2 disabled too? */
+   /* FIXME: should have SoC's L2 disabled too? */
 }
diff --git a/arch/arm/cpu/tegra-common/board.c 
b/arch/arm/cpu/tegra-common/board.c
index b2e10c6..af1879c 100644
--- a/arch/arm/cpu/tegra-common/board.c
+++ b/arch/arm/cpu/tegra-common/board.c
@@ -54,16 +54,37 @@ unsigned int query_sdram_size(void)
reg = readl(pmc-pmc_scratch20);
debug(pmc-pmc_scratch20 (ODMData) = 0x%08x\n, reg);
 
-   /* bits 31:28 in OdmData are used for RAM size  */
+#if defined(CONFIG_TEGRA20)
+   /* bits 30:28 in OdmData are used for RAM size on T20  */
+   reg = 0x7000;
+
switch ((reg)  28) {
case 1:
return 0x1000;  /* 256 MB */
+   case 0:
case 2:
default:
return 0x2000;  /* 512 MB */
case 3:
return 0x4000;  /* 1GB */
}
+#else  /* Tegra30 */
+   /* bits 31:28 in OdmData are used for RAM size on T30  */
+   switch ((reg)  28) {
+   case 0:
+   case 1:
+   default:
+   return 0x1000;  /* 256 MB */
+   case 2:
+   return 0x2000;  /* 512 MB */
+   case 3:
+   return 0x3000;  /* 768 MB */
+   case 4:
+   return 0x4000;  /* 1GB */
+   case 8:
+   return 0x7ff0;  /* 2GB - 1MB */
+   }
+#endif
 }
 
 int dram_init(void)
@@ -82,19 +103,27 @@ int checkboard(void)
 #endif /* CONFIG_DISPLAY_BOARDINFO */
 
 static int uart_configs[] = {
-#if defined(CONFIG_TEGRA_UARTA_UAA_UAB)
+#if defined(CONFIG_TEGRA20)
+ #if defined(CONFIG_TEGRA_UARTA_UAA_UAB)
FUNCMUX_UART1_UAA_UAB,
-#elif defined(CONFIG_TEGRA_UARTA_GPU)
+ #elif defined(CONFIG_TEGRA_UARTA_GPU)
FUNCMUX_UART1_GPU,
-#elif defined(CONFIG_TEGRA_UARTA_SDIO1)
+ #elif 

[U-Boot] [PATCH v2 5/7] Tegra30: Cardhu: Add DT files

2012-12-03 Thread Tom Warren
These are stripped down for bringup, They'll be filled out later
to match-up with the kernel DT contents, and/or as devices are
brought up (mmc, usb, spi, etc.).

Signed-off-by: Tom Warren twar...@nvidia.com
---
V2: Reduce to the minimum needed to build/boot to cmd prompt

 arch/arm/dts/tegra30.dtsi   |6 ++
 board/nvidia/dts/tegra30-cardhu.dts |   14 ++
 2 files changed, 20 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/dts/tegra30.dtsi
 create mode 100644 board/nvidia/dts/tegra30-cardhu.dts

diff --git a/arch/arm/dts/tegra30.dtsi b/arch/arm/dts/tegra30.dtsi
new file mode 100644
index 000..e29f5f6
--- /dev/null
+++ b/arch/arm/dts/tegra30.dtsi
@@ -0,0 +1,6 @@
+/include/ skeleton.dtsi
+
+/ {
+   model = NVIDIA Tegra30;
+   compatible = nvidia,tegra30;
+};
diff --git a/board/nvidia/dts/tegra30-cardhu.dts 
b/board/nvidia/dts/tegra30-cardhu.dts
new file mode 100644
index 000..0aa2625
--- /dev/null
+++ b/board/nvidia/dts/tegra30-cardhu.dts
@@ -0,0 +1,14 @@
+/dts-v1/;
+
+/memreserve/ 0x1c00 0x0400;
+/include/ ARCH_CPU_DTS
+
+/ {
+   model = NVIDIA Cardhu;
+   compatible = nvidia,cardhu, nvidia,tegra30;
+
+   memory {
+   device_type = memory;
+   reg = 0x8000 0xc000;
+   };
+};
-- 
1.7.0.4

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


[U-Boot] [PATCH v2 6/7] Tegra30: Add generic Tegra30 build support

2012-12-03 Thread Tom Warren
This patch adds basic Tegra30 (T30) build support - no specific
board is targeted.

Signed-off-by: Tom Warren twar...@nvidia.com
---
V2:
* Use generic CONFIG_TEGRA in Makefile instead of specific SOC test
* Cleanup a couple of include files due to T20/T30 build differences
* Move pinmux_init to board code

 Makefile|6 +++---
 arch/arm/cpu/armv7/Makefile |2 +-
 arch/arm/cpu/armv7/start.S  |4 ++--
 board/nvidia/common/board.c |   17 ++---
 include/serial.h|2 +-
 spl/Makefile|2 +-
 6 files changed, 22 insertions(+), 11 deletions(-)

diff --git a/Makefile b/Makefile
index 8a04727..5bbfbaf 100644
--- a/Makefile
+++ b/Makefile
@@ -344,7 +344,7 @@ endif
 ifeq ($(SOC),exynos)
 LIBS-y += $(CPUDIR)/s5p-common/libs5p-common.o
 endif
-ifeq ($(SOC),tegra20)
+ifneq ($(CONFIG_TEGRA),)
 LIBS-y += arch/$(ARCH)/cpu/$(SOC)-common/lib$(SOC)-common.o
 LIBS-y += arch/$(ARCH)/cpu/tegra-common/libcputegra-common.o
 LIBS-y += $(CPUDIR)/tegra-common/libtegra-common.o
@@ -408,7 +408,7 @@ ALL-$(CONFIG_SPL) += $(obj)spl/u-boot-spl.bin
 ALL-$(CONFIG_OF_SEPARATE) += $(obj)u-boot.dtb $(obj)u-boot-dtb.bin
 
 # enable combined SPL/u-boot/dtb rules for tegra
-ifeq ($(SOC),tegra20)
+ifneq ($(CONFIG_TEGRA),)
 ifeq ($(CONFIG_OF_SEPARATE),y)
 ALL-y += $(obj)u-boot-dtb-tegra.bin
 else
@@ -515,7 +515,7 @@ $(obj)u-boot.spr:   $(obj)u-boot.img 
$(obj)spl/u-boot-spl.bin
conv=notrunc 2/dev/null
cat $(obj)spl/u-boot-spl-pad.img $(obj)u-boot.img  $@
 
-ifeq ($(SOC),tegra20)
+ifneq ($(CONFIG_TEGRA),)
 ifeq ($(CONFIG_OF_SEPARATE),y)
 nodtb=dtb
 dtbfile=$(obj)u-boot.dtb
diff --git a/arch/arm/cpu/armv7/Makefile b/arch/arm/cpu/armv7/Makefile
index 4fdbee4..ee8c2b3 100644
--- a/arch/arm/cpu/armv7/Makefile
+++ b/arch/arm/cpu/armv7/Makefile
@@ -32,7 +32,7 @@ COBJS += cache_v7.o
 COBJS  += cpu.o
 COBJS  += syslib.o
 
-ifneq ($(CONFIG_AM33XX)$(CONFIG_OMAP44XX)$(CONFIG_OMAP54XX)$(CONFIG_TEGRA20),)
+ifneq ($(CONFIG_AM33XX)$(CONFIG_OMAP44XX)$(CONFIG_OMAP54XX)$(CONFIG_TEGRA),)
 SOBJS  += lowlevel_init.o
 endif
 
diff --git a/arch/arm/cpu/armv7/start.S b/arch/arm/cpu/armv7/start.S
index 7df97c5..213f452 100644
--- a/arch/arm/cpu/armv7/start.S
+++ b/arch/arm/cpu/armv7/start.S
@@ -272,12 +272,12 @@ jump_2_ram:
 /*
  * Move vector table
  */
-#if !defined(CONFIG_TEGRA20)
+#if !defined(CONFIG_TEGRA)
/* Set vector address in CP15 VBAR register */
ldr r0, =_start
add r0, r0, r9
mcr p15, 0, r0, c12, c0, 0  @Set VBAR
-#endif /* !Tegra20 */
+#endif /* !Tegra */
 
ldr r0, _board_init_r_ofs
adr r1, _start
diff --git a/board/nvidia/common/board.c b/board/nvidia/common/board.c
index 819c120..a4af539 100644
--- a/board/nvidia/common/board.c
+++ b/board/nvidia/common/board.c
@@ -26,22 +26,30 @@
 #include linux/compiler.h
 #include asm/io.h
 #include asm/arch/clock.h
+#ifdef CONFIG_LCD
 #include asm/arch/display.h
-#include asm/arch/emc.h
+#endif
 #include asm/arch/funcmux.h
 #include asm/arch/pinmux.h
 #include asm/arch/pmu.h
+#ifdef CONFIG_PWM_TEGRA
 #include asm/arch/pwm.h
+#endif
 #include asm/arch/tegra.h
-#include asm/arch/usb.h
 #include asm/arch-tegra/board.h
 #include asm/arch-tegra/clk_rst.h
 #include asm/arch-tegra/pmc.h
 #include asm/arch-tegra/sys_proto.h
 #include asm/arch-tegra/uart.h
 #include asm/arch-tegra/warmboot.h
-#include spi.h
+#ifdef CONFIG_TEGRA_CLOCK_SCALING
+#include asm/arch/emc.h
+#endif
+#ifdef CONFIG_USB_EHCI_TEGRA
+#include asm/arch/usb.h
+#endif
 #include i2c.h
+#include spi.h
 #include emc.h
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -188,6 +196,9 @@ void gpio_early_init(void) __attribute__((weak, 
alias(__gpio_early_init)));
 
 int board_early_init_f(void)
 {
+#if defined(CONFIG_TEGRA30)
+   pinmux_init();
+#endif
board_init_uart_f();
 
/* Initialize periph GPIOs */
diff --git a/include/serial.h b/include/serial.h
index 14f863e..f6bb2b9 100644
--- a/include/serial.h
+++ b/include/serial.h
@@ -32,7 +32,7 @@ extern struct serial_device *default_serial_console(void);
defined(CONFIG_MB86R0x) || defined(CONFIG_MPC5xxx) || \
defined(CONFIG_MPC83xx) || defined(CONFIG_MPC85xx) || \
defined(CONFIG_MPC86xx) || defined(CONFIG_SYS_SC520) || \
-   defined(CONFIG_TEGRA20) || defined(CONFIG_SYS_COREBOOT) || \
+   defined(CONFIG_TEGRA) || defined(CONFIG_SYS_COREBOOT) || \
defined(CONFIG_MICROBLAZE)
 extern struct serial_device serial0_device;
 extern struct serial_device serial1_device;
diff --git a/spl/Makefile b/spl/Makefile
index 6a79c3c..8dee4e0 100644
--- a/spl/Makefile
+++ b/spl/Makefile
@@ -65,7 +65,7 @@ ifneq 
($(CONFIG_AM33XX)$(CONFIG_OMAP34XX)$(CONFIG_OMAP44XX)$(CONFIG_OMAP54XX),)
 LIBS-y += $(CPUDIR)/omap-common/libomap-common.o
 endif
 
-ifeq ($(SOC),tegra20)
+ifneq ($(CONFIG_TEGRA),)
 LIBS-y += arch/$(ARCH)/cpu/$(SOC)-common/lib$(SOC)-common.o
 LIBS-y += arch/$(ARCH)/cpu/tegra-common/libcputegra-common.o
 LIBS-y += 

[U-Boot] [PATCH v2 7/7] Tegra30: Add/enable Cardhu build (T30 reference board)

2012-12-03 Thread Tom Warren
This build is stripped down. It boots to the command prompt.
GPIO is the only peripheral supported. Others TBD.

include/configs/tegra-common.h now holds common config options
for Tegra SoCs.

Signed-off-by: Tom Warren twar...@nvidia.com
---
V2:
* Move pinmux_init to cardhu.c, move pinmux-config header here, too.
* tegra-common.h holds CONFIG options/defines commmon to all Tegra SoCs.

 board/nvidia/cardhu/Makefile   |   44 
 board/nvidia/cardhu/cardhu.c   |   39 
 board/nvidia/cardhu/pinmux-config-cardhu.h |  339 
 boards.cfg |1 +
 include/configs/cardhu.h   |   52 +
 include/configs/tegra-common.h |  163 +
 include/configs/tegra20-common.h   |  171 ++
 include/configs/tegra30-common.h   |   54 +
 8 files changed, 716 insertions(+), 147 deletions(-)
 create mode 100644 board/nvidia/cardhu/Makefile
 create mode 100644 board/nvidia/cardhu/cardhu.c
 create mode 100644 board/nvidia/cardhu/pinmux-config-cardhu.h
 create mode 100644 include/configs/cardhu.h
 create mode 100644 include/configs/tegra-common.h
 create mode 100644 include/configs/tegra30-common.h

diff --git a/board/nvidia/cardhu/Makefile b/board/nvidia/cardhu/Makefile
new file mode 100644
index 000..913f1ce
--- /dev/null
+++ b/board/nvidia/cardhu/Makefile
@@ -0,0 +1,44 @@
+#
+#  (C) Copyright 2010-2012
+#  NVIDIA Corporation www.nvidia.com
+#
+#
+#  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  := $(BOARD).o
+
+SRCS   := $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+
+$(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/nvidia/cardhu/cardhu.c b/board/nvidia/cardhu/cardhu.c
new file mode 100644
index 000..df4cb6b
--- /dev/null
+++ b/board/nvidia/cardhu/cardhu.c
@@ -0,0 +1,39 @@
+/*
+ *  (C) Copyright 2010-2012
+ *  NVIDIA Corporation www.nvidia.com
+ *
+ * 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 common.h
+#include asm/arch/pinmux.h
+#include pinmux-config-cardhu.h
+
+/*
+ * Routine: pinmux_init
+ * Description: Do individual peripheral pinmux configs
+ */
+void pinmux_init(void)
+{
+   pinmux_config_table(tegra3_pinmux_common,
+   ARRAY_SIZE(tegra3_pinmux_common));
+
+   pinmux_config_table(unused_pins_lowpower,
+   ARRAY_SIZE(unused_pins_lowpower));
+}
diff --git a/board/nvidia/cardhu/pinmux-config-cardhu.h 
b/board/nvidia/cardhu/pinmux-config-cardhu.h
new file mode 100644
index 000..df85fe1
--- /dev/null
+++ b/board/nvidia/cardhu/pinmux-config-cardhu.h
@@ -0,0 +1,339 @@
+/*
+ * Copyright (c) 2010-2012, NVIDIA CORPORATION.  All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope 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 

[U-Boot] [PATCH v2 10/21] x86: fdt: Create basic .dtsi file for coreboot

2012-12-03 Thread Simon Glass
This contains just the minimum information for a coreboot-based board.

Signed-off-by: Stefan Reinauer reina...@chromium.org
Signed-off-by: Gabe Black gabebl...@chromium.org
Signed-off-by: Simon Glass s...@chromium.org
---
Changes in v2:
- Update alex to use this include file
- Add an empty link .dts which also uses this include file

 arch/x86/dts/coreboot.dtsi |   16 +
 arch/x86/dts/skeleton.dtsi |   13 ++
 .../chromebook-x86/dts/{x86-alex.dts = alex.dts}  |   18 +--
 board/chromebook-x86/dts/link.dts  |   24 
 4 files changed, 59 insertions(+), 12 deletions(-)
 create mode 100644 arch/x86/dts/coreboot.dtsi
 create mode 100644 arch/x86/dts/skeleton.dtsi
 rename board/chromebook-x86/dts/{x86-alex.dts = alex.dts} (53%)
 create mode 100644 board/chromebook-x86/dts/link.dts

diff --git a/arch/x86/dts/coreboot.dtsi b/arch/x86/dts/coreboot.dtsi
new file mode 100644
index 000..4862a59
--- /dev/null
+++ b/arch/x86/dts/coreboot.dtsi
@@ -0,0 +1,16 @@
+/include/ skeleton.dtsi
+
+/ {
+   aliases {
+   console = /serial;
+   };
+
+   serial {
+   compatible = ns16550;
+   reg-shift = 1;
+   io-mapped = 1;
+   multiplier = 1;
+   baudrate = 115200;
+   status = disabled;
+   };
+};
diff --git a/arch/x86/dts/skeleton.dtsi b/arch/x86/dts/skeleton.dtsi
new file mode 100644
index 000..b41d241
--- /dev/null
+++ b/arch/x86/dts/skeleton.dtsi
@@ -0,0 +1,13 @@
+/*
+ * Skeleton device tree; the bare minimum needed to boot; just include and
+ * add a compatible value.  The bootloader will typically populate the memory
+ * node.
+ */
+
+/ {
+   #address-cells = 1;
+   #size-cells = 1;
+   chosen { };
+   aliases { };
+   memory { device_type = memory; reg = 0 0; };
+};
diff --git a/board/chromebook-x86/dts/x86-alex.dts 
b/board/chromebook-x86/dts/alex.dts
similarity index 53%
rename from board/chromebook-x86/dts/x86-alex.dts
rename to board/chromebook-x86/dts/alex.dts
index bd90d18..cb6a9e4 100644
--- a/board/chromebook-x86/dts/x86-alex.dts
+++ b/board/chromebook-x86/dts/alex.dts
@@ -1,5 +1,7 @@
 /dts-v1/;
 
+/include/ coreboot.dtsi
+
 / {
 #address-cells = 1;
 #size-cells = 1;
@@ -10,19 +12,11 @@
   silent_console = 0;
};
 
-   aliases {
-   console = /serial@e0401000;
-   };
+gpio: gpio {};
 
-   serial@e0401000 {
-   compatible = ns16550;
-   reg = 0xe0401000 0x40;
-   id = 1;
-   reg-shift = 1;
-   baudrate = 115200;
-   clock-frequency = 400;
-   multiplier = 1;
-   status = ok;
+   serial {
+   reg = 0x3f8 8;
+   clock-frequency = 115200;
};
 
 chosen { };
diff --git a/board/chromebook-x86/dts/link.dts 
b/board/chromebook-x86/dts/link.dts
new file mode 100644
index 000..af60f59
--- /dev/null
+++ b/board/chromebook-x86/dts/link.dts
@@ -0,0 +1,24 @@
+/dts-v1/;
+
+/include/ coreboot.dtsi
+
+/ {
+#address-cells = 1;
+#size-cells = 1;
+   model = Google Link;
+   compatible = google,link, intel,celeron-ivybridge;
+
+   config {
+  silent_console = 0;
+   };
+
+gpio: gpio {};
+
+   serial {
+   reg = 0x3f8 8;
+   clock-frequency = 115200;
+   };
+
+chosen { };
+memory { device_type = memory; reg = 0 0; };
+};
-- 
1.7.7.3

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


[U-Boot] [PATCH v2 11/21] x86: Emit port 80 post codes in show_boot_progress()

2012-12-03 Thread Simon Glass
From: Stefan Reinauer reina...@chromium.org

This helps us monitor boot progress and determine where U-Boot dies if
there are any problems.

Signed-off-by: Stefan Reinauer reina...@google.com

Signed-off-by: Simon Glass s...@chromium.org
---
Changes in v2:
- Enable boot progress in coreboot config file

 arch/x86/cpu/coreboot/coreboot.c |2 ++
 include/configs/coreboot.h   |2 +-
 2 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/arch/x86/cpu/coreboot/coreboot.c b/arch/x86/cpu/coreboot/coreboot.c
index f262800..5a4c3e5 100644
--- a/arch/x86/cpu/coreboot/coreboot.c
+++ b/arch/x86/cpu/coreboot/coreboot.c
@@ -28,6 +28,7 @@
 #include netdev.h
 #include asm/msr.h
 #include asm/cache.h
+#include asm/io.h
 #include asm/arch-coreboot/tables.h
 #include asm/arch-coreboot/sysinfo.h
 #include asm/arch/timestamp.h
@@ -68,6 +69,7 @@ int board_early_init_r(void)
 
 void show_boot_progress(int val)
 {
+   outb(val, 0x80);
 }
 
 
diff --git a/include/configs/coreboot.h b/include/configs/coreboot.h
index e45ecad..94b6917 100644
--- a/include/configs/coreboot.h
+++ b/include/configs/coreboot.h
@@ -35,7 +35,7 @@
  * (easy to change)
  */
 #define CONFIG_SYS_COREBOOT
-#undef CONFIG_SHOW_BOOT_PROGRESS
+#define CONFIG_SHOW_BOOT_PROGRESS
 #define CONFIG_LAST_STAGE_INIT
 #define CONFIG_X86_NO_RESET_VECTOR
 #define CONFIG_SYS_VSNPRINTF
-- 
1.7.7.3

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


[U-Boot] [PATCH v2 12/21] x86: Fix MTRR clear to detect which MTRR to use

2012-12-03 Thread Simon Glass
From: Duncan Laurie dlau...@chromium.org

Coreboot was always using MTRR 7 for the write-protect
cache entry that covers the ROM and U-boot was removing it.
However with 4GB configs we need more MTRRs for the BIOS
and so the WP MTRR needs to move.  Instead coreboot will
always use the last available MTRR that is normally set
aside for OS use and U-boot can clear it before the OS.

Signed-off-by: Duncan Laurie dlau...@chromium.org
Signed-off-by: Simon Glass s...@chromium.org
---
Changes in v2:
- Rebase to deal with cache code changes
- Use functions from Graeme's msr patch

 arch/x86/cpu/coreboot/coreboot.c |   19 +++
 1 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/arch/x86/cpu/coreboot/coreboot.c b/arch/x86/cpu/coreboot/coreboot.c
index 5a4c3e5..f73977f 100644
--- a/arch/x86/cpu/coreboot/coreboot.c
+++ b/arch/x86/cpu/coreboot/coreboot.c
@@ -94,6 +94,8 @@ void setup_pcat_compatibility()
 {
 }
 
+#define MTRR_TYPE_WP  5
+#define MTRRcap_MSR   0xfe
 #define MTRRphysBase_MSR(reg) (0x200 + 2 * (reg))
 #define MTRRphysMask_MSR(reg) (0x200 + 2 * (reg) + 1)
 
@@ -101,11 +103,20 @@ int board_final_cleanup(void)
 {
/* Un-cache the ROM so the kernel has one
 * more MTRR available.
+*
+* Coreboot should have assigned this to the
+* top available variable MTRR.
 */
-   disable_caches();
-   wrmsrl(MTRRphysBase_MSR(7), 0);
-   wrmsrl(MTRRphysMask_MSR(7), 0);
-   enable_caches();
+   u8 top_mtrr = (native_read_msr(MTRRcap_MSR)  0xff) - 1;
+   u8 top_type = native_read_msr(MTRRphysBase_MSR(top_mtrr))  0xff;
+
+   /* Make sure this MTRR is the correct Write-Protected type */
+   if (top_type == MTRR_TYPE_WP) {
+   disable_caches();
+   wrmsrl(MTRRphysBase_MSR(top_mtrr), 0);
+   wrmsrl(MTRRphysMask_MSR(top_mtrr), 0);
+   enable_caches();
+   }
 
return 0;
 }
-- 
1.7.7.3

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


[U-Boot] [PATCH v2 14/21] x86: Provide tick counter and frequency reference for Intel core architecture

2012-12-03 Thread Simon Glass
From: Vadim Bendebury vben...@chromium.org

Some u-boot modules rely on availability of get_ticks() and
get_tbclk() functions, reporting a free running clock and its
frequency respectively. Traditionally these functions return number
and frequency of timer interrupts.

Intel's core architecture processors however are known to run the
rdtsc instruction at a constant rate of the so called 'Max Non Turbo
ratio' times the external clock frequency which is 100MHz. This is
just as good for the timer tick functions in question.

Signed-off-by: Vadim Bendebury vben...@chromium.org
Signed-off-by: Simon Glass s...@chromium.org
---
Changes in v2:
- Use functions from Graeme's msr patch

 arch/x86/cpu/interrupts.c |   31 +++
 1 files changed, 31 insertions(+), 0 deletions(-)

diff --git a/arch/x86/cpu/interrupts.c b/arch/x86/cpu/interrupts.c
index e788715..dd30a05 100644
--- a/arch/x86/cpu/interrupts.c
+++ b/arch/x86/cpu/interrupts.c
@@ -34,6 +34,8 @@
 #include asm/io.h
 #include asm/processor-flags.h
 #include linux/compiler.h
+#include asm/msr.h
+#include asm/u-boot-x86.h
 
 #define DECLARE_INTERRUPT(x) \
.globl irq_#x\n \
@@ -615,3 +617,32 @@ asm(.globl irq_common_entry\n \
DECLARE_INTERRUPT(253) \
DECLARE_INTERRUPT(254) \
DECLARE_INTERRUPT(255));
+
+#if defined(CONFIG_INTEL_CORE_ARCH)
+/*
+ * Get the number of CPU time counter ticks since it was read first time after
+ * restart. This yields a free running counter guaranteed to take almost 6
+ * years to wrap around even at 100GHz clock rate.
+ */
+u64 get_ticks(void)
+{
+   static u64 tick_base;
+   u64 now_tick = rdtsc();
+
+   if (!tick_base)
+   tick_base = now_tick;
+
+   return now_tick - tick_base;
+}
+
+#define PLATFORM_INFO_MSR 0xce
+
+unsigned long get_tbclk(void)
+{
+   u32 ratio;
+   u64 platform_info = native_read_msr(PLATFORM_INFO_MSR);
+
+   ratio = (platform_info  8)  0xff;
+   return 100 * 1000 * 1000 * ratio; /* 100MHz times Max Non Turbo ratio */
+}
+#endif
-- 
1.7.7.3

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


[U-Boot] [PATCH v2 20/21] x86: Build vga video code only if CONFIG_VIDEO_VGA is defined

2012-12-03 Thread Simon Glass
When running from coreboot we don't want this code, so make it
optional.

Signed-off-by: Simon Glass s...@chromium.org
---
Changes in v2:
- Add new patch to remove video code, to avoid compile error

 README|7 +++
 arch/x86/lib/Makefile |4 ++--
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/README b/README
index c7aab18..0f5dfad 100644
--- a/README
+++ b/README
@@ -1409,6 +1409,13 @@ CBFS (Coreboot Filesystem) support
boot.  See the documentation file README.video for a
description of this variable.
 
+   CONFIG_VIDEO_VGA
+
+   Enable the VGA video / BIOS for x86. The alternative if you
+   are using coreboot is to use the coreboot frame buffer
+   driver.
+
+
 - Keyboard Support:
CONFIG_KEYBOARD
 
diff --git a/arch/x86/lib/Makefile b/arch/x86/lib/Makefile
index 2a3e8f0..0a52cc8 100644
--- a/arch/x86/lib/Makefile
+++ b/arch/x86/lib/Makefile
@@ -32,7 +32,7 @@ COBJS-y   += realmode.o
 SOBJS-y+= realmode_switch.o
 
 COBJS-$(CONFIG_SYS_PC_BIOS)+= bios_setup.o
-COBJS-$(CONFIG_VIDEO)  += video_bios.o
+COBJS-$(CONFIG_VIDEO_VGA)  += video_bios.o
 endif
 
 COBJS-y+= board.o
@@ -50,7 +50,7 @@ COBJS-y   += relocate.o
 COBJS-y += physmem.o
 COBJS-y+= string.o
 COBJS-$(CONFIG_SYS_X86_ISR_TIMER)  += timer.o
-COBJS-$(CONFIG_VIDEO)  += video.o
+COBJS-$(CONFIG_VIDEO_VGA)  += video.o
 COBJS-$(CONFIG_CMD_ZBOOT)  += zimage.o
 
 SRCS   := $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c)
-- 
1.7.7.3

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


Re: [U-Boot] [PATCH v2 0/7] Add support for NVIDIA Tegra30 SoC

2012-12-03 Thread Stephen Warren
On 12/03/2012 04:45 PM, Tom Warren wrote:
 This patch series adds basic (boot to cmd prompt) support for Tegra30.
 This is based on the Tegra20 SPL, which initializes the AVP (ARM7TDMI)
 boot proc) first, then control is transferred to the CPU (A9 quad cluster).
 It is based on current u-boot-tegra/next. Some Tegra20 files were
 changed or moved to enable use of common code/headers.
 
 Future patches will add support/drivers for MMC, USB, I2C, SPI, NAND
 and other peripherals. The Cardhu T30 boards is supported initially.
 
 V2: Rework patchset as per feedback from Stephen and Simon.

The series,
Tested-by: Stephen Warren swar...@nvidia.com

The diffstat in patch 0 looks good too; reviews of the patches to come
later.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 1/7] Tegra30: Add arch-tegra30 include files

2012-12-03 Thread Stephen Warren
On 12/03/2012 04:45 PM, Tom Warren wrote:
 Common Tegra files are in arch-tegra, shared between T20 and T30.
 Tegra30-specific headers are in arch-tegra30. Note that some of
 these will be filled in as more T30 support is added (drivers,
 WB/LP0 support, etc.). A couple of Tegra20 files were changed
 to support common headers in arch-tegra, also.

 diff --git a/arch/arm/include/asm/arch-tegra/tegra.h 
 b/arch/arm/include/asm/arch-tegra/tegra.h

 +/*
 + * These are used to distinguish SOC types for setting up clocks. Mostly
 + * we can tell the clocking required by looking at the SOC sku_id, but
 + * for T30 it is a user option as to whether to run PLLP in fast or slow
 + * mode, so we have two options there.
 + */
  enum {
   TEGRA_SOC_T20,
   TEGRA_SOC_T25,
 + TEGRA_SOC_T30,
 + TEGRA_SOC_T30_408MHZ,   /* A T30 with faster PLLP */
 + TEGRA_SOC2_SLOW,/* T2x needs to run at slow clock initially */
  
 - TEGRA_SOC_COUNT,
 + TEGRA_SOC_CNT,
   TEGRA_SOC_UNKNOWN   = -1,
  };

Can you remind me why TEGRA_SOC_T30_408MHZ exists; isn't it a SW thing
whereas this enum is meant to be identifying the HW?

 diff --git a/arch/arm/include/asm/arch-tegra30/funcmux.h 
 b/arch/arm/include/asm/arch-tegra30/funcmux.h

 +/* Configs supported by the func mux */
 +enum {
 + FUNCMUX_DEFAULT = 0,/* default config */
 +
 + /* UART configs */
 + FUNCMUX_UART1_ULPI = 0,

funcmux isn't going to be remotely useful for Tegra30. There are
something like 460 possible ways of muxing out (IIRC) just a 4-pin UART
A on Tegra30. That's why when I was defining the proposed ODMDATA2
representation of UART pinmux for the Tegra30 BCT, I didn't have a
single enum covering the entire UART configuration, but rather a 4-bit
field per signal (RXD, TXD, RTS, CTS) that indicated which of the
possible pins to route it to.

Still, I guess having the initial port use funcmux is fine since we only
need to support 1 option for now. We'll hopefully just convert it to use
the BCT ODMDATA2 format rather quickly.

A similar comment will probably apply to any other peripheral on Tegra30.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 05/21] x86: Override calculate_relocation_address to use the e820 map

2012-12-03 Thread Simon Glass
From: Gabe Black gabebl...@chromium.org

Because calculate_relocation_address now uses the e820 map, it will be able
to avoid addresses over 32 bits and regions that are at high addresses but
not big enough for U-Boot. It also means we can remove the hack which
limitted U-Boot's idea of the size of memory to less than 4GB.

Also take into account the space needed for the heap and stack, so we avoid
picking a very small region those areas might overlap with something it
shouldn't.

Signed-off-by: Gabe Black gabebl...@chromium.org
Signed-off-by: Simon Glass s...@chromium.org
---
Changes in v2:
- Update relocation for new link symbols, headers
- Update relocation for new global data positioning
- Update coreboot text base to fit with relocation scheme

 arch/x86/cpu/coreboot/sdram.c |   61 +
 boards.cfg|2 +-
 2 files changed, 56 insertions(+), 7 deletions(-)

diff --git a/arch/x86/cpu/coreboot/sdram.c b/arch/x86/cpu/coreboot/sdram.c
index 5d3da99..76274cb 100644
--- a/arch/x86/cpu/coreboot/sdram.c
+++ b/arch/x86/cpu/coreboot/sdram.c
@@ -27,8 +27,9 @@
 #include asm/e820.h
 #include asm/u-boot-x86.h
 #include asm/global_data.h
-#include asm/arch-coreboot/sysinfo.h
-#include asm/arch-coreboot/tables.h
+#include asm/processor.h
+#include asm/arch/sysinfo.h
+#include asm/arch/tables.h
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -51,6 +52,58 @@ unsigned install_e820_map(unsigned max_entries, struct 
e820entry *entries)
return num_entries;
 }
 
+/*
+ * This function looks for the highest region of memory lower than 4GB which
+ * has enough space for U-Boot where U-Boot is aligned on a page boundary. It
+ * overrides the default implementation found elsewhere which simply picks the
+ * end of ram, wherever that may be. The location of the stack, the relocation
+ * address, and how far U-Boot is moved by relocation are set in the global
+ * data structure.
+ */
+int calculate_relocation_address(void)
+{
+   const uint64_t uboot_size = (uintptr_t)__bss_end -
+   (uintptr_t)__text_start;
+   const uint64_t total_size = uboot_size + CONFIG_SYS_MALLOC_LEN +
+   CONFIG_SYS_STACK_SIZE;
+   uintptr_t dest_addr = 0;
+   int i;
+
+   for (i = 0; i  lib_sysinfo.n_memranges; i++) {
+   struct memrange *memrange = lib_sysinfo.memrange[i];
+   /* Force U-Boot to relocate to a page aligned address. */
+   uint64_t start = roundup(memrange-base, 1  12);
+   uint64_t end = memrange-base + memrange-size;
+
+   /* Ignore non-memory regions. */
+   if (memrange-type != CB_MEM_RAM)
+   continue;
+
+   /* Filter memory over 4GB. */
+   if (end  0xULL)
+   end = 0x1ULL;
+   /* Skip this region if it's too small. */
+   if (end - start  total_size)
+   continue;
+
+   /* Use this address if it's the largest so far. */
+   if (end - uboot_size  dest_addr)
+   dest_addr = end;
+   }
+
+   /* If no suitable area was found, return an error. */
+   if (!dest_addr)
+   return 1;
+
+   dest_addr -= uboot_size;
+   dest_addr = ~((1  12) - 1);
+   gd-relocaddr = dest_addr;
+   gd-reloc_off = dest_addr - (uintptr_t)__text_start;
+   gd-start_addr_sp = dest_addr - CONFIG_SYS_MALLOC_LEN;
+
+   return 0;
+}
+
 int dram_init_f(void)
 {
int i;
@@ -60,10 +113,6 @@ int dram_init_f(void)
struct memrange *memrange = lib_sysinfo.memrange[i];
unsigned long long end = memrange-base + memrange-size;
 
-   /* Ignore memory over 4GB, we can't use it. */
-   if (memrange-base  0x)
-   continue;
-
if (memrange-type == CB_MEM_RAM  end  ram_size)
ram_size = end;
}
diff --git a/boards.cfg b/boards.cfg
index ca9b12b..9093ecb 100644
--- a/boards.cfg
+++ b/boards.cfg
@@ -1099,7 +1099,7 @@ gr_cpci_ax2000   sparc   leon3   -
   gaisler
 gr_ep2s60sparc   leon3   -   
gaisler
 grsimsparc   leon3   -   
gaisler
 gr_xc3s_1500 sparc   leon3   -   
gaisler
-coreboot-x86 x86 x86coreboot
chromebook-x86 corebootcoreboot:SYS_TEXT_BASE=0xFC
+coreboot-x86 x86 x86coreboot
chromebook-x86 corebootcoreboot:SYS_TEXT_BASE=0x0111
 eNET x86 x86eNET-  
sc520   eNET:SYS_TEXT_BASE=0x3804
 eNET_SRAMx86 x86eNET-  
sc520   eNET:SYS_TEXT_BASE=0x1900
 # 

Re: [U-Boot] [PATCH v2 2/7] Tegra30: Add AVP (arm720t) files

2012-12-03 Thread Stephen Warren
On 12/03/2012 04:45 PM, Tom Warren wrote:
 This provides SPL support for T30 boards - AVP early init, plus
 CPU (A9) init/jump to main U-Boot.
 
 Some changes were made to Tegra20 cpu.c to move common routines
 into tegra-common/cpu.c and reduce code duplication.

  arch/arm/cpu/arm720t/tegra-common/cpu.c|  342 
 
  arch/arm/cpu/arm720t/tegra20/cpu.c |  216 ++

Just a minor note here; this patch both moves a bunch of code from cpu.c
to the new cpu.c, and adds Tegra30 support. It would have been a little
easier to review if the code move were a separate patch (with git
format-patch -C) so that it was obvious what code in the new cpu.c was
changes due to Tegra30 and what was just copied.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 3/7] Tegra30: Add CPU (armv7) files

2012-12-03 Thread Stephen Warren
On 12/03/2012 04:45 PM, Tom Warren wrote:
 These files are for code that runs on the CPU (A9) on T30 boards.
 At this time, it's only the RCM (Recovery Mode) cmd file, which
 is in tegra-common. As T30-specific run-time code is added, it'll
 go here.

I don't think this patch adds any code any more; certainly not cmd_rcm.c.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


  1   2   >