-
Notifications
You must be signed in to change notification settings - Fork 8.2k
SensorTag basic board support #68
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
Conversation
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.
So the patch series should be re-ordered slightly, the linker script should come first, than SoC (merge the cc2650: Add basic support for Device Tree. patch with SoC patch).
Let's also see about the UART driver.
|
Sorry about that, commit dates mixed up the order when pushing. |
78c0221 to
a1c74b7
Compare
I have the following questions:
|
|
Regarding policy on HALs, my understanding is that they are initially being encouraged as a way to expand board support in Zephyr, though I've heard some comments against HALs if they bring in too much extra code. In the case of CC32xx, I was able to save ~2K in code space by using the ROM versions of the cc32xx driverlib functions: MAP_*. I wonder if there is a SimpleLink SDK for cc26xx? The following link seems to suggest that is the case: |
|
Regarding power management, the cc32xx UART driver does not currently support power management, so is not a good example. I would think it's best for the device driver to provide the power management hooks, and initialization. |
drivers/serial/uart_stellaris.c
Outdated
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.
could this be done in soc.c for cc2650?
|
With regards to DT generated, we intend to generate the code bits so the #defines go away, the problem with names is its hard to come up with a generic solution that works for everyone. Some people start at 0, some want it to be the name the board uses, and not the SoC, etc. So for now the fixup file exists until we can generate the bits instead that are in the driver code. |
|
|
Sorry for taking so long on this, headed on vacation for a few days, but will focus on getting this reviewed and merged next week. Thanks. |
|
No problem, I tried to keep conflicts minimal to avoid headaches upon merging. |
1d365cc to
0a8ad73
Compare
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.
A number of changes needed. Lets have the 'uart' patch be the first patch, since its just cleaning / commenting on support for CC2650. Also, lets pull the random # patch from this PR so we can get SoC/Board support in.
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.
Why is CCFG_SIZE not just hard coded value here? Does the size change device to device?
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.
No, I thought initially that other TI devices shared a similar CCFG concept with different options, but I only find this for the CC13xx / CC26xx SoCs. I can remove CONFIG_TI_CCFG_SIZE and hardcode it here, if that's okay.
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 do
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.
ROM_ADDR is defined on line 43, 45, and 52. Lets remove lines 45 & 52.
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.
Lets add a comment here about:
/* Some TI SoCs have a cfg footer at the end of flash for device configuration */
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.
When would this value ever be something other than 88?
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.
__ti_ccfg_section instead of _GENERIC_SECTION()
drivers/serial/uart_stellaris.c
Outdated
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.
What do we need from soc.h?
drivers/serial/uart_stellaris.c
Outdated
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.
Lets just remove usage of UART_IRQ_FLAGS, just change the function to pass a 0.
drivers/pinmux/Kconfig.cc2650
Outdated
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.
since pin mux depends on GPIO driver, the GPIO driver should be first in the sequence of commits.
drivers/pinmux/pinmux_cc2650.c
Outdated
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.
you shouldn't need these prototypes, re-order the code in the file if needed so they can be removed.
drivers/gpio/gpio_cc2650.c
Outdated
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.
remove this, just call function with 0.
drivers/random/random_cc2650.c
Outdated
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.
do we really need toolchain/gcc.h?, trim headres down to what's needed.
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.
I'm just using the ARG_UNUSED() macro.
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.
ok
drivers/random/random_cc2650.c
Outdated
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.
should look like:
- SPDX-License-Identifier: Apache-2.0
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.
some minor comments on random driver.
|
|
Can you rebase the patch set on latest 'arm' branch. Thanks. |
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.
nit picking, but we should probably just have bit_is_set as a static inline in the header.
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.
Points of view seem to differ on this. I was asked exactly the opposite (implement functions in soc.c separately from soc.h) some weeks ago.
dts/arm/ti/cc2650.dtsi
Outdated
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.
should be: compatible = "ti,stellaris-uart";
dts/arm/ti/cc2650.dtsi
Outdated
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.
This doesn't look right, the number of bits should probably be 3? Guessing 8 priority levels.
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.
Good catch, it looks like I mixed up the Cortex M3's user guide number of prio levels (256) with the ones available for the CC2650 SoC (8 indeed).
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.
Some dts related changes need to be made.
|
I'm going to pull in the linker script and modify the uart driver patch into the arm branch so we can close out on those bits. |
|
drivers/serial/uart_stellaris.c
Outdated
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.
Why this change, we should keep things as they are and use label in device tree like other uarts are using.
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.
uart patch still needs work, in theory we should be able to remove it.
dts/arm/cc2650_sensortag.fixup
Outdated
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.
as mentioned before, merge this change into the board patch.
8176617 to
49326ad
Compare
|
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 uart: Use DTS labels... commit, should be first, and should also remove the defines from dts/arm/qemu_cortex_m3.fixup.
#define CONFIG_UART_STELLARIS_PORT_0_NAME TI_STELLARIS_UART_4000C000_LABEL
#define CONFIG_UART_STELLARIS_PORT_1_NAME TI_STELLARIS_UART_4000D000_LABEL
#define CONFIG_UART_STELLARIS_PORT_2_NAME TI_STELLARIS_UART_4000E000_LABEL
dts/arm/ti/cc2650.dtsi
Outdated
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.
I'd expect this in the SOC commit.
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.
Remove GPIO_INT_PIN_EXTRAFLAGS, doesn't seem to add anything.
samples/drivers/gpio/src/main.c
Outdated
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.
is there really a need to introduce GPIO_INT_PIN_EXTRAFLAGS since its only used in the CC2650 ifdef case?
samples/drivers/gpio/src/main.c
Outdated
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.
Why not just replace GPIO_INT_PIN_EXTRAFLAGS with GPIO_PUD_PULL_UP, not sure what the #define is getting us.
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.
For the Sensortag, I needed an extra GPIO_PUD_PULL_UP flag.
As this is probably not the only board needing to pass some extra flags for now, I added a little bit of flexibility, so other boards in the future can define (or not) more flags as needed while keeping code readable.
So yes, for now it's only used for the CC2650 but it may prove useful as the test code becomes used for more boards.
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.
I tend to do such things once we see the need for them.
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.
Alright, I'll just use GPIO_PUD_PULL_UP then.
Update driver to use DTS-generated #defines for port names, and not obsolete Kconfig variables. Signed-off-by: Geoffrey Le Gourriérec <[email protected]>
Add support in arch/arm/soc/ti_simplelink, along with support for CC32xx SoC. Signed-off-by: Geoffrey Le Gourriérec <[email protected]>
Add support for TI's SensorTag board, which uses a CC2650 SoC. Signed-off-by: Geoffrey Le Gourriérec <[email protected]>
Signed-off-by: Geoffrey Le Gourriérec <[email protected]>
Signed-off-by: Geoffrey Le Gourriérec <[email protected]>
Add extra #defines in samples/drivers/gpio to test TI SensorTag board. Signed-off-by: Geoffrey Le Gourriérec <[email protected]>
|
|
Thanks a lot Kumar for your work and patience! I'm happy to make my first steps in the Zephyr project. :) |
|
Thanks for your patience as well. Hope to see some more development from you in the future! |
…-sample [samples] Fix two bugs in TwoButtons.js sample
Basic board support for the TI SensorTag, with minimal drivers.
Basic board support for the TI SensorTag, with minimal drivers.
Questions remain to be answered, like Stellaris / CC3200 UART driver reuse
and how to accomodate HW-specific flash header / footer needs by modifying
the Cortex generic linker script.