Re: [U-Boot] [PATCH 02/51] net: phy: Cleanup drivers/net/phy/micrel.c

2014-09-30 Thread Chin Liang See
On Sun, 2014-09-21 at 14:58 +0200, ma...@denx.de wrote:
> From: Pavel Machek 
> 
> Old saying says that more than three exclamation marks in a row are
> sign of mental disease. Cleanup micrel.c.
> 
> Signed-off-by: Pavel Machek 
> Signed-off-by: Marek Vasut 
> Cc: Chin Liang See 
> Cc: Dinh Nguyen 
> Cc: Albert Aribaud 
> Cc: Tom Rini 
> Cc: Wolfgang Denk 
> Cc: Pavel Machek 
> Cc: Joe Hershberger 
> ---
>  drivers/net/phy/micrel.c | 7 +++
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c
> index 5d7e3be..507b9a3 100644
> --- a/drivers/net/phy/micrel.c
> +++ b/drivers/net/phy/micrel.c
> @@ -25,8 +25,7 @@ static struct phy_driver KSZ804_driver = {
>  #ifndef CONFIG_PHY_MICREL_KSZ9021
>  /*
>   * I can't believe Micrel used the exact same part number
> - * for the KSZ9021
> - * Shame Micrel, Shame!
> + * for the KSZ9021. Shame Micrel, Shame!
>   */
>  static struct phy_driver KS8721_driver = {
>   .name = "Micrel KS8721BL",
> @@ -40,7 +39,7 @@ static struct phy_driver KS8721_driver = {
>  #endif
>  
> 
> -/**
> +/*
>   * KSZ9021 - KSZ9031 common
>   */
>  
> @@ -69,8 +68,8 @@ static int ksz90xx_startup(struct phy_device *phydev)
>   phydev->speed = SPEED_10;
>   return 0;
>  }
> -#ifdef CONFIG_PHY_MICREL_KSZ9021
>  
> +#ifdef CONFIG_PHY_MICREL_KSZ9021
>  /*
>   * KSZ9021
>   */

Acked-by: Chin Liang See 


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


Re: [U-Boot] [PATCH V2 01/51] net: Remove unused CONFIG_DW_SEARCH_PHY from configs

2014-09-30 Thread Chin Liang See
On Sun, 2014-09-21 at 14:58 +0200, ma...@denx.de wrote:
> From: Pavel Machek 
> 
> Remove this symbol from configs, since it's unused.
> 
> Signed-off-by: Pavel Machek 
> Signed-off-by: Marek Vasut 
> Cc: Chin Liang See 
> Cc: Dinh Nguyen 
> Cc: Albert Aribaud 
> Cc: Tom Rini 
> Cc: Wolfgang Denk 
> Cc: Pavel Machek 
> Cc: Joe Hershberger 
> ---
>  include/configs/axs101.h   | 1 -
>  include/configs/socfpga_cyclone5.h | 1 -
>  2 files changed, 2 deletions(-)
> 
> V2: Drop this option globally from all configs
> 
> diff --git a/include/configs/axs101.h b/include/configs/axs101.h
> index c22d6d0..1bf8390 100644
> --- a/include/configs/axs101.h
> +++ b/include/configs/axs101.h
> @@ -125,7 +125,6 @@
>   */
>  #define CONFIG_DESIGNWARE_ETH
>  #define CONFIG_DW_AUTONEG
> -#define CONFIG_DW_SEARCH_PHY
>  #define CONFIG_NET_MULTI
>  
>  /*
> diff --git a/include/configs/socfpga_cyclone5.h 
> b/include/configs/socfpga_cyclone5.h
> index 5d145cd..39e9368 100644
> --- a/include/configs/socfpga_cyclone5.h
> +++ b/include/configs/socfpga_cyclone5.h
> @@ -225,7 +225,6 @@
>  /* designware */
>  #define CONFIG_NET_MULTI
>  #define CONFIG_DW_ALTDESCRIPTOR
> -#define CONFIG_DW_SEARCH_PHY
>  #define CONFIG_MII
>  #define CONFIG_PHY_GIGE
>  #define CONFIG_DW_AUTONEG

Acked-by: Chin Liang See 

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


Re: [U-Boot] [PATCH 00/51] arm: socfpga: Usability fixes

2014-09-30 Thread Chin Liang See
On Sun, 2014-09-21 at 14:58 +0200, ma...@denx.de wrote:
> This entire series is the second stab at making SoCFPGA usable with
> mainline U-Boot again. There are much fewer bits missing than in the
> last series, more cleanup happened and bugs were fixed. This allows
> me to use mainline U-Boot on my SoCFPGA systems.
> 
> The big missing part is the SPL generation, which still needs a lot
> of additional work. We also miss the Cadence QSPI controller driver.
> 
> This set contains patches for a few subsystems, which are utilized
> by the SoCFPGA, but the most part is the SoCFPGA chip support. This
> series now contains cleanup for the mayhem in drivers/fpga/altera.c
> code, which was terrible, but is now much better.
> 

Thanks Marek, I tested this series of patches and here are the outcome I
have.

SDMMC - Working as I can read and write to SDMMC
Boot  - Working as I can boot till Linux
Ethernet - Seems not working for me.
FPGA programming - Seems not working for me too.

I will help to look into those features which are not working for me.
But this series of patches serves as a good start.

Tested-by: Chin Liang See 

Thanks
Chin Liang

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


[U-Boot] [PATCH v1 09/10] arm, at91, spl: add spl support for the taurus board

2014-09-30 Thread Heiko Schocher
replaces the at91bootstrap code with SPL code.

make the spl image with:
./tools/mkimage -T atmelimage -d spl/u-boot-spl.bin spl/boot.bin

this writes the length of the spl image into the 6th
execption vector. This is needed from the ROM bootloader.

Signed-off-by: Heiko Schocher 
Cc: Andreas Bießmann 
Cc: Bo Shen 
---
 board/siemens/taurus/taurus.c | 73 +--
 configs/taurus_defconfig  |  5 +--
 include/configs/taurus.h  | 54 +++-
 3 files changed, 119 insertions(+), 13 deletions(-)

diff --git a/board/siemens/taurus/taurus.c b/board/siemens/taurus/taurus.c
index 98ce441..abf4e7f 100644
--- a/board/siemens/taurus/taurus.c
+++ b/board/siemens/taurus/taurus.c
@@ -21,6 +21,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -30,7 +32,6 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#ifdef CONFIG_CMD_NAND
 static void taurus_nand_hw_init(void)
 {
struct at91_smc *smc = (struct at91_smc *)ATMEL_BASE_SMC;
@@ -63,15 +64,68 @@ static void taurus_nand_hw_init(void)
/* Enable NandFlash */
at91_set_gpio_output(CONFIG_SYS_NAND_ENABLE_PIN, 1);
 }
+
+#if defined(CONFIG_SPL_BUILD)
+#include 
+#include 
+
+void at91_spl_board_init(void)
+{
+   taurus_nand_hw_init();
+
+   /* Configure recovery button PINs */
+   at91_set_gpio_input(AT91_PIN_PA31, 1);
+
+   /* check if button is pressed */
+   if (at91_get_gpio_value(AT91_PIN_PA31) == 0) {
+   u32 boot_device;
+
+   debug("Recovery button pressed\n");
+   boot_device = spl_boot_device();
+   switch (boot_device) {
+#ifdef CONFIG_SPL_NAND_SUPPORT
+   case BOOT_DEVICE_NAND:
+   nand_init();
+   nand_erase_one(0, 0);
+   break;
+#endif
+   }
+   }
+}
+
+void mem_init(void)
+{
+   struct at91_matrix *ma = (struct at91_matrix *)ATMEL_BASE_MATRIX;
+   struct sdramc_reg setting;
+
+   at91_sdram_hw_init();
+   setting.cr = (AT91_SDRAMC_NC_9 |
+ AT91_SDRAMC_NR_13 |
+ AT91_SDRAMC_CAS_3 |
+ AT91_SDRAMC_NB_4 |
+ AT91_SDRAMC_DBW_32 |
+ AT91_SDRAMC_TWR_VAL(3) |
+ AT91_SDRAMC_TRC_VAL(9) |
+ AT91_SDRAMC_TRP_VAL(3) |
+ AT91_SDRAMC_TRCD_VAL(3) |
+ AT91_SDRAMC_TRAS_VAL(6) |
+ AT91_SDRAMC_TXSR_VAL(10));
+   setting.mdr = AT91_SDRAMC_MD_SDRAM;
+   setting.tr = (CONFIG_SYS_MASTER_CLOCK * 7) / 100;
+
+
+   writel(readl(&ma->ebicsa) | AT91_MATRIX_CS1A_SDRAMC |
+   AT91_MATRIX_VDDIOMSEL_3_3V | AT91_MATRIX_EBI_IOSR_SEL,
+   &ma->ebicsa);
+   sdramc_initialize(ATMEL_BASE_CS1, &setting);
+}
 #endif
 
 #ifdef CONFIG_MACB
 static void taurus_macb_hw_init(void)
 {
-   struct at91_pmc *pmc = (struct at91_pmc *)ATMEL_BASE_PMC;
-
/* Enable EMAC clock */
-   writel(1 << ATMEL_ID_EMAC0, &pmc->pcer);
+   at91_periph_clk_enable(ATMEL_ID_EMAC0);
 
/*
 * Disable pull-up on:
@@ -119,12 +173,12 @@ int board_mmc_init(bd_t *bd)
 
 int board_early_init_f(void)
 {
-   struct at91_pmc *pmc = (struct at91_pmc *)ATMEL_BASE_PMC;
-
/* Enable clocks for all PIOs */
-   writel((1 << ATMEL_ID_PIOA) | (1 << ATMEL_ID_PIOB) |
-   (1 << ATMEL_ID_PIOC),
-   &pmc->pcer);
+   at91_periph_clk_enable(ATMEL_ID_PIOA);
+   at91_periph_clk_enable(ATMEL_ID_PIOB);
+   at91_periph_clk_enable(ATMEL_ID_PIOC);
+
+   at91_seriald_hw_init();
 
return 0;
 }
@@ -153,7 +207,6 @@ int board_init(void)
/* adress of boot parameters */
gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100;
 
-   at91_seriald_hw_init();
 #ifdef CONFIG_CMD_NAND
taurus_nand_hw_init();
 #endif
diff --git a/configs/taurus_defconfig b/configs/taurus_defconfig
index 9870048..438e25d 100644
--- a/configs/taurus_defconfig
+++ b/configs/taurus_defconfig
@@ -1,3 +1,4 @@
+CONFIG_SPL=y
 CONFIG_SYS_EXTRA_OPTIONS="AT91SAM9G20,MACH_TYPE=2067,BOARD_TAURUS"
-CONFIG_ARM=y
-CONFIG_TARGET_TAURUS=y
++S:CONFIG_ARM=y
++S:CONFIG_TARGET_TAURUS=y
diff --git a/include/configs/taurus.h b/include/configs/taurus.h
index e30542d..2c33846 100644
--- a/include/configs/taurus.h
+++ b/include/configs/taurus.h
@@ -34,7 +34,7 @@
  */
 
 
-#define CONFIG_SYS_TEXT_BASE   0x23f0
+#define CONFIG_SYS_TEXT_BASE   0x2100
 
 /* ARM asynchronous clock */
 #define CONFIG_SYS_AT91_SLOW_CLOCK 32768   /* slow clock xtal */
@@ -169,4 +169,56 @@
 #define CONFIG_SYS_MALLOC_LEN \
ROUND(3 * CONFIG_ENV_SIZE + 128*1024, 0x1000)
 
+/* Defines for SPL */
+#define CONFIG_SPL_FRAMEWORK
+#define CONFIG_SPL_TEXT_BASE   0x0
+#define CONFIG_SPL_MAX_SIZE(11 * 1024)
+#define CONFIG_SPL_STACK   (16 * 

[U-Boot] [PATCH v1 04/10] spl, nand: add option to boot raw u-boot.bin image only

2014-09-30 Thread Heiko Schocher
enable to boot only a raw u-boot.bin image from nand with the
CONFIG_SPL_NAND_RAW_ONLY define. This option saves space on
boards where spl space is low.

Signed-off-by: Heiko Schocher 
Cc: Andreas Bießmann 
Cc: Bo Shen 
Cc: Scott Wood 
Cc: Josh Wu 

---

on the siemens taurus board, this option saved 0x14d bytes
---
 README|  4 
 common/spl/spl.c  | 15 ++-
 common/spl/spl_nand.c | 13 +
 include/spl.h |  1 +
 4 files changed, 28 insertions(+), 5 deletions(-)

diff --git a/README b/README
index 46def00..d5736b3 100644
--- a/README
+++ b/README
@@ -3596,6 +3596,10 @@ FIT uImage format:
Support for the MTD subsystem within SPL.  Useful for
environment on NAND support within SPL.
 
+   CONFIG_SPL_NAND_RAW_ONLY
+   Support to boot only raw u-boot.bin images. Use this only
+   if you need to save space.
+
CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT
Set for the SPL on PPC mpc8xxx targets, support for
drivers/ddr/fsl/libddr.o in SPL binary.
diff --git a/common/spl/spl.c b/common/spl/spl.c
index b16664f..97dc0f0 100644
--- a/common/spl/spl.c
+++ b/common/spl/spl.c
@@ -61,6 +61,15 @@ __weak void spl_board_prepare_for_linux(void)
/* Nothing to do! */
 }
 
+void spl_set_header_raw_uboot(void)
+{
+   spl_image.size = CONFIG_SYS_MONITOR_LEN;
+   spl_image.entry_point = CONFIG_SYS_UBOOT_START;
+   spl_image.load_addr = CONFIG_SYS_TEXT_BASE;
+   spl_image.os = IH_OS_U_BOOT;
+   spl_image.name = "U-Boot";
+}
+
 void spl_parse_image_header(const struct image_header *header)
 {
u32 header_size = sizeof(struct image_header);
@@ -93,11 +102,7 @@ void spl_parse_image_header(const struct image_header 
*header)
debug("mkimage signature not found - ih_magic = %x\n",
header->ih_magic);
/* Let's assume U-Boot will not be more than 200 KB */
-   spl_image.size = CONFIG_SYS_MONITOR_LEN;
-   spl_image.entry_point = CONFIG_SYS_UBOOT_START;
-   spl_image.load_addr = CONFIG_SYS_TEXT_BASE;
-   spl_image.os = IH_OS_U_BOOT;
-   spl_image.name = "U-Boot";
+   spl_set_header_raw_uboot();
}
 }
 
diff --git a/common/spl/spl_nand.c b/common/spl/spl_nand.c
index 9b200bc..b7801cb 100644
--- a/common/spl/spl_nand.c
+++ b/common/spl/spl_nand.c
@@ -10,6 +10,18 @@
 #include 
 #include 
 
+#if defined(CONFIG_SPL_NAND_RAW_ONLY)
+void spl_nand_load_image(void)
+{
+   nand_init();
+
+   nand_spl_load_image(CONFIG_SYS_NAND_U_BOOT_OFFS,
+   CONFIG_SYS_NAND_U_BOOT_SIZE,
+   (void *)CONFIG_SYS_NAND_U_BOOT_DST);
+   spl_set_header_raw_uboot();
+   nand_deselect();
+}
+#else
 void spl_nand_load_image(void)
 {
struct image_header *header;
@@ -82,3 +94,4 @@ void spl_nand_load_image(void)
spl_image.size, (void *)spl_image.load_addr);
nand_deselect();
 }
+#endif
diff --git a/include/spl.h b/include/spl.h
index a7e41da..6d2040d 100644
--- a/include/spl.h
+++ b/include/spl.h
@@ -35,6 +35,7 @@ extern struct spl_image_info spl_image;
 void preloader_console_init(void);
 u32 spl_boot_device(void);
 u32 spl_boot_mode(void);
+void spl_set_header_raw_uboot(void);
 void spl_parse_image_header(const struct image_header *header);
 void spl_board_prepare_for_linux(void);
 void __noreturn jump_to_image_linux(void *arg);
-- 
1.8.3.1

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


[U-Boot] [PATCH v1 00/10] arm, at91, spl: add spl support for the taurus and corvus boards

2014-09-30 Thread Heiko Schocher
This patchset add SPL support for the AT91SAM9G20 based taurus board, and
the AT91SAM9M10G45 based corvus board from siemens, and replaces the
at91bootstrap code.

The boot.bin which replaces the at91bootstrap image can created with
mkimage:

./tools/mkimage -T atmelimage -d spl/u-boot-spl.bin spl/boot.bin

For other SoC this step is done in one step ... should we add this
also for AT91 based boards?

For example add a "u-boot.at91" target in the Makefile?

This patchset is based on the common updates for the taurus
and corvus board:

Patchwork [U-Boot] arm, at91: add generic board support for the taurus and 
corvus board
http://patchwork.ozlabs.org/patch/395398/

Patchwork [U-Boot] arm, at91: add spi dataflash support for the taurus board
http://patchwork.ozlabs.org/patch/395400/

Heiko Schocher (10):
  arm, at91, mpddrc: fix typo in ddr2_init()
  arm, at91: compile mpddrc ram init code also for AT91SAM9M10G45
  arm, at91: add missing ddr2 cr register MPDDRC_CR_EBISHARE define
  spl, nand: add option to boot raw u-boot.bin image only
  mtd: atmel_nand: add missign include
  spl, nand, atmel_nand: add erase one block function
  spl, mtd, nand, atmel_nand: invert device ready pin logic
  arm, spl, at91: add at91sam9260 and at91sam9g45 spl support
  arm, at91, spl: add spl support for the taurus board
  arm, spl, at91: add spl support for the corvus board

 README |   4 +
 arch/arm/cpu/arm926ejs/at91/at91sam9260_devices.c  |  22 +++
 arch/arm/cpu/arm926ejs/at91/clock.c|  60 +++
 arch/arm/cpu/armv7/at91/clock.c|  27 +++
 arch/arm/cpu/at91-common/Makefile  |   7 +-
 arch/arm/cpu/at91-common/mpddrc.c  |  14 +-
 arch/arm/cpu/at91-common/sdram.c   |  77 +
 arch/arm/cpu/at91-common/spl.c | 185 +++--
 arch/arm/include/asm/arch-at91/at91_common.h   |   4 +
 arch/arm/include/asm/arch-at91/at91_pmc.h  |   5 +-
 arch/arm/include/asm/arch-at91/at91sam9260.h   |   1 +
 .../arm/include/asm/arch-at91/at91sam9260_matrix.h |   5 +
 arch/arm/include/asm/arch-at91/at91sam9_sdramc.h   |  22 ++-
 arch/arm/include/asm/arch-at91/atmel_mpddrc.h  |   1 +
 board/siemens/corvus/board.c   | 109 ++--
 board/siemens/taurus/taurus.c  |  73 ++--
 common/spl/spl.c   |  15 +-
 common/spl/spl_nand.c  |  13 ++
 configs/corvus_defconfig   |   5 +-
 configs/taurus_defconfig   |   5 +-
 drivers/mtd/nand/atmel_nand.c  |  40 -
 include/configs/corvus.h   |  54 +-
 include/configs/taurus.h   |  54 +-
 include/linux/mtd/nand.h   |   1 +
 include/spl.h  |   1 +
 25 files changed, 712 insertions(+), 92 deletions(-)
 create mode 100644 arch/arm/cpu/at91-common/sdram.c

Cc: Andreas Bießmann 
Cc: Bo Shen 
-- 
1.8.3.1

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


[U-Boot] [PATCH v1 10/10] arm, spl, at91: add spl support for the corvus board

2014-09-30 Thread Heiko Schocher
replaces the at91bootstrap code with SPL code.
make the spl image with:
./tools/mkimage -T atmelimage -d spl/u-boot-spl.bin spl/boot.bin

this writes the length of the spl image into the 6th
execption vector. This is needed from the ROM bootloader.

Signed-off-by: Heiko Schocher 
Cc: Andreas Bießmann 
Cc: Bo Shen 
---
 board/siemens/corvus/board.c | 109 ++-
 configs/corvus_defconfig |   5 +-
 include/configs/corvus.h |  54 +++--
 3 files changed, 150 insertions(+), 18 deletions(-)

diff --git a/board/siemens/corvus/board.c b/board/siemens/corvus/board.c
index f1e93ef..b78e795 100644
--- a/board/siemens/corvus/board.c
+++ b/board/siemens/corvus/board.c
@@ -31,12 +31,10 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#ifdef CONFIG_CMD_NAND
 static void corvus_nand_hw_init(void)
 {
struct at91_smc *smc = (struct at91_smc *)ATMEL_BASE_SMC;
struct at91_matrix *matrix = (struct at91_matrix *)ATMEL_BASE_MATRIX;
-   struct at91_pmc *pmc = (struct at91_pmc *)ATMEL_BASE_PMC;
unsigned long csa;
 
/* Enable CS3 */
@@ -63,22 +61,111 @@ static void corvus_nand_hw_init(void)
   AT91_SMC_MODE_TDF_CYCLE(3),
   &smc->cs[3].mode);
 
-   writel(1 << ATMEL_ID_PIOC, &pmc->pcer);
-
-   /* Configure RDY/BSY */
-   at91_set_gpio_input(CONFIG_SYS_NAND_READY_PIN, 1);
+   at91_periph_clk_enable(ATMEL_ID_PIOC);
 
/* Enable NandFlash */
at91_set_gpio_output(CONFIG_SYS_NAND_ENABLE_PIN, 1);
 }
+
+#if defined(CONFIG_SPL_BUILD)
+#include 
+#include 
+
+void at91_spl_board_init(void)
+{
+   /*
+* For on the sam9m10g45ek board, the chip wm9711 stay in the test
+* mode, so it need do some action to exit mode.
+*/
+   at91_set_gpio_output(AT91_PIN_PD7, 0);
+   at91_set_gpio_output(AT91_PIN_PD8, 0);
+   at91_set_pio_pullup(AT91_PIO_PORTD, 7, 1);
+   at91_set_pio_pullup(AT91_PIO_PORTD, 8, 1);
+   at91_set_pio_pullup(AT91_PIO_PORTA, 12, 1);
+   at91_set_pio_pullup(AT91_PIO_PORTA, 13, 1);
+   at91_set_pio_pullup(AT91_PIO_PORTA, 15, 1);
+
+   corvus_nand_hw_init();
+
+   /* Configure recovery button PINs */
+   at91_set_gpio_input(AT91_PIN_PB7, 1);
+
+   /* check if button is pressed */
+   if (at91_get_gpio_value(AT91_PIN_PB7) == 0) {
+   u32 boot_device;
+
+   debug("Recovery button pressed\n");
+   boot_device = spl_boot_device();
+   switch (boot_device) {
+#ifdef CONFIG_SPL_NAND_SUPPORT
+   case BOOT_DEVICE_NAND:
+   nand_init();
+   nand_erase_one(0, 0);
+   break;
 #endif
+   }
+   }
+}
 
