[U-Boot] [PATCH v2] armv7m: Fix larger builds

2017-05-31 Thread Phil Edworthy
The branch instruction only has an 11-bit relative target address, which
is sometimes not enough.

Signed-off-by: Phil Edworthy 
---
v2:
 - Use W(b) instead of ldr+mov. Using this macro requires
   CONFIG_ARM_ASM_UNIFIED and CONFIG_THUMB2_KERNEL to be defined.
---
 arch/arm/cpu/armv7m/Makefile | 3 +++
 arch/arm/cpu/armv7m/start.S  | 4 +++-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/arch/arm/cpu/armv7m/Makefile b/arch/arm/cpu/armv7m/Makefile
index 257fc7f..df1fc95 100644
--- a/arch/arm/cpu/armv7m/Makefile
+++ b/arch/arm/cpu/armv7m/Makefile
@@ -8,3 +8,6 @@
 extra-y := start.o
 obj-y += cpu.o cache.o mpu.o
 obj-$(CONFIG_SYS_ARCH_TIMER) += systick-timer.o
+
+asflags-y += -DCONFIG_ARM_ASM_UNIFIED
+asflags-y += -DCONFIG_THUMB2_KERNEL
diff --git a/arch/arm/cpu/armv7m/start.S b/arch/arm/cpu/armv7m/start.S
index 49f2720..890c773 100644
--- a/arch/arm/cpu/armv7m/start.S
+++ b/arch/arm/cpu/armv7m/start.S
@@ -5,10 +5,12 @@
  * SPDX-License-Identifier:GPL-2.0+
  */
 
+#include 
+
 .globl reset
 .type reset, %function
 reset:
-   b   _main
+   W(b)_main
 
 .globl c_runtime_cpu_setup
 c_runtime_cpu_setup:
-- 
2.7.4

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


Re: [U-Boot] [PATCH v2 1/6] EFI: replace number with UUID_STR_LEN macro

2017-05-31 Thread Lukasz Majewski
Hi Alison,

> From: Alison Chaiken 
> 
> Signed-off-by: Alison Chaiken 

Acked-by: Lukasz Majewski 

