aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/malta
diff options
context:
space:
mode:
authorJames <>2015-11-04 11:49:21 +0000
committerJames <>2015-11-04 11:49:21 +0000
commit716ca530e1c4515d8683c9d5be3d56b301758b66 (patch)
tree700eb5bcc1a462a5f21dcec15ce7c97ecfefa772 /target/linux/malta
downloadtrunk-47381-master.tar.gz
trunk-47381-master.tar.bz2
trunk-47381-master.zip
trunk-47381HEADmaster
Diffstat (limited to 'target/linux/malta')
-rw-r--r--target/linux/malta/Makefile22
-rw-r--r--target/linux/malta/README13
-rw-r--r--target/linux/malta/base-files/etc/inittab7
-rw-r--r--target/linux/malta/base-files/etc/uci-defaults/02-network9
-rw-r--r--target/linux/malta/be/config-default9
-rw-r--r--target/linux/malta/be/target.mk10
-rw-r--r--target/linux/malta/be64/config-default30
-rw-r--r--target/linux/malta/be64/target.mk10
-rw-r--r--target/linux/malta/config-3.18256
-rw-r--r--target/linux/malta/image/Makefile55
-rw-r--r--target/linux/malta/le/config-default9
-rw-r--r--target/linux/malta/le/target.mk10
-rw-r--r--target/linux/malta/le64/config-default30
-rw-r--r--target/linux/malta/le64/target.mk10
-rw-r--r--target/linux/malta/patches/330-MIPS-Malta-Mark-kernel-code-and-kernel-data-segments.patch34
15 files changed, 514 insertions, 0 deletions
diff --git a/target/linux/malta/Makefile b/target/linux/malta/Makefile
new file mode 100644
index 0000000..8392738
--- /dev/null
+++ b/target/linux/malta/Makefile
@@ -0,0 +1,22 @@
+#
+# Copyright (C) 2010-2011 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+include $(TOPDIR)/rules.mk
+
+BOARD:=malta
+BOARDNAME:=MIPS Malta CoreLV board (qemu)
+CPU_TYPE:=24kc
+SUBTARGETS:=le be #le64 be64
+INITRAMFS_EXTRA_FILES:=
+MAINTAINER:=Florian Fainelli <florian@openwrt.org>
+
+KERNEL_PATCHVER:=3.18
+
+include $(INCLUDE_DIR)/target.mk
+
+DEFAULT_PACKAGES += wpad-mini kmod-mac80211-hwsim kmod-pcnet32
+
+$(eval $(call BuildTarget))
diff --git a/target/linux/malta/README b/target/linux/malta/README
new file mode 100644
index 0000000..22bdff5
--- /dev/null
+++ b/target/linux/malta/README
@@ -0,0 +1,13 @@
+This Malta target is intended to be used with the Qemu emulator. It can be used
+to prototype an OpenWrt firmware for MIPS processors. One could also use it to
+troubleshoot MIPS applications without access to real hardware.
+
+To use the images built by OpenWrt with qemu, use the following commands:
+
+For the little-endian image:
+qemu-system-mipsel -kernel bin/malta/openwrt-malta-le-vmlinux-initramfs.elf -nographic -m 256
+
+For the big-endian image:
+qemu-system-mips -kernel bin/malta/openwrt-malta-be-vmlinux-initramfs.elf -nographic -m 256
+
+and enjoy the system bootin.
diff --git a/target/linux/malta/base-files/etc/inittab b/target/linux/malta/base-files/etc/inittab
new file mode 100644
index 0000000..88567b2
--- /dev/null
+++ b/target/linux/malta/base-files/etc/inittab
@@ -0,0 +1,7 @@
+::sysinit:/etc/init.d/rcS S boot
+::shutdown:/etc/init.d/rcS K shutdown
+tts/0::askfirst:/bin/ash --login
+ttyS0::askfirst:/bin/ash --login
+ttyS1::askfirst:/bin/ash --login
+ttyS2::askfirst:/bin/ash --login
+tty1::askfirst:/bin/ash --login
diff --git a/target/linux/malta/base-files/etc/uci-defaults/02-network b/target/linux/malta/base-files/etc/uci-defaults/02-network
new file mode 100644
index 0000000..7b3e225
--- /dev/null
+++ b/target/linux/malta/base-files/etc/uci-defaults/02-network
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+. /lib/functions/uci-defaults.sh
+
+ucidef_set_interface_loopback
+ucidef_set_interface_wan "eth0"
+if [ -d "/sys/class/net/eth1" ]; then
+ ucidef_set_interface_lan "eth1"
+fi
diff --git a/target/linux/malta/be/config-default b/target/linux/malta/be/config-default
new file mode 100644
index 0000000..2772ed7
--- /dev/null
+++ b/target/linux/malta/be/config-default
@@ -0,0 +1,9 @@
+CONFIG_CPU_BIG_ENDIAN=y
+# CONFIG_CPU_LITTLE_ENDIAN is not set
+CONFIG_CPU_MIPS32=y
+# CONFIG_CPU_MIPS32_R1 is not set
+CONFIG_CPU_MIPS32_R2=y
+# CONFIG_CPU_MIPS64_R1 is not set
+# CONFIG_CPU_MIPS64_R2 is not set
+CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
+# CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set
diff --git a/target/linux/malta/be/target.mk b/target/linux/malta/be/target.mk
new file mode 100644
index 0000000..92ae58e
--- /dev/null
+++ b/target/linux/malta/be/target.mk
@@ -0,0 +1,10 @@
+ARCH:=mips
+ARCH_PACKAGES:=malta_mips
+SUBTARGET:=be
+BOARDNAME:=Big Endian
+FEATURES:=ramdisk mips16
+
+define Target/Description
+ Build BE firmware images for MIPS Malta CoreLV board running in
+ big-endian mode
+endef
diff --git a/target/linux/malta/be64/config-default b/target/linux/malta/be64/config-default
new file mode 100644
index 0000000..b424c3e
--- /dev/null
+++ b/target/linux/malta/be64/config-default
@@ -0,0 +1,30 @@
+# CONFIG_32BIT is not set
+CONFIG_64BIT=y
+CONFIG_ARCH_DMA_ADDR_T_64BIT=y
+CONFIG_ARCH_WANT_COMPAT_IPC_PARSE_VERSION=y
+CONFIG_ARCH_WANT_OLD_COMPAT_IPC=y
+CONFIG_BINFMT_ELF32=y
+CONFIG_BLOCK_COMPAT=y
+CONFIG_COMPAT=y
+CONFIG_COMPAT_NETLINK_MESSAGES=y
+CONFIG_CPU_BIG_ENDIAN=y
+# CONFIG_CPU_LITTLE_ENDIAN is not set
+# CONFIG_CPU_MIPS32_R1 is not set
+# CONFIG_CPU_MIPS32_R2 is not set
+CONFIG_CPU_MIPS64=y
+CONFIG_CPU_MIPS64_R1=y
+# CONFIG_CPU_MIPS64_R2 is not set
+CONFIG_CPU_MIPSR1=y
+CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
+CONFIG_CPU_SUPPORTS_64BIT_KERNEL=y
+CONFIG_CPU_SUPPORTS_HUGEPAGES=y
+CONFIG_HAVE_64BIT_ALIGNED_ACCESS=y
+CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE=y
+# CONFIG_HUGETLBFS is not set
+CONFIG_MIPS32_COMPAT=y
+CONFIG_MIPS32_N32=y
+CONFIG_MIPS32_O32=y
+CONFIG_MODULES_USE_ELF_RELA=y
+CONFIG_PHYS_ADDR_T_64BIT=y
+CONFIG_SYSVIPC_COMPAT=y
+CONFIG_SYS_SUPPORTS_HUGETLBFS=y
diff --git a/target/linux/malta/be64/target.mk b/target/linux/malta/be64/target.mk
new file mode 100644
index 0000000..dad3a1c
--- /dev/null
+++ b/target/linux/malta/be64/target.mk
@@ -0,0 +1,10 @@
+ARCH:=mips64
+ARCH_PACKAGES:=malta_mips64
+SUBTARGET:=be64
+BOARDNAME:=Big Endian (64-bits)
+FEATURES:=ramdisk
+
+define Target/Description
+ Build BE firmware images for MIPS Malta CoreLV board running in
+ big-endian and 64-bits mode
+endef
diff --git a/target/linux/malta/config-3.18 b/target/linux/malta/config-3.18
new file mode 100644
index 0000000..09d3ab3
--- /dev/null
+++ b/target/linux/malta/config-3.18
@@ -0,0 +1,256 @@
+CONFIG_ARCH_BINFMT_ELF_RANDOMIZE_PIE=y
+CONFIG_ARCH_DISCARD_MEMBLOCK=y
+CONFIG_ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE=y
+CONFIG_ARCH_HAVE_CUSTOM_GPIO_H=y
+CONFIG_ARCH_MAY_HAVE_PC_FDC=y
+CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y
+CONFIG_ARCH_MIGHT_HAVE_PC_SERIO=y
+CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y
+# CONFIG_AX88796_93CX6 is not set
+CONFIG_ATA=y
+CONFIG_ATA_PIIX=y
+CONFIG_BLK_DEV_BSG=y
+CONFIG_BLK_DEV_BSGLIB=y
+# CONFIG_BLK_DEV_DM is not set
+# CONFIG_BLK_DEV_INITRD is not set
+# CONFIG_BLK_DEV_MD is not set
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_COUNT=16
+CONFIG_BLK_DEV_RAM_SIZE=4096
+CONFIG_BLK_DEV_SD=y
+CONFIG_BOARD_SCACHE=y
+CONFIG_BOOT_ELF32=y
+CONFIG_BOUNCE=y
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+# CONFIG_CEVT_GIC is not set
+CONFIG_CEVT_R4K=y
+CONFIG_CLKBLD_I8253=y
+CONFIG_CLKEVT_I8253=y
+CONFIG_CLKSRC_I8253=y
+CONFIG_CLONE_BACKWARDS=y
+CONFIG_CONSOLE_TRANSLATIONS=y
+CONFIG_CPU_GENERIC_DUMP_TLB=y
+CONFIG_CPU_HAS_PREFETCH=y
+# CONFIG_CPU_HAS_SMARTMIPS is not set
+CONFIG_CPU_HAS_SYNC=y
+# CONFIG_CPU_MIPS32_3_5_FEATURES is not set
+CONFIG_CPU_MIPSR2=y
+CONFIG_CPU_MIPSR2_IRQ_EI=y
+CONFIG_CPU_MIPSR2_IRQ_VI=y
+# CONFIG_CPU_NEEDS_NO_SMARTMIPS_OR_MICROMIPS is not set
+# CONFIG_CPU_NEVADA is not set
+CONFIG_CPU_R4K_CACHE_TLB=y
+CONFIG_CPU_R4K_FPU=y
+# CONFIG_CPU_RM7000 is not set
+CONFIG_CPU_RMAP=y
+CONFIG_CPU_SUPPORTS_HIGHMEM=y
+CONFIG_CRYPTO_MANAGER2=y
+CONFIG_CSRC_GIC=y
+CONFIG_CSRC_R4K=y
+# CONFIG_DEBUG_FS is not set
+CONFIG_DEVKMEM=y
+CONFIG_DMA_MAYBE_COHERENT=y
+CONFIG_DMA_NONCOHERENT=y
+CONFIG_DNOTIFY=y
+CONFIG_DUMMY_CONSOLE=y
+CONFIG_EARLY_PRINTK=y
+CONFIG_ENABLE_MUST_CHECK=y
+CONFIG_EXT4_FS=y
+CONFIG_FIRMWARE_IN_KERNEL=y
+CONFIG_FS_POSIX_ACL=y
+CONFIG_GENERIC_ATOMIC64=y
+CONFIG_GENERIC_CLOCKEVENTS=y
+CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
+CONFIG_GENERIC_CMOS_UPDATE=y
+CONFIG_GENERIC_IO=y
+CONFIG_GENERIC_IRQ_SHOW=y
+CONFIG_GENERIC_ISA_DMA=y
+CONFIG_GENERIC_PCI_IOMAP=y
+CONFIG_GENERIC_SMP_IDLE_THREAD=y
+CONFIG_GPIO_DEVRES=y
+CONFIG_HARDWARE_WATCHPOINTS=y
+CONFIG_HAS_DMA=y
+CONFIG_HAS_IOMEM=y
+CONFIG_HAS_IOPORT=y
+CONFIG_HAVE_ARCH_JUMP_LABEL=y
+CONFIG_HAVE_ARCH_KGDB=y
+CONFIG_HAVE_ARCH_TRACEHOOK=y
+# CONFIG_HAVE_BOOTMEM_INFO_NODE is not set
+CONFIG_HAVE_CC_STACKPROTECTOR=y
+CONFIG_HAVE_CONTEXT_TRACKING=y
+CONFIG_HAVE_C_RECORDMCOUNT=y
+CONFIG_HAVE_DEBUG_KMEMLEAK=y
+CONFIG_HAVE_DEBUG_STACKOVERFLOW=y
+CONFIG_HAVE_DMA_API_DEBUG=y
+CONFIG_HAVE_DMA_ATTRS=y
+CONFIG_HAVE_DYNAMIC_FTRACE=y
+CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
+CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
+CONFIG_HAVE_FUNCTION_TRACER=y
+CONFIG_HAVE_FUNCTION_TRACE_MCOUNT_TEST=y
+CONFIG_HAVE_GENERIC_DMA_COHERENT=y
+CONFIG_HAVE_GENERIC_HARDIRQS=y
+CONFIG_HAVE_IDE=y
+CONFIG_HAVE_KERNEL_BZIP2=y
+CONFIG_HAVE_KERNEL_GZIP=y
+CONFIG_HAVE_KERNEL_LZ4=y
+CONFIG_HAVE_KERNEL_LZMA=y
+CONFIG_HAVE_KERNEL_LZO=y
+CONFIG_HAVE_KERNEL_XZ=y
+CONFIG_HAVE_KVM=y
+CONFIG_HAVE_MEMBLOCK=y
+CONFIG_HAVE_MEMBLOCK_NODE_MAP=y
+CONFIG_HAVE_MOD_ARCH_SPECIFIC=y
+CONFIG_HAVE_NET_DSA=y
+CONFIG_HAVE_OPROFILE=y
+CONFIG_HAVE_PCSPKR_PLATFORM=y
+CONFIG_HAVE_PERF_EVENTS=y
+CONFIG_HAVE_SYSCALL_TRACEPOINTS=y
+CONFIG_HOSTAP_FIRMWARE=y
+CONFIG_HOSTAP_FIRMWARE_NVRAM=y
+CONFIG_HW_CONSOLE=y
+CONFIG_HW_HAS_PCI=y
+CONFIG_I8253=y
+CONFIG_I8253_LOCK=y
+CONFIG_I8259=y
+CONFIG_INET_DIAG=y
+CONFIG_INET_TCP_DIAG=y
+CONFIG_INPUT=y
+# CONFIG_INPUT_MISC is not set
+CONFIG_INPUT_MOUSEDEV=y
+CONFIG_INPUT_MOUSEDEV_PSAUX=y
+CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
+CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
+CONFIG_IPC_NS=y
+# CONFIG_IP_MROUTE is not set
+CONFIG_IRQ_CPU=y
+CONFIG_IRQ_FORCED_THREADING=y
+CONFIG_IRQ_GIC=y
+CONFIG_IRQ_WORK=y
+CONFIG_ISA_DMA_API=y
+CONFIG_JFFS2_FS_POSIX_ACL=y
+CONFIG_JFFS2_FS_SECURITY=y
+# CONFIG_JFFS2_SUMMARY is not set
+CONFIG_KALLSYMS=y
+# CONFIG_KERNEL_XZ is not set
+CONFIG_KERNEL_GZIP=y
+# CONFIG_LEDS_TRIGGER_TIMER is not set
+CONFIG_LEGACY_PTYS=y
+CONFIG_LEGACY_PTY_COUNT=256
+CONFIG_LOG_BUF_SHIFT=15
+CONFIG_MD=y
+CONFIG_MDIO_BOARDINFO=y
+CONFIG_MIPS=y
+CONFIG_MIPS_BONITO64=y
+# CONFIG_MIPS_CMP is not set
+# CONFIG_MIPS_CPS is not set
+CONFIG_MIPS_CPU_SCACHE=y
+CONFIG_MIPS_EXTERNAL_TIMER=y
+# CONFIG_MIPS_HUGE_TLB_SUPPORT is not set
+CONFIG_MIPS_L1_CACHE_SHIFT=6
+CONFIG_MIPS_L1_CACHE_SHIFT_6=y
+# CONFIG_MIPS_MACHINE is not set
+CONFIG_MIPS_MALTA=y
+CONFIG_MIPS_MSC=y
+CONFIG_MIPS_MT=y
+# CONFIG_MIPS_MT_DISABLED is not set
+CONFIG_MIPS_MT_FPAFF=y
+CONFIG_MIPS_MT_SMP=y
+# CONFIG_MIPS_MT_SMTC is not set
+CONFIG_MIPS_PERF_SHARED_TC_COUNTERS=y
+# CONFIG_MIPS_VPE_LOADER is not set
+CONFIG_MODULES_USE_ELF_REL=y
+CONFIG_MODULE_FORCE_UNLOAD=y
+CONFIG_MTD_CFI_STAA=y
+# CONFIG_MTD_COMPLEX_MAPPINGS is not set
+CONFIG_MTD_PHYSMAP=y
+CONFIG_MTD_UBI_BEB_LIMIT=20
+# CONFIG_MTD_UBI_BLOCK is not set
+# CONFIG_MTD_UBI_FASTMAP is not set
+CONFIG_MTD_UBI_WL_THRESHOLD=4096
+CONFIG_MUTEX_SPIN_ON_OWNER=y
+CONFIG_NAMESPACES=y
+CONFIG_NEED_DMA_MAP_STATE=y
+CONFIG_NET_FLOW_LIMIT=y
+# CONFIG_NET_NS is not set
+CONFIG_NO_GENERIC_PCI_IOPORT_MAP=y
+CONFIG_NO_HZ=y
+CONFIG_NO_HZ_COMMON=y
+CONFIG_NO_HZ_IDLE=y
+CONFIG_NR_CPUS=2
+CONFIG_NR_CPUS_DEFAULT_2=y
+CONFIG_PAGEFLAGS_EXTENDED=y
+# CONFIG_PARTITION_ADVANCED is not set
+CONFIG_PCI=y
+CONFIG_PCI_DOMAINS=y
+CONFIG_PCI_GT64XXX_PCI0=y
+CONFIG_PCSPKR_PLATFORM=y
+CONFIG_PERF_EVENTS=y
+CONFIG_PERF_USE_VMALLOC=y
+CONFIG_PID_NS=y
+# CONFIG_PREEMPT_RCU is not set
+CONFIG_PRINT_QUOTA_WARNING=y
+CONFIG_PROC_PAGE_MONITOR=y
+# CONFIG_QFMT_V1 is not set
+CONFIG_QFMT_V2=y
+CONFIG_QUOTA=y
+CONFIG_QUOTACTL=y
+# CONFIG_QUOTA_NETLINK_INTERFACE is not set
+CONFIG_QUOTA_TREE=y
+CONFIG_RCU_STALL_COMMON=y
+CONFIG_RELAY=y
+CONFIG_RFS_ACCEL=y
+CONFIG_RPS=y
+CONFIG_RTC_CLASS=y
+CONFIG_SCSI=y
+CONFIG_SCSI_NETLINK=y
+CONFIG_SECCOMP=y
+CONFIG_SERIAL_8250_NR_UARTS=4
+CONFIG_SERIAL_8250_RUNTIME_UARTS=4
+CONFIG_SERIO=y
+CONFIG_SERIO_SERPORT=y
+CONFIG_SMP=y
+CONFIG_SMP_UP=y
+CONFIG_SOCK_DIAG=y
+# CONFIG_STAGING is not set
+CONFIG_STOP_MACHINE=y
+CONFIG_SWAP_IO_SPACE=y
+CONFIG_SYNC_R4K=y
+CONFIG_SYSFS_DEPRECATED=y
+CONFIG_SYSFS_DEPRECATED_V2=y
+CONFIG_SYS_HAS_CPU_MIPS32_R1=y
+CONFIG_SYS_HAS_CPU_MIPS32_R2=y
+CONFIG_SYS_HAS_CPU_MIPS64_R1=y
+CONFIG_SYS_HAS_CPU_MIPS64_R2=y
+CONFIG_SYS_HAS_CPU_NEVADA=y
+CONFIG_SYS_HAS_CPU_RM7000=y
+CONFIG_SYS_HAS_EARLY_PRINTK=y
+CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
+CONFIG_SYS_SUPPORTS_64BIT_KERNEL=y
+CONFIG_SYS_SUPPORTS_ARBIT_HZ=y
+CONFIG_SYS_SUPPORTS_BIG_ENDIAN=y
+CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y
+CONFIG_SYS_SUPPORTS_MIPS_CMP=y
+CONFIG_SYS_SUPPORTS_MULTITHREADING=y
+CONFIG_SYS_SUPPORTS_SCHED_SMT=y
+CONFIG_SYS_SUPPORTS_SMARTMIPS=y
+CONFIG_SYS_SUPPORTS_SMP=y
+CONFIG_SYS_SUPPORTS_ZBOOT=y
+# CONFIG_TCP_CONG_ADVANCED is not set
+CONFIG_TICK_CPU_ACCOUNTING=y
+CONFIG_TREE_RCU=y
+# CONFIG_UBIFS_FS is not set
+CONFIG_UIDGID_CONVERTED=y
+CONFIG_USB_ARCH_HAS_XHCI=y
+CONFIG_USB_SUPPORT=y
+# CONFIG_USER_NS is not set
+CONFIG_USE_GENERIC_SMP_HELPERS=y
+CONFIG_UTS_NS=y
+# CONFIG_VGA_CONSOLE is not set
+CONFIG_VM_EVENT_COUNTERS=y
+CONFIG_VT=y
+CONFIG_VT_CONSOLE=y
+CONFIG_VT_HW_CONSOLE_BINDING=y
+CONFIG_VXFS_FS=y
+# CONFIG_WATCHDOG is not set
+CONFIG_XPS=y
diff --git a/target/linux/malta/image/Makefile b/target/linux/malta/image/Makefile
new file mode 100644
index 0000000..180e045
--- /dev/null
+++ b/target/linux/malta/image/Makefile
@@ -0,0 +1,55 @@
+#
+# Copyright (C) 2010 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+include $(TOPDIR)/rules.mk
+include $(INCLUDE_DIR)/image.mk
+
+define get_kernel_entry
+0x$(shell $(TARGET_CROSS)nm $(1) 2>/dev/null | grep " kernel_entry" | cut -f1 -d ' ')
+endef
+
+define CompressLzma
+ $(STAGING_DIR_HOST)/bin/lzma e $(1) -lc1 -lp2 -pb2 $(2)
+endef
+
+define CompressGzip
+ gzip -9n -c $(1) > $(2)
+endef
+
+define MkuImage
+ mkimage -A mips -O linux -T kernel -a 0x80100000 -C $(1) $(2) \
+ -e $(call get_kernel_entry,$(KDIR)/vmlinux.debug) -n 'MIPS OpenWrt Linux-$(LINUX_VERSION)' \
+ -d $(3) $(4)
+endef
+
+define Image/Prepare
+ cp $(KDIR)/vmlinux.elf $(BIN_DIR)/$(IMG_PREFIX)-vmlinux.elf
+ $(call CompressLzma,$(KDIR)/vmlinux,$(KDIR)/vmlinux.bin.lzma)
+ $(call MkuImage,lzma,,$(KDIR)/vmlinux.bin.lzma,$(KDIR)/uImage.lzma)
+ $(call CompressGzip,$(KDIR)/vmlinux,$(KDIR)/vmlinux.bin.gz)
+ $(call MkuImage,gzip,,$(KDIR)/vmlinux.bin.gz,$(KDIR)/uImage.gz)
+endef
+
+define Image/BuildKernel
+ cp $(KDIR)/uImage.lzma $(BIN_DIR)/$(IMG_PREFIX)-uImage-lzma
+ cp $(KDIR)/uImage.gz $(BIN_DIR)/$(IMG_PREFIX)-uImage-gzip
+endef
+
+define Image/Build/squashfs
+ $(call prepare_generic_squashfs,$(KDIR)/root.squashfs)
+endef
+
+define Image/Build/Initramfs
+ cp $(KDIR)/vmlinux-initramfs.elf $(BIN_DIR)/$(IMG_PREFIX)-vmlinux-initramfs.elf
+ cp $(KDIR)/vmlinux-initramfs $(BIN_DIR)/$(IMG_PREFIX)-vmlinux-initramfs.bin
+endef
+
+define Image/Build
+ $(call Image/Build/$(1))
+ dd if=$(KDIR)/root.$(1) of=$(BIN_DIR)/$(IMG_PREFIX)-root.$(1) bs=128k conv=sync
+endef
+
+$(eval $(call BuildImage))
diff --git a/target/linux/malta/le/config-default b/target/linux/malta/le/config-default
new file mode 100644
index 0000000..b5634c6
--- /dev/null
+++ b/target/linux/malta/le/config-default
@@ -0,0 +1,9 @@
+# CONFIG_CPU_BIG_ENDIAN is not set
+CONFIG_CPU_LITTLE_ENDIAN=y
+CONFIG_CPU_MIPS32=y
+# CONFIG_CPU_MIPS32_R1 is not set
+CONFIG_CPU_MIPS32_R2=y
+# CONFIG_CPU_MIPS64_R1 is not set
+# CONFIG_CPU_MIPS64_R2 is not set
+CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
+# CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set
diff --git a/target/linux/malta/le/target.mk b/target/linux/malta/le/target.mk
new file mode 100644
index 0000000..35fcf4c
--- /dev/null
+++ b/target/linux/malta/le/target.mk
@@ -0,0 +1,10 @@
+ARCH:=mipsel
+ARCH_PACKAGES:=malta_mipsel
+SUBTARGET:=le
+BOARDNAME:=Little Endian
+FEATURES:=ramdisk mips16
+
+define Target/Description
+ Build LE firmware images for MIPS Malta CoreLV board running in
+ little-endian mode
+endef
diff --git a/target/linux/malta/le64/config-default b/target/linux/malta/le64/config-default
new file mode 100644
index 0000000..8b5731e
--- /dev/null
+++ b/target/linux/malta/le64/config-default
@@ -0,0 +1,30 @@
+# CONFIG_32BIT is not set
+CONFIG_64BIT=y
+CONFIG_ARCH_DMA_ADDR_T_64BIT=y
+CONFIG_ARCH_WANT_COMPAT_IPC_PARSE_VERSION=y
+CONFIG_ARCH_WANT_OLD_COMPAT_IPC=y
+CONFIG_BINFMT_ELF32=y
+CONFIG_BLOCK_COMPAT=y
+CONFIG_COMPAT=y
+CONFIG_COMPAT_NETLINK_MESSAGES=y
+# CONFIG_CPU_BIG_ENDIAN is not set
+CONFIG_CPU_LITTLE_ENDIAN=y
+# CONFIG_CPU_MIPS32_R1 is not set
+# CONFIG_CPU_MIPS32_R2 is not set
+CONFIG_CPU_MIPS64=y
+CONFIG_CPU_MIPS64_R1=y
+# CONFIG_CPU_MIPS64_R2 is not set
+CONFIG_CPU_MIPSR1=y
+CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
+CONFIG_CPU_SUPPORTS_64BIT_KERNEL=y
+CONFIG_CPU_SUPPORTS_HUGEPAGES=y
+CONFIG_HAVE_64BIT_ALIGNED_ACCESS=y
+CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE=y
+# CONFIG_HUGETLBFS is not set
+CONFIG_MIPS32_COMPAT=y
+CONFIG_MIPS32_N32=y
+CONFIG_MIPS32_O32=y
+CONFIG_MODULES_USE_ELF_RELA=y
+CONFIG_PHYS_ADDR_T_64BIT=y
+CONFIG_SYSVIPC_COMPAT=y
+CONFIG_SYS_SUPPORTS_HUGETLBFS=y
diff --git a/target/linux/malta/le64/target.mk b/target/linux/malta/le64/target.mk
new file mode 100644
index 0000000..26b53c1
--- /dev/null
+++ b/target/linux/malta/le64/target.mk
@@ -0,0 +1,10 @@
+ARCH:=mips64el
+ARCH_PACKAGES:=malta_mipsel64
+SUBTARGET:=le64
+BOARDNAME:=Little Endian (64-bits)
+FEATURES:=ramdisk
+
+define Target/Description
+ Build LE firmware images for MIPS Malta CoreLV board running in
+ little-endian and 64-bits mode
+endef
diff --git a/target/linux/malta/patches/330-MIPS-Malta-Mark-kernel-code-and-kernel-data-segments.patch b/target/linux/malta/patches/330-MIPS-Malta-Mark-kernel-code-and-kernel-data-segments.patch
new file mode 100644
index 0000000..789be50
--- /dev/null
+++ b/target/linux/malta/patches/330-MIPS-Malta-Mark-kernel-code-and-kernel-data-segments.patch
@@ -0,0 +1,34 @@
+From 79c7301c922f5023f85805a4ba969ce55f51d0ca Mon Sep 17 00:00:00 2001
+From: Yousong Zhou <yszhou4tech@gmail.com>
+Date: Sat, 31 Jan 2015 15:13:12 +0800
+Subject: [PATCH 330/331] MIPS: Malta: Mark kernel code and kernel data
+ segments as BOOT_MEM_RAM.
+
+Kexec-tools requires those segments listed as "System RAM" in
+/proc/iomem, otherwise, an error message of "Invalid memory segment"
+will be emitted when trying to load the ELF kernel image.
+
+Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
+---
+ arch/mips/mti-malta/malta-memory.c | 9 ++-------
+ 1 file changed, 2 insertions(+), 7 deletions(-)
+
+--- a/arch/mips/mti-malta/malta-memory.c
++++ b/arch/mips/mti-malta/malta-memory.c
+@@ -112,14 +112,9 @@ fw_memblock_t * __init fw_getmdesc(int e
+ mdesc[2].base = mdesc[0].base + 0x000f0000UL;
+ mdesc[2].size = 0x00010000;
+
+- mdesc[3].type = fw_dontuse;
++ mdesc[3].type = fw_free;
+ mdesc[3].base = mdesc[0].base + 0x00100000UL;
+- mdesc[3].size = CPHYSADDR(PFN_ALIGN((unsigned long)&_end)) -
+- 0x00100000UL;
+-
+- mdesc[4].type = fw_free;
+- mdesc[4].base = mdesc[0].base + CPHYSADDR(PFN_ALIGN(&_end));
+- mdesc[4].size = memsize - CPHYSADDR(mdesc[4].base);
++ mdesc[3].size = memsize - CPHYSADDR(mdesc[3].base);
+
+ return &mdesc[0];
+ }