-#ifdef CONFIG_CMD_USB
-static void taurus_usb_hw_init(void)
+#include 
+static void ddr2_conf(struct atmel_mpddr *ddr2)
+{
+   ddr2->md = (ATMEL_MPDDRC_MD_DBW_16_BITS | ATMEL_MPDDRC_MD_DDR2_SDRAM);
+
+   ddr2->cr = (ATMEL_MPDDRC_CR_NC_COL_10 |
+   ATMEL_MPDDRC_CR_NR_ROW_14 |
+   ATMEL_MPDDRC_CR_DIC_DS |
+   ATMEL_MPDDRC_CR_EBISHARE |
+   ATMEL_MPDDRC_CR_CAS_DDR_CAS3);
+   ddr2->rtr = 0x24b;
+
+   ddr2->tpr0 = (6 << ATMEL_MPDDRC_TPR0_TRAS_OFFSET |/* 6*7.5 = 45 ns */
+ 2 << ATMEL_MPDDRC_TPR0_TRCD_OFFSET |/* 2*7.5 = 15 ns */
+ 2 << ATMEL_MPDDRC_TPR0_TWR_OFFSET | /* 2*7.5 = 15 ns */
+ 8 << ATMEL_MPDDRC_TPR0_TRC_OFFSET | /* 8*7.5 = 75 ns */
+ 2 << ATMEL_MPDDRC_TPR0_TRP_OFFSET | /* 2*7.5 = 15 ns */
+ 1 << ATMEL_MPDDRC_TPR0_TRRD_OFFSET | /* 1*7.5= 7.5 ns*/
+ 1 << ATMEL_MPDDRC_TPR0_TWTR_OFFSET | /* 1 clk cycle */
+ 2 << ATMEL_MPDDRC_TPR0_TMRD_OFFSET); /* 2 clk cycles */
+
+   ddr2->tpr1 = (2 << ATMEL_MPDDRC_TPR1_TXP_OFFSET | /* 2*7.5 = 15 ns */
+ 200 << ATMEL_MPDDRC_TPR1_TXSRD_OFFSET |
+ 16 << ATMEL_MPDDRC_TPR1_TXSNR_OFFSET |
+ 14 << ATMEL_MPDDRC_TPR1_TRFC_OFFSET);
+
+   ddr2->tpr2 = (1 << ATMEL_MPDDRC_TPR2_TRTP_OFFSET |
+ 0 << ATMEL_MPDDRC_TPR2_TRPA_OFFSET |
+ 7 << ATMEL_MPDDRC_TPR2_TXARDS_OFFSET |
+ 2 << ATMEL_MPDDRC_TPR2_TXARD_OFFSET);
+}
+
+void mem_init(void)
 {
struct at91_pmc *pmc = (struct at91_pmc *)ATMEL_BASE_PMC;
+   struct at91_matrix *mat = (struct at91_matrix *)ATMEL_BASE_MATRIX;
+   struct atmel_mpddr ddr2;
+   unsigned long csa;
+
+   ddr2_conf(&ddr2);
 
-   writel(1 << ATMEL_ID_PIODE, &pmc->pcer);
+   /* enable DDR2 clock */
+   writel(0x4, &pmc->scer);
+
+   /* Chip select 1 is for DDR2/SDRAM */
+   csa = readl(&mat->ebicsa);
+   csa |= AT91_MATRIX_EBI_CS1A_SDRAMC;
+   csa &= ~AT91_MATRIX_EBI_VDDIOMSEL_3_3V;
+   writel(csa, &mat->ebicsa);
+
+   /* DDRAM2 Controller initialize */
+   ddr2_init(AT

[U-Boot] [PATCH v1 07/10] spl, mtd, nand, atmel_nand: invert device ready pin logic

2014-09-30 Thread Heiko Schocher
device ready pin is signalling that the device is ready on state 1
not on 0. Simmiliar as it is in drivers/mtd/nand/nand_spl_simple.c

Signed-off-by: Heiko Schocher 
Cc: Andreas Bießmann 
Cc: Bo Shen 
Cc: Scott Wood 
Cc: Josh Wu 
---
 drivers/mtd/nand/atmel_nand.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/mtd/nand/atmel_nand.c b/drivers/mtd/nand/atmel_nand.c
index 276d820..4f04ed8 100644
--- a/drivers/mtd/nand/atmel_nand.c
+++ b/drivers/mtd/nand/atmel_nand.c
@@ -1188,7 +1188,7 @@ static int nand_command(int block, int page, uint32_t 
offs, u8 cmd)
void (*hwctrl)(struct mtd_info *mtd, int cmd,
unsigned int ctrl) = this->cmd_ctrl;
 
-   while (this->dev_ready(&mtd))
+   while (!this->dev_ready(&mtd))
;
 
if (cmd == NAND_CMD_READOOB) {
@@ -1213,7 +1213,7 @@ static int nand_command(int block, int page, uint32_t 
offs, u8 cmd)
hwctrl(&mtd, NAND_CMD_READSTART, NAND_CTRL_CLE | NAND_CTRL_CHANGE);
hwctrl(&mtd, NAND_CMD_NONE, NAND_NCE | NAND_CTRL_CHANGE);
 
-   while (this->dev_ready(&mtd))
+   while (!this->dev_ready(&mtd))
;
 
return 0;
@@ -1353,7 +1353,7 @@ int at91_nand_wait_ready(struct mtd_info *mtd)
 
udelay(this->chip_delay);
 
-   return 0;
+   return 1;
 }
 
 int board_nand_init(struct nand_chip *nand)
-- 
1.8.3.1

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


[U-Boot] [PATCH v1 03/10] arm, at91: add missing ddr2 cr register MPDDRC_CR_EBISHARE define

2014-09-30 Thread Heiko Schocher
Signed-off-by: Heiko Schocher 
Cc: Andreas Bießmann 
Cc: Bo Shen 
---
 arch/arm/include/asm/arch-at91/atmel_mpddrc.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/include/asm/arch-at91/atmel_mpddrc.h 
b/arch/arm/include/asm/arch-at91/atmel_mpddrc.h
index 5741f6e..bd403d2 100644
--- a/arch/arm/include/asm/arch-at91/atmel_mpddrc.h
+++ b/arch/arm/include/asm/arch-at91/atmel_mpddrc.h
@@ -57,6 +57,7 @@ int ddr2_init(const unsigned int ram_address,
 #define ATMEL_MPDDRC_CR_DIC_DS (0x1 << 8)
 #define ATMEL_MPDDRC_CR_DIS_DLL(0x1 << 9)
 #define ATMEL_MPDDRC_CR_OCD_DEFAULT(0x7 << 12)
+#define ATMEL_MPDDRC_CR_EBISHARE   (0x1 << 16)
 #define ATMEL_MPDDRC_CR_ENRDM_ON   (0x1 << 17)
 #define ATMEL_MPDDRC_CR_NB_8BANKS  (0x1 << 20)
 #define ATMEL_MPDDRC_CR_NDQS_DISABLED  (0x1 << 21)
-- 
1.8.3.1

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


[U-Boot] [PATCH v1 08/10] arm, spl, at91: add at91sam9260 and at91sam9g45 spl support

2014-09-30 Thread Heiko Schocher
add support for using spl code on at91sam9260 and at91sam9g45
based boards.

Signed-off-by: Heiko Schocher 
Cc: Andreas Bießmann 
Cc: Bo Shen 
---
 arch/arm/cpu/arm926ejs/at91/at91sam9260_devices.c  |  22 +++
 arch/arm/cpu/arm926ejs/at91/clock.c|  60 +++
 arch/arm/cpu/armv7/at91/clock.c|  27 +++
 arch/arm/cpu/at91-common/Makefile  |   1 +
 arch/arm/cpu/at91-common/sdram.c   |  77 +
 arch/arm/cpu/at91-common/spl.c | 185 +++--
 arch/arm/include/asm/arch-at91/at91_common.h   |   4 +
 arch/arm/include/asm/arch-at91/at91_pmc.h  |   5 +-
 arch/arm/include/asm/arch-at91/at91sam9260.h   |   1 +
 .../arm/include/asm/arch-at91/at91sam9260_matrix.h |   5 +
 arch/arm/include/asm/arch-at91/at91sam9_sdramc.h   |  22 ++-
 11 files changed, 359 insertions(+), 50 deletions(-)
 create mode 100644 arch/arm/cpu/at91-common/sdram.c

diff --git a/arch/arm/cpu/arm926ejs/at91/at91sam9260_devices.c 
b/arch/arm/cpu/arm926ejs/at91/at91sam9260_devices.c
index cae4abc..7a7fd7d 100644
--- a/arch/arm/cpu/arm926ejs/at91/at91sam9260_devices.c
+++ b/arch/arm/cpu/arm926ejs/at91/at91sam9260_devices.c
@@ -8,8 +8,10 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
+#include 
 #include 
 
 /*
@@ -207,3 +209,23 @@ void at91_mci_hw_init(void)
 #endif
 }
 #endif
+
+void at91_sdram_hw_init(void)
+{
+   at91_set_a_periph(AT91_PIO_PORTC, 16, 0);
+   at91_set_a_periph(AT91_PIO_PORTC, 17, 0);
+   at91_set_a_periph(AT91_PIO_PORTC, 18, 0);
+   at91_set_a_periph(AT91_PIO_PORTC, 19, 0);
+   at91_set_a_periph(AT91_PIO_PORTC, 20, 0);
+   at91_set_a_periph(AT91_PIO_PORTC, 21, 0);
+   at91_set_a_periph(AT91_PIO_PORTC, 22, 0);
+   at91_set_a_periph(AT91_PIO_PORTC, 23, 0);
+   at91_set_a_periph(AT91_PIO_PORTC, 24, 0);
+   at91_set_a_periph(AT91_PIO_PORTC, 25, 0);
+   at91_set_a_periph(AT91_PIO_PORTC, 26, 0);
+   at91_set_a_periph(AT91_PIO_PORTC, 27, 0);
+   at91_set_a_periph(AT91_PIO_PORTC, 28, 0);
+   at91_set_a_periph(AT91_PIO_PORTC, 29, 0);
+   at91_set_a_periph(AT91_PIO_PORTC, 30, 0);
+   at91_set_a_periph(AT91_PIO_PORTC, 31, 0);
+}
diff --git a/arch/arm/cpu/arm926ejs/at91/clock.c 
b/arch/arm/cpu/arm926ejs/at91/clock.c
index 31315b5..f363982 100644
--- a/arch/arm/cpu/arm926ejs/at91/clock.c
+++ b/arch/arm/cpu/arm926ejs/at91/clock.c
@@ -187,3 +187,63 @@ int at91_clock_init(unsigned long main_clock)
 
return 0;
 }
+
+#if !defined(AT91_PLL_LOCK_TIMEOUT)
+#define AT91_PLL_LOCK_TIMEOUT  100
+#endif
+
+void at91_plla_init(u32 pllar)
+{
+   struct at91_pmc *pmc = (struct at91_pmc *)ATMEL_BASE_PMC;
+   int timeout = AT91_PLL_LOCK_TIMEOUT;
+
+   writel(pllar, &pmc->pllar);
+   while (!(readl(&pmc->sr) & (AT91_PMC_LOCKA | AT91_PMC_MCKRDY))) {
+   timeout--;
+   if (timeout == 0)
+   break;
+   }
+}
+void at91_pllb_init(u32 pllbr)
+{
+   struct at91_pmc *pmc = (struct at91_pmc *)ATMEL_BASE_PMC;
+   int timeout = AT91_PLL_LOCK_TIMEOUT;
+
+   writel(pllbr, &pmc->pllbr);
+   while (!(readl(&pmc->sr) & (AT91_PMC_LOCKB | AT91_PMC_MCKRDY))) {
+   timeout--;
+   if (timeout == 0)
+   break;
+   }
+}
+
+void at91_mck_init(u32 mckr)
+{
+   struct at91_pmc *pmc = (struct at91_pmc *)ATMEL_BASE_PMC;
+   int timeout = AT91_PLL_LOCK_TIMEOUT;
+   u32 tmp;
+
+   tmp = readl(&pmc->mckr);
+   tmp &= ~(AT91_PMC_MCKR_PRES_MASK |
+AT91_PMC_MCKR_MDIV_MASK |
+AT91_PMC_MCKR_PLLADIV_MASK |
+AT91_PMC_MCKR_CSS_MASK);
+   tmp |= mckr & (AT91_PMC_MCKR_PRES_MASK |
+  AT91_PMC_MCKR_MDIV_MASK |
+  AT91_PMC_MCKR_PLLADIV_MASK |
+  AT91_PMC_MCKR_CSS_MASK);
+   writel(tmp, &pmc->mckr);
+
+   while (!(readl(&pmc->sr) & AT91_PMC_MCKRDY)) {
+   timeout--;
+   if (timeout == 0)
+   break;
+   }
+}
+
+void at91_periph_clk_enable(int id)
+{
+   struct at91_pmc *pmc = (struct at91_pmc *)ATMEL_BASE_PMC;
+
+   writel(1 << id, &pmc->pcer);
+}
diff --git a/arch/arm/cpu/armv7/at91/clock.c b/arch/arm/cpu/armv7/at91/clock.c
index 36ed4a6..363081a 100644
--- a/arch/arm/cpu/armv7/at91/clock.c
+++ b/arch/arm/cpu/armv7/at91/clock.c
@@ -111,6 +111,33 @@ int at91_clock_init(unsigned long main_clock)
return 0;
 }
 
+void at91_plla_init(u32 pllar)
+{
+   struct at91_pmc *pmc = (struct at91_pmc *)ATMEL_BASE_PMC;
+
+   writel(pllar, &pmc->pllar);
+   while (!(readl(&pmc->sr) & (AT91_PMC_LOCKA | AT91_PMC_MCKRDY)))
+   ;
+}
+
+void at91_mck_init(u32 mckr)
+{
+   struct at91_pmc *pmc = (struct at91_pmc *)ATMEL_BASE_PMC;
+   u32 tmp;
+
+   tmp = readl(&pmc->mckr);
+   tmp &= ~(AT91_PMC_MCKR_PRES_MASK |
+AT91_PMC_MCKR_MDIV_MASK |
+   

[U-Boot] [PATCH v1 06/10] spl, nand, atmel_nand: add erase one block function

2014-09-30 Thread Heiko Schocher
erase one nand block in spl code. keep it simple, as size matters
This is used on the upcoming taurus spl support.

Signed-off-by: Heiko Schocher 
Cc: Andreas Bießmann 
Cc: Bo Shen 
Cc: Scott Wood 
Cc: Josh Wu 
---
 drivers/mtd/nand/atmel_nand.c | 33 +
 include/linux/mtd/nand.h  |  1 +
 2 files changed, 34 insertions(+)

diff --git a/drivers/mtd/nand/atmel_nand.c b/drivers/mtd/nand/atmel_nand.c
index d506e42..276d820 100644
--- a/drivers/mtd/nand/atmel_nand.c
+++ b/drivers/mtd/nand/atmel_nand.c
@@ -1274,6 +1274,39 @@ static int nand_read_page(int block, int page, void *dst)
 
return 0;
 }
+
+int nand_erase_one(int block, int page)
+{
+   struct nand_chip *this = mtd.priv;
+   void (*hwctrl)(struct mtd_info *mtd, int cmd,
+   unsigned int ctrl) = this->cmd_ctrl;
+   int page_addr;
+
+   if (nand_chip.select_chip)
+   nand_chip.select_chip(&mtd, 0);
+
+   page_addr = page + block * CONFIG_SYS_NAND_PAGE_COUNT;
+   hwctrl(&mtd, NAND_CMD_ERASE1, NAND_CTRL_CLE | NAND_CTRL_CHANGE);
+   /* Row address */
+   hwctrl(&mtd, (page_addr & 0xff), NAND_CTRL_ALE | NAND_CTRL_CHANGE);
+   hwctrl(&mtd, ((page_addr >> 8) & 0xff),
+  NAND_CTRL_ALE | NAND_CTRL_CHANGE);
+#ifdef CONFIG_SYS_NAND_5_ADDR_CYCLE
+   /* One more address cycle for devices > 128MiB */
+   hwctrl(&mtd, (page_addr >> 16) & 0x0f,
+  NAND_CTRL_ALE | NAND_CTRL_CHANGE);
+#endif
+
+   hwctrl(&mtd, NAND_CMD_ERASE2, NAND_CTRL_CLE | NAND_CTRL_CHANGE);
+   udelay(2000);
+
+   while (!this->dev_ready(&mtd))
+   ;
+
+   nand_deselect();
+
+   return 0;
+}
 #else
 static int nand_read_page(int block, int page, void *dst)
 {
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index 8438490..ee2c3fe 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -1020,5 +1020,6 @@ void nand_write_buf16(struct mtd_info *mtd, const uint8_t 
*buf, int len);
 void nand_read_buf(struct mtd_info *mtd, uint8_t *buf, int len);
 void nand_read_buf16(struct mtd_info *mtd, uint8_t *buf, int len);
 uint8_t nand_read_byte(struct mtd_info *mtd);
+int nand_erase_one(int block, int page);
 #endif
 #endif /* __LINUX_MTD_NAND_H */
-- 
1.8.3.1

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


[U-Boot] [PATCH v1 01/10] arm, at91, mpddrc: fix typo in ddr2_init()

2014-09-30 Thread Heiko Schocher
use the configure value for computing the ba_off value
not the value from the cr register. This leaded in a
wrong ram configuration on the upcoming corvus spl board
support.

Signed-off-by: Heiko Schocher 
Cc: Andreas Bießmann 
Cc: Bo Shen 
---
 arch/arm/cpu/at91-common/mpddrc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/arm/cpu/at91-common/mpddrc.c 
b/arch/arm/cpu/at91-common/mpddrc.c
index 8136396..76668d2 100644
--- a/arch/arm/cpu/at91-common/mpddrc.c
+++ b/arch/arm/cpu/at91-common/mpddrc.c
@@ -26,7 +26,8 @@ int ddr2_init(const unsigned int ram_address,
/* Compute bank offset according to NC in configuration register */
ba_off = (mpddr_value->cr & ATMEL_MPDDRC_CR_NC_MASK) + 9;
if (!(mpddr_value->cr & ATMEL_MPDDRC_CR_DECOD_INTERLEAVED))
-   ba_off += ((mpddr->cr & ATMEL_MPDDRC_CR_NR_MASK) >> 2) + 11;
+   ba_off += ((mpddr_value->cr & ATMEL_MPDDRC_CR_NR_MASK) >> 2)
+  + 11;
 
ba_off += (mpddr_value->md & ATMEL_MPDDRC_MD_DBW_MASK) ? 1 : 2;
 
-- 
1.8.3.1

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


[U-Boot] [PATCH v1 05/10] mtd: atmel_nand: add missign include

2014-09-30 Thread Heiko Schocher
using this driver in SPL code with CONFIG_SPL_NAND_ECC
configured leads in a compileerror. Fix this.

Signed-off-by: Heiko Schocher 
Cc: Andreas Bießmann 
Cc: Bo Shen 
Cc: Scott Wood 
Cc: Josh Wu 

---
 drivers/mtd/nand/atmel_nand.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/mtd/nand/atmel_nand.c b/drivers/mtd/nand/atmel_nand.c
index 9114a86..d506e42 100644
--- a/drivers/mtd/nand/atmel_nand.c
+++ b/drivers/mtd/nand/atmel_nand.c
@@ -18,6 +18,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #ifdef CONFIG_ATMEL_NAND_HWECC
 
-- 
1.8.3.1

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


[U-Boot] [PATCH v1 02/10] arm, at91: compile mpddrc ram init code also for AT91SAM9M10G45

2014-09-30 Thread Heiko Schocher
- compile mpddrc ram init code also for AT91SAM9M10G45
  based boards.
- in CONFIG_SAMA5D3 case, look for the ATMEL_MPDDRC_CR_DECOD_INTERLEAVED
  in the cr configuration

Signed-off-by: Heiko Schocher 
Cc: Andreas Bießmann 
Cc: Bo Shen 
---
 arch/arm/cpu/at91-common/Makefile |  6 +-
 arch/arm/cpu/at91-common/mpddrc.c | 11 ++-
 2 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/arch/arm/cpu/at91-common/Makefile 
b/arch/arm/cpu/at91-common/Makefile
index 5b97838..f62863a 100644
--- a/arch/arm/cpu/at91-common/Makefile
+++ b/arch/arm/cpu/at91-common/Makefile
@@ -9,4 +9,8 @@
 #
 
 obj-$(CONFIG_AT91_WANTS_COMMON_PHY) += phy.o
-obj-$(CONFIG_SPL_BUILD) += mpddrc.o spl.o
+ifneq ($(CONFIG_SPL_BUILD),)
+obj-$(CONFIG_AT91SAM9M10G45) += mpddrc.o
+obj-$(CONFIG_SAMA5D3) += mpddrc.o
+obj-y += spl.o
+endif
diff --git a/arch/arm/cpu/at91-common/mpddrc.c 
b/arch/arm/cpu/at91-common/mpddrc.c
index 76668d2..602e71e 100644
--- a/arch/arm/cpu/at91-common/mpddrc.c
+++ b/arch/arm/cpu/at91-common/mpddrc.c
@@ -17,6 +17,15 @@ static inline void atmel_mpddr_op(int mode, u32 ram_address)
writel(0, ram_address);
 }
 
+static int ddr2_decodtype_is_seq(u32 cr)
+{
+#if defined(CONFIG_SAMA5D3)
+   if (cr & ATMEL_MPDDRC_CR_DECOD_INTERLEAVED)
+   return 0;
+#endif
+   return 1;
+}
+
 int ddr2_init(const unsigned int ram_address,
  const struct atmel_mpddr *mpddr_value)
 {
@@ -25,7 +34,7 @@ int ddr2_init(const unsigned int ram_address,
 
/* Compute bank offset according to NC in configuration register */
ba_off = (mpddr_value->cr & ATMEL_MPDDRC_CR_NC_MASK) + 9;
-   if (!(mpddr_value->cr & ATMEL_MPDDRC_CR_DECOD_INTERLEAVED))
+   if (ddr2_decodtype_is_seq(mpddr_value->cr))
ba_off += ((mpddr_value->cr & ATMEL_MPDDRC_CR_NR_MASK) >> 2)
   + 11;
 
-- 
1.8.3.1

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


[U-Boot] [PATCH] arm, at91: add spi dataflash support for the taurus board

2014-09-30 Thread Heiko Schocher
Signed-off-by: Heiko Schocher 
Cc: Andreas Bießmann 
Cc: Bo Shen 
---
 board/siemens/taurus/taurus.c | 22 ++
 include/configs/taurus.h  | 11 +++
 2 files changed, 33 insertions(+)

diff --git a/board/siemens/taurus/taurus.c b/board/siemens/taurus/taurus.c
index 673b302..98ce441 100644
--- a/board/siemens/taurus/taurus.c
+++ b/board/siemens/taurus/taurus.c
@@ -22,6 +22,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 
 #include 
 #include 
@@ -127,6 +129,25 @@ int board_early_init_f(void)
return 0;
 }
 
+int spi_cs_is_valid(unsigned int bus, unsigned int cs)
+{
+   return bus == 0 && cs == 0;
+}
+
+void spi_cs_activate(struct spi_slave *slave)
+{
+   at91_set_gpio_value(TAURUS_SPI_CS_PIN, 0);
+}
+
+void spi_cs_deactivate(struct spi_slave *slave)
+{
+   at91_set_gpio_value(TAURUS_SPI_CS_PIN, 1);
+}
+
+void spi_init_f(void)
+{
+   /* everything done in board_init */
+}
 int board_init(void)
 {
/* adress of boot parameters */
@@ -139,6 +160,7 @@ int board_init(void)
 #ifdef CONFIG_MACB
taurus_macb_hw_init();
 #endif
+   at91_spi0_hw_init(TAURUS_SPI_MASK);
 
return 0;
 }
diff --git a/include/configs/taurus.h b/include/configs/taurus.h
index aadf4cd..e30542d 100644
--- a/include/configs/taurus.h
+++ b/include/configs/taurus.h
@@ -127,6 +127,17 @@
 #define CONFIG_USB_STORAGE
 #endif
 
+/* SPI EEPROM */
+#define CONFIG_SPI
+#define CONFIG_CMD_SPI
+#define CONFIG_CMD_SF
+#define CONFIG_SPI_FLASH
+#define CONFIG_ATMEL_SPI
+#define CONFIG_SPI_FLASH_STMICRO
+#define CONFIG_SYS_SPI_WRITE_TOUT  (5 * CONFIG_SYS_HZ)
+#define TAURUS_SPI_MASK (1 << 4)
+#define TAURUS_SPI_CS_PIN  AT91_PIN_PA3
+
 /* load address */
 #define CONFIG_SYS_LOAD_ADDR   0x2200
 
-- 
1.8.3.1

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


[U-Boot] [PATCH] arm, at91: add generic board support for the taurus and corvus board

2014-09-30 Thread Heiko Schocher
Signed-off-by: Heiko Schocher 
Cc: Andreas Bießmann 
Cc: Bo Shen 
---
 include/configs/corvus.h | 2 ++
 include/configs/taurus.h | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/include/configs/corvus.h b/include/configs/corvus.h
index 6171060..eb1584d 100644
--- a/include/configs/corvus.h
+++ b/include/configs/corvus.h
@@ -18,6 +18,8 @@
 
 #define MACH_TYPE_CORVUS   2066
 
+#define CONFIG_SYS_GENERIC_BOARD
+
 /*
  * Warning: changing CONFIG_SYS_TEXT_BASE requires
  * adapting the initial boot program.
diff --git a/include/configs/taurus.h b/include/configs/taurus.h
index 20d4cee..aadf4cd 100644
--- a/include/configs/taurus.h
+++ b/include/configs/taurus.h
@@ -24,6 +24,8 @@
 #define MACH_TYPE_TAURUS   2067
 #define MACH_TYPE_AXM  2068
 
+#define CONFIG_SYS_GENERIC_BOARD
+
 /*
  * Warning: changing CONFIG_SYS_TEXT_BASE requires
  * adapting the initial boot program.
-- 
1.8.3.1

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


[U-Boot] Commit 294b91a5817147d4b7f47be2ac69bac2a1f26491 broke mpc85xx

2014-09-30 Thread York Sun
Simon,

I didn't notice until today the commit
294b91a5817147d4b7f47be2ac69bac2a1f26491 broke at least T4240QDS. I have
narrowed down to these two lines in common/board_r.c

initr_barrier,
initr_malloc,

If I move these two lines below this part


#if defined(CONFIG_SYS_INIT_RAM_LOCK) && defined(CONFIG_E500)
initr_unlock_ram_in_cache,
#endif


U-boot boots OK on T4240QDS (I can see the prompt). But if I move them
anywhere above this initr_unlock_ram_in_cache, it hangs the core when
initializing PCI. It may break other mpc85xx platforms but I didn't have
time to check more today. I haven't figured out why you have to move these
two lines up. Please take a close look.

Thanks,

York

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


Re: [U-Boot] [PATCH] patman: Check commit_match before stripping leading whitespace

2014-09-30 Thread Simon Glass
Hi Scott,

On 29 September 2014 10:22, Scott Wood  wrote:
> On Sun, 2014-09-28 at 12:04 -0600, Simon Glass wrote:
>> Hi Scott,
>>
>> On 25 September 2014 13:30, Scott Wood  wrote:
>> > True commit lines start at column zero.  Anything that is indented
>> > is part of the commit message instead.  I noticed this by trying to
>> > run buildman with commit e3a4facdfc07179ebe017a07b8de6224a935a9f3
>> > as master, which contained a reference to a Linux commit inside
>> > the commit message.  ProcessLine saw that as a genuite commit
>> > line, and thus buildman tried to build it, and died with an
>> > exception because that SHA is not present in the U-Boot tree.
>> >
>> > Signed-off-by: Scott Wood 
>> > ---
>> >  tools/patman/patchstream.py | 4 +++-
>> >  1 file changed, 3 insertions(+), 1 deletion(-)
>> >
>> > diff --git a/tools/patman/patchstream.py b/tools/patman/patchstream.py
>> > index d630157..68e98b9 100644
>> > --- a/tools/patman/patchstream.py
>> > +++ b/tools/patman/patchstream.py
>> > @@ -139,6 +139,9 @@ class PatchStream:
>> >  # Initially we have no output. Prepare the input line string
>> >  out = []
>> >  line = line.rstrip('\n')
>> > +
>> > +commit_match = re_commit.match(line) if self.is_log else None
>> > +
>> >  if self.is_log:
>> >  if line[:4] == '':
>> >  line = line[4:]
>> > @@ -146,7 +149,6 @@ class PatchStream:
>> >  # Handle state transition and skipping blank lines
>> >  series_tag_match = re_series_tag.match(line)
>> >  commit_tag_match = re_commit_tag.match(line)
>> > -commit_match = re_commit.match(line) if self.is_log else None
>> >  cover_cc_match = re_cover_cc.match(line)
>> >  signoff_match = re_signoff.match(line)
>> >  tag_match = None
>> > --
>> > 1.9.1
>> >
>>
>> Thanks for finding this bug.
>>
>> This could use a test in tools/patman/test.py
>>
>> The problem is that you are breaking the patch-processing part of this
>> code. It operates in two modes - see the comment at the top of
>> ProcessLine(). With your change it will not process patches correctly,
>> e.g. to add Commit-notes: to the patch.
>
> How would this patch would make any difference in the "self.is_log ==
> False" case?  The whitespace removal that this patch reorders around
> won't be executed, and commit_match will be None regardless.

You are changing it so that commit_match will always be None for patches.

This means that the commit message in a patch will never be found, so
the state machine that tracks where it is in the patch will not
function.

Try adding something like:

Commit-notes:
this is a note
more stuff
END

to a commit and then run patman. You will see that the commit notes
are not parsed.

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


Re: [U-Boot] [PATCH v3 26/29] dm: tegra: spi: Convert to driver model

2014-09-30 Thread Simon Glass
Hi Igor,

On 29 September 2014 16:59, Igor Grinberg  wrote:
> Hi Simon,
>
> On 09/29/14 22:35, Simon Glass wrote:
>
>> diff --git a/board/compulab/common/eeprom.c b/board/compulab/common/eeprom.c
>> index 85442cd..ba3a5bf 100644
>> --- a/board/compulab/common/eeprom.c
>> +++ b/board/compulab/common/eeprom.c
>> @@ -33,7 +33,7 @@ static int cl_eeprom_read(uint offset, uchar *buf, int len)
>>  {
>>   int res;
>>   unsigned int current_i2c_bus = i2c_get_bus_num();
>> -
>> +#define CONFIG_SYS_I2C_EEPROM_BUS 1
>>   res = i2c_set_bus_num(CONFIG_SYS_I2C_EEPROM_BUS);
>>   if (res < 0)
>>   return res;
>
> The above hunk is not related to this patch. Please, remove.
> A temporary fix for trimslice if needed can be found here [1].

Thanks - yes this is a bit of a mess but I'll wait to sort it out
until the fix is in mainline. It's never easy adding patches to a
broken tree - I tried to bring it something and ended up merging it
into one of the patches by the look of it.

>
> Albert, patchwork says it is delegated to you.
> Are you going to apply it some time soon?
>
> [1] https://patchwork.ozlabs.org/patch/390381/
>
> --
> Regards,
> Igor.

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


Re: [U-Boot] [PATCH 0/4] dm: rpi: Move Raspberry Pi to use driver model

2014-09-30 Thread Simon Glass
Hi Stephen,

On 30 September 2014 19:41, Stephen Warren  wrote:
> On 09/22/2014 05:30 PM, Simon Glass wrote:
>> This series adds driver model support to the GPIO and serial drivers used
>> by Raspberry Pi, and moves Raspberry Pi over to driver model.
>>
>> This requires adding driver model support to the pl01x serial driver, and
>> replacing the bcm2835 GPIO driver with a driver model version (since there
>> are no longer clients that don't use driver model).
>>
>> See u-boot-dm.git branch rpi-working for the tree this is based on.
>
> The series,
> Tested-by: Stephen Warren 
>
> It threw me for a while that this series changes the command-line syntax
> from:
>
> gpio input 18
>
> to:
>
> gpio input GPIO18
>
> Hopefully that won't annoy anyone who has scripts that need to be
> modified... Still, that's quite minor, so the two RPi patches,
>
> Acked-by: Stephen Warren 

Thanks for looking at this. Re the issue you raise, there is a patch
for this here, part of the omap3 series:

http://patchwork.ozlabs.org/patch/392039/

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


Re: [U-Boot] [PATCH 1/4] dm: rpi: Convert GPIO driver to driver model

2014-09-30 Thread Simon Glass
Hi Stephen,

On 30 September 2014 19:40, Stephen Warren  wrote:
> On 09/22/2014 05:30 PM, Simon Glass wrote:
>> Convert the BCM2835 GPIO driver to use driver model, and switch over
>> Raspberry Pi to use this, since it is the only board.
>
>> diff --git a/drivers/gpio/bcm2835_gpio.c b/drivers/gpio/bcm2835_gpio.c
>
>> +static inline bool gpio_is_requested(struct bcm2835_gpios *gpios, int 
>> offset)
>>  {
>> + return *gpios->label[offset] != '\0';
>>  }
>>
>> +static int check_requested(struct udevice *dev, unsigned offset,
>> +const char *func)
>>  {
>> + struct bcm2835_gpios *gpios = dev_get_priv(dev);
>> + struct gpio_dev_priv *uc_priv = dev->uclass_priv;
>> +
>> + if (!gpio_is_requested(gpios, offset)) {
>> + printf("omap_gpio: %s: error: gpio %s%d not requested\n",
>> +func, uc_priv->bank_name, offset);
>> + return -EPERM;
>> + }
>> +
>> + return 0;
>>  }
>
> It seems like the core GPIO layer should be doing the high-level
> management of GPIO requesting, so each driver doesn't have to duplicate
> the code?

Yes, agreed. I figured this was coming but took a conservative
approach with the uclass to start with. I will be taking a look at
moving this logic into the uclass soon. I've done enough GPIO drivers
to prove this out.

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


Re: [U-Boot] [PATCH v4 0/15] samsung: Use common config files with Samsung boards

2014-09-30 Thread Simon Glass
Hi Minkyu,

On 30 September 2014 07:47, Minkyu Kang  wrote:
> Dear Simon Glass,
>
> On 29/09/14 10:18, Simon Glass wrote:
>> This series tries to unify the Samsung board configs into a few header
>> files for exynos5 and exynos4.
>>
>> The purpose is to make it easier to move to driver model. In that case
>> I would like things like the GPIO drivers and serial drivers to work in
>> a standard way, and not need to support device tree and platform data at
>> the same time. That would be quite painful.
>>
>> Another reason is that the Chrome OS EC drivers are currently included in
>> boards that don't have a Chrome OS EC. This concern was raised by the
>> Samsung maintainer (Minkyu) a while back.
>>
>> There are still a few boards that don't use CONFIG_OF_CONTROL so I have
>> updated these rudimentary of device tree files based on feedback.
>>
>> This series has the side-effect of getting the EC interface working
>> properly on Pit, so the keyboard works. It also provides access to the
>> TPS65090 PMIC, which means that the backlight is enabled.
>>
>> Changes in v4:
>> - Address review nits from Minkyu
>> - Make this driver more like the one it came from
>> - Rebase on top of master (CONFIG_OF settings moved to Kconfig)
>> - Remove special FET_ERR_NOT_READY etc. and use standard errors
>>
>> Changes in v3:
>> - Adjust device tree file based on Robert Baldyga's example
>>
>> Changes in v2:
>> - Add new patch to enable keyboard on pit
>> - Add new patch to split out cros_ec drivers
>> - Add new patch to use 900MHz ARM frequeny in SPL for peach_pit
>> - Avoid using a common file, and just add a device tree
>> - Don't enable the cros_ec on smdk5420
>> - Fix 'cashe' typo in commit subject
>> - Fix device tree base addresses
>> - Leave CONFIG_SERIAL3 in the individual board files
>> - Leave in a few configs which are not in fact common to all boards
>> - Reduce the number of common elements to avoid needing #undefs later
>> - Slightly reword the commit message
>>
>> Simon Glass (15):
>>   Exynos: Use 900MHz ARM frequency in SPL for peach_pit
>>   exynos5: Enable data cache
>>   cros_ec: power: Add a tunnelled version of the tps65090 driver
>>   cros_ec: exynos: Use the correct tps65090 driver in each case
>>   dm: exynos: Split out the cros_ec drivers
>>   exynos: dts: Add device tree node for cros_ec keyboard
>>   exynos: Rename -dt config files to -common
>>   exynos: Move common exynos settings into a common file
>>   exynos: Move common smdk5420 things to common file
>>   exynos: config: Move cros_ec and tps65090 out of smdk boards
>>   config: Move arndale to use common exynos5250 file
>>   config: Move smdkv310 to use common exynos4 file
>>   samsung: Enable device tree for s5p_goni
>>   samsung: Enable device tree for smdkc100
>>   exynos: Enable pre-relocation malloc()
>>
>>  arch/arm/Kconfig   |  13 +-
>>  arch/arm/cpu/armv7/exynos/Kconfig  |   1 +
>>  arch/arm/cpu/armv7/s5pc1xx/Kconfig |  25 +++
>>  arch/arm/dts/Makefile  |   3 +
>>  arch/arm/dts/exynos4210-smdkv310.dts   |  21 ++
>>  arch/arm/dts/exynos5420-peach-pit.dts  |  57 +-
>>  arch/arm/dts/s5pc1xx-goni.dts  |  28 +++
>>  arch/arm/dts/s5pc1xx-smdkc100.dts  |  29 +++
>>  arch/arm/include/asm/arch-s5pc1xx/periph.h |  61 ++
>>  arch/arm/include/asm/arch-s5pc1xx/pinmux.h |  50 +
>>  configs/s5p_goni_defconfig |   2 +
>>  configs/smdkc100_defconfig |   2 +
>>  configs/smdkv310_defconfig |   1 +
>>  drivers/mmc/s5p_sdhci.c|   2 -
>>  drivers/power/pmic/Makefile|   3 +-
>>  drivers/power/pmic/pmic_tps65090_ec.c  | 218 
>> +
>>  include/configs/arndale.h  | 195 +-
>>  include/configs/{exynos4-dt.h => exynos-common.h}  | 110 +++
>>  include/configs/exynos4-common.h   |  68 +++
>>  include/configs/{exynos5-dt.h => exynos5-common.h} | 126 ++--
>>  include/configs/exynos5-dt-common.h|  35 
>>  .../{exynos5250-dt.h => exynos5250-common.h}   |   7 +-
>>  .../configs/{exynos5420.h => exynos5420-common.h}  |  22 ++-
>>  include/configs/odroid.h   |   4 +-
>>  include/configs/origen.h   |   5 +-
>>  include/configs/peach-pit.h|  16 +-
>>  include/configs/s5p_goni.h |   9 +-
>>  include/configs/s5pc210_universal.h|   5 +-
>>  include/configs/smdk5250.h |  23 ++-
>>  include/configs/smdk5420.h |   5 +-
>>  include/configs/smdkc100.h |   6 +
>>  include/configs/smdkv310.h |  61 +-
>>  include/configs/snow.h 

Re: [U-Boot] [PATCH 0/3] usb: gadget: fastboot miscellaneous patches

2014-09-30 Thread Eric Nelson
Hi Marek,

On 09/30/2014 04:59 PM, Marek Vasut wrote:
> On Tuesday, September 30, 2014 at 09:47:07 PM, Eric Nelson wrote:
>> Hi Marek,
>>
>> On 09/30/2014 12:37 PM, Marek Vasut wrote:
>>> On Tuesday, September 30, 2014 at 09:05:39 PM, Eric Nelson wrote:
 While trying to configure Nitrogen6X boards to use Android Fastboot,
 I found a number of places where the implementation doesn't appear
 to match the latest host tools on AOSP.

 Eric Nelson (3):
   usb: gadget: fastboot: add max-download-size variable
   usb: gadget: fastboot: explicitly set radix of maximum download size
   usb: gadget: fastboot: terminate commands with NULL
>>>
>>> Just to make sure, are those fixes for 2014.10 or new stuff for next ?
>>
>> These patches are against master, but should apply against usb/next and
>> dfu/next and "next" is fine for us.
> 
> 3/3 looks like a bugfix though. Is that a bugfix ?
> 

I wasn't able to get fastboot to do much of anything without all three.

-- lack of max-download-size simply stopped downloads
-- the missing radix caused my host to think that the 0x0700
size (copied from Beagle) was 1.8 MiB instead of 100+ MiB.
-- the lack of termination showed up as a request to download
a **huge** image when I tried to send u-boot.imx. I think I got
lucky that the next characters in the buffer looked like hex digits.

I suspect that others are either holding on to some local patches
or are perhaps using old versions of the Fastboot host program.

After applying all three, I was able to configure for flashing on
an MMC device, but I don't have anything configured to use EFI
partitions, so there's no immediate route to usage for us.

I'd really like to be able to "fastboot flash bootloader u-boot.imx"
and program SPI-NOR and also be able to boot a kernel and RAM disk
using "fastboot boot uImage uramdisk.img", but neither of them seems
very close. The first needs some more structure, and the latter seemed
to decide its' own address for the kernel and simply ignore the
RAM disk.

I have the sense that this code is pretty much a work in progress,
but I'd like to hear otherwise from those who have used it.

Regards,


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


Re: [U-Boot] [PATCH 0/4] dm: rpi: Move Raspberry Pi to use driver model

2014-09-30 Thread Stephen Warren
On 09/22/2014 05:30 PM, Simon Glass wrote:
> This series adds driver model support to the GPIO and serial drivers used
> by Raspberry Pi, and moves Raspberry Pi over to driver model.
> 
> This requires adding driver model support to the pl01x serial driver, and
> replacing the bcm2835 GPIO driver with a driver model version (since there
> are no longer clients that don't use driver model).
> 
> See u-boot-dm.git branch rpi-working for the tree this is based on.

The series,
Tested-by: Stephen Warren 

It threw me for a while that this series changes the command-line syntax
from:

gpio input 18

to:

gpio input GPIO18

Hopefully that won't annoy anyone who has scripts that need to be
modified... Still, that's quite minor, so the two RPi patches,

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


Re: [U-Boot] [PATCH 1/4] dm: rpi: Convert GPIO driver to driver model

2014-09-30 Thread Stephen Warren
On 09/22/2014 05:30 PM, Simon Glass wrote:
> Convert the BCM2835 GPIO driver to use driver model, and switch over
> Raspberry Pi to use this, since it is the only board.

> diff --git a/drivers/gpio/bcm2835_gpio.c b/drivers/gpio/bcm2835_gpio.c

> +static inline bool gpio_is_requested(struct bcm2835_gpios *gpios, int offset)
>  {
> + return *gpios->label[offset] != '\0';
>  }
>  
> +static int check_requested(struct udevice *dev, unsigned offset,
> +const char *func)
>  {
> + struct bcm2835_gpios *gpios = dev_get_priv(dev);
> + struct gpio_dev_priv *uc_priv = dev->uclass_priv;
> +
> + if (!gpio_is_requested(gpios, offset)) {
> + printf("omap_gpio: %s: error: gpio %s%d not requested\n",
> +func, uc_priv->bank_name, offset);
> + return -EPERM;
> + }
> +
> + return 0;
>  }

It seems like the core GPIO layer should be doing the high-level
management of GPIO requesting, so each driver doesn't have to duplicate
the code?
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 0/3] usb: gadget: fastboot miscellaneous patches

2014-09-30 Thread Marek Vasut
On Tuesday, September 30, 2014 at 09:47:07 PM, Eric Nelson wrote:
> Hi Marek,
> 
> On 09/30/2014 12:37 PM, Marek Vasut wrote:
> > On Tuesday, September 30, 2014 at 09:05:39 PM, Eric Nelson wrote:
> >> While trying to configure Nitrogen6X boards to use Android Fastboot,
> >> I found a number of places where the implementation doesn't appear
> >> to match the latest host tools on AOSP.
> >> 
> >> Eric Nelson (3):
> >>   usb: gadget: fastboot: add max-download-size variable
> >>   usb: gadget: fastboot: explicitly set radix of maximum download size
> >>   usb: gadget: fastboot: terminate commands with NULL
> > 
> > Just to make sure, are those fixes for 2014.10 or new stuff for next ?
> 
> These patches are against master, but should apply against usb/next and
> dfu/next and "next" is fine for us.

3/3 looks like a bugfix though. Is that a bugfix ?

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


[U-Boot] [PATCH] stdio: staticize locally-used call-backs

2014-09-30 Thread Eric Nelson
The various nulldev_x and stdio_serial_x calls are only used indirectly
through the nulldev and serial devices, so make them static and
prevent the dreaded "Should it be static?" warning with "make C=1".

Signed-off-by: Eric Nelson 
---
 common/stdio.c | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/common/stdio.c b/common/stdio.c
index c878103..523d859 100644
--- a/common/stdio.c
+++ b/common/stdio.c
@@ -36,39 +36,39 @@ char *stdio_names[MAX_FILES] = { "stdin", "stdout", 
"stderr" };
 
 
 #ifdef CONFIG_SYS_DEVICE_NULLDEV
-void nulldev_putc(struct stdio_dev *dev, const char c)
+static void nulldev_putc(struct stdio_dev *dev, const char c)
 {
/* nulldev is empty! */
 }
 
-void nulldev_puts(struct stdio_dev *dev, const char *s)
+static void nulldev_puts(struct stdio_dev *dev, const char *s)
 {
/* nulldev is empty! */
 }
 
-int nulldev_input(struct stdio_dev *dev)
+static int nulldev_input(struct stdio_dev *dev)
 {
/* nulldev is empty! */
return 0;
 }
 #endif
 
-void stdio_serial_putc(struct stdio_dev *dev, const char c)
+static void stdio_serial_putc(struct stdio_dev *dev, const char c)
 {
serial_putc(c);
 }
 
-void stdio_serial_puts(struct stdio_dev *dev, const char *s)
+static void stdio_serial_puts(struct stdio_dev *dev, const char *s)
 {
serial_puts(s);
 }
 
-int stdio_serial_getc(struct stdio_dev *dev)
+static int stdio_serial_getc(struct stdio_dev *dev)
 {
return serial_getc();
 }
 
-int stdio_serial_tstc(struct stdio_dev *dev)
+static int stdio_serial_tstc(struct stdio_dev *dev)
 {
return serial_tstc();
 }
-- 
1.9.1

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


[U-Boot] [PATCH 3/4] ARM: i.MX: provide declaration for board_spi_cs_gpio

2014-09-30 Thread Eric Nelson
Provide a public declaration of the board_spi_cs_gpio()
callback for i.MX SPI chip selects to prevent the warning
"Should it be static?" when compiling with "make C=1".

Signed-off-by: Eric Nelson 
---
 arch/arm/include/asm/imx-common/spi.h | 17 +
 board/boundary/nitrogen6x/nitrogen6x.c|  1 +
 board/compulab/cm_fx6/common.c|  1 +
 board/embest/mx6boards/mx6boards.c|  1 +
 board/freescale/mx6qsabreauto/mx6qsabreauto.c |  1 +
 board/freescale/mx6slevk/mx6slevk.c   |  1 +
 board/gateworks/gw_ventana/gw_ventana.c   |  1 +
 board/genesi/mx51_efikamx/efikamx.c   |  1 +
 board/ttcontrol/vision2/vision2.c |  1 +
 drivers/spi/mxc_spi.c |  1 +
 10 files changed, 26 insertions(+)
 create mode 100644 arch/arm/include/asm/imx-common/spi.h

diff --git a/arch/arm/include/asm/imx-common/spi.h 
b/arch/arm/include/asm/imx-common/spi.h
new file mode 100644
index 000..1d4473a
--- /dev/null
+++ b/arch/arm/include/asm/imx-common/spi.h
@@ -0,0 +1,17 @@
+/*
+ * Copyright 2011 Freescale Semiconductor, Inc.
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#ifndef __MXC_SPI_H_
+#define __MXC_SPI_H_
+
+/*
+ * Board-level chip-select callback
+ * Should return GPIO # to be used for chip-select
+ */
+
+int board_spi_cs_gpio(unsigned bus, unsigned cs);
+
+#endif
diff --git a/board/boundary/nitrogen6x/nitrogen6x.c 
b/board/boundary/nitrogen6x/nitrogen6x.c
index 7edfe19..b6a55f6 100644
--- a/board/boundary/nitrogen6x/nitrogen6x.c
+++ b/board/boundary/nitrogen6x/nitrogen6x.c
@@ -18,6 +18,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/board/compulab/cm_fx6/common.c b/board/compulab/cm_fx6/common.c
index 1f39679..59c9d1a 100644
--- a/board/compulab/cm_fx6/common.c
+++ b/board/compulab/cm_fx6/common.c
@@ -11,6 +11,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include "common.h"
 
diff --git a/board/embest/mx6boards/mx6boards.c 
b/board/embest/mx6boards/mx6boards.c
index a725f15..02fb3fa 100644
--- a/board/embest/mx6boards/mx6boards.c
+++ b/board/embest/mx6boards/mx6boards.c
@@ -23,6 +23,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/board/freescale/mx6qsabreauto/mx6qsabreauto.c 
b/board/freescale/mx6qsabreauto/mx6qsabreauto.c
index 836d722..6c676fe 100644
--- a/board/freescale/mx6qsabreauto/mx6qsabreauto.c
+++ b/board/freescale/mx6qsabreauto/mx6qsabreauto.c
@@ -17,6 +17,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/board/freescale/mx6slevk/mx6slevk.c 
b/board/freescale/mx6slevk/mx6slevk.c
index a0832f4..a500133 100644
--- a/board/freescale/mx6slevk/mx6slevk.c
+++ b/board/freescale/mx6slevk/mx6slevk.c
@@ -13,6 +13,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/board/gateworks/gw_ventana/gw_ventana.c 
b/board/gateworks/gw_ventana/gw_ventana.c
index 1038d9d..df491a8 100644
--- a/board/gateworks/gw_ventana/gw_ventana.c
+++ b/board/gateworks/gw_ventana/gw_ventana.c
@@ -20,6 +20,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/board/genesi/mx51_efikamx/efikamx.c 
b/board/genesi/mx51_efikamx/efikamx.c
index 137e4ed..6ba55cd 100644
--- a/board/genesi/mx51_efikamx/efikamx.c
+++ b/board/genesi/mx51_efikamx/efikamx.c
@@ -14,6 +14,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/board/ttcontrol/vision2/vision2.c 
b/board/ttcontrol/vision2/vision2.c
index b5249e7..247991d 100644
--- a/board/ttcontrol/vision2/vision2.c
+++ b/board/ttcontrol/vision2/vision2.c
@@ -15,6 +15,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/drivers/spi/mxc_spi.c b/drivers/spi/mxc_spi.c
index 026f680..be10269 100644
--- a/drivers/spi/mxc_spi.c
+++ b/drivers/spi/mxc_spi.c
@@ -12,6 +12,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #ifdef CONFIG_MX27
 /* i.MX27 has a completely wrong register layout and register definitions in 
the
-- 
1.9.1

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


[U-Boot] [PATCH 4/4] ARM: i.MX video: declare displays and display_count publicly

2014-09-30 Thread Eric Nelson
Declare displays[] and display_count in imx-common/video.h to
prevent "Should it be static?" messages when compiling board
files with "make C=1".

Signed-off-by: Eric Nelson 
---
 arch/arm/imx-common/video.c | 3 ---
 arch/arm/include/asm/imx-common/video.h | 5 +
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/arch/arm/imx-common/video.c b/arch/arm/imx-common/video.c
index 0121cd7..8651b80 100644
--- a/arch/arm/imx-common/video.c
+++ b/arch/arm/imx-common/video.c
@@ -6,9 +6,6 @@
 #include 
 #include 
 
-extern struct display_info_t const displays[];
-extern size_t display_count;
-
 int board_video_skip(void)
 {
int i;
diff --git a/arch/arm/include/asm/imx-common/video.h 
b/arch/arm/include/asm/imx-common/video.h
index 2d94850..1a907d4 100644
--- a/arch/arm/include/asm/imx-common/video.h
+++ b/arch/arm/include/asm/imx-common/video.h
@@ -21,4 +21,9 @@ struct display_info_t {
 extern int detect_hdmi(struct display_info_t const *dev);
 #endif
 
+#ifdef CONFIG_IMX_VIDEO_SKIP
+extern struct display_info_t const displays[];
+extern size_t display_count;
+#endif
+
 #endif
-- 
1.9.1

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


[U-Boot] [PATCH 2/4] ARM: i.MX6: include prototype for get_board_rev()

2014-09-30 Thread Eric Nelson
Include  to see the prototype for get_board_rev()
and prevent warning "Should it be static?" with "make C=1".

Signed-off-by: Eric Nelson 
---
 arch/arm/cpu/armv7/mx6/soc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/cpu/armv7/mx6/soc.c b/arch/arm/cpu/armv7/mx6/soc.c
index ba21cfe..f459d2f 100644
--- a/arch/arm/cpu/armv7/mx6/soc.c
+++ b/arch/arm/cpu/armv7/mx6/soc.c
@@ -20,6 +20,7 @@
 #include 
 #include 
 #include 
+#include 
 
 enum ldo_reg {
LDO_ARM,
-- 
1.9.1

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


[U-Boot] [PATCH 1/4] ARM: prevent compiler warnings from bootm.c

2014-09-30 Thread Eric Nelson
Without preceding declarations, "make C=1" generates
"Should it be static?" warnings for symbols
do_bootm_linux,
boot_prep_vxworks, and
boot_jump_vxworks

Include of bootm.h also identified a signature mismatch
(const on argv[]).

Signed-off-by: Eric Nelson 
---
 arch/arm/lib/bootm.c | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c
index 39fe7a1..4949d57 100644
--- a/arch/arm/lib/bootm.c
+++ b/arch/arm/lib/bootm.c
@@ -22,6 +22,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 
 #if defined(CONFIG_ARMV7_NONSEC) || defined(CONFIG_ARMV7_VIRT)
 #include 
@@ -299,7 +301,8 @@ static void boot_jump_linux(bootm_headers_t *images, int 
flag)
  * DIFFERENCE: Instead of calling prep and go at the end
  * they are called if subcommand is equal 0.
  */
-int do_bootm_linux(int flag, int argc, char *argv[], bootm_headers_t *images)
+int do_bootm_linux(int flag, int argc, char * const argv[],
+  bootm_headers_t *images)
 {
/* No need for those on ARM */
if (flag & BOOTM_STATE_OS_BD_T || flag & BOOTM_STATE_OS_CMDLINE)
-- 
1.9.1

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


[U-Boot] [PATCH 0/4] ARM: clean up declarations of public functions

2014-09-30 Thread Eric Nelson
This series of patches addresses a number of "Should it be static?"
warnings from make when invoked with C=1.

Eric Nelson (4):
  ARM: prevent compiler warnings from bootm.c
  ARM: i.MX6: include prototype for get_board_rev()
  ARM: i.MX: provide declaration for board_spi_cs_gpio
  ARM: i.MX video: declare displays and display_count publicly

 arch/arm/cpu/armv7/mx6/soc.c  |  1 +
 arch/arm/imx-common/video.c   |  3 ---
 arch/arm/include/asm/imx-common/spi.h | 17 +
 arch/arm/include/asm/imx-common/video.h   |  5 +
 arch/arm/lib/bootm.c  |  5 -
 board/boundary/nitrogen6x/nitrogen6x.c|  1 +
 board/compulab/cm_fx6/common.c|  1 +
 board/embest/mx6boards/mx6boards.c|  1 +
 board/freescale/mx6qsabreauto/mx6qsabreauto.c |  1 +
 board/freescale/mx6slevk/mx6slevk.c   |  1 +
 board/gateworks/gw_ventana/gw_ventana.c   |  1 +
 board/genesi/mx51_efikamx/efikamx.c   |  1 +
 board/ttcontrol/vision2/vision2.c |  1 +
 drivers/spi/mxc_spi.c |  1 +
 14 files changed, 36 insertions(+), 4 deletions(-)
 create mode 100644 arch/arm/include/asm/imx-common/spi.h

-- 
1.9.1

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


Re: [U-Boot] [PATCH 1/1] ARM: sheevaplug: convert to generic board support

2014-09-30 Thread David du Colombier
Sorry, for some reasons, I signed off with the
wrong e-mail address.

The second patch is the right one.

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


[U-Boot] [PATCH 1/1] ARM: sheevaplug: convert to generic board support

2014-09-30 Thread David du Colombier
Signed-off-by: David du Colombier <0in...@gmail.com>
---
 include/configs/sheevaplug.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/configs/sheevaplug.h b/include/configs/sheevaplug.h
index 4747adf..5beb273 100644
--- a/include/configs/sheevaplug.h
+++ b/include/configs/sheevaplug.h
@@ -9,6 +9,8 @@
 #ifndef _CONFIG_SHEEVAPLUG_H
 #define _CONFIG_SHEEVAPLUG_H
 
+#define CONFIG_SYS_GENERIC_BOARD
+
 /*
  * Version number information
  */
-- 
1.8.3.1

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


[U-Boot] [PATCH 1/1] ARM: sheevaplug: convert to generic board support

2014-09-30 Thread David du Colombier
From: David du Colombier 

Signed-off-by: David du Colombier 
---
 include/configs/sheevaplug.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/configs/sheevaplug.h b/include/configs/sheevaplug.h
index 4747adf..5beb273 100644
--- a/include/configs/sheevaplug.h
+++ b/include/configs/sheevaplug.h
@@ -9,6 +9,8 @@
 #ifndef _CONFIG_SHEEVAPLUG_H
 #define _CONFIG_SHEEVAPLUG_H
 
+#define CONFIG_SYS_GENERIC_BOARD
+
 /*
  * Version number information
  */
-- 
1.8.3.1

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


Re: [U-Boot] [PATCH 0/3] usb: gadget: fastboot miscellaneous patches

2014-09-30 Thread Eric Nelson
Hi Marek,

On 09/30/2014 12:37 PM, Marek Vasut wrote:
> On Tuesday, September 30, 2014 at 09:05:39 PM, Eric Nelson wrote:
>> While trying to configure Nitrogen6X boards to use Android Fastboot,
>> I found a number of places where the implementation doesn't appear
>> to match the latest host tools on AOSP.
>>
>> Eric Nelson (3):
>>   usb: gadget: fastboot: add max-download-size variable
>>   usb: gadget: fastboot: explicitly set radix of maximum download size
>>   usb: gadget: fastboot: terminate commands with NULL
> 
> Just to make sure, are those fixes for 2014.10 or new stuff for next ?
> 

These patches are against master, but should apply against usb/next and
dfu/next and "next" is fine for us.

I just thought I'd forward patches for what I've seen so far as I'm
trying to understand how the parts fit together.

The current dependencies on PART_EFI and a fixed MMC device don't fit
our needs very well, since we have our boot loader in SPI-NOR and
support a variety of MMC, eMMC, and SATA drives for booting Android
and structure in fb_mmc.c and aboot.c seems to require some compile-time
decisions.

Regards,


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


Re: [U-Boot] [PATCH 0/3] usb: gadget: fastboot miscellaneous patches

2014-09-30 Thread Marek Vasut
On Tuesday, September 30, 2014 at 09:05:39 PM, Eric Nelson wrote:
> While trying to configure Nitrogen6X boards to use Android Fastboot,
> I found a number of places where the implementation doesn't appear
> to match the latest host tools on AOSP.
> 
> Eric Nelson (3):
>   usb: gadget: fastboot: add max-download-size variable
>   usb: gadget: fastboot: explicitly set radix of maximum download size
>   usb: gadget: fastboot: terminate commands with NULL

Just to make sure, are those fixes for 2014.10 or new stuff for next ?

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


[U-Boot] OMAP4 video driver

2014-09-30 Thread Michael Trimarchi
Hi Tom,

I have done and tested some omap4 dsi video driver but I don't know
what is the best approach
to push it on uboot and change it to make it more mergeable with the
last driver model.

I don't have a lot of time for this task but I can do as a weekend
task. I have seen that we are moving
to the new driver model but the drivers/video directory contains video
but even panel definitions?
What is the best driver there to take as a reference?

Other big problem that some architecture has several files to
implement video subsystem. Is it better to move to arch
directory?

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


[U-Boot] [PATCH 3/3] usb: gadget: fastboot: terminate commands with NULL

2014-09-30 Thread Eric Nelson
Without NULL termination, various commands will read past the
end of input. In particular, this was noticed with error()
calls in cb_getvar and simple_strtoul() in cb_download.

Since the download callback happens elsewhere, the 4k buffer
should always be sufficient to handle command arguments.

Signed-off-by: Eric Nelson 
---
 drivers/usb/gadget/f_fastboot.c | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/drivers/usb/gadget/f_fastboot.c b/drivers/usb/gadget/f_fastboot.c
index 86700f5..0950ea8 100644
--- a/drivers/usb/gadget/f_fastboot.c
+++ b/drivers/usb/gadget/f_fastboot.c
@@ -542,6 +542,13 @@ static void rx_handler_command(struct usb_ep *ep, struct 
usb_request *req)
error("unknown command: %s\n", cmdbuf);
fastboot_tx_write_str("FAILunknown command");
} else {
+   if (req->actual < req->length) {
+   u8 *buf = (u8 *)req->buf;
+   buf[req->actual] = 0;
+   func_cb(ep, req);
+   } else {
+   error("buffer overflow\n");
+   }
func_cb(ep, req);
}
 
-- 
1.9.1

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


[U-Boot] [PATCH 2/3] usb: gadget: fastboot: explicitly set radix of maximum download size

2014-09-30 Thread Eric Nelson
The processing of the max-download-size variable requires a
radix specifier, or the fastboot host tool will interpret
it as an octal number.

See function get_target_sparse_limit() in file fastboot/fastboot.c
in the AOSP:
https://android.googlesource.com/platform/system/core/+/master

Signed-off-by: Eric Nelson 
---
 drivers/usb/gadget/f_fastboot.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/gadget/f_fastboot.c b/drivers/usb/gadget/f_fastboot.c
index f970f89..86700f5 100644
--- a/drivers/usb/gadget/f_fastboot.c
+++ b/drivers/usb/gadget/f_fastboot.c
@@ -355,7 +355,7 @@ static void cb_getvar(struct usb_ep *ep, struct usb_request 
*req)
!strcmp_l1("max-download-size", cmd)) {
char str_num[12];
 
-   sprintf(str_num, "%08x", CONFIG_USB_FASTBOOT_BUF_SIZE);
+   sprintf(str_num, "0x%08x", CONFIG_USB_FASTBOOT_BUF_SIZE);
strncat(response, str_num, chars_left);
} else if (!strcmp_l1("serialno", cmd)) {
s = getenv("serial#");
-- 
1.9.1

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


[U-Boot] [PATCH 0/3] usb: gadget: fastboot miscellaneous patches

2014-09-30 Thread Eric Nelson
While trying to configure Nitrogen6X boards to use Android Fastboot,
I found a number of places where the implementation doesn't appear
to match the latest host tools on AOSP.

Eric Nelson (3):
  usb: gadget: fastboot: add max-download-size variable
  usb: gadget: fastboot: explicitly set radix of maximum download size
  usb: gadget: fastboot: terminate commands with NULL

 drivers/usb/gadget/f_fastboot.c | 12 ++--
 1 file changed, 10 insertions(+), 2 deletions(-)

-- 
1.9.1

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


[U-Boot] [PATCH 1/3] usb: gadget: fastboot: add max-download-size variable

2014-09-30 Thread Eric Nelson
Current Android Fastboot seems to use 'max-download-size' instead
of 'downloadsize' variable to indicate the maximum size of sparse
segments.

See function get_target_sparse_limit() in file fastboot/fastboot.c
in the AOSP:
 https://android.googlesource.com/platform/system/core/+/master

Signed-off-by: Eric Nelson 
---
 drivers/usb/gadget/f_fastboot.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/gadget/f_fastboot.c b/drivers/usb/gadget/f_fastboot.c
index 38c0965..f970f89 100644
--- a/drivers/usb/gadget/f_fastboot.c
+++ b/drivers/usb/gadget/f_fastboot.c
@@ -351,7 +351,8 @@ static void cb_getvar(struct usb_ep *ep, struct usb_request 
*req)
strncat(response, FASTBOOT_VERSION, chars_left);
} else if (!strcmp_l1("bootloader-version", cmd)) {
strncat(response, U_BOOT_VERSION, chars_left);
-   } else if (!strcmp_l1("downloadsize", cmd)) {
+   } else if (!strcmp_l1("downloadsize", cmd) ||
+   !strcmp_l1("max-download-size", cmd)) {
char str_num[12];
 
sprintf(str_num, "%08x", CONFIG_USB_FASTBOOT_BUF_SIZE);
-- 
1.9.1

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


[U-Boot] Boot reason in SPL for OMAP4

2014-09-30 Thread Gregoire Gentil

Hello,

In TI x-loader, the boot reason is copied to a scratchpad 0x4A326000 as 
shown here:

https://gitorious.org/x-loader/x-loader/source/HEAD:cpu/omap4/start.S#L102

How can I access the boot reason in u-boot or in the SPL?

Grégoire

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


Re: [U-Boot] [PATCH v2 06/30] spi: Add brackets and tidy defines in spi.h

2014-09-30 Thread Simon Glass
On 15 September 2014 06:33, Simon Glass  wrote:
> Some of the #defines in spi.h are not bracketed. To avoid future mistakes
> add brackets. Also add an explanatory comment for SPI_CONN_DUAL_...
>
> Signed-off-by: Simon Glass 
> Reviewed-by: Jagannadha Sutradharudu Teki 
> ---
>
> Changes in v2: None

Applied to u-boot-dm/for-tom and now in mainline.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 05/30] dm: spi: Move cmd device code into its own function

2014-09-30 Thread Simon Glass
On 15 September 2014 06:33, Simon Glass  wrote:
> In preparation for changing the error handling in this code for driver
> model, move it into its own function.
>
> Reviewed-by: Jagannadha Sutradharudu Teki 
> Signed-off-by: Simon Glass 
> ---
>
> Changes in v2: None

Applied to u-boot-dm/for-tom and now in mainline.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 03/30] sandbox: config: Enable all SPI flash chips

2014-09-30 Thread Simon Glass
On 15 September 2014 06:33, Simon Glass  wrote:
> Sandbox may as well support everything. This increases the amount of code
> that is built/tested by sandbox, and also provides access to all the
> supported SPI flash devices.
>
> Signed-off-by: Simon Glass 
> Reviewed-by: Jagannadha Sutradharudu Teki 
> ---
>
> Changes in v2: None

Applied to u-boot-dm/for-tom and now in mainline.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 02/30] sandbox: Convert SPI flash emulation to use sf_params

2014-09-30 Thread Simon Glass
On 15 September 2014 06:33, Simon Glass  wrote:
>
> At present sandbox has its own table of supported SPI flash chips. Now that
> the SPI flash system is fully consolidated and has its own list, sandbox
> should use that.
>
> This enables us to expand the number of chips that sandbox supports.
>
> Signed-off-by: Simon Glass 
> Reviewed-by: Jagannadha Sutradharudu Teki 
> ---
>
> Changes in v2: None

Applied to u-boot-dm/for-tom and now in mainline.

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


Re: [U-Boot] [PATCH v1] imx6sx: Fix i.MX6SX HAB api function table offset

2014-09-30 Thread Fabio Estevam
On Tue, Sep 30, 2014 at 2:43 PM, Stefano Babic  wrote:

> ok - I have seen V3, I will apply it.

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


Re: [U-Boot] [PATCH v1] imx6sx: Fix i.MX6SX HAB api function table offset

2014-09-30 Thread Stefano Babic
Hi Fabio,

On 30/09/2014 18:31, Fabio Estevam wrote:
> Hi Stefano,
> 
> On Tue, Sep 30, 2014 at 1:08 PM, Stefano Babic  wrote:
> 
>> I do not like this approach because we do not need an additional
>> CONFIG_, that remains undocumented. If CONFIG_MX6SX, HAB_RVT_BASE is
>> always 0x100 - CONFIG_ROM_UNIFIED_SECTIONS is like a redundant
>> information, because it is not possible (or is it ?) to have a sx
>> processor with a different base address.
> 
> Yes, I agree that we should avoid introducing a new config like
> CONFIG_ROM_UNIFIED_SECTIONS.
> 
> What about this?
> 
> diff --git a/arch/arm/include/asm/arch-mx6/hab.h 
> b/arch/arm/include/asm/arch-mx6
> index 1f12695..c9e5318 100644
> --- a/arch/arm/include/asm/arch-mx6/hab.h
> +++ b/arch/arm/include/asm/arch-mx6/hab.h
> @@ -53,11 +53,17 @@ typedef void *hab_rvt_authenticate_image_t(uint8_t, 
> ptrdiff_
> void **, size_t *, hab_loader_callback_f_t);
>  typedef void hapi_clock_init_t(void);
> 
> -#define HAB_RVT_REPORT_EVENT   (*(uint32_t *)0x00B4)
> -#define HAB_RVT_REPORT_STATUS  (*(uint32_t *)0x00B8)
> -#define HAB_RVT_AUTHENTICATE_IMAGE (*(uint32_t *)0x00A4)
> -#define HAB_RVT_ENTRY  (*(uint32_t *)0x0098)
> -#define HAB_RVT_EXIT   (*(uint32_t *)0x009C)
> +#ifdef CONFIG_MX6SX
> +#define HAB_RVT_BASE   0x0100
> +#else
> +#define HAB_RVT_BASE   0x0094
> +#endif
> +
> +#define HAB_RVT_ENTRY  (*(uint32_t *)(HAB_RVT_BASE + 0x04))
> +#define HAB_RVT_EXIT   (*(uint32_t *)(HAB_RVT_BASE + 0x08))
> +#define HAB_RVT_AUTHENTICATE_IMAGE (*(uint32_t *)(HAB_RVT_BASE + 0x10))
> +#define HAB_RVT_REPORT_EVENT   (*(uint32_t *)(HAB_RVT_BASE + 0x20))
> +#define HAB_RVT_REPORT_STATUS  (*(uint32_t *)(HAB_RVT_BASE + 0x24))
> 
>  #define HAB_RVT_REPORT_EVENT_NEW   (*(uint32_t *)0x00B8)
>  #define HAB_RVT_REPORT_STATUS_NEW  (*(uint32_t *)0x00BC)
> 