> ---
>  disk/part_efi.c | 2 +-
>  include/part.h  | 5 +++--
>  2 files changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/disk/part_efi.c b/disk/part_efi.c
> index 1b7ba27..20d33ef 100644
> --- a/disk/part_efi.c
> +++ b/disk/part_efi.c
> @@ -183,7 +183,7 @@ void part_print_efi(struct blk_desc *dev_desc)
>   ALLOC_CACHE_ALIGN_BUFFER_PAD(gpt_header, gpt_head, 1,
> dev_desc->blksz); gpt_entry *gpt_pte = NULL;
>   int i = 0;
> - char uuid[37];
> + char uuid[UUID_STR_LEN + 1];
>   unsigned char *uuid_bin;
>  
>   /* This function validates AND fills in the GPT header and
> PTE */ diff --git a/include/part.h b/include/part.h
> index 83bce05..6ace09f 100644
> --- a/include/part.h
> +++ b/include/part.h
> @@ -9,6 +9,7 @@
>  
>  #include 
>  #include 
> +#include 
>  
>  struct block_drvr {
>   char *name;
> @@ -54,10 +55,10 @@ typedef struct disk_partition {
>   uchar   type[32];   /* string type
> description   */ int  bootable;   /*
> Active/Bootable flag is set   */ #if
> CONFIG_IS_ENABLED(PARTITION_UUIDS)
> - charuuid[37];   /* filesystem UUID as string,
> if exists */
> + charuuid[UUID_STR_LEN + 1]; /* filesystem
> UUID as string, if exists */ #endif
>  #ifdef CONFIG_PARTITION_TYPE_GUID
> - chartype_guid[37];  /* type GUID as string, if
> exists*/
> + chartype_guid[UUID_STR_LEN + 1];/* type GUID
> as string, if exists  */ #endif
>  #ifdef CONFIG_DOS_PARTITION
>   uchar   sys_ind;/* partition type
>   */




Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v2 2/6] disk_partition: introduce macros for description string lengths

2017-05-31 Thread Lukasz Majewski
Hi Alison,

> From: Alison Chaiken 
> 
> Signed-off-by: Alison Chaiken 
> ---
>  include/part.h | 7 +--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/include/part.h b/include/part.h
> index 6ace09f..87b 100644
> --- a/include/part.h
> +++ b/include/part.h
> @@ -47,12 +47,15 @@ struct block_drvr {
>  #define DEV_TYPE_CDROM   0x05/* CD-ROM */
>  #define DEV_TYPE_OPDISK  0x07/* optical disk */
>  
> +#define PART_NAME_LEN 32
> +#define PART_TYPE_LEN 32
> +
>  typedef struct disk_partition {
>   lbaint_tstart;  /* # of first block in
> partition */ lbaint_t size;   /* number of blocks
> in partition  */ ulongblksz;  /* block
> size in bytes */
> - uchar   name[32];   /* partition
> name  */
> - uchar   type[32];   /* string type
> description   */
> + uchar   name[PART_NAME_LEN];/* partition
> name  */
> + uchar   type[PART_TYPE_LEN];/* string type
> description   */ int  bootable;   /*
> Active/Bootable flag is set   */ #if
> CONFIG_IS_ENABLED(PARTITION_UUIDS) char   uuid[UUID_STR_LEN +
> 1];   /* filesystem UUID as string, if exists */


Acked-by: Lukasz Majewski 

Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH] mx7dsabresd: Increase CONFIG_ENV_OFFSET

2017-05-31 Thread Stefano Babic
On 28/05/2017 19:07, Fabio Estevam wrote:
> From: Fabio Estevam 
> 
> After running 'saveenv' we can no longer boot.
> 
> Adjust CONFIG_ENV_OFFSET so that U-Boot binary and the environment
> section do not overlap.
> 
> Signed-off-by: Fabio Estevam 
> ---
>  include/configs/mx7dsabresd.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/configs/mx7dsabresd.h b/include/configs/mx7dsabresd.h
> index 39291a2..fe9fd66 100644
> --- a/include/configs/mx7dsabresd.h
> +++ b/include/configs/mx7dsabresd.h
> @@ -207,7 +207,7 @@
>  #define CONFIG_APBH_DMA_BURST8
>  #endif
>  
> -#define CONFIG_ENV_OFFSET(8 * SZ_64K)
> +#define CONFIG_ENV_OFFSET(12 * SZ_64K)
>  #ifdef CONFIG_NAND_MXS
>  #define CONFIG_SYS_FSL_USDHC_NUM 1
>  #else
> 

Applied to u-boot-imx -master, thanks !

Best regards,
Stefano Babic

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


Re: [U-Boot] [PATCH v2 4/6] GPT: read partition table from device into a data structure

2017-05-31 Thread Lukasz Majewski
Hi Alison,

> From: Alison Chaiken 
> 
> Make the partition table available for modification by reading it from
> the user-specified device into a linked list.   Provide an accessor
> function for command-line testing.

Acked-by: Lukasz Majewski 

> 
> Signed-off-by: Alison Chaiken 
> ---
>  cmd/gpt.c  | 112
> +
> include/part.h |   8 + 2 files changed, 120 insertions(+)
> 
> diff --git a/cmd/gpt.c b/cmd/gpt.c
> index 3b7d929..c61d2b1 100644
> --- a/cmd/gpt.c
> +++ b/cmd/gpt.c
> @@ -19,6 +19,9 @@
>  #include 
>  #include 
>  #include 
> +#include 
> +
> +static LIST_HEAD(disk_partitions);
>  
>  /**
>   * extract_env(): Expand env name from string format '&{env_name}'
> @@ -151,6 +154,111 @@ static bool found_key(const char *str, const
> char *key) return result;
>  }
>  
> +static void del_gpt_info(void)
> +{
> + struct list_head *pos = _partitions;
> + struct disk_part *curr;
> + while (!list_empty(pos)) {
> + curr = list_entry(pos->next, struct disk_part, list);
> + list_del(pos->next);
> + free(curr);
> + }
> +}
> +
> +static struct disk_part *allocate_disk_part(disk_partition_t *info,
> int partnum) +{
> + struct disk_part *newpart;
> + newpart = (struct disk_part *)malloc(sizeof(*newpart));
> + memset(newpart, '\0', sizeof(newpart));
> + if (!newpart)
> + return ERR_PTR(-ENOMEM);
> +
> + newpart->gpt_part_info.start = info->start;
> + newpart->gpt_part_info.size = info->size;
> + newpart->gpt_part_info.blksz = info->blksz;
> + strncpy((char *)newpart->gpt_part_info.name, (const char
> *)info->name, PART_NAME_LEN);
> + memset(newpart->gpt_part_info.name + 31, '\0', 1);
> + strncpy((char *)newpart->gpt_part_info.type, (const char
> *)info->type, PART_TYPE_LEN);
> + memset(newpart->gpt_part_info.type + 31, '\0', 1);
> + newpart->gpt_part_info.bootable = info->bootable;
> +#ifdef CONFIG_PARTITION_UUIDS
> + strncpy(newpart->gpt_part_info.uuid, (const char
> *)info->uuid,
> + UUID_STR_LEN);
> +#endif
> + newpart->partnum = partnum;
> +
> + return newpart;
> +}
> +
> +static void print_gpt_info(void)
> +{
> + struct list_head *pos;
> + struct disk_part *curr;
> +
> + list_for_each(pos, _partitions) {
> + curr = list_entry(pos, struct disk_part, list);
> + printf("Partition %d:\n", curr->partnum);
> + printf("1st block %x, size %x\n",
> (unsigned)curr->gpt_part_info.start,
> +(unsigned)curr->gpt_part_info.size);
> + printf("Block size %lu, name %s\n",
> curr->gpt_part_info.blksz,
> +curr->gpt_part_info.name);
> + printf("Type %s, bootable %d\n",
> curr->gpt_part_info.type,
> +curr->gpt_part_info.bootable);
> +#ifdef CONFIG_PARTITION_UUIDS
> + printf("UUID %s\n", curr->gpt_part_info.uuid);
> +#endif
> + printf("\n");
> + }
> +}
> +
> +/*
> + * read partition info into disk_partitions list where
> + * it can be printed or modified
> + */
> +static int get_gpt_info(struct blk_desc *dev_desc)
> +{
> + /* start partition numbering at 1, as u-boot does */
> + int valid_parts = 1, p, ret = 0;
> + disk_partition_t info;
> + struct disk_part *new_disk_part;
> +
> + if (disk_partitions.next == NULL)
> + INIT_LIST_HEAD(_partitions);
> +
> + for (p = 1; p <= MAX_SEARCH_PARTITIONS; p++) {
> + ret = part_get_info(dev_desc, p, );
> + if (ret)
> + continue;
> +
> + new_disk_part = allocate_disk_part(,
> valid_parts);
> + if (IS_ERR(new_disk_part) && (valid_parts >= 2))
> + return -1;
> +
> + list_add_tail(_disk_part->list,
> _partitions);
> + valid_parts++;
> + }
> + if (!valid_parts) {
> + printf("** No valid partitions found **\n");
> + del_gpt_info();
> + return -ENODEV;
> + }
> + return --valid_parts;
> +}
> +
> +/* a wrapper to test get_gpt_info */
> +static int do_get_gpt_info(struct blk_desc *dev_desc)
> +{
> + int ret;
> +
> + ret = get_gpt_info(dev_desc);
> + if (ret > 0) {
> + print_gpt_info();
> + del_gpt_info();
> + }
> + return ret;
> +}
> +
> +
>  /**
>   * set_gpt_info(): Fill partition information from string
>   *   function allocates memory, remember to free!
> @@ -457,6 +565,8 @@ static int do_gpt(cmd_tbl_t *cmdtp, int flag, int
> argc, char * const argv[]) if (argc == 5)
>  strcpy(varname, argv[4]);
>   return do_disk_guid(blk_dev_desc, varname);
> + } else if (strcmp(argv[1], "read") == 0) {
> + return do_get_gpt_info(blk_dev_desc);
>   } else {
>   return CMD_RET_USAGE;
>   

[U-Boot] [PATCH 1/4] x86: baytrail: Change "fsp, mrc-init-tseg-size" default value to 1

2017-05-31 Thread Bin Meng
The default value of "fsp,mrc-init-tseg-size" should be 1 (1MB) per
FSP default settings. 0 is not valid.

Signed-off-by: Bin Meng 
---

 arch/x86/cpu/baytrail/fsp_configs.c   | 2 +-
 arch/x86/dts/bayleybay.dts| 2 +-
 arch/x86/dts/baytrail_som-db5800-som-6867.dts | 2 +-
 arch/x86/dts/conga-qeval20-qa3-e3845.dts  | 2 +-
 arch/x86/dts/dfi-bt700.dtsi   | 2 +-
 arch/x86/dts/minnowmax.dts| 2 +-
 6 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/arch/x86/cpu/baytrail/fsp_configs.c 
b/arch/x86/cpu/baytrail/fsp_configs.c
index d49b8d2..365e0dd 100644
--- a/arch/x86/cpu/baytrail/fsp_configs.c
+++ b/arch/x86/cpu/baytrail/fsp_configs.c
@@ -148,7 +148,7 @@ void update_fsp_configs(struct fsp_config_data *config,
 
fsp_upd->mrc_init_tseg_size = fdtdec_get_int(blob, node,
 "fsp,mrc-init-tseg-size",
-0);
+1);
fsp_upd->mrc_init_mmio_size = fdtdec_get_int(blob, node,
 "fsp,mrc-init-mmio-size",
 0x800);
diff --git a/arch/x86/dts/bayleybay.dts b/arch/x86/dts/bayleybay.dts
index 1ae058d..42a8131 100644
--- a/arch/x86/dts/bayleybay.dts
+++ b/arch/x86/dts/bayleybay.dts
@@ -236,7 +236,7 @@
 
fsp {
compatible = "intel,baytrail-fsp";
-   fsp,mrc-init-tseg-size = <0>;
+   fsp,mrc-init-tseg-size = <1>;
fsp,mrc-init-mmio-size = <0x800>;
fsp,mrc-init-spd-addr1 = <0xa0>;
fsp,mrc-init-spd-addr2 = <0xa2>;
diff --git a/arch/x86/dts/baytrail_som-db5800-som-6867.dts 
b/arch/x86/dts/baytrail_som-db5800-som-6867.dts
index aa8bfb8..d4199a3 100644
--- a/arch/x86/dts/baytrail_som-db5800-som-6867.dts
+++ b/arch/x86/dts/baytrail_som-db5800-som-6867.dts
@@ -259,7 +259,7 @@
 
fsp {
compatible = "intel,baytrail-fsp";
-   fsp,mrc-init-tseg-size = <0>;
+   fsp,mrc-init-tseg-size = <1>;
fsp,mrc-init-mmio-size = <0x800>;
fsp,mrc-init-spd-addr1 = <0xa0>;
fsp,mrc-init-spd-addr2 = <0xa2>;
diff --git a/arch/x86/dts/conga-qeval20-qa3-e3845.dts 
b/arch/x86/dts/conga-qeval20-qa3-e3845.dts
index 898e9c9..904197a 100644
--- a/arch/x86/dts/conga-qeval20-qa3-e3845.dts
+++ b/arch/x86/dts/conga-qeval20-qa3-e3845.dts
@@ -246,7 +246,7 @@
 
fsp {
compatible = "intel,baytrail-fsp";
-   fsp,mrc-init-tseg-size = <0>;
+   fsp,mrc-init-tseg-size = <1>;
fsp,mrc-init-mmio-size = <0x800>;
fsp,mrc-init-spd-addr1 = <0xa0>;
fsp,mrc-init-spd-addr2 = <0xa2>;
diff --git a/arch/x86/dts/dfi-bt700.dtsi b/arch/x86/dts/dfi-bt700.dtsi
index 546981a..a369e73 100644
--- a/arch/x86/dts/dfi-bt700.dtsi
+++ b/arch/x86/dts/dfi-bt700.dtsi
@@ -248,7 +248,7 @@
 
fsp {
compatible = "intel,baytrail-fsp";
-   fsp,mrc-init-tseg-size = <0>;
+   fsp,mrc-init-tseg-size = <1>;
fsp,mrc-init-mmio-size = <0x800>;
fsp,mrc-init-spd-addr1 = <0xa0>;
fsp,mrc-init-spd-addr2 = <0xa2>;
diff --git a/arch/x86/dts/minnowmax.dts b/arch/x86/dts/minnowmax.dts
index af64c68..4d55abb 100644
--- a/arch/x86/dts/minnowmax.dts
+++ b/arch/x86/dts/minnowmax.dts
@@ -260,7 +260,7 @@
 
fsp {
compatible = "intel,baytrail-fsp";
-   fsp,mrc-init-tseg-size = <0>;
+   fsp,mrc-init-tseg-size = <1>;
fsp,mrc-init-mmio-size = <0x800>;
fsp,mrc-init-spd-addr1 = <0xa0>;
fsp,mrc-init-spd-addr2 = <0xa2>;
-- 
2.9.2

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


Re: [U-Boot] [PATCH v2 3/6] GPT: add accessor function for disk GUID

2017-05-31 Thread Lukasz Majewski
Hi Alison,

> From: Alison Chaiken 
> 
> In order to read the GPT, modify the partition name strings, and then
> write out a new GPT, the disk GUID is needed.  While there is an
> existing accessor for the partition UUIDs, there is none yet for the
> disk GUID.

Acked-by: Lukasz Majewski 

> 
> Signed-off-by: Alison Chaiken 
> ---
>  cmd/gpt.c   | 30 +-
>  disk/part_efi.c | 31 +++
>  doc/README.gpt  |  3 ++-
>  include/part.h  | 15 +++
>  4 files changed, 77 insertions(+), 2 deletions(-)
> 
> diff --git a/cmd/gpt.c b/cmd/gpt.c
> index 3e98821..3b7d929 100644
> --- a/cmd/gpt.c
> +++ b/cmd/gpt.c
> @@ -398,6 +398,23 @@ static int gpt_verify(struct blk_desc
> *blk_dev_desc, const char *str_part) return ret;
>  }
>  
> +static int do_disk_guid(struct blk_desc *dev_desc, char * const
> namestr) +{
> + int ret;
> + char disk_guid[UUID_STR_LEN + 1];
> +
> + ret = get_disk_guid(dev_desc, disk_guid);
> + if (ret < 0)
> + return 1;
> +
> + if (namestr)
> + setenv(namestr, disk_guid);
> + else
> + printf("%s\n", disk_guid);
> +
> + return 0;
> +}
> +
>  /**
>   * do_gpt(): Perform GPT operations
>   *
> @@ -412,7 +429,7 @@ static int do_gpt(cmd_tbl_t *cmdtp, int flag, int
> argc, char * const argv[]) {
>   int ret = CMD_RET_SUCCESS;
>   int dev = 0;
> - char *ep;
> + char *ep, *varname = NULL;
>   struct blk_desc *blk_dev_desc = NULL;
>  
>   if (argc < 4 || argc > 5)
> @@ -436,6 +453,10 @@ static int do_gpt(cmd_tbl_t *cmdtp, int flag,
> int argc, char * const argv[]) } else if ((strcmp(argv[1], "verify")
> == 0)) { ret = gpt_verify(blk_dev_desc, argv[4]);
>   printf("Verify GPT: ");
> + } else if (strcmp(argv[1], "guid") == 0) {
> + if (argc == 5)
> +strcpy(varname, argv[4]);
> + return do_disk_guid(blk_dev_desc, varname);
>   } else {
>   return CMD_RET_USAGE;
>   }
> @@ -458,4 +479,11 @@ U_BOOT_CMD(gpt, CONFIG_SYS_MAXARGS, 1, do_gpt,
>   " Example usage:\n"
>   " gpt write mmc 0 $partitions\n"
>   " gpt verify mmc 0 $partitions\n"
> + " guid  \n"
> + "- print disk GUID\n"
> + " guid   \n"
> + "- set environment variable to disk GUID\n"
> + " Example usage:\n"
> + " gpt guid mmc 0\n"
> + " gpt guid mmc 0 varname\n"
>  );
> diff --git a/disk/part_efi.c b/disk/part_efi.c
> index 20d33ef..ff9f408 100644
> --- a/disk/part_efi.c
> +++ b/disk/part_efi.c
> @@ -178,6 +178,37 @@ static void prepare_backup_gpt_header(gpt_header
> *gpt_h)
>   * Public Functions (include/part.h)
>   */
>  
> +/*
> + * UUID is displayed as 32 hexadecimal digits, in 5 groups,
> + * separated by hyphens, in the form 8-4-4-4-12 for a total of 36
> characters
> + */
> +int get_disk_guid(struct blk_desc * dev_desc, char *guid)
> +{
> + ALLOC_CACHE_ALIGN_BUFFER_PAD(gpt_header, gpt_head, 1,
> dev_desc->blksz);
> + gpt_entry *gpt_pte = NULL;
> + unsigned char *guid_bin;
> +
> + /* This function validates AND fills in the GPT header and
> PTE */
> + if (is_gpt_valid(dev_desc, GPT_PRIMARY_PARTITION_TABLE_LBA,
> +  gpt_head, _pte) != 1) {
> + printf("%s: *** ERROR: Invalid GPT ***\n", __func__);
> + if (is_gpt_valid(dev_desc, (dev_desc->lba - 1),
> +  gpt_head, _pte) != 1) {
> + printf("%s: *** ERROR: Invalid Backup GPT
> ***\n",
> +__func__);
> + return -1;
> + } else {
> + printf("%s: ***Using Backup GPT
> ***\n",
> +__func__);
> + }
> + }
> +
> + guid_bin = (unsigned char *)(gpt_head->disk_guid.b);
> + uuid_bin_to_str(guid_bin, guid, UUID_STR_FORMAT_GUID);
> +
> + return 0;
> +}
> +
>  void part_print_efi(struct blk_desc *dev_desc)
>  {
>   ALLOC_CACHE_ALIGN_BUFFER_PAD(gpt_header, gpt_head, 1,
> dev_desc->blksz); diff --git a/doc/README.gpt b/doc/README.gpt
> index 3fcd835..c0779a4 100644
> --- a/doc/README.gpt
> +++ b/doc/README.gpt
> @@ -171,7 +171,8 @@ To restore GUID partition table one needs to:
> The fields 'uuid' and 'uuid_disk' are optional if
> CONFIG_RANDOM_UUID is enabled. A random uuid will be used if omitted
> or they point to an empty/ non-existent environment variable. The
> environment variable will be set to
> -   the generated UUID.
> +   the generated UUID.  The 'gpt guid' command reads the current
> value of the
> +   uuid_disk from the GPT.
>  
> The field 'bootable' is optional, it is used to mark the GPT
> partition bootable (set attribute flags "Legacy BIOS bootable").
> diff --git a/include/part.h b/include/part.h
> index 87b..16c4a46 100644
> --- a/include/part.h
> +++ b/include/part.h
> @@ -371,6 +371,21 @@ int 

[U-Boot] [PATCH 4/4] x86: baytrail: Change lpe/lpss-sio/scc FSP properties to integer

2017-05-31 Thread Bin Meng
At present lpe/lpss-sio/scc FSP properties are all boolean, but in
fact for "enable-lpe" it has 3 possible options. This adds macros
for these options and change the property from a boolean type to
an integer type, and change their names to explicitly indicate what
the property is really for.

Signed-off-by: Bin Meng 

---

 arch/x86/cpu/baytrail/fsp_configs.c  | 11 ++-
 arch/x86/dts/bayleybay.dts   |  6 +++---
 arch/x86/dts/baytrail_som-db5800-som-6867.dts|  4 ++--
 arch/x86/dts/conga-qeval20-qa3-e3845.dts |  6 +++---
 arch/x86/dts/dfi-bt700.dtsi  |  6 +++---
 arch/x86/dts/minnowmax.dts   |  6 +++---
 arch/x86/include/asm/arch-baytrail/fsp/fsp_configs.h | 10 ++
 arch/x86/include/asm/arch-baytrail/fsp/fsp_vpd.h |  6 +++---
 doc/device-tree-bindings/misc/intel,baytrail-fsp.txt | 12 ++--
 9 files changed, 39 insertions(+), 28 deletions(-)

diff --git a/arch/x86/cpu/baytrail/fsp_configs.c 
b/arch/x86/cpu/baytrail/fsp_configs.c
index c48ac07..45f9bf9 100644
--- a/arch/x86/cpu/baytrail/fsp_configs.c
+++ b/arch/x86/cpu/baytrail/fsp_configs.c
@@ -175,9 +175,10 @@ void update_fsp_configs(struct fsp_config_data *config,
fsp_upd->enable_azalia = fdtdec_get_bool(blob, node,
 "fsp,enable-azalia");
fsp_upd->enable_xhci = fdtdec_get_bool(blob, node, "fsp,enable-xhci");
-   fsp_upd->enable_lpe = fdtdec_get_bool(blob, node, "fsp,enable-lpe");
-   fsp_upd->lpss_sio_enable_pci_mode = fdtdec_get_bool(blob, node,
-   "fsp,lpss-sio-enable-pci-mode");
+   fsp_upd->lpe_mode = fdtdec_get_int(blob, node, "fsp,lpe-mode",
+  LPE_MODE_PCI);
+   fsp_upd->lpss_sio_mode = fdtdec_get_int(blob, node, "fsp,lpss-sio-mode",
+  LPSS_SIO_MODE_PCI);
fsp_upd->enable_dma0 = fdtdec_get_bool(blob, node, "fsp,enable-dma0");
fsp_upd->enable_dma1 = fdtdec_get_bool(blob, node, "fsp,enable-dma1");
fsp_upd->enable_i2_c0 = fdtdec_get_bool(blob, node, "fsp,enable-i2c0");
@@ -199,8 +200,8 @@ void update_fsp_configs(struct fsp_config_data *config,
fsp_upd->mrc_debug_msg = fdtdec_get_bool(blob, node,
 "fsp,mrc-debug-msg");
fsp_upd->isp_enable = fdtdec_get_bool(blob, node, "fsp,isp-enable");
-   fsp_upd->scc_enable_pci_mode = fdtdec_get_bool(blob, node,
-   "fsp,scc-enable-pci-mode");
+   fsp_upd->scc_mode = fdtdec_get_int(blob, node, "fsp,scc-mode",
+  SCC_MODE_PCI);
fsp_upd->igd_render_standby = fdtdec_get_bool(blob, node,
  "fsp,igd-render-standby");
fsp_upd->txe_uma_enable = fdtdec_get_bool(blob, node,
diff --git a/arch/x86/dts/bayleybay.dts b/arch/x86/dts/bayleybay.dts
index a577b93..0c314e0 100644
--- a/arch/x86/dts/bayleybay.dts
+++ b/arch/x86/dts/bayleybay.dts
@@ -248,8 +248,8 @@
fsp,enable-spi;
fsp,enable-sata;
fsp,sata-mode = ;
-   fsp,enable-lpe;
-   fsp,lpss-sio-enable-pci-mode;
+   fsp,lpe-mode = ;
+   fsp,lpss-sio-mode = ;
fsp,enable-dma0;
fsp,enable-dma1;
fsp,enable-i2c0;
@@ -264,7 +264,7 @@
fsp,igd-dvmt50-pre-alloc = ;
fsp,aperture-size = ;
fsp,gtt-size = ;
-   fsp,scc-enable-pci-mode;
+   fsp,scc-mode = ;
fsp,os-selection = ;
fsp,emmc45-ddr50-enabled;
fsp,emmc45-retune-timer-value = <8>;
diff --git a/arch/x86/dts/baytrail_som-db5800-som-6867.dts 
b/arch/x86/dts/baytrail_som-db5800-som-6867.dts
index 3fc36f1..171e7ff 100644
--- a/arch/x86/dts/baytrail_som-db5800-som-6867.dts
+++ b/arch/x86/dts/baytrail_som-db5800-som-6867.dts
@@ -268,7 +268,7 @@
fsp,enable-sata;
fsp,sata-mode = ;
fsp,enable-azalia;
-   fsp,lpss-sio-enable-pci-mode;
+   fsp,lpss-sio-mode = ;
fsp,enable-dma0;
fsp,enable-dma1;
fsp,enable-i2c0;
@@ -283,7 +283,7 @@
fsp,igd-dvmt50-pre-alloc = ;
fsp,aperture-size = ;
fsp,gtt-size = ;
-   fsp,scc-enable-pci-mode;
+   fsp,scc-mode = ;
fsp,os-selection = ;
fsp,enable-igd;
};
diff --git a/arch/x86/dts/conga-qeval20-qa3-e3845.dts 
b/arch/x86/dts/conga-qeval20-qa3-e3845.dts
index 369cea6..ae11ccc 100644
--- a/arch/x86/dts/conga-qeval20-qa3-e3845.dts
+++ b/arch/x86/dts/conga-qeval20-qa3-e3845.dts
@@ -258,8 +258,8 @@
fsp,enable-spi;
fsp,enable-sata;

[U-Boot] [PATCH 3/4] x86: baytrail: Use macros instead of magic numbers for FSP settings

2017-05-31 Thread Bin Meng
Introduce various meaningful macros for FSP settings and switch over
to use them instead of magic numbers.

Signed-off-by: Bin Meng 
---

 arch/x86/cpu/baytrail/fsp_configs.c| 35 +-
 arch/x86/dts/bayleybay.dts | 17 ++---
 arch/x86/dts/baytrail_som-db5800-som-6867.dts  | 15 +++--
 arch/x86/dts/conga-qeval20-qa3-e3845.dts   | 29 
 arch/x86/dts/dfi-bt700.dtsi| 29 
 arch/x86/dts/minnowmax.dts | 29 
 .../include/asm/arch-baytrail/fsp/fsp_configs.h| 77 ++
 .../misc/intel,baytrail-fsp.txt| 74 +++--
 8 files changed, 181 insertions(+), 124 deletions(-)

diff --git a/arch/x86/cpu/baytrail/fsp_configs.c 
b/arch/x86/cpu/baytrail/fsp_configs.c
index 977d5fe..c48ac07 100644
--- a/arch/x86/cpu/baytrail/fsp_configs.c
+++ b/arch/x86/cpu/baytrail/fsp_configs.c
@@ -148,10 +148,10 @@ void update_fsp_configs(struct fsp_config_data *config,
 
fsp_upd->mrc_init_tseg_size = fdtdec_get_int(blob, node,
 "fsp,mrc-init-tseg-size",
-1);
+MRC_INIT_TSEG_SIZE_1MB);
fsp_upd->mrc_init_mmio_size = fdtdec_get_int(blob, node,
 "fsp,mrc-init-mmio-size",
-0x800);
+MRC_INIT_MMIO_SIZE_2048MB);
fsp_upd->mrc_init_spd_addr1 = fdtdec_get_int(blob, node,
 "fsp,mrc-init-spd-addr1",
 0xa0);
@@ -159,7 +159,8 @@ void update_fsp_configs(struct fsp_config_data *config,
 "fsp,mrc-init-spd-addr2",
 0xa2);
fsp_upd->emmc_boot_mode = fdtdec_get_int(blob, node,
-"fsp,emmc-boot-mode", 2);
+"fsp,emmc-boot-mode",
+EMMC_BOOT_MODE_EMMC41);
fsp_upd->enable_sdio = fdtdec_get_bool(blob, node, "fsp,enable-sdio");
fsp_upd->enable_sdcard = fdtdec_get_bool(blob, node,
 "fsp,enable-sdcard");
@@ -169,7 +170,8 @@ void update_fsp_configs(struct fsp_config_data *config,
  "fsp,enable-hsuart1");
fsp_upd->enable_spi = fdtdec_get_bool(blob, node, "fsp,enable-spi");
fsp_upd->enable_sata = fdtdec_get_bool(blob, node, "fsp,enable-sata");
-   fsp_upd->sata_mode = fdtdec_get_int(blob, node, "fsp,sata-mode", 1);
+   fsp_upd->sata_mode = fdtdec_get_int(blob, node, "fsp,sata-mode",
+   SATA_MODE_AHCI);
fsp_upd->enable_azalia = fdtdec_get_bool(blob, node,
 "fsp,enable-azalia");
fsp_upd->enable_xhci = fdtdec_get_bool(blob, node, "fsp,enable-xhci");
@@ -189,10 +191,11 @@ void update_fsp_configs(struct fsp_config_data *config,
fsp_upd->enable_pwm1 = fdtdec_get_bool(blob, node, "fsp,enable-pwm1");
fsp_upd->enable_hsi = fdtdec_get_bool(blob, node, "fsp,enable-hsi");
fsp_upd->igd_dvmt50_pre_alloc = fdtdec_get_int(blob, node,
-   "fsp,igd-dvmt50-pre-alloc", 2);
+   "fsp,igd-dvmt50-pre-alloc", IGD_DVMT50_PRE_ALLOC_64MB);
fsp_upd->aperture_size = fdtdec_get_int(blob, node, "fsp,aperture-size",
-   2);
-   fsp_upd->gtt_size = fdtdec_get_int(blob, node, "fsp,gtt-size", 2);
+   APERTURE_SIZE_256MB);
+   fsp_upd->gtt_size = fdtdec_get_int(blob, node, "fsp,gtt-size",
+  GTT_SIZE_2MB);
fsp_upd->mrc_debug_msg = fdtdec_get_bool(blob, node,
 "fsp,mrc-debug-msg");
fsp_upd->isp_enable = fdtdec_get_bool(blob, node, "fsp,isp-enable");
@@ -203,7 +206,7 @@ void update_fsp_configs(struct fsp_config_data *config,
fsp_upd->txe_uma_enable = fdtdec_get_bool(blob, node,
  "fsp,txe-uma-enable");
fsp_upd->os_selection = fdtdec_get_int(blob, node, "fsp,os-selection",
-  4);
+  OS_SELECTION_LINUX);
fsp_upd->emmc45_ddr50_enabled = fdtdec_get_bool(blob, node,
"fsp,emmc45-ddr50-enabled");
fsp_upd->emmc45_hs200_enabled = fdtdec_get_bool(blob, node,
@@ -224,30 +227,32 @@ void update_fsp_configs(struct fsp_config_data *config,
} 

[U-Boot] [PATCH 2/4] x86: baytrail: Remove "serial-debug-port-*" settings

2017-05-31 Thread Bin Meng
"serial-debug-port-address" and "serial-debug-port-type" settings
are actually reserved in the FSP UPD data structure. Remove them.

Signed-off-by: Bin Meng 
---

 arch/x86/cpu/baytrail/fsp_configs.c  | 4 
 arch/x86/dts/bayleybay.dts   | 2 --
 arch/x86/dts/baytrail_som-db5800-som-6867.dts| 2 --
 arch/x86/dts/minnowmax.dts   | 2 --
 arch/x86/include/asm/arch-baytrail/fsp/fsp_vpd.h | 3 +--
 doc/device-tree-bindings/misc/intel,baytrail-fsp.txt | 2 --
 6 files changed, 1 insertion(+), 14 deletions(-)

diff --git a/arch/x86/cpu/baytrail/fsp_configs.c 
b/arch/x86/cpu/baytrail/fsp_configs.c
index 365e0dd..977d5fe 100644
--- a/arch/x86/cpu/baytrail/fsp_configs.c
+++ b/arch/x86/cpu/baytrail/fsp_configs.c
@@ -193,10 +193,6 @@ void update_fsp_configs(struct fsp_config_data *config,
fsp_upd->aperture_size = fdtdec_get_int(blob, node, "fsp,aperture-size",
2);
fsp_upd->gtt_size = fdtdec_get_int(blob, node, "fsp,gtt-size", 2);
-   fsp_upd->serial_debug_port_address = fdtdec_get_int(blob, node,
-   "fsp,serial-debug-port-address", 0x3f8);
-   fsp_upd->serial_debug_port_type = fdtdec_get_int(blob, node,
-   "fsp,serial-debug-port-type", 1);
fsp_upd->mrc_debug_msg = fdtdec_get_bool(blob, node,
 "fsp,mrc-debug-msg");
fsp_upd->isp_enable = fdtdec_get_bool(blob, node, "fsp,isp-enable");
diff --git a/arch/x86/dts/bayleybay.dts b/arch/x86/dts/bayleybay.dts
index 42a8131..1916991 100644
--- a/arch/x86/dts/bayleybay.dts
+++ b/arch/x86/dts/bayleybay.dts
@@ -263,8 +263,6 @@
fsp,igd-dvmt50-pre-alloc = <2>;
fsp,aperture-size = <2>;
fsp,gtt-size = <2>;
-   fsp,serial-debug-port-address = <0x3f8>;
-   fsp,serial-debug-port-type = <1>;
fsp,scc-enable-pci-mode;
fsp,os-selection = <4>;
fsp,emmc45-ddr50-enabled;
diff --git a/arch/x86/dts/baytrail_som-db5800-som-6867.dts 
b/arch/x86/dts/baytrail_som-db5800-som-6867.dts
index d4199a3..61af636 100644
--- a/arch/x86/dts/baytrail_som-db5800-som-6867.dts
+++ b/arch/x86/dts/baytrail_som-db5800-som-6867.dts
@@ -285,8 +285,6 @@
fsp,scc-enable-pci-mode;
fsp,os-selection = <4>;
fsp,enable-igd;
-   fsp,serial-debug-port-address = <0x3f8>;
-   fsp,serial-debug-port-type = <1>;
};
 
microcode {
diff --git a/arch/x86/dts/minnowmax.dts b/arch/x86/dts/minnowmax.dts
index 4d55abb..75d2761 100644
--- a/arch/x86/dts/minnowmax.dts
+++ b/arch/x86/dts/minnowmax.dts
@@ -287,8 +287,6 @@
fsp,igd-dvmt50-pre-alloc = <2>;
fsp,aperture-size = <2>;
fsp,gtt-size = <2>;
-   fsp,serial-debug-port-address = <0x3f8>;
-   fsp,serial-debug-port-type = <1>;
fsp,scc-enable-pci-mode;
fsp,os-selection = <4>;
fsp,emmc45-ddr50-enabled;
diff --git a/arch/x86/include/asm/arch-baytrail/fsp/fsp_vpd.h 
b/arch/x86/include/asm/arch-baytrail/fsp/fsp_vpd.h
index 3c782a8..b083b6e 100644
--- a/arch/x86/include/asm/arch-baytrail/fsp/fsp_vpd.h
+++ b/arch/x86/include/asm/arch-baytrail/fsp/fsp_vpd.h
@@ -64,8 +64,7 @@ struct __packed upd_region {
uint8_t igd_dvmt50_pre_alloc;   /* Offset 0x0043 */
uint8_t aperture_size;  /* Offset 0x0044 */
uint8_t gtt_size;   /* Offset 0x0045 */
-   uint32_t serial_debug_port_address; /* Offset 0x0046 */
-   uint8_t serial_debug_port_type; /* Offset 0x004a */
+   uint8_t reserved2[5];   /* Offset 0x0046 */
uint8_t mrc_debug_msg;  /* Offset 0x004b */
uint8_t isp_enable; /* Offset 0x004c */
uint8_t scc_enable_pci_mode;/* Offset 0x004d */
diff --git a/doc/device-tree-bindings/misc/intel,baytrail-fsp.txt 
b/doc/device-tree-bindings/misc/intel,baytrail-fsp.txt
index 07fa46e..f40011e 100644
--- a/doc/device-tree-bindings/misc/intel,baytrail-fsp.txt
+++ b/doc/device-tree-bindings/misc/intel,baytrail-fsp.txt
@@ -60,8 +60,6 @@ discovered by the FSP and used to setup main memory.
 - fsp,igd-dvmt50-pre-alloc
 - fsp,aperture-size
 - fsp,gtt-size
-- fsp,serial-debug-port-address
-- fsp,serial-debug-port-type
 - fsp,os-selection
 - fsp,emmc45-retune-timer-value
 
-- 
2.9.2

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


Re: [U-Boot] [PATCH] armv7m: Fix larger builds

2017-05-31 Thread Phil Edworthy
Hi Vikas,

On 27 May 2017 00:55 Vikas MANOCHA wrote:
> On Friday, May 26, 2017 1:27 AM Phil Edworthy wrote:
> > On 26 May 2017 00:58 Vikas MANOCHA wrote:
> > > On Thursday, May 25, 2017 6:58 AM Phil Edworthy wrote:
> > > > On 25 May 2017 10:16 Phil Edworthy wrote:
> > > > > > On 24 May 2017 18:32 Vikas MANOCHA wrote:
> > > > > > Hi Phil,
> > > > > >
> > > > > > > On Wednesday, May 24, 2017 7:34 AM Phil Edworthy wrote:
> > > > > > > The branch instruction only has an 11-bit relative target
> > > > > > > address, which is
> > > > > > sometimes not enough.
> > > > > > >
> > > > > > > Signed-off-by: Phil Edworthy 
> > > > > > > ---
> > > > > > >  arch/arm/cpu/armv7m/start.S | 3 ++-
> > > > > > >  1 file changed, 2 insertions(+), 1 deletion(-)
> > > > > > >
> > > > > > > diff --git a/arch/arm/cpu/armv7m/start.S
> > > > > b/arch/arm/cpu/armv7m/start.S
> > > > > > > index 49f2720..d79adb5 100644
> > > > > > > --- a/arch/arm/cpu/armv7m/start.S
> > > > > > > +++ b/arch/arm/cpu/armv7m/start.S
> > > > > > > @@ -8,7 +8,8 @@
> > > > > > >  .globl   reset
> > > > > > >  .type reset, %function
> > > > > > >  reset:
> > > > > > > - b   _main
> > > > > > > + ldr r0, =_main
> > > > > > > + mov pc, r0
> > > > > >
> > > > > > How about using W(b) for wider range ?
> > > > > Yes, that makes better sense!
> > > > Hmm, if I use W(b) it complains with:
> > > > arch/arm/cpu/armv7m/start.S:14:(.text+0x0): relocation truncated
> > > > to
> > > > fit: R_ARM_THM_JUMP11 against symbol `_main' defined in .text
> > > > section in arch/arm/lib/built-in.o
> > >
> > > Seems like the generated branch instruction is still 16 bit, you can
> > > check the disassembly.  Which compiler & version you are using ?
> > > Are you getting the same issue with "b_main" also. If no, compare
> the
> > > disassembly.
> > I'm using Linaro GCC 6.3-2017.02
> >
> > b   _main
> > or
> > W(b)_main
> > Disassembly is the same:
> >0:   e7feb.n 0 <_main>
> >
> > The problem appears to be that __ASSEMBLY__ is defined and so in
> arch/arm/include/asm/unified.h, W(x) does nothing.
> 
> __ASSEMBLY__ is fine, flag CONFIG_THUMB2_KERNEL is required.
>
> > Having said
> > that, if I simply change the code to
> > b.w _main
> > then I get a build error "Error: bad instruction `b.w _main'"
> 
> Here also flag CONFIG_ARM_ASM_UNIFIED is required for unified assembly.

Thanks for the pointer, I thought CONFIG_THUMB2_KERNEL was defined, but 
is currently only done for files in arch/arm/lib.

I'll re-send a patch for this.

Thanks
Phil

> Cheers,
> Vikas
> 
> >
> > Sorry, I'm not very familiar with ARM asm :)
> >
> > Thanks
> > Phil
> >
> > > Cheers,
> > > Vikas
> > >
> > > >
> > > > Any ideas why?
> > > > Phil
> > > >
> > > > > Thanks
> > > > > Phil
> > > > >
> > > > > > Cheers,
> > > > > > Vikas
> > > > > >
> > > > > > >
> > > > > > >  .globl   c_runtime_cpu_setup
> > > > > > >  c_runtime_cpu_setup:
> > > > > > > --
> > > > > > > 2.7.4

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


Re: [U-Boot] [PATCH 08/11] dwc3: Add support for USB device boot

2017-05-31 Thread Vignesh R


On Wednesday 31 May 2017 09:20 AM, Simon Glass wrote:
> On 23 May 2017 at 05:55, Vignesh R  wrote:
>> Add support to for USB device boot for dwc3 gadget, so that RNDIS can be
>> used in SPL to download next stage.
>> Provide a way to read MAC address for usb_ether device from board
>> function.
>>
>> Signed-off-by: Vignesh R 
>> ---
>>  drivers/usb/gadget/ether.c| 9 -
>>  drivers/usb/gadget/gadget_chips.h | 2 ++
>>  2 files changed, 10 insertions(+), 1 deletion(-)
> 
> It looks like there are a few changes in here and it should be split
> into 2-3 patches.
> 

Ok, will do.


-- 
Regards
Vignesh
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 1/3] nds32: mmc: Support ftsdc010 DM.

2017-05-31 Thread Jaehoon Chung
On 05/31/2017 10:36 AM, Andes wrote:
> From: rick 
> 
> Support Andestech ftsdc010 SD/MMC device tree flow
> on AG101P/AE3XX platforms.
> 
> Signed-off-by: rick 
> ---
>  drivers/mmc/Kconfig|   12 
>  drivers/mmc/Makefile   |1 +
>  drivers/mmc/ftsdc010_mci.c |  140 
> ++--
>  drivers/mmc/ftsdc010_mci.h |   54 +
>  drivers/mmc/nds32_mmc.c|  139 +++
>  5 files changed, 316 insertions(+), 30 deletions(-)
>  create mode 100644 drivers/mmc/ftsdc010_mci.h
>  create mode 100644 drivers/mmc/nds32_mmc.c
> 
> diff --git a/drivers/mmc/Kconfig b/drivers/mmc/Kconfig
> index 0dd4443..ca1376a 100644
> --- a/drivers/mmc/Kconfig
> +++ b/drivers/mmc/Kconfig
> @@ -377,6 +377,18 @@ config GENERIC_ATMEL_MCI
> the SD Memory Card Specification V2.0, the SDIO V2.0 specification
> and CE-ATA V1.1.
>  
> +config MMC_NDS32
> + bool "Andestech SD/MMC controller support"
> + depends on DM_MMC && OF_CONTROL
> + help
> +   This enables support for the Andestech SD/MMM controller, which is
> +   based on Faraday IP.

If my understanding is correct, nds32_mmc has the dependency to ftsdc010_mci 
file.

> +
> +config FTSDC010
> + bool "Ftsdc010 SD/MMC controller Support"
> + help
> +   This SD/MMC controller is present in Andestech SoCs which is based on 
> Faraday IP.
> +
>  endif
>  
>  config TEGRA124_MMC_DISABLE_EXT_LOOPBACK
> diff --git a/drivers/mmc/Makefile b/drivers/mmc/Makefile
> index a078649..08a552a 100644
> --- a/drivers/mmc/Makefile
> +++ b/drivers/mmc/Makefile
> @@ -44,6 +44,7 @@ obj-$(CONFIG_S3C_SDI) += s3c_sdi.o
>  obj-$(CONFIG_MMC_SANDBOX)+= sandbox_mmc.o
>  obj-$(CONFIG_SH_MMCIF) += sh_mmcif.o
>  obj-$(CONFIG_SH_SDHI) += sh_sdhi.o
> +obj-$(CONFIG_MMC_NDS32) += nds32_mmc.o
>  
>  # SDHCI
>  obj-$(CONFIG_MMC_SDHCI)  += sdhci.o
> diff --git a/drivers/mmc/ftsdc010_mci.c b/drivers/mmc/ftsdc010_mci.c
> index 652a718..ec0bc6b 100644
> --- a/drivers/mmc/ftsdc010_mci.c
> +++ b/drivers/mmc/ftsdc010_mci.c
> @@ -12,24 +12,15 @@
>  #include 
>  #include 
>  
> -#include 
> +#include 
>  #include 
>  #include 
>  #include 
> +#include "ftsdc010_mci.h"
>  
>  #define CFG_CMD_TIMEOUT (CONFIG_SYS_HZ >> 4) /* 250 ms */
>  #define CFG_RST_TIMEOUT CONFIG_SYS_HZ /* 1 sec reset timeout */
>  
> -struct ftsdc010_chip {
> - void __iomem *regs;
> - uint32_t wprot;   /* write protected (locked) */
> - uint32_t rate;/* actual SD clock in Hz */
> - uint32_t sclk;/* FTSDC010 source clock in Hz */
> - uint32_t fifo;/* fifo depth in bytes */
> - uint32_t acmd;
> - struct mmc_config cfg;  /* mmc configuration */
> -};
> -
>  static inline int ftsdc010_send_cmd(struct mmc *mmc, struct mmc_cmd *mmc_cmd)
>  {
>   struct ftsdc010_chip *chip = mmc->priv;
> @@ -127,9 +118,8 @@ static void ftsdc010_clkset(struct mmc *mmc, uint32_t 
> rate)
>  static int ftsdc010_wait(struct ftsdc010_mmc __iomem *regs, uint32_t mask)
>  {
>   int ret = -ETIMEDOUT;
> - uint32_t st, ts;
> -
> - for (ts = get_timer(0); get_timer(ts) < CFG_CMD_TIMEOUT; ) {
> + uint32_t st, timeout = 1000;
> + while (timeout--) {

Why did you touch this code?

>   st = readl(>status);
>   if (!(st & mask))
>   continue;
> @@ -147,10 +137,16 @@ static int ftsdc010_wait(struct ftsdc010_mmc __iomem 
> *regs, uint32_t mask)
>  /*
>   * u-boot mmc api
>   */
> -
> +#ifdef CONFIG_DM_MMC_OPS
> +static int ftsdc010_request(struct udevice *dev, struct mmc_cmd *cmd,
> + struct mmc_data *data)
> +{
> + struct mmc *mmc = mmc_get_mmc_dev(dev);
> +#else
>  static int ftsdc010_request(struct mmc *mmc, struct mmc_cmd *cmd,
>   struct mmc_data *data)
>  {
> +#endif
>   int ret = -EOPNOTSUPP;
>   uint32_t len = 0;
>   struct ftsdc010_chip *chip = mmc->priv;
> @@ -251,8 +247,14 @@ static int ftsdc010_request(struct mmc *mmc, struct 
> mmc_cmd *cmd,
>   return ret;
>  }
>  
> +#ifdef CONFIG_DM_MMC_OPS
> +static int ftsdc010_set_ios(struct udevice *dev)
> +{
> + struct mmc *mmc = mmc_get_mmc_dev(dev);
> +#else
>  static int ftsdc010_set_ios(struct mmc *mmc)
>  {
> +#endif
>   struct ftsdc010_chip *chip = mmc->priv;
>   struct ftsdc010_mmc __iomem *regs = chip->regs;
>  
> @@ -274,20 +276,46 @@ static int ftsdc010_set_ios(struct mmc *mmc)
>   return 0;
>  }
>  
> -static int ftsdc010_init(struct mmc *mmc)
> +#ifdef CONFIG_DM_MMC_OPS
> +static int ftsdc010_get_cd(struct udevice *dev)
>  {
> + struct mmc *mmc = mmc_get_mmc_dev(dev);
> +#else
> +static int ftsdc010_getcd(struct mmc *mmc)

Use "ftsdc010_get_cd"

> +{
> +#endif
>   struct ftsdc010_chip *chip = mmc->priv;
>   struct ftsdc010_mmc __iomem *regs = chip->regs;
> - uint32_t ts;
> -
>   if (readl(>status) & FTSDC010_STATUS_CARD_DETECT)
> - 

Re: [U-Boot] [PATCH V7 4/4] rockchip: rk3288: enable rockusb support on rk3288 based device

2017-05-31 Thread Lukasz Majewski
On Wed, 31 May 2017 10:27:23 +0800
Eddie Cai  wrote:

> Hi Lukasz
> 
> 2017-05-29 15:51 GMT+08:00 Lukasz Majewski :
> > Good morning Eddie,
> >
> >> this patch enable rockusb support on rk3288 based device.
> >>
> >> Signed-off-by: Eddie Cai 
> >> Reviewed-by: Simon Glass 
> >>
> >
> > I've give this patch set a try on travisCI:
> >
> > https://travis-ci.org/lmajewski/u-boot-dfu/jobs/237068149
> >
> > Unfortunately, there are some problem with following boards:
> >
> > chromebook_jerry, chromebook_minnie ...
> I did it by myself last week. i got the same error. then i fix those
> chromebook error
> and test again. I still got some 3036 board error. But it build
> successfully when i
> build it on my computer. here is the travis-ci.org error log
> https://travis-ci.org/eddiecailinux/u-boot/jobs/236232837
> I have no idea what can i do to fix it.

Can you share the SHA1 of commit on top of which you applied your
patches?

I take u-boot-usb (the USB u-boot tree from Marek Vasut) as a base and
then apply commits on top of it.

> >
> > caused by "undefined references to "
> >
> > I've tried your patches on top of:
> > u-boot-usb/HEAD
> > SHA1: 3426b2038cfb831d74ac0407fc7a04e990b44540
> >
> > Maybe you have built tested it on other branch/commit?
> >
> > Best regards,
> > Łukasz Majewski
> >
> > p.s. My travis CI .travis.yml attached.
> >
> >> Changes in v7:
> >> -use imply in the Kconfig to enable rockusb
> >>
> >> Changes in v6:
> >> -enable rockusb in defconfig
> >>
> >> Changes in v5:
> >> -none
> >>
> >> Changes in v4:
> >> -move to rk3288_common.h
> >>
> >> Changes in v3:
> >> -move to defconfig
> >>
> >> ---
> >>  arch/arm/mach-rockchip/Kconfig| 2 ++
> >>  configs/evb-rk3288_defconfig  | 9 +
> >>  configs/fennec-rk3288_defconfig   | 6 ++
> >>  configs/firefly-rk3288_defconfig  | 6 ++
> >>  configs/miqi-rk3288_defconfig | 6 ++
> >>  configs/popmetal-rk3288_defconfig | 6 ++
> >>  configs/tinker-rk3288_defconfig   | 6 ++
> >>  include/configs/rk3288_common.h   | 7 ---
> >>  8 files changed, 41 insertions(+), 7 deletions(-)
> >>
> >> diff --git a/arch/arm/mach-rockchip/Kconfig
> >> b/arch/arm/mach-rockchip/Kconfig index 2b752ad..8a87812 100644
> >> --- a/arch/arm/mach-rockchip/Kconfig
> >> +++ b/arch/arm/mach-rockchip/Kconfig
> >> @@ -32,6 +32,8 @@ config ROCKCHIP_RK3288
> >>   select CPU_V7
> >>   select SUPPORT_SPL
> >>   select SPL
> >> + imply USB_FUNCTION_ROCKUSB
> >> + imply CMD_ROCKUSB
> >>   help
> >> The Rockchip RK3288 is a ARM-based SoC with a quad-core
> >> Cortex-A17 including NEON and GPU, 1MB L2 cache, Mali-T7 graphics,
> >> two diff --git a/configs/evb-rk3288_defconfig
> >> b/configs/evb-rk3288_defconfig index 227150d..cf66e09 100644
> >> --- a/configs/evb-rk3288_defconfig
> >> +++ b/configs/evb-rk3288_defconfig
> >> @@ -17,6 +17,7 @@ CONFIG_CMD_MMC=y
> >>  CONFIG_CMD_SF=y
> >>  CONFIG_CMD_SPI=y
> >>  CONFIG_CMD_I2C=y
> >> +CONFIG_CMD_USB=y
> >>  CONFIG_CMD_GPIO=y
> >>  # CONFIG_CMD_SETEXPR is not set
> >>  CONFIG_CMD_CACHE=y
> >> @@ -61,6 +62,14 @@ CONFIG_DEBUG_UART_CLOCK=2400
> >>  CONFIG_DEBUG_UART_SHIFT=2
> >>  CONFIG_SYS_NS16550=y
> >>  CONFIG_SYSRESET=y
> >> +CONFIG_USB=y
> >> +CONFIG_USB_STORAGE=y
> >>  CONFIG_USE_TINY_PRINTF=y
> >>  CONFIG_CMD_DHRYSTONE=y
> >>  CONFIG_ERRNO_STR=y
> >> +CONFIG_USB_GADGET=y
> >> +CONFIG_USB_GADGET_DOWNLOAD=y
> >> +CONFIG_USB_GADGET_VBUS_DRAW=0
> >> +CONFIG_G_DNL_MANUFACTURER="Rockchip"
> >> +CONFIG_G_DNL_VENDOR_NUM=0x2207
> >> +CONFIG_G_DNL_PRODUCT_NUM=0x320a
> >> diff --git a/configs/fennec-rk3288_defconfig
> >> b/configs/fennec-rk3288_defconfig index befba18..eb33d00 100644
> >> --- a/configs/fennec-rk3288_defconfig
> >> +++ b/configs/fennec-rk3288_defconfig
> >> @@ -66,3 +66,9 @@ CONFIG_USB_STORAGE=y
> >>  CONFIG_USE_TINY_PRINTF=y
> >>  CONFIG_CMD_DHRYSTONE=y
> >>  CONFIG_ERRNO_STR=y
> >> +CONFIG_USB_GADGET=y
> >> +CONFIG_USB_GADGET_DOWNLOAD=y
> >> +CONFIG_USB_GADGET_VBUS_DRAW=0
> >> +CONFIG_G_DNL_MANUFACTURER="Rockchip"
> >> +CONFIG_G_DNL_VENDOR_NUM=0x2207
> >> +CONFIG_G_DNL_PRODUCT_NUM=0x320a
> >> diff --git a/configs/firefly-rk3288_defconfig
> >> b/configs/firefly-rk3288_defconfig index f2872a6..1f4ca32 100644
> >> --- a/configs/firefly-rk3288_defconfig
> >> +++ b/configs/firefly-rk3288_defconfig
> >> @@ -73,3 +73,9 @@ CONFIG_CONSOLE_SCROLL_LINES=10
> >>  CONFIG_USE_TINY_PRINTF=y
> >>  CONFIG_CMD_DHRYSTONE=y
> >>  CONFIG_ERRNO_STR=y
> >> +CONFIG_USB_GADGET=y
> >> +CONFIG_USB_GADGET_DOWNLOAD=y
> >> +CONFIG_USB_GADGET_VBUS_DRAW=0
> >> +CONFIG_G_DNL_MANUFACTURER="Rockchip"
> >> +CONFIG_G_DNL_VENDOR_NUM=0x2207
> >> +CONFIG_G_DNL_PRODUCT_NUM=0x320a
> >> diff --git a/configs/miqi-rk3288_defconfig
> >> b/configs/miqi-rk3288_defconfig index d93bd97..b8b6fd5 100644
> >> --- a/configs/miqi-rk3288_defconfig
> >> +++ b/configs/miqi-rk3288_defconfig
> >> @@ -70,3 +70,9 @@ 

Re: [U-Boot] [PATCH V7 4/4] rockchip: rk3288: enable rockusb support on rk3288 based device

2017-05-31 Thread Eddie Cai
2017-05-31 15:12 GMT+08:00 Lukasz Majewski :
> On Wed, 31 May 2017 10:27:23 +0800
> Eddie Cai  wrote:
>
>> Hi Lukasz
>>
>> 2017-05-29 15:51 GMT+08:00 Lukasz Majewski :
>> > Good morning Eddie,
>> >
>> >> this patch enable rockusb support on rk3288 based device.
>> >>
>> >> Signed-off-by: Eddie Cai 
>> >> Reviewed-by: Simon Glass 
>> >>
>> >
>> > I've give this patch set a try on travisCI:
>> >
>> > https://travis-ci.org/lmajewski/u-boot-dfu/jobs/237068149
>> >
>> > Unfortunately, there are some problem with following boards:
>> >
>> > chromebook_jerry, chromebook_minnie ...
>> I did it by myself last week. i got the same error. then i fix those
>> chromebook error
>> and test again. I still got some 3036 board error. But it build
>> successfully when i
>> build it on my computer. here is the travis-ci.org error log
>> https://travis-ci.org/eddiecailinux/u-boot/jobs/236232837
>> I have no idea what can i do to fix it.
>
> Can you share the SHA1 of commit on top of which you applied your
> patches?
>
> I take u-boot-usb (the USB u-boot tree from Marek Vasut) as a base and
> then apply commits on top of it.
here is my branch https://github.com/eddiecailinux/u-boot/tree/rockusb-v8
I apply my patch on top of below commit
commit a63d800196ebee59b0f8ff924f67843cd597a8c1
Author: Tom Rini 
Date:   Mon May 1 19:54:41 2017 -0400

Prepare v2017.05-rc3

Signed-off-by: Tom Rini 
>
>> >
>> > caused by "undefined references to "
>> >
>> > I've tried your patches on top of:
>> > u-boot-usb/HEAD
>> > SHA1: 3426b2038cfb831d74ac0407fc7a04e990b44540
>> >
>> > Maybe you have built tested it on other branch/commit?
>> >
>> > Best regards,
>> > Łukasz Majewski
>> >
>> > p.s. My travis CI .travis.yml attached.
>> >
>> >> Changes in v7:
>> >> -use imply in the Kconfig to enable rockusb
>> >>
>> >> Changes in v6:
>> >> -enable rockusb in defconfig
>> >>
>> >> Changes in v5:
>> >> -none
>> >>
>> >> Changes in v4:
>> >> -move to rk3288_common.h
>> >>
>> >> Changes in v3:
>> >> -move to defconfig
>> >>
>> >> ---
>> >>  arch/arm/mach-rockchip/Kconfig| 2 ++
>> >>  configs/evb-rk3288_defconfig  | 9 +
>> >>  configs/fennec-rk3288_defconfig   | 6 ++
>> >>  configs/firefly-rk3288_defconfig  | 6 ++
>> >>  configs/miqi-rk3288_defconfig | 6 ++
>> >>  configs/popmetal-rk3288_defconfig | 6 ++
>> >>  configs/tinker-rk3288_defconfig   | 6 ++
>> >>  include/configs/rk3288_common.h   | 7 ---
>> >>  8 files changed, 41 insertions(+), 7 deletions(-)
>> >>
>> >> diff --git a/arch/arm/mach-rockchip/Kconfig
>> >> b/arch/arm/mach-rockchip/Kconfig index 2b752ad..8a87812 100644
>> >> --- a/arch/arm/mach-rockchip/Kconfig
>> >> +++ b/arch/arm/mach-rockchip/Kconfig
>> >> @@ -32,6 +32,8 @@ config ROCKCHIP_RK3288
>> >>   select CPU_V7
>> >>   select SUPPORT_SPL
>> >>   select SPL
>> >> + imply USB_FUNCTION_ROCKUSB
>> >> + imply CMD_ROCKUSB
>> >>   help
>> >> The Rockchip RK3288 is a ARM-based SoC with a quad-core
>> >> Cortex-A17 including NEON and GPU, 1MB L2 cache, Mali-T7 graphics,
>> >> two diff --git a/configs/evb-rk3288_defconfig
>> >> b/configs/evb-rk3288_defconfig index 227150d..cf66e09 100644
>> >> --- a/configs/evb-rk3288_defconfig
>> >> +++ b/configs/evb-rk3288_defconfig
>> >> @@ -17,6 +17,7 @@ CONFIG_CMD_MMC=y
>> >>  CONFIG_CMD_SF=y
>> >>  CONFIG_CMD_SPI=y
>> >>  CONFIG_CMD_I2C=y
>> >> +CONFIG_CMD_USB=y
>> >>  CONFIG_CMD_GPIO=y
>> >>  # CONFIG_CMD_SETEXPR is not set
>> >>  CONFIG_CMD_CACHE=y
>> >> @@ -61,6 +62,14 @@ CONFIG_DEBUG_UART_CLOCK=2400
>> >>  CONFIG_DEBUG_UART_SHIFT=2
>> >>  CONFIG_SYS_NS16550=y
>> >>  CONFIG_SYSRESET=y
>> >> +CONFIG_USB=y
>> >> +CONFIG_USB_STORAGE=y
>> >>  CONFIG_USE_TINY_PRINTF=y
>> >>  CONFIG_CMD_DHRYSTONE=y
>> >>  CONFIG_ERRNO_STR=y
>> >> +CONFIG_USB_GADGET=y
>> >> +CONFIG_USB_GADGET_DOWNLOAD=y
>> >> +CONFIG_USB_GADGET_VBUS_DRAW=0
>> >> +CONFIG_G_DNL_MANUFACTURER="Rockchip"
>> >> +CONFIG_G_DNL_VENDOR_NUM=0x2207
>> >> +CONFIG_G_DNL_PRODUCT_NUM=0x320a
>> >> diff --git a/configs/fennec-rk3288_defconfig
>> >> b/configs/fennec-rk3288_defconfig index befba18..eb33d00 100644
>> >> --- a/configs/fennec-rk3288_defconfig
>> >> +++ b/configs/fennec-rk3288_defconfig
>> >> @@ -66,3 +66,9 @@ CONFIG_USB_STORAGE=y
>> >>  CONFIG_USE_TINY_PRINTF=y
>> >>  CONFIG_CMD_DHRYSTONE=y
>> >>  CONFIG_ERRNO_STR=y
>> >> +CONFIG_USB_GADGET=y
>> >> +CONFIG_USB_GADGET_DOWNLOAD=y
>> >> +CONFIG_USB_GADGET_VBUS_DRAW=0
>> >> +CONFIG_G_DNL_MANUFACTURER="Rockchip"
>> >> +CONFIG_G_DNL_VENDOR_NUM=0x2207
>> >> +CONFIG_G_DNL_PRODUCT_NUM=0x320a
>> >> diff --git a/configs/firefly-rk3288_defconfig
>> >> b/configs/firefly-rk3288_defconfig index f2872a6..1f4ca32 100644
>> >> --- a/configs/firefly-rk3288_defconfig
>> >> +++ b/configs/firefly-rk3288_defconfig
>> >> @@ -73,3 +73,9 @@ CONFIG_CONSOLE_SCROLL_LINES=10
>> >>  

Re: [U-Boot] [PATCH] arm: mx6: remove unused config variable CONFIG_SPL_NAND_MXS

2017-05-31 Thread Stefano Babic
On 26/05/2017 10:12, Lothar Waßmann wrote:
> The config variable CONFIG_SPL_NAND_MXS is only set in
> include/configs/imx6_spl.h but used nowhere.
> Remove it.
> 
> Signed-off-by: Lothar Waßmann 
> ---

Applied to -master, thanks !

Best regards,
Stefano Babic


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


Re: [U-Boot] [PATCH v2 5/6] rename GPT partitions to detect boot failure

2017-05-31 Thread Lukasz Majewski
Hi Alison,

> From: Alison Chaiken 
> 
> This patch provides support in u-boot for renaming GPT
> partitions.  The renaming is accomplished via a new 'gpt flip'
> command which is enabled via a CONFIG_CMD_GPT_FLIP option.
> 
> The concept for the bootloader state machine is the following:
> 
> -- u-boot renames ‘primary’ partitions as ‘candidate’ and tries
>to boot them.
> -- Linux, at boot, will rename ‘candidate’ partitions as
>‘primary’.
> -- If u-boot sees a ‘candidate’ partition after a boot attempt,
>it renames it failed’ and renames the ‘backup’ partition as
>‘candidate’.
> 
> Logic:
> -- Partitions can go to ‘failed’ only from ‘candidate’ and only
>via u-boot.  Partitions can go to ‘backup’ only from ‘primary’
>and vice-versa, only via Linux.  Partitions go to ‘candidate’
>from ‘primary’ or ‘backup’ only via u-boot.  Only system
>update software will rename 'failed' partitions.
> 
> Rewriting the partition table has the side-effect that all partitions
> end up with "msftdata" flag set.  The reason is that partition type
> PARTITION_BASIC_DATA_GUID is hard-coded in the gpt_fill_pte()
> function.  This does not appear to cause any harm.
> 
> Signed-off-by: Alison Chaiken 
> ---
>  cmd/Kconfig|   7 ++
>  cmd/gpt.c  | 199
> +++--
> doc/README.gpt |  13  3 files changed, 215 insertions(+), 4
> deletions(-)
> 
> diff --git a/cmd/Kconfig b/cmd/Kconfig
> index 5ee52f6..a8f7716 100644
> --- a/cmd/Kconfig
> +++ b/cmd/Kconfig
> @@ -575,6 +575,13 @@ config CMD_GPT
> Enable the 'gpt' command to ready and write GPT style
> partition tables.
>  
> +config CMD_GPT_FLIP
> + bool "GPT flip-partitions command"
> + depends on CMD_GPT
> + help
> +   Enables the 'gpt' command to write modified GPT partition
> +   tables via the 'gpt flip' command.
> +
>  config CMD_ARMFLASH
>   #depends on FLASH_CFI_DRIVER
>   bool "armflash"
> diff --git a/cmd/gpt.c b/cmd/gpt.c
> index c61d2b1..6a0b70f 100644
> --- a/cmd/gpt.c
> +++ b/cmd/gpt.c
> @@ -20,6 +20,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  
>  static LIST_HEAD(disk_partitions);
>  
> @@ -190,16 +191,33 @@ static struct disk_part
> *allocate_disk_part(disk_partition_t *info, int partnum) return
> newpart; }
>  
> +static void prettyprint_part_size(char *sizestr, unsigned long
> partsize,
> +   unsigned long blksize)
> +{
> + unsigned long long partbytes;
> + unsigned long partmegabytes;
> +
> + partbytes = partsize * blksize;
> + partmegabytes = lldiv(partbytes, SZ_1M);
> + snprintf(sizestr, 16, "%luMiB", partmegabytes);
> +}
> +
>  static void print_gpt_info(void)
>  {
>   struct list_head *pos;
>   struct disk_part *curr;
> + char partstartstr[16];
> + char partsizestr[16];
>  
>   list_for_each(pos, _partitions) {
>   curr = list_entry(pos, struct disk_part, list);
> + prettyprint_part_size(partstartstr, (unsigned
> long)curr->gpt_part_info.start,
> +   (unsigned long)
> curr->gpt_part_info.blksz);
> + prettyprint_part_size(partsizestr, (unsigned
> long)curr->gpt_part_info.size,
> +   (unsigned long)
> curr->gpt_part_info.blksz); +
>   printf("Partition %d:\n", curr->partnum);
> - printf("1st block %x, size %x\n",
> (unsigned)curr->gpt_part_info.start,
> -(unsigned)curr->gpt_part_info.size);
> + printf("Start %s, size %s\n", partstartstr,
> partsizestr); printf("Block size %lu, name %s\n",
> curr->gpt_part_info.blksz, curr->gpt_part_info.name);
>   printf("Type %s, bootable %d\n",
> curr->gpt_part_info.type, @@ -211,6 +229,85 @@ static void
> print_gpt_info(void) }
>  }
>  
> +#ifdef CONFIG_CMD_GPT_FLIP
> +static int calc_parts_list_len(int numparts)
> +{
> + /*
> +  * prefatory string:
> +  * doc/README.GPT, suggests that
> +  * int partlistlen = UUID_STR_LEN + 1 +
> strlen("partitions=uuid_disk=");
> +  * is correct, but extract_val() expects "uuid_disk" first.
> +  */
> + int partlistlen = UUID_STR_LEN + 1 + strlen("uuid_disk=");
> + /* for the comma */
> + partlistlen++;
> +
> + /* per-partition additions; numparts starts at 1, so this
> should be correct */
> + partlistlen += numparts * (strlen("name=,") + PART_NAME_LEN
> + 1);
> + /* 17 because partstr in create_gpt_partitions_list() is 16
> chars */
> + partlistlen += numparts * (strlen("start=MiB,") + 17);
> + partlistlen += numparts * (strlen("size=MiB,") + 17);
> + partlistlen += numparts * (strlen("uuid=;") + UUID_STR_LEN +
> 1);
> + /* for the terminating null */
> + partlistlen++;
> + debug("Length of partitions_list is %d for %d partitions\n",
> partlistlen,
> +numparts);
> + return partlistlen;
> 

Re: [U-Boot] [PATCH 2/4] x86: baytrail: Remove "serial-debug-port-*" settings

2017-05-31 Thread Stefan Roese

On 31.05.2017 10:04, Bin Meng wrote:

"serial-debug-port-address" and "serial-debug-port-type" settings
are actually reserved in the FSP UPD data structure. Remove them.

Signed-off-by: Bin Meng 


Reviewed-by: Stefan Roese 

Thanks,
Stefan
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 1/4] x86: baytrail: Change "fsp, mrc-init-tseg-size" default value to 1

2017-05-31 Thread Stefan Roese

On 31.05.2017 10:04, Bin Meng wrote:

The default value of "fsp,mrc-init-tseg-size" should be 1 (1MB) per
FSP default settings. 0 is not valid.

Signed-off-by: Bin Meng 


How does this change affect the x86 U-Boot versions? Did you
experience any problems with the incorrect value of 0?

Reviewed-by: Stefan Roese 

Thanks,
Stefan
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] Please pull u-boot-marvell/master

2017-05-31 Thread Stefan Roese
Hi Tom,

please pull the following Marvell changes, mostly including
the Armada 37xx pinctrl / gpio driver.

Thanks,
Stefan

The following changes since commit ccbbada0a59fead35495409d0c2c7bcb22a40278:

  Merge branch 'master' of git://git.denx.de/u-boot-mmc (2017-05-30 14:07:23 
-0400)

are available in the git repository at:

  git://www.denx.de/git/u-boot-marvell.git 

for you to fetch changes up to 6cbf7eda3cbe0f8cbaa84b4daaa86dfa2a696a77:

  arm: mvebu: kwbimage: inline function to fix use-after-free (2017-05-31 
07:43:04 +0200)


Gregory CLEMENT (4):
  arm64: mvebu: Add pinctrl nodes for Armada 3700
  arm64: mvebu: armada37xx: add pinctrl definition
  pinctrl: armada-37xx: Add pin controller support for Armada 37xx
  pinctrl: armada-37xx: Add gpio support

Patrick Wildt (3):
  arm: mvebu: clearfog: reset uSOM onboard 1512 phy
  arm: mvebu: clearfog: generic distro bootcmd
  arm: mvebu: kwbimage: inline function to fix use-after-free

Stefan Roese (4):
  pinctrl: mvebu: Enable support for the Armada 37xx pinctrl driver
  arm64: mvebu_db-88f3720_defconfig: Enable PINCTRL and GPIO support
  arm64: mvebu: armada-7040-db: Enable 10GB port 0 / SFI (KR)
  arm64: mvebu: Replace board specific with generic memory bank decoding

 arch/arm/dts/armada-3720-db.dts |   8 +
 arch/arm/dts/armada-37xx.dtsi   |  73 
 arch/arm/dts/armada-7040-db.dts |   8 +-
 arch/arm/mach-mvebu/arm64-common.c  |  66 +--
 board/solidrun/clearfog/clearfog.c  |   4 +
 configs/clearfog_defconfig  |  10 +-
 configs/mvebu_db-88f3720_defconfig  |   5 +
 configs/mvebu_db-88f7040-nand_defconfig |   8 +-
 configs/mvebu_db-88f7040_defconfig  |   1 +
 configs/mvebu_db-88f8040_defconfig  |   1 +
 configs/mvebu_mcbin-88f8040_defconfig   |   1 +
 drivers/pinctrl/Makefile|   2 +-
 drivers/pinctrl/mvebu/Kconfig   |  18 +-
 drivers/pinctrl/mvebu/Makefile  |   3 +-
 drivers/pinctrl/mvebu/pinctrl-armada-37xx.c | 631 
 include/configs/clearfog.h  |  48 ++-
 tools/kwbimage.c|  93 ++--
 17 files changed, 851 insertions(+), 129 deletions(-)
 create mode 100644 drivers/pinctrl/mvebu/pinctrl-armada-37xx.c
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v3] spi: fsl_qspi: Copy 16 byte aligned data in TX FIFO

2017-05-31 Thread Suresh Gupta
In some of the QSPI controller version, there must be atleast
128bit data available in TX FIFO for any pop operation otherwise
error bit will be set. The code will not make any behavior change
for previous controller as the transfer data size in ipcr register
is still the same.

Patch is tested on LS1046A which do not require 16 bytes aligned and
LS1088A which require 16 bytes aligned data in TX FIFO

Signed-off-by: Suresh Gupta 
---

Changes in v3:
- Change multi-line comment style

Changes in v2:
- Change commit message
- Add "if" condition in replace of "size += (tx_size % 16) != 0;"


 drivers/spi/fsl_qspi.c | 18 --
 1 file changed, 8 insertions(+), 10 deletions(-)

diff --git a/drivers/spi/fsl_qspi.c b/drivers/spi/fsl_qspi.c
index e61c67b..9036795 100644
--- a/drivers/spi/fsl_qspi.c
+++ b/drivers/spi/fsl_qspi.c
@@ -659,22 +659,20 @@ static void qspi_op_write(struct fsl_qspi_priv *priv, u8 
*txbuf, u32 len)
tx_size = (len > TX_BUFFER_SIZE) ?
TX_BUFFER_SIZE : len;
 
-   size = tx_size / 4;
-   for (i = 0; i < size; i++) {
+   size = tx_size / 16;
+   /*
+* There must be atleast 128bit data
+* available in TX FIFO for any pop operation
+*/
+   if (tx_size % 16)
+   size++;
+   for (i = 0; i < size*4; i++) {
memcpy(, txbuf, 4);
data = qspi_endian_xchg(data);
qspi_write32(priv->flags, >tbdr, data);
txbuf += 4;
}
 
-   size = tx_size % 4;
-   if (size) {
-   data = 0;
-   memcpy(, txbuf, size);
-   data = qspi_endian_xchg(data);
-   qspi_write32(priv->flags, >tbdr, data);
-   }
-
qspi_write32(priv->flags, >ipcr,
 (seqid << QSPI_IPCR_SEQID_SHIFT) | tx_size);
while (qspi_read32(priv->flags, >sr) & QSPI_SR_BUSY_MASK)
-- 
1.9.3

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


Re: [U-Boot] [PATCH v2 6/6] GPT: fix error in partitions string doc

2017-05-31 Thread Lukasz Majewski
Hi Alison,

> From: Alison Chaiken 
> 
> The existing partitions-list parsing in cmd/gpt.c passes a value
> from gpt_default() to set_gpt_info() that README.gpt suggests
> should begin with 'partitions='.  Partition-list strings should
> in fact begin with 'uuid_disk', as otherwise the call from
> set_gpt_info() to extract_val() to find 'uuid_disk' will fail.
> Change README.gpt and file comments accordingly.

Acked-by: Lukasz Majewski 

Thank you for updating the README.gpt entry.

> 
> Signed-off-by: Alison Chaiken 
> ---
>  cmd/gpt.c  | 13 +
>  doc/README.gpt |  8 
>  2 files changed, 5 insertions(+), 16 deletions(-)
> 
> diff --git a/cmd/gpt.c b/cmd/gpt.c
> index 6a0b70f..487314b 100644
> --- a/cmd/gpt.c
> +++ b/cmd/gpt.c
> @@ -232,12 +232,6 @@ static void print_gpt_info(void)
>  #ifdef CONFIG_CMD_GPT_FLIP
>  static int calc_parts_list_len(int numparts)
>  {
> - /*
> -  * prefatory string:
> -  * doc/README.GPT, suggests that
> -  * int partlistlen = UUID_STR_LEN + 1 +
> strlen("partitions=uuid_disk=");
> -  * is correct, but extract_val() expects "uuid_disk" first.
> -  */
>   int partlistlen = UUID_STR_LEN + 1 + strlen("uuid_disk=");
>   /* for the comma */
>   partlistlen++;
> @@ -260,7 +254,7 @@ static int calc_parts_list_len(int numparts)
>   * argument
>   *
>   * From doc/README.gpt, Format of partitions layout:
> - *"partitions=uuid_disk=...;name=u-boot,size=60MiB,uuid=...;
> + *"uuid_disk=...;name=u-boot,size=60MiB,uuid=...;
>   *   name=kernel,size=60MiB,uuid=...;"
>   * The fields 'name' and 'size' are mandatory for every partition.
>   * The field 'start' is optional. The fields 'uuid' and 'uuid_disk'
> @@ -275,11 +269,6 @@ static int create_gpt_partitions_list(int
> numparts, const char *guid, char *part if (!partitions_list)
>   return -1;
>  
> - /*
> -  * README.gpt specifies starting with "partitions=" like so:
> -  *  strcpy(partitions_list, "partitions=uuid_disk=");
> -  * but that breaks extract_val, which doesn't skip over
> 'partitions='.
> -  */
>   strcpy(partitions_list, "uuid_disk=");
>   strncat(partitions_list, guid, UUID_STR_LEN + 1);
>   strcat(partitions_list, ";");
> diff --git a/doc/README.gpt b/doc/README.gpt
> index e29b188..754e490 100644
> --- a/doc/README.gpt
> +++ b/doc/README.gpt
> @@ -156,10 +156,10 @@ Creating GPT partitions in U-Boot:
>  To restore GUID partition table one needs to:
>  1. Define partition layout in the environment.
> Format of partitions layout:
> - "partitions=uuid_disk=...;name=u-boot,size=60MiB,uuid=...;
> + "uuid_disk=...;name=u-boot,size=60MiB,uuid=...;
>   name=kernel,size=60MiB,uuid=...;"
>   or
> - "partitions=uuid_disk=${uuid_gpt_disk};name=${uboot_name},
> + "uuid_disk=${uuid_gpt_disk};name=${uboot_name},
>   size=${uboot_size},uuid=${uboot_uuid};"
>  
> The fields 'name' and 'size' are mandatory for every partition.
> @@ -233,7 +233,7 @@ PARTITION_BASIC_DATA_GUID
> (EBD0A0A2-B9E5-4433-87C0-68B6B72699C7). If you define
> 'CONFIG_PARTITION_TYPE_GUID', a optionnal parameter 'type' can
> specify a other partition type guid: 
> - "partitions=uuid_disk=...;name=u-boot,size=60MiB,uuid=...;
> + "uuid_disk=...;name=u-boot,size=60MiB,uuid=...;
>   name=kernel,size=60MiB,uuid=...,
>   type=0FC63DAF-8483-4772-8E79-3D69D8477DE4;"
>  
> @@ -255,7 +255,7 @@ Some strings can be also used at the place of
> known GUID : "lvm"= PARTITION_LINUX_LVM_GUID
>  (E6D6D379-F507-44C2-A23C-238F2A3DF928)
>  
> -"partitions=uuid_disk=...;name=u-boot,size=60MiB,uuid=...;
> +"uuid_disk=...;name=u-boot,size=60MiB,uuid=...;
>   name=kernel,size=60MiB,uuid=...,type=linux;"
>  
>  They are also used to display the type of partition in "part list"
> command.




Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 3/4] x86: baytrail: Use macros instead of magic numbers for FSP settings

2017-05-31 Thread Stefan Roese

On 31.05.2017 10:04, Bin Meng wrote:

Introduce various meaningful macros for FSP settings and switch over
to use them instead of magic numbers.

Signed-off-by: Bin Meng 


Looks very good, much more descriptive this way. Thanks for working
on this. :)

Reviewed-by: Stefan Roese 

Thanks,
Stefan
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH V7 4/4] rockchip: rk3288: enable rockusb support on rk3288 based device

2017-05-31 Thread Eddie Cai
2017-05-31 16:22 GMT+08:00 Lukasz Majewski :
> Hi Eddie,
>
>> > Prepare v2017.05-rc3
>> >
>> > Signed-off-by: Tom Rini 
>>
>> Ok. Thanks for the info.
>>
>> The u-boot-usb seems to be a bit older.
>^^ sorry newer :-)
>
> "usb: ehci: Add Renesas RCar M3/H3 EHCI support"
> 3426b2038cfb831d74ac0407fc7a04e990b44540
>
>>
>> Anyway, have you tried with compiling your code with toolchains
>> suggested by Tom?
Yes. I tried to build with this toolchain on my computer. It build
successfully, but i got below warning.

  CC  spl/arch/arm/mach-rockchip/rk3036-board-spl.o
arch/arm/mach-rockchip/rk3036-board-spl.c:20:34: warning: ‘grf’
defined but not used [-Wunused-const-variable=]
 static struct rk3036_grf * const grf = (void *)GRF_BASE;

I don't think it relate to my patches. so i checkout below commit and
build with the same toolchain again. i got the same warning.
commit a63d800196ebee59b0f8ff924f67843cd597a8c1
Author: Tom Rini 
Date:   Mon May 1 19:54:41 2017 -0400

Prepare v2017.05-rc3

Signed-off-by: Tom Rini 
>>
>> Best regards,
>> Łukasz Majewski
>>
>> > >
>
>
>
> Best regards,
>
> Lukasz Majewski
>
> --
>
> DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
> Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 4/4] x86: baytrail: Change lpe/lpss-sio/scc FSP properties to integer

2017-05-31 Thread Stefan Roese

On 31.05.2017 10:04, Bin Meng wrote:

At present lpe/lpss-sio/scc FSP properties are all boolean, but in
fact for "enable-lpe" it has 3 possible options. This adds macros
for these options and change the property from a boolean type to
an integer type, and change their names to explicitly indicate what
the property is really for.

Signed-off-by: Bin Meng 


Reviewed-by: Stefan Roese 

Thanks,
Stefan
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 0/9] i.MX6: Engicam: Move common config code

2017-05-31 Thread Stefano Babic
Hi Jagan,

On 12/05/2017 13:48, Jagan Teki wrote:
> From: Jagan Teki 
> 
> This series move configs code used by different i.MX6 SOM's into
> single config file, include/configs/imx6-engicam.h
> 
> (1) Generate single config file imx6-engicam.h
> (2) Drop 4 som based config files
> (3) Add Kconfig entry for PHY_MICREL_KSZ9021
> 
> thanks!
> Jagan.
> 
> Jagan Teki (9):
>   mmc: fsl_esdhc: Move non DM_MMC code
>   engicam: Move SPL mmc configs under CONFIG_SPL_BUILD
>   icorem6: Recover missing nand defconfig
>   drivers: net: Kconfig: Add PHY_MICREL_KSZ9021 entry
>   engicam: Move PHY configs to defconfig
>   icorem6: Remove unused FEC configs
>   engicam: Set console env on board_late_init
>   engicam: Add fdt_addr env value based on cpu_type
>   engicam: Generate single config file
> 
>  board/engicam/common/board.c   |   5 +
>  board/engicam/geam6ul/Kconfig  |   2 +-
>  board/engicam/icorem6/Kconfig  |   2 +-
>  board/engicam/icorem6_rqs/Kconfig  |   2 +-
>  board/engicam/isiotmx6ul/Kconfig   |   2 +-
>  configs/imx6qdl_icore_mmc_defconfig|   2 +
>  configs/imx6qdl_icore_nand_defconfig   |  47 +
>  configs/imx6qdl_icore_rqs_mmc_defconfig|   3 +
>  configs/imx6ul_geam_mmc_defconfig  |   2 +
>  configs/imx6ul_geam_nand_defconfig |   2 +
>  configs/imx6ul_isiot_emmc_defconfig|   2 +
>  configs/imx6ul_isiot_mmc_defconfig |   2 +
>  configs/imx6ul_isiot_nand_defconfig|   2 +
>  drivers/mmc/fsl_esdhc.c|  30 ++--
>  drivers/net/phy/Kconfig|   8 +
>  .../configs/{imx6qdl_icore.h => imx6-engicam.h}|  47 +++--
>  include/configs/imx6qdl_icore_rqs.h| 149 
>  include/configs/imx6ul_geam.h  | 197 
>  include/configs/imx6ul_isiot.h | 198 
> -
>  19 files changed, 127 insertions(+), 577 deletions(-)
>  create mode 100644 configs/imx6qdl_icore_nand_defconfig
>  rename include/configs/{imx6qdl_icore.h => imx6-engicam.h} (84%)
>  delete mode 100644 include/configs/imx6qdl_icore_rqs.h
>  delete mode 100644 include/configs/imx6ul_geam.h
>  delete mode 100644 include/configs/imx6ul_isiot.h
> 

Applied to u-boot-imx -master, thanks !

Best regards,
Stefano Babic


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


Re: [U-Boot] [PATCH] arm: mvebu: clearfog: generic distro bootcmd

2017-05-31 Thread Stefan Roese

On 10.05.2017 15:12, Patrick Wildt wrote:

Switch Clearfog to the generic distro defaults.  This has been taken
from a Debian mailing list thread:

https://lists.debian.org/debian-boot/2016/10/msg00026.html

Signed-off-by: Patrick Wildt 


Applied to u-boot-marvell/master.

Thanks,
Stefan
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH] arm: mvebu: clearfog: reset uSOM onboard 1512 phy

2017-05-31 Thread Stefan Roese

On 09.05.2017 13:54, Patrick Wildt wrote:

Use GPIO19 which is wired to the uSOM phy reset signal in order to reset
the uSOM's 1512 Gigabit Ethernet phy.

This GPIO is valid on ClearFog rev 2.1 and newer.

Taken from SolidRun's specialised u-boot, see
https://github.com/SolidRun/u-boot-armada38x/commit/f906e3df172e07ac82cdd87b278d7896949262ea

Signed-off-by: Patrick Wildt 


Applied to u-boot-marvell/master.

Thanks,
Stefan
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 1/4] x86: baytrail: Change "fsp, mrc-init-tseg-size" default value to 1

2017-05-31 Thread Bin Meng
Hi Stefan,

On Wed, May 31, 2017 at 4:18 PM, Stefan Roese  wrote:
> On 31.05.2017 10:04, Bin Meng wrote:
>>
>> The default value of "fsp,mrc-init-tseg-size" should be 1 (1MB) per
>> FSP default settings. 0 is not valid.
>>
>> Signed-off-by: Bin Meng 
>
>
> How does this change affect the x86 U-Boot versions? Did you
> experience any problems with the incorrect value of 0?

What do you mean by "affecting the x86 U-Boot versions"? Do you want
to track back which U-Boot version introduce the wrong tseg-size
setting?

I did not experience any problems with the incorrect value of 0,
probably because U-Boot does not have SMM support yet. But definitely
it is wrong.

Regards,
Bin
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH] arm64: hikey: Fix instructions in readme

2017-05-31 Thread Michal Simek
Fix inaccurate instructions in README.

Signed-off-by: Michal Simek 
---

 board/hisilicon/hikey/README | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/board/hisilicon/hikey/README b/board/hisilicon/hikey/README
index 0f6aab717c4e..4c2021f5097a 100644
--- a/board/hisilicon/hikey/README
+++ b/board/hisilicon/hikey/README
@@ -56,7 +56,7 @@ Compile U-Boot
 Compile ARM Trusted Firmware (ATF)
 ==
 
-  > cd ~/hikey/src/atf
+  > cd ~/hikey/src/arm-trusted-firmware
   > make CROSS_COMPILE=aarch64-linux-gnu- all fip \
 BL30=~/hikey/bin/mcuimage.bin \
 BL33=~/hikey/bin/u-boot.bin DEBUG=1 PLAT=hikey
@@ -67,10 +67,10 @@ Copy resulting binaries
 
 Compile l-loader
 ===
-  > cd ~/hikey/l-loader
+  > cd ~/hikey/src/l-loader
   > make BL1=~/hikey/bin/bl1.bin all
   > cp *.img ~/hikey/bin
-  > cp l-loader.bin ~/hikey.bin
+  > cp l-loader.bin ~/hikey/bin
 
 These instructions are adapted from
 https://github.com/96boards/documentation/wiki/HiKeyUEFI
@@ -82,7 +82,7 @@ FLASHING
 the hisi-idt.py utility.
 
 The command below assumes HiKey enumerated as the first USB serial port
-  > sudo ~/hikey/burn_boot/hisi-idt.py -d /dev/ttyUSB0 
--img1=~/hikey/bin/l-loader.bin
+  > sudo ~/hikey/src/burn-boot/hisi-idt.py -d /dev/ttyUSB0 
--img1=~/hikey/bin/l-loader.bin
 
 2. Once LED 0 comes on solid, HiKey board should be detected as a fastboot 
device by plugging a USB A to mini B
cable from your PC to the USB OTG port of HiKey (on some boards I've found 
this to be unreliable).
-- 
1.9.1

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


Re: [U-Boot] [PATCH v5 5/16] cmd: Add Kconfig option for CMD_MTDPARTS and related options

2017-05-31 Thread Jörg Krause
Hi Maxime,

On Tue, 2017-05-30 at 23:09 +0200, Maxime Ripard wrote:
> Hi Jörg,
> 
> On Tue, May 30, 2017 at 09:39:57AM +0200, Jörg Krause wrote:
> > On Mon, 2017-02-27 at 18:22 +0100, Maxime Ripard wrote:
> > > CMD_MTDPARTS is something the user might or might not want to
> > > select,
> > > and
> > > might depends on (or be selected by) other options too.
> > > 
> > > This is even truer for the MTDIDS_DEFAULT and MTDPARTS_DEFAULT
> > > options that
> > > might change from one board to another, or from one user to the
> > > other,
> > > depending on what it expects and what storage devices are
> > > available.
> > > 
> > > In order to ease that configuration, add those options to
> > > Kconfig.
> > > 
> > > Signed-off-by: Maxime Ripard 
> > > Reviewed-by: Tom Rini 
> > > ---
> > >  cmd/Kconfig| 20 
> > >  cmd/mtdparts.c |  8 
> > >  2 files changed, 28 insertions(+), 0 deletions(-)
> > > 
> > > diff --git a/cmd/Kconfig b/cmd/Kconfig
> > > index ef5315631476..0734d669dbd7 100644
> > > --- a/cmd/Kconfig
> > > +++ b/cmd/Kconfig
> > > @@ -801,6 +801,26 @@ config CMD_FS_GENERIC
> > >   help
> > > Enables filesystem commands (e.g. load, ls) that work
> > > for
> > > multiple
> > > fs types.
> > > +
> > > +config CMD_MTDPARTS
> > > + depends on ARCH_SUNXI
> > 
> > Is there any reason to limit the command for the sunxi arch only?
> 
> Yes, if we don't, this will generate warnings for each architecture
> that has not moved that option from their header to Kconfig.

I see! However, wouldn't it be best to migrate all architectures to
Kconfig instead of doing it seperately?

Jörg
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 2/4] mx25: Fix imx_get_perclk()

2017-05-31 Thread Stefano Babic
On 03/05/2017 11:59, Benoît Thébaudeau wrote:
> imx_get_perclk() used the AHB clock as the clock source for all PER
> clocks, but the USB PLL output can also be a PER clock source if the
> corresponding PER CLK MUX bit is set in CCM.MCR.
> 
> Signed-off-by: Benoît Thébaudeau 
> ---
>  arch/arm/cpu/arm926ejs/mx25/generic.c | 11 ++-
>  1 file changed, 10 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm/cpu/arm926ejs/mx25/generic.c 
> b/arch/arm/cpu/arm926ejs/mx25/generic.c
> index 0b1a8f4..f02cffb 100644
> --- a/arch/arm/cpu/arm926ejs/mx25/generic.c
> +++ b/arch/arm/cpu/arm926ejs/mx25/generic.c
> @@ -58,6 +58,14 @@ static ulong imx_get_mpllclk(void)
>   return imx_decode_pll(readl(>mpctl), fref);
>  }
>  
> +static ulong imx_get_upllclk(void)
> +{
> + struct ccm_regs *ccm = (struct ccm_regs *)IMX_CCM_BASE;
> + ulong fref = MXC_HCLK;
> +
> + return imx_decode_pll(readl(>upctl), fref);
> +}
> +
>  static ulong imx_get_armclk(void)
>  {
>   struct ccm_regs *ccm = (struct ccm_regs *)IMX_CCM_BASE;
> @@ -95,7 +103,8 @@ static ulong imx_get_ipgclk(void)
>  static ulong imx_get_perclk(int clk)
>  {
>   struct ccm_regs *ccm = (struct ccm_regs *)IMX_CCM_BASE;
> - ulong fref = imx_get_ahbclk();
> + ulong fref = readl(>mcr) & (1 << clk) ? imx_get_upllclk() :
> +  imx_get_ahbclk();
>   ulong div;
>  
>   div = readl(>pcdr[CCM_PERCLK_REG(clk)]);
> 
Applied to u-boot-imx -master, thanks !

Best regards,
Stefano Babic


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


Re: [U-Boot] [PATCH 3/4] mx25: Add function to set PER clocks

2017-05-31 Thread Stefano Babic
On 03/05/2017 11:59, Benoît Thébaudeau wrote:
> Introduce the imx_set_perclk() function to make it possible to set the
> PER clocks.
> 
> Signed-off-by: Benoît Thébaudeau 
> ---
>  arch/arm/cpu/arm926ejs/mx25/generic.c  | 19 +++
>  arch/arm/include/asm/arch-mx25/clock.h |  1 +
>  2 files changed, 20 insertions(+)
> 
> diff --git a/arch/arm/cpu/arm926ejs/mx25/generic.c 
> b/arch/arm/cpu/arm926ejs/mx25/generic.c
> index f02cffb..5d9bc6c 100644
> --- a/arch/arm/cpu/arm926ejs/mx25/generic.c
> +++ b/arch/arm/cpu/arm926ejs/mx25/generic.c
> @@ -113,6 +113,25 @@ static ulong imx_get_perclk(int clk)
>   return fref / div;
>  }
>  
> +int imx_set_perclk(enum mxc_clock clk, bool from_upll, unsigned int freq)
> +{
> + struct ccm_regs *ccm = (struct ccm_regs *)IMX_CCM_BASE;
> + ulong fref = from_upll ? imx_get_upllclk() : imx_get_ahbclk();
> + ulong div = (fref + freq - 1) / freq;
> +
> + if (clk > MXC_UART_CLK || !div || --div > CCM_PERCLK_MASK)
> + return -EINVAL;
> +
> + clrsetbits_le32(>pcdr[CCM_PERCLK_REG(clk)],
> + CCM_PERCLK_MASK << CCM_PERCLK_SHIFT(clk),
> + div << CCM_PERCLK_SHIFT(clk));
> + if (from_upll)
> + setbits_le32(>mcr, 1 << clk);
> + else
> + clrbits_le32(>mcr, 1 << clk);
> + return 0;
> +}
> +
>  unsigned int mxc_get_clock(enum mxc_clock clk)
>  {
>   if (clk >= MXC_CLK_NUM)
> diff --git a/arch/arm/include/asm/arch-mx25/clock.h 
> b/arch/arm/include/asm/arch-mx25/clock.h
> index 9fdaa9d..7753caf 100644
> --- a/arch/arm/include/asm/arch-mx25/clock.h
> +++ b/arch/arm/include/asm/arch-mx25/clock.h
> @@ -51,6 +51,7 @@ enum mxc_clock {
>   MXC_CLK_NUM
>  };
>  
> +int imx_set_perclk(enum mxc_clock clk, bool from_upll, unsigned int freq);
>  unsigned int mxc_get_clock(enum mxc_clock clk);
>  
>  #define imx_get_uartclk()mxc_get_clock(MXC_UART_CLK)
> 
Applied to u-boot-imx -master, thanks !

Best regards,
Stefano Babic


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


Re: [U-Boot] [PATCH v2 3/6] GPT: add accessor function for disk GUID

2017-05-31 Thread Lothar Waßmann
Hi,

On Wed, 31 May 2017 09:44:43 +0200 Lukasz Majewski wrote:
> Hi Alison,
> 
> > From: Alison Chaiken 
> > 
> > In order to read the GPT, modify the partition name strings, and then
> > write out a new GPT, the disk GUID is needed.  While there is an
> > existing accessor for the partition UUIDs, there is none yet for the
> > disk GUID.
> 
> Acked-by: Lukasz Majewski 
> 
Did you read my comments on this patch in:
<20170530084651.545d9...@ipc1.ka-ro>
e.g.:
|> +if (argc == 5)
|> +   strcpy(varname, argv[4]);
|>  
|You didn't allocate any memory for varname and copy the argument string
|to a NULL pointer!
|Maybe use strdup() and free varname after use?



Lothar Waßmann
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v2 4/6] GPT: read partition table from device into a data structure

2017-05-31 Thread Lothar Waßmann
Hi,

On Wed, 31 May 2017 09:48:45 +0200 Lukasz Majewski wrote:
> Hi Alison,
> 
> > From: Alison Chaiken 
> > 
> > Make the partition table available for modification by reading it from
> > the user-specified device into a linked list.   Provide an accessor
> > function for command-line testing.
> 
> Acked-by: Lukasz Majewski 
> 
You definitely should read other peoples comments on patches before
blindly Acking them!


Lothar Waßmann
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v3 0/3] rockchip: mkimage: refactor rksd/rkspi padding calculation and add dumpimage support

2017-05-31 Thread Andy Yan
Hi Philipp:

2017-05-31 5:32 GMT+08:00 Philipp Tomsich <
philipp.toms...@theobroma-systems.com>:

>
> We support booting both from SD/MMC images and SPI images on the
> RK3399-Q7 for different use-cases (e.g. external boot in development
> from the SD card, internal boot from MMC or SPI depending on whether
> the SPI flash is populated on any given configuration option).
>
> In getting the SPI image support ready for production, we found a
> few areas that warranted improvements:
> - we had broken SPI bootstrap earlier in the changes introducting
>   boot0-style images for the RK3399 (this needed fixing)
> - in fixing the broken SPI padding calculation, it became apparent
>   that it's best to refactor and document things before we make
>   the same mistake again in the future
> - with both SD/MMC and SPI images being used for various purposes
>   by various people, the wrong image style was inadvertendly used
>   in some tests... so we support for 'dumpimage' (i.e. verify_header
>   and print_header) had to be added to quickly check the image
>   type being handled
>
> With v3, we pad the images to 2KB again, as this is required by the
> BootROM (see https://lists.denx.de/pipermail/u-boot/2017-May/293268.html).
>
> Changes in v3:
> - (added patch) forces the alignment/padding to 2KB for SD images, as
>   this would otherwise break the back-to-bootrom functionality
> - added in v3
>
> Changes in v2:
> - (in rkcommon_verify_header): changed to use a standard error
>   (i.e. from errno.h) to convey 'header0 signature does not match'
>   [squash of: "rockchip: mkimage: don't mix standard errors and FDT"]
>
> Philipp Tomsich (3):
>   rockchip: mkimage: add support for verify_header/print_header
>   rockchip: mkimage: force 2KB alignment for init_size
>   rockchip: mkimage: set init_boot_size to avoid confusing the boot ROM
>
>  tools/rkcommon.c | 130 ++
> ++---
>  tools/rkcommon.h |  20 +
>  tools/rksd.c |  35 ---
>  tools/rkspi.c|  23 ++
>  4 files changed, 158 insertions(+), 50 deletions(-)
>
> --
> 1.9.1
>
>  For patch (2)(3): Tested-by: Andy Yan  on
RV1108 evb board.
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH] drivers: pci: imx: add imx_pcie_remove function

2017-05-31 Thread Stefano Babic
Hi Tim,

On 18/05/2017 16:35, Stefano Babic wrote:
>> Stefano,
>>
>> My patch is not intrusive and it appears several people are wanting
>> it. Why not accept my patch which will end up getting re-written once
>> the PCI driver is moved to DM?
> 
> Well, most drivers are already moved to DM and there is a clear path to
> go on in this direction. It is not strange or something special with PCI
> driver. I am just asking if there is a volunteer to take over the job (I
> understand that we are all quite busy, but Jagan offers himself as
> volunteer). I fully agree that it is bad to let it broken, and I will
> merge this as it is if there will not a patch in time for release.

As promised: I merge it and moving to DM can be done in a follow-up
patch when someone has time for it. In the meantime, this fix a grave issue.

Applied to -master, thanks !

Best regards,
Stefano Babic



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


Re: [U-Boot] [PATCH] pico-imx7d: Add initial support

2017-05-31 Thread Stefano Babic
On 08/05/2017 18:17, Vanessa Maegima wrote:
> Add the initial support for pico-imx7d board based on Wig Cheng's
> source code.
> 
> Add support for eMMC, USB gadget, I2C, PMIC and Ethernet.
> 
> For more information about this board, please visit:
> http://www.technexion.org/products/pico/pico-som/pico-imx7-emmc
> 
> Signed-off-by: Vanessa Maegima 
> ---

Applied to -master, thanks !

Best regards,
Stefano Babic


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


Re: [U-Boot] [PATCH V7 4/4] rockchip: rk3288: enable rockusb support on rk3288 based device

2017-05-31 Thread Lukasz Majewski
Hi Eddie,

> > Prepare v2017.05-rc3
> > 
> > Signed-off-by: Tom Rini   
> 
> Ok. Thanks for the info.
> 
> The u-boot-usb seems to be a bit older.
   ^^ sorry newer :-)

"usb: ehci: Add Renesas RCar M3/H3 EHCI support"
3426b2038cfb831d74ac0407fc7a04e990b44540

> 
> Anyway, have you tried with compiling your code with toolchains
> suggested by Tom?
> 
> Best regards,
> Łukasz Majewski
> 
> > >  



Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 4/4] mx25pdk: Set the eSDHC PER clock to 48 MHz

