Re: [U-Boot] [PATCH v3 6/9] dfu: Send correct DFU response from composite_setup

2012-12-11 Thread Lukasz Majewski
Hi Marek,

> Dear Lukasz Majewski,
> 
> > Pantelis,
> [...]
> 
> Hm hm ... I suspect it'd be nice to have a separate DFU custodian.
> That'd leverage some burden from me. I like that idea. I wonder if
> it'd be nice to start building such bigger net of custodians.

I think,that this (political) decision shall be made by Wolfgang or Tom.

> 
> Hm ?

No problem from my side. I would be honored to be DFU maintainer (as
part of USB subsystem).


> 
> Best regards,
> Marek Vasut



-- 
Best regards,

Lukasz Majewski

Samsung Poland R&D Center | Linux Platform Group
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] m28evk/mx28evk: fix nand_update_full

2012-12-11 Thread Eric Bénard
Hi Scott,

Le Mon, 10 Dec 2012 16:59:23 -0600,
Scott Wood  a écrit :

> On 12/10/2012 10:41:59 AM, Eric Bénard wrote:
> > - commit 418396e212b59bf907dbccad997ff50f7eb61b16 chenged the  
> > behaviour
> > of nand write.raw which now takes a pagecount as a parameter and no  
> > more
> > the size to be written so update the default environment of these  
> > boards
> > to fix the problem.
> 
> It never really took the size to be written -- the size was implicitly  
> one page before.  It looks like there may have been a bug in the old  
> code, where common code expected a size to be there anyway, even though  
> it was ignored other than for error checking.
> 
true, before the size was forced to one page :
rwsize = nand->writesize + nand->oobsize;
now it's rwsize = pagecount * (nand->writesize + nand->oobsize);
so the size parameter in this script was ignored and now leads to a
wrong rwsize calculation.

Do you want me to rephrase the commit log or will you take it as is ?

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


Re: [U-Boot] [PATCH] [DFU] Implement NAND dfu support

2012-12-11 Thread Pantelis Antoniou
Hi Scott,

On Dec 11, 2012, at 3:09 AM, Scott Wood wrote:

> On 12/10/2012 09:24:32 AM, Pantelis Antoniou wrote:
>> Introduce on-the fly DFU NAND support.
>> Signed-off-by: Pantelis Antoniou 
>> ---
>> drivers/dfu/Makefile   |   1 +
>> drivers/dfu/dfu.c  |   7 ++
>> drivers/dfu/dfu_nand.c | 194 
>> +
>> include/dfu.h  |  23 ++
>> 4 files changed, 225 insertions(+)
>> create mode 100644 drivers/dfu/dfu_nand.c
> 
> What is DFU?  I don't see anything in README or doc/, despite there already 
> being CONFIG symbols for it.
> 

This gets answered by a following email.

>> +static int nand_block_op(enum dfu_nand_op op, struct dfu_entity *dfu,
>> +u64 offset, void *buf, long *len)
>> +{
>> +char cmd_buf[DFU_CMD_BUF_SIZE];
>> +u64 start, count;
>> +int ret;
>> +int dev;
>> +loff_t actual;
>> +
>> +/* if buf == NULL return total size of the area */
>> +if (buf == NULL) {
>> +*len = dfu->data.nand.size;
>> +return 0;
>> +}
>> +
>> +start = dfu->data.nand.start + offset + dfu->bad_skip;
>> +count = *len;
>> +if (start + count >
>> +dfu->data.nand.start + dfu->data.nand.size) {
>> +printf("%s: block_op out of bounds\n", __func__);
>> +return -1;
>> +}
>> +dev = nand_curr_device;
>> +if (dev < 0 || dev >= CONFIG_SYS_MAX_NAND_DEVICE ||
>> +!nand_info[dev].name) {
>> +printf("%s: invalid nand device\n", __func__);
>> +return -1;
>> +}
>> +
>> +sprintf(cmd_buf, "nand %s %p %llx %llx",
>> +op == DFU_OP_READ ? "read" : "write",
>> + buf, start, count);
>> +
>> +debug("%s: %s 0x%p\n", __func__, cmd_buf, cmd_buf);
>> +ret = run_command(cmd_buf, 0);
> 
> Why not use the C interface to NAND?

Sigh. That's what I'm working on right now. The original implementation for mmc 
uses the user
facing cmd api, so that's what I'm using for nand too.

The problem is that I see, is that by using this method 
(dfu_mmc|dfu_nand|dfu_foo) this piece of code 
gets duplicated for each different dfu target.

I was told that Device Model will fix everything, eventually, so I abandoned 
anything more generic than
that. I will follow up with a patch that uses the C interface, and hope that 
sometime in the
future we can consolidate. Maybe. 

> 
>> +/* find out how much actual bytes have been written */
>> +/* the difference is the amount of skip we must add from now on */
>> +actual = nand_extent_skip_bad(&nand_info[dev], start, count);
> 
> ...especially since you already need to interact with it here?
> 
> -Scott

Regards

-- Pantelis

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


Re: [U-Boot] [PATCH] [nand] Implement nand_extent_skip_bad

2012-12-11 Thread Pantelis Antoniou
Hi Scott,

On Dec 11, 2012, at 12:53 AM, Scott Wood wrote:

> On 12/10/2012 09:24:24 AM, Pantelis Antoniou wrote:
>> When accessing nand any bad blocks encountered are skipped, with no
>> indication about the amount of bad blocks encountered.
>> While this is normally fine, when you have to write a large amount
>> of data in chunks, you need to account for the skipped amount due
>> to the presence of the bad blocks.
>> nand_extend_skip_bad() returns the offset where the next access
>> should occur.
> 
> s/extend/extent/
> 

Yeah.

>> Signed-off-by: Pantelis Antoniou 
>> ---
>> drivers/mtd/nand/nand_util.c | 50 
>> 
>> include/nand.h   |  2 ++
>> 2 files changed, 52 insertions(+)
>> diff --git a/drivers/mtd/nand/nand_util.c b/drivers/mtd/nand/nand_util.c
>> index 2ba0c5e..a25a4cb 100644
>> --- a/drivers/mtd/nand/nand_util.c
>> +++ b/drivers/mtd/nand/nand_util.c
>> @@ -684,6 +684,56 @@ int nand_read_skip_bad(nand_info_t *nand, loff_t 
>> offset, size_t *length,
>>  return 0;
>> }
>> +/**
>> + * nand_extent_skip_bad:
>> + *
>> + * Find the extent of a chunk, return the offset where it ends
>> + * Blocks that are marked bad are skipped and the next block is examined
>> + * instead as long as the extend is short enough to fit even after skipping 
>> the
>> + * bad blocks.
>> + *
>> + * @param nand NAND device
>> + * @param offset offset in flash
>> + * @param length extend length
>> + * @return next offset in case of success (loff_t)-1 on error
>> + */
> 
> Would it be better to return this information from existing read/write 
> functions -- either instead of or in addition to exporting this functionality?
> 

Yes it would. However that would require modifying all callers, which would be 
a hard sell when there's only one user of it.

>> +loff_t nand_extent_skip_bad(nand_info_t *nand, loff_t offset, size_t length)
>> +{
>> +size_t block_len, block_off;
>> +loff_t block_start;
>> +
>> +if ((offset & (nand->writesize - 1)) != 0) {
>> +printf ("%s: Attempt to check extend non page aligned data\n",
>> +__func__);
>> +return (loff_t)-1;
>> +}
>> +
>> +while (length > 0) {
>> +
>> +if (offset >= nand->size) {
>> +printf("%s: offset >= nand->size (%llx >= %llx)\n",
>> +__func__, offset, nand->size);
>> +return (loff_t)-1;
>> +}
>> +
>> +block_start = offset & ~(loff_t)(nand->erasesize - 1);
>> +block_off = offset & (nand->erasesize - 1);
>> +block_len = nand->erasesize - block_off;
>> +if (block_len > length) /* left over */
>> +block_len = length;
>> +
>> +if (!nand_block_isbad(nand, block_start))
>> +length -= block_len;
>> +else
>> +debug("%s: bad block at %llx (left %x)\n",
>> +__func__, block_start, length);
>> +
>> +offset += block_len;
>> +}
>> +
>> +return offset;
>> +}
> 
> This seems duplicative of check_skip_len().
> 

It is. check_skip_len doesn't return the information I need. I could modify 
check_skip_len with
an extra parameter if that's going to be OK with you.

> -Scott

Regards

-- Pantelis

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


[U-Boot] [PATCH v5 0/7] gpt: GUID Partition Table (GPT) restoration

2012-12-11 Thread Piotr Wilczek

This patch series provides a new command - "gpt" for eMMC partition table
(in the GPT format) restoration.

As a pre-work, some cleanup at the part_efi.c file was performed to
remove custom macros and make GPT related structures more readable.

Moreover the part_efi.h file has been moved to ./include directory to
be easily available from other subsystems.

The GPT detailed description has been written to README.gpt file.

Tested at:
- Exynos4210 rev.1 - TRATS Samsung development board


Chang Hyun Park (1):
  gpt: The leXX_to_int() calls replaced with ones defined at


Lukasz Majewski (5):
  vsprintf:fix: Change type returned by ustrtoul
  part:efi: Move part_efi.h file to ./include
  gpt:doc: GPT (GUID Partition Table) documentation
  gpt: Support for GPT (GUID Partition Table) restoration
  gpt: Enable support for GPT partition table restoration at Samsung's
Trats

Piotr Wilczek (1):
  gpt: Support for new "gpt" command

 common/Makefile  |1 +
 common/cmd_gpt.c |  333 +++
 disk/part_efi.c  |  394 ++
 doc/README.gpt   |  201 +
 include/configs/trats.h  |   28 ++-
 include/exports.h|2 +-
 include/part.h   |   52 ++
 {disk => include}/part_efi.h |   89 +-
 lib/vsprintf.c   |2 +-
 9 files changed, 982 insertions(+), 120 deletions(-)
 create mode 100644 common/cmd_gpt.c
 create mode 100644 doc/README.gpt
 rename {disk => include}/part_efi.h (66%)

-- 
1.7.9.5

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


[U-Boot] [PATCH v5 1/7] vsprintf:fix: Change type returned by ustrtoul

2012-12-11 Thread Piotr Wilczek
From: Lukasz Majewski 

The ustrtoul shall convert string defined size (e.g. 1GiB) to unsigned
long type (as its name implies).

Up till now it had returned int, which might cause problems with large
numbers (GiB range), when interpreted as U2 signed numbers.

Signed-off-by: Lukasz Majewski 
Signed-off-by: Kyungmin Park 

---
Changes in v5:
- changed return type in ustrtoul function decalration

Changes in v4:
- None

Changes in v3:
- None

Changes in v2:
- None

 include/exports.h |2 +-
 lib/vsprintf.c|2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/exports.h b/include/exports.h
index 63aa4b2..6cf31aa 100644
--- a/include/exports.h
+++ b/include/exports.h
@@ -23,7 +23,7 @@ char *getenv (const char *name);
 int setenv (const char *varname, const char *varvalue);
 long simple_strtol(const char *cp,char **endp,unsigned int base);
 int strcmp(const char * cs,const char * ct);
-int ustrtoul(const char *cp, char **endp, unsigned int base);
+unsigned long ustrtoul(const char *cp, char **endp, unsigned int base);
 #if defined(CONFIG_CMD_I2C)
 int i2c_write (uchar, uint, int , uchar* , int);
 int i2c_read (uchar, uint, int , uchar* , int);
diff --git a/lib/vsprintf.c b/lib/vsprintf.c
index b7a79c0..3c432f8 100644
--- a/lib/vsprintf.c
+++ b/lib/vsprintf.c
@@ -103,7 +103,7 @@ long simple_strtol(const char *cp, char **endp, unsigned 
int base)
return simple_strtoul(cp, endp, base);
 }
 
