diff --git a/.circleci/config.yml b/.circleci/config.yml index d63027d..3fac72b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,12 +1,12 @@ exec: &exec name: build-tools/nerves-system-br - version: 1.14.4 - elixir: 1.11.3-otp-23 + version: 1.16.3 + elixir: 1.12.2-otp-24 version: 2.1 orbs: - build-tools: nerves-project/build-tools@0.1.2 + build-tools: nerves-project/build-tools@0.1.4 workflows: version: 2 diff --git a/CHANGELOG.md b/CHANGELOG.md index 4576b90..9833e34 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,29 @@ # Changelog +## v0.3.0 + +This version bumps the toolchain to v1.4.3 which includes updates to GCC 10. + +* Dependencies + * [linux](https://github.com/linux4sam/linux-at91/releases/tag/linux4sam-2021.04) + * [nerves_system_br: v1.16.3](https://github.com/nerves-project/nerves_system_br/releases/tag/v1.16.3) + * [Erlang/OTP 24.0.4](https://erlang.org/download/OTP-24.0.4.README) + +## v0.2.0 + +The device tree and linux kernel are now loaded from the squashfs root file +system. + +* Bug fixes + * `wlan0` could encouter an error indicated by the error `cfg_indicate_rx: Receive unknown message` + when transferring firmware or large file streams. The SDIO interface speed was reduced from + 50Mhz to 48Mhz. + +* Dependencies + * [nerves_system_br: v1.14.0](https://github.com/nerves-project/nerves_system_br/releases/tag/v1.14.4) + * [Erlang/OTP 23.2.4](https://erlang.org/download/OTP-23.2.4.README) + + ## v0.1.0 Initial release diff --git a/README.md b/README.md index af5ddea..8abcc35 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,17 @@ by loading the kernel module. iex> System.cmd("modprobe", ["wilc-sdio"]) ``` +# Ethernet + +A unique hardware address for the eth0 interface is programmed into the QSPI +flash memory from the factory and is read set by U-Boot. Inorder to read from +the flash memory, you will need to ensure the QSPI flash is being powered by +removing the shunt from jumper J8 labeled "Disable Boot". + +The hardware address of the interface can also be forced by setting the U-Boot +environment variable `ethaddr`. If neither of these locations are accessible, +Linux will assign a random hardware address to the interface on every boot. + # Supported USB WiFi Devices The base image includes drivers and firmware for Ralink RT53xx (rt2800usb diff --git a/VERSION b/VERSION index 6e8bf73..0d91a54 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.1.0 +0.3.0 diff --git a/fwup.conf b/fwup.conf index 6334fa1..1cd7c9e 100644 --- a/fwup.conf +++ b/fwup.conf @@ -41,8 +41,6 @@ define(ROOTFS, "${NERVES_SYSTEM}/images/rootfs.squashfs") # +----------------------------+ # | p0: Boot partition (FAT32) | # | u-boot.img | -# | zImage.a | -# | zImage.b | # +----------------------------+ # | p1: Rootfs A (squashfs) | # +----------------------------+ @@ -94,12 +92,6 @@ file-resource u-boot.bin { file-resource uboot-env.bin { host-path = "${NERVES_SYSTEM}/images/uboot-env.bin" } -file-resource zImage { - host-path = "${NERVES_SYSTEM}/images/zImage" -} -file-resource at91-sama5d27_wlsom1_ek.dtb { - host-path = "${NERVES_SYSTEM}/images/at91-sama5d27_wlsom1_ek.dtb" -} file-resource rootfs.img { host-path = ${ROOTFS} @@ -108,7 +100,7 @@ file-resource rootfs.img { } mbr mbr { - bootstrap-code-host-path = "${NERVES_SYSTEM}/images/sama5d27_wlsom1_ek-sdcardboot-uboot-3.9.3.bin" + bootstrap-code-host-path = "${NERVES_SYSTEM}/images/sama5d27_wlsom1_ek-sdcardboot-uboot-4.0.0.bin" partition 0 { block-offset = ${BOOT_PART_OFFSET} block-count = ${BOOT_PART_COUNT} @@ -151,14 +143,10 @@ task complete { fat_mkfs(${BOOT_PART_OFFSET}, ${BOOT_PART_COUNT}) fat_setlabel(${BOOT_PART_OFFSET}, "BOOT") - fat_mkdir(${BOOT_PART_OFFSET}, "overlays") - fat_mkdir(${BOOT_PART_OFFSET}, "dtbs") } on-resource boot.bin { fat_write(${BOOT_PART_OFFSET}, "boot.bin") } on-resource u-boot.bin { fat_write(${BOOT_PART_OFFSET}, "u-boot.bin") } - on-resource at91-sama5d27_wlsom1_ek.dtb { fat_write(${BOOT_PART_OFFSET}, "dtbs/at91-sama5d27_wlsom1_ek.dtb") } - on-resource zImage { fat_write(${BOOT_PART_OFFSET}, "zImage.a") } on-resource uboot-env.bin { # Boot to the A partition first and don't fail back. @@ -229,7 +217,6 @@ task upgrade.a { trim(${ROOTFS_A_PART_OFFSET}, ${ROOTFS_A_PART_COUNT}) } - on-resource zImage { fat_write(${BOOT_PART_OFFSET}, "zImage.a") } on-resource rootfs.img { raw_write(${ROOTFS_A_PART_OFFSET}) } on-finish { @@ -280,7 +267,6 @@ task upgrade.b { trim(${ROOTFS_B_PART_OFFSET}, ${ROOTFS_B_PART_COUNT}) } - on-resource zImage { fat_write(${BOOT_PART_OFFSET}, "zImage.b") } on-resource rootfs.img { raw_write(${ROOTFS_B_PART_OFFSET}) } on-finish { diff --git a/linux/0001-limit-speed-of-sdmmc1-to-48Mhz.patch b/linux/0001-limit-speed-of-sdmmc1-to-48Mhz.patch new file mode 100644 index 0000000..68499c4 --- /dev/null +++ b/linux/0001-limit-speed-of-sdmmc1-to-48Mhz.patch @@ -0,0 +1,35 @@ +From f87ac6fa4a14fb9202232ee1c26ae797d1304f91 Mon Sep 17 00:00:00 2001 +From: Justin Schneck +Date: Sat, 20 Feb 2021 17:41:28 -0500 +Subject: [PATCH] limit speed of sdmmc1 to 48Mhz + +The WILC3000 seems to struggle with transferring large +files when operating at max speed at 50Mhz. The driver +would stop working and result in an error message + +cfg_indicate_rx: Receive unknown message + +After this message the wifi no longer functions. +--- + arch/arm/boot/dts/at91-sama5d27_wlsom1_ek.dts | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/arch/arm/boot/dts/at91-sama5d27_wlsom1_ek.dts b/arch/arm/boot/dts/at91-sama5d27_wlsom1_ek.dts +index 56645bf6f..ae6328a3e 100644 +--- a/arch/arm/boot/dts/at91-sama5d27_wlsom1_ek.dts ++++ b/arch/arm/boot/dts/at91-sama5d27_wlsom1_ek.dts +@@ -216,6 +216,11 @@ + status = "okay"; + }; + ++&sdmmc1 { ++ max-frequency=<4800000>; ++ status = "okay"; ++}; ++ + &shutdown_controller { + atmel,shdwc-debouncer = <976>; + atmel,wakeup-rtc-timer; +-- +2.25.1 + diff --git a/linux/linux-5.4.defconfig b/linux/linux-5.4.defconfig index e373607..39f7806 100644 --- a/linux/linux-5.4.defconfig +++ b/linux/linux-5.4.defconfig @@ -5,6 +5,7 @@ CONFIG_NO_HZ_IDLE=y CONFIG_HIGH_RES_TIMERS=y CONFIG_LOG_BUF_SHIFT=14 CONFIG_CGROUPS=y +CONFIG_NAMESPACES=y CONFIG_BLK_DEV_INITRD=y CONFIG_EMBEDDED=y CONFIG_SLAB=y @@ -13,8 +14,6 @@ CONFIG_SOC_SAMA5D2=y CONFIG_SOC_SAMA5D3=y CONFIG_SOC_SAMA5D4=y CONFIG_UACCESS_WITH_MEMCPY=y -CONFIG_ZBOOT_ROM_TEXT=0x0 -CONFIG_ZBOOT_ROM_BSS=0x0 CONFIG_ARM_APPENDED_DTB=y CONFIG_CMDLINE="console=ttyS0,115200 initrd=0x21100000,25165824 root=/dev/ram0 rw" CONFIG_KEXEC=y @@ -42,15 +41,6 @@ CONFIG_IP_PNP_BOOTP=y CONFIG_IP_PNP_RARP=y # CONFIG_INET_DIAG is not set CONFIG_IPV6_SIT_6RD=y -CONFIG_NETFILTER=y -CONFIG_BRIDGE=m -CONFIG_NET_SCHED=y -CONFIG_NET_EMATCH=y -CONFIG_NET_CLS_ACT=y -CONFIG_DCB=y -CONFIG_NET_L3_MASTER_DEV=y -CONFIG_CGROUP_NET_PRIO=y -CONFIG_BPF_JIT=y CONFIG_CAN=y CONFIG_CAN_AT91=y CONFIG_CAN_M_CAN=y @@ -74,7 +64,6 @@ CONFIG_BLK_DEV_LOOP=y CONFIG_BLK_DEV_RAM=y CONFIG_BLK_DEV_RAM_COUNT=4 CONFIG_BLK_DEV_RAM_SIZE=8192 -CONFIG_ATMEL_TCLIB=y CONFIG_ATMEL_SSC=y CONFIG_EEPROM_AT24=y CONFIG_SCSI=y @@ -88,18 +77,20 @@ CONFIG_MACB=y # CONFIG_NET_VENDOR_INTEL is not set # CONFIG_NET_VENDOR_MARVELL is not set # CONFIG_NET_VENDOR_MICREL is not set -# CONFIG_NET_VENDOR_MICROCHIP is not set +CONFIG_ENC28J60=m # CONFIG_NET_VENDOR_NATSEMI is not set # CONFIG_NET_VENDOR_SEEQ is not set # CONFIG_NET_VENDOR_SMSC is not set # CONFIG_NET_VENDOR_STMICRO is not set -# CONFIG_NET_VENDOR_WIZNET is not set +CONFIG_WIZNET_W5100=m +CONFIG_WIZNET_W5100_SPI=m CONFIG_MICREL_PHY=y CONFIG_LIBERTAS_THINFIRM=m CONFIG_LIBERTAS_THINFIRM_USB=m CONFIG_MWIFIEX=m CONFIG_MWIFIEX_SDIO=m CONFIG_MWIFIEX_USB=m +CONFIG_WILC_SDIO=m CONFIG_RT2X00=m CONFIG_RT2500USB=m CONFIG_RT73USB=m @@ -127,6 +118,7 @@ CONFIG_I2C_GPIO=y CONFIG_SPI=y CONFIG_SPI_ATMEL=y CONFIG_SPI_GPIO=y +CONFIG_SPI_SPIDEV=y CONFIG_GPIO_SYSFS=y CONFIG_POWER_RESET=y CONFIG_POWER_SUPPLY=y @@ -144,7 +136,6 @@ CONFIG_REGULATOR_ACT8865=y CONFIG_REGULATOR_ACT8945A=y CONFIG_REGULATOR_PWM=m CONFIG_MEDIA_SUPPORT=y -CONFIG_MEDIA_CAMERA_SUPPORT=y CONFIG_V4L_PLATFORM_DRIVERS=y CONFIG_VIDEO_ATMEL_ISI=y CONFIG_DRM=y @@ -152,7 +143,6 @@ CONFIG_DRM_ATMEL_HLCDC=y CONFIG_DRM_PANEL_SIMPLE=y CONFIG_LCD_CLASS_DEVICE=y CONFIG_BACKLIGHT_CLASS_DEVICE=y -# CONFIG_BACKLIGHT_GENERIC is not set CONFIG_BACKLIGHT_PWM=y CONFIG_FRAMEBUFFER_CONSOLE=y CONFIG_SOUND=y @@ -166,6 +156,7 @@ CONFIG_SND_ATMEL_SOC_I2S=y # CONFIG_HID_GENERIC is not set CONFIG_USB=y CONFIG_USB_ANNOUNCE_NEW_DEVICES=y +CONFIG_USB_OTG=y CONFIG_USB_EHCI_HCD=y CONFIG_USB_OHCI_HCD=y CONFIG_USB_ACM=y @@ -176,7 +167,7 @@ CONFIG_USB_SERIAL_FTDI_SIO=y CONFIG_USB_SERIAL_PL2303=y CONFIG_USB_GADGET=y CONFIG_USB_ATMEL_USBA=y -CONFIG_USB_G_SERIAL=y +CONFIG_USB_ETH=y CONFIG_MMC=y CONFIG_MMC_SDHCI=y CONFIG_MMC_SDHCI_PLTFM=y @@ -195,7 +186,9 @@ CONFIG_DMADEVICES=y CONFIG_AT_HDMAC=y CONFIG_AT_XDMAC=y CONFIG_STAGING=y -CONFIG_WILC_SDIO=m +CONFIG_FB_TFT=m +CONFIG_FB_TFT_HX8357D=m +CONFIG_FB_TFT_ILI9341=m # CONFIG_IOMMU_SUPPORT is not set CONFIG_IIO=y CONFIG_AT91_ADC=y @@ -210,12 +203,12 @@ CONFIG_PWM_ATMEL_TCB=y CONFIG_EXT4_FS=y CONFIG_F2FS_FS=y CONFIG_FANOTIFY=y +CONFIG_AUTOFS_FS=m CONFIG_VFAT_FS=y CONFIG_TMPFS=y CONFIG_UBIFS_FS=y CONFIG_UBIFS_FS_ADVANCED_COMPR=y CONFIG_SQUASHFS=y -CONFIG_SQUASHFS_FILE_DIRECT=y CONFIG_NFS_FS=y CONFIG_ROOT_NFS=y CONFIG_NLS_CODEPAGE_437=y @@ -227,6 +220,11 @@ CONFIG_CRYPTO_USER_API_SKCIPHER=m CONFIG_CRYPTO_DEV_ATMEL_AES=y CONFIG_CRYPTO_DEV_ATMEL_TDES=y CONFIG_CRYPTO_DEV_ATMEL_SHA=y +CONFIG_CRC_ITU_T=y +CONFIG_CRC7=y +CONFIG_CONSOLE_LOGLEVEL_DEFAULT=3 +CONFIG_CONSOLE_LOGLEVEL_QUIET=3 +CONFIG_MESSAGE_LOGLEVEL_DEFAULT=3 CONFIG_STRIP_ASM_SYMS=y CONFIG_DEBUG_FS=y CONFIG_DEBUG_MEMORY_INIT=y diff --git a/mix.exs b/mix.exs index 4b0ae5a..6d26f7b 100644 --- a/mix.exs +++ b/mix.exs @@ -50,8 +50,8 @@ defmodule NervesSystemSAMA5D27WLSOM1EK.MixProject do defp deps do [ {:nerves, "~> 1.5.4 or ~> 1.6.0 or ~> 1.7.0", runtime: false}, - {:nerves_system_br, "1.14.4", runtime: false}, - {:nerves_toolchain_armv7_nerves_linux_gnueabihf, "~> 1.4.0", runtime: false}, + {:nerves_system_br, "1.16.3", runtime: false}, + {:nerves_toolchain_armv7_nerves_linux_gnueabihf, "1.4.3", runtime: false}, {:nerves_system_linter, "~> 0.4", runtime: false}, {:ex_doc, "~> 0.18", only: [:dev, :test], runtime: false} ] diff --git a/mix.lock b/mix.lock index 31d964f..e11cfbf 100644 --- a/mix.lock +++ b/mix.lock @@ -1,16 +1,17 @@ %{ "distillery": {:hex, :distillery, "1.4.1", "546d851bf27ae8fe0727e10e4fc4e146ad836eecee138263a60431e688044ed3", [:mix], [], "hexpm"}, "earmark": {:hex, :earmark, "1.4.10", "bddce5e8ea37712a5bfb01541be8ba57d3b171d3fa4f80a0be9bcf1db417bcaf", [:mix], [{:earmark_parser, ">= 1.4.10", [hex: :earmark_parser, repo: "hexpm", optional: false]}], "hexpm", "12dbfa80810478e521d3ffb941ad9fbfcbbd7debe94e1341b4c4a1b2411c1c27"}, - "earmark_parser": {:hex, :earmark_parser, "1.4.12", "b245e875ec0a311a342320da0551da407d9d2b65d98f7a9597ae078615af3449", [:mix], [], "hexpm", "711e2cc4d64abb7d566d43f54b78f7dc129308a63bc103fbd88550d2174b3160"}, + "earmark_parser": {:hex, :earmark_parser, "1.4.13", "0c98163e7d04a15feb62000e1a891489feb29f3d10cb57d4f845c405852bbef8", [:mix], [], "hexpm", "d602c26af3a0af43d2f2645613f65841657ad6efc9f0e361c3b6c06b578214ba"}, "elixir_make": {:hex, :elixir_make, "0.6.2", "7dffacd77dec4c37b39af867cedaabb0b59f6a871f89722c25b28fcd4bd70530", [:mix], [], "hexpm", "03e49eadda22526a7e5279d53321d1cced6552f344ba4e03e619063de75348d9"}, - "ex_doc": {:hex, :ex_doc, "0.23.0", "a069bc9b0bf8efe323ecde8c0d62afc13d308b1fa3d228b65bca5cf8703a529d", [:mix], [{:earmark_parser, "~> 1.4.0", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.14", [hex: :makeup_elixir, repo: "hexpm", optional: false]}], "hexpm", "f5e2c4702468b2fd11b10d39416ddadd2fcdd173ba2a0285ebd92c39827a5a16"}, + "ex_doc": {:hex, :ex_doc, "0.25.1", "4b736fa38dc76488a937e5ef2944f5474f3eff921de771b25371345a8dc810bc", [:mix], [{:earmark_parser, "~> 1.4.0", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.14", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1", [hex: :makeup_erlang, repo: "hexpm", optional: false]}], "hexpm", "3200b0a69ddb2028365281fbef3753ea9e728683863d8cdaa96580925c891f67"}, "makeup": {:hex, :makeup, "1.0.5", "d5a830bc42c9800ce07dd97fa94669dfb93d3bf5fcf6ea7a0c67b2e0e4a7f26c", [:mix], [{:nimble_parsec, "~> 0.5 or ~> 1.0", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "cfa158c02d3f5c0c665d0af11512fed3fba0144cf1aadee0f2ce17747fba2ca9"}, "makeup_elixir": {:hex, :makeup_elixir, "0.15.1", "b5888c880d17d1cc3e598f05cdb5b5a91b7b17ac4eaf5f297cb697663a1094dd", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.1", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "db68c173234b07ab2a07f645a5acdc117b9f99d69ebf521821d89690ae6c6ec8"}, - "nerves": {:hex, :nerves, "1.7.4", "6dc9c9c79baf9af540e34638e2fd964700f68f8dcece7cad26048c3a89ef6788", [:make, :mix], [{:elixir_make, "~> 0.6", [hex: :elixir_make, repo: "hexpm", optional: false]}, {:jason, "~> 1.2", [hex: :jason, repo: "hexpm", optional: true]}], "hexpm", "ac99ab1aa27ace81fd6d49e311697e8027b5c34b00728523e0721a8e2f4414eb"}, - "nerves_system_br": {:hex, :nerves_system_br, "1.14.4", "cfab33432035f4ad92202a53d9067a02034d02144f7b33419e2636ef8feb4c3a", [:mix], [], "hexpm", "c04df862d040b9233a4c45e9f58633c70b70a43baf9c68eb983e41819eb95911"}, + "makeup_erlang": {:hex, :makeup_erlang, "0.1.1", "3fcb7f09eb9d98dc4d208f49cc955a34218fc41ff6b84df7c75b3e6e533cc65f", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "174d0809e98a4ef0b3309256cbf97101c6ec01c4ab0b23e926a9e17df2077cbb"}, + "nerves": {:hex, :nerves, "1.7.10", "6a28a69bd671c708615e0b3caded2efaf7159679e3568d0a4eb3acb73ab2c6aa", [:make, :mix], [{:elixir_make, "~> 0.6", [hex: :elixir_make, repo: "hexpm", optional: false]}, {:jason, "~> 1.2", [hex: :jason, repo: "hexpm", optional: true]}], "hexpm", "2137d3eaaf8ce0db9189eec26e7ee8d24183a680bc270c812d14d4e8c1a305a7"}, + "nerves_system_br": {:hex, :nerves_system_br, "1.16.3", "d0a901a313e642d4024aa77f173c1e115eca82813dd6e592037ee5eadf5f58aa", [:mix], [], "hexpm", "20968db0d4e311159f387c0909d412b8ae715d669111954c1b448eec10ff64b9"}, "nerves_system_linter": {:hex, :nerves_system_linter, "0.4.0", "81e9a6f5018fe5fb67d7b43a04dca36156f62b55b5554eb2fa3964d3889d09cd", [:mix], [], "hexpm", "b5bd8480ce7a6317f4601ff41fd2f594bdf76aff0bdf6dcfac571c3fa1ec5f82"}, "nerves_toolchain_arm_unknown_linux_gnueabihf": {:hex, :nerves_toolchain_arm_unknown_linux_gnueabihf, "1.3.2", "c1adf1c067f46810a678946506f379b8d1694b154fcbc77b1de5fda97494fbfc", [:mix], [{:nerves, "~> 1.0", [hex: :nerves, repo: "hexpm", optional: false]}, {:nerves_toolchain_ctng, "~> 1.7.2", [hex: :nerves_toolchain_ctng, repo: "hexpm", optional: false]}], "hexpm", "0200515efb0ddd6a2318234c7084f7cdb8691fbb83c47def527558b4921f3a3a"}, - "nerves_toolchain_armv7_nerves_linux_gnueabihf": {:hex, :nerves_toolchain_armv7_nerves_linux_gnueabihf, "1.4.1", "bd3e3ae08727294c01456f0c6fa55ee11c67ed001bda71e817d3e5f960efd074", [:mix], [{:nerves, "~> 1.0", [hex: :nerves, repo: "hexpm", optional: false]}, {:nerves_toolchain_ctng, "~> 1.8.1", [hex: :nerves_toolchain_ctng, repo: "hexpm", optional: false]}], "hexpm", "fdf4cd7b30d7d4aa49ee997c9bfc5fc4a34951850d18be41d854bf3889a0c749"}, - "nerves_toolchain_ctng": {:hex, :nerves_toolchain_ctng, "1.8.2", "66163f4fb90aa40cabae5700e516fdf40708d260334c4674514413d7cb585dbb", [:mix], [{:nerves, "~> 1.0", [hex: :nerves, repo: "hexpm", optional: false]}], "hexpm", "9734237608269d2d649cc67ebb7bcb605bb122259a7cea17dadcf8204f467638"}, + "nerves_toolchain_armv7_nerves_linux_gnueabihf": {:hex, :nerves_toolchain_armv7_nerves_linux_gnueabihf, "1.4.3", "ff5b8fed2a71daea7ac07a5a0a6ecec7a4985d2a617a89ab073591d441d9cda4", [:mix], [{:nerves, "~> 1.0", [hex: :nerves, repo: "hexpm", optional: false]}, {:nerves_toolchain_ctng, "~> 1.8.4", [hex: :nerves_toolchain_ctng, repo: "hexpm", optional: false]}], "hexpm", "ffefca61b7282a5a10032e61b6dab6758d24eee732c5d8c16fe6aada52dd099a"}, + "nerves_toolchain_ctng": {:hex, :nerves_toolchain_ctng, "1.8.4", "2f6b4153e3904502d117f9d957c12eaafd490e1d2bdf20a85328ada46a1350da", [:mix], [{:nerves, "~> 1.0", [hex: :nerves, repo: "hexpm", optional: false]}], "hexpm", "6194be9b1364fdc1db6b2a0e98fa8dcb94fe1af373dcf8149298d62ce9b1b369"}, "nimble_parsec": {:hex, :nimble_parsec, "1.1.0", "3a6fca1550363552e54c216debb6a9e95bd8d32348938e13de5eda962c0d7f89", [:mix], [], "hexpm", "08eb32d66b706e913ff748f11694b17981c0b04a33ef470e33e11b3d3ac8f54b"}, } diff --git a/nerves_defconfig b/nerves_defconfig index 719ec09..6529b13 100644 --- a/nerves_defconfig +++ b/nerves_defconfig @@ -3,13 +3,13 @@ BR2_cortex_a5=y BR2_ARM_ENABLE_NEON=y BR2_ARM_ENABLE_VFP=y BR2_ARM_INSTRUCTIONS_THUMB2=y -BR2_GLOBAL_PATCH_DIR="${BR2_EXTERNAL_NERVES_PATH}/patches" +BR2_GLOBAL_PATCH_DIR="${BR2_EXTERNAL_NERVES_PATH}/patches ${NERVES_DEFCONFIG_DIR}/patches" BR2_TOOLCHAIN_EXTERNAL=y BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y -BR2_TOOLCHAIN_EXTERNAL_URL="https://github.com/nerves-project/toolchains/releases/download/v1.4.0/nerves_toolchain_armv7_nerves_linux_gnueabihf-linux_x86_64-1.4.0-CE0FCC7.tar.xz" +BR2_TOOLCHAIN_EXTERNAL_URL="https://github.com/nerves-project/toolchains/releases/download/v1.4.3/nerves_toolchain_armv7_nerves_linux_gnueabihf-linux_x86_64-1.4.3-C532A43.tar.xz" BR2_TOOLCHAIN_EXTERNAL_CUSTOM_PREFIX="armv7-nerves-linux-gnueabihf" -BR2_TOOLCHAIN_EXTERNAL_HEADERS_4_4=y +BR2_TOOLCHAIN_EXTERNAL_HEADERS_4_19=y BR2_TOOLCHAIN_EXTERNAL_CUSTOM_GLIBC=y # BR2_TOOLCHAIN_EXTERNAL_INET_RPC is not set BR2_TOOLCHAIN_EXTERNAL_CXX=y @@ -23,35 +23,38 @@ BR2_ROOTFS_POST_BUILD_SCRIPT="${NERVES_DEFCONFIG_DIR}/post-build.sh ${BR2_EXTERN BR2_ROOTFS_POST_IMAGE_SCRIPT="${NERVES_DEFCONFIG_DIR}/post-createfs.sh" BR2_LINUX_KERNEL=y BR2_LINUX_KERNEL_CUSTOM_TARBALL=y -BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="$(call github,linux4sam,linux-at91,linux4sam-2020.10-rc5)/linux4sam-2020.10-rc5.tar.gz" +BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="$(call github,linux4sam,linux-at91,linux4sam-2021.04)/linux4sam-2021.04.tar.gz" BR2_LINUX_KERNEL_PATCH="${NERVES_DEFCONFIG_DIR}/linux" BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="${NERVES_DEFCONFIG_DIR}/linux/linux-5.4.defconfig" BR2_LINUX_KERNEL_DTS_SUPPORT=y BR2_LINUX_KERNEL_INTREE_DTS_NAME="at91-sama5d27_wlsom1_ek" +BR2_LINUX_KERNEL_DTB_OVERLAY_SUPPORT=y +BR2_LINUX_KERNEL_INSTALL_TARGET=y BR2_PACKAGE_BUSYBOX_CONFIG="${BR2_EXTERNAL_NERVES_PATH}/board/nerves-common/busybox-1.22.config" BR2_PACKAGE_F2FS_TOOLS=y BR2_PACKAGE_LIBMNL=y BR2_PACKAGE_WIRELESS_REGDB=y BR2_PACKAGE_WPA_SUPPLICANT=y BR2_PACKAGE_WPA_SUPPLICANT_AP_SUPPORT=y -BR2_PACKAGE_WPA_SUPPLICANT_EAP=y BR2_PACKAGE_WPA_SUPPLICANT_HOTSPOT=y BR2_PACKAGE_WPA_SUPPLICANT_DEBUG_SYSLOG=y +BR2_PACKAGE_WPA_SUPPLICANT_CTRL_IFACE=y # BR2_TARGET_ROOTFS_TAR is not set BR2_TARGET_AT91BOOTSTRAP3=y BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_GIT=y BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_REPO_URL="https://github.com/linux4sam/at91bootstrap.git" -BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_REPO_VERSION="v3.9.3" +BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_REPO_VERSION="v4.0.0" BR2_TARGET_AT91BOOTSTRAP3_DEFCONFIG="sama5d27_wlsom1_eksd_uboot" BR2_TARGET_UBOOT=y BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y BR2_TARGET_UBOOT_CUSTOM_GIT=y BR2_TARGET_UBOOT_CUSTOM_REPO_URL="https://github.com/linux4sam/u-boot-at91.git" -BR2_TARGET_UBOOT_CUSTOM_REPO_VERSION="linux4sam-2020.04" +BR2_TARGET_UBOOT_CUSTOM_REPO_VERSION="linux4sam-2021.04" BR2_TARGET_UBOOT_PATCH="${NERVES_DEFCONFIG_DIR}/uboot" BR2_TARGET_UBOOT_USE_CUSTOM_CONFIG=y BR2_TARGET_UBOOT_CUSTOM_CONFIG_FILE="${NERVES_DEFCONFIG_DIR}/uboot/uboot.defconfig" +BR2_PACKAGE_HOST_UBOOT_TOOLS=y BR2_PACKAGE_HOST_UBOOT_TOOLS_ENVIMAGE=y BR2_PACKAGE_HOST_UBOOT_TOOLS_ENVIMAGE_SOURCE="${NERVES_DEFCONFIG_DIR}/uboot/uboot.env" BR2_PACKAGE_HOST_UBOOT_TOOLS_ENVIMAGE_SIZE="131072" diff --git a/patches/at91bootstrap3/0001-Symlink-the-binaries-directory.patch b/patches/at91bootstrap3/0001-Symlink-the-binaries-directory.patch new file mode 100644 index 0000000..11f59d1 --- /dev/null +++ b/patches/at91bootstrap3/0001-Symlink-the-binaries-directory.patch @@ -0,0 +1,34 @@ +From cd545856aa6aab1cb6a5c3c9b71fd06d81ee472a Mon Sep 17 00:00:00 2001 +From: Justin Schneck +Date: Wed, 4 Aug 2021 17:12:38 -0400 +Subject: [PATCH] Symlink the binaries directory + +--- + .gitignore | 1 - + binaries | 1 + + 2 files changed, 1 insertion(+), 1 deletion(-) + create mode 120000 binaries + +diff --git a/.gitignore b/.gitignore +index e688963..a6c7a8d 100644 +--- a/.gitignore ++++ b/.gitignore +@@ -9,7 +9,6 @@ config/at91bootstrap-config/ + build + debug + result +-binaries + *~ + *.orig + *.o +diff --git a/binaries b/binaries +new file mode 120000 +index 0000000..204c670 +--- /dev/null ++++ b/binaries +@@ -0,0 +1 @@ ++build/binaries +\ No newline at end of file +-- +2.25.1 + diff --git a/rootfs_overlay/etc/erlinit.config b/rootfs_overlay/etc/erlinit.config index 26f92dd..a4e9c11 100644 --- a/rootfs_overlay/etc/erlinit.config +++ b/rootfs_overlay/etc/erlinit.config @@ -14,6 +14,13 @@ # Use nbtty to improve terminal handling on serial ports. -s "/usr/bin/nbtty" +# There's a call to getrandom(2) when loading the crypto NIF that's before +# nerves_runtime can start rngd. This syscall can block the BEAM indefinitely +# if there's not enough entropy in the kernel. We have not observed blocking on +# this platform. However, we don't know that getrandom(2) will always have +# enough entropy, so start rngd here to be safe. +--pre-run-exec /usr/sbin/rngd + # Specify the user and group IDs for the Erlang VM #--uid 100 #--gid 200 diff --git a/uboot/uboot.defconfig b/uboot/uboot.defconfig index fd0aefe..745483d 100644 --- a/uboot/uboot.defconfig +++ b/uboot/uboot.defconfig @@ -11,7 +11,6 @@ CONFIG_SPL_SERIAL_SUPPORT=y CONFIG_SPL_DRIVERS_MISC_SUPPORT=y CONFIG_ENV_OFFSET=0x00100000 CONFIG_SPL=y -CONFIG_DEBUG_UART_BOARD_INIT=y CONFIG_DEBUG_UART_BASE=0xf801c000 CONFIG_DEBUG_UART_CLOCK=82000000 CONFIG_SPL_FS_FAT=y @@ -27,9 +26,9 @@ CONFIG_USE_BOOTARGS=y CONFIG_MISC_INIT_R=y # CONFIG_DISPLAY_BOARDINFO is not set CONFIG_DISPLAY_BOARDINFO_LATE=y -CONFIG_SPL_SEPARATE_BSS=y CONFIG_SPL_DISPLAY_PRINT=y # CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR is not set +CONFIG_SPL_FS_SQUASHFS=y CONFIG_SPL_AT91_MCK_BYPASS=y CONFIG_HUSH_PARSER=y CONFIG_CMD_BOOTZ=y @@ -69,7 +68,7 @@ CONFIG_MMC_SDHCI_ATMEL=y CONFIG_MTD=y CONFIG_DM_SPI_FLASH=y CONFIG_SF_DEFAULT_BUS=2 -CONFIG_SF_DEFAULT_SPEED=50000000 +CONFIG_SF_DEFAULT_SPEED=66000000 CONFIG_SPI_FLASH_SFDP_SUPPORT=y CONFIG_SPI_FLASH_ATMEL=y CONFIG_SPI_FLASH_MACRONIX=y @@ -84,7 +83,6 @@ CONFIG_SPL_PINCTRL=y CONFIG_PINCTRL_AT91PIO4=y CONFIG_DM_SERIAL=y CONFIG_DEBUG_UART_ATMEL=y -CONFIG_DEBUG_UART_ANNOUNCE=y CONFIG_ATMEL_USART=y CONFIG_SPI=y CONFIG_DM_SPI=y @@ -102,6 +100,5 @@ CONFIG_W1=y CONFIG_W1_GPIO=y CONFIG_W1_EEPROM=y CONFIG_W1_EEPROM_DS24XXX=y -CONFIG_FAT_WRITE=y CONFIG_OF_LIBFDT_OVERLAY=y # CONFIG_EFI_LOADER_HII is not set diff --git a/uboot/uboot.env b/uboot/uboot.env index 196951f..363c017 100644 --- a/uboot/uboot.env +++ b/uboot/uboot.env @@ -49,7 +49,6 @@ nerves_init=\ fi;\ saveenv;\ fi;\ - setenv bootfile zImage.${nerves_fw_active};\ if test ${nerves_fw_active} = "a"; then\ setenv uenv_root /dev/mmcblk0p2;\ setenv bootpart 0:2;\ @@ -58,9 +57,7 @@ nerves_init=\ setenv bootpart 0:3;\ fi -# Main Device Tree -fdtfile=/dtbs/at91-sama5d27_wlsom1_ek.dtb - +video=0 console=ttyS0,115200 optargs=atmel.pm_modes=standby,ulp1 quiet @@ -69,14 +66,52 @@ fdt_high=0xffffffff fdtovaddr=0x21800000 loadaddr=0x22000000 fdtaddr=0x21000000 -video=0 -kernel_bootpart=0:1 +fdtfile=/boot/at91-sama5d27_wlsom1_ek.dtb +bootfile=/boot/zImage + +loadoverlay=load mmc ${bootpart} ${fdtovaddr} ${uboot_overlay_addr0} +loadoverlay1=load mmc ${bootpart} ${fdtovaddr} ${uboot_overlay_addr1} +loadoverlay2=load mmc ${bootpart} ${fdtovaddr} ${uboot_overlay_addr2} +loadoverlay3=load mmc ${bootpart} ${fdtovaddr} ${uboot_overlay_addr3} +loadoverlay4=load mmc ${bootpart} ${fdtovaddr} ${uboot_overlay_addr5} mmcargs=setenv bootargs console=${console} ${optargs} rootfstype=squashfs rootwait root=${uenv_root} rootwait video=${video} -loadzimage=load mmc ${kernel_bootpart} ${loadaddr} ${bootfile} -loadfdt=load mmc ${kernel_bootpart} ${fdtaddr} ${fdtfile} +loadzimage=load mmc ${bootpart} ${loadaddr} ${bootfile} +loadfdt=load mmc ${bootpart} ${fdtaddr} ${fdtfile} +loadoverlays=echo Checking for overlays ...;\ + if test -n $enable_uboot_overlays; then\ + fdt addr ${fdtaddr};\ + fdt resize 4096;\ + if test -n $uboot_overlay_addr0; then\ + run loadoverlay;\ + fdt apply ${fdtovaddr};\ + echo loaded ${uboot_overlay_addr0};\ + fi;\ + if test -n $uboot_overlay_addr1; then\ + run loadoverlay1;\ + fdt apply ${fdtovaddr};\ + echo loaded ${uboot_overlay_addr1};\ + fi;\ + if test -n $uboot_overlay_addr2; then\ + run loadoverlay2;\ + fdt apply ${fdtovaddr};\ + echo loaded ${uboot_overlay_addr2};\ + fi;\ + if test -n $uboot_overlay_addr3; then\ + run loadoverlay3;\ + fdt apply ${fdtovaddr};\ + echo loaded ${uboot_overlay_addr3};\ + fi;\ + if test -n $uboot_overlay_addr4; then\ + run loadoverlay4;\ + fdt apply ${fdtovaddr};\ + echo loaded ${uboot_overlay_addr4};\ + fi;\ + fi;true + mmcboot=echo Booting from mmc...;\ run mmcargs;\ bootz ${loadaddr} - ${fdtaddr} -bootcmd=run nerves_init loadzimage loadfdt mmcboot +bootcmd=run nerves_init loadzimage loadfdt loadoverlays mmcboot +