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

Pr neutis n5 support v2.19.0+rev1 #60

Open
wants to merge 4 commits 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
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,7 @@ shared-*/
!package.json

# dynamically created by the build script
conf-notes.txt
conf-notes.txt

# Cache files
*~
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,6 @@
[submodule "layers/meta-rust"]
path = layers/meta-rust
url = https://github.com/meta-rust/meta-rust.git
[submodule "layers/meta-emlid-neutis"]
path = layers/meta-emlid-neutis
url = https://github.com/Neutis/meta-emlid-neutis.git
1 change: 1 addition & 0 deletions layers/meta-emlid-neutis
Submodule meta-emlid-neutis added at 12e3f6
2 changes: 2 additions & 0 deletions layers/meta-resin-allwinner/conf/samples/bblayers.conf.sample
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,6 @@ BBLAYERS ?= " \
${TOPDIR}/../layers/meta-resin/meta-resin-sumo \
${TOPDIR}/../layers/meta-resin-allwinner \
${TOPDIR}/../layers/meta-rust \
${TOPDIR}/../layers/meta-emlid-neutis/meta-neutis-bsp \
${TOPDIR}/../layers/meta-emlid-neutis/meta-neutis-distro \
"
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
From e146913072472dfaa964f11a48a36b6e03709a43 Mon Sep 17 00:00:00 2001
From: Aleksandr Aleksandrov <[email protected]>
Date: Thu, 11 Oct 2018 11:45:32 +0300
Subject: [PATCH] Integrate machine independent resin environment configuration

This patch integrates resin default environment configuration in an u-boot which
has a version with Kconfig support.

Copied from meta-resin/meta-resin-common/recipes-bsp/u-boot/patches/resin-specific-env-integration-kconfig.patch

Signed-off-by: Aleksandr Aleksandrov <[email protected]>
---
include/env_default.h | 3 +++
1 file changed, 3 insertions(+)

diff --git a/include/env_default.h b/include/env_default.h
index 54d8124..5632ec9 100644
--- a/include/env_default.h
+++ b/include/env_default.h
@@ -9,6 +9,8 @@

#include <env_callback.h>

