Skip to content
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

Forked, copied over LEC-PX30 changes, and pushing back up for PR. #23

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ BBLAYERS ?= " \
${TOPDIR}/../layers/meta-balena/meta-balena-common \
${TOPDIR}/../layers/meta-balena/meta-balena-thud \
${TOPDIR}/../layers/meta-rust \
${TOPDIR}/../layers/meta-balena-nanopc-t4 \
${TOPDIR}/../layers/meta-nanopc-t4 \
${TOPDIR}/../layers/meta-balena-lec-px30 \
${TOPDIR}/../layers/meta-lec-px30 \
"
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Supported machines
#MACHINE ?= "nanopc-t4"
#MACHINE ?= "lec-px30"

BALENA_STORAGE = "overlay2"

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
--- a/include/env_default.h
+++ b/include/env_default.h
@@ -8,7 +8,7 @@
*/

#include <env_callback.h>
-
+#include <env_resin.h>
#ifdef DEFAULT_ENV_INSTANCE_EMBEDDED
env_t embedded_environment __UBOOT_ENV_SECTION__(environment) = {
ENV_CRC, /* CRC Sum */
@@ -21,6 +21,7 @@
#else
const uchar default_environment[] = {
#endif
+ RESIN_ENV
#ifndef CONFIG_USE_DEFAULT_ENV_FILE
#ifdef CONFIG_ENV_CALLBACK_LIST_DEFAULT
ENV_CALLBACK_VAR "=" CONFIG_ENV_CALLBACK_LIST_DEFAULT "\0"
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ configuration
Upstream-Status: Inappropriate [configuration]
Signed-off-by: Florin Sarbu <[email protected]>
---
configs/nanopi4_defconfig | 1 +
configs/nanopc-t4-rk3399_defconfig | 1 +
1 file changed, 1 insertions(+)

diff --git a/configs/nanopi4_defconfig b/configs/nanopi4_defconfig
diff --git a/configs/nanopc-t4-rk3399_defconfig b/configs/nanopc-t4-rk3399_defconfig
index b298071..58e2450 100644
--- a/configs/nanopi4_defconfig
+++ b/configs/nanopi4_defconfig
--- a/configs/nanopc-t4-rk3399_defconfig
+++ b/configs/nanopc-t4-rk3399_defconfig
@@ -4,6 +4,7 @@ CONFIG_SYS_TEXT_BASE=0x00200000
CONFIG_SPL_LIBCOMMON_SUPPORT=y
CONFIG_SPL_LIBGENERIC_SUPPORT=y
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,4 @@ FILESEXTRAPATHS_append := ":${THISDIR}/files"
SRC_URI_remove = "file://resin-specific-env-integration-kconfig.patch"
SRC_URI += " \
file://0001-resin-specific-env-integration-kconfig_REWORKED.patch \
file://0002-NanoPC-T4-machine-specific-integration-of-resin-envi.patch \
"
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
include resin-image.inc

DEPENDS = "u-boot-rockchip"

RESIN_BOOT_PARTITION_FILES = " \
idbloader.bin:/ \
rkbin/trust.img:/trust.img \
Expand Down
5 changes: 5 additions & 0 deletions layers/meta-lec-px30/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
OpenEmbedded/Yocto BSP layer for FriendlyElec NanoPC-T4 board
================================================================

This layer provides support for FriendlyElec NanoPC-T4 board for
use with Yocto and OpenEmbedded.
12 changes: 12 additions & 0 deletions layers/meta-lec-px30/conf/layer.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# We have a conf and classes directory, add to BBPATH
BBPATH .= ":${LAYERDIR}"

# We have a packages directory, add to BBFILES
BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \
${LAYERDIR}/recipes-*/*/*.bbappend"

BBFILE_COLLECTIONS += "nanopc-t4"
BBFILE_PATTERN_nanopc-t4 := "^${LAYERDIR}/"
BBFILE_PRIORITY_nanopc-t4 = "6"

LAYERSERIES_COMPAT_nanopc-t4 = "thud"
24 changes: 24 additions & 0 deletions layers/meta-lec-px30/conf/machine/lec-px30.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#@TYPE: Machine
#@NAME: ADLINK LEC-PX30
#@SOC: Rockchip PX30
#@DESCRIPTION: Machine configuration for ADLINK LEC-PX30

require conf/machine/include/arm/arch-armv8.inc
require conf/machine/include/soc-family.inc
# require conf/machine/include/px30.inc

PREFERRED_PROVIDER_virtual/bootloader = "u-boot-rockchip"
PREFERRED_PROVIDER_virtual/kernel = "linux-rockchip"
PREFERRED_VERSION_linux-rockchip = "4.4.185%"

UBOOT_MACHINE = "evb-px30_defconfig"

KERNEL_IMAGETYPE = "Image"

SERIAL_CONSOLES = "1500000;ttyFIQ0"

#KBUILD_DEFCONFIG = "lec-px30_config"

KERNEL_DEVICETREE = "rockchip/px30-evb-ddr3-v10-linux.dtb"

MACHINE_ESSENTIAL_EXTRA_RDEPENDS += "kernel-devicetree rkbin-wifi"
23 changes: 23 additions & 0 deletions layers/meta-lec-px30/conf/machine/nanopc-t4.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#@TYPE: Machine
#@NAME: FriendlyElec NanoPC-T4
#@SOC: Rockchip RK3399
#@DESCRIPTION: Machine configuration for FriendlyElec NanoPC-T4

require conf/machine/include/arm/arch-armv8.inc
require conf/machine/include/soc-family.inc

PREFERRED_PROVIDER_virtual/bootloader = "u-boot-rockchip"
PREFERRED_PROVIDER_virtual/kernel = "linux-rockchip"
PREFERRED_VERSION_linux-rockchip = "4.4.179%"

UBOOT_MACHINE = "nanopi4_defconfig"

KERNEL_IMAGETYPE = "Image"

SERIAL_CONSOLES = "1500000;ttyS2"

KBUILD_DEFCONFIG = "nanopi4_linux_defconfig"

KERNEL_DEVICETREE = "rockchip/rk3399-nanopi4-rev00.dtb"

MACHINE_ESSENTIAL_EXTRA_RDEPENDS += "kernel-devicetree rkbin-wifi"
15 changes: 15 additions & 0 deletions layers/meta-lec-px30/recipes-bsp/rkbin/files/PX30TRUST.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[VERSION]
MAJOR=1
MINOR=0
[BL30_OPTION]
SEC=0
[BL31_OPTION]
SEC=1
PATH=rk33/px30_bl31_v1.14.elf
ADDR=0x00040000
[BL32_OPTION]
SEC=0
[BL33_OPTION]
SEC=0
[OUTPUT]
PATH=trust.img
15 changes: 15 additions & 0 deletions layers/meta-lec-px30/recipes-bsp/rkbin/files/RK3399TRUST.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[VERSION]
MAJOR=1
MINOR=0
[BL30_OPTION]
SEC=0
[BL31_OPTION]
SEC=1
PATH=rk33/rk3399_bl31_v1.30.elf
ADDR=0x00040000
[BL32_OPTION]
SEC=0
[BL33_OPTION]
SEC=0
[OUTPUT]
PATH=trust.img
46 changes: 46 additions & 0 deletions layers/meta-lec-px30/recipes-bsp/rkbin/rkbin_git.bb
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
inherit deploy

DESCRIPTION = "Rockchip binary tools (including WiFi/BT firmware)"

LICENSE = "BINARY"
LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=564e729dd65db6f65f911ce0cd340cf9"
NO_GENERIC_LICENSE[BINARY] = "LICENSE.TXT"

SRC_URI = " \
git://github.com/armbian/rkbin \
file://RK3399TRUST.ini \
file://PX30TRUST.ini \
"
SRCREV = "cd0c2bbc16eba65c6a996809e8026f01f7e435d2"

S = "${WORKDIR}/git"

do_configure[noexec] = "1"

do_compile() {
cp ${WORKDIR}/PX30TRUST.ini .
tools/trust_merger PX30TRUST.ini
}

do_install () {
install -d ${D}/lib/firmware/rkwifi/
cp -fr ${S}/firmware/wifi/fw_bcm4356a2_ag.bin ${D}/lib/firmware/rkwifi/
cp -fr ${S}/firmware/wifi/nvram_ap6356.txt ${D}/lib/firmware/rkwifi/
}

PACKAGES =+ " \
${PN}-wifi \
${PN}-bt \
"

FILES_${PN}-wifi = "/lib/firmware/rkwifi/*"

do_deploy () {
install -d ${DEPLOYDIR}/rkbin/tools
install -m 755 ${S}/tools/loaderimage ${DEPLOYDIR}/rkbin/tools
install -m 755 ${S}/rk33/px30_ddr_333MHz_v1.10.bin ${DEPLOYDIR}/rkbin
install -m 755 ${S}/rk33/px30_miniloader_v1.15.bin ${DEPLOYDIR}/rkbin
install -m 755 ${S}/trust.img ${DEPLOYDIR}/rkbin
}

addtask deploy before do_build after do_compile
Loading