Re: [U-Boot] [PATCH v2 0/4] New tag for Flattened Image Trees (FIT) - Booting Xen from a FIT.

2015-05-18 Thread Simon Glass
+Tom in case he has a comment

Hi Karl,

On 15 May 2015 at 15:13, Karl Apsite karl.aps...@dornerworks.com wrote:

 The FIT config now supports a tag named loadables: which is a
 comma separated list.  Users can add any number of images to the list,
 and u-boot will move the selected binaries to their listed
 load_addresses. This allows u-boot to boot xen from using an FIT
 configuration.  Xen expects a kernel to be placed at a predetermined
 location, however the kernel field was already filled by xen itself.
 This change allows the user to move the required binary before xen
 boots, all within the FIT's configuration.


I think I've convinced myself that this ('loadables') is a good
solution to the problem. I'm not 100% comfortable with the name but I
don't have a better one, and no one else has chimed in.

Will you actually use multiple images in your application?


 Karl Apsite (4):
   add test for two 'loadables'
   mkimage will now report information about loadable
   add boot_get_loadables() to load listed images
   Combine bootm_find_thing functions together

  common/bootm.c| 49 ---
  common/cmd_bootm.c|  4 +-
  common/image-fit.c| 25 +++-
  common/image.c| 71 ++
  doc/uImage.FIT/source_file_format.txt |  4 ++
  include/bootm.h   |  2 +-
  include/bootstage.h   |  1 +
  include/image.h   | 28 +-
  test/image/test-fit.py| 73 
 ++-
  9 files changed, 221 insertions(+), 36 deletions(-)

 --
 2.3.7


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


[U-Boot] [PATCH v5 1/4] dm: sf: Add Atmel DataFlash spi flash driver

2015-05-18 Thread Haikun Wang
Atmel DataFlash chips have commands different from common spi
flash commands.
Atmel DataFlash also have special page-size.
This driver add support for accessing Atmel DataFlash.
It is based on the Driver Model.
Example:
= sf probe 1:0
SPI DataFlash: Detected AT45DB021B with page size 264 Bytes, erase size 264 
Bytes, total 264 KiB, revision d
= sf erase 0 42000
SF: 270336 bytes @ 0x0 Erased: OK
= mw.l 8200 45444342 2
= sf write 8200 0 42000
SF: 270336 bytes @ 0x0 Written: OK
= sf read 8300 0 42000
SF: 270336 bytes @ 0x0 Read: OK
= cmp.b 8200 8300 42000
Total of 270336 byte(s) were the same

Signed-off-by: Haikun Wang haikun.w...@freescale.com
---
Verified with AT45DB021B on LS1021AQDS.
Changes in v5:
- Change CONFIG_DM_SF_DATAFLASH to CONFIG_SF_DATAFLASH

Changes in v4:
- Use dev_get_priv and dev_get_uclass_priv
- Add test log to commit message

Changes in v3:
- 1. Rename file spi_dataflash.c to sf_dataflash.c
- 2. Add comment for array dataflash_data

Changes in v2:
- 1. Correct comment style
- 2. Use get_timer in dataflash_waitready to check whether timeout
- 3. Remove struct spi_flash * in struct dataflash, and get it from 
udevice-uclass_priv
- 4. Replace spi_flash_write_common with spi_flash_cmd_write 
- 5. Replace spi_flash_read with spi_flash_cmd_read 
- 6. Change type of varible status form char to u8 in dataflash_status
- 7. Change add_dataflash's argument type due to change 3
- 8. Add claim_bus and release_bus in erase/write/read due to change 4  5

Changes in v1: None
 drivers/mtd/spi/Makefile   |   1 +
 drivers/mtd/spi/sf_dataflash.c | 711 +
 2 files changed, 712 insertions(+)
 create mode 100644 drivers/mtd/spi/sf_dataflash.c

diff --git a/drivers/mtd/spi/Makefile b/drivers/mtd/spi/Makefile
index c61b784..87f20bc 100644
--- a/drivers/mtd/spi/Makefile
+++ b/drivers/mtd/spi/Makefile
@@ -15,6 +15,7 @@ endif
 #ifndef CONFIG_DM_SPI
 obj-$(CONFIG_SPI_FLASH) += sf_probe.o
 #endif
+obj-$(CONFIG_SF_DATAFLASH) += sf_dataflash.o
 obj-$(CONFIG_CMD_SF) += sf.o
 obj-$(CONFIG_SPI_FLASH) += sf_ops.o sf_params.o
 obj-$(CONFIG_SPI_FLASH_SANDBOX) += sandbox.o
diff --git a/drivers/mtd/spi/sf_dataflash.c b/drivers/mtd/spi/sf_dataflash.c
new file mode 100644
index 000..d287db8
--- /dev/null
+++ b/drivers/mtd/spi/sf_dataflash.c
@@ -0,0 +1,711 @@
+/*
+ *
+ * Atmel DataFlash probing
+ *
+ * Copyright (C) 2004-2009, 2015 Freescale Semiconductor, Inc.
+ * Haikun Wang (haikun.w...@freescale.com)
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+*/
+#include common.h
+#include dm.h
+#include errno.h
+#include fdtdec.h
+#include spi.h
+#include spi_flash.h
+#include div64.h
+#include linux/err.h
+#include linux/math64.h
+
+#include sf_internal.h
+
+/*
+ * DataFlash is a kind of SPI flash.  Most AT45 chips have two buffers in
+ * each chip, which may be used for double buffered I/O; but this driver
+ * doesn't (yet) use these for any kind of i/o overlap or prefetching.
+ *
+ * Sometimes DataFlash is packaged in MMC-format cards, although the
+ * MMC stack can't (yet?) distinguish between MMC and DataFlash
+ * protocols during enumeration.
+ */
+
+/* reads can bypass the buffers */
+#define OP_READ_CONTINUOUS 0xE8
+#define OP_READ_PAGE   0xD2
+
+/* group B requests can run even while status reports busy */
+#define OP_READ_STATUS 0xD7/* group B */
+
+/* move data between host and buffer */
+#define OP_READ_BUFFER10xD4/* group B */
+#define OP_READ_BUFFER20xD6/* group B */
+#define OP_WRITE_BUFFER1   0x84/* group B */
+#define OP_WRITE_BUFFER2   0x87/* group B */
+
+/* erasing flash */
+#define OP_ERASE_PAGE  0x81
+#define OP_ERASE_BLOCK 0x50
+
+/* move data between buffer and flash */
+#define OP_TRANSFER_BUF1   0x53
+#define OP_TRANSFER_BUF2   0x55
+#define OP_MREAD_BUFFER1   0xD4
+#define OP_MREAD_BUFFER2   0xD6
+#define OP_MWERASE_BUFFER1 0x83
+#define OP_MWERASE_BUFFER2 0x86
+#define OP_MWRITE_BUFFER1  0x88/* sector must be pre-erased */
+#define OP_MWRITE_BUFFER2  0x89/* sector must be pre-erased */
+
+/* write to buffer, then write-erase to flash */
+#define OP_PROGRAM_VIA_BUF10x82
+#define OP_PROGRAM_VIA_BUF20x85
+
+/* compare buffer to flash */
+#define OP_COMPARE_BUF10x60
+#define OP_COMPARE_BUF20x61
+
+/* read flash to buffer, then write-erase to flash */
+#define OP_REWRITE_VIA_BUF10x58
+#define OP_REWRITE_VIA_BUF20x59
+
+/*
+ * newer chips report JEDEC manufacturer and device IDs; chip
+ * serial number and OTP bits; and per-sector writeprotect.
+ */
+#define OP_READ_ID 0x9F
+#define OP_READ_SECURITY   0x77
+#define OP_WRITE_SECURITY_REVC 0x9A
+#define OP_WRITE_SECURITY  0x9B/* revision D */
+
+
+struct dataflash {
+   uint8_t command[16];
+   unsigned short  page_offset;/* offset in flash address */
+};
+

[U-Boot] [PATCH v1 2/4] dm: ls1021aqds: dts: Use spi_dataflash driver instead of spi_flash_std for DSPI flash

2015-05-18 Thread Haikun Wang
The type of DSPI flash on ls1021aqds is AT45DB021, it has specail
commands and page-size.
Use the special spi flash driver instead of spi_flash_std driver.

Signed-off-by: Haikun Wang haikun.w...@freescale.com
---
 arch/arm/dts/ls1021a-qds.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/dts/ls1021a-qds.dts b/arch/arm/dts/ls1021a-qds.dts
