Re: [PATCH v4 8/9] memory: renesas-rpc-if: Add RZ/G3E xSPI support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 01/04/2025 16:35, Biju Das wrote:
>  int rpcif_manual_xfer(struct device *dev)
>  {
>  	struct rpcif_priv *rpc = dev_get_drvdata(dev);
> @@ -493,7 +769,7 @@ int rpcif_manual_xfer(struct device *dev)
>  	if (ret)
>  		return ret;
>  
> -	ret = rpcif_manual_xfer_impl(rpc);
> +	ret = rpc->info->impl->manual_xfer(rpc);
>  
>  	pm_runtime_put(dev);
>  
> @@ -543,6 +819,61 @@ static void memcpy_fromio_readw(void *to,
>  	}
>  }
>  

Missing kerneldoc. Exported functions shoud have kerneldoc.

> +ssize_t xspi_dirmap_write(struct device *dev, u64 offs, size_t len, const void *buf)
> +{
> +	struct rpcif_priv *xspi = dev_get_drvdata(dev);
> +	loff_t from = offs & (xspi->size - 1);
> +	u8 addsize = xspi->addr_nbytes - 1;
> +	size_t size = xspi->size - from;
> +	ssize_t writebytes;
> +	int ret;
> +> +	ret = pm_runtime_resume_and_get(dev);
> +	if (ret)
> +		return ret;
> +
> +	if (len > size)
> +		len = size;
> +
> +	if (len > MWRSIZE_MAX)
> +		writebytes = MWRSIZE_MAX;
> +	else
> +		writebytes = len;
> +
> +	regmap_update_bits(xspi->regmap, XSPI_CMCFG0CS0,
> +			   XSPI_CMCFG0_FFMT(0x3) | XSPI_CMCFG0_ADDSIZE(0x3),
> +			   XSPI_CMCFG0_FFMT(0) | XSPI_CMCFG0_ADDSIZE(addsize));
> +
> +	regmap_update_bits(xspi->regmap, XSPI_CMCFG2CS0,
> +			   XSPI_CMCFG2_WRCMD_UPPER(0xff) | XSPI_CMCFG2_WRLATE(0x1f),
> +			   XSPI_CMCFG2_WRCMD_UPPER(xspi->command) |
> +			   XSPI_CMCFG2_WRLATE(xspi->dummy));
> +
> +	regmap_update_bits(xspi->regmap, XSPI_BMCTL0,
> +			   XSPI_BMCTL0_CS0ACC(0xff), XSPI_BMCTL0_CS0ACC(0x03));
> +
> +	regmap_update_bits(xspi->regmap, XSPI_BMCFG,
> +			   XSPI_BMCFG_WRMD | XSPI_BMCFG_MWRCOMB |
> +			   XSPI_BMCFG_MWRSIZE(0xff) | XSPI_BMCFG_PREEN,
> +			   0 | XSPI_BMCFG_MWRCOMB | XSPI_BMCFG_MWRSIZE(0x0f) |
> +			   XSPI_BMCFG_PREEN);
> +
> +	regmap_update_bits(xspi->regmap, XSPI_LIOCFGCS0, XSPI_LIOCFG_PRTMD(0x3ff),
> +			   XSPI_LIOCFG_PRTMD(xspi->proto));
> +
> +	memcpy_toio(xspi->dirmap + from, buf, writebytes);
> +
> +	/* Request to push the pending data */
> +	if (writebytes < MWRSIZE_MAX)
> +		regmap_update_bits(xspi->regmap, XSPI_BMCTL1,
> +				   XSPI_BMCTL1_MWRPUSH, XSPI_BMCTL1_MWRPUSH);
> +
> +	pm_runtime_put(dev);
> +
> +	return writebytes;
> +}
> +EXPORT_SYMBOL(xspi_dirmap_write);

GPL

> +
Best regards,
Krzysztof




[Index of Archives]     [Linux Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux