Thread (12 messages) 12 messages, 2 authors, 2021-01-18

Re: [PATCH v4 1/6] dt-bindings: i3c: Convert controller description to yaml

From: Miquel Raynal <miquel.raynal@bootlin.com>
Date: 2021-01-18 15:32:29
Also in: linux-i3c

Hi Rob,
quoted
+      reg:
+        items:
+          - description: |
+              1st cell
+              ========
+
+              I2C address. 10 bit addressing is not supported. Devices with
+              10-bit address can't be properly passed through DEFSLVS command.
+
+              2nd cell
+              ========
+
+              Should be 0.
+
+              3rd cell
+              ========
+
+              Shall encode the I3C LVR (Legacy Virtual Register):
+              bit[31:8]: unused/ignored
+              bit[7:5]: I2C device index. Possible values:
+                * 0: I2C device has a 50 ns spike filter
+                * 1: I2C device does not have a 50 ns spike filter but supports
+                     high frequency on SCL
+                * 2: I2C device does not have a 50 ns spike filter and is not
+                     tolerant to high frequencies
+                * 3-7: reserved
+              bit[4]: tell whether the device operates in FM (Fast Mode) or
+                      FM+ mode:
+                * 0: FM+ mode
+                * 1: FM mode
+              bit[3:0]: device type
+                * 0-15: reserved  
We can do a bit better:

reg:
  items:
    - items:  # Note: drop the '-' if we support more than 1 entry
        - description: I2C address...
          maximum: 0x7f  # Not sure this works, do we support the high 
                         # flag bits here?
        - const: 0
        - description: I3C LVR (Legacy Virtual Register)...
I definitely think that it is a good move to properly define the fact
that we can accept only a single reg entry with three cells -and their
content, overall-, but this syntax does not work and I really don't find
the right way to describe it.

The error I get is:

---8<---
       reg:
         items:
           - items:
               - description: first item
               - description: second item
--->8---

schemas/i3c/i3c.yaml: ignoring, error in schema: patternProperties: @[0-9a-f]+$: properties: reg
<path>/i3c.yaml: patternProperties:@[0-9a-f]+$:properties:reg: 'anyOf' conditional failed, one must be fixed:
	'maxItems' is a required property
	'items' is not one of ['maxItems', 'description', 'deprecated']
	'items' is not one of ['description', 'deprecated', 'const', 'enum', 'minimum', 'maximum', 'default', '$ref']
	<path>/i3c.yaml: patternProperties:@[0-9a-f]+$:properties:reg:items: 'oneOf' conditional failed, one must be fixed:
		[{'items': [{'description': 'first item'}, {'description': 'second item'}]}] is not of type 'object'
		'items' is not one of ['description', 'deprecated', 'const', 'enum', 'minimum', 'maximum', 'default', '$ref']

I tried defining a phandle array, playing with the dashes, using allOf,
adding maxItems, none of it worked so far so any advice will be highly
appreciated!

Thanks,
Miquèl
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help