Re: [U-Boot] [GIT] Pull request: u-boot-dfu (10.01.2019)

2019-01-09 Thread Lukasz Majewski
On Thu, 10 Jan 2019 01:53:23 +0100
Marek Vasut  wrote:

> On 1/10/19 12:21 AM, Lukasz Majewski wrote:
> > Dear Marek,
> > 
> > I've build tested the patch set from Jean-Jacques on sunxi:
> > 
> > ./tools/buildman/buildman.py --branch=HEAD sunxi --detail --verbose
> > --show_errors --force-build --count=5 --output-dir=../BUILD/
> > 
> > It also passes on Travis-CI:
> > https://travis-ci.org/lmajewski/u-boot-dfu/builds/477104303
> > 
> > The following changes since commit
> > 7436f5e54d35bcad53befec90e2e67288071f74e:
> > 
> >   Merge tag 'for-master-20190103' of
> > git://git.denx.de/u-boot-rockchip (2019-01-03 08:39:44 -0500)
> > 
> > are available in the git repository at:
> > 
> >   git://git.denx.de/u-boot-dfu.git 
> > 
> > for you to fetch changes up to
> > 97f2e698788eba9ee0ea51b3c2f34e989788:
> > 
> >   dm: usb: gadget: Fix boot breakage on sunxi platforms (2019-01-09
> >   01:04:36 +0100)
> > 
> > 
> > Jean-Jacques Hiblot (5):
> >   dm: usb: udc: Use SEQ_ALIAS to index the USB gadget ports
> >   ARM: dts: define USB aliases for all omap5 platforms
> >   Kconfig: rename CONFIG_SPL_USB_GADGET_SUPPORT as
> > CONFIG_SPL_USB_GADGET 
> >   usb: Make compiling gadget support optional
> >   dm: usb: gadget: Fix boot breakage on sunxi platforms  
> 
> I think that's the wrong patch at the end, it still unconditionally
> pulls in udc-uclass.o if CONFIG_$(SPL_)DM is enabled.
> 

This is the order proposed by Jean-Jacques:

Just changing the order should be enough to prevent any breakage.

1) Kconfig: rename CONFIG_SPL_USB_GADGET_SUPPORT as
CONFIG_SPL_USB_GADGET 
2) usb: Make compiling gadget support optional
3) dm: usb: gadget: Fix boot breakage on sunxi platforms

Message-id: <2023e035-748e-ac0d-0dee-64cf000ff...@ti.com>

Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lu...@denx.de


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


Re: [U-Boot] [PATCH v2 2/3] efi_loader: enumerate disk devices every time

2019-01-09 Thread Alexander Graf


On 10.01.19 08:26, AKASHI Takahiro wrote:
> Alex,
> 
> On Thu, Jan 10, 2019 at 07:21:12AM +0100, Alexander Graf wrote:
>>
>>
>> On 10.01.19 03:13, AKASHI Takahiro wrote:
>>> Alex,
>>>
>>> On Wed, Jan 09, 2019 at 10:06:16AM +0100, Alexander Graf wrote:


 On 13.12.18 08:58, AKASHI Takahiro wrote:
> Heinrich,
>
> On Tue, Dec 11, 2018 at 08:55:41PM +0100, Heinrich Schuchardt wrote:
>> On 11/15/18 5:58 AM, AKASHI Takahiro wrote:
>>> Currently, efi_init_obj_list() scan disk devices only once, and never
>>> change a list of efi disk devices. This will possibly result in failing
>>> to find a removable storage which may be added later on. See [1].
>>>
>>> In this patch, called is efi_disk_update() which is responsible for
>>> re-scanning UCLASS_BLK devices and removing/adding efi disks if 
>>> necessary.
>>>
>>> For example,
>>>
>>> => efishell devices
>>> Scanning disk pci_mmc.blk...
>>> Found 3 disks
>>> Device Name
>>> 
>>> /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)
>>> /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)/SD(0)/SD(0)
>>> /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)/SD(0)/SD(0)/HD(2,MBR,0x086246ba,0x40800,0x3f800)
>>> => usb start
>>> starting USB...
>>> USB0:   USB EHCI 1.00
>>> scanning bus 0 for devices... 3 USB Device(s) found
>>>scanning usb for storage devices... 1 Storage Device(s) found
>>> => efishell devices
>>> Scanning disk usb_mass_storage.lun0...
>>> Device Name
>>> 
>>> /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)
>>> /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)/SD(0)/SD(0)
>>> /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)/SD(0)/SD(0)/HD(2,MBR,0x086246ba,0x40800,0x3f800)
>>> /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)/USBClass(0,0,9,0,1)/USBClass(46f4,1,0,0,0)/HD(1,0x01,0,0x40,0x14fe4c)
>>>
>>> Without this patch, the last device, USB mass storage, won't show up.
>>>
>>> [1] https://lists.denx.de/pipermail/u-boot/2018-October/345307.html
>>>
>>> Signed-off-by: AKASHI Takahiro 
>>
>> Why should we try to fix something in the EFI subsystems that goes wrong
>> in the handling of device enumeration.
>
> No.
> This is a natural result from how efi disks are currently implemented on 
> u-boot.
> Do you want to totally re-write/re-implement efi disks?

 Could we just make this event based for now? Call a hook from the
 storage dm subsystem when a new u-boot block device gets created to
 issue a sync of that in the efi subsystem?
>>>
>>> If I correctly understand you, your suggestion here corresponds
>>> with my proposal#3 in [1] while my current approach is #2.
>>>
>>> [1] https://lists.denx.de/pipermail/u-boot/2018-October/345307.html
>>
>> Yes, I think so.
>>
>>> So we will call, say, efi_disk_create(struct udevice *) in
>>> blk_create_device() and efi_dsik_delete() in blk_unbind_all().
>>
>> I would prefer if we didn't call them directly, but through an event
>> mechanism. So the efi_disk subsystem registers an event with the dm
>> block subsystem and that will just call all events when block devices
>> get created which will automatically also include the efi disk creation
>> callback. Same for reverse.
> 
> Do you mean efi event by "event?"
> (I don't think there is any generic event interface on DM side.)
> 
> Whatever an "event" is or whether we call efi_disk_create() directly
> or indirectly via an event, there is one (big?) issue in this approach
> (while I've almost finished prototyping):
> 
> We cannot call efi_disk_create() within blk_create_device() because
> some data fields of struct blk_desc, which are to be used by efi disk,
> are initialized *after* blk_create_device() in driver side.
> 
> So we need to add a hook at/after every occurrence of blk_create_device()
> on driver side. For example,
> 
> === drivers/scsi/scsi.c ===
> int do_scsi_scan_one(struct udevice *dev, int id, int lun, bool verbose)
> {
>   ...
>   ret = blk_create_devicef(dev, "scsi_blk", str, IF_TYPE_SCSI, -1,
>  bd.blksz, bd.lba, );
>   ...
>   bdesc = dev_get_uclass_platdata(bdev);
>   bdesc->target = id;
>   bdesc->lun = lun;
>   ...
> 
>   /*
>* We need have efi_disk_create() called here because bdesc->target
>* and lun will be used by dp helpers in efi_disk_add_dev().
>*/
>   efi_disk_create(bdev);
> }
> 
> int scsi_scan_dev(struct udevice *dev, bool verbose)
> {
> for (i = 0; i < uc_plat->max_id; i++)
> for (lun = 0; lun < uc_plat->max_lun; lun++)
> do_scsi_scan_one(dev, i, lun, verbose);
>   ...
> }
> 
> int scsi_scan(bool verbose)
> {
>   ret = uclass_get(UCLASS_SCSI, );
>   ...
> uclass_foreach_dev(dev, uc)
> 

Re: [U-Boot] [PATCH v2 2/3] efi_loader: enumerate disk devices every time

2019-01-09 Thread AKASHI Takahiro
Alex,

On Thu, Jan 10, 2019 at 07:21:12AM +0100, Alexander Graf wrote:
> 
> 
> On 10.01.19 03:13, AKASHI Takahiro wrote:
> > Alex,
> > 
> > On Wed, Jan 09, 2019 at 10:06:16AM +0100, Alexander Graf wrote:
> >>
> >>
> >> On 13.12.18 08:58, AKASHI Takahiro wrote:
> >>> Heinrich,
> >>>
> >>> On Tue, Dec 11, 2018 at 08:55:41PM +0100, Heinrich Schuchardt wrote:
>  On 11/15/18 5:58 AM, AKASHI Takahiro wrote:
> > Currently, efi_init_obj_list() scan disk devices only once, and never
> > change a list of efi disk devices. This will possibly result in failing
> > to find a removable storage which may be added later on. See [1].
> >
> > In this patch, called is efi_disk_update() which is responsible for
> > re-scanning UCLASS_BLK devices and removing/adding efi disks if 
> > necessary.
> >
> > For example,
> >
> > => efishell devices
> > Scanning disk pci_mmc.blk...
> > Found 3 disks
> > Device Name
> > 
> > /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)
> > /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)/SD(0)/SD(0)
> > /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)/SD(0)/SD(0)/HD(2,MBR,0x086246ba,0x40800,0x3f800)
> > => usb start
> > starting USB...
> > USB0:   USB EHCI 1.00
> > scanning bus 0 for devices... 3 USB Device(s) found
> >scanning usb for storage devices... 1 Storage Device(s) found
> > => efishell devices
> > Scanning disk usb_mass_storage.lun0...
> > Device Name
> > 
> > /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)
> > /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)/SD(0)/SD(0)
> > /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)/SD(0)/SD(0)/HD(2,MBR,0x086246ba,0x40800,0x3f800)
> > /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)/USBClass(0,0,9,0,1)/USBClass(46f4,1,0,0,0)/HD(1,0x01,0,0x40,0x14fe4c)
> >
> > Without this patch, the last device, USB mass storage, won't show up.
> >
> > [1] https://lists.denx.de/pipermail/u-boot/2018-October/345307.html
> >
> > Signed-off-by: AKASHI Takahiro 
> 
>  Why should we try to fix something in the EFI subsystems that goes wrong
>  in the handling of device enumeration.
> >>>
> >>> No.
> >>> This is a natural result from how efi disks are currently implemented on 
> >>> u-boot.
> >>> Do you want to totally re-write/re-implement efi disks?
> >>
> >> Could we just make this event based for now? Call a hook from the
> >> storage dm subsystem when a new u-boot block device gets created to
> >> issue a sync of that in the efi subsystem?
> > 
> > If I correctly understand you, your suggestion here corresponds
> > with my proposal#3 in [1] while my current approach is #2.
> > 
> > [1] https://lists.denx.de/pipermail/u-boot/2018-October/345307.html
> 
> Yes, I think so.
> 
> > So we will call, say, efi_disk_create(struct udevice *) in
> > blk_create_device() and efi_dsik_delete() in blk_unbind_all().
> 
> I would prefer if we didn't call them directly, but through an event
> mechanism. So the efi_disk subsystem registers an event with the dm
> block subsystem and that will just call all events when block devices
> get created which will automatically also include the efi disk creation
> callback. Same for reverse.

Do you mean efi event by "event?"
(I don't think there is any generic event interface on DM side.)

Whatever an "event" is or whether we call efi_disk_create() directly
or indirectly via an event, there is one (big?) issue in this approach
(while I've almost finished prototyping):

We cannot call efi_disk_create() within blk_create_device() because
some data fields of struct blk_desc, which are to be used by efi disk,
are initialized *after* blk_create_device() in driver side.

So we need to add a hook at/after every occurrence of blk_create_device()
on driver side. For example,

=== drivers/scsi/scsi.c ===
int do_scsi_scan_one(struct udevice *dev, int id, int lun, bool verbose)
{
...
ret = blk_create_devicef(dev, "scsi_blk", str, IF_TYPE_SCSI, -1,
   bd.blksz, bd.lba, );
...
bdesc = dev_get_uclass_platdata(bdev);
bdesc->target = id;
bdesc->lun = lun;
...

/*
 * We need have efi_disk_create() called here because bdesc->target
 * and lun will be used by dp helpers in efi_disk_add_dev().
 */
efi_disk_create(bdev);
}

int scsi_scan_dev(struct udevice *dev, bool verbose)
{
for (i = 0; i < uc_plat->max_id; i++)
for (lun = 0; lun < uc_plat->max_lun; lun++)
do_scsi_scan_one(dev, i, lun, verbose);
...
}

int scsi_scan(bool verbose)
{
ret = uclass_get(UCLASS_SCSI, );
...
uclass_foreach_dev(dev, uc)
ret = scsi_scan_dev(dev, verbose);
...
}
=== ===

Since scsn_scan() can be directly called by "scsi rescan" 

Re: [U-Boot] [PATCH v2 3/3] efi_loader: remove block device details from efi file

2019-01-09 Thread AKASHI Takahiro
On Thu, Jan 10, 2019 at 07:22:49AM +0100, Alexander Graf wrote:
> 
> 
> On 10.01.19 01:37, AKASHI Takahiro wrote:
> > Alex,
> > 
> > On Wed, Jan 09, 2019 at 10:18:16AM +0100, Alexander Graf wrote:
> >>
> >>
> >> On 15.11.18 05:58, AKASHI Takahiro wrote:
> >>> Logically, details on u-boot block device used to implement efi file
> >>> protocol are mostly unnecessary, as well as being duplicated, in
> >>> efi_file structure.
> >>> Moreover, a newly introduced flag, _EFI_DISK_FLAG_INVALID, should be
> >>> honored in any file operations via efi file protocol.
> >>> These observation suggests that those internal details be set behind
> >>> efi_disk object.
> >>>
> >>> So rework in this patch addresses all those issues above although
> >>> there is little change in its functionality.
> >>>
> >>> Signed-off-by: AKASHI Takahiro 
> >>> ---
> >>>  include/efi_loader.h  |  6 +-
> >>>  lib/efi_loader/efi_disk.c | 38 --
> >>>  lib/efi_loader/efi_file.c | 21 -
> >>>  3 files changed, 49 insertions(+), 16 deletions(-)
> >>>
> >>> diff --git a/include/efi_loader.h b/include/efi_loader.h
> >>> index 3bae1844befb..108ef3fe52ee 100644
> >>> --- a/include/efi_loader.h
> >>> +++ b/include/efi_loader.h
> >>> @@ -264,6 +264,10 @@ efi_status_t efi_disk_register(void);
> >>>  bool efi_disk_is_valid(efi_handle_t handle);
> >>>  /* Called by bootefi to find and update disk storage information */
> >>>  efi_status_t efi_disk_update(void);
> >>> +/* Called by file protocol to set internal block io device */
> >>> +int efi_disk_set_blk_dev(efi_handle_t disk);
> >>> +/* Called by file protocol to get disk/partition information */
> >>> +int efi_disk_get_info(efi_handle_t disk, disk_partition_t *part);
> >>>  /* Create handles and protocols for the partitions of a block device */
> >>>  int efi_disk_create_partitions(efi_handle_t parent, struct blk_desc 
> >>> *desc,
> >>>  const char *if_typename, int diskid,
> >>> @@ -355,7 +359,7 @@ void efi_signal_event(struct efi_event *event, bool 
> >>> check_tpl);
> >>>  
> >>>  /* open file system: */
> >>>  struct efi_simple_file_system_protocol *efi_simple_file_system(
> >>> - struct blk_desc *desc, int part, struct efi_device_path *dp);
> >>> + efi_handle_t disk);
> >>>  
> >>>  /* open file from device-path: */
> >>>  struct efi_file_handle *efi_file_from_path(struct efi_device_path *fp);
> >>> diff --git a/lib/efi_loader/efi_disk.c b/lib/efi_loader/efi_disk.c
> >>> index 0c4d79ee3fc9..180e8e10bb28 100644
> >>> --- a/lib/efi_loader/efi_disk.c
> >>> +++ b/lib/efi_loader/efi_disk.c
> >>> @@ -9,6 +9,7 @@
> >>>  #include 
> >>>  #include 
> >>>  #include 
> >>> +#include 
> >>>  #include 
> >>>  #include 
> >>>  
> >>> @@ -254,6 +255,40 @@ efi_fs_from_path(struct efi_device_path *full_path)
> >>>   return handler->protocol_interface;
> >>>  }
> >>>  
> >>> +/*
> >>> + * Set block device for later block io's from file system protocol
> >>> + *
> >>> + * @disk handle to uefi disk device
> >>> + * @return   0 for success, -1 for failure
> >>> + */
> >>> +int efi_disk_set_blk_dev(efi_handle_t disk)
> >>> +{
> >>> + struct efi_disk_obj *diskobj;
> >>> +
> >>> + diskobj = container_of(disk, struct efi_disk_obj, header);
> >>> +
> >>> + return fs_set_blk_dev_with_part(diskobj->desc, diskobj->part);
> >>> +}
> >>> +
> >>> +/*
> >>> + * Get disk/partition information
> >>> + *
> >>> + * @disk handle to uefi disk device
> >>> + * @part pointer to disk/partition information to be returned
> >>> + * @return   0 for success, -1 for failure
> >>> + */
> >>> +int efi_disk_get_info(efi_handle_t disk, disk_partition_t *part)
> >>> +{
> >>> + struct efi_disk_obj *diskobj;
> >>> +
> >>> + diskobj = container_of(disk, struct efi_disk_obj, header);
> >>> +
> >>> + if (diskobj->part >= 1)
> >>> + return part_get_info(diskobj->desc, diskobj->part, part);
> >>> + else
> >>> + return part_get_info_whole_disk(diskobj->desc, part);
> >>> +}
> >>> +
> >>>  /*
> >>>   * Create a handle for a partition or disk
> >>>   *
> >>> @@ -308,8 +343,7 @@ static efi_status_t efi_disk_add_dev(
> >>>   if (ret != EFI_SUCCESS)
> >>>   return ret;
> >>>   if (part >= 1) {
> >>> - diskobj->volume = efi_simple_file_system(desc, part,
> >>> -  diskobj->dp);
> >>> + diskobj->volume = efi_simple_file_system(>header);
> >>>   ret = efi_add_protocol(>header,
> >>>  _simple_file_system_protocol_guid,
> >>>  diskobj->volume);
> >>> diff --git a/lib/efi_loader/efi_file.c b/lib/efi_loader/efi_file.c
> >>> index beb4fba917d8..944383224f30 100644
> >>> --- a/lib/efi_loader/efi_file.c
> >>> +++ b/lib/efi_loader/efi_file.c
> >>> @@ -17,9 +17,7 @@ const efi_guid_t efi_file_system_info_guid = 
> >>> EFI_FILE_SYSTEM_INFO_GUID;
> >>>  
> >>>  struct file_system {
> >>>   struct 

Re: [U-Boot] [PATCH 3/3] arm: socfpga: remove CONFIG_SYS_BOOTMAPSZ

2019-01-09 Thread Stefan Roese

On 09.01.19 20:56, Simon Goldschmidt wrote:

socfpga_common.h defines CONFIG_SYS_BOOTMAPSZ to 64 MiB.

Since having this define overrides the 'bootm_size' env variable for
the whole socfpga platform, let's remove this define from socfpga_common.h
and instead rely on the 'bootm_size' env variable (which is initialized
to 160 MiB in the same file's default env). This gives users the
chance to override it in their own environment.

Signed-off-by: Simon Goldschmidt 


Reviewed-by: Stefan Roese 

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


Re: [U-Boot] [PATCH 2/3] arm: socfpga: clean up socfpga_common.h

2019-01-09 Thread Stefan Roese

On 09.01.19 20:56, Simon Goldschmidt wrote:

Remove outdated defines (not used any more, outdated due to DM
conversion) from socfpga_common.h.

Signed-off-by: Simon Goldschmidt 


Reviewed-by: Stefan Roese 

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


Re: [U-Boot] [PATCH v2 3/3] efi_loader: remove block device details from efi file

2019-01-09 Thread Alexander Graf


On 10.01.19 01:37, AKASHI Takahiro wrote:
> Alex,
> 
> On Wed, Jan 09, 2019 at 10:18:16AM +0100, Alexander Graf wrote:
>>
>>
>> On 15.11.18 05:58, AKASHI Takahiro wrote:
>>> Logically, details on u-boot block device used to implement efi file
>>> protocol are mostly unnecessary, as well as being duplicated, in
>>> efi_file structure.
>>> Moreover, a newly introduced flag, _EFI_DISK_FLAG_INVALID, should be
>>> honored in any file operations via efi file protocol.
>>> These observation suggests that those internal details be set behind
>>> efi_disk object.
>>>
>>> So rework in this patch addresses all those issues above although
>>> there is little change in its functionality.
>>>
>>> Signed-off-by: AKASHI Takahiro 
>>> ---
>>>  include/efi_loader.h  |  6 +-
>>>  lib/efi_loader/efi_disk.c | 38 --
>>>  lib/efi_loader/efi_file.c | 21 -
>>>  3 files changed, 49 insertions(+), 16 deletions(-)
>>>
>>> diff --git a/include/efi_loader.h b/include/efi_loader.h
>>> index 3bae1844befb..108ef3fe52ee 100644
>>> --- a/include/efi_loader.h
>>> +++ b/include/efi_loader.h
>>> @@ -264,6 +264,10 @@ efi_status_t efi_disk_register(void);
>>>  bool efi_disk_is_valid(efi_handle_t handle);
>>>  /* Called by bootefi to find and update disk storage information */
>>>  efi_status_t efi_disk_update(void);
>>> +/* Called by file protocol to set internal block io device */
>>> +int efi_disk_set_blk_dev(efi_handle_t disk);
>>> +/* Called by file protocol to get disk/partition information */
>>> +int efi_disk_get_info(efi_handle_t disk, disk_partition_t *part);
>>>  /* Create handles and protocols for the partitions of a block device */
>>>  int efi_disk_create_partitions(efi_handle_t parent, struct blk_desc *desc,
>>>const char *if_typename, int diskid,
>>> @@ -355,7 +359,7 @@ void efi_signal_event(struct efi_event *event, bool 
>>> check_tpl);
>>>  
>>>  /* open file system: */
>>>  struct efi_simple_file_system_protocol *efi_simple_file_system(
>>> -   struct blk_desc *desc, int part, struct efi_device_path *dp);
>>> +   efi_handle_t disk);
>>>  
>>>  /* open file from device-path: */
>>>  struct efi_file_handle *efi_file_from_path(struct efi_device_path *fp);
>>> diff --git a/lib/efi_loader/efi_disk.c b/lib/efi_loader/efi_disk.c
>>> index 0c4d79ee3fc9..180e8e10bb28 100644
>>> --- a/lib/efi_loader/efi_disk.c
>>> +++ b/lib/efi_loader/efi_disk.c
>>> @@ -9,6 +9,7 @@
>>>  #include 
>>>  #include 
>>>  #include 
>>> +#include 
>>>  #include 
>>>  #include 
>>>  
>>> @@ -254,6 +255,40 @@ efi_fs_from_path(struct efi_device_path *full_path)
>>> return handler->protocol_interface;
>>>  }
>>>  
>>> +/*
>>> + * Set block device for later block io's from file system protocol
>>> + *
>>> + * @disk   handle to uefi disk device
>>> + * @return 0 for success, -1 for failure
>>> + */
>>> +int efi_disk_set_blk_dev(efi_handle_t disk)
>>> +{
>>> +   struct efi_disk_obj *diskobj;
>>> +
>>> +   diskobj = container_of(disk, struct efi_disk_obj, header);
>>> +
>>> +   return fs_set_blk_dev_with_part(diskobj->desc, diskobj->part);
>>> +}
>>> +
>>> +/*
>>> + * Get disk/partition information
>>> + *
>>> + * @disk   handle to uefi disk device
>>> + * @part   pointer to disk/partition information to be returned
>>> + * @return 0 for success, -1 for failure
>>> + */
>>> +int efi_disk_get_info(efi_handle_t disk, disk_partition_t *part)
>>> +{
>>> +   struct efi_disk_obj *diskobj;
>>> +
>>> +   diskobj = container_of(disk, struct efi_disk_obj, header);
>>> +
>>> +   if (diskobj->part >= 1)
>>> +   return part_get_info(diskobj->desc, diskobj->part, part);
>>> +   else
>>> +   return part_get_info_whole_disk(diskobj->desc, part);
>>> +}
>>> +
>>>  /*
>>>   * Create a handle for a partition or disk
>>>   *
>>> @@ -308,8 +343,7 @@ static efi_status_t efi_disk_add_dev(
>>> if (ret != EFI_SUCCESS)
>>> return ret;
>>> if (part >= 1) {
>>> -   diskobj->volume = efi_simple_file_system(desc, part,
>>> -diskobj->dp);
>>> +   diskobj->volume = efi_simple_file_system(>header);
>>> ret = efi_add_protocol(>header,
>>>_simple_file_system_protocol_guid,
>>>diskobj->volume);
>>> diff --git a/lib/efi_loader/efi_file.c b/lib/efi_loader/efi_file.c
>>> index beb4fba917d8..944383224f30 100644
>>> --- a/lib/efi_loader/efi_file.c
>>> +++ b/lib/efi_loader/efi_file.c
>>> @@ -17,9 +17,7 @@ const efi_guid_t efi_file_system_info_guid = 
>>> EFI_FILE_SYSTEM_INFO_GUID;
>>>  
>>>  struct file_system {
>>> struct efi_simple_file_system_protocol base;
>>> -   struct efi_device_path *dp;
>>> -   struct blk_desc *desc;
>>> -   int part;
>>> +   efi_handle_t disk;
>>
>> Is there a particular reason we can't just make this a struct
>> efi_disk_obj *?
> 
> Just because efi_disk_obj is an 

Re: [U-Boot] [PATCH v2 2/3] efi_loader: enumerate disk devices every time

2019-01-09 Thread Alexander Graf


On 10.01.19 03:13, AKASHI Takahiro wrote:
> Alex,
> 
> On Wed, Jan 09, 2019 at 10:06:16AM +0100, Alexander Graf wrote:
>>
>>
>> On 13.12.18 08:58, AKASHI Takahiro wrote:
>>> Heinrich,
>>>
>>> On Tue, Dec 11, 2018 at 08:55:41PM +0100, Heinrich Schuchardt wrote:
 On 11/15/18 5:58 AM, AKASHI Takahiro wrote:
> Currently, efi_init_obj_list() scan disk devices only once, and never
> change a list of efi disk devices. This will possibly result in failing
> to find a removable storage which may be added later on. See [1].
>
> In this patch, called is efi_disk_update() which is responsible for
> re-scanning UCLASS_BLK devices and removing/adding efi disks if necessary.
>
> For example,
>
> => efishell devices
> Scanning disk pci_mmc.blk...
> Found 3 disks
> Device Name
> 
> /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)
> /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)/SD(0)/SD(0)
> /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)/SD(0)/SD(0)/HD(2,MBR,0x086246ba,0x40800,0x3f800)
> => usb start
> starting USB...
> USB0:   USB EHCI 1.00
> scanning bus 0 for devices... 3 USB Device(s) found
>scanning usb for storage devices... 1 Storage Device(s) found
> => efishell devices
> Scanning disk usb_mass_storage.lun0...
> Device Name
> 
> /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)
> /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)/SD(0)/SD(0)
> /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)/SD(0)/SD(0)/HD(2,MBR,0x086246ba,0x40800,0x3f800)
> /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)/USBClass(0,0,9,0,1)/USBClass(46f4,1,0,0,0)/HD(1,0x01,0,0x40,0x14fe4c)
>
> Without this patch, the last device, USB mass storage, won't show up.
>
> [1] https://lists.denx.de/pipermail/u-boot/2018-October/345307.html
>
> Signed-off-by: AKASHI Takahiro 

 Why should we try to fix something in the EFI subsystems that goes wrong
 in the handling of device enumeration.
>>>
>>> No.
>>> This is a natural result from how efi disks are currently implemented on 
>>> u-boot.
>>> Do you want to totally re-write/re-implement efi disks?
>>
>> Could we just make this event based for now? Call a hook from the
>> storage dm subsystem when a new u-boot block device gets created to
>> issue a sync of that in the efi subsystem?
> 
> If I correctly understand you, your suggestion here corresponds
> with my proposal#3 in [1] while my current approach is #2.
> 
> [1] https://lists.denx.de/pipermail/u-boot/2018-October/345307.html

Yes, I think so.

> So we will call, say, efi_disk_create(struct udevice *) in
> blk_create_device() and efi_dsik_delete() in blk_unbind_all().

I would prefer if we didn't call them directly, but through an event
mechanism. So the efi_disk subsystem registers an event with the dm
block subsystem and that will just call all events when block devices
get created which will automatically also include the efi disk creation
callback. Same for reverse.

> UEFI handles for disks, however, will *not* be deleted actually
> because, as Heinrich suggested in the past, no *reference count*
> for a handle is maintained in the current implementation. Right?

Sure, but we can have an internal state that just starts failing all
callbacks (read, write, etc) when the backing device was destroyed.

>> That hook would obviously only do something (or get registered?) when
>> the efi object stack is initialized.
>>
>> The long term goal IMHO should still be though to just merge DM and EFI
>> objects. But we're still waiting on the deprecation of non-DM devices
>> for that.
> 
> Maybe my #4?

Not quite.

We would basically get rid of the efi object list altogether. Instead,
any DM object would also be an EFI object and expose EFI interfaces if
awareness exists.

That way we can merge into the existing object maintenance logic and
wouldn't need any callbacks.

Once we're there, we can also start to think about reference counting :).


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


[U-Boot] [PATCH 14/18] rockchip: Tidy up board include-file ordering

2019-01-09 Thread Simon Glass
These board files have inconsistent #include ordering. Fix them.

Signed-off-by: Simon Glass 
---

 arch/arm/mach-rockchip/rk3036-board.c |  2 +-
 arch/arm/mach-rockchip/rk3188-board-spl.c |  2 +-
 arch/arm/mach-rockchip/rk3188-board.c |  2 +-
 arch/arm/mach-rockchip/rk322x-board.c |  2 +-
 arch/arm/mach-rockchip/rk3368-board-spl.c |  2 +-
 arch/arm/mach-rockchip/rk3368-board-tpl.c |  4 ++--
 arch/arm/mach-rockchip/rk3399-board-spl.c | 12 ++--
 7 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/arch/arm/mach-rockchip/rk3036-board.c 
b/arch/arm/mach-rockchip/rk3036-board.c
index 95871cdd2e..872bed9606 100644
--- a/arch/arm/mach-rockchip/rk3036-board.c
+++ b/arch/arm/mach-rockchip/rk3036-board.c
@@ -7,13 +7,13 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
 #include 
 #include 
 #include 
-#include 
 #include 
 
 DECLARE_GLOBAL_DATA_PTR;
diff --git a/arch/arm/mach-rockchip/rk3188-board-spl.c 
b/arch/arm/mach-rockchip/rk3188-board-spl.c
index a5e4d39cb7..5c09b0e4ae 100644
--- a/arch/arm/mach-rockchip/rk3188-board-spl.c
+++ b/arch/arm/mach-rockchip/rk3188-board-spl.c
@@ -12,6 +12,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -27,7 +28,6 @@
 #include 
 #include 
 #include 
-#include 
 
 DECLARE_GLOBAL_DATA_PTR;
 
diff --git a/arch/arm/mach-rockchip/rk3188-board.c 
b/arch/arm/mach-rockchip/rk3188-board.c
index 8853e4a58e..3802395bc0 100644
--- a/arch/arm/mach-rockchip/rk3188-board.c
+++ b/arch/arm/mach-rockchip/rk3188-board.c
@@ -8,13 +8,13 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
 #include 
 #include 
 #include 
-#include 
 #include 
 
 __weak int rk_board_late_init(void)
diff --git a/arch/arm/mach-rockchip/rk322x-board.c 
b/arch/arm/mach-rockchip/rk322x-board.c
index 7366d45ab6..5659248178 100644
--- a/arch/arm/mach-rockchip/rk322x-board.c
+++ b/arch/arm/mach-rockchip/rk322x-board.c
@@ -8,10 +8,10 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
-#include 
 
 DECLARE_GLOBAL_DATA_PTR;
 
diff --git a/arch/arm/mach-rockchip/rk3368-board-spl.c 
b/arch/arm/mach-rockchip/rk3368-board-spl.c
index eae8ef15f3..230850ad6c 100644
--- a/arch/arm/mach-rockchip/rk3368-board-spl.c
+++ b/arch/arm/mach-rockchip/rk3368-board-spl.c
@@ -6,7 +6,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -15,6 +14,7 @@
 #include 
 #include 
 #include 
+#include 
 
 void board_debug_uart_init(void)
 {
diff --git a/arch/arm/mach-rockchip/rk3368-board-tpl.c 
b/arch/arm/mach-rockchip/rk3368-board-tpl.c
index 3b33ce468a..f90a1fdca7 100644
--- a/arch/arm/mach-rockchip/rk3368-board-tpl.c
+++ b/arch/arm/mach-rockchip/rk3368-board-tpl.c
@@ -4,18 +4,18 @@
  */
 
 #include 
-#include 
 #include 
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
 #include 
-#include 
 
 /*
  * The SPL (and also the full U-Boot stage on the RK3368) will run in
diff --git a/arch/arm/mach-rockchip/rk3399-board-spl.c 
b/arch/arm/mach-rockchip/rk3399-board-spl.c
index 0198c6c65f..5453b2a61e 100644
--- a/arch/arm/mach-rockchip/rk3399-board-spl.c
+++ b/arch/arm/mach-rockchip/rk3399-board-spl.c
@@ -5,18 +5,18 @@
  */
 
 #include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
 #include 
 #include 
 #include 
 #include 
 #include 
-#include 
-#include 
-#include 
 #include 
