Skip to contentSkip to conversation

ZII RAVE platform driver

PATCH Superseded Andrey Smirnov 4 participants 14 messages Jul 28, 2017 – Aug 30, 2017

Subsystems (2)

v5 of 17 Superseded Latest is v17 →

lore
Share & tools
lore
#0 lore raw

v5 cover ZII RAVE platform driver

Greg,

I am not sure if you are the right person to send these to, if you are not, please let me know who would be the appropriate recepient and sorry for the noise.

Thanks!

The orginal conver letter text follows:

Hi everyone,

This patch series is v4 of the driver for supervisory processor found on RAVE series of devices from ZII. Supervisory processor is a PIC microcontroller connected to various electrical subsystems on RAVE devices whose firmware implements protocol to command/qery them.

Changes since [v4]:

- Replaced usage of DEVICE_ATTR with DEVICE_ATTR_RW

- Fixed a number of warnings produces by sparse tool

- Incorporated event more feedback from Andy Shevchenko

- Collected Reviewed-by from Andy

Changes since [v3]:

- Re-collected lost Acked-by from Rob

- Incorporated further feedback from Andy Shevchenko

- Dropped useless change (stray newline) to drivers/mfd/Makefile

Changes since [v2]:

- Fixed swapped command codes in rave_sp_common_get_boot_source() and rave_sp_common_set_boot_source() revealed by further testing of the code

- Incorporated feedback from Andy Shevchenko

Changes since [v1]:

- Updated wording in DT-bindings as per Rob's request.

- Collected Rob's Acked-by for patch 2/2

NOTE:

* The driver for "zii,rave-sp-watchdog" exists, but I haven't submitted it yet, becuase I wanted to make sure that API exposed by this MFD is acceptable and doesn't need drastic changes.

* This driver is dependent on crc_ccitt_false() introduced in 2da9378d531f8cc6670c7497f20d936b706ab80b in 'linux-next'

Feedback is greatly appreciated!

Thanks,
Andrey Smirnov

[v4] lkml.kernel.org/r/20170725184450.13171-1-andrew.smirnov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org [v3] lkml.kernel.org/r/20170724150915.4824-1-andrew.smirnov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org [v2] lkml.kernel.org/r/20170718175604.11735-1-andrew.smirnov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org [v1] lkml.kernel.org/r/20170710170449.4544-1-andrew.smirnov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org

Andrey Smirnov (2):
platform: Add driver for RAVE Supervisory Processor
dt-bindings: mfd: Add bindings for ZII RAVE devices

 .../devicetree/bindings/mfd/zii,rave-sp.txt        |   39 +
 drivers/platform/Kconfig                           |    2 +
 drivers/platform/Makefile                          |    1 +
 drivers/platform/rave/Kconfig                      |   26 +
 drivers/platform/rave/Makefile                     |    1 +
 drivers/platform/rave/rave-sp.c                    | 1127 ++++++++++++++++++++
 include/linux/rave-sp.h                            |   54 +
 7 files changed, 1250 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/mfd/zii,rave-sp.txt
 create mode 100644 drivers/platform/rave/Kconfig
 create mode 100644 drivers/platform/rave/Makefile
 create mode 100644 drivers/platform/rave/rave-sp.c
 create mode 100644 include/linux/rave-sp.h
Signature · 6 lines
2.13.3

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#1 lore raw

PATCH v5 1/2 platform: Add driver for RAVE Supervisory Processor

Add a driver for RAVE Supervisory Processor, an MCU implementing varoius bits of housekeeping functionality (watchdoging, backlight control, LED control, etc) on RAVE family of products by Zodiac Inflight Innovations.

This driver implementes core MFD/serdev device as well as communication subroutines necessary for commanding the device.

---
 drivers/platform/Kconfig        |    2 +
 drivers/platform/Makefile       |    1 +
 drivers/platform/rave/Kconfig   |   26 +
 drivers/platform/rave/Makefile  |    1 +
 drivers/platform/rave/rave-sp.c | 1127 +++++++++++++++++++++++++++++++++++++++
 include/linux/rave-sp.h         |   54 ++
 6 files changed, 1211 insertions(+)
 create mode 100644 drivers/platform/rave/Kconfig
 create mode 100644 drivers/platform/rave/Makefile
 create mode 100644 drivers/platform/rave/rave-sp.c
 create mode 100644 include/linux/rave-sp.h