ok - I have seen V3, I will apply it.

Regards,
Stefano

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


Re: [U-Boot] [PATCH] ARM: mx6: gw_ventana: Remove superfluous memset of GD in board_init_f

2014-09-30 Thread Tim Harvey
On Tue, Sep 30, 2014 at 3:41 AM, Stefan Roese  wrote:
> Zeroing GD in board_init_f() is not needed any more. As its now done in
> crt0.S. The patch that clears the GD in crt0.S is this one:
>
> aae2aef9 [arm: Set up global data before board_init_f()] from Simon.
>
> Signed-off-by: Stefan Roese 
> Cc: Tim Harvey 
> Cc: Stefano Babic 
> ---
>  board/gateworks/gw_ventana/gw_ventana_spl.c | 7 ---
>  1 file changed, 7 deletions(-)
>
> diff --git a/board/gateworks/gw_ventana/gw_ventana_spl.c 
> b/board/gateworks/gw_ventana/gw_ventana_spl.c
> index 9fc253b..ca35b3c 100644
> --- a/board/gateworks/gw_ventana/gw_ventana_spl.c
> +++ b/board/gateworks/gw_ventana/gw_ventana_spl.c
> @@ -402,13 +402,6 @@ void board_init_f(ulong dummy)
> struct ventana_board_info ventana_info;
> int board_model;
>
> -   /*
> -* Zero out global data:
> -*  - this shoudl be done by crt0.S
> -*  - failure to zero it will cause i2c_setup to fail
> -*/
> -   memset((void *)gd, 0, sizeof(struct global_data));
> -
> /* setup AIPS and disable watchdog */
> arch_cpu_init();
>
> --
> 2.1.0
>

