Message ID | 20201129202750.23505-2-pierre-jean.texier@lafon.fr |
---|---|
State | Accepted |
Headers | show |
Series | [meta-swupdate-boards,1/2] layer: Implement BBFILES_DYNAMIC to handle dynamic-layers | expand |
On 29.11.20 21:27, Pierre-Jean Texier wrote: > This commit adds a basic support for the Microchip SAMA5D27 SOM1 Evaluation Kit > > Signed-off-by: Pierre-Jean Texier <pierre-jean.texier@lafon.fr> > --- Applied to -master, thanks ! Best regards, Stefano Babic > conf/layer.conf | 3 + > .../u-boot/files/envs/sama5d27-som1-ek-sd.txt | 24 ++++ > .../recipes-bsp/u-boot/u-boot-at91_%.bbappend | 4 + > .../files/sama5d27-som1-ek-sd/fw_env.config | 30 +++++ > .../base-files/sama5d27-som1-ek-sd/fstab | 10 ++ > .../sama5d27-som1-ek-sd/emmcsetup.lua | 12 ++ > .../sama5d27-som1-ek-sd/sw-description | 36 ++++++ > .../sama5d27-som1-ek-sd/09-swupdate-args | 16 +++ > .../swupdate/sama5d27-som1-ek-sd/defconfig | 114 ++++++++++++++++++ > .../swupdate/sama5d27-som1-ek-sd/swupdate.cfg | 47 ++++++++ > wic/sama5d27.wks | 9 ++ > 11 files changed, 305 insertions(+) > create mode 100644 dynamic-layers/atmel/recipes-bsp/u-boot/files/envs/sama5d27-som1-ek-sd.txt > create mode 100644 dynamic-layers/atmel/recipes-bsp/u-boot/u-boot-at91_%.bbappend > create mode 100644 recipes-bsp/libubootenv/files/sama5d27-som1-ek-sd/fw_env.config > create mode 100644 recipes-core/base-files/base-files/sama5d27-som1-ek-sd/fstab > create mode 100644 recipes-extended/images/update-image/sama5d27-som1-ek-sd/emmcsetup.lua > create mode 100644 recipes-extended/images/update-image/sama5d27-som1-ek-sd/sw-description > create mode 100644 recipes-support/swupdate/swupdate/sama5d27-som1-ek-sd/09-swupdate-args > create mode 100644 recipes-support/swupdate/swupdate/sama5d27-som1-ek-sd/defconfig > create mode 100644 recipes-support/swupdate/swupdate/sama5d27-som1-ek-sd/swupdate.cfg > create mode 100644 wic/sama5d27.wks > > diff --git a/conf/layer.conf b/conf/layer.conf > index cdc28eb..37b3809 100644 > --- a/conf/layer.conf > +++ b/conf/layer.conf > @@ -14,6 +14,9 @@ LAYERDEPENDS_swupdate-boards = "swupdate" > LAYERSERIES_COMPAT_swupdate-boards = "dunfell gatesgarth hardknott" > > BBFILES_DYNAMIC += " \ > + atmel:${LAYERDIR}/dynamic-layers/atmel/*/*/*.bb \ > + atmel:${LAYERDIR}/dynamic-layers/atmel/*/*/*.bbappend \ > + \ > raspberrypi:${LAYERDIR}/dynamic-layers/raspberrypi/*/*/*.bb \ > raspberrypi:${LAYERDIR}/dynamic-layers/raspberrypi/*/*/*.bbappend \ > " > diff --git a/dynamic-layers/atmel/recipes-bsp/u-boot/files/envs/sama5d27-som1-ek-sd.txt b/dynamic-layers/atmel/recipes-bsp/u-boot/files/envs/sama5d27-som1-ek-sd.txt > new file mode 100644 > index 0000000..95b32b4 > --- /dev/null > +++ b/dynamic-layers/atmel/recipes-bsp/u-boot/files/envs/sama5d27-som1-ek-sd.txt > @@ -0,0 +1,24 @@ > +video_mode_pda4=Unknown-1:480x272-16 > +video_mode_pda5=Unknown-1:800x480-16 > +video_mode_pda7=Unknown-1:800x480-16 > +video_mode_pda7b=Unknown-1:800x480-16 > +at91_pda_detect=run pda4300test; run pda7000test; run pda7000btest; run pda5000test; run pda4301test; run pda4301btest; > +pda7000btest=test -n $display && test $display = 7000B && setenv display_var 'pda7b' && setenv video_mode ${video_mode_pda7b} > +at91_set_display=test -n $pda && setenv display $pda > +pda4300test=test -n $display && test $display = 4300 && setenv display_var 'pda4' && setenv video_mode ${video_mode_pda4} > +pda4301test=test -n $display && test $display = 4301 && setenv display_var 'pda4' && setenv video_mode ${video_mode_pda4} > +pda4301btest=test -n $display && test $display = 4301B && setenv display_var 'pda4' && setenv video_mode ${video_mode_pda4} > +at91_prepare_bootargs=test -n $display_var && setenv bootargs ${bootargs} ${at91_video_bootargs} > +at91_prepare_video_bootargs=test -n $display_var && setenv at91_video_bootargs video=${video_mode} > +at91_set_rootpart=if env exists rootpart;then echo Booting from mmcblk0p${rootpart};else setenv rootpart 2;echo rootpart not set, default to ${rootpart};fi > +at91_set_bootargs=run at91_set_rootpart && setenv bootargs console=ttyS0,115200 root=/dev/mmcblk0p${rootpart} rw rootfstype=ext4 rootwait atmel.pm_modes=standby,ulp1 > +pda7000test=test -n $display && test $display = 7000 && setenv display_var 'pda7' && setenv video_mode ${video_mode_pda7} > +at91_prepare_overlays_config=test -n $display_var && setenv at91_overlays_config '#'${display_var} > +bootcmd=run at91_set_display; run at91_pda_detect; run at91_prepare_video_bootargs; run at91_set_bootargs ; run at91_prepare_bootargs; run at91_prepare_overlays_config; run bootcmd_boot; > +pda5000test=test -n $display && test $display = 5000 && setenv display_var 'pda5' && setenv video_mode ${video_mode_pda5} > +bootcmd_boot=fatload mmc 0:1 0x24000000 sama5d27_som1_ek.itb; bootm 0x24000000#kernel_dtb${at91_overlays_config} > +bootdelay=1 > +ethact=gmac0 > +stderr=serial > +stdin=serial > +stdout=serial > diff --git a/dynamic-layers/atmel/recipes-bsp/u-boot/u-boot-at91_%.bbappend b/dynamic-layers/atmel/recipes-bsp/u-boot/u-boot-at91_%.bbappend > new file mode 100644 > index 0000000..5230f0f > --- /dev/null > +++ b/dynamic-layers/atmel/recipes-bsp/u-boot/u-boot-at91_%.bbappend > @@ -0,0 +1,4 @@ > +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" > + > +PACKAGE_BEFORE_PN += "${PN}-env" > +RPROVIDES_${PN}-env += "u-boot-default-env" > diff --git a/recipes-bsp/libubootenv/files/sama5d27-som1-ek-sd/fw_env.config b/recipes-bsp/libubootenv/files/sama5d27-som1-ek-sd/fw_env.config > new file mode 100644 > index 0000000..96df4d5 > --- /dev/null > +++ b/recipes-bsp/libubootenv/files/sama5d27-som1-ek-sd/fw_env.config > @@ -0,0 +1,30 @@ > +# Configuration file for fw_(printenv/setenv) utility. > +# Up to two entries are valid, in this case the redundant > +# environment sector is assumed present. > +# Notice, that the "Number of sectors" is not required on NOR and SPI-dataflash. > +# Futhermore, if the Flash sector size is omitted, this value is assumed to > +# be the same as the Environment size, which is valid for NOR and SPI-dataflash > +# Device offset must be prefixed with 0x to be parsed as a hexadecimal value. > + > +# NOR example > +# MTD device name Device offset Env. size Flash sector size Number of sectors > +#/dev/mtd1 0x0000 0x4000 0x4000 > +#/dev/mtd2 0x0000 0x4000 0x4000 > + > +# MTD SPI-dataflash example > +# MTD device name Device offset Env. size Flash sector size Number of sectors > +#/dev/mtd5 0x4200 0x4200 > +#/dev/mtd6 0x4200 0x4200 > + > +# NAND example > +#/dev/mtd0 0x4000 0x4000 0x20000 2 > + > +# On a block device a negative offset is treated as a backwards offset from the > +# end of the device/partition, rather than a forwards offset from the start. > + > +# Block device example > +#/dev/mmcblk0 0xc0000 0x20000 > +#/dev/mmcblk0 -0x20000 0x20000 > + > +# VFAT example > +/boot/uboot.env 0x0000 0x4000 > diff --git a/recipes-core/base-files/base-files/sama5d27-som1-ek-sd/fstab b/recipes-core/base-files/base-files/sama5d27-som1-ek-sd/fstab > new file mode 100644 > index 0000000..6342d7e > --- /dev/null > +++ b/recipes-core/base-files/base-files/sama5d27-som1-ek-sd/fstab > @@ -0,0 +1,10 @@ > +# stock fstab - you probably want to override this with a machine specific one > + > +/dev/root / auto defaults 1 1 > +proc /proc proc defaults 0 0 > +devpts /dev/pts devpts mode=0620,gid=5 0 0 > +tmpfs /run tmpfs mode=0755,nodev,nosuid,strictatime 0 0 > +tmpfs /var/volatile tmpfs defaults 0 0 > + > +# We need to mount the first partition to access the U-Boot environment > +/dev/mmcblk0p1 /boot auto defaults,sync 0 0 > diff --git a/recipes-extended/images/update-image/sama5d27-som1-ek-sd/emmcsetup.lua b/recipes-extended/images/update-image/sama5d27-som1-ek-sd/emmcsetup.lua > new file mode 100644 > index 0000000..58a7832 > --- /dev/null > +++ b/recipes-extended/images/update-image/sama5d27-som1-ek-sd/emmcsetup.lua > @@ -0,0 +1,12 @@ > +function preinst() > + local out = "Post installed script called" > + > + return true, out > + > +end > + > +function postinst() > + local out = "Post installed script called" > + > + return true, out > +end > diff --git a/recipes-extended/images/update-image/sama5d27-som1-ek-sd/sw-description b/recipes-extended/images/update-image/sama5d27-som1-ek-sd/sw-description > new file mode 100644 > index 0000000..2366449 > --- /dev/null > +++ b/recipes-extended/images/update-image/sama5d27-som1-ek-sd/sw-description > @@ -0,0 +1,36 @@ > +software = > +{ > + version = "0.1.0"; > + > + sama5d27-som1-ek-sd = { > + hardware-compatibility: ["1.0"]; > + stable : { > + copy1 : { > + images: ({ > + filename = "core-image-full-cmdline-sama5d27-som1-ek-sd.ext4.gz"; > + type = "raw"; > + sha256 = "@core-image-full-cmdline-sama5d27-som1-ek-sd.ext4.gz"; > + compressed = "zlib"; > + device = "/dev/mmcblk0p2"; > + }); > + uboot: ({ > + name = "rootpart"; > + value = "2"; > + }); > + }; > + copy2 : { > + images: ({ > + filename = "core-image-full-cmdline-sama5d27-som1-ek-sd.ext4.gz"; > + type = "raw"; > + sha256 = "@core-image-full-cmdline-sama5d27-som1-ek-sd.ext4.gz"; > + compressed = "zlib"; > + device = "/dev/mmcblk0p3"; > + }); > + uboot: ({ > + name = "rootpart"; > + value = "3"; > + }); > + }; > + }; > + } > +} > diff --git a/recipes-support/swupdate/swupdate/sama5d27-som1-ek-sd/09-swupdate-args b/recipes-support/swupdate/swupdate/sama5d27-som1-ek-sd/09-swupdate-args > new file mode 100644 > index 0000000..bca35f9 > --- /dev/null > +++ b/recipes-support/swupdate/swupdate/sama5d27-som1-ek-sd/09-swupdate-args > @@ -0,0 +1,16 @@ > +rootfs=`mount | grep "on / type" | cut -d':' -f 2 | cut -d' ' -f 1` > + > +if [ $rootfs == '/dev/mmcblk0p2' ];then > + selection="-e stable,copy2" > +else > + selection="-e stable,copy1" > +fi > + > +state=`fw_printenv ustate | cut -f 2 -d'='` > +if [ $state == 1 ];then > + SWUPDATE_SURICATTA_ARGS="-c 2" > +else > + SWUPDATE_SURICATTA_ARGS=" " > +fi > + > +SWUPDATE_ARGS="-H sama5d27-som1-ek-sd:1.0 ${selection} -f /etc/swupdate.cfg" > diff --git a/recipes-support/swupdate/swupdate/sama5d27-som1-ek-sd/defconfig b/recipes-support/swupdate/swupdate/sama5d27-som1-ek-sd/defconfig > new file mode 100644 > index 0000000..4ac7854 > --- /dev/null > +++ b/recipes-support/swupdate/swupdate/sama5d27-som1-ek-sd/defconfig > @@ -0,0 +1,114 @@ > +# > +# Automatically generated file; DO NOT EDIT. > +# Swupdate Configuration > +# > + > +# > +# Swupdate Settings > +# > + > +# > +# General Configuration > +# > +CONFIG_CURL=y > +CONFIG_CURL_SSL=y > +CONFIG_SYSTEMD=y > +CONFIG_DEFAULT_CONFIG_FILE="/etc/swupdate.cfg" > +CONFIG_SCRIPTS=y > +CONFIG_HW_COMPATIBILITY=y > +CONFIG_HW_COMPATIBILITY_FILE="/etc/hwrevision" > +CONFIG_SW_VERSIONS_FILE="/etc/sw-versions" > + > +# > +# Socket Paths > +# > +CONFIG_SOCKET_CTRL_PATH="" > +CONFIG_SOCKET_PROGRESS_PATH="" > +CONFIG_SOCKET_REMOTE_HANDLER_DIRECTORY="/tmp/" > +# CONFIG_MTD is not set > +CONFIG_LUA=y > +CONFIG_LUAPKG="lua" > +# CONFIG_FEATURE_SYSLOG is not set > + > +# > +# Build Options > +# > +CONFIG_CROSS_COMPILE="" > +CONFIG_SYSROOT="" > +CONFIG_EXTRA_CFLAGS="" > +CONFIG_EXTRA_LDFLAGS="" > +CONFIG_EXTRA_LDLIBS="" > + > +# > +# Debugging Options > +# > +# CONFIG_DEBUG is not set > +# CONFIG_WERROR is not set > +# CONFIG_NOCLEANUP is not set > +# CONFIG_BOOTLOADER_EBG is not set > +CONFIG_UBOOT=y > +# CONFIG_BOOTLOADER_NONE is not set > +# CONFIG_BOOTLOADER_GRUB is not set > +CONFIG_UBOOT_FWENV="/etc/fw_env.config" > +# CONFIG_UPDATE_STATE_CHOICE_NONE is not set > +CONFIG_UPDATE_STATE_CHOICE_BOOTLOADER=y > +CONFIG_UPDATE_STATE_BOOTLOADER="ustate" > +CONFIG_UBOOT_DEFAULTENV="/etc/u-boot-initial-env" > +# CONFIG_SSL_IMPL_NONE is not set > +CONFIG_SSL_IMPL_OPENSSL=y > +# CONFIG_SSL_IMPL_WOLFSSL is not set > +# CONFIG_SSL_IMPL_MBEDTLS is not set > +CONFIG_DOWNLOAD=y > +# CONFIG_DOWNLOAD_SSL is not set > +CONFIG_CHANNEL_CURL=y > +CONFIG_CHANNEL_CURL_SSL=y > +CONFIG_HASH_VERIFY=y > +# CONFIG_DISABLE_CPIO_CRC is not set > +# CONFIG_SIGNED_IMAGES is not set > +CONFIG_ENCRYPTED_IMAGES=y > +# CONFIG_PKCS11 is not set > +CONFIG_SURICATTA=y > + > +# > +# Features > +# > +CONFIG_SURICATTA_SSL=y > + > +# > +# Server > +# > +CONFIG_SURICATTA_HAWKBIT=y > +# CONFIG_SURICATTA_GENERAL is not set > +CONFIG_WEBSERVER=y > +CONFIG_MONGOOSE=y > +# CONFIG_MONGOOSEIPV6 is not set > +CONFIG_MONGOOSESSL=y > +CONFIG_GUNZIP=y > +# CONFIG_ZSTD is not set > + > +# > +# Parser Features > +# > +CONFIG_LIBCONFIG=y > +CONFIG_PARSERROOT="" > +CONFIG_JSON=y > +# CONFIG_LUAEXTERNAL is not set > +# CONFIG_SETSWDESCRIPTION is not set > + > +# > +# Image Handlers > +# > +# CONFIG_DISKPART is not set > +# CONFIG_UNIQUEUUID is not set > +CONFIG_RAW=y > +# CONFIG_RDIFFHANDLER is not set > +# CONFIG_READBACKHANDLER is not set > +CONFIG_LUASCRIPTHANDLER=y > +CONFIG_SHELLSCRIPTHANDLER=y > +# CONFIG_HANDLER_IN_LUA is not set > +CONFIG_ARCHIVE=y > +CONFIG_LOCALE=y > +CONFIG_REMOTE_HANDLER=y > +# CONFIG_SWUFORWARDER_HANDLER is not set > +CONFIG_BOOTLOADERHANDLER=y > +# CONFIG_UCFWHANDLER is not set > diff --git a/recipes-support/swupdate/swupdate/sama5d27-som1-ek-sd/swupdate.cfg b/recipes-support/swupdate/swupdate/sama5d27-som1-ek-sd/swupdate.cfg > new file mode 100644 > index 0000000..a5cb90d > --- /dev/null > +++ b/recipes-support/swupdate/swupdate/sama5d27-som1-ek-sd/swupdate.cfg > @@ -0,0 +1,47 @@ > +globals : > +{ > + > + verbose = true; > + loglevel = 5; > + syslog = true; > + /* public-key-file = "test.pem";*/ > +}; > + > +download : > +{ > + retries = 3; > + timeout = 1800; > +}; > + > +identify : ( > + { name = "board"; value = "sama5d27-som1-ek-sd"; } > +); > + > +suricatta : > +{ > + > + tenant = "default"; > + id = "sama5d27-som1-ek-sd"; > + confirm = 0; > + url = "http://papero:8080"; > + polldelay = 360; > + nocheckcert = true; > + retry = 4; > + retrywait = 200; > + loglevel = 10; > + userid = 0; > + groupid = 0; > + max_artifacts = 1; > +/* > + cafile = "/etc/ssl/cafile"; > + sslkey = "/etc/ssl/sslkey"; > + sslcert = "/etc/ssl/sslcert"; > +*/ > +}; > + > +webserver : > +{ > + document_root = "/www"; > + userid = 0; > + groupid = 0; > +}; > diff --git a/wic/sama5d27.wks b/wic/sama5d27.wks > new file mode 100644 > index 0000000..9ec1543 > --- /dev/null > +++ b/wic/sama5d27.wks > @@ -0,0 +1,9 @@ > +# short-description: Create SD card image with a dual partition > +# long-description: Creates a partitioned SD card image. Boot files > +# are located in the first vfat partition. > + > +part /boot --source bootimg-partition --ondisk mmcblk0 --fstype=vfat --label boot --active --align 4 --size 16 > +part / --source rootfs --ondisk mmcblk0 --fstype=ext4 --label rootfs_A --align 4 > +part / --source rootfs --ondisk mmcblk0 --fstype=ext4 --label rootfs_B --align 4 > + > +bootloader --ptable msdos >
diff --git a/conf/layer.conf b/conf/layer.conf index cdc28eb..37b3809 100644 --- a/conf/layer.conf +++ b/conf/layer.conf @@ -14,6 +14,9 @@ LAYERDEPENDS_swupdate-boards = "swupdate" LAYERSERIES_COMPAT_swupdate-boards = "dunfell gatesgarth hardknott" BBFILES_DYNAMIC += " \ + atmel:${LAYERDIR}/dynamic-layers/atmel/*/*/*.bb \ + atmel:${LAYERDIR}/dynamic-layers/atmel/*/*/*.bbappend \ + \ raspberrypi:${LAYERDIR}/dynamic-layers/raspberrypi/*/*/*.bb \ raspberrypi:${LAYERDIR}/dynamic-layers/raspberrypi/*/*/*.bbappend \ " diff --git a/dynamic-layers/atmel/recipes-bsp/u-boot/files/envs/sama5d27-som1-ek-sd.txt b/dynamic-layers/atmel/recipes-bsp/u-boot/files/envs/sama5d27-som1-ek-sd.txt new file mode 100644 index 0000000..95b32b4 --- /dev/null +++ b/dynamic-layers/atmel/recipes-bsp/u-boot/files/envs/sama5d27-som1-ek-sd.txt @@ -0,0 +1,24 @@ +video_mode_pda4=Unknown-1:480x272-16 +video_mode_pda5=Unknown-1:800x480-16 +video_mode_pda7=Unknown-1:800x480-16 +video_mode_pda7b=Unknown-1:800x480-16 +at91_pda_detect=run pda4300test; run pda7000test; run pda7000btest; run pda5000test; run pda4301test; run pda4301btest; +pda7000btest=test -n $display && test $display = 7000B && setenv display_var 'pda7b' && setenv video_mode ${video_mode_pda7b} +at91_set_display=test -n $pda && setenv display $pda +pda4300test=test -n $display && test $display = 4300 && setenv display_var 'pda4' && setenv video_mode ${video_mode_pda4} +pda4301test=test -n $display && test $display = 4301 && setenv display_var 'pda4' && setenv video_mode ${video_mode_pda4} +pda4301btest=test -n $display && test $display = 4301B && setenv display_var 'pda4' && setenv video_mode ${video_mode_pda4} +at91_prepare_bootargs=test -n $display_var && setenv bootargs ${bootargs} ${at91_video_bootargs} +at91_prepare_video_bootargs=test -n $display_var && setenv at91_video_bootargs video=${video_mode} +at91_set_rootpart=if env exists rootpart;then echo Booting from mmcblk0p${rootpart};else setenv rootpart 2;echo rootpart not set, default to ${rootpart};fi +at91_set_bootargs=run at91_set_rootpart && setenv bootargs console=ttyS0,115200 root=/dev/mmcblk0p${rootpart} rw rootfstype=ext4 rootwait atmel.pm_modes=standby,ulp1 +pda7000test=test -n $display && test $display = 7000 && setenv display_var 'pda7' && setenv video_mode ${video_mode_pda7} +at91_prepare_overlays_config=test -n $display_var && setenv at91_overlays_config '#'${display_var} +bootcmd=run at91_set_display; run at91_pda_detect; run at91_prepare_video_bootargs; run at91_set_bootargs ; run at91_prepare_bootargs; run at91_prepare_overlays_config; run bootcmd_boot; +pda5000test=test -n $display && test $display = 5000 && setenv display_var 'pda5' && setenv video_mode ${video_mode_pda5} +bootcmd_boot=fatload mmc 0:1 0x24000000 sama5d27_som1_ek.itb; bootm 0x24000000#kernel_dtb${at91_overlays_config} +bootdelay=1 +ethact=gmac0 +stderr=serial +stdin=serial +stdout=serial diff --git a/dynamic-layers/atmel/recipes-bsp/u-boot/u-boot-at91_%.bbappend b/dynamic-layers/atmel/recipes-bsp/u-boot/u-boot-at91_%.bbappend new file mode 100644 index 0000000..5230f0f --- /dev/null +++ b/dynamic-layers/atmel/recipes-bsp/u-boot/u-boot-at91_%.bbappend @@ -0,0 +1,4 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + +PACKAGE_BEFORE_PN += "${PN}-env" +RPROVIDES_${PN}-env += "u-boot-default-env" diff --git a/recipes-bsp/libubootenv/files/sama5d27-som1-ek-sd/fw_env.config b/recipes-bsp/libubootenv/files/sama5d27-som1-ek-sd/fw_env.config new file mode 100644 index 0000000..96df4d5 --- /dev/null +++ b/recipes-bsp/libubootenv/files/sama5d27-som1-ek-sd/fw_env.config @@ -0,0 +1,30 @@ +# Configuration file for fw_(printenv/setenv) utility. +# Up to two entries are valid, in this case the redundant +# environment sector is assumed present. +# Notice, that the "Number of sectors" is not required on NOR and SPI-dataflash. +# Futhermore, if the Flash sector size is omitted, this value is assumed to +# be the same as the Environment size, which is valid for NOR and SPI-dataflash +# Device offset must be prefixed with 0x to be parsed as a hexadecimal value. + +# NOR example +# MTD device name Device offset Env. size Flash sector size Number of sectors +#/dev/mtd1 0x0000 0x4000 0x4000 +#/dev/mtd2 0x0000 0x4000 0x4000 + +# MTD SPI-dataflash example +# MTD device name Device offset Env. size Flash sector size Number of sectors +#/dev/mtd5 0x4200 0x4200 +#/dev/mtd6 0x4200 0x4200 + +# NAND example +#/dev/mtd0 0x4000 0x4000 0x20000 2 + +# On a block device a negative offset is treated as a backwards offset from the +# end of the device/partition, rather than a forwards offset from the start. + +# Block device example +#/dev/mmcblk0 0xc0000 0x20000 +#/dev/mmcblk0 -0x20000 0x20000 + +# VFAT example +/boot/uboot.env 0x0000 0x4000 diff --git a/recipes-core/base-files/base-files/sama5d27-som1-ek-sd/fstab b/recipes-core/base-files/base-files/sama5d27-som1-ek-sd/fstab new file mode 100644 index 0000000..6342d7e --- /dev/null +++ b/recipes-core/base-files/base-files/sama5d27-som1-ek-sd/fstab @@ -0,0 +1,10 @@ +# stock fstab - you probably want to override this with a machine specific one + +/dev/root / auto defaults 1 1 +proc /proc proc defaults 0 0 +devpts /dev/pts devpts mode=0620,gid=5 0 0 +tmpfs /run tmpfs mode=0755,nodev,nosuid,strictatime 0 0 +tmpfs /var/volatile tmpfs defaults 0 0 + +# We need to mount the first partition to access the U-Boot environment +/dev/mmcblk0p1 /boot auto defaults,sync 0 0 diff --git a/recipes-extended/images/update-image/sama5d27-som1-ek-sd/emmcsetup.lua b/recipes-extended/images/update-image/sama5d27-som1-ek-sd/emmcsetup.lua new file mode 100644 index 0000000..58a7832 --- /dev/null +++ b/recipes-extended/images/update-image/sama5d27-som1-ek-sd/emmcsetup.lua @@ -0,0 +1,12 @@ +function preinst() + local out = "Post installed script called" + + return true, out + +end + +function postinst() + local out = "Post installed script called" + + return true, out +end diff --git a/recipes-extended/images/update-image/sama5d27-som1-ek-sd/sw-description b/recipes-extended/images/update-image/sama5d27-som1-ek-sd/sw-description new file mode 100644 index 0000000..2366449 --- /dev/null +++ b/recipes-extended/images/update-image/sama5d27-som1-ek-sd/sw-description @@ -0,0 +1,36 @@ +software = +{ + version = "0.1.0"; + + sama5d27-som1-ek-sd = { + hardware-compatibility: ["1.0"]; + stable : { + copy1 : { + images: ({ + filename = "core-image-full-cmdline-sama5d27-som1-ek-sd.ext4.gz"; + type = "raw"; + sha256 = "@core-image-full-cmdline-sama5d27-som1-ek-sd.ext4.gz"; + compressed = "zlib"; + device = "/dev/mmcblk0p2"; + }); + uboot: ({ + name = "rootpart"; + value = "2"; + }); + }; + copy2 : { + images: ({ + filename = "core-image-full-cmdline-sama5d27-som1-ek-sd.ext4.gz"; + type = "raw"; + sha256 = "@core-image-full-cmdline-sama5d27-som1-ek-sd.ext4.gz"; + compressed = "zlib"; + device = "/dev/mmcblk0p3"; + }); + uboot: ({ + name = "rootpart"; + value = "3"; + }); + }; + }; + } +} diff --git a/recipes-support/swupdate/swupdate/sama5d27-som1-ek-sd/09-swupdate-args b/recipes-support/swupdate/swupdate/sama5d27-som1-ek-sd/09-swupdate-args new file mode 100644 index 0000000..bca35f9 --- /dev/null +++ b/recipes-support/swupdate/swupdate/sama5d27-som1-ek-sd/09-swupdate-args @@ -0,0 +1,16 @@ +rootfs=`mount | grep "on / type" | cut -d':' -f 2 | cut -d' ' -f 1` + +if [ $rootfs == '/dev/mmcblk0p2' ];then + selection="-e stable,copy2" +else + selection="-e stable,copy1" +fi + +state=`fw_printenv ustate | cut -f 2 -d'='` +if [ $state == 1 ];then + SWUPDATE_SURICATTA_ARGS="-c 2" +else + SWUPDATE_SURICATTA_ARGS=" " +fi + +SWUPDATE_ARGS="-H sama5d27-som1-ek-sd:1.0 ${selection} -f /etc/swupdate.cfg" diff --git a/recipes-support/swupdate/swupdate/sama5d27-som1-ek-sd/defconfig b/recipes-support/swupdate/swupdate/sama5d27-som1-ek-sd/defconfig new file mode 100644 index 0000000..4ac7854 --- /dev/null +++ b/recipes-support/swupdate/swupdate/sama5d27-som1-ek-sd/defconfig @@ -0,0 +1,114 @@ +# +# Automatically generated file; DO NOT EDIT. +# Swupdate Configuration +# + +# +# Swupdate Settings +# + +# +# General Configuration +# +CONFIG_CURL=y +CONFIG_CURL_SSL=y +CONFIG_SYSTEMD=y +CONFIG_DEFAULT_CONFIG_FILE="/etc/swupdate.cfg" +CONFIG_SCRIPTS=y +CONFIG_HW_COMPATIBILITY=y +CONFIG_HW_COMPATIBILITY_FILE="/etc/hwrevision" +CONFIG_SW_VERSIONS_FILE="/etc/sw-versions" + +# +# Socket Paths +# +CONFIG_SOCKET_CTRL_PATH="" +CONFIG_SOCKET_PROGRESS_PATH="" +CONFIG_SOCKET_REMOTE_HANDLER_DIRECTORY="/tmp/" +# CONFIG_MTD is not set +CONFIG_LUA=y +CONFIG_LUAPKG="lua" +# CONFIG_FEATURE_SYSLOG is not set + +# +# Build Options +# +CONFIG_CROSS_COMPILE="" +CONFIG_SYSROOT="" +CONFIG_EXTRA_CFLAGS="" +CONFIG_EXTRA_LDFLAGS="" +CONFIG_EXTRA_LDLIBS="" + +# +# Debugging Options +# +# CONFIG_DEBUG is not set +# CONFIG_WERROR is not set +# CONFIG_NOCLEANUP is not set +# CONFIG_BOOTLOADER_EBG is not set +CONFIG_UBOOT=y +# CONFIG_BOOTLOADER_NONE is not set +# CONFIG_BOOTLOADER_GRUB is not set +CONFIG_UBOOT_FWENV="/etc/fw_env.config" +# CONFIG_UPDATE_STATE_CHOICE_NONE is not set +CONFIG_UPDATE_STATE_CHOICE_BOOTLOADER=y +CONFIG_UPDATE_STATE_BOOTLOADER="ustate" +CONFIG_UBOOT_DEFAULTENV="/etc/u-boot-initial-env" +# CONFIG_SSL_IMPL_NONE is not set +CONFIG_SSL_IMPL_OPENSSL=y +# CONFIG_SSL_IMPL_WOLFSSL is not set +# CONFIG_SSL_IMPL_MBEDTLS is not set +CONFIG_DOWNLOAD=y +# CONFIG_DOWNLOAD_SSL is not set +CONFIG_CHANNEL_CURL=y +CONFIG_CHANNEL_CURL_SSL=y +CONFIG_HASH_VERIFY=y +# CONFIG_DISABLE_CPIO_CRC is not set +# CONFIG_SIGNED_IMAGES is not set +CONFIG_ENCRYPTED_IMAGES=y +# CONFIG_PKCS11 is not set +CONFIG_SURICATTA=y + +# +# Features +# +CONFIG_SURICATTA_SSL=y + +# +# Server +# +CONFIG_SURICATTA_HAWKBIT=y +# CONFIG_SURICATTA_GENERAL is not set +CONFIG_WEBSERVER=y +CONFIG_MONGOOSE=y +# CONFIG_MONGOOSEIPV6 is not set +CONFIG_MONGOOSESSL=y +CONFIG_GUNZIP=y +# CONFIG_ZSTD is not set + +# +# Parser Features +# +CONFIG_LIBCONFIG=y +CONFIG_PARSERROOT="" +CONFIG_JSON=y +# CONFIG_LUAEXTERNAL is not set +# CONFIG_SETSWDESCRIPTION is not set + +# +# Image Handlers +# +# CONFIG_DISKPART is not set +# CONFIG_UNIQUEUUID is not set +CONFIG_RAW=y +# CONFIG_RDIFFHANDLER is not set +# CONFIG_READBACKHANDLER is not set +CONFIG_LUASCRIPTHANDLER=y +CONFIG_SHELLSCRIPTHANDLER=y +# CONFIG_HANDLER_IN_LUA is not set +CONFIG_ARCHIVE=y +CONFIG_LOCALE=y +CONFIG_REMOTE_HANDLER=y +# CONFIG_SWUFORWARDER_HANDLER is not set +CONFIG_BOOTLOADERHANDLER=y +# CONFIG_UCFWHANDLER is not set diff --git a/recipes-support/swupdate/swupdate/sama5d27-som1-ek-sd/swupdate.cfg b/recipes-support/swupdate/swupdate/sama5d27-som1-ek-sd/swupdate.cfg new file mode 100644 index 0000000..a5cb90d --- /dev/null +++ b/recipes-support/swupdate/swupdate/sama5d27-som1-ek-sd/swupdate.cfg @@ -0,0 +1,47 @@ +globals : +{ + + verbose = true; + loglevel = 5; + syslog = true; + /* public-key-file = "test.pem";*/ +}; + +download : +{ + retries = 3; + timeout = 1800; +}; + +identify : ( + { name = "board"; value = "sama5d27-som1-ek-sd"; } +); + +suricatta : +{ + + tenant = "default"; + id = "sama5d27-som1-ek-sd"; + confirm = 0; + url = "http://papero:8080"; + polldelay = 360; + nocheckcert = true; + retry = 4; + retrywait = 200; + loglevel = 10; + userid = 0; + groupid = 0; + max_artifacts = 1; +/* + cafile = "/etc/ssl/cafile"; + sslkey = "/etc/ssl/sslkey"; + sslcert = "/etc/ssl/sslcert"; +*/ +}; + +webserver : +{ + document_root = "/www"; + userid = 0; + groupid = 0; +}; diff --git a/wic/sama5d27.wks b/wic/sama5d27.wks new file mode 100644 index 0000000..9ec1543 --- /dev/null +++ b/wic/sama5d27.wks @@ -0,0 +1,9 @@ +# short-description: Create SD card image with a dual partition +# long-description: Creates a partitioned SD card image. Boot files +# are located in the first vfat partition. + +part /boot --source bootimg-partition --ondisk mmcblk0 --fstype=vfat --label boot --active --align 4 --size 16 +part / --source rootfs --ondisk mmcblk0 --fstype=ext4 --label rootfs_A --align 4 +part / --source rootfs --ondisk mmcblk0 --fstype=ext4 --label rootfs_B --align 4 + +bootloader --ptable msdos
This commit adds a basic support for the Microchip SAMA5D27 SOM1 Evaluation Kit Signed-off-by: Pierre-Jean Texier <pierre-jean.texier@lafon.fr> --- conf/layer.conf | 3 + .../u-boot/files/envs/sama5d27-som1-ek-sd.txt | 24 ++++ .../recipes-bsp/u-boot/u-boot-at91_%.bbappend | 4 + .../files/sama5d27-som1-ek-sd/fw_env.config | 30 +++++ .../base-files/sama5d27-som1-ek-sd/fstab | 10 ++ .../sama5d27-som1-ek-sd/emmcsetup.lua | 12 ++ .../sama5d27-som1-ek-sd/sw-description | 36 ++++++ .../sama5d27-som1-ek-sd/09-swupdate-args | 16 +++ .../swupdate/sama5d27-som1-ek-sd/defconfig | 114 ++++++++++++++++++ .../swupdate/sama5d27-som1-ek-sd/swupdate.cfg | 47 ++++++++ wic/sama5d27.wks | 9 ++ 11 files changed, 305 insertions(+) create mode 100644 dynamic-layers/atmel/recipes-bsp/u-boot/files/envs/sama5d27-som1-ek-sd.txt create mode 100644 dynamic-layers/atmel/recipes-bsp/u-boot/u-boot-at91_%.bbappend create mode 100644 recipes-bsp/libubootenv/files/sama5d27-som1-ek-sd/fw_env.config create mode 100644 recipes-core/base-files/base-files/sama5d27-som1-ek-sd/fstab create mode 100644 recipes-extended/images/update-image/sama5d27-som1-ek-sd/emmcsetup.lua create mode 100644 recipes-extended/images/update-image/sama5d27-som1-ek-sd/sw-description create mode 100644 recipes-support/swupdate/swupdate/sama5d27-som1-ek-sd/09-swupdate-args create mode 100644 recipes-support/swupdate/swupdate/sama5d27-som1-ek-sd/defconfig create mode 100644 recipes-support/swupdate/swupdate/sama5d27-som1-ek-sd/swupdate.cfg create mode 100644 wic/sama5d27.wks