Re: [U-Boot] [PATCHv7 6/7] igep00x0: UBIize

2016-01-25 Thread Heiko Schocher

Hello Enric,

Am 25.01.2016 um 08:26 schrieb Enric Balletbo Serra:

Hi,

2016-01-25 7:39 GMT+01:00 Heiko Schocher :

Hello Enric, Ladislav,

Am 22.01.2016 um 23:35 schrieb Enric Balletbo Serra:


Hi Ladis,

Many thanks for your work on this, see some comments below ...



Sorry, pull request is sent with this patch, see:

http://lists.denx.de/pipermail/u-boot/2016-January/239855.html

@Ladislav: Please send changes in a follow up patch, thanks!




2016-01-21 7:07 GMT+01:00 Heiko Schocher :


Hello Ladislav,

Am 17.01.2016 um 04:16 schrieb Ladislav Michl:



Convert IGEP board to use UBI volumes for U-Boot, its environment and
kernel. With exception of first four sectors read by SoC boot
ROM whole NAND is UBI managed. As code is too big now, drop
CONFIG_SPL_EXT_SUPPORT to make it fit.

Signed-off-by: Ladislav Michl 
---
include/configs/omap3_igep00x0.h | 80
++--
1 file changed, 45 insertions(+), 35 deletions(-)




Reviewed-by: Heiko Schocher 

bye,
Heiko



diff --git a/include/configs/omap3_igep00x0.h
b/include/configs/omap3_igep00x0.h
index 5da6cfd..9afbcbe 100644
--- a/include/configs/omap3_igep00x0.h
+++ b/include/configs/omap3_igep00x0.h
@@ -74,6 +74,8 @@
#define CONFIG_CMD_CACHE
#ifdef CONFIG_BOOT_ONENAND
#define CONFIG_CMD_ONENAND/* ONENAND support  */
+#else
+#define CONFIG_CMD_UBI
#endif
#define CONFIG_CMD_DHCP
#define CONFIG_CMD_PING
@@ -86,6 +88,10 @@
  "stdout=serial\0" \
  "stderr=serial\0"

+#define ENV_MTD_SETTINGS \
+   "mtdids=nand0=gpmc-nand.0\0" \
+   "mtdparts=mtdparts=gpmc-nand.0:512k(SPL),-(UBI)\0"
+



I think this should be protected by CONFIG_BOOT_NAND, if is defined
CONFIG_BOOT_ONENAND the ENV_MTD_SETTINGS are wrong.



Good point ...


Also, as we're changing the memory map, I'd like to change the
reserved space for SPL to 2M instead of 512k, so we cover all NAND
block sizes from (64KB to 512KB)



I do not understand this, but I have no details about the hw ...



The ROM boot on OMAP reads the first 4 blocks searching for the SPL,
in production is a practice flash the SPL 4 times. OneNAND/NAND
devices can have different block sizes and the OMAP ROM boot supports
block sizes from 64KB to 512K. For IGEP boards in particular, at least
there are boards that have block size of 128K and 256K. What I would
meant here is set as default the mtdparts variable to reserve 2M for
SPL, just to cover all the cases.


Thanks for the explanation.


mtdparts=mtdparts=gpmc-nand.0:2m(SPL),-(UBI)\0





#define MEM_LAYOUT_SETTINGS \
  DEFAULT_LINUX_BOOT_ENV \
  "scriptaddr=0x87E0\0" \
@@ -96,36 +102,15 @@

#include 

-
#define CONFIG_EXTRA_ENV_SETTINGS \
  ENV_DEVICE_SETTINGS \
+   ENV_MTD_SETTINGS \
  MEM_LAYOUT_SETTINGS \
  BOOTENV

#endif

/*
- * FLASH and environment organization
- */
-
-#ifdef CONFIG_BOOT_ONENAND
-#define CONFIG_SYS_ONENAND_BASEONENAND_MAP
-
-#define ONENAND_ENV_OFFSET 0x26 /* environment starts
here */
-
-#define CONFIG_ENV_IS_IN_ONENAND   1
-#define CONFIG_ENV_SIZE(512 << 10) /* Total
Size
Environment */
-#define CONFIG_ENV_ADDRONENAND_ENV_OFFSET
-#endif
-
-#ifdef CONFIG_NAND
-#define CONFIG_ENV_OFFSET  0x26 /* environment starts
here */
-#define CONFIG_ENV_IS_IN_NAND  1
-#define CONFIG_ENV_SIZE(512 << 10) /* Total
Size
Environment */
-#define CONFIG_ENV_ADDRNAND_ENV_OFFSET
-#endif
-
-/*
 * SMSC911x Ethernet
 */
#if defined(CONFIG_CMD_NET)
@@ -134,19 +119,50 @@
#define CONFIG_SMC911X_BASE   0x2C00
#endif /* (CONFIG_CMD_NET) */

+/*
+ * FLASH and environment organization
+ */
+#ifdef CONFIG_NAND
+#define CONFIG_SPL_UBI 1
+#define CONFIG_SPL_UBI_MAX_VOL_LEBS256
+#define CONFIG_SPL_UBI_MAX_PEB_SIZE(256*1024)
+#define CONFIG_SPL_UBI_MAX_PEBS4096
+#define CONFIG_SPL_UBI_VOL_IDS 8
+#define CONFIG_SPL_UBI_LOAD_MONITOR_ID 0
+#define CONFIG_SPL_UBI_LOAD_KERNEL_ID  3
+#define CONFIG_SPL_UBI_LOAD_ARGS_ID4
+#define CONFIG_SPL_UBI_PEB_OFFSET  4
+#define CONFIG_SPL_UBI_VID_OFFSET  512
+#define CONFIG_SPL_UBI_LEB_START   2048
+#define CONFIG_SPL_UBI_INFO_ADDR   0x8808
+
+#define CONFIG_ENV_IS_IN_UBI   1
+#define CONFIG_ENV_UBI_PART"UBI"
+#define CONFIG_ENV_UBI_VOLUME  "config"
+#define CONFIG_ENV_UBI_VOLUME_REDUND   "config_r"
+#define CONFIG_UBI_SILENCE_MSG 1
+#define CONFIG_UBIFS_SILENCE_MSG   1
+#else
+#define CONFIG_ENV_IS_NOWHERE
+#endif
+#define CONFIG_ENV_SIZE(32*1024)
+
+#define CONFIG_RBTREE
+#define CONFIG_MTD_PARTITIONS
+#define MTDIDS_DEFAULT "nand0=gpmc-nand.0"
+#define MTDPARTS_DEFAULT
"mtdparts=gpmc-nand.0:512k(SPL),-(UBI)"
+



Same comment as above.


/* OneNAN

[U-Boot] [PATCH] powerpc: tqm834x: Fix build warnings in initdram()

2016-01-25 Thread Bin Meng
With gcc 4.9, it produces the following warnings:

  CC  board/tqc/tqm834x/tqm834x.o
  board/tqc/tqm834x/tqm834x.c: In function 'initdram':
  board/tqc/tqm834x/tqm834x.c:325:12: warning: iteration 3u invokes undefined 
behavior [-Waggressive-loop-optimizations]
  (((base + size - 1) >> CSBNDS_EA_SHIFT) &
  ^
  board/tqc/tqm834x/tqm834x.c:80:2: note: containing loop
  for(cs = 0; cs < 4; ++cs) {
  ^

There is an integer overflow when cs = 3. To fix it, change
parameters of set_cs_bounds() to ulong.

Signed-off-by: Bin Meng 
---

 board/tqc/tqm834x/tqm834x.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/board/tqc/tqm834x/tqm834x.c b/board/tqc/tqm834x/tqm834x.c
index d891a38..eca218c 100644
--- a/board/tqc/tqm834x/tqm834x.c
+++ b/board/tqc/tqm834x/tqm834x.c
@@ -43,7 +43,7 @@ ulong flash_get_size (ulong base, int banknum);
 /* Local functions */
 static int detect_num_flash_banks(void);
 static long int get_ddr_bank_size(short cs, long *base);
-static void set_cs_bounds(short cs, long base, long size);
+static void set_cs_bounds(short cs, ulong base, ulong size);
 static void set_cs_config(short cs, long config);
 static void set_ddr_config(void);
 
@@ -314,7 +314,7 @@ static long int get_ddr_bank_size(short cs, long *base)
 /**
  * Sets DDR bank CS bounds.
  */
-static void set_cs_bounds(short cs, long base, long size)
+static void set_cs_bounds(short cs, ulong base, ulong size)
 {
debug("Setting bounds %08lx, %08lx for cs %d\n", base, size, cs);
if(size == 0){
-- 
1.8.2.1

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


Re: [U-Boot] [PATCH v2 3/8] drivers: net: keystone_net: convert driver to adopt device driver model

2016-01-25 Thread Mugunthan V N
On Saturday 23 January 2016 01:45 AM, Joe Hershberger wrote:
> On Fri, Jan 22, 2016 at 2:23 AM, Mugunthan V N  wrote:
>> Adopt keystone_net driver to adopt device driver model
>>
>> Signed-off-by: Mugunthan V N 
>> Reviewed-by: Tom Rini 
>> ---
>>  drivers/net/keystone_net.c | 418 
>> -
>>  1 file changed, 376 insertions(+), 42 deletions(-)
>>
>> diff --git a/drivers/net/keystone_net.c b/drivers/net/keystone_net.c
>> index 209fae9..21ebaeb 100644
>> --- a/drivers/net/keystone_net.c
>> +++ b/drivers/net/keystone_net.c
>> @@ -10,6 +10,8 @@
>>  #include 
>>  #include 
>>
>> +#include 
>> +
>>  #include 
>>  #include 
>>  #include 
>> @@ -18,10 +20,15 @@
>>  #include 
>>  #include 
>>  #include 
>> +#include 
>> +
>> +DECLARE_GLOBAL_DATA_PTR;
>>
>> +#ifndef CONFIG_DM_ETH
>>  unsigned int emac_open;
>>  static struct mii_dev *mdio_bus;
>>  static unsigned int sys_has_mdio = 1;
>> +#endif
>>
>>  #ifdef KEYSTONE2_EMAC_GIG_ENABLE
>>  #define emac_gigabit_enable(x) keystone2_eth_gigabit_enable(x)
>> @@ -36,40 +43,44 @@ static unsigned int sys_has_mdio = 1;
>>
>>  static u8 rx_buffs[RX_BUFF_NUMS * RX_BUFF_LEN] __aligned(16);
>>
>> +#ifndef CONFIG_DM_ETH
>>  struct rx_buff_desc net_rx_buffs = {
>> .buff_ptr   = rx_buffs,
>> .num_buffs  = RX_BUFF_NUMS,
>> .buff_len   = RX_BUFF_LEN,
>> .rx_flow= 22,
>>  };
>> -
>> -#ifndef CONFIG_SOC_K2G
>> -static void keystone2_net_serdes_setup(void);
>>  #endif
>>
>> -int keystone2_eth_read_mac_addr(struct eth_device *dev)
>> -{
>> -   struct eth_priv_t *eth_priv;
>> -   u32 maca = 0;
>> -   u32 macb = 0;
>> -
>> -   eth_priv = (struct eth_priv_t *)dev->priv;
>> +#ifdef CONFIG_DM_ETH
>>
>> -   /* Read the e-fuse mac address */
>> -   if (eth_priv->slave_port == 1) {
>> -   maca = __raw_readl(MAC_ID_BASE_ADDR);
>> -   macb = __raw_readl(MAC_ID_BASE_ADDR + 4);
>> -   }
>> -
>> -   dev->enetaddr[0] = (macb >>  8) & 0xff;
>> -   dev->enetaddr[1] = (macb >>  0) & 0xff;
>> -   dev->enetaddr[2] = (maca >> 24) & 0xff;
>> -   dev->enetaddr[3] = (maca >> 16) & 0xff;
>> -   dev->enetaddr[4] = (maca >>  8) & 0xff;
>> -   dev->enetaddr[5] = (maca >>  0) & 0xff;
>> +enum link_type {
>> +   LINK_TYPE_MAC_TO_MAC_AUTO = 0,
>> +   LINK_TYPE_MAC_TO_PHY_MODE = 1,
>> +   LINK_TYPE_MAC_TO_MAC_FORCED_MODE = 2,
>> +   LINK_TYPE_MAC_TO_FIBRE_MODE = 3,
>> +   LINK_TYPE_MAC_TO_PHY_NO_MDIO_MODE = 4,
>> +   LINK_TYPE_10G_MAC_TO_PHY_MODE = 10,
>> +   LINK_TYPE_10G_MAC_TO_MAC_FORCED_MODE = 11,
>> +};
>>
>> -   return 0;
>> -}
>> +struct ks2_eth_priv {
>> +   struct udevice  *dev;
>> +   struct phy_device   *phydev;
>> +   struct mii_dev  *mdio_bus;
>> +   int phy_addr;
>> +   phy_interface_t phy_if;
>> +   int sgmii_link_type;
>> +   void*mdio_base;
>> +   struct rx_buff_desc net_rx_buffs;
>> +   struct pktdma_cfg   *netcp_pktdma;
>> +   void*hd;
>> +   int slave_port;
>> +   enum link_type  link_type;
>> +   boolemac_open;
>> +   boolhas_mdio;
>> +};
>> +#endif
>>
>>  /* MDIO */
>>
>> @@ -140,6 +151,7 @@ static int keystone2_mdio_write(struct mii_dev *bus,
>> return 0;
>>  }
>>
>> +#ifndef CONFIG_DM_ETH
>>  static void  __attribute__((unused))
>> keystone2_eth_gigabit_enable(struct eth_device *dev)
>>  {
>> @@ -163,6 +175,31 @@ static void  __attribute__((unused))
>>EMAC_MACCONTROL_GIGFORCE | EMAC_MACCONTROL_GIGABIT_ENABLE,
>>DEVICE_EMACSL_BASE(eth_priv->slave_port - 1) + 
>> CPGMACSL_REG_CTL);
>>  }
>> +#else
>> +static void  __attribute__((unused))
>> +   keystone2_eth_gigabit_enable(struct udevice *dev)
>> +{
>> +   struct ks2_eth_priv *priv = dev_get_priv(dev);
>> +   u_int16_t data;
>> +
>> +   if (priv->has_mdio) {
>> +   data = keystone2_mdio_read(priv->mdio_bus, priv->phy_addr,
>> +  MDIO_DEVAD_NONE, 0);
>> +   /* speed selection MSB */
>> +   if (!(data & (1 << 6)))
>> +   return;
>> +   }
>> +
>> +   /*
>> +* Check if link detected is giga-bit
>> +* If Gigabit mode detected, enable gigbit in MAC
>> +*/
>> +   writel(readl(DEVICE_EMACSL_BASE(priv->slave_port - 1) +
>> +CPGMACSL_REG_CTL) |
>> +  EMAC_MACCONTROL_GIGFORCE | EMAC_MACCONTROL_GIGABIT_ENABLE,
>> +  DEVICE_EMACSL_BASE(priv->slave_port - 1) + CPGMACSL_REG_CTL);
>> +}
>> +#endif
>>
>>  #ifdef CONFIG_SOC_K2G
>>  int keystone_rgmii_config(struct phy_device *phy_dev)
>

Re: [U-Boot] [PATCH v2 3/8] drivers: net: keystone_net: convert driver to adopt device driver model

2016-01-25 Thread Bin Meng
On Fri, Jan 22, 2016 at 4:23 PM, Mugunthan V N  wrote:
> Adopt keystone_net driver to adopt device driver model
>
> Signed-off-by: Mugunthan V N 
> Reviewed-by: Tom Rini 
> ---
>  drivers/net/keystone_net.c | 418 
> -
>  1 file changed, 376 insertions(+), 42 deletions(-)
>
> diff --git a/drivers/net/keystone_net.c b/drivers/net/keystone_net.c
> index 209fae9..21ebaeb 100644
> --- a/drivers/net/keystone_net.c
> +++ b/drivers/net/keystone_net.c
> @@ -10,6 +10,8 @@
>  #include 
>  #include 
>
> +#include 
> +
>  #include 
>  #include 
>  #include 
> @@ -18,10 +20,15 @@
>  #include 
>  #include 
>  #include 
> +#include 
> +
> +DECLARE_GLOBAL_DATA_PTR;
>
> +#ifndef CONFIG_DM_ETH
>  unsigned int emac_open;
>  static struct mii_dev *mdio_bus;
>  static unsigned int sys_has_mdio = 1;
> +#endif
>
>  #ifdef KEYSTONE2_EMAC_GIG_ENABLE
>  #define emac_gigabit_enable(x) keystone2_eth_gigabit_enable(x)
> @@ -36,40 +43,44 @@ static unsigned int sys_has_mdio = 1;
>
>  static u8 rx_buffs[RX_BUFF_NUMS * RX_BUFF_LEN] __aligned(16);
>
> +#ifndef CONFIG_DM_ETH
>  struct rx_buff_desc net_rx_buffs = {
> .buff_ptr   = rx_buffs,
> .num_buffs  = RX_BUFF_NUMS,
> .buff_len   = RX_BUFF_LEN,
> .rx_flow= 22,
>  };
> -
> -#ifndef CONFIG_SOC_K2G
> -static void keystone2_net_serdes_setup(void);
>  #endif
>
> -int keystone2_eth_read_mac_addr(struct eth_device *dev)
> -{
> -   struct eth_priv_t *eth_priv;
> -   u32 maca = 0;
> -   u32 macb = 0;
> -
> -   eth_priv = (struct eth_priv_t *)dev->priv;
> +#ifdef CONFIG_DM_ETH
>
> -   /* Read the e-fuse mac address */
> -   if (eth_priv->slave_port == 1) {
> -   maca = __raw_readl(MAC_ID_BASE_ADDR);
> -   macb = __raw_readl(MAC_ID_BASE_ADDR + 4);
> -   }
> -
> -   dev->enetaddr[0] = (macb >>  8) & 0xff;
> -   dev->enetaddr[1] = (macb >>  0) & 0xff;
> -   dev->enetaddr[2] = (maca >> 24) & 0xff;
> -   dev->enetaddr[3] = (maca >> 16) & 0xff;
> -   dev->enetaddr[4] = (maca >>  8) & 0xff;
> -   dev->enetaddr[5] = (maca >>  0) & 0xff;
> +enum link_type {
> +   LINK_TYPE_MAC_TO_MAC_AUTO = 0,
> +   LINK_TYPE_MAC_TO_PHY_MODE = 1,
> +   LINK_TYPE_MAC_TO_MAC_FORCED_MODE = 2,
> +   LINK_TYPE_MAC_TO_FIBRE_MODE = 3,
> +   LINK_TYPE_MAC_TO_PHY_NO_MDIO_MODE = 4,
> +   LINK_TYPE_10G_MAC_TO_PHY_MODE = 10,
> +   LINK_TYPE_10G_MAC_TO_MAC_FORCED_MODE = 11,
> +};
>
> -   return 0;
> -}
> +struct ks2_eth_priv {
> +   struct udevice  *dev;
> +   struct phy_device   *phydev;
> +   struct mii_dev  *mdio_bus;
> +   int phy_addr;
> +   phy_interface_t phy_if;
> +   int sgmii_link_type;
> +   void*mdio_base;
> +   struct rx_buff_desc net_rx_buffs;
> +   struct pktdma_cfg   *netcp_pktdma;
> +   void*hd;
> +   int slave_port;
> +   enum link_type  link_type;
> +   boolemac_open;
> +   boolhas_mdio;
> +};
> +#endif
>
>  /* MDIO */
>
> @@ -140,6 +151,7 @@ static int keystone2_mdio_write(struct mii_dev *bus,
> return 0;
>  }
>
> +#ifndef CONFIG_DM_ETH
>  static void  __attribute__((unused))
> keystone2_eth_gigabit_enable(struct eth_device *dev)
>  {
> @@ -163,6 +175,31 @@ static void  __attribute__((unused))
>EMAC_MACCONTROL_GIGFORCE | EMAC_MACCONTROL_GIGABIT_ENABLE,
>DEVICE_EMACSL_BASE(eth_priv->slave_port - 1) + 
> CPGMACSL_REG_CTL);
>  }
> +#else
> +static void  __attribute__((unused))
> +   keystone2_eth_gigabit_enable(struct udevice *dev)
> +{
> +   struct ks2_eth_priv *priv = dev_get_priv(dev);
> +   u_int16_t data;
> +
> +   if (priv->has_mdio) {
> +   data = keystone2_mdio_read(priv->mdio_bus, priv->phy_addr,
> +  MDIO_DEVAD_NONE, 0);
> +   /* speed selection MSB */
> +   if (!(data & (1 << 6)))
> +   return;
> +   }
> +
> +   /*
> +* Check if link detected is giga-bit
> +* If Gigabit mode detected, enable gigbit in MAC
> +*/
> +   writel(readl(DEVICE_EMACSL_BASE(priv->slave_port - 1) +
> +CPGMACSL_REG_CTL) |
> +  EMAC_MACCONTROL_GIGFORCE | EMAC_MACCONTROL_GIGABIT_ENABLE,
> +  DEVICE_EMACSL_BASE(priv->slave_port - 1) + CPGMACSL_REG_CTL);
> +}
> +#endif
>
>  #ifdef CONFIG_SOC_K2G
>  int keystone_rgmii_config(struct phy_device *phy_dev)
> @@ -401,6 +438,58 @@ int ethss_stop(void)
> return 0;
>  }
>
> +struct ks2_serdes ks2_serdes_sgmii_156p25mhz = {
> +   .clk = SERDES_CLOCK_156P25M,
> +   .rate = SERDES_RATE_5G,
> +   .rate_

[U-Boot] [PATCH] net: eepro100: Fix build warnings

2016-01-25 Thread Bin Meng
When building katmai, it reports quite a lot

  warning: cast to pointer from integer of different size 
[-Wint-to-pointer-cast]

Fix this by casting the dev->iobase with u_long.

Signed-off-by: Bin Meng 
---

 drivers/net/eepro100.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/eepro100.c b/drivers/net/eepro100.c
index f2cd32c..d4a6386 100644
--- a/drivers/net/eepro100.c
+++ b/drivers/net/eepro100.c
@@ -240,23 +240,23 @@ static void eepro100_halt (struct eth_device *dev);
 
 static inline int INW (struct eth_device *dev, u_long addr)
 {
-   return le16_to_cpu (*(volatile u16 *) (addr + dev->iobase));
+   return le16_to_cpu(*(volatile u16 *)(addr + (u_long)dev->iobase));
 }
 
 static inline void OUTW (struct eth_device *dev, int command, u_long addr)
 {
-   *(volatile u16 *) ((addr + dev->iobase)) = cpu_to_le16 (command);
+   *(volatile u16 *)((addr + (u_long)dev->iobase)) = cpu_to_le16(command);
 }
 
 static inline void OUTL (struct eth_device *dev, int command, u_long addr)
 {
-   *(volatile u32 *) ((addr + dev->iobase)) = cpu_to_le32 (command);
+   *(volatile u32 *)((addr + (u_long)dev->iobase)) = cpu_to_le32(command);
 }
 
 #if defined(CONFIG_MII) || defined(CONFIG_CMD_MII)
 static inline int INL (struct eth_device *dev, u_long addr)
 {
-   return le32_to_cpu (*(volatile u32 *) (addr + dev->iobase));
+   return le32_to_cpu(*(volatile u32 *)(addr + (u_long)dev->iobase));
 }
 
 static int get_phyreg (struct eth_device *dev, unsigned char addr,
-- 
1.8.2.1

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


Re: [U-Boot] [GIT PULL] Microblaze changes

2016-01-25 Thread Michal Simek
Hi,

On 22.1.2016 19:34, Ricardo Ribalda Delgado wrote:
> Hi
> 
> My main concern is that the support for the board is not removed. I have
> one active product based on virtex5 ppc440.
> 
> Today I had to do some last minute support and now I am on a plane...
> Otherwise the patchset would be on your inbox.
> 
> I have taken a fast look over the required changes, and it is not that bad.
> Most of the hard work has already been done by you for mblaze.
> 
> Thanks for your understanding ;).

You got max 2 more days to solve it. After that I will just disable
uartlite support for this platform and will send updated pull request as
we discussed with Tom.

Thanks,
Michal


-- 
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Microblaze cpu - http://www.monstr.eu/fdt/
Maintainer of Linux kernel - Xilinx Zynq ARM architecture
Microblaze U-BOOT custodian and responsible for u-boot arm zynq platform




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


[U-Boot] [PATCH] openrisc: Fix build errors

2016-01-25 Thread Bin Meng
With kernel.org toolchain, it reports:

  CC  arch/openrisc/lib/board.o
  arch/openrisc/lib/board.c:56:2: error: 'console_init_f' undeclared here (not 
in a function)
  arch/openrisc/lib/board.c: In function 'board_init':
  arch/openrisc/lib/board.c:120:2: warning: implicit declaration of function 
'console_init_r'
  make[1]: *** [arch/openrisc/lib/board.o] Error 1
  make: *** [arch/openrisc/lib] Error 2

Include console.h will fix this.

Signed-off-by: Bin Meng 
---

 arch/openrisc/lib/board.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/openrisc/lib/board.c b/arch/openrisc/lib/board.c
index c26cc8f..b7fbd2f 100644
--- a/arch/openrisc/lib/board.c
+++ b/arch/openrisc/lib/board.c
@@ -13,6 +13,7 @@
  */
 
 #include 
+#include 
 #include 
 #include 
 #include 
-- 
1.8.2.1

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


Re: [U-Boot] [PATCH] openrisc: updating build tools naming convention

2016-01-25 Thread Bin Meng
Hi Guillaume,

On Sun, Nov 8, 2015 at 10:37 PM, Guillaume REMBERT
 wrote:
> Dear u-boot community,
>
> I just made a small change on the openrisc-generic platform
> configuration to take in account the new naming convention (or1k instead
> of or32, so the build process gets fine).
>
> Could you take care to review and approve the following patch, please?
>
> Kind regards,
>
> --
> 
>
> Guillaume REMBERT
> Phone/Fax: 0033 9 72 32 55 76
> Mobile: 0033 6 83 27 98 19
> E-Mail: guillaume.remb...@euryecetelecom.com
> 
>
> On Earth and Space...
>   EURYECE TELECOM
> ... where failure is not an option
> http://www.euryecetelecom.com
> __
>
>
>
>
>
>
>
>
> 51d13f5355943e14db4b95a7f8ae4cd87eba1fe1
>  arch/openrisc/config.mk  | 2 +-
>  arch/openrisc/cpu/u-boot.lds | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/openrisc/config.mk b/arch/openrisc/config.mk
> index cd95f24..bfdb71f 100644
> --- a/arch/openrisc/config.mk
> +++ b/arch/openrisc/config.mk
> @@ -6,7 +6,7 @@
>  #
>
>  ifeq ($(CROSS_COMPILE),)
> -CROSS_COMPILE := or32-elf-
> +CROSS_COMPILE := or1k-elf-
>  endif
>
>  # r10 used for global object pointer, already set in OR32 GCC but just
> to be
> diff --git a/arch/openrisc/cpu/u-boot.lds b/arch/openrisc/cpu/u-boot.lds
> index d9bb7b7..854088b 100644
> --- a/arch/openrisc/cpu/u-boot.lds
> +++ b/arch/openrisc/cpu/u-boot.lds
> @@ -1,5 +1,5 @@
>  #include 
> -OUTPUT_ARCH(or32)
> +OUTPUT_ARCH(or1k)
>  __DYNAMIC  =  0;
>

Can you please mention which toolchain are you using for or1k?
Currently the kernel.org or32 toolchain cannot build U-Boot anymore
with your patch.

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


[U-Boot] [PATCH] ARM: zynq: zynqmp: Line up checkboard message

2016-01-25 Thread Michal Simek
Use space instead of tab in checkboard print to aligned
it with others boards.

Signed-off-by: Michal Simek 
---

 board/xilinx/zynq/board.c| 2 +-
 board/xilinx/zynqmp/zynqmp.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/board/xilinx/zynq/board.c b/board/xilinx/zynq/board.c
index 414f5302a066..477385b442a1 100644
--- a/board/xilinx/zynq/board.c
+++ b/board/xilinx/zynq/board.c
@@ -94,7 +94,7 @@ int board_late_init(void)
 #ifdef CONFIG_DISPLAY_BOARDINFO
 int checkboard(void)
 {
-   puts("Board:\tXilinx Zynq\n");
+   puts("Board: Xilinx Zynq\n");
return 0;
 }
 #endif
diff --git a/board/xilinx/zynqmp/zynqmp.c b/board/xilinx/zynqmp/zynqmp.c
index 1a837897194e..44d347ed3bf0 100644
--- a/board/xilinx/zynqmp/zynqmp.c
+++ b/board/xilinx/zynqmp/zynqmp.c
@@ -117,7 +117,7 @@ int board_late_init(void)
 
 int checkboard(void)
 {
-   puts("Board:\tXilinx ZynqMP\n");
+   puts("Board: Xilinx ZynqMP\n");
return 0;
 }
 
-- 
1.9.1

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


Re: [U-Boot] [PATCH] ARM: zynq: zynqmp: Line up checkboard message

2016-01-25 Thread Michal Simek
On 25.1.2016 11:08, Michal Simek wrote:
> Use space instead of tab in checkboard print to aligned
> it with others boards.
> 
> Signed-off-by: Michal Simek 
> ---
> 
>  board/xilinx/zynq/board.c| 2 +-
>  board/xilinx/zynqmp/zynqmp.c | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/board/xilinx/zynq/board.c b/board/xilinx/zynq/board.c
> index 414f5302a066..477385b442a1 100644
> --- a/board/xilinx/zynq/board.c
> +++ b/board/xilinx/zynq/board.c
> @@ -94,7 +94,7 @@ int board_late_init(void)
>  #ifdef CONFIG_DISPLAY_BOARDINFO
>  int checkboard(void)
>  {
> - puts("Board:\tXilinx Zynq\n");
> + puts("Board: Xilinx Zynq\n");
>   return 0;
>  }
>  #endif
> diff --git a/board/xilinx/zynqmp/zynqmp.c b/board/xilinx/zynqmp/zynqmp.c
> index 1a837897194e..44d347ed3bf0 100644
> --- a/board/xilinx/zynqmp/zynqmp.c
> +++ b/board/xilinx/zynqmp/zynqmp.c
> @@ -117,7 +117,7 @@ int board_late_init(void)
>  
>  int checkboard(void)
>  {
> - puts("Board:\tXilinx ZynqMP\n");
> + puts("Board: Xilinx ZynqMP\n");
>   return 0;
>  }
>  
> 

Just a note

Reported-by: David Glessner 

Thanks,
Michal

-- 
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Microblaze cpu - http://www.monstr.eu/fdt/
Maintainer of Linux kernel - Xilinx Zynq ARM architecture
Microblaze U-BOOT custodian and responsible for u-boot arm zynq platform




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


Re: [U-Boot] [PATCH v2 3/8] drivers: net: keystone_net: convert driver to adopt device driver model

2016-01-25 Thread Mugunthan V N
On Monday 25 January 2016 02:05 PM, Bin Meng wrote:
> On Fri, Jan 22, 2016 at 4:23 PM, Mugunthan V N  wrote:
>> Adopt keystone_net driver to adopt device driver model
>>
>> Signed-off-by: Mugunthan V N 
>> Reviewed-by: Tom Rini 
>> ---
>>  drivers/net/keystone_net.c | 418 
>> -
>>  1 file changed, 376 insertions(+), 42 deletions(-)
>>
>> diff --git a/drivers/net/keystone_net.c b/drivers/net/keystone_net.c
>> index 209fae9..21ebaeb 100644
>> --- a/drivers/net/keystone_net.c
>> +++ b/drivers/net/keystone_net.c
>> @@ -10,6 +10,8 @@
>>  #include 
>>  #include 
>>
>> +#include 
>> +
>>  #include 
>>  #include 
>>  #include 
>> @@ -18,10 +20,15 @@
>>  #include 
>>  #include 
>>  #include 
>> +#include 
>> +
>> +DECLARE_GLOBAL_DATA_PTR;
>>
>> +#ifndef CONFIG_DM_ETH
>>  unsigned int emac_open;
>>  static struct mii_dev *mdio_bus;
>>  static unsigned int sys_has_mdio = 1;
>> +#endif
>>
>>  #ifdef KEYSTONE2_EMAC_GIG_ENABLE
>>  #define emac_gigabit_enable(x) keystone2_eth_gigabit_enable(x)
>> @@ -36,40 +43,44 @@ static unsigned int sys_has_mdio = 1;
>>
>>  static u8 rx_buffs[RX_BUFF_NUMS * RX_BUFF_LEN] __aligned(16);
>>
>> +#ifndef CONFIG_DM_ETH
>>  struct rx_buff_desc net_rx_buffs = {
>> .buff_ptr   = rx_buffs,
>> .num_buffs  = RX_BUFF_NUMS,
>> .buff_len   = RX_BUFF_LEN,
>> .rx_flow= 22,
>>  };
>> -
>> -#ifndef CONFIG_SOC_K2G
>> -static void keystone2_net_serdes_setup(void);
>>  #endif
>>
>> -int keystone2_eth_read_mac_addr(struct eth_device *dev)
>> -{
>> -   struct eth_priv_t *eth_priv;
>> -   u32 maca = 0;
>> -   u32 macb = 0;
>> -
>> -   eth_priv = (struct eth_priv_t *)dev->priv;
>> +#ifdef CONFIG_DM_ETH
>>
>> -   /* Read the e-fuse mac address */
>> -   if (eth_priv->slave_port == 1) {
>> -   maca = __raw_readl(MAC_ID_BASE_ADDR);
>> -   macb = __raw_readl(MAC_ID_BASE_ADDR + 4);
>> -   }
>> -
>> -   dev->enetaddr[0] = (macb >>  8) & 0xff;
>> -   dev->enetaddr[1] = (macb >>  0) & 0xff;
>> -   dev->enetaddr[2] = (maca >> 24) & 0xff;
>> -   dev->enetaddr[3] = (maca >> 16) & 0xff;
>> -   dev->enetaddr[4] = (maca >>  8) & 0xff;
>> -   dev->enetaddr[5] = (maca >>  0) & 0xff;
>> +enum link_type {
>> +   LINK_TYPE_MAC_TO_MAC_AUTO = 0,
>> +   LINK_TYPE_MAC_TO_PHY_MODE = 1,
>> +   LINK_TYPE_MAC_TO_MAC_FORCED_MODE = 2,
>> +   LINK_TYPE_MAC_TO_FIBRE_MODE = 3,
>> +   LINK_TYPE_MAC_TO_PHY_NO_MDIO_MODE = 4,
>> +   LINK_TYPE_10G_MAC_TO_PHY_MODE = 10,
>> +   LINK_TYPE_10G_MAC_TO_MAC_FORCED_MODE = 11,
>> +};
>>
>> -   return 0;
>> -}
>> +struct ks2_eth_priv {
>> +   struct udevice  *dev;
>> +   struct phy_device   *phydev;
>> +   struct mii_dev  *mdio_bus;
>> +   int phy_addr;
>> +   phy_interface_t phy_if;
>> +   int sgmii_link_type;
>> +   void*mdio_base;
>> +   struct rx_buff_desc net_rx_buffs;
>> +   struct pktdma_cfg   *netcp_pktdma;
>> +   void*hd;
>> +   int slave_port;
>> +   enum link_type  link_type;
>> +   boolemac_open;
>> +   boolhas_mdio;
>> +};
>> +#endif
>>
>>  /* MDIO */
>>
>> @@ -140,6 +151,7 @@ static int keystone2_mdio_write(struct mii_dev *bus,
>> return 0;
>>  }
>>
>> +#ifndef CONFIG_DM_ETH
>>  static void  __attribute__((unused))
>> keystone2_eth_gigabit_enable(struct eth_device *dev)
>>  {
>> @@ -163,6 +175,31 @@ static void  __attribute__((unused))
>>EMAC_MACCONTROL_GIGFORCE | EMAC_MACCONTROL_GIGABIT_ENABLE,
>>DEVICE_EMACSL_BASE(eth_priv->slave_port - 1) + 
>> CPGMACSL_REG_CTL);
>>  }
>> +#else
>> +static void  __attribute__((unused))
>> +   keystone2_eth_gigabit_enable(struct udevice *dev)
>> +{
>> +   struct ks2_eth_priv *priv = dev_get_priv(dev);
>> +   u_int16_t data;
>> +
>> +   if (priv->has_mdio) {
>> +   data = keystone2_mdio_read(priv->mdio_bus, priv->phy_addr,
>> +  MDIO_DEVAD_NONE, 0);
>> +   /* speed selection MSB */
>> +   if (!(data & (1 << 6)))
>> +   return;
>> +   }
>> +
>> +   /*
>> +* Check if link detected is giga-bit
>> +* If Gigabit mode detected, enable gigbit in MAC
>> +*/
>> +   writel(readl(DEVICE_EMACSL_BASE(priv->slave_port - 1) +
>> +CPGMACSL_REG_CTL) |
>> +  EMAC_MACCONTROL_GIGFORCE | EMAC_MACCONTROL_GIGABIT_ENABLE,
>> +  DEVICE_EMACSL_BASE(priv->slave_port - 1) + CPGMACSL_REG_CTL);
>> +}
>> +#endif
>>
>>  #ifdef CONFIG_SOC_K2G
>>  int keystone_rgmii_config(struct phy_device *phy_dev)
>> @@ -401

