Re: [U-Boot] [PATCH] arch: ifc: update the IFC IP input clock

2016-09-09 Thread Prabhakar Kushwaha

> -Original Message-
> From: Scott Wood
> Sent: Friday, September 09, 2016 7:30 AM
> To: Prabhakar Kushwaha ; york sun
> ; u-boot@lists.denx.de
> Subject: Re: [PATCH] arch: ifc: update the IFC IP input clock
> 
> On 09/08/2016 08:46 PM, Prabhakar Kushwaha wrote:
> >
> >> -Original Message-
> >> From: Scott Wood
> >> Sent: Friday, September 09, 2016 6:05 AM
> >> To: Prabhakar Kushwaha ; york sun
> >> ; u-boot@lists.denx.de
> >> Subject: Re: [PATCH] arch: ifc: update the IFC IP input clock
> >>
> >> On 09/08/2016 07:05 PM, Prabhakar Kushwaha wrote:
> >>>
>  -Original Message-
>  From: york sun
>  Sent: Thursday, September 08, 2016 9:22 PM
>  To: Prabhakar Kushwaha ; u-
>  b...@lists.denx.de; Scott Wood 
>  Subject: Re: [PATCH] arch: ifc: update the IFC IP input clock
> 
>  On 09/08/2016 02:33 AM, Prabhakar Kushwaha wrote:
> 
>  
> 
> >>> So better to print IP clock to avoid any confusion.
> >>> IFC output clock will be printed when it is actually being used during
> >> synchronous NOR, syn NAND.
> >>
> >> I am not against changing it to internal clock. But what are you going
> >> to print on the console? I think it is confusing to say IFC or local 
> >> bus
> >> internal clock speed. Please also check how this clock is used and make
> >> sure arch.lbc_clk is still correct, after passing to Linux.
> >>
> > arch.lbc_clk is only being used for eLBC for device tree fixup.
> > And I checked the Linux eLBC driver. Looks like it is not using used.
> >
> 
>  If this clock is not used, can we drop it completely?
> 
> >>>
> >>> From my point of view Yes.
> >>>
> >>> Scott, Please advice
> >>
> >> Well, there is that patch from Matt Weber that is trying to guess the
> >> IFC frequency in order to use NWAIT...  Not sure if we'll end up
> >> actually using NWAIT
> > (Prabhakar, can you answer my question of whether
> >> there is a better opcode to use with RNDOUT?) or ever sending a real
> >> RNDOUT, or if we'll ever care about these newer NAND chips on eLBC, but
> >> if U-Boot is currently writing the clock frequency into the device tree
> >> I don't see why we'd rip it out.
> >>
> >
> > IFC frequency means IP clock or IP output clock?
> 
> External bus clock.  Which is currently being written to the device tree?
> 

Currently,  for eLBC IP output clock is being written in as freq_localbus hence 
"bus-frequency" 
Output IP clock is being calculated using CCB/LCR. 

> > If IP clock then other patch for eLBC still valid.
> 
> What other patch?
> 

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


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


Re: [U-Boot] [PATCH v7 01/12] clk: Use dummy clk_get_by_* functions when CONFIG_CLK is disabled

2016-09-09 Thread Paul Burton
On 09/09/16 04:15, Masahiro Yamada wrote:
> 2016-09-08 15:47 GMT+09:00 Paul Burton :
>> The implementations of clk_get_by_index & clk_get_by_name are only
>> available when CONFIG_CLK is enabled.
> 
> Unless I am missing something,
> I think this statement also applies to other clk API functions
> such as clk_request(), clk_free(), clk_get_rate(), etc.

Hi Masahiro,

Yes, I agree. To be clear though, this patch doesn't add any new stub
functions it simply makes the conditions for the existing ones being
provided match the conditions for the real implementations not being
provided.

>> Provide the dummies when this is
>> not the case in order to avoid build failures.
> 
> Why are other functions OK without dummy stubs?

In general, I presume because they aren't used.

In the specific case I'm using clk_get_by_index for
(drivers/serial/ns16550.c in patch 2 of this series) the fact that the
dummy clk_get_by_index always returns an error will cause the compiler
to optimise out a call to clk_get_rate so any dummy implementation
provided for it wouldn't really get used.

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


[U-Boot] [RFC v2] bootm: fix passing argc to standalone apps

2016-09-09 Thread Zubair Lutfullah Kakakhel
This bug appears in b6396403 which makes u-boot unable to pass
arguments via bootm to a standalone application without this patch.

Steps to reproduce.

Compile a u-boot. Use mkimage to package the standalone hello_world.bin
file.

e.g. For the MIPS Boston platform

mkimage -n "hello" -A mips -O u-boot -C none -T standalone \
 -a 0x8020 -d hello_world.bin \
 -ep 0x8020 hello_out

Then tftp hello_out and run it using

boston # dhcp 192.168.154.45:hello_out
...
boston # bootm $loadaddr 123 321

Without the patch the following output is observed.

boston # bootm $loadaddr 123 321
   Image Name:   hello
   Image Type:   MIPS U-Boot Standalone Program (uncompressed)
   Data Size:1240 Bytes = 1.2 KiB
   Load Address: 8020
   Entry Point:  8020
   Verifying Checksum ... OK
   Loading Standalone Program ... OK
Example expects ABI version 8
Actual U-Boot ABI version 8
Hello World
argc = 0
argv[0] = "0x8800"

With the patch, you see the following.

boston # bootm $loadaddr 123 321
   Image Name:   hello
   Image Type:   MIPS U-Boot Standalone Program (uncompressed)
   Data Size:1240 Bytes = 1.2 KiB
   Load Address: 8020
   Entry Point:  8020
   Verifying Checksum ... OK
   Loading Standalone Program ... OK
Example expects ABI version 8
Actual U-Boot ABI version 8
Hello World
argc = 3
argv[0] = "0x8800"
argv[1] = "123"
argv[2] = "321"
argv[3] = ""

Without the patch, the go command at the entry point seems to work.

boston # go 0x8020 123 321
Example expects ABI version 8
Actual U-Boot ABI version 8
Hello World
argc = 3
argv[0] = "0x8020"
argv[1] = "123"
argv[2] = "321"
argv[3] = ""
Hit any key to exit ...

Signed-off-by: Zubair Lutfullah Kakakhel 

---

Tested on the MIPS Boston platform.
---
 common/bootm.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/common/bootm.c b/common/bootm.c
