public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Michal Simek <monstr@monstr.eu>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] spi: zynq_qspi: Add configuration to disable LQSPI feature
Date: Wed, 9 Dec 2015 09:11:41 +0100	[thread overview]
Message-ID: <5667E23D.5000002@monstr.eu> (raw)
In-Reply-To: <1449585883-13332-1-git-send-email-nathan@nathanrossi.com>

On 8.12.2015 15:44, Nathan Rossi wrote:
> When the Zynq Boot ROM code loads the payload from QSPI it uses the
> LQSPI feature of the QSPI device, however it does not clean up its
> configuration before handing over to the payload which leaves the device
> confgured to by-pass the standard non-linear operating mode.
> 
> This ensures the Linear QSPI mode is disabled before re-enabling the
> device.
> 
> Signed-off-by: Nathan Rossi <nathan@nathanrossi.com>
> Cc: Jagan Teki <jteki@openedev.com>
> Cc: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
> Cc: Simon Glass <sjg@chromium.org>
> ---
>  drivers/spi/zynq_qspi.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/drivers/spi/zynq_qspi.c b/drivers/spi/zynq_qspi.c
> index 5825c6d..b98663c 100644
> --- a/drivers/spi/zynq_qspi.c
> +++ b/drivers/spi/zynq_qspi.c
> @@ -30,6 +30,7 @@ DECLARE_GLOBAL_DATA_PTR;
>  #define ZYNQ_QSPI_IXR_TXOW_MASK		BIT(2)	/* TX_FIFO_not_full */
>  #define ZYNQ_QSPI_IXR_ALL_MASK		GENMASK(6, 0)	/* All IXR bits */
>  #define ZYNQ_QSPI_ENR_SPI_EN_MASK	BIT(0)	/* SPI Enable */
> +#define ZYNQ_QSPI_LQSPICFG_LQMODE_MASK	BIT(31) /* Linear QSPI Mode */
>  
>  /* zynq qspi Transmit Data Register */
>  #define ZYNQ_QSPI_TXD_00_00_OFFSET	0x1C	/* Transmit 4-byte inst */
> @@ -68,6 +69,9 @@ struct zynq_qspi_regs {
>  	u32 txd1r;	/* 0x80 */
>  	u32 txd2r;	/* 0x84 */
>  	u32 txd3r;	/* 0x88 */
> +	u32 reserved1[5];
> +	u32 lqspicfg;	/* 0xA0 */
> +	u32 lqspists;	/* 0xA4 */
>  };
>  
>  /* zynq qspi platform data */
> @@ -143,6 +147,11 @@ static void zynq_qspi_init_hw(struct zynq_qspi_priv *priv)
>  		ZYNQ_QSPI_CR_MSTREN_MASK;
>  	writel(confr, &regs->cr);
>  
> +	/* Disable the LQSPI feature */
> +	confr = readl(&regs->lqspicfg);
> +	confr &= ~ZYNQ_QSPI_LQSPICFG_LQMODE_MASK;
> +	writel(confr, &regs->lqspicfg);
> +
>  	/* Enable SPI */
>  	writel(ZYNQ_QSPI_ENR_SPI_EN_MASK, &regs->enr);
>  }
> 

Applied to zynq tree.

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


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20151209/fe2753ce/attachment.sig>

      parent reply	other threads:[~2015-12-09  8:11 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-08 14:44 [U-Boot] [PATCH] spi: zynq_qspi: Add configuration to disable LQSPI feature Nathan Rossi
2015-12-08 14:44 ` [U-Boot] [PATCH] spl: dm: Enable DM_SEQ_ALIAS Nathan Rossi
2015-12-08 19:35   ` Simon Glass
2015-12-08 14:44 ` [U-Boot] [PATCH] arm: zynq: Update ZYBO config options Nathan Rossi
2015-12-09  8:12   ` Michal Simek
2015-12-08 14:44 ` [U-Boot] [PATCH] tools: zynqimage: Clean up check_params Nathan Rossi
2015-12-08 15:03   ` Tom Rini
2015-12-09  7:46     ` Michal Simek
2015-12-09  8:11 ` Michal Simek [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=5667E23D.5000002@monstr.eu \
    --to=monstr@monstr.eu \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox