Re: [PATCH v3 3/4] crypto: amlogic: Add crypto accelerator for amlogic GXL

2019-10-17 Thread Neil Armstrong
is flow > + * @keylen: keylen for this flow operation > + * @complete:completion for the current task on this flow > + * @status: set to 1 by interrupt if task is done > + * @t_phy: Physical address of task > + * @tl: pointer to the current ce_task for this flow > + * @stat_req:number of request done by this flow > + */ > +struct meson_flow { > + struct crypto_engine *engine; > + struct completion complete; > + int status; > + unsigned int keylen; > + dma_addr_t t_phy; > + struct meson_desc *tl; > +#ifdef CONFIG_CRYPTO_DEV_AMLOGIC_GXL_DEBUG > + unsigned long stat_req; > +#endif > +}; > + > +/* > + * struct meson_dev - main container for all this driver information > + * @base:base address of amlogic-crypto > + * @busclk: bus clock for amlogic-crypto > + * @dev: the platform device > + * @chanlist:array of all flow > + * @flow:flow to use in next request > + * @irqs:IRQ numbers for amlogic-crypto > + * @dbgfs_dir: Debugfs dentry for statistic directory > + * @dbgfs_stats: Debugfs dentry for statistic counters > + */ > +struct meson_dev { > + void __iomem *base; > + struct clk *busclk; > + struct device *dev; > + struct meson_flow *chanlist; > + atomic_t flow; > + int *irqs; > +#ifdef CONFIG_CRYPTO_DEV_AMLOGIC_GXL_DEBUG > + struct dentry *dbgfs_dir; > +#endif > +}; > + > +/* > + * struct meson_cipher_req_ctx - context for a skcipher request > + * @op_dir: direction (encrypt vs decrypt) for this request > + * @flow:the flow to use for this request > + */ > +struct meson_cipher_req_ctx { > + u32 op_dir; > + int flow; > +}; > + > +/* > + * struct meson_cipher_tfm_ctx - context for a skcipher TFM > + * @enginectx: crypto_engine used by this TFM > + * @key: pointer to key data > + * @keylen: len of the key > + * @keymode: The keymode(type and size of key) associated with this > TFM > + * @mc: pointer to the private data of driver handling > this TFM > + * @fallback_tfm:pointer to the fallback TFM > + */ > +struct meson_cipher_tfm_ctx { > + struct crypto_engine_ctx enginectx; > + u32 *key; > + u32 keylen; > + u32 keymode; > + struct meson_dev *mc; > + struct crypto_sync_skcipher *fallback_tfm; > +}; > + > +/* > + * struct meson_alg_template - crypto_alg template > + * @type:the CRYPTO_ALG_TYPE for this template > + * @blockmode: the type of block operation > + * @mc: pointer to the meson_dev structure associated > with this template > + * @alg: one of sub struct must be used > + * @stat_req:number of request done on this template > + * @stat_fb: total of all data len done on this template > + */ > +struct meson_alg_template { > + u32 type; > + u32 blockmode; > + union { > + struct skcipher_alg skcipher; > + } alg; > + struct meson_dev *mc; > +#ifdef CONFIG_CRYPTO_DEV_AMLOGIC_GXL_DEBUG > + unsigned long stat_req; > + unsigned long stat_fb; > +#endif > +}; > + > +int meson_enqueue(struct crypto_async_request *areq, u32 type); > + > +int meson_aes_setkey(struct crypto_skcipher *tfm, const u8 *key, > + unsigned int keylen); > +int meson_cipher_init(struct crypto_tfm *tfm); > +void meson_cipher_exit(struct crypto_tfm *tfm); > +int meson_skdecrypt(struct skcipher_request *areq); > +int meson_skencrypt(struct skcipher_request *areq); > Thanks for working on this ! For the record, this is the driver for the GXL Family (S905X, S905D, S905W, S905L, S805X, S805Y) and GXM (S912) only. The previous GXBB family crypto accelerator seems broken, thus not supported, And the next G12A/G12B/SM1 (S905X2, S905Y2, S905D2, S922X, A311D, S905X3, S905Y3, S905D3) generation has a slightly different crypto accelerator HW, with different supported features, with other bugs and limitations ! Reviewed-by: Neil Armstrong Neil

[PATCH 0/9] dt-bindings: first tentative of conversion to yaml format

2019-08-08 Thread Neil Armstrong
renamed yaml files using amlogic prefix Neil Armstrong (9): dt-bindings: mailbox: meson-mhu: convert to yaml dt-bindings: rng: amlogic,meson-rng: convert to yaml dt-bindings: spi: meson: convert to yaml dt-bindings: reset: amlogic,meson-reset: convert to yaml dt-bindings: arm: amlogic: a

[PATCH 2/9] dt-bindings: rng: amlogic,meson-rng: convert to yaml

2019-08-08 Thread Neil Armstrong
Now that we have the DT validation in place, let's convert the device tree bindings for the Amlogic Random Number generator over to a YAML schemas. Reviewed-by: Rob Herring Reviewed-by: Martin Blumenstingl Signed-off-by: Neil Armstrong --- .../bindings/rng/amlogic,meson-rng.txt

Re: [RFCv2 0/9] dt-bindings: first tentative of conversion to yaml format

2019-08-06 Thread Neil Armstrong
Hi Rob, On 05/08/2019 23:51, Rob Herring wrote: > On Mon, Aug 5, 2019 at 6:03 AM Neil Armstrong wrote: >> >> This is a first tentative to convert some of the simplest Amlogic >> dt-bindings to the yaml format. >> >> All have been tested using : >> $ make

[RFCv2 2/9] dt-bindings: rng: amlogic,meson-rng: convert to yaml

2019-08-05 Thread Neil Armstrong
Now that we have the DT validation in place, let's convert the device tree bindings for the Amlogic Random Number generator over to a YAML schemas. Signed-off-by: Neil Armstrong --- .../bindings/rng/amlogic,meson-rng.txt| 21 --- .../bindings/rng/amlogic,meson-rng

[RFCv2 0/9] dt-bindings: first tentative of conversion to yaml format

2019-08-05 Thread Neil Armstrong
bindings are acked. Changes since rfc v1: - Fixed bindings according to Rob's comments - Added commit log - renamed yaml files using amlogic prefix Neil Armstrong (9): dt-bindings: mailbox: meson-mhu: convert to yaml dt-bindings: rng: amlogic,meson-rng: convert to yaml dt-bindings

[RFC 2/9] dt-bindings: rng: amlogic,meson-rng: convert to yaml

2019-08-01 Thread Neil Armstrong
Signed-off-by: Neil Armstrong --- .../bindings/rng/amlogic,meson-rng.txt| 21 --- .../bindings/rng/amlogic,meson-rng.yaml | 37 +++ 2 files changed, 37 insertions(+), 21 deletions(-) delete mode 100644 Documentation/devicetree/bindings/rng/amlogic,meson

[RFC 0/9] dt-bindings: first tentative of conversion to yaml format

2019-08-01 Thread Neil Armstrong
bindings are acked. Neil Armstrong (9): dt-bindings: mailbox: meson-mhu: convert to yaml dt-bindings: rng: amlogic,meson-rng: convert to yaml dt-bindings: spi: meson: convert to yaml dt-bindings: reset: amlogic,meson-reset: convert to yaml dt-bindings: arm: amlogic: amlogic,meson-gx-ao

[PATCH] char: hw_random: meson-rng: update with SPDX Licence identifier

2019-05-20 Thread Neil Armstrong
Signed-off-by: Neil Armstrong --- drivers/char/hw_random/meson-rng.c | 52 +- 1 file changed, 1 insertion(+), 51 deletions(-) diff --git a/drivers/char/hw_random/meson-rng.c b/drivers/char/hw_random/meson-rng.c index 2e23be802a62..76e693da5dde 100644 --- a/drivers

Re: dm-integrity stalls with iMX6q CAAM

2018-10-25 Thread Neil Armstrong
On 17/10/2018 15:35, Horia Geanta wrote: > On 9/21/2018 3:06 PM, Neil Armstrong wrote: >> Hi, >> >> I recently configured dm-crypt + dm-integrity on an iMX6q platform with CAAM >> Hash functions enabled using the following command lines : >> >> Linux 4

dm-integrity stalls with iMX6q CAAM

2018-09-21 Thread Neil Armstrong
kernel. I can see a few (~170) interrupts on the jr0 interrupt then nothing. Is there a particular issue with hmac-sha256 with the linux CAAM driver ? When disabling the CAAM hash functions or using another cipher & integrity pair, it works like a charm. Thanks, Neil -- Neil Armstrong Embe

Re: [PATCH v4 2/2] crypto: stm32 - Support for STM32 CRYP crypto module

2017-10-19 Thread Neil Armstrong
On 19/10/2017 15:01, Fabien DESSENNE wrote: > Hi Corentin > > > Thank you for your comments. I will fix according to them. See also me > answers/questions below > > While we are at it, do you plan to deliver a new version of the > crypto_engine update? (I had to remove the AEAD part of this ne

Re: [PATCH v3 1/3] clk: meson-gxbb: expose clock CLKID_RNG0

2017-02-27 Thread Neil Armstrong
r letter. For the third patch, it may be good to also add the same to the GXL dtsi, no ? Anyway : Reviewed-by: Neil Armstrong Thanks, Neil

Re: [PATCH v2 3/3] hwrng: meson: add clock handling to driver

2017-02-21 Thread Neil Armstrong
On 02/21/2017 12:26 PM, Heiner Kallweit wrote: > Add handling of RNG0 clock to the driver. > > Signed-off-by: Heiner Kallweit > --- > v2: > - consider that clock is optional > - use managed call to clk_disable_unprepare to ensure that > cleaning up is done in the right order if driver is remove

Re: [PATCH v2 2/3] ARM64: dts: meson-gx: add clock CLKID_RNG0 to hwrng node

2017-02-21 Thread Neil Armstrong
On 02/21/2017 12:18 PM, Heiner Kallweit wrote: > Add clock CLKID_RNG0 to HW randon number generator node and > extend the DT binding documentation accordingly. > > Signed-off-by: Heiner Kallweit > --- > v2: > - splitted first version of patch into two > - add DT binding documentation Hi Heiner,

Re: [PATCH 0/2] hwrng: meson: add clock handling

2017-02-20 Thread Neil Armstrong
On 02/19/2017 09:30 PM, Heiner Kallweit wrote: > The HW randon number generator requires a clock and we shouldn't rely > on the boot loader to enable it. > > Heiner Kallweit (2): > hwrng: meson: expose RNG0 clock via DT > hwrng: meson: add clock handling to driver > > arch/arm64/boot/dts/aml

Re: [PATCH] hwrng: meson: Remove unneeded platform MODULE_ALIAS

2016-10-21 Thread Neil Armstrong
> > -MODULE_ALIAS("platform:meson-rng"); > MODULE_DESCRIPTION("Meson H/W Random Number Generator driver"); > MODULE_AUTHOR("Lawrence Mok "); > MODULE_AUTHOR("Neil Armstrong "); > Acked-by: Neil Armstrong -- To unsubscribe from t

Re: [PATCH v2] hwrng: meson: Fix module autoload for OF registration

2016-10-19 Thread Neil Armstrong
/drivers/char/hw_random/meson-rng.c > @@ -110,6 +110,7 @@ static const struct of_device_id meson_rng_of_match[] = { > { .compatible = "amlogic,meson-rng", }, > {}, > }; > +MODULE_DEVICE_TABLE(of, meson_rng_of_match); > > static struct platform_

[RESEND PATCH 0/2] hw_random: Add Amlogic Meson SoCs Random Generator driver

2016-06-15 Thread Neil Armstrong
...@baylibre.com : - change to depend on ARCH_MESON || COMPILE_TEST - check buffer max size in read [1] [GIT PULL] Amlogic DT 64-bit changes for v4.8 : http://lkml.kernel.org/r/7hshwfbiit@baylibre.com Neil Armstrong (2): dt-bindings: hwrng: Add Amlogic Meson Hardware Random Generator

[RESEND PATCH 1/2] dt-bindings: hwrng: Add Amlogic Meson Hardware Random Generator bindings

2016-06-15 Thread Neil Armstrong
Acked-by: Rob Herring Signed-off-by: Neil Armstrong --- .../devicetree/bindings/rng/amlogic,meson-rng.txt | 14 ++ 1 file changed, 14 insertions(+) create mode 100644 Documentation/devicetree/bindings/rng/amlogic,meson-rng.txt diff --git a/Documentation/devicetree

[RESEND PATCH 2/2] ARM64: dts: meson-gxbb: Add Hardware Random Generator node

2016-06-15 Thread Neil Armstrong
Signed-off-by: Neil Armstrong --- arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi | 5 + 1 file changed, 5 insertions(+) diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi index 063e3b6..806b903 100644 --- a/arch/arm64/boot/dts/amlogic/meson

Re: [PATCH v2 3/3] ARM64: dts: meson-gxbb: Add Hardware Random Generator node

2016-06-13 Thread Neil Armstrong
On 06/14/2016 12:09 AM, Kevin Hilman wrote: > Hi Neil, > > Neil Armstrong writes: > >> Signed-off-by: Neil Armstrong >> --- >> arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi | 5 + >> 1 file changed, 5 insertions(+) >> >> diff --git a/arch/a

[PATCH v2 0/3] hw_random: Add Amlogic Meson SoCs Random Generator driver

2016-06-10 Thread Neil Armstrong
-narmstr...@baylibre.com : - change to depend on ARCH_MESON || COMPILE_TEST - check buffer max size in read Neil Armstrong (3): char: hw_random: Add Amlogic Meson Hardware Random Generator dt-bindings: hwrng: Add Amlogic Meson Hardware Random Generator bindings ARM64: dts: meson-gxbb: Add

[PATCH v2 2/3] dt-bindings: hwrng: Add Amlogic Meson Hardware Random Generator bindings

2016-06-10 Thread Neil Armstrong
Acked-by: Rob Herring Signed-off-by: Neil Armstrong --- .../devicetree/bindings/rng/amlogic,meson-rng.txt | 14 ++ 1 file changed, 14 insertions(+) create mode 100644 Documentation/devicetree/bindings/rng/amlogic,meson-rng.txt diff --git a/Documentation/devicetree

[PATCH v2 3/3] ARM64: dts: meson-gxbb: Add Hardware Random Generator node

2016-06-10 Thread Neil Armstrong
Signed-off-by: Neil Armstrong --- arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi | 5 + 1 file changed, 5 insertions(+) diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi index 832815d..8353621 100644 --- a/arch/arm64/boot/dts/amlogic/meson

[PATCH v2 1/3] char: hw_random: Add Amlogic Meson Hardware Random Generator

2016-06-10 Thread Neil Armstrong
Add support for the Amlogic Meson SoCs hardware random generator. Signed-off-by: Neil Armstrong --- drivers/char/hw_random/Kconfig | 14 drivers/char/hw_random/Makefile| 1 + drivers/char/hw_random/meson-rng.c | 131 + 3 files changed, 146

[PATCH 1/3] char: hw_random: Add Amlogic Meson Hardware Random Generator

2016-06-03 Thread Neil Armstrong
Add support for the Amlogic Meson SoCs hardware random generator. Signed-off-by: Neil Armstrong --- drivers/char/hw_random/Kconfig | 13 drivers/char/hw_random/Makefile| 1 + drivers/char/hw_random/meson-rng.c | 128 + 3 files changed, 142

[PATCH 0/3] hw_random: Add Amlogic Meson SoCs Random Genenerator driver

2016-06-03 Thread Neil Armstrong
Add support for the Amlogic Meson SoCs Hardware Random generator as a hw_random char driver. The generator is a single 32bit wide register. Also adds the Meson GXBB SoC DTSI node and corresponding DT bindings. Neil Armstrong (3): char: hw_random: Add Amlogic Meson Hardware Random Generator

[PATCH 2/3] dt-bindings: hwrng: Add Amlogic Meson Hardware Random Generator bindings

2016-06-03 Thread Neil Armstrong
Signed-off-by: Neil Armstrong --- .../devicetree/bindings/rng/amlogic,meson-rng.txt | 14 ++ 1 file changed, 14 insertions(+) create mode 100644 Documentation/devicetree/bindings/rng/amlogic,meson-rng.txt diff --git a/Documentation/devicetree/bindings/rng/amlogic,meson

[PATCH 3/3] ARM64: dts: meson-gxbb: Add Hardware Random Generator node

2016-06-03 Thread Neil Armstrong
Signed-off-by: Neil Armstrong --- arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi | 5 + 1 file changed, 5 insertions(+) diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi index 832815d..8353621 100644 --- a/arch/arm64/boot/dts/amlogic/meson