Acked-by: Tim Harvey 

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


[U-Boot] [PATCH] mx6sxsabresd: Fix PCI reset and power GPIO assignments

2014-09-30 Thread Fabio Estevam
PERST_GPIO and POWER_GPIO are currently swapped.

Fix the GPIO assignments as per the board schematics.

Signed-off-by: Fabio Estevam 
---
 include/configs/mx6sxsabresd.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/configs/mx6sxsabresd.h b/include/configs/mx6sxsabresd.h
index fd74c69..e02ea18 100644
--- a/include/configs/mx6sxsabresd.h
+++ b/include/configs/mx6sxsabresd.h
@@ -204,8 +204,8 @@
 #define CONFIG_PCI_PNP
 #define CONFIG_PCI_SCAN_SHOW
 #define CONFIG_PCIE_IMX
-#define CONFIG_PCIE_IMX_PERST_GPIO IMX_GPIO_NR(2, 1)
-#define CONFIG_PCIE_IMX_POWER_GPIO IMX_GPIO_NR(2, 0)
+#define CONFIG_PCIE_IMX_PERST_GPIO IMX_GPIO_NR(2, 0)
+#define CONFIG_PCIE_IMX_POWER_GPIO IMX_GPIO_NR(2, 1)
 #endif
 
 /* FLASH and environment organization */
-- 
1.9.1

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


[U-Boot] [PATCH fix for v2014.10] sunxi: Fix gmac not working reliable on the Bananapi

2014-09-30 Thread Hans de Goede
In order for the gmac nic to work reliable on the Bananapi, we need to set
bits 10-12 GTXDC "GMAC Transmit Clock Delay Chain" of the GMAC clk register
(0x01c20164) to 3.

Without this about 9 out of 10 ethernet packets get lost, with this setting
there is no packet loss.

So far setting these bits is only necessary on the Bananapi, so this commit
solves this with a bit of #ifdef CONFIG_BANANAPI code. If in the future we
need to do something similar for other boards, we can create a specific
CONFIG_FOO option for this then.

Reported-by: Karsten Merker 
Signed-off-by: Hans de Goede 
Tested-by: Karsten Merker 
Tested-by: Zoltan HERPAI 
Tested-by: Tony Zhang 
Acked-by: Ian Campbell 
---
 board/sunxi/gmac.c | 9 +
 1 file changed, 9 insertions(+)

diff --git a/board/sunxi/gmac.c b/board/sunxi/gmac.c
index e7ff952..6348d27 100644
--- a/board/sunxi/gmac.c
+++ b/board/sunxi/gmac.c
@@ -24,6 +24,15 @@ int sunxi_gmac_initialize(bd_t *bis)
CCM_GMAC_CTRL_GPIT_MII);
 #endif
 
+   /*
+* In order for the gmac nic to work reliable on the Bananapi, we
+* need to set bits 10-12 GTXDC "GMAC Transmit Clock Delay Chain"
+* of the GMAC clk register to 3.
+*/
+#ifdef CONFIG_BANANAPI
+   setbits_le32(&ccm->gmac_clk_cfg, 0x3 << 10);
+#endif
+
/* Configure pin mux settings for GMAC */
for (pin = SUNXI_GPA(0); pin <= SUNXI_GPA(16); pin++) {
 #ifdef CONFIG_RGMII
-- 
2.1.0

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


[U-Boot] [PATCH fix for v2014.10 0/1] sunxi: Fix gmac not working reliable on the Bananapi

2014-09-30 Thread Hans de Goede
Hi Tom,

Here is a last minute sunxi bug-fix for v2014.10, which fixes the ethernet on
the bananapi being unusable.

Ian and I (the sunxi custodians) would like to see this included in v2014.10,
can you please apply it to master before the release ?

Thanks & Regards,

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


[U-Boot] [PATCH v3] imx6sx: Fix i.MX6SX HAB api function table offset

2014-09-30 Thread Nitin Garg
i.MX6SX ROM implements unified table sections.
The HAB function table is at offset 0x100. Update
the HAB function pointers accordingly.

Signed-off-by: Nitin Garg 
Tested-by: Fabio Estevam 

---

Changes in v3:
-Removed CONFIG_ROM_UNIFIED_SECTIONS instead use
CONFIG_MX6SX

Changes in v2:
-Moved CONFIG_ROM_UNIFIED_SECTIONS to mx6_common.h
-Simplified hab.h changes
-Added Fabio as Tested-by

 arch/arm/include/asm/arch-mx6/hab.h |   16 +++-
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/arch/arm/include/asm/arch-mx6/hab.h 
b/arch/arm/include/asm/arch-mx6/hab.h
index 1f12695..c9e5318 100644
--- a/arch/arm/include/asm/arch-mx6/hab.h
+++ b/arch/arm/include/asm/arch-mx6/hab.h
@@ -53,11 +53,17 @@ typedef void *hab_rvt_authenticate_image_t(uint8_t, 
ptrdiff_t,
void **, size_t *, hab_loader_callback_f_t);
 typedef void hapi_clock_init_t(void);
 
-#define HAB_RVT_REPORT_EVENT   (*(uint32_t *)0x00B4)
-#define HAB_RVT_REPORT_STATUS  (*(uint32_t *)0x00B8)
-#define HAB_RVT_AUTHENTICATE_IMAGE (*(uint32_t *)0x00A4)
-#define HAB_RVT_ENTRY  (*(uint32_t *)0x0098)
-#define HAB_RVT_EXIT   (*(uint32_t *)0x009C)
+#ifdef CONFIG_MX6SX
+#define HAB_RVT_BASE   0x0100
+#else
+#define HAB_RVT_BASE   0x0094
+#endif
+
+#define HAB_RVT_ENTRY  (*(uint32_t *)(HAB_RVT_BASE + 0x04))
+#define HAB_RVT_EXIT   (*(uint32_t *)(HAB_RVT_BASE + 0x08))
+#define HAB_RVT_AUTHENTICATE_IMAGE (*(uint32_t *)(HAB_RVT_BASE + 0x10))
+#define HAB_RVT_REPORT_EVENT   (*(uint32_t *)(HAB_RVT_BASE + 0x20))
+#define HAB_RVT_REPORT_STATUS  (*(uint32_t *)(HAB_RVT_BASE + 0x24))
 
 #define HAB_RVT_REPORT_EVENT_NEW   (*(uint32_t *)0x00B8)
 #define HAB_RVT_REPORT_STATUS_NEW  (*(uint32_t *)0x00BC)
-- 
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 v1] imx6sx: Fix i.MX6SX HAB api function table offset

2014-09-30 Thread Fabio Estevam
Hi Stefano,

On Tue, Sep 30, 2014 at 1:08 PM, Stefano Babic  wrote:

> I do not like this approach because we do not need an additional
> CONFIG_, that remains undocumented. If CONFIG_MX6SX, HAB_RVT_BASE is
> always 0x100 - CONFIG_ROM_UNIFIED_SECTIONS is like a redundant
> information, because it is not possible (or is it ?) to have a sx
> processor with a different base address.

Yes, I agree that we should avoid introducing a new config like
CONFIG_ROM_UNIFIED_SECTIONS.

What about this?

diff --git a/arch/arm/include/asm/arch-mx6/hab.h b/arch/arm/include/asm/arch-mx6
index 1f12695..c9e5318 100644
--- a/arch/arm/include/asm/arch-mx6/hab.h
+++ b/arch/arm/include/asm/arch-mx6/hab.h
@@ -53,11 +53,17 @@ typedef void *hab_rvt_authenticate_image_t(uint8_t, ptrdiff_
void **, size_t *, hab_loader_callback_f_t);
 typedef void hapi_clock_init_t(void);

-#define HAB_RVT_REPORT_EVENT   (*(uint32_t *)0x00B4)
-#define HAB_RVT_REPORT_STATUS  (*(uint32_t *)0x00B8)
-#define HAB_RVT_AUTHENTICATE_IMAGE (*(uint32_t *)0x00A4)
-#define HAB_RVT_ENTRY  (*(uint32_t *)0x0098)
-#define HAB_RVT_EXIT   (*(uint32_t *)0x009C)
+#ifdef CONFIG_MX6SX
+#define HAB_RVT_BASE   0x0100
+#else
+#define HAB_RVT_BASE   0x0094
+#endif
+
+#define HAB_RVT_ENTRY  (*(uint32_t *)(HAB_RVT_BASE + 0x04))
+#define HAB_RVT_EXIT   (*(uint32_t *)(HAB_RVT_BASE + 0x08))
+#define HAB_RVT_AUTHENTICATE_IMAGE (*(uint32_t *)(HAB_RVT_BASE + 0x10))
+#define HAB_RVT_REPORT_EVENT   (*(uint32_t *)(HAB_RVT_BASE + 0x20))
+#define HAB_RVT_REPORT_STATUS  (*(uint32_t *)(HAB_RVT_BASE + 0x24))

 #define HAB_RVT_REPORT_EVENT_NEW   (*(uint32_t *)0x00B8)
 #define HAB_RVT_REPORT_STATUS_NEW  (*(uint32_t *)0x00BC)
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v1] imx6sx: Fix i.MX6SX HAB api function table offset

2014-09-30 Thread Stefano Babic
Hi Nitin, hi Fabio,

thanks for immediately fix the issue - I have some comments.

On 30/09/2014 17:40, Nitin Garg wrote:
> i.MX6SX ROM implements unified table sections.
> The HAB function table is at offset 0x100. Update
> the HAB function pointers accordingly.
> 
> Signed-off-by: Nitin Garg 
> Tested-by: Fabio Estevam 
> 
> ---
> 
>  arch/arm/include/asm/arch-mx6/hab.h |   16 +++-
>  include/configs/mx6_common.h|4 
>  2 files changed, 15 insertions(+), 5 deletions(-)
> 
> diff --git a/arch/arm/include/asm/arch-mx6/hab.h 
> b/arch/arm/include/asm/arch-mx6/hab.h
> index 1f12695..c53709b 100644
> --- a/arch/arm/include/asm/arch-mx6/hab.h
> +++ b/arch/arm/include/asm/arch-mx6/hab.h
> @@ -53,11 +53,17 @@ typedef void *hab_rvt_authenticate_image_t(uint8_t, 
> ptrdiff_t,
>   void **, size_t *, hab_loader_callback_f_t);
>  typedef void hapi_clock_init_t(void);
>  
> -#define HAB_RVT_REPORT_EVENT   (*(uint32_t *)0x00B4)
> -#define HAB_RVT_REPORT_STATUS  (*(uint32_t *)0x00B8)
> -#define HAB_RVT_AUTHENTICATE_IMAGE (*(uint32_t *)0x00A4)
> -#define HAB_RVT_ENTRY  (*(uint32_t *)0x0098)
> -#define HAB_RVT_EXIT   (*(uint32_t *)0x009C)
> +#ifdef CONFIG_ROM_UNIFIED_SECTIONS
> +#define HAB_RVT_BASE 0x0100
> +#else
> +#define HAB_RVT_BASE 0x0094
> +#endif

It would be nice to understand how the choice is done. In my
understanding, even HAB_RVT_REPORT_EVENT_NEW and
HAB_RVT_REPORT_STATUS_NEW can be dropped and substituted by an offset.

I see then three cases:

mx6sx   HAB_RVT_BASE = 0x0100

mx6q with soc_rev() > 1.5   HAB_RVT_BASE = 0x098
or
mx6dl with soc_rev > 1.2


mx6q with soc_rev() < 1.5   HAB_RVT_BASE = 0x094
or
mx6d with soc_rev() < 1.2

then the single entries can be calculated from the base address.

> +
> +#define HAB_RVT_ENTRY(*(uint32_t *)(HAB_RVT_BASE + 
> 0x04))
> +#define HAB_RVT_EXIT (*(uint32_t *)(HAB_RVT_BASE + 0x08))
> +#define HAB_RVT_AUTHENTICATE_IMAGE   (*(uint32_t *)(HAB_RVT_BASE + 0x10))
> +#define HAB_RVT_REPORT_EVENT (*(uint32_t *)(HAB_RVT_BASE + 0x20))
> +#define HAB_RVT_REPORT_STATUS(*(uint32_t *)(HAB_RVT_BASE + 
> 0x24))
>  
>  #define HAB_RVT_REPORT_EVENT_NEW   (*(uint32_t *)0x00B8)
>  #define HAB_RVT_REPORT_STATUS_NEW  (*(uint32_t *)0x00BC)
> diff --git a/include/configs/mx6_common.h b/include/configs/mx6_common.h
> index 135a3f5..824e73f 100644
> --- a/include/configs/mx6_common.h
> +++ b/include/configs/mx6_common.h
> @@ -30,4 +30,8 @@
>  
>  #define CONFIG_MP
>  
> +#ifdef CONFIG_MX6SX
> +#define CONFIG_ROM_UNIFIED_SECTIONS

I do not like this approach because we do not need an additional
CONFIG_, that remains undocumented. If CONFIG_MX6SX, HAB_RVT_BASE is
always 0x100 - CONFIG_ROM_UNIFIED_SECTIONS is like a redundant
information, because it is not possible (or is it ?) to have a sx
processor with a different base address.

Best regards,
Stefano Babic

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


Re: [U-Boot] [PATCH] PATI: fix broken SPI access

2014-09-30 Thread Jagan Teki
On 30 September 2014 20:28, David Müller (ELSOFT AG)
 wrote:
> Jagan Teki wrote:
>> On 30 September 2014 18:41, David Müller (ELSOFT AG)
>>  wrote:
>>> Jagan Teki wrote:
 On 30 September 2014 16:53, David Müller  wrote:
> +int board_early_init_f(void)
> +{
> +   spi_init_f();

 Why you need to do this, spi_init_f is trying to call from
 arch/powerpc/lib/board.c
 any specific reason, I couldn't understand the fix you mentioned on
 the commit body.
>>>
>>> There is an EEPROM attached to the SPI channel containing vital board
>>> data. Calling spi_init_f() from arch/powerpc/lib/board.c will be too late.
>>
>> Sorry, this looks an other issue - but anyway we're trying to remove
>
> What kind of "other issue" do you mean?
>
>> spi_init* stuff
>> from drivers/spi/* in future and I don't think it's a good idea to use that.
>
> In this case what is the proposed way of initializing the SPI subsystem?
>

Usually spi got initialized through setup_slave() from the cmd
interface which is of
dynamic probe ie the reason most of drivers have spi_init() with no
functionality code.

On the other hand few are using spi_init() or spi_init_f() from arch
code or from
any other kind to initialize the spi.

Finally spi_init_f() from your case should use from arch(at least) as
this call is more generic
and it shouldn't be a call from board.

And more over we're working on dm-spi where spi_init() calls stuff
would disappear in future.

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


[U-Boot] [PATCH v2] imx6sx: Fix i.MX6SX HAB api function table offset

2014-09-30 Thread Nitin Garg
i.MX6SX ROM implements unified table sections.
The HAB function table is at offset 0x100. Update
the HAB function pointers accordingly.

Signed-off-by: Nitin Garg 
Tested-by: Fabio Estevam 

---

Changes in v2:
-Moved CONFIG_ROM_UNIFIED_SECTIONS to mx6_common.h
-Simplified hab.h changes
-Added Fabio as Tested-by

 arch/arm/include/asm/arch-mx6/hab.h |   16 +++-
 include/configs/mx6_common.h|4 
 2 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/arch/arm/include/asm/arch-mx6/hab.h 
b/arch/arm/include/asm/arch-mx6/hab.h
index 1f12695..c53709b 100644
--- a/arch/arm/include/asm/arch-mx6/hab.h
+++ b/arch/arm/include/asm/arch-mx6/hab.h
@@ -53,11 +53,17 @@ typedef void *hab_rvt_authenticate_image_t(uint8_t, 
ptrdiff_t,
void **, size_t *, hab_loader_callback_f_t);
 typedef void hapi_clock_init_t(void);
 
-#define HAB_RVT_REPORT_EVENT   (*(uint32_t *)0x00B4)
-#define HAB_RVT_REPORT_STATUS  (*(uint32_t *)0x00B8)
-#define HAB_RVT_AUTHENTICATE_IMAGE (*(uint32_t *)0x00A4)
-#define HAB_RVT_ENTRY  (*(uint32_t *)0x0098)
-#define HAB_RVT_EXIT   (*(uint32_t *)0x009C)
+#ifdef CONFIG_ROM_UNIFIED_SECTIONS
+#define HAB_RVT_BASE   0x0100
+#else
+#define HAB_RVT_BASE   0x0094
+#endif
+
+#define HAB_RVT_ENTRY  (*(uint32_t *)(HAB_RVT_BASE + 0x04))
+#define HAB_RVT_EXIT   (*(uint32_t *)(HAB_RVT_BASE + 0x08))
+#define HAB_RVT_AUTHENTICATE_IMAGE (*(uint32_t *)(HAB_RVT_BASE + 0x10))
+#define HAB_RVT_REPORT_EVENT   (*(uint32_t *)(HAB_RVT_BASE + 0x20))
+#define HAB_RVT_REPORT_STATUS  (*(uint32_t *)(HAB_RVT_BASE + 0x24))
 
 #define HAB_RVT_REPORT_EVENT_NEW   (*(uint32_t *)0x00B8)
 #define HAB_RVT_REPORT_STATUS_NEW  (*(uint32_t *)0x00BC)
diff --git a/include/configs/mx6_common.h b/include/configs/mx6_common.h
index 135a3f5..824e73f 100644
--- a/include/configs/mx6_common.h
+++ b/include/configs/mx6_common.h
@@ -30,4 +30,8 @@
 
 #define CONFIG_MP
 
+#ifdef CONFIG_MX6SX
+#define CONFIG_ROM_UNIFIED_SECTIONS
+#endif
+
 #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 v1] imx6sx: Fix i.MX6SX HAB api function table offset

2014-09-30 Thread Fabio Estevam
On Tue, Sep 30, 2014 at 12:40 PM, Nitin Garg  wrote:
> i.MX6SX ROM implements unified table sections.
> The HAB function table is at offset 0x100. Update
> the HAB function pointers accordingly.
>
> Signed-off-by: Nitin Garg 
> Tested-by: Fabio Estevam 

You should have marked this patch as v2 and described the changes
below the --- line.

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


[U-Boot] [PATCH v1] imx6sx: Fix i.MX6SX HAB api function table offset

2014-09-30 Thread Nitin Garg
i.MX6SX ROM implements unified table sections.
The HAB function table is at offset 0x100. Update
the HAB function pointers accordingly.

Signed-off-by: Nitin Garg 
Tested-by: Fabio Estevam 

---

 arch/arm/include/asm/arch-mx6/hab.h |   16 +++-
 include/configs/mx6_common.h|4 
 2 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/arch/arm/include/asm/arch-mx6/hab.h 
b/arch/arm/include/asm/arch-mx6/hab.h
index 1f12695..c53709b 100644
--- a/arch/arm/include/asm/arch-mx6/hab.h
+++ b/arch/arm/include/asm/arch-mx6/hab.h
@@ -53,11 +53,17 @@ typedef void *hab_rvt_authenticate_image_t(uint8_t, 
ptrdiff_t,
void **, size_t *, hab_loader_callback_f_t);
 typedef void hapi_clock_init_t(void);
 
-#define HAB_RVT_REPORT_EVENT   (*(uint32_t *)0x00B4)
-#define HAB_RVT_REPORT_STATUS  (*(uint32_t *)0x00B8)
-#define HAB_RVT_AUTHENTICATE_IMAGE (*(uint32_t *)0x00A4)
-#define HAB_RVT_ENTRY  (*(uint32_t *)0x0098)
-#define HAB_RVT_EXIT   (*(uint32_t *)0x009C)
+#ifdef CONFIG_ROM_UNIFIED_SECTIONS
+#define HAB_RVT_BASE   0x0100
+#else
+#define HAB_RVT_BASE   0x0094
+#endif
+
+#define HAB_RVT_ENTRY  (*(uint32_t *)(HAB_RVT_BASE + 0x04))
+#define HAB_RVT_EXIT   (*(uint32_t *)(HAB_RVT_BASE + 0x08))
+#define HAB_RVT_AUTHENTICATE_IMAGE (*(uint32_t *)(HAB_RVT_BASE + 0x10))
+#define HAB_RVT_REPORT_EVENT   (*(uint32_t *)(HAB_RVT_BASE + 0x20))
+#define HAB_RVT_REPORT_STATUS  (*(uint32_t *)(HAB_RVT_BASE + 0x24))
 
 #define HAB_RVT_REPORT_EVENT_NEW   (*(uint32_t *)0x00B8)
 #define HAB_RVT_REPORT_STATUS_NEW  (*(uint32_t *)0x00BC)
diff --git a/include/configs/mx6_common.h b/include/configs/mx6_common.h
index 135a3f5..824e73f 100644
--- a/include/configs/mx6_common.h
+++ b/include/configs/mx6_common.h
@@ -30,4 +30,8 @@
 
 #define CONFIG_MP
 
+#ifdef CONFIG_MX6SX
+#define CONFIG_ROM_UNIFIED_SECTIONS
+#endif
+
 #endif
-- 
1.7.9.5

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


[U-Boot] Please increase the image size for km boards

2014-09-30 Thread York Sun
Valentin,

We are seeing the image size of kmcoge4 and kmlion1 are on the edge. Attempts to
add new features cause overflow. Would you consider to increase the image size
for km boards. You may have noticed several patches doing this for selected
boards (search git log for 768K).

Thanks,

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


Re: [U-Boot] [PATCH v1] imx6sx: Fix i.MX6SX HAB api function table offset

2014-09-30 Thread Fabio Estevam
On Tue, Sep 30, 2014 at 11:43 AM, Nitin Garg  wrote:
> i.MX6SX ROM implements unified table sections.
> The HAB function table is at offset 0x100. Update
> the HAB function pointers accordingly.
>
> Signed-off-by: Nitin Garg 

It fixes the issue for me, thanks. I have one comment though.

> --- a/include/configs/mx6sxsabresd.h
> +++ b/include/configs/mx6sxsabresd.h
> @@ -15,6 +15,7 @@
>  #include "mx6_common.h"
>
>  #define CONFIG_MX6
> +#define CONFIG_ROM_UNIFIED_SECTIONS
>  #define CONFIG_DISPLAY_CPUINFO
>  #define CONFIG_DISPLAY_BOARDINFO

It would be better to add this CONFIG_ROM_UNIFIED_SECTIONS inside mx6_common.h:

#ifdef CONFIG_MX6SX
#define CONFIG_ROM_UNIFIED_SECTIONS
#endif

with that in place you can add my:

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


[U-Boot] [PATCH] mmc: Fix mmc bus width

2014-09-30 Thread Mario Schuknecht
After setting the bus width, the extended CSD register is read. Some selected
fields are compared with previously read extended CSD register fields. In this
comparison the EXT_CSD_ERASE_GROUP_DEF field is compared. But this field is
previously written under certain circumstances. And then the comparison fails.

Only compare read-only fields. Therefore compare field EXT_CSD_HC_WP_GRP_SIZE
instead of field EXT_CSD_ERASE_GROUP_DEF.

Signed-off-by: Mario Schuknecht 
---
 drivers/mmc/mmc.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
index a26f3ce..d1faa9f 100644
--- a/drivers/mmc/mmc.c
+++ b/drivers/mmc/mmc.c
@@ -1127,10 +1127,11 @@ static int mmc_startup(struct mmc *mmc)
mmc_set_bus_width(mmc, widths[idx]);
 
err = mmc_send_ext_csd(mmc, test_csd);
+   /* Only compare read only fields */
if (!err && ext_csd[EXT_CSD_PARTITIONING_SUPPORT] \
== test_csd[EXT_CSD_PARTITIONING_SUPPORT]
-&& ext_csd[EXT_CSD_ERASE_GROUP_DEF] \
-   == test_csd[EXT_CSD_ERASE_GROUP_DEF] \
+&& ext_csd[EXT_CSD_HC_WP_GRP_SIZE] \
+   == test_csd[EXT_CSD_HC_WP_GRP_SIZE] \
 && ext_csd[EXT_CSD_REV] \
== test_csd[EXT_CSD_REV]
 && ext_csd[EXT_CSD_HC_ERASE_GRP_SIZE] \
-- 
1.8.4.5

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


Re: [U-Boot] [PATCH] PATI: fix broken SPI access

2014-09-30 Thread ELSOFT AG
Jagan Teki wrote:
> On 30 September 2014 18:41, David Müller (ELSOFT AG)
>  wrote:
>> Jagan Teki wrote:
>>> On 30 September 2014 16:53, David Müller  wrote:
 +int board_early_init_f(void)
 +{
 +   spi_init_f();
>>>
>>> Why you need to do this, spi_init_f is trying to call from
>>> arch/powerpc/lib/board.c
>>> any specific reason, I couldn't understand the fix you mentioned on
>>> the commit body.
>>
>> There is an EEPROM attached to the SPI channel containing vital board
>> data. Calling spi_init_f() from arch/powerpc/lib/board.c will be too late.
> 
> Sorry, this looks an other issue - but anyway we're trying to remove

What kind of "other issue" do you mean?

> spi_init* stuff
> from drivers/spi/* in future and I don't think it's a good idea to use that.

In this case what is the proposed way of initializing the SPI subsystem?

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


Re: [U-Boot] [PATCH] PATI: fix broken SPI access

2014-09-30 Thread Tom Rini
On Tue, Sep 30, 2014 at 08:06:43PM +0530, Jagan Teki wrote:
> On 30 September 2014 18:41, David Müller (ELSOFT AG)
>  wrote:
> > Jagan Teki wrote:
> >> On 30 September 2014 16:53, David Müller  wrote:
> >>> +int board_early_init_f(void)
> >>> +{
> >>> +   spi_init_f();
> >>
> >> Why you need to do this, spi_init_f is trying to call from
> >> arch/powerpc/lib/board.c
> >> any specific reason, I couldn't understand the fix you mentioned on
> >> the commit body.
> >
> > There is an EEPROM attached to the SPI channel containing vital board
> > data. Calling spi_init_f() from arch/powerpc/lib/board.c will be too late.
> 
> Sorry, this looks an other issue - but anyway we're trying to remove
> spi_init* stuff
> from drivers/spi/* in future and I don't think it's a good idea to use that.

It's also not a good idea to say that we'll leave a board broken until
something better comes along.  There should be a comment added to the
code here making it clear _why_ we need this done early.

-- 
Tom


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


Re: [U-Boot] [PATCH v4] imx: Support i.MX6 High Assurance Boot authentication

2014-09-30 Thread Nitin Garg
Hi Fabio,

On 09/30/2014 08:44 AM, Fabio Estevam wrote:
> Hi Nitin,
> 
> On Tue, Sep 16, 2014 at 3:33 PM, Nitin Garg  wrote:
>> When CONFIG_SECURE_BOOT is enabled, the signed images
>> like kernel and dtb can be authenticated using iMX6 CAAM.
>> The added command hab_auth_img can be used for HAB
>> authentication of images. The command takes the image
>> DDR location, IVT (Image Vector Table) offset inside
>> image as parameters. Detailed info about signing images
>> can be found in Freescale AppNote AN4581.
>>
>> Signed-off-by: Nitin Garg 
> 
> I have just tested the 'hab_status' command and it hangs my mx6sxsabresd 
> board:
> 
> U-Boot 2014.10-rc2-16959-g6eb2f0d-dirty (Sep 30 2014 - 10:28:19)
> 
> CPU:   Freescale i.MX6SX rev1.0 at 792 MHz
> Reset cause: POR
> Board: MX6SX SABRE SDB
> I2C:   ready
> DRAM:  1 GiB
> MMC:   FSL_SDHC: 0
> In:serial
> Out:   serial
> Err:   serial
> PMIC:  PFUZE100 ID=0x10
> Net:   FEC [PRIME]
> Hit any key to stop autoboot:  0
> => hab_status
> 
> Secure boot disabled
> 
> (hangs the system)
> 
> Could you please take a look at this issue?
> 

I found the reason for the hang. The HAB api table was not
updated for i.MX6SX. Since i.MX6SX ROM implements unified
sections in ROM, the HAP function pointers needs to be
updated. I have sent a patch for the same.

-Nitin

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


[U-Boot] [PATCH v1] imx6sx: Fix i.MX6SX HAB api function table offset

2014-09-30 Thread Nitin Garg
i.MX6SX ROM implements unified table sections.
The HAB function table is at offset 0x100. Update
the HAB function pointers accordingly.

Signed-off-by: Nitin Garg 

---

 arch/arm/include/asm/arch-mx6/hab.h |   33 +++--
 include/configs/mx6sxsabresd.h  |1 +
 2 files changed, 24 insertions(+), 10 deletions(-)

diff --git a/arch/arm/include/asm/arch-mx6/hab.h 
b/arch/arm/include/asm/arch-mx6/hab.h
index 1f12695..4c9734e 100644
--- a/arch/arm/include/asm/arch-mx6/hab.h
+++ b/arch/arm/include/asm/arch-mx6/hab.h
@@ -53,17 +53,30 @@ typedef void *hab_rvt_authenticate_image_t(uint8_t, 
ptrdiff_t,
void **, size_t *, hab_loader_callback_f_t);
 typedef void hapi_clock_init_t(void);
 
-#define HAB_RVT_REPORT_EVENT   (*(uint32_t *)0x00B4)
-#define HAB_RVT_REPORT_STATUS  (*(uint32_t *)0x00B8)
-#define HAB_RVT_AUTHENTICATE_IMAGE (*(uint32_t *)0x00A4)
-#define HAB_RVT_ENTRY  (*(uint32_t *)0x0098)
-#define HAB_RVT_EXIT   (*(uint32_t *)0x009C)
+#ifdef CONFIG_ROM_UNIFIED_SECTIONS
 
-#define HAB_RVT_REPORT_EVENT_NEW   (*(uint32_t *)0x00B8)
-#define HAB_RVT_REPORT_STATUS_NEW  (*(uint32_t *)0x00BC)
-#define HAB_RVT_AUTHENTICATE_IMAGE_NEW (*(uint32_t *)0x00A8)
-#define HAB_RVT_ENTRY_NEW  (*(uint32_t *)0x009C)
-#define HAB_RVT_EXIT_NEW   (*(uint32_t *)0x00A0)
+#define HAB_RVT_BASE   0x0100
+#define HAB_RVT_ENTRY  (*(uint32_t *)(HAB_RVT_BASE + 0x04))
+#define HAB_RVT_EXIT   (*(uint32_t *)(HAB_RVT_BASE + 0x08))
+#define HAB_RVT_AUTHENTICATE_IMAGE (*(uint32_t *)(HAB_RVT_BASE + 0x10))
+#define HAB_RVT_REPORT_EVENT   (*(uint32_t *)(HAB_RVT_BASE + 0x20))
+#define HAB_RVT_REPORT_STATUS  (*(uint32_t *)(HAB_RVT_BASE + 0x24))
+
+#else
+
+#define HAB_RVT_REPORT_EVENT   (*(uint32_t *)0x00B4)
+#define HAB_RVT_REPORT_STATUS  (*(uint32_t *)0x00B8)
+#define HAB_RVT_AUTHENTICATE_IMAGE (*(uint32_t *)0x00A4)
+#define HAB_RVT_ENTRY  (*(uint32_t *)0x0098)
+#define HAB_RVT_EXIT   (*(uint32_t *)0x009C)
+
+#endif
+
+#define HAB_RVT_REPORT_EVENT_NEW   (*(uint32_t *)0x00B8)
+#define HAB_RVT_REPORT_STATUS_NEW  (*(uint32_t *)0x00BC)
+#define HAB_RVT_AUTHENTICATE_IMAGE_NEW (*(uint32_t *)0x00A8)
+#define HAB_RVT_ENTRY_NEW  (*(uint32_t *)0x009C)
+#define HAB_RVT_EXIT_NEW   (*(uint32_t *)0x00A0)
 
 #define HAB_CID_ROM 0 /**< ROM Caller ID */
 #define HAB_CID_UBOOT 1 /**< UBOOT Caller ID*/
diff --git a/include/configs/mx6sxsabresd.h b/include/configs/mx6sxsabresd.h
index 1eda65e..6394667 100644
--- a/include/configs/mx6sxsabresd.h
+++ b/include/configs/mx6sxsabresd.h
@@ -15,6 +15,7 @@
 #include "mx6_common.h"
 
 #define CONFIG_MX6
+#define CONFIG_ROM_UNIFIED_SECTIONS
 #define CONFIG_DISPLAY_CPUINFO
 #define CONFIG_DISPLAY_BOARDINFO
 
-- 
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] PATI: fix broken SPI access

2014-09-30 Thread Jagan Teki
On 30 September 2014 18:41, David Müller (ELSOFT AG)
 wrote:
> Jagan Teki wrote:
>> On 30 September 2014 16:53, David Müller  wrote:
>>> +int board_early_init_f(void)
>>> +{
>>> +   spi_init_f();
>>
>> Why you need to do this, spi_init_f is trying to call from
>> arch/powerpc/lib/board.c
>> any specific reason, I couldn't understand the fix you mentioned on
>> the commit body.
>
> There is an EEPROM attached to the SPI channel containing vital board
> data. Calling spi_init_f() from arch/powerpc/lib/board.c will be too late.

Sorry, this looks an other issue - but anyway we're trying to remove
spi_init* stuff
from drivers/spi/* in future and I don't think it's a good idea to use that.

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


Re: [U-Boot] [PATCH 0/5] Add EXT filesystem support to SPL

2014-09-30 Thread Guillaume Gardet


Le 30/09/2014 15:33, Tom Rini a écrit :

On Mon, Sep 29, 2014 at 08:39:54AM +0200, Guillaume Gardet wrote:


Hi,

Just a ping on this patch set which affects various part of u-boot.

Any comments ?

I like the concept and will look harder for the next merge window,
thanks!



Ok, thanks for the answer.
When will start the next merge window? In case you need a ping. ;)


Guillaume

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


Re: [U-Boot] [linux-sunxi] [PATCH] sunxi: Fix gmac not working reliable on the Bananapi

2014-09-30 Thread Koen Kooi

Op 30 sep. 2014, om 14:02 heeft Hans de Goede  het 
volgende geschreven:

> Hi,
> 
> On 09/29/2014 08:35 PM, jonsm...@gmail.com wrote:
>> On Mon, Sep 29, 2014 at 2:16 PM, Karsten Merker  wrote:
>>> On Mon, Sep 29, 2014 at 09:13:37AM +0300, Siarhei Siamashka wrote:
 How did you come to the idea to poke these bits?
>>> 
>>> The linux 3.4 kernel from https://github.com/LeMaker/linux-bananapi
>>> (which is a patched linux-sunxi.org 3.4 kernel) does not show this
>>> problem, so we started looking into what is different there, and the
>>> relevant change that was found was setting these particular
>>> undocumented bits.
>> 
>> File at issue here asking for the documentation
>> https://github.com/allwinner-zh/documents
> 
> I'm already talking to Allwinner about this, it seems that bits
> 10-11, or more likely 10-12 of the gmac clk register are the tx
> equivalent of bits 5-7, "Configure GMAC receive clock delay
> chain". I think this is there to deal with the pcb data and clk
> traces not having the same length, so that this is highly board
> specific. I'm waiting on confirmation on this from Allwinner,
> as well as some info on the unit of this 0-7 value.

Gbit ethernet requires a delay between the lines, which you can implement by 
adding 10cm  or so extra trace on the PCB or tell the MAC or PHY to do it in 
software. Very board specific, but so far I've only seen Intel reference 
designs use the extra trace length method most arm/ppc/mips gbit boards use a 
PHY that  handles it in hardware on request like the GMAC is doing above.

regards,

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


Re: [U-Boot] [PATCH v4 0/15] samsung: Use common config files with Samsung boards

2014-09-30 Thread Minkyu Kang
Dear Simon Glass,

On 29/09/14 10:18, Simon Glass wrote:
> This series tries to unify the Samsung board configs into a few header
> files for exynos5 and exynos4.
> 
> The purpose is to make it easier to move to driver model. In that case
> I would like things like the GPIO drivers and serial drivers to work in
> a standard way, and not need to support device tree and platform data at
> the same time. That would be quite painful.
> 
> Another reason is that the Chrome OS EC drivers are currently included in
> boards that don't have a Chrome OS EC. This concern was raised by the
> Samsung maintainer (Minkyu) a while back.
> 
> There are still a few boards that don't use CONFIG_OF_CONTROL so I have
> updated these rudimentary of device tree files based on feedback.
> 
> This series has the side-effect of getting the EC interface working
> properly on Pit, so the keyboard works. It also provides access to the
> TPS65090 PMIC, which means that the backlight is enabled.
> 
> Changes in v4:
> - Address review nits from Minkyu
> - Make this driver more like the one it came from
> - Rebase on top of master (CONFIG_OF settings moved to Kconfig)
> - Remove special FET_ERR_NOT_READY etc. and use standard errors
> 
> Changes in v3:
> - Adjust device tree file based on Robert Baldyga's example
> 
> Changes in v2:
> - Add new patch to enable keyboard on pit
> - Add new patch to split out cros_ec drivers
> - Add new patch to use 900MHz ARM frequeny in SPL for peach_pit
> - Avoid using a common file, and just add a device tree
> - Don't enable the cros_ec on smdk5420
> - Fix 'cashe' typo in commit subject
> - Fix device tree base addresses
> - Leave CONFIG_SERIAL3 in the individual board files
> - Leave in a few configs which are not in fact common to all boards
> - Reduce the number of common elements to avoid needing #undefs later
> - Slightly reword the commit message
> 
> Simon Glass (15):
>   Exynos: Use 900MHz ARM frequency in SPL for peach_pit
>   exynos5: Enable data cache
>   cros_ec: power: Add a tunnelled version of the tps65090 driver
>   cros_ec: exynos: Use the correct tps65090 driver in each case
>   dm: exynos: Split out the cros_ec drivers
>   exynos: dts: Add device tree node for cros_ec keyboard
>   exynos: Rename -dt config files to -common
>   exynos: Move common exynos settings into a common file
>   exynos: Move common smdk5420 things to common file
>   exynos: config: Move cros_ec and tps65090 out of smdk boards
>   config: Move arndale to use common exynos5250 file
>   config: Move smdkv310 to use common exynos4 file
>   samsung: Enable device tree for s5p_goni
>   samsung: Enable device tree for smdkc100
>   exynos: Enable pre-relocation malloc()
> 
>  arch/arm/Kconfig   |  13 +-
>  arch/arm/cpu/armv7/exynos/Kconfig  |   1 +
>  arch/arm/cpu/armv7/s5pc1xx/Kconfig |  25 +++
>  arch/arm/dts/Makefile  |   3 +
>  arch/arm/dts/exynos4210-smdkv310.dts   |  21 ++
>  arch/arm/dts/exynos5420-peach-pit.dts  |  57 +-
>  arch/arm/dts/s5pc1xx-goni.dts  |  28 +++
>  arch/arm/dts/s5pc1xx-smdkc100.dts  |  29 +++
>  arch/arm/include/asm/arch-s5pc1xx/periph.h |  61 ++
>  arch/arm/include/asm/arch-s5pc1xx/pinmux.h |  50 +
>  configs/s5p_goni_defconfig |   2 +
>  configs/smdkc100_defconfig |   2 +
>  configs/smdkv310_defconfig |   1 +
>  drivers/mmc/s5p_sdhci.c|   2 -
>  drivers/power/pmic/Makefile|   3 +-
>  drivers/power/pmic/pmic_tps65090_ec.c  | 218 
> +
>  include/configs/arndale.h  | 195 +-
>  include/configs/{exynos4-dt.h => exynos-common.h}  | 110 +++
>  include/configs/exynos4-common.h   |  68 +++
>  include/configs/{exynos5-dt.h => exynos5-common.h} | 126 ++--
>  include/configs/exynos5-dt-common.h|  35 
>  .../{exynos5250-dt.h => exynos5250-common.h}   |   7 +-
>  .../configs/{exynos5420.h => exynos5420-common.h}  |  22 ++-
>  include/configs/odroid.h   |   4 +-
>  include/configs/origen.h   |   5 +-
>  include/configs/peach-pit.h|  16 +-
>  include/configs/s5p_goni.h |   9 +-
>  include/configs/s5pc210_universal.h|   5 +-
>  include/configs/smdk5250.h |  23 ++-
>  include/configs/smdk5420.h |   5 +-
>  include/configs/smdkc100.h |   6 +
>  include/configs/smdkv310.h |  61 +-
>  include/configs/snow.h |  25 ++-
>  include/configs/trats.h|   6 +-
>  include/configs/trats2.h   |   6 +-
>  35 fi

Re: [U-Boot] [PATCH v4] imx: Support i.MX6 High Assurance Boot authentication

2014-09-30 Thread Fabio Estevam
Hi Nitin,

On Tue, Sep 16, 2014 at 3:33 PM, Nitin Garg  wrote:
> When CONFIG_SECURE_BOOT is enabled, the signed images
> like kernel and dtb can be authenticated using iMX6 CAAM.
> The added command hab_auth_img can be used for HAB
> authentication of images. The command takes the image
> DDR location, IVT (Image Vector Table) offset inside
> image as parameters. Detailed info about signing images
> can be found in Freescale AppNote AN4581.
>
> Signed-off-by: Nitin Garg 

I have just tested the 'hab_status' command and it hangs my mx6sxsabresd board:

U-Boot 2014.10-rc2-16959-g6eb2f0d-dirty (Sep 30 2014 - 10:28:19)

CPU:   Freescale i.MX6SX rev1.0 at 792 MHz
Reset cause: POR
Board: MX6SX SABRE SDB
I2C:   ready
DRAM:  1 GiB
MMC:   FSL_SDHC: 0
In:serial
Out:   serial
Err:   serial
PMIC:  PFUZE100 ID=0x10
Net:   FEC [PRIME]
Hit any key to stop autoboot:  0
=> hab_status

Secure boot disabled

(hangs the system)

Could you please take a look at this issue?
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 0/5] Add EXT filesystem support to SPL

2014-09-30 Thread Tom Rini
On Mon, Sep 29, 2014 at 08:39:54AM +0200, Guillaume Gardet wrote:

> Hi,
> 
> Just a ping on this patch set which affects various part of u-boot.
> 
> Any comments ?

I like the concept and will look harder for the next merge window,
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] PATI: fix broken SPI access

2014-09-30 Thread ELSOFT AG
Jagan Teki wrote:
> On 30 September 2014 16:53, David Müller  wrote:
>> +int board_early_init_f(void)
>> +{
>> +   spi_init_f();
> 
> Why you need to do this, spi_init_f is trying to call from
> arch/powerpc/lib/board.c
> any specific reason, I couldn't understand the fix you mentioned on
> the commit body.

There is an EEPROM attached to the SPI channel containing vital board
data. Calling spi_init_f() from arch/powerpc/lib/board.c will be too late.

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


Re: [U-Boot] [PATCH V2 1/2] ARM: rpi_b: query internal MAC address from firmware

2014-09-30 Thread Marek Vasut
On Tuesday, September 30, 2014 at 06:21:46 AM, Stephen Warren wrote:
> On 09/27/2014 01:43 PM, Marek Vasut wrote:
> > On Saturday, September 27, 2014 at 04:51:39 AM, Stephen Warren wrote:
> >> The built-in SMSC 95xx chip doesn't know its own MAC address. Instead,
> >> we must query it from the VC firmware; it's probably encoded in fuses
> >> on the BCM2835.
> >> 
> >> Signed-off-by: Stephen Warren 
> >> ---
> >> v2: Don't set usbethaddr if it's already set
> >> ---
> >> 
> >>  arch/arm/include/asm/arch-bcm2835/mbox.h | 14 ++
> >>  board/raspberrypi/rpi_b/rpi_b.c  | 29
> >> 
> >> + include/configs/rpi_b.h  |
> >> 1 +
> >> 
> >>  3 files changed, 44 insertions(+)
> >> 
> >> diff --git a/arch/arm/include/asm/arch-bcm2835/mbox.h
> >> b/arch/arm/include/asm/arch-bcm2835/mbox.h index dded857..61f427d 100644
> >> --- a/arch/arm/include/asm/arch-bcm2835/mbox.h
> >> +++ b/arch/arm/include/asm/arch-bcm2835/mbox.h
> >> @@ -119,6 +119,20 @@ struct bcm2835_mbox_tag_hdr {
> >> 
> >>   * };
> >>   */
> >> 
> >> +#define BCM2835_MBOX_TAG_GET_MAC_ADDRESS  0x00010003
> >> +
> >> +struct bcm2835_mbox_tag_get_mac_address {
> >> +  struct bcm2835_mbox_tag_hdr tag_hdr;
> >> +  union {
> >> +  struct {
> >> +  } req;
> >> +  struct {
> >> +  u8 mac[6];
> >> +  u8 pad[2];
> >> +  } resp;
> > 
> > Well, can't this be a simple u32 here ?
> 
> If you ignore the fact the message format really is 6 individual bytes,
> sure:-P.

Aw, u64 then. Anyway, it's not critical, it's just that the code looks a bit 
iffy, that's all.

> > [...]
> > 
> > Who will pick this series , shall I pick it ?
> 
> That sounds reasonable to me; they depend on your patches. I suppose
> Albert might want to ack that.

OK, I placed it into u-boot-usb/topic/dwc2-20140930 for now.

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


Re: [U-Boot] [PATCH] PATI: fix broken SPI access

2014-09-30 Thread Jagan Teki
On 30 September 2014 16:53, David Müller  wrote:
> fix broken SPI access by adding/activating BOARD_EARLY_INIT_F
> functionality and calling spi_init_f() from there.
>
> Signed-off-by: David Müller 
> ---
>  board/mpl/pati/pati.c  | 5 +
>  include/configs/PATI.h | 1 +
>  2 files changed, 6 insertions(+)
>
> diff --git a/board/mpl/pati/pati.c b/board/mpl/pati/pati.c
> index 5d701a7..b9d88ee 100644
> --- a/board/mpl/pati/pati.c
> +++ b/board/mpl/pati/pati.c
> @@ -311,6 +311,11 @@ void user_led1(int led_on)
> sysconf->sc_sgpiodt2=reg; /* Data register */
>  }
>
> +int board_early_init_f(void)
> +{
> +   spi_init_f();

Why you need to do this, spi_init_f is trying to call from
arch/powerpc/lib/board.c
any specific reason, I couldn't understand the fix you mentioned on
the commit body.

> +   return 0;
> +}
>
>  /
>   * Last Stage Init
> diff --git a/include/configs/PATI.h b/include/configs/PATI.h
> index 65ab65d..3ca204e 100644
> --- a/include/configs/PATI.h
> +++ b/include/configs/PATI.h
> @@ -98,6 +98,7 @@
>
>  #define CONFIG_SYS_BAUDRATE_TABLE  { 9600, 19200, 38400, 57600, 115200, 
> 125 }
>
> +#define CONFIG_BOARD_EARLY_INIT_F
>
>  /***
>   * Last Stage Init
> --

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


Re: [U-Boot] [linux-sunxi] Re: [PATCH] sunxi: Fix gmac not working reliable on the Bananapi

2014-09-30 Thread jonsm...@gmail.com
On Tue, Sep 30, 2014 at 8:02 AM, Hans de Goede  wrote:
> Hi,
>
> On 09/29/2014 08:35 PM, jonsm...@gmail.com wrote:
>> On Mon, Sep 29, 2014 at 2:16 PM, Karsten Merker  wrote:
>>> On Mon, Sep 29, 2014 at 09:13:37AM +0300, Siarhei Siamashka wrote:
 How did you come to the idea to poke these bits?
>>>
>>> The linux 3.4 kernel from https://github.com/LeMaker/linux-bananapi
>>> (which is a patched linux-sunxi.org 3.4 kernel) does not show this
>>> problem, so we started looking into what is different there, and the
>>> relevant change that was found was setting these particular
>>> undocumented bits.
>>
>> File at issue here asking for the documentation
>> https://github.com/allwinner-zh/documents
>
> I'm already talking to Allwinner about this, it seems that bits
> 10-11, or more likely 10-12 of the gmac clk register are the tx
> equivalent of bits 5-7, "Configure GMAC receive clock delay
> chain". I think this is there to deal with the pcb data and clk
> traces not having the same length, so that this is highly board
> specific. I'm waiting on confirmation on this from Allwinner,
> as well as some info on the unit of this 0-7 value.

Encourage them to update the manual and push a new copy to git hub
immediately. Too much info like this is getting buried in mail
archives. Electronic publishing is free - update as often as you want.

The more they fix stuff like this in the manual, the fewer questions
they will need to deal with in person. When it goes into the manual it
won't get lost.


>
> Regards,
>
> Hans



-- 
Jon Smirl
jonsm...@gmail.com
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [linux-sunxi] Re: [PATCH] sunxi: Fix gmac not working reliable on the Bananapi

2014-09-30 Thread Hans de Goede
Hi,

On 09/29/2014 08:35 PM, jonsm...@gmail.com wrote:
> On Mon, Sep 29, 2014 at 2:16 PM, Karsten Merker  wrote:
>> On Mon, Sep 29, 2014 at 09:13:37AM +0300, Siarhei Siamashka wrote:
>>> How did you come to the idea to poke these bits?
>>
>> The linux 3.4 kernel from https://github.com/LeMaker/linux-bananapi
>> (which is a patched linux-sunxi.org 3.4 kernel) does not show this
>> problem, so we started looking into what is different there, and the
>> relevant change that was found was setting these particular
>> undocumented bits.
> 
> File at issue here asking for the documentation
> https://github.com/allwinner-zh/documents

I'm already talking to Allwinner about this, it seems that bits
10-11, or more likely 10-12 of the gmac clk register are the tx
equivalent of bits 5-7, "Configure GMAC receive clock delay
chain". I think this is there to deal with the pcb data and clk
traces not having the same length, so that this is highly board
specific. I'm waiting on confirmation on this from Allwinner,
as well as some info on the unit of this 0-7 value.

Regards,

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


Re: [U-Boot] [PATCH 1/3] usb: dwc2: Add driver for Synopsis DWC2 USB IP block

2014-09-30 Thread Pavel Machek
Hi!

> > > + case (USB_REQ_GET_DESCRIPTOR << 8) | USB_DIR_IN | USB_TYPE_CLASS:
> > > + {
> > > + __u32 temp = 0x0001;
> > 
> > temp is never writtenn to. Can you just write 1 instead of it?
> 
> I added a comment. This is the root port config, so it should be tweakable
> in case there is some mutated DWC2 core.

Ok.

> > > + /* TODO: no endless loop */
> > > + while (1) {
> > > + hcint_new = readl(&hc_regs->hcint);
> > > + if (hcint != hcint_new)
> > > + hcint = hcint_new;
> > 
> > What is going on here?
> 
> What do you mean ? The loop ?

hcint is set to hcint_new in rather interesting way. The if() should
not be needed, but maybe something else is wrong with the code.

Best regards,
Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) 
http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] VCMA9: remove EXT2 support

2014-09-30 Thread David Müller
remove the seldomly used EXT2 support because the U-Boot binary will
not fit into the 512KiB flash otherwise.

Signed-off-by: David Müller 
---
 include/configs/VCMA9.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/include/configs/VCMA9.h b/include/configs/VCMA9.h
index 0d8a13c..a97f5fa 100644
--- a/include/configs/VCMA9.h
+++ b/include/configs/VCMA9.h
@@ -216,7 +216,6 @@
 
 /* File system */
 #define CONFIG_CMD_FAT
-#define CONFIG_CMD_EXT2
 #define CONFIG_CMD_UBI
 #define CONFIG_CMD_UBIFS
 #define CONFIG_CMD_JFFS2
-- 
1.8.4

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


Re: [U-Boot] [RFC PATCH] genboardscfg.py: use Python2 from default path

2014-09-30 Thread Wolfgang Denk
Dear Masahiro,

In message <20140930175820.4a3c.aa925...@jp.panasonic.com> you wrote:
> 
> > This happens for example with all but the most recent versions of
> > Yocto based tool chains (inclusing all currently existing versions of
> > the ELDK), which provide a python2 binary in SYSROOT/usr/bin/python2,
> > but do not include the "fnmatch" module.
> 
> I'd like to regard the root cause of the problem
> as ELDK missing fnmatch module.

Yes, you are right.  The problem is caused by the fact that the ELDK
(and other Yocto based tool chains until very recently) provide their
own version of Python2, but without including the fnmatch module.

> I think '/usr/bin/env python' is a general strategy
> to support various platforms where Python might not
> be installed in /usr/bin directory.
> (Buildman and Patman have already adopted this way.)

I agree, and I'm fully aware of potential issues - this is why I
marked this patch as RFC.  I'm looking for a solution which works
reasonably well for all.

The situation is, that there is a pretty large number of tool chains
out there (and ectively being used in a number of projects), which
provide their own Python interpreter, but are lacking the fnmatch
module.

As I see it, we have the following options to deal with that:

1) Rewrite  genboardscfg.py  such that fnmatch is not needed.
   I have no idea if this is easily possible or how much effort was
   required to do that.

2) Let the script use the system provided Python binary, asuming that
   fnmatch is either automatically installed or at least ready
   available and with minimal effort installable in all recent Linux
   distros.

