-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
boards: norik: Add support for Norik Octopus SoM & IO-Board #74523
base: main
Are you sure you want to change the base?
Conversation
ef78b27
to
7376d17
Compare
Building an application | ||
======================= | ||
|
||
In most case you'll need to use ``octopus_io_board_ns`` target for building examples. |
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.
name is not correct
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.
Fixed in recent changes
======================= | ||
|
||
In most case you'll need to use ``octopus_io_board_ns`` target for building examples. | ||
Some examples don't require non secure mode and can be built without ``octopus_io_board_ns`` target. |
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 above
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.
Fixed in recent changes
peripheral-power-controller { | ||
compatible = "gpio-keys"; | ||
|
||
pwrgpio0: pwrgpio_0 { | ||
label = "VP on/off"; | ||
gpios = <&gpio0 18 GPIO_ACTIVE_HIGH>; | ||
}; | ||
|
||
pwrgpio1: pwrgpio_1 { | ||
label = "CHG control"; | ||
gpios = <&gpio0 20 (GPIO_ACTIVE_LOW)>; | ||
}; | ||
|
||
}; |
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.
these are not buttons, a custom dts is 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.
Fixed in recent changes
watchdog0 = &wdt0; | ||
ldoctrl = &pwrgpio0; | ||
chgctrl = &pwrgpio1; | ||
bq25180 = &bq25180; |
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.
bq25180
is not used in samples, neither are ldoctrl
or chgctrl
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.
Fixed in recent changes
pinctrl-names = "default", "sleep"; | ||
|
||
bq25180: bq25180@6a { | ||
compatible = "i2c-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.
seems like a driver is missing?
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.
Fixed in recent changes
bq25180: bq25180@6a { | ||
compatible = "i2c-device"; | ||
status = "okay"; | ||
label = "BQ25180"; |
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.
we do not use labels in peripherals
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.
Fixed in recent changes
In most case you'll need to use ``octopus_som_ns`` target for building examples. | ||
Some examples don't require non secure mode and can be built without ``octopus_som_ns`` target. |
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 above
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.
Fixed in recent changes
led0 = &led0; | ||
pwm-led0 = &pwm_led0; | ||
watchdog0 = &wdt0; | ||
simselect = &sim_select; |
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 above
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.
Fixed in recent changes
@FPlohl tests are failing, can you fix? |
boards/norik/octopus_som/Kconfig
Outdated
int "Init priority" | ||
default 99 | ||
help | ||
Init priority for board control. |
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.
1x tab followed by 2x spaces for help text indent
boards/norik/octopus_som/board.c
Outdated
} | ||
|
||
return ret; | ||
} |
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.
indent
boards/norik/octopus_som/board.c
Outdated
static int octopus_som_sim_select(void) | ||
{ | ||
const struct gpio_dt_spec simctrl = GPIO_DT_SPEC_GET(DT_PATH(sim_select), sim_gpios); | ||
|
||
if (!gpio_is_ready_dt(&simctrl)) { | ||
LOG_ERR("SIM select GPIO not available"); | ||
return -ENODEV; | ||
} | ||
|
||
if (DT_ENUM_IDX(SIM_SELECT_NODE, sim) == 0) { | ||
(void)gpio_pin_configure_dt(&simctrl, GPIO_OUTPUT_LOW); | ||
LOG_INF("On-board SIM selected"); | ||
} else { | ||
(void)gpio_pin_configure_dt(&simctrl, GPIO_OUTPUT_HIGH); | ||
LOG_INF("External SIM selected"); | ||
} | ||
return 0; | ||
} | ||
|
||
|
||
static int octopus_som_init(void) |
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.
not sure why these need to be 2 different functions
boards/norik/octopus_som/board.c
Outdated
|
||
ret = octopus_som_sim_select(); | ||
if (ret < 0) { | ||
LOG_ERR("Failed to select SIM, error %d", ret); |
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 this is just showing the same error as the other function
======================= | ||
|
||
In most case you'll need to use ``octopus_som/nrf9160/ns`` target for building examples. | ||
Some examples don't require non secure mode and can be built with ``octopus_som`` target. |
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.
*octopus_som/nrf9160
|
||
.. zephyr-app-commands:: | ||
:zephyr-app: samples/basic/blinky | ||
:board: octopus_som |
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.
*octopus_som/nrf9160
int "Init priority" | ||
default 99 | ||
help | ||
Init priority for board control. |
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.
apply comments from other commit to this 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.
Apply comments to both commits
Building an application | ||
======================= | ||
|
||
In most case you'll need to use ``octopus_som/nrf9160/ns`` target for building examples. |
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.
board target
}; | ||
}; | ||
|
||
&flash0 { |
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 now all gone, see #76452
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 not sure I understand what needs to be done here. Edit: nevermind, looked into recent commits
fb5be5b
to
2cb1c7a
Compare
@nordicjm twister tests seem to be canceled. Can you re-run them or give some insight why they failed? |
Compliance failure |
5c43efb
to
defd842
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.
Minor nits. then good
low-power-enable; | ||
}; | ||
}; | ||
|
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.
boards/norik/octopus_som/Kconfig
Outdated
|
||
config OCTOPUS_SOM_CONTROL_INIT_PRIORITY | ||
int "Init priority" | ||
default 99 |
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.
select PINCTRL
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 you have a .c file which is using it. Breaks how? If it is a Kconfig error then add a new hidden Kconfig that selects that symbol
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 added config BOARD_OCTOPUS_SOM
that contains select PINCTRL
. Now it works as expected.
Hardware | ||
******** | ||
|
||
The Norik Octopus SoM supports the following hardware features: |
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 Norik Octopus SoM supports the following hardware features: | |
The ``octopus_som/nrf9160`` and ``octopus_som/nrf9160/ns`` board targets support the following hardware features: |
low-power-enable; | ||
}; | ||
}; | ||
|
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.
|
||
config OCTOPUS_IO_BOARD_CONTROL_INIT_PRIORITY | ||
int "Init priority" | ||
default 99 |
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 per other comment
3cbce7a
to
b190fa0
Compare
const struct device *charger = DEVICE_DT_GET(CHARGER_NODE); | ||
|
||
if (!device_is_ready(charger)) { | ||
LOG_ERR("Charger not ready"); | ||
return -ENODEV; | ||
} | ||
|
||
const struct charger_config *cfg = charger->config; | ||
|
||
ret = i2c_reg_update_byte_dt(&cfg->i2c, 0x5, 0xff, 0b00100100); | ||
|
||
if (ret < 0) { | ||
LOG_ERR("Failed to set charger CHARGECTRL0 register"); | ||
return ret; | ||
} | ||
LOG_INF("Set CHARGECTRL0 register"); | ||
|
||
return 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.
-1, what is this?
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.
Set input voltage treshold for on-board bq25180 charger. If not set, solar MPPT IC can't supply power efficiently.
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 needs to be handled by the driver. device's config is not meant for public access.
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 understand, we can remove it. But I just want to point out that some other boards like Actinius boards use it to set some peripherals.
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 code gets in without proper reviews from time to time. that code is not accessing any driver internals nor changing a device state (eg i2c transfers) outside of its context.
return 0; | ||
} | ||
|
||
SYS_INIT(octopus_io_board_init, POST_KERNEL, CONFIG_OCTOPUS_IO_BOARD_CONTROL_INIT_PRIORITY); |
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 board hooks?
description: | | ||
This binding is used for controlling battery charger and | ||
LDO regulator on the Octopus IO Board. | ||
compatible: "norik,power-controller" |
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 is this?
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.
Description, but since we did not supply a driver we'll be removing this for now.
zephyr,code: | ||
type: int | ||
description: Key code to emit. |
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 input subsys stuff showing up 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.
Removed as above.
peripheral-power-controller { | ||
compatible = "norik,power-controller"; | ||
|
||
pwrgpio0: pwrgpio_0 { | ||
label = "VP on/off"; | ||
gpios = <&gpio0 18 GPIO_ACTIVE_HIGH>; | ||
}; | ||
|
||
pwrgpio1: pwrgpio_1 { | ||
label = "CHG control"; | ||
gpios = <&gpio0 20 (GPIO_ACTIVE_LOW)>; | ||
}; | ||
|
||
}; |
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.
looks like these are on/off switches? why not regulator-gpio?
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.
Removed.
|
||
# Enable GPIO | ||
CONFIG_GPIO=y | ||
CONFIG_INPUT_GPIO_KEYS=n |
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.
?
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.
Accidentally left in code, removed
CONFIG_UART_CONSOLE=y | ||
|
||
# Enable charger | ||
CONFIG_CHARGER=y |
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 this required to eg boot hello world?
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, removed
Add support for Norik Systems Octopus SoM based on nRF9160 SiP. Supported features: - LTE-M/NB-IoT - GPS - LED - 3-axis accelerometer Signed-off-by: Florijan Plohl <florijan.plohl@norik.com>
Add support for Norik Systems Octopus IO-Board based on Norik Systems Octopus SoM. Supported features: - LTE-M/NB-IoT - GPS - LED - 3-axis accelerometer - Battery charger - Solar charger - SPI NOR flash - Nano SIM connector Signed-off-by: Florijan Plohl <florijan.plohl@norik.com>
Add support for Norik Octopus SoM & IO-Board. Octopus SoM is based on nRF9160, IO-board is "expander" PCB for the SoM.
Implemented fixes mentioned in boards: norik: Add support for Norik Octopus SoM & IO-Board #74239. That pull request was accidentally closed.