Re: [U-Boot] [PATCH 09/11] IMX: add additional function for pinmux using an array

2014-04-22 Thread Tim Harvey
On Thu, Apr 10, 2014 at 7:41 AM, Nikita Kiryanov  wrote:
> On 04/09/2014 06:40 PM, Tim Harvey wrote:
>>
>> On Wed, Apr 9, 2014 at 7:56 AM, Nikita Kiryanov 
>> wrote:
>>>
>>> Hi Tim,
>>>
>>>
>>> On 04/03/2014 09:01 AM, Tim Harvey wrote:


 Add new function that can take an array of iomux configs, an index, and
 a stride to allow a multi-dimentional array of pinmux values to be used
 to define pinmux values per cpu-type.

 This takes a different approach to previously proposed solutions which
 used
 multiple arrays of pad lists. The goal is to eliminate having these
 multiple
 arrays such as 'mx6q_uart1_pads' and 'mx6dl_uart1_pads' which are almost
 identical copies of each other except for the MX6Q/MX6DL prefix on the
 PAD.
>>>
>>>
>>>
>>> I like this approach, but I think you should also define the IOMUX,
>>> SETUP_PAD, and SETUP_PADS macros from patch 10 in this file, as they
>>> (macros and function) are clearly meant to be used together.
>>>
>>
>> I agree with this. Do the macro names IOMUX, SETUP_PAD, SETUP_PADS make
>> sense?
>>
>
> My suggestion would be MX6QDL_DDR_IOMUX, MX6QDL_DDR_SETUP_PADS, and
> MX6QDL_SETUP_PAD (this last one is not DDR specific).
>
>
> --
> Regards,
> Nikita.

Stefano,

You mentioned in another thread you had some remarks about my pinmux
proposal here? I'm anxious to post a v2 patch and keep this ball
rolling.

Thanks,

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


[U-Boot] [PATCH 3/4] power: Add support for LTC3676 PMIC

2014-04-22 Thread Tim Harvey
The LTC3676 PMIC includes four DC/DC converters, and three 300mA
LDO Regulators (two Adjustable). The DC/DC converters are adjustable based
on a resistor devider (board-specific).

This adds support for the LTC3676 by creating a namespace unique init function
that uses the PMIC API to allocate a pmic and defines the registers.

Signed-off-by: Tim Harvey 
---
 drivers/power/pmic/Makefile   |  1 +
 drivers/power/pmic/pmic_ltc3676.c | 32 
 include/power/ltc3676_pmic.h  | 51 +++
 3 files changed, 84 insertions(+)
 create mode 100644 drivers/power/pmic/pmic_ltc3676.c
 create mode 100644 include/power/ltc3676_pmic.h

diff --git a/drivers/power/pmic/Makefile b/drivers/power/pmic/Makefile
index 4129bda..920bbdc 100644
--- a/drivers/power/pmic/Makefile
+++ b/drivers/power/pmic/Makefile
@@ -5,6 +5,7 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
+obj-$(CONFIG_POWER_LTC3676) += pmic_ltc3676.o
 obj-$(CONFIG_POWER_MAX8998) += pmic_max8998.o
 obj-$(CONFIG_POWER_MAX8997) += pmic_max8997.o
 obj-$(CONFIG_POWER_MUIC_MAX8997) += muic_max8997.o
diff --git a/drivers/power/pmic/pmic_ltc3676.c 
b/drivers/power/pmic/pmic_ltc3676.c
new file mode 100644
index 000..9b874cb
--- /dev/null
+++ b/drivers/power/pmic/pmic_ltc3676.c
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2014 Gateworks Corporation
+ * Tim Harvey 
+ *
+ * SPDX-License-Identifier:  GPL-2.0+
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+int power_ltc3676_init(unsigned char bus)
+{
+   static const char name[] = "LTC3676_PMIC";
+   struct pmic *p = pmic_alloc();
+
+   if (!p) {
+   printf("%s: POWER allocation error!\n", __func__);
+   return -ENOMEM;
+   }
+
+   p->name = name;
+   p->interface = PMIC_I2C;
+   p->number_of_regs = LTC3676_NUM_OF_REGS;
+   p->hw.i2c.addr = CONFIG_POWER_LTC3676_I2C_ADDR;
+   p->hw.i2c.tx_num = 1;
+   p->bus = bus;
+
+   return 0;
+}
diff --git a/include/power/ltc3676_pmic.h b/include/power/ltc3676_pmic.h
new file mode 100644
index 000..dcaa985
--- /dev/null
+++ b/include/power/ltc3676_pmic.h
@@ -0,0 +1,51 @@
+/*
+ *  Copyright (C) 2014 Gateworks Corporation
+ *  Tim Harvey 
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#ifndef __LTC3676_PMIC_H_
+#define __LTC3676_PMIC_H_
+
+/* LTC3676 registers */
+enum {
+   LTC3676_BUCK1   = 0x01,
+   LTC3676_BUCK2   = 0x02,
+   LTC3676_BUCK3   = 0x03,
+   LTC3676_BUCK4   = 0x04,
+   LTC3676_LDOA= 0x05,
+   LTC3676_LDOB= 0x06,
+   LTC3676_SQD1= 0x07,
+   LTC3676_SQD2= 0x08,
+   LTC3676_CNTRL   = 0x09,
+   LTC3676_DVB1A   = 0x0A,
+   LTC3676_DVB1B   = 0x0B,
+   LTC3676_DVB2A   = 0x0C,
+   LTC3676_DVB2B   = 0x0D,
+   LTC3676_DVB3A   = 0x0E,
+   LTC3676_DVB3B   = 0x0F,
+   LTC3676_DVB4A   = 0x10,
+   LTC3676_DVB4B   = 0x11,
+   LTC3676_MSKIRQ  = 0x12,
+   LTC3676_MSKPG   = 0x13,
+   LTC3676_USER= 0x14,
+   LTC3676_HRST= 0x1E,
+   LTC3676_CLIRQ   = 0x1F,
+   LTC3676_IRQSTAT = 0x15,
+   LTC3676_PGSTATL = 0x16,
+   LTC3676_PGSTATR = 0x17,
+   LTC3676_NUM_OF_REGS = 0x20,
+};
+
+/*
+ * SW Configuration
+ */
+
+#define LTC3676_DVB_MASK   0x1f
+#define LTC3676_PGOOD_MASK (1<<5)
+#define LTC3676_REF_SELA   (0<<5)
+#define LTC3676_REF_SELB   (1<<5)
+
+int power_ltc3676_init(unsigned char bus);
+#endif
-- 
1.8.3.2

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


[U-Boot] [PATCH 2/4] ventana: use non-generic pfuze100 init

2014-04-22 Thread Tim Harvey
Signed-off-by: Tim Harvey 
---
 board/gateworks/gw_ventana/gw_ventana.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/board/gateworks/gw_ventana/gw_ventana.c 
b/board/gateworks/gw_ventana/gw_ventana.c
index c130e2c..48e90e0 100644
--- a/board/gateworks/gw_ventana/gw_ventana.c
+++ b/board/gateworks/gw_ventana/gw_ventana.c
@@ -1077,10 +1077,11 @@ int misc_init_r(void)
}
 
