ef32-boot-config: move the package to feed-prplos

We've the same Silabs EFR32MG21 MCU on both Fast Track reference
platforms (OSPv2 and Freedom), being wired to the SoC in the similar way
(GPIO pins).

In the default configuration the nReset PIN on EFR32MG21 is being held
down by the SoC GPIO pin (usually low by default), so the EFR32MG21 is
being held in the reset state, thus making the MCU unavailable to the
system/application.

On Freedom we've efr32-boot-config package providing init script, which
puts EFR32MG21 MCU out of the reset state, disables the recovery
functionality and thus boot the MCU into application firmware.

On OSPv2 we're currently missing this functionality and the plan is to
reuse the common bits and share the package in the generic fashion.

So it was decided, that the package should be moved to feed-prplos.

Link: https://gitlab.com/prpl-foundation/prplos/feeds/feed-prplos/-/merge_requests/127
References: PCF-1297
Signed-off-by: Petr Štetiar <petr.stetiar@prplfoundation.org>
This commit is contained in:
Petr Štetiar
2025-06-02 13:37:41 +00:00
parent c0d0ebd439
commit b66cd8e168
2 changed files with 0 additions and 89 deletions

View File

@@ -1,29 +0,0 @@
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/version.mk
PKG_NAME:=efr32-boot-config
PKG_RELEASE:=1
PKG_FLAGS:=nonshared
include $(INCLUDE_DIR)/package.mk
define Build/Prepare
mkdir -p $(PKG_BUILD_DIR)
endef
define Build/Compile
endef
define Package/efr32-boot-config
TITLE:=Bootmode configuration for EFR32
CATEGORY:=prpl Foundation
SUBMENU:=Utilities
DEPENDS:=@TARGET_ipq95xx_generic_DEVICE_prpl_freedom
endef
define Package/efr32-boot-config/install
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/efr32-boot-config.init $(1)/etc/init.d/efr32-boot-config
endef
$(eval $(call BuildPackage,efr32-boot-config))

View File

@@ -1,60 +0,0 @@
#!/bin/sh /etc/rc.common
START=80
extra_command "enter_application" "Switches EFR32 into application mode"
extra_command "enter_bootloader" "Switches EFR32 into bootloader mode"
efr32_gpio_reset=437 # EFR32 RESETn pin connected to P05 pin on TCA6416 GPIO expander
efr32_gpio_fwupgrade=468 # EFR32 PC04 pin connected to IPQ GPIO pin 21
gpio_init() {
echo $efr32_gpio_reset > /sys/class/gpio/export
echo $efr32_gpio_fwupgrade > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio${efr32_gpio_reset}/direction
echo out > /sys/class/gpio/gpio${efr32_gpio_fwupgrade}/direction
}
gpio_deinit() {
echo $efr32_gpio_reset > /sys/class/gpio/unexport
echo $efr32_gpio_fwupgrade > /sys/class/gpio/unexport
}
enter_application() {
gpio_init
# GPIO 437 is set to 0 to reset the EFR32MG
echo 0 > /sys/class/gpio/gpio${efr32_gpio_reset}/value
# GPIO 468 is set to 1 to indicate entering the application (not bootloader)
echo 1 > /sys/class/gpio/gpio${efr32_gpio_fwupgrade}/value
sleep .01
# Set GPIO 437 back to 1 to complete the reset process
echo 1 > /sys/class/gpio/gpio${efr32_gpio_reset}/value
gpio_deinit
}
enter_bootloader() {
gpio_init
# GPIO 437 is set to 0 to reset the EFR32MG
echo 0 > /sys/class/gpio/gpio${efr32_gpio_reset}/value
# GPIO 468 is set to 0 to indicate entering the bootloader
echo 0 > /sys/class/gpio/gpio${efr32_gpio_fwupgrade}/value
sleep .01
# Set GPIO 437 back to 1 to complete the reset process
echo 1 > /sys/class/gpio/gpio${efr32_gpio_reset}/value
gpio_deinit
}
boot() {
enter_application
}