3) Create fixes so the users can rebuild the tool chains such that
   these contain the needed Python modules.

4) For all tool chains that support some form of package management,
   build and distribute the missing Python modules as upate package.

5) Fix and rebuild tool chains and distribute new versions of the tool
   chains.


My proposed patch choses option 2), as this appears to require the
minimal effort on both the tool chain suppliers and on the U-Boot
side.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
"Don't worry about people stealing your ideas. If your ideas are  any
good, you'll have to ram them down people's throats."  - Howard Aiken
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] PATI: fix broken SPI access

2014-09-30 Thread David Müller
fix broken SPI access by adding/activating BOARD_EARLY_INIT_F
functionality and calling spi_init_f() from there.

Signed-off-by: David Müller 
---
 board/mpl/pati/pati.c  | 5 +
 include/configs/PATI.h | 1 +
 2 files changed, 6 insertions(+)

diff --git a/board/mpl/pati/pati.c b/board/mpl/pati/pati.c
index 5d701a7..b9d88ee 100644
--- a/board/mpl/pati/pati.c
+++ b/board/mpl/pati/pati.c
@@ -311,6 +311,11 @@ void user_led1(int led_on)
sysconf->sc_sgpiodt2=reg; /* Data register */
 }
 
+int board_early_init_f(void)
+{
+   spi_init_f();
+   return 0;
+}
 
 /
  * Last Stage Init
diff --git a/include/configs/PATI.h b/include/configs/PATI.h
index 65ab65d..3ca204e 100644
--- a/include/configs/PATI.h
+++ b/include/configs/PATI.h
@@ -98,6 +98,7 @@
 
 #define CONFIG_SYS_BAUDRATE_TABLE  { 9600, 19200, 38400, 57600, 115200, 
125 }
 
+#define CONFIG_BOARD_EARLY_INIT_F
 
 /***
  * Last Stage Init
-- 
1.8.4

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


Re: [U-Boot] UBI issues on SAMA5D31 NOR flash

2014-09-30 Thread Andy Pont
Hello Heiko,

> Hmm.. I thought to see something like this:
> 
> "too large reserved_pebs %d, good PEBs %d"
> 
> I am not familiar with this HW ... I think, you have to debug into it

Changing the dbg_err() to ubi_err() and also adding a bit more output then I
get:

UBI error: vtbl_check: reserved_pebs 81, ubi->good_peb_count 80
UBI error: vtbl_check: too large reserved_pebs, good PEBs 80

Use of UBI is new to me so where are the PEBs configured?

Thanks,

Andy.


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


[U-Boot] [PATCH 4/4] PATI: convert to generic board

2014-09-30 Thread David Müller
Signed-off-by: David Müller 
---
 include/configs/PATI.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/configs/PATI.h b/include/configs/PATI.h
index d823b0f..65ab65d 100644
--- a/include/configs/PATI.h
+++ b/include/configs/PATI.h
@@ -21,6 +21,8 @@
 
 #defineCONFIG_SYS_TEXT_BASE0xFFF0
 
+#define CONFIG_SYS_GENERIC_BOARD
+
 /* Serial Console Configuration */
 #defineCONFIG_5xx_CONS_SCI1
 #undef CONFIG_5xx_CONS_SCI2
-- 
1.8.4

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


[U-Boot] [PATCH 2/4] MIP405: convert to generic board

2014-09-30 Thread David Müller
Signed-off-by: David Müller 
---
 include/configs/MIP405.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/configs/MIP405.h b/include/configs/MIP405.h
index 68824fd..147f122 100644
--- a/include/configs/MIP405.h
+++ b/include/configs/MIP405.h
@@ -21,6 +21,8 @@
 
 #defineCONFIG_SYS_TEXT_BASE0xFFF8
 
+#define CONFIG_SYS_GENERIC_BOARD
+
 /***
  * Note that it may also be a MIP405T board which is a subset of the
  * MIP405
-- 
1.8.4

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


[U-Boot] [PATCH 1/4] PIP405: convert to generic board

2014-09-30 Thread David Müller
Signed-off-by: David Müller 
---
 include/configs/PIP405.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/configs/PIP405.h b/include/configs/PIP405.h
index a6f505a..9a1b2ac 100644
--- a/include/configs/PIP405.h
+++ b/include/configs/PIP405.h
@@ -21,6 +21,8 @@
 
 #defineCONFIG_SYS_TEXT_BASE0xFFF8
 
+#define CONFIG_SYS_GENERIC_BOARD
+
 /***
  * Clock
  ***/
-- 
1.8.4

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


[U-Boot] Activate generic board feature on all MPL boards

2014-09-30 Thread David Müller
[PATCH 1/4] PIP405: convert to generic board
[PATCH 2/4] MIP405: convert to generic board
[PATCH 3/4] VCMA9: convert to generic board
[PATCH 4/4] PATI: convert to generic board
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 3/4] VCMA9: convert to generic board

2014-09-30 Thread David Müller
Signed-off-by: David Müller 
---
 include/configs/VCMA9.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/configs/VCMA9.h b/include/configs/VCMA9.h
index d40185e..0d8a13c 100644
--- a/include/configs/VCMA9.h
+++ b/include/configs/VCMA9.h
@@ -28,6 +28,8 @@
 
 #define CONFIG_SYS_TEXT_BASE   0x0
 
+#define CONFIG_SYS_GENERIC_BOARD
+
 #define CONFIG_SYS_ARM_CACHE_WRITETHROUGH
 
 /* input clock of PLL (VCMA9 has 12MHz input clock) */
-- 
1.8.4

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


[U-Boot] [PATCH] ARM: mx6: gw_ventana: Remove superfluous memset of GD in board_init_f

2014-09-30 Thread Stefan Roese
Zeroing GD in board_init_f() is not needed any more. As its now done in
crt0.S. The patch that clears the GD in crt0.S is this one:

aae2aef9 [arm: Set up global data before board_init_f()] from Simon.

Signed-off-by: Stefan Roese 
Cc: Tim Harvey 
Cc: Stefano Babic 
---
 board/gateworks/gw_ventana/gw_ventana_spl.c | 7 ---
 1 file changed, 7 deletions(-)

diff --git a/board/gateworks/gw_ventana/gw_ventana_spl.c 
b/board/gateworks/gw_ventana/gw_ventana_spl.c
index 9fc253b..ca35b3c 100644
--- a/board/gateworks/gw_ventana/gw_ventana_spl.c
+++ b/board/gateworks/gw_ventana/gw_ventana_spl.c
@@ -402,13 +402,6 @@ void board_init_f(ulong dummy)
struct ventana_board_info ventana_info;
int board_model;
 
-   /*
-* Zero out global data:
-*  - this shoudl be done by crt0.S
-*  - failure to zero it will cause i2c_setup to fail
-*/
-   memset((void *)gd, 0, sizeof(struct global_data));
-
/* setup AIPS and disable watchdog */
arch_cpu_init();
 
-- 
2.1.0

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


