* refresh storm patches * disable BX in uClibc config, add ethernet and watchdog support -- thanks to Zilvinas Valinskas

SVN-Revision: 11367
lede-17.01
Imre Kaloz 2008-06-05 17:10:39 +00:00
parent 2ff1596a22
commit 6ca4659c4e
12 changed files with 804 additions and 577 deletions

View File

@ -57,7 +57,7 @@ CONFIG_BRIDGE_NETFILTER=y
# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
# CONFIG_CIFS is not set # CONFIG_CIFS is not set
# CONFIG_CLS_U32_PERF is not set # CONFIG_CLS_U32_PERF is not set
CONFIG_CMDLINE="root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttySL0,19200 init=/etc/preinit mem=32M loglevel=8" CONFIG_CMDLINE="root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,19200 init=/etc/preinit mem=32M loglevel=8"
# CONFIG_CONFIGFS_FS is not set # CONFIG_CONFIGFS_FS is not set
CONFIG_CPU_32=y CONFIG_CPU_32=y
CONFIG_CPU_32v4=y CONFIG_CPU_32v4=y
@ -159,6 +159,7 @@ CONFIG_IP_NF_MANGLE=m
# CONFIG_IP_NF_MATCH_TOS is not set # CONFIG_IP_NF_MATCH_TOS is not set
# CONFIG_IP_NF_MATCH_TTL is not set # CONFIG_IP_NF_MATCH_TTL is not set
# CONFIG_IP_NF_QUEUE is not set # CONFIG_IP_NF_QUEUE is not set
# CONFIG_IP_NF_RAW is not set
# CONFIG_IP_NF_SET is not set # CONFIG_IP_NF_SET is not set
# CONFIG_IP_NF_TARGET_ECN is not set # CONFIG_IP_NF_TARGET_ECN is not set
# CONFIG_IP_NF_TARGET_IMQ is not set # CONFIG_IP_NF_TARGET_IMQ is not set
@ -181,7 +182,6 @@ CONFIG_LLC=m
# CONFIG_LLC2 is not set # CONFIG_LLC2 is not set
# CONFIG_LOCK_STAT is not set # CONFIG_LOCK_STAT is not set
# CONFIG_MINIX_FS is not set # CONFIG_MINIX_FS is not set
# CONFIG_MINI_FO is not set
# CONFIG_MISC_DEVICES is not set # CONFIG_MISC_DEVICES is not set
# CONFIG_MSDOS_FS is not set # CONFIG_MSDOS_FS is not set
CONFIG_MTD=y CONFIG_MTD=y
@ -241,6 +241,7 @@ CONFIG_MTD_SL2312_CFI=y
# CONFIG_MTD_SL2312_SERIAL_ATMEL is not set # CONFIG_MTD_SL2312_SERIAL_ATMEL is not set
# CONFIG_MTD_SL2312_SERIAL_ST is not set # CONFIG_MTD_SL2312_SERIAL_ST is not set
# CONFIG_MTD_SLRAM is not set # CONFIG_MTD_SLRAM is not set
CONFIG_NETDEV_1000=y
CONFIG_NETFILTER_XTABLES=m CONFIG_NETFILTER_XTABLES=m
# CONFIG_NETFILTER_XT_MATCH_DSCP is not set # CONFIG_NETFILTER_XT_MATCH_DSCP is not set
# CONFIG_NETFILTER_XT_MATCH_ESP is not set # CONFIG_NETFILTER_XT_MATCH_ESP is not set
@ -265,7 +266,6 @@ CONFIG_NETFILTER_XTABLES=m
# CONFIG_NETFILTER_XT_TARGET_NFLOG is not set # CONFIG_NETFILTER_XT_TARGET_NFLOG is not set
# CONFIG_NETFILTER_XT_TARGET_TARPIT is not set # CONFIG_NETFILTER_XT_TARGET_TARPIT is not set
# CONFIG_NETFILTER_XT_TARGET_TCPMSS is not set # CONFIG_NETFILTER_XT_TARGET_TCPMSS is not set
# CONFIG_NETFILTER_XT_TARGET_TRACE is not set
# CONFIG_NET_ACT_GACT is not set # CONFIG_NET_ACT_GACT is not set
# CONFIG_NET_ACT_IPT is not set # CONFIG_NET_ACT_IPT is not set
# CONFIG_NET_ACT_MIRRED is not set # CONFIG_NET_ACT_MIRRED is not set
@ -273,6 +273,7 @@ CONFIG_NETFILTER_XTABLES=m
# CONFIG_NET_CLS_RSVP is not set # CONFIG_NET_CLS_RSVP is not set
# CONFIG_NET_CLS_RSVP6 is not set # CONFIG_NET_CLS_RSVP6 is not set
# CONFIG_NET_EMATCH is not set # CONFIG_NET_EMATCH is not set
CONFIG_NET_GMAC=y
# CONFIG_NET_IPGRE is not set # CONFIG_NET_IPGRE is not set
# CONFIG_NET_IPIP is not set # CONFIG_NET_IPIP is not set
# CONFIG_NET_KEY is not set # CONFIG_NET_KEY is not set
@ -290,6 +291,8 @@ CONFIG_NETFILTER_XTABLES=m
# CONFIG_NET_SCH_SFQ is not set # CONFIG_NET_SCH_SFQ is not set
# CONFIG_NET_SCH_TBF is not set # CONFIG_NET_SCH_TBF is not set
# CONFIG_NET_SCH_TEQL is not set # CONFIG_NET_SCH_TEQL is not set
# CONFIG_NET_SL2312 is not set
CONFIG_NET_SL351X=y
# CONFIG_NET_VENDOR_3COM is not set # CONFIG_NET_VENDOR_3COM is not set
# CONFIG_NEW_LEDS is not set # CONFIG_NEW_LEDS is not set
# CONFIG_NFSD is not set # CONFIG_NFSD is not set
@ -303,11 +306,12 @@ CONFIG_NETFILTER_XTABLES=m
# CONFIG_OUTER_CACHE is not set # CONFIG_OUTER_CACHE is not set
CONFIG_PACKET=m CONFIG_PACKET=m
# CONFIG_PARTITION_ADVANCED is not set # CONFIG_PARTITION_ADVANCED is not set
# CONFIG_PCIPCWATCHDOG is not set
CONFIG_PCI=y CONFIG_PCI=y
# CONFIG_PCIPCWATCHDOG is not set
# CONFIG_PCI_DEBUG is not set # CONFIG_PCI_DEBUG is not set
CONFIG_PCI_SYSCALL=y CONFIG_PCI_SYSCALL=y
# CONFIG_PPP is not set # CONFIG_PPP_MPPE is not set
# CONFIG_PPP_SYNC_TTY is not set
CONFIG_PRINTK_TIME=y CONFIG_PRINTK_TIME=y
# CONFIG_PROVE_LOCKING is not set # CONFIG_PROVE_LOCKING is not set
# CONFIG_RCU_TORTURE_TEST is not set # CONFIG_RCU_TORTURE_TEST is not set
@ -322,7 +326,10 @@ CONFIG_SERIAL_SL2312=y
CONFIG_SERIAL_SL2312_CONSOLE=y CONFIG_SERIAL_SL2312_CONSOLE=y
# CONFIG_SHMEM is not set # CONFIG_SHMEM is not set
# CONFIG_SL2312_LPC is not set # CONFIG_SL2312_LPC is not set
# CONFIG_SL2312_MPAGE is not set
# CONFIG_SL2312_RECVFILE is not set
# CONFIG_SL2312_SHARE_PIN is not set # CONFIG_SL2312_SHARE_PIN is not set
# CONFIG_SL2312_TSO is not set
# CONFIG_SL2312_USB is not set # CONFIG_SL2312_USB is not set
CONFIG_SL3516_ASIC=y CONFIG_SL3516_ASIC=y
# CONFIG_SMC91X is not set # CONFIG_SMC91X is not set
@ -341,7 +348,6 @@ CONFIG_TCP_CONG_CUBIC=y
# CONFIG_TICK_ONESHOT is not set # CONFIG_TICK_ONESHOT is not set
# CONFIG_TIMER_STATS is not set # CONFIG_TIMER_STATS is not set
CONFIG_TINY_SHMEM=y CONFIG_TINY_SHMEM=y
# CONFIG_TUN is not set
# CONFIG_UDF_FS is not set # CONFIG_UDF_FS is not set
CONFIG_UID16=y CONFIG_UID16=y
# CONFIG_USB_SUPPORT is not set # CONFIG_USB_SUPPORT is not set
@ -351,6 +357,8 @@ CONFIG_VECTORS_BASE=0xffff0000
# CONFIG_VGASTATE is not set # CONFIG_VGASTATE is not set
# CONFIG_VIDEO_DEV is not set # CONFIG_VIDEO_DEV is not set
CONFIG_VLAN_8021Q=m CONFIG_VLAN_8021Q=m
# CONFIG_W1 is not set
CONFIG_WATCHDOG_SL351X=y
# CONFIG_WLAN_80211 is not set # CONFIG_WLAN_80211 is not set
# CONFIG_XFRM_USER is not set # CONFIG_XFRM_USER is not set
# CONFIG_XFS_FS is not set # CONFIG_XFS_FS is not set

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,5 @@
Index: linux-2.6.23.17/drivers/net/sl2312_emac.c
===================================================================
--- /dev/null --- /dev/null
+++ linux-2.6.23.17/drivers/net/sl2312_emac.c +++ b/drivers/net/sl2312_emac.c
@@ -0,0 +1,4604 @@ @@ -0,0 +1,4604 @@
+#include <linux/module.h> +#include <linux/module.h>
+#include <linux/kernel.h> +#include <linux/kernel.h>
@ -4607,10 +4605,8 @@ Index: linux-2.6.23.17/drivers/net/sl2312_emac.c
+ } + }
+} +}
+ +
Index: linux-2.6.23.17/drivers/net/sl351x_crc16.c
===================================================================
--- /dev/null --- /dev/null
+++ linux-2.6.23.17/drivers/net/sl351x_crc16.c +++ b/drivers/net/sl351x_crc16.c
@@ -0,0 +1,93 @@ @@ -0,0 +1,93 @@
+/**************************************************************************** +/****************************************************************************
+* Name : sl351x_crc16.c +* Name : sl351x_crc16.c
@ -4705,10 +4701,8 @@ Index: linux-2.6.23.17/drivers/net/sl351x_crc16.c
+ +
+ return(SWAP_WORD(crc)); + return(SWAP_WORD(crc));
+} +}
Index: linux-2.6.23.17/drivers/net/sl351x_gmac.c
===================================================================
--- /dev/null --- /dev/null
+++ linux-2.6.23.17/drivers/net/sl351x_gmac.c +++ b/drivers/net/sl351x_gmac.c
@@ -0,0 +1,5622 @@ @@ -0,0 +1,5622 @@
+/************************************************************************** +/**************************************************************************
+* Copyright 2006 StorLink Semiconductors, Inc. All rights reserved. +* Copyright 2006 StorLink Semiconductors, Inc. All rights reserved.
@ -4859,7 +4853,7 @@ Index: linux-2.6.23.17/drivers/net/sl351x_gmac.c
+struct net_device_stats * gmac_get_stats(struct net_device *dev); +struct net_device_stats * gmac_get_stats(struct net_device *dev);
+static int gmac_start_xmit(struct sk_buff *skb, struct net_device *dev); +static int gmac_start_xmit(struct sk_buff *skb, struct net_device *dev);
+static void gmac_set_rx_mode(struct net_device *dev); +static void gmac_set_rx_mode(struct net_device *dev);
+static irqreturn_t toe_gmac_interrupt (int irq, void *dev_instance, struct pt_regs *regs); +static irqreturn_t toe_gmac_interrupt (int irq, void *dev_instance);
+static void toe_gmac_handle_default_rxq(struct net_device *dev, GMAC_INFO_T *tp); +static void toe_gmac_handle_default_rxq(struct net_device *dev, GMAC_INFO_T *tp);
+unsigned int mii_read(unsigned char phyad,unsigned char regad); +unsigned int mii_read(unsigned char phyad,unsigned char regad);
+void mii_write(unsigned char phyad,unsigned char regad,unsigned int value); +void mii_write(unsigned char phyad,unsigned char regad,unsigned int value);
@ -6532,7 +6526,7 @@ Index: linux-2.6.23.17/drivers/net/sl351x_gmac.c
+#ifdef L2_jumbo_frame +#ifdef L2_jumbo_frame
+ if (total_len >= (dev->mtu+14) && (skb->nh.iph->protocol == 0x011) && skb->nh.iph && (skb->nh.iph->frag_off & __constant_htons(0x3fff))) + if (total_len >= (dev->mtu+14) && (skb->nh.iph->protocol == 0x011) && skb->nh.iph && (skb->nh.iph->frag_off & __constant_htons(0x3fff)))
+#else +#else
+ if (total_len <= 1514 && skb->nh.iph && (skb->nh.iph->frag_off & __constant_htons(0x3fff))) + if (total_len <= 1514 && ip_hdr(skb) && (ip_hdr(skb)->frag_off & __constant_htons(0x3fff)))
+#endif +#endif
+ word1 = total_len | + word1 = total_len |
+ TSS_IP_CHKSUM_BIT | + TSS_IP_CHKSUM_BIT |
@ -7012,7 +7006,7 @@ Index: linux-2.6.23.17/drivers/net/sl351x_gmac.c
+ toe = (TOE_INFO_T *)&toe_private_data; + toe = (TOE_INFO_T *)&toe_private_data;
+ +
+ /* hook ISR */ + /* hook ISR */
+ retval = request_irq (dev->irq, toe_gmac_interrupt, SA_INTERRUPT, dev->name, dev); + retval = request_irq (dev->irq, toe_gmac_interrupt, IRQF_DISABLED, dev->name, dev);
+ if (retval) + if (retval)
+ return retval; + return retval;
+ +
@ -7140,7 +7134,7 @@ Index: linux-2.6.23.17/drivers/net/sl351x_gmac.c
+/*---------------------------------------------------------------------- +/*----------------------------------------------------------------------
+* toe_gmac_interrupt +* toe_gmac_interrupt
+*----------------------------------------------------------------------*/ +*----------------------------------------------------------------------*/
+static irqreturn_t toe_gmac_interrupt (int irq, void *dev_instance, struct pt_regs *regs) +static irqreturn_t toe_gmac_interrupt (int irq, void *dev_instance)
+{ +{
+ struct net_device *dev = (struct net_device *)dev_instance; + struct net_device *dev = (struct net_device *)dev_instance;
+ TOE_INFO_T *toe; + TOE_INFO_T *toe;
@ -10332,10 +10326,8 @@ Index: linux-2.6.23.17/drivers/net/sl351x_gmac.c
+late_initcall(sl351x_mac_address_init); +late_initcall(sl351x_mac_address_init);
+ +
+ +
Index: linux-2.6.23.17/drivers/net/sl351x_hash.c
===================================================================
--- /dev/null --- /dev/null
+++ linux-2.6.23.17/drivers/net/sl351x_hash.c +++ b/drivers/net/sl351x_hash.c
@@ -0,0 +1,713 @@ @@ -0,0 +1,713 @@
+/************************************************************************** +/**************************************************************************
+* Copyright 2006 StorLink Semiconductors, Inc. All rights reserved. +* Copyright 2006 StorLink Semiconductors, Inc. All rights reserved.
@ -11050,10 +11042,8 @@ Index: linux-2.6.23.17/drivers/net/sl351x_hash.c
+} +}
+ +
+ +
Index: linux-2.6.23.17/drivers/net/sl351x_nat.c
===================================================================
--- /dev/null --- /dev/null
+++ linux-2.6.23.17/drivers/net/sl351x_nat.c +++ b/drivers/net/sl351x_nat.c
@@ -0,0 +1,1736 @@ @@ -0,0 +1,1736 @@
+/**************************************************************************** +/****************************************************************************
+* Copyright 2006 StorLink Semiconductors, Inc. All rights reserved. +* Copyright 2006 StorLink Semiconductors, Inc. All rights reserved.
@ -11117,8 +11107,8 @@ Index: linux-2.6.23.17/drivers/net/sl351x_nat.c
+#include <asm/arch/sl351x_hash_cfg.h> +#include <asm/arch/sl351x_hash_cfg.h>
+#include <asm/arch/sl351x_nat_cfg.h> +#include <asm/arch/sl351x_nat_cfg.h>
+#ifdef CONFIG_NETFILTER +#ifdef CONFIG_NETFILTER
+#include <linux/netfilter_ipv4/ip_conntrack.h> +// #include <linux/netfilter/nf_conntrack.h>
+#include <linux/netfilter_ipv4/ip_conntrack_tcp.h> +#include <linux/netfilter/nf_conntrack_tcp.h>
+#endif +#endif
+ +
+//#define NAT_DEBUG_MSG 1 +//#define NAT_DEBUG_MSG 1
@ -12791,10 +12781,8 @@ Index: linux-2.6.23.17/drivers/net/sl351x_nat.c
+ +
+#endif // CONFIG_SL351x_NAT +#endif // CONFIG_SL351x_NAT
+ +
Index: linux-2.6.23.17/drivers/net/sl351x_proc.c
===================================================================
--- /dev/null --- /dev/null
+++ linux-2.6.23.17/drivers/net/sl351x_proc.c +++ b/drivers/net/sl351x_proc.c
@@ -0,0 +1,578 @@ @@ -0,0 +1,578 @@
+/**************************************************************************** +/****************************************************************************
+* Copyright 2006 Storlink Corp. All rights reserved. +* Copyright 2006 Storlink Corp. All rights reserved.
@ -12839,7 +12827,7 @@ Index: linux-2.6.23.17/drivers/net/sl351x_proc.c
+#include <linux/tcp.h> +#include <linux/tcp.h>
+#include <linux/ppp_defs.h> +#include <linux/ppp_defs.h>
+#ifdef CONFIG_NETFILTER +#ifdef CONFIG_NETFILTER
+#include <linux/netfilter_ipv4/ip_conntrack.h> +// #include <linux/netfilter_ipv4/ip_conntrack.h>
+#endif +#endif
+#include <linux/proc_fs.h> +#include <linux/proc_fs.h>
+#include <linux/seq_file.h> +#include <linux/seq_file.h>
@ -13374,10 +13362,8 @@ Index: linux-2.6.23.17/drivers/net/sl351x_proc.c
+module_exit(fini); +module_exit(fini);
+ +
+#endif // CONFIG_PROC_FS +#endif // CONFIG_PROC_FS
Index: linux-2.6.23.17/drivers/net/sl351x_toe.c
===================================================================
--- /dev/null --- /dev/null
+++ linux-2.6.23.17/drivers/net/sl351x_toe.c +++ b/drivers/net/sl351x_toe.c
@@ -0,0 +1,1083 @@ @@ -0,0 +1,1083 @@
+/************************************************************************** +/**************************************************************************
+* Copyright 2006 StorLink Semiconductors, Inc. All rights reserved. +* Copyright 2006 StorLink Semiconductors, Inc. All rights reserved.
@ -14462,10 +14448,8 @@ Index: linux-2.6.23.17/drivers/net/sl351x_toe.c
+} +}
+ +
+ +
Index: linux-2.6.23.17/drivers/net/sl_lepus_hash.c
===================================================================
--- /dev/null --- /dev/null
+++ linux-2.6.23.17/drivers/net/sl_lepus_hash.c +++ b/drivers/net/sl_lepus_hash.c
@@ -0,0 +1,553 @@ @@ -0,0 +1,553 @@
+/************************************************************************** +/**************************************************************************
+* Copyright 2006 StorLink Semiconductors, Inc. All rights reserved. +* Copyright 2006 StorLink Semiconductors, Inc. All rights reserved.
@ -15020,10 +15004,8 @@ Index: linux-2.6.23.17/drivers/net/sl_lepus_hash.c
+} +}
+ +
+ +
Index: linux-2.6.23.17/drivers/net/sl_switch.c
===================================================================
--- /dev/null --- /dev/null
+++ linux-2.6.23.17/drivers/net/sl_switch.c +++ b/drivers/net/sl_switch.c
@@ -0,0 +1,650 @@ @@ -0,0 +1,650 @@
+#include <linux/module.h> +#include <linux/module.h>
+#include <linux/kernel.h> +#include <linux/kernel.h>
@ -15675,10 +15657,8 @@ Index: linux-2.6.23.17/drivers/net/sl_switch.c
+} +}
+EXPORT_SYMBOL(SPI_get_identifier); +EXPORT_SYMBOL(SPI_get_identifier);
+ +
Index: linux-2.6.23.17/include/asm-arm/arch-sl2312/sl351x_gmac.h
===================================================================
--- /dev/null --- /dev/null
+++ linux-2.6.23.17/include/asm-arm/arch-sl2312/sl351x_gmac.h +++ b/include/asm-arm/arch-sl2312/sl351x_gmac.h
@@ -0,0 +1,2223 @@ @@ -0,0 +1,2223 @@
+/**************************************************************************** +/****************************************************************************
+* Copyright 2006 StorLink Semiconductors, Inc. All rights reserved. +* Copyright 2006 StorLink Semiconductors, Inc. All rights reserved.
@ -17903,10 +17883,8 @@ Index: linux-2.6.23.17/include/asm-arm/arch-sl2312/sl351x_gmac.h
+/* transmit timeout value */ +/* transmit timeout value */
+ +
+#endif //_GMAC_SL351x_H +#endif //_GMAC_SL351x_H
Index: linux-2.6.23.17/include/asm-arm/arch-sl2312/sl351x_hash_cfg.h
===================================================================
--- /dev/null --- /dev/null
+++ linux-2.6.23.17/include/asm-arm/arch-sl2312/sl351x_hash_cfg.h +++ b/include/asm-arm/arch-sl2312/sl351x_hash_cfg.h
@@ -0,0 +1,365 @@ @@ -0,0 +1,365 @@
+/*----------------------------------------------------------------------------------- +/*-----------------------------------------------------------------------------------
+* sl351x_hash_cfg.h +* sl351x_hash_cfg.h
@ -18273,10 +18251,8 @@ Index: linux-2.6.23.17/include/asm-arm/arch-sl2312/sl351x_hash_cfg.h
+ +
+ +
+ +
Index: linux-2.6.23.17/include/asm-arm/arch-sl2312/sl351x_nat_cfg.h
===================================================================
--- /dev/null --- /dev/null
+++ linux-2.6.23.17/include/asm-arm/arch-sl2312/sl351x_nat_cfg.h +++ b/include/asm-arm/arch-sl2312/sl351x_nat_cfg.h
@@ -0,0 +1,211 @@ @@ -0,0 +1,211 @@
+/************************************************************************** +/**************************************************************************
+* Copyright 2006 StorLink Semiconductors, Inc. All rights reserved. +* Copyright 2006 StorLink Semiconductors, Inc. All rights reserved.
@ -18489,10 +18465,8 @@ Index: linux-2.6.23.17/include/asm-arm/arch-sl2312/sl351x_nat_cfg.h
+ +
+ +
+ +
Index: linux-2.6.23.17/include/asm-arm/arch-sl2312/sl351x_toe.h
===================================================================
--- /dev/null --- /dev/null
+++ linux-2.6.23.17/include/asm-arm/arch-sl2312/sl351x_toe.h +++ b/include/asm-arm/arch-sl2312/sl351x_toe.h
@@ -0,0 +1,88 @@ @@ -0,0 +1,88 @@
+/************************************************************************** +/**************************************************************************
+* Copyright 2006 StorLink Semiconductors, Inc. All rights reserved. +* Copyright 2006 StorLink Semiconductors, Inc. All rights reserved.
@ -18582,3 +18556,60 @@ Index: linux-2.6.23.17/include/asm-arm/arch-sl2312/sl351x_toe.h
+}; +};
+ +
+#endif // __SL351x_TOE_H +#endif // __SL351x_TOE_H
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -2131,6 +2131,42 @@
The safe and default value for this is N.
+config NET_GMAC
+ tristate "Storlink Gigabit Ethernet support"
+ depends on ARCH_SL2312
+ help
+ This driver supports Storlink dual Gigabit Ethernet.
+
+config NET_SL2312
+ tristate "Storlink Gigabit Ethernet support"
+ depends on NET_GMAC
+ help
+ This driver supports Storlink dual Gigabit Ethernet.
+
+config NET_SL351X
+ tristate "Storlink Lepus Gigabit Ethernet support"
+ depends on NET_GMAC
+ help
+ This driver supports Storlink TOE and NAT dual Gigabit Ethernet.
+
+config SL2312_TSO
+ bool "Tx Segmentation Enable"
+ depends on NET_GMAC
+ help
+ TBD
+
+config SL2312_MPAGE
+ bool "Tx Multipage Enable"
+ depends on NET_GMAC
+ help
+ TBD
+
+config SL2312_RECVFILE
+ bool "Rx Multipage Enable"
+ depends on NET_GMAC
+ help
+ TBD
+
config DL2K
tristate "D-Link DL2000-based Gigabit Ethernet support"
depends on PCI
--- a/drivers/net/Makefile
+++ b/drivers/net/Makefile
@@ -236,4 +236,8 @@
obj-$(CONFIG_FS_ENET) += fs_enet/
-obj-$(CONFIG_NETXEN_NIC) += netxen/
+
+obj-$(CONFIG_NET_SL351X)+= sl351x_gmac.o sl351x_nat.o sl351x_hash.o sl351x_crc16.o sl351x_proc.o sl_switch.o
+obj-$(CONFIG_NET_SL2312)+= sl2312_emac.o
+
+

View File

@ -1,7 +1,5 @@
Index: linux-2.6.23.17/include/asm-arm/arch-sl2312/sl351x_gmac.h --- a/include/asm-arm/arch-sl2312/sl351x_gmac.h
=================================================================== +++ b/include/asm-arm/arch-sl2312/sl351x_gmac.h
--- linux-2.6.23.17.orig/include/asm-arm/arch-sl2312/sl351x_gmac.h
+++ linux-2.6.23.17/include/asm-arm/arch-sl2312/sl351x_gmac.h
@@ -21,7 +21,7 @@ @@ -21,7 +21,7 @@
#undef BIG_ENDIAN #undef BIG_ENDIAN
#define BIG_ENDIAN 0 #define BIG_ENDIAN 0

View File

@ -1,7 +1,5 @@
Index: linux-2.6.23.17/drivers/net/sl351x_gmac.c --- a/drivers/net/sl351x_gmac.c
=================================================================== +++ b/drivers/net/sl351x_gmac.c
--- linux-2.6.23.17.orig/drivers/net/sl351x_gmac.c
+++ linux-2.6.23.17/drivers/net/sl351x_gmac.c
@@ -68,9 +68,11 @@ @@ -68,9 +68,11 @@
#include <linux/ip.h> #include <linux/ip.h>
#endif #endif
@ -15,7 +13,7 @@ Index: linux-2.6.23.17/drivers/net/sl351x_gmac.c
#endif #endif
#define GMAX_TX_INTR_DISABLED 1 #define GMAX_TX_INTR_DISABLED 1
#define DO_HW_CHKSUM 1 #define DO_HW_CHKSUM 1
@@ -124,12 +126,17 @@ static char _debug_prefetch_buf[_DEBUG_P @@ -124,12 +126,17 @@
*************************************************************/ *************************************************************/
static int gmac_initialized = 0; static int gmac_initialized = 0;
TOE_INFO_T toe_private_data; TOE_INFO_T toe_private_data;
@ -35,7 +33,7 @@ Index: linux-2.6.23.17/drivers/net/sl351x_gmac.c
#undef CONFIG_SL351x_RXTOE #undef CONFIG_SL351x_RXTOE
extern NAT_CFG_T nat_cfg; extern NAT_CFG_T nat_cfg;
@@ -2443,7 +2450,8 @@ static irqreturn_t toe_gmac_interrupt (i @@ -2443,7 +2450,8 @@
toe = (TOE_INFO_T *)&toe_private_data; toe = (TOE_INFO_T *)&toe_private_data;
// handle NAPI // handle NAPI
#ifdef CONFIG_SL_NAPI #ifdef CONFIG_SL_NAPI
@ -45,7 +43,7 @@ Index: linux-2.6.23.17/drivers/net/sl351x_gmac.c
{ {
/* disable GMAC interrupt */ /* disable GMAC interrupt */
//toe_gmac_disable_interrupt(tp->irq); //toe_gmac_disable_interrupt(tp->irq);
@@ -2530,7 +2538,7 @@ if (storlink_ctl.pauseoff == 1) @@ -2530,7 +2538,7 @@
{ {
if (likely(netif_rx_schedule_prep(dev))) if (likely(netif_rx_schedule_prep(dev)))
{ {
@ -54,7 +52,7 @@ Index: linux-2.6.23.17/drivers/net/sl351x_gmac.c
// disable GMAC-0 rx interrupt // disable GMAC-0 rx interrupt
// class-Q & TOE-Q are implemented in future // class-Q & TOE-Q are implemented in future
//data32 = readl(TOE_GLOBAL_BASE + GLOBAL_INTERRUPT_ENABLE_1_REG); //data32 = readl(TOE_GLOBAL_BASE + GLOBAL_INTERRUPT_ENABLE_1_REG);
@@ -2563,7 +2571,7 @@ if (storlink_ctl.pauseoff == 1) @@ -2563,7 +2571,7 @@
{ {
if (likely(netif_rx_schedule_prep(dev))) if (likely(netif_rx_schedule_prep(dev)))
{ {
@ -63,7 +61,7 @@ Index: linux-2.6.23.17/drivers/net/sl351x_gmac.c
// disable GMAC-0 rx interrupt // disable GMAC-0 rx interrupt
// class-Q & TOE-Q are implemented in future // class-Q & TOE-Q are implemented in future
//data32 = readl(TOE_GLOBAL_BASE + GLOBAL_INTERRUPT_ENABLE_1_REG); //data32 = readl(TOE_GLOBAL_BASE + GLOBAL_INTERRUPT_ENABLE_1_REG);
@@ -4217,7 +4225,7 @@ static int gmac_rx_poll(struct net_devic @@ -4217,7 +4225,7 @@
GMAC_INFO_T *tp = (GMAC_INFO_T *)dev->priv; GMAC_INFO_T *tp = (GMAC_INFO_T *)dev->priv;
unsigned int status4; unsigned int status4;
volatile DMA_RWPTR_T fq_rwptr; volatile DMA_RWPTR_T fq_rwptr;
@ -72,7 +70,7 @@ Index: linux-2.6.23.17/drivers/net/sl351x_gmac.c
//unsigned long rx_old_bytes; //unsigned long rx_old_bytes;
struct net_device_stats *isPtr = (struct net_device_stats *)&tp->ifStatics; struct net_device_stats *isPtr = (struct net_device_stats *)&tp->ifStatics;
//unsigned long long rx_time; //unsigned long long rx_time;
@@ -4479,7 +4487,7 @@ static int gmac_rx_poll(struct net_devic @@ -4479,7 +4487,7 @@
if (rwptr.bits.rptr == rwptr.bits.wptr) if (rwptr.bits.rptr == rwptr.bits.wptr)
{ {

View File

@ -1,8 +1,6 @@
Index: linux-2.6.23.17/drivers/net/sl351x_gmac.c --- a/drivers/net/sl351x_gmac.c
=================================================================== +++ b/drivers/net/sl351x_gmac.c
--- linux-2.6.23.17.orig/drivers/net/sl351x_gmac.c @@ -127,6 +127,7 @@
+++ linux-2.6.23.17/drivers/net/sl351x_gmac.c
@@ -127,6 +127,7 @@ static char _debug_prefetch_buf[_DEBUG_P
static int gmac_initialized = 0; static int gmac_initialized = 0;
TOE_INFO_T toe_private_data; TOE_INFO_T toe_private_data;
static int do_again = 0; static int do_again = 0;
@ -10,7 +8,7 @@ Index: linux-2.6.23.17/drivers/net/sl351x_gmac.c
spinlock_t gmac_fq_lock; spinlock_t gmac_fq_lock;
unsigned int FLAG_SWITCH; unsigned int FLAG_SWITCH;
@@ -1065,7 +1066,8 @@ static void toe_init_gmac(struct net_dev @@ -1065,7 +1066,8 @@
tp->intr3_enabled = 0xffffffff; tp->intr3_enabled = 0xffffffff;
tp->intr4_selected = GMAC0_INT_BITS | CLASS_RX_FULL_INT_BITS | tp->intr4_selected = GMAC0_INT_BITS | CLASS_RX_FULL_INT_BITS |
HWFQ_EMPTY_INT_BIT | SWFQ_EMPTY_INT_BIT; HWFQ_EMPTY_INT_BIT | SWFQ_EMPTY_INT_BIT;
@ -20,7 +18,7 @@ Index: linux-2.6.23.17/drivers/net/sl351x_gmac.c
data = readl(TOE_GLOBAL_BASE + GLOBAL_INTERRUPT_SELECT_0_REG) & ~tp->intr0_selected; data = readl(TOE_GLOBAL_BASE + GLOBAL_INTERRUPT_SELECT_0_REG) & ~tp->intr0_selected;
writel(data, TOE_GLOBAL_BASE + GLOBAL_INTERRUPT_SELECT_0_REG); writel(data, TOE_GLOBAL_BASE + GLOBAL_INTERRUPT_SELECT_0_REG);
@@ -1115,7 +1117,7 @@ static void toe_init_gmac(struct net_dev @@ -1115,7 +1117,7 @@
tp->intr3_enabled |= 0xffffffff; tp->intr3_enabled |= 0xffffffff;
tp->intr4_selected |= CLASS_RX_FULL_INT_BITS | tp->intr4_selected |= CLASS_RX_FULL_INT_BITS |
HWFQ_EMPTY_INT_BIT | SWFQ_EMPTY_INT_BIT; HWFQ_EMPTY_INT_BIT | SWFQ_EMPTY_INT_BIT;
@ -29,7 +27,7 @@ Index: linux-2.6.23.17/drivers/net/sl351x_gmac.c
} }
data = readl(TOE_GLOBAL_BASE + GLOBAL_INTERRUPT_SELECT_0_REG) | tp->intr0_selected; data = readl(TOE_GLOBAL_BASE + GLOBAL_INTERRUPT_SELECT_0_REG) | tp->intr0_selected;
writel(data, TOE_GLOBAL_BASE + GLOBAL_INTERRUPT_SELECT_0_REG); writel(data, TOE_GLOBAL_BASE + GLOBAL_INTERRUPT_SELECT_0_REG);
@@ -2408,7 +2410,7 @@ static inline void toe_gmac_fill_free_q( @@ -2408,7 +2410,7 @@
// unsigned short max_cnt=TOE_SW_FREEQ_DESC_NUM>>1; // unsigned short max_cnt=TOE_SW_FREEQ_DESC_NUM>>1;
fq_rwptr.bits32 = readl(TOE_GLOBAL_BASE + GLOBAL_SWFQ_RWPTR_REG); fq_rwptr.bits32 = readl(TOE_GLOBAL_BASE + GLOBAL_SWFQ_RWPTR_REG);
@ -38,7 +36,7 @@ Index: linux-2.6.23.17/drivers/net/sl351x_gmac.c
//while ((max_cnt--) && (unsigned short)RWPTR_ADVANCE_ONE(fq_rwptr.bits.wptr, //while ((max_cnt--) && (unsigned short)RWPTR_ADVANCE_ONE(fq_rwptr.bits.wptr,
// TOE_SW_FREEQ_DESC_NUM) != fq_rwptr.bits.rptr) { // TOE_SW_FREEQ_DESC_NUM) != fq_rwptr.bits.rptr) {
while ((unsigned short)RWPTR_ADVANCE_ONE(fq_rwptr.bits.wptr, while ((unsigned short)RWPTR_ADVANCE_ONE(fq_rwptr.bits.wptr,
@@ -2428,10 +2430,47 @@ static inline void toe_gmac_fill_free_q( @@ -2428,10 +2430,47 @@
SET_WPTR(TOE_GLOBAL_BASE+GLOBAL_SWFQ_RWPTR_REG, fq_rwptr.bits.wptr); SET_WPTR(TOE_GLOBAL_BASE+GLOBAL_SWFQ_RWPTR_REG, fq_rwptr.bits.wptr);
toe_private_data.fq_rx_rwptr.bits32 = fq_rwptr.bits32; toe_private_data.fq_rx_rwptr.bits32 = fq_rwptr.bits32;
} }
@ -87,7 +85,7 @@ Index: linux-2.6.23.17/drivers/net/sl351x_gmac.c
/*---------------------------------------------------------------------- /*----------------------------------------------------------------------
* toe_gmac_interrupt * toe_gmac_interrupt
*----------------------------------------------------------------------*/ *----------------------------------------------------------------------*/
@@ -2492,6 +2531,7 @@ if (1) @@ -2492,6 +2531,7 @@
writel(status3 & tp->intr3_enabled, TOE_GLOBAL_BASE+GLOBAL_INTERRUPT_STATUS_3_REG); writel(status3 & tp->intr3_enabled, TOE_GLOBAL_BASE+GLOBAL_INTERRUPT_STATUS_3_REG);
if (status4) if (status4)
writel(status4 & tp->intr4_enabled, TOE_GLOBAL_BASE+GLOBAL_INTERRUPT_STATUS_4_REG); writel(status4 & tp->intr4_enabled, TOE_GLOBAL_BASE+GLOBAL_INTERRUPT_STATUS_4_REG);
@ -95,7 +93,7 @@ Index: linux-2.6.23.17/drivers/net/sl351x_gmac.c
#if 0 #if 0
/* handle freeq interrupt first */ /* handle freeq interrupt first */
if (status4 & tp->intr4_enabled) { if (status4 & tp->intr4_enabled) {
@@ -2536,10 +2576,31 @@ if (1) @@ -2536,10 +2576,31 @@
} }
if (netif_running(dev) && (status1 & DEFAULT_Q0_INT_BIT) && (tp->intr1_enabled & DEFAULT_Q0_INT_BIT)) if (netif_running(dev) && (status1 & DEFAULT_Q0_INT_BIT) && (tp->intr1_enabled & DEFAULT_Q0_INT_BIT))
{ {
@ -130,7 +128,7 @@ Index: linux-2.6.23.17/drivers/net/sl351x_gmac.c
// class-Q & TOE-Q are implemented in future // class-Q & TOE-Q are implemented in future
//data32 = readl(TOE_GLOBAL_BASE + GLOBAL_INTERRUPT_ENABLE_1_REG); //data32 = readl(TOE_GLOBAL_BASE + GLOBAL_INTERRUPT_ENABLE_1_REG);
//data32 &= ~DEFAULT_Q0_INT_BIT; //data32 &= ~DEFAULT_Q0_INT_BIT;
@@ -2549,7 +2610,8 @@ if (1) @@ -2549,7 +2610,8 @@
//tp->total_q_cnt_napi=0; //tp->total_q_cnt_napi=0;
//rx_time = jiffies; //rx_time = jiffies;
//rx_old_bytes = isPtr->rx_bytes; //rx_old_bytes = isPtr->rx_bytes;
@ -140,7 +138,7 @@ Index: linux-2.6.23.17/drivers/net/sl351x_gmac.c
} }
} }
} }
@@ -2569,9 +2631,31 @@ if (1) @@ -2569,9 +2631,31 @@
if (netif_running(dev) && (status1 & DEFAULT_Q1_INT_BIT) && (tp->intr1_enabled & DEFAULT_Q1_INT_BIT)) if (netif_running(dev) && (status1 & DEFAULT_Q1_INT_BIT) && (tp->intr1_enabled & DEFAULT_Q1_INT_BIT))
{ {
@ -174,7 +172,7 @@ Index: linux-2.6.23.17/drivers/net/sl351x_gmac.c
// disable GMAC-0 rx interrupt // disable GMAC-0 rx interrupt
// class-Q & TOE-Q are implemented in future // class-Q & TOE-Q are implemented in future
//data32 = readl(TOE_GLOBAL_BASE + GLOBAL_INTERRUPT_ENABLE_1_REG); //data32 = readl(TOE_GLOBAL_BASE + GLOBAL_INTERRUPT_ENABLE_1_REG);
@@ -2583,9 +2667,13 @@ if (1) @@ -2583,9 +2667,13 @@
//rx_time = jiffies; //rx_time = jiffies;
//rx_old_bytes = isPtr->rx_bytes; //rx_old_bytes = isPtr->rx_bytes;
__netif_rx_schedule(dev); __netif_rx_schedule(dev);
@ -188,7 +186,7 @@ Index: linux-2.6.23.17/drivers/net/sl351x_gmac.c
} }
// Interrupt Status 0 // Interrupt Status 0
@@ -3306,8 +3394,10 @@ next_rx: @@ -3306,8 +3394,10 @@
SET_RPTR(&tp->default_qhdr->word1, rwptr.bits.rptr); SET_RPTR(&tp->default_qhdr->word1, rwptr.bits.rptr);
tp->rx_rwptr.bits32 = rwptr.bits32; tp->rx_rwptr.bits32 = rwptr.bits32;
@ -200,7 +198,7 @@ Index: linux-2.6.23.17/drivers/net/sl351x_gmac.c
} }
/*---------------------------------------------------------------------- /*----------------------------------------------------------------------
@@ -4217,6 +4307,7 @@ static int gmac_rx_poll(struct net_devic @@ -4217,6 +4307,7 @@
GMAC_RXDESC_T *curr_desc; GMAC_RXDESC_T *curr_desc;
struct sk_buff *skb; struct sk_buff *skb;
DMA_RWPTR_T rwptr; DMA_RWPTR_T rwptr;
@ -208,7 +206,7 @@ Index: linux-2.6.23.17/drivers/net/sl351x_gmac.c
unsigned int pkt_size; unsigned int pkt_size;
unsigned int desc_count; unsigned int desc_count;
unsigned int good_frame, chksum_status, rx_status; unsigned int good_frame, chksum_status, rx_status;
@@ -4231,7 +4322,7 @@ static int gmac_rx_poll(struct net_devic @@ -4231,7 +4322,7 @@
//unsigned long long rx_time; //unsigned long long rx_time;
@ -217,7 +215,7 @@ Index: linux-2.6.23.17/drivers/net/sl351x_gmac.c
#if 1 #if 1
if (do_again) if (do_again)
{ {
@@ -4516,6 +4607,30 @@ static int gmac_rx_poll(struct net_devic @@ -4516,6 +4607,30 @@
#endif #endif
//toe_gmac_fill_free_q(); //toe_gmac_fill_free_q();
netif_rx_complete(dev); netif_rx_complete(dev);

View File

@ -1,7 +1,5 @@
Index: linux-2.6.23.17/drivers/net/sl351x_gmac.c --- a/drivers/net/sl351x_gmac.c
=================================================================== +++ b/drivers/net/sl351x_gmac.c
--- linux-2.6.23.17.orig/drivers/net/sl351x_gmac.c
+++ linux-2.6.23.17/drivers/net/sl351x_gmac.c
@@ -43,9 +43,13 @@ @@ -43,9 +43,13 @@
#include <linux/mtd/kvctl.h> #include <linux/mtd/kvctl.h>
@ -17,7 +15,7 @@ Index: linux-2.6.23.17/drivers/net/sl351x_gmac.c
#ifndef CONFIG_SL351x_RXTOE #ifndef CONFIG_SL351x_RXTOE
//#define CONFIG_SL351x_RXTOE 1 //#define CONFIG_SL351x_RXTOE 1
@@ -126,7 +130,6 @@ static char _debug_prefetch_buf[_DEBUG_P @@ -126,7 +130,6 @@
*************************************************************/ *************************************************************/
static int gmac_initialized = 0; static int gmac_initialized = 0;
TOE_INFO_T toe_private_data; TOE_INFO_T toe_private_data;
@ -25,7 +23,7 @@ Index: linux-2.6.23.17/drivers/net/sl351x_gmac.c
static int rx_poll_enabled; static int rx_poll_enabled;
spinlock_t gmac_fq_lock; spinlock_t gmac_fq_lock;
unsigned int FLAG_SWITCH; unsigned int FLAG_SWITCH;
@@ -190,7 +193,7 @@ void mac_get_sw_tx_weight(struct net_dev @@ -190,7 +193,7 @@
void mac_set_sw_tx_weight(struct net_device *dev, char *weight); void mac_set_sw_tx_weight(struct net_device *dev, char *weight);
void mac_get_hw_tx_weight(struct net_device *dev, char *weight); void mac_get_hw_tx_weight(struct net_device *dev, char *weight);
void mac_set_hw_tx_weight(struct net_device *dev, char *weight); void mac_set_hw_tx_weight(struct net_device *dev, char *weight);
@ -34,7 +32,7 @@ Index: linux-2.6.23.17/drivers/net/sl351x_gmac.c
#ifdef VITESSE_G5SWITCH #ifdef VITESSE_G5SWITCH
extern int Get_Set_port_status(void); extern int Get_Set_port_status(void);
@@ -295,12 +298,14 @@ static int __init gmac_init_module(void) @@ -295,12 +298,14 @@
for(j = 0; i<CONFIG_MAC_NUM; j++) for(j = 0; i<CONFIG_MAC_NUM; j++)
{ {
i=j; i=j;
@ -49,7 +47,7 @@ Index: linux-2.6.23.17/drivers/net/sl351x_gmac.c
tp = (GMAC_INFO_T *)&toe_private_data.gmac[i]; tp = (GMAC_INFO_T *)&toe_private_data.gmac[i];
tp->dev = NULL; tp->dev = NULL;
@@ -459,7 +464,7 @@ void mac_init_drv(void) @@ -459,7 +464,7 @@
toe->gmac[1].dma_base_addr = TOE_GMAC1_DMA_BASE; toe->gmac[1].dma_base_addr = TOE_GMAC1_DMA_BASE;
toe->gmac[0].auto_nego_cfg = 1; toe->gmac[0].auto_nego_cfg = 1;
toe->gmac[1].auto_nego_cfg = 1; toe->gmac[1].auto_nego_cfg = 1;
@ -58,7 +56,7 @@ Index: linux-2.6.23.17/drivers/net/sl351x_gmac.c
toe->gmac[0].speed_cfg = GMAC_SPEED_1000; toe->gmac[0].speed_cfg = GMAC_SPEED_1000;
toe->gmac[1].speed_cfg = GMAC_SPEED_1000; toe->gmac[1].speed_cfg = GMAC_SPEED_1000;
#else #else
@@ -508,7 +513,7 @@ void mac_init_drv(void) @@ -508,7 +513,7 @@
// Write GLOBAL_QUEUE_THRESHOLD_REG // Write GLOBAL_QUEUE_THRESHOLD_REG
threshold.bits32 = 0; threshold.bits32 = 0;
threshold.bits.swfq_empty = (TOE_SW_FREEQ_DESC_NUM > 256) ? 255 : threshold.bits.swfq_empty = (TOE_SW_FREEQ_DESC_NUM > 256) ? 255 :
@ -67,7 +65,7 @@ Index: linux-2.6.23.17/drivers/net/sl351x_gmac.c
threshold.bits.hwfq_empty = (TOE_HW_FREEQ_DESC_NUM > 256) ? 256/4 : threshold.bits.hwfq_empty = (TOE_HW_FREEQ_DESC_NUM > 256) ? 256/4 :
TOE_HW_FREEQ_DESC_NUM/4; TOE_HW_FREEQ_DESC_NUM/4;
threshold.bits.toe_class = (TOE_TOE_DESC_NUM > 256) ? 256/4 : threshold.bits.toe_class = (TOE_TOE_DESC_NUM > 256) ? 256/4 :
@@ -613,18 +618,25 @@ static void toe_init_free_queue(void) @@ -613,18 +618,25 @@
rwptr_reg.bits.rptr = 0; rwptr_reg.bits.rptr = 0;
toe->fq_rx_rwptr.bits32 = rwptr_reg.bits32; toe->fq_rx_rwptr.bits32 = rwptr_reg.bits32;
writel(rwptr_reg.bits32, TOE_GLOBAL_BASE + GLOBAL_SWFQ_RWPTR_REG); writel(rwptr_reg.bits32, TOE_GLOBAL_BASE + GLOBAL_SWFQ_RWPTR_REG);
@ -95,7 +93,7 @@ Index: linux-2.6.23.17/drivers/net/sl351x_gmac.c
// toe->rx_skb[i] = skb; // toe->rx_skb[i] = skb;
sw_desc_ptr->word2.buf_adr = (unsigned int)__pa(skb->data); sw_desc_ptr->word2.buf_adr = (unsigned int)__pa(skb->data);
// consistent_sync((unsigned int)desc_ptr, sizeof(GMAC_RXDESC_T), PCI_DMA_TODEVICE); // consistent_sync((unsigned int)desc_ptr, sizeof(GMAC_RXDESC_T), PCI_DMA_TODEVICE);
@@ -851,14 +863,14 @@ static void toe_init_hwtx_queue(void) @@ -851,14 +863,14 @@
*----------------------------------------------------------------------*/ *----------------------------------------------------------------------*/
static void toe_init_default_queue(void) static void toe_init_default_queue(void)
{ {
@ -114,7 +112,7 @@ Index: linux-2.6.23.17/drivers/net/sl351x_gmac.c
if (!desc_ptr) if (!desc_ptr)
{ {
printk("%s::DMA_MALLOC fail !\n",__func__); printk("%s::DMA_MALLOC fail !\n",__func__);
@@ -866,14 +878,17 @@ static void toe_init_default_queue(void) @@ -866,14 +878,17 @@
} }
memset((void *)desc_ptr, 0, TOE_DEFAULT_Q0_DESC_NUM * sizeof(GMAC_RXDESC_T)); memset((void *)desc_ptr, 0, TOE_DEFAULT_Q0_DESC_NUM * sizeof(GMAC_RXDESC_T));
toe->gmac[0].default_desc_base = (unsigned int)desc_ptr; toe->gmac[0].default_desc_base = (unsigned int)desc_ptr;
@ -133,7 +131,7 @@ Index: linux-2.6.23.17/drivers/net/sl351x_gmac.c
if (!desc_ptr) if (!desc_ptr)
{ {
printk("%s::DMA_MALLOC fail !\n",__func__); printk("%s::DMA_MALLOC fail !\n",__func__);
@@ -1071,12 +1086,16 @@ static void toe_init_gmac(struct net_dev @@ -1071,12 +1086,16 @@
data = readl(TOE_GLOBAL_BASE + GLOBAL_INTERRUPT_SELECT_0_REG) & ~tp->intr0_selected; data = readl(TOE_GLOBAL_BASE + GLOBAL_INTERRUPT_SELECT_0_REG) & ~tp->intr0_selected;
writel(data, TOE_GLOBAL_BASE + GLOBAL_INTERRUPT_SELECT_0_REG); writel(data, TOE_GLOBAL_BASE + GLOBAL_INTERRUPT_SELECT_0_REG);
@ -150,7 +148,7 @@ Index: linux-2.6.23.17/drivers/net/sl351x_gmac.c
data = readl(TOE_GLOBAL_BASE + GLOBAL_INTERRUPT_SELECT_4_REG) & ~tp->intr4_selected; data = readl(TOE_GLOBAL_BASE + GLOBAL_INTERRUPT_SELECT_4_REG) & ~tp->intr4_selected;
writel(data, TOE_GLOBAL_BASE + GLOBAL_INTERRUPT_SELECT_4_REG); writel(data, TOE_GLOBAL_BASE + GLOBAL_INTERRUPT_SELECT_4_REG);
} }
@@ -1176,11 +1195,11 @@ static int toe_gmac_init_chip(struct net @@ -1176,11 +1195,11 @@
GMAC_CONFIG2_T config2_val; GMAC_CONFIG2_T config2_val;
GMAC_CONFIG0_T config0,config0_mask; GMAC_CONFIG0_T config0,config0_mask;
GMAC_CONFIG1_T config1; GMAC_CONFIG1_T config1;
@ -164,7 +162,7 @@ Index: linux-2.6.23.17/drivers/net/sl351x_gmac.c
// GMAC_HASH_ENABLE_REG0_T hash_ctrl; // GMAC_HASH_ENABLE_REG0_T hash_ctrl;
// //
#if 0 /* mac address will be set in late_initcall */ #if 0 /* mac address will be set in late_initcall */
@@ -1202,24 +1221,23 @@ static int toe_gmac_init_chip(struct net @@ -1202,24 +1221,23 @@
// config1.bits32 = 0x002004; //next version // config1.bits32 = 0x002004; //next version
/* set flow control threshold */ /* set flow control threshold */
config1.bits32 = 0; config1.bits32 = 0;
@ -197,7 +195,7 @@ Index: linux-2.6.23.17/drivers/net/sl351x_gmac.c
// gmac_write_reg(tp->base_addr,GMAC_MCAST_FIL0,0x0,0xffffffff); // gmac_write_reg(tp->base_addr,GMAC_MCAST_FIL0,0x0,0xffffffff);
// gmac_write_reg(tp->base_addr,GMAC_MCAST_FIL1,0x0,0xffffffff); // gmac_write_reg(tp->base_addr,GMAC_MCAST_FIL1,0x0,0xffffffff);
@@ -1249,7 +1267,7 @@ static int toe_gmac_init_chip(struct net @@ -1249,7 +1267,7 @@
config0.bits.dis_rx = 1; /* disable rx */ config0.bits.dis_rx = 1; /* disable rx */
config0.bits.dis_tx = 1; /* disable tx */ config0.bits.dis_tx = 1; /* disable tx */
config0.bits.loop_back = 0; /* enable/disable GMAC loopback */ config0.bits.loop_back = 0; /* enable/disable GMAC loopback */
@ -206,7 +204,7 @@ Index: linux-2.6.23.17/drivers/net/sl351x_gmac.c
config0.bits.rgmii_en = 0; config0.bits.rgmii_en = 0;
config0.bits.rgmm_edge = 1; config0.bits.rgmm_edge = 1;
config0.bits.rxc_inv = 0; config0.bits.rxc_inv = 0;
@@ -1342,6 +1360,9 @@ static int toe_gmac_init_chip(struct net @@ -1342,6 +1360,9 @@
gmac_write_reg(tp->dma_base_addr, GMAC_AHB_WEIGHT_REG, ahb_weight.bits32, ahb_weight_mask.bits32); gmac_write_reg(tp->dma_base_addr, GMAC_AHB_WEIGHT_REG, ahb_weight.bits32, ahb_weight_mask.bits32);
#endif #endif
@ -216,7 +214,7 @@ Index: linux-2.6.23.17/drivers/net/sl351x_gmac.c
#if defined(CONFIG_SL351x_NAT) || defined(CONFIG_SL351x_RXTOE) #if defined(CONFIG_SL351x_NAT) || defined(CONFIG_SL351x_RXTOE)
gmac_write_reg(tp->dma_base_addr, GMAC_SPR0, IPPROTO_TCP, 0xffffffff); gmac_write_reg(tp->dma_base_addr, GMAC_SPR0, IPPROTO_TCP, 0xffffffff);
#endif #endif
@@ -1552,7 +1573,7 @@ static void toe_gmac_tx_complete(GMAC_I @@ -1552,7 +1573,7 @@
rwptr.bits32 = readl(swtxq->rwptr_reg); rwptr.bits32 = readl(swtxq->rwptr_reg);
if (rwptr.bits.rptr == swtxq->finished_idx) if (rwptr.bits.rptr == swtxq->finished_idx)
break; break;
@ -225,7 +223,7 @@ Index: linux-2.6.23.17/drivers/net/sl351x_gmac.c
// consistent_sync((void *)curr_desc, sizeof(GMAC_TXDESC_T), PCI_DMA_FROMDEVICE); // consistent_sync((void *)curr_desc, sizeof(GMAC_TXDESC_T), PCI_DMA_FROMDEVICE);
word0.bits32 = curr_desc->word0.bits32; word0.bits32 = curr_desc->word0.bits32;
word1.bits32 = curr_desc->word1.bits32; word1.bits32 = curr_desc->word1.bits32;
@@ -1573,6 +1594,7 @@ static void toe_gmac_tx_complete(GMAC_I @@ -1573,6 +1594,7 @@
swtxq->finished_idx = RWPTR_ADVANCE_ONE(swtxq->finished_idx, swtxq->total_desc_num); swtxq->finished_idx = RWPTR_ADVANCE_ONE(swtxq->finished_idx, swtxq->total_desc_num);
curr_desc = (GMAC_TXDESC_T *)swtxq->desc_base + swtxq->finished_idx; curr_desc = (GMAC_TXDESC_T *)swtxq->desc_base + swtxq->finished_idx;
word0.bits32 = curr_desc->word0.bits32; word0.bits32 = curr_desc->word0.bits32;
@ -233,7 +231,7 @@ Index: linux-2.6.23.17/drivers/net/sl351x_gmac.c
#ifdef _DUMP_TX_TCP_CONTENT #ifdef _DUMP_TX_TCP_CONTENT
if (curr_desc->word0.bits.buffer_size < 16) if (curr_desc->word0.bits.buffer_size < 16)
{ {
@@ -1592,12 +1614,12 @@ static void toe_gmac_tx_complete(GMAC_I @@ -1592,12 +1614,12 @@
word0.bits.status_tx_ok = 0; word0.bits.status_tx_ok = 0;
if (swtxq->tx_skb[swtxq->finished_idx]) if (swtxq->tx_skb[swtxq->finished_idx])
{ {
@ -250,7 +248,7 @@ Index: linux-2.6.23.17/drivers/net/sl351x_gmac.c
curr_desc->word0.bits32 = word0.bits32; curr_desc->word0.bits32 = word0.bits32;
swtxq->curr_finished_desc = (GMAC_TXDESC_T *)curr_desc; swtxq->curr_finished_desc = (GMAC_TXDESC_T *)curr_desc;
swtxq->total_finished++; swtxq->total_finished++;
@@ -1624,31 +1646,29 @@ static void toe_gmac_tx_complete(GMAC_I @@ -1624,31 +1646,29 @@
*----------------------------------------------------------------------*/ *----------------------------------------------------------------------*/
static int gmac_start_xmit(struct sk_buff *skb, struct net_device *dev) static int gmac_start_xmit(struct sk_buff *skb, struct net_device *dev)
{ {
@ -296,7 +294,7 @@ Index: linux-2.6.23.17/drivers/net/sl351x_gmac.c
total_pages = snd_pages; total_pages = snd_pages;
#endif #endif
@@ -1664,13 +1684,6 @@ static int gmac_start_xmit(struct sk_buf @@ -1664,13 +1684,6 @@
} }
#endif #endif
@ -310,7 +308,7 @@ Index: linux-2.6.23.17/drivers/net/sl351x_gmac.c
#ifdef GMAC_USE_TXQ0 #ifdef GMAC_USE_TXQ0
#define tx_qid 0 #define tx_qid 0
#endif #endif
@@ -1703,9 +1716,9 @@ static int gmac_start_xmit(struct sk_buf @@ -1703,9 +1716,9 @@
toe_gmac_tx_complete(tp, tx_qid, dev, 0); toe_gmac_tx_complete(tp, tx_qid, dev, 0);
if (wptr >= swtxq->finished_idx) if (wptr >= swtxq->finished_idx)
@ -322,7 +320,7 @@ Index: linux-2.6.23.17/drivers/net/sl351x_gmac.c
if (free_desc < snd_pages) if (free_desc < snd_pages)
{ {
// spin_unlock(&tp->tx_mutex); // spin_unlock(&tp->tx_mutex);
@@ -2063,9 +2076,10 @@ void mac_start_txdma(struct net_device * @@ -2063,9 +2076,10 @@
struct net_device_stats * gmac_get_stats(struct net_device *dev) struct net_device_stats * gmac_get_stats(struct net_device *dev)
{ {
GMAC_INFO_T *tp = (GMAC_INFO_T *)dev->priv; GMAC_INFO_T *tp = (GMAC_INFO_T *)dev->priv;
@ -335,7 +333,7 @@ Index: linux-2.6.23.17/drivers/net/sl351x_gmac.c
if (netif_running(dev)) if (netif_running(dev))
{ {
@@ -2073,10 +2087,14 @@ struct net_device_stats * gmac_get_stats @@ -2073,10 +2087,14 @@
// spin_lock_irqsave(&tp->lock,flags); // spin_lock_irqsave(&tp->lock,flags);
pkt_drop = gmac_read_reg(tp->base_addr,GMAC_IN_DISCARDS); pkt_drop = gmac_read_reg(tp->base_addr,GMAC_IN_DISCARDS);
pkt_error = gmac_read_reg(tp->base_addr,GMAC_IN_ERRORS); pkt_error = gmac_read_reg(tp->base_addr,GMAC_IN_ERRORS);
@ -350,7 +348,7 @@ Index: linux-2.6.23.17/drivers/net/sl351x_gmac.c
return &tp->ifStatics; return &tp->ifStatics;
} }
@@ -2401,36 +2419,63 @@ static int gmac_close(struct net_device @@ -2401,36 +2419,63 @@
* toe_gmac_fill_free_q * toe_gmac_fill_free_q
* allocate buffers for free queue. * allocate buffers for free queue.
*----------------------------------------------------------------------*/ *----------------------------------------------------------------------*/
@ -427,7 +425,7 @@ Index: linux-2.6.23.17/drivers/net/sl351x_gmac.c
} }
// EXPORT_SYMBOL(toe_gmac_fill_free_q); // EXPORT_SYMBOL(toe_gmac_fill_free_q);
@@ -2442,14 +2487,14 @@ static void gmac_registers(const char *m @@ -2442,14 +2487,14 @@
unsigned int status3; unsigned int status3;
unsigned int status4; unsigned int status4;
@ -444,7 +442,7 @@ Index: linux-2.6.23.17/drivers/net/sl351x_gmac.c
printk("status: s0:%08X, s1:%08X, s2:%08X, s3:%08X, s4:%08X\n", printk("status: s0:%08X, s1:%08X, s2:%08X, s3:%08X, s4:%08X\n",
status0, status1, status2, status3, status4); status0, status1, status2, status3, status4);
@@ -2468,8 +2513,9 @@ static void gmac_registers(const char *m @@ -2468,8 +2513,9 @@
status3 = readl(TOE_GLOBAL_BASE + GLOBAL_INTERRUPT_SELECT_3_REG); status3 = readl(TOE_GLOBAL_BASE + GLOBAL_INTERRUPT_SELECT_3_REG);
status4 = readl(TOE_GLOBAL_BASE + GLOBAL_INTERRUPT_SELECT_4_REG); status4 = readl(TOE_GLOBAL_BASE + GLOBAL_INTERRUPT_SELECT_4_REG);
@ -456,7 +454,7 @@ Index: linux-2.6.23.17/drivers/net/sl351x_gmac.c
} }
/*---------------------------------------------------------------------- /*----------------------------------------------------------------------
* toe_gmac_interrupt * toe_gmac_interrupt
@@ -2485,75 +2531,44 @@ static irqreturn_t toe_gmac_interrupt (i @@ -2485,75 +2531,44 @@
unsigned int status3; unsigned int status3;
unsigned int status4; unsigned int status4;
@ -551,7 +549,7 @@ Index: linux-2.6.23.17/drivers/net/sl351x_gmac.c
{ {
#define G1_INTR0_BITS (GMAC1_HWTQ13_EOF_INT_BIT | GMAC1_HWTQ12_EOF_INT_BIT | GMAC1_HWTQ11_EOF_INT_BIT | GMAC1_HWTQ10_EOF_INT_BIT) #define G1_INTR0_BITS (GMAC1_HWTQ13_EOF_INT_BIT | GMAC1_HWTQ12_EOF_INT_BIT | GMAC1_HWTQ11_EOF_INT_BIT | GMAC1_HWTQ10_EOF_INT_BIT)
#define G0_INTR0_BITS (GMAC0_HWTQ03_EOF_INT_BIT | GMAC0_HWTQ02_EOF_INT_BIT | GMAC0_HWTQ01_EOF_INT_BIT | GMAC0_HWTQ00_EOF_INT_BIT) #define G0_INTR0_BITS (GMAC0_HWTQ03_EOF_INT_BIT | GMAC0_HWTQ02_EOF_INT_BIT | GMAC0_HWTQ01_EOF_INT_BIT | GMAC0_HWTQ00_EOF_INT_BIT)
@@ -2563,7 +2578,7 @@ if (1) @@ -2563,7 +2578,7 @@
// because they should pass packets to upper layer // because they should pass packets to upper layer
if (tp->port_id == 0) if (tp->port_id == 0)
{ {
@ -560,7 +558,7 @@ Index: linux-2.6.23.17/drivers/net/sl351x_gmac.c
{ {
if (status1 & GMAC0_HWTQ03_EOF_INT_BIT) if (status1 & GMAC0_HWTQ03_EOF_INT_BIT)
tp->hwtxq[3].eof_cnt++; tp->hwtxq[3].eof_cnt++;
@@ -2574,50 +2589,51 @@ if (1) @@ -2574,50 +2589,51 @@
if (status1 & GMAC0_HWTQ00_EOF_INT_BIT) if (status1 & GMAC0_HWTQ00_EOF_INT_BIT)
tp->hwtxq[0].eof_cnt++; tp->hwtxq[0].eof_cnt++;
} }
@ -648,7 +646,7 @@ Index: linux-2.6.23.17/drivers/net/sl351x_gmac.c
{ {
if (status1 & GMAC1_HWTQ13_EOF_INT_BIT) if (status1 & GMAC1_HWTQ13_EOF_INT_BIT)
tp->hwtxq[3].eof_cnt++; tp->hwtxq[3].eof_cnt++;
@@ -2629,14 +2645,14 @@ if (1) @@ -2629,14 +2645,14 @@
tp->hwtxq[0].eof_cnt++; tp->hwtxq[0].eof_cnt++;
} }
@ -667,7 +665,7 @@ Index: linux-2.6.23.17/drivers/net/sl351x_gmac.c
BUG_ON(rx_poll_enabled == 1); BUG_ON(rx_poll_enabled == 1);
@@ -2646,7 +2662,7 @@ if (1) @@ -2646,7 +2662,7 @@
data32 &= ~(DEFAULT_Q1_INT_BIT); data32 &= ~(DEFAULT_Q1_INT_BIT);
writel(data32, TOE_GLOBAL_BASE + GLOBAL_INTERRUPT_ENABLE_1_REG); writel(data32, TOE_GLOBAL_BASE + GLOBAL_INTERRUPT_ENABLE_1_REG);
@ -676,7 +674,7 @@ Index: linux-2.6.23.17/drivers/net/sl351x_gmac.c
data32 = readl(TOE_GLOBAL_BASE + GLOBAL_INTERRUPT_ENABLE_4_REG); data32 = readl(TOE_GLOBAL_BASE + GLOBAL_INTERRUPT_ENABLE_4_REG);
data32 &= ~DEFAULT_Q1_INT_BIT; data32 &= ~DEFAULT_Q1_INT_BIT;
writel(data32, TOE_GLOBAL_BASE + GLOBAL_INTERRUPT_ENABLE_4_REG); writel(data32, TOE_GLOBAL_BASE + GLOBAL_INTERRUPT_ENABLE_4_REG);
@@ -2656,24 +2672,21 @@ if (1) @@ -2656,24 +2672,21 @@
writel(data32, TOE_GLOBAL_BASE + GLOBAL_INTERRUPT_SELECT_4_REG); writel(data32, TOE_GLOBAL_BASE + GLOBAL_INTERRUPT_SELECT_4_REG);
#endif #endif
@ -708,7 +706,7 @@ Index: linux-2.6.23.17/drivers/net/sl351x_gmac.c
} }
// Interrupt Status 0 // Interrupt Status 0
@@ -2814,676 +2827,93 @@ if (1) @@ -2814,676 +2827,93 @@
} }
} }
@ -1459,7 +1457,7 @@ Index: linux-2.6.23.17/drivers/net/sl351x_gmac.c
{ {
case GMAC_PHY_GMII: case GMAC_PHY_GMII:
mii_write(tp->phy_addr,0x04,0x05e1); /* advertisement 100M full duplex, pause capable on */ mii_write(tp->phy_addr,0x04,0x05e1); /* advertisement 100M full duplex, pause capable on */
@@ -3552,6 +2982,7 @@ void gmac_set_phy_status(struct net_devi @@ -3552,6 +2982,7 @@
status.bits.link = LINK_DOWN; status.bits.link = LINK_DOWN;
// clear_bit(__LINK_STATE_START, &dev->state); // clear_bit(__LINK_STATE_START, &dev->state);
printk("Link Down (0x%04x) ", reg_val); printk("Link Down (0x%04x) ", reg_val);
@ -1467,7 +1465,7 @@ Index: linux-2.6.23.17/drivers/net/sl351x_gmac.c
if(Giga_switch == 1) if(Giga_switch == 1)
{ {
wan_port_id = 1; wan_port_id = 1;
@@ -3565,6 +2996,7 @@ void gmac_set_phy_status(struct net_devi @@ -3565,6 +2996,7 @@
storlink_ctl.link[ tp->port_id] = 0; storlink_ctl.link[ tp->port_id] = 0;
#endif #endif
} }
@ -1475,7 +1473,7 @@ Index: linux-2.6.23.17/drivers/net/sl351x_gmac.c
} }
else else
{ {
@@ -3572,6 +3004,7 @@ void gmac_set_phy_status(struct net_devi @@ -3572,6 +3004,7 @@
status.bits.link = LINK_UP; status.bits.link = LINK_UP;
// set_bit(__LINK_STATE_START, &dev->state); // set_bit(__LINK_STATE_START, &dev->state);
printk("Link Up (0x%04x) ",reg_val); printk("Link Up (0x%04x) ",reg_val);
@ -1483,7 +1481,7 @@ Index: linux-2.6.23.17/drivers/net/sl351x_gmac.c
if(Giga_switch == 1) if(Giga_switch == 1)
{ {
wan_port_id = 1; wan_port_id = 1;
@@ -3585,6 +3018,7 @@ void gmac_set_phy_status(struct net_devi @@ -3585,6 +3018,7 @@
storlink_ctl.link[ tp->port_id] = 1; storlink_ctl.link[ tp->port_id] = 1;
#endif #endif
} }
@ -1491,7 +1489,7 @@ Index: linux-2.6.23.17/drivers/net/sl351x_gmac.c
} }
// value = mii_read(PHY_ADDR,0x05); // value = mii_read(PHY_ADDR,0x05);
@@ -3863,6 +3297,7 @@ void gmac_get_phy_status(struct net_devi @@ -3863,6 +3297,7 @@
} }
} }
status.bits.link = LINK_UP; /* link up */ status.bits.link = LINK_UP; /* link up */
@ -1499,7 +1497,7 @@ Index: linux-2.6.23.17/drivers/net/sl351x_gmac.c
if(Giga_switch==1) if(Giga_switch==1)
{ {
wan_port_id = 1; wan_port_id = 1;
@@ -3874,6 +3309,7 @@ void gmac_get_phy_status(struct net_devi @@ -3874,6 +3309,7 @@
storlink_ctl.link[ tp->port_id] = 1; storlink_ctl.link[ tp->port_id] = 1;
#endif #endif
} }
@ -1507,7 +1505,7 @@ Index: linux-2.6.23.17/drivers/net/sl351x_gmac.c
if ((ability & 0x20)==0x20) if ((ability & 0x20)==0x20)
{ {
if (tp->flow_control_enable == 0) if (tp->flow_control_enable == 0)
@@ -3914,6 +3350,7 @@ void gmac_get_phy_status(struct net_devi @@ -3914,6 +3350,7 @@
else else
{ {
status.bits.link = LINK_DOWN; /* link down */ status.bits.link = LINK_DOWN; /* link down */
@ -1515,7 +1513,7 @@ Index: linux-2.6.23.17/drivers/net/sl351x_gmac.c
if(Giga_switch == 1) if(Giga_switch == 1)
{ {
wan_port_id = 1; wan_port_id = 1;
@@ -3925,6 +3362,7 @@ void gmac_get_phy_status(struct net_devi @@ -3925,6 +3362,7 @@
storlink_ctl.link[ tp->port_id] = 0; storlink_ctl.link[ tp->port_id] = 0;
#endif #endif
} }
@ -1523,7 +1521,7 @@ Index: linux-2.6.23.17/drivers/net/sl351x_gmac.c
if (tp->pre_phy_status == LINK_UP) if (tp->pre_phy_status == LINK_UP)
{ {
printk("GMAC-%d LINK_Down......\n",tp->port_id); printk("GMAC-%d LINK_Down......\n",tp->port_id);
@@ -4298,86 +3736,102 @@ static void gmac_set_rx_mode(struct net_ @@ -4298,86 +3736,102 @@
} }
#ifdef CONFIG_SL_NAPI #ifdef CONFIG_SL_NAPI
@ -1687,7 +1685,7 @@ Index: linux-2.6.23.17/drivers/net/sl351x_gmac.c
{ {
good_frame = 0; good_frame = 0;
if (curr_desc->word0.bits32 & GMAC_RXDESC_0_T_derr) if (curr_desc->word0.bits32 & GMAC_RXDESC_0_T_derr)
@@ -4388,7 +3842,6 @@ static int gmac_rx_poll(struct net_devic @@ -4388,7 +3842,6 @@
{ {
if (rx_status == 4 || rx_status == 7) if (rx_status == 4 || rx_status == 7)
isPtr->rx_crc_errors++; isPtr->rx_crc_errors++;
@ -1695,7 +1693,7 @@ Index: linux-2.6.23.17/drivers/net/sl351x_gmac.c
} }
#ifdef SL351x_GMAC_WORKAROUND #ifdef SL351x_GMAC_WORKAROUND
else if (pkt_size < 60) else if (pkt_size < 60)
@@ -4407,17 +3860,32 @@ static int gmac_rx_poll(struct net_devic @@ -4407,17 +3860,32 @@
} }
} }
#endif #endif
@ -1733,7 +1731,7 @@ Index: linux-2.6.23.17/drivers/net/sl351x_gmac.c
#ifdef SL351x_GMAC_WORKAROUND #ifdef SL351x_GMAC_WORKAROUND
if (tp->short_frames_cnt >= GMAC_SHORT_FRAME_THRESHOLD) if (tp->short_frames_cnt >= GMAC_SHORT_FRAME_THRESHOLD)
@@ -4432,225 +3900,118 @@ static int gmac_rx_poll(struct net_devic @@ -4432,225 +3900,118 @@
} }
tp->short_frames_cnt = 0; tp->short_frames_cnt = 0;
#endif #endif
@ -2017,7 +2015,7 @@ Index: linux-2.6.23.17/drivers/net/sl351x_gmac.c
} }
#endif #endif
@@ -5114,6 +4475,7 @@ void sl351x_poll_gmac_hanged_status(u32 @@ -5114,6 +4475,7 @@
{ {
sl351x_nat_workaround_cnt++; sl351x_nat_workaround_cnt++;
sl351x_nat_workaround_handler(); sl351x_nat_workaround_handler();
@ -2025,7 +2023,7 @@ Index: linux-2.6.23.17/drivers/net/sl351x_gmac.c
} }
#endif #endif
#endif #endif
@@ -5124,6 +4486,7 @@ void sl351x_poll_gmac_hanged_status(u32 @@ -5124,6 +4486,7 @@
} }
do_workaround: do_workaround:
@ -2033,7 +2031,7 @@ Index: linux-2.6.23.17/drivers/net/sl351x_gmac.c
gmac_initialized = 0; gmac_initialized = 0;
if (hanged_state) if (hanged_state)
@@ -5290,6 +4653,7 @@ static void sl351x_gmac_release_swtx_q(v @@ -5290,6 +4653,7 @@
GMAC_SWTXQ_T *swtxq; GMAC_SWTXQ_T *swtxq;
DMA_RWPTR_T rwptr; DMA_RWPTR_T rwptr;
@ -2041,7 +2039,7 @@ Index: linux-2.6.23.17/drivers/net/sl351x_gmac.c
toe = (TOE_INFO_T *)&toe_private_data; toe = (TOE_INFO_T *)&toe_private_data;
tp = (GMAC_INFO_T *)&toe->gmac[0]; tp = (GMAC_INFO_T *)&toe->gmac[0];
for (i=0; i<GMAC_NUM; i++, tp++) for (i=0; i<GMAC_NUM; i++, tp++)
@@ -5341,6 +4705,7 @@ static void sl351x_gmac_release_rx_q(voi @@ -5341,6 +4705,7 @@
volatile GMAC_RXDESC_T *curr_desc; volatile GMAC_RXDESC_T *curr_desc;
struct sk_buff *skb; struct sk_buff *skb;
@ -2049,7 +2047,7 @@ Index: linux-2.6.23.17/drivers/net/sl351x_gmac.c
toe = (TOE_INFO_T *)&toe_private_data; toe = (TOE_INFO_T *)&toe_private_data;
tp = (GMAC_INFO_T *)&toe->gmac[0]; tp = (GMAC_INFO_T *)&toe->gmac[0];
for (i=0; i<GMAC_NUM; i++, tp++) for (i=0; i<GMAC_NUM; i++, tp++)
@@ -5374,6 +4739,7 @@ static void sl351x_gmac_release_class_q( @@ -5374,6 +4739,7 @@
volatile GMAC_RXDESC_T *curr_desc; volatile GMAC_RXDESC_T *curr_desc;
struct sk_buff *skb; struct sk_buff *skb;
@ -2057,7 +2055,7 @@ Index: linux-2.6.23.17/drivers/net/sl351x_gmac.c
toe = (TOE_INFO_T *)&toe_private_data; toe = (TOE_INFO_T *)&toe_private_data;
classq = (CLASSQ_INFO_T *)&toe->classq[0]; classq = (CLASSQ_INFO_T *)&toe->classq[0];
for (i=0; i<TOE_CLASS_QUEUE_NUM; i++, classq++) for (i=0; i<TOE_CLASS_QUEUE_NUM; i++, classq++)
@@ -5410,6 +4776,7 @@ static void sl351x_gmac_release_toe_q(vo @@ -5410,6 +4776,7 @@
GMAC_RXDESC_T *toe_curr_desc; GMAC_RXDESC_T *toe_curr_desc;
struct sk_buff *skb; struct sk_buff *skb;
@ -2065,10 +2063,8 @@ Index: linux-2.6.23.17/drivers/net/sl351x_gmac.c
toe = (TOE_INFO_T *)&toe_private_data; toe = (TOE_INFO_T *)&toe_private_data;
toe_qhdr = (TOE_QHDR_T *)TOE_TOE_QUE_HDR_BASE; toe_qhdr = (TOE_QHDR_T *)TOE_TOE_QUE_HDR_BASE;
for (i=0; i<TOE_TOE_QUEUE_NUM; i++, toe_qhdr++) for (i=0; i<TOE_TOE_QUEUE_NUM; i++, toe_qhdr++)
Index: linux-2.6.23.17/include/asm-arm/arch-sl2312/sl351x_gmac.h --- a/include/asm-arm/arch-sl2312/sl351x_gmac.h
=================================================================== +++ b/include/asm-arm/arch-sl2312/sl351x_gmac.h
--- linux-2.6.23.17.orig/include/asm-arm/arch-sl2312/sl351x_gmac.h
+++ linux-2.6.23.17/include/asm-arm/arch-sl2312/sl351x_gmac.h
@@ -107,7 +107,7 @@ @@ -107,7 +107,7 @@
* The base address and descriptor number are configured at * The base address and descriptor number are configured at
* DMA Queues Descriptor Ring Base Address/Size Register (offset 0x0004) * DMA Queues Descriptor Ring Base Address/Size Register (offset 0x0004)

View File

@ -1,8 +1,6 @@
Index: linux-2.6.23.17/drivers/mtd/chips/Kconfig --- a/drivers/mtd/chips/Kconfig
=================================================================== +++ b/drivers/mtd/chips/Kconfig
--- linux-2.6.23.17.orig/drivers/mtd/chips/Kconfig @@ -220,6 +220,13 @@
+++ linux-2.6.23.17/drivers/mtd/chips/Kconfig
@@ -220,6 +220,13 @@ config MTD_ROM
This option enables basic support for ROM chips accessed through This option enables basic support for ROM chips accessed through
a bus mapping driver. a bus mapping driver.
@ -16,10 +14,8 @@ Index: linux-2.6.23.17/drivers/mtd/chips/Kconfig
config MTD_ABSENT config MTD_ABSENT
tristate "Support for absent chips in bus mapping" tristate "Support for absent chips in bus mapping"
help help
Index: linux-2.6.23.17/drivers/mtd/chips/cfi_cmdset_0002.c --- a/drivers/mtd/chips/cfi_cmdset_0002.c
=================================================================== +++ b/drivers/mtd/chips/cfi_cmdset_0002.c
--- linux-2.6.23.17.orig/drivers/mtd/chips/cfi_cmdset_0002.c
+++ linux-2.6.23.17/drivers/mtd/chips/cfi_cmdset_0002.c
@@ -39,10 +39,15 @@ @@ -39,10 +39,15 @@
#include <linux/mtd/cfi.h> #include <linux/mtd/cfi.h>
#include <linux/mtd/xip.h> #include <linux/mtd/xip.h>
@ -39,7 +35,7 @@ Index: linux-2.6.23.17/drivers/mtd/chips/cfi_cmdset_0002.c
#define MANUFACTURER_AMD 0x0001 #define MANUFACTURER_AMD 0x0001
#define MANUFACTURER_ATMEL 0x001F #define MANUFACTURER_ATMEL 0x001F
@@ -322,6 +327,13 @@ struct mtd_info *cfi_cmdset_0002(struct @@ -322,6 +327,13 @@
#endif #endif
bootloc = extp->TopBottom; bootloc = extp->TopBottom;
@ -53,7 +49,7 @@ Index: linux-2.6.23.17/drivers/mtd/chips/cfi_cmdset_0002.c
if ((bootloc != 2) && (bootloc != 3)) { if ((bootloc != 2) && (bootloc != 3)) {
printk(KERN_WARNING "%s: CFI does not contain boot " printk(KERN_WARNING "%s: CFI does not contain boot "
"bank location. Assuming top.\n", map->name); "bank location. Assuming top.\n", map->name);
@@ -340,6 +352,9 @@ struct mtd_info *cfi_cmdset_0002(struct @@ -340,6 +352,9 @@
cfi->cfiq->EraseRegionInfo[j] = swap; cfi->cfiq->EraseRegionInfo[j] = swap;
} }
} }
@ -63,7 +59,7 @@ Index: linux-2.6.23.17/drivers/mtd/chips/cfi_cmdset_0002.c
/* Set the default CFI lock/unlock addresses */ /* Set the default CFI lock/unlock addresses */
cfi->addr_unlock1 = 0x555; cfi->addr_unlock1 = 0x555;
cfi->addr_unlock2 = 0x2aa; cfi->addr_unlock2 = 0x2aa;
@@ -461,6 +476,7 @@ static int __xipram chip_ready(struct ma @@ -461,6 +476,7 @@
map_word d, t; map_word d, t;
d = map_read(map, addr); d = map_read(map, addr);
@ -71,7 +67,7 @@ Index: linux-2.6.23.17/drivers/mtd/chips/cfi_cmdset_0002.c
t = map_read(map, addr); t = map_read(map, addr);
return map_word_equal(map, d, t); return map_word_equal(map, d, t);
@@ -626,7 +642,9 @@ static void put_chip(struct map_info *ma @@ -626,7 +642,9 @@
default: default:
printk(KERN_ERR "MTD: put_chip() called with oldstate %d!!\n", chip->oldstate); printk(KERN_ERR "MTD: put_chip() called with oldstate %d!!\n", chip->oldstate);
} }
@ -81,7 +77,7 @@ Index: linux-2.6.23.17/drivers/mtd/chips/cfi_cmdset_0002.c
} }
#ifdef CONFIG_MTD_XIP #ifdef CONFIG_MTD_XIP
@@ -940,7 +958,9 @@ static inline int do_read_secsi_onechip( @@ -940,7 +958,9 @@
cfi_send_gen_cmd(0x90, cfi->addr_unlock1, chip->start, map, cfi, cfi->device_type, NULL); cfi_send_gen_cmd(0x90, cfi->addr_unlock1, chip->start, map, cfi, cfi->device_type, NULL);
cfi_send_gen_cmd(0x00, cfi->addr_unlock1, chip->start, map, cfi, cfi->device_type, NULL); cfi_send_gen_cmd(0x00, cfi->addr_unlock1, chip->start, map, cfi, cfi->device_type, NULL);
@ -91,7 +87,7 @@ Index: linux-2.6.23.17/drivers/mtd/chips/cfi_cmdset_0002.c
spin_unlock(chip->mutex); spin_unlock(chip->mutex);
return 0; return 0;
@@ -1005,7 +1025,10 @@ static int __xipram do_write_oneword(str @@ -1005,7 +1025,10 @@
*/ */
unsigned long uWriteTimeout = ( HZ / 1000 ) + 1; unsigned long uWriteTimeout = ( HZ / 1000 ) + 1;
int ret = 0; int ret = 0;
@ -103,7 +99,7 @@ Index: linux-2.6.23.17/drivers/mtd/chips/cfi_cmdset_0002.c
int retry_cnt = 0; int retry_cnt = 0;
adr += chip->start; adr += chip->start;
@@ -1037,9 +1060,15 @@ static int __xipram do_write_oneword(str @@ -1037,9 +1060,15 @@
ENABLE_VPP(map); ENABLE_VPP(map);
xip_disable(map, chip, adr); xip_disable(map, chip, adr);
retry: retry:
@ -119,7 +115,7 @@ Index: linux-2.6.23.17/drivers/mtd/chips/cfi_cmdset_0002.c
map_write(map, datum, adr); map_write(map, datum, adr);
chip->state = FL_WRITING; chip->state = FL_WRITING;
@@ -1072,7 +1101,13 @@ static int __xipram do_write_oneword(str @@ -1072,7 +1101,13 @@
} }
if (chip_ready(map, adr)) if (chip_ready(map, adr))
@ -134,7 +130,7 @@ Index: linux-2.6.23.17/drivers/mtd/chips/cfi_cmdset_0002.c
/* Latency issues. Drop the lock, wait a while and retry */ /* Latency issues. Drop the lock, wait a while and retry */
UDELAY(map, chip, adr, 1); UDELAY(map, chip, adr, 1);
@@ -1084,8 +1119,17 @@ static int __xipram do_write_oneword(str @@ -1084,8 +1119,17 @@
/* FIXME - should have reset delay before continuing */ /* FIXME - should have reset delay before continuing */
if (++retry_cnt <= MAX_WORD_RETRIES) if (++retry_cnt <= MAX_WORD_RETRIES)
@ -153,7 +149,7 @@ Index: linux-2.6.23.17/drivers/mtd/chips/cfi_cmdset_0002.c
ret = -EIO; ret = -EIO;
} }
xip_enable(map, chip, adr); xip_enable(map, chip, adr);
@@ -1171,7 +1215,14 @@ static int cfi_amdstd_write_words(struct @@ -1171,7 +1215,14 @@
return 0; return 0;
} }
} }
@ -169,7 +165,7 @@ Index: linux-2.6.23.17/drivers/mtd/chips/cfi_cmdset_0002.c
/* We are now aligned, write as much as possible */ /* We are now aligned, write as much as possible */
while(len >= map_bankwidth(map)) { while(len >= map_bankwidth(map)) {
map_word datum; map_word datum;
@@ -1181,7 +1232,15 @@ static int cfi_amdstd_write_words(struct @@ -1181,7 +1232,15 @@
ret = do_write_oneword(map, &cfi->chips[chipnum], ret = do_write_oneword(map, &cfi->chips[chipnum],
ofs, datum); ofs, datum);
if (ret) if (ret)
@ -185,7 +181,7 @@ Index: linux-2.6.23.17/drivers/mtd/chips/cfi_cmdset_0002.c
ofs += map_bankwidth(map); ofs += map_bankwidth(map);
buf += map_bankwidth(map); buf += map_bankwidth(map);
@@ -1189,19 +1248,38 @@ static int cfi_amdstd_write_words(struct @@ -1189,19 +1248,38 @@
len -= map_bankwidth(map); len -= map_bankwidth(map);
if (ofs >> cfi->chipshift) { if (ofs >> cfi->chipshift) {
@ -224,7 +220,7 @@ Index: linux-2.6.23.17/drivers/mtd/chips/cfi_cmdset_0002.c
spin_lock(cfi->chips[chipnum].mutex); spin_lock(cfi->chips[chipnum].mutex);
if (cfi->chips[chipnum].state != FL_READY) { if (cfi->chips[chipnum].state != FL_READY) {
@@ -1221,7 +1299,11 @@ static int cfi_amdstd_write_words(struct @@ -1221,7 +1299,11 @@
#endif #endif
goto retry1; goto retry1;
} }
@ -237,7 +233,7 @@ Index: linux-2.6.23.17/drivers/mtd/chips/cfi_cmdset_0002.c
tmp_buf = map_read(map, ofs + chipstart); tmp_buf = map_read(map, ofs + chipstart);
spin_unlock(cfi->chips[chipnum].mutex); spin_unlock(cfi->chips[chipnum].mutex);
@@ -1231,11 +1313,23 @@ static int cfi_amdstd_write_words(struct @@ -1231,11 +1313,23 @@
ret = do_write_oneword(map, &cfi->chips[chipnum], ret = do_write_oneword(map, &cfi->chips[chipnum],
ofs, tmp_buf); ofs, tmp_buf);
if (ret) if (ret)
@ -262,7 +258,7 @@ Index: linux-2.6.23.17/drivers/mtd/chips/cfi_cmdset_0002.c
return 0; return 0;
} }
@@ -1275,6 +1369,7 @@ static int __xipram do_write_buffer(stru @@ -1275,6 +1369,7 @@
ENABLE_VPP(map); ENABLE_VPP(map);
xip_disable(map, chip, cmd_adr); xip_disable(map, chip, cmd_adr);
@ -270,7 +266,7 @@ Index: linux-2.6.23.17/drivers/mtd/chips/cfi_cmdset_0002.c
cfi_send_gen_cmd(0xAA, cfi->addr_unlock1, chip->start, map, cfi, cfi->device_type, NULL); cfi_send_gen_cmd(0xAA, cfi->addr_unlock1, chip->start, map, cfi, cfi->device_type, NULL);
cfi_send_gen_cmd(0x55, cfi->addr_unlock2, chip->start, map, cfi, cfi->device_type, NULL); cfi_send_gen_cmd(0x55, cfi->addr_unlock2, chip->start, map, cfi, cfi->device_type, NULL);
//cfi_send_gen_cmd(0xA0, cfi->addr_unlock1, chip->start, map, cfi, cfi->device_type, NULL); //cfi_send_gen_cmd(0xA0, cfi->addr_unlock1, chip->start, map, cfi, cfi->device_type, NULL);
@@ -1535,6 +1630,9 @@ static int __xipram do_erase_oneblock(st @@ -1535,6 +1630,9 @@
DECLARE_WAITQUEUE(wait, current); DECLARE_WAITQUEUE(wait, current);
int ret = 0; int ret = 0;
@ -280,7 +276,7 @@ Index: linux-2.6.23.17/drivers/mtd/chips/cfi_cmdset_0002.c
adr += chip->start; adr += chip->start;
spin_lock(chip->mutex); spin_lock(chip->mutex);
@@ -1613,6 +1711,9 @@ static int __xipram do_erase_oneblock(st @@ -1613,6 +1711,9 @@
chip->state = FL_READY; chip->state = FL_READY;
put_chip(map, chip, adr); put_chip(map, chip, adr);
spin_unlock(chip->mutex); spin_unlock(chip->mutex);
@ -290,10 +286,8 @@ Index: linux-2.6.23.17/drivers/mtd/chips/cfi_cmdset_0002.c
return ret; return ret;
} }
Index: linux-2.6.23.17/drivers/mtd/chips/map_serial.c
===================================================================
--- /dev/null --- /dev/null
+++ linux-2.6.23.17/drivers/mtd/chips/map_serial.c +++ b/drivers/mtd/chips/map_serial.c
@@ -0,0 +1,188 @@ @@ -0,0 +1,188 @@
+/* +/*
+ * Common code to handle map devices which are simple ROM + * Common code to handle map devices which are simple ROM
@ -483,11 +477,9 @@ Index: linux-2.6.23.17/drivers/mtd/chips/map_serial.c
+MODULE_LICENSE("GPL"); +MODULE_LICENSE("GPL");
+MODULE_AUTHOR("David Woodhouse <dwmw2@infradead.org>"); +MODULE_AUTHOR("David Woodhouse <dwmw2@infradead.org>");
+MODULE_DESCRIPTION("MTD chip driver for ROM chips"); +MODULE_DESCRIPTION("MTD chip driver for ROM chips");
Index: linux-2.6.23.17/drivers/mtd/maps/Kconfig --- a/drivers/mtd/maps/Kconfig
=================================================================== +++ b/drivers/mtd/maps/Kconfig
--- linux-2.6.23.17.orig/drivers/mtd/maps/Kconfig @@ -614,5 +614,30 @@
+++ linux-2.6.23.17/drivers/mtd/maps/Kconfig
@@ -614,5 +614,30 @@ config MTD_PLATRAM
This selection automatically selects the map_ram driver. This selection automatically selects the map_ram driver.
@ -518,10 +510,8 @@ Index: linux-2.6.23.17/drivers/mtd/maps/Kconfig
+ +
endmenu endmenu
Index: linux-2.6.23.17/drivers/mtd/maps/sl2312-flash-atmel.c
===================================================================
--- /dev/null --- /dev/null
+++ linux-2.6.23.17/drivers/mtd/maps/sl2312-flash-atmel.c +++ b/drivers/mtd/maps/sl2312-flash-atmel.c
@@ -0,0 +1,554 @@ @@ -0,0 +1,554 @@
+/* +/*
+ * $Id: sl2312-flash-atmel.c,v 1.2 2006/06/05 02:35:57 middle Exp $ + * $Id: sl2312-flash-atmel.c,v 1.2 2006/06/05 02:35:57 middle Exp $
@ -1077,10 +1067,8 @@ Index: linux-2.6.23.17/drivers/mtd/maps/sl2312-flash-atmel.c
+MODULE_AUTHOR("Plus Chen <plus@storlink.com.tw>"); +MODULE_AUTHOR("Plus Chen <plus@storlink.com.tw>");
+MODULE_DESCRIPTION("MTD map driver for Storlink Sword boards"); +MODULE_DESCRIPTION("MTD map driver for Storlink Sword boards");
+ +
Index: linux-2.6.23.17/drivers/mtd/maps/sl2312-flash-cfi.c
===================================================================
--- /dev/null --- /dev/null
+++ linux-2.6.23.17/drivers/mtd/maps/sl2312-flash-cfi.c +++ b/drivers/mtd/maps/sl2312-flash-cfi.c
@@ -0,0 +1,370 @@ @@ -0,0 +1,370 @@
+/*====================================================================== +/*======================================================================
+ +
@ -1452,10 +1440,8 @@ Index: linux-2.6.23.17/drivers/mtd/maps/sl2312-flash-cfi.c
+MODULE_AUTHOR("Storlink Ltd"); +MODULE_AUTHOR("Storlink Ltd");
+MODULE_DESCRIPTION("CFI map driver"); +MODULE_DESCRIPTION("CFI map driver");
+MODULE_LICENSE("GPL"); +MODULE_LICENSE("GPL");
Index: linux-2.6.23.17/drivers/mtd/maps/sl2312-flash-m25p80.c
===================================================================
--- /dev/null --- /dev/null
+++ linux-2.6.23.17/drivers/mtd/maps/sl2312-flash-m25p80.c +++ b/drivers/mtd/maps/sl2312-flash-m25p80.c
@@ -0,0 +1,498 @@ @@ -0,0 +1,498 @@
+/* +/*
+ * $Id: sl2312-flash-m25p80.c,v 1.2 2006/06/02 08:46:02 middle Exp $ + * $Id: sl2312-flash-m25p80.c,v 1.2 2006/06/02 08:46:02 middle Exp $
@ -1955,10 +1941,8 @@ Index: linux-2.6.23.17/drivers/mtd/maps/sl2312-flash-m25p80.c
+MODULE_AUTHOR("Plus Chen <plus@storlink.com.tw>"); +MODULE_AUTHOR("Plus Chen <plus@storlink.com.tw>");
+MODULE_DESCRIPTION("MTD map driver for Storlink Sword boards"); +MODULE_DESCRIPTION("MTD map driver for Storlink Sword boards");
+ +
Index: linux-2.6.23.17/drivers/mtd/maps/sl2312_flashmap.h
===================================================================
--- /dev/null --- /dev/null
+++ linux-2.6.23.17/drivers/mtd/maps/sl2312_flashmap.h +++ b/drivers/mtd/maps/sl2312_flashmap.h
@@ -0,0 +1,21 @@ @@ -0,0 +1,21 @@
+/* +/*
+ * Please note that the name are used in mkflash script. Therefore + * Please note that the name are used in mkflash script. Therefore
@ -1974,17 +1958,15 @@ Index: linux-2.6.23.17/drivers/mtd/maps/sl2312_flashmap.h
+ +
+static struct mtd_partition sl2312_partitions[] = { +static struct mtd_partition sl2312_partitions[] = {
+ { name: "RedBoot", offset: 0x00000000, size: 0x00020000, }, + { name: "RedBoot", offset: 0x00000000, size: 0x00020000, },
+ { name: "Kernel", offset: 0x00020000, size: 0x00100000, }, + { name: "kernel", offset: 0x00020000, size: 0x00100000, },
+ { name: "Ramdisk", offset: 0x00120000, size: 0x00500000, }, + { name: "rootfs", offset: 0x00120000, size: 0x00500000, },
+ { name: "etc", offset: 0x00620000, size: 0x001A0000, }, + { name: "rootfs_data", offset: 0x00620000, size: 0x001A0000, },
+ { name: "VCTL", offset: 0x007C0000, size: 0x00010000, }, + { name: "VCTL", offset: 0x007C0000, size: 0x00010000, },
+ { name: "cfg", offset: 0x007D0000, size: 0x00020000, }, + { name: "cfg", offset: 0x007D0000, size: 0x00020000, },
+ { name: "FIS directory", offset: 0x007F0000, size: 0x00010000, } + { name: "FIS directory", offset: 0x007F0000, size: 0x00010000, }
+}; +};
Index: linux-2.6.23.17/drivers/mtd/maps/sl2312_flashmap.h.16MB
===================================================================
--- /dev/null --- /dev/null
+++ linux-2.6.23.17/drivers/mtd/maps/sl2312_flashmap.h.16MB +++ b/drivers/mtd/maps/sl2312_flashmap.h.16MB
@@ -0,0 +1,21 @@ @@ -0,0 +1,21 @@
+/* +/*
+ * Please note that the name are used in mkflash script. Therefore + * Please note that the name are used in mkflash script. Therefore
@ -2007,10 +1989,8 @@ Index: linux-2.6.23.17/drivers/mtd/maps/sl2312_flashmap.h.16MB
+ { name: "CurConf", offset: 0x00F40000, size: 0x000A0000, }, + { name: "CurConf", offset: 0x00F40000, size: 0x000A0000, },
+ { name: "FIS directory", offset: 0x00FE0000, size: 0x00020000, } + { name: "FIS directory", offset: 0x00FE0000, size: 0x00020000, }
+}; +};
Index: linux-2.6.23.17/drivers/mtd/maps/sl2312_flashmap.h.8MB
===================================================================
--- /dev/null --- /dev/null
+++ linux-2.6.23.17/drivers/mtd/maps/sl2312_flashmap.h.8MB +++ b/drivers/mtd/maps/sl2312_flashmap.h.8MB
@@ -0,0 +1,21 @@ @@ -0,0 +1,21 @@
+/* +/*
+ * Please note that the name are used in mkflash script. Therefore + * Please note that the name are used in mkflash script. Therefore
@ -2033,11 +2013,9 @@ Index: linux-2.6.23.17/drivers/mtd/maps/sl2312_flashmap.h.8MB
+ { name: "CurConf", offset: 0x007C0000, size: 0x00020000, }, + { name: "CurConf", offset: 0x007C0000, size: 0x00020000, },
+ { name: "FIS directory", offset: 0x007E0000, size: 0x00020000, } + { name: "FIS directory", offset: 0x007E0000, size: 0x00020000, }
+}; +};
Index: linux-2.6.23.17/drivers/mtd/mtdchar.c --- a/drivers/mtd/mtdchar.c
=================================================================== +++ b/drivers/mtd/mtdchar.c
--- linux-2.6.23.17.orig/drivers/mtd/mtdchar.c @@ -59,6 +59,77 @@
+++ linux-2.6.23.17/drivers/mtd/mtdchar.c
@@ -59,6 +59,77 @@ struct mtd_file_info {
enum mtd_file_modes mode; enum mtd_file_modes mode;
}; };
@ -2115,7 +2093,7 @@ Index: linux-2.6.23.17/drivers/mtd/mtdchar.c
static loff_t mtd_lseek (struct file *file, loff_t offset, int orig) static loff_t mtd_lseek (struct file *file, loff_t offset, int orig)
{ {
struct mtd_file_info *mfi = file->private_data; struct mtd_file_info *mfi = file->private_data;
@@ -162,13 +233,21 @@ static ssize_t mtd_read(struct file *fil @@ -162,13 +233,21 @@
int len; int len;
char *kbuf; char *kbuf;
@ -2138,7 +2116,7 @@ Index: linux-2.6.23.17/drivers/mtd/mtdchar.c
/* FIXME: Use kiovec in 2.5 to lock down the user's buffers /* FIXME: Use kiovec in 2.5 to lock down the user's buffers
and pass them directly to the MTD functions */ and pass them directly to the MTD functions */
@@ -178,8 +257,12 @@ static ssize_t mtd_read(struct file *fil @@ -178,8 +257,12 @@
else else
kbuf=kmalloc(count, GFP_KERNEL); kbuf=kmalloc(count, GFP_KERNEL);
@ -2152,7 +2130,7 @@ Index: linux-2.6.23.17/drivers/mtd/mtdchar.c
while (count) { while (count) {
@@ -224,6 +307,9 @@ static ssize_t mtd_read(struct file *fil @@ -224,6 +307,9 @@
*ppos += retlen; *ppos += retlen;
if (copy_to_user(buf, kbuf, retlen)) { if (copy_to_user(buf, kbuf, retlen)) {
kfree(kbuf); kfree(kbuf);
@ -2162,7 +2140,7 @@ Index: linux-2.6.23.17/drivers/mtd/mtdchar.c
return -EFAULT; return -EFAULT;
} }
else else
@@ -235,13 +321,19 @@ static ssize_t mtd_read(struct file *fil @@ -235,13 +321,19 @@
count = 0; count = 0;
} }
else { else {
@ -2183,7 +2161,7 @@ Index: linux-2.6.23.17/drivers/mtd/mtdchar.c
return total_retlen; return total_retlen;
} /* mtd_read */ } /* mtd_read */
@@ -255,24 +347,40 @@ static ssize_t mtd_write(struct file *fi @@ -255,24 +347,40 @@
int ret=0; int ret=0;
int len; int len;
@ -2227,7 +2205,7 @@ Index: linux-2.6.23.17/drivers/mtd/mtdchar.c
while (count) { while (count) {
@@ -283,6 +391,9 @@ static ssize_t mtd_write(struct file *fi @@ -283,6 +391,9 @@
if (copy_from_user(kbuf, buf, len)) { if (copy_from_user(kbuf, buf, len)) {
kfree(kbuf); kfree(kbuf);
@ -2237,7 +2215,7 @@ Index: linux-2.6.23.17/drivers/mtd/mtdchar.c
return -EFAULT; return -EFAULT;
} }
@@ -323,11 +434,17 @@ static ssize_t mtd_write(struct file *fi @@ -323,11 +434,17 @@
} }
else { else {
kfree(kbuf); kfree(kbuf);
@ -2255,7 +2233,7 @@ Index: linux-2.6.23.17/drivers/mtd/mtdchar.c
return total_retlen; return total_retlen;
} /* mtd_write */ } /* mtd_write */
@@ -381,36 +498,67 @@ static int mtd_ioctl(struct inode *inode @@ -381,36 +498,67 @@
u_long size; u_long size;
struct mtd_info_user info; struct mtd_info_user info;
@ -2326,7 +2304,7 @@ Index: linux-2.6.23.17/drivers/mtd/mtdchar.c
break; break;
} }
@@ -433,7 +581,12 @@ static int mtd_ioctl(struct inode *inode @@ -433,7 +581,12 @@
struct erase_info *erase; struct erase_info *erase;
if(!(file->f_mode & 2)) if(!(file->f_mode & 2))
@ -2339,7 +2317,7 @@ Index: linux-2.6.23.17/drivers/mtd/mtdchar.c
erase=kzalloc(sizeof(struct erase_info),GFP_KERNEL); erase=kzalloc(sizeof(struct erase_info),GFP_KERNEL);
if (!erase) if (!erase)
@@ -447,6 +600,9 @@ static int mtd_ioctl(struct inode *inode @@ -447,6 +600,9 @@
if (copy_from_user(&erase->addr, argp, if (copy_from_user(&erase->addr, argp,
sizeof(struct erase_info_user))) { sizeof(struct erase_info_user))) {
kfree(erase); kfree(erase);
@ -2349,7 +2327,7 @@ Index: linux-2.6.23.17/drivers/mtd/mtdchar.c
return -EFAULT; return -EFAULT;
} }
erase->mtd = mtd; erase->mtd = mtd;
@@ -484,14 +640,26 @@ static int mtd_ioctl(struct inode *inode @@ -484,14 +640,26 @@
struct mtd_oob_buf buf; struct mtd_oob_buf buf;
struct mtd_oob_ops ops; struct mtd_oob_ops ops;
@ -2379,7 +2357,7 @@ Index: linux-2.6.23.17/drivers/mtd/mtdchar.c
if (!mtd->write_oob) if (!mtd->write_oob)
ret = -EOPNOTSUPP; ret = -EOPNOTSUPP;
@@ -499,8 +667,12 @@ static int mtd_ioctl(struct inode *inode @@ -499,8 +667,12 @@
ret = access_ok(VERIFY_READ, buf.ptr, ret = access_ok(VERIFY_READ, buf.ptr,
buf.length) ? 0 : EFAULT; buf.length) ? 0 : EFAULT;
@ -2393,7 +2371,7 @@ Index: linux-2.6.23.17/drivers/mtd/mtdchar.c
ops.ooblen = buf.length; ops.ooblen = buf.length;
ops.ooboffs = buf.start & (mtd->oobsize - 1); ops.ooboffs = buf.start & (mtd->oobsize - 1);
@@ -536,19 +708,35 @@ static int mtd_ioctl(struct inode *inode @@ -536,19 +708,35 @@
struct mtd_oob_buf buf; struct mtd_oob_buf buf;
struct mtd_oob_ops ops; struct mtd_oob_ops ops;
@ -2433,7 +2411,7 @@ Index: linux-2.6.23.17/drivers/mtd/mtdchar.c
ops.ooblen = buf.length; ops.ooblen = buf.length;
ops.ooboffs = buf.start & (mtd->oobsize - 1); ops.ooboffs = buf.start & (mtd->oobsize - 1);
@@ -580,7 +768,12 @@ static int mtd_ioctl(struct inode *inode @@ -580,7 +768,12 @@
struct erase_info_user info; struct erase_info_user info;
if (copy_from_user(&info, argp, sizeof(info))) if (copy_from_user(&info, argp, sizeof(info)))
@ -2446,7 +2424,7 @@ Index: linux-2.6.23.17/drivers/mtd/mtdchar.c
if (!mtd->lock) if (!mtd->lock)
ret = -EOPNOTSUPP; ret = -EOPNOTSUPP;
@@ -594,7 +787,12 @@ static int mtd_ioctl(struct inode *inode @@ -594,7 +787,12 @@
struct erase_info_user info; struct erase_info_user info;
if (copy_from_user(&info, argp, sizeof(info))) if (copy_from_user(&info, argp, sizeof(info)))
@ -2459,7 +2437,7 @@ Index: linux-2.6.23.17/drivers/mtd/mtdchar.c
if (!mtd->unlock) if (!mtd->unlock)
ret = -EOPNOTSUPP; ret = -EOPNOTSUPP;
@@ -629,11 +827,21 @@ static int mtd_ioctl(struct inode *inode @@ -629,11 +827,21 @@
loff_t offs; loff_t offs;
if (copy_from_user(&offs, argp, sizeof(loff_t))) if (copy_from_user(&offs, argp, sizeof(loff_t)))
@ -2481,7 +2459,7 @@ Index: linux-2.6.23.17/drivers/mtd/mtdchar.c
break; break;
} }
@@ -642,11 +850,21 @@ static int mtd_ioctl(struct inode *inode @@ -642,11 +850,21 @@
loff_t offs; loff_t offs;
if (copy_from_user(&offs, argp, sizeof(loff_t))) if (copy_from_user(&offs, argp, sizeof(loff_t)))
@ -2503,7 +2481,7 @@ Index: linux-2.6.23.17/drivers/mtd/mtdchar.c
break; break;
} }
@@ -654,8 +872,12 @@ static int mtd_ioctl(struct inode *inode @@ -654,8 +872,12 @@
case OTPSELECT: case OTPSELECT:
{ {
int mode; int mode;
@ -2517,7 +2495,7 @@ Index: linux-2.6.23.17/drivers/mtd/mtdchar.c
mfi->mode = MTD_MODE_NORMAL; mfi->mode = MTD_MODE_NORMAL;
@@ -670,7 +892,12 @@ static int mtd_ioctl(struct inode *inode @@ -670,7 +892,12 @@
{ {
struct otp_info *buf = kmalloc(4096, GFP_KERNEL); struct otp_info *buf = kmalloc(4096, GFP_KERNEL);
if (!buf) if (!buf)
@ -2530,7 +2508,7 @@ Index: linux-2.6.23.17/drivers/mtd/mtdchar.c
ret = -EOPNOTSUPP; ret = -EOPNOTSUPP;
switch (mfi->mode) { switch (mfi->mode) {
case MTD_MODE_OTP_FACTORY: case MTD_MODE_OTP_FACTORY:
@@ -701,12 +928,24 @@ static int mtd_ioctl(struct inode *inode @@ -701,12 +928,24 @@
{ {
struct otp_info info; struct otp_info info;
@ -2558,7 +2536,7 @@ Index: linux-2.6.23.17/drivers/mtd/mtdchar.c
ret = mtd->lock_user_prot_reg(mtd, info.start, info.length); ret = mtd->lock_user_prot_reg(mtd, info.start, info.length);
break; break;
} }
@@ -742,8 +981,12 @@ static int mtd_ioctl(struct inode *inode @@ -742,8 +981,12 @@
break; break;
case MTD_MODE_RAW: case MTD_MODE_RAW:
@ -2572,7 +2550,7 @@ Index: linux-2.6.23.17/drivers/mtd/mtdchar.c
mfi->mode = arg; mfi->mode = arg;
case MTD_MODE_NORMAL: case MTD_MODE_NORMAL:
@@ -766,6 +1009,10 @@ static int mtd_ioctl(struct inode *inode @@ -766,6 +1009,10 @@
ret = -ENOTTY; ret = -ENOTTY;
} }
@ -2583,11 +2561,9 @@ Index: linux-2.6.23.17/drivers/mtd/mtdchar.c
return ret; return ret;
} /* memory_ioctl */ } /* memory_ioctl */
Index: linux-2.6.23.17/drivers/mtd/nand/Kconfig --- a/drivers/mtd/nand/Kconfig
=================================================================== +++ b/drivers/mtd/nand/Kconfig
--- linux-2.6.23.17.orig/drivers/mtd/nand/Kconfig @@ -44,6 +44,13 @@
+++ linux-2.6.23.17/drivers/mtd/nand/Kconfig
@@ -44,6 +44,13 @@ config MTD_NAND_AUTCPU12
This enables the driver for the autronix autcpu12 board to This enables the driver for the autronix autcpu12 board to
access the SmartMediaCard. access the SmartMediaCard.
@ -2601,10 +2577,8 @@ Index: linux-2.6.23.17/drivers/mtd/nand/Kconfig
config MTD_NAND_EDB7312 config MTD_NAND_EDB7312
tristate "Support for Cirrus Logic EBD7312 evaluation board" tristate "Support for Cirrus Logic EBD7312 evaluation board"
depends on ARCH_EDB7312 depends on ARCH_EDB7312
Index: linux-2.6.23.17/drivers/mtd/nand/sl2312-flash-nand.c
===================================================================
--- /dev/null --- /dev/null
+++ linux-2.6.23.17/drivers/mtd/nand/sl2312-flash-nand.c +++ b/drivers/mtd/nand/sl2312-flash-nand.c
@@ -0,0 +1,2287 @@ @@ -0,0 +1,2287 @@
+/* +/*
+ * drivers/mtd/sl2312.c + * drivers/mtd/sl2312.c
@ -4893,10 +4867,8 @@ Index: linux-2.6.23.17/drivers/mtd/nand/sl2312-flash-nand.c
+MODULE_LICENSE("GPL"); +MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Alice Hennessy <ahennessy@mvista.com>"); +MODULE_AUTHOR("Alice Hennessy <ahennessy@mvista.com>");
+MODULE_DESCRIPTION("Glue layer for SmartMediaCard on Toshiba RBsl2312"); +MODULE_DESCRIPTION("Glue layer for SmartMediaCard on Toshiba RBsl2312");
Index: linux-2.6.23.17/drivers/mtd/nand/sl2312-flash-nand.h
===================================================================
--- /dev/null --- /dev/null
+++ linux-2.6.23.17/drivers/mtd/nand/sl2312-flash-nand.h +++ b/drivers/mtd/nand/sl2312-flash-nand.h
@@ -0,0 +1,24 @@ @@ -0,0 +1,24 @@
+#ifndef SL2312_FLASH_NAND_H +#ifndef SL2312_FLASH_NAND_H
+#define SL2312_FLASH_NAND_H +#define SL2312_FLASH_NAND_H
@ -4922,10 +4894,8 @@ Index: linux-2.6.23.17/drivers/mtd/nand/sl2312-flash-nand.h
+ +
+ +
+#endif /* SL2312_FLASH_NAND_H */ +#endif /* SL2312_FLASH_NAND_H */
Index: linux-2.6.23.17/include/linux/mtd/kvctl.h
===================================================================
--- /dev/null --- /dev/null
+++ linux-2.6.23.17/include/linux/mtd/kvctl.h +++ b/include/linux/mtd/kvctl.h
@@ -0,0 +1,40 @@ @@ -0,0 +1,40 @@
+#ifndef KVCTL_H +#ifndef KVCTL_H
+#define KVCTL_H +#define KVCTL_H
@ -4967,11 +4937,9 @@ Index: linux-2.6.23.17/include/linux/mtd/kvctl.h
+#define VCT_VLAN 8 +#define VCT_VLAN 8
+ +
+#endif +#endif
Index: linux-2.6.23.17/drivers/mtd/maps/Makefile --- a/drivers/mtd/maps/Makefile
=================================================================== +++ b/drivers/mtd/maps/Makefile
--- linux-2.6.23.17.orig/drivers/mtd/maps/Makefile @@ -71,3 +71,7 @@
+++ linux-2.6.23.17/drivers/mtd/maps/Makefile
@@ -71,3 +71,7 @@ obj-$(CONFIG_MTD_PLATRAM) += plat-ram.o
obj-$(CONFIG_MTD_OMAP_NOR) += omap_nor.o obj-$(CONFIG_MTD_OMAP_NOR) += omap_nor.o
obj-$(CONFIG_MTD_MTX1) += mtx-1_flash.o obj-$(CONFIG_MTD_MTX1) += mtx-1_flash.o
obj-$(CONFIG_MTD_TQM834x) += tqm834x.o obj-$(CONFIG_MTD_TQM834x) += tqm834x.o

View File

@ -1,7 +1,5 @@
Index: linux-2.6.23.17/drivers/serial/it8712.c
===================================================================
--- /dev/null --- /dev/null
+++ linux-2.6.23.17/drivers/serial/it8712.c +++ b/drivers/serial/it8712.c
@@ -0,0 +1,858 @@ @@ -0,0 +1,858 @@
+/* +/*
+ * linux/drivers/char/serial_uart00.c + * linux/drivers/char/serial_uart00.c
@ -861,10 +859,8 @@ Index: linux-2.6.23.17/drivers/serial/it8712.c
+ +
+ +
+__initcall(it8712_init); +__initcall(it8712_init);
Index: linux-2.6.23.17/drivers/serial/it8712.h
===================================================================
--- /dev/null --- /dev/null
+++ linux-2.6.23.17/drivers/serial/it8712.h +++ b/drivers/serial/it8712.h
@@ -0,0 +1,135 @@ @@ -0,0 +1,135 @@
+#define UART_RX 0 /* In: Receive buffer (DLAB=0) */ +#define UART_RX 0 /* In: Receive buffer (DLAB=0) */
+#define UART_TX 0 /* Out: Transmit buffer (DLAB=0) */ +#define UART_TX 0 /* Out: Transmit buffer (DLAB=0) */
@ -1001,10 +997,8 @@ Index: linux-2.6.23.17/drivers/serial/it8712.h
+ +
+ +
+ +
Index: linux-2.6.23.17/drivers/serial/serial_it8712.c
===================================================================
--- /dev/null --- /dev/null
+++ linux-2.6.23.17/drivers/serial/serial_it8712.c +++ b/drivers/serial/serial_it8712.c
@@ -0,0 +1,876 @@ @@ -0,0 +1,876 @@
+/* +/*
+ * linux/drivers/char/serial_uart00.c + * linux/drivers/char/serial_uart00.c
@ -1882,10 +1876,8 @@ Index: linux-2.6.23.17/drivers/serial/serial_it8712.c
+ +
+ +
+__initcall(it8712_init); +__initcall(it8712_init);
Index: linux-2.6.23.17/drivers/serial/serial_sl2312.c
===================================================================
--- /dev/null --- /dev/null
+++ linux-2.6.23.17/drivers/serial/serial_sl2312.c +++ b/drivers/serial/serial_sl2312.c
@@ -0,0 +1,827 @@ @@ -0,0 +1,827 @@
+/* +/*
+ * linux/drivers/char/serial_uart00.c + * linux/drivers/char/serial_uart00.c
@ -1959,7 +1951,7 @@ Index: linux-2.6.23.17/drivers/serial/serial_sl2312.c
+#define UART_NR 1 +#define UART_NR 1
+ +
+ +
+#define SERIAL_SL2312_NAME "ttySL" +#define SERIAL_SL2312_NAME "ttyS"
+#define SERIAL_SL2312_MAJOR 204 +#define SERIAL_SL2312_MAJOR 204
+#define SERIAL_SL2312_MINOR 40 /* Temporary - will change in future */ +#define SERIAL_SL2312_MINOR 40 /* Temporary - will change in future */
+#define SERIAL_SL2312_NR UART_NR +#define SERIAL_SL2312_NR UART_NR
@ -2714,10 +2706,8 @@ Index: linux-2.6.23.17/drivers/serial/serial_sl2312.c
+ +
+ +
+__initcall(sl2312_init); +__initcall(sl2312_init);
Index: linux-2.6.23.17/include/linux/serial_core.h --- a/include/linux/serial_core.h
=================================================================== +++ b/include/linux/serial_core.h
--- linux-2.6.23.17.orig/include/linux/serial_core.h
+++ linux-2.6.23.17/include/linux/serial_core.h
@@ -147,6 +147,10 @@ @@ -147,6 +147,10 @@
#define PORT_SB1250_DUART 77 #define PORT_SB1250_DUART 77
@ -2729,11 +2719,9 @@ Index: linux-2.6.23.17/include/linux/serial_core.h
#ifdef __KERNEL__ #ifdef __KERNEL__
#include <linux/compiler.h> #include <linux/compiler.h>
Index: linux-2.6.23.17/drivers/char/Makefile --- a/drivers/char/Makefile
=================================================================== +++ b/drivers/char/Makefile
--- linux-2.6.23.17.orig/drivers/char/Makefile @@ -70,6 +70,16 @@
+++ linux-2.6.23.17/drivers/char/Makefile
@@ -70,6 +70,16 @@ obj-$(CONFIG_R3964) += n_r3964.o
obj-$(CONFIG_APPLICOM) += applicom.o obj-$(CONFIG_APPLICOM) += applicom.o
obj-$(CONFIG_SONYPI) += sonypi.o obj-$(CONFIG_SONYPI) += sonypi.o
obj-$(CONFIG_RTC) += rtc.o obj-$(CONFIG_RTC) += rtc.o
@ -2750,11 +2738,9 @@ Index: linux-2.6.23.17/drivers/char/Makefile
obj-$(CONFIG_HPET) += hpet.o obj-$(CONFIG_HPET) += hpet.o
obj-$(CONFIG_GEN_RTC) += genrtc.o obj-$(CONFIG_GEN_RTC) += genrtc.o
obj-$(CONFIG_EFI_RTC) += efirtc.o obj-$(CONFIG_EFI_RTC) += efirtc.o
Index: linux-2.6.23.17/drivers/serial/Kconfig --- a/drivers/serial/Kconfig
=================================================================== +++ b/drivers/serial/Kconfig
--- linux-2.6.23.17.orig/drivers/serial/Kconfig @@ -280,6 +280,56 @@
+++ linux-2.6.23.17/drivers/serial/Kconfig
@@ -280,6 +280,56 @@ config SERIAL_8250_RM9K
comment "Non-8250 serial port support" comment "Non-8250 serial port support"
@ -2778,7 +2764,7 @@ Index: linux-2.6.23.17/drivers/serial/Kconfig
+ Even if you say Y here, the currently visible virtual console + Even if you say Y here, the currently visible virtual console
+ (/dev/tty0) will still be used as the system console by default, but + (/dev/tty0) will still be used as the system console by default, but
+ you can alter that using a kernel command line option such as + you can alter that using a kernel command line option such as
+ "console=ttySL0". (Try "man bootparam" or see the documentation of + "console=ttyS0". (Try "man bootparam" or see the documentation of
+ your boot loader (lilo or loadlin) about how to pass options to the + your boot loader (lilo or loadlin) about how to pass options to the
+ kernel at boot time.) + kernel at boot time.)
+ +
@ -2811,11 +2797,9 @@ Index: linux-2.6.23.17/drivers/serial/Kconfig
config SERIAL_AMBA_PL010 config SERIAL_AMBA_PL010
tristate "ARM AMBA PL010 serial port support" tristate "ARM AMBA PL010 serial port support"
depends on ARM_AMBA && (BROKEN || !ARCH_VERSATILE) depends on ARM_AMBA && (BROKEN || !ARCH_VERSATILE)
Index: linux-2.6.23.17/drivers/serial/Makefile --- a/drivers/serial/Makefile
=================================================================== +++ b/drivers/serial/Makefile
--- linux-2.6.23.17.orig/drivers/serial/Makefile @@ -62,5 +62,7 @@
+++ linux-2.6.23.17/drivers/serial/Makefile
@@ -62,5 +62,7 @@ obj-$(CONFIG_SERIAL_SGI_IOC3) += ioc3_se
obj-$(CONFIG_SERIAL_ATMEL) += atmel_serial.o obj-$(CONFIG_SERIAL_ATMEL) += atmel_serial.o
obj-$(CONFIG_SERIAL_UARTLITE) += uartlite.o obj-$(CONFIG_SERIAL_UARTLITE) += uartlite.o
obj-$(CONFIG_SERIAL_NETX) += netx-serial.o obj-$(CONFIG_SERIAL_NETX) += netx-serial.o

View File

@ -0,0 +1,398 @@
--- a/arch/arm/mach-sl2312/sl3516_device.c
+++ b/arch/arm/mach-sl2312/sl3516_device.c
@@ -76,9 +76,30 @@
.resource = sl3516_sata0_resources,
};
+static struct resource sl351x_wdt_resources[] = {
+ [0] = {
+ .start = SL2312_WAQTCHDOG_BASE + 0x00,
+ .end = SL2312_WAQTCHDOG_BASE + 0x1C,
+ .flags = IORESOURCE_MEM,
+ },
+ [1] = {
+ .start = IRQ_WATCHDOG,
+ .end = IRQ_WATCHDOG,
+ .flags = IORESOURCE_IRQ,
+ },
+};
+
+static struct platform_device sl351x_wdt = {
+ .name = "sl351x-wdt",
+ .id = -1,
+ .resource = sl351x_wdt_resources,
+ .num_resources = ARRAY_SIZE(sl351x_wdt_resources),
+};
+
static struct platform_device *sata_devices[] __initdata = {
&sata_device,
&sata0_device,
+ &sl351x_wdt,
};
static int __init sl3516_init(void)
--- a/drivers/char/watchdog/Kconfig
+++ b/drivers/char/watchdog/Kconfig
@@ -171,6 +171,17 @@
To compile this driver as a module, choose M here: the
module will be called ep93xx_wdt.
+config WATCHDOG_SL351X
+ tristate "SL351x Watchdog"
+ depends on WATCHDOG && ARCH_SL2312
+ help
+ This driver adds watchdog support for the integrated watchdog in the
+ SL351x processors (Farraday core). If you have one of these processors
+ and wish to have watchdog support enabled, say Y, otherwise say N.
+
+ To compile this driver as a module, choose M here: the
+ module will be called sl351x_wdt.
+
config OMAP_WATCHDOG
tristate "OMAP Watchdog"
depends on ARCH_OMAP16XX || ARCH_OMAP24XX
--- a/drivers/char/watchdog/Makefile
+++ b/drivers/char/watchdog/Makefile
@@ -36,6 +36,7 @@
obj-$(CONFIG_SA1100_WATCHDOG) += sa1100_wdt.o
obj-$(CONFIG_MPCORE_WATCHDOG) += mpcore_wdt.o
obj-$(CONFIG_EP93XX_WATCHDOG) += ep93xx_wdt.o
+obj-$(CONFIG_WATCHDOG_SL351X) += sl351x_wdt.o
obj-$(CONFIG_PNX4008_WATCHDOG) += pnx4008_wdt.o
obj-$(CONFIG_IOP_WATCHDOG) += iop_wdt.o
obj-$(CONFIG_DAVINCI_WATCHDOG) += davinci_wdt.o
--- /dev/null
+++ b/drivers/char/watchdog/sl351x_wdt.c
@@ -0,0 +1,332 @@
+#include <linux/module.h>
+#include <linux/types.h>
+#include <linux/fs.h>
+#include <linux/mm.h>
+#include <linux/errno.h>
+#include <linux/init.h>
+#include <linux/miscdevice.h>
+#include <linux/watchdog.h>
+#include <linux/platform_device.h>
+#include <asm/uaccess.h>
+#include <asm/arch/sl2312.h>
+#include <asm/arch/hardware.h>
+#include <asm/arch/irqs.h>
+#include <asm/arch/watchdog.h>
+#include <asm/io.h>
+#include <linux/interrupt.h>
+
+#define WATCHDOG_TEST 1
+#define PFX "sl351x-wdt: "
+
+#define _WATCHDOG_COUNTER 0x00
+#define _WATCHDOG_LOAD 0x04
+#define _WATCHDOG_RESTART 0x08
+#define _WATCHDOG_CR 0x0C
+#define _WATCHDOG_STATUS 0x10
+#define _WATCHDOG_CLEAR 0x14
+#define _WATCHDOG_INTRLEN 0x18
+
+static struct resource *wdt_mem;
+static struct resource *wdt_irq;
+static void __iomem *wdt_base;
+static int wdt_margin = WATCHDOG_TIMEOUT_MARGIN; /* in range of 0 .. 60s */
+
+static int open_state = WATCHDOG_DRIVER_CLOSE;
+static int wd_expire = 0;
+
+static void watchdog_enable(void)
+{
+ unsigned long wdcr;
+
+ wdcr = readl(wdt_base + _WATCHDOG_CR);
+ wdcr |= (WATCHDOG_WDENABLE_MSK|WATCHDOG_WDRST_MSK);
+#ifdef WATCHDOG_TEST
+ wdcr |= WATCHDOG_WDINTR_MSK;
+// wdcr &= ~WATCHDOG_WDRST_MSK;
+#endif
+ wdcr &= ~WATCHDOG_WDCLOCK_MSK;
+ writel(wdcr, wdt_base + _WATCHDOG_CR);
+}
+
+static void watchdog_set_timeout(unsigned long timeout)
+{
+ timeout = WATCHDOG_TIMEOUT_SCALE * timeout;
+ writel(timeout, wdt_base + _WATCHDOG_LOAD);
+ writel(WATCHDOG_RESTART_VALUE, wdt_base + _WATCHDOG_RESTART);
+}
+
+static void watchdog_keepalive(void)
+{
+ writel(WATCHDOG_RESTART_VALUE, wdt_base + _WATCHDOG_RESTART);
+}
+
+static void watchdog_disable(void)
+{
+ unsigned long wdcr;
+
+ wdcr = readl(wdt_base + _WATCHDOG_CR);
+ wdcr &= ~WATCHDOG_WDENABLE_MSK;
+ writel(wdcr, wdt_base + _WATCHDOG_CR);
+}
+
+
+#ifdef WATCHDOG_TEST
+static irqreturn_t watchdog_irq(int irq, void *dev_id, struct pt_regs *regs)
+{
+ unsigned int clear;
+
+ writel(WATCHDOG_CLEAR_STATUS, wdt_base + _WATCHDOG_CLEAR);
+ printk(KERN_INFO PFX "Watchdog timeout, resetting system...\n");
+
+ clear = __raw_readl(IO_ADDRESS(SL2312_INTERRUPT_BASE)+0x0C);
+ clear &= 0x01;
+ __raw_writel(clear,IO_ADDRESS(SL2312_INTERRUPT_BASE)+0x08);
+ wd_expire = 1;
+ return IRQ_HANDLED;
+}
+
+#endif
+
+#define OPTIONS WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING | WDIOF_MAGICCLOSE
+static struct watchdog_info sl351x_wdt_ident = {
+ .options = OPTIONS,
+ .firmware_version = 0,
+ .identity = "sl351x Watchdog",
+};
+
+struct file_operations watchdog_fops = {
+ .write = watchdog_write,
+ .read = watchdog_read,
+ .open = watchdog_open,
+ .release = watchdog_release,
+ .ioctl = watchdog_ioctl,
+};
+
+static int watchdog_open(struct inode *inode, struct file *filp)
+{
+ if (open_state == WATCHDOG_DRIVER_OPEN)
+ return -EBUSY;
+
+ wd_expire = 0;
+
+ watchdog_disable();
+ watchdog_set_timeout(wdt_margin);
+ watchdog_enable();
+
+ printk(KERN_INFO PFX "watchog timer enabled, margin: %ds.\n", wdt_margin);
+ open_state = WATCHDOG_DRIVER_OPEN;
+
+ return nonseekable_open(inode, filp);
+}
+
+static int watchdog_release(struct inode *inode, struct file *filp)
+{
+ watchdog_disable();
+
+ open_state = WATCHDOG_DRIVER_CLOSE;
+ wd_expire = 0;
+ printk(KERN_INFO PFX "watchog timer disabled, margin: %ds.\n", wdt_margin);
+
+ return 0;
+}
+
+static ssize_t watchdog_read(struct file *filp, char *buf, size_t count, loff_t *off)
+{
+ int i;
+ unsigned long val;
+
+
+ for(i=0;i< count;i++)
+ {
+ if ((i%4)==0)
+ val = *((unsigned long *)WATCHDOG_COUNTER);
+ buf[i] = (val & 0xFF);
+ val >>= 8;
+ }
+ return count;
+}
+
+static ssize_t watchdog_write(struct file *filp, const char *buf, size_t len, loff_t *off)
+{
+ /* Refresh the timer. */
+ if (len) {
+ watchdog_keepalive();
+ }
+ return len;
+
+}
+
+static int watchdog_ioctl(struct inode *inode, struct file *filp,
+ unsigned int cmd, unsigned long arg)
+{
+ void __user *argp = (void __user *)arg;
+ int margin;
+
+ switch(cmd)
+ {
+ case WDIOC_GETSUPPORT:
+ return copy_to_user(argp, &sl351x_wdt_ident,
+ sizeof(sl351x_wdt_ident)) ? -EFAULT : 0;
+
+ case WDIOC_GETSTATUS:
+ case WDIOC_GETBOOTSTATUS:
+ return put_user(0, (int __user*)argp);
+
+ case WDIOC_KEEPALIVE:
+ watchdog_keepalive();
+ return 0;
+
+ case WDIOC_SETTIMEOUT:
+ if (get_user(margin, (int __user*)argp))
+ return -EFAULT;
+
+ /* Arbitrary, can't find the card's limits */
+ if ((margin < 0) || (margin > 60))
+ return -EINVAL;
+
+ // watchdog_disable();
+ wdt_margin = margin;
+ watchdog_set_timeout(margin);
+ watchdog_keepalive();
+ // watchdog_enable();
+
+ /* Fall through */
+
+ case WDIOC_GETTIMEOUT:
+ return put_user(wdt_margin, (int *)arg);
+
+ default:
+ return -ENOIOCTLCMD;
+ }
+}
+
+static struct miscdevice wd_dev= {
+ WATCHDOG_MINOR,
+ "watchdog",
+ &watchdog_fops
+};
+
+static char banner[] __initdata = KERN_INFO "SL351x Watchdog Timer, (c) 2007 WILIBOX\n";
+
+static int sl351x_wdt_probe(struct platform_device *pdev)
+{
+ struct resource *res;
+ int ret, size;
+ unsigned long wdcr;
+
+ res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+ if (res == NULL) {
+ printk(KERN_INFO PFX "failed to get memory region resouce\n");
+ return -ENOMEM;
+ }
+
+ size = (res->end-res->start)+1;
+
+ wdt_mem = request_mem_region(res->start, size, pdev->name);
+ if (wdt_mem == NULL) {
+ printk(KERN_INFO PFX "failed to get memory region\n");
+ return -ENOENT;
+ }
+
+ wdt_base = ioremap(res->start, size);
+ if (wdt_base == NULL) {
+ printk(KERN_INFO PFX "failed to ioremap() region\n");
+ return -EINVAL;
+ }
+
+ res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
+ if (res == NULL) {
+ printk(KERN_INFO PFX "failed to get irq resource\n");
+ return -ENOENT;
+ }
+
+ wdt_irq = res;
+
+ ret = request_irq(res->start, watchdog_irq, 0, pdev->name, pdev);
+ if (ret != 0) {
+ printk(KERN_INFO PFX "failed to install irq (%d)\n", ret);
+ return ret;
+ }
+
+ wdcr = readl(wdt_base + _WATCHDOG_CR);
+ if (wdcr & WATCHDOG_WDENABLE_MSK) {
+ printk(KERN_INFO PFX "Found watchdog in enabled state, reseting ...\n");
+ wdcr &= ~WATCHDOG_WDENABLE_MSK;
+ writel(wdcr, wdt_base + _WATCHDOG_CR);
+ }
+
+ ret = misc_register(&wd_dev);
+
+ return ret;
+}
+
+static int sl351x_wdt_remove(struct platform_device *pdev)
+{
+ if (wdt_base != NULL) {
+ iounmap(wdt_base);
+ wdt_base = NULL;
+ }
+
+ if (wdt_irq != NULL) {
+ free_irq(wdt_irq->start, pdev);
+ release_resource(wdt_irq);
+ wdt_irq = NULL;
+ }
+
+ if (wdt_mem != NULL) {
+ release_resource(wdt_mem);
+ wdt_mem = NULL;
+ }
+
+ misc_deregister(&wd_dev);
+
+ return 0;
+}
+
+static void sl351x_wdt_shutdown(struct platform_device *dev)
+{
+ watchdog_disable();
+}
+
+#ifdef CONFIG_PM
+static int sl351x_wdt_suspend(struct platform_device *dev, pm_message_t state)
+{
+ watchdog_disable();
+}
+
+static int sl351x_wdt_resume(struct platform_device *dev)
+{
+ watchdog_set_timeout(wdt_margin);
+ watchdog_enable();
+}
+
+#else
+#define sl351x_wdt_suspend NULL
+#define sl351x_wdt_resume NULL
+#endif
+
+static struct platform_driver sl351x_wdt_driver = {
+ .probe = sl351x_wdt_probe,
+ .remove = sl351x_wdt_remove,
+ .shutdown = sl351x_wdt_shutdown,
+ .suspend = sl351x_wdt_suspend,
+ .resume = sl351x_wdt_resume,
+ .driver = {
+ .owner = THIS_MODULE,
+ .name = "sl351x-wdt",
+ },
+};
+
+static int __init watchdog_init(void)
+{
+ printk(banner);
+ return platform_driver_register(&sl351x_wdt_driver);
+}
+
+static void __exit watchdog_exit(void)
+{
+ platform_driver_unregister(&sl351x_wdt_driver);
+}
+
+module_init(watchdog_init);
+module_exit(watchdog_exit);

View File

@ -1,7 +1,5 @@
Index: linux-2.6.23.17/drivers/char/gemini_gpio_dev.c
===================================================================
--- /dev/null --- /dev/null
+++ linux-2.6.23.17/drivers/char/gemini_gpio_dev.c +++ b/drivers/char/gemini_gpio_dev.c
@@ -0,0 +1,356 @@ @@ -0,0 +1,356 @@
+/* +/*
+ * GPIO driver for Gemini board + * GPIO driver for Gemini board
@ -359,11 +357,9 @@ Index: linux-2.6.23.17/drivers/char/gemini_gpio_dev.c
+MODULE_AUTHOR("Jonas Majauskas"); +MODULE_AUTHOR("Jonas Majauskas");
+MODULE_LICENSE("GPL"); +MODULE_LICENSE("GPL");
+ +
Index: linux-2.6.23.17/drivers/char/Kconfig --- a/drivers/char/Kconfig
=================================================================== +++ b/drivers/char/Kconfig
--- linux-2.6.23.17.orig/drivers/char/Kconfig @@ -1064,5 +1064,12 @@
+++ linux-2.6.23.17/drivers/char/Kconfig
@@ -1064,5 +1064,12 @@ config DEVPORT
source "drivers/s390/char/Kconfig" source "drivers/s390/char/Kconfig"
@ -376,11 +372,9 @@ Index: linux-2.6.23.17/drivers/char/Kconfig
+ +
endmenu endmenu
Index: linux-2.6.23.17/drivers/char/Makefile --- a/drivers/char/Makefile
=================================================================== +++ b/drivers/char/Makefile
--- linux-2.6.23.17.orig/drivers/char/Makefile @@ -115,6 +115,7 @@
+++ linux-2.6.23.17/drivers/char/Makefile
@@ -115,6 +115,7 @@ obj-$(CONFIG_IPMI_HANDLER) += ipmi/
obj-$(CONFIG_HANGCHECK_TIMER) += hangcheck-timer.o obj-$(CONFIG_HANGCHECK_TIMER) += hangcheck-timer.o
obj-$(CONFIG_TCG_TPM) += tpm/ obj-$(CONFIG_TCG_TPM) += tpm/

View File

@ -33,7 +33,7 @@ TARGET_ARCH="arm"
FORCE_OPTIONS_FOR_ARCH=y FORCE_OPTIONS_FOR_ARCH=y
# CONFIG_ARM_OABI is not set # CONFIG_ARM_OABI is not set
CONFIG_ARM_EABI=y CONFIG_ARM_EABI=y
USE_BX=y # USE_BX is not set
# CONFIG_GENERIC_ARM is not set # CONFIG_GENERIC_ARM is not set
# CONFIG_ARM610 is not set # CONFIG_ARM610 is not set
# CONFIG_ARM710 is not set # CONFIG_ARM710 is not set