All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] board/t4240rdb: VID support
@ 2015-12-10  5:33 ying.zhang at freescale.com
  2016-01-20 22:26 ` york sun
       [not found] ` <56A00997.8040607@nxp.com>
  0 siblings, 2 replies; 6+ messages in thread
From: ying.zhang at freescale.com @ 2015-12-10  5:33 UTC (permalink / raw)
  To: u-boot

From: Ying Zhang <b40530@freescale.com>

The fuse status register provides the values from on-chip
voltage ID efuses programmed at the factory.
These values define the voltage requirements for
the chip. u-boot reads FUSESR and translates the values
into the appropriate commands to set the voltage output
value of an external voltage regulator.

Signed-off-by: Ying Zhang <b40530@freescale.com>
---
 board/freescale/common/vid.c     |  2 +-
 board/freescale/t4rdb/t4240rdb.c |  7 +++++++
 include/configs/T4240RDB.h       | 10 ++++++++++
 3 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/board/freescale/common/vid.c b/board/freescale/common/vid.c
index f1bed51..571e105 100644
--- a/board/freescale/common/vid.c
+++ b/board/freescale/common/vid.c
@@ -42,7 +42,7 @@ int __weak board_vdd_drop_compensation(void)
  * The IR chip can show up under the following addresses:
  * 0x08 (Verified on T1040RDB-PA,T4240RDB-PB,X-T4240RDB-16GPA)
  * 0x09 (Verified on T1040RDB-PA)
- * 0x38 (Verified on T2080QDS, T2081QDS)
+ * 0x38 (Verified on T2080QDS, T2081QDS, T4240RDB)
  */
 static int find_ir_chip_on_i2c(void)
 {
diff --git a/board/freescale/t4rdb/t4240rdb.c b/board/freescale/t4rdb/t4240rdb.c
index fac442b..99a8730 100644
--- a/board/freescale/t4rdb/t4240rdb.c
+++ b/board/freescale/t4rdb/t4240rdb.c
@@ -21,6 +21,7 @@
 
 #include "t4rdb.h"
 #include "cpld.h"
+#include "../common/vid.h"
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -79,6 +80,12 @@ int board_early_init_r(void)
 #ifdef CONFIG_SYS_DPAA_QBMAN
 	setup_portals();
 #endif
+	/*
+	 * Adjust core voltage according to voltage ID
+	 * This function changes I2C mux to channel 2.
+	*/
+	if (adjust_vdd(0))
+		printf("Warning: Adjusting core voltage failed.\n");
 
 	return 0;
 }
diff --git a/include/configs/T4240RDB.h b/include/configs/T4240RDB.h
index 73279c8..4a17f41 100644
--- a/include/configs/T4240RDB.h
+++ b/include/configs/T4240RDB.h
@@ -606,6 +606,16 @@ unsigned long get_board_ddr_clk(void);
 #define I2C_VOL_MONITOR_BUS_V_OVF	0x1
 #define I2C_VOL_MONITOR_BUS_V_SHIFT	3
 
+#define CONFIG_VID_FLS_ENV		"t4240rdb_vdd_mv"
+#ifndef CONFIG_SPL_BUILD
+#define CONFIG_VID
+#endif
+#define CONFIG_VOL_MONITOR_IR36021_SET
+#define CONFIG_VOL_MONITOR_IR36021_READ
+/* The lowest and highest voltage allowed for T4240RDB */
+#define VDD_MV_MIN			819
+#define VDD_MV_MAX			1212
+
 /*
  * eSPI - Enhanced SPI
  */
-- 
1.8.4.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH] board/t4240rdb: VID support
  2015-12-10  5:33 [U-Boot] [PATCH] board/t4240rdb: VID support ying.zhang at freescale.com
@ 2016-01-20 22:26 ` york sun
       [not found] ` <56A00997.8040607@nxp.com>
  1 sibling, 0 replies; 6+ messages in thread
From: york sun @ 2016-01-20 22:26 UTC (permalink / raw)
  To: u-boot

On 12/09/2015 11:00 PM, ying.zhang at freescale.com wrote:
> From: Ying Zhang <b40530@freescale.com>
> 
> The fuse status register provides the values from on-chip
> voltage ID efuses programmed at the factory.
> These values define the voltage requirements for
> the chip. u-boot reads FUSESR and translates the values
> into the appropriate commands to set the voltage output
> value of an external voltage regulator.
> 
> Signed-off-by: Ying Zhang <b40530@freescale.com>
> ---
>  board/freescale/common/vid.c     |  2 +-
>  board/freescale/t4rdb/t4240rdb.c |  7 +++++++
>  include/configs/T4240RDB.h       | 10 ++++++++++
>  3 files changed, 18 insertions(+), 1 deletion(-)
> 
> diff --git a/board/freescale/common/vid.c b/board/freescale/common/vid.c
> index f1bed51..571e105 100644
> --- a/board/freescale/common/vid.c
> +++ b/board/freescale/common/vid.c
> @@ -42,7 +42,7 @@ int __weak board_vdd_drop_compensation(void)
>   * The IR chip can show up under the following addresses:
>   * 0x08 (Verified on T1040RDB-PA,T4240RDB-PB,X-T4240RDB-16GPA)
>   * 0x09 (Verified on T1040RDB-PA)
> - * 0x38 (Verified on T2080QDS, T2081QDS)
> + * 0x38 (Verified on T2080QDS, T2081QDS, T4240RDB)
>   */
>  static int find_ir_chip_on_i2c(void)
>  {
> diff --git a/board/freescale/t4rdb/t4240rdb.c b/board/freescale/t4rdb/t4240rdb.c
> index fac442b..99a8730 100644
> --- a/board/freescale/t4rdb/t4240rdb.c
> +++ b/board/freescale/t4rdb/t4240rdb.c
> @@ -21,6 +21,7 @@
>  
>  #include "t4rdb.h"
>  #include "cpld.h"
> +#include "../common/vid.h"
>  
>  DECLARE_GLOBAL_DATA_PTR;
>  
> @@ -79,6 +80,12 @@ int board_early_init_r(void)
>  #ifdef CONFIG_SYS_DPAA_QBMAN
>  	setup_portals();
>  #endif
> +	/*
> +	 * Adjust core voltage according to voltage ID
> +	 * This function changes I2C mux to channel 2.
> +	*/
> +	if (adjust_vdd(0))
> +		printf("Warning: Adjusting core voltage failed.\n");
>  
>  	return 0;
>  }
> diff --git a/include/configs/T4240RDB.h b/include/configs/T4240RDB.h
> index 73279c8..4a17f41 100644
> --- a/include/configs/T4240RDB.h
> +++ b/include/configs/T4240RDB.h
> @@ -606,6 +606,16 @@ unsigned long get_board_ddr_clk(void);
>  #define I2C_VOL_MONITOR_BUS_V_OVF	0x1
>  #define I2C_VOL_MONITOR_BUS_V_SHIFT	3
>  
> +#define CONFIG_VID_FLS_ENV		"t4240rdb_vdd_mv"
> +#ifndef CONFIG_SPL_BUILD
> +#define CONFIG_VID
> +#endif
> +#define CONFIG_VOL_MONITOR_IR36021_SET
> +#define CONFIG_VOL_MONITOR_IR36021_READ
> +/* The lowest and highest voltage allowed for T4240RDB */
> +#define VDD_MV_MIN			819
> +#define VDD_MV_MAX			1212
> +
>  /*
>   * eSPI - Enhanced SPI
>   */
> 

Ying,

This patch looks OK but the board doesn't work. I traced the code to the first
setting voltage. The VID has 1025mV and current voltage is 1047mV. As soon as
the code drops voltage by one step, the board hangs. Please double check if the
voltage setting is correct. You can measure it on the board to confirm.

York

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH] board/t4240rdb: VID support
       [not found] ` <56A00997.8040607@nxp.com>
@ 2016-01-20 22:29   ` york sun
  2016-01-21  2:05     ` Ying Zhang
  0 siblings, 1 reply; 6+ messages in thread
From: york sun @ 2016-01-20 22:29 UTC (permalink / raw)
  To: u-boot

On 01/20/2016 02:26 PM, york.sun at nxp.com wrote:

<snip>

> Ying,
> 
> This patch looks OK but the board doesn't work. I traced the code to the first
> setting voltage. The VID has 1025mV and current voltage is 1047mV. As soon as
> the code drops voltage by one step, the board hangs. Please double check if the
> voltage setting is correct. You can measure it on the board to confirm.
> 

I tested it on top of b57843e68804c2d53d2cff2b8b2238e37b388faa, with two boards.
The result is the same.

York

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH] board/t4240rdb: VID support
  2016-01-20 22:29   ` york sun
@ 2016-01-21  2:05     ` Ying Zhang
  2016-01-21  2:52       ` york sun
  0 siblings, 1 reply; 6+ messages in thread
From: Ying Zhang @ 2016-01-21  2:05 UTC (permalink / raw)
  To: u-boot

Hi, York,
	I know this issue. It's occurred because the IR chip on T4RDB worked on AMD mode, it can work well on INTEL mode.
	Nexcom will collect all the boards and set the IR chip to INTEL mode.
	Before that, What should we do?

	Thanks.

	

-----Original Message-----
From: york sun [mailto:york.sun at nxp.com] 
Sent: Thursday, January 21, 2016 6:29 AM
To: ying.zhang at freescale.com; u-boot at lists.denx.de
Subject: Re: [PATCH] board/t4240rdb: VID support

On 01/20/2016 02:26 PM, york.sun at nxp.com wrote:

<snip>

> Ying,
> 
> This patch looks OK but the board doesn't work. I traced the code to 
> the first setting voltage. The VID has 1025mV and current voltage is 
> 1047mV. As soon as the code drops voltage by one step, the board 
> hangs. Please double check if the voltage setting is correct. You can measure it on the board to confirm.
> 

I tested it on top of b57843e68804c2d53d2cff2b8b2238e37b388faa, with two boards.
The result is the same.

York

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH] board/t4240rdb: VID support
  2016-01-21  2:05     ` Ying Zhang
@ 2016-01-21  2:52       ` york sun
  2016-01-21  2:56         ` Ying Zhang
  0 siblings, 1 reply; 6+ messages in thread
From: york sun @ 2016-01-21  2:52 UTC (permalink / raw)
  To: u-boot

Can software detect IR mode and support both? Or skip the vid part if the mode is not supported?

York


-------- Original Message --------
From: Ying Zhang <ying.zhang22455@nxp.com>
Sent: Wednesday, January 20, 2016 06:05 PM
To: york sun <york.sun@nxp.com>,ying.zhang at freescale.com,u-boot at lists.denx.de
Subject: RE: [PATCH] board/t4240rdb: VID support


Hi, York,
I know this issue. It's occurred because the IR chip on T4RDB worked on AMD mode, it can work well on INTEL mode.
Nexcom will collect all the boards and set the IR chip to INTEL mode.
Before that, What should we do?

Thanks.



-----Original Message-----
From: york sun [mailto:york.sun at nxp.com]
Sent: Thursday, January 21, 2016 6:29 AM
To: ying.zhang at freescale.com; u-boot at lists.denx.de
Subject: Re: [PATCH] board/t4240rdb: VID support

On 01/20/2016 02:26 PM, york.sun at nxp.com wrote:

<snip>

> Ying,
>
> This patch looks OK but the board doesn't work. I traced the code to
> the first setting voltage. The VID has 1025mV and current voltage is
> 1047mV. As soon as the code drops voltage by one step, the board
> hangs. Please double check if the voltage setting is correct. You can measure it on the board to confirm.
>

I tested it on top of b57843e68804c2d53d2cff2b8b2238e37b388faa, with two boards.
The result is the same.

York

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH] board/t4240rdb: VID support
  2016-01-21  2:52       ` york sun
@ 2016-01-21  2:56         ` Ying Zhang
  0 siblings, 0 replies; 6+ messages in thread
From: Ying Zhang @ 2016-01-21  2:56 UTC (permalink / raw)
  To: u-boot

Hi, York,
                All the boards are required to set to Intel mode. If it?s not in Intel mode, VID is not support.
                I have a look how to do.

                Thanks.

From: york sun
Sent: Thursday, January 21, 2016 10:53 AM
To: Ying Zhang; ying.zhang at freescale.com; u-boot at lists.denx.de
Subject: RE: [PATCH] board/t4240rdb: VID support


Can software detect IR mode and support both? Or skip the vid part if the mode is not supported?

York


-------- Original Message --------
From: Ying Zhang <ying.zhang22455 at nxp.com<mailto:ying.zhang22455@nxp.com>>
Sent: Wednesday, January 20, 2016 06:05 PM
To: york sun <york.sun at nxp.com<mailto:york.sun@nxp.com>>,ying.zhang at freescale.com,u-boot at lists.denx.de
Subject: RE: [PATCH] board/t4240rdb: VID support

Hi, York,
I know this issue. It's occurred because the IR chip on T4RDB worked on AMD mode, it can work well on INTEL mode.
Nexcom will collect all the boards and set the IR chip to INTEL mode.
Before that, What should we do?

Thanks.



-----Original Message-----
From: york sun [mailto:york.sun at nxp.com]
Sent: Thursday, January 21, 2016 6:29 AM
To: ying.zhang at freescale.com<mailto:ying.zhang@freescale.com>; u-boot at lists.denx.de<mailto:u-boot@lists.denx.de>
Subject: Re: [PATCH] board/t4240rdb: VID support

On 01/20/2016 02:26 PM, york.sun at nxp.com<mailto:york.sun@nxp.com> wrote:

<snip>

> Ying,
>
> This patch looks OK but the board doesn't work. I traced the code to
> the first setting voltage. The VID has 1025mV and current voltage is
> 1047mV. As soon as the code drops voltage by one step, the board
> hangs. Please double check if the voltage setting is correct. You can measure it on the board to confirm.
>

I tested it on top of b57843e68804c2d53d2cff2b8b2238e37b388faa, with two boards.
The result is the same.

York

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-01-21  2:56 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-10  5:33 [U-Boot] [PATCH] board/t4240rdb: VID support ying.zhang at freescale.com
2016-01-20 22:26 ` york sun
     [not found] ` <56A00997.8040607@nxp.com>
2016-01-20 22:29   ` york sun
2016-01-21  2:05     ` Ying Zhang
2016-01-21  2:52       ` york sun
2016-01-21  2:56         ` Ying Zhang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.