index e6da551..a26ada4 100644
--- a/common/bootm.c
+++ b/common/bootm.c
@@ -602,10 +602,8 @@ int do_bootm_states(cmd_tbl_t *cmdtp, int flag, int argc, 
char * const argv[],
if (!ret && (states & BOOTM_STATE_FINDOS))
ret = bootm_find_os(cmdtp, flag, argc, argv);
 
-   if (!ret && (states & BOOTM_STATE_FINDOTHER)) {
+   if (!ret && (states & BOOTM_STATE_FINDOTHER))
ret = bootm_find_other(cmdtp, flag, argc, argv);
-   argc = 0;   /* consume the args */
-   }
 
/* Load the OS */
if (!ret && (states & BOOTM_STATE_LOADOS)) {
-- 
1.9.1

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


[U-Boot] [PATCH v2 3/4] disk: part: refactor generic name creation for DOS and ISO

2016-09-09 Thread Petr Kulhavy
In both DOS and ISO partition tables the same code to create partition name
like "hda1" was repeated.

Code moved to into a new function part_set_generic_name() in part.c and 
optimized.
Added recognition of MMC and SD types, name is like "mmcsda1".

Signed-off-by: Petr Kulhavy 
Reviewed-by: Tom Rini 
---
v1: initial
v2: no change

 disk/part.c | 32 
 disk/part_dos.c | 31 ++-
 disk/part_iso.c | 25 +
 doc/README.android-fastboot |  1 +
 include/part.h  | 14 ++
 5 files changed, 50 insertions(+), 53 deletions(-)

diff --git a/disk/part.c b/disk/part.c
index 8317e80..9f51a07 100644
--- a/disk/part.c
+++ b/disk/part.c
@@ -641,3 +641,35 @@ int part_get_info_by_name(struct blk_desc *dev_desc, const 
char *name,
}
return -1;
 }
+
+void part_set_generic_name(const struct blk_desc *dev_desc,
+   int part_num, char *name)
+{
+   char *devtype;
+
+   switch (dev_desc->if_type) {
+   case IF_TYPE_IDE:
+   case IF_TYPE_SATA:
+   case IF_TYPE_ATAPI:
+   devtype = "hd";
+   break;
+   case IF_TYPE_SCSI:
+   devtype = "sd";
+   break;
+   case IF_TYPE_USB:
+   devtype = "usbd";
+   break;
+   case IF_TYPE_DOC:
+   devtype = "docd";
+   break;
+   case IF_TYPE_MMC:
+   case IF_TYPE_SD:
+   devtype = "mmcsd";
+   break;
+   default:
+   devtype = "xx";
+   break;
+   }
+
+   sprintf(name, "%s%c%d", devtype, 'a' + dev_desc->devnum, part_num);
+}
diff --git a/disk/part_dos.c b/disk/part_dos.c
index 8e6aae5..ed78334 100644
--- a/disk/part_dos.c
+++ b/disk/part_dos.c
@@ -209,35 +209,8 @@ static int part_get_info_extended(struct blk_desc 
*dev_desc,
info->start = (lbaint_t)(ext_part_sector +
le32_to_int(pt->start4));
info->size  = (lbaint_t)le32_to_int(pt->size4);
-   switch(dev_desc->if_type) {
-   case IF_TYPE_IDE:
-   case IF_TYPE_SATA:
-   case IF_TYPE_ATAPI:
-   sprintf((char *)info->name, "hd%c%d",
-   'a' + dev_desc->devnum,
-   part_num);
-   break;
-   case IF_TYPE_SCSI:
-   sprintf((char *)info->name, "sd%c%d",
-   'a' + dev_desc->devnum,
-   part_num);
-   break;
-   case IF_TYPE_USB:
-   sprintf((char *)info->name, "usbd%c%d",
-   'a' + dev_desc->devnum,
-   part_num);
-   break;
-   case IF_TYPE_DOC:
-   sprintf((char *)info->name, "docd%c%d",
-   'a' + dev_desc->devnum,
-   part_num);
-   break;
-   default:
-   sprintf((char *)info->name, "xx%c%d",
-   'a' + dev_desc->devnum,
-   part_num);
-   break;
-   }
+   part_set_generic_name(dev_desc, part_num,
+ (char *)info->name);
/* sprintf(info->type, "%d, pt->sys_ind); */
strcpy((char *)info->type, "U-Boot");
info->bootable = is_bootable(pt);
diff --git a/disk/part_iso.c b/disk/part_iso.c
index 78fc97e..bb8ed65 100644
--- a/disk/part_iso.c
+++ b/disk/part_iso.c
@@ -137,30 +137,7 @@ int part_get_info_iso_verb(struct blk_desc *dev_desc, int 
part_num,
entry_num=1;
offset=0x20;
strcpy((char *)info->type, "U-Boot");
-   switch(dev_desc->if_type) {
-   case IF_TYPE_IDE:
-   case IF_TYPE_SATA:
-   case IF_TYPE_ATAPI:
-   sprintf ((char *)info->name, "hd%c%d",
-   'a' + dev_desc->devnum, part_num);
-   break;
-   case IF_TYPE_SCSI:
-   sprintf ((char *)info->name, "sd%c%d",
-   'a' + dev_desc->devnum, part_num);
-   break;
-   case IF_TYPE_USB:
-

[U-Boot] [PATCH v2 1/4] disk: part: implement generic function part_get_info_by_name()

2016-09-09 Thread Petr Kulhavy
So far partition search by name has been supported only on the EFI partition
table. This patch extends the search to all partition tables.

Rename part_get_info_efi_by_name() to part_get_info_by_name(), move it from
part_efi.c into part.c and make it a generic function which traverses all part
drivers and searches all partitions (in the order given by the linked list).

For this a new variable struct part_driver.max_entries is added, which limits
the number of partitions searched. For EFI this was GPT_ENTRY_NUMBERS.
Similarly the limit is defined for DOS, ISO, MAC and AMIGA partition tables.

Signed-off-by: Petr Kulhavy 
Reviewed-by: Tom Rini 
---
v1: initial
v2: no change

 common/fb_mmc.c   |  4 ++--
 disk/part.c   | 26 ++
 disk/part_amiga.c |  1 +
 disk/part_dos.c   |  1 +
 disk/part_efi.c   | 20 +---
 disk/part_iso.c   |  1 +
 disk/part_mac.c   |  1 +
 include/part.h| 32 
 8 files changed, 53 insertions(+), 33 deletions(-)

diff --git a/common/fb_mmc.c b/common/fb_mmc.c
index 8d0524d..a0a4a83 100644
--- a/common/fb_mmc.c
+++ b/common/fb_mmc.c
@@ -27,7 +27,7 @@ static int part_get_info_efi_by_name_or_alias(struct blk_desc 
*dev_desc,
 {
int ret;
 
-   ret = part_get_info_efi_by_name(dev_desc, name, info);
+   ret = part_get_info_by_name(dev_desc, name, info);
if (ret) {
/* strlen("fastboot_partition_alias_") + 32(part_name) + 1 */
char env_alias_name[25 + 32 + 1];
@@ -38,7 +38,7 @@ static int part_get_info_efi_by_name_or_alias(struct blk_desc 
*dev_desc,
strncat(env_alias_name, name, 32);
aliased_part_name = getenv(env_alias_name);
if (aliased_part_name != NULL)
-   ret = part_get_info_efi_by_name(dev_desc,
+   ret = part_get_info_by_name(dev_desc,
aliased_part_name, info);
}
return ret;
diff --git a/disk/part.c b/disk/part.c
index 6a1c02d..8317e80 100644
--- a/disk/part.c
+++ b/disk/part.c
@@ -615,3 +615,29 @@ cleanup:
free(dup_str);
return ret;
 }
+
+int part_get_info_by_name(struct blk_desc *dev_desc, const char *name,
+   disk_partition_t *info)
+{
+   struct part_driver *first_drv =
+   ll_entry_start(struct part_driver, part_driver);
+   const int n_drvs = ll_entry_count(struct part_driver, part_driver);
+   struct part_driver *part_drv;
+
+   for (part_drv = first_drv; part_drv != first_drv + n_drvs; part_drv++) {
+   int ret;
+   int i;
+   for (i = 1; i < part_drv->max_entries; i++) {
+   ret = part_drv->get_info(dev_desc, i, info);
+   if (ret != 0) {
+   /* no more entries in table */
+   break;
+   }
+   if (strcmp(name, (const char *)info->name) == 0) {
+   /* matched */
+   return 0;
+   }
+   }
+   }
+   return -1;
+}
diff --git a/disk/part_amiga.c b/disk/part_amiga.c
index d4316b8..25fe56c 100644
--- a/disk/part_amiga.c
+++ b/disk/part_amiga.c
@@ -381,6 +381,7 @@ static void part_print_amiga(struct blk_desc *dev_desc)
 U_BOOT_PART_TYPE(amiga) = {
.name   = "AMIGA",
.part_type  = PART_TYPE_AMIGA,
+   .max_entries= AMIGA_ENTRY_NUMBERS,
.get_info   = part_get_info_amiga,
.print  = part_print_amiga,
.test   = part_test_amiga,
diff --git a/disk/part_dos.c b/disk/part_dos.c
index 511917a..8226601 100644
--- a/disk/part_dos.c
+++ b/disk/part_dos.c
@@ -300,6 +300,7 @@ int part_get_info_dos(struct blk_desc *dev_desc, int part,
 U_BOOT_PART_TYPE(dos) = {
.name   = "DOS",
.part_type  = PART_TYPE_DOS,
+   .max_entries= DOS_ENTRY_NUMBERS,
.get_info   = part_get_info_ptr(part_get_info_dos),
.print  = part_print_ptr(part_print_dos),
.test   = part_test_dos,
diff --git a/disk/part_efi.c b/disk/part_efi.c
index 8d67c09..1924338 100644
--- a/disk/part_efi.c
+++ b/disk/part_efi.c
@@ -296,25 +296,6 @@ int part_get_info_efi(struct blk_desc *dev_desc, int part,
return 0;
 }
 
-int part_get_info_efi_by_name(struct blk_desc *dev_desc,
-   const char *name, disk_partition_t *info)
-{
-   int ret;
-   int i;
-   for (i = 1; i < GPT_ENTRY_NUMBERS; i++) {
-   ret = part_get_info_efi(dev_desc, i, info);
-   if (ret != 0) {
-   /* no more entries in table */
-   return -1;
-   }
-   if (strcmp(name, (const char *)info->name) == 0) {
-   /* matched */
-   return 0;
-   }
-   }
-   return -2;
-}
-
 static int

[U-Boot] [PATCH v2 4/4] fastboot: move FASTBOOT_FLASH options into Kconfig

2016-09-09 Thread Petr Kulhavy
Move FASTBOOT_MBR_NAME and FASTBOOT_GPT_NAME into Kconfig.
Add dependency on the FASTBOOT_FLASH setting (also for FASTBOOT_MBR_NAME).
Remove the now redundant GPT_ENTRY_NAME.

Signed-off-by: Petr Kulhavy 
---
v2: initial

 README   |  2 +-
 cmd/fastboot/Kconfig | 24 
 common/fb_mmc.c  |  9 -
 include/part_efi.h   |  1 -
 4 files changed, 25 insertions(+), 11 deletions(-)

diff --git a/README b/README
index f6ef8b8..9852f88 100644
--- a/README
+++ b/README
@@ -1680,7 +1680,7 @@ The following options need to be configured:
to generate and write the Backup GUID Partition Table.)
This occurs when the specified "partition name" on the
"fastboot flash" command line matches this value.
-   Default is GPT_ENTRY_NAME (currently "gpt") if undefined.
+   The default is "gpt" if undefined.
 
CONFIG_FASTBOOT_MBR_NAME
The fastboot "flash" command supports writing the downloaded
diff --git a/cmd/fastboot/Kconfig b/cmd/fastboot/Kconfig
index a93d1c0..5d2facc 100644
--- a/cmd/fastboot/Kconfig
+++ b/cmd/fastboot/Kconfig
@@ -50,11 +50,35 @@ config FASTBOOT_FLASH
 
 config FASTBOOT_FLASH_MMC_DEV
int "Define FASTBOOT MMC FLASH default device"
+   depends on FASTBOOT_FLASH
help
  The fastboot "flash" command requires additional information
  regarding the non-volatile storage device. Define this to
  the eMMC device that fastboot should use to store the image.
 
+config FASTBOOT_GPT_NAME
+   string "Target name for updating GPT"
+   depends on FASTBOOT_FLASH
+   default "gpt"
+   help
+ The fastboot "flash" command supports writing the downloaded
+ image to the Protective MBR and the Primary GUID Partition
+ Table. (Additionally, this downloaded image is post-processed
+ to generate and write the Backup GUID Partition Table.)
+ This occurs when the specified "partition name" on the
+ "fastboot flash" command line matches the value defined here.
+ The default target name for updating GPT is "gpt".
+
+config FASTBOOT_MBR_NAME
+   string "Target name for updating MBR"
+   depends on FASTBOOT_FLASH
+   default "mbr"
+   help
+ The fastboot "flash" command allows to write the downloaded image
+ to the Master Boot Record. This occurs when the "partition name"
+ specified on the "fastboot flash" command line matches the value
+ defined here. The default target name for updating MBR is "mbr".
+
 endif # USB_FUNCTION_FASTBOOT
 
 endmenu
diff --git a/common/fb_mmc.c b/common/fb_mmc.c
index 4bc68a7..ea8ec4a 100644
--- a/common/fb_mmc.c
+++ b/common/fb_mmc.c
@@ -14,15 +14,6 @@
 #include 
 #include 
 
-#if defined(CONFIG_EFI_PARTITION) && !defined(CONFIG_FASTBOOT_GPT_NAME)
-#define CONFIG_FASTBOOT_GPT_NAME GPT_ENTRY_NAME
-#endif
-
-
-#if defined(CONFIG_DOS_PARTITION) && !defined(CONFIG_FASTBOOT_MBR_NAME)
-#define CONFIG_FASTBOOT_MBR_NAME "mbr"
-#endif
-
 struct fb_mmc_sparse {
struct blk_desc *dev_desc;
 };
diff --git a/include/part_efi.h b/include/part_efi.h
index c8fc873..317c044 100644
--- a/include/part_efi.h
+++ b/include/part_efi.h
@@ -27,7 +27,6 @@
 #define GPT_HEADER_SIGNATURE 0x5452415020494645ULL
 #define GPT_HEADER_REVISION_V1 0x0001
 #define GPT_PRIMARY_PARTITION_TABLE_LBA 1ULL
-#define GPT_ENTRY_NAME "gpt"
 #define GPT_ENTRY_NUMBERS  128
 #define GPT_ENTRY_SIZE 128
 
-- 
2.7.4

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


[U-Boot] [PATCH v2 0/4] Fastboot MBR and generic partition support

2016-09-09 Thread Petr Kulhavy
This set extends the Fastboot implementation from GPT-only to any partition
support.  Further it adds a special target "mbr" (configurable) to write the
DOS MBR.

Version 2: 
Add a fourth patch into the set to move CONFIG_FASTBOOT_GPT_NAME and
CONFIG_FASTBOOT_MBR_NAME into cmd/fastboot/Kconfig

Petr Kulhavy (4):
  disk: part: implement generic function part_get_info_by_name()
  fastboot: add support for writing MBR
  disk: part: refactor generic name creation for DOS and ISO
  fastboot: move FASTBOOT_FLASH options into Kconfig

 README  |  9 +-
 cmd/fastboot/Kconfig| 24 
 common/fb_mmc.c | 41 +++
 disk/part.c | 58 +
 disk/part_amiga.c   |  1 +
 disk/part_dos.c | 52 +++---
 disk/part_efi.c | 20 +
 disk/part_iso.c | 26 ++---
 disk/part_mac.c |  1 +
 doc/README.android-fastboot | 38 +
 include/part.h  | 69 +
 include/part_efi.h  |  1 -
 12 files changed, 243 insertions(+), 97 deletions(-)

-- 
2.7.4

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


[U-Boot] [PATCH v2 2/4] fastboot: add support for writing MBR

2016-09-09 Thread Petr Kulhavy
Add special target "mbr" (otherwise configurable via CONFIG_FASTBOOT_MBR_NAME)
to write MBR partition table.
Partitions are now searched using the generic function which finds any
partiiton by name. For MBR the partition names hda1, sda1, etc. are used.

Signed-off-by: Petr Kulhavy 
Reviewed-by: Tom Rini 
---
v1: initial
v2: no change

 README  |  7 +++
 common/fb_mmc.c | 40 ++--
 disk/part_dos.c | 20 
 doc/README.android-fastboot | 37 +
 include/part.h  | 23 +++
 5 files changed, 121 insertions(+), 6 deletions(-)

diff --git a/README b/README
index 30d7ee3..f6ef8b8 100644
--- a/README
+++ b/README
@@ -1682,6 +1682,13 @@ The following options need to be configured:
"fastboot flash" command line matches this value.
Default is GPT_ENTRY_NAME (currently "gpt") if undefined.
 
+   CONFIG_FASTBOOT_MBR_NAME
+   The fastboot "flash" command supports writing the downloaded
+   image to DOS MBR.
+   This occurs when the "partition name" specified on the
+   "fastboot flash" command line matches this value.
+   If not defined the default value "mbr" is used.
+
 - Journaling Flash filesystem support:
CONFIG_JFFS2_NAND, CONFIG_JFFS2_NAND_OFF, 
CONFIG_JFFS2_NAND_SIZE,
CONFIG_JFFS2_NAND_DEV
diff --git a/common/fb_mmc.c b/common/fb_mmc.c
index a0a4a83..4bc68a7 100644
--- a/common/fb_mmc.c
+++ b/common/fb_mmc.c
@@ -14,15 +14,20 @@
 #include 
 #include 
 
-#ifndef CONFIG_FASTBOOT_GPT_NAME
+#if defined(CONFIG_EFI_PARTITION) && !defined(CONFIG_FASTBOOT_GPT_NAME)
 #define CONFIG_FASTBOOT_GPT_NAME GPT_ENTRY_NAME
 #endif
 
+
+#if defined(CONFIG_DOS_PARTITION) && !defined(CONFIG_FASTBOOT_MBR_NAME)
+#define CONFIG_FASTBOOT_MBR_NAME "mbr"
+#endif
+
 struct fb_mmc_sparse {
struct blk_desc *dev_desc;
 };
 
-static int part_get_info_efi_by_name_or_alias(struct blk_desc *dev_desc,
+static int part_get_info_by_name_or_alias(struct blk_desc *dev_desc,
const char *name, disk_partition_t *info)
 {
int ret;
@@ -103,6 +108,7 @@ void fb_mmc_flash_write(const char *cmd, void 
*download_buffer,
return;
}
 
+#ifdef CONFIG_EFI_PARTITION
if (strcmp(cmd, CONFIG_FASTBOOT_GPT_NAME) == 0) {
printf("%s: updating MBR, Primary and Backup GPT(s)\n",
   __func__);
@@ -114,14 +120,36 @@ void fb_mmc_flash_write(const char *cmd, void 
*download_buffer,
}
if (write_mbr_and_gpt_partitions(dev_desc, download_buffer)) {
printf("%s: writing GPT partitions failed\n", __func__);
-   fastboot_fail(
- "writing GPT partitions failed");
+   fastboot_fail("writing GPT partitions failed");
return;
}
printf(" success\n");
fastboot_okay("");
return;
-   } else if (part_get_info_efi_by_name_or_alias(dev_desc, cmd, &info)) {
+   }
+#endif
+
+#ifdef CONFIG_DOS_PARTITION
+   if (strcmp(cmd, CONFIG_FASTBOOT_MBR_NAME) == 0) {
+   printf("%s: updating MBR\n", __func__);
+   if (is_valid_dos_buf(download_buffer)) {
+   printf("%s: invalid MBR - refusing to write to flash\n",
+  __func__);
+   fastboot_fail("invalid MBR partition");
+   return;
+   }
+   if (write_mbr_partition(dev_desc, download_buffer)) {
+   printf("%s: writing MBR partition failed\n", __func__);
+   fastboot_fail("writing MBR partition failed");
+   return;
+   }
+   printf(" success\n");
+   fastboot_okay("");
+   return;
+   }
+#endif
+
+   if (part_get_info_by_name_or_alias(dev_desc, cmd, &info)) {
error("cannot find partition: '%s'\n", cmd);
fastboot_fail("cannot find partition");
return;
@@ -172,7 +200,7 @@ void fb_mmc_erase(const char *cmd)
return;
}
 
-   ret = part_get_info_efi_by_name_or_alias(dev_desc, cmd, &info);
+   ret = part_get_info_by_name_or_alias(dev_desc, cmd, &info);
if (ret) {
error("cannot find partition: '%s'", cmd);
fastboot_fail("cannot find partition");
diff --git a/disk/part_dos.c b/disk/part_dos.c
index 8226601..8e6aae5 100644
--- a/disk/part_dos.c
+++ b/disk/part_dos.c
@@ -297,6 +297,26 @@ int part_get_info_dos(struct blk_desc *dev_desc, int part,
return part_get_info_extended(dev_desc, 0, 0, 1, part, info, 0);
 }
 
+int is_valid_dos_buf(void *buf)
+{
+   return

[U-Boot] [PATCH v2] mmc: s5p_sdhci: support the Driver model for Exynos

2016-09-09 Thread Jaehoon Chung
This patch support the driver model for s5p_sdhci controller.
To support the legacy model, maintained the existing code.

Note: If use the Driver Model, it needs to modify the device-tree.
In future, will update the Device-tree and enable the configuratioin.
(CONFIG_BLK, CONFIG_DM_MMC and CONFING_DM_MMC_OPS)

Signed-off-by: Jaehoon Chung 
Reviewed-by: Simon Glass 
Acked-by: Minkyu Kang 
---
Changelog for V2:
- Rebase on latest u-boot

 drivers/mmc/s5p_sdhci.c | 71 +
 1 file changed, 71 insertions(+)

diff --git a/drivers/mmc/s5p_sdhci.c b/drivers/mmc/s5p_sdhci.c
index 3bace21..0d65783 100644
--- a/drivers/mmc/s5p_sdhci.c
+++ b/drivers/mmc/s5p_sdhci.c
@@ -6,6 +6,7 @@
  */
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -16,6 +17,15 @@
 #include 
 #include 
 
+#ifdef CONFIG_DM_MMC
+struct s5p_sdhci_plat {
+   struct mmc_config cfg;
+   struct mmc mmc;
+};
+
+DECLARE_GLOBAL_DATA_PTR;
+#endif
+
 static char *S5P_NAME = "SAMSUNG SDHCI";
 static void s5p_sdhci_set_control_reg(struct sdhci_host *host)
 {
@@ -79,7 +89,11 @@ static int s5p_sdhci_core_init(struct sdhci_host *host)
if (host->bus_width == 8)
host->host_caps |= MMC_MODE_8BIT;
 
+#ifndef CONFIG_BLK
return add_sdhci(host, 5200, 40);
+#else
+   return 0;
+#endif
 }
 
 int s5p_sdhci_init(u32 regbase, int index, int bus_width)
@@ -215,3 +229,60 @@ int exynos_mmc_init(const void *blob)
return process_nodes(blob, node_list, count);
 }
 #endif
+
+#ifdef CONFIG_DM_MMC
+static int s5p_sdhci_probe(struct udevice *dev)
+{
+   struct s5p_sdhci_plat *plat = dev_get_platdata(dev);
+   struct mmc_uclass_priv *upriv = dev_get_uclass_priv(dev);
+   struct sdhci_host *host = dev_get_priv(dev);
+   int ret;
+
+   ret = sdhci_get_config(gd->fdt_blob, dev->of_offset, host);
+   if (ret)
+   return ret;
+
+   ret = do_sdhci_init(host);
+   if (ret)
+   return ret;
+
+   ret = sdhci_setup_cfg(&plat->cfg, host, 5200, 40);
+   if (ret)
+   return ret;
+
+   host->mmc = &plat->mmc;
+   host->mmc->priv = host;
+   host->mmc->dev = dev;
+   upriv->mmc = host->mmc;
+
+   return sdhci_probe(dev);
+}
+
+static int s5p_sdhci_bind(struct udevice *dev)
+{
+   struct s5p_sdhci_plat *plat = dev_get_platdata(dev);
+   int ret;
+
+   ret = sdhci_bind(dev, &plat->mmc, &plat->cfg);
+   if (ret)
+   return ret;
+
+   return 0;
+}
+
+static const struct udevice_id s5p_sdhci_ids[] = {
+   { .compatible = "samsung,exynos4412-sdhci"},
+   { }
+};
+
+U_BOOT_DRIVER(s5p_sdhci_drv) = {
+   .name   = "s5p_sdhci",
+   .id = UCLASS_MMC,
+   .of_match   = s5p_sdhci_ids,
+   .bind   = s5p_sdhci_bind,
+   .ops= &sdhci_ops,
+   .probe  = s5p_sdhci_probe,
+   .priv_auto_alloc_size = sizeof(struct sdhci_host),
+   .platdata_auto_alloc_size = sizeof(struct s5p_sdhci_plat),
+};
+#endif /* CONFIG_DM_MMC */
-- 
1.9.1

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


[U-Boot] [PATCH v6 1/2] armv8: Support loading 32-bit OS in AArch32 execution state

2016-09-09 Thread Alison Wang
To support loading a 32-bit OS, the execution state will change from
AArch64 to AArch32 when jumping to kernel.

The architecture information will be got through checking FIT image,
then U-Boot will load 32-bit OS or 64-bit OS automatically.

Signed-off-by: Ebony Zhu 
Signed-off-by: Alison Wang 
Signed-off-by: Chenhui Zhao 
---
Changes in v6:
- Modified armv8_switch_to_el1(). It will always jump to ep when switching to 
AArch64 or AArch32 modes.
- Make other platforms compatible with the new armv8_switch_to_el2() and 
armv8_switch_to_el1().

Changes in v5:
- Modified armv8_switch_to_el2(). It will always jump to ep when switching to 
AArch64 or AArch32 modes.

Changes in v4:
- Correct config ARM64_SUPPORT_AARCH32.
- Omit arch and ftaddr arguments.
- Rename "xreg5" to "tmp".
- Use xxx_RES1 to combine all RES1 fields in xxx register.
- Use an immediate cmp directly.
- Use #ifdef for CONFIG_ARM64_SUPPORT_AARCH32.

Changes in v3:
- Comments the functions and the arguments.
- Rename the real parameters.
- Use the macros instead of the magic values.
- Remove the redundant codes.
- Clean up all of the mess in boot_jump_linux().
- Add CONFIG_ARM64_SUPPORT_AARCH32 to detect for some ARM64 system doesn't 
support AArch32 state.

Changes in v2:
- armv8_switch_to_el2_aarch32() is removed. armv8_switch_to_el2_m is used
  to switch to AArch64 EL2 or AArch32 Hyp.
- armv8_switch_to_el1_aarch32() is removed. armv8_switch_to_el1_m is used
  to switch to AArch64 EL1 or AArch32 SVC.

 arch/arm/Kconfig   |   6 +
 arch/arm/cpu/armv8/start.S |   8 ++
 arch/arm/cpu/armv8/transition.S|   8 +-
 arch/arm/include/asm/macro.h   | 176 ++---
 arch/arm/include/asm/system.h  | 119 ++-
 arch/arm/lib/bootm.c   |  39 ++-
 arch/arm/mach-rmobile/lowlevel_init_gen3.S |   9 +-
 common/image-fit.c |  19 +++-
 8 files changed, 328 insertions(+), 56 deletions(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index e63309a..f122458 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -126,6 +126,12 @@ config ENABLE_ARM_SOC_BOOT0_HOOK
  ARM_SOC_BOOT0_HOOK which contains the required assembler
  preprocessor code.
 
+config ARM64_SUPPORT_AARCH32
+   bool "ARM64 system support AArch32 execution state"
+   default y if ARM64 && !TARGET_THUNDERX_88XX
+   help
+ This ARM64 system supports AArch32 execution state.
+
 choice
prompt "Target select"
default TARGET_HIKEY
diff --git a/arch/arm/cpu/armv8/start.S b/arch/arm/cpu/armv8/start.S
index 19c771d..4f5f6d8 100644
--- a/arch/arm/cpu/armv8/start.S
+++ b/arch/arm/cpu/armv8/start.S
@@ -251,9 +251,17 @@ WEAK(lowlevel_init)
/*
 * All slaves will enter EL2 and optionally EL1.
 */
+   adr x3, lowlevel_in_el2
+   ldr x4, =ES_TO_AARCH64
bl  armv8_switch_to_el2
+
+lowlevel_in_el2:
 #ifdef CONFIG_ARMV8_SWITCH_TO_EL1
+   adr x3, lowlevel_in_el1
+   ldr x4, =ES_TO_AARCH64
bl  armv8_switch_to_el1
+
+lowlevel_in_el1:
 #endif
 
 #endif /* CONFIG_ARMV8_MULTIENTRY */
diff --git a/arch/arm/cpu/armv8/transition.S b/arch/arm/cpu/armv8/transition.S
index 253a39b..115b6e9 100644
--- a/arch/arm/cpu/armv8/transition.S
+++ b/arch/arm/cpu/armv8/transition.S
@@ -11,13 +11,13 @@
 #include 
 
 ENTRY(armv8_switch_to_el2)
-   switch_el x0, 1f, 0f, 0f
+   switch_el x5, 1f, 0f, 0f
 0: ret
-1: armv8_switch_to_el2_m x0
+1: armv8_switch_to_el2_m x3, x4, x5
 ENDPROC(armv8_switch_to_el2)
 
 ENTRY(armv8_switch_to_el1)
-   switch_el x0, 0f, 1f, 0f
+   switch_el x5, 0f, 1f, 0f
 0: ret
-1: armv8_switch_to_el1_m x0, x1
+1: armv8_switch_to_el1_m x3, x4, x5
 ENDPROC(armv8_switch_to_el1)
diff --git a/arch/arm/include/asm/macro.h b/arch/arm/include/asm/macro.h
index 9bb0efa..2553e3e 100644
--- a/arch/arm/include/asm/macro.h
+++ b/arch/arm/include/asm/macro.h
@@ -8,6 +8,11 @@
 
 #ifndef __ASM_ARM_MACRO_H__
 #define __ASM_ARM_MACRO_H__
+
+#ifdef CONFIG_ARM64
+#include 
+#endif
+
 #ifdef __ASSEMBLY__
 
 /*
@@ -135,13 +140,21 @@ lr.reqx30
 #endif
 .endm
 
-.macro armv8_switch_to_el2_m, xreg1
-   /* 64bit EL2 | HCE | SMD | RES1 (Bits[5:4]) | Non-secure EL0/EL1 */
-   mov \xreg1, #0x5b1
-   msr scr_el3, \xreg1
+/*
+ * Switch from EL3 to EL2 for ARMv8
+ * @ep: kernel entry point
+ * @flag:   The execution state flag for lower exception
+ *  level, ES_TO_AARCH64 or ES_TO_AARCH32
+ * @tmp:temporary register
+ *
+ * For loading 32-bit OS, x1 is machine nr and x2 is ftaddr.
+ * For loading 64-bit OS, x0 is physical address to the FDT blob.
+ * They will be passed to the guest.
+ */
+.macro armv8_switch_to_el2_m, ep, flag, tmp
msr cptr_el3, xzr   /* Disable coprocessor traps to EL3 */
-   mov \xreg1, #0x33ff
-   msr cptr_el2, \xreg1/* Disa

[U-Boot] [PATCH v6 0/2] armv8: Support loading 32-bit OS in AArch32 execution state

2016-09-09 Thread Alison Wang
This series is to support loading a 32-bit OS, the execution state will change 
from
AArch64 to AArch32 when jumping to kernel. The architecture information will be 
got
through checking FIT image, then U-Boot will load 32-bit OS or 64-bit OS 
automatically.

Spin-table method is used for secondary cores to load 32-bit OS. The 
architecture
information will be got through checking FIT image and saved in the os_arch 
element
of spin-table, then the secondary cores will check os_arch and jump to 32-bit 
OS or
64-bit OS automatically.

---
Changes in v6:
- Modified armv8_switch_to_el1(). It will always jump to ep when switching to 
AArch64 or AArch32 modes.
- Make other platforms compatible with the new armv8_switch_to_el2() and 
armv8_switch_to_el1().

Changes in v5:
- Modified armv8_switch_to_el2(). It will always jump to ep when switching to 
AArch64 or AArch32 modes.
- Make secondary_switch_to_el2() always jump to ep when switching to AArch64 or 
AArch32 modes.

Changes in v4:
- Correct config ARM64_SUPPORT_AARCH32.
- Omit arch and ftaddr arguments.
- Rename "xreg5" to "tmp".
- Use xxx_RES1 to combine all RES1 fields in xxx register.
- Use an immediate cmp directly.
- Use #ifdef for CONFIG_ARM64_SUPPORT_AARCH32.

Changes in v3:
- Comments the functions and the arguments.
- Rename the real parameters.
- Use the macros instead of the magic values.
- Remove the redundant codes.
- Clean up all of the mess in boot_jump_linux().
- Add CONFIG_ARM64_SUPPORT_AARCH32 to detect for some ARM64 system doesn't 
support AArch32 state.
- Adjust the arguments for armv8_switch_to_el2_m and armv8_switch_to_el1_m.

Changes in v2:
- armv8_switch_to_el2_aarch32() is removed. armv8_switch_to_el2_m is used
  to switch to AArch64 EL2 or AArch32 Hyp.
- armv8_switch_to_el1_aarch32() is removed. armv8_switch_to_el1_m is used
  to switch to AArch64 EL1 or AArch32 SVC.
- Support to call armv8_switch_to_el2_m and armv8_switch_to_el1_m.


Alison Wang (2):
  armv8: Support loading 32-bit OS in AArch32 execution state
  armv8: fsl-layerscape: SMP support for loading 32-bit OS

 arch/arm/Kconfig  |   6 ++
 arch/arm/cpu/armv8/fsl-layerscape/lowlevel.S  |  61 ---
 arch/arm/cpu/armv8/fsl-layerscape/mp.c|  10 +++
 arch/arm/cpu/armv8/start.S|   8 ++
 arch/arm/cpu/armv8/transition.S   |   8 +-
 arch/arm/include/asm/arch-fsl-layerscape/mp.h |   6 ++
 arch/arm/include/asm/macro.h  | 176 
+---
 arch/arm/include/asm/system.h | 119 
+-
 arch/arm/lib/bootm.c  |  45 +--
 arch/arm/mach-rmobile/lowlevel_init_gen3.S|   9 ++-
 common/image-fit.c|  19 -
 11 files changed, 401 insertions(+), 66 deletions(-)

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


[U-Boot] [PATCH] arm: exynos: Use the generic lowlevel_init instead of the specific one

2016-09-09 Thread Alison Wang
This patch is to use the the generic lowlevel_init instead of the
specific one.

Signed-off-by: Alison Wang 
---
 arch/arm/mach-exynos/soc.c | 8 
 1 file changed, 8 deletions(-)

diff --git a/arch/arm/mach-exynos/soc.c b/arch/arm/mach-exynos/soc.c
index f9c7468..737a8dd 100644
--- a/arch/arm/mach-exynos/soc.c
+++ b/arch/arm/mach-exynos/soc.c
@@ -23,11 +23,3 @@ void enable_caches(void)
dcache_enable();
 }
 #endif
-
-#ifdef CONFIG_ARM64
-void lowlevel_init(void)
-{
-   armv8_switch_to_el2();
-   armv8_switch_to_el1();
-}
-#endif
-- 
2.1.0.27.g96db324

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


Re: [U-Boot] [PATCH 1/3] sunxi: Sync h3-orangepi dts files with kernel

2016-09-09 Thread Hans de Goede

Hi,

On 08-09-16 13:58, Ian Campbell wrote:

On Sat, 2016-09-03 at 13:12 +0200, Hans de Goede wrote:

This adds an emac node to the orangepi-2 dts (not yet merged
upstream,
but in u-boot we already have emac support); fixes the alphetically
sorting of nodes in sun8i-h3-orangepi-plus.dts and disables some
usb controllers in sun8i-h3-orangepi-plus.dts which are only used
on the plus2e, as upstream has decided to do a separate dts files
for the plus2e.

Signed-off-by: Hans de Goede 


After these three patches does the state of the dts files now match the
state of the files upstream, modulo things which are still in flight to
upstream (so maybe I should ask "...match the intended/eventual
state...")?


Yes this will make the dts files match the intended/eventual state.

Regards,

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


[U-Boot] [PATCH] cmd: usb: run 'usb start' when USB is stopped

2016-09-09 Thread Jaehoon Chung
If USB is stopped, just run 'usb start' instead of printing message.
Then user didn't consider whether usb is started or stopped.

Signed-off-by: Jaehoon Chung 
---
 cmd/usb.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/cmd/usb.c b/cmd/usb.c
index 455127c..4970851 100644
--- a/cmd/usb.c
+++ b/cmd/usb.c
@@ -651,8 +651,8 @@ static int do_usb(cmd_tbl_t *cmdtp, int flag, int argc, 
char * const argv[])
return 0;
}
if (!usb_started) {
-   printf("USB is stopped. Please issue 'usb start' first.\n");
-   return 1;
+   printf("USB is stopped. Running 'usb start' first.\n");
+   do_usb_start();
}
if (strncmp(argv[1], "tree", 4) == 0) {
puts("USB device tree:\n");
-- 
1.9.1

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


[U-Boot] [PATCH] search.h: Numerous grammatical fixes, comment updates

2016-09-09 Thread Robert P. J. Day

Tweaks (no functional changes) to include/search.h, including:

 * use standard multiple inclusion check
 * fix spelling mistakes
 * have comments match actual names in function prototypes
 * remove obsolete reference to "do_apply"
 * replace "hashing table" with "hash table"

Signed-off-by: Robert P. J. Day 

---

  compile-tested, should be no functional changes.

diff --git a/include/search.h b/include/search.h
index 343dbc3..402dfd8 100644
--- a/include/search.h
+++ b/include/search.h
@@ -12,8 +12,8 @@
  * Copyright (C) 2010-2013 Wolfgang Denk 
  */

-#ifndef _SEARCH_H
-#define_SEARCH_H 1
+#ifndef _SEARCH_H_
+#define _SEARCH_H_

 #include 

@@ -25,7 +25,7 @@ enum env_op {
env_op_overwrite,
 };

-/* Action which shall be performed in the call the hsearch.  */
+/* Action which shall be performed in the call to hsearch.  */
 typedef enum {
FIND,
ENTER
@@ -45,7 +45,7 @@ struct _ENTRY;
 /*
  * Family of hash table handling functions.  The functions also
  * have reentrant counterparts ending with _r.  The non-reentrant
- * functions all work on a signle internal hashing table.
+ * functions all work on a single internal hash table.
  */

 /* Data type for reentrant functions.  */
@@ -55,38 +55,38 @@ struct hsearch_data {
unsigned int filled;
 /*
  * Callback function which will check whether the given change for variable
- * "item" to "newval" may be applied or not, and possibly apply such change.
+ * "__item" to "newval" may be applied or not, and possibly apply such change.
  * When (flag & H_FORCE) is set, it shall not print out any error message and
  * shall force overwriting of write-once variables.
-.* Must return 0 for approval, 1 for denial.
+ * Must return 0 for approval, 1 for denial.
  */
int (*change_ok)(const ENTRY *__item, const char *newval, enum env_op,
int flag);
 };

-/* Create a new hashing table which will at most contain NEL elements.  */
+/* Create a new hash table which will contain at most "__nel" elements.  */
 extern int hcreate_r(size_t __nel, struct hsearch_data *__htab);

-/* Destroy current internal hashing table.  */
+/* Destroy current internal hash table.  */
 extern void hdestroy_r(struct hsearch_data *__htab);

 /*
- * Search for entry matching ITEM.key in internal hash table.  If
+ * Search for entry matching __item.key in internal hash table.  If
  * ACTION is `FIND' return found entry or signal error by returning
  * NULL.  If ACTION is `ENTER' replace existing data (if any) with
- * ITEM.data.
+ * __item.data.
  * */
 extern int hsearch_r(ENTRY __item, ACTION __action, ENTRY ** __retval,
 struct hsearch_data *__htab, int __flag);

 /*
- * Search for an entry matching `MATCH'.  Otherwise, Same semantics
+ * Search for an entry matching "__match".  Otherwise, Same semantics
  * as hsearch_r().
  */
 extern int hmatch_r(const char *__match, int __last_idx, ENTRY ** __retval,
struct hsearch_data *__htab);

-/* Search and delete entry matching ITEM.key in internal hash table. */
+/* Search and delete entry matching "__key" in internal hash table. */
 extern int hdelete_r(const char *__key, struct hsearch_data *__htab,
 int __flag);

@@ -97,8 +97,6 @@ extern ssize_t hexport_r(struct hsearch_data *__htab,
 /*
  * nvars: length of vars array
  * vars: array of strings (variable names) to import (nvars == 0 means all)
- * do_apply: whether to call callback function to check the new argument,
- * and possibly apply changes (false means accept everything)
  */
 extern int himport_r(struct hsearch_data *__htab,
 const char *__env, size_t __size, const char __sep,
@@ -123,4 +121,4 @@ extern int hwalk_r(struct hsearch_data *__htab, int 
(*callback)(ENTRY *));
 #define H_PROGRAMMATIC (1 << 9) /* indicate that an import is from setenv() */
 #define H_ORIGIN_FLAGS (H_INTERACTIVE | H_PROGRAMMATIC)

-#endif /* search.h */
+#endif /* _SEARCH_H_ */


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


[U-Boot] [PATCH v6 2/2] armv8: fsl-layerscape: SMP support for loading 32-bit OS

2016-09-09 Thread Alison Wang
Spin-table method is used for secondary cores to load 32-bit OS. The
architecture information will be got through checking FIT image and
saved in the os_arch element of spin-table, then the secondary cores
will check os_arch and jump to 32-bit OS or 64-bit OS automatically.

Signed-off-by: Alison Wang 
Signed-off-by: Chenhui Zhao 
---
Changes in v6:
- Make secondary_switch_to_el1() always jump to ep when switching to AArch64 or 
AArch32 modes.

Changes in v5:
- Make secondary_switch_to_el2() always jump to ep when switching to AArch64 or 
AArch32 modes.

Changes in v4:
- Omit arch and ftaddr arguments.

Changes in v3:
- Adjust the arguments for armv8_switch_to_el2_m and armv8_switch_to_el1_m. 

Changes in v2:
- Support to call armv8_switch_to_el2_m and armv8_switch_to_el1_m.

 arch/arm/cpu/armv8/fsl-layerscape/lowlevel.S  | 61 ++-
 arch/arm/cpu/armv8/fsl-layerscape/mp.c| 10 +
 arch/arm/include/asm/arch-fsl-layerscape/mp.h |  6 +++
 arch/arm/lib/bootm.c  |  6 +++
 4 files changed, 73 insertions(+), 10 deletions(-)

diff --git a/arch/arm/cpu/armv8/fsl-layerscape/lowlevel.S 
b/arch/arm/cpu/armv8/fsl-layerscape/lowlevel.S
index 5af6b73..782a1ea 100644
--- a/arch/arm/cpu/armv8/fsl-layerscape/lowlevel.S
+++ b/arch/arm/cpu/armv8/fsl-layerscape/lowlevel.S
@@ -13,6 +13,7 @@
 #ifdef CONFIG_MP
 #include 
 #endif
+#include 
 
 ENTRY(lowlevel_init)
mov x29, lr /* Save LR */
@@ -324,11 +325,6 @@ ENTRY(secondary_boot_func)
 gic_wait_for_interrupt_m x0, w1
 #endif
 
-   bl secondary_switch_to_el2
-#ifdef CONFIG_ARMV8_SWITCH_TO_EL1
-   bl secondary_switch_to_el1
-#endif
-
 slave_cpu:
wfe
ldr x0, [x11]
@@ -341,19 +337,64 @@ slave_cpu:
tbz x1, #25, cpu_is_le
rev x0, x0  /* BE to LE conversion */
 cpu_is_le:
-   br  x0  /* branch to the given address */
+   ldr x5, [x11, #24]
+   ldr x6, =IH_ARCH_DEFAULT
+   cmp x6, x5
+   b.eq1f
+
+#ifdef CONFIG_ARMV8_SWITCH_TO_EL1
+   adr x3, secondary_switch_to_el1
+   ldr x4, =ES_TO_AARCH64
+#else
+   ldr x3, [x11]
+   ldr x4, =ES_TO_AARCH32
+#endif
+   bl  secondary_switch_to_el2
+
+1:
+#ifdef CONFIG_ARMV8_SWITCH_TO_EL1
+   adr x3, secondary_switch_to_el1
+#else
+   ldr x3, [x11]
+#endif
+   ldr x4, =ES_TO_AARCH64
+   bl  secondary_switch_to_el2
+
 ENDPROC(secondary_boot_func)
 
 ENTRY(secondary_switch_to_el2)
-   switch_el x0, 1f, 0f, 0f
+   switch_el x5, 1f, 0f, 0f
 0: ret
-1: armv8_switch_to_el2_m x0
+1: armv8_switch_to_el2_m x3, x4, x5
 ENDPROC(secondary_switch_to_el2)
 
 ENTRY(secondary_switch_to_el1)
-   switch_el x0, 0f, 1f, 0f
+   mrs x0, mpidr_el1
+   ubfmx1, x0, #8, #15
+   ubfmx2, x0, #0, #1
+   orr x10, x2, x1, lsl #2 /* x10 has LPID */
+
+   lsl x1, x10, #6
+   ldr x0, =__spin_table
+   /* physical address of this cpus spin table element */
+   add x11, x1, x0
+
+   ldr x3, [x11]
+
+   ldr x5, [x11, #24]
+   ldr x6, =IH_ARCH_DEFAULT
+   cmp x6, x5
+   b.eq2f
+
+   ldr x4, =ES_TO_AARCH32
+   bl  switch_to_el1
+
+2: ldr x4, =ES_TO_AARCH64
+
+switch_to_el1:
+   switch_el x5, 0f, 1f, 0f
 0: ret
-1: armv8_switch_to_el1_m x0, x1
+1: armv8_switch_to_el1_m x3, x4, x5
 ENDPROC(secondary_switch_to_el1)
 
/* Ensure that the literals used by the secondary boot code are
diff --git a/arch/arm/cpu/armv8/fsl-layerscape/mp.c 
b/arch/arm/cpu/armv8/fsl-layerscape/mp.c
index df7ffb8..dd91550 100644
--- a/arch/arm/cpu/armv8/fsl-layerscape/mp.c
+++ b/arch/arm/cpu/armv8/fsl-layerscape/mp.c
@@ -22,6 +22,16 @@ phys_addr_t determine_mp_bootpg(void)
return (phys_addr_t)&secondary_boot_code;
 }
 
+void update_os_arch_secondary_cores(uint8_t os_arch)
+{
+   u64 *table = get_spin_tbl_addr();
+   int i;
+
+   for (i = 1; i < CONFIG_MAX_CPUS; i++)
+   table[i * WORDS_PER_SPIN_TABLE_ENTRY +
+   SPIN_TABLE_ELEM_OS_ARCH_IDX] = os_arch;
+}
+
 int fsl_layerscape_wake_seconday_cores(void)
 {
struct ccsr_gur __iomem *gur = (void *)(CONFIG_SYS_FSL_GUTS_ADDR);
diff --git a/arch/arm/include/asm/arch-fsl-layerscape/mp.h 
b/arch/arm/include/asm/arch-fsl-layerscape/mp.h
index e46e076..55f0e0c 100644
--- a/arch/arm/include/asm/arch-fsl-layerscape/mp.h
+++ b/arch/arm/include/asm/arch-fsl-layerscape/mp.h
@@ -13,6 +13,7 @@
 *  uint64_t entry_addr;
 *  uint64_t status;
 *  uint64_t lpid;
+*  uint64_t os_arch;
 * };
 * we pad this struct to 64 bytes so each entry is in its own cacheline
 * the actual spin table is an array of these structures
@@ -20,6 +21,7 @@
 #define SPIN_TABLE_ELEM_ENTRY_ADDR_IDX 0
 #define SPIN_TABLE_ELEM_STATUS_IDX 1
 #define SPIN_TABLE_ELEM_LPID_IDX   2
+#d

Re: [U-Boot] "_ENTRY" is both a struct and a typedef?

2016-09-09 Thread Måns Rullgård
 writes:

>> "Robert" == Robert P J Day  writes:
>
> Robert>   from lib/hashtable.c:
>
> Robert>   typedef struct _ENTRY { int used; ENTRY entry; } _ENTRY;
>
> Robert> ok, that's just kind of creepy ... defining a typedef over top
> Robert> of a struct of the same name. does anyone else find that
> Robert> strange?
>
> It's standard practice in some C styles.  Personally I'd delete the
> struct tag, as the typedef should be used everywhere instead.

I'd rather drop the typedef.  The struct/typedef is only referenced by
name in two places.

First in include/search.h:

/* Opaque type for internal use.  */
struct _ENTRY;
[...]
/* Data type for reentrant functions.  */
struct hsearch_data {
struct _ENTRY *table;

It is standard practice to use "struct foo" in such constructs.

The second use is further down in lib/hashtable.c:

htab->table = (_ENTRY *) calloc(htab->size + 1, sizeof(_ENTRY));

This line is terrible for two reasons:
1. Type-casting the return value of calloc is always wrong.
2. It is safer to use sizeof(*htab->table) instead of an explicit type.

If someone *really* wants to "fix" this, the proper thing is to drop the
typedef and rewrite the calloc line to not explicitly mention the type.

Then again, this is code borrowed from uclibc/glibc, so perhaps it's
best to simply leave it alone.

-- 
Måns Rullgård
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 1/1] cmd: Rework disk.c usage

2016-09-09 Thread Tom Rini
We only need the function found in cmd/disk.c when we have IDE, SCSI or
USB_STORAGE enabled.  While the first two are easy to get right, in the
3rd case we assume that the set of cases where we do have USB and do not
enable USB_STORAGE are small enough that we can take the small bloat of
un-discarded strings on gcc prior to 6.x

Signed-off-by: Tom Rini 
---
This gives us back ~144 bytes in SPL on many boards and adds ~120 bytes on
xfi3, sansa_fuze_plus, smartweb, eco5pk and p2771--500 in U-Boot itself.

 cmd/Makefile | 7 +++
 cmd/disk.c   | 3 ---
 2 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/cmd/Makefile b/cmd/Makefile
index a1ecf73ef314..81b98ee0d751 100644
--- a/cmd/Makefile
+++ b/cmd/Makefile
@@ -70,7 +70,7 @@ obj-$(CONFIG_CMD_GPIO) += gpio.o
 obj-$(CONFIG_CMD_I2C) += i2c.o
 obj-$(CONFIG_CMD_IOTRACE) += iotrace.o
 obj-$(CONFIG_CMD_HASH) += hash.o
-obj-$(CONFIG_CMD_IDE) += ide.o
+obj-$(CONFIG_CMD_IDE) += ide.o disk.o
 obj-$(CONFIG_CMD_IMMAP) += immap.o
 obj-$(CONFIG_CMD_INI) += ini.o
 obj-$(CONFIG_CMD_IRQ) += irq.o
@@ -115,7 +115,7 @@ obj-$(CONFIG_CMD_REMOTEPROC) += remoteproc.o
 obj-$(CONFIG_SANDBOX) += host.o
 obj-$(CONFIG_CMD_SATA) += sata.o
 obj-$(CONFIG_CMD_SF) += sf.o
-obj-$(CONFIG_SCSI) += scsi.o
+obj-$(CONFIG_SCSI) += scsi.o disk.o
 obj-$(CONFIG_CMD_SHA1SUM) += sha1sum.o
 obj-$(CONFIG_CMD_SETEXPR) += setexpr.o
 obj-$(CONFIG_CMD_SOFTSWITCH) += softswitch.o
@@ -137,7 +137,7 @@ ifdef CONFIG_LZMA
 obj-$(CONFIG_CMD_LZMADEC) += lzmadec.o
 endif
 
-obj-$(CONFIG_CMD_USB) += usb.o
+obj-$(CONFIG_CMD_USB) += usb.o disk.o
 obj-$(CONFIG_CMD_FASTBOOT) += fastboot.o
 obj-$(CONFIG_CMD_FS_UUID) += fs_uuid.o
 
@@ -162,4 +162,3 @@ obj-$(CONFIG_CMD_BLOB) += blob.o
 
 # core command
 obj-y += nvedit.o
-obj-y += disk.o
diff --git a/cmd/disk.c b/cmd/disk.c
index 92de3af8a5c0..3d2a3d22045b 100644
--- a/cmd/disk.c
+++ b/cmd/disk.c
@@ -8,8 +8,6 @@
 #include 
 #include 
 
-#if defined(CONFIG_CMD_IDE) || defined(CONFIG_SCSI) || \
-   defined(CONFIG_USB_STORAGE)
 int common_diskboot(cmd_tbl_t *cmdtp, const char *intf, int argc,
char *const argv[])
 {
@@ -130,4 +128,3 @@ int common_diskboot(cmd_tbl_t *cmdtp, const char *intf, int 
argc,
 
return bootm_maybe_autostart(cmdtp, argv[0]);
 }
-#endif
-- 
1.9.1

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


Re: [U-Boot] [PULL] Resend: Please pull u-boot-imx

2016-09-09 Thread Fabio Estevam
Hi Tom,

On Wed, Sep 7, 2016 at 2:57 PM, Tom Rini  wrote:

> Applied to u-boot/master, thanks!

Still don't appear at http://git.denx.de/?p=u-boot.git;a=summary
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] pedantry: is a FIT image really an enhanced type of uImage?

2016-09-09 Thread Robert P. J. Day

  a matter of picky terminology, but i'm reading the docs on FIT
images, and in doc/uImage.FIT/source_file_format.txt, early on, i
read:

  "U-Boot new uImage source file format (bindings definition)
  ...
  This document defines new uImage structure ..."

and so on and so on ... a number of references that appear to describe
FIT images as newer and enhanced types of uImage.

  but i understood that the proper definition of uImage is the
"legacy" form for u-boot, and there are now alternates such as zImage
and, yes, FIT images.

  the man page for "mkimage" reads:

  SYNOPSIS
   mkimage -l [uimage file name]

   mkimage [options] -f [image tree source file] [uimage file name]

   mkimage [options] -F [uimage file name]

   mkimage [options] (legacy mode)

and further down reads:

  OPTIONS
   List image information:

   -l [uimage file name]
  mkimage lists the information contained in the header of an 
existing U-Boot image.

   Create old legacy image:

   ... snip ...

   Create FIT image:

   ... snip ...

and that latter part seems to suggest that FIT images are *distinct*
from the legacy images.

  so what is the technically proper way to describe a FIT image? just
another type of uImage? or a wholly new type of image?

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


[U-Boot] [RFC PATCH] common, kconfig: move VERSION_VARIABLE to Kconfig

2016-09-09 Thread Heiko Schocher
move VERSION_VARIABLE from board config file into a
Kconfig option.

Signed-off-by: Heiko Schocher 
---

Tested with tbot:
http://lists.denx.de/pipermail/u-boot/2016-June/258119.html

result from first run:
Boards  : 1193
compile err : 60
not checked : 1
U-Boot good : 1129 bad 3
SPL good: 411 bad 0
('compile err :', [...]
('not checked :', ['xtfpga'])
('bad :', ['sandbox', 'sandbox_noblk', 'sandbox_spl'])

The 3 bad boards are the sandbox builds, I must find time
to find out, why the sandbox build is not reproducible ...

I had a toolchain issue with arm64 build, fixed now, result
for the second run (only for the boards which had compile
errors before):
Boards  : 60
compile err : 8
not checked : 0
U-Boot good : 52 bad 0
SPL good: 16 bad 0
('compile err :', ['bf533-stamp', 'cm-bf527', 'colibri_pxa270', 'omap4_panda', 
'openrisc-generic', 'smdk5250', 'snow', 'spring'])

So, this patch does not change the resulting binaries ...

One remark:
define CONFIG_SPL_NET_VCI_STRING="..." is removed from
some defconfigs, but not again added to the defconfig.
This is for all boards, which use this define ... but as
the resulting images are not changes, this seems no
problem... This is the reason for the "RFC" state ...
any comments?


 common/Kconfig | 10 +
 configs/10m50_defconfig|  5 +++--
 configs/3c120_defconfig|  5 +++--
 configs/CPCI2DP_defconfig  |  1 +
 configs/CPCI4052_defconfig |  1 +
 configs/MigoR_defconfig|  1 +
 configs/PLU405_defconfig   |  1 +
 configs/PMC405DE_defconfig |  1 +
 configs/PMC440_defconfig   |  1 +
 configs/VOM405_defconfig   |  1 +
 configs/acadia_defconfig   |  1 +
 configs/alt_defconfig  |  3 ++-
 configs/am335x_baltos_defconfig|  1 +
 configs/am335x_boneblack_defconfig |  1 +
 configs/am335x_boneblack_vboot_defconfig   |  3 ++-
 configs/am335x_evm_defconfig   | 11 +-
 configs/am335x_evm_nor_defconfig   |  2 +-
 configs/am335x_evm_norboot_defconfig   |  4 ++--
 configs/am335x_evm_spiboot_defconfig   |  1 +
 configs/am335x_evm_usbspl_defconfig|  2 +-
 configs/am335x_igep0033_defconfig  |  1 +
 configs/am335x_shc_defconfig   |  1 +
 configs/am335x_shc_ict_defconfig   |  1 +
 configs/am335x_shc_netboot_defconfig   |  1 +
 configs/am335x_shc_prompt_defconfig|  1 +
 configs/am335x_shc_sdboot_defconfig|  1 +
 configs/am335x_shc_sdboot_prompt_defconfig |  1 +
 configs/am335x_sl50_defconfig  |  1 +
 configs/am3517_evm_defconfig   |  1 +
 configs/am43xx_evm_defconfig   | 11 +-
 configs/am43xx_evm_ethboot_defconfig   |  2 +-
 configs/am43xx_evm_qspiboot_defconfig  |  1 +
 configs/am43xx_evm_usbhost_boot_defconfig  | 15 +++---
 configs/am43xx_hs_evm_defconfig| 13 ++--
 configs/am57xx_evm_defconfig   | 25 +++---
 configs/am57xx_evm_nodt_defconfig  | 11 +-
 configs/am57xx_hs_evm_defconfig| 28 -
 configs/ap325rxa_defconfig |  1 +
 configs/ap_sh4a_4a_defconfig   |  1 +
 configs/apf27_defconfig|  1 +
 configs/apx4devkit_defconfig   |  1 +
 configs/arches_defconfig   |  1 +
 configs/armadillo-800eva_defconfig |  1 +
 configs/bamboo_defconfig   |  1 +
 configs/bcm11130_defconfig |  1 +
 configs/bcm11130_nand_defconfig|  1 +
 configs/bcm23550_w1d_defconfig |  1 +
 configs/bcm28155_ap_defconfig  |  1 +
 configs/bcm28155_w1d_defconfig |  1 +
 configs/bcm911360_entphn-ns_defconfig  |  1 +
 configs/bcm911360_entphn_defconfig |  1 +
 configs/bcm911360k_defconfig   |  1 +
 configs/bcm958300k-ns_defconfig|  1 +
 configs/bcm958300k_defconfig   |  1 +
 configs/bcm958305k_defconfig   |  1 +
 configs/bcm958622hr_defconfig  |  1 +
 configs/bg0900_defconfig   |  1 +
 configs/birdland_bav335a_defconfig |  2 +-
 configs/birdland_bav335b_defconfig |  2 +-
 configs/blanche_defconfig  |  1 +
 configs/brppt1_mmc_defconfig   |  1 +
 configs/brppt1_nand_defconfig  |  1 +
 configs/brppt1_spi_defconfig   |  1 +
 configs/brxre1_defconfig   |  1 +
 configs/bubinga_defconfig  |  1 +
 configs/cairo_defconfig|  1 +
 configs/calimain_defconfig |  1 +
 configs/canyonlands_defconfig  |  1 +
 configs/cm_t335_defconfig  |  1 +
 configs/cm_t43_defconfig   |  5 +++--
 configs/cm_t54_defconfig   

[U-Boot] [PATCH] armv8/fsl-layerscape: print SoC revsion number

2016-09-09 Thread Wenbin song
The exact SoC revsion number can be recognized from U-Boot log.

Signed-off-by: Wenbin Song 
Signed-off-by: Mingkai Hu 
---
 arch/arm/cpu/armv8/fsl-layerscape/cpu.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/cpu/armv8/fsl-layerscape/cpu.c 
b/arch/arm/cpu/armv8/fsl-layerscape/cpu.c
index 340d9f9..5cada6d 100644
--- a/arch/arm/cpu/armv8/fsl-layerscape/cpu.c
+++ b/arch/arm/cpu/armv8/fsl-layerscape/cpu.c
@@ -40,6 +40,8 @@ void cpu_name(char *name)
for (i = 0; i < ARRAY_SIZE(cpu_type_list); i++)
if ((cpu_type_list[i].soc_ver & SVR_WO_E) == ver) {
strcpy(name, cpu_type_list[i].name);
+   sprintf(name + strlen(name), " Rev%d.%d\n",
+   SVR_MAJ(svr), SVR_MIN(svr));
 
if (IS_E_PROCESSOR(svr))
strcat(name, "E");
-- 
2.1.0.27.g96db324

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


[U-Boot] Sdcard boot for a generic allwinner q8 clone A33 tablet not work.

2016-09-09 Thread far5893

Hi,
i'm trying to boot a classic A33 q8 clone with uboot copied in sdcard
but nothing happen (not backlight on)

dd if=u-boot-sunxi-with-spl.bin of=/dev/sdb bs=1024 seek=8 on the partitioned 
sdcard for reference

if i compile with configuration for  A13 based tablet   on A13 based tablet  it 
work like charm,
so i suppose i'm not in wrong in my setup, how can i debug  ?

I dont have sd/usart adapter so i cannot boot from fel, there is a way
to make blink backlight to understand if it is working and is an lcd problem ?

On original android it work perfectly.

I attach original fex and .configure for your references.

Thank



#
# Automatically generated file; DO NOT EDIT.
# U-Boot 2016.09-rc2 Configuration
#
CONFIG_CREATE_ARCH_SYMLINK=y
# CONFIG_ARC is not set
CONFIG_ARM=y
# CONFIG_AVR32 is not set
# CONFIG_BLACKFIN is not set
# CONFIG_M68K is not set
# CONFIG_MICROBLAZE is not set
# CONFIG_MIPS is not set
# CONFIG_NDS32 is not set
# CONFIG_NIOS2 is not set
# CONFIG_OPENRISC is not set
# CONFIG_PPC is not set
# CONFIG_SANDBOX is not set
# CONFIG_SH is not set
# CONFIG_SPARC is not set
# CONFIG_X86 is not set
# CONFIG_XTENSA is not set
CONFIG_SYS_ARCH="arm"
CONFIG_SYS_CPU="armv7"
CONFIG_SYS_SOC="sunxi"
CONFIG_SYS_BOARD="sunxi"
CONFIG_SYS_CONFIG_NAME="sun8i"

#
# ARM architecture
#
CONFIG_HAS_VBAR=y
CONFIG_HAS_THUMB2=y
CONFIG_CPU_V7=y
CONFIG_SYS_ARM_ARCH=7
# CONFIG_SEMIHOSTING is not set
# CONFIG_SYS_L2CACHE_OFF is not set
# CONFIG_ENABLE_ARM_SOC_BOOT0_HOOK is not set
# CONFIG_ARCH_AT91 is not set
# CONFIG_TARGET_EDB93XX is not set
# CONFIG_TARGET_VCMA9 is not set
# CONFIG_TARGET_SMDK2410 is not set
# CONFIG_TARGET_ASPENITE is not set
# CONFIG_TARGET_GPLUGD is not set
# CONFIG_ARCH_DAVINCI is not set
# CONFIG_KIRKWOOD is not set
# CONFIG_ARCH_MVEBU is not set
# CONFIG_TARGET_DEVKIT3250 is not set
# CONFIG_TARGET_WORK_92105 is not set
# CONFIG_TARGET_MX25PDK is not set
# CONFIG_TARGET_ZMX25 is not set
# CONFIG_TARGET_APF27 is not set
# CONFIG_TARGET_APX4DEVKIT is not set
# CONFIG_TARGET_XFI3 is not set
# CONFIG_TARGET_M28EVK is not set
# CONFIG_TARGET_MX23EVK is not set
# CONFIG_TARGET_MX28EVK is not set
# CONFIG_TARGET_MX23_OLINUXINO is not set
# CONFIG_TARGET_BG0900 is not set
# CONFIG_TARGET_SANSA_FUZE_PLUS is not set
# CONFIG_TARGET_SC_SPS_1 is not set
# CONFIG_ORION5X is not set
# CONFIG_TARGET_SPEAR300 is not set
# CONFIG_TARGET_SPEAR310 is not set
# CONFIG_TARGET_SPEAR320 is not set
# CONFIG_TARGET_SPEAR600 is not set
# CONFIG_TARGET_STV0991 is not set
# CONFIG_TARGET_X600 is not set
# CONFIG_TARGET_IMX31_PHYCORE is not set
# CONFIG_TARGET_MX31ADS is not set
# CONFIG_TARGET_MX31PDK is not set
# CONFIG_TARGET_WOODBURN is not set
# CONFIG_TARGET_WOODBURN_SD is not set
# CONFIG_TARGET_FLEA3 is not set
# CONFIG_TARGET_MX35PDK is not set
# CONFIG_ARCH_BCM283X is not set
# CONFIG_TARGET_VEXPRESS_CA15_TC2 is not set
# CONFIG_TARGET_VEXPRESS_CA5X2 is not set
# CONFIG_TARGET_VEXPRESS_CA9X4 is not set
# CONFIG_TARGET_BRXRE1 is not set
# CONFIG_TARGET_BRPPT1 is not set
# CONFIG_TARGET_CM_T335 is not set
# CONFIG_TARGET_PEPPER is not set
# CONFIG_TARGET_AM335X_IGEP0033 is not set
# CONFIG_TARGET_PCM051 is not set
# CONFIG_TARGET_DRACO is not set
# CONFIG_TARGET_THUBAN is not set
# CONFIG_TARGET_RASTABAN is not set
# CONFIG_TARGET_ETAMIN is not set
# CONFIG_TARGET_PXM2 is not set
# CONFIG_TARGET_RUT is not set
# CONFIG_TARGET_PENGWYN is not set
# CONFIG_TARGET_AM335X_BALTOS is not set
# CONFIG_TARGET_AM335X_EVM is not set
# CONFIG_TARGET_AM335X_SHC is not set
# CONFIG_TARGET_AM335X_SL50 is not set
# CONFIG_TARGET_BAV335X is not set
# CONFIG_TARGET_TI814X_EVM is not set
# CONFIG_TARGET_TI816X_EVM is not set
# CONFIG_TARGET_BCM23550_W1D is not set
# CONFIG_TARGET_BCM28155_AP is not set
# CONFIG_TARGET_BCMCYGNUS is not set
# CONFIG_TARGET_BCMNSP is not set
# CONFIG_ARCH_EXYNOS is not set
# CONFIG_ARCH_S5PC1XX is not set
# CONFIG_ARCH_HIGHBANK is not set
# CONFIG_ARCH_INTEGRATOR is not set
# CONFIG_ARCH_KEYSTONE is not set
# CONFIG_ARCH_MESON is not set
# CONFIG_ARCH_MX7 is not set
# CONFIG_ARCH_MX6 is not set
# CONFIG_ARCH_MX5 is not set
# CONFIG_TARGET_M53EVK is not set
# CONFIG_TARGET_MX51EVK is not set
# CONFIG_TARGET_MX53ARD is not set
# CONFIG_TARGET_MX53EVK is not set
# CONFIG_TARGET_MX53LOCO is not set
# CONFIG_TARGET_MX53SMD is not set
# CONFIG_OMAP34XX is not set
# CONFIG_OMAP44XX is not set
# CONFIG_OMAP54XX is not set
# CONFIG_AM43XX is not set
# CONFIG_ARCH_RMOBILE is not set
# CONFIG_TARGET_S32V234EVB is not set
# CONFIG_ARCH_SNAPDRAGON is not set
# CONFIG_ARCH_SOCFPGA is not set
# CONFIG_TARGET_CM_T43 is not set
CONFIG_ARCH_SUNXI=y
# CONFIG_TARGET_TS4800 is not set
# CONFIG_TARGET_VF610TWR is not set
# CONFIG_TARGET_COLIBRI_VF is not set
# CONFIG_TARGET_PCM052 is not set
# CONFIG_ARCH_ZYNQ is not set
# CONFIG_ARCH_ZYNQMP is not set
# CONFIG_TEGRA is not set
# CONFIG_TARGET_VEXPRESS64_AEMV8A is not set
# CONFIG_TARGET_VEXPRESS64_BASE_FVP is not set
# CONFIG_TARGET_VEXPRESS64_BASE_FVP_DRAM is not set
# CO

Re: [U-Boot] Sdcard boot for a generic allwinner q8 clone A33 tablet not work.

2016-09-09 Thread Hans de Goede

Hi,

On 09-09-16 14:10, far5893 wrote:

Hi,
i'm trying to boot a classic A33 q8 clone with uboot copied in sdcard
but nothing happen (not backlight on)

dd if=u-boot-sunxi-with-spl.bin of=/dev/sdb bs=1024 seek=8 on the partitioned 
sdcard for reference


In my experience the A33 can be a bit picky wrt which sdcards
it will boot from. Sometimes simply doing the dd again will
help, sometimes using a different sdcard will help.

Regards,

Hans






if i compile with configuration for  A13 based tablet   on A13 based tablet  it 
work like charm,
so i suppose i'm not in wrong in my setup, how can i debug  ?

I dont have sd/usart adapter so i cannot boot from fel, there is a way
to make blink backlight to understand if it is working and is an lcd problem ?

On original android it work perfectly.

I attach original fex and .configure for your references.

Thank





___
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] [PATCH v2 00/10] MIPS L2 cache support

2016-09-09 Thread Paul Burton
This series introduces support for initialising & maintaining L2 caches
on MIPS systems. This allows U-Boot to function correctly on systems
where such caches are present, whereas without performing L2 maintenance
it is likely to fail with cache coherence issues when writing code or
performing DMA transfers.

Paul Burton (10):
  board_f: Add a mach_cpu_init callback
  MIPS: ath79: Use mach_cpu_init instead of arch_cpu_init
  MIPS: Probe cache line sizes once during boot
  MIPS: Enable use of the instruction cache earlier
  MIPS: Preserve Config implementation-defined bits
  MIPS: If we don't need DDR for cache init, init cache first
  MIPS: Define register names for cache init
  MIPS: Map CM Global Control Registers
  MIPS: L2 cache support
  MIPS: Malta: Enable CM & L2 support

 arch/mips/Kconfig   |  24 
 arch/mips/cpu/Makefile  |   2 +
 arch/mips/cpu/cm_init.S |  45 +++
 arch/mips/cpu/cpu.c |   7 ++
 arch/mips/cpu/start.S   |  26 +++--
 arch/mips/include/asm/cache.h   |   9 ++
 arch/mips/include/asm/cm.h  |  57 +
 arch/mips/include/asm/global_data.h |   7 ++
 arch/mips/include/asm/mipsregs.h|   6 +
 arch/mips/lib/cache.c   | 101 +---
 arch/mips/lib/cache_init.S  | 226 
 arch/mips/mach-ath79/cpu.c  |   2 +-
 board/imgtec/malta/lowlevel_init.S  |   6 -
 common/board_f.c|   6 +
 14 files changed, 471 insertions(+), 53 deletions(-)
 create mode 100644 arch/mips/cpu/cm_init.S
 create mode 100644 arch/mips/include/asm/cm.h

-- 
2.9.3

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


[U-Boot] [PATCH] rockchip: miniarm: remove eMMC support

2016-09-09 Thread Ziyuan Xu
The latest rk3288-miniarm board doesn't have eMMC device, so remove it.

Signed-off-by: Ziyuan Xu 
---

 arch/arm/dts/rk3288-miniarm.dtsi   | 12 
 board/rockchip/miniarm_rk3288/miniarm-rk3288.c |  8 
 include/configs/miniarm_rk3288.h   |  7 ++-
 3 files changed, 6 insertions(+), 21 deletions(-)

diff --git a/arch/arm/dts/rk3288-miniarm.dtsi b/arch/arm/dts/rk3288-miniarm.dtsi
index b889875..ceb4e2b 100644
--- a/arch/arm/dts/rk3288-miniarm.dtsi
+++ b/arch/arm/dts/rk3288-miniarm.dtsi
@@ -116,18 +116,6 @@
cpu0-supply = <&vdd_cpu>;
 };
 
-&emmc {
-   broken-cd;
-   bus-width = <8>;
-   cap-mmc-highspeed;
-   disable-wp;
-   non-removable;
-   num-slots = <1>;
-   pinctrl-names = "default";
-   pinctrl-0 = <&emmc_clk &emmc_cmd &emmc_pwr &emmc_bus8>;
-   status = "okay";
-};
-
 &sdmmc {
bus-width = <4>;
cap-mmc-highspeed;
diff --git a/board/rockchip/miniarm_rk3288/miniarm-rk3288.c 
b/board/rockchip/miniarm_rk3288/miniarm-rk3288.c
index aad74ef..79541a3 100644
--- a/board/rockchip/miniarm_rk3288/miniarm-rk3288.c
+++ b/board/rockchip/miniarm_rk3288/miniarm-rk3288.c
@@ -5,11 +5,3 @@
  */
 
 #include 
-#include 
-
-void board_boot_order(u32 *spl_boot_list)
-{
-   /* eMMC prior to sdcard */
-   spl_boot_list[0] = BOOT_DEVICE_MMC2;
-   spl_boot_list[1] = BOOT_DEVICE_MMC1;
-}
diff --git a/include/configs/miniarm_rk3288.h b/include/configs/miniarm_rk3288.h
index 342557f..4f251cc 100644
--- a/include/configs/miniarm_rk3288.h
+++ b/include/configs/miniarm_rk3288.h
@@ -12,8 +12,13 @@
 
 #define CONFIG_SPL_MMC_SUPPORT
 
+#undef BOOT_TARGET_DEVICES
+
+#define BOOT_TARGET_DEVICES(func) \
+   func(MMC, mmc, 0)
+
 #define CONFIG_ENV_IS_IN_MMC
-#define CONFIG_SYS_MMC_ENV_DEV 1
+#define CONFIG_SYS_MMC_ENV_DEV 0
 /* SPL @ 32k for ~36k
  * ENV @ 96k
  * u-boot @ 128K
-- 
2.9.2


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


[U-Boot] [PATCH v2 01/10] board_f: Add a mach_cpu_init callback

2016-09-09 Thread Paul Burton
Currently we have a mismash of architectures which use arch_cpu_init
from architecture-wide code (arc, avr32, blackfin, mips, nios2, xtensa)
and architectures which use arch_cpu_init from machine/SoC level code
(arm, x86).

In order to clean this mess up & allow for both use cases, introduce a
new mach_cpu_init callback which is run immediately after arch_cpu_init.
This will allow for architectures to have arch-wide code without needing
individual machines to all implement their own arch_cpu_init with a call
to some common function.

Signed-off-by: Paul Burton 

---

Changes in v2:
- Use a weak function, make it generic not MIPS-specific

 common/board_f.c | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/common/board_f.c b/common/board_f.c
index da381db..9ef998f 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -290,6 +290,11 @@ __weak int arch_cpu_init(void)
return 0;
 }
 
+__weak int mach_cpu_init(void)
+{
+   return 0;
+}
+
 #ifdef CONFIG_SANDBOX
 static int setup_ram_buf(void)
 {
@@ -860,6 +865,7 @@ static init_fnc_t init_sequence_f[] = {
x86_fsp_init,
 #endif
arch_cpu_init,  /* basic arch cpu dependent setup */
+   mach_cpu_init,  /* SoC/machine dependent CPU setup */
initf_dm,
arch_cpu_init_dm,
mark_bootstage, /* need timer, go after init dm */
-- 
2.9.3

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


[U-Boot] [PATCH v2 02/10] MIPS: ath79: Use mach_cpu_init instead of arch_cpu_init

2016-09-09 Thread Paul Burton
In order to prepare for MIPS arch code making use of arch_cpu_init in a
later patch, stop using it from ath79 SoC code & instead use the new
mach_cpu_init which is provided for this purpose.

Signed-off-by: Paul Burton 

---

Changes in v2:
- Rebase atop changes in patch 1

 arch/mips/mach-ath79/cpu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/mips/mach-ath79/cpu.c b/arch/mips/mach-ath79/cpu.c
index 5756a06..4ef5092 100644
--- a/arch/mips/mach-ath79/cpu.c
+++ b/arch/mips/mach-ath79/cpu.c
@@ -46,7 +46,7 @@ static const struct ath79_soc_desc desc[] = {
{ATH79_SOC_QCA9561, "9561", REV_ID_MAJOR_QCA9561,   0},
 };
 
-int arch_cpu_init(void)
+int mach_cpu_init(void)
 {
void __iomem *base;
enum ath79_soc_type soc = ATH79_SOC_UNKNOWN;
-- 
2.9.3

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


[U-Boot] [PATCH v2 03/10] MIPS: Probe cache line sizes once during boot

2016-09-09 Thread Paul Burton
Rather than probing the cache line sizes on every call of any cache
maintenance function, probe them once during boot & store the values in
the global data structure for later use. This will reduce the overhead
of the cache maintenance functions, which isn't a big deal yet but
becomes more important once L2 caches which may expose their properties
via coprocessor 2 or the CM are supported.

Signed-off-by: Paul Burton 
---

Changes in v2: None

 arch/mips/cpu/cpu.c |  7 ++
 arch/mips/include/asm/cache.h   |  9 
 arch/mips/include/asm/global_data.h |  4 
 arch/mips/lib/cache.c   | 43 +
 4 files changed, 45 insertions(+), 18 deletions(-)

diff --git a/arch/mips/cpu/cpu.c b/arch/mips/cpu/cpu.c
index 391feb3..1b919ed 100644
--- a/arch/mips/cpu/cpu.c
+++ b/arch/mips/cpu/cpu.c
@@ -8,6 +8,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -35,3 +36,9 @@ void write_one_tlb(int index, u32 pagemask, u32 hi, u32 low0, 
u32 low1)
write_c0_index(index);
tlb_write_indexed();
 }
+
+int arch_cpu_init(void)
+{
+   mips_cache_probe();
+   return 0;
+}
diff --git a/arch/mips/include/asm/cache.h b/arch/mips/include/asm/cache.h
index 0cea581..669c362 100644
--- a/arch/mips/include/asm/cache.h
+++ b/arch/mips/include/asm/cache.h
@@ -19,4 +19,13 @@
  */
 #define CONFIG_SYS_CACHELINE_SIZE ARCH_DMA_MINALIGN
 
+/**
+ * mips_cache_probe() - Probe the properties of the caches
+ *
+ * Call this to probe the properties such as line sizes of the caches
+ * present in the system, if any. This must be done before cache maintenance
+ * functions such as flush_cache may be called.
+ */
+void mips_cache_probe(void);
+
 #endif /* __MIPS_CACHE_H__ */
diff --git a/arch/mips/include/asm/global_data.h 
b/arch/mips/include/asm/global_data.h
index 37f8ed5..8533b69 100644
--- a/arch/mips/include/asm/global_data.h
+++ b/arch/mips/include/asm/global_data.h
@@ -21,6 +21,10 @@ struct arch_global_data {
unsigned long rev;
unsigned long ver;
 #endif
+#ifdef CONFIG_SYS_CACHE_SIZE_AUTO
+   unsigned short l1i_line_size;
+   unsigned short l1d_line_size;
+#endif
 };
 
 #include 
diff --git a/arch/mips/lib/cache.c b/arch/mips/lib/cache.c
index db81953..d8baf08 100644
--- a/arch/mips/lib/cache.c
+++ b/arch/mips/lib/cache.c
@@ -9,32 +9,39 @@
 #include 
 #include 
 
-static inline unsigned long icache_line_size(void)
-{
-   unsigned long conf1, il;
+DECLARE_GLOBAL_DATA_PTR;
 
-   if (!config_enabled(CONFIG_SYS_CACHE_SIZE_AUTO))
-   return CONFIG_SYS_ICACHE_LINE_SIZE;
+void mips_cache_probe(void)
+{
+#ifdef CONFIG_SYS_CACHE_SIZE_AUTO
+   unsigned long conf1, il, dl;
 
conf1 = read_c0_config1();
+
il = (conf1 & MIPS_CONF1_IL) >> MIPS_CONF1_IL_SHF;
-   if (!il)
-   return 0;
-   return 2 << il;
+   dl = (conf1 & MIPS_CONF1_DL) >> MIPS_CONF1_DL_SHF;
+
+   gd->arch.l1i_line_size = il ? (2 << il) : 0;
+   gd->arch.l1d_line_size = dl ? (2 << dl) : 0;
+#endif
 }
 
-static inline unsigned long dcache_line_size(void)
+static inline unsigned long icache_line_size(void)
 {
-   unsigned long conf1, dl;
-
-   if (!config_enabled(CONFIG_SYS_CACHE_SIZE_AUTO))
-   return CONFIG_SYS_DCACHE_LINE_SIZE;
+#ifdef CONFIG_SYS_CACHE_SIZE_AUTO
+   return gd->arch.l1i_line_size;
+#else
+   return CONFIG_SYS_ICACHE_LINE_SIZE;
+#endif
+}
 
-   conf1 = read_c0_config1();
-   dl = (conf1 & MIPS_CONF1_DL) >> MIPS_CONF1_DL_SHF;
-   if (!dl)
-   return 0;
-   return 2 << dl;
+static inline unsigned long dcache_line_size(void)
+{
+#ifdef CONFIG_SYS_CACHE_SIZE_AUTO
+   return gd->arch.l1d_line_size;
+#else
+   return CONFIG_SYS_DCACHE_LINE_SIZE;
+#endif
 }
 
 #define cache_loop(start, end, lsize, ops...) do { \
-- 
2.9.3

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


[U-Boot] [PATCH v2 05/10] MIPS: Preserve Config implementation-defined bits

2016-09-09 Thread Paul Burton
The coprocessor 0 Config register includes 9 implementation defined
bits, which in some processors do things like enable write combining or
other functionality. We ought not to wipe them to 0 during boot. Rather
than doing so, preserve their value & only clear the bits standardised
by the MIPS architecture.

Signed-off-by: Paul Burton 
---

Changes in v2: None

 arch/mips/cpu/start.S| 5 +++--
 arch/mips/include/asm/mipsregs.h | 1 +
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/mips/cpu/start.S b/arch/mips/cpu/start.S
index 827a544..6aec430 100644
--- a/arch/mips/cpu/start.S
+++ b/arch/mips/cpu/start.S
@@ -123,8 +123,9 @@ reset:
mtc0zero, CP0_COMPARE
 
 #ifndef CONFIG_SKIP_LOWLEVEL_INIT
-   /* CONFIG0 register */
-   li  t0, CONF_CM_UNCACHED
+   mfc0t0, CP0_CONFIG
+   and t0, t0, MIPS_CONF_IMPL
+   or  t0, t0, CONF_CM_UNCACHED
mtc0t0, CP0_CONFIG
 #endif
 
diff --git a/arch/mips/include/asm/mipsregs.h b/arch/mips/include/asm/mipsregs.h
index 3185dc7..cd4f952 100644
--- a/arch/mips/include/asm/mipsregs.h
+++ b/arch/mips/include/asm/mipsregs.h
@@ -450,6 +450,7 @@
 #define MIPS_CONF_MT_FTLB  (_ULCAST_(4) <<  7)
 #define MIPS_CONF_AR   (_ULCAST_(7) << 10)
 #define MIPS_CONF_AT   (_ULCAST_(3) << 13)
+#define MIPS_CONF_IMPL (_ULCAST_(0x1ff) << 16)
 #define MIPS_CONF_M(_ULCAST_(1) << 31)
 
 /*
-- 
2.9.3

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


[U-Boot] [PATCH v2 04/10] MIPS: Enable use of the instruction cache earlier

2016-09-09 Thread Paul Burton
Enable use of the instruction cache immediately after it has been
initialised. This will only take effect if U-Boot was linked to run from
kseg0 rather than kseg1, but when this is the case the data cache
initialisation code will run cached & thus significantly faster.

Signed-off-by: Paul Burton 
---

Changes in v2: None

 arch/mips/cpu/start.S  |  8 
 arch/mips/lib/cache_init.S | 12 
 2 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/arch/mips/cpu/start.S b/arch/mips/cpu/start.S
index fc6dd66..827a544 100644
--- a/arch/mips/cpu/start.S
+++ b/arch/mips/cpu/start.S
@@ -12,10 +12,6 @@
 #include 
 #include 
 
-#ifndef CONFIG_SYS_MIPS_CACHE_MODE
-#define CONFIG_SYS_MIPS_CACHE_MODE CONF_CM_CACHABLE_NONCOHERENT
-#endif
-
 #ifndef CONFIG_SYS_INIT_SP_ADDR
 #define CONFIG_SYS_INIT_SP_ADDR(CONFIG_SYS_SDRAM_BASE + \
CONFIG_SYS_INIT_SP_OFFSET)
@@ -154,10 +150,6 @@ reset:
PTR_LA  t9, mips_cache_reset
jalrt9
 nop
-
-   /* ... and enable them */
-   li  t0, CONFIG_SYS_MIPS_CACHE_MODE
-   mtc0t0, CP0_CONFIG
 #endif
 
/* Set up temporary stack */
diff --git a/arch/mips/lib/cache_init.S b/arch/mips/lib/cache_init.S
index bc8ab27..c3fb249 100644
--- a/arch/mips/lib/cache_init.S
+++ b/arch/mips/lib/cache_init.S
@@ -172,6 +172,18 @@ LEAF(mips_cache_reset)
cache_loop  t0, t1, t8, INDEX_STORE_TAG_I
 #endif
 
+   /* Enable use of the I-cache by setting Config.K0 */
+   mfc0t0, CP0_CONFIG
+   li  t1, CONFIG_SYS_MIPS_CACHE_MODE
+#if __mips_isa_rev >= 2
+   ins t0, t1, 0, 3
+#else
+   ori t0, t0, CONF_CM_CMASK
+   xorit0, t0, CONF_CM_CMASK
+   or  t0, t0, t1
+#endif
+   mtc0t0, CP0_CONFIG
+
/*
 * then initialize D-cache.
 */
-- 
2.9.3

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


[U-Boot] [PATCH v2 07/10] MIPS: Define register names for cache init

2016-09-09 Thread Paul Burton
Define names for registers holding cache sizes throughout
mips_cache_reset, in order to make the code easier to read & allow for
changing register assignments more easily.

Signed-off-by: Paul Burton 
---

Changes in v2: None

 arch/mips/lib/cache_init.S | 42 +++---
 1 file changed, 23 insertions(+), 19 deletions(-)

diff --git a/arch/mips/lib/cache_init.S b/arch/mips/lib/cache_init.S
index c3fb249..2df3a82 100644
--- a/arch/mips/lib/cache_init.S
+++ b/arch/mips/lib/cache_init.S
@@ -98,19 +98,23 @@
  * RETURNS: N/A
  *
  */
+#define R_IC_SIZE  t2
+#define R_IC_LINE  t8
+#define R_DC_SIZE  t3
+#define R_DC_LINE  t9
 LEAF(mips_cache_reset)
 #ifndef CONFIG_SYS_CACHE_SIZE_AUTO
-   li  t2, CONFIG_SYS_ICACHE_SIZE
-   li  t8, CONFIG_SYS_ICACHE_LINE_SIZE
+   li  R_IC_SIZE, CONFIG_SYS_ICACHE_SIZE
+   li  R_IC_LINE, CONFIG_SYS_ICACHE_LINE_SIZE
 #else
-   l1_info t2, t8, MIPS_CONF1_IA_SHF
+   l1_info R_IC_SIZE, R_IC_LINE, MIPS_CONF1_IA_SHF
 #endif
 
 #ifndef CONFIG_SYS_CACHE_SIZE_AUTO
-   li  t3, CONFIG_SYS_DCACHE_SIZE
-   li  t9, CONFIG_SYS_DCACHE_LINE_SIZE
+   li  R_DC_SIZE, CONFIG_SYS_DCACHE_SIZE
+   li  R_DC_LINE, CONFIG_SYS_DCACHE_LINE_SIZE
 #else
-   l1_info t3, t9, MIPS_CONF1_DA_SHF
+   l1_info R_DC_SIZE, R_DC_LINE, MIPS_CONF1_DA_SHF
 #endif
 
 #ifdef CONFIG_SYS_MIPS_CACHE_INIT_RAM_LOAD
@@ -123,9 +127,9 @@ LEAF(mips_cache_reset)
li  v0, CONFIG_SYS_DCACHE_SIZE
 #endif
 #else
-   movev0, t2
-   sltut1, t2, t3
-   movnv0, t3, t1
+   movev0, R_IC_SIZE
+   sltut1, R_IC_SIZE, R_DC_SIZE
+   movnv0, R_DC_SIZE, t1
 #endif
/*
 * Now clear that much memory starting from zero.
@@ -158,18 +162,18 @@ LEAF(mips_cache_reset)
/*
 * Initialize the I-cache first,
 */
-   blezt2, 1f
+   blezR_IC_SIZE, 1f
PTR_LI  t0, INDEX_BASE
-   PTR_ADDUt1, t0, t2
+   PTR_ADDUt1, t0, R_IC_SIZE
/* clear tag to invalidate */
-   cache_loop  t0, t1, t8, INDEX_STORE_TAG_I
+   cache_loop  t0, t1, R_IC_LINE, INDEX_STORE_TAG_I
 #ifdef CONFIG_SYS_MIPS_CACHE_INIT_RAM_LOAD
/* fill once, so data field parity is correct */
PTR_LI  t0, INDEX_BASE
-   cache_loop  t0, t1, t8, FILL
+   cache_loop  t0, t1, R_IC_LINE, FILL
/* invalidate again - prudent but not strictly neccessary */
PTR_LI  t0, INDEX_BASE
-   cache_loop  t0, t1, t8, INDEX_STORE_TAG_I
+   cache_loop  t0, t1, R_IC_LINE, INDEX_STORE_TAG_I
 #endif
 
/* Enable use of the I-cache by setting Config.K0 */
@@ -187,20 +191,20 @@ LEAF(mips_cache_reset)
/*
 * then initialize D-cache.
 */
-1: blezt3, 3f
+1: blezR_DC_SIZE, 3f
PTR_LI  t0, INDEX_BASE
-   PTR_ADDUt1, t0, t3
+   PTR_ADDUt1, t0, R_DC_SIZE
/* clear all tags */
-   cache_loop  t0, t1, t9, INDEX_STORE_TAG_D
+   cache_loop  t0, t1, R_DC_LINE, INDEX_STORE_TAG_D
 #ifdef CONFIG_SYS_MIPS_CACHE_INIT_RAM_LOAD
/* load from each line (in cached space) */
PTR_LI  t0, INDEX_BASE
 2: LONG_L  zero, 0(t0)
-   PTR_ADDUt0, t9
+   PTR_ADDUt0, R_DC_LINE
bne t0, t1, 2b
/* clear all tags */
PTR_LI  t0, INDEX_BASE
-   cache_loop  t0, t1, t9, INDEX_STORE_TAG_D
+   cache_loop  t0, t1, R_DC_LINE, INDEX_STORE_TAG_D
 #endif
 
 3: jr  ra
-- 
2.9.3

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


[U-Boot] [PATCH v2 08/10] MIPS: Map CM Global Control Registers

2016-09-09 Thread Paul Burton
Map the Global Control Registers (GCRs) provided by the MIPS Coherence
Manager (CM) in preparation for using some of them in later patches.

Signed-off-by: Paul Burton 
---

Changes in v2: None

 arch/mips/Kconfig  | 16 
 arch/mips/cpu/Makefile |  2 ++
 arch/mips/cpu/cm_init.S| 45 +
 arch/mips/cpu/start.S  |  6 ++
 arch/mips/include/asm/cm.h | 19 +++
 5 files changed, 88 insertions(+)
 create mode 100644 arch/mips/cpu/cm_init.S
 create mode 100644 arch/mips/include/asm/cm.h

diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 21066f0..d1cd6f1 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -303,6 +303,22 @@ config MIPS_L1_CACHE_SHIFT
 config DYNAMIC_IO_PORT_BASE
bool
 
+config MIPS_CM
+   bool
+   help
+ Select this if your system contains a MIPS Coherence Manager and you
+ wish U-Boot to configure it or make use of it to retrieve system
+ information such as cache configuration.
+
+config MIPS_CM_BASE
+   hex
+   default 0x1fbf8000
+   help
+ The physical base address at which to map the MIPS Coherence Manager
+ Global Configuration Registers (GCRs). This should be set such that
+ the GCRs occupy a region of the physical address space which is
+ otherwise unused, or at minimum that software doesn't need to access.
+
 endif
 
 endmenu
diff --git a/arch/mips/cpu/Makefile b/arch/mips/cpu/Makefile
index fc6b455..429fd3a 100644
--- a/arch/mips/cpu/Makefile
+++ b/arch/mips/cpu/Makefile
@@ -7,3 +7,5 @@ extra-y = start.o
 obj-y += time.o
 obj-y += interrupts.o
 obj-y += cpu.o
+
+obj-$(CONFIG_MIPS_CM)  += cm_init.o
diff --git a/arch/mips/cpu/cm_init.S b/arch/mips/cpu/cm_init.S
new file mode 100644
index 000..ddcaa49
--- /dev/null
+++ b/arch/mips/cpu/cm_init.S
@@ -0,0 +1,45 @@
+/*
+ * MIPS Coherence Manager (CM) Initialisation
+ *
+ * Copyright (c) 2016 Imagination Technologies Ltd.
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+LEAF(mips_cm_map)
+   /* Config3 must exist for a CM to be present */
+   mfc0t0, CP0_CONFIG, 1
+   bgezt0, 2f
+   mfc0t0, CP0_CONFIG, 2
+   bgezt0, 2f
+
+   /* Check Config3.CMGCR to determine CM presence */
+   mfc0t0, CP0_CONFIG, 3
+   and t0, t0, MIPS_CONF3_CMGCR
+   beqzt0, 2f
+
+   /* Find the current physical GCR base address */
+1: MFC0t0, CP0_CMGCRBASE
+   PTR_SLL t0, t0, 4
+
+   /* If the GCRs are where we want, we're done */
+   PTR_LI  t1, CONFIG_MIPS_CM_BASE
+   beq t0, t1, 2f
+
+   /* Move the GCRs to our configured base address */
+   PTR_LI  t2, CKSEG1
+   PTR_ADDUt0, t0, t2
+   sw  zero, GCR_BASE_UPPER(t0)
+   sw  t1, GCR_BASE(t0)
+
+   /* Re-check the GCR base */
+   b   1b
+
+2: jr  ra
+   END(mips_cm_map)
diff --git a/arch/mips/cpu/start.S b/arch/mips/cpu/start.S
index 6f1d219..c157d03 100644
--- a/arch/mips/cpu/start.S
+++ b/arch/mips/cpu/start.S
@@ -141,6 +141,12 @@ reset:
 1:
PTR_L   gp, 0(ra)
 
+#ifdef CONFIG_MIPS_CM
+   PTR_LA  t9, mips_cm_map
+   jalrt9
+nop
+#endif
+
 #ifndef CONFIG_SKIP_LOWLEVEL_INIT
 # ifdef CONFIG_SYS_MIPS_CACHE_INIT_RAM_LOAD
/* Initialize any external memory */
diff --git a/arch/mips/include/asm/cm.h b/arch/mips/include/asm/cm.h
new file mode 100644
index 000..0261733
--- /dev/null
+++ b/arch/mips/include/asm/cm.h
@@ -0,0 +1,19 @@
+/*
+ * MIPS Coherence Manager (CM) Register Definitions
+ *
+ * Copyright (c) 2016 Imagination Technologies Ltd.
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+#ifndef __MIPS_ASM_CM_H__
+#define __MIPS_ASM_CM_H__
+
+/* Global Control Register (GCR) offsets */
+#define GCR_BASE   0x0008
+#define GCR_BASE_UPPER 0x000c
+#define GCR_REV0x0030
+
+/* GCR_REV CM versions */
+#define GCR_REV_CM30x0800
+
+#endif /* __MIPS_ASM_CM_H__ */
-- 
2.9.3

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


[U-Boot] [PATCH v2 09/10] MIPS: L2 cache support

2016-09-09 Thread Paul Burton
This patch adds support for initialising & maintaining L2 caches on MIPS
systems. The L2 cache configuration may be advertised through either
coprocessor 0 or the MIPS Coherence Manager depending upon the system,
and support for both is included.

If the L2 can be bypassed then we bypass it early in boot & initialise
the L1 caches first, such that we can start making use of the L1
instruction cache as early as possible. Otherwise we initialise the L2
first such that the L1s have no opportunity to generate access to the
uninitialised L2.

Signed-off-by: Paul Burton 
---

Changes in v2: None

 arch/mips/Kconfig   |   6 ++
 arch/mips/include/asm/cm.h  |  38 
 arch/mips/include/asm/global_data.h |   3 +
 arch/mips/include/asm/mipsregs.h|   5 +
 arch/mips/lib/cache.c   |  62 -
 arch/mips/lib/cache_init.S  | 180 +++-
 6 files changed, 288 insertions(+), 6 deletions(-)

diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index d1cd6f1..ff86ad2 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -300,6 +300,12 @@ config MIPS_L1_CACHE_SHIFT
default "4" if MIPS_L1_CACHE_SHIFT_4
default "5"
 
+config MIPS_L2_CACHE
+   bool
+   help
+ Select this if your system includes an L2 cache and you want U-Boot
+ to initialise & maintain it.
+
 config DYNAMIC_IO_PORT_BASE
bool
 
diff --git a/arch/mips/include/asm/cm.h b/arch/mips/include/asm/cm.h
index 0261733..62ecef2 100644
--- a/arch/mips/include/asm/cm.h
+++ b/arch/mips/include/asm/cm.h
@@ -12,8 +12,46 @@
 #define GCR_BASE   0x0008
 #define GCR_BASE_UPPER 0x000c
 #define GCR_REV0x0030
+#define GCR_L2_CONFIG  0x0130
+#define GCR_L2_TAG_ADDR0x0600
+#define GCR_L2_TAG_ADDR_UPPER  0x0604
+#define GCR_L2_TAG_STATE   0x0608
+#define GCR_L2_TAG_STATE_UPPER 0x060c
+#define GCR_L2_DATA0x0610
+#define GCR_L2_DATA_UPPER  0x0614
 
 /* GCR_REV CM versions */
 #define GCR_REV_CM30x0800
 
+/* GCR_L2_CONFIG fields */
+#define GCR_L2_CONFIG_ASSOC_SHIFT  0
+#define GCR_L2_CONFIG_ASSOC_BITS   8
+#define GCR_L2_CONFIG_LINESZ_SHIFT 8
+#define GCR_L2_CONFIG_LINESZ_BITS  4
+#define GCR_L2_CONFIG_SETSZ_SHIFT  12
+#define GCR_L2_CONFIG_SETSZ_BITS   4
+#define GCR_L2_CONFIG_BYPASS   (1 << 20)
+
+#ifndef __ASSEMBLY__
+
+#include 
+
+static inline void *mips_cm_base(void)
+{
+   return (void *)CKSEG1ADDR(CONFIG_MIPS_CM_BASE);
+}
+
+static inline unsigned long mips_cm_l2_line_size(void)
+{
+   unsigned long l2conf, line_sz;
+
+   l2conf = __raw_readl(mips_cm_base() + GCR_L2_CONFIG);
+
+   line_sz = l2conf >> GCR_L2_CONFIG_LINESZ_SHIFT;
+   line_sz &= GENMASK(GCR_L2_CONFIG_LINESZ_BITS - 1, 0);
+   return line_sz ? (2 << line_sz) : 0;
+}
+
+#endif /* !__ASSEMBLY__ */
+
 #endif /* __MIPS_ASM_CM_H__ */
diff --git a/arch/mips/include/asm/global_data.h 
b/arch/mips/include/asm/global_data.h
index 8533b69..0078bbe 100644
--- a/arch/mips/include/asm/global_data.h
+++ b/arch/mips/include/asm/global_data.h
@@ -25,6 +25,9 @@ struct arch_global_data {
unsigned short l1i_line_size;
unsigned short l1d_line_size;
 #endif
+#ifdef CONFIG_MIPS_L2_CACHE
+   unsigned short l2_line_size;
+#endif
 };
 
 #include 
diff --git a/arch/mips/include/asm/mipsregs.h b/arch/mips/include/asm/mipsregs.h
index cd4f952..b4c2dff 100644
--- a/arch/mips/include/asm/mipsregs.h
+++ b/arch/mips/include/asm/mipsregs.h
@@ -485,9 +485,13 @@
 #define MIPS_CONF1_TLBS_SIZE(6)
 #define MIPS_CONF1_TLBS (_ULCAST_(63) << MIPS_CONF1_TLBS_SHIFT)
 
+#define MIPS_CONF2_SA_SHF  0
 #define MIPS_CONF2_SA  (_ULCAST_(15) << 0)
+#define MIPS_CONF2_SL_SHF  4
 #define MIPS_CONF2_SL  (_ULCAST_(15) << 4)
+#define MIPS_CONF2_SS_SHF  8
 #define MIPS_CONF2_SS  (_ULCAST_(15) << 8)
+#define MIPS_CONF2_L2B (_ULCAST_(1) << 12)
 #define MIPS_CONF2_SU  (_ULCAST_(15) << 12)
 #define MIPS_CONF2_TA  (_ULCAST_(15) << 16)
 #define MIPS_CONF2_TL  (_ULCAST_(15) << 20)
@@ -551,6 +555,7 @@
 #define MIPS_CONF5_MVH (_ULCAST_(1) << 5)
 #define MIPS_CONF5_FRE (_ULCAST_(1) << 8)
 #define MIPS_CONF5_UFE (_ULCAST_(1) << 9)
+#define MIPS_CONF5_L2C (_ULCAST_(1) << 10)
 #define MIPS_CONF5_MSAEN   (_ULCAST_(1) << 27)
 #define MIPS_CONF5_EVA (_ULCAST_(1) << 28)
 #define MIPS_CONF5_CV  (_ULCAST_(1) << 29)
diff --git a/arch/mips/lib/cache.c b/arch/mips/lib/cache.c
index d8baf08..bd14ba6 100644
--- a/arch/mips/lib/cache.c
+++ b/arch/mips/lib/cache.c
@@ -7,10 +7,44 @@
 
 #include 
 #include 
+#include 
 #include 
 
 DECLARE_GLOBAL_DATA_PTR;
 
+static void probe_l2(void)
+{
+#ifdef CONFIG_MIPS_L2_CACHE
+   unsigned long conf2, sl;
+   bool l2c = false;
+

[U-Boot] [PATCH v2 10/10] MIPS: Malta: Enable CM & L2 support

2016-09-09 Thread Paul Burton
Enable support for the MIPS Coherence Manager & L2 caches on the MIPS
Malta board, removing the need for us to attempt to bypass the L2 during
boot (which would fail with recent CPUs that expose L2 config via the CM
anyway).

Signed-off-by: Paul Burton 

---

Changes in v2: None

 arch/mips/Kconfig  | 2 ++
 board/imgtec/malta/lowlevel_init.S | 6 --
 2 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index ff86ad2..161427c 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -26,6 +26,8 @@ config TARGET_MALTA
select DM
select DM_SERIAL
select DYNAMIC_IO_PORT_BASE
+   select MIPS_CM
+   select MIPS_L2_CACHE
select OF_CONTROL
select OF_ISA_BUS
select SUPPORTS_BIG_ENDIAN
diff --git a/board/imgtec/malta/lowlevel_init.S 
b/board/imgtec/malta/lowlevel_init.S
index 3d48cdc..6df4d9f 100644
--- a/board/imgtec/malta/lowlevel_init.S
+++ b/board/imgtec/malta/lowlevel_init.S
@@ -28,12 +28,6 @@
 
.globl  lowlevel_init
 lowlevel_init:
-   /* disable any L2 cache for now */
-   sync
-   mfc0t0, CP0_CONFIG, 2
-   ori t0, t0, 0x1 << 12
-   mtc0t0, CP0_CONFIG, 2
-
/* detect the core card */
PTR_LI  t0, CKSEG1ADDR(MALTA_REVISION)
lw  t0, 0(t0)
-- 
2.9.3

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


Re: [U-Boot] [PULL] Resend: Please pull u-boot-imx

2016-09-09 Thread Tom Rini
On Fri, Sep 09, 2016 at 09:34:23AM -0300, Fabio Estevam wrote:

> Hi Tom,
> 
> On Wed, Sep 7, 2016 at 2:57 PM, Tom Rini  wrote:
> 
> > Applied to u-boot/master, thanks!
> 
> Still don't appear at http://git.denx.de/?p=u-boot.git;a=summary

Gah.  Git annoys me every once in a while, fixed now.  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 v2 06/10] MIPS: If we don't need DDR for cache init, init cache first

2016-09-09 Thread Paul Burton
On systems where cache initialisation doesn't require zeroed memory (ie.
systems where CONFIG_SYS_MIPS_CACHE_INIT_RAM_LOAD is not defined)
perform cache initialisation prior to lowlevel_init & DDR
initialisation. This allows for DDR initialisation code to run cached &
thus significantly faster.

Signed-off-by: Paul Burton 
---

Changes in v2: None

 arch/mips/cpu/start.S | 9 +
 1 file changed, 9 insertions(+)

diff --git a/arch/mips/cpu/start.S b/arch/mips/cpu/start.S
index 6aec430..6f1d219 100644
--- a/arch/mips/cpu/start.S
+++ b/arch/mips/cpu/start.S
@@ -142,15 +142,24 @@ reset:
PTR_L   gp, 0(ra)
 
 #ifndef CONFIG_SKIP_LOWLEVEL_INIT
+# ifdef CONFIG_SYS_MIPS_CACHE_INIT_RAM_LOAD
/* Initialize any external memory */
PTR_LA  t9, lowlevel_init
jalrt9
 nop
+# endif
 
/* Initialize caches... */
PTR_LA  t9, mips_cache_reset
jalrt9
 nop
+
+# ifndef CONFIG_SYS_MIPS_CACHE_INIT_RAM_LOAD
+   /* Initialize any external memory */
+   PTR_LA  t9, lowlevel_init
+   jalrt9
+nop
+# endif
 #endif
 
/* Set up temporary stack */
-- 
2.9.3

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


Re: [U-Boot] [PATCH 2/2] configs: Migrate CONFIG_USB_STORAGE

2016-09-09 Thread Tom Rini
On Fri, Sep 09, 2016 at 01:52:34PM +0900, Masahiro Yamada wrote:

[snip]
> BTW,
> 
> $ git grep CONFIG_USB=y configs/*_defconfig | wc
> 669 669   30938
> $ git grep CONFIG_USB_STORAGE=y configs/*_defconfig | wc
> 650 650   35349
> 
> 
> With this series, we will have 669 boards with CONFIG_USB.
> Of the 669 boards, 650 boards define CONFIG_USB_STORAGE.
> 
> Perhaps, "default y" might be suitable for USB_STORAGE, but
> we can flip the default later if we find it useful.
> 
> Anyway, let's move forward the Kconfig migration for now.
> If we have all the defines in defconfigs,
> we can reconsider the default and dependency any time later.

Agreed we should put this off until later.  But I think we need to find
the right balance between "defconfigs should be small", "making a new
board should be easy" and "customizing a reference platform to a real
project should be easy".  In the Linux kernel a single board (or so)
defconfig is around 60-80 lines.  We of course don't have quite so many
knobs, but maybe around there is a good goal too.  And looking at what
we have today, yeah, we need to do some thinking about defaults and
similar tricks.

-- 
Tom


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


Re: [U-Boot] [PATCH v2 4/4] fastboot: move FASTBOOT_FLASH options into Kconfig

2016-09-09 Thread Tom Rini
On Fri, Sep 09, 2016 at 10:27:18AM +0200, Petr Kulhavy wrote:

> Move FASTBOOT_MBR_NAME and FASTBOOT_GPT_NAME into Kconfig.
> Add dependency on the FASTBOOT_FLASH setting (also for FASTBOOT_MBR_NAME).
> Remove the now redundant GPT_ENTRY_NAME.
> 
> Signed-off-by: Petr Kulhavy 

Reviewed-by: Tom Rini 

-- 
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] [RFC PATCH] common, kconfig: move VERSION_VARIABLE to Kconfig

2016-09-09 Thread Tom Rini
On Fri, Sep 09, 2016 at 08:12:49AM +0200, Heiko Schocher wrote:

[snip]
> One remark:
> define CONFIG_SPL_NET_VCI_STRING="..." is removed from
> some defconfigs, but not again added to the defconfig.
> This is for all boards, which use this define ... but as
> the resulting images are not changes, this seems no
> problem... This is the reason for the "RFC" state ...
> any comments?

So we didn't properly migrate SPL_NET_VCI_STRING to Kconfig, but it also
didn't fail as we didn't remove it from the headers.  I just sent Simon
off-list the Kconfig bits we need to migrate it for real (if we don't
have the rest of his SPL Kconfig series it gets ugly).

-- 
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 v1 2/5] simple panel: fix spelling of debug message

2016-09-09 Thread Anatolij Gustschin
On Fri,  9 Sep 2016 18:10:38 +0200
Marcel Ziswiler marcel.ziswi...@toradex.com wrote:

> Fix spelling of debug message from cnnot to cannot.
> 
> Signed-off-by: Marcel Ziswiler 

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


Re: [U-Boot] [PATCH 1/2] configs: Resync with savedefconfig

2016-09-09 Thread Stephen Warren

On 09/08/2016 07:19 PM, Tom Rini wrote:

Signed-off-by: Tom Rini 



diff --git a/configs/harmony_defconfig b/configs/harmony_defconfig



-CONFIG_USE_PRIVATE_LIBGCC=y


I assume that's because =y is the default for that now?


diff --git a/configs/p2771--000_defconfig b/configs/p2771--000_defconfig



-CONFIG_TARGET_P2771_=y



diff --git a/configs/p2771--500_defconfig b/configs/p2771--500_defconfig



-CONFIG_TARGET_P2771_=y


I think we need to keep those two. Those two defconfigs are slightly 
different configurations of U-Boot's p2771- board/target.

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


[U-Boot] question about bootstage and timer_init in init_sequence_f

2016-09-09 Thread Patrick Delaunay
Hi,

I am trying to activate bootstage on ARMV7 architecture.
My platform use the generic armv7 timer defined in file
./arch/arm/cpu/armv7m/timer.c:

For me the get_timer function should not used before timer_init (which
initialize gd->arch.timer_rate_hz) at least for the ARMV7 timer.

But in the init sequence, the bootstage is called before timer_init and
this function use the timer function.

For me it is a error in the init sequence : mark_bootstage is called before
timer_init.

static init_fnc_t init_sequence_f[] = {
#ifdef CONFIG_SANDBOX
setup_ram_buf,
#endif
setup_mon_len,
#ifdef CONFIG_OF_CONTROL
fdtdec_setup,
#endif
#ifdef CONFIG_TRACE
trace_early_init,
#endif
initf_malloc,
initf_console_record,
#if defined(CONFIG_MPC85xx) || defined(CONFIG_MPC86xx)
/* TODO: can this go into arch_cpu_init()? */
probecpu,
#endif
#if defined(CONFIG_X86) && defined(CONFIG_HAVE_FSP)
x86_fsp_init,
#endif
arch_cpu_init,/* basic arch cpu dependent setup */
initf_dm,
arch_cpu_init_dm,
*mark_bootstage,/* need timer, go after init dm */*
#if defined(CONFIG_BOARD_EARLY_INIT_F)
board_early_init_f,
#endif
/* TODO: can any of this go into arch_cpu_init()? */
#if defined(CONFIG_PPC) && !defined(CONFIG_8xx_CPUCLK_DEFAULT)
get_clocks,/* get CPU and bus clocks (etc.) */
#if defined(CONFIG_TQM8xxL) && !defined(CONFIG_TQM866M) \
&& !defined(CONFIG_TQM885D)
adjust_sdram_tbs_8xx,
#endif
/* TODO: can we rename this to timer_init()? */
init_timebase,
#endif
#if defined(CONFIG_ARM) || defined(CONFIG_MIPS) || \
defined(CONFIG_BLACKFIN) || defined(CONFIG_NDS32) || \
defined(CONFIG_SPARC)
 *   timer_init,/* initialize timer */*
#endif
...

I want to propose a patch to move timer_init call just before mark_bootstage

It should be ok for ARMV7 but I don't sure for other platform impacted
- the other ARM platform or ARMV7 wich don't use generic timer
- MIPS BLACKFIN NDS32 or SPARC

and I don't sure of impact for other function called (board_early_init_f
for example)

can I propose my patch ? for all the platfrom or only for ARM ?
or
I need to move mark_bootstage after timer_init ?

PS: I can also solve the issue in timer armv7 but with less generic patch
if my proposal is too dangerous

Best regards

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


Re: [U-Boot] [PATCH 2/2] fs/fat: Optimizes memory size with single global variable instead of 3

2016-09-09 Thread Brüns , Stefan
On Sonntag, 14. August 2016 00:57:38 CEST Benoît Thébaudeau wrote:
> Hi,
> 
> On Tue, Aug 2, 2016 at 9:35 PM, Benoît Thébaudeau
> 
>  wrote:
> > On Tue, Aug 2, 2016 at 8:53 PM, Stephen Warren  
wrote:
> >> On 07/28/2016 12:11 AM, Tien Fong Chee wrote:
> >>> Single 64KB get_contents_vfatname_block global variable would be used
> >>> for
> >>> all FAT implementation instead of allocating additional two global
> >>> variables
> >>> which are get_denfromdir_block and do_fat_read_at_block. This
> >>> implementation
> >>> can help in saving up 128KB memory space.
> >> 
> >> The series,
> >> 
> >> Tested-by: Stephen Warren 
> >> (via DFU's FAT reading/writing on various Tegra; likely primarily FAT
> >> rather than VFAT though)
> >> 
> >> Reviewed-by: Stephen Warren 
> > 
> > I suspect that reading a filename with VFAT entries crossing a cluster
> > boundary in a FAT32 root directory will be broken by this series. I do
> > not have time to test this and other corner cases right now though,
> > but it will be possible in the next few weeks.
> 
> I have tested VFAT long filenames with the current implementation on
> Sandbox. It's completely broken:
>  - There is a length limit somewhere between 111 and 120 characters,
> instead of 256 characters. Beyond this limit, the files are invisible
> with ls.

That one is expected. U-Boot limits the extended name to 9 "slots", each 26 
bytes. As filenames are encoded as UTF-16/UCS-2, each ASCII character uses two 
bytes -> 9 * 26 / 2 = 117.

>  - Some filenames are truncated or mixed up between files. I have
> tested 111-character random filenames for 1000 empty files in the root
> directory. Most filenames had the expected length, but a few were
> shorter or longer.

Where there any filenames with characters outside the ASCII range? There may 
have been some double en-/decoding of UTF-8 vs UTF-16.

Kind regards,

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


Re: [U-Boot] [PATCH] ext4: fix possible crash on directory traversal, ignore deleted entries

2016-09-09 Thread Brüns , Stefan
On Freitag, 2. September 2016 10:53:08 CEST you wrote:
> > 
> > Adding this to the current test script is somewhat problematic. The test
> > runs all tests for fat and ext4, so each testcase should be file system
> > agnostic. Unfortunately fat and ext4 (at least as implemented in U-Boot)
> > have different semantics, as ext4 in U-Boot requires all path to absolute
> > paths, whereas fat seems to require something else (relative path?
> > absolute path, but without leading '/'?).
> > 
> > Calling 'fatwrite host 0 0 /. 0x10' happily creates a directory! called
> > '/.', 'fatwrite host 0 0 /./foo 0x10' creates a file and copletely messes
> > up the filesystem (according to fsck.vfat and mounting the fs in linux).
> > 
> > Any advise?
> 
> Can we fix this up in the argument parsing?  This sounds like it's
> showing some bugs in the fatwrite parsing code itself.

The fatwrite code is hardly doing any parsing at all. It does not strip any 
"/" or "\" characters, does not interpret these as dir delimiters, and just 
pushes whatever it gets into the directory.

For the lookup, it uses a function which is quite similar to the fatload/fatls 
function, but still different. It only traverses the root directory.

The whole fatwrite seems to be a 50% almost verbatim copy of the read 
implementation and shares hardly any code. The problem is the "almost" copy, 
most functions have minor differences.

I think lots of code could be removed from fatwrite if the read implementation 
where better structured, but e.g. the main entry point is a huge function 
which, depending on some flags either prints the directory listing while 
walking/traversing the tree, returns the file size, loads a specified file 
into a buffer, or errors out in case some path element was not reachable.

So, currently there are two options for the bad fatwrite behaviour:
a) add even more duplicate code to fatwrite
b) restructure fatread to be reusable

Opinions, please!

Kind regards,

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


Re: [U-Boot] [Patch v6 8/9] armv8: ls1046ardb: Add LS1046ARDB board support

2016-09-09 Thread york sun
On 09/08/2016 05:07 PM, Prabhakar Kushwaha wrote:



>>> UART: supports two UARTs up to 115200 bps for console
>>
>> The board specification doesn't belong to commit message. Instead, you
>> can add what features have been supported, such as boot source, any
>> important commands, special care to prepare the image, etc.
>>
>
> As such there is no guideline about what should be in commit message of a 
> board support.
> I request you to guide us with about required things in board support commit 
> message.
>
> It will help future board support patches.
>

Good idea. I will write an internal memo.

York

___
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

2016-09-09 Thread Joe Hershberger
Hi Tom,

A few last minute fixes. Turns out I broke NFS.

The following changes since commit 16f416661ec5ffa46b3f879a0b83907bbec13714:

  Merge branch 'master' of git://www.denx.de/git/u-boot-imx (2016-09-09 
09:45:32 -0400)

are available in the git repository at:


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

for you to fetch changes up to 41d1258aceb45b45f9e68f67a9c40f0afbc09dc9:

  net: asix: Fix AX88772B when used with DriverModel (2016-09-09 13:13:42 -0500)


Joe Hershberger (2):
  Revert "net: nfs: Use the tx buffer to construct rpc msgs"
  Revert "net: nfs: Correct the reply data buffer size"

Joshua Scott (1):
  net: asix: Fix AX88772B when used with DriverModel

 drivers/usb/eth/asix.c |  5 +++
 net/nfs.c  | 88 --
 net/nfs.h  |  2 +-
 3 files changed, 49 insertions(+), 46 deletions(-)

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


Re: [U-Boot] net: asix: Fix AX88772B when used with DriverModel

2016-09-09 Thread Joe Hershberger
Hi Joshua,

https://patchwork.ozlabs.org/patch/666191/ was applied to u-boot-net.git.

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


Re: [U-Boot] [PATCH 1/2] configs: Resync with savedefconfig

2016-09-09 Thread Tom Rini
On Fri, Sep 09, 2016 at 10:21:45AM -0600, Stephen Warren wrote:
> On 09/08/2016 07:19 PM, Tom Rini wrote:
> >Signed-off-by: Tom Rini 
/bin/bash: ess: command not found
> >diff --git a/configs/harmony_defconfig b/configs/harmony_defconfig
> 
> >-CONFIG_USE_PRIVATE_LIBGCC=y
> 
> I assume that's because =y is the default for that now?

Yes.

> >diff --git a/configs/p2771--000_defconfig 
> >b/configs/p2771--000_defconfig
> 
> >-CONFIG_TARGET_P2771_=y
> 
> >diff --git a/configs/p2771--500_defconfig 
> >b/configs/p2771--500_defconfig
> 
> >-CONFIG_TARGET_P2771_=y
> 
> I think we need to keep those two. Those two defconfigs are slightly
> different configurations of U-Boot's p2771- board/target.

OK, then you need to submit a patch to fix the underlying problem, if
there is one, really.  Keep in mind that what this is, is re-running
savedefconfig for each target.  So if something odd drops out that means
that it wasn't having any effect before.

-- 
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 v1 4/5] colibri_t20: fix usb operation and controller order

2016-09-09 Thread Marcel Ziswiler
Without this patch the following error will be shown:

Colibri T20 # usb start
starting USB...
No controllers found

This patch fixes USB operation and also the controller order as the
CI UDC driver may only be instantiated on the first aka OTG port.

Signed-off-by: Marcel Ziswiler 
---

 arch/arm/dts/tegra20-colibri.dts | 45 +---
 1 file changed, 24 insertions(+), 21 deletions(-)

diff --git a/arch/arm/dts/tegra20-colibri.dts b/arch/arm/dts/tegra20-colibri.dts
index 7d4e64a..7df4e1b 100644
--- a/arch/arm/dts/tegra20-colibri.dts
+++ b/arch/arm/dts/tegra20-colibri.dts
@@ -14,10 +14,10 @@
i2c0 = "/i2c@7000d000";
i2c1 = "/i2c@7000c000";
i2c2 = "/i2c@7000c400";
-   usb0 = "/usb@c5008000";
-   usb1 = "/usb@c500";
-   usb2 = "/usb@c5004000";
sdhci0 = "/sdhci@c8000600";
+   usb0 = "/usb@c500";
+   usb1 = "/usb@c5004000"; /* on-module only, for ASIX */
+   usb2 = "/usb@c5008000";
};
 
host1x@5000 {
@@ -43,24 +43,6 @@
};
};
 
-   usb@c500 {
-   statuc = "okay";
-   dr_mode = "otg";
-   };
-
-   usb@c5004000 {
-   statuc = "okay";
-   /* VBUS_LAN */
-   nvidia,phy-reset-gpio = <&gpio TEGRA_GPIO(V, 1) 
GPIO_ACTIVE_HIGH>;
-   nvidia,vbus-gpio = <&gpio TEGRA_GPIO(BB, 1) GPIO_ACTIVE_HIGH>;
-   };
-
-   usb@c5008000 {
-   statuc = "okay";
-   /* USBH_PEN */
-   nvidia,vbus-gpio = <&gpio TEGRA_GPIO(W, 2) GPIO_ACTIVE_LOW>;
-   };
-
nand-controller@70008000 {
nvidia,wp-gpios = <&gpio TEGRA_GPIO(S, 0) GPIO_ACTIVE_HIGH>;
nvidia,width = <8>;
@@ -101,6 +83,27 @@
clock-frequency = <10>;
};
 
+   /* EHCI instance 0: USB1_DP/N -> USBC_P/N */
+   usb@c500 {
+   status = "okay";
+   dr_mode = "otg";
+   };
+
+   /* EHCI instance 1: ULPI -> USB3340 -> AX88772B */
+   usb@c5004000 {
+   status = "okay";
+   /* VBUS_LAN */
+   nvidia,phy-reset-gpio = <&gpio TEGRA_GPIO(V, 1) 
GPIO_ACTIVE_HIGH>;
+   nvidia,vbus-gpio = <&gpio TEGRA_GPIO(BB, 1) GPIO_ACTIVE_HIGH>;
+   };
+
+   /* EHCI instance 2: USB3_DP/N -> USBH_P/N */
+   usb@c5008000 {
+   status = "okay";
+   /* USBH_PEN */
+   nvidia,vbus-gpio = <&gpio TEGRA_GPIO(W, 2) GPIO_ACTIVE_LOW>;
+   };
+
sdhci@c8000600 {
status = "okay";
bus-width = <4>;
-- 
2.5.5

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


[U-Boot] [PATCH v1 3/5] colibri_t20: fix display configuration

2016-09-09 Thread Marcel Ziswiler
Without this patch the following error will be shown:

stdio_add_devices: Video device failed (ret=-22)

As commit ec5507707a1d1e84056a6c864338f95f6118d3ca (video: tegra: Move
to using simple-panel and pwm-backlight) states the Colibri T20 needs
updating too which this patch finally attempts doing.

Please note that the current U-Boot implementation requires a dummy
GPIO e.g. for a fixed backlight regulator to be explicitly defined in
order to work unlike in the Linux kernel where this is taken care of
automatically.

Signed-off-by: Marcel Ziswiler 
---

 arch/arm/dts/tegra20-colibri.dts | 72 +---
 1 file changed, 52 insertions(+), 20 deletions(-)

diff --git a/arch/arm/dts/tegra20-colibri.dts b/arch/arm/dts/tegra20-colibri.dts
index 2cf24d3..7d4e64a 100644
--- a/arch/arm/dts/tegra20-colibri.dts
+++ b/arch/arm/dts/tegra20-colibri.dts
@@ -21,12 +21,24 @@
};
 
host1x@5000 {
-   status = "okay";
dc@5420 {
-   status = "okay";
rgb {
status = "okay";
nvidia,panel = <&lcd_panel>;
+   display-timings {
+   timing@0 {
+   /* VESA VGA */
+   clock-frequency = <25175000>;
+   hactive = <640>;
+   vactive = <480>;
+   hback-porch = <48>;
+   hfront-porch = <16>;
+   hsync-len = <96>;
+   vback-porch = <31>;
+   vfront-porch = <11>;
+   vsync-len = <2>;
+   };
+   };
};
};
};
@@ -60,6 +72,10 @@
};
};
 
+   pwm@7000a000 {
+   status = "okay";
+   };
+
/*
 * GEN1_I2C: I2C_SDA/SCL on SODIMM pin 194/196 (e.g. RTC on carrier
 * board)
@@ -91,6 +107,19 @@
cd-gpios = <&gpio TEGRA_GPIO(C, 7) GPIO_ACTIVE_LOW>;
};
 
+   backlight: backlight {
+   compatible = "pwm-backlight";
+
+   brightness-levels = <255 128 64 32 16 8 4 0>;
+   default-brightness-level = <6>;
+   /* BL_ON */
+   enable-gpios = <&gpio TEGRA_GPIO(T, 4) GPIO_ACTIVE_HIGH>;
+   /* Dummy */
+   power-supply = <®_dummy>;
+   /* PWM */
+   pwms = <&pwm 0 500>;
+   };
+
clocks {
compatible = "simple-bus";
#address-cells = <1>;
@@ -104,25 +133,28 @@
};
};
 
-   pwm: pwm@7000a000 {
-   status = "okay";
+   lcd_panel: panel {
+   /*
+* edt,et057090dhu: EDT 5.7" LCD TFT
+* edt,et070080dh6: EDT 7.0" LCD TFT
+*/
+   compatible = "edt,et057090dhu", "simple-panel";
+
+   backlight = <&backlight>;
};
 
-   lcd_panel: panel {
-   clock = <25175000>;
-   xres = <640>;
-   yres = <480>;
-   left-margin = <48>; /* horizontal back porch */
-   right-margin = <16>;/* horizontal front porch */
-   hsync-len = <96>;
-   lower-margin = <11>;/* vertical front porch */
-   upper-margin = <31>;/* vertical back porch */
-   vsync-len = <2>;
-   hsync-active-high;
-   vsync-active-high;
-   nvidia,bits-per-pixel = <16>;
-   nvidia,pwm = <&pwm 0 0>;
-   nvidia,backlight-enable-gpios = <&gpio TEGRA_GPIO(T, 4) 
GPIO_ACTIVE_HIGH>;
-   nvidia,panel-timings = <0 0 0 0>;
+   regulators {
+   compatible = "simple-bus";
+   #address-cells = <1>;
+   #size-cells = <0>;
+
+   reg_dummy: regulator@0 {
+   compatible = "regulator-fixed";
+   reg = <0>;
+   regulator-name = "Dummy";
+   /* Dummy N/C */
+   gpio = <&gpio TEGRA_GPIO(V, 7) GPIO_ACTIVE_HIGH>;
+   enable-active-high;
+   };
};
 };
-- 
2.5.5

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


[U-Boot] [PATCH v1 0/5] various fixes mainly for colibri_t20

2016-09-09 Thread Marcel Ziswiler
This series addresses various issues as seen on Colibri T20. Please
note that for successful Ethernet operation not only on Colibri T20
but also on Colibri T30 the following patch will still need applying
as well:

[PATCH] net: asix: Fix ASIX 88772B with driver model

https://www.mail-archive.com/u-boot@lists.denx.de/msg221455.html

Please further note that USB gadget operation on T20 currently still
gives me headaches and despite me comparing the U-Boot sources with
the Linux driver and trying varous things I am still getting the
following upon connecting a T20 target device to a host machine:

[70291.779549] usb 2-3.4.2.7: new high-speed USB device number 29 using
 xhci_hcd
[70291.779677] usb 2-3.4.2.7: Device not responding to setup address.
[70291.980783] usb 2-3.4.2.7: Device not responding to setup address.
[70292.181466] usb 2-3.4.2.7: device not accepting address 29, error
 -71
[70292.181507] usb 2-3.4.2-port7: unable to enumerate USB device

Any feedback or suggestions are much appreciated.


Marcel Ziswiler (5):
  tegra: usb gadget: fix ci udc operation if not hostpc capable
  simple panel: fix spelling of debug message
  colibri_t20: fix display configuration
  colibri_t20: fix usb operation and controller order
  colibri_t20: enable dfu also for nand

 arch/arm/dts/tegra20-colibri.dts  | 117 +++---
 drivers/video/simple_panel.c  |   2 +-
 include/configs/colibri_t20.h |   6 ++
 include/configs/tegra-common-usb-gadget.h |   1 -
 include/configs/tegra114-common.h |   3 +
 include/configs/tegra124-common.h |   3 +
 include/configs/tegra186-common.h |   3 +
 include/configs/tegra210-common.h |   3 +
 include/configs/tegra30-common.h  |   3 +
 9 files changed, 98 insertions(+), 43 deletions(-)

-- 
2.5.5

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


[U-Boot] [PATCH v1 1/5] tegra: usb gadget: fix ci udc operation if not hostpc capable

2016-09-09 Thread Marcel Ziswiler
The Tegra 2 aka T20 is not host PC capable. Therefore move the define
CONFIG_CI_UDC_HAS_HOSTPC from the generic tegra-common-usb-gadget.h
header file into resp. SoC type specific ones.

Signed-off-by: Marcel Ziswiler 
---

 include/configs/tegra-common-usb-gadget.h | 1 -
 include/configs/tegra114-common.h | 3 +++
 include/configs/tegra124-common.h | 3 +++
 include/configs/tegra186-common.h | 3 +++
 include/configs/tegra210-common.h | 3 +++
 include/configs/tegra30-common.h  | 3 +++
 6 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/include/configs/tegra-common-usb-gadget.h 
b/include/configs/tegra-common-usb-gadget.h
index 3e3eeea..6c6a438 100644
--- a/include/configs/tegra-common-usb-gadget.h
+++ b/include/configs/tegra-common-usb-gadget.h
@@ -10,7 +10,6 @@
 
 #ifndef CONFIG_SPL_BUILD
 /* USB gadget mode support*/
-#define CONFIG_CI_UDC_HAS_HOSTPC
 /* USB mass storage protocol */
 #define CONFIG_USB_FUNCTION_MASS_STORAGE
 /* DFU protocol */
diff --git a/include/configs/tegra114-common.h 
b/include/configs/tegra114-common.h
index 107a0f8..7747e0a 100644
--- a/include/configs/tegra114-common.h
+++ b/include/configs/tegra114-common.h
@@ -60,6 +60,9 @@
 #define CONFIG_SYS_SPL_MALLOC_START0x8009
 #define CONFIG_SPL_STACK   0x800c
 
+/* For USB gadget mode support */
+#define CONFIG_CI_UDC_HAS_HOSTPC
+
 /* For USB EHCI controller */
 #define CONFIG_EHCI_IS_TDI
 #define CONFIG_USB_EHCI_TXFIFO_THRESH  0x10
diff --git a/include/configs/tegra124-common.h 
b/include/configs/tegra124-common.h
index 8cf9bac..ad3dbbb 100644
--- a/include/configs/tegra124-common.h
+++ b/include/configs/tegra124-common.h
@@ -62,6 +62,9 @@
 #define CONFIG_SYS_SPL_MALLOC_START0x8009
 #define CONFIG_SPL_STACK   0x800c
 
+/* For USB gadget mode support */
+#define CONFIG_CI_UDC_HAS_HOSTPC
+
 /* For USB EHCI controller */
 #define CONFIG_EHCI_IS_TDI
 #define CONFIG_USB_EHCI_TXFIFO_THRESH  0x10
diff --git a/include/configs/tegra186-common.h 
b/include/configs/tegra186-common.h
index 98e4fc2..68fcf94 100644
--- a/include/configs/tegra186-common.h
+++ b/include/configs/tegra186-common.h
@@ -65,4 +65,7 @@
 #define CONFIG_SYS_SPL_MALLOC_START0x8009
 #define CONFIG_SPL_STACK   0x800c
 
+/* For USB gadget mode support */
+#define CONFIG_CI_UDC_HAS_HOSTPC
+
 #endif
diff --git a/include/configs/tegra210-common.h 
b/include/configs/tegra210-common.h
index 874fe34d..50be2bf 100644
--- a/include/configs/tegra210-common.h
+++ b/include/configs/tegra210-common.h
@@ -65,6 +65,9 @@
 #define CONFIG_SYS_SPL_MALLOC_START0x8009
 #define CONFIG_SPL_STACK   0x800c
 
+/* For USB gadget mode support */
+#define CONFIG_CI_UDC_HAS_HOSTPC
+
 /* For USB EHCI controller */
 #define CONFIG_EHCI_IS_TDI
 #define CONFIG_USB_EHCI_TXFIFO_THRESH  0x10
diff --git a/include/configs/tegra30-common.h b/include/configs/tegra30-common.h
index baf3d00..0a3cd60 100644
--- a/include/configs/tegra30-common.h
+++ b/include/configs/tegra30-common.h
@@ -67,6 +67,9 @@
 #define CONFIG_SYS_SPL_MALLOC_START0x8009
 #define CONFIG_SPL_STACK   0x800c
 
+/* For USB gadget mode support */
+#define CONFIG_CI_UDC_HAS_HOSTPC
+
 /* For USB EHCI controller */
 #define CONFIG_EHCI_IS_TDI
 #define CONFIG_USB_EHCI_TXFIFO_THRESH  0x10
-- 
2.5.5

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


[U-Boot] [PATCH v1 5/5] colibri_t20: enable dfu also for nand

2016-09-09 Thread Marcel Ziswiler
Enable USB gadget DFU functionality for NAND as well.

Signed-off-by: Marcel Ziswiler 

---

 include/configs/colibri_t20.h | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/include/configs/colibri_t20.h b/include/configs/colibri_t20.h
index c15f0cb..33e1ef5 100644
--- a/include/configs/colibri_t20.h
+++ b/include/configs/colibri_t20.h
@@ -31,6 +31,9 @@
 #define CONFIG_GENERIC_MMC
 #define CONFIG_TEGRA_MMC
 
+/* USB DFU */
+#define CONFIG_DFU_NAND
+
 /* USB host support */
 #define CONFIG_USB_EHCI
 #define CONFIG_USB_EHCI_TEGRA
@@ -86,7 +89,10 @@
 /* Miscellaneous commands */
 #define CONFIG_FAT_WRITE
 
+#define DFU_ALT_NAND_INFO  "u-boot part 0,1;ubi part 0,4"
+
 #define BOARD_EXTRA_ENV_SETTINGS \
+   "dfu_alt_info=" DFU_ALT_NAND_INFO "\0" \
"mtdparts=" MTDPARTS_DEFAULT "\0"
 
 /* Increase console I/O buffer size */
-- 
2.5.5

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


[U-Boot] [PATCH v1 2/5] simple panel: fix spelling of debug message

2016-09-09 Thread Marcel Ziswiler
Fix spelling of debug message from cnnot to cannot.

Signed-off-by: Marcel Ziswiler 
---

 drivers/video/simple_panel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/video/simple_panel.c b/drivers/video/simple_panel.c
index b2fe345..baa95f6 100644
--- a/drivers/video/simple_panel.c
+++ b/drivers/video/simple_panel.c
@@ -42,7 +42,7 @@ static int simple_panel_ofdata_to_platdata(struct udevice 
*dev)
ret = uclass_get_device_by_phandle(UCLASS_REGULATOR, dev,
   "power-supply", &priv->reg);
if (ret) {
-   debug("%s: Warning: cnnot get power supply: ret=%d\n",
+   debug("%s: Warning: cannot get power supply: ret=%d\n",
  __func__, ret);
if (ret != -ENOENT)
return ret;
-- 
2.5.5

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


Re: [U-Boot] [PATCH 1/2] configs: Resync with savedefconfig

2016-09-09 Thread Stephen Warren

On 09/09/2016 01:02 PM, Tom Rini wrote:

On Fri, Sep 09, 2016 at 10:21:45AM -0600, Stephen Warren wrote:

On 09/08/2016 07:19 PM, Tom Rini wrote:

Signed-off-by: Tom Rini 

/bin/bash: ess: command not found

diff --git a/configs/harmony_defconfig b/configs/harmony_defconfig



-CONFIG_USE_PRIVATE_LIBGCC=y


I assume that's because =y is the default for that now?


Yes.



diff --git a/configs/p2771--500_defconfig b/configs/p2771--500_defconfig



-CONFIG_TARGET_P2771_=y


I think we need to keep those two. Those two defconfigs are slightly
different configurations of U-Boot's p2771- board/target.


OK, then you need to submit a patch to fix the underlying problem, if
there is one, really.  Keep in mind that what this is, is re-running
savedefconfig for each target.  So if something odd drops out that means
that it wasn't having any effect before.


I don't believe there is any underlying problem. The Kconfig option in 
question is defined in arch/arm/mach-tegra/tegra186/Kconfig, when 
building for p2771--000 the option makes it into .config just fine, 
and the value is used by board/nvidia/p2771-/Kconfig. Isn't this a 
bug in savedefconfig? I'm CC'ing Masahiro to get some insight.

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


Re: [U-Boot] [PATCH 1/2] configs: Resync with savedefconfig

2016-09-09 Thread Tom Rini
On Fri, Sep 09, 2016 at 01:09:43PM -0600, Stephen Warren wrote:
> On 09/09/2016 01:02 PM, Tom Rini wrote:
> >On Fri, Sep 09, 2016 at 10:21:45AM -0600, Stephen Warren wrote:
> >>On 09/08/2016 07:19 PM, Tom Rini wrote:
> >>>Signed-off-by: Tom Rini 
> >/bin/bash: ess: command not found
> >>>diff --git a/configs/harmony_defconfig b/configs/harmony_defconfig
> >>
> >>>-CONFIG_USE_PRIVATE_LIBGCC=y
> >>
> >>I assume that's because =y is the default for that now?
> >
> >Yes.
> 
> >>>diff --git a/configs/p2771--500_defconfig 
> >>>b/configs/p2771--500_defconfig
> >>
> >>>-CONFIG_TARGET_P2771_=y
> >>
> >>I think we need to keep those two. Those two defconfigs are slightly
> >>different configurations of U-Boot's p2771- board/target.
> >
> >OK, then you need to submit a patch to fix the underlying problem, if
> >there is one, really.  Keep in mind that what this is, is re-running
> >savedefconfig for each target.  So if something odd drops out that means
> >that it wasn't having any effect before.
> 
> I don't believe there is any underlying problem. The Kconfig option
> in question is defined in arch/arm/mach-tegra/tegra186/Kconfig, when
> building for p2771--000 the option makes it into .config just
> fine, and the value is used by board/nvidia/p2771-/Kconfig.
> Isn't this a bug in savedefconfig? I'm CC'ing Masahiro to get some
> insight.

It is the default value then and isn't saved is I believe the answer.

-- 
Tom


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


Re: [U-Boot] [PATCH 1/2] configs: Resync with savedefconfig

2016-09-09 Thread Tom Rini
On Thu, Sep 08, 2016 at 09:19:04PM -0400, Tom Rini wrote:

> Signed-off-by: Tom Rini 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [PATCH 2/2] configs: Migrate CONFIG_USB_STORAGE

2016-09-09 Thread Tom Rini
On Thu, Sep 08, 2016 at 09:19:05PM -0400, Tom Rini wrote:

> In some cases we were missing CONFIG_USB=y so enable that when needed.
> 
> Signed-off-by: Tom Rini 

Applied to u-boot/master, thanks!

-- 
Tom


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


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

2016-09-09 Thread Tom Rini
On Fri, Sep 09, 2016 at 01:52:41PM -0500, Joe Hershberger wrote:

> Hi Tom,
> 
> A few last minute fixes. Turns out I broke NFS.
> 
> The following changes since commit 16f416661ec5ffa46b3f879a0b83907bbec13714:
> 
>   Merge branch 'master' of git://www.denx.de/git/u-boot-imx (2016-09-09 
> 09:45:32 -0400)
> 
> are available in the git repository at:
> 
> 
>   git://git.denx.de/u-boot-net.git master
> 
> for you to fetch changes up to 41d1258aceb45b45f9e68f67a9c40f0afbc09dc9:
> 
>   net: asix: Fix AX88772B when used with DriverModel (2016-09-09 13:13:42 
> -0500)
> 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [PATCH 1/1] cmd: Rework disk.c usage

2016-09-09 Thread Tom Rini
On Fri, Sep 09, 2016 at 07:26:45AM -0400, Tom Rini wrote:

> We only need the function found in cmd/disk.c when we have IDE, SCSI or
> USB_STORAGE enabled.  While the first two are easy to get right, in the
> 3rd case we assume that the set of cases where we do have USB and do not
> enable USB_STORAGE are small enough that we can take the small bloat of
> un-discarded strings on gcc prior to 6.x
> 
> Signed-off-by: Tom Rini 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [PATCH 1/2] configs: Resync with savedefconfig

2016-09-09 Thread Stephen Warren

On 09/09/2016 01:11 PM, Tom Rini wrote:

On Fri, Sep 09, 2016 at 01:09:43PM -0600, Stephen Warren wrote:

On 09/09/2016 01:02 PM, Tom Rini wrote:

On Fri, Sep 09, 2016 at 10:21:45AM -0600, Stephen Warren wrote:

On 09/08/2016 07:19 PM, Tom Rini wrote:

Signed-off-by: Tom Rini 

/bin/bash: ess: command not found

diff --git a/configs/harmony_defconfig b/configs/harmony_defconfig



-CONFIG_USE_PRIVATE_LIBGCC=y


I assume that's because =y is the default for that now?


Yes.



diff --git a/configs/p2771--500_defconfig b/configs/p2771--500_defconfig



-CONFIG_TARGET_P2771_=y


I think we need to keep those two. Those two defconfigs are slightly
different configurations of U-Boot's p2771- board/target.


OK, then you need to submit a patch to fix the underlying problem, if
there is one, really.  Keep in mind that what this is, is re-running
savedefconfig for each target.  So if something odd drops out that means
that it wasn't having any effect before.


I don't believe there is any underlying problem. The Kconfig option
in question is defined in arch/arm/mach-tegra/tegra186/Kconfig, when
building for p2771--000 the option makes it into .config just
fine, and the value is used by board/nvidia/p2771-/Kconfig.
Isn't this a bug in savedefconfig? I'm CC'ing Masahiro to get some
insight.


It is the default value then and isn't saved is I believe the answer.


I don't think it's the default; nothing selects that option and it has 
no "default y".


Or maybe since the value is inside a choice, and is the only entry 
that's there, that does make it the default? If so, that seems a little 
fragile; what if someone comes along and adds a new board into the list, 
and puts it before the existing entry (e.g. to maintain alphabetical 
sorting). That would changing the meaning of the current defconfig file 
if the first entry is picked as default. If so, I'm surprised if nobody 
has had that issue yet.

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


[U-Boot] [PATCH] Revert "net: asix: Fix AX88772B when used with DriverModel"

2016-09-09 Thread Marcel Ziswiler
As discussed before rather than Joshua's patch the one from Alban
should long since have been applied:

https://www.mail-archive.com/u-boot@lists.denx.de/msg221455.html

This reverts commit 41d1258aceb45b45f9e68f67a9c40f0afbc09dc9.

Signed-off-by: Marcel Ziswiler 

---

 drivers/usb/eth/asix.c | 5 -
 1 file changed, 5 deletions(-)

diff --git a/drivers/usb/eth/asix.c b/drivers/usb/eth/asix.c
index a610ae4..ad083cf 100644
--- a/drivers/usb/eth/asix.c
+++ b/drivers/usb/eth/asix.c
@@ -819,11 +819,6 @@ int asix_eth_recv(struct udevice *dev, int flags, uchar 
**packetp)
}
 
*packetp = ptr + sizeof(packet_len);
-
-   if ((ueth->pusb_dev->descriptor.idVendor == ASIX_USB_VENDOR_ID) &&
-   (ueth->pusb_dev->descriptor.idProduct == AX88772B_USB_PRODUCT_ID))
-   *packetp += 2;
-
return packet_len;
 
 err:
-- 
2.5.5

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


Re: [U-Boot] [PATCH 1/2] configs: Resync with savedefconfig

2016-09-09 Thread Tom Rini
On Fri, Sep 09, 2016 at 03:06:01PM -0600, Stephen Warren wrote:
> On 09/09/2016 01:11 PM, Tom Rini wrote:
> >On Fri, Sep 09, 2016 at 01:09:43PM -0600, Stephen Warren wrote:
> >>On 09/09/2016 01:02 PM, Tom Rini wrote:
> >>>On Fri, Sep 09, 2016 at 10:21:45AM -0600, Stephen Warren wrote:
> On 09/08/2016 07:19 PM, Tom Rini wrote:
> >Signed-off-by: Tom Rini 
> >>>/bin/bash: ess: command not found
> >diff --git a/configs/harmony_defconfig b/configs/harmony_defconfig
> 
> >-CONFIG_USE_PRIVATE_LIBGCC=y
> 
> I assume that's because =y is the default for that now?
> >>>
> >>>Yes.
> >>
> >diff --git a/configs/p2771--500_defconfig 
> >b/configs/p2771--500_defconfig
> 
> >-CONFIG_TARGET_P2771_=y
> 
> I think we need to keep those two. Those two defconfigs are slightly
> different configurations of U-Boot's p2771- board/target.
> >>>
> >>>OK, then you need to submit a patch to fix the underlying problem, if
> >>>there is one, really.  Keep in mind that what this is, is re-running
> >>>savedefconfig for each target.  So if something odd drops out that means
> >>>that it wasn't having any effect before.
> >>
> >>I don't believe there is any underlying problem. The Kconfig option
> >>in question is defined in arch/arm/mach-tegra/tegra186/Kconfig, when
> >>building for p2771--000 the option makes it into .config just
> >>fine, and the value is used by board/nvidia/p2771-/Kconfig.
> >>Isn't this a bug in savedefconfig? I'm CC'ing Masahiro to get some
> >>insight.
> >
> >It is the default value then and isn't saved is I believe the answer.
> 
> I don't think it's the default; nothing selects that option and it
> has no "default y".
> 
> Or maybe since the value is inside a choice, and is the only entry
> that's there, that does make it the default? If so, that seems a
> little fragile; what if someone comes along and adds a new board
> into the list, and puts it before the existing entry (e.g. to
> maintain alphabetical sorting). That would changing the meaning of
> the current defconfig file if the first entry is picked as default.
> If so, I'm surprised if nobody has had that issue yet.

It's all correct and I think we have had this hit once or twice when
adding or changing the order.  It is a side effect of how Kconfig just
works.

-- 
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] Revert "net: asix: Fix AX88772B when used with DriverModel"

2016-09-09 Thread Joe Hershberger
Hi Marcel,

On Fri, Sep 9, 2016 at 4:12 PM, Marcel Ziswiler
 wrote:
> As discussed before rather than Joshua's patch the one from Alban
> should long since have been applied:
>
> https://www.mail-archive.com/u-boot@lists.denx.de/msg221455.html
>
> This reverts commit 41d1258aceb45b45f9e68f67a9c40f0afbc09dc9.
>
> Signed-off-by: Marcel Ziswiler 

I had not seen the other patch to know the reason behind the 2 bytes.
It was never assigned to me, it was assigned to Marek - He has it
marked as superseded in PW: https://patchwork.ozlabs.org/patch/655265/

He says that the patch from Alban does not build, but I don't see a follow-up.

Sorry about that.

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


Re: [U-Boot] [PATCH 2/2] fs/fat: Optimizes memory size with single global variable instead of 3

2016-09-09 Thread Benoît Thébaudeau
Hi,

On Fri, Sep 9, 2016 at 6:34 PM, Brüns, Stefan
 wrote:
> On Sonntag, 14. August 2016 00:57:38 CEST Benoît Thébaudeau wrote:
>> On Tue, Aug 2, 2016 at 9:35 PM, Benoît Thébaudeau
>>
>>  wrote:
>> > On Tue, Aug 2, 2016 at 8:53 PM, Stephen Warren 
> wrote:
>> >> On 07/28/2016 12:11 AM, Tien Fong Chee wrote:
>> >>> Single 64KB get_contents_vfatname_block global variable would be used
>> >>> for
>> >>> all FAT implementation instead of allocating additional two global
>> >>> variables
>> >>> which are get_denfromdir_block and do_fat_read_at_block. This
>> >>> implementation
>> >>> can help in saving up 128KB memory space.
>> >>
>> >> The series,
>> >>
>> >> Tested-by: Stephen Warren 
>> >> (via DFU's FAT reading/writing on various Tegra; likely primarily FAT
>> >> rather than VFAT though)
>> >>
>> >> Reviewed-by: Stephen Warren 
>> >
>> > I suspect that reading a filename with VFAT entries crossing a cluster
>> > boundary in a FAT32 root directory will be broken by this series. I do
>> > not have time to test this and other corner cases right now though,
>> > but it will be possible in the next few weeks.
>>
>> I have tested VFAT long filenames with the current implementation on
>> Sandbox. It's completely broken:
>>  - There is a length limit somewhere between 111 and 120 characters,
>> instead of 256 characters. Beyond this limit, the files are invisible
>> with ls.
>
> That one is expected. U-Boot limits the extended name to 9 "slots", each 26
> bytes. As filenames are encoded as UTF-16/UCS-2, each ASCII character uses two
> bytes -> 9 * 26 / 2 = 117.

Indeed. I had only checked VFAT_MAXLEN_BYTES, not VFAT_MAXSEQ.

>>  - Some filenames are truncated or mixed up between files. I have
>> tested 111-character random filenames for 1000 empty files in the root
>> directory. Most filenames had the expected length, but a few were
>> shorter or longer.
>
> Where there any filenames with characters outside the ASCII range? There may
> have been some double en-/decoding of UTF-8 vs UTF-16.

No, only alnum for the affected files. There may have been one or two
filenames from previous tests outside the ASCII range, though, but I
don't think so.

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


Re: [U-Boot] [PATCH 1/2] configs: Resync with savedefconfig

2016-09-09 Thread Stephen Warren

On 09/09/2016 03:14 PM, Tom Rini wrote:

On Fri, Sep 09, 2016 at 03:06:01PM -0600, Stephen Warren wrote:

On 09/09/2016 01:11 PM, Tom Rini wrote:

On Fri, Sep 09, 2016 at 01:09:43PM -0600, Stephen Warren wrote:

On 09/09/2016 01:02 PM, Tom Rini wrote:

On Fri, Sep 09, 2016 at 10:21:45AM -0600, Stephen Warren wrote:

On 09/08/2016 07:19 PM, Tom Rini wrote:

Signed-off-by: Tom Rini 

/bin/bash: ess: command not found

diff --git a/configs/harmony_defconfig b/configs/harmony_defconfig



-CONFIG_USE_PRIVATE_LIBGCC=y


I assume that's because =y is the default for that now?


Yes.



diff --git a/configs/p2771--500_defconfig b/configs/p2771--500_defconfig



-CONFIG_TARGET_P2771_=y


I think we need to keep those two. Those two defconfigs are slightly
different configurations of U-Boot's p2771- board/target.


OK, then you need to submit a patch to fix the underlying problem, if
there is one, really.  Keep in mind that what this is, is re-running
savedefconfig for each target.  So if something odd drops out that means
that it wasn't having any effect before.


I don't believe there is any underlying problem. The Kconfig option
in question is defined in arch/arm/mach-tegra/tegra186/Kconfig, when
building for p2771--000 the option makes it into .config just
fine, and the value is used by board/nvidia/p2771-/Kconfig.
Isn't this a bug in savedefconfig? I'm CC'ing Masahiro to get some
insight.


It is the default value then and isn't saved is I believe the answer.


I don't think it's the default; nothing selects that option and it
has no "default y".

Or maybe since the value is inside a choice, and is the only entry
that's there, that does make it the default? If so, that seems a
little fragile; what if someone comes along and adds a new board
into the list, and puts it before the existing entry (e.g. to
maintain alphabetical sorting). That would changing the meaning of
the current defconfig file if the first entry is picked as default.
If so, I'm surprised if nobody has had that issue yet.


It's all correct and I think we have had this hit once or twice when
adding or changing the order.  It is a side effect of how Kconfig just
works.


I'm not convinced. If I apply your patch, and also the following:


diff --git a/arch/arm/mach-tegra/tegra186/Kconfig 
b/arch/arm/mach-tegra/tegra186/Kconfig
index 97cf23f31f80..05f691ed3ede 100644
--- a/arch/arm/mach-tegra/tegra186/Kconfig
+++ b/arch/arm/mach-tegra/tegra186/Kconfig
@@ -7,6 +7,14 @@ if TEGRA186
 choice
prompt "Tegra186 board select"

+config TARGET_E_1234
+   bool "NVIDIA Tegra186 E-1234 board"
+   help
+ P2771- is a P3310 CPU board married to a P2597 I/O board. The
+ combination contains SoC, DRAM, eMMC, SD card slot, HDMI, USB
+ micro-B port, Ethernet, USB3 host port, SATA, PCIe, and two GPIO
+ expansion headers.
+
 config TARGET_P2771_
bool "NVIDIA Tegra186 P2771- board"
help


... then I get a build failure for p2771--000_defconfig since 
.config ends up containing CONFIG_TARGET_E_1234 rather than 
CONFIG_TARGET_P2771_. I think we want to avoid that don't we? If we 
don't, savedefconfig in the face of choice options seems rather too 
fragile, or we need to force people to update *_defconfig any time any 
Kconfig choice is edited.

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


Re: [U-Boot] [PATCH] Revert "net: asix: Fix AX88772B when used with DriverModel"

2016-09-09 Thread Marek Vasut
On 09/09/2016 11:24 PM, Marcel Ziswiler wrote:
> On Fri, 2016-09-09 at 16:16 -0500, Joe Hershberger wrote:
>> Hi Marcel,
>>
>> On Fri, Sep 9, 2016 at 4:12 PM, Marcel Ziswiler
>>  wrote:
>>>
>>> As discussed before rather than Joshua's patch the one from Alban
>>> should long since have been applied:
>>>
>>> https://www.mail-archive.com/u-boot@lists.denx.de/msg221455.html
>>>
>>> This reverts commit 41d1258aceb45b45f9e68f67a9c40f0afbc09dc9.
>>>
>>> Signed-off-by: Marcel Ziswiler 
>> I had not seen the other patch to know the reason behind the 2 bytes.
>> It was never assigned to me, it was assigned to Marek - He has it
>> marked as superseded in PW: https://patchwork.ozlabs.org/patch/655265
>> /
> 
> Sure, I also have not noticed Joshua's which got in way quick.
> 
>> He says that the patch from Alban does not build, but I don't see a
>> follow-up.
> 
> Hm, it builds and runs fine for my two boards the Colibri T20 and
> Colibri T30 both using one of them AX88772B chips each.
> 
> @Marek: May I ask what exactly about Alban's patch does not build for
> you?

I don't know anymore, sorry. It most likely failed buildman run of the
u-boot-usb tree during some PR, so I removed the patch from the PR.

>> Sorry about that.
> 
> No problem. We will figure it out.
> 
> Thanks, Joe
> 


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


Re: [U-Boot] net: asix: Fix AX88772B when used with DriverModel

2016-09-09 Thread Marek Vasut
On 09/09/2016 11:06 PM, Marcel Ziswiler wrote:
> On Fri, 2016-09-09 at 13:57 -0500, Joe Hershberger wrote:
>> Hi Joshua,
>>
>> https://patchwork.ozlabs.org/patch/666191/ was applied to u-boot-
>> net.git.
>>
>> Thanks!
>> -Joe
> 
> No, sorry, but this is really the wrong approach! As discussed before
> rather than Joshua's patch the one from Alban should long since have
> been applied:
> 
> https://www.mail-archive.com/u-boot@lists.denx.de/msg221455.html
> 
> I will send a revert ASAP and hope Alban's patch will finally make its
> way into master to fix this once and for all!
> 
Can you, instead of sending a revert, just send a subsequent patch to
fix this once and for all ?

Thanks for taking care of this mess :)

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


Re: [U-Boot] U-Boot memory allocation problems with ast2500

2016-09-09 Thread Simon Glass
Hi Maxim,

On 9 September 2016 at 15:53, Maxim Sloyko  wrote:
>
> Hi all,
>
> First, disclaimer: this is the first time I'm doing something with U-Boot or 
> the part (ast2500), so any claim I make below can be false or just plain 
> nonsense.

Welcome!

>
> I'm working on expanding support of Aspeed ast2500 part in U-Boot.
>
> I ran into some problems, when I tried to use Linux Kernel device tree for 
> this part in U-Boot. Looking at diagnostic messages 
> (http://pastebin.ca/3713876) I figured out that the problem is that U-Boot 
> continues to use malloc_simple, even after it has been relocated to RAM. As a 
> result, it fails to allocate 130k needed for environment, because it is 
> larger than the configured size of a memory chunk for simple malloc.

The test for this is in dlmalloc.c - the GD_FLG_FULL_MALLOC_INIT flag.
The flag is set in initr_reloc() after relocation.

I wonder if your global_data (the 'gd' pointer) is not set up
correctly, so it cannot write to the flag.

What version of U-Boot is it? Is the tree available somewhere?

>
> I suspect that this has something to do with memory configuration, do you 
> know what I may be missing? Also, it looks like lowlevel_init has been called 
> twice, i.e. again after relocation -- is this expected? This might be what is 
> causing the problem, because lowlevel_init does a lot of RAM related 
> configuration, but I don't know what to do about it.

I would expect lowlevel_init() to be called only once (or perhaps once
in SPL and once in U-Boot proper).

>
> There is some very basic support for this part in U-Boot, provided by 
> manufacturer, but it is basically a single platform.S assembly file that does 
> everything, like RAM configuration and some other peripherals support in 
> lowlevel_init procedure.
>
> So, if I want to add proper support for this part, i.e. with device tree and 
> all, is there a way to make this a gradual process? I mean, is it possible to 
> leave existing RAM initialization procedure in lowlevel_init and just add new 
> drivers for something I'm interested in or  is this all or nothing kind of 
> thing?

Yes you can do things gradually. If you have a sane early memory
environment then you shouldn't have much trouble.

>
> Thank you.
>
> --
> Maxim Sloyko

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


Re: [U-Boot] net: asix: Fix AX88772B when used with DriverModel

2016-09-09 Thread Marek Vasut
On 09/10/2016 01:13 AM, Marcel Ziswiler wrote:
> On Sat, 2016-09-10 at 01:04 +0200, Marek Vasut wrote:
>> On 09/09/2016 11:06 PM, Marcel Ziswiler wrote:
>>>
>>> On Fri, 2016-09-09 at 13:57 -0500, Joe Hershberger wrote:

 Hi Joshua,

 https://patchwork.ozlabs.org/patch/666191/ was applied to u-boot-
 net.git.

 Thanks!
 -Joe
>>> No, sorry, but this is really the wrong approach! As discussed
>>> before
>>> rather than Joshua's patch the one from Alban should long since
>>> have
>>> been applied:
>>>
>>> https://www.mail-archive.com/u-boot@lists.denx.de/msg221455.html
>>>
>>> I will send a revert ASAP and hope Alban's patch will finally make
>>> its
>>> way into master to fix this once and for all!
>>>
>> Can you, instead of sending a revert, just send a subsequent patch to
>> fix this once and for all ?
> 
> Sure, I will just squash my revert and Alban's fix together and send
> that one along ASAP.

Thanks

>> Thanks for taking care of this mess :)
> 
> You are very welcome.
> 


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


Re: [U-Boot] net: asix: Fix AX88772B when used with DriverModel

2016-09-09 Thread Marcel Ziswiler
On Fri, 2016-09-09 at 13:57 -0500, Joe Hershberger wrote:
> Hi Joshua,
> 
> https://patchwork.ozlabs.org/patch/666191/ was applied to u-boot-
> net.git.
> 
> Thanks!
> -Joe

No, sorry, but this is really the wrong approach! As discussed before
rather than Joshua's patch the one from Alban should long since have
been applied:

https://www.mail-archive.com/u-boot@lists.denx.de/msg221455.html

I will send a revert ASAP and hope Alban's patch will finally make its
way into master to fix this once and for all!
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2] net: asix: Fix ASIX 88772B with driver model

2016-09-09 Thread Marcel Ziswiler
From: Alban Bedel 

Commit 147271209a9d ("net: asix: fix operation without eeprom")
added a special handling for ASIX 88772B that enable another
type of header. This break the driver in DM mode as the extra handling
needed in the receive path is missing.

However this new header mode is not required and only seems to
increase the code complexity, so this patch revert this part of
commit 147271209a9d.

This also reverts commit 41d1258aceb45b45f9e68f67a9c40f0afbc09dc9
("net: asix: Fix AX88772B when used with DriverModel") of late.

Fixes: 147271209a9d ("net: asix: fix operation without eeprom")

Signed-off-by: Alban Bedel 
Signed-off-by: Marcel Ziswiler 

---
Please note that this also obsoletes the following patch sent earlier
as requested by Marek:

[PATCH] Revert "net: asix: Fix AX88772B when used with DriverModel"

Changes in v2:
- reverting the changes from Joshua's patch as well as suggested by
  Marek

 drivers/usb/eth/asix.c | 27 +++
 1 file changed, 3 insertions(+), 24 deletions(-)

diff --git a/drivers/usb/eth/asix.c b/drivers/usb/eth/asix.c
index a610ae4..1c6e967 100644
--- a/drivers/usb/eth/asix.c
+++ b/drivers/usb/eth/asix.c
@@ -67,11 +67,8 @@
 AX_MEDIUM_AC | AX_MEDIUM_RE)
 
 /* AX88772 & AX88178 RX_CTL values */
-#define AX_RX_CTL_RH2M 0x0200  /* 32-bit aligned RX IP header */
-#define AX_RX_CTL_RH1M 0x0100  /* Enable RX header format type 1 */
-#define AX_RX_CTL_SO   0x0080
-#define AX_RX_CTL_AB   0x0008
-#define AX_RX_HEADER_DEFAULT   (AX_RX_CTL_RH1M | AX_RX_CTL_RH2M)
+#define AX_RX_CTL_SO   0x0080
+#define AX_RX_CTL_AB   0x0008
 
 #define AX_DEFAULT_RX_CTL  \
(AX_RX_CTL_SO | AX_RX_CTL_AB)
@@ -98,8 +95,6 @@
 #define FLAG_TYPE_AX88772B (1U << 2)
 #define FLAG_EEPROM_MAC(1U << 3) /* initial mac address in 
eeprom */
 
-#define ASIX_USB_VENDOR_ID 0x0b95
-#define AX88772B_USB_PRODUCT_ID0x772b
 
 /* driver private */
 struct asix_private {
@@ -431,15 +426,10 @@ static int asix_init_common(struct ueth_data *dev, 
uint8_t *enetaddr)
int timeout = 0;
 #define TIMEOUT_RESOLUTION 50  /* ms */
int link_detected;
-   u32 ctl = AX_DEFAULT_RX_CTL;
 
debug("** %s()\n", __func__);
 
-   if ((dev->pusb_dev->descriptor.idVendor == ASIX_USB_VENDOR_ID) &&
-   (dev->pusb_dev->descriptor.idProduct == AX88772B_USB_PRODUCT_ID))
-   ctl |= AX_RX_HEADER_DEFAULT;
-
-   if (asix_write_rx_ctl(dev, ctl) < 0)
+   if (asix_write_rx_ctl(dev, AX_DEFAULT_RX_CTL) < 0)
goto out_err;
 
if (asix_write_hwaddr_common(dev, enetaddr) < 0)
@@ -572,12 +562,6 @@ static int asix_recv(struct eth_device *eth)
return -1;
}
 
-   if ((dev->pusb_dev->descriptor.idVendor ==
-ASIX_USB_VENDOR_ID) &&
-   (dev->pusb_dev->descriptor.idProduct ==
-AX88772B_USB_PRODUCT_ID))
-   buf_ptr += 2;
-
/* Notify net stack */
net_process_received_packet(buf_ptr + sizeof(packet_len),
packet_len);
@@ -819,11 +803,6 @@ int asix_eth_recv(struct udevice *dev, int flags, uchar 
**packetp)
}
 
*packetp = ptr + sizeof(packet_len);
-
-   if ((ueth->pusb_dev->descriptor.idVendor == ASIX_USB_VENDOR_ID) &&
-   (ueth->pusb_dev->descriptor.idProduct == AX88772B_USB_PRODUCT_ID))
-   *packetp += 2;
-
return packet_len;
 
 err:
-- 
2.5.5

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


[U-Boot] [PATCH] colibri_t30: fix usb ethernet functionality

2016-09-09 Thread Marcel Ziswiler
Since commit aa7a648747d8c704a9a81c9e493d386930724e9d
("net: Stop including NFS overhead in defragment max") the following
has been reproducibly observed while trying to transfer data over TFTP:

Load address: 0x80408000
Loading: EHCI timed out on TD - token=0x8008d80
T EHCI timed out on TD - token=0x88008d80
Rx: failed to receive: -5

This patch fixes this by upping our maximal de-fragmentation aka IP
packet size again.

Signed-off-by: Marcel Ziswiler 

---

 include/configs/colibri_t30.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/configs/colibri_t30.h b/include/configs/colibri_t30.h
index fbb235d..3431cde 100644
--- a/include/configs/colibri_t30.h
+++ b/include/configs/colibri_t30.h
@@ -48,6 +48,7 @@
 
 /* General networking support */
 #define CONFIG_IP_DEFRAG
+#define CONFIG_NET_MAXDEFRAG   (16384 + 4096 + 24)
 #define CONFIG_TFTP_BLOCKSIZE  16384
 #define CONFIG_TFTP_TSIZE
 
-- 
2.5.5

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


Re: [U-Boot] net: asix: Fix AX88772B when used with DriverModel

2016-09-09 Thread Marcel Ziswiler
On Sat, 2016-09-10 at 01:04 +0200, Marek Vasut wrote:
> On 09/09/2016 11:06 PM, Marcel Ziswiler wrote:
> > 
> > On Fri, 2016-09-09 at 13:57 -0500, Joe Hershberger wrote:
> > > 
> > > Hi Joshua,
> > > 
> > > https://patchwork.ozlabs.org/patch/666191/ was applied to u-boot-
> > > net.git.
> > > 
> > > Thanks!
> > > -Joe
> > No, sorry, but this is really the wrong approach! As discussed
> > before
> > rather than Joshua's patch the one from Alban should long since
> > have
> > been applied:
> > 
> > https://www.mail-archive.com/u-boot@lists.denx.de/msg221455.html
> > 
> > I will send a revert ASAP and hope Alban's patch will finally make
> > its
> > way into master to fix this once and for all!
> > 
> Can you, instead of sending a revert, just send a subsequent patch to
> fix this once and for all ?

Sure, I will just squash my revert and Alban's fix together and send
that one along ASAP.

> Thanks for taking care of this mess :)

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


Re: [U-Boot] [PATCH] Revert "net: asix: Fix AX88772B when used with DriverModel"

2016-09-09 Thread Marcel Ziswiler
On Fri, 2016-09-09 at 16:16 -0500, Joe Hershberger wrote:
> Hi Marcel,
> 
> On Fri, Sep 9, 2016 at 4:12 PM, Marcel Ziswiler
>  wrote:
> > 
> > As discussed before rather than Joshua's patch the one from Alban
> > should long since have been applied:
> > 
> > https://www.mail-archive.com/u-boot@lists.denx.de/msg221455.html
> > 
> > This reverts commit 41d1258aceb45b45f9e68f67a9c40f0afbc09dc9.
> > 
> > Signed-off-by: Marcel Ziswiler 
> I had not seen the other patch to know the reason behind the 2 bytes.
> It was never assigned to me, it was assigned to Marek - He has it
> marked as superseded in PW: https://patchwork.ozlabs.org/patch/655265
> /

Sure, I also have not noticed Joshua's which got in way quick.

> He says that the patch from Alban does not build, but I don't see a
> follow-up.

Hm, it builds and runs fine for my two boards the Colibri T20 and
Colibri T30 both using one of them AX88772B chips each.

@Marek: May I ask what exactly about Alban's patch does not build for
you?

> Sorry about that.

No problem. We will figure it out.

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


Re: [U-Boot] net: asix: Fix AX88772B when used with DriverModel

2016-09-09 Thread Marcel Ziswiler
On Sat, 2016-09-10 at 02:18 +0200, Marcel Ziswiler wrote:
> On Sat, 2016-09-10 at 01:23 +0200, Marek Vasut wrote:
> > 
> > On 09/10/2016 01:13 AM, Marcel Ziswiler wrote:
> > > 
> > > 
> > > On Sat, 2016-09-10 at 01:04 +0200, Marek Vasut wrote:
> > > > 
> > > > 
> > > > On 09/09/2016 11:06 PM, Marcel Ziswiler wrote:
> > > > > 
> > > > > 
> > > > > 
> > > > > On Fri, 2016-09-09 at 13:57 -0500, Joe Hershberger wrote:
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > Hi Joshua,
> > > > > > 
> > > > > > https://patchwork.ozlabs.org/patch/666191/ was applied to
> > > > > > u-
> > > > > > boot-
> > > > > > net.git.
> > > > > > 
> > > > > > Thanks!
> > > > > > -Joe
> > > > > No, sorry, but this is really the wrong approach! As
> > > > > discussed
> > > > > before
> > > > > rather than Joshua's patch the one from Alban should long
> > > > > since
> > > > > have
> > > > > been applied:
> > > > > 
> > > > > https://www.mail-archive.com/u-boot@lists.denx.de/msg221455.h
> > > > > tm
> > > > > l
> > > > > 
> > > > > I will send a revert ASAP and hope Alban's patch will finally
> > > > > make
> > > > > its
> > > > > way into master to fix this once and for all!
> > > > > 
> > > > Can you, instead of sending a revert, just send a subsequent
> > > > patch to
> > > > fix this once and for all ?
> > > Sure, I will just squash my revert and Alban's fix together and
> > > send
> > > that one along ASAP.
> > Thanks
> Don't thank me too early yet. While it works on Colibri T20 it
> currently fails on Colibri T30. More network and/or USB brokenness...
> Currently bisecting...
> 
> > 
> > > 
> > > > 
> > > > Thanks for taking care of this mess :)
> > > You are very welcome.
> How I do love U-Boot.

And the winner is:

commit aa7a648747d8c704a9a81c9e493d386930724e9d
Author: Joe Hershberger 
Date:   Mon Aug 15 14:42:15 2016 -0500

net: Stop including NFS overhead in defragment max
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot