All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] arm: socfpga: stratix10: Enable EMAC to FPGA bridge based on handoff
@ 2018-08-17  8:22 Ley Foon Tan
  2018-08-17  8:22 ` [U-Boot] [PATCH] arm: socfpga: stratix10: Fix mailbox urgent command with urgent register Ley Foon Tan
  2018-08-17 10:08 ` [U-Boot] [PATCH] arm: socfpga: stratix10: Enable EMAC to FPGA bridge based on handoff Marek Vasut
  0 siblings, 2 replies; 4+ messages in thread
From: Ley Foon Tan @ 2018-08-17  8:22 UTC (permalink / raw)
  To: u-boot

Code checking and setting EMAC use fpga is in
populate_sysmgr_fpgaintf_module(). So, call to sysmgr_pinmux_init()
instead of populate_sysmgr_pinmux().
In sysmgr_pinmux_init(), it will call to both populate_sysmgr_pinmux()
and populate_sysmgr_fpgaintf_module().

Signed-off-by: Ley Foon Tan <ley.foon.tan@intel.com>
---
 arch/arm/mach-socfpga/spl_s10.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-socfpga/spl_s10.c b/arch/arm/mach-socfpga/spl_s10.c
index 69d6e91..cc5dc4f 100644
--- a/arch/arm/mach-socfpga/spl_s10.c
+++ b/arch/arm/mach-socfpga/spl_s10.c
@@ -136,7 +136,7 @@ void board_init_f(ulong dummy)
 	socfpga_per_reset(SOCFPGA_RESET(OSC1TIMER0), 0);
 	timer_init();
 
-	populate_sysmgr_pinmux();
+	sysmgr_pinmux_init();
 
 	/* configuring the HPS clocks */
 	cm_basic_init(cm_default_cfg);
-- 
2.2.2

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

* [U-Boot] [PATCH] arm: socfpga: stratix10: Fix mailbox urgent command with urgent register
  2018-08-17  8:22 [U-Boot] [PATCH] arm: socfpga: stratix10: Enable EMAC to FPGA bridge based on handoff Ley Foon Tan
@ 2018-08-17  8:22 ` Ley Foon Tan
  2018-08-17 10:08   ` Marek Vasut
  2018-08-17 10:08 ` [U-Boot] [PATCH] arm: socfpga: stratix10: Enable EMAC to FPGA bridge based on handoff Marek Vasut
  1 sibling, 1 reply; 4+ messages in thread
From: Ley Foon Tan @ 2018-08-17  8:22 UTC (permalink / raw)
  To: u-boot

According to mailbox spec, software should send urgent command with
urgent register instead of COUT location. This patch write urgent
command index to urgent register.

Signed-off-by: Ley Foon Tan <ley.foon.tan@intel.com>
---
 arch/arm/mach-socfpga/mailbox_s10.c | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/arch/arm/mach-socfpga/mailbox_s10.c b/arch/arm/mach-socfpga/mailbox_s10.c
index cccd1a4..0d906c3 100644
--- a/arch/arm/mach-socfpga/mailbox_s10.c
+++ b/arch/arm/mach-socfpga/mailbox_s10.c
@@ -160,15 +160,15 @@ static __always_inline int mbox_send_cmd_common(u8 id, u32 cmd, u8 is_indirect,
 	u32 buf_len;
 	int ret;
 
-	ret = mbox_prepare_cmd_only(id, cmd, is_indirect, len, arg);
-	if (ret)
-		return ret;
-
 	if (urgent) {
 		/* Read status because it is toggled */
 		status = MBOX_READL(MBOX_STATUS) & MBOX_STATUS_UA_MSK;
-		/* Send command as urgent command */
-		MBOX_WRITEL(1, MBOX_URG);
+		/* Write urgent command to urgent register */
+		MBOX_WRITEL(cmd, MBOX_URG);
+	} else {
+		ret = mbox_prepare_cmd_only(id, cmd, is_indirect, len, arg);
+		if (ret)
+			return ret;
 	}
 
 	/* write doorbell */
@@ -188,8 +188,7 @@ static __always_inline int mbox_send_cmd_common(u8 id, u32 cmd, u8 is_indirect,
 
 		if (urgent) {
 			u32 new_status = MBOX_READL(MBOX_STATUS);
-			/* urgent command doesn't have response */
-			MBOX_WRITEL(0, MBOX_URG);
+
 			/* Urgent ACK is toggled */
 			if ((new_status & MBOX_STATUS_UA_MSK) ^ status)
 				return 0;
-- 
2.2.2

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

* [U-Boot] [PATCH] arm: socfpga: stratix10: Enable EMAC to FPGA bridge based on handoff
  2018-08-17  8:22 [U-Boot] [PATCH] arm: socfpga: stratix10: Enable EMAC to FPGA bridge based on handoff Ley Foon Tan
  2018-08-17  8:22 ` [U-Boot] [PATCH] arm: socfpga: stratix10: Fix mailbox urgent command with urgent register Ley Foon Tan
@ 2018-08-17 10:08 ` Marek Vasut
  1 sibling, 0 replies; 4+ messages in thread
From: Marek Vasut @ 2018-08-17 10:08 UTC (permalink / raw)
  To: u-boot

On 08/17/2018 10:22 AM, Ley Foon Tan wrote:
> Code checking and setting EMAC use fpga is in
> populate_sysmgr_fpgaintf_module(). So, call to sysmgr_pinmux_init()
> instead of populate_sysmgr_pinmux().
> In sysmgr_pinmux_init(), it will call to both populate_sysmgr_pinmux()
> and populate_sysmgr_fpgaintf_module().
> 
> Signed-off-by: Ley Foon Tan <ley.foon.tan@intel.com>
> ---
>  arch/arm/mach-socfpga/spl_s10.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/arm/mach-socfpga/spl_s10.c b/arch/arm/mach-socfpga/spl_s10.c
> index 69d6e91..cc5dc4f 100644
> --- a/arch/arm/mach-socfpga/spl_s10.c
> +++ b/arch/arm/mach-socfpga/spl_s10.c
> @@ -136,7 +136,7 @@ void board_init_f(ulong dummy)
>  	socfpga_per_reset(SOCFPGA_RESET(OSC1TIMER0), 0);
>  	timer_init();
>  
> -	populate_sysmgr_pinmux();
> +	sysmgr_pinmux_init();
>  
>  	/* configuring the HPS clocks */
>  	cm_basic_init(cm_default_cfg);
> 
Applied, thanks.

-- 
Best regards,
Marek Vasut

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

* [U-Boot] [PATCH] arm: socfpga: stratix10: Fix mailbox urgent command with urgent register
  2018-08-17  8:22 ` [U-Boot] [PATCH] arm: socfpga: stratix10: Fix mailbox urgent command with urgent register Ley Foon Tan
@ 2018-08-17 10:08   ` Marek Vasut
  0 siblings, 0 replies; 4+ messages in thread
From: Marek Vasut @ 2018-08-17 10:08 UTC (permalink / raw)
  To: u-boot

On 08/17/2018 10:22 AM, Ley Foon Tan wrote:
> According to mailbox spec, software should send urgent command with
> urgent register instead of COUT location. This patch write urgent
> command index to urgent register.
> 
> Signed-off-by: Ley Foon Tan <ley.foon.tan@intel.com>
> ---
>  arch/arm/mach-socfpga/mailbox_s10.c | 15 +++++++--------
>  1 file changed, 7 insertions(+), 8 deletions(-)
> 
> diff --git a/arch/arm/mach-socfpga/mailbox_s10.c b/arch/arm/mach-socfpga/mailbox_s10.c
> index cccd1a4..0d906c3 100644
> --- a/arch/arm/mach-socfpga/mailbox_s10.c
> +++ b/arch/arm/mach-socfpga/mailbox_s10.c
> @@ -160,15 +160,15 @@ static __always_inline int mbox_send_cmd_common(u8 id, u32 cmd, u8 is_indirect,
>  	u32 buf_len;
>  	int ret;
>  
> -	ret = mbox_prepare_cmd_only(id, cmd, is_indirect, len, arg);
> -	if (ret)
> -		return ret;
> -
>  	if (urgent) {
>  		/* Read status because it is toggled */
>  		status = MBOX_READL(MBOX_STATUS) & MBOX_STATUS_UA_MSK;
> -		/* Send command as urgent command */
> -		MBOX_WRITEL(1, MBOX_URG);
> +		/* Write urgent command to urgent register */
> +		MBOX_WRITEL(cmd, MBOX_URG);
> +	} else {
> +		ret = mbox_prepare_cmd_only(id, cmd, is_indirect, len, arg);
> +		if (ret)
> +			return ret;
>  	}
>  
>  	/* write doorbell */
> @@ -188,8 +188,7 @@ static __always_inline int mbox_send_cmd_common(u8 id, u32 cmd, u8 is_indirect,
>  
>  		if (urgent) {
>  			u32 new_status = MBOX_READL(MBOX_STATUS);
> -			/* urgent command doesn't have response */
> -			MBOX_WRITEL(0, MBOX_URG);
> +
>  			/* Urgent ACK is toggled */
>  			if ((new_status & MBOX_STATUS_UA_MSK) ^ status)
>  				return 0;
> 
Applied, thanks.

-- 
Best regards,
Marek Vasut

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

end of thread, other threads:[~2018-08-17 10:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-17  8:22 [U-Boot] [PATCH] arm: socfpga: stratix10: Enable EMAC to FPGA bridge based on handoff Ley Foon Tan
2018-08-17  8:22 ` [U-Boot] [PATCH] arm: socfpga: stratix10: Fix mailbox urgent command with urgent register Ley Foon Tan
2018-08-17 10:08   ` Marek Vasut
2018-08-17 10:08 ` [U-Boot] [PATCH] arm: socfpga: stratix10: Enable EMAC to FPGA bridge based on handoff Marek Vasut

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.