-int ustrtoul(const char *cp, char **endp, unsigned int base)
+unsigned long ustrtoul(const char *cp, char **endp, unsigned int base)
 {
unsigned long result = simple_strtoul(cp, endp, base);
switch (**endp) {
-- 
1.7.9.5

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


[U-Boot] [PATCH v5 2/7] part:efi: Move part_efi.h file to ./include

2012-12-11 Thread Piotr Wilczek
From: Lukasz Majewski 

This move is necessary to export gpt header and GPT partition entries to be
used with other commands or subsystems.
Additionally the part_efi.h file has been cleaned-up to supress checkpatch's
warnings.

Signed-off-by: Lukasz Majewski 
Signed-off-by: Kyungmin Park 

---
Changes in v5:
- None

Changes in v4:
- None

Changes in v3:
- None

Changes in v2:
- None

 {disk => include}/part_efi.h |0
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename {disk => include}/part_efi.h (100%)

diff --git a/disk/part_efi.h b/include/part_efi.h
similarity index 100%
rename from disk/part_efi.h
rename to include/part_efi.h
-- 
1.7.9.5

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


[U-Boot] [PATCH v5 3/7] gpt:doc: GPT (GUID Partition Table) documentation

2012-12-11 Thread Piotr Wilczek
From: Lukasz Majewski 

Documentation of the GPT format.

Signed-off-by: Lukasz Majewski 
Signed-off-by: Kyungmin Park 

---
Changes in v5:
- Updated documentation

Changes in v4:
- Updated documentation

Changes in v3:
- None

Changes in v2:
- Typos correction.
- Adding guidlines about GPT restoration.
- Adding information about GUID generator

 doc/README.gpt |  201 
 1 file changed, 201 insertions(+)
 create mode 100644 doc/README.gpt

diff --git a/doc/README.gpt b/doc/README.gpt
new file mode 100644
index 000..a9c58b4
--- /dev/null
+++ b/doc/README.gpt
@@ -0,0 +1,201 @@
+#
+#  Copyright (C) 2012 Samsung Electronics
+#
+#  Lukasz Majewski 
+#
+#
+# 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
+
+
+Glossary:
+
+- UUID -(Universally Unique Identifier)
+- GUID - (Globally Unique ID)
+- EFI - (Extensible Firmware Interface)
+- UEFI - (Unified EFI) - EFI evolution
+- GPT (GUID Partition Table) - it is the EFI standard part
+- partitions - lists of available partitions (defined at u-boot):
+  ./include/configs/{target}.h
+
+Introduction:
+=
+This document describes the GPT partition table format and usage of
+the gpt command in u-boot.
+
+
+UUID introduction:
+
+
+GPT for marking disks/partitions is using the UUID. It is supposed to be a
+globally unique value. A UUID is a 16-byte (128-bit) number. The number of
+theoretically possible UUIDs is therefore about 3 x 10^38.
+More often UUID is displayed as 32 hexadecimal digits, in 5 groups,
+separated by hyphens, in the form 8-4-4-4-12 for a total of 36 characters
+(32 digits and 4 hyphens)
+
+For instance, GUID of Linux data partition: 
EBD0A0A2-B9E5-4433-87C0-68B6B72699C7
+
+Historically there are 5 methods to generate this number. The oldest one is
+combining machine's MAC address and timer (epoch) value.
+
+Successive versions are using MD5 hash, random numbers and SHA-1 hash. All 
major
+OSes and programming languages are providing libraries to compute UUID (e.g.
+uuid command line tool).
+
+GPT brief explanation:
+==
+
+   Layout:
+   ---
+
+   --
+   LBA 0  |Protective MBR   |
+   --
+   LBA 1  |Primary GPT Header   | Primary
+   -- GPT
+   LBA 2  |Entry 1|Entry 2| Entry 3| Entry 4|
+   --
+   LBA 3  |Entries 5 - 128  |
+  | |
+  | |
+   --
+   LBA 34 |Partition 1  |
+  | |
+  ---
+  |Partition 2  |
+  | |
+  ---
+  |Partition n  |
+  | |
+   --
+   LBA -34|Entry 1|Entry 2| Entry 3| Entry 4| Secondary
+   -- (bkp)
+   LBA -33|Entries 5 - 128  | GPT
+  | |
+  | |
+   LBA -2 | |
+   --
+   LBA -1 |Secondary GPT Header |
+   --
+
+
+For a legacy reasons, GPT's LBA 0 sector has a MBR structure. It is called
+"protective MBR".
+Its first partition entry ID has 0xEE value, and disk software, which is not
+handling the GPT sees it as a storage device without free space.
+
+It is possible to define 128 linearly placed partition entries.
+
+"LBA -1"

[U-Boot] [PATCH v5 4/7] gpt: The leXX_to_int() calls replaced with ones defined at

2012-12-11 Thread Piotr Wilczek
From: Chang Hyun Park 

Custom definitions of le_XX_to_int functions have been replaced with
standard ones, defined at 

Replacement of several GPT related structures members with ones
indicating its endianness and proper size.

Signed-off-by: Chang Hyun Park 
Signed-off-by: Lukasz Majewski 
Signed-off-by: Kyungmin Park 

---
Changes in v5:
- removed unncessary casting

Changes in v4:
- None

Changes in v3:
- None

Changes in v2:
- Combining two commits regarding part_efi.{h|c}

 disk/part_efi.c|  113 +++-
 include/part_efi.h |   89 +
 2 files changed, 88 insertions(+), 114 deletions(-)

diff --git a/disk/part_efi.c b/disk/part_efi.c
index a3873ce..4aa3647 100644
--- a/disk/part_efi.c
+++ b/disk/part_efi.c
@@ -34,7 +34,7 @@
 #include 
 #include 
 #include 
-#include "part_efi.h"
+#include 
 #include 
 
 #if defined(CONFIG_CMD_IDE) || \
@@ -44,34 +44,6 @@
 defined(CONFIG_MMC) || \
 defined(CONFIG_SYSTEMACE)
 
-/* Convert char[2] in little endian format to the host format integer
- */
-static inline unsigned short le16_to_int(unsigned char *le16)
-{
-   return ((le16[1] << 8) + le16[0]);
-}
-
-/* Convert char[4] in little endian format to the host format integer
- */
-static inline unsigned long le32_to_int(unsigned char *le32)
-{
-   return ((le32[3] << 24) + (le32[2] << 16) + (le32[1] << 8) + le32[0]);
-}
-
-/* Convert char[8] in little endian format to the host format integer
- */
-static inline unsigned long long le64_to_int(unsigned char *le64)
-{
-   return (((unsigned long long)le64[7] << 56) +
-   ((unsigned long long)le64[6] << 48) +
-   ((unsigned long long)le64[5] << 40) +
-   ((unsigned long long)le64[4] << 32) +
-   ((unsigned long long)le64[3] << 24) +
-   ((unsigned long long)le64[2] << 16) +
-   ((unsigned long long)le64[1] << 8) +
-   (unsigned long long)le64[0]);
-}
-
 /**
  * efi_crc32() - EFI version of crc32 function
  * @buf: buffer to calculate crc32 of
@@ -79,7 +51,7 @@ static inline unsigned long long le64_to_int(unsigned char 
*le64)
  *
  * Description: Returns EFI-style CRC32 value for @buf
  */
-static inline unsigned long efi_crc32(const void *buf, unsigned long len)
+static inline u32 efi_crc32(const void *buf, u32 len)
 {
return crc32(0, buf, len);
 }
@@ -171,14 +143,14 @@ void print_part_efi(block_dev_desc_t * dev_desc)
printf("\tType UUID\n");
printf("\tPartition UUID\n");
 
-   for (i = 0; i < le32_to_int(gpt_head->num_partition_entries); i++) {
+   for (i = 0; i < le32_to_cpu(gpt_head->num_partition_entries); i++) {
/* Stop at the first non valid PTE */
if (!is_pte_valid(&gpt_pte[i]))
break;
 
printf("%3d\t0x%08llx\t0x%08llx\t\"%s\"\n", (i + 1),
-   le64_to_int(gpt_pte[i].starting_lba),
-   le64_to_int(gpt_pte[i].ending_lba),
+   le64_to_cpu(gpt_pte[i].starting_lba),
+   le64_to_cpu(gpt_pte[i].ending_lba),
print_efiname(&gpt_pte[i]));
printf("\tattrs:\t0x%016llx\n", gpt_pte[i].attributes.raw);
uuid_string(gpt_pte[i].partition_type_guid.b, uuid);
@@ -211,7 +183,7 @@ int get_partition_info_efi(block_dev_desc_t * dev_desc, int 
part,
return -1;
}
 
-   if (part > le32_to_int(gpt_head->num_partition_entries) ||
+   if (part > le32_to_cpu(gpt_head->num_partition_entries) ||
!is_pte_valid(&gpt_pte[part - 1])) {
printf("%s: *** ERROR: Invalid partition number %d ***\n",
__func__, part);
@@ -219,9 +191,9 @@ int get_partition_info_efi(block_dev_desc_t * dev_desc, int 
part,
}
 
/* The ulong casting limits the maximum disk size to 2 TB */
-   info->start = (ulong) le64_to_int(gpt_pte[part - 1].starting_lba);
+   info->start = (u64)le64_to_cpu(gpt_pte[part - 1].starting_lba);
/* The ending LBA is inclusive, to calculate size, add 1 to it */
-   info->size = ((ulong)le64_to_int(gpt_pte[part - 1].ending_lba) + 1)
+   info->size = ((u64)le64_to_cpu(gpt_pte[part - 1].ending_lba) + 1)
 - info->start;
info->blksz = GPT_BLOCK_SIZE;
 
@@ -264,7 +236,7 @@ int test_part_efi(block_dev_desc_t * dev_desc)
 static int pmbr_part_valid(struct partition *part)
 {
if (part->sys_ind == EFI_PMBR_OSTYPE_EFI_GPT &&
-   le32_to_int(part->start_sect) == 1UL) {
+   le32_to_cpu(part->start_sect) == 1UL) {
return 1;
}
 
@@ -283,9 +255,8 @@ static int is_pmbr_valid(legacy_mbr * mbr)
 {
int i = 0;
 
-   if (!mbr || le16_to_int(mbr->signature) != MSDOS_MBR_SIGNATURE) {
+   if (!mbr || le16_to_cpu(mbr->signature) != MSDOS_MBR_SIGNATURE)
return 0;
-   

[U-Boot] [PATCH v5 5/7] gpt: Support for GPT (GUID Partition Table) restoration

2012-12-11 Thread Piotr Wilczek
From: Lukasz Majewski 

The restoration of GPT table (both primary and secondary) is now possible.
Function 'gpt_restore' presents example of partition restoration process.

Signed-off-by: Lukasz Majewski 
Signed-off-by: Piotr Wilczek 
Signed-off-by: Kyungmin Park 

---
Changes in v5:
- changed function name 'set_gpt_table' to 'write_gpt_table'
- changed function name 'gpt_fill' to 'gpt_restore'
- moved function documentation to header file
- removed guid generation
- fixed partition layout check

Changes in v4:
- Add public functions for fill gpt header and entries
- Add public function for fill and save gpt tables on the basis of
  simple partions list information

Changes in v3:
- Replace printf with puts

Changes in v2:
- Move GPT Header and Page Table Entries generation code to cmd_gpt.c
- Provide clean API to use set_gpt_table function for GPT restoration on
  a block device

 disk/part_efi.c |  281 ++-
 include/part.h  |   52 ++
 2 files changed, 330 insertions(+), 3 deletions(-)

diff --git a/disk/part_efi.c b/disk/part_efi.c
index 4aa3647..7665017 100644
--- a/disk/part_efi.c
+++ b/disk/part_efi.c
@@ -37,6 +37,8 @@
 #include 
 #include 
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #if defined(CONFIG_CMD_IDE) || \
 defined(CONFIG_CMD_SATA) || \
 defined(CONFIG_CMD_SCSI) || \
@@ -62,13 +64,10 @@ static inline u32 efi_crc32(const void *buf, u32 len)
 
 static int pmbr_part_valid(struct partition *part);
 static int is_pmbr_valid(legacy_mbr * mbr);
-
 static int is_gpt_valid(block_dev_desc_t * dev_desc, unsigned long long lba,
gpt_header * pgpt_head, gpt_entry ** pgpt_pte);
-
 static gpt_entry *alloc_read_gpt_entries(block_dev_desc_t * dev_desc,
gpt_header * pgpt_head);
-
 static int is_pte_valid(gpt_entry * pte);
 
 static char *print_efiname(gpt_entry *pte)
@@ -114,6 +113,7 @@ static inline int is_bootable(gpt_entry *p)
sizeof(efi_guid_t));
 }
 
+#ifdef CONFIG_EFI_PARTITION
 /*
  * Public Functions (include/part.h)
  */
@@ -225,6 +225,281 @@ int test_part_efi(block_dev_desc_t * dev_desc)
return 0;
 }
 
+/**
+ * set_protective_mbr(): Set the EFI protective MBR
+ * @param dev_desc - block device descriptor
+ *
+ * @return - zero on success, otherwise error
+ */
+static int set_protective_mbr(block_dev_desc_t *dev_desc)
+{
+   legacy_mbr *p_mbr;
+
+   /* Setup the Protective MBR */
+   p_mbr = calloc(1, sizeof(p_mbr));
+   if (p_mbr == NULL) {
+   printf("%s: calloc failed!\n", __func__);
+   return -1;
+   }
+   /* Append signature */
+   p_mbr->signature = MSDOS_MBR_SIGNATURE;
+   p_mbr->partition_record[0].sys_ind = EFI_PMBR_OSTYPE_EFI_GPT;
+   p_mbr->partition_record[0].start_sect = 1;
+   p_mbr->partition_record[0].nr_sects = (u32) dev_desc->lba;
+
+   /* Write MBR sector to the MMC device */
+   if (dev_desc->block_write(dev_desc->dev, 0, 1, p_mbr) != 1) {
+   printf("** Can't write to device %d **\n",
+   dev_desc->dev);
+   free(p_mbr);
+   return -1;
+   }
+
+   free(p_mbr);
+   return 0;
+}
+
+/**
+ * string_uuid(); Convert UUID stored as string to bytes
+ *
+ * @param uuid - UUID represented as string
+ * @param dst - GUID buffer
+ *
+ * @return return 0 on successful conversion
+ */
+static int string_uuid(char *uuid, u8 *dst)
+{
+   efi_guid_t guid;
+   u16 b, c, d;
+   u64 e;
+   u32 a;
+   u8 *p;
+   u8 i;
+
+   const u8 uuid_str_len = 36;
+
+   /* The UUID is written in text: */
+   /* 1914   19   24 */
+   /* ---- */
+
+   debug("%s: uuid: %s\n", __func__, uuid);
+
+   if (strlen(uuid) != uuid_str_len)
+   return -1;
+
+   for (i = 0; i < uuid_str_len; i++) {
+   if ((i == 8) || (i == 13) || (i == 18) || (i == 23)) {
+   if (uuid[i] != '-')
+   return -1;
+   } else {
+   if (!isxdigit(uuid[i]))
+   return -1;
+   }
+   }
+
+   a = (u32)simple_strtoul(uuid, NULL, 16);
+   b = (u16)simple_strtoul(uuid + 9, NULL, 16);
+   c = (u16)simple_strtoul(uuid + 14, NULL, 16);
+   d = (u16)simple_strtoul(uuid + 19, NULL, 16);
+   e = (u64)simple_strtoull(uuid + 24, NULL, 16);
+
+   p = (u8 *) &e;
+   guid = EFI_GUID(a, b, c, d >> 8, d & 0xFF,
+   *(p + 5), *(p + 4), *(p + 3),
+   *(p + 2), *(p + 1) , *p);
+
+   memcpy(dst, guid.b, sizeof(efi_guid_t));
+
+   return 0;
+}
+
+int write_gpt_table(block_dev_desc_t *dev_desc,
+   gpt_header *gpt_h, gpt_entry *gpt_e)
+{
+   const int pte_blk_num = (gpt_h->num_partition_entries
+   * sizeof(gpt_entry)) / dev_desc->blksz;
+
+ 

[U-Boot] [PATCH v5 6/7] gpt: Support for new "gpt" command

2012-12-11 Thread Piotr Wilczek
New command - "gpt" is supported. It restores the GPT partition table.
It looks into the given environment variable for partitions definition.
It can be enabled at target configuration file with CONFIG_CMD_GPT.

Signed-off-by: Lukasz Majewski 
Signed-off-by: Piotr Wilczek 
Signed-off-by: Kyungmin Park 

---
Changes in v5:
- rewritten 'do_gpt', 'gpt_mmc_default', 'set_gpt_info', 'extract_env',
  and 'extract_val' functions
- 'extract_val' function return value for given key (keys can be in
  any order)
- add 'write' command

Changes in v4:
- partions list can be passed as environment variable or directly as text
- each value in partions list can be passed as environment variable

Changes in v3:
- Remove unnecessary braces

Changes in v2:
- gpt command now accepts device medium and its number (e.g. gpt mmc 0)
- UUIDs can be passed via u-boot prompt when used with gpt command
- Format of restored GPT has been changed - now key=value pairs are used
  'name="PARTS_CSA",size=8MiB;\ '
  'name="PARTS_BOOTLOADER",size=60MiB; \'
- guid_gen now accepts "pool" pointer and guid pointer
- gd->start_addr_sp is used as a primary source of entrophy
- static buffers definitions have been removed
- remove memsize_to_blocks function with call to standard ustrtoul
- doxygen comments for functions added

 common/Makefile  |1 +
 common/cmd_gpt.c |  333 ++
 2 files changed, 334 insertions(+)
 create mode 100644 common/cmd_gpt.c

diff --git a/common/Makefile b/common/Makefile
index c29a7d8..63b9f50 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -192,6 +192,7 @@ COBJS-$(CONFIG_MODEM_SUPPORT) += modem.o
 COBJS-$(CONFIG_UPDATE_TFTP) += update.o
 COBJS-$(CONFIG_USB_KEYBOARD) += usb_kbd.o
 COBJS-$(CONFIG_CMD_DFU) += cmd_dfu.o
+COBJS-$(CONFIG_CMD_GPT) += cmd_gpt.o
 endif
 
 ifdef CONFIG_SPL_BUILD
diff --git a/common/cmd_gpt.c b/common/cmd_gpt.c
new file mode 100644
index 000..da7705d
--- /dev/null
+++ b/common/cmd_gpt.c
@@ -0,0 +1,333 @@
+/*
+ * cmd_gpt.c -- GPT (GUID Partition Table) handling command
+ *
+ * Copyright (C) 2012 Samsung Electronics
+ * author: Lukasz Majewski 
+ * author: Piotr Wilczek 
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#ifndef CONFIG_PARTITION_UUIDS
+#error CONFIG_PARTITION_UUIDS must be enabled for CONFIG_CMD_GPT to be enabled
+#endif
+
+/**
+ * extract_env(): Expand env name from string format '&{env_name}'
+ *and return pointer to the env (if the env is set)
+ *
+ * @param str - pointer to string
+ * @param env - pointer to pointer to extracted env
+ *
+ * @return - zero on successful expand and env is set
+ */
+static char extract_env(const char *str, char **env)
+{
+   char *e, *s;
+
+   if (!str || strlen(str) < 4)
+   return -1;
+
+   if ((strncmp(str, "${", 2) == 0) && (str[strlen(str) - 1] == '}')) {
+   s = strdup(str);
+   if (s == NULL)
+   return -1;
+   memset(s + strlen(s) - 1, '\0', 1);
+   memmove(s, s + 2, strlen(s) - 1);
+   e = getenv(s);
+   free(s);
+   if (e == NULL) {
+   printf("Environmental '%s' not set\n", str);
+   return -1; /* env not set */
+   }
+   *env = e;
+   return 0;
+   }
+
+   return -1;
+}
+
+/**
+ * extract_val(): Extract value from a key=value pair list (comma separated).
+ *Only value for the given key is returend.
+ *Function allocates memory for the value, remember to free!
+ *
+ * @param str - pointer to string with key=values pairs
+ * @param key - pointer to the key to search for
+ *
+ * @return - pointer to allocated string with the value
+ */
+static char *extract_val(const char *str, const char *key)
+{
+   char *v, *k;
+   char *s, *strcopy;
+   char *new = NULL;
+
+   strcopy = strdup(str);
+   if (strcopy == NULL)
+   return NULL;
+
+   s = strcopy;
+   while (s) {
+   v = strsep(&s, ",");
+   if (!v)
+   break;
+   k = strsep(&v, "=");
+   if (!k)
+ 

[U-Boot] [PATCH v5 7/7] gpt: Enable support for GPT partition table restoration at Samsung's Trats

2012-12-11 Thread Piotr Wilczek
From: Lukasz Majewski 

Enable support for GPT partition table restoration at Samsung's Trats
development board.

Signed-off-by: Lukasz Majewski 
Signed-off-by: Kyungmin Park 
CC: Minkyu Kang 

---
Changes in v5:
- Modified partitions list format

Changes in v4:
- Modified default partitions list

Changes in v3:
- None

Changes in v2:
- New format for default GPT partitions (key=value pairs)
- replace size definitions with more readable description(1GiB instead of 1G)

 include/configs/trats.h |   28 +++-
 1 file changed, 27 insertions(+), 1 deletion(-)

diff --git a/include/configs/trats.h b/include/configs/trats.h
index 355029e..94ba55e 100644
--- a/include/configs/trats.h
+++ b/include/configs/trats.h
@@ -98,6 +98,7 @@
 #undef CONFIG_CMD_MTDPARTS
 #define CONFIG_CMD_MMC
 #define CONFIG_CMD_DFU
+#define CONFIG_CMD_GPT
 
 /* FAT */
 #define CONFIG_CMD_FAT
@@ -122,6 +123,26 @@
 #define CONFIG_BOOTBLOCK   "10"
 #define CONFIG_ENV_COMMON_BOOT "${console} ${meminfo}"
 
+/* Tizen - partitions definitions */
+#define PARTS_CSA  "csa-mmc"
+#define PARTS_BOOTLOADER   "u-boot"
+#define PARTS_BOOT "boot"
+#define PARTS_ROOT "platform"
+#define PARTS_DATA "data"
+#define PARTS_CSC  "csc"
+#define PARTS_UMS  "ums"
+
+#define PARTS_DEFAULT \
+   "uuid_disk=${uuid_gpt_disk};" \
+   "name="PARTS_CSA",size=8MiB,uuid=${uuid_gpt_"PARTS_CSA"};" \
+   "name="PARTS_BOOTLOADER",size=60MiB," \
+   "uuid=${uuid_gpt_"PARTS_BOOTLOADER"};" \
+   "name="PARTS_BOOT",size=100MiB,uuid=${uuid_gpt_"PARTS_BOOT"};" \
+   "name="PARTS_ROOT",size=1GiB,uuid=${uuid_gpt_"PARTS_ROOT"};" \
+   "name="PARTS_DATA",size=3GiB,uuid=${uuid_gpt_"PARTS_DATA"};" \
+   "name="PARTS_CSC",size=150MiB,uuid=${uuid_gpt_"PARTS_CSC"};" \
+   "name="PARTS_UMS",size=-,uuid=${uuid_gpt_"PARTS_UMS"}\0" \
+
 #define CONFIG_DFU_ALT \
"dfu_alt_info=" \
"u-boot mmc 80 400;" \
@@ -171,7 +192,8 @@
"mmcbootpart=2\0" \
"mmcrootpart=3\0" \
"opts=always_resume=1\0" \
-   CONFIG_DFU_ALT
+   "partitions=" PARTS_DEFAULT \
+   CONFIG_DFU_ALT \
 
 /* Miscellaneous configurable options */
 #define CONFIG_SYS_LONGHELP/* undef to save memory */
@@ -208,6 +230,10 @@
 
 #define CONFIG_DOS_PARTITION
 
+/* GPT */
+#define CONFIG_EFI_PARTITION
+#define CONFIG_PARTITION_UUIDS
+
 #define CONFIG_SYS_INIT_SP_ADDR(CONFIG_SYS_LOAD_ADDR - 
GENERATED_GBL_DATA_SIZE)
 #define CONFIG_SYS_CACHELINE_SIZE   32
 
-- 
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 v3 6/9] dfu: Send correct DFU response from composite_setup

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

In message <201212110147.49045.ma...@denx.de> you wrote:
>
> Hm hm ... I suspect it'd be nice to have a separate DFU custodian. That'd 
> leverage some burden from me. I like that idea. I wonder if it'd be nice to 
> start building such bigger net of custodians.

I'm not sure about what the limit for a managable number of custodians
might be.  If the number grows too far, we need additional levels in
the hierarchy, concentrators of some kind - similar to what Albert is
doing for ARM.

My gut feeling is that we are not close to any such limit yet, on the
other hand I seriously doubt that somethign like DFU really needs the
formal establishment of a custodian.  Who are the regular users and
who the developers of this piece of code?

Best regards,

Wolfgang Denk

PS: I'm always surprised how the random generator manages to pick the
perfectly fitting quote for my signature :-)

-- 
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
Conceptual integrity in turn dictates that the  design  must  proceed
from  one  mind,  or  from  a  very small number of agreeing resonant
minds.   - Frederick Brooks Jr., "The Mythical Man Month"
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2] universal_c210: check the NULL pointer when get the PMIC

2012-12-11 Thread Minkyu Kang
On 11/12/12 16:57, Lukasz Majewski wrote:
> Hi Minkyu,
> 
>> PMIC 2.0 require to test return pointer from pmic_get()
>>
>> Signed-off-by: Minkyu Kang 
>> Cc: Lukasz Majewski 
>> Cc: Wolfgang Denk 
>> ---
>> Changes in V2:
>>  - Since functions are void type, remove the return value.
>>
>>  board/samsung/universal_c210/universal.c |6 ++
>>  1 file changed, 6 insertions(+)
>>

applied to u-boot-samsung/resolve.

Thanks.
Minkyu Kang.

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


[U-Boot] [PATCH 0/5 v3] Add DT based ethernet driver for SMDK5250

2012-12-11 Thread Hatim Ali
This patch series enables the DT support on SMDK5250.
Ethernet is the first driver whose discovery is based on DT node.
More DT based drivers to be added subsequently

Changes since v1:
- Renamed the smdk5250.h file to exynos5250-dt.h to create a common
  configuration file which can be used by all the boards based on 
  exynos5250 using Device Tree.
- Created a new smdk5250.h file specifying the dts file specific to
  SMDK5250
- Incorporated minor nit (removal of blank lines)
Changes since v2:
- Rebased the "Add DT node definition for SROM and SMSC9215" patch on
  u-boot-samsung.git

Hatim Ali (5):
  EXYNOS5: FDT: add initial dts file for EXYNOS5250, SMDK5250
  fdt: exynos5: Add DT node definition for SROM and SMSC9215
  exynos5: Add DT based driver for SMC911X ethernet
  exynos5: config: Rename the smdk5250.h to exynos5250-dt.h
  SMDK5250: config: Add configuration file for SMDK5250 board

 arch/arm/dts/exynos5250.dtsi  |   31 
 arch/arm/include/asm/arch-exynos/sromc.h  |   18 ++
 board/samsung/dts/exynos5250-smdk5250.dts |   29 +++
 board/samsung/smdk5250/smdk5250.c |  115 +
 include/configs/exynos5250-dt.h   |  267 +
 include/configs/smdk5250.h|  245 +-
 include/fdtdec.h  |2 +
 lib/fdtdec.c  |2 +
 8 files changed, 442 insertions(+), 267 deletions(-)
 create mode 100644 arch/arm/dts/exynos5250.dtsi
 create mode 100644 board/samsung/dts/exynos5250-smdk5250.dts
 create mode 100644 include/configs/exynos5250-dt.h

-- 
1.7.2.3

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


[U-Boot] [PATCH 2/5 v3] fdt: exynos5: Add DT node definition for SROM and SMSC9215

2012-12-11 Thread Hatim Ali
Add the compatibility string and constant for the ethernet driver
so the device tree parsing code can recognize it.

Signed-off-by: Hatim Ali 
Acked-by: Simon Glass 
---
Changes since v1:
- Removed extra blank line before COMPAT_SMSC_LAN9215
- Added Acked-by: Simon Glass
Changes since v2:
- Rebased on u-boot-samsung

 include/fdtdec.h |2 ++
 lib/fdtdec.c |2 ++
 2 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/include/fdtdec.h b/include/fdtdec.h
index 64e5cff..da3c85f 100644
--- a/include/fdtdec.h
+++ b/include/fdtdec.h
@@ -68,6 +68,8 @@ enum fdt_compat_id {
COMPAT_NVIDIA_TEGRA20_NAND, /* Tegra2 NAND controller */
COMPAT_NVIDIA_TEGRA20_PWM,  /* Tegra 2 PWM controller */
COMPAT_NVIDIA_TEGRA20_DC,   /* Tegra 2 Display controller */
+   COMPAT_SMSC_LAN9215,/* SMSC 10/100 Ethernet LAN9215 */
+   COMPAT_SAMSUNG_EXYNOS5_SROMC,   /* Exynos5 SROMC */
 
COMPAT_COUNT,
 };
diff --git a/lib/fdtdec.c b/lib/fdtdec.c
index 23e0205..85e733c 100644
--- a/lib/fdtdec.c
+++ b/lib/fdtdec.c
@@ -45,6 +45,8 @@ static const char * const compat_names[COMPAT_COUNT] = {
COMPAT(NVIDIA_TEGRA20_NAND, "nvidia,tegra20-nand"),
COMPAT(NVIDIA_TEGRA20_PWM, "nvidia,tegra20-pwm"),
COMPAT(NVIDIA_TEGRA20_DC, "nvidia,tegra20-dc"),
+   COMPAT(SMSC_LAN9215, "smsc,lan9215"),
+   COMPAT(SAMSUNG_EXYNOS5_SROMC, "samsung,exynos-sromc"),
 };
 
 const char *fdtdec_get_compatible(enum fdt_compat_id id)
-- 
1.7.2.3

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


[U-Boot] [PATCH 1/5 v3] EXYNOS5: FDT: add initial dts file for EXYNOS5250, SMDK5250

2012-12-11 Thread Hatim Ali
This patch adds initial dts file for EXYNOS5250 SoC. This dts
file currently include only ethernet devices and properties. More
devices to be added in subsequent patches.
Also add the dts file for SMDK5250 board which uses the EXYNOS5250
dts file.

Signed-off-by: Hatim Ali 
Acked-by: Simon Glass 
---
Changes since v1:
- Added Acked-by Simon Glass
Changes since v2:
- No Change

 arch/arm/dts/exynos5250.dtsi  |   31 +
 board/samsung/dts/exynos5250-smdk5250.dts |   29 +++
 2 files changed, 60 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/dts/exynos5250.dtsi
 create mode 100644 board/samsung/dts/exynos5250-smdk5250.dts

diff --git a/arch/arm/dts/exynos5250.dtsi b/arch/arm/dts/exynos5250.dtsi
new file mode 100644
index 000..fa4d498
--- /dev/null
+++ b/arch/arm/dts/exynos5250.dtsi
@@ -0,0 +1,31 @@
+/*
+ * SAMSUNG EXYNOS5250 SoC device tree source
+ *
+ * Copyright (c) 2012 Samsung Electronics Co., Ltd.
+ * http://www.samsung.com
+ *
+ * SAMSUNG EXYNOS5250 SoC device nodes are listed in this file.
+ * EXYNOS5250 based board files can include this file and provide
+ * values for board specfic bindings.
+ *
+ * Note: This file does not include device nodes for all the controllers in
+ * EXYNOS5250 SoC. As device tree coverage for EXYNOS5250 increases,
+ * additional nodes can be added to this file.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+*/
+
+/include/ "skeleton.dtsi"
+
+/ {
+   compatible = "samsung,exynos5250";
+
+   sromc@1225 {
+   compatible = "samsung,exynos-sromc";
+   reg = <0x1225 0x20>;
+   #address-cells = <1>;
+   #size-cells = <0>;
+   };
+};
diff --git a/board/samsung/dts/exynos5250-smdk5250.dts 
b/board/samsung/dts/exynos5250-smdk5250.dts
new file mode 100644
index 000..b6fbb67
--- /dev/null
+++ b/board/samsung/dts/exynos5250-smdk5250.dts
@@ -0,0 +1,29 @@
+/*
+ * SAMSUNG SMDK5250 board device tree source
+ *
+ * Copyright (c) 2012 Samsung Electronics Co., Ltd.
+ * http://www.samsung.com
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+*/
+
+/dts-v1/;
+/include/ ARCH_CPU_DTS
+
+/ {
+   model = "SAMSUNG SMDK5250 board based on EXYNOS5250";
+   compatible = "samsung,smdk5250", "samsung,exynos5250";
+
+   sromc@1225 {
+   bank = <1>;
+   srom-timing = <1 9 12 1 6 1 1>;
+   width = <2>;
+   lan@500 {
+   compatible = "smsc,lan9215", "smsc,lan";
+   reg = <0x500 0x100>;
+   phy-mode = "mii";
+   };
+   };
+};
-- 
1.7.2.3

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


[U-Boot] [PATCH 3/5 v3] exynos5: Add DT based driver for SMC911X ethernet

2012-12-11 Thread Hatim Ali
Add device tree based ethernet driver for SMC911X controller on
SMDK5250 boards.

Signed-off-by: Hatim Ali 
Acked-by: Simon Glass 
---
Changes since v1:
- Added Acked-by Simon Glass
Changes since v2:
- No Change

 arch/arm/include/asm/arch-exynos/sromc.h |   18 +
 board/samsung/smdk5250/smdk5250.c|  115 ++
 2 files changed, 103 insertions(+), 30 deletions(-)

diff --git a/arch/arm/include/asm/arch-exynos/sromc.h 
b/arch/arm/include/asm/arch-exynos/sromc.h
index f616bcb..dc6aae2 100644
--- a/arch/arm/include/asm/arch-exynos/sromc.h
+++ b/arch/arm/include/asm/arch-exynos/sromc.h
@@ -48,4 +48,22 @@ struct s5p_sromc {
 /* Configure the Band Width and Bank Control Regs for required SROMC Bank */
 void s5p_config_sromc(u32 srom_bank, u32 srom_bw_conf, u32 srom_bc_conf);
 
+enum {
+   FDT_SROM_PMC,
+   FDT_SROM_TACP,
+   FDT_SROM_TAH,
+   FDT_SROM_TCOH,
+   FDT_SROM_TACC,
+   FDT_SROM_TCOS,
+   FDT_SROM_TACS,
+
+   FDT_SROM_TIMING_COUNT,
+};
+
+struct fdt_sromc {
+   u8 bank;/* srom bank number */
+   u8 width;   /* bus width in bytes */
+   unsigned int timing[FDT_SROM_TIMING_COUNT]; /* timing parameters */
+};
+
 #endif /* __ASM_ARCH_SROMC_H_ */
diff --git a/board/samsung/smdk5250/smdk5250.c 
b/board/samsung/smdk5250/smdk5250.c
index 4c50342..ac7346d 100644
--- a/board/samsung/smdk5250/smdk5250.c
+++ b/board/samsung/smdk5250/smdk5250.c
@@ -21,6 +21,7 @@
  */
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -34,34 +35,6 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#ifdef CONFIG_SMC911X
-static int smc9115_pre_init(void)
-{
-   u32 smc_bw_conf, smc_bc_conf;
-   int err;
-
-   /* Ethernet needs data bus width of 16 bits */
-   smc_bw_conf = SROMC_DATA16_WIDTH(CONFIG_ENV_SROM_BANK)
-   | SROMC_BYTE_ENABLE(CONFIG_ENV_SROM_BANK);
-
-   smc_bc_conf = SROMC_BC_TACS(0x01) | SROMC_BC_TCOS(0x01)
-   | SROMC_BC_TACC(0x06) | SROMC_BC_TCOH(0x01)
-   | SROMC_BC_TAH(0x0C)  | SROMC_BC_TACP(0x09)
-   | SROMC_BC_PMC(0x01);
-
-   /* Select and configure the SROMC bank */
-   err = exynos_pinmux_config(PERIPH_ID_SROMC,
-   CONFIG_ENV_SROM_BANK | PINMUX_FLAG_16BIT);
-   if (err) {
-   debug("SROMC not configured\n");
-   return err;
-   }
-
-   s5p_config_sromc(CONFIG_ENV_SROM_BANK, smc_bw_conf, smc_bc_conf);
-   return 0;
-}
-#endif
-
 int board_init(void)
 {
gd->bd->bi_boot_params = (PHYS_SDRAM_1 + 0x100UL);
@@ -115,12 +88,94 @@ void dram_init_banksize(void)
PHYS_SDRAM_8_SIZE);
 }
 
+#ifdef CONFIG_OF_CONTROL
+static int decode_sromc(const void *blob, struct fdt_sromc *config)
+{
+   int err;
+   int node;
+
+   node = fdtdec_next_compatible(blob, 0, COMPAT_SAMSUNG_EXYNOS5_SROMC);
+   if (node < 0) {
+   debug("Could not find SROMC node\n");
+   return node;
+   }
+
+   config->bank = fdtdec_get_int(blob, node, "bank", 0);
+   config->width = fdtdec_get_int(blob, node, "width", 2);
+
+   err = fdtdec_get_int_array(blob, node, "srom-timing", config->timing,
+   FDT_SROM_TIMING_COUNT);
+   if (err < 0) {
+   debug("Could not decode SROMC configuration\n");
+   return -FDT_ERR_NOTFOUND;
+   }
+
+   return 0;
+}
+#endif
+
 int board_eth_init(bd_t *bis)
 {
 #ifdef CONFIG_SMC911X
-   if (smc9115_pre_init())
+   u32 smc_bw_conf, smc_bc_conf;
+   struct fdt_sromc config;
+   fdt_addr_t base_addr;
+   int node;
+
+#ifdef CONFIG_OF_CONTROL
+   node = decode_sromc(gd->fdt_blob, &config);
+   if (node < 0) {
+   debug("%s: Could not find sromc configuration\n", __func__);
+   return 0;
+   }
+   node = fdtdec_next_compatible(gd->fdt_blob, node, COMPAT_SMSC_LAN9215);
+   if (node < 0) {
+   debug("%s: Could not find lan9215 configuration\n", __func__);
+   return 0;
+   }
+
+   /* We now have a node, so any problems from now on are errors */
+   base_addr = fdtdec_get_addr(gd->fdt_blob, node, "reg");
+   if (base_addr == FDT_ADDR_T_NONE) {
+   debug("%s: Could not find lan9215 address\n", __func__);
return -1;
-   return smc911x_initialize(0, CONFIG_SMC911X_BASE);
+   }
+#else
+   /* Non-FDT configuration - bank number and timing parameters*/
+   config.bank = CONFIG_ENV_SROM_BANK;
+   config.width = 2;
+
+   config.timing[FDT_SROM_TACS] = 0x01;
+   config.timing[FDT_SROM_TCOS] = 0x01;
+   config.timing[FDT_SROM_TACC] = 0x06;
+   config.timing[FDT_SROM_TCOH] = 0x01;
+   config.timing[FDT_SROM_TAH] = 0x0C;
+   config.timing[FDT_SROM_TACP] = 0x09;
+   config.timing[FDT_SROM_PMC] = 0x01;
+   base_addr = CONFIG_S

[U-Boot] [PATCH 4/5 v3] exynos5: config: Rename the smdk5250.h to exynos5250-dt.h

2012-12-11 Thread Hatim Ali
Create a common configuration file for all exynos5250 based boards.
Going forward we will be using DT based driver discovery for all the boards
based on Exynos5. The different boards added will have there own config.h files
which internally will include this file and specify their specific DT files.

Signed-off-by: Hatim Ali 
---
Changes since v2:
- No Change

 include/configs/{smdk5250.h => exynos5250-dt.h} |9 +++--
 1 files changed, 7 insertions(+), 2 deletions(-)
 rename include/configs/{smdk5250.h => exynos5250-dt.h} (96%)

diff --git a/include/configs/smdk5250.h b/include/configs/exynos5250-dt.h
similarity index 96%
rename from include/configs/smdk5250.h
rename to include/configs/exynos5250-dt.h
index e412da8..12f555c 100644
--- a/include/configs/smdk5250.h
+++ b/include/configs/exynos5250-dt.h
@@ -1,7 +1,7 @@
 /*
- * Copyright (C) 2011 Samsung Electronics
+ * Copyright (C) 2012 Samsung Electronics
  *
- * Configuration settings for the SAMSUNG SMDK5250 (EXYNOS5250) board.
+ * Configuration settings for the SAMSUNG EXYNOS5250 board.
  *
  * See file CREDITS for list of people who contributed to this
  * project.
@@ -37,6 +37,11 @@
 #define CONFIG_DISPLAY_CPUINFO
 #define CONFIG_DISPLAY_BOARDINFO
 
+/* Enable fdt support for Exynos5250 */
+#define CONFIG_ARCH_DEVICE_TREEexynos5250
+#define CONFIG_OF_CONTROL
+#define CONFIG_OF_SEPARATE
+
 /* Keep L2 Cache Disabled */
 #define CONFIG_SYS_DCACHE_OFF
 
-- 
1.7.2.3

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


[U-Boot] [PATCH 5/5 v3] SMDK5250: config: Add configuration file for SMDK5250 board

2012-12-11 Thread Hatim Ali
Add the configuration file for exynos5250 based SMDK5250 board.

Signed-off-by: Hatim Ali 
---
Changes since v2:
- No Change

 include/configs/smdk5250.h |   33 +
 1 files changed, 33 insertions(+), 0 deletions(-)
 create mode 100644 include/configs/smdk5250.h

diff --git a/include/configs/smdk5250.h b/include/configs/smdk5250.h
new file mode 100644
index 000..81f83a8
--- /dev/null
+++ b/include/configs/smdk5250.h
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2012 Samsung Electronics
+ *
+ * Configuration settings for the SAMSUNG SMDK5250 board.
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#ifndef __CONFIG_SMDK_H
+#define __CONFIG_SMDK_H
+
+#include 
+
+#undef CONFIG_DEFAULT_DEVICE_TREE
+#define CONFIG_DEFAULT_DEVICE_TREE exynos5250-smdk5250
+
+#endif /* __CONFIG_SMDK_H */
-- 
1.7.2.3

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


[U-Boot] [PATCH 0/8 v4] Add TMU support for Exynos5250 based SMDK5250

2012-12-11 Thread Hatim Ali
This patch series adds support for TMU driver using device tree for Exynos5250
based SMDK5250 board.
This patch series is dependent on the patch series
"Add DT based ethernet driver for SMDK5250" by Hatim Ali

Changes since v3:
- Rebased patch 1/8

Akshay Saraswat (6):
  EXYNOS5: FDT: Add TMU device node values
  EXYNOS5: TMU: Add driver for Thermal Management Unit
  EXYNOS5: Power down API for Thermal Management Unit
  Add a poll function to monitor events
  EXYNOS5: TMU: Add TMU status polling
  EXYNOS5: Config: Enable support for Exynos TMU driver

Alim Akhtar (2):
  TMU: Add u-boot command to read current temp
  EXYNOS5: Config: Enable tmu command

 README|8 +
 arch/arm/cpu/armv7/exynos/power.c |   15 ++
 arch/arm/dts/exynos5250.dtsi  |5 +
 arch/arm/include/asm/arch-exynos/exynos-tmu.h |   58 +
 arch/arm/include/asm/arch-exynos/power.h  |8 +
 board/samsung/dts/exynos5250-smdk5250.dts |   13 +
 board/samsung/smdk5250/smdk5250.c |   36 +++
 common/Makefile   |1 +
 common/cmd_tmu.c  |   51 +
 common/console.c  |5 +
 doc/device-tree-bindings/exynos/tmu.txt   |   35 +++
 drivers/power/Makefile|1 +
 drivers/power/exynos-tmu.c|  297 +
 include/common.h  |6 +
 include/configs/exynos5250-dt.h   |7 +
 include/fdtdec.h  |1 +
 include/tmu.h |   46 
 lib/fdtdec.c  |1 +
 18 files changed, 594 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-exynos/exynos-tmu.h
 create mode 100644 common/cmd_tmu.c
 create mode 100644 doc/device-tree-bindings/exynos/tmu.txt
 create mode 100644 drivers/power/exynos-tmu.c
 create mode 100644 include/tmu.h

-- 
1.7.2.3

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


[U-Boot] [PATCH 1/8] EXYNOS5: FDT: Add TMU device node values

2012-12-11 Thread Hatim Ali
From: Akshay Saraswat 

Fdt entry for Exynos TMU driver specific pre-defined values used for
calibration of current temperature and defining threshold values.

Signed-off-by: Akshay Saraswat 
Acked-by: Simon Glass 

diff --git a/arch/arm/dts/exynos5250.dtsi b/arch/arm/dts/exynos5250.dtsi
index fa4d498..db22db6 100644
--- a/arch/arm/dts/exynos5250.dtsi
+++ b/arch/arm/dts/exynos5250.dtsi
@@ -28,4 +28,9 @@
#address-cells = <1>;
#size-cells = <0>;
};
+
+   tmu@1006 {
+   compatible = "samsung,exynos-tmu";
+   reg = <0x1006 0x>;
+   };
 };
diff --git a/board/samsung/dts/exynos5250-smdk5250.dts 
b/board/samsung/dts/exynos5250-smdk5250.dts
index b6fbb67..2d3ecca 100644
--- a/board/samsung/dts/exynos5250-smdk5250.dts
+++ b/board/samsung/dts/exynos5250-smdk5250.dts
@@ -26,4 +26,17 @@
phy-mode = "mii";
};
};
+
+   tmu@1006 {
+   samsung,mux = <6>;
+   samsung,min-temp= <25>;
+   samsung,max-temp= <125>;
+   samsung,start-warning   = <95>;
+   samsung,start-tripping  = <105>;
+   samsung,efuse-min-value = <40>;
+   samsung,efuse-value = <55>;
+   samsung,efuse-max-value = <100>;
+   samsung,slope   = <268470274>;
+   samsung,dc-value= <25>;
+   };
 };
diff --git a/doc/device-tree-bindings/exynos/tmu.txt 
b/doc/device-tree-bindings/exynos/tmu.txt
new file mode 100644
index 000..99e7164
--- /dev/null
+++ b/doc/device-tree-bindings/exynos/tmu.txt
@@ -0,0 +1,35 @@
+Exynos Thermal management Unit
+
+The device node for TMU that is a part of Exynos5250
+SOC is as described in the document "Open Firmware Recommended
+Practic : Universal Serial Bus" with the following modifications
+and additions:
+
+Required properties :
+ - compatible : Should be "samsung,exynos-tmu" for TMU
+ - samsung,mux : mux Address for the TMU to enable TMU core:
+ - samsung,min-temp : Minimum temperature, default is 25:
+ - samsung,max-temp : Maximum temperature, defalut set to 125:
+ - samsung,start-warning : temp at which TMU start giving warning:
+ - samsung,start-tripping : temp at which system will trip and shutdown:
+ - samsung,efuse-min-value : SOC efuse min value:
+ - samsung,efuse-value : SOC actual efuse value:
+ - samsung,efuse-max-value : SoC max efuse value:
+ - samsung,slope : Gain of amplifier, default is 268470274:
+ - samsung,dc-value : DC value of TMU, default is 25:
+
+Example:
+
+tmu@1006 {
+   compatible = "samsung,exynos-tmu"
+   samsung,mux = <6>;
+   samsung,min-temp = <25>;
+   samsung,max-temp = <125>;
+   samsung,start-warning = <95>;
+   samsung,start-tripping = <105>;
+   samsung,efuse-min-value = <40>;
+   samsung,efuse-value = <55>;
+   samsung,efuse-max-value = <100>;
+   samsung,slope = <268470274>;
+   samsung,dc-value = <25>;
+};
diff --git a/include/fdtdec.h b/include/fdtdec.h
index da3c85f..2d74cec 100644
--- a/include/fdtdec.h
+++ b/include/fdtdec.h
@@ -70,6 +70,7 @@ enum fdt_compat_id {
COMPAT_NVIDIA_TEGRA20_DC,   /* Tegra 2 Display controller */
COMPAT_SMSC_LAN9215,/* SMSC 10/100 Ethernet LAN9215 */
COMPAT_SAMSUNG_EXYNOS5_SROMC,   /* Exynos5 SROMC */
+   COMPAT_SAMSUNG_EXYNOS_TMU,  /* Exynos TMU */
 
COMPAT_COUNT,
 };
diff --git a/lib/fdtdec.c b/lib/fdtdec.c
index 85e733c..2b9df7f 100644
--- a/lib/fdtdec.c
+++ b/lib/fdtdec.c
@@ -47,6 +47,7 @@ static const char * const compat_names[COMPAT_COUNT] = {
COMPAT(NVIDIA_TEGRA20_DC, "nvidia,tegra20-dc"),
COMPAT(SMSC_LAN9215, "smsc,lan9215"),
COMPAT(SAMSUNG_EXYNOS5_SROMC, "samsung,exynos-sromc"),
+   COMPAT(SAMSUNG_EXYNOS_TMU, "samsung,exynos-tmu"),
 };
 
 const char *fdtdec_get_compatible(enum fdt_compat_id id)
-- 
1.7.2.3

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


[U-Boot] [PATCH 3/8] EXYNOS5: Power down API for Thermal Management Unit

2012-12-11 Thread Hatim Ali
From: Akshay Saraswat 

Adding API in power for system shutdown when tripping value is reached
in Exynos Thermal Management Unit.

Signed-off-by: Akshay Saraswat 
Acked-by: Simon Glass 

diff --git a/arch/arm/cpu/armv7/exynos/power.c 
b/arch/arm/cpu/armv7/exynos/power.c
index d4bce6d..725c2d3 100644
--- a/arch/arm/cpu/armv7/exynos/power.c
+++ b/arch/arm/cpu/armv7/exynos/power.c
@@ -95,3 +95,18 @@ void set_dp_phy_ctrl(unsigned int enable)
if (cpu_is_exynos5())
exynos5_dp_phy_control(enable);
 }
+
+/*
+ * This function never returns.
+ * When called this function makes system hang and PAD driving value high
+ * which in turn makes system power down in case of cold reboot.
+ */
+void power_shutdown(void)
+{
+   struct exynos5_power *power =
+   (struct exynos5_power *)samsung_get_base_power();
+
+   clrbits_le32(&power->ps_hold_control, POWER_PS_HOLD_CONTROL_DATA_HIGH);
+
+   hang();
+}
diff --git a/arch/arm/include/asm/arch-exynos/power.h 
b/arch/arm/include/asm/arch-exynos/power.h
index d2fdb59..f069a0b 100644
--- a/arch/arm/include/asm/arch-exynos/power.h
+++ b/arch/arm/include/asm/arch-exynos/power.h
@@ -863,5 +863,13 @@ void set_usbhost_phy_ctrl(unsigned int enable);
 void set_dp_phy_ctrl(unsigned int enable);
 
 #define EXYNOS_DP_PHY_ENABLE   (1 << 0)
+#define POWER_PS_HOLD_CONTROL_DATA_HIGH (1 << 8)
+
+/*
+ * This function never returns.
+ * When called this function makes system hang and PAD driving value high
+ * which in turn makes system power down in case of cold reboot.
+ */
+void power_shutdown(void) __attribute__ ((noreturn));
 
 #endif
-- 
1.7.2.3

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


[U-Boot] [PATCH 2/8] EXYNOS5: TMU: Add driver for Thermal Management Unit

2012-12-11 Thread Hatim Ali
From: Akshay Saraswat 

Adding Exynos Thermal Management Unit driver to monitor SOC
temperature and take actions corresponding to states of TMU.
System will shutdown if tripping temperature is reached.

Signed-off-by: Akshay Saraswat 
Acked-by: Simon Glass 

diff --git a/arch/arm/include/asm/arch-exynos/exynos-tmu.h 
b/arch/arm/include/asm/arch-exynos/exynos-tmu.h
new file mode 100644
index 000..c79a520
--- /dev/null
+++ b/arch/arm/include/asm/arch-exynos/exynos-tmu.h
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2012 Samsung Electronics Co., Ltd.
+ *  http://www.samsung.com
+ * Akshay Saraswat 
+ *
+ * EXYNOS - Thermal Management Unit
+ *
+ * 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 version 2 as
+ * published by the Free Software Foundation.
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#ifndef __ASM_ARCH_TMU_H
+#define __ASM_ARCH_TMU_H
+
+struct tmu_reg {
+   unsigned triminfo;
+   unsigned rsvd1;
+   unsigned rsvd2;
+   unsigned rsvd3;
+   unsigned rsvd4;
+   unsigned triminfo_control;
+   unsigned rsvd5;
+   unsigned rsvd6;
+   unsigned tmu_control;
+   unsigned rsvd7;
+   unsigned tmu_status;
+   unsigned sampling_internal;
+   unsigned counter_value0;
+   unsigned counter_value1;
+   unsigned rsvd8;
+   unsigned rsvd9;
+   unsigned current_temp;
+   unsigned rsvd10;
+   unsigned rsvd11;
+   unsigned rsvd12;
+   unsigned threshold_temp_rise;
+   unsigned threshold_temp_fall;
+   unsigned rsvd13;
+   unsigned rsvd14;
+   unsigned past_temp3_0;
+   unsigned past_temp7_4;
+   unsigned past_temp11_8;
+   unsigned past_temp15_12;
+   unsigned inten;
+   unsigned intstat;
+   unsigned intclear;
+   unsigned rsvd15;
+   unsigned emul_con;
+};
+#endif /* __ASM_ARCH_THERMAL_H */
diff --git a/drivers/power/Makefile b/drivers/power/Makefile
index 6bf388c..192a7cb 100644
--- a/drivers/power/Makefile
+++ b/drivers/power/Makefile
@@ -30,6 +30,7 @@ COBJS-$(CONFIG_TPS6586X_POWER)+= tps6586x.o
 COBJS-$(CONFIG_TWL4030_POWER)  += twl4030.o
 COBJS-$(CONFIG_TWL6030_POWER)  += twl6030.o
 COBJS-$(CONFIG_TWL6035_POWER)  += twl6035.o
+COBJS-$(CONFIG_EXYNOS_TMU) += exynos-tmu.o
 
 COBJS  := $(COBJS-y)
 SRCS   := $(COBJS:.o=.c)
