mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 0/5] RAVE SP driver fixes
@ 2018-08-31  5:15 Andrey Smirnov
  2018-08-31  5:15 ` [PATCH 1/5] mfd: rave-sp: Remove unused defines Andrey Smirnov
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Andrey Smirnov @ 2018-08-31  5:15 UTC (permalink / raw)
  To: barebox; +Cc: Andrey Smirnov

Everyone:

This series is a backport of a similar series I submitted to upstream
Linux a while ago:

https://lore.kernel.org/lkml/20180707024108.32373-5-andrew.smirnov@gmail.com/T/#m02a75392c729828f822e2cd52f86e541b1649a27

The only omission is the patch related to configuring flow control and
parity of the underlying serdev. It doesn't seem to be necessary for
Barebox (it does fix a problem in Linux) and requires a bunch of new
plumbing to be implemented, so I dropped it for now.

Feedback is welcome!

Thanks,
Andrey Smirnov

Andrey Smirnov (5):
  mfd: rave-sp: Remove unused defines
  mfd: rave-sp: Fix incorrectly specified checksum type
  mfd: rave-sp: Add mapping for legacy EEPROM command
  mfd: rave-sp: Add legacy watchdog ping command translation
  mfd: rave-sp: Emulate CMD_GET_STATUS on device that don't support it

 drivers/mfd/rave-sp.c       | 116 ++++++++++++++++++++++--------------
 include/linux/mfd/rave-sp.h |   1 +
 2 files changed, 72 insertions(+), 45 deletions(-)

-- 
2.17.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/5] mfd: rave-sp: Remove unused defines
  2018-08-31  5:15 [PATCH 0/5] RAVE SP driver fixes Andrey Smirnov
@ 2018-08-31  5:15 ` Andrey Smirnov
  2018-08-31  5:15 ` [PATCH 2/5] mfd: rave-sp: Fix incorrectly specified checksum type Andrey Smirnov
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Andrey Smirnov @ 2018-08-31  5:15 UTC (permalink / raw)
  To: barebox; +Cc: Andrey Smirnov

Remove unusded defines that are a leftover from earlier iterations of
the driver.

This is a backport of Linux kernel patch [1]

[1] https://lore.kernel.org/lkml/20180707024108.32373-5-andrew.smirnov@gmail.com/T/#m02a75392c729828f822e2cd52f86e541b1649a27

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
 drivers/mfd/rave-sp.c | 10 ----------
 1 file changed, 10 deletions(-)

diff --git a/drivers/mfd/rave-sp.c b/drivers/mfd/rave-sp.c
index d55e913ff..47b1e68ba 100644
--- a/drivers/mfd/rave-sp.c
+++ b/drivers/mfd/rave-sp.c
@@ -57,16 +57,6 @@
 #define RAVE_SP_TX_BUFFER_SIZE				\
 	(RAVE_SP_STX_ETX_SIZE + 2 * RAVE_SP_RX_BUFFER_SIZE)
 
-#define RAVE_SP_BOOT_SOURCE_GET		0
-#define RAVE_SP_BOOT_SOURCE_SET		1
-
-#define RAVE_SP_RDU2_BOARD_TYPE_RMB	0
-#define RAVE_SP_RDU2_BOARD_TYPE_DEB	1
-
-#define RAVE_SP_BOOT_SOURCE_SD		0
-#define RAVE_SP_BOOT_SOURCE_EMMC	1
-#define RAVE_SP_BOOT_SOURCE_NOR		2
-
 /**
  * enum rave_sp_deframer_state - Possible state for de-framer
  *
-- 
2.17.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 2/5] mfd: rave-sp: Fix incorrectly specified checksum type
  2018-08-31  5:15 [PATCH 0/5] RAVE SP driver fixes Andrey Smirnov
  2018-08-31  5:15 ` [PATCH 1/5] mfd: rave-sp: Remove unused defines Andrey Smirnov
@ 2018-08-31  5:15 ` Andrey Smirnov
  2018-08-31  5:15 ` [PATCH 3/5] mfd: rave-sp: Add mapping for legacy EEPROM command Andrey Smirnov
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Andrey Smirnov @ 2018-08-31  5:15 UTC (permalink / raw)
  To: barebox; +Cc: Andrey Smirnov

