Re: [U-Boot] [PATCH 3/9] video:exynos_fb:fdt: add additional fdt data

2014-02-07 Thread Piotr Wilczek
Dear Minkyu Kang,

 On 27/01/14 23:15, Piotr Wilczek wrote:
  This patch adds additional data parsing from DTB.
 
  Signed-off-by: Piotr Wilczek p.wilc...@samsung.com
  Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
  Cc: Minkyu Kang mk7.k...@samsung.com
  ---
   drivers/video/exynos_fb.c |   19 +++
   1 file changed, 19 insertions(+)
 
  diff --git a/drivers/video/exynos_fb.c b/drivers/video/exynos_fb.c
  index d4863e8..7e0099f 100644
  --- a/drivers/video/exynos_fb.c
  +++ b/drivers/video/exynos_fb.c
  @@ -20,6 +20,7 @@
   #include asm/arch/dp_info.h
   #include asm/arch/system.h
   #include asm-generic/errno.h
  +#include libtizen.h
 
   #include exynos_fb.h
 
  @@ -269,6 +270,21 @@ int exynos_fimd_parse_dt(const void *blob)
  panel_info.dual_lcd_enabled = fdtdec_get_int(blob, node,
  samsung,dual-lcd-enabled,
0);
 
  +   panel_info.logo_on = fdtdec_get_int(blob, node,
  +   samsung,logo-on, 0);
 
 duplicated.
Ok, will remove it.

 
  +
  +   panel_info.resolution = fdtdec_get_int(blob, node,
  +   samsung,resolution, 0);
  +
  +   panel_info.rgb_mode = fdtdec_get_int(blob, node,
  +   samsung,rgb-mode, 0);
  +
  +   panel_info.power_on_delay = fdtdec_get_int(blob, node,
  +   samsung,power-on-delay,
0);
  +
  +#ifdef CONFIG_TIZEN
  +   get_tizen_logo_info(panel_info);
 
 It looks strange.
 Why you load the logo at frame buffer driver?
Ok, I will move it.

 
  +#endif
  return 0;
   }
   #endif
  @@ -281,6 +297,9 @@ void lcd_ctrl_init(void *lcdbase)  #ifdef
  CONFIG_OF_CONTROL
  if (exynos_fimd_parse_dt(gd-fdt_blob))
  debug(Can't get proper panel info\n);
  +#ifdef CONFIG_EXYNOS_MIPI_DSIM
  +   exynos_init_dsim_platform_data(panel_info);
  +#endif
   #else
  /* initialize parameters which is specific to panel. */
  init_panel_info(panel_info);
 
 
 Thanks,
 Minkyu Kang.

Thanks for review.
Piotr Wilczek



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


[U-Boot] [PATCH] configs: Delete unused CONFIG_SYS_64BIT_{VSPRINTF, STRTOUL}

2014-02-07 Thread Masahiro Yamada
Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---
 include/configs/M54418TWR.h | 1 -
 include/configs/p1_twr.h| 3 ---
 include/configs/vl_ma2sc.h  | 1 -
 include/configs/x600.h  | 1 -
 4 files changed, 6 deletions(-)

diff --git a/include/configs/M54418TWR.h b/include/configs/M54418TWR.h
index 031672e..3d7dc1f 100644
--- a/include/configs/M54418TWR.h
+++ b/include/configs/M54418TWR.h
@@ -77,7 +77,6 @@
 #define CONFIG_SYS_MAX_NAND_DEVICE 1
 #define NAND_MAX_CHIPS CONFIG_SYS_MAX_NAND_DEVICE
 #define CONFIG_SYS_NAND_SELECT_DEVICE
-#defineCONFIG_SYS_64BIT_VSPRINTF   /* needed for nand_util.c */
 #endif
 
 /* Network configuration */
diff --git a/include/configs/p1_twr.h b/include/configs/p1_twr.h
index 601bac7..c296a07 100644
--- a/include/configs/p1_twr.h
+++ b/include/configs/p1_twr.h
@@ -238,9 +238,6 @@ extern unsigned long get_board_sys_clk(unsigned long dummy);
 #define CONFIG_OF_BOARD_SETUP
 #define CONFIG_OF_STDOUT_VIA_ALIAS
 
-#define CONFIG_SYS_64BIT_VSPRINTF
-#define CONFIG_SYS_64BIT_STRTOUL
-
 /* new uImage format support */
 #define CONFIG_FIT
 #define CONFIG_FIT_VERBOSE /* enable fit_format_{error,warning}() */
diff --git a/include/configs/vl_ma2sc.h b/include/configs/vl_ma2sc.h
index 2187f77..14c6e67 100644
--- a/include/configs/vl_ma2sc.h
+++ b/include/configs/vl_ma2sc.h
@@ -322,7 +322,6 @@
 #define CONFIG_SYS_NAND_MASK_CLE   (1  22)   /* our CLE is AD22 */
 #define CONFIG_SYS_NAND_ENABLE_PIN GPIO_PIN_PD(15)
 #define CONFIG_SYS_NAND_READY_PIN  GPIO_PIN_PB(0)
-#define CONFIG_SYS_64BIT_VSPRINTF  /* needed for nand_util.c */
 #endif
 
 /* Ethernet */
diff --git a/include/configs/x600.h b/include/configs/x600.h
index a427ca5..8141927 100644
--- a/include/configs/x600.h
+++ b/include/configs/x600.h
@@ -171,7 +171,6 @@
 #define CONFIG_SYS_BARGSIZECONFIG_SYS_CBSIZE
 #define CONFIG_SYS_LOAD_ADDR   0x0080
 #define CONFIG_SYS_CONSOLE_INFO_QUIET
-#define CONFIG_SYS_64BIT_VSPRINTF
 
 /* Use last 2 lwords in internal SRAM for bootcounter */
 #define CONFIG_BOOTCOUNT_LIMIT
-- 
1.8.3.2

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


Re: [U-Boot] [PATCH 5/9] arm:exynos: add common board file for exynos 4

2014-02-07 Thread Piotr Wilczek
Dear Minkyu Kang,

 -Original Message-
 From: Minkyu Kang [mailto:mk7.k...@samsung.com]
 Sent: Friday, February 07, 2014 8:53 AM
 To: Piotr Wilczek
 Cc: u-boot@lists.denx.de; Kyungmin Park; Lukasz Majewski; Jaehoon
 Chung; Inha Song; Chanho Park
 Subject: Re: [PATCH 5/9] arm:exynos: add common board file for exynos 4
 
 On 27/01/14 23:15, Piotr Wilczek wrote:
  This patch adds common board file for Exynos 4 based boards.
 
  Signed-off-by: Piotr Wilczek p.wilc...@samsung.com
  Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
  ---
   arch/arm/dts/exynos4.dtsi|  139
 +++
   board/samsung/common/Makefile|1 +
   board/samsung/common/board_exynos4.c |   83 +
   include/configs/exynos4-dt.h |  170
 ++
   4 files changed, 393 insertions(+)
   create mode 100644 arch/arm/dts/exynos4.dtsi  create mode 100644
  board/samsung/common/board_exynos4.c
   create mode 100644 include/configs/exynos4-dt.h
 
  diff --git a/arch/arm/dts/exynos4.dtsi b/arch/arm/dts/exynos4.dtsi
 new
  file mode 100644 index 000..38a6919
  --- /dev/null
  +++ b/arch/arm/dts/exynos4.dtsi
  @@ -0,0 +1,139 @@
  +/*
  + * Samsung's Exynos4 SoC common device tree source
  + *
  + * Copyright (c) 2014 Samsung Electronics Co., Ltd.
  + * http://www.samsung.com
  + *
  + * SPDX-License-Identifier:GPL-2.0+
  + */
  +
  +/include/ skeleton.dtsi
  +
  +/ {
  +
  +   serial@1380 {
  +   compatible = samsung,exynos4210-uart;
  +   reg = 0x1380 0x3c;
  +   id = 0;
  +   };
  +
  +   serial@1381 {
  +   compatible = samsung,exynos4210-uart;
  +   reg = 0x1381 0x3c;
  +   id = 1;
  +   };
  +
  +   serial@1382 {
  +   compatible = samsung,exynos4210-uart;
  +   reg = 0x1382 0x3c;
  +   id = 2;
  +   };
  +
  +   serial@1383 {
  +   compatible = samsung,exynos4210-uart;
  +   reg = 0x1383 0x3c;
  +   id = 3;
  +   };
  +
  +   serial@1384 {
  +   compatible = samsung,exynos4210-uart;
  +   reg = 0x1384 0x3c;
  +   id = 4;
  +   };
  +
  +   i2c@1386 {
  +   #address-cells = 1;
  +   #size-cells = 0;
  +   compatible = samsung,s3c2440-i2c;
  +   interrupts = 0 0 0;
  +   };
  +
  +   i2c@1387 {
  +   #address-cells = 1;
  +   #size-cells = 0;
  +   compatible = samsung,s3c2440-i2c;
  +   interrupts = 1 1 0;
  +   };
  +
  +   i2c@1388 {
  +   #address-cells = 1;
  +   #size-cells = 0;
  +   compatible = samsung,s3c2440-i2c;
  +   interrupts = 2 2 0;
  +   };
  +
  +   i2c@1389 {
  +   #address-cells = 1;
  +   #size-cells = 0;
  +   compatible = samsung,s3c2440-i2c;
  +   interrupts = 3 3 0;
  +   };
  +
  +   i2c@138a {
  +   #address-cells = 1;
  +   #size-cells = 0;
  +   compatible = samsung,s3c2440-i2c;
  +   interrupts = 4 4 0;
  +   };
  +
  +   i2c@138b {
  +   #address-cells = 1;
  +   #size-cells = 0;
  +   compatible = samsung,s3c2440-i2c;
  +   interrupts = 5 5 0;
  +   };
  +
  +   i2c@138c {
  +   #address-cells = 1;
  +   #size-cells = 0;
  +   compatible = samsung,s3c2440-i2c;
  +   interrupts = 6 6 0;
  +   };
  +
  +   i2c@138d {
  +   #address-cells = 1;
  +   #size-cells = 0;
  +   compatible = samsung,s3c2440-i2c;
  +   interrupts = 7 7 0;
  +   };
  +
  +   sdhci@1251 {
  +   #address-cells = 1;
  +   #size-cells = 0;
  +   compatible = samsung,exynos-mmc;
  +   reg = 0x1251 0x1000;
  +   interrupts = 0 75 0;
  +   };
  +
  +   sdhci@1252 {
  +   #address-cells = 1;
  +   #size-cells = 0;
  +   compatible = samsung,exynos-mmc;
  +   reg = 0x1252 0x1000;
  +   interrupts = 0 76 0;
  +   };
  +
  +   sdhci@1253 {
  +   #address-cells = 1;
  +   #size-cells = 0;
  +   compatible = samsung,exynos-mmc;
  +   reg = 0x1253 0x1000;
  +   interrupts = 0 77 0;
  +   };
  +
  +   sdhci@1254 {
  +   #address-cells = 1;
  +   #size-cells = 0;
  +   compatible = samsung,exynos-mmc;
  +   reg = 0x1254 0x1000;
  +   interrupts = 0 78 0;
  +   };
  +
  +   gpio: gpio {
  +   gpio-controller;
  +   #gpio-cells = 2;
  +
  +   interrupt-controller;
  +   #interrupt-cells = 2;
  +   };
  +};
  diff --git a/board/samsung/common/Makefile
  b/board/samsung/common/Makefile index 7d2bb8c..25f1e40 100644
  --- a/board/samsung/common/Makefile
  +++ b/board/samsung/common/Makefile
  @@ -12,4 +12,5 @@ obj-$(CONFIG_MISC_COMMON) += misc.o
 
   ifndef CONFIG_SPL_BUILD
   

Re: [U-Boot] [PATCH 2/9] video:mipidsim:fdt: Add DT support for mipi dsim driver

2014-02-07 Thread Piotr Wilczek
Dear Minkyu Kang,

 -Original Message-
 
 On 27/01/14 23:15, Piotr Wilczek wrote:
  This patch enables parsing mipi data from device tree.
  Non device tree case is still supported.
 
  Signed-off-by: Piotr Wilczek p.wilc...@samsung.com
  Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
  Cc: Minkyu Kang mk7.k...@samsung.com
  ---
   arch/arm/include/asm/arch-exynos/mipi_dsim.h |3 +
   drivers/video/exynos_mipi_dsi.c  |   98
 ++
   include/fdtdec.h |1 +
   lib/fdtdec.c |1 +
   4 files changed, 103 insertions(+)
 
  diff --git a/arch/arm/include/asm/arch-exynos/mipi_dsim.h
  b/arch/arm/include/asm/arch-exynos/mipi_dsim.h
  index 40aca71..c9e8e06 100644
  --- a/arch/arm/include/asm/arch-exynos/mipi_dsim.h
  +++ b/arch/arm/include/asm/arch-exynos/mipi_dsim.h
  @@ -12,6 +12,7 @@
 
   #include linux/list.h
   #include linux/fb.h
  +#include lcd.h
 
   #define PANEL_NAME_SIZE(32)
 
  @@ -368,8 +369,10 @@ int exynos_mipi_dsi_register_lcd_device(struct
 mipi_dsim_lcd_device
  *lcd_dev);
 
   void exynos_set_dsim_platform_data(struct exynos_platform_mipi_dsim
  *pd);
  +void exynos_init_dsim_platform_data(vidinfo_t *vid);
 
   /* panel driver init based on mipi dsi interface */  void
  s6e8ax0_init(void);
 
  +extern int mipi_power(void);
   #endif /* _DSIM_H */
  diff --git a/drivers/video/exynos_mipi_dsi.c
  b/drivers/video/exynos_mipi_dsi.c index 8bb8fea..ab15ad6 100644
  --- a/drivers/video/exynos_mipi_dsi.c
  +++ b/drivers/video/exynos_mipi_dsi.c
  @@ -9,6 +9,8 @@
 
   #include common.h
   #include malloc.h
  +#include fdtdec.h
  +#include libfdt.h
   #include linux/err.h
   #include asm/arch/dsim.h
   #include asm/arch/mipi_dsim.h
  @@ -22,7 +24,12 @@
   #define master_to_driver(a)(a-dsim_lcd_drv)
   #define master_to_device(a)(a-dsim_lcd_dev)
 
  +DECLARE_GLOBAL_DATA_PTR;
  +
   static struct exynos_platform_mipi_dsim *dsim_pd;
  +static struct mipi_dsim_config dsim_config_dt; static struct
  +exynos_platform_mipi_dsim dsim_platform_data_dt; static struct
  +mipi_dsim_lcd_device mipi_lcd_device_dt;
 
   struct mipi_dsim_ddi {
  int bus_id;
  @@ -238,3 +245,94 @@ void exynos_set_dsim_platform_data(struct
  exynos_platform_mipi_dsim *pd)
 
  dsim_pd = pd;
   }
  +
  +#ifdef CONFIG_OF_CONTROL
  +int exynos_dsim_config_parse_dt(const void *blob) {
  +   int node;
  +
  +   node = fdtdec_next_compatible(blob, 0,
 COMPAT_SAMSUNG_EXYNOS_MIPI_DSI);
  +   if (node = 0) {
  +   printf(exynos_mipi_dsi: Can't get device node for mipi
 dsi\n);
  +   return -ENODEV;
  +   }
  +
  +   dsim_config_dt.e_interface = fdtdec_get_int(blob, node,
  +   samsung,dsim-config-e_interface, 0);
  +
  +   dsim_config_dt.e_virtual_ch = fdtdec_get_int(blob, node,
  +   samsung,dsim-config-e_virtual_ch, 0);
  +
  +   dsim_config_dt.e_pixel_format = fdtdec_get_int(blob, node,
  +   samsung,dsim-config-e_pixel_format, 0);
  +
  +   dsim_config_dt.e_burst_mode = fdtdec_get_int(blob, node,
  +   samsung,dsim-config-e_burst_mode, 0);
  +
  +   dsim_config_dt.e_no_data_lane = fdtdec_get_int(blob, node,
  +   samsung,dsim-config-e_no_data_lane, 0);
  +
  +   dsim_config_dt.e_byte_clk = fdtdec_get_int(blob, node,
  +   samsung,dsim-config-e_byte_clk, 0);
  +
  +   dsim_config_dt.hfp = fdtdec_get_int(blob, node,
  +   samsung,dsim-config-hfp, 0);
  +
  +   dsim_config_dt.p = fdtdec_get_int(blob, node,
  + samsung,dsim-config-p, 0);
  +   dsim_config_dt.m = fdtdec_get_int(blob, node,
  + samsung,dsim-config-m, 0);
  +   dsim_config_dt.s = fdtdec_get_int(blob, node,
  + samsung,dsim-config-s, 0);
  +
  +   dsim_config_dt.pll_stable_time = fdtdec_get_int(blob, node,
  +   samsung,dsim-config-pll_stable_time, 0);
  +
  +   dsim_config_dt.esc_clk = fdtdec_get_int(blob, node,
  +   samsung,dsim-config-esc_clk, 0);
  +
  +   dsim_config_dt.stop_holding_cnt = fdtdec_get_int(blob, node,
  +   samsung,dsim-config-stop_holding_cnt, 0);
  +
  +   dsim_config_dt.bta_timeout = fdtdec_get_int(blob, node,
  +   samsung,dsim-config-bta_timeout, 0);
  +
  +   dsim_config_dt.rx_timeout = fdtdec_get_int(blob, node,
  +   samsung,dsim-config-rx_timeout, 0);
  +
  +   mipi_lcd_device_dt.name = fdtdec_get_config_string(blob,
  +   samsung,dsim-device-name);
  +
  +   mipi_lcd_device_dt.id = fdtdec_get_int(blob, node,
  +   samsung,dsim-device-id, 0);
  +
  +   mipi_lcd_device_dt.bus_id = 

[U-Boot] uboot/linux version compatibilty

2014-02-07 Thread santosh
Dear all,

Currently our production device has uboot 1.1.2  and Linux kernel 2.6.10.

We are planning to upgrade Linux kernel to 2.6.18 without upgrading
uboot version.

Can you please let us know incompatibility issues if any?

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


Re: [U-Boot] [uBoot] [PATCH v2 2/2] ARM: O5/dra7xx: Add SATA boot support

2014-02-07 Thread Roger Quadros
On 02/03/2014 02:59 PM, Dan Murphy wrote:
 Add the SATA boot support for OMAP5 and dra7xx.
 
 Renamed the omap_sata_init to the common init_sata(int dev)
 for commonality in with sata stack.
 
 Added the ROM boot device ID for SATA.
 
 Signed-off-by: Dan Murphy dmur...@ti.com

Reviewed-by: Roger Quadros rog...@ti.com

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


Re: [U-Boot] [uBoot] [PATCH v2 1/2] common: spl: Add spl sata boot support

2014-02-07 Thread Roger Quadros
Hi Dan,

On 02/03/2014 02:59 PM, Dan Murphy wrote:
 Add spl_sata to read a fat partition from a bootable SATA
 drive.
 
 Signed-off-by: Dan Murphy dmur...@ti.com
 ---

I got some check-patch errors with this one.
Once that is fixed you can please add

Reviewed-by: Roger Quadros rog...@ti.com

cheers,
-roger
 
 v2 - Removed debug print - http://patchwork.ozlabs.org/patch/314811/
 
  common/Makefile   |3 +++
  common/cmd_scsi.c |2 ++
  common/spl/Makefile   |1 +
  common/spl/spl.c  |5 +
  common/spl/spl_sata.c |   49 
 +
  include/spl.h |3 +++
  spl/Makefile  |1 +
  7 files changed, 64 insertions(+)
  create mode 100644 common/spl/spl_sata.c
 
 diff --git a/common/Makefile b/common/Makefile
 index 4d99ecd..b0f5b62 100644
 --- a/common/Makefile
 +++ b/common/Makefile
 @@ -201,6 +201,9 @@ ifdef CONFIG_SPL_USB_HOST_SUPPORT
  obj-$(CONFIG_SPL_USB_SUPPORT) += usb.o usb_hub.o
  obj-$(CONFIG_USB_STORAGE) += usb_storage.o
  endif
 +ifdef CONFIG_SPL_SATA_SUPPORT
 +obj-$(CONFIG_CMD_SCSI) += cmd_scsi.o
 +endif
  ifneq ($(CONFIG_SPL_NET_SUPPORT),y)
  obj-$(CONFIG_ENV_IS_NOWHERE) += env_nowhere.o
  obj-$(CONFIG_ENV_IS_IN_MMC) += env_mmc.o
 diff --git a/common/cmd_scsi.c b/common/cmd_scsi.c
 index 7b97dc9..b3f7687 100644
 --- a/common/cmd_scsi.c
 +++ b/common/cmd_scsi.c
 @@ -168,7 +168,9 @@ removable:
   scsi_curr_dev = -1;
  
   printf(Found %d device(s).\n, scsi_max_devs);
 +#ifndef CONFIG_SPL_BUILD
   setenv_ulong(scsidevs, scsi_max_devs);
 +#endif
  }
  
  int scsi_get_disk_count(void)
 diff --git a/common/spl/Makefile b/common/spl/Makefile
 index 65a1484f..64569c2 100644
 --- a/common/spl/Makefile
 +++ b/common/spl/Makefile
 @@ -18,4 +18,5 @@ obj-$(CONFIG_SPL_NET_SUPPORT) += spl_net.o
  obj-$(CONFIG_SPL_MMC_SUPPORT) += spl_mmc.o
  obj-$(CONFIG_SPL_USB_SUPPORT) += spl_usb.o
  obj-$(CONFIG_SPL_FAT_SUPPORT) += spl_fat.o
 +obj-$(CONFIG_SPL_SATA_SUPPORT) += spl_sata.o
  endif
 diff --git a/common/spl/spl.c b/common/spl/spl.c
 index 0645cee..774fdad 100644
 --- a/common/spl/spl.c
 +++ b/common/spl/spl.c
 @@ -210,6 +210,11 @@ void board_init_r(gd_t *dummy1, ulong dummy2)
   spl_usb_load_image();
   break;
  #endif
 +#ifdef CONFIG_SPL_SATA_SUPPORT
 + case BOOT_DEVICE_SATA:
 + spl_sata_load_image();
 + break;
 +#endif
   default:
   debug(SPL: Un-supported Boot Device\n);
   hang();
 diff --git a/common/spl/spl_sata.c b/common/spl/spl_sata.c
 new file mode 100644
 index 000..2e7adca
 --- /dev/null
 +++ b/common/spl/spl_sata.c
 @@ -0,0 +1,49 @@
 +/*
 + * (C) Copyright 2013
 + * Texas Instruments, www.ti.com
 + *
 + * Dan Murphy dmur...@ti.com
 + *
 + * SPDX-License-Identifier:  GPL-2.0+
 + *
 + * Derived work from spl_usb.c
 + */
 +
 +#include common.h
 +#include spl.h
 +#include asm/u-boot.h
 +#include sata.h
 +#include fat.h
 +#include version.h
 +#include image.h
 +
 +DECLARE_GLOBAL_DATA_PTR;
 +
 +void spl_sata_load_image(void)
 +{
 + int err;
 + block_dev_desc_t *stor_dev;
 +
 + err = init_sata(CONFIG_SPL_SATA_BOOT_DEVICE);
 + if (err) {
 +#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
 + printf(spl: sata init failed: err - %d\n, err);
 +#endif
 + hang();
 + } else {
 + /* try to recognize storage devices immediately */
 + stor_dev = scsi_get_dev(0);
 + }
 +
 +#ifdef CONFIG_SPL_OS_BOOT
 + if (spl_start_uboot() || spl_load_image_fat_os(stor_dev,
 + 
 CONFIG_SYS_SATA_FAT_BOOT_PARTITION))
 +#endif
 + err = spl_load_image_fat(stor_dev,
 + CONFIG_SYS_SATA_FAT_BOOT_PARTITION,
 + CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME);
 + if (err) {
 + puts(Error loading sata device\n);
 + hang();
 + }
 +}
 diff --git a/include/spl.h b/include/spl.h
 index 5e24856..ee09fb6 100644
 --- a/include/spl.h
 +++ b/include/spl.h
 @@ -64,6 +64,9 @@ void spl_net_load_image(const char *device);
  /* USB SPL functions */
  void spl_usb_load_image(void);
  
 +/* SATA SPL functions */
 +void spl_sata_load_image(void);
 +
  /* SPL FAT image functions */
  int spl_load_image_fat(block_dev_desc_t *block_dev, int partition, const 
 char *filename);
  int spl_load_image_fat_os(block_dev_desc_t *block_dev, int partition);
 diff --git a/spl/Makefile b/spl/Makefile
 index 4143e38..28fcfdd 100644
 --- a/spl/Makefile
 +++ b/spl/Makefile
 @@ -85,6 +85,7 @@ LIBS-$(CONFIG_SPL_USBETH_SUPPORT) += drivers/usb/gadget/
  LIBS-$(CONFIG_SPL_WATCHDOG_SUPPORT) += drivers/watchdog/
  LIBS-$(CONFIG_SPL_USB_HOST_SUPPORT) += drivers/usb/host/
  LIBS-$(CONFIG_OMAP_USB_PHY) += drivers/usb/phy/
 +LIBS-$(CONFIG_SPL_SATA_SUPPORT) += drivers/block/
  
  ifneq (,$(CONFIG_MX23)$(CONFIG_MX35)$(filter $(SOC), mx25 mx27 mx5 mx6 mx31 
 mx35))
  LIBS-y += 

Re: [U-Boot] [PATCH 5/9] arm:exynos: add common board file for exynos 4

2014-02-07 Thread Minkyu Kang
On 07/02/14 17:40, Piotr Wilczek wrote:
 Dear Minkyu Kang,
 
 -Original Message-
 From: Minkyu Kang [mailto:mk7.k...@samsung.com]
 Sent: Friday, February 07, 2014 8:53 AM
 To: Piotr Wilczek
 Cc: u-boot@lists.denx.de; Kyungmin Park; Lukasz Majewski; Jaehoon
 Chung; Inha Song; Chanho Park
 Subject: Re: [PATCH 5/9] arm:exynos: add common board file for exynos 4

 On 27/01/14 23:15, Piotr Wilczek wrote:
 This patch adds common board file for Exynos 4 based boards.

 Signed-off-by: Piotr Wilczek p.wilc...@samsung.com
 Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
 ---
  arch/arm/dts/exynos4.dtsi|  139
 +++
  board/samsung/common/Makefile|1 +
  board/samsung/common/board_exynos4.c |   83 +
  include/configs/exynos4-dt.h |  170
 ++
  4 files changed, 393 insertions(+)
  create mode 100644 arch/arm/dts/exynos4.dtsi  create mode 100644
 board/samsung/common/board_exynos4.c
  create mode 100644 include/configs/exynos4-dt.h

 diff --git a/board/samsung/common/Makefile
 b/board/samsung/common/Makefile index 7d2bb8c..25f1e40 100644
 --- a/board/samsung/common/Makefile
 +++ b/board/samsung/common/Makefile
 @@ -12,4 +12,5 @@ obj-$(CONFIG_MISC_COMMON) += misc.o

  ifndef CONFIG_SPL_BUILD
  obj-$(CONFIG_BOARD_COMMON) += board.o
 +obj-$(CONFIG_BOARD_COMMON_EXYNOS4) += board_exynos4.o
  endif
 diff --git a/board/samsung/common/board_exynos4.c
 b/board/samsung/common/board_exynos4.c
 new file mode 100644
 index 000..2d313e6
 --- /dev/null
 +++ b/board/samsung/common/board_exynos4.c

 I don't understand why need exynos4 common board file.
 There's already exist board.c that is common board file for samsung.

 Because in the board.c file, both common and board specific functions are
 added.
 Max 77686, eth, power, board late initialization functions are board
 specific.
 If they are removed, I will be able to use the board.c file.

It seems to be wrapped with ifdef.
I think there's no problems to use same file.

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


Re: [U-Boot] [PATCH v2] common: Remove invalid endianess conversion

2014-02-07 Thread Rommel G Custodio
Dear Christian Eggers

Christian Eggers ceggers at gmx.de writes:

 
 do_bootm_standanlone() calls ntohl(images-ep) which is wrong because
 endianess conversion has already been done:
 
 do_bootm()
 \-do_bootm_states()
   +-bootm_find_os()
   | \-images.ep = image_get_ep();
   |   \-uimage_to_cpu(hdr-ih_ep);
   \-boot_selected_os()
 \-do_bootm_standanlone()
 
 Without this conversion the code works correctly at least on ARM9. 

What is the endian of your ARM9 testbed?

I've tested the hello_world standalone image with and without your patch on 
a T5040 (BE). Behaviour of bootm does not change. So I am not sure what 
problem this patch fixes on PowerPC, if any. The patch might be applicable 
only to certain archs so you should test it on other archs as well 
(otherwise this patch might break them).


As a reference, the standalone image was created using the commandline:
../../tools/mkimage -A powerpc -O u-boot -T standalone -C none -a 0x1004 
-e 0x1004 -n test -d hello_world.bin hello_world.img

(Yes, I modified CONFIG_STANDALONE_LOAD_ADDR for this test.)
(Yes, hello_world was modified to not return for this test.)


And executed, on the board:
tftp 10 hello_world.img
bootm 0x10


 Addtionally appl need not be dereferenced with the * operator.

-snipped-


  common/cmd_bootm.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
 
 diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c
 index a59ee95..c507e1d 100644
 --- a/common/cmd_bootm.c
 +++ b/common/cmd_bootm.c

Also, your patch does not apply on master.

-snipped-

All the best,
Rommel




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


Re: [U-Boot] arm64 patch: gicv3 support

2014-02-07 Thread Arnab Basu
Hi David

Sorry for the late review, please find some comments inline.

On 15-Jan-14 1:40 PM, feng...@phytium.com.cn wrote:
 From: David Feng feng...@phytium.com.cn
 
 This patch add gicv3 support to uboot armv8 platform.
 Modifications cover 4 source files, as follows:
   gic.S: gicv3 initialization and sgi interrupt raising.
   goc.h: gicv3 register definitions.
   vexpress_aemv8a.h: add CONFIG_GICV2/CONFIG_GICV3 switch.
   start.S: set SCR_EL3.NS bit to 1, gicv3 register of ICC_SRE_EL2
could be accessed only when SCR_EL3.NS=1.
set SCR_EL3.IRQ|FIQ|EA bits, reroute all interrupts to
el3 at all cores, slaves could be waken up by interrupt
only when the interrupt is routed to it when running
at el3.

I cant understand why it is required that we route IRQs to EL3 here. Won't it 
be sufficient
to only route FIQs to EL3 and wake the secondary processors using an FIQ?

 Note: please use the latest gcc 4.8 compiler from linaro 
   which support gicv3 system register assembling.
 
 Signed-off-by: David Feng feng...@phytium.com.cn
 
 ---
 arch/arm/cpu/armv8/gic.S  |   84 -
  arch/arm/cpu/armv8/start.S|5 ++-
  arch/arm/include/asm/gic.h|   56 +
  include/configs/vexpress_aemv8a.h |7 
  4 files changed, 150 insertions(+), 2 deletions(-)
 
 diff --git a/arch/arm/cpu/armv8/gic.S b/arch/arm/cpu/armv8/gic.S
 index 599aa8f..a08939a 100644
 --- a/arch/arm/cpu/armv8/gic.S
 +++ b/arch/arm/cpu/armv8/gic.S
 @@ -23,6 +23,74 @@
   *
   */
  WEAK(gic_init)
 +#if defined(CONFIG_GICV3)

There is quite a bit of code inside CONFIG_GICV3 which is very similar to code 
in CONFIG_GICV2
why not collect the common code in one place?

 + branch_if_slave x0, 3f
 +
 + /* Initialize Distributor */
 + ldr x1, =GICD_BASE
 + mov w0, #0x37   /* EnableGrp0 | EnableGrp1NS */
 + /* EnableGrp1S | ARE_S | ARE_NS */
 + str w0, [x1, GICD_CTLR] /* Secure GICD_CTLR */
 + ldr w0, [x1, GICD_TYPER]
 + and w2, w0, #0x1f   /* ITLinesNumber */
 + cbz w2, 1f  /* No SPIs */
 + add x3, x1, (GICD_IGROUPRn + 4)
 + add x4, x1, (GICD_IGROUPMODRn + 4)
 + mov w5, #~0
 +0:   str w5, [x3], #0x4
 + str wzr, [x4], #0x4 /* Config SPIs as Group1NS */
 + sub w2, w2, #0x1
 + cbnzw2, 0b
 +
 + /* Initialize All ReDistributors */
 +1:   ldr x1, =GICR_BASE
 +2:   mov w0, #~0x2
 + ldr w2, [x1, GICR_WAKER]
 + and w2, w2, w0  /* Clear ProcessorSleep */
 + str w2, [x1, GICR_WAKER]
 + dsb st
 + isb
 +0:   ldr w0, [x1, GICR_WAKER]
 + tbnzw0, #2, 0b  /* Wait Children be Alive */
 +
 + add x2, x1, #(1  16)  /* SGI_Base */
 + mov w5, #~0
 + str w5, [x2, GICR_IGROUPRn]
 + str wzr, [x2, GICR_IGROUPMODRn] /* SGIs|PPIs Group1NS */
 + mov w0, #0x1/* Enable SGI 0 */
 + str w0, [x2, GICR_ISENABLERn]
 +
 + ldr w0, [x1, GICR_TYPER]
 + add x1, x1, #(2  16)
 + tbz w0, #4, 2b  /* Next ReDistributor if Exist */

I am not sure that this is a good idea. Why should the primary code initialize 
all redistributors?
Would it not be a better idea to make this code per cpu and let each core 
initialize its own
redistributor interface?

 +
 + /* Initialize Cpu Interface */
 +3:   mrs x0, ICC_SRE_EL3
 + orr x0, x0, #0xf/* SRE  Disable IRQ/FIQ Bypass  */
 + /* Allow EL2 access to ICC_SRE_EL2 */
 + msr ICC_SRE_EL3, x0
 + isb
 +
 + mrs x0, ICC_SRE_EL2
 + orr x0, x0, #0xf/* SRE  Disable IRQ/FIQ Bypass  */
 + /* Allow EL1 access to ICC_SRE_EL1 */

I don't think that u-boot should be doing this unconditionally. If U-Boot is 
configured to
boot the OS in EL2 (i.e. CONFIG_ARMV8_SWITCH_TO_EL1 is not set) then this 
should be left to
the OS. This code should probably be enclosed in ifdef 
CONFIG_ARMV8_SWITCH_TO_EL1

 + msr ICC_SRE_EL2, x0
 + isb
 +
 + mov x0, #0x3/* EnableGrp1NS | EnableGrp1S */
 + msr ICC_IGRPEN1_EL3, x0
 + isb
 +
 + msr ICC_CTLR_EL3, xzr
 + isb
 +
 + msr ICC_CTLR_EL1, xzr   /* NonSecure ICC_CTLR_EL1 */

Again why is U-Boot configuring this register, isn't it best left to the 
software running
in non-secure EL1?

Thanks
Arnab



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


Re: [U-Boot] uboot/linux version compatibilty

2014-02-07 Thread Wolfgang Denk
Dear santosh,

In message CAFcFeQJwzz=rhispm6fcmlofmwjxnkdsqmjchfwo9epmeos...@mail.gmail.com 
you wrote:
 
 Currently our production device has uboot 1.1.2  and Linux kernel 2.6.10.
 
 We are planning to upgrade Linux kernel to 2.6.18 without upgrading
 uboot version.
 
 Can you please let us know incompatibility issues if any?

U-Boot v1.1.2 is more than 9 years old, and even Linux v2.6.18 is
nearly 8 years old - so all the versions you list here (including
your new Linux version) are so totally antiquated that those
engineers who still might remember have long been pensioned off ;-)


In your specific case I would not expect any serious incompatibili-
ties, but don't hold your breath.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
Each honest calling, each walk of life, has its own  elite,  its  own
aristocracy based on excellence of performance. - James Bryant Conant
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 6/6] PPC 85xx: Find CPU speed on ppce500 from device tree

2014-02-07 Thread Alexander Graf

On 07.02.2014, at 02:33, Scott Wood scottw...@freescale.com wrote:

 On Thu, 2014-02-06 at 12:11 +0100, Alexander Graf wrote:
 On 04.02.2014, at 03:52, Scott Wood scottw...@freescale.com wrote:
 
 On Fri, 2014-01-31 at 12:16 +0100, Alexander Graf wrote:
 The only thing we know in our PV machine through device tree is the clock
 speed of the CPUs. Take that as CPU speed, system speed and ddr speed so 
 that
 we have some meaningful values there at all.
 
 The CPU speed is important because our timing loops get determined based 
 on it.
 
 Signed-off-by: Alexander Graf ag...@suse.de
 ---
 arch/powerpc/cpu/mpc85xx/Makefile   |2 ++
 board/freescale/qemu-ppce500/qemu-ppce500.c |   43 
 +++
 2 files changed, 45 insertions(+)
 
 diff --git a/arch/powerpc/cpu/mpc85xx/Makefile 
 b/arch/powerpc/cpu/mpc85xx/Makefile
 index ef7637a..4094785 100644
 --- a/arch/powerpc/cpu/mpc85xx/Makefile
 +++ b/arch/powerpc/cpu/mpc85xx/Makefile
 @@ -102,7 +102,9 @@ obj-y  += cpu.o
 obj-y  += cpu_init.o
 obj-y  += cpu_init_early.o
 obj-y  += interrupts.o
 +ifneq ($(CONFIG_QEMU_E500),y)
 obj-y  += speed.o
 +endif
 obj-y  += tlb.o
 obj-y  += traps.o
 
 diff --git a/board/freescale/qemu-ppce500/qemu-ppce500.c 
 b/board/freescale/qemu-ppce500/qemu-ppce500.c
 index 5d4dd64..9e9d688 100644
 --- a/board/freescale/qemu-ppce500/qemu-ppce500.c
 +++ b/board/freescale/qemu-ppce500/qemu-ppce500.c
 @@ -407,3 +407,46 @@ void init_laws(void)
 {
/* We don't emulate LAWs yet */
 }
 +
 +static uint32_t get_cpu_freq(void)
 +{
 +  const void *fdt = get_fdt();
 +  int cpus_node = fdt_path_offset(fdt, /cpus);
 +  int cpu_node = fdt_first_subnode(fdt, cpus_node);
 +  return myfdt_one_cell(fdt, cpu_node, clock-frequency, 0);
 +}
 +
 +void get_sys_info(sys_info_t *sys_info)
 +{
 +  int freq = get_cpu_freq();
 +
 +  memset(sys_info, 0, sizeof(sys_info_t));
 +  sys_info-freq_systembus = freq;
 +  sys_info-freq_ddrbus = freq;
 +  sys_info-freq_processor[0] = freq;
 +}
 +
 +int get_clocks (void)
 +{
 +  sys_info_t sys_info;
 +
 +  get_sys_info(sys_info);
 +
 +  gd-cpu_clk = sys_info.freq_processor[0];
 +  gd-bus_clk = sys_info.freq_systembus;
 +  gd-mem_clk = sys_info.freq_ddrbus;
 +  gd-arch.lbc_clk = sys_info.freq_ddrbus;
 +
 +  return 0;
 +}
 
 This probably decreases the accuracy of the timebase frequency, since
 you'll be basing it on the CPU frequency rather than the bus frequency.
 
 If you're doing this, why not override get_tbclk() as well?
 
 That one only uses variables I already control, no?
 
 unsigned long get_tbclk (void)
 {
unsigned long tbclk_div = CONFIG_SYS_FSL_TBCLK_DIV;
 
return (gd-bus_clk + (tbclk_div  1)) / tbclk_div;
 }
 
 What did you set CONFIG_SYS_FSL_TBCLK_DIV to?