2017-05-31 Thread Stefano Babic
On 03/05/2017 11:59, Benoît Thébaudeau wrote:
> The maximum SD clock frequency in High Speed mode is 50 MHz. This change
> makes it possible to get 48 MHz from the USB PLL (240 MHz / 5 / 1)
> instead of the previous 33.25 MHz from the AHB clock (133 MHz / 2 / 2).
> 
> Signed-off-by: Benoît Thébaudeau 
> ---
>  board/freescale/mx25pdk/mx25pdk.c | 6 ++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/board/freescale/mx25pdk/mx25pdk.c 
> b/board/freescale/mx25pdk/mx25pdk.c
> index 788d3c3..cab769c 100644
> --- a/board/freescale/mx25pdk/mx25pdk.c
> +++ b/board/freescale/mx25pdk/mx25pdk.c
> @@ -175,6 +175,12 @@ int board_mmc_init(bd_t *bis)
>  
>   imx_iomux_v3_setup_multiple_pads(sdhc1_pads, ARRAY_SIZE(sdhc1_pads));
>  
> + /*
> +  * Set the eSDHC1 PER clock to the maximum frequency lower than or equal
> +  * to 50 MHz that can be obtained, which requires to use UPLL as the
> +  * clock source. This actually gives 48 MHz.
> +  */
> + imx_set_perclk(MXC_ESDHC1_CLK, true, 5000);
>   esdhc_cfg[0].sdhc_clk = mxc_get_clock(MXC_ESDHC1_CLK);
>   return fsl_esdhc_initialize(bis, _cfg[0]);
>  }
> 

