From 6a61d2d905837736644acef39ce2f688764e5707 Mon Sep 17 00:00:00 2001 From: Florian Fainelli Date: Mon, 8 Nov 2010 07:31:31 +0000 Subject: [PATCH] add target to be used with qemu SVN-Revision: 23920 --- target/linux/versatile/Makefile | 21 +++ target/linux/versatile/README | 10 ++ target/linux/versatile/base-files/etc/inittab | 5 + target/linux/versatile/config-default | 151 ++++++++++++++++++ target/linux/versatile/image/Makefile | 23 +++ 5 files changed, 210 insertions(+) create mode 100644 target/linux/versatile/Makefile create mode 100644 target/linux/versatile/README create mode 100644 target/linux/versatile/base-files/etc/inittab create mode 100644 target/linux/versatile/config-default create mode 100644 target/linux/versatile/image/Makefile diff --git a/target/linux/versatile/Makefile b/target/linux/versatile/Makefile new file mode 100644 index 0000000000..6ec2d35add --- /dev/null +++ b/target/linux/versatile/Makefile @@ -0,0 +1,21 @@ +# +# 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 + +ARCH:=arm +BOARD:=versatile +BOARDNAME:=ARM Versatile board (qemu) +FEATURES:=squashfs jffs2 +CFLAGS:=-Os -pipe -march=armv5te -mtune=arm926ej-s -funit-at-a-time + +LINUX_VERSION:=2.6.36 + +include $(INCLUDE_DIR)/target.mk + +KERNELNAME:="zImage" + +$(eval $(call BuildTarget)) diff --git a/target/linux/versatile/README b/target/linux/versatile/README new file mode 100644 index 0000000000..c870cdc3ea --- /dev/null +++ b/target/linux/versatile/README @@ -0,0 +1,10 @@ +This ARM Ltd. Versatile target is intended to be used with the Qemu emulator. +It can be used to prototype an OpenWrt firmware targetting ARM-based hardware. +One could also use it to troubleshoot ARM applications without access to real +hardware. + +To use the images built by OpenWrt with qemu, use the following commands: + +qemu-system-arm -M versatilepb -kernel bin/versatile/openwrt-versatile-vmlinux.elf -nographic -m 128 + +and enjoy the system booting. diff --git a/target/linux/versatile/base-files/etc/inittab b/target/linux/versatile/base-files/etc/inittab new file mode 100644 index 0000000000..3674d98809 --- /dev/null +++ b/target/linux/versatile/base-files/etc/inittab @@ -0,0 +1,5 @@ +::sysinit:/etc/init.d/rcS S boot +::shutdown:/etc/init.d/rcS K stop +tts/0::askfirst:/bin/ash --login +ttyAMA0::askfirst:/bin/ash --login +tty1::askfirst:/bin/ash --login diff --git a/target/linux/versatile/config-default b/target/linux/versatile/config-default new file mode 100644 index 0000000000..27ea3e7c51 --- /dev/null +++ b/target/linux/versatile/config-default @@ -0,0 +1,151 @@ +CONFIG_AEABI=y +CONFIG_ALIGNMENT_TRAP=y +# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set +# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set +# CONFIG_ARCH_SUPPORTS_MSI is not set +CONFIG_ARCH_SUSPEND_POSSIBLE=y +# CONFIG_ARCH_USES_GETTIMEOFFSET is not set +CONFIG_ARCH_VERSATILE=y +CONFIG_ARCH_VERSATILE_PB=y +CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y +CONFIG_ARM=y +CONFIG_ARM_AMBA=y +# CONFIG_ARM_CHARLCD is not set +CONFIG_ARM_L1_CACHE_SHIFT=5 +CONFIG_ARM_THUMB=y +CONFIG_ARM_TIMER_SP804=y +CONFIG_ARM_VIC=y +CONFIG_ARM_VIC_NR=2 +# CONFIG_ARPD is not set +CONFIG_BLK_DEV_RAM=y +CONFIG_BLK_DEV_RAM_COUNT=16 +CONFIG_BLK_DEV_RAM_SIZE=4096 +# CONFIG_BRIDGE is not set +# CONFIG_BSD_PROCESS_ACCT is not set +CONFIG_CC_OPTIMIZE_FOR_SIZE=y +CONFIG_CMDLINE="console=ttyAMA0,115200 init=/etc/preinit" +CONFIG_COMMON_CLKDEV=y +CONFIG_CONSOLE_TRANSLATIONS=y +CONFIG_CPU_32v5=y +CONFIG_CPU_ABRT_EV5TJ=y +CONFIG_CPU_ARM926T=y +# CONFIG_CPU_CACHE_ROUND_ROBIN is not set +CONFIG_CPU_CACHE_VIVT=y +CONFIG_CPU_COPY_V4WB=y +CONFIG_CPU_CP15=y +CONFIG_CPU_CP15_MMU=y +# CONFIG_CPU_DCACHE_WRITETHROUGH is not set +# CONFIG_CPU_ICACHE_DISABLE is not set +CONFIG_CPU_PABRT_LEGACY=y +CONFIG_CPU_TLB_V4WBI=y +CONFIG_CRAMFS=y +# CONFIG_CRYPTO is not set +CONFIG_DEBUG_BUGVERBOSE=y +# CONFIG_DEBUG_FS is not set +CONFIG_DEBUG_USER=y +CONFIG_DECOMPRESS_LZMA=y +CONFIG_DEFAULT_CFQ=y +# CONFIG_DEFAULT_DEADLINE is not set +CONFIG_DEFAULT_IOSCHED="cfq" +CONFIG_DEFAULT_TCP_CONG="cubic" +CONFIG_DNOTIFY=y +CONFIG_DUMMY_CONSOLE=y +CONFIG_ELF_CORE=y +CONFIG_FORCE_MAX_ZONEORDER=11 +CONFIG_FRAME_POINTER=y +# CONFIG_FW_LOADER is not set +CONFIG_GENERIC_ATOMIC64=y +CONFIG_GENERIC_CLOCKEVENTS=y +CONFIG_GENERIC_CLOCKEVENTS_BUILD=y +CONFIG_GENERIC_FIND_LAST_BIT=y +CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y +# CONFIG_HAMRADIO is not set +CONFIG_HARDIRQS_SW_RESEND=y +CONFIG_HAS_DMA=y +CONFIG_HAS_IOMEM=y +CONFIG_HAS_IOPORT=y +CONFIG_HAVE_AOUT=y +CONFIG_HAVE_ARCH_KGDB=y +CONFIG_HAVE_CLK=y +CONFIG_HAVE_FUNCTION_TRACER=y +CONFIG_HAVE_GENERIC_DMA_COHERENT=y +CONFIG_HAVE_IDE=y +CONFIG_HAVE_KERNEL_GZIP=y +CONFIG_HAVE_KERNEL_LZMA=y +CONFIG_HAVE_KERNEL_LZO=y +CONFIG_HAVE_LATENCYTOP_SUPPORT=y +CONFIG_HAVE_MEMBLOCK=y +CONFIG_HAVE_OPROFILE=y +CONFIG_HAVE_PERF_EVENTS=y +CONFIG_HAVE_PROC_CPU=y +CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y +CONFIG_HW_CONSOLE=y +CONFIG_ICST=y +CONFIG_INITRAMFS_SOURCE="" +CONFIG_INPUT=y +# CONFIG_INPUT_MISC is not set +CONFIG_IOSCHED_CFQ=y +# CONFIG_IP_ADVANCED_ROUTER is not set +# CONFIG_IP_MROUTE is not set +CONFIG_IP_PNP=y +CONFIG_IP_PNP_BOOTP=y +# CONFIG_IP_PNP_DHCP is not set +# CONFIG_IP_PNP_RARP is not set +# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set +# CONFIG_JFFS2_LZMA is not set +# CONFIG_JFFS2_SUMMARY is not set +CONFIG_JFFS2_ZLIB=y +CONFIG_KALLSYMS=y +CONFIG_LEDS=y +CONFIG_LEDS_CPU=y +CONFIG_LEGACY_PTYS=y +CONFIG_LEGACY_PTY_COUNT=16 +CONFIG_MACH_VERSATILE_AB=y +CONFIG_MAGIC_SYSRQ=y +# CONFIG_MFD_T7L66XB is not set +CONFIG_MTD_ARM_INTEGRATOR=y +CONFIG_MTD_CFI_ADV_OPTIONS=y +# CONFIG_MTD_CFI_AMDSTD is not set +# CONFIG_MTD_CFI_GEOMETRY is not set +CONFIG_MTD_CMDLINE_PARTS=y +# CONFIG_MTD_COMPLEX_MAPPINGS is not set +CONFIG_NEED_DMA_MAP_STATE=y +# CONFIG_NET_SCHED is not set +# CONFIG_NEW_LEDS is not set +CONFIG_NLS=m +CONFIG_NLS_CODEPAGE_850=m +CONFIG_NLS_ISO8859_1=m +CONFIG_NO_HZ=y +# CONFIG_OABI_COMPAT is not set +CONFIG_PAGEFLAGS_EXTENDED=y +CONFIG_PAGE_OFFSET=0xC0000000 +# CONFIG_PCI is not set +# CONFIG_PCI_SYSCALL is not set +CONFIG_PERF_USE_VMALLOC=y +CONFIG_PLAT_VERSATILE=y +# CONFIG_ROMFS_BACKED_BY_BLOCK is not set +# CONFIG_ROMFS_BACKED_BY_BOTH is not set +# CONFIG_ROMFS_BACKED_BY_MTD is not set +# CONFIG_SCSI_DMA is not set +# CONFIG_SERIAL_8250 is not set +CONFIG_SERIAL_AMBA_PL011=y +CONFIG_SERIAL_AMBA_PL011_CONSOLE=y +CONFIG_SMC91X=y +CONFIG_SPLIT_PTLOCK_CPUS=999999 +# CONFIG_SYN_COOKIES is not set +CONFIG_SYS_SUPPORTS_APM_EMULATION=y +# CONFIG_TCP_CONG_ADVANCED is not set +CONFIG_TCP_CONG_CUBIC=y +# CONFIG_TINY_RCU is not set +CONFIG_TREE_RCU=y +CONFIG_UID16=y +CONFIG_VECTORS_BASE=0xffff0000 +CONFIG_VFP=y +# CONFIG_VLAN_8021Q is not set +CONFIG_VT=y +CONFIG_VT_CONSOLE=y +# CONFIG_VT_HW_CONSOLE_BINDING is not set +# CONFIG_WATCHDOG is not set +CONFIG_ZBOOT_ROM_BSS=0x0 +CONFIG_ZBOOT_ROM_TEXT=0x0 +CONFIG_ZONE_DMA_FLAG=0 diff --git a/target/linux/versatile/image/Makefile b/target/linux/versatile/image/Makefile new file mode 100644 index 0000000000..dd0d9ee76d --- /dev/null +++ b/target/linux/versatile/image/Makefile @@ -0,0 +1,23 @@ +# +# 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 Image/BuildKernel + cp $(LINUX_DIR)/arch/$(ARCH)/boot/$(subst ",,$(KERNELNAME)) $(BIN_DIR)/openwrt-$(BOARD)-vmlinux.elf +endef + +define Image/Build/squashfs + $(call prepare_generic_squashfs,$(KDIR)/root.squashfs) +endef + +define Image/Build + $(call Image/Build/$(1)) + dd if=$(KDIR)/root.$(1) of=$(BIN_DIR)/openwrt-$(BOARD)-root.$(1) bs=128k conv=sync +endef + +$(eval $(call BuildImage)) -- 2.30.2