-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
drivers: Rework Silabs Gecko UART Driver #8930
Conversation
Codecov Report
@@ Coverage Diff @@
## master #8930 +/- ##
==========================================
- Coverage 53.34% 53.19% -0.16%
==========================================
Files 211 211
Lines 25828 25828
Branches 5686 5686
==========================================
- Hits 13779 13738 -41
- Misses 9734 9781 +47
+ Partials 2315 2309 -6
Continue to review full report at Codecov.
|
drivers/serial/Kconfig.gecko
Outdated
@@ -26,7 +26,7 @@ if UART_GECKO_0 | |||
config UART_GECKO_0_GPIO_LOC | |||
int "Pin Locations" | |||
range 0 3 | |||
depends on UART_GECKO | |||
depends on UART_GECKO && !HAS_DTS_SERIAL |
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.
Or could we enforce HAS_DTS_SERIAL somehow, so all gecko mcus must use it? In that case all _LOC config options could be removed from Kconfig.gecko.
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.
d840aa7
to
688125a
Compare
@galak and @MaureenHelm , Any feedbacks? |
1 similar comment
@galak and @MaureenHelm , Any feedbacks? |
688125a
to
258804c
Compare
@galak, can we proceed with the review? |
These changes seem part of the PR #9042. I made comments over there. |
9f0ff44
to
d925896
Compare
d925896
to
f74ce50
Compare
title: EFM32 UART | ||
id: silabs,efm32-uart | ||
title: GECKO UART | ||
id: silabs,gecko-uart |
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.
Trying to remove id: so lets leave that alone
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.
Use CONFIG_ for dt generated defines. This makes it easier for us to know what is being generated by DT rather than dropping the CONFIG_ prefix. Eventually this will go away when we do more codegen and remove dts fixups.
Also, might need updating now that we merged the EFM32HG support
title: EFM32 USART | ||
id: silabs,efm32-usart | ||
title: GECKO USART | ||
id: silabs,gecko-usart |
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.
same comment about id.
@@ -33,15 +33,15 @@ | |||
#endif /* CONFIG_USART_GECKO_0 */ | |||
|
|||
#ifdef CONFIG_USART_GECKO_1 | |||
#if (CONFIG_USART_GECKO_1_GPIO_LOC == 0) | |||
#if (USART_1_LOCATION == 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.
leave these as CONFIG_
@@ -18,13 +18,13 @@ | |||
|
|||
#ifdef CONFIG_SOC_PART_NUMBER_EFR32FG1P133F256GM48 | |||
#ifdef CONFIG_USART_GECKO_0 | |||
#if (CONFIG_USART_GECKO_0_GPIO_LOC == 0) | |||
#if (USART_0_LOCATION == 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.
leave as CONFIG_
@@ -7,9 +7,5 @@ | |||
/* SoC level DTS fixup file */ | |||
|
|||
#define CONFIG_NUM_IRQ_PRIO_BITS ARM_V7M_NVIC_E000E100_ARM_NUM_IRQ_PRIORITY_BITS | |||
#define CONFIG_USART_GECKO_0_NAME SILABS_EFM32_USART_40010000_LABEL |
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.
Leave this mapping
@@ -18,13 +18,13 @@ | |||
|
|||
#ifdef CONFIG_SOC_PART_NUMBER_EFM32WG990F256 | |||
#ifdef CONFIG_UART_GECKO_0 | |||
#if (CONFIG_UART_GECKO_0_GPIO_LOC == 0) | |||
#if (UART_0_LOCATION == 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.
keep these as CONFIG_
Hi, can we rebase this ontop https://github.com/ekarlso/zephyr/tree/silabs-uart @diegosueiro ? |
2e63807
to
231cf44
Compare
@ekarlso this was rebased on top of your tree? do you have a PR outstanding or is this the only Gecko UART driver PR open? |
2910ccf
to
2bc4ffa
Compare
@carlescufi and @galak, Branch rebased and all checks have passed. ;-) |
Use CONFIG_UART_GECKO instead of CONFIG_SERIAL_HAS_DRIVER to compile the low level uart driver. Signed-off-by: Diego Sueiro <diego.sueiro@gmail.com>
Add more uart/usart instances for Silabs Gecko Devices and remove the *_GPIO_LOC configs. Signed-off-by: Diego Sueiro <diego.sueiro@gmail.com>
Introduces the location property and adds the ability to use values generated by the device tree configuration. Signed-off-by: Diego Sueiro <diego.sueiro@gmail.com> Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
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've made some updates, dropped board.h from driver. Used standard CONFIG_ naming convention for now, dropped 'id:' from yaml.
Can you test this out to make sure it still works.
@@ -1,16 +1,17 @@ | |||
--- | |||
title: EFM32 USART | |||
title: GECKO USART | |||
id: silabs,efm32-usart |
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.
drop id
@@ -1,16 +1,17 @@ | |||
--- | |||
title: EFM32 UART | |||
title: GECKO UART | |||
id: silabs,efm32-uart |
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.
drop id
drivers/serial/uart_gecko.c
Outdated
@@ -10,6 +10,7 @@ | |||
#include <em_gpio.h> | |||
#include <em_cmu.h> | |||
#include <soc.h> | |||
#include <board.h> |
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 do we need board.h included?
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.
Because for efr32mg_sltb004a board the board.h includes the "soc_pinmap.h", inside the board folder, which holds the UART pin settings.
The other silabs boards are setting the pins in the "soc_pinmap.h" header, inside the soc folder, which is included by the "soc.h" header, and I think is not the best approach since pin configuration/muxing should be set at board level, not soc. What do you think?
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 mapping which location corresponds to which pin is a property of the soc. But the location that is actually chosen is part of the board. Or am I missing something here?
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.
Its a 50/50 case, in that we set some standard pin cfg in the soc headers for a number of SoCs. The board ends up select a default or pre-cfg option in a lot of cases. Eventually we will move pin cfg info into the device tree. For now I'd keep with the same pattern that other SiLabs boards/SoC 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.
Ok.
I'll update the PR #9042 as soon as this one gets merged.
The only hardware that I have is the thunderboard from the other PR #9042. But the changes looks fine to me apart from dropping the board.h as I explained here |
ok, let me look at that. |
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 is working fine on the EFM32WG-STK3800
This patch series introduces a new config HAS_DTS_SERIAL and reworks the Silabs Gecko UART driver and associated soc and board files to enable using values defined by the device tree configuration.