drivers/platform/Kconfig +2 -0
index c11db8bceea1..e6db685bb895 100644
@@ -8,3 +8,5 @@ endif
 source "drivers/platform/goldfish/Kconfig"
 
 source "drivers/platform/chrome/Kconfig"
+
+source "drivers/platform/rave/Kconfig"
drivers/platform/Makefile +1 -0
index ca2692510733..17bdec5ece0c 100644
@@ -7,3 +7,4 @@ obj-$(CONFIG_MIPS)		+= mips/
 obj-$(CONFIG_OLPC)		+= olpc/
 obj-$(CONFIG_GOLDFISH)		+= goldfish/
 obj-$(CONFIG_CHROME_PLATFORMS)	+= chrome/
+obj-y += rave/
drivers/platform/rave/Kconfig new file +26 -0
new file mode 100644
index 000000000000..6fc50ade3871
@@ -0,0 +1,26 @@
+#
+# Platform support for Zodiac RAVE hardware
+#
+
+menuconfig RAVE_PLATFORMS
+	bool "Platform support for Zodiac RAVE hardware"
+	depends on SERIAL_DEV_BUS && SERIAL_DEV_CTRL_TTYPORT
+	help
+	  Say Y here to get to see options for platform support for
+	  various devices present in RAVE hardware. This option alone
+	  does not add any kernel code.
+
+	  If you say N, all options in this submenu will be skipped
+	  and disabled.
+
+if RAVE_PLATFORMS
+
+config RAVE_SP_CORE
+	tristate "RAVE SP MCU core driver"
+	select MFD_CORE
+	select CRC_CCITT
+	help
+	  Select this to get support for the Supervisory Processor
+	  device found on several devices in RAVE line of hardware.
+
+endif
drivers/platform/rave/Makefile new file +1 -0
new file mode 100644
index 000000000000..e4c21ab2d2f5
@@ -0,0 +1 @@
+obj-$(CONFIG_RAVE_SP_CORE) += rave-sp.o
drivers/platform/rave/rave-sp.c new file +1127 -0

1,127 lines not on this page · raw message

include/linux/rave-sp.h new file +54 -0

54 lines not on this page · raw message

Signature · 1 line
2.13.3
#2 lore raw

Re: [PATCH v5 1/2] platform: Add driver for RAVE Supervisory Processor

url: https://github.com/0day-ci/linux/commits/Andrey-Smirnov/ZII-RAVE-platform-driver/20170729-210238 config: blackfin-allyesconfig (attached as .config) compiler: bfin-uclinux-gcc (GCC) 6.2.0…

Hi Andrey,

[auto build test ERROR on linus/master]
[also build test ERROR on v4.13-rc2 next-20170728]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url: https://github.com/0day-ci/linux/commits/Andrey-Smirnov/ZII-RAVE-platform-driver/20170729-210238
config: blackfin-allyesconfig (attached as .config)
compiler: bfin-uclinux-gcc (GCC) 6.2.0
reproduce:
wget https://raw.githubusercontent.com/01org/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=blackfin

All errors (new ones prefixed by >>):

drivers/platform/rave/rave-sp.c: In function 'csum_ccitt':
drivers/platform/rave/rave-sp.c:458:25: error: implicit declaration of function 'crc_ccitt_false' [-Werror=implicit-function-declaration]

     const u16 calculated = crc_ccitt_false(0xffff, buf, size);
                            ^~~~~~~~~~~~~~~
   drivers/platform/rave/rave-sp.c: In function 'rave_sp_write':
>> drivers/platform/rave/rave-sp.c:495:11: error: 'ENOME' undeclared (first use in this function)
      return -ENOME;
              ^~~~~

drivers/platform/rave/rave-sp.c:495:11: note: each undeclared identifier is reported only once for each function it appears in
cc1: some warnings being treated as errors

vim +/ENOME +495 drivers/platform/rave/rave-sp.c