Re: [U-Boot] [PATCH v4 2/2] imx: mx6dlarm2: Add support for i.MX6Q/DL arm2 LPDDR2 boards

2014-09-30 Thread Stefano Babic
On 29/09/2014 17:26, Ye.Li wrote:
> Update the ddr scripts for LPDDR2 and add two build configs for LPDDR2
> arm2 board. Since the LPDDR2 arm2 board has different DDR size, use
> CONFIG_DDR_MB in defconfig to replace the PHYS_SDRAM_SIZE.
> 
> Signed-off-by: Ye.Li 
> ---

Applied to u-boot-imx, thanks !

Best regards,
Stefano Babic


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


Re: [U-Boot] [PATCH v4 1/2] imx: mx6dlarm2: Add support for i.MX6DL arm2 DDR3 board

2014-09-30 Thread Stefano Babic
Hi Ye,

On 29/09/2014 17:26, Ye.Li wrote:
> This patch adds the i.MX6DL arm2 board support. The i.MX6DL ARM2
> shared the same board with i.MX6Q ARM2 board since the i.MX6DL is
> pin-pin compatible with i.MX6Q.
> 
> The patch also support the DDR 32-BIT mode option. Please define
> CONFIG_DDR_32BIT in the board configure file to enable DDR 32-BIT
> mode.But due to the board design, it's 64bit DDR buswidth physically,
> so, if you CONFIG_DDR_32BIT, the DDR memory size will be half of it.
> 
> Signed-off-by: Ye.Li 
> ---

Applied to u-boot-imx, thanks !

Best regards,
Stefano Babic

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


Re: [U-Boot] UBI issues on SAMA5D31 NOR flash

2014-09-30 Thread Heiko Schocher

Hello Andy,

Am 30.09.2014 11:04, schrieb Andy Pont:

Hello Heiko,


Using the patches from Bo Shen to support the NOR flash on the Atmel


which patches?


I can't find the references in Patchman but they were sent to the mailing
list on 18th July 2014 in a series called "ARM: atmel: sama5d3xek: enable
NOR flash support".  The patches basically just add the board features to
enable the IO pins for the NOR flash and to map it into the memory map at
0x1000.


U-Boot>   ubi part rootfs
UBI: attaching mtd2 to ubi0
UBI: physical eraseblock size:   131072 bytes (128 KiB)
UBI: logical eraseblock size:130944 bytes
UBI: smallest flash I/O unit:1
UBI: VID header offset:  64 (aligned 64)
UBI: data offset:128
UBI error: vtbl_check: volume table check failed: record 0, error 9


seems ubi does not find the volume table ... could you activate
ubi error messages ubi_err() ?


Adding:

#define DEBUG
#define CONFIG_MTD_UBI_DEBUG
#define CONFIG_MTD_UBI_DEBUG_MSG
#define CONFIG_UBIFS_FS_DEBUG

Gives the following output:

U-Boot>  ubi part rootfs

---mtdparts_init---
last_ids  : nor0=physmap-flash.0
env_ids   : nor0=physmap-flash.0
last_parts:
mtdparts=physmap-flash.0:128k(bootstrap)ro,768k(u-boot)ro,128k(fdt),4m(kerne
l),10m(rootfs)
env_parts :
mtdparts=physmap-flash.0:128k(bootstrap)ro,768k(u-boot)ro,128k(fdt),4m(kerne
l),10m(rootfs)

last_partition : nor0,0
env_partition  : nor0,0
--- find_dev_and_part ---
id = rootfs
--- find_dev_and_part ---
id = rootfs
Creating 1 MTD partitions on "nor0":
0x0050-0x00f0 : "mtd=4"
UBI: attaching mtd2 to ubi0
UBI: physical eraseblock size:   131072 bytes (128 KiB)
UBI: logical eraseblock size:130944 bytes
UBI: smallest flash I/O unit:1
UBI: VID header offset:  64 (aligned 64)
UBI: data offset:128
UBI error: vtbl_check: volume table check failed: record 0, error 9
UBI error: ubi_init: cannot attach mtd2
UBI error: ubi_init: UBI error: cannot initialize UBI, error -22
UBI init error 22
Command failed, result=22


Hmm.. I thought to see something like this:

"too large reserved_pebs %d, good PEBs %d"

I am not familiar with this HW ... I think, you have to debug into it ...
Maybe Bo has an idea?


Did the ubi partition work under linux? Did you tried current ML
U-Boot (there MTD/UBI and UBIFS is synced with linux 3.15) ...


I haven't booted to Linux yet.  If I try to boot with the kernel that is in
the NOR flash then I get the following output from the console messages:

0.nor_flash: Found 1 x16 devices at 0x0 in 16-bit bank. Manufacturer ID
0x89 Chip ID 0x00899a
Intel/Sharp Extended Query Table at 0x010A
Intel/Sharp Extended Query Table at 0x010A
Intel/Sharp Extended Query Table at 0x010A
Intel/Sharp Extended Query Table at 0x010A
Intel/Sharp Extended Query Table at 0x010A
Using buffer write method
Using auto-unlock on power-up/resume
cfi_cmdset_0001: Erase suspend on write enabled
UBI error: ubi_init: UBI error: cannot initialize UBI, error -19


Hmm.. linux returns another error ...


Is there something that I need to do in order to tell U-Boot and the kernel
that the base address of the NOR flash device is 0x1000 rather than 0x0?


I don t know ... but it seems, the chip is detected, so the base addr
should be correct.

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


Re: [U-Boot] UBI issues on SAMA5D31 NOR flash

2014-09-30 Thread Andy Pont
Hello Heiko,

> > Using the patches from Bo Shen to support the NOR flash on the Atmel
> 
> which patches?

I can't find the references in Patchman but they were sent to the mailing
list on 18th July 2014 in a series called "ARM: atmel: sama5d3xek: enable
NOR flash support".  The patches basically just add the board features to
enable the IO pins for the NOR flash and to map it into the memory map at
0x1000.

> > U-Boot>  ubi part rootfs
> > UBI: attaching mtd2 to ubi0
> > UBI: physical eraseblock size:   131072 bytes (128 KiB)
> > UBI: logical eraseblock size:130944 bytes
> > UBI: smallest flash I/O unit:1
> > UBI: VID header offset:  64 (aligned 64)
> > UBI: data offset:128
> > UBI error: vtbl_check: volume table check failed: record 0, error 9
> 
> seems ubi does not find the volume table ... could you activate
> ubi error messages ubi_err() ?

Adding:

#define DEBUG
#define CONFIG_MTD_UBI_DEBUG
#define CONFIG_MTD_UBI_DEBUG_MSG
#define CONFIG_UBIFS_FS_DEBUG

Gives the following output:

U-Boot> ubi part rootfs

---mtdparts_init---
last_ids  : nor0=physmap-flash.0
env_ids   : nor0=physmap-flash.0
last_parts:
mtdparts=physmap-flash.0:128k(bootstrap)ro,768k(u-boot)ro,128k(fdt),4m(kerne
l),10m(rootfs)
env_parts :
mtdparts=physmap-flash.0:128k(bootstrap)ro,768k(u-boot)ro,128k(fdt),4m(kerne
l),10m(rootfs)

last_partition : nor0,0
env_partition  : nor0,0
--- find_dev_and_part ---
id = rootfs
--- find_dev_and_part ---
id = rootfs
Creating 1 MTD partitions on "nor0":
0x0050-0x00f0 : "mtd=4"
UBI: attaching mtd2 to ubi0
UBI: physical eraseblock size:   131072 bytes (128 KiB)
UBI: logical eraseblock size:130944 bytes
UBI: smallest flash I/O unit:1
UBI: VID header offset:  64 (aligned 64)
UBI: data offset:128
UBI error: vtbl_check: volume table check failed: record 0, error 9
UBI error: ubi_init: cannot attach mtd2
UBI error: ubi_init: UBI error: cannot initialize UBI, error -22
UBI init error 22
Command failed, result=22

> Did the ubi partition work under linux? Did you tried current ML
> U-Boot (there MTD/UBI and UBIFS is synced with linux 3.15) ...

I haven't booted to Linux yet.  If I try to boot with the kernel that is in
the NOR flash then I get the following output from the console messages:

0.nor_flash: Found 1 x16 devices at 0x0 in 16-bit bank. Manufacturer ID
0x89 Chip ID 0x00899a
Intel/Sharp Extended Query Table at 0x010A
Intel/Sharp Extended Query Table at 0x010A
Intel/Sharp Extended Query Table at 0x010A
Intel/Sharp Extended Query Table at 0x010A
Intel/Sharp Extended Query Table at 0x010A
Using buffer write method
Using auto-unlock on power-up/resume
cfi_cmdset_0001: Erase suspend on write enabled
UBI error: ubi_init: UBI error: cannot initialize UBI, error -19

Is there something that I need to do in order to tell U-Boot and the kernel
that the base address of the NOR flash device is 0x1000 rather than 0x0?

Thanks,

Andy.


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


Re: [U-Boot] [RFC PATCH] genboardscfg.py: use Python2 from default path

2014-09-30 Thread Masahiro Yamada
Hi Wolfgang,


On Tue, 30 Sep 2014 10:17:22 +0200
Wolfgang Denk  wrote:

> Instead of searching for Python2 in $PATH, use the one installed by
> the system (i. e. /usr/bin/python2).  This prevents failures like
> this:
> 
> -> ./MAKEALL m53evk
> Traceback (most recent call last):
>   File "tools/genboardscfg.py", line 19, in 
> import fnmatch
> ImportError: No module named fnmatch
> Failed to generate boards.cfg
> 
> This happens for example with all but the most recent versions of
> Yocto based tool chains (inclusing all currently existing versions of
> the ELDK), which provide a python2 binary in SYSROOT/usr/bin/python2,
> but do not include the "fnmatch" module.

I'd like to regard the root cause of the problem
as ELDK missing fnmatch module.

I have no idea if fnmatch module is so special.


> By using the system installed Python interpreter, the user is able to
> install any missing modules himself, without need to patch and rebuild
> the whole tool chain.



I think '/usr/bin/env python' is a general strategy
to support various platforms where Python might not
be installed in /usr/bin directory.
(Buildman and Patman have already adopted this way.)


If necessary, I do not mind this change (as I only use Linux).

Though FreeBSD people (Jeroen) might be unhappy
because the standard installation path of Python
is '/usr/local/bin/python' on FreeBSD.

(OK. They can have a symbolic link  /usr/bin/python2 => /usr/local/bin/python2)



Best Regards
Masahiro Yamada

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


[U-Boot] [PATCH] SPDX License cleanup for LiMon imported files

2014-09-30 Thread Wolfgang Denk
A number of network related files were imported from the LiMon
project; these contain a somewhat unclear license statement:

Copyright 1994 - 2000 Neil Russell.
(See License)

I analyzed the source code of LiMon v1.4.2 which was used for this
import.  It does not contain any "License" file, but the top level
directory contains a file "COPYING", which turns out to be GPL v2
of June 1991.  So it is legitimate to conclude that the LiMon derived
files are also to be released under GPLv2.  Mark them as such.

Signed-off-by: Wolfgang Denk 
---
 include/net.h | 2 +-
 net/arp.c | 1 +
 net/arp.h | 1 +
 net/cdp.c | 1 +
 net/cdp.h | 1 +
 net/net.c | 1 +
 net/ping.c| 1 +
 net/ping.h| 1 +
 8 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/include/net.h b/include/net.h
index 735b0b9..18d279e 100644
--- a/include/net.h
+++ b/include/net.h
@@ -3,7 +3,7 @@
  *
  * Copyright 1994 - 2000 Neil Russell.
  * (See License)
- *
+ * SPDX-License-Identifier:GPL-2.0
  *
  * History
  * 9/16/00   bor  adapted to TQM823L/STK8xxL board, RARP/TFTP boot added
diff --git a/net/arp.c b/net/arp.c
index 20c6b2d..21ed31b 100644
--- a/net/arp.c
+++ b/net/arp.c
@@ -6,6 +6,7 @@
  * Copyright 2000 Roland Borde
  * Copyright 2000 Paolo Scaffardi
  * Copyright 2000-2002 Wolfgang Denk, w...@denx.de
+ * SPDX-License-Identifier:GPL-2.0
  */
 
 #include 
diff --git a/net/arp.h b/net/arp.h
index bfd57e0..3a0a13a 100644
--- a/net/arp.h
+++ b/net/arp.h
@@ -6,6 +6,7 @@
  * Copyright 2000 Roland Borde
  * Copyright 2000 Paolo Scaffardi
  * Copyright 2000-2002 Wolfgang Denk, w...@denx.de
+ * SPDX-License-Identifier:GPL-2.0
  */
 
 #ifndef __ARP_H__
diff --git a/net/cdp.c b/net/cdp.c
index 3d9559e..2d8fa03 100644
--- a/net/cdp.c
+++ b/net/cdp.c
@@ -6,6 +6,7 @@
  * Copyright 2000 Roland Borde
  * Copyright 2000 Paolo Scaffardi
  * Copyright 2000-2002 Wolfgang Denk, w...@denx.de
+ * SPDX-License-Identifier:GPL-2.0
  */
 
 #include 
diff --git a/net/cdp.h b/net/cdp.h
index ec7315a..95e4ce0 100644
--- a/net/cdp.h
+++ b/net/cdp.h
@@ -6,6 +6,7 @@
  * Copyright 2000 Roland Borde
  * Copyright 2000 Paolo Scaffardi
  * Copyright 2000-2002 Wolfgang Denk, w...@denx.de
+ * SPDX-License-Identifier:GPL-2.0
  */
 
 #if defined(CONFIG_CMD_CDP)
diff --git a/net/net.c b/net/net.c
index 722089f..2bea07b 100644
--- a/net/net.c
+++ b/net/net.c
@@ -6,6 +6,7 @@
  * Copyright 2000 Roland Borde
  * Copyright 2000 Paolo Scaffardi
  * Copyright 2000-2002 Wolfgang Denk, w...@denx.de
+ * SPDX-License-Identifier:GPL-2.0
  */
 
 /*
diff --git a/net/ping.c b/net/ping.c
index 0710b92..2be56ed 100644
--- a/net/ping.c
+++ b/net/ping.c
@@ -6,6 +6,7 @@
  * Copyright 2000 Roland Borde
  * Copyright 2000 Paolo Scaffardi
  * Copyright 2000-2002 Wolfgang Denk, w...@denx.de
+ * SPDX-License-Identifier:GPL-2.0
  */
 
 #include "ping.h"
diff --git a/net/ping.h b/net/ping.h
index 8c71be4..b672b95 100644
--- a/net/ping.h
+++ b/net/ping.h
@@ -6,6 +6,7 @@
  * Copyright 2000 Roland Borde
  * Copyright 2000 Paolo Scaffardi
  * Copyright 2000-2002 Wolfgang Denk, w...@denx.de
+ * SPDX-License-Identifier:GPL-2.0
  */
 
 #ifndef __PING_H__
-- 
1.8.3.1

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


Re: [U-Boot] drivers/net/phy/icplus.c delete reason

2014-09-30 Thread Masahiro Yamada
Hi Dvorkin,


On Tue, 30 Sep 2014 11:14:41 +0400
Dvorkin Dmitry  wrote:

> Hello Masahiro Yamada!
> 
> 4 Aug 2014 in this mailing list you requested deletion of ICPLUS driver for a 
> frequently used and cheap IP101A/G phy. Is there are better alternative PHY 
> driver in U-Boot for this device? If not, could you patch it back?


I assume you are mentioning commit 368b4d2b49bb (drivers: net: remove dead 
drivers).

I have no idea if the latest U-Boot code has an alternative PHY driver.

I am not willing to send the patch because I have no interest
in re-adding drivers I am not using.

If necessary for you, please feel free to send a patch to get it back.
(Please make sure there exists at least one board enabling the driver.
This is not my way, but the community's way.)



Best Regards
Masahiro Yamada

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


Re: [U-Boot] drivers/net/phy/icplus.c delete reason

2014-09-30 Thread Wolfgang Denk
Dear Dmitry,

In message <542a5861.7010...@tibbo.com> you wrote:
> 
> 4 Aug 2014 in this mailing list you requested deletion of ICPLUS driver 
> for a frequently used and cheap IP101A/G phy. Is there are better 
> alternative PHY driver in U-Boot for this device? If not, could you 
> patch it back?

The commit message is pretty explicit about the reason:

commit 368b4d2b49bbbf379d9334747fbbd2fe4356
Author: Masahiro Yamada 
Date:   Mon Aug 4 08:11:37 2014 +0900

drivers: net: remove dead drivers

The following configs are not defined at all:

 - CONFIG_INCA_IP_SWITCH
 - CONFIG_PBL2800_ETHER
 - CONFIG_PHY_ICPLUS

Signed-off-by: Masahiro Yamada 

There is/was not a single board configuration in mainline U-Boot which
defined CONFIG_PHY_ICPLUS, i. e. the driver was just dead, unused
code.

So the PHY may be "frequently used and cheap", but the driver for it
has never been used in mainline, so we finally got rid of the dead
weight.

I can see no reason to adding it back - this can be easily done if
someone wants to actually use this driver, i. e. for example if you
submit a boad configuration which references it.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
"It's when they say 2 + 2 = 5 that I begin to argue."- Eric Pepke
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] drivers/net/phy/icplus.c delete reason

2014-09-30 Thread Dvorkin Dmitry

Hello Masahiro Yamada!

4 Aug 2014 in this mailing list you requested deletion of ICPLUS driver 
for a frequently used and cheap IP101A/G phy. Is there are better 
alternative PHY driver in U-Boot for this device? If not, could you 
patch it back?

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


[U-Boot] [RFC PATCH] genboardscfg.py: use Python2 from default path

2014-09-30 Thread Wolfgang Denk
Instead of searching for Python2 in $PATH, use the one installed by
the system (i. e. /usr/bin/python2).  This prevents failures like
this:

-> ./MAKEALL m53evk
Traceback (most recent call last):
  File "tools/genboardscfg.py", line 19, in 
import fnmatch
ImportError: No module named fnmatch
Failed to generate boards.cfg

This happens for example with all but the most recent versions of
Yocto based tool chains (inclusing all currently existing versions of
the ELDK), which provide a python2 binary in SYSROOT/usr/bin/python2,
but do not include the "fnmatch" module.

By using the system installed Python interpreter, the user is able to
install any missing modules himself, without need to patch and rebuild
the whole tool chain.

Signed-off-by: Wolfgang Denk 
Cc: Masahiro Yamada 
---
 tools/genboardscfg.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/genboardscfg.py b/tools/genboardscfg.py
index 23c956b..fa0f49f 100755
--- a/tools/genboardscfg.py
+++ b/tools/genboardscfg.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2
+#!/usr/bin/python2
 #
 # Author: Masahiro Yamada 
 #
-- 
1.8.3.1

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


[U-Boot] [PATCH 3/3] drivers: usb: fsl: Add USB device-tree errata framework

2014-09-30 Thread Nikhil Badola
Add a new framework for fsl usb erratum handling to standardize
erratum checking only inside Uboot. Information to kernel is passed
via a boolean property corresponding to erratum, hence eliminating
need for code duplication inside kernel

Signed-off-by: Ramneek Mehresh 
Signed-off-by: Nikhil Badola 
---
 drivers/usb/host/ehci-fsl.c | 64 +
 1 file changed, 64 insertions(+)

diff --git a/drivers/usb/host/ehci-fsl.c b/drivers/usb/host/ehci-fsl.c
index 295250a..c125e2c 100644
--- a/drivers/usb/host/ehci-fsl.c
+++ b/drivers/usb/host/ehci-fsl.c
@@ -208,10 +208,57 @@ static int fdt_fixup_usb_mode_phy_type(void *blob, const 
char *mode,
return node_offset;
 }
 
+static const char *fdt_usb_get_node_type(void *blob, int start_offset,
+int *node_offset)
+{
+   const char *compat_dr = "fsl-usb2-dr";
+   const char *compat_mph = "fsl-usb2-mph";
+   const char *node_type = NULL;
+
+   *node_offset = fdt_node_offset_by_compatible(blob, start_offset,
+compat_mph);
+   if (*node_offset < 0) {
+   *node_offset = fdt_node_offset_by_compatible(blob,
+start_offset,
+compat_dr);
+   if (*node_offset < 0) {
+   printf("ERROR: could not find compatible node: %s\n",
+  fdt_strerror(*node_offset));
+   } else {
+   node_type = compat_dr;
+   }
+   } else {
+   node_type = compat_mph;
+   }
+
+   return node_type;
+}
+
+static int fdt_fixup_usb_erratum(void *blob, const char *prop_erratum,
+int start_offset)
+{
+   int node_offset, err;
+   const char *node_type = NULL;
+
+   node_type = fdt_usb_get_node_type(blob, start_offset, &node_offset);
+   if (!node_type)
+   return -1;
+
+   err = fdt_setprop(blob, node_offset, prop_erratum, NULL, 0);
+   if (err < 0) {
+   printf("ERROR: could not set %s for %s: %s.\n",
+  prop_erratum, node_type, fdt_strerror(err));
+   }
+
+   return node_offset;
+}
+
 void fdt_fixup_dr_usb(void *blob, bd_t *bd)
 {
static const char * const modes[] = { "host", "peripheral", "otg" };
static const char * const phys[] = { "ulpi", "utmi" };
+   int usb_erratum_a006261_off = -1;
+   int usb_erratum_a007075_off = -1;
int usb_mode_off = -1;
int usb_phy_off = -1;
char str[5];
@@ -265,6 +312,23 @@ void fdt_fixup_dr_usb(void *blob, bd_t *bd)
 
if (usb_phy_off < 0)
return;
+
+   if (has_erratum_a006261()) {
+   usb_erratum_a006261_off =  fdt_fixup_usb_erratum
+  (blob,
+   "fsl,usb-erratum-a006261",
+   usb_erratum_a006261_off);
+   if (usb_erratum_a006261_off < 0)
+   return;
+   }
+   if (has_erratum_a007075()) {
+   usb_erratum_a007075_off =  fdt_fixup_usb_erratum
+  (blob,
+   "fsl,usb-erratum-a007075",
+   usb_erratum_a007075_off);
+   if (usb_erratum_a007075_off < 0)
+   return;
+   }
}
 }
 #endif
-- 
1.7.11.7


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


  1   2   >