[U-Boot] [PATCH 3/6] net: phy: realtek: Use generic genphy_parse_link() for RTL8211E

2016-02-13 Thread Michal Simek
The problem with current implementation is that SPDDONE bit is 1
but link bit is zero. That's why phydev->link is setup to 0
which ending up in driver failure that link is not up.

Log:
Zynq> dhcp
ethernet@e000b000 Waiting for PHY auto negotiation to complete...
done
ethernet@e000b000: No link.

There is at least 1ms delay between spddone bit and link up.

Use genphy_read_status() instead of realtek implemenation which is
working with page 11. Linux driver is also using generic implementation.

Signed-off-by: Michal Simek 
---

 drivers/net/phy/realtek.c | 10 +-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/net/phy/realtek.c b/drivers/net/phy/realtek.c
index bba48da4099f..259a87fcc59e 100644
--- a/drivers/net/phy/realtek.c
+++ b/drivers/net/phy/realtek.c
@@ -203,6 +203,14 @@ static int rtl8211x_startup(struct phy_device *phydev)
return 0;
 }
 
+static int rtl8211e_startup(struct phy_device *phydev)
+{
+   genphy_update_link(phydev);
+   genphy_parse_link(phydev);
+
+   return 0;
+}
+
 static int rtl8211f_startup(struct phy_device *phydev)
 {
/* Read the Status (2x to make sure link is right) */
@@ -230,7 +238,7 @@ static struct phy_driver RTL8211E_driver = {
.mask = 0xff,
.features = PHY_GBIT_FEATURES,
.config = _config,
-   .startup = _startup,
+   .startup = _startup,
.shutdown = _shutdown,
 };
 
-- 
1.9.1

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


[U-Boot] [PATCH 1/6] net: gem: Add support for reading MAC from I2C EEPROM

2016-02-13 Thread Michal Simek
Add support for reading MAC address from I2C EEPROM.

Signed-off-by: Michal Simek 
---

 drivers/net/zynq_gem.c | 16 
 1 file changed, 16 insertions(+)

diff --git a/drivers/net/zynq_gem.c b/drivers/net/zynq_gem.c
index b3821c31a91d..ace60c901cb5 100644
--- a/drivers/net/zynq_gem.c
+++ b/drivers/net/zynq_gem.c
@@ -627,6 +627,21 @@ static int zynq_gem_remove(struct udevice *dev)
return 0;
 }
 
+static int zynq_gem_read_rom_hwaddr(struct udevice *dev)
+{
+#if defined(CONFIG_ZYNQ_GEM_EEPROM_ADDR) && \
+defined(CONFIG_ZYNQ_GEM_I2C_MAC_OFFSET)
+   struct eth_pdata *pdata = dev_get_platdata(dev);
+
+   if (eeprom_read(CONFIG_ZYNQ_GEM_EEPROM_ADDR,
+   CONFIG_ZYNQ_GEM_I2C_MAC_OFFSET,
+   pdata->enetaddr, ARRAY_SIZE(pdata->enetaddr)))
+   printf("EEPROM MAC address read failed\n");
+#endif
+   return 0;
+}
+
+
 static const struct eth_ops zynq_gem_ops = {
.start  = zynq_gem_init,
.send   = zynq_gem_send,
@@ -634,6 +649,7 @@ static const struct eth_ops zynq_gem_ops = {
.free_pkt   = zynq_gem_free_pkt,
.stop   = zynq_gem_halt,
.write_hwaddr   = zynq_gem_setup_mac,
+   .read_rom_hwaddr= zynq_gem_read_rom_hwaddr,
 };
 
 static int zynq_gem_ofdata_to_platdata(struct udevice *dev)
-- 
1.9.1

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


[U-Boot] [PATCH 2/6] ARM: zynq: zybo: Enabling reading MAC address from EEPROM

2016-02-13 Thread Michal Simek
Zybo has on board I2C EEPROM which contains preprogrammed MAC address.

Signed-off-by: Michal Simek 
---

 include/configs/zynq_zybo.h | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/include/configs/zynq_zybo.h b/include/configs/zynq_zybo.h
index c53ba79d48b0..644d462c01c9 100644
--- a/include/configs/zynq_zybo.h
+++ b/include/configs/zynq_zybo.h
@@ -18,6 +18,12 @@
 #define CONFIG_ZYNQ_USB
 #define CONFIG_ZYNQ_SDHCI0
 #define CONFIG_ZYNQ_BOOT_FREEBSD
+#define CONFIG_ZYNQ_I2C0
+#define CONFIG_ZYNQ_I2C1
+#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1
+#define CONFIG_CMD_EEPROM
+#define CONFIG_ZYNQ_GEM_EEPROM_ADDR0x50
+#define CONFIG_ZYNQ_GEM_I2C_MAC_OFFSET 0xFA
 
 /* Define ZYBO PS Clock Frequency to 50MHz */
 #define CONFIG_ZYNQ_PS_CLK_FREQ5000UL
-- 
1.9.1

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


[U-Boot] [PATCH 4/6] ARM: zynq: Enable Realtek phys by default

2016-02-13 Thread Michal Simek
This phy is available at Zybo board.

Signed-off-by: Michal Simek 
---

 include/configs/zynq-common.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/configs/zynq-common.h b/include/configs/zynq-common.h
index e8c3ef0c3872..7b42a00b9e75 100644
--- a/include/configs/zynq-common.h
+++ b/include/configs/zynq-common.h
@@ -50,6 +50,7 @@
 # define CONFIG_MII
 # define CONFIG_SYS_FAULT_ECHO_LINK_DOWN
 # define CONFIG_PHY_MARVELL
+# define CONFIG_PHY_REALTEK
 # define CONFIG_BOOTP_SERVERIP
 # define CONFIG_BOOTP_BOOTPATH
 # define CONFIG_BOOTP_GATEWAY
-- 
1.9.1

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


[U-Boot] [PATCH 6/6] ARM: zynq: Enable EDID for zybo

2016-02-13 Thread Michal Simek
Zybo contains on board HDMI that's why enable EDID.
Doing it via config because zynq i2c driver hasn't been moved to DM yet
and enabling via Kconfig requires DM_I2C.
This will be moved that driver is moved to DM.

Signed-off-by: Michal Simek 
---

Currently the biggest problem is EEPROM support with DM together.

Log for zybo:
Zynq> i2c dev 1
Setting bus to 1
Zynq> i2c probe
Valid chip addresses: 50
Zynq> i2c edid 50
EDID version: 1.3
Product ID code: 05cd
Manufacturer: SAM
Serial number: 30303033
Manufactured in week: 42 year: 2010
Video input definition: digital signal, voltage level 0
Monitor is non-RGB
Maximum visible display size: 16 cm x 9 cm
Power management features: active off, no suspend, no standby
Estabilished timings:
640x480 60 Hz (VGA)
800x600 56 Hz (VESA)
800x600 60 Hz (VESA)
1024x76860 Hz (VESA)
Standard timings:
1600x1200   60 Hz
1280x1024   60 Hz
1280x96060 Hz
1280x80060 Hz
1440x90060 Hz
1680x1050   60 Hz
1920x1080   60 Hz (detailed)
1280x72060 Hz (detailed)
Monitor range limits, horizontal sync: 30-81 kHz, vertical refresh:
50-60 Hz, max pixel clock: 170 MHz
Monitor name: SyncMaster

---
 include/configs/zynq_zybo.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/configs/zynq_zybo.h b/include/configs/zynq_zybo.h
index 644d462c01c9..3db3c13e8a3e 100644
--- a/include/configs/zynq_zybo.h
+++ b/include/configs/zynq_zybo.h
@@ -24,6 +24,8 @@
 #define CONFIG_CMD_EEPROM
 #define CONFIG_ZYNQ_GEM_EEPROM_ADDR0x50
 #define CONFIG_ZYNQ_GEM_I2C_MAC_OFFSET 0xFA
+#define CONFIG_DISPLAY
+#define CONFIG_I2C_EDID
 
 /* Define ZYBO PS Clock Frequency to 50MHz */
 #define CONFIG_ZYNQ_PS_CLK_FREQ5000UL
-- 
1.9.1

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


[U-Boot] [PATCH 5/6] ARM: zynq: Add reset-gpio property for USB on Zybo

2016-02-13 Thread Michal Simek
DTS syncup with Linux kernel.
Add missing reset-gpio property.

Signed-off-by: Michal Simek 
---

This patch is in queue to next kernel version

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

diff --git a/arch/arm/dts/zynq-zybo.dts b/arch/arm/dts/zynq-zybo.dts
index fbbb8911910b..d04e9625d29e 100644
--- a/arch/arm/dts/zynq-zybo.dts
+++ b/arch/arm/dts/zynq-zybo.dts
@@ -31,8 +31,9 @@
};
 
