Repository navigation
Update i2c1-bcm2708-overlay.dts - #2118
soodvarun78 wants to merge 1 commit into
Conversation
Removing fragment@1 as it is not required. The fragment creates another device node in the with name i2c1_pins, as already dts files bcm2710-rpi-3-b.dts, bcm2708-rpi-b-plus.dts and bcm2709-rpi-2-b.dts creates the device node.
|
Have you tested the modified overlay? Although you've spotted an undesirable anomaly, with your patch the overlay no longer applies. There was a time, over a year ago, when the overlay was merged with the base tree before the parameters were applied, but that was changed so that parameters modify the overlay before merging with the base tree in order to fit with the way the kernel applied overlays. Although this sounds like an implementation detail, a consequence is that parameters/overrides can only refer to symbols within the overlay. The workaround is to create a fragment that targets the symbol and populate it with the properties that the parameters have to change (*). A working version that removes the duplication looks like this: (*) N.B. Although it is permissible for a parameter to create a property that doesn't exist, if the parameter is only modifying a part of the property then the remainder will be filled with zeroes to make it long enough (unless other parameters overwrite the rest), which probably isn't what you want. Therefore it is safer (but less flexible) to provide a default property value. |
|
plz unsubscribe the thread. thx.
2017-07-17 16:52 GMT+08:00 Phil Elwell <notifications@github.com>:
… Have you tested the modified overlay? Although you've spotted an
undesirable anomaly, with your patch the overlay no longer applies.
There was a time, over a year ago, when the overlay was merged with the
base tree before the parameters were applied, but that was changed so that
parameters modify the overlay before merging with the base tree in order to
fit with the way the kernel applied overlays. Although this sounds like an
implementation detail, a consequence is that parameters/overrides can only
refer to symbols within the overlay. The workaround is to create a fragment
that targets the symbol and populate it with the properties that the
parameters have to change (*).
A working version that removes the duplication looks like this:
/*
* Device tree overlay for i2c_bcm2708, i2c1 bus
*
* Compile:
* dtc -@ -I dts -O dtb -o i2c1-bcm2708-overlay.dtb i2c1-bcm2708-overlay.dts
*/
/dts-v1/;
/plugin/;
/{
compatible = "brcm,bcm2708";
***@***.*** {
target = <&i2c1>;
__overlay__ {
pinctrl-0 = <&i2c1_pins>;
status = "okay";
};
};
***@***.*** {
target = <&i2c1_pins>;
pins: __overlay__ {
brcm,pins = <2 3>;
brcm,function = <4>; /* alt 0 */
};
};
__overrides__ {
sda1_pin = <&pins>,"brcm,pins:0";
scl1_pin = <&pins>,"brcm,pins:4";
pin_func = <&pins>,"brcm,function:0";
};
};
(*) N.B. Although it is permissible for a parameter to create a property
that doesn't exist, if the parameter is only modifying a part of the
property then the remainder will be filled with zeroes to make it long
enough (unless other parameters overwrite the rest), which probably isn't
what you want. Therefore it is safer (but less flexible) to provide a
default property value.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#2118 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AECNq4goVgyrRA0-_Rf0q1IZHnPBYxT3ks5sOyCzgaJpZM4OZR4u>
.
|
|
Hi Phil , Thanks for the input. I verified your patch and it is working... It is much more cleaner than me. Regards |
It is bad practise to overwrite an entire node in an overlay. Instead, target the node and overwrite any properties that need changing. See: #2118 Suggested-by: soodvarun78 <soodvarun78@gmail.com> Signed-off-by: Phil Elwell <phil@raspberrypi.org>
|
The modified patch is now in the 4.9 tree. |
It is bad practise to overwrite an entire node in an overlay. Instead, target the node and overwrite any properties that need changing. See: #2118 Suggested-by: soodvarun78 <soodvarun78@gmail.com> Signed-off-by: Phil Elwell <phil@raspberrypi.org>
It is bad practise to overwrite an entire node in an overlay. Instead, target the node and overwrite any properties that need changing. See: #2118 Suggested-by: soodvarun78 <soodvarun78@gmail.com> Signed-off-by: Phil Elwell <phil@raspberrypi.org>
It is bad practise to overwrite an entire node in an overlay. Instead, target the node and overwrite any properties that need changing. See: #2118 Suggested-by: soodvarun78 <soodvarun78@gmail.com> Signed-off-by: Phil Elwell <phil@raspberrypi.org>
It is bad practise to overwrite an entire node in an overlay. Instead, target the node and overwrite any properties that need changing. See: #2118 Suggested-by: soodvarun78 <soodvarun78@gmail.com> Signed-off-by: Phil Elwell <phil@raspberrypi.org>
It is bad practise to overwrite an entire node in an overlay. Instead, target the node and overwrite any properties that need changing. See: #2118 Suggested-by: soodvarun78 <soodvarun78@gmail.com> Signed-off-by: Phil Elwell <phil@raspberrypi.org>
kernel: config: enhance DualShock3 controller support See: raspberrypi/linux#2121 kernel: bcm2835-mmc: Fix DMA usage kernel: bcm2835-mmc: Prevent DMA race condition kernel: overlays: i2c1-bcm2708: Don't overwrite i2c1 pins node See: raspberrypi/linux#2118
kernel: config: enhance DualShock3 controller support See: raspberrypi/linux#2121 kernel: bcm2835-mmc: Fix DMA usage kernel: bcm2835-mmc: Prevent DMA race condition kernel: overlays: i2c1-bcm2708: Don't overwrite i2c1 pins node See: raspberrypi/linux#2118
It is bad practise to overwrite an entire node in an overlay. Instead, target the node and overwrite any properties that need changing. See: #2118 Suggested-by: soodvarun78 <soodvarun78@gmail.com> Signed-off-by: Phil Elwell <phil@raspberrypi.org>
It is bad practise to overwrite an entire node in an overlay. Instead, target the node and overwrite any properties that need changing. See: #2118 Suggested-by: soodvarun78 <soodvarun78@gmail.com> Signed-off-by: Phil Elwell <phil@raspberrypi.org>
It is bad practise to overwrite an entire node in an overlay. Instead, target the node and overwrite any properties that need changing. See: #2118 Suggested-by: soodvarun78 <soodvarun78@gmail.com> Signed-off-by: Phil Elwell <phil@raspberrypi.org>
It is bad practise to overwrite an entire node in an overlay. Instead, target the node and overwrite any properties that need changing. See: #2118 Suggested-by: soodvarun78 <soodvarun78@gmail.com> Signed-off-by: Phil Elwell <phil@raspberrypi.org>
It is bad practise to overwrite an entire node in an overlay. Instead, target the node and overwrite any properties that need changing. See: #2118 Suggested-by: soodvarun78 <soodvarun78@gmail.com> Signed-off-by: Phil Elwell <phil@raspberrypi.org>
It is bad practise to overwrite an entire node in an overlay. Instead, target the node and overwrite any properties that need changing. See: #2118 Suggested-by: soodvarun78 <soodvarun78@gmail.com> Signed-off-by: Phil Elwell <phil@raspberrypi.org>
It is bad practise to overwrite an entire node in an overlay. Instead, target the node and overwrite any properties that need changing. See: #2118 Suggested-by: soodvarun78 <soodvarun78@gmail.com> Signed-off-by: Phil Elwell <phil@raspberrypi.org>
It is bad practise to overwrite an entire node in an overlay. Instead, target the node and overwrite any properties that need changing. See: #2118 Suggested-by: soodvarun78 <soodvarun78@gmail.com> Signed-off-by: Phil Elwell <phil@raspberrypi.org>
It is bad practise to overwrite an entire node in an overlay. Instead, target the node and overwrite any properties that need changing. See: #2118 Suggested-by: soodvarun78 <soodvarun78@gmail.com> Signed-off-by: Phil Elwell <phil@raspberrypi.org>
It is bad practise to overwrite an entire node in an overlay. Instead, target the node and overwrite any properties that need changing. See: #2118 Suggested-by: soodvarun78 <soodvarun78@gmail.com> Signed-off-by: Phil Elwell <phil@raspberrypi.org>
It is bad practise to overwrite an entire node in an overlay. Instead, target the node and overwrite any properties that need changing. See: #2118 Suggested-by: soodvarun78 <soodvarun78@gmail.com> Signed-off-by: Phil Elwell <phil@raspberrypi.org>
It is bad practise to overwrite an entire node in an overlay. Instead, target the node and overwrite any properties that need changing. See: #2118 Suggested-by: soodvarun78 <soodvarun78@gmail.com> Signed-off-by: Phil Elwell <phil@raspberrypi.org>
It is bad practise to overwrite an entire node in an overlay. Instead, target the node and overwrite any properties that need changing. See: #2118 Suggested-by: soodvarun78 <soodvarun78@gmail.com> Signed-off-by: Phil Elwell <phil@raspberrypi.org>
It is bad practise to overwrite an entire node in an overlay. Instead, target the node and overwrite any properties that need changing. See: #2118 Suggested-by: soodvarun78 <soodvarun78@gmail.com> Signed-off-by: Phil Elwell <phil@raspberrypi.org>
It is bad practise to overwrite an entire node in an overlay. Instead, target the node and overwrite any properties that need changing. See: #2118 Suggested-by: soodvarun78 <soodvarun78@gmail.com> Signed-off-by: Phil Elwell <phil@raspberrypi.org>
It is bad practise to overwrite an entire node in an overlay. Instead, target the node and overwrite any properties that need changing. See: #2118 Suggested-by: soodvarun78 <soodvarun78@gmail.com> Signed-off-by: Phil Elwell <phil@raspberrypi.org>
It is bad practise to overwrite an entire node in an overlay. Instead, target the node and overwrite any properties that need changing. See: #2118 Suggested-by: soodvarun78 <soodvarun78@gmail.com> Signed-off-by: Phil Elwell <phil@raspberrypi.org>
It is bad practise to overwrite an entire node in an overlay. Instead, target the node and overwrite any properties that need changing. See: #2118 Suggested-by: soodvarun78 <soodvarun78@gmail.com> Signed-off-by: Phil Elwell <phil@raspberrypi.org>
It is bad practise to overwrite an entire node in an overlay. Instead, target the node and overwrite any properties that need changing. See: #2118 Suggested-by: soodvarun78 <soodvarun78@gmail.com> Signed-off-by: Phil Elwell <phil@raspberrypi.org>
It is bad practise to overwrite an entire node in an overlay. Instead, target the node and overwrite any properties that need changing. See: #2118 Suggested-by: soodvarun78 <soodvarun78@gmail.com> Signed-off-by: Phil Elwell <phil@raspberrypi.org>
It is bad practise to overwrite an entire node in an overlay. Instead, target the node and overwrite any properties that need changing. See: #2118 Suggested-by: soodvarun78 <soodvarun78@gmail.com> Signed-off-by: Phil Elwell <phil@raspberrypi.org>
It is bad practise to overwrite an entire node in an overlay. Instead, target the node and overwrite any properties that need changing. See: #2118 Suggested-by: soodvarun78 <soodvarun78@gmail.com> Signed-off-by: Phil Elwell <phil@raspberrypi.org>
commit d33a484 Author: Phil Elwell <phil@raspberrypi.org> Date: Wed Jul 19 15:20:50 2017 +0100 overlays: i2c1-bcm2708: Don't overwrite i2c1 pins node It is bad practise to overwrite an entire node in an overlay. Instead, target the node and overwrite any properties that need changing. See: raspberrypi/linux#2118 Suggested-by: soodvarun78 <soodvarun78@gmail.com> Signed-off-by: Phil Elwell <phil@raspberrypi.org> Gbp-Pq: Topic rpi Gbp-Pq: Name rpi_1310_d33a484ffeda75e7f3bc76f9ebe1b384a71ec305.patch
It is bad practise to overwrite an entire node in an overlay. Instead, target the node and overwrite any properties that need changing. See: raspberrypi#2118 Suggested-by: soodvarun78 <soodvarun78@gmail.com> Signed-off-by: Phil Elwell <phil@raspberrypi.org>
commit 2ad0bc7 Author: Phil Elwell <phil@raspberrypi.org> Date: Wed Jul 19 15:20:50 2017 +0100 overlays: i2c1-bcm2708: Don't overwrite i2c1 pins node It is bad practise to overwrite an entire node in an overlay. Instead, target the node and overwrite any properties that need changing. See: raspberrypi/linux#2118 Suggested-by: soodvarun78 <soodvarun78@gmail.com> Signed-off-by: Phil Elwell <phil@raspberrypi.org> Gbp-Pq: Topic rpi Gbp-Pq: Name rpi_1312_2ad0bc7fe2645a1a0c0f6e1034720c1d296c0e7e.patch
commit 2ad0bc7 Author: Phil Elwell <phil@raspberrypi.org> Date: Wed Jul 19 15:20:50 2017 +0100 overlays: i2c1-bcm2708: Don't overwrite i2c1 pins node It is bad practise to overwrite an entire node in an overlay. Instead, target the node and overwrite any properties that need changing. See: raspberrypi/linux#2118 Suggested-by: soodvarun78 <soodvarun78@gmail.com> Signed-off-by: Phil Elwell <phil@raspberrypi.org> Gbp-Pq: Topic rpi Gbp-Pq: Name rpi_1312_2ad0bc7fe2645a1a0c0f6e1034720c1d296c0e7e.patch
Removing fragment@1 as it is not required.
The fragment 1 creates another device node with name i2c1_pins which is already created by dts files bcm2710-rpi-3-b.dts, bcm2708-rpi-b-plus.dts and bcm2709-rpi-2-b.dts.