Re: [U-Boot] [UBOOT] [PATCH] cmd: usb: ignore block devices under mass storage device

2017-09-01 Thread Suneel Garapati
Hi Simon,

On Thu, Aug 31, 2017 at 5:52 AM, Simon Glass  wrote:
> Hi Suneel,
>
> On 15 August 2017 at 11:06, Suneel Garapati  wrote:
>> Hi Simon,
>>
>>
>> On Sun, Aug 13, 2017 at 2:37 PM, Simon Glass  wrote:
>>> Hi Suneel,
>>>
>>> On 10 August 2017 at 23:53, Suneel Garapati  wrote:
 usb tree and info commands may cause crash otherwise

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

>>>
>>> Thank you for the patch - it certainly looks like a bug. Can you
>>> please expand the commit message a little? E.g. you have
>>> UCLASS_USB_EMUL below.
>>
>> I will change the description
>>
>>>
 diff --git a/cmd/usb.c b/cmd/usb.c
 index 992d414..81e1a7b 100644
 --- a/cmd/usb.c
 +++ b/cmd/usb.c
 @@ -415,7 +415,8 @@ static void usb_show_tree_graph(struct usb_device 
 *dev, char *pre)
 udev = dev_get_parent_priv(child);

 /* Ignore emulators, we only want real devices */
 -   if (device_get_uclass_id(child) != UCLASS_USB_EMUL) {
 +   if (device_get_uclass_id(child) !=
 +   (UCLASS_USB_EMUL | UCLASS_BLK)) {
>>>
>>> This seems odd to me. Do you mean to check that the child uclass is
>>> neither USB_EMUL nor BLK?
>>>
>>> Would it be possible to check that the parent is UCLASS_USB? That
>>> seems like a better condition to determine whether the child has USB
>>> parent data.
>>
>> It is possible to check parent uclass but would that ever fail?
>
> How would it fail? The only device that does not have a parent is the
> root device, and we know it cannot be that since it will be
> UCLASS_ROOT.
>
>> I assume, block device under usb storage device will always have
>> parent as usb class.
>
> Yes that sounds right.
>
>> Also, tree is called on only usb class devices. Maybe I am missing something.
>
> Maybe, but I think it is more robust to check for the thing you want
> than the things you don't. If someone adds a new thing that can be a
> child then this code will need updating.
I will add a check on parent uclass for USB in v1.

Regards,
Suneel

>
>>
>> Regards,
>> Suneel
>>
>>>
 usb_show_tree_graph(udev, pre);
 pre[index] = 0;
 }
 @@ -605,7 +606,8 @@ static void usb_show_info(struct usb_device *udev)
 for (device_find_first_child(udev->dev, &child);
  child;
  device_find_next_child(&child)) {
 -   if (device_active(child)) {
 +   if (device_active(child) &&
 +   (device_get_uclass_id(child) != UCLASS_BLK)) {
 udev = dev_get_parent_priv(child);
 usb_show_info(udev);
 }
 --
 2.7.4

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


Re: [U-Boot] [UBOOT] [PATCH] cmd: usb: ignore block devices under mass storage device

2017-09-01 Thread Suneel Garapati
Hi,

On Thu, Aug 31, 2017 at 11:30 PM, Lothar Waßmann  
wrote:
> Hi,
>
> On Thu, 10 Aug 2017 22:53:31 -0700 Suneel Garapati wrote:
>> usb tree and info commands may cause crash otherwise
>>
>> Signed-off-by: Suneel Garapati 
>> ---
>>  cmd/usb.c | 6 --
>>  1 file changed, 4 insertions(+), 2 deletions(-)
>>
>> diff --git a/cmd/usb.c b/cmd/usb.c
>> index 992d414..81e1a7b 100644
>> --- a/cmd/usb.c
>> +++ b/cmd/usb.c
>> @@ -415,7 +415,8 @@ static void usb_show_tree_graph(struct usb_device *dev, 
>> char *pre)
>>   udev = dev_get_parent_priv(child);
>>
>>   /* Ignore emulators, we only want real devices */
>> - if (device_get_uclass_id(child) != UCLASS_USB_EMUL) {
>> + if (device_get_uclass_id(child) !=
>> + (UCLASS_USB_EMUL | UCLASS_BLK)) {
>>
> This should most probably be:
>> + if ((device_get_uclass_id(child) != UCLASS_USB_EMUL) &&
> (device_get_uclass_id(child) != UCLASS_BLK)) {
Agree. Will make change in v1.

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


Re: [U-Boot] [U-BOOT][PATCH] drivers: ahci: write upper 32 bits for clb and fis registers

2017-09-01 Thread Suneel Garapati
Hi,

I need to send v1 with LOWER32 and UPPER32 macro definitions, so bad
to miss them.

Regards,
Suneel

On Thu, Aug 24, 2017 at 12:54 AM, Bin Meng  wrote:
> On Thu, Aug 24, 2017 at 2:02 PM, Suneel Garapati  
> wrote:
>> If 64-bit capability is supported, commandlistbase and fis base
>> should be split as lower32 and upper32. upper32 should be
>> written to PORT_(LST/FIS)_ADDR_HI.
>>
>> Signed-off-by: Suneel Garapati 
>> ---
>>  drivers/ata/ahci.c | 11 +--
>>  include/ahci.h |  1 +
>>  2 files changed, 10 insertions(+), 2 deletions(-)
>>
>
> Reviewed-by: Bin Meng 
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH] misc: Kconfig: Add SPL_I2C_EEPROM option

2017-09-01 Thread Yang, Wenyou

Hi,

Do you have any comments?


On 2017/8/3 9:00, Wenyou Yang wrote:

This option is an SPL-variant of the I2C_EEPROM option to enable
the driver for generic I2C-attached EEPROMs for SPL.

Signed-off-by: Wenyou Yang 
---

  drivers/misc/Kconfig  | 8 
  drivers/misc/Makefile | 2 +-
  2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig
index d1ddbbe157..e441031d04 100644
--- a/drivers/misc/Kconfig
+++ b/drivers/misc/Kconfig
@@ -196,4 +196,12 @@ config I2C_EEPROM
depends on MISC
help
  Enable a generic driver for EEPROMs attached via I2C.
+
+config SPL_I2C_EEPROM
+   bool "Enable driver for generic I2C-attached EEPROMs for SPL"
+   depends on MISC && SPL && SPL_DM
+   help
+ This option is an SPL-variant of the I2C_EEPROM option.
+ See the help of I2C_EEPROM for details.
+
  endmenu
diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile
index 10265c8fb4..21f7e6c6f5 100644
--- a/drivers/misc/Makefile
+++ b/drivers/misc/Makefile
@@ -20,7 +20,7 @@ obj-$(CONFIG_CROS_EC_SPI) += cros_ec_spi.o
  endif
  obj-$(CONFIG_FSL_IIM) += fsl_iim.o
  obj-$(CONFIG_LED_STATUS_GPIO) += gpio_led.o
-obj-$(CONFIG_I2C_EEPROM) += i2c_eeprom.o
+obj-$(CONFIG_$(SPL_)I2C_EEPROM) += i2c_eeprom.o
  obj-$(CONFIG_FSL_MC9SDZ60) += mc9sdz60.o
  obj-$(CONFIG_MXC_OCOTP) += mxc_ocotp.o
  obj-$(CONFIG_MXS_OCOTP) += mxs_ocotp.o


Best Regards,
Wenyou Yang

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


Re: [U-Boot] [PATCH 0/2] misc: i2c_eeprom: Add compatibles

2017-09-01 Thread Yang, Wenyou

Hi,

Can be accepted?


On 2017/7/31 11:25, Wenyou Yang wrote:

Add the compatibles to support the I2C EEPROM 24AA02E48 and AT24MAC402
respectively.
  - microchip,24aa02e48
  - atmel,24mac402


Wenyou Yang (2):
   misc: i2c_eeprom: Add compatible for 24AA02E48
   misc: i2c_eeprom: Add compatible for AT24MAC402

  drivers/misc/i2c_eeprom.c | 2 ++
  1 file changed, 2 insertions(+)


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


Re: [U-Boot] [PATCH 0/7] board: atmel: Convert to support DM_VIDEO

2017-09-01 Thread Yang, Wenyou

Hi

On 2017/7/31 14:02, Wenyou Yang wrote:

Add a common code to display the company's logo and board information
by using the API from DM_VIDEO under the board/$(VENDOR)/common
folder, and the logo files can be used by the API from DM_VIDEO, and
then convert the board to enable the driver model support for
LCD/video.

It is based on the patch series:
[PATCH v2 0/3] board: atmel: Set the ethernet mac address from eeprom
https://lists.denx.de/pipermail/u-boot/2017-July/300527.html

Do you have any comments on this patch set?

Best Regards,
Wenyou Yang



Wenyou Yang (7):
   lib: at91: Add logo files used by API from DM_VIDEO
   atmel: common: Add function to display via DM_VIDEO's API
   board: sama5d2_xplained: Convert to support DM_VIDEO
   board: sama5d3xek: Convert to support DM_VIDEO
   board: sama5d4ek: Convert to support DM_VIDEO
   board: sama5d4_xplained: Convert to support DM_VIDEO
   board: at91sam9x5ek: Convert to support DM_VIDEO

  arch/arm/dts/at91-sama5d2_xplained.dts  |   60 ++
  arch/arm/dts/at91-sama5d4_xplained.dts  |   25 +
  arch/arm/dts/at91-sama5d4ek.dts |   26 +
  arch/arm/dts/sama5d2.dtsi   |7 +
  arch/arm/dts/sama5d36ek_cmp.dts |1 +
  arch/arm/dts/sama5d3_lcd.dtsi   |   21 +-
  arch/arm/dts/sama5d3xdm.dtsi|   26 +
  arch/arm/dts/sama5d4.dtsi   |   21 +-
  arch/arm/mach-at91/Kconfig  |4 +
  arch/arm/mach-at91/include/mach/at91_common.h   |1 +
  board/atmel/at91sam9x5ek/at91sam9x5ek.c |  111 +-
  board/atmel/common/Makefile |1 +
  board/atmel/common/video_display.c  |   72 ++
  board/atmel/sama5d2_xplained/sama5d2_xplained.c |   95 +-
  board/atmel/sama5d3xek/sama5d3xek.c |   93 +-
  board/atmel/sama5d4_xplained/sama5d4_xplained.c |  102 +-
  board/atmel/sama5d4ek/sama5d4ek.c   |   97 +-
  configs/at91sam9x5ek_dataflash_defconfig|3 +-
  configs/at91sam9x5ek_mmc_defconfig  |3 +-
  configs/at91sam9x5ek_nandflash_defconfig|3 +-
  configs/at91sam9x5ek_spiflash_defconfig |3 +-
  configs/sama5d2_xplained_mmc_defconfig  |2 +
  configs/sama5d2_xplained_spiflash_defconfig |2 +
  configs/sama5d36ek_cmp_mmc_defconfig|3 +-
  configs/sama5d36ek_cmp_nandflash_defconfig  |3 +-
  configs/sama5d36ek_cmp_spiflash_defconfig   |3 +-
  configs/sama5d3xek_mmc_defconfig|3 +-
  configs/sama5d3xek_nandflash_defconfig  |3 +-
  configs/sama5d3xek_spiflash_defconfig   |3 +-
  configs/sama5d4_xplained_mmc_defconfig  |2 +
  configs/sama5d4_xplained_nandflash_defconfig|2 +
  configs/sama5d4_xplained_spiflash_defconfig |2 +
  configs/sama5d4ek_mmc_defconfig |3 +-
  configs/sama5d4ek_nandflash_defconfig   |3 +-
  configs/sama5d4ek_spiflash_defconfig|3 +-
  include/atmel_lcd.h |9 +
  include/configs/at91sam9x5ek.h  |   10 -
  include/configs/sama5d2_xplained.h  |   12 -
  include/configs/sama5d3xek.h|   12 -
  include/configs/sama5d4_xplained.h  |   11 -
  include/configs/sama5d4ek.h |9 -
  lib/Makefile|1 +
  lib/at91/Makefile   |8 +
  lib/at91/at91.c |   30 +
  lib/at91/atmel_logo_8bpp.h  | 1310 +++
  lib/at91/microchip_logo_8bpp.h  | 1082 +++
  tools/logos/microchip.bmp   |  Bin 0 -> 12726 bytes
  47 files changed, 2729 insertions(+), 577 deletions(-)
  create mode 100644 board/atmel/common/video_display.c
  create mode 100644 lib/at91/Makefile
  create mode 100644 lib/at91/at91.c
  create mode 100644 lib/at91/atmel_logo_8bpp.h
  create mode 100644 lib/at91/microchip_logo_8bpp.h
  create mode 100644 tools/logos/microchip.bmp



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


Re: [U-Boot] [PATCH 03/23] efi_loader: support 16 protocols per efi_object

2017-09-01 Thread Alexander Graf



On 01.09.17 03:45, Heinrich Schuchardt wrote:

On 08/31/2017 04:01 PM, Alexander Graf wrote:

On 08/27/2017 12:51 AM, Heinrich Schuchardt wrote:

8 protocols per efi_object is insufficient for iPXE.

Signed-off-by: Heinrich Schuchardt 
---
   include/efi_loader.h | 4 ++--
   1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/efi_loader.h b/include/efi_loader.h
index 6f71a6202b..e8fb4fbb0a 100644
--- a/include/efi_loader.h
+++ b/include/efi_loader.h
@@ -99,8 +99,8 @@ struct efi_handler {
   struct efi_object {
   /* Every UEFI object is part of a global object list */
   struct list_head link;
-/* We support up to 8 "protocols" an object can be accessed
through */
-struct efi_handler protocols[8];
+/* We support up to 16 "protocols" an object can be accessed
through */
+struct efi_handler protocols[16];


Can you try to convert it into a list instead? Leif tried to make the
UEFI Shell work and stumbled over the same limitation, so I guess a
static array won't cut it for long.


Alex




Hello Alex,

is it safe to call malloc and free before efi_exit_boot_services?


Yes :). Before exiting boot services we're basically in normal U-Boot 
space with a U-Boot owned malloc region that we can allocate from.



Currently we do not check that boottime services are not called after
efi_exit_boot_services. Shouldn't every call to boottime services fail


Yes, IIUC it's simply illegal to call them afterwards.


thereafter? The spec says: "After successfully calling
ExitBootServices(), all boot services in the system are terminated."


I'm not sure. I'd be very surprised to see a payload actually call any 
boot service after exiting boot services. Runtime services is a 
different question, but those are very special anyway.



We definitively do not want to call malloc at runtime because all
available memory (except for EFI_MEMORY_RUNTIME) is managed by the
operating system.


Yes, but efi objects only exist during boot time. Runtime services don't 
expose protocols or objects.



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


Re: [U-Boot] [PATCH 1/1] usb: gadget: g_dnl: Use serial# variable to set g_dnl_serial

2017-09-01 Thread Marek Vasut
On 08/31/2017 08:20 PM, Sam Protsenko wrote:
> Since 842778a09104 commit, "fastboot devices" stopped to show correct
> device serial number for TI boards, showing this line instead:
> 
>   fastboot
> 
> This is because serial# env variable could be set after g_dnl gadget was
> initialized (e.g. by using env_set() in the board file).
> 
> To fix this, before checking g_dnl_serial, let's re-check if we have
> valid serial# value. And if so, let's set it as g_dnl_serial value.
> 
> Signed-off-by: Sam Protsenko 

Can't we use U_BOOT_ENV_CALLBACK() here instead and set the serial
number when the environment variable is set ?

> ---
>  drivers/usb/gadget/g_dnl.c | 9 +
>  1 file changed, 9 insertions(+)
> 
> diff --git a/drivers/usb/gadget/g_dnl.c b/drivers/usb/gadget/g_dnl.c
> index 0491a0eea9..e4d0289757 100644
> --- a/drivers/usb/gadget/g_dnl.c
> +++ b/drivers/usb/gadget/g_dnl.c
> @@ -226,6 +226,15 @@ static int g_dnl_bind(struct usb_composite_dev *cdev)
>  
>   g_dnl_bind_fixup(&device_desc, cdev->driver->name);
>  
> + /* First try to obtain serial number from serial# variable */
> + if (strlen(g_dnl_serial) == 0) {
> + const char *s;
> +
> + s = env_get("serial#");
> + if (s)
> + g_dnl_set_serialnumber((char *)s);
> + }
> +
>   if (strlen(g_dnl_serial)) {
>   id = usb_string_id(cdev);
>   if (id < 0)
> 


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


[U-Boot] [PATCH 1/2] armv8: layerscape: Allocate 66 MB DDR for secure memory

2017-09-01 Thread Sumit Garg
Change DDR allocated for secure memory from 2 MB to 66 MB. This additional
64 MB secure memory is required for trusted OS running in Trusted Execution
Environment using ARMv8 TrustZone.

Signed-off-by: Sumit Garg 
---
 arch/arm/include/asm/arch-fsl-layerscape/config.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/include/asm/arch-fsl-layerscape/config.h 
b/arch/arm/include/asm/arch-fsl-layerscape/config.h
index a7098be..95e2791 100644
--- a/arch/arm/include/asm/arch-fsl-layerscape/config.h
+++ b/arch/arm/include/asm/arch-fsl-layerscape/config.h
@@ -16,7 +16,7 @@
  * Reserve secure memory
  * To be aligned with MMU block size
  */
-#define CONFIG_SYS_MEM_RESERVE_SECURE  (2048 * 1024)   /* 2MB */
+#define CONFIG_SYS_MEM_RESERVE_SECURE  (66 * 1024 * 1024)  /* 66MB */
 #define SPL_TLB_SETBACK0x100   /* 16MB under effective memory 
top */
 
 #ifdef CONFIG_ARCH_LS2080A
-- 
2.7.4

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


[U-Boot] [PATCH 2/2] armv8: sec_firmware: Add support for loadables in FIT

2017-09-01 Thread Sumit Garg
Enable support for loadables in SEC firmware FIT image. Currently support
is added for single loadable image.

Brief description of implementation:
- Add two more address pointers (loadable_h, loadable_l) as arguments to
  sec_firmware_init() api.
- Create new api: sec_firmware_checks_copy_loadable() to check if loadables
  node is present in SEC firmware FIT image. If present, verify loadable
  image and copies it to secure DDR memory.
- Populate address pointers with secure DDR memory addresses where loadable
  is copied.

Example use-case could be trusted OS (tee.bin) as loadables node in SEC
firmware FIT image.

Signed-off-by: Sumit Garg 
---
 arch/arm/cpu/armv8/fsl-layerscape/ppa.c   | 16 +-
 arch/arm/cpu/armv8/sec_firmware.c | 92 +--
 arch/arm/include/asm/armv8/sec_firmware.h |  4 +-
 3 files changed, 104 insertions(+), 8 deletions(-)

diff --git a/arch/arm/cpu/armv8/fsl-layerscape/ppa.c 
b/arch/arm/cpu/armv8/fsl-layerscape/ppa.c
index 35c612d..87a0885 100644
--- a/arch/arm/cpu/armv8/fsl-layerscape/ppa.c
+++ b/arch/arm/cpu/armv8/fsl-layerscape/ppa.c
@@ -35,6 +35,7 @@ int ppa_init(void)
unsigned int el = current_el();
void *ppa_fit_addr;
u32 *boot_loc_ptr_l, *boot_loc_ptr_h;
+   u32 *loadable_l, *loadable_h;
int ret;
 
 #ifdef CONFIG_CHAIN_OF_TRUST
@@ -252,9 +253,9 @@ int ppa_init(void)
   PPA_KEY_HASH,
   &ppa_img_addr);
if (ret != 0)
-   printf("PPA validation failed\n");
+   printf("SEC firmware(s) validation failed\n");
else
-   printf("PPA validation Successful\n");
+   printf("SEC firmware(s) validation Successful\n");
}
 #if defined(CONFIG_SYS_LS_PPA_FW_IN_MMC) || \
defined(CONFIG_SYS_LS_PPA_FW_IN_NAND)
@@ -266,15 +267,24 @@ int ppa_init(void)
struct ccsr_gur __iomem *gur = (void *)(CONFIG_SYS_FSL_GUTS_ADDR);
boot_loc_ptr_l = &gur->bootlocptrl;
boot_loc_ptr_h = &gur->bootlocptrh;
+
+   /* Assign addresses to loadable ptrs */
+   loadable_l = &gur->scratchrw[4];
+   loadable_h = &gur->scratchrw[5];
 #elif defined(CONFIG_FSL_LSCH2)
struct ccsr_scfg __iomem *scfg = (void *)(CONFIG_SYS_FSL_SCFG_ADDR);
boot_loc_ptr_l = &scfg->scratchrw[1];
boot_loc_ptr_h = &scfg->scratchrw[0];
+
+   /* Assign addresses to loadable ptrs */
+   loadable_l = &scfg->scratchrw[2];
+   loadable_h = &scfg->scratchrw[3];
 #endif
 
debug("fsl-ppa: boot_loc_ptr_l = 0x%p, boot_loc_ptr_h =0x%p\n",
  boot_loc_ptr_l, boot_loc_ptr_h);
-   ret = sec_firmware_init(ppa_fit_addr, boot_loc_ptr_l, boot_loc_ptr_h);
+   ret = sec_firmware_init(ppa_fit_addr, boot_loc_ptr_l, boot_loc_ptr_h,
+   loadable_l, loadable_h);
 
 #if defined(CONFIG_SYS_LS_PPA_FW_IN_MMC) || \
defined(CONFIG_SYS_LS_PPA_FW_IN_NAND)
diff --git a/arch/arm/cpu/armv8/sec_firmware.c 
b/arch/arm/cpu/armv8/sec_firmware.c
index 0e74834..927eae4 100644
--- a/arch/arm/cpu/armv8/sec_firmware.c
+++ b/arch/arm/cpu/armv8/sec_firmware.c
@@ -105,6 +105,74 @@ static int sec_firmware_parse_image(const void 
*sec_firmware_img,
return 0;
 }
 
+/*
+ * SEC Firmware FIT image parser to check if any loadable is
+ * present. If present, verify integrity of the loadable and
+ * copy loadable to address provided in (loadable_h, loadable_l).
+ *
+ * Returns 0 on success and a negative errno on error task fail.
+ */
+static int sec_firmware_check_copy_loadable(const void *sec_firmware_img,
+   u32 *loadable_l, u32 *loadable_h)
+{
+   phys_addr_t sec_firmware_loadable_addr = 0;
+   int conf_node_off, ld_node_off;
+   char *conf_node_name = NULL;
+   const void *data;
+   size_t size;
+   ulong load;
+
+   conf_node_name = SEC_FIRMEWARE_FIT_CNF_NAME;
+
+   conf_node_off = fit_conf_get_node(sec_firmware_img, conf_node_name);
+   if (conf_node_off < 0) {
+   printf("SEC Firmware: %s: no such config\n", conf_node_name);
+   return -ENOENT;
+   }
+
+   ld_node_off = fit_conf_get_prop_node(sec_firmware_img, conf_node_off,
+FIT_LOADABLE_PROP);
+   if (ld_node_off >= 0) {
+   printf("SEC Firmware: '%s' present in config\n",
+  FIT_LOADABLE_PROP);
+
+   /* Verify secure firmware image */
+   if (!(fit_image_verify(sec_firmware_img, ld_node_off))) {
+   printf("SEC Loadable: Bad loadable image (bad CRC)\n");
+   return -EINVAL;
+   }
+
+   if (fit_image_get_data(sec_firmware_img, ld_node_off,
+  &data, &size)) {
+   printf("SEC Loadable: Can't get subimage data/size");

[U-Boot] [PATCH v4 0/3] board: atmel: Set the ethernet mac address from eeprom

2017-09-01 Thread Wenyou Yang
Create board/$(VENDOR)/common folder to accommodate the common code
for the boards from atmel. Now put the code to set the ethernet mac
address here, using the function to set the ethernet mac address
on sama5d2 and sama5d4 Xplained boards.

Changes in v4:
 - Follow up the env function renaming.
 - Rebase the latest commit(8b3cec7da) on uboot/master.

Changes in v3:
 - remove CONFIG_SPL_I2C_SUPPORT=y from the default configuration files.
 - rebase on [PATCH] misc: Makefile: Add condition on build i2c_eeprom.
https://lists.denx.de/pipermail/u-boot/2017-August/300783.html

Changes in v2:
 - Add a new patch to create board/$(VENDOR)/common folder to
   accommodate the common code and put the code to set the ethernet
   mac address from eeprom here.
 - Use the i2c_eeprom driver to read the mac address, instead of
   the dm i2c API directly.

Wenyou Yang (3):
  board: atmel: Create board/$(VENDOR)/common folder
  board: sama5d2_xplained: Replace code to set mac address
  board: sama5d4_xplained: Set mac address from eeprom

 arch/arm/dts/at91-sama5d2_xplained.dts  |  5 +++
 arch/arm/dts/at91-sama5d4_xplained.dts  |  5 +++
 arch/arm/mach-at91/include/mach/at91_common.h   |  2 ++
 board/atmel/common/Makefile | 11 ++
 board/atmel/common/board.c  | 12 +++
 board/atmel/common/mac_eeprom.c | 36 +++
 board/atmel/sama5d2_xplained/sama5d2_xplained.c | 46 +++--
 board/atmel/sama5d4_xplained/sama5d4_xplained.c | 12 +++
 configs/sama5d2_xplained_mmc_defconfig  |  1 +
 configs/sama5d2_xplained_spiflash_defconfig |  1 +
 configs/sama5d4_xplained_mmc_defconfig  |  3 ++
 configs/sama5d4_xplained_nandflash_defconfig|  3 ++
 configs/sama5d4_xplained_spiflash_defconfig |  3 ++
 include/configs/sama5d2_xplained.h  |  4 ---
 include/configs/sama5d4_xplained.h  |  2 ++
 15 files changed, 100 insertions(+), 46 deletions(-)
 create mode 100644 board/atmel/common/Makefile
 create mode 100644 board/atmel/common/board.c
 create mode 100644 board/atmel/common/mac_eeprom.c

-- 
2.13.0

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


Re: [U-Boot] [PATCH] arm64: ls1043ardb: Add distro secure boot support

2017-09-01 Thread Sumit Garg
> -Original Message-
> From: York Sun
> Sent: Friday, September 01, 2017 4:38 AM
> To: Sumit Garg ; u-boot@lists.denx.de
> Cc: Ruchika Gupta ; Prabhakar Kushwaha
> ; Mingkai Hu ;
> Shengzhou Liu 
> Subject: Re: [PATCH] arm64: ls1043ardb: Add distro secure boot support
> 
> On 06/04/2017 11:54 PM, Sumit Garg wrote:
> > Enable validation of boot.scr script prior to its execution dependent
> > on "secureboot" flag in environment. Disable fall back option to
> > nor/qspi boot in case of secure boot. Also enable "secureboot=y"
> > flag in environment for ARM based platforms instead of bootcmd.
> >
> > Signed-off-by: Sumit Garg 
> > Tested-by: Vinitha Pillai 
> > ---
> >   board/freescale/common/fsl_chain_of_trust.c |  6 ++
> >   configs/ls1043ardb_SECURE_BOOT_defconfig|  1 +
> >   configs/ls1043ardb_sdcard_SECURE_BOOT_defconfig |  1 +
> >   include/configs/ls1043a_common.h| 23 
> > +-
> -
> >   4 files changed, 29 insertions(+), 2 deletions(-)
> >
> > diff --git a/board/freescale/common/fsl_chain_of_trust.c
> > b/board/freescale/common/fsl_chain_of_trust.c
> > index 438e781..609e2b2 100644
> > --- a/board/freescale/common/fsl_chain_of_trust.c
> > +++ b/board/freescale/common/fsl_chain_of_trust.c
> > @@ -80,7 +80,13 @@ int fsl_setenv_chain_of_trust(void)
> >  * bootcmd = CONFIG_CHAIN_BOOT_CMD (Validate and execute Boot
> script)
> >  */
> > setenv("bootdelay", "0");
> > +
> > +#ifdef CONFIG_ARM
> > +   setenv("secureboot", "y");
> > +#else
> > setenv("bootcmd", CONFIG_CHAIN_BOOT_CMD);
> > +#endif
> > +
> > return 0;
> >   }
> >   #endif
> > diff --git a/configs/ls1043ardb_SECURE_BOOT_defconfig
> > b/configs/ls1043ardb_SECURE_BOOT_defconfig
> > index 861d49b..3f535cc 100644
> > --- a/configs/ls1043ardb_SECURE_BOOT_defconfig
> > +++ b/configs/ls1043ardb_SECURE_BOOT_defconfig
> > @@ -40,3 +40,4 @@ CONFIG_USB_STORAGE=y
> >   CONFIG_RSA=y
> >   CONFIG_SPL_RSA=y
> >   CONFIG_RSA_SOFTWARE_EXP=y
> > +CONFIG_DISTRO_DEFAULTS=y
> > diff --git a/configs/ls1043ardb_sdcard_SECURE_BOOT_defconfig
> > b/configs/ls1043ardb_sdcard_SECURE_BOOT_defconfig
> > index 5f9b21d..2d57e79 100644
> > --- a/configs/ls1043ardb_sdcard_SECURE_BOOT_defconfig
> > +++ b/configs/ls1043ardb_sdcard_SECURE_BOOT_defconfig
> > @@ -56,3 +56,4 @@ CONFIG_RSA=y
> >   CONFIG_SPL_RSA=y
> >   CONFIG_SPL_CRYPTO_SUPPORT=y
> >   CONFIG_SPL_HASH_SUPPORT=y
> > +CONFIG_DISTRO_DEFAULTS=y
> > diff --git a/include/configs/ls1043a_common.h
> > b/include/configs/ls1043a_common.h
> > index e8a756f..6e30427 100644
> > --- a/include/configs/ls1043a_common.h
> > +++ b/include/configs/ls1043a_common.h
> > @@ -282,6 +282,7 @@
> > "fdt_addr=0x64f0\0"  \
> > "kernel_addr=0x6500\0"  \
> > "scriptaddr=0x8000\0"  \
> > +   "scripthdraddr=0x8008\0"\
> > "fdtheader_addr_r=0x8010\0" \
> > "kernelheader_addr_r=0x8020\0"  \
> > "kernel_addr_r=0x8100\0"\
> > @@ -292,6 +293,7 @@
> > "mtdparts=" MTDPARTS_DEFAULT "\0"   \
> > BOOTENV \
> > "boot_scripts=ls1043ardb_boot.scr\0"\
> > +   "boot_script_hdr=hdr_ls1043ardb_bs.out\0"   \
> > "scan_dev_for_boot_part="  \
> >  "part list ${devtype} ${devnum} devplist; "   \
> >  "env exists devplist || setenv devplist 1; "  \ @@ -302,6
> > +304,21 @@
> >   "run scan_dev_for_boot; " \
> >   "fi; "   \
> >   "done\0"\
> > +   "scan_dev_for_boot="  \
> > +   "echo Scanning ${devtype} "   \
> > +   "${devnum}:${distro_bootpart}...; "  \
> > +   "for prefix in ${boot_prefixes}; do " \
> > +   "run scan_dev_for_scripts; "  \
> > +   "done;"   \
> > +   "\0"  \
> > +   "boot_a_script="  \
> > +   "load ${devtype} ${devnum}:${distro_bootpart} "  \
> > +   "${scriptaddr} ${prefix}${script}; "\
> > +   "env exists secureboot && load ${devtype} " \
> > +   "${devnum}:${distro_bootpart} " \
> > +   "${scripthdraddr} ${prefix}${boot_script_hdr} " \
> > +   "&& esbc_validate ${scripthdraddr};"\
> > +   "source ${scriptaddr}\0"  \
> > "installer=load mmc 0:2 $load_addr "  \
> >"/flex_installer_arm64.itb; "  \
> >"bootm $load_addr#ls1043ardb\0"\
> > @@ -315,9 +332,11 @@
> >
> >   #undef CONFIG_BOOTCOMMAND
> >   #if defined(CONFIG_QSPI_BOOT) || defined(CONFIG_SD_BOOT_QSPI)
> > -#define CONFIG_BOOTCOMMAND "run distro_bootcmd;run
> qspi_bootcmd"
> > +#define CONFIG_BOOTCOMMAND "run distro_bootcmd; env

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

2017-09-01 Thread Wenyou Yang
Replace the code to set the ethernet mac address with the code from
the common folder.

Signed-off-by: Wenyou Yang 
---

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

 arch/arm/dts/at91-sama5d2_xplained.dts  |  5 +++
 board/atmel/sama5d2_xplained/sama5d2_xplained.c | 46 +++--
 configs/sama5d2_xplained_mmc_defconfig  |  1 +
 configs/sama5d2_xplained_spiflash_defconfig |  1 +
 include/configs/sama5d2_xplained.h  |  4 ---
 5 files changed, 11 insertions(+), 46 deletions(-)

diff --git a/arch/arm/dts/at91-sama5d2_xplained.dts 
b/arch/arm/dts/at91-sama5d2_xplained.dts
index 3e624f142c..b00aaa2c79 100644
--- a/arch/arm/dts/at91-sama5d2_xplained.dts
+++ b/arch/arm/dts/at91-sama5d2_xplained.dts
@@ -102,6 +102,11 @@
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_i2c1_default>;
status = "okay";
+
+   i2c_eeprom: i2c_eeprom@5c {
+   compatible = "atmel,24mac402";
+   reg = <0x5c>;
+   };
};
 
pioA: gpio@fc038000 {
diff --git a/board/atmel/sama5d2_xplained/sama5d2_xplained.c 
b/board/atmel/sama5d2_xplained/sama5d2_xplained.c
index 3f0860c555..7e0cb4228f 100644
--- a/board/atmel/sama5d2_xplained/sama5d2_xplained.c
+++ b/board/atmel/sama5d2_xplained/sama5d2_xplained.c
@@ -8,8 +8,6 @@
 #include 
 #include 
 #include 
-#include 
-#include 
 #include 
 #include 
 #include 
@@ -161,50 +159,14 @@ int dram_init(void)
return 0;
 }
 
-#ifdef CONFIG_CMD_I2C
-static int set_ethaddr_from_eeprom(void)
-{
-   const int ETH_ADDR_LEN = 6;
-   unsigned char ethaddr[ETH_ADDR_LEN];
-   const char *ETHADDR_NAME = "ethaddr";
-   struct udevice *bus, *dev;
-
-   if (env_get(ETHADDR_NAME))
-   return 0;
-
-   if (uclass_get_device_by_seq(UCLASS_I2C, 1, &bus)) {
-   printf("Cannot find I2C bus 1\n");
-   return -1;
-   }
-
-   if (dm_i2c_probe(bus, AT24MAC_ADDR, 0, &dev)) {
-   printf("Failed to probe I2C chip\n");
-   return -1;
-   }
-
-   if (dm_i2c_read(dev, AT24MAC_REG, ethaddr, ETH_ADDR_LEN)) {
-   printf("Failed to read ethernet address from EEPROM\n");
-   return -1;
-   }
-
-   if (!is_valid_ethaddr(ethaddr)) {
-   printf("The ethernet address read from EEPROM is not valid!\n");
-   return -1;
-   }
-
-   return eth_env_set_enetaddr(ETHADDR_NAME, ethaddr);
-}
-#else
-static int set_ethaddr_from_eeprom(void)
-{
-   return 0;
-}
-#endif
+#define AT24MAC_MAC_OFFSET 0x9a
 
 #ifdef CONFIG_MISC_INIT_R
 int misc_init_r(void)
 {
-   set_ethaddr_from_eeprom();
+#ifdef CONFIG_I2C_EEPROM
+   at91_set_ethaddr(AT24MAC_MAC_OFFSET);
+#endif
 
return 0;
 }
diff --git a/configs/sama5d2_xplained_mmc_defconfig 
b/configs/sama5d2_xplained_mmc_defconfig
index d59fd8216c..fb7c242b1c 100644
--- a/configs/sama5d2_xplained_mmc_defconfig
+++ b/configs/sama5d2_xplained_mmc_defconfig
@@ -51,6 +51,7 @@ CONFIG_DM_GPIO=y
 CONFIG_ATMEL_PIO4=y
 CONFIG_DM_I2C=y
 CONFIG_SYS_I2C_AT91=y
+CONFIG_I2C_EEPROM=y
 CONFIG_DM_MMC=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_ATMEL=y
diff --git a/configs/sama5d2_xplained_spiflash_defconfig 
b/configs/sama5d2_xplained_spiflash_defconfig
index a997aa74bd..24698876ba 100644
--- a/configs/sama5d2_xplained_spiflash_defconfig
+++ b/configs/sama5d2_xplained_spiflash_defconfig
@@ -49,6 +49,7 @@ CONFIG_DM_GPIO=y
 CONFIG_ATMEL_PIO4=y
 CONFIG_DM_I2C=y
 CONFIG_SYS_I2C_AT91=y
+CONFIG_I2C_EEPROM=y
 CONFIG_DM_MMC=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_ATMEL=y
diff --git a/include/configs/sama5d2_xplained.h 
b/include/configs/sama5d2_xplained.h
index 9ceb91924d..891218d83e 100644
--- a/include/configs/sama5d2_xplained.h
+++ b/include/configs/sama5d2_xplained.h
@@ -35,10 +35,6 @@
 #define CONFIG_SF_DEFAULT_SPEED3000
 #endif
 
-/* I2C */
-#define AT24MAC_ADDR   0x5c
-#define AT24MAC_REG0x9a
-
 /* LCD */
 
 #ifdef CONFIG_LCD
-- 
2.13.0

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


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

2017-09-01 Thread Wenyou Yang
Add the code to set the ethernet mac address from eeprom by using
the common code from the common folder.

Signed-off-by: Wenyou Yang 
---

Changes in v4:
 - Rebase the latest commit(8b3cec7da) on uboot/master.

Changes in v3:
 - remove CONFIG_SPL_I2C_SUPPORT=y from the default configuration files.
 - rebase on [PATCH] misc: Makefile: Add condition on build i2c_eeprom.
https://lists.denx.de/pipermail/u-boot/2017-August/300783.html

Changes in v2:
 - Add a new patch to create board/$(VENDOR)/common folder to
   accommodate the common code and put the code to set the ethernet
   mac address from eeprom here.
 - Use the i2c_eeprom driver to read the mac address, instead of
   the dm i2c API directly.

 arch/arm/dts/at91-sama5d4_xplained.dts  |  5 +
 board/atmel/sama5d4_xplained/sama5d4_xplained.c | 12 
 configs/sama5d4_xplained_mmc_defconfig  |  3 +++
 configs/sama5d4_xplained_nandflash_defconfig|  3 +++
 configs/sama5d4_xplained_spiflash_defconfig |  3 +++
 include/configs/sama5d4_xplained.h  |  2 ++
 6 files changed, 28 insertions(+)

diff --git a/arch/arm/dts/at91-sama5d4_xplained.dts 
b/arch/arm/dts/at91-sama5d4_xplained.dts
index ca6aff28e5..0592b31b91 100644
--- a/arch/arm/dts/at91-sama5d4_xplained.dts
+++ b/arch/arm/dts/at91-sama5d4_xplained.dts
@@ -88,6 +88,11 @@
 
i2c0: i2c@f8014000 {
status = "okay";
+
+   i2c_eeprom: i2c_eeprom@5c {
+   compatible = "atmel,24mac402";
+   reg = <0x5c>;
+   };
};
 
macb0: ethernet@f802 {
diff --git a/board/atmel/sama5d4_xplained/sama5d4_xplained.c 
b/board/atmel/sama5d4_xplained/sama5d4_xplained.c
index 854afcb622..248a31b8c4 100644
--- a/board/atmel/sama5d4_xplained/sama5d4_xplained.c
+++ b/board/atmel/sama5d4_xplained/sama5d4_xplained.c
@@ -192,6 +192,18 @@ int board_early_init_f(void)
 }
 #endif
 
+#define AT24MAC_MAC_OFFSET 0x9a
+
+#ifdef CONFIG_MISC_INIT_R
+int misc_init_r(void)
+{
+#ifdef CONFIG_I2C_EEPROM
+   at91_set_ethaddr(AT24MAC_MAC_OFFSET);
+#endif
+   return 0;
+}
+#endif
+
 int board_init(void)
 {
/* adress of boot parameters */
diff --git a/configs/sama5d4_xplained_mmc_defconfig 
b/configs/sama5d4_xplained_mmc_defconfig
index de0ce40a56..792d011718 100644
--- a/configs/sama5d4_xplained_mmc_defconfig
+++ b/configs/sama5d4_xplained_mmc_defconfig
@@ -47,6 +47,9 @@ CONFIG_AT91_UTMI=y
 CONFIG_AT91_H32MX=y
 CONFIG_DM_GPIO=y
 CONFIG_AT91_GPIO=y
+CONFIG_DM_I2C=y
+CONFIG_SYS_I2C_AT91=y
+CONFIG_I2C_EEPROM=y
 CONFIG_DM_MMC=y
 CONFIG_GENERIC_ATMEL_MCI=y
 CONFIG_DM_SPI_FLASH=y
diff --git a/configs/sama5d4_xplained_nandflash_defconfig 
b/configs/sama5d4_xplained_nandflash_defconfig
index cba3c8b640..3b0af5bf00 100644
--- a/configs/sama5d4_xplained_nandflash_defconfig
+++ b/configs/sama5d4_xplained_nandflash_defconfig
@@ -44,6 +44,9 @@ CONFIG_AT91_UTMI=y
 CONFIG_AT91_H32MX=y
 CONFIG_DM_GPIO=y
 CONFIG_AT91_GPIO=y
+CONFIG_DM_I2C=y
+CONFIG_SYS_I2C_AT91=y
+CONFIG_I2C_EEPROM=y
 CONFIG_DM_MMC=y
 CONFIG_GENERIC_ATMEL_MCI=y
 CONFIG_DM_SPI_FLASH=y
diff --git a/configs/sama5d4_xplained_spiflash_defconfig 
b/configs/sama5d4_xplained_spiflash_defconfig
index 174e2bc5ba..26eb00598c 100644
--- a/configs/sama5d4_xplained_spiflash_defconfig
+++ b/configs/sama5d4_xplained_spiflash_defconfig
@@ -46,6 +46,9 @@ CONFIG_AT91_UTMI=y
 CONFIG_AT91_H32MX=y
 CONFIG_DM_GPIO=y
 CONFIG_AT91_GPIO=y
+CONFIG_DM_I2C=y
+CONFIG_SYS_I2C_AT91=y
+CONFIG_I2C_EEPROM=y
 CONFIG_DM_MMC=y
 CONFIG_GENERIC_ATMEL_MCI=y
 CONFIG_DM_SPI_FLASH=y
diff --git a/include/configs/sama5d4_xplained.h 
b/include/configs/sama5d4_xplained.h
index c8462b0b64..08f865016d 100644
--- a/include/configs/sama5d4_xplained.h
+++ b/include/configs/sama5d4_xplained.h
@@ -12,6 +12,8 @@
 
 #include "at91-sama5_common.h"
 
+#define CONFIG_MISC_INIT_R
+
 /* SDRAM */
 #define CONFIG_NR_DRAM_BANKS   1
 #define CONFIG_SYS_SDRAM_BASE   ATMEL_BASE_DDRCS
-- 
2.13.0

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


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

2017-09-01 Thread Wenyou Yang
Create board/$(VENDOR)/common folder to accommodate the common code
shared by other atmel boards, now put the code to set ethernet mac
address from eeprom, which uses the i2c eeprom driver.

Signed-off-by: Wenyou Yang 
---

Changes in v4:
 - Follow up the env function renaming.

Changes in v3: None
Changes in v2: None

 arch/arm/mach-at91/include/mach/at91_common.h |  2 ++
 board/atmel/common/Makefile   | 11 
 board/atmel/common/board.c| 12 +
 board/atmel/common/mac_eeprom.c   | 36 +++
 4 files changed, 61 insertions(+)
 create mode 100644 board/atmel/common/Makefile
 create mode 100644 board/atmel/common/board.c
 create mode 100644 board/atmel/common/mac_eeprom.c

diff --git a/arch/arm/mach-at91/include/mach/at91_common.h 
b/arch/arm/mach-at91/include/mach/at91_common.h
index 0742ffc56f..a95fe41610 100644
--- a/arch/arm/mach-at91/include/mach/at91_common.h
+++ b/arch/arm/mach-at91/include/mach/at91_common.h
@@ -36,4 +36,6 @@ void matrix_init(void);
 void redirect_int_from_saic_to_aic(void);
 void configure_2nd_sram_as_l2_cache(void);
 
+int at91_set_ethaddr(int offset);
+
 #endif /* AT91_COMMON_H */
diff --git a/board/atmel/common/Makefile b/board/atmel/common/Makefile
new file mode 100644
index 00..6d9c6850b5
--- /dev/null
+++ b/board/atmel/common/Makefile
@@ -0,0 +1,11 @@
+#
+# Copyright (C) 2017 Microchip
+#Wenyou Yang 
+#
+# SPDX-License-Identifier: GPL-2.0+
+#
+
+obj-y += board.o
+ifndef CONFIG_SPL_BUILD
+obj-$(CONFIG_I2C_EEPROM) += mac_eeprom.o
+endif
diff --git a/board/atmel/common/board.c b/board/atmel/common/board.c
new file mode 100644
index 00..7e326d925b
--- /dev/null
+++ b/board/atmel/common/board.c
@@ -0,0 +1,12 @@
+/*
+ * Copyright (C) 2017 Microchip
+ *   Wenyou Yang 
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#include 
+
+void dummy(void)
+{
+}
diff --git a/board/atmel/common/mac_eeprom.c b/board/atmel/common/mac_eeprom.c
new file mode 100644
index 00..60ddf00d45
--- /dev/null
+++ b/board/atmel/common/mac_eeprom.c
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2017 Microchip
+ *   Wenyou Yang 
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#include 
+#include 
+#include 
+#include 
+
+int at91_set_ethaddr(int offset)
+{
+   const int ETH_ADDR_LEN = 6;
+   unsigned char ethaddr[ETH_ADDR_LEN];
+   const char *ETHADDR_NAME = "ethaddr";
+   struct udevice *dev;
+   int ret;
+
+   if (env_get(ETHADDR_NAME))
+   return 0;
+
+   ret = uclass_first_device_err(UCLASS_I2C_EEPROM, &dev);
+   if (ret)
+   return ret;
+
+   ret = i2c_eeprom_read(dev, offset, ethaddr, 6);
+   if (ret)
+   return ret;
+
+   if (is_valid_ethaddr(ethaddr))
+   eth_env_set_enetaddr(ETHADDR_NAME, ethaddr);
+
+   return 0;
+}
-- 
2.13.0

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


Re: [U-Boot] [PATCH 1/1] usb: gadget: g_dnl: Use serial# variable to set g_dnl_serial

2017-09-01 Thread Łukasz Majewski

On 09/01/2017 10:19 AM, Marek Vasut wrote:

On 08/31/2017 08:20 PM, Sam Protsenko wrote:

Since 842778a09104 commit, "fastboot devices" stopped to show correct
device serial number for TI boards, showing this line instead:

fastboot

This is because serial# env variable could be set after g_dnl gadget was
initialized (e.g. by using env_set() in the board file).

To fix this, before checking g_dnl_serial, let's re-check if we have
valid serial# value. And if so, let's set it as g_dnl_serial value.

Signed-off-by: Sam Protsenko 


Can't we use U_BOOT_ENV_CALLBACK() here instead and set the serial
number when the environment variable is set ?


Hmm... This might work.

However, I'm a bit concerned with having "bound" the one particular env 
variable ("serial#" in this case) to generic g_dnl.c code.






---
 drivers/usb/gadget/g_dnl.c | 9 +
 1 file changed, 9 insertions(+)

diff --git a/drivers/usb/gadget/g_dnl.c b/drivers/usb/gadget/g_dnl.c
index 0491a0eea9..e4d0289757 100644
--- a/drivers/usb/gadget/g_dnl.c
+++ b/drivers/usb/gadget/g_dnl.c
@@ -226,6 +226,15 @@ static int g_dnl_bind(struct usb_composite_dev *cdev)

g_dnl_bind_fixup(&device_desc, cdev->driver->name);

+   /* First try to obtain serial number from serial# variable */
+   if (strlen(g_dnl_serial) == 0) {
+   const char *s;
+
+   s = env_get("serial#");
+   if (s)
+   g_dnl_set_serialnumber((char *)s);
+   }
+
if (strlen(g_dnl_serial)) {
id = usb_string_id(cdev);
if (id < 0)







--
Best regards,

Lukasz Majewski

--

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


[U-Boot] [PATCH v3] patman: add support for omitting bouncing addresses

2017-09-01 Thread Chris Packham
Add support for reading a list of bouncing addresses from a in-tree file
(doc/bounces) and from the ~/.patman config file. These addresses are
stripped from the Cc list.

Signed-off-by: Chris Packham 
Reviewed-by: Simon Glass 
---
This version supports an in-tree doc/bounces file as well as a section
in the .patman config file. A slight annoyance is the config file parser
expects key: value pairs whereas the bounces file is just a flat list. I
started looking a modeling this after the aliases but then I actually
thought that if we do want to tag someone as a bouncing address we
probably want to be explicit about it.

Changes in v3:
- print addresses that are skipped
- add review from Simon

Changes in v2:
- better integration with existing configuration
- documentation

 doc/bounces  |  3 +++
 tools/patman/README  | 12 
 tools/patman/series.py   |  5 +
 tools/patman/settings.py | 18 ++
 4 files changed, 38 insertions(+)
 create mode 100644 doc/bounces

diff --git a/doc/bounces b/doc/bounces
new file mode 100644
index ..d1c5f0d246eb
--- /dev/null
+++ b/doc/bounces
@@ -0,0 +1,3 @@
+# List of addresses picked up by patman/get_maintainer.pl that are known to
+# bounce. Addresses are listed one per line and need to match the author
+# information recorded in git.
diff --git a/tools/patman/README b/tools/patman/README
index e36857dedea1..8582ed6ba12c 100644
--- a/tools/patman/README
+++ b/tools/patman/README
@@ -84,6 +84,18 @@ Aliases are recursive.
 The checkpatch.pl in the U-Boot tools/ subdirectory will be located and
 used. Failing that you can put it into your path or ~/bin/checkpatch.pl
 
+If you want to avoid sending patches to email addresses that are picked up
+by patman but are known to bounce you can add a [bounces] section to your
+.patman file. Unlike the [alias] section these are simple key: value pairs
+that are not recursive.
+
+>>>
+
+[bounces]
+gonefishing: Fred Bloggs 
+
+<<<
+
 
 If you want to change the defaults for patman's command-line arguments,
 you can add a [settings] section to your .patman file.  This can be used
diff --git a/tools/patman/series.py b/tools/patman/series.py
index d3947a7c2ac5..73ee39448614 100644
--- a/tools/patman/series.py
+++ b/tools/patman/series.py
@@ -10,6 +10,7 @@ import os
 
 import get_maintainer
 import gitutil
+import settings
 import terminal
 
 # Series-xxx tags that we understand
@@ -218,6 +219,7 @@ class Series(dict):
 Return:
 Filename of temp file created
 """
+col = terminal.Color()
 # Look for commit tags (of the form 'xxx:' at the start of the subject)
 fname = '/tmp/patman.%d' % os.getpid()
 fd = open(fname, 'w')
@@ -233,6 +235,9 @@ class Series(dict):
 cc += add_maintainers
 elif add_maintainers:
 cc += get_maintainer.GetMaintainer(commit.patch)
+for x in set(cc) & set(settings.bounces):
+print(col.Color(col.YELLOW, 'Skipping "%s"' % x))
+cc = set(cc) - set(settings.bounces)
 cc = [m.encode('utf-8') if type(m) != str else m for m in cc]
 all_ccs += cc
 print(commit.patch, ', '.join(set(cc)), file=fd)
diff --git a/tools/patman/settings.py b/tools/patman/settings.py
index 5f207f5ef1c4..d735ff9ba3c6 100644
--- a/tools/patman/settings.py
+++ b/tools/patman/settings.py
@@ -269,6 +269,19 @@ def _ReadAliasFile(fname):
 if bad_line:
 print(bad_line)
 
+def _ReadBouncesFile(fname):
+"""Read in the bounces file if it exists
+
+Args:
+fname: Filename to read.
+"""
+if os.path.exists(fname):
+with open(fname) as fd:
+for line in fd:
+if line.startswith('#'):
+continue
+bounces.add(line.strip())
+
 def Setup(parser, project_name, config_fname=''):
 """Set up the settings module by reading config files.
 
@@ -293,10 +306,15 @@ def Setup(parser, project_name, config_fname=''):
 for name, value in config.items('alias'):
 alias[name] = value.split(',')
 
+_ReadBouncesFile('doc/bounces')
+for name, value in config.items('bounces'):
+bounces.add(value)
+
 _UpdateDefaults(parser, config)
 
 # These are the aliases we understand, indexed by alias. Each member is a list.
 alias = {}
+bounces = set()
 
 if __name__ == "__main__":
 import doctest
-- 
2.14.1

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


Re: [U-Boot] [PATCH v3] patman: add support for omitting bouncing addresses

2017-09-01 Thread Dr. Philipp Tomsich

> On 1 Sep 2017, at 10:57, Chris Packham  wrote:
> 
> Add support for reading a list of bouncing addresses from a in-tree file
> (doc/bounces) and from the ~/.patman config file. These addresses are
> stripped from the Cc list.
> 
> Signed-off-by: Chris Packham 
> Reviewed-by: Simon Glass 

Reviewed-by: Philipp Tomsich mailto:philipp.toms...@theobroma-systems.com>>

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


Re: [U-Boot] [PATCH 1/2] x86: ich-spi: Remove useless assignment in ich_spi_xfer()

2017-09-01 Thread Bin Meng
On Sun, Aug 27, 2017 at 4:00 PM, Stefan Roese  wrote:
> On 27.08.2017 04:22, Bin Meng wrote:
>>
>> In ich_spi_xfer() when the driver presets control fields, control
>> variable gets assigned twice. Apparently only the last assignment
>> takes effect. Remove the other one.
>>
>> Signed-off-by: Bin Meng 
>> ---
>>
>>   drivers/spi/ich.c | 2 --
>>   1 file changed, 2 deletions(-)
>>

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


Re: [U-Boot] [PATCH 2/2] x86: ich-spi: Clear atomic preop only when SPI settings are not locked

2017-09-01 Thread Bin Meng
On Sun, Aug 27, 2017 at 4:00 PM, Stefan Roese  wrote:
> On 27.08.2017 04:22, Bin Meng wrote:
>>
>> The atomic preop register can only be written when SPI settings are
>> not locked, otherwise it's read-only.
>>
>> Signed-off-by: Bin Meng 
>> ---
>>
>>   drivers/spi/ich.c | 3 ++-
>>   1 file changed, 2 insertions(+), 1 deletion(-)
>>

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


Re: [U-Boot] [PATCH] x86: baytrail: acpi: Add full reset bit to the reset register value in FADT

2017-09-01 Thread Bin Meng
On Tue, Aug 29, 2017 at 3:49 PM, Stefan Roese  wrote:
> On 29.08.2017 07:09, Bin Meng wrote:
>>
>> It was noticed a few times, that the reboot from Linux (reboot command)
>> is different from the reboot (reset command) under U-Boot. The U-Boot
>> version does seem to reset the board more deeply (PCI cards etc) than
>> the Linux reboot.
>>
>> This is actually caused by missing full reset bit in the reset register
>> value in the ACPI FADT table.
>>
>> Reported-by: Stefan Roese 
>> Signed-off-by: Bin Meng 
>> ---
>>
>>   arch/x86/cpu/baytrail/acpi.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/arch/x86/cpu/baytrail/acpi.c b/arch/x86/cpu/baytrail/acpi.c
>> index cbefdf8..7aac634 100644
>> --- a/arch/x86/cpu/baytrail/acpi.c
>> +++ b/arch/x86/cpu/baytrail/acpi.c
>> @@ -73,7 +73,7 @@ void acpi_create_fadt(struct acpi_fadt *fadt, struct
>> acpi_facs *facs,
>> fadt->reset_reg.access_size = ACPI_ACCESS_SIZE_BYTE_ACCESS;
>> fadt->reset_reg.addrl = IO_PORT_RESET;
>> fadt->reset_reg.addrh = 0;
>> -   fadt->reset_value = SYS_RST | RST_CPU;
>> +   fadt->reset_value = SYS_RST | RST_CPU | FULL_RST;
>> fadt->x_firmware_ctl_l = (u32)facs;
>> fadt->x_firmware_ctl_h = 0;
>>
>
> Very nice Bin, this does exactly what I was missing. :)
>
> Tested-by: Stefan Roese 
>

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


Re: [U-Boot] [PATCH 1/1] usb: gadget: g_dnl: Use serial# variable to set g_dnl_serial

2017-09-01 Thread Marek Vasut
On 09/01/2017 10:36 AM, Łukasz Majewski wrote:
> On 09/01/2017 10:19 AM, Marek Vasut wrote:
>> On 08/31/2017 08:20 PM, Sam Protsenko wrote:
>>> Since 842778a09104 commit, "fastboot devices" stopped to show correct
>>> device serial number for TI boards, showing this line instead:
>>>
>>> fastboot
>>>
>>> This is because serial# env variable could be set after g_dnl gadget was
>>> initialized (e.g. by using env_set() in the board file).
>>>
>>> To fix this, before checking g_dnl_serial, let's re-check if we have
>>> valid serial# value. And if so, let's set it as g_dnl_serial value.
>>>
>>> Signed-off-by: Sam Protsenko 
>>
>> Can't we use U_BOOT_ENV_CALLBACK() here instead and set the serial
>> number when the environment variable is set ?
> 
> Hmm... This might work.
> 
> However, I'm a bit concerned with having "bound" the one particular env
> variable ("serial#" in this case) to generic g_dnl.c code.
That's a separate problem though, we already have this serial# variable
in place.

-- 
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/1] usb: gadget: g_dnl: Use serial# variable to set g_dnl_serial

2017-09-01 Thread Łukasz Majewski

On 09/01/2017 11:51 AM, Marek Vasut wrote:

On 09/01/2017 10:36 AM, Łukasz Majewski wrote:

On 09/01/2017 10:19 AM, Marek Vasut wrote:

On 08/31/2017 08:20 PM, Sam Protsenko wrote:

Since 842778a09104 commit, "fastboot devices" stopped to show correct
device serial number for TI boards, showing this line instead:

fastboot

This is because serial# env variable could be set after g_dnl gadget was
initialized (e.g. by using env_set() in the board file).

To fix this, before checking g_dnl_serial, let's re-check if we have
valid serial# value. And if so, let's set it as g_dnl_serial value.

Signed-off-by: Sam Protsenko 


Can't we use U_BOOT_ENV_CALLBACK() here instead and set the serial
number when the environment variable is set ?


Hmm... This might work.

However, I'm a bit concerned with having "bound" the one particular env
variable ("serial#" in this case) to generic g_dnl.c code.

That's a separate problem though, we already have this serial# variable
in place.


Do you mean that it is the same of "fixed" variable, as "ipaddr" is for 
network subsytem?







--
Best regards,

Lukasz Majewski

--

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


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

2017-09-01 Thread Simon Glass
On 28 August 2017 at 16:50, Chris Packham  wrote:
> This migrates ASIX, ASIX88179, MCS7830, RTL8152 and SMSC95XX to Kconfig.
> Update defconfigs.
>
> Signed-off-by: Chris Packham 
> ---
>
> Changes in v3: None
> Changes in v2:
> - add imply for TARGET_NITROGEN6X, ARCH_EXYNOS5 and X86
>
>  arch/Kconfig   |  2 ++
>  arch/arm/mach-exynos/Kconfig   |  3 ++
>  arch/arm/mach-imx/mx6/Kconfig  |  3 ++
>  configs/arndale_defconfig  |  1 +
>  configs/beaver_defconfig   |  1 +
>  configs/cardhu_defconfig   |  1 +
>  configs/cei-tk1-som_defconfig  |  1 +
>  configs/cgtqmx6eval_defconfig  |  1 +
>  configs/cl-som-am57x_defconfig |  3 ++
>  configs/cm_t54_defconfig   |  3 ++
>  configs/colibri_t20_defconfig  |  1 +
>  configs/colibri_t30_defconfig  |  1 +
>  configs/dalmore_defconfig  |  1 +
>  configs/dfi-bt700-q7x-151_defconfig|  2 ++
>  configs/dragonboard410c_defconfig  |  4 +++
>  configs/e2220-1170_defconfig   |  1 +
>  configs/evb-rk3399_defconfig   |  5 +++
>  configs/fennec-rk3288_defconfig|  2 ++
>  configs/firefly-rk3288_defconfig   |  2 ++
>  configs/firefly-rk3399_defconfig   |  5 +++
>  configs/gwventana_emmc_defconfig   |  2 ++
>  configs/gwventana_gw5904_defconfig |  2 ++
>  configs/gwventana_nand_defconfig   |  2 ++
>  configs/harmony_defconfig  |  3 ++
>  configs/hikey_defconfig|  2 ++
>  configs/jetson-tk1_defconfig   |  1 +
>  configs/kylin-rk3036_defconfig |  2 ++
>  configs/m53evk_defconfig   |  3 ++
>  configs/marsboard_defconfig|  1 +
>  configs/mcx_defconfig  |  2 ++
>  configs/medcom-wide_defconfig  |  1 +
>  configs/miqi-rk3288_defconfig  |  2 ++
>  configs/mvebu_db-88f3720_defconfig |  4 +++
>  configs/mvebu_db_armada8k_defconfig|  4 +++
>  configs/mvebu_espressobin-88f3720_defconfig|  4 +++
>  configs/mvebu_mcbin-88f8040_defconfig  |  4 +++
>  configs/mx23_olinuxino_defconfig   |  1 +
>  configs/mx28evk_auart_console_defconfig|  2 ++
>  configs/mx28evk_defconfig  |  2 ++
>  configs/mx28evk_nand_defconfig |  2 ++
>  configs/mx28evk_spi_defconfig  |  2 ++
>  configs/mx51evk_defconfig  |  2 ++
>  configs/mx53loco_defconfig |  3 ++
>  configs/mx6dlarm2_defconfig|  1 +
>  configs/mx6dlarm2_lpddr2_defconfig |  1 +
>  configs/mx6qarm2_defconfig |  1 +
>  configs/mx6qarm2_lpddr2_defconfig  |  1 +
>  configs/mx6sabreauto_defconfig |  1 +
>  configs/mx6sabresd_defconfig   |  1 +
>  configs/mx6slevk_defconfig |  1 +
>  configs/mx6slevk_spinor_defconfig  |  1 +
>  configs/mx6slevk_spl_defconfig |  1 +
>  configs/mx6sllevk_defconfig|  2 ++
>  configs/mx6sllevk_plugin_defconfig |  2 ++
>  configs/mx6sxsabreauto_defconfig   |  1 +
>  configs/mx6sxsabresd_defconfig |  1 +
>  configs/mx6sxsabresd_spl_defconfig |  1 +
>  configs/mx7dsabresd_defconfig  |  1 +
>  configs/mx7dsabresd_secure_defconfig   |  1 +
>  configs/novena_defconfig   |  2 ++
>  configs/nyan-big_defconfig |  1 +
>  configs/odroid_defconfig   |  1 +
>  configs/omap3_beagle_defconfig |  3 ++
>  configs/omap3_ha_defconfig |  1 +
>  configs/omap4_panda_defconfig  |  1 +
>  configs/omap5_uevm_defconfig   |  1 +
>  configs/p2371-_defconfig   |  1 +
>  configs/p2371-2180_defconfig   |  1 +
>  configs/p2571_defconfig|  1 +
>  configs/paz00_defconfig|  1 +
>  configs/phycore-rk3288_defconfig   |  2 ++
>  configs/plutux_defconfig   |  1 +
>  configs/poplar_defconfig   |  1 +
>  configs/popmetal-rk3288_defconfig  |  2 ++
>  configs/puma-rk3399_defconfig  |  5 +++
>  configs/riotboard_defconfig|  1 +
>  configs/rpi_2_defconfig 

Re: [U-Boot] [PATCH 2/2] ARM: Add a new arch + board for QEMU's 'virt' machine

2017-09-01 Thread Tuomas Tynkkynen

Hi,

On 08/31/2017 09:55 AM, Bin Meng wrote:

Hi Tuomas,

On Wed, Aug 30, 2017 at 4:31 PM, Tuomas Tynkkynen
 wrote:

This board builds an U-Boot binary that is bootable with QEMU's 'virt'
machine on ARM. The minimal QEMU command line is:

 qemu-system-arm -machine virt,highmem=off -bios u-boot.bin

(Note that the 'highmem=off' parameter to the 'virt' machine is required for
PCI to work in U-Boot.) This command line enables the following:
 - u-boot.bin loaded and executing in the emulated flash at address 0x0
 - A generated device tree blob placed at the start of RAM
 - A freely configurable amount of RAM, described by the DTB
 - A PL011 serial port, discoverable via the DTB
 - An ARMv7 architected timer
 - PSCI for rebooting the system
 - A generic ECAM-based PCI host controller, discoverable via the DTB

Additionally, QEMU allows plugging a bunch of useful peripherals to the PCI bus.
The following ones are supported by both U-Boot and Linux:

- To enable a Serial ATA disk via an Intel ICH9 AHCI controller, pass e.g.:
 -drive if=none,file=disk.img,id=mydisk -device ich9-ahci,id=ahci -device 
ide-drive,drive=mydisk,bus=ahci.0
- To enable an Intel E1000 network adapter, pass e.g.:
 -net nic,model=e1000 -net user
- To add an EHCI-compliant USB host controller, pass e.g.:
 -device usb-ehci,id=ehci


Can we enable the NVMe driver (CONFIG_NVME) here?



Yes, 'nvme scan' and 'nvme list' it appear to work. I'll enable it.
There is a bunch of spew of this form though:

CACHE: Misaligned operation at range [bef5d000, bef5d020]




Signed-off-by: Tuomas Tynkkynen 
---
  arch/arm/Kconfig   | 10 
  arch/arm/mach-qemu/Kconfig |  9 +++
  board/qemu-arm/Makefile|  5 
  board/qemu-arm/qemu-arm.c  | 35 ++
  configs/qemu_arm_defconfig | 27 
  include/configs/qemu-arm.h | 63 ++
  6 files changed, 149 insertions(+)
  create mode 100644 arch/arm/mach-qemu/Kconfig
  create mode 100644 board/qemu-arm/Makefile
  create mode 100644 board/qemu-arm/qemu-arm.c
  create mode 100644 configs/qemu_arm_defconfig
  create mode 100644 include/configs/qemu-arm.h

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 53d0831935..0d01ba1b73 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -630,6 +630,14 @@ config ARCH_MX5
 select CPU_V7
 select BOARD_EARLY_INIT_F

+config ARCH_QEMU
+   bool "QEMU Virtual Platform"
+   select CPU_V7
+   select ARCH_SUPPORT_PSCI
+   select DM
+   select DM_SERIAL
+   select OF_CONTROL
+
  config ARCH_RMOBILE
 bool "Renesas ARM SoCs"
 select DM
@@ -1149,6 +1157,8 @@ source "arch/arm/mach-stm32/Kconfig"

  source "arch/arm/mach-sunxi/Kconfig"

+source "arch/arm/mach-qemu/Kconfig"
+


Can you insert this by following alphabetical order?



Oops, yes of course.


  source "arch/arm/mach-tegra/Kconfig"

  source "arch/arm/mach-uniphier/Kconfig"
diff --git a/arch/arm/mach-qemu/Kconfig b/arch/arm/mach-qemu/Kconfig
new file mode 100644
index 00..89d2a36719
--- /dev/null
+++ b/arch/arm/mach-qemu/Kconfig
@@ -0,0 +1,9 @@
+if ARCH_QEMU
+
+config SYS_BOARD
+   default "qemu-arm"
+
+config SYS_CONFIG_NAME
+   default "qemu-arm"
+
+endif
diff --git a/board/qemu-arm/Makefile b/board/qemu-arm/Makefile
new file mode 100644
index 00..3e9907d983
--- /dev/null
+++ b/board/qemu-arm/Makefile


Can this new board be put into the board/emulation/qemu-arm directory?
Since qemu-x86 is put there.



Sure. There is still qemu-mips directly under board/ though.


@@ -0,0 +1,5 @@
+#
+# SPDX-License-Identifier: GPL-2.0
+#
+
+obj-y  += qemu-arm.o
diff --git a/board/qemu-arm/qemu-arm.c b/board/qemu-arm/qemu-arm.c
new file mode 100644
index 00..90d7badbf4
--- /dev/null
+++ b/board/qemu-arm/qemu-arm.c
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2017 Tuomas Tynkkynen
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+#include 
+#include 
+
+DECLARE_GLOBAL_DATA_PTR;


This is not needed as gd is not referenced in this file.



Now removed.

Thank you for the review.
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH] sunxi: Change SUNXI_GMAC to SUN7I_GMAC in sources

2017-09-01 Thread Lionel Koenig
Following 4d43d065db3262f9a9918ba72457bf36dfb8e0bb,
SUNXI_GMAC was still used to configure the code while
SUN7I_GMAC was used in the configuration tools.

Signed-off-by: Lionel Koenig 
---
 arch/arm/include/asm/arch-sunxi/sys_proto.h | 2 +-
 board/sunxi/Makefile| 2 +-
 include/configs/sunxi-common.h  | 2 +-
 scripts/build-whitelist.sh  | 4 ++--
 scripts/config_whitelist.txt| 2 +-
 5 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/arch/arm/include/asm/arch-sunxi/sys_proto.h 
b/arch/arm/include/asm/arch-sunxi/sys_proto.h
index a373319a2b..096510b787 100644
--- a/arch/arm/include/asm/arch-sunxi/sys_proto.h
+++ b/arch/arm/include/asm/arch-sunxi/sys_proto.h
@@ -24,7 +24,7 @@ void sdelay(unsigned long);
 void return_to_fel(uint32_t lr, uint32_t sp);
 
 /* Board / SoC level designware gmac init */
-#if !defined CONFIG_SPL_BUILD && defined CONFIG_SUNXI_GMAC
+#if !defined CONFIG_SPL_BUILD && defined CONFIG_SUN7I_GMAC
 void eth_init_board(void);
 #else
 static inline void eth_init_board(void) {}
diff --git a/board/sunxi/Makefile b/board/sunxi/Makefile
index f4411f01c3..526cb72a51 100644
--- a/board/sunxi/Makefile
+++ b/board/sunxi/Makefile
@@ -9,7 +9,7 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 obj-y  += board.o
-obj-$(CONFIG_SUNXI_GMAC)   += gmac.o
+obj-$(CONFIG_SUN7I_GMAC)   += gmac.o
 ifndef CONFIG_SPL_BUILD
 obj-$(CONFIG_SUNXI_AHCI)   += ahci.o
 endif
diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h
index 212862acd1..1373b1f037 100644
--- a/include/configs/sunxi-common.h
+++ b/include/configs/sunxi-common.h
@@ -294,7 +294,7 @@ extern int soft_i2c_gpio_scl;
 #define CONFIG_MII /* MII PHY management   */
 #endif
 
-#ifdef CONFIG_SUNXI_GMAC
+#ifdef CONFIG_SUN7I_GMAC
 #define CONFIG_PHY_ADDR1
 #define CONFIG_MII /* MII PHY management   */
 #define CONFIG_PHY_REALTEK
diff --git a/scripts/build-whitelist.sh b/scripts/build-whitelist.sh
index 7d8160d5f2..6feb9b67cf 100755
--- a/scripts/build-whitelist.sh
+++ b/scripts/build-whitelist.sh
@@ -13,10 +13,10 @@ export LC_ALL=C LC_COLLATE=C
 # There are two independent greps. The first pulls out the component parts
 # of CONFIG_SYS_EXTRA_OPTIONS. An example is:
 #
-#  SUNXI_GMAC,AHCI,SATAPWR=SUNXI_GPB(8)
+#  SUN7I_GMAC,AHCI,SATAPWR=SUNXI_GPB(8)
 #
 # We want this to produce:
-#  CONFIG_SUNXI_GMAC
+#  CONFIG_SUN7I_GMAC
 #  CONFIG_AHCI
 #  CONFIG_SATAPWR
 #
diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt
index d8710958a3..19416dddca 100644
--- a/scripts/config_whitelist.txt
+++ b/scripts/config_whitelist.txt
@@ -2307,7 +2307,7 @@ CONFIG_STV0991_HZ_CLOCK
 CONFIG_ST_SMI
 CONFIG_SUNXI_AHCI
 CONFIG_SUNXI_EMAC
-CONFIG_SUNXI_GMAC
+CONFIG_SUN7I_GMAC
 CONFIG_SUNXI_GPIO
 CONFIG_SUNXI_MAX_FB_SIZE
 CONFIG_SUNXI_USB_PHYS
-- 
2.14.1

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


[U-Boot] do_nand_status( ) patch

2017-09-01 Thread masonccyang

Hi,

Checking all nand chip is necessary and some of NAND host implement 
cmd_ctrl() from cmdfunc( ).
The select_chip() is required.


===
diff --git a/cmd/nand.c b/cmd/nand.c
index 5b9d4b3..a7c781a 100644
--- a/cmd/nand.c
+++ b/cmd/nand.c
@@ -156,13 +156,18 @@ static void do_nand_status(nand_info_t *nand)
ulong block_start = 0;
ulong off;
int last_status = -1;
+   int chipnr;

struct nand_chip *nand_chip = nand->priv;
/* check the WP bit */
-   nand_chip->cmdfunc(nand, NAND_CMD_STATUS, -1, -1);
-   printf("device is %swrite protected\n",
-   (nand_chip->read_byte(nand) & 0x80 ?
-   "NOT " : ""));
+   for (chipnr = 0; chipnr < nand_chip->numchips; chipnr++) {
+   nand_chip->select_chip(nand, chipnr);
+   nand_chip->cmdfunc(nand, NAND_CMD_STATUS, -1, -1);
+   printf("device %d is %swrite protected\n", chipnr,
+   (nand_chip->read_byte(nand) & 0x80 ?
+   "NOT " : ""));
+   nand_chip->select_chip(nand, -1);
+   }

for (off = 0; off < nand->size; off += nand->erasesize) {
int s = nand_get_lock_status(nand, off);
==

Thanks & Best Regards,
Mason Yang 
Macronix International Co., Ltd


CONFIDENTIALITY NOTE:

This e-mail and any attachments may contain confidential information 
and/or personal data, which is protected by applicable laws. Please be 
reminded that duplication, disclosure, distribution, or use of this e-mail 
(and/or its attachments) or any part thereof is prohibited. If you receive 
this e-mail in error, please notify us immediately and delete this mail as 
well as its attachment(s) from your system. In addition, please be 
informed that collection, processing, and/or use of personal data is 
prohibited unless expressly permitted by personal data protection laws. 
Thank you for your attention and cooperation.

Macronix International Co., Ltd.

=





CONFIDENTIALITY NOTE:

This e-mail and any attachments may contain confidential information and/or 
personal data, which is protected by applicable laws. Please be reminded that 
duplication, disclosure, distribution, or use of this e-mail (and/or its 
attachments) or any part thereof is prohibited. If you receive this e-mail in 
error, please notify us immediately and delete this mail as well as its 
attachment(s) from your system. In addition, please be informed that 
collection, processing, and/or use of personal data is prohibited unless 
expressly permitted by personal data protection laws. Thank you for your 
attention and cooperation.

Macronix International Co., Ltd.

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


Re: [U-Boot] [PATCH 1/2] PCI: Add driver for a 'pci-host-ecam-generic' host controller

2017-09-01 Thread Tuomas Tynkkynen

Hi,

On 08/31/2017 09:51 AM, Bin Meng wrote:

Hi Tuomas,

On Wed, Aug 30, 2017 at 4:31 PM, Tuomas Tynkkynen
 wrote:

QEMU emulates such a device with '-machine virt,highmem=off' on ARM.
The 'highmem=off' part is required for things to work as the PCI code
in U-Boot doesn't seem to support 64-bit BARs.

This driver is basically a copy-paste of the Xilinx PCIE driver with the
Xilinx-specific bits removed and compatible string changed... The
generic code should probably be extracted into some sort of library
functions instead of duplicating them before committing this driver.

Signed-off-by: Tuomas Tynkkynen 
---
  drivers/pci/Kconfig |   8 ++
  drivers/pci/Makefile|   1 +
  drivers/pci/pcie_ecam_generic.c | 193 
  3 files changed, 202 insertions(+)
  create mode 100644 drivers/pci/pcie_ecam_generic.c

diff --git a/drivers/pci/Kconfig b/drivers/pci/Kconfig
index e2a1c0a409..745161fb9f 100644
--- a/drivers/pci/Kconfig
+++ b/drivers/pci/Kconfig
@@ -33,6 +33,14 @@ config PCI_PNP
 help
   Enable PCI memory and I/O space resource allocation and assignment.

+config PCIE_ECAM_GENERIC
+   bool "Generic PCI-E ECAM support"
+   default n


nits: default n is not needed as it is the default value



Seems I have copied from PCIE_DW_MVEBU below. Removed.


+   depends on DM_PCI
+   help
+ Say Y here if you want to enable support for generic ECAM-based
+ PCIe controllers, such as the one emulated by QEMU.
+
  config PCIE_DW_MVEBU
 bool "Enable Armada-8K PCIe driver (DesignWare core)"
 default n
diff --git a/drivers/pci/Makefile b/drivers/pci/Makefile
index ad44e83996..5eb12efbf5 100644
--- a/drivers/pci/Makefile
+++ b/drivers/pci/Makefile
@@ -17,6 +17,7 @@ obj-$(CONFIG_PCI) += pci.o pci_auto_old.o
  endif
  obj-$(CONFIG_PCI) += pci_auto_common.o pci_common.o

+obj-$(CONFIG_PCIE_ECAM_GENERIC) += pcie_ecam_generic.o
  obj-$(CONFIG_FSL_PCI_INIT) += fsl_pci_init.o
  obj-$(CONFIG_PCI_INDIRECT_BRIDGE) += pci_indirect.o
  obj-$(CONFIG_PCI_GT64120) += pci_gt64120.o
diff --git a/drivers/pci/pcie_ecam_generic.c b/drivers/pci/pcie_ecam_generic.c
new file mode 100644
index 00..039e378cb0
--- /dev/null
+++ b/drivers/pci/pcie_ecam_generic.c
@@ -0,0 +1,193 @@
+/*
+ * Generic PCIE host provided by e.g. QEMU
+ *
+ * Heavily based on drivers/pci/pcie_xilinx.c
+ *
+ * Copyright (C) 2016 Imagination Technologies
+ *
+ * SPDX-License-Identifier:GPL-2.0
+ */
+
+#include 
+#include 
+#include 
+
+#include 
+
+/**
+ * struct generic_ecam_pcie - generic_ecam PCIe controller state
+ * @hose: The parent classes PCI controller state
+ * @cfg_base: The base address of memory mapped configuration space
+ */
+struct generic_ecam_pcie {
+   struct pci_controller hose;


This sounds like a non-DM PCI driver stuff. I don't see it is
referenced in this driver.



Indeed, it appears to be leftover code also in the pcie_xilinx that I
copied from. Also a bunch of other drivers that have had a DM conversion
have this as leftovers. I will clean them up also.


+   void *cfg_base;
+};
+
+/**
+ * pcie_generic_ecam_config_address() - Calculate the address of a config 
access
+ * @pcie: Pointer to the PCI controller state
+ * @bdf: Identifies the PCIe device to access
+ * @offset: The offset into the device's configuration space
+ * @paddress: Pointer to the pointer to write the calculates address to
+ *
+ * Calculates the address that should be accessed to perform a PCIe
+ * configuration space access for a given device identified by the PCIe
+ * controller device @pcie and the bus, device & function numbers in @bdf. If
+ * access to the device is not valid then the function will return an error
+ * code. Otherwise the address to access will be written to the pointer pointed
+ * to by @paddress.
+ *
+ * Return: 0 on success, else -ENODEV


I see this driver always return 0.



Will fix the comment. I kept the same signature for config_address since 
I'm planning to have common parts of .write_config and .read_config 
abstracted (similar to pci_generic_config_{read,write} in Linux) instead 
of copy pasting the same code the 3rd time in U-Boot.



+ */
+static int pcie_generic_ecam_config_address(struct generic_ecam_pcie *pcie, 
pci_dev_t bdf,
+ uint offset, void **paddress)
+{
+   unsigned int bus = PCI_BUS(bdf);
+   unsigned int dev = PCI_DEV(bdf);
+   unsigned int func = PCI_FUNC(bdf);
+   void *addr;
+
+   addr = pcie->cfg_base;
+   addr += bus << 20;
+   addr += dev << 15;
+   addr += func << 12;
+   addr += offset;
+   *paddress = addr;
+
+   return 0;
+}
+
+/**
+ * pcie_generic_ecam_read_config() - Read from configuration space
+ * @pcie: Pointer to the PCI controller state


There is no pcie parameter, instead it's bus.



Again a problem inherited from pcie_xilinx... will fix there as well.


+ * @bdf: Identifies the PCIe device to

[U-Boot] Altera Arria10 socfpga image usage

2017-09-01 Thread Andre Renaud
Hi,
Is there a document somewhere describing how to program the Arria10 dev kit
with the u-boot-with-spl.sfp image? This is the image built from the 'next'
branch from http://git.denx.de/?p=u-boot/u-boot-socfpga.git using:
$ make socfpga_arria10_defconfig
$ make

The image is too large to be wrapped up using the Altera mkpimage tool:
$ mkpimage -hv 1 -o u-boot-mkpimage.bin u-boot-with-spl.sfp
Image size must not be more than alignment value of 256 kilobytes

So are the raw u-boot.bin or u-boot-dtb.bin

I've tried writing it either directly into the QSPI flash, onto the base of
an SD card, or into a partition tagged with type 'a2' on an SD card,
starting at sector 2048. None of these seem to work properly.

I am able to build & run the Altera supplied u-boot from https://
github.com/altera-opensource/u-boot-socfpga
,
branch socfpga_v2014.10_arria10_bringup.

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


[U-Boot] [PATCH 1/1] armv8: ls1012a: Memory Map modification of kernel, env

2017-09-01 Thread Bhaskar Upadhaya
This patch adjusts memory map for images on LS1012A
as per below memory map:
Image   Flash Offset
RCW+PBI 0x
Boot firmware (U-Boot)  0x0010
Boot firmware Environment   0x0030

Signed-off-by: Bhaskar Upadhaya 
---
 include/configs/ls1012a_common.h |  4 ++--
 include/configs/ls1012afrdm.h| 16 
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/include/configs/ls1012a_common.h b/include/configs/ls1012a_common.h
index 9d85341..458a6ad 100644
--- a/include/configs/ls1012a_common.h
+++ b/include/configs/ls1012a_common.h
@@ -65,7 +65,7 @@
 #define CONFIG_ENV_OVERWRITE
 
 #define CONFIG_ENV_SIZE0x4  /* 256KB */
-#define CONFIG_ENV_OFFSET  0x20/* 2MB */
+#define CONFIG_ENV_OFFSET  0x30/* 3MB */
 #define CONFIG_ENV_SECT_SIZE   0x4
 #endif
 
@@ -97,7 +97,7 @@
"kernel_addr=0x10\0"\
"fdt_high=0x\0" \
"initrd_high=0x\0"  \
-   "kernel_start=0xa0\0"   \
+   "kernel_start=0x100\0"  \
"kernel_load=0xa000\0"  \
"kernel_size=0x280\0"   \
 
diff --git a/include/configs/ls1012afrdm.h b/include/configs/ls1012afrdm.h
index 6b1ba57..8a9444d 100644
--- a/include/configs/ls1012afrdm.h
+++ b/include/configs/ls1012afrdm.h
@@ -22,14 +22,14 @@
 
 #undef CONFIG_EXTRA_ENV_SETTINGS
 #define CONFIG_EXTRA_ENV_SETTINGS  \
-   "verify=no\0"   \
-   "loadaddr=0x8010\0" \
-   "kernel_addr=0x10\0"\
-   "fdt_high=0x\0" \
-   "initrd_high=0x\0"  \
-   "kernel_start=0xa0\0"   \
-   "kernel_load=0x9600\0"  \
-   "kernel_size=0x280\0"
+   "verify=no\0"   \
+   "loadaddr=0x8010\0" \
+   "kernel_addr=0x10\0"\
+   "fdt_high=0x\0" \
+   "initrd_high=0x\0"  \
+   "kernel_start=0x100\0"   \
+   "kernel_load=0x9600\0"  \
+   "kernel_size=0x280\0"
 
 /*
 * USB
-- 
1.9.1

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


Re: [U-Boot] [PATCH 1/3] arm: dts: da850: Migrate da850-evm DTS files from Linux 4.13-RC5

2017-09-01 Thread Sekhar Nori
On Sunday 27 August 2017 01:46 AM, Adam Ford wrote:
> A few small additional items are needed to support DM_SPI and
> DM_SERIAL, so those were added to da850-evm-u-boot.dtsi
> 
> Signed-off-by: Adam Ford 
> ---
>  arch/arm/dts/da850-evm-u-boot.dtsi |  22 ++
>  arch/arm/dts/da850-evm.dts | 304 +++
>  arch/arm/dts/da850.dtsi| 581 
> +
>  arch/arm/dts/tps6507x.dtsi |  47 +++
>  4 files changed, 954 insertions(+)
> 
> diff --git a/arch/arm/dts/da850-evm-u-boot.dtsi 
> b/arch/arm/dts/da850-evm-u-boot.dtsi
> new file mode 100644
> index 000..516bc1d
> --- /dev/null
> +++ b/arch/arm/dts/da850-evm-u-boot.dtsi
> @@ -0,0 +1,22 @@
> +/*
> + * da850-evm U-Boot Additions
> + *
> + * Copyright (C) 2017 Logic PD, Inc.
> + * Copyright (C) Adam Ford
> + *
> + * SPDX-License-Identifier:  GPL-2.0+
> + */
> +
> +/ {
> + chosen {
> + stdout-path = &serial2;
> + };
> +
> + aliases {
> + spi0 = &spi1;
> + };
> +};

These look like useful for kernel too, can you please submit patches
adding them for kernel too?

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


[U-Boot] QSPI "sf probe ...", "sf read ..." on Altera SoC FPGA

2017-09-01 Thread Hannes Schmelzer

Hi Eldor,

just found your post in the mailinglist.

https://lists.denx.de/pipermail/u-boot/2016-December/276491.html

Reason why i'm searched there is, that i've now excactly same problem as 
you.






I'm using most current mainline u-boot.

did you ever found some solution for your trouble ?

cheers,
Hannes

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


Re: [U-Boot] [PATCH 1/1] usb: gadget: g_dnl: Use serial# variable to set g_dnl_serial

2017-09-01 Thread Sam Protsenko
On 1 September 2017 at 11:19, Marek Vasut  wrote:
> On 08/31/2017 08:20 PM, Sam Protsenko wrote:
>> Since 842778a09104 commit, "fastboot devices" stopped to show correct
>> device serial number for TI boards, showing this line instead:
>>
>>   fastboot
>>
>> This is because serial# env variable could be set after g_dnl gadget was
>> initialized (e.g. by using env_set() in the board file).
>>
>> To fix this, before checking g_dnl_serial, let's re-check if we have
>> valid serial# value. And if so, let's set it as g_dnl_serial value.
>>
>> Signed-off-by: Sam Protsenko 
>
> Can't we use U_BOOT_ENV_CALLBACK() here instead and set the serial
> number when the environment variable is set ?
>

Good point. I've tested this approach and it works fine. Will resend
v2 shortly. Thanks for the hint!

>> ---
>>  drivers/usb/gadget/g_dnl.c | 9 +
>>  1 file changed, 9 insertions(+)
>>
>> diff --git a/drivers/usb/gadget/g_dnl.c b/drivers/usb/gadget/g_dnl.c
>> index 0491a0eea9..e4d0289757 100644
>> --- a/drivers/usb/gadget/g_dnl.c
>> +++ b/drivers/usb/gadget/g_dnl.c
>> @@ -226,6 +226,15 @@ static int g_dnl_bind(struct usb_composite_dev *cdev)
>>
>>   g_dnl_bind_fixup(&device_desc, cdev->driver->name);
>>
>> + /* First try to obtain serial number from serial# variable */
>> + if (strlen(g_dnl_serial) == 0) {
>> + const char *s;
>> +
>> + s = env_get("serial#");
>> + if (s)
>> + g_dnl_set_serialnumber((char *)s);
>> + }
>> +
>>   if (strlen(g_dnl_serial)) {
>>   id = usb_string_id(cdev);
>>   if (id < 0)
>>
>
>
> --
> Best regards,
> Marek Vasut
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v2 1/1] usb: gadget: g_dnl: Sync internal SN variable with env

2017-09-01 Thread Sam Protsenko
Since commit 842778a09104 ("usb: gadget: g_dnl: only set iSerialNumber
if we have a serial#") "fastboot devices" stopped to show correct device
serial number for TI boards, showing this line instead:

fastboot

This is because serial# env variable could be set after g_dnl gadget was
initialized (e.g. by using env_set() in the board file).

To fix this, let's update internal serial number variable (g_dnl_serial)
when "serial#" env var is changed.

Signed-off-by: Sam Protsenko 
Cc: Felipe Balbi 
---
 drivers/usb/gadget/g_dnl.c | 24 
 include/env_callback.h |  1 +
 2 files changed, 25 insertions(+)

diff --git a/drivers/usb/gadget/g_dnl.c b/drivers/usb/gadget/g_dnl.c
index 0491a0eea9..1a9f075485 100644
--- a/drivers/usb/gadget/g_dnl.c
+++ b/drivers/usb/gadget/g_dnl.c
@@ -19,6 +19,8 @@
 #include 
 #include 
 
+#include 
+
 #include "gadget_chips.h"
 #include "composite.c"
 
@@ -202,6 +204,28 @@ static int g_dnl_get_bcd_device_number(struct 
usb_composite_dev *cdev)
return g_dnl_get_board_bcd_device_number(gcnum);
 }
 
+/**
+ * Update internal serial number variable when the "serial#" env var changes.
+ *
+ * Handle all cases, including when flags == H_PROGRAMMATIC.
+ */
+static int on_serialno(const char *name, const char *value, enum env_op op,
+   int flags)
+{
+   switch (op) {
+   case env_op_create:
+   /* Fall through */
+   case env_op_overwrite:
+   g_dnl_set_serialnumber((char *)value);
+   break;
+   default:
+   break;
+   }
+
+   return 0;
+}
+U_BOOT_ENV_CALLBACK(serialno, on_serialno);
+
 static int g_dnl_bind(struct usb_composite_dev *cdev)
 {
struct usb_gadget *gadget = cdev->gadget;
diff --git a/include/env_callback.h b/include/env_callback.h
index 90b95b5e66..5c4a30c2de 100644
--- a/include/env_callback.h
+++ b/include/env_callback.h
@@ -72,6 +72,7 @@
SILENT_CALLBACK \
SPLASHIMAGE_CALLBACK \
"stdin:console,stdout:console,stderr:console," \
+   "serial#:serialno," \
CONFIG_ENV_CALLBACK_LIST_STATIC
 
 struct env_clbk_tbl {
-- 
2.14.1

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


Re: [U-Boot] [PATCH 1/1] usb: gadget: g_dnl: Use serial# variable to set g_dnl_serial

2017-09-01 Thread Sam Protsenko
On 1 September 2017 at 14:58, Sam Protsenko  wrote:
> On 1 September 2017 at 11:19, Marek Vasut  wrote:
>> On 08/31/2017 08:20 PM, Sam Protsenko wrote:
>>> Since 842778a09104 commit, "fastboot devices" stopped to show correct
>>> device serial number for TI boards, showing this line instead:
>>>
>>>   fastboot
>>>
>>> This is because serial# env variable could be set after g_dnl gadget was
>>> initialized (e.g. by using env_set() in the board file).
>>>
>>> To fix this, before checking g_dnl_serial, let's re-check if we have
>>> valid serial# value. And if so, let's set it as g_dnl_serial value.
>>>
>>> Signed-off-by: Sam Protsenko 
>>
>> Can't we use U_BOOT_ENV_CALLBACK() here instead and set the serial
>> number when the environment variable is set ?
>>
>
> Good point. I've tested this approach and it works fine. Will resend
> v2 shortly. Thanks for the hint!
>

Sent v2, using U_BOOT_ENV_CALLBACK: [1]. Guys, please review.

[1] https://lists.denx.de/pipermail/u-boot/2017-September/304460.html

>>> ---
>>>  drivers/usb/gadget/g_dnl.c | 9 +
>>>  1 file changed, 9 insertions(+)
>>>
>>> diff --git a/drivers/usb/gadget/g_dnl.c b/drivers/usb/gadget/g_dnl.c
>>> index 0491a0eea9..e4d0289757 100644
>>> --- a/drivers/usb/gadget/g_dnl.c
>>> +++ b/drivers/usb/gadget/g_dnl.c
>>> @@ -226,6 +226,15 @@ static int g_dnl_bind(struct usb_composite_dev *cdev)
>>>
>>>   g_dnl_bind_fixup(&device_desc, cdev->driver->name);
>>>
>>> + /* First try to obtain serial number from serial# variable */
>>> + if (strlen(g_dnl_serial) == 0) {
>>> + const char *s;
>>> +
>>> + s = env_get("serial#");
>>> + if (s)
>>> + g_dnl_set_serialnumber((char *)s);
>>> + }
>>> +
>>>   if (strlen(g_dnl_serial)) {
>>>   id = usb_string_id(cdev);
>>>   if (id < 0)
>>>
>>
>>
>> --
>> Best regards,
>> Marek Vasut
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH] sunxi: Change SUNXI_GMAC to SUN7I_GMAC in sources

2017-09-01 Thread Mark Kettenis
> From: Lionel Koenig 
> Date: Thu, 31 Aug 2017 19:21:01 +0200
> 
> Following 4d43d065db3262f9a9918ba72457bf36dfb8e0bb,
> SUNXI_GMAC was still used to configure the code while
> SUN7I_GMAC was used in the configuration tools.
> 
> Signed-off-by: Lionel Koenig 

Reviewed-by: Mark Kettenis 

This is fixes an annoying regression in on Allwinner A20 boards.  So
it would be good if this can be fixed ASAP.

> ---
>  arch/arm/include/asm/arch-sunxi/sys_proto.h | 2 +-
>  board/sunxi/Makefile| 2 +-
>  include/configs/sunxi-common.h  | 2 +-
>  scripts/build-whitelist.sh  | 4 ++--
>  scripts/config_whitelist.txt| 2 +-
>  5 files changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/arch/arm/include/asm/arch-sunxi/sys_proto.h 
> b/arch/arm/include/asm/arch-sunxi/sys_proto.h
> index a373319a2b..096510b787 100644
> --- a/arch/arm/include/asm/arch-sunxi/sys_proto.h
> +++ b/arch/arm/include/asm/arch-sunxi/sys_proto.h
> @@ -24,7 +24,7 @@ void sdelay(unsigned long);
>  void return_to_fel(uint32_t lr, uint32_t sp);
>  
>  /* Board / SoC level designware gmac init */
> -#if !defined CONFIG_SPL_BUILD && defined CONFIG_SUNXI_GMAC
> +#if !defined CONFIG_SPL_BUILD && defined CONFIG_SUN7I_GMAC
>  void eth_init_board(void);
>  #else
>  static inline void eth_init_board(void) {}
> diff --git a/board/sunxi/Makefile b/board/sunxi/Makefile
> index f4411f01c3..526cb72a51 100644
> --- a/board/sunxi/Makefile
> +++ b/board/sunxi/Makefile
> @@ -9,7 +9,7 @@
>  # SPDX-License-Identifier:   GPL-2.0+
>  #
>  obj-y+= board.o
> -obj-$(CONFIG_SUNXI_GMAC) += gmac.o
> +obj-$(CONFIG_SUN7I_GMAC) += gmac.o
>  ifndef CONFIG_SPL_BUILD
>  obj-$(CONFIG_SUNXI_AHCI) += ahci.o
>  endif
> diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h
> index 212862acd1..1373b1f037 100644
> --- a/include/configs/sunxi-common.h
> +++ b/include/configs/sunxi-common.h
> @@ -294,7 +294,7 @@ extern int soft_i2c_gpio_scl;
>  #define CONFIG_MII   /* MII PHY management   */
>  #endif
>  
> -#ifdef CONFIG_SUNXI_GMAC
> +#ifdef CONFIG_SUN7I_GMAC
>  #define CONFIG_PHY_ADDR  1
>  #define CONFIG_MII   /* MII PHY management   */
>  #define CONFIG_PHY_REALTEK
> diff --git a/scripts/build-whitelist.sh b/scripts/build-whitelist.sh
> index 7d8160d5f2..6feb9b67cf 100755
> --- a/scripts/build-whitelist.sh
> +++ b/scripts/build-whitelist.sh
> @@ -13,10 +13,10 @@ export LC_ALL=C LC_COLLATE=C
>  # There are two independent greps. The first pulls out the component parts
>  # of CONFIG_SYS_EXTRA_OPTIONS. An example is:
>  #
> -#SUNXI_GMAC,AHCI,SATAPWR=SUNXI_GPB(8)
> +#SUN7I_GMAC,AHCI,SATAPWR=SUNXI_GPB(8)
>  #
>  # We want this to produce:
> -#CONFIG_SUNXI_GMAC
> +#CONFIG_SUN7I_GMAC
>  #CONFIG_AHCI
>  #CONFIG_SATAPWR
>  #
> diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt
> index d8710958a3..19416dddca 100644
> --- a/scripts/config_whitelist.txt
> +++ b/scripts/config_whitelist.txt
> @@ -2307,7 +2307,7 @@ CONFIG_STV0991_HZ_CLOCK
>  CONFIG_ST_SMI
>  CONFIG_SUNXI_AHCI
>  CONFIG_SUNXI_EMAC
> -CONFIG_SUNXI_GMAC
> +CONFIG_SUN7I_GMAC
>  CONFIG_SUNXI_GPIO
>  CONFIG_SUNXI_MAX_FB_SIZE
>  CONFIG_SUNXI_USB_PHYS
> -- 
> 2.14.1
> 
> ___
> U-Boot mailing list
> U-Boot@lists.denx.de
> https://lists.denx.de/listinfo/u-boot
> 
> 
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 1/3] arm: dts: da850: Migrate da850-evm DTS files from Linux 4.13-RC5

2017-09-01 Thread Adam Ford
On Fri, Sep 1, 2017 at 6:34 AM, Sekhar Nori  wrote:
> On Sunday 27 August 2017 01:46 AM, Adam Ford wrote:
>> A few small additional items are needed to support DM_SPI and
>> DM_SERIAL, so those were added to da850-evm-u-boot.dtsi
>>
>> Signed-off-by: Adam Ford 
>> ---
>>  arch/arm/dts/da850-evm-u-boot.dtsi |  22 ++
>>  arch/arm/dts/da850-evm.dts | 304 +++
>>  arch/arm/dts/da850.dtsi| 581 
>> +
>>  arch/arm/dts/tps6507x.dtsi |  47 +++
>>  4 files changed, 954 insertions(+)
>>
>> diff --git a/arch/arm/dts/da850-evm-u-boot.dtsi 
>> b/arch/arm/dts/da850-evm-u-boot.dtsi
>> new file mode 100644
>> index 000..516bc1d
>> --- /dev/null
>> +++ b/arch/arm/dts/da850-evm-u-boot.dtsi
>> @@ -0,0 +1,22 @@
>> +/*
>> + * da850-evm U-Boot Additions
>> + *
>> + * Copyright (C) 2017 Logic PD, Inc.
>> + * Copyright (C) Adam Ford
>> + *
>> + * SPDX-License-Identifier:  GPL-2.0+
>> + */
>> +
>> +/ {
>> + chosen {
>> + stdout-path = &serial2;
>> + };
>> +
>> + aliases {
>> + spi0 = &spi1;
>> + };
>> +};
>
> These look like useful for kernel too, can you please submit patches
> adding them for kernel too?

I will do that.

>
> Thanks,

No problem.

> Sekhar

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


Re: [U-Boot] [PATCH v2 1/1] usb: gadget: g_dnl: Sync internal SN variable with env

2017-09-01 Thread Sam Protsenko
On 1 September 2017 at 15:00, Sam Protsenko  wrote:
> Since commit 842778a09104 ("usb: gadget: g_dnl: only set iSerialNumber
> if we have a serial#") "fastboot devices" stopped to show correct device
> serial number for TI boards, showing this line instead:
>
> fastboot
>
> This is because serial# env variable could be set after g_dnl gadget was
> initialized (e.g. by using env_set() in the board file).
>
> To fix this, let's update internal serial number variable (g_dnl_serial)
> when "serial#" env var is changed.
>
> Signed-off-by: Sam Protsenko 
> Cc: Felipe Balbi 
> ---
>  drivers/usb/gadget/g_dnl.c | 24 
>  include/env_callback.h |  1 +
>  2 files changed, 25 insertions(+)
>
> diff --git a/drivers/usb/gadget/g_dnl.c b/drivers/usb/gadget/g_dnl.c
> index 0491a0eea9..1a9f075485 100644
> --- a/drivers/usb/gadget/g_dnl.c
> +++ b/drivers/usb/gadget/g_dnl.c
> @@ -19,6 +19,8 @@
>  #include 
>  #include 
>
> +#include 
> +
>  #include "gadget_chips.h"
>  #include "composite.c"
>
> @@ -202,6 +204,28 @@ static int g_dnl_get_bcd_device_number(struct 
> usb_composite_dev *cdev)
> return g_dnl_get_board_bcd_device_number(gcnum);
>  }
>
> +/**
> + * Update internal serial number variable when the "serial#" env var changes.
> + *
> + * Handle all cases, including when flags == H_PROGRAMMATIC.
> + */
> +static int on_serialno(const char *name, const char *value, enum env_op op,
> +   int flags)
> +{
> +   switch (op) {
> +   case env_op_create:
> +   /* Fall through */
> +   case env_op_overwrite:
> +   g_dnl_set_serialnumber((char *)value);
> +   break;
> +   default:
> +   break;
> +   }
> +
> +   return 0;
> +}
> +U_BOOT_ENV_CALLBACK(serialno, on_serialno);
> +
>  static int g_dnl_bind(struct usb_composite_dev *cdev)
>  {
> struct usb_gadget *gadget = cdev->gadget;
> diff --git a/include/env_callback.h b/include/env_callback.h
> index 90b95b5e66..5c4a30c2de 100644
> --- a/include/env_callback.h
> +++ b/include/env_callback.h
> @@ -72,6 +72,7 @@
> SILENT_CALLBACK \
> SPLASHIMAGE_CALLBACK \
> "stdin:console,stdout:console,stderr:console," \
> +   "serial#:serialno," \
> CONFIG_ENV_CALLBACK_LIST_STATIC
>
>  struct env_clbk_tbl {
> --
> 2.14.1
>

Please ignore this patch. It doesn't handle the env_op_delete event.
Will send v3 soon.
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v3 1/1] usb: gadget: g_dnl: Sync internal SN variable with env

2017-09-01 Thread Sam Protsenko
Since commit 842778a09104 ("usb: gadget: g_dnl: only set iSerialNumber
if we have a serial#") "fastboot devices" stopped to show correct device
serial number for TI boards, showing this line instead:

fastboot

This is because serial# env variable could be set after g_dnl gadget was
initialized (e.g. by using env_set() in the board file).

To fix this, let's update internal serial number variable (g_dnl_serial)
when "serial#" env var is changed.

Signed-off-by: Sam Protsenko 
Cc: Felipe Balbi 
---
 drivers/usb/gadget/g_dnl.c | 15 +++
 include/env_callback.h |  1 +
 2 files changed, 16 insertions(+)

diff --git a/drivers/usb/gadget/g_dnl.c b/drivers/usb/gadget/g_dnl.c
index 0491a0eea9..039331a5af 100644
--- a/drivers/usb/gadget/g_dnl.c
+++ b/drivers/usb/gadget/g_dnl.c
@@ -19,6 +19,8 @@
 #include 
 #include 
 
+#include 
+
 #include "gadget_chips.h"
 #include "composite.c"
 
@@ -202,6 +204,19 @@ static int g_dnl_get_bcd_device_number(struct 
usb_composite_dev *cdev)
return g_dnl_get_board_bcd_device_number(gcnum);
 }
 
+/**
+ * Update internal serial number variable when the "serial#" env var changes.
+ *
+ * Handle all cases, even when flags == H_PROGRAMMATIC or op == env_op_delete.
+ */
+static int on_serialno(const char *name, const char *value, enum env_op op,
+   int flags)
+{
+   g_dnl_set_serialnumber((char *)value);
+   return 0;
+}
+U_BOOT_ENV_CALLBACK(serialno, on_serialno);
+
 static int g_dnl_bind(struct usb_composite_dev *cdev)
 {
struct usb_gadget *gadget = cdev->gadget;
diff --git a/include/env_callback.h b/include/env_callback.h
index 90b95b5e66..5c4a30c2de 100644
--- a/include/env_callback.h
+++ b/include/env_callback.h
@@ -72,6 +72,7 @@
SILENT_CALLBACK \
SPLASHIMAGE_CALLBACK \
"stdin:console,stdout:console,stderr:console," \
+   "serial#:serialno," \
CONFIG_ENV_CALLBACK_LIST_STATIC
 
 struct env_clbk_tbl {
-- 
2.14.1

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


Re: [U-Boot] [PATCH 00/23] efi_loader implement missing functions

2017-09-01 Thread Rob Clark
On Thu, Aug 31, 2017 at 10:45 AM, Leif Lindholm
 wrote:
> On Wed, Aug 30, 2017 at 08:59:31AM +0100, Leif Lindholm wrote:
>> On Wed, Aug 30, 2017 at 12:03:16AM +0200, Heinrich Schuchardt wrote:
>> > I am able to provide a test application that will cover the API
>> > functions that I have focused on (events, protocols, (dis)connect
>> > controllers). To limit my effort I would like to write it for the HEAD
>> > of my patch queue and not break it down into one test patch per
>> > implementation patch. I hope that is ok for you. My effort estimate is
>> > 40h+ so, please, be patient.
>>
>> I am not going to claim that getting SCT to run under U-Boot is going
>> to come near the top of my priority queue any time soon, and it would
>> certainly be useful for some sort of "make sure we don't break what we
>> have" tests.
>
> Well, I spent a few hours looking at what the immediate issues may be
> with running the UEFI Shell (built with -D NO_SHELL_PROFILES), same as
> edk2/ShellBinPkg/MinUefiShell. Alex suggested I post an update.
>
> I've implemented stubs for the missing protocols preventing the Shell
> from starting properly, and pushed everything to
> https://git.linaro.org/people/leif.lindholm/u-boot.git/log/?h=uefi-shell

from a quick look, at least we have part of the under-the-hood bits
for "efi_loader: add stub EFI_DEVICE_PATH_UTILITIES_PROTOCOL" in:

https://github.com/robclark/u-boot/commit/a00519e2fa7b716dda717a24799a0629d42eb362

I can take a stab at fleshing this one out over the weekend..

BR,
-R

> (As Alex points out, I forgot about the EFI_EXIT/EFI_ENTER macros.)
>
> With this, execution fails with
> Found 2 disks
> new_package_list: 99
>
> ASSERT_EFI_ERROR (Status = Device Error)
> ASSERT [Shell]
> /work/git/edk2/Build/Shell/DEBUG_GCC5/AARCH64/ShellPkg/Application/Shell/Shell/DEBUG/AutoGen.c(615):
> !EFI_ERROR (Status)
> "Synchronous Abort" handler, esr 0x5600dbdb
>
> The AutoGen.c failure is a library constructor
> (ShellLevel2CommandsLibConstructor) returning error because
> MdeModulePkg/Library/UefiHiiLib/HiiLib.c : HiiAddPackages() received
> an error return from new_package_list (in the non-camel-case u-boot
> form).
>
> If you could look into implementing something useful in that function,
> I could look into what causes the next stumbling block after that.
>
> I did overrun the "maximum number of open protocols" limit, so
> randomly bumped that up to 12. It will need to go higher (and
> preferably dynamic). As long as we're not planning to support
> protocols staying around at runtime, I'd say that shouldn't be too
> hard to resolve properly.
>
> I have pushed an update to the pre-built versions of UEFI Shell in edk2:
> https://github.com/tianocore/edk2/tree/master/ShellBinPkg/MinUefiShell
> These are built without ASSERTs, so won't actually give the above
> messages, but should otherwise be identical to the one I've used here.
>
> /
> Leif
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 00/23] efi_loader implement missing functions

2017-09-01 Thread Rob Clark
On Thu, Aug 31, 2017 at 10:45 AM, Leif Lindholm
 wrote:
> On Wed, Aug 30, 2017 at 08:59:31AM +0100, Leif Lindholm wrote:
>> On Wed, Aug 30, 2017 at 12:03:16AM +0200, Heinrich Schuchardt wrote:
>> > I am able to provide a test application that will cover the API
>> > functions that I have focused on (events, protocols, (dis)connect
>> > controllers). To limit my effort I would like to write it for the HEAD
>> > of my patch queue and not break it down into one test patch per
>> > implementation patch. I hope that is ok for you. My effort estimate is
>> > 40h+ so, please, be patient.
>>
>> I am not going to claim that getting SCT to run under U-Boot is going
>> to come near the top of my priority queue any time soon, and it would
>> certainly be useful for some sort of "make sure we don't break what we
>> have" tests.
>
> Well, I spent a few hours looking at what the immediate issues may be
> with running the UEFI Shell (built with -D NO_SHELL_PROFILES), same as
> edk2/ShellBinPkg/MinUefiShell. Alex suggested I post an update.
>
> I've implemented stubs for the missing protocols preventing the Shell
> from starting properly, and pushed everything to
> https://git.linaro.org/people/leif.lindholm/u-boot.git/log/?h=uefi-shell

from a quick look, at least we have part of the under-the-hood bits
for "efi_loader: add stub EFI_DEVICE_PATH_UTILITIES_PROTOCOL" in:

https://github.com/robclark/u-boot/commit/a00519e2fa7b716dda717a24799a0629d42eb362

I can take a stab at fleshing this one out over the weekend..

BR,
-R

> (As Alex points out, I forgot about the EFI_EXIT/EFI_ENTER macros.)
>
> With this, execution fails with
> Found 2 disks
> new_package_list: 99
>
> ASSERT_EFI_ERROR (Status = Device Error)
> ASSERT [Shell]
> /work/git/edk2/Build/Shell/DEBUG_GCC5/AARCH64/ShellPkg/Application/Shell/Shell/DEBUG/AutoGen.c(615):
> !EFI_ERROR (Status)
> "Synchronous Abort" handler, esr 0x5600dbdb
>
> The AutoGen.c failure is a library constructor
> (ShellLevel2CommandsLibConstructor) returning error because
> MdeModulePkg/Library/UefiHiiLib/HiiLib.c : HiiAddPackages() received
> an error return from new_package_list (in the non-camel-case u-boot
> form).
>
> If you could look into implementing something useful in that function,
> I could look into what causes the next stumbling block after that.
>
> I did overrun the "maximum number of open protocols" limit, so
> randomly bumped that up to 12. It will need to go higher (and
> preferably dynamic). As long as we're not planning to support
> protocols staying around at runtime, I'd say that shouldn't be too
> hard to resolve properly.
>
> I have pushed an update to the pre-built versions of UEFI Shell in edk2:
> https://github.com/tianocore/edk2/tree/master/ShellBinPkg/MinUefiShell
> These are built without ASSERTs, so won't actually give the above
> messages, but should otherwise be identical to the one I've used here.
>
> /
> Leif
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [ANN] U-Boot v2017.09-rc3 released

2017-09-01 Thread Tom Rini
On Tue, Aug 29, 2017 at 02:44:07PM +1000, Jonathan Gray wrote:
> On Mon, Aug 28, 2017 at 10:56:52PM -0400, Tom Rini wrote:
> > Hey all,
> > 
> > It's release day and v2017.09-rc3 is out.  I think there's still a few
> > outstanding important bugfixes that need to come in, and probably a few
> > more Kconfig migrations as well.
> 
> The tag/changes not pushed to git yet?

Yeah, nothing like doing a release while traveling, forgetting
something, and then having your ISP re-IP everyone in your area
apparently overnight so you can't get back home.  So, yes, the release
has been on FTP (since my script takes care of that first), but I forgot
to enter the rest of my credentials so that git would be updated too.

> > If anyone has critical fixes I've missed please speak up.  I think I've
> > got an idea on what they are but never the less, better to speak up now
> > than assume i saw it.
> 
> Ethernet is broken on Allwinner A20 without some variation of
> https://patchwork.ozlabs.org/patch/793903/
> but the original submitter hasn't sent a revised diff.

Hmm, ok.  I'll follow up, thanks!

-- 
Tom


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


Re: [U-Boot] [PATCH] mmc: sunxi: Only update timing mode bit when enabling new timing mode

2017-09-01 Thread Jagan Teki
On Thu, Aug 31, 2017 at 7:36 PM, Jagan Teki  wrote:
> On Thu, Aug 31, 2017 at 7:34 PM, Maxime Ripard
>  wrote:
>> On Thu, Aug 31, 2017 at 09:57:48PM +0800, Chen-Yu Tsai wrote:
>>> When enabling the new mmc timing mode, we inadvertently clear all the
>>> remaining bits in the new timing mode register. The bits cleared
>>> include a default phase delay on the output clock. The BSP kernel
>>> states that the default values are supposed to be used. Clearing them
>>> results in decreased performance or transfer errors on some boards.
>>>
>>> Fixes: de9b1771c3b6 ("mmc: sunxi: Support new mode")
>>> Signed-off-by: Chen-Yu Tsai 
>>
>> Acked-by: Maxime Ripard 
>
> Reviewed-by: Jagan Teki 

Applied to u-boot-sunxi/master

thanks!
-- 
Jagan Teki
Free Software Engineer | www.openedev.com
U-Boot, Linux | Upstream Maintainer
Hyderabad, India.
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] DA850evm SPI Flash Partitions between Linux and U-boot are Inconsistent

2017-09-01 Thread Sekhar Nori
Hi Adam,

On Wednesday 30 August 2017 04:07 PM, Adam Ford wrote:
> On Wed, Aug 30, 2017 at 12:30 AM, Sekhar Nori  wrote:
>> On Wednesday 30 August 2017 08:07 AM, Adam Ford wrote:
>>> On Tue, Aug 29, 2017 at 8:05 AM, Adam Ford  wrote:
 On Tue, Aug 29, 2017 at 6:41 AM, Sekhar Nori  wrote:
> On Tuesday 29 August 2017 03:29 PM, Adam Ford wrote:
>> On Tue, Aug 29, 2017 at 4:13 AM, Sekhar Nori  wrote:
>>> Hi Adam,
>>>
>>> On Sunday 27 August 2017 08:31 PM, Adam Ford wrote:
 I was trying to enable MTD Partitions to make loading the Kernel and
 FS easier from within U-Boot

 The da850evm spi-flash partitions in Linux show

 "U-Boot-SPL" @ offset 0, size 64K
 "U-Boot"; @ offset 0x0001, size 512K
 "U-Boot-Env"; @ offset 0x0009
>>>
>>> According to board/davinci/da8xxevm/README.da850, we support AIS image
>>> format for SPI boot. This is a single image containing SPL and U-Boot.
>>>
>>> Given this, I think having separate partitions for SPL and U-Boot does
>>> not make sense since thats not how its going to be used.
>>
>> That's what I was thinking too, but I wasn't sure if someone had split
>> SPL somehow to make it possible to update U-Boot via Linux or U-Boot
>> itself.
>>>

 However U-Boot shows the following:

 CONFIG_SYS_SPI_U_BOOT_OFFS 0x8000 which would make the SPL partition 
 32K.
 CONFIG_SYS_SPI_U_BOOT_SIZE  0x4 and the size of U-boot 256K
 instead of 512k.

 CONFIG_ENV_SIZE (64 << 10)
 CONFIG_ENV_OFFSET   (512 << 10) which is 0x8 instead of
 Linux's 0x9

 It seems to me like the U-Boot and Linux should try and synchronize
 their partitions tables.
>>>
>>> Right.
>>>
 For people who want to burn Linux into the SPI flash it seems there
 there should be some consistency.  I tried making the U-boot settings
 match the Linux ones, but it seems to hang between SPL and U-Boot, so
 I think the U-Boot offset in Linux might need to match U-Boot.  Can
 you guys make some recomendations as to which is correct?
>>>
>>> I have not tried it, but looks like the partitions we need are
>>>
>>> "SPL/U-Boot AIS" @ offset 0, size 512K
>>> "U-Boot Environment" @ offset 512K, size 64K
>>
>> I was thinking the same thing.
>>
>>> "Kernel/Spare" @ offset 576K, size 7552K
>>> "Mac Address" @ offset 8128K, size 64K (read only)
>>
>> If U-Boot reads the MAC address from its environmental variables
>> instead of using up an entire 64K for what conceivably is 6 bytes,
>> could we free up this space to help grow the Kernel/Spare space?
>
> If environment sector is erased, the mac address needs to be restored
> from SPI flash. Thats why I think it needs to remain as a read-only
> partition. Also, its just 64K more space, not sure if it will make a big
> difference in the overall scheme of things.
>
>>> With an 8M flash, I think its futile to try to fit a modern filesystem
>>> on the flash.
>>>
>>> If you are using DT boot, we cannot really change the partitions in
>>> device-tree because of DT backward-compatibility requirements. But we
>>> can fix da850evm_spiflash_part[] table in
>>> arch/arm/mach-davinci/board-da850-evm.c.
>>
>> Wouldn't having two different partition tables between da850-evm.c and
>> the DT cause confusion down the road?  With DT being the future, why
>> would we not try to eliminate any custom board files with just a
>> single common davinci board file + board specific DT?
>
> Thats ideal yes. But there is a lot of support in the da850-evm board
> file which does not have a DT equivalent yet. Thats why I have kept the
> board file around.
>
>>> To help DT boot, we can pass fixed up mtdparts through environment
>>> variables. Something like what is done in 3f18ff07c81b ("ARM: keystone:
>>> Pass SPI MTD partition table via kernel command line").
>>
>> This was ultimately was I was wanting to do.  For some of the OMAP3
>> boards, removing the partition tree was accepted since the partition
>> info was passed to the kernel.  If we did this for DA850, we could
>> simply elimiate the partition info in the Kernel (like some of the
>> omap3 boards) and let the partition maps be defined by U-Boot would
>> would guarantee consistency between them.
>
> Actually, thinking a bit more, we cannot change the partition
> information in kernel at all since that means loss of data for anyone
> updating just the kernel.
>
> We can however, pass updated kernel command line arguments in U-Boot so
> anyone updating the bootloader and erasing the environment sector gets
> updated partit

[U-Boot] [PATCH 1/5] pci: xilinx: Fix doc comments on config space accessors

2017-09-01 Thread Tuomas Tynkkynen
These take the 'struct udevice *' as an argument, not the
'struct xilinx_pcie *` which is a local variable. Fix the comments to
match the code.

Signed-off-by: Tuomas Tynkkynen 
---
 drivers/pci/pcie_xilinx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/pci/pcie_xilinx.c b/drivers/pci/pcie_xilinx.c
index 08e2e93445..e31ba8bd51 100644
--- a/drivers/pci/pcie_xilinx.c
+++ b/drivers/pci/pcie_xilinx.c
@@ -87,7 +87,7 @@ static int pcie_xilinx_config_address(struct xilinx_pcie 
*pcie, pci_dev_t bdf,
 
 /**
  * pcie_xilinx_read_config() - Read from configuration space
- * @pcie: Pointer to the PCI controller state
+ * @bus: Pointer to the PCI bus
  * @bdf: Identifies the PCIe device to access
  * @offset: The offset into the device's configuration space
  * @valuep: A pointer at which to store the read value
@@ -130,7 +130,7 @@ static int pcie_xilinx_read_config(struct udevice *bus, 
pci_dev_t bdf,
 
 /**
  * pcie_xilinx_write_config() - Write to configuration space
- * @pcie: Pointer to the PCI controller state
+ * @bus: Pointer to the PCI bus
  * @bdf: Identifies the PCIe device to access
  * @offset: The offset into the device's configuration space
  * @value: The value to write
-- 
2.13.0

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


[U-Boot] [PATCH 2/5] pci: xilinx: Remove unused field 'hose' from struct xilinx_pcie

2017-09-01 Thread Tuomas Tynkkynen
This field has never been used as the driver has been DM-based since the
beginning. Drop it.

Signed-off-by: Tuomas Tynkkynen 
---
 drivers/pci/pcie_xilinx.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/pci/pcie_xilinx.c b/drivers/pci/pcie_xilinx.c
index e31ba8bd51..4ba32df516 100644
--- a/drivers/pci/pcie_xilinx.c
+++ b/drivers/pci/pcie_xilinx.c
@@ -14,11 +14,9 @@
 
 /**
  * struct xilinx_pcie - Xilinx PCIe controller state
- * @hose: The parent classes PCI controller state
  * @cfg_base: The base address of memory mapped configuration space
  */
 struct xilinx_pcie {
-   struct pci_controller hose;
void *cfg_base;
 };
 
-- 
2.13.0

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


[U-Boot] [PATCH 5/5] pci: Remove unnecessary 'default n' from Kconfig

2017-09-01 Thread Tuomas Tynkkynen
'default n' is the default anyway so it doesn't need to be specified
explicitly, and the rest of the file doesn't specify it either anywhere.
Drop it.

Signed-off-by: Tuomas Tynkkynen 
---
 drivers/pci/Kconfig | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/pci/Kconfig b/drivers/pci/Kconfig
index e2a1c0a409..8af2470268 100644
--- a/drivers/pci/Kconfig
+++ b/drivers/pci/Kconfig
@@ -35,7 +35,6 @@ config PCI_PNP
 
 config PCIE_DW_MVEBU
bool "Enable Armada-8K PCIe driver (DesignWare core)"
-   default n
depends on DM_PCI
depends on ARMADA_8K
help
-- 
2.13.0

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


[U-Boot] [PATCH 4/5] pci: layerscape: Remove unused field 'hose' from struct ls_pcie

2017-09-01 Thread Tuomas Tynkkynen
This field is no longer used since the DM conversion. Drop it.

Signed-off-by: Tuomas Tynkkynen 
---
 drivers/pci/pcie_layerscape.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/pci/pcie_layerscape.h b/drivers/pci/pcie_layerscape.h
index 782e3ab7ad..3a6cecb07d 100644
--- a/drivers/pci/pcie_layerscape.h
+++ b/drivers/pci/pcie_layerscape.h
@@ -145,7 +145,6 @@ struct ls_pcie {
bool big_endian;
bool enabled;
int next_lut_index;
-   struct pci_controller hose;
 };
 
 extern struct list_head ls_pcie_list;
-- 
2.13.0

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


[U-Boot] [PATCH 3/5] pci: tegra: Remove unused field 'hose' from struct tegra_pcie

2017-09-01 Thread Tuomas Tynkkynen
This field is no longer used since the DM conversion. Drop it.

Signed-off-by: Tuomas Tynkkynen 
---
 drivers/pci/pci_tegra.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/pci/pci_tegra.c b/drivers/pci/pci_tegra.c
index cb5cf8b043..7d920d423d 100644
--- a/drivers/pci/pci_tegra.c
+++ b/drivers/pci/pci_tegra.c
@@ -218,8 +218,6 @@ struct tegra_pcie_soc {
 };
 
 struct tegra_pcie {
-   struct pci_controller hose;
-
struct resource pads;
struct resource afi;
struct resource cs;
-- 
2.13.0

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


Re: [U-Boot] [PATCH] sunxi: Change SUNXI_GMAC to SUN7I_GMAC in sources

2017-09-01 Thread Jagan Teki
On Thu, Aug 31, 2017 at 10:51 PM, Lionel Koenig  wrote:
> Following 4d43d065db3262f9a9918ba72457bf36dfb8e0bb,
> SUNXI_GMAC was still used to configure the code while
> SUN7I_GMAC was used in the configuration tools.
>
> Signed-off-by: Lionel Koenig 
> ---
>  arch/arm/include/asm/arch-sunxi/sys_proto.h | 2 +-
>  board/sunxi/Makefile| 2 +-
>  include/configs/sunxi-common.h  | 2 +-
>  scripts/build-whitelist.sh  | 4 ++--
>  scripts/config_whitelist.txt| 2 +-
>  5 files changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/arch/arm/include/asm/arch-sunxi/sys_proto.h 
> b/arch/arm/include/asm/arch-sunxi/sys_proto.h
> index a373319a2b..096510b787 100644
> --- a/arch/arm/include/asm/arch-sunxi/sys_proto.h
> +++ b/arch/arm/include/asm/arch-sunxi/sys_proto.h
> @@ -24,7 +24,7 @@ void sdelay(unsigned long);
>  void return_to_fel(uint32_t lr, uint32_t sp);
>
>  /* Board / SoC level designware gmac init */
> -#if !defined CONFIG_SPL_BUILD && defined CONFIG_SUNXI_GMAC
> +#if !defined CONFIG_SPL_BUILD && defined CONFIG_SUN7I_GMAC
>  void eth_init_board(void);
>  #else
>  static inline void eth_init_board(void) {}
> diff --git a/board/sunxi/Makefile b/board/sunxi/Makefile
> index f4411f01c3..526cb72a51 100644
> --- a/board/sunxi/Makefile
> +++ b/board/sunxi/Makefile
> @@ -9,7 +9,7 @@
>  # SPDX-License-Identifier: GPL-2.0+
>  #
>  obj-y  += board.o
> -obj-$(CONFIG_SUNXI_GMAC)   += gmac.o
> +obj-$(CONFIG_SUN7I_GMAC)   += gmac.o
>  ifndef CONFIG_SPL_BUILD
>  obj-$(CONFIG_SUNXI_AHCI)   += ahci.o
>  endif
> diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h
> index 212862acd1..1373b1f037 100644
> --- a/include/configs/sunxi-common.h
> +++ b/include/configs/sunxi-common.h
> @@ -294,7 +294,7 @@ extern int soft_i2c_gpio_scl;
>  #define CONFIG_MII /* MII PHY management   */
>  #endif
>
> -#ifdef CONFIG_SUNXI_GMAC
> +#ifdef CONFIG_SUN7I_GMAC
>  #define CONFIG_PHY_ADDR1
>  #define CONFIG_MII /* MII PHY management   */
>  #define CONFIG_PHY_REALTEK
> diff --git a/scripts/build-whitelist.sh b/scripts/build-whitelist.sh
> index 7d8160d5f2..6feb9b67cf 100755
> --- a/scripts/build-whitelist.sh
> +++ b/scripts/build-whitelist.sh
> @@ -13,10 +13,10 @@ export LC_ALL=C LC_COLLATE=C
>  # There are two independent greps. The first pulls out the component parts
>  # of CONFIG_SYS_EXTRA_OPTIONS. An example is:
>  #
> -#  SUNXI_GMAC,AHCI,SATAPWR=SUNXI_GPB(8)
> +#  SUN7I_GMAC,AHCI,SATAPWR=SUNXI_GPB(8)
>  #
>  # We want this to produce:
> -#  CONFIG_SUNXI_GMAC
> +#  CONFIG_SUN7I_GMAC
>  #  CONFIG_AHCI
>  #  CONFIG_SATAPWR
>  #
> diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt
> index d8710958a3..19416dddca 100644
> --- a/scripts/config_whitelist.txt
> +++ b/scripts/config_whitelist.txt
> @@ -2307,7 +2307,7 @@ CONFIG_STV0991_HZ_CLOCK
>  CONFIG_ST_SMI
>  CONFIG_SUNXI_AHCI
>  CONFIG_SUNXI_EMAC
> -CONFIG_SUNXI_GMAC
> +CONFIG_SUN7I_GMAC

This shouldn't require since CONFIG_ is part of Kconfig

Reviewed-by: Jagan Teki 

thanks!
-- 
Jagan Teki
Free Software Engineer | www.openedev.com
U-Boot, Linux | Upstream Maintainer
Hyderabad, India.
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] QSPI "sf probe ...", "sf read ..." on Altera SoC FPGA

2017-09-01 Thread Jagan Teki
On Fri, Sep 1, 2017 at 5:23 PM, Hannes Schmelzer  wrote:
> Hi Eldor,
>
> just found your post in the mailinglist.
>
> https://lists.denx.de/pipermail/u-boot/2016-December/276491.html
>
> Reason why i'm searched there is, that i've now excactly same problem as
> you.

Can you give some details, issue came-up while 'sf probe' or 'sf read' ?

thanks!
-- 
Jagan Teki
Free Software Engineer | www.openedev.com
U-Boot, Linux | Upstream Maintainer
Hyderabad, India.
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] DA850evm SPI Flash Partitions between Linux and U-boot are Inconsistent

2017-09-01 Thread Adam Ford
On Fri, Sep 1, 2017 at 9:25 AM, Sekhar Nori  wrote:
> Hi Adam,
>
> On Wednesday 30 August 2017 04:07 PM, Adam Ford wrote:
>> On Wed, Aug 30, 2017 at 12:30 AM, Sekhar Nori  wrote:
>>> On Wednesday 30 August 2017 08:07 AM, Adam Ford wrote:
 On Tue, Aug 29, 2017 at 8:05 AM, Adam Ford  wrote:
> On Tue, Aug 29, 2017 at 6:41 AM, Sekhar Nori  wrote:
>> On Tuesday 29 August 2017 03:29 PM, Adam Ford wrote:
>>> On Tue, Aug 29, 2017 at 4:13 AM, Sekhar Nori  wrote:
 Hi Adam,

 On Sunday 27 August 2017 08:31 PM, Adam Ford wrote:
> I was trying to enable MTD Partitions to make loading the Kernel and
> FS easier from within U-Boot
>
> The da850evm spi-flash partitions in Linux show
>
> "U-Boot-SPL" @ offset 0, size 64K
> "U-Boot"; @ offset 0x0001, size 512K
> "U-Boot-Env"; @ offset 0x0009

 According to board/davinci/da8xxevm/README.da850, we support AIS image
 format for SPI boot. This is a single image containing SPL and U-Boot.

 Given this, I think having separate partitions for SPL and U-Boot does
 not make sense since thats not how its going to be used.
>>>
>>> That's what I was thinking too, but I wasn't sure if someone had split
>>> SPL somehow to make it possible to update U-Boot via Linux or U-Boot
>>> itself.

>
> However U-Boot shows the following:
>
> CONFIG_SYS_SPI_U_BOOT_OFFS 0x8000 which would make the SPL partition 
> 32K.
> CONFIG_SYS_SPI_U_BOOT_SIZE  0x4 and the size of U-boot 256K
> instead of 512k.
>
> CONFIG_ENV_SIZE (64 << 10)
> CONFIG_ENV_OFFSET   (512 << 10) which is 0x8 instead of
> Linux's 0x9
>
> It seems to me like the U-Boot and Linux should try and synchronize
> their partitions tables.

 Right.

> For people who want to burn Linux into the SPI flash it seems there
> there should be some consistency.  I tried making the U-boot settings
> match the Linux ones, but it seems to hang between SPL and U-Boot, so
> I think the U-Boot offset in Linux might need to match U-Boot.  Can
> you guys make some recomendations as to which is correct?

 I have not tried it, but looks like the partitions we need are

 "SPL/U-Boot AIS" @ offset 0, size 512K
 "U-Boot Environment" @ offset 512K, size 64K
>>>
>>> I was thinking the same thing.
>>>
 "Kernel/Spare" @ offset 576K, size 7552K
 "Mac Address" @ offset 8128K, size 64K (read only)
>>>
>>> If U-Boot reads the MAC address from its environmental variables
>>> instead of using up an entire 64K for what conceivably is 6 bytes,
>>> could we free up this space to help grow the Kernel/Spare space?
>>
>> If environment sector is erased, the mac address needs to be restored
>> from SPI flash. Thats why I think it needs to remain as a read-only
>> partition. Also, its just 64K more space, not sure if it will make a big
>> difference in the overall scheme of things.
>>
 With an 8M flash, I think its futile to try to fit a modern filesystem
 on the flash.

 If you are using DT boot, we cannot really change the partitions in
 device-tree because of DT backward-compatibility requirements. But we
 can fix da850evm_spiflash_part[] table in
 arch/arm/mach-davinci/board-da850-evm.c.
>>>
>>> Wouldn't having two different partition tables between da850-evm.c and
>>> the DT cause confusion down the road?  With DT being the future, why
>>> would we not try to eliminate any custom board files with just a
>>> single common davinci board file + board specific DT?
>>
>> Thats ideal yes. But there is a lot of support in the da850-evm board
>> file which does not have a DT equivalent yet. Thats why I have kept the
>> board file around.
>>
 To help DT boot, we can pass fixed up mtdparts through environment
 variables. Something like what is done in 3f18ff07c81b ("ARM: keystone:
 Pass SPI MTD partition table via kernel command line").
>>>
>>> This was ultimately was I was wanting to do.  For some of the OMAP3
>>> boards, removing the partition tree was accepted since the partition
>>> info was passed to the kernel.  If we did this for DA850, we could
>>> simply elimiate the partition info in the Kernel (like some of the
>>> omap3 boards) and let the partition maps be defined by U-Boot would
>>> would guarantee consistency between them.
>>
>> Actually, thinking a bit more, we cannot change the partition
>> information in kernel at all since that means loss of data for anyone
>> updating just the kernel.
>>
>> We can ho

Re: [U-Boot] [PATCH] sunxi: Change SUNXI_GMAC to SUN7I_GMAC in sources

2017-09-01 Thread Jagan Teki
On Fri, Sep 1, 2017 at 8:03 PM, Jagan Teki  wrote:
> On Thu, Aug 31, 2017 at 10:51 PM, Lionel Koenig  
> wrote:
>> Following 4d43d065db3262f9a9918ba72457bf36dfb8e0bb,
>> SUNXI_GMAC was still used to configure the code while
>> SUN7I_GMAC was used in the configuration tools.
>>
>> Signed-off-by: Lionel Koenig 

There was a patch already[1] will proceed with that.

[1] https://patchwork.ozlabs.org/patch/793903/

thanks!
-- 
Jagan Teki
Free Software Engineer | www.openedev.com
U-Boot, Linux | Upstream Maintainer
Hyderabad, India.
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 00/23] efi_loader implement missing functions

2017-09-01 Thread Tom Rini
On Wed, Aug 30, 2017 at 04:16:34AM +0800, Simon Glass wrote:
> Hi,
> 
> On 29 August 2017 at 22:16, Rob Clark  wrote:
> > On Tue, Aug 29, 2017 at 8:57 AM, Leif Lindholm  
> > wrote:
> >> On Tue, Aug 29, 2017 at 02:26:48PM +0200, Alexander Graf wrote:
> >>> > > > I would add command
> >>> > > > bootefi selftest.efi
> >>> > > > to run the tests and provide the python wrapper code to add it to 
> >>> > > > the
> >>> > > > test suite.
> >>> > >
> >>> > > I think that's a great idea, yes.
> >>> > I wonder how far we are from running UEFI tests (either the official
> >>> > ones, or I seem to remember hearing about some other test suite which
> >>> > didn't require UEFI shell)?
> >>>
> >>> Let's ask Leif, Ard and Dong.
> >>>
> >>> The official test suite definitely needs the UEFI Shell. Is the suite
> >>> publicly available by now?
> >>
> >> In binary form, you can access it already from the links on
> >> http://uefi.org/testtools
> >>
> >> Yes, 2.5 is latest release. No this is not a restriction ... the SCT
> >> releases have been lagging the specification releases a fair bit.
> >>
> >> The 2.5a package contains AARCH64, IA32 and X64 support (not ARM).
> >> Not that it couldn't contain ARM, it just hasn't been packaged.
> >>
> >>> > That seems more useful long term than re-inventing comprehensive UEFI
> >>> > test suite.  (Also, beyond just running shim/fallback/grub, I don't
> >>> > really have time to invent new tests for the stack of efi_loader
> >>> > patches I have.)
> >>>
> >>> Yes and no - it depends on the availability of the official suite :/.
> >>
> >> UEFI SCT is not yet open source/free software. Obviously, this is
> >> something Linaro has been lobbying for since day one of our
> >> involvement. There used to be little understanding for this, but that
> >> attitude has shifted substantially.
> >
> > So, if/until UEFI SCT is not an option, what about:
> >
> >   https://01.org/linux-uefi-validation
> >
> > (thx to pjones for pointing that out to me)
> 
> Well in any case I'm not looking for a large functional test suite at
> this stage. It certainly could be useful, but not as a replacement for
> unit tests. The latter is for fast verification (so that everyone can
> run it as part of 'make tests') and easy identification of the
> location of bugs.

I want to chime in here.  Unless we're talking hours of time, if "make
tests" takes 5 minutes to run, but that includes doing some sort of full
validation suite to the relevant EFI code, that seems like a win to me.
And if someone else is responsible for the contents of the tests and we
just have to confirm our expected results, that's an even bigger win.

-- 
Tom


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


Re: [U-Boot] [PATCH v3] rpi: Enable USB keyboard support

2017-09-01 Thread Tom Rini
On Thu, Aug 31, 2017 at 08:52:34PM +0800, Simon Glass wrote:
> Hi Alex,
> 
> On 28 August 2017 at 18:10, Alexander Graf  wrote:
> >
> >
> >> Am 26.08.2017 um 19:43 schrieb Simon Glass :
> >>
> >> This is currently disabled, so USB keyboards are not detected in U-Boot.
> >> Enable this option to fix that.
> >>
> >> Signed-off-by: Simon Glass 
> >> Tested-by: Jonathan Gray 
> >> Reviewed-by: Bin Meng 
> >> Tested-by: Paul Barker 
> >
> > When did the default behavior on kbd usb support change? I'd be inclined to 
> > say that we should restore the exact same functionality scope as before for 
> > all affected boards, not just a few well tested ones ;).
> >
> > In fact, wouldn't it make sense to imply usb kbd support in kconfig always 
> > when usb (and gfx?) is present?
> 
> Well I think it is odd to have to enable this option separately when
> you already have decided to use the keyboard. I'm not sure what to do
> in the interim, but once everything is using DM, we will drop
> CONFIG_DM_KEYBOARD. So this is really just an interim state.
> 
> I don't have strong views either way.

If someone wants to cook up a patch to add 'imply USB_KEYBOARD' in the
right places we can do it that way for now certainly.

-- 
Tom


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


Re: [U-Boot] [PATCH] arm: am33xx: Make pin multiplexing functions optional

2017-09-01 Thread Tom Rini
On Thu, Aug 31, 2017 at 03:16:17PM +0200, Felix Brack wrote:

> Boards using the single-register-pin-controller can  configure all
> pins by means of the device tree. This renders the implementation of
> the two functions set_uart_mux_conf and set_mux_conf_regs obsolete.
> Using the weak attribute for these two function declarations allows
> the omission of the respective definitions.
> 
> Signed-off-by: Felix Brack 
> ---
> 
>  arch/arm/include/asm/arch-am33xx/sys_proto.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm/include/asm/arch-am33xx/sys_proto.h 
> b/arch/arm/include/asm/arch-am33xx/sys_proto.h
> index 4e78aaf..e31c25c 100644
> --- a/arch/arm/include/asm/arch-am33xx/sys_proto.h
> +++ b/arch/arm/include/asm/arch-am33xx/sys_proto.h
> @@ -31,8 +31,8 @@ void enable_gpmc_cs_config(const u32 *gpmc_config, const 
> struct gpmc_cs *cs, u32
>   u32 size);
>  int omap_nand_switch_ecc(uint32_t, uint32_t);
>  
> -void set_uart_mux_conf(void);
> -void set_mux_conf_regs(void);
> +__weak void set_uart_mux_conf(void);
> +__weak void set_mux_conf_regs(void);
>  void sdram_init(void);
>  u32 wait_on_value(u32, u32, void *, u32);
>  #ifdef CONFIG_NOR_BOOT

This seems wrong in a few ways.  First, this (and the matching ones for
omap3, etc) should be full of externs instead and in that case __weak
makes no sense.  Then, on the technical side, what you're describing
isn't quite true in that you're likely relying on having the ROM to have
setup the 'normal' UART still for you, as it so often does, I believe.
Or in the case I'm wrong, then yes, you do get UART to work once we have
parsed the DT, but the "usual" case is that we want UART and thus
printf/etc to be available asap in case of errors, so it's still not a
recommended way to go.  Thanks!

-- 
Tom


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


[U-Boot] [PATCH v2] sunxi: Fix CONFIG_SUNXI_GMAC references

2017-09-01 Thread Jagan Teki
From: Dave Prue 

SUNXI_GMAC was still used to configure the code where as the
same has been renamed and moved to Kconfig in below commit
"sunxi: Move SUNXI_GMAC to Kconfig"
(sha1: 4d43d065db3262f9a9918ba72457bf36dfb8e0bb)

Signed-off-by: Dave Prue 
Reviewed-by: Simon Glass 
Reviewed-by: Jagan Teki 
Reviewed-by: Mark Kettenis 
Tested-by: Mark Kettenis 
[Tweek commit message, config_whitelist.txt, build-whitelist.sh]
Signed-off-by: Jagan Teki 
---
Changes for v2:
- Tweek the commit message
- Remove SUNXI_GMAC from config_whitelist.txt
- %s/SUNXI_GMAC/SUN7I_GMAC in build-whitelist.sh

 arch/arm/include/asm/arch-sunxi/sys_proto.h | 2 +-
 board/sunxi/Makefile| 2 +-
 include/configs/sunxi-common.h  | 2 +-
 scripts/build-whitelist.sh  | 4 ++--
 scripts/config_whitelist.txt| 1 -
 5 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/arch/arm/include/asm/arch-sunxi/sys_proto.h 
b/arch/arm/include/asm/arch-sunxi/sys_proto.h
index a373319..096510b 100644
--- a/arch/arm/include/asm/arch-sunxi/sys_proto.h
+++ b/arch/arm/include/asm/arch-sunxi/sys_proto.h
@@ -24,7 +24,7 @@ void sdelay(unsigned long);
 void return_to_fel(uint32_t lr, uint32_t sp);
 
 /* Board / SoC level designware gmac init */
-#if !defined CONFIG_SPL_BUILD && defined CONFIG_SUNXI_GMAC
+#if !defined CONFIG_SPL_BUILD && defined CONFIG_SUN7I_GMAC
 void eth_init_board(void);
 #else
 static inline void eth_init_board(void) {}
diff --git a/board/sunxi/Makefile b/board/sunxi/Makefile
index f4411f0..526cb72 100644
--- a/board/sunxi/Makefile
+++ b/board/sunxi/Makefile
@@ -9,7 +9,7 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 obj-y  += board.o
-obj-$(CONFIG_SUNXI_GMAC)   += gmac.o
+obj-$(CONFIG_SUN7I_GMAC)   += gmac.o
 ifndef CONFIG_SPL_BUILD
 obj-$(CONFIG_SUNXI_AHCI)   += ahci.o
 endif
diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h
index 212862a..1373b1f 100644
--- a/include/configs/sunxi-common.h
+++ b/include/configs/sunxi-common.h
@@ -294,7 +294,7 @@ extern int soft_i2c_gpio_scl;
 #define CONFIG_MII /* MII PHY management   */
 #endif
 
-#ifdef CONFIG_SUNXI_GMAC
+#ifdef CONFIG_SUN7I_GMAC
 #define CONFIG_PHY_ADDR1
 #define CONFIG_MII /* MII PHY management   */
 #define CONFIG_PHY_REALTEK
diff --git a/scripts/build-whitelist.sh b/scripts/build-whitelist.sh
index 7d8160d..6feb9b6 100755
--- a/scripts/build-whitelist.sh
+++ b/scripts/build-whitelist.sh
@@ -13,10 +13,10 @@ export LC_ALL=C LC_COLLATE=C
 # There are two independent greps. The first pulls out the component parts
 # of CONFIG_SYS_EXTRA_OPTIONS. An example is:
 #
-#  SUNXI_GMAC,AHCI,SATAPWR=SUNXI_GPB(8)
+#  SUN7I_GMAC,AHCI,SATAPWR=SUNXI_GPB(8)
 #
 # We want this to produce:
-#  CONFIG_SUNXI_GMAC
+#  CONFIG_SUN7I_GMAC
 #  CONFIG_AHCI
 #  CONFIG_SATAPWR
 #
diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt
index d871095..4651bb5 100644
--- a/scripts/config_whitelist.txt
+++ b/scripts/config_whitelist.txt
@@ -2307,7 +2307,6 @@ CONFIG_STV0991_HZ_CLOCK
 CONFIG_ST_SMI
 CONFIG_SUNXI_AHCI
 CONFIG_SUNXI_EMAC
-CONFIG_SUNXI_GMAC
 CONFIG_SUNXI_GPIO
 CONFIG_SUNXI_MAX_FB_SIZE
 CONFIG_SUNXI_USB_PHYS
-- 
2.7.4

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


Re: [U-Boot] [PATCH 0/2] Board for QEMU's '-machine virt' on ARM

2017-09-01 Thread Tom Rini
On Wed, Aug 30, 2017 at 10:09:27PM +0100, Peter Robinson wrote:
> On Wed, Aug 30, 2017 at 9:31 AM, Tuomas Tynkkynen
>  wrote:
> > Hi,
> >
> > Sending this out in a slightly unfinished state to gauge if there's
> > interest in having this included in U-Boot. Basically this allows
> > running U-Boot under QEMU's '-machine virt' emulation, thus making it
> > possible to boot Linux distros that use the extlinux.conf booting method
> > under '-machine virt'.
> 
> I'm definitely interested, and I'm aware of others that are as well.
> Being able to do that an use things like virtio drivers and easily
> doing CPU/mem bits would be great.

I too would like to see this happen.  Can you please make sure to update
.travis.yml in the next iteration to add it to the list of qemu boards
we run and pass tests to (and so also send a PR for the uboot hooks
repo) ?  Then we can see about follow-up work to enable more and more
tests on this platform as well, thanks!

-- 
Tom


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


[U-Boot] [Patch V2 0/4] Migrate DA850-evm to Driver Model

2017-09-01 Thread Adam Ford
This series adds the DA850-evm device tree and related dependant files, along
with enabling DM_SPI, DM_SERIAL, and DM_SPI with DM_SPIFLASH.

This is a resend of the original series. The only real change to this series 
from V1 is the additional adding of MTD PARTS and I2C.  

Adam Ford (4):
  spi: davinci_spi: Add da830-spi support for DM
  arm: da850-evm: Enable DM and device tree support for da850-evm
  arm: da850-evm: Enable MTD Parts
  ARM: da850-evm: Enable DM_I2C

 arch/arm/dts/da850-evm-u-boot.dtsi |  1 +
 configs/da850evm_defconfig | 14 --
 drivers/spi/davinci_spi.c  |  1 +
 include/configs/da850evm.h | 36 +++-
 4 files changed, 45 insertions(+), 7 deletions(-)

-- 
2.7.4

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


[U-Boot] [Patch V2 2/4] arm: da850-evm: Enable DM and device tree support for da850-evm

2017-09-01 Thread Adam Ford
With the device tree ported and DM compatible drivers, enable:
OF_CONTROL, DM_SPI, DM_SPI_FLASH and DM_SERIAL

Signed-off-by: Adam Ford 
---
 configs/da850evm_defconfig |  9 +++--
 include/configs/da850evm.h | 17 +++--
 2 files changed, 22 insertions(+), 4 deletions(-)

diff --git a/configs/da850evm_defconfig b/configs/da850evm_defconfig
index 0135e7d..652da01 100644
--- a/configs/da850evm_defconfig
+++ b/configs/da850evm_defconfig
@@ -6,8 +6,8 @@ CONFIG_SPL_LIBGENERIC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_SPL_SPI_FLASH_SUPPORT=y
 CONFIG_SPL_SPI_SUPPORT=y
+CONFIG_DEFAULT_DEVICE_TREE="da850-evm"
 CONFIG_SYS_EXTRA_OPTIONS="MAC_ADDR_IN_SPIFLASH"
-CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_BOOTDELAY=3
 CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="mem=32M console=ttyS2,115200n8 root=/dev/mtdblock2 rw 
noinitrd ip=dhcp"
@@ -34,8 +34,13 @@ CONFIG_CMD_PING=y
 CONFIG_CMD_EXT2=y
 CONFIG_CMD_FAT=y
 CONFIG_CMD_DIAG=y
+CONFIG_OF_CONTROL=y
+CONFIG_ENV_IS_IN_SPI_FLASH=y
+CONFIG_DM=y
+CONFIG_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_SPI_FLASH_WINBOND=y
+CONFIG_DM_SERIAL=y
 CONFIG_SYS_NS16550=y
-CONFIG_OF_LIBFDT=y
+CONFIG_DM_SPI=y
diff --git a/include/configs/da850evm.h b/include/configs/da850evm.h
index 0736b39..b147bc5 100644
--- a/include/configs/da850evm.h
+++ b/include/configs/da850evm.h
@@ -21,6 +21,15 @@
 #endif
 
 /*
+* Disable DM_* for SPL build and can be re-enabled after adding
+* DM support in SPL
+*/
+#ifdef CONFIG_SPL_BUILD
+#undef CONFIG_DM_SPI
+#undef CONFIG_DM_SPI_FLASH
+#undef CONFIG_DM_I2C
+#endif
+/*
  * SoC Configuration
  */
 #define CONFIG_MACH_DAVINCI_DA850_EVM
@@ -130,18 +139,23 @@
 /*
  * Serial Driver info
  */
+
+#ifdef CONFIG_SPL_BUILD
 #define CONFIG_SYS_NS16550_SERIAL
 #define CONFIG_SYS_NS16550_REG_SIZE-4  /* NS16550 register size */
 #define CONFIG_SYS_NS16550_COM1DAVINCI_UART2_BASE /* Base address of 
UART2 */
+#endif
 #define CONFIG_SYS_NS16550_CLK clk_get(DAVINCI_UART2_CLKID)
 #define CONFIG_CONS_INDEX  1   /* use UART0 for console */
 
 #define CONFIG_SPI
 #define CONFIG_DAVINCI_SPI
-#define CONFIG_SYS_SPI_BASEDAVINCI_SPI1_BASE
 #define CONFIG_SYS_SPI_CLK clk_get(DAVINCI_SPI1_CLKID)
+#ifdef CONFIG_SPL_BUILD
+#define CONFIG_SYS_SPI_BASEDAVINCI_SPI1_BASE
 #define CONFIG_SF_DEFAULT_SPEED3000
 #define CONFIG_ENV_SPI_MAX_HZ  CONFIG_SF_DEFAULT_SPEED
+#endif
 
 #ifdef CONFIG_USE_SPIFLASH
 #define CONFIG_SPL_SPI_LOAD
@@ -152,7 +166,6 @@
 /*
  * I2C Configuration
  */
-#define CONFIG_SYS_I2C
 #define CONFIG_SYS_I2C_DAVINCI
 #define CONFIG_SYS_DAVINCI_I2C_SPEED   25000
 #define CONFIG_SYS_DAVINCI_I2C_SLAVE   10 /* Bogus, master-only in U-Boot */
-- 
2.7.4

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


[U-Boot] [Patch V2 1/4] spi: davinci_spi: Add da830-spi support for DM

2017-09-01 Thread Adam Ford
The DM support is already in the driver, so add
da830-spi to the compatible list.

Signed-off-by: Adam Ford 
---
 drivers/spi/davinci_spi.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/spi/davinci_spi.c b/drivers/spi/davinci_spi.c
index 291ef95..eda252d 100644
--- a/drivers/spi/davinci_spi.c
+++ b/drivers/spi/davinci_spi.c
@@ -563,6 +563,7 @@ static const struct dm_spi_ops davinci_spi_ops = {
 static const struct udevice_id davinci_spi_ids[] = {
{ .compatible = "ti,keystone-spi" },
{ .compatible = "ti,dm6441-spi" },
+   { .compatible = "ti,da830-spi" },
{ }
 };
 
-- 
2.7.4

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


[U-Boot] [Patch V2 3/4] arm: da850-evm: Enable MTD Parts

2017-09-01 Thread Adam Ford
There is a discrepency between U-Boot and Linux on the partition map.
This enabes the MTD parts to pass MTD partition information from U-Boot to
Linux.  Linux already has a pending patch to enable MTD PARTS in
davinci_all_defconfig

Signed-off-by: Adam Ford 

V2:  This patch is new to the series
---
 configs/da850evm_defconfig |  2 ++
 include/configs/da850evm.h | 16 ++--
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/configs/da850evm_defconfig b/configs/da850evm_defconfig
index 652da01..08cc2e8 100644
--- a/configs/da850evm_defconfig
+++ b/configs/da850evm_defconfig
@@ -33,6 +33,7 @@ CONFIG_CMD_MII=y
 CONFIG_CMD_PING=y
 CONFIG_CMD_EXT2=y
 CONFIG_CMD_FAT=y
+CONFIG_CMD_MTDPARTS=y
 CONFIG_CMD_DIAG=y
 CONFIG_OF_CONTROL=y
 CONFIG_ENV_IS_IN_SPI_FLASH=y
@@ -41,6 +42,7 @@ CONFIG_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_SPI_FLASH_WINBOND=y
+CONFIG_SPI_FLASH_MTD=y
 CONFIG_DM_SERIAL=y
 CONFIG_SYS_NS16550=y
 CONFIG_DM_SPI=y
diff --git a/include/configs/da850evm.h b/include/configs/da850evm.h
index b147bc5..a47ba96 100644
--- a/include/configs/da850evm.h
+++ b/include/configs/da850evm.h
@@ -139,7 +139,6 @@
 /*
  * Serial Driver info
  */
-
 #ifdef CONFIG_SPL_BUILD
 #define CONFIG_SYS_NS16550_SERIAL
 #define CONFIG_SYS_NS16550_REG_SIZE-4  /* NS16550 register size */
@@ -148,6 +147,9 @@
 #define CONFIG_SYS_NS16550_CLK clk_get(DAVINCI_UART2_CLKID)
 #define CONFIG_CONS_INDEX  1   /* use UART0 for console */
 
+/*
+ * SPI Driver Info
+ */
 #define CONFIG_SPI
 #define CONFIG_DAVINCI_SPI
 #define CONFIG_SYS_SPI_CLK clk_get(DAVINCI_SPI1_CLKID)
@@ -156,11 +158,21 @@
 #define CONFIG_SF_DEFAULT_SPEED3000
 #define CONFIG_ENV_SPI_MAX_HZ  CONFIG_SF_DEFAULT_SPEED
 #endif
-
 #ifdef CONFIG_USE_SPIFLASH
 #define CONFIG_SPL_SPI_LOAD
 #define CONFIG_SYS_SPI_U_BOOT_OFFS 0x8000
 #define CONFIG_SYS_SPI_U_BOOT_SIZE 0x4
+#ifdef CONFIG_SPL_BUILD
+#undef CONFIG_SPI_FLASH_MTD
+#endif
+#define CONFIG_MTD_DEVICE  /* needed for mtdparts commands */
+#define CONFIG_MTD_PARTITIONS  /* required for UBI partition support */
+#define MTDIDS_DEFAULT "nor0=spi0.0"
+#define MTDPARTS_DEFAULT   "mtdparts=spi0.0:"\
+   "512k(u-boot.ais),"\
+   "64k(u-boot-env),"\
+   "7552k(kernel-spare),"\
+   "64k(MAC-Address)"
 #endif
 
 /*
-- 
2.7.4

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


[U-Boot] [Patch V2 4/4] ARM: da850-evm: Enable DM_I2C

2017-09-01 Thread Adam Ford
With DM now enabled with the device tree pulled from Linux, we can
enable DM_I2C in U-Boot.

Signed-off-by: Adam Ford 

V2: New to series
---
 arch/arm/dts/da850-evm-u-boot.dtsi | 1 +
 configs/da850evm_defconfig | 3 +++
 include/configs/da850evm.h | 5 +++--
 3 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/arch/arm/dts/da850-evm-u-boot.dtsi 
b/arch/arm/dts/da850-evm-u-boot.dtsi
index 516bc1d..2041cde 100644
--- a/arch/arm/dts/da850-evm-u-boot.dtsi
+++ b/arch/arm/dts/da850-evm-u-boot.dtsi
@@ -13,6 +13,7 @@
};

aliases {
+   i2c0 = &i2c0;
spi0 = &spi1;
};
 };
diff --git a/configs/da850evm_defconfig b/configs/da850evm_defconfig
index 08cc2e8..d6cd1fa 100644
--- a/configs/da850evm_defconfig
+++ b/configs/da850evm_defconfig
@@ -24,6 +24,7 @@ CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_ASKENV=y
 CONFIG_CRC32_VERIFY=y
 # CONFIG_CMD_FLASH is not set
+CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
@@ -38,6 +39,8 @@ CONFIG_CMD_DIAG=y
 CONFIG_OF_CONTROL=y
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_DM=y
+CONFIG_DM_I2C=y
+CONFIG_I2C_SET_DEFAULT_BUS_NUM=y
 CONFIG_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_STMICRO=y
diff --git a/include/configs/da850evm.h b/include/configs/da850evm.h
index a47ba96..38798b0 100644
--- a/include/configs/da850evm.h
+++ b/include/configs/da850evm.h
@@ -28,6 +28,7 @@
 #undef CONFIG_DM_SPI
 #undef CONFIG_DM_SPI_FLASH
 #undef CONFIG_DM_I2C
+#undef CONFIG_DM_I2C_COMPAT
 #endif
 /*
  * SoC Configuration
@@ -178,10 +179,10 @@
 /*
  * I2C Configuration
  */
+#ifndef CONFIG_SPL_BUILD
 #define CONFIG_SYS_I2C_DAVINCI
-#define CONFIG_SYS_DAVINCI_I2C_SPEED   25000
-#define CONFIG_SYS_DAVINCI_I2C_SLAVE   10 /* Bogus, master-only in U-Boot */
 #define CONFIG_SYS_I2C_EXPANDER_ADDR   0x20
+#endif
 
 /*
  * Flash & Environment
-- 
2.7.4

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


Re: [U-Boot] Pull request: u-boot-sunxi/master

2017-09-01 Thread Tom Rini
On Tue, Aug 29, 2017 at 12:57:43PM +0530, Jagan Teki wrote:

> Hi Tom,
> 
> These fixes need to be in for the release, please pull the same.
> 
> thanks!
> Jagan.
> 
> The following changes since commit 8b3cec7da18645eda7f7cd0b65ee9f2dac573409:
> 
>   mtdparts: Fix uninitialized scalar usage (2017-08-26 16:59:24 -0400)
> 
> are available in the git repository at:
> 
>   git://git.denx.de/u-boot-sunxi.git master
> 
> for you to fetch changes up to ead3697d7ec491c055fe546b3a45bcfba45fa022:
> 
>   mmc: sunxi: fix legacy MMC initialisation (2017-08-28 22:38:05 +0530)
> 

Applied to u-boot/master, thanks!

But!  Can you please grab https://patchwork.ozlabs.org/patch/793903/ and
update the commit message as Andreas describes?  I think the whitelist
part is "ok" until we migrate the symbols, which should of course be
done sooner rather than later.  Thanks again!

-- 
Tom


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


Re: [U-Boot] [GIT PULL] u-boot-uniphier/master

2017-09-01 Thread Tom Rini
On Wed, Aug 30, 2017 at 09:22:33AM +0900, Masahiro Yamada wrote:

> Hi Tom,
> 
> Here is a bit volume pull request, but changes
> are SoC-specific except the ofnode patch and denali_dt.
> The latter is reviewed by Simon.
> 

Applied to u-boot/master, thanks!

-- 
Tom


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


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

2017-09-01 Thread Tom Rini
On Wed, Aug 30, 2017 at 10:06:30AM +0200, Stefan Roese wrote:

> Hi Tom,
> 
> please pull this last minute fix from Chris, which is needed
> to get SPI NOR working on current master.
> 
> Thanks,
> Stefan
> 
> 
> The following changes since commit 8b3cec7da18645eda7f7cd0b65ee9f2dac573409:
> 
>   mtdparts: Fix uninitialized scalar usage (2017-08-26 16:59:24 -0400)
> 
> are available in the git repository at:
> 
>   git://www.denx.de/git/u-boot-marvell.git 
> 
> for you to fetch changes up to dbc3e64fd1d416395def9b555a9b76e84d6f44f3:
> 
>   ARM: mvebu: add "spi-flash" compatible string (2017-08-30 10:03:35 +0200)
> 

Applied to u-boot/master, thanks!

-- 
Tom


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


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

2017-09-01 Thread Tom Rini
On Wed, Aug 30, 2017 at 12:35:02PM +0200, Stefano Babic wrote:

> Hi Tom,
> 
> please pull from u-boot-imx, thanks !
> 
> The following changes since commit 90ae53ce1ae665a1b43ecf5ccafc339839392427:
> 
>   fastboot: Ensure we treat CONFIG_FASTBOOT_BUF_ADDR as long (2017-08-22
> 08:20:02 -0400)
> 
> are available in the git repository at:
> 
>   git://www.denx.de/git/u-boot-imx.git master
> 
> for you to fetch changes up to 63af4b0ad0666e0797306593813b6272e1995bde:
> 
>   i.MX6Q: icorem6: Add falcon mode (2017-08-30 12:18:41 +0200)
> 

Applied to u-boot/master, thanks!

-- 
Tom


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


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

2017-09-01 Thread Fabio Estevam
Hi Stefan,

On Wed, Aug 16, 2017 at 3:00 PM, Stefan Agner  wrote:
> From: Stefan Agner 
>
> This series adds NXP's Serial Download Protocol (SDP) support via
> USB for SPL/U-Boot. It allows to download U-Boot via USB from a
> (recovered) SPL using the same tools used to download SPL itself
> (specifically imx_usb, but also sb_loader seems to work).
>
> The idea has been brought up when the first targets started to make
> use of SPL for DDR initialization, see:
> https://lists.denx.de/pipermail/u-boot/2015-July/220330.html
>
> The initial SDP implementation (patch 2) requires the payload to
> have the imx specific headers (hence the move of the imx header
> file in patch 1).
>
> Patch 3 extends image header support beyond the SDP specification,
> specifically implements also support for U-Boot headers. This
> allows to use the same SPL/U-Boot binaries for recovery as used on
> the regular boot device (SD/eMMC). For that to work also the host
> side imx_usb tools needed an extension, currently available here:
>
> https://github.com/toradex/imx_loader/tree/imx_usb_batch_mode_refactored
>
> (in case this patchset gets accepted in U-Boot, I plan to push
> these imx_usb changes upstream as well)
>
> The full patchset allows to download SPL and U-Boot over USB to a
> target in recovery mode using the same usb_imx utility. Refer to
> the new README.sdp for details how to use usb_imx in combination
> with this implementation.

I am trying to use this feature on a imx6qsabresd board.

Here are the changes I made (against u-boot-imx latest tree):

diff --git a/board/freescale/mx6sabresd/mx6sabresd.c
b/board/freescale/mx6sabresd/mx6sabresd.c
index 5b50bc8..6ca2485 100644
--- a/board/freescale/mx6sabresd/mx6sabresd.c
+++ b/board/freescale/mx6sabresd/mx6sabresd.c
@@ -29,6 +29,7 @@
 #include 
 #include "../common/pfuze.h"
 #include 
+#include 

 DECLARE_GLOBAL_DATA_PTR;

@@ -1033,6 +1034,19 @@ static void spl_dram_init(void)
ddr_init(mx6dl_dcd_table, ARRAY_SIZE(mx6dl_dcd_table));
 }

+#ifdef CONFIG_SPL_USB_GADGET_SUPPORT
+#define FSL_USB_PRODUCT_NUM_OFFSET0xa4a5
+int g_dnl_bind_fixup(struct usb_device_descriptor *dev, const char *name)
+{
+   unsigned short usb_pid;
+
+   usb_pid = FSL_USB_PRODUCT_NUM_OFFSET + 0xff;
+   put_unaligned(usb_pid, &dev->idProduct);
+
+   return 0;
+}
+#endif
+
 void board_init_f(ulong dummy)
 {
/* DDR initialization */
diff --git a/configs/mx6sabresd_defconfig b/configs/mx6sabresd_defconfig
index 7949c5e..1c08639 100644
--- a/configs/mx6sabresd_defconfig
+++ b/configs/mx6sabresd_defconfig
@@ -19,6 +19,9 @@ CONFIG_SPL=y
 CONFIG_SPL_EXT_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_OS_BOOT=y
+CONFIG_SPL_USB_HOST_SUPPORT=y
+CONFIG_SPL_USB_GADGET_SUPPORT=y
+CONFIG_SPL_USB_SDP_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMLS is not set
@@ -32,6 +35,7 @@ CONFIG_CMD_PART=y
 CONFIG_CMD_PCI=y
 CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
+CONFIG_CMD_USB_SDP=y
 CONFIG_CMD_DHCP=y
 CONFIG_CMD_MII=y
 CONFIG_CMD_PING=y

Then I use the imx_usb tool from
https://github.com/toradex/imx_loader/tree/imx_usb_batch_mode_refactored

I remove the SD card, so that the board goes to SDP and then run:

sudo ./imx_usb SPL

and then I see in the board console:

U-Boot SPL 2017.09-rc2-36996-g63af4b0-dirty (Sep 01 2017 - 13:42:55)
Trying to boot from MMC1
MMC: no card present
mmc_init: -123, time 1
spl: mmc init failed with error: -123
SPL: failed to boot from all boot devices
### ERROR ### Please RESET the board ###

I was expecting to see:

  Trying to boot from USB SDP
  SDP: initialize...
  SDP: handle requests...

as per the README.sdp

Any ideas as to what I am missing?

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


Re: [U-Boot] Pull request: u-boot-sunxi/master

2017-09-01 Thread Jagan Teki
On Fri, Sep 1, 2017 at 10:12 PM, Tom Rini  wrote:
> On Tue, Aug 29, 2017 at 12:57:43PM +0530, Jagan Teki wrote:
>
>> Hi Tom,
>>
>> These fixes need to be in for the release, please pull the same.
>>
>> thanks!
>> Jagan.
>>
>> The following changes since commit 8b3cec7da18645eda7f7cd0b65ee9f2dac573409:
>>
>>   mtdparts: Fix uninitialized scalar usage (2017-08-26 16:59:24 -0400)
>>
>> are available in the git repository at:
>>
>>   git://git.denx.de/u-boot-sunxi.git master
>>
>> for you to fetch changes up to ead3697d7ec491c055fe546b3a45bcfba45fa022:
>>
>>   mmc: sunxi: fix legacy MMC initialisation (2017-08-28 22:38:05 +0530)
>>
>
> Applied to u-boot/master, thanks!
>
> But!  Can you please grab https://patchwork.ozlabs.org/patch/793903/ and
> update the commit message as Andreas describes?  I think the whitelist
> part is "ok" until we migrate the symbols, which should of course be
> done sooner rather than later.  Thanks again!

Yeah, Fixed and send v2 for this[1] will send the PR.

[1] https://patchwork.ozlabs.org/patch/808719/

thanks!
-- 
Jagan Teki
Senior Linux Kernel Engineer | Amarula Solutions
U-Boot, Linux | Upstream Maintainer
Hyderabad, India.
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


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

2017-09-01 Thread Anatolij Gustschin
Hi Tom,

Please pull to fixes for v2017.09.

The following changes since commit 8b3cec7da18645eda7f7cd0b65ee9f2dac573409:

  mtdparts: Fix uninitialized scalar usage (2017-08-26 16:59:24 -0400)

are available in the git repository at:

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

for you to fetch changes up to 0d1ae97c0299089e85a2980ac76e924e6d4447c6:

  video: ipuv3_fb: skip IPU shutdown if IPU was not enabled before (2017-08-29 
15:23:55 +0200)


Anatolij Gustschin (1):
  video: ipuv3_fb: skip IPU shutdown if IPU was not enabled before

Niko Mauno (1):
  splash_source: Verify FIT magic

 common/splash_source.c   |  5 +
 drivers/video/mxc_ipuv3_fb.c | 13 -
 2 files changed, 17 insertions(+), 1 deletion(-)

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


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

2017-09-01 Thread Tom Rini
On Fri, Sep 01, 2017 at 06:50:46PM +0200, Anatolij Gustschin wrote:

> Hi Tom,
> 
> Please pull to fixes for v2017.09.
> 
> The following changes since commit 8b3cec7da18645eda7f7cd0b65ee9f2dac573409:
> 
>   mtdparts: Fix uninitialized scalar usage (2017-08-26 16:59:24 -0400)
> 
> are available in the git repository at:
> 
>   git://git.denx.de/u-boot-video.git master
> 
> for you to fetch changes up to 0d1ae97c0299089e85a2980ac76e924e6d4447c6:
> 
>   video: ipuv3_fb: skip IPU shutdown if IPU was not enabled before 
> (2017-08-29 15:23:55 +0200)
> 

Applied to u-boot/master, thanks!

-- 
Tom


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


[U-Boot] Pull request: u-boot-sunxi/master

2017-09-01 Thread Jagan Teki
Hi Tom,

Please pull these fixes.

thanks!
Jagan.

The following changes since commit ead3697d7ec491c055fe546b3a45bcfba45fa022:

  mmc: sunxi: fix legacy MMC initialisation (2017-08-28 22:38:05 +0530)

are available in the git repository at:

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

for you to fetch changes up to 6ff005cf19363382fc867d7876a75fd8a386e894:

  sunxi: Fix CONFIG_SUNXI_GMAC references (2017-09-01 20:48:27 +0530)


Chen-Yu Tsai (1):
  mmc: sunxi: Only update timing mode bit when enabling new timing mode

Dave Prue (1):
  sunxi: Fix CONFIG_SUNXI_GMAC references

 arch/arm/include/asm/arch-sunxi/sys_proto.h | 2 +-
 board/sunxi/Makefile| 2 +-
 drivers/mmc/sunxi_mmc.c | 2 +-
 include/configs/sunxi-common.h  | 2 +-
 scripts/build-whitelist.sh  | 4 ++--
 scripts/config_whitelist.txt| 1 -
 6 files changed, 6 insertions(+), 7 deletions(-)
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v2] sunxi: Fix CONFIG_SUNXI_GMAC references

2017-09-01 Thread Jagan Teki
On Fri, Sep 1, 2017 at 8:53 PM, Jagan Teki  wrote:
> From: Dave Prue 
>
> SUNXI_GMAC was still used to configure the code where as the
> same has been renamed and moved to Kconfig in below commit
> "sunxi: Move SUNXI_GMAC to Kconfig"
> (sha1: 4d43d065db3262f9a9918ba72457bf36dfb8e0bb)
>
> Signed-off-by: Dave Prue 
> Reviewed-by: Simon Glass 
> Reviewed-by: Jagan Teki 
> Reviewed-by: Mark Kettenis 
> Tested-by: Mark Kettenis 
> [Tweek commit message, config_whitelist.txt, build-whitelist.sh]
> Signed-off-by: Jagan Teki 

Applied to u-boot-sunxi/master

thanks!
-- 
Jagan Teki
Free Software Engineer | www.openedev.com
U-Boot, Linux | Upstream Maintainer
Hyderabad, India.
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [Patch V2 1/4] spi: davinci_spi: Add da830-spi support for DM

2017-09-01 Thread Jagan Teki
On Fri, Sep 1, 2017 at 9:41 PM, Adam Ford  wrote:
> The DM support is already in the driver, so add
> da830-spi to the compatible list.
>
> Signed-off-by: Adam Ford 
> ---

I think you missed, last version r-w-b ?

thanks!
-- 
Jagan Teki
Free Software Engineer | www.openedev.com
U-Boot, Linux | Upstream Maintainer
Hyderabad, India.
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [Patch V2 2/4] arm: da850-evm: Enable DM and device tree support for da850-evm

2017-09-01 Thread Jagan Teki
On Fri, Sep 1, 2017 at 9:41 PM, Adam Ford  wrote:
> With the device tree ported and DM compatible drivers, enable:
> OF_CONTROL, DM_SPI, DM_SPI_FLASH and DM_SERIAL
>
> Signed-off-by: Adam Ford 
> ---

Reviewed-by: Jagan Teki 

thanks!
-- 
Jagan Teki
Free Software Engineer | www.openedev.com
U-Boot, Linux | Upstream Maintainer
Hyderabad, India.
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [Patch V2 3/4] arm: da850-evm: Enable MTD Parts

2017-09-01 Thread Jagan Teki
On Fri, Sep 1, 2017 at 9:41 PM, Adam Ford  wrote:
> There is a discrepency between U-Boot and Linux on the partition map.
> This enabes the MTD parts to pass MTD partition information from U-Boot to
> Linux.  Linux already has a pending patch to enable MTD PARTS in
> davinci_all_defconfig
>
> Signed-off-by: Adam Ford 
>
> V2:  This patch is new to the series
> ---

Reviewed-by: Jagan Teki 

thanks!
-- 
Jagan Teki
Free Software Engineer | www.openedev.com
U-Boot, Linux | Upstream Maintainer
Hyderabad, India.
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [Patch V2 4/4] ARM: da850-evm: Enable DM_I2C

2017-09-01 Thread Jagan Teki
On Fri, Sep 1, 2017 at 9:41 PM, Adam Ford  wrote:
> With DM now enabled with the device tree pulled from Linux, we can
> enable DM_I2C in U-Boot.
>
> Signed-off-by: Adam Ford 
>
> V2: New to series
> ---

Reviewed-by: Jagan Teki 

thanks!
-- 
Jagan Teki
Free Software Engineer | www.openedev.com
U-Boot, Linux | Upstream Maintainer
Hyderabad, India.
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] Pull request: u-boot-sunxi/master

2017-09-01 Thread Tom Rini
On Fri, Sep 01, 2017 at 10:40:59PM +0530, Jagan Teki wrote:

> Hi Tom,
> 
> Please pull these fixes.
> 
> thanks!
> Jagan.
> 
> The following changes since commit ead3697d7ec491c055fe546b3a45bcfba45fa022:
> 
>   mmc: sunxi: fix legacy MMC initialisation (2017-08-28 22:38:05 +0530)
> 
> are available in the git repository at:
> 
>   git://git.denx.de/u-boot-sunxi.git master
> 
> for you to fetch changes up to 6ff005cf19363382fc867d7876a75fd8a386e894:
> 
>   sunxi: Fix CONFIG_SUNXI_GMAC references (2017-09-01 20:48:27 +0530)
> 

I ran test/py/test.py on my A20-OLinuXino-Lime2 (that was working with eth
already) and applied to u-boot/master, thanks!

-- 
Tom


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


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

2017-09-01 Thread Stefan Agner
On 2017-09-01 09:48, Fabio Estevam wrote:
> Hi Stefan,
> 
> On Wed, Aug 16, 2017 at 3:00 PM, Stefan Agner  wrote:
>> From: Stefan Agner 
>>
>> This series adds NXP's Serial Download Protocol (SDP) support via
>> USB for SPL/U-Boot. It allows to download U-Boot via USB from a
>> (recovered) SPL using the same tools used to download SPL itself
>> (specifically imx_usb, but also sb_loader seems to work).
>>
>> The idea has been brought up when the first targets started to make
>> use of SPL for DDR initialization, see:
>> https://lists.denx.de/pipermail/u-boot/2015-July/220330.html
>>
>> The initial SDP implementation (patch 2) requires the payload to
>> have the imx specific headers (hence the move of the imx header
>> file in patch 1).
>>
>> Patch 3 extends image header support beyond the SDP specification,
>> specifically implements also support for U-Boot headers. This
>> allows to use the same SPL/U-Boot binaries for recovery as used on
>> the regular boot device (SD/eMMC). For that to work also the host
>> side imx_usb tools needed an extension, currently available here:
>>
>> https://github.com/toradex/imx_loader/tree/imx_usb_batch_mode_refactored
>>
>> (in case this patchset gets accepted in U-Boot, I plan to push
>> these imx_usb changes upstream as well)
>>
>> The full patchset allows to download SPL and U-Boot over USB to a
>> target in recovery mode using the same usb_imx utility. Refer to
>> the new README.sdp for details how to use usb_imx in combination
>> with this implementation.
> 
> I am trying to use this feature on a imx6qsabresd board.
> 
> Here are the changes I made (against u-boot-imx latest tree):
> 
> diff --git a/board/freescale/mx6sabresd/mx6sabresd.c
> b/board/freescale/mx6sabresd/mx6sabresd.c
> index 5b50bc8..6ca2485 100644
> --- a/board/freescale/mx6sabresd/mx6sabresd.c
> +++ b/board/freescale/mx6sabresd/mx6sabresd.c
> @@ -29,6 +29,7 @@
>  #include 
>  #include "../common/pfuze.h"
>  #include 
> +#include 
> 
>  DECLARE_GLOBAL_DATA_PTR;
> 
> @@ -1033,6 +1034,19 @@ static void spl_dram_init(void)
> ddr_init(mx6dl_dcd_table, ARRAY_SIZE(mx6dl_dcd_table));
>  }
> 
> +#ifdef CONFIG_SPL_USB_GADGET_SUPPORT
> +#define FSL_USB_PRODUCT_NUM_OFFSET0xa4a5
> +int g_dnl_bind_fixup(struct usb_device_descriptor *dev, const char *name)
> +{
> +   unsigned short usb_pid;
> +
> +   usb_pid = FSL_USB_PRODUCT_NUM_OFFSET + 0xff;
> +   put_unaligned(usb_pid, &dev->idProduct);
> +
> +   return 0;
> +}
> +#endif
> +
>  void board_init_f(ulong dummy)
>  {
> /* DDR initialization */
> diff --git a/configs/mx6sabresd_defconfig b/configs/mx6sabresd_defconfig
> index 7949c5e..1c08639 100644
> --- a/configs/mx6sabresd_defconfig
> +++ b/configs/mx6sabresd_defconfig
> @@ -19,6 +19,9 @@ CONFIG_SPL=y
>  CONFIG_SPL_EXT_SUPPORT=y
>  CONFIG_SPL_I2C_SUPPORT=y
>  CONFIG_SPL_OS_BOOT=y
> +CONFIG_SPL_USB_HOST_SUPPORT=y
> +CONFIG_SPL_USB_GADGET_SUPPORT=y
> +CONFIG_SPL_USB_SDP_SUPPORT=y
>  CONFIG_HUSH_PARSER=y
>  CONFIG_CMD_BOOTZ=y
>  # CONFIG_CMD_IMLS is not set
> @@ -32,6 +35,7 @@ CONFIG_CMD_PART=y
>  CONFIG_CMD_PCI=y
>  CONFIG_CMD_SF=y
>  CONFIG_CMD_USB=y
> +CONFIG_CMD_USB_SDP=y
>  CONFIG_CMD_DHCP=y
>  CONFIG_CMD_MII=y
>  CONFIG_CMD_PING=y
> 
> Then I use the imx_usb tool from
> https://github.com/toradex/imx_loader/tree/imx_usb_batch_mode_refactored
> 
> I remove the SD card, so that the board goes to SDP and then run:
> 
> sudo ./imx_usb SPL
> 
> and then I see in the board console:
> 
> U-Boot SPL 2017.09-rc2-36996-g63af4b0-dirty (Sep 01 2017 - 13:42:55)
> Trying to boot from MMC1
> MMC: no card present
> mmc_init: -123, time 1
> spl: mmc init failed with error: -123
> SPL: failed to boot from all boot devices
> ### ERROR ### Please RESET the board ###
> 
> I was expecting to see:
> 
>   Trying to boot from USB SDP
>   SDP: initialize...
>   SDP: handle requests...
> 
> as per the README.sdp
> 
> Any ideas as to what I am missing?


That is the issue I am describing here:
https://lists.denx.de/pipermail/u-boot/2017-August/301952.html

Either enter recovery mode explicitly (by setting the BMODE pins or
using the bmode command)

Or you can use the USB PHY method which indicates whether the ROM used
serial downloader. We use this in our downstream U-Boot (NXP used that
method to go into "mgfr" mode...)
http://git.toradex.com/cgit/u-boot-toradex.git/commit/?h=2016.11-toradex-next&id=0d069117614b590848b490e348488362443c5547
http://git.toradex.com/cgit/u-boot-toradex.git/commit/?h=2016.11-toradex-next&id=80c3bd6c2750c3c2843537f015c0d675b1b74a58

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


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

2017-09-01 Thread Fabio Estevam
Hi Stefan,

On Fri, Sep 1, 2017 at 3:19 PM, Stefan Agner  wrote:

> That is the issue I am describing here:
> https://lists.denx.de/pipermail/u-boot/2017-August/301952.html
>
> Either enter recovery mode explicitly (by setting the BMODE pins or
> using the bmode command)

On imx6qsabresd it is not possible to put the boot pins into serial
download mode.

>
> Or you can use the USB PHY method which indicates whether the ROM used
> serial downloader. We use this in our downstream U-Boot (NXP used that
> method to go into "mgfr" mode...)
> http://git.toradex.com/cgit/u-boot-toradex.git/commit/?h=2016.11-toradex-next&id=0d069117614b590848b490e348488362443c5547
> http://git.toradex.com/cgit/u-boot-toradex.git/commit/?h=2016.11-toradex-next&id=80c3bd6c2750c3c2843537f015c0d675b1b74a58

I have tested this method and it works, thanks.

Do you plan to usptream this method?

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


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

2017-09-01 Thread Fabio Estevam
On Fri, Sep 1, 2017 at 3:54 PM, Fabio Estevam  wrote:

> I have tested this method and it works, thanks.
>
> Do you plan to usptream this method?

Or I can also put your patch as part of my series that adds SDP
support for imx6qsabresd if you prefer.
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


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

2017-09-01 Thread Tom Rini
On Fri, Sep 01, 2017 at 12:57:56PM -0400, Tom Rini wrote:
> On Fri, Sep 01, 2017 at 06:50:46PM +0200, Anatolij Gustschin wrote:
> 
> > Hi Tom,
> > 
> > Please pull to fixes for v2017.09.
> > 
> > The following changes since commit 8b3cec7da18645eda7f7cd0b65ee9f2dac573409:
> > 
> >   mtdparts: Fix uninitialized scalar usage (2017-08-26 16:59:24 -0400)
> > 
> > are available in the git repository at:
> > 
> >   git://git.denx.de/u-boot-video.git master
> > 
> > for you to fetch changes up to 0d1ae97c0299089e85a2980ac76e924e6d4447c6:
> > 
> >   video: ipuv3_fb: skip IPU shutdown if IPU was not enabled before 
> > (2017-08-29 15:23:55 +0200)
> > 
> 
> Applied to u-boot/master, thanks!

Welp, that's what I get for not doing a full build cycle:
https://travis-ci.org/trini/u-boot/jobs/270930592

I've reverted this commit for now, sorry!

-- 
Tom


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


Re: [U-Boot] [U-Boot, 1/2] configs: Migrate all of the existing USB symbols, except fastboot

2017-09-01 Thread Tom Rini
On Fri, Aug 25, 2017 at 05:50:26PM -0400, Tom Rini wrote:

> This syncs all of the currently Kconfig'd symbols out of the headers and
> into the defconfig files.  This has two exceptions, first am335x_evm
> needs to be converted to DM in SPL and then it can stop undef'ing
> CONFIG_DM_USB.  Leaving this as-is results in a build failure, and
> without work, run time failure.  The other case is am43xx_evm.h and in
> turn am43xx_evm_usbhost_boot.  The problem here is that we need DWC3 USB
> host mode in SPL, but still desire to have gadget mode in U-Boot proper.
> 
> Signed-off-by: Tom Rini 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [U-Boot, 2/2] Kconfig: Migrate all of cmd/fastboot/Kconfig to defconfigs

2017-09-01 Thread Tom Rini
On Fri, Aug 25, 2017 at 05:50:27PM -0400, Tom Rini wrote:


Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [PATCH V2] imx: mx7: Add support for USB and normal boot modes

2017-09-01 Thread Troy Kisky
On 8/31/2017 4:13 PM, Troy Kisky wrote:
> On 8/31/2017 4:04 PM, Eric Nelson wrote:
>> On 08/31/2017 03:53 PM, Troy Kisky wrote:
>>> On 8/31/2017 2:28 PM, Troy Kisky wrote:
>>>

 Maybe if you change the WDOG pinmux it might work ?


>>>
>>> Worked for me
>>>
>>> => mm.l 302c
>>> 302c: 0003 ? 0
>>> 302c0004: 0001 ? q
>>> => bmod usb
>>> resetting ...
>>>
>>
>> Hmm...
>>
>> On SABRE-SD or Nitrogen7?
>>
> 
> Nitrogen7,
> 
> It does show up in lsusb afterwards
> Bus 003 Device 100: ID 15a2:0076 Freescale Semiconductor, Inc.
> 
> But imx_usb gets errors afterwards
> 
> == work item
> filename /tftpboot/u-boot.nitrogen7
> load_size 0 bytes
> load_addr 0x
> dcd 1
> clear_dcd 0
> plug 1
> jump_mode 2
> jump_addr 0x
> == end work item
> loading DCD table @0x91
> 
> <<<-564, 1024 bytes>>>
> report 3 in err=-7, last_trans=0  c4 34 03 32
> report 4 in err=-7, last_trans=0  c4 34 03 32
> failed (status 0x320334c4)
> 
> 
> 
> So, close but no cigar.
> 

FYI


=> mw.l 302c 0
=> reset
resetting ...
___

Also just hangs. So, it is not "bmode" specify.



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


Re: [U-Boot] [PATCH] misc: Kconfig: Add SPL_I2C_EEPROM option

2017-09-01 Thread Tom Rini
On Fri, Sep 01, 2017 at 04:01:58PM +0800, Yang, Wenyou wrote:
> Hi,
> 
> Do you have any comments?
> 
> 
> On 2017/8/3 9:00, Wenyou Yang wrote:
> >This option is an SPL-variant of the I2C_EEPROM option to enable
> >the driver for generic I2C-attached EEPROMs for SPL.
> >
> >Signed-off-by: Wenyou Yang 
> >---
> >
> >  drivers/misc/Kconfig  | 8 
> >  drivers/misc/Makefile | 2 +-
> >  2 files changed, 9 insertions(+), 1 deletion(-)
> >
> >diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig
> >index d1ddbbe157..e441031d04 100644
> >--- a/drivers/misc/Kconfig
> >+++ b/drivers/misc/Kconfig
> >@@ -196,4 +196,12 @@ config I2C_EEPROM
> > depends on MISC
> > help
> >   Enable a generic driver for EEPROMs attached via I2C.
> >+
> >+config SPL_I2C_EEPROM
> >+bool "Enable driver for generic I2C-attached EEPROMs for SPL"
> >+depends on MISC && SPL && SPL_DM
> >+help
> >+  This option is an SPL-variant of the I2C_EEPROM option.
> >+  See the help of I2C_EEPROM for details.
> >+
> >  endmenu
> >diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile
> >index 10265c8fb4..21f7e6c6f5 100644
> >--- a/drivers/misc/Makefile
> >+++ b/drivers/misc/Makefile
> >@@ -20,7 +20,7 @@ obj-$(CONFIG_CROS_EC_SPI) += cros_ec_spi.o
> >  endif
> >  obj-$(CONFIG_FSL_IIM) += fsl_iim.o
> >  obj-$(CONFIG_LED_STATUS_GPIO) += gpio_led.o
> >-obj-$(CONFIG_I2C_EEPROM) += i2c_eeprom.o
> >+obj-$(CONFIG_$(SPL_)I2C_EEPROM) += i2c_eeprom.o
> >  obj-$(CONFIG_FSL_MC9SDZ60) += mc9sdz60.o
> >  obj-$(CONFIG_MXC_OCOTP) += mxc_ocotp.o
> >  obj-$(CONFIG_MXS_OCOTP) += mxs_ocotp.o

I'm running behind, sorry.  I hope to grab this and do (and check) the
Kconfig migration soon.

-- 
Tom


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


Re: [U-Boot] [U-Boot, V3] Convert CONFIG_NAND_OMAP_GPMC et al to Kconfig

2017-09-01 Thread Tom Rini
On Sat, Aug 12, 2017 at 09:38:08PM -0500, Adam Ford wrote:

> This converts the following to Kconfig:
>CONFIG_NAND_OMAP_GPMC
>CONFIG_NAND_OMAP_GPMC_PREFETCH
>CONFIG_NAND_OMAP_ELM
>CONFIG_SYS_NAND_BUSWIDTH_16BIT
>CONFIG_SPL_NAND_AM33XX_BCH
>CONFIG_SPL_NAND_SIMPLE (ARCH_OMAP2PLUS only)
> 
> Signed-off-by: Adam Ford 
> 
> V3:
> Remove selection from CMD_NAND
> 
> Changes since V1:
>   Rebased on latest Master
>   Fixed a few missing entries where some features lacked dependancies
> ---

The changelog goes below the '---' :)  And more importantly..

>  configs/am3517_crane_defconfig| 6 --
>  configs/cm_t3517_defconfig| 1 +
>  configs/cm_t35_defconfig  | 1 +
>  configs/omap3_evm_defconfig   | 1 +
>  configs/omap3_ha_defconfig| 6 --
>  configs/tao3530_defconfig | 6 --
>  configs/tricorder_defconfig   | 1 +
>  include/configs/ti_omap3_common.h | 1 -
>  8 files changed, 16 insertions(+), 7 deletions(-)

You forgot the Kconfig part of these changes.

-- 
Tom


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


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

2017-09-01 Thread Stefan Agner


On September 1, 2017 12:25:44 PM PDT, Fabio Estevam  wrote:
>On Fri, Sep 1, 2017 at 3:54 PM, Fabio Estevam 
>wrote:
>
>> I have tested this method and it works, thanks.
>>
>> Do you plan to usptream this method?
>
>Or I can also put your patch as part of my series that adds SDP
>support for imx6qsabresd if you prefer.

Let me do a separate, I guess it could be controversial...

--
Stefan
-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [U-Boot, V3] Convert CONFIG_NAND_OMAP_GPMC et al to Kconfig

2017-09-01 Thread Adam Ford
On Fri, Sep 1, 2017 at 4:54 PM, Tom Rini  wrote:
> On Sat, Aug 12, 2017 at 09:38:08PM -0500, Adam Ford wrote:
>
>> This converts the following to Kconfig:
>>CONFIG_NAND_OMAP_GPMC
>>CONFIG_NAND_OMAP_GPMC_PREFETCH
>>CONFIG_NAND_OMAP_ELM
>>CONFIG_SYS_NAND_BUSWIDTH_16BIT
>>CONFIG_SPL_NAND_AM33XX_BCH
>>CONFIG_SPL_NAND_SIMPLE (ARCH_OMAP2PLUS only)
>>
>> Signed-off-by: Adam Ford 
>>
>> V3:
>> Remove selection from CMD_NAND
>>
>> Changes since V1:
>>   Rebased on latest Master
>>   Fixed a few missing entries where some features lacked dependancies
>> ---
>
> The changelog goes below the '---' :)  And more importantly..
>
>>  configs/am3517_crane_defconfig| 6 --
>>  configs/cm_t3517_defconfig| 1 +
>>  configs/cm_t35_defconfig  | 1 +
>>  configs/omap3_evm_defconfig   | 1 +
>>  configs/omap3_ha_defconfig| 6 --
>>  configs/tao3530_defconfig | 6 --
>>  configs/tricorder_defconfig   | 1 +
>>  include/configs/ti_omap3_common.h | 1 -
>>  8 files changed, 16 insertions(+), 7 deletions(-)
>
> You forgot the Kconfig part of these changes.

My bad.  I didn't add the '--amend' to my git commit, so version 2 &3
totally missed the vast majority of what I had in V1.  Sorry about
that.  I just re-sent V4 with everything from V1-V3 combined into 1
patch.

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


[U-Boot] [PATCH V4] Convert CONFIG_NAND_OMAP_GPMC et al to Kconfig

2017-09-01 Thread Adam Ford
This converts the following to Kconfig:
   CONFIG_NAND_OMAP_GPMC
   CONFIG_NAND_OMAP_GPMC_PREFETCH
   CONFIG_NAND_OMAP_ELM
   CONFIG_SPL_NAND_AM33XX_BCH
   CONFIG_SPL_NAND_SIMPLE (ARCH_OMAP2PLUS only)

Signed-off-by: Adam Ford 
---
V4: Fix missing data from V2-V3
V3: Remove selection from CMD_NAND
V2: Rebased on latest Master
Fixed a few missing entries where some features lacked dependancies

 arch/arm/mach-omap2/Kconfig| 18 +
 configs/am335x_baltos_defconfig|  2 +-
 configs/am335x_evm_defconfig   |  1 +
 configs/am335x_evm_nor_defconfig   |  1 +
 configs/am335x_evm_usbspl_defconfig|  1 +
 configs/am335x_hs_evm_defconfig|  1 +
 configs/am3517_crane_defconfig |  2 ++
 configs/am3517_evm_defconfig   |  1 +
 configs/chiliboard_defconfig   |  2 +-
 configs/cm_t3517_defconfig |  1 +
 configs/cm_t35_defconfig   |  1 +
 configs/eco5pk_defconfig   |  1 +
 configs/mcx_defconfig  |  1 +
 configs/mt_ventoux_defconfig   |  1 +
 configs/omap3_evm_defconfig|  1 +
 configs/omap3_ha_defconfig |  2 ++
 configs/tao3530_defconfig  |  2 ++
 configs/ti816x_evm_defconfig   |  1 +
 configs/tricorder_defconfig|  1 +
 configs/tricorder_flash_defconfig  |  1 +
 configs/twister_defconfig  |  1 +
 drivers/mtd/nand/Kconfig   | 47 +-
 include/configs/am335x_evm.h   |  6 -
 include/configs/am335x_igep003x.h  |  1 -
 include/configs/am3517_crane.h |  2 --
 include/configs/am3517_evm.h   |  3 ---
 include/configs/am43xx_evm.h   |  5 
 include/configs/baltos.h   |  3 ---
 include/configs/bav335x.h  |  5 
 include/configs/brppt1.h   |  3 ---
 include/configs/chiliboard.h   |  6 -
 include/configs/cm_t35.h   |  2 --
 include/configs/cm_t3517.h |  1 -
 include/configs/cm_t43.h   |  1 -
 include/configs/dra7xx_evm.h   |  5 
 include/configs/mcx.h  |  2 --
 include/configs/omap3_beagle.h |  1 -
 include/configs/omap3_cairo.h  |  1 -
 include/configs/omap3_evm.h|  1 -
 include/configs/omap3_igep00x0.h   |  1 -
 include/configs/omap3_logic.h  |  2 --
 include/configs/pengwyn.h  |  2 --
 include/configs/siemens-am33x-common.h |  3 ---
 include/configs/tam3517-common.h   |  3 ---
 include/configs/tao3530.h  |  2 --
 include/configs/ti816x_evm.h   |  4 ---
 include/configs/ti_am335x_common.h |  4 ---
 include/configs/ti_armv7_omap.h|  1 -
 include/configs/ti_omap3_common.h  |  1 -
 include/configs/ti_omap4_common.h  |  4 ---
 include/configs/ti_omap5_common.h  |  4 ---
 include/configs/tricorder.h|  2 --
 scripts/config_whitelist.txt   |  4 ---
 53 files changed, 87 insertions(+), 88 deletions(-)

diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index 72832ad..15e8d54 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -11,6 +11,7 @@ config OMAP34XX
select ARM_ERRATA_621766
select ARM_ERRATA_725233
select USE_TINY_PRINTF
+   imply NAND_OMAP_GPMC
imply SPL_EXT_SUPPORT
imply SPL_FAT_SUPPORT
imply SPL_GPIO_SUPPORT
@@ -19,6 +20,7 @@ config OMAP34XX
imply SPL_LIBDISK_SUPPORT
imply SPL_LIBGENERIC_SUPPORT
imply SPL_MMC_SUPPORT
+   imply SPL_NAND_SIMPLE
imply SPL_NAND_SUPPORT
imply SPL_POWER_SUPPORT
imply SPL_SERIAL_SUPPORT
@@ -29,6 +31,8 @@ config OMAP34XX
 config OMAP44XX
bool "OMAP44XX SoC"
select USE_TINY_PRINTF
+   imply NAND_OMAP_ELM
+   imply NAND_OMAP_GPMC
imply SPL_DISPLAY_PRINT
imply SPL_EXT_SUPPORT
imply SPL_FAT_SUPPORT
@@ -38,6 +42,7 @@ config OMAP44XX
imply SPL_LIBDISK_SUPPORT
imply SPL_LIBGENERIC_SUPPORT
imply SPL_MMC_SUPPORT
+   imply SPL_NAND_AM33XX_BCH
imply SPL_NAND_SUPPORT
imply SPL_POWER_SUPPORT
imply SPL_SERIAL_SUPPORT
@@ -48,6 +53,8 @@ config OMAP54XX
bool "OMAP54XX SoC"
select ARM_ERRATA_798870
select SYS_THUMB_BUILD
+   imply NAND_OMAP_ELM
+   imply NAND_OMAP_GPMC
imply SPL_DISPLAY_PRINT
imply SPL_ENV_SUPPORT
imply SPL_EXT_SUPPORT
@@ -58,6 +65,7 @@ config OMAP54XX
imply SPL_LIBDISK_SUPPORT
imply SPL_LIBGENERIC_SUPPORT
imply SPL_MMC_SUPPORT
+   imply SPL_NAND_AM33XX_BCH
imply SPL_NAND_SUPPORT
imply SPL_POWER_SUPPORT
imply SPL_SERIAL_SUPPORT
@@ -72,6 +80,8 @@ config TI814X
 
 config TI816X
bool "TI816X SoC"
+   imply NAND_OMAP_ELM
+   imply NAND_OMAP_GPMC
help
  Support for AM335x SOC from Texas Instruments.
  Th

[U-Boot] [PATCH] ARM: socfpga: remove unneeded NAND config options

2017-09-01 Thread Masahiro Yamada
CONFIG_NAND_DENALI select's CONFIG_SYS_NAND_SELF_INIT, so the
NAND initialization process is driven by the driver itself.
CONFIG_SYS_NAND_MAX_CHIPS and CONFIG_SYS_NAND_BASE are unused.

Signed-off-by: Masahiro Yamada 
---

 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 175b01ef84a9..4f64c3281e42 100644
--- a/include/configs/socfpga_common.h
+++ b/include/configs/socfpga_common.h
@@ -144,12 +144,10 @@
  */
 #ifdef CONFIG_NAND_DENALI
 #define CONFIG_SYS_MAX_NAND_DEVICE 1
-#define CONFIG_SYS_NAND_MAX_CHIPS  1
 #define CONFIG_SYS_NAND_ONFI_DETECTION
 #define CONFIG_NAND_DENALI_ECC_SIZE512
 #define CONFIG_SYS_NAND_REGS_BASE  SOCFPGA_NANDREGS_ADDRESS
 #define CONFIG_SYS_NAND_DATA_BASE  SOCFPGA_NANDDATA_ADDRESS
-#define CONFIG_SYS_NAND_BASE   (CONFIG_SYS_NAND_DATA_BASE + 0x10)
 #endif
 
 /*
-- 
2.7.4

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


Re: [U-Boot] [U-Boot, 1/2] Configs: Migrate I2C_BUS_MAX to CONFIG_SYS_I2C_BUS_MAX

2017-09-01 Thread Tom Rini
On Fri, Aug 11, 2017 at 06:39:13AM -0500, Adam Ford wrote:

> For consistency with other platforms and in preparation of Kconfig
> migration, let's change Several TI platforms that use I2C_BUS_MAX
> to CONFIG_SYS_I2C_BUS_MAX
> 
> Signed-off-by: Adam Ford 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [U-Boot, 2/2] Convert CONFIG_SYS_I2C_BUS_MAX to Kconfig

2017-09-01 Thread Tom Rini
On Fri, Aug 11, 2017 at 06:39:34AM -0500, Adam Ford wrote:

> This converts the following to Kconfig:
>CONFIG_SYS_I2C_BUS_MAX
> 
> Signed-off-by: Adam Ford 
> Reviewed-by: Heiko Schocher 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] Convert CONFIG_SPL_OMAP3_ID_NAND to Kconfig

2017-09-01 Thread Tom Rini
On Fri, Aug 11, 2017 at 08:51:20AM -0500, Adam Ford wrote:

> This converts the following to Kconfig:
>CONFIG_SPL_OMAP3_ID_NAND
> 
> Signed-off-by: Adam Ford 
> Reviewed-by: Simon Glass 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] Convert CONFIG_BCH to Kconfig

2017-09-01 Thread Tom Rini
On Fri, Aug 11, 2017 at 09:46:05AM -0500, Adam Ford wrote:

> This converts the following to Kconfig:
>CONFIG_BCH
> 
> Signed-off-by: Adam Ford 
> Reviewed-by: Tom Rini 

Applied to u-boot/master, thanks!

-- 
Tom


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