usb_phy0: phy0 {
-   compatible = "usb-nop-xceiv";
#phy-cells = <0>;
+   compatible = "usb-nop-xceiv";
+   reset-gpios = < 46 1>;
};
 };
 
-- 
1.9.1

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


[U-Boot] [PATCH] ARM: zynq: Wire-up saving environment to QSPI

2016-02-13 Thread Michal Simek
Extend options for saving variables to QSPI.

Signed-off-by: Michal Simek 
---

 include/configs/zynq-common.h | 4 
 1 file changed, 4 insertions(+)

diff --git a/include/configs/zynq-common.h b/include/configs/zynq-common.h
index 73b7f2072bc6..1eee8a0667dc 100644
--- a/include/configs/zynq-common.h
+++ b/include/configs/zynq-common.h
@@ -198,7 +198,11 @@
 /* Environment */
 #ifndef CONFIG_ENV_IS_NOWHERE
 # ifndef CONFIG_SYS_NO_FLASH
+/* Environment in NOR flash */
 #  define CONFIG_ENV_IS_IN_FLASH
+# elif defined(CONFIG_ZYNQ_QSPI)
+/* Environment in Serial Flash */
+#  define CONFIG_ENV_IS_IN_SPI_FLASH
 # elif defined(CONFIG_SYS_NO_FLASH)
 #  define CONFIG_ENV_IS_NOWHERE
 # endif
-- 
1.9.1

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


[U-Boot] oddity(?) in selection of FCC Ethernet index in 2014 version of u-boot

2016-02-13 Thread Robert P. J. Day
  at the moment, i'm trying to get a minimal u-boot running on an  
MPC8280-based
target board (please, no jokes), and for the sake of expediency, i  
just used git
to check out a version of u-boot just before it removed the definition  
of a target

board (MPC8260ads) that seems moderately close to what i'm after. so i checked
out git commit 373a9788f05dfab47e01badc046459dead163104, which is dated May of
2014 to see what I could do with that, and I found the following oddity(?).

  I actually selected the (8280-based) PQ2FADS board:

  $ make PQ2FADS_config

and started tweaking until i got to configuring Ethernet support on FCC. the
board definition file MPC8260ADS.h contains the following snippet for  
selecting

Ethernet on FCC:

#ifdef CONFIG_ETHER_ON_FCC

#define CONFIG_ETHER_INDEX  2   /* which SCC/FCC channel for  
ethernet */


#if   CONFIG_ETHER_INDEX == 1

# define CONFIG_SYS_PHY_ADDR0
# define CONFIG_SYS_CMXFCR_VALUE1   (CMXFCR_RF1CS_CLK11 |  
CMXFCR_TF1CS_CLK10)
# define CONFIG_SYS_CMXFCR_MASK1(CMXFCR_FC1 | CMXFCR_RF1CS_MSK  
| CMXFCR_TF1CS_MSK)


#elif CONFIG_ETHER_INDEX == 2

#if CONFIG_ADSTYPE == CONFIG_SYS_8272ADS/* RxCLK is CLK15,  
TxCLK is CLK16 */

# define CONFIG_SYS_PHY_ADDR3
# define CONFIG_SYS_CMXFCR_VALUE2   (CMXFCR_RF2CS_CLK15 |  
CMXFCR_TF2CS_CLK16)

#else   /* RxCLK is CLK13, TxCLK is CLK14 */
# define CONFIG_SYS_PHY_ADDR0
# define CONFIG_SYS_CMXFCR_VALUE2   (CMXFCR_RF2CS_CLK13 |  
CMXFCR_TF2CS_CLK14)

#endif /* CONFIG_ADSTYPE == CONFIG_SYS_8272ADS */

# define CONFIG_SYS_CMXFCR_MASK2(CMXFCR_FC2 | CMXFCR_RF2CS_MSK  
| CMXFCR_TF2CS_MSK)


#endif  /* CONFIG_ETHER_INDEX */

  fair enough ... the above clearly implies that Ethernet on FCC will be
defined by the values of the two variables:

  CONFIG_ETHER_ON_FCC
  CONFIG_ETHER_INDEX

but here's the puzzler -- this appears to be implemented by the source file
arch/powerpc/cpu/mpc8260/ether_fcc.c (it is in fact compiled), but that file
contains the snippet:

#if defined(CONFIG_ETHER_ON_FCC) && defined(CONFIG_CMD_NET)

static struct ether_fcc_info_s
{
int ether_index;
int proff_enet;
ulong cpm_cr_enet_sblock;
ulong cpm_cr_enet_page;
ulong cmxfcr_mask;
ulong cmxfcr_value;
}
ether_fcc_info[] =
{
#ifdef CONFIG_ETHER_ON_FCC1
{
0,
PROFF_FCC1,
CPM_CR_FCC1_SBLOCK,
CPM_CR_FCC1_PAGE,
CONFIG_SYS_CMXFCR_MASK1,
CONFIG_SYS_CMXFCR_VALUE1
},
#endif

#ifdef CONFIG_ETHER_ON_FCC2
... snip ...

 note that the board header file sets CONFIG_ETHER_INDEX to identify the
channel, but that source file checks the variables CONFIG_ETHER_ON_FCC1,
CONFIG_ETHER_ON_FCC2 and so on, which are not set in the board definition
file.

  i took a look and, back then, some boards defined CONFIG_ETHER_ON_FCCn,
while others set CONFIG_ETHER_INDEX. it seems that doing it that second way
could not possibly have worked. i'm just writing this off to bit-rot in that
nobody really looked at those old boards for a long time. but am i right in
concluding that using CONFIG_ETHER_INDEX to select the FCC channel could not
possibly have worked? or am i missing something?

rday

p.s. to be more precise about the target board, a group of us are porting
linux to the Mitel 3300 AX Controller. so if you've been down that or a
similar road, i'd love to hear from you.


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


[U-Boot] Compilation errors after enabling the flash support

2016-02-13 Thread Srinivasa_Nagalla
Dell - Internal Use - Confidential
Hi,

I am developing U-Boot for ARM CPU and enabled FLASH support.
During the compilation getting the following error -

arch/arm/lib/libarm.o: In function `board_init_r':
/sites/eqx/work/swdrivers03-1/snagalla/Omsai_STOMP_40G_DEV/Boot/Bootflash/STOMP_40G/u-boot/arch/arm/lib/board.c:922:
 undefined reference to `flash_init'
common/libcommon.o: In function `addr2info':
/sites/eqx/work/swdrivers03-1/snagalla/Omsai_STOMP_40G_DEV/Boot/Bootflash/STOMP_40G/u-boot/common/flash.c:126:
 undefined reference to `flash_info'
common/libcommon.o: In function `flash_write':
/sites/eqx/work/swdrivers03-1/snagalla/Omsai_STOMP_40G_DEV/Boot/Bootflash/STOMP_40G/u-boot/common/flash.c:181:
 undefined reference to `write_buff'
/tools/vendor/bcm/iproc-3.4.8-RC2/usr/bin/arm-linux-ld.bfd: BFD (Broadcom 
Linux) 2.21.1 assertion fail elf32-arm.c:12241
/tools/vendor/bcm/iproc-3.4.8-RC2/usr/bin/arm-linux-ld.bfd: BFD (Broadcom 
Linux) 2.21.1 assertion fail elf32-arm.c:12241
/tools/vendor/bcm/iproc-3.4.8-RC2/usr/bin/arm-linux-ld.bfd: BFD (Broadcom 
Linux) 2.21.1 assertion fail elf32-arm.c:12478
/bin/sh: line 1: 28479 Segmentation fault  (core dumped) 
/tools/vendor/bcm/iproc-3.4.8-RC2/usr/bin/arm-linux-ld.bfd -pie -T 
/sites/eqx/work/swdrivers03-1/snagalla/Omsai_STOMP_40G_DEV/Boot/Bootflash/STOMP_40G/u-boot/build-output/u-boot.lds
 -Bstatic -Ttext 0x1E00 $UNDEF_SYM

When I check the code the respective flash.h is included. But still seeing the 
error.
Any inputs are highly appreciated...

Thanks & Regards,
Srinivasa Rao Nagalla

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


[U-Boot] [RFC PATCH v4 2/3] common: Convert ulong to phys_addr_t for image addresses

2016-02-13 Thread York Sun
When dealing with image addresses, ulong has been used. Some files
are used by both host and target. It is OK for the target, but not
always enough for host tools including mkimage. This patch replaces
"ulong" with "phys_addr_t" to make sure addresses are correct for
both the target and the host.

This issue was found on 32-bit host when compiling for 64-bit target
to support images with address higher than 32-bit space.

Signed-off-by: York Sun 

---

Changes in v4:
  New patch, separated from fixing FIT image.

Changes in v3: None
Changes in v2: None

 arch/powerpc/lib/bootm.c |4 ++--
 cmd/ximg.c   |9 +
 common/bootm.c   |   21 +++--
 common/bootm_os.c|   14 --
 common/image-android.c   |6 +++---
 common/image-fdt.c   |   16 
 common/image-fit.c   |   27 ++-
 common/image.c   |   17 ++---
 include/bootm.h  |6 +++---
 include/image.h  |   30 ++
 tools/default_image.c|2 +-
 11 files changed, 83 insertions(+), 69 deletions(-)

diff --git a/arch/powerpc/lib/bootm.c b/arch/powerpc/lib/bootm.c
index ef15e7a..794382a 100644
--- a/arch/powerpc/lib/bootm.c
+++ b/arch/powerpc/lib/bootm.c
@@ -47,7 +47,7 @@ static void boot_jump_linux(bootm_headers_t *images)
 #endif
 
kernel = (void (*)(bd_t *, ulong, ulong, ulong,
-  ulong, ulong, ulong))images->ep;
+  ulong, ulong, ulong))(uintptr_t)images->ep;
debug ("## Transferring control to Linux (at address %08lx) ...\n",
(ulong)kernel);
 