diff --git a/drivers/power/exynos-tmu.c b/drivers/power/exynos-tmu.c
new file mode 100644
index 000..ce71408
--- /dev/null
+++ b/drivers/power/exynos-tmu.c
@@ -0,0 +1,297 @@
+/*
+ * Copyright (c) 2012 Samsung Electronics Co., Ltd.
+ *  http://www.samsung.com
+ * Akshay Saraswat 
+ *
+ * EXYNOS - Thermal Management Unit
+ *
+ * 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 version 2 as
+ * published by the Free Software Foundation.
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#define TRIMINFO_RELOAD1
+#define CORE_EN1
+
+#define INTEN_RISE01
+#define INTEN_RISE1(1 << 4)
+#define INTEN_RISE2(1 << 8)
+#define INTEN_FALL0(1 << 16)
+#define INTEN_FALL1(1 << 20)
+#define INTEN_FALL2(1 << 24)
+
+#define TRIM_INFO_MASK 0xff
+
+#define INTCLEAR_RISE0 1
+#define INTCLEAR_RISE1 (1 << 4)
+#define INTCLEAR_RISE2 (1 << 8)
+#define INTCLEAR_FALL0 (1 << 16)
+#define INTCLEAR_FALL1 (1 << 20)
+#define INTCLEAR_FALL2 (1 << 24)
+#define INTCLEARALL(INTCLEAR_RISE0 | INTCLEAR_RISE1 | \
+INTCLEAR_RISE2 | INTCLEAR_FALL0 | \
+INTCLEAR_FALL1 | INTCLEAR_FALL2)
+
+/* Tmeperature threshold values for various thermal events */
+struct temperature_params {
+   /* minimum value in temperature code range */
+   unsigned int min_val;
+   /* maximum value in temperature code range */
+   unsigned int max_val;
+   /* temperature threshold to start warning */
+   unsigned int start_warning;
+   /* temperature threshold CPU tripping */
+   unsigned int start_tripping;
+};
+
+/* Pre-defined values and thresholds for calibration of current temperature */
+struct tmu_data {
+   /* pre-defined temperature thresholds */
+   struct temperature_params ts;
+   /* pre-defined efuse range minimum

[U-Boot] [PATCH 4/8] Add a poll function to monitor events

2012-12-11 Thread Hatim Ali
From: Akshay Saraswat 

Adding a generic polling function to continuously monitor events and
trigger actions corresponding to them.

Signed-off-by: Akshay Saraswat 
Acked-by: Simon Glass 

diff --git a/README b/README
index 037513a..0e4083c 100644
--- a/README
+++ b/README
@@ -2841,6 +2841,13 @@ Configuration Settings:
the application (usually a Linux kernel) when it is
booted
 
+- CONFIG_BOARD_POLL
+   There are various scenarios in which parallel-thread like
+   polling is required to monitor status of variety of devices.
+   For such situations CONFIG_BOARD_POLL shall be enabled
+   and funtion call board_poll_devices() from console_tstc()
+   will then poll for the device status as defined inside function.
+
 - CONFIG_SYS_BAUDRATE_TABLE:
List of legal baudrate settings for this board.
 
diff --git a/common/console.c b/common/console.c
index 1177f7d..d320b9b 100644
--- a/common/console.c
+++ b/common/console.c
@@ -117,6 +117,11 @@ static int console_tstc(int file)
int i, ret;
struct stdio_dev *dev;
 
+#if defined CONFIG_BOARD_POLL
+   /* Generic polling function */
+   board_poll_devices();
+#endif
+
disable_ctrlc(1);
for (i = 0; i < cd_count[file]; i++) {
dev = console_devices[file][i];
diff --git a/include/common.h b/include/common.h
index 5e3c5ee..b6f563b 100644
--- a/include/common.h
+++ b/include/common.h
@@ -778,6 +778,12 @@ void   clear_ctrlc (void); /* clear the Control-C 
condition */
 intdisable_ctrlc (int);/* 1 to disable, 0 to enable Control-C detect */
 
 /*
+ * A generic polling function.
+ * This will be called form console_tstc() to poll for various events.
+ */
+void board_poll_devices(void);
+
+/*
  * STDIO based functions (can always be used)
  */
 /* serial stuff */
-- 
1.7.2.3

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


[U-Boot] [PATCH 5/8] EXYNOS5: TMU: Add TMU status polling

2012-12-11 Thread Hatim Ali
From: Akshay Saraswat 

This adds call to tmu_init() and TMU status polling in board_poll_devices()
funtion to monitor temperature change of the SOC.

Signed-off-by: Akshay Saraswat 
Acked-by: Simon Glass 

diff --git a/board/samsung/smdk5250/smdk5250.c 
b/board/samsung/smdk5250/smdk5250.c
index ac7346d..db2457b 100644
--- a/board/samsung/smdk5250/smdk5250.c
+++ b/board/samsung/smdk5250/smdk5250.c
@@ -32,15 +32,51 @@
 #include 
 #include 
 #include 
+#include 
+#include 
+#include 
 
 DECLARE_GLOBAL_DATA_PTR;
 
+/*
+ * Polling various devices on board for details and status monitoring purposes
+ */
+void board_poll_devices(void)
+{
+#if defined CONFIG_EXYNOS_TMU
+   int temp;
+
+   switch (tmu_monitor(&temp)) {
+   case TMU_STATUS_TRIPPED:
+   puts("EXYNOS_TMU: TRIPPING! Device power going down ...\n");
+   power_shutdown();
+   break;
+   case TMU_STATUS_WARNING:
+   puts("EXYNOS_TMU: WARNING! Temperature very high\n");
+   break;
+   case TMU_STATUS_INIT:
+   case TMU_STATUS_NORMAL:
+   break;
+   default:
+   debug("Unknown TMU state\n");
+   }
+#endif
+}
+
 int board_init(void)
 {
gd->bd->bi_boot_params = (PHYS_SDRAM_1 + 0x100UL);
 #if defined(CONFIG_PMIC)
pmic_init();
 #endif
+
+#if defined CONFIG_EXYNOS_TMU
+   if (tmu_init(gd->fdt_blob)) {
+   debug("%s: Failed to init TMU\n", __func__);
+   return -1;
+   }
+#endif
+
 #ifdef CONFIG_EXYNOS_SPI
spi_init();
 #endif
-- 
1.7.2.3

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


[U-Boot] [PATCH 6/8] EXYNOS5: Config: Enable support for Exynos TMU driver

2012-12-11 Thread Hatim Ali
From: Akshay Saraswat 

Enables TMU driver support for exynos5250

Signed-off-by: Akshay Saraswat 
Acked-by: Simon Glass 

diff --git a/include/configs/exynos5250-dt.h b/include/configs/exynos5250-dt.h
index 12f555c..2f4315a 100644
--- a/include/configs/exynos5250-dt.h
+++ b/include/configs/exynos5250-dt.h
@@ -106,6 +106,12 @@
 #define CONFIG_BOOTDELAY   3
 #define CONFIG_ZERO_BOOTDELAY_CHECK
 
+/* Generic Device Polling */
+#define CONFIG_BOARD_POLL
+
+/* Thermal Management Unit */
+#define CONFIG_EXYNOS_TMU
+
 /* USB */
 #define CONFIG_CMD_USB
 #define CONFIG_USB_EHCI
-- 
1.7.2.3

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


[U-Boot] [PATCH 7/8] TMU: Add u-boot command to read current temp

2012-12-11 Thread Hatim Ali
From: Alim Akhtar 

Adds a new u-boot command to read current temprature from tmu driver.

Signed-off-by: Alim Akhtar 
Acked-by: Simon Glass 

diff --git a/README b/README
index 0e4083c..d3e7ea3 100644
--- a/README
+++ b/README
@@ -3877,6 +3877,7 @@ icache- enable or disable instruction cache
 dcache - enable or disable data cache
 reset  - Perform RESET of the CPU
 echo   - echo args to console
+tmu- measurement values by Thermal Management Unit
 version - print monitor version
 help   - print online help
 ?  - alias for 'help'
diff --git a/common/Makefile b/common/Makefile
index ded6318..93dc65a 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -155,6 +155,7 @@ COBJS-$(CONFIG_CMD_STRINGS) += cmd_strings.o
 COBJS-$(CONFIG_CMD_TERMINAL) += cmd_terminal.o
 COBJS-$(CONFIG_CMD_TIME) += cmd_time.o
 COBJS-$(CONFIG_SYS_HUSH_PARSER) += cmd_test.o
+COBJS-$(CONFIG_CMD_TMU) += cmd_tmu.o
 COBJS-$(CONFIG_CMD_TPM) += cmd_tpm.o
 COBJS-$(CONFIG_CMD_TSI148) += cmd_tsi148.o
 COBJS-$(CONFIG_CMD_UBI) += cmd_ubi.o
diff --git a/common/cmd_tmu.c b/common/cmd_tmu.c
new file mode 100644
index 000..836e457
--- /dev/null
+++ b/common/cmd_tmu.c
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 2012 Samsung Electronics
+ * Alim Akhtar 
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include 
+#include 
+#include 
+
+int do_tmu(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+{
+   int cur_temp;
+
+   if (argc < 2)
+   return CMD_RET_USAGE;
+
+   if (strcmp(argv[1], "curtemp") == 0) {
+   if (tmu_monitor(&cur_temp) == -1)
+   printf("TMU is in unknown state,temperature invalid\n");
+   else
+   printf("Current temperature: %u Celsius\n", cur_temp);
+   } else {
+   return CMD_RET_USAGE;
+   }
+
+   return 0;
+}
+
+U_BOOT_CMD(
+   tmu, 2, 1, do_tmu,
+   "Thermal Management Unit\n",
+   "curtemp - show current CPU temperature in degrees Celsius\n"
+);
-- 
1.7.2.3

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


[U-Boot] [PATCH 8/8] EXYNOS5: Config: Enable tmu command

2012-12-11 Thread Hatim Ali
From: Alim Akhtar 

This enables the tmu command to read the current SOC
temperature with the help of TMU

Signed-off-by: Alim Akhtar 
Acked-by: Simon Glass 

diff --git a/include/configs/exynos5250-dt.h b/include/configs/exynos5250-dt.h
index 2f4315a..2b9271c 100644
--- a/include/configs/exynos5250-dt.h
+++ b/include/configs/exynos5250-dt.h
@@ -111,6 +111,7 @@
 
 /* Thermal Management Unit */
 #define CONFIG_EXYNOS_TMU
+#define CONFIG_CMD_TMU
 
 /* USB */
 #define CONFIG_CMD_USB
-- 
1.7.2.3

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


Re: [U-Boot] [PATCH 0/5 v2] Add DT based ethernet driver for SMDK5250

2012-12-11 Thread Hatim Rv
Dear Minkyu Kang,

I have submitted the rebased patches.

Regards,
Hatim Ali

On Fri, Dec 7, 2012 at 2:29 PM, Minkyu Kang  wrote:
> Dear Hatim
>
> On 06/11/12 19:13, Hatim Ali wrote:
>> This patch series enables the DT support on SMDK5250.
>> Ethernet is the first driver whose discovery is based on DT node.
>> More DT based drivers to be added subsequently
>>
>> Changes since v1:
>>   - Renamed the smdk5250.h file to exynos5250-dt.h to create a common
>> configuration file which can be used by all the boards based on
>> exynos5250 using Device Tree.
>>   - Created a new smdk5250.h file specifying the dts file specific to
>> SMDK5250
>>   - Incorporated minor nit (removal of blank lines)
>>
>> Hatim Ali (5):
>>   EXYNOS5: FDT: add initial dts file for EXYNOS5250, SMDK5250
>>   fdt: exynos5: Add DT node definition for SROM and SMSC9215
>>   exynos5: Add DT based driver for SMC911X ethernet
>>   exynos5: config: Rename the smdk5250.h to exynos5250-dt.h
>>   SMDK5250: config: Add configuration file for SMDK5250 board
>>
>>  arch/arm/dts/exynos5250.dtsi  |   31 
>>  arch/arm/include/asm/arch-exynos/sromc.h  |   18 ++
>>  board/samsung/dts/exynos5250-smdk5250.dts |   29 +++
>>  board/samsung/smdk5250/smdk5250.c |  115 +
>>  include/configs/exynos5250-dt.h   |  267 
>> +
>>  include/configs/smdk5250.h|  245 +-
>>  include/fdtdec.h  |2 +
>>  lib/fdtdec.c  |2 +
>>  8 files changed, 442 insertions(+), 267 deletions(-)
>>  create mode 100644 arch/arm/dts/exynos5250.dtsi
>>  create mode 100644 board/samsung/dts/exynos5250-smdk5250.dts
>>  create mode 100644 include/configs/exynos5250-dt.h
>>
>
> please rebase this patchset.
>
> Thanks.
> Minkyu Kang.
> ___
> 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


[U-Boot] please pull u-boot-samsung/resolve

2012-12-11 Thread Minkyu Kang
Dear Albert,

The following changes since commit fd4d564b3c80b111f18c93adb14233a6a7ddb0e9:

  Merge branch 'master' of git://git.denx.de/u-boot-x86 (2012-12-07 08:47:59 
-0700)

are available in the git repository at:


  git://git.denx.de/u-boot-samsung resolve

for you to fetch changes up to fbef8e6e7f1233ed20f8c5045e12c9cf31b43540:

  universal_c210: check the NULL pointer when get the PMIC (2012-12-11 17:37:28 
+0900)


Albert ARIBAUD (1):
  Merge branch 'u-boot-imx/master' into 'u-boot-arm/master'

Allen Martin (1):
  tegra: add CONSOLE_MUX support to tegra-kbc

Ashok Kumar Reddy (1):
  ARM: arm1176: Define arch_cpu_init() for s3c64xx

Benoît Thébaudeau (17):
  arm1136: Fix enable_caches()
  mx31: Move EHCI definitions to ehci-fsl.h
  ehci-mxc: Clean up
  ehci-mx5: Clean up
  ehci-mx5: Fix OC_DIS usage
  ehci-mx5: Fix OPM usage
  ehci-mx5: Fix *PM usage for i.MX53
  ehci-mx5: Add missing OC_DIS for i.MX53
  ehci-mxc: Make EHCI power/oc polarities configurable
  ehci-mxc: Make i.MX25 EHCI configurable
  ehci-mxc: Define host offsets
  ehci-mxc: Add support for i.MX35
  mx35pdk: Add support for OTG
  ehci-mx5/6: Make board_ehci_hcd_init() optional
  ehci-mxc: Fix host power mask bit for i.MX35
  ehci-mxc: Fix host power mask bit for i.MX25
  mx5: Mark lowlevel_init board-specific code

Chander Kashyap (1):
  Exynos5250: Enable PXE Support

Fabio Estevam (24):
  mx25pdk: Include CONFIG_MX25
  mx25pdk: Add esdhc support
  pmic_fsl: Introduce FSL_PMIC_I2C_LENGTH
  mx25: Place common functions into sys_proto.h
  pmic: Add support for mc34704
  mx25pdk: Add Ethernet support
  mx53loco: Allow booting a zImage kernel
  mx25pdk: Allow booting a zImage kernel
  mx51evk: Allow booting a zImage kernel
  mx35pdk: Allow booting a zImage kernel
  mx6qsabre_common: Allow booting a zImage kernel
  mx5: Align SPI CS naming with i.MX53 reference manual
  mx5: Print CSPI clock in 'clock' command
  spi: mxc_spi: Fix handling of chip select
  spi: mxc_spi: Fix spi clock glitch durant reset
  mx6: clock: Only show CSPI clock if CSPI is enabled
  mx28evk: Configure CONFIG_BOOTDELAY to one second
  mx53loco: Configure CONFIG_BOOTDELAY to one second
  mx6qsabrelite: Configure CONFIG_BOOTDELAY to one second
  mx6qsabre_common: Configure CONFIG_BOOTDELAY to one second
  mx51evk: Configure CONFIG_BOOTDELAY to one second
  mx25pdk: Configure CONFIG_BOOTDELAY to one second
  mx31pdk: Configure CONFIG_BOOTDELAY to one second
  mx35pdk: Configure CONFIG_BOOTDELAY to one second

Hatim RV (3):
  EXYNOS: Add clock for SPI
  EXYNOS5: Add base address for SPI
  EXYNOS5: Enable SPI

Marek Vasut (3):
  dm: wdt: Move s5p watchdog timer to drivers/watchdog/
  mx28: Fix typo in POWER_MINPWR_VBG_OFF
  mx28: Fix typo in POWER_DCLIMITS_NEGLIMIT_OFFSET

Mayuresh Kulkarni (1):
  tegra: Enable display/lcd support on Seaboard

Minkyu Kang (6):
  ARCH: EXYNOS: add support to match product id
  EXYNOS: Clock: Add common function for pll rate calculation
  s3c64xx: fix the compiler error and warning
  Merge branch 'master' of git://git.denx.de/u-boot into resolve
  universal_c210: fix compiler error and compiler warning
  universal_c210: check the NULL pointer when get the PMIC

Piotr Wilczek (12):
  arm:exynos4:trats: Correct SDRAM configuration for trats
  arm:exynos4:trats: Fix SDRAM size
  arm:exynos4:pinmux: Modify the gpio function for mmc
  arm:exynos4:trats: Use pinmux for mmc configuration
  arm:exynos4:universal: Use pinmux for mmc configuration
  arm:exynos4:universal: Eliminated low level init
  arm: trats: Power down core 1
  exynos4: universal_C210: use software SPI
  misc:max8998 Add LDO macros
  drivers: video: Add ld9040 video driver
  drivers: video: fix image position
  exynos4: universal_C210: add display support

Rajeshwari Shinde (16):
  PMIC: MAX77686: Add support for MAX77686
  SMDK5250: Config: Enable MAX77686 pmic chip
  SOUND: SAMSUNG: Add I2S driver
  SOUND: Add WM8994 codec
  Sound: Add command for audio playback
  EXYNOS: Add I2S registers
  EXYNOS: Add parameters required by I2S
  EXYNOS: Add pinmux for I2S
  EXYNOS: Add I2S base address
  EXYNOS: Add clock for I2S
  SMDK5250: Enable Sound
  EXYNOS5: Add pinmux support for SPI
  SPI: Add SPI Driver for EXYNOS.
  EXYNOS5: Enable SPI booting.
  POWER: MAX77686: Modified as per the latest Implementation
  SMDK5250: Enable pmic MAX77686

Simon Glass (17):
  pxa: Disable dcache on palmld, palmtc, zipitz2
  tegra: Use const for pinmux_config_pingroup/table()
  tegra: Add display support to funcmux
  tegra: fdt: Add pwm binding and node
  tegra: fdt: Add LCD de

Re: [U-Boot] [PATCH v3 6/9] dfu: Send correct DFU response from composite_setup

2012-12-11 Thread Lukasz Majewski
Hi Lukasz,

> Tomorrow I will prepare output of USB Ellisys analizer on my side, so
> we could get clue what is going on.   

Since log itself waits for moderator approval, I will be more precise:

1. dfu-util version 0.1+svnexported

2. u-boot-denx master branch:

SHA1: d987274e214cbfc7a56504fb3f0575fc6d2c587a

-- 
Best regards,

Lukasz Majewski

Samsung Poland R&D Center | Linux Platform Group
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 1/5] EXYNOS5: Change parent clock of FIMD to MPLL

2012-12-11 Thread Ajay Kumar
With VPLL as source clock to FIMD,
Exynos DP Initializaton was failing sometimes with unstable clock.
Changing FIMD source to resolves this issue.

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

diff --git a/arch/arm/cpu/armv7/exynos/clock.c 
b/arch/arm/cpu/armv7/exynos/clock.c
index fe61f88..bfcd5f7 100644
--- a/arch/arm/cpu/armv7/exynos/clock.c
+++ b/arch/arm/cpu/armv7/exynos/clock.c
@@ -603,7 +603,7 @@ void exynos5_set_lcd_clk(void)
 */
cfg = readl(&clk->src_disp1_0);
cfg &= ~(0xf);
-   cfg |= 0x8;
+   cfg |= 0x6;
writel(cfg, &clk->src_disp1_0);
 
/*
-- 
1.7.1

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


[U-Boot] [PATCH 2/5] EXYNOS5: Add pinmux for LCD

2012-12-11 Thread Ajay Kumar
This patch adds pinmux configuration for backlight, LCD reset
and HPD for DP panel on Exynos5 SMDK.

Signed-off-by: Ajay Kumar 
---
 arch/arm/cpu/armv7/exynos/pinmux.c|   20 
 arch/arm/include/asm/arch-exynos/periph.h |1 +
 2 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/arch/arm/cpu/armv7/exynos/pinmux.c 
b/arch/arm/cpu/armv7/exynos/pinmux.c
index f02f441..84f52ea 100644
--- a/arch/arm/cpu/armv7/exynos/pinmux.c
+++ b/arch/arm/cpu/armv7/exynos/pinmux.c
@@ -284,6 +284,23 @@ void exynos5_spi_config(int peripheral)
}
 }
 
+void exynos5_lcd_config()
+{
+   struct exynos5_gpio_part1 *gpio1 =
+   (struct exynos5_gpio_part1 *) samsung_get_base_gpio_part1();
+
+   /* For Backlight */
+   s5p_gpio_cfg_pin(&gpio1->b2, 0, GPIO_OUTPUT);
+   s5p_gpio_set_value(&gpio1->b2, 0, 1);
+
+   /* LCD power on */
+   s5p_gpio_cfg_pin(&gpio1->x1, 5, GPIO_OUTPUT);
+   s5p_gpio_set_value(&gpio1->x1, 5, 1);
+
+   /* Set Hotplug detect for DP */
+   s5p_gpio_cfg_pin(&gpio1->x0, 7, GPIO_FUNC(0x3));
+}
+
 static int exynos5_pinmux_config(int peripheral, int flags)
 {
switch (peripheral) {
@@ -321,6 +338,9 @@ static int exynos5_pinmux_config(int peripheral, int flags)
case PERIPH_ID_SPI4:
exynos5_spi_config(peripheral);
break;
+   case PERIPH_ID_LCD:
+   exynos5_lcd_config();
+   break;
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 13abd2d..446f5c9 100644
--- a/arch/arm/include/asm/arch-exynos/periph.h
+++ b/arch/arm/include/asm/arch-exynos/periph.h
@@ -54,6 +54,7 @@ enum periph_id {
PERIPH_ID_UART1,
PERIPH_ID_UART2,
PERIPH_ID_UART3,
+   PERIPH_ID_LCD,
 
PERIPH_ID_COUNT,
PERIPH_ID_NONE = -1,
-- 
1.7.1

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


[U-Boot] [PATCH 3/5] video: Fix compilation dependency of exynos_dp and exynos_mipi on exynos_fb

2012-12-11 Thread Ajay Kumar
When only DP is used, we need not enable CONFIG_EXYNOS_MIPI_DSIM.
Similarly, when only MIPI is used, we need not enable CONFIG_EXYNOS_DP.
But the current structuring of code forces us to enable both
CONFIG_EXYNOS_MIPI_DSIM and CONFIG_EXYNOS_DP.
This patch adds conditional compilation check to remove the dependency.

Signed-off-by: Ajay Kumar 
---
 drivers/video/exynos_fb.c |4 
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/video/exynos_fb.c b/drivers/video/exynos_fb.c
index d9a3f9a..39d3b74 100644
--- a/drivers/video/exynos_fb.c
+++ b/drivers/video/exynos_fb.c
@@ -103,8 +103,10 @@ static void lcd_panel_on(vidinfo_t *vid)
 
udelay(vid->power_on_delay);
 
+#ifdef CONFIG_EXYNOS_DP
if (vid->dp_enabled)
exynos_init_dp();
+#endif
 
if (vid->reset_lcd) {
vid->reset_lcd();
@@ -120,8 +122,10 @@ static void lcd_panel_on(vidinfo_t *vid)
if (vid->enable_ldo)
vid->enable_ldo(1);
 
+#ifdef CONFIG_EXYNOS_MIPI_DSIM
if (vid->mipi_enabled)
exynos_mipi_dsi_init();
+#endif
 }
 
 void lcd_ctrl_init(void *lcdbase)
-- 
1.7.1

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


[U-Boot] [PATCH 4/5] EXYNOS5: Add support for FIMD and DP

2012-12-11 Thread Ajay Kumar
Add panel_info structure required by LCD driver
and DP panel platdata for SMDK5250.
Enable FIMD and DP support on SMDK5250.
DP Panel size: 2560x1600.
We use 16BPP resolution to get LCD console.

Signed-off-by: Ajay Kumar 
---
 board/samsung/smdk5250/smdk5250.c |   82 +
 include/configs/smdk5250.h|9 
 2 files changed, 91 insertions(+), 0 deletions(-)

diff --git a/board/samsung/smdk5250/smdk5250.c 
b/board/samsung/smdk5250/smdk5250.c
index 4c50342..e3d6ac1 100644
--- a/board/samsung/smdk5250/smdk5250.c
+++ b/board/samsung/smdk5250/smdk5250.c
@@ -24,12 +24,15 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
+#include 
 #include 
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -181,6 +184,85 @@ static int board_uart_init(void)
return 0;
 }
 
+vidinfo_t panel_info = {
+   .vl_freq= 60,
+   .vl_col = 2560,
+   .vl_row = 1600,
+   .vl_width   = 2560,
+   .vl_height  = 1600,
+   .vl_clkp= CONFIG_SYS_LOW,
+   .vl_hsp = CONFIG_SYS_LOW,
+   .vl_vsp = CONFIG_SYS_LOW,
+   .vl_dp  = CONFIG_SYS_LOW,
+   .vl_bpix= 4,/* LCD_BPP = 2^4, for output conosle on LCD */
+
+   /* wDP panel timing infomation */
+   .vl_hspw= 32,
+   .vl_hbpd= 80,
+   .vl_hfpd= 48,
+
+   .vl_vspw= 6,
+   .vl_vbpd= 37,
+   .vl_vfpd= 3,
+   .vl_cmd_allow_len = 0xf,
+
+   .win_id = 3,
+   .cfg_gpio   = NULL,
+   .backlight_on   = NULL,
+   .lcd_power_on   = NULL,
+   .reset_lcd  = NULL,
+   .dual_lcd_enabled = 0,
+
+   .init_delay = 0,
+   .power_on_delay = 0,
+   .reset_delay= 0,
+   .interface_mode = FIMD_RGB_INTERFACE,
+   .dp_enabled = 1,
+};
+
+static struct edp_device_info edp_info = {
+   .disp_info = {
+   .h_res = 2560,
+   .h_sync_width = 32,
+   .h_back_porch = 80,
+   .h_front_porch = 48,
+   .v_res = 1600,
+   .v_sync_width  = 6,
+   .v_back_porch = 37,
+   .v_front_porch = 3,
+   .v_sync_rate = 60,
+   },
+   .lt_info = {
+   .lt_status = DP_LT_NONE,
+   },
+   .video_info = {
+   .master_mode = 0,
+   .bist_mode = DP_DISABLE,
+   .bist_pattern = NO_PATTERN,
+   .h_sync_polarity = 0,
+   .v_sync_polarity = 0,
+   .interlaced = 0,
+   .color_space = COLOR_RGB,
+   .dynamic_range = VESA,
+   .ycbcr_coeff = COLOR_YCBCR601,
+   .color_depth = COLOR_8,
+   },
+};
+
+static struct exynos_dp_platform_data dp_platform_data = {
+   .phy_enable = set_dp_phy_ctrl,
+   .edp_dev_info   = &edp_info,
+};
+
+void init_panel_info(vidinfo_t *vid)
+{
+   vid->logo_on= 1,
+   vid->rgb_mode   = MODE_RGB_P,
+
+   exynos_set_dp_platform_data(&dp_platform_data);
+   exynos_pinmux_config(PERIPH_ID_LCD, NULL);
+}
+
 #ifdef CONFIG_SYS_I2C_INIT_BOARD
 static int board_i2c_init(void)
 {
diff --git a/include/configs/smdk5250.h b/include/configs/smdk5250.h
index e412da8..9489714 100644
--- a/include/configs/smdk5250.h
+++ b/include/configs/smdk5250.h
@@ -256,6 +256,15 @@
 #define CONFIG_SOUND_WM8994
 #endif
 
+/* Display */
+#define CONFIG_LCD
+#define CONFIG_EXYNOS_FB
+#define CONFIG_EXYNOS_DP
+#define LCD_XRES   2560
+#define LCD_YRES   1600
+#define LCD_BPPLCD_COLOR16
+#define CONFIG_CMD_BMP
+
 /* Enable devicetree support */
 #define CONFIG_OF_LIBFDT
 
-- 
1.7.1

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


[U-Boot] [PATCH 5/5] video: Modify exynos_fimd driver to support LCD console.

2012-12-11 Thread Ajay Kumar
Currently, exynos FIMD driver is being used to support only TIZEN LOGOs.
In order to get LCD console, we need to enable half word swap feature
of FIMD and use 16 BPP.

Signed-off-by: Ajay Kumar 
---
 drivers/video/exynos_fimd.c |   10 --
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/video/exynos_fimd.c b/drivers/video/exynos_fimd.c
index 06eae2e..8a12c30 100644
--- a/drivers/video/exynos_fimd.c
+++ b/drivers/video/exynos_fimd.c
@@ -88,14 +88,20 @@ static void exynos_fimd_set_par(unsigned int win_id)
/* DATAPATH is DMA */
cfg |= EXYNOS_WINCON_DATAPATH_DMA;
 
-   /* bpp is 32 */
+#ifdef CONFIG_TIZEN /* Tizen uses Proprietary LOGO */
cfg |= EXYNOS_WINCON_WSWP_ENABLE;
+#else  /* Other boards must use output console on LCD */
+   cfg |= EXYNOS_WINCON_HAWSWP_ENABLE;
+#endif
 
/* dma burst is 16 */
cfg |= EXYNOS_WINCON_BURSTLEN_16WORD;
 
-   /* pixel format is unpacked RGB888 */
+#ifdef CONFIG_TIZEN /* Tizen uses Proprietary LOGO */
cfg |= EXYNOS_WINCON_BPPMODE_24BPP_888;
+#else  /* Other boards must use output console on LCD */
+   cfg |= EXYNOS_WINCON_BPPMODE_16BPP_565;
+#endif
 
writel(cfg, (unsigned int)&fimd_ctrl->wincon0 +
EXYNOS_WINCON(win_id));
-- 
1.7.1

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


Re: [U-Boot] [PATCH v3 6/9] dfu: Send correct DFU response from composite_setup

2012-12-11 Thread Pantelis Antoniou
Hi Lukasz,

I bet transmission is performed, but with the default settings of dfu.
The DFU function descriptor is completely ignored.

An easy way to verify it is to check if the DFU version of the device
is the same one as the one stored in the descriptor. Same with the transmission
block size.

It might work, but only by accident.

I sure hope I'll have time today to send my captures as well.

Regards

-- Pantelis
 
On Dec 11, 2012, at 1:02 PM, Lukasz Majewski wrote:

> Hi Pantelis,
> 
>> Tomorrow I will prepare output of USB Ellisys analizer on my side, so
>> we could get clue what is going on. 
> 
> Please find attached output from USB ellisys analizer.
> 
> (It is possible to download WinXP based program to view logs without
> USB analizer box).
> 
> What I see in the current implementation stalls on GetDescriptor
> (Class: 0x21),but afterwards transmission is performed.
> 
> 
> 
> -- 
> Best regards,
> 
> Lukasz Majewski
> 
> Samsung Poland R&D Center | Linux Platform Group
> 

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


Re: [U-Boot] [PATCH v3 6/9] dfu: Send correct DFU response from composite_setup

2012-12-11 Thread Robert P. J. Day
On Tue, 11 Dec 2012, Lukasz Majewski wrote:

> Hi Pantelis,
>
> > Tomorrow I will prepare output of USB Ellisys analizer on my side, so
> > we could get clue what is going on.
>
> Please find attached output from USB ellisys analizer.

  is it really appropriate to post 8M of output to a mailing
list?  what's wrong with pastebin?

rday

-- 


Robert P. J. Day Ottawa, Ontario, CANADA
http://crashcourse.ca

Twitter:   http://twitter.com/rpjday
LinkedIn:   http://ca.linkedin.com/in/rpjday

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


Re: [U-Boot] [PATCH 4/4] sf: Add Quad-input Page Program(32h) instruction support

2012-12-11 Thread Langer Thomas (LQDE RD ST PON SW)
Hello Jagannadha,

I have some remarks and questions, as I currently work on a hw platform, which 
also would allow 
to support dual- or quad-io accesses.

So my first question: why is this restricted to write only? If you have a 
hardware, which is capable
of supporting this, the read will definitely benefit from it, while the speedup 
for write depends on
the internal programming time of the flash.

The other questions: On which hardware platform was this tested and for which 
flashes?
Patches for both components are missing from this patch series.
And for both I have more remarks below.

Jagannadha Sutradharudu Teki wrote on 2012-12-10:
> This patch provides support to program a flash using
> Quad-input Page Program(32h) instruction.
> 
> This will effectively increases the data transfer rate
> by up to four times, as compared to the Page Program(PP) instruction.
> 
> Respective flash drivers need to use spi_flash_cmd_write_multi_qpp()
> based on their usage.
> 


> +#ifdef CONFIG_CMD_SF_QPP
> + else if (strcmp(argv[0], "write.qpp") == 0)
> + ret = spi_flash_write_qpp(flash, offset, len, buf);
> +#endif
Is it really necessary to have a dedicated command here? Wouldn't it be better, 
if the SF layer or
the driver will use it automatically, if the hardware supports it and the 
driver has detected the
feature of the flash?

> +#ifdef CONFIG_CMD_SF_QPP
> +int spi_flash_set_quad_enable_bit(struct spi_flash *flash)
> +{
[...]
> +
> + if (data & 0x2) {
> + debug("SF: quad enable bit is already set.\n");
Is this bit common for all flashes? Otherwise add some comments on tested 
flashed
and/or TODO for an extension to provide this info from the flash driver.

> + return ret;
> + } else {
> + debug("SF: need to set quad enable bit\n");
> +
> + ret = spi_flash_cmd_write_config(flash, 0x0200);
Same here. And why is this a 16-bit value here?

> +int spi_flash_cmd_write_multi_qpp(struct spi_flash *flash, u32 offset,
> + size_t len, const void *buf)
> +{
> + unsigned long page_addr, byte_addr, page_size;
> + size_t chunk_len, actual;
> + int ret;
> + u8 cmd[4];
> +
> + page_size = flash->page_size;
> + page_addr = offset / page_size;
> + byte_addr = offset % page_size;
> +
> + ret = spi_claim_bus(flash->spi);
> + if (ret) {
> + debug("SF: unable to claim SPI bus\n");
> + return ret;
> + }
> +
> + ret = spi_flash_set_quad_enable_bit(flash);
I don't like this implicit setting here. And as far as I know, this bit is 
sticky/non-volatile. It is not
necessary to write this each time.
Maybe it make more sense to  have an interactive command to write this bit 
(enabled or disabled)
to the flash?
And then the flash probe function can check the bit and map to the appropriate 
read and write
functions.

> + if (ret) {
> + debug("SF: set quad enable bit failed\n");
> + return ret;
> + }
> +
> + cmd[0] = CMD_QUAD_PAGE_PROGRAM;
> + for (actual = 0; actual < len; actual += chunk_len) {
> + chunk_len = min(len - actual, page_size - byte_addr);
> +
> + cmd[1] = page_addr >> 8;
> + cmd[2] = page_addr;
> + cmd[3] = byte_addr;
> +
> + debug("PP: 0x%p => cmd = { 0x%02x 0x%02x%02x%02x }
> chunk_len = %zu\n",
> +   buf + actual, cmd[0], cmd[1], cmd[2], cmd[3], chunk_len);
> +
> + ret = spi_flash_cmd_write_enable(flash);
> + if (ret < 0) {
> + debug("SF: enabling write failed\n");
> + break;
> + }
> +
> + ret = spi_flash_cmd_write(flash->spi, cmd, 4,
> +   buf + actual, chunk_len);
> + if (ret < 0) {
> + debug("SF: write failed\n");
> + break;
> + }
Except for the config bit and the different command code, I don't see any 
difference to the
"regular" spi_flash_cmd_write_multi function. So the question is: How does the 
SPI framework
knows when to send 4 bits in parallel to 4 pins instead of the serialization to 
one signal pin?

This extension to the SPI framework is completely missing!

> diff --git a/include/spi_flash.h b/include/spi_flash.h
> index 9da9062..61f0c19 100644
> --- a/include/spi_flash.h
> +++ b/include/spi_flash.h
> @@ -43,6 +43,10 @@ struct spi_flash {
>   size_t len, void *buf);
>   int (*write)(struct spi_flash *flash, u32 offset,
>   size_t len, const void *buf);
> +#ifdef CONFIG_CMD_SF_QPP
> + int (*write_qpp)(struct spi_flash *flash, u32 offset,
> + size_t len, const void *buf);

The flash probe should detect, if QPP is possible, and then map the existing 
(*read) and (*write)
pointers to the relevant functions. No new pointers required here.

> +#endif
>   

Re: [U-Boot] [PATCH 2/4] S5P: GPIO: Add GPIO pin numbering to driver

2012-12-11 Thread Rajeshwari Birje
Hi Minkyu Kang,

Thank you for comments.

On Wed, Dec 5, 2012 at 4:51 PM, Minkyu Kang  wrote:
> Dear Rajeshwari,
>
> On 05/12/12 19:46, Minkyu Kang wrote:
>> API's for GPIO pin numbering support are added to the generic S5P
>> gpio driver
>>
>> Signed-off-by: Leela Krishna Amudala 
>> Signed-off-by: Simon Glass 
>> Signed-off-by: Rajeshawari Shinde 
>> ---
>>  drivers/gpio/s5p_gpio.c |  158
>> +--
>>  1 files changed, 152 insertions(+), 6 deletions(-)
>>
>> diff --git a/drivers/gpio/s5p_gpio.c b/drivers/gpio/s5p_gpio.c
>> index 47f3213..5c051d4 100644
>> --- a/drivers/gpio/s5p_gpio.c
>> +++ b/drivers/gpio/s5p_gpio.c
>> @@ -142,20 +142,165 @@ void s5p_gpio_set_rate(struct s5p_gpio_bank *bank,
>> int gpio, int mode)
>>   writel(value, &bank->drv);
>>  }
>>
>> -struct s5p_gpio_bank *s5p_gpio_get_bank(unsigned gpio)
>> +
>> +int s5p_gpio_get_pin(unsigned gpio)
>>  {
>> - int bank = gpio / GPIO_PER_BANK;
>> - bank *= sizeof(struct s5p_gpio_bank);
>> + return gpio % GPIO_PER_BANK;
>> +}
>>
>> - return (struct s5p_gpio_bank *) (s5p_gpio_base(gpio) + bank);
>> +#ifdef HAVE_GENERIC_GPIO
>
> Is it generic naming?
-- As of now it has been defined only for EXYNOS5.
>
> Also.. why we support two types of GPIO functions?
> If you want to support generic GPIO, you should be replaced new gpio 
> functions completely.
- We can do it, we can have only 1 set of gpio functions.
>
>> +static struct s5p_gpio_bank *gpio_get_bank(unsigned int gpio)
>> +{
>> + int bank_offset;
>> +
>> + if (gpio < GPIO_MAX_PORT_PART_1) {
>> + bank_offset = gpio / GPIO_PER_BANK;
>> + return (struct s5p_gpio_bank *) (EXYNOS5_GPIO_PART1_BASE +
>
> Is it exynos5 specific?
Yes it is exynos5 specific as in EXYNOS5 the gpio banks are not
continuous and the number of pins are also not uniform across the gpio
banks hence the exsistting funcion gives us wrong values. Hence this
calculation will change for Exynos5 and we need to a dedicated
function, do suggest me if you have any other idea.
>
>> (bank_offset *
>> + sizeof(struct
>> s5p_gpio_bank)));
>> + } else if (gpio < GPIO_MAX_PORT_PART_2) {
>> + bank_offset = (gpio - GPIO_MAX_PORT_PART_1) / GPIO_PER_BANK;
>> + return (struct s5p_gpio_bank *) (EXYNOS5_GPIO_PART2_BASE +
>> (bank_offset *
>> + sizeof(struct
>> s5p_gpio_bank)));
>> + } else if (gpio < GPIO_MAX_PORT_PART_3) {
>> + bank_offset = (gpio - GPIO_MAX_PORT_PART_2) / GPIO_PER_BANK;
>> + return (struct s5p_gpio_bank *) (EXYNOS5_GPIO_PART3_BASE +
>> (bank_offset *
>> + sizeof(struct
>> s5p_gpio_bank)));
>> + }
>> + else
>
> should be moved to upper line.
> And need the brace at this else state.
- Will do this
>
>> + return (struct s5p_gpio_bank *) EXYNOS5_GPIO_PART4_BASE;
>> +
>> + return NULL;
>>  }
>>
>> -int s5p_gpio_get_pin(unsigned gpio)
>> +void gpio_cfg_pin(int gpio, int cfg)
>>  {
>> - return gpio % GPIO_PER_BANK;
>> + unsigned int value;
>> + struct s5p_gpio_bank *bank = gpio_get_bank(gpio);
>> +
>> + value = readl(&bank->con);
>> + value &= ~CON_MASK(GPIO_BIT(gpio));
>> + value |= CON_SFR(GPIO_BIT(gpio), cfg);
>> + writel(value, &bank->con);
>> +}
>> +
>> +void gpio_set_pull(int gpio, int mode)
>> +{
>> + unsigned int value;
>> + struct s5p_gpio_bank *bank = gpio_get_bank(gpio);
>> +
>> + value = readl(&bank->pull);
>> + value &= ~PULL_MASK(GPIO_BIT(gpio));
>> +
>> + switch (mode) {
>> + case GPIO_PULL_DOWN:
>> + case GPIO_PULL_UP:
>> + value |= PULL_MODE(GPIO_BIT(gpio), mode);
>> + break;
>> + default:
>> + break;
>> + }
>> +
>> + writel(value, &bank->pull);
>> +}
>> +
>> +void gpio_set_drv(int gpio, int mode)
>> +{
>> + unsigned int value;
>> + struct s5p_gpio_bank *bank = gpio_get_bank(gpio);
>> +
>> + value = readl(&bank->drv);
>> + value &= ~DRV_MASK(GPIO_BIT(gpio));
>> +
>> + switch (mode) {
>> + case GPIO_DRV_1X:
>> + case GPIO_DRV_2X:
>> + case GPIO_DRV_3X:
>> + case GPIO_DRV_4X:
>> + value |= DRV_SET(GPIO_BIT(gpio), mode);
>> + break;
>> + default:
>> + return;
>> + }
>> +
>> + writel(value, &bank->drv);
>>  }
>>
>> +void gpio_set_rate(int gpio, int mode)
>> +{
>> + unsigned int value;
>> + struct s5p_gpio_bank *bank = gpio_get_bank(gpio);
>> +
>> + value = readl(&bank->drv);
>> + value &= ~RATE_MASK(GPIO_BIT(gpio));
>> +
>> + switch (mode) {
>> + case GPIO_DRV_FAST:
>> + case GPIO_DRV_SLOW:
>> + value |= RATE_SET(GPIO_BIT(gpio));
>> + break;
>> + default:
>> + return;
>> + }
>> +
>> + writel(value, &bank->drv);
>> +}
>> +
>> +int gpio_direction_input(unsigned gpio)
>> +

Re: [U-Boot] [PATCH 7/8] TMU: Add u-boot command to read current temp

2012-12-11 Thread Wolfgang Denk
Dear Hatim Ali,

In message <1355223289-15685-8-git-send-email-hatim...@samsung.com> you wrote:
> From: Alim Akhtar 
> 
> Adds a new u-boot command to read current temprature from tmu driver.
> 
> Signed-off-by: Alim Akhtar 
> Acked-by: Simon Glass 

Do we really need a new command here?

We already have dtt, which basicly does the same.

It makes no sense to add new commands for each new device, all doing
basicly trhe same, just in an incompatible 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
The explanation requiring the fewest assumptions is the  most  likely
to be correct.-- William of Occam
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 4/8] Add a poll function to monitor events

2012-12-11 Thread Wolfgang Denk
Dear Hatim Ali,

In message <1355223289-15685-5-git-send-email-hatim...@samsung.com> you wrote:
> From: Akshay Saraswat 
> 
> Adding a generic polling function to continuously monitor events and
> trigger actions corresponding to them.
> 
> Signed-off-by: Akshay Saraswat 
> Acked-by: Simon Glass 
> 
> diff --git a/README b/README
> index 037513a..0e4083c 100644
> --- a/README
> +++ b/README
> @@ -2841,6 +2841,13 @@ Configuration Settings:
>   the application (usually a Linux kernel) when it is
>   booted
>  
> +- CONFIG_BOARD_POLL
> + There are various scenarios in which parallel-thread like
> + polling is required to monitor status of variety of devices.
> + For such situations CONFIG_BOARD_POLL shall be enabled
> + and funtion call board_poll_devices() from console_tstc()
> + will then poll for the device status as defined inside function.


Sorry, but I dislike this, for a number of reasons.

1) There is, and has always been, a very basic design decision, that
   U-Boot is strictly single-tasking, i. e. we don't have any kind of
   "background activities" goind on.  Your introduction of a device
   polling mechanism violates this principle.

   I don't say that this is unacceptable, but we have to be aware that
   this is a far-reaching decision, so we should consider it very
   carefully.

   If anything like this gets implemented, it has to be done in a way
   that will be general enough to be useful to others as well.

2) U-Boot is a boot loader, not an OS.  Do we really need continuous
   temperature management in U-Boot?  I think not.  After all, our
   main purpose is to boot an OS, and do that as fast as possible.
   The majority of users will see U-Boot running only for a few
   milliseconds, and only when they boot the device - which may be
   very seldom.

   So what exactly do we need this for?

3) Your hooking of a device polling into console_tstc() is broken by
   design.   It may be sufficient for the specific use case you have
   in mind here, but it is totally useless for any other purpose.

This needs a lot of additional thought, and major changes to the
implementation.

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
Without facts, the decision cannot be made logically. You  must  rely
on your human intuition.
-- Spock, "Assignment: Earth", stardate unknown
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 2/8] EXYNOS5: TMU: Add driver for Thermal Management Unit

2012-12-11 Thread Wolfgang Denk
Dear Hatim Ali,

In message <1355223289-15685-3-git-send-email-hatim...@samsung.com> you wrote:
> From: Akshay Saraswat 
> 
> Adding Exynos Thermal Management Unit driver to monitor SOC
> temperature and take actions corresponding to states of TMU.
> System will shutdown if tripping temperature is reached.

Do we really need this in the boot loader?

If so, can we please implement this in a way comaptible to the
existing DTT code?

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
"Beware of bugs in the above code; I have only proved it correct, not
tried it." - Donald Knuth
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 3/8] EXYNOS5: Power down API for Thermal Management Unit

2012-12-11 Thread Wolfgang Denk
Dear Hatim Ali,

In message <1355223289-15685-4-git-send-email-hatim...@samsung.com> you wrote:
> From: Akshay Saraswat 
> 
> Adding API in power for system shutdown when tripping value is reached
> in Exynos Thermal Management Unit.
> 
> Signed-off-by: Akshay Saraswat 
> Acked-by: Simon Glass 

If we add something like this, it should be general enough to be used
by other systems as well, i. e. please chose a generic API like plain
poweroff() or similar.

Best regards,

Wolfgang Denk

--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
Chapter 1 -- The story so  far:
In the beginning the Universe was created. This has  made  a  lot  of
people very angry and been widely regarded as a bad move.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3 6/9] dfu: Send correct DFU response from composite_setup

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

