From 4c509fb2b812a34246078b97e92425d3578ec3ef Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Wed, 16 Dec 2009 19:55:02 +0100 Subject: add basic support for ag241 ar7 based dsl router - my wag54g died. disable wag54g for now. - add 2.6.32 support for ag241. - cpmac still broken --- target/ag241/Makefile | 54 ++ target/ag241/files/etc/inittab | 3 + target/ag241/files/etc/mdev.conf | 10 + target/ag241/kernel.config | 914 +++++++++++++++++++++++++++++ target/ag241/patches/ar7.patch | 78 +++ target/ag241/target.mk | 7 + target/ag241/tools/addpattern/Makefile | 4 + target/ag241/tools/addpattern/addpattern.c | 255 ++++++++ target/ag241/tools/rules.mk | 9 + target/ag241/tools/squashfs/Makefile | 27 + target/ag241/tools/srec2bin/Makefile | 4 + target/ag241/tools/srec2bin/srec2bin.c | 524 +++++++++++++++++ target/ag241/uclibc.config | 233 ++++++++ 13 files changed, 2122 insertions(+) create mode 100644 target/ag241/Makefile create mode 100644 target/ag241/files/etc/inittab create mode 100644 target/ag241/files/etc/mdev.conf create mode 100644 target/ag241/kernel.config create mode 100644 target/ag241/patches/ar7.patch create mode 100644 target/ag241/target.mk create mode 100644 target/ag241/tools/addpattern/Makefile create mode 100644 target/ag241/tools/addpattern/addpattern.c create mode 100644 target/ag241/tools/rules.mk create mode 100644 target/ag241/tools/squashfs/Makefile create mode 100644 target/ag241/tools/srec2bin/Makefile create mode 100644 target/ag241/tools/srec2bin/srec2bin.c create mode 100644 target/ag241/uclibc.config (limited to 'target/ag241') diff --git a/target/ag241/Makefile b/target/ag241/Makefile new file mode 100644 index 000000000..abfaf7bef --- /dev/null +++ b/target/ag241/Makefile @@ -0,0 +1,54 @@ +# $Id: Makefile 30 2008-09-04 13:31:09Z wbx $ +#- +# This file is part of the OpenADK project. OpenADK is copyrighted +# material, please see the LICENCE file in the top-level directory. + +include $(TOPDIR)/rules.mk +include $(TOPDIR)/mk/kernel.mk +include $(TOPDIR)/mk/modules.mk +include $(TOPDIR)/mk/kernel-build.mk +include $(TOPDIR)/mk/image.mk + +$(TOOLS_BUILD_DIR): + mkdir -p $(TOOLS_BUILD_DIR) + +tools-compile: $(TOOLS_BUILD_DIR) + $(MAKE) -C tools/addpattern + $(MAKE) -C tools/srec2bin + $(MAKE) -C tools/squashfs prepare compile install + +kernel-install: tools-compile + PATH='${TARGET_PATH}' \ + mipsel-linux-objcopy -S -O srec $(LINUX_DIR)/vmlinux \ + $(LINUX_DIR)/vmlinux.srec + PATH='${TARGET_PATH}' \ + srec2bin $(LINUX_DIR)/vmlinux.srec $(LINUX_DIR)/vmlinux.bin + (dd if=/dev/zero bs=16 count=1; cat $(LINUX_DIR)/vmlinux.bin) > \ + $(LINUX_DIR)/vmlinux.tmp + PATH='${TARGET_PATH}' \ + addpattern -p AG3B -b -r 2.0 -i $(LINUX_DIR)/vmlinux.tmp \ + -o $(BIN_DIR)/${ADK_TARGET}-${ARCH}-kernel + +ifeq ($(FS),squashfs) +imageinstall: $(BIN_DIR)/$(ROOTFSSQUASHFS) + ${CP} ${BUILD_DIR}/${ROOTFSSQUASHFS} $(BIN_DIR)/$(ROOTFSSQUASHFS) + @echo + @echo The image file is $(ROOTFSSQUASHFS) + @echo 'You can flash the image via tftp:' + @echo 'tftp 192.168.1.1' + @echo 'tftp> binary' + @echo "tftp> put $(ROOTFSSQUASHFS) upgrade_code.bin" + @echo 'Login as user root with password linux123 via ssh or console' +endif + +ifeq ($(FS),nfsroot) +imageinstall: $(BIN_DIR)/$(ROOTFSTARBALL) + @echo + @echo 'The kernel file is: ${BIN_DIR}/${ADK_TARGET}-${ARCH}-kernel' + @echo 'The nfs root tarball is: ${BIN_DIR}/${ROOTFSTARBALL}' + @echo 'You can flash the kernel via tftp:' + @echo 'tftp 192.168.1.1' + @echo 'tftp> binary' + @echo 'tftp> put ag241-mips-kernel upgrade_code.bin' + @echo 'Login as user root with password linux123 via ssh or console' +endif diff --git a/target/ag241/files/etc/inittab b/target/ag241/files/etc/inittab new file mode 100644 index 000000000..4566ae3e8 --- /dev/null +++ b/target/ag241/files/etc/inittab @@ -0,0 +1,3 @@ +::sysinit:/etc/init.d/rcS +::shutdown:/etc/init.d/rcK +ttyS0::respawn:/sbin/getty -i -L ttyS0 38400 vt100 diff --git a/target/ag241/files/etc/mdev.conf b/target/ag241/files/etc/mdev.conf new file mode 100644 index 000000000..582a7b43f --- /dev/null +++ b/target/ag241/files/etc/mdev.conf @@ -0,0 +1,10 @@ +tun 0:0 660 >net/tun +device-mapper 0:0 660 @mkdir /dev/mapper +null 0:0 777 +zero 0:0 666 +u?random 0:0 644 +console 0:0 0600 +ptmx 0:0 666 +tty 0:0 666 +ttyS* 0:0 640 +.* 0:0 644 @/lib/mdev/init diff --git a/target/ag241/kernel.config b/target/ag241/kernel.config new file mode 100644 index 000000000..a62a800ed --- /dev/null +++ b/target/ag241/kernel.config @@ -0,0 +1,914 @@ +# +# Automatically generated make config: don't edit +# Linux kernel version: 2.6.32 +# Tue Dec 15 19:52:06 2009 +# +CONFIG_MIPS=y + +# +# Machine selection +# +# CONFIG_MACH_ALCHEMY is not set +CONFIG_AR7=y +# CONFIG_BASLER_EXCITE is not set +# CONFIG_BCM47XX is not set +# CONFIG_BCM63XX is not set +# CONFIG_MIPS_COBALT is not set +# CONFIG_MACH_DECSTATION is not set +# CONFIG_MACH_JAZZ is not set +# CONFIG_LASAT is not set +# CONFIG_MACH_LOONGSON is not set +# CONFIG_MIPS_MALTA is not set +# CONFIG_MIPS_SIM is not set +# CONFIG_NEC_MARKEINS is not set +# CONFIG_MACH_VR41XX is not set +# CONFIG_NXP_STB220 is not set +# CONFIG_NXP_STB225 is not set +# CONFIG_PNX8550_JBS is not set +# CONFIG_PNX8550_STB810 is not set +# CONFIG_PMC_MSP is not set +# CONFIG_PMC_YOSEMITE is not set +# CONFIG_SGI_IP22 is not set +# CONFIG_SGI_IP27 is not set +# CONFIG_SGI_IP28 is not set +# CONFIG_SGI_IP32 is not set +# CONFIG_SIBYTE_CRHINE is not set +# CONFIG_SIBYTE_CARMEL is not set +# CONFIG_SIBYTE_CRHONE is not set +# CONFIG_SIBYTE_RHONE is not set +# CONFIG_SIBYTE_SWARM is not set +# CONFIG_SIBYTE_LITTLESUR is not set +# CONFIG_SIBYTE_SENTOSA is not set +# CONFIG_SIBYTE_BIGSUR is not set +# CONFIG_SNI_RM is not set +# CONFIG_MACH_TX39XX is not set +# CONFIG_MACH_TX49XX is not set +# CONFIG_MIKROTIK_RB532 is not set +# CONFIG_WR_PPMC is not set +# CONFIG_CAVIUM_OCTEON_SIMULATOR is not set +# CONFIG_CAVIUM_OCTEON_REFERENCE_BOARD is not set +# CONFIG_ALCHEMY_GPIO_INDIRECT is not set +CONFIG_RWSEM_GENERIC_SPINLOCK=y +# CONFIG_ARCH_HAS_ILOG2_U32 is not set +# CONFIG_ARCH_HAS_ILOG2_U64 is not set +CONFIG_ARCH_SUPPORTS_OPROFILE=y +CONFIG_GENERIC_FIND_NEXT_BIT=y +CONFIG_GENERIC_HWEIGHT=y +CONFIG_GENERIC_CALIBRATE_DELAY=y +CONFIG_GENERIC_CLOCKEVENTS=y +CONFIG_GENERIC_TIME=y +CONFIG_GENERIC_CMOS_UPDATE=y +CONFIG_SCHED_OMIT_FRAME_POINTER=y +CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y +CONFIG_CEVT_R4K_LIB=y +CONFIG_CEVT_R4K=y +CONFIG_CSRC_R4K_LIB=y +CONFIG_CSRC_R4K=y +CONFIG_DMA_NONCOHERENT=y +CONFIG_DMA_NEED_PCI_MAP_STATE=y +CONFIG_EARLY_PRINTK=y +CONFIG_SYS_HAS_EARLY_PRINTK=y +# CONFIG_NO_IOPORT is not set +CONFIG_GENERIC_GPIO=y +# CONFIG_CPU_BIG_ENDIAN is not set +CONFIG_CPU_LITTLE_ENDIAN=y +CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y +CONFIG_IRQ_CPU=y +CONFIG_SWAP_IO_SPACE=y +CONFIG_BOOT_ELF32=y +CONFIG_MIPS_L1_CACHE_SHIFT=5 + +# +# CPU selection +# +# CONFIG_CPU_LOONGSON2E is not set +CONFIG_CPU_MIPS32_R1=y +# CONFIG_CPU_MIPS32_R2 is not set +# CONFIG_CPU_MIPS64_R1 is not set +# CONFIG_CPU_MIPS64_R2 is not set +# CONFIG_CPU_R3000 is not set +# CONFIG_CPU_TX39XX is not set +# CONFIG_CPU_VR41XX is not set +# CONFIG_CPU_R4300 is not set +# CONFIG_CPU_R4X00 is not set +# CONFIG_CPU_TX49XX is not set +# CONFIG_CPU_R5000 is not set +# CONFIG_CPU_R5432 is not set +# CONFIG_CPU_R5500 is not set +# CONFIG_CPU_R6000 is not set +# CONFIG_CPU_NEVADA is not set +# CONFIG_CPU_R8000 is not set +# CONFIG_CPU_R10000 is not set +# CONFIG_CPU_RM7000 is not set +# CONFIG_CPU_RM9000 is not set +# CONFIG_CPU_SB1 is not set +# CONFIG_CPU_CAVIUM_OCTEON is not set +CONFIG_SYS_HAS_CPU_MIPS32_R1=y +CONFIG_CPU_MIPS32=y +CONFIG_CPU_MIPSR1=y +CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y +CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y +CONFIG_HARDWARE_WATCHPOINTS=y + +# +# Kernel type +# +CONFIG_32BIT=y +# CONFIG_64BIT is not set +CONFIG_PAGE_SIZE_4KB=y +# CONFIG_PAGE_SIZE_8KB is not set +# CONFIG_PAGE_SIZE_16KB is not set +# CONFIG_PAGE_SIZE_32KB is not set +# CONFIG_PAGE_SIZE_64KB is not set +CONFIG_CPU_HAS_PREFETCH=y +CONFIG_MIPS_MT_DISABLED=y +# CONFIG_MIPS_MT_SMP is not set +# CONFIG_MIPS_MT_SMTC is not set +CONFIG_CPU_HAS_SYNC=y +CONFIG_GENERIC_HARDIRQS=y +CONFIG_GENERIC_IRQ_PROBE=y +CONFIG_CPU_SUPPORTS_HIGHMEM=y +CONFIG_ARCH_FLATMEM_ENABLE=y +CONFIG_ARCH_POPULATES_NODE_MAP=y +CONFIG_SELECT_MEMORY_MODEL=y +CONFIG_FLATMEM_MANUAL=y +# CONFIG_DISCONTIGMEM_MANUAL is not set +# CONFIG_SPARSEMEM_MANUAL is not set +CONFIG_FLATMEM=y +CONFIG_FLAT_NODE_MEM_MAP=y +CONFIG_PAGEFLAGS_EXTENDED=y +CONFIG_SPLIT_PTLOCK_CPUS=4 +# CONFIG_PHYS_ADDR_T_64BIT is not set +CONFIG_ZONE_DMA_FLAG=0 +CONFIG_VIRT_TO_BUS=y +CONFIG_HAVE_MLOCK=y +CONFIG_HAVE_MLOCKED_PAGE_BIT=y +# CONFIG_KSM is not set +CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 +CONFIG_TICK_ONESHOT=y +# CONFIG_NO_HZ is not set +CONFIG_HIGH_RES_TIMERS=y +CONFIG_GENERIC_CLOCKEVENTS_BUILD=y +# CONFIG_HZ_48 is not set +CONFIG_HZ_100=y +# CONFIG_HZ_128 is not set +# CONFIG_HZ_250 is not set +# CONFIG_HZ_256 is not set +# CONFIG_HZ_1000 is not set +# CONFIG_HZ_1024 is not set +CONFIG_SYS_SUPPORTS_ARBIT_HZ=y +CONFIG_HZ=100 +CONFIG_PREEMPT_NONE=y +# CONFIG_PREEMPT_VOLUNTARY is not set +# CONFIG_PREEMPT is not set +# CONFIG_KEXEC is not set +# CONFIG_SECCOMP is not set +CONFIG_LOCKDEP_SUPPORT=y +CONFIG_STACKTRACE_SUPPORT=y +CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" +CONFIG_CONSTRUCTORS=y + +# +# General setup +# +CONFIG_EXPERIMENTAL=y +CONFIG_BROKEN_ON_SMP=y +CONFIG_INIT_ENV_ARG_LIMIT=32 +CONFIG_LOCALVERSION="" +# CONFIG_LOCALVERSION_AUTO is not set +# CONFIG_SWAP is not set +CONFIG_SYSVIPC=y +CONFIG_SYSVIPC_SYSCTL=y +CONFIG_POSIX_MQUEUE=y +CONFIG_POSIX_MQUEUE_SYSCTL=y +# CONFIG_BSD_PROCESS_ACCT is not set +# CONFIG_TASKSTATS is not set +# CONFIG_AUDIT is not set + +# +# RCU Subsystem +# +CONFIG_TREE_RCU=y +# CONFIG_TREE_PREEMPT_RCU is not set +# CONFIG_RCU_TRACE is not set +CONFIG_RCU_FANOUT=32 +# CONFIG_RCU_FANOUT_EXACT is not set +# CONFIG_TREE_RCU_TRACE is not set +# CONFIG_IKCONFIG is not set +CONFIG_LOG_BUF_SHIFT=14 +# CONFIG_GROUP_SCHED is not set +# CONFIG_CGROUPS is not set +# CONFIG_SYSFS_DEPRECATED_V2 is not set +# CONFIG_RELAY is not set +# CONFIG_NAMESPACES is not set +# CONFIG_BLK_DEV_INITRD is not set +CONFIG_CC_OPTIMIZE_FOR_SIZE=y +CONFIG_SYSCTL=y +CONFIG_ANON_INODES=y +CONFIG_EMBEDDED=y +CONFIG_SYSCTL_SYSCALL=y +CONFIG_KALLSYMS=y +# CONFIG_KALLSYMS_EXTRA_PASS is not set +CONFIG_HOTPLUG=y +CONFIG_PRINTK=y +CONFIG_BUG=y +# CONFIG_ELF_CORE is not set +# CONFIG_PCSPKR_PLATFORM is not set +CONFIG_BASE_FULL=y +# CONFIG_FUTEX is not set +CONFIG_EPOLL=y +CONFIG_SIGNALFD=y +CONFIG_TIMERFD=y +CONFIG_EVENTFD=y +CONFIG_SHMEM=y +# CONFIG_AIO is not set + +# +# Kernel Performance Events And Counters +# +# CONFIG_VM_EVENT_COUNTERS is not set +# CONFIG_COMPAT_BRK is not set +CONFIG_SLAB=y +# CONFIG_SLUB is not set +# CONFIG_SLOB is not set +# CONFIG_PROFILING is not set +CONFIG_HAVE_OPROFILE=y + +# +# GCOV-based kernel profiling +# +# CONFIG_SLOW_WORK is not set +CONFIG_HAVE_GENERIC_DMA_COHERENT=y +CONFIG_SLABINFO=y +CONFIG_BASE_SMALL=0 +CONFIG_MODULES=y +# CONFIG_MODULE_FORCE_LOAD is not set +CONFIG_MODULE_UNLOAD=y +# CONFIG_MODULE_FORCE_UNLOAD is not set +# CONFIG_MODVERSIONS is not set +# CONFIG_MODULE_SRCVERSION_ALL is not set +CONFIG_BLOCK=y +# CONFIG_LBDAF is not set +# CONFIG_BLK_DEV_BSG is not set +# CONFIG_BLK_DEV_INTEGRITY is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +# CONFIG_IOSCHED_AS is not set +CONFIG_IOSCHED_DEADLINE=y +# CONFIG_IOSCHED_CFQ is not set +# CONFIG_DEFAULT_AS is not set +CONFIG_DEFAULT_DEADLINE=y +# CONFIG_DEFAULT_CFQ is not set +# CONFIG_DEFAULT_NOOP is not set +CONFIG_DEFAULT_IOSCHED="deadline" +# CONFIG_FREEZER is not set + +# +# Bus options (PCI, PCMCIA, EISA, ISA, TC) +# +# CONFIG_ARCH_SUPPORTS_MSI is not set +CONFIG_MMU=y +# CONFIG_PCCARD is not set + +# +# Executable file formats +# +CONFIG_BINFMT_ELF=y +# CONFIG_HAVE_AOUT is not set +# CONFIG_BINFMT_MISC is not set +CONFIG_TRAD_SIGNALS=y + +# +# Power management options +# +CONFIG_ARCH_HIBERNATION_POSSIBLE=y +CONFIG_ARCH_SUSPEND_POSSIBLE=y +# CONFIG_PM is not set +CONFIG_NET=y + +# +# Networking options +# +CONFIG_PACKET=y +CONFIG_PACKET_MMAP=y +CONFIG_UNIX=y +# CONFIG_NET_KEY is not set +CONFIG_INET=y +CONFIG_IP_MULTICAST=y +CONFIG_IP_ADVANCED_ROUTER=y +CONFIG_ASK_IP_FIB_HASH=y +# CONFIG_IP_FIB_TRIE is not set +CONFIG_IP_FIB_HASH=y +# CONFIG_IP_MULTIPLE_TABLES is not set +# CONFIG_IP_ROUTE_MULTIPATH is not set +# CONFIG_IP_ROUTE_VERBOSE is not set +# CONFIG_IP_PNP is not set +# CONFIG_NET_IPIP is not set +# CONFIG_NET_IPGRE is not set +# CONFIG_IP_MROUTE is not set +# CONFIG_ARPD is not set +CONFIG_SYN_COOKIES=y +# CONFIG_INET_AH is not set +# CONFIG_INET_ESP is not set +# CONFIG_INET_IPCOMP is not set +# CONFIG_INET_XFRM_TUNNEL is not set +# CONFIG_INET_TUNNEL is not set +# CONFIG_INET_XFRM_MODE_TRANSPORT is not set +# CONFIG_INET_XFRM_MODE_TUNNEL is not set +# CONFIG_INET_XFRM_MODE_BEET is not set +CONFIG_INET_LRO=y +CONFIG_INET_DIAG=y +CONFIG_INET_TCP_DIAG=y +CONFIG_TCP_CONG_ADVANCED=y +# CONFIG_TCP_CONG_BIC is not set +CONFIG_TCP_CONG_CUBIC=y +# CONFIG_TCP_CONG_WESTWOOD is not set +# CONFIG_TCP_CONG_HTCP is not set +# CONFIG_TCP_CONG_HSTCP is not set +# CONFIG_TCP_CONG_HYBLA is not set +# CONFIG_TCP_CONG_VEGAS is not set +# CONFIG_TCP_CONG_SCALABLE is not set +# CONFIG_TCP_CONG_LP is not set +# CONFIG_TCP_CONG_VENO is not set +# CONFIG_TCP_CONG_YEAH is not set +# CONFIG_TCP_CONG_ILLINOIS is not set +# CONFIG_DEFAULT_BIC is not set +CONFIG_DEFAULT_CUBIC=y +# CONFIG_DEFAULT_HTCP is not set +# CONFIG_DEFAULT_VEGAS is not set +# CONFIG_DEFAULT_WESTWOOD is not set +# CONFIG_DEFAULT_RENO is not set +CONFIG_DEFAULT_TCP_CONG="cubic" +# CONFIG_TCP_MD5SIG is not set +# CONFIG_IPV6 is not set +# CONFIG_NETWORK_SECMARK is not set +# CONFIG_NETFILTER is not set +# CONFIG_IP_DCCP is not set +# CONFIG_IP_SCTP is not set +# CONFIG_RDS is not set +# CONFIG_TIPC is not set +# CONFIG_ATM is not set +# CONFIG_BRIDGE is not set +# CONFIG_NET_DSA is not set +# CONFIG_VLAN_8021Q is not set +# CONFIG_DECNET is not set +# CONFIG_LLC2 is not set +# CONFIG_IPX is not set +# CONFIG_ATALK is not set +# CONFIG_X25 is not set +# CONFIG_LAPB is not set +# CONFIG_ECONET is not set +# CONFIG_WAN_ROUTER is not set +# CONFIG_PHONET is not set +# CONFIG_IEEE802154 is not set +# CONFIG_NET_SCHED is not set +# CONFIG_DCB is not set + +# +# Network testing +# +# CONFIG_NET_PKTGEN is not set +# CONFIG_HAMRADIO is not set +# CONFIG_CAN is not set +# CONFIG_IRDA is not set +# CONFIG_BT is not set +# CONFIG_AF_RXRPC is not set +CONFIG_WIRELESS=y +# CONFIG_CFG80211 is not set +CONFIG_CFG80211_DEFAULT_PS_VALUE=0 +# CONFIG_WIRELESS_OLD_REGULATORY is not set +# CONFIG_WIRELESS_EXT is not set +# CONFIG_LIB80211 is not set + +# +# CFG80211 needs to be enabled for MAC80211 +# +# CONFIG_WIMAX is not set +# CONFIG_RFKILL is not set +# CONFIG_NET_9P is not set + +# +# Device Drivers +# + +# +# Generic Driver Options +# +CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" +# CONFIG_DEVTMPFS is not set +CONFIG_STANDALONE=y +# CONFIG_PREVENT_FIRMWARE_BUILD is not set +# CONFIG_FW_LOADER is not set +# CONFIG_SYS_HYPERVISOR is not set +# CONFIG_CONNECTOR is not set +CONFIG_MTD=y +# CONFIG_MTD_DEBUG is not set +# CONFIG_MTD_TESTS is not set +# CONFIG_MTD_CONCAT is not set +CONFIG_MTD_PARTITIONS=y +CONFIG_MTD_ROOTFS_ROOT_DEV=y +# CONFIG_MTD_REDBOOT_PARTS is not set +# CONFIG_MTD_CMDLINE_PARTS is not set +CONFIG_MTD_AR7_PARTS=y + +# +# User Modules And Translation Layers +# +CONFIG_MTD_CHAR=y +CONFIG_MTD_BLKDEVS=y +CONFIG_MTD_BLOCK=y +# CONFIG_FTL is not set +# CONFIG_NFTL is not set +# CONFIG_INFTL is not set +# CONFIG_RFD_FTL is not set +# CONFIG_SSFDC is not set +# CONFIG_MTD_OOPS is not set + +# +# RAM/ROM/Flash chip drivers +# +CONFIG_MTD_CFI=y +# CONFIG_MTD_JEDECPROBE is not set +CONFIG_MTD_GEN_PROBE=y +# CONFIG_MTD_CFI_ADV_OPTIONS is not set +# CONFIG_MTD_CFI_NOSWAP is not set +# CONFIG_MTD_CFI_BE_BYTE_SWAP is not set +# CONFIG_MTD_CFI_LE_BYTE_SWAP is not set +CONFIG_MTD_MAP_BANK_WIDTH_1=y +CONFIG_MTD_MAP_BANK_WIDTH_2=y +CONFIG_MTD_MAP_BANK_WIDTH_4=y +# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set +# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set +# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set +CONFIG_MTD_CFI_I1=y +CONFIG_MTD_CFI_I2=y +# CONFIG_MTD_CFI_I4 is not set +# CONFIG_MTD_CFI_I8 is not set +# CONFIG_MTD_CFI_INTELEXT is not set +CONFIG_MTD_CFI_AMDSTD=y +# CONFIG_MTD_CFI_STAA is not set +CONFIG_MTD_CFI_UTIL=y +# CONFIG_MTD_RAM is not set +# CONFIG_MTD_ROM is not set +# CONFIG_MTD_ABSENT is not set + +# +# Mapping drivers for chip access +# +CONFIG_MTD_COMPLEX_MAPPINGS=y +CONFIG_MTD_PHYSMAP=y +# CONFIG_MTD_PHYSMAP_COMPAT is not set +# CONFIG_MTD_GPIO_ADDR is not set +# CONFIG_MTD_PLATRAM is not set + +# +# Self-contained MTD device drivers +# +# CONFIG_MTD_SLRAM is not set +# CONFIG_MTD_PHRAM is not set +# CONFIG_MTD_MTDRAM is not set +# CONFIG_MTD_BLOCK2MTD is not set + +# +# Disk-On-Chip Device Drivers +# +# CONFIG_MTD_DOC2000 is not set +# CONFIG_MTD_DOC2001 is not set +# CONFIG_MTD_DOC2001PLUS is not set +# CONFIG_MTD_NAND is not set +# CONFIG_MTD_ONENAND is not set + +# +# LPDDR flash memory drivers +# +# CONFIG_MTD_LPDDR is not set + +# +# UBI - Unsorted block images +# +# CONFIG_MTD_UBI is not set +# CONFIG_PARPORT is not set +CONFIG_BLK_DEV=y +# CONFIG_BLK_DEV_COW_COMMON is not set +# CONFIG_BLK_DEV_LOOP is not set +# CONFIG_BLK_DEV_NBD is not set +# CONFIG_BLK_DEV_RAM is not set +# CONFIG_CDROM_PKTCDVD is not set +# CONFIG_ATA_OVER_ETH is not set +# CONFIG_BLK_DEV_HD is not set +# CONFIG_MISC_DEVICES is not set +CONFIG_HAVE_IDE=y +# CONFIG_IDE is not set + +# +# SCSI device support +# +# CONFIG_RAID_ATTRS is not set +# CONFIG_SCSI is not set +# CONFIG_SCSI_DMA is not set +# CONFIG_SCSI_NETLINK is not set +# CONFIG_ATA is not set +# CONFIG_MD is not set +CONFIG_NETDEVICES=y +# CONFIG_DUMMY is not set +# CONFIG_BONDING is not set +# CONFIG_MACVLAN is not set +# CONFIG_EQUALIZER is not set +# CONFIG_TUN is not set +# CONFIG_VETH is not set +CONFIG_PHYLIB=y +# CONFIG_SWCONFIG is not set + +# +# MII PHY device drivers +# +# CONFIG_MARVELL_PHY is not set +# CONFIG_DAVICOM_PHY is not set +# CONFIG_QSEMI_PHY is not set +# CONFIG_LXT_PHY is not set +# CONFIG_CICADA_PHY is not set +# CONFIG_VITESSE_PHY is not set +# CONFIG_SMSC_PHY is not set +# CONFIG_BROADCOM_PHY is not set +# CONFIG_ICPLUS_PHY is not set +# CONFIG_REALTEK_PHY is not set +# CONFIG_NATIONAL_PHY is not set +# CONFIG_STE10XP is not set +# CONFIG_LSI_ET1011C_PHY is not set +CONFIG_FIXED_PHY=y +# CONFIG_MDIO_BITBANG is not set +CONFIG_NET_ETHERNET=y +CONFIG_MII=y +# CONFIG_AX88796 is not set +# CONFIG_SMC91X is not set +# CONFIG_DM9000 is not set +# CONFIG_ETHOC is not set +# CONFIG_DNET is not set +# CONFIG_IBM_NEW_EMAC_ZMII is not set +# CONFIG_IBM_NEW_EMAC_RGMII is not set +# CONFIG_IBM_NEW_EMAC_TAH is not set +# CONFIG_IBM_NEW_EMAC_EMAC4 is not set +# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set +# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set +# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set +# CONFIG_B44 is not set +# CONFIG_KS8842 is not set +# CONFIG_KS8851_MLL is not set +CONFIG_CPMAC=y +# CONFIG_NETDEV_1000 is not set +# CONFIG_NETDEV_10000 is not set +CONFIG_WLAN=y +# CONFIG_WLAN_PRE80211 is not set +# CONFIG_WLAN_80211 is not set + +# +# Enable WiMAX (Networking options) to see the WiMAX drivers +# +# CONFIG_WAN is not set +# CONFIG_PPP is not set +# CONFIG_SLIP is not set +# CONFIG_NETCONSOLE is not set +# CONFIG_NETPOLL is not set +# CONFIG_NET_POLL_CONTROLLER is not set +# CONFIG_ISDN is not set +# CONFIG_PHONE is not set + +# +# Input device support +# +# CONFIG_INPUT is not set + +# +# Hardware I/O ports +# +# CONFIG_SERIO is not set +# CONFIG_GAMEPORT is not set + +# +# Character devices +# +# CONFIG_VT is not set +# CONFIG_DEVKMEM is not set +# CONFIG_SERIAL_NONSTANDARD is not set + +# +# Serial drivers +# +CONFIG_SERIAL_8250=y +CONFIG_SERIAL_8250_CONSOLE=y +CONFIG_SERIAL_8250_NR_UARTS=2 +CONFIG_SERIAL_8250_RUNTIME_UARTS=2 +# CONFIG_SERIAL_8250_EXTENDED is not set + +# +# Non-8250 serial port support +# +CONFIG_SERIAL_CORE=y +CONFIG_SERIAL_CORE_CONSOLE=y +CONFIG_UNIX98_PTYS=y +# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set +# CONFIG_LEGACY_PTYS is not set +# CONFIG_IPMI_HANDLER is not set +# CONFIG_HW_RANDOM is not set +# CONFIG_R3964 is not set +# CONFIG_RAW_DRIVER is not set +# CONFIG_TCG_TPM is not set +# CONFIG_I2C is not set +# CONFIG_SPI is not set + +# +# PPS support +# +# CONFIG_PPS is not set +# CONFIG_W1 is not set +# CONFIG_POWER_SUPPLY is not set +# CONFIG_HWMON is not set +# CONFIG_THERMAL is not set +CONFIG_WATCHDOG=y +# CONFIG_WATCHDOG_NOWAYOUT is not set + +# +# Watchdog Device Drivers +# +# CONFIG_SOFT_WATCHDOG is not set +CONFIG_AR7_WDT=y +CONFIG_SSB_POSSIBLE=y + +# +# Sonics Silicon Backplane +# +# CONFIG_SSB is not set + +# +# Multifunction device drivers +# +# CONFIG_MFD_CORE is not set +# CONFIG_MFD_SM501 is not set +# CONFIG_HTC_PASIC3 is not set +# CONFIG_MFD_TMIO is not set +# CONFIG_REGULATOR is not set +# CONFIG_MEDIA_SUPPORT is not set + +# +# Graphics support +# +# CONFIG_VGASTATE is not set +# CONFIG_VIDEO_OUTPUT_CONTROL is not set +# CONFIG_FB is not set +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set + +# +# Display device support +# +# CONFIG_DISPLAY_SUPPORT is not set +# CONFIG_SOUND is not set +# CONFIG_USB_SUPPORT is not set +# CONFIG_MMC is not set +# CONFIG_MEMSTICK is not set +# CONFIG_NEW_LEDS is not set +# CONFIG_ACCESSIBILITY is not set +CONFIG_RTC_LIB=y +# CONFIG_RTC_CLASS is not set +# CONFIG_DMADEVICES is not set +# CONFIG_AUXDISPLAY is not set +# CONFIG_UIO is not set + +# +# TI VLYNQ +# +CONFIG_VLYNQ=y +# CONFIG_STAGING is not set + +# +# File systems +# +# CONFIG_EXT2_FS is not set +# CONFIG_EXT3_FS is not set +# CONFIG_EXT4_FS is not set +# CONFIG_REISERFS_FS is not set +# CONFIG_JFS_FS is not set +# CONFIG_FS_POSIX_ACL is not set +# CONFIG_XFS_FS is not set +# CONFIG_OCFS2_FS is not set +# CONFIG_BTRFS_FS is not set +# CONFIG_NILFS2_FS is not set +# CONFIG_AUFS_FS is not set +CONFIG_FILE_LOCKING=y +# CONFIG_FSNOTIFY is not set +# CONFIG_DNOTIFY is not set +# CONFIG_INOTIFY is not set +# CONFIG_INOTIFY_USER is not set +# CONFIG_QUOTA is not set +# CONFIG_AUTOFS_FS is not set +# CONFIG_AUTOFS4_FS is not set +# CONFIG_FUSE_FS is not set + +# +# Caches +# +# CONFIG_FSCACHE is not set + +# +# CD-ROM/DVD Filesystems +# +# CONFIG_ISO9660_FS is not set +# CONFIG_UDF_FS is not set + +# +# DOS/FAT/NT Filesystems +# +# CONFIG_MSDOS_FS is not set +# CONFIG_VFAT_FS is not set +# CONFIG_NTFS_FS is not set + +# +# Pseudo filesystems +# +CONFIG_PROC_FS=y +# CONFIG_PROC_KCORE is not set +CONFIG_PROC_SYSCTL=y +# CONFIG_PROC_PAGE_MONITOR is not set +CONFIG_SYSFS=y +CONFIG_TMPFS=y +# CONFIG_TMPFS_POSIX_ACL is not set +# CONFIG_HUGETLB_PAGE is not set +# CONFIG_CONFIGFS_FS is not set +CONFIG_MISC_FILESYSTEMS=y +# CONFIG_ADFS_FS is not set +# CONFIG_AFFS_FS is not set +# CONFIG_HFS_FS is not set +# CONFIG_HFSPLUS_FS is not set +# CONFIG_BEFS_FS is not set +# CONFIG_BFS_FS is not set +# CONFIG_EFS_FS is not set +# CONFIG_YAFFS_FS is not set +# CONFIG_JFFS2_FS is not set +# CONFIG_CRAMFS is not set +# CONFIG_SQUASHFS is not set +# CONFIG_VXFS_FS is not set +# CONFIG_MINIX_FS is not set +# CONFIG_OMFS_FS is not set +# CONFIG_HPFS_FS is not set +# CONFIG_QNX4FS_FS is not set +# CONFIG_ROMFS_FS is not set +# CONFIG_SYSV_FS is not set +# CONFIG_UFS_FS is not set +CONFIG_NETWORK_FILESYSTEMS=y +# CONFIG_NFS_FS is not set +# CONFIG_NFSD is not set +# CONFIG_SMB_FS is not set +# CONFIG_CIFS is not set +# CONFIG_NCP_FS is not set +# CONFIG_CODA_FS is not set +# CONFIG_AFS_FS is not set + +# +# Partition Types +# +# CONFIG_PARTITION_ADVANCED is not set +CONFIG_MSDOS_PARTITION=y +# CONFIG_NLS is not set +# CONFIG_DLM is not set + +# +# Kernel hacking +# +CONFIG_TRACE_IRQFLAGS_SUPPORT=y +CONFIG_PRINTK_TIME=y +# CONFIG_ENABLE_WARN_DEPRECATED is not set +# CONFIG_ENABLE_MUST_CHECK is not set +CONFIG_FRAME_WARN=1024 +CONFIG_MAGIC_SYSRQ=y +# CONFIG_STRIP_ASM_SYMS is not set +# CONFIG_UNUSED_SYMBOLS is not set +# CONFIG_DEBUG_FS is not set +# CONFIG_HEADERS_CHECK is not set +# CONFIG_DEBUG_KERNEL is not set +# CONFIG_DEBUG_MEMORY_INIT is not set +# CONFIG_RCU_CPU_STALL_DETECTOR is not set +# CONFIG_SYSCTL_SYSCALL_CHECK is not set +CONFIG_TRACING_SUPPORT=y +# CONFIG_FTRACE is not set +# CONFIG_SAMPLES is not set +CONFIG_HAVE_ARCH_KGDB=y +CONFIG_CMDLINE="console=ttyS0,38400 cpmac.dumb_switch=1" + +# +# Security options +# +# CONFIG_KEYS is not set +# CONFIG_SECURITY is not set +# CONFIG_SECURITYFS is not set +# CONFIG_SECURITY_FILE_CAPABILITIES is not set +CONFIG_CRYPTO=y + +# +# Crypto core or helper +# +# CONFIG_CRYPTO_MANAGER is not set +# CONFIG_CRYPTO_MANAGER2 is not set +# CONFIG_CRYPTO_GF128MUL is not set +# CONFIG_CRYPTO_NULL is not set +# CONFIG_CRYPTO_CRYPTD is not set +# CONFIG_CRYPTO_AUTHENC is not set +# CONFIG_CRYPTO_TEST is not set + +# +# Authenticated Encryption with Associated Data +# +# CONFIG_CRYPTO_CCM is not set +# CONFIG_CRYPTO_GCM is not set +# CONFIG_CRYPTO_SEQIV is not set + +# +# Block modes +# +# CONFIG_CRYPTO_CBC is not set +# CONFIG_CRYPTO_CTR is not set +# CONFIG_CRYPTO_CTS is not set +# CONFIG_CRYPTO_ECB is not set +# CONFIG_CRYPTO_LRW is not set +# CONFIG_CRYPTO_PCBC is not set +# CONFIG_CRYPTO_XTS is not set + +# +# Hash modes +# +# CONFIG_CRYPTO_HMAC is not set +# CONFIG_CRYPTO_XCBC is not set +# CONFIG_CRYPTO_VMAC is not set + +# +# Digest +# +# CONFIG_CRYPTO_CRC32C is not set +# CONFIG_CRYPTO_GHASH is not set +# CONFIG_CRYPTO_MD4 is not set +# CONFIG_CRYPTO_MD5 is not set +# CONFIG_CRYPTO_MICHAEL_MIC is not set +# CONFIG_CRYPTO_RMD128 is not set +# CONFIG_CRYPTO_RMD160 is not set +# CONFIG_CRYPTO_RMD256 is not set +# CONFIG_CRYPTO_RMD320 is not set +# CONFIG_CRYPTO_SHA1 is not set +# CONFIG_CRYPTO_SHA256 is not set +# CONFIG_CRYPTO_SHA512 is not set +# CONFIG_CRYPTO_TGR192 is not set +# CONFIG_CRYPTO_WP512 is not set + +# +# Ciphers +# +# CONFIG_CRYPTO_AES is not set +# CONFIG_CRYPTO_ANUBIS is not set +# CONFIG_CRYPTO_ARC4 is not set +# CONFIG_CRYPTO_BLOWFISH is not set +# CONFIG_CRYPTO_CAMELLIA is not set +# CONFIG_CRYPTO_CAST5 is not set +# CONFIG_CRYPTO_CAST6 is not set +# CONFIG_CRYPTO_DES is not set +# CONFIG_CRYPTO_FCRYPT is not set +# CONFIG_CRYPTO_KHAZAD is not set +# CONFIG_CRYPTO_SALSA20 is not set +# CONFIG_CRYPTO_SEED is not set +# CONFIG_CRYPTO_SERPENT is not set +# CONFIG_CRYPTO_TEA is not set +# CONFIG_CRYPTO_TWOFISH is not set + +# +# Compression +# +# CONFIG_CRYPTO_DEFLATE is not set +# CONFIG_CRYPTO_ZLIB is not set +# CONFIG_CRYPTO_LZO is not set + +# +# Random Number Generation +# +# CONFIG_CRYPTO_ANSI_CPRNG is not set +# CONFIG_CRYPTO_HW is not set + +# +# OCF Configuration +# +# CONFIG_OCF_OCF is not set +# CONFIG_BINARY_PRINTF is not set + +# +# Library routines +# +CONFIG_GENERIC_FIND_LAST_BIT=y +# CONFIG_CRC_CCITT is not set +# CONFIG_CRC16 is not set +# CONFIG_CRC_T10DIF is not set +# CONFIG_CRC_ITU_T is not set +# CONFIG_CRC32 is not set +# CONFIG_CRC7 is not set +# CONFIG_LIBCRC32C is not set +CONFIG_HAS_IOMEM=y +CONFIG_HAS_IOPORT=y +CONFIG_HAS_DMA=y +CONFIG_NLATTR=y diff --git a/target/ag241/patches/ar7.patch b/target/ag241/patches/ar7.patch new file mode 100644 index 000000000..e1866f572 --- /dev/null +++ b/target/ag241/patches/ar7.patch @@ -0,0 +1,78 @@ +diff -Nur linux-2.6.32.orig/arch/mips/ar7/platform.c linux-2.6.32/arch/mips/ar7/platform.c +--- linux-2.6.32.orig/arch/mips/ar7/platform.c 2009-12-03 04:51:21.000000000 +0100 ++++ linux-2.6.32/arch/mips/ar7/platform.c 2009-12-15 18:27:15.208942638 +0100 +@@ -509,7 +509,7 @@ + + memset(uart_port, 0, sizeof(struct uart_port) * 2); + +- uart_port[0].type = PORT_16550A; ++ uart_port[0].type = PORT_AR7; + uart_port[0].line = 0; + uart_port[0].irq = AR7_IRQ_UART0; + uart_port[0].uartclk = ar7_bus_freq() / 2; +@@ -524,7 +524,7 @@ + + /* Only TNETD73xx have a second serial port */ + if (ar7_has_second_uart()) { +- uart_port[1].type = PORT_16550A; ++ uart_port[1].type = PORT_AR7; + uart_port[1].line = 1; + uart_port[1].irq = AR7_IRQ_UART1; + uart_port[1].uartclk = ar7_bus_freq() / 2; +diff -Nur linux-2.6.32.orig/arch/mips/include/asm/page.h linux-2.6.32/arch/mips/include/asm/page.h +--- linux-2.6.32.orig/arch/mips/include/asm/page.h 2009-12-03 04:51:21.000000000 +0100 ++++ linux-2.6.32/arch/mips/include/asm/page.h 2009-12-14 22:03:51.157752807 +0100 +@@ -200,8 +200,11 @@ + #define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ + VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) + +-#define UNCAC_ADDR(addr) ((addr) - PAGE_OFFSET + UNCAC_BASE) +-#define CAC_ADDR(addr) ((addr) - UNCAC_BASE + PAGE_OFFSET) ++#define UNCAC_ADDR(addr) ((addr) - PAGE_OFFSET + UNCAC_BASE + \ ++ PHYS_OFFSET) ++#define CAC_ADDR(addr) ((addr) - UNCAC_BASE + PAGE_OFFSET - \ ++ PHYS_OFFSET) ++ + + #include + #include +diff -Nur linux-2.6.32.orig/arch/mips/Kconfig linux-2.6.32/arch/mips/Kconfig +--- linux-2.6.32.orig/arch/mips/Kconfig 2009-12-14 21:11:40.737752912 +0100 ++++ linux-2.6.32/arch/mips/Kconfig 2009-12-14 21:00:48.533738664 +0100 +@@ -30,7 +30,6 @@ + select CEVT_R4K + select CSRC_R4K + select IRQ_CPU +- select NO_EXCEPT_FILL + select SWAP_IO_SPACE + select SYS_HAS_CPU_MIPS32_R1 + select SYS_HAS_EARLY_PRINTK +diff -Nur linux-2.6.32.orig/arch/mips/kernel/traps.c linux-2.6.32/arch/mips/kernel/traps.c +--- linux-2.6.32.orig/arch/mips/kernel/traps.c 2009-12-03 04:51:21.000000000 +0100 ++++ linux-2.6.32/arch/mips/kernel/traps.c 2009-12-14 22:25:58.329754617 +0100 +@@ -1255,9 +1255,22 @@ + + exception_handlers[n] = handler; + if (n == 0 && cpu_has_divec) { +- *(u32 *)(ebase + 0x200) = 0x08000000 | +- (0x03ffffff & (handler >> 2)); +- local_flush_icache_range(ebase + 0x200, ebase + 0x204); ++ if ((handler ^ (ebase + 4)) & 0xfc000000) { ++ /* lui k0, 0x0000 */ ++ *(u32 *)(ebase + 0x200) = 0x3c1a0000 | (handler >> 16); ++ /* ori k0, 0x0000 */ ++ *(u32 *)(ebase + 0x204) = ++ 0x375a0000 | (handler & 0xffff); ++ /* jr k0 */ ++ *(u32 *)(ebase + 0x208) = 0x03400008; ++ /* nop */ ++ *(u32 *)(ebase + 0x20C) = 0x00000000; ++ flush_icache_range(ebase + 0x200, ebase + 0x210); ++ } else { ++ *(u32 *)(ebase + 0x200) = ++ 0x08000000 | (0x03ffffff & (handler >> 2)); ++ flush_icache_range(ebase + 0x200, ebase + 0x204); ++ } + } + return (void *)old_handler; + } diff --git a/target/ag241/target.mk b/target/ag241/target.mk new file mode 100644 index 000000000..95f01766b --- /dev/null +++ b/target/ag241/target.mk @@ -0,0 +1,7 @@ +ARCH:= mips +CPU_ARCH:= mipsel +KERNEL_VERSION:= 2.6.32 +KERNEL_RELEASE:= 1 +KERNEL_MD5SUM:= 260551284ac224c3a43c4adac7df4879 +TARGET_OPTIMIZATION:= -Os -pipe +TARGET_CFLAGS_ARCH:= -march=mips32 diff --git a/target/ag241/tools/addpattern/Makefile b/target/ag241/tools/addpattern/Makefile new file mode 100644 index 000000000..3ac1884fa --- /dev/null +++ b/target/ag241/tools/addpattern/Makefile @@ -0,0 +1,4 @@ +include $(TOPDIR)/rules.mk + +all: + $(HOSTCC) ${HOSTCFLAGS} -o ${STAGING_TOOLS}/bin/addpattern addpattern.c diff --git a/target/ag241/tools/addpattern/addpattern.c b/target/ag241/tools/addpattern/addpattern.c new file mode 100644 index 000000000..6f2a036c0 --- /dev/null +++ b/target/ag241/tools/addpattern/addpattern.c @@ -0,0 +1,255 @@ +/* + * Copyright (C) 2004 Manuel Novoa III + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* July 29, 2004 + * + * This is a hacked replacement for the 'addpattern' utility used to + * create wrt54g .bin firmware files. It isn't pretty, but it does + * the job for me. + * + * Extensions: + * -v allows setting the version string on the command line. + * -{0|1} sets the (currently ignored) hw_ver flag in the header + * to 0 or 1 respectively. + */ + +/* January 12, 2005 + * + * Modified by rodent at rodent dot za dot net + * Support added for the new WRT54G v2.2 and WRT54GS v1.1 "flags" + * Without the flags set to 0x7, the above units will refuse to flash. + * + * Extensions: + * -{0|1|2} sets {0|1} sets hw_ver flag to 0/1. {2} sets hw_ver to 1 + * and adds the new hardware "flags" for the v2.2/v1.1 units +*/ + +/* January 1, 2007 + * + * Modified by juan.i.gonzalez at subdown dot net + * Support added for the AG241v2 and similar + * + * Extensions: + * -r #.# adds revision hardware flags. AG241v2 and similar. + * + * AG241V2 firmware sets the hw_ver to 0x44. + * + * Example: -r 2.0 + * + * Convert 2.0 to 20 to be an integer, and add 0x30 to skip special ASCII + * #define HW_Version ((HW_REV * 10) + 0x30) -> from cyutils.h +*/ + +#include +#include +#include +#include +#include +#include + +/**********************************************************************/ + +#define CODE_ID "U2ND" /* from code_pattern.h */ +#define CODE_PATTERN "W54S" /* from code_pattern.h */ +#define PBOT_PATTERN "PBOT" + +#define CYBERTAN_VERSION "v3.37.2" /* from cyutils.h */ + +/* WRT54G v2.2 and WRT54GS v1.1 "flags" (from 3.37.32 firmware cyutils.h) */ +#define SUPPORT_4712_CHIP 0x0001 +#define SUPPORT_INTEL_FLASH 0x0002 +#define SUPPORT_5325E_SWITCH 0x0004 + +struct code_header { /* from cyutils.h */ + char magic[4]; + char res1[4]; /* for extra magic */ + char fwdate[3]; + char fwvern[3]; + char id[4]; /* U2ND */ + char hw_ver; /* 0: for 4702, 1: for 4712 -- new in 2.04.3 */ + char unused; + unsigned char flags[2]; /* SUPPORT_ flags new for 3.37.2 (WRT54G v2.2 and WRT54GS v1.1) */ + unsigned char res2[10]; +} ; + +/**********************************************************************/ + +void usage(void) __attribute__ (( __noreturn__ )); + +void usage(void) +{ + fprintf(stderr, "Usage: addpattern [-i trxfile] [-o binfile] [-p pattern] [-g] [-b] [-v v#.#.#] [-r #.#] [-{0|1|2|4}] -h\n"); + exit(EXIT_FAILURE); +} + +int main(int argc, char **argv) +{ + char buf[1024]; /* keep this at 1k or adjust garbage calc below */ + struct code_header *hdr; + FILE *in = stdin; + FILE *out = stdout; + char *ifn = NULL; + char *ofn = NULL; + char *pattern = CODE_PATTERN; + char *pbotpat = PBOT_PATTERN; + char *version = CYBERTAN_VERSION; + int gflag = 0; + int pbotflag = 0; + int c; + int v0, v1, v2; + size_t off, n; + time_t t; + struct tm *ptm; + + fprintf(stderr, "mjn3's addpattern replacement - v0.81\n"); + + hdr = (struct code_header *) buf; + memset(hdr, 0, sizeof(struct code_header)); + + while ((c = getopt(argc, argv, "i:o:p:gbv:0124hr:")) != -1) { + switch (c) { + case 'i': + ifn = optarg; + break; + case 'o': + ofn = optarg; + break; + case 'p': + pattern = optarg; + break; + case 'g': + gflag = 1; + break; + case 'b': + pbotflag = 1; + break; + case 'v': /* extension to allow setting version */ + version = optarg; + break; + case '0': + hdr->hw_ver = 0; + break; + case '1': + hdr->hw_ver = 1; + break; + case '2': /* new 54G v2.2 and 54GS v1.1 flags */ + hdr->hw_ver = 1; + hdr->flags[0] |= SUPPORT_4712_CHIP; + hdr->flags[0] |= SUPPORT_INTEL_FLASH; + hdr->flags[0] |= SUPPORT_5325E_SWITCH; + break; + case '4': + /* V4 firmware sets the flags to 0x1f */ + hdr->hw_ver = 0; + hdr->flags[0] = 0x1f; + break; + case 'r': + hdr->hw_ver = (char)(atof(optarg)*10)+0x30; + break; + + case 'h': + default: + usage(); + } + } + + if (optind != argc || optind == 1) { + fprintf(stderr, "illegal arg \"%s\"\n", argv[optind]); + usage(); + } + + if (strlen(pattern) != 4) { + fprintf(stderr, "illegal pattern \"%s\": length != 4\n", pattern); + usage(); + } + + if (ifn && !(in = fopen(ifn, "r"))) { + fprintf(stderr, "can not open \"%s\" for reading\n", ifn); + usage(); + } + + if (ofn && !(out = fopen(ofn, "w"))) { + fprintf(stderr, "can not open \"%s\" for writing\n", ofn); + usage(); + } + + if (time(&t) == (time_t)(-1)) { + fprintf(stderr, "time call failed\n"); + return EXIT_FAILURE; + } + + ptm = localtime(&t); + + if (3 != sscanf(version, "v%d.%d.%d", &v0, &v1, &v2)) { + fprintf(stderr, "bad version string \"%s\"\n", version); + return EXIT_FAILURE; + } + + memcpy(&hdr->magic, pattern, 4); + if (pbotflag) + memcpy(&hdr->res1, pbotpat, 4); + hdr->fwdate[0] = ptm->tm_year % 100; + hdr->fwdate[1] = ptm->tm_mon + 1; + hdr->fwdate[2] = ptm->tm_mday; + hdr->fwvern[0] = v0; + hdr->fwvern[1] = v1; + hdr->fwvern[2] = v2; + memcpy(&hdr->id, CODE_ID, strlen(CODE_ID)); + + off = sizeof(struct code_header); + + fprintf(stderr, "writing firmware v%d.%d.%d on %d/%d/%d (y/m/d)\n", + v0, v1, v2, + hdr->fwdate[0], hdr->fwdate[1], hdr->fwdate[2]); + + + while ((n = fread(buf + off, 1, sizeof(buf)-off, in) + off) > 0) { + off = 0; + if (n < sizeof(buf)) { + if (ferror(in)) { + FREAD_ERROR: + fprintf(stderr, "fread error\n"); + return EXIT_FAILURE; + } + if (gflag) { + gflag = sizeof(buf) - n; + memset(buf + n, 0xff, gflag); + fprintf(stderr, "adding %d bytes of garbage\n", gflag); + n = sizeof(buf); + } + } + if (!fwrite(buf, n, 1, out)) { + FWRITE_ERROR: + fprintf(stderr, "fwrite error\n"); + return EXIT_FAILURE; + } + } + + if (ferror(in)) { + goto FREAD_ERROR; + } + + if (fflush(out)) { + goto FWRITE_ERROR; + } + + fclose(in); + fclose(out); + + return EXIT_SUCCESS; +} diff --git a/target/ag241/tools/rules.mk b/target/ag241/tools/rules.mk new file mode 100644 index 000000000..8d03c031a --- /dev/null +++ b/target/ag241/tools/rules.mk @@ -0,0 +1,9 @@ +# $Id$ +#- +# This file is part of the OpenADK project. OpenADK is copyrighted +# material, please see the LICENCE file in the top-level directory. + +WRKDIR_BASE= ${TOOLS_BUILD_DIR} +WRKDIR= ${WRKDIR_BASE} + +include ${TOPDIR}/mk/buildhlp.mk diff --git a/target/ag241/tools/squashfs/Makefile b/target/ag241/tools/squashfs/Makefile new file mode 100644 index 000000000..0887afc22 --- /dev/null +++ b/target/ag241/tools/squashfs/Makefile @@ -0,0 +1,27 @@ +# $Id$ +#- +# This file is part of the OpenADK project. OpenADK is copyrighted +# material, please see the LICENCE file in the top-level directory. + +include $(TOPDIR)/rules.mk + +PKG_NAME:= squashfs +PKG_VERSION:= 4.0 +PKG_RELEASE:= 1 +PKG_MD5SUM:= a3c23391da4ebab0ac4a75021ddabf96 +PKG_SITES:= ${MASTER_SITE_SOURCEFORGE:=squashfs/} +DISTFILES:= ${PKG_NAME}${PKG_VERSION}.tar.gz +WRKDIST= ${WRKDIR}/$(PKG_NAME)${PKG_VERSION} + +include ../rules.mk + +$(WRKBUILD)/.compiled: ${WRKDIST}/.prepared + $(MAKE) -C $(WRKBUILD)/squashfs-tools + touch $@ + +$(WRKBUILD)/.installed: + $(INSTALL_BIN) $(WRKBUILD)/squashfs-tools/mksquashfs \ + ${STAGING_TOOLS}/bin + touch $@ + +include $(TOPDIR)/mk/tools.mk diff --git a/target/ag241/tools/srec2bin/Makefile b/target/ag241/tools/srec2bin/Makefile new file mode 100644 index 000000000..dd6a285fd --- /dev/null +++ b/target/ag241/tools/srec2bin/Makefile @@ -0,0 +1,4 @@ +include $(TOPDIR)/rules.mk + +all: + $(HOSTCC) ${HOSTCFLAGS} -o ${STAGING_TOOLS}/bin/srec2bin srec2bin.c diff --git a/target/ag241/tools/srec2bin/srec2bin.c b/target/ag241/tools/srec2bin/srec2bin.c new file mode 100644 index 000000000..1cffbaed9 --- /dev/null +++ b/target/ag241/tools/srec2bin/srec2bin.c @@ -0,0 +1,524 @@ +#include +#include +#include + +//Rev 0.1 Original +// 8 Jan 2001 MJH Added code to write data to Binary file +// note: outputfile is name.bin, where name is first part +// of input file. ie tmp.rec -> tmp.bin +// +// srec2bin +// +// TAG +// bit32u TAG_BIG = 0xDEADBE42; +// bit32u TAG_LITTLE = 0xFEEDFA42; +// +// File Structure +// +// TAG : 32 Bits +// [DATA RECORDS] +// +// Data Records Structure +// +// LENGTH : 32 Bits <- Length of DATA, excludes ADDRESS and CHECKSUM +// ADDRESS : 32 Bits +// DATA : 8 Bits * LENGTH +// CHECKSUM: 32 Bits <- 0 - (Sum of Length --> End of Data) +// +// Note : If Length == 0, Address will be Program Start +// +// +// +// +// + +#define MajRevNum 0 +#define MinRevNum 2 + + +#define EndianSwitch(x) ((x >> 24) | (x << 24) | ((x << 8) & (0x00FF0000)) | ((x >> 8) & (0x0000FF00)) ) + +typedef unsigned char bit8u; +typedef unsigned int bit32u; +typedef int bit32; + +#define FALSE 0 +#define TRUE (!FALSE) + + +bit32u CheckSum; +int RecStart; +int debug; +int verbose; + +FILE *OpenOutputFile( char *Name ); +FILE *fOut; +bit32u RecLength=0; + +bit32u AddressCurrent; + +bit32u gh(char *cp,int nibs); + +int BigEndian; + +int inputline; + +// char buf[16*1024]; + +char buffer[2048]; +char *cur_ptr; +int cur_line=0; +int cur_len=0; + +int s1s2s3_total=0; + +bit32u PBVal; +int PBValid; +bit32u PBAdr; + + +void dumpfTell(char *s, bit32u Value) +{ + int Length; + Length = (int) RecLength; + if (debug) + printf("[%s ] ftell()[0x%08lX] Length[0x%4X] Length[%4d] Value[0x%08x]\n", + s, ftell(fOut), Length, Length, Value); +} + +void DispHex(bit32u Hex) +{ +// printf("%X", Hex); +} + +void WaitDisplay(void) +{ + static int Count=0; + static int Index=0; + char iline[]={"-\\|/"}; + + Count++; + if ((Count % 32)==0) + { + if (verbose) + printf("%c%c",iline[Index++],8); + Index &= 3; + } +} + + +void binOut32 ( bit32u Data ) +{ +// On UNIX machine all 32bit writes need ENDIAN switched +// Data = EndianSwitch(Data); +// fwrite( &Data, sizeof(bit32u), 1, fOut); + + char sdat[4]; + int i; + + for(i=0;i<4;i++) + sdat[i]=(char)(Data>>(i*8)); + fwrite( sdat, 1, 4, fOut); + dumpfTell("Out32" , Data); +} + +// Only update RecLength on Byte Writes +// All 32 bit writes will be for Length etc + +void binOut8 ( bit8u Data ) +{ + int n; + dumpfTell("B4Data" , (bit32u) (Data & 0xFF) ); + n = fwrite( &Data, sizeof(bit8u), 1, fOut); + if (n != 1) + printf("Error in writing %X for Address 0x%8X\n", Data, AddressCurrent); + RecLength += 1; +} + +// Currently ONLY used for outputting Program Start + +void binRecStart(bit32u Address) +{ + RecLength = 0; + CheckSum = Address; + RecStart = TRUE; + + if (debug) + printf("[RecStart] CheckSum[0x%08X] Length[%4d] Address[0x%08X]\n", + CheckSum, RecLength, Address); + + + dumpfTell("RecLength", RecLength); + binOut32( RecLength ); + dumpfTell("Address", Address); + binOut32( Address ); +} + +void binRecEnd(void) +{ + long RecEnd; + + if (!RecStart) // if no record started, do not end it + { + return; + } + + RecStart = FALSE; + + + RecEnd = ftell(fOut); // Save Current position + + if (debug) + printf("[RecEnd ] CheckSum[0x%08X] Length[%4d] Length[0x%X] RecEnd[0x%08lX]\n", + CheckSum, RecLength, RecLength, RecEnd); + + fseek( fOut, -((long) RecLength), SEEK_CUR); // move back Start Of Data + + dumpfTell("Data ", -1); + + fseek( fOut, -4, SEEK_CUR); // move back Start Of Address + + dumpfTell("Address ", -1); + + fseek( fOut, -4, SEEK_CUR); // move back Start Of Length + + dumpfTell("Length ", -1); + + binOut32( RecLength ); + + fseek( fOut, RecEnd, SEEK_SET); // move to end of Record + + CheckSum += RecLength; + + CheckSum = ~CheckSum + 1; // Two's complement + + binOut32( CheckSum ); + + if (verbose) + printf("[Created Record of %d Bytes with CheckSum [0x%8X]\n", RecLength, CheckSum); +} + +void binRecOutProgramStart(bit32u Address) +{ + if (Address != (AddressCurrent+1)) + { + binRecEnd(); + binRecStart(Address); + } + AddressCurrent = Address; +} +void binRecOutByte(bit32u Address, bit8u Data) +{ + // If Address is one after Current Address, output Byte + // If not, close out last record, update Length, write checksum + // Then Start New Record, updating Current Address + + if (Address != (AddressCurrent+1)) + { + binRecEnd(); + binRecStart(Address); + } + AddressCurrent = Address; + CheckSum += Data; + binOut8( Data ); +} + +//============================================================================= +// SUPPORT FUNCTIONS +//============================================================================= +int readline(FILE *fil,char *buf,int len) +{ + int rlen; + + rlen=0; + if (len==0) return(0); + while(1) + { + if (cur_len==0) + { + cur_len=fread(buffer, 1, sizeof(buffer), fil); + if (cur_len==0) + { + if (rlen) + { + *buf=0; + return(rlen); + } + return(-1); + } + cur_ptr=buffer; + } + if (cur_len) + { + if (*cur_ptr=='\n') + { + *buf=0; + cur_ptr++; + cur_len--; + return(rlen); + } + else + { + if ((len>1)&&(*cur_ptr!='\r')) + { + *buf++=*cur_ptr++; + len--; + } + else + cur_ptr++; + + rlen++; + cur_len--; + } + } + else + { + *buf=0; + cur_ptr++; + cur_len--; + return(rlen); + } + } +} + + +int SRLerrorout(char *c1,char *c2) +{ + printf("\nERROR: %s - '%s'.",c1,c2); + return(FALSE); +} + + +int checksum(char *cp,int count) +{ + char *scp; + int cksum; + int dum; + + scp=cp; + while(*scp) + { + if (!isxdigit(*scp++)) + return(SRLerrorout("Invalid hex digits",cp)); + } + scp=cp; + + cksum=count; + + while(count) + { + cksum += gh(scp,2); + if (count == 2) + dum = ~cksum; + scp += 2; + count--; + } + cksum&=0x0ff; + // printf("\nCk:%02x",cksum); + return(cksum==0x0ff); +} + +bit32u gh(char *cp,int nibs) +{ + int i; + bit32u j; + + j=0; + + for(i=0;i='a')&&(*cp<='z')) *cp &= 0x5f; + if ((*cp>='0')&&(*cp<='9')) + j += (*cp-0x30); + else + if ((*cp>='A')&&(*cp<='F')) + j += (*cp-0x37); + else + SRLerrorout("Bad Hex char", cp); + cp++; + } + return(j); +} + + +//============================================================================= +// PROCESS SREC LINE +//============================================================================= + +int srecLine(char *pSrecLine) +{ + char *scp,ch; + int itmp,count,dat; + bit32u adr; + static bit32u RecordCounter=0; + + cur_line++; + scp=pSrecLine; + + if (*pSrecLine!='S') + return(SRLerrorout("Not an Srecord file",scp)); + pSrecLine++; + if (strlen(pSrecLine)<4) + return(SRLerrorout("Srecord too short",scp)); + + ch=*pSrecLine++; + + count=gh(pSrecLine,2); + + pSrecLine += 2; + + // if(debug) + // printf("count %d, strlen(pSrecLine) = %d, pSrecLine =[%s]\n", count, strlen(pSrecLine), pSrecLine); + RecordCounter++; + DispHex(RecordCounter); + + if ((count*2) != strlen(pSrecLine)) return(SRLerrorout("Count field larger than record",scp)); + + if (!checksum(pSrecLine, count)) return(SRLerrorout("Bad Checksum",scp)); + + switch(ch) + { + case '0': if (count<3) return(SRLerrorout("Invalid Srecord count field",scp)); + itmp=gh(pSrecLine,4); pSrecLine+=4; count-=2; + if (itmp) return(SRLerrorout("Srecord 1 address not zero",scp)); + break; + case '1': if (count<3) return(SRLerrorout("Invalid Srecord count field",scp)); + return(SRLerrorout("Srecord Not valid for MIPS",scp)); + break; + case '2': if (count<4) return(SRLerrorout("Invalid Srecord count field",scp)); + return(SRLerrorout("Srecord Not valid for MIPS",scp)); + break; + case '3': if (count<5) return(SRLerrorout("Invalid Srecord count field",scp)); + adr=gh(pSrecLine,8); pSrecLine+=8; count-=4; + count--; + while(count) + { + dat=gh(pSrecLine,2); pSrecLine+=2; count--; + binRecOutByte(adr, (char) (dat & 0xFF)); + adr++; + } + s1s2s3_total++; + break; + case '4': return(SRLerrorout("Invalid Srecord type",scp)); + break; + case '5': if (count<3) return(SRLerrorout("Invalid Srecord count field",scp)); + itmp=gh(pSrecLine,4); pSrecLine+=4; count-=2; + if (itmp|=s1s2s3_total) return(SRLerrorout("Incorrect number of S3 Record processed",scp)); + break; + case '6': return(SRLerrorout("Invalid Srecord type",scp)); + break; + case '7': // PROGRAM START + if (count<5) return(SRLerrorout("Invalid Srecord count field",scp)); + adr=gh(pSrecLine,8); pSrecLine+=8; count-=4; + if (count!=1) return(SRLerrorout("Invalid Srecord count field",scp)); + binRecOutProgramStart(adr); + break; + case '8': if (count<4) return(SRLerrorout("Invalid Srecord count field",scp)); + return(SRLerrorout("Srecord Not valid for MIPS",scp)); + break; + case '9': if (count<3) return(SRLerrorout("Invalid Srecord count field",scp)); + return(SRLerrorout("Srecord Not valid for MIPS",scp)); + break; + default: + break; + } + return(TRUE); +} + + +//============================================================================= +// MAIN LOGIC, READS IN LINE AND OUTPUTS BINARY +//============================================================================= + +int srec2bin(int argc,char *argv[],int verbose) +{ + int i,rlen,sts; + FILE *fp; + char ac; + char buff[256]; + bit32u TAG_BIG = 0xDEADBE42; + bit32u TAG_LITTLE = 0xFEEDFA42; + + bit32u Tag; + + + if(argc < 3) + { + printf("\nError: \n\n"); + return(0); + } + + if (argc > 3) BigEndian=TRUE; else BigEndian=FALSE; + + if (BigEndian) + Tag = TAG_BIG; + else + Tag = TAG_LITTLE; + + if (verbose) + printf("\nEndian: %s, Tag is 0x%8X\n",(BigEndian)?"BIG":"LITTLE", Tag); + + fp = fopen(argv[1],"rt"); + + if (fp==NULL) + { + printf("\nError: Opening input file, %s.", argv[1]); + return(0); + } + + fOut = fopen( argv[2], "wb"); + + if (fOut==NULL) + { + printf("\nError: Opening Output file, %s.", argv[2]); + if(fp) fclose(fp); + return(0); + } + + RecStart = FALSE; + + AddressCurrent = 0xFFFFFFFFL; + + // Setup Tag + + dumpfTell("Tag", Tag); + + binOut32(Tag); + + + inputline=0; + sts=TRUE; + + rlen = readline(fp,buff,sizeof buff); + + while( (sts) && (rlen != -1)) + { + if (strlen(buff)) + { + sts &= srecLine(buff); + WaitDisplay(); + } + rlen = readline(fp,buff,sizeof buff); + } + + + // printf("PC: 0x%08X, Length 0x%08X, Tag 0x%08X\n", ProgramStart, RecLength, TAG_LITTLE); + + binRecEnd(); + + if(fp) fclose(fp); + if(fOut) fclose(fOut); + + return(1); +} + +main(int argc, char *argv[]) +{ + debug = TRUE; + debug = FALSE; + verbose = FALSE; + srec2bin(argc,argv,verbose); + return 0; +} + diff --git a/target/ag241/uclibc.config b/target/ag241/uclibc.config new file mode 100644 index 000000000..bc9ffb3fc --- /dev/null +++ b/target/ag241/uclibc.config @@ -0,0 +1,233 @@ +# +# Automatically generated make config: don't edit +# Version: 0.9.30.1 +# Sun Aug 23 20:28:49 2009 +# +# TARGET_alpha is not set +# TARGET_arm is not set +# TARGET_avr32 is not set +# TARGET_bfin is not set +# TARGET_cris is not set +# TARGET_e1 is not set +# TARGET_frv is not set +# TARGET_h8300 is not set +# TARGET_hppa is not set +# TARGET_i386 is not set +# TARGET_i960 is not set +# TARGET_ia64 is not set +# TARGET_m68k is not set +# TARGET_microblaze is not set +TARGET_mips=y +# TARGET_nios is not set +# TARGET_nios2 is not set +# TARGET_powerpc is not set +# TARGET_sh is not set +# TARGET_sh64 is not set +# TARGET_sparc is not set +# TARGET_v850 is not set +# TARGET_vax is not set +# TARGET_x86_64 is not set +# TARGET_xtensa is not set + +# +# Target Architecture Features and Options +# +TARGET_ARCH="mips" +FORCE_OPTIONS_FOR_ARCH=y +ARCH_CFLAGS="-mno-split-addresses" +CONFIG_MIPS_O32_ABI=y +# CONFIG_MIPS_N32_ABI is not set +# CONFIG_MIPS_N64_ABI is not set +# CONFIG_MIPS_ISA_1 is not set +# CONFIG_MIPS_ISA_2 is not set +# CONFIG_MIPS_ISA_3 is not set +# CONFIG_MIPS_ISA_4 is not set +CONFIG_MIPS_ISA_MIPS32=y +# CONFIG_MIPS_ISA_MIPS32R2 is not set +# CONFIG_MIPS_ISA_MIPS64 is not set +TARGET_SUBARCH="" + +# +# Using ELF file format +# +ARCH_ANY_ENDIAN=y +ARCH_LITTLE_ENDIAN=y +# ARCH_WANTS_BIG_ENDIAN is not set +ARCH_WANTS_LITTLE_ENDIAN=y +ARCH_HAS_MMU=y +ARCH_USE_MMU=y +UCLIBC_HAS_FLOATS=y +UCLIBC_HAS_FPU=y +DO_C99_MATH=y +UCLIBC_HAS_FENV=y +KERNEL_HEADERS="/home/wbx/lemote/toolchain_build_mipsel/libc_dev/usr/include" +HAVE_DOT_CONFIG=y + +# +# General Library Settings +# +# HAVE_NO_PIC is not set +DOPIC=y +# ARCH_HAS_NO_SHARED is not set +# ARCH_HAS_NO_LDSO is not set +HAVE_SHARED=y +# FORCE_SHAREABLE_TEXT_SEGMENTS is not set +LDSO_LDD_SUPPORT=y +LDSO_CACHE_SUPPORT=y +# LDSO_PRELOAD_FILE_SUPPORT is not set +LDSO_BASE_FILENAME="ld.so" +# UCLIBC_STATIC_LDCONFIG is not set +LDSO_RUNPATH=y +UCLIBC_CTOR_DTOR=y +# LDSO_GNU_HASH_SUPPORT is not set +# HAS_NO_THREADS is not set +UCLIBC_HAS_THREADS=y +# PTHREADS_DEBUG_SUPPORT is not set +LINUXTHREADS_OLD=y +UCLIBC_HAS_SYSLOG=y +UCLIBC_HAS_LFS=y +# MALLOC is not set +# MALLOC_SIMPLE is not set +MALLOC_STANDARD=y +MALLOC_GLIBC_COMPAT=y +UCLIBC_DYNAMIC_ATEXIT=y +COMPAT_ATEXIT=y +UCLIBC_SUSV3_LEGACY=y +# UCLIBC_SUSV3_LEGACY_MACROS is not set +# UCLIBC_HAS_STUBS is not set +UCLIBC_HAS_SHADOW=y +UCLIBC_HAS_PROGRAM_INVOCATION_NAME=y +UCLIBC_HAS___PROGNAME=y +UCLIBC_HAS_PTY=y +ASSUME_DEVPTS=y +UNIX98PTY_ONLY=y +# UCLIBC_HAS_GETPT is not set +UCLIBC_HAS_TM_EXTENSIONS=y +UCLIBC_HAS_TZ_CACHING=y +UCLIBC_HAS_TZ_FILE=y +UCLIBC_HAS_TZ_FILE_READ_MANY=y +UCLIBC_TZ_FILE_PATH="/etc/TZ" + +# +# Advanced Library Settings +# +UCLIBC_PWD_BUFFER_SIZE=256 +UCLIBC_GRP_BUFFER_SIZE=256 + +# +# Support various families of functions +# +# UCLIBC_LINUX_MODULE_24 is not set +UCLIBC_LINUX_SPECIFIC=y +UCLIBC_HAS_GNU_ERROR=y +UCLIBC_BSD_SPECIFIC=y +UCLIBC_HAS_BSD_ERR=y +# UCLIBC_HAS_OBSOLETE_BSD_SIGNAL is not set +# UCLIBC_HAS_OBSOLETE_SYSV_SIGNAL is not set +# UCLIBC_NTP_LEGACY is not set +# UCLIBC_SV4_DEPRECATED is not set +UCLIBC_HAS_REALTIME=y +UCLIBC_HAS_ADVANCED_REALTIME=y +UCLIBC_HAS_EPOLL=y +UCLIBC_HAS_XATTR=y +# UCLIBC_HAS_PROFILING is not set +UCLIBC_HAS_CRYPT_IMPL=y +UCLIBC_HAS_CRYPT=y +UCLIBC_HAS_NETWORK_SUPPORT=y +UCLIBC_HAS_SOCKET=y +UCLIBC_HAS_IPV4=y +UCLIBC_HAS_IPV6=y +UCLIBC_HAS_RPC=y +UCLIBC_HAS_FULL_RPC=y +UCLIBC_HAS_REENTRANT_RPC=y +UCLIBC_USE_NETLINK=y +UCLIBC_SUPPORT_AI_ADDRCONFIG=y +UCLIBC_HAS_BSD_RES_CLOSE=y + +# +# String and Stdio Support +# +UCLIBC_HAS_STRING_GENERIC_OPT=y +UCLIBC_HAS_STRING_ARCH_OPT=y +UCLIBC_HAS_CTYPE_TABLES=y +UCLIBC_HAS_CTYPE_SIGNED=y +# UCLIBC_HAS_CTYPE_UNSAFE is not set +UCLIBC_HAS_CTYPE_CHECKED=y +# UCLIBC_HAS_CTYPE_ENFORCED is not set +UCLIBC_HAS_WCHAR=y +# UCLIBC_HAS_LOCALE is not set +UCLIBC_HAS_HEXADECIMAL_FLOATS=y +UCLIBC_HAS_GLIBC_CUSTOM_PRINTF=y +UCLIBC_PRINTF_SCANF_POSITIONAL_ARGS=9 +UCLIBC_HAS_SCANF_GLIBC_A_FLAG=y +# UCLIBC_HAS_STDIO_BUFSIZ_NONE is not set +# UCLIBC_HAS_STDIO_BUFSIZ_256 is not set +# UCLIBC_HAS_STDIO_BUFSIZ_512 is not set +# UCLIBC_HAS_STDIO_BUFSIZ_1024 is not set +# UCLIBC_HAS_STDIO_BUFSIZ_2048 is not set +UCLIBC_HAS_STDIO_BUFSIZ_4096=y +# UCLIBC_HAS_STDIO_BUFSIZ_8192 is not set +UCLIBC_HAS_STDIO_BUILTIN_BUFFER_NONE=y +# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_4 is not set +# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_8 is not set +# UCLIBC_HAS_STDIO_SHUTDOWN_ON_ABORT is not set +UCLIBC_HAS_STDIO_GETC_MACRO=y +UCLIBC_HAS_STDIO_PUTC_MACRO=y +UCLIBC_HAS_STDIO_AUTO_RW_TRANSITION=y +# UCLIBC_HAS_FOPEN_LARGEFILE_MODE is not set +UCLIBC_HAS_FOPEN_EXCLUSIVE_MODE=y +UCLIBC_HAS_GLIBC_CUSTOM_STREAMS=y +UCLIBC_HAS_PRINTF_M_SPEC=y +UCLIBC_HAS_ERRNO_MESSAGES=y +# UCLIBC_HAS_SYS_ERRLIST is not set +UCLIBC_HAS_SIGNUM_MESSAGES=y +# UCLIBC_HAS_SYS_SIGLIST is not set +UCLIBC_HAS_GNU_GETOPT=y +UCLIBC_HAS_GNU_GETSUBOPT=y + +# +# Big and Tall +# +UCLIBC_HAS_REGEX=y +UCLIBC_HAS_REGEX_OLD=y +UCLIBC_HAS_FNMATCH=y +UCLIBC_HAS_FNMATCH_OLD=y +UCLIBC_HAS_WORDEXP=y +UCLIBC_HAS_FTW=y +UCLIBC_HAS_GLOB=y +UCLIBC_HAS_GNU_GLOB=y + +# +# Library Installation Options +# +SHARED_LIB_LOADER_PREFIX="/lib" +RUNTIME_PREFIX="/" +DEVEL_PREFIX="/usr/" + +# +# Security options +# +# UCLIBC_BUILD_PIE is not set +UCLIBC_HAS_ARC4RANDOM=y +# HAVE_NO_SSP is not set +# UCLIBC_HAS_SSP is not set +UCLIBC_BUILD_RELRO=y +# UCLIBC_BUILD_NOW is not set +UCLIBC_BUILD_NOEXECSTACK=y + +# +# uClibc development/debugging options +# +CROSS_COMPILER_PREFIX="" +UCLIBC_EXTRA_CFLAGS="" +# DODEBUG is not set +# DODEBUG_PT is not set +DOSTRIP=y +# DOASSERTS is not set +# SUPPORT_LD_DEBUG is not set +# SUPPORT_LD_DEBUG_EARLY is not set +# UCLIBC_MALLOC_DEBUGGING is not set +WARNINGS="-Wall" +# EXTRA_WARNINGS is not set +# DOMULTI is not set +# UCLIBC_MJN3_ONLY is not set -- cgit v1.2.3 From 11a25b78e7c010ed5f2b60fc85a5ac952a4c0e73 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Wed, 16 Dec 2009 22:05:17 +0100 Subject: fix cpmac mac address bug, fix serial and mtd partitions finally ag241 boots via nfs --- target/ag241/patches/ar7.patch | 47 ++++++++++++++++++++++++++++++++++++++---- 1 file changed, 43 insertions(+), 4 deletions(-) (limited to 'target/ag241') diff --git a/target/ag241/patches/ar7.patch b/target/ag241/patches/ar7.patch index e1866f572..a09ea1c18 100644 --- a/target/ag241/patches/ar7.patch +++ b/target/ag241/patches/ar7.patch @@ -1,6 +1,6 @@ diff -Nur linux-2.6.32.orig/arch/mips/ar7/platform.c linux-2.6.32/arch/mips/ar7/platform.c --- linux-2.6.32.orig/arch/mips/ar7/platform.c 2009-12-03 04:51:21.000000000 +0100 -+++ linux-2.6.32/arch/mips/ar7/platform.c 2009-12-15 18:27:15.208942638 +0100 ++++ linux-2.6.32/arch/mips/ar7/platform.c 2009-12-16 20:10:47.564817191 +0100 @@ -509,7 +509,7 @@ memset(uart_port, 0, sizeof(struct uart_port) * 2); @@ -21,7 +21,7 @@ diff -Nur linux-2.6.32.orig/arch/mips/ar7/platform.c linux-2.6.32/arch/mips/ar7/ uart_port[1].uartclk = ar7_bus_freq() / 2; diff -Nur linux-2.6.32.orig/arch/mips/include/asm/page.h linux-2.6.32/arch/mips/include/asm/page.h --- linux-2.6.32.orig/arch/mips/include/asm/page.h 2009-12-03 04:51:21.000000000 +0100 -+++ linux-2.6.32/arch/mips/include/asm/page.h 2009-12-14 22:03:51.157752807 +0100 ++++ linux-2.6.32/arch/mips/include/asm/page.h 2009-12-16 20:10:47.576432079 +0100 @@ -200,8 +200,11 @@ #define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) @@ -38,7 +38,7 @@ diff -Nur linux-2.6.32.orig/arch/mips/include/asm/page.h linux-2.6.32/arch/mips/ #include diff -Nur linux-2.6.32.orig/arch/mips/Kconfig linux-2.6.32/arch/mips/Kconfig --- linux-2.6.32.orig/arch/mips/Kconfig 2009-12-14 21:11:40.737752912 +0100 -+++ linux-2.6.32/arch/mips/Kconfig 2009-12-14 21:00:48.533738664 +0100 ++++ linux-2.6.32/arch/mips/Kconfig 2009-12-16 20:10:47.592420151 +0100 @@ -30,7 +30,6 @@ select CEVT_R4K select CSRC_R4K @@ -49,7 +49,7 @@ diff -Nur linux-2.6.32.orig/arch/mips/Kconfig linux-2.6.32/arch/mips/Kconfig select SYS_HAS_EARLY_PRINTK diff -Nur linux-2.6.32.orig/arch/mips/kernel/traps.c linux-2.6.32/arch/mips/kernel/traps.c --- linux-2.6.32.orig/arch/mips/kernel/traps.c 2009-12-03 04:51:21.000000000 +0100 -+++ linux-2.6.32/arch/mips/kernel/traps.c 2009-12-14 22:25:58.329754617 +0100 ++++ linux-2.6.32/arch/mips/kernel/traps.c 2009-12-16 20:10:47.596422057 +0100 @@ -1255,9 +1255,22 @@ exception_handlers[n] = handler; @@ -76,3 +76,42 @@ diff -Nur linux-2.6.32.orig/arch/mips/kernel/traps.c linux-2.6.32/arch/mips/kern } return (void *)old_handler; } +diff -Nur linux-2.6.32.orig/drivers/mtd/maps/physmap.c linux-2.6.32/drivers/mtd/maps/physmap.c +--- linux-2.6.32.orig/drivers/mtd/maps/physmap.c 2009-12-03 04:51:21.000000000 +0100 ++++ linux-2.6.32/drivers/mtd/maps/physmap.c 2009-12-16 20:12:01.388510102 +0100 +@@ -80,7 +80,7 @@ + "map_rom", + NULL }; + #ifdef CONFIG_MTD_PARTITIONS +-static const char *part_probe_types[] = { "cmdlinepart", "RedBoot", NULL }; ++static const char *part_probe_types[] = { "cmdlinepart", "RedBoot", "ar7part", NULL }; + #endif + + static int physmap_flash_probe(struct platform_device *dev) +diff -Nur linux-2.6.32.orig/drivers/net/cpmac.c linux-2.6.32/drivers/net/cpmac.c +--- linux-2.6.32.orig/drivers/net/cpmac.c 2009-12-03 04:51:21.000000000 +0100 ++++ linux-2.6.32/drivers/net/cpmac.c 2009-12-16 21:24:20.356422767 +0100 +@@ -1165,7 +1165,7 @@ + priv->dev = dev; + priv->ring_size = 64; + priv->msg_enable = netif_msg_init(debug_level, 0xff); +- memcpy(dev->dev_addr, pdata->dev_addr, sizeof(dev->dev_addr)); ++ memcpy(dev->dev_addr, pdata->dev_addr, ETH_ALEN); + + snprintf(priv->phy_name, MII_BUS_ID_SIZE, PHY_ID_FMT, mdio_bus_id, phy_id); + +diff -Nur linux-2.6.32.orig/drivers/serial/8250.c linux-2.6.32/drivers/serial/8250.c +--- linux-2.6.32.orig/drivers/serial/8250.c 2009-12-03 04:51:21.000000000 +0100 ++++ linux-2.6.32/drivers/serial/8250.c 2009-12-16 20:10:58.820421544 +0100 +@@ -2714,7 +2714,11 @@ + { + struct uart_8250_port *up = (struct uart_8250_port *)port; + ++#ifdef CONFIG_AR7 ++ wait_for_xmitr(up, BOTH_EMPTY); ++#else + wait_for_xmitr(up, UART_LSR_THRE); ++#endif + serial_out(up, UART_TX, ch); + } + -- cgit v1.2.3 From bb17a19fcc7f7d10369eed7f6c8662f6e4df9d4b Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Thu, 17 Dec 2009 17:36:04 +0100 Subject: enable cfgfs and atm - make cfgfs work for ag241 - split mtd to separate package to control dependencies - update linux-atm package to latest upstream - enable atm kernel module building --- package/Config.in | 4 +- package/cfgfs/Config.in | 2 + package/cfgfs/Makefile | 9 +- package/cfgfs/src/mtd.c | 379 --------------------- package/iptables/Config.in | 10 - package/linux-atm/Config.in | 9 +- package/linux-atm/Config.in.lib | 10 + package/linux-atm/Makefile | 8 +- package/linux-atm/patches/patch-src_Makefile_in | 12 +- package/linux-atm/patches/patch-src_led_main_c | 11 - .../linux-atm/patches/patch-src_qgen_Makefile_in | 29 +- package/linux-atm/patches/patch-src_qgen_ql_l_c | 12 - .../linux-atm/patches/patch-src_sigd_Makefile_in | 7 +- package/linux-atm/patches/patch-src_sigd_cfg_l_c | 12 - package/linux-atm/patches/patch-src_sigd_cfg_l_l | 10 + .../linux-atm/patches/patch-src_switch_Makefile_in | 11 + package/linux-atm/patches/patch-src_switch_cfg_l_c | 12 - package/linux-atm/patches/patch-src_switch_cfg_l_l | 10 + .../patches/patch-src_switch_debug_Makefile_in | 7 +- .../patches/patch-src_switch_tcp_Makefile_in | 9 +- .../linux-atm/patches/patch-src_test_Makefile_in | 12 - package/linux-atm/patches/patch-src_test_ispl_l_c | 12 - package/linux-atm/patches/patch-src_test_ttcp_c | 21 -- package/mtd/Config.in | 9 + package/mtd/Makefile | 32 ++ package/mtd/src/mtd.c | 379 +++++++++++++++++++++ target/Config.in | 3 +- target/ag241/patches/ar7.patch | 34 ++ target/linux/config/Config.in.fs | 4 + target/linux/config/Config.in.network | 34 +- 30 files changed, 556 insertions(+), 557 deletions(-) delete mode 100644 package/cfgfs/src/mtd.c create mode 100644 package/linux-atm/Config.in.lib delete mode 100644 package/linux-atm/patches/patch-src_led_main_c delete mode 100644 package/linux-atm/patches/patch-src_qgen_ql_l_c delete mode 100644 package/linux-atm/patches/patch-src_sigd_cfg_l_c create mode 100644 package/linux-atm/patches/patch-src_sigd_cfg_l_l create mode 100644 package/linux-atm/patches/patch-src_switch_Makefile_in delete mode 100644 package/linux-atm/patches/patch-src_switch_cfg_l_c create mode 100644 package/linux-atm/patches/patch-src_switch_cfg_l_l delete mode 100644 package/linux-atm/patches/patch-src_test_Makefile_in delete mode 100644 package/linux-atm/patches/patch-src_test_ispl_l_c delete mode 100644 package/linux-atm/patches/patch-src_test_ttcp_c create mode 100644 package/mtd/Config.in create mode 100644 package/mtd/Makefile create mode 100644 package/mtd/src/mtd.c (limited to 'target/ag241') diff --git a/package/Config.in b/package/Config.in index 1cc29c402..c6f714d74 100644 --- a/package/Config.in +++ b/package/Config.in @@ -55,6 +55,7 @@ source "package/dosfstools/Config.in" source "package/e2fsprogs/Config.in" source "package/fuse/Config.in" source "package/mdadm/Config.in" +source "package/mtd/Config.in" source "package/lvm/Config.in" source "package/parted/Config.in" source "package/util-linux-ng/Config.in" @@ -236,6 +237,7 @@ endmenu menu "Firewall / Routing / Bridging" source "package/arpd/Config.in" source "package/bridge-utils/Config.in" +source "package/linux-atm/Config.in" source "package/cutter/Config.in" source "package/ebtables/Config.in" source "package/ether-wake/Config.in" @@ -243,7 +245,6 @@ source "package/iproute2/Config.in" source "package/ipset/Config.in" source "package/iptables/Config.in" source "package/knock/Config.in" -source "package/linux-atm/Config.in" source "package/macchanger/Config.in" source "package/netstat-nat/Config.in" source "package/quagga/Config.in" @@ -407,6 +408,7 @@ source "package/id3lib/Config.in" source "package/libao/Config.in" source "package/libaudiofile/Config.in" source "package/libart/Config.in" +source "package/linux-atm/Config.in.lib" source "package/libcli/Config.in" source "package/curl/Config.in.lib" source "package/libdaemon/Config.in" diff --git a/package/cfgfs/Config.in b/package/cfgfs/Config.in index fcda6c97e..911027433 100644 --- a/package/cfgfs/Config.in +++ b/package/cfgfs/Config.in @@ -5,11 +5,13 @@ config ADK_PACKAGE_CFGFS select BUSYBOX_MD5SUM select BUSYBOX_XARGS select BUSYBOX_FEATURE_SORT_BIG + select ADK_PACKAGE_MTD depends on \ ADK_LINUX_X86_ALIX1C || \ ADK_LINUX_X86_ALIX2D || \ ADK_LINUX_X86_WRAP || \ ADK_LINUX_CRIS_FOXBOARD || \ + ADK_LINUX_MIPS_AG241 || \ ADK_LINUX_MIPS_RB532 default y help diff --git a/package/cfgfs/Makefile b/package/cfgfs/Makefile index 50d571e90..17ab5e6a7 100644 --- a/package/cfgfs/Makefile +++ b/package/cfgfs/Makefile @@ -5,7 +5,7 @@ include ${TOPDIR}/rules.mk PKG_NAME:= cfgfs PKG_VERSION:= 1.0.6 -PKG_RELEASE:= 3 +PKG_RELEASE:= 4 PKG_DESCR:= compressed config filesystem PKG_SECTION:= base @@ -21,14 +21,11 @@ BUILD_STYLE:= auto do-configure: mkdir -p ${WRKBUILD} ${CP} ./src/* ${WRKBUILD} - ${TARGET_CC} ${TCPPFLAGS} ${TCFLAGS} -o ${WRKBUILD}/mtd ${WRKBUILD}/mtd.c do-install: ${INSTALL_DIR} ${IDIR_CFGFS}/sbin ${INSTALL_BIN} ${WRKBUILD}/fwcf.sh ${IDIR_CFGFS}/sbin/cfgfs - ${INSTALL_BIN} ${WRKBUILD}/fwcf.helper.out ${IDIR_CFGFS}/sbin/cfgfs.helper -ifeq ($(ARCH),cris) - ${INSTALL_BIN} ${WRKBUILD}/mtd ${IDIR_CFGFS}/sbin/mtd -endif + ${INSTALL_BIN} ${WRKBUILD}/fwcf.helper.out \ + ${IDIR_CFGFS}/sbin/cfgfs.helper include ${TOPDIR}/mk/pkg-bottom.mk diff --git a/package/cfgfs/src/mtd.c b/package/cfgfs/src/mtd.c deleted file mode 100644 index 6812c5e31..000000000 --- a/package/cfgfs/src/mtd.c +++ /dev/null @@ -1,379 +0,0 @@ -/* - * mtd - simple memory technology device manipulation tool - * - * Copyright (c) 2006, 2007 Thorsten Glaser - * Copyright (C) 2005 Waldemar Brodkorb , - * Felix Fietkau - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The code is based on the linux-mtd examples. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#define BUFSIZE (16 * 1024) -#define MAX_ARGS 8 - -#define DEBUG - -int mtd_check(char *); -int mtd_unlock(const char *); -int mtd_open(const char *, int); -int mtd_erase(const char *); -int mtd_write(int, const char *, int, bool); -void usage(void) __attribute__((noreturn)); - -char buf[BUFSIZE]; -int buflen; - -int -mtd_check(char *mtd) -{ - struct mtd_info_user mtdInfo; - int fd; - - fd = mtd_open(mtd, O_RDWR | O_SYNC); - if(fd < 0) { - fprintf(stderr, "Could not open mtd device: %s\n", mtd); - return 0; - } - - if(ioctl(fd, MEMGETINFO, &mtdInfo)) { - fprintf(stderr, "Could not get MTD device info from %s\n", mtd); - close(fd); - return 0; - } - - close(fd); - return 1; -} - -int -mtd_unlock(const char *mtd) -{ - int fd; - struct mtd_info_user mtdInfo; - struct erase_info_user mtdLockInfo; - - fd = mtd_open(mtd, O_RDWR | O_SYNC); - if(fd < 0) { - fprintf(stderr, "Could not open mtd device: %s\n", mtd); - exit(1); - } - - if(ioctl(fd, MEMGETINFO, &mtdInfo)) { - fprintf(stderr, "Could not get MTD device info from %s\n", mtd); - close(fd); - exit(1); - } - - mtdLockInfo.start = 0; - mtdLockInfo.length = mtdInfo.size; - if(ioctl(fd, MEMUNLOCK, &mtdLockInfo)) { - close(fd); - return 0; - } - - close(fd); - return 0; -} - -int -mtd_open(const char *mtd, int flags) -{ - FILE *fp; - char dev[PATH_MAX]; - int i; - - if ((fp = fopen("/proc/mtd", "r"))) { - while (fgets(dev, sizeof(dev), fp)) { - if (sscanf(dev, "mtd%d:", &i) && strstr(dev, mtd)) { - snprintf(dev, sizeof(dev), "/dev/mtd%d", i); - fclose(fp); - return open(dev, flags); - } - } - fclose(fp); - } - - return open(mtd, flags); -} - -int -mtd_erase(const char *mtd) -{ - int fd; - struct mtd_info_user mtdInfo; - struct erase_info_user mtdEraseInfo; - - fd = mtd_open(mtd, O_RDWR | O_SYNC); - if(fd < 0) { - fprintf(stderr, "Could not open mtd device: %s\n", mtd); - exit(1); - } - - if(ioctl(fd, MEMGETINFO, &mtdInfo)) { - fprintf(stderr, "Could not get MTD device info from %s\n", mtd); - close(fd); - exit(1); - } - - mtdEraseInfo.length = mtdInfo.erasesize; - - for (mtdEraseInfo.start = 0; - mtdEraseInfo.start < mtdInfo.size; - mtdEraseInfo.start += mtdInfo.erasesize) { - - ioctl(fd, MEMUNLOCK, &mtdEraseInfo); - if(ioctl(fd, MEMERASE, &mtdEraseInfo)) { - fprintf(stderr, "Could not erase MTD device: %s\n", mtd); - close(fd); - exit(1); - } - } - - close(fd); - return 0; - -} - -int -mtd_write(int imagefd, const char *mtd, int quiet, bool do_erase) -{ - int fd, result; - size_t r, w, e; - struct mtd_info_user mtdInfo; - struct erase_info_user mtdEraseInfo; - - fd = mtd_open(mtd, O_RDWR | O_SYNC); - if(fd < 0) { - fprintf(stderr, "Could not open mtd device: %s\n", mtd); - exit(1); - } - - if(ioctl(fd, MEMGETINFO, &mtdInfo)) { - fprintf(stderr, "Could not get MTD device info from %s\n", mtd); - close(fd); - exit(1); - } - - r = w = e = 0; - if (!quiet) - fprintf(stderr, " [ ]"); - - for (;;) { - /* buffer may contain data already (from trx check) */ - r = buflen; - r += read(imagefd, buf + buflen, BUFSIZE - buflen); - w += r; - - /* EOF */ - if (r <= 0) break; - - /* need to erase the next block before writing data to it */ - while (do_erase && w > e) { - mtdEraseInfo.start = e; - mtdEraseInfo.length = mtdInfo.erasesize; - - if (!quiet) - fprintf(stderr, "\b\b\b[e]"); - /* erase the chunk */ - if (ioctl (fd,MEMERASE,&mtdEraseInfo) < 0) { - fprintf(stderr, "Erasing mtd failed: %s\n", mtd); - exit(1); - } - e += mtdInfo.erasesize; - } - - if (!quiet) - fprintf(stderr, "\b\b\b[w]"); - - if ((result = write(fd, buf, r)) < (ssize_t)r) { - if (result < 0) { - fprintf(stderr, "Error writing image.\n"); - exit(1); - } else { - fprintf(stderr, "Insufficient space.\n"); - exit(1); - } - } - - buflen = 0; - } - if (!quiet) - fprintf(stderr, "\b\b\b\b"); - - close(fd); - return 0; -} - -void -usage(void) -{ - fprintf(stderr, "Usage: mtd [ ...] [ ...] \n\n" - "The device is in the format of mtdX (eg: mtd4) or its label.\n" - "mtd recognises these commands:\n" - " unlock unlock the device\n" - " erase erase all data on device\n" - " write |- write (use - for stdin) to device\n" - "Following options are available:\n" - " -q quiet mode (once: no [w] on writing,\n" - " twice: no status messages)\n" - " -e erase before executing the command\n\n" - "Example: To write linux.trx to mtd1 labeled as linux\n" - " mtd write linux.trx linux\n\n"); - exit(1); -} - -int -main(int argc, char **argv) -{ - int ch, i, imagefd = -1, quiet, unlocked; - char *erase[MAX_ARGS], *device; - const char *imagefile = NULL; - enum { - CMD_ERASE, - CMD_WRITE, - CMD_UNLOCK - } cmd; - - erase[0] = NULL; - buflen = 0; - quiet = 0; - - while ((ch = getopt(argc, argv, "Fqe:")) != -1) - switch (ch) { - case 'F': - quiet = 1; - /* FALLTHROUGH */ - case 'q': - quiet++; - break; - case 'e': - i = 0; - while ((erase[i] != NULL) && ((i + 1) < MAX_ARGS)) - i++; - - erase[i++] = optarg; - erase[i] = NULL; - break; - - case '?': - default: - usage(); - } - argc -= optind; - argv += optind; - - if (argc < 2) - usage(); - - if ((strcmp(argv[0], "unlock") == 0) && (argc == 2)) { - cmd = CMD_UNLOCK; - device = argv[1]; - } else if ((strcmp(argv[0], "erase") == 0) && (argc == 2)) { - cmd = CMD_ERASE; - device = argv[1]; - } else if ((strcmp(argv[0], "write") == 0) && (argc == 3)) { - cmd = CMD_WRITE; - device = argv[2]; - - if (strcmp(argv[1], "-") == 0) { - imagefile = ""; - imagefd = 0; - } else { - imagefile = argv[1]; - if ((imagefd = open(argv[1], O_RDONLY)) < 0) { - fprintf(stderr, "Couldn't open image file: %s!\n", imagefile); - exit(1); - } - } - - if (!mtd_check(device)) { - fprintf(stderr, "Can't open device for writing!\n"); - exit(1); - } - } else { - usage(); - } - - sync(); - - i = 0; - unlocked = 0; - while (erase[i] != NULL) { - if (quiet < 2) - fprintf(stderr, "Unlocking %s ...\n", erase[i]); - mtd_unlock(erase[i]); - if (quiet < 2) - fprintf(stderr, "Erasing %s ...\n", erase[i]); - mtd_erase(erase[i]); - if (strcmp(erase[i], device) == 0) - /* this means that is unlocked and erased */ - unlocked = 1; - i++; - } - - if (!unlocked) { - if (quiet < 2) - fprintf(stderr, "Unlocking %s ...\n", device); - mtd_unlock(device); - } - - switch (cmd) { - case CMD_UNLOCK: - break; - case CMD_ERASE: - if (unlocked) { - fprintf(stderr, "Already erased: %s\n", device); - break; - } - if (quiet < 2) - fprintf(stderr, "Erasing %s ...\n", device); - mtd_erase(device); - break; - case CMD_WRITE: - if (quiet < 2) - fprintf(stderr, "Writing from %s to %s ... ", imagefile, device); - mtd_write(imagefd, device, quiet, (unlocked == 0)); - if (quiet < 2) - fprintf(stderr, "\n"); - break; - } - - sync(); - return 0; -} diff --git a/package/iptables/Config.in b/package/iptables/Config.in index 5b82599ad..56dd79cc9 100644 --- a/package/iptables/Config.in +++ b/package/iptables/Config.in @@ -21,16 +21,6 @@ config ADK_PACKAGE_IPTABLES http://www.iptables.org/ -config ADK_PACKAGE_IPTABLES_UTILS - prompt "iptables-utils.................. Save and restore utilities" - tristate - default n - depends on ADK_PACKAGE_IPTABLES - help - iptables-save and iptables-restore for Iptables (IPv4) - - http://www.iptables.org/ - config ADK_PACKAGE_IP6TABLES prompt "ip6tables......................... IPv6 firewall administration tool" tristate diff --git a/package/linux-atm/Config.in b/package/linux-atm/Config.in index e89db02d1..3991c679f 100644 --- a/package/linux-atm/Config.in +++ b/package/linux-atm/Config.in @@ -2,20 +2,13 @@ config ADK_COMPILE_LINUX_ATM bool default n help - -config ADK_PACKAGE_LIBATM - prompt "libatm............................. ATM Library for Linux" - tristate - default n - depends on !ADK_HOST_FREEBSD - help - ATM Library for linux config ADK_PACKAGE_BR2684CTL prompt "br2684ctl......................... RFC2684 bridging utility" tristate default n select ADK_PACKAGE_LIBATM + select ADK_COMPILE_LINUX_ATM depends on !ADK_HOST_FREEBSD help Utility for setting up ATM RFC2684 bridging mode. diff --git a/package/linux-atm/Config.in.lib b/package/linux-atm/Config.in.lib new file mode 100644 index 000000000..6c3e92d21 --- /dev/null +++ b/package/linux-atm/Config.in.lib @@ -0,0 +1,10 @@ +config ADK_PACKAGE_LIBATM + prompt "libatm............................ ATM Library for Linux" + tristate + default n + select ADK_COMPILE_LINUX_ATM + select ADK_KPACKAGE_KMOD_ATM + depends on !ADK_HOST_FREEBSD + help + ATM Library for linux. + diff --git a/package/linux-atm/Makefile b/package/linux-atm/Makefile index edb277885..2f32e7aa8 100644 --- a/package/linux-atm/Makefile +++ b/package/linux-atm/Makefile @@ -4,14 +4,16 @@ include ${TOPDIR}/rules.mk PKG_NAME:= linux-atm -PKG_VERSION:= 2.5.0 +PKG_VERSION:= 2.5.1 PKG_RELEASE:= 1 -PKG_MD5SUM:= 0b45a0e801fac7093ce4b0cadf419965 -PKG_DESCR:= ATM library for linux +PKG_MD5SUM:= 9560b0e1f410a05b849dfdab465dd758 +PKG_DESCR:= ATM library and tools for Linux PKG_SECTION:= libs PKG_URL:= http://linux-atm.sourceforge.net PKG_SITES:= ${MASTER_SITE_SOURCEFORGE:=linux-atm/} +DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tgz + PKG_DESCR_1:= br2684ctl PKG_DEPENDS_1:= libatm PKG_SECTION_1:= net diff --git a/package/linux-atm/patches/patch-src_Makefile_in b/package/linux-atm/patches/patch-src_Makefile_in index be1ca26b5..843577f7f 100644 --- a/package/linux-atm/patches/patch-src_Makefile_in +++ b/package/linux-atm/patches/patch-src_Makefile_in @@ -1,11 +1,11 @@ ---- linux-atm-2.5.0.orig/src/Makefile.in 2007-12-29 21:31:30.000000000 +0100 -+++ linux-atm-2.5.0/src/Makefile.in 2009-12-11 15:54:54.000000000 +0100 -@@ -179,7 +179,7 @@ target_os = @target_os@ - target_vendor = @target_vendor@ +--- linux-atm-2.5.1.orig/src/Makefile.in 2009-11-30 17:21:16.000000000 +0100 ++++ linux-atm-2.5.1/src/Makefile.in 2009-12-17 16:12:07.284420844 +0100 +@@ -214,7 +214,7 @@ target_vendor = @target_vendor@ + top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ --SUBDIRS = include lib test debug qgen saal sigd maint arpd ilmid man led lane \ -+SUBDIRS = include lib debug qgen saal sigd maint arpd ilmid man led lane \ +-SUBDIRS = include lib test debug qgen q2931 saal sigd maint arpd ilmid man led lane \ ++SUBDIRS = include lib debug qgen q2931 saal sigd maint arpd ilmid man led lane \ mpoad oamd switch config extra br2684 all: all-recursive diff --git a/package/linux-atm/patches/patch-src_led_main_c b/package/linux-atm/patches/patch-src_led_main_c deleted file mode 100644 index 63c5b5e9b..000000000 --- a/package/linux-atm/patches/patch-src_led_main_c +++ /dev/null @@ -1,11 +0,0 @@ -$Id: update-patches 24 2008-08-31 14:56:13Z wbx $ ---- linux-atm-2.5.0.orig/src/led/main.c 2005-10-06 19:27:50.000000000 +0200 -+++ linux-atm-2.5.0/src/led/main.c 2009-06-01 22:38:27.000000000 +0200 -@@ -31,6 +31,7 @@ - #endif - - /* Global includes */ -+#include - #include - #include - #include diff --git a/package/linux-atm/patches/patch-src_qgen_Makefile_in b/package/linux-atm/patches/patch-src_qgen_Makefile_in index 5c4bf490e..211ff90ff 100644 --- a/package/linux-atm/patches/patch-src_qgen_Makefile_in +++ b/package/linux-atm/patches/patch-src_qgen_Makefile_in @@ -1,33 +1,20 @@ -$Id: update-patches 24 2008-08-31 14:56:13Z wbx $ ---- linux-atm-2.5.0.orig/src/qgen/Makefile.in 2007-12-29 21:31:35.000000000 +0100 -+++ linux-atm-2.5.0/src/qgen/Makefile.in 2009-05-29 22:15:30.511416896 +0200 -@@ -92,9 +92,9 @@ AWK = @AWK@ - CC = @CC_FOR_BUILD@ - CCDEPMODE = @CCDEPMODE@ - CC_FOR_BUILD = @CC_FOR_BUILD@ --CFLAGS = @CFLAGS@ -+CFLAGS = -I../include +--- linux-atm-2.5.1.orig/src/qgen/Makefile.in 2009-11-30 17:21:18.000000000 +0100 ++++ linux-atm-2.5.1/src/qgen/Makefile.in 2009-12-17 16:17:11.216421967 +0100 +@@ -91,7 +91,7 @@ CC_FOR_BUILD = @CC_FOR_BUILD@ + CFLAGS = @CFLAGS_FOR_BUILD@ + CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@ CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -+CPPFLAGS = ++CPPFLAGS = CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ -@@ -116,7 +116,7 @@ INSTALL_DATA = @INSTALL_DATA@ +@@ -114,7 +114,7 @@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LDFLAGS = @LDFLAGS@ -+LDFLAGS= ++LDFLAGS = LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -@@ -208,7 +208,7 @@ top_srcdir = @top_srcdir@ - qgen_SOURCES = common.c common.h file.c file.h first.c ql_y.y ql_l.l qgen.c \ - qgen.h second.c third.c - --qgen_LDADD = -lfl -+qgen_LDADD = - q_dump_SOURCES = common.c - q_dump_LDADD = qd.dump.standalone.o - # FIXME: paulsch: We don't really depend on qd.dump.o or q.out.o here, but this diff --git a/package/linux-atm/patches/patch-src_qgen_ql_l_c b/package/linux-atm/patches/patch-src_qgen_ql_l_c deleted file mode 100644 index ac01bebfb..000000000 --- a/package/linux-atm/patches/patch-src_qgen_ql_l_c +++ /dev/null @@ -1,12 +0,0 @@ -$Id: update-patches 24 2008-08-31 14:56:13Z wbx $ ---- linux-atm-2.5.0.orig/src/qgen/ql_l.c 2007-12-24 20:46:13.000000000 +0100 -+++ linux-atm-2.5.0/src/qgen/ql_l.c 2009-05-29 22:10:55.010199430 +0200 -@@ -23,6 +23,8 @@ - - /* end standard C headers. */ - -+int yywrap(void) { return 1; } -+ - /* flex integer type definitions */ - - #ifndef FLEXINT_H diff --git a/package/linux-atm/patches/patch-src_sigd_Makefile_in b/package/linux-atm/patches/patch-src_sigd_Makefile_in index d48ea25e7..faa5a1385 100644 --- a/package/linux-atm/patches/patch-src_sigd_Makefile_in +++ b/package/linux-atm/patches/patch-src_sigd_Makefile_in @@ -1,7 +1,6 @@ -$Id: update-patches 24 2008-08-31 14:56:13Z wbx $ ---- linux-atm-2.5.0.orig/src/sigd/Makefile.in 2007-12-29 21:31:36.000000000 +0100 -+++ linux-atm-2.5.0/src/sigd/Makefile.in 2009-05-29 22:17:18.374156943 +0200 -@@ -223,7 +223,7 @@ atmsigd_XTRAS = mess.o $(top_builddir)/s +--- linux-atm-2.5.1.orig/src/sigd/Makefile.in 2009-11-30 17:21:19.000000000 +0100 ++++ linux-atm-2.5.1/src/sigd/Makefile.in 2009-12-17 16:21:42.636433571 +0100 +@@ -244,7 +244,7 @@ atmsigd_XTRAS = mess.o $(top_builddir)/s $(top_builddir)/src/lib/libatm.la \ $(top_builddir)/src/saal/libsaal.a diff --git a/package/linux-atm/patches/patch-src_sigd_cfg_l_c b/package/linux-atm/patches/patch-src_sigd_cfg_l_c deleted file mode 100644 index 91ace0a91..000000000 --- a/package/linux-atm/patches/patch-src_sigd_cfg_l_c +++ /dev/null @@ -1,12 +0,0 @@ -$Id: update-patches 24 2008-08-31 14:56:13Z wbx $ ---- linux-atm-2.5.0.orig/src/sigd/cfg_l.c 2007-12-24 20:46:31.000000000 +0100 -+++ linux-atm-2.5.0/src/sigd/cfg_l.c 2009-05-29 22:21:00.552981945 +0200 -@@ -23,6 +23,8 @@ - - /* end standard C headers. */ - -+int yywrap(void) { return 1; } -+ - /* flex integer type definitions */ - - #ifndef FLEXINT_H diff --git a/package/linux-atm/patches/patch-src_sigd_cfg_l_l b/package/linux-atm/patches/patch-src_sigd_cfg_l_l new file mode 100644 index 000000000..38bde1e58 --- /dev/null +++ b/package/linux-atm/patches/patch-src_sigd_cfg_l_l @@ -0,0 +1,10 @@ +--- linux-atm-2.5.1.orig/src/sigd/cfg_l.l 2004-09-25 13:25:48.000000000 +0200 ++++ linux-atm-2.5.1/src/sigd/cfg_l.l 2009-12-17 16:26:08.528422011 +0100 +@@ -16,6 +16,7 @@ + + #include "cfg_y.h" + ++int yywrap(void) { return 1; } + + static int lineno = 1; + static int token; /* f@#%ing flex doesn't grok return after BEGIN */ diff --git a/package/linux-atm/patches/patch-src_switch_Makefile_in b/package/linux-atm/patches/patch-src_switch_Makefile_in new file mode 100644 index 000000000..4a2981839 --- /dev/null +++ b/package/linux-atm/patches/patch-src_switch_Makefile_in @@ -0,0 +1,11 @@ +--- linux-atm-2.5.1.orig/src/switch/Makefile.in 2009-11-30 17:21:19.000000000 +0100 ++++ linux-atm-2.5.1/src/switch/Makefile.in 2009-12-17 16:30:47.392542123 +0100 +@@ -249,7 +249,7 @@ target_vendor = @target_vendor@ + top_build_prefix = @top_build_prefix@ + top_builddir = @top_builddir@ + top_srcdir = @top_srcdir@ +-SUBDIRS = . debug tcp ++SUBDIRS = . tcp + noinst_LIBRARIES = libsw.a + swc_SOURCES = swc.c swc.h + swc_LDADD = $(top_builddir)/src/lib/libatm.la diff --git a/package/linux-atm/patches/patch-src_switch_cfg_l_c b/package/linux-atm/patches/patch-src_switch_cfg_l_c deleted file mode 100644 index c0f08dc69..000000000 --- a/package/linux-atm/patches/patch-src_switch_cfg_l_c +++ /dev/null @@ -1,12 +0,0 @@ -$Id: update-patches 24 2008-08-31 14:56:13Z wbx $ ---- linux-atm-2.5.0.orig/src/switch/cfg_l.c 2007-12-24 20:47:23.000000000 +0100 -+++ linux-atm-2.5.0/src/switch/cfg_l.c 2009-05-29 22:27:33.024571460 +0200 -@@ -23,6 +23,8 @@ - - /* end standard C headers. */ - -+int yywrap(void) { return 1; } -+ - /* flex integer type definitions */ - - #ifndef FLEXINT_H diff --git a/package/linux-atm/patches/patch-src_switch_cfg_l_l b/package/linux-atm/patches/patch-src_switch_cfg_l_l new file mode 100644 index 000000000..ec00bc66b --- /dev/null +++ b/package/linux-atm/patches/patch-src_switch_cfg_l_l @@ -0,0 +1,10 @@ +--- linux-atm-2.5.1.orig/src/switch/cfg_l.l 2001-10-10 00:33:08.000000000 +0200 ++++ linux-atm-2.5.1/src/switch/cfg_l.l 2009-12-17 16:37:59.408538574 +0100 +@@ -15,6 +15,7 @@ + + #include "cfg_y.h" + ++int yywrap(void) { return 1; } + + static int lineno = 1; + static int token; /* f@#%ing flex doesn't grok return after BEGIN */ diff --git a/package/linux-atm/patches/patch-src_switch_debug_Makefile_in b/package/linux-atm/patches/patch-src_switch_debug_Makefile_in index 34f1db7da..2d8fa57d2 100644 --- a/package/linux-atm/patches/patch-src_switch_debug_Makefile_in +++ b/package/linux-atm/patches/patch-src_switch_debug_Makefile_in @@ -1,7 +1,6 @@ -$Id: update-patches 24 2008-08-31 14:56:13Z wbx $ ---- linux-atm-2.5.0.orig/src/switch/debug/Makefile.in 2007-12-29 21:31:36.000000000 +0100 -+++ linux-atm-2.5.0/src/switch/debug/Makefile.in 2009-05-29 22:23:13.656360541 +0200 -@@ -191,7 +191,7 @@ sw_debug_SOURCES = debug.c +--- linux-atm-2.5.1.orig/src/switch/debug/Makefile.in 2009-11-30 17:21:19.000000000 +0100 ++++ linux-atm-2.5.1/src/switch/debug/Makefile.in 2009-12-17 16:28:31.520542232 +0100 +@@ -199,7 +199,7 @@ sw_debug_SOURCES = debug.c sw_debug_XTRAS = $(top_builddir)/src/switch/libsw.a \ $(top_builddir)/src/lib/libatm.la diff --git a/package/linux-atm/patches/patch-src_switch_tcp_Makefile_in b/package/linux-atm/patches/patch-src_switch_tcp_Makefile_in index e40a65b23..f23a64405 100644 --- a/package/linux-atm/patches/patch-src_switch_tcp_Makefile_in +++ b/package/linux-atm/patches/patch-src_switch_tcp_Makefile_in @@ -1,12 +1,11 @@ -$Id: update-patches 24 2008-08-31 14:56:13Z wbx $ ---- linux-atm-2.5.0.orig/src/switch/tcp/Makefile.in 2007-12-29 21:31:37.000000000 +0100 -+++ linux-atm-2.5.0/src/switch/tcp/Makefile.in 2009-05-29 22:35:16.037506912 +0200 -@@ -191,7 +191,7 @@ sw_tcp_SOURCES = tcpsw.c +--- linux-atm-2.5.1.orig/src/switch/tcp/Makefile.in 2009-11-30 17:21:19.000000000 +0100 ++++ linux-atm-2.5.1/src/switch/tcp/Makefile.in 2009-12-17 16:33:08.832418828 +0100 +@@ -199,7 +199,7 @@ sw_tcp_SOURCES = tcpsw.c sw_tcp_XTRAS = $(top_builddir)/src/switch/libsw.a \ $(top_builddir)/src/lib/libatm.la -sw_tcp_LDADD = $(sw_tcp_XTRAS) -lfl -+sw_tcp_LDADD = $(sw_tcp_XTRAS) ++sw_tcp_LDADD = $(sw_tcp_XTRAS) sw_tcp_DEPENDENCIES = $(sw_tcp_XTRAS) EXTRA_DIST = mkfiles README all: all-am diff --git a/package/linux-atm/patches/patch-src_test_Makefile_in b/package/linux-atm/patches/patch-src_test_Makefile_in deleted file mode 100644 index af972e59e..000000000 --- a/package/linux-atm/patches/patch-src_test_Makefile_in +++ /dev/null @@ -1,12 +0,0 @@ -$Id: update-patches 24 2008-08-31 14:56:13Z wbx $ ---- linux-atm-2.5.0.orig/src/test/Makefile.in 2007-12-29 21:31:37.000000000 +0100 -+++ linux-atm-2.5.0/src/test/Makefile.in 2009-05-29 21:38:58.834444157 +0200 -@@ -275,7 +275,7 @@ br_SOURCES = br.c - bw_SOURCES = bw.c - isp_SOURCES = isp.c isp.h ispl_y.y ispl_l.l - isp_XTRAS = $(LDADD) --isp_LDADD = $(isp_XTRAS) -lfl -+isp_LDADD = $(isp_XTRAS) - isp_DEPENDENCIES = $(isp_XTRAS) errnos.inc - window_SOURCES = window.c - CLEANFILES = errnos.inc diff --git a/package/linux-atm/patches/patch-src_test_ispl_l_c b/package/linux-atm/patches/patch-src_test_ispl_l_c deleted file mode 100644 index e7a8af5f2..000000000 --- a/package/linux-atm/patches/patch-src_test_ispl_l_c +++ /dev/null @@ -1,12 +0,0 @@ -$Id: update-patches 24 2008-08-31 14:56:13Z wbx $ ---- linux-atm-2.5.0.orig/src/test/ispl_l.c 2007-12-24 20:46:06.000000000 +0100 -+++ linux-atm-2.5.0/src/test/ispl_l.c 2009-05-29 21:41:01.398113709 +0200 -@@ -23,6 +23,8 @@ - - /* end standard C headers. */ - -+int yywrap(void) { return 1; } -+ - /* flex integer type definitions */ - - #ifndef FLEXINT_H diff --git a/package/linux-atm/patches/patch-src_test_ttcp_c b/package/linux-atm/patches/patch-src_test_ttcp_c deleted file mode 100644 index e436e9d9d..000000000 --- a/package/linux-atm/patches/patch-src_test_ttcp_c +++ /dev/null @@ -1,21 +0,0 @@ -$Id: update-patches 24 2008-08-31 14:56:13Z wbx $ ---- linux-atm-2.5.0.orig/src/test/ttcp.c 2005-04-18 18:18:28.000000000 +0200 -+++ linux-atm-2.5.0/src/test/ttcp.c 2009-05-29 21:27:32.488378268 +0200 -@@ -331,7 +331,7 @@ int no_check = 0; - /* xmitr */ - if (optind == argc) - goto usage; -- bzero((char *)&sinhim, sizeof(sinhim)); -+ memset((char *)&sinhim, 0, sizeof(sinhim)); - if (atoi(host) > 0 ) { - /* Numeric */ - sinhim.sin_family = AF_INET; -@@ -345,7 +345,7 @@ int no_check = 0; - if ((addr=gethostbyname(host)) == NULL) - err("bad hostname"); - sinhim.sin_family = addr->h_addrtype; -- bcopy(addr->h_addr,(char*)&addr_tmp, addr->h_length); -+ memcpy((char*)&addr_tmp, addr->h_addr, addr->h_length); - #if defined(cray) - sinhim.sin_addr = addr_tmp; - #else diff --git a/package/mtd/Config.in b/package/mtd/Config.in new file mode 100644 index 000000000..aacc297b5 --- /dev/null +++ b/package/mtd/Config.in @@ -0,0 +1,9 @@ +config ADK_PACKAGE_MTD + prompt "mtd................................ mtd utility" + tristate + depends on \ + ADK_LINUX_CRIS_FOXBOARD || \ + ADK_LINUX_MIPS_AG241 + default n + help + MTD utility. diff --git a/package/mtd/Makefile b/package/mtd/Makefile new file mode 100644 index 000000000..67aa1f30c --- /dev/null +++ b/package/mtd/Makefile @@ -0,0 +1,32 @@ +# This file is part of the OpenADK project. OpenADK is copyrighted +# material, please see the LICENCE file in the top-level directory. + +include ${TOPDIR}/rules.mk + +PKG_NAME:= mtd +PKG_VERSION:= 1.0 +PKG_RELEASE:= 1 +PKG_DESCR:= MTD utility +PKG_SECTION:= base + +WRKDIST= ${WRKDIR}/${PKG_NAME}-${PKG_VERSION} +NO_DISTFILES:= 1 + +include ${TOPDIR}/mk/package.mk + +$(eval $(call PKG_template,MTD,${PKG_NAME},${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION})) + +BUILD_STYLE:= manual +INSTALL_STYLE:= manual + +do-build: + mkdir -p ${WRKBUILD} + ${CP} ./src/* ${WRKBUILD} + ${TARGET_CC} ${TCPPFLAGS} ${TCFLAGS} -o ${WRKBUILD}/mtd \ + ${WRKBUILD}/mtd.c + +do-install: + ${INSTALL_DIR} ${IDIR_MTD}/sbin + ${INSTALL_BIN} ${WRKBUILD}/mtd ${IDIR_MTD}/sbin/mtd + +include ${TOPDIR}/mk/pkg-bottom.mk diff --git a/package/mtd/src/mtd.c b/package/mtd/src/mtd.c new file mode 100644 index 000000000..6812c5e31 --- /dev/null +++ b/package/mtd/src/mtd.c @@ -0,0 +1,379 @@ +/* + * mtd - simple memory technology device manipulation tool + * + * Copyright (c) 2006, 2007 Thorsten Glaser + * Copyright (C) 2005 Waldemar Brodkorb , + * Felix Fietkau + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * The code is based on the linux-mtd examples. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#define BUFSIZE (16 * 1024) +#define MAX_ARGS 8 + +#define DEBUG + +int mtd_check(char *); +int mtd_unlock(const char *); +int mtd_open(const char *, int); +int mtd_erase(const char *); +int mtd_write(int, const char *, int, bool); +void usage(void) __attribute__((noreturn)); + +char buf[BUFSIZE]; +int buflen; + +int +mtd_check(char *mtd) +{ + struct mtd_info_user mtdInfo; + int fd; + + fd = mtd_open(mtd, O_RDWR | O_SYNC); + if(fd < 0) { + fprintf(stderr, "Could not open mtd device: %s\n", mtd); + return 0; + } + + if(ioctl(fd, MEMGETINFO, &mtdInfo)) { + fprintf(stderr, "Could not get MTD device info from %s\n", mtd); + close(fd); + return 0; + } + + close(fd); + return 1; +} + +int +mtd_unlock(const char *mtd) +{ + int fd; + struct mtd_info_user mtdInfo; + struct erase_info_user mtdLockInfo; + + fd = mtd_open(mtd, O_RDWR | O_SYNC); + if(fd < 0) { + fprintf(stderr, "Could not open mtd device: %s\n", mtd); + exit(1); + } + + if(ioctl(fd, MEMGETINFO, &mtdInfo)) { + fprintf(stderr, "Could not get MTD device info from %s\n", mtd); + close(fd); + exit(1); + } + + mtdLockInfo.start = 0; + mtdLockInfo.length = mtdInfo.size; + if(ioctl(fd, MEMUNLOCK, &mtdLockInfo)) { + close(fd); + return 0; + } + + close(fd); + return 0; +} + +int +mtd_open(const char *mtd, int flags) +{ + FILE *fp; + char dev[PATH_MAX]; + int i; + + if ((fp = fopen("/proc/mtd", "r"))) { + while (fgets(dev, sizeof(dev), fp)) { + if (sscanf(dev, "mtd%d:", &i) && strstr(dev, mtd)) { + snprintf(dev, sizeof(dev), "/dev/mtd%d", i); + fclose(fp); + return open(dev, flags); + } + } + fclose(fp); + } + + return open(mtd, flags); +} + +int +mtd_erase(const char *mtd) +{ + int fd; + struct mtd_info_user mtdInfo; + struct erase_info_user mtdEraseInfo; + + fd = mtd_open(mtd, O_RDWR | O_SYNC); + if(fd < 0) { + fprintf(stderr, "Could not open mtd device: %s\n", mtd); + exit(1); + } + + if(ioctl(fd, MEMGETINFO, &mtdInfo)) { + fprintf(stderr, "Could not get MTD device info from %s\n", mtd); + close(fd); + exit(1); + } + + mtdEraseInfo.length = mtdInfo.erasesize; + + for (mtdEraseInfo.start = 0; + mtdEraseInfo.start < mtdInfo.size; + mtdEraseInfo.start += mtdInfo.erasesize) { + + ioctl(fd, MEMUNLOCK, &mtdEraseInfo); + if(ioctl(fd, MEMERASE, &mtdEraseInfo)) { + fprintf(stderr, "Could not erase MTD device: %s\n", mtd); + close(fd); + exit(1); + } + } + + close(fd); + return 0; + +} + +int +mtd_write(int imagefd, const char *mtd, int quiet, bool do_erase) +{ + int fd, result; + size_t r, w, e; + struct mtd_info_user mtdInfo; + struct erase_info_user mtdEraseInfo; + + fd = mtd_open(mtd, O_RDWR | O_SYNC); + if(fd < 0) { + fprintf(stderr, "Could not open mtd device: %s\n", mtd); + exit(1); + } + + if(ioctl(fd, MEMGETINFO, &mtdInfo)) { + fprintf(stderr, "Could not get MTD device info from %s\n", mtd); + close(fd); + exit(1); + } + + r = w = e = 0; + if (!quiet) + fprintf(stderr, " [ ]"); + + for (;;) { + /* buffer may contain data already (from trx check) */ + r = buflen; + r += read(imagefd, buf + buflen, BUFSIZE - buflen); + w += r; + + /* EOF */ + if (r <= 0) break; + + /* need to erase the next block before writing data to it */ + while (do_erase && w > e) { + mtdEraseInfo.start = e; + mtdEraseInfo.length = mtdInfo.erasesize; + + if (!quiet) + fprintf(stderr, "\b\b\b[e]"); + /* erase the chunk */ + if (ioctl (fd,MEMERASE,&mtdEraseInfo) < 0) { + fprintf(stderr, "Erasing mtd failed: %s\n", mtd); + exit(1); + } + e += mtdInfo.erasesize; + } + + if (!quiet) + fprintf(stderr, "\b\b\b[w]"); + + if ((result = write(fd, buf, r)) < (ssize_t)r) { + if (result < 0) { + fprintf(stderr, "Error writing image.\n"); + exit(1); + } else { + fprintf(stderr, "Insufficient space.\n"); + exit(1); + } + } + + buflen = 0; + } + if (!quiet) + fprintf(stderr, "\b\b\b\b"); + + close(fd); + return 0; +} + +void +usage(void) +{ + fprintf(stderr, "Usage: mtd [ ...] [ ...] \n\n" + "The device is in the format of mtdX (eg: mtd4) or its label.\n" + "mtd recognises these commands:\n" + " unlock unlock the device\n" + " erase erase all data on device\n" + " write |- write (use - for stdin) to device\n" + "Following options are available:\n" + " -q quiet mode (once: no [w] on writing,\n" + " twice: no status messages)\n" + " -e erase before executing the command\n\n" + "Example: To write linux.trx to mtd1 labeled as linux\n" + " mtd write linux.trx linux\n\n"); + exit(1); +} + +int +main(int argc, char **argv) +{ + int ch, i, imagefd = -1, quiet, unlocked; + char *erase[MAX_ARGS], *device; + const char *imagefile = NULL; + enum { + CMD_ERASE, + CMD_WRITE, + CMD_UNLOCK + } cmd; + + erase[0] = NULL; + buflen = 0; + quiet = 0; + + while ((ch = getopt(argc, argv, "Fqe:")) != -1) + switch (ch) { + case 'F': + quiet = 1; + /* FALLTHROUGH */ + case 'q': + quiet++; + break; + case 'e': + i = 0; + while ((erase[i] != NULL) && ((i + 1) < MAX_ARGS)) + i++; + + erase[i++] = optarg; + erase[i] = NULL; + break; + + case '?': + default: + usage(); + } + argc -= optind; + argv += optind; + + if (argc < 2) + usage(); + + if ((strcmp(argv[0], "unlock") == 0) && (argc == 2)) { + cmd = CMD_UNLOCK; + device = argv[1]; + } else if ((strcmp(argv[0], "erase") == 0) && (argc == 2)) { + cmd = CMD_ERASE; + device = argv[1]; + } else if ((strcmp(argv[0], "write") == 0) && (argc == 3)) { + cmd = CMD_WRITE; + device = argv[2]; + + if (strcmp(argv[1], "-") == 0) { + imagefile = ""; + imagefd = 0; + } else { + imagefile = argv[1]; + if ((imagefd = open(argv[1], O_RDONLY)) < 0) { + fprintf(stderr, "Couldn't open image file: %s!\n", imagefile); + exit(1); + } + } + + if (!mtd_check(device)) { + fprintf(stderr, "Can't open device for writing!\n"); + exit(1); + } + } else { + usage(); + } + + sync(); + + i = 0; + unlocked = 0; + while (erase[i] != NULL) { + if (quiet < 2) + fprintf(stderr, "Unlocking %s ...\n", erase[i]); + mtd_unlock(erase[i]); + if (quiet < 2) + fprintf(stderr, "Erasing %s ...\n", erase[i]); + mtd_erase(erase[i]); + if (strcmp(erase[i], device) == 0) + /* this means that is unlocked and erased */ + unlocked = 1; + i++; + } + + if (!unlocked) { + if (quiet < 2) + fprintf(stderr, "Unlocking %s ...\n", device); + mtd_unlock(device); + } + + switch (cmd) { + case CMD_UNLOCK: + break; + case CMD_ERASE: + if (unlocked) { + fprintf(stderr, "Already erased: %s\n", device); + break; + } + if (quiet < 2) + fprintf(stderr, "Erasing %s ...\n", device); + mtd_erase(device); + break; + case CMD_WRITE: + if (quiet < 2) + fprintf(stderr, "Writing from %s to %s ... ", imagefile, device); + mtd_write(imagefd, device, quiet, (unlocked == 0)); + if (quiet < 2) + fprintf(stderr, "\n"); + break; + } + + sync(); + return 0; +} diff --git a/target/Config.in b/target/Config.in index 7fcc049fd..2ff9ce4dd 100644 --- a/target/Config.in +++ b/target/Config.in @@ -557,7 +557,8 @@ config ADK_TARGET_ROOTFS_INITRAMFS_PIGGYBACK create an read-only initramfs system. config ADK_TARGET_ROOTFS_SQUASHFS - bool "squashfs read-only root filesystem" + bool "Compressed read-only root filesystem (squashfs)" + select ADK_KERNEL_SQUASHFS depends on \ ADK_LINUX_CRIS_FOXBOARD || \ ADK_LINUX_MIPS_AG241 || \ diff --git a/target/ag241/patches/ar7.patch b/target/ag241/patches/ar7.patch index a09ea1c18..8b28e854c 100644 --- a/target/ag241/patches/ar7.patch +++ b/target/ag241/patches/ar7.patch @@ -76,6 +76,40 @@ diff -Nur linux-2.6.32.orig/arch/mips/kernel/traps.c linux-2.6.32/arch/mips/kern } return (void *)old_handler; } +diff -Nur linux-2.6.32.orig/drivers/mtd/ar7part.c linux-2.6.32/drivers/mtd/ar7part.c +--- linux-2.6.32.orig/drivers/mtd/ar7part.c 2009-12-03 04:51:21.000000000 +0100 ++++ linux-2.6.32/drivers/mtd/ar7part.c 2009-12-17 10:51:32.044434005 +0100 +@@ -28,7 +28,7 @@ + #include + #include + +-#define AR7_PARTS 4 ++#define AR7_PARTS 5 + #define ROOT_OFFSET 0xe0000 + + #define LOADER_MAGIC1 le32_to_cpu(0xfeedfa42) +@@ -122,14 +122,19 @@ + + ar7_parts[2].name = "linux"; + ar7_parts[2].offset = pre_size; +- ar7_parts[2].size = master->size - pre_size - post_size; ++ ar7_parts[2].size = master->size - pre_size - post_size - 2*master->erasesize; + ar7_parts[2].mask_flags = 0; + + ar7_parts[3].name = "rootfs"; + ar7_parts[3].offset = root_offset; +- ar7_parts[3].size = master->size - root_offset - post_size; ++ ar7_parts[3].size = master->size - root_offset - post_size - 2*master->erasesize; + ar7_parts[3].mask_flags = 0; + ++ ar7_parts[4].name = "cfgfs"; ++ ar7_parts[4].offset = master->size - 2*master->erasesize; ++ ar7_parts[4].size = 2*master->erasesize; ++ ar7_parts[4].mask_flags = 0; ++ + *pparts = ar7_parts; + return AR7_PARTS; + } diff -Nur linux-2.6.32.orig/drivers/mtd/maps/physmap.c linux-2.6.32/drivers/mtd/maps/physmap.c --- linux-2.6.32.orig/drivers/mtd/maps/physmap.c 2009-12-03 04:51:21.000000000 +0100 +++ linux-2.6.32/drivers/mtd/maps/physmap.c 2009-12-16 20:12:01.388510102 +0100 diff --git a/target/linux/config/Config.in.fs b/target/linux/config/Config.in.fs index a9c2668ae..8631b486e 100644 --- a/target/linux/config/Config.in.fs +++ b/target/linux/config/Config.in.fs @@ -17,6 +17,10 @@ config ADK_KPACKAGE_KMOD_EXPORTFS default n help +config ADK_KERNEL_SQUASHFS + boolean + default n + config ADK_KERNEL_EXT2_FS boolean default n diff --git a/target/linux/config/Config.in.network b/target/linux/config/Config.in.network index 349f4a9fd..05995b8b2 100644 --- a/target/linux/config/Config.in.network +++ b/target/linux/config/Config.in.network @@ -40,23 +40,23 @@ config ADK_KERNEL_LLC tristate default n -#config ADK_KPACKAGE_KMOD_ATM -# prompt "kmod-atm.......................... Asynchronous Transfer Mode (ATM)" -# tristate -# default n -# help -# ATM is a high-speed networking technology for Local Area Networks -# and Wide Area Networks. It uses a fixed packet size and is -# connection oriented, allowing for the negotiation of minimum -# bandwidth requirements. -# -# In order to participate in an ATM network, your Linux box needs an -# ATM networking card. If you have that, say Y here and to the driver -# of your ATM card below. -# -# Note that you need a set of user-space programs to actually make use -# of ATM. See the file for -# further details. +config ADK_KPACKAGE_KMOD_ATM + prompt "kmod-atm.......................... Asynchronous Transfer Mode (ATM)" + tristate + default n + help + ATM is a high-speed networking technology for Local Area Networks + and Wide Area Networks. It uses a fixed packet size and is + connection oriented, allowing for the negotiation of minimum + bandwidth requirements. + + In order to participate in an ATM network, your Linux box needs an + ATM networking card. If you have that, say Y here and to the driver + of your ATM card below. + + Note that you need a set of user-space programs to actually make use + of ATM. See the file for + further details. config ADK_KPACKAGE_KMOD_BRIDGE prompt "kmod-net-bridge................... 802.1d Ethernet Bridging" -- cgit v1.2.3 From f9b8f27119a5fc811c2a0a25e686638c8b5680b8 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Thu, 17 Dec 2009 20:17:21 +0100 Subject: add sangam-atm package - driver package for ag241 dsl modem, it loads, but we will see if it works.. --- mk/kernel-build.mk | 6 +- mk/kernel-vars.mk | 8 + package/Makefile | 1 + package/linux-atm/Makefile | 4 +- package/sangam-atm/Config.in | 23 + package/sangam-atm/Makefile | 41 ++ package/sangam-atm/patches/patch-Makefile | 29 + package/sangam-atm/patches/patch-cp_sar_reg_h | 8 + package/sangam-atm/patches/patch-cppi_cpaal5_c | 11 + .../sangam-atm/patches/patch-dev_host_interface_h | 11 + package/sangam-atm/patches/patch-dsl_hal_advcfg_c | 15 + package/sangam-atm/patches/patch-dsl_hal_api_c | 107 ++++ package/sangam-atm/patches/patch-dsl_hal_support_c | 52 ++ package/sangam-atm/patches/patch-dsl_hal_support_h | 11 + package/sangam-atm/patches/patch-tn7api_h | 17 + package/sangam-atm/patches/patch-tn7atm_c | 633 +++++++++++++++++++++ package/sangam-atm/patches/patch-tn7atm_h | 50 ++ package/sangam-atm/patches/patch-tn7dsl_c | 602 ++++++++++++++++++++ package/sangam-atm/patches/patch-tn7sar_c | 79 +++ target/ag241/kernel.config | 2 +- target/linux/config/Config.in.netdevice | 7 + 21 files changed, 1709 insertions(+), 8 deletions(-) create mode 100644 mk/kernel-vars.mk create mode 100644 package/sangam-atm/Config.in create mode 100644 package/sangam-atm/Makefile create mode 100644 package/sangam-atm/patches/patch-Makefile create mode 100644 package/sangam-atm/patches/patch-cp_sar_reg_h create mode 100644 package/sangam-atm/patches/patch-cppi_cpaal5_c create mode 100644 package/sangam-atm/patches/patch-dev_host_interface_h create mode 100644 package/sangam-atm/patches/patch-dsl_hal_advcfg_c create mode 100644 package/sangam-atm/patches/patch-dsl_hal_api_c create mode 100644 package/sangam-atm/patches/patch-dsl_hal_support_c create mode 100644 package/sangam-atm/patches/patch-dsl_hal_support_h create mode 100644 package/sangam-atm/patches/patch-tn7api_h create mode 100644 package/sangam-atm/patches/patch-tn7atm_c create mode 100644 package/sangam-atm/patches/patch-tn7atm_h create mode 100644 package/sangam-atm/patches/patch-tn7dsl_c create mode 100644 package/sangam-atm/patches/patch-tn7sar_c (limited to 'target/ag241') diff --git a/mk/kernel-build.mk b/mk/kernel-build.mk index c32964c10..3c594ef90 100644 --- a/mk/kernel-build.mk +++ b/mk/kernel-build.mk @@ -4,14 +4,10 @@ include $(TOPDIR)/rules.mk include $(TOPDIR)/mk/linux.mk include ${TOPDIR}/mk/buildhlp.mk +include ${TOPDIR}/mk/kernel-vars.mk KERNEL_PKGDIR:=$(LINUX_BUILD_DIR)/kernel-pkg -KERNEL_MAKE_OPTS:= -C "${LINUX_DIR}" V=1 -ifneq ($(ADK_NATIVE),y) -KERNEL_MAKE_OPTS+= CROSS_COMPILE="$(TARGET_CROSS)" ARCH=$(ARCH) CC="$(TARGET_CC)" -endif - $(TOOLCHAIN_BUILD_DIR)/linux-$(KERNEL_VERSION)/.patched: $(TRACE) target/$(ADK_TARGET)-kernel-patch $(PATCH) $(TOOLCHAIN_BUILD_DIR)/linux-$(KERNEL_VERSION) ../linux/patches/$(KERNEL_VERSION) *.patch $(MAKE_TRACE) diff --git a/mk/kernel-vars.mk b/mk/kernel-vars.mk new file mode 100644 index 000000000..cbc1257ff --- /dev/null +++ b/mk/kernel-vars.mk @@ -0,0 +1,8 @@ +# This file is part of the OpenADK project. OpenADK is copyrighted +# material, please see the LICENCE file in the top-level directory. + +KERNEL_MAKE_OPTS:= -C "${LINUX_DIR}" V=1 +ifneq ($(ADK_NATIVE),y) +KERNEL_MAKE_OPTS+= CROSS_COMPILE="$(TARGET_CROSS)" ARCH=$(ARCH) CC="$(TARGET_CC)" +endif + diff --git a/package/Makefile b/package/Makefile index 994520726..ce92c1cb0 100644 --- a/package/Makefile +++ b/package/Makefile @@ -453,6 +453,7 @@ package-$(ADK_PACKAGE_ZSH) += zsh # kernel addon packages package-$(ADK_PACKAGE_KMOD_EM28XX) += em28xx package-$(ADK_PACKAGE_NTFS_3G) += ntfs-3g +package-$(ADK_PACKAGE_KMOD_SANGAM_ATM) += sangam-atm DOWNLOAD:=$(patsubst %,%-download,$(package-y) $(package-m)) COMPILE_PACKAGES:=$(patsubst %,%-compile,$(package-y) $(package-m)) diff --git a/package/linux-atm/Makefile b/package/linux-atm/Makefile index 2f32e7aa8..1ebd2172b 100644 --- a/package/linux-atm/Makefile +++ b/package/linux-atm/Makefile @@ -5,7 +5,7 @@ include ${TOPDIR}/rules.mk PKG_NAME:= linux-atm PKG_VERSION:= 2.5.1 -PKG_RELEASE:= 1 +PKG_RELEASE:= 2 PKG_MD5SUM:= 9560b0e1f410a05b849dfdab465dd758 PKG_DESCR:= ATM library and tools for Linux PKG_SECTION:= libs @@ -29,7 +29,7 @@ INSTALL_STYLE:= auto post-install: ${INSTALL_DIR} ${IDIR_LIBATM}/usr/lib - ${CP} ${WRKINST}/usr/lib/libatm.so.1 ${IDIR_LIBATM}/usr/lib + ${CP} ${WRKINST}/usr/lib/libatm.so* ${IDIR_LIBATM}/usr/lib ${INSTALL_DIR} ${IDIR_BR2684CTL}/usr/sbin ${CP} ${WRKINST}/usr/sbin/br2684ctl ${IDIR_BR2684CTL}/usr/sbin diff --git a/package/sangam-atm/Config.in b/package/sangam-atm/Config.in new file mode 100644 index 000000000..fb37f6431 --- /dev/null +++ b/package/sangam-atm/Config.in @@ -0,0 +1,23 @@ +config ADK_PACKAGE_KMOD_SANGAM_ATM + prompt "kmod-sangam-atm.......................... Driver for TI AR7 DSL modem" + tristate + select ADK_KPACKAGE_KMOD_FW_LOADER + default n + help + ATM driver for AR7 DSL modem. + +choice +prompt "Firmware type" +depends on ADK_PACKAGE_KMOD_SANGAM_ATM + +config ADK_PACKAGE_SANGAM_ATM_ANNEX_A + prompt "Annex A, ADSL over POTS" + boolean + help + +config ADK_PACKAGE_SANGAM_ATM_ANNEX_B + prompt "Annex B, ADSL over ISDN" + boolean + help + +endchoice diff --git a/package/sangam-atm/Makefile b/package/sangam-atm/Makefile new file mode 100644 index 000000000..e6c98e4c4 --- /dev/null +++ b/package/sangam-atm/Makefile @@ -0,0 +1,41 @@ +# This file is part of the OpenADK project. OpenADK is copyrighted +# material, please see the LICENCE file in the top-level directory. + +include ${TOPDIR}/rules.mk + +PKG_NAME:= sangam-atm +PKG_VERSION:= 1.0 +PKG_RELEASE:= 1 +PKG_MD5SUM:= 3843f3e670967fe81561770ac960c1cd +PKG_DESCR:= sangam-atm DSL modem driver for TI AR7 boards +PKG_SECTION:= kernel +PKG_SITES:= http://openadk.org/distfiles/ + +include ${TOPDIR}/mk/package.mk +include ${TOPDIR}/mk/kernel-vars.mk + +$(eval $(call PKG_template,KMOD_SANGAM_ATM,kmod-sangam-atm,${KERNEL_VERSION}+${PKG_VERSION}-${ADK_TARGET}-${PKG_RELEASE},kernel ${KERNEL_VERSION}-${KERNEL_RELEASE},${PKG_DESCR},${PKG_SECTION})) + +BUILD_STYLE:= manual +INSTALL_STYLE:= manual + +do-build: + $(MAKE) ${KERNEL_MAKE_OPTS} LDFLAGS="" SUBDIRS="${WRKBUILD}" modules + +do-install: + ${INSTALL_DIR} ${IDIR_KMOD_SANGAM_ATM}/etc/modules.d/ + echo "tiatm" > ${IDIR_KMOD_SANGAM_ATM}/etc/modules.d/70-sangam-atm + ${INSTALL_DIR} ${IDIR_KMOD_SANGAM_ATM}/lib/modules/${KERNEL_VERSION}/ + ${INSTALL_DATA} ${WRKBUILD}/tiatm.ko \ + ${IDIR_KMOD_SANGAM_ATM}/lib/modules/${KERNEL_VERSION} + ${INSTALL_DIR} ${IDIR_KMOD_SANGAM_ATM}/lib/firmware +ifeq (${ADK_PACKAGE_SANGAM_ATM_ANNEX_A},y) + ${INSTALL_DATA} ${WRKBUILD}/ar0700mp.bin \ + ${IDIR_KMOD_SANGAM_ATM}/lib/firmware/ar0700xx.bin +endif +ifeq (${ADK_PACKAGE_SANGAM_ATM_ANNEX_B},y) + ${INSTALL_DATA} ${WRKBUILD}/ar0700db.bin \ + ${IDIR_KMOD_SANGAM_ATM}/lib/firmware/ar0700xx.bin +endif + +include ${TOPDIR}/mk/pkg-bottom.mk diff --git a/package/sangam-atm/patches/patch-Makefile b/package/sangam-atm/patches/patch-Makefile new file mode 100644 index 000000000..4386b4a3f --- /dev/null +++ b/package/sangam-atm/patches/patch-Makefile @@ -0,0 +1,29 @@ +--- sangam-atm-1.0.orig/Makefile 2005-06-01 05:46:28.000000000 +0200 ++++ sangam-atm-1.0/Makefile 2009-12-17 19:10:13.456420379 +0100 +@@ -1,18 +1,11 @@ +-# File: drivers/atm/ti_evm3/Makefile +-# +-# Makefile for the Texas Instruments EVM3 ADSL/ATM driver. + # ++# Makefile for the TIATM device driver. + # +-# Copyright (c) 2000 Texas Instruments Incorporated. +-# Jeff Harrell (jharrell@telogy.com) +-# Viren Balar (vbalar@ti.com) +-# Victor Wells (vwells@telogy.com) +-# +-include $(TOPDIR)/Rules.make +- +- +- +- +- +- + ++CONFIG_SANGAM_ATM=m ++#EXTRA_CFLAGS += -DEL -I. -DPOST_SILICON -DCOMMON_NSP -DCONFIG_LED_MODULE -DDEREGISTER_LED -DNO_ACT ++#EXTRA_CFLAGS += -DEL -I$(PWD) -DPOST_SILICON -DCOMMON_NSP -DNO_ACT -D__NO__VOICE_PATCH__ -DEL ++#EXTRA_CFLAGS += -DEL -I$(PWD) -DPOST_SILICON -DCOMMON_NSP -D__NO__VOICE_PATCH__ -DEL ++EXTRA_CFLAGS += -DEL -I$(PWD) -DPOST_SILICON -DCOMMON_NSP -D__NO__VOICE_PATCH__ -DEL -DCPATM_TASKLET_MODE ++obj-$(CONFIG_SANGAM_ATM) := tiatm.o ++tiatm-objs += cpsar.o aal5sar.o tn7sar.o tn7atm.o tn7dsl.o dsl_hal_api.o dsl_hal_support.o dsl_hal_advcfg.o diff --git a/package/sangam-atm/patches/patch-cp_sar_reg_h b/package/sangam-atm/patches/patch-cp_sar_reg_h new file mode 100644 index 000000000..2452ff86d --- /dev/null +++ b/package/sangam-atm/patches/patch-cp_sar_reg_h @@ -0,0 +1,8 @@ +--- sangam-atm-1.0.orig/cp_sar_reg.h 2004-04-20 08:23:30.000000000 +0200 ++++ sangam-atm-1.0/cp_sar_reg.h 2009-12-17 19:25:17.702739456 +0100 +@@ -214,4 +214,4 @@ + + /* END OF FILE */ + +-#endif _INC_SAR_REG ++#endif diff --git a/package/sangam-atm/patches/patch-cppi_cpaal5_c b/package/sangam-atm/patches/patch-cppi_cpaal5_c new file mode 100644 index 000000000..a32408982 --- /dev/null +++ b/package/sangam-atm/patches/patch-cppi_cpaal5_c @@ -0,0 +1,11 @@ +--- sangam-atm-1.0.orig/cppi_cpaal5.c 2005-04-08 10:22:04.000000000 +0200 ++++ sangam-atm-1.0/cppi_cpaal5.c 2009-12-17 19:09:41.516423269 +0100 +@@ -352,7 +352,7 @@ static int halRxReturn(HAL_RECEIVEINFO * + { + /* malloc failed, add this RCB to Needs Buffer List */ + TempRcb->FragCount = 1; /*MJH+030417*/ +- (HAL_RCB *)TempRcb->Eop = TempRcb; /* GSG +030430 */ ++ TempRcb->Eop = TempRcb; /* GSG +030430 */ + + if(HalDev->NeedsCount < MAX_NEEDS) /* +MJH 030410 */ + { /* +MJH 030410 */ diff --git a/package/sangam-atm/patches/patch-dev_host_interface_h b/package/sangam-atm/patches/patch-dev_host_interface_h new file mode 100644 index 000000000..6927ab96b --- /dev/null +++ b/package/sangam-atm/patches/patch-dev_host_interface_h @@ -0,0 +1,11 @@ +--- sangam-atm-1.0.orig/dev_host_interface.h 2007-03-07 14:40:14.000000000 +0100 ++++ sangam-atm-1.0/dev_host_interface.h 2009-12-17 19:27:01.156438308 +0100 +@@ -1288,7 +1288,7 @@ typedef struct + + SINT16 devCodecRxdf4Coeff[12] ; // (BOTH) IIR Coefficients + SINT16 devCodecTxdf2aCoeff[64] ; // (BOTH) FIR filter coefficients +-#if OHIO_SUPPORT ++#if defined(OHIO_SUPPORT) + SINT16 devCodecTxdf2bCoeff[84] ; // (BOTH) FIR filter coefficients + #else + SINT16 devCodecTxdf2bCoeff[64] ; // (BOTH) FIR filter coefficients diff --git a/package/sangam-atm/patches/patch-dsl_hal_advcfg_c b/package/sangam-atm/patches/patch-dsl_hal_advcfg_c new file mode 100644 index 000000000..33149402d --- /dev/null +++ b/package/sangam-atm/patches/patch-dsl_hal_advcfg_c @@ -0,0 +1,15 @@ +--- sangam-atm-1.0.orig/dsl_hal_advcfg.c 2005-08-09 09:20:46.000000000 +0200 ++++ sangam-atm-1.0/dsl_hal_advcfg.c 2009-12-17 19:09:58.440420854 +0100 +@@ -36,9 +36,9 @@ + * 05Jul05 0.00.09 CPH CQ9775: Change dslhal_advcfg_configDsTones input parameters & support for ADSL2+ + * 24Jul05 0.00.10 CPH Fixed comments in dslhal_advcfg_configDsTones function header + *******************************************************************************/ +-#include +-#include +-#include ++#include "dev_host_interface.h" ++#include "dsl_hal_register.h" ++#include "dsl_hal_support.h" + + /*****************************************************************************/ + /* ACT API functions -- To be moved into their own independent module --RamP */ diff --git a/package/sangam-atm/patches/patch-dsl_hal_api_c b/package/sangam-atm/patches/patch-dsl_hal_api_c new file mode 100644 index 000000000..b88f4350f --- /dev/null +++ b/package/sangam-atm/patches/patch-dsl_hal_api_c @@ -0,0 +1,107 @@ +--- sangam-atm-1.0.orig/dsl_hal_api.c 2007-03-07 04:13:06.000000000 +0100 ++++ sangam-atm-1.0/dsl_hal_api.c 2009-12-17 19:39:11.092420102 +0100 +@@ -254,15 +254,15 @@ + * of phyEnableDisableWord & phyControlWord to avoid changing API struct + * which may cause change required to application data structure. + ******************************************************************************/ +-#include +-#include +-#include ++#include "dev_host_interface.h" ++#include "dsl_hal_register.h" ++#include "dsl_hal_support.h" + + #ifndef NO_ADV_STATS +-#include ++#include "dsl_hal_logtable.h" + #endif + +-#include ++#include "dsl_hal_version.h" + + // UR8_MERGE_START CQ11054 Jack Zhang + static unsigned int highprecision_selected = 0; //By default we use low precision for backward compt. +@@ -958,9 +958,6 @@ int dslhal_api_pollTrainingStatus(tidsl_ + + /*char *tmp;*/ + DEV_HOST_dspOamSharedInterface_t *pdspOamSharedInterface, dspOamSharedInterface; +-#if SWTC +- DEV_HOST_tcHostCommDef_t TCHostCommDef; +-#endif + + dgprintf(5,"dslhal_api_pollTrainingStatus\n"); + pdspOamSharedInterface = (DEV_HOST_dspOamSharedInterface_t *) ptidsl->pmainAddr; +@@ -971,17 +968,6 @@ int dslhal_api_pollTrainingStatus(tidsl_ + dgprintf(1,"dslhal_support_blockRead failed\n"); + return DSLHAL_ERROR_BLOCK_READ; + } +-#if SWTC +- dspOamSharedInterface.tcHostComm_p =(DEV_HOST_tcHostCommDef_t *) dslhal_support_byteSwap32((unsigned int)dspOamSharedInterface.tcHostComm_p); +- +- rc = dslhal_support_blockRead((PVOID)dspOamSharedInterface.tcHostComm_p, +- &TCHostCommDef, sizeof(DEV_HOST_tcHostCommDef_t)); +- if (rc) +- { +- dgprintf(1,"dslhal_support_blockRead failed\n"); +- return DSLHAL_ERROR_BLOCK_READ; +- } +-#endif + + rc = dslhal_support_processTrainingState(ptidsl); + if(rc) +@@ -1025,9 +1011,6 @@ int dslhal_api_handleTrainingInterrupt(t + + /*char *tmp;*/ + DEV_HOST_dspOamSharedInterface_t *pdspOamSharedInterface, dspOamSharedInterface; +-#if SWTC +- DEV_HOST_tcHostCommDef_t TCHostCommDef; +-#endif + dgprintf(6,"dslhal_api_handleTrainingInterrupt\n"); + pdspOamSharedInterface = (DEV_HOST_dspOamSharedInterface_t *) ptidsl->pmainAddr; + rc = dslhal_support_blockRead(pdspOamSharedInterface, &dspOamSharedInterface, +@@ -1037,17 +1020,6 @@ int dslhal_api_handleTrainingInterrupt(t + dgprintf(1,"dslhal_support_blockRead failed\n"); + return DSLHAL_ERROR_BLOCK_READ; + } +-#if SWTC +- dspOamSharedInterface.tcHostComm_p =(DEV_HOST_tcHostCommDef_t *) dslhal_support_byteSwap32((unsigned int)dspOamSharedInterface.tcHostComm_p); +- +- rc = dslhal_support_blockRead((PVOID)dspOamSharedInterface.tcHostComm_p, +- &TCHostCommDef, sizeof(DEV_HOST_tcHostCommDef_t)); +- if (rc) +- { +- dgprintf(1,"dslhal_support_blockRead failed\n"); +- return DSLHAL_ERROR_BLOCK_READ; +- } +-#endif + + if(intrSource & MASK_BITFIELD_INTERRUPTS) + { +@@ -1705,27 +1677,15 @@ void dslhal_api_gatherStatistics(tidsl_t + /* Get ATM Stats for both US and DS for Channel 0*/ + ptidsl->AppData.usAtm_count[0] = dslhal_support_byteSwap32(usAtmStats0.goodCount); + ptidsl->AppData.usIdle_count[0] = dslhal_support_byteSwap32(usAtmStats0.idleCount); +-#if SWTC +- ptidsl->AppData.usPdu_count[0] = dslhal_support_byteSwap32(usAtmStats0.pduCount); +-#endif + ptidsl->AppData.dsGood_count[0] = dslhal_support_byteSwap32(dsAtmStats0.goodCount); + ptidsl->AppData.dsIdle_count[0] = dslhal_support_byteSwap32(dsAtmStats0.idleCount); +-#if SWTC +- ptidsl->AppData.dsPdu_count[0] = dslhal_support_byteSwap32(dsAtmStats0.pduCount); +-#endif + ptidsl->AppData.dsBadHec_count[0] = dslhal_support_byteSwap32((dsAtmStats0.badHecCount)); + ptidsl->AppData.dsOVFDrop_count[0] = dslhal_support_byteSwap32((dsAtmStats0.ovflwDropCount)); + /* Get ATM Stats for both US and DS for Channel 1*/ + ptidsl->AppData.usAtm_count[1] = dslhal_support_byteSwap32(usAtmStats1.goodCount); + ptidsl->AppData.usIdle_count[1] = dslhal_support_byteSwap32(usAtmStats1.idleCount); +-#if SWTC +- ptidsl->AppData.usPdu_count[1] = dslhal_support_byteSwap32(usAtmStats1.pduCount); +-#endif + ptidsl->AppData.dsGood_count[1] = dslhal_support_byteSwap32(dsAtmStats1.goodCount); + ptidsl->AppData.dsIdle_count[1] = dslhal_support_byteSwap32(dsAtmStats1.idleCount); +-#if SWTC +- ptidsl->AppData.dsPdu_count[1] = dslhal_support_byteSwap32(dsAtmStats1.pduCount); +-#endif + ptidsl->AppData.dsBadHec_count[1] = dslhal_support_byteSwap32((dsAtmStats1.badHecCount)); + ptidsl->AppData.dsOVFDrop_count[1] = dslhal_support_byteSwap32((dsAtmStats1.ovflwDropCount)); + diff --git a/package/sangam-atm/patches/patch-dsl_hal_support_c b/package/sangam-atm/patches/patch-dsl_hal_support_c new file mode 100644 index 000000000..f1cdcd64a --- /dev/null +++ b/package/sangam-atm/patches/patch-dsl_hal_support_c @@ -0,0 +1,52 @@ +--- sangam-atm-1.0.orig/dsl_hal_support.c 2007-05-18 09:47:33.000000000 +0200 ++++ sangam-atm-1.0/dsl_hal_support.c 2009-12-17 19:40:14.924421047 +0100 +@@ -140,9 +140,9 @@ + * oamFeature are overriden + // UR8_MERGE_END CQ10774 Ram + *******************************************************************************/ +-#include +-#include +-#include ++#include "dev_host_interface.h" ++#include "dsl_hal_register.h" ++#include "dsl_hal_support.h" + + #define NUM_READ_RETRIES 3 + static unsigned int dslhal_support_adsl2ByteSwap32(unsigned int in32Bits); +@@ -1665,9 +1665,6 @@ int dslhal_support_hostDspCodeDownload(t + unsigned char * image; + char *tmp = (char *)DEV_HOST_DSP_OAM_POINTER_LOCATION; + DEV_HOST_dspVersionDef_t dspVersion; +-#if SWTC +- DEV_HOST_tcHostCommDef_t TCHostCommDef; +-#endif + DEV_HOST_oamWrNegoParaDef_t OamWrNegoParaDef; + DEV_HOST_dspOamSharedInterface_t dspOamSharedInterface, *pdspOamSharedInterface; + DEV_HOST_olayDpDef_t olayDpParms; +@@ -2152,26 +2149,6 @@ int dslhal_support_hostDspCodeDownload(t + } + + /* table_dsp info */ +-#if SWTC +- dspOamSharedInterface.tcHostComm_p = (DEV_HOST_tcHostCommDef_t *)dslhal_support_byteSwap32((unsigned int)dspOamSharedInterface.tcHostComm_p); +- rc = dslhal_support_blockRead(&pdspOamSharedInterface->tcHostComm_p, +- &pTCHostCommDef, 4); +- if (rc) +- { +- dgprintf(1,"dslhal_support_blockRead failed\n"); +- return DSLHAL_ERROR_BLOCK_READ; +- } +- +- pTCHostCommDef=(DEV_HOST_tcHostCommDef_t *) dslhal_support_byteSwap32((unsigned int)pTCHostCommDef); +- +- rc = dslhal_support_blockRead((PVOID)dspOamSharedInterface.tcHostComm_p, +- &TCHostCommDef, sizeof(DEV_HOST_tcHostCommDef_t)); +- if (rc) +- { +- dgprintf(1,"dslhal_support_blockRead failed\n"); +- return DSLHAL_ERROR_BLOCK_READ; +- } +-#endif + /* Select the Multimode Training */ + dspOamSharedInterface.oamWriteNegoParams_p = (DEV_HOST_oamWrNegoParaDef_t *)dslhal_support_byteSwap32((unsigned int)dspOamSharedInterface.oamWriteNegoParams_p); + rc = dslhal_support_blockRead((PVOID)dspOamSharedInterface.oamWriteNegoParams_p, &OamWrNegoParaDef, sizeof(DEV_HOST_oamWrNegoParaDef_t)); diff --git a/package/sangam-atm/patches/patch-dsl_hal_support_h b/package/sangam-atm/patches/patch-dsl_hal_support_h new file mode 100644 index 000000000..074953501 --- /dev/null +++ b/package/sangam-atm/patches/patch-dsl_hal_support_h @@ -0,0 +1,11 @@ +--- sangam-atm-1.0.orig/dsl_hal_support.h 2005-11-11 09:07:04.000000000 +0100 ++++ sangam-atm-1.0/dsl_hal_support.h 2009-12-17 19:09:41.532422794 +0100 +@@ -49,7 +49,7 @@ + * 04Nov05 0.11.00 CPH Fixed T1413 mode got Zero DS/US rate when DSL_BIT_TMODE is set. + *******************************************************************************/ + +-#include ++#include "dsl_hal_api.h" + + #define virtual2Physical(a) (((int)a)&~0xe0000000) + /* External Function Prototype Declarations */ diff --git a/package/sangam-atm/patches/patch-tn7api_h b/package/sangam-atm/patches/patch-tn7api_h new file mode 100644 index 000000000..7688e20e0 --- /dev/null +++ b/package/sangam-atm/patches/patch-tn7api_h @@ -0,0 +1,17 @@ +--- sangam-atm-1.0.orig/tn7api.h 2006-12-11 15:36:54.000000000 +0100 ++++ sangam-atm-1.0/tn7api.h 2009-12-17 19:24:45.926721344 +0100 +@@ -107,7 +107,7 @@ int tn7dsl_proc_dbg_rmsgs4(char* buf, ch + + int tn7dsl_proc_write_stats(struct file *fp, const char * buf, unsigned long count, void * data); + int tn7dsl_proc_modem(char* buf, char **start, off_t offset, int count,int *eof, void *data); +-inline int tn7dsl_handle_interrupt(void); ++int tn7dsl_handle_interrupt(void); + + void tn7dsl_dslmod_sysctl_register(void); + void tn7dsl_dslmod_sysctl_unregister(void); +@@ -173,4 +173,4 @@ void tn7sar_get_sar_firmware_version(uns + int tn7sar_proc_oam_ping(char* buf, char **start, off_t offset, int count,int *eof, void *data); + int tn7sar_proc_pvc_table(char* buf, char **start, off_t offset, int count,int *eof, void *data); + int tn7sar_tx_flush(void *privContext, int chan, int queue, int skip); +-#endif __SGAPI_H ++#endif diff --git a/package/sangam-atm/patches/patch-tn7atm_c b/package/sangam-atm/patches/patch-tn7atm_c new file mode 100644 index 000000000..744dec517 --- /dev/null +++ b/package/sangam-atm/patches/patch-tn7atm_c @@ -0,0 +1,633 @@ +--- sangam-atm-1.0.orig/tn7atm.c 2007-05-18 09:45:50.000000000 +0200 ++++ sangam-atm-1.0/tn7atm.c 2009-12-17 19:10:27.616421480 +0100 +@@ -61,7 +61,6 @@ + * UR8_MERGE_END CQ11057* + *********************************************************************************************/ + +-#include + #include + #include + #include +@@ -69,11 +68,20 @@ + #include + #include + #include +-#include +-#include + #include + #include + #include ++#include ++ ++#include ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31) ++#include ++#include ++#else ++#include ++#include ++#endif ++ + #include "dsl_hal_api.h" + #include "tn7atm.h" + #include "tn7api.h" +@@ -82,8 +90,149 @@ + #include "dsl_hal_register.h" + + #ifdef MODULE ++MODULE_LICENSE("GPL"); + MODULE_DESCRIPTION ("Tnetd73xx ATM Device Driver"); + MODULE_AUTHOR ("Zhicheng Tang"); ++ ++int mp_sar_ipacemax = -1; ++module_param_named(ipacemax, mp_sar_ipacemax, int, 0); ++MODULE_PARM_DESC(ipacemax, "Interrupt pacing"); ++ ++char *mp_macc = NULL; ++module_param_named(macc, mp_macc, charp, 0); ++MODULE_PARM_DESC(macc, "MAC address"); ++ ++int mp_dsp_noboost = -1; ++module_param_named(dsp_noboost, mp_dsp_noboost, int, 0); ++MODULE_PARM_DESC(dsp_noboost, "Suppress DSP frequency boost"); ++ ++int mp_dsp_freq = -1; ++module_param_named(dsp_freq, mp_dsp_freq, int, 0); ++MODULE_PARM_DESC(dsp_freq, "Frequency to boost the DSP to"); ++ ++char *mp_featctl0 = NULL; ++module_param_named(featctl0, mp_featctl0, charp, 0); ++MODULE_PARM_DESC(featctl0, "DSL feature control 0"); ++ ++char *mp_featctl1 = NULL; ++module_param_named(featctl1, mp_featctl1, charp, 0); ++MODULE_PARM_DESC(featctl1, "DSL feature control 1"); ++ ++char *mp_phyctl0 = NULL; ++module_param_named(phyctl0, mp_phyctl0, charp, 0); ++MODULE_PARM_DESC(phyctl0, "DSL PHY control 0"); ++ ++char *mp_phyctl1 = NULL; ++module_param_named(phyctl1, mp_phyctl1, charp, 0); ++MODULE_PARM_DESC(phyctl1, "DSL PHY control 1"); ++ ++int mp_turbodsl = -1; ++module_param_named(turbodsl, mp_turbodsl, int, 0); ++MODULE_PARM_DESC(turbodsl, "Enable TurboDSL"); ++ ++int mp_sar_rxbuf = -1; ++module_param_named(sar_rxbuf, mp_sar_rxbuf, int, 0); ++MODULE_PARM_DESC(sar_rxbuf, "SAR RxBuf size"); ++ ++int mp_sar_rxmax = -1; ++module_param_named(sar_rxmax, mp_sar_rxmax, int, 0); ++MODULE_PARM_DESC(sar_rxmax, "SAR RxMax size"); ++ ++int mp_sar_txbuf = -1; ++module_param_named(sar_txbuf, mp_sar_txbuf, int, 0); ++MODULE_PARM_DESC(sar_txbuf, "SAR TxBuf size"); ++ ++int mp_sar_txmax = -1; ++module_param_named(sar_txmax, mp_sar_txmax, int, 0); ++MODULE_PARM_DESC(sar_txmax, "SAR TxMax size"); ++ ++char *mp_modulation = NULL; ++module_param_named(modulation, mp_modulation, charp, 0); ++MODULE_PARM_DESC(modulation, "Modulation"); ++ ++int mp_fine_gain_control = -1; ++module_param_named(fine_gain_control, mp_fine_gain_control, int, 0); ++MODULE_PARM_DESC(fine_gain_control, "Fine gain control"); ++ ++int mp_fine_gain_value = -1; ++module_param_named(fine_gain_value, mp_fine_gain_value, int, 0); ++MODULE_PARM_DESC(fine_gain_value, "Fine gain value"); ++ ++int mp_enable_margin_retrain = -1; ++module_param_named(enable_margin_retrain, mp_enable_margin_retrain, int, 0); ++MODULE_PARM_DESC(enable_margin_retrain, "Enable margin retrain"); ++ ++int mp_margin_threshold = -1; ++module_param_named(margin_threshold, mp_margin_threshold, int, 0); ++MODULE_PARM_DESC(margin_threshold, "Margin retrain treshold"); ++ ++int mp_enable_rate_adapt = -1; ++module_param_named(enable_rate_adapt, mp_enable_rate_adapt, int, 0); ++MODULE_PARM_DESC(enable_rate_adapt, "Enable rate adaption"); ++ ++int mp_powercutback = -1; ++module_param_named(powercutback, mp_powercutback, int, 0); ++MODULE_PARM_DESC(powercutback, "Enable / disable powercutback"); ++ ++int mp_trellis = -1; ++module_param_named(trellis, mp_trellis, int, 0); ++MODULE_PARM_DESC(trellis, "Enable / disable trellis coding"); ++ ++int mp_bitswap = -1; ++module_param_named(bitswap, mp_bitswap, int, 0); ++MODULE_PARM_DESC(bitswap, "Enable / disable bitswap"); ++ ++int mp_maximum_bits_per_carrier = -1; ++module_param_named(maximum_bits_per_carrier, mp_maximum_bits_per_carrier, int, 0); ++MODULE_PARM_DESC(maximum_bits_per_carrier, "Maximum bits per carrier"); ++ ++int mp_maximum_interleave_depth = -1; ++module_param_named(maximum_interleave_depth, mp_maximum_interleave_depth, int, 0); ++MODULE_PARM_DESC(maximum_interleave_depth, "Maximum interleave depth"); ++ ++int mp_pair_selection = -1; ++module_param_named(pair_selection, mp_pair_selection, int, 0); ++MODULE_PARM_DESC(pair_selection, "Pair selection"); ++ ++int mp_dgas_polarity = -1; ++module_param_named(dgas_polarity, mp_dgas_polarity, int, 0); ++MODULE_PARM_DESC(dgas_polarity, "DGAS polarity"); ++ ++int mp_los_alarm = -1; ++module_param_named(los_alarm, mp_los_alarm, int, 0); ++MODULE_PARM_DESC(los_alarm, "LOS alarm"); ++ ++char *mp_eoc_vendor_id = NULL; ++module_param_named(eoc_vendor_id, mp_eoc_vendor_id, charp, 0); ++MODULE_PARM_DESC(eoc_vendor_id, "EOC vendor id"); ++ ++int mp_eoc_vendor_revision = -1; ++module_param_named(eoc_vendor_revision, mp_eoc_vendor_revision, int, 0); ++MODULE_PARM_DESC(eoc_vendor_revision, "EOC vendor revision"); ++ ++char *mp_eoc_vendor_serialnum = NULL; ++module_param_named(eoc_vendor_serialnum, mp_eoc_vendor_serialnum, charp, 0); ++MODULE_PARM_DESC(eoc_vendor_serialnum, "EOC vendor serial number"); ++ ++char *mp_invntry_vernum = NULL; ++module_param_named(invntry_vernum, mp_invntry_vernum, charp, 0); ++MODULE_PARM_DESC(invntry_vernum, "Inventory revision number"); ++ ++int mp_dsl_bit_tmode = -1; ++module_param_named(dsl_bit_tmode, mp_dsl_bit_tmode, int, 0); ++MODULE_PARM_DESC(dsl_bit_tmode, "DSL bit training mode"); ++ ++int mp_high_precision = -1; ++module_param_named(high_precision, mp_high_precision, int, 0); ++MODULE_PARM_DESC(high_precision, "High precision"); ++ ++int mp_autopvc_enable = -1; ++module_param_named(autopvc_enable, mp_autopvc_enable, int, 0); ++MODULE_PARM_DESC(autopvc_enable, "Enable / disable automatic PVC"); ++ ++int mp_oam_lb_timeout = -1; ++module_param_named(oam_lb_timeout, mp_oam_lb_timeout, int, 0); ++MODULE_PARM_DESC(oam_lb_timeout, "OAM LB timeout"); + #endif + + #ifndef TRUE +@@ -100,9 +249,9 @@ MODULE_AUTHOR ("Zhicheng Tang"); + + /*end of externs */ + +-#ifndef TI_STATIC_ALLOCATIONS +-#define TI_STATIC_ALLOCATIONS +-#endif ++//#ifndef TI_STATIC_ALLOCATIONS ++//#define TI_STATIC_ALLOCATIONS ++//#endif + + #define tn7atm_kfree_skb(x) dev_kfree_skb(x) + +@@ -114,7 +263,7 @@ static int EnableQoS = FALSE; + /* prototypes */ + static int tn7atm_set_can_support_adsl2 (int can); + +-static int tn7atm_open (struct atm_vcc *vcc, short vpi, int vci); ++static int tn7atm_open (struct atm_vcc *vcc); + + static void tn7atm_close (struct atm_vcc *vcc); + +@@ -257,13 +406,12 @@ static const struct atmdev_ops tn7atm_op + getsockopt: NULL, + setsockopt: NULL, + send: tn7atm_send, +- sg_send: NULL, + phy_put: NULL, + phy_get: NULL, + change_qos: tn7atm_change_qos, + }; + +-const char drv_proc_root_folder[] = "avalanche/"; ++const char drv_proc_root_folder[] = "avalanche"; + static struct proc_dir_entry *root_proc_dir_entry = NULL; + #define DRV_PROC_MODE 0644 + static int proc_root_already_exists = TRUE; +@@ -559,62 +707,12 @@ static int turbodsl_check_priority_type( + + /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * +- * Function: int tn7atm_walk_vccs(struct atm_dev *dev, short *vcc, int *vci) +- * +- * Description: retrieve VPI/VCI for connection +- * +- *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ +-static int tn7atm_walk_vccs (struct atm_vcc *vcc, short *vpi, int *vci) +-{ +- struct atm_vcc *walk; +- +- /* +- * find a free VPI +- */ +- if (*vpi == ATM_VPI_ANY) +- { +- +- for (*vpi = 0, walk = vcc->dev->vccs; walk; walk = walk->next) +- { +- +- if ((walk->vci == *vci) && (walk->vpi == *vpi)) +- { +- (*vpi)++; +- walk = vcc->dev->vccs; +- } +- } +- } +- +- /* +- * find a free VCI +- */ +- if (*vci == ATM_VCI_ANY) +- { +- +- for (*vci = ATM_NOT_RSV_VCI, walk = vcc->dev->vccs; walk; +- walk = walk->next) +- { +- +- if ((walk->vpi = *vpi) && (walk->vci == *vci)) +- { +- *vci = walk->vci + 1; +- walk = vcc->dev->vccs; +- } +- } +- } +- +- return 0; +-} +- +- +-/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +- * + * Function: int tn7atm_sar_irq(void) + * + * Description: tnetd73xx SAR interrupt. + * + *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ +-static void tn7atm_sar_irq (int irq, void *voiddev, struct pt_regs *regs) ++static irqreturn_t tn7atm_sar_irq (int irq, void *voiddev) + { + struct atm_dev *atmdev; + Tn7AtmPrivate *priv; +@@ -641,6 +739,7 @@ static void tn7atm_sar_irq (int irq, voi + #ifdef TIATM_INST_SUPP + psp_trace_par (ATM_DRV_SAR_ISR_EXIT, retval); + #endif ++ return IRQ_HANDLED; + } + + /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +@@ -650,7 +749,7 @@ static void tn7atm_sar_irq (int irq, voi + * Description: tnetd73xx DSL interrupt. + * + *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ +-static void tn7atm_dsl_irq (int irq, void *voiddev, struct pt_regs *regs) ++static irqreturn_t tn7atm_dsl_irq (int irq, void *voiddev) + { + struct atm_dev *atmdev; + Tn7AtmPrivate *priv; +@@ -672,6 +771,8 @@ static void tn7atm_dsl_irq (int irq, voi + #ifdef TIATM_INST_SUPP + psp_trace_par (ATM_DRV_DSL_ISR_EXIT, retval); + #endif ++ ++ return IRQ_HANDLED; + } + + /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +@@ -693,25 +794,25 @@ static int __init tn7atm_irq_request (st + * Register SAR interrupt + */ + priv->sar_irq = LNXINTNUM (ATM_SAR_INT); /* Interrupt line # */ +- if (request_irq (priv->sar_irq, tn7atm_sar_irq, SA_INTERRUPT, "SAR ", dev)) ++ if (request_irq (priv->sar_irq, tn7atm_sar_irq, IRQF_DISABLED, "SAR ", dev)) + printk ("Could not register tn7atm_sar_irq\n"); + + /* + * interrupt pacing + */ + ptr = prom_getenv ("sar_ipacemax"); +- if (ptr) ++ if (ptr || mp_sar_ipacemax != -1) + { +- def_sar_inter_pace = os_atoi (ptr); ++ def_sar_inter_pace = mp_sar_ipacemax == -1 ? os_atoi (ptr) : mp_sar_ipacemax; + } +- avalanche_request_pacing (priv->sar_irq, ATM_SAR_INT_PACING_BLOCK_NUM, +- def_sar_inter_pace); ++/* avalanche_request_pacing (priv->sar_irq, ATM_SAR_INT_PACING_BLOCK_NUM, ++ def_sar_inter_pace);*/ + + /* + * Reigster Receive interrupt A + */ + priv->dsl_irq = LNXINTNUM (ATM_DSL_INT); /* Interrupt line # */ +- if (request_irq (priv->dsl_irq, tn7atm_dsl_irq, SA_INTERRUPT, "DSL ", dev)) ++ if (request_irq (priv->dsl_irq, tn7atm_dsl_irq, IRQF_DISABLED, "DSL ", dev)) + printk ("Could not register tn7atm_dsl_irq\n"); + + /***** VRB Tasklet Mode ****/ +@@ -842,7 +943,7 @@ static int __init tn7atm_get_ESI (struct + char esi_addr[ESI_LEN] = { 0x00, 0x00, 0x11, 0x22, 0x33, 0x44 }; + char *esiaddr_str = NULL; + +- esiaddr_str = prom_getenv ("maca"); ++ esiaddr_str = mp_macc ? mp_macc : prom_getenv ("maca"); + + if (!esiaddr_str) + { +@@ -875,11 +976,15 @@ static int __init tn7atm_get_ESI (struct + #define ATM_VBR_RT 5 + #endif + +-int tn7atm_open (struct atm_vcc *vcc, short vpi, int vci) ++int tn7atm_open (struct atm_vcc *vcc) + { + tn7atm_activate_vc_parm_t tn7atm_activate_vc_parm; + int rc; + //int flags; ++ tn7atm_activate_vc_parm.pcr = 0x20000; ++ tn7atm_activate_vc_parm.scr = 0x20000; ++ tn7atm_activate_vc_parm.mbs = 0x20000; ++ tn7atm_activate_vc_parm.cdvt = 10000; + + dgprintf(1, "tn7atm_open()\n"); + +@@ -891,24 +996,18 @@ int tn7atm_open (struct atm_vcc *vcc, sh + return -1; + } + +- MOD_INC_USE_COUNT; +- +- /* find a free VPI/VCI */ +- tn7atm_walk_vccs(vcc, &vpi, &vci); +- +- vcc->vpi = vpi; +- vcc->vci = vci; ++// MOD_INC_USE_COUNT; + +- if ((vci == ATM_VCI_UNSPEC) || (vpi == ATM_VCI_UNSPEC)) ++ if ((vcc->vci == ATM_VCI_UNSPEC) || (vcc->vpi == ATM_VCI_UNSPEC)) + { +- MOD_DEC_USE_COUNT; ++// MOD_DEC_USE_COUNT; + return -EBUSY; + } + +- tn7atm_activate_vc_parm.vpi = vpi; +- tn7atm_activate_vc_parm.vci = vci; ++ tn7atm_activate_vc_parm.vpi = vcc->vpi; ++ tn7atm_activate_vc_parm.vci = vcc->vci; + +- if ((vpi == CLEAR_EOC_VPI) && (vci == CLEAR_EOC_VCI)) ++ if ((vcc->vpi == CLEAR_EOC_VPI) && (vcc->vci == CLEAR_EOC_VCI)) + { + /* always use (max_dma_chan+1) for clear eoc */ + tn7atm_activate_vc_parm.chan = EOC_DMA_CHAN; +@@ -916,7 +1015,7 @@ int tn7atm_open (struct atm_vcc *vcc, sh + /* check to see whether clear eoc is opened or not */ + if (tn7atm_activate_vc_parm.priv->lut[tn7atm_activate_vc_parm.chan].inuse) + { +- MOD_DEC_USE_COUNT; ++// MOD_DEC_USE_COUNT; + printk("tn7atm_open: Clear EOC channel (dmachan=%d) already in use.\n", tn7atm_activate_vc_parm.chan); + return -EBUSY; + } +@@ -925,7 +1024,7 @@ int tn7atm_open (struct atm_vcc *vcc, sh + if (rc) + { + printk("tn7atm_open: failed to setup clear_eoc\n"); +- MOD_DEC_USE_COUNT; ++// MOD_DEC_USE_COUNT; + return -EBUSY; + } + tn7atm_set_lut(tn7atm_activate_vc_parm.priv,vcc, tn7atm_activate_vc_parm.chan); +@@ -934,17 +1033,17 @@ int tn7atm_open (struct atm_vcc *vcc, sh + } + else /* PVC channel setup */ + { +- if ((vpi==REMOTE_MGMT_VPI) && (vci==REMOTE_MGMT_VCI)) ++ if ((vcc->vpi==REMOTE_MGMT_VPI) && (vcc->vci==REMOTE_MGMT_VCI)) + { + tn7atm_activate_vc_parm.chan = 14; /* always use chan 14 for MII PVC-base romote mgmt */ + } + else + { +- rc = tn7atm_lut_find(vpi, vci); ++ rc = tn7atm_lut_find(vcc->vpi, vcc->vci); + /* check to see whether PVC is opened or not */ + if(ATM_NO_DMA_CHAN != rc) + { +- MOD_DEC_USE_COUNT; ++// MOD_DEC_USE_COUNT; + printk("PVC already opened. dmachan = %d\n", rc); + return -EBUSY; + } +@@ -976,6 +1075,7 @@ int tn7atm_open (struct atm_vcc *vcc, sh + tn7atm_activate_vc_parm.priority = 2; + break; + ++#if 0 + case ATM_VBR: /* Variable Bit Rate-Non RealTime*/ + tn7atm_activate_vc_parm.qos = 1; + tn7atm_activate_vc_parm.priority = 1; +@@ -997,6 +1097,7 @@ int tn7atm_open (struct atm_vcc *vcc, sh + tn7atm_activate_vc_parm.mbs = vcc->qos.txtp.max_pcr; + tn7atm_activate_vc_parm.cdvt = vcc->qos.txtp.max_cdv; + break; ++#endif + + default: + tn7atm_activate_vc_parm.qos = 2; +@@ -1024,7 +1125,7 @@ int tn7atm_open (struct atm_vcc *vcc, sh + if (rc < 0) + { + printk("failed to activate hw channel\n"); +- MOD_DEC_USE_COUNT; ++// MOD_DEC_USE_COUNT; + tn7atm_lut_clear(vcc, tn7atm_activate_vc_parm.chan); + //spin_unlock_irqrestore(&chan_init_lock, flags); + return -EBUSY; +@@ -1114,7 +1215,7 @@ void tn7atm_close (struct atm_vcc *vcc) + tn7atm_lut_clear (vcc, dmachan); + //spin_unlock_irqrestore (&closeLock, closeFlag); + +- MOD_DEC_USE_COUNT; ++// MOD_DEC_USE_COUNT; + + dgprintf (1, "Leave tn7atm_close\n"); + } +@@ -1528,8 +1629,7 @@ int tn7atm_receive (void *os_dev, int ch + * firewall is on */ + + dgprintf (3, "pushing the skb...\n"); +- +- skb->stamp = vcc->timestamp = xtime; ++ __net_timestamp(skb); + + xdump ((unsigned char *) skb->data, skb->len, 5); + +@@ -1725,8 +1825,7 @@ static void tn7atm_exit (void) + + kfree (dev->dev_data); + +- // atm_dev_deregister (dev); +- shutdown_atm_dev (dev); ++ atm_dev_deregister (dev); + + /* + * remove proc entries +@@ -1885,9 +1984,6 @@ static int __init tn7atm_detect (void) + /* + * Set up proc entry for atm stats + */ +- if (tn7atm_xlate_proc_name +- (drv_proc_root_folder, &root_proc_dir_entry, &residual)) +- { + printk ("Creating new root folder %s in the proc for the driver stats \n", + drv_proc_root_folder); + root_proc_dir_entry = proc_mkdir (drv_proc_root_folder, NULL); +@@ -1897,7 +1993,6 @@ static int __init tn7atm_detect (void) + return -ENOMEM; + } + proc_root_already_exists = FALSE; +- } + + /* + * AV: Clean-up. Moved all the definitions to the data structure. +@@ -1981,15 +2076,15 @@ static int tn7atm_autoDetectDspBoost (vo + //UR8_MERGE_END CQ10450* + + cp = prom_getenv ("dsp_noboost"); +- if (cp) ++ if (cp || mp_dsp_noboost != -1) + { +- dsp_noboost = os_atoi (cp); ++ dsp_noboost = mp_dsp_noboost == -1 ? os_atoi (cp) : mp_dsp_noboost; + } + + cp = (char *) prom_getenv ("dsp_freq"); +- if (cp) ++ if (cp || mp_dsp_freq != -1) + { +- dspfreq = os_atoi (cp); ++ dspfreq = mp_dsp_freq == -1 ? os_atoi (cp) : mp_dsp_freq; + if (dspfreq == 250) + { + boostDsp = 1; +@@ -2238,8 +2333,9 @@ static int __init tn7atm_init (struct at + // Inter-Op DSL phy Control + // Note the setting of _dsl_Feature_0 and _dsl_Feature_1 must before + // dslhal_api_dslStartup (in tn7dsl_init()). +- if ((ptr = prom_getenv ("DSL_FEATURE_CNTL_0")) != NULL) ++ if ((ptr = prom_getenv ("DSL_FEATURE_CNTL_0")) != NULL || mp_featctl0 != NULL) + { ++ if (mp_featctl0 != NULL) ptr = mp_featctl0; + if ((ptr[0] == '0') && (ptr[1] == 'x')) // skip 0x before pass to + // os_atoh + ptr += 2; +@@ -2247,8 +2343,9 @@ static int __init tn7atm_init (struct at + _dsl_Feature_0_defined = 1; + } + +- if ((ptr = prom_getenv ("DSL_FEATURE_CNTL_1")) != NULL) ++ if ((ptr = prom_getenv ("DSL_FEATURE_CNTL_1")) != NULL || mp_featctl1 != NULL) + { ++ if (mp_featctl1 != NULL) ptr = mp_featctl1; + if ((ptr[0] == '0') && (ptr[1] == 'x')) // skip 0x before pass to + // os_atoh + ptr += 2; +@@ -2260,8 +2357,9 @@ static int __init tn7atm_init (struct at + // DSL phy Feature Control + // Note the setting of _dsl_PhyControl_0 and _dsl_PhyControl_1 must before + // dslhal_api_dslStartup (in tn7dsl_init()). +- if ((ptr = prom_getenv ("DSL_PHY_CNTL_0")) != NULL) ++ if ((ptr = prom_getenv ("DSL_PHY_CNTL_0")) != NULL || mp_phyctl0 != NULL) + { ++ if (mp_phyctl0 != NULL) ptr = mp_phyctl0; + if ((ptr[0] == '0') && (ptr[1] == 'x')) // skip 0x before pass to + // os_atoh + ptr += 2; +@@ -2269,8 +2367,9 @@ static int __init tn7atm_init (struct at + _dsl_PhyControl_0_defined = 1; + } + +- if ((ptr = prom_getenv ("DSL_PHY_CNTL_1")) != NULL) ++ if ((ptr = prom_getenv ("DSL_PHY_CNTL_1")) != NULL || mp_phyctl1 != NULL) + { ++ if (mp_phyctl1 != NULL) ptr = mp_phyctl1; + if ((ptr[0] == '0') && (ptr[1] == 'x')) // skip 0x before pass to + // os_atoh + ptr += 2; +@@ -2298,9 +2397,9 @@ static int __init tn7atm_init (struct at + priv->bTurboDsl = 1; + // read config for turbo dsl + ptr = prom_getenv ("TurboDSL"); +- if (ptr) ++ if (ptr || mp_turbodsl != -1) + { +- priv->bTurboDsl = os_atoi (ptr); ++ priv->bTurboDsl = mp_turbodsl == -1 ? os_atoi (ptr) : mp_turbodsl; + } + + // @Added to make Rx buffer number & Service max configurable through +@@ -2308,30 +2407,30 @@ static int __init tn7atm_init (struct at + priv->sarRxBuf = RX_BUFFER_NUM; + ptr = NULL; + ptr = prom_getenv ("SarRxBuf"); +- if (ptr) ++ if (ptr || mp_sar_rxbuf != -1) + { +- priv->sarRxBuf = os_atoi (ptr); ++ priv->sarRxBuf = mp_sar_rxbuf == -1 ? os_atoi (ptr) : mp_sar_rxbuf; + } + priv->sarRxMax = RX_SERVICE_MAX; + ptr = NULL; + ptr = prom_getenv ("SarRxMax"); +- if (ptr) ++ if (ptr || mp_sar_rxmax != -1) + { +- priv->sarRxMax = os_atoi (ptr); ++ priv->sarRxMax = mp_sar_rxmax == -1 ? os_atoi (ptr) : mp_sar_rxmax; + } + priv->sarTxBuf = TX_BUFFER_NUM; + ptr = NULL; + ptr = prom_getenv ("SarTxBuf"); +- if (ptr) ++ if (ptr || mp_sar_txbuf != -1) + { +- priv->sarTxBuf = os_atoi (ptr); ++ priv->sarTxBuf = mp_sar_txbuf == -1 ? os_atoi (ptr) : mp_sar_txbuf; + } + priv->sarTxMax = TX_SERVICE_MAX; + ptr = NULL; + ptr = prom_getenv ("SarTxMax"); +- if (ptr) ++ if (ptr || mp_sar_txmax != -1) + { +- priv->sarTxMax = os_atoi (ptr); ++ priv->sarTxMax = mp_sar_txmax == -1 ? os_atoi (ptr) : mp_sar_txmax; + } + + return 0; +@@ -2479,7 +2578,5 @@ static int tn7atm_proc_qos_write(struct + return count; + } + +-#ifdef MODULE + module_init (tn7atm_detect); + module_exit (tn7atm_exit); +-#endif /* MODULE */ diff --git a/package/sangam-atm/patches/patch-tn7atm_h b/package/sangam-atm/patches/patch-tn7atm_h new file mode 100644 index 000000000..e26e0441a --- /dev/null +++ b/package/sangam-atm/patches/patch-tn7atm_h @@ -0,0 +1,50 @@ +--- sangam-atm-1.0.orig/tn7atm.h 2006-04-05 07:33:06.000000000 +0200 ++++ sangam-atm-1.0/tn7atm.h 2009-12-17 19:15:08.310494800 +0100 +@@ -19,7 +19,8 @@ + //#include "mips_support.h" + #include + +-#include ++#define MIPS_EXCEPTION_OFFSET 8 ++#define LNXINTNUM(x)((x) + MIPS_EXCEPTION_OFFSET) + + #ifdef CONFIG_MODVERSIONS + #include +@@ -61,37 +62,6 @@ extern int avalanche_request_pacing(int + #include + #endif /* CONFIG_HAS_RELEASE_H_FILE */ + +-/* Base PSP 7.4 support */ +-#if ((PSP_VERSION_MAJOR == 7) && (PSP_VERSION_MINOR == 4)) +-#define TIATM_INST_SUPP /* Enable Instrumentation code. */ +-#define __NO__VOICE_PATCH__ /* Not required anymore. */ +- +-#if defined (CONFIG_MIPS_AVALANCHE_COLORED_LED) +-#include +- +-/* LED handles */ +-extern void *hnd_LED_0; +- +-#define MOD_ADSL 1 +-#define DEF_ADSL_IDLE 1 +-#define DEF_ADSL_TRAINING 2 +-#define DEF_ADSL_SYNC 3 +-#define DEF_ADSL_ACTIVITY 4 +- +-#define LED_NUM_1 0 +-#define LED_NUM_2 1 +- +-#endif /*defined (CONFIG_MIPS_AVALANCHE_COLORED_LED)*/ +- +-/* So as to not cause any confusion. */ +-#ifdef BASE_PSP_7X +-#undef BASE_PSP_7X +-#endif /*BASE_PSP_7X*/ +- +-#define TN7DSL_LED_ACTION(module_handle, module_name, state_id) led_manager_led_action(module_handle, state_id) +- +-#endif /*((PSP_VERSION_MAJOR == 7) && (PSP_VERSION_MINOR == 4)) */ +- + #ifdef CONFIG_LED_MODULE + #ifndef BASE_PSP_7X + #include diff --git a/package/sangam-atm/patches/patch-tn7dsl_c b/package/sangam-atm/patches/patch-tn7dsl_c new file mode 100644 index 000000000..8a06dcfe1 --- /dev/null +++ b/package/sangam-atm/patches/patch-tn7dsl_c @@ -0,0 +1,602 @@ +--- sangam-atm-1.0.orig/tn7dsl.c 2007-01-04 09:04:14.000000000 +0100 ++++ sangam-atm-1.0/tn7dsl.c 2009-12-17 19:22:19.372420289 +0100 +@@ -94,7 +94,6 @@ + * 1/02/07 JZ CQ11054: Data Precision and Range Changes for TR-069 Conformance + * UR8_MERGE_END CQ11054* + *********************************************************************************************/ +-#include + #include + #include + #include +@@ -102,8 +101,6 @@ + #include + #include + #include +-#include +-#include + #include + #include + #include +@@ -111,6 +108,18 @@ + #include + #include + #include ++#include ++#include ++ ++#include ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31) ++#include ++#include ++#else ++#include ++#include ++#endif ++ + /* Modules specific header files */ + #include "tn7atm.h" + #include "tn7api.h" +@@ -133,6 +142,27 @@ + #define NEW_TRAINING_VAL_T1413 128 + #define NEW_TRAINING_VAL_MMODE 255 + ++extern char *mp_modulation; ++extern int mp_fine_gain_control; ++extern int mp_fine_gain_value; ++extern int mp_enable_margin_retrain; ++extern int mp_margin_threshold; ++extern int mp_enable_rate_adapt; ++extern int mp_powercutback; ++extern int mp_trellis; ++extern int mp_bitswap; ++extern int mp_maximum_bits_per_carrier; ++extern int mp_maximum_interleave_depth; ++extern int mp_pair_selection; ++extern int mp_dgas_polarity; ++extern int mp_los_alarm; ++extern char *mp_eoc_vendor_id; ++extern int mp_eoc_vendor_revision; ++extern char *mp_eoc_vendor_serialnum; ++extern char *mp_invntry_vernum; ++extern int mp_dsl_bit_tmode; ++extern int mp_high_precision; ++ + int testflag1 = 0; + extern int __guDbgLevel; + extern sar_stat_t sarStat; +@@ -173,7 +203,7 @@ led_reg_t ledreg[2]; + static struct led_funcs ledreg[2]; + #endif + +-#define DEV_DSLMOD 1 ++#define DEV_DSLMOD CTL_UNNUMBERED + #define MAX_STR_SIZE 256 + #define DSL_MOD_SIZE 256 + +@@ -299,7 +329,7 @@ static PITIDSLHW_T pIhw; + static volatile int bshutdown; + static char info[MAX_STR_SIZE]; + /* Used for DSL Polling enable */ +-static DECLARE_MUTEX_LOCKED (adsl_sem_overlay); ++static struct semaphore adsl_sem_overlay; + + //kthread_t overlay_thread; + /* end of module wide declars */ +@@ -323,6 +353,14 @@ static int tn7dsl_proc_snr_print (char * + #define gDot1(a) ((a>0)?(a%10):((-a)%10)) + // UR8_MERGE_END CQ11054* + ++int avalanche_request_intr_pacing(int irq_nr, unsigned int blk_num, ++ unsigned int pace_value) ++{ ++ printk("avalanche_request_pacing(%d, %u, %u); // not implemented\n", irq_nr, blk_num, pace_value); ++ return 0; ++} ++ ++ + int os_atoi(const char *pStr) + { + int MulNeg = (*pStr == '-' ? -1 : 1); +@@ -359,39 +397,6 @@ void dprintf (int uDbgLevel, char *szFmt + #endif + } + +-int strcmp(const char *s1, const char *s2) +-{ +- +- int size = strlen(s1); +- +- return(strncmp(s1, s2, size)); +-} +- +-int strncmp(const char *s1, const char *s2, size_t size) +-{ +- int i = 0; +- int max_size = (int)size; +- +- while((s1[i] != 0) && i < max_size) +- { +- if(s2[i] == 0) +- { +- return -1; +- } +- if(s1[i] != s2[i]) +- { +- return 1; +- } +- i++; +- } +- if(s2[i] != 0) +- { +- return 1; +- } +- +- return 0; +-} +- + // * UR8_MERGE_START CQ10640 Jack Zhang + int tn7dsl_dump_dsp_memory(char *input_str) //cph99 + { +@@ -441,101 +446,79 @@ unsigned int shim_osGetCpuFrequency(void + return CpuFrequency; + } + +-int shim_osLoadFWImage(unsigned char *ptr) ++static void avsar_release(struct device *dev) + { +- unsigned int bytesRead; +- mm_segment_t oldfs; +- static struct file *filp; +- unsigned int imageLength=0x5ffff; +- +- +- dgprintf(4, "tn7dsl_read_dsp()\n"); +- +- dgprintf(4,"open file %s\n", DSP_FIRMWARE_PATH); +- +- filp=filp_open(DSP_FIRMWARE_PATH,00,O_RDONLY); +- if(filp ==NULL) +- { +- printk("Failed: Could not open DSP binary file\n"); +- return -1; +- } +- +- if (filp->f_dentry != NULL) +- { +- if (filp->f_dentry->d_inode != NULL) +- { +- printk ("DSP binary filesize = %d bytes\n", +- (int) filp->f_dentry->d_inode->i_size); +- imageLength = (unsigned int)filp->f_dentry->d_inode->i_size + 0x200; +- } +- } +- +- if (filp->f_op->read==NULL) +- return -1; /* File(system) doesn't allow reads */ +- +- /* +- * Disable parameter checking +- */ +- oldfs = get_fs(); +- set_fs(KERNEL_DS); +- +- /* +- * Now read bytes from postion "StartPos" +- */ +- filp->f_pos = 0; +- +- bytesRead = filp->f_op->read(filp,ptr,imageLength,&filp->f_pos); +- +- dgprintf(4,"file length = %d\n", bytesRead); +- +- set_fs(oldfs); +- +- /* +- * Close the file +- */ +- fput(filp); +- +- return bytesRead; ++ printk(KERN_DEBUG "avsar firmware released\n"); + } + ++static struct device avsar = { ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30) ++ .bus_id = "vlynq", ++#endif ++ .release = avsar_release, ++}; + +-unsigned int shim_read_overlay_page (void *ptr, unsigned int secOffset, +- unsigned int secLength) ++int shim_osLoadFWImage(unsigned char *ptr) + { +- unsigned int bytesRead; +- mm_segment_t oldfs; +- struct file *filp; +- +- dgprintf(4,"shim_read_overlay_page\n"); +- //dgprintf(4,"sec offset=%d, sec length =%d\n", secOffset, secLength); ++ const struct firmware *fw_entry; ++ size_t size; + +- filp=filp_open(DSP_FIRMWARE_PATH,00,O_RDONLY); +- if(filp ==NULL) +- { +- printk("Failed: Could not open DSP binary file\n"); +- return -1; +- } ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,30) ++ dev_set_name(&avsar, "avsar"); ++#endif ++ printk("requesting firmware image \"ar0700xx.bin\"\n"); ++ if(device_register(&avsar) < 0) { ++ printk(KERN_ERR ++ "avsar: device_register fails\n"); ++ return -1; ++ } + +- if (filp->f_op->read==NULL) +- return -1; /* File(system) doesn't allow reads */ ++ if(request_firmware(&fw_entry, "ar0700xx.bin", &avsar)) { ++ printk(KERN_ERR ++ "avsar: Firmware not available\n"); ++ device_unregister(&avsar); ++ return -1; ++ } ++ size = fw_entry->size; ++ device_unregister(&avsar); ++ if(size > 0x5ffff) { ++ printk(KERN_ERR ++ "avsar: Firmware too big (%d bytes)\n", size); ++ release_firmware(fw_entry); ++ return -1; ++ } ++ memcpy(ptr, fw_entry->data, size); ++ release_firmware(fw_entry); ++ return size; ++} + +- /* +- * Now read bytes from postion "StartPos" +- */ ++unsigned int shim_read_overlay_page(void *ptr, unsigned int secOffset, unsigned int secLength) ++{ ++ const struct firmware *fw_entry; + +- if(filp->f_op->llseek) +- filp->f_op->llseek(filp,secOffset, 0); +- oldfs = get_fs(); +- set_fs(KERNEL_DS); +- filp->f_pos = secOffset; +- bytesRead = filp->f_op->read(filp,ptr,secLength,&filp->f_pos); ++ printk("requesting firmware image \"ar0700xx.bin\"\n"); ++ if(device_register(&avsar) < 0) { ++ printk(KERN_ERR ++ "avsar: device_register fails\n"); ++ return -1; ++ } + +- set_fs(oldfs); +- /* +- * Close the file +- */ +- fput(filp); +- return bytesRead; ++ if(request_firmware(&fw_entry, "ar0700xx.bin", &avsar)) { ++ printk(KERN_ERR ++ "avsar: Firmware not available\n"); ++ device_unregister(&avsar); ++ return -1; ++ } ++ device_unregister(&avsar); ++ if(fw_entry->size > secLength) { ++ printk(KERN_ERR ++ "avsar: Firmware too big (%d bytes)\n", fw_entry->size); ++ release_firmware(fw_entry); ++ return -1; ++ } ++ memcpy(ptr + secOffset, fw_entry->data, secLength); ++ release_firmware(fw_entry); ++ return secLength; + } + + int shim_osLoadDebugFWImage(unsigned char *ptr) +@@ -2845,98 +2828,82 @@ static int tn7dsl_set_dsl(void) + (unsigned int *) &offset, + (unsigned char *) &oamFeature, 4); + +- /* Do only if we are in the new Base PSP 7.4.*/ +- #if ((PSP_VERSION_MAJOR == 7) && (PSP_VERSION_MINOR == 4)) +- /* Check to see if we are operating in the new bit mode. */ +- ptr = prom_getenv("DSL_BIT_TMODE"); +- if (ptr) +- { +- /* If we are see if this is the first time the user has upgraded. */ +- ptr = prom_getenv("DSL_UPG_DONE"); +- if(!ptr) +- { +- /* If it is the first time the user is upgrading, then make sure that +- we clear the modulation environment variable, as this could potentially +- not have the same meaning in the new mode. +- */ +- prom_unsetenv("modulation"); +- prom_setenv("DSL_UPG_DONE", "1"); +- } +- } +- #endif +- + // modulation + ptr = prom_getenv("modulation"); +- if (ptr) ++ if (ptr || mp_modulation != NULL) + { +- tn7dsl_set_modulation(ptr, FALSE); ++ tn7dsl_set_modulation(mp_modulation == NULL ? ptr : mp_modulation, FALSE); + } + + // Fine Gains + ptr = prom_getenv("fine_gain_control"); +- if (ptr) ++ if (ptr || mp_fine_gain_control != -1) + { +- value = os_atoi(ptr); ++ value = mp_fine_gain_control == -1 ? os_atoi(ptr) : mp_fine_gain_control; + tn7dsl_ctrl_fineGain(value); + } + ptr = NULL; + ptr = prom_getenv("fine_gain_value"); +- if(ptr) +- tn7dsl_set_fineGainValue(os_atoh(ptr)); ++ if(ptr || mp_fine_gain_value != -1) ++ tn7dsl_set_fineGainValue(mp_fine_gain_value == -1 ? os_atoh(ptr) : mp_fine_gain_value); + + // margin retrain + ptr = NULL; + ptr = prom_getenv("enable_margin_retrain"); +- if(ptr) ++ value = mp_enable_margin_retrain == -1 ? (ptr ? os_atoi(ptr) : 0) : mp_enable_margin_retrain; ++ ++ if (value == 1) + { +- value = os_atoi(ptr); +- if(value == 1) ++ dslhal_api_setMarginMonitorFlags(pIhw, 0, 1); ++ bMarginRetrainEnable = 1; ++ //printk("enable showtime margin monitor.\n"); ++ ++ ptr = NULL; ++ ptr = prom_getenv("margin_threshold"); ++ value = mp_margin_threshold == -1 ? (ptr ? os_atoi(ptr) : 0) : mp_margin_threshold; ++ ++ if(value >= 0) + { +- dslhal_api_setMarginMonitorFlags(pIhw, 0, 1); +- bMarginRetrainEnable = 1; +- //printk("enable showtime margin monitor.\n"); +- ptr = NULL; +- ptr = prom_getenv("margin_threshold"); +- if(ptr) +- { +- value = os_atoi(ptr); +- //printk("Set margin threshold to %d x 0.5 db\n",value); +- if(value >= 0) +- { +- dslhal_api_setMarginThreshold(pIhw, value); +- bMarginThConfig=1; +- } +- } ++ dslhal_api_setMarginThreshold(pIhw, value); ++ bMarginThConfig=1; + } + } + + // rate adapt + ptr = NULL; + ptr = prom_getenv("enable_rate_adapt"); +- if(ptr) ++ if(ptr || mp_enable_rate_adapt != -1) + { +- dslhal_api_setRateAdaptFlag(pIhw, os_atoi(ptr)); ++ dslhal_api_setRateAdaptFlag(pIhw, mp_enable_rate_adapt == -1 ? os_atoi(ptr) : mp_enable_rate_adapt); ++ } ++ ++ // set powercutback ++ ptr = NULL; ++ ptr = prom_getenv("powercutback"); ++ if(ptr || mp_powercutback != -1) ++ { ++ dslhal_advcfg_onOffPcb(pIhw, mp_powercutback == -1 ? os_atoi(ptr) : mp_powercutback); + } + + // trellis + ptr = NULL; + ptr = prom_getenv("trellis"); +- if(ptr) ++ if(ptr || mp_trellis != -1) + { +- dslhal_api_setTrellisFlag(pIhw, os_atoi(ptr)); +- trellis = os_atoi(ptr); ++ trellis = mp_trellis == -1 ? os_atoi(ptr) : mp_trellis; ++ dslhal_api_setTrellisFlag(pIhw, trellis); + //printk("trellis=%d\n"); + } + + // bitswap + ptr = NULL; + ptr = prom_getenv("bitswap"); +- if(ptr) ++ if(ptr || mp_bitswap != -1) + { + int offset[2] = {33, 0}; + unsigned int bitswap; + +- bitswap = os_atoi(ptr); ++ bitswap = mp_bitswap == -1 ? os_atoi(ptr) : mp_bitswap; + + tn7dsl_generic_read(2, offset); + dslReg &= dslhal_support_byteSwap32(0xFFFFFF00); +@@ -2954,46 +2921,47 @@ static int tn7dsl_set_dsl(void) + // maximum bits per carrier + ptr = NULL; + ptr = prom_getenv("maximum_bits_per_carrier"); +- if(ptr) ++ if(ptr || mp_maximum_bits_per_carrier != -1) + { +- dslhal_api_setMaxBitsPerCarrierUpstream(pIhw, os_atoi(ptr)); ++ dslhal_api_setMaxBitsPerCarrierUpstream(pIhw, mp_maximum_bits_per_carrier == -1 ? os_atoi(ptr) : mp_maximum_bits_per_carrier); + } + + // maximum interleave depth + ptr = NULL; + ptr = prom_getenv("maximum_interleave_depth"); +- if(ptr) ++ if(ptr || mp_maximum_interleave_depth != -1) + { +- dslhal_api_setMaxInterleaverDepth(pIhw, os_atoi(ptr)); ++ dslhal_api_setMaxInterleaverDepth(pIhw, mp_maximum_interleave_depth == -1 ? os_atoi(ptr) : mp_maximum_interleave_depth); + } + + // inner and outer pairs + ptr = NULL; + ptr = prom_getenv("pair_selection"); +- if(ptr) ++ if(ptr || mp_pair_selection != -1) + { +- dslhal_api_selectInnerOuterPair(pIhw, os_atoi(ptr)); ++ dslhal_api_selectInnerOuterPair(pIhw, mp_pair_selection == -1 ? os_atoi(ptr) : mp_pair_selection); + } + + ptr = NULL; + ptr = prom_getenv("dgas_polarity"); +- if(ptr) ++ if(ptr || mp_dgas_polarity != -1) + { + dslhal_api_configureDgaspLpr(pIhw, 1, 1); +- dslhal_api_configureDgaspLpr(pIhw, 0, os_atoi(ptr)); ++ dslhal_api_configureDgaspLpr(pIhw, 0, mp_dgas_polarity == -1 ? os_atoi(ptr) : mp_dgas_polarity); + } + + ptr = NULL; + ptr = prom_getenv("los_alarm"); +- if(ptr) ++ if(ptr || mp_los_alarm != -1) + { +- dslhal_api_disableLosAlarm(pIhw, os_atoi(ptr)); ++ dslhal_api_disableLosAlarm(pIhw, mp_los_alarm == -1 ? os_atoi(ptr) : mp_los_alarm); + } + + ptr = NULL; + ptr = prom_getenv("eoc_vendor_id"); +- if(ptr) ++ if(ptr || mp_eoc_vendor_id != NULL) + { ++ ptr = mp_eoc_vendor_id == NULL ? ptr : mp_eoc_vendor_id; + for(i=0;i<8;i++) + { + tmp[0]=ptr[i*2]; +@@ -3018,26 +2986,26 @@ static int tn7dsl_set_dsl(void) + } + ptr = NULL; + ptr = prom_getenv("eoc_vendor_revision"); +- if(ptr) ++ if(ptr || mp_eoc_vendor_revision != -1) + { +- value = os_atoi(ptr); ++ value = mp_eoc_vendor_revision == -1 ? os_atoi(ptr) : mp_eoc_vendor_revision; + //printk("eoc rev=%d\n", os_atoi(ptr)); + dslhal_api_setEocRevisionNumber(pIhw, (char *)&value); + + } + ptr = NULL; + ptr = prom_getenv("eoc_vendor_serialnum"); +- if(ptr) ++ if(ptr || mp_eoc_vendor_serialnum != NULL) + { +- dslhal_api_setEocSerialNumber(pIhw, ptr); ++ dslhal_api_setEocSerialNumber(pIhw, mp_eoc_vendor_serialnum == NULL ? ptr : mp_eoc_vendor_serialnum); + } + + // CQ10037 Added invntry_vernum environment variable to be able to set version number in ADSL2, ADSL2+ modes. + ptr = NULL; + ptr = prom_getenv("invntry_vernum"); +- if(ptr) ++ if(ptr || mp_invntry_vernum != NULL) + { +- dslhal_api_setEocRevisionNumber(pIhw, ptr); ++ dslhal_api_setEocRevisionNumber(pIhw, mp_invntry_vernum == NULL ? ptr : mp_invntry_vernum); + } + + return 0; +@@ -3064,6 +3032,7 @@ int tn7dsl_init(void *priv) + int high_precision_selected = 0; + // UR8_MERGE_END CQ11054* + ++ sema_init(&adsl_sem_overlay, 0); + /* + * start dsl + */ +@@ -3081,7 +3050,7 @@ int tn7dsl_init(void *priv) + * backward compatibility. + */ + cp = prom_getenv("DSL_BIT_TMODE"); +- if (cp) ++ if (cp || mp_dsl_bit_tmode != -1) + { + printk("%s : env var DSL_BIT_TMODE is set\n", __FUNCTION__); + /* +@@ -3110,9 +3079,9 @@ int tn7dsl_init(void *priv) + + // UR8_MERGE_START CQ11054 Jack Zhang + cp = prom_getenv("high_precision"); +- if (cp) ++ if (cp || mp_high_precision != -1) + { +- high_precision_selected = os_atoi(cp); ++ high_precision_selected = mp_high_precision == -1 ? os_atoi(cp) : mp_high_precision; + } + if ( high_precision_selected) + { +@@ -3442,7 +3411,7 @@ static int dslmod_sysctl(ctl_table *ctl, + */ + if(write) + { +- ret = proc_dostring(ctl, write, filp, buffer, lenp); ++ ret = proc_dostring(ctl, write, buffer, lenp, filp); + + switch (ctl->ctl_name) + { +@@ -3528,14 +3497,14 @@ static int dslmod_sysctl(ctl_table *ctl, + else + { + len += sprintf(info+len, mod_req); +- ret = proc_dostring(ctl, write, filp, buffer, lenp); ++ ret = proc_dostring(ctl, write, buffer, lenp, filp); + } + return ret; + } + + + ctl_table dslmod_table[] = { +- {DEV_DSLMOD, "dslmod", info, DSL_MOD_SIZE, 0644, NULL, &dslmod_sysctl} ++ {DEV_DSLMOD, "dslmod", info, DSL_MOD_SIZE, 0644, NULL, NULL, &dslmod_sysctl, &sysctl_string} + , + {0} + }; +@@ -3558,8 +3527,7 @@ void tn7dsl_dslmod_sysctl_register(void) + if (initialized == 1) + return; + +- dslmod_sysctl_header = register_sysctl_table(dslmod_root_table, 1); +- dslmod_root_table->child->de->owner = THIS_MODULE; ++ dslmod_sysctl_header = register_sysctl_table(dslmod_root_table); + + /* + * set the defaults +@@ -4821,4 +4789,4 @@ int tn7dsl_proc_PMDus(char* buf, char ** + } + #endif //NO_ADV_STATS + #endif //TR69_PMD_IN +-// * UR8_MERGE_END CQ11057 * +\ No newline at end of file ++// * UR8_MERGE_END CQ11057 * diff --git a/package/sangam-atm/patches/patch-tn7sar_c b/package/sangam-atm/patches/patch-tn7sar_c new file mode 100644 index 000000000..4f9f587e3 --- /dev/null +++ b/package/sangam-atm/patches/patch-tn7sar_c @@ -0,0 +1,79 @@ +--- sangam-atm-1.0.orig/tn7sar.c 2007-05-18 09:46:30.000000000 +0200 ++++ sangam-atm-1.0/tn7sar.c 2009-12-17 19:10:27.628421613 +0100 +@@ -42,7 +42,6 @@ + * UR8_MERGE_END CQ10700 + *******************************************************************************/ + +-#include + #include + #include + #include +@@ -50,12 +49,19 @@ + #include + #include + #include +-#include +-#include + #include + #include + #include ++#include + ++#include ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31) ++#include ++#include ++#else ++#include ++#include ++#endif + + #define _CPHAL_AAL5 + #define _CPHAL_SAR +@@ -74,6 +80,8 @@ typedef void OS_SETUP; + /* PDSP Firmware files */ + #include "tnetd7300_sar_firm.h" + ++extern int mp_oam_lb_timeout; ++extern int mp_autopvc_enable; + + enum + { +@@ -103,10 +111,10 @@ enum + + #define RESERVED_OAM_CHANNEL 15 + +-#define AAL5_PARM "id=aal5, base = 0x03000000, offset = 0, int_line=15, ch0=[RxBufSize=1522; RxNumBuffers = 32; RxServiceMax = 50; TxServiceMax=50; TxNumBuffers=32; CpcsUU=0x5aa5; TxVc_CellRate=0x3000; TxVc_AtmHeader=0x00000640]" +-#define SAR_PARM "id=sar,base = 0x03000000, reset_bit = 9, offset = 0; UniNni = 0, PdspEnable = 1" ++#define CH0_PARM "RxBufSize=1522, RxNumBuffers=32, RxServiceMax=50, TxServiceMax=50, TxNumBuffers=32, CpcsUU=0x5aa5, TxVc_CellRate=0x3000, TxVc_AtmHeader=0x00000640" ++#define AAL5_PARM "id=aal5, base=0x03000000, offset=0, int_line=15, ch0=[" CH0_PARM "]" ++#define SAR_PARM "id=sar, base=0x03000000, reset_bit=9, offset=0; UniNni=0, PdspEnable=1, Debug=0xFFFFFFFF" + #define RESET_PARM "id=ResetControl, base=0xA8611600" +-#define CH0_PARM "RxBufSize=1522, RxNumBuffers = 32, RxServiceMax = 50, TxServiceMax=50, TxNumBuffers=32, CpcsUU=0x5aa5, TxVc_CellRate=0x3000, TxVc_AtmHeader=0x00000640" + + #define MAX_PVC_TABLE_ENTRY 16 + +@@ -817,9 +825,9 @@ int tn7sar_setup_oam_channel(Tn7AtmPriva + pHalDev = (HAL_DEVICE *)priv->pSarHalDev; + + pauto_pvc = prom_getenv("autopvc_enable"); +- if(pauto_pvc) //CQ10273 ++ if(pauto_pvc || mp_autopvc_enable != -1) //CQ10273 + { +- auto_pvc =tn7sar_strtoul(pauto_pvc, NULL, 10); ++ auto_pvc = mp_autopvc_enable == -1 ? tn7sar_strtoul(pauto_pvc, NULL, 10) : mp_autopvc_enable; + } + + memset(&chInfo, 0xff, sizeof(chInfo)); +@@ -985,9 +993,9 @@ int tn7sar_init(struct atm_dev *dev, Tn7 + + /* read in oam lb timeout value */ + pLbTimeout = prom_getenv("oam_lb_timeout"); +- if(pLbTimeout) ++ if(pLbTimeout || mp_oam_lb_timeout != -1) + { +- lbTimeout =tn7sar_strtoul(pLbTimeout, NULL, 10); ++ lbTimeout = mp_oam_lb_timeout == -1 ? tn7sar_strtoul(pLbTimeout, NULL, 10) : mp_oam_lb_timeout; + oamLbTimeout = lbTimeout; + pHalFunc->Control(pHalDev,"OamLbTimeout", "Set", &lbTimeout); + } diff --git a/target/ag241/kernel.config b/target/ag241/kernel.config index a62a800ed..e7a5bbfbc 100644 --- a/target/ag241/kernel.config +++ b/target/ag241/kernel.config @@ -780,7 +780,7 @@ CONFIG_TRACE_IRQFLAGS_SUPPORT=y CONFIG_PRINTK_TIME=y # CONFIG_ENABLE_WARN_DEPRECATED is not set # CONFIG_ENABLE_MUST_CHECK is not set -CONFIG_FRAME_WARN=1024 +CONFIG_FRAME_WARN=2048 CONFIG_MAGIC_SYSRQ=y # CONFIG_STRIP_ASM_SYMS is not set # CONFIG_UNUSED_SYMBOLS is not set diff --git a/target/linux/config/Config.in.netdevice b/target/linux/config/Config.in.netdevice index cef62da0b..f743b8271 100644 --- a/target/linux/config/Config.in.netdevice +++ b/target/linux/config/Config.in.netdevice @@ -245,4 +245,11 @@ config ADK_KERNEL_RT2X00_DEBUG help endmenu + +menu "ATM driver support" + +source package/sangam-atm/Config.in + +endmenu + endmenu -- cgit v1.2.3 From cac2cd65b190f7eb2b678886052621405d30e9de Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Thu, 17 Dec 2009 21:29:33 +0100 Subject: check image size --- target/ag241/Makefile | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'target/ag241') diff --git a/target/ag241/Makefile b/target/ag241/Makefile index abfaf7bef..e1c5b47a5 100644 --- a/target/ag241/Makefile +++ b/target/ag241/Makefile @@ -31,14 +31,17 @@ kernel-install: tools-compile ifeq ($(FS),squashfs) imageinstall: $(BIN_DIR)/$(ROOTFSSQUASHFS) - ${CP} ${BUILD_DIR}/${ROOTFSSQUASHFS} $(BIN_DIR)/$(ROOTFSSQUASHFS) - @echo - @echo The image file is $(ROOTFSSQUASHFS) - @echo 'You can flash the image via tftp:' - @echo 'tftp 192.168.1.1' - @echo 'tftp> binary' - @echo "tftp> put $(ROOTFSSQUASHFS) upgrade_code.bin" - @echo 'Login as user root with password linux123 via ssh or console' + @if [ $$(stat --format=%s ${BUILD_DIR}/${ROOTFSSQUASHFS}) -gt 4063233 ];then \ + echo 'Image is too big!'; \ + else \ + ${CP} ${BUILD_DIR}/${ROOTFSSQUASHFS} $(BIN_DIR)/$(ROOTFSSQUASHFS); \ + echo The image file is $(ROOTFSSQUASHFS); \ + echo 'You can flash the image via tftp:'; \ + echo 'tftp 192.168.1.1'; \ + echo 'tftp> binary'; \ + echo "tftp> put $(ROOTFSSQUASHFS) upgrade_code.bin"; \ + echo 'Login as user root with password linux123 via ssh or console'; \ + fi endif ifeq ($(FS),nfsroot) -- cgit v1.2.3 From ecccdfb45e27df5d9ee6deba57fb4fa28131a59d Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Fri, 18 Dec 2009 08:44:40 +0100 Subject: enable pppoa and fix dsl driver - fix dsl driver crash, sync is now successful - add ppp ppp over atm --- mk/image.mk | 4 +- package/ppp/Config.in | 12 +++--- package/ppp/Makefile | 6 +++ package/sangam-atm/patches/patch-tn7atm_h | 8 +++- package/sangam-atm/patches/patch-tn7dsl_c | 69 ++++++++++++++++++++++++------- target/ag241/Makefile | 4 +- target/linux/config/Config.in.network | 16 +++---- 7 files changed, 84 insertions(+), 35 deletions(-) (limited to 'target/ag241') diff --git a/mk/image.mk b/mk/image.mk index 1b92da0df..a41e41482 100644 --- a/mk/image.mk +++ b/mk/image.mk @@ -70,8 +70,8 @@ ${BIN_DIR}/${ROOTFSSQUASHFS}: ${TARGET_DIR} -nopad -noappend -root-owned $(MAKE_TRACE) cat ${BIN_DIR}/${ADK_TARGET}-${ARCH}-kernel ${BUILD_DIR}/root.squashfs > \ ${BUILD_DIR}/${ROOTFSSQUASHFS} - # padding of images is required - dd if=${BUILD_DIR}/${ROOTFSSQUASHFS} of=${BIN_DIR}/${ROOTFSSQUASHFS} \ + # padding of images is required, foxboard only? + #dd if=${BUILD_DIR}/${ROOTFSSQUASHFS} of=${BIN_DIR}/${ROOTFSSQUASHFS} \ bs=4063232 conv=sync $(MAKE_TRACE) imageclean: diff --git a/package/ppp/Config.in b/package/ppp/Config.in index 0969ae40a..68b5c4d66 100644 --- a/package/ppp/Config.in +++ b/package/ppp/Config.in @@ -5,12 +5,12 @@ config ADK_PACKAGE_PPP default n select ADK_KPACKAGE_KMOD_PPP -#config ADK_PACKAGE_PPP_MOD_PPPOA -# prompt "ppp-mod-pppoa................... PPPoA (PPP over ATM) plugin" -# tristate -# default n -# select ADK_KPACKAGE_KMOD_PPPOATM -# depends on ADK_PACKAGE_PPP +config ADK_PACKAGE_PPP_MOD_PPPOA + prompt "ppp-mod-pppoa................... PPPoA (PPP over ATM) plugin" + tristate + default n + select ADK_KPACKAGE_KMOD_PPPOATM + depends on ADK_PACKAGE_PPP config ADK_PACKAGE_PPP_MOD_PPPOE prompt "ppp-mod-pppoe................... PPPoE (PPP over Ethernet) plugin" diff --git a/package/ppp/Makefile b/package/ppp/Makefile index 295c19b0e..350095cb6 100644 --- a/package/ppp/Makefile +++ b/package/ppp/Makefile @@ -39,6 +39,7 @@ XAKE_FLAGS+= CC="${TARGET_CC}" \ SUB_INSTALLS-y:= SUB_INSTALLS-m:= SUB_INSTALLS-${ADK_PACKAGE_PPP_MOD_PPPOE}+= mod-pppoe-install +SUB_INSTALLS-${ADK_PACKAGE_PPP_MOD_PPPOA}+= mod-pppoa-install SUB_INSTALLS-${ADK_PACKAGE_PPP_MOD_RADIUS}+= mod-radius-install SUB_INSTALLS-${ADK_PACKAGE_PPP_MOD_CHAT}+= mod-chat-install SUB_INSTALLS-${ADK_PACKAGE_PPP_MOD_PPPDUMP}+= mod-pppdump-install @@ -81,6 +82,11 @@ mod-pppoe-install: ${INSTALL_BIN} $(WRKINST)/usr/lib/pppd/$(PKG_VERSION)/rp-pppoe.so \ ${IDIR_PPP_MOD_PPPOE}/usr/lib/pppd/$(PKG_VERSION) +mod-pppoa-install: + ${INSTALL_DIR} ${IDIR_PPP_MOD_PPPOA}/usr/lib/pppd/$(PKG_VERSION) + ${INSTALL_BIN} $(WRKINST)/usr/lib/pppd/$(PKG_VERSION)/pppoatm.so \ + ${IDIR_PPP_MOD_PPPOA}/usr/lib/pppd/$(PKG_VERSION) + mod-chat-install: ${INSTALL_DIR} ${IDIR_PPP_MOD_CHAT}/usr/sbin ${CP} ${WRKINST}/usr/sbin/chat ${IDIR_PPP_MOD_CHAT}/usr/sbin/ diff --git a/package/sangam-atm/patches/patch-tn7atm_h b/package/sangam-atm/patches/patch-tn7atm_h index e26e0441a..fd9ca3db1 100644 --- a/package/sangam-atm/patches/patch-tn7atm_h +++ b/package/sangam-atm/patches/patch-tn7atm_h @@ -1,5 +1,5 @@ --- sangam-atm-1.0.orig/tn7atm.h 2006-04-05 07:33:06.000000000 +0200 -+++ sangam-atm-1.0/tn7atm.h 2009-12-17 19:15:08.310494800 +0100 ++++ sangam-atm-1.0/tn7atm.h 2009-12-17 23:42:04.069784991 +0100 @@ -19,7 +19,8 @@ //#include "mips_support.h" #include @@ -48,3 +48,9 @@ #ifdef CONFIG_LED_MODULE #ifndef BASE_PSP_7X #include +@@ -275,4 +245,4 @@ typedef struct + #define PHYS_TO_K1(X) (PHYS_ADDR(X)|K1BASE) + #endif + +-#endif __TN7ATM_H ++#endif diff --git a/package/sangam-atm/patches/patch-tn7dsl_c b/package/sangam-atm/patches/patch-tn7dsl_c index 8a06dcfe1..dfbc994ff 100644 --- a/package/sangam-atm/patches/patch-tn7dsl_c +++ b/package/sangam-atm/patches/patch-tn7dsl_c @@ -1,5 +1,5 @@ --- sangam-atm-1.0.orig/tn7dsl.c 2007-01-04 09:04:14.000000000 +0100 -+++ sangam-atm-1.0/tn7dsl.c 2009-12-17 19:22:19.372420289 +0100 ++++ sangam-atm-1.0/tn7dsl.c 2009-12-17 23:40:56.457448616 +0100 @@ -94,7 +94,6 @@ * 1/02/07 JZ CQ11054: Data Precision and Range Changes for TR-069 Conformance * UR8_MERGE_END CQ11054* @@ -82,7 +82,17 @@ //kthread_t overlay_thread; /* end of module wide declars */ -@@ -323,6 +353,14 @@ static int tn7dsl_proc_snr_print (char * +@@ -309,8 +339,7 @@ static void tn7dsl_chng_modulation(void* + static unsigned int tn7dsl_set_modulation(void* data, int flag); + static void tn7dsl_ctrl_fineGain(int value); + static void tn7dsl_set_fineGainValue(int value); +-static int dslmod_sysctl (ctl_table * ctl, int write, struct file *filp, +- void *buffer, size_t * lenp); ++static int dslmod_sysctl (ctl_table * ctl, int write, void *buffer, size_t * lenp, loff_t *ppos); + static void tn7dsl_register_dslss_led(void); + void tn7dsl_dslmod_sysctl_register(void); + void tn7dsl_dslmod_sysctl_unregister(void); +@@ -323,6 +352,14 @@ static int tn7dsl_proc_snr_print (char * #define gDot1(a) ((a>0)?(a%10):((-a)%10)) // UR8_MERGE_END CQ11054* @@ -97,7 +107,7 @@ int os_atoi(const char *pStr) { int MulNeg = (*pStr == '-' ? -1 : 1); -@@ -359,39 +397,6 @@ void dprintf (int uDbgLevel, char *szFmt +@@ -359,39 +396,6 @@ void dprintf (int uDbgLevel, char *szFmt #endif } @@ -137,7 +147,7 @@ // * UR8_MERGE_START CQ10640 Jack Zhang int tn7dsl_dump_dsp_memory(char *input_str) //cph99 { -@@ -441,101 +446,79 @@ unsigned int shim_osGetCpuFrequency(void +@@ -441,101 +445,79 @@ unsigned int shim_osGetCpuFrequency(void return CpuFrequency; } @@ -302,7 +312,15 @@ } int shim_osLoadDebugFWImage(unsigned char *ptr) -@@ -2845,98 +2828,82 @@ static int tn7dsl_set_dsl(void) +@@ -2834,7 +2816,6 @@ static int tn7dsl_set_dsl(void) + int value; + int i, offset[2]={4,11},oamFeature=0; + char tmp[4]; +- char dspVer[10]; + + // OAM Feature Configuration + dslhal_api_dspInterfaceRead (pIhw, (unsigned int) pIhw->pmainAddr, 2, +@@ -2845,98 +2826,82 @@ static int tn7dsl_set_dsl(void) (unsigned int *) &offset, (unsigned char *) &oamFeature, 4); @@ -436,7 +454,7 @@ tn7dsl_generic_read(2, offset); dslReg &= dslhal_support_byteSwap32(0xFFFFFF00); -@@ -2954,46 +2921,47 @@ static int tn7dsl_set_dsl(void) +@@ -2954,46 +2919,47 @@ static int tn7dsl_set_dsl(void) // maximum bits per carrier ptr = NULL; ptr = prom_getenv("maximum_bits_per_carrier"); @@ -495,7 +513,7 @@ for(i=0;i<8;i++) { tmp[0]=ptr[i*2]; -@@ -3018,26 +2986,26 @@ static int tn7dsl_set_dsl(void) +@@ -3018,26 +2984,26 @@ static int tn7dsl_set_dsl(void) } ptr = NULL; ptr = prom_getenv("eoc_vendor_revision"); @@ -528,7 +546,7 @@ } return 0; -@@ -3064,6 +3032,7 @@ int tn7dsl_init(void *priv) +@@ -3064,6 +3030,7 @@ int tn7dsl_init(void *priv) int high_precision_selected = 0; // UR8_MERGE_END CQ11054* @@ -536,7 +554,7 @@ /* * start dsl */ -@@ -3081,7 +3050,7 @@ int tn7dsl_init(void *priv) +@@ -3081,7 +3048,7 @@ int tn7dsl_init(void *priv) * backward compatibility. */ cp = prom_getenv("DSL_BIT_TMODE"); @@ -545,7 +563,7 @@ { printk("%s : env var DSL_BIT_TMODE is set\n", __FUNCTION__); /* -@@ -3110,9 +3079,9 @@ int tn7dsl_init(void *priv) +@@ -3110,9 +3077,9 @@ int tn7dsl_init(void *priv) // UR8_MERGE_START CQ11054 Jack Zhang cp = prom_getenv("high_precision"); @@ -557,21 +575,40 @@ } if ( high_precision_selected) { -@@ -3442,7 +3411,7 @@ static int dslmod_sysctl(ctl_table *ctl, +@@ -3419,8 +3386,7 @@ unsigned int tn7dsl_get_memory(unsigned + + + +-static int dslmod_sysctl(ctl_table *ctl, int write, struct file * filp, +- void *buffer, size_t *lenp) ++static int dslmod_sysctl(ctl_table *ctl, int write, void *buffer, size_t *lenp, loff_t *ppos) + { + char *ptr; + int ret, len = 0; +@@ -3432,7 +3398,7 @@ static int dslmod_sysctl(ctl_table *ctl, + char mod_req[16] = { '\t' }; + char fst_byt; + +- if (!*lenp || (filp->f_pos && !write)) ++ if (!*lenp || (!*ppos && !write)) + { + *lenp = 0; + return 0; +@@ -3442,7 +3408,7 @@ static int dslmod_sysctl(ctl_table *ctl, */ if(write) { - ret = proc_dostring(ctl, write, filp, buffer, lenp); -+ ret = proc_dostring(ctl, write, buffer, lenp, filp); ++ ret = proc_dostring(ctl, write, buffer, lenp, ppos); switch (ctl->ctl_name) { -@@ -3528,14 +3497,14 @@ static int dslmod_sysctl(ctl_table *ctl, +@@ -3528,14 +3494,14 @@ static int dslmod_sysctl(ctl_table *ctl, else { len += sprintf(info+len, mod_req); - ret = proc_dostring(ctl, write, filp, buffer, lenp); -+ ret = proc_dostring(ctl, write, buffer, lenp, filp); ++ ret = proc_dostring(ctl, write, buffer, lenp, ppos); } return ret; } @@ -583,7 +620,7 @@ , {0} }; -@@ -3558,8 +3527,7 @@ void tn7dsl_dslmod_sysctl_register(void) +@@ -3558,8 +3524,7 @@ void tn7dsl_dslmod_sysctl_register(void) if (initialized == 1) return; @@ -593,7 +630,7 @@ /* * set the defaults -@@ -4821,4 +4789,4 @@ int tn7dsl_proc_PMDus(char* buf, char ** +@@ -4821,4 +4786,4 @@ int tn7dsl_proc_PMDus(char* buf, char ** } #endif //NO_ADV_STATS #endif //TR69_PMD_IN diff --git a/target/ag241/Makefile b/target/ag241/Makefile index e1c5b47a5..730b06bfa 100644 --- a/target/ag241/Makefile +++ b/target/ag241/Makefile @@ -31,10 +31,10 @@ kernel-install: tools-compile ifeq ($(FS),squashfs) imageinstall: $(BIN_DIR)/$(ROOTFSSQUASHFS) - @if [ $$(stat --format=%s ${BUILD_DIR}/${ROOTFSSQUASHFS}) -gt 4063233 ];then \ + @if [ $$(stat --format=%s ${BUILD_DIR}/${ROOTFSSQUASHFS}) -gt 3801088 ];then \ echo 'Image is too big!'; \ else \ - ${CP} ${BUILD_DIR}/${ROOTFSSQUASHFS} $(BIN_DIR)/$(ROOTFSSQUASHFS); \ + ${CP} ${BUILD_DIR}/${ROOTFSSQUASHFS} ${BIN_DIR}/${ROOTFSSQUASHFS}; \ echo The image file is $(ROOTFSSQUASHFS); \ echo 'You can flash the image via tftp:'; \ echo 'tftp 192.168.1.1'; \ diff --git a/target/linux/config/Config.in.network b/target/linux/config/Config.in.network index 05995b8b2..cf3b2a278 100644 --- a/target/linux/config/Config.in.network +++ b/target/linux/config/Config.in.network @@ -193,14 +193,14 @@ config ADK_KPACKAGE_KMOD_PPP_MPPE See http://pptpclient.sourceforge.net/ for information on configuring PPTP clients and servers to utilize this method. -#config ADK_KPACKAGE_KMOD_PPPOATM -# prompt "kmod-pppoatm.................... PPPoA (PPP over ATM) kernel support" -# tristate -# default n -# depends on ADK_KPACKAGE_KMOD_PPP -# select ADK_KPACKAGE_KMOD_ATM -# help -# Support for PPP over ATM +config ADK_KPACKAGE_KMOD_PPPOATM + prompt "kmod-pppoatm.................... PPPoA (PPP over ATM) kernel support" + tristate + default n + depends on ADK_KPACKAGE_KMOD_PPP + select ADK_KPACKAGE_KMOD_ATM + help + Support for PPP over ATM config ADK_KPACKAGE_KMOD_PPPOE prompt "kmod-pppoe...................... PPPoE (PPP over Ethernet) kernel support" -- cgit v1.2.3 From 8b28681c4a5f6aff8a99045feca75dd5e073a53f Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Sat, 19 Dec 2009 12:02:53 +0100 Subject: add a target specific todo --- target/ag241/TODO | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 target/ag241/TODO (limited to 'target/ag241') diff --git a/target/ag241/TODO b/target/ag241/TODO new file mode 100644 index 000000000..3c1ac28a8 --- /dev/null +++ b/target/ag241/TODO @@ -0,0 +1,3 @@ +- update with mtd, reboot feature in mtd +- startupscript for bridged nas device +- -- cgit v1.2.3