Re: [U-Boot] [PATCH] i2c: muxes: pca954x: Add support for GPIO reset line

2017-09-08 Thread Moritz Fischer
Hi Simon,

On Fri, Sep 8, 2017 at 9:55 PM, Simon Glass  wrote:
> On 5 September 2017 at 12:24, Moritz Fischer  wrote:
>> This commit adds support for GPIO reset lines matching the
>> common linux "reset-gpios" devicetree binding.
>>
>> Signed-off-by: Moritz Fischer 
>> Cc: Heiko Schocher 
>> Cc: Stefan Roese 
>> Cc: Marek Behún 
>> Cc: Simon Glass 
>> Cc: Michal Simek 
>>
>> ---
>>  drivers/i2c/muxes/pca954x.c | 44 
>> +++-
>>  1 file changed, 43 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/i2c/muxes/pca954x.c b/drivers/i2c/muxes/pca954x.c
>> index 383f72f552..dd28ff057b 100644
>> --- a/drivers/i2c/muxes/pca954x.c
>> +++ b/drivers/i2c/muxes/pca954x.c
>> @@ -1,5 +1,6 @@
>>  /*
>>   * Copyright (C) 2015 - 2016 Xilinx, Inc.
>> + * Copyright (C) 2017 National Instruments Corp
>>   * Written by Michal Simek
>>   *
>>   * SPDX-License-Identifier:GPL-2.0+
>> @@ -9,7 +10,10 @@
>>  #include 
>>  #include 
>>  #include 
>> -#include 
>> +
>> +#if CONFIG_DM_GPIO
>> +# include 
>> +#endif /* CONFIG_DM_GPIO */
>
> Can we drop the #ifdef?

Yeah, will do.
>
>>
>>  DECLARE_GLOBAL_DATA_PTR;
>>
>> @@ -30,6 +34,9 @@ struct chip_desc {
>>  struct pca954x_priv {
>> u32 addr; /* I2C mux address */
>> u32 width; /* I2C mux width - number of busses */
>> +#ifdef CONFIG_DM_GPIO
>> +   struct gpio_desc gpio_mux_reset;
>> +#endif /* CONFIG_DM_GPIO */
>>  };
>>
>>  static const struct chip_desc chips[] = {
>> @@ -105,10 +112,45 @@ static int pca954x_ofdata_to_platdata(struct udevice 
>> *dev)
>> return 0;
>>  }
>>
>> +static int pca954x_probe(struct udevice *dev)
>> +{
>> +#ifdef CONFIG_DM_GPIO
>
> Can we use if (IS_ENABLED(CONFIG_DM_GPIO)) ?

I suppose. I was wondering. Is this in general preferable?
>
>> +   struct pca954x_priv *priv = dev_get_priv(dev);
>> +   int err;
>> +
>> +   err = gpio_request_by_name(dev, "reset-gpios", 0,
>> +   &priv->gpio_mux_reset, GPIOD_IS_OUT);
>> +
>> +   /* it's optional so only bail if we get a real error */
>> +   if (err && (err != -ENOENT))
>> +   return err;
>> +
>> +   /* dm will take care of polarity */
>> +   if (dm_gpio_is_valid(&priv->gpio_mux_reset))
>> +   dm_gpio_set_value(&priv->gpio_mux_reset, 0);
>> +
>> +#endif /* CONFIG_DM_GPIO */
>> +   return 0;
>> +}
>> +
>> +static int pca954x_remove(struct udevice *dev)
>> +{
>> +#ifdef CONFIG_DM_GPIO
>> +   struct pca954x_priv *priv = dev_get_priv(dev);
>> +
>> +   if (dm_gpio_is_valid(&priv->gpio_mux_reset))
>> +   dm_gpio_free(dev, &priv->gpio_mux_reset);
>> +
>> +#endif /* CONFIG_DM_GPIO */
>> +   return 0;
>> +}
>> +
>>  U_BOOT_DRIVER(pca954x) = {
>> .name = "pca954x",
>> .id = UCLASS_I2C_MUX,
>> .of_match = pca954x_ids,
>> +   .probe = pca954x_probe,
>> +   .remove = pca954x_remove,
>> .ops = &pca954x_ops,
>> .ofdata_to_platdata = pca954x_ofdata_to_platdata,
>> .priv_auto_alloc_size = sizeof(struct pca954x_priv),
>> --
>> 2.14.1
>>

Thanks for the review,

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


Re: [U-Boot] [PATCH 3/3] rockchip: evb-rv1108: add usb init function for dwc2 gadget

2017-09-08 Thread Simon Glass
Hi,

On 14 August 2017 at 04:05, wlf  wrote:
> Dear Simon,
>
>
> 在 2017年08月14日 05:35, Simon Glass 写道:
>>
>> On 8 August 2017 at 21:36, William Wu  wrote:
>>>
>>> This patch implements board_usb_init() for dwc2 gadget, it
>>> generally called from do_fastboot to do dwc2 udc probe and
>>> support fastboot over USB.
>>>
>>> Signed-off-by: William Wu 
>>> ---
>>>   board/rockchip/evb_rv1108/evb_rv1108.c | 47
>>> ++
>>>   1 file changed, 47 insertions(+)
>>>
>>> diff --git a/board/rockchip/evb_rv1108/evb_rv1108.c
>>> b/board/rockchip/evb_rv1108/evb_rv1108.c
>>> index fe37eac..8ca5ee6 100644
>>> --- a/board/rockchip/evb_rv1108/evb_rv1108.c
>>> +++ b/board/rockchip/evb_rv1108/evb_rv1108.c
>>> @@ -50,3 +50,50 @@ int dram_init_banksize(void)
>>>
>>>  return 0;
>>>   }
>>> +
>>> +#if defined(CONFIG_USB_GADGET) && defined(CONFIG_USB_GADGET_DWC2_OTG)
>>> +#include 
>>> +#include 
>>> +
>>> +static struct dwc2_plat_otg_data rv1108_otg_data = {
>>> +   .rx_fifo_sz = 512,
>>> +   .np_tx_fifo_sz  = 16,
>>> +   .tx_fifo_sz = 128,
>>> +};
>>> +
>>> +int board_usb_init(int index, enum usb_init_type init)
>>> +{
>>> +   int node;
>>> +   const char *mode;
>>> +   bool matched = false;
>>> +   const void *blob = gd->fdt_blob;
>>> +
>>> +   /* find the usb_otg node */
>>> +   node = fdt_node_offset_by_compatible(blob, -1,
>>> +   "rockchip,rv1108-usb");
>>> +
>>> +   while (node > 0) {
>>> +   mode = fdt_getprop(blob, node, "dr_mode", NULL);
>>> +   if (mode && strcmp(mode, "otg") == 0) {
>>> +   matched = true;
>>> +   break;
>>> +   }
>>> +
>>> +   node = fdt_node_offset_by_compatible(blob, node,
>>> +   "rockchip,rv1108-usb");
>>> +   }
>>> +   if (!matched) {
>>> +   debug("Not found usb_otg device\n");
>>> +   return -ENODEV;
>>> +   }
>>> +
>>> +   rv1108_otg_data.regs_otg = fdtdec_get_addr(blob, node, "reg");
>>> +
>>> +   return dwc2_udc_probe(&rv1108_otg_data);
>>
>> These USB init things have been bothering me for a while. Do you think
>> this could be changed into a driver that you could probe with
>> device_probe()? Then much of the code in here would not be needed and
>> it might be easier to tidy it up when we have proper driver-model
>> support for USB device mode.
>
> Yes,  on rockchip platforms, it did most of the same USB init things in
> different board special drivers.
> I think may be we can try to optimize the code in two different ways.
>
> Method1.
> 1. Move the USB init things from board_usb_init(), just simply call
> dwc2_udc_probe().
> 2. Create a new USB init  function in drivers/usb/gadget/dwc2_udc_otg.c,
>  and call it in dwc2_udc_probe().
> 3. Use fdt (Flat Device Tree manipulation )  to parse the dts, and get the
> regs_phy, regs_otg and so on.
>
> Method2.
> Just like your  suggestion, use driver-model method to probe with
> device_probe,
> actually, I don't know much about the driver-model, as far as I know, we may
> need
> to do the following work:
> 1. Create a new uclass id for usb udc, and declare a new uclass_driver with
> UCLASS_DRIVER,
> and also need to create a  new U-boot driver for dwc2 controller with
> U_BOOT_DRIVER.
> 2. How to call device_probe()? Maybe it's better to create a new driver
> (like drivers/usb/host/usb-uclass.c)
> in drivers/usb/gadget to match different usb gadget controllers, and
> wrap the device_probe()
> to a new function (like udc_pre_probe()), and then different udc driver
> can call it,
> e.g.
> dwc2_udc_probe() --> udc_pre_probe() --> device_probe()
>
> In summary, method1 is easily to be done, but method2 is more generic.
>
> I hope I haven't misunderstood your proposal, and hope to get your reply.
> Thank you!

Yes I think method 2 is better.

You will have to call device_probe() as you say. I think what you
suggest is reasonable, since something has to decide that the USB
device mode should be started.

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


Re: [U-Boot] [PATCH v3 1/2] dm: core: add clocks node scan

2017-09-08 Thread Simon Glass
On 4 September 2017 at 06:55,   wrote:
> From: Patrice Chotard 
>
> Currently, all fixed-clock declared in "clocks" node in device tree
> can be binded by clk_fixed_rate.c driver only if each of them have
> the "simple-bus" compatible string.
> This constraint has been invoked here [1].
>
> This patch offers a solution to avoid adding "simple-bus" compatible
> string to nodes that are not busses.
>
> [1] https://patchwork.ozlabs.org/patch/558837/
>
> Signed-off-by: Patrice Chotard 
> ---
>
> v3: _ rename dm_extended_scan_dt() to dm_extended_scan_fdt() to insure
>   function naming consistency
> _ update dm_extended_scan_fdt() description
>
>  drivers/core/root.c | 34 --
>  include/dm/root.h   | 14 ++
>  2 files changed, 46 insertions(+), 2 deletions(-)

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


Re: [U-Boot] [PATCH v3 14/14] test: overlay: Add unit test for stacked overlay

2017-09-08 Thread Simon Glass
On 4 September 2017 at 14:12, Pantelis Antoniou
 wrote:
> Verify that stacked overlays work.
>
> Signed-off-by: Pantelis Antoniou 
> ---
>  test/overlay/Makefile |  1 +
>  test/overlay/cmd_ut_overlay.c | 34 
> ++-
>  test/overlay/test-fdt-overlay-stacked.dts | 21 +++
>  3 files changed, 55 insertions(+), 1 deletion(-)
>  create mode 100644 test/overlay/test-fdt-overlay-stacked.dts

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


Re: [U-Boot] [PATCH 1/3] efi_loader: rename __efi_hello_world_*

2017-09-08 Thread Simon Glass
On 4 September 2017 at 19:19, Heinrich Schuchardt  wrote:
> In scripts/Makefile.lib we build section including helloworld.efi.
> This allows to load the EFI binary with command 'bootefi hello'.
>
> scripts/Makefile.lib contains explicit references to strings
> containing helloworld and hello_world. This makes it impossible
> to generalize the coding to accomodate additional built in
> EFI binaries.
>
> Let us rename the variables __efi_hello_world_* to
> __efi_helloworld_*.
>
> Signed-off-by: Heinrich Schuchardt 
> ---
>  cmd/bootefi.c  | 4 ++--
>  include/asm-generic/sections.h | 4 ++--
>  scripts/Makefile.lib   | 8 
>  3 files changed, 8 insertions(+), 8 deletions(-)
>

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


Re: [U-Boot] [PATCH v3 11/14] dtbo: make dtbos special

2017-09-08 Thread Simon Glass
On 4 September 2017 at 14:12, Pantelis Antoniou
 wrote:
> Special rule for dtbo generation
>
> Signed-off-by: Pantelis Antoniou 
> ---
>  scripts/Makefile.lib | 17 +
>  1 file changed, 17 insertions(+)
>

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


Re: [U-Boot] [PATCH v3 07/14] fit: Introduce methods for applying overlays on fit-load

2017-09-08 Thread Simon Glass
On 4 September 2017 at 14:12, Pantelis Antoniou
 wrote:
> Introduce an overlay based method for constructing a base DT blob
> to pass to the kernel.
>
> It is based on a specific method now to get the FDT from a FIT image
> named boot_get_fdt_fit().
>
> Signed-off-by: Pantelis Antoniou 
> ---
>  common/image-fdt.c |   7 +--
>  common/image-fit.c | 181 
> +++--
>  include/image.h|  25 
>  3 files changed, 205 insertions(+), 8 deletions(-)

Acked-by: Simon Glass 

I wonder if you can use if (IS_ENABLED(CONFIG_OF_LIBFDT_OVERLAY))
instead of #if ?
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 3/3] efi_loader: usage of always in Makefile

2017-09-08 Thread Simon Glass
On 4 September 2017 at 19:19, Heinrich Schuchardt  wrote:
> Variable always should only be appended but not overwritten by
> lib/efi_loader/Makefile.
>
> Remove variable efiprogs which is not otherwise used.
>
> Signed-off-by: Heinrich Schuchardt 
> ---
>  lib/efi_loader/Makefile | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)

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


Re: [U-Boot] USB Ethernet with device model

2017-09-08 Thread Simon Glass
+Bin

Hi Maxiime,

On 5 September 2017 at 14:32, Maxime Ripard
 wrote:
> Hi,
>
> I've been working with USB-Ethernet gadget for quite some time on the
> Allwinner SoCs, especially because most Allwinner boards lack an
> ethernet controller.
>
> The thing is, it wasn't really upstreamable all this time since we've
> had also some boards that had a controller with DM_ETH. And usb_ether
> didn't have DM_ETH support until recently.
>
> So I gave it a shot, and encountered a few weird things that prevented
> it from working (and still do):
>
> 1) I converted our musb glue to support the DM even in the peripheral
>mode. Here is the code: http://code.bulix.org/m846ni-194479
>
>It almost works, except that usb_scan_bus in usb-uclass.c for some
>reason unknown to me tries to scan the peripheral device, and
>fails. Skipping that scan makes fastboot works, so I guess the
>peripheral is working. Is there any particular reason that the
>DM_USB code tries to scan even peripheral devices ?

Perhaps because it might be a hub? This is for companion support which
Bin may know more about.

>
> 2) I can't manage to get usb_ether to probe after that, using the
>DM. It seems that we need to call usb_ether_init, and that it looks
>for UCLASS_USB_DEV_GENERIC devices and binds the usb_ether gadget
>to it.
>
>However, every board or arch hooks I tried seems to be much earlier
>than the USB controller, leading to the binding failing since we
>don't have a controller to bind to yet.
>
>Adding that code right after the USB controller initialisation in
>the musb probe solves that issue, but for some other reason, it
>looks for a device of the USB_DEV_GENERIC uclass, while the uclass
>for the USB controllers seems to be USB. Actually, I don't seem to
>find any user of the USB_DEV_GENERIC uclass but the usb_ether
>driver, so I'm not really sure how it's supposed to work either...

USB_DEV_GENERIC is a USB device (i.e. something ON the bus) which is
not identified (i.e. not UCLASS_ETH for example). Anything that has a
driver will be picked up by usb_find_and_bind_driver(). Note that the
generic device is a fallback when the search fails.

>
> Is there some user of this in U-Boot right now? the only call there is
> to usb_ether_init seems to be for the am33xx SoCs, whose usb glue
> don't register a peripheral controller (yet), so I don't really know
> how that can work either.

Well once the UCLASS_ETH device is found on USB, it will appear as a
normal Ethernet device and operate as any other such device.

Thanks for looking at this. It will require some refactoring since the
code is made for host mode at present.

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


Re: [U-Boot] [PATCH v3 09/14] doc: Document how to apply fdt overlays

2017-09-08 Thread Simon Glass
On 4 September 2017 at 14:12, Pantelis Antoniou
 wrote:
> We have the capability to apply overlays on the command line but
> we didn't have a document explaining how.
>
> Signed-off-by: Pantelis Antoniou 
> ---
>  doc/README.fdt-overlays | 37 +
>  1 file changed, 37 insertions(+)
>  create mode 100644 doc/README.fdt-overlays
>

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


Re: [U-Boot] [PATCH v3 05/14] fit: Allow multiple images per property

2017-09-08 Thread Simon Glass
On 4 September 2017 at 14:12, Pantelis Antoniou
 wrote:
> As part of the fdt overlay support which need it, allow
> a list of configurations per property.
>
> Signed-off-by: Pantelis Antoniou 
> ---
>  common/image-fit.c | 18 +++---
>  1 file changed, 15 insertions(+), 3 deletions(-)

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


Re: [U-Boot] [PATCH v3 01/14] Introduce fdt_setprop_placeholder() method

2017-09-08 Thread Simon Glass
On 4 September 2017 at 14:12, Pantelis Antoniou
 wrote:
> In some cases you need to add a property but the contents of it
> are not known at creation time, merely the extend of it.
>
> This method allows you to create a property of a given size (filled
> with garbage) while a pointer to the property data will be provided.
>
> Signed-off-by: Pantelis Antoniou 
> [dwg: Corrected commit message]
> Signed-off-by: David Gibson 
> ---
>  lib/libfdt/fdt_rw.c | 20 +---
>  lib/libfdt/libfdt.h | 31 +++
>  2 files changed, 48 insertions(+), 3 deletions(-)

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


Re: [U-Boot] [PATCH v2 2/8] fs/fat: introduce new director iterators

2017-09-08 Thread Simon Glass
Hi Rob,

On 5 September 2017 at 03:54, Rob Clark  wrote:
> On Tue, Sep 5, 2017 at 4:56 AM, Simon Glass  wrote:
>> Hi Rob,
>>
>> On 3 September 2017 at 00:37, Rob Clark  wrote:
>>> Untangle directory traversal into a simple iterator, to replace the
>>> existing multi-purpose do_fat_read_at() + get_dentfromdir().
>>>
>>> Signed-off-by: Rob Clark 
>>> ---
>>>  fs/fat/fat.c | 326 
>>> +++
>>>  1 file changed, 326 insertions(+)
>>>
>>> diff --git a/fs/fat/fat.c b/fs/fat/fat.c
>>> index e1c0a15dc7..c72d6ca931 100644
>>> --- a/fs/fat/fat.c
>>> +++ b/fs/fat/fat.c
>>> @@ -1245,6 +1245,332 @@ exit:
>>> return ret;
>>>  }
>>>
>>> +
>>> +/*
>>> + * Directory iterator, to simplify filesystem traversal
>>> + */
>>> +
>>> +typedef struct {
>>
>> Please avoid using a typedef here. It seems like it could just be a struct.
>
> I'm typically not a fan of 'typedef struct' but that seems to be the
> style that fs/fat code was already using, and "when in Rome..."

Sure, but let's move to Venice as it is less dusty.

>
>> Also pleaee add a comment about what the struct is for
>>
>>> +   fsdata*fsdata;
>>> +   unsigned   cursect;
>>> +   dir_entry *dent;
>>> +   intremaining; /* remaining dent's in current cluster */
>>> +   intlast_cluster;
>>> +   intis_root;
>>> +
>>> +   /* current iterator position values: */
>>> +   char   l_name[VFAT_MAXLEN_BYTES];
>>> +   char   s_name[14];
>>> +   char  *name;  /* l_name if there is one, else s_name */
>>> +
>>> +   u8 block[MAX_CLUSTSIZE] __aligned(ARCH_DMA_MINALIGN);
>>
>> Some members are missing comments.
>>
>> Also I'm not too sure how the alignment works here. I don't see you
>> creating one of these objects in this patch, but could you add a
>> comment to the struct about how to create one? Do you use memalign()?
>
> I was just creating them on the stack normally.. expecting the
> compiler to dtrt because of the __aligned() on block[].

Well I think that works. OK.

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


Re: [U-Boot] [PATCH v3 13/14] ut: fix fdt_getprop_u32() change

2017-09-08 Thread Simon Glass
On 4 September 2017 at 14:12, Pantelis Antoniou
 wrote:
> fdt_getprop_u32 is not exported and it's different than what the
> unit test uses. Rename u32 prop access methods to something that's
> unit test specific.
>
> Signed-off-by: Pantelis Antoniou 
> ---
>  test/overlay/cmd_ut_overlay.c | 16 
>  1 file changed, 8 insertions(+), 8 deletions(-)
>

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


Re: [U-Boot] [PATCH v3 08/14] fit: fdt overlays doc

2017-09-08 Thread Simon Glass
On 4 September 2017 at 14:12, Pantelis Antoniou
 wrote:
> Signed-off-by: Pantelis Antoniou 
> ---
>  doc/uImage.FIT/command_syntax_extensions.txt |  12 +-
>  doc/uImage.FIT/overlay-fdt-boot.txt  | 221 
> +++
>  doc/uImage.FIT/source_file_format.txt|   6 +-
>  3 files changed, 236 insertions(+), 3 deletions(-)
>  create mode 100644 doc/uImage.FIT/overlay-fdt-boot.txt
>

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


Re: [U-Boot] [PATCH v3 10/14] doc: overlays: Tweak documentation regarding overlays

2017-09-08 Thread Simon Glass
On 4 September 2017 at 14:12, Pantelis Antoniou
 wrote:
> From: Franklin S Cooper Jr 
>
> Pull some information regarding overlays from commit messages and
> put them directly within the documentation. Also add some information
> regarding required dtc version to properly use overlays.
>
> Signed-off-by: Franklin S Cooper Jr 
> ---
>  doc/README.fdt-overlays | 85 
> +++--
>  doc/uImage.FIT/overlay-fdt-boot.txt |  8 +++-
>  2 files changed, 87 insertions(+), 6 deletions(-)

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


Re: [U-Boot] [PATCH v3 12/14] config: sandbox: Add unit tests

2017-09-08 Thread Simon Glass
On 4 September 2017 at 14:12, Pantelis Antoniou
 wrote:
> Add unit tests for sandbox default config.
>
> Signed-off-by: Pantelis Antoniou 
> ---
>  configs/sandbox_defconfig | 2 ++
>  1 file changed, 2 insertions(+)
>

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


Re: [U-Boot] [PATCH v3 03/14] fdt: Switch to using the verbose overlay application method

2017-09-08 Thread Simon Glass
On 4 September 2017 at 14:12, Pantelis Antoniou
 wrote:
> The verbose overlay application method prints out more helpful
> messages, so switch to it.
>
> Signed-off-by: Pantelis Antoniou 
> ---
>  cmd/fdt.c | 7 +++
>  1 file changed, 3 insertions(+), 4 deletions(-)

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


Re: [U-Boot] [PATCH v3 02/14] fdt: Introduce helper method fdt_overlay_apply_verbose()

2017-09-08 Thread Simon Glass
On 4 September 2017 at 14:12, Pantelis Antoniou
 wrote:
> Introduce fdt_overlay_apply_verbose, a method that applies an
> overlay but in the case of an error produces a helpful message.
>
> In addition if a base tree is found to be missing the __symbols__
> node the message will point out that the probable reason is that
> the base tree was miscompiled without the -@ option.
>
> Signed-off-by: Pantelis Antoniou 
> ---
>  common/fdt_support.c  | 31 +++
>  include/fdt_support.h |  2 ++
>  2 files changed, 33 insertions(+)

Acked-by: Simon Glass 

BTW I'd prefer to have the function comments in the header, but this
file is mixed, so OK.
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v10 05/10] STiH410-B2260: enable USB Host Networking

2017-09-08 Thread Simon Glass
On 5 September 2017 at 03:04,   wrote:
> From: Patrice Chotard 
>
> Enable USB Host Networking support by enabling Ethernet/USB
> adaptors support and by enabling some BOOTP flags
>
> Signed-off-by: Patrice Chotard 
> ---
>
> v10:_ remove obsolete CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS
> v9: _ none
> v8: _ none
> v7: _ none
> v6: _ add reviewed-by Simon Glass
> _ add missing comment in commit message
> v5: _ none
> v4: _ none
> v3: _ none
> v2: _ none
>
>  include/configs/stih410-b2260.h | 15 +++
>  1 file changed, 15 insertions(+)

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


Re: [U-Boot] [PATCH v3 06/14] fit: Do not throw away extra configuration on fit_image_load()

2017-09-08 Thread Simon Glass
Hi,

On 4 September 2017 at 14:12, Pantelis Antoniou
 wrote:
> fit_image_load() threw away the extra configuration parts when
> loading. We need them around for applying extra overlays for
> building the boot fdt.
>
> Signed-off-by: Pantelis Antoniou 
> ---
>  common/image-fit.c | 11 +++
>  1 file changed, 7 insertions(+), 4 deletions(-)

Acked-by: Simon Glass 

>
> diff --git a/common/image-fit.c b/common/image-fit.c
> index 74e5557..e75cb64 100644
> --- a/common/image-fit.c
> +++ b/common/image-fit.c
> @@ -1653,6 +1653,7 @@ int fit_image_load(bootm_headers_t *images, ulong addr,
> int cfg_noffset, noffset;
> const char *fit_uname;
> const char *fit_uname_config;
> +   const char *fit_base_uname_config;
> const void *fit;
> const void *buf;
> size_t size;
> @@ -1668,6 +1669,7 @@ int fit_image_load(bootm_headers_t *images, ulong addr,
> fit = map_sysmem(addr, 0);
> fit_uname = fit_unamep ? *fit_unamep : NULL;
> fit_uname_config = fit_uname_configp ? *fit_uname_configp : NULL;
> +   fit_base_uname_config = NULL;
> prop_name = fit_get_image_type_property(image_type);
> printf("## Loading %s from FIT Image at %08lx ...\n", prop_name, 
> addr);
>
> @@ -1701,11 +1703,11 @@ int fit_image_load(bootm_headers_t *images, ulong 
> addr,
> BOOTSTAGE_SUB_NO_UNIT_NAME);
> return -ENOENT;
> }
> -   fit_uname_config = fdt_get_name(fit, cfg_noffset, NULL);
> -   printf("   Using '%s' configuration\n", fit_uname_config);
> +   fit_base_uname_config = fdt_get_name(fit, cfg_noffset, NULL);
> +   printf("   Using '%s' configuration\n", 
> fit_base_uname_config);
> if (image_type == IH_TYPE_KERNEL) {
> /* Remember (and possibly verify) this config */
> -   images->fit_uname_cfg = fit_uname_config;
> +   images->fit_uname_cfg = fit_base_uname_config;
> if (IMAGE_ENABLE_VERIFY && images->verify) {
> puts("   Verifying Hash Integrity ... ");
> if (fit_config_verify(fit, cfg_noffset)) {
> @@ -1861,7 +1863,8 @@ int fit_image_load(bootm_headers_t *images, ulong addr,
> if (fit_unamep)
> *fit_unamep = (char *)fit_uname;
> if (fit_uname_configp)
> -   *fit_uname_configp = (char *)fit_uname_config;
> +   *fit_uname_configp = (char *)(fit_uname_config ? :
> + fit_base_uname_config);

I just learned something I didn't know about C.

>
> return noffset;
>  }
> --
> 2.1.4
>
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH] i2c: muxes: pca954x: Add support for GPIO reset line

2017-09-08 Thread Simon Glass
On 5 September 2017 at 12:24, Moritz Fischer  wrote:
> This commit adds support for GPIO reset lines matching the
> common linux "reset-gpios" devicetree binding.
>
> Signed-off-by: Moritz Fischer 
> Cc: Heiko Schocher 
> Cc: Stefan Roese 
> Cc: Marek Behún 
> Cc: Simon Glass 
> Cc: Michal Simek 
>
> ---
>  drivers/i2c/muxes/pca954x.c | 44 +++-
>  1 file changed, 43 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/i2c/muxes/pca954x.c b/drivers/i2c/muxes/pca954x.c
> index 383f72f552..dd28ff057b 100644
> --- a/drivers/i2c/muxes/pca954x.c
> +++ b/drivers/i2c/muxes/pca954x.c
> @@ -1,5 +1,6 @@
>  /*
>   * Copyright (C) 2015 - 2016 Xilinx, Inc.
> + * Copyright (C) 2017 National Instruments Corp
>   * Written by Michal Simek
>   *
>   * SPDX-License-Identifier:GPL-2.0+
> @@ -9,7 +10,10 @@
>  #include 
>  #include 
>  #include 
> -#include 
> +
> +#if CONFIG_DM_GPIO
> +# include 
> +#endif /* CONFIG_DM_GPIO */

Can we drop the #ifdef?

>
>  DECLARE_GLOBAL_DATA_PTR;
>
> @@ -30,6 +34,9 @@ struct chip_desc {
>  struct pca954x_priv {
> u32 addr; /* I2C mux address */
> u32 width; /* I2C mux width - number of busses */
> +#ifdef CONFIG_DM_GPIO
> +   struct gpio_desc gpio_mux_reset;
> +#endif /* CONFIG_DM_GPIO */
>  };
>
>  static const struct chip_desc chips[] = {
> @@ -105,10 +112,45 @@ static int pca954x_ofdata_to_platdata(struct udevice 
> *dev)
> return 0;
>  }
>
> +static int pca954x_probe(struct udevice *dev)
> +{
> +#ifdef CONFIG_DM_GPIO

Can we use if (IS_ENABLED(CONFIG_DM_GPIO)) ?

> +   struct pca954x_priv *priv = dev_get_priv(dev);
> +   int err;
> +
> +   err = gpio_request_by_name(dev, "reset-gpios", 0,
> +   &priv->gpio_mux_reset, GPIOD_IS_OUT);
> +
> +   /* it's optional so only bail if we get a real error */
> +   if (err && (err != -ENOENT))
> +   return err;
> +
> +   /* dm will take care of polarity */
> +   if (dm_gpio_is_valid(&priv->gpio_mux_reset))
> +   dm_gpio_set_value(&priv->gpio_mux_reset, 0);
> +
> +#endif /* CONFIG_DM_GPIO */
> +   return 0;
> +}
> +
> +static int pca954x_remove(struct udevice *dev)
> +{
> +#ifdef CONFIG_DM_GPIO
> +   struct pca954x_priv *priv = dev_get_priv(dev);
> +
> +   if (dm_gpio_is_valid(&priv->gpio_mux_reset))
> +   dm_gpio_free(dev, &priv->gpio_mux_reset);
> +
> +#endif /* CONFIG_DM_GPIO */
> +   return 0;
> +}
> +
>  U_BOOT_DRIVER(pca954x) = {
> .name = "pca954x",
> .id = UCLASS_I2C_MUX,
> .of_match = pca954x_ids,
> +   .probe = pca954x_probe,
> +   .remove = pca954x_remove,
> .ops = &pca954x_ops,
> .ofdata_to_platdata = pca954x_ofdata_to_platdata,
> .priv_auto_alloc_size = sizeof(struct pca954x_priv),
> --
> 2.14.1
>
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [U-Boot,v2,2/5] rockchip: rk322x: add sdram driver

2017-09-08 Thread Simon Glass
Hi Philipp,

On 5 September 2017 at 03:51, Philipp Tomsich
 wrote:
> + Simon
>
> Kever,
>
> thanks for moving this to the new location, but it doesn't address my
> concerns that we are duplicating large amounts of code from other SDRAM
> drivers (and that there's large amounts of #define statements where we
> usually use enum definitions for Rockchip).
>
> You may be able to convince me to apply this to the 'next' branch as-is, if
> we get a plan in place to clean up the DRAM controller code over during the
> two merge windows remaining in this year.
>
> @Simon: I know the amount of code-duplication across the DRAM controller
> drivers is a touchy subject for you too --- any additional comments or
> guidance?

Well I haven't changed my mind. I think it would be good to make a
start before any more drivers go in.

But I should leave the specifics to you.

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


Re: [U-Boot] [PATCH 2/3] scripts/Makefile.lib: generalize building built in EFI app

2017-09-08 Thread Simon Glass
On 4 September 2017 at 19:19, Heinrich Schuchardt  wrote:
> Replace all occurences of helloworld by generalized forms.
> This allows us to build additional EFI applications that are
> included into the U-Boot binary without loading
> scripts/Makefile.lib with specific filenames.
>
> Signed-off-by: Heinrich Schuchardt 
> ---
>  scripts/Makefile.lib | 28 +++-
>  1 file changed, 15 insertions(+), 13 deletions(-)

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


Re: [U-Boot] [PATCH v3 2/2] dm: test: replace dm_scan_dt() by of dm_extended_scan_fdt() in dm_do_test

2017-09-08 Thread Simon Glass
On 4 September 2017 at 06:55,   wrote:
> From: Patrice Chotard 
>
> This allows to scan the DT including all "clocks" node's sub-nodes
> in which fixed-clock are defined.
> All fixed-clock should be defined inside a clocks node which collect all
> external oscillators. Until now, all clocks sub-nodes can't be binded except
> if the "simple-bus" compatible string is added which is a hack.
>
> Update test.dts by moving clk_fixed node inside clocks.
>
> Signed-off-by: Patrice Chotard 
> Reviewed-by: Simon Glass 
> ---
>
>
>  arch/sandbox/dts/test.dts | 10 ++
>  test/dm/test-main.c   |  2 +-
>  2 files changed, 7 insertions(+), 5 deletions(-)

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


Re: [U-Boot] [PATCH v3 04/14] fdt: Allow stacked overlays phandle references

2017-09-08 Thread Simon Glass
On 4 September 2017 at 14:12, Pantelis Antoniou
 wrote:
> This patch enables an overlay to refer to a previous overlay's
> labels by performing a merge of symbol information at application
> time.
>
> In a nutshell it allows an overlay to refer to a symbol that a previous
> overlay has defined. It requires both the base and all the overlays
> to be compiled with the -@ command line switch so that symbol
> information is included.
>
> base.dts
> 
>
> /dts-v1/;
> / {
> foo: foonode {
> foo-property;
> };
> };
>
> $ dtc -@ -I dts -O dtb -o base.dtb base.dts
>
> bar.dts
> ---
>
> /dts-v1/;
> /plugin/;
> / {
> fragment@1 {
> target = <&foo>;
> __overlay__ {
> overlay-1-property;
> bar: barnode {
> bar-property;
> };
> };
> };
> };
>
> $ dtc -@ -I dts -O dtb -o bar.dtb bar.dts
>
> baz.dts
> ---
>
> /dts-v1/;
> /plugin/;
> / {
> fragment@1 {
> target = <&bar>;
> __overlay__ {
> overlay-2-property;
> baz: baznode {
> baz-property;
> };
> };
> };
> };
>
> $ dtc -@ -I dts -O dtb -o baz.dtb baz.dts
>
> Applying the overlays:
>
> $ fdtoverlay -i base.dtb -o target.dtb bar.dtb baz.dtb
>
> Dumping:
>
> $ fdtdump target.dtb
> / {
> foonode {
> overlay-1-property;
> foo-property;
> linux,phandle = <0x0001>;
> phandle = <0x0001>;
> barnode {
> overlay-2-property;
> phandle = <0x0002>;
> linux,phandle = <0x0002>;
> bar-property;
> baznode {
> phandle = <0x0003>;
> linux,phandle = <0x0003>;
> baz-property;
> };
> };
> };
> __symbols__ {
> baz = "/foonode/barnode/baznode";
> bar = "/foonode/barnode";
> foo = "/foonode";
> };
> };
>
> Signed-off-by: Pantelis Antoniou 
> Signed-off-by: David Gibson 
> ---
>  lib/libfdt/fdt_overlay.c | 228 
> ++-
>  1 file changed, 206 insertions(+), 22 deletions(-)
>

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


Re: [U-Boot] [PATCH v5 1/1] mmc: Add MMC support for stm32h7 Socs

2017-09-08 Thread Simon Glass
On 4 September 2017 at 09:56,   wrote:
> From: Patrice Chotard 
>
> This patch adds SD/MMC support for STM32H7 SoCs.
>
> Here is an extraction of SDMMC main features, embedded in
> STM32H7 SoCs.
> The SD/MMC block include the following:
>  _ Full compliance with MultiMediaCard System Specification
>Version 4.51. Card support for three different databus modes:
>1-bit (default), 4-bit and 8-bit.
>  _ Full compatibility with previous versions of MultiMediaCards
>(backward compatibility).
>  _ Full compliance with SD memory card specifications version 4.1.
>(SDR104 SDMMC_CK speed limited to maximum allowed IO speed,
> SPI mode and UHS-II mode not supported).
>  _ Full compliance with SDIO card specification version 4.0.
>Card support for two different databus modes: 1-bit (default)
>and 4-bit. (SDR104 SDMMC_CK speed limited to maximum allowed IO
>speed, SPI mode and UHS-II mode not supported).
>  _ Data transfer up to 208 Mbyte/s for the 8 bit mode.
>(depending maximum allowed IO speed).
>  _ Data and command output enable signals to control external
>bidirectional drivers.
>
> The current version of the SDMMC supports only one SD/SDIO/MMC card
> at any one time and a stack of MMC Version 4.51 or previous.
>
> Signed-off-by: Christophe Kerello 
> Signed-off-by: Patrice Chotard 
> ---
>
> v5: _ give a more meaningful name to stm32_sdmmc2_start_cmd() last param
> _ use readl_poll_timeout() instead of using while in 
> stm32_sdmmc2_end_cmd()
> v4: _ replace mmc_create() usage by mmc_bind() callback
> _ rename struct stm32_sdmmc2_host to stm32_sdmmc2_priv
> v3: _ use registers offset instead of registers struct description
> _ rename clk_reg_add and pwr_reg_add to respectively clk_reg_msk and 
> pwr_reg_msk
> _ don't exit in error if DT bus-width value is not correct, force it to 1
>   and continue
> v2: _ add .get_cd() callback support
>
>  drivers/mmc/Kconfig|   8 +
>  drivers/mmc/Makefile   |   1 +
>  drivers/mmc/stm32_sdmmc2.c | 608 
> +
>  3 files changed, 617 insertions(+)
>  create mode 100644 drivers/mmc/stm32_sdmmc2.c

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


Re: [U-Boot] [PATCH 2/2] rockchip: rk3368: add the missing target and pinctrl config for sheep board

2017-09-08 Thread Simon Glass
On 4 September 2017 at 06:32, Andy Yan  wrote:
> Add the missing target and pinctrl config for rk3368 sheep board
>
> Signed-off-by: Andy Yan 
> ---
>
>  configs/sheep-rk3368_defconfig | 2 ++
>  1 file changed, 2 insertions(+)

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


Re: [U-Boot] [PATCH v4 2/3] board: sama5d2_xplained: Replace code to set mac address

2017-09-08 Thread Simon Glass
On 1 September 2017 at 02:26, Wenyou Yang  wrote:
> Replace the code to set the ethernet mac address with the code from
> the common folder.
>
> Signed-off-by: Wenyou Yang 
> ---
>
> Changes in v4: None
> Changes in v3: None
> Changes in v2: None
>
>  arch/arm/dts/at91-sama5d2_xplained.dts  |  5 +++
>  board/atmel/sama5d2_xplained/sama5d2_xplained.c | 46 
> +++--
>  configs/sama5d2_xplained_mmc_defconfig  |  1 +
>  configs/sama5d2_xplained_spiflash_defconfig |  1 +
>  include/configs/sama5d2_xplained.h  |  4 ---
>  5 files changed, 11 insertions(+), 46 deletions(-)

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


Re: [U-Boot] [PATCH v4 3/3] board: sama5d4_xplained: Set mac address from eeprom

2017-09-08 Thread Simon Glass
On 1 September 2017 at 02:26, Wenyou Yang  wrote:
> Add the code to set the ethernet mac address from eeprom by using
> the common code from the common folder.
>
> Signed-off-by: Wenyou Yang 
> ---
>
> Changes in v4:
>  - Rebase the latest commit(8b3cec7da) on uboot/master.
>
> Changes in v3:
>  - remove CONFIG_SPL_I2C_SUPPORT=y from the default configuration files.
>  - rebase on [PATCH] misc: Makefile: Add condition on build i2c_eeprom.
> https://lists.denx.de/pipermail/u-boot/2017-August/300783.html
>
> Changes in v2:
>  - Add a new patch to create board/$(VENDOR)/common folder to
>accommodate the common code and put the code to set the ethernet
>mac address from eeprom here.
>  - Use the i2c_eeprom driver to read the mac address, instead of
>the dm i2c API directly.
>
>  arch/arm/dts/at91-sama5d4_xplained.dts  |  5 +
>  board/atmel/sama5d4_xplained/sama5d4_xplained.c | 12 
>  configs/sama5d4_xplained_mmc_defconfig  |  3 +++
>  configs/sama5d4_xplained_nandflash_defconfig|  3 +++
>  configs/sama5d4_xplained_spiflash_defconfig |  3 +++
>  include/configs/sama5d4_xplained.h  |  2 ++

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


Re: [U-Boot] [PATCH v4 1/3] board: atmel: Create board/$(VENDOR)/common folder

2017-09-08 Thread Simon Glass
On 1 September 2017 at 02:26, Wenyou Yang  wrote:
> Create board/$(VENDOR)/common folder to accommodate the common code
> shared by other atmel boards, now put the code to set ethernet mac
> address from eeprom, which uses the i2c eeprom driver.
>
> Signed-off-by: Wenyou Yang 
> ---
>
> Changes in v4:
>  - Follow up the env function renaming.
>
> Changes in v3: None
> Changes in v2: None
>
>  arch/arm/mach-at91/include/mach/at91_common.h |  2 ++
>  board/atmel/common/Makefile   | 11 
>  board/atmel/common/board.c| 12 +
>  board/atmel/common/mac_eeprom.c   | 36 
> +++
>  4 files changed, 61 insertions(+)
>  create mode 100644 board/atmel/common/Makefile
>  create mode 100644 board/atmel/common/board.c
>  create mode 100644 board/atmel/common/mac_eeprom.c

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


Re: [U-Boot] [PATCH 06/13] usb: gadget: usb_ether: Move settings to common

2017-09-08 Thread Łukasz Majewski

On 09/08/2017 07:34 PM, Maxime Ripard wrote:

The usb_ether gadget duplicates the USB settings for the manufacturer,
product ID and vendor ID.

Make sure we use the common option so that we can expect a single VID/PID
couple for a single device.

Signed-off-by: Maxime Ripard 


Reviewed-by: Lukasz Majewski 


---
  configs/sama5d2_ptc_nandflash_defconfig |  1 +
  configs/sama5d2_ptc_spiflash_defconfig  |  1 +
  configs/vinco_defconfig |  1 +
  drivers/usb/gadget/ether.c  | 16 
  include/configs/ma5d4evk.h  |  1 -
  include/configs/sama5d2_ptc.h   |  1 -
  include/configs/vinco.h |  1 -
  scripts/config_whitelist.txt|  1 -
  8 files changed, 11 insertions(+), 12 deletions(-)

diff --git a/configs/sama5d2_ptc_nandflash_defconfig 
b/configs/sama5d2_ptc_nandflash_defconfig
index 6672a5ce11f7..431056a50a8b 100644
--- a/configs/sama5d2_ptc_nandflash_defconfig
+++ b/configs/sama5d2_ptc_nandflash_defconfig
@@ -29,5 +29,6 @@ CONFIG_USB=y
  CONFIG_USB_EHCI_HCD=y
  CONFIG_USB_STORAGE=y
  CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="Atmel SAMA5D2_PTC"
  CONFIG_USB_GADGET_ATMEL_USBA=y
  CONFIG_USB_ETHER=y
diff --git a/configs/sama5d2_ptc_spiflash_defconfig 
b/configs/sama5d2_ptc_spiflash_defconfig
index 9a23a808f1b3..66bb671820a6 100644
--- a/configs/sama5d2_ptc_spiflash_defconfig
+++ b/configs/sama5d2_ptc_spiflash_defconfig
@@ -30,5 +30,6 @@ CONFIG_USB=y
  CONFIG_USB_EHCI_HCD=y
  CONFIG_USB_STORAGE=y
  CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="Atmel SAMA5D2_PTC"
  CONFIG_USB_GADGET_ATMEL_USBA=y
  CONFIG_USB_ETHER=y
diff --git a/configs/vinco_defconfig b/configs/vinco_defconfig
index b0df6b3c7805..8d7f9f99ab81 100644
--- a/configs/vinco_defconfig
+++ b/configs/vinco_defconfig
@@ -33,3 +33,4 @@ CONFIG_USB_STORAGE=y
  CONFIG_USB_GADGET=y
  CONFIG_USB_GADGET_ATMEL_USBA=y
  CONFIG_USB_ETHER=y
+CONFIG_USB_GADGET_MANUFACTURER="L+G VInCo"
diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c
index 2cf5c8d31e25..dbb578258f96 100644
--- a/drivers/usb/gadget/ether.c
+++ b/drivers/usb/gadget/ether.c
@@ -273,8 +273,8 @@ static inline int BITRATE(struct usb_gadget *g)
   * static ushort idProduct;
   */
  
-#if defined(CONFIG_USBNET_MANUFACTURER)

-static char *iManufacturer = CONFIG_USBNET_MANUFACTURER;
+#if defined(CONFIG_USB_GADGET_MANUFACTURER)
+static char *iManufacturer = CONFIG_USB_GADGET_MANUFACTURER;
  #else
  static char *iManufacturer = "U-Boot";
  #endif
@@ -2073,11 +2073,11 @@ static int eth_bind(struct usb_gadget *gadget)
 * to choose the right configuration otherwise.
 */
if (rndis) {
-#if defined(CONFIG_USB_RNDIS_VENDOR_ID) && defined(CONFIG_USB_RNDIS_PRODUCT_ID)
+#if defined(CONFIG_USB_GADGET_VENDOR_NUM) && 
defined(CONFIG_USB_GADGET_PRODUCT_NUM)
device_desc.idVendor =
-   __constant_cpu_to_le16(CONFIG_USB_RNDIS_VENDOR_ID);
+   __constant_cpu_to_le16(CONFIG_USB_GADGET_VENDOR_NUM);
device_desc.idProduct =
-   __constant_cpu_to_le16(CONFIG_USB_RNDIS_PRODUCT_ID);
+   __constant_cpu_to_le16(CONFIG_USB_GADGET_PRODUCT_NUM);
  #else
device_desc.idVendor =
__constant_cpu_to_le16(RNDIS_VENDOR_NUM);
@@ -2092,9 +2092,9 @@ static int eth_bind(struct usb_gadget *gadget)
 * supporting one submode of the "SAFE" variant of MDLM.)
 */
} else {
-#if defined(CONFIG_USB_CDC_VENDOR_ID) && defined(CONFIG_USB_CDC_PRODUCT_ID)
-   device_desc.idVendor = cpu_to_le16(CONFIG_USB_CDC_VENDOR_ID);
-   device_desc.idProduct = cpu_to_le16(CONFIG_USB_CDC_PRODUCT_ID);
+#if defined(CONFIG_USB_GADGET_VENDOR_NUM) && 
defined(CONFIG_USB_GADGET_PRODUCT_NUM)
+   device_desc.idVendor = 
cpu_to_le16(CONFIG_USB_GADGET_VENDOR_NUM);
+   device_desc.idProduct = 
cpu_to_le16(CONFIG_USB_GADGET_PRODUCT_NUM);
  #else
if (!cdc) {
device_desc.idVendor =
diff --git a/include/configs/ma5d4evk.h b/include/configs/ma5d4evk.h
index 6d25d84c6eb6..3aeb7e6ef136 100644
--- a/include/configs/ma5d4evk.h
+++ b/include/configs/ma5d4evk.h
@@ -97,7 +97,6 @@
  #ifdef CONFIG_CMD_USB
  
  /* USB device */

-#define CONFIG_USBNET_MANUFACTURER  "AriesEmbedded"
  #define CONFIG_USB_FUNCTION_MASS_STORAGE
  #define CONFIG_SYS_DFU_DATA_BUF_SIZE  (1 * 1024 * 1024)
  #define DFU_DEFAULT_POLL_TIMEOUT  300
diff --git a/include/configs/sama5d2_ptc.h b/include/configs/sama5d2_ptc.h
index 543592e3a574..2328c7614ed7 100644
--- a/include/configs/sama5d2_ptc.h
+++ b/include/configs/sama5d2_ptc.h
@@ -60,7 +60,6 @@
  #endif
  
  /* USB device */

-#define CONFIG_USBNET_MANUFACTURER  "Atmel SAMA5D2_PTC"
  
  /* Ethernet Hardware */

  #define CONFIG_MACB
diff --git a/include/configs/vinco.h b/include/configs/vinco.h
index d3d5dc8f7732..265da84fc0cc 100644
--- a/include/configs/vinco.h

Re: [U-Boot] [PATCH v3 2/4] block: ide: Fix block read/write with driver model

2017-09-08 Thread Tom Rini
On Sat, Sep 09, 2017 at 08:30:44AM +0800, Bin Meng wrote:
> Hi Tom,
> 
> On Wed, Sep 6, 2017 at 3:30 PM, Bin Meng  wrote:
> > This converts the IDE driver to driver model so that block read and
> > write are fully functional.
> >
> > Fixes: b7c6baef ("x86: Convert MMC to driver model")
> > Reported-by: Heinrich Schuchardt 
> > Signed-off-by: Bin Meng 
> >
> > Reviewed-by: Simon Glass 
> > Tested-by: Heinrich Schuchardt 
> > ---
> >
> > Changes in v3:
> > - Updated BLK_XXX_SIZE usage
> >
> > Changes in v2:
> > - Fixed 'fatls ide 0' issue
> >
> >  drivers/block/blk-uclass.c |  2 +-
> >  drivers/block/ide.c| 70 
> > ++
> >  include/dm/uclass-id.h |  1 +
> >  3 files changed, 72 insertions(+), 1 deletion(-)
> >
> 
> Will you take this series in 2017.09?

I would swear that we declare vendor/etc as size + 1 so that we can
ensure that size+1==NULL and only write up to size into the field.  But
the rest of this patch strncpy's to size+1.  That feels wrong, but I'm
not totally sure.  Are you?  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 v2 2/2] imx_common: detect USB serial downloader reliably

2017-09-08 Thread Stefan Agner
On 2017-09-08 17:41, Eric Nelson wrote:
> Hi Stefan,
> 
> On 09/08/2017 05:35 PM, Fabio Estevam wrote:
>> On Fri, Sep 8, 2017 at 8:35 PM, Stefan Agner  wrote:
>>
>>> +   /*
>>> +* The above method does not detect that the boot ROM used
>>> +* serial downloader in case the boot ROM descided to use the
>>
>> Typo: decided
>>
> 
> You know you're on the right track when the only comments about
> your patch are about naming, spelling and grammar ;)

Hehe, ok cool.

Yeah my parser was searching for a logical issue wrt initialize... :-)

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


Re: [U-Boot] [PATCH v2 2/2] imx_common: detect USB serial downloader reliably

2017-09-08 Thread Eric Nelson

Hi Stefan,

On 09/08/2017 05:35 PM, Fabio Estevam wrote:

On Fri, Sep 8, 2017 at 8:35 PM, Stefan Agner  wrote:


+   /*
+* The above method does not detect that the boot ROM used
+* serial downloader in case the boot ROM descided to use the 


Typo: decided



You know you're on the right track when the only comments about
your patch are about naming, spelling and grammar ;)
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v2 2/2] imx_common: detect USB serial downloader reliably

2017-09-08 Thread Fabio Estevam
On Fri, Sep 8, 2017 at 8:35 PM, Stefan Agner  wrote:

> +   /*
> +* The above method does not detect that the boot ROM used
> +* serial downloader in case the boot ROM descided to use the

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


Re: [U-Boot] [PATCH v2 2/2] imx_common: detect USB serial downloader reliably

2017-09-08 Thread Eric Nelson

Hi Stefan,

On 09/08/2017 05:16 PM, Stefan Agner wrote:

On 2017-09-08 16:41, Eric Nelson wrote:

On 09/08/2017 04:35 PM, Stefan Agner wrote:

From: Stefan Agner 







Nit: should be "did not initialize" instead of "initialized".


Sorry, don't get that. Below I write "did not (yet) initialized"...



The proper English usage here is "did not (yet) initialize".

You don't need the past tense after "did not".

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


Re: [U-Boot] [PATCH v3 2/4] block: ide: Fix block read/write with driver model

2017-09-08 Thread Bin Meng
Hi Tom,

On Wed, Sep 6, 2017 at 3:30 PM, Bin Meng  wrote:
> This converts the IDE driver to driver model so that block read and
> write are fully functional.
>
> Fixes: b7c6baef ("x86: Convert MMC to driver model")
> Reported-by: Heinrich Schuchardt 
> Signed-off-by: Bin Meng 
>
> Reviewed-by: Simon Glass 
> Tested-by: Heinrich Schuchardt 
> ---
>
> Changes in v3:
> - Updated BLK_XXX_SIZE usage
>
> Changes in v2:
> - Fixed 'fatls ide 0' issue
>
>  drivers/block/blk-uclass.c |  2 +-
>  drivers/block/ide.c| 70 
> ++
>  include/dm/uclass-id.h |  1 +
>  3 files changed, 72 insertions(+), 1 deletion(-)
>

Will you take this series in 2017.09?

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


Re: [U-Boot] [PATCH v2 2/2] imx_common: detect USB serial downloader reliably

2017-09-08 Thread Stefan Agner
On 2017-09-08 16:41, Eric Nelson wrote:
> Hi Stefan,
> 
> On 09/08/2017 04:35 PM, Stefan Agner wrote:
>> From: Stefan Agner 
>>
>> The current mechanism using SCR/GPR registers work well when
>> the serial downloader boot mode has been selected explicitly
>> (either via boot mode pins or using bmode command). However,
>> in case the system entered boot ROM due to unbootable primary
>> boot devices (e.g. empty eMMC), the SPL fails to detect that
>> it has been downloaded through serial loader and tries to
>> continue booting from eMMC:
>>Trying to boot from MMC1
>>mmc_load_image_raw_sector: mmc block read error
>>SPL: failed to boot from all boot devices
>>### ERROR ### Please RESET the board ###
>>
>> The only known way to reliably detect USB serial downloader
>> is by checking the USB PHY receiver block power state...
>>
>> Signed-off-by: Stefan Agner 
>> Acked-by: Marcel Ziswiler 
>> Tested-by: Fabio Estevam 
>> ---
>>
>> Changes in v2:
>> - Add comment that we infer boot ROM behavior from USB PHY state
>>
>>   arch/arm/mach-imx/spl.c | 12 
>>   1 file changed, 12 insertions(+)
>>
>> diff --git a/arch/arm/mach-imx/spl.c b/arch/arm/mach-imx/spl.c
>> index 258578ac25..f3fec81de7 100644
>> --- a/arch/arm/mach-imx/spl.c
>> +++ b/arch/arm/mach-imx/spl.c
>> @@ -31,6 +31,18 @@ u32 spl_boot_device(void)
>>  if (((bmode >> 24) & 0x03) == 0x01) /* Serial Downloader */
>>  return BOOT_DEVICE_BOARD;
>>   +  /*
>> + * The above method does not detect that the boot ROM used
>> + * serial downloader in case the boot ROM descided to use the
>> + * serial downloader as a fall back (primary boot source failed).
>> + *
> 
> Nit: should be "did not initialize" instead of "initialized".

Sorry, don't get that. Below I write "did not (yet) initialized"...

--
Stefan

> 
> Otherwise, this is a nice comment that describes the situation.
> 
>> + * Infer that the boot ROM used the USB serial downloader by
>> + * checking whether the USB PHY is currently active... This
>> + * assumes that SPL did not (yet) initialized the USB PHY...
>> + */
>> +if (is_usbphy_active())
>> +return BOOT_DEVICE_BOARD;
>> +
>>  /* BOOT_CFG1[7:4] - see IMX6DQRM Table 8-8 */
>>  switch ((reg & IMX6_BMODE_MASK) >> IMX6_BMODE_SHIFT) {
>>   /* EIM: See 8.5.1, Table 8-9 */
>>
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v2 2/2] imx_common: detect USB serial downloader reliably

2017-09-08 Thread Eric Nelson

Hi Stefan,

On 09/08/2017 04:35 PM, Stefan Agner wrote:

From: Stefan Agner 

The current mechanism using SCR/GPR registers work well when
the serial downloader boot mode has been selected explicitly
(either via boot mode pins or using bmode command). However,
in case the system entered boot ROM due to unbootable primary
boot devices (e.g. empty eMMC), the SPL fails to detect that
it has been downloaded through serial loader and tries to
continue booting from eMMC:
   Trying to boot from MMC1
   mmc_load_image_raw_sector: mmc block read error
   SPL: failed to boot from all boot devices
   ### ERROR ### Please RESET the board ###

The only known way to reliably detect USB serial downloader
is by checking the USB PHY receiver block power state...

Signed-off-by: Stefan Agner 
Acked-by: Marcel Ziswiler 
Tested-by: Fabio Estevam 
---

Changes in v2:
- Add comment that we infer boot ROM behavior from USB PHY state

  arch/arm/mach-imx/spl.c | 12 
  1 file changed, 12 insertions(+)

diff --git a/arch/arm/mach-imx/spl.c b/arch/arm/mach-imx/spl.c
index 258578ac25..f3fec81de7 100644
--- a/arch/arm/mach-imx/spl.c
+++ b/arch/arm/mach-imx/spl.c
@@ -31,6 +31,18 @@ u32 spl_boot_device(void)
if (((bmode >> 24) & 0x03) == 0x01) /* Serial Downloader */
return BOOT_DEVICE_BOARD;
  
+	/*

+* The above method does not detect that the boot ROM used
+* serial downloader in case the boot ROM descided to use the
+* serial downloader as a fall back (primary boot source failed).
+*


Nit: should be "did not initialize" instead of "initialized".

Otherwise, this is a nice comment that describes the situation.


+* Infer that the boot ROM used the USB serial downloader by
+* checking whether the USB PHY is currently active... This
+* assumes that SPL did not (yet) initialized the USB PHY...
+*/
+   if (is_usbphy_active())
+   return BOOT_DEVICE_BOARD;
+
/* BOOT_CFG1[7:4] - see IMX6DQRM Table 8-8 */
switch ((reg & IMX6_BMODE_MASK) >> IMX6_BMODE_SHIFT) {
 /* EIM: See 8.5.1, Table 8-9 */


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


Re: [U-Boot] [PATCH v2 1/2] imx: add macro to detect whether USB PHY is active

2017-09-08 Thread Eric Nelson

Hi Stefan,

On 09/08/2017 04:35 PM, Stefan Agner wrote:

From: Stefan Agner 

This macro allows to detect whether the USB PHY is active. This
is helpful to detect if the boot ROM has previously started the
USB serial downloader.

The idea is taken from the mfgtool support in the NXP U-Boot:
http://git.freescale.com/git/cgit.cgi/imx/uboot-imx.git/commit/?h=imx_v2016.03_4.1.15_2.0.0_ga&id=a352ed3c5184b95c4c9f7468f5fbb5f43de5e412

Signed-off-by: Stefan Agner 
Acked-by: Marcel Ziswiler 
Tested-by: Fabio Estevam 
---

Changes in v2:
- Move macro to sys_proto.h
- Renamed from is_boot_from_usb() to is_usbphy_active()
- Use defines for register offset and field
- Remove tab after define
- Remove comment since the actual "magic" is happening and
   documented at usage side

  arch/arm/include/asm/arch-mx6/sys_proto.h | 7 +++
  1 file changed, 7 insertions(+)

diff --git a/arch/arm/include/asm/arch-mx6/sys_proto.h 
b/arch/arm/include/asm/arch-mx6/sys_proto.h
index 14f5d948c9..9d4b1d6768 100644
--- a/arch/arm/include/asm/arch-mx6/sys_proto.h
+++ b/arch/arm/include/asm/arch-mx6/sys_proto.h
@@ -6,3 +6,10 @@
   */
  
  #include 

+
+#define USBPHY_PWD 0x
+
+#define USBPHY_PWD_RXPWDRX (1 << 20) /* receiver block power down */
+


At least MX6 and MX7 have USB Host PHY as well as USB OTG.

How about is_otgphy_active() instead?


+#define is_usbphy_active(void) (!(readl(USB_PHY0_BASE_ADDR + USBPHY_PWD) & \
+  USBPHY_PWD_RXPWDRX))


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


[U-Boot] [PATCH v2 2/2] imx_common: detect USB serial downloader reliably

2017-09-08 Thread Stefan Agner
From: Stefan Agner 

The current mechanism using SCR/GPR registers work well when
the serial downloader boot mode has been selected explicitly
(either via boot mode pins or using bmode command). However,
in case the system entered boot ROM due to unbootable primary
boot devices (e.g. empty eMMC), the SPL fails to detect that
it has been downloaded through serial loader and tries to
continue booting from eMMC:
  Trying to boot from MMC1
  mmc_load_image_raw_sector: mmc block read error
  SPL: failed to boot from all boot devices
  ### ERROR ### Please RESET the board ###

The only known way to reliably detect USB serial downloader
is by checking the USB PHY receiver block power state...

Signed-off-by: Stefan Agner 
Acked-by: Marcel Ziswiler 
Tested-by: Fabio Estevam 
---

Changes in v2:
- Add comment that we infer boot ROM behavior from USB PHY state

 arch/arm/mach-imx/spl.c | 12 
 1 file changed, 12 insertions(+)

diff --git a/arch/arm/mach-imx/spl.c b/arch/arm/mach-imx/spl.c
index 258578ac25..f3fec81de7 100644
--- a/arch/arm/mach-imx/spl.c
+++ b/arch/arm/mach-imx/spl.c
@@ -31,6 +31,18 @@ u32 spl_boot_device(void)
if (((bmode >> 24) & 0x03) == 0x01) /* Serial Downloader */
return BOOT_DEVICE_BOARD;
 
+   /*
+* The above method does not detect that the boot ROM used
+* serial downloader in case the boot ROM descided to use the
+* serial downloader as a fall back (primary boot source failed).
+*
+* Infer that the boot ROM used the USB serial downloader by
+* checking whether the USB PHY is currently active... This
+* assumes that SPL did not (yet) initialized the USB PHY...
+*/
+   if (is_usbphy_active())
+   return BOOT_DEVICE_BOARD;
+
/* BOOT_CFG1[7:4] - see IMX6DQRM Table 8-8 */
switch ((reg & IMX6_BMODE_MASK) >> IMX6_BMODE_SHIFT) {
 /* EIM: See 8.5.1, Table 8-9 */
-- 
2.14.1

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


[U-Boot] [PATCH v2 1/2] imx: add macro to detect whether USB PHY is active

2017-09-08 Thread Stefan Agner
From: Stefan Agner 

This macro allows to detect whether the USB PHY is active. This
is helpful to detect if the boot ROM has previously started the
USB serial downloader.

The idea is taken from the mfgtool support in the NXP U-Boot:
http://git.freescale.com/git/cgit.cgi/imx/uboot-imx.git/commit/?h=imx_v2016.03_4.1.15_2.0.0_ga&id=a352ed3c5184b95c4c9f7468f5fbb5f43de5e412

Signed-off-by: Stefan Agner 
Acked-by: Marcel Ziswiler 
Tested-by: Fabio Estevam 
---

Changes in v2:
- Move macro to sys_proto.h
- Renamed from is_boot_from_usb() to is_usbphy_active()
- Use defines for register offset and field
- Remove tab after define
- Remove comment since the actual "magic" is happening and
  documented at usage side

 arch/arm/include/asm/arch-mx6/sys_proto.h | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/arch/arm/include/asm/arch-mx6/sys_proto.h 
b/arch/arm/include/asm/arch-mx6/sys_proto.h
index 14f5d948c9..9d4b1d6768 100644
--- a/arch/arm/include/asm/arch-mx6/sys_proto.h
+++ b/arch/arm/include/asm/arch-mx6/sys_proto.h
@@ -6,3 +6,10 @@
  */
 
 #include 
+
+#define USBPHY_PWD 0x
+
+#define USBPHY_PWD_RXPWDRX (1 << 20) /* receiver block power down */
+
+#define is_usbphy_active(void) (!(readl(USB_PHY0_BASE_ADDR + USBPHY_PWD) & \
+  USBPHY_PWD_RXPWDRX))
-- 
2.14.1

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


[U-Boot] [PATCH 2/2] Convert CONFIG_MAC_ADDR_IN_SPIFLASH et al to Kconfig

2017-09-08 Thread Adam Ford
This converts the following to Kconfig:
   CONFIG_MAC_ADDR_IN_SPIFLASH
   CONFIG_MAC_ADDR_IN_EEPROM

Signed-off-by: Adam Ford 
---
 board/davinci/da8xxevm/Kconfig| 24 
 configs/da850_am18xxevm_defconfig |  3 ++-
 configs/da850evm_defconfig|  1 -
 configs/da850evm_direct_nor_defconfig |  2 +-
 scripts/config_whitelist.txt  |  2 --
 5 files changed, 27 insertions(+), 5 deletions(-)

diff --git a/board/davinci/da8xxevm/Kconfig b/board/davinci/da8xxevm/Kconfig
index 0935abf..6e51ce4 100644
--- a/board/davinci/da8xxevm/Kconfig
+++ b/board/davinci/da8xxevm/Kconfig
@@ -9,6 +9,30 @@ config SYS_VENDOR
 config SYS_CONFIG_NAME
default "da850evm"
 
+menuconfig DA850_MAC
+   bool "Use MAC Address"
+   default y
+
+if DA850_MAC
+config MAC_ADDR_IN_SPIFLASH
+   bool "MAC address in SPI Flash"
+   default y
+   help
+ The OMAP-L138 and AM1808 SoM are programmed with
+ their MAC address in SPI Flash from the factory
+ Enable this option to read the MAC from SPI Flash
+
+config MAC_ADDR_IN_EEPROM
+   bool "MAC address in EEPROM"
+   help
+ The DA850 EVM comes with SoM are programmed with
+ their MAC address in SPI Flash from the factory,
+ but the kit has an optional expansion board with
+ EEPROM available.  Enable this option to read the
+ MAC from the EEPROM
+
+endif
+
 endif
 
 if TARGET_OMAPL138_LCDK
diff --git a/configs/da850_am18xxevm_defconfig 
b/configs/da850_am18xxevm_defconfig
index cb3726d..ad9c66c 100644
--- a/configs/da850_am18xxevm_defconfig
+++ b/configs/da850_am18xxevm_defconfig
@@ -1,12 +1,13 @@
 CONFIG_ARM=y
 CONFIG_ARCH_DAVINCI=y
 CONFIG_TARGET_DA850EVM=y
+CONFIG_MAC_ADDR_IN_EEPROM=y
 CONFIG_SPL_LIBCOMMON_SUPPORT=y
 CONFIG_SPL_LIBGENERIC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_SPL_SPI_FLASH_SUPPORT=y
 CONFIG_SPL_SPI_SUPPORT=y
-CONFIG_SYS_EXTRA_OPTIONS="DA850_AM18X_EVM,MAC_ADDR_IN_EEPROM,SYS_I2C_EEPROM_ADDR_LEN=2,SYS_I2C_EEPROM_ADDR=0x50"
+CONFIG_SYS_EXTRA_OPTIONS="DA850_AM18X_EVM,SYS_I2C_EEPROM_ADDR_LEN=2,SYS_I2C_EEPROM_ADDR=0x50"
 CONFIG_BOOTDELAY=3
 CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="mem=32M console=ttyS2,115200n8 root=/dev/mtdblock2 rw 
noinitrd ip=dhcp"
diff --git a/configs/da850evm_defconfig b/configs/da850evm_defconfig
index ac54235..3193bbd 100644
--- a/configs/da850evm_defconfig
+++ b/configs/da850evm_defconfig
@@ -6,7 +6,6 @@ CONFIG_SPL_LIBGENERIC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_SPL_SPI_FLASH_SUPPORT=y
 CONFIG_SPL_SPI_SUPPORT=y
-CONFIG_SYS_EXTRA_OPTIONS="MAC_ADDR_IN_SPIFLASH"
 CONFIG_BOOTDELAY=3
 CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="mem=32M console=ttyS2,115200n8 root=/dev/mtdblock2 rw 
noinitrd ip=dhcp"
diff --git a/configs/da850evm_direct_nor_defconfig 
b/configs/da850evm_direct_nor_defconfig
index 9c1ae37..ec31e7c 100644
--- a/configs/da850evm_direct_nor_defconfig
+++ b/configs/da850evm_direct_nor_defconfig
@@ -1,7 +1,7 @@
 CONFIG_ARM=y
 CONFIG_ARCH_DAVINCI=y
 CONFIG_TARGET_DA850EVM=y
-CONFIG_SYS_EXTRA_OPTIONS="MAC_ADDR_IN_SPIFLASH,USE_NOR,DIRECT_NOR_BOOT"
+CONFIG_SYS_EXTRA_OPTIONS="USE_NOR,DIRECT_NOR_BOOT"
 CONFIG_BOOTDELAY=3
 CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="mem=32M console=ttyS2,115200n8 root=/dev/mtdblock2 rw 
noinitrd ip=dhcp"
diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt
index 9ce0c3f..5dc69ea 100644
--- a/scripts/config_whitelist.txt
+++ b/scripts/config_whitelist.txt
@@ -1360,8 +1360,6 @@ CONFIG_MACH_SPECIFIC
 CONFIG_MACH_TYPE
 CONFIG_MACH_TYPE_COMPAT_REV
 CONFIG_MACRESET_TIMEOUT
-CONFIG_MAC_ADDR_IN_EEPROM
-CONFIG_MAC_ADDR_IN_SPIFLASH
 CONFIG_MALLOC_F_ADDR
 CONFIG_MALTA
 CONFIG_MARCO_MEMSET
-- 
2.7.4

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


[U-Boot] [PATCH 1/2] davinci: da850evm: Make EEPROM MAC code configurable

2017-09-08 Thread Adam Ford
There was a check for CONFIG_MAC_ADDR_IN_EEPROM and
a check for CONFIG_MAC_ADDR_IN_SPIFLASH, however
some of the EEPROM related code wasn't encapsulated
inside the #if defined statement so the EEPROM code
could get executed even when it wasn't explicitly
enabled or wanted.

Signed-off-by: Adam Ford 
---
 board/davinci/da8xxevm/da850evm.c | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/board/davinci/da8xxevm/da850evm.c 
b/board/davinci/da8xxevm/da850evm.c
index c2d2e8e..516d86d 100644
--- a/board/davinci/da8xxevm/da850evm.c
+++ b/board/davinci/da8xxevm/da850evm.c
@@ -133,6 +133,8 @@ int misc_init_r(void)
 
enetaddr_found = eth_env_get_enetaddr("ethaddr", env_enetaddr);
 
+#endif
+
 #ifdef CONFIG_MAC_ADDR_IN_SPIFLASH
int spi_mac_read;
uchar buff[6];
@@ -167,7 +169,8 @@ int misc_init_r(void)
"with the MAC address in the 
environment\n");
printf("Default using MAC address from environment\n");
}
-#endif
+
+#elif defined(CONFIG_MAC_ADDR_IN_EEPROM)
uint8_t enetaddr[8];
int eeprom_mac_read;
 
-- 
2.7.4

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


Re: [U-Boot] [PATCH] edison: Disable CONFIG_USB_HOST_ETHER

2017-09-08 Thread Tom Rini
On Fri, Sep 08, 2017 at 04:44:04PM -0400, Tom Rini wrote:

> This board does dwc3 gadget, not host, so we cannot have host support or
> we will fail to link.
> 
> Signed-off-by: Tom Rini 

Applied to u-boot/master, thanks!

-- 
Tom


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


[U-Boot] [PATCH] edison: Disable CONFIG_USB_HOST_ETHER

2017-09-08 Thread Tom Rini
This board does dwc3 gadget, not host, so we cannot have host support or
we will fail to link.

Signed-off-by: Tom Rini 
---
 configs/edison_defconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configs/edison_defconfig b/configs/edison_defconfig
index d099c0b0dcd0..d58700c204cb 100644
--- a/configs/edison_defconfig
+++ b/configs/edison_defconfig
@@ -36,5 +36,6 @@ CONFIG_USB_GADGET_DOWNLOAD=y
 CONFIG_G_DNL_MANUFACTURER="Intel"
 CONFIG_G_DNL_VENDOR_NUM=0x8087
 CONFIG_G_DNL_PRODUCT_NUM=0x0a99
+# CONFIG_USB_HOST_ETHER is not set
 CONFIG_FAT_WRITE=y
 CONFIG_SHA1=y
-- 
1.9.1

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


[U-Boot] [PATCH 2/2] ARM: DRA7: Cleanup old pinctrl macros

2017-09-08 Thread Suman Anna
Commit 6ae4c3efbd62 ("ARM: DRA7: Add pinctrl register definitions")
has added new macros for pinmux configuration in line with the kernel
definitions. Cleanup the old pinctrl macros from the common header
file so that they are not used by any new boards.

Signed-off-by: Suman Anna 
---
 arch/arm/include/asm/arch-omap5/mux_dra7xx.h | 14 --
 1 file changed, 14 deletions(-)

diff --git a/arch/arm/include/asm/arch-omap5/mux_dra7xx.h 
b/arch/arm/include/asm/arch-omap5/mux_dra7xx.h
index 5eed98ca27a4..55f49c784857 100644
--- a/arch/arm/include/asm/arch-omap5/mux_dra7xx.h
+++ b/arch/arm/include/asm/arch-omap5/mux_dra7xx.h
@@ -12,20 +12,6 @@
 
 #include 
 
-#define FSC(1 << 19)
-#define SSC(0 << 19)
-
-#define IEN(1 << 18)
-#define IDIS   (0 << 18)
-
-#define PTU(1 << 17)
-#define PTD(0 << 17)
-#define PEN(1 << 16)
-#define PDIS   (0 << 16)
-
-#define WKEN   (1 << 24)
-#define WKDIS  (0 << 24)
-
 #define PULL_ENA   (0 << 16)
 #define PULL_DIS   (1 << 16)
 #define PULL_UP(1 << 17)
-- 
2.13.1

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


[U-Boot] [PATCH 1/2] arm: am57xx: cl-som-am57x: Use new pinctrl macros

2017-09-08 Thread Suman Anna
Commit 6ae4c3efbd62 ("ARM: DRA7: Add pinctrl register definitions")
has added new macros for pinmux configuration in line with the
kernel definitions. Fixup the current pinctrl data for the CompuLab
CL-SOM-AM57x board to use these new macros to facilitate the removal
of the old macros.

NOTE:
The PEN and PDIS macro values used previously were actually defined
inversely, a value of 1 in bit position 16 actually means that the
internal pullup/pulldown is disabled and not enabled as inferred by
PEN. So, previous pinmux config data such as (PDIS | PTU) is confusing
as it actually was meant for enabling internal pullup. The data is
fixed up only to be equivalent to the previous data.

Signed-off-by: Suman Anna 
---
 board/compulab/cl-som-am57x/mux.c | 105 +++---
 1 file changed, 53 insertions(+), 52 deletions(-)

diff --git a/board/compulab/cl-som-am57x/mux.c 
b/board/compulab/cl-som-am57x/mux.c
index 0db0609727f7..21449ca029b0 100644
--- a/board/compulab/cl-som-am57x/mux.c
+++ b/board/compulab/cl-som-am57x/mux.c
@@ -12,97 +12,98 @@
 
 /* Serial console */
 static const struct pad_conf_entry cl_som_am57x_padconf_console[] = {
-   {UART3_RXD, (FSC | IEN | PDIS | PTU | M0)}, /* UART3_RXD */
-   {UART3_TXD, (FSC | IEN | PDIS | PTU | M0)}, /* UART3_TXD */
+   {UART3_RXD, (M0 | PIN_INPUT_PULLUP | SLEWCONTROL)}, /* UART3_RXD */
+   {UART3_TXD, (M0 | PIN_INPUT_PULLUP | SLEWCONTROL)}, /* UART3_TXD */
 };
 
 /* PMIC I2C */
 static const struct pad_conf_entry cl_som_am57x_padconf_pmic[] = {
-   {MCASP1_ACLKR, (IEN | PEN | M10)}, /* MCASP1_ACLKR.I2C4_SDA */
-   {MCASP1_FSR,   (IEN | PEN | M10)}, /* MCASP1_FSR.I2C4_SCL */
+   {MCASP1_ACLKR, (M10 | PIN_INPUT)}, /* MCASP1_ACLKR.I2C4_SDA */
+   {MCASP1_FSR,   (M10 | PIN_INPUT)}, /* MCASP1_FSR.I2C4_SCL */
 };
 
 /* Green GPIO led */
 static const struct pad_conf_entry cl_som_am57x_padconf_green_led[] = {
-   {GPMC_A15, (IDIS | PDIS | PTD | M14)}, /* GPMC_A15.GPIO2_5 */
+   {GPMC_A15, (M14 | PIN_OUTPUT_PULLDOWN)}, /* GPMC_A15.GPIO2_5 */
 };
 
 /* MMC/SD Card */
 static const struct pad_conf_entry cl_som_am57x_padconf_sd_card[] = {
-   {MMC1_CLK,  (IEN | PDIS | PTU | M0) }, /* MMC1_CLK */
-   {MMC1_CMD,  (IEN | PDIS | PTU | M0) }, /* MMC1_CMD */
-   {MMC1_DAT0, (IEN | PDIS | PTU | M0) }, /* MMC1_DAT0 */
-   {MMC1_DAT1, (IEN | PDIS | PTU | M0) }, /* MMC1_DAT1 */
-   {MMC1_DAT2, (IEN | PDIS | PTU | M0) }, /* MMC1_DAT2 */
-   {MMC1_DAT3, (IEN | PDIS | PTU | M0) }, /* MMC1_DAT3 */
-   {MMC1_SDCD, (IEN | PEN  |   M14)}, /* MMC1_SDCD */
-   {MMC1_SDWP, (IEN | PEN  |   M14)}, /* MMC1_SDWP */
+   {MMC1_CLK,  (M0  | PIN_INPUT_PULLUP)}, /* MMC1_CLK */
+   {MMC1_CMD,  (M0  | PIN_INPUT_PULLUP)}, /* MMC1_CMD */
+   {MMC1_DAT0, (M0  | PIN_INPUT_PULLUP)}, /* MMC1_DAT0 */
+   {MMC1_DAT1, (M0  | PIN_INPUT_PULLUP)}, /* MMC1_DAT1 */
+   {MMC1_DAT2, (M0  | PIN_INPUT_PULLUP)}, /* MMC1_DAT2 */
+   {MMC1_DAT3, (M0  | PIN_INPUT_PULLUP)}, /* MMC1_DAT3 */
+   {MMC1_SDCD, (M14 | PIN_INPUT)   }, /* MMC1_SDCD */
+   {MMC1_SDWP, (M14 | PIN_INPUT)   }, /* MMC1_SDWP */
 };
 
 /* WiFi - must be in the safe mode on boot */
 static const struct pad_conf_entry cl_som_am57x_padconf_wifi[] = {
-   {UART1_CTSN, (IEN | M15)}, /* UART1_CTSN */
-   {UART1_RTSN, (IEN | M15)}, /* UART1_RTSN */
-   {UART2_RXD,  (IEN | M15)}, /* UART2_RXD */
-   {UART2_TXD,  (IEN | M15)}, /* UART2_TXD */
-   {UART2_CTSN, (IEN | M15)}, /* UART2_CTSN */
-   {UART2_RTSN, (IEN | M15)}, /* UART2_RTSN */
+   {UART1_CTSN, (M15 | PIN_INPUT_PULLDOWN)}, /* UART1_CTSN */
+   {UART1_RTSN, (M15 | PIN_INPUT_PULLDOWN)}, /* UART1_RTSN */
+   {UART2_RXD,  (M15 | PIN_INPUT_PULLDOWN)}, /* UART2_RXD */
+   {UART2_TXD,  (M15 | PIN_INPUT_PULLDOWN)}, /* UART2_TXD */
+   {UART2_CTSN, (M15 | PIN_INPUT_PULLDOWN)}, /* UART2_CTSN */
+   {UART2_RTSN, (M15 | PIN_INPUT_PULLDOWN)}, /* UART2_RTSN */
 };
 
 /* QSPI */
 static const struct pad_conf_entry cl_som_am57x_padconf_qspi[] = {
-   {GPMC_A13, (IEN | PEN  |   M1)}, /* GPMC_A13.QSPI1_RTCLK */
-   {GPMC_A18, (IEN | PEN  |   M1)}, /* GPMC_A18.QSPI1_SCLK */
-   {GPMC_A16, (IEN | PEN  |   M1)}, /* GPMC_A16.QSPI1_D0 */
-   {GPMC_A17, (IEN | PEN  |   M1)}, /* GPMC_A17.QSPI1_D1 */
-   {GPMC_CS2, (IEN | PDIS | PTU | M1)}, /* GPMC_CS2.QSPI1_CS0 */
+   {GPMC_A13, (M1 | PIN_INPUT)   }, /* GPMC_A13.QSPI1_RTCLK */
+   {GPMC_A18, (M1 | PIN_INPUT)   }, /* GPMC_A18.QSPI1_SCLK */
+   {GPMC_A16, (M1 | PIN_INPUT)   }, /* GPMC_A16.QSPI1_D0 */
+   {GPMC_A17, (M1 | PIN_INPUT)   }, /* GPMC_A17.QSPI1_D1 */
+   {GPMC_CS2, (M1 | PIN_INPUT_PULLUP)}, /* GPMC_CS2.QSPI1_CS0 */
 };
 
 /* GPIO Expander I2C */
 static const struct pad_conf_entry cl_som_am57x_padconf_i2c_gpio[] = {
-   {MCASP1_AXR0, (IEN | PEN | M10)}, /* MCASP1_AXR0.I2C5_SDA */
-   {MCASP1_AXR1, (IEN | PEN | M

[U-Boot] [PATCH 0/2] Cleanup old DRA7 pinctrl macros

2017-09-08 Thread Suman Anna
Hi Uri, Tom,

The following series is an attempt to clean up the old DRA7 pinctrl
macros defined in the common header file, so that all DRA7/AM57 derived
boards use the kernel-style macro definitions. There is only one board,
the Compulab CL-SOM-AM57x board that was using the previous definitions.
The first patch adapts this board to use the new macros and the second
patch cleans up the common definitions.

Patches based on current master. I have only build tested the patches,
as I don't have access to the AM57x CL SOM board.

regards
Suman

Suman Anna (2):
  arm: am57xx: cl-som-am57x: Use new pinctrl macros
  ARM: DRA7: Cleanup old pinctrl macros

 arch/arm/include/asm/arch-omap5/mux_dra7xx.h |  14 
 board/compulab/cl-som-am57x/mux.c| 105 ++-
 2 files changed, 53 insertions(+), 66 deletions(-)

-- 
2.13.1

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


[U-Boot] Enc: Uboot compatible with board Tegra124-nyan-big (ChromeBook G3 HP 14")

2017-09-08 Thread Alexandre N. Perfeito

FYI


De: s...@google.com  em nome de Simon Glass 
Enviado: quinta-feira, 7 de setembro de 2017 21:16
Para: Tom Warren
Cc: Alexandre N. Perfeito
Assunto: Re: Uboot compatible with board Tegra124-nyan-big (ChromeBook G3 HP 
14")

Hi Alexander,

Can you please send this to the U-Boot list/ It's fine to cc me but it needs to 
go to the list.

Regards,
Simon


On 7 September 2017 at 17:35, Tom Warren 
mailto:twar...@nvidia.com>> wrote:
Sorry, Alexander. I have no experience trying to load U-Boot this way on 
Nyan-big. Hopefully Simon can help here ..

Tom

From: Alexandre N. Perfeito 
[mailto:perfeit...@hotmail.com]
Sent: Thursday, September 07, 2017 4:26 PM
To: Tom Warren mailto:twar...@nvidia.com>>
Cc: Simon Glass mailto:s...@chromium.org>>
Subject: Re: Uboot compatible with board Tegra124-nyan-big (ChromeBook G3 HP 
14")


Hi Tom,



I Try to running Linux Mainline Kernel V 4.4.0 to boot up in my chromebook 
using Ctrl+U in dev mode  and using USBv3.0 drive as a drive.



I using this command:


aperfeito@alarm:/# sudo make -j5  uImage UIMAGE_LOADADDR=0x82408000 dtbs modules


In doc in 
http://git.denx.de/?p=u-boot.git;a=blob_plain;f=doc/README.chromium;hb=HEAD

SAY:

1. Patch U-Boot



Open include/configs/tegra124-common.h



Change:



#define CONFIG_SYS_TEXT_BASE  0x8011



to:



#define CONFIG_SYS_TEXT_BASE  0x81000100
I did this and compiled U-boot OK

And after copy the files generated by Kernel compilation (uImage) Mychromebooks 
BLEPS everytime when try to boot with this files generated:
vbutil_kernel \
--pack vmlinux.kpart \
--version 1 \
--vmlinuz vmlinux.uimg \
--arch arm \
--keyblock  /usr/share/vboot/devkeys/kernel.keyblock \
--signprivate /usr/share/vboot/devkeys/kernel_data_key.vbprivk \
--config config.txt \   
  #  console=tty0 init=/sbin/init root=PARTUUID=%U/PARTNROFF=1 
rootwait rw noinitrd
--bootloader bootloader.bin  #dummy

file vmlinux.kpart created

 Put the file vmlinux.kpart in Kernel Partition /dev/sda6 and file uImage 
compiled  in /boot also dtb(s) tegra124-nyan-big and -blaze.dtbs

My USB:
aperfeito@alarm ~]$ sudo cgpt show /dev/sda
[sudo] password for aperfeito:
   startsizepart   contents
   0   1PMBR (Boot GUID: 
AD11024D-1016-B345-A21D-F7B823B0318A)
   1   1Pri GPT header
   2  32   Pri GPT table
  64   32768   6  Label: "KERN-A"
  Type: ChromeOS kernel
  UUID: 
D43B02E7-AF2D-3642-93D8-370D84193655
  Attr: priority=0 
tries=0 successful=0
   6560053542815 7 Label: "ROOT-A"
 Type: 
0FC63DAF-8483-4772-8E79-3D69D8477DE4
 UUID: 
A01D12A1-C0E2-D54C-B68A-6E24E3896AE2
61997023  32   Sec GPT table
61997055   1Sec GPT header


The ADDRESS IS RIGHT  0x82408000



De: Tom Warren mailto:twar...@nvidia.com>>
Enviado: sexta-feira, 21 de julho de 2017 12:26
Para: Alexandre N. Perfeito
Assunto: RE: Uboot compatible with board Tegra124-nyan-big (ChromeBook G3 HP 
14")


Sorry, Alexander. I’m not sure what you are asking me to do here.



I’ve got an action-item to look at Simon’s Nyan-big patches, but haven’t had a 
chance to do that this week. I’ll try to get to it early next week, and if 
everything looks good I’ll post a PR to bring those patches in to u-boot/tegra.



Hope this helps,



Tom



From: Alexandre N. Perfeito [mailto:perfeit...@hotmail.com]
Sent: Friday, July 21, 2017 10:23 AM
To: Tom Warren mailto:twar...@nvidia.com>>
Subject: Enc: Uboot compatible with board Tegra124-nyan-big (ChromeBook G3 HP 
14")



Tom,



Hi its me again , Alexander and I been chat with Simon and be send 
back to you forCoud you foward to someone to help with this tip to i need  
resolve to boot-up the board nyan-big Using the 4.4.x.x kernel.



Thanks again



Perfeito, Alexander



De: s...@google.com 
mailto:s...@google.com>> em nome de Simon Glass 
mailto:s...@chromium.org>>
Enviado: sexta-feira, 21 de julho de 2017 05:48
Para: Alexandre N. Perfeito
Cc: u-boot@lists.denx.de
Assunto: Re: Uboot compatible with board Tegra124-nyan-big (ChromeBook G3 HP 
14")

There is a series which shows how to do this for tegra and rockchip.
It is at u-boot-dm/chain-working and you can find a README there as
well.

The series has not been applied yet - I think i

[U-Boot] [PATCH] fdt: call fdt_fixup_ethernet after board/system fixups

2017-09-08 Thread Icenowy Zheng
In commit 26d61195f870 we added fdt_fixup_ethernet to a common code
path, which executes before board/system fixups.

However, on sunxi platform board-specific fixup will create ethaddr for
ethernet aliases not present in U-Boot FDT, which won't be used in this
situation.

Move the call of fdt_fixup_ethernet after board/system fixups, so that
board/system fixups can create ethaddr.

Signed-off-by: Icenowy Zheng 
---
 common/image-fdt.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/common/image-fdt.c b/common/image-fdt.c
index c6e8832d66..f57525f865 100644
--- a/common/image-fdt.c
+++ b/common/image-fdt.c
@@ -478,8 +478,6 @@ int image_setup_libfdt(bootm_headers_t *images, void *blob,
printf("ERROR: arch-specific fdt fixup failed\n");
goto err;
}
-   /* Update ethernet nodes */
-   fdt_fixup_ethernet(blob);
if (IMAGE_OF_BOARD_SETUP) {
fdt_ret = ft_board_setup(blob, gd->bd);
if (fdt_ret) {
@@ -496,6 +494,8 @@ int image_setup_libfdt(bootm_headers_t *images, void *blob,
goto err;
}
}
+   /* Update ethernet nodes */
+   fdt_fixup_ethernet(blob);
 
/* Delete the old LMB reservation */
if (lmb)
-- 
2.13.5

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


[U-Boot] [PATCH 06/13] usb: gadget: usb_ether: Move settings to common

2017-09-08 Thread Maxime Ripard
The usb_ether gadget duplicates the USB settings for the manufacturer,
product ID and vendor ID.

Make sure we use the common option so that we can expect a single VID/PID
couple for a single device.

Signed-off-by: Maxime Ripard 
---
 configs/sama5d2_ptc_nandflash_defconfig |  1 +
 configs/sama5d2_ptc_spiflash_defconfig  |  1 +
 configs/vinco_defconfig |  1 +
 drivers/usb/gadget/ether.c  | 16 
 include/configs/ma5d4evk.h  |  1 -
 include/configs/sama5d2_ptc.h   |  1 -
 include/configs/vinco.h |  1 -
 scripts/config_whitelist.txt|  1 -
 8 files changed, 11 insertions(+), 12 deletions(-)

diff --git a/configs/sama5d2_ptc_nandflash_defconfig 
b/configs/sama5d2_ptc_nandflash_defconfig
index 6672a5ce11f7..431056a50a8b 100644
--- a/configs/sama5d2_ptc_nandflash_defconfig
+++ b/configs/sama5d2_ptc_nandflash_defconfig
@@ -29,5 +29,6 @@ CONFIG_USB=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="Atmel SAMA5D2_PTC"
 CONFIG_USB_GADGET_ATMEL_USBA=y
 CONFIG_USB_ETHER=y
diff --git a/configs/sama5d2_ptc_spiflash_defconfig 
b/configs/sama5d2_ptc_spiflash_defconfig
index 9a23a808f1b3..66bb671820a6 100644
--- a/configs/sama5d2_ptc_spiflash_defconfig
+++ b/configs/sama5d2_ptc_spiflash_defconfig
@@ -30,5 +30,6 @@ CONFIG_USB=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="Atmel SAMA5D2_PTC"
 CONFIG_USB_GADGET_ATMEL_USBA=y
 CONFIG_USB_ETHER=y
diff --git a/configs/vinco_defconfig b/configs/vinco_defconfig
index b0df6b3c7805..8d7f9f99ab81 100644
--- a/configs/vinco_defconfig
+++ b/configs/vinco_defconfig
@@ -33,3 +33,4 @@ CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_ATMEL_USBA=y
 CONFIG_USB_ETHER=y
+CONFIG_USB_GADGET_MANUFACTURER="L+G VInCo"
diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c
index 2cf5c8d31e25..dbb578258f96 100644
--- a/drivers/usb/gadget/ether.c
+++ b/drivers/usb/gadget/ether.c
@@ -273,8 +273,8 @@ static inline int BITRATE(struct usb_gadget *g)
  * static ushort idProduct;
  */
 
-#if defined(CONFIG_USBNET_MANUFACTURER)
-static char *iManufacturer = CONFIG_USBNET_MANUFACTURER;
+#if defined(CONFIG_USB_GADGET_MANUFACTURER)
+static char *iManufacturer = CONFIG_USB_GADGET_MANUFACTURER;
 #else
 static char *iManufacturer = "U-Boot";
 #endif
@@ -2073,11 +2073,11 @@ static int eth_bind(struct usb_gadget *gadget)
 * to choose the right configuration otherwise.
 */
if (rndis) {
-#if defined(CONFIG_USB_RNDIS_VENDOR_ID) && defined(CONFIG_USB_RNDIS_PRODUCT_ID)
+#if defined(CONFIG_USB_GADGET_VENDOR_NUM) && 
defined(CONFIG_USB_GADGET_PRODUCT_NUM)
device_desc.idVendor =
-   __constant_cpu_to_le16(CONFIG_USB_RNDIS_VENDOR_ID);
+   __constant_cpu_to_le16(CONFIG_USB_GADGET_VENDOR_NUM);
device_desc.idProduct =
-   __constant_cpu_to_le16(CONFIG_USB_RNDIS_PRODUCT_ID);
+   __constant_cpu_to_le16(CONFIG_USB_GADGET_PRODUCT_NUM);
 #else
device_desc.idVendor =
__constant_cpu_to_le16(RNDIS_VENDOR_NUM);
@@ -2092,9 +2092,9 @@ static int eth_bind(struct usb_gadget *gadget)
 * supporting one submode of the "SAFE" variant of MDLM.)
 */
} else {
-#if defined(CONFIG_USB_CDC_VENDOR_ID) && defined(CONFIG_USB_CDC_PRODUCT_ID)
-   device_desc.idVendor = cpu_to_le16(CONFIG_USB_CDC_VENDOR_ID);
-   device_desc.idProduct = cpu_to_le16(CONFIG_USB_CDC_PRODUCT_ID);
+#if defined(CONFIG_USB_GADGET_VENDOR_NUM) && 
defined(CONFIG_USB_GADGET_PRODUCT_NUM)
+   device_desc.idVendor = 
cpu_to_le16(CONFIG_USB_GADGET_VENDOR_NUM);
+   device_desc.idProduct = 
cpu_to_le16(CONFIG_USB_GADGET_PRODUCT_NUM);
 #else
if (!cdc) {
device_desc.idVendor =
diff --git a/include/configs/ma5d4evk.h b/include/configs/ma5d4evk.h
index 6d25d84c6eb6..3aeb7e6ef136 100644
--- a/include/configs/ma5d4evk.h
+++ b/include/configs/ma5d4evk.h
@@ -97,7 +97,6 @@
 #ifdef CONFIG_CMD_USB
 
 /* USB device */
-#define CONFIG_USBNET_MANUFACTURER  "AriesEmbedded"
 #define CONFIG_USB_FUNCTION_MASS_STORAGE
 #define CONFIG_SYS_DFU_DATA_BUF_SIZE   (1 * 1024 * 1024)
 #define DFU_DEFAULT_POLL_TIMEOUT   300
diff --git a/include/configs/sama5d2_ptc.h b/include/configs/sama5d2_ptc.h
index 543592e3a574..2328c7614ed7 100644
--- a/include/configs/sama5d2_ptc.h
+++ b/include/configs/sama5d2_ptc.h
@@ -60,7 +60,6 @@
 #endif
 
 /* USB device */
-#define CONFIG_USBNET_MANUFACTURER  "Atmel SAMA5D2_PTC"
 
 /* Ethernet Hardware */
 #define CONFIG_MACB
diff --git a/include/configs/vinco.h b/include/configs/vinco.h
index d3d5dc8f7732..265da84fc0cc 100644
--- a/include/configs/vinco.h
+++ b/include/configs/vinco.h
@@ -64,7 +64,6 @@
 #endif
 
 /* USB device */
-#define CONFIG_USBNET_MANUFACTURER  "L+G VI

[U-Boot] [PATCH 13/13] sunxi: sina33: Sync the device tree with the kernel

2017-09-08 Thread Maxime Ripard
The kernel DT of the SinA33 has evolved quite a bit. Make sure we sync it
and its upstream DTSI to be able to use the OTG.

Signed-off-by: Maxime Ripard 
---
 arch/arm/dts/axp223.dtsi  |  58 ++-
 arch/arm/dts/axp22x.dtsi  |  10 +-
 arch/arm/dts/sun8i-a23-a33.dtsi   | 446 +++---
 arch/arm/dts/sun8i-a33-sinlinx-sina33.dts |  43 ++-
 arch/arm/dts/sun8i-a33.dtsi   | 477 +++
 include/dt-bindings/clock/sun8i-a23-a33-ccu.h | 127 +-
 include/dt-bindings/reset/sun8i-a23-a33-ccu.h |  87 +++-
 7 files changed, 914 insertions(+), 334 deletions(-)
 create mode 100644 arch/arm/dts/axp223.dtsi
 create mode 100644 include/dt-bindings/clock/sun8i-a23-a33-ccu.h
 create mode 100644 include/dt-bindings/reset/sun8i-a23-a33-ccu.h

diff --git a/arch/arm/dts/axp223.dtsi b/arch/arm/dts/axp223.dtsi
new file mode 100644
index ..b91b6c1278c7
--- /dev/null
+++ b/arch/arm/dts/axp223.dtsi
@@ -0,0 +1,58 @@
+/*
+ * Copyright 2016 Free Electrons
+ *
+ * Quentin Schulz 
+ *
+ * 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 file 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 file 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.
+ */
+
+/*
+ * AXP223 Integrated Power Management Chip
+ * http://www.x-powers.com/product/AXP22X.php
+ * http://dl.linux-sunxi.org/AXP/AXP223-en.pdf
+ *
+ * The AXP223 shares most of its logic with the AXP221 but it has some
+ * differences, for the VBUS driver for example.
+ */
+
+#include "axp22x.dtsi"
+
+&usb_power_supply {
+   compatible = "x-powers,axp223-usb-power-supply";
+};
diff --git a/arch/arm/dts/axp22x.dtsi b/arch/arm/dts/axp22x.dtsi
index 458b6681e3ec..87fb08e812ec 100644
--- a/arch/arm/dts/axp22x.dtsi
+++ b/arch/arm/dts/axp22x.dtsi
@@ -52,6 +52,16 @@
interrupt-controller;
#interrupt-cells = <1>;
 
+   ac_power_supply: ac-power-supply {
+   compatible = "x-powers,axp221-ac-power-supply";
+   status = "disabled";
+   };
+
+   battery_power_supply: battery-power-supply {
+   compatible = "x-powers,axp221-battery-power-supply";
+   status = "disabled";
+   };
+
regulators {
/* Default work frequency for buck regulators */
x-powers,dcdc-freq = <3000>;
diff --git a/arch/arm/dts/sun8i-a23-a33.dtsi b/arch/arm/dts/sun8i-a23-a33.dtsi
index f97c38f097d1..ea50dda75adc 100644
--- a/arch/arm/dts/sun8i-a23-a33.dtsi
+++ b/arch/arm/dts/sun8i-a23-a33.dtsi
@@ -46,7 +46,8 @@
 
 #include 
 
-#include 
+#include 
+#include 
 
 / {
interrupt-parent = <&gic>;
@@ -60,7 +61,9 @@
compatible = "allwinner,simple-framebuffer",
 "simple-framebuffer";
allwinner,pipeline = "de_be0-lcd0";
-   clocks = <&pll6 0>;
+   clocks = <&ccu CLK_BUS_LCD>, <&ccu CLK_BUS_DE_BE>,
+<&ccu CLK_LCD_CH0>, <&ccu CLK_DE_BE>,
+<&ccu CLK_DRAM_DE_BE>, <&ccu CLK_DRC>;
status = "disabled";
};
};
@@ -80,7 +83,7 @@
 

[U-Boot] [PATCH 09/13] cmd: fastboot: Rework fastboot dependency

2017-09-08 Thread Maxime Ripard
Fastboot need a bunch of options to be operating properly, such as the
g_dnl gadget, the fastboot command, and some options that make sense. Since
fastboot is now part of Kconfig, make sure we have them right.

That will also reduce the boilerplate in the defconfigs.

Signed-off-by: Maxime Ripard 
---
 arch/arm/Kconfig   | 2 --
 cmd/fastboot/Kconfig   | 4 
 configs/A13-OLinuXino_defconfig| 1 -
 configs/A20-OLinuXino-Lime2-eMMC_defconfig | 1 -
 configs/A20-OLinuXino-Lime2_defconfig  | 1 -
 configs/CHIP_defconfig | 1 -
 configs/CHIP_pro_defconfig | 1 -
 configs/Cubietruck_defconfig   | 1 -
 configs/Nintendo_NES_Classic_Edition_defconfig | 1 -
 configs/Sinlinx_SinA33_defconfig   | 1 -
 configs/am335x_boneblack_defconfig | 2 --
 configs/am335x_boneblack_vboot_defconfig   | 2 --
 configs/am335x_evm_defconfig   | 2 --
 configs/am335x_evm_nor_defconfig   | 2 --
 configs/am335x_evm_norboot_defconfig   | 2 --
 configs/am335x_evm_spiboot_defconfig   | 2 --
 configs/am335x_evm_usbspl_defconfig| 2 --
 configs/am57xx_evm_defconfig   | 2 --
 configs/am57xx_evm_nodt_defconfig  | 3 ---
 configs/am57xx_hs_evm_defconfig| 2 --
 configs/bcm23550_w1d_defconfig | 3 ---
 configs/bcm28155_ap_defconfig  | 3 ---
 configs/birdland_bav335a_defconfig | 3 ---
 configs/birdland_bav335b_defconfig | 3 ---
 configs/cgtqmx6eval_defconfig  | 3 ---
 configs/chromebit_mickey_defconfig | 1 -
 configs/chromebook_jerry_defconfig | 1 -
 configs/chromebook_minnie_defconfig| 1 -
 configs/dra7xx_evm_defconfig   | 2 --
 configs/dra7xx_hs_evm_defconfig| 2 --
 configs/evb-rk3036_defconfig   | 1 -
 configs/evb-rk3229_defconfig   | 1 -
 configs/evb-rk3288_defconfig   | 1 -
 configs/fennec-rk3288_defconfig| 1 -
 configs/firefly-rk3288_defconfig   | 1 -
 configs/kc1_defconfig  | 3 ---
 configs/kylin-rk3036_defconfig | 1 -
 configs/miqi-rk3288_defconfig  | 1 -
 configs/mx6qsabrelite_defconfig| 3 ---
 configs/nitrogen6dl2g_defconfig| 3 ---
 configs/nitrogen6dl_defconfig  | 3 ---
 configs/nitrogen6q2g_defconfig | 3 ---
 configs/nitrogen6q_defconfig   | 3 ---
 configs/nitrogen6s1g_defconfig | 3 ---
 configs/nitrogen6s_defconfig   | 3 ---
 configs/omap3_beagle_defconfig | 3 ---
 configs/omap3_logic_defconfig  | 2 --
 configs/parrot_r16_defconfig   | 1 -
 configs/phycore-rk3288_defconfig   | 1 -
 configs/popmetal-rk3288_defconfig  | 1 -
 configs/rock2_defconfig| 1 -
 configs/sniper_defconfig   | 3 ---
 configs/tinker-rk3288_defconfig| 1 -
 53 files changed, 4 insertions(+), 97 deletions(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 449fd164b040..58c06ebb076e 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -693,7 +693,6 @@ config ARCH_SUNXI
select USB_STORAGE if DISTRO_DEFAULTS
select USB_KEYBOARD if DISTRO_DEFAULTS
select USE_TINY_PRINTF
-   imply CMD_FASTBOOT
imply FASTBOOT
imply FAT_WRITE
imply PRE_CONSOLE_BUFFER
@@ -704,7 +703,6 @@ config ARCH_SUNXI
imply SPL_MMC_SUPPORT if MMC
imply SPL_POWER_SUPPORT
imply SPL_SERIAL_SUPPORT
-   imply USB_FUNCTION_FASTBOOT
imply USB_GADGET
 
 config TARGET_TS4600
diff --git a/cmd/fastboot/Kconfig b/cmd/fastboot/Kconfig
index fb0c5da94cdb..5c1186017206 100644
--- a/cmd/fastboot/Kconfig
+++ b/cmd/fastboot/Kconfig
@@ -8,6 +8,10 @@ if FASTBOOT
 
 config USB_FUNCTION_FASTBOOT
bool "Enable USB fastboot gadget"
+   default y
+   select USB_GADGET_DOWNLOAD
+   imply ANDROID_BOOT_IMAGE
+   imply CMD_FASTBOOT
help
  This enables the USB part of the fastboot gadget.
 
diff --git a/configs/A13-OLinuXino_defconfig b/configs/A13-OLinuXino_defconfig
index e55dbff44d36..ed8349000e22 100644
--- a/configs/A13-OLinuXino_defconfig
+++ b/configs/A13-OLinuXino_defconfig
@@ -31,4 +31,3 @@ CONFIG_AXP_ALDO3_VOLT=3300
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_MUSB_GADGET=y
 CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
-CONFIG_USB_GADGET_DOWNLOAD=y
diff --git a/configs/A20-OLinuXino-Lime2-eMMC_defconfig 
b/configs/A20-OLinuXino-Lime2-eMMC_defconfig
index 9491708d80c6..a04037ebe7cc 100644
--- a/configs/A20-OLinuXino-Lime2-eMMC_defconfig
+++ b/configs/A20-OLinuXino-Lime2-eMMC_defconfig
@@ -33,4 +33,3 @@ CONFIG_SCSI=y
 CONFIG_USB_EHCI_HCD=y
 CONF

[U-Boot] [PATCH 07/13] sunxi: provide default USB gadget setup

2017-09-08 Thread Maxime Ripard
All the Allwinner boards use the same manufacturer, VID and PID for the
gadgets. Make them the defaults to remove some boilerplate from our
defconfigs.

Signed-off-by: Maxime Ripard 
---
 configs/A13-OLinuXino_defconfig| 3 ---
 configs/A20-OLinuXino-Lime2-eMMC_defconfig | 3 ---
 configs/A20-OLinuXino-Lime2_defconfig  | 3 ---
 configs/CHIP_defconfig | 3 ---
 configs/CHIP_pro_defconfig | 3 ---
 configs/Cubietruck_defconfig   | 3 ---
 configs/Nintendo_NES_Classic_Edition_defconfig | 3 ---
 configs/Sinlinx_SinA33_defconfig   | 3 ---
 configs/parrot_r16_defconfig   | 3 ---
 drivers/usb/gadget/Kconfig | 3 +++
 10 files changed, 3 insertions(+), 27 deletions(-)

diff --git a/configs/A13-OLinuXino_defconfig b/configs/A13-OLinuXino_defconfig
index 2574018d8213..ae790164dff7 100644
--- a/configs/A13-OLinuXino_defconfig
+++ b/configs/A13-OLinuXino_defconfig
@@ -32,7 +32,4 @@ CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_MUSB_GADGET=y
 CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
 CONFIG_USB_GADGET=y
-CONFIG_USB_GADGET_MANUFACTURER="Allwinner Technology"
-CONFIG_USB_GADGET_VENDOR_NUM=0x1f3a
-CONFIG_USB_GADGET_PRODUCT_NUM=0x1010
 CONFIG_USB_GADGET_DOWNLOAD=y
diff --git a/configs/A20-OLinuXino-Lime2-eMMC_defconfig 
b/configs/A20-OLinuXino-Lime2-eMMC_defconfig
index 5663a824e71b..b136af66b71f 100644
--- a/configs/A20-OLinuXino-Lime2-eMMC_defconfig
+++ b/configs/A20-OLinuXino-Lime2-eMMC_defconfig
@@ -34,7 +34,4 @@ CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_MUSB_GADGET=y
 CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
 CONFIG_USB_GADGET=y
-CONFIG_USB_GADGET_MANUFACTURER="Allwinner Technology"
-CONFIG_USB_GADGET_VENDOR_NUM=0x1f3a
-CONFIG_USB_GADGET_PRODUCT_NUM=0x1010
 CONFIG_USB_GADGET_DOWNLOAD=y
diff --git a/configs/A20-OLinuXino-Lime2_defconfig 
b/configs/A20-OLinuXino-Lime2_defconfig
index 63d013293690..ebb435f30956 100644
--- a/configs/A20-OLinuXino-Lime2_defconfig
+++ b/configs/A20-OLinuXino-Lime2_defconfig
@@ -33,7 +33,4 @@ CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_MUSB_GADGET=y
 CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
 CONFIG_USB_GADGET=y
-CONFIG_USB_GADGET_MANUFACTURER="Allwinner Technology"
-CONFIG_USB_GADGET_VENDOR_NUM=0x1f3a
-CONFIG_USB_GADGET_PRODUCT_NUM=0x1010
 CONFIG_USB_GADGET_DOWNLOAD=y
diff --git a/configs/CHIP_defconfig b/configs/CHIP_defconfig
index 278039c05573..7d50d0533dcd 100644
--- a/configs/CHIP_defconfig
+++ b/configs/CHIP_defconfig
@@ -23,8 +23,5 @@ CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_MUSB_GADGET=y
 CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
 CONFIG_USB_GADGET=y
-CONFIG_USB_GADGET_MANUFACTURER="Allwinner Technology"
-CONFIG_USB_GADGET_VENDOR_NUM=0x1f3a
-CONFIG_USB_GADGET_PRODUCT_NUM=0x1010
 CONFIG_USB_GADGET_DOWNLOAD=y
 CONFIG_OF_LIBFDT_OVERLAY=y
diff --git a/configs/CHIP_pro_defconfig b/configs/CHIP_pro_defconfig
index edbdefc69ddf..76daf477ec87 100644
--- a/configs/CHIP_pro_defconfig
+++ b/configs/CHIP_pro_defconfig
@@ -28,8 +28,5 @@ CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_MUSB_GADGET=y
 CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
 CONFIG_USB_GADGET=y
-CONFIG_USB_GADGET_MANUFACTURER="Allwinner Technology"
-CONFIG_USB_GADGET_VENDOR_NUM=0x1f3a
-CONFIG_USB_GADGET_PRODUCT_NUM=0x1010
 CONFIG_USB_GADGET_DOWNLOAD=y
 CONFIG_OF_LIBFDT_OVERLAY=y
diff --git a/configs/Cubietruck_defconfig b/configs/Cubietruck_defconfig
index 2d1753645b0f..1b2989d364f6 100644
--- a/configs/Cubietruck_defconfig
+++ b/configs/Cubietruck_defconfig
@@ -33,7 +33,4 @@ CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_MUSB_GADGET=y
 CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
 CONFIG_USB_GADGET=y
-CONFIG_USB_GADGET_MANUFACTURER="Allwinner Technology"
-CONFIG_USB_GADGET_VENDOR_NUM=0x1f3a
-CONFIG_USB_GADGET_PRODUCT_NUM=0x1010
 CONFIG_USB_GADGET_DOWNLOAD=y
diff --git a/configs/Nintendo_NES_Classic_Edition_defconfig 
b/configs/Nintendo_NES_Classic_Edition_defconfig
index 99f7d30f150d..5986764a14b9 100644
--- a/configs/Nintendo_NES_Classic_Edition_defconfig
+++ b/configs/Nintendo_NES_Classic_Edition_defconfig
@@ -23,7 +23,4 @@ CONFIG_AXP_ELDO2_VOLT=1800
 CONFIG_USB_MUSB_GADGET=y
 CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
 CONFIG_USB_GADGET=y
-CONFIG_USB_GADGET_MANUFACTURER="Allwinner Technology"
-CONFIG_USB_GADGET_VENDOR_NUM=0x1f3a
-CONFIG_USB_GADGET_PRODUCT_NUM=0x1010
 CONFIG_USB_GADGET_DOWNLOAD=y
diff --git a/configs/Sinlinx_SinA33_defconfig b/configs/Sinlinx_SinA33_defconfig
index 8c5fc7587909..9299aedd6019 100644
--- a/configs/Sinlinx_SinA33_defconfig
+++ b/configs/Sinlinx_SinA33_defconfig
@@ -28,7 +28,4 @@ CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_MUSB_GADGET=y
 CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
 CONFIG_USB_GADGET=y
-CONFIG_USB_GADGET_MANUFACTURER="Allwinner Technology"
-CONFIG_USB_GADGET_VENDOR_NUM=0x1f3a
-CONFIG_USB_GADGET_PRODUCT_NUM=0x1010
 CONFIG_USB_GADGET_DOWNLOAD=y
diff --git a/configs/parrot_r16_defconfig b/configs/parrot_r16_defconfig
index 4b70fc5687eb..57db9587fe77 100644
--- a/configs/parrot_r16_defconfig
+++ b/configs/parrot_r16_defconfig
@@ -24,7

[U-Boot] [PATCH 05/13] usb: gadget: Make g_dnl USB settings common

2017-09-08 Thread Maxime Ripard
The g_dnl USB settings for the vendor ID, product ID and manufacturer are
actually common settings that can and should be shared by all the gadgets.

Make them common by renaming them, and convert all the users.

Signed-off-by: Maxime Ripard 
---
 board/samsung/common/gadget.c|  4 ++--
 board/siemens/common/factoryset.c|  4 ++--
 configs/A13-OLinuXino_defconfig  |  6 +++---
 configs/A20-OLinuXino-Lime2-eMMC_defconfig   |  6 +++---
 configs/A20-OLinuXino-Lime2_defconfig|  6 +++---
 configs/CHIP_defconfig   |  6 +++---
 configs/CHIP_pro_defconfig   |  6 +++---
 configs/Cubietruck_defconfig |  6 +++---
 configs/Nintendo_NES_Classic_Edition_defconfig   |  6 +++---
 configs/Sinlinx_SinA33_defconfig |  6 +++---
 configs/am335x_baltos_defconfig  |  6 +++---
 configs/am335x_boneblack_defconfig   |  6 +++---
 configs/am335x_boneblack_vboot_defconfig |  6 +++---
 configs/am335x_evm_defconfig |  6 +++---
 configs/am335x_evm_nor_defconfig |  6 +++---
 configs/am335x_evm_norboot_defconfig |  6 +++---
 configs/am335x_evm_spiboot_defconfig |  6 +++---
 configs/am335x_evm_usbspl_defconfig  |  6 +++---
 configs/am335x_hs_evm_defconfig  |  6 +++---
 configs/am43xx_evm_defconfig |  6 +++---
 configs/am43xx_evm_ethboot_defconfig |  6 +++---
 configs/am43xx_evm_qspiboot_defconfig|  6 +++---
 configs/am43xx_evm_usbhost_boot_defconfig|  6 +++---
 configs/am43xx_hs_evm_defconfig  |  6 +++---
 configs/am57xx_evm_defconfig |  6 +++---
 configs/am57xx_evm_nodt_defconfig|  6 +++---
 configs/am57xx_hs_evm_defconfig  |  6 +++---
 configs/apalis-tk1_defconfig |  6 +++---
 configs/apalis_imx6_defconfig|  6 +++---
 configs/apalis_imx6_nospl_com_defconfig  |  6 +++---
 configs/apalis_imx6_nospl_it_defconfig   |  6 +++---
 configs/apalis_t30_defconfig |  6 +++---
 configs/bcm11130_defconfig   |  6 +++---
 configs/bcm11130_nand_defconfig  |  6 +++---
 configs/bcm23550_w1d_defconfig   |  6 +++---
 configs/bcm28155_ap_defconfig|  6 +++---
 configs/bcm28155_w1d_defconfig   |  6 +++---
 configs/beaver_defconfig |  6 +++---
 configs/birdland_bav335a_defconfig   |  6 +++---
 configs/birdland_bav335b_defconfig   |  6 +++---
 configs/cei-tk1-som_defconfig|  6 +++---
 configs/cgtqmx6eval_defconfig|  6 +++---
 configs/chromebit_mickey_defconfig   |  6 +++---
 configs/chromebook_jerry_defconfig   |  6 +++---
 configs/chromebook_minnie_defconfig  |  6 +++---
 configs/colibri_imx6_defconfig   |  6 +++---
 configs/colibri_imx6_nospl_defconfig |  6 +++---
 configs/colibri_imx7_defconfig   |  6 +++---
 configs/colibri_t20_defconfig|  6 +++---
 configs/colibri_t30_defconfig|  6 +++---
 configs/colibri_vf_defconfig |  6 +++---
 configs/corvus_defconfig |  6 +++---
 configs/dalmore_defconfig|  6 +++---
 configs/dms-ba16-1g_defconfig|  6 +++---
 configs/dms-ba16_defconfig   |  6 +++---
 configs/dra7xx_evm_defconfig |  6 +++---
 configs/dra7xx_hs_evm_defconfig  |  6 +++---
 configs/draco_defconfig  |  6 +++---
 configs/e2220-1170_defconfig |  6 +++---
 configs/edison_defconfig |  6 +++---
 configs/etamin_defconfig |  6 +++---
 configs/evb-rk3036_defconfig |  6 +++---
 configs/evb-rk3229_defconfig |  6 +++---
 configs/evb-rk3288_defconfig |  6 +++---
 configs/evb-rk3328_defconfig |  6 +++---
 configs/fennec-rk3288_defconfig  |  6 +++---
 configs/firefly-rk3288_defconfig |  6 +++---
 configs/gwventana_emmc_defconfig |  6 +++---
 configs/gwventana_gw5904_defconfig   |  6 +++---
 configs/gwventana_nand_defconfig |  6 +++---
 configs/jetson-tk1_defconfig |  6 +++---
 configs/kc1_defconfig|  6 +++---
 configs/kylin-rk3036_defconfig   |  6 +++---
 configs/ma5d4evk_defconfig   |  6 +++---
 configs/miqi-rk3288_defconfig|  6 +++---
 configs/mx6qsabrelite_defconfig  |  6 +++---
 configs/mx6sabreauto_defconfig 

[U-Boot] [PATCH 08/13] sunxi: imply USB_GADGET

2017-09-08 Thread Maxime Ripard
A good number of our boards have USB_GADGET enabled. Imply it so that all
the boards can benefit from it, and remove some boilerplate from our
defconfigs.

Signed-off-by: Maxime Ripard 
---
 arch/arm/Kconfig   | 1 +
 configs/A13-OLinuXino_defconfig| 1 -
 configs/A20-OLinuXino-Lime2-eMMC_defconfig | 1 -
 configs/A20-OLinuXino-Lime2_defconfig  | 1 -
 configs/CHIP_defconfig | 1 -
 configs/CHIP_pro_defconfig | 1 -
 configs/Cubietruck_defconfig   | 1 -
 configs/Nintendo_NES_Classic_Edition_defconfig | 1 -
 configs/Sinlinx_SinA33_defconfig   | 1 -
 configs/parrot_r16_defconfig   | 1 -
 10 files changed, 1 insertion(+), 9 deletions(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 65805f115279..449fd164b040 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -705,6 +705,7 @@ config ARCH_SUNXI
imply SPL_POWER_SUPPORT
imply SPL_SERIAL_SUPPORT
imply USB_FUNCTION_FASTBOOT
+   imply USB_GADGET
 
 config TARGET_TS4600
bool "Support TS4600"
diff --git a/configs/A13-OLinuXino_defconfig b/configs/A13-OLinuXino_defconfig
index ae790164dff7..e55dbff44d36 100644
--- a/configs/A13-OLinuXino_defconfig
+++ b/configs/A13-OLinuXino_defconfig
@@ -31,5 +31,4 @@ CONFIG_AXP_ALDO3_VOLT=3300
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_MUSB_GADGET=y
 CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
-CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_DOWNLOAD=y
diff --git a/configs/A20-OLinuXino-Lime2-eMMC_defconfig 
b/configs/A20-OLinuXino-Lime2-eMMC_defconfig
index b136af66b71f..9491708d80c6 100644
--- a/configs/A20-OLinuXino-Lime2-eMMC_defconfig
+++ b/configs/A20-OLinuXino-Lime2-eMMC_defconfig
@@ -33,5 +33,4 @@ CONFIG_SCSI=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_MUSB_GADGET=y
 CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
-CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_DOWNLOAD=y
diff --git a/configs/A20-OLinuXino-Lime2_defconfig 
b/configs/A20-OLinuXino-Lime2_defconfig
index ebb435f30956..2bb8ee8c9ebd 100644
--- a/configs/A20-OLinuXino-Lime2_defconfig
+++ b/configs/A20-OLinuXino-Lime2_defconfig
@@ -32,5 +32,4 @@ CONFIG_SCSI=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_MUSB_GADGET=y
 CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
-CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_DOWNLOAD=y
diff --git a/configs/CHIP_defconfig b/configs/CHIP_defconfig
index 7d50d0533dcd..b9f70d240c3c 100644
--- a/configs/CHIP_defconfig
+++ b/configs/CHIP_defconfig
@@ -22,6 +22,5 @@ CONFIG_AXP_ALDO4_VOLT=3300
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_MUSB_GADGET=y
 CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
-CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_DOWNLOAD=y
 CONFIG_OF_LIBFDT_OVERLAY=y
diff --git a/configs/CHIP_pro_defconfig b/configs/CHIP_pro_defconfig
index 76daf477ec87..74f6eb10fc01 100644
--- a/configs/CHIP_pro_defconfig
+++ b/configs/CHIP_pro_defconfig
@@ -27,6 +27,5 @@ CONFIG_AXP_ALDO4_VOLT=3300
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_MUSB_GADGET=y
 CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
-CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_DOWNLOAD=y
 CONFIG_OF_LIBFDT_OVERLAY=y
diff --git a/configs/Cubietruck_defconfig b/configs/Cubietruck_defconfig
index 1b2989d364f6..458e2a9d8b04 100644
--- a/configs/Cubietruck_defconfig
+++ b/configs/Cubietruck_defconfig
@@ -32,5 +32,4 @@ CONFIG_SCSI=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_MUSB_GADGET=y
 CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
-CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_DOWNLOAD=y
diff --git a/configs/Nintendo_NES_Classic_Edition_defconfig 
b/configs/Nintendo_NES_Classic_Edition_defconfig
index 5986764a14b9..e031dd8f5d5f 100644
--- a/configs/Nintendo_NES_Classic_Edition_defconfig
+++ b/configs/Nintendo_NES_Classic_Edition_defconfig
@@ -22,5 +22,4 @@ CONFIG_AXP_DLDO1_VOLT=3300
 CONFIG_AXP_ELDO2_VOLT=1800
 CONFIG_USB_MUSB_GADGET=y
 CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
-CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_DOWNLOAD=y
diff --git a/configs/Sinlinx_SinA33_defconfig b/configs/Sinlinx_SinA33_defconfig
index 9299aedd6019..143a9b4b6c10 100644
--- a/configs/Sinlinx_SinA33_defconfig
+++ b/configs/Sinlinx_SinA33_defconfig
@@ -27,5 +27,4 @@ CONFIG_DFU_RAM=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_MUSB_GADGET=y
 CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
-CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_DOWNLOAD=y
diff --git a/configs/parrot_r16_defconfig b/configs/parrot_r16_defconfig
index 57db9587fe77..b36b9efec650 100644
--- a/configs/parrot_r16_defconfig
+++ b/configs/parrot_r16_defconfig
@@ -23,5 +23,4 @@ CONFIG_FASTBOOT_FLASH_MMC_DEV=0
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_MUSB_GADGET=y
 CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
-CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_DOWNLOAD=y
-- 
git-series 0.9.1
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH 03/13] usb: gadget: Convert USB_ETHER to Kconfig

2017-09-08 Thread Maxime Ripard
The USB Ethernet gadget option has not yet been moved to Kconfig, let's
deal with that.

Signed-off-by: Maxime Ripard 
---
 configs/am335x_baltos_defconfig  |  1 +
 configs/am335x_boneblack_defconfig   |  1 +
 configs/am335x_boneblack_vboot_defconfig |  1 +
 configs/am335x_evm_defconfig |  1 +
 configs/am335x_evm_nor_defconfig |  1 +
 configs/am335x_evm_norboot_defconfig |  1 +
 configs/am335x_evm_spiboot_defconfig |  1 +
 configs/am335x_evm_usbspl_defconfig  |  1 +
 configs/am335x_hs_evm_defconfig  |  1 +
 configs/draco_defconfig  |  1 +
 configs/etamin_defconfig |  1 +
 configs/gwventana_emmc_defconfig |  1 +
 configs/gwventana_gw5904_defconfig   |  1 +
 configs/gwventana_nand_defconfig |  1 +
 configs/ma5d4evk_defconfig   |  1 +
 configs/mx6qsabrelite_defconfig  |  1 +
 configs/nitrogen6dl2g_defconfig  |  1 +
 configs/nitrogen6dl_defconfig|  1 +
 configs/nitrogen6q2g_defconfig   |  1 +
 configs/nitrogen6q_defconfig |  1 +
 configs/nitrogen6s1g_defconfig   |  1 +
 configs/nitrogen6s_defconfig |  1 +
 configs/novena_defconfig |  1 +
 configs/omap3_beagle_defconfig   |  1 +
 configs/omap3_evm_defconfig  |  1 +
 configs/omap3_logic_defconfig|  1 +
 configs/pcm051_rev1_defconfig|  1 +
 configs/pcm051_rev3_defconfig|  1 +
 configs/pxm2_defconfig   |  1 +
 configs/rastaban_defconfig   |  1 +
 configs/rut_defconfig|  1 +
 configs/sama5d2_ptc_nandflash_defconfig  |  1 +
 configs/sama5d2_ptc_spiflash_defconfig   |  1 +
 configs/sansa_fuze_plus_defconfig|  1 +
 configs/thuban_defconfig |  1 +
 configs/vinco_defconfig  |  1 +
 configs/warp7_defconfig  |  1 +
 configs/warp7_secure_defconfig   |  1 +
 configs/xfi3_defconfig   |  1 +
 drivers/usb/gadget/Kconfig   | 10 ++
 include/configs/am335x_evm.h |  1 -
 include/configs/am3517_evm.h |  1 -
 include/configs/baltos.h |  1 -
 include/configs/gw_ventana.h |  1 -
 include/configs/h2200.h  |  1 -
 include/configs/ma5d4evk.h   |  1 -
 include/configs/nitrogen6x.h |  1 -
 include/configs/novena.h |  1 -
 include/configs/omap3_beagle.h   |  1 -
 include/configs/omap3_evm.h  |  1 -
 include/configs/omap3_logic.h|  1 -
 include/configs/pcm051.h |  1 -
 include/configs/sama5d2_ptc.h|  1 -
 include/configs/sansa_fuze_plus.h|  1 -
 include/configs/siemens-am33x-common.h   |  1 -
 include/configs/tao3530.h|  1 -
 include/configs/vinco.h  |  1 -
 include/configs/warp7.h  |  1 -
 include/configs/xfi3.h   |  1 -
 scripts/config_whitelist.txt |  1 -
 60 files changed, 49 insertions(+), 20 deletions(-)

diff --git a/configs/am335x_baltos_defconfig b/configs/am335x_baltos_defconfig
index be057acf8634..2f075091b27a 100644
--- a/configs/am335x_baltos_defconfig
+++ b/configs/am335x_baltos_defconfig
@@ -63,6 +63,7 @@ CONFIG_USB_GADGET_DOWNLOAD=y
 CONFIG_G_DNL_MANUFACTURER="Texas Instruments"
 CONFIG_G_DNL_VENDOR_NUM=0x0403
 CONFIG_G_DNL_PRODUCT_NUM=0xbd00
+CONFIG_USB_ETHER=y
 CONFIG_USBNET_HOST_ADDR="de:ad:be:af:00:00"
 CONFIG_FAT_WRITE=y
 CONFIG_OF_LIBFDT=y
diff --git a/configs/am335x_boneblack_defconfig 
b/configs/am335x_boneblack_defconfig
index 719d16b145eb..a3dd9b03b538 100644
--- a/configs/am335x_boneblack_defconfig
+++ b/configs/am335x_boneblack_defconfig
@@ -42,6 +42,7 @@ CONFIG_USB_GADGET_DOWNLOAD=y
 CONFIG_G_DNL_MANUFACTURER="Texas Instruments"
 CONFIG_G_DNL_VENDOR_NUM=0x0451
 CONFIG_G_DNL_PRODUCT_NUM=0xd022
+CONFIG_USB_ETHER=y
 CONFIG_USBNET_HOST_ADDR="de:ad:be:af:00:00"
 CONFIG_LZO=y
 CONFIG_OF_LIBFDT=y
diff --git a/configs/am335x_boneblack_vboot_defconfig 
b/configs/am335x_boneblack_vboot_defconfig
index 0a239bb73399..7d52382c24dc 100644
--- a/configs/am335x_boneblack_vboot_defconfig
+++ b/configs/am335x_boneblack_vboot_defconfig
@@ -52,4 +52,5 @@ CONFIG_USB_GADGET_DOWNLOAD=y
 CONFIG_G_DNL_MANUFACTURER="Texas Instruments"
 CONFIG_G_DNL_VENDOR_NUM=0x0451
 CONFIG_G_DNL_PRODUCT_NUM=0xd022
+CONFIG_USB_ETHER=y
 CONFIG_LZO=y
diff --git a/configs/am335x_evm_defconfig b/configs/am335x_evm_defconfig
index 00c1af43449d..69b2cf3e1f61 100644
--- a/configs/am335x_evm_defconfig
+++ b/configs/am335x_evm_defconfig
@@ -54,6 +54,7 @@ CONFIG_USB_GADGET_DOWNLOAD=y
 CONFIG_G_DNL_MANUFACTURER="Texas Instruments"
 CONFIG_G_DNL_VENDOR_NUM=0x0451
 CONFIG_G_DNL_PRODUCT_NUM=0xd022
+CONFIG_USB_ETHER=y
 CONFIG_RSA=y
 CONFIG_LZO=y
 CONFIG_OF_LIBFDT_OVERLAY=y
diff --git a/configs/am335x_evm_nor_defconfig b/configs/am335x_evm_nor_defconfig
index 9f08edff4ca5..708d

[U-Boot] [PATCH 04/13] usb: gadget: usb_ether: Move the interfaces to Kconfig

2017-09-08 Thread Maxime Ripard
We need to select an interface for the usb_ether gadget, and they haven't
been converted to Kconfig yet. Add a choice to make sure we have an option
selected, and convert all the users.

Signed-off-by: Maxime Ripard 
---
 configs/gwventana_emmc_defconfig   |  1 +
 configs/gwventana_gw5904_defconfig |  1 +
 configs/gwventana_nand_defconfig   |  1 +
 configs/mx6qsabrelite_defconfig|  1 +
 configs/nitrogen6dl2g_defconfig|  1 +
 configs/nitrogen6dl_defconfig  |  1 +
 configs/nitrogen6q2g_defconfig |  1 +
 configs/nitrogen6q_defconfig   |  1 +
 configs/nitrogen6s1g_defconfig |  1 +
 configs/nitrogen6s_defconfig   |  1 +
 configs/novena_defconfig   |  1 +
 configs/sansa_fuze_plus_defconfig  |  1 +
 configs/warp7_defconfig|  1 +
 configs/warp7_secure_defconfig |  1 +
 configs/xfi3_defconfig |  1 +
 drivers/usb/gadget/Kconfig | 12 
 include/configs/am335x_evm.h   |  4 
 include/configs/am3517_evm.h   |  4 
 include/configs/baltos.h   |  4 
 include/configs/gw_ventana.h   |  1 -
 include/configs/ma5d4evk.h |  1 -
 include/configs/nitrogen6x.h   |  1 -
 include/configs/novena.h   |  1 -
 include/configs/pcm051.h   |  4 
 include/configs/sama5d2_ptc.h  |  1 -
 include/configs/sansa_fuze_plus.h  |  1 -
 include/configs/siemens-am33x-common.h |  4 
 include/configs/vinco.h|  1 -
 include/configs/warp7.h|  2 --
 include/configs/xfi3.h |  1 -
 scripts/config_whitelist.txt   |  2 --
 31 files changed, 27 insertions(+), 32 deletions(-)

diff --git a/configs/gwventana_emmc_defconfig b/configs/gwventana_emmc_defconfig
index 34b7a200ffbc..17ca9c9af46e 100644
--- a/configs/gwventana_emmc_defconfig
+++ b/configs/gwventana_emmc_defconfig
@@ -69,6 +69,7 @@ CONFIG_G_DNL_MANUFACTURER="Gateworks"
 CONFIG_G_DNL_VENDOR_NUM=0x0525
 CONFIG_G_DNL_PRODUCT_NUM=0xa4a5
 CONFIG_USB_ETHER=y
+CONFIG_USB_ETH_CDC=y
 # CONFIG_VIDEO_SW_CURSOR is not set
 CONFIG_OF_LIBFDT=y
 CONFIG_FDT_FIXUP_PARTITIONS=y
diff --git a/configs/gwventana_gw5904_defconfig 
b/configs/gwventana_gw5904_defconfig
index 4ad0f867222e..906bac282139 100644
--- a/configs/gwventana_gw5904_defconfig
+++ b/configs/gwventana_gw5904_defconfig
@@ -73,6 +73,7 @@ CONFIG_G_DNL_MANUFACTURER="Gateworks"
 CONFIG_G_DNL_VENDOR_NUM=0x0525
 CONFIG_G_DNL_PRODUCT_NUM=0xa4a5
 CONFIG_USB_ETHER=y
+CONFIG_USB_ETH_CDC=y
 # CONFIG_VIDEO_SW_CURSOR is not set
 CONFIG_OF_LIBFDT=y
 CONFIG_FDT_FIXUP_PARTITIONS=y
diff --git a/configs/gwventana_nand_defconfig b/configs/gwventana_nand_defconfig
index b58f27418815..05fb98c62ce8 100644
--- a/configs/gwventana_nand_defconfig
+++ b/configs/gwventana_nand_defconfig
@@ -72,6 +72,7 @@ CONFIG_G_DNL_MANUFACTURER="Gateworks"
 CONFIG_G_DNL_VENDOR_NUM=0x0525
 CONFIG_G_DNL_PRODUCT_NUM=0xa4a5
 CONFIG_USB_ETHER=y
+CONFIG_USB_ETH_CDC=y
 # CONFIG_VIDEO_SW_CURSOR is not set
 CONFIG_OF_LIBFDT=y
 CONFIG_FDT_FIXUP_PARTITIONS=y
diff --git a/configs/mx6qsabrelite_defconfig b/configs/mx6qsabrelite_defconfig
index bab0d0c79f0d..f716c8fd7f77 100644
--- a/configs/mx6qsabrelite_defconfig
+++ b/configs/mx6qsabrelite_defconfig
@@ -55,5 +55,6 @@ CONFIG_G_DNL_MANUFACTURER="Boundary"
 CONFIG_G_DNL_VENDOR_NUM=0x0525
 CONFIG_G_DNL_PRODUCT_NUM=0xa4a5
 CONFIG_USB_ETHER=y
+CONFIG_USB_ETH_CDC=y
 # CONFIG_VIDEO_SW_CURSOR is not set
 CONFIG_OF_LIBFDT=y
diff --git a/configs/nitrogen6dl2g_defconfig b/configs/nitrogen6dl2g_defconfig
index 0d19b85a30f3..fd4a46558129 100644
--- a/configs/nitrogen6dl2g_defconfig
+++ b/configs/nitrogen6dl2g_defconfig
@@ -52,5 +52,6 @@ CONFIG_G_DNL_MANUFACTURER="Boundary"
 CONFIG_G_DNL_VENDOR_NUM=0x0525
 CONFIG_G_DNL_PRODUCT_NUM=0xa4a5
 CONFIG_USB_ETHER=y
+CONFIG_USB_ETH_CDC=y
 # CONFIG_VIDEO_SW_CURSOR is not set
 CONFIG_OF_LIBFDT=y
diff --git a/configs/nitrogen6dl_defconfig b/configs/nitrogen6dl_defconfig
index a20580eb77bb..30046e3f3a07 100644
--- a/configs/nitrogen6dl_defconfig
+++ b/configs/nitrogen6dl_defconfig
@@ -52,5 +52,6 @@ CONFIG_G_DNL_MANUFACTURER="Boundary"
 CONFIG_G_DNL_VENDOR_NUM=0x0525
 CONFIG_G_DNL_PRODUCT_NUM=0xa4a5
 CONFIG_USB_ETHER=y
+CONFIG_USB_ETH_CDC=y
 # CONFIG_VIDEO_SW_CURSOR is not set
 CONFIG_OF_LIBFDT=y
diff --git a/configs/nitrogen6q2g_defconfig b/configs/nitrogen6q2g_defconfig
index 940c74a5ece2..f9160c208fe7 100644
--- a/configs/nitrogen6q2g_defconfig
+++ b/configs/nitrogen6q2g_defconfig
@@ -53,5 +53,6 @@ CONFIG_G_DNL_MANUFACTURER="Boundary"
 CONFIG_G_DNL_VENDOR_NUM=0x0525
 CONFIG_G_DNL_PRODUCT_NUM=0xa4a5
 CONFIG_USB_ETHER=y
+CONFIG_USB_ETH_CDC=y
 # CONFIG_VIDEO_SW_CURSOR is not set
 CONFIG_OF_LIBFDT=y
diff --git a/configs/nitrogen6q_defconfig b/configs/nitrogen6q_defconfig
index 83772cb2efcf..8bca0e04439e 100644
--- a/configs/nitrogen6q_defconfig
+++ b/configs/nitrogen6q_defconfig
@@ -53,5 +53,6 @@ CONFIG_G_DNL_MANUFACTURER="Boundary

[U-Boot] [PATCH 01/13] usb: gadget: Move USBNET_DEVADDR option out of g_dnl

2017-09-08 Thread Maxime Ripard
The USBNET_DEVADDR has nothing to do with the USB download gadget, but
rather with the USB Ethernet gadget. Move it out of the if statement.

Signed-off-by: Maxime Ripard 
---
 drivers/usb/gadget/Kconfig | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig
index 225b66bc95ff..d52626908846 100644
--- a/drivers/usb/gadget/Kconfig
+++ b/drivers/usb/gadget/Kconfig
@@ -119,10 +119,10 @@ config G_DNL_VENDOR_NUM
 config G_DNL_PRODUCT_NUM
hex "Product ID of USB device"
 
+endif # USB_GADGET_DOWNLOAD
+
 config USBNET_DEVADDR
string "USB Gadget Ethernet device mac address"
default "de:ad:be:ef:00:01"
 
-endif # USB_GADGET_DOWNLOAD
-
 endif # USB_GADGET
-- 
git-series 0.9.1
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH 02/13] usb: gadget: Move USBNET_HOST_ADDR to Kconfig

2017-09-08 Thread Maxime Ripard
While the USB Ethernet device address is already defined in Kconfig, the
host address isn't. Convert it.

Signed-off-by: Maxime Ripard 
---
 configs/am335x_baltos_defconfig| 1 +
 configs/am335x_boneblack_defconfig | 1 +
 configs/am335x_evm_norboot_defconfig   | 1 +
 configs/pxm2_defconfig | 1 +
 configs/rastaban_defconfig | 1 +
 configs/warp7_defconfig| 1 +
 configs/warp7_secure_defconfig | 1 +
 drivers/usb/gadget/Kconfig | 4 
 include/configs/am335x_evm.h   | 1 -
 include/configs/baltos.h   | 1 -
 include/configs/h2200.h| 1 -
 include/configs/siemens-am33x-common.h | 1 -
 include/configs/warp7.h| 1 -
 scripts/config_whitelist.txt   | 1 -
 14 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/configs/am335x_baltos_defconfig b/configs/am335x_baltos_defconfig
index eb8338f0f10d..be057acf8634 100644
--- a/configs/am335x_baltos_defconfig
+++ b/configs/am335x_baltos_defconfig
@@ -63,5 +63,6 @@ CONFIG_USB_GADGET_DOWNLOAD=y
 CONFIG_G_DNL_MANUFACTURER="Texas Instruments"
 CONFIG_G_DNL_VENDOR_NUM=0x0403
 CONFIG_G_DNL_PRODUCT_NUM=0xbd00
+CONFIG_USBNET_HOST_ADDR="de:ad:be:af:00:00"
 CONFIG_FAT_WRITE=y
 CONFIG_OF_LIBFDT=y
diff --git a/configs/am335x_boneblack_defconfig 
b/configs/am335x_boneblack_defconfig
index b8526fc15ed3..719d16b145eb 100644
--- a/configs/am335x_boneblack_defconfig
+++ b/configs/am335x_boneblack_defconfig
@@ -42,6 +42,7 @@ CONFIG_USB_GADGET_DOWNLOAD=y
 CONFIG_G_DNL_MANUFACTURER="Texas Instruments"
 CONFIG_G_DNL_VENDOR_NUM=0x0451
 CONFIG_G_DNL_PRODUCT_NUM=0xd022
+CONFIG_USBNET_HOST_ADDR="de:ad:be:af:00:00"
 CONFIG_LZO=y
 CONFIG_OF_LIBFDT=y
 CONFIG_OF_LIBFDT_OVERLAY=y
diff --git a/configs/am335x_evm_norboot_defconfig 
b/configs/am335x_evm_norboot_defconfig
index c5e7425a7797..c9eab68c8299 100644
--- a/configs/am335x_evm_norboot_defconfig
+++ b/configs/am335x_evm_norboot_defconfig
@@ -35,6 +35,7 @@ CONFIG_USB_GADGET_DOWNLOAD=y
 CONFIG_G_DNL_MANUFACTURER="Texas Instruments"
 CONFIG_G_DNL_VENDOR_NUM=0x0451
 CONFIG_G_DNL_PRODUCT_NUM=0xd022
+CONFIG_USBNET_HOST_ADDR="de:ad:be:af:00:00"
 CONFIG_LZO=y
 CONFIG_OF_LIBFDT=y
 CONFIG_OF_LIBFDT_OVERLAY=y
diff --git a/configs/pxm2_defconfig b/configs/pxm2_defconfig
index 38370ee8d8f5..b1da71d4c7ed 100644
--- a/configs/pxm2_defconfig
+++ b/configs/pxm2_defconfig
@@ -74,6 +74,7 @@ CONFIG_USB_GADGET_DOWNLOAD=y
 CONFIG_G_DNL_MANUFACTURER="Siemens AG"
 CONFIG_G_DNL_VENDOR_NUM=0x0908
 CONFIG_G_DNL_PRODUCT_NUM=0x02d2
+CONFIG_USBNET_HOST_ADDR="de:ad:be:af:00:00"
 # CONFIG_VIDEO_SW_CURSOR is not set
 CONFIG_SYS_CONSOLE_BG_COL=0xff
 CONFIG_SYS_CONSOLE_FG_COL=0x00
diff --git a/configs/rastaban_defconfig b/configs/rastaban_defconfig
index 5acfe22b0a6d..940c4144d406 100644
--- a/configs/rastaban_defconfig
+++ b/configs/rastaban_defconfig
@@ -70,3 +70,4 @@ CONFIG_USB_GADGET_DOWNLOAD=y
 CONFIG_G_DNL_MANUFACTURER="Siemens AG"
 CONFIG_G_DNL_VENDOR_NUM=0x0908
 CONFIG_G_DNL_PRODUCT_NUM=0x02d2
+CONFIG_USBNET_HOST_ADDR="de:ad:be:af:00:00"
diff --git a/configs/warp7_defconfig b/configs/warp7_defconfig
index 99fe800317c2..f430f30bbbe5 100644
--- a/configs/warp7_defconfig
+++ b/configs/warp7_defconfig
@@ -38,4 +38,5 @@ CONFIG_USB_GADGET_DOWNLOAD=y
 CONFIG_G_DNL_MANUFACTURER="FSL"
 CONFIG_G_DNL_VENDOR_NUM=0x0525
 CONFIG_G_DNL_PRODUCT_NUM=0xa4a5
+CONFIG_USBNET_HOST_ADDR="de:ad:be:af:00:00"
 CONFIG_OF_LIBFDT=y
diff --git a/configs/warp7_secure_defconfig b/configs/warp7_secure_defconfig
index 8beda72cd882..96e2c9e5cfde 100644
--- a/configs/warp7_secure_defconfig
+++ b/configs/warp7_secure_defconfig
@@ -36,4 +36,5 @@ CONFIG_USB_GADGET_DOWNLOAD=y
 CONFIG_G_DNL_MANUFACTURER="FSL"
 CONFIG_G_DNL_VENDOR_NUM=0x0525
 CONFIG_G_DNL_PRODUCT_NUM=0xa4a5
+CONFIG_USBNET_HOST_ADDR="de:ad:be:af:00:00"
 CONFIG_OF_LIBFDT=y
diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig
index d52626908846..84c8bf84da5f 100644
--- a/drivers/usb/gadget/Kconfig
+++ b/drivers/usb/gadget/Kconfig
@@ -125,4 +125,8 @@ config USBNET_DEVADDR
string "USB Gadget Ethernet device mac address"
default "de:ad:be:ef:00:01"
 
+config USBNET_HOST_ADDR
+   string "USB Gadget Ethernet host mac address"
+   default "de:ad:be:ef:00:00"
+
 endif # USB_GADGET
diff --git a/include/configs/am335x_evm.h b/include/configs/am335x_evm.h
index 415ce46e0d8d..7c025c7e46c8 100644
--- a/include/configs/am335x_evm.h
+++ b/include/configs/am335x_evm.h
@@ -266,7 +266,6 @@
 #ifdef CONFIG_USB_MUSB_GADGET
 #define CONFIG_USB_ETHER
 #define CONFIG_USB_ETH_RNDIS
-#define CONFIG_USBNET_HOST_ADDR"de:ad:be:af:00:00"
 #endif /* CONFIG_USB_MUSB_GADGET */
 
 /*
diff --git a/include/configs/baltos.h b/include/configs/baltos.h
index 185c749d7868..535fdd4373b0 100644
--- a/include/configs/baltos.h
+++ b/include/configs/baltos.h
@@ -286,7 +286,6 @@
 #ifdef CONFIG_USB_MUSB_GADGET
 #define CONFIG_USB_ETHER
 #define CONFIG_USB_ETH_RNDIS
-#define CONFIG_USBNET_HOST_ADDR"de:ad

[U-Boot] [PATCH 12/13] sunxi: Imply USB_ETHER

2017-09-08 Thread Maxime Ripard
Now that we can enable the usb_ether gadget, do it. This will be especially
useful for boards that don't have any ethernet controller, such as the ones
based on the A13 or A33.

Signed-off-by: Maxime Ripard 
---
 arch/arm/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 58c06ebb076e..04d91e954455 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -703,6 +703,7 @@ config ARCH_SUNXI
imply SPL_MMC_SUPPORT if MMC
imply SPL_POWER_SUPPORT
imply SPL_SERIAL_SUPPORT
+   imply USB_ETHER
imply USB_GADGET
 
 config TARGET_TS4600
-- 
git-series 0.9.1
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH 10/13] musb: sunxi: switch to the device model

2017-09-08 Thread Maxime Ripard
The device model was implemented so far using a hook that needed to be
called from the board support, without DT support and only for the host.

Switch to probing both in peripheral and host mode through the DT.

Signed-off-by: Maxime Ripard 
---
 arch/arm/include/asm/arch-sunxi/usb_phy.h |  7 +---
 board/sunxi/board.c   |  1 +-
 drivers/usb/musb-new/sunxi.c  | 56 +++-
 3 files changed, 27 insertions(+), 37 deletions(-)

diff --git a/arch/arm/include/asm/arch-sunxi/usb_phy.h 
b/arch/arm/include/asm/arch-sunxi/usb_phy.h
index cef6c985bc8d..5a9cacb6f4a3 100644
--- a/arch/arm/include/asm/arch-sunxi/usb_phy.h
+++ b/arch/arm/include/asm/arch-sunxi/usb_phy.h
@@ -19,10 +19,3 @@ void sunxi_usb_phy_power_off(int index);
 int sunxi_usb_phy_vbus_detect(int index);
 int sunxi_usb_phy_id_detect(int index);
 void sunxi_usb_phy_enable_squelch_detect(int index, int enable);
-
-/* Not really phy related, but we have to declare this somewhere ... */
-#if defined(CONFIG_USB_MUSB_HOST) || defined(CONFIG_USB_MUSB_GADGET)
-void sunxi_musb_board_init(void);
-#else
-#define sunxi_musb_board_init()
-#endif
diff --git a/board/sunxi/board.c b/board/sunxi/board.c
index 70e01437c4f4..f9224360d758 100644
--- a/board/sunxi/board.c
+++ b/board/sunxi/board.c
@@ -736,7 +736,6 @@ int misc_init_r(void)
if (ret)
return ret;
 #endif
-   sunxi_musb_board_init();
 
return 0;
 }
diff --git a/drivers/usb/musb-new/sunxi.c b/drivers/usb/musb-new/sunxi.c
index 5c1a902e42dc..7ee44ea91900 100644
--- a/drivers/usb/musb-new/sunxi.c
+++ b/drivers/usb/musb-new/sunxi.c
@@ -308,9 +308,6 @@ static struct musb_hdrc_platform_data musb_plat = {
.platform_ops   = &sunxi_musb_ops,
 };
 
-#ifdef CONFIG_USB_MUSB_HOST
-static int musb_usb_remove(struct udevice *dev);
-
 static int musb_usb_probe(struct udevice *dev)
 {
struct musb_host_data *host = dev_get_priv(dev);
@@ -319,16 +316,20 @@ static int musb_usb_probe(struct udevice *dev)
 
priv->desc_before_addr = true;
 
+#ifdef CONFIG_USB_MUSB_HOST
host->host = musb_init_controller(&musb_plat, NULL,
  (void *)SUNXI_USB0_BASE);
if (!host->host)
return -EIO;
 
ret = musb_lowlevel_init(host);
-   if (ret == 0)
-   printf("MUSB OTG\n");
-   else
-   musb_usb_remove(dev);
+   if (!ret)
+   printf("Allwinner mUSB OTG (Host)\n");
+#else
+   ret = musb_register(&musb_plat, NULL, (void *)SUNXI_USB0_BASE);
+   if (!ret)
+   printf("Allwinner mUSB OTG (Peripheral)\n");
+#endif
 
return ret;
 }
@@ -352,30 +353,27 @@ static int musb_usb_remove(struct udevice *dev)
return 0;
 }
 
-U_BOOT_DRIVER(usb_musb) = {
-   .name   = "sunxi-musb",
-   .id = UCLASS_USB,
-   .probe = musb_usb_probe,
-   .remove = musb_usb_remove,
-   .ops= &musb_usb_ops,
-   .platdata_auto_alloc_size = sizeof(struct usb_platdata),
-   .priv_auto_alloc_size = sizeof(struct musb_host_data),
+static const struct udevice_id sunxi_musb_ids[] = {
+   { .compatible = "allwinner,sun4i-a10-musb" },
+   { .compatible = "allwinner,sun6i-a31-musb" },
+   { .compatible = "allwinner,sun8i-a33-musb" },
+   { .compatible = "allwinner,sun8i-h3-musb" },
+   { }
 };
-#endif
 
-void sunxi_musb_board_init(void)
-{
+U_BOOT_DRIVER(usb_musb) = {
+   .name   = "sunxi-musb",
 #ifdef CONFIG_USB_MUSB_HOST
-   struct udevice *dev;
-
-   /*
-* Bind the driver directly for now as musb linux kernel support is
-* still pending upstream so our dts files do not have the necessary
-* nodes yet. TODO: Remove this as soon as the dts nodes are in place
-* and bind by compatible instead.
-*/
-   device_bind_driver(dm_root(), "sunxi-musb", "sunxi-musb", &dev);
+   .id = UCLASS_USB,
 #else
-   musb_register(&musb_plat, NULL, (void *)SUNXI_USB0_BASE);
+   .id = UCLASS_USB_DEV_GENERIC,
 #endif
-}
+   .of_match   = sunxi_musb_ids,
+   .probe  = musb_usb_probe,
+   .remove = musb_usb_remove,
+#ifdef CONFIG_USB_MUSB_HOST
+   .ops= &musb_usb_ops,
+#endif
+   .platdata_auto_alloc_size = sizeof(struct usb_platdata),
+   .priv_auto_alloc_size = sizeof(struct musb_host_data),
+};
-- 
git-series 0.9.1
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH 11/13] sunxi: Register usb_ether

2017-09-08 Thread Maxime Ripard
Call the function to register the usb_ether gadget in the board.

Signed-off-by: Maxime Ripard 
---
 board/sunxi/board.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/board/sunxi/board.c b/board/sunxi/board.c
index f9224360d758..610fa89056ef 100644
--- a/board/sunxi/board.c
+++ b/board/sunxi/board.c
@@ -737,6 +737,8 @@ int misc_init_r(void)
return ret;
 #endif
 
+   usb_ether_init();
+
return 0;
 }
 
-- 
git-series 0.9.1
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH 00/13] sunxi: convert musb to the device model and enable usb_ether

2017-09-08 Thread Maxime Ripard
Hi,

This serie aims at fixing an issue we had to carry out of tree patches
for for a few years.

The issue is this: a significant number of Allwinner boards don't have
an Ethernet connection, while an Ethernet connection is pretty useful
for example during development to do some PXE/NFS boot.

However, we needed to have DM_ETH enabled for the boards that use our
Ethernet controller drivers that rely on it. It meant having to use
the newly introduced DM_ETH support in the usb_ether gadget, but our
musb peripheral wasn't converted to the device model, and therefore
not usable with it.

The other alternative was to use the old-style usb_ether driver, which
worked fine but were disabling the Ethernet controller driver.

Thus, none were good, upstreamable solution.

Fix this properly by adding support for the musb in peripheral mode in
the device model. While we're doing so, I also took the occasion to
move a number of configuration options to Kconfig, and rework the
dependencies between them to ease the selection of related options
while trying to avoid as much as possible the combinations that are
not valid.

This was tested on a Sinlinx SinA33 that is wired as a peripheral-only
mUSB.

Let me know what you think,
Maxime

Maxime Ripard (13):
  usb: gadget: Move USBNET_DEVADDR option out of g_dnl
  usb: gadget: Move USBNET_HOST_ADDR to Kconfig
  usb: gadget: Convert USB_ETHER to Kconfig
  usb: gadget: usb_ether: Move the interfaces to Kconfig
  usb: gadget: Make g_dnl USB settings common
  usb: gadget: usb_ether: Move settings to common
  sunxi: provide default USB gadget setup
  sunxi: imply USB_GADGET
  cmd: fastboot: Rework fastboot dependency
  musb: sunxi: switch to the device model
  sunxi: Register usb_ether
  sunxi: Imply USB_ETHER
  sunxi: sina33: Sync the device tree with the kernel

 arch/arm/Kconfig |   4 +-
 arch/arm/dts/axp223.dtsi |  58 ++-
 arch/arm/dts/axp22x.dtsi |  10 +-
 arch/arm/dts/sun8i-a23-a33.dtsi  | 446 ++-
 arch/arm/dts/sun8i-a33-sinlinx-sina33.dts|  43 +-
 arch/arm/dts/sun8i-a33.dtsi  | 477 +---
 arch/arm/include/asm/arch-sunxi/usb_phy.h|   7 +-
 board/samsung/common/gadget.c|   4 +-
 board/siemens/common/factoryset.c|   4 +-
 board/sunxi/board.c  |   3 +-
 cmd/fastboot/Kconfig |   4 +-
 configs/A13-OLinuXino_defconfig  |   5 +-
 configs/A20-OLinuXino-Lime2-eMMC_defconfig   |   5 +-
 configs/A20-OLinuXino-Lime2_defconfig|   5 +-
 configs/CHIP_defconfig   |   5 +-
 configs/CHIP_pro_defconfig   |   5 +-
 configs/Cubietruck_defconfig |   5 +-
 configs/Nintendo_NES_Classic_Edition_defconfig   |   5 +-
 configs/Sinlinx_SinA33_defconfig |   5 +-
 configs/am335x_baltos_defconfig  |   8 +-
 configs/am335x_boneblack_defconfig   |  10 +-
 configs/am335x_boneblack_vboot_defconfig |   9 +-
 configs/am335x_evm_defconfig |   9 +-
 configs/am335x_evm_nor_defconfig |   9 +-
 configs/am335x_evm_norboot_defconfig |  10 +-
 configs/am335x_evm_spiboot_defconfig |   9 +-
 configs/am335x_evm_usbspl_defconfig  |   9 +-
 configs/am335x_hs_evm_defconfig  |   7 +-
 configs/am43xx_evm_defconfig |   6 +-
 configs/am43xx_evm_ethboot_defconfig |   6 +-
 configs/am43xx_evm_qspiboot_defconfig|   6 +-
 configs/am43xx_evm_usbhost_boot_defconfig|   6 +-
 configs/am43xx_hs_evm_defconfig  |   6 +-
 configs/am57xx_evm_defconfig |   8 +-
 configs/am57xx_evm_nodt_defconfig|   9 +-
 configs/am57xx_hs_evm_defconfig  |   8 +-
 configs/apalis-tk1_defconfig |   6 +-
 configs/apalis_imx6_defconfig|   6 +-
 configs/apalis_imx6_nospl_com_defconfig  |   6 +-
 configs/apalis_imx6_nospl_it_defconfig   |   6 +-
 configs/apalis_t30_defconfig |   6 +-
 configs/bcm11130_defconfig   |   6 +-
 configs/bcm11130_nand_defconfig  |   6 +-
 configs/bcm23550_w1d_defconfig   |   9 +-
 configs/bcm28155_ap_defconfig|   9 +-
 configs/bcm28155_w1d_defconfig   |   6 +-
 configs/beaver_defconfig |   6 +-
 configs/birdland_bav335a_defconfig   |   9 +-
 configs/birdland_bav335b_defconfig   |   9 +-
 configs/cei-tk1-som_defconfig|   6 +-
 configs/cgtqmx6eval_defconfig|   9 +-
 configs/chromebit_mickey_defconfig   |   7 +-
 configs/chromebook_jerry_defconfig   |   7 +-
 configs/chromebook_min

Re: [U-Boot] [PATCH] env: Migrate CONFIG_ENV_AES to Kconfig and deprecate

2017-09-08 Thread Tom Rini
On Fri, Sep 08, 2017 at 01:13:59PM -0400, Tom Rini wrote:

> The underlying implementation for ENV_AES has security complications and
> is not recommended for use.  Please see CVE-2017-3225 and CVE-2017-3226
> for more details.  Mark this as deprecated now and delete this in the
> medium term if no one comes forward to re-work the support.
> 
> Signed-off-by: Tom Rini 

Applied to u-boot/master, thanks!

-- 
Tom


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


[U-Boot] [PATCH] env: Migrate CONFIG_ENV_AES to Kconfig and deprecate

2017-09-08 Thread Tom Rini
The underlying implementation for ENV_AES has security complications and
is not recommended for use.  Please see CVE-2017-3225 and CVE-2017-3226
for more details.  Mark this as deprecated now and delete this in the
medium term if no one comes forward to re-work the support.

Signed-off-by: Tom Rini 
---
 env/Kconfig  | 8 
 scripts/config_whitelist.txt | 1 -
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/env/Kconfig b/env/Kconfig
index f12ef2863458..024d4d79bd49 100644
--- a/env/Kconfig
+++ b/env/Kconfig
@@ -375,6 +375,14 @@ config ENV_IS_IN_UBI
 
 endchoice
 
+config ENV_AES
+   bool "AES-128 encryption for stored environment (DEPRECATED)"
+   help
+ Enable this to have the on-device stored environment be encrypted
+ with AES-128.  The implementation here however has security
+ complications and is not recommended for use.  Please see
+ CVE-2017-3225 and CVE-2017-3226 for more details.
+
 config ENV_FAT_INTERFACE
string "Name of the block device for the environment"
depends on ENV_IS_IN_FAT
diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt
index a9fb068e925b..9ce0c3f039ff 100644
--- a/scripts/config_whitelist.txt
+++ b/scripts/config_whitelist.txt
@@ -574,7 +574,6 @@ CONFIG_ENV_ACCESS_IGNORE_FORCE
 CONFIG_ENV_ADDR
 CONFIG_ENV_ADDR_FLEX
 CONFIG_ENV_ADDR_REDUND
-CONFIG_ENV_AES
 CONFIG_ENV_BASE
 CONFIG_ENV_CALLBACK_LIST_DEFAULT
 CONFIG_ENV_CALLBACK_LIST_STATIC
-- 
1.9.1

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


Re: [U-Boot] [PATCH v2 0/8] imx: add USB Serial Download Protocol (SDP) support

2017-09-08 Thread Stefan Agner
Hi Vincent,

On 2017-09-08 01:27, Vincent Prince wrote:
> Hi everyone,
> 
> I managed to get SDP protocol to work with on my custom i.MX6 board,
> so big thanks to Stefan for your work!
> 
> I'm now trying to load swupdate ramdisk with u-boot sdp command,
> without success.
> Is it a possible use case ?

Yes it should work, we use the U-Boot sdp command to download a squashfs
based ramdisk in our Toradex Easy Installer:
http://developer.toradex.com/software/toradex-easy-installer

> 
> Here my steps:
> 
> In u-boot:
> => sdp 0
> 
> On Host,
> $ imx_usb
> 
> config file 
> vid=0x15a2 pid=0x0061 file_name=mx6_usb_rom.conf -> vid=0x0525
> pid=0xb4a4 file_name=mx6_usb_sdp_spl.conf
> vid=0x0525 pid=0xa4a5 file_name=mx6_usb_uboot.conf
> config file 
> parse C:\Users\vpr\IMXUSBLOADER2\delivery\\mx6_usb_uboot.conf
> Trying to open device vid=0x0525 pid=0xa4a5.
> Could not open device vid=0x0525 pid=0xa4a5

Is VID/PID showing up in Device Manager?

We did saw some problems with certain USB host implementation, so it
might be a device dependency... I would also try a different
machine/maybe Linux machine...

> 
> VID/PID in imx_usb.conf are correctly detected, and correct
> configuration file is launched (mx6_usb_uboot.conf),
> it contains:
> 
> mx6_usb_sdp_uboot
> hid,1024,0x1000,1G,0x00907000,0x31000
> test.txt:load 0x1210
> 
> My imx_usb.conf is the following:
> 
> #vid:pid, config_file
> 0x15a2:0x0061, mx6_usb_rom.conf, 0x0525:0xb4a4, mx6_usb_sdp_spl.conf
> 0x0525:0xa4a5, mx6_usb_uboot.conf

Yeah assuming you use the Toradex branch of imx_loader currently this
should work.

Our script looks like this:
mx6_usb_sdp_uboot
#hid/bulk,[old_header,]max packet size, {ram start, ram size}(repeat
valid ram areas)
hid,1024,0x1000,1G,0x00907000,0x31000
#Load complete FIT image to $ramdisk_addr_r
tezi.itb:load 0x1210
#Load script to $loadaddr and jump to it
boot-sdp.scr:load 0x1200,jump 0x1200

--
Stefan


> 
> Am I missing something,
> Thanks,
> Vincent
> 
> 2017-09-01 22:09 GMT+02:00 Stefan Agner :
>>
>>
>> On September 1, 2017 12:25:44 PM PDT, Fabio Estevam  
>> wrote:
>>>On Fri, Sep 1, 2017 at 3:54 PM, Fabio Estevam 
>>>wrote:
>>>
 I have tested this method and it works, thanks.

 Do you plan to usptream this method?
>>>
>>>Or I can also put your patch as part of my series that adds SDP
>>>support for imx6qsabresd if you prefer.
>>
>> Let me do a separate, I guess it could be controversial...
>>
>> --
>> Stefan
>> --
>> Sent from my Android device with K-9 Mail. Please excuse my brevity.
>> ___
>> 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


Re: [U-Boot] [U-Boot, v3, 4/5] usb: net: migrate USB Ethernet adapters to Kconfig

2017-09-08 Thread Tom Rini
On Mon, Aug 28, 2017 at 08:50:46PM +1200, Chris Packham wrote:

> This migrates ASIX, ASIX88179, MCS7830, RTL8152 and SMSC95XX to Kconfig.
> Update defconfigs.
> 
> Signed-off-by: Chris Packham 
> Reviewed-by: Simon Glass 

Applied to u-boot/master, 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] [U-Boot, v3, 3/5] usb: net: migrate CONFIG_USB_HOST_ETHER to Kconfig

2017-09-08 Thread Tom Rini
On Mon, Aug 28, 2017 at 08:50:45PM +1200, Chris Packham wrote:

> CONFIG_USB_HOST_ETHER is the framework that the drivers are dependent on
> USB_HOST_ETHER. Use this as a menu and move the existing LAN75XX and
> LAN78XX options under new menu. Finally update the defconfigs that need
> CONFIG_USB_HOST_ETHER.
> 
> Signed-off-by: Chris Packham 
> Reviewed-by: Simon Glass 

Applied to u-boot/master, 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] [U-Boot, v3, 5/5] usb: doc: update README.usb for new config options

2017-09-08 Thread Tom Rini
On Mon, Aug 28, 2017 at 08:50:47PM +1200, Chris Packham wrote:

> A number of the config options for USB networking have been migrated to
> Kconfig. Update README.usb to reflect this.
> 
> Signed-off-by: Chris Packham 

Applied to u-boot/master, 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] [U-Boot,v3,1/5] Kconfig: drop CONFIG_USB_ETHER_DM9601

2017-09-08 Thread Tom Rini
On Mon, Aug 28, 2017 at 08:50:43PM +1200, Chris Packham wrote:

> This is not a valid option. Drop it.
> 
> Signed-off-by: Chris Packham 
> Reviewed-by: Simon Glass 

Applied to u-boot/master, 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] [U-Boot,v3,2/5] Kconfig: drop CONFIG_USB_ETHER_RNDIS

2017-09-08 Thread Tom Rini
On Mon, Aug 28, 2017 at 08:50:44PM +1200, Chris Packham wrote:

> This is not a valid option. Drop it.
> 
> Signed-off-by: Chris Packham 
> Reviewed-by: Simon Glass 

Applied to u-boot/master, 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] README: Fix typo in description of CONFIG_OF_EMBED

2017-09-08 Thread Tom Rini
On Sat, Aug 26, 2017 at 07:34:14AM +0900, Nobuhiro Iwamatsu wrote:

> The correct name is 'gd->fdt_blob', not 'gd->blob'.
> 
> Signed-off-by: Nobuhiro Iwamatsu 
> CC: Simon Glass 
> Reviewed-by: Simon Glass 

Applied to u-boot/master, 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] Starting u-boot in USB otg mode

2017-09-08 Thread 'Maxime Ripard'
On Fri, Sep 08, 2017 at 04:45:31PM +0300, rivael_il wrote:
> It got compiled. But the u-boot-sunxi-with-spl.bin still generate HOST
> controller rather than Peripheral USB.
> I can't see it in lsusb.
> 
> Here is the u-boot console:
> 
> => usb stop
> stopping USB..
> => usb tree
> USB is stopped. Please issue 'usb start' first.
> => usb start
> starting USB...
> USB0:   USB EHCI 1.00
> USB1:   USB OHCI 1.0
> USB2:   USB EHCI 1.00
> USB3:   USB OHCI 1.0
> scanning bus 0 for devices... 1 USB Device(s) found
> scanning bus 2 for devices... 1 USB Device(s) found
>scanning usb for storage devices... 0 Storage Device(s) found
> => usb tree
> USB device tree:
>   1  Hub (480 Mb/s, 0mA)
>  u-boot EHCI Host Controller
> 
>   1  Hub (480 Mb/s, 0mA)
>  u-boot EHCI Host Controller

Those are all host only commands. What are you trying to do, and which
gadgets are you trying to use?

Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com


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


Re: [U-Boot] [PULL] Please pull u-boot-rockchip/master

2017-09-08 Thread Tom Rini
On Fri, Sep 08, 2017 at 12:15:48PM +0200, Dr. Philipp Tomsich wrote:

> Tom,
> 
> There’s two more bug-fixes for the Rockchip board available.
> Please pull.
> 
> Thanks,
> Philipp.
> 
> 
> The following changes since commit 25f840d7ef440442f290e760459714a068487727:
> 
>   ARM: rmobile: Disable CONFIG_ARCH_FIXUP_FDT_MEMORY (2017-09-07 20:04:41 
> -0400)
> 
> are available in the git repository at:
> 
>   git://git.denx.de/u-boot-rockchip.git master
> 
> for you to fetch changes up to 0532ceef30b735fe24c0cb4f77fb1717bd55c7ee:
> 
>   rockchip: enable SPL_SYSRESET config for all Rockchip SoCs (2017-09-08 
> 11:45:19 +0200)
> 

Applied to u-boot/master, 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] Starting u-boot in USB otg mode

