summaryrefslogtreecommitdiffstats
path: root/configs/platform-mipsel/rules
diff options
context:
space:
mode:
authorOleksij Rempel <o.rempel@pengutronix.de>2021-07-08 06:16:28 +0200
committerRobert Schwebel <r.schwebel@pengutronix.de>2021-07-16 07:28:06 +0200
commiteaf7839876093a6c34f8c2ee4562bff1ffcdee34 (patch)
treeaa458cd7298cf202107655413004bb6b9591d4f2 /configs/platform-mipsel/rules
parent19cf676d19101eac7342c35969d87820b4c426f1 (diff)
downloadDistroKit-eaf7839876093a6c34f8c2ee4562bff1ffcdee34.tar.gz
DistroKit-eaf7839876093a6c34f8c2ee4562bff1ffcdee34.tar.xz
platform-mipsel: add basic qemu malta support
Add MIPSEL (MIPS little-endian 32bit) platform. Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Link: https://lore.pengutronix.de/20210708041628.17608-1-o.rempel@pengutronix.de Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de>
Diffstat (limited to 'configs/platform-mipsel/rules')
-rw-r--r--configs/platform-mipsel/rules/barebox-common.make84
-rw-r--r--configs/platform-mipsel/rules/barebox-malta.make112
-rw-r--r--configs/platform-mipsel/rules/blspec-malta.make37
-rw-r--r--configs/platform-mipsel/rules/host-qemu.make233
-rw-r--r--configs/platform-mipsel/rules/image-malta.make32
-rw-r--r--configs/platform-mipsel/rules/kernel-malta.make115
-rw-r--r--configs/platform-mipsel/rules/kernel.make82
7 files changed, 695 insertions, 0 deletions
diff --git a/configs/platform-mipsel/rules/barebox-common.make b/configs/platform-mipsel/rules/barebox-common.make
new file mode 100644
index 0000000..d0caead
--- /dev/null
+++ b/configs/platform-mipsel/rules/barebox-common.make
@@ -0,0 +1,84 @@
+# -*-makefile-*-
+#
+# Copyright (C) 2019 Roland Hieber <rhi@pengutronix.de>
+#
+# For further information about the PTXdist project and license conditions
+# see the README file.
+#
+
+#
+# We provide this package
+#
+PACKAGES-$(PTXCONF_BAREBOX_COMMON) += barebox-common
+
+#
+# Paths and names
+#
+BAREBOX_COMMON_VERSION := $(call remove_quotes,$(PTXCONF_BAREBOX_COMMON_VERSION))
+BAREBOX_COMMON_MD5 := $(call remove_quotes,$(PTXCONF_BAREBOX_COMMON_MD5))
+BAREBOX_COMMON := barebox-common-$(BAREBOX_COMMON_VERSION)
+BAREBOX_COMMON_SUFFIX := tar.bz2
+BAREBOX_COMMON_URL := $(call barebox-url, BAREBOX_COMMON)
+BAREBOX_COMMON_PATCHES := barebox-$(BAREBOX_COMMON_VERSION)
+BAREBOX_COMMON_SOURCE := $(SRCDIR)/$(BAREBOX_COMMON_PATCHES).$(BAREBOX_COMMON_SUFFIX)
+BAREBOX_COMMON_DIR := $(BUILDDIR)/$(BAREBOX_COMMON)
+BAREBOX_COMMON_BUILD_DIR := $(BAREBOX_COMMON_DIR)-build
+BAREBOX_COMMON_CONFIG := $(call ptx/in-platformconfigdir, barebox.config)
+BAREBOX_COMMON_LICENSE := GPL-2.0-only
+BAREBOX_COMMON_BUILD_OOT := KEEP
+
+# ----------------------------------------------------------------------------
+# Prepare
+# ----------------------------------------------------------------------------
+
+# use host pkg-config for host tools
+BAREBOX_COMMON_PATH := PATH=$(HOST_PATH)
+
+BAREBOX_COMMON_CONF_OPT := \
+ -C $(BAREBOX_COMMON_DIR) \
+ O=$(BAREBOX_COMMON_BUILD_DIR) \
+ BUILDSYSTEM_VERSION=$(PTXDIST_VCS_VERSION) \
+ $(call barebox-opts, BAREBOX_COMMON)
+
+BAREBOX_COMMON_MAKE_OPT := $(BAREBOX_COMMON_CONF_OPT)
+
+BAREBOX_COMMON_TAGS_OPT := TAGS tags cscope
+
+ifdef PTXCONF_BAREBOX_COMMON
+$(BAREBOX_COMMON_CONFIG):
+ @echo
+ @echo "****************************************************************************"
+ @echo " Please generate a bareboxconfig with 'ptxdist menuconfig barebox-common'"
+ @echo "****************************************************************************"
+ @echo
+ @echo
+ @exit 1
+endif
+
+# ----------------------------------------------------------------------------
+# Compile
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/barebox-common.compile:
+ @$(call targetinfo)
+ @$(call touch)
+
+# ----------------------------------------------------------------------------
+# Install
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/barebox-common.install:
+ @$(call targetinfo)
+ @$(call touch)
+
+# ----------------------------------------------------------------------------
+# oldconfig / menuconfig
+# ----------------------------------------------------------------------------
+
+barebox-common_menuconfig barebox-common_nconfig: $(STATEDIR)/barebox-common.extract
+ @$(call world/kconfig, BAREBOX_COMMON, $(subst barebox-common_,,$@))
+
+barebox-common_do_oldconfig: $(STATEDIR)/barebox-common.extract
+ @$(call world/kconfig, BAREBOX_COMMON, oldconfig)
+
+# vim: syntax=make
diff --git a/configs/platform-mipsel/rules/barebox-malta.make b/configs/platform-mipsel/rules/barebox-malta.make
new file mode 100644
index 0000000..d9a63fa
--- /dev/null
+++ b/configs/platform-mipsel/rules/barebox-malta.make
@@ -0,0 +1,112 @@
+# -*-makefile-*-
+#
+# Copyright (C) 2017 by Robert Schwebel <r.schwebel@pengutronix.de>
+# Copyright (C) 2020 by Oleksij Rempel <o.rempel@pengutronix.de>
+#
+# For further information about the PTXdist project and license conditions
+# see the README file.
+#
+
+#
+# We provide this package
+#
+PACKAGES-$(PTXCONF_BAREBOX_MALTA) += barebox-malta
+
+#
+# Paths and names
+#
+BAREBOX_MALTA_VERSION := $(call remove_quotes,$(PTXCONF_BAREBOX_COMMON_VERSION))
+BAREBOX_MALTA_MD5 := $(call remove_quotes,$(PTXCONF_BAREBOX_COMMON_MD5))
+BAREBOX_MALTA := barebox-malta-$(BAREBOX_MALTA_VERSION)
+BAREBOX_MALTA_SUFFIX := tar.bz2
+BAREBOX_MALTA_URL := $(call barebox-url, BAREBOX_MALTA)
+BAREBOX_MALTA_PATCHES := barebox-$(BAREBOX_MALTA_VERSION)
+BAREBOX_MALTA_SOURCE := $(SRCDIR)/$(BAREBOX_MALTA_PATCHES).$(BAREBOX_MALTA_SUFFIX)
+BAREBOX_MALTA_DIR := $(BUILDDIR)/$(BAREBOX_MALTA)
+BAREBOX_MALTA_BUILD_DIR := $(BAREBOX_MALTA_DIR)-build
+BAREBOX_MALTA_CONFIG := $(call ptx/in-platformconfigdir, barebox-malta.config)
+BAREBOX_MALTA_REF_CONFIG := $(call ptx/in-platformconfigdir, barebox.config)
+BAREBOX_MALTA_LICENSE := GPL-2.0-only
+BAREBOX_MALTA_BUILD_OOT := KEEP
+
+# ----------------------------------------------------------------------------
+# Prepare
+# ----------------------------------------------------------------------------
+
+# use host pkg-config for host tools
+BAREBOX_MALTA_PATH := PATH=$(HOST_PATH)
+
+BAREBOX_MALTA_WRAPPER_BLACKLIST := \
+ $(PTXDIST_LOWLEVEL_WRAPPER_BLACKLIST)
+
+BAREBOX_MALTA_CONF_OPT := \
+ -C $(BAREBOX_MALTA_DIR) \
+ O=$(BAREBOX_MALTA_BUILD_DIR) \
+ BUILDSYSTEM_VERSION=$(PTXDIST_VCS_VERSION) \
+ $(call barebox-opts, BAREBOX_MALTA)
+
+BAREBOX_MALTA_MAKE_OPT := $(BAREBOX_MALTA_CONF_OPT)
+
+BAREBOX_MALTA_IMAGES := images/barebox-qemu-malta.img
+BAREBOX_MALTA_IMAGES := $(addprefix $(BAREBOX_MALTA_BUILD_DIR)/,$(BAREBOX_MALTA_IMAGES))
+
+ifdef PTXCONF_BAREBOX_MALTA
+$(BAREBOX_MALTA_CONFIG):
+ @echo
+ @echo "****************************************************************************"
+ @echo " Please generate a bareboxconfig with 'ptxdist menuconfig barebox-malta'"
+ @echo "****************************************************************************"
+ @echo
+ @echo
+ @exit 1
+endif
+
+$(STATEDIR)/barebox-malta.prepare: $(BAREBOX_MALTA_CONFIG)
+ @$(call targetinfo)
+ @$(call world/prepare, BAREBOX_MALTA)
+ @rm -f "$(BAREBOX_MALTA_BUILD_DIR)/.ptxdist-defaultenv"
+ @ln -s "$(call ptx/in-platformconfigdir, barebox-malta-defaultenv)" \
+ "$(BAREBOX_MALTA_BUILD_DIR)/.ptxdist-defaultenv"
+ @$(call touch)
+
+# ----------------------------------------------------------------------------
+# Install
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/barebox-malta.install:
+ @$(call targetinfo)
+ @$(call touch)
+
+# ----------------------------------------------------------------------------
+# Target-Install
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/barebox-malta.targetinstall:
+ @$(call targetinfo)
+ @$(foreach image, $(BAREBOX_MALTA_IMAGES), \
+ install -m 644 \
+ $(image) $(IMAGEDIR)/$(notdir $(image))$(ptx/nl))
+ @install -D -m644 $(BAREBOX_MALTA_BUILD_DIR)/defaultenv/barebox_zero_env $(IMAGEDIR)/barebox-zero-env-malta
+ @install -D -m644 $(BAREBOX_MALTA_BUILD_DIR)/arch/mips/dts/qemu-malta.dtb $(IMAGEDIR)/qemu-malta.dtb-bb
+ @$(call touch)
+
+# ----------------------------------------------------------------------------
+# Clean
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/barebox-malta.clean:
+ @$(call targetinfo)
+ @$(call clean_pkg, BAREBOX_MALTA)
+ @$(foreach image, $(BAREBOX_MALTA_IMAGES), \
+ rm -fv $(IMAGEDIR)/$(notdir $(image))$(ptx/nl))
+ @rm -vf $(IMAGEDIR)/barebox-zero-env-malta \
+ $(IMAGEDIR)/qemu-malta.dtb-bb
+
+# ----------------------------------------------------------------------------
+# oldconfig / menuconfig
+# ----------------------------------------------------------------------------
+
+barebox-malta_oldconfig barebox-malta_menuconfig barebox-malta_nconfig: $(STATEDIR)/barebox-malta.extract
+ @$(call world/kconfig, BAREBOX_MALTA, $(subst barebox-malta_,,$@))
+
+# vim: syntax=make
diff --git a/configs/platform-mipsel/rules/blspec-malta.make b/configs/platform-mipsel/rules/blspec-malta.make
new file mode 100644
index 0000000..e025109
--- /dev/null
+++ b/configs/platform-mipsel/rules/blspec-malta.make
@@ -0,0 +1,37 @@
+# -*-makefile-*-
+#
+# Copyright (C) 2017 by Chris Fiege <c.fiege@pengutronix.de>
+# Copyright (C) 2020 by Oleksij Rempel <o.rempel@pengutronix.de>
+#
+# For further information about the PTXdist project and license conditions
+# see the README file.
+#
+
+#
+# We provide this package
+#
+PACKAGES-$(PTXCONF_BLSPEC_MALTA) += blspec-malta
+
+BLSPEC_MALTA_VERSION := 4.11
+
+# ----------------------------------------------------------------------------
+# Target-Install
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/blspec-malta.targetinstall:
+ @$(call targetinfo)
+
+ @$(call install_init, blspec-malta)
+ @$(call install_fixup,blspec-malta,PRIORITY,optional)
+ @$(call install_fixup,blspec-malta,SECTION,base)
+ @$(call install_fixup,blspec-malta,AUTHOR,"Oleksij Rempel <o.rempel@pengutronix.de>")
+ @$(call install_fixup,blspec-malta,DESCRIPTION,missing)
+
+ @$(call install_alternative, blspec-malta, 0, 0, 0644, \
+ /loader/entries/malta.conf)
+
+ @$(call install_finish,blspec-malta)
+
+ @$(call touch)
+
+# vim: syntax=make
diff --git a/configs/platform-mipsel/rules/host-qemu.make b/configs/platform-mipsel/rules/host-qemu.make
new file mode 100644
index 0000000..a841f4c
--- /dev/null
+++ b/configs/platform-mipsel/rules/host-qemu.make
@@ -0,0 +1,233 @@
+# -*-makefile-*-
+#
+# Copyright (C) 2012 by Bernhard Walle <bernhard@bwalle.de>
+# (C) 2013 by Michael Olbrich <m.olbrich@pengutronix.de>
+# (C) 2013 by Jan Luebbe <j.luebbe@pengutronix.de>
+#
+# For further information about the PTXdist project and license conditions
+# see the README file.
+#
+
+#
+# We provide this package
+#
+HOST_PACKAGES-$(PTXCONF_HOST_QEMU) += host-qemu
+
+#
+# Paths and names
+#
+HOST_QEMU_VERSION := 5.2.0
+HOST_QEMU_MD5 := 179f86928835da857c237b42f4b2df73
+HOST_QEMU := qemu-$(HOST_QEMU_VERSION)
+HOST_QEMU_SUFFIX := tar.xz
+HOST_QEMU_URL := https://download.qemu.org/$(HOST_QEMU).$(HOST_QEMU_SUFFIX)
+HOST_QEMU_SOURCE := $(SRCDIR)/$(HOST_QEMU).$(HOST_QEMU_SUFFIX)
+HOST_QEMU_DIR := $(HOST_BUILDDIR)/$(HOST_QEMU)
+HOST_QEMU_LICENSE := GPL-2.0-only AND GPL-2.0-or-later AND MIT AND BSD-1-Clause AND BSD-2-Clause AND BSD-3-Clause
+HOST_QEMU_BUILD_OOT := YES
+
+# ----------------------------------------------------------------------------
+# Prepare
+# ----------------------------------------------------------------------------
+
+#
+# autoconf
+#
+
+HOST_QEMU_BROKEN_ICECC := \
+ $(call ptx/sh, gcc -dumpversion | awk -F . '{ if ($$1*100 + $$2 < 409) print "y" }')
+
+ifeq ($(HOST_QEMU_BROKEN_ICECC),y)
+HOST_QEMU_MAKE_ENV := PTXDIST_ICECC=$(PTXDIST_ICERUN)
+endif
+HOST_QEMU_MAKE_OPT := V=$(filter 1,$(PTXDIST_VERBOSE))
+
+HOST_QEMU_TARGETS := $(PTXCONF_ARCH_STRING)
+ifndef PTXCONF_ARCH_X86_64
+ifdef PTXCONF_ARCH_X86
+HOST_QEMU_TARGETS := i386
+endif
+endif
+ifdef PTXCONF_ARCH_ARM64
+HOST_QEMU_TARGETS := aarch64
+endif
+ifdef PTXCONF_ARCH_MIPS
+ifdef PTXCONF_ENDIAN_LITTLE
+HOST_QEMU_TARGETS := mipsel
+endif
+endif
+HOST_QEMU_SYS_TARGETS := $(patsubst %,%-softmmu,$(HOST_QEMU_TARGETS))
+HOST_QEMU_USR_TARGETS := $(patsubst %,%-linux-user,$(HOST_QEMU_TARGETS))
+
+HOST_QEMU_CONF_TOOL := autoconf
+# Note: not realy autoconf:
+# e.g. there is --enable-debug but not --disable-debug
+HOST_QEMU_CONF_OPT := \
+ --prefix=/. \
+ --target-list=" \
+ $(call ptx/ifdef, PTXCONF_HOST_QEMU_SYS,$(HOST_QEMU_SYS_TARGETS),) \
+ $(call ptx/ifdef, PTXCONF_HOST_QEMU_USR,$(HOST_QEMU_USR_TARGETS),) \
+ " \
+ --meson=meson \
+ --ninja=ninja \
+ --disable-sanitizers \
+ --disable-tsan \
+ --disable-werror \
+ --enable-stack-protector \
+ --audio-drv-list= \
+ --block-drv-rw-whitelist= \
+ --block-drv-ro-whitelist= \
+ --enable-trace-backends=nop \
+ --disable-tcg-interpreter \
+ --enable-malloc-trim \
+ --with-coroutine= \
+ --tls-priority=NORMAL \
+ --disable-plugins \
+ --disable-containers \
+ --$(call ptx/endis, PTXCONF_HOST_QEMU_SYS)-system \
+ --disable-user \
+ --$(call ptx/endis, PTXCONF_HOST_QEMU_USR)-linux-user \
+ --disable-bsd-user \
+ --disable-docs \
+ --disable-guest-agent \
+ --disable-guest-agent-msi \
+ --enable-pie \
+ --disable-modules \
+ --disable-module-upgrades \
+ --disable-debug-tcg \
+ --disable-debug-info \
+ --disable-sparse \
+ --disable-safe-stack \
+ --disable-gnutls \
+ --disable-nettle \
+ --disable-gcrypt \
+ --disable-auth-pam \
+ --disable-sdl \
+ --disable-sdl-image \
+ --disable-gtk \
+ --disable-vte \
+ --disable-curses \
+ --enable-iconv \
+ --disable-vnc \
+ --disable-vnc-sasl \
+ --disable-vnc-jpeg \
+ --disable-vnc-png \
+ --disable-cocoa \
+ --enable-virtfs \
+ --disable-virtiofsd \
+ --disable-libudev \
+ --disable-mpath \
+ --disable-xen \
+ --disable-xen-pci-passthrough \
+ --disable-brlapi \
+ --disable-curl \
+ --enable-membarrier \
+ --enable-fdt \
+ --enable-kvm \
+ --disable-hax \
+ --disable-hvf \
+ --disable-whpx \
+ --disable-rdma \
+ --disable-pvrdma \
+ --disable-netmap \
+ --disable-linux-aio \
+ --disable-linux-io-uring \
+ --enable-cap-ng \
+ --enable-attr \
+ --enable-vhost-net \
+ --enable-vhost-vsock \
+ --enable-vhost-scsi \
+ --disable-vhost-crypto \
+ --enable-vhost-kernel \
+ --disable-vhost-user \
+ --disable-vhost-user-blk-server \
+ --disable-vhost-vdpa \
+ --disable-spice \
+ --disable-rbd \
+ --disable-libiscsi \
+ --disable-libnfs \
+ --disable-smartcard \
+ --disable-u2f \
+ --$(call ptx/endis, PTXCONF_HOST_QEMU_SYS)-libusb \
+ --disable-live-block-migration \
+ --disable-usb-redir \
+ --disable-lzo \
+ --disable-snappy \
+ --disable-bzip2 \
+ --disable-lzfse \
+ --disable-zstd \
+ --disable-seccomp \
+ --enable-coroutine-pool \
+ --disable-glusterfs \
+ --disable-tpm \
+ --disable-libssh \
+ --disable-numa \
+ --disable-libxml2 \
+ --disable-tcmalloc \
+ --disable-jemalloc \
+ --enable-replication \
+ --disable-opengl \
+ --disable-virglrenderer \
+ --disable-xfsctl \
+ --disable-qom-cast-debug \
+ --disable-tools \
+ --disable-bochs \
+ --disable-cloop \
+ --disable-dmg \
+ --disable-qcow1 \
+ --disable-vdi \
+ --disable-vvfat \
+ --disable-qed \
+ --disable-parallels \
+ --disable-sheepdog \
+ --disable-crypto-afalg \
+ --disable-capstone \
+ --disable-debug-mutex \
+ --disable-libpmem \
+ --disable-xkbcommon \
+ --disable-rng-none \
+ --disable-libdaxctl \
+ \
+ --disable-fuzzing \
+ --disable-keyring
+
+# Use '=' to delay $(shell ...) calls until this is needed
+QEMU_CROSS_QEMU = $(call ptx/get-alternative, config/qemu, qemu-cross)
+QEMU_CROSS_DL = $(shell ptxd_cross_cc_v | sed -n -e 's/.* -dynamic-linker \([^ ]*\).*/\1/p')
+QEMU_CROSS_TOOLEXECLIBDIR = $(shell dirname $$(realpath $$(ptxd_cross_cc -print-file-name=libatomic.so 2> /dev/null)))
+QEMU_CROSS_LD_LIBRARY_PATH = $(PTXDIST_SYSROOT_TOOLCHAIN)/lib:$(QEMU_CROSS_TOOLEXECLIBDIR):$(SYSROOT)/$(CROSS_LIB_DIR):$(SYSROOT)/usr/$(CROSS_LIB_DIR)
+
+QEMU_CROSS_QEMU_ENV = \
+ QEMU="$(PTXDIST_SYSROOT_HOST)/bin/qemu-$(HOST_QEMU_TARGETS)" \
+ KERNEL_VERSION="$(KERNEL_VERSION)" \
+ QEMU_LD_PREFIX="$(PTXDIST_SYSROOT_TOOLCHAIN)" \
+ QEMU_LD_LIBRARY_PATH="$(QEMU_CROSS_LD_LIBRARY_PATH)" \
+ LINKER="$(shell readlink -f "$$(ptxd_cross_cc -print-file-name=$$(ptxd_get_dl))")"
+
+$(STATEDIR)/host-qemu.install:
+ @$(call targetinfo)
+ @$(call world/install, HOST_QEMU)
+ifdef PTXCONF_HOST_QEMU_SYS
+# # necessary for qemu to find its ROM files
+ @ln -vsf share/qemu $(HOST_QEMU_PKGDIR)/pc-bios
+endif
+ @$(call touch)
+
+$(STATEDIR)/host-qemu.install.post:
+ @$(call targetinfo)
+ @$(call world/install.post, HOST_QEMU)
+ifdef PTXCONF_HOST_QEMU_USR
+ @$(QEMU_CROSS_QEMU_ENV) ptxd_replace_magic $(QEMU_CROSS_QEMU) > $(PTXDIST_SYSROOT_CROSS)/bin/qemu-cross
+ @chmod +x $(PTXDIST_SYSROOT_CROSS)/bin/qemu-cross
+ @install -d -m 755 $(PTXDIST_SYSROOT_CROSS)/bin/qemu/
+ @sed \
+ -e 's|RTLDLIST=.*|RTLDLIST="$(PTXDIST_SYSROOT_TOOLCHAIN)$(QEMU_CROSS_DL)"|' \
+ -e 's|eval $$add_env|eval $(PTXDIST_SYSROOT_CROSS)/bin/qemu-cross -E "$${add_env// /,}"|' \
+ -e 's|verify_out=`|verify_out=`$(PTXDIST_SYSROOT_CROSS)/bin/qemu-cross |' \
+ -e 's|#! */.*$$|#!$(shell readlink $(PTXDIST_TOPDIR)/bin/bash)|' \
+ $(PTXDIST_SYSROOT_TOOLCHAIN)/usr/bin/ldd > $(PTXDIST_SYSROOT_CROSS)/bin/qemu/ldd
+ @chmod +x $(PTXDIST_SYSROOT_CROSS)/bin/qemu/ldd
+endif
+ @$(call touch)
+
+# vim: syntax=make
diff --git a/configs/platform-mipsel/rules/image-malta.make b/configs/platform-mipsel/rules/image-malta.make
new file mode 100644
index 0000000..c005c9e
--- /dev/null
+++ b/configs/platform-mipsel/rules/image-malta.make
@@ -0,0 +1,32 @@
+# -*-makefile-*-
+#
+# Copyright (C) 2017 by Chris Fiege <c.fiege@pengutronix.de>
+# Copyright (C) 2020 by Oleksij Rempel <o.rempel@pengutronix.de>
+#
+# For further information about the PTXdist project and license conditions
+# see the README file.
+#
+
+#
+# We provide this package
+#
+IMAGE_PACKAGES-$(PTXCONF_IMAGE_MALTA) += image-malta
+
+#
+# Paths and names
+#
+IMAGE_MALTA := image-malta
+IMAGE_MALTA_DIR := $(BUILDDIR)/$(IMAGE_MALTA)
+IMAGE_MALTA_IMAGE := $(IMAGEDIR)/malta.hdimg
+IMAGE_MALTA_CONFIG := malta.config
+
+# ----------------------------------------------------------------------------
+# Image
+# ----------------------------------------------------------------------------
+
+$(IMAGE_MALTA_IMAGE):
+ @$(call targetinfo)
+ @$(call image/genimage, IMAGE_MALTA)
+ @$(call finish)
+
+# vim: syntax=make
diff --git a/configs/platform-mipsel/rules/kernel-malta.make b/configs/platform-mipsel/rules/kernel-malta.make
new file mode 100644
index 0000000..cfb3874
--- /dev/null
+++ b/configs/platform-mipsel/rules/kernel-malta.make
@@ -0,0 +1,115 @@
+# -*-makefile-*-
+#
+# Copyright (C) 2020 by Oleksij Rempel <o.rempel@pengutronix.de>
+#
+# For further information about the PTXdist project and license conditions
+# see the README file.
+#
+
+#
+# We provide this package
+#
+PACKAGES-$(PTXCONF_KERNEL_MALTA) += kernel-malta
+
+#
+# Paths and names
+#
+KERNEL_MALTA_VERSION := $(KERNEL_VERSION)
+KERNEL_MALTA_MD5 := $(call remove_quotes,$(PTXCONF_KERNEL_MD5))
+KERNEL_MALTA := linux-malta-$(KERNEL_MALTA_VERSION)
+KERNEL_MALTA_SUFFIX := tar.xz
+KERNEL_MALTA_URL := $(call kernel-url, KERNEL_MALTA)
+KERNEL_MALTA_PATCHES := linux-$(KERNEL_MALTA_VERSION)
+KERNEL_MALTA_SOURCE := $(SRCDIR)/$(KERNEL_MALTA_PATCHES).$(KERNEL_MALTA_SUFFIX)
+KERNEL_MALTA_DIR := $(BUILDDIR)/$(KERNEL_MALTA)
+KERNEL_MALTA_BUILD_DIR := $(KERNEL_MALTA_DIR)-build
+KERNEL_MALTA_CONFIG := $(call ptx/in-platformconfigdir, kernelconfig-malta)
+KERNEL_MALTA_REF_CONFIG := $(call ptx/in-platformconfigdir, kernelconfig)
+KERNEL_MALTA_LICENSE := GPL-2.0-only
+KERNEL_MALTA_BUILD_OOT := KEEP
+
+# ----------------------------------------------------------------------------
+# Prepare
+# ----------------------------------------------------------------------------
+
+# use CONFIG_CC_STACKPROTECTOR if available. The rest makes no sense for the kernel
+KERNEL_MALTA_WRAPPER_BLACKLIST := \
+ $(PTXDIST_LOWLEVEL_WRAPPER_BLACKLIST)
+
+KERNEL_MALTA_CONF_OPT := \
+ -C $(KERNEL_MALTA_DIR) \
+ O=$(KERNEL_MALTA_BUILD_DIR) \
+ $(call kernel-opts, KERNEL_MALTA)
+
+# no gcc plugins; avoid config changes depending on the host compiler
+KERNEL_MALTA_CONF_OPT += \
+ HOSTCXX=false
+
+KERNEL_MALTA_IMAGES := vmlinuz
+KERNEL_MALTA_IMAGES := $(addprefix $(KERNEL_MALTA_BUILD_DIR)/,$(KERNEL_MALTA_IMAGES))
+
+ifdef PTXCONF_KERNEL_MALTA
+$(KERNEL_MALTA_CONFIG):
+ @echo
+ @echo "*************************************************************************"
+ @echo " Please generate a kernelconfig with 'ptxdist menuconfig kernel-malta'"
+ @echo "*************************************************************************"
+ @echo
+ @echo
+ @exit 1
+endif
+
+# ----------------------------------------------------------------------------
+# Compile
+# ----------------------------------------------------------------------------
+
+KERNEL_MALTA_MAKE_OPT := \
+ $(KERNEL_MALTA_CONF_OPT) \
+ vmlinuz modules
+
+# ----------------------------------------------------------------------------
+# Install
+# ----------------------------------------------------------------------------
+
+KERNEL_MALTA_INSTALL_OPT := \
+ $(call kernel-opts, KERNEL_MALTA) \
+ modules_install
+
+$(STATEDIR)/kernel-malta.install:
+ @$(call targetinfo)
+ @$(call world/install, KERNEL_MALTA)
+ @$(foreach image, $(KERNEL_MALTA_IMAGES), \
+ install -m 644 $(image) $(IMAGEDIR)/$(notdir $(image))-malta$(ptx/nl))
+ @$(call touch)
+
+# ----------------------------------------------------------------------------
+# Target-Install
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/kernel-malta.targetinstall:
+ @$(call targetinfo)
+
+ @$(call install_init, kernel-malta)
+ @$(call install_fixup, kernel-malta, PRIORITY,optional)
+ @$(call install_fixup, kernel-malta, SECTION,base)
+ @$(call install_fixup, kernel-malta, AUTHOR,"Oleksij Rempel <o.rempel@pengutronix.de>")
+ @$(call install_fixup, kernel-malta, DESCRIPTION,missing)
+
+ @$(call install_copy, kernel-malta, 0, 0, 0644, \
+ $(IMAGEDIR)/vmlinuz-malta, /boot/vmlinuz-malta, n)
+
+ @$(call install_glob, kernel-malta, 0, 0, -, /lib/modules, *.ko,, n)
+ @$(call install_glob, kernel-malta, 0, 0, -, /lib/modules,, *.ko */build */source, n)
+
+ @$(call install_finish, kernel-malta)
+
+ @$(call touch)
+
+# ----------------------------------------------------------------------------
+# oldconfig / menuconfig
+# ----------------------------------------------------------------------------
+
+kernel-malta_oldconfig kernel-malta_menuconfig kernel-malta_nconfig: $(STATEDIR)/kernel-malta.extract
+ @$(call world/kconfig, KERNEL_MALTA, $(subst kernel-malta_,,$@))
+
+# vim: syntax=make
diff --git a/configs/platform-mipsel/rules/kernel.make b/configs/platform-mipsel/rules/kernel.make
new file mode 100644
index 0000000..a9eb0f2
--- /dev/null
+++ b/configs/platform-mipsel/rules/kernel.make
@@ -0,0 +1,82 @@
+# -*-makefile-*-
+#
+# Copyright (C) 2002-2009 by Pengutronix e.K., Hildesheim, Germany
+# 2010 by Marc Kleine-Budde <mkl@pengutronix.de>
+#
+# For further information about the PTXdist project and license conditions
+# see the README file.
+#
+
+#
+# We provide this package
+#
+PACKAGES-$(PTXCONF_KERNEL) += kernel
+
+#
+# Paths and names
+#
+KERNEL := linux-$(KERNEL_VERSION)
+KERNEL_MD5 := $(call remove_quotes,$(PTXCONF_KERNEL_MD5))
+ifneq ($(KERNEL_NEEDS_GIT_URL),y)
+KERNEL_SUFFIX := tar.xz
+KERNEL_URL := $(call kernel-url, KERNEL)
+else
+KERNEL_SUFFIX := tar.gz
+KERNEL_URL := https://git.kernel.org/torvalds/t/$(KERNEL).$(KERNEL_SUFFIX)
+endif
+KERNEL_DIR := $(BUILDDIR)/$(KERNEL)
+KERNEL_BUILD_DIR := $(KERNEL_DIR)-build
+KERNEL_CONFIG := $(call ptx/in-platformconfigdir, kernelconfig)
+KERNEL_LICENSE := GPL-2.0-only
+KERNEL_SOURCE := $(SRCDIR)/$(KERNEL).$(KERNEL_SUFFIX)
+KERNEL_DEVPKG := NO
+KERNEL_BUILD_OOT := KEEP
+
+# ----------------------------------------------------------------------------
+# Prepare
+# ----------------------------------------------------------------------------
+
+KERNEL_CONF_OPT := \
+ -C $(KERNEL_DIR) \
+ O=$(KERNEL_BUILD_DIR) \
+ $(call kernel-opts, KERNEL)
+
+# no gcc plugins; avoid config changes depending on the host compiler
+KERNEL_CONF_OPT += \
+ HOSTCXX=false
+
+ifdef PTXCONF_KERNEL
+$(KERNEL_CONFIG):
+ @echo
+ @echo "*************************************************************************"
+ @echo "**** Please generate a kernelconfig with 'ptxdist menuconfig kernel' ****"
+ @echo "*************************************************************************"
+ @echo
+ @echo
+ @exit 1
+endif
+
+# ----------------------------------------------------------------------------
+# Compile
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/kernel.compile:
+ @$(call targetinfo)
+ @$(call touch)
+
+# ----------------------------------------------------------------------------
+# Install
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/kernel.install:
+ @$(call targetinfo)
+ @$(call touch)
+
+# ----------------------------------------------------------------------------
+# oldconfig / menuconfig
+# ----------------------------------------------------------------------------
+
+kernel_oldconfig kernel_menuconfig kernel_nconfig: $(STATEDIR)/kernel.extract
+ @$(call world/kconfig, KERNEL, $(subst kernel_,,$@))
+
+# vim: syntax=make