+#include <env_resin.h>
+
#ifdef DEFAULT_ENV_INSTANCE_EMBEDDED
env_t environment __UBOOT_ENV_SECTION__(environment) = {
ENV_CRC, /* CRC Sum */
@@ -21,6 +23,7 @@ static char default_environment[] = {
#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"
--
2.7.4

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Copied from meta-resin-allwinner/recipes-bsp/u-boot/files/0001-Add-Resin-specific-boot-command.patch

setenv resin_kernel_load_addr ${kernel_addr_r};
run resin_set_kernel_root;
setenv bootargs ${resin_kernel_root} rootfstype=ext4 rootwait console=$console;
fatload ${resin_dev_type} ${resin_dev_index}:${resin_boot_part} ${resin_kernel_load_addr} Image;
fatload ${resin_dev_type} ${resin_dev_index}:${resin_boot_part} ${fdt_addr_r} dtb/${fdtfile};
booti ${resin_kernel_load_addr} - ${fdt_addr_r}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why can't this be patched like for other boards? What is the problem with 64 bits u-boot?
Just as a side note, here's how we do it for other boards. https://github.com/balena-os/resin-artik710/blob/master/layers/meta-resin-artik710/recipes-bsp/u-boot/patches/0007-artik710_raptor.h-Board-specific-integration-with-re.patch (this also happens to be 64 bits)

Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
UBOOT_KCONFIG_SUPPORT = "1"

inherit resin-u-boot

FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
FILESEXTRAPATHS_prepend_neutis-n5 := "${THISDIR}/u-boot-neutis:"

INTEGRATION_KCONFIG_PATCH = "file://resin-specific-env-integration-kconfig-2018_07.patch"

39 changes: 39 additions & 0 deletions layers/meta-resin-allwinner/recipes-core/images/resin-image.inc
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,42 @@ IMAGE_CMD_resinos-img_append_nanopi-neo-air () {
# nanopi-neo-air needs uboot written at a specific location
dd if=${DEPLOY_DIR_IMAGE}/u-boot-sunxi-with-spl.bin of=${RESIN_RAW_IMG} conv=notrunc seek=8 bs=1024
}

#
# Emlid Neutis N5
#

IMAGE_FSTYPES_append_neutis-n5 = " resinos-img"

# Customize resinos-img
RESIN_IMAGE_BOOTLOADER_neutis-n5 = "u-boot"
RESIN_BOOT_PARTITION_FILES_neutis-n5 = " \
${KERNEL_IMAGETYPE}${KERNEL_INITRAMFS}-${MACHINE}.bin:/${KERNEL_IMAGETYPE} \
Image-sun50i-h5-emlid-neutis-n5-devboard.dtb:/dtb/allwinner/sun50i-h5-emlid-neutis-n5-devboard.dtb \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you amend the previous commit in which you introduced the copying of the overlays so that you do this change directly in that commit?

Image-sun50i-h5-emlid-neutis-n5.dtb:/dtb/allwinner/sun50i-h5-emlid-neutis-n5.dtb \
Image-sun50i-h5-analog-codec.dtbo:/dtb/allwinner/overlay/sun50i-h5-analog-codec.dtbo \
Image-sun50i-h5-cir.dtbo:/dtb/allwinner/overlay/sun50i-h5-cir.dtbo \
Image-sun50i-h5-ethernet-100.dtbo:/dtb/allwinner/overlay/sun50i-h5-ethernet-100.dtbo \
Image-sun50i-h5-spi0-status-okay.dtbo:/dtb/allwinner/overlay/sun50i-h5-spi0-status-okay.dtbo \
Image-sun50i-h5-spi1-status-okay.dtbo:/dtb/allwinner/overlay/sun50i-h5-spi1-status-okay.dtbo \
Image-sun50i-h5-uart1.dtbo:/dtb/allwinner/overlay/sun50i-h5-uart1.dtbo \
Image-sun50i-h5-uart2.dtbo:/dtb/allwinner/overlay/sun50i-h5-uart2.dtbo \
Image-sun50i-h5-uart3.dtbo:/dtb/allwinner/overlay/sun50i-h5-uart3.dtbo \
Image-sun50i-h5-r-uart.dtbo:/dtb/allwinner/overlay/sun50i-h5-r-uart.dtbo \
Image-sun50i-h5-i2c0.dtbo:/dtb/allwinner/overlay/sun50i-h5-i2c0.dtbo \
Image-sun50i-h5-i2c1.dtbo:/dtb/allwinner/overlay/sun50i-h5-i2c1.dtbo \
Image-sun50i-h5-i2c2.dtbo:/dtb/allwinner/overlay/sun50i-h5-i2c2.dtbo \
Image-sun50i-h5-r-i2c.dtbo:/dtb/allwinner/overlay/sun50i-h5-r-i2c.dtbo \
Image-sun50i-h5-usbhost0.dtbo:/dtb/allwinner/overlay/sun50i-h5-usbhost0.dtbo \
Image-sun50i-h5-usbhost1.dtbo:/dtb/allwinner/overlay/sun50i-h5-usbhost1.dtbo \
Image-sun50i-h5-usbhost2.dtbo:/dtb/allwinner/overlay/sun50i-h5-usbhost2.dtbo \
Image-sun50i-h5-usbhost3.dtbo:/dtb/allwinner/overlay/sun50i-h5-usbhost3.dtbo \
Image-sun50i-h5-hdmi.dtbo:/dtb/allwinner/overlay/sun50i-h5-hdmi.dtbo \
Image-sun50i-h5-camera-status-okay.dtbo:/dtb/allwinner/overlay/sun50i-h5-camera-status-okay.dtbo \
Env.txt:/Env.txt \
boot.scr:/boot.scr \
"

IMAGE_CMD_resinos-img_append_neutis-n5 () {
dd if=${DEPLOY_DIR_IMAGE}/u-boot-sunxi-with-spl.bin of=${RESIN_RAW_IMG} conv=notrunc seek=8 bs=1024
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#AP6212_NVRAM_V1.0_20140603
# 2.4 GHz, 20 MHz BW mode

# The following parameter values are just placeholders, need to be updated.
manfid=0x2d0
prodid=0x0726
vendid=0x14e4
devid=0x43e2
boardtype=0x0726
boardrev=0x1101
boardnum=22
macaddr=00:90:4c:c5:12:38
sromrev=11
boardflags=0x00404201
xtalfreq=26000
nocrc=1
ag0=255
aa2g=1
ccode=ALL

pa0itssit=0x20
extpagain2g=0

#PA parameters for 2.4GHz, measured at CHIP OUTPUT
pa2ga0=-168,7161,-820
AvVmid_c0=0x0,0xc8
cckpwroffset0=5

# PPR params
maxp2ga0=90
txpwrbckof=6
cckbw202gpo=0x5555
legofdmbw202gpo=0x77777777
mcsbw202gpo=0xaaaaaaaa

# OFDM IIR :
ofdmdigfilttype=7
# PAPD mode:
papdmode=2

il0macaddr=00:90:4c:c5:12:38
wl0id=0x431b

#OOB parameters
hostwake=0x40
hostrdy=0x41
usbrdy=0x03
usbrdydelay=100
deadman_to=0xffffffff
# muxenab: 0x1 for UART enable, 0x10 for Host awake
muxenab=0x10
# CLDO PWM voltage settings - 0x4 - 1.1 volt
#cldo_pwm=0x4

Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ SRC_URI_append = " \
file://bcm43438-sdio.hcd \
file://brcmfmac43430a0-sdio.bin \
file://brcmfmac43430a0-sdio.txt \
file://brcmfmac43430a1-sdio.bin \
file://brcmfmac43430a1-sdio.txt \
file://config.txt \
file://brcmfmac43362-sdio.txt \
file://brcmfmac43430-sdio.txt \
Expand All @@ -18,6 +20,8 @@ do_install_append() {
cp ${WORKDIR}/bcm43438-sdio.hcd ${D}/lib/firmware/brcm/bcm43438-sdio.hcd
cp ${WORKDIR}/brcmfmac43430a0-sdio.bin ${D}/lib/firmware/brcm/brcmfmac43430a0-sdio.bin
cp ${WORKDIR}/brcmfmac43430a0-sdio.txt ${D}/lib/firmware/brcm/brcmfmac43430a0-sdio.txt
cp ${WORKDIR}/brcmfmac43430a1-sdio.bin ${D}/lib/firmware/brcm/brcmfmac43430-sdio.bin
cp ${WORKDIR}/brcmfmac43430a1-sdio.txt ${D}/lib/firmware/brcm/brcmfmac43430-sdio.txt
cp ${WORKDIR}/config.txt ${D}/lib/firmware/brcm/config.txt
cp ${S}/brcm/brcmfmac43362-sdio.bin ${D}/lib/firmware/brcm/
cp ${WORKDIR}/brcmfmac43362-sdio.txt ${D}/lib/firmware/brcm/
Expand All @@ -36,6 +40,8 @@ FILES_${PN}-ap6212 = " \
/lib/firmware/brcm/bcm43438-sdio.hcd \
/lib/firmware/brcm/brcmfmac43430a0-sdio.bin \
/lib/firmware/brcm/brcmfmac43430a0-sdio.txt \
/lib/firmware/brcm/brcmfmac43430-sdio.bin \
/lib/firmware/brcm/brcmfmac43430-sdio.txt \
/lib/firmware/brcm/config.txt \
"

Expand Down
Loading