455
456 static void csum_ccitt(const u8 *buf, size_t size, u8 *crc)
457 {

 > 458		const u16 calculated = crc_ccitt_false(0xffff, buf, size);
   459	
   460		/*
   461		 * While the rest of the wire protocol is little-endian,
   462		 * CCITT-16 CRC in RDU2 device is sent out in big-endian order.
   463		 */
   464		put_unaligned_be16(calculated, crc);
   465	}
   466	
   467	static void *stuff(unsigned char *dest, const unsigned char *src, size_t n)
   468	{
   469		while (n--) {
   470			const unsigned char byte = *src++;
   471	
   472			switch (byte) {
   473			case RAVE_SP_STX:
   474			case RAVE_SP_ETX:
   475			case RAVE_SP_DLE:
   476				*dest++ = RAVE_SP_DLE;
   477				/* FALLTHROUGH */
   478			default:
   479				*dest++ = byte;
   480			}
   481		}
   482	
   483		return dest;
   484	}
   485	
   486	static int rave_sp_write(struct rave_sp *sp, const u8 *data, u8 data_size)
   487	{
   488		const size_t checksum_length = sp->variant->checksum->length;
   489		unsigned char frame[RAVE_SP_TX_BUFFER_SIZE];
   490		unsigned char crc[RAVE_SP_CHECKSUM_SIZE];
   491		unsigned char *dest = frame;
   492		size_t length;
   493	
   494		if (WARN_ON(checksum_length > sizeof(crc)))
 > 495			return -ENOME;

496
497 if (WARN_ON(data_size > sizeof(frame)))
498 return -ENOMEM;
499
500 sp->variant->checksum->subroutine(data, data_size, crc);
501
502 *dest++ = RAVE_SP_STX;
503 dest = stuff(dest, data, data_size);
504 dest = stuff(dest, crc, checksum_length);
505 *dest++ = RAVE_SP_ETX;
506
507 length = dest - frame;
508
509 print_hex_dump(KERN_DEBUG, "rave-sp tx: ", DUMP_PREFIX_NONE,
510 16, 1, frame, length, false);
511
512 return serdev_device_write(sp->serdev, frame, length, HZ);
513 }
514

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation

#3 lore raw

Re: [PATCH v5 1/2] platform: Add driver for RAVE Supervisory Processor

In reply to Andrey Smirnov
Quoted 7 lines · Andrey Smirnov

Add a driver for RAVE Supervisory Processor, an MCU implementing varoius bits of housekeeping functionality (watchdoging, backlight control, LED control, etc) on RAVE family of products by Zodiac Inflight Innovations.

This driver implementes core MFD/serdev device as well as communication subroutines necessary for commanding the device.

This introduces new /sysfs userland interfaces, right? That needs documenting, and some review.

For example... bootreason is there on Nokia N900, too. We want to use same interface...

Pavel

#4 lore raw

Re: [PATCH v5 1/2] platform: Add driver for RAVE Supervisory Processor

Quoted 6 lines · Pavel Machek
Quoted 5 lines · Andrey Smirnov

Add a driver for RAVE Supervisory Processor, an MCU implementing varoius bits of housekeeping functionality (watchdoging, backlight control, LED control, etc) on RAVE family of products by Zodiac Inflight Innovations.

Quoted 6 lines
Quoted 2 lines

This driver implementes core MFD/serdev device as well as communication subroutines necessary for commanding the device.

This introduces new /sysfs userland interfaces, right? That needs documenting, and some review.

Correct and yes, good point. I was originally asked to implement all of the exposed attributes via sysfs, but, after more discussion, I now have green light to move a large chunk of those into debugfs which is what I intend to do in v6, I'll also update it to document all of the remaining sysfs entries.

Quoted 2 lines

For example... bootreason is there on Nokia N900, too. We want to use same interface...

I tried grepping Documentation/ABI and kernel tree in general for that sysfs interface, but wasn't able to find it. If you don't mind, could you point me to where it's implemented?

Thanks,
Andrey Smirnov

#5 lore raw

Re: [PATCH v5 1/2] platform: Add driver for RAVE Supervisory Processor

Quoted 14 lines · Andrey Smirnov
Quoted 6 lines · Pavel Machek
Quoted 5 lines · Andrey Smirnov

Add a driver for RAVE Supervisory Processor, an MCU implementing varoius bits of housekeeping functionality (watchdoging, backlight control, LED control, etc) on RAVE family of products by Zodiac Inflight Innovations.

Quoted 6 lines
Quoted 2 lines

This driver implementes core MFD/serdev device as well as communication subroutines necessary for commanding the device.

This introduces new /sysfs userland interfaces, right? That needs documenting, and some review.

Quoted 5 lines

Correct and yes, good point. I was originally asked to implement all of the exposed attributes via sysfs, but, after more discussion, I now have green light to move a large chunk of those into debugfs which is what I intend to do in v6, I'll also update it to document all of the remaining sysfs entries.

Ok, we still would like to have documentation. .. and debugfs is for debugging, not for production use.

Quoted 6 lines
Quoted 2 lines