Applied to u-boot-imx -master, thanks !

Best regards,
Stefano Babic

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


Re: [U-Boot] [PATCH] arm64: mvebu: armada-7040-db: Enable 10GB port 0 / SFI (KR)

2017-05-31 Thread Stefan Roese

On 06.04.2017 15:39, Stefan Roese wrote:

This patch enables the mvpp2 port 0 usage on the Armada 7k DB by setting
the correct PHY type (KR / SFI) for the COMPHY driver and enabling the
ethernet0 device node in the dts.

Signed-off-by: Stefan Roese 
Cc: Stefan Chulski 
Cc: Kostya Porotchkin 
Cc: Nadav Haklai 


Applied to u-boot-marvell/master.

Thanks,
Stefan
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH] arm64: mvebu: Replace board specific with generic memory bank decoding

2017-05-31 Thread Stefan Roese

On 08.05.2017 08:31, Stefan Roese wrote:

The dram_init and dram_init_banksize functions were using a board
specific implementation for decoding the memory banks from the fdt.
This change makes the dram_init* functions use a generic implementation
of decoding and populating memory bank and size data.

Signed-off-by: Stefan Roese 
Cc: Nathan Rossi 
Cc: Nadav Haklai 
Cc: Kostya Porotchkin 


Applied to u-boot-marvell/master.

Thanks,
Stefan
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH V7 4/4] rockchip: rk3288: enable rockusb support on rk3288 based device

2017-05-31 Thread Lukasz Majewski
On Wed, 31 May 2017 16:02:27 +0800
Eddie Cai  wrote:

> 2017-05-31 15:12 GMT+08:00 Lukasz Majewski :
> > On Wed, 31 May 2017 10:27:23 +0800
> > Eddie Cai  wrote:
> >
> >> Hi Lukasz
> >>
> >> 2017-05-29 15:51 GMT+08:00 Lukasz Majewski :
> >> > Good morning Eddie,
> >> >
> >> >> this patch enable rockusb support on rk3288 based device.
> >> >>
> >> >> Signed-off-by: Eddie Cai 
> >> >> Reviewed-by: Simon Glass 
> >> >>
> >> >
> >> > I've give this patch set a try on travisCI:
> >> >
> >> > https://travis-ci.org/lmajewski/u-boot-dfu/jobs/237068149
> >> >
> >> > Unfortunately, there are some problem with following boards:
> >> >
> >> > chromebook_jerry, chromebook_minnie ...
> >> I did it by myself last week. i got the same error. then i fix
> >> those chromebook error
> >> and test again. I still got some 3036 board error. But it build
> >> successfully when i
> >> build it on my computer. here is the travis-ci.org error log
> >> https://travis-ci.org/eddiecailinux/u-boot/jobs/236232837
> >> I have no idea what can i do to fix it.
> >
> > Can you share the SHA1 of commit on top of which you applied your
> > patches?
> >
> > I take u-boot-usb (the USB u-boot tree from Marek Vasut) as a base
> > and then apply commits on top of it.
> here is my branch
> https://github.com/eddiecailinux/u-boot/tree/rockusb-v8 I apply my
> patch on top of below commit commit
> a63d800196ebee59b0f8ff924f67843cd597a8c1 Author: Tom Rini
>  Date:   Mon May 1 19:54:41 2017 -0400
> 
> Prepare v2017.05-rc3
> 
> Signed-off-by: Tom Rini 

Ok. Thanks for the info.

The u-boot-usb seems to be a bit older.

Anyway, have you tried with compiling your code with toolchains
suggested by Tom?

Best regards,
Łukasz Majewski

> >
> >> >
> >> > caused by "undefined references to "
> >> >
> >> > I've tried your patches on top of:
> >> > u-boot-usb/HEAD
> >> > SHA1: 3426b2038cfb831d74ac0407fc7a04e990b44540
> >> >
> >> > Maybe you have built tested it on other branch/commit?
> >> >
> >> > Best regards,
> >> > Łukasz Majewski
> >> >
> >> > p.s. My travis CI .travis.yml attached.
> >> >
> >> >> Changes in v7:
> >> >> -use imply in the Kconfig to enable rockusb
> >> >>
> >> >> Changes in v6:
> >> >> -enable rockusb in defconfig
> >> >>
> >> >> Changes in v5:
> >> >> -none
> >> >>
> >> >> Changes in v4:
> >> >> -move to rk3288_common.h
> >> >>
> >> >> Changes in v3:
> >> >> -move to defconfig
> >> >>
> >> >> ---
> >> >>  arch/arm/mach-rockchip/Kconfig| 2 ++
> >> >>  configs/evb-rk3288_defconfig  | 9 +
> >> >>  configs/fennec-rk3288_defconfig   | 6 ++
> >> >>  configs/firefly-rk3288_defconfig  | 6 ++
> >> >>  configs/miqi-rk3288_defconfig | 6 ++
> >> >>  configs/popmetal-rk3288_defconfig | 6 ++
> >> >>  configs/tinker-rk3288_defconfig   | 6 ++
> >> >>  include/configs/rk3288_common.h   | 7 ---
> >> >>  8 files changed, 41 insertions(+), 7 deletions(-)
> >> >>
> >> >> diff --git a/arch/arm/mach-rockchip/Kconfig
> >> >> b/arch/arm/mach-rockchip/Kconfig index 2b752ad..8a87812 100644
> >> >> --- a/arch/arm/mach-rockchip/Kconfig
> >> >> +++ b/arch/arm/mach-rockchip/Kconfig
> >> >> @@ -32,6 +32,8 @@ config ROCKCHIP_RK3288
> >> >>   select CPU_V7
> >> >>   select SUPPORT_SPL
> >> >>   select SPL
> >> >> + imply USB_FUNCTION_ROCKUSB
> >> >> + imply CMD_ROCKUSB
> >> >>   help
> >> >> The Rockchip RK3288 is a ARM-based SoC with a quad-core
> >> >> Cortex-A17 including NEON and GPU, 1MB L2 cache, Mali-T7
> >> >> graphics, two diff --git a/configs/evb-rk3288_defconfig
> >> >> b/configs/evb-rk3288_defconfig index 227150d..cf66e09 100644
> >> >> --- a/configs/evb-rk3288_defconfig
> >> >> +++ b/configs/evb-rk3288_defconfig
> >> >> @@ -17,6 +17,7 @@ CONFIG_CMD_MMC=y
> >> >>  CONFIG_CMD_SF=y
> >> >>  CONFIG_CMD_SPI=y
> >> >>  CONFIG_CMD_I2C=y
> >> >> +CONFIG_CMD_USB=y
> >> >>  CONFIG_CMD_GPIO=y
> >> >>  # CONFIG_CMD_SETEXPR is not set
> >> >>  CONFIG_CMD_CACHE=y
> >> >> @@ -61,6 +62,14 @@ CONFIG_DEBUG_UART_CLOCK=2400
> >> >>  CONFIG_DEBUG_UART_SHIFT=2
> >> >>  CONFIG_SYS_NS16550=y
> >> >>  CONFIG_SYSRESET=y
> >> >> +CONFIG_USB=y
> >> >> +CONFIG_USB_STORAGE=y
> >> >>  CONFIG_USE_TINY_PRINTF=y
> >> >>  CONFIG_CMD_DHRYSTONE=y
> >> >>  CONFIG_ERRNO_STR=y
> >> >> +CONFIG_USB_GADGET=y
> >> >> +CONFIG_USB_GADGET_DOWNLOAD=y
> >> >> +CONFIG_USB_GADGET_VBUS_DRAW=0
> >> >> +CONFIG_G_DNL_MANUFACTURER="Rockchip"
> >> >> +CONFIG_G_DNL_VENDOR_NUM=0x2207
> >> >> +CONFIG_G_DNL_PRODUCT_NUM=0x320a
> >> >> diff --git a/configs/fennec-rk3288_defconfig
> >> >> b/configs/fennec-rk3288_defconfig index befba18..eb33d00 100644
> >> >> --- a/configs/fennec-rk3288_defconfig
> >> >> +++ b/configs/fennec-rk3288_defconfig
> >> >> @@ -66,3 +66,9 @@ CONFIG_USB_STORAGE=y
> >> >>  CONFIG_USE_TINY_PRINTF=y
> >> >>  CONFIG_CMD_DHRYSTONE=y
> >> >>  

Re: [U-Boot] [PATCH V7 4/4] rockchip: rk3288: enable rockusb support on rk3288 based device

2017-05-31 Thread Eddie Cai
2017-05-31 16:41 GMT+08:00 Eddie Cai :
> 2017-05-31 16:22 GMT+08:00 Lukasz Majewski :
>> Hi Eddie,
>>
>>> > Prepare v2017.05-rc3
>>> >
>>> > Signed-off-by: Tom Rini 
>>>
>>> Ok. Thanks for the info.
>>>
>>> The u-boot-usb seems to be a bit older.
>>^^ sorry newer :-)
>>
>> "usb: ehci: Add Renesas RCar M3/H3 EHCI support"
>> 3426b2038cfb831d74ac0407fc7a04e990b44540
>>
>>>
>>> Anyway, have you tried with compiling your code with toolchains
>>> suggested by Tom?
> Yes. I tried to build with this toolchain on my computer. It build
> successfully, but i got below warning.
>
>   CC  spl/arch/arm/mach-rockchip/rk3036-board-spl.o
> arch/arm/mach-rockchip/rk3036-board-spl.c:20:34: warning: ‘grf’
> defined but not used [-Wunused-const-variable=]
>  static struct rk3036_grf * const grf = (void *)GRF_BASE;
>
> I don't think it relate to my patches. so i checkout below commit and
> build with the same toolchain again. i got the same warning.
> commit a63d800196ebee59b0f8ff924f67843cd597a8c1
> Author: Tom Rini 
> Date:   Mon May 1 19:54:41 2017 -0400
>
> Prepare v2017.05-rc3
>
> Signed-off-by: Tom Rini 
Anyway, This warning is not the same error travis-ci report.
>>>
>>> Best regards,
>>> Łukasz Majewski
>>>
>>> > >
>>
>>
>>
>> Best regards,
>>
>> Lukasz Majewski
>>
>> --
>>
>> DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
>> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
>> Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 1/4] mmc: fsl_esdhc: Allow all supported prescaler values

2017-05-31 Thread Stefano Babic
On 03/05/2017 11:59, Benoît Thébaudeau wrote:
> On i.MX, SYSCTL.SDCLKFS may be set to 0 in order to make the SD clock
> frequency prescaler divide by 1 in SDR mode. In DDR mode, the prescaler
> can divide by up to 512. Allow both of these settings.
> 
> The maximum SD clock frequency in High Speed mode is 50 MHz. On i.MX25,
> this change makes it possible to get 48 MHz from the USB PLL
> (240 MHz / 5 / 1) instead of only 40 MHz from the USB PLL
> (240 MHz / 3 / 2) or 33.25 MHz from the AHB clock (133 MHz / 2 / 2).
> 
> Signed-off-by: Benoît Thébaudeau 
> ---
>  drivers/mmc/fsl_esdhc.c | 23 ---
>  1 file changed, 12 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/mmc/fsl_esdhc.c b/drivers/mmc/fsl_esdhc.c
> index f3c6358..ca72627 100644
> --- a/drivers/mmc/fsl_esdhc.c
> +++ b/drivers/mmc/fsl_esdhc.c
> @@ -521,7 +521,13 @@ out:
>  
>  static void set_sysctl(struct mmc *mmc, uint clock)
>  {
> - int div, pre_div;
> + int div = 1;
> +#ifdef ARCH_MXC
> + int pre_div = 1;
> +#else
> + int pre_div = 2;
> +#endif
> + int ddr_pre_div = mmc->ddr_mode ? 2 : 1;
>   struct fsl_esdhc_priv *priv = mmc->priv;
>   struct fsl_esdhc *regs = priv->esdhc_regs;
>   int sdhc_clk = priv->sdhc_clk;
> @@ -530,18 +536,13 @@ static void set_sysctl(struct mmc *mmc, uint clock)
>   if (clock < mmc->cfg->f_min)
>   clock = mmc->cfg->f_min;
>  
> - if (sdhc_clk / 16 > clock) {
> - for (pre_div = 2; pre_div < 256; pre_div *= 2)
> - if ((sdhc_clk / pre_div) <= (clock * 16))
> - break;
> - } else
> - pre_div = 2;
> + while (sdhc_clk / (16 * pre_div * ddr_pre_div) > clock && pre_div < 256)
> + pre_div *= 2;
>  
> - for (div = 1; div <= 16; div++)
> - if ((sdhc_clk / (div * pre_div)) <= clock)
> - break;
> + while (sdhc_clk / (div * pre_div * ddr_pre_div) > clock && div < 16)
> + div++;
>  
> - pre_div >>= mmc->ddr_mode ? 2 : 1;
> + pre_div >>= 1;
>   div -= 1;
>  
>   clk = (pre_div << 8) | (div << 4);
> 

Applied to u-boot-imx -master, thanks !

Best regards,
Stefano Babic

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


Re: [U-Boot] [PATCH 1/6] arm64: mvebu: Add pinctrl nodes for Armada 3700

2017-05-31 Thread Stefan Roese

On 23.05.2017 06:59, Stefan Roese wrote:

From: Gregory CLEMENT 

Add the nodes for the two pin controller present in the Armada 37xx SoCs.

Initially the node was named gpio1 using the same name that for the
register range in the datasheet. However renaming it pinctr_nb (nb for
North Bridge) makes more sense.

Minor changes for U-Boot because of the slightly different dts version
done by Stefan Roese.

Signed-off-by: Gregory CLEMENT 
Signed-off-by: Stefan Roese 
Cc: Gregory CLEMENT 
Cc: Konstantin Porotchkin 
Cc: Nadav Haklai 


Whole series applied to u-boot-marvell/master.

Thanks,
Stefan
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH] arm: mvebu: kwbimage: inline function to fix use-after-free

2017-05-31 Thread Stefan Roese

On 10.05.2017 22:18, Patrick Wildt wrote:

image_version_file()'s only use is to return the version number of the
specified image, and it's only called by kwbimage_generate().  This
version function mallocs "image_cfg" and reads the contents of the image
into that buffer.  Before return to its caller it frees the buffer.

After extracting the version, kwb_image_generate() tries to calculate
the header size by calling image_headersz_v1().  This function now
accesses "image_cfg", which has already been freed.

Since image_version_file() is only used by a single function, inline it
into kwbimage_generate() and only free the buffer after it is no longer
needed.  This also improves code readability since the code is mostly
equal to kwbimage_set_header().

Signed-off-by: Patrick Wildt 


Applied to u-boot-marvell/master.

Thanks,
Stefan
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v2] sun50i: a64: Add initial Banana Pi M64 support

2017-05-31 Thread Maxime Ripard
On Mon, May 29, 2017 at 01:21:48PM +, Jagan Teki wrote:
> From: Jagan Teki 
> 
> BPI-M64 is a 64-bit quad-core mini single board computer
> using the Allwinner A64 SOC.
> 
> BPI-M64 features
> - 1.2 Ghz Quad-Core ARM Cortex A53
> - 2GB DDR3 SDRAM with 733MHz
> - MicroSD/eMMC(8GB)
> - 10/100/1000Mbps ethernet (Realtek RTL8211E/D)
> - Wifi + BT
> - IR receiver
> - Audio In/Out
> - Video In/Out
> - 5V 2A DC power-supply
> 
> For dts file,
> Sync with Linux commit 4879b7ae("Merge tag 'dmaengine-4.12-rc1'").
> 
> Boot from MMC:
> -
> U-Boot SPL 2017.05-00667-g85dd258-dirty (May 29 2017 - 13:07:31)
> DRAM: 2048 MiB
> Trying to boot from MMC1
> NOTICE:  BL3-1: Running on A64/H64 (1689) in SRAM A2 (@0x44000)
> NOTICE:  Configuring SPC Controller
> NOTICE:  BL3-1: v1.0(debug):aa75c8d
> NOTICE:  BL3-1: Built : 18:28:27, May 24 2017
> NOTICE:  Configuring AXP PMIC
> NOTICE:  PMIC: setup successful
> INFO:BL3-1: Initializing runtime services
> INFO:BL3-1: Preparing for EL3 exit to normal world
> INFO:BL3-1: Next image address: 0x4a00, SPSR: 0x3c9
> 
> U-Boot 2017.05-00667-g85dd258-dirty (May 29 2017 - 13:07:31 +) Allwinner 
> Technology
> 
> CPU:   Allwinner A64 (SUN50I)
> Model: BananaPi-M64
> DRAM:  2 GiB
> MMC:   SUNXI SD/MMC: 0, SUNXI SD/MMC: 1
> *** Warning - bad CRC, using default environment
> 
> In:serial
> Out:   serial
> Err:   serial
> Net:   No ethernet found.
> starting USB...
> No controllers found
> Hit any key to stop autoboot:  0
> 
> Signed-off-by: Jagan Teki 
> ---
> Changes for v2:
> - Update email-id
> - Tested on BPI-M64
> - Added MMC Slot 2 CONFIG_
> 
> Note:
> Ethernet missing here, since the a64 emac as moved to 
> sun50i-a64-pine64-plus-u-boot.dtsi
> once it rename/move/update to shared dtsi BPI-M64 should have it, otherwise 
> will
> create emac node inside m64 dts.
> 
>  arch/arm/dts/Makefile|   1 +
>  arch/arm/dts/sun50i-a64-bananapi-m64.dts | 114 
> +++
>  board/sunxi/MAINTAINERS  |   5 ++
>  configs/bananapi_m64_defconfig   |  18 +
>  4 files changed, 138 insertions(+)
>  create mode 100644 arch/arm/dts/sun50i-a64-bananapi-m64.dts
>  create mode 100644 configs/bananapi_m64_defconfig
> 
> diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
> index a59395b..242b329 100644
> --- a/arch/arm/dts/Makefile
> +++ b/arch/arm/dts/Makefile
> @@ -319,6 +319,7 @@ dtb-$(CONFIG_MACH_SUN50I_H5) += \
>   sun50i-h5-orangepi-prime.dtb \
>   sun50i-h5-orangepi-zero-plus2.dtb
>  dtb-$(CONFIG_MACH_SUN50I) += \
> + sun50i-a64-bananapi-m64.dtb \
>   sun50i-a64-orangepi-win.dtb \
>   sun50i-a64-pine64-plus.dtb \
>   sun50i-a64-pine64.dtb
> diff --git a/arch/arm/dts/sun50i-a64-bananapi-m64.dts 
> b/arch/arm/dts/sun50i-a64-bananapi-m64.dts
> new file mode 100644
> index 000..9001812
> --- /dev/null
> +++ b/arch/arm/dts/sun50i-a64-bananapi-m64.dts
> @@ -0,0 +1,114 @@
> +/*
> + * Copyright (c) 2016 ARM Ltd.
> + * Copyright (C) 2017 Jagan Teki 
> + *
> + * This file is dual-licensed: you can use it either under the terms
> + * of the GPL or the X11 license, at your option. Note that this dual
> + * licensing only applies to this file, and not this project as a
> + * whole.
> + *
> + *  a) This library is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU General Public License as
> + * published by the Free Software Foundation; either version 2 of the
> + * License, or (at your option) any later version.
> + *
> + * This library is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU General Public License for more details.
> + *
> + * Or, alternatively,
> + *
> + *  b) Permission is hereby granted, free of charge, to any person
> + * obtaining a copy of this software and associated documentation
> + * files (the "Software"), to deal in the Software without
> + * restriction, including without limitation the rights to use,
> + * copy, modify, merge, publish, distribute, sublicense, and/or
> + * sell copies of the Software, and to permit persons to whom the
> + * Software is furnished to do so, subject to the following
> + * conditions:
> + *
> + * The above copyright notice and this permission notice shall be
> + * included in all copies or substantial portions of the Software.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
> + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
> + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
> + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
> + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
> + * WHETHER IN 

Re: [U-Boot] [PATCH 1/4] x86: baytrail: Change "fsp, mrc-init-tseg-size" default value to 1

2017-05-31 Thread Stefan Roese

Hi Bin,

On 31.05.2017 11:18, Bin Meng wrote:

Hi Stefan,

On Wed, May 31, 2017 at 4:18 PM, Stefan Roese  wrote:

On 31.05.2017 10:04, Bin Meng wrote:


The default value of "fsp,mrc-init-tseg-size" should be 1 (1MB) per
FSP default settings. 0 is not valid.

Signed-off-by: Bin Meng 



How does this change affect the x86 U-Boot versions? Did you
experience any problems with the incorrect value of 0?


What do you mean by "affecting the x86 U-Boot versions"? Do you want
to track back which U-Boot version introduce the wrong tseg-size
setting?


No, I just meant, if you were experiencing any problems that were
caused by these incorrect values.


I did not experience any problems with the incorrect value of 0,
probably because U-Boot does not have SMM support yet. But definitely
it is wrong.


That explain it.

Thanks,
Stefan
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v4] dm: serial: bcm6345: fix baud rate clock calculation

2017-05-31 Thread Daniel Schwierzeck


Am 22.05.2017 um 20:01 schrieb Álvaro Fernández Rojas:
> It's currently bugged and doesn't work for even cases.
> Right shift bits instead of dividing and fix even cases.
> 
> Signed-off-by: Álvaro Fernández Rojas 
> ---
>  v4: really fix baud rate calculation
>  v3: fix baud rate calculation
> 
>  drivers/serial/serial_bcm6345.c | 8 
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 

applied to u-boot-mips/next and replaced the previously applied v3
patch, thanks.

-- 
- Daniel



signature.asc
Description: OpenPGP digital signature
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v2] armv7m: Fix larger builds

2017-05-31 Thread Vikas MANOCHA


> On May 31, 2017, at 12:27 AM, Phil Edworthy  wrote:
> 
> The branch instruction only has an 11-bit relative target address, which
> is sometimes not enough.
> 
> Signed-off-by: Phil Edworthy 

Reviewed-by: Vikas Manocha 

Cheers,
Vikas

> ---
> v2:
> - Use W(b) instead of ldr+mov. Using this macro requires
>   CONFIG_ARM_ASM_UNIFIED and CONFIG_THUMB2_KERNEL to be defined.
> ---
> arch/arm/cpu/armv7m/Makefile | 3 +++
> arch/arm/cpu/armv7m/start.S  | 4 +++-
> 2 files changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm/cpu/armv7m/Makefile b/arch/arm/cpu/armv7m/Makefile
> index 257fc7f..df1fc95 100644
> --- a/arch/arm/cpu/armv7m/Makefile
> +++ b/arch/arm/cpu/armv7m/Makefile
> @@ -8,3 +8,6 @@
> extra-y := start.o
> obj-y += cpu.o cache.o mpu.o
> obj-$(CONFIG_SYS_ARCH_TIMER) += systick-timer.o
> +
> +asflags-y += -DCONFIG_ARM_ASM_UNIFIED
> +asflags-y += -DCONFIG_THUMB2_KERNEL
> diff --git a/arch/arm/cpu/armv7m/start.S b/arch/arm/cpu/armv7m/start.S
> index 49f2720..890c773 100644
> --- a/arch/arm/cpu/armv7m/start.S
> +++ b/arch/arm/cpu/armv7m/start.S
> @@ -5,10 +5,12 @@
>  * SPDX-License-Identifier:GPL-2.0+
>  */
> 
> +#include 
> +
> .globlreset
> .type reset, %function
> reset:
> -b_main
> +W(b)_main
> 
> .globlc_runtime_cpu_setup
> c_runtime_cpu_setup:
> -- 
> 2.7.4
> 
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v2] armv7m: Fix larger builds

2017-05-31 Thread Tom Rini
On Wed, May 31, 2017 at 08:27:05AM +0100, Phil Edworthy wrote:

> The branch instruction only has an 11-bit relative target address, which
> is sometimes not enough.
> 
> Signed-off-by: Phil Edworthy 
> ---
> v2:
>  - Use W(b) instead of ldr+mov. Using this macro requires
>CONFIG_ARM_ASM_UNIFIED and CONFIG_THUMB2_KERNEL to be defined.
> ---
>  arch/arm/cpu/armv7m/Makefile | 3 +++
>  arch/arm/cpu/armv7m/start.S  | 4 +++-
>  2 files changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm/cpu/armv7m/Makefile b/arch/arm/cpu/armv7m/Makefile
> index 257fc7f..df1fc95 100644
> --- a/arch/arm/cpu/armv7m/Makefile
> +++ b/arch/arm/cpu/armv7m/Makefile
> @@ -8,3 +8,6 @@
>  extra-y := start.o
>  obj-y += cpu.o cache.o mpu.o
>  obj-$(CONFIG_SYS_ARCH_TIMER) += systick-timer.o
> +
> +asflags-y += -DCONFIG_ARM_ASM_UNIFIED
> +asflags-y += -DCONFIG_THUMB2_KERNEL

Lets move these two symbols to Kconfig and select them on CPU_V7M,
thanks!

-- 
Tom


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


Re: [U-Boot] [PATCH] board: ti: am571-idx: Add vcores support

2017-05-31 Thread Keerthy


On Thursday 25 May 2017 08:11 PM, Tom Rini wrote:
> On Thu, May 25, 2017 at 03:37:34PM +0530, Keerthy wrote:
> 
>> Update vcores for am571-idk board.
>>
>> Reported-by: Steve Kipisz 
>> Signed-off-by: Keerthy 
>> Signed-off-by: Lokesh Vutla 
> 
> Reviewed-by: Tom Rini 

Are you planning to pull yourself Tom?

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


[U-Boot] [PATCH v3] sun50i: a64: Add initial Banana Pi M64 support

2017-05-31 Thread Jagan Teki
From: Jagan Teki 

BPI-M64 is a 64-bit quad-core mini single board computer
using the Allwinner A64 SOC.

BPI-M64 features
- 1.2 Ghz Quad-Core ARM Cortex A53
- 2GB DDR3 SDRAM with 733MHz
- MicroSD/eMMC(8GB)
- 10/100/1000Mbps ethernet (Realtek RTL8211E/D)
- Wifi + BT
- IR receiver
- Audio In/Out
- Video In/Out
- 5V 2A DC power-supply

For dts file,
Sync with Linux commit 4879b7ae("Merge tag 'dmaengine-4.12-rc1'").

Boot from MMC:
-
U-Boot SPL 2017.05-00667-g85dd258-dirty (May 29 2017 - 13:07:31)
DRAM: 2048 MiB
Trying to boot from MMC1
NOTICE:  BL3-1: Running on A64/H64 (1689) in SRAM A2 (@0x44000)
NOTICE:  Configuring SPC Controller
NOTICE:  BL3-1: v1.0(debug):aa75c8d
NOTICE:  BL3-1: Built : 18:28:27, May 24 2017
NOTICE:  Configuring AXP PMIC
NOTICE:  PMIC: setup successful
INFO:BL3-1: Initializing runtime services
INFO:BL3-1: Preparing for EL3 exit to normal world
INFO:BL3-1: Next image address: 0x4a00, SPSR: 0x3c9

U-Boot 2017.05-00667-g85dd258-dirty (May 29 2017 - 13:07:31 +) Allwinner 
Technology

CPU:   Allwinner A64 (SUN50I)
Model: BananaPi-M64
DRAM:  2 GiB
MMC:   SUNXI SD/MMC: 0, SUNXI SD/MMC: 1
*** Warning - bad CRC, using default environment

In:serial
Out:   serial
Err:   serial
Net:   No ethernet found.
starting USB...
No controllers found
Hit any key to stop autoboot:  0

Signed-off-by: Jagan Teki 
---
Changes for v3:
- Droped CONSOLE_MUX, bcz it is enabled by default
- Sync with Linux dts file
Changes for v2:
- Update email-id
- Tested on BPI-M64
- Added MMC Slot 2 CONFIG_

 arch/arm/dts/Makefile|   1 +
 arch/arm/dts/sun50i-a64-bananapi-m64.dts | 121 +++
 board/sunxi/MAINTAINERS  |   5 ++
 configs/bananapi_m64_defconfig   |  17 +
 4 files changed, 144 insertions(+)
 create mode 100644 arch/arm/dts/sun50i-a64-bananapi-m64.dts
 create mode 100644 configs/bananapi_m64_defconfig

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index d121a62..de54481 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -318,6 +318,7 @@ dtb-$(CONFIG_MACH_SUN50I_H5) += \
sun50i-h5-orangepi-prime.dtb \
sun50i-h5-orangepi-zero-plus2.dtb
 dtb-$(CONFIG_MACH_SUN50I) += \
+   sun50i-a64-bananapi-m64.dtb \
sun50i-a64-orangepi-win.dtb \
sun50i-a64-pine64-plus.dtb \
sun50i-a64-pine64.dtb
diff --git a/arch/arm/dts/sun50i-a64-bananapi-m64.dts 
b/arch/arm/dts/sun50i-a64-bananapi-m64.dts
new file mode 100644
index 000..02db114
--- /dev/null
+++ b/arch/arm/dts/sun50i-a64-bananapi-m64.dts
@@ -0,0 +1,121 @@
+/*
+ * Copyright (c) 2016 ARM Ltd.
+ * Copyright (C) 2017 Jagan Teki 
+ *
+ * This file is dual-licensed: you can use it either under the terms
+ * of the GPL or the X11 license, at your option. Note that this dual
+ * licensing only applies to this file, and not this project as a
+ * whole.
+ *
+ *  a) This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * Or, alternatively,
+ *
+ *  b) Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following
+ * conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/dts-v1/;
+
+#include "sun50i-a64.dtsi"
+
+#include 
+
+/ {
+   model = "BananaPi-M64";
+   compatible = "sinovoip,bananapi-m64", "allwinner,sun50i-a64";
+
+   aliases {
+   serial0 = 
+   serial1 = 
+   };
+
+   chosen 

Re: [U-Boot] [RESEND PATCH v2 0/5] net/pch_gbe: updates for MIPS Boston board

2017-05-31 Thread Daniel Schwierzeck
Hi Joe,

Am 30.05.2017 um 22:29 schrieb Joe Hershberger:
> Hi Daniel,
> 
> On Sun, Apr 30, 2017 at 2:57 PM, Daniel Schwierzeck
>  wrote:
>> This series is a resend of selected net/pch_gbe patches from the
>> original patch series [1] which was blocked by other patch series.
>> This series only contains the net/pch_gbe patches required for
>> MIPS Boston board, but whose can be separately applied.
>>
>> [1] https://lists.denx.de/pipermail/u-boot/2016-September/268137.html
>>
>> Changes in v2:
>> - move the switch to dm_pci_virt_to_mem() in pch_gbe_rx_descs_init()
>>   to the next patch as suggested by Bin Meng
>> - move the switch to dm_pci_virt_to_mem() in pch_gbe_rx_descs_init()
>>   from the previous patch to this one as suggested by Bin Meng
>>
>> Paul Burton (5):
>>   net: pch_gbe: Reset during probe
>>   net: pch_gbe: Fix rx descriptor buffer addresses
>>   net: pch_gbe: CPU accessible addresses are virtual
>>   net: pch_gbe: Add cache maintenance
>>   net: pch_gbe: Support PHY reset GPIOs
> 
> This series is assigned to you in patchwork. Does that mean you would
> like to apply it? If you want me to apply it, please delegate it to
> me.
> 

ok, I've delegated patches 1/5 to 4/5 to you. I'll send another version
of patch 5/5 which fetches the PHY reset interval from device-tree. But
I need some time, so at least the first four patches could be applied.
Thanks!

-- 
- Daniel



signature.asc
Description: OpenPGP digital signature
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v4 6/9] rockchip: video: split RK3228-specific part off from rk_hdmi

2017-05-31 Thread Philipp Tomsich
To prepare for the addition of RK3399 HDMI support, the HDMI driver is
refactored and broken into a chip-specific and a generic part.  This
change adds the internal interfaces, makes common/reusable functions
externally visible and splits the RK3228 driver into a separate file.

For the probing of regulators, we reuse the infrastructure created
during the VOP refactoring... i.e. we simply call into the helper
function defined for the VOP.

Signed-off-by: Philipp Tomsich 

Version-changes: 4
- add this path (as part of breaking up the large HDMI change for the RK3399)

---

Changes in v4: None
Changes in v3: None
Changes in v2: None

 drivers/video/rockchip/Makefile  |   3 +-
 drivers/video/rockchip/rk3288_hdmi.c | 116 +++
 drivers/video/rockchip/rk_hdmi.c | 105 +--
 drivers/video/rockchip/rk_hdmi.h |  32 ++
 4 files changed, 166 insertions(+), 90 deletions(-)
 create mode 100644 drivers/video/rockchip/rk3288_hdmi.c
 create mode 100644 drivers/video/rockchip/rk_hdmi.h

diff --git a/drivers/video/rockchip/Makefile b/drivers/video/rockchip/Makefile
index 495d5f7..65d0ed6 100644
--- a/drivers/video/rockchip/Makefile
+++ b/drivers/video/rockchip/Makefile
@@ -11,6 +11,7 @@ obj-$(CONFIG_ROCKCHIP_RK3288) += rk3288_vop.o
 obj-$(CONFIG_ROCKCHIP_RK3399) += rk3399_vop.o
 obj-$(CONFIG_DISPLAY_ROCKCHIP_EDP) += rk_edp.o
 obj-$(CONFIG_DISPLAY_ROCKCHIP_LVDS) += rk_lvds.o
-obj-$(CONFIG_DISPLAY_ROCKCHIP_HDMI) += rk_hdmi.o
+obj-hdmi-$(CONFIG_ROCKCHIP_RK3288) += rk3288_hdmi.o
+obj-$(CONFIG_DISPLAY_ROCKCHIP_HDMI) += rk_hdmi.o $(obj-hdmi-y)
 obj-$(CONFIG_DISPLAY_ROCKCHIP_MIPI) += rk_mipi.o
 endif
diff --git a/drivers/video/rockchip/rk3288_hdmi.c 
b/drivers/video/rockchip/rk3288_hdmi.c
new file mode 100644
index 000..eae0dd2
--- /dev/null
+++ b/drivers/video/rockchip/rk3288_hdmi.c
@@ -0,0 +1,116 @@
+/*
+ * Copyright (c) 2017 Theobroma Systems Design und Consulting GmbH
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include "rk_hdmi.h"
+
+static int rk3288_hdmi_enable(struct udevice *dev, int panel_bpp,
+ const struct display_timing *edid)
+{
+   struct rk_hdmi_priv *priv = dev_get_priv(dev);
+   struct display_plat *uc_plat = dev_get_uclass_platdata(dev);
+   int vop_id = uc_plat->source_id;
+   struct rk3288_grf *grf = priv->grf;
+
+   /* hdmi source select hdmi controller */
+   rk_setreg(>soc_con6, 1 << 15);
+
+   /* hdmi data from vop id */
+   rk_clrsetreg(>soc_con6, 1 << 4, (vop_id == 1) ? (1 << 4) : 0);
+
+   return 0;
+}
+
+static int rk3288_hdmi_ofdata_to_platdata(struct udevice *dev)
+{
+   struct rk_hdmi_priv *priv = dev_get_priv(dev);
+   struct dw_hdmi *hdmi = >hdmi;
+
+   hdmi->i2c_clk_high = 0x7a;
+   hdmi->i2c_clk_low = 0x8d;
+
+   /*
+* TODO(s...@chromium.org): The above values don't work - these
+* ones work better, but generate lots of errors in the data.
+*/
+   hdmi->i2c_clk_high = 0x0d;
+   hdmi->i2c_clk_low = 0x0d;
+
+   return rk_hdmi_ofdata_to_platdata(dev);
+}
+
+static int rk3288_clk_config(struct udevice *dev)
+{
+   struct display_plat *uc_plat = dev_get_uclass_platdata(dev);
+   struct clk clk;
+   int ret;
+
+   /*
+* Configure the maximum clock to permit whatever resolution the
+* monitor wants
+*/
+   ret = clk_get_by_index(uc_plat->src_dev, 0, );
+   if (ret >= 0) {
+   ret = clk_set_rate(, 38400);
+   clk_free();
+   }
+   if (ret < 0) {
+   debug("%s: Failed to set clock in source device '%s': ret=%d\n",
+ __func__, uc_plat->src_dev->name, ret);
+   return ret;
+   }
+
+   return 0;
+}
+
+static const char * const rk3288_regulator_names[] = {
+   "vcc50_hdmi"
+};
+
+static int rk3288_hdmi_probe(struct udevice *dev)
+{
+   /* Enable VOP clock for RK3288 */
+   rk3288_clk_config(dev);
+
+   /* Enable regulators required for HDMI */
+   rk_hdmi_probe_regulators(dev, rk3288_regulator_names,
+ARRAY_SIZE(rk3288_regulator_names));
+
+   return rk_hdmi_probe(dev);
+}
+
+static const struct dm_display_ops rk3288_hdmi_ops = {
+   .read_edid = rk_hdmi_read_edid,
+   .enable = rk3288_hdmi_enable,
+};
+
+static const struct udevice_id rk3288_hdmi_ids[] = {
+   { .compatible = "rockchip,rk3288-dw-hdmi" },
+   { }
+};
+
+U_BOOT_DRIVER(rk3288_hdmi_rockchip) = {
+   .name = "rk3288_hdmi_rockchip",
+   .id = UCLASS_DISPLAY,
+   .of_match = rk3288_hdmi_ids,
+   .ops = _hdmi_ops,
+   .ofdata_to_platdata = rk3288_hdmi_ofdata_to_platdata,
+   .probe = rk3288_hdmi_probe,
+   

[U-Boot] [PATCH v4 5/9] rockchip: video: add mpixelclock settings from Linux driver

2017-05-31 Thread Philipp Tomsich
The Linux driver now supports higher mpixelclock settings.
Add these to rockchip_phy_config[] and rockchip_mpll_cfg[].

Signed-off-by: Philipp Tomsich 

---

Changes in v4:
- new patch (split off from the earlier RK3399 HDMI encoder change)

Changes in v3: None
Changes in v2: None

 drivers/video/rockchip/rk_hdmi.c | 9 +
 1 file changed, 9 insertions(+)

diff --git a/drivers/video/rockchip/rk_hdmi.c b/drivers/video/rockchip/rk_hdmi.c
index db07588..2af4995 100644
--- a/drivers/video/rockchip/rk_hdmi.c
+++ b/drivers/video/rockchip/rk_hdmi.c
@@ -35,6 +35,9 @@ static const struct hdmi_phy_config rockchip_phy_config[] = {
.mpixelclock = 29700,
.sym_ctr = 0x8039, .term = 0x0005, .vlev_ctr = 0x028d,
}, {
+   .mpixelclock = 58400,
+   .sym_ctr = 0x8039, .term = 0x, .vlev_ctr = 0x019d,
+   }, {
.mpixelclock = ~0ul,
.sym_ctr = 0x, .term = 0x, .vlev_ctr = 0x,
}
@@ -60,6 +63,12 @@ static const struct hdmi_mpll_config rockchip_mpll_cfg[] = {
.mpixelclock = 14850,
.cpce = 0x0051, .gmp = 0x0003, .curr = 0x,
}, {
+   .mpixelclock = 27200,
+   .cpce = 0x0040, .gmp = 0x0003, .curr = 0x,
+   }, {
+   .mpixelclock = 34000,
+   .cpce = 0x0040, .gmp = 0x0003, .curr = 0x,
+   }, {
.mpixelclock = ~0ul,
.cpce = 0x0051, .gmp = 0x0003, .curr = 0x,
}
-- 
1.9.1

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


[U-Boot] [PATCH 3/4] rockchip: dts: rk3399-puma: Add DDR3-1866 timings

2017-05-31 Thread Philipp Tomsich
With the validation done for DDR3-1866 (i.e. 933 MHz bus clock), we
can now add the timings (rk3399-sdram-ddr3-1866.dtsi) for boards built
with the DDR3-1866 option.

Signed-off-by: Philipp Tomsich 
---

 arch/arm/dts/rk3399-sdram-ddr3-1866.dtsi | 1537 ++
 1 file changed, 1537 insertions(+)
 create mode 100644 arch/arm/dts/rk3399-sdram-ddr3-1866.dtsi

diff --git a/arch/arm/dts/rk3399-sdram-ddr3-1866.dtsi 
b/arch/arm/dts/rk3399-sdram-ddr3-1866.dtsi
new file mode 100644
index 000..80e946e
--- /dev/null
+++ b/arch/arm/dts/rk3399-sdram-ddr3-1866.dtsi
@@ -0,0 +1,1537 @@
+/*
+ * (C) 2017 Theobroma Systems Design und Consulting GmbH
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+ {
+rockchip,sdram-params = <
+   0x1
+   0xa
+   0x3
+   0x2
+   0x1
+   0x0
+   0xf
+   0xf
+   1
+   0x80181219
+   0x17050a03
+   0x0002
+   0x6456
+   0x004c
+   0x
+   0x1
+   0xa
+   0x3
+   0x2
+   0x1
+   0x0
+   0xf
+   0xf
+   1
+   0x80181219
+   0x17050a03
+   0x0002
+   0x6456
+   0x004c
+   0x
+   933
+   3
+   2
+   9
+   1
+   0x0600
+   0x
+   0x
+   0x
+   0x
+   0x000a
+   0x
+   0x
+   0x
+   0x000a
+   0x
+   0x
+   0x
+   0x000a
+   0x
+   0x
+   0x0100
+   0x
+   0x0101
+   0x00020100
+   0x0002d976
+   0x00071fa6
+   0x02000200
+   0x091a0200
+   0x00091a00
+   0x0400091a
+   0x2c060004
+   0x210c0820
+   0x202c0600
+   0x00210c08
+   0x08202c06
+   0x0800210c
+   0x0f04
+   0x0501000a
+   0x0f040805
+   0x0501000a
+   0x0f040805
+   0x0501000a
+   0x02030005
+   0x0c0f0c00
+   0x000f0c0f
+   0x14000a0a
+   0x0a0a
+   0x0001
+   0x031c1c1c
+   0x000c0c0c
+   0x
+   0x0301
+   0x1c6a0147
+   0x1c6a0147
+   0x1c6a0147
+   0x
+   0x00060006
+   0x00170006
+   0x00170017
+   0x
+   0x
+   0x
+   0x
+   0x0200
+   0x02000151
+   0x02000151
+   0x0151
+   0x
+   0x
+   0x
+   0x
+   0x
+   0x
+   0x0301
+   0x0001
+   0x
+   0x
+   0x0100
+   0x80104002
+   0x00040003
+   0x00040005
+   0x0003
+   0x00050004
+   0x0004
+   0x00040003
+   0x00040005
+   0x71a8
+   0x38d4
+   0x38d471a8
+   0x71a8
+   0x38d4
+   0x
+   0x
+   0x
+   0x
+   0x
+   0x0a0a0a00
+   0x000a0a0a
+   0x00030200
+   0x00040700
+   0x0302
+   0x02000407
+   0x0003
+   0x00030f04
+   0x00070004
+   0x
+   0x
+   0x
+   0x
+   0x
+   0x
+   0x0001
+   0x0001
+   0x20040020
+   0x00200400
+   0x01000400
+   0x0b80
+   0x
+   0x0001
+   0x0002
+   0x000e
+   0x
+   0x
+   0x
+   0x
+   0x
+   0x00bb
+   0x00ea005e
+   0x00ea
+   0x005e00bb
+   0x00ea

Re: [U-Boot] [PATCH v4 31/72] dm: gpio: Add live tree support

2017-05-31 Thread Simon Glass
On 30 May 2017 at 21:47, Simon Glass  wrote:
> Add support for requesting GPIOs with a live device tree.
>
> This involves adjusting the function signature for the legacy function
> gpio_request_by_name_nodev(), so fix up all callers.
>
> Signed-off-by: Simon Glass 
> Fixes to stm32f746-disco.c:
> Signed-off-by: Tom Rini 
> ---
>
> Changes in v4:
> - Update stm32f746-disco.c to support live tree
>
> Changes in v3: None
> Changes in v2: None
>
>  board/qualcomm/dragonboard410c/dragonboard410c.c | 12 +++---
>  board/samsung/common/board.c |  4 +-
>  board/samsung/common/exynos5-dt.c|  2 +-
>  board/st/stm32f746-disco/stm32f746-disco.c   |  6 +--
>  drivers/gpio/gpio-uclass.c   | 51 
> +++-
>  drivers/i2c/mxc_i2c.c| 12 +++---
>  drivers/mmc/fsl_esdhc.c  |  6 +--
>  drivers/mmc/s5p_sdhci.c  |  8 ++--
>  drivers/mtd/nand/sunxi_nand.c|  2 +-
>  drivers/mtd/nand/tegra_nand.c|  4 +-
>  drivers/net/pic32_eth.c  |  3 +-
>  drivers/sound/max98095.c |  2 +
>  drivers/sound/wm8994.c   |  2 +-
>  drivers/spi/pic32_spi.c  |  2 +-
>  drivers/usb/host/ehci-tegra.c|  7 ++--
>  drivers/usb/host/ehci-vf.c   |  5 ++-
>  include/asm-generic/gpio.h   | 10 ++---
>  17 files changed, 68 insertions(+), 70 deletions(-)

Applied to u-boot-dm in place of the earlier patch.
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v4 51/72] dm: clk: Update uclass to support livetree

2017-05-31 Thread Simon Glass
On 30 May 2017 at 21:47, Simon Glass  wrote:
> Update the clk uclass to support a live device tree.
>
> Signed-off-by: Simon Glass 
> ---
>
> Changes in v4:
> - Update zynq clock driver to use the correct error number
>
> Changes in v3: None
> Changes in v2: None
>
>  drivers/clk/clk-uclass.c | 17 +++--
>  drivers/clk/clk_zynq.c   |  2 +-
>  2 files changed, 8 insertions(+), 11 deletions(-)

Applied to u-boot-dm in place of the earlier patch.
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH] board/freescale: Share qbman init between archs

2017-05-31 Thread Roy Pledge
On 5/30/2017 12:40 PM, york sun wrote:
> On 05/12/2017 01:30 PM, Roy Pledge wrote:
>> From: Ahmed Mansour 
>>
>> This patch adds changes necessary to move functionality present in
>> PowerPC folders with ARM architectures that have DPAA1 QBMan hardware
>>
>> - Created new board/freescale/common/portals.c to house shared device
>>tree fixups for DPAA1 devices with ARM and PowerPC cores
> I don't think using board/freescale/common/portals.c is the best 
> solution. QBMan is a SoC feature, not Freescale board specific. Please 
> consider to move it to somewhere common.
Do you have a suggestion?  We choose this location as the fman support
is in this directory as well.  There doesn't seem to be a good place to
share SoC specific drivers other than perhaps drivers/soc but there is
very little in that directory right now.
>
>> - Added new header file to top includes directory to allow files in
>>both architectures to grab the function prototypes
>> - Port inhibit_portals() from PowerPC to ARM. This function is used in
>>setup to disable interrupts on all QMan and BMan portals. It is
>>needed because the interrupts are enabled by default for all portals
>>including unused/uninitialised portals. When the kernel attempts to
>>go to deep sleep the unused portals prevent it from doing so
>>
>> Signed-off-by: Ahmed Mansour 
>> Signed-off-by: Roy Pledge 
>> ---
>>   arch/arm/cpu/armv8/fsl-layerscape/cpu.c|   7 +
>>   arch/arm/cpu/armv8/fsl-layerscape/fdt.c|  15 +
>>   .../arm/cpu/armv8/fsl-layerscape/fsl_lsch2_speed.c |   3 +
>>   .../include/asm/arch-fsl-layerscape/immap_lsch2.h  |  29 ++
>>   arch/powerpc/cpu/mpc85xx/cpu_init.c|   3 +-
>>   arch/powerpc/cpu/mpc85xx/fdt.c |   1 +
>>   arch/powerpc/cpu/mpc85xx/portals.c | 281 
>> ---
>>   arch/powerpc/include/asm/fsl_liodn.h   |   5 +-
>>   arch/powerpc/include/asm/fsl_portals.h |   4 -
>>   arch/powerpc/include/asm/immap_85xx.h  |  60 
>>   board/freescale/common/Makefile|   2 +
>>   board/freescale/common/portals.c   | 312 
>> +
>>   include/configs/ls1043a_common.h   |   2 +
>>   include/fsl_qbman.h|  75 +
>>   14 files changed, 451 insertions(+), 348 deletions(-)
>>   create mode 100644 board/freescale/common/portals.c
>>   create mode 100644 include/fsl_qbman.h
>>
>> diff --git a/arch/arm/cpu/armv8/fsl-layerscape/cpu.c 
>> b/arch/arm/cpu/armv8/fsl-layerscape/cpu.c
>> index bb02960..4b5b1b4 100644
>> --- a/arch/arm/cpu/armv8/fsl-layerscape/cpu.c
>> +++ b/arch/arm/cpu/armv8/fsl-layerscape/cpu.c
>> @@ -26,6 +26,10 @@
>>   #ifdef CONFIG_SYS_FSL_DDR
>>   #include 
>>   #endif
>> +#include 
>> +#ifdef CONFIG_SYS_DPAA_QBMAN
>> +#include 
>> +#endif
> Do not use ifdef if you can avoid it.
>
> 
>
>> diff --git a/include/configs/ls1043a_common.h 
>> b/include/configs/ls1043a_common.h
>> index e269248..e2d6ef1 100644
>> --- a/include/configs/ls1043a_common.h
>> +++ b/include/configs/ls1043a_common.h
>> @@ -201,6 +201,8 @@
>>   #endif
>>   #endif
>>   
>> +#define CONFIG_SYS_DPAA_QBMAN   /* Support Q/Bman */
>> +
> It's better to move this option to Kconfig.
Again we copied what was done for FMan here
>
> York
>

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


[U-Boot] [PATCH 4/4] cm_fx6: Remove SPL entry from CONFIG_SYS_EXTRA_OPTIONS

2017-05-31 Thread Fabio Estevam
SPL is already selected via CONFIG_SPL=y, so there is no need
to pass it inside CONFIG_SYS_EXTRA_OPTIONS.

Signed-off-by: Fabio Estevam 
---
 configs/cm_fx6_defconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configs/cm_fx6_defconfig b/configs/cm_fx6_defconfig
index fb2f9fa..d8d4401 100644
--- a/configs/cm_fx6_defconfig
+++ b/configs/cm_fx6_defconfig
@@ -12,7 +12,7 @@ CONFIG_SPL_WATCHDOG_SUPPORT=y
 # CONFIG_CMD_BMODE is not set
 CONFIG_VIDEO=y
 CONFIG_OF_BOARD_SETUP=y
-CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/imx-common/spl_sd.cfg,MX6QDL,SPL"
+CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/imx-common/spl_sd.cfg,MX6QDL"
 CONFIG_BOOTDELAY=3
 CONFIG_SPL=y
 CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x80
-- 
2.7.4

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


[U-Boot] [PATCH 3/4] rockchip: dts: rk3399-puma: set spl-payload-offset

2017-05-31 Thread Philipp Tomsich
From: Klaus Goger 

defines the spl-payload to 256k (0x4)

Signed-off-by: Klaus Goger 
Signed-off-by: Philipp Tomsich 
---

 arch/arm/dts/rk3399-puma.dts | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/arm/dts/rk3399-puma.dts b/arch/arm/dts/rk3399-puma.dts
index 7009fde..c04a853 100644
--- a/arch/arm/dts/rk3399-puma.dts
+++ b/arch/arm/dts/rk3399-puma.dts
@@ -14,7 +14,8 @@
compatible = "tsd,puma", "rockchip,rk3399";
 
config {
-   u-boot,spl-payload-offset = <204800>;
+   u-boot,spl-payload-offset = <0x4>; // 256kbyte
+   u-boot,boot-led = "puma:orange:power";
};
 
chosen {
-- 
1.9.1

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


[U-Boot] [PATCH 4/4] rockchip: dts: rk3399-puma: sync DTS with Linux tree

2017-05-31 Thread Philipp Tomsich
The Linux DTS for the RK3399-Q7 has moved with the times... resync
against it to ensure a consistent configuration.

Signed-off-by: Philipp Tomsich 
---

 arch/arm/dts/rk3399-puma.dts | 540 +++
 1 file changed, 495 insertions(+), 45 deletions(-)

diff --git a/arch/arm/dts/rk3399-puma.dts b/arch/arm/dts/rk3399-puma.dts
index c04a853..fca14d3 100644
--- a/arch/arm/dts/rk3399-puma.dts
+++ b/arch/arm/dts/rk3399-puma.dts
@@ -5,17 +5,18 @@
  */
 
 /dts-v1/;
+
 #include 
 #include "rk3399.dtsi"
 #include "rk3399-sdram-ddr3-1600.dtsi"
 
 / {
model = "Theobroma Systems RK3399-Q7 SoM";
-   compatible = "tsd,puma", "rockchip,rk3399";
+   compatible = "tsd,rk3399-q7", "tsd,puma", "rockchip,rk3399";
 
config {
-   u-boot,spl-payload-offset = <0x4>; // 256kbyte
-   u-boot,boot-led = "puma:orange:power";
+   u-boot,spl-payload-offset = <0x4>; /* 256kbyte */
+   u-boot,boot-led = "module_led";
};
 
chosen {
@@ -28,16 +29,74 @@
spi1 = 
};
 
-   vdd_center: vdd-center {
-   compatible = "pwm-regulator";
-   pwms = < 0 25000 0>;
-   regulator-name = "vdd_center";
-   regulator-min-microvolt = <80>;
-   regulator-max-microvolt = <140>;
-   regulator-init-microvolt = <95>;
+   leds {
+   compatible = "gpio-leds";
+   pinctrl-names = "default";
+   pinctrl-0 = <_pins_puma>;
+
+   module_led {
+   label = "module_led";
+   gpios = < 25 GPIO_ACTIVE_HIGH>;
+   linux,default-trigger = "heartbeat";
+   };
+
+   sd_card_led {
+   label = "sd_card_led";
+   gpios = < 2 GPIO_ACTIVE_HIGH>;
+   linux,default-trigger = "mmc0";
+   };
+   };
+
+   clkin_gmac: external-gmac-clock {
+   compatible = "fixed-clock";
+   clock-frequency = <12500>;
+   clock-output-names = "clkin_gmac";
+   #clock-cells = <0>;
+   };
+
+   dw_hdmi_audio: dw-hdmi-audio {
+   status = "enabled";
+   compatible = "rockchip,dw-hdmi-audio";
+   #sound-dai-cells = <0>;
+   };
+
+   hdmi_codec: hdmi-codec {
+   compatible = "simple-audio-card";
+   simple-audio-card,format = "i2s";
+   simple-audio-card,mclk-fs = <256>;
+   simple-audio-card,name = "HDMI-CODEC";
+
+   simple-audio-card,cpu {
+   sound-dai = <>;
+   };
+
+   simple-audio-card,codec {
+   sound-dai = <>;
+   };
+   };
+
+   hdmi_sound: hdmi-sound {
+   status = "disabled";
+   compatible = "simple-audio-card";
+   simple-audio-card,format = "i2s";
+   simple-audio-card,mclk-fs = <256>;
+   simple-audio-card,name = "rockchip,hdmi";
+
+   simple-audio-card,cpu {
+   sound-dai = <>;
+   };
+   simple-audio-card,codec {
+   sound-dai = <>;
+   };
+   };
+
+   vccadc_ref: vccadc-ref {
+   compatible = "regulator-fixed";
+   regulator-name = "vcc1v8_sys";
regulator-always-on;
regulator-boot-on;
-   status = "okay";
+   regulator-min-microvolt = <180>;
+   regulator-max-microvolt = <180>;
};
 
vcc3v3_sys: vcc3v3-sys {
@@ -49,24 +108,33 @@
regulator-max-microvolt = <330>;
};
 
-   vcc_phy: vcc-phy-regulator {
+   vcc5v0_otg: vcc5v0-otg-regulator {
compatible = "regulator-fixed";
-   regulator-name = "vcc_phy";
+   enable-active-high;
+   gpio = < 2 GPIO_ACTIVE_HIGH>;
+   pinctrl-names = "default";
+   pinctrl-0 = <_vbus_drv>;
+   regulator-name = "vcc5v0_otg";
regulator-always-on;
-   regulator-boot-on;
};
 
-   vcc5v0_host: vcc5v0-host-en {
+   vcc5v0_host: vcc5v0-host-regulator {
compatible = "regulator-fixed";
+   enable-active-low;
+   gpio = < 3 GPIO_ACTIVE_HIGH>;
+   pinctrl-names = "default";
+   pinctrl-0 = <_vbus_drv>;
regulator-name = "vcc5v0_host";
-   gpio = < 25 GPIO_ACTIVE_HIGH>;
+   regulator-always-on;
};
 
-   clkin_gmac: external-gmac-clock {
-   compatible = "fixed-clock";
-   clock-frequency = <12500>;
-   clock-output-names = "clkin_gmac";
-   #clock-cells = 

[U-Boot] [PATCH 2/4] rockchip: dts: rk3399-puma: release reset of on-module USB3 hub via vbus-gpio

2017-05-31 Thread Philipp Tomsich
On the RK3399-Q7, the on-module USB3 hub is held in reset at boot-up
to save power and needs to be woken up using GPIO4A3.

Note that this is not a negated reset-signal (due to a level shifter
being needed for this signal anyway), but a negated enable-signal:
to enable, we need to output LOW (i.e. 0)... so we mark this as an
ACTIVE_LOW signal.

Signed-off-by: Philipp Tomsich 
---

 arch/arm/dts/rk3399-puma.dts | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/arm/dts/rk3399-puma.dts b/arch/arm/dts/rk3399-puma.dts
index 5d9dfb5..7009fde 100644
--- a/arch/arm/dts/rk3399-puma.dts
+++ b/arch/arm/dts/rk3399-puma.dts
@@ -124,7 +124,7 @@
 };
 
 _typec0 {
-   status = "okay";
+   status = "disabled";
 };
 
 _host1_ehci {
@@ -136,6 +136,7 @@
 };
 
 _typec1 {
+   rockchip,vbus-gpio = < 3 GPIO_ACTIVE_LOW>;
status = "okay";
 };
 
@@ -182,7 +183,7 @@
 
compatible = "spi-flash";
reg = <0>;
-   spi-max-frequency = <500>;
+   spi-max-frequency = <4950>;
spi-cpol;
spi-cpha;
};
-- 
1.9.1

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


[U-Boot] Please pull u-boot-dm (take 3)

2017-05-31 Thread Simon Glass
Hi Tom,

Here it is again with the reported problems (zynq_zc702, stm disco) fixed.


The following changes since commit ccbbada0a59fead35495409d0c2c7bcb22a40278:

  Merge branch 'master' of git://git.denx.de/u-boot-mmc (2017-05-30
14:07:23 -0400)

are available in the git repository at:

  git://git.denx.de/u-boot-dm.git

for you to fetch changes up to 8566c475d5e7522a9b77b7e7027f59d92109c99f:

  sandbox: Move to use live tree (2017-05-31 09:27:05 -0600)


Simon Glass (89):
  dm: Use dm.h header when driver mode is used
  dm: core: Move dev_get_addr() etc. into a separate file
  dm: Rename dev_addr..() functions
  atmel: Fix up use of dm_scan_fdt_node()
  dm: Fix up inclusion of common.h
  dm: core: Dont export dm_scan_fdt_node()
  dm: core: Replace of_offset with accessor (part 2)
  dm: core: Add ofnode to represent device tree nodes
  dm: core: Adjust device_bind_common() to take an ofnode
  dm: mmc: Don't call board_mmc_power_init() with driver model
  dm: mmc: Don't re-init when accessing environment
  dm: blk: Allow finding block devices without probing
  dm: blk: Add a function to find the next block device number
  dm: blk: Improve block device claiming
  dm: mmc: Check that drivers have operations
  dm: mmc: Rewrite mmc_blk_probe()
  tegra: Convert MMC to use driver model for operations
  dm: core: Set return value first in lists_bind_fdt()
  Update WARN_ON() to return a value
  dm: core: Add livetree definitions
  dm: core: Add livetree access functions
  dm: Add a function to create a 'live' device tree
  dm: Build a live tree after relocation
  dm: core: Rename of_device_is_compatible()
  dm: core: Add operations on device tree references
  dm: core: Add livetree address functions
  fdt: Update fdt_get_base_address() to use const
  dm: core: Add address operations on device tree references
  dm: core: Add a place to put extra device-tree reading functions
  dm: core: Add device-based 'read' functions to access DT
  dm: core: Implement live tree 'read' functions
  dm: core: Allow binding a device from a live tree
  dm: core: Update lists_bind_fdt() to use ofnode
  dm: core: Update device_bind_driver_to_node() to use ofnode
  dm: core: Scan the live tree when setting up driver model
  dm: core: Add a way to find a device by ofnode
  dm: regmap: Add support for livetree
  dm: simple-bus: Add support for livetree
  dm: core: Update uclass_find_device_by_phandle() for livetree
  sandbox: Add a way to reset sandbox state for tests
  dm: test: Move test running code into a separate function
  dm: test: Show the test filename when running
  dm: test: Add support for running tests with livetree
  dm: core: Run tests with both livetree and flat tree
  dm: gpio: Refactor to prepare for live tree support
  dm: gpio: Drop blank line in gpio_xlate_offs_flags() comment
  dm: gpio: sandbox: Use dev_read...() functions to access DT
  dm: gpio: Add live tree support
  cros_ec: Fix debug() statement in ec_command_inptr()
  cros_ec: Convert to support live tree
  sandbox: Add a new sandbox_flattree board
  test: Update 'make test' to run more tests
  fdt: Rename a few functions in fdt_support
  dm: Add more livetree helpers and definitions
  string: Add strchrnul()
  string: Add strcspn()
  dm: i2c: Convert uclass to livetree
  samsung: Move pmic header out of config file
  dm: pmic: Convert uclass to livetree
  sandbox: pmic: Convert pmic emulator to support livetree
  dm: regulator: Convert regulator uclass to support livetree
  dm: regulator: Update fixed regulator to support livetree.
  dm: mmc: Convert uclass to livetree
  dm: adc: Convert uclass to livetree
  dm: usb: Convert uclass to livetree
  sandbox: usb: Convert emulators to livetree
  clk: Modify xlate() method for livetree
  dm: clk: Update uclass to support livetree
  dm: clk: fixed: Update to support livetree
  dm: test: Separate out the bus DT offset test
  dm: test: Disable the fdt_offset test with livetree
  dm: phy: Update tests to use ut_asserteq()
  dm: mailbox: Update uclass to support livetree
  dm: phy: Update uclass to support livetree
  sandbox: phy: Update driver for livetree
  dm: power-domain: Update uclass to support livetree
  dm: reset: Update uclass to support livetree
  dm: pci: Update uclass to support livetree
  dm: Update the I2C eeprom driver for livetree
  cros_ec: Update the cros_ec keyboard driver to livetree
  dm: spi: Convert uclass to livetree
  dm: sandbox: i2c: Drop fdtdec.h header
  dm: sandbox: i2c_rtc: Drop fdtdec.h header
  dm: spi-flash: Convert uclass to livetree
  dm: sandbox: spi: Convert driver to support 

[U-Boot] [PATCH v4 3/9] rockchip: video: refactor rk_vop and split RK3328-specific code off

2017-05-31 Thread Philipp Tomsich
To prepare for adding the RK3399 VOP driver (which shares most of its
registers and config logic with the RK3228 VOP), this change refactors
the driver and splits the RK3288-specific driver off.

The changes in detail are:
- introduces a data-structure for chip-specific drivers to register
  features/callbacks with the common driver: at this time, this is
  limited to a callback for setting the pin polarities (between the
  VOP and the encoder modules) and a flag to signal 10bit RGB
  capability
- refactors the probing of regulators into a helper function that
  can take a list of regulator names to probe and autoset
- moves the priv data-structure into a (common) header file to be
  used by the chip-specific drivers to provide base addresses to
  the common driver
- uses a callback into the chip-specific driver to set pin polarities
  (replacing the direct register accesses previously used)
- splits enabling the output (towards an encoder) into a separate
  help function withint the common driver

Signed-off-by: Philipp Tomsich 

---

Changes in v4:
- added to break down into smaller changes

Changes in v3: None
Changes in v2: None

 arch/arm/include/asm/arch-rockchip/vop_rk3288.h |   1 +
 drivers/video/rockchip/Makefile |   1 +
 drivers/video/rockchip/rk3288_vop.c |  95 +
 drivers/video/rockchip/rk_vop.c | 182 
 drivers/video/rockchip/rk_vop.h |  32 +
 5 files changed, 217 insertions(+), 94 deletions(-)
 create mode 100644 drivers/video/rockchip/rk3288_vop.c
 create mode 100644 drivers/video/rockchip/rk_vop.h

diff --git a/arch/arm/include/asm/arch-rockchip/vop_rk3288.h 
b/arch/arm/include/asm/arch-rockchip/vop_rk3288.h
index d5599ec..049f192 100644
--- a/arch/arm/include/asm/arch-rockchip/vop_rk3288.h
+++ b/arch/arm/include/asm/arch-rockchip/vop_rk3288.h
@@ -197,6 +197,7 @@ enum vop_modes {
 #define V_DSP_DEN_POL(x)   (((x) & 1) << 6)
 #define V_DSP_VSYNC_POL(x) (((x) & 1) << 5)
 #define V_DSP_HSYNC_POL(x) (((x) & 1) << 4)
+#define V_DSP_PIN_POL(x)   (((x) & 0xf) << 4)
 #define V_DSP_OUT_MODE(x)  ((x) & 0xf)
 
 /* VOP_DSP_CTRL1 */
diff --git a/drivers/video/rockchip/Makefile b/drivers/video/rockchip/Makefile
index cd54b12..9477ad0 100644
--- a/drivers/video/rockchip/Makefile
+++ b/drivers/video/rockchip/Makefile
@@ -7,6 +7,7 @@
 
 ifdef CONFIG_VIDEO_ROCKCHIP
 obj-y += rk_vop.o
+obj-$(CONFIG_ROCKCHIP_RK3288) += rk3288_vop.o
 obj-$(CONFIG_DISPLAY_ROCKCHIP_EDP) += rk_edp.o
 obj-$(CONFIG_DISPLAY_ROCKCHIP_LVDS) += rk_lvds.o
 obj-$(CONFIG_DISPLAY_ROCKCHIP_HDMI) += rk_hdmi.o
diff --git a/drivers/video/rockchip/rk3288_vop.c 
b/drivers/video/rockchip/rk3288_vop.c
new file mode 100644
index 000..e3e1ec7
--- /dev/null
+++ b/drivers/video/rockchip/rk3288_vop.c
@@ -0,0 +1,95 @@
+/*
+ * Copyright (c) 2017 Theobroma Systems Design und Consulting GmbH
+ * Copyright (c) 2015 Google, Inc
+ * Copyright 2014 Rockchip Inc.
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include "rk_vop.h"
+
+DECLARE_GLOBAL_DATA_PTR;
+
+static void rk3288_set_pin_polarity(struct udevice *dev,
+   enum vop_modes mode, u32 polarity)
+{
+   struct rk_vop_priv *priv = dev_get_priv(dev);
+   struct rk3288_vop *regs = priv->regs;
+
+   /* The RK3328 VOP (v3.1) has its polarity configuration in ctrl0 */
+   clrsetbits_le32(>dsp_ctrl0,
+   M_DSP_DCLK_POL | M_DSP_DEN_POL |
+   M_DSP_VSYNC_POL | M_DSP_HSYNC_POL,
+   V_DSP_PIN_POL(polarity));
+}
+
+static void rk3288_set_io_vsel(struct udevice *dev)
+{
+   struct rk3288_grf *grf = syscon_get_first_range(ROCKCHIP_SYSCON_GRF);
+
+   /* lcdc(vop) iodomain select 1.8V */
+   rk_setreg(>io_vsel, 1 << 0);
+}
+
+/*
+ * Try some common regulators. We should really get these from the
+ * device tree somehow.
+ */
+static const char * const rk3288_regulator_names[] = {
+   "vcc18_lcd",
+   "VCC18_LCD",
+   "vdd10_lcd_pwren_h",
+   "vdd10_lcd",
+   "VDD10_LCD",
+   "vcc33_lcd"
+};
+
+static int rk3288_vop_probe(struct udevice *dev)
+{
+   /* Before relocation we don't need to do anything */
+   if (!(gd->flags & GD_FLG_RELOC))
+   return 0;
+
+   /* Set the LCDC(vop) iodomain to 1.8V */
+   rk3288_set_io_vsel(dev);
+
+   /* Probe regulators required for the RK3288 VOP */
+   rk_vop_probe_regulators(dev, rk3288_regulator_names,
+   ARRAY_SIZE(rk3288_regulator_names));
+
+   return rk_vop_probe(dev);
+}
+
+struct rkvop_driverdata rk3288_driverdata = {
+   .features = VOP_FEATURE_OUTPUT_10BIT,
+   .set_pin_polarity = rk3288_set_pin_polarity,
+};
+
+static const struct udevice_id 

[U-Boot] [PATCH v4 1/9] rockchip: video: Kconfig: reformat help for VIDEO_ROCKCHIP

2017-05-31 Thread Philipp Tomsich
For consistency sake (and as we are about to add new options to this
file), reformat the help for VIDEO_ROCKCHIP.

Signed-off-by: Philipp Tomsich 

---

Changes in v4:
- added to break down into smaller changes

Changes in v3: None
Changes in v2: None

 drivers/video/rockchip/Kconfig | 11 ++-
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/video/rockchip/Kconfig b/drivers/video/rockchip/Kconfig
index 80e399f..4ad2da5 100644
--- a/drivers/video/rockchip/Kconfig
+++ b/drivers/video/rockchip/Kconfig
@@ -12,11 +12,12 @@ menuconfig VIDEO_ROCKCHIP
bool "Enable Rockchip Video Support"
depends on DM_VIDEO
help
-   Rockchip SoCs provide video output capabilities for 
High-Definition
-   Multimedia Interface (HDMI), Low-voltage Differential Signalling
-   (LVDS), embedded DisplayPort (eDP) and Display Serial Interface
-   (DSI). This driver supports the on-chip video output device, and
-   targets the Rockchip RK3288 and RK3399.
+ Rockchip SoCs provide video output capabilities for High-Definition
+ Multimedia Interface (HDMI), Low-voltage Differential Signalling
+ (LVDS), embedded DisplayPort (eDP) and Display Serial Interface (DSI).
+
+ This driver supports the on-chip video output device, and targets the
+ Rockchip RK3288 and RK3399.
 
 if VIDEO_ROCKCHIP
 
-- 
1.9.1

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


Re: [U-Boot] [RESEND PATCH v2 0/5] net/pch_gbe: updates for MIPS Boston board

2017-05-31 Thread Joe Hershberger
On Wed, May 31, 2017 at 7:45 AM, Daniel Schwierzeck
 wrote:
> Hi Joe,
>
> Am 30.05.2017 um 22:29 schrieb Joe Hershberger:
>> Hi Daniel,
>>
>> On Sun, Apr 30, 2017 at 2:57 PM, Daniel Schwierzeck
>>  wrote:
>>> This series is a resend of selected net/pch_gbe patches from the
>>> original patch series [1] which was blocked by other patch series.
>>> This series only contains the net/pch_gbe patches required for
>>> MIPS Boston board, but whose can be separately applied.
>>>
>>> [1] https://lists.denx.de/pipermail/u-boot/2016-September/268137.html
>>>
>>> Changes in v2:
>>> - move the switch to dm_pci_virt_to_mem() in pch_gbe_rx_descs_init()
>>>   to the next patch as suggested by Bin Meng
>>> - move the switch to dm_pci_virt_to_mem() in pch_gbe_rx_descs_init()
>>>   from the previous patch to this one as suggested by Bin Meng
>>>
>>> Paul Burton (5):
>>>   net: pch_gbe: Reset during probe
>>>   net: pch_gbe: Fix rx descriptor buffer addresses
>>>   net: pch_gbe: CPU accessible addresses are virtual
>>>   net: pch_gbe: Add cache maintenance
>>>   net: pch_gbe: Support PHY reset GPIOs
>>
>> This series is assigned to you in patchwork. Does that mean you would
>> like to apply it? If you want me to apply it, please delegate it to
>> me.
>>
>
> ok, I've delegated patches 1/5 to 4/5 to you. I'll send another version
> of patch 5/5 which fetches the PHY reset interval from device-tree. But
> I need some time, so at least the first four patches could be applied.
> Thanks!

OK, I've sent them to travis for build testing.

https://travis-ci.org/jhershbe/u-boot/builds/237978449
https://travis-ci.org/jhershbe/u-boot/builds/237978597
https://travis-ci.org/jhershbe/u-boot/builds/237978697
https://travis-ci.org/jhershbe/u-boot/builds/237979116

Cheers,
-Joe
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v4 9/9] rockchip: board: puma_rk3399: enable BMP_16BPP, BMP_24BPP and BMP_32BPP

2017-05-31 Thread Philipp Tomsich
With video output support for the RK3399-Q7 (Puma) available, we want
CMD_BMP enabled and the support for 16bit, 24bit and 32bit BMPs
defined.

Signed-off-by: Philipp Tomsich 

Version-changes: 2
- enable SYS_WHITE_ON_BLACK via defconfig

---

Changes in v4: None
Changes in v3: None
Changes in v2: None

 include/configs/puma_rk3399.h | 4 
 1 file changed, 4 insertions(+)

diff --git a/include/configs/puma_rk3399.h b/include/configs/puma_rk3399.h
index ece8bba..af1dae8 100644
--- a/include/configs/puma_rk3399.h
+++ b/include/configs/puma_rk3399.h
@@ -26,4 +26,8 @@
 #define CONFIG_SERIAL_TAG
 #define CONFIG_ENV_OVERWRITE
 
+#define CONFIG_BMP_16BPP
+#define CONFIG_BMP_24BPP
+#define CONFIG_BMP_32BPP
+
 #endif
-- 
1.9.1

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


[U-Boot] [PATCH 4/4] rockchip: dts: rk3399-puma: select DRAM timing via Kconfig

2017-05-31 Thread Philipp Tomsich
The RK3399-Q7 has multiple build-options for its DRAM configuration,
including the timing of the DRAM components populated.

While DDR3-1600 is the standard configuration, custom-configurations
are available with DDR3-1333 (for a further cost-optimisation) and
with DDR3-1866 (as a premium option).

To simplify our test automation (without the need to maintain 3
different defconfigs) and customer evaluation, we make this selectable
via Kconfig.

Signed-off-by: Philipp Tomsich 
---

 arch/arm/dts/rk3399-puma.dts|  8 +++
 board/theobroma-systems/puma_rk3399/Kconfig | 37 +
 2 files changed, 45 insertions(+)

diff --git a/arch/arm/dts/rk3399-puma.dts b/arch/arm/dts/rk3399-puma.dts
index fca14d3..41d32eb 100644
--- a/arch/arm/dts/rk3399-puma.dts
+++ b/arch/arm/dts/rk3399-puma.dts
@@ -8,7 +8,15 @@
 
 #include 
 #include "rk3399.dtsi"
+#if defined(CONFIG_SYS_TSD_PUMA_DDR3_1333)
+#include "rk3399-sdram-ddr3-1333.dtsi"
+#elif defined(CONFIG_SYS_TSD_PUMA_DDR3_1600)
 #include "rk3399-sdram-ddr3-1600.dtsi"
+#elif defined(CONFIG_SYS_TSD_PUMA_DDR3_1866)
+#include "rk3399-sdram-ddr3-1866.dtsi"
+#else
+#error "Unknown memory timing configuration for the RK3399-Q7"
+#endif
 
 / {
model = "Theobroma Systems RK3399-Q7 SoM";
diff --git a/board/theobroma-systems/puma_rk3399/Kconfig 
b/board/theobroma-systems/puma_rk3399/Kconfig
index a645590..1773648 100644
--- a/board/theobroma-systems/puma_rk3399/Kconfig
+++ b/board/theobroma-systems/puma_rk3399/Kconfig
@@ -12,4 +12,41 @@ config SYS_CONFIG_NAME
 config BOARD_SPECIFIC_OPTIONS # dummy
def_bool y
 
+if SPL
+
+choice
+   prompt "RK3399-Q7 DRAM timings"
+default SYS_TSD_PUMA_DDR3_1600
+help
+ The RK3399-Q7 module is orderable in multiple memory
+  configurations, which may also differ in the timings used.
+
+  DDR3-1600 is the standard configuration, but both DDR3-1333
+  (for potential cost-optimisation) and DDR3-1866 (as a
+  premium option) are fully validated in the design.
+
+ The setting of this option is used to select the appropriate
+ timings for inclusion in the device tree controlling DRAM
+ initialisation during the board-initialisation performed by
+ the SPL stage.
+
+config SYS_TSD_PUMA_DDR3_1333
+bool "DDR3-1333 timings"
+help
+ Use DDR3-1333 timings for the DRAM setup of the RK3399-Q7.
+
+config SYS_TSD_PUMA_DDR3_1600
+bool "DDR3-1600 timings"
+help
+ Use DDR3-1600 timings for the DRAM setup of the RK3399-Q7.
+
+config SYS_TSD_PUMA_DDR3_1866
+bool "DDR3-1866 timings"
+help
+ Use DDR3-1866 timings for the DRAM setup of the RK3399-Q7.
+
+endchoice
+
+endif
+
 endif
-- 
1.9.1

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


[U-Boot] [PATCH 2/4] rockchip: arm64: rk3399: support DDR3-1866 (i.e. 933MHz clock)

2017-05-31 Thread Philipp Tomsich
The RK3399 is capable of driving DDR3 at 933MHz (i.e. DDR3-1866),
if the PCB layout permits and appropriate memory timings are used.

This changes the sanity checks to allow a DTS to request DDR3-1866
operation.

Signed-off-by: Philipp Tomsich 
Tested-by: Klaus Goger 
---

 arch/arm/mach-rockchip/rk3399/sdram_rk3399.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-rockchip/rk3399/sdram_rk3399.c 
b/arch/arm/mach-rockchip/rk3399/sdram_rk3399.c
index 4dd84e2..0b87fcf 100644
--- a/arch/arm/mach-rockchip/rk3399/sdram_rk3399.c
+++ b/arch/arm/mach-rockchip/rk3399/sdram_rk3399.c
@@ -1090,7 +1090,7 @@ static int sdram_init(struct dram_info *dram,
 
debug("Starting SDRAM initialization...\n");
 
-   if ((dramtype == DDR3 && ddr_freq > 800) ||
+   if ((dramtype == DDR3 && ddr_freq > 933) ||
(dramtype == LPDDR3 && ddr_freq > 933) ||
(dramtype == LPDDR4 && ddr_freq > 800)) {
debug("SDRAM frequency is to high!");
-- 
1.9.1

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


[U-Boot] [PATCH 1/4] rockchip: dts: rk3399-puma: make the debug serial dm-pre-reloc

2017-05-31 Thread Philipp Tomsich
Signed-off-by: Philipp Tomsich 
---

 arch/arm/dts/rk3399-puma.dts | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/dts/rk3399-puma.dts b/arch/arm/dts/rk3399-puma.dts
index a234db8..5d9dfb5 100644
--- a/arch/arm/dts/rk3399-puma.dts
+++ b/arch/arm/dts/rk3399-puma.dts
@@ -107,6 +107,7 @@
 };
 
  {
+   u-boot,dm-pre-reloc;
status = "okay";
 };
 
-- 
1.9.1

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


[U-Boot] [PATCH 2/6] rockchip: defconfig: puma-rk3399: update defconfig with video-support

2017-05-31 Thread Philipp Tomsich
With HDMI output for the RK3399 working, this update the RK3399-Q7
(Puma) defconfig for the new functionality:
1. enables PMIC command (to check if the HDMI voltages are correct)
  +CONFIG_CMD_PMIC=y
  +CONFIG_CMD_REGULATOR=y
2. enables video-output (via HDMI)
  +CONFIG_DM_VIDEO=y
  +CONFIG_DISPLAY=y
  +CONFIG_VIDEO_ROCKCHIP=y
  +CONFIG_DISPLAY_ROCKCHIP_HDMI=y
3. turns on the 'dcache'-command (for a dcache flush) for our QA to
   fill the framebuffer using 'mw.l'
  +CONFIG_CMD_CACHE=y
4. turns on the 'bmp'-command
  +CONFIG_CMD_BMP=y

Signed-off-by: Philipp Tomsich 

---

Changes in v2:
- enable CMD_BMP in the puma-rk3399_defconfig (following a rebase to
  the upstream master after CMD_BMP was migrate to Kconfig)

 configs/puma-rk3399_defconfig | 8 
 1 file changed, 8 insertions(+)

diff --git a/configs/puma-rk3399_defconfig b/configs/puma-rk3399_defconfig
index ecc85bc..e0f1821 100644
--- a/configs/puma-rk3399_defconfig
+++ b/configs/puma-rk3399_defconfig
@@ -29,7 +29,11 @@ CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_USB_MASS_STORAGE=y
 # CONFIG_CMD_SETEXPR is not set
+CONFIG_CMD_BMP=y
+CONFIG_CMD_CACHE=y
 CONFIG_CMD_TIME=y
+CONFIG_CMD_PMIC=y
+CONFIG_CMD_REGULATOR=y
 CONFIG_SPL_OF_CONTROL=y
 CONFIG_OF_SPL_REMOVE_PROPS="pinctrl-0 pinctrl-names clock-names 
interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents"
 CONFIG_REGMAP=y
@@ -82,4 +86,8 @@ CONFIG_USB_GADGET_DOWNLOAD=y
 CONFIG_G_DNL_MANUFACTURER="Theobroma Systems"
 CONFIG_G_DNL_VENDOR_NUM=0x2294
 CONFIG_G_DNL_PRODUCT_NUM=0x3399
+CONFIG_DM_VIDEO=y
+CONFIG_DISPLAY=y
+CONFIG_VIDEO_ROCKCHIP=y
+CONFIG_DISPLAY_ROCKCHIP_HDMI=y
 CONFIG_ERRNO_STR=y
-- 
1.9.1

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


[U-Boot] [PATCH 1/6] rockchip: defconfig: puma-rk3399: enable RK808 support

2017-05-31 Thread Philipp Tomsich
On the RK3399-Q7, we need PMIC support (for the RK808) to enable HDMI
output, as one of the required powerrails is not enabled on boot.
For this, we need to enable the RK808 driver.

Signed-off-by: Philipp Tomsich 

Version-changes: 3
- With the recent upstream changes to the RK808 (PMIC) driver, the
  associated configuration options have been renamed to RK8XX.  Track
  this change in the RK3399-Q7 defconfig.

---

Changes in v2: None

 configs/puma-rk3399_defconfig | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/configs/puma-rk3399_defconfig b/configs/puma-rk3399_defconfig
index 7b4f595..ecc85bc 100644
--- a/configs/puma-rk3399_defconfig
+++ b/configs/puma-rk3399_defconfig
@@ -54,8 +54,11 @@ CONFIG_GMAC_ROCKCHIP=y
 CONFIG_PINCTRL=y
 CONFIG_SPL_PINCTRL=y
 CONFIG_PINCTRL_ROCKCHIP_RK3399=y
+CONFIG_DM_PMIC=y
+CONFIG_PMIC_RK8XX=y
 CONFIG_REGULATOR_PWM=y
 CONFIG_DM_REGULATOR_FIXED=y
+CONFIG_REGULATOR_RK8XX=y
 CONFIG_PWM_ROCKCHIP=y
 CONFIG_RAM=y
 CONFIG_SPL_RAM=y
-- 
1.9.1

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


[U-Boot] [PATCH 0/4] rockchip: dts: rk3399-puma: update DTS

2017-05-31 Thread Philipp Tomsich

For the RK3399-Q7, there's been a number of changes to the DTS from
the ongoing Linux development and from recently enabled functionality
within U-Boot.


Klaus Goger (1):
  rockchip: dts: rk3399-puma: set spl-payload-offset

Philipp Tomsich (3):
  rockchip: dts: rk3399-puma: make the debug serial dm-pre-reloc
  rockchip: dts: rk3399-puma: release reset of on-module USB3 hub via
vbus-gpio
  rockchip: dts: rk3399-puma: sync DTS with Linux tree

 arch/arm/dts/rk3399-puma.dts | 543 +++
 1 file changed, 498 insertions(+), 45 deletions(-)

-- 
1.9.1

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


[U-Boot] [PATCH v4 4/9] rockchip: video: rk3399: enable HDMI output (from the rk_vop) for the RK3399

2017-05-31 Thread Philipp Tomsich
This commit adds a driver for the RK3399 VOPs capable and all the
necessary plumbing to feed the HDMI encoder. For the VOP-big, this
correctly tracks the ability to feed 10bit RGB data to the encoder.

Signed-off-by: Philipp Tomsich 

---

Changes in v4:
- split the massive "refactor, split and add RK3399 support"-change into
  smaller chunks that are more easily digestible

Changes in v3:
- splits the VOP driver into SOC-specific and common portions
- moves the "maximum x" and "maximum y" resolution config into Kconfig (instead
  of having hard-coded values that may need to be revised each time someone adds
  a new device or new features)

Changes in v2: None

 arch/arm/include/asm/arch-rockchip/vop_rk3288.h |  10 +++
 drivers/video/rockchip/Makefile |   1 +
 drivers/video/rockchip/rk3399_vop.c | 105 
 3 files changed, 116 insertions(+)
 create mode 100644 drivers/video/rockchip/rk3399_vop.c

diff --git a/arch/arm/include/asm/arch-rockchip/vop_rk3288.h 
b/arch/arm/include/asm/arch-rockchip/vop_rk3288.h
index 049f192..21e59be 100644
--- a/arch/arm/include/asm/arch-rockchip/vop_rk3288.h
+++ b/arch/arm/include/asm/arch-rockchip/vop_rk3288.h
@@ -201,6 +201,16 @@ enum vop_modes {
 #define V_DSP_OUT_MODE(x)  ((x) & 0xf)
 
 /* VOP_DSP_CTRL1 */
+#define V_RK3399_DSP_MIPI_POL(x)   ((x) << 28)
+#define V_RK3399_DSP_EDP_POL(x)((x) << 24)
+#define V_RK3399_DSP_HDMI_POL(x)   ((x) << 20)
+#define V_RK3399_DSP_LVDS_POL(x)   ((x) << 16)
+
+#define M_RK3399_DSP_MIPI_POL  (V_RK3399_DSP_MIPI_POL(0xf))
+#define M_RK3399_DSP_EDP_POL   (V_RK3399_DSP_EDP_POL(0xf))
+#define M_RK3399_DSP_HDMI_POL  (V_RK3399_DSP_HDMI_POL(0xf))
+#define M_RK3399_DSP_LVDS_POL  (V_RK3399_DSP_LVDS_POL(0xf))
+
 #define M_DSP_LAYER3_SEL   (3 << 14)
 #define M_DSP_LAYER2_SEL   (3 << 12)
 #define M_DSP_LAYER1_SEL   (3 << 10)
diff --git a/drivers/video/rockchip/Makefile b/drivers/video/rockchip/Makefile
index 9477ad0..495d5f7 100644
--- a/drivers/video/rockchip/Makefile
+++ b/drivers/video/rockchip/Makefile
@@ -8,6 +8,7 @@
 ifdef CONFIG_VIDEO_ROCKCHIP
 obj-y += rk_vop.o
 obj-$(CONFIG_ROCKCHIP_RK3288) += rk3288_vop.o
+obj-$(CONFIG_ROCKCHIP_RK3399) += rk3399_vop.o
 obj-$(CONFIG_DISPLAY_ROCKCHIP_EDP) += rk_edp.o
 obj-$(CONFIG_DISPLAY_ROCKCHIP_LVDS) += rk_lvds.o
 obj-$(CONFIG_DISPLAY_ROCKCHIP_HDMI) += rk_hdmi.o
diff --git a/drivers/video/rockchip/rk3399_vop.c 
b/drivers/video/rockchip/rk3399_vop.c
new file mode 100644
index 000..91a40ab
--- /dev/null
+++ b/drivers/video/rockchip/rk3399_vop.c
@@ -0,0 +1,105 @@
+/*
+ * Copyright (c) 2017 Theobroma Systems Design und Consulting GmbH
+ * Copyright (c) 2015 Google, Inc
+ * Copyright 2014 Rockchip Inc.
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include "rk_vop.h"
+
+DECLARE_GLOBAL_DATA_PTR;
+
+static void rk3399_set_pin_polarity(struct udevice *dev,
+   enum vop_modes mode, u32 polarity)
+{
+   struct rk_vop_priv *priv = dev_get_priv(dev);
+   struct rk3288_vop *regs = priv->regs;
+
+   /*
+* The RK3399 VOPs (v3.5 and v3.6) require a per-mode setting of
+* the polarity configuration (in ctrl1).
+*/
+   switch (mode) {
+   case VOP_MODE_HDMI:
+   clrsetbits_le32(>dsp_ctrl1,
+   M_RK3399_DSP_HDMI_POL,
+   V_RK3399_DSP_HDMI_POL(polarity));
+   break;
+
+   case VOP_MODE_EDP:
+   clrsetbits_le32(>dsp_ctrl1,
+   M_RK3399_DSP_EDP_POL,
+   V_RK3399_DSP_EDP_POL(polarity));
+   break;
+
+   case VOP_MODE_MIPI:
+   clrsetbits_le32(>dsp_ctrl1,
+   M_RK3399_DSP_MIPI_POL,
+   V_RK3399_DSP_MIPI_POL(polarity));
+   break;
+
+   case VOP_MODE_LVDS:
+   /* The RK3399 has neither parallel RGB nor LVDS output. */
+   default:
+   debug("%s: unsupported output mode %x\n", __func__, mode);
+   }
+}
+
+/*
+ * Try some common regulators. We should really get these from the
+ * device tree somehow.
+ */
+static const char * const rk3399_regulator_names[] = {
+   "vcc33_lcd"
+};
+
+static int rk3399_vop_probe(struct udevice *dev)
+{
+   /* Before relocation we don't need to do anything */
+   if (!(gd->flags & GD_FLG_RELOC))
+   return 0;
+
+   /* Probe regulators required for the RK3399 VOP */
+   rk_vop_probe_regulators(dev, rk3399_regulator_names,
+   ARRAY_SIZE(rk3399_regulator_names));
+
+   return rk_vop_probe(dev);
+}
+
+struct rkvop_driverdata rk3399_lit_driverdata = {
+   .set_pin_polarity = rk3399_set_pin_polarity,
+};
+
+struct 

[U-Boot] [PATCH v4 0/9] rockchip: video: rk3399: enable HDMI output

2017-05-31 Thread Philipp Tomsich

This series provides HDMI enablement for the RK3399 and will support
video console on the RK3399 either with VOP-lit or VOP-big:
 - pinctrl and clk support for the hdmi node
 - a refactoring of rk_vop.c and rk_hdmi.c to allow for the minor
   differences between the RK3288 and RK3399 VOP and HDMI blocks

This has been tested (on top of sjg/master) using 'bmp display' and
'setenv stdout vidconsole' on the RK3399-Q7 with various HDMI monitors,
both for VOP-lit and VOP-big (setting the other one to 'disabled').

v4 splits the changes to the rk_vop and rk_hdmi components into more
manageable series of changes.

Changes in v4:
- added patch to break down into smaller changes
- added patch to break down into smaller changes
- added patch to break down into smaller changes
- split the massive "refactor, split and add RK3399 support"-change into
  smaller chunks that are more easily digestible
- new patch (split off from the earlier RK3399 HDMI encoder change)
- splits the large change into smaller changes

Changes in v3:
- splits the VOP driver into SOC-specific and common portions
- moves the "maximum x" and "maximum y" resolution config into Kconfig (instead
  of having hard-coded values that may need to be revised each time someone adds
  a new device or new features)
- split into separate drivers for the SOC-specific portion of the driver
- rebase to sjg/next

Changes in v2:
- removed DEBUG from the patch (as was done in our production branches,
  but missing from the patch-prep branch)
- updated SJG's comment (with a TODO for the RK3288) to reflect the
  new code structure

Philipp Tomsich (9):
  rockchip: video: Kconfig: reformat help for VIDEO_ROCKCHIP
  rockchip: video: Kconfig: set MAX_XRES and MAX_YRES via Kconfig
  rockchip: video: refactor rk_vop and split RK3328-specific code off
  rockchip: video: rk3399: enable HDMI output (from the rk_vop) for the
RK3399
  rockchip: video: add mpixelclock settings from Linux driver
  rockchip: video: split RK3228-specific part off from rk_hdmi
  rockchip: video: rk3399: add HDMI TX support on the RK3399
  rockchip: dts: rk3399: enable HDMI output in the DTS
  rockchip: board: puma_rk3399: enable BMP_16BPP, BMP_24BPP and
BMP_32BPP

 arch/arm/dts/rk3399.dtsi|  39 +
 arch/arm/include/asm/arch-rockchip/grf_rk3399.h |   3 +
 arch/arm/include/asm/arch-rockchip/vop_rk3288.h |  11 ++
 drivers/video/rockchip/Kconfig  |  29 +++-
 drivers/video/rockchip/Makefile |   6 +-
 drivers/video/rockchip/rk3288_hdmi.c| 116 +++
 drivers/video/rockchip/rk3288_vop.c |  95 
 drivers/video/rockchip/rk3399_hdmi.c|  81 +++
 drivers/video/rockchip/rk3399_vop.c | 105 ++
 drivers/video/rockchip/rk_hdmi.c| 114 ---
 drivers/video/rockchip/rk_hdmi.h|  32 
 drivers/video/rockchip/rk_vop.c | 185 
 drivers/video/rockchip/rk_vop.h |  32 
 include/configs/puma_rk3399.h   |   4 +
 14 files changed, 662 insertions(+), 190 deletions(-)
 create mode 100644 drivers/video/rockchip/rk3288_hdmi.c
 create mode 100644 drivers/video/rockchip/rk3288_vop.c
 create mode 100644 drivers/video/rockchip/rk3399_hdmi.c
 create mode 100644 drivers/video/rockchip/rk3399_vop.c
 create mode 100644 drivers/video/rockchip/rk_hdmi.h
 create mode 100644 drivers/video/rockchip/rk_vop.h

-- 
1.9.1

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


[U-Boot] [PATCH] arm: omap: Unify get_device_type() function

2017-05-31 Thread Sam Protsenko
Refactor OMAP3/4/5 code so that we have only one get_device_type()
function for all platforms.

Details:
 - Add ctrl variable for AM33xx and OMAP3 platforms (like it's done for
   OMAP4/5), so we can obtain status register in common way
 - For now ctrl structure for AM33xx/OMAP3 contains only status register
   address
 - Run hw_data_init() in order to assign ctrl to proper structure
 - Extract some definitions to omap_am_common.h, because including
   omap_common.h in am33xx board files breaks compilation

Buildman script was run for all OMAP boards. Result output:
arm: (for 38/616 boards)
all +348.9
bss -6.2
data +3.5
rodata +300.0
spl/u-boot-spl:all +281.4
spl/u-boot-spl:data +2.2
spl/u-boot-spl:rodata +252.0
spl/u-boot-spl:text +27.2
text +51.7
(no errors to report)

Tested on AM57x EVM.

Signed-off-by: Sam Protsenko 
---
 arch/arm/include/asm/arch-am33xx/cpu.h  |  6 --
 arch/arm/include/asm/arch-am33xx/omap.h |  3 +++
 arch/arm/include/asm/arch-omap3/omap.h  |  3 +++
 arch/arm/include/asm/omap_am_common.h   | 21 +
 arch/arm/include/asm/omap_common.h  | 16 +++-
 arch/arm/mach-omap2/Makefile|  1 +
 arch/arm/mach-omap2/am33xx/Makefile |  2 ++
 arch/arm/mach-omap2/am33xx/board.c  |  3 +++
 arch/arm/mach-omap2/am33xx/hw_data.c| 19 +++
 arch/arm/mach-omap2/am33xx/prcm-regs.c  | 15 +++
 arch/arm/mach-omap2/am33xx/sys_info.c   | 10 --
 arch/arm/mach-omap2/hwinit-common.c |  9 -
 arch/arm/mach-omap2/omap3/Makefile  |  2 ++
 arch/arm/mach-omap2/omap3/board.c   | 12 
 arch/arm/mach-omap2/omap3/hw_data.c | 19 +++
 arch/arm/mach-omap2/omap3/prcm-regs.c   | 15 +++
 arch/arm/mach-omap2/omap3/sys_info.c|  9 +
 arch/arm/mach-omap2/sysinfo-common.c| 21 +
 board/ti/am335x/board.c |  1 +
 19 files changed, 141 insertions(+), 46 deletions(-)
 create mode 100644 arch/arm/include/asm/omap_am_common.h
 create mode 100644 arch/arm/mach-omap2/am33xx/hw_data.c
 create mode 100644 arch/arm/mach-omap2/am33xx/prcm-regs.c
 create mode 100644 arch/arm/mach-omap2/omap3/hw_data.c
 create mode 100644 arch/arm/mach-omap2/omap3/prcm-regs.c
 create mode 100644 arch/arm/mach-omap2/sysinfo-common.c

diff --git a/arch/arm/include/asm/arch-am33xx/cpu.h 
b/arch/arm/include/asm/arch-am33xx/cpu.h
index 8cae291ea0..e8d7d549e8 100644
--- a/arch/arm/include/asm/arch-am33xx/cpu.h
+++ b/arch/arm/include/asm/arch-am33xx/cpu.h
@@ -36,12 +36,6 @@
 #define TCFG_RESET BIT(0)  /* software reset */
 #define TCFG_EMUFREE   BIT(1)  /* behaviour of tmr on debug */
 #define TCFG_IDLEMOD_SHIFT (2) /* power management */
-/* device type */
-#define DEVICE_MASK(BIT(8) | BIT(9) | BIT(10))
-#define TST_DEVICE 0x0
-#define EMU_DEVICE 0x1
-#define HS_DEVICE  0x2
-#define GP_DEVICE  0x3
 
 /* cpu-id for AM43XX AM33XX and TI81XX family */
 #define AM437X 0xB98C
diff --git a/arch/arm/include/asm/arch-am33xx/omap.h 
b/arch/arm/include/asm/arch-am33xx/omap.h
index 3293caaca4..5a1b95c2c0 100644
--- a/arch/arm/include/asm/arch-am33xx/omap.h
+++ b/arch/arm/include/asm/arch-am33xx/omap.h
@@ -41,6 +41,9 @@ struct omap_boot_parameters {
unsigned char boot_device;
unsigned char reset_reason;
 };
+
+#define DEVICE_TYPE_SHIFT  0x8
+#define DEVICE_TYPE_MASK   (0x7 << DEVICE_TYPE_SHIFT)
 #endif
 
 #endif
diff --git a/arch/arm/include/asm/arch-omap3/omap.h 
b/arch/arm/include/asm/arch-omap3/omap.h
index db763e49a3..8933f5489f 100644
--- a/arch/arm/include/asm/arch-omap3/omap.h
+++ b/arch/arm/include/asm/arch-omap3/omap.h
@@ -91,6 +91,9 @@ struct s32ktimer {
unsigned int s32k_cr;   /* 0x10 */
 };
 
+#define DEVICE_TYPE_SHIFT  0x8
+#define DEVICE_TYPE_MASK   (0x7 << DEVICE_TYPE_SHIFT)
+
 #endif /* __ASSEMBLY__ */
 
 #ifndef __ASSEMBLY__
diff --git a/arch/arm/include/asm/omap_am_common.h 
b/arch/arm/include/asm/omap_am_common.h
new file mode 100644
index 00..70aa15b22c
--- /dev/null
+++ b/arch/arm/include/asm/omap_am_common.h
@@ -0,0 +1,21 @@
+/*
+ * Common definitions for OMAP/AM based boards.
+ *
+ * (C) Copyright 2017 Linaro Ltd.
+ * Sam Protsenko 
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#ifndef _OMAP_AM_COMMON_H_
+#define _OMAP_AM_COMMON_H_
+
+/* Silicon device type */
+#define TST_DEVICE 0x0
+#define EMU_DEVICE 0x1
+#define HS_DEVICE  0x2
+#define GP_DEVICE  0x3
+
+void hw_data_init(void);
+
+#endif /* _OMAP_AM_COMMON_H_ */
diff --git a/arch/arm/include/asm/omap_common.h 
b/arch/arm/include/asm/omap_common.h
index 

[U-Boot] [PATCH v4 8/9] rockchip: dts: rk3399: enable HDMI output in the DTS

2017-05-31 Thread Philipp Tomsich
This commit enables HDMI output in the DTS by adding the necessary
nodes to vopl/vopb and by adding the HDMI node.

Signed-off-by: Philipp Tomsich 
---

Changes in v4: None
Changes in v3: None
Changes in v2: None

 arch/arm/dts/rk3399.dtsi | 39 +++
 1 file changed, 39 insertions(+)

diff --git a/arch/arm/dts/rk3399.dtsi b/arch/arm/dts/rk3399.dtsi
index f3d3f53..7f1fc50 100644
--- a/arch/arm/dts/rk3399.dtsi
+++ b/arch/arm/dts/rk3399.dtsi
@@ -1419,6 +1419,11 @@
reg = <3>;
remote-endpoint = <_in_vopl>;
};
+
+   vopl_out_hdmi: endpoint@1 {
+   reg = <1>;
+   remote-endpoint = <_in_vopl>;
+   };
};
};
 
@@ -1440,6 +1445,40 @@
reg = <3>;
remote-endpoint = <_in_vopb>;
};
+
+   vopb_out_hdmi: endpoint@1 {
+   reg = <1>;
+   remote-endpoint = <_in_vopb>;
+   };
+   };
+   };
+
+   hdmi: hdmi@ff94 {
+   compatible = "rockchip,rk3399-dw-hdmi";
+   reg = <0x0 0xff94 0x0 0x2>;
+   reg-io-width = <4>;
+   rockchip,grf = <>;
+   pinctrl-names = "default";
+   pinctrl-0 = <_i2c_xfer>;
+   power-domains = < RK3399_PD_HDCP>;
+   interrupts = ;
+   clocks = < PCLK_HDMI_CTRL>, < SCLK_HDMI_SFR>, < 
PLL_VPLL>, < PCLK_VIO_GRF>;
+   clock-names = "iahb", "isfr", "vpll", "grf";
+   status = "disabled";
+
+   ports {
+   hdmi_in: port {
+   #address-cells = <1>;
+   #size-cells = <0>;
+   hdmi_in_vopb: endpoint@0 {
+   reg = <0>;
+   remote-endpoint = <_out_hdmi>;
+   };
+   hdmi_in_vopl: endpoint@1 {
+   reg = <1>;
+   remote-endpoint = <_out_hdmi>;
+   };
+   };
};
};
 
-- 
1.9.1

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


[U-Boot] [PATCH v4 7/9] rockchip: video: rk3399: add HDMI TX support on the RK3399

2017-05-31 Thread Philipp Tomsich
This commit enables the RK3399 HDMI TX, which is very similar to the
one found on the RK3288.  As requested by Simon, this splits the HDMI
driver into a SOC-specific portion (rk3399_hdmi.c, rk3288_hdmi.c) and
a common portion (rk_hdmi.c).

Note that the I2C communication for reading the EDID works well with
the default settings, but does not with the alternate settings used on
the RK3288... this configuration aspect is reflected by the driverdata
for the RK3399 driver.

Having some sort of DTS-based configuration for the regulator
dependencies would be nice for the future, but for now we simply use
lists of regulator names (also via driverdata) that we probe.

Signed-off-by: Philipp Tomsich 
---

Changes in v4:
- splits the large change into smaller changes

Changes in v3:
- split into separate drivers for the SOC-specific portion of the driver
- rebase to sjg/next

Changes in v2:
- removed DEBUG from the patch (as was done in our production branches,
  but missing from the patch-prep branch)
- updated SJG's comment (with a TODO for the RK3288) to reflect the
  new code structure


---
 arch/arm/include/asm/arch-rockchip/grf_rk3399.h |  3 +
 drivers/video/rockchip/Makefile |  1 +
 drivers/video/rockchip/rk3399_hdmi.c| 81 +
 3 files changed, 85 insertions(+)
 create mode 100644 drivers/video/rockchip/rk3399_hdmi.c

diff --git a/arch/arm/include/asm/arch-rockchip/grf_rk3399.h 
b/arch/arm/include/asm/arch-rockchip/grf_rk3399.h
index eda9956..8d21eb7 100644
--- a/arch/arm/include/asm/arch-rockchip/grf_rk3399.h
+++ b/arch/arm/include/asm/arch-rockchip/grf_rk3399.h
@@ -534,6 +534,9 @@ enum {
GRF_DSI0_VOP_SEL_MASK   = 1 << GRF_DSI0_VOP_SEL_SHIFT,
GRF_DSI0_VOP_SEL_B  = 0,
GRF_DSI0_VOP_SEL_L  = 1,
+   GRF_RK3399_HDMI_VOP_SEL_MASK = 1 << 6,
+   GRF_RK3399_HDMI_VOP_SEL_B = 0 << 6,
+   GRF_RK3399_HDMI_VOP_SEL_L = 1 << 6,
 
/* GRF_SOC_CON22 */
GRF_DPHY_TX0_RXMODE_SHIFT = 0,
diff --git a/drivers/video/rockchip/Makefile b/drivers/video/rockchip/Makefile
index 65d0ed6..872dc0f 100644
--- a/drivers/video/rockchip/Makefile
+++ b/drivers/video/rockchip/Makefile
@@ -12,6 +12,7 @@ obj-$(CONFIG_ROCKCHIP_RK3399) += rk3399_vop.o
 obj-$(CONFIG_DISPLAY_ROCKCHIP_EDP) += rk_edp.o
 obj-$(CONFIG_DISPLAY_ROCKCHIP_LVDS) += rk_lvds.o
 obj-hdmi-$(CONFIG_ROCKCHIP_RK3288) += rk3288_hdmi.o
+obj-hdmi-$(CONFIG_ROCKCHIP_RK3399) += rk3399_hdmi.o
 obj-$(CONFIG_DISPLAY_ROCKCHIP_HDMI) += rk_hdmi.o $(obj-hdmi-y)
 obj-$(CONFIG_DISPLAY_ROCKCHIP_MIPI) += rk_mipi.o
 endif
diff --git a/drivers/video/rockchip/rk3399_hdmi.c 
b/drivers/video/rockchip/rk3399_hdmi.c
new file mode 100644
index 000..b1e5097
--- /dev/null
+++ b/drivers/video/rockchip/rk3399_hdmi.c
@@ -0,0 +1,81 @@
+/*
+ * Copyright (c) 2017 Theobroma Systems Design und Consulting GmbH
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include "rk_hdmi.h"
+
+static int rk3399_hdmi_enable(struct udevice *dev, int panel_bpp,
+ const struct display_timing *edid)
+{
+   struct rk_hdmi_priv *priv = dev_get_priv(dev);
+   struct display_plat *uc_plat = dev_get_uclass_platdata(dev);
+   int vop_id = uc_plat->source_id;
+   struct rk3399_grf_regs *grf = priv->grf;
+
+   /* select the hdmi encoder input data from our source_id */
+   rk_clrsetreg(>soc_con20, GRF_RK3399_HDMI_VOP_SEL_MASK,
+(vop_id == 1) ? GRF_RK3399_HDMI_VOP_SEL_L : 0);
+
+   return dw_hdmi_enable(>hdmi, edid);
+}
+
+static int rk3399_hdmi_ofdata_to_platdata(struct udevice *dev)
+{
+   struct rk_hdmi_priv *priv = dev_get_priv(dev);
+   struct dw_hdmi *hdmi = >hdmi;
+
+   hdmi->i2c_clk_high = 0x7a;
+   hdmi->i2c_clk_low = 0x8d;
+
+   return rk_hdmi_ofdata_to_platdata(dev);
+}
+
+static const char * const rk3399_regulator_names[] = {
+   "vcc1v8_hdmi",
+   "vcc0v9_hdmi"
+};
+
+static int rk3399_hdmi_probe(struct udevice *dev)
+{
+   /* Enable regulators required for HDMI */
+   rk_hdmi_probe_regulators(dev, rk3399_regulator_names,
+ARRAY_SIZE(rk3399_regulator_names));
+
+   return rk_hdmi_probe(dev);
+}
+
+static const struct dm_display_ops rk3399_hdmi_ops = {
+   .read_edid = rk_hdmi_read_edid,
+   .enable = rk3399_hdmi_enable,
+};
+
+static const struct udevice_id rk3399_hdmi_ids[] = {
+   { .compatible = "rockchip,rk3399-dw-hdmi" },
+   { }
+};
+
+U_BOOT_DRIVER(rk3399_hdmi_rockchip) = {
+   .name = "rk3399_hdmi_rockchip",
+   .id = UCLASS_DISPLAY,
+   .of_match = rk3399_hdmi_ids,
+   .ops = _hdmi_ops,
+   .ofdata_to_platdata = rk3399_hdmi_ofdata_to_platdata,
+   .probe = rk3399_hdmi_probe,
+   .priv_auto_alloc_size = sizeof(struct 

[U-Boot] [PATCH v2 02/28] Allow displaying the U-Boot banner on a video display

2017-05-31 Thread Simon Glass
At present the U-Boot banner is only displayed on the serial console. If
this is not visible to the user, the banner does not show. Some devices
have a video display which can usefully display this information.

Add a banner which is printed after relocation only on non-serial devices
if CONFIG_DISPLAY_BOARDINFO_LATE is defined.

Signed-off-by: Simon Glass 
---

Changes in v2: None

 common/board_r.c  |  1 +
 common/console.c  | 15 +++
 include/console.h | 12 
 3 files changed, 24 insertions(+), 4 deletions(-)

diff --git a/common/board_r.c b/common/board_r.c
index 5986cd7674..99b5d22c81 100644
--- a/common/board_r.c
+++ b/common/board_r.c
@@ -847,6 +847,7 @@ static init_fnc_t init_sequence_r[] = {
 #endif
console_init_r, /* fully init console as a device */
 #ifdef CONFIG_DISPLAY_BOARDINFO_LATE
+   console_announce_r,
show_board_info,
 #endif
 #ifdef CONFIG_ARCH_MISC_INIT
diff --git a/common/console.c b/common/console.c
index 1232808df5..3fcd7ce66b 100644
--- a/common/console.c
+++ b/common/console.c
@@ -202,7 +202,6 @@ static void console_putc(int file, const char c)
}
 }
 
-#if CONFIG_IS_ENABLED(PRE_CONSOLE_BUFFER)
 static void console_puts_noserial(int file, const char *s)
 {
int i;
@@ -214,7 +213,6 @@ static void console_puts_noserial(int file, const char *s)
dev->puts(dev, s);
}
 }
-#endif
 
 static void console_puts(int file, const char *s)
 {
@@ -248,13 +246,11 @@ static inline void console_putc(int file, const char c)
stdio_devices[file]->putc(stdio_devices[file], c);
 }
 
-#if CONFIG_IS_ENABLED(PRE_CONSOLE_BUFFER)
 static inline void console_puts_noserial(int file, const char *s)
 {
if (strcmp(stdio_devices[file]->name, "serial") != 0)
stdio_devices[file]->puts(stdio_devices[file], s);
 }
-#endif
 
 static inline void console_puts(int file, const char *s)
 {
@@ -699,6 +695,17 @@ static void console_update_silent(void)
 #endif
 }
 
