-
Notifications
You must be signed in to change notification settings - Fork 7k
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
Shields: Allow shields conditional configuration #20934
Changes from all commits
1f8fd14
797a037
61fbafe
d03c9c9
9594614
a6c364c
5d12789
503d68b
f77f790
cd9dfcb
9d93f02
e86adc4
62faa39
a9620f8
4191c5c
e594d30
a778c21
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,6 +23,9 @@ source "$(BOARD_DIR)/Kconfig.board" | |
|
||
endchoice | ||
|
||
# Parse shields references | ||
# Don't do it as a menuconfig, as shield selection is a CMake feature. | ||
rsource "shields/*/Kconfig.shield" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. FWIW, I prefer The globbing kinda breaks grepping already though. |
||
|
||
menu "Board Options" | ||
# There might not be any board options, hence the optional source | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Copyright (c) 2019 Linaro Limited | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
if SHIELD_ADAFRUIT_2_8_TFT_TOUCH_V2 | ||
|
||
if DISPLAY | ||
|
||
config SPI | ||
default y | ||
|
||
config ILI9340 | ||
erwango marked this conversation as resolved.
Show resolved
Hide resolved
|
||
default y | ||
|
||
if LVGL | ||
|
||
config LVGL_DISPLAY_DEV_NAME | ||
default "ILI9340" | ||
|
||
config LVGL_HOR_RES | ||
default 320 | ||
|
||
config LVGL_VER_RES | ||
default 240 | ||
|
||
config LVGL_VDB_SIZE | ||
default 64 | ||
|
||
config LVGL_BITS_PER_PIXEL | ||
default 24 | ||
|
||
endif # LVGL | ||
|
||
endif # DISPLAY | ||
|
||
endif # SHIELD_ADAFRUIT_2_8_TFT_TOUCH_V2 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Copyright (c) 2019 Linaro Limited | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
config SHIELD_ADAFRUIT_2_8_TFT_TOUCH_V2 | ||
def_bool $(shields_list_contains,adafruit_2_8_tft_touch_v2) |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Copyright (c) 2019 Linaro Limited | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
if SHIELD_DFROBOT_CAN_BUS_V2_0 | ||
|
||
if CAN | ||
|
||
config SPI | ||
default y | ||
|
||
config CAN_MCP2515 | ||
default y | ||
|
||
rsource "boards/*.defconfig" | ||
|
||
endif # CAN | ||
|
||
endif # SHIELD_DFROBOT_CAN_BUS_V2_0 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Copyright (c) 2019 Linaro Limited | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
config SHIELD_DFROBOT_CAN_BUS_V2_0 | ||
def_bool $(shields_list_contains,dfrobot_can_bus_v2_0) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Copyright (c) 2019 Linaro Limited | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
if BOARD_NRF52_PCA10040 | ||
|
||
config CAN_1 | ||
default y | ||
|
||
endif # BOARD_NRF52_PCA10040 |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# | ||
# Copyright (c) 2019, NXP | ||
# Copyright (c) 2019 Linaro Limited | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Inconsistent header. Make it
|
||
|
||
if SHIELD_FRDM_CR20A | ||
|
||
if IEEE802154 | ||
|
||
config SPI | ||
default y | ||
|
||
config IEEE802154_MCR20A | ||
default y | ||
|
||
config NET_CONFIG_IEEE802154_DEV_NAME | ||
default "mcr20a" | ||
|
||
rsource "boards/*.defconfig" | ||
|
||
endif # IEEE802154 | ||
|
||
endif # SHIELD_FRDM_CR20A |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Copyright (c) 2019 Linaro Limited | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
config SHIELD_FRDM_CR20A | ||
def_bool $(shields_list_contains,frdm_cr20a) |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# | ||
# Copyright (c) 2019, NXP | ||
# Copyright (c) 2019 Linaro Limited | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Make it
|
||
|
||
if BOARD_FRDM_K64F | ||
|
||
config NET_L2_ETHERNET | ||
default n | ||
|
||
endif # BOARD_FRDM_K64F |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Copyright (c) 2019 Linaro Limited | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
config SHIELD_FRDM_KW41Z | ||
def_bool $(shields_list_contains,frdm_kw41z) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Copyright (c) 2019 Linaro Limited | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
if SHIELD_LINK_BOARD_CAN | ||
|
||
if NETWORKING | ||
|
||
config SPI | ||
default y | ||
|
||
config CAN_MCP2515 | ||
default y | ||
|
||
rsource "boards/*.defconfig" | ||
|
||
endif # NETWORKING | ||
|
||
endif # SHIELD_LINK_BOARD_CAN |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Copyright (c) 2019 Linaro Limited | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
config SHIELD_LINK_BOARD_CAN | ||
def_bool $(shields_list_contains,link_board_can) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Copyright (c) 2019 Linaro Limited | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
if BOARD_REEL_BOARD | ||
|
||
config SPI_1 | ||
default y | ||
|
||
config CAN_1 | ||
default y | ||
|
||
endif # BOARD_REEL_BOARD |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Copyright (c) 2019 Linaro Limited | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
if SHIELD_LINK_BOARD_ETH | ||
|
||
if NETWORKING | ||
|
||
config SPI | ||
default y | ||
|
||
config NET_L2_ETHERNET | ||
default y | ||
|
||
config ETH_ENC424J600 | ||
default y | ||
|
||
rsource "boards/*.defconfig" | ||
|
||
endif # NETWORKING | ||
|
||
endif # SHIELD_LINK_BOARD_ETH |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Copyright (c) 2019 Linaro Limited | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
config SHIELD_LINK_BOARD_ETH | ||
def_bool $(shields_list_contains,link_board_eth) |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Copyright (c) 2019 Linaro Limited | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
if BOARD_REEL_BOARD | ||
|
||
config ETH_ENC424J600_0_GPIO_SPI_CS | ||
default y | ||
|
||
endif # BOARD_REEL_BOARD |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Copyright (c) 2019 Linaro Limited | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
if SHIELD_SPARKFUN_SARA_R4 | ||
|
||
if NETWORKING | ||
|
||
config MODEM | ||
default y | ||
|
||
config MODEM_SHELL | ||
default y | ||
|
||
config MODEM_UBLOX_SARA | ||
default y | ||
|
||
choice MODEM_UBLOX_SARA_VARIANT | ||
default MODEM_UBLOX_SARA_R4 | ||
endchoice | ||
|
||
config UART_INTERRUPT_DRIVEN | ||
default y | ||
|
||
# extend retry timing to 20 seconds for LTE/LTE-M | ||
config COAP_INIT_ACK_TIMEOUT_MS | ||
default 20000 | ||
|
||
# Hack: disable IPv6 for now | ||
config NET_IPV6 | ||
default n | ||
|
||
config NET_CONFIG_NEED_IPV6 | ||
default n | ||
|
||
rsource "boards/*.defconfig" | ||
|
||
endif # NETWORKING | ||
|
||
endif # SHIELD_SPARKFUN_SARA_R4 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Copyright (c) 2019 Linaro Limited | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
config SHIELD_SPARKFUN_SARA_R4 | ||
def_bool $(shields_list_contains,sparkfun_sara_r4) |
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Copyright (c) 2019 Linaro Limited | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
if BOARD_FRDM_K64F | ||
|
||
config UART_MCUX_3 | ||
default y | ||
|
||
endif # BOARD_FRDM_K64F |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Copyright (c) 2019 Linaro Limited | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
if BOARD_NRF52840_PCA10056 | ||
|
||
config GPIO_NRF_P1 | ||
default y | ||
|
||
config UART_1_NRF_UARTE | ||
default y | ||
|
||
endif # BOARD_NRF52840_PCA10056 |
This file was deleted.
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.
Are the enabled shields known pre-Kconfig?
If so we want to limit the sourced files to just those enabled.
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 and no.
When running a west build command this is known... But user can modify shields selection using
menuconfig
.If we do so (need to figure it out how, though), we prevent the ability to select shields in
menuconfig
.So we need to chose between this and build performance (which, I guess, is your point).
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.
Never mind then, thank you for the explanation.