index 8367811..e634292 100644
--- a/arch/arm/dts/ls1021a-qds.dts
+++ b/arch/arm/dts/ls1021a-qds.dts
@@ -30,7 +30,7 @@
dspiflash: at45db021d@0 {
#address-cells = 1;
#size-cells = 1;
-   compatible = spi-flash;
+   compatible = atmel,dataflash;
spi-max-frequency = 1600;
spi-cpol;
spi-cpha;
-- 
2.1.0.27.g96db324

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


[U-Boot] [Patch v3 3/4] imx: mx6: add display of CPU temperature grade in print_cpuinfo()

2015-05-18 Thread Tim Harvey
When CONFIG_IMX6_THERMAL is defined print the CPU temperature grade info
along with the current temperature.

Before:
 CPU:   Temperature 42 C

After:
 CPU:   Automotive temperature grade (-40C to 125C) at 42C
 CPU:   Industrial temperature grade (-40C to 105C) at 42C
 CPU:   Extended Commercial temperature grade (-20C to 105C) at 42C

Cc: Stefan Roese s...@denx.de
Cc: Eric Nelson eric.nel...@boundarydevices.com
Cc: Heiko Schocher h...@denx.de
Cc: Nikita Kiryanov nik...@compulab.co.il
Cc: Jon Nettleton jon.nettle...@gmail.com
Cc: Jason Liu r64...@freescale.com
Cc: Ye Li b37...@freescale.com
Cc: Fabio Estevam fabio.este...@freescale.com
Cc: Christian Gmeiner christian.gmei...@gmail.com
Cc: Markus Niebel markus.nie...@tq-group.com
Cc: Peng Fan b51...@freescale.com
Tested-by: Nikolay Dimitrov picmas...@mail.bg
Signed-off-by: Tim Harvey thar...@gateworks.com
---
v3:
 - remove check for IMX6SX - it supports the same OTP regs/definitions for this
 - fixed typo in commit message
 - added Nokolay's tested by
v2:
 - moved display of CPU temperature grade to own patch and combined with the
   current temperature from the thermal sensor driver
 - add example output to description

Signed-off-by: Tim Harvey thar...@gateworks.com
---
 arch/arm/imx-common/cpu.c | 25 +
 1 file changed, 21 insertions(+), 4 deletions(-)

diff --git a/arch/arm/imx-common/cpu.c b/arch/arm/imx-common/cpu.c
index 6b20482..5be07a2 100644
--- a/arch/arm/imx-common/cpu.c
+++ b/arch/arm/imx-common/cpu.c
@@ -16,6 +16,7 @@
 #include asm/arch/clock.h
 #include asm/arch/sys_proto.h
 #include asm/arch/crm_regs.h
+#include imx_thermal.h
 #include ipu_pixfmt.h
 #include thermal.h
 #include sata.h
@@ -146,7 +147,7 @@ int print_cpuinfo(void)
 
 #if defined(CONFIG_MX6)  defined(CONFIG_IMX6_THERMAL)
struct udevice *thermal_dev;
-   int cpu_tmp, ret;
+   int cpu_tmp, minc, maxc, ret;
 #endif
 
cpurev = get_cpu_rev();
@@ -172,16 +173,32 @@ int print_cpuinfo(void)
 #endif
 
 #if defined(CONFIG_MX6)  defined(CONFIG_IMX6_THERMAL)
+   puts(CPU:   );
+   switch (get_cpu_temp_grade(minc, maxc)) {
+   case TEMP_AUTOMOTIVE:
+   puts(Automotive temperature grade );
+   break;
+   case TEMP_INDUSTRIAL:
+   puts(Industrial temperature grade );
+   break;
+   case TEMP_EXTCOMMERCIAL:
+   puts(Extended Commercial temperature grade );
+   break;
+   default:
+   puts(Commercial temperature grade );
+   break;
+   }
+   printf((%dC to %dC), minc, maxc);
ret = uclass_get_device(UCLASS_THERMAL, 0, thermal_dev);
if (!ret) {
ret = thermal_get_temp(thermal_dev, cpu_tmp);
 
if (!ret)
-   printf(CPU:   Temperature %d C\n, cpu_tmp);
+   printf( at %dC\n, cpu_tmp);
else
-   printf(CPU:   Temperature: invalid sensor data\n);
+   puts( - invalid sensor data\n);
} else {
-   printf(CPU:   Temperature: Can't find sensor device\n);
+   puts( - invalid sensor device\n);
}
 #endif
 
-- 
1.9.1

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


[U-Boot] [Patch v3 2/4] imx: mx6: add get_cpu_temp_grade to obtain cpu temperature grade from OTP

2015-05-18 Thread Tim Harvey
The MX6 has a temperature grade defined by OCOTP_MEM0[7:6] which is at 0x480
in the Fusemap Description Table in the reference manual. Return this value
as well as min/max temperature based on the value.

Note that the IMX6SDLRM and the IMX6SXRM do not indicate this in the
their Fusemap Description Table however Freescale has confirmed that these
eFUSE bits match the description within the IMX6DQRM and that they will
be added to the next revision of the respective reference manuals.

This has been tested with IMX6 Automative and Industrial parts.

Signed-off-by: Tim Harvey thar...@gateworks.com
---
v2:
 - split out adding get_cpu_temp_grade to its own patch
 - added note about support of MX6SDL and MX6SX

Signed-off-by: Tim Harvey thar...@gateworks.com
---
 arch/arm/cpu/armv7/mx6/soc.c  | 38 +++
 arch/arm/include/asm/arch-mx6/sys_proto.h |  1 +
 include/imx_thermal.h |  6 +
 3 files changed, 45 insertions(+)

diff --git a/arch/arm/cpu/armv7/mx6/soc.c b/arch/arm/cpu/armv7/mx6/soc.c
index 71fa1fb..6f501ac 100644
--- a/arch/arm/cpu/armv7/mx6/soc.c
+++ b/arch/arm/cpu/armv7/mx6/soc.c
@@ -124,6 +124,44 @@ u32 get_cpu_speed_grade_hz(void)
return 0;
 }
 
+/*
+ * OCOTP_MEM0[7:6] (see Fusemap Description Table offset 0x480)
+ * defines a 2-bit Temperature Grade
+ *
+ * return temperature grade and min/max temperature in celcius
+ */
+#define OCOTP_MEM0_TEMP_SHIFT  6
+
+u32 get_cpu_temp_grade(int *minc, int *maxc)
+{
+   struct ocotp_regs *ocotp = (struct ocotp_regs *)OCOTP_BASE_ADDR;
+   struct fuse_bank *bank = ocotp-bank[1];
+   struct fuse_bank1_regs *fuse =
+   (struct fuse_bank1_regs *)bank-fuse_regs;
+   uint32_t val;
+
+   val = readl(fuse-mem0);
+   val = OCOTP_MEM0_TEMP_SHIFT;
+   val = 0x3;
+
+   if (minc  maxc) {
+   if (val == TEMP_AUTOMOTIVE) {
+   *minc = -40;
+   *maxc = 125;
+   } else if (val == TEMP_INDUSTRIAL) {
+   *minc = -40;
+   *maxc = 105;
+   } else if (val == TEMP_EXTCOMMERCIAL) {
+   *minc = -20;
+   *maxc = 105;
+   } else {
+   *minc = 0;
+   *maxc = 95;
+   }
+   }
+   return val;
+}
+
 #ifdef CONFIG_REVISION_TAG
 u32 __weak get_board_rev(void)
 {
diff --git a/arch/arm/include/asm/arch-mx6/sys_proto.h 
b/arch/arm/include/asm/arch-mx6/sys_proto.h
index a2cd0a9..c583291 100644
--- a/arch/arm/include/asm/arch-mx6/sys_proto.h
+++ b/arch/arm/include/asm/arch-mx6/sys_proto.h
@@ -17,6 +17,7 @@
 u32 get_nr_cpus(void);
 u32 get_cpu_rev(void);
 u32 get_cpu_speed_grade_hz(void);
+u32 get_cpu_temp_grade(int *minc, int *maxc);
 
 /* returns MXC_CPU_ value */
 #define cpu_type(rev) (((rev)  12)0xff)
diff --git a/include/imx_thermal.h b/include/imx_thermal.h
index be13652..8ce333c 100644
--- a/include/imx_thermal.h
+++ b/include/imx_thermal.h
@@ -8,6 +8,12 @@
 #ifndef _IMX_THERMAL_H_
 #define _IMX_THERMAL_H_
 
+/* CPU Temperature Grades */
+#define TEMP_COMMERCIAL 0
+#define TEMP_EXTCOMMERCIAL  1
+#define TEMP_INDUSTRIAL 2
+#define TEMP_AUTOMOTIVE 3
+
 struct imx_thermal_plat {
void *regs;
int fuse_bank;
-- 
1.9.1

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


Re: [U-Boot] [PATCH] arm/imx-common: Fix warning 'get_reset_cause' defined but not used

2015-05-18 Thread Eric Nelson
Hi Prabhakar,

On 05/18/2015 04:43 AM, Prabhakar Kushwaha wrote:
 Fix below warning
 arch/arm/imx-common/cpu.c:29:14: warning: ‘get_reset_cause’ defined but
 not used
  static char *get_reset_cause(void)
 
 Signed-off-by: Prabhakar Kushwaha prabha...@freescale.com
 ---
  arch/arm/imx-common/cpu.c | 2 ++
  1 file changed, 2 insertions(+)
 
 diff --git a/arch/arm/imx-common/cpu.c b/arch/arm/imx-common/cpu.c
 index 067d08f..0cd08cb 100644
 --- a/arch/arm/imx-common/cpu.c
 +++ b/arch/arm/imx-common/cpu.c
 @@ -24,6 +24,7 @@
  #include fsl_esdhc.h
  #endif
  
 +#if defined(CONFIG_DISPLAY_CPUINFO)
  static u32 reset_cause = -1;
  
  static char *get_reset_cause(void)
 @@ -60,6 +61,7 @@ u32 get_imx_reset_cause(void)
  {
   return reset_cause;
  }
 +#endif
  
  #if defined(CONFIG_MX53) || defined(CONFIG_MX6)
  #if defined(CONFIG_MX53)
 

This makes the dependency clear, even if it's odd.

Reviewed-by: Eric Nelson eric.nel...@boundarydevices.com

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


[U-Boot] [PATCH 02/11] dm: gpio: vf610: Add GPIO driver support

2015-05-18 Thread Bhuvanchandra DV
Add GPIO driver support to Freescale VF610

Signed-off-by: Bhuvanchandra DV bhuvanchandra...@toradex.com
---
 arch/arm/imx-common/iomux-v3.c |  26 +
 arch/arm/include/asm/arch-vf610/gpio.h |  29 +
 arch/arm/include/asm/arch-vf610/imx-regs.h |   5 +
 arch/arm/include/asm/imx-common/iomux-v3.h |   6 +
 drivers/gpio/Kconfig   |   7 ++
 drivers/gpio/Makefile  |   1 +
 drivers/gpio/vybrid_gpio.c | 169 +
 7 files changed, 243 insertions(+)
 create mode 100644 arch/arm/include/asm/arch-vf610/gpio.h
 create mode 100644 drivers/gpio/vybrid_gpio.c

diff --git a/arch/arm/imx-common/iomux-v3.c b/arch/arm/imx-common/iomux-v3.c
index e88e6e2..7fb23dd 100644
--- a/arch/arm/imx-common/iomux-v3.c
+++ b/arch/arm/imx-common/iomux-v3.c
@@ -92,3 +92,29 @@ void imx_iomux_set_gpr_register(int group, int start_bit,
reg |= (value  start_bit);
writel(reg, base + group * 4);
 }
+
+#ifdef CONFIG_IOMUX_SHARE_CONF_REG
+void imx_iomux_gpio_set_direction(unsigned int gpio,
+   unsigned int direction)
+{
+   u32 reg;
+   /*
+* Only on Vybrid the input/output buffer enable flags
+* are part of the shared mux/conf register.
+*/
+   reg = readl(base + (gpio  2));
+
+   if (direction)
+   reg |= 0x2;
+   else
+   reg = ~0x2;
+
+   writel(reg, base + (gpio  2));
+}
+
+void imx_iomux_gpio_get_function(unsigned int gpio, u32 *gpio_state)
+{
+   *gpio_state = readl(base + (gpio  2)) 
+   ((0X07  PAD_MUX_MODE_SHIFT) | PAD_CTL_OBE_IBE_ENABLE);
+}
+#endif
diff --git a/arch/arm/include/asm/arch-vf610/gpio.h 
b/arch/arm/include/asm/arch-vf610/gpio.h
new file mode 100644
index 000..622b8f0
--- /dev/null
+++ b/arch/arm/include/asm/arch-vf610/gpio.h
@@ -0,0 +1,29 @@
+/*
+ * Copyright (C) 2015
+ * Bhuvanchandra DV, Toradex, Inc.
+ *
+ * SPDX-License-Identifier:GPL-2.0
+ */
+
+#ifndef __ASM_ARCH_VF610_GPIO_H
+#define __ASM_ARCH_VF610_GPIO_H
+
+#define VYBRID_GPIO_COUNT  32
+#define VF610_GPIO_DIRECTION_IN0x0
+#define VF610_GPIO_DIRECTION_OUT   0x1
+
+/* GPIO registers */
+struct vybrid_gpio_regs {
+   u32 gpio_pdor;
+   u32 gpio_psor;
+   u32 gpio_pcor;
+   u32 gpio_ptor;
+   u32 gpio_pdir;
+};
+
+struct vybrid_gpio_platdata {
+   unsigned int chip;
+   u32 base;
+   const char *port_name;
+};
+#endif /* __ASM_ARCH_VF610_GPIO_H */
diff --git a/arch/arm/include/asm/arch-vf610/imx-regs.h 
b/arch/arm/include/asm/arch-vf610/imx-regs.h
index a7d765a..5a37193 100644
--- a/arch/arm/include/asm/arch-vf610/imx-regs.h
+++ b/arch/arm/include/asm/arch-vf610/imx-regs.h
@@ -81,6 +81,11 @@
 #define VREG_DIG_BASE_ADDR (AIPS0_BASE_ADDR + 0x0006D000)
 #define SRC_BASE_ADDR  (AIPS0_BASE_ADDR + 0x0006E000)
 #define CMU_BASE_ADDR  (AIPS0_BASE_ADDR + 0x0006F000)
+#define GPIO0_BASE_ADDR(AIPS0_BASE_ADDR + 0x000FF000)
+#define GPIO1_BASE_ADDR(AIPS0_BASE_ADDR + 0x000FF040)
+#define GPIO2_BASE_ADDR(AIPS0_BASE_ADDR + 0x000FF080)
+#define GPIO3_BASE_ADDR(AIPS0_BASE_ADDR + 0x000FF0C0)
+#define GPIO4_BASE_ADDR(AIPS0_BASE_ADDR + 0x000FF100)
 
 /* AIPS 1 */
 #define OCOTP_BASE_ADDR(AIPS1_BASE_ADDR + 0x00025000)
diff --git a/arch/arm/include/asm/imx-common/iomux-v3.h 
b/arch/arm/include/asm/imx-common/iomux-v3.h
index e0a49be..2581019 100644
--- a/arch/arm/include/asm/imx-common/iomux-v3.h
+++ b/arch/arm/include/asm/imx-common/iomux-v3.h
@@ -187,6 +187,12 @@ void imx_iomux_v3_setup_multiple_pads(iomux_v3_cfg_t const 
*pad_list,
 */
 void imx_iomux_set_gpr_register(int group, int start_bit,
 int num_bits, int value);
+#ifdef CONFIG_IOMUX_SHARE_CONF_REG
+void imx_iomux_gpio_set_direction(unsigned int gpio,
+   unsigned int direction);
+void imx_iomux_gpio_get_function(unsigned int gpio,
+   u32 *gpio_state);
+#endif
 
 /* macros for declaring and using pinmux array */
 #if defined(CONFIG_MX6QDL)
diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig
index 0840a30..0c43777 100644
--- a/drivers/gpio/Kconfig
+++ b/drivers/gpio/Kconfig
@@ -35,3 +35,10 @@ config SANDBOX_GPIO_COUNT
  are specified using the device tree. But you can also have a number
  of 'anonymous' GPIOs that do not belong to any device or bank.
  Select a suitable value depending on your needs.
+
+config VYBRID_GPIO
+   bool Vybrid GPIO driver
+   depends on DM
+   default n
+   help
+ Say yes here to support Vybrid vf610 GPIOs.
diff --git a/drivers/gpio/Makefile b/drivers/gpio/Makefile
index ba9efe8..5864850 100644
--- a/drivers/gpio/Makefile
+++ b/drivers/gpio/Makefile
@@ -45,3 +45,4 @@ obj-$(CONFIG_SUNXI_GPIO)  += sunxi_gpio.o
 obj-$(CONFIG_LPC32XX_GPIO) += 

[U-Boot] [PATCH 00/11] Add GPIO driver for Freescale Vybrid platform

2015-05-18 Thread Bhuvanchandra DV
This patch-set adds GPIO driver, DSPI and device tree support
for Freescale Vybrid platform and Toradex Colibri Vybrid VF50,
VF61 modules.

Following cases are tested with Vybrid GPIO driver:
- with DM, without DT
- with DM and DT
Both the above cases were tested on Toradex Colibri Vybrid VF50, VF61
modules and both works fine.

- The patchset is based and tested on the latest master branch.

Bhuvanchandra DV (9):
  dm: gpio: uclass: Add flag to control sequence numbering
  dm: gpio: vf610: Add GPIO driver support
  colibri_vf: Add pinmux entries for GPIOs
  colibri_vf: Enable GPIO support
  arm: vf610: Add clock support for DSPI
  arm: vf610: Add iomux support for DSPI
  vf610: dts: Add device tree support
  colibri-vf: Enable SPI support
  colibri_vf: Add separate defconfig for device tree support

Sanchayan Maity (2):
  usb: ehci-vf: Add weak function for board specific initialisation
  colibri_vf: Enable board specific USB initialisation for USB pen gpio

 arch/arm/cpu/armv7/vf610/generic.c|   7 ++
 arch/arm/dts/Makefile |   3 +
 arch/arm/dts/vf-colibri.dtsi  |  21 
 arch/arm/dts/vf.dtsi  | 100 +++
 arch/arm/dts/vf500-colibri.dts|  18 +++
 arch/arm/dts/vf610-colibri.dts|  18 +++
 arch/arm/imx-common/iomux-v3.c|  26 
 arch/arm/include/asm/arch-vf610/clock.h   |   1 +
 arch/arm/include/asm/arch-vf610/crm_regs.h|   4 +
 arch/arm/include/asm/arch-vf610/gpio.h|  29 +
 arch/arm/include/asm/arch-vf610/imx-regs.h|   5 +
 arch/arm/include/asm/arch-vf610/iomux-vf610.h |  59 +
 arch/arm/include/asm/imx-common/iomux-v3.h|   6 +
 board/toradex/colibri_vf/colibri_vf.c | 106 
 configs/colibri_vf_defconfig  |   1 +
 configs/colibri_vf_dtb_defconfig  |   6 +
 drivers/gpio/Kconfig  |   7 ++
 drivers/gpio/Makefile |   1 +
 drivers/gpio/gpio-uclass.c|   1 +
 drivers/gpio/vybrid_gpio.c| 169 ++
 drivers/usb/host/ehci-vf.c|   8 ++
 include/configs/colibri_vf.h  |  16 +++
 22 files changed, 612 insertions(+)
 create mode 100644 arch/arm/dts/vf-colibri.dtsi
 create mode 100644 arch/arm/dts/vf.dtsi
 create mode 100644 arch/arm/dts/vf500-colibri.dts
 create mode 100644 arch/arm/dts/vf610-colibri.dts
 create mode 100644 arch/arm/include/asm/arch-vf610/gpio.h
 create mode 100644 configs/colibri_vf_dtb_defconfig
 create mode 100644 drivers/gpio/vybrid_gpio.c

-- 
2.1.0

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


[U-Boot] [PATCH 04/11] colibri_vf: Enable GPIO support

2015-05-18 Thread Bhuvanchandra DV
Signed-off-by: Bhuvanchandra DV bhuvanchandra...@toradex.com
---
 configs/colibri_vf_defconfig | 1 +
 include/configs/colibri_vf.h | 5 +
 2 files changed, 6 insertions(+)

diff --git a/configs/colibri_vf_defconfig b/configs/colibri_vf_defconfig
index 0df337c..a527086 100644
--- a/configs/colibri_vf_defconfig
+++ b/configs/colibri_vf_defconfig
@@ -1,3 +1,4 @@
 CONFIG_ARM=y
 CONFIG_TARGET_COLIBRI_VF=y
 
CONFIG_SYS_EXTRA_OPTIONS=IMX_CONFIG=board/toradex/colibri_vf/imximage.cfg,ENV_IS_IN_NAND,IMX_NAND
+CONFIG_DM=y
diff --git a/include/configs/colibri_vf.h b/include/configs/colibri_vf.h
index 414600a..42555fb 100644
--- a/include/configs/colibri_vf.h
+++ b/include/configs/colibri_vf.h
@@ -55,6 +55,11 @@
 #define CONFIG_SYS_MAX_NAND_DEVICE 1
 #define CONFIG_SYS_NAND_BASE   NFC_BASE_ADDR
 
+/* GPIO support */
+#define CONFIG_DM_GPIO
+#define CONFIG_CMD_GPIO
+#define CONFIG_VYBRID_GPIO
+
 /* Dynamic MTD partition support */
 #define CONFIG_CMD_MTDPARTS/* Enable 'mtdparts' command line support */
 #define CONFIG_MTD_PARTITIONS
-- 
2.1.0

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


[U-Boot] [PATCH] arm: mx6: ddr: set fast-exit on DDR3 if pd_fast_exit specified

2015-05-18 Thread Tim Harvey
Commit fa8b7d66f49f0c7bd41467fe78f6488d8af6976a introduced fast-exit support
to the MMDC however enabling it on the DDR3 got missed. Make sure we enable
it on the DDR3 as well.

Gateworks uses Micron memory as well as Winbond in MX6. We have found in
testing that we need to enable fast-exit for Winbond stability. Gateworks
boards are currently the only boards using the MX6 SPL and enabling
fast-exit mode.

Signed-off-by: Tim Harvey thar...@gateworks.com
---
 arch/arm/cpu/armv7/mx6/ddr.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/arm/cpu/armv7/mx6/ddr.c b/arch/arm/cpu/armv7/mx6/ddr.c
index 653d58e..40df2ba 100644
--- a/arch/arm/cpu/armv7/mx6/ddr.c
+++ b/arch/arm/cpu/armv7/mx6/ddr.c
@@ -527,7 +527,8 @@ void mx6_dram_cfg(const struct mx6_ddr_sysinfo *sysinfo,
/* MR0 */
val = ((tcl - 1)  4) |/* CAS */
  (1  8)   |  /* DLL Reset */
- ((twr - 3)  9); /* Write Recovery */
+ ((twr - 3)  9) |/* Write Recovery */
+ (sysinfo-pd_fast_exit  12); /* Precharge PD PLL on */
debug(MR0 CS%d: 0x%08x\n, cs, (u32)MR(val, 0, 3, cs));
mmdc0-mdscr = MR(val, 0, 3, cs);
/* ZQ calibration */
-- 
1.9.1

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


Re: [U-Boot] [PATCH] arc: gitignore: ignore ARC DTBs

2015-05-18 Thread Alexey Brodkin
Hello Masahiro-san,

On Thu, 2015-05-14 at 18:59 +0900, Masahiro Yamada wrote:
 Signed-off-by: Masahiro Yamada yamada.masah...@socionext.com
 ---
 
  arch/arc/dts/.gitignore | 1 +
  1 file changed, 1 insertion(+)
  create mode 100644 arch/arc/dts/.gitignore
 
 diff --git a/arch/arc/dts/.gitignore b/arch/arc/dts/.gitignore
 new file mode 100644
 index 000..b60ed20
 --- /dev/null
 +++ b/arch/arc/dts/.gitignore
 @@ -0,0 +1 @@
 +*.dtb

Applied,
Thanks!

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


[U-Boot] [PATCH 01/11] dm: gpio: uclass: Add flag to control sequence numbering

2015-05-18 Thread Bhuvanchandra DV
Like SPI and I2C few GPIO controllers also have
multiple chip instances. This patch adds the
flag 'DM_UC_FLAG_SEQ_ALIAS' in gpio_uclass driver
to control device sequence numbering. By defalut
the dev-r_seq for gpio_uclass will alwalys
returns -1, which leads the gpio driver probe
failure when using the driver with device trees.

Signed-off-by: Bhuvanchandra DV bhuvanchandra...@toradex.com
---
 drivers/gpio/gpio-uclass.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpio/gpio-uclass.c b/drivers/gpio/gpio-uclass.c
index 530bb3e..bf982b9 100644
--- a/drivers/gpio/gpio-uclass.c
+++ b/drivers/gpio/gpio-uclass.c
@@ -757,6 +757,7 @@ static int gpio_pre_remove(struct udevice *dev)
 UCLASS_DRIVER(gpio) = {
.id = UCLASS_GPIO,
.name   = gpio,
+   .flags  = DM_UC_FLAG_SEQ_ALIAS,
.post_probe = gpio_post_probe,
.pre_remove = gpio_pre_remove,
.per_device_auto_alloc_size = sizeof(struct gpio_dev_priv),
-- 
2.1.0

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


[U-Boot] [PATCH 06/11] arm: vf610: Add iomux support for DSPI

2015-05-18 Thread Bhuvanchandra DV
Add iomux definitions for DSPI second instance.

Signed-off-by: Bhuvanchandra DV bhuvanchandra...@toradex.com
---
 arch/arm/include/asm/arch-vf610/iomux-vf610.h |  9 +
 board/toradex/colibri_vf/colibri_vf.c | 21 +
 2 files changed, 30 insertions(+)

diff --git a/arch/arm/include/asm/arch-vf610/iomux-vf610.h 
b/arch/arm/include/asm/arch-vf610/iomux-vf610.h
index e22e3f9..b8b22b1 100644
--- a/arch/arm/include/asm/arch-vf610/iomux-vf610.h
+++ b/arch/arm/include/asm/arch-vf610/iomux-vf610.h
@@ -35,6 +35,11 @@
 #define VF610_GPIO_PAD_CTRL(PAD_CTL_SPEED_MED | PAD_CTL_DSE_50ohm | \
PAD_CTL_PUS_47K_UP | PAD_CTL_IBE_ENABLE)
 
+#define VF610_DSPI_PAD_CTRL(PAD_CTL_OBE_ENABLE | PAD_CTL_DSE_20ohm | \
+   PAD_CTL_PUS_100K_UP | PAD_CTL_SPEED_HIGH)
+#define VF610_DSPI_SIN_PAD_CTRL(PAD_CTL_IBE_ENABLE | PAD_CTL_DSE_20ohm 
| \
+   PAD_CTL_PUS_100K_UP | PAD_CTL_SPEED_HIGH)
+
 enum {
VF610_PAD_PTA6__RMII0_CLKIN = IOMUX_PAD(0x, 0x, 2, 
__NA_, 0, VF610_ENET_PAD_CTRL),
VF610_PAD_PTA6__RMII0_CLKOUT= IOMUX_PAD(0x, 0x, 1, 
__NA_, 0, VF610_ENET_PAD_CTRL),
@@ -91,6 +96,10 @@ enum {
VF610_PAD_PTC15__RMII1_TD1  = IOMUX_PAD(0x00f0, 0x00f0, 1, 
__NA_, 0, VF610_ENET_PAD_CTRL),
VF610_PAD_PTC16__RMII1_TD0  = IOMUX_PAD(0x00f4, 0x00f4, 1, 
__NA_, 0, VF610_ENET_PAD_CTRL),
VF610_PAD_PTC17__RMII1_TXEN = IOMUX_PAD(0x00f8, 0x00f8, 1, 
__NA_, 0, VF610_ENET_PAD_CTRL),
+   VF610_PAD_PTD5__DSPI1_CS0   = IOMUX_PAD(0x0150, 0x0150, 3, 
0x300, 1, VF610_DSPI_PAD_CTRL),
+   VF610_PAD_PTD6__DSPI1_SIN   = IOMUX_PAD(0x0154, 0x0154, 3, 
0x2fc, 1, VF610_DSPI_SIN_PAD_CTRL),
+   VF610_PAD_PTD7__DSPI1_SOUT  = IOMUX_PAD(0x0158, 0x0158, 3, 
__NA_, 0, VF610_DSPI_PAD_CTRL),
+   VF610_PAD_PTD8__DSPI1_SCK   = IOMUX_PAD(0x015c, 0x015c, 3, 
0x2f8, 1, VF610_DSPI_PAD_CTRL),
VF610_PAD_PTC29__GPIO_102   = IOMUX_PAD(0x0198, 0x0198, 0, 
__NA_, 0, VF610_GPIO_PAD_CTRL),
VF610_PAD_PTC30__GPIO_103   = IOMUX_PAD(0x019c, 0x019c, 0, 
__NA_, 0, VF610_GPIO_PAD_CTRL),
VF610_PAD_PTA24__ESDHC1_CLK = IOMUX_PAD(0x0038, 0x0038, 5, 
__NA_, 0, VF610_SDHC_PAD_CTRL),
diff --git a/board/toradex/colibri_vf/colibri_vf.c 
b/board/toradex/colibri_vf/colibri_vf.c
index e354c6d..7173022 100644
--- a/board/toradex/colibri_vf/colibri_vf.c
+++ b/board/toradex/colibri_vf/colibri_vf.c
@@ -146,6 +146,20 @@ static void setup_iomux_nfc(void)
 }
 #endif
 
+#ifdef CONFIG_FSL_DSPI
+static void setup_iomux_dspi(void)
+{
+   static const iomux_v3_cfg_t dspi1_pads[] = {
+   VF610_PAD_PTD5__DSPI1_CS0,
+   VF610_PAD_PTD6__DSPI1_SIN,
+   VF610_PAD_PTD7__DSPI1_SOUT,
+   VF610_PAD_PTD8__DSPI1_SCK,
+   };
+
+   imx_iomux_v3_setup_multiple_pads(dspi1_pads, ARRAY_SIZE(dspi1_pads));
+}
+#endif
+
 #ifdef CONFIG_VYBRID_GPIO
 static void setup_iomux_gpio(void)
 {
@@ -252,6 +266,9 @@ static void clock_init(void)
 
clrsetbits_le32(ccm-ccgr0, CCM_REG_CTRL_MASK,
CCM_CCGR0_UART0_CTRL_MASK);
+#ifdef CONFIG_FSL_DSPI
+   setbits_le32(ccm-ccgr0, CCM_CCGR0_DSPI1_CTRL_MASK);
+#endif
clrsetbits_le32(ccm-ccgr1, CCM_REG_CTRL_MASK,
CCM_CCGR1_PIT_CTRL_MASK | CCM_CCGR1_WDOGA5_CTRL_MASK);
clrsetbits_le32(ccm-ccgr2, CCM_REG_CTRL_MASK,
@@ -364,6 +381,10 @@ int board_early_init_f(void)
setup_iomux_gpio();
 #endif
 
+#ifdef CONFIG_FSL_DSPI
+   setup_iomux_dspi();
+#endif
+
return 0;
 }
 
-- 
2.1.0

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


[U-Boot] [PATCH 11/11] colibri_vf: Enable board specific USB initialisation for USB pen gpio

2015-05-18 Thread Bhuvanchandra DV
From: Sanchayan Maity maitysancha...@gmail.com

Add IOMUX for the pad used as USB pen. This needs to be driven low for
the Iris and Viola boards where it is pulled up high by default. This is
required for the USB host functionality to work on these boards. Use the
board specific weak initialisation function, to drive the pin low which
would be called on usb start.

Signed-off-by: Sanchayan Maity maitysancha...@gmail.com
---
 arch/arm/include/asm/arch-vf610/iomux-vf610.h |  1 +
 board/toradex/colibri_vf/colibri_vf.c | 25 +
 2 files changed, 26 insertions(+)

diff --git a/arch/arm/include/asm/arch-vf610/iomux-vf610.h 
b/arch/arm/include/asm/arch-vf610/iomux-vf610.h
index b8b22b1..019307b 100644
--- a/arch/arm/include/asm/arch-vf610/iomux-vf610.h
+++ b/arch/arm/include/asm/arch-vf610/iomux-vf610.h
@@ -131,6 +131,7 @@ enum {
VF610_PAD_PTD1__QSPI0_A_CS0 = IOMUX_PAD(0x0140, 0x0140, 1, 
__NA_, 0, VF610_QSPI_PAD_CTRL),
VF610_PAD_PTD2__QSPI0_A_DATA3   = IOMUX_PAD(0x0144, 0x0144, 1, 
__NA_, 0, VF610_QSPI_PAD_CTRL),
VF610_PAD_PTD3__QSPI0_A_DATA2   = IOMUX_PAD(0x0148, 0x0148, 1, 
__NA_, 0, VF610_QSPI_PAD_CTRL),
+   VF610_PAD_PTD4__GPIO_83 = IOMUX_PAD(0x014C, 0x014C, 0, __NA_, 
0, VF610_GPIO_PAD_CTRL),
VF610_PAD_PTD4__QSPI0_A_DATA1   = IOMUX_PAD(0x014c, 0x014c, 1, 
__NA_, 0, VF610_QSPI_PAD_CTRL),
VF610_PAD_PTD5__QSPI0_A_DATA0   = IOMUX_PAD(0x0150, 0x0150, 1, 
__NA_, 0, VF610_QSPI_PAD_CTRL),
VF610_PAD_PTD7__QSPI0_B_QSCK= IOMUX_PAD(0x0158, 0x0158, 1, 
__NA_, 0, VF610_QSPI_PAD_CTRL),
diff --git a/board/toradex/colibri_vf/colibri_vf.c 
b/board/toradex/colibri_vf/colibri_vf.c
index 7173022..8618fd0 100644
--- a/board/toradex/colibri_vf/colibri_vf.c
+++ b/board/toradex/colibri_vf/colibri_vf.c
@@ -20,6 +20,7 @@
 #include netdev.h
 #include i2c.h
 #include g_dnl.h
+#include asm/gpio.h
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -32,6 +33,12 @@ DECLARE_GLOBAL_DATA_PTR;
 #define ENET_PAD_CTRL  (PAD_CTL_PUS_47K_UP | PAD_CTL_SPEED_HIGH | \
PAD_CTL_DSE_50ohm | PAD_CTL_OBE_IBE_ENABLE)
 
+#define USB_PEN_GPIO   83
+
+static const iomux_v3_cfg_t usb_pads[] = {
+   VF610_PAD_PTD4__GPIO_83,
+};
+
 int dram_init(void)
 {
static const struct ddr3_jedec_timings timings = {
@@ -464,3 +471,21 @@ int g_dnl_bind_fixup(struct usb_device_descriptor *dev, 
const char *name)
 
return 0;
 }
+
+#ifdef CONFIG_USB_EHCI_VF
+int board_ehci_hcd_init(int port)
+{
+   imx_iomux_v3_setup_multiple_pads(usb_pads, ARRAY_SIZE(usb_pads));
+
+   switch (port) {
+   case 0:
+   /* USBC does not have PEN, also configured as USB client only */
+   break;
+   case 1:
+   gpio_request(USB_PEN_GPIO, usb-pen-gpio);
+   gpio_direction_output(USB_PEN_GPIO, 0);
+   break;
+   }
+   return 0;
+}
+#endif
-- 
2.1.0

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


[U-Boot] [Patch v3 0/4] imx: mx6: use OTP for teperature grade info

2015-05-18 Thread Tim Harvey
Use Temperature grade info in OTP/eFUSE for thermal management and display of
thermal data.

Cc: Stefan Roese s...@denx.de
Cc: Eric Nelson eric.nel...@boundarydevices.com
Cc: Heiko Schocher h...@denx.de
Cc: Nikita Kiryanov nik...@compulab.co.il
Cc: Jon Nettleton jon.nettle...@gmail.com
Cc: Jason Liu r64...@freescale.com
Cc: Ye Li b37...@freescale.com
Cc: Fabio Estevam fabio.este...@freescale.com
Cc: Christian Gmeiner christian.gmei...@gmail.com
Cc: Markus Niebel markus.nie...@tq-group.com
Cc: Peng Fan b51...@freescale.com
Signed-off-by: Tim Harvey thar...@gateworks.com
---
v3:
 - include display of temperature grade for IMX6SX
v2:
 - split into two series: 1 for CPU frequency, other for Temperature grade

Tim Harvey (4):
  mx6: add OTP bank1 registers
  imx: mx6: add get_cpu_temp_grade to obtain cpu temperature grade from
OTP
  imx: mx6: add display of CPU temperature grade in print_cpuinfo()
  thermal: imx_thermal: use CPU temperature grade for trip points

 arch/arm/cpu/armv7/mx6/soc.c  | 38 +++
 arch/arm/imx-common/cpu.c | 25 
 arch/arm/include/asm/arch-mx6/imx-regs.h  | 19 
 arch/arm/include/asm/arch-mx6/sys_proto.h |  1 +
 drivers/thermal/imx_thermal.c | 29 +++
 include/imx_thermal.h |  6 +
 6 files changed, 104 insertions(+), 14 deletions(-)

-- 
1.9.1

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


[U-Boot] [PATCH] arc: significant cache rework

2015-05-18 Thread Alexey Brodkin
 [1] Align cache management functions to those in Linux kernel. I.e.:
a) Use the same functions for all cache ops (D$ Inv/Flush)
b) Split cache ops in 3 sub-functions: before, lineloop and
after. That way we may re-use before and after functions for
region and full cache ops.

 [2] Implement full-functional L2 (SLC) management. Before SLC was
simply disabled early on boot. It's also possible to enable or disable
L2 cache from config utility.

 [3] Disable/enable corresponding caches early on boot. So if U-Boot is
configured to use caches they will be used at all times (this is useful
in partucular for speed-up of relocation).

Signed-off-by: Alexey Brodkin abrod...@synopsys.com
---
 arch/arc/Kconfig   |  10 ++
 arch/arc/include/asm/arcregs.h |   5 +-
 arch/arc/include/asm/cache.h   |   7 +-
 arch/arc/lib/cache.c   | 378 -
 arch/arc/lib/cpu.c |   2 +
 arch/arc/lib/init_helpers.c|  10 +-
 arch/arc/lib/start.S   |  50 +-
 7 files changed, 317 insertions(+), 145 deletions(-)

diff --git a/arch/arc/Kconfig b/arch/arc/Kconfig
index 67d28d3..a8f82b1 100644
--- a/arch/arc/Kconfig
+++ b/arch/arc/Kconfig
@@ -130,6 +130,16 @@ config ARC_CACHE_LINE_SHIFT
  So line lengths of 32, 64, 128 are specified by 5,6,7, respectively
  Linux only supports same line lengths for I and D caches.
 
+config SYS_L2CACHE_OFF
+   bool Do not use L2 cache (AKA System-Level Cache, SLC)
+   default n
+   depends on ISA_ARCV2
+   depends on !SYS_DCACHE_OFF
+   help
+ ARC cores based on ISAv2 may have L2 cache, also known as SLC
+ (System-Level Cache).
+ Select this option to disable usage of L2 cache completely.
+
 choice
prompt Target select
optional
diff --git a/arch/arc/include/asm/arcregs.h b/arch/arc/include/asm/arcregs.h
index 0e11dcc..667f218 100644
--- a/arch/arc/include/asm/arcregs.h
+++ b/arch/arc/include/asm/arcregs.h
@@ -47,9 +47,12 @@
 #endif
 #define ARC_BCR_DC_BUILD   0x72
 #define ARC_BCR_SLC0xce
-#define ARC_AUX_SLC_CONTROL0x903
+#define ARC_AUX_SLC_CONFIG 0x901
+#define ARC_AUX_SLC_CTRL   0x903
 #define ARC_AUX_SLC_FLUSH  0x904
 #define ARC_AUX_SLC_INVALIDATE 0x905
+#define ARC_AUX_SLC_IVDL   0x910
+#define ARC_AUX_SLC_FLDL   0x912
 
 #ifndef __ASSEMBLY__
 /* Accessors for auxiliary registers */
diff --git a/arch/arc/include/asm/cache.h b/arch/arc/include/asm/cache.h
index 0b3ebd9..432606a 100644
--- a/arch/arc/include/asm/cache.h
+++ b/arch/arc/include/asm/cache.h
@@ -29,12 +29,7 @@
 
 #ifndef __ASSEMBLY__
 
-#ifdef CONFIG_ISA_ARCV2
-void slc_enable(void);
-void slc_disable(void);
-void slc_flush(void);
-void slc_invalidate(void);
-#endif
+void cache_init(void);
 
 #endif /* __ASSEMBLY__ */
 
diff --git a/arch/arc/lib/cache.c b/arch/arc/lib/cache.c
index e369e5a..3184803 100644
--- a/arch/arc/lib/cache.c
+++ b/arch/arc/lib/cache.c
@@ -5,9 +5,13 @@
  */
 
 #include config.h
+#include linux/compiler.h
+#include linux/kernel.h
 #include asm/arcregs.h
 #include asm/cache.h
 
+#define CACHE_LINE_MASK(~(CONFIG_SYS_CACHELINE_SIZE - 1))
+
 /* Bit values in IC_CTRL */
 #define IC_CTRL_CACHE_DISABLE  (1  0)
 
@@ -18,60 +22,193 @@
 #define CACHE_VER_NUM_MASK 0xF
 #define SLC_CTRL_SB(1  2)
 
+#define OP_INV 0x1
+#define OP_FLUSH   0x2
+#define OP_INV_IC  0x3
+
+#ifdef CONFIG_ISA_ARCV2
+/*
+ * By default that variable will fall into .bss section.
+ * But .bss section is not relocated and so it will be initilized before
+ * relocation but will be used after being zeroed.
+ */
+int slc_line_sz __section(.data);
+
+static inline int slc_exists(void)
+{
+   /* Check if System-Level Cahce is available */
+   if (read_aux_reg(ARC_BCR_SLC)  CACHE_VER_NUM_MASK)
+   return 1;
+   else
+   return 0;
+}
+
+#ifndef CONFIG_SYS_L2CACHE_OFF
+static unsigned int __before_slc_op(const int op)
+{
+   unsigned int reg = reg;
+
+   if (op == OP_INV) {
+   /*
+* IM is set by default and implies Flush-n-inv
+* Clear it here for vanilla inv
+*/
+   reg = read_aux_reg(ARC_AUX_SLC_CTRL);
+   write_aux_reg(ARC_AUX_SLC_CTRL, reg  ~DC_CTRL_INV_MODE_FLUSH);
+   }
+
+   return reg;
+}
+
+static void __after_slc_op(const int op, unsigned int reg)
+{
+   if (op  OP_FLUSH)  /* flush / flush-n-inv both wait */
+   while (read_aux_reg(ARC_AUX_SLC_CTRL) 
+  DC_CTRL_FLUSH_STATUS)
+   ;
+
+   /* Switch back to default Invalidate mode */
+   if (op == OP_INV)
+   write_aux_reg(ARC_AUX_SLC_CTRL, reg | DC_CTRL_INV_MODE_FLUSH);
+}
+
+static inline void __slc_line_loop(unsigned long paddr, unsigned long sz,
+  const int op)
+{
+   unsigned int aux_cmd;
+   int 

Re: [U-Boot] [PATCH 3/4] usb: board_usb_init and board_usb_cleanup calls in the fastboot command

2015-05-18 Thread Lukasz Majewski
Hi Paul,

 Each USB download function command calls board_usb_init before
 registering the USB gadget and board_usb_cleanup after de-registering
 it. On devices currently using fasboot, musb-new is usually
 initialized earlier, but some other boards might need the
 board_usb_init call to properly initialize musb-new.
 
 This requires adding an argument (the USB controller index) to the
 fastboot command, as it is currently done with other USB download
 gadget functions.
 
 Signed-off-by: Paul Kocialkowski cont...@paulk.fr
 ---
  common/cmd_fastboot.c | 31
 +-- include/configs/ti_omap5_common.h |
 2 +- 2 files changed, 26 insertions(+), 7 deletions(-)
 
 diff --git a/common/cmd_fastboot.c b/common/cmd_fastboot.c
 index d52ccfb..86fbddf 100644
 --- a/common/cmd_fastboot.c
 +++ b/common/cmd_fastboot.c
 @@ -10,11 +10,26 @@
  #include common.h
  #include command.h
  #include g_dnl.h
 +#include usb.h
  
  static int do_fastboot(cmd_tbl_t *cmdtp, int flag, int argc, char
 *const argv[]) {
 + int controller_index;
 + char *usb_controller;
   int ret;
  
 + if (argc  2)
 + return CMD_RET_USAGE;
 +
 + usb_controller = argv[1];
 + controller_index = simple_strtoul(usb_controller, NULL, 0);
 +
 + ret = board_usb_init(controller_index, USB_INIT_DEVICE);
 + if (ret) {
 + error(USB init failed: %d, ret);
 + return CMD_RET_FAILURE;
 + }
 +
   g_dnl_clear_detach();
   ret = g_dnl_register(usb_dnl_fastboot);
   if (ret)
 @@ -23,9 +38,8 @@ static int do_fastboot(cmd_tbl_t *cmdtp, int flag,
 int argc, char *const argv[]) if (!g_dnl_board_usb_cable_connected())
 { puts(\rUSB cable not detected.\n \
Command exit.\n);
 - g_dnl_unregister();
 - g_dnl_clear_detach();
 - return CMD_RET_FAILURE;
 + ret = CMD_RET_FAILURE;
 + goto exit;
   }
  
   while (1) {
 @@ -36,14 +50,19 @@ static int do_fastboot(cmd_tbl_t *cmdtp, int
 flag, int argc, char *const argv[]) usb_gadget_handle_interrupts(0);
   }
  
 + ret = CMD_RET_SUCCESS;
 +
 +exit:
   g_dnl_unregister();
   g_dnl_clear_detach();
 - return CMD_RET_SUCCESS;
 + board_usb_cleanup(controller_index, USB_INIT_DEVICE);
 +
 + return ret;
  }
  
  U_BOOT_CMD(
 - fastboot,   1,  0,  do_fastboot,
 + fastboot, 2, 1, do_fastboot,
   use USB Fastboot protocol,
 - \n
 + USB_controller\n
   - run as a fastboot usb device
  );
 diff --git a/include/configs/ti_omap5_common.h
 b/include/configs/ti_omap5_common.h index 3383491..dd1dcf5 100644
 --- a/include/configs/ti_omap5_common.h
 +++ b/include/configs/ti_omap5_common.h
 @@ -138,7 +138,7 @@
   if test ${dofastboot} -eq 1; then  \
   echo Boot fastboot requested, resetting
 dofastboot ...; \ setenv dofastboot 0; saveenv; \
 - echo Booting into fastboot ...; fastboot; \
 + echo Booting into fastboot ...; fastboot 0; \
   fi; \
   run findfdt;  \
   run mmcboot; \

Acked-by: Lukasz Majewski l.majew...@samsung.com

I will test this patch on my devices and then pull it to u-boot-dfu
tree.

Thanks for your work!

-- 
Best regards,

Lukasz Majewski

Samsung RD Institute Poland (SRPOL) | Linux Platform Group
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/4] usb: USB download gadget and functions config options coherent naming

2015-05-18 Thread Lukasz Majewski
Hi Paul,

 This introduces a coherent scheme for naming USB download gadget and
 functions config options. The download USB gadget config option is
 moved to CONFIG_USB_GADGET_DOWNLOAD for better consistency with other
 gadgets and each function's config option is moved to a
 CONFIG_USB_FUNCTION_ prefix.
 
 Signed-off-by: Paul Kocialkowski cont...@paulk.fr
 ---
  README| 2 +-
  board/samsung/common/Makefile | 2 +-
  board/siemens/common/factoryset.c | 4 ++--
  doc/README.android-fastboot   | 2 +-
  drivers/dfu/Makefile  | 2 +-
  drivers/usb/gadget/Makefile   | 8 
  include/configs/am335x_evm.h  | 4 ++--
  include/configs/am43xx_evm.h  | 4 ++--
  include/configs/bav335x.h | 6 +++---
  include/configs/colibri_vf.h  | 6 +++---
  include/configs/dra7xx_evm.h  | 4 ++--
  include/configs/exynos4-common.h  | 8 
  include/configs/gw_ventana.h  | 4 ++--
  include/configs/mx6sabre_common.h | 4 ++--
  include/configs/nitrogen6x.h  | 4 ++--
  include/configs/omap3_beagle.h| 2 +-
  include/configs/s5p_goni.h| 8 
  include/configs/siemens-am33x-common.h| 4 ++--
  include/configs/socfpga_common.h  | 6 +++---
  include/configs/tbs2910.h | 4 ++--
  include/configs/tegra-common-usb-gadget.h | 6 +++---
  include/configs/warp.h| 6 +++---
  include/configs/zynq-common.h | 6 +++---
  23 files changed, 53 insertions(+), 53 deletions(-)
 
 diff --git a/README b/README
 index 1ea397a..ba3fa49 100644
 --- a/README
 +++ b/README
 @@ -1672,7 +1672,7 @@ The following options need to be configured:
   key for the Replay Protection Memory Block partition
 in eMMC. 
  - USB Device Firmware Update (DFU) class support:
 - CONFIG_DFU_FUNCTION
 + CONFIG_USB_FUNCTION_DFU
   This enables the USB portion of the DFU USB class
  
   CONFIG_CMD_DFU
 diff --git a/board/samsung/common/Makefile
 b/board/samsung/common/Makefile index 93347ef..5fb01ce 100644
 --- a/board/samsung/common/Makefile
 +++ b/board/samsung/common/Makefile
 @@ -6,7 +6,7 @@
  #
  
  obj-$(CONFIG_SOFT_I2C_MULTI_BUS) += multi_i2c.o
 -obj-$(CONFIG_USBDOWNLOAD_GADGET) += gadget.o
 +obj-$(CONFIG_USB_GADGET_DOWNLOAD) += gadget.o
  obj-$(CONFIG_MISC_COMMON) += misc.o
  
  ifndef CONFIG_SPL_BUILD
 diff --git a/board/siemens/common/factoryset.c
 b/board/siemens/common/factoryset.c index d81f548..6c869ed 100644
 --- a/board/siemens/common/factoryset.c
 +++ b/board/siemens/common/factoryset.c
 @@ -144,7 +144,7 @@ int factoryset_read_eeprom(int i2c_addr)
   unsigned char eeprom_buf[0x3c00], hdr[4],
 buf[MAX_STRING_LENGTH]; unsigned char *cp, *cp1;
  
 -#if defined(CONFIG_DFU_FUNCTION)
 +#if defined(CONFIG_USB_FUNCTION_DFU)
   factory_dat.usb_vendor_id = CONFIG_G_DNL_VENDOR_NUM;
   factory_dat.usb_product_id = CONFIG_G_DNL_PRODUCT_NUM;
  #endif
 @@ -202,7 +202,7 @@ int factoryset_read_eeprom(int i2c_addr)
   cp1 += 3;
   }
  
 -#if defined(CONFIG_DFU_FUNCTION)
 +#if defined(CONFIG_USB_FUNCTION_DFU)
   /* read vid and pid for dfu mode */
   if (0 = get_factory_record_val(cp, size, (uchar *)USBD1,
   (uchar *)vid, buf,
 diff --git a/doc/README.android-fastboot b/doc/README.android-fastboot
 index 04411e9..c2a2418 100644
 --- a/doc/README.android-fastboot
 +++ b/doc/README.android-fastboot
 @@ -33,7 +33,7 @@ Board specific
  The fastboot gadget relies on the USB download gadget, so the
 following options must be configured:
  
 -CONFIG_USBDOWNLOAD_GADGET
 +CONFIG_USB_GADGET_DOWNLOAD
  CONFIG_G_DNL_VENDOR_NUM
  CONFIG_G_DNL_PRODUCT_NUM
  CONFIG_G_DNL_MANUFACTURER
 diff --git a/drivers/dfu/Makefile b/drivers/dfu/Makefile
 index 5cc535e..cebea30 100644
 --- a/drivers/dfu/Makefile
 +++ b/drivers/dfu/Makefile
 @@ -5,7 +5,7 @@
  # SPDX-License-Identifier:   GPL-2.0+
  #
  
 -obj-$(CONFIG_DFU_FUNCTION) += dfu.o
 +obj-$(CONFIG_USB_FUNCTION_DFU) += dfu.o
  obj-$(CONFIG_DFU_MMC) += dfu_mmc.o
  obj-$(CONFIG_DFU_NAND) += dfu_nand.o
  obj-$(CONFIG_DFU_RAM) += dfu_ram.o
 diff --git a/drivers/usb/gadget/Makefile b/drivers/usb/gadget/Makefile
 index 70bb550..46d7d94 100644
 --- a/drivers/usb/gadget/Makefile
 +++ b/drivers/usb/gadget/Makefile
 @@ -15,10 +15,10 @@ obj-$(CONFIG_USB_GADGET_S3C_UDC_OTG) +=
 s3c_udc_otg.o obj-$(CONFIG_USB_GADGET_S3C_UDC_OTG_PHY) +=
 s3c_udc_otg_phy.o obj-$(CONFIG_USB_GADGET_FOTG210) += fotg210.o
  obj-$(CONFIG_CI_UDC) += ci_udc.o
 -obj-$(CONFIG_THOR_FUNCTION) += f_thor.o
 -obj-$(CONFIG_USBDOWNLOAD_GADGET) += g_dnl.o
 -obj-$(CONFIG_DFU_FUNCTION) += f_dfu.o
 -obj-$(CONFIG_USB_GADGET_MASS_STORAGE) += f_mass_storage.o
 +obj-$(CONFIG_USB_GADGET_DOWNLOAD) += g_dnl.o
 +obj-$(CONFIG_USB_FUNCTION_THOR) += f_thor.o
 +obj-$(CONFIG_USB_FUNCTION_DFU) += 

Re: [U-Boot] [PATCH 2/4] usb: Fastboot function config for better consistency with other functions

2015-05-18 Thread Lukasz Majewski
Hi Paul,

 USB download gadget functions such as thor and dfu have a separate
 config option for the USB gadget part of the code, independent from
 the command part. This switches the fastboot USB gadget to the same
 scheme, for better consistency.
 
 Signed-off-by: Paul Kocialkowski cont...@paulk.fr
 ---
  README   | 3 +++
  arch/arm/cpu/armv7/omap-common/boot-common.c | 2 +-
  doc/README.android-fastboot  | 4 ++--
  drivers/usb/gadget/Makefile  | 2 +-
  include/configs/am335x_evm.h | 1 +
  include/configs/bav335x.h| 1 +
  include/configs/dra7xx_evm.h | 1 +
  include/configs/nitrogen6x.h | 1 +
  include/configs/omap3_beagle.h   | 1 +
  9 files changed, 12 insertions(+), 4 deletions(-)
 
 diff --git a/README b/README
 index ba3fa49..470210a 100644
 --- a/README
 +++ b/README
 @@ -1717,6 +1717,9 @@ The following options need to be configured:
   sending again an USB request to the device.
  
  - USB Device Android Fastboot support:
 + CONFIG_USB_FUNCTION_FASTBOOT
 + This enables the USB part of the fastboot gadget
 +
   CONFIG_CMD_FASTBOOT
   This enables the command fastboot which enables
 the Android fastboot mode for the platform's USB device. Fastboot is
 a USB diff --git a/arch/arm/cpu/armv7/omap-common/boot-common.c
 b/arch/arm/cpu/armv7/omap-common/boot-common.c index bbc6bed..7fc0a56
 100644 --- a/arch/arm/cpu/armv7/omap-common/boot-common.c
 +++ b/arch/arm/cpu/armv7/omap-common/boot-common.c
 @@ -163,7 +163,7 @@ void arch_preboot_os(void)
  }
  #endif
  
 -#if defined(CONFIG_CMD_FASTBOOT)  !defined(CONFIG_ENV_IS_NOWHERE)
 +#if defined(CONFIG_USB_FUNCTION_FASTBOOT)
  !defined(CONFIG_ENV_IS_NOWHERE) int fb_set_reboot_flag(void)
  {
   printf(Setting reboot to fastboot flag ...\n);
 diff --git a/doc/README.android-fastboot b/doc/README.android-fastboot
 index c2a2418..92f2897 100644
 --- a/doc/README.android-fastboot
 +++ b/doc/README.android-fastboot
 @@ -42,8 +42,8 @@ NOTE: The CONFIG_G_DNL_VENDOR_NUM must be one of
 the numbers supported by the fastboot client. The list of vendor IDs
 supported can be found in the fastboot client source code
 (fastboot.c) mentioned above. 
 -The fastboot function is enabled by defining CONFIG_CMD_FASTBOOT and
 -CONFIG_ANDROID_BOOT_IMAGE.
 +The fastboot function is enabled by defining
 CONFIG_USB_FUNCTION_FASTBOOT, +CONFIG_CMD_FASTBOOT and
 CONFIG_ANDROID_BOOT_IMAGE. 
  The fastboot protocol requires a large memory buffer for downloads.
 This buffer should be as large as possible for a platform. The
 location of the diff --git a/drivers/usb/gadget/Makefile
 b/drivers/usb/gadget/Makefile index 46d7d94..4e15323 100644
 --- a/drivers/usb/gadget/Makefile
 +++ b/drivers/usb/gadget/Makefile
 @@ -19,7 +19,7 @@ obj-$(CONFIG_USB_GADGET_DOWNLOAD) += g_dnl.o
  obj-$(CONFIG_USB_FUNCTION_THOR) += f_thor.o
  obj-$(CONFIG_USB_FUNCTION_DFU) += f_dfu.o
  obj-$(CONFIG_USB_FUNCTION_MASS_STORAGE) += f_mass_storage.o
 -obj-$(CONFIG_CMD_FASTBOOT) += f_fastboot.o
 +obj-$(CONFIG_USB_FUNCTION_FASTBOOT) += f_fastboot.o
  endif
  ifdef CONFIG_USB_ETHER
  obj-y += ether.o
 diff --git a/include/configs/am335x_evm.h
 b/include/configs/am335x_evm.h index b94e4b5..8aa3fd7 100644
 --- a/include/configs/am335x_evm.h
 +++ b/include/configs/am335x_evm.h
 @@ -298,6 +298,7 @@
  
  #ifndef CONFIG_SPL_USBETH_SUPPORT
  /* Fastboot */
 +#define CONFIG_USB_FUNCTION_FASTBOOT
  #define CONFIG_CMD_FASTBOOT
  #define CONFIG_ANDROID_BOOT_IMAGE
  #define CONFIG_USB_FASTBOOT_BUF_ADDR CONFIG_SYS_LOAD_ADDR
 diff --git a/include/configs/bav335x.h b/include/configs/bav335x.h
 index 7ce568b..99e3a00 100644
 --- a/include/configs/bav335x.h
 +++ b/include/configs/bav335x.h
 @@ -455,6 +455,7 @@ DEFAULT_LINUX_BOOT_ENV \
  
  #ifndef CONFIG_SPL_USBETH_SUPPORT
  /* Fastboot */
 +#define CONFIG_USB_FUNCTION_FASTBOOT
  #define CONFIG_CMD_FASTBOOT
  #define CONFIG_ANDROID_BOOT_IMAGE
  #define CONFIG_USB_FASTBOOT_BUF_ADDR CONFIG_SYS_LOAD_ADDR
 diff --git a/include/configs/dra7xx_evm.h
 b/include/configs/dra7xx_evm.h index c5ce741..0826235 100644
 --- a/include/configs/dra7xx_evm.h
 +++ b/include/configs/dra7xx_evm.h
 @@ -85,6 +85,7 @@
   DFU_ALT_INFO_RAM
  
  /* Fastboot */
 +#define CONFIG_USB_FUNCTION_FASTBOOT
  #define CONFIG_CMD_FASTBOOT
  #define CONFIG_ANDROID_BOOT_IMAGE
  #define CONFIG_USB_FASTBOOT_BUF_ADDRCONFIG_SYS_LOAD_ADDR
 diff --git a/include/configs/nitrogen6x.h
 b/include/configs/nitrogen6x.h index 53ee997..3ba7476 100644
 --- a/include/configs/nitrogen6x.h
 +++ b/include/configs/nitrogen6x.h
 @@ -416,6 +416,7 @@
  #define CONFIG_G_DNL_PRODUCT_NUM 0xa4a5
  #define CONFIG_G_DNL_MANUFACTURER Boundary
  
 +#define CONFIG_USB_FUNCTION_FASTBOOT
  #define CONFIG_CMD_FASTBOOT
  #define CONFIG_ANDROID_BOOT_IMAGE
  #define CONFIG_USB_FASTBOOT_BUF_ADDR   CONFIG_SYS_LOAD_ADDR
 diff --git 

Re: [U-Boot] [PATCH 4/4] usb: gadget: Weak board_usb_init/cleanup definitions in USB download gadget code

2015-05-18 Thread Lukasz Majewski
Hi Paul,

 Weak versions of board_usb_init and board_usb_cleanup are defined in
 common USB host code, but it is also used for USB device gadgets, so
 we also need a weak definition of it when there is no USB host
 enabled. Both weak definitions do not conflict.
 
 Signed-off-by: Paul Kocialkowski cont...@paulk.fr
 ---
  drivers/usb/gadget/g_dnl.c | 13 +
  1 file changed, 13 insertions(+)
 
 diff --git a/drivers/usb/gadget/g_dnl.c b/drivers/usb/gadget/g_dnl.c
 index ee52a29..ad89a0d 100644
 --- a/drivers/usb/gadget/g_dnl.c
 +++ b/drivers/usb/gadget/g_dnl.c
 @@ -12,6 +12,7 @@
  
  #include mmc.h
  #include part.h
 +#include usb.h
  
  #include g_dnl.h
  #include usb_mass_storage.h
 @@ -148,6 +149,18 @@ static int g_dnl_config_register(struct
 usb_composite_dev *cdev) }
  
  __weak
 +int board_usb_init(int index, enum usb_init_type init)
 +{
 + return 0;
 +}
 +
 +__weak
 +int board_usb_cleanup(int index, enum usb_init_type init)
 +{
 + return 0;
 +}
 +
 +__weak
  int g_dnl_bind_fixup(struct usb_device_descriptor *dev, const char
 *name) {
   return 0;

Acked-by: Lukasz Majewski l.majew...@samsung.com

I will test this patch on my devices and then pull it to u-boot-dfu
tree.

Thanks for your work!

-- 
Best regards,

Lukasz Majewski

Samsung RD Institute Poland (SRPOL) | Linux Platform Group
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 05/11] arm: vf610: Add clock support for DSPI

2015-05-18 Thread Bhuvanchandra DV
Signed-off-by: Bhuvanchandra DV bhuvanchandra...@toradex.com
---
 arch/arm/cpu/armv7/vf610/generic.c | 7 +++
 arch/arm/include/asm/arch-vf610/clock.h| 1 +
 arch/arm/include/asm/arch-vf610/crm_regs.h | 4 
 3 files changed, 12 insertions(+)

diff --git a/arch/arm/cpu/armv7/vf610/generic.c 
b/arch/arm/cpu/armv7/vf610/generic.c
index 1bb9b8e..05c401d 100644
--- a/arch/arm/cpu/armv7/vf610/generic.c
+++ b/arch/arm/cpu/armv7/vf610/generic.c
@@ -198,6 +198,11 @@ static u32 get_i2c_clk(void)
return get_ipg_clk();
 }
 
+static u32 get_dspi_clk(void)
+{
+   return get_ipg_clk();
+}
+
 unsigned int mxc_get_clock(enum mxc_clock clk)
 {
switch (clk) {
@@ -215,6 +220,8 @@ unsigned int mxc_get_clock(enum mxc_clock clk)
return get_fec_clk();
case MXC_I2C_CLK:
return get_i2c_clk();
+   case MXC_DSPI_CLK:
+   return get_dspi_clk();
default:
break;
}
diff --git a/arch/arm/include/asm/arch-vf610/clock.h 
b/arch/arm/include/asm/arch-vf610/clock.h
index 535adad..e5a5c6d 100644
--- a/arch/arm/include/asm/arch-vf610/clock.h
+++ b/arch/arm/include/asm/arch-vf610/clock.h
@@ -17,6 +17,7 @@ enum mxc_clock {
MXC_ESDHC_CLK,
MXC_FEC_CLK,
MXC_I2C_CLK,
+   MXC_DSPI_CLK,
 };
 
 void enable_ocotp_clk(unsigned char enable);
diff --git a/arch/arm/include/asm/arch-vf610/crm_regs.h 
b/arch/arm/include/asm/arch-vf610/crm_regs.h
index bc6db2a..fdb45e9 100644
--- a/arch/arm/include/asm/arch-vf610/crm_regs.h
+++ b/arch/arm/include/asm/arch-vf610/crm_regs.h
@@ -189,6 +189,8 @@ struct anadig_reg {
 #define CCM_REG_CTRL_MASK  0x
 #define CCM_CCGR0_UART0_CTRL_MASK   (0x3  14)
 #define CCM_CCGR0_UART1_CTRL_MASK  (0x3  16)
+#define CCM_CCGR0_DSPI0_CTRL_MASK  (0x3  24)
+#define CCM_CCGR0_DSPI1_CTRL_MASK  (0x3  26)
 #define CCM_CCGR1_USBC0_CTRL_MASK   (0x3  8)
 #define CCM_CCGR1_PIT_CTRL_MASK(0x3  14)
 #define CCM_CCGR1_WDOGA5_CTRL_MASK (0x3  28)
@@ -206,6 +208,8 @@ struct anadig_reg {
 #define CCM_CCGR4_GPC_CTRL_MASK(0x3  24)
 #define CCM_CCGR4_I2C0_CTRL_MASK   (0x3  12)
 #define CCM_CCGR6_OCOTP_CTRL_MASK  (0x3  10)
+#define CCM_CCGR6_DSPI2_CTRL_MASK  (0x3  24)
+#define CCM_CCGR6_DSPI3_CTRL_MASK  (0x3  26)
 #define CCM_CCGR6_DDRMC_CTRL_MASK  (0x3  28)
 #define CCM_CCGR7_SDHC1_CTRL_MASK  (0x3  4)
 #define CCM_CCGR7_USBC1_CTRL_MASK   (0x3  8)
-- 
2.1.0

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


[U-Boot] [PATCH 07/11] vf610: dts: Add device tree support

2015-05-18 Thread Bhuvanchandra DV
Add device tree files for Freescale Vybrid platform and
Toradex Colibri VF50, VF61 modules.
Device tree files are taken from upstream Kernel.
Removed the stuff which are not used/supported yet in U-Boot.

Signed-off-by: Bhuvanchandra DV bhuvanchandra...@toradex.com
---
 arch/arm/dts/Makefile  |   3 ++
 arch/arm/dts/vf-colibri.dtsi   |  21 +
 arch/arm/dts/vf.dtsi   | 100 +
 arch/arm/dts/vf500-colibri.dts |  18 
 arch/arm/dts/vf610-colibri.dts |  18 
 5 files changed, 160 insertions(+)
 create mode 100644 arch/arm/dts/vf-colibri.dtsi
 create mode 100644 arch/arm/dts/vf.dtsi
 create mode 100644 arch/arm/dts/vf500-colibri.dts
 create mode 100644 arch/arm/dts/vf610-colibri.dts

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 267fd17..55039df 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -130,6 +130,9 @@ dtb-$(CONFIG_MACH_SUN9I) += \
sun9i-a80-optimus.dtb \
sun9i-a80-cubieboard4.dtb
 
+dtb-$(CONFIG_VF610) += vf500-colibri.dtb \
+   vf610-colibri.dtb
+
 targets += $(dtb-y)
 
 DTC_FLAGS += -R 4 -p 0x1000
diff --git a/arch/arm/dts/vf-colibri.dtsi b/arch/arm/dts/vf-colibri.dtsi
new file mode 100644
index 000..7a8e9bee
--- /dev/null
+++ b/arch/arm/dts/vf-colibri.dtsi
@@ -0,0 +1,21 @@
+/*
+ * Copyright 2014 Toradex AG
+ *
+ * SPDX-License-Identifier: GPL-2.0+ or X11
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ */
+#include vf.dtsi
+
+dspi1 {
+   status = okay;
+   bus-num = 1;
+
+   spi_cmd: sspi@0 {
+   reg = 0;
+   spi-max-frequency = 5000;
+   };
+};
diff --git a/arch/arm/dts/vf.dtsi b/arch/arm/dts/vf.dtsi
new file mode 100644
index 000..78706e1
--- /dev/null
+++ b/arch/arm/dts/vf.dtsi
@@ -0,0 +1,100 @@
+/*
+ * Copyright 2013 Freescale Semiconductor, Inc.
+ *
+ * SPDX-License-Identifier: GPL-2.0+ or X11
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ */
+/include/ skeleton.dtsi
+
+/ {
+   aliases {
+   gpio0 = gpio0;
+   gpio1 = gpio1;
+   gpio2 = gpio2;
+   gpio3 = gpio3;
+   gpio4 = gpio4;
+   spi0 = dspi0;
+   spi1 = dspi1;
+   };
+
+   soc {
+   #address-cells = 1;
+   #size-cells = 1;
+   compatible = simple-bus;
+   ranges;
+
+   aips0: aips-bus@4000 {
+   compatible = fsl,aips-bus, simple-bus;
+   #address-cells = 1;
+   #size-cells = 1;
+   ranges;
+
+   dspi0: dspi0@4002c000 {
+   #address-cells = 1;
+   #size-cells = 0;
+   compatible = fsl,vf610-dspi;
+   reg = 0x4002c000 0x1000;
+   num-cs = 5;
+   status = disabled;
+   };
+
+   dspi1: dspi1@4002d000 {
+   #address-cells = 1;
+   #size-cells = 0;
+   compatible = fsl,vf610-dspi;
+   reg = 0x4002d000 0x1000;
+   num-cs = 5;
+   status = disabled;
+   };
+
+   qspi0: quadspi@40044000 {
+   #address-cells = 1;
+   #size-cells = 0;
+   compatible = fsl,vf610-qspi;
+   reg = 0x40044000 0x1000;
+   status = disabled;
+   };
+
+   gpio0: gpio@40049000 {
+   compatible = fsl,vf610-gpio;
+   reg = 0x400ff000 0x40;
+   #gpio-cells = 2;
+   };
+
+   gpio1: gpio@4004a000 {
+   compatible = fsl,vf610-gpio;
+   reg = 0x400ff040 0x40;
+   #gpio-cells = 2;
+   };
+
+   gpio2: gpio@4004b000 {
+   compatible = fsl,vf610-gpio;
+   reg = 0x400ff080 0x40;
+   #gpio-cells = 2;
+   };
+
+   gpio3: gpio@4004c000 {
+   

[U-Boot] [PATCH 08/11] colibri-vf: Enable SPI support

2015-05-18 Thread Bhuvanchandra DV
Signed-off-by: Bhuvanchandra DV bhuvanchandra...@toradex.com
---
 include/configs/colibri_vf.h | 11 +++
 1 file changed, 11 insertions(+)

diff --git a/include/configs/colibri_vf.h b/include/configs/colibri_vf.h
index 42555fb..25a9bf9 100644
--- a/include/configs/colibri_vf.h
+++ b/include/configs/colibri_vf.h
@@ -273,4 +273,15 @@
 #define CONFIG_USB_GADGET_MASS_STORAGE
 #define CONFIG_CMD_USB_MASS_STORAGE
 
+/* Enable SPI support */
+#define CONFIG_DM_SPI
+#define CONFIG_CMD_SPI
+#define CONFIG_FSL_DSPI
+
+#ifndef CONFIG_OF_CONTROL
+#undef CONFIG_DM_SPI
+#undef CONFIG_CMD_SPI
+#undef CONFIG_FSL_DSPI
+#endif
+
 #endif /* __CONFIG_H */
-- 
2.1.0

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


[U-Boot] [PATCH 09/11] colibri_vf: Add separate defconfig for device tree support

2015-05-18 Thread Bhuvanchandra DV
Most of the drivers available for Vybrid are not yet converted
to OF model to use device tree model, only few drivers
like SPI and GPIO drivers use device trees.
Add separate defconfig for who needs to use device tree model.
Later this can be integrated to single defconfig.

Signed-off-by: Bhuvanchandra DV bhuvanchandra...@toradex.com
---
 configs/colibri_vf_dtb_defconfig | 6 ++
 1 file changed, 6 insertions(+)
 create mode 100644 configs/colibri_vf_dtb_defconfig

diff --git a/configs/colibri_vf_dtb_defconfig b/configs/colibri_vf_dtb_defconfig
new file mode 100644
index 000..28ff1e9
--- /dev/null
+++ b/configs/colibri_vf_dtb_defconfig
@@ -0,0 +1,6 @@
+CONFIG_ARM=y
+CONFIG_TARGET_COLIBRI_VF=y
+CONFIG_SYS_EXTRA_OPTIONS=IMX_CONFIG=board/toradex/colibri_vf/imximage.cfg,ENV_IS_IN_NAND,IMX_NAND
+CONFIG_DM=y
+CONFIG_OF_CONTROL=y
+CONFIG_DEFAULT_DEVICE_TREE=vf610-colibri
-- 
2.1.0

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


[U-Boot] [PATCH 10/11] usb: ehci-vf: Add weak function for board specific initialisation

2015-05-18 Thread Bhuvanchandra DV
From: Sanchayan Maity maitysancha...@gmail.com

Add a weak function board_ehci_hcd_init which can be used by the board
file for board specific initialisation.

Signed-off-by: Sanchayan Maity maitysancha...@gmail.com
---
 drivers/usb/host/ehci-vf.c | 8 
 1 file changed, 8 insertions(+)

diff --git a/drivers/usb/host/ehci-vf.c b/drivers/usb/host/ehci-vf.c
index 5454855..98e0fc6 100644
--- a/drivers/usb/host/ehci-vf.c
+++ b/drivers/usb/host/ehci-vf.c
@@ -121,6 +121,11 @@ static void usb_oc_config(int index)
setbits_le32(ctrl, UCTRL_OVER_CUR_DIS);
 }
 
+int __weak board_ehci_hcd_init(int port)
+{
+   return 0;
+}
+
 int ehci_hcd_init(int index, enum usb_init_type init,
struct ehci_hccr **hccr, struct ehci_hcor **hcor)
 {
@@ -136,6 +141,9 @@ int ehci_hcd_init(int index, enum usb_init_type init,
 
ehci = (struct usb_ehci *)nc_reg_bases[index];
 
+   /* Do board specific initialisation */
+   board_ehci_hcd_init(index);
+
usb_power_config(index);
usb_oc_config(index);
usb_internal_phy_clock_gate(index);
-- 
2.1.0

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


[U-Boot] [PATCH 03/11] colibri_vf: Add pinmux entries for GPIOs

2015-05-18 Thread Bhuvanchandra DV
Inorder to use the pins as GPIO, apart from setting the alt-function,
pinmuxing need to be done, this patch adds pinmux entries of
few GPIOs.

Signed-off-by: Bhuvanchandra DV bhuvanchandra...@toradex.com
---
 arch/arm/include/asm/arch-vf610/iomux-vf610.h | 49 ++
 board/toradex/colibri_vf/colibri_vf.c | 60 +++
 2 files changed, 109 insertions(+)

diff --git a/arch/arm/include/asm/arch-vf610/iomux-vf610.h 
b/arch/arm/include/asm/arch-vf610/iomux-vf610.h
index 9226e69..e22e3f9 100644
--- a/arch/arm/include/asm/arch-vf610/iomux-vf610.h
+++ b/arch/arm/include/asm/arch-vf610/iomux-vf610.h
@@ -32,22 +32,56 @@
 #define VF610_QSPI_PAD_CTRL(PAD_CTL_SPEED_HIGH | PAD_CTL_DSE_150ohm | \
PAD_CTL_PUS_22K_UP | PAD_CTL_OBE_IBE_ENABLE)
 
+#define VF610_GPIO_PAD_CTRL(PAD_CTL_SPEED_MED | PAD_CTL_DSE_50ohm | \
+   PAD_CTL_PUS_47K_UP | PAD_CTL_IBE_ENABLE)
+
 enum {
VF610_PAD_PTA6__RMII0_CLKIN = IOMUX_PAD(0x, 0x, 2, 
__NA_, 0, VF610_ENET_PAD_CTRL),
VF610_PAD_PTA6__RMII0_CLKOUT= IOMUX_PAD(0x, 0x, 1, 
__NA_, 0, VF610_ENET_PAD_CTRL),
+   VF610_PAD_PTA7__GPIO_134= IOMUX_PAD(0x0218, 0x0218, 0, 
__NA_, 0, VF610_GPIO_PAD_CTRL),
+   VF610_PAD_PTA17__GPIO_7 = IOMUX_PAD(0x001c, 0x001c, 0, 
__NA_, 0, VF610_GPIO_PAD_CTRL),
+   VF610_PAD_PTA20__GPIO_10= IOMUX_PAD(0x0028, 0x0028, 0, 
__NA_, 0, VF610_GPIO_PAD_CTRL),
+   VF610_PAD_PTA21__GPIO_11= IOMUX_PAD(0x002c, 0x002c, 0, 
__NA_, 0, VF610_GPIO_PAD_CTRL),
+   VF610_PAD_PTA30__GPIO_20= IOMUX_PAD(0x0050, 0x0050, 0, 
__NA_, 0, VF610_GPIO_PAD_CTRL),
+   VF610_PAD_PTA31__GPIO_21= IOMUX_PAD(0x0054, 0x0054, 0, 
__NA_, 0, VF610_GPIO_PAD_CTRL),
+   VF610_PAD_PTB0__GPIO_22 = IOMUX_PAD(0x0058, 0x0058, 0, 
__NA_, 0, VF610_GPIO_PAD_CTRL),
+   VF610_PAD_PTB1__GPIO_23 = IOMUX_PAD(0x005C, 0x005C, 0, 
__NA_, 0, VF610_GPIO_PAD_CTRL),
VF610_PAD_PTB4__UART1_TX= IOMUX_PAD(0x0068, 0x0068, 2, 
0x0380, 0, VF610_UART_PAD_CTRL),
VF610_PAD_PTB5__UART1_RX= IOMUX_PAD(0x006c, 0x006c, 2, 
0x037c, 0, VF610_UART_PAD_CTRL),
+   VF610_PAD_PTB6__GPIO_28 = IOMUX_PAD(0x0070, 0x0070, 0, 
__NA_, 0, VF610_GPIO_PAD_CTRL),
+   VF610_PAD_PTB7__GPIO_29 = IOMUX_PAD(0x0074, 0x0074, 0, 
__NA_, 0, VF610_GPIO_PAD_CTRL),
+   VF610_PAD_PTB8__GPIO_30 = IOMUX_PAD(0x0078, 0x0078, 0, 
__NA_, 0, VF610_GPIO_PAD_CTRL),
+   VF610_PAD_PTB9__GPIO_31 = IOMUX_PAD(0x007C, 0x007C, 0, 
__NA_, 0, VF610_GPIO_PAD_CTRL),
VF610_PAD_PTB10__UART0_TX   = IOMUX_PAD(0x0080, 0x0080, 1, 
__NA_, 0, VF610_UART_PAD_CTRL),
VF610_PAD_PTB11__UART0_RX   = IOMUX_PAD(0x0084, 0x0084, 1, 
__NA_, 0, VF610_UART_PAD_CTRL),
+   VF610_PAD_PTB12__GPIO_34= IOMUX_PAD(0x0088, 0x0088, 0, 
__NA_, 0, VF610_GPIO_PAD_CTRL),
+   VF610_PAD_PTB13__GPIO_35= IOMUX_PAD(0x008c, 0x008c, 0, 
__NA_, 0, VF610_GPIO_PAD_CTRL),
+   VF610_PAD_PTB16__GPIO_38= IOMUX_PAD(0x0098, 0x0098, 0, 
__NA_, 0, VF610_GPIO_PAD_CTRL),
+   VF610_PAD_PTB17__GPIO_39= IOMUX_PAD(0x009c, 0x009c, 0, 
__NA_, 0, VF610_GPIO_PAD_CTRL),
+   VF610_PAD_PTB18__GPIO_40= IOMUX_PAD(0x00a0, 0x00a0, 0, 
__NA_, 0, VF610_GPIO_PAD_CTRL),
+   VF610_PAD_PTB21__GPIO_43= IOMUX_PAD(0x00ac, 0x00ac, 0, 
__NA_, 0, VF610_GPIO_PAD_CTRL),
+   VF610_PAD_PTB22__GPIO_44= IOMUX_PAD(0x00b0, 0x00b0, 0, 
__NA_, 0, VF610_GPIO_PAD_CTRL),
+   VF610_PAD_PTB23__GPIO_93= IOMUX_PAD(0x0174, 0x0174, 0, 
__NA_, 0, VF610_GPIO_PAD_CTRL),
+   VF610_PAD_PTB26__GPIO_96= IOMUX_PAD(0x0180, 0x0180, 0, 
__NA_, 0, VF610_GPIO_PAD_CTRL),
+   VF610_PAD_PTB28__GPIO_98= IOMUX_PAD(0x0188, 0x0188, 0, 
__NA_, 0, VF610_GPIO_PAD_CTRL),
+   VF610_PAD_PTC1__GPIO_46 = IOMUX_PAD(0x00b8, 0x00b8, 0, 
__NA_, 0, VF610_GPIO_PAD_CTRL),
VF610_PAD_PTC1__RMII0_MDIO  = IOMUX_PAD(0x00b8, 0x00b8, 1, 
__NA_, 0, VF610_ENET_PAD_CTRL),
+   VF610_PAD_PTC0__GPIO_45 = IOMUX_PAD(0x00b4, 0x00b4, 0, 
__NA_, 0, VF610_GPIO_PAD_CTRL),
VF610_PAD_PTC0__RMII0_MDC   = IOMUX_PAD(0x00b4, 0x00b4, 1, 
__NA_, 0, VF610_ENET_PAD_CTRL),
VF610_PAD_PTC2__RMII0_CRS_DV= IOMUX_PAD(0x00bc, 0x00bc, 1, 
__NA_, 0, VF610_ENET_PAD_CTRL),
+   VF610_PAD_PTC2__GPIO_47 = IOMUX_PAD(0x00bc, 0x00bc, 0, 
__NA_, 0, VF610_GPIO_PAD_CTRL),
VF610_PAD_PTC3__RMII0_RD1   = IOMUX_PAD(0x00c0, 0x00c0, 1, 
__NA_, 0, VF610_ENET_PAD_CTRL),
+   VF610_PAD_PTC3__GPIO_48 = IOMUX_PAD(0x00c0, 0x00c0, 0, 
__NA_, 0, 

Re: [U-Boot] [PATCH v2 3/4] imx: mx6: add display of CPU temperature grade in print_cpuinfo()

2015-05-18 Thread Tim Harvey
On Sun, May 17, 2015 at 5:11 PM, Peng Fan b51...@freescale.com wrote:
 Hi Fabio,

 On Fri, May 15, 2015 at 10:36:09AM -0300, Fabio Estevam wrote:
Hi Tim,

On Fri, May 15, 2015 at 10:31 AM, Tim Harvey thar...@gateworks.com wrote:

 Yes, that sounds like the best approach. What were your thoughts on
 enabling the second CPU: line just to display the temperature grade if
 CONFIG_IMX6_THERMAL was not enabled?

 I'm surprised someone on this list hasn't already tested this on IMX6SX.

 Fabio - certainly you must have a reference board with an IMX6SX and
 could enable/test that the CPU markings agree with what is
 detected/displayed via OTP?

Yes, I do have a mx6sx sdb board, but the one I have is from the old
silicon and I had issues event with the temperature reading, so I
prefer not to rely on my testing.

Ye Li / Peng / Nitin,

Could some of you please test Tim's series on a mx6sx sdb and let us
know what it displays on the CPU lines?

 Tested on mx6sx sdb Revb board. I applied the following patches for this test:

 mx6: add OTP bank1 registers
 thermal: imx_thermal: use CPU temperature grade for trip points
 imx: mx6: add display of CPU temperature grade in print_cpuinfo()
 imx: mx6: add get_cpu_temp_grade to obtain cpu temperature grade from OTP
 mx: mx6: display max cpu frequency in print_cpuinfo()
 imx: mx6: add get_cpu_speed_grade_hz func to return MHz speed grade from OTP

 The log info: 
 U-Boot 2015.07-rc1-00256-gec154cc (May 18 2015 - 09:00:57)

 CPU:   Freescale i.MX6SX rev1.2 996 MHz (running at 792 MHz)
 CPU:at 39C
 Reset cause: POR
 Board: MX6SX SABRE SDB
 I2C:   ready
 DRAM:  1 GiB
 PMIC:  PFUZE100 ID=0x11
 MMC:   FSL_SDHC: 0, FSL_SDHC: 1, FSL_SDHC: 2
 In:serial
 Out:   serial
 Err:   serial
 Net:   FEC [PRIME]
 Hit any key to stop autoboot:  0
 
Thanks,

Fabio Estevam

 Regards,
 Peng.

 --

Peng,

I'll send a v3 of the patch that removes disabling of showing the
temperature grade info for imx6sx and please test again with this
version as well as let us know the part markings for your chip so I
can verify the fuses are set properly.

Thanks!

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


[U-Boot] [PATCH v3 2/2] imx: mx6: display max cpu frequency in print_cpuinfo()

2015-05-18 Thread Tim Harvey
Display the max CPU frequency as well as the current running CPU frequency
if the max CPU frequency is available and differs from the current CPU
frequency.

Before:
CPU:   Freescale i.MX6Q rev1.2 at 792 MHz

After - using an 800MHz IMX6DL (running at its max)
CPU:   Freescale i.MX6DL rev1.1 at 792 MHz

After - using a 1GHz IMX6Q (not running at its max):
CPU:   Freescale i.MX6Q rev1.2 996 MHz (running at 792 MHz)

Cc: Stefan Roese s...@denx.de
Cc: Eric Nelson eric.nel...@boundarydevices.com
Cc: Heiko Schocher h...@denx.de
Cc: Nikita Kiryanov nik...@compulab.co.il
Cc: Jon Nettleton jon.nettle...@gmail.com
Cc: Jason Liu r64...@freescale.com
Cc: Ye Li b37...@freescale.com
Cc: Fabio Estevam fabio.este...@freescale.com
Cc: Christian Gmeiner christian.gmei...@gmail.com
Cc: Markus Niebel markus.nie...@tq-group.com
Cc: Peng Fan b51...@freescale.com
Tested-by: Nikolay Dimitrov picmas...@mail.bg
Signed-off-by: Tim Harvey thar...@gateworks.com
---
v3:
 - fix commit message (mx: mx6 - imx: mx6)
 - added Nikolay's tested by
v2:
 - split out from patch that obtains the max cpu freq
 - add before/after example and more description of change

Signed-off-by: Tim Harvey thar...@gateworks.com
v2:
---
 arch/arm/imx-common/cpu.c | 16 +++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/arch/arm/imx-common/cpu.c b/arch/arm/imx-common/cpu.c
index 067d08f..6b20482 100644
--- a/arch/arm/imx-common/cpu.c
+++ b/arch/arm/imx-common/cpu.c
@@ -142,7 +142,7 @@ const char *get_imx_type(u32 imxtype)
 
 int print_cpuinfo(void)
 {
-   u32 cpurev;
+   u32 cpurev, max_freq;
 
 #if defined(CONFIG_MX6)  defined(CONFIG_IMX6_THERMAL)
struct udevice *thermal_dev;
@@ -151,11 +151,25 @@ int print_cpuinfo(void)
 
cpurev = get_cpu_rev();
 
+#if defined(CONFIG_MX6)
+   printf(CPU:   Freescale i.MX%s rev%d.%d,
+  get_imx_type((cpurev  0xFF000)  12),
+  (cpurev  0x000F0)  4,
+  (cpurev  0xF)  0);
+   max_freq = get_cpu_speed_grade_hz();
+   if (!max_freq || max_freq == mxc_get_clock(MXC_ARM_CLK)) {
+   printf( at %dMHz\n, mxc_get_clock(MXC_ARM_CLK) / 100);
+   } else {
+   printf( %d MHz (running at %d MHz)\n, max_freq / 100,
+  mxc_get_clock(MXC_ARM_CLK) / 100);
+   }
+#else
printf(CPU:   Freescale i.MX%s rev%d.%d at %d MHz\n,
get_imx_type((cpurev  0xFF000)  12),
(cpurev  0x000F0)  4,
(cpurev  0xF)  0,
mxc_get_clock(MXC_ARM_CLK) / 100);
+#endif
 
 #if defined(CONFIG_MX6)  defined(CONFIG_IMX6_THERMAL)
ret = uclass_get_device(UCLASS_THERMAL, 0, thermal_dev);
-- 
1.9.1

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


[U-Boot] [PATCH v3 0/2] imx: mx6: use OTP for freq grade

2015-05-18 Thread Tim Harvey
use CPU frequency grade in print_cpuinfo()
--
v3:
 - fix typo in a commit message
 - add tested-by
v2:
 - split into two series: 1 for CPU frequency, other for Temperature grade

Tim Harvey (2):
  imx: mx6: add get_cpu_speed_grade_hz func to return MHz speed grade
from OTP
  imx: mx6: display max cpu frequency in print_cpuinfo()

 arch/arm/cpu/armv7/mx6/soc.c  | 41 +++
 arch/arm/imx-common/cpu.c | 16 +++-
 arch/arm/include/asm/arch-mx6/sys_proto.h |  1 +
 3 files changed, 57 insertions(+), 1 deletion(-)

-- 
1.9.1

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


[U-Boot] [PATCH v3 1/2] imx: mx6: add get_cpu_speed_grade_hz func to return MHz speed grade from OTP

2015-05-18 Thread Tim Harvey
The IMX6 has four different speed grades determined by eFUSE SPEED_GRADING
indicated by OCOTP_CFG3[17:16] which is at 0x440 in the Fusemap Description
Table. Return this frequency so that it can be used elsewhere.

Note that the IMX6SDLRM and the IMX6SXRM do not indicate this in the
their Fusemap Description Table however Freescale has confirmed that these
eFUSE bits match the description within the IMX6DQRM and that they will
be added to the next revision of the respective reference manuals.

These have been tested with IMX6 Quad/Solo/Dual-light 800Mhz and 1GHz grades.

Signed-off-by: Tim Harvey thar...@gateworks.com
---
v3:
 - no changes
v2:
 - no changes

---
 arch/arm/cpu/armv7/mx6/soc.c  | 41 +++
 arch/arm/include/asm/arch-mx6/sys_proto.h |  1 +
 2 files changed, 42 insertions(+)

diff --git a/arch/arm/cpu/armv7/mx6/soc.c b/arch/arm/cpu/armv7/mx6/soc.c
index dd34138..71fa1fb 100644
--- a/arch/arm/cpu/armv7/mx6/soc.c
+++ b/arch/arm/cpu/armv7/mx6/soc.c
@@ -83,6 +83,47 @@ u32 get_cpu_rev(void)
return (type  12) | (reg + 0x10);
 }
 
+/*
+ * OCOTP_CFG3[17:16] (see Fusemap Description Table offset 0x440)
+ * defines a 2-bit SPEED_GRADING
+ */
+#define OCOTP_CFG3_SPEED_SHIFT 16
+#define OCOTP_CFG3_SPEED_800MHZ0
+#define OCOTP_CFG3_SPEED_850MHZ1
+#define OCOTP_CFG3_SPEED_1GHZ  2
+#define OCOTP_CFG3_SPEED_1P2GHZ3
+
+u32 get_cpu_speed_grade_hz(void)
+{
+   struct ocotp_regs *ocotp = (struct ocotp_regs *)OCOTP_BASE_ADDR;
+   struct fuse_bank *bank = ocotp-bank[0];
+   struct fuse_bank0_regs *fuse =
+   (struct fuse_bank0_regs *)bank-fuse_regs;
+   uint32_t val;
+
+   val = readl(fuse-cfg3);
+   val = OCOTP_CFG3_SPEED_SHIFT;
+   val = 0x3;
+
+   switch (val) {
+   /* Valid for IMX6DQ */
+   case OCOTP_CFG3_SPEED_1P2GHZ:
+   if (is_cpu_type(MXC_CPU_MX6Q) || is_cpu_type(MXC_CPU_MX6D))
+   return 12;
+   /* Valid for IMX6SX/IMX6SDL/IMX6DQ */
+   case OCOTP_CFG3_SPEED_1GHZ:
+   return 99600;
+   /* Valid for IMX6DQ */
+   case OCOTP_CFG3_SPEED_850MHZ:
+   if (is_cpu_type(MXC_CPU_MX6Q) || is_cpu_type(MXC_CPU_MX6D))
+   return 85200;
+   /* Valid for IMX6SX/IMX6SDL/IMX6DQ */
+   case OCOTP_CFG3_SPEED_800MHZ:
+   return 79200;
+   }
+   return 0;
+}
+
 #ifdef CONFIG_REVISION_TAG
 u32 __weak get_board_rev(void)
 {
diff --git a/arch/arm/include/asm/arch-mx6/sys_proto.h 
b/arch/arm/include/asm/arch-mx6/sys_proto.h
index 28ba844..a2cd0a9 100644
--- a/arch/arm/include/asm/arch-mx6/sys_proto.h
+++ b/arch/arm/include/asm/arch-mx6/sys_proto.h
@@ -16,6 +16,7 @@
 
 u32 get_nr_cpus(void);
 u32 get_cpu_rev(void);
+u32 get_cpu_speed_grade_hz(void);
 
 /* returns MXC_CPU_ value */
 #define cpu_type(rev) (((rev)  12)0xff)
-- 
1.9.1

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


[U-Boot] [PATCH v3 1/4] Kconfig: Enable usage of escape char '\' in string values

2015-05-18 Thread Stefan Roese
I might have missed something, but I failed to use the escape char '\'
in strings. To pass a printf format string like foo %d bar\n via
Kconfig to the code.

Right now its not possible to use the escape character '\' in Kconfig
string values correctly to e.g. set this string value test output\n.
The '\n' will be converted to 'n'.

The current implementation removes some of the '\' chars from the input
string in conf_set_sym_val(). Examples:

'\' - ''
'\\'- '\'
'\\\'   - '\'
''  - '\\'
...

And then doubles the backslash chars in the output string in
sym_escape_string_value(). Example:

'\' - ''   - ''
'\\'- '\'  - '\\'
'\\\'   - '\'  - '\\'
''  - '\\' - ''
...

As you see in these examples, its impossible to generate a single '\'
charater in the output string as its needed for something like '\n'.

This patch now changes this behavior to not drop some backslashes in
conf_set_sym_val() and to not add new backslashes in the resulting
output string. Removing the function sym_escape_string_value()
completely as its not needed anymore.

Signed-off-by: Stefan Roese s...@denx.de
Cc: Masahiro Yamada yamada.masah...@socionext.com
Cc: Simon Glass s...@chromium.org
---

Changes in v3: None
Changes in v2: None

 scripts/kconfig/confdata.c | 20 +---
 scripts/kconfig/symbol.c   | 43 ---
 2 files changed, 9 insertions(+), 54 deletions(-)

diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c
index f88d90f..4482192 100644
--- a/scripts/kconfig/confdata.c
+++ b/scripts/kconfig/confdata.c
@@ -155,18 +155,14 @@ static int conf_set_sym_val(struct symbol *sym, int def, 
int def_flags, char *p)
case S_STRING:
if (*p++ != '')
break;
-   for (p2 = p; (p2 = strpbrk(p2, \\\)); p2++) {
-   if (*p2 == '') {
-   *p2 = 0;
-   break;
-   }
-   memmove(p2, p2 + 1, strlen(p2));
-   }
-   if (!p2) {
+   /* Last char has to be a '' */
+   if (p[strlen(p) - 1] != '') {
if (def != S_DEF_AUTO)
conf_warning(invalid string found);
return 1;
}
+   /* Overwrite '' with \0 for string termination */
+   p[strlen(p) - 1] = 0;
/* fall through */
case S_INT:
case S_HEX:
@@ -624,6 +620,7 @@ static void conf_write_symbol(FILE *fp, struct symbol *sym,
  struct conf_printer *printer, void *printer_arg)
 {
const char *str;
+   char *str2;
 
switch (sym-type) {
case S_OTHER:
@@ -631,9 +628,10 @@ static void conf_write_symbol(FILE *fp, struct symbol *sym,
break;
case S_STRING:
str = sym_get_string_value(sym);
-   str = sym_escape_string_value(str);
-   printer-print_symbol(fp, sym, str, printer_arg);
-   free((void *)str);
+   str2 = xmalloc(strlen(str) + 2);
+   sprintf(str2, \%s\, str);
+   printer-print_symbol(fp, sym, str2, printer_arg);
+   free((void *)str2);
break;
default:
str = sym_get_string_value(sym);
diff --git a/scripts/kconfig/symbol.c b/scripts/kconfig/symbol.c
index 7caabdb..ab339eb 100644
--- a/scripts/kconfig/symbol.c
+++ b/scripts/kconfig/symbol.c
@@ -912,49 +912,6 @@ const char *sym_expand_string_value(const char *in)
return res;
 }
 
-const char *sym_escape_string_value(const char *in)
-{
-   const char *p;
-   size_t reslen;
-   char *res;
-   size_t l;
-
-   reslen = strlen(in) + strlen(\\) + 1;
-
-   p = in;
-   for (;;) {
-   l = strcspn(p, \\\);
-   p += l;
-
-   if (p[0] == '\0')
-   break;
-
-   reslen++;
-   p++;
-   }
-
-   res = xmalloc(reslen);
-   res[0] = '\0';
-
-   strcat(res, \);
-
-   p = in;
-   for (;;) {
-   l = strcspn(p, \\\);
-   strncat(res, p, l);
-   p += l;
-
-   if (p[0] == '\0')
-   break;
-
-   strcat(res, \\);
-   strncat(res, p++, 1);
-   }
-
-   strcat(res, \);
-   return res;
-}
-
 struct sym_match {
struct symbol   *sym;
off_t   so, eo;
-- 
2.4.1

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


[U-Boot] Status of squashsfs support

2015-05-18 Thread leszek Hanusz
Hi,

I was wondering what is the status of the squashfs support in u-boot ?
The wiki page
http://elinux.org/Squashfs_filesystem_support_for_u-boot
is linking to a mail indicating that support for squashfs version 3 exists
but the link is broken ?
Anything new ?

Best Regards,

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


[U-Boot] [PATCH v3 4/4] autoboot.c: Add feature to stop autobooting via SHA256 encrypted password

2015-05-18 Thread Stefan Roese
This patch adds the feature to only stop the autobooting, and therefor
boot into the U-Boot prompt, when the input string / password matches
a values that is encypted via a SHA256 hash and saved in the environment.

This feature is enabled by defined these config options:
 CONFIG_AUTOBOOT_KEYED
 CONFIG_AUTOBOOT_STOP_STR_SHA256

Signed-off-by: Stefan Roese s...@denx.de
Reviewed-by: Simon Glass s...@chromium.org

---

Changes in v3:
- Removed CONFIG_AUTOBOOT_STOP_STR2 and CONFIG_AUTOBOOT_DELAY_STR2
  again
- Introduced hash_parse_string() to share some code as suggested by
  Simon
- Used hash_block() instead of sha256_csum_wd() as suggested by Simon
- Added some Acked-by's / Reviewed-by's

Changes in v2:
- AUTOBOOT_STOP_STR_SHA256 is a string and not bool
- Add input key length check as suggested by Magnus
- Add constant-length time compare function as suggested
  by Magnus

 common/Kconfig|  20 +++--
 common/autoboot.c | 119 +-
 common/hash.c |  30 +-
 include/hash.h|  14 +++
 4 files changed, 152 insertions(+), 31 deletions(-)

diff --git a/common/Kconfig b/common/Kconfig
index 08da786..52c0e94 100644
--- a/common/Kconfig
+++ b/common/Kconfig
@@ -45,9 +45,14 @@ config AUTOBOOT_PROMPT
  the responsibility of the user to select only such arguments
  that are valid in the given context.
 
+config AUTOBOOT_ENCRYPTION
+   bool Enable encryption in autoboot stopping
+   depends on AUTOBOOT_KEYED
+   default n
+
 config AUTOBOOT_DELAY_STR
string Delay autobooting via specific input key / string
-   depends on AUTOBOOT_KEYED
+   depends on AUTOBOOT_KEYED  !AUTOBOOT_ENCRYPTION
help
  This option delays the automatic boot feature by issuing
  a specific input key or string. If CONFIG_AUTOBOOT_DELAY_STR
@@ -59,7 +64,7 @@ config AUTOBOOT_DELAY_STR
 
 config AUTOBOOT_STOP_STR
string Stop autobooting via specific input key / string
-   depends on AUTOBOOT_KEYED
+   depends on AUTOBOOT_KEYED  !AUTOBOOT_ENCRYPTION
help
  This option enables stopping (aborting) of the automatic
  boot feature only by issuing a specific input key or
@@ -71,7 +76,7 @@ config AUTOBOOT_STOP_STR
 
 config AUTOBOOT_KEYED_CTRLC
bool Enable Ctrl-C autoboot interruption
-   depends on AUTOBOOT_KEYED
+   depends on AUTOBOOT_KEYED  !AUTOBOOT_ENCRYPTION
default n
help
  This option allows for the boot sequence to be interrupted
@@ -79,6 +84,15 @@ config AUTOBOOT_KEYED_CTRLC
  Setting this variable provides an escape sequence from the
  limited password strings.
 
+config AUTOBOOT_STOP_STR_SHA256
+   string Stop autobooting via SHA256 encrypted password
+   depends on AUTOBOOT_KEYED  AUTOBOOT_ENCRYPTION
+   help
+ This option adds the feature to only stop the autobooting,
+ and therefore boot into the U-Boot prompt, when the input
+ string / password matches a values that is encypted via
+ a SHA256 hash and saved in the environment.
+
 endmenu
 
 comment Commands
diff --git a/common/autoboot.c b/common/autoboot.c
index f72eb18..c367076 100644
--- a/common/autoboot.c
+++ b/common/autoboot.c
@@ -12,6 +12,7 @@
 #include fdtdec.h
 #include menu.h
 #include post.h
+#include u-boot/sha256.h
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -26,15 +27,81 @@ DECLARE_GLOBAL_DATA_PTR;
 /* Stored value of bootdelay, used by autoboot_command() */
 static int stored_bootdelay;
 
-/***
- * Watch for 'delay' seconds for autoboot stop or autoboot delay string.
- * returns: 0 -  no key string, allow autoboot 1 - got key string, abort
+#if defined(CONFIG_AUTOBOOT_KEYED)
+#if defined(CONFIG_AUTOBOOT_STOP_STR_SHA256)
+
+/*
+ * Use a constant-length time compare function for this
+ * hash compare:
+ *
+ * https://crackstation.net/hashing-security.htm
  */
-# if defined(CONFIG_AUTOBOOT_KEYED)
-static int abortboot_keyed(int bootdelay)
+static int slow_equals(u8 *a, u8 *b, int len)
+{
+   int diff = 0;
+   int i;
+
+   for (i = 0; i  len; i++)
+   diff |= a[i] ^ b[i];
+
+   return diff == 0;
+}
+
+static int passwd_abort(uint64_t etime)
+{
+   const char *sha_env_str = getenv(bootstopkeysha256);
+   u8 sha_env[SHA256_SUM_LEN];
+   u8 sha[SHA256_SUM_LEN];
+   char presskey[MAX_DELAY_STOP_STR];
+   const char *algo_name = sha256;
+   u_int presskey_len = 0;
+   int abort = 0;
+   int size;
+   int ret;
+
+   if (sha_env_str == NULL)
+   sha_env_str = CONFIG_AUTOBOOT_STOP_STR_SHA256;
+
+   /*
+* Generate the binary value from the environment hash value
+* so that we can compare this value with the computed hash
+* from the user input
+*/
+   ret = hash_parse_string(algo_name, sha_env_str, sha_env);
+   if 

[U-Boot] [PATCH v3 0/4] Add SHA256 encrypted stop string for autobooting

2015-05-18 Thread Stefan Roese

The main task for this patch series is to add the new feature to abort
autobooting via a SHA256 encrypted password. For this, some of the old
autobooting related config macros have been moved to Kconfig. This was a bit
more complicated, since Kconfig currently apparently doesn't support using
escape characters '\' as used in printf format strings like foo %s bar\n.
And this is needed for some of these new Kconfig options. So I needed to
make some changes to the Kconfig sources as well. If nobody complains about
these Kconfig stuff, I'll try to push this into the Linux Kconfig source as
well.

There should be no functional change introduced. Please let me know if you
find any problems.

Thanks,
Stefan

Changes in v3:
- Added some Acked-by's / Reviewed-by's
- Added additional backslash to the default CONFIG_AUTOBOOT_PROMPT
  string as this seems to be needed for the parser
- Added some Acked-by's / Reviewed-by's
- Removed CONFIG_AUTOBOOT_STOP_STR2 and CONFIG_AUTOBOOT_DELAY_STR2
  again
- Introduced hash_parse_string() to share some code as suggested by
  Simon
- Used hash_block() instead of sha256_csum_wd() as suggested by Simon
- Added some Acked-by's / Reviewed-by's

Changes in v2:
- AUTOBOOT_STOP_STR_SHA256 is a string and not bool
- Add input key length check as suggested by Magnus
- Add constant-length time compare function as suggested
  by Magnus

Stefan Roese (4):
  Kconfig: Enable usage of escape char '\' in string values
  autoboot.c: Remove CONFIG_AUTOBOOT_STOP_STR2 and
CONFIG_AUTOBOOT_DELAY_STR2
  autoboot.c: Move config options to Kconfig
  autoboot.c: Add feature to stop autobooting via SHA256 encrypted
password

 README   |   2 -
 common/Kconfig   |  78 +++
 common/autoboot.c| 129 ---
 common/hash.c|  30 ---
 configs/CPCI4052_defconfig   |   3 +
 configs/O2DNT2_RAMBOOT_defconfig |   3 +
 configs/O2DNT2_defconfig |   3 +
 configs/PLU405_defconfig |   3 +
 configs/PMC405DE_defconfig   |   3 +
 configs/PMC440_defconfig |   3 +
 configs/UCP1020_SPIFLASH_defconfig   |   3 +
 configs/UCP1020_defconfig|   3 +
 configs/a4m072_defconfig |   3 +
 configs/atngw100_defconfig   |   4 +
 configs/atngw100mkii_defconfig   |   4 +
 configs/atstk1002_defconfig  |   4 +
 configs/atstk1003_defconfig  |   4 +
 configs/atstk1004_defconfig  |   4 +
 configs/atstk1006_defconfig  |   4 +
 configs/calimain_defconfig   |   2 +
 configs/cpuat91_defconfig|   4 +
 configs/cpuat91_ram_defconfig|   3 +
 configs/digsy_mtc_RAMBOOT_defconfig  |   3 +
 configs/digsy_mtc_defconfig  |   3 +
 configs/digsy_mtc_rev5_RAMBOOT_defconfig |   3 +
 configs/digsy_mtc_rev5_defconfig |   3 +
 configs/dlvision-10g_defconfig   |   2 +
 configs/draco_defconfig  |   3 +
 configs/dxr2_defconfig   |   3 +
 configs/favr-32-ezkit_defconfig  |   4 +
 configs/gdppc440etx_defconfig|   2 +
 configs/grasshopper_defconfig|   4 +
 configs/hammerhead_defconfig |   4 +
 configs/highbank_defconfig   |   3 +
 configs/hrcon_defconfig  |   2 +
 configs/ids8313_defconfig|   3 +
 configs/intip_defconfig  |   2 +
 configs/io64_defconfig   |   2 +
 configs/io_defconfig |   2 +
 configs/iocon_defconfig  |   2 +
 configs/ip04_defconfig   |   1 +
 configs/motionpro_defconfig  |   3 +
 configs/nokia_rx51_defconfig |   1 +
 configs/omap3_mvblx_defconfig|   2 +
 configs/ph1_ld4_defconfig|   4 +
 configs/ph1_pro4_defconfig   |   4 +
 configs/ph1_sld8_defconfig   |   4 +
 configs/pm9263_defconfig |   1 +
 configs/pxm2_defconfig   |   3 +
 configs/rut_defconfig|   3 +
 configs/spear600_defconfig   |   3 +
 configs/stv0991_defconfig|   3 +
 configs/x600_defconfig   |   3 +
 configs/zmx25_defconfig  |   4 +
 doc/README.autoboot  |  10 ---
 include/configs/CPCI4052.h   |   6 --
 include/configs/PLU405.h |   9 ---
 include/configs/PMC405DE.h   |   6 --
 include/configs/PMC440.h |   6 --
 include/configs/UCP1020.h|  11 ---
 include/configs/a4m072.h |   4 -
 include/configs/atngw100.h   |  10 ---
 include/configs/atngw100mkii.h   |  10 ---
 include/configs/atstk1002.h  |  10 ---
 include/configs/atstk1003.h  |  10 ---
 

[U-Boot] please pull u-boot-arc master

2015-05-18 Thread Alexey Brodkin
Hi Tom,

The following changes since commit 3bfe3ce2a6e3b04da1d04dbc0520dcc26e17f98a:

  MAINTAINERS, git-mailrc: Update Jagan's name and e-mail (2015-05-16 07:34:26 
-0400)

are available in the git repository at:

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

for you to fetch changes up to 0744c2f1ad082a4d9ac38084b8f3ac84cc012d05:

  arc: gitignore: ignore ARC DTBs (2015-05-18 12:06:36 +0300)


Masahiro Yamada (1):
  arc: gitignore: ignore ARC DTBs

 arch/arc/dts/.gitignore | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 arch/arc/dts/.gitignore

Regards,
Alexey


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


[U-Boot] [PATCH v3 3/4] arm: ls102xa: Enable Driver Model SPI for ls1021aqds

2015-05-18 Thread Haikun Wang
Enable Driver Model SPI for ls1021aqds board.
DSPI and QSPI is enabled only when boot from QSPI.
DSPI and QSPI are compatible under Driver Model SPI.

Signed-off-by: Haikun Wang haikun.w...@freescale.com
---
Changes in v3:
- Remove CONFIG_SPI_FLASH_ATMEL
- IS_ENABLED(CONFIG_XXX) is only work with configure option in Kconfig,
  and DM core code use IS_ENABLED(), so configure option in head file
  can't work, so remove CONFIG_OF_CONTROL CONFIG_OF_SEPARATE CONFIG_DM 
CONFIG_DM_SPI

Changes in v2:
- Move all changes inside of CONFIG_QSPI_BOOT 

Changes in v1: None
 include/configs/ls1021aqds.h | 13 +++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/include/configs/ls1021aqds.h b/include/configs/ls1021aqds.h
index 9a8fd50..55f52e8 100644
--- a/include/configs/ls1021aqds.h
+++ b/include/configs/ls1021aqds.h
@@ -409,16 +409,25 @@ unsigned long get_board_ddr_clk(void);
 #define CONFIG_CMD_FAT
 #define CONFIG_DOS_PARTITION
 
-/* QSPI */
+/* SPI */
 #ifdef CONFIG_QSPI_BOOT
+/* QSPI */
 #define CONFIG_FSL_QSPI
 #define QSPI0_AMBA_BASE0x4000
 #define FSL_QSPI_FLASH_SIZE(1  24)
 #define FSL_QSPI_FLASH_NUM 2
+#define CONFIG_SPI_FLASH_SPANSION
 
+/* DSPI */
+#define CONFIG_FSL_DSPI
+
+/* DM SPI */
+#if defined(CONFIG_FSL_DSPI) || defined(CONFIG_FSL_QSPI)
 #define CONFIG_CMD_SF
+#define CONFIG_DM_SPI_FLASH
 #define CONFIG_SPI_FLASH
-#define CONFIG_SPI_FLASH_SPANSION
+#define CONFIG_SF_DATAFLASH
+#endif
 #endif
 
 /*
-- 
2.1.0.27.g96db324

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


[U-Boot] [PATCH v3 4/4] arm: ls102xa: Enable Driver Model SPI for ls1021atwr

2015-05-18 Thread Haikun Wang
From: Haikun Wang haikun.w...@freescale.com

Enable Driver Model SPI for ls1021atwr board.
DSPI and QSPI only be enabled when boot from QSPI.
DSPI and QSPI are compatible under Driver Model SPI.

Signed-off-by: Haikun Wang haikun.w...@freescale.com
Change-Id: I6342807da7725ae8b678952117c8758c75a61d3d
Reviewed-on: http://git.am.freescale.net:8181/33447
Tested-by: Review Code-CDREVIEW cdrev...@freescale.com
Reviewed-by: Prabhakar Kushwaha prabha...@freescale.com
---
Changes in v3:
- IS_ENABLED(CONFIG_XXX) is only work with configure option in Kconfig,
  and DM core code use IS_ENABLED(), so configure option in head file
  can't work, so remove CONFIG_OF_CONTROL CONFIG_OF_SEPARATE CONFIG_DM 
CONFIG_DM_SPI

Changes in v2:
- Move all changes inside of CONFIG_QSPI_BOOT 

Changes in v1: None
 include/configs/ls1021atwr.h | 10 --
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/include/configs/ls1021atwr.h b/include/configs/ls1021atwr.h
index 729205f..13e3aa4 100644
--- a/include/configs/ls1021atwr.h
+++ b/include/configs/ls1021atwr.h
@@ -229,16 +229,22 @@
 #define CONFIG_CMD_FAT
 #define CONFIG_DOS_PARTITION
 
-/* QSPI */
+/* SPI */
 #ifdef CONFIG_QSPI_BOOT
+/* QSPI */
 #define CONFIG_FSL_QSPI
 #define QSPI0_AMBA_BASE0x4000
 #define FSL_QSPI_FLASH_SIZE(1  24)
 #define FSL_QSPI_FLASH_NUM 2
 
+#define CONFIG_SPI_FLASH_STMICRO
+
+/* DM SPI */
+#if defined(CONFIG_FSL_DSPI) || defined(CONFIG_FSL_QSPI)
 #define CONFIG_CMD_SF
+#define CONFIG_DM_SPI_FLASH
 #define CONFIG_SPI_FLASH
-#define CONFIG_SPI_FLASH_STMICRO
+#endif
 #endif
 
 /*
-- 
2.1.0.27.g96db324

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


[U-Boot] [Patch v3 4/4] thermal: imx_thermal: use CPU temperature grade for trip points

2015-05-18 Thread Tim Harvey
Replace the hard-coded values for min/max/passive with values derived from
the CPU temperature grade.

Signed-off-by: Tim Harvey thar...@gateworks.com
---
 drivers/thermal/imx_thermal.c | 29 +++--
 1 file changed, 19 insertions(+), 10 deletions(-)

diff --git a/drivers/thermal/imx_thermal.c b/drivers/thermal/imx_thermal.c
index 0bd9cfd..b5dab63 100644
--- a/drivers/thermal/imx_thermal.c
+++ b/drivers/thermal/imx_thermal.c
@@ -12,15 +12,13 @@
 #include fuse.h
 #include asm/io.h
 #include asm/arch/clock.h
+#include asm/arch/sys_proto.h
 #include dm.h
 #include errno.h
 #include malloc.h
 #include thermal.h
 #include imx_thermal.h
 
-#define TEMPERATURE_MIN-40
-#define TEMPERATURE_HOT80
-#define TEMPERATURE_MAX125
 #define FACTOR01000
 #define FACTOR115976
 #define FACTOR24297157
@@ -34,14 +32,21 @@
 #define MISC0_REFTOP_SELBIASOFF(1  3)
 #define TEMPSENSE1_MEASURE_FREQ0x
 
+struct thermal_data {
+   unsigned int fuse;
+   int passive;
+   int minc;
+   int maxc;
+};
+
 static int read_cpu_temperature(struct udevice *dev)
 {
int temperature;
unsigned int reg, n_meas;
const struct imx_thermal_plat *pdata = dev_get_platdata(dev);
struct anatop_regs *anatop = (struct anatop_regs *)pdata-regs;
-   unsigned int *priv = dev_get_priv(dev);
-   u32 fuse = *priv;
+   struct thermal_data *priv = dev_get_priv(dev);
+   u32 fuse = priv-fuse;
int t1, n1;
u32 c1, c2;
u64 temp64;
@@ -119,11 +124,12 @@ static int read_cpu_temperature(struct udevice *dev)
 
 int imx_thermal_get_temp(struct udevice *dev, int *temp)
 {
+   struct thermal_data *priv = dev_get_priv(dev);
int cpu_tmp = 0;
 
cpu_tmp = read_cpu_temperature(dev);
-   while (cpu_tmp  TEMPERATURE_MIN  cpu_tmp  TEMPERATURE_MAX) {
-   if (cpu_tmp = TEMPERATURE_HOT) {
+   while (cpu_tmp  priv-minc  cpu_tmp  priv-maxc) {
+   if (cpu_tmp = priv-passive) {
printf(CPU Temperature is %d C, too hot to boot, 
waiting...\n,
   cpu_tmp);
udelay(500);
@@ -147,7 +153,7 @@ static int imx_thermal_probe(struct udevice *dev)
unsigned int fuse = ~0;
 
const struct imx_thermal_plat *pdata = dev_get_platdata(dev);
-   unsigned int *priv = dev_get_priv(dev);
+   struct thermal_data *priv = dev_get_priv(dev);
 
/* Read Temperature calibration data fuse */
fuse_read(pdata-fuse_bank, pdata-fuse_word, fuse);
@@ -158,7 +164,10 @@ static int imx_thermal_probe(struct udevice *dev)
return -EPERM;
}
 
-   *priv = fuse;
+   /* set passive cooling temp to max - 20C */
+   get_cpu_temp_grade(priv-minc, priv-maxc);
+   priv-passive = priv-maxc - 20;
+   priv-fuse = fuse;
 
enable_thermal_clk();
 
@@ -170,6 +179,6 @@ U_BOOT_DRIVER(imx_thermal) = {
.id = UCLASS_THERMAL,
.ops= imx_thermal_ops,
.probe  = imx_thermal_probe,
-   .priv_auto_alloc_size = sizeof(unsigned int),
+   .priv_auto_alloc_size = sizeof(struct thermal_data),
.flags  = DM_FLAG_PRE_RELOC,
 };
-- 
1.9.1

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


[U-Boot] [PATCH v3 2/4] autoboot.c: Remove CONFIG_AUTOBOOT_STOP_STR2 and CONFIG_AUTOBOOT_DELAY_STR2

2015-05-18 Thread Stefan Roese
These defines for a 2nd autoboot stop and delay string are nearly unused. Only
sc3 defines CONFIG_AUTOBOOT_DELAY_STR2. And a patch to remove this most likely
unmaintained board is also posted to the list.

By removing these defines the code will become cleaner and moving the remaining
compile options to Kconfig will get easier.

Signed-off-by: Stefan Roese s...@denx.de
Reviewed-by: Tom Rini tr...@konsulko.com
Reviewed-by: Simon Glass s...@chromium.org
Cc: Wolfgang Denk w...@denx.de
Cc: Heiko Schocher h...@denx.de

---

Changes in v3:
- Added some Acked-by's / Reviewed-by's

Changes in v2: None

 README  |  2 --
 common/autoboot.c   | 14 ++
 doc/README.autoboot | 10 --
 3 files changed, 2 insertions(+), 24 deletions(-)

diff --git a/README b/README
index 1ea397a..edcac69 100644
--- a/README
+++ b/README
@@ -974,8 +974,6 @@ The following options need to be configured:
CONFIG_AUTOBOOT_PROMPT
CONFIG_AUTOBOOT_DELAY_STR
CONFIG_AUTOBOOT_STOP_STR
-   CONFIG_AUTOBOOT_DELAY_STR2
-   CONFIG_AUTOBOOT_STOP_STR2
CONFIG_ZERO_BOOTDELAY_CHECK
CONFIG_RESET_TO_RETRY
 
diff --git a/common/autoboot.c b/common/autoboot.c
index c27cc2c..7c92f3e 100644
--- a/common/autoboot.c
+++ b/common/autoboot.c
@@ -42,9 +42,7 @@ static int abortboot_keyed(int bootdelay)
}
delaykey[] = {
{ .str = getenv(bootdelaykey),  .retry = 1 },
-   { .str = getenv(bootdelaykey2), .retry = 1 },
{ .str = getenv(bootstopkey),   .retry = 0 },
-   { .str = getenv(bootstopkey2),  .retry = 0 },
};
 
char presskey[MAX_DELAY_STOP_STR];
@@ -65,17 +63,9 @@ static int abortboot_keyed(int bootdelay)
if (delaykey[0].str == NULL)
delaykey[0].str = CONFIG_AUTOBOOT_DELAY_STR;
 #  endif
-#  ifdef CONFIG_AUTOBOOT_DELAY_STR2
-   if (delaykey[1].str == NULL)
-   delaykey[1].str = CONFIG_AUTOBOOT_DELAY_STR2;
-#  endif
 #  ifdef CONFIG_AUTOBOOT_STOP_STR
-   if (delaykey[2].str == NULL)
-   delaykey[2].str = CONFIG_AUTOBOOT_STOP_STR;
-#  endif
-#  ifdef CONFIG_AUTOBOOT_STOP_STR2
-   if (delaykey[3].str == NULL)
-   delaykey[3].str = CONFIG_AUTOBOOT_STOP_STR2;
+   if (delaykey[1].str == NULL)
+   delaykey[1].str = CONFIG_AUTOBOOT_STOP_STR;
 #  endif
 
for (i = 0; i  sizeof(delaykey) / sizeof(delaykey[0]); i++) {
diff --git a/doc/README.autoboot b/doc/README.autoboot
index 14e3660..227e3b5 100644
--- a/doc/README.autoboot
+++ b/doc/README.autoboot
@@ -78,13 +78,9 @@ What they do
   CONFIG_AUTOBOOT_PROMPT
   CONFIG_AUTOBOOT_DELAY_STR
   CONFIG_AUTOBOOT_STOP_STR
-  CONFIG_AUTOBOOT_DELAY_STR2
-  CONFIG_AUTOBOOT_STOP_STR2
 
   bootdelaykey  environment variable
   bootstopkey  environment variable
-  bootdelaykey2 environment variable
-  bootstopkey2  environment variable
 
These options give more control over stopping autoboot. When
they are used a specific character or string is required to
@@ -130,12 +126,6 @@ What they do
character of a key string does not appear in the rest of the
string.
 
-   Using the CONFIG_AUTOBOOT_DELAY_STR2 #define or the
-   bootdelaykey2 environment variable and/or the
-   CONFIG_AUTOBOOT_STOP_STR2 #define or the bootstopkey
-   environment variable you can specify a second, alternate
-   string (which allows you to have two password strings).
-
The CONFIG_AUTOBOOT_KEYED_CTRLC #define allows for the boot
sequence to be interrupted by ctrl-c, in addition to the
bootdelaykey and bootstopkey. Setting this variable
-- 
2.4.1

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


[U-Boot] [PATCH v3 3/4] autoboot.c: Move config options to Kconfig

2015-05-18 Thread Stefan Roese
This patch moves the following config options to Kconfig:

CONFIG_AUTOBOOT_KEYED
CONFIG_AUTOBOOT_PROMPT
CONFIG_AUTOBOOT_DELAY_STR
CONFIG_AUTOBOOT_STOP_STR
AUTOBOOT_KEYED_CTRLC

Signed-off-by: Stefan Roese s...@denx.de
Reviewed-by: Simon Glass s...@chromium.org
Cc: Masahiro Yamada yamada.masah...@socionext.com

---

Changes in v3:
- Added additional backslash to the default CONFIG_AUTOBOOT_PROMPT
  string as this seems to be needed for the parser
- Added some Acked-by's / Reviewed-by's

Changes in v2: None

 common/Kconfig   | 64 
 common/autoboot.c|  6 ++-
 configs/CPCI4052_defconfig   |  3 ++
 configs/O2DNT2_RAMBOOT_defconfig |  3 ++
 configs/O2DNT2_defconfig |  3 ++
 configs/PLU405_defconfig |  3 ++
 configs/PMC405DE_defconfig   |  3 ++
 configs/PMC440_defconfig |  3 ++
 configs/UCP1020_SPIFLASH_defconfig   |  3 ++
 configs/UCP1020_defconfig|  3 ++
 configs/a4m072_defconfig |  3 ++
 configs/atngw100_defconfig   |  4 ++
 configs/atngw100mkii_defconfig   |  4 ++
 configs/atstk1002_defconfig  |  4 ++
 configs/atstk1003_defconfig  |  4 ++
 configs/atstk1004_defconfig  |  4 ++
 configs/atstk1006_defconfig  |  4 ++
 configs/calimain_defconfig   |  2 +
 configs/cpuat91_defconfig|  4 ++
 configs/cpuat91_ram_defconfig|  3 ++
 configs/digsy_mtc_RAMBOOT_defconfig  |  3 ++
 configs/digsy_mtc_defconfig  |  3 ++
 configs/digsy_mtc_rev5_RAMBOOT_defconfig |  3 ++
 configs/digsy_mtc_rev5_defconfig |  3 ++
 configs/dlvision-10g_defconfig   |  2 +
 configs/draco_defconfig  |  3 ++
 configs/dxr2_defconfig   |  3 ++
 configs/favr-32-ezkit_defconfig  |  4 ++
 configs/gdppc440etx_defconfig|  2 +
 configs/grasshopper_defconfig|  4 ++
 configs/hammerhead_defconfig |  4 ++
 configs/highbank_defconfig   |  3 ++
 configs/hrcon_defconfig  |  2 +
 configs/ids8313_defconfig|  3 ++
 configs/intip_defconfig  |  2 +
 configs/io64_defconfig   |  2 +
 configs/io_defconfig |  2 +
 configs/iocon_defconfig  |  2 +
 configs/ip04_defconfig   |  1 +
 configs/motionpro_defconfig  |  3 ++
 configs/nokia_rx51_defconfig |  1 +
 configs/omap3_mvblx_defconfig|  2 +
 configs/ph1_ld4_defconfig|  4 ++
 configs/ph1_pro4_defconfig   |  4 ++
 configs/ph1_sld8_defconfig   |  4 ++
 configs/pm9263_defconfig |  1 +
 configs/pxm2_defconfig   |  3 ++
 configs/rut_defconfig|  3 ++
 configs/spear600_defconfig   |  3 ++
 configs/stv0991_defconfig|  3 ++
 configs/x600_defconfig   |  3 ++
 configs/zmx25_defconfig  |  4 ++
 include/configs/CPCI4052.h   |  6 ---
 include/configs/PLU405.h |  9 -
 include/configs/PMC405DE.h   |  6 ---
 include/configs/PMC440.h |  6 ---
 include/configs/UCP1020.h| 11 --
 include/configs/a4m072.h |  4 --
 include/configs/atngw100.h   | 10 -
 include/configs/atngw100mkii.h   | 10 -
 include/configs/atstk1002.h  | 10 -
 include/configs/atstk1003.h  | 10 -
 include/configs/atstk1004.h  | 10 -
 include/configs/atstk1006.h  | 10 -
 include/configs/bf537-stamp.h|  4 --
 include/configs/calimain.h   |  2 -
 include/configs/cpuat91.h|  6 ---
 include/configs/digsy_mtc.h  |  4 --
 include/configs/dlvision-10g.h   |  2 -
 include/configs/favr-32-ezkit.h  | 10 -
 include/configs/gdppc440etx.h|  2 -
 include/configs/grasshopper.h| 10 -
 include/configs/hammerhead.h | 10 -
 include/configs/highbank.h   |  4 +-
 include/configs/hrcon.h  |  2 -
 include/configs/ids8313.h|  4 --
 include/configs/intip.h  |  2 -
 include/configs/io.h |  2 -
 include/configs/io64.h   |  2 -
 include/configs/iocon.h  |  2 -
 include/configs/ip04.h   |  1 -
 include/configs/motionpro.h  |  6 ---
 include/configs/nokia_rx51.h |  1 -
 include/configs/o2dnt-common.h   | 12 --
 include/configs/omap3_mvblx.h|  2 -
 include/configs/pm9263.h |  1 -
 include/configs/siemens-am33x-common.h   |  6 ---
 include/configs/spear-common.h   |  4 --
 include/configs/stv0991.h  

[U-Boot] [Patch v3 1/4] mx6: add OTP bank1 registers

2015-05-18 Thread Tim Harvey
Signed-off-by: Tim Harvey thar...@gateworks.com
---
 arch/arm/include/asm/arch-mx6/imx-regs.h | 19 +++
 1 file changed, 19 insertions(+)

diff --git a/arch/arm/include/asm/arch-mx6/imx-regs.h 
b/arch/arm/include/asm/arch-mx6/imx-regs.h
index 9a4ad8b..35bb005 100644
--- a/arch/arm/include/asm/arch-mx6/imx-regs.h
+++ b/arch/arm/include/asm/arch-mx6/imx-regs.h
@@ -640,6 +640,25 @@ struct fuse_bank0_regs {
u32 rsvd7[3];
 };
 
+struct fuse_bank1_regs {
+   u32 mem0;
+   u32 rsvd0[3];
+   u32 mem1;
+   u32 rsvd1[3];
+   u32 mem2;
+   u32 rsvd2[3];
+   u32 mem3;
+   u32 rsvd3[3];
+   u32 mem4;
+   u32 rsvd4[3];
+   u32 ana0;
+   u32 rsvd5[3];
+   u32 ana1;
+   u32 rsvd6[3];
+   u32 ana2;
+   u32 rsvd7[3];
+};
+
 #ifdef CONFIG_MX6SX
 struct fuse_bank4_regs {
u32 sjc_resp_low;
-- 
1.9.1

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


[U-Boot] [PATCH 02/20] armv8/ls2085ardb: add hwconfig setting for eSDHC

2015-05-18 Thread Prabhakar Kushwaha
From: Yangbo Lu yangbo...@freescale.com

Add hwconfig setting for eSDHC since it shares some pins with other
IP block.

Signed-off-by: Yangbo Lu yangbo...@freescale.com
Signed-off-by: Prabhakar Kushwaha prabha...@freescale.com
---
 board/freescale/ls2085ardb/ls2085ardb.c | 36 +
 include/configs/ls2085ardb.h|  2 ++
 2 files changed, 38 insertions(+)

diff --git a/board/freescale/ls2085ardb/ls2085ardb.c 
b/board/freescale/ls2085ardb/ls2085ardb.c
index 6cb7b13..e0a8a41 100644
--- a/board/freescale/ls2085ardb/ls2085ardb.c
+++ b/board/freescale/ls2085ardb/ls2085ardb.c
@@ -10,6 +10,7 @@
 #include fsl_ifc.h
 #include fsl_ddr.h
 #include asm/io.h
+#include hwconfig.h
 #include fdt_support.h
 #include libfdt.h
 #include fsl_debug_server.h
@@ -21,8 +22,15 @@
 #include ../common/qixis.h
 #include ls2085ardb_qixis.h
 
+#define PIN_MUX_SEL_SDHC   0x00
+
+#define SET_SDHC_MUX_SEL(reg, value)   ((reg  0xf0) | value)
 DECLARE_GLOBAL_DATA_PTR;
 
+enum {
+   MUX_TYPE_SDHC,
+};
+
 unsigned long long get_qixis_addr(void)
 {
unsigned long long addr;
@@ -129,6 +137,34 @@ int board_early_init_f(void)
return 0;
 }
 
+int config_board_mux(int ctrl_type)
+{
+   u8 reg5;
+
+   reg5 = QIXIS_READ(brdcfg[5]);
+
+   switch (ctrl_type) {
+   case MUX_TYPE_SDHC:
+   reg5 = SET_SDHC_MUX_SEL(reg5, PIN_MUX_SEL_SDHC);
+   break;
+   default:
+   printf(Wrong mux interface type\n);
+   return -1;
+   }
+
+   QIXIS_WRITE(brdcfg[5], reg5);
+
+   return 0;
+}
+
+int misc_init_r(void)
+{
+   if (hwconfig(sdhc))
+   config_board_mux(MUX_TYPE_SDHC);
+
+   return 0;
+}
+
 void detail_board_ddr_info(void)
 {
puts(\nDDR);
diff --git a/include/configs/ls2085ardb.h b/include/configs/ls2085ardb.h
index 62f13f9..29c934e 100644
--- a/include/configs/ls2085ardb.h
+++ b/include/configs/ls2085ardb.h
@@ -288,6 +288,8 @@ unsigned long get_board_sys_clk(void);
 #define CONFIG_DOS_PARTITION
 #endif
 
+#define CONFIG_MISC_INIT_R
+
 /* Initial environment variables */
 #undef CONFIG_EXTRA_ENV_SETTINGS
 #define CONFIG_EXTRA_ENV_SETTINGS  \
-- 
1.9.1


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


[U-Boot] [PATCH v3 0/4] arm: mvebu: Allow DB-88F6820-GP to boot Linux

2015-05-18 Thread Kevin Smith
Changes needed to allow the DB-88F6820-GP development board to successfully
boot a Linux kernel.

Changes in v3:
- Correct coding-style errors
- Correct config macro style error
- Add acked-by lines

Kevin Smith (3):
  arm: mvebu: Update CBAR with SOC regs base
  mv-common.h: Include support for device trees
  db-88f6820-gp.h: Load data blobs into lower memory

Stefan Roese (1):
  arm: mvebu: Disable L2 cache before enabling d-cache

 arch/arm/mach-mvebu/cpu.c   | 15 +++
 include/configs/db-88f6820-gp.h |  5 +
 include/configs/mv-common.h |  2 ++
 3 files changed, 22 insertions(+)

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


Re: [U-Boot] [PATCH v3 1/2] ARM: zynq: add separate configuration for ZC702 and ZC706

2015-05-18 Thread Joe Hershberger
Hi Masahiro-san,

On Mon, May 18, 2015 at 1:31 AM, Masahiro Yamada
yamada.masah...@socionext.com wrote:
 Prior to this commit, ZC702 and ZC706 shared the same configuration
 and were built as follows:

 ZC702: make zynq_zc70x_defconfig  make
 ZC706: make zynq_zc70x_defconfig  make DEVICE_TREE=zynq-zc706

 This commit introduces separate configuration for them, which makes
 the next commit much easier.

 Going forward, the recommended build commands are:

 ZC702: make zynq_zc702_defconfig  make
 ZC706: make zynq_zc706_defconfig  make

 Although the old work flow is still supported, CONFIG_TARGET_ZC70X
 has been marked as deprecated.  If used, the warning message is
 shown to prompt users to switch to the new scheme.

 Signed-off-by: Masahiro Yamada yamada.masah...@socionext.com
 ---

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


Re: [U-Boot] [PATCH v2 0/4] New tag for Flattened Image Trees (FIT) - Booting Xen from a FIT.

2015-05-18 Thread Karl Apsite
Hi Simon,

On 05/18/2015 11:28 AM, Simon Glass wrote:
 +Tom in case he has a comment
 
 Hi Karl,
 
 On 15 May 2015 at 15:13, Karl Apsite karl.aps...@dornerworks.com wrote:

 The FIT config now supports a tag named loadables: which is a
 comma separated list.  Users can add any number of images to the list,
 and u-boot will move the selected binaries to their listed
 load_addresses. This allows u-boot to boot xen from using an FIT
 configuration.  Xen expects a kernel to be placed at a predetermined
 location, however the kernel field was already filled by xen itself.
 This change allows the user to move the required binary before xen
 boots, all within the FIT's configuration.

 
 I think I've convinced myself that this ('loadables') is a good
 solution to the problem. I'm not 100% comfortable with the name but I
 don't have a better one, and no one else has chimed in.
 
 Will you actually use multiple images in your application?
 
We initially wanted to create this feature for Xen initially, and that only
required loading one loadable, or simply another kernel binary along side the
first one.

While I was working on loading another binary in this fashion, we thought of a
few other use cases that might benefit from this feature involving a number of
the embedded systems we work with.  Many of our use cases involve other
peripheries that need to be configured or programmed with data during the boot
process.  By extending this configuration to an FIT, we can load/configure
N-number of peripherals during boot, and gain some of the benefits that an FIT
can provide:
 - Automatic checksum validation
 - Multiple configurations at the ready, all inside one pre-baked image
 - All while keeping the interface that a customer might use relatively simple
` bootm #config@2` or `#config@3`, etc.
This is quite beneficial when we'd normally have to rely on u-boot scripts to do
everything instead.

As a final consideration (and to be clear, this is requires a lot more
investigation), one of the long-term goals that has been proposed to Xen,
involves splitting up the master control domain (known as dom0) into a number
of smaller domains/microkernels, each responsible for a certain task/service.
E.G. a networking domain, a file-system IO domain, etc.  So while this doesn't
solve a large number of problems that are currently blocking that complex
feature, this might help open the door to allow Xen to break components/services
into different executables/kernels, and load them simultaneously.

 Karl Apsite (4):
   add test for two 'loadables'
   mkimage will now report information about loadable
   add boot_get_loadables() to load listed images
   Combine bootm_find_thing functions together

  common/bootm.c| 49 ---
  common/cmd_bootm.c|  4 +-
  common/image-fit.c| 25 +++-
  common/image.c| 71 
 ++
  doc/uImage.FIT/source_file_format.txt |  4 ++
  include/bootm.h   |  2 +-
  include/bootstage.h   |  1 +
  include/image.h   | 28 +-
  test/image/test-fit.py| 73 
 ++-
  9 files changed, 221 insertions(+), 36 deletions(-)

 --
 2.3.7

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


Re: [U-Boot] [PATCH 10/11] usb: ehci-vf: Add weak function for board specific initialisation

2015-05-18 Thread Marek Vasut
On Monday, May 18, 2015 at 03:06:28 PM, Bhuvanchandra DV wrote:
 From: Sanchayan Maity maitysancha...@gmail.com
 
 Add a weak function board_ehci_hcd_init which can be used by the board
 file for board specific initialisation.
 
 Signed-off-by: Sanchayan Maity maitysancha...@gmail.com

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

What I do not like is that you're sending a patch series which affects
multiple subsystems and which contains patches which should go through
multiple trees. Yet, you submit it all in one huge series.

I guess the best way out of this is to push all this stuff via u-boot-imx now?

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


[U-Boot] [PATCH] odroid: dts: cleanup of MAX77686 regulators

2015-05-18 Thread Przemyslaw Marczak
This commit cleanup MAX77686 regulator node by:
- remove the sub-nodes of unconnected regulators
- remove the regulator-compatible properties of all regulators

This prevents printing init errors for the regulators,
with duplicated name strings.

Signed-off-by: Przemyslaw Marczak p.marc...@samsung.com
Cc: Minkyu Kang mk7.k...@samsung.com
---
 arch/arm/dts/exynos4412-odroid.dts | 80 +-
 1 file changed, 2 insertions(+), 78 deletions(-)

diff --git a/arch/arm/dts/exynos4412-odroid.dts 
b/arch/arm/dts/exynos4412-odroid.dts
index 415dfea..d572f1e 100644
--- a/arch/arm/dts/exynos4412-odroid.dts
+++ b/arch/arm/dts/exynos4412-odroid.dts
@@ -43,140 +43,102 @@
 
voltage-regulators {
ldo1_reg: ldo1 {
-   regulator-compatible = LDO1;
regulator-name = VDD_ALIVE_1.0V;
regulator-min-microvolt = 100;
regulator-max-microvolt = 100;
};
 
ldo2_reg: ldo2 {
-   regulator-compatible = LDO2;
regulator-name = VDDQ_VM1M2_1.2V;
regulator-min-microvolt = 120;
regulator-max-microvolt = 120;
};
 
ldo3_reg: ldo3 {
-   regulator-compatible = LDO3;
regulator-name = VCC_1.8V_AP;
regulator-min-microvolt = 180;
regulator-max-microvolt = 180;
};
 
ldo4_reg: ldo4 {
-   regulator-compatible = LDO4;
regulator-name = VDDQ_MMC2_2.8V;
regulator-min-microvolt = 280;
regulator-max-microvolt = 280;
};
 
ldo5_reg: ldo5 {
-   regulator-compatible = LDO5;
regulator-name = VDDQ_MMC0/1/3_1.8V;
regulator-min-microvolt = 180;
regulator-max-microvolt = 180;
};
 
ldo6_reg: ldo6 {
-   regulator-compatible = LDO6;
regulator-name = VMPLL_1.0V;
regulator-min-microvolt = 110;
regulator-max-microvolt = 110;
};
 
ldo7_reg: ldo7 {
-   regulator-compatible = LDO7;
regulator-name = VPLL_1.1V;
regulator-min-microvolt = 110;
regulator-max-microvolt = 110;
};
 
ldo8_reg: ldo8 {
-   regulator-compatible = LDO8;
regulator-name = VDD_MIPI/HDMI_1.0V;
regulator-min-microvolt = 100;
regulator-max-microvolt = 100;
};
 
-   ldo9_reg: ldo9 {
-   regulator-compatible = LDO9;
-   regulator-name = nc;
-   regulator-min-microvolt = 180;
-   regulator-max-microvolt = 180;
-   };
-
ldo10_reg: ldo10 {
-   regulator-compatible = LDO10;
regulator-name = VDD_MIPI/HDMI_1.8V;
regulator-min-microvolt = 180;
regulator-max-microvolt = 180;
};
 
ldo11_reg: ldo11 {
-   regulator-compatible = LDO11;
regulator-name = VDD_ABB1_1.8V;
regulator-min-microvolt = 180;
regulator-max-microvolt = 180;
};
 
ldo12_reg: ldo12 {
-   

[U-Boot] [PATCH v3 4/4] db-88f6820-gp.h: Load data blobs into lower memory

2015-05-18 Thread Kevin Smith
By default on this platform, u-boot loads data into high memory
in the range of 0x7Fxx, which generates a data abort when the
kernel tries to read it.  Config the u-boot environment to load
the device tree and initrd image into lower memory to make them
accessible to the kernel.

Signed-off-by: Kevin Smith kevin.sm...@elecsyscorp.com
Acked-by: Stefan Roese s...@denx.de
---
 include/configs/db-88f6820-gp.h | 5 +
 1 file changed, 5 insertions(+)

diff --git a/include/configs/db-88f6820-gp.h b/include/configs/db-88f6820-gp.h
index 12a24ce..95a05e6 100644
--- a/include/configs/db-88f6820-gp.h
+++ b/include/configs/db-88f6820-gp.h
@@ -63,6 +63,11 @@
 #define CONFIG_SYS_CONSOLE_INFO_QUIET  /* don't print console @ startup */
 #define CONFIG_SYS_ALT_MEMTEST
 
+/* Keep device tree and initrd in lower memory so the kernel can access them */
+#define CONFIG_EXTRA_ENV_SETTINGS  \
+   fdt_high=0x1000\0 \
+   initrd_high=0x1000\0
+
 /*
  * mv-common.h should be defined after CMD configs since it used them
  * to enable certain macros
-- 
2.3.2
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v3 3/4] mv-common.h: Include support for device trees

2015-05-18 Thread Kevin Smith
Signed-off-by: Kevin Smith kevin.sm...@elecsyscorp.com
Acked-by: Stefan Roese s...@denx.de
---
 include/configs/mv-common.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/configs/mv-common.h b/include/configs/mv-common.h
index 51436da..4039b71 100644
--- a/include/configs/mv-common.h
+++ b/include/configs/mv-common.h
@@ -59,6 +59,8 @@
 #define CONFIG_BOOTDELAY   3   /* default enable autoboot */
 #define CONFIG_PREBOOT
 
+#define CONFIG_OF_LIBFDT   /* Device tree support */
+
 /*
  * For booting Linux, the board info and command line data
  * have to be in the first 8 MB of memory, since this is
-- 
2.3.2
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v3 2/4] arm: mvebu: Update CBAR with SOC regs base

2015-05-18 Thread Kevin Smith
SMP-enabled Linux kernels read the CBAR register in CP15 to find
the address of the SCU registers.  After remapping internal
registers, also update the CBAR so the kernel can find them.

Signed-off-by: Kevin Smith kevin.sm...@elecsyscorp.com
Acked-by: Stefan Roese s...@denx.de
---
 arch/arm/mach-mvebu/cpu.c | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/arch/arm/mach-mvebu/cpu.c b/arch/arm/mach-mvebu/cpu.c
index 417fc35..0121db8 100644
--- a/arch/arm/mach-mvebu/cpu.c
+++ b/arch/arm/mach-mvebu/cpu.c
@@ -161,10 +161,17 @@ static void update_sdram_window_sizes(void)
 }
 
 #ifdef CONFIG_ARCH_CPU_INIT
+static void set_cbar(u32 addr)
+{
+   asm(mcr p15, 4, %0, c15, c0 : : r (addr));
+}
+
+
 int arch_cpu_init(void)
 {
/* Linux expects the internal registers to be at 0xf100 */
writel(SOC_REGS_PHY_BASE, INTREG_BASE_ADDR_REG);
+   set_cbar(SOC_REGS_PHY_BASE + 0xC000);
 
/*
 * We need to call mvebu_mbus_probe() before calling
-- 
2.3.2
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v3 1/4] arm: mvebu: Disable L2 cache before enabling d-cache

2015-05-18 Thread Kevin Smith
From: Stefan Roese s...@denx.de

L2 cache may still be enabled by the BootROM. We need to first disable
it before enabling d-cache support.

Signed-off-by: Stefan Roese s...@denx.de
Tested-by: Kevin Smith kevin.sm...@elecsyscorp.com
---
 arch/arm/mach-mvebu/cpu.c | 8 
 1 file changed, 8 insertions(+)

diff --git a/arch/arm/mach-mvebu/cpu.c b/arch/arm/mach-mvebu/cpu.c
index 04681fc..417fc35 100644
--- a/arch/arm/mach-mvebu/cpu.c
+++ b/arch/arm/mach-mvebu/cpu.c
@@ -7,6 +7,7 @@
 #include common.h
 #include netdev.h
 #include asm/io.h
+#include asm/pl310.h
 #include asm/arch/cpu.h
 #include asm/arch/soc.h
 
@@ -240,6 +241,13 @@ int cpu_eth_init(bd_t *bis)
 #ifndef CONFIG_SYS_DCACHE_OFF
 void enable_caches(void)
 {
+   struct pl310_regs *const pl310 =
+   (struct pl310_regs *)CONFIG_SYS_PL310_BASE;
+
+   /* First disable L2 cache - may still be enable from BootROM */
+   if (mvebu_soc_family() == MVEBU_SOC_A38X)
+   clrbits_le32(pl310-pl310_ctrl, L2X0_CTRL_EN);
+
/* Avoid problem with e.g. neta ethernet driver */
invalidate_dcache_all();
 
-- 
2.3.2
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3 2/2] ARM: zynq: add default ps7_init_gpl.c/h for Zed, MicroZed, ZC70x

2015-05-18 Thread Joe Hershberger
Hi Masahiro-san

On Mon, May 18, 2015 at 1:31 AM, Masahiro Yamada
yamada.masah...@socionext.com wrote:
 Due to licensing issues, the files ps7_init.c/h are not able to be
 distributed with U-Boot source code.  Recent Xilinx tools also
 provide the GPL variants (ps7_init_gpl.c/h), compatible with U-Boot
 license.

 Prior to this commit, we had to copy ps7_init files into
 board/xilinx/zynq/ before the compile.

 To be more user-friendly, let's include ps7_init_gpl.c/h for
 Zedboard, MicroZed, ZC702, ZC706.

 These init code have been taken from the hwplatform_templates
 directory of Xilinx SDK 2014.4.

 You can still use customized ps7_init_gpl.c/h by enabling
 CONFIG_ZYNQ_CUSTOM_INIT.  The recommended directory for storing them
 is now board/xilinx/zynq/custom_hw_platform, but board/xilinx/zynq
 is still supported for backward compatibility.  The latter emits
 a warning message to prompt users to gradually switch to the new
 directory.

 Signed-off-by: Masahiro Yamada yamada.masah...@socionext.com
 Acked-by: Sören Brinkmann soren.brinkm...@xilinx.com
 ---

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


[U-Boot] [PATCH] net/fm: Update FMan Compatibels

2015-05-18 Thread Igal . Liberman
From: Igal Liberman igal.liber...@freescale.com

During FMan upstreaming, the FMan Port and MAC compatibles changed.
This patch aligns the FMan Port and MAC compatibles to the FMan
device tree binding document.

The FMan device tree binding document can be found in the Linux kernel:
./Documentation/devicetree/bindings/powerpc/fsl/fman.txt

Signed-off-by: Igal Liberman igal.liber...@freescale.com
---
 arch/powerpc/include/asm/fsl_liodn.h |   20 
 drivers/net/fm/init.c|4 ++--
 2 files changed, 18 insertions(+), 6 deletions(-)

diff --git a/arch/powerpc/include/asm/fsl_liodn.h 
b/arch/powerpc/include/asm/fsl_liodn.h
index 811f034..d493f8c 100644
--- a/arch/powerpc/include/asm/fsl_liodn.h
+++ b/arch/powerpc/include/asm/fsl_liodn.h
@@ -133,15 +133,27 @@ extern void fdt_fixup_liodn(void *blob);
CONFIG_SYS_FSL_FM##fmNum##_OFFSET + \
offsetof(struct ccsr_fman, fm_bmi_common.fmbm_ppid[portID - 1])
 
-/* enetNum is 0, 1, 2... so we + 8 for 1g to get to HW Port ID */
+#ifdef CONFIG_SYS_FMAN_V3
+#define SET_FMAN_RX_1G_LIODN(fmNum, enetNum, liodn) \
+   _SET_FMAN_RX_1G_LIODN(fsl,fman-v3-port-rx, fmNum, enetNum, liodn)
+#define SET_FMAN_RX_10G_LIODN(fmNum, enetNum, liodn) \
+   _SET_FMAN_RX_10G_LION(fsl,fman-v3-port-rx, fmNum, enetNum, liodn)
+#else
 #define SET_FMAN_RX_1G_LIODN(fmNum, enetNum, liodn) \
-   SET_LIODN_ENTRY_1(fsl,fman-port-1g-rx, liodn, \
+   _SET_FMAN_RX_1G_LIODN(fsl,fman-v2-port-rx, fmNum, enetNum, liodn)
+#define SET_FMAN_RX_10G_LIODN(fmNum, enetNum, liodn) \
+   _SET_FMAN_RX_10G_LIODN(fsl,fman-v2-port-rx, fmNum, enetNum, liodn)
+#endif
+
+/* enetNum is 0, 1, 2... so we + 8 for 1g to get to HW Port ID */
+#define _SET_FMAN_RX_1G_LIODN(compatible, fmNum, enetNum, liodn) \
+   SET_LIODN_ENTRY_1(compatible, liodn, \
FM_PPID_RX_PORT_OFFSET(fmNum, enetNum + 8), \
CONFIG_SYS_FSL_FM##fmNum##_RX##enetNum##_1G_OFFSET) \
 
 /* enetNum is 0, 1, 2... so we + 16 for 10g to get to HW Port ID */
-#define SET_FMAN_RX_10G_LIODN(fmNum, enetNum, liodn) \
-   SET_LIODN_ENTRY_1(fsl,fman-port-10g-rx, liodn, \
+#define _SET_FMAN_RX_10G_LIODN(compatible, fmNum, enetNum, liodn)  \
+   SET_LIODN_ENTRY_1(compatible, liodn, \
FM_PPID_RX_PORT_OFFSET(fmNum, enetNum + 16), \
CONFIG_SYS_FSL_FM##fmNum##_RX##enetNum##_10G_OFFSET) \
 
diff --git a/drivers/net/fm/init.c b/drivers/net/fm/init.c
index 9a8a007..4e43cca 100644
--- a/drivers/net/fm/init.c
+++ b/drivers/net/fm/init.c
@@ -306,9 +306,9 @@ void fdt_fixup_fman_ethernet(void *blob)
 #else
for (i = 0; i  ARRAY_SIZE(fm_info); i++) {
if (fm_info[i].type == FM_ETH_1G_E)
-   ft_fixup_port(blob, fm_info[i], fsl,fman-1g-mac);
+   ft_fixup_port(blob, fm_info[i], fsl,fman-dtsec);
else
-   ft_fixup_port(blob, fm_info[i], fsl,fman-10g-mac);
+   ft_fixup_port(blob, fm_info[i], fsl,fman-xgec);
}
 #endif
 }
-- 
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 3/4] arm: ls102xa: Enable Driver Model SPI for ls1021aqds

2015-05-18 Thread York Sun
Haikun,

On 05/18/2015 06:24 AM, Haikun Wang wrote:
 Enable Driver Model SPI for ls1021aqds board.
 DSPI and QSPI is enabled only when boot from QSPI.
 DSPI and QSPI are compatible under Driver Model SPI.
 
 Signed-off-by: Haikun Wang haikun.w...@freescale.com
 ---
 Changes in v3:
 - Remove CONFIG_SPI_FLASH_ATMEL
 - IS_ENABLED(CONFIG_XXX) is only work with configure option in Kconfig,
   and DM core code use IS_ENABLED(), so configure option in head file
   can't work, so remove CONFIG_OF_CONTROL CONFIG_OF_SEPARATE CONFIG_DM 
 CONFIG_DM_SPI
 
 Changes in v2:
 - Move all changes inside of CONFIG_QSPI_BOOT 
 
 Changes in v1: None
  include/configs/ls1021aqds.h | 13 +++--
  1 file changed, 11 insertions(+), 2 deletions(-)


I lost track of your patch set. You have v3 3/4 and v3 4/4. Where are the first
two patches in this set?

The subject arm:ls102xa is not too bad. For future patches, I prefer the subject
to be arch/soc, or arch/board. This one should have arm/ls1021aqds, or
armv7/ls1021aqds. It helps maintainers to delegate the patches to custodians.

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


Re: [U-Boot] [PATCH 10/11] usb: ehci-vf: Add weak function for board specific initialisation

2015-05-18 Thread maitysanchayan
Hello Marek,

On 15-05-18 19:09:58, Marek Vasut wrote:
 On Monday, May 18, 2015 at 03:06:28 PM, Bhuvanchandra DV wrote:
  From: Sanchayan Maity maitysancha...@gmail.com
  
  Add a weak function board_ehci_hcd_init which can be used by the board
  file for board specific initialisation.
  
  Signed-off-by: Sanchayan Maity maitysancha...@gmail.com
 
 Acked-by: Marek Vasut ma...@denx.de
 
 What I do not like is that you're sending a patch series which affects
 multiple subsystems and which contains patches which should go through
 multiple trees. Yet, you submit it all in one huge series.

If required I can send in the last two patches affecting the USB 
susbsystem later once the rest of the patchset gets merged, if this is 
not acceptable?.

Since these last two were dependent on the GPIO patches I thought 
perhaps it is better that they go along with the GPIO patches as a 
coherent whole.

 
 I guess the best way out of this is to push all this stuff via u-boot-imx now?
 
 Best regards,
 Marek Vasut

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


Re: [U-Boot] [PATCH 10/11] usb: ehci-vf: Add weak function for board specific initialisation

2015-05-18 Thread Marek Vasut
On Monday, May 18, 2015 at 08:52:59 PM, maitysancha...@gmail.com wrote:
 Hello Marek,

Hi!

 On 15-05-18 19:09:58, Marek Vasut wrote:
  On Monday, May 18, 2015 at 03:06:28 PM, Bhuvanchandra DV wrote:
   From: Sanchayan Maity maitysancha...@gmail.com
   
   Add a weak function board_ehci_hcd_init which can be used by the board
   file for board specific initialisation.
   
   Signed-off-by: Sanchayan Maity maitysancha...@gmail.com
  
  Acked-by: Marek Vasut ma...@denx.de
  
  What I do not like is that you're sending a patch series which affects
  multiple subsystems and which contains patches which should go through
  multiple trees. Yet, you submit it all in one huge series.
 
 If required I can send in the last two patches affecting the USB
 susbsystem later once the rest of the patchset gets merged, if this is
 not acceptable?.
 
 Since these last two were dependent on the GPIO patches I thought
 perhaps it is better that they go along with the GPIO patches as a
 coherent whole.

I think if there's no oposition, just push this all via u-boot-imx .
I don't plan to block it, but subsystem stuff should usually go though
subsystem trees.

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


[U-Boot] [PATCHv3 0/3] drivers/ddr/altera: Add the DDR controller driver for SoCFPGA

2015-05-18 Thread dinguyen
From: Dinh Nguyen dingu...@opensource.altera.com

Hi,

This is V3 of patch series that adds the DDR controller driver for Altera's
SoCFPGA platform.

V3:
- Clean up to address comments from Marek for the calibration portion.

V2:
- Clean up to address comments from Pavel

Thanks,

Dinh Nguyen (3):
  driver/ddr/altera: Add DDR driver for Altera's SDRAM controller
  driver/ddr/altera/: Add the sdram calibration portion
  arm: socfpga: enable the Altera SDRAM controller driver

 Makefile |1 +
 arch/arm/include/asm/arch-socfpga/sdram.h|  306 ++
 arch/arm/include/asm/arch-socfpga/sdram_config.h |  100 +
 drivers/ddr/altera/Makefile  |   11 +
 drivers/ddr/altera/sdram.c   |  799 +
 drivers/ddr/altera/sequencer.c   | 4121 ++
 drivers/ddr/altera/sequencer.h   |  322 ++
 drivers/ddr/altera/sequencer_auto.h  |  128 +
 drivers/ddr/altera/sequencer_auto_ac_init.h  |   84 +
 drivers/ddr/altera/sequencer_auto_inst_init.h|  268 ++
 drivers/ddr/altera/sequencer_defines.h   |  121 +
 include/configs/socfpga_common.h |5 +
 scripts/Makefile.spl |1 +
 13 files changed, 6267 insertions(+)
 create mode 100644 arch/arm/include/asm/arch-socfpga/sdram.h
 create mode 100644 arch/arm/include/asm/arch-socfpga/sdram_config.h
 create mode 100644 drivers/ddr/altera/Makefile
 create mode 100644 drivers/ddr/altera/sdram.c
 create mode 100644 drivers/ddr/altera/sequencer.c
 create mode 100644 drivers/ddr/altera/sequencer.h
 create mode 100644 drivers/ddr/altera/sequencer_auto.h
 create mode 100644 drivers/ddr/altera/sequencer_auto_ac_init.h
 create mode 100644 drivers/ddr/altera/sequencer_auto_inst_init.h
 create mode 100644 drivers/ddr/altera/sequencer_defines.h

-- 
2.2.1

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


[U-Boot] [PATCHv3 1/3] driver/ddr/altera: Add DDR driver for Altera's SDRAM controller

2015-05-18 Thread dinguyen
From: Dinh Nguyen dingu...@opensource.altera.com

This patch enables the SDRAM controller that is used on Altera's SoCFPGA
family. This patch configures the SDRAM controller based on a configuration
file that is generated from the Quartus tool, sdram_config.h.

Signed-off-by: Dinh Nguyen dingu...@opensource.altera.com
---
v2: clean up from comments from Pavel
---
 Makefile |   1 +
 arch/arm/include/asm/arch-socfpga/sdram.h| 306 +
 arch/arm/include/asm/arch-socfpga/sdram_config.h | 100 +++
 drivers/ddr/altera/sdram.c   | 799 +++
 scripts/Makefile.spl |   1 +
 5 files changed, 1207 insertions(+)
 create mode 100644 arch/arm/include/asm/arch-socfpga/sdram.h
 create mode 100644 arch/arm/include/asm/arch-socfpga/sdram_config.h
 create mode 100644 drivers/ddr/altera/sdram.c

diff --git a/Makefile b/Makefile
index 0f7d583..163d530 100644
--- a/Makefile
+++ b/Makefile
@@ -649,6 +649,7 @@ libs-y += drivers/power/ \
 libs-y += drivers/spi/
 libs-$(CONFIG_FMAN_ENET) += drivers/net/fm/
 libs-$(CONFIG_SYS_FSL_DDR) += drivers/ddr/fsl/
+libs-$(CONFIG_ALTERA_SDRAM) += drivers/ddr/altera/
 libs-y += drivers/serial/
 libs-y += drivers/usb/dwc3/
 libs-y += drivers/usb/eth/
diff --git a/arch/arm/include/asm/arch-socfpga/sdram.h 
b/arch/arm/include/asm/arch-socfpga/sdram.h
new file mode 100644
index 000..b4c1a2f
--- /dev/null
+++ b/arch/arm/include/asm/arch-socfpga/sdram.h
@@ -0,0 +1,306 @@
+/*
+ * Copyright Altera Corporation (C) 2014-2015
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+#ifndef_SDRAM_H_
+#define_SDRAM_H_
+
+#ifndef __ASSEMBLY__
+
+unsigned long sdram_calculate_size(void);
+unsigned sdram_mmr_init_full(unsigned int sdr_phy_reg);
+int sdram_calibration_full(void);
+
+extern int sdram_calibration(void);
+
+#define SDR_CTRLGRP_ADDRESS 0x5000
+
+struct socfpga_sdr_ctrl {
+   u32 ctrl_cfg;
+   u32 dram_timing1;
+   u32 dram_timing2;
+   u32 dram_timing3;
+   u32 dram_timing4;   /* 0x10 */
+   u32 lowpwr_timing;
+   u32 dram_odt;
+   u32 __padding0[4];
+   u32 dram_addrw; /* 0x2c */
+   u32 dram_if_width;  /* 0x30 */
+   u32 dram_dev_width;
+   u32 dram_sts;
+   u32 dram_intr;
+   u32 sbe_count;  /* 0x40 */
+   u32 dbe_count;
+   u32 err_addr;
+   u32 drop_count;
+   u32 drop_addr;  /* 0x50 */
+   u32 lowpwr_eq;
+   u32 lowpwr_ack;
+   u32 static_cfg;
+   u32 ctrl_width; /* 0x60 */
+   u32 cport_width;
+   u32 cport_wmap;
+   u32 cport_rmap;
+   u32 rfifo_cmap; /* 0x70 */
+   u32 wfifo_cmap;
+   u32 cport_rdwr;
+   u32 port_cfg;
+   u32 fpgaport_rst;   /* 0x80 */
+   u32 __padding1;
+   u32 fifo_cfg;
+   u32 protport_default;
+   u32 prot_rule_addr; /* 0x90 */
+   u32 prot_rule_id;
+   u32 prot_rule_data;
+   u32 prot_rule_rdwr;
+   u32 __padding2[3];
+   u32 mp_priority;/* 0xac */
+   u32 mp_weight0; /* 0xb0 */
+   u32 mp_weight1;
+   u32 mp_weight2;
+   u32 mp_weight3;
+   u32 mp_pacing0; /* 0xc0 */
+   u32 mp_pacing1;
+   u32 mp_pacing2;
+   u32 mp_pacing3;
+   u32 mp_threshold0;  /* 0xd0 */
+   u32 mp_threshold1;
+   u32 mp_threshold2;
+   u32 __padding3[29];
+   u32 phy_ctrl0;  /* 0x150 */
+   u32 phy_ctrl1;
+   u32 phy_ctrl2;
+};
+
+struct sdram_prot_rule {
+   uint64_tsdram_start; /* SDRAM start address */
+   uint64_tsdram_end; /* SDRAM end address */
+   uint32_trule; /* SDRAM protection rule number: 0-19 */
+   int valid; /* Rule valid or not? 1 - valid, 0 not*/
+
+   uint32_tsecurity;
+   uint32_tportmask;
+   uint32_tresult;
+   uint32_tlo_prot_id;
+   uint32_thi_prot_id;
+};
+
+#define SDR_CTRLGRP_CTRLCFG_NODMPINS_LSB 23
+#define SDR_CTRLGRP_CTRLCFG_NODMPINS_MASK 0x0080
+#define SDR_CTRLGRP_CTRLCFG_DQSTRKEN_LSB 22
+#define SDR_CTRLGRP_CTRLCFG_DQSTRKEN_MASK 0x0040
+#define SDR_CTRLGRP_CTRLCFG_STARVELIMIT_LSB 16
+#define SDR_CTRLGRP_CTRLCFG_STARVELIMIT_MASK 0x003f
+#define SDR_CTRLGRP_CTRLCFG_REORDEREN_LSB 15
+#define SDR_CTRLGRP_CTRLCFG_REORDEREN_MASK 0x8000
+#define SDR_CTRLGRP_CTRLCFG_ECCCORREN_LSB 11
+#define SDR_CTRLGRP_CTRLCFG_ECCCORREN_MASK 0x0800
+#define SDR_CTRLGRP_CTRLCFG_ECCEN_LSB 10
+#define SDR_CTRLGRP_CTRLCFG_ECCEN_MASK 0x0400
+#define SDR_CTRLGRP_CTRLCFG_ADDRORDER_LSB 8
+#define SDR_CTRLGRP_CTRLCFG_ADDRORDER_MASK 0x0300
+#define SDR_CTRLGRP_CTRLCFG_MEMBL_LSB 3
+#define SDR_CTRLGRP_CTRLCFG_MEMBL_MASK 0x00f8
+#define 

[U-Boot] [PATCHv3 3/3] arm: socfpga: enable the Altera SDRAM controller driver

2015-05-18 Thread dinguyen
From: Dinh Nguyen dingu...@opensource.altera.com

Enable the Altera SDRAM driver for the SoCFPGA platform.

Signed-off-by: Dinh Nguyen dingu...@opensource.altera.com
---
 include/configs/socfpga_common.h | 5 +
 1 file changed, 5 insertions(+)

diff --git a/include/configs/socfpga_common.h b/include/configs/socfpga_common.h
index cae744d..9b52050 100644
--- a/include/configs/socfpga_common.h
+++ b/include/configs/socfpga_common.h
@@ -77,6 +77,11 @@
 #define CONFIG_SYS_PL310_BASE  SOCFPGA_MPUL2_ADDRESS
 
 /*
+ * SDRAM controller
+ */
+#define CONFIG_ALTERA_SDRAM
+
+/*
  * EPCS/EPCQx1 Serial Flash Controller
  */
 #ifdef CONFIG_ALTERA_SPI
-- 
2.2.1

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


Re: [U-Boot] [PATCH V2 00/13] PMIC/REGULATOR cleanup and Sandbox tests

2015-05-18 Thread Simon Glass
Hi Przemyslaw,

On 15 May 2015 at 10:21, Przemyslaw Marczak p.marc...@samsung.com wrote:
 Hello Simon,


 On 05/15/2015 03:55 PM, Simon Glass wrote:

 On 13 May 2015 at 05:38, Przemyslaw Marczak p.marc...@samsung.com wrote:

 Hello Simon,

 This patchset fixes the build issues. It changes the last three
 top commits of u-boot-dm/next. So it is rebased onto:
 4e9a6eb dm: board:samsung: power_init_board: add requirement of
 CONFIG_DM_PMIC

 The rebased version, can be fetched from:
 https://github.com/bobenstein/u-boot.git
 branch: dm-pmic-v5-sandbox

 Best regards,
 Przemyslaw Marczak

 Przemyslaw Marczak (13):
odroid: dts: add 'voltage-regulators' description to max77686 node
odroid: enable driver model pmic/regulator API and MAX77686 drivers
dm: pmic: code cleanup of PMIC uclass driver
dm: regulator: uclass driver code cleanup
common: cmd pmic: command cleanup
common: cmd regulator: command cleanup
doc: driver-model: pmic-framework.txt - cleanup
sandbox: i2c: search child emul dev and check its uclass id
sandbox: add: sandbox PMIC device drivers: I2C emul, pmic, regulator
test: dm: add sandbox PMIC framework tests
test: dm: test.dts - move to sandbox dts directory
sandbox: dts: add sandbox_pmic.dtsi and include it to sandbox.dts and
  test.dts
sandbox: defconfig: enable support of sandbox PMIC drivers

   arch/arm/dts/exynos4412-odroid.dts | 253 ++
   arch/sandbox/dts/Makefile  |   1 +
   arch/sandbox/dts/sandbox.dts   |   4 +
   arch/sandbox/dts/sandbox_pmic.dtsi |  78 ++
   arch/sandbox/dts/test.dts  | 236 
   board/samsung/common/misc.c|   1 +
   board/samsung/odroid/odroid.c  |  76 +++---
   common/cmd_pmic.c  | 131 -
   common/cmd_regulator.c | 239 +
   configs/odroid_defconfig   |   8 +-
   configs/sandbox_defconfig  |   7 +
   doc/device-tree-bindings/pmic/sandbox.txt  |  35 +++
   doc/device-tree-bindings/regulator/sandbox.txt |  45 
   doc/driver-model/pmic-framework.txt|  20 +-
   drivers/i2c/sandbox_i2c.c  |  20 +-
   drivers/power/pmic/Kconfig |  27 +-
   drivers/power/pmic/Makefile|   3 +-
   drivers/power/pmic/i2c_pmic_emul.c | 142 ++
   drivers/power/pmic/max77686.c  |  15 +-
   drivers/power/pmic/pmic-uclass.c   |  31 +--
   drivers/power/pmic/sandbox.c   |  79 ++
   drivers/power/regulator/Kconfig|  32 ++-
   drivers/power/regulator/Makefile   |   1 +
   drivers/power/regulator/regulator-uclass.c | 104 +---
   drivers/power/regulator/sandbox.c  | 355
 +
   include/configs/odroid.h   |   5 -
   include/dt-bindings/pmic/sandbox_pmic.h|  35 +++
   include/power/pmic.h   |  39 +--
   include/power/regulator.h  | 116 
   include/power/sandbox_pmic.h   | 138 ++
   test/dm/.gitignore |   1 -
   test/dm/Makefile   |   2 +
   test/dm/pmic.c |  69 +
   test/dm/regulator.c| 325
 ++
   test/dm/test-dm.sh |   3 +-
   test/dm/test-main.c|   3 +-
   test/dm/test.dts   | 230 
   37 files changed, 2287 insertions(+), 622 deletions(-)
   create mode 100644 arch/sandbox/dts/sandbox_pmic.dtsi
   create mode 100644 arch/sandbox/dts/test.dts
   create mode 100644 doc/device-tree-bindings/pmic/sandbox.txt
   create mode 100644 doc/device-tree-bindings/regulator/sandbox.txt
   create mode 100644 drivers/power/pmic/i2c_pmic_emul.c
   create mode 100644 drivers/power/pmic/sandbox.c
   create mode 100644 drivers/power/regulator/sandbox.c
   create mode 100644 include/dt-bindings/pmic/sandbox_pmic.h
   create mode 100644 include/power/sandbox_pmic.h
   delete mode 100644 test/dm/.gitignore
   create mode 100644 test/dm/pmic.c
   create mode 100644 test/dm/regulator.c
   delete mode 100644 test/dm/test.dts

 --
 1.9.1


 I've pulled this in from u-boot-dm/next to master.

 - Simon


 Thank you, this is great information!
 And also thank you for the review of all the versions.

No problem - congratulations on getting this major piece of work into
mainline. I'll see if I can try it out for another SOC.

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


Re: [U-Boot] [PATCH v2 2/4] mkimage will now report information about loadable

2015-05-18 Thread Simon Glass
Hi Karl,

On 15 May 2015 at 15:13, Karl Apsite karl.aps...@dornerworks.com wrote:
 From: Karl Apsite karl.aps...@dornerworks.com

 Added FIT_LOADABLE_PROP, so the user can identify an optional entry
 named loadables in their .its configuration. loadables is a comma
 separated list in the .its

 example configuration:
 config@1 {
 description = Xen 4.6.0-one loadable;
 kernel = xen_kernel@1;
 fdt = fdt@1;
 loadables = linux_kernel@1;
 };

 config@2 {
 description = Xen 4.6.0-two loadables;
 kernel = xen_kernel@1;
 fdt = fdt@1;
 loadables = linux_kernel@2, linux_kernel@1;
 };

 example output:
 ...
  Configuration 0 (config@1)
   Description:  Xen 4.6.0-one loadable
   Kernel:   xen_kernel@1
   FDT:  fdt@1
   Loadables:linux_kernel@1
  Configuration 1 (config@2)
   Description:  Xen 4.6.0-two loadables
   Kernel:   xen_kernel@1
   FDT:  fdt@1
   Loadables:linux_kernel@2
 linux_kernel@1

 Signed-off-by: Karl Apsite karl.aps...@dornerworks.com

Reviewed-by: Simon Glass s...@chromium.org

But I think you should remove this stuff from your commit message. It
should go in the docs.

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


Re: [U-Boot] [PATCH 20/20] tegra: config: nyan-big: Add options required by Chrome OS boot

2015-05-18 Thread Simon Glass
Hi Stephen,

On 15 May 2015 at 09:34, Stephen Warren swar...@wwwdotorg.org wrote:
 On 05/13/2015 07:56 AM, Simon Glass wrote:

 Hi Stephen,

 On 25 February 2015 at 16:31, Stephen Warren swar...@wwwdotorg.org
 wrote:

 On 02/17/2015 03:29 PM, Simon Glass wrote:


 We need to match the device tree in the FIT with the U-Boot model so we
 can automatically select the right device tree. Also adjust the load
 address
 so that the device tree is not in the way when a zImage kernel tries to
 extract itself.



 We don't tend to use LOADADDR in any of the default boot scripts any
 more.
 Rather, we explicitly load files to a semantic location indicated by
 one
 of the following variables in tegra124-common.h:

 #define MEM_LAYOUT_ENV_SETTINGS \
  scriptaddr=0x9000\0 \
  pxefile_addr_r=0x9010\0 \
  kernel_addr_r=0x8100\0 \
  fdt_addr_r=0x8200\0 \
  ramdisk_addr_r=0x8210\0

 Perhaps the ChromeOS boot scripts could be adjusted to use one/some of
 those
 variables?

 If the value of CONFIG_LOADADDR isn't appropriate, perhaps we should fix
 it
 for all Tegra SoCs/boards?


 I forgot about this comment sorry. I had problems with the image
 overwriting itself. It is a bzImage inside a FIT so doesn't use the
 proper FIT decompression.

 Anyway I'd like to clarify what is meant by kernel_addr_r. Is that
 where the FIT is loaded or where the kernel will decompress to, or
 something else?


 kernel_addr_r is the address in RAM at which a kernel zImage is loaded by
 config_distro_bootcmd.h scripts (and likely other scripts too). It's usually
 deliberately chosen to be a fair way into RAM, so that when the zImage
 decompresses (to approx the start of RAM), the decompressed image doesn't
 overlap the compressed image at kernel_addr_r. This avoids the kernel
 decompressor having to move/copy the zImage somewhere else before copying to
 avoid any overlap during decompression.

 config_distro_bootcmd.h doesn't support FIT, so I haven't tried out loading
 FIT images. That said, if U-Boot simply jumps to the location of the kernel
 in the FIT image itself without any copying, I would expect everything to
 work fine if you loaded a FIT image to kernel_addr_r. However, if the
 processing of the FIT image requires the kernel to be copied out of the FIT
 image to some other location, you'd have to carefully choose that location
 so it didn't overlap anything. I'd strongly recommend avoiding any
 unnecessary copies like that though, if at all possible, from the
 perspective of both pointlessly wasted execution time and simplicity of the
 boot process. Perhaps storing a a kernel_noload image type inside the FIT
 rather than a kernel image type might help there? Perhaps you want to
 introduce a new standard variable that defines where FIT images are loaded.

I wonder what would be involved in adjusting config_distro_bootcmd to
support FIT? Would it make it simpler or harder? To me, we should be
moving to using FIT with U-Boot as it is much more flexible and better
designed from the ground up to provide the required features.

Anyway, normally FIT has a compressed kernel (e.g. with LZO), not a
bzImage. So it seems like we need an additional decompression address.
I suppose we could always use malloc() instead... But perhaps a FIT
load address makes sense. But then we don't really need a kernel load
address do we? Shouldn't that be specified in the FIT itself?

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


[U-Boot] [PATCH v3 1/4] mkimage will now report information about loadable

2015-05-18 Thread Karl Apsite
From: Karl Apsite karl.aps...@dornerworks.com

Added FIT_LOADABLE_PROP, so the user can identify an optional entry
named loadables in their .its configuration. loadables is a comma
separated list in the .its

Documentation can be found in doc/uImage.FIT/source_file_format.txt and
  doc/uImage.Fit/multi-with-loadables.its

Signed-off-by: Karl Apsite karl.aps...@dornerworks.com
---

Changes in v3:
- Moved the documentation about the loadables field from the commit
  message, to a new example.its file in doc/uImage.FIT/
doc/uImage.FIT/multi-with-loadables.its

 common/image-fit.c  | 17 +++
 doc/uImage.FIT/multi-with-loadables.its | 89 +
 doc/uImage.FIT/source_file_format.txt   |  4 ++
 include/image.h |  1 +
 4 files changed, 111 insertions(+)
 create mode 100644 doc/uImage.FIT/multi-with-loadables.its

diff --git a/common/image-fit.c b/common/image-fit.c
index 4eb4d42..fc9ea1f 100644
--- a/common/image-fit.c
+++ b/common/image-fit.c
@@ -1436,6 +1436,7 @@ void fit_conf_print(const void *fit, int noffset, const 
char *p)
char *desc;
char *uname;
int ret;
+   int loadables_index;
 
/* Mandatory properties */
ret = fit_get_desc(fit, noffset, desc);
@@ -1460,6 +1461,22 @@ void fit_conf_print(const void *fit, int noffset, const 
char *p)
uname = (char *)fdt_getprop(fit, noffset, FIT_FDT_PROP, NULL);
if (uname)
printf(%s  FDT:  %s\n, p, uname);
+
+   /* Print out all of the specified loadables */
+   for (loadables_index = 0;
+!fdt_get_string_index(fit, noffset,
+   FIT_LOADABLE_PROP,
+   loadables_index,
+   (const char **)uname)  0;
+loadables_index++)
+   {
+   if (loadables_index == 0) {
+   printf(%s  Loadables:, p);
+   } else {
+   printf(%s, p);
+   }
+   printf(%s\n, uname);
+   }
 }
 
 static int fit_image_select(const void *fit, int rd_noffset, int verify)
diff --git a/doc/uImage.FIT/multi-with-loadables.its 
b/doc/uImage.FIT/multi-with-loadables.its
new file mode 100644
index 000..9baffa6
--- /dev/null
+++ b/doc/uImage.FIT/multi-with-loadables.its
@@ -0,0 +1,89 @@
+/*
+ * U-boot uImage source file with multiple kernels, ramdisks and FDT blobs
+ * This example makes use of the 'loadables' field
+ */
+
+/dts-v1/;
+
+/ {
+   description = Configuration to load a Xen Kernel;
+   #address-cells = 1;
+
+   images {
+   xen_kernel@1 {
+   description = xen binary;
+   data = /incbin/(./xen);
+   type = kernel;
+   arch = arm;
+   os = linux;
+   compression = none;
+   load = 0xa000;
+   entry = 0xa000;
+   hash@1 {
+   algo = md5;
+   };
+   };
+
+   fdt@1 {
+   description = xexpress-ca15 tree blob;
+   data = /incbin/(./vexpress-v2p-ca15-tc1.dtb);
+   type = flat_dt;
+   arch = arm;
+   compression = none;
+   load = 0xb000;
+   hash@1 {
+   algo = md5;
+   };
+   };
+
+   fdt@2 {
+   description = xexpress-ca15 tree blob;
+   data = /incbin/(./vexpress-v2p-ca15-tc1.dtb);
+   type = flat_dt;
+   arch = arm;
+   compression = none;
+   load = 0xb040;
+   hash@1 {
+   algo = md5;
+   };
+   };
+
+   linux_kernel@1 {
+   description = Linux Image;
+   data = /incbin/(./Image);
+   type = kernel;
+   arch = arm;
+   os = linux;
+   compression = none;
+   load = 0xa000;
+   entry = 0xa000;
+   hash@1 {
+   algo = md5;
+   };
+   };
+   };
+
+   configurations {
+   default = config@2;
+
+   config@1 {
+   description = Just plain Linux;
+   kernel = linux_kernel@1;
+   fdt = fdt@1;
+   };
+   
+   config@2 {
+   description = Xen one loadable;
+   kernel = xen_kernel@1;
+   fdt = 

[U-Boot] [PATCH v3 3/4] Combine bootm_find_thing functions together

2015-05-18 Thread Karl Apsite
bootm_find_ramdisk_fdt() renamed to bootm_find_images() for readability.

The function bootm_find_ramdisk_fdt() appears to be a simple wrapper for
bootm_find_ramdisk(), bootm_find_fdt(), and now bootm_find_loadables().
I didn't see any other callers entering a bootm_findthing, so removing
the wrapper, and condensing these together hopefully makes the code a
little simpler.

Signed-off-by: Karl Apsite karl.aps...@dornerworks.com
---

Changes in v3: None

 common/bootm.c | 53 ++---
 common/cmd_bootm.c |  4 ++--
 include/bootm.h|  2 +-
 3 files changed, 21 insertions(+), 38 deletions(-)

diff --git a/common/bootm.c b/common/bootm.c
index 07ae0f5..667c934 100644
--- a/common/bootm.c
+++ b/common/bootm.c
@@ -206,7 +206,23 @@ static int bootm_find_os(cmd_tbl_t *cmdtp, int flag, int 
argc,
return 0;
 }
 
-static int bootm_find_ramdisk(int flag, int argc, char * const argv[])
+/**
+ * bootm_find_images - wrapper to find and locate various images
+ * @flag: Ignored Argument
+ * @argc: command argument count
+ * @argv: command argument list
+ *
+ * boot_find_images() will attempt to load an available ramdisk,
+ * flattened device tree, as well as specifically marked
+ * loadable images (loadables are FIT only)
+ *
+ * Note: bootm_find_images will skip an image if it is not found
+ *
+ * @return:
+ * 0, if all existing images were loaded correctly
+ * 1, if an image is found but corrupted, or invalid
+ */
+int bootm_find_images(int flag, int argc, char * const argv[])
 {
int ret;
 
@@ -218,14 +234,7 @@ static int bootm_find_ramdisk(int flag, int argc, char * 
const argv[])
return 1;
}
 
-   return 0;
-}
-
 #if defined(CONFIG_OF_LIBFDT)
-static int bootm_find_fdt(int flag, int argc, char * const argv[])
-{
-   int ret;
-
/* find flattened device tree */
ret = boot_get_fdt(flag, argc, argv, IH_ARCH_DEFAULT, images,
   images.ft_addr, images.ft_len);
@@ -233,18 +242,10 @@ static int bootm_find_fdt(int flag, int argc, char * 
const argv[])
puts(Could not find a valid device tree\n);
return 1;
}
-
set_working_fdt_addr((ulong)images.ft_addr);
-
-   return 0;
-}
 #endif
 
 #if defined(CONFIG_FIT)
-static int bootm_find_loadables(int flag, int argc, char * const argv[])
-{
-   int ret;
-
/* find all of the loadables */
ret = boot_get_loadable(argc, argv, images, IH_ARCH_DEFAULT,
   NULL, NULL);
@@ -252,24 +253,6 @@ static int bootm_find_loadables(int flag, int argc, char * 
const argv[])
printf(Loadable(s) is corrupt or invalid\n);
return 1;
}
-
-   return 0;
-}
-#endif
-
-int bootm_find_ramdisk_fdt(int flag, int argc, char * const argv[])
-{
-   if (bootm_find_ramdisk(flag, argc, argv))
-   return 1;
-
-#if defined(CONFIG_OF_LIBFDT)
-   if (bootm_find_fdt(flag, argc, argv))
-   return 1;
-#endif
-
-#if defined(CONFIG_FIT)
-   if (bootm_find_loadables(flag, argc, argv))
-   return 1;
 #endif
 
return 0;
@@ -283,7 +266,7 @@ static int bootm_find_other(cmd_tbl_t *cmdtp, int flag, int 
argc,
 (images.os.type == IH_TYPE_MULTI)) 
(images.os.os == IH_OS_LINUX ||
 images.os.os == IH_OS_VXWORKS))
-   return bootm_find_ramdisk_fdt(flag, argc, argv);
+   return bootm_find_images(flag, argc, argv);
 
return 0;
 }
diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c
index 6b6aca6..48738ac 100644
--- a/common/cmd_bootm.c
+++ b/common/cmd_bootm.c
@@ -580,7 +580,7 @@ static int bootz_start(cmd_tbl_t *cmdtp, int flag, int argc,
 * Handle the BOOTM_STATE_FINDOTHER state ourselves as we do not
 * have a header that provide this informaiton.
 */
-   if (bootm_find_ramdisk_fdt(flag, argc, argv))
+   if (bootm_find_images(flag, argc, argv))
return 1;
 
return 0;
@@ -721,7 +721,7 @@ static int booti_start(cmd_tbl_t *cmdtp, int flag, int argc,
 * Handle the BOOTM_STATE_FINDOTHER state ourselves as we do not
 * have a header that provide this informaiton.
 */
-   if (bootm_find_ramdisk_fdt(flag, argc, argv))
+   if (bootm_find_images(flag, argc, argv))
return 1;
 
return 0;
diff --git a/include/bootm.h b/include/bootm.h
index 6181488..4981377 100644
--- a/include/bootm.h
+++ b/include/bootm.h
@@ -49,7 +49,7 @@ int boot_selected_os(int argc, char * const argv[], int state,
 ulong bootm_disable_interrupts(void);
 
 /* This is a special function used by booti/bootz */
-int bootm_find_ramdisk_fdt(int flag, int argc, char * const argv[]);
+int bootm_find_images(int flag, int argc, char * const argv[]);
 
 int do_bootm_states(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[],
int states, 

[U-Boot] [PATCH v3 0/4] New tag for Flattened Image Trees (FIT) - Booting Xen from a FIT.

2015-05-18 Thread Karl Apsite
The FIT config now supports a tag named loadables: which is a
comma separated list.  Users can add any number of images to the list,
and u-boot will move the selected binaries to their listed
load_addresses. This allows u-boot to boot xen from using an FIT
configuration.  Xen expects a kernel to be placed at a predetermined
location, however the kernel field was already filled by xen itself.
This change allows the user to move the required binary before xen
boots, all within the FIT's configuration.

Changes in v3:
- Moved the documentation about the loadables field from the commit
  message, to a new example.its file in doc/uImage.FIT/
doc/uImage.FIT/multi-with-loadables.its
- Removed a couple zealous puts-printf conversions
- Replaced an instance of puts I mistakenly included with printf
- Moved the commit that adds the test to the end of patch-stack

Karl Apsite (4):
  mkimage will now report information about loadable
  add boot_get_loadables() to load listed images
  Combine bootm_find_thing functions together
  add test for two 'loadables'

 common/bootm.c  | 45 +
 common/cmd_bootm.c  |  4 +-
 common/image-fit.c  | 25 -
 common/image.c  | 71 ++
 doc/uImage.FIT/multi-with-loadables.its | 89 +
 doc/uImage.FIT/source_file_format.txt   |  4 ++
 include/bootm.h |  2 +-
 include/bootstage.h |  1 +
 include/image.h | 28 ++-
 test/image/test-fit.py  | 73 +++
 10 files changed, 308 insertions(+), 34 deletions(-)
 create mode 100644 doc/uImage.FIT/multi-with-loadables.its

-- 
2.3.7

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


[U-Boot] [PATCH v3 2/4] add boot_get_loadables() to load listed images

2015-05-18 Thread Karl Apsite
From: Karl Apsite karl.aps...@dornerworks.com

Added a trimmed down instance of boot_get_thing() to satisfy the
minimum requierments of the added feature.  The function follows the
normal patterns set by other boot_getthing's, which should make it a
bit easier to combine them all together into one boot_get_image()
function in a later refactor.

Documentation for the new function can be found in source:
  include/image.h

Signed-off-by: Karl Apsite karl.aps...@dornerworks.com
---

Changes in v3:
- Removed a couple zealous puts-printf conversions
- Replaced an instance of puts I mistakenly included with printf

 common/bootm.c  | 22 +
 common/image-fit.c  |  8 +-
 common/image.c  | 71 +
 include/bootstage.h |  1 +
 include/image.h | 27 +++-
 5 files changed, 127 insertions(+), 2 deletions(-)

diff --git a/common/bootm.c b/common/bootm.c
index 6842029..07ae0f5 100644
--- a/common/bootm.c
+++ b/common/bootm.c
@@ -240,6 +240,23 @@ static int bootm_find_fdt(int flag, int argc, char * const 
argv[])
 }
 #endif
 
+#if defined(CONFIG_FIT)
+static int bootm_find_loadables(int flag, int argc, char * const argv[])
+{
+   int ret;
+
+   /* find all of the loadables */
+   ret = boot_get_loadable(argc, argv, images, IH_ARCH_DEFAULT,
+  NULL, NULL);
+   if (ret) {
+   printf(Loadable(s) is corrupt or invalid\n);
+   return 1;
+   }
+
+   return 0;
+}
+#endif
+
 int bootm_find_ramdisk_fdt(int flag, int argc, char * const argv[])
 {
if (bootm_find_ramdisk(flag, argc, argv))
@@ -250,6 +267,11 @@ int bootm_find_ramdisk_fdt(int flag, int argc, char * 
const argv[])
return 1;
 #endif
 
+#if defined(CONFIG_FIT)
+   if (bootm_find_loadables(flag, argc, argv))
+   return 1;
+#endif
+
return 0;
 }
 
diff --git a/common/image-fit.c b/common/image-fit.c
index fc9ea1f..ecd3e67 100644
--- a/common/image-fit.c
+++ b/common/image-fit.c
@@ -1544,6 +1544,8 @@ static const char *fit_get_image_type_property(int type)
return FIT_RAMDISK_PROP;
case IH_TYPE_X86_SETUP:
return FIT_SETUP_PROP;
+   case IH_TYPE_LOADABLE:
+   return FIT_LOADABLE_PROP;
}
 
return unknown;
@@ -1661,7 +1663,11 @@ int fit_image_load(bootm_headers_t *images, ulong addr,
os_ok = image_type == IH_TYPE_FLATDT ||
fit_image_check_os(fit, noffset, IH_OS_LINUX) ||
fit_image_check_os(fit, noffset, IH_OS_OPENRTOS);
-   if (!type_ok || !os_ok) {
+
+   /* If either of the checks fail, we should report an error, but
+* if the image type is coming from the loadables field, we
+* don't care what it is */
+   if ((!type_ok || !os_ok)  image_type != IH_TYPE_LOADABLE) {
fit_image_get_os(fit, noffset, os);
printf(No %s %s %s Image\n,
   genimg_get_os_name(os),
diff --git a/common/image.c b/common/image.c
index fdec496..0f5274f 100644
--- a/common/image.c
+++ b/common/image.c
@@ -1165,6 +1165,77 @@ int boot_get_setup(bootm_headers_t *images, uint8_t arch,
 #endif
 }
 
+#if defined(CONFIG_FIT)
+int boot_get_loadable(int argc, char * const argv[], bootm_headers_t *images,
+   uint8_t arch, const ulong *ld_start, ulong * const ld_len)
+{
+   /*
+* These variables are used to hold the current image location
+* in system memory.
+*/
+   ulong tmp_img_addr;
+   /*
+* These two variables are requirements for fit_image_load, but
+* their values are not used
+*/
+   ulong img_data, img_len;
+   void *buf;
+   int loadables_index;
+   int conf_noffset;
+   int fit_img_result;
+   char *uname;
+
+   /* Check to see if the images struct has a FIT configuration */
+   if (!genimg_has_config(images)) {
+   debug(## FIT configuration was not specified\n);
+   return 0;
+   }
+
+   /*
+* Obtain the os FIT header from the images struct
+* copy from dataflash if needed
+*/
+   tmp_img_addr = map_to_sysmem(images-fit_hdr_os);
+   tmp_img_addr = genimg_get_image(tmp_img_addr);
+   buf = map_sysmem(tmp_img_addr, 0);
+   /*
+* Check image type. For FIT images get FIT node
+* and attempt to locate a generic binary.
+*/
+   switch (genimg_get_format(buf)) {
+   case IMAGE_FORMAT_FIT:
+   conf_noffset = fit_conf_get_node(buf, images-fit_uname_cfg);
+
+   for (loadables_index = 0;
+!fdt_get_string_index(buf, conf_noffset,
+   FIT_LOADABLE_PROP,
+   loadables_index,
+   (const char **)uname)  0;
+loadables_index++)
+   {
+   

Re: [U-Boot] fsl_elbc_nand bug

2015-05-18 Thread Andrei Yakimov
I will try, It will take a while due to I am not working with 
latest code. I do have a chip with first 2 parameter blocks 
corrupted. So I can test it. I can not send it to Linux - 
I am not subscribed to any Linux mailing lists.
As of  patch structure:

1) separate READID and PARAM command.
2) READID will read 5 bytes as per ONFI spec.
3) PARAM command will read 768 bytes as per ONFI spec.

I will check is path to send read size are valid
for this command - but it will affect every NAND driver,
It is dangers changing. First approach is save, will
not eliminate other divers problems if they exist.
  

I will update only fsl_elbc_nand driver.

This is least invasive patch.

Should I get just master for generation of this patch?

Andrei.

On Mon, 2015-05-18 at 16:17 -0500, Scott Wood wrote:
 On Fri, 2015-05-15 at 14:48 -0700, Andrei Yakimov wrote:
  Hi, 
   I just found, if NAND ONFI parameter page first copy is 
  bad, u-boot will never read extra copes: 
  
  fsl_elbc_nand.c: 
   342 out_be32(lbc-fbcr, 256);  
   343 ctrl-read_bytes = 256;
  
  this code cause read beyond buffer error message:
   
  nand_base.c:
 chip-cmdfunc(mtd, NAND_CMD_PARAM, 0, -1);
  3243 for (i = 0; i  3; i++) {
  3244 for (j = 0; j  sizeof(*p); j++)
  3245 ((uint8_t *)p)[j] = chip-read_byte(mtd);
  3246 if (onfi_crc16(ONFI_CRC_BASE, (uint8_t *)p, 254) ==
  3247 le16_to_cpu(p-crc)) {
  3248 break;
  3249 }
  3250 }
  
  Unfortunately I do not working with latest u-boot now,
  so can not provide a patch,  read size should be increased to
  at least 768 ( 3 copy mandatory for ONFI spec). Linux kernel should be
  updated too.
 
 Could you send a patch (both here and Linux)?  Especially since you have
 a test case. :-)
 
 Though a better fix than just increasing the byte count would be to add
 a read_id() callback so that the NAND subsystem can actually tell the
 driver how much data it's expecting, rather than forcing it to go
 through cmdfunc that makes high-level drivers (poorly) emulate
 low-level hardware.
 
  I am also not expert for other NAND controllers drivers.
 
 At least IFC will have the same issue.
 
 -Scott
 
 


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


[U-Boot] [PATCH v3 4/4] add test for two 'loadables'

2015-05-18 Thread Karl Apsite
From: Karl Apsite karl.aps...@dornerworks.com

Nothing too fancy.  A simple test that attmpts to load two loadables and
verify that they are properly unpacked in the u-boot sandbox.
Signed-off-by: Karl Apsite karl.aps...@dornerworks.com
---

Changes in v3:
- Moved the commit that adds the test to the end of patch-stack

 test/image/test-fit.py | 73 +++---
 1 file changed, 64 insertions(+), 9 deletions(-)

diff --git a/test/image/test-fit.py b/test/image/test-fit.py
index e9e756a..ef6b24f 100755
--- a/test/image/test-fit.py
+++ b/test/image/test-fit.py
@@ -48,6 +48,15 @@ base_its = '''
 load = 0x4;
 entry = 0x8;
 };
+kernel@2 {
+data = /incbin/(%(loadables1)s);
+type = kernel;
+arch = sandbox;
+os = linux;
+compression = none;
+%(loadables1_load)s
+entry = 0x0;
+};
 fdt@1 {
 description = snow;
 data = /incbin/(u-boot.dtb);
@@ -69,6 +78,15 @@ base_its = '''
 %(ramdisk_load)s
 compression = none;
 };
+ramdisk@2 {
+description = snow;
+data = /incbin/(%(loadables2)s);
+type = ramdisk;
+arch = sandbox;
+os = linux;
+%(loadables2_load)s
+compression = none;
+};
 };
 configurations {
 default = conf@1;
@@ -76,6 +94,7 @@ base_its = '''
 kernel = kernel@1;
 fdt = fdt@1;
 %(ramdisk_config)s
+%(loadables_config)s
 };
 };
 };
@@ -103,6 +122,8 @@ bootm loados
 sb save hostfs 0 %(kernel_addr)x %(kernel_out)s %(kernel_size)x
 sb save hostfs 0 %(fdt_addr)x %(fdt_out)s %(fdt_size)x
 sb save hostfs 0 %(ramdisk_addr)x %(ramdisk_out)s %(ramdisk_size)x
+sb save hostfs 0 %(loadables1_addr)x %(loadables1_out)s %(loadables1_size)x
+sb save hostfs 0 %(loadables2_addr)x %(loadables2_out)s %(loadables2_size)x
 reset
 '''
 
@@ -188,30 +209,32 @@ def make_fit(mkimage, params):
 print fd, base_fdt
 return fit
 
-def make_kernel():
+def make_kernel(filename, text):
 Make a sample kernel with test data
 
+Args:
+filename: the name of the file you want to create
 Returns:
-Filename of kernel created
+Full path and filename of the kernel it created
 
-fname = make_fname('test-kernel.bin')
+fname = make_fname(filename)
 data = ''
 for i in range(100):
-data += 'this kernel %d is unlikely to boot\n' % i
+data += 'this %s %d is unlikely to boot\n' % (text, i)
 with open(fname, 'w') as fd:
 print fd, data
 return fname
 
-def make_ramdisk():
+def make_ramdisk(filename, text):
 Make a sample ramdisk with test data
 
 Returns:
 Filename of ramdisk created
 
-fname = make_fname('test-ramdisk.bin')
+fname = make_fname(filename)
 data = ''
 for i in range(100):
-data += 'ramdisk %d was seldom used in the middle ages\n' % i
+data += '%s %d was seldom used in the middle ages\n' % (text, i)
 with open(fname, 'w') as fd:
 print fd, data
 return fname
@@ -298,11 +321,15 @@ def run_fit_test(mkimage, u_boot):
 
 # Set up invariant files
 control_dtb = make_dtb()
-kernel = make_kernel()
-ramdisk = make_ramdisk()
+kernel = make_kernel('test-kernel.bin', 'kernel')
+ramdisk = make_ramdisk('test-ramdisk.bin', 'ramdisk')
+loadables1 = make_kernel('test-loadables1.bin', 'lenrek')
+loadables2 = make_ramdisk('test-loadables2.bin', 'ksidmar')
 kernel_out = make_fname('kernel-out.bin')
 fdt_out = make_fname('fdt-out.dtb')
 ramdisk_out = make_fname('ramdisk-out.bin')
+loadables1_out = make_fname('loadables1-out.bin')
+loadables2_out = make_fname('loadables2-out.bin')
 
 # Set up basic parameters with default values
 params = {
@@ -324,6 +351,20 @@ def run_fit_test(mkimage, u_boot):
 'ramdisk_size' : filesize(ramdisk),
 'ramdisk_load' : '',
 'ramdisk_config' : '',
+
+'loadables1' : loadables1,
+'loadables1_out' : loadables1_out,
+'loadables1_addr' : 0x10,
+'loadables1_size' : filesize(loadables1),
+'loadables1_load' : '',
+
+'loadables2' : loadables2,
+'loadables2_out' : loadables2_out,
+'loadables2_addr' : 0x14,
+'loadables2_size' : filesize(loadables2),
+'loadables2_load' : '',
+
+'loadables_config' : '',
 }
 
 # Make a basic FIT and a 

Re: [U-Boot] pritnf() in arch_cpu_init()

2015-05-18 Thread Simon Glass
Hi Alexey,

On 18 May 2015 at 04:41, Alexey Brodkin alexey.brod...@synopsys.com wrote:
 Hi Simon,

 I was looking at how to output error message from very early init and
 found IMHO senseless code in arch/x86/cpu/coreboot/coreboot.c:
 8--
 int arch_cpu_init(void)
 {
 int ret = get_coreboot_info(lib_sysinfo);
 if (ret != 0) {
 printf(Failed to parse coreboot tables.\n);
 return ret;
 }
 8--

 The problem here is arch_cpu_init() executed much earlier compared to
 serial/console init, refer to init_sequence_f:
 8--
 line 764:   arch_cpu_init,
 ...
 line 807:   serial_init,/* serial communications setup */
 console_init_f, /* stage 1 init of console */
 8--

 So printf() output is only available in pre-console buffer if
 CONFIG_PRE_CONSOLE_BUFFER is configured. Otherwise CPU will end up in
 halt before anything gets printed to console.

 I would propose to create a special very-early flavour of printf() which
 is only built if pre-console buffer is configured. That way we:

  [1] By default get rid of printf() in early CPU init code that might as
 well be used in SPL build (so there will be no extra dependency on
 pritnf/console)

  [2] Save some space in memory footprint with removal of the string.

 I'm pretty sure there're more places when printf() is used before
 console gets initialized but let's first discuss it with this particular
 example.

I've been fiddling with some patches to enable the debug UART
(CONFIG_DEBUG_UART) with printf() so that it can be used from very
early on. That might help here.

But the case you identify should probably be a debug().

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


Re: [U-Boot] [PATCH v2 3/4] add boot_get_loadables() to load listed images

2015-05-18 Thread Simon Glass
Hi Karl,

On 15 May 2015 at 15:13, Karl Apsite karl.aps...@dornerworks.com wrote:
 From: Karl Apsite karl.aps...@dornerworks.com

 Added a trimmed down instance of boot_get_thing() to satisfy the
 minimum requierments of the added feature.  The function follows the
 normal patterns set by other boot_getthing's, which should make it a
 bit easier to combine them all together into one boot_get_image()
 function in a later refactor.

 Documentation for the new function can be found in source:
   include/image.h

 Signed-off-by: Karl Apsite karl.aps...@dornerworks.com
 ---

Looks good to me - but see comment below.


  common/bootm.c  | 26 ++--
  common/image-fit.c  |  8 +-
  common/image.c  | 71 
 +
  include/bootstage.h |  1 +
  include/image.h | 27 +++-
  5 files changed, 129 insertions(+), 4 deletions(-)

 diff --git a/common/bootm.c b/common/bootm.c
 index 6842029..f42fb66 100644
 --- a/common/bootm.c
 +++ b/common/bootm.c
 @@ -214,7 +214,7 @@ static int bootm_find_ramdisk(int flag, int argc, char * 
 const argv[])
 ret = boot_get_ramdisk(argc, argv, images, IH_INITRD_ARCH,
images.rd_start, images.rd_end);
 if (ret) {
 -   puts(Ramdisk image is corrupt or invalid\n);
 +   printf(Ramdisk image is corrupt or invalid\n);

This seems unrelated to your patch - can you pull out this clean-up
into a separate patch? It could precede this one in the stack.

 return 1;
 }

 @@ -230,7 +230,7 @@ static int bootm_find_fdt(int flag, int argc, char * 
 const argv[])
 ret = boot_get_fdt(flag, argc, argv, IH_ARCH_DEFAULT, images,
images.ft_addr, images.ft_len);
 if (ret) {
 -   puts(Could not find a valid device tree\n);
 +   printf(Could not find a valid device tree\n);
 return 1;
 }

 @@ -240,6 +240,23 @@ static int bootm_find_fdt(int flag, int argc, char * 
 const argv[])
  }
  #endif

 +#if defined(CONFIG_FIT)
 +static int bootm_find_loadables(int flag, int argc, char * const argv[])
 +{
 +   int ret;
 +
 +   /* find all of the loadables */
 +   ret = boot_get_loadable(argc, argv, images, IH_ARCH_DEFAULT,
 +  NULL, NULL);
 +   if (ret) {
 +   printf(Loadable(s) is corrupt or invalid\n);
 +   return 1;
 +   }
 +
 +   return 0;
 +}
 +#endif
 +
  int bootm_find_ramdisk_fdt(int flag, int argc, char * const argv[])
  {
 if (bootm_find_ramdisk(flag, argc, argv))
 @@ -250,6 +267,11 @@ int bootm_find_ramdisk_fdt(int flag, int argc, char * 
 const argv[])
 return 1;
  #endif

 +#if defined(CONFIG_FIT)
 +   if (bootm_find_loadables(flag, argc, argv))
 +   return 1;
 +#endif
 +
 return 0;
  }

 diff --git a/common/image-fit.c b/common/image-fit.c
 index fc9ea1f..ecd3e67 100644
 --- a/common/image-fit.c
 +++ b/common/image-fit.c
 @@ -1544,6 +1544,8 @@ static const char *fit_get_image_type_property(int type)
 return FIT_RAMDISK_PROP;
 case IH_TYPE_X86_SETUP:
 return FIT_SETUP_PROP;
 +   case IH_TYPE_LOADABLE:
 +   return FIT_LOADABLE_PROP;
 }

 return unknown;
 @@ -1661,7 +1663,11 @@ int fit_image_load(bootm_headers_t *images, ulong addr,
 os_ok = image_type == IH_TYPE_FLATDT ||
 fit_image_check_os(fit, noffset, IH_OS_LINUX) ||
 fit_image_check_os(fit, noffset, IH_OS_OPENRTOS);
 -   if (!type_ok || !os_ok) {
 +
 +   /* If either of the checks fail, we should report an error, but
 +* if the image type is coming from the loadables field, we
 +* don't care what it is */
 +   if ((!type_ok || !os_ok)  image_type != IH_TYPE_LOADABLE) {
 fit_image_get_os(fit, noffset, os);
 printf(No %s %s %s Image\n,
genimg_get_os_name(os),
 diff --git a/common/image.c b/common/image.c
 index fdec496..e5cff05 100644
 --- a/common/image.c
 +++ b/common/image.c
 @@ -1165,6 +1165,77 @@ int boot_get_setup(bootm_headers_t *images, uint8_t 
 arch,
  #endif
  }

 +#if defined(CONFIG_FIT)
 +int boot_get_loadable(int argc, char * const argv[], bootm_headers_t *images,
 +   uint8_t arch, const ulong *ld_start, ulong * const ld_len)
 +{
 +   /*
 +* These variables are used to hold the current image location
 +* in system memory.
 +*/
 +   ulong tmp_img_addr;
 +   /*
 +* These two variables are requirements for fit_image_load, but
 +* their values are not used
 +*/
 +   ulong img_data, img_len;
 +   void *buf;
 +   int loadables_index;
 +   int conf_noffset;
 +   int fit_img_result;
 +   char *uname;
 +
 +   /* Check to see if the images struct has a FIT configuration 

Re: [U-Boot] [PATCH v2 4/6] cmd_ide: Eliminate build warnings in atapi_inquiry()

2015-05-18 Thread Simon Glass
On 15 May 2015 at 19:33, Bin Meng bmeng...@gmail.com wrote:
 Eliminate the following build warning in atapi_inquiry():
   warning: assignment from incompatible pointer type [enabled by default]

 Signed-off-by: Bin Meng bmeng...@gmail.com

 ---

 Changes in v2:
 - Correct the typo of 'Eliminate' in the commit message

  common/cmd_ide.c | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)

 diff --git a/common/cmd_ide.c b/common/cmd_ide.c
 index 04a6d9b..ecd3e9d 100644
 --- a/common/cmd_ide.c
 +++ b/common/cmd_ide.c
 @@ -79,7 +79,7 @@ static void ident_cpy (unsigned char *dest, unsigned char 
 *src, unsigned int len

  #ifdef CONFIG_ATAPI
  static voidatapi_inquiry(block_dev_desc_t *dev_desc);
 -static ulong atapi_read(int device, ulong blknr, lbaint_t blkcnt,
 +static ulong atapi_read(int device, lbaint_t blknr, lbaint_t blkcnt,
 void *buffer);
  #endif

 @@ -1388,13 +1388,13 @@ static void atapi_inquiry(block_dev_desc_t *dev_desc)
  #define ATAPI_READ_BLOCK_SIZE  2048/* assuming CD part */
  #define ATAPI_READ_MAX_BLOCK   (ATAPI_READ_MAX_BYTES/ATAPI_READ_BLOCK_SIZE)

 -ulong atapi_read(int device, ulong blknr, lbaint_t blkcnt, void *buffer)
 +ulong atapi_read(int device, lbaint_t blknr, lbaint_t blkcnt, void *buffer)
  {
 ulong n = 0;
 unsigned char ccb[12];  /* Command descriptor block */
 ulong cnt;

 -   debug(atapi_read dev %d start %lX, blocks  LBAF  buffer at %lX\n,
 +   debug(atapi_read dev %d start  LBAF  blocks  LBAF  buffer at 
 %lX\n,
   device, blknr, blkcnt, (ulong) buffer);

 do {
 --
 1.8.2.1


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


Re: [U-Boot] [PATCH v2 5/6] x86: Add CONFIG_LBA48 and remove CONFIG_ATAPI in x86-common.h

2015-05-18 Thread Simon Glass
On 15 May 2015 at 19:33, Bin Meng bmeng...@gmail.com wrote:
 Enable CONFIG_LBA48 to support large disks. CONFIG_ATAPI is only needed
 by cmd_ide.c which is not common for modern x86 targets, hence remove it.

 Signed-off-by: Bin Meng bmeng...@gmail.com
 ---

 Changes in v2: None

  include/configs/x86-common.h | 5 +
  1 file changed, 1 insertion(+), 4 deletions(-)

 diff --git a/include/configs/x86-common.h b/include/configs/x86-common.h
 index 0b61615..3912b39 100644
 --- a/include/configs/x86-common.h
 +++ b/include/configs/x86-common.h
 @@ -37,6 +37,7 @@
  #define CONFIG_SCSI_AHCI
  #ifdef CONFIG_SCSI_AHCI
  #define CONFIG_LIBATA
 +#define CONFIG_LBA48
  #define CONFIG_SYS_64BIT_LBA

  #define CONFIG_SYS_SCSI_MAX_SCSI_ID2
 @@ -76,10 +77,6 @@
  #define CONFIG_SYS_HUSH_PARSER

  #define CONFIG_SUPPORT_VFAT
 -/
 - * ATAPI support (experimental)
 - /
 -#define CONFIG_ATAPI

  /
   * DISK Partition support
 --
 1.8.2.1


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


Re: [U-Boot] [PATCH 2/6] pci: Do not skip legacy IDE device configutation

2015-05-18 Thread Simon Glass
Hi Bin,

On 15 May 2015 at 09:40, Bin Meng bmeng...@gmail.com wrote:
 The legacy IDE device has a BAR4 (Bus Master Interface BAR) which
 needs to be configured.

 Signed-off-by: Bin Meng bmeng...@gmail.com
 ---

  drivers/pci/pci_auto.c | 14 --
  1 file changed, 14 deletions(-)

I don't see how this code change relates to your commit message...


 diff --git a/drivers/pci/pci_auto.c b/drivers/pci/pci_auto.c
 index 43965d8..7c10983 100644
 --- a/drivers/pci/pci_auto.c
 +++ b/drivers/pci/pci_auto.c
 @@ -20,8 +20,6 @@
  #define DEBUGF(x...)
  #endif /* DEBUG */

 -#definePCIAUTO_IDE_MODE_MASK   0x05
 -
  /* the user can define CONFIG_SYS_PCI_CACHE_LINE_SIZE to avoid problems */
  #ifndef CONFIG_SYS_PCI_CACHE_LINE_SIZE
  #define CONFIG_SYS_PCI_CACHE_LINE_SIZE 8
 @@ -424,7 +422,6 @@ int pciauto_config_device(struct pci_controller *hose, 
 pci_dev_t dev)
  {
 unsigned int sub_bus = PCI_BUS(dev);
 unsigned short class;
 -   unsigned char prg_iface;
 int n;

 pci_hose_read_config_word(hose, dev, PCI_CLASS_DEVICE, class);
 @@ -460,17 +457,6 @@ int pciauto_config_device(struct pci_controller *hose, 
 pci_dev_t dev)
  #endif
 break;

 -   case PCI_CLASS_STORAGE_IDE:
 -   pci_hose_read_config_byte(hose, dev, PCI_CLASS_PROG, 
 prg_iface);
 -   if (!(prg_iface  PCIAUTO_IDE_MODE_MASK)) {
 -   DEBUGF(PCI Autoconfig: Skipping legacy mode IDE 
 controller\n);
 -   return sub_bus;
 -   }
 -
 -   pciauto_setup_device(hose, dev, 6, hose-pci_mem,
 -   hose-pci_prefetch, hose-pci_io);
 -   break;
 -
 case PCI_CLASS_BRIDGE_CARDBUS:
 /*
  * just do a minimal setup of the bridge,
 --
 1.8.2.1


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


Re: [U-Boot] [PATCH v2 4/4] Combine bootm_find_thing functions together

2015-05-18 Thread Simon Glass
On 15 May 2015 at 15:13, Karl Apsite karl.aps...@dornerworks.com wrote:
 bootm_find_ramdisk_fdt() renamed to bootm_find_images() for readability.

 The function bootm_find_ramdisk_fdt() appears to be a simple wrapper for
 bootm_find_ramdisk(), bootm_find_fdt(), and now bootm_find_loadables().
 I didn't see any other callers entering a bootm_findthing, so removing
 the wrapper, and condensing these together hopefully makes the code a
 little simpler.

 Signed-off-by: Karl Apsite karl.aps...@dornerworks.com
 ---

  common/bootm.c | 53 ++---
  common/cmd_bootm.c |  4 ++--
  include/bootm.h|  2 +-
  3 files changed, 21 insertions(+), 38 deletions(-)

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


Re: [U-Boot] [PATCH v2 1/6] pci: Allow debug message output in pci_auto.c

2015-05-18 Thread Simon Glass
On 15 May 2015 at 19:33, Bin Meng bmeng...@gmail.com wrote:
 Remove the '#undef DEBUG' in pci_auto.c so that we can enable debug
 message output via '-DDEBUG'.

 Signed-off-by: Bin Meng bmeng...@gmail.com

 ---

 Changes in v2:
 - Commit meessage minor update

  drivers/pci/pci_auto.c | 1 -
  1 file changed, 1 deletion(-)

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


Re: [U-Boot] [PATCH v2 3/6] drivers: block: Remove the ata_piix driver

2015-05-18 Thread Simon Glass
On 15 May 2015 at 19:33, Bin Meng bmeng...@gmail.com wrote:
 This driver was originally added to support the native IDE mode for
 Intel chipset, however it has some bugs like not supporting ATAPI
 devices, endianness issue, or even broken build when CONFIG_LAB48.
 Given no board is using this driver as of today, rather than fixing
 all these issues we just remove it from the source tree.

 Signed-off-by: Bin Meng bmeng...@gmail.com

 ---

 Changes in v2:
 - Correct typo of 'endianness' in the commit message

  drivers/block/Makefile   |   1 -
  drivers/block/ata_piix.c | 717 
 ---
  drivers/block/ata_piix.h |  71 -
  3 files changed, 789 deletions(-)
  delete mode 100644 drivers/block/ata_piix.c
  delete mode 100644 drivers/block/ata_piix.h


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


Re: [U-Boot] fsl_elbc_nand bug

2015-05-18 Thread Scott Wood
On Fri, 2015-05-15 at 14:48 -0700, Andrei Yakimov wrote:
 Hi, 
  I just found, if NAND ONFI parameter page first copy is 
 bad, u-boot will never read extra copes: 
 
 fsl_elbc_nand.c: 
  342 out_be32(lbc-fbcr, 256);  
  343 ctrl-read_bytes = 256;
 
 this code cause read beyond buffer error message:
  
 nand_base.c:
chip-cmdfunc(mtd, NAND_CMD_PARAM, 0, -1);
 3243 for (i = 0; i  3; i++) {
 3244 for (j = 0; j  sizeof(*p); j++)
 3245 ((uint8_t *)p)[j] = chip-read_byte(mtd);
 3246 if (onfi_crc16(ONFI_CRC_BASE, (uint8_t *)p, 254) ==
 3247 le16_to_cpu(p-crc)) {
 3248 break;
 3249 }
 3250 }
 
 Unfortunately I do not working with latest u-boot now,
 so can not provide a patch,  read size should be increased to
 at least 768 ( 3 copy mandatory for ONFI spec). Linux kernel should be
 updated too.

Could you send a patch (both here and Linux)?  Especially since you have
a test case. :-)

Though a better fix than just increasing the byte count would be to add
a read_id() callback so that the NAND subsystem can actually tell the
driver how much data it's expecting, rather than forcing it to go
through cmdfunc that makes high-level drivers (poorly) emulate
low-level hardware.

 I am also not expert for other NAND controllers drivers.

At least IFC will have the same issue.

-Scott


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


Re: [U-Boot] [PATCH 4/5] nand: sunxi: Add multiimage preload option

2015-05-18 Thread Scott Wood
On Wed, 2015-04-29 at 17:03 +0200, Daniel Kochmański wrote:
 Patch adds support in spl_nand for preloading multiimage before
 loading u-boot into memory. It might be used in example to put in
 memory single image containing boot script, kernel and device
 tree.

Why can't the main U-Boot load it?

 Behavior is triggered, if CONFIG_SPL_NAND_MULTI_PRELOAD is defined -
 multiimage is loaded from CONFIG_SYS_NAND_MULTI_OFFS to address
 specified on image creation.
 
 Additionally defines it in sunxi-common.h conditionally when
 CONFIG_SPL_NAND_SUPPORT is enabled. SPL tries to preload image from
 beginning of non-syndrome area.
 
 Signed-off-by: Daniel Kochmański dkochman...@turtle-solutions.eu
 Cc: Ian Campbell i...@hellion.org.uk
 Cc: Hans De Goede hdego...@redhat.com
 ---
 
  README |  6 ++
  common/spl/spl_nand.c  | 14 ++
  include/configs/sunxi-common.h |  2 ++
  3 files changed, 22 insertions(+)
 
 diff --git a/README b/README
 index 4ccf3cb..444b02f 100644
 --- a/README
 +++ b/README
 @@ -3719,6 +3719,9 @@ FIT uImage format:
   CONFIG_SPL_NAND_BOOT
   Add support NAND boot
  
 + CONFIG_SPL_NAND_MULTI_PRELOAD
 + Preload multiimage from predefined offset in NAND.

Why is this not implied by CONFIG_SYS_NAND_MULTI_OFFS not being defined?

 +
   CONFIG_SYS_NAND_U_BOOT_OFFS
   Location in NAND to read U-Boot from
  
 @@ -3735,6 +3738,9 @@ FIT uImage format:
   CONFIG_SYS_NAND_U_BOOT_START
   Entry point in loaded image to jump to
  
 + CONFIG_SYS_NAND_MULTI_OFFS
 + Location in NAND to read multiimage from.

Why SYS and not SPL?  Why not using kconfig?

 +
   CONFIG_SYS_NAND_HW_ECC_OOBFIRST
   Define this if you need to first read the OOB and then the
   data. This is used, for example, on davinci platforms.
 diff --git a/common/spl/spl_nand.c b/common/spl/spl_nand.c
 index 7c44de1..f87db0a 100644
 --- a/common/spl/spl_nand.c
 +++ b/common/spl/spl_nand.c
 @@ -89,6 +89,20 @@ void spl_nand_load_image(void)
   (void *)spl_image.load_addr);
  #endif
  #endif
 +#ifdef CONFIG_SPL_NAND_MULTI_PRELOAD
 + /* Load multiimage */
 + puts(Preloading multiimage.\n);

This function isn't this verbose for any of the other images...

-Scott


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


Re: [U-Boot] [PATCH 5/5] nand: sunxi: And a20_nandread command utilizing spl nand read driver

2015-05-18 Thread Scott Wood
On Wed, 2015-04-29 at 17:03 +0200, Daniel Kochmański wrote:
 This patch adds a20_nandread command. It is simple function utilizing
 function from SPL nand driver `nand_spl_load_image`.
 
 Usage: a20_nandread address offset bytes
 
 Signed-off-by: Daniel Kochmański dkochman...@turtle-solutions.eu
 Cc: Ian Campbell i...@hellion.org.uk
 Cc: Hans De Goede hdego...@redhat.com
 ---
 
  common/Kconfig|  7 +++
  common/Makefile   |  1 +
  common/cmd_a20_nandread.c | 27 +++
  3 files changed, 35 insertions(+)
  create mode 100644 common/cmd_a20_nandread.c

Obviously a real NAND driver would be preferred (even if some
functionality is missing at first), but if for some reason we do need to
support simple read-only access using SPL code in the main U-Boot, what
is a20-specific about this file beyond the use case?

-Scott


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


Re: [U-Boot] [PATCH v4 01/10] moveconfig: Always run savedefconfig on the moved config

2015-05-18 Thread Masahiro Yamada
Hi Joe,

2015-05-16 6:40 GMT+09:00 Joe Hershberger joe.hershber...@ni.com:
 This will ensure that the order of the defconfig entries will always
 match that of the Kconfig files. After one slightly painful (but
 still early in the process) pass over all boards, this should keep
 the defconfigs clean from here on.

 Users must edit the Kconfig first to add the menu entries and then run
 moveconfig.py to update the defconfig files and the include configs.

 As such, moveconfig.py cannot compare against the '.config' contents.

 Signed-off-by: Joe Hershberger joe.hershber...@ni.com


This feature expects the defconfigs are all clean.
Otherwise, savedefconfig would make git diff noisier.

It is safer to use make menuconfig  make savedefconfig
for adding new options, but some people still try to
edit the defconfig directly...

Perhaps, should do the global cleanup periodically?


 ---
 This is based on https://patchwork.ozlabs.org/patch/472591/

 Changes in v4:
 -Rebased series on Masahiro's v2

 Changes in v3: None
 Changes in v2: None

  tools/moveconfig.py | 35 ++-
  1 file changed, 26 insertions(+), 9 deletions(-)

 diff --git a/tools/moveconfig.py b/tools/moveconfig.py
 index c39ea95..544f6af 100755
 --- a/tools/moveconfig.py
 +++ b/tools/moveconfig.py
 @@ -46,6 +46,9 @@ should look like this:
CONFIG_CMD_USB bool n
CONFIG_SYS_TEXT_BASE hex 0x

 +Next you must edit the Kconfig to add the menu entries for the configs
 +you are moving.
 +
  And then run this tool giving the file name of the recipe

Uh, I was doing in a different work-flow.
(I edit the Kconfig after I move CONFIGs to defconfigs).

But, the Kconfig must be edited beforehand
to do savedefconfig.

So, I am OK with this change.



$ tools/moveconfig.py recipe
 @@ -192,6 +195,7 @@ CROSS_COMPILE = {
  STATE_IDLE = 0
  STATE_DEFCONFIG = 1
  STATE_AUTOCONF = 2
 +STATE_SAVEDEFCONFIG = 3

  ACTION_MOVE = 0
  ACTION_DEFAULT_VALUE = 1
 @@ -390,8 +394,7 @@ class KconfigParser:

  return CROSS_COMPILE.get(arch, '')

 -def parse_one_config(self, config_attr, defconfig_lines,
 - dotconfig_lines, autoconf_lines):
 +def parse_one_config(self, config_attr, defconfig_lines, autoconf_lines):
  Parse .config, defconfig, include/autoconf.mk for one config.

  This function looks for the config options in the lines from
 @@ -402,7 +405,6 @@ class KconfigParser:
config_attr: A dictionary including the name, the type,
 and the default value of the target config.
defconfig_lines: lines from the original defconfig file.
 -  dotconfig_lines: lines from the .config file.
autoconf_lines: lines from the include/autoconf.mk file.

  Returns:
 @@ -418,7 +420,7 @@ class KconfigParser:
  else:
  default = config + '=' + config_attr['default']

 -for line in defconfig_lines + dotconfig_lines:
 +for line in defconfig_lines:
  line = line.rstrip()
  if line.startswith(config + '=') or line == not_set:
  return (ACTION_ALREADY_EXIST, line)
 @@ -463,15 +465,12 @@ class KconfigParser:
  with open(defconfig_path) as f:
  defconfig_lines = f.readlines()

 -with open(dotconfig_path) as f:
 -dotconfig_lines = f.readlines()
 -
  with open(autoconf_path) as f:
  autoconf_lines = f.readlines()

  for config_attr in self.config_attrs:
  result = self.parse_one_config(config_attr, defconfig_lines,
 -   dotconfig_lines, autoconf_lines)
 +   autoconf_lines)
  results.append(result)

  log = ''


With the change of the work-flow above,
we need not parse the .config, so this seems OK.



 @@ -499,7 +498,7 @@ class KconfigParser:
  print log,

  if not self.options.dry_run:
 -with open(defconfig_path, 'a') as f:
 +with open(dotconfig_path, 'a') as f:
  for (action, value) in results:
  if action == ACTION_MOVE:
  f.write(value + '\n')
 @@ -608,6 +607,24 @@ class Slot:

  if self.state == STATE_AUTOCONF:
  self.parser.update_defconfig(self.defconfig)
 +
 +Save off the defconfig in a consistent way
 +cmd = list(self.make_cmd)
 +cmd.append('savedefconfig')
 +self.ps = subprocess.Popen(cmd, stdout=self.devnull,
 +   stderr=self.devnull)
 +self.state = STATE_SAVEDEFCONFIG
 +return False
 +
 +if self.state == STATE_SAVEDEFCONFIG:
 +defconfig_path = os.path.join(self.build_dir, 'defconfig')
 +if not os.path.exists(defconfig_path):
 +print  sys.stderr, log_msg(self.options.color,
 +  

Re: [U-Boot] [PATCH v5 1/4] dm: sf: Add Atmel DataFlash spi flash driver

2015-05-18 Thread Wang Haikun
On 5/18/2015 9:28 PM, Haikun Wang wrote:
 Atmel DataFlash chips have commands different from common spi
 flash commands.
 Atmel DataFlash also have special page-size.
 This driver add support for accessing Atmel DataFlash.
 It is based on the Driver Model.
 Example:
 = sf probe 1:0
 SPI DataFlash: Detected AT45DB021B with page size 264 Bytes, erase size 264 
 Bytes, total 264 KiB, revision d
 = sf erase 0 42000
 SF: 270336 bytes @ 0x0 Erased: OK
 = mw.l 8200 45444342 2
 = sf write 8200 0 42000
 SF: 270336 bytes @ 0x0 Written: OK
 = sf read 8300 0 42000
 SF: 270336 bytes @ 0x0 Read: OK
 = cmp.b 8200 8300 42000
 Total of 270336 byte(s) were the same

 Signed-off-by: Haikun Wang haikun.w...@freescale.com
 ---
 Verified with AT45DB021B on LS1021AQDS.
 Changes in v5:
 - Change CONFIG_DM_SF_DATAFLASH to CONFIG_SF_DATAFLASH

 Changes in v4:
 - Use dev_get_priv and dev_get_uclass_priv
 - Add test log to commit message

 Changes in v3:
 - 1. Rename file spi_dataflash.c to sf_dataflash.c
 - 2. Add comment for array dataflash_data

 Changes in v2:
 - 1. Correct comment style
 - 2. Use get_timer in dataflash_waitready to check whether timeout
 - 3. Remove struct spi_flash * in struct dataflash, and get it from 
 udevice-uclass_priv
 - 4. Replace spi_flash_write_common with spi_flash_cmd_write
 - 5. Replace spi_flash_read with spi_flash_cmd_read
 - 6. Change type of varible status form char to u8 in dataflash_status
 - 7. Change add_dataflash's argument type due to change 3
 - 8. Add claim_bus and release_bus in erase/write/read due to change 4  5

 Changes in v1: None
   drivers/mtd/spi/Makefile   |   1 +
   drivers/mtd/spi/sf_dataflash.c | 711 
 +
   2 files changed, 712 insertions(+)
   create mode 100644 drivers/mtd/spi/sf_dataflash.c
+ York Sun
Help him review the rest patches of this set.

 diff --git a/drivers/mtd/spi/Makefile b/drivers/mtd/spi/Makefile
 index c61b784..87f20bc 100644
 --- a/drivers/mtd/spi/Makefile
 +++ b/drivers/mtd/spi/Makefile
 @@ -15,6 +15,7 @@ endif
   #ifndef CONFIG_DM_SPI
   obj-$(CONFIG_SPI_FLASH) += sf_probe.o
   #endif
 +obj-$(CONFIG_SF_DATAFLASH) += sf_dataflash.o
   obj-$(CONFIG_CMD_SF) += sf.o
   obj-$(CONFIG_SPI_FLASH) += sf_ops.o sf_params.o
   obj-$(CONFIG_SPI_FLASH_SANDBOX) += sandbox.o
 diff --git a/drivers/mtd/spi/sf_dataflash.c b/drivers/mtd/spi/sf_dataflash.c
 new file mode 100644
 index 000..d287db8
 --- /dev/null
 +++ b/drivers/mtd/spi/sf_dataflash.c
 @@ -0,0 +1,711 @@
 +/*
 + *
 + * Atmel DataFlash probing
 + *
 + * Copyright (C) 2004-2009, 2015 Freescale Semiconductor, Inc.
 + * Haikun Wang (haikun.w...@freescale.com)
 + *
 + * SPDX-License-Identifier:  GPL-2.0+
 +*/
 +#include common.h
 +#include dm.h
 +#include errno.h
 +#include fdtdec.h
 +#include spi.h
 +#include spi_flash.h
 +#include div64.h
 +#include linux/err.h
 +#include linux/math64.h
 +
 +#include sf_internal.h
 +
 +/*
 + * DataFlash is a kind of SPI flash.  Most AT45 chips have two buffers in
 + * each chip, which may be used for double buffered I/O; but this driver
 + * doesn't (yet) use these for any kind of i/o overlap or prefetching.
 + *
 + * Sometimes DataFlash is packaged in MMC-format cards, although the
 + * MMC stack can't (yet?) distinguish between MMC and DataFlash
 + * protocols during enumeration.
 + */
 +
 +/* reads can bypass the buffers */
 +#define OP_READ_CONTINUOUS   0xE8
 +#define OP_READ_PAGE 0xD2
 +
 +/* group B requests can run even while status reports busy */
 +#define OP_READ_STATUS   0xD7/* group B */
 +
 +/* move data between host and buffer */
 +#define OP_READ_BUFFER1  0xD4/* group B */
 +#define OP_READ_BUFFER2  0xD6/* group B */
 +#define OP_WRITE_BUFFER1 0x84/* group B */
 +#define OP_WRITE_BUFFER2 0x87/* group B */
 +
 +/* erasing flash */
 +#define OP_ERASE_PAGE0x81
 +#define OP_ERASE_BLOCK   0x50
 +
 +/* move data between buffer and flash */
 +#define OP_TRANSFER_BUF1 0x53
 +#define OP_TRANSFER_BUF2 0x55
 +#define OP_MREAD_BUFFER1 0xD4
 +#define OP_MREAD_BUFFER2 0xD6
 +#define OP_MWERASE_BUFFER1   0x83
 +#define OP_MWERASE_BUFFER2   0x86
 +#define OP_MWRITE_BUFFER10x88/* sector must be pre-erased */
 +#define OP_MWRITE_BUFFER20x89/* sector must be pre-erased */
 +
 +/* write to buffer, then write-erase to flash */
 +#define OP_PROGRAM_VIA_BUF1  0x82
 +#define OP_PROGRAM_VIA_BUF2  0x85
 +
 +/* compare buffer to flash */
 +#define OP_COMPARE_BUF1  0x60
 +#define OP_COMPARE_BUF2  0x61
 +
 +/* read flash to buffer, then write-erase to flash */
 +#define OP_REWRITE_VIA_BUF1  0x58
 +#define OP_REWRITE_VIA_BUF2  0x59
 +
 +/*
 + * newer chips report JEDEC manufacturer and device IDs; chip
 + * serial number and OTP bits; and per-sector writeprotect.
 + */
 +#define OP_READ_ID   0x9F
 +#define OP_READ_SECURITY 0x77
 +#define 

Re: [U-Boot] [PATCH v4 07/10] moveconfig: Output a list of failed boards

2015-05-18 Thread Masahiro Yamada
2015-05-16 6:40 GMT+09:00 Joe Hershberger joe.hershber...@ni.com:
 If boards fail, output that list to a file so that it can easily be
 passed back into moveconfig.py using the -d option.

 Signed-off-by: Joe Hershberger joe.hershber...@ni.com
 ---

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

  tools/moveconfig.py | 4 
  1 file changed, 4 insertions(+)

 diff --git a/tools/moveconfig.py b/tools/moveconfig.py
 index 15b0f2b..9e923da 100755
 --- a/tools/moveconfig.py
 +++ b/tools/moveconfig.py
 @@ -728,6 +728,10 @@ class Slots:
  for line in msg:
  print  sys.stderr, color_text(self.options.color,
  COLOR_LIGHT_RED, line)
 +ffail = open('moveconfig.failed', 'w')
 +for failed_board in failed_boards:
 +ffail.write(%s\n % failed_board)
 +ffail.close()

  def move_config(config_attrs, options):
  Move config options to defconfig files.


If you use with ... as ..., it will automatically close
the file on exit.

with open('moveconfig.failed', 'w') as f:
for board in failed_boards:
f.write(board + '\n')





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


Re: [U-Boot] [PATCH v4 02/10] moveconfig: Ignore duplicate configs when moving

2015-05-18 Thread Masahiro Yamada
2015-05-16 6:40 GMT+09:00 Joe Hershberger joe.hershber...@ni.com:
 When moving configs, it is important to know what was defined in the
 config header even if it duplicates the configs coming from Kconfig.

 This is specifically needed for the case where a config is set to
 default 'y' in the Kconfig. This would previously cause the actual value
 from the include config to be filtered out, and moveconfig.py would
 think that it was 'n'... This means that the value that should be 'y'
 is now (in every defconfig) set to 'not set'.

 tools/moveconfig.py now defines KCONFIG_IGNORE_DUPLICATES to prevent the
 filtering from happening and selecting wrong values for the defconfig.

 Signed-off-by: Joe Hershberger joe.hershber...@ni.com

 ---

 Changes in v4: None
 Changes in v3:
 -New for version 3

 Changes in v2: None

  scripts/Makefile.autoconf | 3 ++-
  tools/moveconfig.py   | 1 +
  2 files changed, 3 insertions(+), 1 deletion(-)

 diff --git a/scripts/Makefile.autoconf b/scripts/Makefile.autoconf
 index f054081..36bfa17 100644
 --- a/scripts/Makefile.autoconf
 +++ b/scripts/Makefile.autoconf
 @@ -58,7 +58,8 @@ quiet_cmd_autoconf = GEN $@
 $(CPP) $(c_flags) $2 -DDO_DEPS_ONLY -dM $(srctree)/include/common.h  
 $@.tmp  { \
 sed -n -f $(srctree)/tools/scripts/define2mk.sed $@.tmp | 
   \
 while read line; do   
   \
 -   if ! grep -q $${line%=*}= include/config/auto.conf; 
 then  \
 +   if [ -n ${KCONFIG_IGNORE_DUPLICATES} ] ||   
   \
 +  ! grep -q $${line%=*}= include/config/auto.conf; 
 then  \
 echo $$line;
   \
 fi
   \
 done  $@;
   \
 diff --git a/tools/moveconfig.py b/tools/moveconfig.py
 index 544f6af..d3009de 100755
 --- a/tools/moveconfig.py
 +++ b/tools/moveconfig.py
 @@ -632,6 +632,7 @@ class Slot:
  cmd = list(self.make_cmd)
  if cross_compile:
  cmd.append('CROSS_COMPILE=%s' % cross_compile)
 +cmd.append('KCONFIG_IGNORE_DUPLICATES=1')
  cmd.append('include/config/auto.conf')
  self.ps = subprocess.Popen(cmd, stdout=self.devnull)
  self.state = STATE_AUTOCONF
 --


Now, I fully understood your intention.
This comes from our work-flow differences.

Because I edited the Kconfig after moving configs that are default to y,
so I did not notice this necessity.

Anyway, we should do it beforehand for savedefconfig.

So, this looks good to me.

Acked-by: Masahiro Yamada yamada.masah...@socionext.com


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


Re: [U-Boot] [PATCH v2] README.scrapyard: add entries for dead board, T4240EMU and sc3

2015-05-18 Thread Masahiro Yamada
Tom,

Ping.



2015-05-15 11:51 GMT+09:00 Masahiro Yamada yamada.masah...@socionext.com:
 Follow-up commit 7fc63cca611b (mpc85xx/T4240EMU: Remove T4240EMU
 board), and commit 27e721564591 (ppc4xx: Remove sc3 board),
 filling the blank fields.

 Signed-off-by: Masahiro Yamada yamada.masah...@socionext.com
 ---

 Changes in v2:
   - rebased on commit 4588d61a284

  doc/README.scrapyard | 8 +---
  1 file changed, 5 insertions(+), 3 deletions(-)

 diff --git a/doc/README.scrapyard b/doc/README.scrapyard
 index aa2b07b..a62bd0b 100644
 --- a/doc/README.scrapyard
 +++ b/doc/README.scrapyard
 @@ -12,9 +12,11 @@ The list should be sorted in reverse chronological order.

  BoardArchCPUCommit  Removed Last 
 known maintainer/contact
  
 =
 -afeb9260 arm arm926ejs  -   -   Sergey 
 Lapin sla...@ossfans.org
 -tny_a9260arm arm926ejs  -   -   Albin 
 Tonnerre albin.tonne...@free-electrons.com
 -sbc35_a9g20  arm arm926ejs  -   -   Albin 
 Tonnerre albin.tonne...@free-electrons.com
 +afeb9260 arm arm926ejs  f6b42c142015-05-13  Sergey 
 Lapin sla...@ossfans.org
 +tny_a9260arm arm926ejs  f6b42c142015-05-13  Albin 
 Tonnerre albin.tonne...@free-electrons.com
 +sbc35_a9g20  arm arm926ejs  f6b42c142015-05-13  Albin 
 Tonnerre albin.tonne...@free-electrons.com
 +sc3  powerpc ppc4xx 27e721562015-05-10  Heiko 
 Schocher h...@denx.de
 +T4240EMU powerpc mpc85xx7fc63cca2015-05-05  York Sun 
 york...@freescale.com
  koratpowerpc ppc4xx 5043045d2015-03-17  Larry 
 Johnson l...@acm.org
  galaxy5200   powerpc mpc5xxx41eb4e5c2015-03-17  Eric 
 Millbrandt emillbra...@dekaresearch.com
  W7OLMC   powerpc ppc4xx 6beecd5d2015-03-17  Erik 
 Theisen ethei...@mindspring.com
 --
 1.9.1

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



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


Re: [U-Boot] [PATCH v3 3/4] arm: ls102xa: Enable Driver Model SPI for ls1021aqds

2015-05-18 Thread Wang Haikun
On 5/19/2015 12:22 AM, Sun York-R58495 wrote:
 Haikun,

 On 05/18/2015 06:24 AM, Haikun Wang wrote:
 Enable Driver Model SPI for ls1021aqds board.
 DSPI and QSPI is enabled only when boot from QSPI.
 DSPI and QSPI are compatible under Driver Model SPI.

 Signed-off-by: Haikun Wang haikun.w...@freescale.com
 ---
 Changes in v3:
 - Remove CONFIG_SPI_FLASH_ATMEL
 - IS_ENABLED(CONFIG_XXX) is only work with configure option in Kconfig,
and DM core code use IS_ENABLED(), so configure option in head file
can't work, so remove CONFIG_OF_CONTROL CONFIG_OF_SEPARATE CONFIG_DM 
 CONFIG_DM_SPI

 Changes in v2:
 - Move all changes inside of CONFIG_QSPI_BOOT

 Changes in v1: None
   include/configs/ls1021aqds.h | 13 +++--
   1 file changed, 11 insertions(+), 2 deletions(-)


 I lost track of your patch set. You have v3 3/4 and v3 4/4. Where are the 
 first
 two patches in this set?
Sorry, I forget copy to you in the two previous patches.
I will copy to you now.

 The subject arm:ls102xa is not too bad. For future patches, I prefer the 
 subject
 to be arch/soc, or arch/board. This one should have arm/ls1021aqds, or
 armv7/ls1021aqds. It helps maintainers to delegate the patches to custodians.
Fine.

 York


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


Re: [U-Boot] [PATCH v1 2/4] dm: ls1021aqds: dts: Use spi_dataflash driver instead of spi_flash_std for DSPI flash

2015-05-18 Thread Wang Haikun
On 5/18/2015 9:28 PM, Haikun Wang wrote:
 The type of DSPI flash on ls1021aqds is AT45DB021, it has specail
 commands and page-size.
 Use the special spi flash driver instead of spi_flash_std driver.

 Signed-off-by: Haikun Wang haikun.w...@freescale.com
 ---
   arch/arm/dts/ls1021a-qds.dts | 2 +-
   1 file changed, 1 insertion(+), 1 deletion(-)
+ York Sun
Help him review the rest patches of this set.

 diff --git a/arch/arm/dts/ls1021a-qds.dts b/arch/arm/dts/ls1021a-qds.dts
 index 8367811..e634292 100644
 --- a/arch/arm/dts/ls1021a-qds.dts
 +++ b/arch/arm/dts/ls1021a-qds.dts
 @@ -30,7 +30,7 @@
   dspiflash: at45db021d@0 {
   #address-cells = 1;
   #size-cells = 1;
 - compatible = spi-flash;
 + compatible = atmel,dataflash;
   spi-max-frequency = 1600;
   spi-cpol;
   spi-cpha;


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


Re: [U-Boot] [PATCH v4 10/10] moveconfig: Print status about the processed defconfigs

2015-05-18 Thread Masahiro Yamada
2015-05-16 6:40 GMT+09:00 Joe Hershberger joe.hershber...@ni.com:
 This gives a basic idea about progress.

 Signed-off-by: Joe Hershberger joe.hershber...@ni.com


Good idea!


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


Re: [U-Boot] [PATCH v4 08/10] moveconfig: Print a message for missing compiler

2015-05-18 Thread Masahiro Yamada
2015-05-16 6:40 GMT+09:00 Joe Hershberger joe.hershber...@ni.com:
 A common case for failed builds is a missing compiler. Print a message
 for that case to tell the user concisely which compiler was expected
 that was not found.

 This patch also has the effect of not printing build errors any longer.
 The next patch will add a switch to optionally bring that back.

 Signed-off-by: Joe Hershberger joe.hershber...@ni.com
 ---

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

  tools/moveconfig.py | 16 ++--
  1 file changed, 10 insertions(+), 6 deletions(-)

 diff --git a/tools/moveconfig.py b/tools/moveconfig.py
 index 9e923da..f986f55 100755
 --- a/tools/moveconfig.py
 +++ b/tools/moveconfig.py
 @@ -166,6 +166,7 @@ import os
  import re
  import shutil
  import subprocess
 +from subprocess import PIPE

Personally I do not prefer from ... import
because it disturbs the naming space.

Could you use subprocess.PIPE instead?


  import sys
  import tempfile
  import time
 @@ -606,11 +607,14 @@ class Slot:
  return False

  if self.ps.poll() != 0:
 -
 +errmsg = 'Failed to process.'
 +errout = self.ps.stderr.read()

This throws exception if make *_defconfig or make savedefconfig fail.



Traceback (most recent call last):
  File tools/moveconfig.py, line 924, in module
main()
  File tools/moveconfig.py, line 919, in main
move_config(config_attrs, options)
  File tools/moveconfig.py, line 794, in move_config
while not slots.available():
  File tools/moveconfig.py, line 717, in available
if slot.poll():
  File tools/moveconfig.py, line 616, in poll
errout = self.ps.stderr.read()
AttributeError: 'NoneType' object has no attribute 'read'



Seems better to add PIPE for all the call of subprocess.Popen()





 +if errout.find('gcc: command not found') != -1:
 +errmsg = 'Compiler not found (%s)' % self.cross_compile

If you do this, should the locale be changed?

Without LANG=C, command not found is displayed in Japanese on my computer.


If --verbose is given, we will be able to know the cause of erorr.
missing compiler is a special case error?



  print  sys.stderr, log_msg(self.options.color,
   COLOR_LIGHT_RED,
   self.defconfig,
 - failed to process.)
 + errmsg),
  if self.options.exit_on_error:
  sys.exit(Exit on error.)
  else:
 @@ -644,13 +648,13 @@ class Slot:
  self.state = STATE_IDLE
  return True

 -cross_compile = self.parser.get_cross_compile()
 +self.cross_compile = self.parser.get_cross_compile()
  cmd = list(self.make_cmd)
 -if cross_compile:
 -cmd.append('CROSS_COMPILE=%s' % cross_compile)
 +if self.cross_compile:
 +cmd.append('CROSS_COMPILE=%s' % self.cross_compile)
  cmd.append('KCONFIG_IGNORE_DUPLICATES=1')
  cmd.append('include/config/auto.conf')
 -self.ps = subprocess.Popen(cmd, stdout=self.devnull)
 +self.ps = subprocess.Popen(cmd, stdout=self.devnull, stderr=PIPE)
  self.state = STATE_AUTOCONF
  return False


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


Re: [U-Boot] [PATCH v4 09/10] moveconfig: Add a switch to enable printing errors

2015-05-18 Thread Masahiro Yamada
2015-05-16 6:40 GMT+09:00 Joe Hershberger joe.hershber...@ni.com:
 In some cases the build for the autoconf breaks. This outputs the errors
 following the status so that action can be taken without building again
 manually.

 Signed-off-by: Joe Hershberger joe.hershber...@ni.com

 ---

 Changes in v4: None
 Changes in v3: None
 Changes in v2:
 -New for version 2

  tools/moveconfig.py | 9 +
  1 file changed, 9 insertions(+)

 diff --git a/tools/moveconfig.py b/tools/moveconfig.py
 index f986f55..685b47b 100755
 --- a/tools/moveconfig.py
 +++ b/tools/moveconfig.py
 @@ -153,6 +153,9 @@ Available options
 Specify the number of threads to run simultaneously.  If not specified,
 the number of threads is the same as the number of CPU cores.

 + -v, --verbose
 +   Show any build errors as boards are built
 +
  To see the complete list of supported options, run

$ tools/moveconfig.py -h
 @@ -615,6 +618,9 @@ class Slot:
   COLOR_LIGHT_RED,
   self.defconfig,
   errmsg),
 +if self.options.verbose:
 +print  sys.stderr, color_text(self.options.color,
 +COLOR_LIGHT_CYAN, errout)
  if self.options.exit_on_error:
  sys.exit(Exit on error.)
  else:
 @@ -882,6 +888,9 @@ def main():
help='only cleanup the headers')
  parser.add_option('-j', '--jobs', type='int', default=cpu_count,
help='the number of jobs to run simultaneously')
 +parser.add_option('-v', '--verbose', dest='verbose',
 +  action='store_true', default=False,
 +  help='show any build errors as boards are built')

dest='verbose' is redundant.

The destination is chosen based on the long option name.


Apart from that, I think this is a nice improvement.


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


Re: [U-Boot] [PATCH v4 03/10] moveconfig: Add a parameter to accept a list to build

2015-05-18 Thread Masahiro Yamada
2015-05-16 6:40 GMT+09:00 Joe Hershberger joe.hershber...@ni.com:
 This is helpful to re-attempt to move failed boards from a previous run
 without starting over.

 Signed-off-by: Joe Hershberger joe.hershber...@ni.com

 ---

 Changes in v4: None
 Changes in v3:
 -Fixed command line options order (alphabetize)

 Changes in v2:
 -New for version 2

  tools/moveconfig.py | 26 --
  1 file changed, 20 insertions(+), 6 deletions(-)

 diff --git a/tools/moveconfig.py b/tools/moveconfig.py
 index d3009de..3f31e81 100755
 --- a/tools/moveconfig.py
 +++ b/tools/moveconfig.py
 @@ -135,6 +135,9 @@ Available options
 Surround each portion of the log with escape sequences to display it
 in color on the terminal.

 + -d, --defconfigs
 +  Specify a file containing a list of defconfigs to move
 +
   -n, --dry-run
 Peform a trial run that does not make any changes.  It is useful to
 see what is going to happen before one actually runs it.
 @@ -734,12 +737,21 @@ def move_config(config_attrs, options):
  config_attr['type'],
  config_attr['default'])

 -# All the defconfig files to be processed
 -defconfigs = []
 -for (dirpath, dirnames, filenames) in os.walk('configs'):
 -dirpath = dirpath[len('configs') + 1:]
 -for filename in fnmatch.filter(filenames, '*_defconfig'):
 -defconfigs.append(os.path.join(dirpath, filename))
 +if options.defconfigs:
 +defconfigs = [line.strip() for line in open(options.defconfigs, 'r')]
 +for i, defconfig in enumerate(defconfigs):
 +if not defconfig.endswith('_defconfig'):
 +defconfigs[i] = defconfig + '_defconfig'
 +if not os.path.exists(os.path.join('configs', defconfigs[i])):
 +sys.exit('%s - defconfig does not exist. Stopping.' %
 + defconfigs[i])


'r' is redundant for open() because read-mode is default.

moveconfig.failed always prefixes _defconfig,
so we need not to do so again, I think. (or will we make this file by hand?)

Then, we can drop enumarate and write the error message within 80 columns.

if options.defconfigs:
defconfigs = [line.strip() for line in open(options.defconfigs)]
for defconfig in defconfigs:
if not os.path.exists(os.path.join('configs', defconfig)):
sys.exit('%s: defconfig does not exist. Stopping.' % defconfig)



  slots = Slots(config_attrs, options)

 @@ -840,6 +852,8 @@ def main():
  # Add options here
  parser.add_option('-c', '--color', action='store_true', default=False,
help='display the log in color')
 +parser.add_option('-d', '--defconfigs', type='string',
 +  help='a file containing a list of defconfigs to move')
  parser.add_option('-n', '--dry-run', action='store_true', default=False,
help='perform a trial run (show log with no changes)')
  parser.add_option('-e', '--exit-on-error', action='store_true',





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


Re: [U-Boot] [RFC PATCH] tools: get-toolchais: a tool to get cross-tools for all architectures

2015-05-18 Thread Masahiro Yamada
Hi Simon,


2015-05-18 2:50 GMT+09:00 Simon Glass s...@chromium.org:
 Hi Masahiro,

 On 15 May 2015 at 22:58, Masahiro Yamada yamada.masah...@socionext.com
 wrote:
 Hi Joe,
 (added Simon)

 2015-05-16 4:52 GMT+09:00 Joe Hershberger joe.hershber...@gmail.com:
 Hi Masahiro-san,

 On Fri, May 15, 2015 at 6:01 AM, Masahiro Yamada
 yamada.masah...@socionext.com wrote:
 When we send patches, we are supposed to test them by build utilities
 such as MAKEALL, buildman. When we want to test global changes, the
 first hurdle is, I think, to collect toolchains for all the
 architectures.

 We have some documents about build utilities, but I have not seen any
 official information about how to get the suitable cross-tools.
 Of course, it is possible to build them from sources, but it is not
 necessarily feasible.

 Fortunately, the kernel.org site provides us pre-built toolchains, but
 some architectures are missing. Also, some boards fail to build with
 the kernel.org tools. We sometimes see, where can I get the compiler
 for this architecture? things on the ML. We should be able to prepare
 cross-compilers more easily.

 It is true that buildman provides --fetch-arch option for downloading
 kernel.org toolchains, but it does not have access to others. And what
 we really want to know is most likely how to get compilers for such
 minor
 architectures as kernel.org does not provide.

 Maybe just integrate this into buildman? Or remove it from buildman?
 In buildman has the benefit that it updates buildman's config to know
 how to find the compiler.

 I wanted to add more options to provide better flexibility.

 For example, I wanted --destdir option
 because I think installing tools under /opt/ or /usr/loca/ is a generic
 demand.

 That's why I implemented this tool as a separate script.
 I also want to hear Simon's opinion.

 I think a separate script is fine - it helps if we can reduce the
 functionality in buildman. But buildman should call this script.

We cannot mix up python 2 and 3 script.

If buildman should call this script, it must be re-written in 2.



 Also I
 think your script should use urllib2 and IMO the simple progress update
 that buildman provides is plenty.

In python 2, there exist two libraries, urllib and urlib2, to do similar things.

In python 3,  the former was discontinued and the latter was renamed
into urllib.

So, the urllib I am using in my python 3 script
is equivalent to what you call urllib2 in python 2.


 Re the destination, buildman could provide its own destination for its
 download operation. But I suggest we use the same default one for both.

OK, I can do this.

 Perhaps your default makes more sense that buildman's? After all, buildman
 doesn't really care where it is.



 This tool intends to be more generic design without hard-coding such
 kernel.org things.

 To achieve that, this tool consists of two files:
 Python script (this file) and the database file containing URLs of
 tarballs.

 We just need to update the latter when new version compilers are
 released
 (or better compilers are found.) The file is in the form of RFC 822 for
 easier editing.

 Any reason not to just maintain this list on the wiki. It seem this is
 the primary issue for everyone... not figuring out how to download or
 extract the toolchain.

 I can just note URLs down in README or wiki.

 Of course, everyone knows how to download a tarball and extract it, but
 isn't it more convenient to prepare a utility that can do everything for
 you?


 The script only uses Python libraries, not relies on external programs
 although it displays wget-like log when downloading tarballs. :-)

 It seems like using wget would be more appropriate. Why reinvent the
 wheel?


 My intention was to not depend on particular external programs like wget,
 curl.

 But, you are right, we should not reinvent the wheel.

 I will replace my implementation with a caller of wget.

 I think urllib2 is a better solution.

Now I understand we must depend on tar anyway.

So my first intention no external program dependency  seems impossible
(at least on Python 2).

I do not mind depending on wget, and it seems easier.





 This is RFC because I am thinking it can be more brushed up.
 If the basis idea is OK, I will improve code, add more comments.

 Note this script is written in Python 3 and only works on Python 3.3
 or later. I do not think it is too much limitation, but some popular
 distributions under support might include older version. For example,
 looks like Ubuntu 12.04 LTS is shipped with Python 3.2.

 Why not write it in something that exists everywhere? If it's just for
 downloading tool-chains, seems it should be easy to make it python 2.6
 compatible.

 The reason of Python 3.3 dependency is that I wanted to unpack tarballs
 with a Python library.

 The tarfile library only supports .xz format on version 3.3 or later.

 We can just invoke tar program rather than Python library, so this version
 dependency will go away.


Re: [U-Boot] [PATCH 19/19] imx: ventana: config: enable Falcon mode

2015-05-18 Thread Fabio Estevam
Hi Tim,

On Fri, May 8, 2015 at 10:28 PM, Tim Harvey thar...@gateworks.com wrote:
 Falcon mode entails the SPL booting the OS directly instead of U-Boot.

I would like to give this a try, but I am not sure where the dtb
should be placed in the SD card.

Or are you combining the dtb and zImage into a single binary?

Do you have a small README that shows how the user should use Falcon mode?

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


Re: [U-Boot] [PATCH 2/5] nand: sunxi: Add support for booting from internal NAND memory

2015-05-18 Thread Scott Wood
On Wed, 2015-04-29 at 17:02 +0200, Daniel Kochmański wrote:
 Adds minimal DMA NAND driver for booting from NAND internal
 memory. New config option SPL_NAND_SUPPORT is created for sunxi board,
 which enables introduced driver and sets ENV_IS_NOWHERE (instead of
 ENV_IS_IN_MMC).
 
 NAND driver utilizes DMA interface to flash controller, which supports
 randomization. Reading from both syndrome and non-syndrom partitions
 is supported. Writing to flash isn't implemented for time being.
 
 Signed-off-by: Daniel Kochmański dkochman...@turtle-solutions.eu
 Cc: Ian Campbell i...@hellion.org.uk
 Cc: Hans De Goede hdego...@redhat.com
 ---
 
  arch/arm/cpu/armv7/sunxi/board.c |  12 ++-
  board/sunxi/Kconfig  |  12 +++
  board/sunxi/Makefile |   1 +
  board/sunxi/nand.c   | 219 
 +++
  common/spl/spl_nand.c|  13 +--
  include/configs/sunxi-common.h   |   9 ++
  6 files changed, 258 insertions(+), 8 deletions(-)
  create mode 100644 board/sunxi/nand.c

NAND drivers go in drivers/mtd/nand (with spl in the name since it's
an SPL driver).

-Scott


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


Re: [U-Boot] please pull u-boot-arc master

2015-05-18 Thread Tom Rini
On Mon, May 18, 2015 at 12:30:32PM +, Alexey Brodkin wrote:

 Hi Tom,
 
 The following changes since commit 3bfe3ce2a6e3b04da1d04dbc0520dcc26e17f98a:
 
   MAINTAINERS, git-mailrc: Update Jagan's name and e-mail (2015-05-16 
 07:34:26 -0400)
 
 are available in the git repository at:
 
   git://git.denx.de/u-boot-arc.git 
 
 for you to fetch changes up to 0744c2f1ad082a4d9ac38084b8f3ac84cc012d05:
 
   arc: gitignore: ignore ARC DTBs (2015-05-18 12:06:36 +0300)
 

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] please pull u-boot-samsung master

2015-05-18 Thread Tom Rini
On Mon, May 18, 2015 at 08:52:00PM +0900, Minkyu Kang wrote:

 Dear Tom,
 
 The following changes since commit 905e8f9e53766e606bd4a0ed46d804889e613f32:
 
   Prepare v2015.07-rc1 (2015-05-05 19:52:15 -0400)
 
 are available in the git repository at:
 
   http://git.denx.de/u-boot-samsung 
 
 for you to fetch changes up to cf85202770d95474ba341b8881f9b76589244bed:
 
   exynos: clock: clean up checkpatch issues (2015-05-18 20:47:31 +0900)
 

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 3/3] x86: quark: Implement PIRQ routing

2015-05-18 Thread Bin Meng
Hi Simon,

On Tue, May 5, 2015 at 10:05 AM, Simon Glass s...@chromium.org wrote:
 Hi Bin,

 On 4 May 2015 at 00:27, Bin Meng bmeng...@gmail.com wrote:

 Hi Simon,

 On Tue, Apr 28, 2015 at 10:05 PM, Simon Glass s...@chromium.org wrote:
  Hi Bin,
 
  On 27 April 2015 at 00:16, Bin Meng bmeng...@gmail.com wrote:
  Intel Quark SoC has the same interrupt routing mechanism as the
  Queensbay platform, only the difference is that PCI devices'
  INTA/B/C/D are harcoded and cannot be changed freely.
 
  Signed-off-by: Bin Meng bmeng...@gmail.com
 
  ---
 
   arch/x86/cpu/quark/Makefile  |   2 +-
   arch/x86/cpu/quark/irq.c | 173 
  +++
   arch/x86/cpu/quark/quark.c   |   8 ++
   arch/x86/include/asm/arch-quark/device.h |  70 ++---
   arch/x86/include/asm/arch-quark/irq.h|  55 ++
   arch/x86/include/asm/arch-quark/quark.h  |  15 +++
   configs/galileo_defconfig|   1 +
   include/configs/galileo.h|   1 +
   8 files changed, 309 insertions(+), 16 deletions(-)
   create mode 100644 arch/x86/cpu/quark/irq.c
   create mode 100644 arch/x86/include/asm/arch-quark/irq.h
 
  Before going too far down this path I'd like to see if we can put the
  IRQ data in the device tree. What do you think?
 

 Device tree might work, and we might come up with a standard intel irq
 router driver to configure this based on device tree input. But I will
 need study more chipset datasheet to do that.

 OK let's wait for that. It does seem like a job for device tree. Even
 if we can get a binding that works for modern chips that would be a
 win. Let me know what you find.


I've refactored current PIRQ support using device tree on queensbay.
Next is on quark and qemu. A patch will be sent out soon.

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


Re: [U-Boot] [PATCH v4 04/10] moveconfig: Add a switch to only cleanup headers

2015-05-18 Thread Masahiro Yamada
Hi Joe,

2015-05-16 6:40 GMT+09:00 Joe Hershberger joe.hershber...@ni.com:
 In some case you may want to only cleanup the headers. Make it possible
 without waiting for all boards to compile.

 Signed-off-by: Joe Hershberger joe.hershber...@ni.com

 ---

 Changes in v4: None
 Changes in v3:
 -New for version 3

 Changes in v2: None

  tools/moveconfig.py | 13 ++---
  1 file changed, 10 insertions(+), 3 deletions(-)

 diff --git a/tools/moveconfig.py b/tools/moveconfig.py
 index 3f31e81..b6db058 100755
 --- a/tools/moveconfig.py
 +++ b/tools/moveconfig.py
 @@ -146,6 +146,9 @@ Available options
 Exit immediately if Make exits with a non-zero status while processing
 a defconfig file.

 + -H, --headers-only
 +   Only cleanup the headers; skip the defconfig processing
 +
   -j, --jobs
 Specify the number of threads to run simultaneously.  If not specified,
 the number of threads is the same as the number of CPU cores.
 @@ -770,8 +773,6 @@ def move_config(config_attrs, options):

  slots.show_failed_boards()

 -cleanup_headers(config_attrs, options.dry_run)
 -
  def bad_recipe(filename, linenum, msg):
  Print error message with the file name and the line number and 
 exit.
  sys.exit(%s: line %d: error :  % (filename, linenum) + msg)
 @@ -859,6 +860,9 @@ def main():
  parser.add_option('-e', '--exit-on-error', action='store_true',
default=False,
help='exit immediately on any error')
 +parser.add_option('-H', '--headers-only', dest='cleanup_headers_only',
 +  action='store_true', default=False,
 +  help='only cleanup the headers')
  parser.add_option('-j', '--jobs', type='int', default=cpu_count,
help='the number of jobs to run simultaneously')
  parser.usage += ' recipe_file\n\n' + \
 @@ -879,7 +883,10 @@ def main():

  update_cross_compile()

 -move_config(config_attrs, options)
 +if not options.cleanup_headers_only:
 +move_config(config_attrs, options)
 +
 +cleanup_headers(config_attrs, options.dry_run)

  if __name__ == '__main__':
  main()


Could you also move the check_top_directory() call
to main() function, above the move_config call.

We should make sure we are at the top directory
also for cleaning headers.



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


Re: [U-Boot] [PATCH 3/5] nand: sunxi: Add secondary U-Boot offset on second syndrome partition

2015-05-18 Thread Scott Wood
On Wed, 2015-04-29 at 17:02 +0200, Daniel Kochmański wrote:
 diff --git a/common/spl/spl_nand.c b/common/spl/spl_nand.c
 index 9d59fbb..7c44de1 100644
 --- a/common/spl/spl_nand.c
 +++ b/common/spl/spl_nand.c
 @@ -2,6 +2,9 @@
   * Copyright (C) 2011
   * Corscience GmbH  Co. KG - Simon Schwarz schw...@corscience.de
   *
 + * Copyright (C) 2015
 + * Turtle Solutions - Daniel Kochmański dkochman...@turtle-solutions.eu
 + *
   * SPDX-License-Identifier:  GPL-2.0+
   */
  #include common.h
 @@ -90,9 +93,28 @@ void spl_nand_load_image(void)
   nand_spl_load_image(CONFIG_SYS_NAND_U_BOOT_OFFS,
   sizeof(*header), (void *)header);
   spl_parse_image_header(header);
 - nand_spl_load_image(CONFIG_SYS_NAND_U_BOOT_OFFS,
 - spl_image.size,
 - (void *)(unsigned long)spl_image.load_addr);
 + if (header-ih_os == IH_OS_U_BOOT) {
 + nand_spl_load_image(CONFIG_SYS_NAND_U_BOOT_OFFS,
 + spl_image.size,
 + (void *)(unsigned long)spl_image.load_addr);
 + nand_deselect();
 + return;
 + }
 + puts(U-boot header didn't match.\n);
 +#ifdef CONFIG_SYS_NAND_U_BOOT_BACKUP_OFFS
 + puts(Trying to start backup u-boot now...\n);
 + nand_spl_load_image(CONFIG_SYS_NAND_U_BOOT_BACKUP_OFFS,
 + sizeof(*header), (void *)header);
 + spl_parse_image_header(header);
 + if (header-ih_os == IH_OS_U_BOOT) {
 + nand_spl_load_image(CONFIG_SYS_NAND_U_BOOT_BACKUP_OFFS,
 + spl_image.size,
 + (void *)(unsigned long)spl_image.load_addr);
 + nand_deselect();
 + return;
 + }
 +#endif

Factor this code into a function that is called twice rather than
repeating everything.

-Scott


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


Re: [U-Boot] [PATCH v4 05/10] moveconfig: Cleanup headers in arch and board

2015-05-18 Thread Masahiro Yamada
Hi Joe,


2015-05-16 6:40 GMT+09:00 Joe Hershberger joe.hershber...@ni.com:
 Some config.h files live in arch and board directories. They will need
 to be cleaned up as well, so run the same filters there.

 Signed-off-by: Joe Hershberger joe.hershber...@ni.com

 ---

 Changes in v4:
 -New for version 4

 Changes in v3: None
 Changes in v2: None

  tools/moveconfig.py | 10 ++
  1 file changed, 10 insertions(+)

 diff --git a/tools/moveconfig.py b/tools/moveconfig.py
 index b6db058..25cee21 100755
 --- a/tools/moveconfig.py
 +++ b/tools/moveconfig.py
 @@ -352,6 +352,16 @@ def cleanup_headers(config_attrs, dry_run):
  if not fnmatch.fnmatch(filename, '*~'):
  cleanup_one_header(os.path.join(dirpath, filename), patterns,
 dry_run)
 +for (dirpath, dirnames, filenames) in os.walk('arch'):
 +for filename in filenames:
 +if not fnmatch.fnmatch(filename, '*~'):
 +cleanup_one_header(os.path.join(dirpath, filename), patterns,
 +   dry_run)
 +for (dirpath, dirnames, filenames) in os.walk('board'):
 +for filename in filenames:
 +if not fnmatch.fnmatch(filename, '*~'):
 +cleanup_one_header(os.path.join(dirpath, filename), patterns,
 +   dry_run)


To reduce code duplication, can we write like this or something?

for dir in 'include', 'arch', 'board':
for (dirpath, dirnames, filenames) in os.walk(dir):
for filename in filenames:
if not fnmatch.fnmatch(filename, '*~'):
cleanup_one_header(os.path.join(dirpath, filename),
   patterns, dry_run)



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


Re: [U-Boot] [PATCH v2 2/6] pci: Do not skip legacy IDE device configuration

2015-05-18 Thread Bin Meng
Hi Simon,

Reply this thread to the v2 patch.

On Tue, May 19, 2015 at 5:39 AM, Simon Glass s...@chromium.org wrote:
 Hi Bin,

On Sat, May 16, 2015 at 9:33 AM, Bin Meng bmeng...@gmail.com wrote:
 The legacy IDE device has a BAR4 (Bus Master Interface BAR) which
 needs to be configured.

 Signed-off-by: Bin Meng bmeng...@gmail.com

 ---

 Changes in v2:
 - Correct a typo in the commit message title

  drivers/pci/pci_auto.c | 14 --
  1 file changed, 14 deletions(-)

 I don't see how this code change relates to your commit message...


The legacy IDE controller reports PI (offset 9 in the configuration
space) as 0x80, so the codes here will skip (!(0x80  0x05)) its
configuration (ie: BAR4 won't be assigned to a valid memory window)

[snip]

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


  1   2   >