+int console_announce_r(void)
+{
+   char buf[DISPLAY_OPTIONS_BANNER_LENGTH];
+
+   display_options_get_banner(false, buf, sizeof(buf));
+
+   console_puts_noserial(stdout, buf);
+
+   return 0;
+}
+
 /* Called before relocation - use serial functions */
 int console_init_f(void)
 {
diff --git a/include/console.h b/include/console.h
index 3d37f6a53b..511b38e9e7 100644
--- a/include/console.h
+++ b/include/console.h
@@ -42,6 +42,18 @@ void console_record_reset(void);
  */
 void console_record_reset_enable(void);
 
+/**
+ * console_announce_r() - print a U-Boot console on non-serial consoles
+ *
+ * When U-Boot starts up with a display it generally does not account itself
+ * on the display. The banner is emitted on the UART before relocation instead.
+ * This function prints a banner on devices which (we assume) did not receive
+ * it before relocation.
+ *
+ * @return 0 (meaning no errors)
+ */
+int console_announce_r(void);
+
 /*
  * CONSOLE multiplexing.
  */
-- 
2.13.0.219.gdb65acc882-goog

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


[U-Boot] [PATCH v2 03/28] arm: arm720t: Support CONFIG_SKIP_LOWLEVEL_INIT_ONLY

2017-05-31 Thread Simon Glass
This option allows skipping the call to lowlevel() while still performing
CP15 init. Support this on ARM720T so it can be used with Tegra.

Signed-off-by: Simon Glass 
---

Changes in v2: None

 arch/arm/cpu/arm720t/start.S | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/arm/cpu/arm720t/start.S b/arch/arm/cpu/arm720t/start.S
index 0bb3441fb8..365d8f08cb 100644
--- a/arch/arm/cpu/arm720t/start.S
+++ b/arch/arm/cpu/arm720t/start.S
@@ -38,7 +38,8 @@ reset:
 * we do sys-critical inits only at reboot,
 * not when booting from ram!
 */
-#ifndef CONFIG_SKIP_LOWLEVEL_INIT
+#if !defined(CONFIG_SKIP_LOWLEVEL_INIT) && \
+   !defined(CONFIG_SKIP_LOWLEVEL_INIT_ONLY)
bl  cpu_init_crit
 #endif
 
@@ -62,7 +63,8 @@ c_runtime_cpu_setup:
  *
  */
 
-#ifndef CONFIG_SKIP_LOWLEVEL_INIT
+#if !defined(CONFIG_SKIP_LOWLEVEL_INIT) && \
+   !defined(CONFIG_SKIP_LOWLEVEL_INIT_ONLY)
 cpu_init_crit:
 
mov ip, lr
-- 
2.13.0.219.gdb65acc882-goog

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


[U-Boot] [PATCH v2 22/28] rockchip: jerry: Add a .its file for chromium

2017-05-31 Thread Simon Glass
Add a sample .its file for booting U-Boot on a jerry Chromebook.

Signed-off-by: Simon Glass 
---

Changes in v2:
- Add new patch containing a .its file for chromium

 doc/chromium/chromebook_jerry.its | 42 +++
 1 file changed, 42 insertions(+)
 create mode 100644 doc/chromium/chromebook_jerry.its

diff --git a/doc/chromium/chromebook_jerry.its 
b/doc/chromium/chromebook_jerry.its
new file mode 100644
index 00..8cff840e00
--- /dev/null
+++ b/doc/chromium/chromebook_jerry.its
@@ -0,0 +1,42 @@
+/dts-v1/;
+
+/ {
+   description = "U-Boot mainline";
+   #address-cells = <1>;
+
+   images {
+   kernel@1 {
+   description = "U-Boot mainline";
+   type = "kernel_noload";
+   arch = "arm";
+   os = "linux";
+   data = /incbin/("../../b/chromebook_jerry/u-boot.bin");
+   compression = "none";
+   load = <0>;
+   entry = <0>;
+   hash@2 {
+   algo = "sha1";
+   };
+   };
+
+   fdt@1{
+   description = "rk3288-veryron-jerry.dtb";
+   data = /incbin/("../../b/chromebook_jerry/u-boot.dtb");
+   type = "flat_dt";
+   arch = "arm";
+   compression = "none";
+   hash@1{
+   algo = "sha1";
+   };
+   };
+   };
+
+   configurations {
+   default = "config@1";
+   config@1 {
+   description = "Boot U-Boot";
+   kernel = "kernel@1";
+   fdt = "fdt@1";
+   };
+   };
+};
-- 
2.13.0.219.gdb65acc882-goog

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


[U-Boot] [PATCH v2 23/28] rockchip: rk3288: Convert clock driver to use shifted masks

2017-05-31 Thread Simon Glass
Shifted masks are the standard approach with rockchip since it allows
use of the mask without shifting it each time. Update the definitions and
the driver to match.

Signed-off-by: Simon Glass 
---

Changes in v2: None

 arch/arm/include/asm/arch-rockchip/cru_rk3288.h |  74 ---
 drivers/clk/rockchip/clk_rk3288.c   | 121 ++--
 2 files changed, 90 insertions(+), 105 deletions(-)

diff --git a/arch/arm/include/asm/arch-rockchip/cru_rk3288.h 
b/arch/arm/include/asm/arch-rockchip/cru_rk3288.h
index d575f4a163..cb0a935edc 100644
--- a/arch/arm/include/asm/arch-rockchip/cru_rk3288.h
+++ b/arch/arm/include/asm/arch-rockchip/cru_rk3288.h
@@ -64,135 +64,137 @@ check_member(rk3288_cru, cru_emmc_con[1], 0x021c);
 /* CRU_CLKSEL11_CON */
 enum {
HSICPHY_DIV_SHIFT   = 8,
-   HSICPHY_DIV_MASK= 0x3f,
+   HSICPHY_DIV_MASK= 0x3f << HSICPHY_DIV_SHIFT,
 
MMC0_PLL_SHIFT  = 6,
-   MMC0_PLL_MASK   = 3,
+   MMC0_PLL_MASK   = 3 << MMC0_PLL_SHIFT,
MMC0_PLL_SELECT_CODEC   = 0,
MMC0_PLL_SELECT_GENERAL,
MMC0_PLL_SELECT_24MHZ,
 
MMC0_DIV_SHIFT  = 0,
-   MMC0_DIV_MASK   = 0x3f,
+   MMC0_DIV_MASK   = 0x3f << MMC0_DIV_SHIFT,
 };
 
 /* CRU_CLKSEL12_CON */
 enum {
EMMC_PLL_SHIFT  = 0xe,
-   EMMC_PLL_MASK   = 3,
+   EMMC_PLL_MASK   = 3 << EMMC_PLL_SHIFT,
EMMC_PLL_SELECT_CODEC   = 0,
EMMC_PLL_SELECT_GENERAL,
EMMC_PLL_SELECT_24MHZ,
 
EMMC_DIV_SHIFT  = 8,
-   EMMC_DIV_MASK   = 0x3f,
+   EMMC_DIV_MASK   = 0x3f < EMMC_DIV_SHIFT,
 
SDIO0_PLL_SHIFT = 6,
-   SDIO0_PLL_MASK  = 3,
+   SDIO0_PLL_MASK  = 3 << SDIO0_PLL_SHIFT,
SDIO0_PLL_SELECT_CODEC  = 0,
SDIO0_PLL_SELECT_GENERAL,
SDIO0_PLL_SELECT_24MHZ,
 
SDIO0_DIV_SHIFT = 0,
-   SDIO0_DIV_MASK  = 0x3f,
+   SDIO0_DIV_MASK  = 0x3f << SDIO0_DIV_SHIFT,
 };
 
 /* CRU_CLKSEL21_CON */
 enum {
-   MAC_DIV_CON_SHIFT = 0xf,
-   MAC_DIV_CON_MASK = 0x1f,
+   MAC_DIV_CON_SHIFT   = 0xf,
+   MAC_DIV_CON_MASK= 0x1f << MAC_DIV_CON_SHIFT,
 
-   RMII_EXTCLK_SHIFT = 4,
-   RMII_EXTCLK_MASK = 1,
+   RMII_EXTCLK_SHIFT   = 4,
+   RMII_EXTCLK_MASK= 1 << RMII_EXTCLK_SHIFT,
RMII_EXTCLK_SELECT_INT_DIV_CLK = 0,
RMII_EXTCLK_SELECT_EXT_CLK = 1,
 
-   EMAC_PLL_SHIFT = 0,
-   EMAC_PLL_MASK = 0x3,
-   EMAC_PLL_SELECT_NEW = 0x0,
-   EMAC_PLL_SELECT_CODEC = 0x1,
-   EMAC_PLL_SELECT_GENERAL = 0x2,
+   EMAC_PLL_SHIFT  = 0,
+   EMAC_PLL_MASK   = 0x3 << EMAC_PLL_SHIFT,
+   EMAC_PLL_SELECT_NEW = 0x0,
+   EMAC_PLL_SELECT_CODEC   = 0x1,
+   EMAC_PLL_SELECT_GENERAL = 0x2,
 };
 
 /* CRU_CLKSEL25_CON */
 enum {
SPI1_PLL_SHIFT  = 0xf,
-   SPI1_PLL_MASK   = 1,
+   SPI1_PLL_MASK   = 1 << SPI1_PLL_SHIFT,
SPI1_PLL_SELECT_CODEC   = 0,
SPI1_PLL_SELECT_GENERAL,
 
SPI1_DIV_SHIFT  = 8,
-   SPI1_DIV_MASK   = 0x7f,
+   SPI1_DIV_MASK   = 0x7f << SPI1_DIV_SHIFT,
 
SPI0_PLL_SHIFT  = 7,
-   SPI0_PLL_MASK   = 1,
+   SPI0_PLL_MASK   = 1 << SPI0_PLL_SHIFT,
SPI0_PLL_SELECT_CODEC   = 0,
SPI0_PLL_SELECT_GENERAL,
 
SPI0_DIV_SHIFT  = 0,
-   SPI0_DIV_MASK   = 0x7f,
+   SPI0_DIV_MASK   = 0x7f << SPI0_DIV_SHIFT,
 };
 
 /* CRU_CLKSEL37_CON */
 enum {
PCLK_CORE_DBG_DIV_SHIFT = 9,
-   PCLK_CORE_DBG_DIV_MASK  = 0x1f,
+   PCLK_CORE_DBG_DIV_MASK  = 0x1f << PCLK_CORE_DBG_DIV_SHIFT,
 
ATCLK_CORE_DIV_CON_SHIFT = 4,
-   ATCLK_CORE_DIV_CON_MASK = 0x1f,
+   ATCLK_CORE_DIV_CON_MASK = 0x1f << ATCLK_CORE_DIV_CON_SHIFT,
 
CLK_L2RAM_DIV_SHIFT = 0,
-   CLK_L2RAM_DIV_MASK  = 7,
+   CLK_L2RAM_DIV_MASK  = 7 << CLK_L2RAM_DIV_SHIFT,
 };
 
 /* CRU_CLKSEL39_CON */
 enum {
ACLK_HEVC_PLL_SHIFT = 0xe,
-   ACLK_HEVC_PLL_MASK  = 3,
+   ACLK_HEVC_PLL_MASK  = 3 << ACLK_HEVC_PLL_SHIFT,
ACLK_HEVC_PLL_SELECT_CODEC = 0,
ACLK_HEVC_PLL_SELECT_GENERAL,
ACLK_HEVC_PLL_SELECT_NEW,
 
ACLK_HEVC_DIV_SHIFT = 8,
-   ACLK_HEVC_DIV_MASK  = 0x1f,
+   ACLK_HEVC_DIV_MASK  = 0x1f << ACLK_HEVC_DIV_SHIFT,
 
SPI2_PLL_SHIFT  = 7,
-   SPI2_PLL_MASK   = 1,
+   SPI2_PLL_MASK   = 1 << SPI2_PLL_SHIFT,
SPI2_PLL_SELECT_CODEC   = 0,
SPI2_PLL_SELECT_GENERAL,
 
SPI2_DIV_SHIFT  = 0,
-   SPI2_DIV_MASK   = 0x7f,
+   SPI2_DIV_MASK   = 0x7f << SPI2_DIV_SHIFT,
 };
 
 /* CRU_MODE_CON */
 enum {
+   CRU_MODE_MASK   = 3,
+
NPLL_MODE_SHIFT = 0xe,
-   NPLL_MODE_MASK 

[U-Boot] [PATCH v2 19/28] rockchip: rk3288: Add error debugging to veyron_init()

2017-05-31 Thread Simon Glass
Add a debug() statement so we can see when something goes wrong with the
regulator.

Signed-off-by: Simon Glass 
---

Changes in v2: None

 arch/arm/mach-rockchip/rk3288-board.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-rockchip/rk3288-board.c 
b/arch/arm/mach-rockchip/rk3288-board.c
index 9894a25e08..18fd0dcd20 100644
--- a/arch/arm/mach-rockchip/rk3288-board.c
+++ b/arch/arm/mach-rockchip/rk3288-board.c
@@ -86,8 +86,10 @@ static int veyron_init(void)
int ret;
 
ret = regulator_get_by_platname("vdd_arm", );
-   if (ret)
+   if (ret) {
+   debug("Cannot set regulator name\n");
return ret;
+   }
 
/* Slowly raise to max CPU voltage to prevent overshoot */
ret = regulator_set_value(dev, 120);
-- 
2.13.0.219.gdb65acc882-goog

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


[U-Boot] [PATCH v2 14/28] tegra: clock: Avoid a divide-by-zero error

2017-05-31 Thread Simon Glass
The clock fix-up for tegra is still present in the code. It causes a
divide-by-zero bug after relocation when chain-loading U-Boot from
coreboot. Fix this by adding a check.

Signed-off-by: Simon Glass 
Fixes: 7468676 (ARM: tegra: fix clock_get_periph_rate() for UART clocks)
---

Changes in v2: None

 arch/arm/mach-tegra/clock.c | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-tegra/clock.c b/arch/arm/mach-tegra/clock.c
index ce68c7d0cc..dc58b3027d 100644
--- a/arch/arm/mach-tegra/clock.c
+++ b/arch/arm/mach-tegra/clock.c
@@ -339,8 +339,11 @@ unsigned long clock_get_periph_rate(enum periph_id 
periph_id,
 * return value doesn't help. In summary this clock driver is
 * quite broken but I'm afraid I have no idea how to fix it
 * without completely replacing it.
+*
+* Be careful to avoid a divide by zero error.
 */
-   div -= 2;
+   if (div >= 1)
+   div -= 2;
break;
 #endif
default:
-- 
2.13.0.219.gdb65acc882-goog

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


Re: [U-Boot] [PATCH 1/4] dm: spi: add BCM63xx HSSPI driver

2017-05-31 Thread Simon Glass
Hi Alvaro,

On 23 May 2017 at 13:18, Álvaro Fernández Rojas  wrote:
> This driver is a simplified version of linux/drivers/spi/spi-bcm63xx-hsspi.c
>
> Signed-off-by: Álvaro Fernández Rojas 
> ---
>  drivers/spi/Kconfig |   8 +
>  drivers/spi/Makefile|   1 +
>  drivers/spi/bcm63xx_hsspi.c | 392 
> 
>  3 files changed, 401 insertions(+)
>  create mode 100644 drivers/spi/bcm63xx_hsspi.c

Reviewed-by: Simon Glass 

Suggest you add error checking to clk_enable(), etc. and split
bcm63xx_hsspi_xfer() into a few subparts as it is very long.

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


Re: [U-Boot] [PATCH 12/12] README: Add instructions for chain-loading U-Boot

2017-05-31 Thread Simon Glass
Hi Peter,

On 29 May 2017 at 07:29, Peter Robinson  wrote:
>  On Mon, May 22, 2017 at 12:17 PM, Simon Glass  wrote:
>> Most Chromebooks support chain-loading U-Boot but instructions are
>> somewhat scattered. Add a README to hold this information within the
>> U-Boot tree. Also add the standard developer keys to simplify the
>> instructions, since they are small.
>>
>> For now this only supports nyan-big.
>>
>> Signed-off-by: Simon Glass 
>> ---
>>
>>  doc/README.chromium  | 222 
>> +++
>>  doc/chromium/devkeys/kernel.keyblock | Bin 0 -> 1208 bytes
>>  doc/chromium/devkeys/kernel_data_key.vbprivk | Bin 0 -> 1199 bytes
>>  3 files changed, 222 insertions(+)
>>  create mode 100644 doc/README.chromium
>>  create mode 100644 doc/chromium/devkeys/kernel.keyblock
>>  create mode 100644 doc/chromium/devkeys/kernel_data_key.vbprivk
>>
>> diff --git a/doc/README.chromium b/doc/README.chromium
>> new file mode 100644
>> index 00..1dd111c65d
>> --- /dev/null
>> +++ b/doc/README.chromium
>> @@ -0,0 +1,222 @@
>> +Running U-Boot from coreboot on Chromebooks
>> +===
>> +
>> +U-Boot can be used as a secondary boot loader in a few situations such as 
>> from
>> +UEFI and coreboot (see README.x86). Recent Chromebooks use coreboot even on
>> +ARM platforms to start up the machine.
>> +
>> +This document aims to provide a guide to booting U-Boot on a Chromebook. It
>> +is only a starting point, and there are many guides on the interwebs. But
>> +placing this information in the U-Boot tree should make it easier to find 
>> for
>> +those who use U-Boot habitually.
>> +
>> +Most of these platforms are supported by U-Boot natively, but it is risky to
>> +replace the ROM unless you have a servo board and cable to restore it with.
>> +
>> +
>> +For all of these the standard U-Boot build instructions apply. For example 
>> on
>> +ARM:
>> +
>> +   sudo apt install gcc-arm-linux-gnueabi
>> +   mkdir b
>> +   make O=b/nyan_big CROSS_COMPILE=arm-linux-gnueabi- nyan-big_defconfig all
>> +
>> +You can obtain the vbutil_kernel utility here:
>> +
>> +   https://drive.google.com/open?id=0B7WYZbZ9zd-3dHlVVXo4VXE2T0U
>> +
>> +
>> +Snow (Samsung ARM Chromebook)
>> +-
>> +
>> +See here:
>> +
>> +https://www.chromium.org/chromium-os/firmware-porting-guide/using-nv-u-boot-on-the-samsung-arm-chromebook
>> +
>> +
>> +Nyan-big
>> +
>> +
>> +Compiled based on information here:
>> +https://lists.denx.de/pipermail/u-boot/2015-March/209530.html
>> +https://git.collabora.com/cgit/user/tomeu/u-boot.git/commit/?h=nyan-big
>> +https://lists.denx.de/pipermail/u-boot/2017-May/289491.html
>> +https://github.com/chromeos-nvidia-androidtv/gnu-linux-on-acer-chromebook-13#copy-data-to-the-sd-card
>> +
>> +1. Patch U-Boot
>> +
>> +Open include/configs/tegra124-common.h
>> +
>> +Change:
>> +
>> +#define CONFIG_SYS_TEXT_BASE   0x8011
>> +
>> +to:
>> +
>> +#define CONFIG_SYS_TEXT_BASE   0x81000100
>
> One query on this one, is it possible to define or override that in
> configs/nyan-big_defconfig rather than in the include file. This would
> be useful from a distro PoV where we build numerous u-boot binaries
> from a single source tree.

Yes I think so. I will have a think about it.

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


Re: [U-Boot] [PATCH v4 1/5] usb: host: xhci-dwc3: Convert driver to DM

2017-05-31 Thread Simon Glass
On 29 May 2017 at 01:57,   wrote:
> From: Patrice Chotard 
>
> Add Driver Model support with use of generic DT
> compatible string "snps,dwc3"
>
> Signed-off-by: Patrice Chotard 
> ---
> v4: _ none
> v3: _ none
> v2: _ use dev_get_addr() and removed useless piece of code
>
>  drivers/usb/host/xhci-dwc3.c | 50 
> 
>  1 file changed, 50 insertions(+)
>

Reviewed-by: Simon Glass 
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v2 27/28] rockchip: jerry: Disable CONFIG_CONSOLE_SCROLL_LINES

2017-05-31 Thread Simon Glass
The display on jerry is so fast that this option is not needed. Drop it so
that the display scrolls more smoothly.

Signed-off-by: Simon Glass 
---

Changes in v2: None

 configs/chromebook_jerry_defconfig | 1 -
 1 file changed, 1 deletion(-)

diff --git a/configs/chromebook_jerry_defconfig 
b/configs/chromebook_jerry_defconfig
index bb880585e1..63de674241 100644
--- a/configs/chromebook_jerry_defconfig
+++ b/configs/chromebook_jerry_defconfig
@@ -75,7 +75,6 @@ CONFIG_DISPLAY=y
 CONFIG_VIDEO_ROCKCHIP=y
 CONFIG_DISPLAY_ROCKCHIP_EDP=y
 CONFIG_DISPLAY_ROCKCHIP_HDMI=y
-CONFIG_CONSOLE_SCROLL_LINES=10
 CONFIG_USE_TINY_PRINTF=y
 CONFIG_CMD_DHRYSTONE=y
 CONFIG_ERRNO_STR=y
-- 
2.13.0.219.gdb65acc882-goog

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


[U-Boot] [PATCH v2 10/28] tegra: spi: Wait a little after setting the clocks

2017-05-31 Thread Simon Glass
For devices that need a delay between SPI transactions we seem to need an
additional delay before the first one if the CPU is running at full speed.
Add this, under control of the existing setting. At present it will only
be enabled with the Chrome OS EC.

Signed-off-by: Simon Glass 
---

Changes in v2: None

 drivers/spi/tegra114_spi.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/spi/tegra114_spi.c b/drivers/spi/tegra114_spi.c
index 013bc82380..04b4fce061 100644
--- a/drivers/spi/tegra114_spi.c
+++ b/drivers/spi/tegra114_spi.c
@@ -149,6 +149,7 @@ static int tegra114_spi_probe(struct udevice *bus)
   bus->name, priv->freq, rate);
}
}
+   udelay(plat->deactivate_delay_us);
 
/* Clear stale status here */
setbits_le32(>fifo_status,
-- 
2.13.0.219.gdb65acc882-goog

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


[U-Boot] [PATCH v2 09/28] tegra: dts: Add cros-ec SPI settings

2017-05-31 Thread Simon Glass
At present the interrupt does not work and the SPI bus runs much less
quickly than it should. Add settings to fix this.

Signed-off-by: Simon Glass 
---

Changes in v2: None

 arch/arm/dts/tegra124-nyan-big-u-boot.dtsi | 9 +
 1 file changed, 9 insertions(+)

diff --git a/arch/arm/dts/tegra124-nyan-big-u-boot.dtsi 
b/arch/arm/dts/tegra124-nyan-big-u-boot.dtsi
index fff1d78169..65c3851aff 100644
--- a/arch/arm/dts/tegra124-nyan-big-u-boot.dtsi
+++ b/arch/arm/dts/tegra124-nyan-big-u-boot.dtsi
@@ -12,4 +12,13 @@
u-boot,dm-pre-reloc;
};
};
+
+   spi@7000d400 {
+   spi-deactivate-delay = <200>;
+   spi-max-frequency = <300>;
+
+   cros_ec: cros-ec@0 {
+   ec-interrupt = < TEGRA_GPIO(C, 7) GPIO_ACTIVE_LOW>;
+   };
+   };
 };
-- 
2.13.0.219.gdb65acc882-goog

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


[U-Boot] [PATCH v2 04/28] arm: Rename HCTR to HTCR

2017-05-31 Thread Simon Glass
This appears to be a typo. Fix it.

Signed-off-by: Simon Glass 
---

Changes in v2: None

 arch/arm/lib/cache-cp15.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/lib/cache-cp15.c b/arch/arm/lib/cache-cp15.c
index e9bbcf5122..0f7020a315 100644
--- a/arch/arm/lib/cache-cp15.c
+++ b/arch/arm/lib/cache-cp15.c
@@ -147,7 +147,7 @@ static inline void mmu_setup(void)
 #endif
 
if (is_hyp()) {
-   /* Set HCTR to enable LPAE */
+   /* Set HTCR to enable LPAE */
asm volatile("mcr p15, 4, %0, c2, c0, 2"
: : "r" (reg) : "memory");
/* Set HTTBR0 */
-- 
2.13.0.219.gdb65acc882-goog

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


[U-Boot] Add Ethernet Support for Banana Pi M64

2017-05-31 Thread Duncan Hare
BPI-M64 is a 64-bit quad-core mini single board computer
using the Allwinner A64 SOC.

BPI-M64 features
- 1.2 Ghz Quad-Core ARM Cortex A53
- 2GB DDR3 SDRAM with 733MHz
- MicroSD/eMMC(8GB)
- 10/100/1000Mbps ethernet (Realtek RTL8211E/D)
- Wifi + BT
- IR receiver
- Audio In/Out
- Video In/Out
- 5V 2A DC power-supply Duncan Hare

714 931 7952
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] Add ethernet support to Banana-Pi M2U

2017-05-31 Thread Duncan Hare
Banana Pi BPI-M2 Ultra is a quad-core mini single board computer built with 
Allwinner R40 SoC. It features 2GB of RAM and 8GB eMMC. Duncan Hare

714 931 7952
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [RFC PATCH 5/5] rockchip: mkimage: use spl_boot0 for all Rockchip SoCs

2017-05-31 Thread Andy Yan
Hi Philipp:

2017-05-31 18:58 GMT+08:00 Dr. Philipp Tomsich <
philipp.toms...@theobroma-systems.com>:

> Now that there are no remaining cases where (spl_boot0 == false), we can
> drop the spl_boot0 field from struct spl_info and also remove the if-check
> (leaving only the code-path for true in place).
>
>

  I think we still have one case: use mkimage to pack ddr.bin  from
rockchip as spl.bin.



> There should be no need to keep the legacy code-path around, as GIT will
> always remember them anyway.
>
> Regards,
> Philipp.
>
> > On 31 May 2017, at 12:50, Kever Yang  wrote:
> >
> > Enable the spl_boot0 in SPL and use the pre-padding TAG memory,
> > the mkimage do not need to pad it but only need to replace the value
> > with correct TAG value.
> >
> > Signed-off-by: Kever Yang 
> > ---
> >
> > tools/rkcommon.c | 8 
> > 1 file changed, 4 insertions(+), 4 deletions(-)
> >
> > diff --git a/tools/rkcommon.c b/tools/rkcommon.c
> > index 836a5a5..b58dfae 100644
> > --- a/tools/rkcommon.c
> > +++ b/tools/rkcommon.c
> > @@ -68,10 +68,10 @@ struct spl_info {
> > };
> >
> > static struct spl_info spl_infos[] = {
> > - { "rk3036", "RK30", 0x1000, false, false },
> > - { "rk3188", "RK31", 0x8000 - 0x800, true, false },
> > - { "rk3288", "RK32", 0x8000, false, false },
> > - { "rk3328", "RK32", 0x8000 - 0x1000, false, false },
> > + { "rk3036", "RK30", 0x1000, false, true },
> > + { "rk3188", "RK31", 0x8000 - 0x800, true, true },
> > + { "rk3288", "RK32", 0x8000, false, true },
> > + { "rk3328", "RK32", 0x8000 - 0x1000, false, true },
> >   { "rk3399", "RK33", 0x2, false, true },
> > };
> >
> > --
> > 1.9.1
> >
>
> ___
> U-Boot mailing list
> U-Boot@lists.denx.de
> https://lists.denx.de/listinfo/u-boot
>
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH] fdt: Report libfdt error to stderr

2017-05-31 Thread Simon Glass
This error needs to go to stderr otherwise it will not be reported by
buildman. Fix it.

Signed-off-by: Simon Glass 
---

 Makefile | 13 +++--
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/Makefile b/Makefile
index 89e0451a49..c13937c3a8 100644
--- a/Makefile
+++ b/Makefile
@@ -1357,12 +1357,13 @@ $(timestamp_h): $(srctree)/Makefile FORCE
 
 checkbinman: tools
@if ! ( echo 'import libfdt' | ( PYTHONPATH=tools python )); then \
-   echo '*** binman needs the Python libfdt library. Either '; \
-   echo '*** install it on your system, or try:'; \
-   echo '***'; \
-   echo '*** sudo apt-get install swig libpython-dev'; \
-   echo '***'; \
-   echo '*** to have U-Boot build its own version.'; \
+   echo >&2; \
+   echo >&2 '*** binman needs the Python libfdt library.'; \
+   echo >&2 '*** Either install it on your system, or try:'; \
+   echo >&2 '***'; \
+   echo >&2 '*** sudo apt-get install swig libpython-dev'; \
+   echo >&2 '***'; \
+   echo >&2 '*** to have U-Boot build its own version.'; \
false; \
fi
 
-- 
2.13.0.219.gdb65acc882-goog

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


[U-Boot] Uboot send pull request

2017-05-31 Thread uboot
 Hi Tom,

 Please pull the following patch from u-boot-nds32 into your tree.
 Thanks!

The following changes since commit ccbbada0a59fead35495409d0c2c7bcb22a40278:

  Merge branch 'master' of git://git.denx.de/u-boot-mmc (2017-05-30 14:07:23 
-0400)

are available in the git repository at:


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

for you to fetch changes up to 4099090fd0ed9c03d6b90c1382921e7184946878:

  nds32: board: Support ftsdc010 DM. (2017-06-01 09:11:19 +0800)


rick (3):
  nds32: mmc: Support ftsdc010 DM.
  nds32: dts: Support ftsdc010 DM.
  nds32: board: Support ftsdc010 DM.

 arch/nds32/dts/ae3xx.dts|8 ++
 arch/nds32/dts/ag101p.dts   |8 ++
 board/AndesTech/adp-ae3xx/adp-ae3xx.c   |4 +-
 board/AndesTech/adp-ag101p/adp-ag101p.c |7 +-
 configs/adp-ae3xx_defconfig |5 ++
 configs/adp-ag101p_defconfig|5 ++
 drivers/mmc/Kconfig |   12 +++
 drivers/mmc/Makefile|1 +
 drivers/mmc/ftsdc010_mci.c  |  140 ---
 drivers/mmc/ftsdc010_mci.h  |   54 
 drivers/mmc/nds32_mmc.c |  139 ++
 include/configs/adp-ae3xx.h |1 -
 include/configs/adp-ag101p.h|1 -
 13 files changed, 344 insertions(+), 41 deletions(-)
 create mode 100644 drivers/mmc/ftsdc010_mci.h
 create mode 100644 drivers/mmc/nds32_mmc.c
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v4 02/11] reset: add reset_count()

2017-05-31 Thread Simon Glass
Hi Patrice,

On 24 May 2017 at 07:01,   wrote:
> From: Patrice Chotard 
>
> Add reset_count() method to be able to get the number
> of resets contained into a resets property. This will allow
> to allocate the right amount of memory in order to keep resets
> reference. These resets reference can be used later on error path
> or in .remove callback to release these resets.
>
> Signed-off-by: Patrice Chotard 
> ---
>
> v4: _ add reset_count() method
>
>  drivers/reset/reset-uclass.c | 14 ++
>  include/reset.h  | 11 +++
>  2 files changed, 25 insertions(+)
>
> diff --git a/drivers/reset/reset-uclass.c b/drivers/reset/reset-uclass.c
> index 916f210..ebdeee5 100644
> --- a/drivers/reset/reset-uclass.c
> +++ b/drivers/reset/reset-uclass.c
> @@ -98,6 +98,20 @@ int reset_get_by_name(struct udevice *dev, const char 
> *name,
> return reset_get_by_index(dev, index, reset_ctl);
>  }
>
> +int reset_count(struct udevice *dev)
> +{
> +   int count;
> +   struct fdtdec_phandle_args args;
> +
> +   for (count = 0; ; count++) {
> +   if (fdtdec_parse_phandle_with_args(gd->fdt_blob,
> +  dev_of_offset(dev),
> +  "resets", "#reset-cells", 
> 0,
> +  count, ))

As I'm trying to get livetree support landed in U-Boot could you
please rebase this on u-boot-dm/master? There is a new
dev_read_phandle...() function.

> +   return count;
> +   }
> +}
> +
>  int reset_request(struct reset_ctl *reset_ctl)
>  {
> struct reset_ops *ops = reset_dev_ops(reset_ctl->dev);
> diff --git a/include/reset.h b/include/reset.h
> index 4f2e35f..e8e68b6 100644
> --- a/include/reset.h
> +++ b/include/reset.h
> @@ -100,6 +100,17 @@ int reset_get_by_name(struct udevice *dev, const char 
> *name,
>   struct reset_ctl *reset_ctl);
>
>  /**
> + * reset_count - Get reset count contained in the "resets" property.
> + *
> + * This returns the count of reset found into the "resets" property. This
> + * allows to allocate the right amount of memory to keep reset reference.
> + *
> + * @dev:   The client device.
> + * @return number of resets found.
> + */
> +int reset_count(struct udevice *dev);
> +
> +/**
>   * reset_request - Request a reset signal.
>   *
>   * @reset_ctl: A reset control struct.
> --
> 1.9.1
>

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


  1   2   3   >