2017-09-08 Thread rivael_il
It got compiled. But the u-boot-sunxi-with-spl.bin still generate HOST
controller rather than Peripheral USB.
I can't see it in lsusb.

Here is the u-boot console:

=> usb stop
stopping USB..
=> usb tree
USB is stopped. Please issue 'usb start' first.
=> usb start
starting USB...
USB0:   USB EHCI 1.00
USB1:   USB OHCI 1.0
USB2:   USB EHCI 1.00
USB3:   USB OHCI 1.0
scanning bus 0 for devices... 1 USB Device(s) found
scanning bus 2 for devices... 1 USB Device(s) found
   scanning usb for storage devices... 0 Storage Device(s) found
=> usb tree
USB device tree:
  1  Hub (480 Mb/s, 0mA)
 u-boot EHCI Host Controller

  1  Hub (480 Mb/s, 0mA)
 u-boot EHCI Host Controller

=>
U-Boot SPL 2017.09-rc2-00168-g90ae53c-dirty (Sep 08 2017 - 11:26:35)
DRAM: 1024 MiB


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


Re: [U-Boot] Starting u-boot in USB otg mode

2017-09-08 Thread 'Maxime Ripard'
On Fri, Sep 08, 2017 at 03:38:42PM +0300, rivael_il wrote:
> Thank you Maxime!
> 
> I have removed the USB_HOST configuration. Now I get:
> 
> LD  u-boot
> drivers/usb/host/built-in.o: In function `ehci_usb_remove':
> /home/pi/otg/mikboot/u-boot/drivers/usb/host/ehci-sunxi.c:78: undefined
> reference to `ehci_deregister'
> drivers/usb/host/built-in.o: In function `ehci_usb_probe':
> /home/pi/otg/mikboot/u-boot/drivers/usb/host/ehci-sunxi.c:69: undefined
> reference to `ehci_register'
> drivers/usb/host/built-in.o:(.u_boot_list_2_driver_2_ehci_sunxi+0x3c):
> undefined reference to `ehci_usb_ops'
> arm-linux-gnueabihf-ld.bfd: BFD (GNU Binutils for Raspbian) 2.25 assertion
> fail ../../bfd/elf32-arm.c:7827
> arm-linux-gnueabihf-ld.bfd: BFD (GNU Binutils for Raspbian) 2.25 assertion
> fail ../../bfd/elf32-arm.c:7827
> arm-linux-gnueabihf-ld.bfd: error: required section '.rel.plt' not found in
> the linker script
> arm-linux-gnueabihf-ld.bfd: final link failed: Invalid operation
> Makefile:1255: recipe for target 'u-boot' failed
> make: *** [u-boot] Error 1

You should keep USB_HOST.

Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com


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


Re: [U-Boot] mv88e61xx autoneg doesn't work with new driver

2017-09-08 Thread Clément Péron
Hi,

After some investigation i found that the phy_reset of the Marvell
doesn't reup the PHY and the ANEG bits.

The issue has been introduce by the commit
a058052c358c3ecf5f394ff37def6a45eb26768c

"net: phy: do not read configuration register on reset

When doing a software reset, the reset flag should be written without
other bits set. Writing the current state will lead to restoring the
state of the PHY (e.g. Powerdown), which is not what is expected from
a software reset."

Regards,
Clement

2017-08-31 11:12 GMT+02:00 Clément Péron :
> Hi,
>
> I try to update my u-boot with the latest version 2017.07.
>
> My board is an Altera SocFPGA CycloneV and I have a mv88e61xx switch.
>
> My board is working fine except I got an issue with the new switch driver.
> If autoneg is set to enable, negotation never complete and i got a timeout.
> If I let the autoneg disable, I have ethernet working but with slow
> speed 10mbits / half duplex.
>
> Not sure if i'm doing something wrong or if there is a bug in the new driver.
>
> Could you please help me to debug this issue ?
>
> Thanks for your help,
> Regards,
> Clement
>
> KConfig
> 
> --- Marvel MV88E61xx Ethernet switch PHY support.
> (5)   CPU Port
> (0x1F) Bitmask of PHY Ports
> (0x0) Bitmask of PHYless serdes Ports
>
>
> board.c
> 
>  int mv88e61xx_hw_reset(struct phy_device *phydev)
>  {
>  struct mii_dev *bus = phydev->bus;
>
>  /* RGMII delay - Physical Control register bit[15:14] */
>  debug("setting port%d RGMII rx/tx delay\n", 
> CONFIG_MV88E61XX_CPU_PORT);
>  /* forced 1000mbps full-duplex link */
>  bus->write(bus, 0x10 + CONFIG_MV88E61XX_CPU_PORT, 0, 1, 0xc0fe);
>  phydev->autoneg = AUTONEG_ENABLE;
>  phydev->speed = SPEED_1000;
>  phydev->duplex = DUPLEX_FULL;
>
>  return 0;
>  }
>
> serial
> 
> U-Boot SPL 2017.07-9-g9f00f9622e-dirty (Aug 31 2017 - 10:52:53)
> drivers/ddr/altera/sequencer.c: Preparing to start memory calibration
> drivers/ddr/altera/sequencer.c: CALIBRATION PASSED
> drivers/ddr/altera/sequencer.c: Calibration complete
> Trying to boot from SPI
>
>
> U-Boot 2017.07-9-g9f00f9622e-dirty (Aug 31 2017 - 10:52:53 +0200)
>
> CPU:   Altera SoCFPGA Platform
> FPGA:  Altera Cyclone V, SE/A4 or SX/C4, version 0x0
> BOOT:  QSPI Flash (3.0V)
>Watchdog enabled
> DRAM:  512 MiB
> MMC:   dwmmc0@ff704000: 0
> *** Warning - bad CRC, using default environment
>
> In:serial
> Out:   serial
> Err:   serial
> Model: Board
> Net:   setting port5 RGMII rx/tx delay
>
> Warning: ethernet@ff702000 (eth0) using random MAC address - 2e:91:a1:21:8e:38
> eth0: ethernet@ff702000
> Hit any key to stop autoboot:  0
> => tftp ${rootaddr} rootfs.cpio.uboot; tftp ${dtb_loadaddr} board.dtb;
> tftp ${loadaddr} uImage; bootm ${loadaddr} ${rootaddr} ${dtb_loadadd}
> ethernet@ff702000 Waiting for PHY auto negotiation to
> complete. TIMEOUT !
> ethernet@ff702000 Waiting for PHY auto negotiation to
> complete. TIMEOUT !
> ethernet@ff702000 Waiting for PHY auto negotiation to
> complete. TIMEOUT !
> ethernet@ff702000 Waiting for PHY auto negotiation to
> complete. TIMEOUT !
> ethernet@ff702000 Waiting for PHY auto negotiation to
> complete. TIMEOUT !
> ethernet@ff702000: No link.
> ethernet@ff702000 Waiting for PHY auto negotiation to
> complete. TIMEOUT !
> ethernet@ff702000 Waiting for PHY auto negotiation to
> complete. TIMEOUT !
> ethernet@ff702000 Waiting for PHY auto negotiation to
> complete. TIMEOUT !
> ethernet@ff702000 Waiting for PHY auto negotiation to
> complete. TIMEOUT !
> ethernet@ff702000 Waiting for PHY auto negotiation to
> complete. TIMEOUT !
> ethernet@ff702000: No link.
> ethernet@ff702000 Waiting for PHY auto negotiation to
> complete. TIMEOUT !
> ethernet@ff702000 Waiting for PHY auto negotiation to
> complete. TIMEOUT !
> ethernet@ff702000 Waiting for PHY auto negotiation to
> complete. TIMEOUT !
> ethernet@ff702000 Waiting for PHY auto negotiation to
> complete. TIMEOUT !
> ethernet@ff702000 Waiting for PHY auto negotiation to
> complete. TIMEOUT !
> ethernet@ff702000: No link.
> ...
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] Starting u-boot in USB otg mode

2017-09-08 Thread rivael_il
Thank you Maxime!

I have removed the USB_HOST configuration. Now I get:

LD  u-boot
drivers/usb/host/built-in.o: In function `ehci_usb_remove':
/home/pi/otg/mikboot/u-boot/drivers/usb/host/ehci-sunxi.c:78: undefined
reference to `ehci_deregister'
drivers/usb/host/built-in.o: In function `ehci_usb_probe':
/home/pi/otg/mikboot/u-boot/drivers/usb/host/ehci-sunxi.c:69: undefined
reference to `ehci_register'
drivers/usb/host/built-in.o:(.u_boot_list_2_driver_2_ehci_sunxi+0x3c):
undefined reference to `ehci_usb_ops'
arm-linux-gnueabihf-ld.bfd: BFD (GNU Binutils for Raspbian) 2.25 assertion
fail ../../bfd/elf32-arm.c:7827
arm-linux-gnueabihf-ld.bfd: BFD (GNU Binutils for Raspbian) 2.25 assertion
fail ../../bfd/elf32-arm.c:7827
arm-linux-gnueabihf-ld.bfd: error: required section '.rel.plt' not found in
the linker script
arm-linux-gnueabihf-ld.bfd: final link failed: Invalid operation
Makefile:1255: recipe for target 'u-boot' failed
make: *** [u-boot] Error 1