RAVE SP firmware covered by "legacy" variant uses 16-bit CCITT
checksum algorithm. Change the code to correctly reflect that.

This is a backport of Linux kernel patch [1]

[1] https://lore.kernel.org/lkml/20180707024108.32373-5-andrew.smirnov@gmail.com/T/#m6251b0a4869dd303c21910fc99f2ce127cf8aae0

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
 drivers/mfd/rave-sp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mfd/rave-sp.c b/drivers/mfd/rave-sp.c
index 47b1e68ba..a711633a0 100644
--- a/drivers/mfd/rave-sp.c
+++ b/drivers/mfd/rave-sp.c
@@ -653,7 +653,7 @@ static const struct rave_sp_checksum rave_sp_checksum_ccitt = {
 };
 
 static const struct rave_sp_variant rave_sp_legacy = {
-	.checksum = &rave_sp_checksum_8b2c,
+	.checksum = &rave_sp_checksum_ccitt,
 	.cmd = {
 		.translate = rave_sp_default_cmd_translate,
 	},
-- 
2.17.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 3/5] mfd: rave-sp: Add mapping for legacy EEPROM command
  2018-08-31  5:15 [PATCH 0/5] RAVE SP driver fixes Andrey Smirnov
  2018-08-31  5:15 ` [PATCH 1/5] mfd: rave-sp: Remove unused defines Andrey Smirnov
  2018-08-31  5:15 ` [PATCH 2/5] mfd: rave-sp: Fix incorrectly specified checksum type Andrey Smirnov
@ 2018-08-31  5:15 ` Andrey Smirnov
  2018-08-31  5:15 ` [PATCH 4/5] mfd: rave-sp: Add legacy watchdog ping command translation Andrey Smirnov
  2018-08-31  6:43 ` [PATCH 0/5] RAVE SP driver fixes Sascha Hauer
  4 siblings, 0 replies; 6+ messages in thread
From: Andrey Smirnov @ 2018-08-31  5:15 UTC (permalink / raw)
  To: barebox; +Cc: Andrey Smirnov

This is needed to make rave-sp-eeprom driver work on "legacy"
firmware.

This is a backport of Linux kernel patch [1]

[1] https://lore.kernel.org/lkml/20180707024108.32373-5-andrew.smirnov@gmail.com/T/#mae2272763ae092b5b11ab128f5c22039d55557cb

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
 drivers/mfd/rave-sp.c       | 2 ++
 include/linux/mfd/rave-sp.h | 1 +
 2 files changed, 3 insertions(+)

diff --git a/drivers/mfd/rave-sp.c b/drivers/mfd/rave-sp.c
index a711633a0..61152c491 100644
--- a/drivers/mfd/rave-sp.c
+++ b/drivers/mfd/rave-sp.c
@@ -592,6 +592,8 @@ static int rave_sp_default_cmd_translate(enum rave_sp_command command)
 		return 0x1F;
 	case RAVE_SP_CMD_BOOTLOADER:
 		return 0x2A;
+	case RAVE_SP_CMD_RMB_EEPROM:
+		return 0x20;
 	default:
 		return -EINVAL;
 	}
diff --git a/include/linux/mfd/rave-sp.h b/include/linux/mfd/rave-sp.h
index 6b6f90bf9..721b2095d 100644
--- a/include/linux/mfd/rave-sp.h
+++ b/include/linux/mfd/rave-sp.h
@@ -24,6 +24,7 @@ enum rave_sp_command {
 	RAVE_SP_CMD_STATUS			= 0xA0,
 	RAVE_SP_CMD_SW_WDT			= 0xA1,
 	RAVE_SP_CMD_PET_WDT			= 0xA2,
+	RAVE_SP_CMD_RMB_EEPROM			= 0xA4,
 	RAVE_SP_CMD_SET_BACKLIGHT		= 0xA6,
 	RAVE_SP_CMD_RESET			= 0xA7,
 	RAVE_SP_CMD_RESET_REASON		= 0xA8,
-- 
2.17.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 4/5] mfd: rave-sp: Add legacy watchdog ping command translation
  2018-08-31  5:15 [PATCH 0/5] RAVE SP driver fixes Andrey Smirnov
                   ` (2 preceding siblings ...)
  2018-08-31  5:15 ` [PATCH 3/5] mfd: rave-sp: Add mapping for legacy EEPROM command Andrey Smirnov
@ 2018-08-31  5:15 ` Andrey Smirnov
  2018-08-31  6:43 ` [PATCH 0/5] RAVE SP driver fixes Sascha Hauer
  4 siblings, 0 replies; 6+ messages in thread
From: Andrey Smirnov @ 2018-08-31  5:15 UTC (permalink / raw)
  To: barebox; +Cc: Andrey Smirnov

This is needed to make rave-sp-wdt driver to properly ping the
watchdog on "legacy" firmware.

This is a backport of Linux kernel patch [1]

[1] https://lore.kernel.org/lkml/20180707024108.32373-5-andrew.smirnov@gmail.com/T/#m767615239f8aa681a2dc0ccfe1c877e4cbb0edf6

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
 drivers/mfd/rave-sp.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/mfd/rave-sp.c b/drivers/mfd/rave-sp.c
index 61152c491..96f69cc09 100644
--- a/drivers/mfd/rave-sp.c
+++ b/drivers/mfd/rave-sp.c
@@ -586,6 +586,8 @@ static int rave_sp_default_cmd_translate(enum rave_sp_command command)
 		return 0x14;
 	case RAVE_SP_CMD_SW_WDT:
 		return 0x1C;
+	case RAVE_SP_CMD_PET_WDT:
+		return 0x1D;
 	case RAVE_SP_CMD_RESET:
 		return 0x1E;
 	case RAVE_SP_CMD_RESET_REASON:
-- 
2.17.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 0/5] RAVE SP driver fixes
  2018-08-31  5:15 [PATCH 0/5] RAVE SP driver fixes Andrey Smirnov
                   ` (3 preceding siblings ...)
  2018-08-31  5:15 ` [PATCH 4/5] mfd: rave-sp: Add legacy watchdog ping command translation Andrey Smirnov
@ 2018-08-31  6:43 ` Sascha Hauer
  4 siblings, 0 replies; 6+ messages in thread
