All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marek Vasut <marex@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v1] ARM: socfpga: stratix10: Probe FPGA status before bridge enable
Date: Fri, 3 May 2019 17:10:07 +0200	[thread overview]
Message-ID: <694515e3-5dd1-8167-faa6-b5943aa0b852@denx.de> (raw)
In-Reply-To: <1556871507-17614-1-git-send-email-chee.hong.ang@intel.com>

On 5/3/19 10:18 AM, chee.hong.ang at intel.com wrote:
> From: "Ang, Chee Hong" <chee.hong.ang@intel.com>
> 
> Send CONFIG_STATUS and RECONFIG_STATUS mailbox commands to Secure
> Device Manager (SDM) to get the status of FPGA and make sure the
> FPGA is in user mode before enable the bridge.
> 
> Signed-off-by: Ang, Chee Hong <chee.hong.ang@intel.com>
> ---
>  arch/arm/mach-socfpga/misc_s10.c | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/arch/arm/mach-socfpga/misc_s10.c b/arch/arm/mach-socfpga/misc_s10.c
> index 113eace..0e4133f 100644
> --- a/arch/arm/mach-socfpga/misc_s10.c
> +++ b/arch/arm/mach-socfpga/misc_s10.c
> @@ -16,6 +16,7 @@
>  #include <asm/arch/misc.h>
>  #include <asm/pl310.h>
>  #include <linux/libfdt.h>
> +#include <asm/arch/mailbox_s10.h>
>  
>  #include <dt-bindings/reset/altr,rst-mgr-s10.h>
>  
> @@ -152,5 +153,16 @@ int arch_early_init_r(void)
>  
>  void do_bridge_reset(int enable)
>  {
> +	/* Check FPGA status before bridge enable */
> +	if (enable) {
> +		int ret = mbox_get_fpga_config_status(MBOX_RECONFIG_STATUS);
> +
> +		if (ret && ret != MBOX_CFGSTAT_STATE_CONFIG)
> +			ret = mbox_get_fpga_config_status(MBOX_CONFIG_STATUS);
> +
> +		if (ret)
> +			return;
> +	}
> +
>  	socfpga_bridges_reset(enable);
>  }
> 
Applied, thanks

-- 
Best regards,
Marek Vasut

      reply	other threads:[~2019-05-03 15:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-03  8:18 [U-Boot] [PATCH v1] ARM: socfpga: stratix10: Probe FPGA status before bridge enable chee.hong.ang at intel.com
2019-05-03 15:10 ` Marek Vasut [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=694515e3-5dd1-8167-faa6-b5943aa0b852@denx.de \
    --to=marex@denx.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.