-#include 
-#include 
-#include 
 
 void board_return_to_bootrom(void)
 {
-- 
2.20.1.97.g81188d93c3-goog

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


[U-Boot] [PATCH 12/18] rockchip: Add settings for Samsung LPDDR3 4GB SDRAM 1866MHz

2019-01-09 Thread Simon Glass
This memory is used on Bob. Add settings for this, taken from coreboot.

Signed-off-by: Simon Glass 
---

 .../rk3399-sdram-lpddr3-samsung-4GB-1866.dtsi | 1542 +
 1 file changed, 1542 insertions(+)
 create mode 100644 arch/arm/dts/rk3399-sdram-lpddr3-samsung-4GB-1866.dtsi

diff --git a/arch/arm/dts/rk3399-sdram-lpddr3-samsung-4GB-1866.dtsi 
b/arch/arm/dts/rk3399-sdram-lpddr3-samsung-4GB-1866.dtsi
new file mode 100644
index 00..2a627e1be5
--- /dev/null
+++ b/arch/arm/dts/rk3399-sdram-lpddr3-samsung-4GB-1866.dtsi
@@ -0,0 +1,1542 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * (C) Copyright 2016 Rockchip Electronics Co., Ltd
+ */
+
+ {
+   rockchip,sdram-params = <
+   0x2
+   0xa
+   0x3
+   0x2
+   0x2
+   0x0
+   0xf
+   0xf
+   1
+
+   0x801d181e
+   0x17050a08
+   0x0002
+   0x6426
+   0x004c
+   0x
+
+   0x2
+   0xa
+   0x3
+   0x2
+   0x2
+   0x0
+   0xf
+   0xf
+   1
+
+   0x801d181e
+   0x17050a08
+   0x0002
+   0x6426
+   0x004c
+   0x
+
+   933
+   6   /* LPDDR3 */
+   2
+   13
+   1
+
+   0x0700  /* DENALI_CTL_00_DATA */
+   0x  /* DENALI_CTL_01_DATA */
+   0x  /* DENALI_CTL_02_DATA */
+   0x  /* DENALI_CTL_03_DATA */
+   0x  /* DENALI_CTL_04_DATA */
+   0x005e  /* DENALI_CTL_05_DATA */
+   0x0002d976  /* DENALI_CTL_06_DATA */
+   0x03a6  /* DENALI_CTL_07_DATA */
+   0x247a  /* DENALI_CTL_08_DATA */
+   0x005e  /* DENALI_CTL_09_DATA */
+   0x0002d976  /* DENALI_CTL_10_DATA */
+   0x03a6  /* DENALI_CTL_11_DATA */
+   0x247a  /* DENALI_CTL_12_DATA */
+   0x005e  /* DENALI_CTL_13_DATA */
+   0x0002d976  /* DENALI_CTL_14_DATA */
+   0x03a6  /* DENALI_CTL_15_DATA */
+   0x0100247a  /* DENALI_CTL_16_DATA */
+   0x  /* DENALI_CTL_17_DATA */
+   0x0101  /* DENALI_CTL_18_DATA */
+   0x00020100  /* DENALI_CTL_19_DATA */
+   0x00bb  /* DENALI_CTL_20_DATA */
+   0x01d3  /* DENALI_CTL_21_DATA */
+   0x  /* DENALI_CTL_22_DATA */
+   0x081c  /* DENALI_CTL_23_DATA */
+   0x00081c00  /* DENALI_CTL_24_DATA */
+   0x0400081c  /* DENALI_CTL_25_DATA */
+   0x3b0a0004  /* DENALI_CTL_26_DATA */
+   0x2f110828  /* DENALI_CTL_27_DATA */
+   0x283b0a00  /* DENALI_CTL_28_DATA */
+   0x002f1108  /* DENALI_CTL_29_DATA */
+   0x08283b0a  /* DENALI_CTL_30_DATA */
+   0x08002f11  /* DENALI_CTL_31_DATA */
+   0x0a0a  /* DENALI_CTL_32_DATA */
+   0x0800ff4f  /* DENALI_CTL_33_DATA */
+   0x0a0a080f  /* DENALI_CTL_34_DATA */
+   0x0800ff4f  /* DENALI_CTL_35_DATA */
+   0x0a0a080f  /* DENALI_CTL_36_DATA */
+   0x0800ff4f  /* DENALI_CTL_37_DATA */
+   0x0203000f  /* DENALI_CTL_38_DATA */
+   0x110f1100  /* DENALI_CTL_39_DATA */
+   0x040f110f  /* DENALI_CTL_40_DATA */
+   0x14000a0a  /* DENALI_CTL_41_DATA */
+   0x03030a0a  /* DENALI_CTL_42_DATA */
+   0x00010003  /* DENALI_CTL_43_DATA */
+   0x03212121  /* DENALI_CTL_44_DATA */
+   0x00141414  /* DENALI_CTL_45_DATA */
+   0x  /* DENALI_CTL_46_DATA */
+   0x0301  /* DENALI_CTL_47_DATA */
+   0x0e3100c5  /* DENALI_CTL_48_DATA */
+   0x0e3100c5  /* DENALI_CTL_49_DATA */
+   0x0e3100c5  /* DENALI_CTL_50_DATA */
+   0x  /* DENALI_CTL_51_DATA */
+   0x00080008  /* DENALI_CTL_52_DATA */
+   0x00170008  /* DENALI_CTL_53_DATA */
+   0x00170017  /* DENALI_CTL_54_DATA */
+   0x0011  /* DENALI_CTL_55_DATA */
+   0x  /* DENALI_CTL_56_DATA */
+   0x  /* DENALI_CTL_57_DATA */
+   0x  /* DENALI_CTL_58_DATA */
+   0x00ce  /* DENALI_CTL_59_DATA */
+   0x00ce00ce  /* DENALI_CTL_60_DATA */
+   

[U-Boot] [PATCH 18/18] rockchip: Add support for chromebook_bob

2019-01-09 Thread Simon Glass
Bob is a 10-inch chromebook produced by Asus. It has two USB 3.0 type-C
ports, 4GB of SDRAM, WiFi and a 1280x800 display. It uses its USB ports
for both power and external display. It includes a Chrome OS EC
(Cortex-M3) to provide access to the keyboard and battery functions.

Support so far includes only:
- UART
- SDRAM
- MMC, SD card
- Cros EC (but not keyboard)

Not included:
- Keyboard
- Display
- Sound
- USB
- TPM

Bob is quite similar to Kevin, the Samsung Chromebook Plus, but support
for this is not provided in this series.

Signed-off-by: Simon Glass 
---

 .../arm/include/asm/arch-rockchip/sys_proto.h |   3 +
 arch/arm/mach-rockchip/rk3399-board-spl.c |  37 ++-
 arch/arm/mach-rockchip/rk3399/Kconfig |  10 ++
 board/google/gru/Kconfig  |  15 +++
 board/google/gru/MAINTAINERS  |   6 ++
 board/google/gru/Makefile |   5 +
 board/google/gru/gru.c|  16 +++
 configs/chromebook_bob_defconfig  | 100 ++
 doc/README.rockchip   |   6 +-
 include/configs/gru.h |  18 
 10 files changed, 213 insertions(+), 3 deletions(-)
 create mode 100644 board/google/gru/Kconfig
 create mode 100644 board/google/gru/MAINTAINERS
 create mode 100644 board/google/gru/Makefile
 create mode 100644 board/google/gru/gru.c
 create mode 100644 configs/chromebook_bob_defconfig
 create mode 100644 include/configs/gru.h

diff --git a/arch/arm/include/asm/arch-rockchip/sys_proto.h 
b/arch/arm/include/asm/arch-rockchip/sys_proto.h
index 925fcc888c..928e4f258b 100644
--- a/arch/arm/include/asm/arch-rockchip/sys_proto.h
+++ b/arch/arm/include/asm/arch-rockchip/sys_proto.h
@@ -29,4 +29,7 @@ static void configure_l2ctlr(void)
 }
 #endif /* CONFIG_ROCKCHIP_RK3288 */
 
+/* provided to defeat compiler optimisation in board_init_f() */
+void gru_dummy_function(int i);
+
 #endif /* _ASM_ARCH_SYS_PROTO_H */
diff --git a/arch/arm/mach-rockchip/rk3399-board-spl.c 
b/arch/arm/mach-rockchip/rk3399-board-spl.c
index 5453b2a61e..2be485ec5e 100644
--- a/arch/arm/mach-rockchip/rk3399-board-spl.c
+++ b/arch/arm/mach-rockchip/rk3399-board-spl.c
@@ -9,6 +9,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -16,6 +17,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 void board_return_to_bootrom(void)
@@ -128,7 +130,11 @@ void secure_timer_init(void)
 void board_debug_uart_init(void)
 {
 #define GRF_BASE   0xff77
+#define GPIO0_BASE 0xff72
+#define PMUGRF_BASE0xff32
struct rk3399_grf_regs * const grf = (void *)GRF_BASE;
+   struct rk3399_pmugrf_regs * const pmugrf = (void *)PMUGRF_BASE;
+   struct rockchip_gpio_regs * const gpio = (void *)GPIO0_BASE;
 
 #if defined(CONFIG_DEBUG_UART_BASE) && (CONFIG_DEBUG_UART_BASE == 0xff18)
/* Enable early UART0 on the RK3399 */
@@ -139,6 +145,20 @@ void board_debug_uart_init(void)
 GRF_GPIO2C1_SEL_MASK,
 GRF_UART0BT_SOUT << GRF_GPIO2C1_SEL_SHIFT);
 #else
+# ifdef CONFIG_TARGET_CHROMEBOOK_BOB
+   rk_setreg(>io_vsel, 1 << 0);
+
+   /*
+* Let's enable these power rails here, we are already running the SPI
+* Flash based code.
+*/
+   spl_gpio_output(gpio, GPIO(BANK_B, 2), 1);  /* PP1500_EN */
+   spl_gpio_set_pull(>gpio0_p, GPIO(BANK_B, 2), GPIO_PULL_NONE);
+
+   spl_gpio_output(gpio, GPIO(BANK_B, 4), 1);  /* PP3000_EN */
+   spl_gpio_set_pull(>gpio0_p, GPIO(BANK_B, 4), GPIO_PULL_NONE);
+#endif /* CONFIG_TARGET_CHROMEBOOK_BOB */
+
/* Enable early UART2 channel C on the RK3399 */
rk_clrsetreg(>gpio4c_iomux,
 GRF_GPIO4C3_SEL_MASK,
@@ -163,6 +183,22 @@ void board_init_f(ulong dummy)
 
 #define EARLY_UART
 #ifdef EARLY_UART
+# ifdef CONFIG_TARGET_CHROMEBOOK_BOB
+   int sum, i;
+
+   debug_uart_init();
+
+   /*
+* Add a delay and ensure that the compiler does not optimise this out.
+* This is needed since the power rails tail a while to turn on, and
+* we get garbage serial output otherwise.
+*/
+   sum = 0;
+   for (i = 0; i < 15; i++)
+   sum += i;
+   gru_dummy_function(sum);
+#endif /* CONFIG_TARGET_CHROMEBOOK_BOB */
+
/*
 * Debug UART can be used from here if required:
 *
@@ -171,7 +207,6 @@ void board_init_f(ulong dummy)
 * printhex8(0x1234);
 * printascii("string");
 */
-   debug_uart_init();
printascii("U-Boot SPL board init\n");
 #endif
 
diff --git a/arch/arm/mach-rockchip/rk3399/Kconfig 
b/arch/arm/mach-rockchip/rk3399/Kconfig
index 8f18e33c76..2408adb420 100644
--- a/arch/arm/mach-rockchip/rk3399/Kconfig
+++ b/arch/arm/mach-rockchip/rk3399/Kconfig
@@ -53,6 +53,15 @@ config TARGET_ROCK960_RK3399
   * 2x USB 3.0 type A, 2x USB 2.0 type A (host mode only),
 1x USB 3.0 type C OTG
 

[U-Boot] [PATCH 10/18] rockchip: Clarify docs on SPI writing

2019-01-09 Thread Simon Glass
We use every second block when creating a SPI image, so update the text to
say this explicitly.

Signed-off-by: Simon Glass 
---

 doc/README.rockchip | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/README.rockchip b/doc/README.rockchip
index a45b8a97b7..9b7e4bac11 100644
--- a/doc/README.rockchip
+++ b/doc/README.rockchip
@@ -261,7 +261,7 @@ To write an image that boots from SPI flash (e.g. for the 
Haier Chromebook):
dd if=out.bin of=out.bin.pad bs=4M conv=sync
 
 This converts the SPL image to the required SPI format by adding the Rockchip
-header and skipping every 2KB block. Then the U-Boot image is written at
+header and skipping every second 2KB block. Then the U-Boot image is written at
 offset 128KB and the whole image is padded to 4MB which is the SPI flash size.
 The position of U-Boot is controlled with this setting in U-Boot:
 
-- 
2.20.1.97.g81188d93c3-goog

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


[U-Boot] [PATCH 13/18] rockchip: clk: Add mention of four new clocks

2019-01-09 Thread Simon Glass
These clocks are needed to get MMC running. We don't actually support
setting them yet.

Signed-off-by: Simon Glass 
---

 drivers/clk/rockchip/clk_rk3399.c | 12 
 1 file changed, 12 insertions(+)

diff --git a/drivers/clk/rockchip/clk_rk3399.c 
b/drivers/clk/rockchip/clk_rk3399.c
index 198914b067..98de4bc69c 100644
--- a/drivers/clk/rockchip/clk_rk3399.c
+++ b/drivers/clk/rockchip/clk_rk3399.c
@@ -925,7 +925,13 @@ static ulong rk3399_clk_get_rate(struct clk *clk)
case SCLK_SARADC:
rate = rk3399_saradc_get_clk(priv->cru);
break;
+   case ACLK_VIO:
+   case ACLK_HDCP:
+   case ACLK_GIC_PRE:
+   case PCLK_DDR:
+   break;
default:
+   log_debug("Unknown clock %d\n", clk->id);
return -ENOENT;
}
 
@@ -993,7 +999,13 @@ static ulong rk3399_clk_set_rate(struct clk *clk, ulong 
rate)
case SCLK_SARADC:
ret = rk3399_saradc_set_clk(priv->cru, rate);
break;
+   case ACLK_VIO:
+   case ACLK_HDCP:
+   case ACLK_GIC_PRE:
+   case PCLK_DDR:
+   return 0;
default:
+   log_debug("Unknown clock %d\n", clk->id);
return -ENOENT;
}
 
-- 
2.20.1.97.g81188d93c3-goog

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


[U-Boot] [PATCH 15/18] rockchip: rk3399: Add ROCKCHIP_DEVICE_SETTINGS to set env

2019-01-09 Thread Simon Glass
Some boards use different stdio environment variables from the default.
Provide a #define for this which can be set before including the header
file.

Signed-off-by: Simon Glass 
---

 include/configs/rk3399_common.h | 5 +
 1 file changed, 5 insertions(+)

diff --git a/include/configs/rk3399_common.h b/include/configs/rk3399_common.h
index eeda070752..3231de6668 100644
--- a/include/configs/rk3399_common.h
+++ b/include/configs/rk3399_common.h
@@ -50,11 +50,16 @@
"kernel_addr_r=0x0208\0" \
"ramdisk_addr_r=0x0400\0"
 
+#ifndef ROCKCHIP_DEVICE_SETTINGS
+#define ROCKCHIP_DEVICE_SETTINGS
+#endif
+
 #include 
 #define CONFIG_EXTRA_ENV_SETTINGS \
ENV_MEM_LAYOUT_SETTINGS \
"fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0" \
"partitions=" PARTS_DEFAULT \
+   ROCKCHIP_DEVICE_SETTINGS \
BOOTENV
 
 #endif
-- 
2.20.1.97.g81188d93c3-goog

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


[U-Boot] [PATCH 16/18] rockchip: Implement spl_gpio in the GPIO driver

2019-01-09 Thread Simon Glass
Allow rockchip boards to use GPIOs before driver model is ready. This is
really only useful for setting GPIOs to enable the early debug console, if
needed on some platforms.

Signed-off-by: Simon Glass 
---

 arch/arm/include/asm/arch-rockchip/gpio.h | 29 ++
 drivers/gpio/rk_gpio.c| 46 +++
 2 files changed, 75 insertions(+)

diff --git a/arch/arm/include/asm/arch-rockchip/gpio.h 
b/arch/arm/include/asm/arch-rockchip/gpio.h
index e204dcfd1d..3b337c4d41 100644
--- a/arch/arm/include/asm/arch-rockchip/gpio.h
+++ b/arch/arm/include/asm/arch-rockchip/gpio.h
@@ -24,4 +24,33 @@ struct rockchip_gpio_regs {
 };
 check_member(rockchip_gpio_regs, ls_sync, 0x60);
 
+/* These defines are only used by spl_gpio.h */
+enum {
+   /* Banks have 8 GPIOs, so 3 bits, and there are 4 banks, so 2 bits */
+   GPIO_BANK_SHIFT = 3,
+   GPIO_BANK_MASK  = 3 << GPIO_BANK_SHIFT,
+
+   GPIO_OFFSET_MASK= 0x1f,
+};
+
+#define GPIO(bank, offset) ((bank) << GPIO_BANK_SHIFT | (offset))
+
+enum gpio_bank_t {
+   BANK_A = 0,
+   BANK_B,
+   BANK_C,
+   BANK_D,
+};
+
+enum gpio_dir_t {
+   GPIO_INPUT = 0,
+   GPIO_OUTPUT,
+};
+
+enum gpio_pull_t {
+   GPIO_PULL_NONE = 0,
+   GPIO_PULL_DOWN,
+   GPIO_PULL_UP,
+};
+
 #endif
diff --git a/drivers/gpio/rk_gpio.c b/drivers/gpio/rk_gpio.c
index a8f311bbd6..c4d0c4ff23 100644
--- a/drivers/gpio/rk_gpio.c
+++ b/drivers/gpio/rk_gpio.c
@@ -91,6 +91,52 @@ static int rockchip_gpio_get_function(struct udevice *dev, 
unsigned offset)
 #endif
 }
 
+/* Simple SPL interface to GPIOs */
+#ifdef CONFIG_SPL_BUILD
+
+enum {
+   PULL_NONE_1V8 = 0,
+   PULL_DOWN_1V8 = 1,
+   PULL_UP_1V8 = 3,
+};
+
+int spl_gpio_set_pull(void *vregs, uint gpio, int pull)
+{
+   u32 *regs = vregs;
+   uint val;
+
+   regs += gpio >> GPIO_BANK_SHIFT;
+   gpio &= GPIO_OFFSET_MASK;
+   switch (pull) {
+   case GPIO_PULL_UP:
+   val = PULL_UP_1V8;
+   break;
+   case GPIO_PULL_DOWN:
+   val = PULL_DOWN_1V8;
+   break;
+   case GPIO_PULL_NONE:
+   default:
+   val = PULL_NONE_1V8;
+   break;
+   }
+   clrsetbits_le32(regs, 3 << (gpio * 2), val << (gpio * 2));
+
+   return 0;
+}
+
+int spl_gpio_output(void *vregs, uint gpio, int value)
+{
+   struct rockchip_gpio_regs * const regs = vregs;
+
+   clrsetbits_le32(>swport_dr, 1 << gpio, value << gpio);
+
+   /* Set direction */
+   clrsetbits_le32(>swport_ddr, 1 << gpio, 1 << gpio);
+
+   return 0;
+}
+#endif /* CONFIG_SPL_BUILD */
+
 static int rockchip_gpio_probe(struct udevice *dev)
 {
struct gpio_dev_priv *uc_priv = dev_get_uclass_priv(dev);
-- 
2.20.1.97.g81188d93c3-goog

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


[U-Boot] [PATCH 17/18] rockchip: gru: Add extra device-tree settings

2019-01-09 Thread Simon Glass
Add some U-Boot-specific settings. These should really go in the
*u-boot.dtsi file, but it seems that rk3399 does not use that yet.

Signed-off-by: Simon Glass 
---

 arch/arm/dts/rk3399-gru-bob.dts |  1 +
 arch/arm/dts/rk3399-gru-chromebook.dtsi |  1 +
 arch/arm/dts/rk3399-gru.dtsi| 21 +
 3 files changed, 19 insertions(+), 4 deletions(-)

diff --git a/arch/arm/dts/rk3399-gru-bob.dts b/arch/arm/dts/rk3399-gru-bob.dts
index 1ee0dc0d9f..0e3d91fc28 100644
--- a/arch/arm/dts/rk3399-gru-bob.dts
+++ b/arch/arm/dts/rk3399-gru-bob.dts
@@ -7,6 +7,7 @@
 
 /dts-v1/;
 #include "rk3399-gru-chromebook.dtsi"
+#include "rk3399-sdram-lpddr3-samsung-4GB-1866.dtsi"
 
 / {
model = "Google Bob";
diff --git a/arch/arm/dts/rk3399-gru-chromebook.dtsi 
b/arch/arm/dts/rk3399-gru-chromebook.dtsi
index ff81dfda3b..c6495adcca 100644
--- a/arch/arm/dts/rk3399-gru-chromebook.dtsi
+++ b/arch/arm/dts/rk3399-gru-chromebook.dtsi
@@ -232,6 +232,7 @@
  {
status = "okay";
 
+   rockchip,panel = <_panel>;
ports {
edp_out: port@1 {
reg = <1>;
diff --git a/arch/arm/dts/rk3399-gru.dtsi b/arch/arm/dts/rk3399-gru.dtsi
index 7cc9b2642b..df19263acc 100644
--- a/arch/arm/dts/rk3399-gru.dtsi
+++ b/arch/arm/dts/rk3399-gru.dtsi
@@ -11,7 +11,13 @@
 
 / {
chosen {
+   u-boot,dm-pre-reloc;
stdout-path = "serial2:115200n8";
+   u-boot,spl-boot-order = _flash;
+   };
+
+   config {
+   u-boot,spl-payload-offset = <0x4>;
};
 
/*
@@ -539,12 +545,14 @@ ap_i2c_audio:  {
 
  {
status = "okay";
+   u-boot,dm-pre-reloc;
 
pinctrl-names = "default", "sleep";
pinctrl-1 = <_sleep>;
 
-   spiflash@0 {
-   compatible = "jedec,spi-nor";
+   spi_flash: spiflash@0 {
+   u-boot,dm-pre-reloc;
+   compatible = "jedec,spi-nor", "spi-flash";
reg = <0>;
 
/* May run faster once verified. */
@@ -558,12 +566,16 @@ ap_i2c_audio:  {
 
  {
status = "okay";
+   spi-activate-delay = <100>;
+   spi-max-frequency = <300>;
+   spi-deactivate-delay = <200>;
 
cros_ec: ec@0 {
compatible = "google,cros-ec-spi";
reg = <0>;
interrupt-parent = <>;
interrupts = <1 IRQ_TYPE_LEVEL_LOW>;
+   ec-interrupt = < 1 GPIO_ACTIVE_LOW>;
pinctrl-names = "default";
pinctrl-0 = <_ap_int_l>;
spi-max-frequency = <300>;
@@ -618,6 +630,7 @@ ap_i2c_audio:  {
 
  {
status = "okay";
+   u-boot,dm-pre-reloc;
 };
 
 _host0_ohci {
@@ -650,8 +663,8 @@ ap_i2c_audio:  {
status = "okay";
 };
 
-#include 
-#include 
+#include 
+#include 
 
  {
/*
-- 
2.20.1.97.g81188d93c3-goog

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


[U-Boot] [PATCH 06/18] rockchip: Drop note about supporting other SoCs

2019-01-09 Thread Simon Glass
Quite a wide range of Rockchip SoCs are supported in mainline U-Boot now,
so drop the comment about needing to add more.

Signed-off-by: Simon Glass 
---

 doc/README.rockchip | 9 +
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/doc/README.rockchip b/doc/README.rockchip
index 2b24ce8c06..a45b8a97b7 100644
--- a/doc/README.rockchip
+++ b/doc/README.rockchip
@@ -6,13 +6,7 @@
 U-Boot on Rockchip
 ==
 
-There are several repositories available with versions of U-Boot that support
-many Rockchip devices [1] [2].
-
-The current mainline support is experimental only and is not useful for
-anything. It should provide a base on which to build.
-
-So far only support for the RK3288 and RK3036 is provided.
+A wide range of Rockchip SoCs are supported in mainline U-Boot
 
 
 Prerequisites
@@ -303,7 +297,6 @@ Immediate priorities are:
 - USB device
 - Run CPU at full speed (code exists but we only see ~60 DMIPS maximum)
 - NAND flash
-- Support for other Rockchip parts
 - Boot U-Boot proper over USB OTG (at present only SPL works)
 
 
-- 
2.20.1.97.g81188d93c3-goog

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


[U-Boot] [PATCH 11/18] rockchip: Allow booting from SPI

2019-01-09 Thread Simon Glass
The u-boot,spl-boot-device property only allows MMC at present. Add SPI as
well for boards that boot from SPI flash.

Signed-off-by: Simon Glass 
---

 arch/arm/mach-rockchip/spl-boot-order.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/arm/mach-rockchip/spl-boot-order.c 
b/arch/arm/mach-rockchip/spl-boot-order.c
index 81a72cc263..0e485deda2 100644
--- a/arch/arm/mach-rockchip/spl-boot-order.c
+++ b/arch/arm/mach-rockchip/spl-boot-order.c
@@ -61,6 +61,9 @@ static int spl_node_to_boot_device(int node)
default:
return -ENOSYS;
}
+   } else if (!uclass_get_device_by_of_offset(UCLASS_SPI_FLASH, node,
+   )) {
+   return BOOT_DEVICE_SPI;
}
 
/*
-- 
2.20.1.97.g81188d93c3-goog

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


[U-Boot] [PATCH 08/18] rockchip: Adjust rk3399 device tree to be closer to linux

2019-01-09 Thread Simon Glass
This file has changed upstream, with some additions and changes. Move the
U-Boot version towards this.

Some USB changes seem to be incompatible with how the bindings work on
rockchip in U-Boot. Testing is needed to make sure that USB still works
correct, and adjust the code (not device tree) if not.

Signed-off-by: Simon Glass 
---

 arch/arm/dts/rk3399.dtsi | 432 +--
 1 file changed, 371 insertions(+), 61 deletions(-)

diff --git a/arch/arm/dts/rk3399.dtsi b/arch/arm/dts/rk3399.dtsi
index 21f156782f..b53e41b4dc 100644
--- a/arch/arm/dts/rk3399.dtsi
+++ b/arch/arm/dts/rk3399.dtsi
@@ -349,45 +349,105 @@
status = "disabled";
};
 
-   dwc3_typec0: usb@fe80 {
-   compatible = "rockchip,rk3399-xhci";
-   reg = <0x0 0xfe80 0x0 0x10>;
+   usbdrd3_0: dwc3_typec0: usb@fe80 {
+   compatible = "rockchip,rk3399-dwc3";
+   #address-cells = <2>;
+   #size-cells = <2>;
+   ranges;
+   clocks = < SCLK_USB3OTG0_REF>, < SCLK_USB3OTG0_SUSPEND>,
+< ACLK_USB3OTG0>, < ACLK_USB3_RKSOC_AXI_PERF>,
+< ACLK_USB3>, < ACLK_USB3_GRF>;
+   clock-names = "ref_clk", "suspend_clk",
+ "bus_clk", "aclk_usb3_rksoc_axi_perf",
+ "aclk_usb3", "grf_clk";
+   resets = < SRST_A_USB3_OTG0>;
+   reset-names = "usb3-otg";
status = "disabled";
-   snps,dis-enblslpm-quirk;
-   snps,phyif-utmi-bits = <16>;
-   snps,dis-u2-freeclk-exists-quirk;
-   snps,dis-u2-susphy-quirk;
 
+   usbdrd_dwc3_0: dwc3 {
+   compatible = "snps,dwc3";
+   reg = <0x0 0xfe80 0x0 0x10>;
+   interrupts = ;
+   dr_mode = "otg";
+   phys = <_otg>, <_usb3>;
+   phy-names = "usb2-phy", "usb3-phy";
+   phy_type = "utmi_wide";
+   snps,dis_enblslpm_quirk;
+   snps,dis-u2-freeclk-exists-quirk;
+   snps,dis_u2_susphy_quirk;
+   snps,dis-del-phy-power-chg-quirk;
+   snps,dis-tx-ipgap-linecheck-quirk;
+   power-domains = < RK3399_PD_USB3>;
+   status = "disabled";
+   };
+   };
+
+   dwc3_typec1: usbdrd3_1: usb@fe90 {
+   compatible = "rockchip,rk3399-dwc3";
#address-cells = <2>;
#size-cells = <2>;
-   hub {
-   compatible = "usb-hub";
-   usb,device-class = ;
-   };
-   typec_phy0 {
-   compatible = "rockchip,rk3399-usb3-phy";
-   reg = <0x0 0xff7c 0x0 0x4>;
+   ranges;
+   clocks = < SCLK_USB3OTG1_REF>, < SCLK_USB3OTG1_SUSPEND>,
+< ACLK_USB3OTG1>, < ACLK_USB3_RKSOC_AXI_PERF>,
+< ACLK_USB3>, < ACLK_USB3_GRF>;
+   clock-names = "ref_clk", "suspend_clk",
+ "bus_clk", "aclk_usb3_rksoc_axi_perf",
+ "aclk_usb3", "grf_clk";
+   resets = < SRST_A_USB3_OTG1>;
+   reset-names = "usb3-otg";
+   status = "disabled";
+
+   usbdrd_dwc3_1: dwc3 {
+   compatible = "snps,dwc3";
+   reg = <0x0 0xfe90 0x0 0x10>;
+   interrupts = ;
+   dr_mode = "otg";
+   phys = <_otg>, <_usb3>;
+   phy-names = "usb2-phy", "usb3-phy";
+   phy_type = "utmi_wide";
+   snps,dis_enblslpm_quirk;
+   snps,dis-u2-freeclk-exists-quirk;
+   snps,dis_u2_susphy_quirk;
+   snps,dis-del-phy-power-chg-quirk;
+   snps,dis-tx-ipgap-linecheck-quirk;
+   power-domains = < RK3399_PD_USB3>;
+   status = "disabled";
};
};
 
-   dwc3_typec1: usb@fe90 {
-   compatible = "rockchip,rk3399-xhci";
-   reg = <0x0 0xfe90 0x0 0x10>;
+   cdn_dp: dp@fec0 {
+   compatible = "rockchip,rk3399-cdn-dp";
+   reg = <0x0 0xfec0 0x0 0x10>;
+   interrupts = ;
+   assigned-clocks = < SCLK_DP_CORE>, < 
SCLK_SPDIF_REC_DPTX>;
+   assigned-clock-rates = <1>, <2>;
+   clocks = < SCLK_DP_CORE>, < PCLK_DP_CTRL>,
+< SCLK_SPDIF_REC_DPTX>, < PCLK_VIO_GRF>;
+   clock-names = "core-clk", "pclk", "spdif", "grf";
+   phys = <_dp>, <_dp>;
+ 

[U-Boot] [PATCH 05/18] rockchip: Add mention of other boards

2019-01-09 Thread Simon Glass
At present some Rockchip SoCs and boards are not mentioned in the README.
So that people can see which SoCs are supported, expand the list to
include everything.

Signed-off-by: Simon Glass 
---

 doc/README.rockchip | 43 +--
 1 file changed, 41 insertions(+), 2 deletions(-)

diff --git a/doc/README.rockchip b/doc/README.rockchip
index 51b00a9d85..2b24ce8c06 100644
--- a/doc/README.rockchip
+++ b/doc/README.rockchip
@@ -34,23 +34,62 @@ You will need:
 Building
 
 
-At present nine RK3288 boards are supported:
+At present 12 RK3288 boards are supported:
 
- EVB RK3288 - use evb-rk3288 configuration
- Fennec RK3288 - use fennec-rk3288 configuration
- Firefly RK3288 - use firefly-rk3288 configuration
- Hisense Chromebook - use chromebook_jerry configuration
+   - Asus C100P Chromebook - use chromebook_minnie configuration
+   - Asus Chromebit - use chromebook_mickey configuration
- MiQi RK3288 - use miqi-rk3288 configuration
- phyCORE-RK3288 RDK - use phycore-rk3288 configuration
- PopMetal RK3288 - use popmetal-rk3288 configuration
- Radxa Rock 2 - use rock2 configuration
- Tinker RK3288 - use tinker-rk3288 configuration
+   - Vyasa RK3288 - use vyasa-rk3288 configuration
 
-Two RK3036 board are supported:
+Two RK3036 boards are supported:
 
- EVB RK3036 - use evb-rk3036 configuration
- Kylin - use kylin_rk3036 configuration
 
+One RK3328 board is supported:
+
+   - EVB RK3328
+
+Five RK3399 boards are supported (aarch64):
+
+   - EBV RK3399 - use evb_rk3399 configuration
+   - Firefly RK3399 - use the same evb_rk3399 configuration
+   - Puma - use puma_rk3399 configuration
+   - Ficus - use ficus-rk3399 configuration
+   - Rock960 (Vamrs) - use rock960-rk3399 configuration
+
+Four RK3368 boards are supported:
+
+   - Sheep - use sheep-rk3368 configuration
+   - Lion - use lion-rk3368 configuration
+   - Geekbox - use geekbox configuration
+   - EVB PX5 - use evb-px5  configuration
+
+One RK3128 board is supported:
+
+   - EVB RK3128 - use evb-rk3128 configuration
+
+One RK3229 board is supported:
+
+   - EVB RK3229 - use evb-rk3229 configuration
+
+One RV1108 board is supported:
+
+   - Elgin R1 - use elgin-rv1108 configuration
+
+One RV3188 baord is supported:
+
+   - Raxda Rock - use rock configuration
+
+
 For example:
 
CROSS_COMPILE=arm-linux-gnueabi- make O=firefly firefly-rk3288_defconfig all
-- 
2.20.1.97.g81188d93c3-goog

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


[U-Boot] [PATCH 09/18] rockchip: evb_rk3399: Tidy up the README

2019-01-09 Thread Simon Glass
Add mention of a prerequisite needed to build the image. Also adjust the
English wording in a few places.

Ideally this should move to using binman to produce images, and avoid the
manual steps.

Signed-off-by: Simon Glass 
---

 board/rockchip/evb_rk3399/README | 33 
 1 file changed, 21 insertions(+), 12 deletions(-)

diff --git a/board/rockchip/evb_rk3399/README b/board/rockchip/evb_rk3399/README
index 8321467046..6469821987 100644
--- a/board/rockchip/evb_rk3399/README
+++ b/board/rockchip/evb_rk3399/README
@@ -35,21 +35,29 @@ Get the Source and prebuild binary
   > git clone https://github.com/rockchip-linux/rkbin.git
   > git clone https://github.com/rockchip-linux/rkdeveloptool.git
 
-Compile the ATF
-===
+Get some prerequisites
+==
+
+You need the Python elftools.elf.elffile library for make_fit_atf.py to work:
+
+  > sudo apt-get install python-pyelftools
+
+Compile ATF
+===
 
   > cd arm-trusted-firmware
   > make realclean
   > make CROSS_COMPILE=aarch64-linux-gnu- PLAT=rk3399 bl31
 
+  Get bl31.elf in this step, copy it to U-Boot root dir:
+  > cp build/rk3399/release/bl31/bl31.elf ../u-boot/
+
   Or you can get the bl31.elf directly from Rockchip:
-  cp rkbin/rk33/rk3399_bl31_v1.00.elf ../u-boot/bl31.elf
+  > cp rkbin/rk33/rk3399_bl31_v1.00.elf ../u-boot/bl31.elf
 
-  Get bl31.elf in this step, copy it to U-Boot root dir:
-  > cp bl31.elf ../u-boot/
 
-Compile the U-Boot
-==
+Compile U-Boot
+==
 
   > cd ../u-boot
   > export ARCH=arm64
@@ -62,17 +70,18 @@ Compile the U-Boot
 
   Get spl/u-boot-spl.bin and u-boot.itb in this step.
 
-Compile the rkdeveloptool
-===
-  Follow instructions in latest README
+Compile rkdeveloptool
+=
+
+Get rkdeveloptool installed on your Host in this step.
+
+Follow instructions in latest README, example:
   > cd ../rkdeveloptool
   > autoreconf -i
   > ./configure
   > make
   > sudo make install
 
-  Get rkdeveloptool in you Host in this step.
-
 Both origin binaries and Tool are ready now, choose either option 1 or
 option 2 to deploy U-Boot.
 
-- 
2.20.1.97.g81188d93c3-goog

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


[U-Boot] [PATCH 07/18] rockchip: Bring in device tree files for rk3399-gru

2019-01-09 Thread Simon Glass
Bring in these files from Linux v4.20.

Signed-off-by: Simon Glass 
---

 arch/arm/dts/rk3399-gru-bob.dts |  79 +++
 arch/arm/dts/rk3399-gru-chromebook.dtsi | 397 +++
 arch/arm/dts/rk3399-gru-kevin.dts   | 309 +
 arch/arm/dts/rk3399-gru.dtsi| 831 
 arch/arm/dts/rk3399-op1-opp.dtsi| 141 
 5 files changed, 1757 insertions(+)
 create mode 100644 arch/arm/dts/rk3399-gru-bob.dts
 create mode 100644 arch/arm/dts/rk3399-gru-chromebook.dtsi
 create mode 100644 arch/arm/dts/rk3399-gru-kevin.dts
 create mode 100644 arch/arm/dts/rk3399-gru.dtsi
 create mode 100644 arch/arm/dts/rk3399-op1-opp.dtsi

diff --git a/arch/arm/dts/rk3399-gru-bob.dts b/arch/arm/dts/rk3399-gru-bob.dts
new file mode 100644
index 00..1ee0dc0d9f
--- /dev/null
+++ b/arch/arm/dts/rk3399-gru-bob.dts
@@ -0,0 +1,79 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Google Gru-Bob Rev 4+ board device tree source
+ *
+ * Copyright 2018 Google, Inc
+ */
+
+/dts-v1/;
+#include "rk3399-gru-chromebook.dtsi"
+
+/ {
+   model = "Google Bob";
+   compatible = "google,bob-rev13", "google,bob-rev12",
+"google,bob-rev11", "google,bob-rev10",
+"google,bob-rev9", "google,bob-rev8",
+"google,bob-rev7", "google,bob-rev6",
+"google,bob-rev5", "google,bob-rev4",
+"google,bob", "google,gru", "rockchip,rk3399";
+
+   edp_panel: edp-panel {
+   compatible = "boe,nv101wxmn51", "simple-panel";
+   backlight = <>;
+   power-supply = <_disp>;
+
+   ports {
+   panel_in_edp: endpoint {
+   remote-endpoint = <_out_panel>;
+   };
+   };
+   };
+};
+
+_i2c_ts {
+   touchscreen: touchscreen@10 {
+   compatible = "elan,ekth3500";
+   reg = <0x10>;
+   interrupt-parent = <>;
+   interrupts = <13 IRQ_TYPE_LEVEL_LOW>;
+   pinctrl-names = "default";
+   pinctrl-0 = <_int_l _reset_l>;
+   reset-gpios = < 26 GPIO_ACTIVE_LOW>;
+   };
+};
+
+_i2c_tp {
+   trackpad: trackpad@15 {
+   compatible = "elan,ekth3000";
+   reg = <0x15>;
+   interrupt-parent = <>;
+   interrupts = <4 IRQ_TYPE_LEVEL_LOW>;
+   pinctrl-names = "default";
+   pinctrl-0 = <_int_l>;
+   wakeup-source;
+   };
+};
+
+ {
+   pwms = <_ec_pwm 0>;
+};
+
+_alert0 {
+   temperature = <65000>;
+};
+
+_alert1 {
+   temperature = <7>;
+};
+
+ {
+   status = "okay";
+};
+
+ {
+   tpm {
+   h1_int_od_l: h1-int-od-l {
+   rockchip,pins = <0 5 RK_FUNC_GPIO _pull_up>;
+   };
+   };
+};
diff --git a/arch/arm/dts/rk3399-gru-chromebook.dtsi 
b/arch/arm/dts/rk3399-gru-chromebook.dtsi
new file mode 100644
index 00..ff81dfda3b
--- /dev/null
+++ b/arch/arm/dts/rk3399-gru-chromebook.dtsi
@@ -0,0 +1,397 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Google Gru-Chromebook shared properties
+ *
+ * Copyright 2018 Google, Inc
+ */
+
+#include "rk3399-gru.dtsi"
+
+/ {
+   pp900_ap: pp900-ap {
+   compatible = "regulator-fixed";
+   regulator-name = "pp900_ap";
+
+   /* EC turns on w/ pp900_ap_en; always on for AP */
+   regulator-always-on;
+   regulator-boot-on;
+   regulator-min-microvolt = <90>;
+   regulator-max-microvolt = <90>;
+
+   vin-supply = <_sys>;
+   };
+
+   /* EC turns on w/ pp900_usb_en */
+   pp900_usb: pp900-ap {
+   };
+
+   /* EC turns on w/ pp900_pcie_en */
+   pp900_pcie: pp900-ap {
+   };
+
+   pp3000: pp3000 {
+   compatible = "regulator-fixed";
+   regulator-name = "pp3000";
+   pinctrl-names = "default";
+   pinctrl-0 = <_en>;
+
+   enable-active-high;
+   gpio = < 12 GPIO_ACTIVE_HIGH>;
+
+   regulator-always-on;
+   regulator-boot-on;
+   regulator-min-microvolt = <300>;
+   regulator-max-microvolt = <300>;
+
+   vin-supply = <_sys>;
+   };
+
+   ppvar_centerlogic_pwm: ppvar-centerlogic-pwm {
+   compatible = "pwm-regulator";
+   regulator-name = "ppvar_centerlogic_pwm";
+
+   pwms = < 0 3337 0>;
+   pwm-supply = <_sys>;
+   pwm-dutycycle-range = <100 0>;
+   pwm-dutycycle-unit = <100>;
+
+   /* EC turns on w/ ppvar_centerlogic_en; always on for AP */
+   regulator-always-on;
+   regulator-boot-on;
+   regulator-min-microvolt = <799434>;
+   regulator-max-microvolt = <1049925>;
+   };
+
+   

[U-Boot] [PATCH 04/18] gpio: Add a simple GPIO API for SPL

2019-01-09 Thread Simon Glass
In space-constrained environments or before driver model is available, it
is sometimes necessary to set GPIO values. Add an SPL API for this, to
allow early board code to change GPIOs. The caller must provide the
register address, so that the drivers can be fairly generic.

This API can be implemented by GPIO drivers, behind a suitable guard,
like #ifdef CONFIG_SPL_BUILD.

Signed-off-by: Simon Glass 
---

 include/spl_gpio.h | 62 ++
 1 file changed, 62 insertions(+)
 create mode 100644 include/spl_gpio.h

diff --git a/include/spl_gpio.h b/include/spl_gpio.h
new file mode 100644
index 00..e410e62914
--- /dev/null
+++ b/include/spl_gpio.h
@@ -0,0 +1,62 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Simple GPIO access from SPL. This only supports a single GPIO space,
+ * typically the SoC GPIO banks.
+ *
+ * Copyright 2018 Google LLC
+ */
+
+#ifndef __SPL_GPIO_H
+#define __SPL_GPIO_H
+
+#include 
+
+/*
+ * The functions listed here should be implemented in the SoC GPIO driver.
+ * They correspond to the normal GPIO API (asm-generic/gpio.h). The GPIO
+ * number is encoded in an unsigned int by an SoC-specific means. Pull
+ * values are also SoC-specific.
+ *
+ * This API should only be used in TPL/SPL where GPIO access is needed but
+ * driver model is not available (yet) or adds too much overhead.
+ *
+ * The caller must supply the GPIO register base since this information is
+ * often specific to a particular SoC generation. This allows the GPIO
+ * code to be fairly generic.
+ *
+ * Only a single implementation of each of these functions can be provided.
+ *
+ * The 'gpio' value can include both a bank and a GPIO number, if desired. The
+ * encoding is SoC-specific.
+ */
+
+/**
+ * spl_gpio_set_pull() - Set the pull up/down state of a GPIO
+ *
+ * @regs: Pointer to GPIO registers
+ * @gpio: GPIO to adjust (SoC-specific)
+ * @pull: Pull value (SoC-specific)
+ * @return return 0 if OK, -ve on error
+ */
+int spl_gpio_set_pull(void *regs, uint gpio, int pull);
+
+/**
+ * spl_gpio_output() - Set a GPIO as an output
+ *
+ * @regs: Pointer to GPIO registers
+ * @gpio: GPIO to adjust (SoC-specific)
+ * @value: 0 to set the output low, 1 to set it high
+ * @return return 0 if OK, -ve on error
+ */
+int spl_gpio_output(void *regs, uint gpio, int value);
+
+/**
+ * spl_gpio_input() - Set a GPIO as an input
+ *
+ * @regs: Pointer to GPIO registers
+ * @gpio: GPIO to adjust (SoC-specific)
+ * @return return 0 if OK, -ve on error
+ */
+int spl_gpio_input(void *regs, uint gpio);
+
+#endif /* __SPL_GPIO_H */
-- 
2.20.1.97.g81188d93c3-goog

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


[U-Boot] [PATCH 03/18] gpio: Use more command-specific enums values

2019-01-09 Thread Simon Glass
At present this file uses GPIO_OUTPUT and GPIO_INPUT as its sub-command
values. These are pretty generic names. Add a 'C' suffix to avoid possible
conflicts.

Signed-off-by: Simon Glass 
---

 cmd/gpio.c | 37 +++--
 1 file changed, 23 insertions(+), 14 deletions(-)

diff --git a/cmd/gpio.c b/cmd/gpio.c
index ecdc453918..77d2573562 100644
--- a/cmd/gpio.c
+++ b/cmd/gpio.c
@@ -18,10 +18,10 @@ __weak int name_to_gpio(const char *name)
 }
 
 enum gpio_cmd {
-   GPIO_INPUT,
-   GPIO_SET,
-   GPIO_CLEAR,
-   GPIO_TOGGLE,
+   GPIOC_INPUT,
+   GPIOC_SET,
+   GPIOC_CLEAR,
+   GPIOC_TOGGLE,
 };
 
 #if defined(CONFIG_DM_GPIO) && !defined(gpio_status)
@@ -158,11 +158,20 @@ static int do_gpio(cmd_tbl_t *cmdtp, int flag, int argc, 
char * const argv[])
 
/* parse the behavior */
switch (*str_cmd) {
-   case 'i': sub_cmd = GPIO_INPUT;  break;
-   case 's': sub_cmd = GPIO_SET;break;
-   case 'c': sub_cmd = GPIO_CLEAR;  break;
-   case 't': sub_cmd = GPIO_TOGGLE; break;
-   default:  goto show_usage;
+   case 'i':
+   sub_cmd = GPIOC_INPUT;
+   break;
+   case 's':
+   sub_cmd = GPIOC_SET;
+   break;
+   case 'c':
+   sub_cmd = GPIOC_CLEAR;
+   break;
+   case 't':
+   sub_cmd = GPIOC_TOGGLE;
+   break;
+   default:
+   goto show_usage;
}
 
 #if defined(CONFIG_DM_GPIO)
@@ -192,18 +201,18 @@ static int do_gpio(cmd_tbl_t *cmdtp, int flag, int argc, 
char * const argv[])
}
 
/* finally, let's do it: set direction and exec command */
-   if (sub_cmd == GPIO_INPUT) {
+   if (sub_cmd == GPIOC_INPUT) {
gpio_direction_input(gpio);
value = gpio_get_value(gpio);
} else {
switch (sub_cmd) {
-   case GPIO_SET:
+   case GPIOC_SET:
value = 1;
break;
-   case GPIO_CLEAR:
+   case GPIOC_CLEAR:
value = 0;
break;
-   case GPIO_TOGGLE:
+   case GPIOC_TOGGLE:
value = gpio_get_value(gpio);
if (!IS_ERR_VALUE(value))
value = !value;
@@ -218,7 +227,7 @@ static int do_gpio(cmd_tbl_t *cmdtp, int flag, int argc, 
char * const argv[])
printf("unknown (ret=%d)\n", value);
else
printf("%d\n", value);
-   if (sub_cmd != GPIO_INPUT && !IS_ERR_VALUE(value)) {
+   if (sub_cmd != GPIOC_INPUT && !IS_ERR_VALUE(value)) {
int nval = gpio_get_value(gpio);
 
if (IS_ERR_VALUE(nval))
-- 
2.20.1.97.g81188d93c3-goog

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


[U-Boot] [PATCH 01/18] lib: Allow using display_buffer() in SPL

2019-01-09 Thread Simon Glass
At present this function uses printf() format strings that are not
supported in SPL, so the output just consists of %llx strings on 64-bit.
machines. Fix this by adding a special case.

Signed-off-by: Simon Glass 
---

 lib/display_options.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/display_options.c b/lib/display_options.c
index 32849821f4..af1802ef99 100644
--- a/lib/display_options.c
+++ b/lib/display_options.c
@@ -174,7 +174,9 @@ int print_buffer(ulong addr, const void *data, uint width, 
uint count,
x = lb.us[i] = *(volatile uint16_t *)data;
else
x = lb.uc[i] = *(volatile uint8_t *)data;
-#ifdef CONFIG_SYS_SUPPORT_64BIT_DATA
+#if defined(CONFIG_SPL_BUILD)
+   printf(" %x", (uint)x);
+#elif defined(CONFIG_SYS_SUPPORT_64BIT_DATA)
printf(" %0*llx", width * 2, (long long)x);
 #else
printf(" %0*x", width * 2, x);
-- 
2.20.1.97.g81188d93c3-goog

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


[U-Boot] [PATCH 02/18] clk: Improve debug message in clk_set_default_rates()

2019-01-09 Thread Simon Glass
It is helpful to print the clock number as well as the index, so that this
can be looked up in the binding file. Update the debug() statement to do
this.

Signed-off-by: Simon Glass 
---

 drivers/clk/clk-uclass.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/clk/clk-uclass.c b/drivers/clk/clk-uclass.c
index 6d7a514006..844b87cc33 100644
--- a/drivers/clk/clk-uclass.c
+++ b/drivers/clk/clk-uclass.c
@@ -228,8 +228,8 @@ static int clk_set_default_rates(struct udevice *dev)
 
ret = clk_set_rate(, rates[index]);
if (ret < 0) {
-   debug("%s: failed to set rate on clock %d for %s\n",
- __func__, index, dev_read_name(dev));
+   debug("%s: failed to set rate on clock index %d (%ld) 
for %s\n",
+ __func__, index, clk.id, dev_read_name(dev));
break;
}
}
-- 
2.20.1.97.g81188d93c3-goog

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


[U-Boot] [PATCH 00/18] rockchip: Add support for Bob Chromebook

2019-01-09 Thread Simon Glass
This series adds basic support for Bob which is based on RK3399. Quite a
bit of work remains to get this into fully working condition.

This series is based on the rockchip pinctrl drivers series by David Wu.


Simon Glass (18):
  lib: Allow using display_buffer() in SPL
  clk: Improve debug message in clk_set_default_rates()
  gpio: Use more command-specific enums values
  gpio: Add a simple GPIO API for SPL
  rockchip: Add mention of other boards
  rockchip: Drop note about supporting other SoCs
  rockchip: Bring in device tree files for rk3399-gru
  rockchip: Adjust rk3399 device tree to be closer to linux
  rockchip: evb_rk3399: Tidy up the README
  rockchip: Clarify docs on SPI writing
  rockchip: Allow booting from SPI
  rockchip: Add settings for Samsung LPDDR3 4GB SDRAM 1866MHz
  rockchip: clk: Add mention of four new clocks
  rockchip: Tidy up board include-file ordering
  rockchip: rk3399: Add ROCKCHIP_DEVICE_SETTINGS to set env
  rockchip: Implement spl_gpio in the GPIO driver
  rockchip: gru: Add extra device-tree settings
  rockchip: Add support for chromebook_bob

 arch/arm/dts/rk3399-gru-bob.dts   |   80 +
 arch/arm/dts/rk3399-gru-chromebook.dtsi   |  398 +
 arch/arm/dts/rk3399-gru-kevin.dts |  309 
 arch/arm/dts/rk3399-gru.dtsi  |  844 +
 arch/arm/dts/rk3399-op1-opp.dtsi  |  141 ++
 .../rk3399-sdram-lpddr3-samsung-4GB-1866.dtsi | 1542 +
 arch/arm/dts/rk3399.dtsi  |  432 -
 arch/arm/include/asm/arch-rockchip/gpio.h |   29 +
 .../arm/include/asm/arch-rockchip/sys_proto.h |3 +
 arch/arm/mach-rockchip/rk3036-board.c |2 +-
 arch/arm/mach-rockchip/rk3188-board-spl.c |2 +-
 arch/arm/mach-rockchip/rk3188-board.c |2 +-
 arch/arm/mach-rockchip/rk322x-board.c |2 +-
 arch/arm/mach-rockchip/rk3368-board-spl.c |2 +-
 arch/arm/mach-rockchip/rk3368-board-tpl.c |4 +-
 arch/arm/mach-rockchip/rk3399-board-spl.c |   49 +-
 arch/arm/mach-rockchip/rk3399/Kconfig |   10 +
 arch/arm/mach-rockchip/spl-boot-order.c   |3 +
 board/google/gru/Kconfig  |   15 +
 board/google/gru/MAINTAINERS  |6 +
 board/google/gru/Makefile |5 +
 board/google/gru/gru.c|   16 +
 board/rockchip/evb_rk3399/README  |   33 +-
 cmd/gpio.c|   37 +-
 configs/chromebook_bob_defconfig  |  100 ++
 doc/README.rockchip   |   58 +-
 drivers/clk/clk-uclass.c  |4 +-
 drivers/clk/rockchip/clk_rk3399.c |   12 +
 drivers/gpio/rk_gpio.c|   46 +
 include/configs/gru.h |   18 +
 include/configs/rk3399_common.h   |5 +
 include/spl_gpio.h|   62 +
 lib/display_options.c |4 +-
 33 files changed, 4159 insertions(+), 116 deletions(-)
 create mode 100644 arch/arm/dts/rk3399-gru-bob.dts
 create mode 100644 arch/arm/dts/rk3399-gru-chromebook.dtsi
 create mode 100644 arch/arm/dts/rk3399-gru-kevin.dts
 create mode 100644 arch/arm/dts/rk3399-gru.dtsi
 create mode 100644 arch/arm/dts/rk3399-op1-opp.dtsi
 create mode 100644 arch/arm/dts/rk3399-sdram-lpddr3-samsung-4GB-1866.dtsi
 create mode 100644 board/google/gru/Kconfig
 create mode 100644 board/google/gru/MAINTAINERS
 create mode 100644 board/google/gru/Makefile
 create mode 100644 board/google/gru/gru.c
 create mode 100644 configs/chromebook_bob_defconfig
 create mode 100644 include/configs/gru.h
 create mode 100644 include/spl_gpio.h

-- 
2.20.1.97.g81188d93c3-goog

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


Re: [U-Boot] [PATCH v2] misc: fs_loader: Add support for initializing MMC

2019-01-09 Thread Chee, Tien Fong
On Wed, 2019-01-09 at 09:19 -0700, Simon Glass wrote:
> Hi Tien Fong,
> 
> On Sat, 29 Dec 2018 at 18:36,  wrote:
> > 
> > 
> > From: Tien Fong Chee 
> > 
> > Firmware loader would encounter problem if the MMC is accessed
> > before
> > initializing it. This patch would adding the support of probing
> > block
> > device and initializing MMC before the MMC is accessed by firmware
> > loader.
> > 
> > Signed-off-by: Tien Fong Chee 
> > ---
> > 
> > Changes in v2:
> > - Initializing MMC through probing the blk device
> > ---
> >  drivers/misc/fs_loader.c | 33 +
> >  1 file changed, 33 insertions(+)
> > 
> > diff --git a/drivers/misc/fs_loader.c b/drivers/misc/fs_loader.c
> > index 57a14a3..5858073 100644
> > --- a/drivers/misc/fs_loader.c
> > +++ b/drivers/misc/fs_loader.c
> > @@ -12,6 +12,7 @@
> >  #include 
> >  #include 
> >  #include 
> > +#include 
> >  #include 
> > 
> >  DECLARE_GLOBAL_DATA_PTR;
> > @@ -252,6 +253,38 @@ static int fs_loader_ofdata_to_platdata(struct
> > udevice *dev)
> > 
> >  static int fs_loader_probe(struct udevice *dev)
> >  {
> > +#if defined(CONFIG_DM_MMC) && defined(CONFIG_BLK)
> > +   int ret;
> > +   struct device_platdata *plat = dev->platdata;
> > +
> > +   ret = mmc_initialize(NULL);
> You should not need this since the MMC device should init itself when
> probed.
Noted.
> 
> > 
> > +   if (ret) {
> > +   debug("MMC: could not initialize mmc. error: %d\n",
> > ret);
> > +
> > +   return ret;
> > +   }
> > +
> > +   if (plat->phandlepart.phandle) {
> > +   ofnode node = ofnode_get_by_phandle(plat-
> > >phandlepart.phandle);
> > +
> > +   struct udevice *mmc_dev = NULL;
> > +
> > +   ret = device_get_global_by_ofnode(node, _dev);
> You could use this?
> 
> uclass_get_device_by_ofnode(UCLASS_MMC, node, _dev)
Okay.
> 
> But actually I think you should drop any mention of MMC so that your
> code can work for any storage uclass.
I agree with you, we should made the probing generic to any storage
uclass.

But now i'm not familiar with all storage uclass yet, so my strategy is
getting one storage uclass in at a time, and restructure the probing if
there is commonality for the next storage uclass. With that, we can
control the quality and achieving the goal step by step.

What do you think?
> 
> > 
> > +   if (!ret) {
> > +   struct mmc *mmc = mmc_get_mmc_dev(mmc_dev);
> > +   struct udevice *dev;
> > +
> > +   ret = blk_get_from_parent(mmc->dev, );
> You are going from mmc_dev -> mmc -> mmc->dev, but unless I am
> mistaken, mmc_dev == mmc->dev. So you should be able to simplify this
> to:
> 
>    ret = blk_get_from_parent(mmc_dev, );
Okay,noted.
> 
> Also you should be able to rename mmc to something more generic, e.g.
> to make this work with SATA.
Replied in above.
> 
> > 
> > +   if (ret) {
> > +   debug("MMC: No block device: %d\n",
> > +   ret);
> > +
> > +   return ret;
> > +   }
> > +   }
> > +   }
> > +#endif
> > +
> > return 0;
> >  };
> > 
> > --
> > 2.2.0
> > 
> Regards,
> Simon
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH] arm: ti: boot: Fix am57xx evm fdtfile name

2019-01-09 Thread Lokesh Vutla


On 1/10/2019 1:55 AM, Praneeth Bajjuri wrote:
> am57xx evm uses am57xx-evm-reva3.dtb.
> update findfdt to pick the correct default dtb
> 
> Signed-off-by: Praneeth Bajjuri 
> ---
>  include/environment/ti/boot.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/environment/ti/boot.h b/include/environment/ti/boot.h
> index 86ff6d3ea7c6..c9ad3046acaa 100644
> --- a/include/environment/ti/boot.h
> +++ b/include/environment/ti/boot.h
> @@ -125,7 +125,7 @@
>   "if test $board_name = am57xx_evm; then " \
>   "setenv fdtfile am57xx-beagle-x15.dtb; fi;" \
>   "if test $board_name = am57xx_evm_reva3; then " \
> - "setenv fdtfile am57xx-beagle-x15.dtb; fi;" \
> + "setenv fdtfile am57xx-evm-reva3.dtb; fi;" \

I do not see this dts in kernel. Either it is not upstream or we are
suposed to use overlays in this case.

Thanks and regards,
Lokesh

>   "if test $board_name = am571x_idk; then " \
>   "setenv fdtfile am571x-idk.dtb; fi;" \
>   "if test $fdtfile = undefined; then " \
> 
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] Makefile: Correct logic for DM_SCSI + unconverted drivers check

2019-01-09 Thread Tom Rini
On Mon, Jan 07, 2019 at 10:57:56PM -0500, Tom Rini wrote:

> When checking for boards that are enabling a SATA driver that isn't
> converted to DM yet we need to be sure to not also trip over boards that
> do set CONFIG_DM_SCSI by itself, as that is not a bug.
> 
> Reported-by: Andy Shevchenko 
> Fixes: ea9d7c17fc4c ("dm: MIGRATION: Add migration plan for CONFIG_SATA")
> Signed-off-by: Tom Rini 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] arm: ti: boot: Remove legacy Android partitions

2019-01-09 Thread Tom Rini
On Fri, Jan 04, 2019 at 10:09:08PM +0200, Sam Protsenko wrote:

> Remove unused Android partitions:
>   - efs, crypto, cache: we don't use it anymore (images are not built
> in AOSP
>   - ipu1, ipu2: IPU firmware is now a part of vendor image and doesn't
> reside as a separate partition
> 
> While at it, rename "reserved" partition to "uboot-env", as it's
> actually stores U-Boot environment.
> 
> Signed-off-by: Sam Protsenko 
> Signed-off-by: Praneeth Bajjuri 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] env: sata: Fix saveenv issue

2019-01-09 Thread Tom Rini
On Mon, Jan 07, 2019 at 09:22:35AM +, Ye Li wrote:

> Wrong env buffer was passed into sata write function, cause the saveenv
> not work.
> 
> Signed-off-by: Ye Li 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [U-Boot, v1, 1/2] gpio: stm32f7: Fix gpio bank hole management

2019-01-09 Thread Tom Rini
On Fri, Jan 04, 2019 at 10:55:05AM +0100, Patrice Chotard wrote:

> In case "gpio-ranges" property is not present in device tree,
> use default value for gpio_count and gpio_range.
> This fixes an issue on stm32 F7 and H7 boards where "pinmux status -a"
> command didn't return any pin status due to the fact that both stm32 F7
> and H7 board DT doesn't use the gpio-ranges property.
> 
> Fixes: dbf928dd2634a6("gpio: stm32f7: Add gpio bank holes management")
> 
> Signed-off-by: Patrice Chotard 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [U-Boot,v1,2/2] gpio: stm32f7: Fix SPL code size

2019-01-09 Thread Tom Rini
On Fri, Jan 04, 2019 at 10:55:06AM +0100, Patrice Chotard wrote:

> In order to keep SPL code size below the 32Kb limit,
> put under CONFIG_SPL_BUILD flag all unused code in SPL.
> This is needed for stm32f7xx board which are using SPL.
> 
> Signed-off-by: Patrice Chotard 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [U-Boot, v3, 1/2] dm: pci: MIGRATION: Add migration plan for PCI

2019-01-09 Thread Tom Rini
On Fri, Dec 28, 2018 at 02:03:07PM -0700, Simon Glass wrote:

> Add a migration plan for PCI which is an important subsystem in U-Boot.
> 
> Signed-off-by: Simon Glass 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] env: sata: Add missed env location for SATA boot

2019-01-09 Thread Tom Rini
On Fri, Jan 04, 2019 at 09:34:24AM +, Ye Li wrote:

> The env location label ENVL_ESATA is missed in location tables, so
> when we configure the ENV in SATA, u-boot fails to get correct env
> location and cause boot hang in board_f.
> 
> Signed-off-by: Ye Li 
> Reviewed-by: Peng Fan 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [U-Boot,1/1] doc: README.commands: fix type

2019-01-09 Thread Tom Rini
On Sun, Dec 30, 2018 at 01:00:51PM +0100, Heinrich Schuchardt wrote:

> %s/commmand/command/
> 
> Signed-off-by: Heinrich Schuchardt 
> Reviewed-by: Simon Glass 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] Add a github template telling people to not use pull requests there

2019-01-09 Thread Tom Rini
On Thu, Dec 27, 2018 at 09:22:55AM -0500, Tom Rini wrote:

> On our mirror account on github we have gotten a handful of pull
> requests.  At this time github does not allow you to disable pull
> requests on a project.  The generally suggested work-around is to add a
> pull request template that tells people to not use that workflow.  Add
> one here that points to the wiki page on submitted patches.
> 
> Signed-off-by: Tom Rini 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [U-Boot, 1/2] igep003x: MAINTAINER: Remove myself as maintainer and add Javier

2019-01-09 Thread Tom Rini
On Fri, Dec 28, 2018 at 11:55:47AM +0100, Enric Balletbo i Serra wrote:

> I can't continue maintaining the board because I don't have access to the
> hardware anymore, so remove myself from the entry and add Javier who has
> volunteered to help and maintain the board.
> 
> Signed-off-by: Enric Balletbo i Serra 
> Signed-off-by: Javier Martínez Canillas 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [U-Boot, v3, 2/2] dm: video: lcd: MIGRATION: Add migration plan for video

2019-01-09 Thread Tom Rini
On Fri, Dec 28, 2018 at 02:03:08PM -0700, Simon Glass wrote:

> Add a migration plan for video which is an important subsystem in U-Boot.
> 
> Signed-off-by: Simon Glass 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] arm: Round the dma_alloc_coherent memory size to cache line aligned

2019-01-09 Thread Tom Rini
On Fri, Jan 04, 2019 at 09:24:14AM +, Ye Li wrote:

> When running usb dwc3 gadget driver, we meet random USB enumeration failure 
> in fastboot.
> The root cause is a cache coherence issue. When it happens, the ctrl_req in
> gadget driver is allocated at 0xfe932f40, and the usb_composite_dev (cdev)
> is allocated at 0xfe932f60. So after we submit the setup request (cache 
> flushed) to USB
> controller, any accessing to usb_composite_dev variable will cause the cache 
> line refill, then
> when setup transfer is completed, reading the setup data in ctrl_req will 
> gets old value from
> cache not from memory.
> 
> The ctrl_req is allocated by API dma_alloc_coherent, but u-boot don't have 
> cohernet memory.
> so it still needs cache maintain operations before/after HW accessing. Since 
> the cache flush or
> invalidate bases on cache line, so when the allocated memory size is not 
> cache line aligned,
> potentially it may meet such issue.
> 
> This patch modifies the dma_alloc_coherent API to round the size to cache 
> line aligned.
> 
> Signed-off-by: Ye Li 
> Reviewed-by: Peng Fan 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [U-Boot, 2/2] mmc: bring back partition init for non-DM MMC drivers

2019-01-09 Thread Tom Rini
On Mon, Dec 17, 2018 at 10:05:45AM +, Andre Przywara wrote:

> Commit d0851c893706 ("blk: Call part_init() in the post_probe() method")
> removed the call to part_init() in mmc.c, as this is done by the DM_MMC
> framework.
> However Allwinner is (still) relying on a non-DM MMC driver, so we are
> now missing the implicit partition init, leading to failing MMC accesses
> due to the missing partition information.
> 
> Bring the call back just for non-DM MMC driver to fix this regression.
> 
> Signed-off-by: Andre Przywara 
> Reviewed-by: Simon Glass 
> Tested-by: Soeren Moch 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [PATCH 2/2] board: tbs2910: Remove FIT support in defconfig to reduce u-boot size

2019-01-09 Thread Tom Rini
On Thu, Jan 10, 2019 at 02:28:23AM +0100, Soeren Moch wrote:
> 
> 
> On 09.01.19 23:39, Tom Rini wrote:
> > On Wed, Jan 09, 2019 at 05:01:37PM +0100, Stefano Babic wrote:
> >> Hi Soeren,
> >>
> >> On 08/01/19 12:03, Soeren Moch wrote:
> >>> Hi Stefano,
> >>>
> >>> On 08.01.19 11:24, Stefano Babic wrote:
>  Hi Soeren,
> 
>  On 08/01/19 11:14, Soeren Moch wrote:
> > Stefano,
> >
> > can you apply this for v2019.01? This is really a important fix to avoid
> >  environment and u-boot binary overwriting each other.
> > It is also a small local fix which cannot hurt anybody else.
>  I will apply and I send a new PR. This is not the first fix in this
>  direction, u-boot becomes pretty large, it is becoming a common problem.
> 
> >>> Thank you very much.
> >>>
> >>> Yes, "in the good old days (tm)" there was much effort put into not
> >>> increasing the binary size for existing boards when adding new features.
> >> Right, fully agree.
> >>
> >>> Unfortunately this is not true anymore.
> >> I get in the same trouble with more as one project. A previous rule of
> >> thumb was to reserve 512KB to the bootloader because it was pretty
> >> unthinkable that bootloader could be larger. Mhmmhhthis remember me
> >> someone else who said that 640Kb is enough for everything.
> >>
> >> Anyway, as you noted, this is a big problem in field and it makes
> >> difficult an upgrade without returning back the device to factory, what
> >> nobody wants.
> > So, this is more on me, so I should probably explain a little, and point
> > at the biggest culprit too.  The biggest at times culprit and sometimes
> > controversial thing is that we default to the EFI subsystem being on by
> > default.  This is 50KiB on tbs2910.  Why default?  Well, "everyone"
> > agrees that defaulting to EFI application support means the widest
> > choice of out of the box software support.
> >
> Hm, AFAIK EFI support is very uncommon for arm32, at least for pre-arm64
> boards. The usual way for firmware updates was to load a special

Yes, there's some amount of chicken-and-egg but it's there and growing.

> UEnv.txt or boot.scr with commands. But OK, maybe it is more modern or
> more convenient these days to support EFI, maybe a good idea to
> default=y, but why this is not disabled in old board's defconfigs then?

While it's default y and means we're even enabling it on pre-v7
processors, the general answer is that defaults matter especially when
things get forked off for a custom project or for a new reference
platform, and it's something that can always be turned off.  i.MX is in
fact where a number of platforms have gone for opt-out.

> Either "automatically" like in the Kconfig conversions, or via a short
> notice to the relevant board maintainers?

I've been bad about communicating stuff to board maintainers, so that's
on me.  I have been, more of late at least, mentioning them in the
release emails, and now that we have build-time warnings (which are long
over-due, sorry!) I hope it will be more visible.  But I haven't come up
with a good way to not too painfully email the 300 or so people listed
as a maintainer for something under boards/.  I need to 'tho.

> I also noticed this EFI support as big, but disabling it is more
> complicated than disabling FIT, and we are at -rc3. Maybe I will send a
> corresponding patch for the next merge window.

It shouldn't be more than just disabling CONFIG_EFI_LOADER.

> > And I do look at size changes, at least per push to master.  So most of
> > the time it comes in "drips and drabs".  Right now I'm going to grow
> > tbs2910 by 60 bytes[1].  Most of that is section re-alignment and 8 of it
> > is the regression fix to mmc_startup() or non-DM MMC drivers.  But
> > that's not super interesting, so lets look at v2018.09 to now.  That's
> > 1800 bytes.  That's not too bad and looks like it's maybe half bug
> > fixes, half working on various frameworks (sure, DM/DT stuff but also
> > hash algos.  If we jump back to v2018.01, so more or less a year worth
> > of changes, that's 19KiB.  Without trying to break down _everything_
> > that's a good bit of EFI and a little bit everywhere else.
> I fully understand that this is not a easy job for you. And usually a
> few kiB are not a big deal. But the one kiB that overwrites the
> environment on eMMC (and therefore often bricks the board) is very very
> inconvenient for users.

Right, it's bad, I agree.  Which is part of my further lament about the
build-time size check.

> >>> And all the shiny new driver model / OF features only bring
> >>> disadvantages for maintainers and users of existing boards.
> >>>
> >>> I totally understand the desire to convert the driver code to "something
> >>> better", which is easier to maintain long-term. But apparently new code
> >>> is only tested on a single platform, while constantly breaking support
> >>> for others without notice. But 'm complaining to the wrong person...
> >> Yes, I am 

Re: [U-Boot] [U-Boot, 1/2] sunxi: drop default SPL_LIBDISK_SUPPORT enablement

2019-01-09 Thread Tom Rini
On Mon, Dec 17, 2018 at 10:05:44AM +, Andre Przywara wrote:

> There is no code for using partition labels in the Allwinner SPL port.
> Even so the name is slightly misleading, CONFIG_SPL_LIBDISK_SUPPORT was
> meant to guard partition code for the SPL.
> 
> Remove the "imply" line in the Kconfig to make this obvious and avoid
> unneeded code inclusions, helping to keep the H6 SPL code small.
> 
> Signed-off-by: Andre Przywara 
> Reviewed-by: Simon Glass 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [PATCH v2 2/3] efi_loader: enumerate disk devices every time

2019-01-09 Thread AKASHI Takahiro
Alex,

On Wed, Jan 09, 2019 at 10:06:16AM +0100, Alexander Graf wrote:
> 
> 
> On 13.12.18 08:58, AKASHI Takahiro wrote:
> > Heinrich,
> > 
> > On Tue, Dec 11, 2018 at 08:55:41PM +0100, Heinrich Schuchardt wrote:
> >> On 11/15/18 5:58 AM, AKASHI Takahiro wrote:
> >>> Currently, efi_init_obj_list() scan disk devices only once, and never
> >>> change a list of efi disk devices. This will possibly result in failing
> >>> to find a removable storage which may be added later on. See [1].
> >>>
> >>> In this patch, called is efi_disk_update() which is responsible for
> >>> re-scanning UCLASS_BLK devices and removing/adding efi disks if necessary.
> >>>
> >>> For example,
> >>>
> >>> => efishell devices
> >>> Scanning disk pci_mmc.blk...
> >>> Found 3 disks
> >>> Device Name
> >>> 
> >>> /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)
> >>> /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)/SD(0)/SD(0)
> >>> /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)/SD(0)/SD(0)/HD(2,MBR,0x086246ba,0x40800,0x3f800)
> >>> => usb start
> >>> starting USB...
> >>> USB0:   USB EHCI 1.00
> >>> scanning bus 0 for devices... 3 USB Device(s) found
> >>>scanning usb for storage devices... 1 Storage Device(s) found
> >>> => efishell devices
> >>> Scanning disk usb_mass_storage.lun0...
> >>> Device Name
> >>> 
> >>> /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)
> >>> /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)/SD(0)/SD(0)
> >>> /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)/SD(0)/SD(0)/HD(2,MBR,0x086246ba,0x40800,0x3f800)
> >>> /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)/USBClass(0,0,9,0,1)/USBClass(46f4,1,0,0,0)/HD(1,0x01,0,0x40,0x14fe4c)
> >>>
> >>> Without this patch, the last device, USB mass storage, won't show up.
> >>>
> >>> [1] https://lists.denx.de/pipermail/u-boot/2018-October/345307.html
> >>>
> >>> Signed-off-by: AKASHI Takahiro 
> >>
> >> Why should we try to fix something in the EFI subsystems that goes wrong
> >> in the handling of device enumeration.
> > 
> > No.
> > This is a natural result from how efi disks are currently implemented on 
> > u-boot.
> > Do you want to totally re-write/re-implement efi disks?
> 
> Could we just make this event based for now? Call a hook from the
> storage dm subsystem when a new u-boot block device gets created to
> issue a sync of that in the efi subsystem?

If I correctly understand you, your suggestion here corresponds
with my proposal#3 in [1] while my current approach is #2.

[1] https://lists.denx.de/pipermail/u-boot/2018-October/345307.html

So we will call, say, efi_disk_create(struct udevice *) in
blk_create_device() and efi_dsik_delete() in blk_unbind_all().
UEFI handles for disks, however, will *not* be deleted actually
because, as Heinrich suggested in the past, no *reference count*
for a handle is maintained in the current implementation. Right?

> That hook would obviously only do something (or get registered?) when
> the efi object stack is initialized.
> 
> The long term goal IMHO should still be though to just merge DM and EFI
> objects. But we're still waiting on the deprecation of non-DM devices
> for that.

Maybe my #4?

-Takahiro Akashi

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


Re: [U-Boot] [PATCH 2/2] board: tbs2910: Remove FIT support in defconfig to reduce u-boot size

2019-01-09 Thread Soeren Moch


On 09.01.19 23:39, Tom Rini wrote:
> On Wed, Jan 09, 2019 at 05:01:37PM +0100, Stefano Babic wrote:
>> Hi Soeren,
>>
>> On 08/01/19 12:03, Soeren Moch wrote:
>>> Hi Stefano,
>>>
>>> On 08.01.19 11:24, Stefano Babic wrote:
 Hi Soeren,

 On 08/01/19 11:14, Soeren Moch wrote:
> Stefano,
>
> can you apply this for v2019.01? This is really a important fix to avoid
>  environment and u-boot binary overwriting each other.
> It is also a small local fix which cannot hurt anybody else.
 I will apply and I send a new PR. This is not the first fix in this
 direction, u-boot becomes pretty large, it is becoming a common problem.

>>> Thank you very much.
>>>
>>> Yes, "in the good old days (tm)" there was much effort put into not
>>> increasing the binary size for existing boards when adding new features.
>> Right, fully agree.
>>
>>> Unfortunately this is not true anymore.
>> I get in the same trouble with more as one project. A previous rule of
>> thumb was to reserve 512KB to the bootloader because it was pretty
>> unthinkable that bootloader could be larger. Mhmmhhthis remember me
>> someone else who said that 640Kb is enough for everything.
>>
>> Anyway, as you noted, this is a big problem in field and it makes
>> difficult an upgrade without returning back the device to factory, what
>> nobody wants.
> So, this is more on me, so I should probably explain a little, and point
> at the biggest culprit too.  The biggest at times culprit and sometimes
> controversial thing is that we default to the EFI subsystem being on by
> default.  This is 50KiB on tbs2910.  Why default?  Well, "everyone"
> agrees that defaulting to EFI application support means the widest
> choice of out of the box software support.
>
Hm, AFAIK EFI support is very uncommon for arm32, at least for pre-arm64
boards. The usual way for firmware updates was to load a special
UEnv.txt or boot.scr with commands. But OK, maybe it is more modern or
more convenient these days to support EFI, maybe a good idea to
default=y, but why this is not disabled in old board's defconfigs then?
Either "automatically" like in the Kconfig conversions, or via a short
notice to the relevant board maintainers?
I also noticed this EFI support as big, but disabling it is more
complicated than disabling FIT, and we are at -rc3. Maybe I will send a
corresponding patch for the next merge window.
> And I do look at size changes, at least per push to master.  So most of
> the time it comes in "drips and drabs".  Right now I'm going to grow
> tbs2910 by 60 bytes[1].  Most of that is section re-alignment and 8 of it
> is the regression fix to mmc_startup() or non-DM MMC drivers.  But
> that's not super interesting, so lets look at v2018.09 to now.  That's
> 1800 bytes.  That's not too bad and looks like it's maybe half bug
> fixes, half working on various frameworks (sure, DM/DT stuff but also
> hash algos.  If we jump back to v2018.01, so more or less a year worth
> of changes, that's 19KiB.  Without trying to break down _everything_
> that's a good bit of EFI and a little bit everywhere else.
I fully understand that this is not a easy job for you. And usually a
few kiB are not a big deal. But the one kiB that overwrites the
environment on eMMC (and therefore often bricks the board) is very very
inconvenient for users.
>>> And all the shiny new driver model / OF features only bring
>>> disadvantages for maintainers and users of existing boards.
>>>
>>> I totally understand the desire to convert the driver code to "something
>>> better", which is easier to maintain long-term. But apparently new code
>>> is only tested on a single platform, while constantly breaking support
>>> for others without notice. But 'm complaining to the wrong person...
>> Yes, I am not the right person ;-)
>>
>> I picked up your patches, I will run build tests and if everything is
>> fine I will sent PR for 2019.01.
> In retrospect, I wish more people knew about enforcing a link time hard
> limit on the binary and knew about it a lot longer ago.  Because when
> those failures pop up, I don't apply the new PR and I start talking to
> the relevant parties to see what we can do.
Unfortunately I learned about the availability of this check only
recently. As hobbyist maintainer I usually rely on the reference board
settings.


But for v2019.01 all the problems (MMC partitions and u-boot size) have
been solved (when the relevant patches are applied), so I think we are
in good shape for now.

The bigger challenge are the BLK and DM conversions for the next u-boot
version. I absolutely cannot understand how somebody can insist on these
changes, while letting the board maintainers completely alone with
required driver adaptations. Board maintainers are not familiar with
driver code, a lot of board maintainers would need to work in parallel
on this (when no person is designated for this work, all maintainers are
equally responsible), while the author of the BLK/DM 

Re: [U-Boot] [PATCH] ARM: at91: Convert SPL_GENERATE_ATMEL_PMECC_HEADER to Kconfig

2019-01-09 Thread Derald Woods
On Mon, Jan 7, 2019 at 3:40 AM  wrote:

> Hi Derald,
>
> Thank you for the patch,
>
> Some minor questions inline.
>


Sorry for the late response. Family and day job take priority.

The patch is the simplest technical conversion that I could produce with my
board (SAMA5D3-XPLD) as the test platform. I was very careful not to touch
anything unrelated. It is not intended to address permutations outside of
the PMECC Kconfig scope. I have submitted these type of conversions to
U-Boot in the past. Adding speculative things is risky when you only have
one development board. The patch works well, for me, and addresses the
original need. All items, in the patch, are currently in scope. If there
are additions and/or modifications, feel free to modify the patch. It is
complete from my perspective. I do not have any additional time to chase
this any further. I have been developing for some time now and can handle
an 'out of tree' patch, in my environment, until something better comes
along. This patch is just my contribution to the process.

Cheers,

Derald



>
> On 15.12.2018 09:36, Derald D. Woods wrote:
> > This commit converts the following items to Kconfig:
> >
> > CONFIG_ATMEL_NAND_HWECC
> > CONFIG_ATMEL_NAND_HW_PMECC
> > CONFIG_PMECC_CAP
> > CONFIG_PMECC_SECTOR_SIZE
> > CONFIG_SPL_GENERATE_ATMEL_PMECC_HEADER
> >
> > [PMECC References]
> > https://www.at91.com/linux4sam/bin/view/Linux4SAM/PmeccConfigure
> > https://www.at91.com/linux4sam/bin/view/Linux4SAM/AT91Bootstrap
> >
> > [Mailing List Thread]
> > https://lists.denx.de/pipermail/u-boot/2018-December/350666.html
> >
> > Fixes: 5541543f ("configs: at91: Remove CONFIG_SYS_EXTRA_OPTIONS
> assignment")
> > Reported-by: Daniel Evans 
> > Cc: Eugen Hristev 
> > Signed-off-by: Derald D. Woods 
> > ---
> >   configs/at91sam9n12ek_mmc_defconfig  |  1 +
> >   configs/at91sam9n12ek_nandflash_defconfig|  3 ++
> >   configs/at91sam9n12ek_spiflash_defconfig |  3 ++
> >   configs/at91sam9x5ek_dataflash_defconfig |  3 ++
> >   configs/at91sam9x5ek_mmc_defconfig   |  1 +
> >   configs/at91sam9x5ek_nandflash_defconfig |  3 ++
> >   configs/at91sam9x5ek_spiflash_defconfig  |  3 ++
> >   configs/sama5d3_xplained_mmc_defconfig   |  1 +
> >   configs/sama5d3_xplained_nandflash_defconfig |  3 ++
> >   configs/sama5d3xek_mmc_defconfig |  1 +
> >   configs/sama5d3xek_nandflash_defconfig   |  3 ++
> >   configs/sama5d3xek_spiflash_defconfig|  3 ++
> >   configs/sama5d4_xplained_mmc_defconfig   |  1 +
> >   configs/sama5d4_xplained_nandflash_defconfig |  3 ++
> >   configs/sama5d4_xplained_spiflash_defconfig  |  3 ++
> >   configs/sama5d4ek_mmc_defconfig  |  1 +
> >   configs/sama5d4ek_nandflash_defconfig|  3 ++
> >   configs/sama5d4ek_spiflash_defconfig |  3 ++
> >   configs/wb45n_defconfig  |  3 ++
> >   configs/wb50n_defconfig  |  3 ++
> >   doc/README.atmel_pmecc   | 13 ---
> >   drivers/mtd/nand/raw/Kconfig | 38 
> >   include/configs/at91sam9n12ek.h  |  7 
> >   include/configs/at91sam9x5ek.h   |  7 
> >   include/configs/sama5d3_xplained.h   |  7 
> >   include/configs/sama5d3xek.h |  7 
> >   include/configs/sama5d4_xplained.h   |  6 
> >   include/configs/sama5d4ek.h  |  6 
> >   include/configs/wb45n.h  |  7 
> >   include/configs/wb50n.h  |  6 
> >   scripts/config_whitelist.txt |  5 ---
> >   31 files changed, 92 insertions(+), 65 deletions(-)
> >
> > diff --git a/configs/at91sam9n12ek_mmc_defconfig
> b/configs/at91sam9n12ek_mmc_defconfig
> > index 6b2cfe9c42..7b46eb498d 100644
> > --- a/configs/at91sam9n12ek_mmc_defconfig
> > +++ b/configs/at91sam9n12ek_mmc_defconfig
> > @@ -2,6 +2,7 @@ CONFIG_ARM=y
> >   CONFIG_ARCH_AT91=y
> >   CONFIG_SYS_TEXT_BASE=0x26f0
> >   CONFIG_TARGET_AT91SAM9N12EK=y
> > +# CONFIG_SPL_GENERATE_ATMEL_PMECC_HEADER is not set
> >   CONFIG_SYS_MALLOC_F_LEN=0x2000
> >   CONFIG_DEBUG_UART_BOARD_INIT=y
> >   CONFIG_DEBUG_UART_BASE=0xf200
> > diff --git a/configs/at91sam9n12ek_nandflash_defconfig
> b/configs/at91sam9n12ek_nandflash_defconfig
> > index 354c24ff16..4e34a517fd 100644
> > --- a/configs/at91sam9n12ek_nandflash_defconfig
> > +++ b/configs/at91sam9n12ek_nandflash_defconfig
> > @@ -2,6 +2,9 @@ CONFIG_ARM=y
> >   CONFIG_ARCH_AT91=y
> >   CONFIG_SYS_TEXT_BASE=0x26f0
> >   CONFIG_TARGET_AT91SAM9N12EK=y
> > +CONFIG_PMECC_CAP=2
> > +CONFIG_PMECC_SECTOR_SIZE=512
> > +CONFIG_SPL_GENERATE_ATMEL_PMECC_HEADER=y
> >   CONFIG_SYS_MALLOC_F_LEN=0x2000
> >   CONFIG_DEBUG_UART_BOARD_INIT=y
> >   CONFIG_DEBUG_UART_BASE=0xf200
> > diff --git a/configs/at91sam9n12ek_spiflash_defconfig
> b/configs/at91sam9n12ek_spiflash_defconfig
> > index 63889355bf..500c3ab088 100644
> > --- 

Re: [U-Boot] [GIT] Pull request: u-boot-dfu (10.01.2019)

2019-01-09 Thread Marek Vasut
On 1/10/19 12:21 AM, Lukasz Majewski wrote:
> Dear Marek,
> 
> I've build tested the patch set from Jean-Jacques on sunxi:
> 
> ./tools/buildman/buildman.py --branch=HEAD sunxi --detail --verbose
> --show_errors --force-build --count=5 --output-dir=../BUILD/
> 
> It also passes on Travis-CI:
> https://travis-ci.org/lmajewski/u-boot-dfu/builds/477104303
> 
> The following changes since commit
> 7436f5e54d35bcad53befec90e2e67288071f74e:
> 
>   Merge tag 'for-master-20190103' of git://git.denx.de/u-boot-rockchip
>   (2019-01-03 08:39:44 -0500)
> 
> are available in the git repository at:
> 
>   git://git.denx.de/u-boot-dfu.git 
> 
> for you to fetch changes up to 97f2e698788eba9ee0ea51b3c2f34e989788:
> 
>   dm: usb: gadget: Fix boot breakage on sunxi platforms (2019-01-09
>   01:04:36 +0100)
> 
> 
> Jean-Jacques Hiblot (5):
>   dm: usb: udc: Use SEQ_ALIAS to index the USB gadget ports
>   ARM: dts: define USB aliases for all omap5 platforms
>   Kconfig: rename CONFIG_SPL_USB_GADGET_SUPPORT as
> CONFIG_SPL_USB_GADGET 
>   usb: Make compiling gadget support optional
>   dm: usb: gadget: Fix boot breakage on sunxi platforms

I think that's the wrong patch at the end, it still unconditionally
pulls in udc-uclass.o if CONFIG_$(SPL_)DM is enabled.

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


Re: [U-Boot] [PATCH v5 02/26] reset: Add Allwinner RESET driver

2019-01-09 Thread André Przywara
On 31/12/2018 16:59, Jagan Teki wrote:
> Add common reset driver for all Allwinner SoC's.
> 
> Since CLK and RESET share common DT compatible, it is CLK driver
> job is to bind the reset driver. So add CLK bind call on respective
> SoC driver by passing ccu map descriptor so-that reset deassert,
> deassert operations held based on ccu reset table defined from
> CLK driver.
> 
> Select DM_RESET via CLK_SUNXI, this make hidden section of RESET
> since CLK and RESET share common DT compatible and code.
> 
> Signed-off-by: Jagan Teki 
> Acked-by: Maxime Ripard 
> ---
>  arch/arm/include/asm/arch-sunxi/ccu.h |  29 ++
>  drivers/clk/sunxi/Kconfig |   1 +
>  drivers/clk/sunxi/clk_a64.c   |  20 +
>  drivers/reset/Kconfig |   8 ++
>  drivers/reset/Makefile|   1 +
>  drivers/reset/reset-sunxi.c   | 125 ++
>  6 files changed, 184 insertions(+)
>  create mode 100644 drivers/reset/reset-sunxi.c
> 
> diff --git a/arch/arm/include/asm/arch-sunxi/ccu.h 
> b/arch/arm/include/asm/arch-sunxi/ccu.h
> index db69c8f0d5..3fdc26978d 100644
> --- a/arch/arm/include/asm/arch-sunxi/ccu.h
> +++ b/arch/arm/include/asm/arch-sunxi/ccu.h
> @@ -34,13 +34,33 @@ struct ccu_clk_gate {
>   .flags = CCU_CLK_F_INIT_DONE,   \
>  }
>  
> +/**
> + * struct ccu_reset - ccu reset
> + * @off: reset offset
> + * @bit: reset bit
> + * @flags:   reset flags
> + */
> +struct ccu_reset {
> + u16 off;
> + u32 bit;
> + enum ccu_clk_flags flags;
> +};
> +
> +#define RESET(_off, _bit) {  \
> + .off = _off,\
> + .bit = _bit,\
> + .flags = CCU_CLK_F_INIT_DONE,   \
> +}
> +
>  /**
>   * struct ccu_desc - clock control unit descriptor
>   *
>   * @gates:   clock gates
> + * @resets:  reset unit
>   */
>  struct ccu_desc {
>   const struct ccu_clk_gate *gates;
> + const struct ccu_reset *resets;
>  };
>  
>  /**
> @@ -62,4 +82,13 @@ int sunxi_clk_probe(struct udevice *dev);
>  
>  extern struct clk_ops sunxi_clk_ops;
>  
> +/**
> + * sunxi_reset_bind() - reset binding
> + *
> + * @dev:   reset device
> + * @count: reset count
> + * @return 0 success, or error value
> + */
> +int sunxi_reset_bind(struct udevice *dev, ulong count);
> +
>  #endif /* _ASM_ARCH_CCU_H */
> diff --git a/drivers/clk/sunxi/Kconfig b/drivers/clk/sunxi/Kconfig
> index bf5ecb3801..041d711e58 100644
> --- a/drivers/clk/sunxi/Kconfig
> +++ b/drivers/clk/sunxi/Kconfig
> @@ -1,6 +1,7 @@
>  config CLK_SUNXI
>   bool "Clock support for Allwinner SoCs"
>   depends on CLK && ARCH_SUNXI
> + select DM_RESET
>   default y
>   help
> This enables support for common clock driver API on Allwinner
> diff --git a/drivers/clk/sunxi/clk_a64.c b/drivers/clk/sunxi/clk_a64.c
> index 803a2f711d..28bda1f497 100644
> --- a/drivers/clk/sunxi/clk_a64.c
> +++ b/drivers/clk/sunxi/clk_a64.c
> @@ -10,6 +10,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  
>  static const struct ccu_clk_gate a64_gates[] = {
>   [CLK_BUS_OTG]   = GATE(0x060, BIT(23)),
> @@ -26,10 +27,28 @@ static const struct ccu_clk_gate a64_gates[] = {
>   [CLK_USB_OHCI1] = GATE(0x0cc, BIT(17)),
>  };
>  
> +static const struct ccu_reset a64_resets[] = {
> + [RST_USB_PHY0]  = RESET(0x0cc, BIT(0)),
> + [RST_USB_PHY1]  = RESET(0x0cc, BIT(1)),
> + [RST_USB_HSIC]  = RESET(0x0cc, BIT(2)),
> +
> + [RST_BUS_OTG]   = RESET(0x2c0, BIT(23)),
> + [RST_BUS_EHCI0] = RESET(0x2c0, BIT(24)),
> + [RST_BUS_EHCI1] = RESET(0x2c0, BIT(25)),
> + [RST_BUS_OHCI0] = RESET(0x2c0, BIT(28)),
> + [RST_BUS_OHCI1] = RESET(0x2c0, BIT(29)),
> +};
> +
>  static const struct ccu_desc a64_ccu_desc = {
>   .gates = a64_gates,
> + .resets = a64_resets,
>  };
>  
> +static int a64_clk_bind(struct udevice *dev)
> +{
> + return sunxi_reset_bind(dev, 50);

The second parameter is count, so it should be 51. But this is wrong
either way, so just use ARRAY_SIZE(a64_reset), as this is what you are
after with the check later on.
Same for the other SoCs, of course.

> +}
> +
>  static const struct udevice_id a64_ccu_ids[] = {
>   { .compatible = "allwinner,sun50i-a64-ccu",
> .data = (ulong)_ccu_desc },
> @@ -43,4 +62,5 @@ U_BOOT_DRIVER(clk_sun50i_a64) = {
>   .priv_auto_alloc_size   = sizeof(struct ccu_priv),
>   .ops= _clk_ops,
>   .probe  = sunxi_clk_probe,
> + .bind   = a64_clk_bind,
>  };
> diff --git a/drivers/reset/Kconfig b/drivers/reset/Kconfig
> index 9c5208b7da..b6b40b6ce9 100644
> --- a/drivers/reset/Kconfig
> +++ b/drivers/reset/Kconfig
> @@ -106,4 +106,12 @@ config RESET_SOCFPGA
>   help
> Support for reset controller on SoCFPGA platform.
>  
> +config RESET_SUNXI
> + bool "RESET support for Allwinner SoCs"
> + depends 

Re: [U-Boot] [PATCH v5 15/26] clk: sunxi: Add ccu clock tree support

2019-01-09 Thread André Przywara
On 08/01/2019 19:12, Jagan Teki wrote:
> On Tue, Jan 8, 2019 at 5:09 PM Andre Przywara  wrote:
>>
>> On Tue, 8 Jan 2019 16:27:14 +0530
>> Jagan Teki  wrote:
>>
>> Hi,
>>
>>> On Mon, Jan 7, 2019 at 6:35 AM André Przywara
>>>  wrote:

 On 31/12/2018 16:59, Jagan Teki wrote:
> Clock control unit comprises of parent clocks, gates,
> multiplexers, dividers, multipliers, pre/post dividers and flags
> etc.
>
> So, the U-Boot implementation of ccu has divided into gates and
> tree. gates are generic clock configuration of enable/disable bit
> management which can be handle via ccu_clock_gate.

 So if I understand this correctly, you implement the gate
 functionality separately from the complex clock code, even if they
 are the same clock from the DT point of view? So if one wants to
 enable the MMC0 clock, which is a mux/divider clock, one needs to
 specify an extra entry in the gate array to describe the enable bit
 in this special clock register? Sounds a bit surprising, but is
 probably a neat trick to keep things simple. There should be a
 comment in the code to this regard then.
>>>
>>> Exactly. Idea is to keep the macro's as simple as possible.
>>>
>>> Adding gates clocks separately make easy and reasonable way to
>>> enable/disable clock operations. We even operate with single macro
>>> with all clock attributes along with gate(either another member or
>>> common structure like Linux does), but that seems not simple as per as
>>> my experince since there are many IP's like USB's just need
>>> enable/disable.
>>>

> Tree clocks are parent clock type, fixed clocks, mp, nk, nkm,
> nkmp, pre/post div, flags etc. which were managed via
> ccu_clock_tree.

 For a start, can we use more descriptive names than those very
 specific MP/NK names? DIV_MUX and PLL sound more descriptive to me.
 I understand that Linux uses those terms, but it would be great if
 uninitiated people have a chance to understand this as well.

> This patch add support for MP, NK, MISC, FIXED clock types as
> part of ccu clock tree with get_rate functionality this
> eventually used by uart driver. and rest of the infrastructure
> will try to add while CLK is being used on respective peripherals.
>
> Note that few of the tree type clock would require to enable
> gates on their specific clock, in that case we need to add the
> gate details via ccu_clock_gate, example: MP with gate so the
> gate offset, bit value should add as part of ccu_clock_gate.
>
> Signed-off-by: Jagan Teki 
> ---
>  arch/arm/include/asm/arch-sunxi/ccu.h | 192
> +- drivers/clk/sunxi/clk_a64.c
> |  40 ++ drivers/clk/sunxi/clk_sunxi.c | 182
>  3 files changed, 413 insertions(+), 1
> deletion(-)
>
> diff --git a/arch/arm/include/asm/arch-sunxi/ccu.h
> b/arch/arm/include/asm/arch-sunxi/ccu.h index
> 3fdc26978d..61b8c36b3b 100644 ---
> a/arch/arm/include/asm/arch-sunxi/ccu.h +++
> b/arch/arm/include/asm/arch-sunxi/ccu.h @@ -7,15 +7,204 @@
>  #ifndef _ASM_ARCH_CCU_H
>  #define _ASM_ARCH_CCU_H
>
> +#define OSC_32K_ULL  32000ULL

 32768

 And why ULL? The whole Allwinner clock system works with 32-bit
 values, so just U would be totally sufficient. This avoid blowing
 this up to 64 bit unnecessarily, which sounds painful for those
 poor ARMv7 parts.
> +#define OSC_24M_ULL  2400ULL
> +
> +/**
> + * enum ccu_clk_type - ccu clock types
> + *
> + * @CCU_CLK_TYPE_MISC:   misc clock type

 What is MISC, exactly? Seems like an artefact clock to me, some
 placeholder you need because gate clocks are handled separately in
 the gates struct. Should this be called something with SIMPLE
 instead, or GATE?
>>>
>>> Unlike MP type in MMC, UART doesn't need any clock attributes like
>>> dividers, mux, etc, just have attached parent. I don't think UART
>>> clock is simple one It has parent, that indeed have another parents
>>> and so...on, ie reason I named as MISC.
>>
>> Not really, as far as I can see the UART clock is a just a gate clock as
>> many others, with one parent (APB2).
>> The fact that APB2 in turn can have multiple parents doesn't affect the
>> UART clock itself, as you model this via the clock tree.
>>
>> In fact we could have similar clocks in the tree structure for the
>> other gate clocks (USB, for instance), it's just that the UART is the
>> only user so far which actually queries the clock rate.
>>
>> So MISC is way too generic, I would still prefer CCU_CLK_TYPE_GATE.
> 
> TYPE_GATE is more sense. fine for me.
> 
>>
> + * @CCU_CLK_TYPE_FIXED:  fixed clock type
> + * @CCU_CLK_TYPE_MP: mp clock type
> + * @CCU_CLK_TYPE_NK: nk clock 

Re: [U-Boot] [PATCH v2 3/3] efi_loader: remove block device details from efi file

2019-01-09 Thread AKASHI Takahiro
Alex,

On Wed, Jan 09, 2019 at 10:18:16AM +0100, Alexander Graf wrote:
> 
> 
> On 15.11.18 05:58, AKASHI Takahiro wrote:
> > Logically, details on u-boot block device used to implement efi file
> > protocol are mostly unnecessary, as well as being duplicated, in
> > efi_file structure.
> > Moreover, a newly introduced flag, _EFI_DISK_FLAG_INVALID, should be
> > honored in any file operations via efi file protocol.
> > These observation suggests that those internal details be set behind
> > efi_disk object.
> > 
> > So rework in this patch addresses all those issues above although
> > there is little change in its functionality.
> > 
> > Signed-off-by: AKASHI Takahiro 
> > ---
> >  include/efi_loader.h  |  6 +-
> >  lib/efi_loader/efi_disk.c | 38 --
> >  lib/efi_loader/efi_file.c | 21 -
> >  3 files changed, 49 insertions(+), 16 deletions(-)
> > 
> > diff --git a/include/efi_loader.h b/include/efi_loader.h
> > index 3bae1844befb..108ef3fe52ee 100644
> > --- a/include/efi_loader.h
> > +++ b/include/efi_loader.h
> > @@ -264,6 +264,10 @@ efi_status_t efi_disk_register(void);
> >  bool efi_disk_is_valid(efi_handle_t handle);
> >  /* Called by bootefi to find and update disk storage information */
> >  efi_status_t efi_disk_update(void);
> > +/* Called by file protocol to set internal block io device */
> > +int efi_disk_set_blk_dev(efi_handle_t disk);
> > +/* Called by file protocol to get disk/partition information */
> > +int efi_disk_get_info(efi_handle_t disk, disk_partition_t *part);
> >  /* Create handles and protocols for the partitions of a block device */
> >  int efi_disk_create_partitions(efi_handle_t parent, struct blk_desc *desc,
> >const char *if_typename, int diskid,
> > @@ -355,7 +359,7 @@ void efi_signal_event(struct efi_event *event, bool 
> > check_tpl);
> >  
> >  /* open file system: */
> >  struct efi_simple_file_system_protocol *efi_simple_file_system(
> > -   struct blk_desc *desc, int part, struct efi_device_path *dp);
> > +   efi_handle_t disk);
> >  
> >  /* open file from device-path: */
> >  struct efi_file_handle *efi_file_from_path(struct efi_device_path *fp);
> > diff --git a/lib/efi_loader/efi_disk.c b/lib/efi_loader/efi_disk.c
> > index 0c4d79ee3fc9..180e8e10bb28 100644
> > --- a/lib/efi_loader/efi_disk.c
> > +++ b/lib/efi_loader/efi_disk.c
> > @@ -9,6 +9,7 @@
> >  #include 
> >  #include 
> >  #include 
> > +#include 
> >  #include 
> >  #include 
> >  
> > @@ -254,6 +255,40 @@ efi_fs_from_path(struct efi_device_path *full_path)
> > return handler->protocol_interface;
> >  }
> >  
> > +/*
> > + * Set block device for later block io's from file system protocol
> > + *
> > + * @disk   handle to uefi disk device
> > + * @return 0 for success, -1 for failure
> > + */
> > +int efi_disk_set_blk_dev(efi_handle_t disk)
> > +{
> > +   struct efi_disk_obj *diskobj;
> > +
> > +   diskobj = container_of(disk, struct efi_disk_obj, header);
> > +
> > +   return fs_set_blk_dev_with_part(diskobj->desc, diskobj->part);
> > +}
> > +
> > +/*
> > + * Get disk/partition information
> > + *
> > + * @disk   handle to uefi disk device
> > + * @part   pointer to disk/partition information to be returned
> > + * @return 0 for success, -1 for failure
> > + */
> > +int efi_disk_get_info(efi_handle_t disk, disk_partition_t *part)
> > +{
> > +   struct efi_disk_obj *diskobj;
> > +
> > +   diskobj = container_of(disk, struct efi_disk_obj, header);
> > +
> > +   if (diskobj->part >= 1)
> > +   return part_get_info(diskobj->desc, diskobj->part, part);
> > +   else
> > +   return part_get_info_whole_disk(diskobj->desc, part);
> > +}
> > +
> >  /*
> >   * Create a handle for a partition or disk
> >   *
> > @@ -308,8 +343,7 @@ static efi_status_t efi_disk_add_dev(
> > if (ret != EFI_SUCCESS)
> > return ret;
> > if (part >= 1) {
> > -   diskobj->volume = efi_simple_file_system(desc, part,
> > -diskobj->dp);
> > +   diskobj->volume = efi_simple_file_system(>header);
> > ret = efi_add_protocol(>header,
> >_simple_file_system_protocol_guid,
> >diskobj->volume);
> > diff --git a/lib/efi_loader/efi_file.c b/lib/efi_loader/efi_file.c
> > index beb4fba917d8..944383224f30 100644
> > --- a/lib/efi_loader/efi_file.c
> > +++ b/lib/efi_loader/efi_file.c
> > @@ -17,9 +17,7 @@ const efi_guid_t efi_file_system_info_guid = 
> > EFI_FILE_SYSTEM_INFO_GUID;
> >  
> >  struct file_system {
> > struct efi_simple_file_system_protocol base;
> > -   struct efi_device_path *dp;
> > -   struct blk_desc *desc;
> > -   int part;
> > +   efi_handle_t disk;
> 
> Is there a particular reason we can't just make this a struct
> efi_disk_obj *?

Just because efi_disk_obj is an internally-defined structure in efi_disk.c.

> Inside our own code 

[U-Boot] [GIT] Pull request: u-boot-dfu (10.01.2019)

2019-01-09 Thread Lukasz Majewski
Dear Marek,

I've build tested the patch set from Jean-Jacques on sunxi:

./tools/buildman/buildman.py --branch=HEAD sunxi --detail --verbose
--show_errors --force-build --count=5 --output-dir=../BUILD/

It also passes on Travis-CI:
https://travis-ci.org/lmajewski/u-boot-dfu/builds/477104303

The following changes since commit
7436f5e54d35bcad53befec90e2e67288071f74e:

  Merge tag 'for-master-20190103' of git://git.denx.de/u-boot-rockchip
  (2019-01-03 08:39:44 -0500)

are available in the git repository at:

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

for you to fetch changes up to 97f2e698788eba9ee0ea51b3c2f34e989788:

  dm: usb: gadget: Fix boot breakage on sunxi platforms (2019-01-09
  01:04:36 +0100)


Jean-Jacques Hiblot (5):
  dm: usb: udc: Use SEQ_ALIAS to index the USB gadget ports
  ARM: dts: define USB aliases for all omap5 platforms
  Kconfig: rename CONFIG_SPL_USB_GADGET_SUPPORT as
CONFIG_SPL_USB_GADGET 
  usb: Make compiling gadget support optional
  dm: usb: gadget: Fix boot breakage on sunxi platforms

 Makefile | 4 ++--
 arch/arm/dts/omap5-u-boot.dtsi   | 5 +
 arch/arm/mach-imx/mx6/Kconfig| 2 +-
 arch/arm/mach-imx/spl.c  | 2 +-
 common/spl/Kconfig   | 4 ++--
 configs/am335x_boneblack_vboot_defconfig | 2 +-
 configs/am335x_evm_usbspl_defconfig  | 2 +-
 configs/am43xx_evm_defconfig | 2 +-
 configs/am43xx_hs_evm_defconfig  | 2 +-
 configs/apalis_imx6_defconfig| 2 +-
 configs/cm_t3517_defconfig   | 1 +
 configs/cm_t35_defconfig | 1 +
 configs/colibri_imx6_defconfig   | 2 +-
 configs/display5_factory_defconfig   | 2 +-
 configs/duovero_defconfig| 1 +
 configs/igep0032_defconfig   | 1 +
 configs/igep00x0_defconfig   | 1 +
 configs/imx6q_logic_defconfig| 2 +-
 configs/mx6memcal_defconfig  | 2 +-
 configs/mx6sabresd_defconfig | 2 +-
 configs/omap3_zoom1_defconfig| 1 +
 configs/omap4_panda_defconfig| 1 +
 configs/omap4_sdp4430_defconfig  | 1 +
 configs/pico-hobbit-imx6ul_defconfig | 2 +-
 configs/pico-hobbit-imx7d_defconfig  | 2 +-
 configs/pico-imx6ul_defconfig| 2 +-
 configs/pico-imx7d_defconfig | 2 +-
 configs/pico-pi-imx6ul_defconfig | 2 +-
 configs/pico-pi-imx7d_defconfig  | 2 +-
 configs/spear300_usbtty_defconfig| 2 ++
 configs/spear300_usbtty_nand_defconfig   | 2 ++
 configs/spear310_usbtty_defconfig| 2 ++
 configs/spear310_usbtty_nand_defconfig   | 2 ++
 configs/spear310_usbtty_pnor_defconfig   | 2 ++
 configs/spear320_usbtty_defconfig| 2 ++
 configs/spear320_usbtty_nand_defconfig   | 2 ++
 configs/spear320_usbtty_pnor_defconfig   | 2 ++
 configs/spear600_usbtty_defconfig| 2 ++
 configs/spear600_usbtty_nand_defconfig   | 2 ++
 drivers/Makefile | 6 +++---
 drivers/usb/gadget/Makefile  | 2 +-
 drivers/usb/gadget/udc/Makefile  | 3 ++-
 drivers/usb/gadget/udc/udc-uclass.c  | 7 +--
 scripts/Makefile.spl | 2 +-
 44 files changed, 67 insertions(+), 30 deletions(-)


Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lu...@denx.de


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


Re: [U-Boot] [PATCH 2/2] board: tbs2910: Remove FIT support in defconfig to reduce u-boot size

2019-01-09 Thread Tom Rini
On Wed, Jan 09, 2019 at 05:01:37PM +0100, Stefano Babic wrote:
> Hi Soeren,
> 
> On 08/01/19 12:03, Soeren Moch wrote:
> > Hi Stefano,
> > 
> > On 08.01.19 11:24, Stefano Babic wrote:
> >> Hi Soeren,
> >>
> >> On 08/01/19 11:14, Soeren Moch wrote:
> >>> Stefano,
> >>>
> >>> can you apply this for v2019.01? This is really a important fix to avoid
> >>>  environment and u-boot binary overwriting each other.
> >>> It is also a small local fix which cannot hurt anybody else.
> >> I will apply and I send a new PR. This is not the first fix in this
> >> direction, u-boot becomes pretty large, it is becoming a common problem.
> >>
> > Thank you very much.
> > 
> > Yes, "in the good old days (tm)" there was much effort put into not
> > increasing the binary size for existing boards when adding new features.
> 
> Right, fully agree.
> 
> > Unfortunately this is not true anymore.
> 
> I get in the same trouble with more as one project. A previous rule of
> thumb was to reserve 512KB to the bootloader because it was pretty
> unthinkable that bootloader could be larger. Mhmmhhthis remember me
> someone else who said that 640Kb is enough for everything.
> 
> Anyway, as you noted, this is a big problem in field and it makes
> difficult an upgrade without returning back the device to factory, what
> nobody wants.

So, this is more on me, so I should probably explain a little, and point
at the biggest culprit too.  The biggest at times culprit and sometimes
controversial thing is that we default to the EFI subsystem being on by
default.  This is 50KiB on tbs2910.  Why default?  Well, "everyone"
agrees that defaulting to EFI application support means the widest
choice of out of the box software support.

And I do look at size changes, at least per push to master.  So most of
the time it comes in "drips and drabs".  Right now I'm going to grow
tbs2910 by 60 bytes[1].  Most of that is section re-alignment and 8 of it
is the regression fix to mmc_startup() or non-DM MMC drivers.  But
that's not super interesting, so lets look at v2018.09 to now.  That's
1800 bytes.  That's not too bad and looks like it's maybe half bug
fixes, half working on various frameworks (sure, DM/DT stuff but also
hash algos.  If we jump back to v2018.01, so more or less a year worth
of changes, that's 19KiB.  Without trying to break down _everything_
that's a good bit of EFI and a little bit everywhere else.

> > And all the shiny new driver model / OF features only bring
> > disadvantages for maintainers and users of existing boards.
> > 
> > I totally understand the desire to convert the driver code to "something
> > better", which is easier to maintain long-term. But apparently new code
> > is only tested on a single platform, while constantly breaking support
> > for others without notice. But 'm complaining to the wrong person...
> 
> Yes, I am not the right person ;-)
> 
> I picked up your patches, I will run build tests and if everything is
> fine I will sent PR for 2019.01.

In retrospect, I wish more people knew about enforcing a link time hard
limit on the binary and knew about it a lot longer ago.  Because when
those failures pop up, I don't apply the new PR and I start talking to
the relevant parties to see what we can do.

[1]: buildman --step 0 -SBCdevlk followed by --step 0 -SsBdevlk to see
how much and where, and yes, that's a few more flags than I _need_ for
that, and since it's in a script I never go and optimize it down.

-- 
Tom


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


[U-Boot] [PATCH] Revert "dm: pinctrl: Prevent (re-)configuring pins when already done before relocation"

2019-01-09 Thread Lukasz Majewski
This reverts commit a7f4b4b344396590845e6552c82829ef68ef9f89.

As reported by Alex Kiernan the above optimization introduces a
regression in the below use case where:

1. Device has defined 'u-boot,dm-spl' property (@ eMMC DTS node)

2. The device downloads its MLO/SPL via UART (not eMMC - the eMMC pinmux
pins are NOT probed/configured in MLO/SPL).

3. The loaded via UART MLO/SPL wants to load Linux from eMMC. In this case
the DM core and pinctrl uclass checks 'u-boot,dm-spl' and don't
configure pins (as it thinks that those were initialized in MLO/SPL).

As we are very close to release - please revert this commit.

Reported-by: Alex Kiernan 
Signed-off-by: Lukasz Majewski 

---

 drivers/pinctrl/pinctrl-uclass.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/pinctrl/pinctrl-uclass.c b/drivers/pinctrl/pinctrl-uclass.c
index 29c910c55f..6db0445067 100644
--- a/drivers/pinctrl/pinctrl-uclass.c
+++ b/drivers/pinctrl/pinctrl-uclass.c
@@ -117,9 +117,9 @@ static int pinconfig_post_bind(struct udevice *dev)
int ret;
 
dev_for_each_subnode(node, dev) {
-   if (pre_reloc_only ^ ofnode_pre_reloc(node))
+   if (pre_reloc_only &&
+   !ofnode_pre_reloc(node))
continue;
-
/*
 * If this node has "compatible" property, this is not
 * a pin configuration node, but a normal device. skip.
-- 
2.11.0

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


Re: [U-Boot] [PATCH 3/3] arm: socfpga: remove CONFIG_SYS_BOOTMAPSZ

2019-01-09 Thread Marek Vasut
On 1/9/19 10:42 PM, Simon Goldschmidt wrote:
> 
> 
> Am Mi., 9. Jan. 2019, 22:39 hat Marek Vasut  > geschrieben:
> 
> On 1/9/19 10:34 PM, Simon Goldschmidt wrote:
> >
> >
> > Am Mi., 9. Jan. 2019, 22:31 hat Marek Vasut  
> > >> geschrieben:
> >
> >     On 1/9/19 10:30 PM, Simon Goldschmidt wrote:
> >     >
> >     >
> >     > Am Mi., 9. Jan. 2019, 22:27 hat Marek Vasut  
> >     >
> >     > 
>  >     >
> >     >     On 1/9/19 8:56 PM, Simon Goldschmidt wrote:
> >     >     > socfpga_common.h defines CONFIG_SYS_BOOTMAPSZ to 64 MiB.
> >     >     >
> >     >     > Since having this define overrides the 'bootm_size' env
> >     variable for
> >     >     > the whole socfpga platform, let's remove this define from
> >     >     socfpga_common.h
> >     >     > and instead rely on the 'bootm_size' env variable
> (which is
> >     >     initialized
> >     >     > to 160 MiB in the same file's default env). This gives
> users the
> >     >     > chance to override it in their own environment.
> >     >     >
> >     >     > Signed-off-by: Simon Goldschmidt
> >      
> >      >
> >     >      
> >       >     >     > ---
> >     >     >
> >     >     >  include/configs/socfpga_common.h | 2 --
> >     >     >  1 file changed, 2 deletions(-)
> >     >     >
> >     >     > diff --git a/include/configs/socfpga_common.h
> >     >     b/include/configs/socfpga_common.h
> >     >     > index e9b368d93a..04e0f06230 100644
> >     >     > --- a/include/configs/socfpga_common.h
> >     >     > +++ b/include/configs/socfpga_common.h
> >     >     > @@ -10,8 +10,6 @@
> >     >     >   */
> >     >     >  #define CONFIG_CLOCKS
> >     >     > 
> >     >     > -#define CONFIG_SYS_BOOTMAPSZ         (64 * 1024 * 1024)
> >     >     > -
> >     >     >  #define CONFIG_TIMESTAMP             /* Print image
> info with
> >     >     timestamp */
> >     >     > 
> >     >     >  /* add target to build it automatically upon "make" */
> >     >     >
> >     >     Can you at least "imply" it to 64 MiB, so we don't
> change the
> >     behavior ?
> >     >
> >     >
> >     > You mean change the "boot_size" value in default environment
> to 64
> >     MiB?
> >     > Sure.
> >
> >     Sure, just so we won't change the behavior, some people like
> to run
> >     gigantic kernels.
> >
> >
> > Well, 28th this patch, the size should grow from 64 MiB (from the
> > define) to 160 MiB (bootm_size value). I figured that would be ok for
> > everyone... But if you want me to shrink that back to 64 MiB, I'm ok
> > with that either...
> 
> 160 is fine too.
> 
> 
> Ok, so no V2 for this one. I'll check i2c DM tomorrow.

Thanks, appreciated.

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


Re: [U-Boot] [PATCH 3/3] arm: socfpga: remove CONFIG_SYS_BOOTMAPSZ

2019-01-09 Thread Simon Goldschmidt
Am Mi., 9. Jan. 2019, 22:39 hat Marek Vasut  geschrieben:

> On 1/9/19 10:34 PM, Simon Goldschmidt wrote:
> >
> >
> > Am Mi., 9. Jan. 2019, 22:31 hat Marek Vasut  > > geschrieben:
> >
> > On 1/9/19 10:30 PM, Simon Goldschmidt wrote:
> > >
> > >
> > > Am Mi., 9. Jan. 2019, 22:27 hat Marek Vasut  > 
> > > >> geschrieben:
> > >
> > > On 1/9/19 8:56 PM, Simon Goldschmidt wrote:
> > > > socfpga_common.h defines CONFIG_SYS_BOOTMAPSZ to 64 MiB.
> > > >
> > > > Since having this define overrides the 'bootm_size' env
> > variable for
> > > > the whole socfpga platform, let's remove this define from
> > > socfpga_common.h
> > > > and instead rely on the 'bootm_size' env variable (which is
> > > initialized
> > > > to 160 MiB in the same file's default env). This gives users
> the
> > > > chance to override it in their own environment.
> > > >
> > > > Signed-off-by: Simon Goldschmidt
> >  > 
> > >  > >>
> > > > ---
> > > >
> > > >  include/configs/socfpga_common.h | 2 --
> > > >  1 file changed, 2 deletions(-)
> > > >
> > > > diff --git a/include/configs/socfpga_common.h
> > > b/include/configs/socfpga_common.h
> > > > index e9b368d93a..04e0f06230 100644
> > > > --- a/include/configs/socfpga_common.h
> > > > +++ b/include/configs/socfpga_common.h
> > > > @@ -10,8 +10,6 @@
> > > >   */
> > > >  #define CONFIG_CLOCKS
> > > >
> > > > -#define CONFIG_SYS_BOOTMAPSZ (64 * 1024 * 1024)
> > > > -
> > > >  #define CONFIG_TIMESTAMP /* Print image info
> with
> > > timestamp */
> > > >
> > > >  /* add target to build it automatically upon "make" */
> > > >
> > > Can you at least "imply" it to 64 MiB, so we don't change the
> > behavior ?
> > >
> > >
> > > You mean change the "boot_size" value in default environment to 64
> > MiB?
> > > Sure.
> >
> > Sure, just so we won't change the behavior, some people like to run
> > gigantic kernels.
> >
> >
> > Well, 28th this patch, the size should grow from 64 MiB (from the
> > define) to 160 MiB (bootm_size value). I figured that would be ok for
> > everyone... But if you want me to shrink that back to 64 MiB, I'm ok
> > with that either...
>
> 160 is fine too.
>

Ok, so no V2 for this one. I'll check i2c DM tomorrow.

Regards,
Simon

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


Re: [U-Boot] [PATCH 3/3] arm: socfpga: remove CONFIG_SYS_BOOTMAPSZ

2019-01-09 Thread Marek Vasut
On 1/9/19 10:34 PM, Simon Goldschmidt wrote:
> 
> 
> Am Mi., 9. Jan. 2019, 22:31 hat Marek Vasut  > geschrieben:
> 
> On 1/9/19 10:30 PM, Simon Goldschmidt wrote:
> >
> >
> > Am Mi., 9. Jan. 2019, 22:27 hat Marek Vasut  
> > >> geschrieben:
> >
> >     On 1/9/19 8:56 PM, Simon Goldschmidt wrote:
> >     > socfpga_common.h defines CONFIG_SYS_BOOTMAPSZ to 64 MiB.
> >     >
> >     > Since having this define overrides the 'bootm_size' env
> variable for
> >     > the whole socfpga platform, let's remove this define from
> >     socfpga_common.h
> >     > and instead rely on the 'bootm_size' env variable (which is
> >     initialized
> >     > to 160 MiB in the same file's default env). This gives users the
> >     > chance to override it in their own environment.
> >     >
> >     > Signed-off-by: Simon Goldschmidt
>  
> >      >>
> >     > ---
> >     >
> >     >  include/configs/socfpga_common.h | 2 --
> >     >  1 file changed, 2 deletions(-)
> >     >
> >     > diff --git a/include/configs/socfpga_common.h
> >     b/include/configs/socfpga_common.h
> >     > index e9b368d93a..04e0f06230 100644
> >     > --- a/include/configs/socfpga_common.h
> >     > +++ b/include/configs/socfpga_common.h
> >     > @@ -10,8 +10,6 @@
> >     >   */
> >     >  #define CONFIG_CLOCKS
> >     > 
> >     > -#define CONFIG_SYS_BOOTMAPSZ         (64 * 1024 * 1024)
> >     > -
> >     >  #define CONFIG_TIMESTAMP             /* Print image info with
> >     timestamp */
> >     > 
> >     >  /* add target to build it automatically upon "make" */
> >     >
> >     Can you at least "imply" it to 64 MiB, so we don't change the
> behavior ?
> >
> >
> > You mean change the "boot_size" value in default environment to 64
> MiB?
> > Sure.
> 
> Sure, just so we won't change the behavior, some people like to run
> gigantic kernels.
> 
> 
> Well, 28th this patch, the size should grow from 64 MiB (from the
> define) to 160 MiB (bootm_size value). I figured that would be ok for
> everyone... But if you want me to shrink that back to 64 MiB, I'm ok
> with that either...

160 is fine too.

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


Re: [U-Boot] [PATCH v1] tools: logos: crop Toradex logo slightly

2019-01-09 Thread Lukasz Majewski
On Wed, 9 Jan 2019 16:41:40 +0100
Stefano Babic  wrote:

> Hi Stefan, Lukasz,
> 
> On 04/01/19 16:05, Stefan Agner wrote:
> > Hi Stefano,
> > 
> > On 14.12.2018 14:40, Stefano Babic wrote:  
> >> On 14/12/18 14:30, Tom Rini wrote:  
> >>> On Fri, Dec 14, 2018 at 02:26:22PM +0100, Stefan Agner wrote:  
>  On 14.12.2018 14:20, Tom Rini wrote:  
> > On Fri, Dec 14, 2018 at 02:13:46PM +0100, Stefan Agner wrote:  
> >> Hi Tom,
> >>
> >> On 08.12.2018 17:48, Lukasz Majewski wrote:  
> >>> Hi Stefan,
> >>>  
>  From: Stefan Agner 
> 
>  The current bitmap is a bit larger than necessary, it has a
>  black border around the Toradex logo. Crop the logo slightly
>  which safes some space, useful especially on Colibri VFxx.  
> >>>
> >>> I can confirm that those changes, as well as
> >>>
> >>> [PATCH v1] board: toradex: colibri_vf: unset NFS and LOADS/B  
> 
> You're right, this was slipped away, I pick it now.
> 
> >>> [PATCH v1] mtd: nand: raw: allow to disable unneeded ECC
> >>> layouts [PATCH v1] fs: fat: dynamically allocate memory for
> >>> temporary buffer  
> 
> Both of them are outside u-boot-imx, so they will be merged by
> Scott / Tom.
> 
> >>
> >> I think all of those go directly into your tree?  
> >
> > I had filed vybird stuff off to Stefano for some, hopefully
> > correct reason.  The FAT change and logo change are me, yes.  
> 
>  I guess the mtd change is rather global...  
> >>>
> >>> Ah right.  Maybe I gave it to myself?  I know I assigned it in
> >>> patchwork.
> >>>  
>  Currently board/toradex is not specifically marked to be
>  maintained by Stefano (we also have Tegra boards). But yeah for
>  Vybrid it probably makes sense.  
> >>>  
> >>
> >> Yes, I saw your patches, I will picked them up after current PR
> >> (sent now) will be merged.  
> > 
> > This still did not make it. Can it still be considered for the next
> > release?
> > 
> > There is also:
> > - board: toradex: colibri_vf: unset NFS and LOADS/B
> > - ARM: vf610: ddrmc: program Dummy DDRBYTE1/2  
> 
> Applied to u-boot-imx.
> 
> > - ddr: vybrid: various fixes (patchset)  
> 
> There is a (slight) conflict with Lukasz's patches regarding DDR
> calibration. I won't pick Lukasz's for 2019.01, 

Ok. No problem.
( The DDR patch series itself:
http://patchwork.ozlabs.org/cover/1008330/)

> and I could solve the
> conflict in -next branch. IMHO I have no concerns (open points)
> regarding usage of bit shifting instead of BIT() macro. So I pushed
> this patchset and I delay Lukasz's to next release.

Ok. Thanks for the update. 

> 
> Best regards,
> Stefano
> 




Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lu...@denx.de


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


Re: [U-Boot] [PATCH 3/3] arm: socfpga: remove CONFIG_SYS_BOOTMAPSZ

2019-01-09 Thread Simon Goldschmidt
Am Mi., 9. Jan. 2019, 22:31 hat Marek Vasut  geschrieben:

> On 1/9/19 10:30 PM, Simon Goldschmidt wrote:
> >
> >
> > Am Mi., 9. Jan. 2019, 22:27 hat Marek Vasut  > > geschrieben:
> >
> > On 1/9/19 8:56 PM, Simon Goldschmidt wrote:
> > > socfpga_common.h defines CONFIG_SYS_BOOTMAPSZ to 64 MiB.
> > >
> > > Since having this define overrides the 'bootm_size' env variable
> for
> > > the whole socfpga platform, let's remove this define from
> > socfpga_common.h
> > > and instead rely on the 'bootm_size' env variable (which is
> > initialized
> > > to 160 MiB in the same file's default env). This gives users the
> > > chance to override it in their own environment.
> > >
> > > Signed-off-by: Simon Goldschmidt  > >
> > > ---
> > >
> > >  include/configs/socfpga_common.h | 2 --
> > >  1 file changed, 2 deletions(-)
> > >
> > > diff --git a/include/configs/socfpga_common.h
> > b/include/configs/socfpga_common.h
> > > index e9b368d93a..04e0f06230 100644
> > > --- a/include/configs/socfpga_common.h
> > > +++ b/include/configs/socfpga_common.h
> > > @@ -10,8 +10,6 @@
> > >   */
> > >  #define CONFIG_CLOCKS
> > >
> > > -#define CONFIG_SYS_BOOTMAPSZ (64 * 1024 * 1024)
> > > -
> > >  #define CONFIG_TIMESTAMP /* Print image info with
> > timestamp */
> > >
> > >  /* add target to build it automatically upon "make" */
> > >
> > Can you at least "imply" it to 64 MiB, so we don't change the
> behavior ?
> >
> >
> > You mean change the "boot_size" value in default environment to 64 MiB?
> > Sure.
>
> Sure, just so we won't change the behavior, some people like to run
> gigantic kernels.
>

Well, 28th this patch, the size should grow from 64 MiB (from the define)
to 160 MiB (bootm_size value). I figured that would be ok for everyone...
But if you want me to shrink that back to 64 MiB, I'm ok with that either...

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


Re: [U-Boot] [PATCH 1/3] arm: socfpga: move legacy i2c defines to vining

2019-01-09 Thread Marek Vasut
On 1/9/19 10:31 PM, Simon Goldschmidt wrote:
> 
> 
> Am Mi., 9. Jan. 2019, 22:27 hat Marek Vasut  > geschrieben:
> 
> On 1/9/19 8:56 PM, Simon Goldschmidt wrote:
> > All socfpga boards exept for vining_fpga use DM_I2C. Move the non-DM
> > i2c defines from socfpga_common.h to socfpga_vining_fpga.h to prevent
> > i2c getting enabled for those boards when DM_I2C is deselected.
> 
> Can you just flip the board to DM I2C ? I can test the patch .
> 
> 
> I tried that first and it wouldn't compile. But if you can test it (I
> can't), I can give it a 2nd look.

Yes please, let's get rid of this ad-hoc non-DM stuff.

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


Re: [U-Boot] [PATCH 1/3] arm: socfpga: move legacy i2c defines to vining

2019-01-09 Thread Simon Goldschmidt
Am Mi., 9. Jan. 2019, 22:27 hat Marek Vasut  geschrieben:

> On 1/9/19 8:56 PM, Simon Goldschmidt wrote:
> > All socfpga boards exept for vining_fpga use DM_I2C. Move the non-DM
> > i2c defines from socfpga_common.h to socfpga_vining_fpga.h to prevent
> > i2c getting enabled for those boards when DM_I2C is deselected.
>
> Can you just flip the board to DM I2C ? I can test the patch .
>

I tried that first and it wouldn't compile. But if you can test it (I
can't), I can give it a 2nd look.

Regards,
Simon

> Signed-off-by: Simon Goldschmidt 
> > ---
> >
> >  include/configs/socfpga_common.h  | 26 --
> >  include/configs/socfpga_vining_fpga.h | 24 
> >  2 files changed, 24 insertions(+), 26 deletions(-)
> >
> > diff --git a/include/configs/socfpga_common.h
> b/include/configs/socfpga_common.h
> > index bd8f5c8c41..087ed6e96d 100644
> > --- a/include/configs/socfpga_common.h
> > +++ b/include/configs/socfpga_common.h
> > @@ -137,32 +137,6 @@
> >  #define CONFIG_SYS_NAND_DATA_BASESOCFPGA_NANDDATA_ADDRESS
> >  #endif
> >
> > -/*
> > - * I2C support
> > - */
> > -#ifndef CONFIG_DM_I2C
> > -#define CONFIG_SYS_I2C
> > -#define CONFIG_SYS_I2C_BASE  SOCFPGA_I2C0_ADDRESS
> > -#define CONFIG_SYS_I2C_BASE1 SOCFPGA_I2C1_ADDRESS
> > -#define CONFIG_SYS_I2C_BASE2 SOCFPGA_I2C2_ADDRESS
> > -#define CONFIG_SYS_I2C_BASE3 SOCFPGA_I2C3_ADDRESS
> > -/* Using standard mode which the speed up to 100Kb/s */
> > -#define CONFIG_SYS_I2C_SPEED 10
> > -#define CONFIG_SYS_I2C_SPEED110
> > -#define CONFIG_SYS_I2C_SPEED210
> > -#define CONFIG_SYS_I2C_SPEED310
> > -/* Address of device when used as slave */
> > -#define CONFIG_SYS_I2C_SLAVE 0x02
> > -#define CONFIG_SYS_I2C_SLAVE10x02
> > -#define CONFIG_SYS_I2C_SLAVE20x02
> > -#define CONFIG_SYS_I2C_SLAVE30x02
> > -#ifndef __ASSEMBLY__
> > -/* Clock supplied to I2C controller in unit of MHz */
> > -unsigned int cm_get_l4_sp_clk_hz(void);
> > -#define IC_CLK   (cm_get_l4_sp_clk_hz() /
> 100)
> > -#endif
> > -#endif /* CONFIG_DM_I2C */
> > -
> >  /*
> >   * QSPI support
> >   */
> > diff --git a/include/configs/socfpga_vining_fpga.h
> b/include/configs/socfpga_vining_fpga.h
> > index 5517ed722d..2c6fee6ece 100644
> > --- a/include/configs/socfpga_vining_fpga.h
> > +++ b/include/configs/socfpga_vining_fpga.h
> > @@ -16,6 +16,30 @@
> >  #define CONFIG_LOADADDR  0x0100
> >  #define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR
> >
> > +/* I2C support */
> > +#ifndef CONFIG_DM_I2C
> > +#define CONFIG_SYS_I2C
> > +#define CONFIG_SYS_I2C_BASE  SOCFPGA_I2C0_ADDRESS
> > +#define CONFIG_SYS_I2C_BASE1 SOCFPGA_I2C1_ADDRESS
> > +#define CONFIG_SYS_I2C_BASE2 SOCFPGA_I2C2_ADDRESS
> > +#define CONFIG_SYS_I2C_BASE3 SOCFPGA_I2C3_ADDRESS
> > +/* Using standard mode which the speed up to 100Kb/s */
> > +#define CONFIG_SYS_I2C_SPEED 10
> > +#define CONFIG_SYS_I2C_SPEED110
> > +#define CONFIG_SYS_I2C_SPEED210
> > +#define CONFIG_SYS_I2C_SPEED310
> > +/* Address of device when used as slave */
> > +#define CONFIG_SYS_I2C_SLAVE 0x02
> > +#define CONFIG_SYS_I2C_SLAVE10x02
> > +#define CONFIG_SYS_I2C_SLAVE20x02
> > +#define CONFIG_SYS_I2C_SLAVE30x02
> > +#ifndef __ASSEMBLY__
> > +/* Clock supplied to I2C controller in unit of MHz */
> > +unsigned int cm_get_l4_sp_clk_hz(void);
> > +#define IC_CLK   (cm_get_l4_sp_clk_hz() /
> 100)
> > +#endif
> > +#endif /* CONFIG_DM_I2C */
> > +
> >  /* I2C EEPROM */
> >  #ifdef CONFIG_CMD_EEPROM
> >  #define CONFIG_SYS_I2C_EEPROM_ADDR   0x50
> >
>
>
> --
> Best regards,
> Marek Vasut
>
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 3/3] arm: socfpga: remove CONFIG_SYS_BOOTMAPSZ

2019-01-09 Thread Marek Vasut
On 1/9/19 10:30 PM, Simon Goldschmidt wrote:
> 
> 
> Am Mi., 9. Jan. 2019, 22:27 hat Marek Vasut  > geschrieben:
> 
> On 1/9/19 8:56 PM, Simon Goldschmidt wrote:
> > socfpga_common.h defines CONFIG_SYS_BOOTMAPSZ to 64 MiB.
> >
> > Since having this define overrides the 'bootm_size' env variable for
> > the whole socfpga platform, let's remove this define from
> socfpga_common.h
> > and instead rely on the 'bootm_size' env variable (which is
> initialized
> > to 160 MiB in the same file's default env). This gives users the
> > chance to override it in their own environment.
> >
> > Signed-off-by: Simon Goldschmidt  >
> > ---
> >
> >  include/configs/socfpga_common.h | 2 --
> >  1 file changed, 2 deletions(-)
> >
> > diff --git a/include/configs/socfpga_common.h
> b/include/configs/socfpga_common.h
> > index e9b368d93a..04e0f06230 100644
> > --- a/include/configs/socfpga_common.h
> > +++ b/include/configs/socfpga_common.h
> > @@ -10,8 +10,6 @@
> >   */
> >  #define CONFIG_CLOCKS
> > 
> > -#define CONFIG_SYS_BOOTMAPSZ         (64 * 1024 * 1024)
> > -
> >  #define CONFIG_TIMESTAMP             /* Print image info with
> timestamp */
> > 
> >  /* add target to build it automatically upon "make" */
> >
> Can you at least "imply" it to 64 MiB, so we don't change the behavior ?
> 
> 
> You mean change the "boot_size" value in default environment to 64 MiB?
> Sure.

Sure, just so we won't change the behavior, some people like to run
gigantic kernels.

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


Re: [U-Boot] [PATCH 3/3] arm: socfpga: remove CONFIG_SYS_BOOTMAPSZ

2019-01-09 Thread Simon Goldschmidt
Am Mi., 9. Jan. 2019, 22:27 hat Marek Vasut  geschrieben:

> On 1/9/19 8:56 PM, Simon Goldschmidt wrote:
> > socfpga_common.h defines CONFIG_SYS_BOOTMAPSZ to 64 MiB.
> >
> > Since having this define overrides the 'bootm_size' env variable for
> > the whole socfpga platform, let's remove this define from
> socfpga_common.h
> > and instead rely on the 'bootm_size' env variable (which is initialized
> > to 160 MiB in the same file's default env). This gives users the
> > chance to override it in their own environment.
> >
> > Signed-off-by: Simon Goldschmidt 
> > ---
> >
> >  include/configs/socfpga_common.h | 2 --
> >  1 file changed, 2 deletions(-)
> >
> > diff --git a/include/configs/socfpga_common.h
> b/include/configs/socfpga_common.h
> > index e9b368d93a..04e0f06230 100644
> > --- a/include/configs/socfpga_common.h
> > +++ b/include/configs/socfpga_common.h
> > @@ -10,8 +10,6 @@
> >   */
> >  #define CONFIG_CLOCKS
> >
> > -#define CONFIG_SYS_BOOTMAPSZ (64 * 1024 * 1024)
> > -
> >  #define CONFIG_TIMESTAMP /* Print image info with timestamp
> */
> >
> >  /* add target to build it automatically upon "make" */
> >
> Can you at least "imply" it to 64 MiB, so we don't change the behavior ?
>

You mean change the "boot_size" value in default environment to 64 MiB?
Sure.

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


Re: [U-Boot] [PATCH 3/3] arm: socfpga: remove CONFIG_SYS_BOOTMAPSZ

2019-01-09 Thread Marek Vasut
On 1/9/19 8:56 PM, Simon Goldschmidt wrote:
> socfpga_common.h defines CONFIG_SYS_BOOTMAPSZ to 64 MiB.
> 
> Since having this define overrides the 'bootm_size' env variable for
> the whole socfpga platform, let's remove this define from socfpga_common.h
> and instead rely on the 'bootm_size' env variable (which is initialized
> to 160 MiB in the same file's default env). This gives users the
> chance to override it in their own environment.
> 
> Signed-off-by: Simon Goldschmidt 
> ---
> 
>  include/configs/socfpga_common.h | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/include/configs/socfpga_common.h 
> b/include/configs/socfpga_common.h
> index e9b368d93a..04e0f06230 100644
> --- a/include/configs/socfpga_common.h
> +++ b/include/configs/socfpga_common.h
> @@ -10,8 +10,6 @@
>   */
>  #define CONFIG_CLOCKS
>  
> -#define CONFIG_SYS_BOOTMAPSZ (64 * 1024 * 1024)
> -
>  #define CONFIG_TIMESTAMP /* Print image info with timestamp */
>  
>  /* add target to build it automatically upon "make" */
> 
Can you at least "imply" it to 64 MiB, so we don't change the behavior ?

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


Re: [U-Boot] [PATCH 2/3] arm: socfpga: clean up socfpga_common.h

2019-01-09 Thread Marek Vasut
On 1/9/19 8:56 PM, Simon Goldschmidt wrote:
> Remove outdated defines (not used any more, outdated due to DM
> conversion) from socfpga_common.h.
> 
> Signed-off-by: Simon Goldschmidt 

Acked-by: Marek Vasut 

> ---
> 
>  include/configs/socfpga_common.h | 13 -
>  1 file changed, 13 deletions(-)
> 
> diff --git a/include/configs/socfpga_common.h 
> b/include/configs/socfpga_common.h
> index 087ed6e96d..e9b368d93a 100644
> --- a/include/configs/socfpga_common.h
> +++ b/include/configs/socfpga_common.h
> @@ -58,10 +58,6 @@
>  #define CONFIG_SYS_BARGSIZE  CONFIG_SYS_CBSIZE
>   /* Boot argument buffer size */
>  
> -#ifndef CONFIG_SYS_HOSTNAME
> -#define CONFIG_SYS_HOSTNAME  CONFIG_SYS_BOARD
> -#endif
> -
>  /*
>   * Cache
>   */
> @@ -150,15 +146,6 @@ unsigned int cm_get_qspi_controller_clk_hz(void);
>  #define CONFIG_CQSPI_REF_CLK cm_get_qspi_controller_clk_hz()
>  #endif
>  
> -/*
> - * Designware SPI support
> - */
> -
> -/*
> - * Serial Driver
> - */
> -#define CONFIG_SYS_NS16550_SERIAL
> -
>  /*
>   * USB
>   */
> 


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


Re: [U-Boot] [PATCH 1/3] arm: socfpga: move legacy i2c defines to vining

2019-01-09 Thread Marek Vasut
On 1/9/19 8:56 PM, Simon Goldschmidt wrote:
> All socfpga boards exept for vining_fpga use DM_I2C. Move the non-DM
> i2c defines from socfpga_common.h to socfpga_vining_fpga.h to prevent
> i2c getting enabled for those boards when DM_I2C is deselected.

Can you just flip the board to DM I2C ? I can test the patch .

> Signed-off-by: Simon Goldschmidt 
> ---
> 
>  include/configs/socfpga_common.h  | 26 --
>  include/configs/socfpga_vining_fpga.h | 24 
>  2 files changed, 24 insertions(+), 26 deletions(-)
> 
> diff --git a/include/configs/socfpga_common.h 
> b/include/configs/socfpga_common.h
> index bd8f5c8c41..087ed6e96d 100644
> --- a/include/configs/socfpga_common.h
> +++ b/include/configs/socfpga_common.h
> @@ -137,32 +137,6 @@
>  #define CONFIG_SYS_NAND_DATA_BASESOCFPGA_NANDDATA_ADDRESS
>  #endif
>  
> -/*
> - * I2C support
> - */
> -#ifndef CONFIG_DM_I2C
> -#define CONFIG_SYS_I2C
> -#define CONFIG_SYS_I2C_BASE  SOCFPGA_I2C0_ADDRESS
> -#define CONFIG_SYS_I2C_BASE1 SOCFPGA_I2C1_ADDRESS
> -#define CONFIG_SYS_I2C_BASE2 SOCFPGA_I2C2_ADDRESS
> -#define CONFIG_SYS_I2C_BASE3 SOCFPGA_I2C3_ADDRESS
> -/* Using standard mode which the speed up to 100Kb/s */
> -#define CONFIG_SYS_I2C_SPEED 10
> -#define CONFIG_SYS_I2C_SPEED110
> -#define CONFIG_SYS_I2C_SPEED210
> -#define CONFIG_SYS_I2C_SPEED310
> -/* Address of device when used as slave */
> -#define CONFIG_SYS_I2C_SLAVE 0x02
> -#define CONFIG_SYS_I2C_SLAVE10x02
> -#define CONFIG_SYS_I2C_SLAVE20x02
> -#define CONFIG_SYS_I2C_SLAVE30x02
> -#ifndef __ASSEMBLY__
> -/* Clock supplied to I2C controller in unit of MHz */
> -unsigned int cm_get_l4_sp_clk_hz(void);
> -#define IC_CLK   (cm_get_l4_sp_clk_hz() / 
> 100)
> -#endif
> -#endif /* CONFIG_DM_I2C */
> -
>  /*
>   * QSPI support
>   */
> diff --git a/include/configs/socfpga_vining_fpga.h 
> b/include/configs/socfpga_vining_fpga.h
> index 5517ed722d..2c6fee6ece 100644
> --- a/include/configs/socfpga_vining_fpga.h
> +++ b/include/configs/socfpga_vining_fpga.h
> @@ -16,6 +16,30 @@
>  #define CONFIG_LOADADDR  0x0100
>  #define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR
>  
> +/* I2C support */
> +#ifndef CONFIG_DM_I2C
> +#define CONFIG_SYS_I2C
> +#define CONFIG_SYS_I2C_BASE  SOCFPGA_I2C0_ADDRESS
> +#define CONFIG_SYS_I2C_BASE1 SOCFPGA_I2C1_ADDRESS
> +#define CONFIG_SYS_I2C_BASE2 SOCFPGA_I2C2_ADDRESS
> +#define CONFIG_SYS_I2C_BASE3 SOCFPGA_I2C3_ADDRESS
> +/* Using standard mode which the speed up to 100Kb/s */
> +#define CONFIG_SYS_I2C_SPEED 10
> +#define CONFIG_SYS_I2C_SPEED110
> +#define CONFIG_SYS_I2C_SPEED210
> +#define CONFIG_SYS_I2C_SPEED310
> +/* Address of device when used as slave */
> +#define CONFIG_SYS_I2C_SLAVE 0x02
> +#define CONFIG_SYS_I2C_SLAVE10x02
> +#define CONFIG_SYS_I2C_SLAVE20x02
> +#define CONFIG_SYS_I2C_SLAVE30x02
> +#ifndef __ASSEMBLY__
> +/* Clock supplied to I2C controller in unit of MHz */
> +unsigned int cm_get_l4_sp_clk_hz(void);
> +#define IC_CLK   (cm_get_l4_sp_clk_hz() / 
> 100)
> +#endif
> +#endif /* CONFIG_DM_I2C */
> +
>  /* I2C EEPROM */
>  #ifdef CONFIG_CMD_EEPROM
>  #define CONFIG_SYS_I2C_EEPROM_ADDR   0x50
> 


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


[U-Boot] [PATCH 1/1] efi_loader: fix CopyMem()

2019-01-09 Thread Heinrich Schuchardt
CopyMem() must support overlapping buffers. So replace memcpy() by
memmove().

Signed-off-by: Heinrich Schuchardt 
---
 lib/efi_loader/efi_boottime.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c
index 88386ff676..dbf0d56c1d 100644
--- a/lib/efi_loader/efi_boottime.c
+++ b/lib/efi_loader/efi_boottime.c
@@ -2483,7 +2483,7 @@ static void EFIAPI efi_copy_mem(void *destination, const 
void *source,
size_t length)
 {
EFI_ENTRY("%p, %p, %ld", destination, source, (unsigned long)length);
-   memcpy(destination, source, length);
+   memmove(destination, source, length);
EFI_EXIT(EFI_SUCCESS);
 }
 
-- 
2.20.1

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


Re: [U-Boot] [PATCH 1/2] env: fix allow to build multiple environments

2019-01-09 Thread York Sun
On 1/2/19 8:37 PM, Rajesh Bhagat wrote:
> Patch fixes build error when enabling CONFIG_ENV_IS_IN_SPI_FLASH
> and CONFIG_ENV_IS_IN_MMC at the same time mentioned issue in
> below link:
> 
> Refer: https://lists.denx.de/pipermail/u-boot/2018-February/319565.html
> 
> build error when enabling CONFIG_ENV_IS_IN_SPI_FLASH and
> CONFIG_ENV_IS_IN_MMC at the same time.
> 
> Signed-off-by: Rajesh Bhagat 
> ---
> Depends on:
> https://patchwork.ozlabs.org/project/uboot/list/?series=83635

Rajesh,

Please resend this set and CC maintainers.

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


[U-Boot] [PATCH] arm: ti: boot: Fix am57xx evm fdtfile name

2019-01-09 Thread Praneeth Bajjuri
am57xx evm uses am57xx-evm-reva3.dtb.
update findfdt to pick the correct default dtb

Signed-off-by: Praneeth Bajjuri 
---
 include/environment/ti/boot.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/environment/ti/boot.h b/include/environment/ti/boot.h
index 86ff6d3ea7c6..c9ad3046acaa 100644
--- a/include/environment/ti/boot.h
+++ b/include/environment/ti/boot.h
@@ -125,7 +125,7 @@
"if test $board_name = am57xx_evm; then " \
"setenv fdtfile am57xx-beagle-x15.dtb; fi;" \
"if test $board_name = am57xx_evm_reva3; then " \
-   "setenv fdtfile am57xx-beagle-x15.dtb; fi;" \
+   "setenv fdtfile am57xx-evm-reva3.dtb; fi;" \
"if test $board_name = am571x_idk; then " \
"setenv fdtfile am571x-idk.dtb; fi;" \
"if test $fdtfile = undefined; then " \
-- 
2.7.4

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


[U-Boot] [PATCH 2/3] arm: socfpga: clean up socfpga_common.h

2019-01-09 Thread Simon Goldschmidt
Remove outdated defines (not used any more, outdated due to DM
conversion) from socfpga_common.h.

Signed-off-by: Simon Goldschmidt 
---

 include/configs/socfpga_common.h | 13 -
 1 file changed, 13 deletions(-)

diff --git a/include/configs/socfpga_common.h b/include/configs/socfpga_common.h
index 087ed6e96d..e9b368d93a 100644
--- a/include/configs/socfpga_common.h
+++ b/include/configs/socfpga_common.h
@@ -58,10 +58,6 @@
 #define CONFIG_SYS_BARGSIZECONFIG_SYS_CBSIZE
/* Boot argument buffer size */
 
-#ifndef CONFIG_SYS_HOSTNAME
-#define CONFIG_SYS_HOSTNAMECONFIG_SYS_BOARD
-#endif
-
 /*
  * Cache
  */
@@ -150,15 +146,6 @@ unsigned int cm_get_qspi_controller_clk_hz(void);
 #define CONFIG_CQSPI_REF_CLK   cm_get_qspi_controller_clk_hz()
 #endif
 
-/*
- * Designware SPI support
- */
-
-/*
- * Serial Driver
- */
-#define CONFIG_SYS_NS16550_SERIAL
-
 /*
  * USB
  */
-- 
2.17.1

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


[U-Boot] [PATCH 3/3] arm: socfpga: remove CONFIG_SYS_BOOTMAPSZ

2019-01-09 Thread Simon Goldschmidt
socfpga_common.h defines CONFIG_SYS_BOOTMAPSZ to 64 MiB.

Since having this define overrides the 'bootm_size' env variable for
the whole socfpga platform, let's remove this define from socfpga_common.h
and instead rely on the 'bootm_size' env variable (which is initialized
to 160 MiB in the same file's default env). This gives users the
chance to override it in their own environment.

Signed-off-by: Simon Goldschmidt 
---

 include/configs/socfpga_common.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/include/configs/socfpga_common.h b/include/configs/socfpga_common.h
index e9b368d93a..04e0f06230 100644
--- a/include/configs/socfpga_common.h
+++ b/include/configs/socfpga_common.h
@@ -10,8 +10,6 @@
  */
 #define CONFIG_CLOCKS
 
-#define CONFIG_SYS_BOOTMAPSZ   (64 * 1024 * 1024)
-
 #define CONFIG_TIMESTAMP   /* Print image info with timestamp */
 
 /* add target to build it automatically upon "make" */
-- 
2.17.1

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


[U-Boot] [PATCH 1/3] arm: socfpga: move legacy i2c defines to vining

2019-01-09 Thread Simon Goldschmidt
All socfpga boards exept for vining_fpga use DM_I2C. Move the non-DM
i2c defines from socfpga_common.h to socfpga_vining_fpga.h to prevent
i2c getting enabled for those boards when DM_I2C is deselected.

Signed-off-by: Simon Goldschmidt 
---

 include/configs/socfpga_common.h  | 26 --
 include/configs/socfpga_vining_fpga.h | 24 
 2 files changed, 24 insertions(+), 26 deletions(-)

diff --git a/include/configs/socfpga_common.h b/include/configs/socfpga_common.h
index bd8f5c8c41..087ed6e96d 100644
--- a/include/configs/socfpga_common.h
+++ b/include/configs/socfpga_common.h
@@ -137,32 +137,6 @@
 #define CONFIG_SYS_NAND_DATA_BASE  SOCFPGA_NANDDATA_ADDRESS
 #endif
 
-/*
- * I2C support
- */
-#ifndef CONFIG_DM_I2C
-#define CONFIG_SYS_I2C
-#define CONFIG_SYS_I2C_BASESOCFPGA_I2C0_ADDRESS
-#define CONFIG_SYS_I2C_BASE1   SOCFPGA_I2C1_ADDRESS
-#define CONFIG_SYS_I2C_BASE2   SOCFPGA_I2C2_ADDRESS
-#define CONFIG_SYS_I2C_BASE3   SOCFPGA_I2C3_ADDRESS
-/* Using standard mode which the speed up to 100Kb/s */
-#define CONFIG_SYS_I2C_SPEED   10
-#define CONFIG_SYS_I2C_SPEED1  10
-#define CONFIG_SYS_I2C_SPEED2  10
-#define CONFIG_SYS_I2C_SPEED3  10
-/* Address of device when used as slave */
-#define CONFIG_SYS_I2C_SLAVE   0x02
-#define CONFIG_SYS_I2C_SLAVE1  0x02
-#define CONFIG_SYS_I2C_SLAVE2  0x02
-#define CONFIG_SYS_I2C_SLAVE3  0x02
-#ifndef __ASSEMBLY__
-/* Clock supplied to I2C controller in unit of MHz */
-unsigned int cm_get_l4_sp_clk_hz(void);
-#define IC_CLK (cm_get_l4_sp_clk_hz() / 100)
-#endif
-#endif /* CONFIG_DM_I2C */
-
 /*
  * QSPI support
  */
diff --git a/include/configs/socfpga_vining_fpga.h 
b/include/configs/socfpga_vining_fpga.h
index 5517ed722d..2c6fee6ece 100644
--- a/include/configs/socfpga_vining_fpga.h
+++ b/include/configs/socfpga_vining_fpga.h
@@ -16,6 +16,30 @@
 #define CONFIG_LOADADDR0x0100
 #define CONFIG_SYS_LOAD_ADDR   CONFIG_LOADADDR
 
+/* I2C support */
+#ifndef CONFIG_DM_I2C
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_BASESOCFPGA_I2C0_ADDRESS
+#define CONFIG_SYS_I2C_BASE1   SOCFPGA_I2C1_ADDRESS
+#define CONFIG_SYS_I2C_BASE2   SOCFPGA_I2C2_ADDRESS
+#define CONFIG_SYS_I2C_BASE3   SOCFPGA_I2C3_ADDRESS
+/* Using standard mode which the speed up to 100Kb/s */
+#define CONFIG_SYS_I2C_SPEED   10
+#define CONFIG_SYS_I2C_SPEED1  10
+#define CONFIG_SYS_I2C_SPEED2  10
+#define CONFIG_SYS_I2C_SPEED3  10
+/* Address of device when used as slave */
+#define CONFIG_SYS_I2C_SLAVE   0x02
+#define CONFIG_SYS_I2C_SLAVE1  0x02
+#define CONFIG_SYS_I2C_SLAVE2  0x02
+#define CONFIG_SYS_I2C_SLAVE3  0x02
+#ifndef __ASSEMBLY__
+/* Clock supplied to I2C controller in unit of MHz */
+unsigned int cm_get_l4_sp_clk_hz(void);
+#define IC_CLK (cm_get_l4_sp_clk_hz() / 100)
+#endif
+#endif /* CONFIG_DM_I2C */
+
 /* I2C EEPROM */
 #ifdef CONFIG_CMD_EEPROM
 #define CONFIG_SYS_I2C_EEPROM_ADDR 0x50
-- 
2.17.1

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


[U-Boot] [PATCH 0/3] arm: socfpga: clean up socfpga_common.h

2019-01-09 Thread Simon Goldschmidt
This series cleans up the include/configs/socfpga_common.h file a bit.

It removes some defines that are used nowhere and cleans up some
leftovers after various subsystems have been converted to use DM.


Simon Goldschmidt (3):
  arm: socfpga: move legacy i2c defines to vining
  arm: socfpga: clean up socfpga_common.h
  arm: socfpga: remove CONFIG_SYS_BOOTMAPSZ

 include/configs/socfpga_common.h  | 41 ---
 include/configs/socfpga_vining_fpga.h | 24 
 2 files changed, 24 insertions(+), 41 deletions(-)

-- 
2.17.1

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


[U-Boot] [PATCH] serial: ns16550: fix debug uart putc called before init

2019-01-09 Thread Simon Goldschmidt
If _debug_uart_putc() is called before _debug_uart_init(), the
ns16550 debug uart driver hangs in a tight loop waiting for the
tx FIFO to get empty.

As this can happen via a printf sneaking in before the port calls
debug_uart_init(), introduce a config option to ignore characters
before the debug uart is initialized.

This is done by reading the baudrate divisor and aborting if is zero.

The Kconfig option is required as reading the baudrate divisor does
not seem to work for all ns16500 compatibles (which is why the last
attempt on this has been reverted in 1a67969a99).

Tested on socfpga_cyclone5_socrates.

Signed-off-by: Simon Goldschmidt 
---

 drivers/serial/Kconfig   | 12 
 drivers/serial/ns16550.c | 20 ++--
 2 files changed, 30 insertions(+), 2 deletions(-)

diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig
index b7ff2960ab..8709bf69c0 100644
--- a/drivers/serial/Kconfig
+++ b/drivers/serial/Kconfig
@@ -446,6 +446,18 @@ config DEBUG_UART_SKIP_INIT
  Select this if the UART you want to use for debug output is already
  initialized by the time U-Boot starts its execution.
 
+config DEBUG_UART_NS16550_CHECK_ENABLED
+   bool "Check if UART is enabled on output"
+   depends on DEBUG_UART
+   depends on DEBUG_UART_NS16550
+   help
+ Select this if puts()/putc() might be called before the debug UART
+ has been initialized. If this is disabled, putc() might sit in a
+ tight loop if it is called before debug_uart_init() has been called.
+
+ Note that this does not work for every ns16550-compatible UART and
+ so has to be enabled carefully or you might notice lost characters.
+
 config ALTERA_JTAG_UART
bool "Altera JTAG UART support"
depends on DM_SERIAL
diff --git a/drivers/serial/ns16550.c b/drivers/serial/ns16550.c
index 560ca2ae34..6cf2be8f2b 100644
--- a/drivers/serial/ns16550.c
+++ b/drivers/serial/ns16550.c
@@ -272,12 +272,28 @@ static inline void _debug_uart_init(void)
serial_dout(_port->lcr, UART_LCRVAL);
 }
 
+static inline int NS16550_read_baud_divisor(struct NS16550 *com_port)
+{
+   int ret;
+
+   serial_dout(_port->lcr, UART_LCR_BKSE | UART_LCRVAL);
+   ret = serial_din(_port->dll) & 0xff;
+   ret |= (serial_din(_port->dlm) & 0xff) << 8;
+   serial_dout(_port->lcr, UART_LCRVAL);
+
+   return ret;
+}
+
 static inline void _debug_uart_putc(int ch)
 {
struct NS16550 *com_port = (struct NS16550 *)CONFIG_DEBUG_UART_BASE;
 
-   while (!(serial_din(_port->lsr) & UART_LSR_THRE))
-   ;
+   while (!(serial_din(_port->lsr) & UART_LSR_THRE)) {
+#ifdef CONFIG_DEBUG_UART_NS16550_CHECK_ENABLED
+   if (!NS16550_read_baud_divisor(com_port))
+   return;
+#endif
+   }
serial_dout(_port->thr, ch);
 }
 
-- 
2.17.1

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


[U-Boot] [PATCH] drivers: serial: DEBUG_UART_SKIP_INIT depends on DEBUG_UART

2019-01-09 Thread Simon Goldschmidt
DEBUG_UART_SKIP_INIT is used only by debug UART and thus should depend
on DEBUG_UART.

Signed-off-by: Simon Goldschmidt 
---

 drivers/serial/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig
index b7ff2960ab..e67ea52338 100644
--- a/drivers/serial/Kconfig
+++ b/drivers/serial/Kconfig
@@ -442,6 +442,7 @@ config DEBUG_UART_ANNOUNCE
 
 config DEBUG_UART_SKIP_INIT
bool "Skip UART initialization"
+   depends on DEBUG_UART
help
  Select this if the UART you want to use for debug output is already
  initialized by the time U-Boot starts its execution.
-- 
2.17.1

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


Re: [U-Boot] [PATCH v1 3/4] serial: add an of-platdata driver for "snps, dw-apb-uart"

2019-01-09 Thread Simon Goldschmidt

Hi Alexey,

Am 09.01.2019 um 09:35 schrieb Alexey Brodkin:

Hi Simon,


-Original Message-
From: Simon Goldschmidt [mailto:simon.k.r.goldschm...@gmail.com]
Sent: Tuesday, January 8, 2019 12:14 AM
To: Marek Vasut 
Cc: Simon Goldschmidt ; Patrice Chotard 
;
Simon Glass ; Anup Patel ; Lokesh Vutla 
;
Alexey Brodkin ; Patrick Delaunay 
; Marek Vasut
; u-boot@lists.denx.de; Álvaro Fernández Rojas 
; Ryder Lee
; Vikas Manocha ; Alexander Graf 
; Weijie
Gao 
Subject: [PATCH v1 3/4] serial: add an of-platdata driver for "snps,dw-apb-uart"

Add a driver for the "snps,dw-apb-uart" used in socfpga and others.

This driver is required to get OF_PLATDATA to work for socfpga.
It uses the ns16550 driver, converting the platdata from of-platdata
go the ns16550 format.

Signed-off-by: Simon Goldschmidt 
---

  drivers/serial/Kconfig | 10 
  drivers/serial/Makefile|  1 +
  drivers/serial/serial_dw_apb.c | 42 ++
  3 files changed, 53 insertions(+)
  create mode 100644 drivers/serial/serial_dw_apb.c

diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig
index b7ff2960ab..10addd3309 100644
--- a/drivers/serial/Kconfig
+++ b/drivers/serial/Kconfig
@@ -511,6 +511,16 @@ config BCM283X_PL011_SERIAL
  that supports automatic disable, so that it only gets used when
  the UART is actually muxed.

+config DESIGNWARE_SERIAL
+   bool "DesignWare UART support"
+   depends on DM_SERIAL && SPL_OF_PLATDATA


Might be a bit naïve question but why depend on SPL_OF_PLATDATA only?
What about CONFIG_OF_EMBED?

I'd happily switch my ARC boards on this driver and get rid of all
CONFIG_SYS_NS16550_xxx nonsense in include/configs/myboardname.h


I checked include/configs/socfpga_common.h again and by its using 
Kconfig and DM_SERIAL, there are no CONFIG_SYS_NS16550_xxx defines left 
(other than CONFIG_SYS_NS16550_SERIAL, which I will remove).


So it seems it's not a matter of a new driver but a matter of cleaning 
up the boards to use DM_SERIAL, I guess?


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


[U-Boot] [PATCH v2] mmc: sunxi: Fix mmc clocks for DM_MMC

2019-01-09 Thread Jagan Teki
Existing clock configure code has been followed based on the
legacy MMC dt node definitions and it cannot work with recent
dts(i) sync from Linux.

So, add clock configure code for Allwinner platforms which support
DM_MMC and eventually this will drop once CLK support is in Mainline.

Fixes: 3c92cca3cda0 ("ARM: dts: sun4i: Update A10 dts(i) files from 
Linux-v4.18-rc3")
Signed-off-by: Jagan Teki 
---
Changes for v2:
- Use u16 for gate and mclk offset, since future support for H6

 drivers/mmc/sunxi_mmc.c | 50 ++---
 1 file changed, 37 insertions(+), 13 deletions(-)

diff --git a/drivers/mmc/sunxi_mmc.c b/drivers/mmc/sunxi_mmc.c
index 9bf040cb40..302332bf97 100644
--- a/drivers/mmc/sunxi_mmc.c
+++ b/drivers/mmc/sunxi_mmc.c
@@ -19,6 +19,13 @@
 #include 
 #include 
 
+#ifdef CONFIG_DM_MMC
+struct sunxi_mmc_variant {
+   u16 gate_offset;
+   u16 mclk_offset;
+};
+#endif
+
 struct sunxi_mmc_plat {
struct mmc_config cfg;
struct mmc mmc;
@@ -32,6 +39,9 @@ struct sunxi_mmc_priv {
int cd_inverted;/* Inverted Card Detect */
struct sunxi_mmc *reg;
struct mmc_config cfg;
+#ifdef CONFIG_DM_MMC
+   const struct sunxi_mmc_variant *variant;
+#endif
 };
 
 #if !CONFIG_IS_ENABLED(DM_MMC)
@@ -599,7 +609,7 @@ static int sunxi_mmc_probe(struct udevice *dev)
struct sunxi_mmc_priv *priv = dev_get_priv(dev);
struct mmc_config *cfg = >cfg;
struct ofnode_phandle_args args;
-   u32 *gate_reg;
+   u32 *gate_reg, *ccu_reg;
int bus_width, ret;
 
cfg->name = dev->name;
@@ -618,21 +628,21 @@ static int sunxi_mmc_probe(struct udevice *dev)
cfg->f_max = 5200;
 
priv->reg = (void *)dev_read_addr(dev);
+   priv->variant =
+   (const struct sunxi_mmc_variant *)dev_get_driver_data(dev);
 
/* We don't have a sunxi clock driver so find the clock address here */
ret = dev_read_phandle_with_args(dev, "clocks", "#clock-cells", 0,
  1, );
if (ret)
return ret;
-   priv->mclkreg = (u32 *)ofnode_get_addr(args.node);
+   ccu_reg = (u32 *)ofnode_get_addr(args.node);
 
-   ret = dev_read_phandle_with_args(dev, "clocks", "#clock-cells", 0,
- 0, );
-   if (ret)
-   return ret;
-   gate_reg = (u32 *)ofnode_get_addr(args.node);
-   setbits_le32(gate_reg, 1 << args.args[0]);
-   priv->mmc_no = args.args[0] - 8;
+   priv->mmc_no = ((uintptr_t)priv->reg - SUNXI_MMC0_BASE) / 0x1000;
+   priv->mclkreg = (void *)ccu_reg +
+   (priv->variant->mclk_offset + (priv->mmc_no * 4));
+   gate_reg = (void *)ccu_reg + priv->variant->gate_offset;
+   setbits_le32(gate_reg, BIT(AHB_GATE_OFFSET_MMC(priv->mmc_no)));
 
ret = mmc_set_mod_clk(priv, 2400);
if (ret)
@@ -665,11 +675,25 @@ static int sunxi_mmc_bind(struct udevice *dev)
return mmc_bind(dev, >mmc, >cfg);
 }
 
+static const struct sunxi_mmc_variant sun4i_a10_variant = {
+   .gate_offset = 0x60,
+   .mclk_offset = 0x88,
+};
+
 static const struct udevice_id sunxi_mmc_ids[] = {
-   { .compatible = "allwinner,sun4i-a10-mmc" },
-   { .compatible = "allwinner,sun5i-a13-mmc" },
-   { .compatible = "allwinner,sun7i-a20-mmc" },
-   { }
+   {
+ .compatible = "allwinner,sun4i-a10-mmc",
+ .data = (ulong)_a10_variant,
+   },
+   {
+ .compatible = "allwinner,sun5i-a13-mmc",
+ .data = (ulong)_a10_variant,
+   },
+   {
+ .compatible = "allwinner,sun7i-a20-mmc",
+ .data = (ulong)_a10_variant,
+   },
+   { /* sentinel */ }
 };
 
 U_BOOT_DRIVER(sunxi_mmc_drv) = {
-- 
2.18.0.321.gffc6fa0e3

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


[U-Boot] imx7d SPL driver fails to allocate memory.

2019-01-09 Thread Rens Dol

Hi all,

I am trying to get SPL working on a imx7 based board. I need to 
configure the DDR voltage before u-boot can be loaded from NAND. I am 
using the pico-imx7_defconfig as a starting point. It already has SPL 
configured to initialize ddr.


From board_init_f I call spl_early_init() to initialize malloc_simple 
so that I can use the pmic driver to set the DDR voltage and configure 
DDR . So far everything is working as expected, I can write/read from DDR.


But this is as far as SPL wants to go.. my guess is that switching from 
malloc_simple in board_init_f() to the full malloc implementation is not 
working.


- I use boundarydevices/imx_usb_loader to load u-boot-nand-spl.imx -

- git.denx.de/u-boot-imx version 2019.01-rc1 -

This what my debug output shows.

U-Boot SPL 2019.01-rc1-dirty (Jan 09 2019 - 16:07:51 +0100)
spl_early_init
power_init Set ddr regulator to 1.50V
 -- mALLOc --
0040
pmic_alloc: new pmic struct: 0x009467b0
pmic_get: pmic BD71815 -> 0x009467b0
Bus: 1 PMIC:BD71815 probed!
i2c_write_data: chip=0x4b, len=0x0
write_data:
i2c_read_data: chip=0x4b, len=0x1
 0x41
PMIC:  BD71815 DEV_ID=0x41
i2c_write_data: chip=0x4b, len=0x1
write_data:  0x10
setup drr controller!
 Testing ram
>>SPL: board_init_r()
using memory 0x8830-0x8840 for malloc()
spl_init
spl_board_init
Trying to boot from NAND
spl: nand - using hw ecc
 Trying to load image from CONFIG_SYS_NAND_U_BOOT_OFFS 40 8780
nand_spl_load_image
mxs_nand_init
 -- mALLOc --
0598
 -- malloc_extend_top --  pagesz  = 1000
 nb  = 05A0
 top  = 0091F010
-- sbrk
 increment = 05B0 returns  = 8830-- sbrk end
 brk  = 8830
-- sbrk
 increment = 0A50 returns  = 883005B0-- sbrk end
top = 8830
old_top = 0091F010
old_top_size = 
top_size = 1000

MXS NAND: Failed to allocate private data.

Attached the spl/u-boot.cfg  and pico-imx7d.h files.

Here are my questions.

- Has anyone tried this before on a imx7d?

- Do I have conflicting configuration options?

- Do I need to relocate the complete SPL from SRAM to DDR to make this work?

- Should malloc be available in spl_board_init()?

By enabling CONFIG_SPL_SYS_MALLOC_SIMPLE it boots a little further, but 
gets stuck in the nand driver after reading the onfi data and searching 
for a bad block table.


Should it be possible to have usb + nand + i2c working using only 
CONFIG_SPL_SYS_MALLOC_SIMPLE?



Met vriendelijke groeten
Kind regards,

Rens Dol
Software Engineer
Opticon Sensors Europe B.V.
Opaallaan 35
2132 XV  HOOFDDORP
The Netherlands
Tel.+31(0)235692720
rens@opticon.com 1

#define CONFIG_CMD_FAT 1
#define CONFIG_SYS_BOOT_GET_CMDLINE 1
#define CONFIG_HAS_CAAM 1
#define CONFIG_BOOTM_NETBSD 1
#define CONFIG_BOARD_EARLY_INIT_F 1
#define CONFIG_CMD_FDT 1
#define CONFIG_USB_GADGET_DOWNLOAD 1
#define CONFIG_SYS_NAND_U_BOOT_OFFS 0x40
#define CONFIG_MXC_USB_FLAGS 0
#define CONFIG_IMX_CONFIG arch/arm/mach-imx/spl_nand.cfg
#define CONFIG_CMD_ITEST 1
#define CONFIG_BOOTM_VXWORKS 1
#define CONFIG_CMD_EDITENV 1
#define CONFIG_SPL_SPRINTF 1
#define CONFIG_FASTBOOT_GPT_NAME "gpt"
#define CONFIG_SPL_NAND_SUPPORT 1
#define CONFIG_SYS_MAX_NAND_DEVICE 1
#define CONFIG_CPU_V7_HAS_NONSEC 1
#define CONFIG_CMD_PART 1
#define CONFIG_DFU_OVER_USB 1
#define CONFIG_SPL_LOGLEVEL 4
#define CONFIG_SPL_USE_ARCH_MEMSET 1
#define CONFIG_HAS_VBAR 1
#define CONFIG_CMD_ENV_EXISTS 1
#define CONFIG_CMD_CRC32 1
#define CONFIG_SYS_LONGHELP 1
#define CONFIG_SYS_NAND_5_ADDR_CYCLE 
#define CONFIG_IS_MODULE(option) config_enabled(CONFIG_VAL(option ##_MODULE))
#define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR
#define CONFIG_FASTBOOT_BUF_SIZE 0x1000
#define CONFIG_HASH 1
#define CONFIG_SYS_FSL_MAX_NUM_OF_SEC 1
#define CONFIG_USE_ARCH_MEMSET 1
#define CONFIG_DISPLAY_BOARDINFO 1
#define CONFIG_CMD_CACHE 1
#define CONFIG_OPTEE_TZDRAM_BASE 0x
#define CONFIG_EXPERT 1
#define CONFIG_CMDLINE 1
#define CONFIG_BOOTDELAY 3
#define CONFIG_SYS_NAND_BASE 0x4000
#define CONFIG_MX7D 1
#define CONFIG_POWER_BD71815 
#define CONFIG_CMD_BOOTEFI 1
#define CONFIG_SYS_HELP_CMD_WIDTH 8
#define CONFIG_NR_DRAM_BANKS 1
#define CONFIG_EFI_PARTITION 1
#define CONFIG_FS_FAT 1
#define CONFIG_SYS_ARM_CACHE_CP15 1
#define CONFIG_BOOTM_RTEMS 1
#define CONFIG_SYS_CBSIZE 512
#define CONFIG_SYS_NAND_ONFI_DETECTION 
#define CONFIG_SYS_SPL_MALLOC_SIZE 0x10
#define CONFIG_ARMV7_LPAE 1
#define CONFIG_EHCI_HCD_INIT_AFTER_RESET 
#define CONFIG_BOOTM_LINUX 1
#define CONFIG_ARCH_MX7 1
#define CONFIG_DEFAULT_FDT_FILE ""
#define CONFIG_TARGET_PICO_IMX7D 1
#define CONFIG_BOARD_LATE_INIT 1
#define CONFIG_CREATE_ARCH_SYMLINK 1
#define CONFIG_CMD_CONSOLE 1
#define CONFIG_SUPPORT_OF_CONTROL 1
#define CONFIG_SPL_STRTO 1
#define CONFIG_SYS_CPU "armv7"
#define CONFIG_SPL_BOARD_INIT 1
#define CONFIG_BOOTP_PXE_CLIENTARCH 0x15
#define CONFIG_SYS_CACHELINE_SIZE 64
#define CONFIG_MMC 1
#define CONFIG_BOARD_SIZE_LIMIT 715776
#define CONFIG_CMD_USB_MASS_STORAGE 1
#define CONFIG_SMBIOS_PRODUCT_NAME "pico-imx7d"
#define 

Re: [U-Boot] [PATCH v3 7/7] MSCC: Add sysreset driver for Jaguar2 SOC family

2019-01-09 Thread Daniel Schwierzeck


Am 09.01.19 um 09:25 schrieb Horatiu Vultur:
> Create sysreset driver for Jaguar2 SOC family and update defconfig
> to use it.
> 
> Signed-off-by: Horatiu Vultur 
> ---
>  MAINTAINERS |  1 +
>  board/mscc/jr2/jr2.c|  8 +++
>  configs/mscc_jr2_defconfig  |  2 ++
>  drivers/sysreset/Kconfig|  6 ++
>  drivers/sysreset/Makefile   |  1 +
>  drivers/sysreset/sysreset_jr2.c | 46 
> +
>  6 files changed, 64 insertions(+)
>  create mode 100644 drivers/sysreset/sysreset_jr2.c
> 
> diff --git a/MAINTAINERS b/MAINTAINERS
> index d42736b..8b8cc9d 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -526,6 +526,7 @@ F:arch/mips/dts/serval*
>  F:   board/mscc/
>  F:   configs/mscc*
>  F:   drivers/gpio/mscc_sgpio.c
> +F:   drivers/sysreset/sysreset_jr2.c
>  F:   include/configs/vcoreiii.h
>  F:   drivers/pinctrl/mscc/
>  
> diff --git a/board/mscc/jr2/jr2.c b/board/mscc/jr2/jr2.c
> index 36f9896..2935ad0 100644
> --- a/board/mscc/jr2/jr2.c
> +++ b/board/mscc/jr2/jr2.c
> @@ -6,6 +6,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  
>  DECLARE_GLOBAL_DATA_PTR;
>  
> @@ -17,6 +18,8 @@ enum {
>  
>  int board_early_init_r(void)
>  {
> + int ret;
> +
>   /* Prepare SPI controller to be used in master mode */
>   writel(0, BASE_CFG + ICPU_SW_MODE);
>   clrsetbits_le32(BASE_CFG + ICPU_GENERAL_CTRL,
> @@ -30,6 +33,11 @@ int board_early_init_r(void)
>   if (IS_ENABLED(CONFIG_LED))
>   led_default_state();
>  
> + ret = device_bind_driver(gd->dm_root, "jr2_soft_reset",
> +  "reset_soft", NULL);
> + if (ret)
> + printf("Warning: No reset driver: ret=%d\n", ret);
> +

hm, that's still the same as v2. You don't need this code if you add a
sysreset node to device-tree.
But as already said, you don't need to add a sysreset driver with this
series. I'm fine with the v1 variant of initially extending
_machine_restart(). But you should consider adding a sysreset driver
later which supports all Microsemi SoC's.

>   return 0;
>  }
>  
> diff --git a/configs/mscc_jr2_defconfig b/configs/mscc_jr2_defconfig
> index b215754..e80dde6 100644
> --- a/configs/mscc_jr2_defconfig
> +++ b/configs/mscc_jr2_defconfig
> @@ -57,3 +57,5 @@ CONFIG_SPI=y
>  CONFIG_DM_SPI=y
>  CONFIG_LZMA=y
>  CONFIG_XZ=y
> +CONFIG_SYSRESET=y
> +CONFIG_SYSRESET_JR2=y
> diff --git a/drivers/sysreset/Kconfig b/drivers/sysreset/Kconfig
> index 8ce3e2e..7c6db0f 100644
> --- a/drivers/sysreset/Kconfig
> +++ b/drivers/sysreset/Kconfig
> @@ -43,6 +43,12 @@ config SYSRESET_TI_SCI
> This enables the system reset driver support over TI System Control
> Interface available on some new TI's SoCs.
>  
> +config SYSRESET_JR2
> + bool "Enable support for Jaguar2 soft reset"
> + depends on SOC_JR2
> + help
> +   This is soft reset on Jaguar2.
> +
>  endif
>  
>  config SYSRESET_SYSCON
> diff --git a/drivers/sysreset/Makefile b/drivers/sysreset/Makefile
> index b3728ac..24c488b 100644
> --- a/drivers/sysreset/Makefile
> +++ b/drivers/sysreset/Makefile
> @@ -16,3 +16,4 @@ obj-$(CONFIG_SYSRESET_SYSCON) += sysreset_syscon.o
>  obj-$(CONFIG_SYSRESET_WATCHDOG) += sysreset_watchdog.o
>  obj-$(CONFIG_SYSRESET_X86) += sysreset_x86.o
>  obj-$(CONFIG_TARGET_XTFPGA) += sysreset_xtfpga.o
> +obj-$(CONFIG_SYSRESET_JR2) += sysreset_jr2.o
> diff --git a/drivers/sysreset/sysreset_jr2.c b/drivers/sysreset/sysreset_jr2.c
> new file mode 100644
> index 000..76a5bac
> --- /dev/null
> +++ b/drivers/sysreset/sysreset_jr2.c
> @@ -0,0 +1,46 @@
> +// SPDX-License-Identifier: (GPL-2.0 OR MIT)
> +/*
> + * Microsemi SoCs pinctrl driver
> + *
> + * Author: 
> + * License: Dual MIT/GPL
> + * Copyright (c) 2018 Microsemi Corporation
> + */
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +static int jr2_sysreset_request(struct udevice *dev,
> + enum sysreset_t type)
> +{
> + register u32 reg = readl(BASE_CFG + ICPU_GENERAL_CTRL);
> + /* Set owner */
> + reg &= ~ICPU_GENERAL_CTRL_IF_SI_OWNER_M;
> + reg |= ICPU_GENERAL_CTRL_IF_SI_OWNER(1);
> + /* Set boot mode */
> + reg |= ICPU_GENERAL_CTRL_BOOT_MODE_ENA;
> + writel(reg, BASE_CFG + ICPU_GENERAL_CTRL);
> + /* Read back in order to make BOOT mode setting active */
> + reg = readl(BASE_CFG + ICPU_GENERAL_CTRL);
> + /* Reset CPU only - still executing _here_. but from cache */
> + writel(readl(BASE_CFG + ICPU_RESET) |
> +ICPU_RESET_CORE_RST_CPU_ONLY |
> +ICPU_RESET_CORE_RST_FORCE,
> +BASE_CFG + ICPU_RESET);
> +
> + return -EINPROGRESS;
> +}
> +
> +static struct sysreset_ops jr2_sysreset = {
> + .request = jr2_sysreset_request,
> +};
> +
> +U_BOOT_DRIVER(sysreset_jr2) = {
> + .id = UCLASS_SYSRESET,
> + .name   = "jr2_soft_reset",
> + .ops= _sysreset,
> +};
> 

-- 
- Daniel

Re: [U-Boot] [PATCH v3 1/7] pinctrl: mscc: Add gpio and pinctrl for Jaguar2 SOC family

2019-01-09 Thread Daniel Schwierzeck


Am 09.01.19 um 09:25 schrieb Horatiu Vultur:
> The Jaguar2 SOC family has 63 gpio pins therefore I extended mscc-common
> to support new numbe of pins and remove any platform dependency from
> mscc-common.
> 
> Signed-off-by: Horatiu Vultur 
> ---
>  MAINTAINERS   |   1 +
>  drivers/pinctrl/mscc/Kconfig  |   9 +
>  drivers/pinctrl/mscc/Makefile |   1 +
>  drivers/pinctrl/mscc/mscc-common.c|  90 +++---
>  drivers/pinctrl/mscc/mscc-common.h|  17 +-
>  drivers/pinctrl/mscc/pinctrl-jr2.c| 315 
> ++
>  drivers/pinctrl/mscc/pinctrl-luton.c  |  16 +-
>  drivers/pinctrl/mscc/pinctrl-ocelot.c |  16 +-
>  8 files changed, 436 insertions(+), 29 deletions(-)
>  create mode 100644 drivers/pinctrl/mscc/pinctrl-jr2.c
> 

Reviewed-by: Daniel Schwierzeck 

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


Re: [U-Boot] [PATCH v2 1/7] pinctrl: mscc: Add gpio and pinctrl for Jaguar2 SOC family

2019-01-09 Thread Daniel Schwierzeck


Am 09.01.19 um 09:21 schrieb Horatiu Vultur:
> Hi Daniel,
> 
> First, thank you for all the feedback.
> 
> I have created a new patch series that will fix the issue that you
> addressed bellow but the fix it would not use compatible string, because
> that presume that I need to change the other pinctrl-drivers(ocelot, luton).
> I was thinking if it is OK the way I have done in v3 and then create a
> new patch series specific for fixing pinctrl. Similar with the issue
> that I have for sysreset driver.

I didn't expect that you select the registers via compatible strings in
the pinctrl driver because you effectively have three drivers and a
common driver core. Your v3 variant is perfect. The compatible string
method makes sense for drivers that support more than one SoC. The
sysreset driver could be an example.

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


Re: [U-Boot] [PATCH] mmc: sunxi: Fix mmc clocks for DM_MMC

2019-01-09 Thread Jagan Teki
On Wed, Jan 9, 2019 at 10:21 PM Priit Laes  wrote:
>
> On Wed, Jan 09, 2019 at 07:31:43PM +0530, Jagan Teki wrote:
> > Existing clock configure code has been followed based on the
> > legacy MMC dt node definitions and it cannot work with recent
> > dts(i) sync from Linux.
> >
> > So, add clock configure code for Allwinner platforms which support
> > DM_MMC and eventually this will drop once CLK support is in Mainline.
>
> Tested-by: Priit Laes  on Gemei G9 A10 Tablet

Zoltan, or anyone, what is A20 bug - I couldn't see any issue from my end?
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH] mmc: sunxi: Fix mmc clocks for DM_MMC

2019-01-09 Thread Priit Laes
On Wed, Jan 09, 2019 at 07:31:43PM +0530, Jagan Teki wrote:
> Existing clock configure code has been followed based on the
> legacy MMC dt node definitions and it cannot work with recent
> dts(i) sync from Linux.
> 
> So, add clock configure code for Allwinner platforms which support
> DM_MMC and eventually this will drop once CLK support is in Mainline.

Tested-by: Priit Laes  on Gemei G9 A10 Tablet
> 
> Fixes: 3c92cca3cda0 ("ARM: dts: sun4i: Update A10 dts(i) files from 
> Linux-v4.18-rc3")
> Signed-off-by: Jagan Teki 
> ---
>  drivers/mmc/sunxi_mmc.c | 50 ++---
>  1 file changed, 37 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/mmc/sunxi_mmc.c b/drivers/mmc/sunxi_mmc.c
> index 9bf040cb40..c55b8b753d 100644
> --- a/drivers/mmc/sunxi_mmc.c
> +++ b/drivers/mmc/sunxi_mmc.c
> @@ -19,6 +19,13 @@
>  #include 
>  #include 
>  
> +#ifdef CONFIG_DM_MMC
> +struct sunxi_mmc_variant {
> + u8 gate_offset;
> + u8 mclk_offset;
> +};
> +#endif
> +
>  struct sunxi_mmc_plat {
>   struct mmc_config cfg;
>   struct mmc mmc;
> @@ -32,6 +39,9 @@ struct sunxi_mmc_priv {
>   int cd_inverted;/* Inverted Card Detect */
>   struct sunxi_mmc *reg;
>   struct mmc_config cfg;
> +#ifdef CONFIG_DM_MMC
> + const struct sunxi_mmc_variant *variant;
> +#endif
>  };
>  
>  #if !CONFIG_IS_ENABLED(DM_MMC)
> @@ -599,7 +609,7 @@ static int sunxi_mmc_probe(struct udevice *dev)
>   struct sunxi_mmc_priv *priv = dev_get_priv(dev);
>   struct mmc_config *cfg = >cfg;
>   struct ofnode_phandle_args args;
> - u32 *gate_reg;
> + u32 *gate_reg, *ccu_reg;
>   int bus_width, ret;
>  
>   cfg->name = dev->name;
> @@ -618,21 +628,21 @@ static int sunxi_mmc_probe(struct udevice *dev)
>   cfg->f_max = 5200;
>  
>   priv->reg = (void *)dev_read_addr(dev);
> + priv->variant =
> + (const struct sunxi_mmc_variant *)dev_get_driver_data(dev);
>  
>   /* We don't have a sunxi clock driver so find the clock address here */
>   ret = dev_read_phandle_with_args(dev, "clocks", "#clock-cells", 0,
> 1, );
>   if (ret)
>   return ret;
> - priv->mclkreg = (u32 *)ofnode_get_addr(args.node);
> + ccu_reg = (u32 *)ofnode_get_addr(args.node);
>  
> - ret = dev_read_phandle_with_args(dev, "clocks", "#clock-cells", 0,
> -   0, );
> - if (ret)
> - return ret;
> - gate_reg = (u32 *)ofnode_get_addr(args.node);
> - setbits_le32(gate_reg, 1 << args.args[0]);
> - priv->mmc_no = args.args[0] - 8;
> + priv->mmc_no = ((uintptr_t)priv->reg - SUNXI_MMC0_BASE) / 0x1000;
> + priv->mclkreg = (void *)ccu_reg +
> + (priv->variant->mclk_offset + (priv->mmc_no * 4));
> + gate_reg = (void *)ccu_reg + priv->variant->gate_offset;
> + setbits_le32(gate_reg, BIT(AHB_GATE_OFFSET_MMC(priv->mmc_no)));
>  
>   ret = mmc_set_mod_clk(priv, 2400);
>   if (ret)
> @@ -665,11 +675,25 @@ static int sunxi_mmc_bind(struct udevice *dev)
>   return mmc_bind(dev, >mmc, >cfg);
>  }
>  
> +static const struct sunxi_mmc_variant sun4i_a10_variant = {
> + .gate_offset = 0x60,
> + .mclk_offset = 0x88,
> +};
> +
>  static const struct udevice_id sunxi_mmc_ids[] = {
> - { .compatible = "allwinner,sun4i-a10-mmc" },
> - { .compatible = "allwinner,sun5i-a13-mmc" },
> - { .compatible = "allwinner,sun7i-a20-mmc" },
> - { }
> + {
> +   .compatible = "allwinner,sun4i-a10-mmc",
> +   .data = (ulong)_a10_variant,
> + },
> + {
> +   .compatible = "allwinner,sun5i-a13-mmc",
> +   .data = (ulong)_a10_variant,
> + },
> + {
> +   .compatible = "allwinner,sun7i-a20-mmc",
> +   .data = (ulong)_a10_variant,
> + },
> + { /* sentinel */ }
>  };
>  
>  U_BOOT_DRIVER(sunxi_mmc_drv) = {
> -- 
> 2.18.0.321.gffc6fa0e3
> 
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v3 5/8] arm: dts: imx7s-warp: Create alias for mmc0 to

2019-01-09 Thread Bryan O'Donoghue
This patch sets up an alias for mmc0 to usdhc3.

Before the DM conversion only usdhc3 was enabled and therefore it appeared
as MMC 0 to u-boot. After enabling MMC DM though usdhc3 defaults to MMC 2,
which left unattended would drive changes to existing warp7 bootscripts and
environment variables that rely on mmc 0.

Setup the alias of mmc0 and usdhc3 so that existing warp7 boot code will
work unmodified.

Signed-off-by: Bryan O'Donoghue 
Cc: Albert Aribaud 
Cc: Peng Fan 
Cc: Fabio Estevam 
Cc: Stefano Babic 
---
 arch/arm/dts/imx7s-warp.dts | 4 
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/dts/imx7s-warp.dts b/arch/arm/dts/imx7s-warp.dts
index f7ba2c0a24..d28b7ec715 100644
--- a/arch/arm/dts/imx7s-warp.dts
+++ b/arch/arm/dts/imx7s-warp.dts
@@ -17,6 +17,10 @@
reg = <0x8000 0x2000>;
};
 
+   aliases {
+   mmc0 = 
+   };
+
gpio-keys {
compatible = "gpio-keys";
pinctrl-0 = <_gpio>;
-- 
2.20.0

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


[U-Boot] [PATCH v3 7/8] warp7: defconfig: Switch to DM for I2C

2019-01-09 Thread Bryan O'Donoghue
This commit switches to DM I2C for warp7 and warp7_bl33 defconfigs.

Signed-off-by: Bryan O'Donoghue 
Reviewed-by: Peng Fan 
Cc: Peng Fan 
Cc: Fabio Estevam 
Cc: Stefano Babic 
---
 board/warp7/warp7.c  | 24 
 configs/warp7_bl33_defconfig |  1 +
 configs/warp7_defconfig  |  1 +
 include/configs/warp7.h  |  2 --
 4 files changed, 2 insertions(+), 26 deletions(-)

diff --git a/board/warp7/warp7.c b/board/warp7/warp7.c
index 146d722b15..19f0df4d09 100644
--- a/board/warp7/warp7.c
+++ b/board/warp7/warp7.c
@@ -31,26 +31,6 @@ DECLARE_GLOBAL_DATA_PTR;
 #define UART_PAD_CTRL  (PAD_CTL_DSE_3P3V_49OHM | PAD_CTL_PUS_PU100KOHM | \
PAD_CTL_HYS)
 
-#define I2C_PAD_CTRL   (PAD_CTL_DSE_3P3V_32OHM | PAD_CTL_SRE_SLOW | \
-   PAD_CTL_HYS | PAD_CTL_PUE | PAD_CTL_PUS_PU100KOHM)
-
-#ifdef CONFIG_SYS_I2C_MXC
-#define PC MUX_PAD_CTRL(I2C_PAD_CTRL)
-/* I2C1 for PMIC */
-static struct i2c_pads_info i2c_pad_info1 = {
-   .scl = {
-   .i2c_mode = MX7D_PAD_I2C1_SCL__I2C1_SCL | PC,
-   .gpio_mode = MX7D_PAD_I2C1_SCL__GPIO4_IO8 | PC,
-   .gp = IMX_GPIO_NR(4, 8),
-   },
-   .sda = {
-   .i2c_mode = MX7D_PAD_I2C1_SDA__I2C1_SDA | PC,
-   .gpio_mode = MX7D_PAD_I2C1_SDA__GPIO4_IO9 | PC,
-   .gp = IMX_GPIO_NR(4, 9),
-   },
-};
-#endif
-
 int dram_init(void)
 {
gd->ram_size = PHYS_SDRAM_SIZE;
@@ -130,10 +110,6 @@ int board_init(void)
/* address of boot parameters */
gd->bd->bi_boot_params = PHYS_SDRAM + 0x100;
 
-   #ifdef CONFIG_SYS_I2C_MXC
-   setup_i2c(0, CONFIG_SYS_I2C_SPEED, 0x7f, _pad_info1);
-   #endif
-
return 0;
 }
 
diff --git a/configs/warp7_bl33_defconfig b/configs/warp7_bl33_defconfig
index 7f21bb4f53..2e80011cbc 100644
--- a/configs/warp7_bl33_defconfig
+++ b/configs/warp7_bl33_defconfig
@@ -44,3 +44,4 @@ CONFIG_DEFAULT_DEVICE_TREE="imx7s-warp"
 CONFIG_PINCTRL=y
 CONFIG_PINCTRL_IMX7=y
 CONFIG_DM_GPIO=y
+CONFIG_DM_I2C=y
diff --git a/configs/warp7_defconfig b/configs/warp7_defconfig
index 2d3171e42a..9f7dc73a11 100644
--- a/configs/warp7_defconfig
+++ b/configs/warp7_defconfig
@@ -57,3 +57,4 @@ CONFIG_DEFAULT_DEVICE_TREE="imx7s-warp"
 CONFIG_PINCTRL=y
 CONFIG_PINCTRL_IMX7=y
 CONFIG_DM_GPIO=y
+CONFIG_DM_I2C=y
diff --git a/include/configs/warp7.h b/include/configs/warp7.h
index a391dfb5c1..41eb8d7e1d 100644
--- a/include/configs/warp7.h
+++ b/include/configs/warp7.h
@@ -126,9 +126,7 @@
(CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
 
 /* I2C configs */
-#define CONFIG_SYS_I2C
 #define CONFIG_SYS_I2C_MXC
-#define CONFIG_SYS_I2C_MXC_I2C1
 #define CONFIG_SYS_I2C_SPEED   10
 
 /* PMIC */
-- 
2.20.0

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


[U-Boot] [PATCH v3 4/8] arm: imx7s-warp: Convert to DM MMC initialization

2019-01-09 Thread Bryan O'Donoghue
Converts from fixed initialization of MMC to DM initialization of MMC.

Signed-off-by: Bryan O'Donoghue 
Cc: Albert Aribaud 
Cc: Peng Fan 
Cc: Fabio Estevam 
Cc: Stefano Babic 
---
 board/warp7/warp7.c  | 34 --
 configs/warp7_bl33_defconfig |  1 +
 configs/warp7_defconfig  |  1 +
 3 files changed, 2 insertions(+), 34 deletions(-)

diff --git a/board/warp7/warp7.c b/board/warp7/warp7.c
index 3d32b3eb52..146d722b15 100644
--- a/board/warp7/warp7.c
+++ b/board/warp7/warp7.c
@@ -30,8 +30,6 @@ DECLARE_GLOBAL_DATA_PTR;
 
 #define UART_PAD_CTRL  (PAD_CTL_DSE_3P3V_49OHM | PAD_CTL_PUS_PU100KOHM | \
PAD_CTL_HYS)
-#define USDHC_PAD_CTRL (PAD_CTL_DSE_3P3V_32OHM | PAD_CTL_SRE_SLOW |\
-   PAD_CTL_HYS | PAD_CTL_PUE | PAD_CTL_PUS_PU47KOHM)
 
 #define I2C_PAD_CTRL   (PAD_CTL_DSE_3P3V_32OHM | PAD_CTL_SRE_SLOW | \
PAD_CTL_HYS | PAD_CTL_PUE | PAD_CTL_PUS_PU100KOHM)
@@ -74,43 +72,11 @@ static iomux_v3_cfg_t const uart1_pads[] = {
MX7D_PAD_UART1_RX_DATA__UART1_DCE_RX | MUX_PAD_CTRL(UART_PAD_CTRL),
 };
 
-static iomux_v3_cfg_t const usdhc3_pads[] = {
-   MX7D_PAD_SD3_CLK__SD3_CLK | MUX_PAD_CTRL(USDHC_PAD_CTRL),
-   MX7D_PAD_SD3_CMD__SD3_CMD | MUX_PAD_CTRL(USDHC_PAD_CTRL),
-   MX7D_PAD_SD3_DATA0__SD3_DATA0 | MUX_PAD_CTRL(USDHC_PAD_CTRL),
-   MX7D_PAD_SD3_DATA1__SD3_DATA1 | MUX_PAD_CTRL(USDHC_PAD_CTRL),
-   MX7D_PAD_SD3_DATA2__SD3_DATA2 | MUX_PAD_CTRL(USDHC_PAD_CTRL),
-   MX7D_PAD_SD3_DATA3__SD3_DATA3 | MUX_PAD_CTRL(USDHC_PAD_CTRL),
-   MX7D_PAD_SD3_DATA4__SD3_DATA4 | MUX_PAD_CTRL(USDHC_PAD_CTRL),
-   MX7D_PAD_SD3_DATA5__SD3_DATA5 | MUX_PAD_CTRL(USDHC_PAD_CTRL),
-   MX7D_PAD_SD3_DATA6__SD3_DATA6 | MUX_PAD_CTRL(USDHC_PAD_CTRL),
-   MX7D_PAD_SD3_DATA7__SD3_DATA7 | MUX_PAD_CTRL(USDHC_PAD_CTRL),
-   MX7D_PAD_SD3_RESET_B__SD3_RESET_B | MUX_PAD_CTRL(USDHC_PAD_CTRL),
-};
-
 static void setup_iomux_uart(void)
 {
imx_iomux_v3_setup_multiple_pads(uart1_pads, ARRAY_SIZE(uart1_pads));
 };
 
-static struct fsl_esdhc_cfg usdhc_cfg[1] = {
-   {USDHC3_BASE_ADDR},
-};
-
-int board_mmc_getcd(struct mmc *mmc)
-{
-   /* Assume uSDHC3 emmc is always present */
-   return 1;
-}
-
-int board_mmc_init(bd_t *bis)
-{
-   imx_iomux_v3_setup_multiple_pads(usdhc3_pads, ARRAY_SIZE(usdhc3_pads));
-   usdhc_cfg[0].sdhc_clk = mxc_get_clock(MXC_ESDHC3_CLK);
-
-   return fsl_esdhc_initialize(bis, _cfg[0]);
-}
-
 int board_early_init_f(void)
 {
setup_iomux_uart();
diff --git a/configs/warp7_bl33_defconfig b/configs/warp7_bl33_defconfig
index 12141fedd3..b2f943c775 100644
--- a/configs/warp7_bl33_defconfig
+++ b/configs/warp7_bl33_defconfig
@@ -24,6 +24,7 @@ CONFIG_OF_CONTROL=y
 CONFIG_CMD_FS_GENERIC=y
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_DFU_MMC=y
+CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_HCD=y
diff --git a/configs/warp7_defconfig b/configs/warp7_defconfig
index fee98dfbbe..65d801ffe2 100644
--- a/configs/warp7_defconfig
+++ b/configs/warp7_defconfig
@@ -33,6 +33,7 @@ CONFIG_OF_CONTROL=y
 CONFIG_CMD_FS_GENERIC=y
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_DFU_MMC=y
+CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_OPTEE=y
 CONFIG_USB=y
-- 
2.20.0

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


[U-Boot] [PATCH v3 8/8] arm: imx7s-warp: Convert to DM PMIC

2019-01-09 Thread Bryan O'Donoghue
This patch converts the warp7 and warp7_bl33 board ports over to using the
DM PMIC model.

Signed-off-by: Bryan O'Donoghue 
Reviewed-by: Peng Fan 
Cc: Peng Fan 
Cc: Fabio Estevam 
Cc: Stefano Babic 
---
 board/warp7/warp7.c  | 27 +++
 configs/warp7_bl33_defconfig |  6 ++
 configs/warp7_defconfig  |  6 ++
 include/configs/warp7.h  |  6 --
 4 files changed, 23 insertions(+), 22 deletions(-)

diff --git a/board/warp7/warp7.c b/board/warp7/warp7.c
index 19f0df4d09..6ebeb08e33 100644
--- a/board/warp7/warp7.c
+++ b/board/warp7/warp7.c
@@ -64,29 +64,24 @@ int board_early_init_f(void)
return 0;
 }
 
-#ifdef CONFIG_POWER
-#define I2C_PMIC   0
-static struct pmic *pfuze;
+#ifdef CONFIG_DM_PMIC
 int power_init_board(void)
 {
-   int ret;
-   unsigned int reg, rev_id;
+   struct udevice *dev;
+   int ret, dev_id, rev_id;
 
-   ret = power_pfuze3000_init(I2C_PMIC);
-   if (ret)
+   ret = pmic_get("pfuze3000", );
+   if (ret == -ENODEV)
+   return 0;
+   if (ret != 0)
return ret;
 
-   pfuze = pmic_get("PFUZE3000");
-   ret = pmic_probe(pfuze);
-   if (ret)
-   return ret;
-
-   pmic_reg_read(pfuze, PFUZE3000_DEVICEID, );
-   pmic_reg_read(pfuze, PFUZE3000_REVID, _id);
-   printf("PMIC: PFUZE3000 DEV_ID=0x%x REV_ID=0x%x\n", reg, rev_id);
+   dev_id = pmic_reg_read(dev, PFUZE3000_DEVICEID);
+   rev_id = pmic_reg_read(dev, PFUZE3000_REVID);
+   printf("PMIC: PFUZE3000 DEV_ID=0x%x REV_ID=0x%x\n", dev_id, rev_id);
 
/* disable Low Power Mode during standby mode */
-   pmic_reg_write(pfuze, PFUZE3000_LDOGCTL, 0x1);
+   pmic_clrsetbits(dev, PFUZE3000_LDOGCTL, 0, 1);
 
return 0;
 }
diff --git a/configs/warp7_bl33_defconfig b/configs/warp7_bl33_defconfig
index 2e80011cbc..7b40bfbd6d 100644
--- a/configs/warp7_bl33_defconfig
+++ b/configs/warp7_bl33_defconfig
@@ -45,3 +45,9 @@ CONFIG_PINCTRL=y
 CONFIG_PINCTRL_IMX7=y
 CONFIG_DM_GPIO=y
 CONFIG_DM_I2C=y
+CONFIG_DM_PMIC=y
+CONFIG_DM_PMIC_PFUZE100=y
+CONFIG_DM_REGULATOR=y
+CONFIG_DM_REGULATOR_PFUZE100=y
+CONFIG_DM_REGULATOR_FIXED=y
+CONFIG_DM_REGULATOR_GPIO=y
diff --git a/configs/warp7_defconfig b/configs/warp7_defconfig
index 9f7dc73a11..d1c8e403a7 100644
--- a/configs/warp7_defconfig
+++ b/configs/warp7_defconfig
@@ -58,3 +58,9 @@ CONFIG_PINCTRL=y
 CONFIG_PINCTRL_IMX7=y
 CONFIG_DM_GPIO=y
 CONFIG_DM_I2C=y
+CONFIG_DM_PMIC=y
+CONFIG_DM_PMIC_PFUZE100=y
+CONFIG_DM_REGULATOR=y
+CONFIG_DM_REGULATOR_PFUZE100=y
+CONFIG_DM_REGULATOR_FIXED=y
+CONFIG_DM_REGULATOR_GPIO=y
diff --git a/include/configs/warp7.h b/include/configs/warp7.h
index 41eb8d7e1d..043f2861b6 100644
--- a/include/configs/warp7.h
+++ b/include/configs/warp7.h
@@ -129,12 +129,6 @@
 #define CONFIG_SYS_I2C_MXC
 #define CONFIG_SYS_I2C_SPEED   10
 
-/* PMIC */
-#define CONFIG_POWER
-#define CONFIG_POWER_I2C
-#define CONFIG_POWER_PFUZE3000
-#define CONFIG_POWER_PFUZE3000_I2C_ADDR0x08
-
 /* environment organization */
 #define CONFIG_ENV_SIZESZ_8K
 
-- 
2.20.0

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


[U-Boot] [PATCH v3 6/8] warp7: defconfig: Switch on IMX7 GPIO/pinctrl for both ports

2019-01-09 Thread Bryan O'Donoghue
Switches on the IMX7 pinctrl driver for the warp7 and warp7_bl33 ports,
necessary to convert over to DM for this board.

It is necessary to switch on pinctrl and GPIO in one go.

Signed-off-by: Bryan O'Donoghue 
Cc: Peng Fan 
Cc: Fabio Estevam 
Cc: Stefano Babic 
---
 configs/warp7_bl33_defconfig | 3 +++
 configs/warp7_defconfig  | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/configs/warp7_bl33_defconfig b/configs/warp7_bl33_defconfig
index b2f943c775..7f21bb4f53 100644
--- a/configs/warp7_bl33_defconfig
+++ b/configs/warp7_bl33_defconfig
@@ -41,3 +41,6 @@ CONFIG_USB_ETH_CDC=y
 CONFIG_USBNET_HOST_ADDR="de:ad:be:af:00:00"
 CONFIG_OPTEE_TZDRAM_SIZE=0x200
 CONFIG_DEFAULT_DEVICE_TREE="imx7s-warp"
+CONFIG_PINCTRL=y
+CONFIG_PINCTRL_IMX7=y
+CONFIG_DM_GPIO=y
diff --git a/configs/warp7_defconfig b/configs/warp7_defconfig
index 65d801ffe2..2d3171e42a 100644
--- a/configs/warp7_defconfig
+++ b/configs/warp7_defconfig
@@ -54,3 +54,6 @@ CONFIG_OPTEE_TZDRAM_SIZE=0x300
 CONFIG_OPTEE_TZDRAM_BASE=0x9d00
 CONFIG_BOOTM_OPTEE=y
 CONFIG_DEFAULT_DEVICE_TREE="imx7s-warp"
+CONFIG_PINCTRL=y
+CONFIG_PINCTRL_IMX7=y
+CONFIG_DM_GPIO=y
-- 
2.20.0

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


[U-Boot] [PATCH v3 2/8] arm: dts: imx7s-warp: Import Linux warp7 dts

2019-01-09 Thread Bryan O'Donoghue
This patch imports the Linux kernel warp7 dts as at upstream kernel commit
cf76c364a1e1.

Signed-off-by: Bryan O'Donoghue 
Cc: Albert Aribaud 
Cc: Peng Fan 
Cc: Fabio Estevam 
Cc: Stefano Babic 
---
 arch/arm/dts/imx7s-warp.dts | 438 
 1 file changed, 438 insertions(+)
 create mode 100644 arch/arm/dts/imx7s-warp.dts

diff --git a/arch/arm/dts/imx7s-warp.dts b/arch/arm/dts/imx7s-warp.dts
new file mode 100644
index 00..f7ba2c0a24
--- /dev/null
+++ b/arch/arm/dts/imx7s-warp.dts
@@ -0,0 +1,438 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (C) 2016 NXP Semiconductors.
+ * Author: Fabio Estevam 
+ */
+
+/dts-v1/;
+
+#include 
+#include "imx7s.dtsi"
+
+/ {
+   model = "Warp i.MX7 Board";
+   compatible = "warp,imx7s-warp", "fsl,imx7s";
+
+   memory@8000 {
+   reg = <0x8000 0x2000>;
+   };
+
+   gpio-keys {
+   compatible = "gpio-keys";
+   pinctrl-0 = <_gpio>;
+   autorepeat;
+
+   back {
+   label = "Back";
+   gpios = < 1 GPIO_ACTIVE_HIGH>;
+   linux,code = ;
+   wakeup-source;
+   };
+   };
+
+   reg_brcm: regulator-brcm {
+   compatible = "regulator-fixed";
+   enable-active-high;
+   gpio = < 10 GPIO_ACTIVE_HIGH>;
+   pinctrl-names = "default";
+   pinctrl-0 = <_brcm_reg>;
+   regulator-name = "brcm_reg";
+   regulator-min-microvolt = <330>;
+   regulator-max-microvolt = <330>;
+   startup-delay-us = <20>;
+   };
+
+   reg_bt: regulator-bt {
+   compatible = "regulator-fixed";
+   pinctrl-names = "default";
+   pinctrl-0 = <_bt_reg>;
+   enable-active-high;
+   gpio = < 17 GPIO_ACTIVE_HIGH>;
+   regulator-name = "bt_reg";
+   regulator-min-microvolt = <330>;
+   regulator-max-microvolt = <330>;
+   regulator-always-on;
+   };
+
+   sound {
+   compatible = "simple-audio-card";
+   simple-audio-card,name = "imx7-sgtl5000";
+   simple-audio-card,format = "i2s";
+   simple-audio-card,bitclock-master = <_master>;
+   simple-audio-card,frame-master = <_master>;
+   simple-audio-card,cpu {
+   sound-dai = <>;
+   };
+
+   dailink_master: simple-audio-card,codec {
+   sound-dai = <>;
+   clocks = < IMX7D_AUDIO_MCLK_ROOT_CLK>;
+   };
+   };
+};
+
+ {
+   assigned-clocks = < IMX7D_PLL_AUDIO_POST_DIV>;
+   assigned-clock-rates = <884736000>;
+};
+
+ {
+   pinctrl-names = "default";
+   pinctrl-0 = <_i2c1>;
+   status = "okay";
+
+   pmic: pfuze3000@8 {
+   compatible = "fsl,pfuze3000";
+   reg = <0x08>;
+
+   regulators {
+   sw1a_reg: sw1a {
+   regulator-min-microvolt = <70>;
+   regulator-max-microvolt = <1475000>;
+   regulator-boot-on;
+   regulator-always-on;
+   regulator-ramp-delay = <6250>;
+   };
+
+   /* use sw1c_reg to align with pfuze100/pfuze200 */
+   sw1c_reg: sw1b {
+   regulator-min-microvolt = <70>;
+   regulator-max-microvolt = <1475000>;
+   regulator-boot-on;
+   regulator-always-on;
+   regulator-ramp-delay = <6250>;
+   };
+
+   sw2_reg: sw2 {
+   regulator-min-microvolt = <150>;
+   regulator-max-microvolt = <185>;
+   regulator-boot-on;
+   regulator-always-on;
+   };
+
+   sw3a_reg: sw3 {
+   regulator-min-microvolt = <90>;
+   regulator-max-microvolt = <165>;
+   regulator-boot-on;
+   regulator-always-on;
+   };
+
+   swbst_reg: swbst {
+   regulator-min-microvolt = <500>;
+   regulator-max-microvolt = <515>;
+   };
+
+   snvs_reg: vsnvs {
+   regulator-min-microvolt = <100>;
+   regulator-max-microvolt = <300>;
+   regulator-boot-on;
+

[U-Boot] [PATCH v3 1/8] arm: dts: imx7: Correct spelling mistake in GPIO name

2019-01-09 Thread Bryan O'Donoghue
As pointed out by Lucas WDOD1_WDOG_ANY should be WDOG1_WDOG_ANY. Once
corrected we can import the latest kernel DTS unmodified.

Signed-off-by: Bryan O'Donoghue 
Reported-by: Lukas Auer 
---
 arch/arm/dts/imx7d-pinfunc.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm/dts/imx7d-pinfunc.h b/arch/arm/dts/imx7d-pinfunc.h
index f6f7e78f88..f2493bc63d 100644
--- a/arch/arm/dts/imx7d-pinfunc.h
+++ b/arch/arm/dts/imx7d-pinfunc.h
@@ -17,9 +17,9 @@
 
 #define MX7D_PAD_LPSR_GPIO1_IO00__GPIO1_IO0   0x 
0x0030 0x 0x0 0x0
 #define MX7D_PAD_LPSR_GPIO1_IO00__PWM4_OUT0x 
0x0030 0x 0x1 0x0
-#define MX7D_PAD_LPSR_GPIO1_IO00__WDOD1_WDOG_ANY  0x 
0x0030 0x 0x2 0x0
-#define MX7D_PAD_LPSR_GPIO1_IO00__WDOD1_WDOG_B0x 
0x0030 0x 0x3 0x0
-#define MX7D_PAD_LPSR_GPIO1_IO00__WDOD1_WDOG__RST_B_DEB   0x 
0x0030 0x 0x4 0x0
+#define MX7D_PAD_LPSR_GPIO1_IO00__WDOG1_WDOG_ANY  0x 
0x0030 0x 0x2 0x0
+#define MX7D_PAD_LPSR_GPIO1_IO00__WDOG1_WDOG_B0x 
0x0030 0x 0x3 0x0
+#define MX7D_PAD_LPSR_GPIO1_IO00__WDOG1_WDOG__RST_B_DEB   0x 
0x0030 0x 0x4 0x0
 #define MX7D_PAD_LPSR_GPIO1_IO01__GPIO1_IO1   0x0004 
0x0034 0x 0x0 0x0
 #define MX7D_PAD_LPSR_GPIO1_IO01__PWM1_OUT0x0004 
0x0034 0x 0x1 0x0
 #define MX7D_PAD_LPSR_GPIO1_IO01__CCM_ENET_REF_CLK3   0x0004 
0x0034 0x 0x2 0x0
-- 
2.20.0

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


[U-Boot] [PATCH v3 3/8] arm: imx7s-warp: Add DT file hooks

2019-01-09 Thread Bryan O'Donoghue
This patch adds DT file hooks for imx7s-warp.dtb to the warp7 and
warp7_bl33 builds.

Signed-off-by: Bryan O'Donoghue 
Reviewed-by: Peng Fan 
Cc: Albert Aribaud 
Cc: Peng Fan 
Cc: Fabio Estevam 
Cc: Stefano Babic 
---
 arch/arm/dts/Makefile| 3 ++-
 configs/warp7_bl33_defconfig | 3 ++-
 configs/warp7_defconfig  | 3 ++-
 3 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index dda4e59491..4fe7e90902 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -460,7 +460,8 @@ dtb-$(CONFIG_MX6ULL) += imx6ull-14x14-evk.dtb
 
 dtb-$(CONFIG_MX7) += imx7-colibri.dtb \
imx7d-sdb.dtb \
-   imx7d-sdb-qspi.dtb
+   imx7d-sdb-qspi.dtb \
+   imx7s-warp.dtb
 
 dtb-$(CONFIG_ARCH_MX7ULP) += imx7ulp-evk.dtb
 
diff --git a/configs/warp7_bl33_defconfig b/configs/warp7_bl33_defconfig
index a568c6d10e..12141fedd3 100644
--- a/configs/warp7_bl33_defconfig
+++ b/configs/warp7_bl33_defconfig
@@ -20,6 +20,7 @@ CONFIG_CMD_EXT2=y
 CONFIG_CMD_EXT4=y
 CONFIG_CMD_EXT4_WRITE=y
 CONFIG_CMD_FAT=y
+CONFIG_OF_CONTROL=y
 CONFIG_CMD_FS_GENERIC=y
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_DFU_MMC=y
@@ -37,5 +38,5 @@ CONFIG_USB_GADGET_DOWNLOAD=y
 CONFIG_USB_ETHER=y
 CONFIG_USB_ETH_CDC=y
 CONFIG_USBNET_HOST_ADDR="de:ad:be:af:00:00"
-CONFIG_OF_LIBFDT=y
 CONFIG_OPTEE_TZDRAM_SIZE=0x200
+CONFIG_DEFAULT_DEVICE_TREE="imx7s-warp"
diff --git a/configs/warp7_defconfig b/configs/warp7_defconfig
index 4d443295ba..fee98dfbbe 100644
--- a/configs/warp7_defconfig
+++ b/configs/warp7_defconfig
@@ -29,6 +29,7 @@ CONFIG_CMD_EXT2=y
 CONFIG_CMD_EXT4=y
 CONFIG_CMD_EXT4_WRITE=y
 CONFIG_CMD_FAT=y
+CONFIG_OF_CONTROL=y
 CONFIG_CMD_FS_GENERIC=y
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_DFU_MMC=y
@@ -47,8 +48,8 @@ CONFIG_USB_GADGET_DOWNLOAD=y
 CONFIG_USB_ETHER=y
 CONFIG_USB_ETH_CDC=y
 CONFIG_USBNET_HOST_ADDR="de:ad:be:af:00:00"
-CONFIG_OF_LIBFDT=y
 CONFIG_OPTEE_LOAD_ADDR=0x8400
 CONFIG_OPTEE_TZDRAM_SIZE=0x300
 CONFIG_OPTEE_TZDRAM_BASE=0x9d00
 CONFIG_BOOTM_OPTEE=y
+CONFIG_DEFAULT_DEVICE_TREE="imx7s-warp"
-- 
2.20.0

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


[U-Boot] [PATCH v3 0/8] Convert i.MX7 WaRP7 ports to DM

2019-01-09 Thread Bryan O'Donoghue
V3:
- Fix Lucas' mail address "Auer, Lucas" makes git send-mail choke

V2:
- Add review-by as indicated - Peng Fan
- Squash commit 4 and 5 from v1 - Peng Fan
- Leave usdhc1 intact because of alias of mmc0 to usdhc3 - Bryan
- Add correction for spelling mistake in imx7d-pinfunc.h - Lukas Auer
- Imports imx7s-warp7.dts from kernel unmodified as a result of #1 - Bryan

V1:
This series does a minimal conversion of WaRP7 and the BL33 version of
WaRP7 to the DM.

Pinctrl, GPIO, I2C, Regulators, PMIC and MMC are converted. Later patches
will convert USB and UART.

Bryan O'Donoghue (8):
  arm: dts: imx7: Correct spelling mistake in GPIO name
  arm: dts: imx7s-warp: Import Linux warp7 dts
  arm: imx7s-warp: Add DT file hooks
  arm: imx7s-warp: Convert to DM MMC initialization
  arm: dts: imx7s-warp: Create alias for mmc0 to 
  warp7: defconfig: Switch on IMX7 GPIO/pinctrl for both ports
  warp7: defconfig: Switch to DM for I2C
  arm: imx7s-warp: Convert to DM PMIC

 arch/arm/dts/Makefile|   3 +-
 arch/arm/dts/imx7d-pinfunc.h |   6 +-
 arch/arm/dts/imx7s-warp.dts  | 442 +++
 board/warp7/warp7.c  |  85 +--
 configs/warp7_bl33_defconfig |  14 +-
 configs/warp7_defconfig  |  14 +-
 include/configs/warp7.h  |   8 -
 7 files changed, 484 insertions(+), 88 deletions(-)
 create mode 100644 arch/arm/dts/imx7s-warp.dts

-- 
2.20.0

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


[U-Boot] [PATCH v2 7/8] warp7: defconfig: Switch to DM for I2C

2019-01-09 Thread Bryan O'Donoghue
This commit switches to DM I2C for warp7 and warp7_bl33 defconfigs.

Signed-off-by: Bryan O'Donoghue 
Reviewed-by: Peng Fan 
Cc: Peng Fan 
Cc: Fabio Estevam 
Cc: Stefano Babic 
---
 board/warp7/warp7.c  | 24 
 configs/warp7_bl33_defconfig |  1 +
 configs/warp7_defconfig  |  1 +
 include/configs/warp7.h  |  2 --
 4 files changed, 2 insertions(+), 26 deletions(-)

diff --git a/board/warp7/warp7.c b/board/warp7/warp7.c
index 146d722b15..19f0df4d09 100644
--- a/board/warp7/warp7.c
+++ b/board/warp7/warp7.c
@@ -31,26 +31,6 @@ DECLARE_GLOBAL_DATA_PTR;
 #define UART_PAD_CTRL  (PAD_CTL_DSE_3P3V_49OHM | PAD_CTL_PUS_PU100KOHM | \
PAD_CTL_HYS)
 
-#define I2C_PAD_CTRL   (PAD_CTL_DSE_3P3V_32OHM | PAD_CTL_SRE_SLOW | \
-   PAD_CTL_HYS | PAD_CTL_PUE | PAD_CTL_PUS_PU100KOHM)
-
-#ifdef CONFIG_SYS_I2C_MXC
-#define PC MUX_PAD_CTRL(I2C_PAD_CTRL)
-/* I2C1 for PMIC */
-static struct i2c_pads_info i2c_pad_info1 = {
-   .scl = {
-   .i2c_mode = MX7D_PAD_I2C1_SCL__I2C1_SCL | PC,
-   .gpio_mode = MX7D_PAD_I2C1_SCL__GPIO4_IO8 | PC,
-   .gp = IMX_GPIO_NR(4, 8),
-   },
-   .sda = {
-   .i2c_mode = MX7D_PAD_I2C1_SDA__I2C1_SDA | PC,
-   .gpio_mode = MX7D_PAD_I2C1_SDA__GPIO4_IO9 | PC,
-   .gp = IMX_GPIO_NR(4, 9),
-   },
-};
-#endif
-
 int dram_init(void)
 {
gd->ram_size = PHYS_SDRAM_SIZE;
@@ -130,10 +110,6 @@ int board_init(void)
/* address of boot parameters */
gd->bd->bi_boot_params = PHYS_SDRAM + 0x100;
 
-   #ifdef CONFIG_SYS_I2C_MXC
-   setup_i2c(0, CONFIG_SYS_I2C_SPEED, 0x7f, _pad_info1);
-   #endif
-
return 0;
 }
 
diff --git a/configs/warp7_bl33_defconfig b/configs/warp7_bl33_defconfig
index 7f21bb4f53..2e80011cbc 100644
--- a/configs/warp7_bl33_defconfig
+++ b/configs/warp7_bl33_defconfig
@@ -44,3 +44,4 @@ CONFIG_DEFAULT_DEVICE_TREE="imx7s-warp"
 CONFIG_PINCTRL=y
 CONFIG_PINCTRL_IMX7=y
 CONFIG_DM_GPIO=y
+CONFIG_DM_I2C=y
diff --git a/configs/warp7_defconfig b/configs/warp7_defconfig
index 2d3171e42a..9f7dc73a11 100644
--- a/configs/warp7_defconfig
+++ b/configs/warp7_defconfig
@@ -57,3 +57,4 @@ CONFIG_DEFAULT_DEVICE_TREE="imx7s-warp"
 CONFIG_PINCTRL=y
 CONFIG_PINCTRL_IMX7=y
 CONFIG_DM_GPIO=y
+CONFIG_DM_I2C=y
diff --git a/include/configs/warp7.h b/include/configs/warp7.h
index a391dfb5c1..41eb8d7e1d 100644
--- a/include/configs/warp7.h
+++ b/include/configs/warp7.h
@@ -126,9 +126,7 @@
(CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
 
 /* I2C configs */
-#define CONFIG_SYS_I2C
 #define CONFIG_SYS_I2C_MXC
-#define CONFIG_SYS_I2C_MXC_I2C1
 #define CONFIG_SYS_I2C_SPEED   10
 
 /* PMIC */
-- 
2.20.0

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


[U-Boot] [PATCH v2 6/8] warp7: defconfig: Switch on IMX7 GPIO/pinctrl for both ports

2019-01-09 Thread Bryan O'Donoghue
Switches on the IMX7 pinctrl driver for the warp7 and warp7_bl33 ports,
necessary to convert over to DM for this board.

It is necessary to switch on pinctrl and GPIO in one go.

Signed-off-by: Bryan O'Donoghue 
Cc: Peng Fan 
Cc: Fabio Estevam 
Cc: Stefano Babic 
---
 configs/warp7_bl33_defconfig | 3 +++
 configs/warp7_defconfig  | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/configs/warp7_bl33_defconfig b/configs/warp7_bl33_defconfig
index b2f943c775..7f21bb4f53 100644
--- a/configs/warp7_bl33_defconfig
+++ b/configs/warp7_bl33_defconfig
@@ -41,3 +41,6 @@ CONFIG_USB_ETH_CDC=y
 CONFIG_USBNET_HOST_ADDR="de:ad:be:af:00:00"
 CONFIG_OPTEE_TZDRAM_SIZE=0x200
 CONFIG_DEFAULT_DEVICE_TREE="imx7s-warp"
+CONFIG_PINCTRL=y
+CONFIG_PINCTRL_IMX7=y
+CONFIG_DM_GPIO=y
diff --git a/configs/warp7_defconfig b/configs/warp7_defconfig
index 65d801ffe2..2d3171e42a 100644
--- a/configs/warp7_defconfig
+++ b/configs/warp7_defconfig
@@ -54,3 +54,6 @@ CONFIG_OPTEE_TZDRAM_SIZE=0x300
 CONFIG_OPTEE_TZDRAM_BASE=0x9d00
 CONFIG_BOOTM_OPTEE=y
 CONFIG_DEFAULT_DEVICE_TREE="imx7s-warp"
+CONFIG_PINCTRL=y
+CONFIG_PINCTRL_IMX7=y
+CONFIG_DM_GPIO=y
-- 
2.20.0

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


[U-Boot] [PATCH v2 8/8] arm: imx7s-warp: Convert to DM PMIC

2019-01-09 Thread Bryan O'Donoghue
This patch converts the warp7 and warp7_bl33 board ports over to using the
DM PMIC model.

Signed-off-by: Bryan O'Donoghue 
Reviewed-by: Peng Fan 
Cc: Peng Fan 
Cc: Fabio Estevam 
Cc: Stefano Babic 
---
 board/warp7/warp7.c  | 27 +++
 configs/warp7_bl33_defconfig |  6 ++
 configs/warp7_defconfig  |  6 ++
 include/configs/warp7.h  |  6 --
 4 files changed, 23 insertions(+), 22 deletions(-)

diff --git a/board/warp7/warp7.c b/board/warp7/warp7.c
index 19f0df4d09..6ebeb08e33 100644
--- a/board/warp7/warp7.c
+++ b/board/warp7/warp7.c
@@ -64,29 +64,24 @@ int board_early_init_f(void)
return 0;
 }
 
-#ifdef CONFIG_POWER
-#define I2C_PMIC   0
-static struct pmic *pfuze;
+#ifdef CONFIG_DM_PMIC
 int power_init_board(void)
 {
-   int ret;
-   unsigned int reg, rev_id;
+   struct udevice *dev;
+   int ret, dev_id, rev_id;
 
-   ret = power_pfuze3000_init(I2C_PMIC);
-   if (ret)
+   ret = pmic_get("pfuze3000", );
+   if (ret == -ENODEV)
+   return 0;
+   if (ret != 0)
return ret;
 
-   pfuze = pmic_get("PFUZE3000");
-   ret = pmic_probe(pfuze);
-   if (ret)
-   return ret;
-
-   pmic_reg_read(pfuze, PFUZE3000_DEVICEID, );
-   pmic_reg_read(pfuze, PFUZE3000_REVID, _id);
-   printf("PMIC: PFUZE3000 DEV_ID=0x%x REV_ID=0x%x\n", reg, rev_id);
+   dev_id = pmic_reg_read(dev, PFUZE3000_DEVICEID);
+   rev_id = pmic_reg_read(dev, PFUZE3000_REVID);
+   printf("PMIC: PFUZE3000 DEV_ID=0x%x REV_ID=0x%x\n", dev_id, rev_id);
 
/* disable Low Power Mode during standby mode */
-   pmic_reg_write(pfuze, PFUZE3000_LDOGCTL, 0x1);
+   pmic_clrsetbits(dev, PFUZE3000_LDOGCTL, 0, 1);
 
return 0;
 }
diff --git a/configs/warp7_bl33_defconfig b/configs/warp7_bl33_defconfig
index 2e80011cbc..7b40bfbd6d 100644
--- a/configs/warp7_bl33_defconfig
+++ b/configs/warp7_bl33_defconfig
@@ -45,3 +45,9 @@ CONFIG_PINCTRL=y
 CONFIG_PINCTRL_IMX7=y
 CONFIG_DM_GPIO=y
 CONFIG_DM_I2C=y
+CONFIG_DM_PMIC=y
+CONFIG_DM_PMIC_PFUZE100=y
+CONFIG_DM_REGULATOR=y
+CONFIG_DM_REGULATOR_PFUZE100=y
+CONFIG_DM_REGULATOR_FIXED=y
+CONFIG_DM_REGULATOR_GPIO=y
diff --git a/configs/warp7_defconfig b/configs/warp7_defconfig
index 9f7dc73a11..d1c8e403a7 100644
--- a/configs/warp7_defconfig
+++ b/configs/warp7_defconfig
@@ -58,3 +58,9 @@ CONFIG_PINCTRL=y
 CONFIG_PINCTRL_IMX7=y
 CONFIG_DM_GPIO=y
 CONFIG_DM_I2C=y
+CONFIG_DM_PMIC=y
+CONFIG_DM_PMIC_PFUZE100=y
+CONFIG_DM_REGULATOR=y
+CONFIG_DM_REGULATOR_PFUZE100=y
+CONFIG_DM_REGULATOR_FIXED=y
+CONFIG_DM_REGULATOR_GPIO=y
diff --git a/include/configs/warp7.h b/include/configs/warp7.h
index 41eb8d7e1d..043f2861b6 100644
--- a/include/configs/warp7.h
+++ b/include/configs/warp7.h
@@ -129,12 +129,6 @@
 #define CONFIG_SYS_I2C_MXC
 #define CONFIG_SYS_I2C_SPEED   10
 
-/* PMIC */
-#define CONFIG_POWER
-#define CONFIG_POWER_I2C
-#define CONFIG_POWER_PFUZE3000
-#define CONFIG_POWER_PFUZE3000_I2C_ADDR0x08
-
 /* environment organization */
 #define CONFIG_ENV_SIZESZ_8K
 
-- 
2.20.0

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


[U-Boot] [PATCH v2 4/8] arm: imx7s-warp: Convert to DM MMC initialization

2019-01-09 Thread Bryan O'Donoghue
Converts from fixed initialization of MMC to DM initialization of MMC.

Signed-off-by: Bryan O'Donoghue 
Cc: Albert Aribaud 
Cc: Peng Fan 
Cc: Fabio Estevam 
Cc: Stefano Babic 
---
 board/warp7/warp7.c  | 34 --
 configs/warp7_bl33_defconfig |  1 +
 configs/warp7_defconfig  |  1 +
 3 files changed, 2 insertions(+), 34 deletions(-)

diff --git a/board/warp7/warp7.c b/board/warp7/warp7.c
index 3d32b3eb52..146d722b15 100644
--- a/board/warp7/warp7.c
+++ b/board/warp7/warp7.c
@@ -30,8 +30,6 @@ DECLARE_GLOBAL_DATA_PTR;
 
 #define UART_PAD_CTRL  (PAD_CTL_DSE_3P3V_49OHM | PAD_CTL_PUS_PU100KOHM | \
PAD_CTL_HYS)
-#define USDHC_PAD_CTRL (PAD_CTL_DSE_3P3V_32OHM | PAD_CTL_SRE_SLOW |\
-   PAD_CTL_HYS | PAD_CTL_PUE | PAD_CTL_PUS_PU47KOHM)
 
 #define I2C_PAD_CTRL   (PAD_CTL_DSE_3P3V_32OHM | PAD_CTL_SRE_SLOW | \
PAD_CTL_HYS | PAD_CTL_PUE | PAD_CTL_PUS_PU100KOHM)
@@ -74,43 +72,11 @@ static iomux_v3_cfg_t const uart1_pads[] = {
MX7D_PAD_UART1_RX_DATA__UART1_DCE_RX | MUX_PAD_CTRL(UART_PAD_CTRL),
 };
 
-static iomux_v3_cfg_t const usdhc3_pads[] = {
-   MX7D_PAD_SD3_CLK__SD3_CLK | MUX_PAD_CTRL(USDHC_PAD_CTRL),
-   MX7D_PAD_SD3_CMD__SD3_CMD | MUX_PAD_CTRL(USDHC_PAD_CTRL),
-   MX7D_PAD_SD3_DATA0__SD3_DATA0 | MUX_PAD_CTRL(USDHC_PAD_CTRL),
-   MX7D_PAD_SD3_DATA1__SD3_DATA1 | MUX_PAD_CTRL(USDHC_PAD_CTRL),
-   MX7D_PAD_SD3_DATA2__SD3_DATA2 | MUX_PAD_CTRL(USDHC_PAD_CTRL),
-   MX7D_PAD_SD3_DATA3__SD3_DATA3 | MUX_PAD_CTRL(USDHC_PAD_CTRL),
-   MX7D_PAD_SD3_DATA4__SD3_DATA4 | MUX_PAD_CTRL(USDHC_PAD_CTRL),
-   MX7D_PAD_SD3_DATA5__SD3_DATA5 | MUX_PAD_CTRL(USDHC_PAD_CTRL),
-   MX7D_PAD_SD3_DATA6__SD3_DATA6 | MUX_PAD_CTRL(USDHC_PAD_CTRL),
-   MX7D_PAD_SD3_DATA7__SD3_DATA7 | MUX_PAD_CTRL(USDHC_PAD_CTRL),
-   MX7D_PAD_SD3_RESET_B__SD3_RESET_B | MUX_PAD_CTRL(USDHC_PAD_CTRL),
-};
-
 static void setup_iomux_uart(void)
 {
imx_iomux_v3_setup_multiple_pads(uart1_pads, ARRAY_SIZE(uart1_pads));
 };
 
-static struct fsl_esdhc_cfg usdhc_cfg[1] = {
-   {USDHC3_BASE_ADDR},
-};
-
-int board_mmc_getcd(struct mmc *mmc)
-{
-   /* Assume uSDHC3 emmc is always present */
-   return 1;
-}
-
-int board_mmc_init(bd_t *bis)
-{
-   imx_iomux_v3_setup_multiple_pads(usdhc3_pads, ARRAY_SIZE(usdhc3_pads));
-   usdhc_cfg[0].sdhc_clk = mxc_get_clock(MXC_ESDHC3_CLK);
-
-   return fsl_esdhc_initialize(bis, _cfg[0]);
-}
-
 int board_early_init_f(void)
 {
setup_iomux_uart();
diff --git a/configs/warp7_bl33_defconfig b/configs/warp7_bl33_defconfig
index 12141fedd3..b2f943c775 100644
--- a/configs/warp7_bl33_defconfig
+++ b/configs/warp7_bl33_defconfig
@@ -24,6 +24,7 @@ CONFIG_OF_CONTROL=y
 CONFIG_CMD_FS_GENERIC=y
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_DFU_MMC=y
+CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_HCD=y
diff --git a/configs/warp7_defconfig b/configs/warp7_defconfig
index fee98dfbbe..65d801ffe2 100644
--- a/configs/warp7_defconfig
+++ b/configs/warp7_defconfig
@@ -33,6 +33,7 @@ CONFIG_OF_CONTROL=y
 CONFIG_CMD_FS_GENERIC=y
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_DFU_MMC=y
+CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_OPTEE=y
 CONFIG_USB=y
-- 
2.20.0

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


[U-Boot] [PATCH v2 3/8] arm: imx7s-warp: Add DT file hooks

2019-01-09 Thread Bryan O'Donoghue
This patch adds DT file hooks for imx7s-warp.dtb to the warp7 and
warp7_bl33 builds.

Signed-off-by: Bryan O'Donoghue 
Reviewed-by: Peng Fan 
Cc: Albert Aribaud 
Cc: Peng Fan 
Cc: Fabio Estevam 
Cc: Stefano Babic 
---
 arch/arm/dts/Makefile| 3 ++-
 configs/warp7_bl33_defconfig | 3 ++-
 configs/warp7_defconfig  | 3 ++-
 3 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index dda4e59491..4fe7e90902 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -460,7 +460,8 @@ dtb-$(CONFIG_MX6ULL) += imx6ull-14x14-evk.dtb
 
 dtb-$(CONFIG_MX7) += imx7-colibri.dtb \
imx7d-sdb.dtb \
-   imx7d-sdb-qspi.dtb
+   imx7d-sdb-qspi.dtb \
+   imx7s-warp.dtb
 
 dtb-$(CONFIG_ARCH_MX7ULP) += imx7ulp-evk.dtb
 
diff --git a/configs/warp7_bl33_defconfig b/configs/warp7_bl33_defconfig
index a568c6d10e..12141fedd3 100644
--- a/configs/warp7_bl33_defconfig
+++ b/configs/warp7_bl33_defconfig
@@ -20,6 +20,7 @@ CONFIG_CMD_EXT2=y
 CONFIG_CMD_EXT4=y
 CONFIG_CMD_EXT4_WRITE=y
 CONFIG_CMD_FAT=y
+CONFIG_OF_CONTROL=y
 CONFIG_CMD_FS_GENERIC=y
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_DFU_MMC=y
@@ -37,5 +38,5 @@ CONFIG_USB_GADGET_DOWNLOAD=y
 CONFIG_USB_ETHER=y
 CONFIG_USB_ETH_CDC=y
 CONFIG_USBNET_HOST_ADDR="de:ad:be:af:00:00"
-CONFIG_OF_LIBFDT=y
 CONFIG_OPTEE_TZDRAM_SIZE=0x200
+CONFIG_DEFAULT_DEVICE_TREE="imx7s-warp"
diff --git a/configs/warp7_defconfig b/configs/warp7_defconfig
index 4d443295ba..fee98dfbbe 100644
--- a/configs/warp7_defconfig
+++ b/configs/warp7_defconfig
@@ -29,6 +29,7 @@ CONFIG_CMD_EXT2=y
 CONFIG_CMD_EXT4=y
 CONFIG_CMD_EXT4_WRITE=y
 CONFIG_CMD_FAT=y
+CONFIG_OF_CONTROL=y
 CONFIG_CMD_FS_GENERIC=y
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_DFU_MMC=y
@@ -47,8 +48,8 @@ CONFIG_USB_GADGET_DOWNLOAD=y
 CONFIG_USB_ETHER=y
 CONFIG_USB_ETH_CDC=y
 CONFIG_USBNET_HOST_ADDR="de:ad:be:af:00:00"
-CONFIG_OF_LIBFDT=y
 CONFIG_OPTEE_LOAD_ADDR=0x8400
 CONFIG_OPTEE_TZDRAM_SIZE=0x300
 CONFIG_OPTEE_TZDRAM_BASE=0x9d00
 CONFIG_BOOTM_OPTEE=y
+CONFIG_DEFAULT_DEVICE_TREE="imx7s-warp"
-- 
2.20.0

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


[U-Boot] [PATCH v2 5/8] arm: dts: imx7s-warp: Create alias for mmc0 to

2019-01-09 Thread Bryan O'Donoghue
This patch sets up an alias for mmc0 to usdhc3.

Before the DM conversion only usdhc3 was enabled and therefore it appeared
as MMC 0 to u-boot. After enabling MMC DM though usdhc3 defaults to MMC 2,
which left unattended would drive changes to existing warp7 bootscripts and
environment variables that rely on mmc 0.

Setup the alias of mmc0 and usdhc3 so that existing warp7 boot code will
work unmodified.

Signed-off-by: Bryan O'Donoghue 
Cc: Albert Aribaud 
Cc: Peng Fan 
Cc: Fabio Estevam 
Cc: Stefano Babic 
---
 arch/arm/dts/imx7s-warp.dts | 4 
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/dts/imx7s-warp.dts b/arch/arm/dts/imx7s-warp.dts
index f7ba2c0a24..d28b7ec715 100644
--- a/arch/arm/dts/imx7s-warp.dts
+++ b/arch/arm/dts/imx7s-warp.dts
@@ -17,6 +17,10 @@
reg = <0x8000 0x2000>;
};
 
+   aliases {
+   mmc0 = 
+   };
+
gpio-keys {
compatible = "gpio-keys";
pinctrl-0 = <_gpio>;
-- 
2.20.0

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


[U-Boot] [PATCH v2 2/8] arm: dts: imx7s-warp: Import Linux warp7 dts

2019-01-09 Thread Bryan O'Donoghue
This patch imports the Linux kernel warp7 dts as at upstream kernel commit
cf76c364a1e1.

Signed-off-by: Bryan O'Donoghue 
Cc: Albert Aribaud 
Cc: Peng Fan 
Cc: Fabio Estevam 
Cc: Stefano Babic 
---
 arch/arm/dts/imx7s-warp.dts | 438 
 1 file changed, 438 insertions(+)
 create mode 100644 arch/arm/dts/imx7s-warp.dts

diff --git a/arch/arm/dts/imx7s-warp.dts b/arch/arm/dts/imx7s-warp.dts
new file mode 100644
index 00..f7ba2c0a24
--- /dev/null
+++ b/arch/arm/dts/imx7s-warp.dts
@@ -0,0 +1,438 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (C) 2016 NXP Semiconductors.
+ * Author: Fabio Estevam 
+ */
+
+/dts-v1/;
+
+#include 
+#include "imx7s.dtsi"
+
+/ {
+   model = "Warp i.MX7 Board";
+   compatible = "warp,imx7s-warp", "fsl,imx7s";
+
+   memory@8000 {
+   reg = <0x8000 0x2000>;
+   };
+
+   gpio-keys {
+   compatible = "gpio-keys";
+   pinctrl-0 = <_gpio>;
+   autorepeat;
+
+   back {
+   label = "Back";
+   gpios = < 1 GPIO_ACTIVE_HIGH>;
+   linux,code = ;
+   wakeup-source;
+   };
+   };
+
+   reg_brcm: regulator-brcm {
+   compatible = "regulator-fixed";
+   enable-active-high;
+   gpio = < 10 GPIO_ACTIVE_HIGH>;
+   pinctrl-names = "default";
+   pinctrl-0 = <_brcm_reg>;
+   regulator-name = "brcm_reg";
+   regulator-min-microvolt = <330>;
+   regulator-max-microvolt = <330>;
+   startup-delay-us = <20>;
+   };
+
+   reg_bt: regulator-bt {
+   compatible = "regulator-fixed";
+   pinctrl-names = "default";
+   pinctrl-0 = <_bt_reg>;
+   enable-active-high;
+   gpio = < 17 GPIO_ACTIVE_HIGH>;
+   regulator-name = "bt_reg";
+   regulator-min-microvolt = <330>;
+   regulator-max-microvolt = <330>;
+   regulator-always-on;
+   };
+
+   sound {
+   compatible = "simple-audio-card";
+   simple-audio-card,name = "imx7-sgtl5000";
+   simple-audio-card,format = "i2s";
+   simple-audio-card,bitclock-master = <_master>;
+   simple-audio-card,frame-master = <_master>;
+   simple-audio-card,cpu {
+   sound-dai = <>;
+   };
+
+   dailink_master: simple-audio-card,codec {
+   sound-dai = <>;
+   clocks = < IMX7D_AUDIO_MCLK_ROOT_CLK>;
+   };
+   };
+};
+
+ {
+   assigned-clocks = < IMX7D_PLL_AUDIO_POST_DIV>;
+   assigned-clock-rates = <884736000>;
+};
+
+ {
+   pinctrl-names = "default";
+   pinctrl-0 = <_i2c1>;
+   status = "okay";
+
+   pmic: pfuze3000@8 {
+   compatible = "fsl,pfuze3000";
+   reg = <0x08>;
+
+   regulators {
+   sw1a_reg: sw1a {
+   regulator-min-microvolt = <70>;
+   regulator-max-microvolt = <1475000>;
+   regulator-boot-on;
+   regulator-always-on;
+   regulator-ramp-delay = <6250>;
+   };
+
+   /* use sw1c_reg to align with pfuze100/pfuze200 */
+   sw1c_reg: sw1b {
+   regulator-min-microvolt = <70>;
+   regulator-max-microvolt = <1475000>;
+   regulator-boot-on;
+   regulator-always-on;
+   regulator-ramp-delay = <6250>;
+   };
+
+   sw2_reg: sw2 {
+   regulator-min-microvolt = <150>;
+   regulator-max-microvolt = <185>;
+   regulator-boot-on;
+   regulator-always-on;
+   };
+
+   sw3a_reg: sw3 {
+   regulator-min-microvolt = <90>;
+   regulator-max-microvolt = <165>;
+   regulator-boot-on;
+   regulator-always-on;
+   };
+
+   swbst_reg: swbst {
+   regulator-min-microvolt = <500>;
+   regulator-max-microvolt = <515>;
+   };
+
+   snvs_reg: vsnvs {
+   regulator-min-microvolt = <100>;
+   regulator-max-microvolt = <300>;
+   regulator-boot-on;
+

[U-Boot] [PATCH v2 1/8] arm: dts: imx7: Correct spelling mistake in GPIO name

2019-01-09 Thread Bryan O'Donoghue
As pointed out by Lucas WDOD1_WDOG_ANY should be WDOG1_WDOG_ANY. Once
corrected we can import the latest kernel DTS unmodified.

Signed-off-by: Bryan O'Donoghue 
Reported-by: Auer Lukas 
---
 arch/arm/dts/imx7d-pinfunc.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm/dts/imx7d-pinfunc.h b/arch/arm/dts/imx7d-pinfunc.h
index f6f7e78f88..f2493bc63d 100644
--- a/arch/arm/dts/imx7d-pinfunc.h
+++ b/arch/arm/dts/imx7d-pinfunc.h
@@ -17,9 +17,9 @@
 
 #define MX7D_PAD_LPSR_GPIO1_IO00__GPIO1_IO0   0x 
0x0030 0x 0x0 0x0
 #define MX7D_PAD_LPSR_GPIO1_IO00__PWM4_OUT0x 
0x0030 0x 0x1 0x0
-#define MX7D_PAD_LPSR_GPIO1_IO00__WDOD1_WDOG_ANY  0x 
0x0030 0x 0x2 0x0
-#define MX7D_PAD_LPSR_GPIO1_IO00__WDOD1_WDOG_B0x 
0x0030 0x 0x3 0x0
-#define MX7D_PAD_LPSR_GPIO1_IO00__WDOD1_WDOG__RST_B_DEB   0x 
0x0030 0x 0x4 0x0
+#define MX7D_PAD_LPSR_GPIO1_IO00__WDOG1_WDOG_ANY  0x 
0x0030 0x 0x2 0x0
+#define MX7D_PAD_LPSR_GPIO1_IO00__WDOG1_WDOG_B0x 
0x0030 0x 0x3 0x0
+#define MX7D_PAD_LPSR_GPIO1_IO00__WDOG1_WDOG__RST_B_DEB   0x 
0x0030 0x 0x4 0x0
 #define MX7D_PAD_LPSR_GPIO1_IO01__GPIO1_IO1   0x0004 
0x0034 0x 0x0 0x0
 #define MX7D_PAD_LPSR_GPIO1_IO01__PWM1_OUT0x0004 
0x0034 0x 0x1 0x0
 #define MX7D_PAD_LPSR_GPIO1_IO01__CCM_ENET_REF_CLK3   0x0004 
0x0034 0x 0x2 0x0
-- 
2.20.0

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


  1   2   >