On 12/10/12 19:47, Marek Vasut wrote:
> Dear Lukasz Majewski,
> 
>> Pantelis,
> [...]
> 
> Hm hm ... I suspect it'd be nice to have a separate DFU custodian.
> That'd leverage some burden from me. I like that idea. I wonder if
> it'd be nice to start building such bigger net of custodians.

So long as everyone involved plays nice, we have a maintainer of the
code (Lukasz) and another user / developer of the code (Pantelis).  I
don't think we need to go full on custodian right now.  Lukasz is
reviewing and trying to understand what Pantelis is seeing since we're
seeing some odd issues on the second platform to add DFU support.

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

iQIcBAEBAgAGBQJQxzi6AAoJENk4IS6UOR1WfOcP/3ix59xKvaGPxQcW9XLBbOjj
XQC1jwqsJHTMlYY+gabgCH+A8sCiL8X5qHV7fbMu9RttS1cYvojxojk0dcIxpYdI
bQCAnKFKBNCAHzbXSqFJPnfrw8tZs7c0Ug+KfzscG+W6jacrCyb0U+NEV6QJdO+y
w+emS4zKFRMFxS6RSeAJcj5EKUa/ozn+O43oQamDl38MQ5Tut2UNZF6gf293Xw8E
+mquY3vAQiDe05x1hEt7GALwgEWrwfFVU1l5c+Xs75ERFhC2boDd8EL42GRz2HRq
X9flEOiF8za+CojRJ3yLR67jMgP4p+zmWUSPQdbqnRjrw5rzM/o2K3fSFlykmQeW
SmMaaB/imf3kJPskMsEQu9CGAJl/jWvUhM+wsaVp+YEMLTcOrQt9AzPFOGS/Zpee
hvIYdTrhGaXNDGo02kCBIvp/X2/rVBt8x4r3zhB3dDZHGxE3c4bGed6iftO8cBxA
2NODvJ2ZDGgN8i3WKo18sg4K4W5ocGck77iBFx1grfja6jr9Xcwsn3h1QIVePTXe
qMMjO7h58VrRojOr1+UwWECEbZXqr0wV8HAzTtu0KgQ4v6AcD43bHjaCg9gwWJ74
aCMmvTpW96l/8m1NAIeAWmX3fgzriMUsI/06aIpEQdFsmRF+BC452YgcyRHJbeBT
vE06Y5LBMbtGFixSgq5b
=gqji
-END PGP SIGNATURE-
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] mx25pdk: Adapt it for the new PMIC framework

2012-12-11 Thread Fabio Estevam
Make the necessary adaptions for the new PMIC framework, so that mx25pdk can
be built again. 

Signed-off-by: Fabio Estevam 
---
Stefano,

Build tested only, as I did not manage to get access to a mx25pdk.

 board/freescale/mx25pdk/mx25pdk.c |   13 ++---
 include/configs/mx25pdk.h |6 +++---
 2 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/board/freescale/mx25pdk/mx25pdk.c 
b/board/freescale/mx25pdk/mx25pdk.c
index 72fa6bc..d73e27e 100644
--- a/board/freescale/mx25pdk/mx25pdk.c
+++ b/board/freescale/mx25pdk/mx25pdk.c
@@ -27,7 +27,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 
@@ -110,11 +110,18 @@ int board_init(void)
 int board_late_init(void)
 {
struct pmic *p;
+   int ret;
 
mx25pdk_fec_init();
 
-   pmic_init();
-   p = get_pmic();
+   ret = pmic_init(I2C_PMIC);
+   if (ret)
+   return ret;
+
+   p = pmic_get("FSL_PMIC");
+   if (!p)
+   return -ENODEV;
+
/* Turn on Ethernet PHY supply */
pmic_reg_write(p, MC34704_GENERAL2_REG, ONOFFE);
 
diff --git a/include/configs/mx25pdk.h b/include/configs/mx25pdk.h
index b5338a0..bbb3161 100644
--- a/include/configs/mx25pdk.h
+++ b/include/configs/mx25pdk.h
@@ -108,9 +108,9 @@
 #define CONFIG_SYS_FSL_ESDHC_NUM   1
 
 /* PMIC Configs */
-#define CONFIG_PMIC
-#define CONFIG_PMIC_I2C
-#define CONFIG_PMIC_FSL
+#define CONFIG_POWER
+#define CONFIG_POWER_I2C
+#define CONFIG_POWER_FSL
 #define CONFIG_PMIC_FSL_MC34704
 #define CONFIG_SYS_FSL_PMIC_I2C_ADDR   0x54
 
-- 
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] mx25pdk: Adapt it for the new PMIC framework

2012-12-11 Thread Stefano Babic
On 11/12/2012 15:58, Fabio Estevam wrote:
> Make the necessary adaptions for the new PMIC framework, so that mx25pdk can
> be built again. 
> 
> Signed-off-by: Fabio Estevam 
> ---
> Stefano,
> 
> Build tested only, as I did not manage to get access to a mx25pdk.

Ok - I will merge it soon into u-boot-imx. If we will find some issues
later, we will fix on the top of it.

Acked-by: Stefano Babic 

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 v2] ARM: OMAP5: redefine arm_setup_identity_mapping

2012-12-11 Thread Vincent Stehlé
We introduce an OMAP5 specific version of arm_setup_identity_mapping(), which
makes the first page of the identity mapping invalid.

We want to unmap the region near address zero on HS OMAP devices, to avoid
speculative accesses. Accessing this region causes security violations, which
we want to avoid.

Signed-off-by: Vincent Stehlé 
Cc: Tom Rini 
---
Changes for v2:
  - Fix missing page_table argument
  - Add extern definition to fix compilation warning

 arch/arm/cpu/armv7/omap5/Makefile |1 +
 arch/arm/cpu/armv7/omap5/cache-cp15.c |   46 +
 2 files changed, 47 insertions(+)
 create mode 100644 arch/arm/cpu/armv7/omap5/cache-cp15.c

diff --git a/arch/arm/cpu/armv7/omap5/Makefile 
b/arch/arm/cpu/armv7/omap5/Makefile
index 9b261c4..49c454c 100644
--- a/arch/arm/cpu/armv7/omap5/Makefile
+++ b/arch/arm/cpu/armv7/omap5/Makefile
@@ -29,6 +29,7 @@ COBJS += hwinit.o
 COBJS  += clocks.o
 COBJS  += emif.o
 COBJS  += sdram.o
+COBJS  += cache-cp15.o
 
 SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS   := $(addprefix $(obj),$(COBJS) $(SOBJS))
diff --git a/arch/arm/cpu/armv7/omap5/cache-cp15.c 
b/arch/arm/cpu/armv7/omap5/cache-cp15.c
new file mode 100644
index 000..6ff4548
--- /dev/null
+++ b/arch/arm/cpu/armv7/omap5/cache-cp15.c
@@ -0,0 +1,46 @@
+/*
+ * (C) Copyright 2002
+ * Wolfgang Denk, DENX Software Engineering, w...@denx.de.
+ *
+ * (C) Copyright 2012
+ * Vincent Stehlé, Texas Instruments, v-ste...@ti.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 
+
+/* OMAP5 specific function to set up the identity mapping. */
+void arm_setup_identity_mapping(u32 *page_table)
+{
+   extern void __arm_setup_identity_mapping(u32 *page_table);
+
+   /*
+* Perform default mapping, which sets up an identity-mapping for all
+* 4GB, rw for everyone.
+*/
+   __arm_setup_identity_mapping(page_table);
+
+   /*
+* First page (starting at 0x0) is made invalid to avoid speculative
+* accesses in secure rom.
+* TODO: use second level descriptors for finer grained mapping.
+*/
+   page_table[0] = 0;
+}
-- 
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 v2] ARM: OMAP5: redefine arm_setup_identity_mapping

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

On 12/11/12 10:35, Vincent Stehlé wrote:
> We introduce an OMAP5 specific version of 
> arm_setup_identity_mapping(), which makes the first page of the 
> identity mapping invalid.
> 
> We want to unmap the region near address zero on HS OMAP devices, 
> to avoid speculative accesses. Accessing this region causes 
> security violations, which we want to avoid.
> 
> Signed-off-by: Vincent Stehlé  Cc: Tom Rini 
>  --- Changes for v2: - Fix missing page_table 
> argument - Add extern definition to fix compilation warning
> 
> arch/arm/cpu/armv7/omap5/Makefile |1 + 
> arch/arm/cpu/armv7/omap5/cache-cp15.c |   46 
> + 2 files changed, 47 insertions(+)
> create mode 100644 arch/arm/cpu/armv7/omap5/cache-cp15.c
> 
> diff --git a/arch/arm/cpu/armv7/omap5/Makefile 
> b/arch/arm/cpu/armv7/omap5/Makefile index 9b261c4..49c454c 100644 
> --- a/arch/arm/cpu/armv7/omap5/Makefile +++ 
> b/arch/arm/cpu/armv7/omap5/Makefile @@ -29,6 +29,7 @@ COBJS   += 
> hwinit.o COBJS+= clocks.o COBJS   += emif.o COBJS += sdram.o 
> +COBJS 
> += cache-cp15.o
> 
> SRCS  := $(SOBJS:.o=.S) $(COBJS:.o=.c) OBJS   := $(addprefix 
> $(obj),$(COBJS) $(SOBJS)) diff --git 
> a/arch/arm/cpu/armv7/omap5/cache-cp15.c 
> b/arch/arm/cpu/armv7/omap5/cache-cp15.c new file mode 100644 index 
> 000..6ff4548 --- /dev/null +++ 
> b/arch/arm/cpu/armv7/omap5/cache-cp15.c @@ -0,0 +1,46 @@ +/* + * 
> (C) Copyright 2002 + * Wolfgang Denk, DENX Software Engineering, 
> w...@denx.de. + * + * (C) Copyright 2012 + * Vincent Stehlé, Texas 
> Instruments, v-ste...@ti.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  + +/* OMAP5 specific
> function to set up the identity mapping. */ +void
> arm_setup_identity_mapping(u32 *page_table) +{ + extern void
> __arm_setup_identity_mapping(u32 *page_table);

Lets put the extern in arch/arm/include/asm/cache.h and make both
files #include .  Thanks!

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

iQIcBAEBAgAGBQJQx1SdAAoJENk4IS6UOR1WmRkQAIfaVp9YOcBPiGmKNDNTBpXL
ol4psfAEEg0OGOZdzX4lIW2+NjzLtzzcwx8s8luEt4YMtaSkPlJ+Sf5eQ1Fd9KpG
xBteU5PLWqE9mtTRBHylKrwqjysyuypFHfWpU4tiwLWygGI+eybRb0hrRKEplop6
BYjAOhJ8i4J5NYxQucFkLFeCTR7WAFQsxQ58rfDg/7KkVYcK71j+tZs6SmPijhIw
oJoGsWnpsljC/4mbTs189Y391CKmYcSNxgRtGc6fU9NJQFJ2Vx8Ajazhasvtl8sU
7yOrxR8ssFhXSSD2/PdcKUi/VHrX/mVXTV9uk4B9ImsQt5e5Jr3c8XTnw+hLdBzz
WMBpQNNPxEMibhYn3UZpskWfxR+1T1kCNbq+lVB6KVCboy98/3Bhu8OWGCLUWRk5
IB/LUfrf4uWjO5pA9hHlmzM0ckjLbQd27zGtof1qwB6EsOefL+x83XR4azqHW6Pq
6Iw+RdX7G+KKvJEqHux/fHvxrSqUzSUQJH4Bk6GYVeSNno+XfIAzNSfMfGv94zvN
HMrL9AQIhxfl+2+D1siEXG5YHw4COgNhcz55DYMZK9/1HvQ6QWW5WmT/+Ty1+DfB
WKX9ZLksdVl9dPgHtxlfaqWIVc2GrbwUgEzdZHVbdzsDfecNFDxxypBXU7U693KW
AC/XcVMEiN1rGRL0cRFt
=giVG
-END PGP SIGNATURE-
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2] ARM: OMAP5: redefine arm_setup_identity_mapping

2012-12-11 Thread Vincent Stehlé
Tom Rini:
> Lets put the extern in arch/arm/include/asm/cache.h and make both files
> #include .

