From 5c105d9f3fd086aff195d3849dcf847d6b0bd927 Mon Sep 17 00:00:00 2001 From: blogic Date: Fri, 5 Oct 2012 10:12:53 +0000 Subject: branch Attitude Adjustment git-svn-id: svn://svn.openwrt.org/openwrt/branches/attitude_adjustment@33625 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- target/linux/avr32/Makefile | 23 +++++ target/linux/avr32/config-3.3 | 103 +++++++++++++++++++++ target/linux/avr32/image/Config.in | 13 +++ target/linux/avr32/image/Makefile | 55 +++++++++++ target/linux/avr32/image/u-boot/Makefile | 35 +++++++ .../patches/100-ngw100_enable_lzma_support.patch | 10 ++ target/linux/avr32/modules.mk | 38 ++++++++ .../avr32/patches-3.3/110-openwrt_flashmap.patch | 19 ++++ 8 files changed, 296 insertions(+) create mode 100644 target/linux/avr32/Makefile create mode 100644 target/linux/avr32/config-3.3 create mode 100644 target/linux/avr32/image/Config.in create mode 100644 target/linux/avr32/image/Makefile create mode 100644 target/linux/avr32/image/u-boot/Makefile create mode 100644 target/linux/avr32/image/u-boot/patches/100-ngw100_enable_lzma_support.patch create mode 100644 target/linux/avr32/modules.mk create mode 100644 target/linux/avr32/patches-3.3/110-openwrt_flashmap.patch (limited to 'target/linux/avr32') diff --git a/target/linux/avr32/Makefile b/target/linux/avr32/Makefile new file mode 100644 index 000000000..71a84aeab --- /dev/null +++ b/target/linux/avr32/Makefile @@ -0,0 +1,23 @@ +# +# Copyright (C) 2007-2011 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# +include $(TOPDIR)/rules.mk + +ARCH:=avr32 +BOARD:=avr32 +BOARDNAME:=Atmel AVR32 +FEATURES:=squashfs +MAINTAINER:=Imre Kaloz + +LINUX_VERSION:=3.3.8 + +include $(INCLUDE_DIR)/target.mk + +define Target/Description + Build firmware images for ATNGW100 board +endef + +$(eval $(call BuildTarget)) diff --git a/target/linux/avr32/config-3.3 b/target/linux/avr32/config-3.3 new file mode 100644 index 000000000..7a077ef0a --- /dev/null +++ b/target/linux/avr32/config-3.3 @@ -0,0 +1,103 @@ +CONFIG_AP700X_16_BIT_SMC=y +# CONFIG_AP700X_32_BIT_SMC is not set +# CONFIG_AP700X_8_BIT_SMC is not set +# CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set +# CONFIG_ARCH_HAVE_MEMORY_PRESENT is not set +CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG=y +CONFIG_ARCH_REQUIRE_GPIOLIB=y +# CONFIG_ARCH_SPARSEMEM_ENABLE is not set +CONFIG_ARCH_SUSPEND_POSSIBLE=y +CONFIG_AT32AP700X_WDT=m +# CONFIG_ATMEL_PWM is not set +# CONFIG_ATMEL_SSC is not set +CONFIG_ATMEL_TCB_CLKSRC=y +CONFIG_ATMEL_TCB_CLKSRC_BLOCK=0 +CONFIG_ATMEL_TCLIB=y +CONFIG_AVR32=y +CONFIG_BCMA_POSSIBLE=y +CONFIG_BOARD_ATNGW100_ADDON_NONE=y +CONFIG_BOARD_ATNGW100_COMMON=y +# CONFIG_BOARD_ATNGW100_EVKLCD10X is not set +CONFIG_BOARD_ATNGW100_MKI=y +# CONFIG_BOARD_ATNGW100_MKII is not set +# CONFIG_BOARD_ATNGW100_MRMT is not set +# CONFIG_BOARD_ATSTK1000 is not set +# CONFIG_BOARD_FAVR_32 is not set +# CONFIG_BOARD_HAMMERHEAD is not set +# CONFIG_BOARD_MERISC is not set +# CONFIG_BOARD_MIMC200 is not set +CONFIG_CPU_AT32AP7000=y +CONFIG_CPU_AT32AP700X=y +CONFIG_DECOMPRESS_LZMA=y +CONFIG_DMADEVICES=y +CONFIG_DMA_ENGINE=y +CONFIG_DW_DMAC=y +CONFIG_ENTRY_ADDRESS=0x90000000 +CONFIG_GENERIC_ALLOCATOR=y +CONFIG_GENERIC_ATOMIC64=y +CONFIG_GENERIC_BUG=y +CONFIG_GENERIC_CLOCKEVENTS=y +CONFIG_GENERIC_CLOCKEVENTS_BUILD=y +CONFIG_GENERIC_GPIO=y +CONFIG_GENERIC_IRQ_SHOW=y +CONFIG_GPIOLIB=y +CONFIG_HARDIRQS_SW_RESEND=y +CONFIG_HAS_DMA=y +CONFIG_HAS_IOMEM=y +CONFIG_HAS_IOPORT=y +# CONFIG_HAVE_ARCH_BOOTMEM is not set +CONFIG_HAVE_CLK=y +CONFIG_HAVE_FB_ATMEL=y +# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set +CONFIG_HAVE_GENERIC_HARDIRQS=y +CONFIG_HAVE_NET_MACB=y +CONFIG_HAVE_OPROFILE=y +CONFIG_I2C=m +CONFIG_I2C_BOARDINFO=y +CONFIG_INITRAMFS_SOURCE="" +CONFIG_LEDS_GPIO=y +CONFIG_LOADER_U_BOOT=y +CONFIG_LOAD_ADDRESS=0x10000000 +CONFIG_MACB=y +CONFIG_MDIO_BOARDINFO=y +CONFIG_MMC=m +CONFIG_MMC_ATMELMCI=m +# CONFIG_MMC_ATMELMCI_DMA is not set +CONFIG_MMC_BLOCK=m +# CONFIG_MTD_CFI_INTELEXT is not set +CONFIG_MTD_CMDLINE_PARTS=y +# CONFIG_MTD_COMPLEX_MAPPINGS is not set +CONFIG_MTD_DATAFLASH=y +# CONFIG_MTD_DATAFLASH_OTP is not set +# CONFIG_MTD_DATAFLASH_WRITE_VERIFY is not set +CONFIG_MTD_PHYSMAP=y +# CONFIG_NEED_NODE_MEMMAP_SIZE is not set +CONFIG_NEED_PER_CPU_KM=y +# CONFIG_NET_DMA is not set +# CONFIG_NMI_DEBUGGING is not set +CONFIG_NO_HZ=y +CONFIG_NR_QUICK=2 +# CONFIG_OWNERSHIP_TRACE is not set +CONFIG_PAGEFLAGS_EXTENDED=y +CONFIG_PERFORMANCE_COUNTERS=y +CONFIG_PHYLIB=y +CONFIG_PHYS_OFFSET=0x10000000 +CONFIG_PLATFORM_AT32AP=y +# CONFIG_PREEMPT_RCU is not set +CONFIG_QUICKLIST=y +CONFIG_RTC_CLASS=y +CONFIG_RTC_DRV_AT32AP700X=y +# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set +CONFIG_SCHED_HRTICK=y +# CONFIG_SCSI_DMA is not set +# CONFIG_SERIAL_8250 is not set +CONFIG_SERIAL_ATMEL=y +CONFIG_SERIAL_ATMEL_CONSOLE=y +CONFIG_SERIAL_ATMEL_PDC=y +# CONFIG_SERIAL_ATMEL_TTYAT is not set +CONFIG_SPI=y +CONFIG_SPI_ATMEL=y +CONFIG_SPI_MASTER=y +CONFIG_SUBARCH_AVR32B=y +CONFIG_XZ_DEC=y +CONFIG_ZONE_DMA_FLAG=0 diff --git a/target/linux/avr32/image/Config.in b/target/linux/avr32/image/Config.in new file mode 100644 index 000000000..bc5469e7a --- /dev/null +++ b/target/linux/avr32/image/Config.in @@ -0,0 +1,13 @@ +config AVR32_UBOOT + bool "Build U-Boot bootloader" + depends TARGET_avr32 + default n + +config AVR32_UBOOT_TARGET + string "U-Boot target board" + depends TARGET_avr32 + depends AVR32_UBOOT + default "atngw100" + help + For all supported boards there are ready-to-use default + configurations available; just type "". diff --git a/target/linux/avr32/image/Makefile b/target/linux/avr32/image/Makefile new file mode 100644 index 000000000..595a5d9fc --- /dev/null +++ b/target/linux/avr32/image/Makefile @@ -0,0 +1,55 @@ +# +# Copyright (C) 2007-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 + +ifneq ($(CONFIG_AVR32_UBOOT),) + define Build/Clean + $(MAKE) -C u-boot clean + endef + + define Build/Compile + $(MAKE) -C u-boot compile + endef +endif + +define Image/Prepare + cp $(LINUX_DIR)/arch/avr32/boot/images/uImage $(KDIR)/uImage +endef + +define Image/BuildKernel + cp $(KDIR)/uImage $(BIN_DIR)/$(IMG_PREFIX)-uImage + + $(STAGING_DIR_HOST)/bin/lzma e $(LINUX_DIR)/arch/avr32/boot/images/vmlinux.bin $(KDIR)/vmlinux.lzma + mkimage -A avr32 -O linux -T kernel -a 0x10000000 -C lzma \ + -e 0x90000000 \ + -n 'OpenWrt Linux-$(LINUX_VERSION)' \ + -d $(KDIR)/vmlinux.lzma $(KDIR)/uImage-lzma + + cp $(KDIR)/uImage-lzma $(BIN_DIR)/$(IMG_PREFIX)-uImage-lzma +endef + +define Image/Build + $(call Image/Build/$(1),$(1)) +endef + +define Image/Build/squashfs + $(call prepare_generic_squashfs,$(KDIR)/root.squashfs) + ( \ + dd if=$(KDIR)/uImage bs=1024k conv=sync; \ + dd if=$(KDIR)/root.$(1) bs=64k conv=sync; \ + ) > $(BIN_DIR)/$(IMG_PREFIX)-$(1).img +endef + +define Image/Build/jffs2-64k + ( \ + dd if=$(KDIR)/uImage bs=1024k conv=sync; \ + dd if=$(KDIR)/root.$(1) bs=64k conv=sync; \ + ) > $(BIN_DIR)/$(IMG_PREFIX)-$(1).img +endef + +$(eval $(call BuildImage)) diff --git a/target/linux/avr32/image/u-boot/Makefile b/target/linux/avr32/image/u-boot/Makefile new file mode 100644 index 000000000..6775d1d7c --- /dev/null +++ b/target/linux/avr32/image/u-boot/Makefile @@ -0,0 +1,35 @@ +# +# Copyright (C) 2008-2011 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)/kernel.mk + +PKG_NAME:=u-boot +PKG_VERSION:=2011.06 +PKG_RELEASE:=1 + +PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=ftp://ftp.denx.de/pub/u-boot +PKG_MD5SUM:=0cc5026aad02f218a9b9ac56b301c97a +PKG_CAT:=bzcat + +include $(INCLUDE_DIR)/package.mk + +UBOOT_CONFIG=$(call qstrip,$(CONFIG_AVR32_UBOOT_TARGET)) + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) $(UBOOT_CONFIG)_config + $(MAKE) -C $(PKG_BUILD_DIR) CROSS_COMPILE=$(TARGET_CROSS) +endef + +define Build/InstallDev + mkdir -p $(BIN_DIR) + dd if=$(PKG_BUILD_DIR)/u-boot.bin of=$(BIN_DIR)/u-boot-$(PKG_VERSION)-$(UBOOT_CONFIG).bin bs=64k conv=sync +endef + +$(eval $(call Build/DefaultTargets)) diff --git a/target/linux/avr32/image/u-boot/patches/100-ngw100_enable_lzma_support.patch b/target/linux/avr32/image/u-boot/patches/100-ngw100_enable_lzma_support.patch new file mode 100644 index 000000000..213a17582 --- /dev/null +++ b/target/linux/avr32/image/u-boot/patches/100-ngw100_enable_lzma_support.patch @@ -0,0 +1,10 @@ +--- a/include/configs/atngw100.h ++++ b/include/configs/atngw100.h +@@ -65,6 +65,7 @@ + #define CONFIG_USART_ID 1 + /* User serviceable stuff */ + #define CONFIG_DOS_PARTITION ++#define CONFIG_LZMA + + #define CONFIG_CMDLINE_TAG + #define CONFIG_SETUP_MEMORY_TAGS diff --git a/target/linux/avr32/modules.mk b/target/linux/avr32/modules.mk new file mode 100644 index 000000000..e8655b054 --- /dev/null +++ b/target/linux/avr32/modules.mk @@ -0,0 +1,38 @@ +# +# Copyright (C) 2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +define KernelPackage/atmel-wdt + SUBMENU:=$(OTHER_MENU) + TITLE:=AT32AP700x watchdog + DEPENDS:=@TARGET_avr32 + KCONFIG:=CONFIG_AT32AP700X_WDT + FILES:=$(LINUX_DIR)/drivers/$(WATCHDOG_DIR)/at32ap700x_wdt.ko + AUTOLOAD:=$(call AutoLoad,50,at32ap700x_wdt) +endef + +define KernelPackage/atmel-wdt/description + AT32AP700x watchdog +endef + +$(eval $(call KernelPackage,atmel-wdt)) + + +define KernelPackage/mmc-atmelmci + SUBMENU:=$(OTHER_MENU) + TITLE:=Amtel MMC Support + DEPENDS:=@TARGET_avr32 +kmod-mmc + KCONFIG:=CONFIG_MMC_ATMELMCI + FILES:=$(LINUX_DIR)/drivers/mmc/host/atmel-mci.ko + AUTOLOAD:=$(call AutoLoad,90,atmel-mci) +endef + +define KernelPackage/mmc-atmelmci/description + Kernel support for Atmel Multimedia Card Interface. +endef + +$(eval $(call KernelPackage,mmc-atmelmci,1)) + diff --git a/target/linux/avr32/patches-3.3/110-openwrt_flashmap.patch b/target/linux/avr32/patches-3.3/110-openwrt_flashmap.patch new file mode 100644 index 000000000..98669bc47 --- /dev/null +++ b/target/linux/avr32/patches-3.3/110-openwrt_flashmap.patch @@ -0,0 +1,19 @@ +--- a/arch/avr32/boards/atngw100/flash.c ++++ b/arch/avr32/boards/atngw100/flash.c +@@ -45,9 +45,14 @@ static struct mtd_partition flash_parts[ + .mask_flags = MTD_WRITEABLE, + }, + { +- .name = "root", ++ .name = "kernel", + .offset = 0x00020000, +- .size = 0x007d0000, ++ .size = 0x00100000, ++ }, ++ { ++ .name = "rootfs", ++ .offset = 0x00120000, ++ .size = 0x006d0000, + }, + { + .name = "env", -- cgit v1.2.3