Here is my .config USB reference:
-
CONFIG_INITIAL_USB_SCAN_DELAY=0
CONFIG_USB0_VBUS_PIN=""
CONFIG_USB0_VBUS_DET=""
CONFIG_USB0_ID_DET=""
CONFIG_USB1_VBUS_PIN=""
CONFIG_USB2_VBUS_PIN=""
CONFIG_USB3_VBUS_PIN=""
# CONFIG_SPL_MUSB_NEW_SUPPORT is not set
# CONFIG_SPL_USB_HOST_SUPPORT is not set
# CONFIG_SPL_USB_GADGET_SUPPORT is not set
CONFIG_CMD_USB=y
# CONFIG_CMD_USB_MASS_STORAGE is not set
CONFIG_USB=y
CONFIG_DM_USB=y
# USB Host Controller Drivers
# CONFIG_USB_XHCI_HCD is not set
# CONFIG_USB_EHCI_HCD is not set
# CONFIG_USB_OHCI_HCD is not set
# CONFIG_USB_UHCI_HCD is not set
# CONFIG_USB_DWC2 is not set
# CONFIG_USB_DWC3 is not set
# MUSB Controller Driver
# CONFIG_USB_MUSB_HOST is not set
CONFIG_USB_MUSB_GADGET=y
# CONFIG_USB_MUSB_TI is not set
CONFIG_USB_MUSB_SUNXI=y
# USB peripherals
CONFIG_USB_STORAGE=y
CONFIG_USB_KEYBOARD=y
CONFIG_USB_GADGET=y
# CONFIG_USB_GADGET_ATMEL_USBA is not set
# CONFIG_USB_GADGET_BCM_UDC_OTG_PHY is not set
# CONFIG_USB_GADGET_DWC2_OTG is not set
CONFIG_USB_GADGET_VBUS_DRAW=2
CONFIG_USB_GADGET_DUALSPEED=y
# CONFIG_USB_GADGET_DOWNLOAD is not set
# USB to Ethernet Controller Drivers
# CONFIG_USB_ETHER_LAN75XX is not set
# CONFIG_USB_ETHER_LAN78XX is not set

