mikroBUS driver for add-on boards
Subsystems (3)
v2 cover mikroBUS driver for add-on boards
Hi,
This Patch series is an update to the mikroBUS driver
RFC v1 Patch : https://lkml.org/lkml/2020/7/24/518 .
The mikrobus driver is updated to add mikrobus ports from device-tree overlays, the debug interfaces for adding mikrobus ports through sysFS is removed, and the driver considers the extended usage of mikrobus port pins from their standard purposes.
change log:
v2: support for adding mikroBUS ports from DT overlays, remove debug sysFS interface for adding mikrobus ports, consider extended pin usage/deviations from mikrobus standard specifications,
use greybus CPort protocol enum instead of new protcol enums Fix cases of wrong indendation, ignoring return values, freeing allocated resources in case of errors and other style suggestions in v1 review.
Vaishnav M A (3):
add mikrobus descriptors to greybus_manifest mikroBUS driver for add-on boards on mikrobus ports Add Device Tree Bindings for mikroBUS port
.../bindings/misc/linux,mikrobus.txt | 81 ++ MAINTAINERS | 6 + drivers/misc/Kconfig | 1 + drivers/misc/Makefile | 1 + drivers/misc/mikrobus/Kconfig | 16 + drivers/misc/mikrobus/Makefile | 7 + drivers/misc/mikrobus/mikrobus_core.c | 692 ++++++++++++++++++ drivers/misc/mikrobus/mikrobus_core.h | 191 +++++ drivers/misc/mikrobus/mikrobus_manifest.c | 444 +++++++++++ drivers/misc/mikrobus/mikrobus_manifest.h | 21 + drivers/misc/mikrobus/mikrobus_port.c | 171 +++++ include/linux/greybus/greybus_manifest.h | 47 ++ 12 files changed, 1678 insertions(+) create mode 100644 Documentation/devicetree/bindings/misc/linux,mikrobus.txt create mode 100644 drivers/misc/mikrobus/Kconfig create mode 100644 drivers/misc/mikrobus/Makefile create mode 100644 drivers/misc/mikrobus/mikrobus_core.c create mode 100644 drivers/misc/mikrobus/mikrobus_core.h create mode 100644 drivers/misc/mikrobus/mikrobus_manifest.c create mode 100644 drivers/misc/mikrobus/mikrobus_manifest.h create mode 100644 drivers/misc/mikrobus/mikrobus_port.c
Signature · 1 line
2.25.1
RFC PATCH v2 1/3 add mikrobus descriptors to greybus_manifest
This patch adds new descriptors used in the manifest parsing inside the mikrobus driver, the device descriptor help to describe the devices on a mikroBUS port, mikrobus descriptor is used to set up the mikrobus port pinmux and GPIO states and property descriptor to pass named properties to device drivers through the Unified Properties API under linux/property.h
The corresponding pull request for manifesto is updated at : https://github.com/projectara/manifesto/pull/2
--- include/linux/greybus/greybus_manifest.h | 47 ++++++++++++++++++++++++ 1 file changed, 47 insertions(+)
include/linux/greybus/greybus_manifest.h +47 -0
@@ -23,6 +23,9 @@ enum greybus_descriptor_type {GREYBUS_TYPE_STRING =0x02 ,GREYBUS_TYPE_BUNDLE =0x03 ,GREYBUS_TYPE_CPORT =0x04 , +GREYBUS_TYPE_MIKROBUS =0x05 , +GREYBUS_TYPE_PROPERTY =0x06 , + GREYBUS_TYPE_DEVICE = 0x07, }; enum greybus_protocol {
@@ -151,6 +154,47 @@ struct greybus_descriptor_cport {__u8 protocol_id;/* enum greybus_protocol */ } __packed; +/* +* A mikrobus descriptor is used to describe the details +* about the bus ocnfiguration for the add-on board +* connected to the mikrobus port. +*/ +struct greybus_descriptor_mikrobus { +__u8 pin_state[12 ]; +} __packed; + +/* +* A property descriptor is used to pass named properties +* to device drivers through the unified device properties +* interface under linux/property.h +*/ +struct greybus_descriptor_property { +__u8 length; +__u8 id; +__u8 propname_stringid; +__u8 type; +__u8 value[0 ]; +} __packed; + +/* +* A device descriptor is used to describe the +* details required by a add-on board device +* driver. +*/ +struct greybus_descriptor_device { +__u8 id; +__u8 driver_stringid; +__u8 protocol; +__u8 reg; +__le32 max_speed_hz; +__u8 irq; +__u8 irq_type; +__u8 mode; +__u8 prop_link; +__u8 gpio_link; +__u8 pad[3 ]; +} __packed; +struct greybus_descriptor_header {__le16 size;__u8 type;/* enum greybus_descriptor_type */
@@ -164,6 +208,9 @@ struct greybus_descriptor {struct greybus_descriptor_interface interface;struct greybus_descriptor_bundle bundle;struct greybus_descriptor_cport cport; +struct greybus_descriptor_mikrobus mikrobus; +struct greybus_descriptor_property property; +struct greybus_descriptor_device device; }; } __packed;
Signature · 1 line
2.25.1
Re: [RFC PATCH v2 1/3] add mikrobus descriptors to greybus_manifest
Hi,
Trying to add more information regarding the newly added descriptors and describe how they are used now within the mikroBUS driver.
Quoted 21 lines · Vaishnav M A
This patch adds new descriptors used in the manifest parsing inside the mikrobus driver, the device descriptor help to describe the devices on a mikroBUS port, mikrobus descriptor is used to set up the mikrobus port pinmux and GPIO states and property descriptor to pass named properties to device drivers through the Unified Properties API under
linux/property.hThe corresponding pull request for manifesto is updated at : https://github.com/projectara/manifesto/pull/2
Signed-off-by Vaishnav M A <[email protected]>--- include/linux/greybus/greybus_manifest.h | 47 ++++++++++++++++++++++++ 1 file changed, 47 insertions(+)include/linux/greybus/greybus_manifest.h +0
-0
include/linux/greybus/greybus_manifest.h enum greybus_descriptor_type { · line 26
Quoted 4 lines
include/linux/greybus/greybus_manifest.h +1
-0@@ -23,6 +23,9 @@ enum greybus_descriptor_type {GREYBUS_TYPE_STRING =0x02 ,GREYBUS_TYPE_BUNDLE =0x03 ,GREYBUS_TYPE_CPORT =0x04 , + GREYBUS_TYPE_MIKROBUS = 0x05,
The mikrobus descriptor is used to pass information about the specific pinmux settings and the default GPIO states on the mikrobus port to be set up for the add-on board to work correctly, this descriptor has 12 u8 fields(corresponding to the 12 pins on the mikrobus port) which includes information about the prior setup required on the mikroBUS port for the device(s) on the add-on board to work correctly. The mikrobus descriptor is a fixed-length descriptor and there will be only a single instance of mikrobus descriptor per add-on board manifest.
include/linux/greybus/greybus_manifest.h enum greybus_descriptor_type { · line 27
Quoted 1 line
include/linux/greybus/greybus_manifest.h +1
-0+ GREYBUS_TYPE_PROPERTY = 0x06,
The property descriptors are used to pass named properties to the device drivers through the Unified device property interface under linux/property.h , so that device drivers using the device_property_read_* call can get the named properties, the mikrobus driver fetches the information from the manifest binary and forms a corresponding struct property_entry which will be attached to the struct device.
The property descriptor is a variable-length descriptor similar to the string descriptor and there can be multiple instances of property descriptor per add-on board manifest.
include/linux/greybus/greybus_manifest.h enum greybus_descriptor_type { · line 28
Quoted 1 line
include/linux/greybus/greybus_manifest.h +1
-0+ GREYBUS_TYPE_DEVICE = 0x07,
The device descriptor is used to describe a device on the mikrobus port and has necessary fields from struct i2c_board_info and struct spi_board_info to describe a device on these buses in a mikrobus port, even though SPI/I2C device info structs are used this descriptor has enough information to describe other kinds of devices relevant to mikrobus as well.(serdev/platform devices). The device descriptor is a fixed-length descriptor and there can be multiple instances of device descriptors in an add-on board manifest in cases where the add-on board presents more than one device to the host.
Quoted 6 lines
include/linux/greybus/greybus_manifest.h +0
-0};enum greybus_protocol {@@ -151,6 +154,47 @@ struct greybus_descriptor_cport {__u8 protocol_id;/* enum greybus_protocol */ } __packed;
include/linux/greybus/greybus_manifest.h struct greybus_descriptor_cport { · line 165
Quoted 10 lines
include/linux/greybus/greybus_manifest.h +9
-0+/* +* A mikrobus descriptor is used to describe the details +* about the bus ocnfiguration for the add-on board +* connected to the mikrobus port. +*/ +struct greybus_descriptor_mikrobus { +__u8 pin_state[12 ]; +} __packed; +
These 12 u8 fields describe the state of the pins in the
mikrobus port(in clock wise order starting from the PWM
pin)
mikrobus v2 standard specification :
https://download.mikroe.com/documents/standards/mikrobus/mikrobus-standard-specification-v200.pdf
This struct is filled from the mikrobus-descriptor
in the manifest and can have one of the values
for each pin group:MIKROBUS_STATE_INPUT = 0x01,MIKROBUS_STATE_OUTPUT_HIGH = 0x02,MIKROBUS_STATE_OUTPUT_LOW = 0x03,MIKROBUS_STATE_PWM = 0x04, ( applicable only to PWM pin) MIKROBUS_STATE_SPI = 0x05, ( applicable only to
the group of MOSI, MISO, SCK , CS pins on mikroBUS port) MIKROBUS_STATE_I2C = 0x06, (applicable only to the SCL, SDA
pins on the mikrobus port)MIKROBUS_STATE_UART = 0x07,(applicable only to the RX, TX
pins on the mikrobus port)
There are two purposes for adding this descriptor,
1) for some add-on boards some of the pins might need to
be configured as GPIOs deviating from their reserved purposes
An example for this case is an SHT15 Click (https://www.mikroe.com/sht1x-click),
where the SCL and SDA Pins need to be configured as GPIOs
for the driver (drivers/hwmon/sht15.c) to work. The mikrobus descriptor for this case would look like this :
[mikrobus-descriptor]
pwm-state = 4 (default, pwm)
int-state = 1 (default, input)
rx-state = 7 (default, uart)
tx-state = 7 (default, uart)
scl-state = 3 (note the SCL Pin configured as GPIO)
sda-state = 3 (note the SCL Pin configured as GPIO)
mosi-state = 5 (default, spi)
miso-state = 5 (default, spi)
sck-state = 5 (default, spi)
cs-state = 5 (default, spi)
rst-state = 2 (default, GPIO)
an-state = 1 (default, input)
2) for some add-on boards the driver may not take care
of some additional signals like reset/wake-up/other thus
the mikrobus driver can set-up these GPIOs to a required
default state from the information from the manifest, a good example for this is the ENC28J60 click (https://www.mikroe.com/eth-click)
where the reset line(RST pin on the mikrobus port) needs to be pulled high. The manifest example for this add-on board can
be found here :
https://github.com/vaishnav98/manifesto/blob/mikrobusv3/manifests/ETH-CLICK.mnfs
include/linux/greybus/greybus_manifest.h struct greybus_descriptor_cport { · line 178
Quoted 13 lines
include/linux/greybus/greybus_manifest.h +13
-0+/* +* A property descriptor is used to pass named properties +* to device drivers through the unified device properties +* interface under linux/property.h +*/ +struct greybus_descriptor_property { +__u8 length; +__u8 id; +__u8 propname_stringid; +__u8 type; +__u8 value[0 ]; +} __packed; +
This descriptor is used to fill in struct property_entry (linux/property.h), the propname_stringid
field is used to map to the corresponding string descriptor which has the property name, the type field has the types under dev_prop_type (linux/property.h) and there are some new types which are used within the mikrobus driver, these are the new types :MIKROBUS_PROPERTY_TYPE_LINK = 0x01 MIKROBUS_PROPERTY_TYPE_GPIO = 0x02
The property-link type is used to attach an array of properties to the corresponding device, for example, consider an SPI EEPROM device which works with the AT25 driver( drivers/misc/eeprom/at25.c), The device and property descriptor parts of the manifest will look like this.
[device-descriptor 1]
driver-string-id = 3
prop-link = 1 (The ID of the property-descriptor which contains the list of IDs of the actual properties to attach with the device)
protocol = 0xb
reg = 0
mode = 0x3
max-speed-hz = 5000000
[string-descriptor 3]
string = at25 (driver string)
[property-descriptor 1]
name-string-id = 4
type = 0x01 (type is property-link)
value = <2 3 4>(attach properties with id 2,3,4 to the device) [string-descriptor 4]
string = prop-link
[property-descriptor 2]
name-string-id = 5 (string id for the property name string) type = 0x05 (U32, driver uses device_property_read_u32 call to read the value)
value = <262144>
[string-descriptor 5]
string = size (property name string)
[property-descriptor 3]
name-string-id = 6
type = 0x05
value = <256>
[string-descriptor 6]
string = pagesize
[property-descriptor 4]
name-string-id = 7
type = 0x05
value = <24>
[string-descriptor 7]
string = address-width
The gpio-link type is very similar to property descriptor and is used to pass an array of named gpios to the device driver through GPIO lookup tables, consider an example for a SHT15 device (drivers/hwmon/sht15.c), the device and the property(gpio) descriptors are as follows :
[device-descriptor 1]
driver-string-id = 3
protocol = 0xfe
reg = 0
gpio-link = 1 (The ID of the property-descriptor which contains the list of IDs of the named gpio properties to attach with the device)
[string-descriptor 3]
string = sht11 (device_id string)
[property-descriptor 1]
name-string-id = 4
type = 0x02 (gpio-link)
value = <2 3> (attach properties with id 2,3 as named gpios to the device) [string-descriptor 4]
string = gpio-link
[property-descriptor 2]
name-string-id = 5
type = 0x03
value = <4>
[string-descriptor 5]
string = clk (name of the GPIO, the driver usesdevm_gpiod_get or similar calls to get the GPIO)
[property-descriptor 3]
name-string-id = 6
type = 0x03
value = <5>
[string-descriptor 6]
string = data
Note that the values here 4 and 5 for the GPIOs are the offset numbers(clockwise starting from PWM pin) within a mikrobus port, the mikrobus drivers translates this offset information to the actual GPIO while creating the GPIO lookup table, this ensures that the manifest doesn't have any port-specific information and a single manifest can be used for an add-on board over different platforms/sockets.
Quoted 9 lines
include/linux/greybus/greybus_manifest.h +9
-0+/* +* A device descriptor is used to describe the +* details required by a add-on board device +* driver. +*/ +struct greybus_descriptor_device { +__u8 id; +__u8 driver_stringid; +__u8 protocol;
include/linux/greybus/greybus_manifest.h struct greybus_descriptor_cport { · line 197
Quoted 10 lines
include/linux/greybus/greybus_manifest.h +10
-0+__u8 reg; +__le32 max_speed_hz; +__u8 irq; +__u8 irq_type; +__u8 mode; +__u8 prop_link; +__u8 gpio_link; +__u8 pad[3 ]; +} __packed; +
The device descriptor is used to describe a device on the mikrobus port and has necessary fields from struct i2c_board_info and struct spi_board_info, of these fields, the irq field is similar to the gpio descriptor value above in that the value under irq is also the pin offset within the mikrobus port which will be translated to the actual GPIO within the mikrobus driver and the irq-type takes types defined under linux/interrupt.h . For a device with a IRQF_TRIGGER_RISING interrupt on the INT pin on the mikrobus port the fields will be :
irq = 1 (offset of INT pin)irq_type = 1 ( IRQF_TRIGGER_RISING)
Quoted 14 lines
include/linux/greybus/greybus_manifest.h +3
-1struct greybus_descriptor_header {__le16 size;__u8 type;/* enum greybus_descriptor_type */ @@ -164,6 +208,9 @@ struct greybus_descriptor {struct greybus_descriptor_interface interface;struct greybus_descriptor_bundle bundle;struct greybus_descriptor_cport cport; +struct greybus_descriptor_mikrobus mikrobus; +struct greybus_descriptor_property property; +struct greybus_descriptor_device device; }; } __packed; --
Quoted 2 lines
2.25.1
Thanks and Regards,
Vaishnav
Re: [RFC PATCH v2 1/3] add mikrobus descriptors to greybus_manifest
Hello Vaishnav,
I should say, an excellent work on the greybus_manifest.h file.
Actually, my thoughts will be to have a two-stage commit of the whole MikroBUS patch.
The first one are these changes with greybus_manifest.h, followed by dependent mikrobus_core.h and mikrobus_manifest.h.
These two should have included #include <linux/greybus/greybus_manifest.h> to reflect the correct hierarchical structure.
The rest is with the mikrobus driver .c code.
It is just an observation from me, I guess, it is obvious.
My two cent worth comment,
Zoran
_______
Quoted 302 lines · Vaishnav M A
Hi,
Trying to add more information regarding the newly added descriptors and describe how they are used now within the mikroBUS driver.
Quoted 21 lines · Vaishnav M A
This patch adds new descriptors used in the manifest parsing inside the mikrobus driver, the device descriptor help to describe the devices on a mikroBUS port, mikrobus descriptor is used to set up the mikrobus port pinmux and GPIO states and property descriptor to pass named properties to device drivers through the Unified Properties API under
linux/property.hThe corresponding pull request for manifesto is updated at : https://github.com/projectara/manifesto/pull/2
Signed-off-by Vaishnav M A <[email protected]>--- include/linux/greybus/greybus_manifest.h | 47 ++++++++++++++++++++++++ 1 file changed, 47 insertions(+)include/linux/greybus/greybus_manifest.h +0
-0include/linux/greybus/greybus_manifest.h enum greybus_descriptor_type { · line 26
Quoted 4 lines
include/linux/greybus/greybus_manifest.h +1
-0@@ -23,6 +23,9 @@ enum greybus_descriptor_type {GREYBUS_TYPE_STRING =0x02 ,GREYBUS_TYPE_BUNDLE =0x03 ,GREYBUS_TYPE_CPORT =0x04 , + GREYBUS_TYPE_MIKROBUS = 0x05,The mikrobus descriptor is used to pass information about the specific pinmux settings and the default GPIO states on the mikrobus port to be set up for the add-on board to work correctly, this descriptor has 12 u8 fields(corresponding to the 12 pins on the mikrobus port) which includes information about the prior setup required on the mikroBUS port for the device(s) on the add-on board to work correctly. The mikrobus descriptor is a fixed-length descriptor and there will be only a single instance of mikrobus descriptor per add-on board manifest.
include/linux/greybus/greybus_manifest.h enum greybus_descriptor_type { · line 27
Quoted 1 line
include/linux/greybus/greybus_manifest.h +1
-0+ GREYBUS_TYPE_PROPERTY = 0x06,The property descriptors are used to pass named properties to the device drivers through the Unified device property interface under
linux/property.h, so that device drivers using the device_property_read_* call can get the named properties, the mikrobus driver fetches the information from the manifest binary and forms a correspondingstruct property_entrywhich will be attached to thestruct device.
The property descriptor is a variable-length descriptor similar to the string descriptor and there can be multiple instances of property descriptor per add-on board manifest.include/linux/greybus/greybus_manifest.h enum greybus_descriptor_type { · line 28
Quoted 1 line
include/linux/greybus/greybus_manifest.h +1
-0+ GREYBUS_TYPE_DEVICE = 0x07,The device descriptor is used to describe a device on the mikrobus port and has necessary fields from
struct i2c_board_infoandstruct spi_board_infoto describe a device on these buses in a mikrobus port, even though SPI/I2C device info structs are used this descriptor has enough information to describe other kinds of devices relevant to mikrobus as well.(serdev/platform devices). The device descriptor is a fixed-length descriptor and there can be multiple instances of device descriptors in an add-on board manifest in cases where the add-on board presents more than one device to the host.Quoted 6 lines
include/linux/greybus/greybus_manifest.h +0
-0};enum greybus_protocol {@@ -151,6 +154,47 @@ struct greybus_descriptor_cport {__u8 protocol_id;/* enum greybus_protocol */ } __packed;include/linux/greybus/greybus_manifest.h struct greybus_descriptor_cport { · line 165
Quoted 10 lines
include/linux/greybus/greybus_manifest.h +9
-0+/* +* A mikrobus descriptor is used to describe the details +* about the bus ocnfiguration for the add-on board +* connected to the mikrobus port. +*/ +struct greybus_descriptor_mikrobus { +__u8 pin_state[12 ]; +} __packed; +These 12 u8 fields describe the state of the pins in the
mikrobus port(in clock wise order starting from the PWM
pin)
mikrobus v2 standard specification :
https://download.mikroe.com/documents/standards/mikrobus/mikrobus-standard-specification-v200.pdf
This struct is filled from the mikrobus-descriptor
in the manifest and can have one of the values
for each pin group:MIKROBUS_STATE_INPUT=0x01,MIKROBUS_STATE_OUTPUT_HIGH=0x02,MIKROBUS_STATE_OUTPUT_LOW=0x03,MIKROBUS_STATE_PWM=0x04, ( applicable only to PWM pin)MIKROBUS_STATE_SPI=0x05, ( applicable only to
the group of MOSI, MISO, SCK , CS pins on mikroBUS port)MIKROBUS_STATE_I2C=0x06, (applicable only to the SCL, SDA
pins on the mikrobus port)MIKROBUS_STATE_UART= 0x07,(applicable only to the RX, TX
pins on the mikrobus port)
There are two purposes for adding this descriptor,
1) for some add-on boards some of the pins might need to
be configured as GPIOs deviating from their reserved purposes
An example for this case is an SHT15 Click (https://www.mikroe.com/sht1x-click),
where the SCL and SDA Pins need to be configured as GPIOs
for the driver (drivers/hwmon/sht15.c) to work. The mikrobus descriptor for this case would look like this :
[mikrobus-descriptor]
pwm-state = 4 (default, pwm)
int-state = 1 (default, input)
rx-state = 7 (default, uart)
tx-state = 7 (default, uart)
scl-state = 3 (note the SCL Pin configured as GPIO)
sda-state = 3 (note the SCL Pin configured as GPIO)
mosi-state = 5 (default, spi)
miso-state = 5 (default, spi)
sck-state = 5 (default, spi)
cs-state = 5 (default, spi)
rst-state = 2 (default, GPIO)
an-state = 1 (default, input)
2) for some add-on boards the driver may not take care
of some additional signals like reset/wake-up/other thus
the mikrobus driver can set-up these GPIOs to a required
default state from the information from the manifest, a good example for this is the ENC28J60 click (https://www.mikroe.com/eth-click)
where the reset line(RST pin on the mikrobus port) needs to be pulled high. The manifest example for this add-on board can
be found here :
https://github.com/vaishnav98/manifesto/blob/mikrobusv3/manifests/ETH-CLICK.mnfsinclude/linux/greybus/greybus_manifest.h struct greybus_descriptor_cport { · line 178
Quoted 13 lines
include/linux/greybus/greybus_manifest.h +13
-0+/* +* A property descriptor is used to pass named properties +* to device drivers through the unified device properties +* interface under linux/property.h +*/ +struct greybus_descriptor_property { +__u8 length; +__u8 id; +__u8 propname_stringid; +__u8 type; +__u8 value[0 ]; +} __packed; +This descriptor is used to fill in
struct property_entry(linux/property.h), thepropname_stringid
field is used to map to the corresponding string descriptor which has the property name, the type field has the types underdev_prop_type(linux/property.h) and there are some new types which are used within the mikrobus driver, these are the new types :MIKROBUS_PROPERTY_TYPE_LINK=0x01MIKROBUS_PROPERTY_TYPE_GPIO=0x02The property-link type is used to attach an array of properties to the corresponding device, for example, consider an SPI EEPROM device which works with the AT25 driver(
drivers/misc/eeprom/at25.c), The device and property descriptor parts of the manifest will look like this.[device-descriptor 1]
driver-string-id = 3
prop-link = 1 (The ID of the property-descriptor which contains the list of IDs of the actual properties to attach with the device)
protocol =0xb
reg = 0
mode =0x3
max-speed-hz = 5000000
[string-descriptor 3]
string = at25 (driver string)[property-descriptor 1]
name-string-id = 4
type =0x01(type is property-link)
value = <2 3 4>(attach properties with id 2,3,4 to the device) [string-descriptor 4]
string = prop-link[property-descriptor 2]
name-string-id = 5 (string id for the property name string) type =0x05(U32, driver usesdevice_property_read_u32call to read the value)
value = <262144>
[string-descriptor 5]
string = size (property name string)[property-descriptor 3]
name-string-id = 6
type =0x05
value = <256>
[string-descriptor 6]
string = pagesize[property-descriptor 4]
name-string-id = 7
type =0x05
value = <24>
[string-descriptor 7]
string = address-widthThe gpio-link type is very similar to property descriptor and is used to pass an array of named gpios to the device driver through GPIO lookup tables, consider an example for a SHT15 device (
drivers/hwmon/sht15.c), the device and the property(gpio) descriptors are as follows :[device-descriptor 1]
driver-string-id = 3
protocol =0xfe
reg = 0
gpio-link = 1 (The ID of the property-descriptor which contains the list of IDs of the named gpio properties to attach with the device)[string-descriptor 3]
string = sht11 (device_idstring)[property-descriptor 1]
name-string-id = 4
type =0x02(gpio-link)
value = <2 3> (attach properties with id 2,3 as named gpios to the device) [string-descriptor 4]
string = gpio-link[property-descriptor 2]
name-string-id = 5
type =0x03
value = <4>
[string-descriptor 5]
string = clk (name of the GPIO, the driver usesdevm_gpiod_getor similar calls to get the GPIO)[property-descriptor 3]
name-string-id = 6
type =0x03
value = <5>
[string-descriptor 6]
string = dataNote that the values here 4 and 5 for the GPIOs are the offset numbers(clockwise starting from PWM pin) within a mikrobus port, the mikrobus drivers translates this offset information to the actual GPIO while creating the GPIO lookup table, this ensures that the manifest doesn't have any port-specific information and a single manifest can be used for an add-on board over different platforms/sockets.
Quoted 9 lines
include/linux/greybus/greybus_manifest.h +9
-0+/* +* A device descriptor is used to describe the +* details required by a add-on board device +* driver. +*/ +struct greybus_descriptor_device { +__u8 id; +__u8 driver_stringid; +__u8 protocol;include/linux/greybus/greybus_manifest.h struct greybus_descriptor_cport { · line 197
Quoted 10 lines
include/linux/greybus/greybus_manifest.h +10
-0+__u8 reg; +__le32 max_speed_hz; +__u8 irq; +__u8 irq_type; +__u8 mode; +__u8 prop_link; +__u8 gpio_link; +__u8 pad[3 ]; +} __packed; +The device descriptor is used to describe a device on the mikrobus port and has necessary fields from
struct i2c_board_infoandstruct spi_board_info, of these fields, the irq field is similar to the gpio descriptor value above in that the value under irq is also the pin offset within the mikrobus port which will be translated to the actual GPIO within the mikrobus driver and the irq-type takes types defined underlinux/interrupt.h. For a device with aIRQF_TRIGGER_RISINGinterrupt on the INT pin on the mikrobus port the fields will be :
irq = 1 (offset of INT pin)irq_type= 1 (IRQF_TRIGGER_RISING)Quoted 14 lines
include/linux/greybus/greybus_manifest.h +3
-1struct greybus_descriptor_header {__le16 size;__u8 type;/* enum greybus_descriptor_type */ @@ -164,6 +208,9 @@ struct greybus_descriptor {struct greybus_descriptor_interface interface;struct greybus_descriptor_bundle bundle;struct greybus_descriptor_cport cport; +struct greybus_descriptor_mikrobus mikrobus; +struct greybus_descriptor_property property; +struct greybus_descriptor_device device; }; } __packed; --Quoted 2 lines
2.25.1
Thanks and Regards,
Vaishnav
Re: [RFC PATCH v2 1/3] add mikrobus descriptors to greybus_manifest
Hi Zoran,
Thank you for your review,
Quoted 11 lines · Zoran Stojsavljevic
Hello Vaishnav,
I should say, an excellent work on the
greybus_manifest.hfile.Actually, my thoughts will be to have a two-stage commit of the whole MikroBUS patch.
The first one are these changes with
greybus_manifest.h, followed by dependentmikrobus_core.handmikrobus_manifest.h.
Quoted 8 lines
These two should have included #include <
linux/greybus/greybus_manifest.h> to reflect the correct hierarchical structure.The rest is with the mikrobus driver .c code.
It is just an observation from me, I guess, it is obvious.
Sure, we can split up the mikrobus driver patch into two parts and still ensure that each patch builds without errors, will fix this in the next version.
Quoted 4 lines
My two cent worth comment,
Zoran
_______
Quoted 303 lines
Quoted 302 lines · Vaishnav M A
Hi,
Trying to add more information regarding the newly added descriptors and describe how they are used now within the mikroBUS driver.
Quoted 21 lines · Vaishnav M A
This patch adds new descriptors used in the manifest parsing inside the mikrobus driver, the device descriptor help to describe the devices on a mikroBUS port, mikrobus descriptor is used to set up the mikrobus port pinmux and GPIO states and property descriptor to pass named properties to device drivers through the Unified Properties API under
linux/property.hThe corresponding pull request for manifesto is updated at : https://github.com/projectara/manifesto/pull/2
Signed-off-by Vaishnav M A <[email protected]>--- include/linux/greybus/greybus_manifest.h | 47 ++++++++++++++++++++++++ 1 file changed, 47 insertions(+)include/linux/greybus/greybus_manifest.h +0
-0include/linux/greybus/greybus_manifest.h enum greybus_descriptor_type { · line 26
Quoted 4 lines
include/linux/greybus/greybus_manifest.h +1
-0@@ -23,6 +23,9 @@ enum greybus_descriptor_type {GREYBUS_TYPE_STRING =0x02 ,GREYBUS_TYPE_BUNDLE =0x03 ,GREYBUS_TYPE_CPORT =0x04 , + GREYBUS_TYPE_MIKROBUS = 0x05,The mikrobus descriptor is used to pass information about the specific pinmux settings and the default GPIO states on the mikrobus port to be set up for the add-on board to work correctly, this descriptor has 12 u8 fields(corresponding to the 12 pins on the mikrobus port) which includes information about the prior setup required on the mikroBUS port for the device(s) on the add-on board to work correctly. The mikrobus descriptor is a fixed-length descriptor and there will be only a single instance of mikrobus descriptor per add-on board manifest.
include/linux/greybus/greybus_manifest.h enum greybus_descriptor_type { · line 27
Quoted 1 line
include/linux/greybus/greybus_manifest.h +1
-0+ GREYBUS_TYPE_PROPERTY = 0x06,The property descriptors are used to pass named properties to the device drivers through the Unified device property interface under
linux/property.h, so that device drivers using the device_property_read_* call can get the named properties, the mikrobus driver fetches the information from the manifest binary and forms a correspondingstruct property_entrywhich will be attached to thestruct device.
The property descriptor is a variable-length descriptor similar to the string descriptor and there can be multiple instances of property descriptor per add-on board manifest.include/linux/greybus/greybus_manifest.h enum greybus_descriptor_type { · line 28
Quoted 1 line
include/linux/greybus/greybus_manifest.h +1
-0+ GREYBUS_TYPE_DEVICE = 0x07,The device descriptor is used to describe a device on the mikrobus port and has necessary fields from
struct i2c_board_infoandstruct spi_board_infoto describe a device on these buses in a mikrobus port, even though SPI/I2C device info structs are used this descriptor has enough information to describe other kinds of devices relevant to mikrobus as well.(serdev/platform devices). The device descriptor is a fixed-length descriptor and there can be multiple instances of device descriptors in an add-on board manifest in cases where the add-on board presents more than one device to the host.Quoted 6 lines
include/linux/greybus/greybus_manifest.h +0
-0};enum greybus_protocol {@@ -151,6 +154,47 @@ struct greybus_descriptor_cport {__u8 protocol_id;/* enum greybus_protocol */ } __packed;include/linux/greybus/greybus_manifest.h struct greybus_descriptor_cport { · line 165
Quoted 10 lines
include/linux/greybus/greybus_manifest.h +9
-0+/* +* A mikrobus descriptor is used to describe the details +* about the bus ocnfiguration for the add-on board +* connected to the mikrobus port. +*/ +struct greybus_descriptor_mikrobus { +__u8 pin_state[12 ]; +} __packed; +These 12 u8 fields describe the state of the pins in the
mikrobus port(in clock wise order starting from the PWM
pin)
mikrobus v2 standard specification :
https://download.mikroe.com/documents/standards/mikrobus/mikrobus-standard-specification-v200.pdf
This struct is filled from the mikrobus-descriptor
in the manifest and can have one of the values
for each pin group:MIKROBUS_STATE_INPUT=0x01,MIKROBUS_STATE_OUTPUT_HIGH=0x02,MIKROBUS_STATE_OUTPUT_LOW=0x03,MIKROBUS_STATE_PWM=0x04, ( applicable only to PWM pin)MIKROBUS_STATE_SPI=0x05, ( applicable only to
the group of MOSI, MISO, SCK , CS pins on mikroBUS port)MIKROBUS_STATE_I2C=0x06, (applicable only to the SCL, SDA
pins on the mikrobus port)MIKROBUS_STATE_UART= 0x07,(applicable only to the RX, TX
pins on the mikrobus port)
There are two purposes for adding this descriptor,
1) for some add-on boards some of the pins might need to
be configured as GPIOs deviating from their reserved purposes
An example for this case is an SHT15 Click (https://www.mikroe.com/sht1x-click),
where the SCL and SDA Pins need to be configured as GPIOs
for the driver (drivers/hwmon/sht15.c) to work. The mikrobus descriptor for this case would look like this :
[mikrobus-descriptor]
pwm-state = 4 (default, pwm)
int-state = 1 (default, input)
rx-state = 7 (default, uart)
tx-state = 7 (default, uart)
scl-state = 3 (note the SCL Pin configured as GPIO)
sda-state = 3 (note the SCL Pin configured as GPIO)
mosi-state = 5 (default, spi)
miso-state = 5 (default, spi)
sck-state = 5 (default, spi)
cs-state = 5 (default, spi)
rst-state = 2 (default, GPIO)
an-state = 1 (default, input)
2) for some add-on boards the driver may not take care
of some additional signals like reset/wake-up/other thus
the mikrobus driver can set-up these GPIOs to a required
default state from the information from the manifest, a good example for this is the ENC28J60 click (https://www.mikroe.com/eth-click)
where the reset line(RST pin on the mikrobus port) needs to be pulled high. The manifest example for this add-on board can
be found here :
https://github.com/vaishnav98/manifesto/blob/mikrobusv3/manifests/ETH-CLICK.mnfsinclude/linux/greybus/greybus_manifest.h struct greybus_descriptor_cport { · line 178
Quoted 13 lines
include/linux/greybus/greybus_manifest.h +13
-0+/* +* A property descriptor is used to pass named properties +* to device drivers through the unified device properties +* interface under linux/property.h +*/ +struct greybus_descriptor_property { +__u8 length; +__u8 id; +__u8 propname_stringid; +__u8 type; +__u8 value[0 ]; +} __packed; +This descriptor is used to fill in
struct property_entry(linux/property.h), thepropname_stringid
field is used to map to the corresponding string descriptor which has the property name, the type field has the types underdev_prop_type(linux/property.h) and there are some new types which are used within the mikrobus driver, these are the new types :MIKROBUS_PROPERTY_TYPE_LINK=0x01MIKROBUS_PROPERTY_TYPE_GPIO=0x02The property-link type is used to attach an array of properties to the corresponding device, for example, consider an SPI EEPROM device which works with the AT25 driver(
drivers/misc/eeprom/at25.c), The device and property descriptor parts of the manifest will look like this.[device-descriptor 1]
driver-string-id = 3
prop-link = 1 (The ID of the property-descriptor which contains the list of IDs of the actual properties to attach with the device)
protocol =0xb
reg = 0
mode =0x3
max-speed-hz = 5000000
[string-descriptor 3]
string = at25 (driver string)[property-descriptor 1]
name-string-id = 4
type =0x01(type is property-link)
value = <2 3 4>(attach properties with id 2,3,4 to the device) [string-descriptor 4]
string = prop-link[property-descriptor 2]
name-string-id = 5 (string id for the property name string) type =0x05(U32, driver usesdevice_property_read_u32call to read the value)
value = <262144>
[string-descriptor 5]
string = size (property name string)[property-descriptor 3]
name-string-id = 6
type =0x05
value = <256>
[string-descriptor 6]
string = pagesize[property-descriptor 4]
name-string-id = 7
type =0x05
value = <24>
[string-descriptor 7]
string = address-widthThe gpio-link type is very similar to property descriptor and is used to pass an array of named gpios to the device driver through GPIO lookup tables, consider an example for a SHT15 device (
drivers/hwmon/sht15.c), the device and the property(gpio) descriptors are as follows :[device-descriptor 1]
driver-string-id = 3
protocol =0xfe
reg = 0
gpio-link = 1 (The ID of the property-descriptor which contains the list of IDs of the named gpio properties to attach with the device)[string-descriptor 3]
string = sht11 (device_idstring)[property-descriptor 1]
name-string-id = 4
type =0x02(gpio-link)
value = <2 3> (attach properties with id 2,3 as named gpios to the device) [string-descriptor 4]
string = gpio-link[property-descriptor 2]
name-string-id = 5
type =0x03
value = <4>
[string-descriptor 5]
string = clk (name of the GPIO, the driver usesdevm_gpiod_getor similar calls to get the GPIO)[property-descriptor 3]
name-string-id = 6
type =0x03
value = <5>
[string-descriptor 6]
string = dataNote that the values here 4 and 5 for the GPIOs are the offset numbers(clockwise starting from PWM pin) within a mikrobus port, the mikrobus drivers translates this offset information to the actual GPIO while creating the GPIO lookup table, this ensures that the manifest doesn't have any port-specific information and a single manifest can be used for an add-on board over different platforms/sockets.
Quoted 9 lines
include/linux/greybus/greybus_manifest.h +9
-0+/* +* A device descriptor is used to describe the +* details required by a add-on board device +* driver. +*/ +struct greybus_descriptor_device { +__u8 id; +__u8 driver_stringid; +__u8 protocol;include/linux/greybus/greybus_manifest.h struct greybus_descriptor_cport { · line 197
Quoted 10 lines
include/linux/greybus/greybus_manifest.h +10
-0+__u8 reg; +__le32 max_speed_hz; +__u8 irq; +__u8 irq_type; +__u8 mode; +__u8 prop_link; +__u8 gpio_link; +__u8 pad[3 ]; +} __packed; +The device descriptor is used to describe a device on the mikrobus port and has necessary fields from
struct i2c_board_infoandstruct spi_board_info, of these fields, the irq field is similar to the gpio descriptor value above in that the value under irq is also the pin offset within the mikrobus port which will be translated to the actual GPIO within the mikrobus driver and the irq-type takes types defined underlinux/interrupt.h. For a device with aIRQF_TRIGGER_RISINGinterrupt on the INT pin on the mikrobus port the fields will be :
irq = 1 (offset of INT pin)irq_type= 1 (IRQF_TRIGGER_RISING)Quoted 14 lines
include/linux/greybus/greybus_manifest.h +3
-1struct greybus_descriptor_header {__le16 size;__u8 type;/* enum greybus_descriptor_type */ @@ -164,6 +208,9 @@ struct greybus_descriptor {struct greybus_descriptor_interface interface;struct greybus_descriptor_bundle bundle;struct greybus_descriptor_cport cport; +struct greybus_descriptor_mikrobus mikrobus; +struct greybus_descriptor_property property; +struct greybus_descriptor_device device; }; } __packed; --Quoted 2 lines
2.25.1
Thanks and Regards,
Vaishnav
Thanks and Regards,
Vaishnav
RFC PATCH v2 2/3 mikroBUS driver for add-on boards on mikrobus ports
In reply to Vaishnav M AThe mikrobus driver is updated to add mikrobus ports from device-tree overlays, the debug interfaces for adding mikrobus ports through sysFS is removed, and the driver considers the extended usage of mikrobus port pins from their standard purpose, for example an SHT15 add-on board will need the I2C pins to be configured as GPIOs for the corresponding driver(drivers/hwmon/sht15.c) to work correctly to consider cases like these the mikrobus driver supports setting the pinmux states and can consider each Pin of the mikrobus port as GPIO if required.
The manifests for supported 110 add-on boards are available here:
https://github.com/vaishnav98/manifesto/tree/mikrobusv3
--- MAINTAINERS | 6 + drivers/misc/Kconfig | 1 + drivers/misc/Makefile | 1 + drivers/misc/mikrobus/Kconfig | 16 + drivers/misc/mikrobus/Makefile | 7 + drivers/misc/mikrobus/mikrobus_core.c | 692 ++++++++++++++++++++++ drivers/misc/mikrobus/mikrobus_core.h | 191 ++++++ drivers/misc/mikrobus/mikrobus_manifest.c | 444 ++++++++++++++ drivers/misc/mikrobus/mikrobus_manifest.h | 21 + drivers/misc/mikrobus/mikrobus_port.c | 171 ++++++ 10 files changed, 1550 insertions(+) create mode 100644 drivers/misc/mikrobus/Kconfig create mode 100644 drivers/misc/mikrobus/Makefile create mode 100644 drivers/misc/mikrobus/mikrobus_core.c create mode 100644 drivers/misc/mikrobus/mikrobus_core.h create mode 100644 drivers/misc/mikrobus/mikrobus_manifest.c create mode 100644 drivers/misc/mikrobus/mikrobus_manifest.h create mode 100644 drivers/misc/mikrobus/mikrobus_port.c
MAINTAINERS +6 -0
@@ -11543,6 +11543,12 @@ M: Oliver Neukum <[email protected]> S: Maintained F: drivers/usb/image/microtek.* +MIKROBUS ADDON BOARD DRIVER +M: Vaishnav M A <[email protected]> +S: Maintained +W: https://elinux.org/Mikrobus +F: drivers/misc/mikrobus/ + MIPS M: Thomas Bogendoerfer <[email protected]> L: [email protected]
drivers/misc/Kconfig +1 -0
@@ -472,4 +472,5 @@ source "drivers/misc/ocxl/Kconfig" source "drivers/misc/cardreader/Kconfig" source "drivers/misc/habanalabs/Kconfig" source "drivers/misc/uacce/Kconfig" +source "drivers/misc/mikrobus/Kconfig" endmenu
drivers/misc/Makefile +1 -0
@@ -40,6 +40,7 @@ obj-$(CONFIG_VMWARE_BALLOON) += vmw_balloon.o obj-$(CONFIG_PCH_PHUB) += pch_phub.o obj-y += ti-st/ obj-y += lis3lv02d/ +obj-y += mikrobus/ obj-$(CONFIG_ALTERA_STAPL) +=altera-stapl/ obj-$(CONFIG_INTEL_MEI) += mei/ obj-$(CONFIG_VMWARE_VMCI) += vmw_vmci/
drivers/misc/mikrobus/Kconfig new file +16 -0
@@ -0,0 +1,16 @@ +menuconfig MIKROBUS + tristate "Module for instantiating devices on mikroBUS ports" + help + This option enables the mikroBUS driver. mikroBUS is an add-on + board socket standard that offers maximum expandability with + the smallest number of pins. The mikroBUS driver instantiates + devices on a mikroBUS port described by identifying data present + in an add-on board resident EEPROM, more details on the mikroBUS + driver support and discussion can be found in this eLinux wiki : + elinux.org/Mikrobus + + + Say Y here to enable support for this driver. + + To compile this code as a module, chose M here: the module + will be called mikrobus.ko
drivers/misc/mikrobus/Makefile new file +7 -0
@@ -0,0 +1,7 @@ +# SPDX-License-Identifier: GPL-2.0 +# mikroBUS Core + +mikrobus-y := mikrobus_core.o mikrobus_manifest.o +mikrobus_port-y := mikrobus_port.o +obj-$(CONFIG_MIKROBUS) += mikrobus.o +obj-$(CONFIG_MIKROBUS) += mikrobus_port.o
drivers/misc/mikrobus/mikrobus_core.c new file +692 -0
692 lines not on this page · raw message
drivers/misc/mikrobus/mikrobus_core.h new file +191 -0
191 lines not on this page · raw message
drivers/misc/mikrobus/mikrobus_manifest.c new file +444 -0
444 lines not on this page · raw message
drivers/misc/mikrobus/mikrobus_manifest.h new file +21 -0
@@ -0,0 +1,21 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* +* mikroBUS manifest definition +* extension to Greybus Manifest Definition +* +* Copyright 2014-2015 Google Inc. +* Copyright 2014-2015 Linaro Ltd. +* +* Released under the GPLv2 and BSD licenses. +*/ + +#ifndef __MIKROBUS_MANIFEST_H +#define __MIKROBUS_MANIFEST_H + +#include "mikrobus_core.h" + +int mikrobus_manifest_parse (struct addon_board_info *info,void *data, +size_t size); +size_t mikrobus_manifest_header_validate (void *data,size_t size); + +#endif /* __MIKROBUS_MANIFEST_H */
drivers/misc/mikrobus/mikrobus_port.c new file +171 -0
171 lines not on this page · raw message
Signature · 1 line
2.25.1
kernel test robot
build botRe: [RFC PATCH v2 2/3] mikroBUS driver for add-on boards on mikrobus ports
[If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch]
Hi Vaishnav,
[FYI, it's a private test report for your RFC patch.]
[auto build test WARNING on char-misc/char-misc-testing]
[also build test WARNING on linux/master robh/for-next soc/for-next linus/master v5.9-rc1 next-20200818] [If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Vaishnav-M-A/mikroBUS-driver-for-add-on-boards/20200818-205058 base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git 9123e3a74ec7b934a4a099e98af6a61c2f80bbf5 config: sh-allmodconfig (attached as .config) compiler: sh4-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=sh
If you fix the issue, kindly add following tag as appropriate
All warnings (new ones prefixed by >>):
drivers/misc/mikrobus/mikrobus_manifest.c: In function 'mikrobus_manifest_parse_devices':
>> drivers/misc/mikrobus/mikrobus_manifest.c:363:6: warning: variable 'retval' set but not used [-Wunused-but-set-variable]
363 | int retval;
| ^~~~~~# https://github.com/0day-ci/linux/commit/c988bea7af28a40a4c0a835b6765a2c4fe154c04
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Vaishnav-M-A/mikroBUS-driver-for-add-on-boards/20200818-205058 git checkout c988bea7af28a40a4c0a835b6765a2c4fe154c04
vim +/retval +363 drivers/misc/mikrobus/mikrobus_manifest.c
358
359 static int mikrobus_manifest_parse_devices(struct addon_board_info *board)
360 {
361 struct greybus_descriptor_device *desc_device;
362 struct manifest_desc *desc, *next;
> 363 int retval;
364 int devcount = 0;
365
366 list_for_each_entry_safe(desc, next, &board->manifest_descs, links) {
367 if (desc->type != GREYBUS_TYPE_DEVICE)
368 continue;
369 desc_device = desc->data;
370 retval = mikrobus_manifest_attach_device(board, desc_device);
371 devcount++;
372 }
373 return devcount;
374 }
375
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
kernel test robot
build botRe: [RFC PATCH v2 2/3] mikroBUS driver for add-on boards on mikrobus ports
In reply to Vaishnav M A[If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch]
Hi Vaishnav,
[FYI, it's a private test report for your RFC patch.]
[auto build test WARNING on char-misc/char-misc-testing]
[also build test WARNING on linux/master robh/for-next soc/for-next linus/master v5.9-rc1 next-20200818] [If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Vaishnav-M-A/mikroBUS-driver-for-add-on-boards/20200818-205058 base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git 9123e3a74ec7b934a4a099e98af6a61c2f80bbf5 config: alpha-allyesconfig (attached as .config) compiler: alpha-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=alpha
If you fix the issue, kindly add following tag as appropriate
All warnings (new ones prefixed by >>):
drivers/misc/mikrobus/mikrobus_manifest.c: In function 'mikrobus_manifest_parse_devices':
drivers/misc/mikrobus/mikrobus_manifest.c:363:6: warning: variable 'retval' set but not used [-Wunused-but-set-variable]
363 | int retval;
| ^~~~~~
In file included from include/linux/printk.h:7,
from include/linux/kernel.h:15,
from drivers/misc/mikrobus/mikrobus_core.h:12,
from drivers/misc/mikrobus/mikrobus_manifest.h:15,
from drivers/misc/mikrobus/mikrobus_manifest.c:18:
drivers/misc/mikrobus/mikrobus_manifest.c: In function 'mikrobus_manifest_parse':
>> include/linux/kern_levels.h:5:18: warning: format '%zu' expects argument of type 'size_t', but argument 4 has type 'int' [-Wformat=]
5 | #define KERN_SOH "\001" /* ASCII Start Of Header */
| ^~~~~~
include/linux/kern_levels.h:11:18: note: in expansion of macro 'KERN_SOH'
11 | #define KERN_ERR KERN_SOH "3" /* error conditions */
| ^~~~~~~~
include/linux/printk.h:339:9: note: in expansion of macro 'KERN_ERR'
339 | printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
| ^~~~~~~~
drivers/misc/mikrobus/mikrobus_manifest.c:396:3: note: in expansion of macro 'pr_err'
396 | pr_err("invalid manifest size(%zu < %zu)", size, manifest_size);
| ^~~~~~
drivers/misc/mikrobus/mikrobus_manifest.c:396:41: note: format string is defined here
396 | pr_err("invalid manifest size(%zu < %zu)", size, manifest_size);
| ~~^
| |
| long unsigned int
| %u
In file included from include/linux/printk.h:7,
from include/linux/kernel.h:15,
from drivers/misc/mikrobus/mikrobus_core.h:12,
from drivers/misc/mikrobus/mikrobus_manifest.h:15,
from drivers/misc/mikrobus/mikrobus_manifest.c:18:
include/linux/kern_levels.h:5:18: warning: format '%zu' expects argument of type 'size_t', but argument 3 has type 'int' [-Wformat=]
5 | #define KERN_SOH "\001" /* ASCII Start Of Header */
| ^~~~~~
include/linux/kern_levels.h:11:18: note: in expansion of macro 'KERN_SOH'
11 | #define KERN_ERR KERN_SOH "3" /* error conditions */
| ^~~~~~~~
include/linux/printk.h:339:9: note: in expansion of macro 'KERN_ERR'
339 | printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
| ^~~~~~~~
drivers/misc/mikrobus/mikrobus_manifest.c:412:4: note: in expansion of macro 'pr_err'
412 | pr_err("invalid manifest descriptor, size: %zu", desc_size);
| ^~~~~~
drivers/misc/mikrobus/mikrobus_manifest.c:412:49: note: format string is defined here
412 | pr_err("invalid manifest descriptor, size: %zu", desc_size);
| ~~^
| |
| long unsigned int
| %u# https://github.com/0day-ci/linux/commit/c988bea7af28a40a4c0a835b6765a2c4fe154c04
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Vaishnav-M-A/mikroBUS-driver-for-add-on-boards/20200818-205058 git checkout c988bea7af28a40a4c0a835b6765a2c4fe154c04
vim +5 include/linux/kern_levels.h
314ba3520e513a7 Joe Perches 2012-07-30 404d2c8c83d0e3ac Joe Perches 2012-07-30 @5 #define KERN_SOH "\001" /* ASCII Start Of Header */04d2c8c83d0e3ac Joe Perches 2012-07-30 6 #define KERN_SOH_ASCII '\001'04d2c8c83d0e3ac Joe Perches 2012-07-30 7
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]
RFC PATCH v2 3/3 Add Device Tree Bindings for mikroBUS port
In reply to Vaishnav M AThis patch adds device tree bindings for the mikroBUS port, device tree overlays for the mikrobus Port on the BeagleBoard.org PocketBeagle is available here :github.com/beagleboard/bb.org-overlays/blob/master/src/arm/PB-MIKROBUS-0.dts
--- .../bindings/misc/linux,mikrobus.txt | 81 +++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 Documentation/devicetree/bindings/misc/linux,mikrobus.txt
Documentation/devicetree/bindings/misc/linux,mikrobus.txt new file +81 -0
@@ -0,0 +1,81 @@ +mikroBUS add-on board socket + +Required properties: +- compatible: Must be "linux,mikrobus" +- i2c-adapter: phandle to the i2c adapter attached to the mikrobus socket. +- spi-master: spi bus number of the spi-master attached to the mikrobus socket. +- spi-cs: spi chip-select numbers corresponding to the chip-selects + on the mikrobus socket(0 -> chip select corresponding to CS pin + 1 -> chip select corresponding to RST pin). +- serdev-controller: phandle to the uart port attached to the mikrobus socket. +- pwms: phandle to the pwm-controller corresponding to the mikroBUS PWM pin. +- mikrobus-gpios: gpios array corresponding to GPIOs on the mikroBUS port, + for targets not supporting the AN pin on the mikroBUS port as + GPIO, the length of the gpios array can be 11, otherwise it + should be 12. +- pinctrl-names: pinctrl state names to support additional pin usage/deviations + from mikroBUS socket standard usage, must be "default", + "pwm_default", "pwm_gpio", "uart_default", "uart_gpio", + "i2c_default", "i2c_gpio", "spi_default", "spi_gpio", these + pinctrl names should have corresponding pinctrl-N entries which + corresponds to the pinmux state for the pingroup, for example, + i2c_default corresponds to the state where the I2C pin group + (SCL,SDA) are configured in I2C mode and i2c_gpio mode corresponds + to the pinmux state where these pins are configured as GPIO. +- pinctrl-N : pinctrl-(0-8) corresponds to the pinctrl states for the states described + above. + +Example: + mikrobus-0 { + compatible = "linux,mikrobus"; + status = "okay"; + pinctrl-names = "default", "pwm_default", "pwm_gpio", + "uart_default", "uart_gpio", "i2c_default", + "i2c_gpio", "spi_default", "spi_gpio"; + pinctrl-0 = < + &P2_03_gpio_input_pin + &P1_04_gpio_pin + &P1_02_gpio_pin + >; + pinctrl-1 = <&P2_01_pwm_pin>; + pinctrl-2 = <&P2_01_gpio_pin>; + pinctrl-3 = < + &P2_05_uart_pin + &P2_07_uart_pin + >; + pinctrl-4 = < + &P2_05_gpio_pin + &P2_07_gpio_pin + >; + pinctrl-5 = < + &P2_09_i2c_pin + &P2_11_i2c_pin + >; + pinctrl-6 = < + &P2_09_gpio_pin + &P2_11_gpio_pin + >; + pinctrl-7 = < + &P1_12_spi_pin + &P1_10_spi_pin + &P1_08_spi_sclk_pin + &P1_06_spi_cs_pin + >; + pinctrl-8 = < + &P1_12_gpio_pin + &P1_10_gpio_pin + &P1_08_gpio_pin + &P1_06_gpio_pin + >; + i2c-adapter = <&i2c1>; + spi-master = <0>; + spi-cs = <0 1>; + serdev-controller = <&uart4>; + pwms = <&ehrpwm1 0 500000 0>; + mikrobus-gpios = <&gpio1 18 0> , <&gpio0 23 0>, + <&gpio0 30 0> , <&gpio0 31 0>, + <&gpio0 15 0> , <&gpio0 14 0>, + <&gpio0 4 0> , <&gpio0 3 0>, + <&gpio0 2 0> , <&gpio0 5 0>, + <&gpio2 25 0> , <&gpio2 3 0>; + };
Signature · 1 line
2.25.1
Re: [greybus-dev] [RFC PATCH v2 3/3] Add Device Tree Bindings for mikroBUS port
Hi Vaishnav,
Thank you for the patch.
Quoted 8 lines · Vaishnav M A
This patch adds device tree bindings for the mikroBUS port, device tree overlays for the mikrobus Port on the BeagleBoard.org PocketBeagle is available here :
github.com/beagleboard/bb.org-overlays/blob/master/src/arm/PB-MIKROBUS-0.dtsSigned-off-by Vaishnav M A <[email protected]>--- .../bindings/misc/linux,mikrobus.txt | 81 +++++++++++++++++++
Would you mind converting this binding document to YAML ? For new bindings we're trying to enforce usage of YAML, to avoid increasing the conversion backlog.
Quoted 91 lines
1 file changed, 81 insertions(+) create mode 100644 Documentation/devicetree/bindings/misc/linux,mikrobus.txtDocumentation/devicetree/bindings/misc/linux,mikrobus.txt new file +81
-0@@ -0,0 +1,81 @@ +mikroBUS add-on board socket + +Required properties: +- compatible: Must be "linux,mikrobus" +- i2c-adapter: phandle to the i2c adapter attached to the mikrobus socket. +- spi-master: spi bus number of the spi-master attached to the mikrobus socket. +- spi-cs: spi chip-select numbers corresponding to the chip-selects + on the mikrobus socket(0 -> chip select corresponding to CS pin + 1 -> chip select corresponding to RST pin). +- serdev-controller: phandle to the uart port attached to the mikrobus socket. +- pwms: phandle to the pwm-controller corresponding to the mikroBUS PWM pin. +- mikrobus-gpios: gpios array corresponding to GPIOs on the mikroBUS port, + for targets not supporting the AN pin on the mikroBUS port as + GPIO, the length of the gpios array can be 11, otherwise it + should be 12. +- pinctrl-names: pinctrl state names to support additional pin usage/deviations + from mikroBUS socket standard usage, must be "default", + "pwm_default", "pwm_gpio", "uart_default", "uart_gpio", + "i2c_default", "i2c_gpio", "spi_default", "spi_gpio", these + pinctrl names should have corresponding pinctrl-N entries which + corresponds to the pinmux state for the pingroup, for example, + i2c_default corresponds to the state where the I2C pin group + (SCL,SDA) are configured in I2C mode and i2c_gpio mode corresponds + to the pinmux state where these pins are configured as GPIO. +- pinctrl-N : pinctrl-(0-8) corresponds to the pinctrl states for the states described + above. + +Example: + mikrobus-0 { + compatible = "linux,mikrobus"; + status = "okay"; + pinctrl-names = "default", "pwm_default", "pwm_gpio", + "uart_default", "uart_gpio", "i2c_default", + "i2c_gpio", "spi_default", "spi_gpio"; + pinctrl-0 = < + &P2_03_gpio_input_pin + &P1_04_gpio_pin + &P1_02_gpio_pin + >; + pinctrl-1 = <&P2_01_pwm_pin>; + pinctrl-2 = <&P2_01_gpio_pin>; + pinctrl-3 = < + &P2_05_uart_pin + &P2_07_uart_pin + >; + pinctrl-4 = < + &P2_05_gpio_pin + &P2_07_gpio_pin + >; + pinctrl-5 = < + &P2_09_i2c_pin + &P2_11_i2c_pin + >; + pinctrl-6 = < + &P2_09_gpio_pin + &P2_11_gpio_pin + >; + pinctrl-7 = < + &P1_12_spi_pin + &P1_10_spi_pin + &P1_08_spi_sclk_pin + &P1_06_spi_cs_pin + >; + pinctrl-8 = < + &P1_12_gpio_pin + &P1_10_gpio_pin + &P1_08_gpio_pin + &P1_06_gpio_pin + >; + i2c-adapter = <&i2c1>; + spi-master = <0>; + spi-cs = <0 1>; + serdev-controller = <&uart4>; + pwms = <&ehrpwm1 0 500000 0>; + mikrobus-gpios = <&gpio1 18 0> , <&gpio0 23 0>, + <&gpio0 30 0> , <&gpio0 31 0>, + <&gpio0 15 0> , <&gpio0 14 0>, + <&gpio0 4 0> , <&gpio0 3 0>, + <&gpio0 2 0> , <&gpio0 5 0>, + <&gpio2 25 0> , <&gpio2 3 0>; + };
Signature · 3 lines
Regards, Laurent Pinchart
Re: [greybus-dev] [RFC PATCH v2 3/3] Add Device Tree Bindings for mikroBUS port
Quoted 11 lines · Laurent Pinchart
Hi Vaishnav,
Thank you for the patch.
Quoted 5 lines · Vaishnav M A
This patch adds device tree bindings for the mikroBUS port, device tree overlays for the mikrobus Port on the BeagleBoard.org PocketBeagle is available here :
github.com/beagleboard/bb.org-overlays/blob/master/src/arm/PB-MIKROBUS-0.dts
Quoted 8 lines
Quoted 3 lines
Signed-off-by Vaishnav M A <[email protected]>--- .../bindings/misc/linux,mikrobus.txt | 81 +++++++++++++++++++Would you mind converting this binding document to YAML ? For new bindings we're trying to enforce usage of YAML, to avoid increasing the conversion backlog.
Hi Laurent,
Sure, I will convert the device tree binding document to YAML in the next version.
Quoted 95 lines
Quoted 81 lines
1 file changed, 81 insertions(+) create mode 100644 Documentation/devicetree/bindings/misc/linux,mikrobus.txtDocumentation/devicetree/bindings/misc/linux,mikrobus.txt new file +72
-0@@ -0,0 +1,81 @@ +mikroBUS add-on board socket + +Required properties: +- compatible: Must be "linux,mikrobus" +- i2c-adapter: phandle to the i2c adapter attached to the mikrobus socket. +- spi-master: spi bus number of the spi-master attached to the mikrobus socket. +- spi-cs: spi chip-select numbers corresponding to the chip-selects + on the mikrobus socket(0 -> chip select corresponding to CS pin + 1 -> chip select corresponding to RST pin). +- serdev-controller: phandle to the uart port attached to the mikrobus socket. +- pwms: phandle to the pwm-controller corresponding to the mikroBUS PWM pin. +- mikrobus-gpios: gpios array corresponding to GPIOs on the mikroBUS port, + for targets not supporting the AN pin on the mikroBUS port as + GPIO, the length of the gpios array can be 11, otherwise it + should be 12. +- pinctrl-names: pinctrl state names to support additional pin usage/deviations + from mikroBUS socket standard usage, must be "default", + "pwm_default", "pwm_gpio", "uart_default", "uart_gpio", + "i2c_default", "i2c_gpio", "spi_default", "spi_gpio", these + pinctrl names should have corresponding pinctrl-N entries which + corresponds to the pinmux state for the pingroup, for example, + i2c_default corresponds to the state where the I2C pin group + (SCL,SDA) are configured in I2C mode and i2c_gpio mode corresponds + to the pinmux state where these pins are configured as GPIO. +- pinctrl-N : pinctrl-(0-8) corresponds to the pinctrl states for the states described + above. + +Example: + mikrobus-0 { + compatible = "linux,mikrobus"; + status = "okay"; + pinctrl-names = "default", "pwm_default", "pwm_gpio", + "uart_default", "uart_gpio", "i2c_default", + "i2c_gpio", "spi_default", "spi_gpio"; + pinctrl-0 = < + &P2_03_gpio_input_pin + &P1_04_gpio_pin + &P1_02_gpio_pin + >; + pinctrl-1 = <&P2_01_pwm_pin>; + pinctrl-2 = <&P2_01_gpio_pin>; + pinctrl-3 = < + &P2_05_uart_pin + &P2_07_uart_pin + >; + pinctrl-4 = < + &P2_05_gpio_pin + &P2_07_gpio_pin + >; + pinctrl-5 = < + &P2_09_i2c_pin + &P2_11_i2c_pin + >; + pinctrl-6 = < + &P2_09_gpio_pin + &P2_11_gpio_pin + >; + pinctrl-7 = < + &P1_12_spi_pin + &P1_10_spi_pin + &P1_08_spi_sclk_pin + &P1_06_spi_cs_pin + >; + pinctrl-8 = < + &P1_12_gpio_pin + &P1_10_gpio_pin + &P1_08_gpio_pin + &P1_06_gpio_pin + >; + i2c-adapter = <&i2c1>; + spi-master = <0>; + spi-cs = <0 1>;Documentation/devicetree/bindings/misc/linux,mikrobus.txt line 81
Quoted 10 lines
Documentation/devicetree/bindings/misc/linux,mikrobus.txt new file +9
-0+ serdev-controller = <&uart4>; + pwms = <&ehrpwm1 0 500000 0>; + mikrobus-gpios = <&gpio1 18 0> , <&gpio0 23 0>, + <&gpio0 30 0> , <&gpio0 31 0>, + <&gpio0 15 0> , <&gpio0 14 0>, + <&gpio0 4 0> , <&gpio0 3 0>, + <&gpio0 2 0> , <&gpio0 5 0>, + <&gpio2 25 0> , <&gpio2 3 0>; + };--
Regards,
Quoted 1 line
Laurent Pinchart
Thanks and Regards,
Vaishnav
Rob Herring
maintainerRe: [RFC PATCH v2 3/3] Add Device Tree Bindings for mikroBUS port
In reply to Vaishnav M AQuoted 18 lines · Vaishnav M A
This patch adds device tree bindings for the mikroBUS port, device tree overlays for the mikrobus Port on the BeagleBoard.org PocketBeagle is available here :
github.com/beagleboard/bb.org-overlays/blob/master/src/arm/PB-MIKROBUS-0.dtsSigned-off-by Vaishnav M A <[email protected]>--- .../bindings/misc/linux,mikrobus.txt | 81 +++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 Documentation/devicetree/bindings/misc/linux,mikrobus.txtDocumentation/devicetree/bindings/misc/linux,mikrobus.txt new file +0
-0
Documentation/devicetree/bindings/misc/linux,mikrobus.txt line 4
Quoted 4 lines
Documentation/devicetree/bindings/misc/linux,mikrobus.txt new file +4
-0@@ -0,0 +1,81 @@ +mikroBUS add-on board socket + +Required properties: +- compatible: Must be "linux,mikrobus"
mikrobus is only a Linux thing? Just 'mikrobus-connector' is fine.
Are there versions of mikrobus spec/connectors? If so, then should probably include that into
Documentation/devicetree/bindings/misc/linux,mikrobus.txt line 9
Quoted 5 lines
Documentation/devicetree/bindings/misc/linux,mikrobus.txt new file +5
-0+- i2c-adapter: phandle to the i2c adapter attached to the mikrobus socket. +- spi-master: spi bus number of the spi-master attached to the mikrobus socket. +- spi-cs: spi chip-select numbers corresponding to the chip-selects + on the mikrobus socket(0 -> chip select corresponding to CS pin + 1 -> chip select corresponding to RST pin).
SPI and I2C need a common way to remap from host bus/cs to connector bus/cs including how to define the child devices and multiple instances.
Documentation/devicetree/bindings/misc/linux,mikrobus.txt line 10
Quoted 1 line
Documentation/devicetree/bindings/misc/linux,mikrobus.txt new file +1
-0+- serdev-controller: phandle to the uart port attached to the mikrobus socket.
'serdev' is a Linuxism. This also needs to be defined how child devices and multiple instances.
There's also a problem with the current serdev implementation that assigning a serial port to serdev or tty is a one time decision as probe time. So I don't think hotplug of a serial device will work today. But that's a Linux problem independent of the binding.
Documentation/devicetree/bindings/misc/linux,mikrobus.txt line 11
Quoted 1 line
Documentation/devicetree/bindings/misc/linux,mikrobus.txt new file +1
-0+- pwms: phandle to the pwm-controller corresponding to the mikroBUS PWM pin.
The PWM binding has a provider specific number of cells, so some translation is needed. Probably can define a 'pwm-map' property like gpio-map on this. More below.
Documentation/devicetree/bindings/misc/linux,mikrobus.txt line 15
Quoted 4 lines
Documentation/devicetree/bindings/misc/linux,mikrobus.txt new file +4
-0+- mikrobus-gpios: gpios array corresponding to GPIOs on the mikroBUS port, + for targets not supporting the AN pin on the mikroBUS port as + GPIO, the length of the gpios array can be 11, otherwise it + should be 12.
We have 'gpio-map' binding already (it's in the DT spec) created for this purpose of remapping connector GPIO numbers to host GPIO numbers.
Quoted 70 lines
Documentation/devicetree/bindings/misc/linux,mikrobus.txt new file +66
-1+- pinctrl-names: pinctrl state names to support additional pin usage/deviations + from mikroBUS socket standard usage, must be "default", + "pwm_default", "pwm_gpio", "uart_default", "uart_gpio", + "i2c_default", "i2c_gpio", "spi_default", "spi_gpio", these + pinctrl names should have corresponding pinctrl-N entries which + corresponds to the pinmux state for the pingroup, for example, + i2c_default corresponds to the state where the I2C pin group + (SCL,SDA) are configured in I2C mode and i2c_gpio mode corresponds + to the pinmux state where these pins are configured as GPIO. +- pinctrl-N : pinctrl-(0-8) corresponds to the pinctrl states for the states described + above. + +Example: + mikrobus-0 { + compatible = "linux,mikrobus"; + status = "okay"; + pinctrl-names = "default", "pwm_default", "pwm_gpio", + "uart_default", "uart_gpio", "i2c_default", + "i2c_gpio", "spi_default", "spi_gpio"; + pinctrl-0 = < + &P2_03_gpio_input_pin + &P1_04_gpio_pin + &P1_02_gpio_pin + >; + pinctrl-1 = <&P2_01_pwm_pin>; + pinctrl-2 = <&P2_01_gpio_pin>; + pinctrl-3 = < + &P2_05_uart_pin + &P2_07_uart_pin + >; + pinctrl-4 = < + &P2_05_gpio_pin + &P2_07_gpio_pin + >; + pinctrl-5 = < + &P2_09_i2c_pin + &P2_11_i2c_pin + >; + pinctrl-6 = < + &P2_09_gpio_pin + &P2_11_gpio_pin + >; + pinctrl-7 = < + &P1_12_spi_pin + &P1_10_spi_pin + &P1_08_spi_sclk_pin + &P1_06_spi_cs_pin + >; + pinctrl-8 = < + &P1_12_gpio_pin + &P1_10_gpio_pin + &P1_08_gpio_pin + &P1_06_gpio_pin + >; + i2c-adapter = <&i2c1>; + spi-master = <0>; + spi-cs = <0 1>; + serdev-controller = <&uart4>; + pwms = <&ehrpwm1 0 500000 0>; + mikrobus-gpios = <&gpio1 18 0> , <&gpio0 23 0>, + <&gpio0 30 0> , <&gpio0 31 0>, + <&gpio0 15 0> , <&gpio0 14 0>, + <&gpio0 4 0> , <&gpio0 3 0>, + <&gpio0 2 0> , <&gpio0 5 0>, + <&gpio2 25 0> , <&gpio2 3 0>; + }; --2.25.1
Greg KH
maintainerQuoted 4 lines · Vaishnav M A
Hi,
This Patch series is an update to the mikroBUS driver RFC v1 Patch : https://lkml.org/lkml/2020/7/24/518 .
Please use lore.kernel.org for links, we have no idea if lkml.org will be working tomorrow or not :)
Quoted 4 lines
The mikrobus driver is updated to add mikrobus ports from device-tree overlays, the debug interfaces for adding mikrobus ports through sysFS is removed, and the driver considers the extended usage of mikrobus port pins from their standard purposes.
I don't know what "properties" and "device" mean with regards to things here, any chance you can provide a patch to the greybus spec itself that adds this information so we can better understand the reasoning here to see if the kernel changes match up with the goals?
thanks,
greg k-h
Quoted 10 lines · Greg KH
Quoted 4 lines · Vaishnav M A
Hi,
This Patch series is an update to the mikroBUS driver RFC v1 Patch : https://lkml.org/lkml/2020/7/24/518 .
Please use lore.kernel.org for links, we have no idea if lkml.org will be working tomorrow or not :)
Hi Greg,
Thanks, will use lore.kernel.org for the links, attaching the corresponding link to the v1 RFC patch thread for reference:
https://lore.kernel.org/lkml/20200724120637.GA427284@vaishnav-VirtualBox/
Quoted 5 lines
Quoted 4 lines
The mikrobus driver is updated to add mikrobus ports from device-tree overlays, the debug interfaces for adding mikrobus ports through sysFS is removed, and the driver considers the extended usage of mikrobus port pins from their standard purposes.
Quoted 8 lines
I don't know what "properties" and "device" mean with regards to things here, any chance you can provide a patch to the greybus spec itself that adds this information so we can better understand the reasoning here to see if the kernel changes match up with the goals?
thanks,
greg k-h
Sure, I will add a patch to the greybus-spec to describe the new descriptors, the property and device descriptors are introduced to add information about the SPI/I2C/UART chip/sensor which is required by the corresponding device drivers, With these descriptors, it will be possible to describe devices on I2C, SPI, UART, etc. behind a greybus device so as to bind existing kernel drivers to them, This is not what is currently being done within the mikroBUS driver, now it tries to instantiate devices on actual I2C, SPI, UART from describing manifests, but the ultimate goal is to describe the devices on I2C/SPI/UART behind a greybus device, thus enabling to attach existing kernel drivers to devices present in add-on boards attached to mikroBUS ports added via greybus.
Shall I submit a pull request to https://github.com/projectara/greybus-spec
for the specs, is there a different official upstream to greybus-spec?
Thanks and Regards,
Vaishnav M A
Greg KH
maintainerQuoted 42 lines · Vaishnav M A
Quoted 10 lines · Greg KH
Quoted 4 lines · Vaishnav M A
Hi,
This Patch series is an update to the mikroBUS driver RFC v1 Patch : https://lkml.org/lkml/2020/7/24/518 .
Please use lore.kernel.org for links, we have no idea if lkml.org will be working tomorrow or not :)
Hi Greg,
Thanks, will use lore.kernel.org for the links, attaching the corresponding link to the v1 RFC patch thread for reference:
https://lore.kernel.org/lkml/20200724120637.GA427284@vaishnav-VirtualBox/Quoted 5 lines
Quoted 4 lines
The mikrobus driver is updated to add mikrobus ports from device-tree overlays, the debug interfaces for adding mikrobus ports through sysFS is removed, and the driver considers the extended usage of mikrobus port pins from their standard purposes.
Quoted 8 lines
I don't know what "properties" and "device" mean with regards to things here, any chance you can provide a patch to the greybus spec itself that adds this information so we can better understand the reasoning here to see if the kernel changes match up with the goals?
thanks,
greg k-h
Sure, I will add a patch to the greybus-spec to describe the new descriptors, the property and device descriptors are introduced to add information about the SPI/I2C/UART chip/sensor which is required by the corresponding device drivers, With these descriptors, it will be possible to describe devices on I2C, SPI, UART, etc. behind a greybus device so as to bind existing kernel drivers to them, This is not what is currently being done within the mikroBUS driver, now it tries to instantiate devices on actual I2C, SPI, UART from describing manifests, but the ultimate goal is to describe the devices on I2C/SPI/UART behind a greybus device, thus enabling to attach existing kernel drivers to devices present in add-on boards attached to mikroBUS ports added via greybus.
Quoted 2 lines
Shall I submit a pull request to https://github.com/projectara/greybus-spec
for the specs, is there a different official upstream to greybus-spec?
That's a good place, but for now, you can submit it as part of your patch series as well, so we can all see it and review it easier.
thanks,
greg k-h
Hi Vaishnav,
+me +devicetree
Please add these two recipients to future versions.
I will comment more after reading the first version and v2.
-Frank
Quoted 46 lines · Vaishnav M A
Hi,
This Patch series is an update to the mikroBUS driver
RFC v1 Patch : https://lkml.org/lkml/2020/7/24/518 .
The mikrobus driver is updated to add mikrobus ports from device-tree overlays, the debug interfaces for adding mikrobus ports through sysFS is removed, and the driver considers the extended usage of mikrobus port pins from their standard purposes.change log:
v2: support for adding mikroBUS ports from DT overlays, remove debug sysFS interface for adding mikrobus ports, consider extended pin usage/deviations from mikrobus standard specifications,
use greybus CPort protocol enum instead of new protcol enums Fix cases of wrong indendation, ignoring return values, freeing allocated resources in case of errors and other style suggestions in v1 review.Vaishnav M A (3):
add mikrobus descriptors togreybus_manifestmikroBUS driver for add-on boards on mikrobus ports Add Device Tree Bindings for mikroBUS port.../bindings/misc/linux,mikrobus.txt | 81 ++ MAINTAINERS | 6 + drivers/misc/Kconfig | 1 + drivers/misc/Makefile | 1 + drivers/misc/mikrobus/Kconfig | 16 + drivers/misc/mikrobus/Makefile | 7 + drivers/misc/mikrobus/mikrobus_core.c | 692 ++++++++++++++++++ drivers/misc/mikrobus/mikrobus_core.h | 191 +++++ drivers/misc/mikrobus/mikrobus_manifest.c | 444 +++++++++++ drivers/misc/mikrobus/mikrobus_manifest.h | 21 + drivers/misc/mikrobus/mikrobus_port.c | 171 +++++ include/linux/greybus/greybus_manifest.h | 47 ++ 12 files changed, 1678 insertions(+) create mode 100644 Documentation/devicetree/bindings/misc/linux,mikrobus.txt create mode 100644 drivers/misc/mikrobus/Kconfig create mode 100644 drivers/misc/mikrobus/Makefile create mode 100644 drivers/misc/mikrobus/mikrobus_core.c create mode 100644 drivers/misc/mikrobus/mikrobus_core.h create mode 100644 drivers/misc/mikrobus/mikrobus_manifest.c create mode 100644 drivers/misc/mikrobus/mikrobus_manifest.h create mode 100644 drivers/misc/mikrobus/mikrobus_port.c
Quoted 11 lines · Frank Rowand
Hi Vaishnav,
+me +devicetree
Please add these two recipients to future versions.
I will comment more after reading the first version and v2.
-Frank
Hi Frank,
Sorry, I missed to run get_maintainer.pl after making the changes will add both recipients in future versions.
Thanks and Regards,
Vaishnav M A
Quoted 49 lines · Vaishnav M A
Quoted 46 lines
Hi,
This Patch series is an update to the mikroBUS driver
RFC v1 Patch : https://lkml.org/lkml/2020/7/24/518 .
The mikrobus driver is updated to add mikrobus ports from device-tree overlays, the debug interfaces for adding mikrobus ports through sysFS is removed, and the driver considers the extended usage of mikrobus port pins from their standard purposes.change log:
v2: support for adding mikroBUS ports from DT overlays, remove debug sysFS interface for adding mikrobus ports, consider extended pin usage/deviations from mikrobus standard specifications,
use greybus CPort protocol enum instead of new protcol enums Fix cases of wrong indendation, ignoring return values, freeing allocated resources in case of errors and other style suggestions in v1 review.Vaishnav M A (3):
add mikrobus descriptors togreybus_manifestmikroBUS driver for add-on boards on mikrobus ports Add Device Tree Bindings for mikroBUS port.../bindings/misc/linux,mikrobus.txt | 81 ++ MAINTAINERS | 6 + drivers/misc/Kconfig | 1 + drivers/misc/Makefile | 1 + drivers/misc/mikrobus/Kconfig | 16 + drivers/misc/mikrobus/Makefile | 7 + drivers/misc/mikrobus/mikrobus_core.c | 692 ++++++++++++++++++ drivers/misc/mikrobus/mikrobus_core.h | 191 +++++ drivers/misc/mikrobus/mikrobus_manifest.c | 444 +++++++++++ drivers/misc/mikrobus/mikrobus_manifest.h | 21 + drivers/misc/mikrobus/mikrobus_port.c | 171 +++++ include/linux/greybus/greybus_manifest.h | 47 ++ 12 files changed, 1678 insertions(+) create mode 100644 Documentation/devicetree/bindings/misc/linux,mikrobus.txt create mode 100644 drivers/misc/mikrobus/Kconfig create mode 100644 drivers/misc/mikrobus/Makefile create mode 100644 drivers/misc/mikrobus/mikrobus_core.c create mode 100644 drivers/misc/mikrobus/mikrobus_core.h create mode 100644 drivers/misc/mikrobus/mikrobus_manifest.c create mode 100644 drivers/misc/mikrobus/mikrobus_manifest.h create mode 100644 drivers/misc/mikrobus/mikrobus_port.c
Hi Vaishnav,
Apologies in advance -- I expect to be very slow in responding this week. Linux Plumbers will take some of my time and I am moving to a new home.
-Frank
Quoted 59 lines · Frank Rowand
Hi Vaishnav,
+me +devicetree
Please add these two recipients to future versions.
I will comment more after reading the first version and v2.
-Frank
Quoted 46 lines · Vaishnav M A
Hi,
This Patch series is an update to the mikroBUS driver
RFC v1 Patch : https://lkml.org/lkml/2020/7/24/518 .
The mikrobus driver is updated to add mikrobus ports from device-tree overlays, the debug interfaces for adding mikrobus ports through sysFS is removed, and the driver considers the extended usage of mikrobus port pins from their standard purposes.change log:
v2: support for adding mikroBUS ports from DT overlays, remove debug sysFS interface for adding mikrobus ports, consider extended pin usage/deviations from mikrobus standard specifications,
use greybus CPort protocol enum instead of new protcol enums Fix cases of wrong indendation, ignoring return values, freeing allocated resources in case of errors and other style suggestions in v1 review.Vaishnav M A (3):
add mikrobus descriptors togreybus_manifestmikroBUS driver for add-on boards on mikrobus ports Add Device Tree Bindings for mikroBUS port.../bindings/misc/linux,mikrobus.txt | 81 ++ MAINTAINERS | 6 + drivers/misc/Kconfig | 1 + drivers/misc/Makefile | 1 + drivers/misc/mikrobus/Kconfig | 16 + drivers/misc/mikrobus/Makefile | 7 + drivers/misc/mikrobus/mikrobus_core.c | 692 ++++++++++++++++++ drivers/misc/mikrobus/mikrobus_core.h | 191 +++++ drivers/misc/mikrobus/mikrobus_manifest.c | 444 +++++++++++ drivers/misc/mikrobus/mikrobus_manifest.h | 21 + drivers/misc/mikrobus/mikrobus_port.c | 171 +++++ include/linux/greybus/greybus_manifest.h | 47 ++ 12 files changed, 1678 insertions(+) create mode 100644 Documentation/devicetree/bindings/misc/linux,mikrobus.txt create mode 100644 drivers/misc/mikrobus/Kconfig create mode 100644 drivers/misc/mikrobus/Makefile create mode 100644 drivers/misc/mikrobus/mikrobus_core.c create mode 100644 drivers/misc/mikrobus/mikrobus_core.h create mode 100644 drivers/misc/mikrobus/mikrobus_manifest.c create mode 100644 drivers/misc/mikrobus/mikrobus_manifest.h create mode 100644 drivers/misc/mikrobus/mikrobus_port.c