-
Notifications
You must be signed in to change notification settings - Fork 176
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BBB and BBAI compatible BBORG motorCape overlay #188
base: master
Are you sure you want to change the base?
Conversation
To make it compatible for both BBB and BBAI by using code from beagleboard/BeagleBoard-DeviceTrees/pull/17 and new DT format.
This DT is using code from beagleboard/BeagleBoard-DeviceTrees/pull/17 to create compatible led_P8_* / led_P8_* nodes for both BBB and BBAI. The PWM nodes are also made compatible on both the boards. Rewritten based on the BBORG_MOTOR-00A2.dts written by Robert Nelson for kernel <4.14
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please link to documentation at https://elinux.org/Beagleboard:BeagleBone_cape_interface_spec and update the documentation with a changelog that includes changes to conventions as well as a summary of symbols that can be referenced by overlays to use the cape interface "bus", including any helpers.
@@ -1,5 +1,8 @@ | |||
/* | |||
* Copyright (C) 2018 Robert Nelson <[email protected]> | |||
* Copyright (C) 2020 Deepak Khatri <[email protected]> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right approach is to add your copyright, not remove someone else's.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new code is very different from the old code that's why I dropped that. I will do that if you say so, talked to ds2 he suggested to include the comment you are seeing.
* Enable and Update the default state of the pins | ||
*/ | ||
&ocp { | ||
P8_13_pinmux { status = "okay"; pinctrl-0 = <&P8_13_pwm_pin>; }; /* motor3 speed */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given this approach, I don't think disabling the pinmux helper is needed. As only loosely mentioned in the comment, what you are doing here is changing the default mode with the pinmux helper, rather than using the driver to simply define the mode. This may be an OK approach, but it is a bit error-prone if someone messes with the pinmux helper. This change needs to be a bit better documented for users in some kind of changelog.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, you are right we don't need those disabling I will try things without it. There was a much bigger problem in the previous implementation method. we were limiting users to use labels we defined for the buses. With this approach and good documentation, the user can create new overlays without chaing in the compatibility code. I will write the documentation soon :)
pinctrl-0 = <&bborg_motor_ehrpwm1_pins>; | ||
/* | ||
* Easy Motor direction control through sysfs (/sys/class/leds/motor*) using gpio-leds driver | ||
* See these files for the led_P8_#/led_P9_# definition |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting to carry these led definitions at the "bus" level. I suppose it works if they are useful enough. We need a sane way to document helpers that are exposed by the "bus".
Please update the wiki page specification with usage guidelines for what interfaces are exposed for overlays to use.
@jadonk @RobertCNelson please review my code :)
Everything has been tested on BBB and BBAI. There is no 5v voltage connection on P9_5 and P9_6 of BBAI which is required by motorCape. To test the cape I used a jumper wire and connected P9_6 to P9_8 (sys_5v). We should consider resolving this in revision A2. Also, Symlinks are not working for PWM nodes what can be the reason for that?
Note: This DT overlay is dependent upon code from beagleboard/BeagleBoard-DeviceTrees#17