Sure, here is an updated patches pair:

  [PATCH v3 1/2] ARM: cache: introduce weak arm_setup_identity_mapping
  [PATCH v3 2/2] ARM: OMAP5: redefine arm_setup_identity_mapping

Thank you for your reviews.

Best regards,

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


[U-Boot] [PATCH v3 1/2] ARM: cache: introduce weak arm_setup_identity_mapping

2012-12-11 Thread Vincent Stehlé
Separate the MMU identity mapping for ARM in a weak function, to allow
redefinition with platform specific function.

This is motivated by the need to unmap the region near address zero on HS OMAP
devices, to avoid speculative accesses. Accessing this region causes security
violations, which we want to avoid.

Signed-off-by: Vincent Stehlé 
Cc: Tom Rini 
---
Changes for v3:
  - Add definition of __arm_setup_identity_mapping() into asm/cache.h
  - Fix comments style

 arch/arm/include/asm/cache.h |1 +
 arch/arm/lib/cache-cp15.c|   22 +++---
 2 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/arch/arm/include/asm/cache.h b/arch/arm/include/asm/cache.h
index eef6a5a..328377b 100644
--- a/arch/arm/include/asm/cache.h
+++ b/arch/arm/include/asm/cache.h
@@ -41,6 +41,7 @@ static inline void invalidate_l2_cache(void)
 
 void l2_cache_enable(void);
 void l2_cache_disable(void);
+void __arm_setup_identity_mapping(u32 *page_table);
 
 /*
  * The current upper bound for ARM L1 data cache line sizes is 64 bytes.  We
diff --git a/arch/arm/lib/cache-cp15.c b/arch/arm/lib/cache-cp15.c
index 939de10..f785ff5 100644
--- a/arch/arm/lib/cache-cp15.c
+++ b/arch/arm/lib/cache-cp15.c
@@ -23,6 +23,8 @@
 
 #include 
 #include 
+#include 
+#include 
 
 #if !(defined(CONFIG_SYS_ICACHE_OFF) && defined(CONFIG_SYS_DCACHE_OFF))
 
@@ -40,6 +42,17 @@ void __arm_init_before_mmu(void)
 void arm_init_before_mmu(void)
__attribute__((weak, alias("__arm_init_before_mmu")));
 
+void __arm_setup_identity_mapping(u32 *page_table)
+{
+   int i;
+
+   /* Set up an identity-mapping for all 4GB, rw for everyone */
+   for (i = 0; i < 4096; i++)
+   page_table[i] = i << 20 | (3 << 10) | 0x12;
+}
+__weak void arm_setup_identity_mapping(u32 *page_table)
+   __attribute__((alias("__arm_setup_identity_mapping")));
+
 static void cp_delay (void)
 {
volatile int i;
@@ -72,9 +85,12 @@ static inline void mmu_setup(void)
u32 reg;
 
arm_init_before_mmu();
-   /* Set up an identity-mapping for all 4GB, rw for everyone */
-   for (i = 0; i < 4096; i++)
-   page_table[i] = i << 20 | (3 << 10) | 0x12;
+
+   /*
+* Set up an identity-mapping. Default version maps all 4GB rw for
+* everyone
+*/
+   arm_setup_identity_mapping(page_table);
 
for (i = 0; i < CONFIG_NR_DRAM_BANKS; i++) {
dram_bank_mmu_setup(i);
-- 
1.7.9.5

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


[U-Boot] [PATCH v3 2/2] ARM: OMAP5: redefine arm_setup_identity_mapping

2012-12-11 Thread Vincent Stehlé
We introduce an OMAP5 specific version of arm_setup_identity_mapping(), which
makes the first page of the identity mapping invalid.

We want to unmap the region near address zero on HS OMAP devices, to avoid
speculative accesses. Accessing this region causes security violations, which
we want to avoid.

Signed-off-by: Vincent Stehlé 
Cc: Tom Rini 
---
Changes for v3:
  - Use definition of __arm_setup_identity_mapping() from asm/cache.h

Changes for v2:
  - Fix missing page_table argument
  - Add extern definition to fix compilation warning

 arch/arm/cpu/armv7/omap5/Makefile |1 +
 arch/arm/cpu/armv7/omap5/cache-cp15.c |   45 +
 2 files changed, 46 insertions(+)
 create mode 100644 arch/arm/cpu/armv7/omap5/cache-cp15.c

diff --git a/arch/arm/cpu/armv7/omap5/Makefile 
b/arch/arm/cpu/armv7/omap5/Makefile
index 9b261c4..49c454c 100644
--- a/arch/arm/cpu/armv7/omap5/Makefile
+++ b/arch/arm/cpu/armv7/omap5/Makefile
@@ -29,6 +29,7 @@ COBJS += hwinit.o
 COBJS  += clocks.o
 COBJS  += emif.o
 COBJS  += sdram.o
+COBJS  += cache-cp15.o
 
 SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS   := $(addprefix $(obj),$(COBJS) $(SOBJS))
diff --git a/arch/arm/cpu/armv7/omap5/cache-cp15.c 
b/arch/arm/cpu/armv7/omap5/cache-cp15.c
new file mode 100644
index 000..8e4388c
--- /dev/null
+++ b/arch/arm/cpu/armv7/omap5/cache-cp15.c
@@ -0,0 +1,45 @@
+/*
+ * (C) Copyright 2002
+ * Wolfgang Denk, DENX Software Engineering, w...@denx.de.
+ *
+ * (C) Copyright 2012
+ * Vincent Stehlé, Texas Instruments, v-ste...@ti.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 
+#include 
+
+/* OMAP5 specific function to set up the identity mapping. */
+void arm_setup_identity_mapping(u32 *page_table)
+{
+   /*
+* Perform default mapping, which sets up an identity-mapping for all
+* 4GB, rw for everyone.
+*/
+   __arm_setup_identity_mapping(page_table);
+
+   /*
+* First page (starting at 0x0) is made invalid to avoid speculative
+* accesses in secure rom.
+* TODO: use second level descriptors for finer grained mapping.
+*/
+   page_table[0] = 0;
+}
-- 
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] mx25pdk: Adapt it for the new PMIC framework

2012-12-11 Thread Fabio Estevam
On Tue, Dec 11, 2012 at 1:14 PM, Stefano Babic  wrote:

> Ok - I will merge it soon into u-boot-imx. If we will find some issues
> later, we will fix on the top of it.

Good, I have managed to get a mx25pdk and I can confirm that with this
patch the FEC (which depends on a supply being turned on by the PMIC)
is functional.

Regards,

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


[U-Boot] [PATCH] woodburn: Set gpio value in gpio_direction_output()

2012-12-11 Thread Fabio Estevam
Set the gpio value in gpio_direction_output() instead of an extra gpio_set_value
call.

Signed-off-by: Fabio Estevam 
---
 board/woodburn/woodburn.c |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/board/woodburn/woodburn.c b/board/woodburn/woodburn.c
index 66a0d35..d74f360 100644
--- a/board/woodburn/woodburn.c
+++ b/board/woodburn/woodburn.c
@@ -133,8 +133,7 @@ int woodburn_init(void)
mxc_request_iomux(MX35_PIN_SCKR, MUX_CONFIG_ALT5);
gpio_direction_output(4, 1);
mxc_request_iomux(MX35_PIN_HCKT, MUX_CONFIG_ALT5);
-   gpio_direction_output(9, 0);
-   gpio_set_value(9, 1);
+   gpio_direction_output(9, 1);
 
return 0;
 }
-- 
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] woodburn: Set gpio value in gpio_direction_output()

2012-12-11 Thread Stefano Babic
On 11/12/2012 17:19, Fabio Estevam wrote:
> Set the gpio value in gpio_direction_output() instead of an extra 
> gpio_set_value
> call.
> 
> Signed-off-by: Fabio Estevam 
> ---
>  board/woodburn/woodburn.c |3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/board/woodburn/woodburn.c b/board/woodburn/woodburn.c
> index 66a0d35..d74f360 100644
> --- a/board/woodburn/woodburn.c
> +++ b/board/woodburn/woodburn.c
> @@ -133,8 +133,7 @@ int woodburn_init(void)
>   mxc_request_iomux(MX35_PIN_SCKR, MUX_CONFIG_ALT5);
>   gpio_direction_output(4, 1);
>   mxc_request_iomux(MX35_PIN_HCKT, MUX_CONFIG_ALT5);
> - gpio_direction_output(9, 0);
> - gpio_set_value(9, 1);
> + gpio_direction_output(9, 1);
>  
>   return 0;
>  }
> 

Thanks !

Acked-by: Stefano Babic 

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


Re: [U-Boot] [PATCH] woodburn: Set gpio value in gpio_direction_output()

2012-12-11 Thread Stefano Babic
On 11/12/2012 17:19, Fabio Estevam wrote:
> Set the gpio value in gpio_direction_output() instead of an extra 
> gpio_set_value
> call.
> 
> Signed-off-by: Fabio Estevam 
> ---
>  board/woodburn/woodburn.c |3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/board/woodburn/woodburn.c b/board/woodburn/woodburn.c
> index 66a0d35..d74f360 100644
> --- a/board/woodburn/woodburn.c
> +++ b/board/woodburn/woodburn.c
> @@ -133,8 +133,7 @@ int woodburn_init(void)
>   mxc_request_iomux(MX35_PIN_SCKR, MUX_CONFIG_ALT5);
>   gpio_direction_output(4, 1);
>   mxc_request_iomux(MX35_PIN_HCKT, MUX_CONFIG_ALT5);
> - gpio_direction_output(9, 0);
> - gpio_set_value(9, 1);
> + gpio_direction_output(9, 1);
>  
>   return 0;
>  }
> 
Applied to u-boot-imx, thanks.

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-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] mx25pdk: Adapt it for the new PMIC framework

2012-12-11 Thread Stefano Babic
On 11/12/2012 15:58, Fabio Estevam wrote:
> Make the necessary adaptions for the new PMIC framework, so that mx25pdk can
> be built again. 
> 
> Signed-off-by: Fabio Estevam 
> ---

Applied to u-boot-imx, thanks.

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-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 v3 6/6] mx25pdk: Add Ethernet support

2012-12-11 Thread Fabio Estevam
Albert,

On Sat, Dec 8, 2012 at 9:12 AM, Albert ARIBAUD
 wrote:

> This commit introduced a dependency on the PMIC framework, which has
> since been reworked in u-boot/master, leading to a failure to merge
> u-boot-arm/master and u-boot/master properly.

I have just sent a patch fixing it.

Regards,

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


Re: [U-Boot] [PATCH v4 0/20] Add environment call-back and flags capability

2012-12-11 Thread Tom Rini
On Tue, Dec 04, 2012 at 07:52:27PM -0600, Joe Hershberger wrote:
> 
> When a variable with a registered callback is inserted, deleted, or
> overwritten the callback is called and gives the system an opportunity
> to do something in response to the change.  It also has the opportunuty
> to reject the change by returning non-zero.
> 
> The flags on variables can control their type as well as their allowed
> access.
> 
> The format of the list is:
> type_attribute = [s|d|x|b|i|m]
> attributes = type_attribute
> entry = variable_name[:attributes]
> list = entry[,list]
> 
> The type attributes are:
> s - String (default)
> d - Decimal
> x - Hexadecimal
> b - Boolean ([1yYtT|0nNfF])
> i - IP address
> m - MAC address
> 
> The access attributes are:
> a - Any (default)
> r - Read-only
> o - Write-once
> c - Change-default
> 
> Changes in v4:
> - Prevent crash on relocation import
> - Fixed help text
> - Add help text for env flags command
> - Add force support to setenv
> - Implement delete

This should fix the problem Wolfgang saw, correct?  And aside from the
comment fix Graeme found, this is ready for merge?  Thanks!

-- 
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] [PATCH] mx53loco: Fix PMIC name

2012-12-11 Thread Fabio Estevam
commit c73368150 (pmic: Extend PMIC framework to support multiple instances 
of PMIC devices) has incorrectly passed the PMIC name under the FSL PMIC case.

Fix that by passing "FSL_PMIC" as the parameter of pmic_get.

Signed-off-by: Fabio Estevam 
---
 board/freescale/mx53loco/mx53loco.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/board/freescale/mx53loco/mx53loco.c 
b/board/freescale/mx53loco/mx53loco.c
index 81c511c..2c8cb7a 100644
--- a/board/freescale/mx53loco/mx53loco.c
+++ b/board/freescale/mx53loco/mx53loco.c
@@ -374,7 +374,7 @@ static int power_init(void)
if (retval)
return retval;
 
-   p = pmic_get("DIALOG_PMIC");
+   p = pmic_get("FSL_PMIC");
if (!p)
return -ENODEV;
 
-- 
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] m28evk/mx28evk: fix nand_update_full

2012-12-11 Thread Scott Wood

On 12/11/2012 02:50:37 AM, Eric Bénard wrote:

Hi Scott,

Le Mon, 10 Dec 2012 16:59:23 -0600,
Scott Wood  a écrit :

> On 12/10/2012 10:41:59 AM, Eric Bénard wrote:
> > - commit 418396e212b59bf907dbccad997ff50f7eb61b16 chenged the
> > behaviour
> > of nand write.raw which now takes a pagecount as a parameter and  
no

> > more
> > the size to be written so update the default environment of these
> > boards
> > to fix the problem.
>
> It never really took the size to be written -- the size was  
implicitly

> one page before.  It looks like there may have been a bug in the old
> code, where common code expected a size to be there anyway, even  
though

> it was ignored other than for error checking.
>
true, before the size was forced to one page :
rwsize = nand->writesize + nand->oobsize;
now it's rwsize = pagecount * (nand->writesize + nand->oobsize);
so the size parameter in this script was ignored and now leads to a
wrong rwsize calculation.

Do you want me to rephrase the commit log or will you take it as is ?


Please reword it.

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


Re: [U-Boot] please pull u-boot-samsung/resolve

2012-12-11 Thread Stephen Warren
On 12/11/2012 04:10 AM, Minkyu Kang wrote:
> Dear Albert,
> 
> The following changes since commit fd4d564b3c80b111f18c93adb14233a6a7ddb0e9:
> 
>   Merge branch 'master' of git://git.denx.de/u-boot-x86 (2012-12-07 08:47:59 
> -0700)
> 
> are available in the git repository at:
> 
> 
>   git://git.denx.de/u-boot-samsung resolve
> 
> for you to fetch changes up to fbef8e6e7f1233ed20f8c5045e12c9cf31b43540:
> 
>   universal_c210: check the NULL pointer when get the PMIC (2012-12-11 
> 17:37:28 +0900)

How come this includes a bunch of Tegra changes; did you just use the
wrong base commit when generating the commit list below?

> Simon Glass (17):

>   tegra: Use const for pinmux_config_pingroup/table()
>   tegra: Add display support to funcmux
>   tegra: fdt: Add pwm binding and node
>   tegra: fdt: Add LCD definitions for Tegra
>   tegra: Add support for PWM
>   tegra: Add LCD driver
>   tegra: Add LCD support to Nvidia boards
>   arm: Add control over cachability of memory regions
>   lcd: Add CONFIG_LCD_ALIGNMENT to select frame buffer alignment
>   lcd: Add support for flushing LCD fb from dcache after update
>   tegra: Align LCD frame buffer to section boundary
>   tegra: Support control of cache settings for LCD
>   tegra: fdt: Add LCD definitions for Seaboard
>   lcd: Add CONFIG_CONSOLE_SCROLL_LINES option to speed console
>   tegra: Remove unnecessary CONFIG_SYS_NAND_BASE
>   tegra: config: seaboard: Move tegra-common-post to correct place

> Stephen Warren (4):
>   ARM: tegra: TrimSlice: add support for USB1 port
>   mmc: tegra: support 4-bit operation too on 8-bit slots
>   ARM: tegra: enable 8-bit SD slots in board files
>   tegra: use generic fs commands in BOOTCOMMAND

> Wei Ni (1):
>   tegra: Add SOC support for display/lcd
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] [nand] Implement nand_extent_skip_bad

2012-12-11 Thread Scott Wood

On 12/11/2012 03:40:53 AM, Pantelis Antoniou wrote:

Hi Scott,

On Dec 11, 2012, at 12:53 AM, Scott Wood wrote:

>> +/**
>> + * nand_extent_skip_bad:
>> + *
>> + * Find the extent of a chunk, return the offset where it ends
>> + * Blocks that are marked bad are skipped and the next block is  
examined
>> + * instead as long as the extend is short enough to fit even  
after skipping the

>> + * bad blocks.
>> + *
>> + * @param nand NAND device
>> + * @param offset offset in flash
>> + * @param length extend length
>> + * @return next offset in case of success (loff_t)-1 on error
>> + */
>
> Would it be better to return this information from existing  
read/write functions -- either instead of or in addition to exporting  
this functionality?

>

Yes it would. However that would require modifying all callers, which  
would be a hard sell when there's only one user of it.


There aren't that many callers, and it's all common code (so no issue  
with testing on obscure hardware).



> This seems duplicative of check_skip_len().
>

It is. check_skip_len doesn't return the information I need. I could  
modify check_skip_len with

an extra parameter if that's going to be OK with you.


Yes, please modify check_skip_len() instead.

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


Re: [U-Boot] [PATCH] [nand] Implement nand_extent_skip_bad

2012-12-11 Thread Pantelis Antoniou
Hi Scott,

On Dec 11, 2012, at 7:13 PM, Scott Wood wrote:

> On 12/11/2012 03:40:53 AM, Pantelis Antoniou wrote:
>> Hi Scott,
>> On Dec 11, 2012, at 12:53 AM, Scott Wood wrote:
>> >> +/**
>> >> + * nand_extent_skip_bad:
>> >> + *
>> >> + * Find the extent of a chunk, return the offset where it ends
>> >> + * Blocks that are marked bad are skipped and the next block is examined
>> >> + * instead as long as the extend is short enough to fit even after 
>> >> skipping the
>> >> + * bad blocks.
>> >> + *
>> >> + * @param nand NAND device
>> >> + * @param offset offset in flash
>> >> + * @param length extend length
>> >> + * @return next offset in case of success (loff_t)-1 on error
>> >> + */
>> >
>> > Would it be better to return this information from existing read/write 
>> > functions -- either instead of or in addition to exporting this 
>> > functionality?
>> >
>> Yes it would. However that would require modifying all callers, which would 
>> be a hard sell when there's only one user of it.
> 
> There aren't that many callers, and it's all common code (so no issue with 
> testing on obscure hardware).
> 
>> > This seems duplicative of check_skip_len().
>> >
>> It is. check_skip_len doesn't return the information I need. I could modify 
>> check_skip_len with
>> an extra parameter if that's going to be OK with you.
> 
> Yes, please modify check_skip_len() instead.
> 
> -Scott

Nice, hope I'll get around doing it today or tomorrow.

Regards

-- Pantelis


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


[U-Boot] NFS time out problem

2012-12-11 Thread Matthias Brugger
After reading through the RFC [1] I realized that we have to 
increment the rpc_id when we resend a message. This patch
therefor doesn't change the rpc_id behaviour, but adds a dynamic
increment of the "time to wait before time out".
Apart we just drop messages which are replies to timed out requests.

Any comments are welcome.

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


[U-Boot] [PATCH] net: nfs: add dynamic wait period

2012-12-11 Thread Matthias Brugger
This patch tackles the time out problem which leads to break the
boot process, when loading file over nfs. The patch does two things.

First of all, we just ignore messages that arrive with a rpc_id smaller
then the client id. We just interpret this messages as answers to
formaly timed out messages.

Second, when a time out occurs we double the time to wait, so that we
do not stress the server resending the last message.

Signed-off-by: Matthias Brugger 
---
 net/nfs.c |   73 +++--
 1 file changed, 52 insertions(+), 21 deletions(-)

diff --git a/net/nfs.c b/net/nfs.c
index 7f2393f..84aeda1 100644
--- a/net/nfs.c
+++ b/net/nfs.c
@@ -37,10 +37,14 @@
 # define NFS_TIMEOUT CONFIG_NFS_TIMEOUT
 #endif
 
+#define NFS_RPC_ERR1
+#define NFS_RPC_DROP   124
+
 static int fs_mounted;
 static unsigned long rpc_id;
 static int nfs_offset = -1;
 static int nfs_len;
+static ulong nfs_timeout = NFS_TIMEOUT;
 
 static char dirfh[NFS_FHSIZE]; /* file handle of directory */
 static char filefh[NFS_FHSIZE]; /* file handle of kernel image */
@@ -399,8 +403,10 @@ rpc_lookup_reply(int prog, uchar *pkt, unsigned len)
 
debug("%s\n", __func__);
 
-   if (ntohl(rpc_pkt.u.reply.id) != rpc_id)
-   return -1;
+   if (ntohl(rpc_pkt.u.reply.id) > rpc_id)
+   return -NFS_RPC_ERR;
+   else if (ntohl(rpc_pkt.u.reply.id) < rpc_id)
+   return -NFS_RPC_DROP;
 