Re: [U-Boot] [PATCH] ARM: zynq: zynqmp: Line up checkboard message

2016-01-25 Thread Moritz Fischer
Hi Michal,

On Mon, Jan 25, 2016 at 11:09 AM, Michal Simek  wrote:
> On 25.1.2016 11:08, Michal Simek wrote:
>> Use space instead of tab in checkboard print to aligned
>> it with others boards.
>>
>> Signed-off-by: Michal Simek 
Reviewed-by: Moritz Fischer 

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


Re: [U-Boot] [PATCH] usb: xhci: Fix vendor command error if the request type is USB_REQ_SET_ADDRESS or USB_REQ_SET_CONFIGURATION.

2016-01-25 Thread Ted
Hi Marek, 

> -Original Message-
> From: Marek Vasut [mailto:ma...@denx.de] 
> Sent: Thursday, November 26, 2015 9:25 AM
> To: Ted
> Cc: swar...@nvidia.com; u-boot@lists.denx.de; 
> linux.am...@gmail.com; Hans de Goede
> Subject: Re: [PATCH] usb: xhci: Fix vendor command error if 
> the request type is USB_REQ_SET_ADDRESS or USB_REQ_SET_CONFIGURATION.
> 
> On Wednesday, November 25, 2015 at 06:57:48 AM, Ted Chen wrote:
> > Add a condition of set_address and set_configuration to 
> check if the 
> > request is standardized.
> > 
> > Signed-off-by: Ted Chen 
> > ---
> >  drivers/usb/host/xhci.c |6 --
> >  1 file changed, 4 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/usb/host/xhci.c 
> b/drivers/usb/host/xhci.c index 
> > ca598aa..cb8a04b 100644
> > --- a/drivers/usb/host/xhci.c
> > +++ b/drivers/usb/host/xhci.c
> > @@ -941,10 +941,12 @@ static int _xhci_submit_control_msg(struct 
> > usb_device *udev, unsigned long pipe, if 
> (usb_pipedevice(pipe) == ctrl->rootdev)
> > return xhci_submit_root(udev, pipe, buffer, setup);
> > 
> 
> Hi!
> What do you say we reorder the check a little:
> 
> if ((setup->requesttype & USB_TYPE_MASK) == USB_TYPE_STANDARD) {
>   if (setup->request == USB_REQ_SET_ADDRESS)
>   return xhci_address_device(udev, root_portnr);
> 
>   if (setup->request == USB_REQ_SET_CONFIGURATION)
>   ...
> }
> 
> Also, I suspect this sort of fix needs to be applied to at 
> least dwc3 ep0.c, r8a66597-hcd.c and musb_hcd.c as well.
> 

I don't have another board in my hand, so I can't verify the other xhci host 
controller.

But I have confirmed this patch in xhci.c actually can fix errors while  the 
the request type is USB_REQ_SET_ADDRESS or USB_REQ_SET_CONFIGURATION in USB 
vendor command.

> Paging Hans so he can share his visdom too :)

Hi Hans,

Do you have any comments?

Thanks

> 
> > -   if (setup->request == USB_REQ_SET_ADDRESS)
> > +   if (setup->request == USB_REQ_SET_ADDRESS &&
> > +  (setup->requesttype & USB_TYPE_MASK) == USB_TYPE_STANDARD)
> > return xhci_address_device(udev, root_portnr);
> > 
> > -   if (setup->request == USB_REQ_SET_CONFIGURATION) {
> > +   if (setup->request == USB_REQ_SET_CONFIGURATION &&
> > +  (setup->requesttype & USB_TYPE_MASK) == USB_TYPE_STANDARD) {
> > ret = xhci_set_configuration(udev);
> > if (ret) {
> > puts("Failed to configure xHCI endpoint\n");
> 
> Best regards,
> Marek Vasut
> 
> --Please consider the environment before printing this e-mail.
> 
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [Patch V3 1/3] qe: move drivers/qe/qe.h to include/fsl_qe.h

2016-01-25 Thread Gong Qianyu
As the QE firmware struct is shared with Fman, move the header file
out of drivers/qe/.

Signed-off-by: Gong Qianyu 
---
V3:
 - Move file changes about "qe.h" to this patch.
V2:
 - New Patch.

 arch/powerpc/cpu/mpc85xx/cpu_init.c | 2 +-
 arch/powerpc/cpu/mpc85xx/fdt.c  | 2 +-
 board/freescale/common/arm_sleep.c  | 2 +-
 board/freescale/common/mpc85xx_sleep.c  | 2 +-
 board/freescale/ls1021aqds/ls1021aqds.c | 2 +-
 board/freescale/ls1021atwr/ls1021atwr.c | 2 +-
 drivers/net/fm/fm.c | 2 +-
 drivers/qe/fdt.c| 2 +-
 drivers/qe/qe.c | 2 +-
 drivers/qe/uccf.c   | 2 +-
 drivers/qe/uccf.h   | 2 +-
 drivers/qe/uec.c| 2 +-
 drivers/qe/uec.h| 2 +-
 drivers/qe/uec_phy.c| 2 +-
 drivers/qe/qe.h => include/fsl_qe.h | 0
 15 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/arch/powerpc/cpu/mpc85xx/cpu_init.c 
b/arch/powerpc/cpu/mpc85xx/cpu_init.c
index bd81a0d..78f1f39 100644
--- a/arch/powerpc/cpu/mpc85xx/cpu_init.c
+++ b/arch/powerpc/cpu/mpc85xx/cpu_init.c
@@ -45,7 +45,7 @@
 
 #include "../../../../drivers/block/fsl_sata.h"
 #ifdef CONFIG_U_QE
-#include "../../../../drivers/qe/qe.h"
+#include 
 #endif
 
 DECLARE_GLOBAL_DATA_PTR;
diff --git a/arch/powerpc/cpu/mpc85xx/fdt.c b/arch/powerpc/cpu/mpc85xx/fdt.c
index 7270be1..50eef05 100644
--- a/arch/powerpc/cpu/mpc85xx/fdt.c
+++ b/arch/powerpc/cpu/mpc85xx/fdt.c
@@ -19,7 +19,7 @@
 #ifdef CONFIG_FSL_ESDHC
 #include 
 #endif
-#include "../../../../drivers/qe/qe.h" /* For struct qe_firmware */
+#include /* For struct qe_firmware */
 
 DECLARE_GLOBAL_DATA_PTR;
 
diff --git a/board/freescale/common/arm_sleep.c 
b/board/freescale/common/arm_sleep.c
index a498c65..71ed15e 100644
--- a/board/freescale/common/arm_sleep.c
+++ b/board/freescale/common/arm_sleep.c
@@ -19,7 +19,7 @@
 
 #include "sleep.h"
 #ifdef CONFIG_U_QE
-#include "../../../drivers/qe/qe.h"
+#include 
 #endif
 
 DECLARE_GLOBAL_DATA_PTR;
diff --git a/board/freescale/common/mpc85xx_sleep.c 
b/board/freescale/common/mpc85xx_sleep.c
index e9cbd51..498d770 100644
--- a/board/freescale/common/mpc85xx_sleep.c
+++ b/board/freescale/common/mpc85xx_sleep.c
@@ -8,7 +8,7 @@
 #include 
 #include "sleep.h"
 #ifdef CONFIG_U_QE
-#include "../../../drivers/qe/qe.h"
+#include 
 #endif
 
 DECLARE_GLOBAL_DATA_PTR;
diff --git a/board/freescale/ls1021aqds/ls1021aqds.c 
b/board/freescale/ls1021aqds/ls1021aqds.c
index ca1ea61..639d5a7 100644
--- a/board/freescale/ls1021aqds/ls1021aqds.c
+++ b/board/freescale/ls1021aqds/ls1021aqds.c
@@ -27,7 +27,7 @@
 #include "../common/qixis.h"
 #include "ls1021aqds_qixis.h"
 #ifdef CONFIG_U_QE
-#include "../../../drivers/qe/qe.h"
+#include 
 #endif
 
 #define PIN_MUX_SEL_CAN0x03
diff --git a/board/freescale/ls1021atwr/ls1021atwr.c 
b/board/freescale/ls1021atwr/ls1021atwr.c
index ae62bca..772da72 100644
--- a/board/freescale/ls1021atwr/ls1021atwr.c
+++ b/board/freescale/ls1021atwr/ls1021atwr.c
@@ -28,7 +28,7 @@
 #include 
 #include "../common/sleep.h"
 #ifdef CONFIG_U_QE
-#include "../../../drivers/qe/qe.h"
+#include 
 #endif
 
 
diff --git a/drivers/net/fm/fm.c b/drivers/net/fm/fm.c
index df5db72..16d793e 100644
--- a/drivers/net/fm/fm.c
+++ b/drivers/net/fm/fm.c
@@ -10,7 +10,7 @@
 #include 
 
 #include "fm.h"
-#include "../../qe/qe.h"   /* For struct qe_firmware */
+#include /* For struct qe_firmware */
 
 #ifdef CONFIG_SYS_QE_FMAN_FW_IN_NAND
 #include 
diff --git a/drivers/qe/fdt.c b/drivers/qe/fdt.c
index dfae4bf..4f48f98 100644
--- a/drivers/qe/fdt.c
+++ b/drivers/qe/fdt.c
@@ -10,7 +10,7 @@
 #include 
 #include 
 #include 
-#include "qe.h"
+#include 
 
 #ifdef CONFIG_QE
 DECLARE_GLOBAL_DATA_PTR;
diff --git a/drivers/qe/qe.c b/drivers/qe/qe.c
index 08620b2..8f00817 100644
--- a/drivers/qe/qe.c
+++ b/drivers/qe/qe.c
@@ -12,7 +12,7 @@
 #include "asm/errno.h"
 #include "asm/io.h"
 #include "linux/immap_qe.h"
-#include "qe.h"
+#include 
 #ifdef CONFIG_LS102XA
 #include 
 #endif
diff --git a/drivers/qe/uccf.c b/drivers/qe/uccf.c
index 85386bf..e011886 100644
--- a/drivers/qe/uccf.c
+++ b/drivers/qe/uccf.c
@@ -12,8 +12,8 @@
 #include "asm/errno.h"
 #include "asm/io.h"
 #include "linux/immap_qe.h"
-#include "qe.h"
 #include "uccf.h"
+#include 
 
 void ucc_fast_transmit_on_demand(ucc_fast_private_t *uccf)
 {
diff --git a/drivers/qe/uccf.h b/drivers/qe/uccf.h
index 55941e4..aa817e7 100644
--- a/drivers/qe/uccf.h
+++ b/drivers/qe/uccf.h
@@ -11,8 +11,8 @@
 #define __UCCF_H__
 
 #include "common.h"
-#include "qe.h"
 #include "linux/immap_qe.h"
+#include 
 
 /* Fast or Giga ethernet
 */
diff --git a/drivers/qe/uec.c b/drivers/qe/uec.c
index e0ab04a..402 100644
--- a/drivers/qe/uec.c
+++ b/drivers/qe/uec.c
@@ -12,11 +12,11 @@
 #include "asm/errno.h"
 #include "asm/io.h"
 #include "linux/immap_qe.h"
-#include "qe.h"
 #include "uccf.h"
 #include "uec.h

[U-Boot] [Patch V3 3/3] armv8/fsl-layerscape: fdt: add fixup for Fman ucode

2016-01-25 Thread Gong Qianyu
Add fdt fixup to insert Fman firmware into the device tree.

Signed-off-by: Gong Qianyu 
---
V3:
 - Remove fman clock fixup.
 - Revise commit message too.
V2:
 - Removed the duplicated function.

 arch/arm/cpu/armv8/fsl-layerscape/fdt.c | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/arch/arm/cpu/armv8/fsl-layerscape/fdt.c 
b/arch/arm/cpu/armv8/fsl-layerscape/fdt.c
index 4e4861d..9c18fd7 100644
--- a/arch/arm/cpu/armv8/fsl-layerscape/fdt.c
+++ b/arch/arm/cpu/armv8/fsl-layerscape/fdt.c
@@ -14,6 +14,9 @@
 #ifdef CONFIG_FSL_ESDHC
 #include 
 #endif
+#ifdef CONFIG_SYS_DPAA_FMAN
+#include 
+#endif
 #ifdef CONFIG_MP
 #include 
 #endif
@@ -204,4 +207,8 @@ void ft_cpu_setup(void *blob, bd_t *bd)
 #ifdef CONFIG_FSL_LSCH3
fdt_fixup_smmu(blob);
 #endif
+
+#ifdef CONFIG_SYS_DPAA_FMAN
+   fdt_fixup_fman_firmware(blob);
+#endif
 }
-- 
2.1.0.27.g96db324

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


[U-Boot] [Patch V3 2/3] fm: fdt: Move fman ucode fixup to Fman driver code

2016-01-25 Thread Gong Qianyu
Both Freescale Layerscape and powerpc/mpc85xx platforms are using
fdt_fixup_fman_firmware() to insert Fman ucode blob into the device
tree. So move the function to driver code.

Signed-off-by: Gong Qianyu 
---
V3:
 - Remove file changes about "qe.h".
   (Should be put in the first patch of this patchset)
V2:
 - New patch.

 arch/powerpc/cpu/mpc85xx/fdt.c | 125 ++-
 drivers/net/fm/Makefile|   1 +
 drivers/net/fm/fdt.c   | 129 +
 include/fsl_fman.h |   1 +
 4 files changed, 136 insertions(+), 120 deletions(-)

diff --git a/arch/powerpc/cpu/mpc85xx/fdt.c b/arch/powerpc/cpu/mpc85xx/fdt.c
index 50eef05..ced216c 100644
--- a/arch/powerpc/cpu/mpc85xx/fdt.c
+++ b/arch/powerpc/cpu/mpc85xx/fdt.c
@@ -19,7 +19,9 @@
 #ifdef CONFIG_FSL_ESDHC
 #include 
 #endif
-#include /* For struct qe_firmware */
+#ifdef CONFIG_SYS_DPAA_FMAN
+#include 
+#endif
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -488,125 +490,6 @@ static void ft_fixup_qe_snum(void *blob)
 }
 #endif
 
-/**
- * fdt_fixup_fman_firmware -- insert the Fman firmware into the device tree
- *
- * The binding for an Fman firmware node is documented in
- * Documentation/powerpc/dts-bindings/fsl/dpaa/fman.txt.  This node contains
- * the actual Fman firmware binary data.  The operating system is expected to
- * be able to parse the binary data to determine any attributes it needs.
- */
-#ifdef CONFIG_SYS_DPAA_FMAN
-void fdt_fixup_fman_firmware(void *blob)
-{
-   int rc, fmnode, fwnode = -1;
-   uint32_t phandle;
-   struct qe_firmware *fmanfw;
-   const struct qe_header *hdr;
-   unsigned int length;
-   uint32_t crc;
-   const char *p;
-
-   /* The first Fman we find will contain the actual firmware. */
-   fmnode = fdt_node_offset_by_compatible(blob, -1, "fsl,fman");
-   if (fmnode < 0)
-   /* Exit silently if there are no Fman devices */
-   return;
-
-   /* If we already have a firmware node, then also exit silently. */
-   if (fdt_node_offset_by_compatible(blob, -1, "fsl,fman-firmware") > 0)
-   return;
-
-   /* If the environment variable is not set, then exit silently */
-   p = getenv("fman_ucode");
-   if (!p)
-   return;
-
-   fmanfw = (struct qe_firmware *) simple_strtoul(p, NULL, 16);
-   if (!fmanfw)
-   return;
-
-   hdr = &fmanfw->header;
-   length = be32_to_cpu(hdr->length);
-
-   /* Verify the firmware. */
-   if ((hdr->magic[0] != 'Q') || (hdr->magic[1] != 'E') ||
-   (hdr->magic[2] != 'F')) {
-   printf("Data at %p is not an Fman firmware\n", fmanfw);
-   return;
-   }
-
-   if (length > CONFIG_SYS_QE_FMAN_FW_LENGTH) {
-   printf("Fman firmware at %p is too large (size=%u)\n",
-  fmanfw, length);
-   return;
-   }
-
-   length -= sizeof(u32);  /* Subtract the size of the CRC */
-   crc = be32_to_cpu(*(u32 *)((void *)fmanfw + length));
-   if (crc != crc32_no_comp(0, (void *)fmanfw, length)) {
-   printf("Fman firmware at %p has invalid CRC\n", fmanfw);
-   return;
-   }
-
-   /* Increase the size of the fdt to make room for the node. */
-   rc = fdt_increase_size(blob, fmanfw->header.length);
-   if (rc < 0) {
-   printf("Unable to make room for Fman firmware: %s\n",
-   fdt_strerror(rc));
-   return;
-   }
-
-   /* Create the firmware node. */
-   fwnode = fdt_add_subnode(blob, fmnode, "fman-firmware");
-   if (fwnode < 0) {
-   char s[64];
-   fdt_get_path(blob, fmnode, s, sizeof(s));
-   printf("Could not add firmware node to %s: %s\n", s,
-  fdt_strerror(fwnode));
-   return;
-   }
-   rc = fdt_setprop_string(blob, fwnode, "compatible", 
"fsl,fman-firmware");
-   if (rc < 0) {
-   char s[64];
-   fdt_get_path(blob, fwnode, s, sizeof(s));
-   printf("Could not add compatible property to node %s: %s\n", s,
-  fdt_strerror(rc));
-   return;
-   }
-   phandle = fdt_create_phandle(blob, fwnode);
-   if (!phandle) {
-   char s[64];
-   fdt_get_path(blob, fwnode, s, sizeof(s));
-   printf("Could not add phandle property to node %s: %s\n", s,
-  fdt_strerror(rc));
-   return;
-   }
-   rc = fdt_setprop(blob, fwnode, "fsl,firmware", fmanfw, 
fmanfw->header.length);
-   if (rc < 0) {
-   char s[64];
-   fdt_get_path(blob, fwnode, s, sizeof(s));
-   printf("Could not add firmware property to node %s: %s\n", s,
-  fdt_strerror(rc));
-   return;
-   }
-
-   /* Find all other Fman nodes and point them to th

[U-Boot] mmc rescan problem!

2016-01-25 Thread rick
Hi Pantelis

Please review this patch of attached.

Thank you very much.

Rick

-Original Message-
From: Tom Rini [mailto:tr...@konsulko.com]
Sent: Monday, January 25, 2016 11:05 AM
To: Rick Jian-Zhi Chen(陳建志)
Subject: Re: mmc rescan problem!

On Mon, Jan 25, 2016 at 02:43:03AM +, r...@andestech.com wrote:

> Hi Tom
>
> I encounter a problem which is relative to mmc command.
> When I execute mmc rescan, system will hang.
> After trace I found it is because mmc command table have not been fixed up.
> It can be fixed it by the attached patch 
> (0001-nds32-fix-mmc-rescan-hang-problem.patch).
> Is it the correct way to fix this problem ?
> Can you review it for me ?

Please post it to the list and cc Pantelis.  But also keep in mind you've found 
and fixed a generic manual reloc problem so you don't need to guard things with 
NDS32 tests as well.  Thanks!

--
Tom
CONFIDENTIALITY NOTICE:

This e-mail (and its attachments) may contain confidential and legally 
privileged information or information protected from disclosure. If you are not 
the intended recipient, you are hereby notified that any disclosure, copying, 
distribution, or use of the information contained herein is strictly 
prohibited. In this case, please immediately notify the sender by return 
e-mail, delete the message (and any accompanying documents) and destroy all 
printed hard copies. Thank you for your cooperation.

Copyright ANDES TECHNOLOGY CORPORATION - All Rights Reserved.


signature.asc
Description: signature.asc


0001-mmc-fix-mmc-rescan-hang-problem.patch
Description: 0001-mmc-fix-mmc-rescan-hang-problem.patch
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] nand: mxs: fix error handling for mxs_nand_init

2016-01-25 Thread Peng Fan
Hi Scott,

Gentle ping.. it's a few weeks since patch sent out.

Thanks,
Peng.

On Sat, Jan 09, 2016 at 09:23:53PM +0800, Peng Fan wrote:
>From: Peng Fan 
>
>Fix error handling for mxs_nand_init.
>
>The original error handling is wrong for err2 and err1.
>Should first free desc[x], then free desc.
>
>This patch also correctly handle err3, should use
>MXS_DMA_CHANNEL_AHB_APBH_GPMI0 as the check point.
>
>Signed-off-by: Peng Fan 
>Cc: Stefano Babic 
>CC: Fabio Estevam 
>Cc: Scott Wood 
>Signed-off-by: Peng Fan 
>---
> drivers/mtd/nand/mxs_nand.c | 24 +++-
> 1 file changed, 15 insertions(+), 9 deletions(-)
>
>diff --git a/drivers/mtd/nand/mxs_nand.c b/drivers/mtd/nand/mxs_nand.c
>index f15cf36..5102e4b 100644
>--- a/drivers/mtd/nand/mxs_nand.c
>+++ b/drivers/mtd/nand/mxs_nand.c
>@@ -1090,24 +1090,29 @@ int mxs_nand_init(struct mxs_nand_info *info)
>   (struct mxs_gpmi_regs *)MXS_GPMI_BASE;
>   struct mxs_bch_regs *bch_regs =
>   (struct mxs_bch_regs *)MXS_BCH_BASE;
>-  int i = 0, j;
>+  int i = 0, j, ret = 0;
> 
>   info->desc = malloc(sizeof(struct mxs_dma_desc *) *
>   MXS_NAND_DMA_DESCRIPTOR_COUNT);
>-  if (!info->desc)
>+  if (!info->desc) {
>+  ret = -ENOMEM;
>   goto err1;
>+  }
> 
>   /* Allocate the DMA descriptors. */
>   for (i = 0; i < MXS_NAND_DMA_DESCRIPTOR_COUNT; i++) {
>   info->desc[i] = mxs_dma_desc_alloc();
>-  if (!info->desc[i])
>+  if (!info->desc[i]) {
>+  ret = -ENOMEM;
>   goto err2;
>+  }
>   }
> 
>   /* Init the DMA controller. */
>   for (j = MXS_DMA_CHANNEL_AHB_APBH_GPMI0;
>   j <= MXS_DMA_CHANNEL_AHB_APBH_GPMI7; j++) {
>-  if (mxs_dma_init_channel(j))
>+  ret = mxs_dma_init_channel(j);
>+  if (ret)
>   goto err3;
>   }
> 
>@@ -1127,15 +1132,16 @@ int mxs_nand_init(struct mxs_nand_info *info)
>   return 0;
> 
> err3:
>-  for (--j; j >= 0; j--)
>+  for (--j; j >= MXS_DMA_CHANNEL_AHB_APBH_GPMI0; j--)
>   mxs_dma_release(j);
> err2:
>-  free(info->desc);
>-err1:
>   for (--i; i >= 0; i--)
>   mxs_dma_desc_free(info->desc[i]);
>-  printf("MXS NAND: Unable to allocate DMA descriptors\n");
>-  return -ENOMEM;
>+  free(info->desc);
>+err1:
>+  if (ret == -ENOMEM)
>+  printf("MXS NAND: Unable to allocate DMA descriptors\n");
>+  return ret;
> }
> 
> /*!
>-- 
>2.6.2
>
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


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

2016-01-25 Thread Stefano Babic
Hi Tom,

please pull from u-boot-imx, thanks !

The following changes since commit 12f229ea8f6c8e20f8fd07906eafc853c4c354a9:

  Merge git://git.denx.de/u-boot-fdt (2016-01-22 17:01:22 -0500)

are available in the git repository at:


  git://www.denx.de/git/u-boot-imx.git master

for you to fetch changes up to ed3fb1fb22fb9e0e786c58c2d80cd030b89b9b7d:

  imx: spl: enable CONFIG_SPL_WATCHDOG_SUPPORT (2016-01-25 10:03:17 +0100)


Fabio Estevam (1):
  mx25pdk: Remove lowlevel_init.S file

Peng Fan (10):
  imx: mx6ulevk: change mtest memory size to 128M
  imx: mx6/7 enlarge CONFIG_SYS_BOOTM_LEN to 16M
  imx: mx6ulevk: add CONFIG_SPI_FLASH_STMICRO
  imx: apbh_dma: Update APBH-DMA for MX7D
  imx: nand: update GPMI NAND driver to support MX7
  imx: mx7dsabresd: support nand
  imx: mx6: add more entry for mxc_ccm_reg
  imx: mx6ul/sx: fix mmdc_ch0 clk calculation
  imx: mx7: default enable MDIO open drain
  imx: spl: enable CONFIG_SPL_WATCHDOG_SUPPORT

 arch/arm/cpu/armv7/mx6/clock.c  |  61 ++--
 arch/arm/cpu/armv7/mx7/soc.c|  20 ++
 arch/arm/include/asm/arch-mx6/crm_regs.h| 103

 arch/arm/include/asm/arch-mx7/imx-regs.h|   2 +
 arch/arm/include/asm/imx-common/dma.h   |   2 +-
 arch/arm/include/asm/imx-common/regs-apbh.h |   6 +-
 arch/arm/include/asm/imx-common/regs-bch.h  |   4 +-
 board/freescale/mx25pdk/Makefile|   1 -
 board/freescale/mx25pdk/lowlevel_init.S |  10 ---
 board/freescale/mx25pdk/mx25pdk.c   |   3 +
 board/freescale/mx7dsabresd/mx7dsabresd.c   |  39 +++
 drivers/dma/apbh_dma.c  |   2 +-
 drivers/mtd/nand/mxs_nand.c |   4 +-
 include/configs/imx6_spl.h  |   1 +
 include/configs/mx6_common.h|   2 +
 include/configs/mx6ul_14x14_evk.h   |   3 +-
 include/configs/mx7_common.h|   2 +
 include/configs/mx7dsabresd.h   |  25 +++
 18 files changed, 265 insertions(+), 25 deletions(-)
 delete mode 100644 board/freescale/mx25pdk/lowlevel_init.S


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


[U-Boot] CONFIG_DISPLAY causes build error on microblaze-generic

2016-01-25 Thread Bin Meng
Hi Simon, Anatolij,

At present CONFIG_DISPLAY is set to y by default when driver model is
on. This causes the following building error on microblaze-generic.

  drivers/built-in.o: In function 'display_read_timing':
  drivers/video/display-uclass.c:45: undefined reference to 'edid_get_timing'

I think we should make CONFIG_DISPLAY 'default n' and update whatever
boards who want DM video support to explicitly turn in on in its board
defconfig files. This will fix microblaze-generic build error too.

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


Re: [U-Boot] buildman errors

2016-01-25 Thread Tom Rini
On Mon, Jan 25, 2016 at 11:18:26AM +0800, Bin Meng wrote:
> Hi Tom,
> 
> On Mon, Jan 25, 2016 at 11:05 AM, Tom Rini  wrote:
> > On Mon, Jan 25, 2016 at 10:34:16AM +0800, Bin Meng wrote:
> >> Hi Tom,
> >>
> >> On Mon, Jan 25, 2016 at 12:19 AM, Tom Rini  wrote:
> >> > On Sun, Jan 24, 2016 at 12:00:42PM +0800, Bin Meng wrote:
> >> >
> >> >> Hi,
> >> >>
> >> >> Summary of 71 commits for 1100 boards (24 threads, 1 job per thread)
> >> >> 01: iocon / bamboo: Drop CONFIG_SYS_LONGHELP
> >> >>   blackfin:  +   bf561-acvilon cm-bf561 blackstamp bf537-minotaur
> >> >> bct-brettl2 cm-bf527 bf506f-ezkit ip04 bf527-sdp pr1 bf527-ad7160-eval
> >> >> bf609-ezkit bf537-stamp bf527-ezkit-v2 cm-bf537e tcm-bf518 cm-bf537u
> >> >> bf527-ezkit cm-bf533 bf533-ezkit ibf-dsp561 bf537-pnav bf537-srv1
> >> >> cm-bf548 bf538f-ezkit bf548-ezkit bf525-ucr2 blackvme tcm-bf537
> >> >> bf533-stamp dnp5370 bf518f-ezbrd bf526-ezbrd bf561-ezkit br4
> >> >>aarch64:  +   test
> >> >>  avr32:  +   atngw100mkii grasshopper atstk1002 atngw100
> >> >> sh:  +   sh7753evb sh7785lcr_32bit sh7785lcr
> >> >>arc:  +   arcangel4-be axs101 axs103 tb100 arcangel4
> >> >>   openrisc:  +   openrisc-generic
> >> >>powerpc:  +   TQM834x katmai
> >> >>arm:  +   mx28evk mx28evk_nand xfi3 bg0900 sansa_fuze_plus
> >> >> mx23evk m28evk sc_sps_1 mx28evk_spi apx4devkit mx23_olinuxino
> >> >> mx28evk_auart_console
> >> >>  nds32:  +   adp-ag101p
> >> >
> >> > I need to finally fetch a few toolchains as I don't do
> >> > avr32/sh/openrisc/nds32 iirc.  As a tangent, x86 is very broken with gcc
> >> > 5.x, can you look into it? :)
> >> >
> >>
> >> Sure, I can look into x86. Which gcc 5.x toolchain are you using?
> >
> > Pretty much any, I've seen it for a long time but not had time to poke
> > at the libgcc "fun" that's involved here.
> >
> 
> I mean if there is any prebuilt gcc 5.x for me to grab and test? Or do
> I need build one from gcc source?

Fedora has shipped with gcc 5.x for a release or two and Debian/unstable
is how I get all of my gcc 5.x toolchains for build testing.

-- 
Tom


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


Re: [U-Boot] [PATCH] net: eepro100: Fix build warnings

2016-01-25 Thread Joe Hershberger
On Mon, Jan 25, 2016 at 3:26 AM, Bin Meng  wrote:
> When building katmai, it reports quite a lot
>
>   warning: cast to pointer from integer of different size 
> [-Wint-to-pointer-cast]
>
> Fix this by casting the dev->iobase with u_long.
>
> Signed-off-by: Bin Meng 

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


Re: [U-Boot] [PATCH V2] net: bootp: Ignore packets whose yiaddr is 0

2016-01-25 Thread Joe Hershberger
On Thu, Jan 7, 2016 at 1:28 AM, Peng Fan  wrote:
> From: Peng Fan 
>
> When doing `dhcp`, there is a bad dhcp server in my network
> which always reply dhcp request with yiaddr 0, which cause
> uboot can not successfully get ipaddr from the good dhcp server.
> But the Linux PC can get the ip address even if there is a bad
> dhcp server. This patch is to fix that even if there is a bad
> dhcp server, uboot can still get ipaddr and tftp work ok.
>
> The way is to ignore the packets from the bad dhcp server by filtering
> out the yiaddr whose value is 0.
>
> Signed-off-by: Peng Fan 
> Cc: Joe Hershberger 

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


Re: [U-Boot] [PATCHv7 6/7] igep00x0: UBIize

2016-01-25 Thread Tom Rini
On Mon, Jan 25, 2016 at 07:39:10AM +0100, Heiko Schocher wrote:
> Hello Enric, Ladislav,
> 
> Am 22.01.2016 um 23:35 schrieb Enric Balletbo Serra:
> >Hi Ladis,
> >
> >Many thanks for your work on this, see some comments below ...
> 
> Sorry, pull request is sent with this patch, see:
> 
> http://lists.denx.de/pipermail/u-boot/2016-January/239855.html

Note that the PR there just lists one patch...

> @Ladislav: Please send changes in a follow up patch, thanks!

No, sorry.  I had intentionally not yet grabbed the PR there yet since I
didn't want this series in until Enric had ack'd them as it's a behavior
change and he is listed as the maintainer.  You grabbed them a bit too
early, sorry!

-- 
Tom


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


Re: [U-Boot] [GIT PULL] Microblaze changes

2016-01-25 Thread Tom Rini
On Mon, Jan 25, 2016 at 10:24:20AM +0100, Michal Simek wrote:
> Hi,
> 
> On 22.1.2016 19:34, Ricardo Ribalda Delgado wrote:
> > Hi
> > 
> > My main concern is that the support for the board is not removed. I have
> > one active product based on virtex5 ppc440.
> > 
> > Today I had to do some last minute support and now I am on a plane...
> > Otherwise the patchset would be on your inbox.
> > 
> > I have taken a fast look over the required changes, and it is not that bad.
> > Most of the hard work has already been done by you for mblaze.
> > 
> > Thanks for your understanding ;).
> 
> You got max 2 more days to solve it. After that I will just disable
> uartlite support for this platform and will send updated pull request as
> we discussed with Tom.

Since this was on IRC, yes, we should disable the uartlite support to
keep 440 building if this can't be resolved by enabling DM there instead
as I don't want to block everything else on this.  Thanks!

-- 
Tom


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


Re: [U-Boot] CONFIG_DISPLAY causes build error on microblaze-generic

2016-01-25 Thread Tom Rini
On Mon, Jan 25, 2016 at 10:08:20PM +0800, Bin Meng wrote:

> Hi Simon, Anatolij,
> 
> At present CONFIG_DISPLAY is set to y by default when driver model is
> on. This causes the following building error on microblaze-generic.
> 
>   drivers/built-in.o: In function 'display_read_timing':
>   drivers/video/display-uclass.c:45: undefined reference to 'edid_get_timing'
> 
> I think we should make CONFIG_DISPLAY 'default n' and update whatever
> boards who want DM video support to explicitly turn in on in its board
> defconfig files. This will fix microblaze-generic build error too.

This is a Kconfig thinko, yes, as we're enabling stuff we don't need
everywhere.  I talked with Simon about this the other day as it's
causing a slight bloat everywhere too.

-- 
Tom


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


Re: [U-Boot] CONFIG_DISPLAY causes build error on microblaze-generic

2016-01-25 Thread Anatolij Gustschin
Hi Bin,

> Hi Simon, Anatolij,
> 
> At present CONFIG_DISPLAY is set to y by default when driver model is
> on. This causes the following building error on microblaze-generic.
> 
>   drivers/built-in.o: In function 'display_read_timing':
>   drivers/video/display-uclass.c:45: undefined reference to 'edid_get_timing'
>
> I think we should make CONFIG_DISPLAY 'default n' and update whatever
> boards who want DM video support to explicitly turn in on in its board
> defconfig files. This will fix microblaze-generic build error too.

CONFIG_DISPLAY depends on CONFIG_I2C_EDID, this should be considered
in Kconfig, too.

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


Re: [U-Boot] [PATCHv7 6/7] igep00x0: UBIize

2016-01-25 Thread Heiko Schocher

Hello Tom,

Am 25.01.2016 um 16:13 schrieb Tom Rini:

On Mon, Jan 25, 2016 at 07:39:10AM +0100, Heiko Schocher wrote:

Hello Enric, Ladislav,

Am 22.01.2016 um 23:35 schrieb Enric Balletbo Serra:

Hi Ladis,

Many thanks for your work on this, see some comments below ...


Sorry, pull request is sent with this patch, see:

http://lists.denx.de/pipermail/u-boot/2016-January/239855.html


Note that the PR there just lists one patch...


wrong link, sorry.


@Ladislav: Please send changes in a follow up patch, thanks!


No, sorry.  I had intentionally not yet grabbed the PR there yet since I
didn't want this series in until Enric had ack'd them as it's a behavior
change and he is listed as the maintainer.  You grabbed them a bit too
early, sorry!


Ups, sorry (may I was to happy for having UBI support in SPL)

Ok, so I wait for a new version for this patch.

bye,
Heiko
--
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3 0/7] Determine Boot mode at run time

2016-01-25 Thread Tom Rini
On Fri, Jan 22, 2016 at 04:37:21PM +0530, Aneesh Bansal wrote:

> There are two phases in Secure Boot
> 1. ISBC: In BootROM, validate the BootLoader (U-Boot).
> 2. ESBC: In U-Boot, continuing the Chain of Trust by
>  validating and booting LINUX.
> 
> For ESBC phase, there is no difference in SoC's based on ARM or PowerPC
> cores.
> 
> But the exit conditions after ISBC phase i.e. entry conditions for
> U-Boot are different for ARM and PowerPC.
> PowerPC:
> 
> If Secure Boot is executed, a separate U-Boot target is required which
> must be compiled with a diffrent Text Base as compared to Non-Secure Boot.
> There are some LAW and TLB settings which are required specifically for
> Secure Boot scenario.
> 
> ARM:
> 
> ARM based SoC's have a fixed memory map and exit conditions from BootROM
> are same irrespective of boot mode (Secure or Non-Secure).
> 
> This patchset is aimed at removing the requirement for a separate Secure Boot
> target for ARM based SoC's. 
> 
> Another Security Requirement for running CHAIN_OF_TRUST is that U-Boot 
> environemnt
> must not be picked from flash/external memory. This cannot be done based on 
> bootmode
> at run time in current U-Boot architecture. Once this dependency is resolved, 
> no separate
> SECURE_BOOT target will be required for ARM based SoC's.
> 
> Currently, the only code under CONFIG_SECURE_BOOT for ARM SoC's is defining
> CONFIG_ENV_IS_NOWHERE
> 
> The patches have been tested on LS1043, LS1021, P3041 and T1024.
> 
> The patch set is dependent on following:
> http://patchwork.ozlabs.org/patch/553826/
> 
> Aneesh Bansal (7):
>   include/configs: make secure boot header file include uniform
>   include/configs: move definition of CONFIG_CMD_BLOB
>   SECURE_BOOT: split the secure boot functionality in two parts
>   create function to determine boot mode
>   enable chain of trust for ARM platforms
>   enable chain of trust for PowerPC platforms
>   SECURE_BOOT: change error handler for esbc_validate
> 
>  arch/arm/cpu/armv8/fsl-layerscape/soc.c|   6 ++
>  .../include/asm/arch-fsl-layerscape/immap_lsch2.h  |   3 +
>  arch/arm/include/asm/arch-ls102xa/immap_ls102xa.h  |   2 +
>  arch/arm/include/asm/fsl_secure_boot.h |  20 +++-
>  arch/powerpc/cpu/mpc85xx/cpu_init.c|  14 +++
>  arch/powerpc/include/asm/fsl_secure_boot.h |  47 ++---
>  arch/powerpc/include/asm/immap_85xx.h  |   3 +
>  board/freescale/common/Makefile|   1 +
>  board/freescale/common/cmd_esbc_validate.c |   7 +-
>  board/freescale/common/fsl_chain_of_trust.c|  70 +
>  board/freescale/common/fsl_validate.c  |   7 ++
>  board/freescale/ls1021aqds/ls1021aqds.c|   4 +
>  board/freescale/ls1021atwr/ls1021atwr.c|   4 +
>  include/config_fsl_chain_trust.h   | 101 ++
>  include/config_fsl_secboot.h   | 116 
> -
>  include/configs/B4860QDS.h |   4 -
>  include/configs/BSC9132QDS.h   |   4 -
>  include/configs/P1010RDB.h |   4 -
>  include/configs/P2041RDB.h |   4 -
>  include/configs/T102xQDS.h |  10 +-
>  include/configs/T102xRDB.h |  10 +-
>  include/configs/T1040QDS.h |   3 -
>  include/configs/T104xRDB.h |   3 -
>  include/configs/T208xQDS.h |   4 -
>  include/configs/T208xRDB.h |   4 -
>  include/configs/T4240QDS.h |   4 -
>  include/configs/T4240RDB.h |   9 --
>  include/configs/corenet_ds.h   |   4 -
>  include/configs/ls1021aqds.h   |   5 +-
>  include/configs/ls1021atwr.h   |   5 +-
>  include/configs/ls1043a_common.h   |   8 ++
>  include/configs/ls1043aqds.h   |   2 +
>  include/configs/ls1043ardb.h   |   8 --
>  include/fsl_validate.h |   2 +
>  34 files changed, 299 insertions(+), 203 deletions(-)
>  create mode 100644 board/freescale/common/fsl_chain_of_trust.c
>  create mode 100644 include/config_fsl_chain_trust.h
>  delete mode 100644 include/config_fsl_secboot.h

Looking at the config file changes, I think we need to move a bunch of
this stuff to Kconfig so that we can get these consistent and correct
each time.

-- 
Tom


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


Re: [U-Boot] [PATCHv7 6/7] igep00x0: UBIize

2016-01-25 Thread Ladislav Michl
Hi Enric,

On Mon, Jan 25, 2016 at 08:26:23AM +0100, Enric Balletbo Serra wrote:
> The ROM boot on OMAP reads the first 4 blocks searching for the SPL,
> in production is a practice flash the SPL 4 times. OneNAND/NAND
> devices can have different block sizes and the OMAP ROM boot supports
> block sizes from 64KB to 512K. For IGEP boards in particular, at least
> there are boards that have block size of 128K and 256K. What I would
> meant here is set as default the mtdparts variable to reserve 2M for
> SPL, just to cover all the cases.
> 
> mtdparts=mtdparts=gpmc-nand.0:2m(SPL),-(UBI)\0

So far there was no ack or nack to yesterday's proposal making that
dynamic; Both boot ROM and ubispl code thinks in terms of eraseblocks,
only mtd needs fixed offset. So I'd like to see this offset calculated as
4*block_size, not some "worst case" value...

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


Re: [U-Boot] [PATCH] arm: cache: Implement cache range check for v7

2016-01-25 Thread Tom Rini
On Sun, Jan 24, 2016 at 06:28:12PM +0100, Marek Vasut wrote:
> On Monday, December 28, 2015 at 04:23:46 PM, Marek Vasut wrote:
> > On Friday, December 11, 2015 at 05:36:15 AM, Marek Vasut wrote:
> > > On Tuesday, December 01, 2015 at 06:23:17 PM, Marek Vasut wrote:
> > > > On Monday, July 27, 2015 at 10:34:17 PM, Marek Vasut wrote:
> > > > > Add code to aid tracking down cache alignment issues.
> > > > > In case DEBUG is defined in the cache.c, this code will
> > > > > check alignment of each attempt to flush/invalidate data
> > > > > cache and print a warning if the alignment is incorrect.
> > > > > If DEBUG is not defined, this code is optimized out.
> > > > > 
> > > > > Signed-off-by: Marek Vasut 
> > > > > Cc: Dinh Nguyen 
> > > > > Cc: Albert Aribaud 
> > > > > Cc: Tom Rini 
> > > > 
> > > > Bump ?
> > > 
> > > Bump ?
> > 
> > Bump #3 ?
> 
> Bump #4 ?

Albert?

> > > > >  arch/arm/cpu/armv7/cache_v7.c | 21 +
> > > > >  1 file changed, 21 insertions(+)
> > > > > 
> > > > > diff --git a/arch/arm/cpu/armv7/cache_v7.c
> > > > > b/arch/arm/cpu/armv7/cache_v7.c index e8ee875..84431bb 100644
> > > > > --- a/arch/arm/cpu/armv7/cache_v7.c
> > > > > +++ b/arch/arm/cpu/armv7/cache_v7.c
> > > > > @@ -16,6 +16,23 @@
> > > > > 
> > > > >  #define ARMV7_DCACHE_CLEAN_INVAL_RANGE   4
> > > > >  
> > > > >  #ifndef CONFIG_SYS_DCACHE_OFF
> > > > > 
> > > > > +static int check_cache_range(unsigned long start, unsigned long
> > > > > stop) +{
> > > > > + int ok = 1;
> > > > > +
> > > > > + if (start & (CONFIG_SYS_CACHELINE_SIZE - 1))
> > > > > + ok = 0;
> > > > > +
> > > > > + if (stop & (CONFIG_SYS_CACHELINE_SIZE - 1))
> > > > > + ok = 0;
> > > > > +
> > > > > + if (!ok)
> > > > > + debug("CACHE: Misaligned operation at range [%08lx, 
> %08lx]\n",
> > > > > + start, stop);
> > > > > +
> > > > > + return ok;
> > > > > +}
> > > > > +
> > > > > 
> > > > >  /*
> > > > >  
> > > > >   * Write the level and type you want to Cache Size Selection
> > > > > 
> > > > > Register(CSSELR) * to get size details from Current Cache Size ID
> > > > > Register(CCSIDR) @@ -257,6 +274,8 @@ void flush_dcache_all(void)
> > > > > 
> > > > >   */
> > > > >  
> > > > >  void invalidate_dcache_range(unsigned long start, unsigned long
> > > > >  stop) {
> > > > > 
> > > > > + check_cache_range(start, stop);
> > > > > +
> > > > > 
> > > > >   v7_dcache_maint_range(start, stop, ARMV7_DCACHE_INVAL_RANGE);
> > > > >   
> > > > >   v7_outer_cache_inval_range(start, stop);
> > > > > 
> > > > > @@ -269,6 +288,8 @@ void invalidate_dcache_range(unsigned long start,
> > > > > unsigned long stop) */
> > > > > 
> > > > >  void flush_dcache_range(unsigned long start, unsigned long stop)
> > > > >  {
> > > > > 
> > > > > + check_cache_range(start, stop);
> > > > > +
> > > > > 
> > > > >   v7_dcache_maint_range(start, stop, 
> ARMV7_DCACHE_CLEAN_INVAL_RANGE);
> > > > >   
> > > > >   v7_outer_cache_flush_range(start, stop);
> > > > 
> > > > Best regards,
> > > > Marek Vasut
> > 
> > Best regards,
> > Marek Vasut
> 
> Best regards,
> Marek Vasut
> ___
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot

-- 
Tom


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


Re: [U-Boot] [PATCH] nds32: fix mmc rescan hang problem.

2016-01-25 Thread Tom Rini
On Mon, Jan 25, 2016 at 01:08:15PM +0800, Andes wrote:

> From: rick 
> 
> When execute mmc rescan command, system will hang.
> 
> Signed-off-by: rick 
> ---
>  common/cmd_mmc.c  |9 +
>  common/env_common.c   |3 +++
>  include/environment.h |3 +++
>  3 files changed, 15 insertions(+)
> 
> diff --git a/common/cmd_mmc.c b/common/cmd_mmc.c
> index dfc1ec8..3090466 100644
> --- a/common/cmd_mmc.c
> +++ b/common/cmd_mmc.c
> @@ -814,6 +814,15 @@ static cmd_tbl_t cmd_mmc[] = {
>   U_BOOT_CMD_MKENT(setdsr, 2, 0, do_mmc_setdsr, "", ""),
>  };
>  
> +#if defined(__NDS32__)
> +#ifdef CONFIG_NEEDS_MANUAL_RELOC
> +void mmc_reloc(void)
> +{
> + fixup_cmdtable(cmd_mmc, ARRAY_SIZE(cmd_mmc));
> +}
> +#endif
> +#endif
> +
>  static int do_mmcops(cmd_tbl_t *cmdtp, int flag, int argc, char * const 
> argv[])
>  {
>   cmd_tbl_t *cp;

Don't need to test __NDS32__ here.

> diff --git a/common/env_common.c b/common/env_common.c
> index af59c72..8e7b0a5 100644
> --- a/common/env_common.c
> +++ b/common/env_common.c
> @@ -253,6 +253,9 @@ void env_relocate(void)
>  {
>  #if defined(CONFIG_NEEDS_MANUAL_RELOC)
>   env_reloc();
> +#if defined(CONFIG_NDS32)
> + mmc_reloc();
> +#endif
>   env_htab.change_ok += gd->reloc_off;
>  #endif
>   if (gd->env_valid == 0) {

This should just check CONFIG_ENV_IS_IN_MMC

> diff --git a/include/environment.h b/include/environment.h
> index 1fdbdad..4bc5326 100644
> --- a/include/environment.h
> +++ b/include/environment.h
> @@ -178,6 +178,9 @@ extern unsigned char env_get_char_spec(int);
>  
>  #if defined(CONFIG_NEEDS_MANUAL_RELOC)
>  extern void env_reloc(void);
> +#if defined(CONFIG_NDS32)
> +extern void mmc_reloc(void);
> +#endif
>  #endif
>  
>  #ifdef CONFIG_ENV_IS_IN_MMC

Don't need to test __NDS32__ here.

-- 
Tom


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


[U-Boot] [PATCH] video: add CONFIG_I2C_EDID and disable CONFIG_DISPLAY by default

2016-01-25 Thread Anatolij Gustschin
Enabling CONFIG_DISPLAY breaks building for some architectures
(microblaze-generic), so we disable CONFIG_DISPLAY in Kconfig
by default and enable this option in defconfigs. CONFIG_DISPLAY
depends on CONFIG_I2C_EDID, so add and enable it in defconfigs, too.

Signed-off-by: Anatolij Gustschin 
Reported-by: Bin Meng 
Cc: Simon Glass 
---
 configs/chromebook_jerry_defconfig |  2 ++
 configs/firefly-rk3288_defconfig   |  2 ++
 configs/nyan-big_defconfig |  1 +
 configs/rock2_defconfig|  2 ++
 drivers/video/Kconfig  | 10 +-
 include/configs/chromebook_jerry.h |  1 -
 include/configs/firefly-rk3288.h   |  1 -
 include/configs/nyan-big.h |  2 --
 include/configs/rock2.h|  1 -
 9 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/configs/chromebook_jerry_defconfig 
b/configs/chromebook_jerry_defconfig
index 27e53c1..bd8b964 100644
--- a/configs/chromebook_jerry_defconfig
+++ b/configs/chromebook_jerry_defconfig
@@ -55,6 +55,8 @@ CONFIG_DEBUG_UART_SHIFT=2
 CONFIG_SYS_NS16550=y
 CONFIG_ROCKCHIP_SPI=y
 CONFIG_DM_VIDEO=y
+CONFIG_I2C_EDID=y
+CONFIG_DISPLAY=y
 CONFIG_VIDEO_ROTATION=y
 CONFIG_VIDEO_ROCKCHIP=y
 CONFIG_USE_PRIVATE_LIBGCC=y
diff --git a/configs/firefly-rk3288_defconfig b/configs/firefly-rk3288_defconfig
index 15eb4d8..3b29158 100644
--- a/configs/firefly-rk3288_defconfig
+++ b/configs/firefly-rk3288_defconfig
@@ -47,6 +47,8 @@ CONFIG_DEBUG_UART_CLOCK=2400
 CONFIG_DEBUG_UART_SHIFT=2
 CONFIG_SYS_NS16550=y
 CONFIG_DM_VIDEO=y
+CONFIG_I2C_EDID=y
+CONFIG_DISPLAY=y
 CONFIG_VIDEO_ROTATION=y
 CONFIG_VIDEO_ROCKCHIP=y
 CONFIG_USE_PRIVATE_LIBGCC=y
diff --git a/configs/nyan-big_defconfig b/configs/nyan-big_defconfig
index 03348a6..ca0f9e0 100644
--- a/configs/nyan-big_defconfig
+++ b/configs/nyan-big_defconfig
@@ -26,6 +26,7 @@ CONFIG_TPM_TIS_INFINEON=y
 CONFIG_USB=y
 CONFIG_DM_USB=y
 CONFIG_DISPLAY=y
+CONFIG_I2C_EDID=y
 CONFIG_VIDEO_TEGRA124=y
 CONFIG_USE_PRIVATE_LIBGCC=y
 CONFIG_TPM=y
diff --git a/configs/rock2_defconfig b/configs/rock2_defconfig
index 2563775..68e3b36 100644
--- a/configs/rock2_defconfig
+++ b/configs/rock2_defconfig
@@ -45,6 +45,8 @@ CONFIG_DEBUG_UART_CLOCK=2400
 CONFIG_DEBUG_UART_SHIFT=2
 CONFIG_SYS_NS16550=y
 CONFIG_DM_VIDEO=y
+CONFIG_I2C_EDID=y
+CONFIG_DISPLAY=y
 CONFIG_VIDEO_ROTATION=y
 CONFIG_VIDEO_ROCKCHIP=y
 CONFIG_USE_PRIVATE_LIBGCC=y
diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
index 912e397..3fd781b 100644
--- a/drivers/video/Kconfig
+++ b/drivers/video/Kconfig
@@ -293,10 +293,18 @@ config VIDEO_LCD_SPI_MISO
option takes a string in the format understood by 'name_to_gpio'
function, e.g. PH1 for pin 1 of port H.
 
+config I2C_EDID
+   bool "Enable EDID library"
+   depends on DM_I2C
+   default n
+   help
+  This enables library for accessing EDID data from an LCD panel.
+
 config DISPLAY
bool "Enable Display support"
depends on DM
-   default y
+   default n
+   select I2C_EDID
help
   This supports drivers that provide a display, such as eDP (Embedded
   DisplayPort) and HDMI (High Definition Multimedia Interface).
diff --git a/include/configs/chromebook_jerry.h 
b/include/configs/chromebook_jerry.h
index 150e876..67f45c0 100644
--- a/include/configs/chromebook_jerry.h
+++ b/include/configs/chromebook_jerry.h
@@ -30,7 +30,6 @@
 #define CONFIG_SPL_POWER_SUPPORT
 #define CONFIG_SPL_I2C_SUPPORT
 
-#define CONFIG_I2C_EDID
 #define CONFIG_SYS_WHITE_ON_BLACK
 #define CONFIG_CONSOLE_SCROLL_LINES10
 
diff --git a/include/configs/firefly-rk3288.h b/include/configs/firefly-rk3288.h
index d6423e7..a29f557 100644
--- a/include/configs/firefly-rk3288.h
+++ b/include/configs/firefly-rk3288.h
@@ -24,7 +24,6 @@
  */
 #define CONFIG_ENV_OFFSET (96 * 1024)
 
-#define CONFIG_I2C_EDID
 #define CONFIG_SYS_WHITE_ON_BLACK
 #define CONFIG_CONSOLE_SCROLL_LINES10
 
diff --git a/include/configs/nyan-big.h b/include/configs/nyan-big.h
index 9464153..176f6e9 100644
--- a/include/configs/nyan-big.h
+++ b/include/configs/nyan-big.h
@@ -37,8 +37,6 @@
 #define CONFIG_SYS_MMC_ENV_PART2
 #define CONFIG_ENV_OFFSET  (-CONFIG_ENV_SIZE)
 
-#define CONFIG_I2C_EDID
-
 /* LCD support */
 #define CONFIG_LCD
 #define CONFIG_PWM_TEGRA
diff --git a/include/configs/rock2.h b/include/configs/rock2.h
index d6423e7..a29f557 100644
--- a/include/configs/rock2.h
+++ b/include/configs/rock2.h
@@ -24,7 +24,6 @@
  */
 #define CONFIG_ENV_OFFSET (96 * 1024)
 
-#define CONFIG_I2C_EDID
 #define CONFIG_SYS_WHITE_ON_BLACK
 #define CONFIG_CONSOLE_SCROLL_LINES10
 
-- 
1.9.1

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


Re: [U-Boot] [Patch V5 2/4] spi: fsl_qspi: Fix qspi_op_rdid memcpy issue

2016-01-25 Thread york sun
On 01/24/2016 08:09 PM, Yao Yuan wrote:
> On 01/25/2016 04:16 AM, York Sun wrote:
>> On 01/22/2016 07:43 AM, Scott Wood wrote:
>>> On 01/21/2016 09:35 PM, Qianyu Gong wrote:

> -Original Message-
> From: Scott Wood
> Sent: Friday, January 22, 2016 3:30 AM
> To: Qianyu Gong ; u-boot@lists.denx.de;
> r58...@freescale.com
> Cc: mingkai...@freescale.com; jt...@openedev.com;
> b48...@freescale.com; shaohui@freescale.com;
> wenbin.s...@freescale.com; Scott Wood ; Gong
> Qianyu 
> Subject: Re: [Patch V5 2/4] spi: fsl_qspi: Fix qspi_op_rdid memcpy
> issue
>
> On 01/20/2016 09:43 PM, Gong Qianyu wrote:
>> From: Gong Qianyu 
>>
>> In current driver everytime we memcpy 4 bytes to the dest memory
>> regardless of the remaining length.
>> This patch adds checking the remaining length before memcpy.
>> If the length is shorter than 4 bytes, memcpy the actual length of
>> data to the dest memory.
>>
>> Signed-off-by: Gong Qianyu 
>> ---
>> V2-V5:
>>  - No change.
>>
>>  drivers/spi/fsl_qspi.c | 5 -
>>  1 file changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/spi/fsl_qspi.c b/drivers/spi/fsl_qspi.c index
>> 38e5900..f178857 100644
>> --- a/drivers/spi/fsl_qspi.c
>> +++ b/drivers/spi/fsl_qspi.c
>> @@ -500,7 +500,10 @@ static void qspi_op_rdid(struct fsl_qspi_priv
>> *priv, u32
> *rxbuf, u32 len)
>>  if (rbsr_reg & QSPI_RBSR_RDBFL_MASK) {
>>  data = qspi_read32(priv->flags, ®s->rbdr[i]);
>>  data = qspi_endian_xchg(data);
>> -memcpy(rxbuf, &data, 4);
>> +if (size < 4)
>> +memcpy(rxbuf, &data, size);
>> +else
>> +memcpy(rxbuf, &data, 4);
>
> memcpy(rxbuf, &data, min(size, 4));
>
>>  rxbuf++;
>>  size -= 4;
>>  i++;
>
> size -= 4 even if size was < 4?
>
> -Scott

 Yes.. The following is complete code:

 i = 0;
 size = len;
 while ((RX_BUFFER_SIZE >= size) && (size > 0)) {
 rbsr_reg = qspi_read32(priv->flags, ®s->rbsr);
 if (rbsr_reg & QSPI_RBSR_RDBFL_MASK) {
 data = qspi_read32(priv->flags, ®s->rbdr[i]);
 data = qspi_endian_xchg(data);
 memcpy(rxbuf, &data, min(size, 4));
 rxbuf++;
 size -= 4;
 i++;
 }
 }
>>>
>>> I'm not saying it doesn't work (assuming i is signed, which the
>>> "complete code" above doesn't show).  I'm saying it looks weird, and
>>> it would be better to have a variable that holds min(size, 4) and pass
>>> that to both memcpy and the subtraction.
>>>
>>
>> Qianyu,
>>
>> Previously I said it looked weird for doing this. Please fix.
>>
>> "size" is declared as "int".
>> "len" is declared as u32. That's not "int". If you trace back the functions, 
>> you
>> may see it came from DIV_ROUND_UP(bitlen, 8) where bitlen is "unsigned int".
>> So technically the code is safe. But it is _confusing_. We don't want to 
>> confuse
>> ourselves when reading the code later. And the fix is easy, isn't it?
>>
>> York
>>
> 
> How about like this?
> 
> diff --git a/drivers/spi/fsl_qspi.c b/drivers/spi/fsl_qspi.c
> index feec3e8..13bba09 100644
> --- a/drivers/spi/fsl_qspi.c
> +++ b/drivers/spi/fsl_qspi.c
> @@ -477,8 +477,8 @@ static void qspi_op_rdbank(struct fsl_qspi_priv *priv, u8 
> *rxbuf, u32 len)
>  static void qspi_op_rdid(struct fsl_qspi_priv *priv, u32 *rxbuf, u32 len)
>  {
> struct fsl_qspi_regs *regs = priv->regs;
> -   u32 mcr_reg, rbsr_reg, data;
> -   int i, size;
> +   u32 mcr_reg, rbsr_reg, data, size;
> +   int i;
> 
> mcr_reg = qspi_read32(priv->flags, ®s->mcr);
> qspi_write32(priv->flags, ®s->mcr,
> @@ -495,14 +495,14 @@ static void qspi_op_rdid(struct fsl_qspi_priv *priv, 
> u32 *rxbuf, u32 len)
> 
> i = 0;
> size = len;
> -   while ((RX_BUFFER_SIZE >= size) && (size > 0)) {
> +   while ((RX_BUFFER_SIZE >= size) && (size != 0)) {

You can keep using "size > 0". It is still correct.

> rbsr_reg = qspi_read32(priv->flags, ®s->rbsr);
> if (rbsr_reg & QSPI_RBSR_RDBFL_MASK) {
> data = qspi_read32(priv->flags, ®s->rbdr[i]);
> data = qspi_endian_xchg(data);
> -   memcpy(rxbuf, &data, 4);
> +   memcpy(rxbuf, &data, min(size, 4));
> +   size = (size < 4) ? 0 : ( size - 4);
> rxbuf++;
> - 

[U-Boot] [PATCH REPOST] checkpatch: ignore request to use ether_addr_copy()

2016-01-25 Thread Stephen Warren
From: Stephen Warren 

The Linux kernel, from which checkpatch originates, contains function
ether_addr_copy() to copy Ethernet MAC addresses, and checkpatch warns
that it should be used in preference to memcpy() where appropriate.
U-Boot doesn't contain ether_addr_copy(), so tell checkpatch not to issue
this warning.

Signed-off-by: Stephen Warren 
Reviewed-by: Marek Vasut 
Acked-by: Joe Hershberger 
---
 .checkpatch.conf | 4 
 1 file changed, 4 insertions(+)

diff --git a/.checkpatch.conf b/.checkpatch.conf
index 35167e12015b..d1d32fac9db5 100644
--- a/.checkpatch.conf
+++ b/.checkpatch.conf
@@ -21,3 +21,7 @@
 
 # Ignore networking block comment style
 --ignore NETWORKING_BLOCK_COMMENT_STYLE
+
+# Ignore "WARNING: Prefer ether_addr_copy() over memcpy() if the Ethernet
+# addresses are __aligned(2)".
+--ignore PREFER_ETHER_ADDR_COPY
-- 
2.7.0

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


Re: [U-Boot] [PATCH 1/2] test/py: move find_ram_base() into u_boot_utils

2016-01-25 Thread Stephen Warren

On 01/22/2016 03:30 PM, Wolfgang Denk wrote:

Dear Stephen,

In message <1453417531-23669-1-git-send-email-swar...@wwwdotorg.org> you wrote:


find_ram_base() is a shared utility function, not a core part of the
U-Boot console interaction.


On which boards did you test this feature?  Eventually ARM only?


It's been tested on a few ARM, sandbox, and at least one microblaze.


+with u_boot_console.log.section('find_ram_base'):
+response = u_boot_console.run_command('bdinfo')
+for l in response.split('\n'):
+if '-> start' in l:
+ram_base = int(l.split('=')[1].strip(), 16)
+break


Searching for "-> start" is probably not exactly portable.  For
example, on a PowerPC system the output of "bdi" might look like this:

=> bdi
memstart= 0x
memsize = 0x0400

...


[example is from a TQM5200S, U-Boot 2016.01-00223-gb57843e]


Good point. I think the best fix here is to modify all implementations 
of "bdinfo" to print the same information and in the same format as much 
as possible. Do you agree?

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


Re: [U-Boot] [Patch V5 2/4] spi: fsl_qspi: Fix qspi_op_rdid memcpy issue

2016-01-25 Thread york sun
On 01/25/2016 09:01 AM, Scott Wood wrote:
> On 01/25/2016 10:47 AM, york sun wrote:
>> On 01/24/2016 08:09 PM, Yao Yuan wrote:
>>> On 01/25/2016 04:16 AM, York Sun wrote:
 On 01/22/2016 07:43 AM, Scott Wood wrote:
> On 01/21/2016 09:35 PM, Qianyu Gong wrote:
>>
>>> -Original Message-
>>> From: Scott Wood
>>> Sent: Friday, January 22, 2016 3:30 AM
>>> To: Qianyu Gong ; u-boot@lists.denx.de;
>>> r58...@freescale.com
>>> Cc: mingkai...@freescale.com; jt...@openedev.com;
>>> b48...@freescale.com; shaohui@freescale.com;
>>> wenbin.s...@freescale.com; Scott Wood ; Gong
>>> Qianyu 
>>> Subject: Re: [Patch V5 2/4] spi: fsl_qspi: Fix qspi_op_rdid memcpy
>>> issue
>>>
>>> On 01/20/2016 09:43 PM, Gong Qianyu wrote:
 From: Gong Qianyu 

 In current driver everytime we memcpy 4 bytes to the dest memory
 regardless of the remaining length.
 This patch adds checking the remaining length before memcpy.
 If the length is shorter than 4 bytes, memcpy the actual length of
 data to the dest memory.

 Signed-off-by: Gong Qianyu 
 ---
 V2-V5:
  - No change.

  drivers/spi/fsl_qspi.c | 5 -
  1 file changed, 4 insertions(+), 1 deletion(-)

 diff --git a/drivers/spi/fsl_qspi.c b/drivers/spi/fsl_qspi.c index
 38e5900..f178857 100644
 --- a/drivers/spi/fsl_qspi.c
 +++ b/drivers/spi/fsl_qspi.c
 @@ -500,7 +500,10 @@ static void qspi_op_rdid(struct fsl_qspi_priv
 *priv, u32
>>> *rxbuf, u32 len)
if (rbsr_reg & QSPI_RBSR_RDBFL_MASK) {
data = qspi_read32(priv->flags, ®s->rbdr[i]);
data = qspi_endian_xchg(data);
 -  memcpy(rxbuf, &data, 4);
 +  if (size < 4)
 +  memcpy(rxbuf, &data, size);
 +  else
 +  memcpy(rxbuf, &data, 4);
>>>
>>> memcpy(rxbuf, &data, min(size, 4));
>>>
rxbuf++;
size -= 4;
i++;
>>>
>>> size -= 4 even if size was < 4?
>>>
>>> -Scott
>>
>> Yes.. The following is complete code:
>>
>> i = 0;
>> size = len;
>> while ((RX_BUFFER_SIZE >= size) && (size > 0)) {
>> rbsr_reg = qspi_read32(priv->flags, ®s->rbsr);
>> if (rbsr_reg & QSPI_RBSR_RDBFL_MASK) {
>> data = qspi_read32(priv->flags, ®s->rbdr[i]);
>> data = qspi_endian_xchg(data);
>> memcpy(rxbuf, &data, min(size, 4));
>> rxbuf++;
>> size -= 4;
>> i++;
>> }
>> }
>
> I'm not saying it doesn't work (assuming i is signed, which the
> "complete code" above doesn't show).  I'm saying it looks weird, and
> it would be better to have a variable that holds min(size, 4) and pass
> that to both memcpy and the subtraction.
>

 Qianyu,

 Previously I said it looked weird for doing this. Please fix.

 "size" is declared as "int".
 "len" is declared as u32. That's not "int". If you trace back the 
 functions, you
 may see it came from DIV_ROUND_UP(bitlen, 8) where bitlen is "unsigned 
 int".
 So technically the code is safe. But it is _confusing_. We don't want to 
 confuse
 ourselves when reading the code later. And the fix is easy, isn't it?

 York

>>>
>>> How about like this?
>>>
>>> diff --git a/drivers/spi/fsl_qspi.c b/drivers/spi/fsl_qspi.c
>>> index feec3e8..13bba09 100644
>>> --- a/drivers/spi/fsl_qspi.c
>>> +++ b/drivers/spi/fsl_qspi.c
>>> @@ -477,8 +477,8 @@ static void qspi_op_rdbank(struct fsl_qspi_priv *priv, 
>>> u8 *rxbuf, u32 len)
>>>  static void qspi_op_rdid(struct fsl_qspi_priv *priv, u32 *rxbuf, u32 len)
>>>  {
>>> struct fsl_qspi_regs *regs = priv->regs;
>>> -   u32 mcr_reg, rbsr_reg, data;
>>> -   int i, size;
>>> +   u32 mcr_reg, rbsr_reg, data, size;
>>> +   int i;
>>>
>>> mcr_reg = qspi_read32(priv->flags, ®s->mcr);
>>> qspi_write32(priv->flags, ®s->mcr,
>>> @@ -495,14 +495,14 @@ static void qspi_op_rdid(struct fsl_qspi_priv *priv, 
>>> u32 *rxbuf, u32 len)
>>>
>>> i = 0;
>>> size = len;
>>> -   while ((RX_BUFFER_SIZE >= size) && (size > 0)) {
>>> +   while ((RX_BUFFER_SIZE >= size) && (size != 0)) {
>>
>> You can keep using "size > 0". It is still correct.
> 
> And more robust.
> 
>>
>>> rbsr_reg = qspi_read32(priv->flags, ®s->rbsr);
>>> if (rbsr_reg & QSPI_RBSR_RDBFL_MASK) {
>>>

Re: [U-Boot] [PATCH v4 5/6] rockchip: kylin: Enable boot with android boot image

2016-01-25 Thread Tom Rini
On Fri, Jan 15, 2016 at 04:42:21PM +0100, Daniel Schwierzeck wrote:
> Am Freitag, den 15.01.2016, 09:42 -0500 schrieb Tom Rini:
> > On Fri, Jan 15, 2016 at 10:20:43AM +0800, Jeffy Chen wrote:
> > > Hi Tom,
> > > 
> > > On 2016-1-15 8:59, Tom Rini wrote:
> > > > On Fri, Jan 15, 2016 at 08:53:06AM +0800, Jeffy Chen wrote:
> > > > > Hi Tom,
> > > > > 
> > > > > On 2016-1-15 0:22, Tom Rini wrote:
> > > > > > On Thu, Jan 14, 2016 at 10:31:34AM +0800, Jeffy Chen wrote:
> > > > > > > Hi Tom,
> > > > > > > 
> > > > > > > On 2016-1-13 23:28, Tom Rini wrote:
> > > > > > > > On Wed, Jan 13, 2016 at 04:53:19PM +0800, Jeffy Chen
> > > > > > > > wrote:
> > > > > > > > 
> > > > > > > > > The android kernel is using appended dtb by default,
> > > > > > > > > and store
> > > > > > > > > ramdisk right after kernel & dtb.
> > > > > > > > > So we needs to relocate ramdisk, and use atags to pass
> > > > > > > > > params.
> > > > > > > > > 
> > > > > > > > > Signed-off-by: Jeffy Chen 
> > > > > > > > > Acked-by: Simon Glass 
> > > > > > > > > ---
> > > > > > > > > 
> > > > > > > > > Changes in v4: None
> > > > > > > > > Changes in v3: None
> > > > > > > > > Changes in v2: None
> > > > > > > > > 
> > > > > > > > >  include/configs/kylin_rk3036.h | 23
> > > > > > > > > +++
> > > > > > > > >  1 file changed, 23 insertions(+)
> > > > > > > > > 
> > > > > > > > > diff --git a/include/configs/kylin_rk3036.h
> > > > > > > > > b/include/configs/kylin_rk3036.h
> > > > > > > > > index b750b26..49997ec 100644
> > > > > > > > > --- a/include/configs/kylin_rk3036.h
> > > > > > > > > +++ b/include/configs/kylin_rk3036.h
> > > > > > > > > @@ -35,6 +35,29 @@
> > > > > > > > >  #undef CONFIG_EXTRA_ENV_SETTINGS
> > > > > > > > >  #define CONFIG_EXTRA_ENV_SETTINGS \
> > > > > > > > >   "partitions=" PARTS_DEFAULT \
> > > > > > > > > + "mmcdev=0\0" \
> > > > > > > > > + "mmcpart=5\0" \
> > > > > > > > > + "loadaddr=" __stringify(CONFIG_SYS_LOAD_ADDR)
> > > > > > > > > "\0" \
> > > > > > > > > +
> > > > > > > > > +#define CONFIG_ANDROID_BOOT_IMAGE
> > > > > > > > > +#define CONFIG_SYS_BOOT_RAMDISK_HIGH
> > > > > > > > This should already be set.
> > > > > > > Right, i'll remove it...
> > > > > > > > > +#define CONFIG_SYS_HUSH_PARSER
> > > > > > > > > +
> > > > > > > > > +#undef CONFIG_BOOTCOMMAND
> > > > > > > > > +#define CONFIG_BOOTCOMMAND \
> > > > > > > > > + "mmc dev ${mmcdev}; if mmc rescan; then " \
> > > > > > > > > + "part start mmc ${mmcdev} ${mmcpart}
> > > > > > > > > boot_start;" \
> > > > > > > > > + "part size mmc ${mmcdev} ${mmcpart}
> > > > > > > > > boot_size;" \
> > > > > > > > > + "mmc read ${loadaddr} ${boot_start}
> > > > > > > > > ${boot_size};" \
> > > > > > > > > + "bootm start ${loadaddr}; bootm
> > > > > > > > > ramdisk;" \
> > > > > > > > > + "bootm prep; bootm go;" \
> > > > > > > > > + "fi;" \
> > > > > > > > > +
> > > > > > > > > +/* Enable atags */
> > > > > > > > > +#define CONFIG_SYS_BOOTPARAMS_LEN(64*1024)
> > > > > > > > > +#define CONFIG_INITRD_TAG
> > > > > > > > > +#define CONFIG_SETUP_MEMORY_TAGS
> > > > > > > > > +#define CONFIG_CMDLINE_TAG
> > > > > > > > But I'm confused as to what exactly is going on here. 
> > > > > > > >  Appended dtb is
> > > > > > > > not the same as ATAGS.  And you shouldn't need to split
> > > > > > > > up bootm like
> > > > > > > > that.  Can you please explain a bit more?  Thanks!
> > > > > > > The u-boot will pass atags to kernel, and kernel will merge
> > > > > > > those
> > > > > > > atags into the appended dtb(fdt).
> > > > > > > 
> > > > > > > The default bootm flow would not pass ramdisk state, but we
> > > > > > > need it,
> > > > > > > so we should add this state into default flow, or just use
> > > > > > > split
> > > > > > > bootm cmds :)
> > > > > > That seems very strange.  Is the ramdisk concatenated with
> > > > > > the kernel
> > > > > > and dtb as well (and that's why bootm ramdisk somehow finds
> > > > > > it but
> > > > > > normal bootm doesn't as you aren't passing in a ramdisk
> > > > > > address) ?
> > > > > Yes, the ramdisk concatenated with the kernel and dtb as
> > > > > well(u-boot/include/android_image.h: struct andr_img_hdr).
> > > > > 
> > > > > And the normal bootm cmd would find it by parsing andr_img_hdr
> > > > > struct.
> > > > > But we still need bootm ramdisk state, because it will call
> > > > > boot_ramdisk_high to relocate ramdisk area :)
> > > > > 
> > > > > I found if not relocate it to somewhere else, it would be
> > > > > corrupted
> > > > > after kernel's decompressing(during update fdt area).
> > > > So 'bootm $loadaddr' of an Android image sees, but does not
> > > > relocate the
> > > > ramdisk that is included in the image, but bootm ramdisk does? 
> > > >  That
> > > > sounds like a bug in the regular bootm handling.
> > > Yep, the default bootm flow would not contain ramdisk relocate
> > > state:
> > > 
> > > vi common/cmd_boot

Re: [U-Boot] [PATCHv7 6/7] igep00x0: UBIize

2016-01-25 Thread Enric Balletbo Serra
Hi Ladis,

2016-01-25 16:56 GMT+01:00 Ladislav Michl :
> Hi Enric,
>
> On Mon, Jan 25, 2016 at 08:26:23AM +0100, Enric Balletbo Serra wrote:
>> The ROM boot on OMAP reads the first 4 blocks searching for the SPL,
>> in production is a practice flash the SPL 4 times. OneNAND/NAND
>> devices can have different block sizes and the OMAP ROM boot supports
>> block sizes from 64KB to 512K. For IGEP boards in particular, at least
>> there are boards that have block size of 128K and 256K. What I would
>> meant here is set as default the mtdparts variable to reserve 2M for
>> SPL, just to cover all the cases.
>>
>> mtdparts=mtdparts=gpmc-nand.0:2m(SPL),-(UBI)\0
>
> So far there was no ack or nack to yesterday's proposal making that
> dynamic; Both boot ROM and ubispl code thinks in terms of eraseblocks,
> only mtd needs fixed offset. So I'd like to see this offset calculated as
> 4*block_size, not some "worst case" value...
>
> ladis

Your proposal looks good to me.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCHv2 2/8] arm: colibri-vf: Enable serial support

2016-01-25 Thread Bhuvanchandra DV
- Enable lpuart support on Toradex Colibri VF50/VF61
- Use UART0 for stdout.

Signed-off-by: Bhuvanchandra DV 
---
 arch/arm/dts/vf-colibri.dtsi | 9 +
 1 file changed, 9 insertions(+)

diff --git a/arch/arm/dts/vf-colibri.dtsi b/arch/arm/dts/vf-colibri.dtsi
index 7a8e9bee..13a1dba 100644
--- a/arch/arm/dts/vf-colibri.dtsi
+++ b/arch/arm/dts/vf-colibri.dtsi
@@ -10,6 +10,12 @@
  */
 #include "vf.dtsi"
 
+/ {
+   chosen {
+   stdout-path = &uart0;
+   };
+};
+
 &dspi1 {
status = "okay";
bus-num = <1>;
@@ -19,3 +25,6 @@
spi-max-frequency = <5000>;
};
 };
+&uart0 {
+   status = "okay";
+};
-- 
2.7.0

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


[U-Boot] [PATCHv2 3/8] dm: lpuart: Drop the legacy code

2016-01-25 Thread Bhuvanchandra DV
All boards using this driver are with device tree support,
hence drop the legacy code in driver to have a pure DT solution.

Signed-off-by: Bhuvanchandra DV 
Reviewed-by: Bin Meng 
---
 drivers/serial/serial_lpuart.c | 101 +
 1 file changed, 2 insertions(+), 99 deletions(-)

diff --git a/drivers/serial/serial_lpuart.c b/drivers/serial/serial_lpuart.c
index 3f9c4d1..fc3321f 100644
--- a/drivers/serial/serial_lpuart.c
+++ b/drivers/serial/serial_lpuart.c
@@ -48,8 +48,6 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-struct lpuart_fsl *base = (struct lpuart_fsl *)LPUART_BASE;
-
 struct lpuart_serial_platdata {
struct lpuart_fsl *reg;
 };
@@ -127,43 +125,6 @@ static int _lpuart_serial_init(struct lpuart_fsl *base)
return 0;
 }
 
-#ifndef CONFIG_DM_SERIAL
-static void lpuart_serial_setbrg(void)
-{
-   _lpuart_serial_setbrg(base, gd->baudrate);
-}
-
-static int lpuart_serial_getc(void)
-{
-   return _lpuart_serial_getc(base);
-}
-
-static void lpuart_serial_putc(const char c)
-{
-   _lpuart_serial_putc(base, c);
-}
-
-static int lpuart_serial_tstc(void)
-{
-   return _lpuart_serial_tstc(base);
-}
-
-static int lpuart_serial_init(void)
-{
-   return _lpuart_serial_init(base);
-}
-
-static struct serial_device lpuart_serial_drv = {
-   .name = "lpuart_serial",
-   .start = lpuart_serial_init,
-   .stop = NULL,
-   .setbrg = lpuart_serial_setbrg,
-   .putc = lpuart_serial_putc,
-   .puts = default_serial_puts,
-   .getc = lpuart_serial_getc,
-   .tstc = lpuart_serial_tstc,
-};
-#else /* CONFIG_DM_SERIAL */
 static int lpuart_serial_setbrg(struct udevice *dev, int baudrate)
 {
struct lpuart_serial_platdata *plat = dev->platdata;
@@ -210,8 +171,8 @@ static int lpuart_serial_probe(struct udevice *dev)
 
return _lpuart_serial_init(reg);
 }
-#endif /* CONFIG_DM_SERIAL */
 #else
+
 static void _lpuart32_serial_setbrg(struct lpuart_fsl *base, int baudrate)
 {
u32 clk = CONFIG_SYS_CLK_FREQ;
@@ -281,43 +242,6 @@ static int _lpuart32_serial_init(struct lpuart_fsl *base)
return 0;
 }
 
-#ifndef CONFIG_DM_SERIAL
-static void lpuart32_serial_setbrg(void)
-{
-   _lpuart32_serial_setbrg(base, gd->baudrate);
-}
-
-static int lpuart32_serial_getc(void)
-{
-   return _lpuart32_serial_getc(base);
-}
-
-static void lpuart32_serial_putc(const char c)
-{
-   _lpuart32_serial_putc(base, c);
-}
-
-static int lpuart32_serial_tstc(void)
-{
-   return _lpuart32_serial_tstc(base);
-}
-
-static int lpuart32_serial_init(void)
-{
-   return _lpuart32_serial_init(base);
-}
-
-static struct serial_device lpuart32_serial_drv = {
-   .name = "lpuart32_serial",
-   .start = lpuart32_serial_init,
-   .stop = NULL,
-   .setbrg = lpuart32_serial_setbrg,
-   .putc = lpuart32_serial_putc,
-   .puts = default_serial_puts,
-   .getc = lpuart32_serial_getc,
-   .tstc = lpuart32_serial_tstc,
-};
-#else /* CONFIG_DM_SERIAL */
 static int lpuart32_serial_setbrg(struct udevice *dev, int baudrate)
 {
struct lpuart_serial_platdata *plat = dev->platdata;
@@ -364,28 +288,8 @@ static int lpuart32_serial_probe(struct udevice *dev)
 
return _lpuart32_serial_init(reg);
 }
-#endif /* CONFIG_DM_SERIAL */
-#endif
-
-#ifndef CONFIG_DM_SERIAL
-void lpuart_serial_initialize(void)
-{
-#ifdef CONFIG_LPUART_32B_REG
-   serial_register(&lpuart32_serial_drv);
-#else
-   serial_register(&lpuart_serial_drv);
-#endif
-}
+#endif /* CONFIG_LPUART_32B_REG */
 
-__weak struct serial_device *default_serial_console(void)
-{
-#ifdef CONFIG_LPUART_32B_REG
-   return &lpuart32_serial_drv;
-#else
-   return &lpuart_serial_drv;
-#endif
-}
-#else /* CONFIG_DM_SERIAL */
 static int lpuart_serial_ofdata_to_platdata(struct udevice *dev)
 {
struct lpuart_serial_platdata *plat = dev->platdata;
@@ -447,4 +351,3 @@ U_BOOT_DRIVER(serial_lpuart32) = {
.flags = DM_FLAG_PRE_RELOC,
 };
 #endif /* CONFIG_LPUART_32B_REG */
-#endif /* CONFIG_DM_SERIAL */
-- 
2.7.0

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


[U-Boot] [PATCHv2 4/8] dm: vybrid_gpio: Drop legacy code

2016-01-25 Thread Bhuvanchandra DV
All boards using this driver are with device tree support,
hence drop the legacy code in driver to have a pure DT solution.

Signed-off-by: Bhuvanchandra DV 
Reviewed-by: Bin Meng 
---
 drivers/gpio/vybrid_gpio.c | 18 --
 1 file changed, 18 deletions(-)

diff --git a/drivers/gpio/vybrid_gpio.c b/drivers/gpio/vybrid_gpio.c
index 4d25f9a..a30ba5d 100644
--- a/drivers/gpio/vybrid_gpio.c
+++ b/drivers/gpio/vybrid_gpio.c
@@ -135,24 +135,6 @@ static int vybrid_gpio_bind(struct udevice *dev)
return 0;
 }
 
-#if !CONFIG_IS_ENABLED(OF_CONTROL)
-static const struct vybrid_gpio_platdata vybrid_gpio[] = {
-   {0, GPIO0_BASE_ADDR, "GPIO0 "},
-   {1, GPIO1_BASE_ADDR, "GPIO1 "},
-   {2, GPIO2_BASE_ADDR, "GPIO2 "},
-   {3, GPIO3_BASE_ADDR, "GPIO3 "},
-   {4, GPIO4_BASE_ADDR, "GPIO4 "},
-};
-
-U_BOOT_DEVICES(vybrid_gpio) = {
-   { "gpio_vybrid", &vybrid_gpio[0] },
-   { "gpio_vybrid", &vybrid_gpio[1] },
-   { "gpio_vybrid", &vybrid_gpio[2] },
-   { "gpio_vybrid", &vybrid_gpio[3] },
-   { "gpio_vybrid", &vybrid_gpio[4] },
-};
-#endif
-
 static const struct udevice_id vybrid_gpio_ids[] = {
{ .compatible = "fsl,vf610-gpio" },
{ }
-- 
2.7.0

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


[U-Boot] [PATCHv2 6/8] arm: vf610-twr: Add device tree file's

2016-01-25 Thread Bhuvanchandra DV
- Add device tree files for NXP/Freescale VF610 Tower Board.
- Enable lpuart support on NXP/Freescale VF610 Tower Board.
- Use UART1 as stdout.

Signed-off-by: Bhuvanchandra DV 
---
 arch/arm/dts/Makefile  |  3 ++-
 arch/arm/dts/vf610-twr.dts | 22 ++
 2 files changed, 24 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/dts/vf610-twr.dts

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index f66ff41..c6fb50c 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -190,7 +190,8 @@ dtb-$(CONFIG_MACH_SUN9I) += \
sun9i-a80-cubieboard4.dtb
 
 dtb-$(CONFIG_VF610) += vf500-colibri.dtb \
-   vf610-colibri.dtb
+   vf610-colibri.dtb \
+   vf610-twr.dtb
 
 dtb-$(CONFIG_SOC_KEYSTONE) += k2hk-evm.dtb \
k2l-evm.dtb \
diff --git a/arch/arm/dts/vf610-twr.dts b/arch/arm/dts/vf610-twr.dts
new file mode 100644
index 000..a4ccbcb
--- /dev/null
+++ b/arch/arm/dts/vf610-twr.dts
@@ -0,0 +1,22 @@
+/*
+ * Copyright 2016 Toradex AG
+ *
+ * SPDX-License-Identifier: GPL-2.0+ or X11
+ */
+
+/dts-v1/;
+#include "vf.dtsi"
+
+/ {
+   model = "VF610 Tower Board";
+   compatible = "fsl,vf610-twr", "fsl,vf610";
+
+   choosen {
+   stdout-path = &uart1;
+   };
+
+};
+
+&uart1 {
+   status = "okay";
+};
-- 
2.7.0

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


[U-Boot] [PATCHv2 5/8] arm: vybrid: Drop enabling GPIO, UART and SPI in legacy mode

2016-01-25 Thread Bhuvanchandra DV
Remove the legacy way of enabling UART, GPIO and SPI on Vybrid
based boards since these driver's now only supports DT mode.

Signed-off-by: Bhuvanchandra DV 
---
 include/configs/colibri_vf.h | 13 -
 include/configs/pcm052.h |  3 ---
 include/configs/vf610twr.h   |  3 ---
 3 files changed, 19 deletions(-)

diff --git a/include/configs/colibri_vf.h b/include/configs/colibri_vf.h
index 5aed3a5..6efff76 100644
--- a/include/configs/colibri_vf.h
+++ b/include/configs/colibri_vf.h
@@ -36,13 +36,10 @@
 
 #define CONFIG_BOARD_EARLY_INIT_F
 
-#define LPUART_BASEUART0_BASE
-
 /* Allow to overwrite serial and ethaddr */
 #define CONFIG_ENV_OVERWRITE
 #define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
 #define CONFIG_VERSION_VARIABLE
-#define CONFIG_SYS_UART_PORT   (0)
 #define CONFIG_BAUDRATE115200
 #define CONFIG_CMD_ASKENV
 
@@ -52,10 +49,6 @@
 #define CONFIG_SYS_MAX_NAND_DEVICE 1
 #define CONFIG_SYS_NAND_BASE   NFC_BASE_ADDR
 
-/* GPIO support */
-#define CONFIG_DM_GPIO
-#define CONFIG_VYBRID_GPIO
-
 /* Dynamic MTD partition support */
 #define CONFIG_CMD_MTDPARTS/* Enable 'mtdparts' command line support */
 #define CONFIG_MTD_PARTITIONS
@@ -265,10 +258,4 @@
 #define CONFIG_USB_FUNCTION_MASS_STORAGE
 #define CONFIG_CMD_USB_MASS_STORAGE
 
-/* Enable SPI support */
-#ifdef CONFIG_OF_CONTROL
-#define CONFIG_DM_SPI
-#define CONFIG_CMD_SPI
-#endif
-
 #endif /* __CONFIG_H */
diff --git a/include/configs/pcm052.h b/include/configs/pcm052.h
index 891bdb0..f3353f2 100644
--- a/include/configs/pcm052.h
+++ b/include/configs/pcm052.h
@@ -27,11 +27,8 @@
 
 #define CONFIG_BOARD_EARLY_INIT_F
 
-#define LPUART_BASEUART1_BASE
-
 /* Allow to overwrite serial and ethaddr */
 #define CONFIG_ENV_OVERWRITE
-#define CONFIG_SYS_UART_PORT   (1)
 #define CONFIG_BAUDRATE115200
 
 #undef CONFIG_CMD_IMLS
diff --git a/include/configs/vf610twr.h b/include/configs/vf610twr.h
index dcfafaf..84ad2c3 100644
--- a/include/configs/vf610twr.h
+++ b/include/configs/vf610twr.h
@@ -34,11 +34,8 @@
 
 #define CONFIG_BOARD_EARLY_INIT_F
 
-#define LPUART_BASEUART1_BASE
-
 /* Allow to overwrite serial and ethaddr */
 #define CONFIG_ENV_OVERWRITE
-#define CONFIG_SYS_UART_PORT   (1)
 #define CONFIG_BAUDRATE115200
 
 /* NAND support */
-- 
2.7.0

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


[U-Boot] [PATCHv2 8/8] arm: vybrid: Update defconfig's

2016-01-25 Thread Bhuvanchandra DV
Let's go with pure DT solution for board's
based on NXP/Freescale Vybrid platform.

- Merge the DT defconfig with non-DT defconfig for Toradex
  Colibri VF50/VF61 and drop the non-DT defconfig.
- Update the legacy defconfigs for NXP/Freescale VF610 Tower
  Board with DT.
- Update the legacy defconfigs for Phytec phyCORE-vybrid
  Board with DT.

Signed-off-by: Bhuvanchandra DV 
---
 configs/colibri_vf_defconfig |  8 
 configs/colibri_vf_dtb_defconfig | 14 --
 configs/pcm052_defconfig |  7 +++
 configs/vf610twr_defconfig   |  7 +++
 configs/vf610twr_nand_defconfig  |  7 +++
 5 files changed, 29 insertions(+), 14 deletions(-)
 delete mode 100644 configs/colibri_vf_dtb_defconfig

diff --git a/configs/colibri_vf_defconfig b/configs/colibri_vf_defconfig
index 45917c8..27a41e7 100644
--- a/configs/colibri_vf_defconfig
+++ b/configs/colibri_vf_defconfig
@@ -1,11 +1,19 @@
 CONFIG_ARM=y
 CONFIG_TARGET_COLIBRI_VF=y
+CONFIG_DM_SERIAL=y
+CONFIG_DM_SPI=y
+CONFIG_DM_GPIO=y
+CONFIG_DEFAULT_DEVICE_TREE="vf610-colibri"
 
CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/toradex/colibri_vf/imximage.cfg,ENV_IS_IN_NAND,IMX_NAND"
 CONFIG_SYS_PROMPT="Colibri VFxx # "
 # CONFIG_CMD_IMLS is not set
+CONFIG_CMD_SPI=y
 CONFIG_CMD_GPIO=y
 # CONFIG_CMD_SETEXPR is not set
+CONFIG_OF_CONTROL=y
 CONFIG_DM=y
+CONFIG_VYBRID_GPIO=y
 CONFIG_NAND_VF610_NFC=y
 CONFIG_SYS_NAND_VF610_NFC_60_ECC_BYTES=y
 CONFIG_FSL_LPUART=y
+CONFIG_FSL_DSPI=y
diff --git a/configs/colibri_vf_dtb_defconfig b/configs/colibri_vf_dtb_defconfig
deleted file mode 100644
index b1a843a..000
--- a/configs/colibri_vf_dtb_defconfig
+++ /dev/null
@@ -1,14 +0,0 @@
-CONFIG_ARM=y
-CONFIG_TARGET_COLIBRI_VF=y
-CONFIG_DEFAULT_DEVICE_TREE="vf610-colibri"
-CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/toradex/colibri_vf/imximage.cfg,ENV_IS_IN_NAND,IMX_NAND"
-CONFIG_SYS_PROMPT="Colibri VFxx # "
-# CONFIG_CMD_IMLS is not set
-CONFIG_CMD_GPIO=y
-# CONFIG_CMD_SETEXPR is not set
-# CONFIG_CMD_NET is not set
-CONFIG_OF_CONTROL=y
-CONFIG_DM=y
-CONFIG_NAND_VF610_NFC=y
-CONFIG_SYS_NAND_VF610_NFC_60_ECC_BYTES=y
-CONFIG_FSL_LPUART=y
diff --git a/configs/pcm052_defconfig b/configs/pcm052_defconfig
index 26ab733..49159ce 100644
--- a/configs/pcm052_defconfig
+++ b/configs/pcm052_defconfig
@@ -1,6 +1,13 @@
 CONFIG_ARM=y
 CONFIG_TARGET_PCM052=y
+CONFIG_DM_SERIAL=y
+CONFIG_DM_GPIO=y
+CONFIG_DEFAULT_DEVICE_TREE="pcm052"
 
CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/phytec/pcm052/imximage.cfg,ENV_IS_IN_NAND"
+CONFIG_CMD_GPIO=y
+CONFIG_OF_CONTROL=y
+CONFIG_DM=y
+CONFIG_VYBRID_GPIO=y
 CONFIG_NAND_VF610_NFC=y
 CONFIG_SYS_NAND_BUSWIDTH_16BIT=y
 CONFIG_FSL_LPUART=y
diff --git a/configs/vf610twr_defconfig b/configs/vf610twr_defconfig
index d51c93b..d959293 100644
--- a/configs/vf610twr_defconfig
+++ b/configs/vf610twr_defconfig
@@ -1,8 +1,15 @@
 CONFIG_ARM=y
 CONFIG_TARGET_VF610TWR=y
+CONFIG_DM_SERIAL=y
+CONFIG_DM_GPIO=y
+CONFIG_DEFAULT_DEVICE_TREE="vf610-twr"
 
CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/freescale/vf610twr/imximage.cfg,ENV_IS_IN_MMC"
 # CONFIG_CMD_IMLS is not set
+CONFIG_CMD_GPIO=y
 # CONFIG_CMD_SETEXPR is not set
+CONFIG_OF_CONTROL=y
+CONFIG_DM=y
+CONFIG_VYBRID_GPIO=y
 CONFIG_NAND_VF610_NFC=y
 CONFIG_SYS_NAND_BUSWIDTH_16BIT=y
 CONFIG_SPI_FLASH=y
diff --git a/configs/vf610twr_nand_defconfig b/configs/vf610twr_nand_defconfig
index 299fa8f..b6a96f2 100644
--- a/configs/vf610twr_nand_defconfig
+++ b/configs/vf610twr_nand_defconfig
@@ -1,8 +1,15 @@
 CONFIG_ARM=y
 CONFIG_TARGET_VF610TWR=y
+CONFIG_DM_SERIAL=y
+CONFIG_DM_GPIO=y
+CONFIG_DEFAULT_DEVICE_TREE="vf610-twr"
 
CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/freescale/vf610twr/imximage.cfg,ENV_IS_IN_NAND"
 # CONFIG_CMD_IMLS is not set
+CONFIG_CMD_GPIO=y
 # CONFIG_CMD_SETEXPR is not set
+CONFIG_OF_CONTROL=y
+CONFIG_DM=y
+CONFIG_VYBRID_GPIO=y
 CONFIG_NAND_VF610_NFC=y
 CONFIG_SYS_NAND_BUSWIDTH_16BIT=y
 CONFIG_SPI_FLASH=y
-- 
2.7.0

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


[U-Boot] [PATCHv2 7/8] arm: pcm052: Add device tree file's

2016-01-25 Thread Bhuvanchandra DV
- Add device tree files for Phytec phyCORE-Vybrid Board.
- Enable lpuart support for Phytec phyCORE-Vybrid Board.
- Use UART1 for stdout.

Signed-off-by: Bhuvanchandra DV 
---
 arch/arm/dts/Makefile   |  3 ++-
 arch/arm/dts/pcm052.dts | 22 ++
 2 files changed, 24 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/dts/pcm052.dts

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index c6fb50c..b3bde5a 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -191,7 +191,8 @@ dtb-$(CONFIG_MACH_SUN9I) += \
 
 dtb-$(CONFIG_VF610) += vf500-colibri.dtb \
vf610-colibri.dtb \
-   vf610-twr.dtb
+   vf610-twr.dtb \
+   pcm052.dtb
 
 dtb-$(CONFIG_SOC_KEYSTONE) += k2hk-evm.dtb \
k2l-evm.dtb \
diff --git a/arch/arm/dts/pcm052.dts b/arch/arm/dts/pcm052.dts
new file mode 100644
index 000..0475f1f
--- /dev/null
+++ b/arch/arm/dts/pcm052.dts
@@ -0,0 +1,22 @@
+/*
+ * Copyright 2016 Toradex AG
+ *
+ * SPDX-License-Identifier: GPL-2.0+ or X11
+ */
+
+/dts-v1/;
+#include "vf.dtsi"
+
+/ {
+   model = "Phytec phyCORE-Vybrid";
+   compatible = "phytec,pcm052", "fsl,vf610";
+
+   choosen {
+   stdout-path = &uart1;
+   };
+
+};
+
+&uart1 {
+   status = "okay";
+};
-- 
2.7.0

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


[U-Boot] U-Boot as a next bootloader in a chain - reading the kernel boot args provided by the previous stage bootlader?

2016-01-25 Thread Wael Almattar
Hi,

How do you suggest to implement such functionality? Do you want to
make u-boot able to modify kernel args which has been sent by
start.elf? or you want during u-boot stage to press a hotkey which
give you the opportunity to edit previous bootargs?

Please explain how do you expect u-boot to behave after implementing
this patch..

Best Regards,

Wael Almattar

Hello Wojciech,

On Mon, 16 Nov 2015 13:09:43 +0100, Wojciech Zabolotny
http://lists.denx.de/mailman/listinfo/u-boot>> wrote:
>* 2015-11-16 11:52 GMT+01:00 Albert ARIBAUD >:
*>* > Hello Wojciech,
*>* >
*>* > On Mon, 16 Nov 2015 10:42:50 +0100, Wojciech Zabolotny
*>* > http://lists.denx.de/mailman/listinfo/u-boot>> wrote:
*>* >> Hi,
*>* >>
*>* >> I need to use U-Boot (or barebox) as a bootloader in a Raspberry Pi
*>* >> based system to extend booting flexibility.
*>* >> The problem however is that certain kernel boot arguments are prepared
*>* >> by the previous stage bootloader (start.elf)
*>* >> basing on the properties of the individual board.
*>* >> For example in one of the boards I use, the kernel command line when a
*>* >> standard kernel is booted, looks as follows (MAC address and serial
*>* >> number are partially masked for privacy):
*>* >>
*>* >> dma.dmachans=0x7f35 bcm2708_fb.fbwidth=720 bcm2708_fb.fbheight=480
*>* >> bcm2708.boardrev=0xd bcm2708.serial=0x6f15
*>* >> smsc95xx.macaddr=B8:27:EB:XX:XX:XX bcm2708_fb.fbswap=1
*>* >> sdhci-bcm2708.emmc_clock_freq=25000 vc_mem.mem_base=0x1ec0
*>* >> vc_mem.mem_size=0x2000  console=ttyAMA0 root=/dev/mmcblk0p2
*>* >> rootwait
*>* >>
*>* >> Only the "console=ttyAMA0 root=/dev/mmcblk0p2 rootwait" is provided by
*>* >> the user (in the cmdline.txt file). The rest is generated by the
*>* >> start.elf.
*>* >>
*>* >> Of course when I boot the u-boot.bin instead of zImage, the same
*>* >> parameters are passed to it, but the U-Boot is not able to read them
*>* >> and to pass them to the finally booted kernel.
*>* >> As U-Boot shares a lot of code with the Linux kernel it should be
*>* >> possible to add necessary functions.
*>* >> It could be useful in all applications where U-Boot is used as an
*>* >> additional stage in the boot chain e.g., to add new booting
*>* >> functionalities (booting from the network, booting from the flash disk
*>* >> etc.).
*>* >>
*>* >> I have found a nice description, how the paremeters are passed in ARM
*>* >> architecture:
*>* >> http://www.simtec.co.uk/products/SWLINUX/files/booting%5Farticle.html

*>* >> but of course the solution should be probably portable (or implemented
*>* >> for each platform independently with unified API).
*>* >
*>* > Not sure what kind of answer you're asking for here. Do you want to
*>* > know if what you're suggesting is feasible? Are you looking for someone
*>* > to implement it? Are you going to implement it yourself but asking for
*>* > feedback?
*>* >
*>* >> --
*>* >
*>* > (aside: if the above should be a signature delimiter, then it lacks a
*>* > space after the dashes)
*>* >
*>* > Amicalement,
*>* > --
*>* > Albert.
*> >* Dear Albert,
*> >* Yes the first question is if this feature is feasible.
*
In software, just about anything is feasible; ask any PHB. :)

Specifically, catching information passed to U-Boot's entry point is
something that e.g. OMAPs do already. It is probably not going to be
portable, though, because the passing method is inherently specific to
your platform and pre-U-Boot loader.

>* If yes, then I'd like to propose such functionality as a possible 
>improvement.
*>* I think that may be more people interested in such a feature.
*>>* I'll appreciate any sugestions/pointers regarding the possible
implementation.
*> >* Probably I can try to implement it. Of course if there are other
*>* interested users
*>* who can do it, I'll be definitely happy to discuss that with them.
*
Best is that you post a patch with a working implementation which can
be build above current u-boot/master branch; people interested in it
will comment.

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


[U-Boot] [PATCH]: net: Wrong Initialization in davinci-emac driver

2016-01-25 Thread Vishwas Srivastava
Author: Vishwas Srivastava 
Date:   Mon Jan 25 21:28:17 2016 +0530

Wrong Initialization in davinci emac driver

emac module of the davinci platform supports only 8 tx and
8 rx channels (total 16). emac driver for davinci platform,
however, while doing initialization of the dma descriptor
head pointers,wrongly initializes the 16 head pointers
(instead of  8) for tx dma and 16 head pointers for rx dma,
which is wrong.The result is, that this register initilization
spills over the other registers which was not intended and is
undesirable.This patch fixes this problem.

Signed-off-by: Vishwas Srivastava 
CC: Sergey Kubushyn ;Joe Hershberger <
joe.hershber...@ni.com>
Signed-off-by: Vishwas Srivastava 

diff --git a/drivers/net/davinci_emac.c b/drivers/net/davinci_emac.c
index 92c3dca..3f54a3f 100644
--- a/drivers/net/davinci_emac.c
+++ b/drivers/net/davinci_emac.c
@@ -459,11 +459,11 @@ static int davinci_eth_open(struct eth_device *dev,
bd_t *bis)

/* Set DMA 8 TX / 8 RX Head pointers to 0 */
addr = &adap_emac->TX0HDP;
-   for(cnt = 0; cnt < 16; cnt++)
+   for(cnt = 0; cnt < 8; cnt++)
writel(0, addr++);

addr = &adap_emac->RX0HDP;
-   for(cnt = 0; cnt < 16; cnt++)
+   for(cnt = 0; cnt < 8; cnt++)
writel(0, addr++);

/* Clear Statistics (do this before setting MacControl register) */
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] pci: restore initialization for DM_PCI

2016-01-25 Thread Stephen Warren

On 01/22/2016 03:00 PM, Simon Glass wrote:

Hi Stephen,

On 22 January 2016 at 14:58, Stephen Warren  wrote:

On 01/22/2016 02:50 PM, Simon Glass wrote:


Hi Stephen,

On 22 January 2016 at 14:48, Stephen Warren  wrote:


On 01/22/2016 01:32 PM, Simon Glass wrote:



Hi Stephen,

On 22 January 2016 at 12:38, Stephen Warren 
wrote:




On 01/21/2016 09:03 PM, Simon Glass wrote:




Hi Bin,

On 21 January 2016 at 20:53, Bin Meng  wrote:




On Fri, Jan 22, 2016 at 11:36 AM, Simon Glass 
wrote:




Hi,

On 21 January 2016 at 18:39, Bin Meng  wrote:




Hi Stephen,

On Fri, Jan 22, 2016 at 7:35 AM, Stephen Warren
 wrote:




From: Stephen Warren 

PCI controllers should be enumerated at startup so that PCI
devices
such as Ethernet controllers are available at startup. Fix
board_init_r()
not to skip calling pci_init() when CONFIG_DM_PCI is defined, and
provide
an implementation of pci_init() for the DM case.



What exact issue are you trying to fix? I posted the same question
on
Simon's patch [1] before. Does your patch and Simon's fix the same
issue?

Note I submitted a similar patch [2] last year for x86 only, to
explicitly trigger the PCI enueration. But it was not accepted.


Fixes: 96350f729c42 ("dm: tegra: net: Convert tegra boards to
driver
model
for Ethernet")
Signed-off-by: Stephen Warren 
---
I'm not sure if relying on the side-effects of calling
uclass_{first,ext}_device is the correct approach; is there a more
explicit
way to probe all PCI controllers?

Arguably, perhaps we should introduce a "pci start" command
instead
of
this change to be consistent with e.g. USB. However, that would be
a
regression relative to earlier versions of U-Boot.
---





[1] http://patchwork.ozlabs.org/patch/569323/
[2] http://patchwork.ozlabs.org/patch/500246/

Regards,
Bin





This does go against the driver-model philosophy of lazy init. I
wonder if we should add this patch with a Kconfig option to enable
it?
Then it can be enabled only for boards that need it.



I suspect the issue is somewhere else. On Intel Galileo with a PCI
ethernet, it works fine without such explicit pci init. Which PCI
ethernet driver does not work on Tegra?





It could be because that board probes PCI to get its serial to work.

This could be fixed on Tegra by adding an Ethernet node to the device
tree to cause it to be probed. But I don't think that should be a
requirement.





Since PCI devices are automatically probed via standard bus protocols,
I
believe we shouldn't have to add them to the DT.

However, I could accept that we should add the PCI controller to DT in
order for the controller to be probed, and when that happens, the bus
should
be enumerated thus causing all the Ethernet devices to be probed.
However,
the PCI controller is already in DT, and this process isn't being
kicked
off, so if that's the way it's supposed to work, there's a bug there.




So what do you think about a Kconfig option that tells U-Boot that PCI
must be probed after relocation?




I'm puzzled why anyone would turn off that option.

If PCI is to be used at all, it needs to be probed. The only way I'm
aware
of that it can be probed today is by accidental side-effect of some board
forcibly probing some device that happens to be on a PCI bus (i.e. Bin's
case). In other case, PCI doesn't get automatically probed at boot, and I
don't see any command that allows it to be probed manually. Don't we need
this patch (or your patch linked above) in order to make PCI usable at
all?
If so, why would anyone turn this off?



We try to probe devices only when used. E.g. on beaver, if you are not
net-booting, you actually don't need PCI.



Are you saying that the first network command I execute in U-Boot should
probe Ethernet device and hence PCI devices right now in the current U-Boot
code?

That doesn't work right now. If it did work, that would probably be OK.


Two options:
- Add a 'pci start' command to your script
- Enable the PCI auto-probe Kconfig option

Boards can then choose which they prefer.


I see there's already a "pci enum" command that can be enabled:

#ifdef CONFIG_SYS_LONGHELP
static char pci_help_text[] =
"[bus] [long]\n"
"- short or long list of PCI devices on bus 'bus'\n"
#ifdef CONFIG_CMD_PCI_ENUM
"pci enum\n"
"- re-enumerate PCI buses\n"
#endif

I'm tempted to re-enable that for DM, by making the implementation of 
pci_init() exist even with CONFIG_DM_PCI, then enhance 
config_distro_bootcmd.h to have it run "pci enum" any time before it 
might touch a PCI device, similar to the existing USB and SCSI 
enumeration support.


The only wart is that the command help text currently says 
"*re-*enumerate PCI buses" rather than just "enumerate PCI buses", which 
implies the semantics would always cause an enumeration even on the 
second/... execution, whereas it'd be simpler to have it work like "usb 
start", i.e. perform enumeration the first time but be a no-op any 
second/... time. Am I reading too much 

[U-Boot] [PATCHv2 1/8] arm: vybrid: Enable lpuart support

2016-01-25 Thread Bhuvanchandra DV
- Add device tree node's for lpuart on Vybrid platform
- Update the license string.

Signed-off-by: Bhuvanchandra DV 
---
 arch/arm/dts/vf.dtsi   | 47 +-
 arch/arm/dts/vf500-colibri.dts |  5 -
 arch/arm/dts/vf610-colibri.dts |  5 -
 3 files changed, 42 insertions(+), 15 deletions(-)

diff --git a/arch/arm/dts/vf.dtsi b/arch/arm/dts/vf.dtsi
index 78706e1..8b87b57 100644
--- a/arch/arm/dts/vf.dtsi
+++ b/arch/arm/dts/vf.dtsi
@@ -2,11 +2,6 @@
  * Copyright 2013 Freescale Semiconductor, Inc.
  *
  * SPDX-License-Identifier: GPL-2.0+ or X11
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
  */
 /include/ "skeleton.dtsi"
 
@@ -17,6 +12,12 @@
gpio2 = &gpio2;
gpio3 = &gpio3;
gpio4 = &gpio4;
+   serial0 = &uart0;
+   serial1 = &uart1;
+   serial2 = &uart2;
+   serial3 = &uart3;
+   serial4 = &uart4;
+   serial5 = &uart5;
spi0 = &dspi0;
spi1 = &dspi1;
};
@@ -33,6 +34,30 @@
#size-cells = <1>;
ranges;
 
+   uart0: serial@40027000 {
+   compatible = "fsl,vf610-lpuart";
+   reg = <0x40027000 0x1000>;
+   status = "disabled";
+   };
+
+   uart1: serial@40028000 {
+   compatible = "fsl,vf610-lpuart";
+   reg = <0x40028000 0x1000>;
+   status = "disabled";
+   };
+
+   uart2: serial@40029000 {
+   compatible = "fsl,vf610-lpuart";
+   reg = <0x40029000 0x1000>;
+   status = "disabled";
+   };
+
+   uart3: serial@4002a000 {
+   compatible = "fsl,vf610-lpuart";
+   reg = <0x4002a000 0x1000>;
+   status = "disabled";
+   };
+
dspi0: dspi0@4002c000 {
#address-cells = <1>;
#size-cells = <0>;
@@ -95,6 +120,18 @@
#address-cells = <1>;
#size-cells = <1>;
ranges;
+
+   uart4: serial@400a9000 {
+   compatible = "fsl,vf610-lpuart";
+   reg = <0x400a9000 0x1000>;
+   status = "disabled";
+   };
+
+   uart5: serial@400aa000 {
+   compatible = "fsl,vf610-lpuart";
+   reg = <0x400aa000 0x1000>;
+   status = "disabled";
+   };
};
};
 };
diff --git a/arch/arm/dts/vf500-colibri.dts b/arch/arm/dts/vf500-colibri.dts
index e383306..02d0ce8 100644
--- a/arch/arm/dts/vf500-colibri.dts
+++ b/arch/arm/dts/vf500-colibri.dts
@@ -2,11 +2,6 @@
  * Copyright 2014 Toradex AG
  *
  * SPDX-License-Identifier: GPL-2.0+ or X11
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
  */
 
 /dts-v1/;
diff --git a/arch/arm/dts/vf610-colibri.dts b/arch/arm/dts/vf610-colibri.dts
index 63bb3f4..24dfcbe 100644
--- a/arch/arm/dts/vf610-colibri.dts
+++ b/arch/arm/dts/vf610-colibri.dts
@@ -2,11 +2,6 @@
  * Copyright 2014 Toradex AG
  *
  * SPDX-License-Identifier: GPL-2.0+ or X11
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
  */
 
 /dts-v1/;
-- 
2.7.0

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


[U-Boot] [PATCHv2 0/8] Migrate NXP/Freescale Vybrid based boards to support pure DT

2016-01-25 Thread Bhuvanchandra DV
Changes since V1:
- Update the license string in device tree's.
- Update all lpuart's uart nodes in device tree.
- Dropped *_dtb_defconfig and updated the default defconfig's with DT support.
- Reordered defconfig's using defconfig via savedefconfig.
- Use one patch to update all Vybrid based board defconfig's.
- Dropped vybrid_gpio driver legacy code. Thanks! Stefan for pointing this.
- Dropped the legacy way of enabling GPIO, UART and SPI on NXP/Freescale Vybrid
  based board's.

- Compile checked for vf610twr and pcm052  since I don't have access
  to such hardware at my end. Reviewer's and tester's welcome!

Bhuvanchandra DV (8):
  arm: vybrid: Enable lpuart support
  arm: colibri-vf: Enable serial support
  dm: lpuart: Drop the legacy code
  dm: vybrid_gpio: Drop legacy code
  arm: vybrid: Drop enabling gpio, uart and spi in legacy mode
  arm: vf610-twr: Add device tree files
  arm: pcm052: Add device tree files
  arm: vybrid: Update defconfig's

 arch/arm/dts/Makefile|   4 +-
 arch/arm/dts/pcm052.dts  |  22 +
 arch/arm/dts/vf-colibri.dtsi |   9 
 arch/arm/dts/vf.dtsi |  47 --
 arch/arm/dts/vf500-colibri.dts   |   5 --
 arch/arm/dts/vf610-colibri.dts   |   5 --
 arch/arm/dts/vf610-twr.dts   |  22 +
 configs/colibri_vf_defconfig |   8 
 configs/colibri_vf_dtb_defconfig |  14 --
 configs/pcm052_defconfig |   7 +++
 configs/vf610twr_defconfig   |   7 +++
 configs/vf610twr_nand_defconfig  |   7 +++
 drivers/gpio/vybrid_gpio.c   |  18 ---
 drivers/serial/serial_lpuart.c   | 101 +--
 include/configs/colibri_vf.h |  13 -
 include/configs/pcm052.h |   3 --
 include/configs/vf610twr.h   |   3 --
 17 files changed, 129 insertions(+), 166 deletions(-)
 create mode 100644 arch/arm/dts/pcm052.dts
 create mode 100644 arch/arm/dts/vf610-twr.dts
 delete mode 100644 configs/colibri_vf_dtb_defconfig

-- 
2.7.0

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


Re: [U-Boot] [Patch V3 2/3] fm: fdt: Move fman ucode fixup to Fman driver code

2016-01-25 Thread Scott Wood
On Mon, 2016-01-25 at 19:37 +0800, Gong Qianyu wrote:
> Both Freescale Layerscape and powerpc/mpc85xx platforms are using
> fdt_fixup_fman_firmware() to insert Fman ucode blob into the device
> tree. So move the function to driver code.
> 
> Signed-off-by: Gong Qianyu 
> ---
> V3:
>  - Remove file changes about "qe.h".
>(Should be put in the first patch of this patchset)
> V2:
>  - New patch.
> 
>  arch/powerpc/cpu/mpc85xx/fdt.c | 125 ++
> -
>  drivers/net/fm/Makefile|   1 +
>  drivers/net/fm/fdt.c   | 129
> +
>  include/fsl_fman.h |   1 +
>  4 files changed, 136 insertions(+), 120 deletions(-)

Again, pass -M -C to git format-patch.

-Scott

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


Re: [U-Boot] [PATCH 1/7] driver: net: fsl-mc: Add version check for MC objects

2016-01-25 Thread york sun
On 12/24/2015 02:02 AM, Prabhakar Kushwaha wrote:
> Check and compare version of management  complex's object with the version
> supported by Freescale ldpaa2 ethernet driver.
> 
> Signed-off-by: Prabhakar Kushwaha 
> ---
>  drivers/net/fsl-mc/mc.c   | 51 
> ++-
>  drivers/net/ldpaa_eth/ldpaa_eth.c | 28 +
>  2 files changed, 78 insertions(+), 1 deletion(-)
> 

The driver is not backward compatible, is it? Looks like every time the firmware
upgrades, the driver changes.

York


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


Re: [U-Boot] [PATCH 5/7] driver: net: ldpaa: Increase num of buffers for a pool

2016-01-25 Thread york sun
On 12/24/2015 02:03 AM, Prabhakar Kushwaha wrote:
> Management Complex FW 9.0 set the hardware depletion to be 20 buffers
> in order to support multiple pools in DPNI. This requires driver to fill
> the pool with at least 21 to be able to receive frames.
> 
> So, Increase number of buffers for a pool.
> 
> Signed-off-by: Prabhakar Kushwaha 
> ---
>  drivers/net/ldpaa_eth/ldpaa_eth.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ldpaa_eth/ldpaa_eth.h 
> b/drivers/net/ldpaa_eth/ldpaa_eth.h
> index af41b27..3b16150 100644
> --- a/drivers/net/ldpaa_eth/ldpaa_eth.h
> +++ b/drivers/net/ldpaa_eth/ldpaa_eth.h
> @@ -24,7 +24,7 @@ enum ldpaa_eth_type {
>  };
>  
>  /* Arbitrary values for now, but we'll need to tune */
> -#define LDPAA_ETH_NUM_BUFS   (2 * 7)
> +#define LDPAA_ETH_NUM_BUFS   (7 * 7)

You said at least 21, but actually use 49. Is there a connection?

York

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


Re: [U-Boot] [PATCHv2 2/8] arm: colibri-vf: Enable serial support

2016-01-25 Thread Stefan Agner
On 2016-01-25 09:03, Bhuvanchandra DV wrote:
> - Enable lpuart support on Toradex Colibri VF50/VF61
> - Use UART0 for stdout.

Compared to the previous commit, I would say here it is fine, since
those two changes are really connected.

Acked-by: Stefan Agner 

--
Stefan

> 
> Signed-off-by: Bhuvanchandra DV 
> ---
>  arch/arm/dts/vf-colibri.dtsi | 9 +
>  1 file changed, 9 insertions(+)
> 
> diff --git a/arch/arm/dts/vf-colibri.dtsi b/arch/arm/dts/vf-colibri.dtsi
> index 7a8e9bee..13a1dba 100644
> --- a/arch/arm/dts/vf-colibri.dtsi
> +++ b/arch/arm/dts/vf-colibri.dtsi
> @@ -10,6 +10,12 @@
>   */
>  #include "vf.dtsi"
>  
> +/ {
> + chosen {
> + stdout-path = &uart0;
> + };
> +};
> +
>  &dspi1 {
>   status = "okay";
>   bus-num = <1>;
> @@ -19,3 +25,6 @@
>   spi-max-frequency = <5000>;
>   };
>  };
> +&uart0 {
> + status = "okay";
> +};
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCHv2 3/8] dm: lpuart: Drop the legacy code

2016-01-25 Thread Stefan Agner
On 2016-01-25 09:03, Bhuvanchandra DV wrote:
> All boards using this driver are with device tree support,
> hence drop the legacy code in driver to have a pure DT solution.

Hm, dropping the legacy code at this point probably leads to a broken
state (bisectability...)

I would recommend to first move the boards to device tree and then drop
legacy stuff... Probably along these lines:

  arm: vybrid: Enable lpuart support
  arm: colibri-vf: Enable serial support
  arm: vybrid: Drop enabling gpio, uart and spi in legacy mode
  arm: vf610-twr: Add device tree files
  arm: pcm052: Add device tree files
  arm: vybrid: Update defconfig's
  dm: lpuart: Drop the legacy code
  dm: vybrid_gpio: Drop legacy code

--
Stefan

> 
> Signed-off-by: Bhuvanchandra DV 
> Reviewed-by: Bin Meng 
> ---
>  drivers/serial/serial_lpuart.c | 101 
> +
>  1 file changed, 2 insertions(+), 99 deletions(-)
> 
> diff --git a/drivers/serial/serial_lpuart.c b/drivers/serial/serial_lpuart.c
> index 3f9c4d1..fc3321f 100644
> --- a/drivers/serial/serial_lpuart.c
> +++ b/drivers/serial/serial_lpuart.c
> @@ -48,8 +48,6 @@
>  
>  DECLARE_GLOBAL_DATA_PTR;
>  
> -struct lpuart_fsl *base = (struct lpuart_fsl *)LPUART_BASE;
> -
>  struct lpuart_serial_platdata {
>   struct lpuart_fsl *reg;
>  };
> @@ -127,43 +125,6 @@ static int _lpuart_serial_init(struct lpuart_fsl *base)
>   return 0;
>  }
>  
> -#ifndef CONFIG_DM_SERIAL
> -static void lpuart_serial_setbrg(void)
> -{
> - _lpuart_serial_setbrg(base, gd->baudrate);
> -}
> -
> -static int lpuart_serial_getc(void)
> -{
> - return _lpuart_serial_getc(base);
> -}
> -
> -static void lpuart_serial_putc(const char c)
> -{
> - _lpuart_serial_putc(base, c);
> -}
> -
> -static int lpuart_serial_tstc(void)
> -{
> - return _lpuart_serial_tstc(base);
> -}
> -
> -static int lpuart_serial_init(void)
> -{
> - return _lpuart_serial_init(base);
> -}
> -
> -static struct serial_device lpuart_serial_drv = {
> - .name = "lpuart_serial",
> - .start = lpuart_serial_init,
> - .stop = NULL,
> - .setbrg = lpuart_serial_setbrg,
> - .putc = lpuart_serial_putc,
> - .puts = default_serial_puts,
> - .getc = lpuart_serial_getc,
> - .tstc = lpuart_serial_tstc,
> -};
> -#else /* CONFIG_DM_SERIAL */
>  static int lpuart_serial_setbrg(struct udevice *dev, int baudrate)
>  {
>   struct lpuart_serial_platdata *plat = dev->platdata;
> @@ -210,8 +171,8 @@ static int lpuart_serial_probe(struct udevice *dev)
>  
>   return _lpuart_serial_init(reg);
>  }
> -#endif /* CONFIG_DM_SERIAL */
>  #else
> +
>  static void _lpuart32_serial_setbrg(struct lpuart_fsl *base, int baudrate)
>  {
>   u32 clk = CONFIG_SYS_CLK_FREQ;
> @@ -281,43 +242,6 @@ static int _lpuart32_serial_init(struct lpuart_fsl *base)
>   return 0;
>  }
>  
> -#ifndef CONFIG_DM_SERIAL
> -static void lpuart32_serial_setbrg(void)
> -{
> - _lpuart32_serial_setbrg(base, gd->baudrate);
> -}
> -
> -static int lpuart32_serial_getc(void)
> -{
> - return _lpuart32_serial_getc(base);
> -}
> -
> -static void lpuart32_serial_putc(const char c)
> -{
> - _lpuart32_serial_putc(base, c);
> -}
> -
> -static int lpuart32_serial_tstc(void)
> -{
> - return _lpuart32_serial_tstc(base);
> -}
> -
> -static int lpuart32_serial_init(void)
> -{
> - return _lpuart32_serial_init(base);
> -}
> -
> -static struct serial_device lpuart32_serial_drv = {
> - .name = "lpuart32_serial",
> - .start = lpuart32_serial_init,
> - .stop = NULL,
> - .setbrg = lpuart32_serial_setbrg,
> - .putc = lpuart32_serial_putc,
> - .puts = default_serial_puts,
> - .getc = lpuart32_serial_getc,
> - .tstc = lpuart32_serial_tstc,
> -};
> -#else /* CONFIG_DM_SERIAL */
>  static int lpuart32_serial_setbrg(struct udevice *dev, int baudrate)
>  {
>   struct lpuart_serial_platdata *plat = dev->platdata;
> @@ -364,28 +288,8 @@ static int lpuart32_serial_probe(struct udevice *dev)
>  
>   return _lpuart32_serial_init(reg);
>  }
> -#endif /* CONFIG_DM_SERIAL */
> -#endif
> -
> -#ifndef CONFIG_DM_SERIAL
> -void lpuart_serial_initialize(void)
> -{
> -#ifdef CONFIG_LPUART_32B_REG
> - serial_register(&lpuart32_serial_drv);
> -#else
> - serial_register(&lpuart_serial_drv);
> -#endif
> -}
> +#endif /* CONFIG_LPUART_32B_REG */
>  
> -__weak struct serial_device *default_serial_console(void)
> -{
> -#ifdef CONFIG_LPUART_32B_REG
> - return &lpuart32_serial_drv;
> -#else
> - return &lpuart_serial_drv;
> -#endif
> -}
> -#else /* CONFIG_DM_SERIAL */
>  static int lpuart_serial_ofdata_to_platdata(struct udevice *dev)
>  {
>   struct lpuart_serial_platdata *plat = dev->platdata;
> @@ -447,4 +351,3 @@ U_BOOT_DRIVER(serial_lpuart32) = {
>   .flags = DM_FLAG_PRE_RELOC,
>  };
>  #endif /* CONFIG_LPUART_32B_REG */
> -#endif /* CONFIG_DM_SERIAL */
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinf

Re: [U-Boot] [PATCH v4 5/6] rockchip: kylin: Enable boot with android boot image

2016-01-25 Thread Tom Rini
On Fri, Jan 15, 2016 at 10:20:43AM +0800, Jeffy Chen wrote:
> Hi Tom,
> 
> On 2016-1-15 8:59, Tom Rini wrote:
> >On Fri, Jan 15, 2016 at 08:53:06AM +0800, Jeffy Chen wrote:
> >>Hi Tom,
> >>
> >>On 2016-1-15 0:22, Tom Rini wrote:
> >>>On Thu, Jan 14, 2016 at 10:31:34AM +0800, Jeffy Chen wrote:
> Hi Tom,
> 
> On 2016-1-13 23:28, Tom Rini wrote:
> >On Wed, Jan 13, 2016 at 04:53:19PM +0800, Jeffy Chen wrote:
> >
> >>The android kernel is using appended dtb by default, and store
> >>ramdisk right after kernel & dtb.
> >>So we needs to relocate ramdisk, and use atags to pass params.
> >>
> >>Signed-off-by: Jeffy Chen 
> >>Acked-by: Simon Glass 
> >>---
> >>
> >>Changes in v4: None
> >>Changes in v3: None
> >>Changes in v2: None
> >>
> >>  include/configs/kylin_rk3036.h | 23 +++
> >>  1 file changed, 23 insertions(+)
> >>
> >>diff --git a/include/configs/kylin_rk3036.h 
> >>b/include/configs/kylin_rk3036.h
> >>index b750b26..49997ec 100644
> >>--- a/include/configs/kylin_rk3036.h
> >>+++ b/include/configs/kylin_rk3036.h
> >>@@ -35,6 +35,29 @@
> >>  #undef CONFIG_EXTRA_ENV_SETTINGS
> >>  #define CONFIG_EXTRA_ENV_SETTINGS \
> >>"partitions=" PARTS_DEFAULT \
> >>+   "mmcdev=0\0" \
> >>+   "mmcpart=5\0" \
> >>+   "loadaddr=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \
> >>+
> >>+#define CONFIG_ANDROID_BOOT_IMAGE
> >>+#define CONFIG_SYS_BOOT_RAMDISK_HIGH
> >This should already be set.
> Right, i'll remove it...
> >>+#define CONFIG_SYS_HUSH_PARSER
> >>+
> >>+#undef CONFIG_BOOTCOMMAND
> >>+#define CONFIG_BOOTCOMMAND \
> >>+   "mmc dev ${mmcdev}; if mmc rescan; then " \
> >>+   "part start mmc ${mmcdev} ${mmcpart} boot_start;" \
> >>+   "part size mmc ${mmcdev} ${mmcpart} boot_size;" \
> >>+   "mmc read ${loadaddr} ${boot_start} ${boot_size};" \
> >>+   "bootm start ${loadaddr}; bootm ramdisk;" \
> >>+   "bootm prep; bootm go;" \
> >>+   "fi;" \
> >>+
> >>+/* Enable atags */
> >>+#define CONFIG_SYS_BOOTPARAMS_LEN  (64*1024)
> >>+#define CONFIG_INITRD_TAG
> >>+#define CONFIG_SETUP_MEMORY_TAGS
> >>+#define CONFIG_CMDLINE_TAG
> >But I'm confused as to what exactly is going on here.  Appended dtb is
> >not the same as ATAGS.  And you shouldn't need to split up bootm like
> >that.  Can you please explain a bit more?  Thanks!
> The u-boot will pass atags to kernel, and kernel will merge those
> atags into the appended dtb(fdt).
> 
> The default bootm flow would not pass ramdisk state, but we need it,
> so we should add this state into default flow, or just use split
> bootm cmds :)
> >>>That seems very strange.  Is the ramdisk concatenated with the kernel
> >>>and dtb as well (and that's why bootm ramdisk somehow finds it but
> >>>normal bootm doesn't as you aren't passing in a ramdisk address) ?
> >>Yes, the ramdisk concatenated with the kernel and dtb as
> >>well(u-boot/include/android_image.h: struct andr_img_hdr).
> >>
> >>And the normal bootm cmd would find it by parsing andr_img_hdr struct.
> >>But we still need bootm ramdisk state, because it will call
> >>boot_ramdisk_high to relocate ramdisk area :)
> >>
> >>I found if not relocate it to somewhere else, it would be corrupted
> >>after kernel's decompressing(during update fdt area).
> >So 'bootm $loadaddr' of an Android image sees, but does not relocate the
> >ramdisk that is included in the image, but bootm ramdisk does?  That
> >sounds like a bug in the regular bootm handling.
> Yep, the default bootm flow would not contain ramdisk relocate state:
> 
> vi common/cmd_bootm.c
> return do_bootm_states(cmdtp, flag, argc, argv, BOOTM_STATE_START |
> BOOTM_STATE_FINDOS | BOOTM_STATE_FINDOTHER |
> BOOTM_STATE_LOADOS |
> #if defined(CONFIG_PPC) || defined(CONFIG_MIPS)
> BOOTM_STATE_OS_CMDLINE |
> #endif
> BOOTM_STATE_OS_PREP | BOOTM_STATE_OS_FAKE_GO |
> BOOTM_STATE_OS_GO, &images, 1);
> 
> But i'm not sure if it's ok to add it here...

So, I've poked aruond a bit more on some of my TI platforms at least.
Can you look at the following things on yours?
1) Do you still see the problem on top of tree? Masahiro fixed at least
one problem just before v2016.01
2) Instead of fdt_high / initrd_high can you look at bootm_low /
bootm_size ?  include/configs/ti_armv7_common.h has these along with a
big comment about what the overall constraints are.

Thanks!

-- 
Tom


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


[U-Boot] [PATCH] .travis.yml: rework according to new travis-ci infra

2016-01-25 Thread Roger Meier
- install using addons.apt
- remove MAKEALL
- split mpc85xx boards
- remove TEST_CONFIG_CMD, just info
- fetch mips toolchain via buildman
- remove --list-error-boards param
- conditional script
- use TOOLCHAIN instead of INSTALL_TOOLCHAIN
- add aarch64
- enable notifications via email

Signed-off-by: Roger Meier 
Cc: Wolfgang Denk 
Cc: Heiko Schocher 
Cc: Tom Rini 
Cc: Daniel Schwierzeck 
Cc: Andreas Färber 
---
 .travis.yml | 217 
 1 file changed, 88 insertions(+), 129 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index 4e20e09..67674e2 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -5,23 +5,29 @@
 
 language: c
 
+addons:
+  apt:
+packages:
+- cppcheck
+- sloccount
+- sparse
+- bc
+- build-essential
+- libsdl1.2-dev
+
 cache:
  - apt
 
 install:
- # install U-Boot build dependencies
- - sudo apt-get install -qq cppcheck sloccount sparse bc libsdl-dev 
build-essential
  # install latest device tree compiler
  - git clone --depth=1 https://git.kernel.org/pub/scm/utils/dtc/dtc.git 
/tmp/dtc
  - make -j4 -C /tmp/dtc
  # prepare buildman environment
  - export BUILDMAN_ROOT="root:"
- - export BUILDMAN_MIPS="mips:"
  - export BUILDMAN_PPC="ppc:"
  - export BUILDMAN_ARM="arm:"
  - export BUILDMAN_SANDBOX="sandbox:"
  - echo -e "[toolchain]\n${BUILDMAN_ROOT} /\n" > ~/.buildman
- - echo -e "${BUILDMAN_MIPS} 
/opt/eldk-5.4/mips/sysroots/i686-eldk-linux/usr/bin/mips32-linux/\n" >> 
~/.buildman
  - echo -e "${BUILDMAN_PPC} 
/opt/eldk-5.4/powerpc/sysroots/i686-eldk-linux/usr/bin/powerpc-linux/\n" >> 
~/.buildman
  - echo -e "${BUILDMAN_ARM} 
/opt/eldk-5.4/armv5te/sysroots/i686-eldk-linux/usr/bin/armv5te-linux-gnueabi/\n"
 >> ~/.buildman
  - echo -e "${BUILDMAN_SANDBOX} /usr/bin/gcc\n" >> ~/.buildman
@@ -35,165 +41,121 @@ env:
   global:
 - PATH=/tmp/dtc:$PATH
 - BUILD_DIR=build
-- CROSS_COMPILE=""
 - HOSTCC="cc"
 - HOSTCXX="c++"
-- TEST_CONFIG_CMD=""
 
 before_script:
-  # install toolchains based on INSTALL_TOOLCHAIN} variable
-  - if [[ "${INSTALL_TOOLCHAIN}" == *arm* ]]; then wget 
ftp://ftp.denx.de/pub/eldk/5.4/targets/armv5te/eldk-eglibc-i686-arm-toolchain-gmae-5.4.sh
 ; fi
-  - if [[ "${INSTALL_TOOLCHAIN}" == *arm* ]]; then sh 
eldk-eglibc-i686-arm-toolchain-gmae-5.4.sh -y ; fi
-  - if [[ "${INSTALL_TOOLCHAIN}" == *arm* ]]; then ls -al 
/opt/eldk-5.4/armv5te/sysroots/i686-eldk-linux/usr/bin/armv5te-linux-gnueabi ; 
fi
-  - if [[ "${INSTALL_TOOLCHAIN}" == *avr32* ]]; then ./tools/buildman/buildman 
--fetch-arch avr32 ; fi
-  - if [[ "${INSTALL_TOOLCHAIN}" == *i386* ]]; then ./tools/buildman/buildman 
sandbox --fetch-arch i386 ; fi
-  - if [[ "${INSTALL_TOOLCHAIN}" == *m68k* ]]; then ./tools/buildman/buildman 
--fetch-arch m68k ; fi
-  - if [[ "${INSTALL_TOOLCHAIN}" == *mips* ]]; then wget 
ftp://ftp.denx.de/pub/eldk/5.4/targets/mips/eldk-eglibc-i686-mips-toolchain-gmae-5.4.sh
 ; fi
-  - if [[ "${INSTALL_TOOLCHAIN}" == *mips* ]]; then sh 
eldk-eglibc-i686-mips-toolchain-gmae-5.4.sh -y ; fi
-  - if [[ "${INSTALL_TOOLCHAIN}" == *ppc* ]]; then wget 
ftp://ftp.denx.de/pub/eldk/5.4/targets/powerpc/eldk-eglibc-i686-powerpc-toolchain-gmae-5.4.sh
 ; fi
-  - if [[ "${INSTALL_TOOLCHAIN}" == *ppc* ]]; then sh 
eldk-eglibc-i686-powerpc-toolchain-gmae-5.4.sh -y ; fi
+  # install toolchains based on TOOLCHAIN} variable
+  - if [[ "${TOOLCHAIN}" == *aarch64* ]]; then ./tools/buildman/buildman 
--fetch-arch aarch64 ; fi
+  - if [[ "${TOOLCHAIN}" == *arm* ]]; then wget 
ftp://ftp.denx.de/pub/eldk/5.4/targets/armv5te/eldk-eglibc-i686-arm-toolchain-gmae-5.4.sh
 ; fi
+  - if [[ "${TOOLCHAIN}" == *arm* ]]; then sh 
eldk-eglibc-i686-arm-toolchain-gmae-5.4.sh -y ; fi
+  - if [[ "${TOOLCHAIN}" == *avr32* ]]; then ./tools/buildman/buildman 
--fetch-arch avr32 ; fi
+  - if [[ "${TOOLCHAIN}" == *i386* ]]; then ./tools/buildman/buildman sandbox 
--fetch-arch i386 ; fi
+  - if [[ "${TOOLCHAIN}" == *m68k* ]]; then ./tools/buildman/buildman 
--fetch-arch m68k ; fi
+  - if [[ "${TOOLCHAIN}" == *mips* ]]; then ./tools/buildman/buildman 
--fetch-arch mips ; fi
+  - if [[ "${TOOLCHAIN}" == *ppc* ]]; then wget 
ftp://ftp.denx.de/pub/eldk/5.4/targets/powerpc/eldk-eglibc-i686-powerpc-toolchain-gmae-5.4.sh
 ; fi
+  - if [[ "${TOOLCHAIN}" == *ppc* ]]; then sh 
eldk-eglibc-i686-powerpc-toolchain-gmae-5.4.sh -y ; fi
 
 script:
  # the execution sequence for each test
- - echo ${TEST_CONFIG_CMD}
- - ${TEST_CONFIG_CMD}
- - echo ${TEST_CMD}
- - ${TEST_CMD}
+ - if [[ "${TEST_CMD}" != "" ]]; then
+ ${TEST_CMD};
+   fi
+ - if [[ "${BUILDMAN}" != "" ]]; then
+ tools/buildman/buildman ${BUILDMAN};
+   fi
 
 matrix:
   include:
   # we need to build by vendor due to 50min time limit for builds
   # each env setting here is a dedicated build
 - env:
-- TEST_CMD="./MAKEALL -a arm -v atmel"
-  INSTALL_TOOLCHAIN="arm"
-  
CROSS_COMPILE="/opt/eldk-5.4/armv5te/sysroots/i686-eldk-linux/usr/bin/armv5te-linux-gnueabi/ar

Re: [U-Boot] [PATCH][v2] powerpc: mpc85xx: Move set_liodns, setup_portals to common boot seq

2016-01-25 Thread york sun
On 01/22/2016 01:05 AM, Prabhakar Kushwaha wrote:
> Users migrating Freescale's PowerPC SoC U-Boot code to their custom
> board, often overlook the need to execute set_liodns() and
> setup_portals() being called by platform files.
> 
> So Move set_liodns() and setup_portals() to common u-boot boot
> sequence
> 
> Signed-off-by: Prabhakar Kushwaha 
> ---
> Changes for v2
>  - put function call CONFIG_FSL_CORENET 

Applied to u-boot-mpc85xx master branch. Awaiting upstream.

Thanks.

York


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


[U-Boot] [PATCH 0/7] fdt: Replace u-boot-dtb.bin with u-boot.bin

2016-01-25 Thread Simon Glass
At present u-boot.bin holds the plain U-Boot binary without the device tree.
This is somewhat annoying since you need either u-boot.bin or u-boot-dtb.bin
depending on whether device tree is used.

This series adjusts the build such that u-boot.bin includes a device tree,
and the plain binary is in u-boot-nodtb.bin. For now u-boot-dtb.bin remains
the same.

This should be acceptable since:

- without OF_CONTROL, u-boot.bin still does not include a device tree
- with OF_CONTROL, u-boot-dtb.bin does not change

The main impact is build systems which are set up to use u-boot.bin as
the output file and then add a device tree. These will have to change to use
u-boot-nodtb.bin instead.

The original decision to use a separate u-boot-dtb.bin was aimed at allowing
any device tree file to be concatenated to the u-boot.bin image after the
build. However this no-longer seems so important. More important is the
convenience of using the same output file regardless of the setting for
OF_CONTROL.


Simon Glass (7):
  tegra: Drop generation of -nodtb file with OF_CONTROL
  fdt: Build a U-Boot binary without device tree
  fdt: Build an SPL binary without device tree
  tegra: Always build a boot image with the same filename
  socfpga: Simplify Makefile filenames
  Makefile: Make u-boot.img the same as u-boot-dtb.img
  Makefile: Drop unnecessary -dtb suffixes

 Makefile | 67 ++--
 scripts/Makefile.spl | 26 +---
 2 files changed, 50 insertions(+), 43 deletions(-)

-- 
2.7.0.rc3.207.g0ac5344

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


[U-Boot] [PATCH 3/7] fdt: Build an SPL binary without device tree

2016-01-25 Thread Simon Glass
At present u-boot-spl.bin holds the plain SPL binary without the device
tree. This is somewhat annoying since you need either u-boot-spl.bin or
u-boot-spl-dtb.bin depending on whether device tree is used.

Adjust the build such that u-boot-spl.bin includes a device tree, and the
plain binary is in u-boot-spl-nodtb.bin. For now u-boot-spl-dtb.bin remains
the same.

Signed-off-by: Simon Glass 
---

 scripts/Makefile.spl | 20 ++--
 1 file changed, 14 insertions(+), 6 deletions(-)

diff --git a/scripts/Makefile.spl b/scripts/Makefile.spl
index 96f414a..7bf471a 100644
--- a/scripts/Makefile.spl
+++ b/scripts/Makefile.spl
@@ -131,14 +131,14 @@ boot.bin: $(obj)/u-boot-spl.bin
 else
 MKIMAGEFLAGS_boot.bin = -T zynqimage
 
-spl/boot.bin: $(obj)/u-boot-spl-dtb.bin
+spl/boot.bin: $(obj)/u-boot-spl.bin
$(call if_changed,mkimage)
 endif
 
 ALL-y  += $(obj)/$(SPL_BIN).bin $(obj)/$(SPL_BIN).cfg
 
 ifdef CONFIG_SPL_OF_CONTROL
-ALL-$(CONFIG_OF_SEPARATE) += $(obj)/$(SPL_BIN)-pad.bin 
$(obj)/$(SPL_BIN)-dtb.bin
+ALL-$(CONFIG_OF_SEPARATE) += $(obj)/$(SPL_BIN)-pad.bin 
$(obj)/$(SPL_BIN)-nodtb.bin
 endif
 
 ifdef CONFIG_SAMSUNG
@@ -166,11 +166,19 @@ all:  $(ALL-y)
 quiet_cmd_cat = CAT $@
 cmd_cat = cat $(filter-out $(PHONY), $^) > $@
 
-$(obj)/$(SPL_BIN)-dtb.bin: $(obj)/$(SPL_BIN).bin $(obj)/$(SPL_BIN)-pad.bin \
+ifeq ($(CONFIG_SPL_OF_CONTROL),y)
+$(obj)/$(SPL_BIN)-dtb.bin: $(obj)/$(SPL_BIN)-nodtb.bin 
$(obj)/$(SPL_BIN)-pad.bin \
$(obj)/$(SPL_BIN).dtb FORCE
$(call if_changed,cat)
 
-# Create a file that pads from the end of u-boot-spl.bin to bss_end
+$(obj)/$(SPL_BIN).bin: $(obj)/$(SPL_BIN)-dtb.bin FORCE
+   $(call if_changed,cat)
+else
+$(obj)/$(SPL_BIN).bin: $(obj)/$(SPL_BIN)-nodtb.bin FORCE
+   $(call if_changed,cat)
+endif
+
+# Create a file that pads from the end of u-boot-spl-nodtb.bin to bss_end
 $(obj)/$(SPL_BIN)-pad.bin: $(obj)/$(SPL_BIN)
@bss_size_str=$(shell $(NM) $< | awk 'BEGIN {size = 0} /__bss_size/ 
{size = $$1} END {print "ibase=16; " toupper(size)}' | bc); \
dd if=/dev/zero of=$@ bs=1 count=$${bss_size_str} 2>/dev/null;
@@ -211,9 +219,9 @@ endif
 quiet_cmd_objcopy = OBJCOPY $@
 cmd_objcopy = $(OBJCOPY) $(OBJCOPYFLAGS) $(OBJCOPYFLAGS_$(@F)) $< $@
 
-OBJCOPYFLAGS_$(SPL_BIN).bin = $(SPL_OBJCFLAGS) -O binary
+OBJCOPYFLAGS_$(SPL_BIN)-nodtb.bin = $(SPL_OBJCFLAGS) -O binary
 
-$(obj)/$(SPL_BIN).bin: $(obj)/$(SPL_BIN) FORCE
+$(obj)/$(SPL_BIN)-nodtb.bin: $(obj)/$(SPL_BIN) FORCE
$(call if_changed,objcopy)
 
 LDFLAGS_$(SPL_BIN) += -T u-boot-spl.lds $(LDFLAGS_FINAL)
-- 
2.7.0.rc3.207.g0ac5344

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


[U-Boot] [PATCH 4/7] tegra: Always build a boot image with the same filename

2016-01-25 Thread Simon Glass
Adjust the Makefile to build u-boot-tegra.bin which contains a device tree
if OF_CONTROL is enabled, and does not if not. This mirrors U-Boot's new
approach of using u-boot.bin to handle both cases.

Signed-off-by: Simon Glass 
---

 Makefile | 12 +---
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/Makefile b/Makefile
index 4fa1b9a..fa55c71 100644
--- a/Makefile
+++ b/Makefile
@@ -765,6 +765,7 @@ endif
 # enable combined SPL/u-boot/dtb rules for tegra
 ifneq ($(CONFIG_TEGRA),)
 ifeq ($(CONFIG_SPL),y)
+ALL-y += u-boot-tegra.bin
 ifeq ($(CONFIG_OF_SEPARATE),y)
 ALL-y += u-boot-dtb-tegra.bin
 else
@@ -1080,15 +1081,12 @@ u-boot-sunxi-with-spl.bin: spl/sunxi-spl.bin \
 endif
 
 ifneq ($(CONFIG_TEGRA),)
-OBJCOPYFLAGS_u-boot-nodtb-tegra.bin = -O binary 
--pad-to=$(CONFIG_SYS_TEXT_BASE)
-u-boot-nodtb-tegra.bin: spl/u-boot-spl u-boot.bin FORCE
+OBJCOPYFLAGS_u-boot-tegra.bin = -O binary --pad-to=$(CONFIG_SYS_TEXT_BASE)
+u-boot-tegra.bin: spl/u-boot-spl u-boot.bin FORCE
$(call if_changed,pad_cat)
 
-ifeq ($(CONFIG_OF_SEPARATE),y)
-OBJCOPYFLAGS_u-boot-dtb-tegra.bin = -O binary --pad-to=$(CONFIG_SYS_TEXT_BASE)
-u-boot-dtb-tegra.bin: spl/u-boot-spl u-boot-dtb.bin FORCE
-   $(call if_changed,pad_cat)
-endif
+u-boot-nodtb-tegra.bin u-boot-dtb-tegra.bin: u-boot-tegra.bin FORCE
+   $(call if_changed,cat)
 endif
 
 OBJCOPYFLAGS_u-boot-app.efi := $(OBJCOPYFLAGS_EFI)
-- 
2.7.0.rc3.207.g0ac5344

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


[U-Boot] [PATCH 5/7] socfpga: Simplify Makefile filenames

2016-01-25 Thread Simon Glass
We don't need the -dtb suffix anymore, so drop it.

Signed-off-by: Simon Glass 
---

 Makefile | 10 +-
 scripts/Makefile.spl |  6 +++---
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/Makefile b/Makefile
index fa55c71..66e96cb 100644
--- a/Makefile
+++ b/Makefile
@@ -1015,10 +1015,10 @@ u-boot.spr: spl/u-boot-spl.img u-boot.img FORCE
 
 ifneq ($(CONFIG_ARCH_SOCFPGA),)
 quiet_cmd_socboot = SOCBOOT $@
-cmd_socboot = cat  spl/u-boot-spl-dtb.sfp spl/u-boot-spl-dtb.sfp   \
-   spl/u-boot-spl-dtb.sfp spl/u-boot-spl-dtb.sfp   \
-   u-boot-dtb.img > $@ || rm -f $@
-u-boot-with-spl-dtb.sfp: spl/u-boot-spl-dtb.sfp u-boot-dtb.img FORCE
+cmd_socboot = cat  spl/u-boot-spl.sfp spl/u-boot-spl.sfp   \
+   spl/u-boot-spl.sfp spl/u-boot-spl.sfp   \
+   u-boot.img > $@ || rm -f $@
+u-boot-with-spl.sfp: spl/u-boot-spl.sfp u-boot.img FORCE
$(call if_changed,socboot)
 endif
 
@@ -1323,7 +1323,7 @@ spl/u-boot-spl: tools prepare $(if 
$(CONFIG_OF_SEPARATE),dts/dt.dtb)
 spl/sunxi-spl.bin: spl/u-boot-spl
@:
 
-spl/u-boot-spl-dtb.sfp: spl/u-boot-spl
+spl/u-boot-spl.sfp: spl/u-boot-spl
@:
 
 spl/boot.bin: spl/u-boot-spl
diff --git a/scripts/Makefile.spl b/scripts/Makefile.spl
index 7bf471a..aa7091c 100644
--- a/scripts/Makefile.spl
+++ b/scripts/Makefile.spl
@@ -146,7 +146,7 @@ ALL-y   += $(obj)/$(BOARD)-spl.bin
 endif
 
 ifdef CONFIG_ARCH_SOCFPGA
-ALL-y  += $(obj)/$(SPL_BIN)-dtb.sfp
+ALL-y  += $(obj)/$(SPL_BIN).sfp
 endif
 
 ifdef CONFIG_SUNXI
@@ -230,8 +230,8 @@ LDFLAGS_$(SPL_BIN) += -Ttext $(CONFIG_SPL_TEXT_BASE)
 endif
 
 ifdef CONFIG_ARCH_SOCFPGA
-MKIMAGEFLAGS_$(SPL_BIN)-dtb.sfp = -T socfpgaimage
-$(obj)/$(SPL_BIN)-dtb.sfp: $(obj)/$(SPL_BIN)-dtb.bin FORCE
+MKIMAGEFLAGS_$(SPL_BIN).sfp = -T socfpgaimage
+$(obj)/$(SPL_BIN).sfp: $(obj)/$(SPL_BIN).bin FORCE
$(call if_changed,mkimage)
 endif
 
-- 
2.7.0.rc3.207.g0ac5344

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


[U-Boot] [PATCH 7/7] Makefile: Drop unnecessary -dtb suffixes

2016-01-25 Thread Simon Glass
When OF_CONTROL is enabled, u-boot-dtb.* files are the same as u-boot.*
files. So we can use the latter for simplicity.

Signed-off-by: Simon Glass 
---

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

diff --git a/Makefile b/Makefile
index d432000..c15a5ac 100644
--- a/Makefile
+++ b/Makefile
@@ -920,7 +920,7 @@ MKIMAGEFLAGS_u-boot.pbl = -n 
$(srctree)/$(CONFIG_SYS_FSL_PBL_RCW:"%"=%) \
 u-boot-dtb.img u-boot.img u-boot.kwb u-boot.pbl: u-boot.bin FORCE
$(call if_changed,mkimage)
 
-u-boot-spl.kwb: u-boot-dtb.img spl/u-boot-spl.bin FORCE
+u-boot-spl.kwb: u-boot.img spl/u-boot-spl.bin FORCE
$(call if_changed,mkimage)
 
 u-boot.sha1:   u-boot.bin
@@ -1061,7 +1061,7 @@ endif
 cmd_ifdtool += $(IFDTOOL) $(IFDTOOL_FLAGS) u-boot.tmp;
 cmd_ifdtool += mv u-boot.tmp $@
 
-u-boot.rom: u-boot-x86-16bit.bin u-boot-dtb.bin
+u-boot.rom: u-boot-x86-16bit.bin u-boot.bin
$(call if_changed,ifdtool)
 
 OBJCOPYFLAGS_u-boot-x86-16bit.bin := -O binary -j .start16 -j .resetvec
@@ -1072,8 +1072,7 @@ endif
 ifneq ($(CONFIG_SUNXI),)
 OBJCOPYFLAGS_u-boot-sunxi-with-spl.bin = -I binary -O binary \
   --pad-to=$(CONFIG_SPL_PAD_TO) --gap-fill=0xff
-u-boot-sunxi-with-spl.bin: spl/sunxi-spl.bin \
-   u-boot$(if $(CONFIG_OF_CONTROL),-dtb,).img FORCE
+u-boot-sunxi-with-spl.bin: spl/sunxi-spl.bin u-boot.img FORCE
$(call if_changed,pad_cat)
 endif
 
@@ -1090,7 +1089,7 @@ OBJCOPYFLAGS_u-boot-app.efi := $(OBJCOPYFLAGS_EFI)
 u-boot-app.efi: u-boot FORCE
$(call if_changed,zobjcopy)
 
-u-boot-dtb.bin.o: u-boot-dtb.bin FORCE
+u-boot.bin.o: u-boot.bin FORCE
$(call if_changed,efipayload)
 
 u-boot-payload.lds: $(LDSCRIPT_EFI) FORCE
@@ -1100,10 +1099,10 @@ u-boot-payload.lds: $(LDSCRIPT_EFI) FORCE
 quiet_cmd_u-boot_payload ?= LD  $@
   cmd_u-boot_payload ?= $(LD) $(LDFLAGS_EFI_PAYLOAD) -o $@ \
   -T u-boot-payload.lds arch/x86/cpu/call32.o \
-  lib/efi/efi.o lib/efi/efi_stub.o u-boot-dtb.bin.o \
+  lib/efi/efi.o lib/efi/efi_stub.o u-boot.bin.o \
   $(addprefix arch/$(ARCH)/lib/efi/,$(EFISTUB))
 
-u-boot-payload: u-boot-dtb.bin.o u-boot-payload.lds FORCE
+u-boot-payload: u-boot.bin.o u-boot-payload.lds FORCE
$(call if_changed,u-boot_payload)
 
 OBJCOPYFLAGS_u-boot-payload.efi := $(OBJCOPYFLAGS_EFI)
-- 
2.7.0.rc3.207.g0ac5344

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


[U-Boot] [PATCH 1/7] tegra: Drop generation of -nodtb file with OF_CONTROL

2016-01-25 Thread Simon Glass
It seems clear that the intent is to generate u-boot-nodtb-tegra.bin only
when OF_CONTROL is not set. But due to the way the rules are set up, this
file is always generated. Fix this.

Signed-off-by: Simon Glass 
---

 Makefile | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index c9c2cbe..e2b6674 100644
--- a/Makefile
+++ b/Makefile
@@ -1077,8 +1077,9 @@ u-boot-nodtb-tegra.bin: spl/u-boot-spl u-boot.bin FORCE
$(call if_changed,pad_cat)
 
 ifeq ($(CONFIG_OF_SEPARATE),y)
-u-boot-dtb-tegra.bin: u-boot-nodtb-tegra.bin dts/dt.dtb FORCE
-   $(call if_changed,cat)
+OBJCOPYFLAGS_u-boot-dtb-tegra.bin = -O binary --pad-to=$(CONFIG_SYS_TEXT_BASE)
+u-boot-dtb-tegra.bin: spl/u-boot-spl u-boot-dtb.bin FORCE
+   $(call if_changed,pad_cat)
 endif
 endif
 
-- 
2.7.0.rc3.207.g0ac5344

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


[U-Boot] [PATCH 6/7] Makefile: Make u-boot.img the same as u-boot-dtb.img

2016-01-25 Thread Simon Glass
When OF_CONTROL is enabled, u-boot.img has no purpose since it does not
include the required device tree binary. The correct image to use is
u-boot-dtb.img with OF_CONTROL but u-boot.img without OF_CONTROL.

Create u-boot.img even when OF_CONTROL is enabled, so that this file can be
used in both cases.

Signed-off-by: Simon Glass 
---

 Makefile | 13 +++--
 1 file changed, 3 insertions(+), 10 deletions(-)

diff --git a/Makefile b/Makefile
index 66e96cb..d432000 100644
--- a/Makefile
+++ b/Makefile
@@ -906,6 +906,8 @@ MKIMAGEFLAGS_u-boot.img = -A $(ARCH) -T firmware -C none -O 
u-boot \
-a $(CONFIG_SYS_TEXT_BASE) -e $(CONFIG_SYS_UBOOT_START) \
-n "U-Boot $(UBOOTRELEASE) for $(BOARD) board"
 
+MKIMAGEFLAGS_u-boot-dtb.img = $(MKIMAGEFLAGS_u-boot.img)
+
 MKIMAGEFLAGS_u-boot.kwb = -n $(srctree)/$(CONFIG_SYS_KWD_CONFIG:"%"=%) \
-T kwbimage -a $(CONFIG_SYS_TEXT_BASE) -e $(CONFIG_SYS_TEXT_BASE)
 
@@ -915,17 +917,12 @@ MKIMAGEFLAGS_u-boot-spl.kwb = -n 
$(srctree)/$(CONFIG_SYS_KWD_CONFIG:"%"=%) \
 MKIMAGEFLAGS_u-boot.pbl = -n $(srctree)/$(CONFIG_SYS_FSL_PBL_RCW:"%"=%) \
-R $(srctree)/$(CONFIG_SYS_FSL_PBL_PBI:"%"=%) -T pblimage
 
-u-boot.img u-boot.kwb u-boot.pbl: u-boot.bin FORCE
+u-boot-dtb.img u-boot.img u-boot.kwb u-boot.pbl: u-boot.bin FORCE
$(call if_changed,mkimage)
 
 u-boot-spl.kwb: u-boot-dtb.img spl/u-boot-spl.bin FORCE
$(call if_changed,mkimage)
 
-MKIMAGEFLAGS_u-boot-dtb.img = $(MKIMAGEFLAGS_u-boot.img)
-
-u-boot-dtb.img: u-boot-dtb.bin FORCE
-   $(call if_changed,mkimage)
-
 u-boot.sha1:   u-boot.bin
tools/ubsha1 u-boot.bin
 
@@ -1127,11 +1124,7 @@ spl/u-boot-spl.pbl: spl/u-boot-spl.bin FORCE
$(call if_changed,mkimage)
 
 ifeq ($(ARCH),arm)
-ifdef CONFIG_OF_CONTROL
-UBOOT_BINLOAD := u-boot-dtb.img
-else
 UBOOT_BINLOAD := u-boot.img
-endif
 else
 UBOOT_BINLOAD := u-boot.bin
 endif
-- 
2.7.0.rc3.207.g0ac5344

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


Re: [U-Boot] [PATCH 2/2 v2] x86: BayTrail: Add option to disable the internal UART to setup_early_uart()

2016-01-25 Thread Simon Glass
On 24 January 2016 at 19:50, Bin Meng  wrote:
> Hi Simon,
>
> On Tue, Jan 19, 2016 at 9:24 PM, Stefan Roese  wrote:
>> This patch adds a parameter to the function setup_early_uart() to either
>> enable or disable the internal BayTrail legacy UART. Since the name
>> setup_early_uart() does not match its functionality any more, lets
>> rename it to setup_internal_uart() as well in this patch.
>>
>> Signed-off-by: Stefan Roese 
>> Reviewed-by: Bin Meng 
>> Cc: Simon Glass 
>> ---
>> v2:
>> - Also change reference in README.x86
>>
>>  arch/x86/cpu/baytrail/early_uart.c | 10 +++---
>>  arch/x86/include/asm/u-boot-x86.h  |  2 +-
>>  arch/x86/lib/fsp/fsp_support.c |  2 +-
>>  doc/README.x86 |  2 +-
>>  4 files changed, 10 insertions(+), 6 deletions(-)

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


[U-Boot] [PATCH 2/7] fdt: Build a U-Boot binary without device tree

2016-01-25 Thread Simon Glass
At present u-boot.bin holds the plain U-Boot binary without the device tree.
This is somewhat annoying since you need either u-boot.bin or u-boot-dtb.bin
depending on whether device tree is used.

Adjust the build such that u-boot.bin includes a device tree, and the
plain binary is in u-boot-nodtb.bin. For now u-boot-dtb.bin remains the
same.

This should be acceptable since:

- without OF_CONTROL, u-boot.bin still does not include a device tree
- with OF_CONTROL, u-boot-dtb.bin does not change

The main impact is build systems which are set up to use u-boot.bin as
the output file and then add a device tree. These will have to change to use
u-boot-nodtb.bin instead.

Adjust tegra rules so it continues to produce the correct files.

Signed-off-by: Simon Glass 
---

 Makefile | 22 +++---
 1 file changed, 15 insertions(+), 7 deletions(-)

diff --git a/Makefile b/Makefile
index e2b6674..4fa1b9a 100644
--- a/Makefile
+++ b/Makefile
@@ -827,9 +827,17 @@ PHONY += dtbs
 dtbs dts/dt.dtb: checkdtc u-boot
$(Q)$(MAKE) $(build)=dts dtbs
 
-u-boot-dtb.bin: u-boot.bin dts/dt.dtb FORCE
+ifeq ($(CONFIG_OF_CONTROL),y)
+u-boot-dtb.bin: u-boot-nodtb.bin dts/dt.dtb FORCE
$(call if_changed,cat)
 
+u-boot.bin: u-boot-dtb.bin FORCE
+   $(call if_changed,cat)
+else
+u-boot.bin: u-boot-nodtb.bin FORCE
+   $(call if_changed,cat)
+endif
+
 %.imx: %.bin
$(Q)$(MAKE) $(build)=arch/arm/imx-common $@
 
@@ -846,11 +854,11 @@ OBJCOPYFLAGS_u-boot.srec := -O srec
 u-boot.hex u-boot.srec: u-boot FORCE
$(call if_changed,objcopy)
 
-OBJCOPYFLAGS_u-boot.bin := -O binary \
+OBJCOPYFLAGS_u-boot-nodtb.bin := -O binary \
$(if $(CONFIG_X86_RESET_VECTOR),-R .start16 -R .resetvec)
 
-binary_size_check: u-boot.bin FORCE
-   @file_size=$(shell wc -c u-boot.bin | awk '{print $$1}') ; \
+binary_size_check: u-boot-nodtb.bin FORCE
+   @file_size=$(shell wc -c u-boot-nodtb.bin | awk '{print $$1}') ; \
map_size=$(shell cat u-boot.map | \
awk '/_image_copy_start/ {start = $$1} /_image_binary_end/ {end 
= $$1} END {if (start != "" && end != "") print "ibase=16; " toupper(end) " - " 
toupper(start)}' \
| sed 's/0X//g' \
@@ -858,12 +866,12 @@ binary_size_check: u-boot.bin FORCE
if [ "" != "$$map_size" ]; then \
if test $$map_size -ne $$file_size; then \
echo "u-boot.map shows a binary size of $$map_size" >&2 
; \
-   echo "  but u-boot.bin shows $$file_size" >&2 ; \
+   echo "  but u-boot-nodtb.bin shows $$file_size" >&2 ; \
exit 1; \
fi \
fi
 
-u-boot.bin: u-boot FORCE
+u-boot-nodtb.bin: u-boot FORCE
$(call if_changed,objcopy)
$(call DO_STATIC_RELA,$<,$@,$(CONFIG_SYS_TEXT_BASE))
$(BOARD_SIZE_CHECK)
@@ -1022,7 +1030,7 @@ rom: u-boot.rom FORCE
 IFDTOOL=$(objtree)/tools/ifdtool
 IFDTOOL_FLAGS  = -f 0:$(objtree)/u-boot.dtb
 IFDTOOL_FLAGS += -m 0x$(shell $(NM) u-boot |grep _dt_ucode_base_size |cut -d' 
' -f1)
-IFDTOOL_FLAGS += -U $(CONFIG_SYS_TEXT_BASE):$(objtree)/u-boot.bin
+IFDTOOL_FLAGS += -U $(CONFIG_SYS_TEXT_BASE):$(objtree)/u-boot-nodtb.bin
 IFDTOOL_FLAGS += -w $(CONFIG_SYS_X86_START16):$(objtree)/u-boot-x86-16bit.bin
 IFDTOOL_FLAGS += -C
 
-- 
2.7.0.rc3.207.g0ac5344

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


Re: [U-Boot] [PATCH 2/2 v3] board/t4240rdb: VID support

2016-01-25 Thread york sun
On 01/21/2016 09:48 PM, ying.zh...@freescale.com wrote:
> From: Ying Zhang 
> 
> The fuse status register provides the values from on-chip
> voltage ID efuses programmed at the factory.
> These values define the voltage requirements for
> the chip. u-boot reads FUSESR and translates the values
> into the appropriate commands to set the voltage output
> value of an external voltage regulator.
> 
> Signed-off-by: Ying Zhang 
> ---
> Changed from v2:
> - Split the Intel mode support patch
> Changed from v1:
> - Not support IR chip is used in AMD mode
> ---

Revised subject and slightly reformat commit message

powerpc/board/t4240rdb: Enable VID support

The fuse status register provides the values from on-chip
voltage ID efuses programmed at the factory. These values
define the voltage requirements for the chip. u-boot reads
FUSESR and translates the values into the appropriate
commands to set the voltage output value of an external
voltage regulator.

Applied to u-boot-mpc85xx master branch. Awaiting upstream.

Thanks.

York

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


Re: [U-Boot] [PATCH][v2] arch/powperpc: Fix start_align due to use of __ffs64() instead ffs64()

2016-01-25 Thread york sun
On 01/22/2016 02:20 AM, Ashish Kumar wrote:
>  Return value of ffs64() different to that of __ffs64(),
> ffs64(0x8000) = 0x20
> __ffs64(0x8000) = 0x1f,
>as result of this change -1 from start_align needs to be removed.
>  Incorrect DDR law was created in case of B4860qds
> 
> Signed-off-by: Ashish Kumar 
> ---
>  * Test on B4860qds and T1040
>  * 83xx platform not tested

(resend)

Revised commit message as

Incorrect DDR law was created in case of B4860qds after commit
2d2f490d. Return value of ffs64() differs from __ffs64(), eg.
ffs64(0x8000) = 0x20
__ffs64(0x8000) = 0x1f
As a result of this change, callers need to adjust the expected
return value by removing -1.

Applied to u-boot-mpc85xx master branch. Awaiting upstream.

Thanks.

York


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


[U-Boot] Please pull u-boot-mpc85xx master

2016-01-25 Thread york sun
Tom,

The following changes since commit 12f229ea8f6c8e20f8fd07906eafc853c4c354a9:

  Merge git://git.denx.de/u-boot-fdt (2016-01-22 17:01:22 -0500)

are available in the git repository at:


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

for you to fetch changes up to 2f66a828f7621958b6925fc763380fa87be55ee6:

  powerpc/board/t4240rdb: Enable VID support (2016-01-25 12:38:05 -0800)


Ashish kumar (1):
  arch/powperpc: Fix start_align due to use of __ffs64() instead ffs64()

Prabhakar Kushwaha (1):
  powerpc: mpc85xx: Move set_liodns, setup_portals to common boot seq

Ying Zhang (2):
  board/freescale/common: Check IR chip mode for VID support
  powerpc/board/t4240rdb: Enable VID support

 arch/powerpc/cpu/mpc83xx/law.c  |4 ++--
 arch/powerpc/cpu/mpc85xx/cpu_init.c |   11 +++
 arch/powerpc/cpu/mpc8xxx/law.c  |4 ++--
 board/freescale/b4860qds/b4860qds.c |5 -
 board/freescale/common/vid.c|   19 +--
 board/freescale/common/vid.h|4 
 board/freescale/corenet_ds/corenet_ds.c |6 --
 board/freescale/p2041rdb/p2041rdb.c |3 ---
 board/freescale/t102xqds/t102xqds.c |5 -
 board/freescale/t102xrdb/t102xrdb.c |5 -
 board/freescale/t1040qds/t1040qds.c |5 -
 board/freescale/t104xrdb/t104xrdb.c |6 --
 board/freescale/t208xqds/t208xqds.c |6 --
 board/freescale/t208xrdb/t208xrdb.c |6 --
 board/freescale/t4qds/t4240emu.c|6 --
 board/freescale/t4qds/t4240qds.c|6 --
 board/freescale/t4rdb/t4240rdb.c|   12 +++-
 include/configs/T4240RDB.h  |   10 ++
 18 files changed, 53 insertions(+), 70 deletions(-)

Thanks.

York

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


Re: [U-Boot] [PATCH 5/7] socfpga: Simplify Makefile filenames

2016-01-25 Thread Marek Vasut
On Monday, January 25, 2016 at 09:30:29 PM, Simon Glass wrote:
> We don't need the -dtb suffix anymore, so drop it.
> 
> Signed-off-by: Simon Glass 
> ---

You should also fix the MCV:

$ git grep u-boot-with-spl-dtb.sfp
...
include/configs/socfpga_mcvevk.h:  "update_filename=u-boot-with-spl-dtb.sfp\0"

I have to admit, I am not a big fan of this renaming, since it's just 
introducing naming chaos between versions.

>  Makefile | 10 +-
>  scripts/Makefile.spl |  6 +++---
>  2 files changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/Makefile b/Makefile
> index fa55c71..66e96cb 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -1015,10 +1015,10 @@ u-boot.spr: spl/u-boot-spl.img u-boot.img FORCE
> 
>  ifneq ($(CONFIG_ARCH_SOCFPGA),)
>  quiet_cmd_socboot = SOCBOOT $@
> -cmd_socboot = catspl/u-boot-spl-dtb.sfp spl/u-boot-spl-dtb.sfp   \
> - spl/u-boot-spl-dtb.sfp spl/u-boot-spl-dtb.sfp   \
> - u-boot-dtb.img > $@ || rm -f $@
> -u-boot-with-spl-dtb.sfp: spl/u-boot-spl-dtb.sfp u-boot-dtb.img FORCE
> +cmd_socboot = catspl/u-boot-spl.sfp spl/u-boot-spl.sfp   \
> + spl/u-boot-spl.sfp spl/u-boot-spl.sfp   \
> + u-boot.img > $@ || rm -f $@
> +u-boot-with-spl.sfp: spl/u-boot-spl.sfp u-boot.img FORCE
>   $(call if_changed,socboot)
>  endif
> 
> @@ -1323,7 +1323,7 @@ spl/u-boot-spl: tools prepare $(if
> $(CONFIG_OF_SEPARATE),dts/dt.dtb) spl/sunxi-spl.bin: spl/u-boot-spl
>   @:
> 
> -spl/u-boot-spl-dtb.sfp: spl/u-boot-spl
> +spl/u-boot-spl.sfp: spl/u-boot-spl
>   @:
> 
>  spl/boot.bin: spl/u-boot-spl
> diff --git a/scripts/Makefile.spl b/scripts/Makefile.spl
> index 7bf471a..aa7091c 100644
> --- a/scripts/Makefile.spl
> +++ b/scripts/Makefile.spl
> @@ -146,7 +146,7 @@ ALL-y += $(obj)/$(BOARD)-spl.bin
>  endif
> 
>  ifdef CONFIG_ARCH_SOCFPGA
> -ALL-y+= $(obj)/$(SPL_BIN)-dtb.sfp
> +ALL-y+= $(obj)/$(SPL_BIN).sfp
>  endif
> 
>  ifdef CONFIG_SUNXI
> @@ -230,8 +230,8 @@ LDFLAGS_$(SPL_BIN) += -Ttext $(CONFIG_SPL_TEXT_BASE)
>  endif
> 
>  ifdef CONFIG_ARCH_SOCFPGA
> -MKIMAGEFLAGS_$(SPL_BIN)-dtb.sfp = -T socfpgaimage
> -$(obj)/$(SPL_BIN)-dtb.sfp: $(obj)/$(SPL_BIN)-dtb.bin FORCE
> +MKIMAGEFLAGS_$(SPL_BIN).sfp = -T socfpgaimage
> +$(obj)/$(SPL_BIN).sfp: $(obj)/$(SPL_BIN).bin FORCE
>   $(call if_changed,mkimage)
>  endif

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


Re: [U-Boot] [PATCH 1/2 v3] VID: support IR chip is used in Intel mode

2016-01-25 Thread york sun
On 01/21/2016 09:48 PM, ying.zh...@freescale.com wrote:
> From: Ying Zhang 
> 
> IR chip on all the boards support VID are required to be
> used in Intel mode.
> the VDD will not be adjusted while IR chip is not used in
> Intel mode.
> 
> Signed-off-by: Ying Zhang 
> ---
> Changed from v2:
> - Separate this patch from T4RDB VID support patch
> Changed from v1:
> - Not support IR chip is used in AMD mode
> ---

Revised commit subject and message as

board/freescale/common: Check IR chip mode for VID support

IR chip on all the boards are required to be used in Intel mode
to support VID. VDD will not be adjusted if IR chip is used in
other modes.

Applied to u-boot-mpc85xx master branch. Awaiting upstream.

Thanks.

York


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


Re: [U-Boot] [PATCH REPOST] checkpatch: ignore request to use ether_addr_copy()

2016-01-25 Thread Marek Vasut
On Monday, January 25, 2016 at 05:48:00 PM, Stephen Warren wrote:
> From: Stephen Warren 
> 
> The Linux kernel, from which checkpatch originates, contains function
> ether_addr_copy() to copy Ethernet MAC addresses, and checkpatch warns
> that it should be used in preference to memcpy() where appropriate.
> U-Boot doesn't contain ether_addr_copy(), so tell checkpatch not to issue
> this warning.
> 
> Signed-off-by: Stephen Warren 
> Reviewed-by: Marek Vasut 
> Acked-by: Joe Hershberger 

+CC Tom, Simon

> ---
>  .checkpatch.conf | 4 
>  1 file changed, 4 insertions(+)
> 
> diff --git a/.checkpatch.conf b/.checkpatch.conf
> index 35167e12015b..d1d32fac9db5 100644
> --- a/.checkpatch.conf
> +++ b/.checkpatch.conf
> @@ -21,3 +21,7 @@
> 
>  # Ignore networking block comment style
>  --ignore NETWORKING_BLOCK_COMMENT_STYLE
> +
> +# Ignore "WARNING: Prefer ether_addr_copy() over memcpy() if the Ethernet
> +# addresses are __aligned(2)".
> +--ignore PREFER_ETHER_ADDR_COPY

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


Re: [U-Boot] [PATCH v3] usb: add clock support for generic EHCI

2016-01-25 Thread Marek Vasut
On Monday, January 25, 2016 at 07:00:36 AM, Masahiro Yamada wrote:
> This driver is designed in a generic manner, so clocks should be
> handled genericly as well.
> 
> Signed-off-by: Masahiro Yamada 

Applied, thanks!

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


Re: [U-Boot] [PATCH] usb: xhci: Fix vendor command error if the request type is USB_REQ_SET_ADDRESS or USB_REQ_SET_CONFIGURATION.

2016-01-25 Thread Marek Vasut
On Monday, January 25, 2016 at 12:11:59 PM, Ted wrote:
> Hi Marek,

Hi Ted,

> > -Original Message-
> > From: Marek Vasut [mailto:ma...@denx.de]
> > Sent: Thursday, November 26, 2015 9:25 AM
> > To: Ted
> > Cc: swar...@nvidia.com; u-boot@lists.denx.de;
> > linux.am...@gmail.com; Hans de Goede
> > Subject: Re: [PATCH] usb: xhci: Fix vendor command error if
> > the request type is USB_REQ_SET_ADDRESS or USB_REQ_SET_CONFIGURATION.
> > 
> > On Wednesday, November 25, 2015 at 06:57:48 AM, Ted Chen wrote:
> > > Add a condition of set_address and set_configuration to
> > 
> > check if the
> > 
> > > request is standardized.
> > > 
> > > Signed-off-by: Ted Chen 
> > > ---
> > > 
> > >  drivers/usb/host/xhci.c |6 --
> > >  1 file changed, 4 insertions(+), 2 deletions(-)
> > > 
> > > diff --git a/drivers/usb/host/xhci.c
> > 
> > b/drivers/usb/host/xhci.c index
> > 
> > > ca598aa..cb8a04b 100644
> > > --- a/drivers/usb/host/xhci.c
> > > +++ b/drivers/usb/host/xhci.c
> > > @@ -941,10 +941,12 @@ static int _xhci_submit_control_msg(struct
> > > usb_device *udev, unsigned long pipe, if
> > 
> > (usb_pipedevice(pipe) == ctrl->rootdev)
> > 
> > >   return xhci_submit_root(udev, pipe, buffer, setup);
> > 
> > Hi!
> > What do you say we reorder the check a little:
> > 
> > if ((setup->requesttype & USB_TYPE_MASK) == USB_TYPE_STANDARD) {
> > 
> > if (setup->request == USB_REQ_SET_ADDRESS)
> > 
> > return xhci_address_device(udev, root_portnr);
> > 
> > if (setup->request == USB_REQ_SET_CONFIGURATION)
> > 
> > ...
> > 
> > }
> > 
> > Also, I suspect this sort of fix needs to be applied to at
> > least dwc3 ep0.c, r8a66597-hcd.c and musb_hcd.c as well.
> 
> I don't have another board in my hand, so I can't verify the other xhci
> host controller.

That's fine, just fixing this problem everywhere is enough and the people
who have the controller can test it themselves.

> But I have confirmed this patch in xhci.c actually can fix errors while 
> the the request type is USB_REQ_SET_ADDRESS or USB_REQ_SET_CONFIGURATION
> in USB vendor command.

Excellent.

> > Paging Hans so he can share his visdom too :)
> 
> Hi Hans,
> 
> Do you have any comments?
> 
> Thanks

Thanks!

> > > - if (setup->request == USB_REQ_SET_ADDRESS)
> > > + if (setup->request == USB_REQ_SET_ADDRESS &&
> > > +(setup->requesttype & USB_TYPE_MASK) == USB_TYPE_STANDARD)
> > > 
> > >   return xhci_address_device(udev, root_portnr);
> > > 
> > > - if (setup->request == USB_REQ_SET_CONFIGURATION) {
> > > + if (setup->request == USB_REQ_SET_CONFIGURATION &&
> > > +(setup->requesttype & USB_TYPE_MASK) == USB_TYPE_STANDARD) {
> > > 
> > >   ret = xhci_set_configuration(udev);
> > >   if (ret) {
> > >   
> > >   puts("Failed to configure xHCI endpoint\n");
> > 
> > Best regards,
> > Marek Vasut
> > 
> > --Please consider the environment before printing this e-mail.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] malloc: work around some memalign fragmentation issues

2016-01-25 Thread Stephen Warren
From: Stephen Warren 

Use of memalign can trigger fragmentation issues such as:

// Internally, this needs to find a free block quite bit larger than s.
// Once the free region is found, any unaligned "padding" immediately
// before and after the block is marked free, so that the allocation
// takes only s bytes (plus malloc header overhead).
p = memalign(a, s);
// If there's little fragmentation so far, this allocation is likely
// located immediately after p.
p2 = malloc(x);
free(p);
// In theory, this should return the same value for p. However, the hole
// left by the free() call is only s in size (plus malloc header overhead)
// whereas memalign searches for a larger block in order to guarantee it
// can adjust the returned pointer to the alignment requirements. Hence,
// the pointer returned, if any, won't be p. If there's little or no space
// left after p2, this allocation will fail.
p = memalign(a, s);

In practice, this issue occurs when running the "dfu" command repeatedly
on NVIDIA Tegra boards, since DFU allocates a large 32M data buffer, and
then initializes the USB controller. If this is the first time USB has
been used in the U-Boot session, this causes a probe of the USB driver,
which causes various allocations, including a strdup() of a GPIO name
when requesting the VBUS GPIO. When DFU is torn down, the USB driver
is left probed, and hence its memory is left allocated. If "dfu" is
executed again, allocation of the 32M data buffer fails as described
above.

In practice, there is a memory hole exactly large enough to hold the 32M
data buffer than DFU needs. However, memalign() can't know that in a
general way. Given that, it's particularly annoying that the allocation
fails!

The issue is that memalign() tries to allocate something larger to
guarantee the ability to align the returned pointer. This patch modifies
memalign() so that if the "general case" over-sized allocation fails,
another allocation is attempted, of the exact size the user desired. If
that allocation just happens to be aligned in the way the user wants,
(and in the case described above, it will be, since the free memory
region is located where a previous identical allocation was located),
the pointer can be returned.

This patch is somewhat related to 806bd245b1ab "dfu: don't keep
freeing/reallocating". That patch worked around the issue by removing
repeated free/memalign within a single execution of "dfu". However,
the same technique can't be applied across multiple invocations, since
there's no reason to keep the DFU buffer allocated while DFU isn't
running. This patch addresses the root-cause a bit more directly.

This problem highlights some of the disadvantages of dynamic allocation
and deferred probing of devices.

This patch isn't checkpatch-clean, since it conforms to the existing
coding style in dlmalloc.c, which is different to the rest of U-Boot.

Signed-off-by: Stephen Warren 
---
 common/dlmalloc.c | 22 ++
 1 file changed, 22 insertions(+)

diff --git a/common/dlmalloc.c b/common/dlmalloc.c
index b5bb05191c24..2b964d16b11e 100644
--- a/common/dlmalloc.c
+++ b/common/dlmalloc.c
@@ -2829,6 +2829,28 @@ Void_t* mEMALIGn(alignment, bytes) size_t alignment; 
size_t bytes;
   nb = request2size(bytes);
   m  = (char*)(mALLOc(nb + alignment + MINSIZE));
 
+  /*
+  * The attempt to over-allocate (with a size large enough to guarantee the
+  * ability to find an aligned region within allocated memory) failed.
+  *
+  * Try again, this time only allocating exactly the size the user wants. If
+  * the allocation now succeeds and just happens to be aligned, we can still
+  * fulfill the user's request.
+  */
+  if (m == NULL) {
+/*
+ * Use bytes not nb, since mALLOc internally calls request2size too, and
+ * each call increases the size to allocate, to account for the header.
+ */
+m  = (char*)(mALLOc(bytes));
+/* Aligned -> return it */
+if unsigned long)(m)) % alignment) == 0)
+  return m;
+/* Otherwise, fail */
+fREe(m);
+return NULL;
+  }
+
   if (m == NULL) return NULL; /* propagate failure */
 
   p = mem2chunk(m);
-- 
2.7.0

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


Re: [U-Boot] [PATCH][v2] arch/powperpc: Fix start_align due to use of __ffs64() instead ffs64()

2016-01-25 Thread york sun
On 01/22/2016 02:20 AM, Ashish Kumar wrote:
>  Return value of ffs64() different to that of __ffs64(),
> ffs64(0x8000) = 0x20
> __ffs64(0x8000) = 0x1f,
>as result of this change -1 from start_align needs to be removed.
>  Incorrect DDR law was created in case of B4860qds
> 
> Signed-off-by: Ashish Kumar 
> ---
>  * Test on B4860qds and T1040
>  * 83xx platform not tested

Revised commit message as

Incorrect DDR law was created in case of B4860qds after commit
2d2f490d. Return value of ffs64() differs from __ffs64(), eg.
ffs64(0x8000) = 0x20
__ffs64(0x8000) = 0x1f
As a result of this change, callers need to adjust the expected
return value by removing -1.

Applied to u-boot-mpc85xx master branch. Awaiting upstream.

Thanks.

York

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


Re: [U-Boot] [PATCH 1/7] tegra: Drop generation of -nodtb file with OF_CONTROL

2016-01-25 Thread Stephen Warren

On 01/25/2016 01:30 PM, Simon Glass wrote:

It seems clear that the intent is to generate u-boot-nodtb-tegra.bin only
when OF_CONTROL is not set. But due to the way the rules are set up, this
file is always generated. Fix this.


Nak, this file is used by our flashing tools, so needs to be kept around.

(As background, we take the separate u-boot-nodtb-tegra.bin and 
u-boot.dtb, modify u-boot.dtb to inject some changes to the environment 
such as over-writing bootcmd with flashing instructions etc., and then 
blend the two back together for download into RAM and subsequent execution).

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


[U-Boot] [PATCH] usb: kbd: Prevent out of bound access

2016-01-25 Thread Marek Vasut
Scan code 0x39 is CapsLock, which is not a printable character and thus
is not covered by either usb_kbd_numkey_shifted[] or usb_kbd_numkey[].
Fix the scan code check to avoid looking it up in either of the arrays.

Signed-off-by: Marek Vasut 
---
 common/usb_kbd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/usb_kbd.c b/common/usb_kbd.c
index cbb1995..d84865f 100644
--- a/common/usb_kbd.c
+++ b/common/usb_kbd.c
@@ -199,7 +199,7 @@ static int usb_kbd_translate(struct usb_kbd_pdata *data, 
unsigned char scancode,
}
}
 
-   if ((scancode > 0x1d) && (scancode < 0x3a)) {
+   if ((scancode > 0x1d) && (scancode < 0x39)) {
/* Shift pressed */
if (modifier & (LEFT_SHIFT | RIGHT_SHIFT))
keycode = usb_kbd_numkey_shifted[scancode - 0x1e];
-- 
2.1.4

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


Re: [U-Boot] [PATCH 2/7] fdt: Build a U-Boot binary without device tree

2016-01-25 Thread Stephen Warren

On 01/25/2016 01:30 PM, Simon Glass wrote:

At present u-boot.bin holds the plain U-Boot binary without the device tree.
This is somewhat annoying since you need either u-boot.bin or u-boot-dtb.bin
depending on whether device tree is used.

Adjust the build such that u-boot.bin includes a device tree, and the
plain binary is in u-boot-nodtb.bin. For now u-boot-dtb.bin remains the
same.

This should be acceptable since:

- without OF_CONTROL, u-boot.bin still does not include a device tree
- with OF_CONTROL, u-boot-dtb.bin does not change

The main impact is build systems which are set up to use u-boot.bin as
the output file and then add a device tree. These will have to change to use
u-boot-nodtb.bin instead.


That's probably going to annoy somebody. Have you put thought into how 
such a build system could auto-detect which file it should use in order 
to automatically adjust to the different file naming conventions of 
different U-Boot versions or branches? If not, this change will burden 
the operator of any tool or automated system with manually handling the 
difference by branching their own code or processes:-(



Adjust tegra rules so it continues to produce the correct files.


I don't see anything Tegra-related in this patch. Perhaps patch 1/7 was 
included here in a previous version and the commit description not updated?


Anyway, I think this patch doesn't affect me or Tegra's flashing tools. 
For reference, the tool currently uses the following files:


u-boot
spl/u-boot-spl
u-boot-nodtb-tegra.bin
u-boot.dtb
u-boot-dtb-tegra.bin

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


Re: [U-Boot] [PATCH 1/7] tegra: Drop generation of -nodtb file with OF_CONTROL

2016-01-25 Thread Simon Glass
Hi Stephen,

On 25 January 2016 at 14:08, Stephen Warren  wrote:
>
> On 01/25/2016 01:30 PM, Simon Glass wrote:
>>
>> It seems clear that the intent is to generate u-boot-nodtb-tegra.bin only
>> when OF_CONTROL is not set. But due to the way the rules are set up, this
>> file is always generated. Fix this.
>
>
> Nak, this file is used by our flashing tools, so needs to be kept around.
>
> (As background, we take the separate u-boot-nodtb-tegra.bin and u-boot.dtb, 
> modify u-boot.dtb to inject some changes to the environment such as 
> over-writing bootcmd with flashing instructions etc., and then blend the two 
> back together for download into RAM and subsequent execution).

OK. well in that case It think the code at the top is wrong:

# enable combined SPL/u-boot/dtb rules for tegra
ifneq ($(CONFIG_TEGRA),)
ifeq ($(CONFIG_SPL),y)
ifeq ($(CONFIG_OF_SEPARATE),y)
ALL-y += u-boot-dtb-tegra.bin
else
ALL-y += u-boot-nodtb-tegra.bin
endif
endif
endif

It should be this, right?

# enable combined SPL/u-boot/dtb rules for tegra
ifneq ($(CONFIG_TEGRA),)
ifeq ($(CONFIG_SPL),y)
ALL-y += u-boot-dtb-tegra.bin u-boot-nodtb-tegra.bin
endif
endif

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


Re: [U-Boot] [PATCH 5/7] socfpga: Simplify Makefile filenames

2016-01-25 Thread Simon Glass
Hi Marek,

On 25 January 2016 at 13:43, Marek Vasut  wrote:
> On Monday, January 25, 2016 at 09:30:29 PM, Simon Glass wrote:
>> We don't need the -dtb suffix anymore, so drop it.
>>
>> Signed-off-by: Simon Glass 
>> ---
>
> You should also fix the MCV:
>
> $ git grep u-boot-with-spl-dtb.sfp
> ...
> include/configs/socfpga_mcvevk.h:  "update_filename=u-boot-with-spl-dtb.sfp\0"
>

OK

> I have to admit, I am not a big fan of this renaming, since it's just
> introducing naming chaos between versions.

I'm rather hoping that the impact will be fairly small for the reasons
I explained in the cover letter.

>
>>  Makefile | 10 +-
>>  scripts/Makefile.spl |  6 +++---
>>  2 files changed, 8 insertions(+), 8 deletions(-)
>>
>> diff --git a/Makefile b/Makefile
>> index fa55c71..66e96cb 100644
>> --- a/Makefile
>> +++ b/Makefile
>> @@ -1015,10 +1015,10 @@ u-boot.spr: spl/u-boot-spl.img u-boot.img FORCE
>>
>>  ifneq ($(CONFIG_ARCH_SOCFPGA),)
>>  quiet_cmd_socboot = SOCBOOT $@
>> -cmd_socboot = catspl/u-boot-spl-dtb.sfp spl/u-boot-spl-dtb.sfp   \
>> - spl/u-boot-spl-dtb.sfp spl/u-boot-spl-dtb.sfp   \
>> - u-boot-dtb.img > $@ || rm -f $@
>> -u-boot-with-spl-dtb.sfp: spl/u-boot-spl-dtb.sfp u-boot-dtb.img FORCE
>> +cmd_socboot = catspl/u-boot-spl.sfp spl/u-boot-spl.sfp   \
>> + spl/u-boot-spl.sfp spl/u-boot-spl.sfp   \
>> + u-boot.img > $@ || rm -f $@
>> +u-boot-with-spl.sfp: spl/u-boot-spl.sfp u-boot.img FORCE
>>   $(call if_changed,socboot)
>>  endif
>>
>> @@ -1323,7 +1323,7 @@ spl/u-boot-spl: tools prepare $(if
>> $(CONFIG_OF_SEPARATE),dts/dt.dtb) spl/sunxi-spl.bin: spl/u-boot-spl
>>   @:
>>
>> -spl/u-boot-spl-dtb.sfp: spl/u-boot-spl
>> +spl/u-boot-spl.sfp: spl/u-boot-spl
>>   @:
>>
>>  spl/boot.bin: spl/u-boot-spl
>> diff --git a/scripts/Makefile.spl b/scripts/Makefile.spl
>> index 7bf471a..aa7091c 100644
>> --- a/scripts/Makefile.spl
>> +++ b/scripts/Makefile.spl
>> @@ -146,7 +146,7 @@ ALL-y += $(obj)/$(BOARD)-spl.bin
>>  endif
>>
>>  ifdef CONFIG_ARCH_SOCFPGA
>> -ALL-y+= $(obj)/$(SPL_BIN)-dtb.sfp
>> +ALL-y+= $(obj)/$(SPL_BIN).sfp
>>  endif
>>
>>  ifdef CONFIG_SUNXI
>> @@ -230,8 +230,8 @@ LDFLAGS_$(SPL_BIN) += -Ttext $(CONFIG_SPL_TEXT_BASE)
>>  endif
>>
>>  ifdef CONFIG_ARCH_SOCFPGA
>> -MKIMAGEFLAGS_$(SPL_BIN)-dtb.sfp = -T socfpgaimage
>> -$(obj)/$(SPL_BIN)-dtb.sfp: $(obj)/$(SPL_BIN)-dtb.bin FORCE
>> +MKIMAGEFLAGS_$(SPL_BIN).sfp = -T socfpgaimage
>> +$(obj)/$(SPL_BIN).sfp: $(obj)/$(SPL_BIN).bin FORCE
>>   $(call if_changed,mkimage)
>>  endif
>
> Best regards,
> Marek Vasut

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


Re: [U-Boot] [PATCH 2/7] fdt: Build a U-Boot binary without device tree

2016-01-25 Thread Simon Glass
Hi Stephen,

On 25 January 2016 at 14:14, Stephen Warren  wrote:
> On 01/25/2016 01:30 PM, Simon Glass wrote:
>>
>> At present u-boot.bin holds the plain U-Boot binary without the device
>> tree.
>> This is somewhat annoying since you need either u-boot.bin or
>> u-boot-dtb.bin
>> depending on whether device tree is used.
>>
>> Adjust the build such that u-boot.bin includes a device tree, and the
>> plain binary is in u-boot-nodtb.bin. For now u-boot-dtb.bin remains the
>> same.
>>
>> This should be acceptable since:
>>
>> - without OF_CONTROL, u-boot.bin still does not include a device tree
>> - with OF_CONTROL, u-boot-dtb.bin does not change
>>
>> The main impact is build systems which are set up to use u-boot.bin as
>> the output file and then add a device tree. These will have to change to
>> use
>> u-boot-nodtb.bin instead.
>
>
> That's probably going to annoy somebody. Have you put thought into how such
> a build system could auto-detect which file it should use in order to
> automatically adjust to the different file naming conventions of different
> U-Boot versions or branches? If not, this change will burden the operator of
> any tool or automated system with manually handling the difference by
> branching their own code or processes:-(

Well we cannot know what downstream build systems do, but I think my
reasoning is about right.

>
>> Adjust tegra rules so it continues to produce the correct files.
>
>
> I don't see anything Tegra-related in this patch. Perhaps patch 1/7 was
> included here in a previous version and the commit description not updated?

Yes, somehow I managed to send out the wrong branch. A few commit
messages are out of date but the code is the same. I'll fix it with v2
once I get some comments.

> Anyway, I think this patch doesn't affect me or Tegra's flashing tools. For
> reference, the tool currently uses the following files:
>
> u-boot
> spl/u-boot-spl
> u-boot-nodtb-tegra.bin
> u-boot.dtb
> u-boot-dtb-tegra.bin
>

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


Re: [U-Boot] [PATCH 4/7] tegra: Always build a boot image with the same filename

2016-01-25 Thread Stephen Warren

On 01/25/2016 01:30 PM, Simon Glass wrote:

Adjust the Makefile to build u-boot-tegra.bin which contains a device tree
if OF_CONTROL is enabled, and does not if not. This mirrors U-Boot's new
approach of using u-boot.bin to handle both cases.


For Tegra, we need:

u-boot-nodtb-tegra.bin
Required always.
This never includes a DTB.

u-boot-dtb-tegra.bin
Required if OF_CONTROL is enabled (which these days is always).
This always includes a DTB.

I believe this change violates those requirements since it makes both 
u-boot-nodtb-tegra.bin and u-boot-dtb-tegra.bin identical to 
u-boot-tegra.bin, and hence always include a DTB in practice.

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


Re: [U-Boot] [PATCH] arm: cache: Implement cache range check for v7

2016-01-25 Thread Albert ARIBAUD
Hello Tom,

On Mon, 25 Jan 2016 11:04:59 -0500, Tom Rini  wrote:
> On Sun, Jan 24, 2016 at 06:28:12PM +0100, Marek Vasut wrote:
> > On Monday, December 28, 2015 at 04:23:46 PM, Marek Vasut wrote:
> > > On Friday, December 11, 2015 at 05:36:15 AM, Marek Vasut wrote:
> > > > On Tuesday, December 01, 2015 at 06:23:17 PM, Marek Vasut wrote:
> > > > > On Monday, July 27, 2015 at 10:34:17 PM, Marek Vasut wrote:
> > > > > > Add code to aid tracking down cache alignment issues.
> > > > > > In case DEBUG is defined in the cache.c, this code will
> > > > > > check alignment of each attempt to flush/invalidate data
> > > > > > cache and print a warning if the alignment is incorrect.
> > > > > > If DEBUG is not defined, this code is optimized out.
> > > > > > 
> > > > > > Signed-off-by: Marek Vasut 
> > > > > > Cc: Dinh Nguyen 
> > > > > > Cc: Albert Aribaud 
> > > > > > Cc: Tom Rini 
> > > > > 
> > > > > Bump ?
> > > > 
> > > > Bump ?
> > > 
> > > Bump #3 ?
> > 
> > Bump #4 ?
> 
> Albert?

Sorry. Applied to u-boot-arm/master, thanks.

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


Re: [U-Boot] [PATCH 4/7] tegra: Always build a boot image with the same filename

2016-01-25 Thread Simon Glass
Hi Stephen,

On 25 January 2016 at 14:20, Stephen Warren  wrote:
> On 01/25/2016 01:30 PM, Simon Glass wrote:
>>
>> Adjust the Makefile to build u-boot-tegra.bin which contains a device tree
>> if OF_CONTROL is enabled, and does not if not. This mirrors U-Boot's new
>> approach of using u-boot.bin to handle both cases.
>
>
> For Tegra, we need:
>
> u-boot-nodtb-tegra.bin
> Required always.
> This never includes a DTB.
>
> u-boot-dtb-tegra.bin
> Required if OF_CONTROL is enabled (which these days is always).
> This always includes a DTB.
>
> I believe this change violates those requirements since it makes both
> u-boot-nodtb-tegra.bin and u-boot-dtb-tegra.bin identical to
> u-boot-tegra.bin, and hence always include a DTB in practice.

Yes, I think I was confused by the code at the top, as mentioned on
the other thread. Will await your response there and then take another
look.

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


Re: [U-Boot] [PATCH 1/7] tegra: Drop generation of -nodtb file with OF_CONTROL

2016-01-25 Thread Stephen Warren

On 01/25/2016 02:18 PM, Simon Glass wrote:

Hi Stephen,

On 25 January 2016 at 14:08, Stephen Warren  wrote:


On 01/25/2016 01:30 PM, Simon Glass wrote:


It seems clear that the intent is to generate u-boot-nodtb-tegra.bin only
when OF_CONTROL is not set. But due to the way the rules are set up, this
file is always generated. Fix this.



Nak, this file is used by our flashing tools, so needs to be kept around.

(As background, we take the separate u-boot-nodtb-tegra.bin and u-boot.dtb, 
modify u-boot.dtb to inject some changes to the environment such as 
over-writing bootcmd with flashing instructions etc., and then blend the two 
back together for download into RAM and subsequent execution).


OK. well in that case It think the code at the top is wrong:

# enable combined SPL/u-boot/dtb rules for tegra
ifneq ($(CONFIG_TEGRA),)
ifeq ($(CONFIG_SPL),y)
ifeq ($(CONFIG_OF_SEPARATE),y)
ALL-y += u-boot-dtb-tegra.bin
else
ALL-y += u-boot-nodtb-tegra.bin
endif
endif
endif

It should be this, right?

# enable combined SPL/u-boot/dtb rules for tegra
ifneq ($(CONFIG_TEGRA),)
ifeq ($(CONFIG_SPL),y)
ALL-y += u-boot-dtb-tegra.bin u-boot-nodtb-tegra.bin
endif
endif


That change looks almost fine, yes. I'd phrase it as follows:

ifneq ($(CONFIG_TEGRA),)
ifeq ($(CONFIG_SPL),y)
ALL-y += u-boot-nodtb-tegra.bin
ifeq ($(CONFIG_OF_SEPARATE),y)
ALL-y += u-boot-dtb-tegra.bin
endif
endif
endif

... so that u-boot-dtb-tegra.bin is only built when there's a DTB in use.

(or we could drop the most nested ifdef as you wrote, if we assume the 
value of CONFIG_OF_SEPARATE on Tegra)


Everything works and is safe right now since later Makefile says:

ifeq ($(CONFIG_OF_SEPARATE),y)
u-boot-dtb-tegra.bin: u-boot-nodtb-tegra.bin dts/dt.dtb FORCE
$(call if_changed,cat)
endif

So the if statement you're quoting is ensuring that the "final" or "most 
complete" file is built, and then the dependency chain ends up ensuring 
that all the others are built. As you say though, it would be good if 
ALL-y listed everything that users expect to use.

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


Re: [U-Boot] [U-Boot, 1/2] checkpatch: ignore request to use ether_addr_copy()

2016-01-25 Thread Tom Rini
On Fri, Nov 13, 2015 at 09:03:00AM -0700, Stephen Warren wrote:

> From: Stephen Warren 
> 
> The Linux kernel, from which checkpatch originates, contains function
> ether_addr_copy() to copy Ethernet MAC addresses, and checkpatch warns
> that it should be used in preference to memcpy() where appropriate.
> U-Boot doesn't contain ether_addr_copy(), so tell checkpatch not to issue
> this warning.
> 
> Signed-off-by: Stephen Warren 
> Reviewed-by: Marek Vasut 
> Acked-by: Joe Hershberger 
> Tested-by: Anand Moon 
> Reviewed-by: Anand Moon 

Applied to u-boot/master, thanks!

-- 
Tom


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


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

2016-01-25 Thread Tom Rini
On Mon, Jan 25, 2016 at 03:07:33PM +0100, Stefano Babic wrote:

> Hi Tom,
> 
> please pull from u-boot-imx, thanks !
> 
> The following changes since commit 12f229ea8f6c8e20f8fd07906eafc853c4c354a9:
> 
>   Merge git://git.denx.de/u-boot-fdt (2016-01-22 17:01:22 -0500)
> 
> are available in the git repository at:
> 
> 
>   git://www.denx.de/git/u-boot-imx.git master
> 
> for you to fetch changes up to ed3fb1fb22fb9e0e786c58c2d80cd030b89b9b7d:
> 
>   imx: spl: enable CONFIG_SPL_WATCHDOG_SUPPORT (2016-01-25 10:03:17 +0100)
> 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [U-Boot, v2, 2/2] ns16550: zap the rockchip serial compatible string

2016-01-25 Thread Tom Rini
On Mon, Dec 14, 2015 at 08:45:09PM +0800, Thomas Chou wrote:

> Zap the rockchip serial compatible string, because rockchip
> serial has "snps,dw-apb-uart" compatible string in the dts.
> 
> Signed-off-by: Thomas Chou 
> Acked-by: Simon Glass 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [U-Boot, v2, 1/2] ns16550: replace with binding files from Linux kernel

2016-01-25 Thread Tom Rini
On Mon, Dec 14, 2015 at 08:45:08PM +0800, Thomas Chou wrote:

> Replace ns16550.txt with binding files from Linux kernel. As suggested
> by Stephen Warren, we should keep the directory structure, filenames,
> and file content identical to the bindings in the Linux kernel.
> 
> Signed-off-by: Thomas Chou 
> Acked-by: Stephen Warren 
> 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
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [U-Boot, 2/2] Remove the cmd_ prefix from command files

2016-01-25 Thread Tom Rini
On Sun, Jan 17, 2016 at 08:53:52PM -0700, Simon Glass wrote:

> Now that they are in their own directory, we can remove this prefix.
> This makes it easier to find a file since the prefix does not get in the
> way.
> 
> Signed-off-by: Simon Glass 
> Reviewed-by: Bin Meng 
> Reviewed-by: Heiko Schocher 
> Acked-by: Stefan Roese 
> Acked-by: Przemyslaw Marczak 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [U-Boot, 1/2] Move all command code into its own directory

2016-01-25 Thread Tom Rini
On Sun, Jan 17, 2016 at 08:53:51PM -0700, Simon Glass wrote:

> There are a lot of unrelated files in common, including all of the commands.
> Moving them into their own directory makes them easier to find and is more
> logical.
> 
> Some commands include non-command code, such as cmd_scsi.c. This should be
> sorted out at some point so that the function can be enabled with or without
> the associated command.
> 
> Unfortunately, with m68k I get this error:
> 
> m68k:  +   M5329AFEE
> +arch/m68k/cpu/mcf532x/start.o: In function `_start':
> +arch/m68k/cpu/mcf532x/start.S:159:(.text+0x452): relocation truncated to 
> fit: R_68K_PC16 against symbol `board_init_f' defined in .text.board_init_f 
> section in common/built-in.o
> 
> I hope someone can shed some light on what this means. I hope it isn't
> depending on the position of code in the image.
> 
> Signed-off-by: Simon Glass 
> Reviewed-by: Bin Meng 
> Reviewed-by: Heiko Schocher 
> Acked-by: Stefan Roese 
> Acked-by: Przemyslaw Marczak 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [U-Boot, 2/2] arm, powerpc: Update cc-version tests to check for cc-name as well

2016-01-25 Thread Tom Rini
On Tue, Jan 19, 2016 at 08:39:02PM -0500, Tom Rini wrote:

> For compatibility clang will report some gcc version.  However since we
> are checking gcc versions in order to then fail to build, we should
> limit these tests only to when we are using gcc and not clang.
> 
> Signed-off-by: Tom Rini 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] bootm: fix size arg of flush_cache() in bootm_load_os().

2016-01-25 Thread Tom Rini
On Wed, Jan 20, 2016 at 02:07:39PM +0530, Purna Chandra Mandal wrote:

> Variable _load_end_ points to end address of uncompressed buffer
> (*not* uncomress_buffer_end / sizeof(ulong)), so multipling uncompressed
> size with sizeof(ulong) is grossly incorrect in flush_cache().
> It might lead to access of address beyond valid memory range and hang the CPU.
> 
> Tested on MIPS architecture by using compressed(gzip, lzma)
> and uncompressed uImage.
> 
> Signed-off-by: Purna Chandra Mandal 
> Reviewed-by: Simon Glass 
> Reviewed-by: Daniel Schwierzeck 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [U-Boot,1/2] kbuild: Add clang detection

2016-01-25 Thread Tom Rini
On Tue, Jan 19, 2016 at 08:39:01PM -0500, Tom Rini wrote:

> Adapted from:
> 
> >From 5631d9c429857194bd55d7bcd8fa5bdd1a9899a3 Mon Sep 17 00:00:00 2001
> From: Michal Marek 
> Date: Wed, 19 Aug 2015 17:36:41 +0200
> Subject: [PATCH 1/1] kbuild: Fix clang detection
> 
> We cannot detect clang before including the arch Makefile, because that
> can set the default cross compiler. We also cannot detect clang after
> including the arch Makefile, because powerpc wants to know about clang.
> Solve this by using an deferred variable. This costs us a few shell
> invocations, but this is only a constant number.
> 
> Reported-by: Behan Webster 
> Reported-by: Anton Blanchard 
> Signed-off-by: Michal Marek 
> 
> in the Linux kernel.
> 
> This will allow us to make better decisions about when to run tests
> later on for gcc features.
> 
> Signed-off-by: Tom Rini 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] part: Drop duplication declaration of block_dev_desc_t

2016-01-25 Thread Tom Rini
On Wed, Jan 20, 2016 at 08:12:07PM -0700, Simon Glass wrote:

> This is already defined in ide.h, which part.h includes. So we don't need
> the duplicate typedef. At least with my old blackfin gcc 4.3.5 tool chain,
> this causes an error.
> 
> Signed-off-by: Simon Glass 
> Reviewed-by: Bin Meng 
> Reviewed-by: Andreas Bießmann 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] OMAP: Define CONFIG_OMAP3_GPIO_6 on omap3_logic

2016-01-25 Thread Tom Rini
On Fri, Jan 22, 2016 at 04:40:58AM -0600, Adam Ford wrote:

> Since we are manipulating GPIO 189 to determine the board type, we
> need to enable the GPIO Bank 6.
> 
> 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
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [U-Boot, v2] common/console.c: Remove unused inline functions

2016-01-25 Thread Tom Rini
On Thu, Jan 21, 2016 at 09:10:26AM -0500, Tom Rini wrote:

> clang-3.8 reports that these functions are unused, remove them.  As this
> is the last part of CONFIG_MODEM_SUPPORT_DEBUG, drop that from README.
> 
> Reviewed-by: Bin Meng 
> Signed-off-by: Tom Rini 

Applied to u-boot/master, thanks!

-- 
Tom


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


  1   2   >