Can you tell me how to fix this?

Michael


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


Re: [U-Boot] [PATCH 2/2] rockchip: ram: rk3399: update reg map for of-platdata

2017-09-08 Thread Simon Glass
Hi Kever,

On 8 September 2017 at 01:34, Dr. Philipp Tomsich
 wrote:
>
>
> > On 8 Sep 2017, at 04:46, Kever Yang  wrote:
> >
> > Philipp,
> >
> >We already enable CONFIG_SPL_OF_CONTROL for all rk3399 board, right?
>
> I meant “full OF_CONTROL” as opposed to “OF_PLATDATA” (which is dependent
> of OF_CONTROL, but is intended as a stopgap measure).
>
> >For OF_PLATDATA, I would prefer there always have a  option to use for
> > speed up the boot time, not only for ram size.
>
> I had discussed that with Simon recently and he views OF_PLATDATA as a last
> resort to be used, when there is not enough memory for full OF_CONTROL.


Can you use bootstage to measure the boot time impact?

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


[U-Boot] [PULL] Please pull u-boot-rockchip/master

2017-09-08 Thread Dr. Philipp Tomsich
Tom,

There’s two more bug-fixes for the Rockchip board available.
Please pull.

Thanks,
Philipp.


The following changes since commit 25f840d7ef440442f290e760459714a068487727:

  ARM: rmobile: Disable CONFIG_ARCH_FIXUP_FDT_MEMORY (2017-09-07 20:04:41 -0400)