/* configure PFUZE100 PMIC (not used on all Ventana baseboards) */
-   if ((board_type == GW54xx || board_type == GW54proto) &&
-   !pmic_init(I2C_PMIC)) {
+   power_pfuze100_init(I2C_PMIC);
+   if (board_type == GW54xx || board_type == GW54proto) {
struct pmic *p = pmic_get("PFUZE100_PMIC");
u32 reg;
+
if (p && !pmic_probe(p)) {
pmic_reg_read(p, PFUZE100_DEVICEID, ®);
printf("PMIC:  PFUZE100 ID=0x%02x\n", reg);
-- 
1.8.3.2

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


[U-Boot] [PATCH 1/4] power: make pfuze100 be able to coexist with other pmics

2014-04-22 Thread Tim Harvey
Avoid uding pmic_init() as this forces the model of only allowing a
single PMIC driver to be built at a time.

Signed-off-by: Tim Harvey 
---
 drivers/power/pmic/pmic_pfuze100.c | 2 +-
 include/power/pfuze100_pmic.h  | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/power/pmic/pmic_pfuze100.c 
b/drivers/power/pmic/pmic_pfuze100.c
index 22c1f15..21f12d2 100644
--- a/drivers/power/pmic/pmic_pfuze100.c
+++ b/drivers/power/pmic/pmic_pfuze100.c
@@ -11,7 +11,7 @@
 #include 
 #include 
 
-int pmic_init(unsigned char bus)
+int power_pfuze100_init(unsigned char bus)
 {
static const char name[] = "PFUZE100_PMIC";
struct pmic *p = pmic_alloc();
diff --git a/include/power/pfuze100_pmic.h b/include/power/pfuze100_pmic.h
index 2a9032a..444aba6 100644
--- a/include/power/pfuze100_pmic.h
+++ b/include/power/pfuze100_pmic.h
@@ -93,4 +93,5 @@ enum {
 #define SWBST_MODE_AUTO(2 << 2)
 #define SWBST_MODE_APS (2 << 3)
 
+int power_pfuze100_init(unsigned char bus);
 #endif
-- 
1.8.3.2

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


[U-Boot] [PATCH 0/4] ventana: Add LTC3676 PMIC support

2014-04-22 Thread Tim Harvey
The Gateworks Ventana boards share much in common, but there are two differing
PMIC's used on them. This patch series adds a new PMIC driver for the LTC3676
and supports them both within the common board support file.

Signed-off-By: Tim Harvey 

Tim Harvey (4):
  power: make pfuze100 be able to coexist with other pmics
  ventana: use non-generic pfuze100 init
  power: Add support for LTC3676 PMIC
  ventana: Add support for the LTC3676 PMIC

 board/gateworks/gw_ventana/gw_ventana.c | 78 -
 drivers/power/pmic/Makefile |  1 +
 drivers/power/pmic/pmic_ltc3676.c   | 32 ++
 drivers/power/pmic/pmic_pfuze100.c  |  2 +-
 include/configs/gw_ventana.h|  2 +
 include/power/ltc3676_pmic.h| 51 +
 include/power/pfuze100_pmic.h   |  1 +
 7 files changed, 145 insertions(+), 22 deletions(-)
 create mode 100644 drivers/power/pmic/pmic_ltc3676.c
 create mode 100644 include/power/ltc3676_pmic.h

-- 
1.8.3.2

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


[U-Boot] [PATCH 4/4] [PATCH] ventana: Add support for the LTC3676 PMIC

2014-04-22 Thread Tim Harvey
The LTC3676 PMIC is used instead of the PFUZE100 PMIC on the
GW51xx/GW52xx/GW53xx Ventana baseboards. In order to support the IMX6Q SoC
at 1GHz on those baseboards, we need to adjust the voltage scaling for the SW1
and SW3 DC/DC converters on the LTC3676 for 1225mV. Note that the scalar
values for the LTC3676 are board-specific as they relate to a resistor devider
chosen by the board design.

Signed-off-by: Tim Harvey 
---
 board/gateworks/gw_ventana/gw_ventana.c | 79 -
 include/configs/gw_ventana.h|  2 +
 2 files changed, 59 insertions(+), 22 deletions(-)

diff --git a/board/gateworks/gw_ventana/gw_ventana.c 
b/board/gateworks/gw_ventana/gw_ventana.c
index 48e90e0..29fcebe 100644
--- a/board/gateworks/gw_ventana/gw_ventana.c
+++ b/board/gateworks/gw_ventana/gw_ventana.c
@@ -30,6 +30,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -733,6 +734,60 @@ struct ventana gpio_cfg[] = {
},
 };
 
+/* setup board specific PMIC */
+static void setup_board_pmic(int board)
+{
+   struct pmic *p;
+   u32 reg;
+
+   /* configure PFUZE100 PMIC */
+   if (board_type == GW54xx || board_type == GW54proto) {
+   power_pfuze100_init(I2C_PMIC);
+   p = pmic_get("PFUZE100_PMIC");
+   if (p && !pmic_probe(p)) {
+   pmic_reg_read(p, PFUZE100_DEVICEID, ®);
+   printf("PMIC:  PFUZE100 ID=0x%02x\n", reg);
+
+   /* Set VGEN1 to 1.5V and enable */
+   pmic_reg_read(p, PFUZE100_VGEN1VOL, ®);
+   reg &= ~(LDO_VOL_MASK);
+   reg |= (LDOA_1_50V | LDO_EN);
+   pmic_reg_write(p, PFUZE100_VGEN1VOL, reg);
+
+   /* Set SWBST to 5.0V and enable */
+   pmic_reg_read(p, PFUZE100_SWBSTCON1, ®);
+   reg &= ~(SWBST_MODE_MASK | SWBST_VOL_MASK);
+   reg |= (SWBST_5_00V | SWBST_MODE_AUTO);
+   pmic_reg_write(p, PFUZE100_SWBSTCON1, reg);
+   }
+   }
+
+   /* configure LTC3676 PMIC */
+   else {
+   power_ltc3676_init(I2C_PMIC);
+   p = pmic_get("LTC3676_PMIC");
+   if (p && !pmic_probe(p)) {
+   puts("PMIC:  LTC3676\n");
+   /* set board-specific scalar to 1225mV for IMX6Q@1GHz */
+   if (is_cpu_type(MXC_CPU_MX6Q)) {
+   /* mask PGOOD during SW1 transition */
+   reg = 0x1d | LTC3676_PGOOD_MASK;
+   pmic_reg_write(p, LTC3676_DVB1B, reg);
+   /* set SW1 (VDD_SOC) to 1259mV */
+   reg = 0x1d;
+   pmic_reg_write(p, LTC3676_DVB1A, reg);
+
+   /* mask PGOOD during SW3 transition */
+   reg = 0x1d | LTC3676_PGOOD_MASK;
+   pmic_reg_write(p, LTC3676_DVB3B, reg);
+   /*set SW3 (VDD_ARM) to 1259mV */
+   reg = 0x1d;
+   pmic_reg_write(p, LTC3676_DVB3A, reg);
+   }
+   }
+   }
+}
+
 /* setup GPIO pinmux and default configuration per baseboard */
 static void setup_board_gpio(int board)
 {
@@ -1076,29 +1131,9 @@ int misc_init_r(void)
setenv("serial#", str);
}
 
-   /* configure PFUZE100 PMIC (not used on all Ventana baseboards) */
-   power_pfuze100_init(I2C_PMIC);
-   if (board_type == GW54xx || board_type == GW54proto) {
-   struct pmic *p = pmic_get("PFUZE100_PMIC");
-   u32 reg;
-
-   if (p && !pmic_probe(p)) {
-   pmic_reg_read(p, PFUZE100_DEVICEID, ®);
-   printf("PMIC:  PFUZE100 ID=0x%02x\n", reg);
-
-   /* Set VGEN1 to 1.5V and enable */
-   pmic_reg_read(p, PFUZE100_VGEN1VOL, ®);
-   reg &= ~(LDO_VOL_MASK);
-   reg |= (LDOA_1_50V | LDO_EN);
-   pmic_reg_write(p, PFUZE100_VGEN1VOL, reg);
 
-   /* Set SWBST to 5.0V and enable */
-   pmic_reg_read(p, PFUZE100_SWBSTCON1, ®);
-   reg &= ~(SWBST_MODE_MASK | SWBST_VOL_MASK);
-   reg |= (SWBST_5_00V | SWBST_MODE_AUTO);
-   pmic_reg_write(p, PFUZE100_SWBSTCON1, reg);
-   }
-   }
+   /* setup pmic */
+   setup_board_pmic(board_type);
 
/* setup baseboard specific GPIO pinmux and config */
setup_board_gpio(board_type);
diff --git a/include/configs/gw_ventana.h b/include/configs/gw_ventana.h
index 3398390..b984f27 100644
--- a/include/configs/gw_ventana.h
+++ b/include/configs/gw_ventana.h
@@ -136,6 +136,8 @@
 #define

Re: [U-Boot] [PATCH] powerpc/mpc85xx: Remove QE firmware copy from NAND

2014-04-22 Thread Prabhakar Kushwaha


On 4/23/2014 1:01 AM, Scott Wood wrote:

On Mon, 2014-04-21 at 10:46 +0530, Prabhakar Kushwaha wrote:

qe_init() does not use data copied from NAND. Thise code is not tested or
complied causing compilation error during NAND boot

So, remove QE firmware copy from NAND to ddr.

Signed-off-by: Prabhakar Kushwaha 

Where does the QE firmware come from when booting from NAND?




QE firmware load from NAND is currently not being supported.

Even if it is supported, cpu_init.c file should not  have code of 
loading QE firmware.


-prabhakar


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


[U-Boot] [PATCH 6/6] ARM: tegra: update Venice2 pinmux

2014-04-22 Thread Stephen Warren
From: Stephen Warren 

This re-imports the entire Venice2 pinmux data from the board's master
spreadsheet, and makes use of the new IO clamping GPIO initialization
table features. This makes the board port fully compliant with the
required HW-defined pinmux initialization sequence.

Signed-off-by: Stephen Warren 
---
 board/nvidia/venice2/pinmux-config-venice2.h | 563 ---
 board/nvidia/venice2/venice2.c   |  19 +-
 2 files changed, 266 insertions(+), 316 deletions(-)

diff --git a/board/nvidia/venice2/pinmux-config-venice2.h 
b/board/nvidia/venice2/pinmux-config-venice2.h
index 2f79ec75237e..05f3dab89dcd 100644
--- a/board/nvidia/venice2/pinmux-config-venice2.h
+++ b/board/nvidia/venice2/pinmux-config-venice2.h
@@ -1,76 +1,282 @@
 /*
- * (C) Copyright 2013
- * NVIDIA Corporation 
+ * Copyright (c) 2013-2014, NVIDIA CORPORATION. All rights reserved.
  *
- * SPDX-License-Identifier: GPL-2.0+
+ * SPDX-License-Identifier: GPL-2.0+
  */
 
 #ifndef _PINMUX_CONFIG_VENICE2_H_
 #define _PINMUX_CONFIG_VENICE2_H_
 
-#define DEFAULT_PINMUX(_pingrp, _mux, _pull, _tri, _io)\
-   {   \
-   .pingrp = PMUX_PINGRP_##_pingrp,\
-   .func   = PMUX_FUNC_##_mux, \
-   .pull   = PMUX_PULL_##_pull,\
-   .tristate   = PMUX_TRI_##_tri,  \
-   .io = PMUX_PIN_##_io,   \
-   .lock   = PMUX_PIN_LOCK_DEFAULT,\
-   .od = PMUX_PIN_OD_DEFAULT,  \
-   .ioreset= PMUX_PIN_IO_RESET_DEFAULT,\
+#define GPIO_INIT(_gpio, _init)\
+   {   \
+   .gpio   = GPIO_P##_gpio,\
+   .init   = TEGRA_GPIO_INIT_##_init,  \
}
 
-#define I2C_PINMUX(_pingrp, _mux, _pull, _tri, _io, _lock, _od)\
-   {   \
-   .pingrp = PMUX_PINGRP_##_pingrp,\
-   .func   = PMUX_FUNC_##_mux, \
-   .pull   = PMUX_PULL_##_pull,\
-   .tristate   = PMUX_TRI_##_tri,  \
-   .io = PMUX_PIN_##_io,   \
-   .lock   = PMUX_PIN_LOCK_##_lock,\
-   .od = PMUX_PIN_OD_##_od,\
-   .ioreset= PMUX_PIN_IO_RESET_DEFAULT,\
-   }
+static const struct tegra_gpio_config venice2_gpio_inits[] = {
+   /*gpio, init_val */
+   GPIO_INIT(A0,   IN),
+   GPIO_INIT(C7,   IN),
+   GPIO_INIT(G0,   IN),
+   GPIO_INIT(G1,   IN),
+   GPIO_INIT(G2,   IN),
+   GPIO_INIT(G3,   IN),
+   GPIO_INIT(H2,   IN),
+   GPIO_INIT(H4,   IN),
+   GPIO_INIT(H5,   OUT0),
+   GPIO_INIT(H6,   IN),
+   GPIO_INIT(H7,   OUT1),
+   GPIO_INIT(I0,   IN),
+   GPIO_INIT(I1,   IN),
+   GPIO_INIT(I2,   OUT0),
+   GPIO_INIT(I4,   OUT0),
+   GPIO_INIT(I6,   IN),
+   GPIO_INIT(J0,   IN),
+   GPIO_INIT(J7,   IN),
+   GPIO_INIT(K0,   IN),
+   GPIO_INIT(K1,   OUT0),
+   GPIO_INIT(K2,   IN),
+   GPIO_INIT(K3,   IN),
+   GPIO_INIT(K4,   OUT0),
+   GPIO_INIT(K6,   OUT0),
+   GPIO_INIT(K7,   IN),
+   GPIO_INIT(N7,   IN),
+   GPIO_INIT(O2,   IN),
+   GPIO_INIT(O5,   IN),
+   GPIO_INIT(O6,   OUT0),
+   GPIO_INIT(O7,   IN),
+   GPIO_INIT(P2,   OUT0),
+   GPIO_INIT(Q0,   IN),
+   GPIO_INIT(Q3,   IN),
+   GPIO_INIT(R0,   OUT0),
+   GPIO_INIT(R1,   IN),
+   GPIO_INIT(R4,   IN),
+   GPIO_INIT(S0,   IN),
+   GPIO_INIT(S3,   OUT0),
+   GPIO_INIT(S4,   OUT0),
+   GPIO_INIT(S7,   IN),
+   GPIO_INIT(T1,   IN),
+   GPIO_INIT(U4,   IN),
+   GPIO_INIT(U5,   IN),
+   GPIO_INIT(U6,   IN),
+   GPIO_INIT(V0,   IN),
+   GPIO_INIT(V1,   IN),
+   GPIO_INIT(W3,   IN),
+   GPIO_INIT(X1,   IN),
+   GPIO_INIT(X3,   IN),
+   GPIO_INIT(X4,   IN),
+   GPIO_INIT(X7,   OUT0),
+   GPIO_INIT(CC5,  OUT0),
+};
 
-#define DDC_PINMUX(_pingrp, _mux, _pull, _tri, _io, _lock, _rcv_sel) \
+#define PINCFG(_pingrp, _mux, _pull, _tri, _io, _od, _rcv_sel) \
{   \
.pingrp = PMUX_PINGRP_##_pingrp,\
.func   = PMUX_FUNC_##_mux, \
.pull   = PMUX_PULL_##_pull,\
.tristate   = PMUX_TRI_##_tri,  \
.io = PMUX_PIN_##_io,   \
-   .lock   = PMUX_PIN_LOCK_##_lock,\
+   .od = PMUX_PIN_OD_##_od,\
.rcv_sel=

[U-Boot] [PATCH 1/6] ARM: tegra: allow pinmux mux option not to be set by init tables

2014-04-22 Thread Stephen Warren
From: Stephen Warren 

Define enum PMUX_FUNC_DEFAULT, which indicates that a table entry passed
to pinmux_config_pingrp()/pinmux_config_pingrp_table() shouldn't change
the mux option in HW.

For pins that will be used as GPIOs, the mux option is irrelevant, so we
simply don't want to define any mux option in the pinmux initialization
table.

Signed-off-by: Stephen Warren 
---
 arch/arm/cpu/tegra-common/pinmux-common.c   | 3 +++
 arch/arm/include/asm/arch-tegra114/pinmux.h | 1 +
 arch/arm/include/asm/arch-tegra124/pinmux.h | 1 +
 arch/arm/include/asm/arch-tegra20/pinmux.h  | 1 +
 arch/arm/include/asm/arch-tegra30/pinmux.h  | 1 +
 5 files changed, 7 insertions(+)

diff --git a/arch/arm/cpu/tegra-common/pinmux-common.c 
b/arch/arm/cpu/tegra-common/pinmux-common.c
index d62618cd0f61..6d7a7d907b16 100644
--- a/arch/arm/cpu/tegra-common/pinmux-common.c
+++ b/arch/arm/cpu/tegra-common/pinmux-common.c
@@ -92,6 +92,9 @@ void pinmux_set_func(enum pmux_pingrp pin, enum pmux_func 
func)
int i, mux = -1;
u32 val;
 
+   if (func == PMUX_FUNC_DEFAULT)
+   return;
+
/* Error check on pin and func */
assert(pmux_pingrp_isvalid(pin));
assert(pmux_func_isvalid(func));
diff --git a/arch/arm/include/asm/arch-tegra114/pinmux.h 
b/arch/arm/include/asm/arch-tegra114/pinmux.h
index c1cb3ef16b1a..b86562ac6dee 100644
--- a/arch/arm/include/asm/arch-tegra114/pinmux.h
+++ b/arch/arm/include/asm/arch-tegra114/pinmux.h
@@ -231,6 +231,7 @@ enum pmux_drvgrp {
 };
 
 enum pmux_func {
+   PMUX_FUNC_DEFAULT,
PMUX_FUNC_BLINK,
PMUX_FUNC_CEC,
PMUX_FUNC_CLDVFS,
diff --git a/arch/arm/include/asm/arch-tegra124/pinmux.h 
b/arch/arm/include/asm/arch-tegra124/pinmux.h
index c49801c21d07..1884935a579e 100644
--- a/arch/arm/include/asm/arch-tegra124/pinmux.h
+++ b/arch/arm/include/asm/arch-tegra124/pinmux.h
@@ -247,6 +247,7 @@ enum pmux_drvgrp {
 };
 
 enum pmux_func {
+   PMUX_FUNC_DEFAULT,
PMUX_FUNC_BLINK,
PMUX_FUNC_CCLA,
PMUX_FUNC_CEC,
diff --git a/arch/arm/include/asm/arch-tegra20/pinmux.h 
b/arch/arm/include/asm/arch-tegra20/pinmux.h
index 11c0104ff3e0..f7bc97fe5f73 100644
--- a/arch/arm/include/asm/arch-tegra20/pinmux.h
+++ b/arch/arm/include/asm/arch-tegra20/pinmux.h
@@ -166,6 +166,7 @@ enum pmux_pingrp {
  * purely a convenience. The translation is done through a table search.
  */
 enum pmux_func {
+   PMUX_FUNC_DEFAULT,
PMUX_FUNC_AHB_CLK,
PMUX_FUNC_APB_CLK,
PMUX_FUNC_AUDIO_SYNC,
diff --git a/arch/arm/include/asm/arch-tegra30/pinmux.h 
b/arch/arm/include/asm/arch-tegra30/pinmux.h
index 6d83061dc1e9..a42e00990f0c 100644
--- a/arch/arm/include/asm/arch-tegra30/pinmux.h
+++ b/arch/arm/include/asm/arch-tegra30/pinmux.h
@@ -306,6 +306,7 @@ enum pmux_drvgrp {
 };
 
 enum pmux_func {
+   PMUX_FUNC_DEFAULT,
PMUX_FUNC_BLINK,
PMUX_FUNC_CEC,
PMUX_FUNC_CLK_12M_OUT,
-- 
1.8.1.5

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


[U-Boot] [PATCH 5/6] ARM: tegra: clamp inputs on Jetson TK1

2014-04-22 Thread Stephen Warren
From: Stephen Warren 

The HW-defined procedure for booting Tegra requires that
CLAMP_INPUTS_WHEN_TRISTATED be enabled before programming the pinmux.
Modify the Jetson TK1 board to do this.

Signed-off-by: Stephen Warren 
---
 board/nvidia/jetson-tk1/jetson-tk1.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/board/nvidia/jetson-tk1/jetson-tk1.c 
b/board/nvidia/jetson-tk1/jetson-tk1.c
index 9c54bd64c479..5d37718f3b89 100644
--- a/board/nvidia/jetson-tk1/jetson-tk1.c
+++ b/board/nvidia/jetson-tk1/jetson-tk1.c
@@ -16,6 +16,8 @@
  */
 void pinmux_init(void)
 {
+   pinmux_set_tristate_input_clamping();
+
gpio_config_table(jetson_tk1_gpio_inits,
  ARRAY_SIZE(jetson_tk1_gpio_inits));
 
-- 
1.8.1.5

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


[U-Boot] [PATCH 2/6] ARM: tegra: add GPIO initialization table function

2014-04-22 Thread Stephen Warren
From: Stephen Warren 

The HW-defined procedure for booting Tegra requires that some pins be
set up as GPIOs immediately at boot in order to avoid glitches on those
pins, when the pinmux is programmed. Add a feature to the GPIO driver
which executes a GPIO configuration table. Board files will use this to
implement the correct HW initialization procedure.

Signed-off-by: Stephen Warren 
---
 arch/arm/include/asm/arch-tegra/gpio.h | 20 
 drivers/gpio/tegra_gpio.c  | 20 
 2 files changed, 40 insertions(+)

diff --git a/arch/arm/include/asm/arch-tegra/gpio.h 
b/arch/arm/include/asm/arch-tegra/gpio.h
index d97190dd7cf5..44cd455699e7 100644
--- a/arch/arm/include/asm/arch-tegra/gpio.h
+++ b/arch/arm/include/asm/arch-tegra/gpio.h
@@ -14,11 +14,31 @@
 #define GPIO_FULLPORT(x)   ((x) >> 3)
 #define GPIO_BIT(x)((x) & 0x7)
 
+enum tegra_gpio_init {
+   TEGRA_GPIO_INIT_IN,
+   TEGRA_GPIO_INIT_OUT0,
+   TEGRA_GPIO_INIT_OUT1,
+};
+
+struct tegra_gpio_config {
+   u32 gpio:16;
+   u32 init:2;
+};
+
 /*
  * Tegra-specific GPIO API
  */
 
+/**
+ * Configure a list of GPIOs
+ *
+ * @param config   List of GPIO configurations
+ * @param len  Number of config items in list
+ */
+void gpio_config_table(const struct tegra_gpio_config *config, int len);
+
 void gpio_info(void);
 
 #define gpio_status()  gpio_info()
+
 #endif /* TEGRA_GPIO_H_ */
diff --git a/drivers/gpio/tegra_gpio.c b/drivers/gpio/tegra_gpio.c
index 82b30d5ab682..fea9d17f8e62 100644
--- a/drivers/gpio/tegra_gpio.c
+++ b/drivers/gpio/tegra_gpio.c
@@ -221,6 +221,26 @@ int gpio_set_value(unsigned gpio, int value)
return 0;
 }
 
+void gpio_config_table(const struct tegra_gpio_config *config, int len)
+{
+   int i;
+
+   for (i = 0; i < len; i++) {
+   switch (config[i].init) {
+   case TEGRA_GPIO_INIT_IN:
+   gpio_direction_input(config[i].gpio);
+   break;
+   case TEGRA_GPIO_INIT_OUT0:
+   gpio_direction_output(config[i].gpio, 0);
+   break;
+   case TEGRA_GPIO_INIT_OUT1:
+   gpio_direction_output(config[i].gpio, 1);
+   break;
+   }
+   set_config(config[i].gpio, 1);
+   }
+}
+
 /*
  * Display Tegra GPIO information
  */
-- 
1.8.1.5

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


[U-Boot] [PATCH 4/6] ARM: tegra: make use of GPIO init table on Jetson TK1

2014-04-22 Thread Stephen Warren
From: Stephen Warren 

The HW-defined procedure for booting Tegra requires that some pins be
set up as GPIOs immediately at boot in order to avoid glitches on those
pins, when the pinmux is programmed. This patch implements this
procedure for Jetson TK1. For pins which are to be used as GPIOs, the
pinmux mux function need not be programmed, so the pinmux table is also
adjusted.

Signed-off-by: Stephen Warren 
---
 board/nvidia/jetson-tk1/jetson-tk1.c   |   4 +
 board/nvidia/jetson-tk1/pinmux-config-jetson-tk1.h | 256 ++---
 2 files changed, 178 insertions(+), 82 deletions(-)

diff --git a/board/nvidia/jetson-tk1/jetson-tk1.c 
b/board/nvidia/jetson-tk1/jetson-tk1.c
index f97aafad422b..9c54bd64c479 100644
--- a/board/nvidia/jetson-tk1/jetson-tk1.c
+++ b/board/nvidia/jetson-tk1/jetson-tk1.c
@@ -6,6 +6,7 @@
  */
 
 #include 
+#include 
 #include 
 #include "pinmux-config-jetson-tk1.h"
 
@@ -15,6 +16,9 @@
  */
 void pinmux_init(void)
 {
+   gpio_config_table(jetson_tk1_gpio_inits,
+ ARRAY_SIZE(jetson_tk1_gpio_inits));
+
pinmux_config_pingrp_table(jetson_tk1_pingrps,
   ARRAY_SIZE(jetson_tk1_pingrps));
 
diff --git a/board/nvidia/jetson-tk1/pinmux-config-jetson-tk1.h 
b/board/nvidia/jetson-tk1/pinmux-config-jetson-tk1.h
index 1adcae4bdded..d338818a64eb 100644
--- a/board/nvidia/jetson-tk1/pinmux-config-jetson-tk1.h
+++ b/board/nvidia/jetson-tk1/pinmux-config-jetson-tk1.h
@@ -7,6 +7,98 @@
 #ifndef _PINMUX_CONFIG_JETSON_TK1_H_
 #define _PINMUX_CONFIG_JETSON_TK1_H_
 
+#define GPIO_INIT(_gpio, _init)\
+   {   \
+   .gpio   = GPIO_P##_gpio,\
+   .init   = TEGRA_GPIO_INIT_##_init,  \
+   }
+
+static const struct tegra_gpio_config jetson_tk1_gpio_inits[] = {
+   /*gpio, init_val */
+   GPIO_INIT(C7,   IN),
+   GPIO_INIT(G0,   OUT0),
+   GPIO_INIT(G1,   OUT0),
+   GPIO_INIT(G2,   IN),
+   GPIO_INIT(G3,   IN),
+   GPIO_INIT(H2,   OUT0),
+   GPIO_INIT(H3,   OUT0),
+   GPIO_INIT(H4,   IN),
+   GPIO_INIT(H5,   OUT0),
+   GPIO_INIT(H6,   IN),
+   GPIO_INIT(H7,   OUT0),
+   GPIO_INIT(I0,   OUT0),
+   GPIO_INIT(I2,   OUT0),
+   GPIO_INIT(I4,   OUT0),
+   GPIO_INIT(I5,   IN),
+   GPIO_INIT(I6,   IN),
+   GPIO_INIT(J0,   IN),
+   GPIO_INIT(J2,   IN),
+   GPIO_INIT(K1,   OUT0),
+   GPIO_INIT(K2,   IN),
+   GPIO_INIT(K3,   IN),
+   GPIO_INIT(K4,   OUT0),
+   GPIO_INIT(K5,   OUT0),
+   GPIO_INIT(K6,   OUT0),
+   GPIO_INIT(N7,   IN),
+   GPIO_INIT(O0,   IN),
+   GPIO_INIT(O1,   IN),
+   GPIO_INIT(O2,   IN),
+   GPIO_INIT(O3,   IN),
+   GPIO_INIT(O4,   IN),
+   GPIO_INIT(O5,   IN),
+   GPIO_INIT(O6,   OUT0),
+   GPIO_INIT(O7,   IN),
+   GPIO_INIT(P0,   OUT0),
+   GPIO_INIT(P1,   OUT0),
+   GPIO_INIT(P2,   OUT0),
+   GPIO_INIT(Q0,   IN),
+   GPIO_INIT(Q1,   IN),
+   GPIO_INIT(Q2,   IN),
+   GPIO_INIT(Q5,   IN),
+   GPIO_INIT(Q6,   IN),
+   GPIO_INIT(Q7,   IN),
+   GPIO_INIT(R0,   OUT0),
+   GPIO_INIT(R1,   OUT0),
+   GPIO_INIT(R2,   OUT0),
+   GPIO_INIT(R4,   IN),
+   GPIO_INIT(R5,   OUT0),
+   GPIO_INIT(R7,   IN),
+   GPIO_INIT(S0,   IN),
+   GPIO_INIT(S3,   OUT0),
+   GPIO_INIT(S4,   OUT0),
+   GPIO_INIT(S5,   IN),
+   GPIO_INIT(S6,   OUT0),
+   GPIO_INIT(T0,   OUT0),
+   GPIO_INIT(T1,   OUT0),
+   GPIO_INIT(U0,   OUT0),
+   GPIO_INIT(U1,   IN),
+   GPIO_INIT(U2,   IN),
+   GPIO_INIT(U3,   OUT0),
+   GPIO_INIT(U4,   OUT0),
+   GPIO_INIT(U5,   IN),
+   GPIO_INIT(U6,   IN),
+   GPIO_INIT(V0,   IN),
+   GPIO_INIT(V1,   IN),
+   GPIO_INIT(W2,   IN),
+   GPIO_INIT(W3,   IN),
+   GPIO_INIT(X1,   OUT0),
+   GPIO_INIT(X3,   IN),
+   GPIO_INIT(X4,   OUT0),
+   GPIO_INIT(X5,   IN),
+   GPIO_INIT(X6,   IN),
+   GPIO_INIT(X7,   OUT0),
+   GPIO_INIT(BB3,  OUT0),
+   GPIO_INIT(BB5,  OUT0),
+   GPIO_INIT(BB6,  OUT0),
+   GPIO_INIT(BB7,  OUT0),
+   GPIO_INIT(CC1,  IN),
+   GPIO_INIT(CC2,  IN),
+   GPIO_INIT(CC5,  OUT0),
+   GPIO_INIT(EE1,  OUT0),
+   GPIO_INIT(FF1,  OUT0),
+   GPIO_INIT(FF2,  IN),
+};
+
 #define PINCFG(_pingrp, _mux, _pull, _tri, _io, _od, _rcv_sel) \
{   \
.pingrp = PMUX_PINGRP_##_pingrp,\
@@ -41,43 +133,43 @@ static const struct pmux_pingrp_config 
jetson_tk1_pingrps[] = {
PINCFG(UART2_RXD_PC3,  IRDA, UP, NORMAL,   INPUT,   
DEFAULT, DEFAULT),
PINCFG(GEN1_I2C_SCL_PC4,   I2C1, NORMAL, NORMAL,   INPUT,   
ENABLE,  DEFAULT),
PINCFG(GEN1_I2C_SDA_PC5,   I2C1, NORMAL, NORMAL,   INPUT,   
ENABLE,  DEFAULT),
-   PINCFG(PC7,

[U-Boot] [PATCH 3/6] ARM: tegra: add function to enable input clamping on tristate

2014-04-22 Thread Stephen Warren
From: Stephen Warren 

The HW-defined procedure for booting Tegra requires that
CLAMP_INPUTS_WHEN_TRISTATED be enabled before programming the pinmux.
Add a function to the pinmux driver to allow boards to do this.

Signed-off-by: Stephen Warren 
---
 arch/arm/cpu/tegra-common/pinmux-common.c | 16 
 arch/arm/include/asm/arch-tegra/pinmux.h  |  5 +
 2 files changed, 21 insertions(+)

diff --git a/arch/arm/cpu/tegra-common/pinmux-common.c 
b/arch/arm/cpu/tegra-common/pinmux-common.c
index 6d7a7d907b16..6e3ab0c14ca2 100644
--- a/arch/arm/cpu/tegra-common/pinmux-common.c
+++ b/arch/arm/cpu/tegra-common/pinmux-common.c
@@ -86,6 +86,22 @@
 #define IO_RESET_SHIFT 8
 #define RCV_SEL_SHIFT  9
 
+#if !defined(CONFIG_TEGRA20) && !defined(CONFIG_TEGRA30)
+/* This register/field only exists on Tegra114 and later */
+#define APB_MISC_PP_PINMUX_GLOBAL_0 0x40
+#define CLAMP_INPUTS_WHEN_TRISTATED 1
+
+void pinmux_set_tristate_input_clamping(void)
+{
+   u32 *reg = _R(APB_MISC_PP_PINMUX_GLOBAL_0);
+   u32 val;
+
+   val = readl(reg);
+   val |= CLAMP_INPUTS_WHEN_TRISTATED;
+   writel(val, reg);
+}
+#endif
+
 void pinmux_set_func(enum pmux_pingrp pin, enum pmux_func func)
 {
u32 *reg = MUX_REG(pin);
diff --git a/arch/arm/include/asm/arch-tegra/pinmux.h 
b/arch/arm/include/asm/arch-tegra/pinmux.h
index 035159d66537..da477697bf02 100644
--- a/arch/arm/include/asm/arch-tegra/pinmux.h
+++ b/arch/arm/include/asm/arch-tegra/pinmux.h
@@ -80,6 +80,11 @@ struct pmux_pingrp_config {
 #endif
 };
 
+#if !defined(CONFIG_TEGRA20) && !defined(CONFIG_TEGRA30)
+/* Set the pinmux CLAMP_INPUTS_WHEN_TRISTATED bit */
+void pinmux_set_tristate_input_clamping(void);
+#endif
+
 /* Set the mux function for a pin group */
 void pinmux_set_func(enum pmux_pingrp pin, enum pmux_func func);
 
-- 
1.8.1.5

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


Re: [U-Boot] [PATCH] powerpc/mpc85xx: Remove QE firmware copy from NAND

2014-04-22 Thread Scott Wood
On Mon, 2014-04-21 at 10:46 +0530, Prabhakar Kushwaha wrote:
> qe_init() does not use data copied from NAND. Thise code is not tested or
> complied causing compilation error during NAND boot
> 
> So, remove QE firmware copy from NAND to ddr.
> 
> Signed-off-by: Prabhakar Kushwaha 

Where does the QE firmware come from when booting from NAND?

-Scott


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


Re: [U-Boot] [PATCH 1/2] mtd: denali: improve nand_read_oob and fix nand_write_oob

2014-04-22 Thread Scott Wood
On Tue, 2014-04-22 at 10:04 +0900, Masahiro Yamada wrote:
> Hi Scott,
> 
> 
> > > It is really really painful to wait more than 10 seconds just for bad 
> > > block
> > > scanning to boot Linux.
> > 
> > Making bad block scans faster is a good thing, but why do you need to
> > scan them just to boot Linux?  Aren't you using an on-flash BBT?
> 
> I did not know that.
> I thought all blocks must be scanned.
> 
> Could you teach me the better way?

If you use NAND_BBT_USE_FLASH, and NAND_BBT_CREATE is present in the bbt
descriptor (this is true of the default descriptors), then the scanning
should only need to happen on first use.  On subsequent boots only the
bad block table should need to be read.

-Scott


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


Re: [U-Boot] [PATCH] doc: README.generic-board: Fix typo

2014-04-22 Thread Simon Glass
On 22 April 2014 12:45, Fabio Estevam  wrote:
> Signed-off-by: Fabio Estevam 
> ---
>  doc/README.generic-board | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/doc/README.generic-board b/doc/README.generic-board
> index 50d3a26..17da0b9 100644
> --- a/doc/README.generic-board
> +++ b/doc/README.generic-board
> @@ -17,7 +17,7 @@ architecture-specific board.c file before October 2014.
>  Background
>  --
>
> -U-Boot has tranditionally had a board.c file for each architecture. This has
> +U-Boot has traditionally had a board.c file for each architecture. This has
>  introduced quite a lot of duplication, with each architecture tending to do
>  initialisation slightly differently. To address this, a new 'generic board
>  init' feature was introduced a year ago in March 2013 (further motivation is

Thanks.

Acked-by: Simon Glass 

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


[U-Boot] [PATCH 6/8] mx53evk: Convert to generic board

2014-04-22 Thread Fabio Estevam
Enable CONFIG_SYS_GENERIC_BOARD, so that we get rid of the following warning on
boot:

"Warning: Your board does not use generic board. Please read
 
doc/README.generic-board and take action. Boards not
upgraded by the late 2014 may break or be removed."

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

diff --git a/include/configs/mx53evk.h b/include/configs/mx53evk.h
index 3f0d80a..5bbae8c 100644
--- a/include/configs/mx53evk.h
+++ b/include/configs/mx53evk.h
@@ -23,6 +23,8 @@
 #define CONFIG_INITRD_TAG
 #define CONFIG_REVISION_TAG
 
+#define CONFIG_SYS_GENERIC_BOARD
+
 #define CONFIG_OF_LIBFDT
 
 /* Size of malloc() pool */
-- 
1.8.3.2

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


[U-Boot] [PATCH 4/8] mx53ard: Convert to generic board

2014-04-22 Thread Fabio Estevam
Enable CONFIG_SYS_GENERIC_BOARD, so that we get rid of the following warning on
boot:

"Warning: Your board does not use generic board. Please read
 
doc/README.generic-board and take action. Boards not
upgraded by the late 2014 may break or be removed."

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

diff --git a/include/configs/mx53ard.h b/include/configs/mx53ard.h
index 797a637..134d680 100644
--- a/include/configs/mx53ard.h
+++ b/include/configs/mx53ard.h
@@ -23,6 +23,8 @@
 #define CONFIG_INITRD_TAG
 #define CONFIG_REVISION_TAG
 
+#define CONFIG_SYS_GENERIC_BOARD
+
 /* Size of malloc() pool */
 #define CONFIG_SYS_MALLOC_LEN  (CONFIG_ENV_SIZE + 2 * 1024 * 1024)
 
-- 
1.8.3.2

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


[U-Boot] [PATCH 2/8] mx53loco: Convert to generic board

2014-04-22 Thread Fabio Estevam
Enable CONFIG_SYS_GENERIC_BOARD, so that we get rid of the following warning on
boot:

"Warning: Your board does not use generic board. Please read
 
doc/README.generic-board and take action. Boards not
upgraded by the late 2014 may break or be removed."

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

diff --git a/include/configs/mx53loco.h b/include/configs/mx53loco.h
index 5859f36..12d79b4 100644
--- a/include/configs/mx53loco.h
+++ b/include/configs/mx53loco.h
@@ -22,6 +22,8 @@
 #define CONFIG_SETUP_MEMORY_TAGS
 #define CONFIG_INITRD_TAG
 
+#define CONFIG_SYS_GENERIC_BOARD
+
 /* Size of malloc() pool */
 #define CONFIG_SYS_MALLOC_LEN  (10 * 1024 * 1024)
 
-- 
1.8.3.2

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


[U-Boot] [PATCH 7/8] udoo: Convert to generic board

2014-04-22 Thread Fabio Estevam
Enable CONFIG_SYS_GENERIC_BOARD, so that we get rid of the following warning on
boot:

"Warning: Your board does not use generic board. Please read
 
doc/README.generic-board and take action. Boards not
upgraded by the late 2014 may break or be removed."

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

diff --git a/include/configs/udoo.h b/include/configs/udoo.h
index a0306de..f8f731a 100644
--- a/include/configs/udoo.h
+++ b/include/configs/udoo.h
@@ -25,6 +25,8 @@
 #define CONFIG_SETUP_MEMORY_TAGS
 #define CONFIG_INITRD_TAG
 #define CONFIG_REVISION_TAG
+
+#define CONFIG_SYS_GENERIC_BOARD
 
 /* Size of malloc() pool */
 #define CONFIG_SYS_MALLOC_LEN  (2 * SZ_1M)
-- 
1.8.3.2

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


[U-Boot] [PATCH 5/8] mx53smd: Convert to generic board

2014-04-22 Thread Fabio Estevam
Enable CONFIG_SYS_GENERIC_BOARD, so that we get rid of the following warning on
boot:

"Warning: Your board does not use generic board. Please read
 
doc/README.generic-board and take action. Boards not
upgraded by the late 2014 may break or be removed."

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

diff --git a/include/configs/mx53smd.h b/include/configs/mx53smd.h
index a04e7c7..3da0ef4 100644
--- a/include/configs/mx53smd.h
+++ b/include/configs/mx53smd.h
@@ -23,6 +23,8 @@
 #define CONFIG_INITRD_TAG
 #define CONFIG_REVISION_TAG
 
+#define CONFIG_SYS_GENERIC_BOARD
+
 /* Size of malloc() pool */
 #define CONFIG_SYS_MALLOC_LEN  (CONFIG_ENV_SIZE + 2 * 1024 * 1024)
 
-- 
1.8.3.2

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


[U-Boot] [PATCH 1/8] wandboard: Convert to generic board

2014-04-22 Thread Fabio Estevam
Enable CONFIG_SYS_GENERIC_BOARD, so that we get rid of the following warning on
boot:

"Warning: Your board does not use generic board. Please read
 
doc/README.generic-board and take action. Boards not
upgraded by the late 2014 may break or be removed."

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

diff --git a/include/configs/wandboard.h b/include/configs/wandboard.h
index 6c74c72..b137d06 100644
--- a/include/configs/wandboard.h
+++ b/include/configs/wandboard.h
@@ -26,6 +26,8 @@
 #define CONFIG_INITRD_TAG
 #define CONFIG_REVISION_TAG
 
+#define CONFIG_SYS_GENERIC_BOARD
+
 /* Size of malloc() pool */
 #define CONFIG_SYS_MALLOC_LEN  (10 * SZ_1M)
 
-- 
1.8.3.2

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


[U-Boot] [PATCH 3/8] mx6sabre_common: Convert to generic board

2014-04-22 Thread Fabio Estevam
Enable CONFIG_SYS_GENERIC_BOARD, so that we get rid of the following warning on
boot:

"Warning: Your board does not use generic board. Please read
 
doc/README.generic-board and take action. Boards not
upgraded by the late 2014 may break or be removed."

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

diff --git a/include/configs/mx6sabre_common.h 
b/include/configs/mx6sabre_common.h
index 7a2c172..e59a3b4 100644
--- a/include/configs/mx6sabre_common.h
+++ b/include/configs/mx6sabre_common.h
@@ -25,6 +25,8 @@
 #define CONFIG_INITRD_TAG
 #define CONFIG_REVISION_TAG
 
+#define CONFIG_SYS_GENERIC_BOARD
+
 /* Size of malloc() pool */
 #define CONFIG_SYS_MALLOC_LEN  (10 * SZ_1M)
 
-- 
1.8.3.2

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


[U-Boot] [PATCH 8/8] hummingboard: Convert to generic board

2014-04-22 Thread Fabio Estevam
Enable CONFIG_SYS_GENERIC_BOARD, so that we get rid of the following warning on
boot:

"Warning: Your board does not use generic board. Please read
 
doc/README.generic-board and take action. Boards not
upgraded by the late 2014 may break or be removed."

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

diff --git a/include/configs/hummingboard.h b/include/configs/hummingboard.h
index 2895523..34dbdce 100644
--- a/include/configs/hummingboard.h
+++ b/include/configs/hummingboard.h
@@ -27,6 +27,8 @@
 #define CONFIG_INITRD_TAG
 #define CONFIG_REVISION_TAG
 
+#define CONFIG_SYS_GENERIC_BOARD
+
 /* Size of malloc() pool */
 #define CONFIG_SYS_MALLOC_LEN  (2 * SZ_1M)
 
-- 
1.8.3.2

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


[U-Boot] [PATCH] doc: README.generic-board: Fix typo

2014-04-22 Thread Fabio Estevam
Signed-off-by: Fabio Estevam 
---
 doc/README.generic-board | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/README.generic-board b/doc/README.generic-board
index 50d3a26..17da0b9 100644
--- a/doc/README.generic-board
+++ b/doc/README.generic-board
@@ -17,7 +17,7 @@ architecture-specific board.c file before October 2014.
 Background
 --
 
-U-Boot has tranditionally had a board.c file for each architecture. This has
+U-Boot has traditionally had a board.c file for each architecture. This has
 introduced quite a lot of duplication, with each architecture tending to do
 initialisation slightly differently. To address this, a new 'generic board
 init' feature was introduced a year ago in March 2013 (further motivation is
-- 
1.8.3.2

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


Re: [U-Boot] [PATCH V3 3/3] eMMC: cmd_mmc.c adds the 'rpmb' sub-command for the 'mmc' command

2014-04-22 Thread Wolfgang Denk
Dear Pierre Aubert,

In message <1398182087-14913-4-git-send-email-p.aub...@staubli.com> you wrote:
> This sub-command adds support for the RPMB partition of an eMMC:
> * mmc rpmb key 
>   Programs the authentication key in the eMMC This key can not
>   be overwritten.
> * mmc rpmb read   <#count> [address of key]
>   Reads <#count> blocks of 256 bytes in the RPMB partition
>   beginning at block number . If the optionnal
>   address of the authentication key is provided, the
>   Message Authentication Code (MAC) is verified on each
>   block.
> * mmc rpmb write   <#count> 
>   Writes <#count> blocks of 256 bytes in the RPMB partition
>   beginning at block number . The datas are signed
>   with the key provided.
> * mmc rpmb counter
>   Returns the 'Write counter' of the RPMB partition.
> 
> The sub-command is conditional on compilation flag CONFIG_SUPPORT_EMMC_RPMB
> 
> Signed-off-by: Pierre Aubert 
> CC: Pantelis Antoniou 
> ---
>  README   |   10 
>  common/cmd_mmc.c |  123 
> +-
>  2 files changed, 132 insertions(+), 1 deletions(-)

Unfortunatley there is no changelog here.  Please note that this is
mandatory for updated patch versions, see [1] 

[1] http://www.denx.de/wiki/view/U-Boot/Patches#Sending_updated_patch_versions

A changelog in the cover letter is useless, as this does not get
recorded in patchwork.  The changelog must always be in the patch
itself.


...
> + if (argc == 4 && strcmp(argv[2], "key") == 0)
> + state = RPMB_KEY;
> + if ((argc == 6 || argc == 7) && strcmp(argv[2], "read") == 0)
> + state = RPMB_READ;
> + else if (argc == 7 && strcmp(argv[2], "write") == 0)
> + state = RPMB_WRITE;
> + else if (argc == 3 && strcmp(argv[2], "counter") == 0)
> + state = RPMB_COUNTER;

As mentiuoned before, these repeated strcmp() should probably be
replaced by a subcommand table.

> + ret = CMD_RET_SUCCESS;
> + if (state == RPMB_KEY) {
> + key_addr = (void *)simple_strtoul(argv[3], NULL, 16);
> + if (!confirm_key_prog())
> + return CMD_RET_FAILURE;
> + if (mmc_rpmb_set_key(mmc, key_addr)) {
> + printf("ERROR - Key already programmed ?\n");
> + ret = CMD_RET_FAILURE;

Do a return here, or use some "goto errout" and place the label errout
before the needed cleanup acrtions.

> + }
> + } else if (state == RPMB_COUNTER) {

You can then get rid of this "else" level.

> + unsigned long counter;
> +
> + if (mmc_rpmb_get_counter(mmc, &counter))
> + ret = CMD_RET_FAILURE;
> + else

Ditto.

> + printf("Write counter= %lx\n", counter);

Should this be a debug() ?

> +#ifdef CONFIG_SUPPORT_EMMC_RPMB
> + } else if (strcmp(argv[1], "rpmb") == 0) {
> + return do_mmcrpmb(argc, argv);
> +#endif /*  CONFIG_SUPPORT_EMMC_RPMB */
>   }

Again, it would be better to switch the code to regular subcommand
processing.

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
"I knew then (in 1970) that a 4-kbyte minicomputer would cost as much
as a house. So I reasoned  that  after  college,  I'd  have  to  live
cheaply in an apartment and put all my money into owning a computer."
  - Apple co-founder Steve Wozniak, EE Times, June 6, 1988, pg 45
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH V2 2/2] eMMC: cmd_mmc.c adds the 'rpmb' sub-command for the 'mmc' command

2014-04-22 Thread Wolfgang Denk
Dear Pierre,

In message <5350c8bc.9000...@staubli.com> you wrote:
> 
> > I think that now, with more subcommands being added, we should
> > convert the mmc code to proper subcommand handling. [It might even
> > make sense to do so for "mmc rpmb", too.]
> Do you think about the use of the macro U_BOOT_CMD_MKENT ?

Yes - see for example how the "env" sub-commands are implemented.

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
Never underestimate the power of human stupidity  when  it  comes  to
using technology they don't understand.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] config: enable CMD_BMP when API+LCD is enabled

2014-04-22 Thread Stephen Warren
On 04/21/2014 05:31 PM, Simon Glass wrote:
> Hi Stephen,
> 
> On 18 April 2014 11:15, Stephen Warren  wrote:
>>
>> From: Stephen Warren 
>>
>> When both CONFIG_API and CONFIG_LCD are enabled, the API code calls
>> lcd_display_bitmap(). That isn't compiled unless either CONFIG_CMD_BMP
>> or CONFIG_SPLASH_SCREEN is enabled. In order to prevent build problems,
>> have config_fallbacks.h enable CONFIG_CMD_BMP when both API and LCD are
>> enabled.
>>
>> Signed-off-by: Stephen Warren 
> 
> Reviewed-by: Simon Glass 
> 
> I do wonder whether it might be better to #error in this case?

I see it rather like a "select" in Kconfig. (although perhaps this would
end up being a depends rather than a select)
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH V3 2/3] Add the function 'confirm_yesno' for interactive confirmation.

2014-04-22 Thread Pierre Aubert
User's confirmation is asked in different commands. This commit adds a
function for such confirmation.

Signed-off-by: Pierre Aubert 
---
 common/cmd_fuse.c |   11 ++-
 common/cmd_nand.c |   16 +---
 common/cmd_otp.c  |   18 +++---
 common/console.c  |   28 +++-
 include/common.h  |2 +-
 5 files changed, 38 insertions(+), 37 deletions(-)

diff --git a/common/cmd_fuse.c b/common/cmd_fuse.c
index 0df57db..abab978 100644
--- a/common/cmd_fuse.c
+++ b/common/cmd_fuse.c
@@ -33,15 +33,8 @@ static int confirm_prog(void)
"what you are doing!\n"
"\nReally perform this fuse programming? \n");
 
-   if (getc() == 'y') {
-   int c;
-
-   putc('y');
-   c = getc();
-   putc('\n');
-   if (c == '\r')
-   return 1;
-   }
+   if (confirm_yesno())
+   return 1;
 
puts("Fuse programming aborted\n");
return 0;
diff --git a/common/cmd_nand.c b/common/cmd_nand.c
index 04ab0f1..a84f7dc 100644
--- a/common/cmd_nand.c
+++ b/common/cmd_nand.c
@@ -605,22 +605,16 @@ static int do_nand(cmd_tbl_t *cmdtp, int flag, int argc, 
char * const argv[])
opts.spread = spread;
 
if (scrub) {
-   if (!scrub_yes)
-   puts(scrub_warn);
-
-   if (scrub_yes)
+   if (scrub_yes) {
opts.scrub = 1;
-   else if (getc() == 'y') {
-   puts("y");
-   if (getc() == '\r')
+   } else {
+   puts(scrub_warn);
+   if (confirm_yesno()) {
opts.scrub = 1;
-   else {
+   } else {
puts("scrub aborted\n");
return 1;
}
-   } else {
-   puts("scrub aborted\n");
-   return 1;
}
}
ret = nand_erase_opts(nand, &opts);
diff --git a/common/cmd_otp.c b/common/cmd_otp.c
index 67808aa..593bb8c 100644
--- a/common/cmd_otp.c
+++ b/common/cmd_otp.c
@@ -158,21 +158,9 @@ int do_otp(cmd_tbl_t *cmdtp, int flag, int argc, char * 
const argv[])
lowup(half + count - 1), page + (half + count - 1) / 2,
half + count
);
-
-   i = 0;
-   while (1) {
-   if (tstc()) {
-   const char exp_ans[] = "YES\r";
-   char c;
-   putc(c = getc());
-   if (exp_ans[i++] != c) {
-   printf(" Aborting\n");
-   return 1;
-   } else if (!exp_ans[i]) {
-   puts("\n");
-   break;
-   }
-   }
+   if (!confirm_yesno()) {
+   printf(" Aborting\n");
+   return 1;
}
}
 
diff --git a/common/console.c b/common/console.c
index 2dfb788..5453726 100644
--- a/common/console.c
+++ b/common/console.c
@@ -537,7 +537,33 @@ int ctrlc(void)
}
return 0;
 }
-
+/* Reads user's confirmation.
+   Returns 1 if user's input is "y", "Y", "yes" or "YES"
+*/
+int confirm_yesno(void)
+{
+   int i;
+   char str_input[5];
+
+   /* Flush input */
+   while (tstc())
+   getc();
+   i = 0;
+   while (i < sizeof(str_input)) {
+   str_input[i] = getc();
+   putc(str_input[i]);
+   if (str_input[i] == '\r')
+   break;
+   i++;
+   }
+   putc('\n');
+   if (strncmp(str_input, "y\r", 2) == 0 ||
+   strncmp(str_input, "Y\r", 2) == 0 ||
+   strncmp(str_input, "yes\r", 4) == 0 ||
+   strncmp(str_input, "YES\r", 4) == 0)
+   return 1;
+   return 0;
+}
 /* pass 1 to disable ctrlc() checking, 0 to enable.
  * returns previous state
  */
diff --git a/include/common.h b/include/common.h
index baf361b..1d922b9 100644
--- a/include/common.h
+++ b/include/common.h
@@ -838,7 +838,7 @@ int ctrlc (void);
 inthad_ctrlc (void);   /* have we had a Control-C since last clear? */
 void   clear_ctrlc (void); /* clear the Control-C condition */
 intdisable_ctrlc (int);/* 1 to disable, 0 to enable Control-C detect */
-
+int confirm_yesno(void);/*  1 if input is "y", "Y", "yes" or "YES" */
 /*
  * STD

[U-Boot] [PATCH V3 1/3] eMMC: add support for operations in RPMB partition

2014-04-22 Thread Pierre Aubert
This patch adds functions for read, write and authentication
key programming for the Replay Protected Memory Block partition
in the eMMC.

Signed-off-by: Pierre Aubert 
CC: Pantelis Antoniou 
---
 drivers/mmc/Makefile |1 +
 drivers/mmc/rpmb.c   |  323 ++
 include/mmc.h|   10 ++-
 lib/Makefile |3 +
 4 files changed, 336 insertions(+), 1 deletions(-)
 create mode 100644 drivers/mmc/rpmb.c

diff --git a/drivers/mmc/Makefile b/drivers/mmc/Makefile
index 931922b..4c6ab9e 100644
--- a/drivers/mmc/Makefile
+++ b/drivers/mmc/Makefile
@@ -30,6 +30,7 @@ obj-$(CONFIG_DWMMC) += dw_mmc.o
 obj-$(CONFIG_EXYNOS_DWMMC) += exynos_dw_mmc.o
 obj-$(CONFIG_ZYNQ_SDHCI) += zynq_sdhci.o
 obj-$(CONFIG_SOCFPGA_DWMMC) += socfpga_dw_mmc.o
+obj-$(CONFIG_SUPPORT_EMMC_RPMB) += rpmb.o
 ifdef CONFIG_SPL_BUILD
 obj-$(CONFIG_SPL_MMC_BOOT) += fsl_esdhc_spl.o
 else
diff --git a/drivers/mmc/rpmb.c b/drivers/mmc/rpmb.c
new file mode 100644
index 000..05936f5
--- /dev/null
+++ b/drivers/mmc/rpmb.c
@@ -0,0 +1,323 @@
+/*
+ * Copyright 2014, Staubli Faverges
+ * Pierre Aubert
+ *
+ * eMMC- Replay Protected Memory Block
+ * According to JEDEC Standard No. 84-A441
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include "mmc_private.h"
+
+/* Request codes */
+#define RPMB_REQ_KEY   1
+#define RPMB_REQ_WCOUNTER  2
+#define RPMB_REQ_WRITE_DATA3
+#define RPMB_REQ_READ_DATA 4
+#define RPMB_REQ_STATUS5
+
+/* Response code */
+#define RPMB_RESP_KEY  0x0100
+#define RPMB_RESP_WCOUNTER 0x0200
+#define RPMB_RESP_WRITE_DATA   0x0300
+#define RPMB_RESP_READ_DATA0x0400
+
+/* Error codes */
+#define RPMB_OK0
+#define RPMB_ERR_GENERAL   1
+#define RPMB_ERR_AUTH  2
+#define RPMB_ERR_COUNTER   3
+#define RPMB_ERR_ADDRESS   4
+#define RPMB_ERR_WRITE 5
+#define RPMB_ERR_READ  6
+#define RPMB_ERR_KEY   7
+#define RPMB_ERR_CNT_EXPIRED   0x80
+#define RPMB_ERR_MSK   0x7
+
+/* Sizes of RPMB data frame */
+#define RPMB_SZ_STUFF  196
+#define RPMB_SZ_MAC32
+#define RPMB_SZ_DATA   256
+#define RPMB_SZ_NONCE  16
+
+#define SHA256_BLOCK_SIZE  64
+
+/* Error messages */
+static const char * const rpmb_err_msg[] = {
+   "",
+   "General failure",
+   "Authentication failure",
+   "Counter failure",
+   "Address failure",
+   "Write failure",
+   "Read failure",
+   "Authentication key not yet programmed",
+};
+
+
+/* Structure of RPMB data frame. */
+struct s_rpmb {
+   unsigned char stuff[RPMB_SZ_STUFF];
+   unsigned char mac[RPMB_SZ_MAC];
+   unsigned char data[RPMB_SZ_DATA];
+   unsigned char nonce[RPMB_SZ_NONCE];
+   unsigned long write_counter;
+   unsigned short address;
+   unsigned short block_count;
+   unsigned short result;
+   unsigned short request;
+};
+
+static int mmc_set_blockcount(struct mmc *mmc, unsigned int blockcount,
+ bool is_rel_write)
+{
+   struct mmc_cmd cmd = {0};
+
+   cmd.cmdidx = MMC_CMD_SET_BLOCK_COUNT;
+   cmd.cmdarg = blockcount & 0x;
+   if (is_rel_write)
+   cmd.cmdarg |= 1 << 31;
+   cmd.resp_type = MMC_RSP_R1;
+
+   return mmc_send_cmd(mmc, &cmd, NULL);
+}
+static int mmc_rpmb_request(struct mmc *mmc, const struct s_rpmb *s,
+   unsigned int count, bool is_rel_write)
+{
+   struct mmc_cmd cmd = {0};
+   struct mmc_data data;
+   int ret;
+
+   ret = mmc_set_blockcount(mmc, count, is_rel_write);
+   if (ret) {
+#ifdef CONFIG_MMC_RPMB_TRACE
+   printf("%s:mmc_set_blockcount-> %d\n", __func__, ret);
+#endif
+   return 1;
+   }
+
+   cmd.cmdidx = MMC_CMD_WRITE_MULTIPLE_BLOCK;
+   cmd.cmdarg = 0;
+   cmd.resp_type = MMC_RSP_R1b;
+
+   data.src = (const char *)s;
+   data.blocks = 1;
+   data.blocksize = MMC_MAX_BLOCK_LEN;
+   data.flags = MMC_DATA_WRITE;
+
+   ret = mmc_send_cmd(mmc, &cmd, &data);
+   if (ret) {
+#ifdef CONFIG_MMC_RPMB_TRACE
+   printf("%s:mmc_send_cmd-> %d\n", __func__, ret);
+#endif
+   return 1;
+   }
+   return 0;
+}
+static int mmc_rpmb_response(struct mmc *mmc, struct s_rpmb *s,
+unsigned short expected)
+{
+   struct mmc_cmd cmd = {0};
+   struct mmc_data data;
+   int ret;
+
+   ret = mmc_set_blockcount(mmc, 1, false);
+   if (ret) {
+#ifdef CONFIG_MMC_RPMB_TRACE
+   printf("%s:mmc_set_blockcount-> %d\n", __func__, ret);
+#endif
+   return -1;
+   }
+   cmd.cmdidx = MMC_CMD_READ_MULTIPLE_BLOCK;
+   cmd.cmdarg = 0;
+   cmd.resp_type = MMC_RSP_R1;
+
+   data.dest = (char *)s;
+   data.blocks = 1;
+   data.blocksize = MMC_MAX_BLOCK_LEN;
+   data.flags = MMC_DATA_READ;

[U-Boot] [PATCH V3 3/3] eMMC: cmd_mmc.c adds the 'rpmb' sub-command for the 'mmc' command

2014-04-22 Thread Pierre Aubert
This sub-command adds support for the RPMB partition of an eMMC:
* mmc rpmb key 
  Programs the authentication key in the eMMC This key can not
  be overwritten.
* mmc rpmb read   <#count> [address of key]
  Reads <#count> blocks of 256 bytes in the RPMB partition
  beginning at block number . If the optionnal
  address of the authentication key is provided, the
  Message Authentication Code (MAC) is verified on each
  block.
* mmc rpmb write   <#count> 
  Writes <#count> blocks of 256 bytes in the RPMB partition
  beginning at block number . The datas are signed
  with the key provided.
* mmc rpmb counter
  Returns the 'Write counter' of the RPMB partition.

The sub-command is conditional on compilation flag CONFIG_SUPPORT_EMMC_RPMB

Signed-off-by: Pierre Aubert 
CC: Pantelis Antoniou 
---
 README   |   10 
 common/cmd_mmc.c |  123 +-
 2 files changed, 132 insertions(+), 1 deletions(-)

diff --git a/README b/README
index 52a92e7..518e209 100644
--- a/README
+++ b/README
@@ -1493,6 +1493,16 @@ The following options need to be configured:
CONFIG_SH_MMCIF_CLK
Define the clock frequency for MMCIF
 
+   CONFIG_GENERIC_MMC
+   Enable the generic MMC driver
+
+   CONFIG_SUPPORT_EMMC_BOOT
+   Enable some additional features of the eMMC boot partitions.
+
+   CONFIG_SUPPORT_EMMC_RPMB
+   Enable the commands for reading, writing and programming the
+   key for the Replay Protection Memory Block partition in eMMC.
+
 - USB Device Firmware Update (DFU) class support:
CONFIG_DFU_FUNCTION
This enables the USB portion of the DFU USB class
diff --git a/common/cmd_mmc.c b/common/cmd_mmc.c
index c1916c9..da8a243 100644
--- a/common/cmd_mmc.c
+++ b/common/cmd_mmc.c
@@ -130,7 +130,118 @@ U_BOOT_CMD(
"display MMC info",
"- display info of the current MMC device"
 );
+#ifdef CONFIG_SUPPORT_EMMC_RPMB
+static int confirm_key_prog(void)
+{
+   puts("Warning: Programming authentication key can be done only once !\n"
+" Use this command only if you are sure of what you are 
doing,\n"
+"Really perform the key programming?  ");
+   if (confirm_yesno())
+   return 1;
+
+   puts("Authentication key programming aborted\n");
+   return 0;
+}
+static int do_mmcrpmb(int argc, char * const argv[])
+{
+   enum rpmb_state {
+   RPMB_INVALID,
+   RPMB_READ,
+   RPMB_WRITE,
+   RPMB_KEY,
+   RPMB_COUNTER,
+   } state;
+   struct mmc *mmc = find_mmc_device(curr_device);
+   void *key_addr;
+   char original_part;
+   int ret;
+
+   state = RPMB_INVALID;
+   if (argc == 4 && strcmp(argv[2], "key") == 0)
+   state = RPMB_KEY;
+   if ((argc == 6 || argc == 7) && strcmp(argv[2], "read") == 0)
+   state = RPMB_READ;
+   else if (argc == 7 && strcmp(argv[2], "write") == 0)
+   state = RPMB_WRITE;
+   else if (argc == 3 && strcmp(argv[2], "counter") == 0)
+   state = RPMB_COUNTER;
+
+   if (state == RPMB_INVALID)
+   return CMD_RET_USAGE;
 
+   if (!mmc) {
+   printf("no mmc device at slot %x\n", curr_device);
+   return CMD_RET_FAILURE;
+   }
+   mmc_init(mmc);
+   if (!(mmc->version & MMC_VERSION_MMC)) {
+   printf("It is not a EMMC device\n");
+   return CMD_RET_FAILURE;
+   }
+   if (mmc->version < MMC_VERSION_4_41) {
+   printf("RPMB not supported before version 4.41\n");
+   return CMD_RET_FAILURE;
+   }
+   /* Switch to the RPMB partition */
+   original_part = mmc->part_num;
+   if (mmc->part_num != MMC_PART_RPMB) {
+   if (mmc_switch_part(curr_device, MMC_PART_RPMB) != 0)
+   return CMD_RET_FAILURE;
+   mmc->part_num = MMC_PART_RPMB;
+   }
+   ret = CMD_RET_SUCCESS;
+   if (state == RPMB_KEY) {
+   key_addr = (void *)simple_strtoul(argv[3], NULL, 16);
+   if (!confirm_key_prog())
+   return CMD_RET_FAILURE;
+   if (mmc_rpmb_set_key(mmc, key_addr)) {
+   printf("ERROR - Key already programmed ?\n");
+   ret = CMD_RET_FAILURE;
+   }
+   } else if (state == RPMB_COUNTER) {
+   unsigned long counter;
+
+   if (mmc_rpmb_get_counter(mmc, &counter))
+   ret = CMD_RET_FAILURE;
+   else
+   printf("Write counter= %lx\n", counter);
+   } else {
+   u16 blk, cnt;
+   void *addr;
+   int n;
+
+   addr = (void *)simple_strtoul(argv[3], NULL, 16);
+   blk = simple_strtoul(argv[4], N

[U-Boot] [PATCH V3 0/3] eMMC: support for Read Protected Memory Block (RPMB)

2014-04-22 Thread Pierre Aubert
This serie of patches adds some functions and a sub-command of 'mmc' for  
programming the authentication key and for reading and writing the RPMB 
partition of an eMMC according to the JEDEC standard No. 64-A441

The sub-command rpmb is enabled by the flag CONFIG_SUPPORT_EMMC_RPMB defined
in the board configuration file.
It has been tested on a SabreSDP iMX6 board.

Changes in V3:
- add entries in README for configuration options related to eMMC.
- new patch for adding the 'confirm_yesno' function as suggested by W.Denk
- improved test for existence of RPMB partition.
- fix of coding issues.

Changes in V2:
- use ALLOC_CACHE_ALIGN_BUFFER in rpmb.c instead of a static buffer for the 
  RPMB frames.

Pierre Aubert (3):
  eMMC: add support for operations in RPMB partition
  Add the function 'confirm_yesno' for interactive confirmation.
  eMMC: cmd_mmc.c adds the 'rpmb' sub-command for the 'mmc' command

 README   |   10 ++
 common/cmd_fuse.c|   11 +--
 common/cmd_mmc.c |  123 +++-
 common/cmd_nand.c|   16 +--
 common/cmd_otp.c |   18 +---
 common/console.c |   28 -
 drivers/mmc/Makefile |1 +
 drivers/mmc/rpmb.c   |  323 ++
 include/common.h |2 +-
 include/mmc.h|   10 ++-
 lib/Makefile |3 +
 11 files changed, 506 insertions(+), 39 deletions(-)
 create mode 100644 drivers/mmc/rpmb.c

-- 
1.7.6.5

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


Re: [U-Boot] [RFC PATCH 3/3] mkconfig: Do not define CONFIG_SYS_{ARCH, CPU, SOC, VENDOR, BOARD} in config.h.

2014-04-22 Thread Stephen Warren
On 04/22/2014 03:43 AM, Masahiro Yamada wrote:
> This commit modifies mkconfig not to define CONFIG_SYS_ARCH,
> CONFIG_SYS_CPU, CONFIG_SYS_SOC, CONFIG_SYS_VENDOR, CONFIG_SYS_BOARD.
> 
> They are still used in some board files.
> Tegra family, OMAP-Panda board, some Samsung boards.
> 
> Add CONFIG_SYS_SOC, CONFIG_SYS_BOARD definition to their header files
> to keep the same behavior.

NAK. These are required by include/env_default.h, which creates
environment variables which cross-board boot.scr may use e.g. to create
DTB filenames. These variables need to continue to exist.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


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

2014-04-22 Thread Tom Rini
On Fri, Apr 18, 2014 at 11:25:23AM +0200, Michael Trimarchi wrote:

> Hi Tom
> 
> On Thu, Jan 30, 2014 at 10:31 PM, Tom Rini  wrote:
> > Add a bootbus sub-command to the mmc command to allow for setting
> > the boot_bus_width, reset_boot_bus_width and boot_mode fields of
> > BOOT_BUS_WIDTH (EXT_CSD[177]).
> >
> > Signed-off-by: Tom Rini 
> > ---
> 
> Can I ask if does it work even for OMAP4 device?
> So can I flash on boot0 and let omap4 bootrom to load from that?

In theory, yes.  I don't have hardware around in that exact setup, but
if the OMAP4 TRM talks about booting from the boot partition then yes,
this should let you set all the right bits.

-- 
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] [RFC PATCH 2/3] cmd_pxe: remove SoC, ARCH path from pxe_default_path

2014-04-22 Thread Stephen Warren
On 04/22/2014 03:43 AM, Masahiro Yamada wrote:
> Drop CONFIG_SYS_ARCH and CONFIG_SYS_SOC from the code.

This seems like something that will be annoying to people who rely on
this behaviour; the patch removes functionality for no purpose.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] support for maxim dallas rtcds1347

2014-04-22 Thread Tom Rini
On Fri, Apr 18, 2014 at 12:26:21AM +0530, RAGHAVENDRA GANIGA wrote:

> I am writing the support for rtc ds1347
> 
> my driver file resides in drivers/rtc/ds1347.c
> 
> who is the custodian for the rtc subsystem of uboot
> or just i have to mail patch to u-boot@lists.denx.de

I haven't picked it up since you haven't submitted a board that uses
this driver and we don't add unreachable code.

-- 
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 0/3] pcnet driver fixes

2014-04-22 Thread Tom Rini
On Thu, Apr 17, 2014 at 09:44:06PM +0200, Daniel Schwierzeck wrote:
> Hi Tom,
> 
> 2014-04-07 17:41 GMT+02:00 Paul Burton :
> > This series fixes issues with the pcnet driver & its memory accesses.
> >
> > Previously the network interface on the MIPS Malta board was unreliable
> > & would often time out whilst transferring files via TFTP, but with this
> > series applied it is now stable.
> >
> > Paul Burton (3):
> >   pcnet: access descriptor rings & init block uncached
> >   pcnet: align rx buffers for cache invalidation
> >   pcnet: force ordering of descriptor accesses
> >
> 
> In patchwork someone assigned all patches in this series to you. Is
> that intentional or shall I pick them up for MIPS tree?

I grabbed them since they were networking related and Joe is a bit busy.
As a rule of thumb, if you see something assigned to me in patchwork but
you want to take it, feel free.  I often grab things to make sure they
don't get missed.

-- 
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] Micron PC28F00AP30 flash support

2014-04-22 Thread Stefan Roese

Hi Andy,

On 14.04.2014 13:32, Andy Pont wrote:

I am looking at porting U-Boot to a board that is being designed with a
Micron PC28D00AP30 NOR flash device and can't work out whether this is
something that is already supported by U-Boot or whether it is work that I
will need to undertake.

I have had a good grep through the code and can't find any specific
references to the device but don't know the CFI code well enough to know
whether it will just detect it and work.  According to the Micron datasheet,
the device itself is 1Gb in density and has symmetrical 64Kword erase
blocks.

Any guidance would be much appreciated.


I did not look at the datasheet of this NOR device. But chances are 
quite good that this device is currently supported by the common CFI NOR 
flash driver without any changes. The most complex part will be to 
correctly configure the CONFIG_ options for your board / flash chip.


I suggest to copy/clone those CFI CONFIG options from another config 
header of a similar board port (e.g. same ARM SoC or PowerPC variant). 
And make potentially necessary changes for your board port (address etc).


HTP,
Stefan

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


Re: [U-Boot] [RFC PATCH 2/3] cmd_pxe: remove SoC, ARCH path from pxe_default_path

2014-04-22 Thread Rob Herring
On Tue, Apr 22, 2014 at 4:43 AM, Masahiro Yamada
 wrote:
> Drop CONFIG_SYS_ARCH and CONFIG_SYS_SOC from the code.

That is clear from the diff, but you are not stating why you need this change.

Rob

>
> Signed-off-by: Masahiro Yamada 
> Cc: Rob Herring 
> Cc: Stephen Warren 
> ---
>
>  common/cmd_pxe.c | 4 
>  1 file changed, 4 deletions(-)
>
> diff --git a/common/cmd_pxe.c b/common/cmd_pxe.c
> index 3483328..4b4a954 100644
> --- a/common/cmd_pxe.c
> +++ b/common/cmd_pxe.c
> @@ -18,10 +18,6 @@
>  #define MAX_TFTP_PATH_LEN 127
>
>  const char *pxe_default_paths[] = {
> -#ifdef CONFIG_SYS_SOC
> -   "default-" CONFIG_SYS_ARCH "-" CONFIG_SYS_SOC,
> -#endif
> -   "default-" CONFIG_SYS_ARCH,
> "default",
> NULL
>  };
> --
> 1.8.3.2
>
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [RFC PATCH 1/3] env: drop CONFIG_ENV_VARS_UBOOT_CONFIG support

2014-04-22 Thread Wolfgang Denk
Dear Masahiro,

In message <1398159826-29398-2-git-send-email-yamad...@jp.panasonic.com> you 
wrote:
> CONFIG_ENV_VARS_UBOOT_CONFIG, if defined, sets environment
> variables, "arch", "cpu", "board", etc. depending on
> CONFIG_SYS_ARCH, CONFIG_SYS_CPU, CONFIG_SYS_BOARD, respectively.
> 
> We are discussing the introduction of Kconfig.
> In our discussion, we found boolean CONFIG macros are more useful
> in Kconfig context.
> 
> That is,
> 
> CONFIG_ARM=y
> CONFIG_CPU_ARMv7=y
> CONFIG_BOARD_HARMONY=y
> CONFIG_VENDOR_NVIDIA=y
> 
> rather than
> 
> CONFIG_SYS_ARCH="arm"
> CONFIG_SYS_CPU="armv7"
> CONFIG_SYS_BOARD="harmony"
> CONFIG_SYS_VENDOR="nvidia"

I understand your intention - but does this not mean that we lose all
flexibility in assigning board and vendor names?  So far, we allow any
kind of names, lowercase and uppercase and mixed.  Will we not lose
this capability?  Also, we have '-' characters in a number of board
names - would this not also cause trouble?

Finally, I don't see what your replacement code would be to create the
set of environment settigns - and I think these are needed, as some
user defined scripts are processing these?

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
You can only live once, but if you do it right, once is enough.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [RFC PATCH 3/5] MAINTAINERS.boards: add initial version

2014-04-22 Thread Wolfgang Denk
Dear Albert,

In message  you wrote:
> 
> Also, I don't think we need a *centralized* source of information.
> I think we need a source of information which requires minimal effort
> when adding or removing a board (or SoC, or...). Therefore, I'm fine
> with a board-specific file (defconfig or other) as long as it can be
> recognized by (part of) its path and lives with the other board files.

This is something which I actually agree with.  When I asked for a
single, central database I was actually more restrictive than I
intended.  What I had (and have) in mind is that all relevant pieces
of information for a specific board (i. e. one "entry" in the
database) should be in a single location.  Whether this is a single
central file or a single board specific file (like a defconfig) is not 
really relevant to me.

[I have to admit that I find the MAINTAINERS format pretty unlucky; it
is difficult to write and to process.]

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
Remember, there's a big difference between kneeling down and  bending
over.   - Frank Zappa
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [RFC PATCH 3/5] MAINTAINERS.boards: add initial version

2014-04-22 Thread Wolfgang Denk
Dear Masahiro,

In message <20140422163032.3ae3.aa925...@jp.panasonic.com> you wrote:
> 
> I did this (CONFIG_BOARD_MAINTAINER) in my RFC
> http://patchwork.ozlabs.org/patch/330915/
> (but user-editable)
> 
> I think everyone was opposed to my idea
> and we chose to add MAINTAINERS file.

Well, speaking for myself only: by then I didn't know that the
alternative would be even worse ;-)

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
Premature optimization is the root of all evil. -- D.E. Knuth
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] powerpc/fman/memac: use default MDIO_HOLD value

2014-04-22 Thread shh.xie
From: Shaohui Xie 

Current driver uses a Maximum value for MDIO_HOLD when doing 10G MDIO
access, this is due to an errata A-006260 on T4 rev1.0 which is fixed
on rev2.0, so remove the maximum value to use the default value for rev2.0.

Signed-off-by: Shaohui Xie 
---
 drivers/net/fm/memac_phy.c | 8 ++--
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/net/fm/memac_phy.c b/drivers/net/fm/memac_phy.c
index 2f4bc11..de9c0e9 100644
--- a/drivers/net/fm/memac_phy.c
+++ b/drivers/net/fm/memac_phy.c
@@ -29,10 +29,8 @@ int memac_mdio_write(struct mii_dev *bus, int port_addr, int 
dev_addr,
c45 = 0; /* clause 22 */
dev_addr = regnum & 0x1f;
clrbits_be32(®s->mdio_stat, MDIO_STAT_ENC);
-   } else {
+   } else
setbits_be32(®s->mdio_stat, MDIO_STAT_ENC);
-   setbits_be32(®s->mdio_stat, MDIO_STAT_HOLD_15_CLK);
-   }
 
/* Wait till the bus is free */
while ((in_be32(®s->mdio_stat)) & MDIO_STAT_BSY)
@@ -76,10 +74,8 @@ int memac_mdio_read(struct mii_dev *bus, int port_addr, int 
dev_addr,
c45 = 0; /* clause 22 */
dev_addr = regnum & 0x1f;
clrbits_be32(®s->mdio_stat, MDIO_STAT_ENC);
-   } else {
+   } else
setbits_be32(®s->mdio_stat, MDIO_STAT_ENC);
-   setbits_be32(®s->mdio_stat, MDIO_STAT_HOLD_15_CLK);
-   }
 
/* Wait till the bus is free */
while ((in_be32(®s->mdio_stat)) & MDIO_STAT_BSY)
-- 
1.8.0

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


[U-Boot] [PATCH 2/2] powerpc/mpc85xx: SECURE BOOT- Add secure boot target for T2080RDB

2014-04-22 Thread Aneesh Bansal
Secure Boot Target is added for T2080RDB

Changes:
For Secure boot, CPC is configured as SRAM and used as house
keeping area which needs to be disabled.
So CONFIG_SYS_CPC_REINIT_F is defined for CONFIG_T2080RDB.

Signed-off-by: Aneesh Bansal 
---
 arch/powerpc/include/asm/fsl_secure_boot.h | 1 +
 boards.cfg | 1 +
 2 files changed, 2 insertions(+)

diff --git a/arch/powerpc/include/asm/fsl_secure_boot.h 
b/arch/powerpc/include/asm/fsl_secure_boot.h
index 9a0cb20..74c5d8f 100644
--- a/arch/powerpc/include/asm/fsl_secure_boot.h
+++ b/arch/powerpc/include/asm/fsl_secure_boot.h
@@ -20,6 +20,7 @@
 #if defined(CONFIG_B4860QDS) || \
defined(CONFIG_T4240QDS) || \
defined(CONFIG_T2080QDS) || \
+   defined(CONFIG_T2080RDB) || \
defined(CONFIG_T1040QDS) || \
defined(CONFIG_T104xRDB)
 #define CONFIG_SYS_CPC_REINIT_F
diff --git a/boards.cfg b/boards.cfg
index aac8b10..831c35d 100644
--- a/boards.cfg
+++ b/boards.cfg
@@ -969,6 +969,7 @@ Active  powerpc mpc85xx-   freescale
   t208xqds
 Active  powerpc mpc85xx-   freescale   t208xqds
T2081QDS_SPIFLASH
T208xQDS:PPC_T2081,RAMBOOT_PBL,SPL_FSL_PBL,SPIFLASH 
  -
 Active  powerpc mpc85xx-   freescale   t208xqds
T2081QDS_SRIO_PCIE_BOOT  
T208xQDS:PPC_T2081,SRIO_PCIE_BOOT_SLAVE,SYS_TEXT_BASE=0xFFF4
  -
 Active  powerpc mpc85xx-   freescale   t208xrdb
T2080RDB T208xRDB:PPC_T2080 

   -
+Active  powerpc mpc85xx-   freescale   t208xrdb
T2080RDB_SECURE_BOOT T208xRDB:PPC_T2080,SECURE_BOOT 

   Aneesh Bansal 
 Active  powerpc mpc85xx-   freescale   t208xrdb
T2080RDB_NAND
T208xRDB:PPC_T2080,RAMBOOT_PBL,SPL_FSL_PBL,NAND
 Active  powerpc mpc85xx-   freescale   t208xrdb
T2080RDB_SDCARD  
T208xRDB:PPC_T2080,RAMBOOT_PBL,SPL_FSL_PBL,SDCARD
 Active  powerpc mpc85xx-   freescale   t208xrdb
T2080RDB_SPIFLASH
T208xRDB:PPC_T2080,RAMBOOT_PBL,SPL_FSL_PBL,SPIFLASH
-- 
1.8.1.4

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


[U-Boot] [PATCH 1/2] powerpc/mpc85xx: SECURE BOOT- secure boot target for t1040rdb

2014-04-22 Thread Aneesh Bansal
T1040RDB.h file is removed and a unified file T104xRDB.h is created.
Hence macro CONFIG_T1040 is renamed to CONFIG_T104x.

Signed-off-by: Gaurav Kumar Rana 
Signed-off-by: Aneesh Bansal 
---
 arch/powerpc/include/asm/fsl_secure_boot.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/include/asm/fsl_secure_boot.h 
b/arch/powerpc/include/asm/fsl_secure_boot.h
index 29bef91..9a0cb20 100644
--- a/arch/powerpc/include/asm/fsl_secure_boot.h
+++ b/arch/powerpc/include/asm/fsl_secure_boot.h
@@ -21,7 +21,7 @@
defined(CONFIG_T4240QDS) || \
defined(CONFIG_T2080QDS) || \
defined(CONFIG_T1040QDS) || \
-   defined(CONFIG_T1040RDB)
+   defined(CONFIG_T104xRDB)
 #define CONFIG_SYS_CPC_REINIT_F
 #undef CONFIG_SYS_INIT_L3_ADDR
 #define CONFIG_SYS_INIT_L3_ADDR0xbff0
-- 
1.8.1.4

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


[U-Boot] [RFC PATCH 2/3] cmd_pxe: remove SoC, ARCH path from pxe_default_path

2014-04-22 Thread Masahiro Yamada
Drop CONFIG_SYS_ARCH and CONFIG_SYS_SOC from the code.

Signed-off-by: Masahiro Yamada 
Cc: Rob Herring 
Cc: Stephen Warren 
---

 common/cmd_pxe.c | 4 
 1 file changed, 4 deletions(-)

diff --git a/common/cmd_pxe.c b/common/cmd_pxe.c
index 3483328..4b4a954 100644
--- a/common/cmd_pxe.c
+++ b/common/cmd_pxe.c
@@ -18,10 +18,6 @@
 #define MAX_TFTP_PATH_LEN 127
 
 const char *pxe_default_paths[] = {
-#ifdef CONFIG_SYS_SOC
-   "default-" CONFIG_SYS_ARCH "-" CONFIG_SYS_SOC,
-#endif
-   "default-" CONFIG_SYS_ARCH,
"default",
NULL
 };
-- 
1.8.3.2

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


[U-Boot] [RFC PATCH 3/3] mkconfig: Do not define CONFIG_SYS_{ARCH, CPU, SOC, VENDOR, BOARD} in config.h.

2014-04-22 Thread Masahiro Yamada
This commit modifies mkconfig not to define CONFIG_SYS_ARCH,
CONFIG_SYS_CPU, CONFIG_SYS_SOC, CONFIG_SYS_VENDOR, CONFIG_SYS_BOARD.

They are still used in some board files.
Tegra family, OMAP-Panda board, some Samsung boards.

Add CONFIG_SYS_SOC, CONFIG_SYS_BOARD definition to their header files
to keep the same behavior.

Signed-off-by: Masahiro Yamada 
Cc: Lukasz Majewski 
Cc: Piotr Wilczek 
Cc: Przemyslaw Marczak 
Cc: Sricharan R 
Cc: Stephen Warren 
Cc: Tom Warren 
---

 arch/arm/include/asm/arch-tegra114/tegra.h | 1 +
 arch/arm/include/asm/arch-tegra124/tegra.h | 1 +
 arch/arm/include/asm/arch-tegra20/tegra.h  | 1 +
 arch/arm/include/asm/arch-tegra30/tegra.h  | 1 +
 arch/blackfin/lib/Makefile | 3 ---
 include/configs/exynos4-dt.h   | 2 +-
 include/configs/omap4_panda.h  | 1 +
 include/configs/s5pc210_universal.h| 2 ++
 include/configs/trats.h| 1 +
 include/configs/trats2.h   | 2 ++
 mkconfig   | 8 
 11 files changed, 11 insertions(+), 12 deletions(-)

diff --git a/arch/arm/include/asm/arch-tegra114/tegra.h 
b/arch/arm/include/asm/arch-tegra114/tegra.h
index 705ca57..e6b56c6 100644
--- a/arch/arm/include/asm/arch-tegra114/tegra.h
+++ b/arch/arm/include/asm/arch-tegra114/tegra.h
@@ -18,6 +18,7 @@
 #define _TEGRA114_H_
 
 #define CONFIG_TEGRA114
+#define CONFIG_SYS_SOC "tegra114"
 
 #define NV_PA_SDRAM_BASE   0x8000  /* 0x8000 for real T114 */
 #define NV_PA_TSC_BASE 0x700F  /* System Counter TSC regs */
diff --git a/arch/arm/include/asm/arch-tegra124/tegra.h 
b/arch/arm/include/asm/arch-tegra124/tegra.h
index 86ebd19..9f455a1 100644
--- a/arch/arm/include/asm/arch-tegra124/tegra.h
+++ b/arch/arm/include/asm/arch-tegra124/tegra.h
@@ -9,6 +9,7 @@
 #define _TEGRA124_H_
 
 #define CONFIG_TEGRA124
+#define CONFIG_SYS_SOC "tegra124"
 
 #define NV_PA_SDRAM_BASE   0x8000
 #define NV_PA_TSC_BASE 0x700F  /* System Counter TSC regs */
diff --git a/arch/arm/include/asm/arch-tegra20/tegra.h 
b/arch/arm/include/asm/arch-tegra20/tegra.h
index 6a4b40e..8d50b80 100644
--- a/arch/arm/include/asm/arch-tegra20/tegra.h
+++ b/arch/arm/include/asm/arch-tegra20/tegra.h
@@ -9,6 +9,7 @@
 #define _TEGRA20_H_
 
 #define CONFIG_TEGRA20
+#define CONFIG_SYS_SOC "tegra20"
 
 #define NV_PA_SDRAM_BASE   0x
 
diff --git a/arch/arm/include/asm/arch-tegra30/tegra.h 
b/arch/arm/include/asm/arch-tegra30/tegra.h
index 4ad8b1c..5ddb1c0 100644
--- a/arch/arm/include/asm/arch-tegra30/tegra.h
+++ b/arch/arm/include/asm/arch-tegra30/tegra.h
@@ -18,6 +18,7 @@
 #define _TEGRA30_H_
 
 #define CONFIG_TEGRA30
+#define CONFIG_SYS_SOC "tegra30"
 
 #define NV_PA_SDRAM_BASE   0x8000  /* 0x8000 for real T30 */
 
diff --git a/arch/blackfin/lib/Makefile b/arch/blackfin/lib/Makefile
index 4ba7bf6..f99dfc7 100644
--- a/arch/blackfin/lib/Makefile
+++ b/arch/blackfin/lib/Makefile
@@ -9,9 +9,6 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-# Unnecessary.
-# Use CONFIG_SYS_BOARD instead of BFIN_BOARD_NAME
-# and delete this.
 ccflags-y += -DBFIN_BOARD_NAME='"$(BOARD)"'
 
 obj-y  += ins.o
diff --git a/include/configs/exynos4-dt.h b/include/configs/exynos4-dt.h
index 2040bf7..2063887 100644
--- a/include/configs/exynos4-dt.h
+++ b/include/configs/exynos4-dt.h
@@ -13,7 +13,7 @@
 #define CONFIG_SAMSUNG /* in a SAMSUNG core */
 #define CONFIG_S5P /* S5P Family */
 #define CONFIG_EXYNOS4 /* which is in a Exynos4 Family */
-
+#define CONFIG_SYS_SOC "exynos"
 #include   /* get chip and board defs */
 
 #define CONFIG_ARCH_CPU_INIT
diff --git a/include/configs/omap4_panda.h b/include/configs/omap4_panda.h
index 7378acd..4a844a1 100644
--- a/include/configs/omap4_panda.h
+++ b/include/configs/omap4_panda.h
@@ -15,6 +15,7 @@
 /*
  * High Level Configuration Options
  */
+#define CONFIG_SYS_BOARD"panda"
 
 /* USB UHH support options */
 #define CONFIG_CMD_USB
diff --git a/include/configs/s5pc210_universal.h 
b/include/configs/s5pc210_universal.h
index 509bd06..ac914f9 100644
--- a/include/configs/s5pc210_universal.h
+++ b/include/configs/s5pc210_universal.h
@@ -14,6 +14,8 @@
 
 #define CONFIG_SYS_PROMPT  "Universal # "  /* Monitor Command Prompt */
 
+#define CONFIG_SYS_BOARD   "universal_c210"
+
 #undef CONFIG_DEFAULT_DEVICE_TREE
 #define CONFIG_DEFAULT_DEVICE_TREE exynos4210-universal_c210
 
diff --git a/include/configs/trats.h b/include/configs/trats.h
index 29cabab..19160ac 100644
--- a/include/configs/trats.h
+++ b/include/configs/trats.h
@@ -15,6 +15,7 @@
 #define CONFIG_SYS_PROMPT  "Trats # "  /* Monitor Command Prompt */
 
 #define CONFIG_TRATS
+#define CONFIG_SYS_BOARD   "trats"
 
 #undef CONFIG_DEFAULT_DEVICE_TREE
 #define CONFIG_DEFAULT_DEVICE_TREE exynos4210-trats
diff --git a/include/configs/trats2.h b/include/configs/trats2.h
index

[U-Boot] [RFC PATCH 1/3] env: drop CONFIG_ENV_VARS_UBOOT_CONFIG support

2014-04-22 Thread Masahiro Yamada
CONFIG_ENV_VARS_UBOOT_CONFIG, if defined, sets environment
variables, "arch", "cpu", "board", etc. depending on
CONFIG_SYS_ARCH, CONFIG_SYS_CPU, CONFIG_SYS_BOARD, respectively.

We are discussing the introduction of Kconfig.
In our discussion, we found boolean CONFIG macros are more useful
in Kconfig context.

That is,

CONFIG_ARM=y
CONFIG_CPU_ARMv7=y
CONFIG_BOARD_HARMONY=y
CONFIG_VENDOR_NVIDIA=y

rather than

CONFIG_SYS_ARCH="arm"
CONFIG_SYS_CPU="armv7"
CONFIG_SYS_BOARD="harmony"
CONFIG_SYS_VENDOR="nvidia"

Using CONFIG_SYS_ARCH, CONFIG_SYS_CPU, etc. will be an obstacle
for our future refactoring.

Signed-off-by: Masahiro Yamada 
---

 README | 14 --
 include/configs/am335x_igep0033.h  |  1 -
 include/configs/apf27.h|  1 -
 include/configs/pcm051.h   |  1 -
 include/configs/rpi_b.h|  1 -
 include/configs/s5p_goni.h |  1 -
 include/configs/s5pc210_universal.h|  1 -
 include/configs/siemens-am33x-common.h |  1 -
 include/configs/tegra-common.h |  1 -
 include/configs/ti814x_evm.h   |  1 -
 include/configs/ti_armv7_common.h  |  1 -
 include/configs/trats.h|  1 -
 include/configs/trats2.h   |  1 -
 include/env_default.h  | 12 
 14 files changed, 38 deletions(-)

diff --git a/README b/README
index f91e044..7fd47aa 100644
--- a/README
+++ b/README
@@ -2740,20 +2740,6 @@ CBFS (Coreboot Filesystem) support
the environment like the "source" command or the
boot command first.
 
-   CONFIG_ENV_VARS_UBOOT_CONFIG
-
-   Define this in order to add variables describing the
-   U-Boot build configuration to the default environment.
-   These will be named arch, cpu, board, vendor, and soc.
-
-   Enabling this option will cause the following to be defined:
-
-   - CONFIG_SYS_ARCH
-   - CONFIG_SYS_CPU
-   - CONFIG_SYS_BOARD
-   - CONFIG_SYS_VENDOR
-   - CONFIG_SYS_SOC
-
CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
 
Define this in order to add variables describing certain
diff --git a/include/configs/am335x_igep0033.h 
b/include/configs/am335x_igep0033.h
index c17327f..8c84b7f 100644
--- a/include/configs/am335x_igep0033.h
+++ b/include/configs/am335x_igep0033.h
@@ -64,7 +64,6 @@
 #define CONFIG_UBIFS_SILENCE_MSG
 
 #define CONFIG_BOOTDELAY   1   /* negative for no autoboot */
-#define CONFIG_ENV_VARS_UBOOT_CONFIG
 #define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
 #define CONFIG_EXTRA_ENV_SETTINGS \
"loadaddr=0x80F8\0" \
diff --git a/include/configs/apf27.h b/include/configs/apf27.h
index b10c48c..92b102a 100644
--- a/include/configs/apf27.h
+++ b/include/configs/apf27.h
@@ -157,7 +157,6 @@
 #define CONFIG_CMDLINE_EDITING
 #define CONFIG_SYS_HUSH_PARSER /* enable the "hush" shell */
 #define CONFIG_SYS_PROMPT_HUSH_PS2 "> "/* secondary prompt string */
-#define CONFIG_ENV_VARS_UBOOT_CONFIG
 #define CONFIG_PREBOOT "run check_flash check_env;"
 
 
diff --git a/include/configs/pcm051.h b/include/configs/pcm051.h
index 9af3efd..2375348 100644
--- a/include/configs/pcm051.h
+++ b/include/configs/pcm051.h
@@ -47,7 +47,6 @@
 
 /* set to negative value for no autoboot */
 #define CONFIG_BOOTDELAY   1
-#define CONFIG_ENV_VARS_UBOOT_CONFIG
 #define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
 #define CONFIG_EXTRA_ENV_SETTINGS \
"loadaddr=0x80007fc0\0" \
diff --git a/include/configs/rpi_b.h b/include/configs/rpi_b.h
index ed8b4df..d5cd912 100644
--- a/include/configs/rpi_b.h
+++ b/include/configs/rpi_b.h
@@ -91,7 +91,6 @@
 /* Environment */
 #define CONFIG_ENV_SIZESZ_16K
 #define CONFIG_ENV_IS_NOWHERE
-#define CONFIG_ENV_VARS_UBOOT_CONFIG
 #define CONFIG_SYS_LOAD_ADDR   0x100
 #define CONFIG_CONSOLE_MUX
 #define CONFIG_SYS_CONSOLE_IS_IN_ENV
diff --git a/include/configs/s5p_goni.h b/include/configs/s5p_goni.h
index 991c43e..66ee58b 100644
--- a/include/configs/s5p_goni.h
+++ b/include/configs/s5p_goni.h
@@ -119,7 +119,6 @@
 
 #define CONFIG_ENV_OVERWRITE
 #define CONFIG_SYS_CONSOLE_IS_IN_ENV
-#define CONFIG_ENV_VARS_UBOOT_CONFIG
 #define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
 #define CONFIG_EXTRA_ENV_SETTINGS  \
CONFIG_UPDATEB \
diff --git a/include/configs/s5pc210_universal.h 
b/include/configs/s5pc210_universal.h
index 2da8871..509bd06 100644
--- a/include/configs/s5pc210_universal.h
+++ b/include/configs/s5pc210_universal.h
@@ -99,7 +99,6 @@
 
 #define CONFIG_ENV_COMMON_BOOT "${console} ${meminfo}"
 
-#define CONFIG_ENV_VARS_UBOOT_CONFIG
 #define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
 
 #define CONFIG_EXTRA_ENV_SETTINGS  \
diff --git a/include/configs/siemens-am33x-common.h 
b/include/configs

[U-Boot] [RFC PATCH 0/3] Remove CONFIG_SYS_{ARCH, CPU, SOC, VENDOR, BOARD}

2014-04-22 Thread Masahiro Yamada
When I posted the RFC version of Kconfig series,
I defined
CONFIG_SYS_ARCH, CONFIG_SYS_CPU, CONFIG_SYS_SOC, CONFIG_SYS_VENDOR,
CONFIG_SYS_BOARD in Kconfig.

For example,
configs/harmony_defconfig was like this:
  CONFIG_SPL=y
  CONFIG_ARM=y
  CONFIG_SYS_CPU="armv7"
  CONFIG_SOC_DIR=y
  CONFIG_SYS_SOC="tegra20"
  CONFIG_SYS_BOARD="harmony"
  CONFIG_VENDOR_DIR=y
  CONFIG_SYS_VENDOR="nvidia"
  CONFIG_SYS_CONFIG_NAME="harmony"
  CONFIG_BOARD_MAINTAINER="Tom Warren "

But the most reviewers involved did not like that.
(See http://patchwork.ozlabs.org/patch/330915/)

Instead, Daniel Schwierzeck suggested to select a board
by using boolean macro: something like this,
CONFIG_BOARD_HARMONY, CONFIG_VENDOR_NVIDIA, ...

I agree this is a good idea.
But string macros are used everywhere in U-Boot.

$(CPU), $(SOC), $(VENDOR), $(BOARD) here and there in makefiles
and CONFIG_SYS_{ARCH, CPU, SOC, VENDOR, BOARD} in C source files.

I took an action little by little to reduce the number of such
variables in makefiles
For example, these patches:
http://patchwork.ozlabs.org/patch/335202/
http://patchwork.ozlabs.org/patch/335201/

I want to do something with CONFIG_SYS_{ARCH,...} in this series.



Masahiro Yamada (3):
  env: drop CONFIG_ENV_VARS_UBOOT_CONFIG support
  cmd_pxe: remove SoC, ARCH path from pxe_default_path
  mkconfig: Do not define CONFIG_SYS_{ARCH,CPU,SOC,VENDOR,BOARD} in
config.h.

 README | 14 --
 arch/arm/include/asm/arch-tegra114/tegra.h |  1 +
 arch/arm/include/asm/arch-tegra124/tegra.h |  1 +
 arch/arm/include/asm/arch-tegra20/tegra.h  |  1 +
 arch/arm/include/asm/arch-tegra30/tegra.h  |  1 +
 arch/blackfin/lib/Makefile |  3 ---
 common/cmd_pxe.c   |  4 
 include/configs/am335x_igep0033.h  |  1 -
 include/configs/apf27.h|  1 -
 include/configs/exynos4-dt.h   |  2 +-
 include/configs/omap4_panda.h  |  1 +
 include/configs/pcm051.h   |  1 -
 include/configs/rpi_b.h|  1 -
 include/configs/s5p_goni.h |  1 -
 include/configs/s5pc210_universal.h|  3 ++-
 include/configs/siemens-am33x-common.h |  1 -
 include/configs/tegra-common.h |  1 -
 include/configs/ti814x_evm.h   |  1 -
 include/configs/ti_armv7_common.h  |  1 -
 include/configs/trats.h|  2 +-
 include/configs/trats2.h   |  3 ++-
 include/env_default.h  | 12 
 mkconfig   |  8 
 23 files changed, 11 insertions(+), 54 deletions(-)

-- 
1.8.3.2

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


Re: [U-Boot] [PATCH] spl: consolidate arch/arm/include/asm/arch-*/spl.h

2014-04-22 Thread Michal Simek
On 04/16/2014 08:44 AM, Masahiro Yamada wrote:
> arch/arm/include/asm/spl.h requires all SoCs to have
> arch/arm/include/asm/arch-*/spl.h.
> 
> But many of them just define BOOT_DEVICE_* macros.
> 
> Those macros are used in the "switch (boot_device) { ... }"
> statement in common/spl/spl.c.
> 
> So they should not be archtecture specific, but described as
> a simpile enumeration.
> 
> This commit merge most of arch/arm/include/asm/arch-*/spl.h
> into arch/arm/include/asm/spl.h.
> 
> With a little more effort, arch-zynq/spl.h and arch-socfpga/spl.h
> will be merged, while I am not sure about OMAP and Exynos.
> 
> Signed-off-by: Masahiro Yamada 
> Cc: Tom Rini 
> Cc: Michal Simek 


Finally. :-)
Acked-by: Michal Simek 

Thanks,
Michal

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




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


[U-Boot] [PATCH] powerpc/85xx: add T4080 SoC support

2014-04-22 Thread Shengzhou Liu
The T4080 SoC is a low-power version of the T4240/T4160.
T4080 combines 4 dual-threaded Power Architecture e6500
cores with single cluster and two memory complexes.

Signed-off-by: Shengzhou Liu 
---
based on 'next' branch of u-boot-mpc85xx.

 arch/powerpc/cpu/mpc85xx/Makefile |  2 ++
 arch/powerpc/cpu/mpc85xx/cpu.c| 21 +
 arch/powerpc/cpu/mpc85xx/cpu_init.c   |  5 -
 arch/powerpc/cpu/mpc85xx/speed.c  |  3 ++-
 arch/powerpc/cpu/mpc85xx/t4240_serdes.c   |  2 +-
 arch/powerpc/cpu/mpc8xxx/cpu.c|  1 +
 arch/powerpc/include/asm/config_mpc85xx.h | 16 +++-
 arch/powerpc/include/asm/fsl_errata.h |  2 ++
 arch/powerpc/include/asm/immap_85xx.h |  6 --
 arch/powerpc/include/asm/processor.h  |  1 +
 drivers/net/fm/Makefile   |  1 +
 11 files changed, 50 insertions(+), 10 deletions(-)

diff --git a/arch/powerpc/cpu/mpc85xx/Makefile 
b/arch/powerpc/cpu/mpc85xx/Makefile
index 4094785..ad26b43 100644
--- a/arch/powerpc/cpu/mpc85xx/Makefile
+++ b/arch/powerpc/cpu/mpc85xx/Makefile
@@ -44,6 +44,7 @@ obj-$(CONFIG_PPC_P5020) += p5020_ids.o
 obj-$(CONFIG_PPC_P5040) += p5040_ids.o
 obj-$(CONFIG_PPC_T4240) += t4240_ids.o
 obj-$(CONFIG_PPC_T4160) += t4240_ids.o
+obj-$(CONFIG_PPC_T4080) += t4240_ids.o
 obj-$(CONFIG_PPC_B4420) += b4860_ids.o
 obj-$(CONFIG_PPC_B4860) += b4860_ids.o
 obj-$(CONFIG_PPC_T1040) += t1040_ids.o
@@ -88,6 +89,7 @@ obj-$(CONFIG_PPC_P5020) += p5020_serdes.o
 obj-$(CONFIG_PPC_P5040) += p5040_serdes.o
 obj-$(CONFIG_PPC_T4240) += t4240_serdes.o
 obj-$(CONFIG_PPC_T4160) += t4240_serdes.o
+obj-$(CONFIG_PPC_T4080) += t4240_serdes.o
 obj-$(CONFIG_PPC_B4420) += b4860_serdes.o
 obj-$(CONFIG_PPC_B4860) += b4860_serdes.o
 obj-$(CONFIG_BSC9132) += bsc9132_serdes.o
diff --git a/arch/powerpc/cpu/mpc85xx/cpu.c b/arch/powerpc/cpu/mpc85xx/cpu.c
index 12e8e10..55df8cb 100644
--- a/arch/powerpc/cpu/mpc85xx/cpu.c
+++ b/arch/powerpc/cpu/mpc85xx/cpu.c
@@ -77,6 +77,27 @@ int checkcpu (void)
major = SVR_MAJ(svr);
minor = SVR_MIN(svr);
 
+#if defined(CONFIG_SYS_FSL_QORIQ_CHASSIS2) && defined(CONFIG_E6500)
+   if (SVR_SOC_VER(svr) == SVR_T4080) {
+   ccsr_rcpm_t *rcpm =
+   (void __iomem *)(CONFIG_SYS_FSL_CORENET_RCPM_ADDR);
+
+   setbits_be32(&gur->devdisr2, FSL_CORENET_DEVDISR2_DTSEC1_6 ||
+FSL_CORENET_DEVDISR2_DTSEC1_9);
+   setbits_be32(&gur->devdisr3, FSL_CORENET_DEVDISR3_PCIE3);
+   setbits_be32(&gur->devdisr5, FSL_CORENET_DEVDISR5_DDR3);
+
+   for (i = 4; i < 8; i++)
+   cpu_disable(i);
+
+   /* request core4~7 into PH20 state */
+   setbits_be32(&rcpm->pcph20setr, 0xf0);
+
+   /* put the 2nd cluster into PCL10 state */
+   setbits_be32(&rcpm->clpcl10setr, 1 << 1);
+   }
+#endif
+
if (cpu_numcores() > 1) {
 #ifndef CONFIG_MP
puts("Unicore software on multiprocessor system!!\n"
diff --git a/arch/powerpc/cpu/mpc85xx/cpu_init.c 
b/arch/powerpc/cpu/mpc85xx/cpu_init.c
index ea41ffc..dcc4bff 100644
--- a/arch/powerpc/cpu/mpc85xx/cpu_init.c
+++ b/arch/powerpc/cpu/mpc85xx/cpu_init.c
@@ -462,10 +462,13 @@ __attribute__((weak, alias("__fsl_serdes__init"))) void 
fsl_serdes_init(void);
 int enable_cluster_l2(void)
 {
int i = 0;
-   u32 cluster;
+   u32 cluster, svr = get_svr();
ccsr_gur_t *gur = (void __iomem *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
struct ccsr_cluster_l2 __iomem *l2cache;
 
+   if (SVR_SOC_VER(svr) == SVR_T4080)
+   return 0;
+
cluster = in_be32(&gur->tp_cluster[i].lower);
if (cluster & TP_CLUSTER_EOC)
return 0;
diff --git a/arch/powerpc/cpu/mpc85xx/speed.c b/arch/powerpc/cpu/mpc85xx/speed.c
index 2d6c668..33441c9 100644
--- a/arch/powerpc/cpu/mpc85xx/speed.c
+++ b/arch/powerpc/cpu/mpc85xx/speed.c
@@ -123,7 +123,8 @@ void get_sys_info(sys_info_t *sys_info)
 * T4240/T4160 Rev1.0. eg. It's 12 in Rev1.0, however, for Rev2.0
 * it uses 6.
 */
-#if defined(CONFIG_PPC_T4240) || defined(CONFIG_PPC_T4160)
+#if defined(CONFIG_PPC_T4240) || defined(CONFIG_PPC_T4160) || \
+   defined(CONFIG_PPC_T4080)
if (SVR_MAJ(get_svr()) >= 2)
mem_pll_rat *= 2;
 #endif
diff --git a/arch/powerpc/cpu/mpc85xx/t4240_serdes.c 
b/arch/powerpc/cpu/mpc85xx/t4240_serdes.c
index ff55e3c..1f99a0a 100644
--- a/arch/powerpc/cpu/mpc85xx/t4240_serdes.c
+++ b/arch/powerpc/cpu/mpc85xx/t4240_serdes.c
@@ -172,7 +172,7 @@ static const struct serdes_config serdes4_cfg_tbl[] = {
{18, {PCIE3, PCIE3, PCIE3, PCIE3, AURORA, AURORA, AURORA, AURORA}},
{}
 };
-#elif defined(CONFIG_PPC_T4160)
+#elif defined(CONFIG_PPC_T4160) || defined(CONFIG_PPC_T4080)
 static const struct serdes_config serdes1_cfg_tbl[] = {
/* SerDes 1 */
{1, {XAUI_FM1_MAC9, XAUI_FM1_MAC9,
diff --git a/arch/powerpc/cpu/mpc8x

Re: [U-Boot] [RFC PATCH 3/5] MAINTAINERS.boards: add initial version

2014-04-22 Thread Albert ARIBAUD
Hi Masahiro,

On Tue, 22 Apr 2014 16:30:32 +0900, Masahiro Yamada
 wrote:

> Hi Albert,
> 
> > Can'we have the maintainer(s) be part of the board config file
> > from the start, like a required (but possible non-editable)
> > configuration item, something like "CONFIG_MAINTAINER_EMAIL"?
> > 
> > This would, at least, keep all information for a single board
> > in a single place.
> 
> I did this (CONFIG_BOARD_MAINTAINER) in my RFC
> http://patchwork.ozlabs.org/patch/330915/
> (but user-editable)
> 
> I think everyone was opposed to my idea
> and we chose to add MAINTAINERS file.

I don't agree that everyone was opposed to it. There were disagreements
and suggestions to use get_maintainers.pl, and then disagreements about
this suggestion too.

(I did not chime in then for lack of time and because what I would have
said was already; I am chiming in now because Wolfgang was explicitly
wondering whether anyone was agreeing with him, and I am.)

I personally don't like the proposed MAINTAINERS format any more than I
liked the old one.

Also, I don't think we need a *centralized* source of information.
I think we need a source of information which requires minimal effort
when adding or removing a board (or SoC, or...). Therefore, I'm fine
with a board-specific file (defconfig or other) as long as it can be
recognized by (part of) its path and lives with the other board files.

> Best Regards
> Masahiro Yamada

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


[U-Boot] [PATCH ][v3] powerpc/T4QDS: add two stage boot of nand/sd

2014-04-22 Thread shh.xie
From: Shaohui Xie 

Add support of 2 stage NAND/SD boot loader using SPL framework.
PBL initialise the internal SRAM and copy SPL, this further
initialise DDR using SPD and environment and copy u-boot from
NAND/SD to DDR, finally SPL transfer control to u-boot.
NOR uses CS1 instead of CS2 when NAND boot, fix it.

Signed-off-by: Shaohui Xie 
---
changes for v3:
updated env to adapt to new spl.

changes for v2:
added Secure Boot header(32KB), adjust settings accordingly.

 board/freescale/t4qds/Makefile |   6 +-
 board/freescale/t4qds/ddr.c|   6 +-
 board/freescale/t4qds/spl.c| 141 +
 board/freescale/t4qds/tlb.c|   8 ++-
 boards.cfg |   7 +-
 doc/README.t4240qds|  53 
 include/configs/T4240QDS.h |  99 +++--
 include/configs/t4qds.h|  17 -
 8 files changed, 310 insertions(+), 27 deletions(-)
 create mode 100644 board/freescale/t4qds/spl.c

diff --git a/board/freescale/t4qds/Makefile b/board/freescale/t4qds/Makefile
index 2b1f7aa..4e8e5cb 100644
--- a/board/freescale/t4qds/Makefile
+++ b/board/freescale/t4qds/Makefile
@@ -4,10 +4,14 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
+ifdef CONFIG_SPL_BUILD
+obj-y += spl.o
+else
 obj-$(CONFIG_T4240QDS) += t4240qds.o
 obj-$(CONFIG_T4240EMU) += t4240emu.o
-obj-y  += ddr.o
 obj-$(CONFIG_T4240QDS)+= eth.o
 obj-$(CONFIG_PCI)  += pci.o
+endif
+obj-y  += ddr.o
 obj-y  += law.o
 obj-y  += tlb.o
diff --git a/board/freescale/t4qds/ddr.c b/board/freescale/t4qds/ddr.c
index 7586cc3..7abd38d 100644
--- a/board/freescale/t4qds/ddr.c
+++ b/board/freescale/t4qds/ddr.c
@@ -117,11 +117,15 @@ phys_size_t initdram(int board_type)
 
puts("Initializingusing SPD\n");
 
+#if defined(CONFIG_SPL_BUILD) || !defined(CONFIG_RAMBOOT_PBL)
dram_size = fsl_ddr_sdram();
 
dram_size = setup_ddr_tlbs(dram_size / 0x10);
dram_size *= 0x10;
 
-   puts("DDR: ");
+#else
+   /* DDR has been initialised by first stage boot loader */
+   dram_size = fsl_ddr_sdram_size();
+#endif
return dram_size;
 }
diff --git a/board/freescale/t4qds/spl.c b/board/freescale/t4qds/spl.c
new file mode 100644
index 000..0c6156e
--- /dev/null
+++ b/board/freescale/t4qds/spl.c
@@ -0,0 +1,141 @@
+/* Copyright 2014 Freescale Semiconductor, Inc.
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include "../common/qixis.h"
+#include "t4240qds_qixis.h"
+
+#define FSL_CORENET_CCSR_PORSR1_RCW_MASK   0xFF80
+
+DECLARE_GLOBAL_DATA_PTR;
+
+phys_size_t get_effective_memsize(void)
+{
+   return CONFIG_SYS_L3_SIZE;
+}
+
+unsigned long get_board_sys_clk(void)
+{
+   u8 sysclk_conf = QIXIS_READ(brdcfg[1]);
+
+   switch (sysclk_conf & 0x0F) {
+   case QIXIS_SYSCLK_83:
+   return 8333;
+   case QIXIS_SYSCLK_100:
+   return 1;
+   case QIXIS_SYSCLK_125:
+   return 12500;
+   case QIXIS_SYSCLK_133:
+   return 1;
+   case QIXIS_SYSCLK_150:
+   return 15000;
+   case QIXIS_SYSCLK_160:
+   return 16000;
+   case QIXIS_SYSCLK_166:
+   return 1;
+   }
+   return ;
+}
+
+unsigned long get_board_ddr_clk(void)
+{
+   u8 ddrclk_conf = QIXIS_READ(brdcfg[1]);
+
+   switch ((ddrclk_conf & 0x30) >> 4) {
+   case QIXIS_DDRCLK_100:
+   return 1;
+   case QIXIS_DDRCLK_125:
+   return 12500;
+   case QIXIS_DDRCLK_133:
+   return 1;
+   }
+   return ;
+}
+
+void board_init_f(ulong bootflag)
+{
+   u32 plat_ratio, sys_clk, ccb_clk;
+   ccsr_gur_t *gur = (void *)CONFIG_SYS_MPC85xx_GUTS_ADDR;
+#ifdef CONFIG_SPL_NAND_BOOT
+   u32 porsr1, pinctl;
+#endif
+
+#ifdef CONFIG_SPL_NAND_BOOT
+   porsr1 = in_be32(&gur->porsr1);
+   pinctl = ((porsr1 & ~(FSL_CORENET_CCSR_PORSR1_RCW_MASK)) | 0x2480);
+   out_be32((unsigned int *)(CONFIG_SYS_DCSRBAR + 0x2), pinctl);
+#endif
+   /* Memcpy existing GD at CONFIG_SPL_GD_ADDR */
+   memcpy((void *)CONFIG_SPL_GD_ADDR, (void *)gd, sizeof(gd_t));
+
+   /* Update GD pointer */
+   gd = (gd_t *)(CONFIG_SPL_GD_ADDR);
+
+   /* compiler optimization barrier needed for GCC >= 3.4 */
+   __asm__ __volatile__("" : : : "memory");
+
+   console_init_f();
+
+   /* initialize selected port with appropriate baud rate */
+   sys_clk = get_board_sys_clk();
+   plat_ratio = (in_be32(&gur->rcwsr[0]) >> 25) & 0x1f;
+   ccb_clk = sys_clk * plat_ratio / 2;
+
+   NS16550_init((NS16550_t)CONFIG_SYS_NS16550_COM1,
+ccb_clk / 16 / CONFIG_BAUDRATE);
+
+#ifdef CONFIG_SPL_MMC_BOOT
+   puts("\nSD boot...\n");
+#elif defined(CONFIG_SPL_NAND_BOOT)
+   puts("\nNAND boot...\n");
+#endif

Re: [U-Boot] [PATCH 06/11] MX6: add struct for sharing data between SPL and uboot

2014-04-22 Thread Igor Grinberg
Hi Tim,

On 04/21/14 21:28, Tim Harvey wrote:
> On Sun, Apr 20, 2014 at 12:52 AM, Igor Grinberg  
> wrote:
>> On 04/18/14 09:35, Tim Harvey wrote:
>>> On Thu, Apr 17, 2014 at 4:44 AM, Stefano Babic  wrote:
 Hi Igor, hi Tim

 On 17/04/2014 13:22, Igor Grinberg wrote:

>
> get_ram_size() works on cm-fx6 all DRAM configurations.

 As on most boards in mainline ;-)

>>>
>>> It looks like I mis-interpreted the failure. This issue is that
>>> get_ram_size() only works with powers of 2 and maxes out at 2GB due to
>>> 32bit addressing. I was simply passing in a bogus value. I'm not sure
>>> how you would deal with detecting systems with 4GB but I don't need to
>>> support that for my boards currently.
>>>
>>
>> cm-fx6 supports 4GB and detects it properly.
> 
> Igor,
> 
> That's interesting. What value are you passing get_ram_size() then?

Well, we do it in several get_ram_size() calls and decide according
to returned results.

> Where is your code? I don't see any cm-fx6 in mainline or posted
> patchsets.

Right, it is work in progress.
Currently, it is based on 2014.01. Once it is ready, we re-base and post it.


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


Re: [U-Boot] [RFC PATCH 3/5] MAINTAINERS.boards: add initial version

2014-04-22 Thread Masahiro Yamada
Hi Albert,

> Can'we have the maintainer(s) be part of the board config file
> from the start, like a required (but possible non-editable)
> configuration item, something like "CONFIG_MAINTAINER_EMAIL"?
> 
> This would, at least, keep all information for a single board
> in a single place.

I did this (CONFIG_BOARD_MAINTAINER) in my RFC
http://patchwork.ozlabs.org/patch/330915/
(but user-editable)

I think everyone was opposed to my idea
and we chose to add MAINTAINERS file.

Best Regards
Masahiro Yamada

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