mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Witold Sadowski <wsadowski@marvell.com>
Cc: linux-spi@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, jpawar@cadence.com,
	pthombar@cadence.com, konrad@cadence.com, wbartczak@marvell.com,
	wzmuda@marvell.com
Subject: Re: [PATCH 6/7] spi: cadence: Add Marvell IP modification changes
Date: Mon, 19 Dec 2022 18:27:36 +0000	[thread overview]
Message-ID: <Y6CtGEmi0wZUKaxT@sirena.org.uk> (raw)
In-Reply-To: <20221219144254.20883-7-wsadowski@marvell.com>

[-- Attachment #1: Type: text/plain, Size: 2000 bytes --]

On Mon, Dec 19, 2022 at 06:42:53AM -0800, Witold Sadowski wrote:
> Add support for Marvell IP modification - clock divider,
> and PHY config, and IRQ clearing.
> Clock divider block is build into Cadence XSPI controller
> and is connected directly to 800MHz clock.
> As PHY config is not set directly in IP block, driver can
> load custom PHY configuration values.

What is a PHY in the context of a SPI controller?

> +config SPI_CADENCE_MRVL_XSPI
> +	tristate "Marvell mods for XSPI controller"
> +	depends on SPI_CADENCE_XSPI
> +
> +	help

Extra blank line (does this work?).  It's not clear to me that there's
enough code here to justify a Kconfig.

> +	/*Reset DLL*/

Please follow the kernel coding style.

> @@ -328,6 +468,9 @@ static int cdns_xspi_controller_init(struct cdns_xspi_dev *cdns_xspi)
>  		return -EIO;
>  	}
>  
> +	writel(FIELD_PREP(CDNS_XSPI_CTRL_WORK_MODE, CDNS_XSPI_WORK_MODE_STIG),
> +	       cdns_xspi->iobase + CDNS_XSPI_CTRL_CONFIG_REG);
> +

This is done unconditionally, will other instances in the IP be OK with
it?  Should it be a separate commit since it's affecting everything?

> +#if IS_ENABLED(CONFIG_SPI_CADENCE_MRVL_XSPI)
> +	writel(CDNS_MSIX_CLEAR_IRQ, cdns_xspi->auxbase + CDNS_XSPI_SPIX_INTR_AUX);
> +#endif

This is not how we do support for variants of an IP, we need to support
a single kernel image for many different systems so variant handling
needs to be done with runtime selection not build time selection.
Please handle this in a similar way to how other drivers handle support
for multiple devices.

> +#if IS_ENABLED(CONFIG_SPI_CADENCE_MRVL_XSPI)
> +static int cdns_xspi_setup(struct spi_device *spi_dev)
> +{
> +	struct cdns_xspi_dev *cdns_xspi = spi_master_get_devdata(spi_dev->master);
> +
> +	cdns_xspi_setup_clock(cdns_xspi, spi_dev->max_speed_hz);
> +
> +	return 0;
> +}
> +#endif

Note that setup() might be called while other transfers are in progress
and should not affect them.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2022-12-19 18:27 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-19 14:42 [PATCH 0/7] Support for Marvell modifications for Cadence XSPI Witold Sadowski
2022-12-19 14:42 ` [PATCH 1/7] spi: cadence: Fix busy cycles calculation Witold Sadowski
2022-12-19 14:42 ` [PATCH 2/7] spi: cadence: Change dt-bindings documentation for Cadence XSPI controller Witold Sadowski
2022-12-20 14:08   ` Krzysztof Kozlowski
2022-12-19 14:42 ` [PATCH 3/7] spi: cadence: Add polling mode support Witold Sadowski
2022-12-19 18:05   ` kernel test robot
2022-12-19 14:42 ` [PATCH 4/7] spi: cadence: Change dt-bindings documentation for Cadence XSPI controller Witold Sadowski
2022-12-19 18:14   ` Mark Brown
2022-12-19 21:22   ` Rob Herring
2022-12-20 14:09   ` Krzysztof Kozlowski
2024-04-29 15:13     ` [EXT] " Witold Sadowski
2022-12-19 14:42 ` [PATCH 5/7] spi: cadence: Add read access size switch Witold Sadowski
2022-12-19 18:16   ` Mark Brown
2024-04-29 15:40     ` [EXT] " Witold Sadowski
2022-12-19 20:26   ` kernel test robot
2022-12-19 14:42 ` [PATCH 6/7] spi: cadence: Add Marvell IP modification changes Witold Sadowski
2022-12-19 18:27   ` Mark Brown [this message]
2024-04-29 15:27     ` [EXT] " Witold Sadowski
2022-12-20 14:12   ` Krzysztof Kozlowski
2024-04-29 15:10     ` [EXT] " Witold Sadowski
2022-12-19 14:42 ` [PATCH 7/7] spi: cadence: Force single modebyte Witold Sadowski
2022-12-19 18:28   ` Mark Brown
2022-12-27 11:57 ` (subset) [PATCH 0/7] Support for Marvell modifications for Cadence XSPI Mark Brown

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=Y6CtGEmi0wZUKaxT@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=jpawar@cadence.com \
    --cc=konrad@cadence.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=pthombar@cadence.com \
    --cc=wbartczak@marvell.com \
    --cc=wsadowski@marvell.com \
    --cc=wzmuda@marvell.com \
    /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

all inboxes | Powered by JetHome®