are available in the git repository at:

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

for you to fetch changes up to 0532ceef30b735fe24c0cb4f77fb1717bd55c7ee:

  rockchip: enable SPL_SYSRESET config for all Rockchip SoCs (2017-09-08 
11:45:19 +0200)


Kever Yang (2):
  rockchip: rk3328: fix syscon id table
  rockchip: enable SPL_SYSRESET config for all Rockchip SoCs

 arch/arm/Kconfig  | 1 +
 arch/arm/mach-rockchip/rk3328/syscon_rk3328.c | 1 +
 2 files changed, 2 insertions(+)

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


Re: [U-Boot] rockchip: enable SPL_SYSRESET config for all sockchip SoCs

2017-09-08 Thread Philipp Tomsich
> After the patch below, we need to add SPL_SYSRESET for do_reset()
> in SPL:
> 87c16d4 drivers: spl: consistently use the $(SPL_TPL_) macro
> 
> Signed-off-by: Kever Yang 
> ---
> 
>  arch/arm/Kconfig | 1 +
>  1 file changed, 1 insertion(+)
> 

Applied to u-boot-rockchip, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] rockchip: rk3328: fix syscon id table

2017-09-08 Thread Philipp Tomsich
> syscon id table need a dummy member as NULL ending, or else system
> will panic while try to match a compatible in this table as a list.
> 
> Signed-off-by: Kever Yang 
> ---
> 
>  arch/arm/mach-rockchip/rk3328/syscon_rk3328.c | 1 +
>  1 file changed, 1 insertion(+)
> 

Applied to u-boot-rockchip, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH] rockchip: enable SPL_SYSRESET config for all sockchip SoCs

2017-09-08 Thread Dr. Philipp Tomsich
Kever,

Note that this patch applies neither to master nor to next cleanly.
Given that it’s a single line change, I’ll patch this in by hand.

Thanks,
Philipp.


> On 8 Sep 2017, at 05:00, Kever Yang  wrote:
> 
> After the patch below, we need to add SPL_SYSRESET for do_reset()
> in SPL:
> 87c16d4 drivers: spl: consistently use the $(SPL_TPL_) macro
> 
> Signed-off-by: Kever Yang 
> ---
> 
> arch/arm/Kconfig | 1 +
> 1 file changed, 1 insertion(+)
> 
> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> index e01b72e..7872cfd 100644
> --- a/arch/arm/Kconfig
> +++ b/arch/arm/Kconfig
> @@ -1118,6 +1118,7 @@ config ARCH_ROCKCHIP
>   imply USB_FUNCTION_FASTBOOT
>   imply USB_FUNCTION_ROCKUSB
>   imply CMD_ROCKUSB
> + imply SPL_SYSRESET
> 
> config TARGET_THUNDERX_88XX
>   bool "Support ThunderX 88xx"
> -- 
> 1.9.1
> 

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


Re: [U-Boot] rockchip: enable SPL_SYSRESET config for all sockchip SoCs

2017-09-08 Thread Philipp Tomsich
> After the patch below, we need to add SPL_SYSRESET for do_reset()
> in SPL:
> 87c16d4 drivers: spl: consistently use the $(SPL_TPL_) macro
> 
> Signed-off-by: Kever Yang 
> ---
> 
>  arch/arm/Kconfig | 1 +
>  1 file changed, 1 insertion(+)
> 

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


Re: [U-Boot] rockchip: rk3328: fix syscon id table

2017-09-08 Thread Philipp Tomsich
> syscon id table need a dummy member as NULL ending, or else system
> will panic while try to match a compatible in this table as a list.
> 
> Signed-off-by: Kever Yang 
> ---
> 
>  arch/arm/mach-rockchip/rk3328/syscon_rk3328.c | 1 +
>  1 file changed, 1 insertion(+)
> 

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


Re: [U-Boot] rockchip: rk3328: fix syscon id table

2017-09-08 Thread Philipp Tomsich
> syscon id table need a dummy member as NULL ending, or else system
> will panic while try to match a compatible in this table as a list.
> 
> Signed-off-by: Kever Yang 
> ---
> 
>  arch/arm/mach-rockchip/rk3328/syscon_rk3328.c | 1 +
>  1 file changed, 1 insertion(+)
> 

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


Re: [U-Boot] rockchip: enable SPL_SYSRESET config for all sockchip SoCs

2017-09-08 Thread Philipp Tomsich
> After the patch below, we need to add SPL_SYSRESET for do_reset()
> in SPL:
> 87c16d4 drivers: spl: consistently use the $(SPL_TPL_) macro
> 
> Signed-off-by: Kever Yang 
> ---
> 
>  arch/arm/Kconfig | 1 +
>  1 file changed, 1 insertion(+)
> 

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


Re: [U-Boot] [PATCH v2 0/8] imx: add USB Serial Download Protocol (SDP) support

2017-09-08 Thread Vincent Prince
Hi everyone,

I managed to get SDP protocol to work with on my custom i.MX6 board,
so big thanks to Stefan for your work!

I'm now trying to load swupdate ramdisk with u-boot sdp command,
without success.
Is it a possible use case ?

Here my steps:

In u-boot:
=> sdp 0

On Host,
$ imx_usb

config file 
vid=0x15a2 pid=0x0061 file_name=mx6_usb_rom.conf -> vid=0x0525
pid=0xb4a4 file_name=mx6_usb_sdp_spl.conf
vid=0x0525 pid=0xa4a5 file_name=mx6_usb_uboot.conf
config file 
parse C:\Users\vpr\IMXUSBLOADER2\delivery\\mx6_usb_uboot.conf
Trying to open device vid=0x0525 pid=0xa4a5.
Could not open device vid=0x0525 pid=0xa4a5

VID/PID in imx_usb.conf are correctly detected, and correct
configuration file is launched (mx6_usb_uboot.conf),
it contains:

mx6_usb_sdp_uboot
hid,1024,0x1000,1G,0x00907000,0x31000
test.txt:load 0x1210

My imx_usb.conf is the following:

#vid:pid, config_file
0x15a2:0x0061, mx6_usb_rom.conf, 0x0525:0xb4a4, mx6_usb_sdp_spl.conf
0x0525:0xa4a5, mx6_usb_uboot.conf

Am I missing something,
Thanks,
Vincent

2017-09-01 22:09 GMT+02:00 Stefan Agner :
>
>
> On September 1, 2017 12:25:44 PM PDT, Fabio Estevam  
> wrote:
>>On Fri, Sep 1, 2017 at 3:54 PM, Fabio Estevam 
>>wrote:
>>
>>> I have tested this method and it works, thanks.
>>>
>>> Do you plan to usptream this method?
>>
>>Or I can also put your patch as part of my series that adds SDP
>>support for imx6qsabresd if you prefer.
>
> Let me do a separate, I guess it could be controversial...
>
> --
> Stefan
> --
> Sent from my Android device with K-9 Mail. Please excuse my brevity.
> ___
> 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


Re: [U-Boot] [PATCH 2/2] rockchip: ram: rk3399: update reg map for of-platdata

2017-09-08 Thread Dr. Philipp Tomsich

> On 8 Sep 2017, at 04:46, Kever Yang  wrote:
> 
> Philipp,
> 
>We already enable CONFIG_SPL_OF_CONTROL for all rk3399 board, right?

I meant “full OF_CONTROL” as opposed to “OF_PLATDATA” (which is dependent
of OF_CONTROL, but is intended as a stopgap measure).

>For OF_PLATDATA, I would prefer there always have a  option to use for
> speed up the boot time, not only for ram size.

I had discussed that with Simon recently and he views OF_PLATDATA as a last
resort to be used, when there is not enough memory for full OF_CONTROL.


> Thanks,
> - Kever
> On 09/07/2017 04:51 PM, Dr. Philipp Tomsich wrote:
>> Kever,
>> 
>> Thanks for the fix.
>> 
>> Could we move all RK3399 boards to use OF_CONTROL (i.e. not OF_PLATDATA)
>> in SPL?  We have been using this for the RK3399-Q7 and there is plenty of 
>> SRAM
>> left for future code-growth, so this should be a safe choice.
>> 
>> Regards,
>> Philipp.
>> 
>>> On 7 Sep 2017, at 05:20, Kever Yang  wrote:
>>> 
>>> After Simon's patch, the dtoc can work with 64bit address,
>>> so we need to fix reg number for it.
>>> Depend on Simon's patch set:
>>> https://patchwork.ozlabs.org/cover/807266/
>>> 
>>> Signed-off-by: Kever Yang 
>> Reviewed-by: Philipp Tomsich 
>> 
>>> ---
>>> 
>>> drivers/ram/rockchip/sdram_rk3399.c | 2 +-
>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>> 
>>> diff --git a/drivers/ram/rockchip/sdram_rk3399.c 
>>> b/drivers/ram/rockchip/sdram_rk3399.c
>>> index 63342ab..5ed4b03 100644
>>> --- a/drivers/ram/rockchip/sdram_rk3399.c
>>> +++ b/drivers/ram/rockchip/sdram_rk3399.c
>>> @@ -1115,7 +1115,7 @@ static int conv_of_platdata(struct udevice *dev)
>>> int ret;
>>> 
>>> ret = regmap_init_mem_platdata(dev, dtplat->reg,
>>> -   ARRAY_SIZE(dtplat->reg) / 4,
>>> +   ARRAY_SIZE(dtplat->reg) / 2,
>>> &plat->map);
>>> if (ret)
>>> return ret;
>>> -- 
>>> 1.9.1
>>> 
>> 
> 
> 

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


Re: [U-Boot] [Bug] Installation of sources fails on case insensitive filesystems

2017-09-08 Thread Stefan Weil
Am 04.09.2017 um 19:42 schrieb Stefan Weil:
> This problem was initially reported for QEMU
> (which includes the U-Boot sources):
> 
> https://bugs.launchpad.net/qemu/+bug/1714750
> 
> It is caused by scripts/Kconfig and scripts/kconfig
> which occupy the same name on filesystems which don't
> distinguish the case.
> 
> Maybe this can be fixed in the planned next release
> of U-Boot?
> 
> Kind regards,
> Stefan Weil

According to https://bugs.launchpad.net/qemu/+bug/1714750/comments/2,
the regression was added by this commit:
https://github.com/u-boot/u-boot/commit/61304dbec36dc445bbe7d2c19b4da0695861e0a8

Is there a chance to get this fixed in the next release?

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