From: Sascha Hauer @ 2018-08-31  6:43 UTC (permalink / raw)
  To: Andrey Smirnov; +Cc: barebox

On Thu, Aug 30, 2018 at 10:15:45PM -0700, Andrey Smirnov wrote:
> Everyone:
> 
> This series is a backport of a similar series I submitted to upstream
> Linux a while ago:
> 
> https://lore.kernel.org/lkml/20180707024108.32373-5-andrew.smirnov@gmail.com/T/#m02a75392c729828f822e2cd52f86e541b1649a27
> 
> The only omission is the patch related to configuring flow control and
> parity of the underlying serdev. It doesn't seem to be necessary for
> Barebox (it does fix a problem in Linux) and requires a bunch of new
> plumbing to be implemented, so I dropped it for now.
> 
> Feedback is welcome!

Applied, thanks

Sascha

> 
> Thanks,
> Andrey Smirnov
> 
> Andrey Smirnov (5):
>   mfd: rave-sp: Remove unused defines
>   mfd: rave-sp: Fix incorrectly specified checksum type
>   mfd: rave-sp: Add mapping for legacy EEPROM command
>   mfd: rave-sp: Add legacy watchdog ping command translation
>   mfd: rave-sp: Emulate CMD_GET_STATUS on device that don't support it
> 
>  drivers/mfd/rave-sp.c       | 116 ++++++++++++++++++++++--------------
>  include/linux/mfd/rave-sp.h |   1 +
>  2 files changed, 72 insertions(+), 45 deletions(-)
> 
> -- 
> 2.17.1
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-08-31  6:44 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-31  5:15 [PATCH 0/5] RAVE SP driver fixes Andrey Smirnov
2018-08-31  5:15 ` [PATCH 1/5] mfd: rave-sp: Remove unused defines Andrey Smirnov
2018-08-31  5:15 ` [PATCH 2/5] mfd: rave-sp: Fix incorrectly specified checksum type Andrey Smirnov
2018-08-31  5:15 ` [PATCH 3/5] mfd: rave-sp: Add mapping for legacy EEPROM command Andrey Smirnov
2018-08-31  5:15 ` [PATCH 4/5] mfd: rave-sp: Add legacy watchdog ping command translation Andrey Smirnov
2018-08-31  6:43 ` [PATCH 0/5] RAVE SP driver fixes Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox