aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/imx
diff options
context:
space:
mode:
authorLech Perczak <lech.perczak@gmail.com>2022-04-25 00:42:03 +0200
committerPiotr Dymacz <pepe2k@gmail.com>2022-07-11 14:26:24 +0200
commitfa26cdacc2eb7924f71ea62c0dfbeec7763b465f (patch)
treee9b39e6f3670b311070107be5259fda9273b6326 /target/linux/imx
parentpre { line-height: 125%; margin: 0; } td.linenos pre { color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px; } span.linenos { color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px; } td.linenos pre.special { color: #000000; background-color: #ffffc0; padding: 0 5px 0 5px; } span.linenos.special { color: #000000; background-color: #ffffc0; padding: 0 5px 0 5px; } .highlight .hll { background-color: #ffffcc } .highlight { background: #ffffff; } .highlight .c { color: #888888 } /* Comment */ .highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */ .highlight .k { color: #008800; font-weight: bold } /* Keyword */ .highlight .ch { color: #888888 } /* Comment.Hashbang */ .highlight .cm { color: #888888 } /* Comment.Multiline */ .highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */ .highlight .cpf { color: #888888 } /* Comment.PreprocFile */ .highlight .c1 { color: #888888 } /* Comment.Single */ .highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */ .highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */ .highlight .ge { font-style: italic } /* Generic.Emph */ .highlight .gr { color: #aa0000 } /* Generic.Error */ .highlight .gh { color: #333333 } /* Generic.Heading */ .highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */ .highlight .go { color: #888888 } /* Generic.Output */ .highlight .gp { color: #555555 } /* Generic.Prompt */ .highlight .gs { font-weight: bold } /* Generic.Strong */ .highlight .gu { color: #666666 } /* Generic.Subheading */ .highlight .gt { color: #aa0000 } /* Generic.Traceback */ .highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */ .highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */ .highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */ .highlight .kp { color: #008800 } /* Keyword.Pseudo */ .highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */ .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
#
# Copyright (C) 2006-2015 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk

PKG_NAME:=mtd-utils
PKG_VERSION:=2.0.2

PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=ftp://ftp.infradead.org/pub/mtd-utils/
PKG_HASH:=fb3de61be8e932abb424e8ea3c30298f553d5f970ad158a737bb303bbf9660b8

PKG_FIXUP:=autoreconf

include $(INCLUDE_DIR)/host-build.mk

ifneq ($(HOST_OS),Linux)
  HOST_CFLAGS += \
	-I$(CURDIR)/include \
	-Dloff_t=off_t \
	-D__BYTE_ORDER=BYTE_ORDER \
	-include endian.h \
	-DNO_NATIVE_SUPPORT \
	-include fls.h
endif

HOST_CONFIGURE_VARS+= \
	UUID_CFLAGS="-I$(STAGING_DIR_HOST)/include/e2fsprogs/uuid"

HOST_CONFIGURE_ARGS+= \
	--disable-tests \
	--without-xattr \
	--without-lzo

HOST_MAKE_FLAGS += \
	PROGRAMS="mkfs.jffs2 ubinize mkfs.ubifs"

define Host/Install
	$(CP) \
		$(HOST_BUILD_DIR)/mkfs.jffs2 \
		$(HOST_BUILD_DIR)/mkfs.ubifs \
		$(HOST_BUILD_DIR)/ubinize \
		$(STAGING_DIR_HOST)/bin/
endef

define Host/Clean
	rm -f $(STAGING_DIR_HOST)/bin/{mkfs.jffs2,mkfs.ubifs,ubinize}
/>
5 files changed, 98 insertions, 5 deletions
diff --git a/target/linux/imx/cortexa7/base-files/etc/board.d/02_network b/target/linux/imx/cortexa7/base-files/etc/board.d/02_network
index 75d1c7d1d80..8ada58e6c1f 100644
--- a/target/linux/imx/cortexa7/base-files/etc/board.d/02_network
+++ b/target/linux/imx/cortexa7/base-files/etc/board.d/02_network
@@ -5,6 +5,9 @@ board=$(board_name)
board_config_update
case "$board" in
+technexion,imx7d-pico-pi)
+ ucidef_set_interface_lan "eth0"
+ ;;
*)
ucidef_set_interfaces_lan_wan "eth0" "eth1"
;;
diff --git a/target/linux/imx/cortexa7/base-files/lib/preinit/79_move_config b/target/linux/imx/cortexa7/base-files/lib/preinit/79_move_config
new file mode 100644
index 00000000000..7bdb2d5499a
--- /dev/null
+++ b/target/linux/imx/cortexa7/base-files/lib/preinit/79_move_config
@@ -0,0 +1,15 @@
+. /lib/imx.sh
+. /lib/functions.sh
+. /lib/upgrade/common.sh
+
+move_config() {
+ local board=$(board_name)
+
+ case "$board" in
+ technexion,imx7d-pico-pi)
+ imx_sdcard_move_config
+ ;;
+ esac
+}
+
+boot_hook_add preinit_mount_root move_config
diff --git a/target/linux/imx/cortexa7/base-files/lib/upgrade/platform.sh b/target/linux/imx/cortexa7/base-files/lib/upgrade/platform.sh
index 9a613c43b1a..1bdc2aa4b93 100644
--- a/target/linux/imx/cortexa7/base-files/lib/upgrade/platform.sh
+++ b/target/linux/imx/cortexa7/base-files/lib/upgrade/platform.sh
@@ -1,16 +1,55 @@
-PART_NAME=firmware
-REQUIRE_IMAGE_METADATA=1
+. /lib/imx.sh
+
+RAMFS_COPY_BIN='blkid jffs2reset'
+
+enable_image_metadata_check() {
+ case "$(board_name)" in
+ technexion,imx7d-pico-pi)
+ REQUIRE_IMAGE_METADATA=1
+ ;;
+ esac
+}
+enable_image_metadata_check
platform_check_image() {
- return 0
+ local board=$(board_name)
+
+ case "$board" in
+ technexion,imx7d-pico-pi)
+ return 0
+ ;;
+ esac
+
+ echo "Sysupgrade is not yet supported on $board."
+ return 1
}
platform_do_upgrade() {
local board=$(board_name)
case "$board" in
- *)
- default_do_upgrade "$1"
+ technexion,imx7d-pico-pi)
+ imx_sdcard_do_upgrade "$1"
+ ;;
+ esac
+}
+
+platform_copy_config() {
+ local board=$(board_name)
+
+ case "$board" in
+ technexion,imx7d-pico-pi)
+ imx_sdcard_copy_config
+ ;;
+ esac
+}
+
+platform_pre_upgrade() {
+ local board=$(board_name)
+
+ case "$board" in
+ technexion,imx7d-pico-pi)
+ imx_sdcard_pre_upgrade
;;
esac
}
diff --git a/target/linux/imx/image/bootscript-technexion_imx7d-pico-pi b/target/linux/imx/image/bootscript-technexion_imx7d-pico-pi
new file mode 100644
index 00000000000..7521cce7f1c
--- /dev/null
+++ b/target/linux/imx/image/bootscript-technexion_imx7d-pico-pi
@@ -0,0 +1,18 @@
+echo "PICO-PI-IMX7 OpenWrt boot script"
+
+# Initial setup, avoid overwriting environment every boot
+if test ${bootm_boot_mode} != nonsec; then setenv bootm_boot_mode nonsec; setenv bootcmd run bootcmd_mmc0; saveenv; fi
+
+# Set console variable for both UART and HDMI
+setenv console "console=ttymxc4,115200 console=tty0 video=DPI-1:800x480-32"
+setenv fdt_name imx7d-pico-pi.dtb
+setenv mmcdev 0
+setenv mmcrootpart 2
+part uuid mmc ${mmcdev}:${mmcrootpart} uuid
+
+# Boot from eMMC is the only supported option
+setenv bootargs "${console} root=PARTUUID=${uuid} rw rootwait"
+mmc dev ${mmcdev}
+load ${devtype} ${mmcdev}:${devplist} ${kernel_addr_r} /uImage
+load ${devtype} ${mmcdev}:${devplist} ${fdt_addr_r} /${fdt_name}
+bootm ${kernel_addr_r} - ${fdt_addr_r}
diff --git a/target/linux/imx/image/cortexa7.mk b/target/linux/imx/image/cortexa7.mk
index 9b2159c5406..b4ac1b6904d 100644
--- a/target/linux/imx/image/cortexa7.mk
+++ b/target/linux/imx/image/cortexa7.mk
@@ -1,3 +1,5 @@
+DEVICE_VARS += UBOOT
+
include common.mk
define Device/Default
@@ -10,3 +12,19 @@ define Device/Default
KERNEL_LOADADDR := 0x80008000
IMAGES :=
endef
+
+define Device/technexion_imx7d-pico-pi
+ DEVICE_VENDOR := TechNexion
+ DEVICE_MODEL := PICO-PI-IMX7D
+ UBOOT := pico-pi-imx7d
+ DEVICE_DTS := imx7d-pico-pi
+ DEVICE_PACKAGES := kmod-sound-core kmod-sound-soc-imx kmod-sound-soc-imx-sgtl5000 \
+ kmod-can kmod-can-flexcan kmod-can-raw kmod-leds-gpio \
+ kmod-input-touchscreen-edt-ft5x06 kmod-usb-hid kmod-btsdio \
+ kmod-brcmfmac cypress-firmware-4339-sdio cypress-nvram-4339-pico-pi-imx7d
+ FILESYSTEMS := squashfs
+ IMAGES := combined.bin sysupgrade.bin
+ IMAGE/combined.bin := append-rootfs | pad-extra 128k | imx-sdcard-raw-uboot
+ IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
+endef
+TARGET_DEVICES += technexion_imx7d-pico-pi