Nothing which is why it's defaulting to 8.


Alex

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


Re: [U-Boot] [PATCH v2 1/6] PPC 85xx: Detect e500v2 / e500mc during runtime

2014-02-07 Thread Alexander Graf

On 07.02.2014, at 01:51, Scott Wood scottw...@freescale.com wrote:

 On Thu, 2014-02-06 at 12:40 +0100, Alexander Graf wrote:
 On 04.02.2014, at 02:59, Scott Wood scottw...@freescale.com wrote:
 
 On Fri, 2014-01-31 at 12:16 +0100, Alexander Graf wrote:
 With the qemu-ppce500 machine type we can run the same board with
 either an e500v2 or an e500mc core plugged in.
 
 This means that the IVOR setup can't be based on compile time decisions,
 so instead we have to do a runtime check which CPU generation we're
 running on.
 
 Signed-off-by: Alexander Graf ag...@suse.de
 ---
 arch/powerpc/cpu/mpc85xx/fixed_ivor.S |   21 -
 1 file changed, 16 insertions(+), 5 deletions(-)
 
 diff --git a/arch/powerpc/cpu/mpc85xx/fixed_ivor.S 
 b/arch/powerpc/cpu/mpc85xx/fixed_ivor.S
 index ebbb8c0..635a97e 100644
 --- a/arch/powerpc/cpu/mpc85xx/fixed_ivor.S
 +++ b/arch/powerpc/cpu/mpc85xx/fixed_ivor.S
 @@ -36,17 +36,25 @@
SET_IVOR(14, 0x1e0) /* Instruction TLB Error */
SET_IVOR(15, 0x040) /* Debug */
 
 -/* e500v1  e500v2 only */
 -#ifndef CONFIG_E500MC
 +  /* Check for CPU */
 +  mfpvr   r3
 +  srwir3, r3, 16
 +  /* Compare with e500mc PVR major number */
 +  li  r4, 0
 +  ori r4, r4, 0x8023
 +  cmpwr3, r4
 +
 +  /* e500v1  e500v2 only */
 +  bge 1f
SET_IVOR(32, 0x200) /* SPE Unavailable */
SET_IVOR(33, 0x220) /* Embedded FP Data */
SET_IVOR(34, 0x240) /* Embedded FP Round */
 -#endif
 +1:
 
SET_IVOR(35, 0x260) /* Performance monitor */
 
 -/* e500mc only */
 -#ifdef CONFIG_E500MC
 +  /* e500mc only */
 +  blt 2f
SET_IVOR(36, 0x280) /* Processor doorbell */
SET_IVOR(37, 0x2a0) /* Processor doorbell critical */
SET_IVOR(38, 0x2c0) /* Guest Processor doorbell */
 @@ -54,6 +62,8 @@
SET_IVOR(40, 0x300) /* Hypervisor system call */
SET_IVOR(41, 0x320) /* Hypervisor Priviledge */
 
 +#ifndef CONFIG_QEMU_E500
 +  /* QEMU guests runs in guest mode and can't access GIVORs */
SET_GIVOR(2, 0x060) /* Guest Data Storage */
SET_GIVOR(3, 0x080) /* Guest Instruction Storage */
SET_GIVOR(4, 0x0a0) /* Guest External Input */
 @@ -61,3 +71,4 @@
SET_GIVOR(13, 0x1c0) /* Guest Data TLB Error */
SET_GIVOR(14, 0x1e0) /* Guest Instruction TLB Error */
 #endif
 +2:
 
 Again, let's please just remove this entire file.
 
 I can remove it, but it's a pretty drastic change from the original
 behavior that was introduced 4 1/2 years ago:
 
  http://lists.denx.de/pipermail/u-boot/2009-August/058670.html
 
 I assume the idea was to give OSs one thing less to worry about (IVOR
 setting). If any OS in between 2009 and now relied on that fact, we'll
 break it by removing this code.
 
 Any such OS would already be broken on pre-2009 U-Boot.  Linux doesn't
 rely on it.  Neither the code nor the commit message gives a sufficient
 rationale, and Kumar didn't answer when asked.  It's incomplete (doesn't
 include e6500 IVORs).  It doesn't work on e6500 secondary threads.  The

I thought e6500 has hard coded IVORs which is the whole point of this exercise? 
Or am I wrong there?


Alex

 reset value of these registers is documented as zero, so it's not like
 we're just putting things back the way they were.  It only happens
 (except on secondary cores) when the bootm/bootz commands are used, not
 when using the ELF loader or the go command, nor when using bootm with
 IH_TYPE_STANDALONE.
 
 Does anyone know of an OS that actually depends on this?
 
 -Scott
 
 

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


Re: [U-Boot] [PATCH v2 5/6] PPC 85xx: Find PCI host controllers on ppce500 from device tree

2014-02-07 Thread Alexander Graf

On 06.02.2014, at 23:52, Scott Wood scottw...@freescale.com wrote:

 On Thu, 2014-02-06 at 14:26 +0100, Alexander Graf wrote:
 On 04.02.2014, at 03:47, Scott Wood scottw...@freescale.com wrote:
 
 On Fri, 2014-01-31 at 12:16 +0100, Alexander Graf wrote:
 The definition of our ppce500 PV machine is that every address is 
 dynamically
 determined through device tree bindings.
 
 So don't hardcode where PCI devices are in our physical memory layout but 
 instead
 read them dynamically from the device tree we get passed on boot.
 
 Would it be difficult to make the QEMU emulation properly implement
 access windows?
 
 What are access windows? You mean BAR region offsets? Not too hard I
 suppose, but it adds complexity which we were trying to avoid, no?
 
 It would remove U-Boot complexity (unlike the LAW stuff where we just
 skip it) because we wouldn't need to care about QEMU's default settings.
 It should be easier to do than LAW support, and more useful (e.g. Linux
 currently programs this as well, we just get lucky that it misuses the
 device tree as configuration information).