if (rpc_pkt.u.reply.rstatus  ||
rpc_pkt.u.reply.verifier ||
@@ -428,8 +434,10 @@ nfs_mount_reply(uchar *pkt, unsigned len)
 
memcpy((unsigned char *)&rpc_pkt, pkt, len);
 
-   if (ntohl(rpc_pkt.u.reply.id) != rpc_id)
-   return -1;
+   if (ntohl(rpc_pkt.u.reply.id) > rpc_id)
+   return -NFS_RPC_ERR;
+   else if (ntohl(rpc_pkt.u.reply.id) < rpc_id)
+   return -NFS_RPC_DROP;
 
if (rpc_pkt.u.reply.rstatus  ||
rpc_pkt.u.reply.verifier ||
@@ -452,8 +460,10 @@ nfs_umountall_reply(uchar *pkt, unsigned len)
 
memcpy((unsigned char *)&rpc_pkt, pkt, len);
 
-   if (ntohl(rpc_pkt.u.reply.id) != rpc_id)
-   return -1;
+   if (ntohl(rpc_pkt.u.reply.id) > rpc_id)
+   return -NFS_RPC_ERR;
+   else if (ntohl(rpc_pkt.u.reply.id) < rpc_id)
+   return -NFS_RPC_DROP;
 
if (rpc_pkt.u.reply.rstatus  ||
rpc_pkt.u.reply.verifier ||
@@ -475,8 +485,10 @@ nfs_lookup_reply(uchar *pkt, unsigned len)
 
memcpy((unsigned char *)&rpc_pkt, pkt, len);
 
-   if (ntohl(rpc_pkt.u.reply.id) != rpc_id)
-   return -1;
+   if (ntohl(rpc_pkt.u.reply.id) > rpc_id)
+   return -NFS_RPC_ERR;
+   else if (ntohl(rpc_pkt.u.reply.id) < rpc_id)
+   return -NFS_RPC_DROP;
 
if (rpc_pkt.u.reply.rstatus  ||
rpc_pkt.u.reply.verifier ||
@@ -499,8 +511,10 @@ nfs_readlink_reply(uchar *pkt, unsigned len)
 
memcpy((unsigned char *)&rpc_pkt, pkt, len);
 
-   if (ntohl(rpc_pkt.u.reply.id) != rpc_id)
-   return -1;
+   if (ntohl(rpc_pkt.u.reply.id) > rpc_id)
+   return -NFS_RPC_ERR;
+   else if (ntohl(rpc_pkt.u.reply.id) < rpc_id)
+   return -NFS_RPC_DROP;
 
if (rpc_pkt.u.reply.rstatus  ||
rpc_pkt.u.reply.verifier ||
@@ -534,8 +548,10 @@ nfs_read_reply(uchar *pkt, unsigned len)
 
memcpy((uchar *)&rpc_pkt, pkt, sizeof(rpc_pkt.u.reply));
 
-   if (ntohl(rpc_pkt.u.reply.id) != rpc_id)
-   return -1;
+   if (ntohl(rpc_pkt.u.reply.id) > rpc_id)
+   return -NFS_RPC_ERR;
+   else if (ntohl(rpc_pkt.u.reply.id) < rpc_id)
+   return -NFS_RPC_DROP;
 
if (rpc_pkt.u.reply.rstatus  ||
rpc_pkt.u.reply.verifier ||
@@ -574,7 +590,7 @@ NfsTimeout(void)
NetStartAgain();
} else {
puts("T ");
-   NetSetTimeout(NFS_TIMEOUT, NfsTimeout);
+   NetSetTimeout(nfs_timeout + NFS_TIMEOUT * NfsTimeoutCount, 
NfsTimeout);
NfsSend();
}
 }
@@ -583,6 +599,7 @@ static void
 NfsHandler(uchar *pkt, unsigned dest, IPaddr_t sip, unsigned src, unsigned len)
 {
int rlen;
+   int reply;
 
debug("%s\n", __func__);
 
@@ -591,19 +608,24 @@ NfsHandler(uchar *pkt, unsigned dest, IPaddr_t sip, 
unsigned src, unsigned len)
 
switch (NfsState) {
case STATE_PRCLOOKUP_PROG_MOUNT_REQ:
-   rpc_lookup_reply(PROG_MOUNT, pkt, len);
+   if (rpc_lookup_reply(PROG_MOUNT, pkt, len) == -NFS_RPC_DROP)
+   break;
NfsState = STATE_PRCLOOKUP_PROG_NFS_REQ;
NfsSend();
break;
 
case STATE_PRCLOOKUP_PROG_NFS_REQ:
-   rpc_lookup_reply(PROG_NFS, pkt, len);
+   if (rpc_lookup_reply(PROG_NFS, pkt, len) == -NFS_RPC_DROP)
+   break;
NfsState 

[U-Boot] [PATCH] env: Fixup typos in callback

2012-12-11 Thread Joe Hershberger
Use the same command guard on the help and make the help accurate.
Fix spelling in header.

Signed-off-by: Joe Hershberger 
---
 common/cmd_nvedit.c| 6 +++---
 include/env_callback.h | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c
index 3bfaa46..92d2048 100644
--- a/common/cmd_nvedit.c
+++ b/common/cmd_nvedit.c
@@ -1024,7 +1024,7 @@ static cmd_tbl_t cmd_env_sub[] = {
U_BOOT_CMD_MKENT(edit, 2, 0, do_env_edit, "", ""),
 #endif
 #if defined(CONFIG_CMD_ENV_CALLBACK)
-   U_BOOT_CMD_MKENT(callback, 1, 0, do_env_callback, "", ""),
+   U_BOOT_CMD_MKENT(callbacks, 1, 0, do_env_callback, "", ""),
 #endif
 #if defined(CONFIG_CMD_ENV_FLAGS)
U_BOOT_CMD_MKENT(flags, 1, 0, do_env_flags, "", ""),
@@ -1079,8 +1079,8 @@ static char env_help_text[] =
 #if defined(CONFIG_CMD_ASKENV)
"ask name [message] [size] - ask for environment variable\nenv "
 #endif
-#if defined(CONFIG_CMD_CALLBACKENV)
-   "callback [name] - print callbacks and their associated variables\nenv "
+#if defined(CONFIG_CMD_ENV_CALLBACK)
+   "callbacks - print callbacks and their associated variables\nenv "
 #endif
"default [-f] -a - [forcibly] reset default environment\n"
"env default [-f] var [...] - [forcibly] reset variable(s) to their 
default values\n"
diff --git a/include/env_callback.h b/include/env_callback.h
index 1d8bb0e..47fdc6f 100644
--- a/include/env_callback.h
+++ b/include/env_callback.h
@@ -43,7 +43,7 @@
 
 /*
  * This list of callback bindings is static, but may be overridden by defining
- * a new assogiation in the ".callbacks" environment variable.
+ * a new association in the ".callbacks" environment variable.
  */
 #define ENV_CALLBACK_LIST_STATIC ENV_CALLBACK_VAR ":callbacks," \
ENV_FLAGS_VAR ":flags," \
-- 
1.7.11.5

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


Re: [U-Boot] Conflicting commits for seaboard USB keyboard handling

2012-12-11 Thread Allen Martin
On Mon, Dec 10, 2012 at 01:51:40PM -0800, Tom Warren wrote:
> Albert,
> 
> > On Sat, Dec 8, 2012 at 11:03 PM, Albert ARIBAUD
> >  wrote:
> >> Hello,
> >>
> >> It seems like two commits 5ddcc38b (in u-boot, committed by Marek)
> >> 29f3e3f2 (in u-boot-arm, committed by Tom from u-boot-tegra) are
> >> conflicting on the seaboard configuration header file for USB (and
> >> possibly other areas).
> 
> One possible problem is that I've got new commits ready in
> u-boot-tegra/next that were almost ready for a pull request, so I
> copied them over to my tegra/master branch and pushed to
> u-boot-tegra/master on denx.  I assumed that once I got the 'applied
> to u-boot-arm/master' response from you, that I could stage the next
> pull request.  But if you (or Allen) are pulling from
> u-boot-tegra/master )or /next), you're gonna get commits that haven't
> been merged into u-boot-arm/master.
> 
> I can push the older tegra/master branch back to denx.de (the one that
> I requested a pull from on Nov 19th) if that'll help.  But I'm not
> sure how it would help, since all those commits should have been
> present in u-boot-arm/master (from my pull request) when you went to
> merge w/u-boot/master.
> 
> So I'm still not seeing how the conflict arose, or what the path is to
> fixing it.
> 

The conflict came from my config file changes for tegra USB keyboard
which went up to u-boot/master through Marek's tree becasue they
depend on my USB DMA alignment fix which was not a tegra change.
There are subsequent changes in both the tegra and arm trees that were
not based on that change, so they now conflict when attempting to
merge back into u-boot/master.

It's trivial for me to resolve the conflict since I have context on
the changes.  I see that there are other merge conflicts between
u-boot/master and u-boot-arm/master though, so I'm not sure how to
proceed.  Albert do you just want me to post merged versions of the
two files that conflict, so you know how to resolve the conflict
during your merge?

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


[U-Boot] Pull request: u-boot-net.git master

2012-12-11 Thread Joe Hershberger
The following changes since commit ea40a05422bdc87a7af5dc349e8adce59f982e72:

  MIPS: constify address pointer in test_bit() (2012-12-08 21:48:19 +0100)

are available in the git repository at:

  git://git.denx.de/u-boot-net.git master

for you to fetch changes up to 7680b9a758b257ea272c83518d9c76c3ef0a59b8:

  net: usb: smsc95xx: Pull out init of struct eth_ops (2012-12-10
14:28:03 -0600)


Joe Hershberger (1):
  net: Fix endianness bug in link-local

Michal Simek (1):
  phy: Add support for Marvell 88E1118R

Ruchika Gupta (1):
  e1000e : Correct Rx Threshold granularity

Simon Glass (1):
  net: Add tftp speed indication

Tomas Hlavacek (67):
  net: dm: Pull out ops from struct eth_device
  net: 4xx_enet: Pull out init of struct eth_ops
  net: altera_tse: Pull out init of struct eth_ops
  net: dm9000x: Pull out init of struct eth_ops
  net: armada100_fec: Pull out init of struct eth_ops
  net: at91_emac: Pull out init of struct eth_ops
  net: ax88180: Pull out init of struct eth_ops
  net: bfin_mac: Pull out init of struct eth_ops
  net: calxedaxgmac: Pull out init of struct eth_ops
  net: cs8900: Pull out init of struct eth_ops
  net: davinci_emac: Pull out init of struct eth_ops
  net: dc2114x: Pull out init of struct eth_ops
  net: designware: Pull out init of struct eth_ops
  net: dnet: Pull out init of struct eth_ops
  net: e1000: Pull out init of struct eth_ops
  net: eepro100: Pull out init of struct eth_ops
  net: enc28j60: Pull out init of struct eth_ops
  net: ep93xx_eth: Pull out init of struct eth_ops
  net: ethoc: Pull out init of struct eth_ops
  net: fec_mxc: Pull out init of struct eth_ops
  net: ftgmac100: Pull out init of struct eth_ops
  net: greth.c: Pull out init of struct eth_ops
  net: fsl_mcdmafec: Pull out init of struct eth_ops
  net: inca-ip_sw: Pull out init of struct eth_ops
  net: ks8695eth: Pull out init of struct eth_ops
  net: lan91c96: Pull out init of struct eth_ops
  net: macb: Pull out init of struct eth_ops
  net: mcffec: Pull out init of struct eth_ops
  net: mpc5xxx_fec: Pull out init of struct eth_ops
  net: mvgbe: Pull out init of struct eth_ops
  net: mpc512x_fec: Pull out init of struct eth_ops
  net: natsemi: Pull out init of struct eth_ops
  net: ne2000: Pull out init of struct eth_ops
  net: npe: Pull out init of struct eth_ops
  net: ns8382x: Pull out init of struct eth_ops
  net: pcnet: Pull out init of struct eth_ops
  net: plb2800_eth: Pull out init of struct eth_ops
  net: rtl8139: Pull out init of struct eth_ops
  net: rtl8169: Pull out init of struct eth_ops
  net: smc9: Pull out init of struct eth_ops
  net: smc911x: Pull out init of struct eth_ops
  net: tsec: Pull out init of struct eth_ops
  net: tsi108_eth: Pull out init of struct eth_ops
  net: uli526x: Pull out init of struct eth_ops
  net: xilinx_axi_emac: Pull out init of struct eth_ops
  net: xilinx_emaclite: Pull out init of struct eth_ops
  net: zynq_gem: Pull out init of struct eth_ops
  net: xilinx_ll_temac: Pull out init of struct eth_ops
  net: sh_eth: Pull out init of struct eth_ops
  net: au1x00_eth: Pull out init of struct eth_ops
  net: mpc8220_fec: Pull out init of struct eth_ops
  net: mpc8260_fec: Pull out init of struct eth_ops
  net: mpc8260_scc: Pull out init of struct eth_ops
  net: mpc85xx_fec: Pull out init of struct eth_ops
  net: mpc8xx_scc: Pull out init of struct eth_ops
  net: db64360/mv_eth: Pull out init of struct eth_ops
  net: mpc8xx_fec: Pull out init of struct eth_ops
  net: db64460/mv_eth: Pull out init of struct eth_ops
  net: cpci750/mv_eth: Pull out init of struct eth_ops
  net: evb64260: Pull out init of struct eth_ops
  net: p3mx/mv_eth: Pull out init of struct eth_ops
  net: cpsw: Pull out init of struct eth_ops
  net: fm_eth: Pull out init of struct eth_ops
  net: ftmac100: Pull out init of struct eth_ops
  net: qe: uec: Pull out init of struct eth_ops
  net: usb: asix: Pull out init of struct eth_ops
  net: usb: smsc95xx: Pull out init of struct eth_ops

trem (1):
  powerpc: remove not used CONFIG_SYS_TFTP_LOADADDR

 README   |  3 ---
 arch/mips/cpu/mips32/au1x00/au1x00_eth.c | 14 +-
 arch/powerpc/cpu/mpc8220/fec.c   | 11 +++
 arch/powerpc/cpu/mpc8260/ether_fcc.c | 14 +-
 arch/powerpc/cpu/mpc8260/ether_scc.c | 12 
 arch/powerpc/cpu/mpc85xx/ether_fcc.c | 14 +-
 arch/powerpc/cpu/mpc8xx/fec.c| 12 
 arch/powerpc/cpu/mpc8xx/scc.c| 12 
 board/Marvell/db64360/mv_eth.c   | 12 
 board/Marvell/db64460/mv_eth.c   | 12 
 bo

[U-Boot] [PATCH v2] m28evk/mx28evk: fix nand_update_full

2012-12-11 Thread Eric Bénard
- since commit 418396e212b59bf907dbccad997ff50f7eb61b16 nand write.raw
can take the number of page to be written as an argument. nand_update_full
is passing the size (in bytes) to nand write.raw. This value was previously
ignored but now breaks the write.
- this patch updates the default environment of these boards to provide a
pagecount instead of a size to nand write.raw.
- tested on a mx28evk with a 4k page NAND and on a custom board with a
2k page NAND.

Signed-off-by: Eric Bénard 
Cc: Marek Vasut 
Cc: Fabio Estevam 
---
 include/configs/m28evk.h  |2 +-
 include/configs/mx28evk.h |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/configs/m28evk.h b/include/configs/m28evk.h
index b49ec8c..3f37e84 100644
--- a/include/configs/m28evk.h
+++ b/include/configs/m28evk.h
@@ -297,7 +297,7 @@
"if tftp ${update_nand_full_filename} ; then "  \
"run update_nand_get_fcb_size ; "   \
"nand scrub -y 0x0 ${filesize} ; "  \
-   "nand write.raw ${loadaddr} 0x0 ${update_nand_fcb} ; "  \
+   "nand write.raw ${loadaddr} 0x0 ${fcb_sz} ; "   \
"setexpr update_off ${loadaddr} + ${update_nand_fcb} ; " \
"setexpr update_sz ${filesize} - ${update_nand_fcb} ; " \
"nand write ${update_off} ${update_nand_fcb} ${update_sz} ; " \
diff --git a/include/configs/mx28evk.h b/include/configs/mx28evk.h
index 0511cd1..d474a92 100644
--- a/include/configs/mx28evk.h
+++ b/include/configs/mx28evk.h
@@ -264,7 +264,7 @@
"if tftp ${update_nand_full_filename} ; then " \
"run update_nand_get_fcb_size ; " \
"nand scrub -y 0x0 ${filesize} ; " \
-   "nand write.raw ${loadaddr} 0x0 ${update_nand_fcb} ; " \
+   "nand write.raw ${loadaddr} 0x0 ${fcb_sz} ; " \
"setexpr update_off ${loadaddr} + ${update_nand_fcb} ; " \
"setexpr update_sz ${filesize} - ${update_nand_fcb} ; " \
"nand write ${update_off} ${update_nand_fcb} ${update_sz} ; " \
-- 
1.7.7.6

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


[U-Boot] [PATCH] mx25pdk: Allow booting a device tree kernel

2012-12-11 Thread Fabio Estevam
From: Fabio Estevam 

Select CONFIG_OF_LIBFDT so that a device tree kernel can be launched.

Signed-off-by: Fabio Estevam 
---
 include/configs/mx25pdk.h |1 +
 1 file changed, 1 insertion(+)

diff --git a/include/configs/mx25pdk.h b/include/configs/mx25pdk.h
index bbb3161..c10e78b 100644
--- a/include/configs/mx25pdk.h
+++ b/include/configs/mx25pdk.h
@@ -87,6 +87,7 @@
 
 /* U-Boot commands */
 #include 
+#define CONFIG_OF_LIBFDT
 #define CONFIG_CMD_BOOTZ
 #define CONFIG_CMD_CACHE
 #define CONFIG_CMD_MMC
-- 
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] [DFU] Implement NAND dfu support

2012-12-11 Thread Scott Wood

On 12/11/2012 01:56:25 AM, Lukasz Majewski wrote:

Hi Scott,

> On 12/10/2012 09:24:32 AM, Pantelis Antoniou wrote:
> > + sprintf(cmd_buf, "nand %s %p %llx %llx",
> > + op == DFU_OP_READ ? "read" : "write",
> > +  buf, start, count);
> > +
> > + debug("%s: %s 0x%p\n", __func__, cmd_buf, cmd_buf);
> > + ret = run_command(cmd_buf, 0);
>
> Why not use the C interface to NAND?

We also support there eMMC (both with raw and file systems). Moreover
we had this discussion some time ago (if we shall use "command" or
native C API).


I don't see how "nand %s %p %llx %llx" supports anything that the NAND  
C API doesn't support.


I can't follow every discussion that happens on this list, on the off  
chance it might eventually become relevant to NAND.  "Some time ago" is  
not an easily followed reference to the archives.


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


Re: [U-Boot] [PATCH] [DFU] Implement NAND dfu support

2012-12-11 Thread Scott Wood

On 12/10/2012 07:16:50 PM, Tom Rini wrote:

On Mon, Dec 10, 2012 at 07:09:55PM -0600, Scott Wood wrote:
> On 12/10/2012 09:24:32 AM, Pantelis Antoniou wrote:
> >+  sprintf(cmd_buf, "nand %s %p %llx %llx",
> >+  op == DFU_OP_READ ? "read" : "write",
> >+   buf, start, count);
> >+
> >+  debug("%s: %s 0x%p\n", __func__, cmd_buf, cmd_buf);
> >+  ret = run_command(cmd_buf, 0);
>
> Why not use the C interface to NAND?
>
> >+  /* find out how much actual bytes have been written */
> >+  /* the difference is the amount of skip we must add from now on
> >*/
> >+  actual = nand_extent_skip_bad(&nand_info[dev], start, count);
>
> ...especially since you already need to interact with it here?

I've been talking with Pantelis about this as well and in short, this
series adds NAND support ala MMC (which is to say, (ab)using the  
command
interface).  I think he was thinking we need a bit more generic help  
to

avoid having to duplicate the code the command interface also uses
(state, sanity checking), iirc.


Some elaboration on what exactly he's relying on from the command line  
interface would be nice.


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


[U-Boot] patchwork delegation

2012-12-11 Thread Scott Wood
Is there any way to find out who delegated a patch to me, or get a
history of patchwork actions in general?

People have been delegating patches to me that are not NAND-related, such
as the series beginning with http://patchwork.ozlabs.org/patch/204177/

I am the NAND custodian (i.e. drivers/nand, not anything that might have
a NAND chip buried inside somewhere behind a different interface), not
the mtd custodian.  I don't know anything about "st_smi".  To whom should
I redelegate these?

-Scott

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


Re: [U-Boot] [PATCH] [DFU] Implement NAND dfu support

2012-12-11 Thread Tom Rini
On Tue, Dec 11, 2012 at 04:24:37PM -0600, Scott Wood wrote:
> On 12/10/2012 07:16:50 PM, Tom Rini wrote:
> >On Mon, Dec 10, 2012 at 07:09:55PM -0600, Scott Wood wrote:
> >> On 12/10/2012 09:24:32 AM, Pantelis Antoniou wrote:
> >> >+ sprintf(cmd_buf, "nand %s %p %llx %llx",
> >> >+ op == DFU_OP_READ ? "read" : "write",
> >> >+  buf, start, count);
> >> >+
> >> >+ debug("%s: %s 0x%p\n", __func__, cmd_buf, cmd_buf);
> >> >+ ret = run_command(cmd_buf, 0);
> >>
> >> Why not use the C interface to NAND?
> >>
> >> >+ /* find out how much actual bytes have been written */
> >> >+ /* the difference is the amount of skip we must add from now on
> >> >*/
> >> >+ actual = nand_extent_skip_bad(&nand_info[dev], start, count);
> >>
> >> ...especially since you already need to interact with it here?
> >
> >I've been talking with Pantelis about this as well and in short, this
> >series adds NAND support ala MMC (which is to say, (ab)using the
> >command
> >interface).  I think he was thinking we need a bit more generic
> >help to
> >avoid having to duplicate the code the command interface also uses
> >(state, sanity checking), iirc.
> 
> Some elaboration on what exactly he's relying on from the command
> line interface would be nice.

My gmane-fu is failing me, but the actual 4/7 parts of
http://search.gmane.org/?query=dfu+mmc+%224%2F7%22&author=&group=gmane.comp.boot-loaders.u-boot&sort=revdate&DEFAULTOP=and&%3E=Next&xP=Zdfu%09Zmmc%094%097&xFILTERS=Gcomp.boot-loaders.u-boot---A
show the discussion.  In short, for MMC writing it's more complex
because we have a number of layouts we need to deal with (raw, FAT,
other), but yes, we should in the end migrate things to using the API
rather than abusing the command infrastructure.

-- 
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] patchwork delegation

2012-12-11 Thread Tom Rini
On Tue, Dec 11, 2012 at 04:34:23PM -0600, Scott Wood wrote:

> Is there any way to find out who delegated a patch to me, or get a
> history of patchwork actions in general?

Not that I know of, but in general, yell at me, I probably did it.

> People have been delegating patches to me that are not NAND-related, such
> as the series beginning with http://patchwork.ozlabs.org/patch/204177/
> 
> 
> I am the NAND custodian (i.e. drivers/nand, not anything that might have
> a NAND chip buried inside somewhere behind a different interface), not
> the mtd custodian.  I don't know anything about "st_smi".  To whom should
> I redelegate these?

Right, sorry.  I'd try Stefan Roese next instead.

-- 
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 2/4] env_nand.c: support falling back to redundant env when writing

2012-12-11 Thread Scott Wood

On 12/10/2012 07:41:43 AM, Phil Sutter wrote:

On Fri, Dec 07, 2012 at 11:38:11AM -0600, Scott Wood wrote:
> On 12/07/2012 10:58:53 AM, Phil Sutter wrote:
> > Hmm. Does not look like CONFIG_ENV_OFFSET_OOB is used to select  
the

> > block(s) within the erase page to save the environment. Looking at
> > common/env_nand.c:318, the environment offset saved in the OOB  
seems

> > to
> > be in erase page unit.
>
> I'm not sure what you mean by "block(s) within the erase page" --
> blocks are the unit of erasing, and of bad block marking.

Not always, at least not with NAND flash. Erase pages are mostly  
bigger

than write pages (or "blocks"). In my case, flash consists of 0x800
bytes write pages and 0x2000 bytes erase pages.


Erase blocks are larger than write pages, yes.  I've never heard erase  
blocks called "pages" or write pages called "blocks" -- but my main  
point is that the unit of erasing and the unit of badness are the same.


> The block to hold the environment is stored in the OOB of block  
zero,

> which is usually guaranteed to not be bad.

Erase or write block? Note that every write block has it's own OOB.


"block" means "erase block".

Every write page has its own OOB, but it is erase blocks that are  
marked bad.  Typically the block can be marked bad in either the first  
or the second page of the erase block.



> > On the other hand, I could not find code that alters this setting
> > based
> > on bad blocks found or whatever. This seems to simply be an
> > alternative
> > to setting CONFIG_ENV_OFFSET at build-time.
>
> It is set by the "nand env.oob" command.  It is currently a manual
> process (or rather, automation is left to the user's board  
preparation
> process rather than being built into U-Boot), as U-Boot wouldn't  
know

> how to give back unused blocks to other purposes.

So that assumes that any block initially identified 'good' will ever
turn 'bad' later on?


We don't currently have any mechanism for that to happen with the  
environment -- which could be another good reason to have real  
redundancy that doesn't get crippled from day one by having one copy  
land on a factory bad block.  Of course, that requires someone to  
implement support for redundant environment combined with  
CONFIG_ENV_OFFSET_OOB.


Maybe a better option is to implement support for storing the  
environment in ubi, although usually if your environment is in NAND  
that means your U-Boot image is in NAND, so you have the same problem  
there.  Maybe you could have an SPL that contains ubi support, that  
fits in the guaranteed-good first block.


Do you have any data on how often a block might go bad that wasn't  
factory-bad, to what extent reads versus writes matter, and whether  
there is anything special about block zero beyond not being factory-bad?


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


Re: [U-Boot] [PATCH] mtd: nand: mxs: reset BCH earlier, too, to avoid NAND startup problems

2012-12-11 Thread Scott Wood

On 12/05/2012 02:48:47 PM, Wolfram Sang wrote:
It could happen (1 out of 100 times) that NAND did not start up  
correctly after
warm rebooting, so we end up with various failures or DMA timed out  
due to a
stalled BCH. When resetting BCH together with GPMI, the issue could  
not be
observed anymore (after 1+ reboots). We probably need the  
consistent state
already before sending commands to NAND. This behaviour was observed  
in barebox
and kernel, so I assume it affects U-Boot as well. I chose to keep  
the extra

reset for BCH when changing the flash layout to be on the safe side.

Signed-off-by: Wolfram Sang 
---


Applied to u-boot-nand-flash

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


Re: [U-Boot] [PATCH v2] m28evk/mx28evk: fix nand_update_full

2012-12-11 Thread Scott Wood

On 12/11/2012 03:36:21 PM, Eric Bénard wrote:

- since commit 418396e212b59bf907dbccad997ff50f7eb61b16 nand write.raw
can take the number of page to be written as an argument.  
nand_update_full
is passing the size (in bytes) to nand write.raw. This value was  
previously

ignored but now breaks the write.
- this patch updates the default environment of these boards to  
provide a

pagecount instead of a size to nand write.raw.
- tested on a mx28evk with a 4k page NAND and on a custom board with a
2k page NAND.

Signed-off-by: Eric Bénard 
Cc: Marek Vasut 
Cc: Fabio Estevam 
---
 include/configs/m28evk.h  |2 +-
 include/configs/mx28evk.h |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)


Marek, can you ack this?

There is still a change in behavior in that before  
418396e212b59bf907dbccad997ff50f7eb61b16 it only wrote one page (since  
that's all the write.raw command ever did) but with this patch it will  
write ${fcb_sz} pages.  I assume the new behavior is correct?


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


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

2012-12-11 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.
V3: Use 408MHz PLLP, remove unneeded #defines, shrink DT files further

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  |  335 +++
 arch/arm/cpu/arm720t/tegra-common/cpu.h  |   68 +-
 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   |   14 +-
 arch/arm/cpu/tegra-common/board.c|   41 +-
 arch/arm/cpu/tegra-common/sys_info.c |   16 +-
 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|5 +
 arch/arm/include/asm/arch-tegra/ap.h |   52 +-
 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  |   12 +-
 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   |  329 +++
 board/nvidia/common/board.c  |   17 +-
 board/nvidia/dts/tegra30-cardhu.dts  |   14 +
 boards.cfg   |1 +
 include/configs/cardhu.h |   45 +
 include/configs/tegra-common-post.h  |   27 -
 .../configs/{tegra20-common.h => tegra-common.h} |   59 +-
 include/configs/tegra20-common.h |  199 ++---
 include/configs/tegra30-common.h |   86 ++
 include/serial.h |2 +-
 spl/Makefile |2 +-
 54 files changed, 5011 insertions(+), 534 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.

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

2012-12-11 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 
---
V2:
* Move common CPU init code to tegra-common/cpu.c
V3:
* Use 408MHz for PLLP.
* Cleanup whitespace

 arch/arm/cpu/arm720t/tegra-common/Makefile |1 +
 arch/arm/cpu/arm720t/tegra-common/cpu.c|  335 
 arch/arm/cpu/arm720t/tegra-common/cpu.h|   68 ++
 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, 612 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..693d584
--- /dev/null
+++ b/arch/arm/cpu/arm720t/tegra-common/cpu.c
@@ -0,0 +1,335 @@
+/*
+ * 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 .
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#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: 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) | PLLP_OUT4_OVR
+   | (IN_408_OUT_102_DIVISOR << PLLP_OUT3_RATIO) | PLLP_OUT3_OVR;
+   writel(reg, &pll->pll_out[1]);
+}
+
+int pllx_set_rate(struct clk_pll_simple *pll , u32 divn, u32 divm,
+   u32 divp, u32 cpcon)
+{
+   u32 reg;

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

2012-12-11 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 
---
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.
V3:
* Use 408MHz for PLLP.

 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  |   12 +-
 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, 1775 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_cmpl

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

2012-12-11 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 
---
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.
V3:
* Always program PLLP to 408MHz
* Use generic SoC string in print_cpuinfo

 arch/arm/cpu/tegra-common/ap.c |   14 +-
 arch/arm/cpu/tegra-common/board.c  |   41 ++-
 arch/arm/cpu/tegra-common/sys_info.c   |   16 +-
 arch/arm/cpu/tegra20-common/warmboot.c |2 +-
 .../{arm720t/tegra30 => tegra30-common}/Makefile   |   11 +-
 .../cpu/{tegra20-common => tegra30-common}/clock.c |  516 +---
 arch/arm/cpu/tegra30-common/funcmux.c  |   57 +++
 arch/arm/cpu/tegra30-common/pinmux.c   |  506 +++
 arch/arm/include/asm/arch-tegra/ap.h   |   52 +--
 9 files changed, 880 insertions(+), 335 deletions(-)
 copy arch/arm/cpu/{arm720t/tegra30 => tegra30-common}/Makefile (80%)
 copy arch/arm/cpu/{tegra20-common => tegra30-common}/clock.c (74%)
 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..aebe29e 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 
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -58,6 +62,12 @@ int tegra_get_chip_type(void)
return TEGRA_SOC_T25;
}
break;
+   case CHIPID_TEGRA30:
+   switch (tegra_sku_id) {
+   case SKU_ID_T30:
+   return TEGRA_SOC_T30;
+   }
+   break;
}
/* unknown sku id */
return TEGRA_SOC_UNKNOWN;
@@ -93,7 +103,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 +137,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 defined(CONFIG_TEGRA_UARTA_SDIO1)
FUNCMUX_UART1_SDIO1,
-#else
+ #else
FUNCMUX_UART1_IRRX_IRTX,
-#endif
+ #endif
FUNCMUX_UART2_IRDA,
-1,
FUNCMUX_UART4_GMC,
-1,
+#else  /* Tegra30 */
+   FUNCMUX_UART1_ULPI, /* UARTA */
+   -1,
+   -1,
+   -1,
+   -1,
+#endif
 };
 
 /**
diff --git a/arch/arm/cpu/tegra-common/sys_info.c 
b/arch/arm/cpu/tegra-common/sys_info.c
index 1a0bb56..4632f15 100644
--- a/arch/arm/cpu/tegra-common/sys_info.c
+++ b/arch/arm/cpu/tegra-com

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

2012-12-11 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 
---
V2: Reduce to the minimum needed to build/boot to cmd prompt
V3: Remove model= from .dtsi, fix memory length in .dts

 arch/arm/dts/tegra30.dtsi   |5 +
 board/nvidia/dts/tegra30-cardhu.dts |   14 ++
 2 files changed, 19 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..f568d44
--- /dev/null
+++ b/arch/arm/dts/tegra30.dtsi
@@ -0,0 +1,5 @@
+/include/ "skeleton.dtsi"
+
+/ {
+   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..3012534
--- /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 0x4000>;
+   };
+};
-- 
1.7.0.4

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


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

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

Signed-off-by: Tom Warren 
---
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
V3:
* No changes

 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 
 #include 
 #include 
+#ifdef CONFIG_LCD
 #include 
-#include 
+#endif
 #include 
 #include 
 #include 
+#ifdef CONFIG_PWM_TEGRA
 #include 
+#endif
 #include 
-#include 
 #include 
 #include 
 #include 
 #include 
 #include 
 #include 
-#include 
+#ifdef CONFIG_TEGRA_CLOCK_SCALING
+#include 
+#endif
+#ifdef CONFIG_USB_EHCI_TEGRA
+#include 
+#endif
 #include 
+#include 
 #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 += $(CPUDIR)/tegra-common/libtegra-common.o
-- 
1.7.0.4

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


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

2012-12-11 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 
---
---
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.
V3:
* Remove REALTEK HDA section in pinmux-config header
* Use 408MHz UART clock on T30 (still 216MHz on T20)
* Remove CONFIG_SYS_CPU_OSC_FREQUENCY (unused)
* Move MEM_LAYOUT_ENV settings to tegraXX-common.h

 board/nvidia/cardhu/Makefile   |   44 +++
 board/nvidia/cardhu/cardhu.c   |   39 +++
 board/nvidia/cardhu/pinmux-config-cardhu.h |  329 
 boards.cfg |1 +
 include/configs/cardhu.h   |   45 +++
 include/configs/tegra-common-post.h|   27 --
 .../configs/{tegra20-common.h => tegra-common.h}   |   59 +
 include/configs/tegra20-common.h   |  199 -
 include/configs/tegra30-common.h   |   86 +
 9 files changed, 602 insertions(+), 227 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
 copy include/configs/{tegra20-common.h => tegra-common.h} (72%)
 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 
+#
+#
+#  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 
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include 
+#include 
+#include "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..3162219
--- /dev/null
+++ b/board/nvidia/cardhu/pinmux-config-cardhu.h
@@ -0,0 +1,329 @@
+/*
+ * 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

Re: [U-Boot] Pull request: u-boot-net.git master

2012-12-11 Thread Langer Thomas (LQDE RD ST PON SW)
Hello Joe,

> Tomas Hlavacek (67):
>   net: dm: Pull out ops from struct eth_device
>   net: 4xx_enet: Pull out init of struct eth_ops
>   net: altera_tse: Pull out init of struct eth_ops
>   net: dm9000x: Pull out init of struct eth_ops
>   net: armada100_fec: Pull out init of struct eth_ops
>   net: at91_emac: Pull out init of struct eth_ops
>   net: ax88180: Pull out init of struct eth_ops
>   net: bfin_mac: Pull out init of struct eth_ops
>   net: calxedaxgmac: Pull out init of struct eth_ops
>   net: cs8900: Pull out init of struct eth_ops
>   net: davinci_emac: Pull out init of struct eth_ops
>   net: dc2114x: Pull out init of struct eth_ops
>   net: designware: Pull out init of struct eth_ops
>   net: dnet: Pull out init of struct eth_ops
>   net: e1000: Pull out init of struct eth_ops
>   net: eepro100: Pull out init of struct eth_ops
>   net: enc28j60: Pull out init of struct eth_ops
>   net: ep93xx_eth: Pull out init of struct eth_ops
>   net: ethoc: Pull out init of struct eth_ops
>   net: fec_mxc: Pull out init of struct eth_ops
>   net: ftgmac100: Pull out init of struct eth_ops
>   net: greth.c: Pull out init of struct eth_ops
>   net: fsl_mcdmafec: Pull out init of struct eth_ops
>   net: inca-ip_sw: Pull out init of struct eth_ops
>   net: ks8695eth: Pull out init of struct eth_ops
>   net: lan91c96: Pull out init of struct eth_ops
>   net: macb: Pull out init of struct eth_ops
>   net: mcffec: Pull out init of struct eth_ops
>   net: mpc5xxx_fec: Pull out init of struct eth_ops
>   net: mvgbe: Pull out init of struct eth_ops
>   net: mpc512x_fec: Pull out init of struct eth_ops
>   net: natsemi: Pull out init of struct eth_ops
>   net: ne2000: Pull out init of struct eth_ops
>   net: npe: Pull out init of struct eth_ops
>   net: ns8382x: Pull out init of struct eth_ops
>   net: pcnet: Pull out init of struct eth_ops
>   net: plb2800_eth: Pull out init of struct eth_ops
>   net: rtl8139: Pull out init of struct eth_ops
>   net: rtl8169: Pull out init of struct eth_ops
>   net: smc9: Pull out init of struct eth_ops
>   net: smc911x: Pull out init of struct eth_ops
>   net: tsec: Pull out init of struct eth_ops
>   net: tsi108_eth: Pull out init of struct eth_ops
>   net: uli526x: Pull out init of struct eth_ops
>   net: xilinx_axi_emac: Pull out init of struct eth_ops
>   net: xilinx_emaclite: Pull out init of struct eth_ops
>   net: zynq_gem: Pull out init of struct eth_ops
>   net: xilinx_ll_temac: Pull out init of struct eth_ops
>   net: sh_eth: Pull out init of struct eth_ops
>   net: au1x00_eth: Pull out init of struct eth_ops
>   net: mpc8220_fec: Pull out init of struct eth_ops
>   net: mpc8260_fec: Pull out init of struct eth_ops
>   net: mpc8260_scc: Pull out init of struct eth_ops
>   net: mpc85xx_fec: Pull out init of struct eth_ops
>   net: mpc8xx_scc: Pull out init of struct eth_ops
>   net: db64360/mv_eth: Pull out init of struct eth_ops
>   net: mpc8xx_fec: Pull out init of struct eth_ops
>   net: db64460/mv_eth: Pull out init of struct eth_ops
>   net: cpci750/mv_eth: Pull out init of struct eth_ops
>   net: evb64260: Pull out init of struct eth_ops
>   net: p3mx/mv_eth: Pull out init of struct eth_ops
>   net: cpsw: Pull out init of struct eth_ops
>   net: fm_eth: Pull out init of struct eth_ops
>   net: ftmac100: Pull out init of struct eth_ops
>   net: qe: uec: Pull out init of struct eth_ops
>   net: usb: asix: Pull out init of struct eth_ops
>   net: usb: smsc95xx: Pull out init of struct eth_ops

These patches for static initialization of the struct eth_ops will break the 
drivers on any architecture which needs manual relocation!

I've send a comment regarding this, please see here:
http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/146092/focus=147607

The tests with QEMU are insufficient, as probably the memory locations before 
relocation were still available and used via the 
uncorrected pointers.

So please consider to revoke the pull request until an update with fixes for 
the "eth_ops" series is available.

Best Regards,
Thomas

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


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

2012-12-11 Thread Tom Warren
These files are for code that runs on the CPU (A9) on T30 boards.
At this time, there are no T30-specific ARMV7 files. As T30-specific
run-time code is added, it'll go here.

Signed-off-by: Tom Warren 
---
V2: Cleanup whitespace issues
V3: Change commit msg

 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 .
+#
+
+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, 
+#
+# 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 .
+#
+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


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

2012-12-11 Thread Stephen Warren
On 12/11/2012 04:34 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

> + TEGRA_SOC2_SLOW,/* T2x needs to run at slow clock initially */

I don't think that's used anywhere; drop it?

> - TEGRA_SOC_COUNT,
> + TEGRA_SOC_CNT,

A little arbitrary, but whatever.

Aside from that, this patch,
Reviewed-by: Stephen Warren 
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


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

2012-12-11 Thread Stephen Warren
On 12/11/2012 04:34 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.

> diff --git a/arch/arm/cpu/arm720t/tegra-common/cpu.c 
> b/arch/arm/cpu/arm720t/tegra-common/cpu.c

> +struct clk_pll_table tegra_pll_x_table[TEGRA_SOC_CNT][CLOCK_OSC_FREQ_COUNT] 
> = {

> + /* 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 */
> + },

Given my comment on patch 1, I'd suggest dropping that table entry too.

Aside from that, this patch,
Reviewed-by: Stephen Warren 
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


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

2012-12-11 Thread Stephen Warren
On 12/11/2012 04:34 PM, Tom Warren wrote:
> These files are for code that runs on the CPU (A9) on T30 boards.
> At this time, there are no T30-specific ARMV7 files. As T30-specific
> run-time code is added, it'll go here.

Reviewed-by: Stephen Warren 

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


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

2012-12-11 Thread Allen Martin
On Tue, Dec 11, 2012 at 03:34:11PM -0800, 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

I wasn't able to get these to apply cleanly to u-boot-tegra/next.  It
failed on the first patch:

$ git am ~/twarren
Applying: Tegra30: Add arch-tegra30 include files
error: patch failed: arch/arm/include/asm/arch-tegra/clk_rst.h:37
error: arch/arm/include/asm/arch-tegra/clk_rst.h: patch does not apply
error: patch failed: arch/arm/include/asm/arch-tegra/clock.h:136
error: arch/arm/include/asm/arch-tegra/clock.h: patch does not apply
error: patch failed: arch/arm/include/asm/arch-tegra/tegra.h:72
error: arch/arm/include/asm/arch-tegra/tegra.h: patch does not apply
error: patch failed: arch/arm/include/asm/arch-tegra20/funcmux.h:62
error: arch/arm/include/asm/arch-tegra20/funcmux.h: patch does not apply
error: patch failed: arch/arm/include/asm/arch-tegra20/gp_padctrl.h:61
error: arch/arm/include/asm/arch-tegra20/gp_padctrl.h: patch does not apply
Patch failed at 0001 Tegra30: Add arch-tegra30 include files
When you have resolved this problem run "git am --resolved".
If you would prefer to skip this patch, instead run "git am --skip".
To restore the original branch and stop patching run "git am --abort".

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


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

2012-12-11 Thread Allen Martin
On Tue, Dec 11, 2012 at 05:09:45PM -0800, Allen Martin wrote:
> On Tue, Dec 11, 2012 at 03:34:11PM -0800, 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
> 
> I wasn't able to get these to apply cleanly to u-boot-tegra/next.  It
> failed on the first patch:
> 

My bad, I pulled the patches from patchwork and they apply cleanly, so
I must have mangled them somehow.

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


Re: [U-Boot] [PATCH v2] m28evk/mx28evk: fix nand_update_full

2012-12-11 Thread Marek Vasut
Dear Scott Wood,

> On 12/11/2012 03:36:21 PM, Eric Bénard wrote:
> > - since commit 418396e212b59bf907dbccad997ff50f7eb61b16 nand write.raw
> > can take the number of page to be written as an argument.
> > nand_update_full
> > is passing the size (in bytes) to nand write.raw. This value was
> > previously
> > ignored but now breaks the write.
> > - this patch updates the default environment of these boards to
> > provide a
> > pagecount instead of a size to nand write.raw.
> > - tested on a mx28evk with a 4k page NAND and on a custom board with a
> > 2k page NAND.
> > 
> > Signed-off-by: Eric Bénard 
> > Cc: Marek Vasut 
> > Cc: Fabio Estevam 
> > ---
> > 
> >  include/configs/m28evk.h  |2 +-
> >  include/configs/mx28evk.h |2 +-
> >  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> Marek, can you ack this?
> 
> There is still a change in behavior in that before
> 418396e212b59bf907dbccad997ff50f7eb61b16 it only wrote one page (since
> that's all the write.raw command ever did) but with this patch it will
> write ${fcb_sz} pages.  I assume the new behavior is correct?

Yes, it's correct

Acked-by: Marek Vasut 

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 V3 0/7] Add support for NVIDIA Tegra30 SoC

2012-12-11 Thread Allen Martin
On Tue, Dec 11, 2012 at 03:34:11PM -0800, 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.
> 

Booted to command prompt on cardhu with the series, so:

Tested-by: Allen Martin 

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


[U-Boot] [BUGFIX PATCH] mips: serial: Fix busted manual relocation

2012-12-11 Thread Joe Hershberger
serial_initialize() must be called after relocation to adjust the
pointers to putc(), getc(), etc.  This is busted ever since the
serial driver-model-ification series.

Signed-off-by: Joe Hershberger 
---
 arch/mips/lib/board.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/mips/lib/board.c b/arch/mips/lib/board.c
index 7ddd778..e47989b 100644
--- a/arch/mips/lib/board.c
+++ b/arch/mips/lib/board.c
@@ -262,6 +262,8 @@ void board_init_r(gd_t *id, ulong dest_addr)
 
monitor_flash_len = (ulong)&uboot_end_data - dest_addr;
 
+   serial_initialize();
+
 #if defined(CONFIG_NEEDS_MANUAL_RELOC)
/*
 * We have to relocate the command table manually
-- 
1.7.11.5

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


Re: [U-Boot] Pull request: u-boot-net.git master

2012-12-11 Thread Joe Hershberger
Hi Thomas,

On Tue, Dec 11, 2012 at 5:47 PM, Langer Thomas (LQDE RD ST PON SW)
 wrote:
> Hello Joe,
>
> These patches for static initialization of the struct eth_ops will break the 
> drivers on any architecture which needs manual relocation!
>
> I've send a comment regarding this, please see here:
> http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/146092/focus=147607

I missed that message before.  Thanks for keeping an eye out!

> The tests with QEMU are insufficient, as probably the memory locations before 
> relocation were still available and used via the
> uncorrected pointers.

I just ran into another issue on MIPS where the is the case... serial
is busted (serial_initialize() isn't called, which manually
relocates), but it doesn't appear as a crash because of the
pre-relocation addresses still being valid.

> So please consider to revoke the pull request until an update with fixes for 
> the "eth_ops" series is available.

Indeed.  Tom, please disregard this pull request.

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


[U-Boot] [PATCH v5 13/20] env: Add a silent env handler

2012-12-11 Thread Joe Hershberger
The silent variable now updates the global data flag anytime it is
changed as well as after the env relocation (in case its value is
different from the default env in such cases as NAND env)

Signed-off-by: Joe Hershberger 
---
Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2: None

 common/console.c   | 23 +++
 doc/README.silent  | 14 ++
 include/env_callback.h |  7 +++
 3 files changed, 40 insertions(+), 4 deletions(-)

diff --git a/common/console.c b/common/console.c
index 549d379..3322bcc 100644
--- a/common/console.c
+++ b/common/console.c
@@ -73,6 +73,29 @@ static int on_console(const char *name, const char *value, 
enum env_op op,
 }
 U_BOOT_ENV_CALLBACK(console, on_console);
 
+#ifdef CONFIG_SILENT_CONSOLE
+static int on_silent(const char *name, const char *value, enum env_op op,
+   int flags)
+{
+#ifndef CONFIG_SILENT_CONSOLE_UPDATE_ON_SET
+   if (flags & H_INTERACTIVE)
+   return 0;
+#endif
+#ifndef CONFIG_SILENT_CONSOLE_UPDATE_ON_RELOC
+   if ((flags & H_INTERACTIVE) == 0)
+   return 0;
+#endif
+
+   if (value != NULL)
+   gd->flags |= GD_FLG_SILENT;
+   else
+   gd->flags &= ~GD_FLG_SILENT;
+
+   return 0;
+}
+U_BOOT_ENV_CALLBACK(silent, on_silent);
+#endif
+
 #ifdef CONFIG_SYS_CONSOLE_IS_IN_ENV
 /*
  * if overwrite_console returns 1, the stdin, stderr and stdout
diff --git a/doc/README.silent b/doc/README.silent
index a26e3df..70202ce 100644
--- a/doc/README.silent
+++ b/doc/README.silent
@@ -1,9 +1,15 @@
 The config option CONFIG_SILENT_CONSOLE can be used to quiet messages
 on the console.  If the option has been enabled, the output can be
-silenced by setting the environment variable "silent".  The variable
-is latched into the global data at an early stage in the boot process
-so deleting it with "setenv" will not take effect until the system is
-restarted.
+silenced by setting the environment variable "silent".
+
+- CONFIG_SILENT_CONSOLE_UPDATE_ON_SET
+   When the "silent" variable is changed with env set, the change
+   will take effect immediately.
+
+- CONFIG_SILENT_CONSOLE_UPDATE_ON_RELOC
+   Some environments are not available until relocation (e.g. NAND)
+   so this will make the value in the flash env take effect at
+   relocation.
 
 The following actions are taken if "silent" is set at boot time:
 
diff --git a/include/env_callback.h b/include/env_callback.h
index 9d2d2c9..f52e133 100644
--- a/include/env_callback.h
+++ b/include/env_callback.h
@@ -34,6 +34,12 @@
 #define CONFIG_ENV_CALLBACK_LIST_STATIC
 #endif
 
+#ifdef CONFIG_SILENT_CONSOLE
+#define SILENT_CALLBACK "silent:silent,"
+#else
+#define SILENT_CALLBACK
+#endif
+
 /*
  * This list of callback bindings is static, but may be overridden by defining
  * a new association in the ".callbacks" environment variable.
@@ -42,6 +48,7 @@
"baudrate:baudrate," \
"bootfile:bootfile," \
"loadaddr:loadaddr," \
+   SILENT_CALLBACK \
"stdin:console,stdout:console,stderr:console," \
CONFIG_ENV_CALLBACK_LIST_STATIC
 
-- 
1.7.11.5

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


[U-Boot] [PATCH v5 10/20] env: Add a baudrate env handler

2012-12-11 Thread Joe Hershberger
Remove the hard-coded baudrate handler and use a callback instead

Signed-off-by: Joe Hershberger 
---
Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2: None

 common/cmd_nvedit.c | 47 -
 drivers/serial/serial.c | 70 +
 include/env_callback.h  |  1 +
 3 files changed, 71 insertions(+), 47 deletions(-)

diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c
index 874baef..df136cf 100644
--- a/common/cmd_nvedit.c
+++ b/common/cmd_nvedit.c
@@ -78,12 +78,6 @@ ulong save_addr; /* Default Save Address 
*/
 ulong save_size;   /* Default Save Size (in bytes) */
 
 /*
- * Table with supported baudrates (defined in config_xyz.h)
- */
-static const unsigned long baudrate_table[] = CONFIG_SYS_BAUDRATE_TABLE;
-#defineN_BAUDRATES (sizeof(baudrate_table) / sizeof(baudrate_table[0]))
-
-/*
  * This variable is incremented on each do_env_set(), so it can
  * be used via get_env_id() as an indication, if the environment
  * has changed or not. So it is possible to reread an environment
@@ -275,47 +269,6 @@ int env_change_ok(const ENTRY *item, const char *newval, 
enum env_op op,
}
}
 #endif
-   /*
-* When we change baudrate, or we are doing an env default -a
-* (which will erase all variables prior to calling this),
-* we want the baudrate to actually change - for real.
-*/
-   if (op != env_op_create ||  /* variable exists */
-   (flag & H_NOCLEAR) == 0) {  /* or env is clear */
-   /*
-* Switch to new baudrate if new baudrate is supported
-*/
-   if (strcmp(name, "baudrate") == 0) {
-   int baudrate = simple_strtoul(newval, NULL, 10);
-   int i;
-   for (i = 0; i < N_BAUDRATES; ++i) {
-   if (baudrate == baudrate_table[i])
-   break;
-   }
-   if (i == N_BAUDRATES) {
-   if ((flag & H_FORCE) == 0)
-   printf("## Baudrate %d bps not "
-   "supported\n", baudrate);
-   return 1;
-   }
-   if (gd->baudrate == baudrate) {
-   /* If unchanged, we just say it's OK */
-   return 0;
-   }
-   printf("## Switch baudrate to %d bps and"
-   "press ENTER ...\n", baudrate);
-   udelay(5);
-   gd->baudrate = baudrate;
-#if defined(CONFIG_PPC) || defined(CONFIG_MCF52x2)
-   gd->bd->bi_baudrate = baudrate;
-#endif
-
-   serial_setbrg();
-   udelay(5);
-   while (getc() != '\r')
-   ;
-   }
-   }
 
/*
 * Some variables should be updated when the corresponding
diff --git a/drivers/serial/serial.c b/drivers/serial/serial.c
index f5f43a6..1f8955a 100644
--- a/drivers/serial/serial.c
+++ b/drivers/serial/serial.c
@@ -22,6 +22,7 @@
  */
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -32,6 +33,11 @@ DECLARE_GLOBAL_DATA_PTR;
 
 static struct serial_device *serial_devices;
 static struct serial_device *serial_current;
+/*
+ * Table with supported baudrates (defined in config_xyz.h)
+ */
+static const unsigned long baudrate_table[] = CONFIG_SYS_BAUDRATE_TABLE;
+#defineN_BAUDRATES (sizeof(baudrate_table) / sizeof(baudrate_table[0]))
 
 /**
  * serial_null() - Void registration routine of a serial driver
@@ -46,6 +52,70 @@ static void serial_null(void)
 }
 
 /**
+ * on_baudrate() - Update the actual baudrate when the env var changes
+ *
+ * This will check for a valid baudrate and only apply it if valid.
+ */
+static int on_baudrate(const char *name, const char *value, enum env_op op,
+   int flags)
+{
+   int i;
+   int baudrate;
+
+   switch (op) {
+   case env_op_create:
+   case env_op_overwrite:
+   /*
+* Switch to new baudrate if new baudrate is supported
+*/
+   baudrate = simple_strtoul(value, NULL, 10);
+
+   /* Not actually changing */
+   if (gd->baudrate == baudrate)
+   return 0;
+
+   for (i = 0; i < N_BAUDRATES; ++i) {
+   if (baudrate == baudrate_table[i])
+   break;
+   }
+   if (i == N_BAUDRATES) {
+   if ((flags & H_FORCE) == 0)
+   printf("## Baudrate %d bps not supported\n",
+   baud

  1   2   >