diff mbox

[U-Boot,v7,3/3] T1040QDS/U-QE: Add u-qe support to t1040qds

Message ID 1395390106-20439-3-git-send-email-B45475@freescale.com
State Accepted
Delegated to: York Sun
Headers show

Commit Message

Zhao Qiang March 21, 2014, 8:21 a.m. UTC
Add u-qe support for t1040qds

Signed-off-by: Zhao Qiang <B45475@freescale.com>
---
Changes for v2:
	- modify CONFIG_SYS_QE_FMAN_FW_ADDR to CONFIG_SYS_FMAN_FW_ADDR and CONFIG_SYS_QE_FW_ADDR
Changes for v3:
	- use CONFIG_U_QE instead of CONFIG_PPC_T1040
Changes for v4:
	- ifdef CONFIG_U_QE, include "../../../../drivers/qe/qe.h"
Changes for v5:
	- no
Changes for v6:
	- rebase
Changes for v7:
	- split to two patches, the one to support u-qe and the other is to add u-qe to t1040qds

 board/freescale/t1040qds/t1040qds.c | 27 +++++++++++++++++++++++++++
 include/configs/T1040QDS.h          |  3 +++
 2 files changed, 30 insertions(+)

Comments

York Sun March 26, 2014, 8:04 p.m. UTC | #1
On 03/21/2014 01:21 AM, Zhao Qiang wrote:
> Add u-qe support for t1040qds
> 
> Signed-off-by: Zhao Qiang <B45475@freescale.com>
> ---
> Changes for v2:
> 	- modify CONFIG_SYS_QE_FMAN_FW_ADDR to CONFIG_SYS_FMAN_FW_ADDR and CONFIG_SYS_QE_FW_ADDR
> Changes for v3:
> 	- use CONFIG_U_QE instead of CONFIG_PPC_T1040
> Changes for v4:
> 	- ifdef CONFIG_U_QE, include "../../../../drivers/qe/qe.h"
> Changes for v5:
> 	- no
> Changes for v6:
> 	- rebase
> Changes for v7:
> 	- split to two patches, the one to support u-qe and the other is to add u-qe to t1040qds
> 
>  board/freescale/t1040qds/t1040qds.c | 27 +++++++++++++++++++++++++++
>  include/configs/T1040QDS.h          |  3 +++
>  2 files changed, 30 insertions(+)
> 
> diff --git a/board/freescale/t1040qds/t1040qds.c b/board/freescale/t1040qds/t1040qds.c
> index 3dec447..d50ad42 100644
> --- a/board/freescale/t1040qds/t1040qds.c
> +++ b/board/freescale/t1040qds/t1040qds.c
> @@ -18,6 +18,7 @@
>  #include <asm/fsl_portals.h>
>  #include <asm/fsl_liodn.h>
>  #include <fm_eth.h>
> +#include <hwconfig.h>
>  
>  #include "../common/qixis.h"
>  #include "t1040qds.h"
> @@ -89,6 +90,30 @@ int select_i2c_ch_pca9547(u8 ch)
>  	return 0;
>  }
>  
> +static void qe_board_setup(void)
> +{
> +	u8 brdcfg15, brdcfg9;
> +
> +	if (hwconfig("qe") && hwconfig("tdm")) {


This is called before environmental variables are relocated to DDR. It will
cause a warning. Please use hwconfig_f.

York
York Sun April 16, 2014, 11:02 p.m. UTC | #2
On 03/26/2014 01:04 PM, York Sun wrote:
> On 03/21/2014 01:21 AM, Zhao Qiang wrote:
>>  
>> +static void qe_board_setup(void)
>> +{
>> +	u8 brdcfg15, brdcfg9;
>> +
>> +	if (hwconfig("qe") && hwconfig("tdm")) {
> 
> 
> This is called before environmental variables are relocated to DDR. It will
> cause a warning. Please use hwconfig_f.
> 

Please fix this patch with a new version. No need to submit other patches in
this set.

York
Zhao Qiang April 17, 2014, 1:39 a.m. UTC | #3
On 04/17/2014 07:03 PM, York Sun wrote:

> -----Original Message-----
> From: Sun York-R58495
> Sent: Thursday, April 17, 2014 7:03 AM
> To: Zhao Qiang-B45475; u-boot@lists.denx.de
> Cc: Xie Xiaobo-R63061
> Subject: Re: [U-Boot] [PATCH v7 3/3] T1040QDS/U-QE: Add u-qe support to
> t1040qds
> 
> On 03/26/2014 01:04 PM, York Sun wrote:
> > On 03/21/2014 01:21 AM, Zhao Qiang wrote:
> >>
> >> +static void qe_board_setup(void)
> >> +{
> >> +	u8 brdcfg15, brdcfg9;
> >> +
> >> +	if (hwconfig("qe") && hwconfig("tdm")) {
> >
> >
> > This is called before environmental variables are relocated to DDR. It
> > will cause a warning. Please use hwconfig_f.
> >
> 
> Please fix this patch with a new version. No need to submit other patches
> in this set.

This upstream patch,  qe_board_setup() is called in misc_init_r , it is correct,
Doesn't need to change.

> 
> York
> 

Regards,
Zhao Qiang
York Sun April 17, 2014, 1:42 a.m. UTC | #4
On 04/16/2014 06:39 PM, Zhao Qiang-B45475 wrote:
> On 04/17/2014 07:03 PM, York Sun wrote:
> 
>> -----Original Message-----
>> From: Sun York-R58495
>> Sent: Thursday, April 17, 2014 7:03 AM
>> To: Zhao Qiang-B45475; u-boot@lists.denx.de
>> Cc: Xie Xiaobo-R63061
>> Subject: Re: [U-Boot] [PATCH v7 3/3] T1040QDS/U-QE: Add u-qe support to
>> t1040qds
>>
>> On 03/26/2014 01:04 PM, York Sun wrote:
>>> On 03/21/2014 01:21 AM, Zhao Qiang wrote:
>>>>
>>>> +static void qe_board_setup(void)
>>>> +{
>>>> +	u8 brdcfg15, brdcfg9;
>>>> +
>>>> +	if (hwconfig("qe") && hwconfig("tdm")) {
>>>
>>>
>>> This is called before environmental variables are relocated to DDR. It
>>> will cause a warning. Please use hwconfig_f.
>>>
>>
>> Please fix this patch with a new version. No need to submit other patches
>> in this set.
> 
> This upstream patch,  qe_board_setup() is called in misc_init_r , it is correct,
> Doesn't need to change.
> 

OK. Thanks.

York
York Sun April 23, 2014, 10:19 p.m. UTC | #5
On 03/21/2014 01:21 AM, Zhao Qiang wrote:
> Add u-qe support for t1040qds
> 
> Signed-off-by: Zhao Qiang <B45475@freescale.com>
> ---
> Changes for v2:
> 	- modify CONFIG_SYS_QE_FMAN_FW_ADDR to CONFIG_SYS_FMAN_FW_ADDR and CONFIG_SYS_QE_FW_ADDR
> Changes for v3:
> 	- use CONFIG_U_QE instead of CONFIG_PPC_T1040
> Changes for v4:
> 	- ifdef CONFIG_U_QE, include "../../../../drivers/qe/qe.h"
> Changes for v5:
> 	- no
> Changes for v6:
> 	- rebase
> Changes for v7:
> 	- split to two patches, the one to support u-qe and the other is to add u-qe to t1040qds
> 


Applied to u-boot-mpc85xx/master, thanks.

York
diff mbox

Patch

diff --git a/board/freescale/t1040qds/t1040qds.c b/board/freescale/t1040qds/t1040qds.c
index 3dec447..d50ad42 100644
--- a/board/freescale/t1040qds/t1040qds.c
+++ b/board/freescale/t1040qds/t1040qds.c
@@ -18,6 +18,7 @@ 
 #include <asm/fsl_portals.h>
 #include <asm/fsl_liodn.h>
 #include <fm_eth.h>
+#include <hwconfig.h>
 
 #include "../common/qixis.h"
 #include "t1040qds.h"
@@ -89,6 +90,30 @@  int select_i2c_ch_pca9547(u8 ch)
 	return 0;
 }
 
+static void qe_board_setup(void)
+{
+	u8 brdcfg15, brdcfg9;
+
+	if (hwconfig("qe") && hwconfig("tdm")) {
+		brdcfg15 = QIXIS_READ(brdcfg[15]);
+		/*
+		 * TDMRiser uses QE-TDM
+		 * Route QE_TDM signals to TDM Riser slot
+		 */
+		QIXIS_WRITE(brdcfg[15], brdcfg15 | 7);
+	} else if (hwconfig("qe") && hwconfig("uart")) {
+		brdcfg15 = QIXIS_READ(brdcfg[15]);
+		brdcfg9 = QIXIS_READ(brdcfg[9]);
+		/*
+		 * Route QE_TDM signals to UCC
+		 * ProfiBus controlled by UCC3
+		 */
+		brdcfg15 &= 0xfc;
+		QIXIS_WRITE(brdcfg[15], brdcfg15 | 2);
+		QIXIS_WRITE(brdcfg[9], brdcfg9 | 4);
+	}
+}
+
 int board_early_init_r(void)
 {
 #ifdef CONFIG_SYS_FLASH_BASE
@@ -196,6 +221,8 @@  int misc_init_r(void)
 		}
 	}
 
+	qe_board_setup();
+
 	return 0;
 }
 
diff --git a/include/configs/T1040QDS.h b/include/configs/T1040QDS.h
index 84213b8..0340bb4 100644
--- a/include/configs/T1040QDS.h
+++ b/include/configs/T1040QDS.h
@@ -595,6 +595,8 @@  unsigned long get_board_ddr_clk(void);
 #define CONFIG_SYS_DPAA_FMAN
 #define CONFIG_SYS_DPAA_PME
 
+#define CONFIG_QE
+#define CONFIG_U_QE
 /* Default address of microcode for the Linux Fman driver */
 #if defined(CONFIG_SPIFLASH)
 /*
@@ -617,6 +619,7 @@  unsigned long get_board_ddr_clk(void);
 #else
 #define CONFIG_SYS_QE_FMAN_FW_IN_NOR
 #define CONFIG_SYS_FMAN_FW_ADDR		0xEFF00000
+#define CONFIG_SYS_QE_FW_ADDR		0xEFF10000
 #endif
 #define CONFIG_SYS_QE_FMAN_FW_LENGTH	0x10000
 #define CONFIG_SYS_FDT_PAD		(0x3000 + CONFIG_SYS_QE_FMAN_FW_LENGTH)