driver: char: bfin_crc: CRC hardware accelerator driver for BF60x family processors.
PATCH 1/1 driver: char: bfin_crc: CRC hardware accelerator driver for BF60x family processors.
From: Sonic Zhang <[email protected]>
The CRC peripheral is a hardware block used to compute the CRC of the block of data. This is based on a CRC32 engine which computes the CRC value of 32b data words presented to it. For data words of < 32b in size, it is the responsibility of the application to pack the data into 32b data units.
This driver defines data strcture crc_info and 4 IOCTL interfaces for applciations.
1) CRC Memory Scan
2) CRC Memory Transfer
3) CRC Data Verify
4) CRC Data Fill
--- drivers/char/Kconfig | 8 + drivers/char/Makefile | 1 + drivers/char/bfin_crc.c | 537 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 546 insertions(+), 0 deletions(-) create mode 100644 drivers/char/bfin_crc.c
drivers/char/Kconfig +8 -0
@@ -94,6 +94,14 @@ config BFIN_OTP_WRITE_ENABLE If unsure, say N. +config BFIN_CRC + tristate "Blackfin hardware CRC driver" + depends on BF60x + default y + help + This is a hardware CRC driver for BF60x. It is added to accelerate + CRC calculation individually or within DMA in user applications. + config PRINTER tristate "Parallel printer support" depends on PARPORT
drivers/char/Makefile +1 -0
@@ -17,6 +17,7 @@ obj-$(CONFIG_VIOTAPE) += viotape.o obj-$(CONFIG_IBM_BSR) += bsr.o obj-$(CONFIG_SGI_MBCS) += mbcs.o obj-$(CONFIG_BFIN_OTP) += bfin-otp.o +obj-$(CONFIG_BFIN_CRC) += bfin_crc.o obj-$(CONFIG_PRINTER) += lp.o
drivers/char/bfin_crc.c new file +537 -0
537 lines not on this page · raw message
Signature · 1 line
1.7.0.4
Greg Kroah-Hartman
maintainerQuoted 13 lines · On Wed, May 16, 2012 at 04:26:07PM +0800, [email protected] wrote:
From: Sonic Zhang <[email protected]>
The CRC peripheral is a hardware block used to compute the CRC of the block of data. This is based on a CRC32 engine which computes the CRC value of 32b data words presented to it. For data words of < 32b in size, it is the responsibility of the application to pack the data into 32b data units.
This driver defines data strcture
crc_infoand 4 IOCTL interfaces for applciations.
1) CRC Memory Scan
2) CRC Memory Transfer
3) CRC Data Verify
4) CRC Data Fill
Quoted 7 lines
Signed-off-by Sonic Zhang <[email protected]>--- drivers/char/Kconfig | 8 + drivers/char/Makefile | 1 + drivers/char/bfin_crc.c | 537 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 546 insertions(+), 0 deletions(-) create mode 100644 drivers/char/bfin_crc.c
Why is this a char driver, and not a crypto driver, using the existing crypto userspace api for things like this?
drivers/char/bfin_crc.c line 6
Quoted 12 lines
drivers/char/bfin_crc.c new file +6
-0@@ -0,0 +1,537 @@ +/* +* Blackfin On-Chip hardware CRC Driver +* +* Copyright 2011 Analog Devices Inc. +* +* Licensed under the GPL-2 or later.
Do you really mean "or later"? It's fine if you do, just checking.
thanks,
greg k-h
Arnd Bergmann
maintainerQuoted 22 lines · Greg Kroah-Hartman
Quoted 13 lines · On Wed, May 16, 2012 at 04:26:07PM +0800, [email protected] wrote:
From: Sonic Zhang <[email protected]>
The CRC peripheral is a hardware block used to compute the CRC of the block of data. This is based on a CRC32 engine which computes the CRC value of 32b data words presented to it. For data words of < 32b in size, it is the responsibility of the application to pack the data into 32b data units.
This driver defines data strcture
crc_infoand 4 IOCTL interfaces for applciations.
1) CRC Memory Scan
2) CRC Memory Transfer
3) CRC Data Verify
4) CRC Data FillQuoted 7 lines
Signed-off-by Sonic Zhang <[email protected]>--- drivers/char/Kconfig | 8 + drivers/char/Makefile | 1 + drivers/char/bfin_crc.c | 537 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 546 insertions(+), 0 deletions(-) create mode 100644 drivers/char/bfin_crc.c
Quoted 2 lines
Why is this a char driver, and not a crypto driver, using the existing crypto userspace api for things like this?
Do we have a userspace crypto API these days? The last I remember every attempt to add one so far was abandoned before it got merged. There is drivers/s390/crypto/zcrypt*, which has a nonportable API, and then there is the in-kernel crypto layer in drivers/crypto that has no user interface at all.
I agree that having another private driver for bfin_crc is not a good idea, but I also don't have a better one.
About the driver itself, the submission seems incomplete (missing at least the bfin_crc.h file) and the driver has a number of shortcomings that we should discuss in case we decide to merge it.
Arnd
Greg Kroah-Hartman
maintainerQuoted 23 lines · Arnd Bergmann
Quoted 22 lines · Greg Kroah-Hartman
Quoted 20 lines · On Wed, May 16, 2012 at 04:26:07PM +0800, [email protected] wrote:
From: Sonic Zhang <[email protected]>
The CRC peripheral is a hardware block used to compute the CRC of the block of data. This is based on a CRC32 engine which computes the CRC value of 32b data words presented to it. For data words of < 32b in size, it is the responsibility of the application to pack the data into 32b data units.
This driver defines data strcture
crc_infoand 4 IOCTL interfaces for applciations.
1) CRC Memory Scan
2) CRC Memory Transfer
3) CRC Data Verify
4) CRC Data FillSigned-off-by Sonic Zhang <[email protected]>--- drivers/char/Kconfig | 8 + drivers/char/Makefile | 1 + drivers/char/bfin_crc.c | 537 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 546 insertions(+), 0 deletions(-) create mode 100644 drivers/char/bfin_crc.c
Quoted 8 lines
Quoted 2 lines
Why is this a char driver, and not a crypto driver, using the existing crypto userspace api for things like this?
Do we have a userspace crypto API these days? The last I remember every attempt to add one so far was abandoned before it got merged. There is
drivers/s390/crypto/zcrypt*, which has a nonportable API, and then there is the in-kernel crypto layer indrivers/cryptothat has no user interface at all.
What is CONFIG_CRYPTO_USER for then, with the matching, crypto/crypto_user.c file?
Quoted 6 lines
I agree that having another private driver for
bfin_crcis not a good idea, but I also don't have a better one.About the driver itself, the submission seems incomplete (missing at least the
bfin_crc.hfile) and the driver has a number of shortcomings that we should discuss in case we decide to merge it.
I suggest at least tieing into the in-kernel crypto api first, and then worrying about the userspace side of things, right?
thanks,
greg k-h
Arnd Bergmann
maintainerQuoted 8 lines · Greg Kroah-Hartman
Quoted 5 lines
Do we have a userspace crypto API these days? The last I remember every attempt to add one so far was abandoned before it got merged. There is
drivers/s390/crypto/zcrypt*, which has a nonportable API, and then there is the in-kernel crypto layer indrivers/cryptothat has no user interface at all.What is
CONFIG_CRYPTO_USERfor then, with the matching,crypto/crypto_user.cfile?
Ah, I completely missed that going in and looked in the wrong place when trying to find it now (/drivers/crypto, not /crypto). I'm glad that part is resolved.
Quoted 9 lines
Quoted 6 lines
I agree that having another private driver for
bfin_crcis not a good idea, but I also don't have a better one.About the driver itself, the submission seems incomplete (missing at least the
bfin_crc.hfile) and the driver has a number of shortcomings that we should discuss in case we decide to merge it.I suggest at least tieing into the in-kernel crypto api first, and then worrying about the userspace side of things, right?
Absolutely.
Arnd
Hi Greg,
Quoted 27 lines
-----Original Message-----
From: Greg Kroah-Hartman [mailto:[email protected]]
Sent: Wednesday, May 16, 2012 8:13 PM
To: Zhang, Sonic
Cc: Arnd Bergmann; LKML; [email protected]
Subject: Re: [PATCH] driver: char:bfin_crc: CRC hardware accelerator driver for BF60x family processors.Quoted 13 lines · On Wed, May 16, 2012 at 04:26:07PM +0800, [email protected] wrote:
From: Sonic Zhang <[email protected]>
The CRC peripheral is a hardware block used to compute the CRC of the block of data. This is based on a CRC32 engine which computes the CRC value of 32b data words presented to it. For data words of < 32b in size, it is the responsibility of the application to pack the data into 32b data units.
This driver defines data strcture
crc_infoand 4 IOCTL interfaces for applciations.
1) CRC Memory Scan
2) CRC Memory Transfer
3) CRC Data Verify
4) CRC Data FillQuoted 5 lines
Signed-off-by Sonic Zhang <[email protected]>--- drivers/char/Kconfig | 8 + drivers/char/Makefile | 1 + drivers/char/bfin_crc.c | 537
Quoted 7 lines
+++++++++++++++++++++++++++++++++++++++++++++++
Quoted 2 lines
3 files changed, 546 insertions(+), 0 deletions(-) create mode 100644 drivers/char/bfin_crc.cWhy is this a char driver, and not a crypto driver, using the existing crypto userspace api for things like this?
It looks only the CRC memory scan mode can be implemented as a crypto ahash driver. The other 3 functions are not supported in the crypto framework. I will post a crypto driver for the CRC memory scan mode later.
Sonic
Quoted 18 lines
drivers/char/bfin_crc.c line 6
Quoted 12 lines
drivers/char/bfin_crc.c new file +6
-0@@ -0,0 +1,537 @@ +/* +* Blackfin On-Chip hardware CRC Driver +* +* Copyright 2011 Analog Devices Inc. +* +* Licensed under the GPL-2 or later. Do you really mean "or later"? It's fine if you do, just checking.
thanks,
greg k-h
Greg Kroah-Hartman
maintainerQuoted 33 lines · Sonic
Hi Greg,
Quoted 31 lines
-----Original Message-----
From: Greg Kroah-Hartman [mailto:[email protected]]
Sent: Wednesday, May 16, 2012 8:13 PM
To: Zhang, Sonic
Cc: Arnd Bergmann; LKML; [email protected]
Subject: Re: [PATCH] driver: char:bfin_crc: CRC hardware accelerator driver for BF60x family processors.Quoted 13 lines · On Wed, May 16, 2012 at 04:26:07PM +0800, [email protected] wrote:
From: Sonic Zhang <[email protected]>
The CRC peripheral is a hardware block used to compute the CRC of the block of data. This is based on a CRC32 engine which computes the CRC value of 32b data words presented to it. For data words of < 32b in size, it is the responsibility of the application to pack the data into 32b data units.
This driver defines data strcture
crc_infoand 4 IOCTL interfaces for applciations.
1) CRC Memory Scan
2) CRC Memory Transfer
3) CRC Data Verify
4) CRC Data FillQuoted 5 lines
Signed-off-by Sonic Zhang <[email protected]>--- drivers/char/Kconfig | 8 + drivers/char/Makefile | 1 + drivers/char/bfin_crc.c | 537+++++++++++++++++++++++++++++++++++++++++++++++
Quoted 2 lines
3 files changed, 546 insertions(+), 0 deletions(-) create mode 100644 drivers/char/bfin_crc.c
Quoted 8 lines
Quoted 3 lines
Why is this a char driver, and not a crypto driver, using the existing crypto userspace api for things like this?
It looks only the CRC memory scan mode can be implemented as a crypto ahash driver. The other 3 functions are not supported in the crypto framework. I will post a crypto driver for the CRC memory scan mode later.
Then why not extend the crypto framework to handle these 3 other functions?
greg k-h