For example... bootreason is there on Nokia N900, too. We want to use same interface...

I tried grepping Documentation/ABI and kernel tree in general for that sysfs interface, but wasn't able to find it. If you don't mind, could you point me to where it's implemented?

I'm not sure if the implementation is in the mainline, but the bootloader provides this functionality.
Pavel

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#6 lore raw

PATCH v5 2/2 dt-bindings: mfd: Add bindings for ZII RAVE devices

In reply to Andrey Smirnov
---
 .../devicetree/bindings/mfd/zii,rave-sp.txt        | 39 ++++++++++++++++++++++
 1 file changed, 39 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/mfd/zii,rave-sp.txt
Documentation/devicetree/bindings/mfd/zii,rave-sp.txt new file +39 -0
new file mode 100644
index 000000000000..088eff9ddb78
@@ -0,0 +1,39 @@
+Zodiac Inflight Innovations RAVE Supervisory Processor
+
+RAVE Supervisory Processor communicates with SoC over UART. It is
+expected that its Device Tree node is specified as a child of a node
+corresponding to UART controller used for communication.
+
+Required parent device properties:
+
+ - compatible: Should be one of:
+	- "zii,rave-sp-niu"
+	- "zii,rave-sp-mezz"
+	- "zii,rave-sp-esb"
+	- "zii,rave-sp-rdu1"
+	- "zii,rave-sp-rdu2"
+
+ - current-speed: Should be set to baud rate SP device is using
+
+RAVE SP consists of the following sub-devices:
+
+Device				 Description
+------				 -----------
+rave-sp-wdt			: Watchdog
+rave-sp-nvmem			: Interface to onborad EEPROM
+rave-sp-backlight		: Display backlight
+rave-sp-hwmon			: Interface to onboard hardware sensors
+rave-sp-leds			: Interface to onboard LEDs
+rave-sp-input			: Interface to onboard power button
+
+Example of usage:
+
+	rdu {
+		compatible = "zii,rave-sp-rdu2";
+		current-speed = <1000000>;
+
+		watchdog {
+			compatible = "zii,rave-sp-watchdog";
+		};
+	};
+
Signature · 1 line
2.13.3
#7 lore raw

Re: [PATCH v5 2/2] dt-bindings: mfd: Add bindings for ZII RAVE devices

Quoted 10 lines · Andrey Smirnov
Quoted 4 lines
---
 .../devicetree/bindings/mfd/zii,rave-sp.txt        | 39 ++++++++++++++++++++++
 1 file changed, 39 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/mfd/zii,rave-sp.txt

I can't take patches without any changelog text in them :(

#8 lore raw

Re: [PATCH v5 2/2] dt-bindings: mfd: Add bindings for ZII RAVE devices

Quoted 16 lines · Greg Kroah-Hartman
Quoted 10 lines · Andrey Smirnov
Quoted 4 lines
---
 .../devicetree/bindings/mfd/zii,rave-sp.txt        | 39 ++++++++++++++++++++++
 1 file changed, 39 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/mfd/zii,rave-sp.txt
Quoted 1 line

I can't take patches without any changelog text in them :(

OK, will fix in v6.

Thanks,
Andrey Smirnov
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#9 lore raw
In reply to Andrey Smirnov
Quoted 4 lines · Andrey Smirnov

Greg,

I am not sure if you are the right person to send these to, if you are not, please let me know who would be the appropriate recepient and sorry for the noise.

Why not the platform driver maintainer(s)? Doesn't scripts/get_maintainer.pl give you an idea for who to send them to?

thanks,

greg k-h

#10 lore raw
Quoted 8 lines · Greg Kroah-Hartman
Quoted 4 lines · Andrey Smirnov

Greg,

I am not sure if you are the right person to send these to, if you are not, please let me know who would be the appropriate recepient and sorry for the noise.

Why not the platform driver maintainer(s)? Doesn't scripts/get_maintainer.pl give you an idea for who to send them to?

Unfortunately I wasn't able to find anyone in MAINTAINERS and running scripts/get_maintainer.pl on the patch returns only:

scripts/get_maintainer.pl
v5-0001-platform-Add-driver-for-RAVE-Supervisory-Processo.patch
Andrey Smirnov <[email protected]> (commit_signer:1/1=100%,authored:1/1=100%,added_lines:2/2=100%,added_lines:1/1=100%,added_lines:26/26=100%,added_lines:1127/1127=100%,added_lines:54/54=100%) Andy Shevchenko <[email protected]> (commit_signer:1/1=100%) [email protected] (open list)

hence me reaching out to you.

Thanks,
Andrey Smirnov
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#11 lore raw
Quoted 14 lines · Andrey Smirnov
Quoted 8 lines · Greg Kroah-Hartman
Quoted 4 lines · Andrey Smirnov

Greg,

I am not sure if you are the right person to send these to, if you are not, please let me know who would be the appropriate recepient and sorry for the noise.

Why not the platform driver maintainer(s)? Doesn't scripts/get_maintainer.pl give you an idea for who to send them to?

Unfortunately I wasn't able to find anyone in MAINTAINERS and running scripts/get_maintainer.pl on the patch returns only:

Quoted 8 lines

scripts/get_maintainer.pl
v5-0001-platform-Add-driver-for-RAVE-Supervisory-Processo.patch
Andrey Smirnov <[email protected]> (commit_signer:1/1=100%,authored:1/1=100%,added_lines:2/2=100%,added_lines:1/1=100%,added_lines:26/26=100%,added_lines:1127/1127=100%,added_lines:54/54=100%) Andy Shevchenko <[email protected]> (commit_signer:1/1=100%) [email protected] (open list)

hence me reaching out to you.

Greg, did you have any chance to consider this? I have a v6 with a fix for build break reported by kbuild test robot, and I want to avoid spamming the mailing list too much and send it to an appropriate person.

Thanks,
Andrey Smirnov
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#12 lore raw
Quoted 23 lines · Andrey Smirnov
Quoted 21 lines · Andrey Smirnov
Quoted 8 lines · Greg Kroah-Hartman
Quoted 4 lines · Andrey Smirnov

Greg,

I am not sure if you are the right person to send these to, if you are not, please let me know who would be the appropriate recepient and sorry for the noise.

Why not the platform driver maintainer(s)? Doesn't scripts/get_maintainer.pl give you an idea for who to send them to?

Unfortunately I wasn't able to find anyone in MAINTAINERS and running scripts/get_maintainer.pl on the patch returns only:

scripts/get_maintainer.pl
v5-0001-platform-Add-driver-for-RAVE-Supervisory-Processo.patch
Andrey Smirnov <[email protected]> (commit_signer:1/1=100%,authored:1/1=100%,added_lines:2/2=100%,added_lines:1/1=100%,added_lines:26/26=100%,added_lines:1127/1127=100%,added_lines:54/54=100%) Andy Shevchenko <[email protected]> (commit_signer:1/1=100%)
[email protected] (open list)

Quoted 6 lines
Quoted 1 line

hence me reaching out to you.

Greg, did you have any chance to consider this? I have a v6 with a fix for build break reported by kbuild test robot, and I want to avoid spamming the mailing list too much and send it to an appropriate person.

$ mdfrm -c ~/mail/todo/
944 messages in /home/gregkh/mail/todo/

Please be patient if you are waiting for a review from me, my queue is kind of big...

greg k-h

#13 lore raw
Quoted 24 lines · Greg Kroah-Hartman
Quoted 23 lines · Andrey Smirnov
Quoted 21 lines · Andrey Smirnov
Quoted 8 lines · Greg Kroah-Hartman
Quoted 4 lines · Andrey Smirnov

Greg,

I am not sure if you are the right person to send these to, if you are not, please let me know who would be the appropriate recepient and sorry for the noise.

Why not the platform driver maintainer(s)? Doesn't scripts/get_maintainer.pl give you an idea for who to send them to?

Unfortunately I wasn't able to find anyone in MAINTAINERS and running scripts/get_maintainer.pl on the patch returns only:

scripts/get_maintainer.pl
v5-0001-platform-Add-driver-for-RAVE-Supervisory-Processo.patch
Andrey Smirnov <[email protected]> (commit_signer:1/1=100%,authored:1/1=100%,added_lines:2/2=100%,added_lines:1/1=100%,added_lines:26/26=100%,added_lines:1127/1127=100%,added_lines:54/54=100%) Andy Shevchenko <[email protected]> (commit_signer:1/1=100%)
[email protected] (open list)

Quoted 6 lines
Quoted 6 lines
Quoted 1 line

hence me reaching out to you.

Greg, did you have any chance to consider this? I have a v6 with a fix for build break reported by kbuild test robot, and I want to avoid spamming the mailing list too much and send it to an appropriate person.

As I can't do anything with v5, please send v6, never wait for me...

thanks,

greg k-h