@@ -335,7 +335,7 @@ void boot_jump_vxworks(bootm_headers_t *images)
WATCHDOG_RESET();
 
((void (*)(void *, ulong, ulong, ulong,
-   ulong, ulong, ulong))images->ep)(images->ft_addr,
+   ulong, ulong, ulong))(uintptr_t)images->ep)(images->ft_addr,
0, 0, EPAPR_MAGIC, getenv_bootm_mapsize(), 0, 0);
 }
 #endif
diff --git a/cmd/ximg.c b/cmd/ximg.c
index d033c15..70d6d14 100644
--- a/cmd/ximg.c
+++ b/cmd/ximg.c
@@ -33,7 +33,8 @@ do_imgextract(cmd_tbl_t * cmdtp, int flag, int argc, char * 
const argv[])
 {
ulong   addr = load_addr;
ulong   dest = 0;
-   ulong   data, len;
+   phys_addr_t data;
+   ulong   len;
int verify;
int part = 0;
 #if defined(CONFIG_IMAGE_FORMAT_LEGACY)
@@ -173,7 +174,7 @@ do_imgextract(cmd_tbl_t * cmdtp, int flag, int argc, char * 
const argv[])
return 1;
}
 
-   data = (ulong)fit_data;
+   data = (phys_addr_t)(uintptr_t)fit_data;
len = (ulong)fit_len;
break;
 #endif
@@ -205,14 +206,14 @@ do_imgextract(cmd_tbl_t * cmdtp, int flag, int argc, char 
* const argv[])
}
 #else  /* !(CONFIG_HW_WATCHDOG || CONFIG_WATCHDOG) */
printf("   Loading part %d ... ", part);
-   memmove((char *) dest, (char *)data, len);
+   memmove((char *)dest, (char *)(uintptr_t)data, len);
 #endif /* CONFIG_HW_WATCHDOG || CONFIG_WATCHDOG */
break;
 #ifdef CONFIG_GZIP
case IH_COMP_GZIP:
printf("   Uncompressing part %d ... ", part);
if (gunzip((void *) dest, unc_len,
-  (uchar *) data, ) != 0) {
+  (uchar *)(uintptr_t)data, ) != 0) {
puts("GUNZIP ERROR - image not loaded\n");
return 1;
}
diff --git a/common/bootm.c b/common/bootm.c
index 99d574d..785858c 100644
--- a/common/bootm.c
+++ b/common/bootm.c
@@ -43,7 +43,7 @@ DECLARE_GLOBAL_DATA_PTR;
 
 static const void *boot_get_kernel(cmd_tbl_t *cmdtp, int flag, int argc,
   char * const argv[], bootm_headers_t *images,
-  ulong *os_data, ulong *os_len);
+  phys_addr_t *os_data, ulong *os_len);
 
 #ifdef CONFIG_LMB
 static void boot_start_lmb(bootm_headers_t *images)
@@ -325,9 +325,9 @@ static int handle_decomp_error(int comp_type, size_t 
uncomp_size,
return BOOTM_ERR_RESET;
 }
 
-int bootm_decomp_image(int comp, ulong load, ulong image_start, int type,
-  void *load_buf, void *image_buf, ulong image_len,
-  uint unc_len, ulong *load_end)
+int bootm_decomp_image(int comp, phys_addr_t load, phys_addr_t image_start,
+  int type, void *load_buf, void *image_buf,
+  ulong image_len, uint unc_len, ulong *load_end)
 {
int ret = 0;
 
@@ -767,7 +767,7 @@ static image_header_t *image_get_kernel(ulong img_addr, int 
verify)
 
 /**
  * boot_get_kernel - find 

[U-Boot] How to boot bare board binary from U-Boot>

2016-02-13 Thread veerendranathj
Hello,

How can we boot independent bare board binary(not standalone binary which
runs using U-Boot environment and not linux kernel) from U-Boot. My
requirement is to reinitialize the board and drivers using my binary...

I can replace the U-Boot in the boot medium(here NOR Flash) with my binary
but my requirement is to not removing the U-boot from NOR flash and I should 
load my binary from LAN network using "tftp" command.

Thanks and Regards,
Veerendranath



--
View this message in context: 
http://u-boot.10912.n7.nabble.com/How-to-boot-bare-board-binary-from-U-Boot-tp245739.html
Sent from the U-Boot mailing list archive at Nabble.com.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [RFC PATCH v4 0/3] Enable FIT image to be loaded beyond 32-bit space

2016-02-13 Thread York Sun
Please comment on these changes. Don't apply yet. I think there may
be compiling warnings on some platforms. Want to get some feedback
before going too far on this path.

This set fixes compiling warnings for sandbox on 32-bit host (Ubuntu),
convert ulong to phys_addr_t for image handling. The purpose is to fix
image addresses so FIT image can be put beyond 32-bit space.
The challenge is to keep 32-bit host tool (eg mkimage) working. Using
unsigned long long as phys_addr_t for host is the trick.

This patchset is only tested on powerpc and arm for selected platforms.
More test (at least compiling) is needed for other platforms.

Changes in v4:
  New patch to fix compiling warnings for sandbox built on 32-bit host
  Still need to change CONFIG_SANDBOX_BITS_PER_LONG to 32 to avoid
  these warnings
  include/asm-generic/bitops/__fls.h:17:2: warning: left shift
   count >= width of type [enabled by default]
  include/asm-generic/bitops/__fls.h:19:3: warning: left shift
   count >= width of type [enabled by default]
  include/asm-generic/bitops/__fls.h:22:2: warning: left shift
   count >= width of type [enabled by default]
  include/asm-generic/bitops/__fls.h:26:2: warning: left shift
   count >= width of type [enabled by default]
  include/asm-generic/bitops/__fls.h:30:2: warning: left shift
   count >= width of type [enabled by default]
  include/asm-generic/bitops/__fls.h:34:2: warning: left shift
   count >= width of type [enabled by default]
  include/asm-generic/bitops/__fls.h:38:2: warning: left shift
   count >= width of type [enabled by default]
  New patch, separated from fixing FIT image.
  Separate ulong to phys_addr_t change to another patch.

Changes in v3:
  Define PRIpa for host and target in common/image-fit.c so printf works
  properly for 32-, 64-bit targets and host tools.

Changes in v2:
  Make a common function for both load and entry addresses.
  Simplify calculation of addresses in a similar way as fdtdec_get_number()
  fdtdec_get_number() is not used, or too many files need to be included
and/or twisted for host tool
  Continue to use %08llx for print format for load and entry addresses
because %pa does not always work for host tool (mkimage)

York Sun (3):
  sandbox: Fix compiling warning on 32-bit host
  common: Convert ulong to phys_addr_t for image addresses
  common: Fix load and entry addresses in FIT image

 arch/powerpc/lib/bootm.c |4 +-
 arch/sandbox/cpu/cpu.c   |3 +-
 arch/sandbox/include/asm/types.h |4 +-
 arch/sandbox/lib/bootm.c |3 +-
 arch/sandbox/lib/pci_io.c|2 +-
 cmd/bootm.c  |4 +-
 cmd/lzmadec.c|5 ++-
 cmd/ximg.c   |9 +++--
 common/bootm.c   |   21 +-
 common/bootm_os.c|   14 ---
 common/image-android.c   |6 +--
 common/image-fdt.c   |   16 
 common/image-fit.c   |   81 +-
 common/image.c   |   17 
 disk/part_efi.c  |2 +-
 include/bootm.h  |6 +--
 include/image.h  |   36 +++--
 lib/hashtable.c  |2 +-
 tools/default_image.c|2 +-
 19 files changed, 134 insertions(+), 103 deletions(-)

-- 
1.7.9.5

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


Re: [U-Boot] How to boot bare board binary from U-Boot>

2016-02-13 Thread Michael Zimmermann
Hi

you can either run the binary directly from memory or you can build a uboot
image from your raw binary using the mkimage command.

Michael

On Fri, Feb 12, 2016 at 10:32 AM, veerendranathj 
wrote:

> Hello,
>
> How can we boot independent bare board binary(not standalone binary which
> runs using U-Boot environment and not linux kernel) from U-Boot. My
> requirement is to reinitialize the board and drivers using my binary...
>
> I can replace the U-Boot in the boot medium(here NOR Flash) with my binary
> but my requirement is to not removing the U-boot from NOR flash and I
> should
> load my binary from LAN network using "tftp" command.
>
> Thanks and Regards,
> Veerendranath
>
>
>
> --
> View this message in context:
> http://u-boot.10912.n7.nabble.com/How-to-boot-bare-board-binary-from-U-Boot-tp245739.html
> Sent from the U-Boot mailing list archive at Nabble.com.
> ___
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
>
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] sunxi: H3: Add support for the host usb-phys

2016-02-13 Thread Chen-Yu Tsai
Hi,

On Wed, Feb 10, 2016 at 5:25 PM, Hans de Goede  wrote:
> From: Jelle van der Waa 
>
> Add support for phy 1-3.
>
> Signed-off-by: Jelle van der Waa 
> [hdego...@redhat.com: use setclrbits_le32 instead of read-modify-write]
> Signed-off-by: Hans de Goede 
> ---
>  arch/arm/cpu/armv7/sunxi/usb_phy.c| 35 
> +--
>  arch/arm/include/asm/arch-sunxi/clock_sun6i.h | 22 +
>  arch/arm/include/asm/arch-sunxi/cpu_sun4i.h   |  8 ++
>  configs/orangepi_pc_defconfig |  1 +
>  configs/orangepi_plus_defconfig   |  1 +
>  drivers/usb/host/ehci-sunxi.c | 14 +--
>  drivers/usb/host/ohci-sunxi.c | 18 +++---
>  include/configs/sun8i.h   |  6 -
>  8 files changed, 81 insertions(+), 24 deletions(-)
>
> diff --git a/arch/arm/cpu/armv7/sunxi/usb_phy.c 
> b/arch/arm/cpu/armv7/sunxi/usb_phy.c
> index 19bb5a1..6ac96cc 100644
> --- a/arch/arm/cpu/armv7/sunxi/usb_phy.c
> +++ b/arch/arm/cpu/armv7/sunxi/usb_phy.c
> @@ -31,6 +31,9 @@
>  #define SUNXI_EHCI_AHB_INCRX_ALIGN_EN  (1 << 8)
>  #define SUNXI_EHCI_ULPI_BYPASS_EN  (1 << 0)
>
> +#define REG_PHY_UNK_H3 0x420
> +#define REG_PMU_UNK_H3 0x810
> +
>  static struct sunxi_usb_phy {
> int usb_rst_mask;
> int gpio_vbus;
> @@ -39,19 +42,30 @@ static struct sunxi_usb_phy {
> int id;
> int init_count;
> int power_on_count;
> +   int base;
>  } sunxi_usb_phy[] = {
> {
> .usb_rst_mask = CCM_USB_CTRL_PHY0_RST | CCM_USB_CTRL_PHY0_CLK,
> .id = 0,
> +   .base = SUNXI_USB0_BASE,
> },
> {
> .usb_rst_mask = CCM_USB_CTRL_PHY1_RST | CCM_USB_CTRL_PHY1_CLK,
> .id = 1,
> +   .base = SUNXI_USB1_BASE,
> },
>  #if CONFIG_SUNXI_USB_PHYS >= 3
> {
> .usb_rst_mask = CCM_USB_CTRL_PHY2_RST | CCM_USB_CTRL_PHY2_CLK,
> .id = 2,
> +   .base = SUNXI_USB2_BASE,
> +   },
> +#endif
> +#if CONFIG_SUNXI_USB_PHYS >= 4
> +   {
> +   .usb_rst_mask = CCM_USB_CTRL_PHY3_RST | CCM_USB_CTRL_PHY3_CLK,
> +   .id = 3,
> +   .base = SUNXI_USB3_BASE,
> }
>  #endif
>  };
> @@ -114,6 +128,15 @@ static void usb_phy_write(struct sunxi_usb_phy *phy, int 
> addr,
> }
>  }
>
> +#if defined CONFIG_MACH_SUN8I_H3
> +static void sunxi_usb_phy_config(struct sunxi_usb_phy *phy)
> +{
> +   if (phy->id == 0)
> +   clrbits_le32(SUNXI_USBPHY_BASE + REG_PHY_UNK_H3, 0x01);
> +
> +   clrbits_le32(phy->base + REG_PMU_UNK_H3, 0x02);
> +}
> +#else
>  static void sunxi_usb_phy_config(struct sunxi_usb_phy *phy)
>  {
> /* The following comments are machine
> @@ -136,16 +159,14 @@ static void sunxi_usb_phy_config(struct sunxi_usb_phy 
> *phy)
>
> return;
>  }
> +#endif
>
> -static void sunxi_usb_phy_passby(int index, int enable)
> +static void sunxi_usb_phy_passby(struct sunxi_usb_phy *phy, int enable)
>  {
> unsigned long bits = 0;
> void *addr;
>
> -   if (index == 1)
> -   addr = (void *)SUNXI_USB1_BASE + SUNXI_USB_PMU_IRQ_ENABLE;
> -   else
> -   addr = (void *)SUNXI_USB2_BASE + SUNXI_USB_PMU_IRQ_ENABLE;
> +   addr = (void *)phy->base + SUNXI_USB_PMU_IRQ_ENABLE;

I'd suggest moving this into struct sunxi_usb_phy itself, i.e. have
sunxi_usb_phy
record the phy register base, instead of the whole usb controller block, kind of
like what we have for the kernel sun4i-a10-usb-phy bindings. This
would help with
moving the phy driver to device model / DT. But it would add more modifications.
It's up to you though.

>
> bits = SUNXI_EHCI_AHB_ICHR8_EN |
> SUNXI_EHCI_AHB_INCR4_BURST_EN |
> @@ -181,7 +202,7 @@ void sunxi_usb_phy_init(int index)
> sunxi_usb_phy_config(phy);
>
> if (phy->id != 0)
> -   sunxi_usb_phy_passby(index, SUNXI_USB_PASSBY_EN);
> +   sunxi_usb_phy_passby(phy, SUNXI_USB_PASSBY_EN);
>  }
>
>  void sunxi_usb_phy_exit(int index)
> @@ -194,7 +215,7 @@ void sunxi_usb_phy_exit(int index)
> return;
>
> if (phy->id != 0)
> -   sunxi_usb_phy_passby(index, !SUNXI_USB_PASSBY_EN);
> +   sunxi_usb_phy_passby(phy, !SUNXI_USB_PASSBY_EN);
>
> clrbits_le32(>usb_clk_cfg, phy->usb_rst_mask);
>  }
> diff --git a/arch/arm/include/asm/arch-sunxi/clock_sun6i.h 
> b/arch/arm/include/asm/arch-sunxi/clock_sun6i.h
> index 554d858..1655f10 100644
> --- a/arch/arm/include/asm/arch-sunxi/clock_sun6i.h
> +++ b/arch/arm/include/asm/arch-sunxi/clock_sun6i.h
> @@ -229,8 +229,18 @@ struct sunxi_ccm_reg {
>  /* ahb_gate0 offsets */
>  #define AHB_GATE_OFFSET_USB_OHCI1  30
>  #define AHB_GATE_OFFSET_USB_OHCI0  29
> +#ifdef 

Re: [U-Boot] [PATCH 1/6] net: gem: Add support for reading MAC from I2C EEPROM

2016-02-13 Thread Bin Meng
Hi Michal,

On Sat, Feb 13, 2016 at 6:39 PM, Michal Simek  wrote:
> Add support for reading MAC address from I2C EEPROM.
>

Is this a feature provided by the GEM MAC IP?

> Signed-off-by: Michal Simek 
> ---
>
>  drivers/net/zynq_gem.c | 16 
>  1 file changed, 16 insertions(+)
>
> diff --git a/drivers/net/zynq_gem.c b/drivers/net/zynq_gem.c
> index b3821c31a91d..ace60c901cb5 100644
> --- a/drivers/net/zynq_gem.c
> +++ b/drivers/net/zynq_gem.c
> @@ -627,6 +627,21 @@ static int zynq_gem_remove(struct udevice *dev)
> return 0;
>  }
>
> +static int zynq_gem_read_rom_hwaddr(struct udevice *dev)
> +{
> +#if defined(CONFIG_ZYNQ_GEM_EEPROM_ADDR) && \
> +defined(CONFIG_ZYNQ_GEM_I2C_MAC_OFFSET)
> +   struct eth_pdata *pdata = dev_get_platdata(dev);
> +
> +   if (eeprom_read(CONFIG_ZYNQ_GEM_EEPROM_ADDR,
> +   CONFIG_ZYNQ_GEM_I2C_MAC_OFFSET,
> +   pdata->enetaddr, ARRAY_SIZE(pdata->enetaddr)))

This call to eeprom_read() looks to me a board-specific feature, that
an on-board eeprom is used to store the MAC address for the GEM?

> +   printf("EEPROM MAC address read failed\n");
> +#endif
> +   return 0;
> +}
> +
> +
>  static const struct eth_ops zynq_gem_ops = {
> .start  = zynq_gem_init,
> .send   = zynq_gem_send,
> @@ -634,6 +649,7 @@ static const struct eth_ops zynq_gem_ops = {
> .free_pkt   = zynq_gem_free_pkt,
> .stop   = zynq_gem_halt,
> .write_hwaddr   = zynq_gem_setup_mac,
> +   .read_rom_hwaddr= zynq_gem_read_rom_hwaddr,
>  };
>
>  static int zynq_gem_ofdata_to_platdata(struct udevice *dev)
> --

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


Re: [U-Boot] [RFC PATCH v1 2/2] arm: ls1021aqds: Enable driver model lpuart serial driver

2016-02-13 Thread Bin Meng
Hi York,

On Tue, Feb 9, 2016 at 8:57 AM, York Sun  wrote:
> Convert ls1021aqds_nor_lpuart and ls1021aqds_ddr4_nor_lpuart
> to driver model suport. Enable lpuart port driver.
>
> Signed-off-by: York Sun 
> CC: Alison Wang 
> CC: Bin Meng 
>
> ---
>
>  arch/arm/dts/Makefile|1 +
>  arch/arm/dts/ls1021a-qds-lpuart.dts  |   16 
>  configs/ls1021aqds_ddr4_nor_lpuart_defconfig |4 
>  configs/ls1021aqds_nor_lpuart_defconfig  |4 
>  4 files changed, 25 insertions(+)
>  create mode 100644 arch/arm/dts/ls1021a-qds-lpuart.dts
>
> diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
> index ef58aec..c27b80c 100644
> --- a/arch/arm/dts/Makefile
> +++ b/arch/arm/dts/Makefile
> @@ -95,6 +95,7 @@ dtb-$(CONFIG_TARGET_BEAGLE_X15) += am57xx-beagle-x15.dtb
>  dtb-$(CONFIG_TARGET_STV0991) += stv0991.dtb
>
>  dtb-$(CONFIG_LS102XA) += ls1021a-qds-duart.dtb \
> +   ls1021a-qds-lpuart.dtb \
> ls1021a-twr-duart.dtb ls1021a-twr-lpuart.dtb
>  dtb-$(CONFIG_FSL_LSCH3) += fsl-ls2080a-qds.dtb \
> fsl-ls2080a-rdb.dtb
> diff --git a/arch/arm/dts/ls1021a-qds-lpuart.dts 
> b/arch/arm/dts/ls1021a-qds-lpuart.dts
> new file mode 100644
> index 000..1d16ffd
> --- /dev/null
> +++ b/arch/arm/dts/ls1021a-qds-lpuart.dts
> @@ -0,0 +1,16 @@
> +/*
> + * Freescale ls1021a QDS board common device tree source
> + *
> + * Copyright 2013-2015 Freescale Semiconductor, Inc.
> + *
> + * SPDX-License-Identifier:GPL-2.0+
> + */
> +
> +/dts-v1/;
> +#include "ls1021a-qds.dtsi"
> +
> +/ {
> +   chosen {
> +   stdout-path = 
> +   };
> +};
> diff --git a/configs/ls1021aqds_ddr4_nor_lpuart_defconfig 
> b/configs/ls1021aqds_ddr4_nor_lpuart_defconfig
> index 44b2a0d..ffac6dd 100644
> --- a/configs/ls1021aqds_ddr4_nor_lpuart_defconfig
> +++ b/configs/ls1021aqds_ddr4_nor_lpuart_defconfig
> @@ -1,7 +1,11 @@
>  CONFIG_ARM=y
>  CONFIG_TARGET_LS1021AQDS=y
>  CONFIG_SYS_EXTRA_OPTIONS="SYS_FSL_DDR4,LPUART"
> +CONFIG_DM_SERIAL=y
> +CONFIG_DEFAULT_DEVICE_TREE="ls1021a-qds-duart"

I believe this should be "ls1021a-qds-lpuart"?

>  # CONFIG_CMD_SETEXPR is not set
> +CONFIG_OF_CONTROL=y
> +CONFIG_DM=y
>  CONFIG_NETDEVICES=y
>  CONFIG_E1000=y
>  CONFIG_FSL_LPUART=y
> diff --git a/configs/ls1021aqds_nor_lpuart_defconfig 
> b/configs/ls1021aqds_nor_lpuart_defconfig
> index 1186af2..e81448d 100644
> --- a/configs/ls1021aqds_nor_lpuart_defconfig
> +++ b/configs/ls1021aqds_nor_lpuart_defconfig
> @@ -1,7 +1,11 @@
>  CONFIG_ARM=y
>  CONFIG_TARGET_LS1021AQDS=y
> +CONFIG_DM_SERIAL=y
> +CONFIG_DEFAULT_DEVICE_TREE="ls1021a-qds-lpuart"
>  CONFIG_SYS_EXTRA_OPTIONS="LPUART"
>  # CONFIG_CMD_SETEXPR is not set
> +CONFIG_OF_CONTROL=y
> +CONFIG_DM=y
>  CONFIG_NETDEVICES=y
>  CONFIG_E1000=y
>  CONFIG_FSL_LPUART=y
> --

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


Re: [U-Boot] [PATCH] x86: fix memalign() parameter order

2016-02-13 Thread Bin Meng
Hi Stephen,

On Sat, Feb 13, 2016 at 5:27 AM, Stephen Warren  wrote:
> From: Stephen Warren 
>
> Purely by code inspection, it looks like the parameter order to memalign()
> is swapped; its parameters are (align, size). 4096 is a likely desired
> alignment, and a variable named size sounds like a size:-)
>

Good catch! It was lucky that this did not corrupt any important data before ..

> Fixes: 45b5a37836d5 ("x86: Add multi-processor init")
> Signed-off-by: Stephen Warren 
> ---

Reviewed-by: Bin Meng 

> I've taken a quick look at all the other memalign() calls in U-Boot, and
> I /think/ they're all correct.
> ---
>  arch/x86/cpu/mp_init.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/x86/cpu/mp_init.c b/arch/x86/cpu/mp_init.c
> index 7917350bff26..fc2fb5bf445c 100644
> --- a/arch/x86/cpu/mp_init.c
> +++ b/arch/x86/cpu/mp_init.c
> @@ -243,7 +243,7 @@ static int load_sipi_vector(atomic_t **ap_countp, int 
> num_cpus)
>
> params->stack_size = CONFIG_AP_STACK_SIZE;
> size = params->stack_size * num_cpus;
> -   stack = memalign(size, 4096);
> +   stack = memalign(4096, size);
> if (!stack)
> return -ENOMEM;
> params->stack_top = (u32)(stack + size);
> --

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


Re: [U-Boot] [PATCH] x86: fix memalign() parameter order

2016-02-13 Thread Simon Glass
On 12 February 2016 at 14:27, Stephen Warren  wrote:
> From: Stephen Warren 
>
> Purely by code inspection, it looks like the parameter order to memalign()
> is swapped; its parameters are (align, size). 4096 is a likely desired
> alignment, and a variable named size sounds like a size:-)
>
> Fixes: 45b5a37836d5 ("x86: Add multi-processor init")
> Signed-off-by: Stephen Warren 
> ---
> I've taken a quick look at all the other memalign() calls in U-Boot, and
> I /think/ they're all correct.
> ---
> arch/x86/cpu/mp_init.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/x86/cpu/mp_init.c b/arch/x86/cpu/mp_init.c
> index 7917350bff26..fc2fb5bf445c 100644
> --- a/arch/x86/cpu/mp_init.c
> +++ b/arch/x86/cpu/mp_init.c
> @@ -243,7 +243,7 @@ static int load_sipi_vector(atomic_t **ap_countp, int
num_cpus)
>
> params->stack_size = CONFIG_AP_STACK_SIZE;
> size = params->stack_size * num_cpus;
> - stack = memalign(size, 4096);
> + stack = memalign(4096, size);
> if (!stack)
> return -ENOMEM;
> params->stack_top = (u32)(stack + size);
> --
> 2.7.0
>

Reviewed-by: Simon Glass 

Thanks. I'm a little surprised this hasn't caused problems with CPU
start-up!

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


Re: [U-Boot] [PATCH v2 5/5] x86: Add Intel Cougar Canyon 2 board

2016-02-13 Thread Bin Meng
Hi Simon,

On Wed, Feb 10, 2016 at 6:23 AM, Simon Glass  wrote:
> Hi Bin,
>
> On 5 February 2016 at 23:08, Bin Meng  wrote:
>> This adds basic support to Intel Cougar Canyon 2 board, a board
>> based on Chief River platform with an Ivy Bridge processor and
>> a Panther Point chipset.
>>
>> Signed-off-by: Bin Meng 
>> Acked-by: Simon Glass 
>>
>> ---
>>
>> Changes in v2:
>> - Change include order -  go after the normal includes
>> - Use PCH uclass driver and change to use dm pci config APIs
>>
>>  arch/x86/cpu/ivybridge/Kconfig|   4 ++
>>  arch/x86/dts/Makefile |   1 +
>>  arch/x86/dts/cougarcanyon2.dts| 104 
>> ++
>>  board/intel/Kconfig   |   9 +++
>>  board/intel/cougarcanyon2/Kconfig |  25 +++
>>  board/intel/cougarcanyon2/MAINTAINERS |   6 ++
>>  board/intel/cougarcanyon2/Makefile|   7 ++
>>  board/intel/cougarcanyon2/cougarcanyon2.c |  58 +
>>  board/intel/cougarcanyon2/start.S |   9 +++
>>  configs/cougarcanyon2_defconfig   |  21 ++
>>  include/configs/cougarcanyon2.h   |  34 ++
>>  11 files changed, 278 insertions(+)
>>  create mode 100644 arch/x86/dts/cougarcanyon2.dts
>>  create mode 100644 board/intel/cougarcanyon2/Kconfig
>>  create mode 100644 board/intel/cougarcanyon2/MAINTAINERS
>>  create mode 100644 board/intel/cougarcanyon2/Makefile
>>  create mode 100644 board/intel/cougarcanyon2/cougarcanyon2.c
>>  create mode 100644 board/intel/cougarcanyon2/start.S
>>  create mode 100644 configs/cougarcanyon2_defconfig
>>  create mode 100644 include/configs/cougarcanyon2.h
>
> Can you update README.x86 to mention this board and how to get the
> required binaries?
>

Sure, will do in v3.

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