What complexity would it remove? We would still need to find the configuration 
space for the access windows, configure them and then even go as far as 
modifying the original device tree so we expose the new windows.

 
 +{
 +  int len;
 +  const uint32_t *prop;
 +
 +  prop = fdt_getprop(fdt, node, property, len);
 +
 +  if (!prop)
 +  return defval;
 +
 +  if (len  ((off + num) * sizeof(uint32_t)))
 +  panic(Invalid fdt);
 +
 +  prop += off;
 +
 +  switch (num) {
 +  case 1:
 +  return *prop;
 +  case 2:
 +  return *(const uint64_t *)prop;
 +  }
 +
 
 What about this function is specific to qemu-ppce500?
 
 Nothing. But the less common code I touch the less I can break.
 
 The more that line of thought is applied, the uglier the codebase we'll
 end up with. :-)
 
 There seems to be an fdt helper framework that's only targeted at a few ARM
 devices - not sure what to make of that.
 
 Make use of whatever parts you can, and extend it with the missing bits
 you need.  There's also common/fdt_support.c which is definitely not
 just used by ARM.
 
 +   panic(Invalid cell size);
 +}
 
 s/cell size/cell count/
 
 +static uint32_t myfdt_one_cell(const void *fdt, int node, const char 
 *property,
 + uint32_t defval)
 +{
 +  return myfdt_readcells(fdt, node, property, 1, 0, defval);
 +}
 
 This looks a lot like fdt_getprop_u32_default(), except for int node
 versus path.
 
 Well, I use it inside of a loop where I don't have the path :).
 
 It still indicates where the proper place for code like this is. :-)
 
 +static void map_tlb1_io(ulong virt_addr, uint64_t phys_addr, uint64_t 
 size)
 +{
 +  unsigned int max_cam, tsize_mask;
 +  int i;
 +
 +  if ((mfspr(SPRN_MMUCFG)  MMUCFG_MAVN) == MMUCFG_MAVN_V1) {
 +  /* Convert (4^max) kB to (2^max) bytes */
 +  max_cam = ((mfspr(SPRN_TLB1CFG)  16)  0xf) * 2 + 10;
 +  tsize_mask = ~1U;
 +  } else {
 +  /* Convert (2^max) kB to (2^max) bytes */
 +  max_cam = __ilog2(mfspr(SPRN_TLB1PS)) + 10;
 +  tsize_mask = ~0U;
 +  }
 +
 +  for (i = 0; size  i  8; i++) {
 +  int tlb_index = find_free_tlbcam();
 +  u32 camsize = __ilog2_u64(size)  tsize_mask;
 +  u32 align = __ilog2(virt_addr)  tsize_mask;
 +  unsigned int tlb_size;
 +
 +  if (tlb_index == -1)
 +  break;
 +
 +  if (align == -2) align = max_cam;
 
 -2?  Besides align being unsigned, if this is meant to handle the case
 where virt_addr is zero, that's undefined for __ilog2() (don't rely on
 it being implemented with cntlzw), and you're not handling the MMUv2
 case.
 
 I merely copied this from tlb.c's setup_ddr_tlbs_phys() and adjusted it
 slightly to let me choose the target virt address.
 
 Would you prefer if I generalize setup_ddr_tlbs_phys() inside tlb.c and
 export that function there?
 
 Yes.
 
 And maybe fix that align == -2 bug while you're at it. :-)

I'll leave that to you :P


Alex

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


[U-Boot] [PATCH v2] Add support for BR KWB Motherboard

2014-02-07 Thread Hannes Petermaier
Adds support for Bernecker  Rainer Industrieelektronik GmbH KWB
Motherboard, using TI's AM3352 SoC.

Most of code is derived from TI's AM335x_EVM

Signed-off-by: Hannes Petermaier oe5...@oevsv.at
Cc: tr...@ti.com
---
---
Changes for v2:
   - Coding Style cleanup
   - using common/shared code sections of other BR Motherboards
   - common files are also included in tsereies board

 arch/arm/include/asm/arch-am33xx/cpu.h |6 +-
 board/BuR/common/bur_common.h  |   22 +++
 board/BuR/common/common.c  |  216 
 board/BuR/kwb/Makefile |   12 ++
 board/BuR/kwb/board.c  |  240 
 board/BuR/kwb/mux.c|  195 ++
 boards.cfg |1 +
 include/configs/bur_am335x_common.h|  197 ++
 include/configs/kwb.h  |  128 +
 9 files changed, 1015 insertions(+), 2 deletions(-)
 create mode 100644 board/BuR/common/bur_common.h
 create mode 100644 board/BuR/common/common.c
 create mode 100644 board/BuR/kwb/Makefile
 create mode 100644 board/BuR/kwb/board.c
 create mode 100644 board/BuR/kwb/mux.c
 create mode 100644 include/configs/bur_am335x_common.h
 create mode 100644 include/configs/kwb.h

diff --git a/arch/arm/include/asm/arch-am33xx/cpu.h 
b/arch/arm/include/asm/arch-am33xx/cpu.h
index 9febfa2..248dc4d 100644
--- a/arch/arm/include/asm/arch-am33xx/cpu.h
+++ b/arch/arm/include/asm/arch-am33xx/cpu.h
@@ -171,7 +171,8 @@ struct cm_wkuppll {
unsigned int resv11[1];
unsigned int wkup_uart0ctrl;/* offset 0xB4 */
unsigned int wkup_i2c0ctrl; /* offset 0xB8 */
-   unsigned int resv12[7];
+   unsigned int wkup_adctscctrl;   /* offset 0xBC */
+   unsigned int resv12[6];
unsigned int divm6dpllcore; /* offset 0xD8 */
 };
 
@@ -221,7 +222,8 @@ struct cm_perpll {
unsigned int tpccclkctrl;   /* offset 0xBC */
unsigned int dcan0clkctrl;  /* offset 0xC0 */
unsigned int dcan1clkctrl;  /* offset 0xC4 */
-   unsigned int resv6[2];
+   unsigned int resv6;
+   unsigned int epwmss1clkctrl;/* offset 0xCC */
unsigned int emiffwclkctrl; /* offset 0xD0 */
unsigned int epwmss0clkctrl;/* offset 0xD4 */
unsigned int epwmss2clkctrl;/* offset 0xD8 */
diff --git a/board/BuR/common/bur_common.h b/board/BuR/common/bur_common.h
new file mode 100644
index 000..15225b0
--- /dev/null
+++ b/board/BuR/common/bur_common.h
@@ -0,0 +1,22 @@
+/*
+ * bur_comon.h
+ *
+ * common board information header for BR boards
+ *
+ * Copyright (C) 2013 Hannes Petermaier oe5...@oevsv.at
+ * Bernecker  Rainer Industrieelektronik GmbH - http://www.br-automation.com
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#ifndef _BUR_COMMON_H_
+#define _BUR_COMMON_H_
+
+void blink(u32 blinks, u32 intervall, u32 pin);
+void pmicsetup(u32 mpupll);
+void enable_uart0_pin_mux(void);
+void enable_i2c0_pin_mux(void);
+void enable_board_pin_mux(void);
+int board_eth_init(bd_t *bis);
+
+#endif
diff --git a/board/BuR/common/common.c b/board/BuR/common/common.c
new file mode 100644
index 000..6d187ea
--- /dev/null
+++ b/board/BuR/common/common.c
@@ -0,0 +1,216 @@
+/*
+ * common.c
+ *
+ * common board functions for BR boards
+ *
+ * Copyright (C) 2013 Hannes Petermaier oe5...@oevsv.at
+ * Bernecker  Rainer Industrieelektronik GmbH - http://www.br-automation.com
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ *
+ */
+
+#include common.h
+#include errno.h
+#include spl.h
+#include asm/arch/cpu.h
+#include asm/arch/hardware.h
+#include asm/arch/omap.h
+#include asm/arch/clock.h
+#include asm/arch/gpio.h
+#include asm/arch/sys_proto.h
+#include asm/io.h
+#include asm/gpio.h
+#include i2c.h
+#include miiphy.h
+#include cpsw.h
+#include power/tps65217.h
+#include bur_common.h
+
+static struct ctrl_dev *cdev = (struct ctrl_dev *)CTRL_DEVICE_BASE;
+/* --*/
+void blink(u32 blinks, u32 intervall, u32 pin)
+{
+   gpio_direction_output(pin, 0);
+   int val = 0;
+
+   do {
+   val ^= 0x01;
+   gpio_set_value(pin, val);
+   mdelay(intervall);
+   } while (blinks--);
+
+   gpio_set_value(pin, 0);
+}
+#ifdef CONFIG_SPL_BUILD
+void pmicsetup(u32 mpupll)
+{
+   int mpu_vdd;
+   int usb_cur_lim;
+
+   /* setup I2C */
+   enable_i2c0_pin_mux();
+   i2c_init(CONFIG_SYS_OMAP24_I2C_SPEED, CONFIG_SYS_OMAP24_I2C_SLAVE);
+
+   if (i2c_probe(TPS65217_CHIP_PM)) {
+   puts(PMIC (0x24) not found! skip further initalization.\n);
+   return;
+   }
+
+   /* Get the frequency which is defined by device fuses */
+   dpll_mpu_opp100.m = am335x_get_efuse_mpu_max_freq(cdev);
+   printf(detected max. frequency: %d - , dpll_mpu_opp100.m);
+
+   if (0 != mpupll) {
+ 

[U-Boot] [PATCH 0/15] Follow-up for Kbuild series: more misc targets and short logs

2014-02-07 Thread Masahiro Yamada
Kbuild series must be applied before this series.

This series refactors a little, imports more Kbuild features
and convert many rules to Kbuild style.

I think most of rules will be displayed in short log formats
by applying this series.
(But I know there are still some old style rules.
I need more efforts...)



Masahiro Yamada (15):
  kbuild: consolidate version and timestamp headers generation
  kbuild: abolish depend target
  kbuild: move asm-offsets.h rules to ./Kbuild
  kbuild: rename OBJCFLAGS to OBJCOPYFLAGS
  kbuild: Add $(Q) when descending into subdirectories
  kbuild: use shorten logs objcopy rules
  kbuild: use shorten logs for mkimage rules
  kbuild: use shorten logs for cat rules
  kbuild: use shorten logs for combined rules of mkimage, padding and
cat
  kbuild: use shorten log for linking u-boot
  kbuild: use shorten logs for misc targets
  kbuild: use shorten logs for IMX images
  kbuild: refactor more IMX image rules
  kbuild: support building signle targets
  kbuild: add misc targets, help, ubootrelease, ubootversion

 Kbuild|  87 +
 Makefile  | 482 --
 arch/arm/config.mk|  14 +-
 arch/arm/cpu/arm1136/config.mk|  10 -
 arch/arm/cpu/arm926ejs/config.mk  |  10 -
 arch/arm/cpu/armv7/am33xx/config.mk   |   4 +-
 arch/arm/cpu/armv7/config.mk  |  10 -
 arch/arm/cpu/armv7/omap3/config.mk|   2 +-
 arch/arm/cpu/armv7/omap4/config.mk|   2 +-
 arch/arm/cpu/armv7/omap5/config.mk|   2 +-
 arch/arm/cpu/pxa/config.mk|   2 +-
 arch/arm/imx-common/Makefile  |  85 +++--
 arch/blackfin/cpu/Makefile|   6 +-
 arch/mips/config.mk   |   2 +-
 arch/sandbox/config.mk|   4 +
 board/hymod/config.mk |   2 +-
 config.mk |   2 +-
 doc/DocBook/Makefile  |   2 +-
 examples/api/Makefile |  46 +--
 examples/standalone/Makefile  |  35 +-
 nand_spl/board/amcc/acadia/Makefile   |   4 +-
 nand_spl/board/amcc/bamboo/Makefile   |   4 +-
 nand_spl/board/amcc/canyonlands/Makefile  |   4 +-
 nand_spl/board/amcc/kilauea/Makefile  |   4 +-
 nand_spl/board/amcc/sequoia/Makefile  |   4 +-
 nand_spl/board/freescale/mpc8315erdb/Makefile |   4 +-
 nand_spl/board/freescale/mpc8536ds/Makefile   |   4 +-
 nand_spl/board/freescale/mpc8569mds/Makefile  |   4 +-
 nand_spl/board/freescale/mpc8572ds/Makefile   |   4 +-
 nand_spl/board/freescale/p1023rds/Makefile|   4 +-
 nand_spl/board/freescale/p1_p2_rdb/Makefile   |   4 +-
 nand_spl/board/sheldon/simpc8313/Makefile |   4 +-
 scripts/kernel-doc|   4 +-
 spl/Makefile  |  41 ++-
 tools/scripts/make-asm-offsets|  27 --
 35 files changed, 562 insertions(+), 367 deletions(-)
 create mode 100644 Kbuild
 delete mode 100755 tools/scripts/make-asm-offsets

-- 
1.8.3.2

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


[U-Boot] [PATCH 08/15] kbuild: use shorten logs for cat rules

2014-02-07 Thread Masahiro Yamada
Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---

 Makefile | 23 +++
 1 file changed, 15 insertions(+), 8 deletions(-)

diff --git a/Makefile b/Makefile
index d43d09b..80c0b1b 100644
--- a/Makefile
+++ b/Makefile
@@ -751,14 +751,17 @@ quiet_cmd_mkimage = UIMAGE  $@
 cmd_mkimage = $(objtree)/tools/mkimage $(MKIMAGEFLAGS_$(@F)) -d $ $@ \
$(if $(KBUILD_VERBOSE:1=), /dev/null)
 
+quiet_cmd_cat = CAT $@
+cmd_cat = cat $(filter-out $(PHONY), $^)  $@
+
 all:   $(ALL-y)
 
 PHONY += dtbs
 dtbs dts/dt.dtb: checkdtc u-boot
$(Q)$(MAKE) $(build)=dts dtbs
 
-u-boot-dtb.bin: u-boot.bin dts/dt.dtb
-   cat $^ $@
+u-boot-dtb.bin: u-boot.bin dts/dt.dtb FORCE
+   $(call if_changed,cat)
 
 OBJCOPYFLAGS_u-boot.hex := -O ihex
 
@@ -880,13 +883,13 @@ u-boot-nodtb-tegra.bin: spl/u-boot-spl.bin u-boot.bin
rm spl/u-boot-spl-pad.bin
 
 ifeq ($(CONFIG_OF_SEPARATE),y)
-u-boot-dtb-tegra.bin: u-boot-nodtb-tegra.bin dts/dt.dtb
-   cat $^  $@
+u-boot-dtb-tegra.bin: u-boot-nodtb-tegra.bin dts/dt.dtb FORCE
+   $(call if_changed,cat)
 endif
 endif
 
-u-boot-img.bin: spl/u-boot-spl.bin u-boot.img
-   cat spl/u-boot-spl.bin u-boot.img  $@
+u-boot-img.bin: spl/u-boot-spl.bin u-boot.img FORCE
+   $(call if_changed,cat)
 
 # PPC4xx needs the SPL at the end of the image, since the reset vector
 # is located at 0xfffc. So we can't use the u-boot-img.bin target
@@ -1054,11 +1057,15 @@ depend dep:
 u-boot.lds: $(LDSCRIPT) prepare
$(CPP) $(cpp_flags) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - $ 
$@
 
+PHONY += nand_spl
 nand_spl: prepare
$(Q)$(MAKE) $(build)=nand_spl/board/$(BOARDDIR) all
 
-u-boot-nand.bin:   nand_spl u-boot.bin
-   cat nand_spl/u-boot-spl-16k.bin u-boot.bin  u-boot-nand.bin
+nand_spl/u-boot-spl-16k.bin: nand_spl
+   @:
+
+u-boot-nand.bin: nand_spl/u-boot-spl-16k.bin u-boot.bin FORCE
+   $(call if_changed,cat)
 
 spl/u-boot-spl.bin: tools prepare
$(Q)$(MAKE) obj=spl -f $(srctree)/spl/Makefile all
-- 
1.8.3.2

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


[U-Boot] [PATCH 09/15] kbuild: use shorten logs for combined rules of mkimage, padding and cat

2014-02-07 Thread Masahiro Yamada
Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---

 Makefile | 79 +---
 1 file changed, 41 insertions(+), 38 deletions(-)

diff --git a/Makefile b/Makefile
index 80c0b1b..364b9be 100644
--- a/Makefile
+++ b/Makefile
@@ -754,6 +754,11 @@ cmd_mkimage = $(objtree)/tools/mkimage 
$(MKIMAGEFLAGS_$(@F)) -d $ $@ \
 quiet_cmd_cat = CAT $@
 cmd_cat = cat $(filter-out $(PHONY), $^)  $@
 
+append = cat $(filter-out $ $(PHONY), $^)  $@
+
+quiet_cmd_pad_cat = CAT $@
+cmd_pad_cat = $(cmd_objcopy)  $(append) || rm -f $@
+
 all:   $(ALL-y)
 
 PHONY += dtbs
@@ -819,25 +824,21 @@ u-boot.sha1:  u-boot.bin
 u-boot.dis:u-boot
$(OBJDUMP) -d $  $@
 
-# $@ is output, $(1) and $(2) are inputs, $(3) is padded intermediate,
-# $(4) is pad-to
-SPL_PAD_APPEND = \
-   $(OBJCOPY) $(OBJCOPYFLAGS) --pad-to=$(4) -I binary -O binary \
-   $(1) $(3); \
-   cat $(3) $(2)  $@; \
-   rm $(3)
-
 ifdef CONFIG_TPL
 SPL_PAYLOAD := tpl/u-boot-with-tpl.bin
 else
 SPL_PAYLOAD := u-boot.bin
 endif
 
-u-boot-with-spl.bin: spl/u-boot-spl.bin $(SPL_PAYLOAD)
-   $(call 
SPL_PAD_APPEND,$,$(SPL_PAYLOAD),spl/u-boot-spl-pad.bin,$(CONFIG_SPL_PAD_TO))
+OBJCOPYFLAGS_u-boot-with-spl.bin = -I binary -O binary \
+  --pad-to=$(CONFIG_SPL_PAD_TO)
+u-boot-with-spl.bin: spl/u-boot-spl.bin $(SPL_PAYLOAD) FORCE
+   $(call if_changed,pad_cat)
 
-tpl/u-boot-with-tpl.bin: tpl/u-boot-tpl.bin u-boot.bin
-   $(call 
SPL_PAD_APPEND,$,u-boot.bin,tpl/u-boot-tpl-pad.bin,$(CONFIG_TPL_PAD_TO))
+OBJCOPYFLAGS_u-boot-with-tpl.bin = -I binary -O binary \
+  --pad-to=$(CONFIG_TPL_PAD_TO)
+tpl/u-boot-with-tpl.bin: tpl/u-boot-tpl.bin u-boot.bin FORCE
+   $(call if_changed,pad_cat)
 
 u-boot-with-spl.imx u-boot-with-nand-spl.imx: spl/u-boot-spl.bin u-boot.bin
$(Q)$(MAKE) $(build)=arch/arm/imx-common $(objtree)/$@
@@ -847,17 +848,15 @@ MKIMAGEFLAGS_u-boot.ubl = -n $(UBL_CONFIG) -T ublimage -e 
$(CONFIG_SYS_TEXT_BASE
 u-boot.ubl: u-boot-with-spl.bin FORCE
$(call if_changed,mkimage)
 
-u-boot.ais:   spl/u-boot-spl.bin u-boot.img
-   tools/mkimage -s -n $(if 
$(CONFIG_AIS_CONFIG_FILE),$(srctree)/$(CONFIG_AIS_CONFIG_FILE:%=%),/dev/null)
 \
-   -T aisimage \
-   -e $(CONFIG_SPL_TEXT_BASE) \
-   -d spl/u-boot-spl.bin \
-   spl/u-boot-spl.ais
-   $(OBJCOPY) $(OBJCOPYFLAGS) -I binary \
-   --pad-to=$(CONFIG_SPL_MAX_SIZE) -O binary \
-   spl/u-boot-spl.ais spl/u-boot-spl-pad.ais
-   cat spl/u-boot-spl-pad.ais u-boot.img  u-boot.ais
+MKIMAGEFLAGS_u-boot-spl.ais = -s -n $(if $(CONFIG_AIS_CONFIG_FILE), \
+   $(srctree)/$(CONFIG_AIS_CONFIG_FILE:%=%),/dev/null) \
+   -T aisimage -e $(CONFIG_SPL_TEXT_BASE)
+spl/u-boot-spl.ais: spl/u-boot-spl.bin FORCE
+   $(call if_changed,mkimage)
 
+OBJCOPYFLAGS_u-boot.ais = -I binary -O binary --pad-to=$(CONFIG_SPL_MAX_SIZE)
+u-boot.ais: spl/u-boot-spl.ais u-boot.img FORCE
+   $(call if_changed,pad_cat)
 
 u-boot.sb: u-boot.bin spl/u-boot-spl.bin
$(Q)$(MAKE) $(build)=arch/arm/cpu/arm926ejs/mxs $(objtree)/u-boot.sb
@@ -868,19 +867,20 @@ u-boot.sb: u-boot.bin spl/u-boot-spl.bin
 # SPL image (with mkimage header) and not the binary. Otherwise the resulting 
image
 # which is loaded/copied by the ROM bootloader to SRAM doesn't fit.
 # The resulting image containing both U-Boot images is called u-boot.spr
-u-boot.spr:u-boot.img spl/u-boot-spl.bin
-   tools/mkimage -A $(ARCH) -T firmware -C none \
-   -a $(CONFIG_SPL_TEXT_BASE) -e $(CONFIG_SPL_TEXT_BASE) -n 
XLOADER \
-   -d spl/u-boot-spl.bin $@
-   $(OBJCOPY) -I binary -O binary \
-   --pad-to=$(CONFIG_SPL_PAD_TO) --gap-fill=0xff $@
-   cat u-boot.img  $@
+MKIMAGEFLAGS_u-boot-spl.img = -A $(ARCH) -T firmware -C none \
+   -a $(CONFIG_SPL_TEXT_BASE) -e $(CONFIG_SPL_TEXT_BASE) -n XLOADER
+spl/u-boot-spl.img: spl/u-boot-spl.bin FORCE
+   $(call if_changed,mkimage)
+
+OBJCOPYFLAGS_u-boot.spr = -I binary -O binary --pad-to=$(CONFIG_SPL_PAD_TO) \
+ --gap-fill=0xff
+u-boot.spr: spl/u-boot-spl.img u-boot.img FORCE
+   $(call if_changed,pad_cat)
 
 ifneq ($(CONFIG_TEGRA),)
-u-boot-nodtb-tegra.bin: spl/u-boot-spl.bin u-boot.bin
-   $(OBJCOPY) $(OBJCOPYFLAGS) --pad-to=$(CONFIG_SYS_TEXT_BASE) -O 
binary spl/u-boot-spl spl/u-boot-spl-pad.bin
-   cat spl/u-boot-spl-pad.bin u-boot.bin  $@
-   rm spl/u-boot-spl-pad.bin
+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
+   $(call if_changed,pad_cat)
 
 ifeq ($(CONFIG_OF_SEPARATE),y)
 

[U-Boot] [PATCH 03/15] kbuild: move asm-offsets.h rules to ./Kbuild

2014-02-07 Thread Masahiro Yamada
Generate include/generated/generic-asm-offsets.h and
include/generated/asm-offsets.h in ./Kbuild.

This commit also changes the include guard.

Before this commit, __ASM_OFFSETS_H__ was used for both of them.
So we could not include generic-asm-offsets.h and asm-offsets.h
at the same time.

This commit renames the include guard of the former to
__GENERIC_ASM_OFFSETS_H__.

Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---

 Kbuild | 87 ++
 Makefile   | 36 +
 tools/scripts/make-asm-offsets | 27 -
 3 files changed, 89 insertions(+), 61 deletions(-)
 create mode 100644 Kbuild
 delete mode 100755 tools/scripts/make-asm-offsets

diff --git a/Kbuild b/Kbuild
new file mode 100644
index 000..1d89761
--- /dev/null
+++ b/Kbuild
@@ -0,0 +1,87 @@
+#
+# Kbuild for top-level directory of U-Boot
+# This file takes care of the following:
+# 1) Generate generic-asm-offsets.h
+# 2) Generate asm-offsets.h
+
+#
+# 1) Generate generic-asm-offsets.h
+
+generic-offsets-file := include/generated/generic-asm-offsets.h
+
+always  := $(generic-offsets-file)
+targets := $(generic-offsets-file) lib/asm-offsets.s
+
+quiet_cmd_generic-offsets = GEN $@
+define cmd_generic-offsets
+   (set -e; \
+echo #ifndef __GENERIC_ASM_OFFSETS_H__; \
+echo #define __GENERIC_ASM_OFFSETS_H__; \
+echo /*; \
+echo  * DO NOT MODIFY.; \
+echo  *; \
+echo  * This file was generated by Kbuild; \
+echo  *; \
+echo  */; \
+echo ; \
+sed -ne $(sed-y) $; \
+echo ; \
+echo #endif )  $@
+endef
+
+# We use internal kbuild rules to avoid the is up to date message from make
+lib/asm-offsets.s: lib/asm-offsets.c FORCE
+   $(Q)mkdir -p $(dir $@)
+   $(call if_changed_dep,cc_s_c)
+
+$(obj)/$(generic-offsets-file): lib/asm-offsets.s Kbuild
+   $(Q)mkdir -p $(dir $@)
+   $(call cmd,generic-offsets)
+
+#
+# 2) Generate asm-offsets.h
+#
+
+ifneq ($(wildcard $(srctree)/$(CPUDIR)/$(SOC)/asm-offsets.c),)
+offsets-file := include/generated/asm-offsets.h
+endif
+
+always  += $(offsets-file)
+targets += $(offsets-file)
+targets += $(CPUDIR)/$(SOC)/asm-offsets.s
+
+
+# Default sed regexp - multiline due to syntax constraints
+define sed-y
+   /^-/{s:-#\(.*\):/* \1 */:; \
+   s:^-\([^ ]*\) [\$$#]*\([-0-9]*\) \(.*\):#define \1 \2 /* \3 */:; \
+   s:^-\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; \
+   s:-::; p;}
+endef
+
+CFLAGS_asm-offsets.o := -DDO_DEPS_ONLY
+
+quiet_cmd_offsets = GEN $@
+define cmd_offsets
+   (set -e; \
+echo #ifndef __ASM_OFFSETS_H__; \
+echo #define __ASM_OFFSETS_H__; \
+echo /*; \
+echo  * DO NOT MODIFY.; \
+echo  *; \
+echo  * This file was generated by Kbuild; \
+echo  *; \
+echo  */; \
+echo ; \
+sed -ne $(sed-y) $; \
+echo ; \
+echo #endif )  $@
+endef
+
+# We use internal kbuild rules to avoid the is up to date message from make
+$(CPUDIR)/$(SOC)/asm-offsets.s: $(CPUDIR)/$(SOC)/asm-offsets.c FORCE
+   $(Q)mkdir -p $(dir $@)
+   $(call if_changed_dep,cc_s_c)
+
+$(obj)/$(offsets-file): $(CPUDIR)/$(SOC)/asm-offsets.s
+   $(call cmd,offsets)
diff --git a/Makefile b/Makefile
index fb6cf8e..866343e 100644
--- a/Makefile
+++ b/Makefile
@@ -989,9 +989,8 @@ prepare1: prepare2 $(version_h) $(timestamp_h)
 
 archprepare: prepare1 scripts_basic
 
-prepare0: archprepare FORCE include/generated/generic-asm-offsets.h \
-   include/generated/asm-offsets.h
-   @:
+prepare0: archprepare FORCE
+   $(Q)$(MAKE) $(build)=.
 
 # All the preparing..
 prepare: prepare0
@@ -1116,37 +1115,6 @@ checkdtc:
false; \
fi
 
-quiet_cmd_offsets = GEN $@
-  cmd_offsets = $(srctree)/tools/scripts/make-asm-offsets $ $@
-
-include/generated/generic-asm-offsets.h: lib/asm-offsets.s
-   $(call cmd,offsets)
-
-quiet_cmd_asm-offsets.s = CC  $@
-  cmd_asm-offsets.s = mkdir -p lib; \
-   $(CC) -DDO_DEPS_ONLY \
-   $(c_flags) $(CFLAGS_$(BCURDIR)/$(@F)) $(CFLAGS_$(BCURDIR)) \
-   -o $@ $ -c -S
-
-lib/asm-offsets.s: $(srctree)/lib/asm-offsets.c include/config.h
-   $(call cmd,asm-offsets.s)
-
-include/generated/asm-offsets.h: $(CPUDIR)/$(SOC)/asm-offsets.s
-   $(call cmd,offsets)
-
-quiet_cmd_soc_asm-offsets.s = CC  $@
-  cmd_soc_asm-offsets.s = mkdir -p $(CPUDIR)/$(SOC); \
-   if [ -f $(srctree)/$(CPUDIR)/$(SOC)/asm-offsets.c ];then \
-   $(CC) -DDO_DEPS_ONLY \
-   $(c_flags) $(CFLAGS_$(BCURDIR)/$(@F)) $(CFLAGS_$(BCURDIR)) \
-   -o $@ $(srctree)/$(CPUDIR)/$(SOC)/asm-offsets.c -c -S; \
-   else \
-   touch $@; \
-   fi
-
-$(CPUDIR)/$(SOC)/asm-offsets.s:include/config.h
-   $(call cmd,soc_asm-offsets.s)
-
 

[U-Boot] [PATCH 14/15] kbuild: support building signle targets

2014-02-07 Thread Masahiro Yamada
Import build rules of single targets from Linux 3.13.

Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---

 Makefile | 52 
 1 file changed, 52 insertions(+)

diff --git a/Makefile b/Makefile
index ad9c315..be61a15 100644
--- a/Makefile
+++ b/Makefile
@@ -1268,6 +1268,58 @@ scripts: ;
 endif #ifeq ($(config-targets),1)
 endif #ifeq ($(mixed-targets),1)
 
+# Single targets
+# ---
+# Single targets are compatible with:
+# - build with mixed source and output
+# - build with separate output dir 'make O=...'
+# - external modules
+#
+#  target-dir = where to store outputfile
+#  build-dir  = directory in kernel source tree to use
+
+ifeq ($(KBUILD_EXTMOD),)
+build-dir  = $(patsubst %/,%,$(dir $@))
+target-dir = $(dir $@)
+else
+zap-slash=$(filter-out .,$(patsubst %/,%,$(dir $@)))
+build-dir  = $(KBUILD_EXTMOD)$(if $(zap-slash),/$(zap-slash))
+target-dir = $(if $(KBUILD_EXTMOD),$(dir $),$(dir $@))
+endif
+
+%.s: %.c prepare scripts FORCE
+   $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
+%.i: %.c prepare scripts FORCE
+   $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
+%.o: %.c prepare scripts FORCE
+   $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
+%.lst: %.c prepare scripts FORCE
+   $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
+%.s: %.S prepare scripts FORCE
+   $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
+%.o: %.S prepare scripts FORCE
+   $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
+%.symtypes: %.c prepare scripts FORCE
+   $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
+
+# Modules
+/: prepare scripts FORCE
+   $(cmd_crmodverdir)
+   $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \
+   $(build)=$(build-dir)
+%/: prepare scripts FORCE
+   $(cmd_crmodverdir)
+   $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \
+   $(build)=$(build-dir)
+%.ko: prepare scripts FORCE
+   $(cmd_crmodverdir)
+   $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1)   \
+   $(build)=$(build-dir) $(@:.ko=.o)
+   $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost
+
+# FIXME Should go into a make.lib or something 
+# ===
+
 quiet_cmd_rmdirs = $(if $(wildcard $(rm-dirs)),CLEAN   $(wildcard $(rm-dirs)))
   cmd_rmdirs = rm -rf $(rm-dirs)
 
-- 
1.8.3.2

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


[U-Boot] [PATCH 15/15] kbuild: add misc targets, help, ubootrelease, ubootversion

2014-02-07 Thread Masahiro Yamada
help target has been copied from Linux 3.13 and adjusted
for U-Boot.
Unlike Linux, cleaning is done on 4 levels:
clean, clobber, mrproper, distclean.

Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---

 Makefile | 65 +---
 1 file changed, 58 insertions(+), 7 deletions(-)

diff --git a/Makefile b/Makefile
index be61a15..2618026 100644
--- a/Makefile
+++ b/Makefile
@@ -415,7 +415,7 @@ timestamp_h := include/generated/timestamp_autogenerated.h
 
 no-dot-config-targets := clean clobber mrproper distclean \
 cscope TAGS %tags help %docs check% coccicheck \
-backup
+ubootversion backup
 
 config-targets := 0
 mixed-targets  := 0
@@ -1082,12 +1082,6 @@ TAG_SUBDIRS := $(u-boot-dirs) include
 FIND := find
 FINDFLAGS := -L
 
-PHONY += checkstack
-
-checkstack:
-   $(OBJDUMP) -d u-boot $$(find . -name u-boot-spl) | \
-   $(PERL) $(src)/scripts/checkstack.pl $(ARCH)
-
 tags ctags:
ctags -w -o ctags `$(FIND) $(FINDFLAGS) $(TAG_SUBDIRS) \
-name '*.[chS]' -print`
@@ -1253,6 +1247,51 @@ backup:
F=`basename $(TOPDIR)` ; cd .. ; \
gtar --force-local -zcvf `LC_ALL=C date +$$F-%Y-%m-%d-%T.tar.gz` $$F
 
+help:
+   @echo  'Cleaning targets:'
+   @echo  '  clean   - Remove most generated files but keep the 
config and'
+   @echo  'necessities for testing u-boot'
+   @echo  '  clobber - Remove most generated files but keep the 
config'
+   @echo  '  mrproper- Remove all generated files + config + 
various backup files'
+   @echo  '  distclean   - mrproper + remove editor backup and patch 
files'
+   @echo  ''
+# uncomment after adding Kconfig feature
+#  @echo  'Configuration targets:'
+#  @$(MAKE) -f $(srctree)/scripts/kconfig/Makefile help
+#  @echo  ''
+   @echo  'Other generic targets:'
+   @echo  '  all - Build all necessary images depending on 
configuration'
+   @echo  '  u-boot  - Build the bare u-boot'
+   @echo  '  dir/- Build all files in dir and below'
+   @echo  '  dir/file.[oisS] - Build specified target only'
+   @echo  '  dir/file.lst- Build specified mixed source/assembly 
target only'
+   @echo  '(requires a recent binutils and recent 
build (System.map))'
+   @echo  '  tags/TAGS   - Generate tags file for editors'
+   @echo  '  cscope  - Generate cscope index'
+   @echo  '  ubootrelease- Output the release version string'
+   @echo  '  ubootversion- Output the version stored in Makefile'
+   @echo  ''
+   @echo  'Static analysers'
+   @echo  '  checkstack  - Generate a list of stack hogs'
+   @echo  ''
+   @echo  'Documentation targets:'
+   @$(MAKE) -f $(srctree)/doc/DocBook/Makefile dochelp
+   @echo  ''
+   @echo  '  make V=0|1 [targets] 0 = quiet build (default), 1 = verbose 
build'
+   @echo  '  make V=2   [targets] 2 = give reason for rebuild of target'
+   @echo  '  make O=dir [targets] Locate all output files in dir, 
including .config'
+   @echo  '  make C=1   [targets] Check all c source with $$CHECK (sparse 
by default)'
+   @echo  '  make C=2   [targets] Force check of all c source with $$CHECK'
+   @echo  '  make RECORDMCOUNT_WARN=1 [targets] Warn about ignored mcount 
sections'
+   @echo  '  make W=n   [targets] Enable extra gcc checks, n=1,2,3 where'
+   @echo  '1: warnings which may be relevant and do not 
occur too often'
+   @echo  '2: warnings which occur quite often but may 
still be relevant'
+   @echo  '3: more obscure warnings, can most likely be 
ignored'
+   @echo  'Multiple levels can be combined with W=12 or 
W=123'
+   @echo  ''
+   @echo  'Execute make or make all to build all targets marked with 
[*] '
+   @echo  'For further info see the ./README file'
+
 
 # Documentation targets
 # ---
@@ -1268,6 +1307,18 @@ scripts: ;
 endif #ifeq ($(config-targets),1)
 endif #ifeq ($(mixed-targets),1)
 
+PHONY += checkstack ubootrelease ubootversion
+
+checkstack:
+   $(OBJDUMP) -d u-boot $$(find . -name u-boot-spl) | \
+   $(PERL) $(src)/scripts/checkstack.pl $(ARCH)
+
+ubootrelease:
+   @echo $(UBOOTVERSION)$$($(CONFIG_SHELL) 
$(srctree)/scripts/setlocalversion $(srctree))
+
+ubootversion:
+   @echo $(UBOOTVERSION)
+
 # Single targets
 # ---
 # Single targets are compatible with:
-- 
1.8.3.2

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


[U-Boot] [PATCH 04/15] kbuild: rename OBJCFLAGS to OBJCOPYFLAGS

2014-02-07 Thread Masahiro Yamada
Rename OBJCFLAGS to OBJCOPYFLAGS beforehand to use
cmd_objcopy in scripts/Makefile.lib in an upcoming commit.

Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---

 Makefile  | 16 
 arch/arm/config.mk|  4 ++--
 arch/arm/cpu/pxa/config.mk|  2 +-
 arch/arm/imx-common/Makefile  |  4 ++--
 arch/mips/config.mk   |  2 +-
 board/hymod/config.mk |  2 +-
 config.mk |  2 +-
 nand_spl/board/amcc/acadia/Makefile   |  4 ++--
 nand_spl/board/amcc/bamboo/Makefile   |  4 ++--
 nand_spl/board/amcc/canyonlands/Makefile  |  4 ++--
 nand_spl/board/amcc/kilauea/Makefile  |  4 ++--
 nand_spl/board/amcc/sequoia/Makefile  |  4 ++--
 nand_spl/board/freescale/mpc8315erdb/Makefile |  4 ++--
 nand_spl/board/freescale/mpc8536ds/Makefile   |  4 ++--
 nand_spl/board/freescale/mpc8569mds/Makefile  |  4 ++--
 nand_spl/board/freescale/mpc8572ds/Makefile   |  4 ++--
 nand_spl/board/freescale/p1023rds/Makefile|  4 ++--
 nand_spl/board/freescale/p1_p2_rdb/Makefile   |  4 ++--
 nand_spl/board/sheldon/simpc8313/Makefile |  4 ++--
 spl/Makefile  |  2 +-
 20 files changed, 41 insertions(+), 41 deletions(-)

diff --git a/Makefile b/Makefile
index 866343e..beca991 100644
--- a/Makefile
+++ b/Makefile
@@ -754,13 +754,13 @@ u-boot-dtb.bin: u-boot.bin dts/dt.dtb
cat $^ $@
 
 u-boot.hex:u-boot
-   $(OBJCOPY) ${OBJCFLAGS} -O ihex $ $@
+   $(OBJCOPY) $(OBJCOPYFLAGS) -O ihex $ $@
 
 u-boot.srec:   u-boot
-   $(OBJCOPY) ${OBJCFLAGS} -O srec $ $@
+   $(OBJCOPY) $(OBJCOPYFLAGS) -O srec $ $@
 
 u-boot.bin:u-boot
-   $(OBJCOPY) ${OBJCFLAGS} -O binary $ $@
+   $(OBJCOPY) $(OBJCOPYFLAGS) -O binary $ $@
$(call DO_STATIC_RELA,$,$@,$(CONFIG_SYS_TEXT_BASE))
$(BOARD_SIZE_CHECK)
 
@@ -770,10 +770,10 @@ u-boot.ldr:   u-boot
$(BOARD_SIZE_CHECK)
 
 u-boot.ldr.hex:u-boot.ldr
-   $(OBJCOPY) ${OBJCFLAGS} -O ihex $ $@ -I binary
+   $(OBJCOPY) $(OBJCOPYFLAGS) -O ihex $ $@ -I binary
 
 u-boot.ldr.srec:   u-boot.ldr
-   $(OBJCOPY) ${OBJCFLAGS} -O srec $ $@ -I binary
+   $(OBJCOPY) $(OBJCOPYFLAGS) -O srec $ $@ -I binary
 
 #
 # U-Boot entry point, needed for booting of full-blown U-Boot
@@ -811,7 +811,7 @@ u-boot.dis: u-boot
 # $@ is output, $(1) and $(2) are inputs, $(3) is padded intermediate,
 # $(4) is pad-to
 SPL_PAD_APPEND = \
-   $(OBJCOPY) ${OBJCFLAGS} --pad-to=$(4) -I binary -O binary \
+   $(OBJCOPY) $(OBJCOPYFLAGS) --pad-to=$(4) -I binary -O binary \
$(1) $(3); \
cat $(3) $(2)  $@; \
rm $(3)
@@ -846,7 +846,7 @@ u-boot.ais:   spl/u-boot-spl.bin u-boot.img
-e $(CONFIG_SPL_TEXT_BASE) \
-d spl/u-boot-spl.bin \
spl/u-boot-spl.ais
-   $(OBJCOPY) ${OBJCFLAGS} -I binary \
+   $(OBJCOPY) $(OBJCOPYFLAGS) -I binary \
--pad-to=$(CONFIG_SPL_MAX_SIZE) -O binary \
spl/u-boot-spl.ais spl/u-boot-spl-pad.ais
cat spl/u-boot-spl-pad.ais u-boot.img  u-boot.ais
@@ -871,7 +871,7 @@ u-boot.spr: u-boot.img spl/u-boot-spl.bin
 
 ifneq ($(CONFIG_TEGRA),)
 u-boot-nodtb-tegra.bin: spl/u-boot-spl.bin u-boot.bin
-   $(OBJCOPY) ${OBJCFLAGS} --pad-to=$(CONFIG_SYS_TEXT_BASE) -O 
binary spl/u-boot-spl spl/u-boot-spl-pad.bin
+   $(OBJCOPY) $(OBJCOPYFLAGS) --pad-to=$(CONFIG_SYS_TEXT_BASE) -O 
binary spl/u-boot-spl spl/u-boot-spl-pad.bin
cat spl/u-boot-spl-pad.bin u-boot.bin  $@
rm spl/u-boot-spl-pad.bin
 
diff --git a/arch/arm/config.mk b/arch/arm/config.mk
index 98c1253..8a65c34 100644
--- a/arch/arm/config.mk
+++ b/arch/arm/config.mk
@@ -108,7 +108,7 @@ endif
 
 # limit ourselves to the sections we want in the .bin.
 ifdef CONFIG_ARM64
-OBJCFLAGS += -j .text -j .rodata -j .data -j .u_boot_list -j .rela.dyn
+OBJCOPYFLAGS += -j .text -j .rodata -j .data -j .u_boot_list -j .rela.dyn
 else
-OBJCFLAGS += -j .text -j .rodata -j .hash -j .data -j .got.plt -j .u_boot_list 
-j .rel.dyn
+OBJCOPYFLAGS += -j .text -j .rodata -j .hash -j .data -j .got.plt -j 
.u_boot_list -j .rel.dyn
 endif
diff --git a/arch/arm/cpu/pxa/config.mk b/arch/arm/cpu/pxa/config.mk
index 986b11b..525f5d3 100644
--- a/arch/arm/cpu/pxa/config.mk
+++ b/arch/arm/cpu/pxa/config.mk
@@ -18,5 +18,5 @@ PLATFORM_CPPFLAGS += -mcpu=xscale
 #
 
 #ifdef CONFIG_SPL_BUILD
-OBJCFLAGS += -j .text.0 -j .text.1
+OBJCOPYFLAGS += -j .text.0 -j .text.1
 #endif
diff --git a/arch/arm/imx-common/Makefile b/arch/arm/imx-common/Makefile
index 9dda59d..88d6c0b 100644
--- 

[U-Boot] [PATCH 12/15] kbuild: use shorten logs for IMX images

2014-02-07 Thread Masahiro Yamada
Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---

 Makefile |  4 +-
 arch/arm/cpu/arm1136/config.mk   |  2 +-
 arch/arm/cpu/arm926ejs/config.mk |  2 +-
 arch/arm/cpu/armv7/config.mk |  2 +-
 arch/arm/imx-common/Makefile | 85 
 spl/Makefile |  4 +-
 6 files changed, 58 insertions(+), 41 deletions(-)

diff --git a/Makefile b/Makefile
index 907b013..5acf538 100644
--- a/Makefile
+++ b/Makefile
@@ -816,7 +816,7 @@ u-boot.img u-boot.kwb u-boot.pbl: u-boot.bin FORCE
$(call if_changed,mkimage)
 
 u-boot.imx: u-boot.bin
-   $(Q)$(MAKE) $(build)=arch/arm/imx-common $(objtree)/$@
+   $(Q)$(MAKE) $(build)=arch/arm/imx-common $@
 
 u-boot.sha1:   u-boot.bin
tools/ubsha1 u-boot.bin
@@ -841,7 +841,7 @@ tpl/u-boot-with-tpl.bin: tpl/u-boot-tpl.bin u-boot.bin FORCE
$(call if_changed,pad_cat)
 
 u-boot-with-spl.imx u-boot-with-nand-spl.imx: spl/u-boot-spl.bin u-boot.bin
-   $(Q)$(MAKE) $(build)=arch/arm/imx-common $(objtree)/$@
+   $(Q)$(MAKE) $(build)=arch/arm/imx-common $@
 
 MKIMAGEFLAGS_u-boot.ubl = -n $(UBL_CONFIG) -T ublimage -e 
$(CONFIG_SYS_TEXT_BASE)
 
diff --git a/arch/arm/cpu/arm1136/config.mk b/arch/arm/cpu/arm1136/config.mk
index ab1fc4a..91b0ef3 100644
--- a/arch/arm/cpu/arm1136/config.mk
+++ b/arch/arm/cpu/arm1136/config.mk
@@ -11,7 +11,7 @@ PLATFORM_CPPFLAGS += -march=armv5
 ifneq ($(CONFIG_IMX_CONFIG),)
 ifdef CONFIG_SPL
 ifdef CONFIG_SPL_BUILD
-ALL-y  += $(OBJTREE)/SPL
+ALL-y  += SPL
 endif
 else
 ALL-y  += u-boot.imx
diff --git a/arch/arm/cpu/arm926ejs/config.mk b/arch/arm/cpu/arm926ejs/config.mk
index f27ca15..918cdec 100644
--- a/arch/arm/cpu/arm926ejs/config.mk
+++ b/arch/arm/cpu/arm926ejs/config.mk
@@ -10,7 +10,7 @@ PLATFORM_CPPFLAGS += -march=armv5te
 ifneq ($(CONFIG_IMX_CONFIG),)
 ifdef CONFIG_SPL
 ifdef CONFIG_SPL_BUILD
-ALL-y  += $(OBJTREE)/SPL
+ALL-y  += SPL
 endif
 else
 ALL-y  += u-boot.imx
diff --git a/arch/arm/cpu/armv7/config.mk b/arch/arm/cpu/armv7/config.mk
index d01f3d9..852f83c 100644
--- a/arch/arm/cpu/armv7/config.mk
+++ b/arch/arm/cpu/armv7/config.mk
@@ -17,7 +17,7 @@ PLATFORM_NO_UNALIGNED := $(PF_NO_UNALIGNED)
 ifneq ($(CONFIG_IMX_CONFIG),)
 ifdef CONFIG_SPL
 ifdef CONFIG_SPL_BUILD
-ALL-y  += $(OBJTREE)/SPL
+ALL-y  += SPL
 endif
 else
 ALL-y  += u-boot.imx
diff --git a/arch/arm/imx-common/Makefile b/arch/arm/imx-common/Makefile
index 88d6c0b..16809fe 100644
--- a/arch/arm/imx-common/Makefile
+++ b/arch/arm/imx-common/Makefile
@@ -23,37 +23,54 @@ endif
 obj-$(CONFIG_CMD_BMODE) += cmd_bmode.o
 obj-$(CONFIG_CMD_HDMIDETECT) += cmd_hdmidet.o
 
-$(OBJTREE)/$(patsubst %,%,$(CONFIG_IMX_CONFIG)).cfgtmp: $(OBJTREE)/%.cfgtmp 
: $(SRCTREE)/%
-   mkdir -p $(dir $@)
-   $(CPP) $(cpp_flags) -x c -o $@ $
-
-$(OBJTREE)/u-boot.imx: $(OBJTREE)/u-boot.bin $(OBJTREE)/$(patsubst 
%,%,$(CONFIG_IMX_CONFIG)).cfgtmp
-   $(OBJTREE)/tools/mkimage -n $(filter-out %.bin,$^) -T imximage \
-   -e $(CONFIG_SYS_TEXT_BASE) -d $ $@
-
-$(OBJTREE)/SPL: $(OBJTREE)/spl/u-boot-spl.bin $(OBJTREE)/$(patsubst 
%,%,$(CONFIG_IMX_CONFIG)).cfgtmp
-   $(OBJTREE)/tools/mkimage -n $(filter-out %.bin,$^) -T imximage \
-   -e $(CONFIG_SPL_TEXT_BASE) -d $ $@
-
-$(OBJTREE)/u-boot-with-spl.imx: $(OBJTREE)/SPL $(OBJTREE)/u-boot.bin
-   $(OBJCOPY) $(OBJCOPYFLAGS) --pad-to=$(CONFIG_SPL_PAD_TO) \
-   -I binary -O binary $ $(OBJTREE)/spl/u-boot-spl-pad.imx
-   $(OBJTREE)/tools/mkimage -A arm -O U-Boot -a $(CONFIG_SYS_TEXT_BASE) \
-   -e $(CONFIG_SYS_TEXT_BASE) -C none -d $(OBJTREE)/u-boot.bin \
-   $(OBJTREE)/u-boot.uim
-   cat $(OBJTREE)/spl/u-boot-spl-pad.imx $(OBJTREE)/u-boot.uim  $@
-   rm $(OBJTREE)/spl/u-boot-spl-pad.imx $(OBJTREE)/u-boot.uim
-
-$(OBJTREE)/u-boot-with-nand-spl.imx: $(OBJTREE)/SPL $(OBJTREE)/u-boot.bin
-   (echo -ne '\x00\x00\x00\x00\x46\x43\x42\x20\x01'  \
-   dd bs=1015 count=1 if=/dev/zero 2/dev/null) | \
-   cat - $  $(OBJTREE)/spl/u-boot-nand-spl.imx
-   $(OBJCOPY) $(OBJCOPYFLAGS) --pad-to=$(CONFIG_SPL_PAD_TO) \
-   -I binary -O binary $(OBJTREE)/spl/u-boot-nand-spl.imx \
-   $(OBJTREE)/spl/u-boot-nand-spl-pad.imx
-   rm $(OBJTREE)/spl/u-boot-nand-spl.imx
-   $(OBJTREE)/tools/mkimage -A arm -O U-Boot -a $(CONFIG_SYS_TEXT_BASE) \
-   -e $(CONFIG_SYS_TEXT_BASE) -C none -d $(OBJTREE)/u-boot.bin \
-   $(OBJTREE)/u-boot.uim
-   cat $(OBJTREE)/spl/u-boot-nand-spl-pad.imx $(OBJTREE)/u-boot.uim  $@
-   rm $(OBJTREE)/spl/u-boot-nand-spl-pad.imx $(OBJTREE)/u-boot.uim
+quiet_cmd_cpp_cfg = CFGS$@
+  cmd_cpp_cfg = $(CPP) $(cpp_flags) -x c -o $@ $
+
+IMX_CONFIG = $(CONFIG_IMX_CONFIG:%=%).cfgtmp
+
+$(IMX_CONFIG): %.cfgtmp: % FORCE
+   $(Q)mkdir -p $(dir $@)
+   $(call if_changed_dep,cpp_cfg)
+
+quiet_cmd_mkimage = UIMAGE  $@
+cmd_mkimage = $(objtree)/tools/mkimage $(MKIMAGEFLAGS_$(@F)) -d 

[U-Boot] [PATCH 05/15] kbuild: Add $(Q) when descending into subdirectories

2014-02-07 Thread Masahiro Yamada
Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---

 Makefile | 21 -
 spl/Makefile |  4 ++--
 2 files changed, 10 insertions(+), 15 deletions(-)

diff --git a/Makefile b/Makefile
index beca991..edb6868 100644
--- a/Makefile
+++ b/Makefile
@@ -791,7 +791,7 @@ u-boot.img: u-boot.bin
-d $ $@
 
 u-boot.imx: u-boot.bin
-   $(MAKE) $(build)=arch/arm/imx-common $(objtree)/u-boot.imx
+   $(Q)$(MAKE) $(build)=arch/arm/imx-common $(objtree)/$@
 
 u-boot.kwb:   u-boot.bin
tools/mkimage -n $(CONFIG_SYS_KWD_CONFIG) -T kwbimage \
@@ -828,13 +828,8 @@ u-boot-with-spl.bin: spl/u-boot-spl.bin $(SPL_PAYLOAD)
 tpl/u-boot-with-tpl.bin: tpl/u-boot-tpl.bin u-boot.bin
$(call 
SPL_PAD_APPEND,$,u-boot.bin,tpl/u-boot-tpl-pad.bin,$(CONFIG_TPL_PAD_TO))
 
-u-boot-with-spl.imx: spl/u-boot-spl.bin u-boot.bin
-   $(MAKE) $(build)=arch/arm/imx-common \
-   $(OBJTREE)/u-boot-with-spl.imx
-
-u-boot-with-nand-spl.imx: spl/u-boot-spl.bin u-boot.bin
-   $(MAKE) $(build)=arch/arm/imx-common \
-   $(OBJTREE)/u-boot-with-nand-spl.imx
+u-boot-with-spl.imx u-boot-with-nand-spl.imx: spl/u-boot-spl.bin u-boot.bin
+   $(Q)$(MAKE) $(build)=arch/arm/imx-common $(objtree)/$@
 
 u-boot.ubl:   u-boot-with-spl.bin
tools/mkimage -n $(UBL_CONFIG) -T ublimage \
@@ -852,8 +847,8 @@ u-boot.ais:   spl/u-boot-spl.bin u-boot.img
cat spl/u-boot-spl-pad.ais u-boot.img  u-boot.ais
 
 
-u-boot.sb:   u-boot.bin spl/u-boot-spl.bin
-   $(MAKE) $(build)=$(CPUDIR)/$(SOC)/ $(OBJTREE)/u-boot.sb
+u-boot.sb: u-boot.bin spl/u-boot-spl.bin
+   $(Q)$(MAKE) $(build)=arch/arm/cpu/arm926ejs/mxs $(objtree)/u-boot.sb
 
 # On x600 (SPEAr600) U-Boot is appended to U-Boot SPL.
 # Both images are created using mkimage (crc etc), so that the ROM
@@ -1051,16 +1046,16 @@ u-boot.lds: $(LDSCRIPT) prepare
$(CPP) $(cpp_flags) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - $ 
$@
 
 nand_spl: prepare
-   $(MAKE) $(build)=nand_spl/board/$(BOARDDIR) all
+   $(Q)$(MAKE) $(build)=nand_spl/board/$(BOARDDIR) all
 
 u-boot-nand.bin:   nand_spl u-boot.bin
cat nand_spl/u-boot-spl-16k.bin u-boot.bin  u-boot-nand.bin
 
 spl/u-boot-spl.bin: tools prepare
-   $(MAKE) obj=spl -f $(srctree)/spl/Makefile all
+   $(Q)$(MAKE) obj=spl -f $(srctree)/spl/Makefile all
 
 tpl/u-boot-tpl.bin: tools prepare
-   $(MAKE) obj=tpl -f $(srctree)/spl/Makefile all 
CONFIG_TPL_BUILD=y
+   $(Q)$(MAKE) obj=tpl -f $(srctree)/spl/Makefile all CONFIG_TPL_BUILD=y
 
 TAG_SUBDIRS := $(u-boot-dirs) include
 
diff --git a/spl/Makefile b/spl/Makefile
index 3e63881..10b77a5 100644
--- a/spl/Makefile
+++ b/spl/Makefile
@@ -175,8 +175,8 @@ $(OBJTREE)/MLO.byteswap: $(obj)/u-boot-spl.bin
$(OBJTREE)/tools/mkimage -T omapimage -n byteswap \
-a $(CONFIG_SPL_TEXT_BASE) -d $ $@
 
-$(objtree)/SPL : $(obj)/u-boot-spl.bin
-   $(MAKE) $(build)=spl/arch/arm/imx-common $@
+$(objtree)/SPL: $(obj)/u-boot-spl.bin
+   $(Q)$(MAKE) $(build)=spl/arch/arm/imx-common $@
 
 ALL-y  += $(obj)/$(SPL_BIN).bin
 
-- 
1.8.3.2

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


[U-Boot] [PATCH 11/15] kbuild: use shorten logs for misc targets

2014-02-07 Thread Masahiro Yamada
Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---

 Makefile |  7 +--
 arch/blackfin/cpu/Makefile   |  6 +-
 examples/api/Makefile| 40 +---
 examples/standalone/Makefile | 25 +++--
 spl/Makefile |  6 +-
 5 files changed, 47 insertions(+), 37 deletions(-)

diff --git a/Makefile b/Makefile
index c4706d6..907b013 100644
--- a/Makefile
+++ b/Makefile
@@ -1049,9 +1049,12 @@ depend dep:
@echo '*** Warning: make $@ is unnecessary now.'
 
 # ---
+quiet_cmd_cpp_lds = LDS $@
+cmd_cpp_lds = $(CPP) $(cpp_flags) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ \
+   -x assembler-with-cpp -P -o $@ $
 
-u-boot.lds: $(LDSCRIPT) prepare
-   $(CPP) $(cpp_flags) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - $ 
$@
+u-boot.lds: $(LDSCRIPT) prepare FORCE
+   $(call if_changed,cpp_lds)
 
 PHONY += nand_spl
 nand_spl: prepare
diff --git a/arch/blackfin/cpu/Makefile b/arch/blackfin/cpu/Makefile
index 426292f..cfbcd31 100644
--- a/arch/blackfin/cpu/Makefile
+++ b/arch/blackfin/cpu/Makefile
@@ -37,5 +37,9 @@ ifneq ($(CONFIG_BFIN_BOOT_MODE),BFIN_BOOT_BYPASS)
 endif
 
 CPPFLAGS_init.lds := -ansi
+
+quiet_cmd_link_init = LD  $@
+  cmd_link_init = $(LD) $(LDFLAGS) -T $^ -o $@
 $(obj)/init.elf: $(obj)/init.lds $(obj)/init.o $(obj)/initcode.o
-   $(LD) $(LDFLAGS) -T $^ -o $@
+   $(call if_changed,link_init)
+targets += init.lds init.o
diff --git a/examples/api/Makefile b/examples/api/Makefile
index 6c19830..6cf23d1 100644
--- a/examples/api/Makefile
+++ b/examples/api/Makefile
@@ -15,30 +15,32 @@ endif
 extra-y = demo
 
 # Source files located in the examples/api directory
-SOBJ_FILES-y += crt0.o
-COBJ_FILES-y += demo.o
-COBJ_FILES-y += glue.o
-COBJ_FILES-y += libgenwrap.o
+OBJ-y += crt0.o
+OBJ-y += demo.o
+OBJ-y += glue.o
+OBJ-y += libgenwrap.o
 
 # Source files which exist outside the examples/api directory
-EXT_COBJ_FILES-y += lib/crc32.o
-EXT_COBJ_FILES-y += lib/ctype.o
-EXT_COBJ_FILES-y += lib/div64.o
-EXT_COBJ_FILES-y += lib/string.o
-EXT_COBJ_FILES-y += lib/time.o
-EXT_COBJ_FILES-y += lib/vsprintf.o
-EXT_SOBJ_FILES-$(CONFIG_PPC) += arch/powerpc/lib/ppcstring.o
+EXT_COBJ-y += lib/crc32.o
+EXT_COBJ-y += lib/ctype.o
+EXT_COBJ-y += lib/div64.o
+EXT_COBJ-y += lib/string.o
+EXT_COBJ-y += lib/time.o
+EXT_COBJ-y += lib/vsprintf.o
+EXT_SOBJ-$(CONFIG_PPC) += arch/powerpc/lib/ppcstring.o
 
 # Create a list of object files to be compiled
-OBJS   += $(addprefix $(obj)/,$(SOBJ_FILES-y))
-OBJS   += $(addprefix $(obj)/,$(COBJ_FILES-y))
-OBJS   += $(addprefix $(obj)/,$(notdir $(EXT_COBJ_FILES-y)))
-OBJS   += $(addprefix $(obj)/,$(notdir $(EXT_SOBJ_FILES-y)))
+OBJS := $(OBJ-y) $(notdir $(EXT_COBJ-y) $(EXT_SOBJ-y))
+targets += $(OBJS)
+OBJS := $(addprefix $(obj)/,$(OBJS))
 
 #
 
-$(obj)/demo:   $(OBJS)
-   $(LD) --gc-sections -Ttext $(LOAD_ADDR) -o $@ $^ 
$(PLATFORM_LIBS)
+quiet_cmd_link_demo = LD  $@
+cmd_link_demo = $(LD) --gc-sections -Ttext $(LOAD_ADDR) -o $@ $(filter-out 
$(PHONY), $^) $(PLATFORM_LIBS)
+
+$(obj)/demo: $(OBJS) FORCE
+   $(call if_changed,link_demo)
 
 # demo.bin is never genrated. Is this necessary?
 OBJCOPYFLAGS_demo.bin := -O binary
@@ -46,10 +48,10 @@ $(obj)/demo.bin: $(obj)/demo FORCE
$(call if_changed,objcopy)
 
 # Rule to build generic library C files
-$(addprefix $(obj)/,$(notdir $(EXT_COBJ_FILES-y))): $(obj)/%.o: 
$(SRCTREE)/lib/%.c FORCE
+$(addprefix $(obj)/,$(notdir $(EXT_COBJ-y))): $(obj)/%.o: lib/%.c FORCE
$(call cmd,force_checksrc)
$(call if_changed_rule,cc_o_c)
 
 # Rule to build architecture-specific library assembly files
-$(addprefix $(obj)/,$(notdir $(EXT_SOBJ_FILES-y))): $(obj)/%.o: 
$(SRCTREE)/arch/$(ARCH)/lib/%.S
+$(addprefix $(obj)/,$(notdir $(EXT_SOBJ-y))): $(obj)/%.o: arch/powerpc/lib/%.S 
FORCE
$(call if_changed_dep,as_o_S)
diff --git a/examples/standalone/Makefile b/examples/standalone/Makefile
index 5f61043..5b227cd 100644
--- a/examples/standalone/Makefile
+++ b/examples/standalone/Makefile
@@ -24,22 +24,18 @@ ELF := $(strip $(extra-y))
 extra-y += $(addsuffix .srec,$(extra-y)) $(addsuffix .bin,$(extra-y))
 clean-files  := $(extra-) $(addsuffix .srec,$(extra-)) $(addsuffix 
.bin,$(extra-))
 
-
 COBJS  := $(ELF:=.o)
 
 LIB= $(obj)/libstubs.o
 
-LIBAOBJS-$(CONFIG_PPC) += ppc_longjmp.o ppc_setjmp.o
-LIBAOBJS-$(CONFIG_8xx) += test_burst_lib.o
-LIBAOBJS := $(LIBAOBJS-y)
-
-LIBCOBJS = stubs.o
+LIBOBJS-$(CONFIG_PPC) += ppc_longjmp.o ppc_setjmp.o
+LIBOBJS-$(CONFIG_8xx) += test_burst_lib.o
+LIBOBJS-y += stubs.o
 
 .SECONDARY: $(call objectify,$(COBJS))
-targets += $(patsubst $(obj)/%,%,$(LIB)) $(COBJS) $(LIBAOBJS) $(LIBCOBJS)
-
-LIBOBJS= $(addprefix $(obj)/,$(LIBAOBJS) $(LIBCOBJS))
+targets += $(patsubst $(obj)/%,%,$(LIB)) $(COBJS) $(LIBOBJS-y)
 

[U-Boot] [PATCH 01/15] kbuild: consolidate version and timestamp headers generation

2014-02-07 Thread Masahiro Yamada
 - Generate include/generated/{timestamp.h, version.h}
   more simply by using filechk rule.

 - Add $(UBOOTRELEASE) variable and re-write u-boot.imx rule
   more simply.

 - Rename U_BOOT_VERSION in Makefile to UBOOTVERSION

   Before this commit, the same variable name, U_BOOT_VERSION
   was used for two different strings.

   One of them was defined in Makefile.
   It takes the form like 2014.01-rc1 and used in
   makefiles and script files.

   The other is defined in include/generated/version.h
   It takes the form like U-Boot 2014.01-rc1-00010-gbe6d426-dirty
   and used in C and Aseembler.

   It is confusing when grepping the source tree. So, this commit
   renames the former to UBOOTVERSION.

Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---

 Makefile | 83 +---
 doc/DocBook/Makefile |  2 +-
 scripts/kernel-doc   |  4 +--
 3 files changed, 49 insertions(+), 40 deletions(-)

diff --git a/Makefile b/Makefile
index b425bfb..3d98b04 100644
--- a/Makefile
+++ b/Makefile
@@ -180,9 +180,6 @@ unexport CDPATH
 
 #
 
-TIMESTAMP_FILE = include/generated/timestamp_autogenerated.h
-VERSION_FILE = include/generated/version_autogenerated.h
-
 HOSTARCH := $(shell uname -m | \
sed -e s/i.86/x86/ \
-e s/sun4u/sparc64/ \
@@ -356,9 +353,11 @@ KBUILD_CFLAGS   := -Wall -Wstrict-prototypes \
   -fno-builtin -ffreestanding
 KBUILD_AFLAGS   := -D__ASSEMBLY__
 
-U_BOOT_VERSION = $(VERSION)$(if $(PATCHLEVEL),.$(PATCHLEVEL)$(if 
$(SUBLEVEL),.$(SUBLEVEL)))$(EXTRAVERSION)
+# Read UBOOTRELEASE from include/config/uboot.release (if it exists)
+UBOOTRELEASE = $(shell cat include/config/uboot.release 2 /dev/null)
+UBOOTVERSION = $(VERSION)$(if $(PATCHLEVEL),.$(PATCHLEVEL)$(if 
$(SUBLEVEL),.$(SUBLEVEL)))$(EXTRAVERSION)
 
-export VERSION PATCHLEVEL SUBLEVEL U_BOOT_VERSION
+export VERSION PATCHLEVEL SUBLEVEL UBOOTRELEASE UBOOTVERSION
 export ARCH CPU BOARD VENDOR SOC
 export CONFIG_SHELL HOSTCC HOSTCFLAGS HOSTLDFLAGS CROSS_COMPILE AS LD CC
 export CPP AR NM LDR STRIP OBJCOPY OBJDUMP
@@ -411,6 +410,9 @@ endif
 # Detect when mixed targets is specified, and make a second invocation
 # of make so .config is not included in this case either (for *config).
 
+version_h := include/generated/version_autogenerated.h
+timestamp_h := include/generated/timestamp_autogenerated.h
+
 no-dot-config-targets := clean clobber mrproper distclean \
 cscope TAGS %tags help %docs check% coccicheck \
 backup
@@ -582,8 +584,6 @@ CHECKFLAGS += $(NOSTDINC_FLAGS)
 cpp_flags := $(KBUILD_CPPFLAGS) $(CPPFLAGS) $(UBOOTINCLUDE) $(NOSTDINC_FLAGS)
 c_flags := $(KBUILD_CFLAGS) $(cpp_flags)
 
-.PHONY : $(VERSION_FILE) $(TIMESTAMP_FILE)
-
 #
 # U-Boot objectsorder is important (i.e. start must be first)
 
@@ -787,8 +787,7 @@ u-boot.img: u-boot.bin
tools/mkimage -A $(ARCH) -T firmware -C none \
-O u-boot -a $(CONFIG_SYS_TEXT_BASE) \
-e $(CONFIG_SYS_UBOOT_START) \
-   -n $(shell sed -n -e 's/.*U_BOOT_VERSION//p' $(VERSION_FILE) | \
-   sed -e 's/[ ]*$$/ for $(BOARD) board/') \
+   -n U-Boot $(UBOOTRELEASE) for $(BOARD) board \
-d $ $@
 
 u-boot.imx: u-boot.bin
@@ -944,13 +943,22 @@ PHONY += $(u-boot-dirs)
 $(u-boot-dirs): depend prepare scripts
$(Q)$(MAKE) $(build)=$@
 
-tools: $(TIMESTAMP_FILE) $(VERSION_FILE)
+tools: prepare
 # The tools are needed early
 $(filter-out tools, $(u-boot-dirs)): tools
 # The examples conditionally depend on U-Boot (say, when USE_PRIVATE_LIBGCC
 # is yes), so compile examples after U-Boot is compiled.
 examples: $(filter-out examples, $(u-boot-dirs))
 
+define filechk_uboot.release
+   echo $(UBOOTVERSION)$$($(CONFIG_SHELL) 
$(srctree)/scripts/setlocalversion $(srctree))
+endef
+
+# Store (new) UBOOTRELEASE string in include/config/uboot.release
+include/config/uboot.release: Makefile FORCE
+   $(call filechk,uboot.release)
+
+
 # Things we need to do before we recursively start building the kernel
 # or the modules are listed in prepare.
 # A multi level approach is used. prepareN is processed before prepareN-1.
@@ -963,7 +971,7 @@ PHONY += prepare archprepare prepare0 prepare1 prepare2 
prepare3
 # prepare3 is used to check if we are building in a separate output directory,
 # and if so do:
 # 1) Check that make has not been executed in the kernel src $(srctree)
-prepare3:
+prepare3: include/config/uboot.release
 ifneq ($(KBUILD_SRC),)
@$(kecho) '  Using $(srctree) as source for u-boot'
$(Q)if [ -f $(srctree)/include/config.mk ]; then \
@@ -976,7 +984,7 @@ endif
 # prepare2 creates a makefile if using a separate output directory
 prepare2: prepare3 outputmakefile
 
-prepare1: prepare2
+prepare1: 

[U-Boot] [PATCH 10/15] kbuild: use shorten log for linking u-boot

2014-02-07 Thread Masahiro Yamada
Move sandbox-specific link rule to arch/sandbox/config.mk.

Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---

 Makefile   | 33 ++---
 arch/sandbox/config.mk |  4 
 2 files changed, 18 insertions(+), 19 deletions(-)

diff --git a/Makefile b/Makefile
index 364b9be..c4706d6 100644
--- a/Makefile
+++ b/Makefile
@@ -739,7 +739,7 @@ endif
 endif
 endif
 
-LDFLAGS_u-boot += -T u-boot.lds $(LDFLAGS_FINAL)
+LDFLAGS_u-boot += $(LDFLAGS_FINAL)
 ifneq ($(CONFIG_SYS_TEXT_BASE),)
 LDFLAGS_u-boot += -Ttext $(CONFIG_SYS_TEXT_BASE)
 endif
@@ -914,27 +914,22 @@ u-boot.elf: u-boot.bin
--defsym=_start=$(CONFIG_SYS_TEXT_BASE) \
-Ttext=$(CONFIG_SYS_TEXT_BASE)
 
-ifeq ($(CONFIG_SANDBOX),y)
-GEN_UBOOT = \
-   $(CC) $(SYMS) -T u-boot.lds \
-   -Wl,--start-group $(u-boot-main) -Wl,--end-group \
-   $(PLATFORM_LIBS) -Wl,-Map -Wl,u-boot.map -o u-boot
-else
-GEN_UBOOT = \
-   $(LD) $(LDFLAGS) $(LDFLAGS_$(@F)) \
-   $(u-boot-init) \
-   --start-group $(u-boot-main) --end-group 
$(PLATFORM_LIBS) \
-   -Map u-boot.map -o u-boot
-endif
+# Rule to link u-boot
+# May be overridden by arch/$(ARCH)/config.mk
+quiet_cmd_u-boot__ ?= LD  $@
+  cmd_u-boot__ ?= $(LD) $(LDFLAGS) $(LDFLAGS_u-boot) -o $@ \
+  -T u-boot.lds $(u-boot-init) \
+  --start-group $(u-boot-main) --end-group \
+  $(PLATFORM_LIBS) -Map u-boot.map
 
 u-boot:$(u-boot-init) $(u-boot-main) u-boot.lds
-   $(GEN_UBOOT)
+   $(call if_changed,u-boot__)
 ifeq ($(CONFIG_KALLSYMS),y)
-   smap=`$(call SYSTEM_MAP,u-boot) | \
-   awk '$$2 ~ /[tTwW]/ {printf $$1 $$3 000}'` ; \
-   $(CC) $(c_flags) -DSYSTEM_MAP=\$${smap}\ \
-   -c $(srctree)/common/system_map.c -o common/system_map.o
-   $(GEN_UBOOT) common/system_map.o
+   smap=`$(call SYSTEM_MAP,u-boot) | \
+   awk '$$2 ~ /[tTwW]/ {printf $$1 $$3 000}'` ; \
+   $(CC) $(c_flags) -DSYSTEM_MAP=\$${smap}\ \
+   -c $(srctree)/common/system_map.c -o common/system_map.o
+   $(call cmd,u-boot__) common/system_map.o
 endif
 
 # The actual objects are generated when descending, 
diff --git a/arch/sandbox/config.mk b/arch/sandbox/config.mk
index 6142dd4..23b057e 100644
--- a/arch/sandbox/config.mk
+++ b/arch/sandbox/config.mk
@@ -7,3 +7,7 @@ PLATFORM_LIBS += -lrt
 
 # Support generic board on sandbox
 __HAVE_ARCH_GENERIC_BOARD := y
+
+cmd_u-boot__ = $(CC) -o $@ -T u-boot.lds \
+   -Wl,--start-group $(u-boot-main) -Wl,--end-group \
+   $(PLATFORM_LIBS) -Wl,-Map -Wl,u-boot.map
-- 
1.8.3.2

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


[U-Boot] [PATCH 07/15] kbuild: use shorten logs for mkimage rules

2014-02-07 Thread Masahiro Yamada
Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---

 Makefile| 38 +++--
 arch/arm/cpu/armv7/am33xx/config.mk |  4 ++--
 arch/arm/cpu/armv7/omap3/config.mk  |  2 +-
 arch/arm/cpu/armv7/omap4/config.mk  |  2 +-
 arch/arm/cpu/armv7/omap5/config.mk  |  2 +-
 spl/Makefile| 15 +--
 6 files changed, 34 insertions(+), 29 deletions(-)

diff --git a/Makefile b/Makefile
index 864cd70..d43d09b 100644
--- a/Makefile
+++ b/Makefile
@@ -747,6 +747,10 @@ endif
 quiet_cmd_objcopy = OBJCOPY $@
 cmd_objcopy = $(OBJCOPY) $(OBJCOPYFLAGS) $(OBJCOPYFLAGS_$(@F)) $ $@
 
+quiet_cmd_mkimage = UIMAGE  $@
+cmd_mkimage = $(objtree)/tools/mkimage $(MKIMAGEFLAGS_$(@F)) -d $ $@ \
+   $(if $(KBUILD_VERBOSE:1=), /dev/null)
+
 all:   $(ALL-y)
 
 PHONY += dtbs
@@ -790,24 +794,21 @@ ifndef CONFIG_SYS_UBOOT_START
 CONFIG_SYS_UBOOT_START := 0
 endif
 
-u-boot.img:u-boot.bin
-   tools/mkimage -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 \
-   -d $ $@
+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
 
-u-boot.imx: u-boot.bin
-   $(Q)$(MAKE) $(build)=arch/arm/imx-common $(objtree)/$@
+MKIMAGEFLAGS_u-boot.kwb = -n $(CONFIG_SYS_KWD_CONFIG) -T kwbimage \
+   -a $(CONFIG_SYS_TEXT_BASE) -e $(CONFIG_SYS_TEXT_BASE)
 
-u-boot.kwb:   u-boot.bin
-   tools/mkimage -n $(CONFIG_SYS_KWD_CONFIG) -T kwbimage \
-   -a $(CONFIG_SYS_TEXT_BASE) -e $(CONFIG_SYS_TEXT_BASE) -d $ $@
+MKIMAGEFLAGS_u-boot.pbl = -n $(CONFIG_SYS_FSL_PBL_RCW) \
+   -R $(CONFIG_SYS_FSL_PBL_PBI) -T pblimage
 
-u-boot.pbl:u-boot.bin
-   tools/mkimage -n $(CONFIG_SYS_FSL_PBL_RCW) \
-   -R $(CONFIG_SYS_FSL_PBL_PBI) -T pblimage \
-   -d $ $@
+u-boot.img u-boot.kwb u-boot.pbl: u-boot.bin FORCE
+   $(call if_changed,mkimage)
+
+u-boot.imx: u-boot.bin
+   $(Q)$(MAKE) $(build)=arch/arm/imx-common $(objtree)/$@
 
 u-boot.sha1:   u-boot.bin
tools/ubsha1 u-boot.bin
@@ -838,9 +839,10 @@ tpl/u-boot-with-tpl.bin: tpl/u-boot-tpl.bin u-boot.bin
 u-boot-with-spl.imx u-boot-with-nand-spl.imx: spl/u-boot-spl.bin u-boot.bin
$(Q)$(MAKE) $(build)=arch/arm/imx-common $(objtree)/$@
 
-u-boot.ubl:   u-boot-with-spl.bin
-   tools/mkimage -n $(UBL_CONFIG) -T ublimage \
-   -e $(CONFIG_SYS_TEXT_BASE) -d $ u-boot.ubl
+MKIMAGEFLAGS_u-boot.ubl = -n $(UBL_CONFIG) -T ublimage -e 
$(CONFIG_SYS_TEXT_BASE)
+
+u-boot.ubl: u-boot-with-spl.bin FORCE
+   $(call if_changed,mkimage)
 
 u-boot.ais:   spl/u-boot-spl.bin u-boot.img
tools/mkimage -s -n $(if 
$(CONFIG_AIS_CONFIG_FILE),$(srctree)/$(CONFIG_AIS_CONFIG_FILE:%=%),/dev/null)
 \
diff --git a/arch/arm/cpu/armv7/am33xx/config.mk 
b/arch/arm/cpu/armv7/am33xx/config.mk
index 1c06fb4..5294d16 100644
--- a/arch/arm/cpu/armv7/am33xx/config.mk
+++ b/arch/arm/cpu/armv7/am33xx/config.mk
@@ -4,8 +4,8 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 ifdef CONFIG_SPL_BUILD
-ALL-y  += $(OBJTREE)/MLO
-ALL-$(CONFIG_SPL_SPI_SUPPORT) += $(OBJTREE)/MLO.byteswap
+ALL-y  += MLO
+ALL-$(CONFIG_SPL_SPI_SUPPORT) += MLO.byteswap
 else
 ALL-y  += u-boot.img
 endif
diff --git a/arch/arm/cpu/armv7/omap3/config.mk 
b/arch/arm/cpu/armv7/omap3/config.mk
index 2a3d1c5..ad44d63 100644
--- a/arch/arm/cpu/armv7/omap3/config.mk
+++ b/arch/arm/cpu/armv7/omap3/config.mk
@@ -9,7 +9,7 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 ifdef CONFIG_SPL_BUILD
-ALL-y  += $(OBJTREE)/MLO
+ALL-y  += MLO
 else
 ALL-y  += u-boot.img
 endif
diff --git a/arch/arm/cpu/armv7/omap4/config.mk 
b/arch/arm/cpu/armv7/omap4/config.mk
index 2a3d1c5..ad44d63 100644
--- a/arch/arm/cpu/armv7/omap4/config.mk
+++ b/arch/arm/cpu/armv7/omap4/config.mk
@@ -9,7 +9,7 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 ifdef CONFIG_SPL_BUILD
-ALL-y  += $(OBJTREE)/MLO
+ALL-y  += MLO
 else
 ALL-y  += u-boot.img
 endif
diff --git a/arch/arm/cpu/armv7/omap5/config.mk 
b/arch/arm/cpu/armv7/omap5/config.mk
index 261b272..ef2725a 100644
--- a/arch/arm/cpu/armv7/omap5/config.mk
+++ b/arch/arm/cpu/armv7/omap5/config.mk
@@ -7,7 +7,7 @@
 #
 
 ifdef CONFIG_SPL_BUILD
-ALL-y  += $(OBJTREE)/MLO
+ALL-y  += MLO
 else
 ALL-y  += u-boot.img
 endif
diff --git a/spl/Makefile b/spl/Makefile
index 9c5bb53..43d053a 100644
--- a/spl/Makefile
+++ b/spl/Makefile
@@ -167,13 +167,16 @@ LDPPFLAGS += \
$(shell $(LD) --version | \
  sed -ne 's/GNU ld version 
\([0-9][0-9]*\)\.\([0-9][0-9]*\).*/-DLD_MAJOR=\1 -DLD_MINOR=\2/p')
 
-$(OBJTREE)/MLO:$(obj)/u-boot-spl.bin
-   $(OBJTREE)/tools/mkimage -T omapimage \
-   -a $(CONFIG_SPL_TEXT_BASE) -d $ $@

[U-Boot] [PATCH 13/15] kbuild: refactor more IMX image rules

2014-02-07 Thread Masahiro Yamada
This commit avoids generating ./SPL twice.
  - Fist time descending to spl/
  - Second time as a prerequisite of u-boot-with-spl.imx,
u-boot-with-nand-spl.imx.

Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---

 Makefile |  5 -
 arch/arm/config.mk   | 10 ++
 arch/arm/cpu/arm1136/config.mk   | 10 --
 arch/arm/cpu/arm926ejs/config.mk | 10 --
 arch/arm/cpu/armv7/config.mk | 10 --
 spl/Makefile |  3 ---
 6 files changed, 14 insertions(+), 34 deletions(-)

diff --git a/Makefile b/Makefile
index 5acf538..ad9c315 100644
--- a/Makefile
+++ b/Makefile
@@ -840,7 +840,10 @@ OBJCOPYFLAGS_u-boot-with-tpl.bin = -I binary -O binary \
 tpl/u-boot-with-tpl.bin: tpl/u-boot-tpl.bin u-boot.bin FORCE
$(call if_changed,pad_cat)
 
-u-boot-with-spl.imx u-boot-with-nand-spl.imx: spl/u-boot-spl.bin u-boot.bin
+SPL: spl/u-boot-spl.bin FORCE
+   $(Q)$(MAKE) $(build)=arch/arm/imx-common $@
+
+u-boot-with-spl.imx u-boot-with-nand-spl.imx: SPL u-boot.bin FORCE
$(Q)$(MAKE) $(build)=arch/arm/imx-common $@
 
 MKIMAGEFLAGS_u-boot.ubl = -n $(UBL_CONFIG) -T ublimage -e 
$(CONFIG_SYS_TEXT_BASE)
diff --git a/arch/arm/config.mk b/arch/arm/config.mk
index 8a65c34..17b7408 100644
--- a/arch/arm/config.mk
+++ b/arch/arm/config.mk
@@ -112,3 +112,13 @@ OBJCOPYFLAGS += -j .text -j .rodata -j .data -j 
.u_boot_list -j .rela.dyn
 else
 OBJCOPYFLAGS += -j .text -j .rodata -j .hash -j .data -j .got.plt -j 
.u_boot_list -j .rel.dyn
 endif
+
+ifneq ($(CONFIG_IMX_CONFIG),)
+ifdef CONFIG_SPL
+ifndef CONFIG_SPL_BUILD
+ALL-y += SPL
+endif
+else
+ALL-y += u-boot.imx
+endif
+endif
diff --git a/arch/arm/cpu/arm1136/config.mk b/arch/arm/cpu/arm1136/config.mk
index 91b0ef3..a82c6ce 100644
--- a/arch/arm/cpu/arm1136/config.mk
+++ b/arch/arm/cpu/arm1136/config.mk
@@ -7,13 +7,3 @@
 
 # Make ARMv5 to allow more compilers to work, even though its v6.
 PLATFORM_CPPFLAGS += -march=armv5
-
-ifneq ($(CONFIG_IMX_CONFIG),)
-ifdef CONFIG_SPL
-ifdef CONFIG_SPL_BUILD
-ALL-y  += SPL
-endif
-else
-ALL-y  += u-boot.imx
-endif
-endif
diff --git a/arch/arm/cpu/arm926ejs/config.mk b/arch/arm/cpu/arm926ejs/config.mk
index 918cdec..bdb3da1 100644
--- a/arch/arm/cpu/arm926ejs/config.mk
+++ b/arch/arm/cpu/arm926ejs/config.mk
@@ -6,13 +6,3 @@
 #
 
 PLATFORM_CPPFLAGS += -march=armv5te
-
-ifneq ($(CONFIG_IMX_CONFIG),)
-ifdef CONFIG_SPL
-ifdef CONFIG_SPL_BUILD
-ALL-y  += SPL
-endif
-else
-ALL-y  += u-boot.imx
-endif
-endif
diff --git a/arch/arm/cpu/armv7/config.mk b/arch/arm/cpu/armv7/config.mk
index 852f83c..247b7a5 100644
--- a/arch/arm/cpu/armv7/config.mk
+++ b/arch/arm/cpu/armv7/config.mk
@@ -13,13 +13,3 @@ PLATFORM_CPPFLAGS += $(PF_CPPFLAGS_ARMV7)
 # SEE README.arm-unaligned-accesses
 PF_NO_UNALIGNED := $(call cc-option, -mno-unaligned-access,)
 PLATFORM_NO_UNALIGNED := $(PF_NO_UNALIGNED)
-
-ifneq ($(CONFIG_IMX_CONFIG),)
-ifdef CONFIG_SPL
-ifdef CONFIG_SPL_BUILD
-ALL-y  += SPL
-endif
-else
-ALL-y  += u-boot.imx
-endif
-endif
diff --git a/spl/Makefile b/spl/Makefile
index e8c5938..6e9a740 100644
--- a/spl/Makefile
+++ b/spl/Makefile
@@ -178,9 +178,6 @@ MKIMAGEFLAGS_MLO.byteswap = -T omapimage -n byteswap -a 
$(CONFIG_SPL_TEXT_BASE)
 MLO MLO.byteswap: $(obj)/u-boot-spl.bin
$(call if_changed,mkimage)
 
-SPL: $(obj)/u-boot-spl.bin
-   $(Q)$(MAKE) $(build)=arch/arm/imx-common $@
-
 ALL-y  += $(obj)/$(SPL_BIN).bin
 
 ifdef CONFIG_SAMSUNG
-- 
1.8.3.2

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


[U-Boot] [PATCH 02/15] kbuild: abolish depend target

2014-02-07 Thread Masahiro Yamada
This commit moves include/generated/{generic-asm-offsets.h, asm-offsets.h}
from depend targets to prepare targets and deletes depend targets.

Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---

 Makefile | 27 +++
 1 file changed, 15 insertions(+), 12 deletions(-)

diff --git a/Makefile b/Makefile
index 3d98b04..fb6cf8e 100644
--- a/Makefile
+++ b/Makefile
@@ -940,7 +940,7 @@ $(sort $(u-boot-init) $(u-boot-main)): $(u-boot-dirs) ;
 # Error messages still appears in the original language
 
 PHONY += $(u-boot-dirs)
-$(u-boot-dirs): depend prepare scripts
+$(u-boot-dirs): prepare scripts
$(Q)$(MAKE) $(build)=$@
 
 tools: prepare
@@ -989,7 +989,8 @@ prepare1: prepare2 $(version_h) $(timestamp_h)
 
 archprepare: prepare1 scripts_basic
 
-prepare0: archprepare FORCE
+prepare0: archprepare FORCE include/generated/generic-asm-offsets.h \
+   include/generated/asm-offsets.h
@:
 
 # All the preparing..
@@ -1039,27 +1040,29 @@ quiet_cmd_autoconf = GEN $@
 include/autoconf.mk: include/config.h
$(call cmd,autoconf)
 
-u-boot.lds: $(LDSCRIPT) depend prepare
+# ---
+
+PHONY += depend dep
+depend dep:
+   @echo '*** Warning: make $@ is unnecessary now.'
+
+# ---
+
+u-boot.lds: $(LDSCRIPT) prepare
$(CPP) $(cpp_flags) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - $ 
$@
 
-nand_spl: depend prepare
+nand_spl: prepare
$(MAKE) $(build)=nand_spl/board/$(BOARDDIR) all
 
 u-boot-nand.bin:   nand_spl u-boot.bin
cat nand_spl/u-boot-spl-16k.bin u-boot.bin  u-boot-nand.bin
 
-spl/u-boot-spl.bin: tools depend prepare
+spl/u-boot-spl.bin: tools prepare
$(MAKE) obj=spl -f $(srctree)/spl/Makefile all
 
-tpl/u-boot-tpl.bin: tools depend prepare
+tpl/u-boot-tpl.bin: tools prepare
$(MAKE) obj=tpl -f $(srctree)/spl/Makefile all 
CONFIG_TPL_BUILD=y
 
-# Explicitly make _depend in subdirs containing multiple targets to prevent
-# parallel sub-makes creating .depend files simultaneously.
-depend dep:\
-   include/generated/generic-asm-offsets.h \
-   include/generated/asm-offsets.h
-
 TAG_SUBDIRS := $(u-boot-dirs) include
 
 FIND := find
-- 
1.8.3.2

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


[U-Boot] [PATCH 06/15] kbuild: use shorten logs objcopy rules

2014-02-07 Thread Masahiro Yamada
Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---

 Makefile | 41 +
 examples/api/Makefile|  6 --
 examples/standalone/Makefile | 10 ++
 spl/Makefile | 19 +--
 4 files changed, 56 insertions(+), 20 deletions(-)

diff --git a/Makefile b/Makefile
index edb6868..864cd70 100644
--- a/Makefile
+++ b/Makefile
@@ -744,6 +744,9 @@ ifneq ($(CONFIG_SYS_TEXT_BASE),)
 LDFLAGS_u-boot += -Ttext $(CONFIG_SYS_TEXT_BASE)
 endif
 
+quiet_cmd_objcopy = OBJCOPY $@
+cmd_objcopy = $(OBJCOPY) $(OBJCOPYFLAGS) $(OBJCOPYFLAGS_$(@F)) $ $@
+
 all:   $(ALL-y)
 
 PHONY += dtbs
@@ -753,27 +756,31 @@ dtbs dts/dt.dtb: checkdtc u-boot
 u-boot-dtb.bin: u-boot.bin dts/dt.dtb
cat $^ $@
 
-u-boot.hex:u-boot
-   $(OBJCOPY) $(OBJCOPYFLAGS) -O ihex $ $@
+OBJCOPYFLAGS_u-boot.hex := -O ihex
 
-u-boot.srec:   u-boot
-   $(OBJCOPY) $(OBJCOPYFLAGS) -O srec $ $@
+OBJCOPYFLAGS_u-boot.srec := -O srec
 
-u-boot.bin:u-boot
-   $(OBJCOPY) $(OBJCOPYFLAGS) -O binary $ $@
-   $(call DO_STATIC_RELA,$,$@,$(CONFIG_SYS_TEXT_BASE))
-   $(BOARD_SIZE_CHECK)
+u-boot.hex u-boot.srec: u-boot FORCE
+   $(call if_changed,objcopy)
+
+OBJCOPYFLAGS_u-boot.bin := -O binary
+
+u-boot.bin: u-boot FORCE
+   $(call if_changed,objcopy)
+   $(call DO_STATIC_RELA,$,$@,$(CONFIG_SYS_TEXT_BASE))
+   $(BOARD_SIZE_CHECK)
 
 u-boot.ldr:u-boot
$(CREATE_LDR_ENV)
$(LDR) -T $(CONFIG_BFIN_CPU) -c $@ $ $(LDR_FLAGS)
$(BOARD_SIZE_CHECK)
 
-u-boot.ldr.hex:u-boot.ldr
-   $(OBJCOPY) $(OBJCOPYFLAGS) -O ihex $ $@ -I binary
+OBJCOPYFLAGS_u-boot.ldr.hex := -I binary -O ihex
+
+OBJCOPYFLAGS_u-boot.ldr.srec := -I binary -O srec
 
-u-boot.ldr.srec:   u-boot.ldr
-   $(OBJCOPY) $(OBJCOPYFLAGS) -O srec $ $@ -I binary
+u-boot.ldr.hex u-boot.ldr.srec: u-boot.ldr FORCE
+   $(call if_changed,objcopy)
 
 #
 # U-Boot entry point, needed for booting of full-blown U-Boot
@@ -1254,6 +1261,16 @@ quiet_cmd_rmdirs = $(if $(wildcard $(rm-dirs)),CLEAN   
$(wildcard $(rm-dirs)))
 quiet_cmd_rmfiles = $(if $(wildcard $(rm-files)),CLEAN   $(wildcard 
$(rm-files)))
   cmd_rmfiles = rm -f $(rm-files)
 
+# read all saved command lines
+
+targets := $(wildcard $(sort $(targets)))
+cmd_files := $(wildcard .*.cmd $(foreach f,$(targets),$(dir $(f)).$(notdir 
$(f)).cmd))
+
+ifneq ($(cmd_files),)
+  $(cmd_files): ;  # Do not try to update included dependency files
+  include $(cmd_files)
+endif
+
 # Shorthand for $(Q)$(MAKE) -f scripts/Makefile.clean obj=dir
 # Usage:
 # $(Q)$(MAKE) $(clean)=dir
diff --git a/examples/api/Makefile b/examples/api/Makefile
index 09475f8..6c19830 100644
--- a/examples/api/Makefile
+++ b/examples/api/Makefile
@@ -40,8 +40,10 @@ OBJS += $(addprefix $(obj)/,$(notdir $(EXT_SOBJ_FILES-y)))
 $(obj)/demo:   $(OBJS)
$(LD) --gc-sections -Ttext $(LOAD_ADDR) -o $@ $^ 
$(PLATFORM_LIBS)
 
-$(obj)/demo.bin: $(obj)/demo
-   $(OBJCOPY) -O binary $ $@ 2/dev/null
+# demo.bin is never genrated. Is this necessary?
+OBJCOPYFLAGS_demo.bin := -O binary
+$(obj)/demo.bin: $(obj)/demo FORCE
+   $(call if_changed,objcopy)
 
 # Rule to build generic library C files
 $(addprefix $(obj)/,$(notdir $(EXT_COBJ_FILES-y))): $(obj)/%.o: 
$(SRCTREE)/lib/%.c FORCE
diff --git a/examples/standalone/Makefile b/examples/standalone/Makefile
index 47c9d54..5f61043 100644
--- a/examples/standalone/Makefile
+++ b/examples/standalone/Makefile
@@ -72,8 +72,10 @@ $(obj)/%:$(obj)/%.o $(LIB)
-o $@ -e $(SYM_PREFIX)$(notdir $(:.o=)) $ $(LIB) \
-L$(gcclibdir) -lgcc
 
-$(obj)/%.srec: $(obj)/%
-   $(OBJCOPY) -O srec $ $@ 2/dev/null
+$(obj)/%.srec: OBJCOPYFLAGS := -O srec
+$(obj)/%.srec: $(obj)/% FORCE
+   $(call if_changed,objcopy)
 
-$(obj)/%.bin:  $(obj)/%
-   $(OBJCOPY) -O binary $ $@ 2/dev/null
+$(obj)/%.bin: OBJCOPYFLAGS := -O binary
+$(obj)/%.bin: $(obj)/% FORCE
+   $(call if_changed,objcopy)
diff --git a/spl/Makefile b/spl/Makefile
index 10b77a5..9c5bb53 100644
--- a/spl/Makefile
+++ b/spl/Makefile
@@ -198,8 +198,13 @@ $(obj)/$(BOARD)-spl.bin: $(obj)/u-boot-spl.bin
$(OBJTREE)/tools/mkexynosspl) $(VAR_SIZE_PARAM) $ $@
 endif
 
-$(obj)/$(SPL_BIN).bin: $(obj)/$(SPL_BIN)
-   $(OBJCOPY) $(OBJCOPYFLAGS) $(SPL_OBJCFLAGS) -O binary $ $@
+quiet_cmd_objcopy = OBJCOPY $@
+cmd_objcopy = $(OBJCOPY) $(OBJCOPYFLAGS) $(OBJCOPYFLAGS_$(@F)) $ $@
+
+OBJCOPYFLAGS_$(SPL_BIN).bin = $(SPL_OBJCFLAGS) -O binary
+
+$(obj)/$(SPL_BIN).bin: $(obj)/$(SPL_BIN) FORCE
+   $(call if_changed,objcopy)
 
 LDFLAGS_$(SPL_BIN) += -T u-boot-spl.lds $(LDFLAGS_FINAL)
 ifneq ($(CONFIG_SPL_TEXT_BASE),)
@@ -227,6 +232,16 @@ cpp_flags := $(KBUILD_CPPFLAGS) $(CPPFLAGS) 
$(UBOOTINCLUDE) $(NOSTDINC_FLAGS)
 $(obj)/u-boot-spl.lds: $(LDSCRIPT) FORCE
  

Re: [U-Boot] serial/serial_arc - add driver for ARC UART

2014-02-07 Thread Tom Rini
On Fri, Dec 13, 2013 at 10:35:11AM +0400, Alexey Brodkin wrote:

 Driver for non-standard on-chip UART, instantiated in the ARC (Synopsys)
 FPGA Boards such as ARCAngel4/ML50x
 
 Signed-off-by: Alexey Brodkin abrod...@synopsys.com

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] [PATCH v4 0/9] Add support for the ARC700 architecture

2014-02-07 Thread Tom Rini
On Tue, Feb 04, 2014 at 12:56:12PM +0400, Alexey Brodkin wrote:

 This patch series adds support for the Synopsys DesignWare ARC700 
 architecture.
 
 DesignWare ARC700 is family of 32-bit CPUs developed by Synopsys, Inc.
 
 Since version 3.9 ARC architecture is supported in mainline Linux developemnt.
 And now to get better support in commonly used boot-loader we are introducing
 port of U-Boot for ARC700 CPUs.
 
 Patches included in this series are also available on GitHub in the
 'for-upstream-v4' branch:
 
 g...@github.com:foss-for-synopsys-dwc-arc-processors/u-boot.git
 
 Also browsable here:
 
 https://github.com/foss-for-synopsys-dwc-arc-processors/u-boot/tree/for-upstream-v4
 
 NOTE: there's an acked by Tom Rini prerequisite for Arcangel4 board:
 
 http://patchwork.ozlabs.org/patch/300901/
 
 For those who are interested in building this port please download pre-built
 toolchains for x86_64 hosts.
 
 For RedHat-based distros:
 https://github.com/foss-for-synopsys-dwc-arc-processors/toolchain/releases/download/arc-4.8-R2/arc_gnu_4.8-R2_prebuilt_uclibc_le_rhel6_install.tar.gz
 
 For Debian-based distros:
 https://github.com/foss-for-synopsys-dwc-arc-processors/toolchain/releases/download/arc-4.8-R2/arc_gnu_4.8-R2_prebuilt_uclibc_le_ubuntu_install.tar.gz
 
 Major changes for v4:
 
  * Clean-up of board configurations.
 
 Each patch that follows has detailed description of its changes.
 
 Alexey Brodkin (9):
   arc: add architecture header files
   arc: add cpu files
   arc: add library functions
   arc: bdinfo, image and arc-specific init functions declarations
 support
   arc: add support for standalone programs
   arc: add Arcangel4 board support
   arc: add AXS101 board support
   arc: add architecture to MAKEALL
   arc: add README for architecture

I've applied the series to u-boot/master.  But please note that with the
toolchain links above, MAKEALL doesn't agree that axs101 builds without
error (but doing it with 'make' does) and arcangel4 doesn't build due
to:
arc-linux-ld.bfd: Error: Overflow detected in relocation value;
arc-linux-ld.bfd: Relocation value should be between 16777215 and -16777216 
whereas it  2130661664
arc-linux-ld.bfd: Global symbol: default_serial_console.
arc-linux-ld.bfd:
Relocation type is:R_ARC_S25W_PCREL
FileName:drivers/serial/built-in.o
Section Name:.text
Offset in Section:10
arc-linux-ld.bfd: final link failed: Bad value
make: *** [/home/trini/work/u-boot/u-boot/temp/u-boot] Error 1

-- 
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 request: u-boot-blackfin

2014-02-07 Thread Tom Rini
On Fri, Feb 07, 2014 at 11:33:57AM +0800, Sonic Zhang wrote:

 Hi Tom,
 
 Please pull the following patches for Blackfin from u-boot-blackfin
 into your tree.
 
 Thanks
 
 Sonic Zhang
 
 
 The following changes since commit dbf3de2dd26cae37d16b00b348828c883b658cc5:
 
   include/usb/s3c_udc.h: Add asm/sizes.h (2014-02-06 14:26:05 -0500)
 
 are available in the git repository at:
 
   git://git.denx.de/u-boot-blackfin.git master
 
 for you to fetch changes up to 819ca38fa70da85a14b4328d1511146e6c59eb32:
 
   blackfin: Initialize the EMAC VLAN with proper default value
 (2014-02-07 11:18:06 +0800)
 
 
 Aaron Wu (1):
   blackfin: Initialize the EMAC VLAN with proper default value
 
 Bob Liu (1):
   blackfin: init bss early
 
 Sonic Zhang (2):
   blackfin: The logic of the BF609 macro is opposite.
   blackfin: Change SMC dcplb entry flag to cover 16M address region
 
  arch/blackfin/cpu/initcode.h  | 6 +++---
  arch/blackfin/cpu/start.S | 2 +-
  arch/blackfin/include/asm/mach-common/bits/emac.h | 3 +++
  arch/blackfin/lib/board.c | 3 ++-
  drivers/net/bfin_mac.c| 2 ++
  5 files changed, 11 insertions(+), 5 deletions(-)

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] [PATCH 2/2] usb: ehci: fully align interrupt QHs/QTDs

2014-02-07 Thread Marek Vasut
On Friday, February 07, 2014 at 07:48:06 AM, Stephen Warren wrote:
 On 02/06/2014 07:53 PM, Marek Vasut wrote:
  On Thursday, February 06, 2014 at 09:13:06 PM, Stephen Warren wrote:
  From: Stephen Warren swar...@nvidia.com
  
  These data structures are passed to cache-flushing routines, and hence
  must be conform to both the USB the cache-flusing alignment
  requirements. That means aligning to USB_DMA_MINALIGN. This is
  important on systems where cache lines are 32 bytes.
  
  Signed-off-by: Stephen Warren swar...@nvidia.com
  
  Acked-by: Marek Vasut ma...@denx.de
 
 Oh, I assumed you would be applying this?

Yes I would , but the previous patch still needs some discussion.

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] ush: ehci: initialize altnext pointers in QH

2014-02-07 Thread Marek Vasut
On Friday, February 07, 2014 at 07:47:14 AM, Stephen Warren wrote:
 On 02/06/2014 07:53 PM, Marek Vasut wrote:
  On Thursday, February 06, 2014 at 09:13:05 PM, Stephen Warren wrote:
  From: Stephen Warren swar...@nvidia.com
  
  A QH's overlay QTD altnext pointer should be explicitly marked invalid
  so that the EHCI controller knows to look at the QTD next pointer.
  Update the driver to do this.
  
  Can you please add a reference to the spec where this is stated ?
 
 Section 4.10.2 Advance Queue. Are you simply asking me to repost with
 that added to the commit description, or justify the change?

Justify it. Of course, clear and helpful commit message like so would be very 
nice, so feel free to repost this please.

 FWIW, the situation is that the QH set up by ehci_submit_async() does
 not have the active or halt bits set the first time around, so after the
 Fetch Queue Head state, the Advance Queue state is entered, and this
 is when the T bits of the Alternate Next qTD Pointer and Next qTD
 Pointer are checked. I guess since I can download the PDF from Intel's
 website without agreeing to any kind of license, I can quote it:
 
 If the field Bytes to Transfer is not zero and the T-bit in the
 Alternate Next qTD Pointer is set to zero, then the host controller uses
 the Alternate Next qTD Pointer. Otherwise, the host controller uses the
 Next qTD Pointer. If Next qTD Pointer’s T-bit is set to a one, then the
 host controller exits this state and uses the horizontal pointer to the
 next schedule data structure.
 
  diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
  
  @@ -1186,6 +1187,7 @@ create_int_queue(struct usb_device *dev, unsigned
  long pipe, int queuesize, qh-qh_link = QH_LINK_TERMINATE;
  
 qh-qh_overlay.qt_next = (uint32_t)td;
  
  +  qh-qh_overlay.qt_altnext = QT_NEXT_TERMINATE;
  
  So next is td and altnext is terminate here ?
 
 Yes. TERMINATE really just means INVALID, so the EHCI controller gets
 the pointer from qt_next rather than qt_altnext.

H ... not really clear or self-explaining, is it. If you have time to 
produce a RFC to clean this up, I'm all for checking it.

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


[U-Boot] [PATCH] zynq: Add support for U-BOOT SPL

2014-02-07 Thread Michal Simek
SPL is using ps7_init.c/h files which are generated
from design tools which have to be copied to
boards/xilinx/zynq folder before compilation.

BSS section is moved to SDRAM because fat support
requires more space than SRAM size.

Added:
- MMC and QSPI support
- Boot OS directly from SPL
- Enable SPL command

Signed-off-by: Michal Simek michal.si...@xilinx.com
---

 arch/arm/cpu/armv7/zynq/Makefile   |  1 +
 arch/arm/cpu/armv7/zynq/cpu.c  |  4 +-
 arch/arm/cpu/armv7/zynq/spl.c  | 69 ++
 arch/arm/cpu/armv7/zynq/u-boot-spl.lds | 61 +++
 arch/arm/include/asm/arch-zynq/spl.h   | 18 
 board/xilinx/zynq/Makefile |  1 +
 board/xilinx/zynq/ps7_init.c   | 12 ++
 include/configs/zynq-common.h  | 77 ++
 8 files changed, 241 insertions(+), 2 deletions(-)
 create mode 100644 arch/arm/cpu/armv7/zynq/spl.c
 create mode 100644 arch/arm/cpu/armv7/zynq/u-boot-spl.lds
 create mode 100644 arch/arm/include/asm/arch-zynq/spl.h
 create mode 100644 board/xilinx/zynq/ps7_init.c

diff --git a/arch/arm/cpu/armv7/zynq/Makefile b/arch/arm/cpu/armv7/zynq/Makefile
index 3374789..3363a3c 100644
--- a/arch/arm/cpu/armv7/zynq/Makefile
+++ b/arch/arm/cpu/armv7/zynq/Makefile
@@ -13,3 +13,4 @@ obj-y += cpu.o
 obj-y  += ddrc.o
 obj-y  += slcr.o
 obj-y  += clk.o
+obj-$(CONFIG_SPL_BUILD)+= spl.o
diff --git a/arch/arm/cpu/armv7/zynq/cpu.c b/arch/arm/cpu/armv7/zynq/cpu.c
index 5d505dd..7626b5c 100644
--- a/arch/arm/cpu/armv7/zynq/cpu.c
+++ b/arch/arm/cpu/armv7/zynq/cpu.c
@@ -17,7 +17,7 @@ void lowlevel_init(void)
 int arch_cpu_init(void)
 {
zynq_slcr_unlock();
-
+#ifndef CONFIG_SPL_BUILD
/* Device config APB, unlock the PCAP */
writel(0x757BDF0D, devcfg_base-unlock);
writel(0x, devcfg_base-rom_shadow);
@@ -35,7 +35,7 @@ int arch_cpu_init(void)
/* Urgent write, ports S2/S3 */
writel(0xC, slcr_base-ddr_urgent);
 #endif
-
+#endif
zynq_clk_early_init();
zynq_slcr_lock();

diff --git a/arch/arm/cpu/armv7/zynq/spl.c b/arch/arm/cpu/armv7/zynq/spl.c
new file mode 100644
index 000..fcad762
--- /dev/null
+++ b/arch/arm/cpu/armv7/zynq/spl.c
@@ -0,0 +1,69 @@
+/*
+ * (C) Copyright 2014 Xilinx, Inc. Michal Simek
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+#include common.h
+#include spl.h
+
+#include asm/io.h
+#include asm/arch/hardware.h
+#include asm/arch/spl.h
+#include asm/arch/sys_proto.h
+
+DECLARE_GLOBAL_DATA_PTR;
+
+void board_init_f(ulong dummy)
+{
+   ps7_init();
+
+   /* Clear the BSS. */
+   memset(__bss_start, 0, __bss_end - __bss_start);
+
+   /* Set global data pointer. */
+   gd = gdata;
+
+   preloader_console_init();
+   arch_cpu_init();
+   board_init_r(NULL, 0);
+}
+
+u32 spl_boot_device(void)
+{
+   u32 mode;
+
+   switch ((zynq_slcr_get_boot_mode())  ZYNQ_BM_MASK) {
+#ifdef CONFIG_SPL_SPI_SUPPORT
+   case ZYNQ_BM_QSPI:
+   puts(qspi boot\n);
+   mode = BOOT_DEVICE_SPI;
+   break;
+#endif
+#ifdef CONFIG_SPL_MMC_SUPPORT
+   case ZYNQ_BM_SD:
+   puts(mmc boot\n);
+   mode = BOOT_DEVICE_MMC1;
+   break;
+#endif
+   default:
+   puts(Unsupported boot mode selected\n);
+   hang();
+   }
+
+   return mode;
+}
+
+#ifdef CONFIG_SPL_MMC_SUPPORT
+u32 spl_boot_mode(void)
+{
+   return MMCSD_MODE_FAT;
+}
+#endif
+
+#ifdef CONFIG_SPL_OS_BOOT
+int spl_start_uboot(void)
+{
+   /* boot linux */
+   return 0;
+}
+#endif
diff --git a/arch/arm/cpu/armv7/zynq/u-boot-spl.lds 
b/arch/arm/cpu/armv7/zynq/u-boot-spl.lds
new file mode 100644
index 000..0c4501e
--- /dev/null
+++ b/arch/arm/cpu/armv7/zynq/u-boot-spl.lds
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2014 Xilinx, Inc. Michal Simek
+ * Copyright (c) 2004-2008 Texas Instruments
+ *
+ * (C) Copyright 2002
+ * Gary Jennejohn, DENX Software Engineering, ga...@denx.de
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+MEMORY { .sram : ORIGIN = CONFIG_SPL_TEXT_BASE,\
+   LENGTH = CONFIG_SPL_MAX_SIZE }
+MEMORY { .sdram : ORIGIN = CONFIG_SPL_BSS_START_ADDR, \
+   LENGTH = CONFIG_SPL_BSS_MAX_SIZE }
+
+OUTPUT_FORMAT(elf32-littlearm, elf32-littlearm, elf32-littlearm)
+OUTPUT_ARCH(arm)
+ENTRY(_start)
+SECTIONS
+{
+   . = ALIGN(4);
+   .text :
+   {
+   __image_copy_start = .;
+   CPUDIR/start.o (.text*)
+   *(.text*)
+   }  .sram
+
+   . = ALIGN(4);
+   .rodata : {
+   *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*)))
+   }  .sram
+
+   . = ALIGN(4);
+   .data : {
+   *(.data*)
+   }  .sram
+
+   . = ALIGN(4);
+
+   . = .;
+
+   __image_copy_end = .;
+
+   _end = .;
+
+   /* Move BSS section to RAM because of FAT */
+   .bss (NOLOAD) : {
+   __bss_start = .;
+  

[U-Boot] [PATCH] x600: Switch to CONFIG_PHYLIB

2014-02-07 Thread Tom Rini
Now that the designware ethernet driver uses phylib we need to turn it
on here.

Signed-off-by: Tom Rini tr...@ti.com
---
 include/configs/x600.h |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/include/configs/x600.h b/include/configs/x600.h
index 39540e3..00b938a 100644
--- a/include/configs/x600.h
+++ b/include/configs/x600.h
@@ -74,10 +74,9 @@
 /* Ethernet config options */
 #define CONFIG_MII
 #define CONFIG_DESIGNWARE_ETH
-#define CONFIG_DW_SEARCH_PHY
 #define CONFIG_NET_MULTI
+#define CONFIG_PHYLIB
 #define CONFIG_PHY_RESET_DELAY 1   /* in usec */
-#define CONFIG_DW_AUTONEG
 #define CONFIG_PHY_ADDR0   /* PHY address */
 #define CONFIG_PHY_GIGE/* Include GbE speed/duplex 
detection */
 
-- 
1.7.9.5

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


Re: [U-Boot] [uBoot] [PATCH v2 1/2] common: spl: Add spl sata boot support

2014-02-07 Thread Dan Murphy
Roger

On 02/07/2014 03:48 AM, Roger Quadros wrote:
 Hi Dan,

 On 02/03/2014 02:59 PM, Dan Murphy wrote:
 Add spl_sata to read a fat partition from a bootable SATA
 drive.

 Signed-off-by: Dan Murphy dmur...@ti.com
 ---
 I got some check-patch errors with this one.
 Once that is fixed you can please add

Thanks for the review

Checkpatch errors or warnings?

When I ran checkpatch before submitting I did have 2 warnings but these should 
be
acceptable.

I will let the maintainer decide on the acceptability of the two warnings since 
these warnings are consistent
with the spl_mmc and spl_usb files

WARNING: suspect code indent for conditional statements (8, 8)
#122: FILE: common/spl/spl_sata.c:39:
+if (spl_start_uboot() || spl_load_image_fat_os(stor_dev,
[...]
+err = spl_load_image_fat(stor_dev,

WARNING: line over 80 characters
#123: FILE: common/spl/spl_sata.c:40:
+CONFIG_SYS_SATA_FAT_BOOT_PARTITION))

total: 0 errors, 2 warnings, 99 lines checked



 Reviewed-by: Roger Quadros rog...@ti.com

 cheers,
 -roger
 v2 - Removed debug print - http://patchwork.ozlabs.org/patch/314811/

  common/Makefile   |3 +++
  common/cmd_scsi.c |2 ++
  common/spl/Makefile   |1 +
  common/spl/spl.c  |5 +
  common/spl/spl_sata.c |   49 
 +
  include/spl.h |3 +++
  spl/Makefile  |1 +
  7 files changed, 64 insertions(+)
  create mode 100644 common/spl/spl_sata.c

 diff --git a/common/Makefile b/common/Makefile
 index 4d99ecd..b0f5b62 100644
 --- a/common/Makefile
 +++ b/common/Makefile
 @@ -201,6 +201,9 @@ ifdef CONFIG_SPL_USB_HOST_SUPPORT
  obj-$(CONFIG_SPL_USB_SUPPORT) += usb.o usb_hub.o
  obj-$(CONFIG_USB_STORAGE) += usb_storage.o
  endif
 +ifdef CONFIG_SPL_SATA_SUPPORT
 +obj-$(CONFIG_CMD_SCSI) += cmd_scsi.o
 +endif
  ifneq ($(CONFIG_SPL_NET_SUPPORT),y)
  obj-$(CONFIG_ENV_IS_NOWHERE) += env_nowhere.o
  obj-$(CONFIG_ENV_IS_IN_MMC) += env_mmc.o
 diff --git a/common/cmd_scsi.c b/common/cmd_scsi.c
 index 7b97dc9..b3f7687 100644
 --- a/common/cmd_scsi.c
 +++ b/common/cmd_scsi.c
 @@ -168,7 +168,9 @@ removable:
  scsi_curr_dev = -1;
  
  printf(Found %d device(s).\n, scsi_max_devs);
 +#ifndef CONFIG_SPL_BUILD
  setenv_ulong(scsidevs, scsi_max_devs);
 +#endif
  }
  
  int scsi_get_disk_count(void)
 diff --git a/common/spl/Makefile b/common/spl/Makefile
 index 65a1484f..64569c2 100644
 --- a/common/spl/Makefile
 +++ b/common/spl/Makefile
 @@ -18,4 +18,5 @@ obj-$(CONFIG_SPL_NET_SUPPORT) += spl_net.o
  obj-$(CONFIG_SPL_MMC_SUPPORT) += spl_mmc.o
  obj-$(CONFIG_SPL_USB_SUPPORT) += spl_usb.o
  obj-$(CONFIG_SPL_FAT_SUPPORT) += spl_fat.o
 +obj-$(CONFIG_SPL_SATA_SUPPORT) += spl_sata.o
  endif
 diff --git a/common/spl/spl.c b/common/spl/spl.c
 index 0645cee..774fdad 100644
 --- a/common/spl/spl.c
 +++ b/common/spl/spl.c
 @@ -210,6 +210,11 @@ void board_init_r(gd_t *dummy1, ulong dummy2)
  spl_usb_load_image();
  break;
  #endif
 +#ifdef CONFIG_SPL_SATA_SUPPORT
 +case BOOT_DEVICE_SATA:
 +spl_sata_load_image();
 +break;
 +#endif
  default:
  debug(SPL: Un-supported Boot Device\n);
  hang();
 diff --git a/common/spl/spl_sata.c b/common/spl/spl_sata.c
 new file mode 100644
 index 000..2e7adca
 --- /dev/null
 +++ b/common/spl/spl_sata.c
 @@ -0,0 +1,49 @@
 +/*
 + * (C) Copyright 2013
 + * Texas Instruments, www.ti.com
 + *
 + * Dan Murphy dmur...@ti.com
 + *
 + * SPDX-License-Identifier: GPL-2.0+
 + *
 + * Derived work from spl_usb.c
 + */
 +
 +#include common.h
 +#include spl.h
 +#include asm/u-boot.h
 +#include sata.h
 +#include fat.h
 +#include version.h
 +#include image.h
 +
 +DECLARE_GLOBAL_DATA_PTR;
 +
 +void spl_sata_load_image(void)
 +{
 +int err;
 +block_dev_desc_t *stor_dev;
 +
 +err = init_sata(CONFIG_SPL_SATA_BOOT_DEVICE);
 +if (err) {
 +#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
 +printf(spl: sata init failed: err - %d\n, err);
 +#endif
 +hang();
 +} else {
 +/* try to recognize storage devices immediately */
 +stor_dev = scsi_get_dev(0);
 +}
 +
 +#ifdef CONFIG_SPL_OS_BOOT
 +if (spl_start_uboot() || spl_load_image_fat_os(stor_dev,
 +
 CONFIG_SYS_SATA_FAT_BOOT_PARTITION))
 +#endif
 +err = spl_load_image_fat(stor_dev,
 +CONFIG_SYS_SATA_FAT_BOOT_PARTITION,
 +CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME);
 +if (err) {
 +puts(Error loading sata device\n);
 +hang();
 +}
 +}
 diff --git a/include/spl.h b/include/spl.h
 index 5e24856..ee09fb6 100644
 --- a/include/spl.h
 +++ b/include/spl.h
 @@ -64,6 +64,9 @@ void spl_net_load_image(const char *device);
  /* USB SPL functions */
  void spl_usb_load_image(void);
  
 +/* SATA SPL functions */
 +void spl_sata_load_image(void);
 +
  /* 

Re: [U-Boot] net: execute miiphy_init if CONFIG_PHYLIB defined

2014-02-07 Thread Tom Rini
On Fri, Jan 10, 2014 at 07:58:11PM +0400, Alexey Brodkin wrote:

 In common/Makefile miiphyutil.o gets built if any of the following
 items enabled:
  * CONFIG_PHYLIB
  * CONFIG_MII
  * CONFIG_CMD_MII
 
 So it's possible to not define CONFIG_MII or CONFIG_CMD_MII and still
 use functions like miiphy_get_dev_by_name.
 
 In its turn miiphy_get_dev_by_name traverses mii_devs list which is
 not initialized because miiphy_init never got called.
 
 Signed-off-by: Alexey Brodkin abrod...@synopsys.com
 
 Cc: Joe Hershberger joe.hershber...@ni.com
 Cc: Rob Herring rob.herr...@calxeda.com
 Cc: Simon Glass s...@chromium.org
 Cc: Wolfgang Denk w...@denx.de
 Acked-by: Joe Hershberger joe.hershber...@ni.com

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] net/designware - switch driver to phylib usage

2014-02-07 Thread Tom Rini
On Wed, Jan 22, 2014 at 08:54:06PM +0400, Alexey Brodkin wrote:

 With this change driver will benefit from existing phylib and thus
 custom phy functionality implemented in the driver will go away:
  * Instantiation of the driver is now much shorter - 2 parameters
 instead of 4.
  * Simplified phy management/functoinality in driver is replaced with
 rich functionality of phylib.
  * Support of custom phy initialization is now done with existing
 board_phy_config.
 
 Note that after this change some previously used config options
 (driver-specific PHY configuration) will be obsolete and they are simply
 substituted with similar options of phylib.
 
 For example:
  * CONFIG_DW_AUTONEG - no need in this one. Autonegotiation is enabled
 by default.
  * CONFIG_DW_SEARCH_PHY - if one wants to specify attached phy
 explicitly CONFIG_PHY_ADDR board config option has to be used, otherwise
 automatically the first discovered on MDIO bus phy will be used
 
 I believe there's no need now in doc/README.designware_eth because
 user only needs to instantiate the driver with designware_initialize
 whose prototype exists in include/netdev.h.
 
 Prerequisites are:
  1) http://patchwork.ozlabs.org/patch/313326/
  2) http://patchwork.ozlabs.org/patch/309764/
 
 Signed-off-by: Alexey Brodkin abrod...@synopsys.com
 
 Cc: Joe Hershberger joe.hershber...@ni.com
 Cc: Vipin Kumar vipin.ku...@st.com
 Cc: Stefan Roese s...@denx.de
 Cc: Mischa Jonker mjon...@synopsys.com
 Cc: Shiraz Hashim shiraz.has...@st.com
 Cc: Albert ARIBAUD albert.u.b...@aribaud.net
 Cc: Amit Virdi amit.vi...@st.com
 Cc: Sonic Zhang sonic.zh...@analog.com

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] [PATCH] x600: Switch to CONFIG_PHYLIB

2014-02-07 Thread Tom Rini
On Fri, Feb 07, 2014 at 09:03:23AM -0500, Tom Rini wrote:

 Now that the designware ethernet driver uses phylib we need to turn it
 on here.
 
 Signed-off-by: Tom Rini tr...@ti.com

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] [PATCH] zynq: Add support for U-BOOT SPL

2014-02-07 Thread Tom Rini
On Fri, Feb 07, 2014 at 02:56:34PM +0100, Michal Simek wrote:

 SPL is using ps7_init.c/h files which are generated
 from design tools which have to be copied to
 boards/xilinx/zynq folder before compilation.
 
 BSS section is moved to SDRAM because fat support
 requires more space than SRAM size.
 
 Added:
 - MMC and QSPI support
 - Boot OS directly from SPL
 - Enable SPL command
 
 Signed-off-by: Michal Simek michal.si...@xilinx.com

Reviewed-by: Tom Rini tr...@ti.com

-- 
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 v2 5/6] PPC 85xx: Find PCI host controllers on ppce500 from device tree

2014-02-07 Thread Alexander Graf

On 06.02.2014, at 23:52, Scott Wood scottw...@freescale.com wrote:

 On Thu, 2014-02-06 at 14:26 +0100, Alexander Graf wrote:
 On 04.02.2014, at 03:47, Scott Wood scottw...@freescale.com wrote:
 
 On Fri, 2014-01-31 at 12:16 +0100, Alexander Graf wrote:
 The definition of our ppce500 PV machine is that every address is 
 dynamically
 determined through device tree bindings.
 
 So don't hardcode where PCI devices are in our physical memory layout but 
 instead
 read them dynamically from the device tree we get passed on boot.
 
 Would it be difficult to make the QEMU emulation properly implement
 access windows?
 
 What are access windows? You mean BAR region offsets? Not too hard I
 suppose, but it adds complexity which we were trying to avoid, no?
 
 It would remove U-Boot complexity (unlike the LAW stuff where we just
 skip it) because we wouldn't need to care about QEMU's default settings.
 It should be easier to do than LAW support, and more useful (e.g. Linux
 currently programs this as well, we just get lucky that it misuses the
 device tree as configuration information).
 
 +{
 +  int len;
 +  const uint32_t *prop;
 +
 +  prop = fdt_getprop(fdt, node, property, len);
 +
 +  if (!prop)
 +  return defval;
 +
 +  if (len  ((off + num) * sizeof(uint32_t)))
 +  panic(Invalid fdt);
 +
 +  prop += off;
 +
 +  switch (num) {
 +  case 1:
 +  return *prop;
 +  case 2:
 +  return *(const uint64_t *)prop;
 +  }
 +
 
 What about this function is specific to qemu-ppce500?
 
 Nothing. But the less common code I touch the less I can break.
 
 The more that line of thought is applied, the uglier the codebase we'll
 end up with. :-)
 
 There seems to be an fdt helper framework that's only targeted at a few ARM
 devices - not sure what to make of that.
 
 Make use of whatever parts you can, and extend it with the missing bits
 you need.  There's also common/fdt_support.c which is definitely not
 just used by ARM.
 
 +   panic(Invalid cell size);
 +}
 
 s/cell size/cell count/
 
 +static uint32_t myfdt_one_cell(const void *fdt, int node, const char 
 *property,
 + uint32_t defval)
 +{
 +  return myfdt_readcells(fdt, node, property, 1, 0, defval);
 +}
 
 This looks a lot like fdt_getprop_u32_default(), except for int node
 versus path.
 
 Well, I use it inside of a loop where I don't have the path :).
 
 It still indicates where the proper place for code like this is. :-)
 
 +static void map_tlb1_io(ulong virt_addr, uint64_t phys_addr, uint64_t 
 size)
 +{
 +  unsigned int max_cam, tsize_mask;
 +  int i;
 +
 +  if ((mfspr(SPRN_MMUCFG)  MMUCFG_MAVN) == MMUCFG_MAVN_V1) {
 +  /* Convert (4^max) kB to (2^max) bytes */
 +  max_cam = ((mfspr(SPRN_TLB1CFG)  16)  0xf) * 2 + 10;
 +  tsize_mask = ~1U;
 +  } else {
 +  /* Convert (2^max) kB to (2^max) bytes */
 +  max_cam = __ilog2(mfspr(SPRN_TLB1PS)) + 10;
 +  tsize_mask = ~0U;
 +  }
 +
 +  for (i = 0; size  i  8; i++) {
 +  int tlb_index = find_free_tlbcam();
 +  u32 camsize = __ilog2_u64(size)  tsize_mask;
 +  u32 align = __ilog2(virt_addr)  tsize_mask;
 +  unsigned int tlb_size;
 +
 +  if (tlb_index == -1)
 +  break;
 +
 +  if (align == -2) align = max_cam;
 
 -2?  Besides align being unsigned, if this is meant to handle the case
 where virt_addr is zero, that's undefined for __ilog2() (don't rely on
 it being implemented with cntlzw), and you're not handling the MMUv2
 case.
 
 I merely copied this from tlb.c's setup_ddr_tlbs_phys() and adjusted it
 slightly to let me choose the target virt address.
 
 Would you prefer if I generalize setup_ddr_tlbs_phys() inside tlb.c and
 export that function there?
 
 Yes.
 
 And maybe fix that align == -2 bug while you're at it. :-)
 
 void pci_init_board(void)
 {
 -  struct fsl_pci_info pci_info;
 +  struct pci_controller *pci_hoses;
const void *fdt = get_fdt();
int pci_node;
 +  int pci_num = 0;
 +  int pci_count;
 +  const char *compat = fsl,mpc8540-pci;
 +  ulong map_addr;
 
puts(\n);
 
 -  pci_node = fdt_path_offset(fdt, /pci);
 -  if (pci_node  0) {
 +  /* Start MMIO and PIO range maps above RAM */
 +  map_addr = CONFIG_MAX_MEM_MAPPED;
 +
 +  /* Count and allocate PCI buses */
 +  pci_count = myfdt_count_compatibles(fdt, compat);
 +
 +  if (pci_count) {
 +  pci_hoses = malloc(sizeof(struct pci_controller) * pci_count);
 +  } else {
printf(PCI: disabled\n\n);
return;
}
 
 -  SET_STD_PCI_INFO(pci_info, 1);
 -
 -  fsl_setup_hose(pci1_hose, pci_info.regs);
 -  printf(PCI: 32 bit, 66 MHz, async, host, base address %lx\n,
 -  pci_info.regs);
 -
 -  fsl_pci_init_port(pci_info, pci1_hose, 0);
 +  /* Spawn PCI buses based on device tree */
 +  pci_node = fdt_node_offset_by_compatible(fdt, -1, compat);
 +  while (pci_node != -FDT_ERR_NOTFOUND) {
 +  struct fsl_pci_info pci_info = { };
 +  uint64_t 

Re: [U-Boot] [Qemu-ppc] [PATCH v2 5/6] PPC 85xx: Find PCI host controllers on ppce500 from device tree

2014-02-07 Thread Alexander Graf

On 07.02.2014, at 15:54, Alexander Graf ag...@suse.de wrote:

 
 On 06.02.2014, at 23:52, Scott Wood scottw...@freescale.com wrote:
 
 On Thu, 2014-02-06 at 14:26 +0100, Alexander Graf wrote:
 
 How about using fdt_translate_address() or other existing functionality?
 
 Mind to show exactly how?
 
 I guess you can't use that when you don't know the bus address, but
 still this is the wrong place to implement it.  If getting PCI range
 info from the device tree is something we want to do, then it should be
 a new common code helper.
 
 The more I think about this the less of an idea I have how to do any generic 
 API for this at all. And I'm not convinced anything generic is going to help 
 anyone. Do a git grep on fdt_translate_address over the code base and you 
 will find a _single_ caller.
 
 So even if we come up with something now, nobody's going to use it.

Hrm. Maybe fdt_get_base_address() is the answer?


Alex

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


Re: [U-Boot] [PATCH] mmc: set rca to 1 for MMC cards

2014-02-07 Thread Pantelis Antoniou
Looks good.

On Jan 31, 2014, at 1:11 AM, Stephen Warren wrote:

 From: Stephen Warren swar...@nvidia.com
 
 U-Boot currently sets MMC cards' RCA register to 0. This value is
 reserved according to the specification. Use a value of 1 instead, just
 like the Linux kernel.
 
 Signed-off-by: Stephen Warren swar...@nvidia.com
 ---
 drivers/mmc/mmc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
 index c6a1c23fbf1c..7efc2bedbe11 100644
 --- a/drivers/mmc/mmc.c
 +++ b/drivers/mmc/mmc.c
 @@ -430,7 +430,7 @@ int mmc_complete_op_cond(struct mmc *mmc)
   mmc-ocr = cmd.response[0];
 
   mmc-high_capacity = ((mmc-ocr  OCR_HCS) == OCR_HCS);
 - mmc-rca = 0;
 + mmc-rca = 1;
 
   return 0;
 }
 -- 
 1.8.1.5
 

Applied, Thanks.

Signed-off-by: Pantelis Antoniou pa...@antoniou-consulting.com

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


Re: [U-Boot] [PATCH RESEND] MMC: DWMMC: Correct the CLKDIV register value

2014-02-07 Thread Pantelis Antoniou
Hi Rajesh,

Sorry for the delay, patch looks good.

On Feb 5, 2014, at 7:18 AM, Rajeshwari Shinde wrote:

 From: Rajeshwari S Shinde rajeshwar...@samsung.com
 
 This patch corrects the divider value written to CLKDIV register.
 Since SDCLKIN is divided inside controller by the DIVRATIO value set
 in the CLKSEL register, we need to use the same output clock value to
 calculate the CLKDIV value.
 as per user manual: cclk_in = SDCLKIN / (DIVRATIO + 1)
 
 Input parameter to mmc_clk is changed to dwmci_host, since
 we need the same to read DWMCI_CLKSEL register.
 
 This improves the read timing values for channel 0 on SMDK5250
 from 0.288sec to 0.144sec
 
 Signed-off-by: Rajeshwari S Shinde rajeshwar...@samsung.com
 ---
 arch/arm/include/asm/arch-exynos/dwmmc.h |  4 
 drivers/mmc/dw_mmc.c |  2 +-
 drivers/mmc/exynos_dw_mmc.c  | 17 +++--
 include/dwmmc.h  |  2 +-
 4 files changed, 21 insertions(+), 4 deletions(-)
 
 diff --git a/arch/arm/include/asm/arch-exynos/dwmmc.h 
 b/arch/arm/include/asm/arch-exynos/dwmmc.h
 index 09d739d..a7ca12c 100644
 --- a/arch/arm/include/asm/arch-exynos/dwmmc.h
 +++ b/arch/arm/include/asm/arch-exynos/dwmmc.h
 @@ -23,6 +23,10 @@
 #define MPSCTRL_ENCRYPTION(0x11)
 #define MPSCTRL_VALID (0x10)
 
 +/* CLKSEL Register */
 +#define DWMCI_DIVRATIO_BIT   24
 +#define DWMCI_DIVRATIO_MASK  0x7
 +
 #ifdef CONFIG_OF_CONTROL
 int exynos_dwmmc_init(const void *blob);
 #endif
 diff --git a/drivers/mmc/dw_mmc.c b/drivers/mmc/dw_mmc.c
 index 4cec5aa..d45c15c 100644
 --- a/drivers/mmc/dw_mmc.c
 +++ b/drivers/mmc/dw_mmc.c
 @@ -237,7 +237,7 @@ static int dwmci_setup_bus(struct dwmci_host *host, u32 
 freq)
* host-bus_hz should be set from user.
*/
   if (host-get_mmc_clk)
 - sclk = host-get_mmc_clk(host-dev_index);
 + sclk = host-get_mmc_clk(host);
   else if (host-bus_hz)
   sclk = host-bus_hz;
   else {
 diff --git a/drivers/mmc/exynos_dw_mmc.c b/drivers/mmc/exynos_dw_mmc.c
 index b3e5c5e..de8cdcc 100644
 --- a/drivers/mmc/exynos_dw_mmc.c
 +++ b/drivers/mmc/exynos_dw_mmc.c
 @@ -29,9 +29,22 @@ static void exynos_dwmci_clksel(struct dwmci_host *host)
   dwmci_writel(host, DWMCI_CLKSEL, host-clksel_val);
 }
 
 -unsigned int exynos_dwmci_get_clk(int dev_index)
 +unsigned int exynos_dwmci_get_clk(struct dwmci_host *host)
 {
 - return get_mmc_clk(dev_index);
 + unsigned long sclk;
 + int8_t clk_div;
 +
 + /*
 +  * Since SDCLKIN is divided inside controller by the DIVRATIO
 +  * value set in the CLKSEL register, we need to use the same output
 +  * clock value to calculate the CLKDIV value.
 +  * as per user manual:cclk_in = SDCLKIN / (DIVRATIO + 1)
 +  */
 + clk_div = ((dwmci_readl(host, DWMCI_CLKSEL)  DWMCI_DIVRATIO_BIT)
 +  DWMCI_DIVRATIO_MASK) + 1;
 + sclk = get_mmc_clk(host-dev_index);
 +
 + return sclk / clk_div;
 }
 
 static void exynos_dwmci_board_init(struct dwmci_host *host)
 diff --git a/include/dwmmc.h b/include/dwmmc.h
 index a02dd67..b641558 100644
 --- a/include/dwmmc.h
 +++ b/include/dwmmc.h
 @@ -142,7 +142,7 @@ struct dwmci_host {
 
   void (*clksel)(struct dwmci_host *host);
   void (*board_init)(struct dwmci_host *host);
 - unsigned int (*get_mmc_clk)(int dev_index);
 + unsigned int (*get_mmc_clk)(struct dwmci_host *host);
 };
 
 struct dwmci_idmac {
 -- 
 1.7.12.4
 

Applied, Thanks

Signed-off-by: Pantelis Antoniou pa...@antoniou-consulting.com

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


Re: [U-Boot] [PATCH] mmc: Enabled quirk SDHCI_QUIRK_BROKEN_R1B

2014-02-07 Thread Pantelis Antoniou
Hi Michal,


On Jan 22, 2014, at 10:17 AM, Michal Simek wrote:

 From: Siva Durga Prasad Paladugu siva.durga.palad...@xilinx.com
 
 As per the below commit
 mmc: sdhci: add the quirk for broken r1b response
 (sha1: 3a6383207be3f71b39004e64464a6e99290b16fa)
 need to add quirk SDHCI_QUIRK_BROKEN_R1B, when the
 response type is R1b.
 
 Signed-off-by: Siva Durga Prasad Paladugu siva...@xilinx.com
 Signed-off-by: Michal Simek michal.si...@xilinx.com
 Acked-by: Jagannadha Sutradharudu Teki jaga...@xilinx.com
 ---
 
 drivers/mmc/zynq_sdhci.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
 
 diff --git a/drivers/mmc/zynq_sdhci.c b/drivers/mmc/zynq_sdhci.c
 index 610bef5..72a272f 100644
 --- a/drivers/mmc/zynq_sdhci.c
 +++ b/drivers/mmc/zynq_sdhci.c
 @@ -23,7 +23,8 @@ int zynq_sdhci_init(u32 regbase)
 
   host-name = zynq_sdhci;
   host-ioaddr = (void *)regbase;
 - host-quirks = SDHCI_QUIRK_NO_CD | SDHCI_QUIRK_WAIT_SEND_CMD;
 + host-quirks = SDHCI_QUIRK_NO_CD | SDHCI_QUIRK_WAIT_SEND_CMD |
 +SDHCI_QUIRK_BROKEN_R1B;
   host-version = sdhci_readw(host, SDHCI_HOST_VERSION);
 
   host-host_caps = MMC_MODE_HC;
 --
 1.8.2.3

Applied, Thanks.

Signed-off-by: Pantelis Antoniou pa...@antoniou-consulting.com

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


Re: [U-Boot] [PATCH v3 1/8] SPL: Add CONFIG_SUPPORT_EMMC_BOOT support to CONFIG_SPL_FRAMEWORK

2014-02-07 Thread Pantelis Antoniou
Hi Tom,

On Feb 5, 2014, at 5:24 PM, Tom Rini wrote:

 We use the switch CONFIG_SUPPORT_EMMC_BOOT today to enable some
 additional features of the eMMC boot partitions.  Add support for being
 told that we have booted from one of these partitions to the spl
 framework and implement this on TI OMAP/related.
 
 Cc: Pantelis Antoniou pa...@antoniou-consulting.com
 Signed-off-by: Tom Rini tr...@ti.com
 ---
 Changes in v3:
 - Rework eMMC boot detect logic for TI platforms, in the eMMC boot case
  we rely on non-FAT/RAW values being in bootmode.
 ---
 arch/arm/cpu/armv7/omap-common/boot-common.c |   13 -
 common/spl/spl_mmc.c |   24 
 include/spl.h|1 +
 3 files changed, 37 insertions(+), 1 deletion(-)
 
 diff --git a/arch/arm/cpu/armv7/omap-common/boot-common.c 
 b/arch/arm/cpu/armv7/omap-common/boot-common.c
 index 69fff32..52e0f4a 100644
 --- a/arch/arm/cpu/armv7/omap-common/boot-common.c
 +++ b/arch/arm/cpu/armv7/omap-common/boot-common.c
 @@ -66,7 +66,18 @@ u32 spl_boot_device(void)
 
 u32 spl_boot_mode(void)
 {
 - return gd-arch.omap_boot_params.omap_bootmode;
 + u32 val = gd-arch.omap_boot_params.omap_bootmode;
 +
 + if (val == MMCSD_MODE_RAW)
 + return MMCSD_MODE_RAW;
 + else if (val == MMCSD_MODE_FAT)
 + return MMCSD_MODE_FAT;
 + else
 +#ifdef CONFIG_SUPPORT_EMMC_BOOT
 + return MMCSD_MODE_EMMCBOOT;
 +#else
 + return MMCSD_MODE_UNDEFINED;
 +#endif
 }
 
 void spl_board_init(void)
 diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c
 index 13fbff0..fa6f891 100644
 --- a/common/spl/spl_mmc.c
 +++ b/common/spl/spl_mmc.c
 @@ -111,6 +111,30 @@ void spl_mmc_load_image(void)
   CONFIG_SYS_MMC_SD_FAT_BOOT_PARTITION,
   CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME);
 #endif
 +#ifdef CONFIG_SUPPORT_EMMC_BOOT
 + } else if (boot_mode == MMCSD_MODE_EMMCBOOT) {
 + /*
 +  * We need to check what the partition is configured to.
 +  * 1 and 2 match up to boot0 / boot1 and 7 is user data
 +  * which is the first physical partition (0).
 +  */
 + int part = (mmc-part_config  3)  PART_ACCESS_MASK;
 +
 + if (part == 7)
 + part = 0;
 +
 + if (mmc_switch_part(0, part)) {
 +#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
 + puts(MMC partition switch failed\n);
 +#endif
 + hang();
 + }
 +#ifdef CONFIG_SPL_OS_BOOT
 + if (spl_start_uboot() || mmc_load_image_raw_os(mmc))
 +#endif
 + err = mmc_load_image_raw(mmc,
 + CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR);
 +#endif
   } else {
 #ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
   puts(spl: wrong MMC boot mode\n);
 diff --git a/include/spl.h b/include/spl.h
 index 5e24856..dad00c0 100644
 --- a/include/spl.h
 +++ b/include/spl.h
 @@ -16,6 +16,7 @@
 #define MMCSD_MODE_UNDEFINED  0
 #define MMCSD_MODE_RAW1
 #define MMCSD_MODE_FAT2
 +#define MMCSD_MODE_EMMCBOOT  3
 
 struct spl_image_info {
   const char *name;
 -- 
 1.7.9.5

Applied. Thanks.

Signed-off-by: Pantelis Antoniou pa...@antoniou-consulting.com

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


Re: [U-Boot] [PATCH v3 5/8] cmd_mmc.c: Add bootbus mmc sub-command

2014-02-07 Thread Pantelis Antoniou
Hi Tom,

On Feb 5, 2014, at 5:24 PM, Tom Rini wrote:

 Add a bootbus sub-command to the mmc command to allow for setting
 the boot_bus_width, reset_boot_bus_width and boot_mode fields of
 BOOT_BUS_WIDTH (EXT_CSD[177]).
 
 Acked-by: Jaehoon Chung jh80.ch...@samsung.com
 Signed-off-by: Tom Rini tr...@ti.com
 ---
 common/cmd_mmc.c  |   29 +
 drivers/mmc/mmc.c |   21 +
 include/mmc.h |5 +
 3 files changed, 55 insertions(+)
 
 diff --git a/common/cmd_mmc.c b/common/cmd_mmc.c
 index 5842e85..a028149 100644
 --- a/common/cmd_mmc.c
 +++ b/common/cmd_mmc.c
 @@ -338,6 +338,33 @@ static int do_mmcops(cmd_tbl_t *cmdtp, int flag, int 
 argc, char * const argv[])
 
   /* acknowledge to be sent during boot operation */
   return mmc_set_part_conf(mmc, ack, part_num, access);
 + } else if (strcmp(argv[1], bootbus) == 0) {
 + int dev;
 + struct mmc *mmc;
 + u8 width, reset, mode;
 +
 + if (argc == 6) {
 + dev = simple_strtoul(argv[2], NULL, 10);
 + width = simple_strtoul(argv[3], NULL, 10);
 + reset = simple_strtoul(argv[4], NULL, 10);
 + mode = simple_strtoul(argv[5], NULL, 10);
 + } else {
 + return CMD_RET_USAGE;
 + }
 +
 + mmc = find_mmc_device(dev);
 + if (!mmc) {
 + printf(no mmc device at slot %x\n, dev);
 + return 1;
 + }
 +
 + if (IS_SD(mmc)) {
 + puts(BOOT_BUS_WIDTH only exists on eMMC\n);
 + return 1;
 + }
 +
 + /* acknowledge to be sent during boot operation */
 + return mmc_set_boot_bus_width(mmc, width, reset, mode);
   } else if (strcmp(argv[1], bootpart-resize) == 0) {
   int dev;
   struct mmc *mmc;
 @@ -475,6 +502,8 @@ U_BOOT_CMD(
- Enable boot_part for booting and enable R/W access of boot_part\n
   mmc close dev boot_partition\n
- Enable boot_part for booting and disable access to boot_part\n
 + mmc bootbus dev boot_bus_width reset_boot_bus_width boot_mode\n
 +  - Set the BOOT_BUS_WIDTH field of the specified device\n
   mmc bootpart-resize dev boot part size MB RPMB part size MB\n
- Change sizes of boot and RPMB partitions of specified device\n
   mmc partconf dev boot_ack boot_partition partition_access\n
 diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
 index 1591fce..fc1c1dc 100644
 --- a/drivers/mmc/mmc.c
 +++ b/drivers/mmc/mmc.c
 @@ -1507,6 +1507,27 @@ int mmc_boot_part_access(struct mmc *mmc, u8 ack, u8 
 part_num, u8 access)
 }
 
 /*
 + * Modify EXT_CSD[177] which is BOOT_BUS_WIDTH
 + * based on the passed in values for BOOT_BUS_WIDTH, RESET_BOOT_BUS_WIDTH
 + * and BOOT_MODE.
 + *
 + * Returns 0 on success.
 + */
 +int mmc_set_boot_bus_width(struct mmc *mmc, u8 width, u8 reset, u8 mode)
 +{
 + int err;
 +
 + err = mmc_switch(mmc, EXT_CSD_CMD_SET_NORMAL, EXT_CSD_BOOT_BUS_WIDTH,
 +  EXT_CSD_BOOT_BUS_WIDTH_MODE(mode) |
 +  EXT_CSD_BOOT_BUS_WIDTH_RESET(reset) |
 +  EXT_CSD_BOOT_BUS_WIDTH_WIDTH(width));
 +
 + if (err)
 + return err;
 + return 0;
 +}
 +
 +/*
  * Modify EXT_CSD[179] which is PARTITION_CONFIG (formerly BOOT_CONFIG)
  * based on the passed in values for BOOT_ACK, BOOT_PARTITION_ENABLE and
  * PARTITION_ACCESS.
 diff --git a/include/mmc.h b/include/mmc.h
 index 7e026da..3594286 100644
 --- a/include/mmc.h
 +++ b/include/mmc.h
 @@ -187,6 +187,9 @@
 #define EXT_CSD_BOOT_PART_NUM(x)  (x  3)
 #define EXT_CSD_PARTITION_ACCESS(x)   (x  0)
 
 +#define EXT_CSD_BOOT_BUS_WIDTH_MODE(x)   (x  3)
 +#define EXT_CSD_BOOT_BUS_WIDTH_RESET(x)  (x  2)
 +#define EXT_CSD_BOOT_BUS_WIDTH_WIDTH(x)  (x)
 
 #define R1_ILLEGAL_COMMAND(1  22)
 #define R1_APP_CMD(1  5)
 @@ -314,6 +317,8 @@ int mmc_boot_partition_size_change(struct mmc *mmc, 
 unsigned long bootsize,
 int mmc_boot_part_access(struct mmc *mmc, u8 ack, u8 part_num, u8 access);
 /* Function to modify the PARTITION_CONFIG field of EXT_CSD */
 int mmc_set_part_conf(struct mmc *mmc, u8 ack, u8 part_num, u8 access);
 +/* Function to modify the BOOT_BUS_WIDTH field of EXT_CSD */
 +int mmc_set_boot_bus_width(struct mmc *mmc, u8 width, u8 reset, u8 mode);
 
 /**
  * Start device initialization and return immediately; it does not block on
 -- 
 1.7.9.5

Applied. Thanks.

Signed-off-by: Pantelis Antoniou pa...@antoniou-consulting.com


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


Re: [U-Boot] [PATCH v3 4/8] cmd_mmc.c: Add 'partconf' command to mmc

2014-02-07 Thread Pantelis Antoniou
Hi Tom,

On Feb 5, 2014, at 5:24 PM, Tom Rini wrote:

 Add a partconf sub-command to the mmc command to allow for setting
 the boot_ack, boot_partition and partition_access fields of
 PARTITION_CONFIG (formerly BOOT_CONFIG, EXT_CSD[179]).  Part of this
 requires changing the check for 'part' from an strncmp to a strcmp, like
 the rest of the sub-commands.
 
 Cc: Andy Fleming aflem...@gmail.com
 Cc: Pantelis Antoniou pa...@antoniou-consulting.com
 Acked-by: Jaehoon Chung jh80.ch...@samsung.com
 Signed-off-by: Tom Rini tr...@ti.com
 ---
 common/cmd_mmc.c  |   30 +-
 drivers/mmc/mmc.c |   21 +
 include/mmc.h |2 ++
 3 files changed, 52 insertions(+), 1 deletion(-)
 
 diff --git a/common/cmd_mmc.c b/common/cmd_mmc.c
 index a322063..5842e85 100644
 --- a/common/cmd_mmc.c
 +++ b/common/cmd_mmc.c
 @@ -195,7 +195,7 @@ static int do_mmcops(cmd_tbl_t *cmdtp, int flag, int 
 argc, char * const argv[])
   return 1;
   else
   return 0;
 - } else if (strncmp(argv[1], part, 4) == 0) {
 + } else if (strcmp(argv[1], part) == 0) {
   block_dev_desc_t *mmc_dev;
   struct mmc *mmc;
 
 @@ -311,7 +311,33 @@ static int do_mmcops(cmd_tbl_t *cmdtp, int flag, int 
 argc, char * const argv[])
 
   /* acknowledge to be sent during boot operation */
   return boot_part_access(mmc, 1, part_num, access);
 + } else if (strcmp(argv[1], partconf) == 0) {
 + int dev;
 + struct mmc *mmc;
 + u8 ack, part_num, access;
 +
 + if (argc == 6) {
 + dev = simple_strtoul(argv[2], NULL, 10);
 + ack = simple_strtoul(argv[3], NULL, 10);
 + part_num = simple_strtoul(argv[4], NULL, 10);
 + access = simple_strtoul(argv[5], NULL, 10);
 + } else {
 + return CMD_RET_USAGE;
 + }
 +
 + mmc = find_mmc_device(dev);
 + if (!mmc) {
 + printf(no mmc device at slot %x\n, dev);
 + return 1;
 + }
 
 + if (IS_SD(mmc)) {
 + puts(PARTITION_CONFIG only exists on eMMC\n);
 + return 1;
 + }
 +
 + /* acknowledge to be sent during boot operation */
 + return mmc_set_part_conf(mmc, ack, part_num, access);
   } else if (strcmp(argv[1], bootpart-resize) == 0) {
   int dev;
   struct mmc *mmc;
 @@ -451,6 +477,8 @@ U_BOOT_CMD(
- Enable boot_part for booting and disable access to boot_part\n
   mmc bootpart-resize dev boot part size MB RPMB part size MB\n
- Change sizes of boot and RPMB partitions of specified device\n
 + mmc partconf dev boot_ack boot_partition partition_access\n
 +  - Change the bits of the PARTITION_CONFIG field of the specified 
 device\n
 #endif
   mmc setdsr - set DSR register value\n
   );
 diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
 index c6a1c23..1591fce 100644
 --- a/drivers/mmc/mmc.c
 +++ b/drivers/mmc/mmc.c
 @@ -1505,4 +1505,25 @@ int mmc_boot_part_access(struct mmc *mmc, u8 ack, u8 
 part_num, u8 access)
   }
   return 0;
 }
 +
 +/*
 + * Modify EXT_CSD[179] which is PARTITION_CONFIG (formerly BOOT_CONFIG)
 + * based on the passed in values for BOOT_ACK, BOOT_PARTITION_ENABLE and
 + * PARTITION_ACCESS.
 + *
 + * Returns 0 on success.
 + */
 +int mmc_set_part_conf(struct mmc *mmc, u8 ack, u8 part_num, u8 access)
 +{
 + int err;
 +
 + err = mmc_switch(mmc, EXT_CSD_CMD_SET_NORMAL, EXT_CSD_PART_CONF,
 +  EXT_CSD_BOOT_ACK(ack) |
 +  EXT_CSD_BOOT_PART_NUM(part_num) |
 +  EXT_CSD_PARTITION_ACCESS(access));
 +
 + if (err)
 + return err;
 + return 0;
 +}
 #endif
 diff --git a/include/mmc.h b/include/mmc.h
 index e1060b9..7e026da 100644
 --- a/include/mmc.h
 +++ b/include/mmc.h
 @@ -312,6 +312,8 @@ int mmc_boot_partition_size_change(struct mmc *mmc, 
 unsigned long bootsize,
   unsigned long rpmbsize);
 /* Function to send commands to open/close the specified boot partition */
 int mmc_boot_part_access(struct mmc *mmc, u8 ack, u8 part_num, u8 access);
 +/* Function to modify the PARTITION_CONFIG field of EXT_CSD */
 +int mmc_set_part_conf(struct mmc *mmc, u8 ack, u8 part_num, u8 access);
 
 /**
  * Start device initialization and return immediately; it does not block on
 -- 
 1.7.9.5
 

Applied. Thanks.

Signed-off-by: Pantelis Antoniou pa...@antoniou-consulting.com

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


Re: [U-Boot] [PATCH v3 3/8] cmd_mmc.c: Rename 'bootpart' to 'bootpart-resize'

2014-02-07 Thread Pantelis Antoniou
Hi Tom,

On Feb 5, 2014, at 5:24 PM, Tom Rini wrote:

 Rename 'bootpart' to 'bootpart-resize' to better reflect what this
 command is for.
 
 Acked-by: Jaehoon Chung jh80.ch...@samsung.com
 Signed-off-by: Tom Rini tr...@ti.com
 ---
 common/cmd_mmc.c |8 
 1 file changed, 4 insertions(+), 4 deletions(-)
 
 diff --git a/common/cmd_mmc.c b/common/cmd_mmc.c
 index e118252..a322063 100644
 --- a/common/cmd_mmc.c
 +++ b/common/cmd_mmc.c
 @@ -312,9 +312,9 @@ static int do_mmcops(cmd_tbl_t *cmdtp, int flag, int 
 argc, char * const argv[])
   /* acknowledge to be sent during boot operation */
   return boot_part_access(mmc, 1, part_num, access);
 
 - } else if (strcmp(argv[1], bootpart) == 0) {
 + } else if (strcmp(argv[1], bootpart-resize) == 0) {
   int dev;
 - struct *mmc;
 + struct mmc *mmc;
   u32 bootsize, rpmbsize;
 
   if (argc == 5) {
 @@ -449,8 +449,8 @@ U_BOOT_CMD(
- Enable boot_part for booting and enable R/W access of boot_part\n
   mmc close dev boot_partition\n
- Enable boot_part for booting and disable access to boot_part\n
 - mmc bootpart device num boot part size MB RPMB part size MB\n
 -  - change sizes of boot and RPMB partitions of specified device\n
 + mmc bootpart-resize dev boot part size MB RPMB part size MB\n
 +  - Change sizes of boot and RPMB partitions of specified device\n
 #endif
   mmc setdsr - set DSR register value\n
   );
 -- 
 1.7.9.5


Applied. Thanks.

Signed-off-by: Pantelis Antoniou pa...@antoniou-consulting.com

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


Re: [U-Boot] [PATCH v3 8/8] dra7xx_evm: Add CONFIG_SUPPORT_EMMC_BOOT, document usage

2014-02-07 Thread Pantelis Antoniou
Hi Tom,

On Feb 5, 2014, at 5:24 PM, Tom Rini wrote:

 Add a README to the board which lists the commands required to enable
 booting from the eMMC boot partitions found on the board.
 
 Cc: Lokesh Vutla lokeshvu...@ti.com
 Signed-off-by: Tom Rini tr...@ti.com
 ---
 board/ti/dra7xx/README   |   25 +
 include/configs/dra7xx_evm.h |2 ++
 2 files changed, 27 insertions(+)
 create mode 100644 board/ti/dra7xx/README
 
 diff --git a/board/ti/dra7xx/README b/board/ti/dra7xx/README
 new file mode 100644
 index 000..2fdaeac
 --- /dev/null
 +++ b/board/ti/dra7xx/README
 @@ -0,0 +1,25 @@
 +Summary
 +===
 +
 +This document covers various features of the 'dra7xx_evm' build and some
 +related uses.
 +
 +eMMC boot partition use
 +===
 +
 +It is possible, depending on SYSBOOT configuration to boot from the eMMC
 +boot partitions using (name depending on documentation referenced)
 +Alternative Boot operation mode or Boot Sequence Option 1/2.  In this
 +example we load MLO and u-boot.img from the build into DDR and then use
 +'mmc bootbus' to set the required rate (see TRM) and 'mmc partconfig' to
 +set boot0 as the boot device.
 +U-Boot # setenv autoload no
 +U-Boot # usb start
 +U-Boot # dhcp
 +U-Boot # mmc dev 1 1
 +U-Boot # tftp ${loadaddr} dra7xx/MLO
 +U-Boot # mmc write ${loadaddr} 0 100
 +U-Boot # tftp ${loadaddr} dra7xx/u-boot.img
 +U-Boot # mmc write ${loadaddr} 300 400
 +U-Boot # mmc bootbus 1 2 0 2
 +U-Boot # mmc partconf 1 1 1 0
 diff --git a/include/configs/dra7xx_evm.h b/include/configs/dra7xx_evm.h
 index f210ed8..3c53f0a 100644
 --- a/include/configs/dra7xx_evm.h
 +++ b/include/configs/dra7xx_evm.h
 @@ -73,6 +73,8 @@
 #define CONFIG_SPL_SPI_CS  0
 #define CONFIG_SYS_SPI_U_BOOT_OFFS 0x2
 
 +#define CONFIG_SUPPORT_EMMC_BOOT
 +
 /* USB xHCI HOST */
 #define CONFIG_CMD_USB
 #define CONFIG_USB_HOST
 -- 
 1.7.9.5


Applied. Thanks.

Signed-off-by: Pantelis Antoniou pa...@antoniou-consulting.com


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


Re: [U-Boot] [PATCH v3 7/8] omap5_uevm: Add CONFIG_SUPPORT_EMMC_BOOT, document usage

2014-02-07 Thread Pantelis Antoniou
Hi Tom,

On Feb 5, 2014, at 5:24 PM, Tom Rini wrote:

 Add a README to the board which lists the commands required to enable
 booting from the eMMC boot partitions found on the board.
 
 Signed-off-by: Tom Rini tr...@ti.com
 ---
 board/ti/omap5_uevm/README   |   25 +
 include/configs/omap5_uevm.h |1 +
 2 files changed, 26 insertions(+)
 create mode 100644 board/ti/omap5_uevm/README
 
 diff --git a/board/ti/omap5_uevm/README b/board/ti/omap5_uevm/README
 new file mode 100644
 index 000..970e2ec
 --- /dev/null
 +++ b/board/ti/omap5_uevm/README
 @@ -0,0 +1,25 @@
 +Summary
 +===
 +
 +This document covers various features of the 'omap5_uevm' build and some
 +related uses.
 +
 +eMMC boot partition use
 +===
 +
 +It is possible, depending on SYSBOOT configuration to boot from the eMMC
 +boot partitions using (name depending on documentation referenced)
 +Alternative Boot operation mode or Boot Sequence Option 1/2.  In this
 +example we load MLO and u-boot.img from the build into DDR and then use
 +'mmc bootbus' to set the required rate (see TRM) and 'mmc partconfig' to
 +set boot0 as the boot device.
 +U-Boot # setenv autoload no
 +U-Boot # usb start
 +U-Boot # dhcp
 +U-Boot # mmc dev 1 1
 +U-Boot # tftp ${loadaddr} omap5uevm/MLO
 +U-Boot # mmc write ${loadaddr} 0 100
 +U-Boot # tftp ${loadaddr} omap5uevm/u-boot.img
 +U-Boot # mmc write ${loadaddr} 300 400
 +U-Boot # mmc bootbus 1 2 0 2
 +U-Boot # mmc partconf 1 1 1 0
 diff --git a/include/configs/omap5_uevm.h b/include/configs/omap5_uevm.h
 index 76c5106..3df502e 100644
 --- a/include/configs/omap5_uevm.h
 +++ b/include/configs/omap5_uevm.h
 @@ -37,6 +37,7 @@
 #define CONFIG_PARTITION_UUIDS
 #define CONFIG_CMD_PART
 #define CONFIG_HSMMC2_8BIT
 +#define CONFIG_SUPPORT_EMMC_BOOT
 
 /* Required support for the TCA642X GPIO we have on the uEVM */
 #define CONFIG_TCA642X
 -- 
 1.7.9.5

Applied. Thanks.

Signed-off-by: Pantelis Antoniou pa...@antoniou-consulting.com


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


Re: [U-Boot] [PATCH v3 6/8] cmd_mmc.c: Drop open/close mmc sub-commands

2014-02-07 Thread Pantelis Antoniou
Hi Tom,

On Feb 5, 2014, at 5:24 PM, Tom Rini wrote:

 The open and close mmc sub-commands implement a hard-coded set of values
 specific to the SMDK5250 platform.  Remove these commands as what they
 did can be done instead with a series of mmc dev / bootpart / bootbus
 commands instead now.
 
 Cc: Amar amarendra...@samsung.com
 Cc: Minkyu Kang mk7.k...@samsung.com
 Acked-by: Jaehoon Chung jh80.ch...@samsung.com
 Signed-off-by: Tom Rini tr...@ti.com
 ---
 common/cmd_mmc.c  |   72 -
 drivers/mmc/mmc.c |   65 ---
 include/mmc.h |2 --
 3 files changed, 139 deletions(-)
 
 diff --git a/common/cmd_mmc.c b/common/cmd_mmc.c
 index a028149..2d51927 100644
 --- a/common/cmd_mmc.c
 +++ b/common/cmd_mmc.c
 @@ -131,36 +131,6 @@ U_BOOT_CMD(
   - display info of the current MMC device
 );
 
 -#ifdef CONFIG_SUPPORT_EMMC_BOOT
 -static int boot_part_access(struct mmc *mmc, u8 ack, u8 part_num, u8 access)
 -{
 - int err;
 - err = mmc_boot_part_access(mmc, ack, part_num, access);
 -
 - if ((err == 0)  (access != 0)) {
 - printf(\t\t\t!!!Notice!!!\n);
 -
 - printf(!You must close EMMC boot Partition);
 - printf(after all images are written\n);
 -
 - printf(!EMMC boot partition has continuity);
 - printf(at image writing time.\n);
 -
 - printf(!So, do not close the boot partition);
 - printf(before all images are written.\n);
 - return 0;
 - } else if ((err == 0)  (access == 0))
 - return 0;
 - else if ((err != 0)  (access != 0)) {
 - printf(EMMC boot partition-%d OPEN Failed.\n, part_num);
 - return 1;
 - } else {
 - printf(EMMC boot partition-%d CLOSE Failed.\n, part_num);
 - return 1;
 - }
 -}
 -#endif
 -
 static int do_mmcops(cmd_tbl_t *cmdtp, int flag, int argc, char * const 
 argv[])
 {
   enum mmc_state state;
 @@ -273,44 +243,6 @@ static int do_mmcops(cmd_tbl_t *cmdtp, int flag, int 
 argc, char * const argv[])
 
   return 0;
 #ifdef CONFIG_SUPPORT_EMMC_BOOT
 - } else if ((strcmp(argv[1], open) == 0) ||
 - (strcmp(argv[1], close) == 0)) {
 - int dev;
 - struct mmc *mmc;
 - u8 part_num, access = 0;
 -
 - if (argc == 4) {
 - dev = simple_strtoul(argv[2], NULL, 10);
 - part_num = simple_strtoul(argv[3], NULL, 10);
 - } else {
 - return CMD_RET_USAGE;
 - }
 -
 - mmc = find_mmc_device(dev);
 - if (!mmc) {
 - printf(no mmc device at slot %x\n, dev);
 - return 1;
 - }
 -
 - if (IS_SD(mmc)) {
 - printf(SD device cannot be opened/closed\n);
 - return 1;
 - }
 -
 - if ((part_num = 0) || (part_num  MMC_NUM_BOOT_PARTITION)) {
 - printf(Invalid boot partition number:\n);
 - printf(Boot partition number cannot be = 0\n);
 - printf(EMMC44 supports only 2 boot partitions\n);
 - return 1;
 - }
 -
 - if (strcmp(argv[1], open) == 0)
 - access = part_num; /* enable R/W access to boot part*/
 - else
 - access = 0; /* No access to boot partition */
 -
 - /* acknowledge to be sent during boot operation */
 - return boot_part_access(mmc, 1, part_num, access);
   } else if (strcmp(argv[1], partconf) == 0) {
   int dev;
   struct mmc *mmc;
 @@ -498,10 +430,6 @@ U_BOOT_CMD(
   mmc dev [dev] [part] - show or set current mmc device [partition]\n
   mmc list - lists available devices\n
 #ifdef CONFIG_SUPPORT_EMMC_BOOT
 - mmc open dev boot_partition\n
 -  - Enable boot_part for booting and enable R/W access of boot_part\n
 - mmc close dev boot_partition\n
 -  - Enable boot_part for booting and disable access to boot_part\n
   mmc bootbus dev boot_bus_width reset_boot_bus_width boot_mode\n
- Set the BOOT_BUS_WIDTH field of the specified device\n
   mmc bootpart-resize dev boot part size MB RPMB part size MB\n
 diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
 index fc1c1dc..3a57ab8 100644
 --- a/drivers/mmc/mmc.c
 +++ b/drivers/mmc/mmc.c
 @@ -1442,71 +1442,6 @@ int mmc_boot_partition_size_change(struct mmc *mmc, 
 unsigned long bootsize,
 }
 
 /*
 - * This function shall form and send the commands to open / close the
 - * boot partition specified by user.
 - *
 - * Input Parameters:
 - * ack: 0x0 - No boot acknowledge sent (default)
 - *   0x1 - Boot acknowledge sent during boot operation
 - * part_num: User selects boot data that will be sent to master
 - *   0x0 - Device not boot enabled (default)

Re: [U-Boot] [PATCH 2/2] usb: ehci: fully align interrupt QHs/QTDs

2014-02-07 Thread Stephen Warren
On 02/07/2014 06:48 AM, Marek Vasut wrote:
 On Friday, February 07, 2014 at 07:48:06 AM, Stephen Warren wrote:
 On 02/06/2014 07:53 PM, Marek Vasut wrote:
 On Thursday, February 06, 2014 at 09:13:06 PM, Stephen Warren wrote:
 From: Stephen Warren swar...@nvidia.com

 These data structures are passed to cache-flushing routines, and hence
 must be conform to both the USB the cache-flusing alignment
 requirements. That means aligning to USB_DMA_MINALIGN. This is
 important on systems where cache lines are 32 bytes.

 Signed-off-by: Stephen Warren swar...@nvidia.com

 Acked-by: Marek Vasut ma...@denx.de

 Oh, I assumed you would be applying this?
 
 Yes I would , but the previous patch still needs some discussion.

Oh OK. The patches don't depend on each-other in any way, so you can go
ahead and apply this now if you want. I should have actually sent them
separately rather than as a series.

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


Re: [U-Boot] [PATCH v3 1/2] env_mmc: make board configurable the partition for the environment

2014-02-07 Thread Pantelis Antoniou
Hi Hector,

On Jan 23, 2014, at 2:39 PM, Hector Palacios wrote:

 This complements commit 9404a5fc7cb58 env_mmc: allow environment to be
 in an eMMC partition by allowing boards to accommodate the partition
 to use for the environment in different scenarios (similarly to what is
 done with the mmc dev number). Depending on the detected boot media,
 boards may decide to store the environment in a different partition.
 
 The __weak function also allows to remove some ifdefs from the code.
 If CONFIG_SYS_MMC_ENV_PART is not defined, partition 0 is assumed
 (default value for U-Boot when a partition is not provided).
 
 Signed-off-by: Hector Palacios hector.palac...@digi.com
 Reviewed-by: Stephen Warren swar...@nvidia.com

The patch does not apply cleanly after Tom's mmc patches went in.

Can you please rework and report? Thanks.

Regards

-- Pantelis
  

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


Re: [U-Boot] [PATCH 1/2] ush: ehci: initialize altnext pointers in QH

2014-02-07 Thread Stephen Warren
On 02/07/2014 06:50 AM, Marek Vasut wrote:
 On Friday, February 07, 2014 at 07:47:14 AM, Stephen Warren wrote:
 On 02/06/2014 07:53 PM, Marek Vasut wrote:
 On Thursday, February 06, 2014 at 09:13:05 PM, Stephen Warren wrote:
 From: Stephen Warren swar...@nvidia.com

 A QH's overlay QTD altnext pointer should be explicitly marked invalid
 so that the EHCI controller knows to look at the QTD next pointer.
 Update the driver to do this.
...
 diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c

 @@ -1186,6 +1187,7 @@ create_int_queue(struct usb_device *dev, unsigned
 long pipe, int queuesize, qh-qh_link = QH_LINK_TERMINATE;

qh-qh_overlay.qt_next = (uint32_t)td;

 +  qh-qh_overlay.qt_altnext = QT_NEXT_TERMINATE;

 So next is td and altnext is terminate here ?

 Yes. TERMINATE really just means INVALID, so the EHCI controller gets
 the pointer from qt_next rather than qt_altnext.
 
 H ... not really clear or self-explaining, is it. If you have time to 
 produce a RFC to clean this up, I'm all for checking it.

Looking at section 3.5.1 Next qTD Pointer, this bit is in fact named
Terminate (hence it's referred to as the T bit), so this naming seems to
be ingrained in the EHCI specification, so I'm uninclined to change it
in U-Boot.

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


Re: [U-Boot] [PATCH v2 6/6] PPC 85xx: Find CPU speed on ppce500 from device tree

2014-02-07 Thread Scott Wood
On Fri, 2014-02-07 at 12:50 +0100, Alexander Graf wrote:
 On 07.02.2014, at 02:33, Scott Wood scottw...@freescale.com wrote:
 
  On Thu, 2014-02-06 at 12:11 +0100, Alexander Graf wrote:
  On 04.02.2014, at 03:52, Scott Wood scottw...@freescale.com wrote:
  
  On Fri, 2014-01-31 at 12:16 +0100, Alexander Graf wrote:
  The only thing we know in our PV machine through device tree is the clock
  speed of the CPUs. Take that as CPU speed, system speed and ddr speed so 
  that
  we have some meaningful values there at all.
  
  The CPU speed is important because our timing loops get determined based 
  on it.
  
  Signed-off-by: Alexander Graf ag...@suse.de
  ---
  arch/powerpc/cpu/mpc85xx/Makefile   |2 ++
  board/freescale/qemu-ppce500/qemu-ppce500.c |   43 
  +++
  2 files changed, 45 insertions(+)
  
  diff --git a/arch/powerpc/cpu/mpc85xx/Makefile 
  b/arch/powerpc/cpu/mpc85xx/Makefile
  index ef7637a..4094785 100644
  --- a/arch/powerpc/cpu/mpc85xx/Makefile
  +++ b/arch/powerpc/cpu/mpc85xx/Makefile
  @@ -102,7 +102,9 @@ obj-y+= cpu.o
  obj-y+= cpu_init.o
  obj-y+= cpu_init_early.o
  obj-y+= interrupts.o
  +ifneq ($(CONFIG_QEMU_E500),y)
  obj-y+= speed.o
  +endif
  obj-y+= tlb.o
  obj-y+= traps.o
  
  diff --git a/board/freescale/qemu-ppce500/qemu-ppce500.c 
  b/board/freescale/qemu-ppce500/qemu-ppce500.c
  index 5d4dd64..9e9d688 100644
  --- a/board/freescale/qemu-ppce500/qemu-ppce500.c
  +++ b/board/freescale/qemu-ppce500/qemu-ppce500.c
  @@ -407,3 +407,46 @@ void init_laws(void)
  {
   /* We don't emulate LAWs yet */
  }
  +
  +static uint32_t get_cpu_freq(void)
  +{
  +const void *fdt = get_fdt();
  +int cpus_node = fdt_path_offset(fdt, /cpus);
  +int cpu_node = fdt_first_subnode(fdt, cpus_node);
  +return myfdt_one_cell(fdt, cpu_node, clock-frequency, 0);
  +}
  +
  +void get_sys_info(sys_info_t *sys_info)
  +{
  +int freq = get_cpu_freq();
  +
  +memset(sys_info, 0, sizeof(sys_info_t));
  +sys_info-freq_systembus = freq;
  +sys_info-freq_ddrbus = freq;
  +sys_info-freq_processor[0] = freq;
  +}
  +
  +int get_clocks (void)
  +{
  +sys_info_t sys_info;
  +
  +get_sys_info(sys_info);
  +
  +gd-cpu_clk = sys_info.freq_processor[0];
  +gd-bus_clk = sys_info.freq_systembus;
  +gd-mem_clk = sys_info.freq_ddrbus;
  +gd-arch.lbc_clk = sys_info.freq_ddrbus;
  +
  +return 0;
  +}
  
  This probably decreases the accuracy of the timebase frequency, since
  you'll be basing it on the CPU frequency rather than the bus frequency.
  
  If you're doing this, why not override get_tbclk() as well?
  
  That one only uses variables I already control, no?
  
  unsigned long get_tbclk (void)
  {
 unsigned long tbclk_div = CONFIG_SYS_FSL_TBCLK_DIV;
  
 return (gd-bus_clk + (tbclk_div  1)) / tbclk_div;
  }
  
  What did you set CONFIG_SYS_FSL_TBCLK_DIV to?
 
 Nothing which is why it's defaulting to 8.

Hence why I suggested overriding get_tbclk() rather than trying to fake
up a divider (which could be difficult if the CPU clock is not a
multiple of the bus clock).

-Scott


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


[U-Boot] [PATCH V2] ush: ehci: initialize altnext pointers in QH

2014-02-07 Thread Stephen Warren
From: Stephen Warren swar...@nvidia.com

Section 4.10.2 Advance Queue of ehci-specification-for-usb.pdf
specifies how an EHCI controller loads a new QTD for processing if the
QH is not already marked as active. It states:

=
If the field Bytes to Transfer is not zero and the T-bit in the Alternate
Next qTD Pointer is set to zero, then the host controller uses the
Alternate Next qTD Pointer. Otherwise, the host controller uses the Next
qTD Pointer. If Next qTD Pointer’s T-bit is set to a one, then the host
controller exits this state and uses the horizontal pointer to the next
schedule data structure.
=

Hence, we must ensure that the alternate next QTD pointer's T-bit
(TERMINATE) is set, so the EHCI controller knows to use the next QTD
pointer.

Signed-off-by: Stephen Warren swar...@nvidia.com
---
v2: Quote text from the EHCI specification to justify the change.
---
 drivers/usb/host/ehci-hcd.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index ffc7dbdc215a..6017090ebeec 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -395,6 +395,7 @@ ehci_submit_async(struct usb_device *dev, unsigned long 
pipe, void *buffer,
QH_ENDPT2_UFCMASK(0) | QH_ENDPT2_UFSMASK(0);
qh-qh_endpt2 = cpu_to_hc32(endpt);
qh-qh_overlay.qt_next = cpu_to_hc32(QT_NEXT_TERMINATE);
+   qh-qh_overlay.qt_altnext = cpu_to_hc32(QT_NEXT_TERMINATE);
 
tdp = qh-qh_overlay.qt_next;
 
@@ -1188,6 +1189,7 @@ create_int_queue(struct usb_device *dev, unsigned long 
pipe, int queuesize,
qh-qh_link = QH_LINK_TERMINATE;
 
qh-qh_overlay.qt_next = (uint32_t)td;
+   qh-qh_overlay.qt_altnext = QT_NEXT_TERMINATE;
qh-qh_endpt1 = (0  28) | /* No NAK reload (ehci 4.9) */
(usb_maxpacket(dev, pipe)  16) | /* MPS */
(1  14) |
-- 
1.8.1.5

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


Re: [U-Boot] [PATCH v2 1/6] PPC 85xx: Detect e500v2 / e500mc during runtime

2014-02-07 Thread Scott Wood
On Fri, 2014-02-07 at 12:52 +0100, Alexander Graf wrote:
 On 07.02.2014, at 01:51, Scott Wood scottw...@freescale.com wrote:
 
  On Thu, 2014-02-06 at 12:40 +0100, Alexander Graf wrote:
  On 04.02.2014, at 02:59, Scott Wood scottw...@freescale.com wrote:
  
  On Fri, 2014-01-31 at 12:16 +0100, Alexander Graf wrote:
  With the qemu-ppce500 machine type we can run the same board with
  either an e500v2 or an e500mc core plugged in.
  
  This means that the IVOR setup can't be based on compile time decisions,
  so instead we have to do a runtime check which CPU generation we're
  running on.
  
  Signed-off-by: Alexander Graf ag...@suse.de
  ---
  arch/powerpc/cpu/mpc85xx/fixed_ivor.S |   21 -
  1 file changed, 16 insertions(+), 5 deletions(-)
  
  diff --git a/arch/powerpc/cpu/mpc85xx/fixed_ivor.S 
  b/arch/powerpc/cpu/mpc85xx/fixed_ivor.S
  index ebbb8c0..635a97e 100644
  --- a/arch/powerpc/cpu/mpc85xx/fixed_ivor.S
  +++ b/arch/powerpc/cpu/mpc85xx/fixed_ivor.S
  @@ -36,17 +36,25 @@
   SET_IVOR(14, 0x1e0) /* Instruction TLB Error */
   SET_IVOR(15, 0x040) /* Debug */
  
  -/* e500v1  e500v2 only */
  -#ifndef CONFIG_E500MC
  +/* Check for CPU */
  +mfpvr   r3
  +srwir3, r3, 16
  +/* Compare with e500mc PVR major number */
  +li  r4, 0
  +ori r4, r4, 0x8023
  +cmpwr3, r4
  +
  +/* e500v1  e500v2 only */
  +bge 1f
   SET_IVOR(32, 0x200) /* SPE Unavailable */
   SET_IVOR(33, 0x220) /* Embedded FP Data */
   SET_IVOR(34, 0x240) /* Embedded FP Round */
  -#endif
  +1:
  
   SET_IVOR(35, 0x260) /* Performance monitor */
  
  -/* e500mc only */
  -#ifdef CONFIG_E500MC
  +/* e500mc only */
  +blt 2f
   SET_IVOR(36, 0x280) /* Processor doorbell */
   SET_IVOR(37, 0x2a0) /* Processor doorbell critical */
   SET_IVOR(38, 0x2c0) /* Guest Processor doorbell */
  @@ -54,6 +62,8 @@
   SET_IVOR(40, 0x300) /* Hypervisor system call */
   SET_IVOR(41, 0x320) /* Hypervisor Priviledge */
  
  +#ifndef CONFIG_QEMU_E500
  +/* QEMU guests runs in guest mode and can't access GIVORs */
   SET_GIVOR(2, 0x060) /* Guest Data Storage */
   SET_GIVOR(3, 0x080) /* Guest Instruction Storage */
   SET_GIVOR(4, 0x0a0) /* Guest External Input */
  @@ -61,3 +71,4 @@
   SET_GIVOR(13, 0x1c0) /* Guest Data TLB Error */
   SET_GIVOR(14, 0x1e0) /* Guest Instruction TLB Error */
  #endif
  +2:
  
  Again, let's please just remove this entire file.
  
  I can remove it, but it's a pretty drastic change from the original
  behavior that was introduced 4 1/2 years ago:
  
   http://lists.denx.de/pipermail/u-boot/2009-August/058670.html
  
  I assume the idea was to give OSs one thing less to worry about (IVOR
  setting). If any OS in between 2009 and now relied on that fact, we'll
  break it by removing this code.
  
  Any such OS would already be broken on pre-2009 U-Boot.  Linux doesn't
  rely on it.  Neither the code nor the commit message gives a sufficient
  rationale, and Kumar didn't answer when asked.  It's incomplete (doesn't
  include e6500 IVORs).  It doesn't work on e6500 secondary threads.  The
 
 I thought e6500 has hard coded IVORs which is the whole point of this 
 exercise? Or am I wrong there?

e6500 does not have fixed interrupt vector offsets.  I think IBM book3e
chips do, and IVORs are phased out in the architecture.

-Scott


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


Re: [U-Boot] [PATCH] x600: Switch to CONFIG_PHYLIB

2014-02-07 Thread Stefan Roese

On 07.02.2014 15:03, Tom Rini wrote:

Now that the designware ethernet driver uses phylib we need to turn it
on here.

Signed-off-by: Tom Rini tr...@ti.com


Acked-by: Stefan Roese s...@denx.de

Thanks,
Stefan

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


Re: [U-Boot] serial/serial_arc - add driver for ARC UART

2014-02-07 Thread Alexey Brodkin
Hello Tom,

On Fri, 2014-02-07 at 08:35 -0500, Tom Rini wrote:
 On Fri, Dec 13, 2013 at 10:35:11AM +0400, Alexey Brodkin wrote:
 
  Driver for non-standard on-chip UART, instantiated in the ARC (Synopsys)
  FPGA Boards such as ARCAngel4/ML50x
  
  Signed-off-by: Alexey Brodkin abrod...@synopsys.com
 
 Applied to u-boot/master, thanks!
 

Are you sure this patch was applied?
I don't see it in master tree -
http://git.denx.de/?p=u-boot.git;a=tree;f=drivers/serial;h=48a1ed6ee43b81f0392a25b94c54c03fe1e12137;hb=HEAD

And as a result you seeing a build error trying to build arcangel4
board.

Could you please double-check?

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


Re: [U-Boot] [PATCH v4 0/9] Add support for the ARC700 architecture

2014-02-07 Thread Alexey Brodkin
Dear Tom.

On Fri, 2014-02-07 at 08:36 -0500, Tom Rini wrote:
 On Tue, Feb 04, 2014 at 12:56:12PM +0400, Alexey Brodkin wrote:
 
 I've applied the series to u-boot/master.  But please note that with the
 toolchain links above, MAKEALL doesn't agree that axs101 builds without
 error (but doing it with 'make' does) and arcangel4 doesn't build due
 to:
 arc-linux-ld.bfd: Error: Overflow detected in relocation value;
 arc-linux-ld.bfd: Relocation value should be between 16777215 and -16777216 
 whereas it  2130661664
 arc-linux-ld.bfd: Global symbol: default_serial_console.
 arc-linux-ld.bfd:
 Relocation type is:R_ARC_S25W_PCREL
 FileName:drivers/serial/built-in.o
 Section Name:.text
 Offset in Section:10
 arc-linux-ld.bfd: final link failed: Bad value
 make: *** [/home/trini/work/u-boot/u-boot/temp/u-boot] Error 1
 

You see this error message because expected serial driver was not built.
And it was not built because it is still missing in u-boot master tree
as of now.

I commented on corresponding driver thread.

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


Re: [U-Boot] [PATCH v3 1/2] env_mmc: make board configurable the partition for the environment

2014-02-07 Thread Palacios, Hector
Hi Antoniou,

On 02/07/2014 05:26 PM, Pantelis Antoniou wrote:
 Hi Hector,

 On Jan 23, 2014, at 2:39 PM, Hector Palacios wrote:

 This complements commit 9404a5fc7cb58 env_mmc: allow environment to be
 in an eMMC partition by allowing boards to accommodate the partition
 to use for the environment in different scenarios (similarly to what is
 done with the mmc dev number). Depending on the detected boot media,
 boards may decide to store the environment in a different partition.

 The __weak function also allows to remove some ifdefs from the code.
 If CONFIG_SYS_MMC_ENV_PART is not defined, partition 0 is assumed
 (default value for U-Boot when a partition is not provided).

 Signed-off-by: Hector Palacios hector.palac...@digi.com
 Reviewed-by: Stephen Warren swar...@nvidia.com

 The patch does not apply cleanly after Tom's mmc patches went in.

 Can you please rework and report? Thanks.

Ooops. I'm afraid I applied this after an unofficial non-upstream Freescale 
patch.
Without it, this series just doesn't fit. I would need to resend a version that 
includes Freescale missing patch, and have this reviewed.

Sorry about that.
-- 
Héctor Palacios
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] serial/serial_arc - add driver for ARC UART

2014-02-07 Thread Tom Rini
On Fri, Feb 07, 2014 at 05:35:21PM +, Alexey Brodkin wrote:
 Hello Tom,
 
 On Fri, 2014-02-07 at 08:35 -0500, Tom Rini wrote:
  On Fri, Dec 13, 2013 at 10:35:11AM +0400, Alexey Brodkin wrote:
  
   Driver for non-standard on-chip UART, instantiated in the ARC (Synopsys)
   FPGA Boards such as ARCAngel4/ML50x
   
   Signed-off-by: Alexey Brodkin abrod...@synopsys.com
  
  Applied to u-boot/master, thanks!
  
 
 Are you sure this patch was applied?
 I don't see it in master tree -
 http://git.denx.de/?p=u-boot.git;a=tree;f=drivers/serial;h=48a1ed6ee43b81f0392a25b94c54c03fe1e12137;hb=HEAD
 
 And as a result you seeing a build error trying to build arcangel4
 board.
 
 Could you please double-check?

Whoops, you're right, this got lost in the shuffle by accident, really
applied now.

-- 
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 v2 2/3] dts: move device tree sources to arch/$(ARCH)/dts/

2014-02-07 Thread Scott Wood
On Wed, 2014-02-05 at 14:47 -0700, Simon Glass wrote:
 Hi Masahiro,
 
 On 4 February 2014 02:38, Masahiro Yamada yamad...@jp.panasonic.com wrote:
  Unlike Linux Kernel, U-Boot historically had *.dts files under
  board/$(VENDOR)/dts/ and *.dtsi files under arch/$(ARCH)/dts/.
 
  I think arch/$(ARCH)/dts dicretory is a better location
  to store both *.dts and *.dtsi files.
 
  For example, before this commit, board/xilinx/dts directory
  had both MicroBlaze dts (microblaze-generic.dts) and
  ARM dts (zynq-*.dts), which are totally unrelated.
 
  This commit moves *.dts to arch/$(ARCH)/dts/ directories,
  allowing us to describe nicely mutiple DTBs generation in the next commit.
 
 What is the motivation for this? I worry that we might end up with a
 lot of files in one directory. One benefit of the current approach is
 that .dts files are split up by vendor. Even if we put the SoC .dtsi
 files in arch/arm, perhaps there is a benefit in leaving the board
 .dts files in board/vendor?
 
 I don't have strong feelings, just questing this...

Having all the device trees in one place (I don't even see why it should
be split by arch; some common dtsi files may be shared by multiple
arches) is nice for grepping and maintenance.  If it gets too large it
can grow an internal hierarchy.

Just like net drivers go under drivers/net regardless of arch, etc.

-Scott


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


Re: [U-Boot] [PATCH v2 5/6] PPC 85xx: Find PCI host controllers on ppce500 from device tree

2014-02-07 Thread Scott Wood
On Fri, 2014-02-07 at 13:25 +0100, Alexander Graf wrote:
 On 06.02.2014, at 23:52, Scott Wood scottw...@freescale.com wrote:
 
  On Thu, 2014-02-06 at 14:26 +0100, Alexander Graf wrote:
  On 04.02.2014, at 03:47, Scott Wood scottw...@freescale.com wrote:
  
  On Fri, 2014-01-31 at 12:16 +0100, Alexander Graf wrote:
  The definition of our ppce500 PV machine is that every address is 
  dynamically
  determined through device tree bindings.
  
  So don't hardcode where PCI devices are in our physical memory layout 
  but instead
  read them dynamically from the device tree we get passed on boot.
  
  Would it be difficult to make the QEMU emulation properly implement
  access windows?
  
  What are access windows? You mean BAR region offsets? Not too hard I
  suppose, but it adds complexity which we were trying to avoid, no?
  
  It would remove U-Boot complexity (unlike the LAW stuff where we just
  skip it) because we wouldn't need to care about QEMU's default settings.
  It should be easier to do than LAW support, and more useful (e.g. Linux
  currently programs this as well, we just get lucky that it misuses the
  device tree as configuration information).
 
 What complexity would it remove?

Getting the PCI translation window addresses from the device tree.

 We would still need to find the configuration space for the access
 windows,

That's easier -- just a standard reg lookup.

 configure them

That code's already there.

 and then even go as far as modifying the original device tree so we
 expose the new windows.

It would be nice if we did this regardless of QEMU.  As is, IIRC we have
some device trees that don't match what U-Boot does, which works (at
least in Linux) because Linux reprograms it to match the device tree.

-Scott


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


Re: [U-Boot] [Qemu-ppc] [PATCH v2 5/6] PPC 85xx: Find PCI host controllers on ppce500 from device tree

2014-02-07 Thread Scott Wood
On Fri, 2014-02-07 at 16:00 +0100, Alexander Graf wrote:
 On 07.02.2014, at 15:54, Alexander Graf ag...@suse.de wrote:
 
  
  On 06.02.2014, at 23:52, Scott Wood scottw...@freescale.com wrote:
  
  On Thu, 2014-02-06 at 14:26 +0100, Alexander Graf wrote:
  
  How about using fdt_translate_address() or other existing functionality?
  
  Mind to show exactly how?
  
  I guess you can't use that when you don't know the bus address, but
  still this is the wrong place to implement it.  If getting PCI range
  info from the device tree is something we want to do, then it should be
  a new common code helper.
  
  The more I think about this the less of an idea I have how to do any 
  generic API for this at all. And I'm not convinced anything generic is 
  going to help anyone. Do a git grep on fdt_translate_address over the code 
  base and you will find a _single_ caller.
  
  So even if we come up with something now, nobody's going to use it.
 
 Hrm. Maybe fdt_get_base_address() is the answer?

Yes, that looks close to what you want.  It'd have to be extended to
look for the various types of PCI ranges and return a (cpu address, bus
address, size) tuple rather than just a base address.

It's moot though if we can reprogram the PCI windows.

-Scott


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


[U-Boot] [PATCH] mmc: Add 'mmc rst-function' sub-command

2014-02-07 Thread Tom Rini
Some eMMC chips may need the RST_n_FUNCTION bit set to a non-zero value
in order for warm reset of the system to work.  Details on this being
required will be part of the eMMC datasheet.  Also add using this
command to the dra7xx README.

Signed-off-by: Tom Rini tr...@ti.com
---
 board/ti/dra7xx/README |1 +
 common/cmd_mmc.c   |   37 +
 drivers/mmc/mmc.c  |   12 
 include/mmc.h  |3 +++
 4 files changed, 53 insertions(+)

diff --git a/board/ti/dra7xx/README b/board/ti/dra7xx/README
index 2fdaeac..533da01 100644
--- a/board/ti/dra7xx/README
+++ b/board/ti/dra7xx/README
@@ -23,3 +23,4 @@ U-Boot # tftp ${loadaddr} dra7xx/u-boot.img
 U-Boot # mmc write ${loadaddr} 300 400
 U-Boot # mmc bootbus 1 2 0 2
 U-Boot # mmc partconf 1 1 1 0
+U-Boot # mmc rst-function 1 1
diff --git a/common/cmd_mmc.c b/common/cmd_mmc.c
index 2d51927..f505d97 100644
--- a/common/cmd_mmc.c
+++ b/common/cmd_mmc.c
@@ -330,6 +330,40 @@ static int do_mmcops(cmd_tbl_t *cmdtp, int flag, int argc, 
char * const argv[])
printf(EMMC boot partition Size change Failed.\n);
return 1;
}
+   } else if (strcmp(argv[1], rst-function) == 0) {
+   /*
+* Set the RST_n_ENABLE bit of RST_n_FUNCTION
+* The only valid values are 0x0, 0x1 and 0x2 and writing
+* a value of 0x1 or 0x2 sets the value permanently.
+*/
+   int dev;
+   struct mmc *mmc;
+   u8 enable;
+
+   if (argc == 4) {
+   dev = simple_strtoul(argv[2], NULL, 10);
+   enable = simple_strtoul(argv[3], NULL, 10);
+   } else {
+   return CMD_RET_USAGE;
+   }
+   
+   if (enable  2 || enable  0) {
+   puts(Invalid RST_n_ENABLE value\n);
+   return CMD_RET_USAGE;
+   }
+
+   mmc = find_mmc_device(dev);
+   if (!mmc) {
+   printf(no mmc device at slot %x\n, dev);
+   return 1;
+   }
+
+   if (IS_SD(mmc)) {
+   puts(RST_n_FUNCTION only exists on eMMC\n);
+   return 1;
+   }
+
+   return mmc_set_rst_n_function(mmc, enable);
 #endif /* CONFIG_SUPPORT_EMMC_BOOT */
}
 
@@ -436,6 +470,9 @@ U_BOOT_CMD(
 - Change sizes of boot and RPMB partitions of specified device\n
mmc partconf dev boot_ack boot_partition partition_access\n
 - Change the bits of the PARTITION_CONFIG field of the specified 
device\n
+   mmc rst-function dev value\n
+- Change the RST_n_FUNCTION field of the specified device\n
+  WARNING: This is a write-once field and 0 / 1 / 2 are the only 
valid values.\n
 #endif
mmc setdsr - set DSR register value\n
);
diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
index 3a57ab8..e48db50 100644
--- a/drivers/mmc/mmc.c
+++ b/drivers/mmc/mmc.c
@@ -1482,4 +1482,16 @@ int mmc_set_part_conf(struct mmc *mmc, u8 ack, u8 
part_num, u8 access)
return err;
return 0;
 }
+
+/*
+ * Modify EXT_CSD[162] which is RST_n_FUNCTION based on the given value
+ * for enable.  Note that this is a write-once field for non-zero values.
+ *
+ * Returns 0 on success.
+ */
+int mmc_set_rst_n_function(struct mmc *mmc, u8 enable)
+{
+   return mmc_switch(mmc, EXT_CSD_CMD_SET_NORMAL, EXT_CSD_RST_N_FUNCTION,
+ enable);
+}
 #endif
diff --git a/include/mmc.h b/include/mmc.h
index e95a237..7b0768e 100644
--- a/include/mmc.h
+++ b/include/mmc.h
@@ -150,6 +150,7 @@
 #define EXT_CSD_GP_SIZE_MULT   143 /* R/W */
 #define EXT_CSD_PARTITIONS_ATTRIBUTE   156 /* R/W */
 #define EXT_CSD_PARTITIONING_SUPPORT   160 /* RO */
+#define EXT_CSD_RST_N_FUNCTION 162 /* R/W */
 #define EXT_CSD_RPMB_MULT  168 /* RO */
 #define EXT_CSD_ERASE_GROUP_DEF175 /* R/W */
 #define EXT_CSD_BOOT_BUS_WIDTH 177
@@ -317,6 +318,8 @@ int mmc_boot_partition_size_change(struct mmc *mmc, 
unsigned long bootsize,
 int mmc_set_part_conf(struct mmc *mmc, u8 ack, u8 part_num, u8 access);
 /* Function to modify the BOOT_BUS_WIDTH field of EXT_CSD */
 int mmc_set_boot_bus_width(struct mmc *mmc, u8 width, u8 reset, u8 mode);
+/* Function to modify the RST_n_FUNCTION field of EXT_CSD */
+int mmc_set_rst_n_function(struct mmc *mmc, u8 enable);
 
 /**
  * Start device initialization and return immediately; it does not block on
-- 
1.7.9.5

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


Re: [U-Boot] [PATCH][v3] powerpc/mpc85xx: SECURE BOOT- Add secure boot target for B4860QDS

2014-02-07 Thread Scott Wood
On Tue, 2014-02-04 at 08:03 +0100, Wolfgang Denk wrote:
 Dear Scott,
 
 In message 1391469528.6733.97.ca...@snotra.buserror.net you wrote:
 
+#if defined(CONFIG_RAMBOOT_PBL)
+   disable_cpc_sram();
+#endif
   
   What is the meaning of this undocumented CONFIG_RAMBOOT_PBL option?
  
  I agree it should be documented, but it's not new to this patch.
 
 Of course you are right.  But this patch clearly shows the need to
 document such things, or more and more code will be added based on
 incorrect interpretations.
 
  FWIW, the only documentation I can find for CONFIG_SYS_RAMBOOT is
  doc/README.mpc85xx and doc/README.ramboot-ppc85xx which specify its
  usage in totally normal steps in a boot process from regular boot
  media.
 
 Agreed.  The original purpose has never been documented, whichi s a
 serious pity, as now we only have the misinterpreting documents you
 refer to.
 
  Any instance of booting from RAM is going to need the image to get
  into RAM somehow.  If the symbol is to mean anything at all, it seems
  reasonable that it means that U-Boot was executing from RAM when the
 
 Yes, booting from RAM has been indeed intended for confiurations
 where the U-Boot image was brought to RAM by some magic means totally
 outside of normal operations of the CPU.

Why does U-Boot care, though, whether the means were totally outside the
normal operations of the CPU, or something that was done by some other
software component running on the CPU?  What U-Boot needs to know is the
present state of the system.

  current image was entered, regardless of how that came to be.  There
  should be some way to distinguish running from SRAM versus running from
  DDR, though.
 
 I cannot see how this is related to the RAMBOOT discussion.

It's related because it's part of what CONFIG_RAMBOOT_PBL is being used
to indicate.

 Actually I cannot even see why such distinguishing would be needed at all
 (unless you have very specific ideas about the characteristics of
 SRAM versus DDR on some systems): SRAM and DDR are just examples of
 hardware implementations for the more generic term RAM, i. e.
 writable system memory from wich code can be executed (in contrast to
 some storage device from which no code can be executed without
 previously loading it to RAM, like NAND, SPI flash, SDcard, USB
 storage devices, hard disk drives, etc. etc.)

The difference is relevant (at least on some platforms) because U-Boot
needs to know which TLB entries to have during early boot, whether it
needs to initialize the DDR controller, whether the cache is currently
configured as an SRAM, etc.

Perhaps it could detect this information at runtime, but currently it
does not for at least some of the above.  It also affects the
pre-relocation link address, which must be compile time (but doesn't
necessarily need a symbol that's visible outside the board config file).

-Scott


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


Re: [U-Boot] [PATCH v3 2/8] cmd_mmc.c: Change 'bootpart' code to match normal coding style

2014-02-07 Thread Pantelis Antoniou
Hi Tom,

On Feb 5, 2014, at 5:24 PM, Tom Rini wrote:

 Acked-by: Jaehoon Chung jh80.ch...@samsung.com
 Signed-off-by: Tom Rini tr...@ti.com
 ---
 common/cmd_mmc.c |   15 +++
 1 file changed, 11 insertions(+), 4 deletions(-)
 
 diff --git a/common/cmd_mmc.c b/common/cmd_mmc.c
 index da5fef9..e118252 100644
 --- a/common/cmd_mmc.c
 +++ b/common/cmd_mmc.c
 @@ -314,11 +314,18 @@ static int do_mmcops(cmd_tbl_t *cmdtp, int flag, int 
 argc, char * const argv[])
 
   } else if (strcmp(argv[1], bootpart) == 0) {
   int dev;
 - dev = simple_strtoul(argv[2], NULL, 10);
 + struct *mmc;
 + u32 bootsize, rpmbsize;
 
 - u32 bootsize = simple_strtoul(argv[3], NULL, 10);
 - u32 rpmbsize = simple_strtoul(argv[4], NULL, 10);
 - struct mmc *mmc = find_mmc_device(dev);
 + if (argc == 5) {
 + dev = simple_strtoul(argv[2], NULL, 10);
 + bootsize = simple_strtoul(argv[3], NULL, 10);
 + rpmbsize = simple_strtoul(argv[4], NULL, 10);
 + } else {
 + return CMD_RET_USAGE;
 + }
 +
 + mmc = find_mmc_device(dev);
   if (!mmc) {
   printf(no mmc device at slot %x\n, dev);
   return 1;
 -- 
 1.7.9.5

Applied. Thanks.

Signed-off-by: Pantelis Antoniou pa...@antoniou-consulting.com

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


Re: [U-Boot] [U-Boot, v3] net/designware: make driver compatible with data cache

2014-02-07 Thread Tom Rini
On Wed, Jan 22, 2014 at 08:49:09PM +0400, Alexey Brodkin wrote:

 From: Alexey Brodkin alexey.brod...@synopsys.com
 
 Up until now this driver only worked with data cache disabled.
 To make it work with enabled data cache following changes were required:
 
  * Flush Tx/Rx buffer descriptors their modification
  * Invalidate Tx/Rx buffer descriptors before reading its values
  * Flush cache for data passed from CPU to GMAC
  * Invalidate cache for data passed from GMAC to CPU
 
 Signed-off-by: Alexey Brodkin abrod...@synopsys.com
 
 Cc: Joe Hershberger joe.hershber...@ni.com
 Cc: Vipin Kumar vipin.ku...@st.com
 Cc: Stefan Roese s...@denx.de
 Cc: Mischa Jonker mjon...@synopsys.com
 Cc: Shiraz Hashim shiraz.has...@st.com
 Cc: Albert ARIBAUD albert.u.b...@aribaud.net
 Cc: Amit Virdi amit.vi...@st.com
 Cc: Sonic Zhang sonic.zh...@analog.com

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


[U-Boot] Pull request: u-boot-mmc 07022014

2014-02-07 Thread Pantelis Antoniou
Hi Tom,

The following changes since commit dbf3de2dd26cae37d16b00b348828c883b658cc5:

  include/usb/s3c_udc.h: Add asm/sizes.h (2014-02-06 14:26:05 -0500)

are available in the git repository at:

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

for you to fetch changes up to b818d9ab8d96471c40ccbd4541a46dfa415eda73:

  dra7xx_evm: Add CONFIG_SUPPORT_EMMC_BOOT, document usage (2014-02-07 18:17:49 
+0200)


Rajeshwari S Shinde (1):
  MMC: DWMMC: Correct the CLKDIV register value

Siva Durga Prasad Paladugu (1):
  mmc: Enabled quirk SDHCI_QUIRK_BROKEN_R1B

Stephen Warren (1):
  mmc: set rca to 1 for MMC cards

Tom Rini (8):
  SPL: Add CONFIG_SUPPORT_EMMC_BOOT support to CONFIG_SPL_FRAMEWORK
  cmd_mmc.c: Change 'bootpart' code to match normal coding style
  cmd_mmc.c: Rename 'bootpart' to 'bootpart-resize'
  cmd_mmc.c: Add 'partconf' command to mmc
  cmd_mmc.c: Add bootbus mmc sub-command
  cmd_mmc.c: Drop open/close mmc sub-commands
  omap5_uevm: Add CONFIG_SUPPORT_EMMC_BOOT, document usage
  dra7xx_evm: Add CONFIG_SUPPORT_EMMC_BOOT, document usage

 arch/arm/cpu/armv7/omap-common/boot-common.c |  13 ++-
 arch/arm/include/asm/arch-exynos/dwmmc.h |   4 
 board/ti/dra7xx/README   |  25 +
 board/ti/omap5_uevm/README   |  25 +
 common/cmd_mmc.c | 108 
++
 common/spl/spl_mmc.c |  24 
 drivers/mmc/dw_mmc.c |   2 +-
 drivers/mmc/exynos_dw_mmc.c  |  17 +--
 drivers/mmc/mmc.c|  79 
--
 drivers/mmc/zynq_sdhci.c |   3 ++-
 include/configs/dra7xx_evm.h |   2 ++
 include/configs/omap5_uevm.h |   1 +
 include/dwmmc.h  |   2 +-
 include/mmc.h|   9 ++--
 include/spl.h|   1 +
 15 files changed, 198 insertions(+), 117 deletions(-)
 create mode 100644 board/ti/dra7xx/README
 create mode 100644 board/ti/omap5_uevm/README

Regards

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


Re: [U-Boot] net/designware: add explicit reset of {tx|rx}_currdescnum

2014-02-07 Thread Tom Rini
On Mon, Jan 13, 2014 at 01:28:38PM +0400, Alexey Brodkin wrote:

 Driver init function might be called multiple times.
 On every init Tx/Rx buffer descriptors are initialized: descs_init
 - {tx|rx}_descs_init.
 
 In its turn those init functions set MAC's {tx|rx}desclistaddr to
 point on the first buffer descriptor in the list.
 
 So CPU to start operation from the first buffer descriptor as well after
 every init we have to reset {tx|rx}_currdescnum.
 
 Signed-off-by: Alexey Brodkin abrod...@synopsys.com
 
 Cc: Joe Hershberger joe.hershber...@ni.com
 Cc: Vipin Kumar vipin.ku...@st.com
 Cc: Stefan Roese s...@denx.de
 Cc: Mischa Jonker mjon...@synopsys.com

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


[U-Boot] [[PATCH 7/7] keystone2: net: add keystone ethernet driver

2014-02-07 Thread Murali Karicheri
The network driver consists of multicore navigator
driver and the ethernet sub system driver. Multicore
navigator consists of Network Coprocessor (NetCP) and
Queue Manager sub system. More details on the hardware can
be obtained from the following links:-

Network Coprocessor: http://www.ti.com/lit/pdf/sprugz6
Multicore Navigator: http://www.ti.com/lit/pdf/sprugr9

Multicore navigator driver implements APIs to configure
the Queue Manager and NetCP Pkt DMA. Ethernet driver
configures the CPSW, SGMI and Phy and uses the the Navigator
APIs. The driver supports 4 Ethernet ports and can work with
only one port at a time.

Port configurations are defined in board.c.

Signed-off-by: Vitaly Andrianov vita...@ti.com
Signed-off-by: Murali Karicheri m-kariche...@ti.com
Signed-off-by: WingMan Kwok w-kw...@ti.com
---
 arch/arm/cpu/armv7/keystone/Makefile  |1 +
 arch/arm/cpu/armv7/keystone/keystone_nav.c|  377 +
 arch/arm/include/asm/arch-keystone/emac_defs.h|  255 ++
 arch/arm/include/asm/arch-keystone/keystone_nav.h |  194 +
 board/ti/k2hk_evm/board.c |   65 ++
 drivers/net/Makefile  |1 +
 drivers/net/keystone_net.c|  857 +
 include/configs/k2hk_evm.h|   38 +
 8 files changed, 1788 insertions(+)
 create mode 100644 arch/arm/cpu/armv7/keystone/keystone_nav.c
 create mode 100644 arch/arm/include/asm/arch-keystone/emac_defs.h
 create mode 100644 arch/arm/include/asm/arch-keystone/keystone_nav.h
 create mode 100644 drivers/net/keystone_net.c

diff --git a/arch/arm/cpu/armv7/keystone/Makefile 
b/arch/arm/cpu/armv7/keystone/Makefile
index 0fd4189..e323cf6 100644
--- a/arch/arm/cpu/armv7/keystone/Makefile
+++ b/arch/arm/cpu/armv7/keystone/Makefile
@@ -11,6 +11,7 @@ obj-y   += psc.o
 obj-y   += clock.o
 obj-y   += cmd_clock.o
 obj-y   += cmd_mon.o
+obj-y   += keystone_nav.o
 obj-y   += msmc.o
 obj-y   += lowlevel_init.o
 obj-$(CONFIG_SPL_BUILD) += spl.o
diff --git a/arch/arm/cpu/armv7/keystone/keystone_nav.c 
b/arch/arm/cpu/armv7/keystone/keystone_nav.c
new file mode 100644
index 000..3579be1
--- /dev/null
+++ b/arch/arm/cpu/armv7/keystone/keystone_nav.c
@@ -0,0 +1,377 @@
+/*
+ * Multicore Navigator driver for TI Keystone 2 devices.
+ *
+ * (C) Copyright 2012-2014
+ * Texas Instruments Incorporated, www.ti.com
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+#include common.h
+#include asm/io.h
+#include asm/arch/keystone_nav.h
+
+static int soc_type =
+#ifdef CONFIG_SOC_K2HK
+   k2hk;
+#endif
+
+struct qm_config k2hk_qm_memmap = {
+   .stat_cfg   = 0x02a4,
+   .queue  = (struct qm_reg_queue *)0x02a8,
+   .mngr_vbusm = 0x23a8,
+   .i_lram = 0x0010,
+   .proxy  = (struct qm_reg_queue *)0x02ac,
+   .status_ram = 0x02a06000,
+   .mngr_cfg   = (struct qm_cfg_reg *)0x02a02000,
+   .intd_cfg   = 0x02a0c000,
+   .desc_mem   = (struct descr_mem_setup_reg *)0x02a03000,
+   .region_num = 64,
+   .pdsp_cmd   = 0x02a2,
+   .pdsp_ctl   = 0x02a0f000,
+   .pdsp_iram  = 0x02a1,
+   .qpool_num  = 4000,
+};
+
+/*
+ * We are going to use only one type of descriptors - host packet
+ * descriptors. We staticaly allocate memory for them here
+ */
+struct qm_host_desc desc_pool[HDESC_NUM] __aligned(sizeof(struct 
qm_host_desc));
+
+static struct qm_config *qm_cfg;
+
+inline int num_of_desc_to_reg(int num_descr)
+{
+   int j, num;
+
+   for (j = 0, num = 32; j  15; j++, num *= 2) {
+   if (num_descr = num)
+   return j;
+   }
+
+   return 15;
+}
+
+static int _qm_init(struct qm_config *cfg)
+{
+   u32 j;
+
+   if (cfg == NULL)
+   return QM_ERR;
+
+   qm_cfg = cfg;
+
+   qm_cfg-mngr_cfg-link_ram_base0= qm_cfg-i_lram;
+   qm_cfg-mngr_cfg-link_ram_size0= HDESC_NUM * 8;
+   qm_cfg-mngr_cfg-link_ram_base1= 0;
+   qm_cfg-mngr_cfg-link_ram_size1= 0;
+   qm_cfg-mngr_cfg-link_ram_base2= 0;
+
+   qm_cfg-desc_mem[0].base_addr = (u32)desc_pool;
+   qm_cfg-desc_mem[0].start_idx = 0;
+   qm_cfg-desc_mem[0].desc_reg_size =
+   (((sizeof(struct qm_host_desc)  4) - 1)  16) |
+   num_of_desc_to_reg(HDESC_NUM);
+
+   memset(desc_pool, 0, sizeof(desc_pool));
+   for (j = 0; j  HDESC_NUM; j++)
+   qm_push(desc_pool[j], qm_cfg-qpool_num);
+
+   return QM_OK;
+}
+
+int qm_init(void)
+{
+   switch (soc_type) {
+   case k2hk:
+   return _qm_init(k2hk_qm_memmap);
+   }
+
+   return QM_ERR;
+}
+
+void qm_close(void)
+{
+   u32 j;
+
+   if (qm_cfg == NULL)
+   return;
+
+   queue_close(qm_cfg-qpool_num);
+
+   qm_cfg-mngr_cfg-link_ram_base0= 0;
+   qm_cfg-mngr_cfg-link_ram_size0  

[U-Boot] [[PATCH 5/7 v1] NAND: DaVinci: allow forced disable of subpage writes

2014-02-07 Thread Murali Karicheri
This patch introduces a configurable mechanism to disable
subpage writes in the DaVinci NAND driver.

Signed-off-by: Vitaly Andrianov vita...@ti.com
Signed-off-by: Murali Karicheri m-kariche...@ti.com
---
 - Updated README to include the option as per review comments
 README  |5 +
 drivers/mtd/nand/davinci_nand.c |3 +++
 2 files changed, 8 insertions(+)

diff --git a/README b/README
index aea82be..caf60a2 100644
--- a/README
+++ b/README
@@ -4427,6 +4427,11 @@ Low Level (hardware related) configuration options:
 - CONFIG_SPL_AM33XX_ENABLE_RTC32K_OSC:
Enables the RTC32K OSC on AM33xx based plattforms
 
+- CONFIG_SYS_NAND_NO_SUBPAGE_WRITE
+   Option to disable subpage write in NAND driver
+   Example driver that use this:
+   drivers/mtd/nand/davinci_nand.c
+
 Freescale QE/FMAN Firmware Support:
 ---
 
diff --git a/drivers/mtd/nand/davinci_nand.c b/drivers/mtd/nand/davinci_nand.c
index 5b17d7b..75b03a7 100644
--- a/drivers/mtd/nand/davinci_nand.c
+++ b/drivers/mtd/nand/davinci_nand.c
@@ -609,6 +609,9 @@ void davinci_nand_init(struct nand_chip *nand)
 #ifdef CONFIG_SYS_NAND_USE_FLASH_BBT
nand-bbt_options |= NAND_BBT_USE_FLASH;
 #endif
+#ifdef CONFIG_SYS_NAND_NO_SUBPAGE_WRITE
+   nand-options |= NAND_NO_SUBPAGE_WRITE;
+#endif
 #ifdef CONFIG_SYS_NAND_HW_ECC
nand-ecc.mode = NAND_ECC_HW;
nand-ecc.size = 512;
-- 
1.7.9.5

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


[U-Boot] [[PATCH 1/7] fdt: call ft_board_setup_ex() at the end of image_setup_libfdt()

2014-02-07 Thread Murali Karicheri
From: Vitaly Andrianov vita...@ti.com

The keystone2 SOC requires to fix all 32 bit aliased addresses
to their 36 physical format. This has to happen after all fdt
nodes are added or modified.

Signed-off-by: Vitaly Andrianov vita...@ti.com
---
 common/image-fdt.c|5 +
 include/fdt_support.h |1 +
 2 files changed, 6 insertions(+)

diff --git a/common/image-fdt.c b/common/image-fdt.c
index 6f9ce7d..ee4dd6f 100644
--- a/common/image-fdt.c
+++ b/common/image-fdt.c
@@ -487,5 +487,10 @@ int image_setup_libfdt(bootm_headers_t *images, void *blob,
if (!ft_verify_fdt(blob))
return -1;
 
+#ifdef CONFIG_SOC_K2HK
+   if (IMAAGE_OF_BOARD_SETUP)
+   ft_board_setup_ex(blob, gd-bd);
+#endif
+
return 0;
 }
diff --git a/include/fdt_support.h b/include/fdt_support.h
index 9871e2f..4c1416d 100644
--- a/include/fdt_support.h
+++ b/include/fdt_support.h
@@ -63,6 +63,7 @@ int fdt_pci_dma_ranges(void *blob, int phb_off, struct 
pci_controller *hose);
 #endif
 
 void ft_board_setup(void *blob, bd_t *bd);
+void ft_board_setup_ex(void *blob, bd_t *bd);
 void ft_cpu_setup(void *blob, bd_t *bd);
 void ft_pci_setup(void *blob, bd_t *bd);
 
-- 
1.7.9.5

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


[U-Boot] [[PATCH 2/7] tools: sort the entries in Makefile

2014-02-07 Thread Murali Karicheri
The NOPED_OBJ_FILES, dumpimage and mkimage object file
entries are to be kept sorted. This patch fix this issue.

Signed-off-by: Murali Karicheri m-kariche...@ti.com
---
 - As per review comments
 tools/Makefile |   14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/tools/Makefile b/tools/Makefile
index 328cea3..3c719b3 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -77,10 +77,10 @@ NOPED_OBJ_FILES-y += aisimage.o
 NOPED_OBJ_FILES-y += default_image.o
 NOPED_OBJ_FILES-y += dumpimage.o
 NOPED_OBJ_FILES-y += fit_image.o
+NOPED_OBJ_FILES-y += imagetool.o
 NOPED_OBJ_FILES-y += image-host.o
 NOPED_OBJ_FILES-y += imximage.o
 NOPED_OBJ_FILES-y += kwbimage.o
-NOPED_OBJ_FILES-y += imagetool.o
 NOPED_OBJ_FILES-y += mkenvimage.o
 NOPED_OBJ_FILES-y += mkimage.o
 NOPED_OBJ_FILES-y += mxsimage.o
@@ -88,8 +88,8 @@ NOPED_OBJ_FILES-y += omapimage.o
 NOPED_OBJ_FILES-y += os_support.o
 NOPED_OBJ_FILES-y += pblimage.o
 NOPED_OBJ_FILES-y += proftool.o
-NOPED_OBJ_FILES-y += ublimage.o
 NOPED_OBJ_FILES-y += relocate-rela.o
+NOPED_OBJ_FILES-y += ublimage.o
 OBJ_FILES-$(CONFIG_BUILD_ENVCRC) += envcrc.o
 OBJ_FILES-$(CONFIG_CMD_LOADS) += img2srec.o
 OBJ_FILES-$(CONFIG_CMD_NET) += gen_eth_addr.o
@@ -209,14 +209,14 @@ $(obj)dumpimage$(SFX):$(obj)aisimage.o \
$(FIT_SIG_OBJS) \
$(obj)crc32.o \
$(obj)default_image.o \
+   $(obj)dumpimage.o \
$(obj)fit_image.o \
-   $(obj)image-fit.o \
$(obj)image.o \
-   $(obj)image-host.o \
$(obj)imagetool.o \
+   $(obj)image-fit.o \
+   $(obj)image-host.o \
$(obj)imximage.o \
$(obj)kwbimage.o \
-   $(obj)dumpimage.o \
$(obj)md5.o \
$(obj)mxsimage.o \
$(obj)omapimage.o \
@@ -239,10 +239,10 @@ $(obj)mkimage$(SFX):  $(obj)aisimage.o \
$(obj)crc32.o \
$(obj)default_image.o \
$(obj)fit_image.o \
-   $(obj)image-fit.o \
-   $(obj)image-host.o \
$(obj)image.o \
$(obj)imagetool.o \
+   $(obj)image-host.o \
+   $(obj)image-fit.o \
$(obj)imximage.o \
$(obj)kwbimage.o \
$(obj)md5.o \
-- 
1.7.9.5

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


[U-Boot] [PATCH 0/7] Add support for Keystone2 SoC and K2HK EVM

2014-02-07 Thread Murali Karicheri
This patch series add support for keystone2 SoC and K2HK EVM.

Following patches were reviewed before in this list and v1 of the
same is send with review comments incorporated:-
  - tools: mkimage: add support for gpimage format
  - arm: add support for arch timer
  - NAND: DaVinci: allow forced disable of subpage writes

The patch below is added as a seperate patch based on comments:-
   - tools: sort the entries in Makefile

Murali Karicheri (5):
  tools: sort the entries in Makefile
  tools: mkimage: add support for gpimage format
  NAND: DaVinci: allow forced disable of subpage writes
  k2hk: add support for k2hk SOC and EVM
  keystone2: net: add keystone ethernet driver

Vitaly Andrianov (2):
  fdt: call ft_board_setup_ex() at the end of image_setup_libfdt()
  arm: add support for arch timer

 Makefile   |   19 +
 README |5 +
 arch/arm/cpu/armv7/keystone/Makefile   |   19 +
 arch/arm/cpu/armv7/keystone/aemif.c|   79 ++
 arch/arm/cpu/armv7/keystone/clock-k2hk.c   |  106 +++
 arch/arm/cpu/armv7/keystone/clock.c|  200 +
 arch/arm/cpu/armv7/keystone/cmd_clock.c|  139 
 arch/arm/cpu/armv7/keystone/cmd_mon.c  |  131 +++
 arch/arm/cpu/armv7/keystone/config.mk  |   14 +
 arch/arm/cpu/armv7/keystone/ddr3.c |   69 ++
 arch/arm/cpu/armv7/keystone/init.c |   49 ++
 arch/arm/cpu/armv7/keystone/keystone_nav.c |  377 +
 arch/arm/cpu/armv7/keystone/lowlevel_init.S|   13 +
 arch/arm/cpu/armv7/keystone/msmc.c |   69 ++
 arch/arm/cpu/armv7/keystone/psc.c  |  240 ++
 arch/arm/cpu/armv7/keystone/spl.c  |   45 +
 arch/arm/include/asm/arch-keystone/clock-k2hk.h|  109 +++
 arch/arm/include/asm/arch-keystone/clock.h |   17 +
 arch/arm/include/asm/arch-keystone/clock_defs.h|   97 +++
 arch/arm/include/asm/arch-keystone/emac_defs.h |  255 ++
 arch/arm/include/asm/arch-keystone/emif_defs.h |   75 ++
 arch/arm/include/asm/arch-keystone/hardware-k2hk.h |  143 
 arch/arm/include/asm/arch-keystone/hardware.h  |  174 
 arch/arm/include/asm/arch-keystone/i2c_defs.h  |   86 ++
 arch/arm/include/asm/arch-keystone/keystone_nav.h  |  194 +
 arch/arm/include/asm/arch-keystone/nand_defs.h |   25 +
 arch/arm/include/asm/arch-keystone/psc_defs.h  |   91 +++
 arch/arm/include/asm/arch-keystone/spl.h   |   12 +
 arch/arm/lib/Makefile  |1 +
 arch/arm/lib/arch_timer.c  |   58 ++
 board/ti/k2hk_evm/Makefile |9 +
 board/ti/k2hk_evm/README   |   56 ++
 board/ti/k2hk_evm/board.c  |  311 +++
 board/ti/k2hk_evm/ddr3.c   |  269 ++
 boards.cfg |1 +
 common/image-fdt.c |5 +
 common/image.c |1 +
 drivers/i2c/Makefile   |1 +
 drivers/i2c/keystone_i2c.c |  372 +
 drivers/mtd/nand/davinci_nand.c|3 +
 drivers/net/Makefile   |1 +
 drivers/net/keystone_net.c |  857 
 drivers/serial/ns16550.c   |8 +
 include/configs/k2hk_evm.h |  259 ++
 include/fdt_support.h  |1 +
 include/image.h|1 +
 tools/Makefile |   20 +-
 tools/gpheader.h   |   40 +
 tools/gpimage-common.c |   80 ++
 tools/gpimage.c|   77 ++
 tools/imagetool.c  |2 +
 tools/imagetool.h  |1 +
 tools/omapimage.c  |  104 +--
 tools/omapimage.h  |5 -
 54 files changed, 5295 insertions(+), 100 deletions(-)
 create mode 100644 arch/arm/cpu/armv7/keystone/Makefile
 create mode 100644 arch/arm/cpu/armv7/keystone/aemif.c
 create mode 100644 arch/arm/cpu/armv7/keystone/clock-k2hk.c
 create mode 100644 arch/arm/cpu/armv7/keystone/clock.c
 create mode 100644 arch/arm/cpu/armv7/keystone/cmd_clock.c
 create mode 100644 arch/arm/cpu/armv7/keystone/cmd_mon.c
 create mode 100644 arch/arm/cpu/armv7/keystone/config.mk
 create mode 100644 arch/arm/cpu/armv7/keystone/ddr3.c
 create mode 100644 arch/arm/cpu/armv7/keystone/init.c
 create mode 100644 arch/arm/cpu/armv7/keystone/keystone_nav.c
 create mode 100644 arch/arm/cpu/armv7/keystone/lowlevel_init.S
 create mode 100644 arch/arm/cpu/armv7/keystone/msmc.c
 create mode 100644 

[U-Boot] [[PATCH 4/7 v1] arm: add support for arch timer

2014-02-07 Thread Murali Karicheri
From: Vitaly Andrianov vita...@ti.com

This patch add basic support for the architecture timer found on recent
ARMv7 based SoCs.

Signed-off-by: Vitaly Andrianov vita...@ti.com
Signed-off-by: Murali Karicheri m-kariche...@ti.com
---
 - Resending the patch along with SoC/board patch
 arch/arm/lib/Makefile |1 +
 arch/arm/lib/arch_timer.c |   58 +
 2 files changed, 59 insertions(+)
 create mode 100644 arch/arm/lib/arch_timer.c

diff --git a/arch/arm/lib/Makefile b/arch/arm/lib/Makefile
index 321997c..726f229 100644
--- a/arch/arm/lib/Makefile
+++ b/arch/arm/lib/Makefile
@@ -42,6 +42,7 @@ obj-$(CONFIG_USE_ARCH_MEMCPY) += memcpy.o
 else
 obj-$(CONFIG_SPL_FRAMEWORK) += spl.o
 endif
+obj-$(CONFIG_SYS_ARCH_TIMER) += arch_timer.o
 
 ifdef CONFIG_ARM64
 obj-y  += interrupts_64.o
diff --git a/arch/arm/lib/arch_timer.c b/arch/arm/lib/arch_timer.c
new file mode 100644
index 000..0588e2b
--- /dev/null
+++ b/arch/arm/lib/arch_timer.c
@@ -0,0 +1,58 @@
+/*
+ * (C) Copyright 2012-2014
+ * Texas Instruments Incorporated, www.ti.com
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#include common.h
+#include asm/io.h
+#include div64.h
+
+DECLARE_GLOBAL_DATA_PTR;
+
+int timer_init(void)
+{
+   gd-arch.tbl = 0;
+   gd-arch.tbu = 0;
+
+   gd-arch.timer_rate_hz = CONFIG_SYS_HZ_CLOCK / CONFIG_SYS_HZ;
+
+   return 0;
+}
+
+unsigned long long get_ticks(void)
+{
+   ulong nowl, nowu;
+
+   asm volatile(mrrc p15, 0, %0, %1, c14 : =r (nowl), =r (nowu));
+
+   gd-arch.tbl = nowl;
+   gd-arch.tbu = nowu;
+
+   return (((unsigned long long)gd-arch.tbu)  32) | gd-arch.tbl;
+}
+
+
+ulong get_timer(ulong base)
+{
+   return lldiv(get_ticks(), gd-arch.timer_rate_hz) - base;
+}
+
+void __udelay(unsigned long usec)
+{
+   unsigned long long endtime;
+
+   endtime = lldiv((unsigned long long)usec * gd-arch.timer_rate_hz,
+   1000UL);
+
+   endtime += get_ticks();
+
+   while (get_ticks()  endtime)
+   ;
+}
+
+ulong get_tbclk(void)
+{
+   return gd-arch.timer_rate_hz;
+}
-- 
1.7.9.5

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


[U-Boot] [[PATCH 3/7 v1] tools: mkimage: add support for gpimage format

2014-02-07 Thread Murali Karicheri
This patch add support for gpimage format as a preparatory
patch for porting u-boot for keystone2 devices and is
based on omapimage format. It re-uses gph header to store the
size and loadaddr as done in omapimage.c

Signed-off-by: Vitaly Andrianov vita...@ti.com
Signed-off-by: Murali Karicheri m-kariche...@ti.com
---
 - Addressed review comments against initial version
 - refactored the code to avoid redundant code
 common/image.c |1 +
 include/image.h|1 +
 tools/Makefile |6 +++
 tools/gpheader.h   |   40 +++
 tools/gpimage-common.c |   80 +
 tools/gpimage.c|   77 +++
 tools/imagetool.c  |2 +
 tools/imagetool.h  |1 +
 tools/omapimage.c  |  104 
 tools/omapimage.h  |5 ---
 10 files changed, 224 insertions(+), 93 deletions(-)
 create mode 100644 tools/gpheader.h
 create mode 100644 tools/gpimage-common.c
 create mode 100644 tools/gpimage.c

diff --git a/common/image.c b/common/image.c
index ae95c3f..cb5c656 100644
--- a/common/image.c
+++ b/common/image.c
@@ -124,6 +124,7 @@ static const table_entry_t uimage_type[] = {
{   IH_TYPE_FILESYSTEM, filesystem, Filesystem Image,   },
{   IH_TYPE_FIRMWARE,   firmware,   Firmware,   },
{   IH_TYPE_FLATDT, flat_dt,Flat Device Tree,   },
+   {   IH_TYPE_GPIMAGE,gpimage,TI Keystone SPL Image,},
{   IH_TYPE_KERNEL, kernel, Kernel Image,   },
{   IH_TYPE_KERNEL_NOLOAD, kernel_noload,  Kernel Image (no 
loading done), },
{   IH_TYPE_KWBIMAGE,   kwbimage,   Kirkwood Boot Image,},
diff --git a/include/image.h b/include/image.h
index 7de2bb2..0a3d346 100644
--- a/include/image.h
+++ b/include/image.h
@@ -214,6 +214,7 @@ struct lmb;
 #define IH_TYPE_KERNEL_NOLOAD  14  /* OS Kernel Image, can run from any 
load address */
 #define IH_TYPE_PBLIMAGE   15  /* Freescale PBL Boot Image */
 #define IH_TYPE_MXSIMAGE   16  /* Freescale MXSBoot Image  */
+#define IH_TYPE_GPIMAGE17  /* TI Keystone GPHeader Image   
*/
 
 /*
  * Compression Types
diff --git a/tools/Makefile b/tools/Makefile
index 3c719b3..421aba5 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -77,6 +77,8 @@ NOPED_OBJ_FILES-y += aisimage.o
 NOPED_OBJ_FILES-y += default_image.o
 NOPED_OBJ_FILES-y += dumpimage.o
 NOPED_OBJ_FILES-y += fit_image.o
+NOPED_OBJ_FILES-y += gpimage.o
+NOPED_OBJ_FILES-y += gpimage-common.o
 NOPED_OBJ_FILES-y += imagetool.o
 NOPED_OBJ_FILES-y += image-host.o
 NOPED_OBJ_FILES-y += imximage.o
@@ -211,6 +213,8 @@ $(obj)dumpimage$(SFX):  $(obj)aisimage.o \
$(obj)default_image.o \
$(obj)dumpimage.o \
$(obj)fit_image.o \
+   $(obj)gpimage.o \
+   $(obj)gpimage-common.o \
$(obj)image.o \
$(obj)imagetool.o \
$(obj)image-fit.o \
@@ -239,6 +243,8 @@ $(obj)mkimage$(SFX):$(obj)aisimage.o \
$(obj)crc32.o \
$(obj)default_image.o \
$(obj)fit_image.o \
+   $(obj)gpimage.o \
+   $(obj)gpimage-common.o \
$(obj)image.o \
$(obj)imagetool.o \
$(obj)image-host.o \
diff --git a/tools/gpheader.h b/tools/gpheader.h
new file mode 100644
index 000..63a28a2
--- /dev/null
+++ b/tools/gpheader.h
@@ -0,0 +1,40 @@
+/*
+ * (C) Copyright 2014
+ * Texas Instruments Incorporated
+ * Refactored common functions in to gpimage-common.c. Include this common
+ * header file
+ *
+ * (C) Copyright 2010
+ * Linaro LTD, www.linaro.org
+ * Author: John Rigby john.ri...@linaro.org
+ * Based on TI's signGP.c
+ *
+ * (C) Copyright 2009
+ * Stefano Babic, DENX Software Engineering, sba...@denx.de.
+ *
+ * (C) Copyright 2008
+ * Marvell Semiconductor www.marvell.com
+ * Written-by: Prafulla Wadaskar prafu...@marvell.com
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#ifndef _GPIMAGE_H_
+#define _GPIMAGE_H_
+
+/* common headers for gpimage and omapimage formats */
+struct gp_header {
+   uint32_t size;
+   uint32_t load_addr;
+};
+#define GPIMAGE_HDR_SIZE (sizeof(struct gp_header))
+
+/* common functions across gpimage and omapimage handlers */
+int valid_gph_size(uint32_t size);
+int valid_gph_load_addr(uint32_t load_addr);
+int gph_verify_header(struct gp_header *gph, int be);
+void gph_print_header(const struct gp_header *gph, int be);
+void gph_set_header(struct gp_header *gph, uint32_t size, uint32_t load_addr,
+   int be);
+int gpimage_check_params(struct image_tool_params *params);
+#endif
diff --git a/tools/gpimage-common.c b/tools/gpimage-common.c
new file mode 

[U-Boot] [U-Boot: RESEND][PATCH 0/7] Add support for Keystone2 SoC and K2HK EVM

2014-02-07 Thread Murali Karicheri
 - Resending since I missed some in the CC

This patch series add support for keystone2 SoC and K2HK EVM.

Following patches were reviewed before in this list and v1 of the
same is send with review comments incorporated:-
  - tools: mkimage: add support for gpimage format
  - arm: add support for arch timer
  - NAND: DaVinci: allow forced disable of subpage writes

The patch below is added as a seperate patch based on comments:-
   - tools: sort the entries in Makefile

Murali Karicheri (5):
  tools: sort the entries in Makefile
  tools: mkimage: add support for gpimage format
  NAND: DaVinci: allow forced disable of subpage writes
  k2hk: add support for k2hk SOC and EVM
  keystone2: net: add keystone ethernet driver

Vitaly Andrianov (2):
  fdt: call ft_board_setup_ex() at the end of image_setup_libfdt()
  arm: add support for arch timer

 Makefile   |   19 +
 README |5 +
 arch/arm/cpu/armv7/keystone/Makefile   |   19 +
 arch/arm/cpu/armv7/keystone/aemif.c|   79 ++
 arch/arm/cpu/armv7/keystone/clock-k2hk.c   |  106 +++
 arch/arm/cpu/armv7/keystone/clock.c|  200 +
 arch/arm/cpu/armv7/keystone/cmd_clock.c|  139 
 arch/arm/cpu/armv7/keystone/cmd_mon.c  |  131 +++
 arch/arm/cpu/armv7/keystone/config.mk  |   14 +
 arch/arm/cpu/armv7/keystone/ddr3.c |   69 ++
 arch/arm/cpu/armv7/keystone/init.c |   49 ++
 arch/arm/cpu/armv7/keystone/keystone_nav.c |  377 +
 arch/arm/cpu/armv7/keystone/lowlevel_init.S|   13 +
 arch/arm/cpu/armv7/keystone/msmc.c |   69 ++
 arch/arm/cpu/armv7/keystone/psc.c  |  240 ++
 arch/arm/cpu/armv7/keystone/spl.c  |   45 +
 arch/arm/include/asm/arch-keystone/clock-k2hk.h|  109 +++
 arch/arm/include/asm/arch-keystone/clock.h |   17 +
 arch/arm/include/asm/arch-keystone/clock_defs.h|   97 +++
 arch/arm/include/asm/arch-keystone/emac_defs.h |  255 ++
 arch/arm/include/asm/arch-keystone/emif_defs.h |   75 ++
 arch/arm/include/asm/arch-keystone/hardware-k2hk.h |  143 
 arch/arm/include/asm/arch-keystone/hardware.h  |  174 
 arch/arm/include/asm/arch-keystone/i2c_defs.h  |   86 ++
 arch/arm/include/asm/arch-keystone/keystone_nav.h  |  194 +
 arch/arm/include/asm/arch-keystone/nand_defs.h |   25 +
 arch/arm/include/asm/arch-keystone/psc_defs.h  |   91 +++
 arch/arm/include/asm/arch-keystone/spl.h   |   12 +
 arch/arm/lib/Makefile  |1 +
 arch/arm/lib/arch_timer.c  |   58 ++
 board/ti/k2hk_evm/Makefile |9 +
 board/ti/k2hk_evm/README   |   56 ++
 board/ti/k2hk_evm/board.c  |  311 +++
 board/ti/k2hk_evm/ddr3.c   |  269 ++
 boards.cfg |1 +
 common/image-fdt.c |5 +
 common/image.c |1 +
 drivers/i2c/Makefile   |1 +
 drivers/i2c/keystone_i2c.c |  372 +
 drivers/mtd/nand/davinci_nand.c|3 +
 drivers/net/Makefile   |1 +
 drivers/net/keystone_net.c |  857 
 drivers/serial/ns16550.c   |8 +
 include/configs/k2hk_evm.h |  259 ++
 include/fdt_support.h  |1 +
 include/image.h|1 +
 tools/Makefile |   20 +-
 tools/gpheader.h   |   40 +
 tools/gpimage-common.c |   80 ++
 tools/gpimage.c|   77 ++
 tools/imagetool.c  |2 +
 tools/imagetool.h  |1 +
 tools/omapimage.c  |  104 +--
 tools/omapimage.h  |5 -
 54 files changed, 5295 insertions(+), 100 deletions(-)
 create mode 100644 arch/arm/cpu/armv7/keystone/Makefile
 create mode 100644 arch/arm/cpu/armv7/keystone/aemif.c
 create mode 100644 arch/arm/cpu/armv7/keystone/clock-k2hk.c
 create mode 100644 arch/arm/cpu/armv7/keystone/clock.c
 create mode 100644 arch/arm/cpu/armv7/keystone/cmd_clock.c
 create mode 100644 arch/arm/cpu/armv7/keystone/cmd_mon.c
 create mode 100644 arch/arm/cpu/armv7/keystone/config.mk
 create mode 100644 arch/arm/cpu/armv7/keystone/ddr3.c
 create mode 100644 arch/arm/cpu/armv7/keystone/init.c
 create mode 100644 arch/arm/cpu/armv7/keystone/keystone_nav.c
 create mode 100644 arch/arm/cpu/armv7/keystone/lowlevel_init.S
 create mode 100644 

[U-Boot] [U-Boot:RESEND][[PATCH 4/7 v1] arm: add support for arch timer

2014-02-07 Thread Murali Karicheri
From: Vitaly Andrianov vita...@ti.com

This patch add basic support for the architecture timer found on recent
ARMv7 based SoCs.

Signed-off-by: Vitaly Andrianov vita...@ti.com
Signed-off-by: Murali Karicheri m-kariche...@ti.com
---
 - Resending with some more in cc
 - Resending the patch along with SoC/board patch
 arch/arm/lib/Makefile |1 +
 arch/arm/lib/arch_timer.c |   58 +
 2 files changed, 59 insertions(+)
 create mode 100644 arch/arm/lib/arch_timer.c

diff --git a/arch/arm/lib/Makefile b/arch/arm/lib/Makefile
index 321997c..726f229 100644
--- a/arch/arm/lib/Makefile
+++ b/arch/arm/lib/Makefile
@@ -42,6 +42,7 @@ obj-$(CONFIG_USE_ARCH_MEMCPY) += memcpy.o
 else
 obj-$(CONFIG_SPL_FRAMEWORK) += spl.o
 endif
+obj-$(CONFIG_SYS_ARCH_TIMER) += arch_timer.o
 
 ifdef CONFIG_ARM64
 obj-y  += interrupts_64.o
diff --git a/arch/arm/lib/arch_timer.c b/arch/arm/lib/arch_timer.c
new file mode 100644
index 000..0588e2b
--- /dev/null
+++ b/arch/arm/lib/arch_timer.c
@@ -0,0 +1,58 @@
+/*
+ * (C) Copyright 2012-2014
+ * Texas Instruments Incorporated, www.ti.com
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#include common.h
+#include asm/io.h
+#include div64.h
+
+DECLARE_GLOBAL_DATA_PTR;
+
+int timer_init(void)
+{
+   gd-arch.tbl = 0;
+   gd-arch.tbu = 0;
+
+   gd-arch.timer_rate_hz = CONFIG_SYS_HZ_CLOCK / CONFIG_SYS_HZ;
+
+   return 0;
+}
+
+unsigned long long get_ticks(void)
+{
+   ulong nowl, nowu;
+
+   asm volatile(mrrc p15, 0, %0, %1, c14 : =r (nowl), =r (nowu));
+
+   gd-arch.tbl = nowl;
+   gd-arch.tbu = nowu;
+
+   return (((unsigned long long)gd-arch.tbu)  32) | gd-arch.tbl;
+}
+
+
+ulong get_timer(ulong base)
+{
+   return lldiv(get_ticks(), gd-arch.timer_rate_hz) - base;
+}
+
+void __udelay(unsigned long usec)
+{
+   unsigned long long endtime;
+
+   endtime = lldiv((unsigned long long)usec * gd-arch.timer_rate_hz,
+   1000UL);
+
+   endtime += get_ticks();
+
+   while (get_ticks()  endtime)
+   ;
+}
+
+ulong get_tbclk(void)
+{
+   return gd-arch.timer_rate_hz;
+}
-- 
1.7.9.5

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


[U-Boot] [U-Boot:RESEND][[PATCH 2/7] tools: sort the entries in Makefile

2014-02-07 Thread Murali Karicheri
The NOPED_OBJ_FILES, dumpimage and mkimage object file
entries are to be kept sorted. This patch fix this issue.

Signed-off-by: Murali Karicheri m-kariche...@ti.com
---
 - Resend with some more in cc
 - As per review comments
 tools/Makefile |   14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/tools/Makefile b/tools/Makefile
index 328cea3..3c719b3 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -77,10 +77,10 @@ NOPED_OBJ_FILES-y += aisimage.o
 NOPED_OBJ_FILES-y += default_image.o
 NOPED_OBJ_FILES-y += dumpimage.o
 NOPED_OBJ_FILES-y += fit_image.o
+NOPED_OBJ_FILES-y += imagetool.o
 NOPED_OBJ_FILES-y += image-host.o
 NOPED_OBJ_FILES-y += imximage.o
 NOPED_OBJ_FILES-y += kwbimage.o
-NOPED_OBJ_FILES-y += imagetool.o
 NOPED_OBJ_FILES-y += mkenvimage.o
 NOPED_OBJ_FILES-y += mkimage.o
 NOPED_OBJ_FILES-y += mxsimage.o
@@ -88,8 +88,8 @@ NOPED_OBJ_FILES-y += omapimage.o
 NOPED_OBJ_FILES-y += os_support.o
 NOPED_OBJ_FILES-y += pblimage.o
 NOPED_OBJ_FILES-y += proftool.o
-NOPED_OBJ_FILES-y += ublimage.o
 NOPED_OBJ_FILES-y += relocate-rela.o
+NOPED_OBJ_FILES-y += ublimage.o
 OBJ_FILES-$(CONFIG_BUILD_ENVCRC) += envcrc.o
 OBJ_FILES-$(CONFIG_CMD_LOADS) += img2srec.o
 OBJ_FILES-$(CONFIG_CMD_NET) += gen_eth_addr.o
@@ -209,14 +209,14 @@ $(obj)dumpimage$(SFX):$(obj)aisimage.o \
$(FIT_SIG_OBJS) \
$(obj)crc32.o \
$(obj)default_image.o \
+   $(obj)dumpimage.o \
$(obj)fit_image.o \
-   $(obj)image-fit.o \
$(obj)image.o \
-   $(obj)image-host.o \
$(obj)imagetool.o \
+   $(obj)image-fit.o \
+   $(obj)image-host.o \
$(obj)imximage.o \
$(obj)kwbimage.o \
-   $(obj)dumpimage.o \
$(obj)md5.o \
$(obj)mxsimage.o \
$(obj)omapimage.o \
@@ -239,10 +239,10 @@ $(obj)mkimage$(SFX):  $(obj)aisimage.o \
$(obj)crc32.o \
$(obj)default_image.o \
$(obj)fit_image.o \
-   $(obj)image-fit.o \
-   $(obj)image-host.o \
$(obj)image.o \
$(obj)imagetool.o \
+   $(obj)image-host.o \
+   $(obj)image-fit.o \
$(obj)imximage.o \
$(obj)kwbimage.o \
$(obj)md5.o \
-- 
1.7.9.5

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


[U-Boot] [U-Boot:RESEND][[PATCH 5/7 v1] NAND: DaVinci: allow forced disable of subpage writes

2014-02-07 Thread Murali Karicheri
This patch introduces a configurable mechanism to disable
subpage writes in the DaVinci NAND driver.

Signed-off-by: Vitaly Andrianov vita...@ti.com
Signed-off-by: Murali Karicheri m-kariche...@ti.com
---
 - Resend with some more in cc
 - Updated README to include the option as per review comments
 README  |5 +
 drivers/mtd/nand/davinci_nand.c |3 +++
 2 files changed, 8 insertions(+)

diff --git a/README b/README
index aea82be..caf60a2 100644
--- a/README
+++ b/README
@@ -4427,6 +4427,11 @@ Low Level (hardware related) configuration options:
 - CONFIG_SPL_AM33XX_ENABLE_RTC32K_OSC:
Enables the RTC32K OSC on AM33xx based plattforms
 
+- CONFIG_SYS_NAND_NO_SUBPAGE_WRITE
+   Option to disable subpage write in NAND driver
+   Example driver that use this:
+   drivers/mtd/nand/davinci_nand.c
+
 Freescale QE/FMAN Firmware Support:
 ---
 
diff --git a/drivers/mtd/nand/davinci_nand.c b/drivers/mtd/nand/davinci_nand.c
index 5b17d7b..75b03a7 100644
--- a/drivers/mtd/nand/davinci_nand.c
+++ b/drivers/mtd/nand/davinci_nand.c
@@ -609,6 +609,9 @@ void davinci_nand_init(struct nand_chip *nand)
 #ifdef CONFIG_SYS_NAND_USE_FLASH_BBT
nand-bbt_options |= NAND_BBT_USE_FLASH;
 #endif
+#ifdef CONFIG_SYS_NAND_NO_SUBPAGE_WRITE
+   nand-options |= NAND_NO_SUBPAGE_WRITE;
+#endif
 #ifdef CONFIG_SYS_NAND_HW_ECC
nand-ecc.mode = NAND_ECC_HW;
nand-ecc.size = 512;
-- 
1.7.9.5

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


[U-Boot] [U-Boot:RESEND][[PATCH 1/7] fdt: call ft_board_setup_ex() at the end of image_setup_libfdt()

2014-02-07 Thread Murali Karicheri
From: Vitaly Andrianov vita...@ti.com

The keystone2 SOC requires to fix all 32 bit aliased addresses
to their 36 physical format. This has to happen after all fdt
nodes are added or modified.

Signed-off-by: Vitaly Andrianov vita...@ti.com
---
 - Resending with some more in cc
 common/image-fdt.c|5 +
 include/fdt_support.h |1 +
 2 files changed, 6 insertions(+)

diff --git a/common/image-fdt.c b/common/image-fdt.c
index 6f9ce7d..ee4dd6f 100644
--- a/common/image-fdt.c
+++ b/common/image-fdt.c
@@ -487,5 +487,10 @@ int image_setup_libfdt(bootm_headers_t *images, void *blob,
if (!ft_verify_fdt(blob))
return -1;
 
+#ifdef CONFIG_SOC_K2HK
+   if (IMAAGE_OF_BOARD_SETUP)
+   ft_board_setup_ex(blob, gd-bd);
+#endif
+
return 0;
 }
diff --git a/include/fdt_support.h b/include/fdt_support.h
index 9871e2f..4c1416d 100644
--- a/include/fdt_support.h
+++ b/include/fdt_support.h
@@ -63,6 +63,7 @@ int fdt_pci_dma_ranges(void *blob, int phb_off, struct 
pci_controller *hose);
 #endif
 
 void ft_board_setup(void *blob, bd_t *bd);
+void ft_board_setup_ex(void *blob, bd_t *bd);
 void ft_cpu_setup(void *blob, bd_t *bd);
 void ft_pci_setup(void *blob, bd_t *bd);
 
-- 
1.7.9.5

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


[U-Boot] [U-Boot:RESEND][[PATCH 3/7 v1] tools: mkimage: add support for gpimage format

2014-02-07 Thread Murali Karicheri
This patch add support for gpimage format as a preparatory
patch for porting u-boot for keystone2 devices and is
based on omapimage format. It re-uses gph header to store the
size and loadaddr as done in omapimage.c

Signed-off-by: Vitaly Andrianov vita...@ti.com
Signed-off-by: Murali Karicheri m-kariche...@ti.com
---
 - Resending with some more in cc
 - Addressed review comments against initial version
 - refactored the code to avoid redundant code
 common/image.c |1 +
 include/image.h|1 +
 tools/Makefile |6 +++
 tools/gpheader.h   |   40 +++
 tools/gpimage-common.c |   80 +
 tools/gpimage.c|   77 +++
 tools/imagetool.c  |2 +
 tools/imagetool.h  |1 +
 tools/omapimage.c  |  104 
 tools/omapimage.h  |5 ---
 10 files changed, 224 insertions(+), 93 deletions(-)
 create mode 100644 tools/gpheader.h
 create mode 100644 tools/gpimage-common.c
 create mode 100644 tools/gpimage.c

diff --git a/common/image.c b/common/image.c
index ae95c3f..cb5c656 100644
--- a/common/image.c
+++ b/common/image.c
@@ -124,6 +124,7 @@ static const table_entry_t uimage_type[] = {
{   IH_TYPE_FILESYSTEM, filesystem, Filesystem Image,   },
{   IH_TYPE_FIRMWARE,   firmware,   Firmware,   },
{   IH_TYPE_FLATDT, flat_dt,Flat Device Tree,   },
+   {   IH_TYPE_GPIMAGE,gpimage,TI Keystone SPL Image,},
{   IH_TYPE_KERNEL, kernel, Kernel Image,   },
{   IH_TYPE_KERNEL_NOLOAD, kernel_noload,  Kernel Image (no 
loading done), },
{   IH_TYPE_KWBIMAGE,   kwbimage,   Kirkwood Boot Image,},
diff --git a/include/image.h b/include/image.h
index 7de2bb2..0a3d346 100644
--- a/include/image.h
+++ b/include/image.h
@@ -214,6 +214,7 @@ struct lmb;
 #define IH_TYPE_KERNEL_NOLOAD  14  /* OS Kernel Image, can run from any 
load address */
 #define IH_TYPE_PBLIMAGE   15  /* Freescale PBL Boot Image */
 #define IH_TYPE_MXSIMAGE   16  /* Freescale MXSBoot Image  */
+#define IH_TYPE_GPIMAGE17  /* TI Keystone GPHeader Image   
*/
 
 /*
  * Compression Types
diff --git a/tools/Makefile b/tools/Makefile
index 3c719b3..421aba5 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -77,6 +77,8 @@ NOPED_OBJ_FILES-y += aisimage.o
 NOPED_OBJ_FILES-y += default_image.o
 NOPED_OBJ_FILES-y += dumpimage.o
 NOPED_OBJ_FILES-y += fit_image.o
+NOPED_OBJ_FILES-y += gpimage.o
+NOPED_OBJ_FILES-y += gpimage-common.o
 NOPED_OBJ_FILES-y += imagetool.o
 NOPED_OBJ_FILES-y += image-host.o
 NOPED_OBJ_FILES-y += imximage.o
@@ -211,6 +213,8 @@ $(obj)dumpimage$(SFX):  $(obj)aisimage.o \
$(obj)default_image.o \
$(obj)dumpimage.o \
$(obj)fit_image.o \
+   $(obj)gpimage.o \
+   $(obj)gpimage-common.o \
$(obj)image.o \
$(obj)imagetool.o \
$(obj)image-fit.o \
@@ -239,6 +243,8 @@ $(obj)mkimage$(SFX):$(obj)aisimage.o \
$(obj)crc32.o \
$(obj)default_image.o \
$(obj)fit_image.o \
+   $(obj)gpimage.o \
+   $(obj)gpimage-common.o \
$(obj)image.o \
$(obj)imagetool.o \
$(obj)image-host.o \
diff --git a/tools/gpheader.h b/tools/gpheader.h
new file mode 100644
index 000..63a28a2
--- /dev/null
+++ b/tools/gpheader.h
@@ -0,0 +1,40 @@
+/*
+ * (C) Copyright 2014
+ * Texas Instruments Incorporated
+ * Refactored common functions in to gpimage-common.c. Include this common
+ * header file
+ *
+ * (C) Copyright 2010
+ * Linaro LTD, www.linaro.org
+ * Author: John Rigby john.ri...@linaro.org
+ * Based on TI's signGP.c
+ *
+ * (C) Copyright 2009
+ * Stefano Babic, DENX Software Engineering, sba...@denx.de.
+ *
+ * (C) Copyright 2008
+ * Marvell Semiconductor www.marvell.com
+ * Written-by: Prafulla Wadaskar prafu...@marvell.com
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#ifndef _GPIMAGE_H_
+#define _GPIMAGE_H_
+
+/* common headers for gpimage and omapimage formats */
+struct gp_header {
+   uint32_t size;
+   uint32_t load_addr;
+};
+#define GPIMAGE_HDR_SIZE (sizeof(struct gp_header))
+
+/* common functions across gpimage and omapimage handlers */
+int valid_gph_size(uint32_t size);
+int valid_gph_load_addr(uint32_t load_addr);
+int gph_verify_header(struct gp_header *gph, int be);
+void gph_print_header(const struct gp_header *gph, int be);
+void gph_set_header(struct gp_header *gph, uint32_t size, uint32_t load_addr,
+   int be);
+int gpimage_check_params(struct image_tool_params *params);
+#endif
diff --git a/tools/gpimage-common.c 

[U-Boot] [PATCH 2/2] serial/serial_arc: switch from {read|write}l to {read|write}b accessors

2014-02-07 Thread Alexey Brodkin
This is required for proper functionality on big-endian targets.
Memory-mapped registres of ARC UART are not 32-bit words but 8-bit bytes
so on little-endian target either acessor (_l or _b) works fine.
On big-endian only _b accessors works as expected.

Signed-off-by: Alexey Brodkin abrod...@synopsys.com

Cc: Vineet Gupta vgu...@synopsys.com
Cc: Noam Camus no...@ezchip.com
Cc: Tom Rini tr...@ti.com
---
 drivers/serial/serial_arc.c | 18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/serial/serial_arc.c b/drivers/serial/serial_arc.c
index 55d0769..b21b12b 100644
--- a/drivers/serial/serial_arc.c
+++ b/drivers/serial/serial_arc.c
@@ -38,7 +38,7 @@ static void arc_serial_setbrg(void)
gd-baudrate = CONFIG_BAUDRATE;
 
arc_console_baud = gd-cpu_clk / (gd-baudrate * 4) - 1;
-   writel(arc_console_baud  0xff, regs-baudl);
+   writeb(arc_console_baud  0xff, regs-baudl);
 
 #ifdef CONFIG_ARC
/*
@@ -50,11 +50,11 @@ static void arc_serial_setbrg(void)
 * Until that is fixed, when running on ISS, we will set baudh to !0
 */
if (gd-arch.running_on_hw)
-   writel((arc_console_baud  0xff00)  8, regs-baudh);
+   writeb((arc_console_baud  0xff00)  8, regs-baudh);
else
-   writel(1, regs-baudh);
+   writeb(1, regs-baudh);
 #else
-   writel((arc_console_baud  0xff00)  8, regs-baudh);
+   writeb((arc_console_baud  0xff00)  8, regs-baudh);
 #endif
 }
 
@@ -70,15 +70,15 @@ static void arc_serial_putc(const char c)
if (c == '\n')
arc_serial_putc('\r');
 
-   while (!(readl(regs-status)  UART_TXEMPTY))
+   while (!(readb(regs-status)  UART_TXEMPTY))
;
 
-   writel(c, regs-data);
+   writeb(c, regs-data);
 }
 
 static int arc_serial_tstc(void)
 {
-   return !(readl(regs-status)  UART_RXEMPTY);
+   return !(readb(regs-status)  UART_RXEMPTY);
 }
 
 static int arc_serial_getc(void)
@@ -87,10 +87,10 @@ static int arc_serial_getc(void)
;
 
/* Check for overflow errors */
-   if (readl(regs-status)  UART_OVERFLOW_ERR)
+   if (readb(regs-status)  UART_OVERFLOW_ERR)
return 0;
 
-   return readl(regs-data)  0xFF;
+   return readb(regs-data)  0xFF;
 }
 
 static void arc_serial_puts(const char *s)
-- 
1.8.5.3

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


[U-Boot] [PATCH 1/2] serial/serial_arc: add work-around of ISS bug

2014-02-07 Thread Alexey Brodkin
Explanation is in in-lined comment.

Signed-off-by: Alexey Brodkin abrod...@synopsys.com

Cc: Vineet Gupta vgu...@synopsys.com
Cc: Noam Camus no...@ezchip.com
Cc: Tom Rini tr...@ti.com
---
 drivers/serial/serial_arc.c | 16 
 1 file changed, 16 insertions(+)

diff --git a/drivers/serial/serial_arc.c b/drivers/serial/serial_arc.c
index e63d25d..55d0769 100644
--- a/drivers/serial/serial_arc.c
+++ b/drivers/serial/serial_arc.c
@@ -39,7 +39,23 @@ static void arc_serial_setbrg(void)
 
arc_console_baud = gd-cpu_clk / (gd-baudrate * 4) - 1;
writel(arc_console_baud  0xff, regs-baudl);
+
+#ifdef CONFIG_ARC
+   /*
+* UART ISS(Instruction Set simulator) emulation has a subtle bug:
+* A existing value of Baudh = 0 is used as a indication to startup
+* it's internal state machine.
+* Thus if baudh is set to 0, 2 times, it chokes.
+* This happens with BAUD=115200 and the formaula above
+* Until that is fixed, when running on ISS, we will set baudh to !0
+*/
+   if (gd-arch.running_on_hw)
+   writel((arc_console_baud  0xff00)  8, regs-baudh);
+   else
+   writel(1, regs-baudh);
+#else
writel((arc_console_baud  0xff00)  8, regs-baudh);
+#endif
 }
 
 static int arc_serial_init(void)
-- 
1.8.5.3

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


[U-Boot] [PATCH 0/2] Post-mainline updates of serial_arc driver

2014-02-07 Thread Alexey Brodkin
serial_arc driver didn't exist in U-Boot Master branch until supoort of ARC700
architecture was accepted yesterday.

Because of that there was no way to apply pathes to initially approved version
searial_arc driver.

So now when driver is in U-Boot source tree it's time to submit 2 minor fixes
that are required for propoer driver operation in:
 * Simulation
 * On big-endian machines

Alexey Brodkin (2):
  serial/serial_arc: add work-around of ISS bug
  serial/serial_arc: switch from {read|write}l to {read|write}b
accessors

 drivers/serial/serial_arc.c | 30 +++---
 1 file changed, 23 insertions(+), 7 deletions(-)

-- 
1.8.5.3

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


[U-Boot] [PATCH] axs101: fix dw gmac instantiation for updated dw gmac driver

2014-02-07 Thread Alexey Brodkin
With accepted change to DW GMAC driver -
92a190aaab3536d695c51e0739f925910eb49889 (net/designware - switch driver
to phylib usage) we need to update this board because
designware_initialize now accepts only 2 parameters instead of 4.

Cc: Vineet Gupta vgu...@synopsys.com
Cc: Tom Rini tr...@ti.com

Signed-off-by: Alexey Brodkin abrod...@synopsys.com
---
 board/synopsys/axs101/axs101.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/board/synopsys/axs101/axs101.c b/board/synopsys/axs101/axs101.c
index 4dbeaea..d1271ff 100644
--- a/board/synopsys/axs101/axs101.c
+++ b/board/synopsys/axs101/axs101.c
@@ -36,7 +36,7 @@ int board_mmc_init(bd_t *bis)
 
 int board_eth_init(bd_t *bis)
 {
-   if (designware_initialize(0, ARC_DWGMAC_BASE, 0,
+   if (designware_initialize(ARC_DWGMAC_BASE,
  PHY_INTERFACE_MODE_RGMII) = 0)
return 1;
 
-- 
1.8.5.3

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


[U-Boot] [PATCH] axs101: change command prompt marker to match marketing name of the board

2014-02-07 Thread Alexey Brodkin
Proper spelling of the boad marketing name is with upper case.
So changing it from lower case to upper case here.

Cc: Tom Rini tr...@ti.com

Signed-off-by: Alexey Brodkin abrod...@synopsys.com
---
 include/configs/axs101.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/configs/axs101.h b/include/configs/axs101.h
index af2e63b..f6b569a 100644
--- a/include/configs/axs101.h
+++ b/include/configs/axs101.h
@@ -167,7 +167,7 @@
  * Console configuration
  */
 #define CONFIG_SYS_LONGHELP
-#define CONFIG_SYS_PROMPT  axs# 
+#define CONFIG_SYS_PROMPT  AXS# 
 #define CONFIG_SYS_CBSIZE  256
 #define CONFIG_SYS_BARGSIZECONFIG_SYS_CBSIZE
 #define CONFIG_SYS_PBSIZE  (CONFIG_SYS_CBSIZE + \
-- 
1.8.5.3

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


[U-Boot] [PATCH] serial: arc: Convert to use default_serial_puts

2014-02-07 Thread Axel Lin
Use default_serial_puts() instead of duplicating the implementation.

Signed-off-by: Axel Lin axel@ingics.com
---
 drivers/serial/serial_arc.c | 8 +---
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/drivers/serial/serial_arc.c b/drivers/serial/serial_arc.c
index e63d25d..fd56ca3 100644
--- a/drivers/serial/serial_arc.c
+++ b/drivers/serial/serial_arc.c
@@ -77,19 +77,13 @@ static int arc_serial_getc(void)
return readl(regs-data)  0xFF;
 }
 
-static void arc_serial_puts(const char *s)
-{
-   while (*s)
-   arc_serial_putc(*s++);
-}
-
 static struct serial_device arc_serial_drv = {
.name   = arc_serial,
.start  = arc_serial_init,
.stop   = NULL,
.setbrg = arc_serial_setbrg,
.putc   = arc_serial_putc,
-   .puts   = arc_serial_puts,
+   .puts   = default_serial_puts,
.getc   = arc_serial_getc,
.tstc   = arc_serial_tstc,
 };
-- 
1.8.1.2



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