mirror of
git://projects.qi-hardware.com/openwrt-xburst.git
synced 2025-04-21 12:27:27 +03:00
split kernel patches into board dependend and generic
git-svn-id: svn://svn.openwrt.org/openwrt/trunk/openwrt@1122 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
21550
target/linux/linux-2.4/patches/brcm/001-bcm47xx.patch
Normal file
21550
target/linux/linux-2.4/patches/brcm/001-bcm47xx.patch
Normal file
File diff suppressed because it is too large
Load Diff
346
target/linux/linux-2.4/patches/brcm/002-wl_fix.patch
Normal file
346
target/linux/linux-2.4/patches/brcm/002-wl_fix.patch
Normal file
@@ -0,0 +1,346 @@
|
||||
diff -Nur linux-2.4.30/include/linux/netdevice.h linux-2.4.30-wl-fix/include/linux/netdevice.h
|
||||
--- linux-2.4.30/include/linux/netdevice.h 2004-11-17 12:54:22.000000000 +0100
|
||||
+++ linux-2.4.30-wl-fix/include/linux/netdevice.h 2005-05-09 16:31:08.000000000 +0200
|
||||
@@ -297,7 +297,7 @@
|
||||
* See <net/iw_handler.h> for details. Jean II */
|
||||
struct iw_handler_def * wireless_handlers;
|
||||
|
||||
- struct ethtool_ops *ethtool_ops;
|
||||
+
|
||||
|
||||
/*
|
||||
* This marks the end of the "visible" part of the structure. All
|
||||
@@ -352,8 +355,8 @@
|
||||
|
||||
struct Qdisc *qdisc;
|
||||
struct Qdisc *qdisc_sleeping;
|
||||
+ struct Qdisc *qdisc_list;
|
||||
struct Qdisc *qdisc_ingress;
|
||||
- struct list_head qdisc_list;
|
||||
unsigned long tx_queue_len; /* Max frames per queue allowed */
|
||||
|
||||
/* hard_start_xmit synchronizer */
|
||||
@@ -453,6 +460,7 @@
|
||||
/* this will get initialized at each interface type init routine */
|
||||
struct divert_blk *divert;
|
||||
#endif /* CONFIG_NET_DIVERT */
|
||||
+ struct ethtool_ops *ethtool_ops;
|
||||
};
|
||||
|
||||
/* 2.6 compatibility */
|
||||
diff -Nur linux-2.4.30/include/linux/skbuff.h linux-2.4.30-wl-fix/include/linux/skbuff.h
|
||||
--- linux-2.4.30/include/linux/skbuff.h 2005-04-04 03:42:20.000000000 +0200
|
||||
+++ linux-2.4.30-wl-fix/include/linux/skbuff.h 2005-05-08 00:50:55.000000000 +0200
|
||||
@@ -135,10 +135,6 @@
|
||||
struct sock *sk; /* Socket we are owned by */
|
||||
struct timeval stamp; /* Time we arrived */
|
||||
struct net_device *dev; /* Device we arrived on/are leaving by */
|
||||
- struct net_device *real_dev; /* For support of point to point protocols
|
||||
- (e.g. 802.3ad) over bonding, we must save the
|
||||
- physical device that got the packet before
|
||||
- replacing skb->dev with the virtual device. */
|
||||
|
||||
/* Transport layer header */
|
||||
union
|
||||
@@ -219,6 +215,10 @@
|
||||
#ifdef CONFIG_NET_SCHED
|
||||
__u32 tc_index; /* traffic control index */
|
||||
#endif
|
||||
+ struct net_device *real_dev; /* For support of point to point protocols
|
||||
+ (e.g. 802.3ad) over bonding, we must save the
|
||||
+ physical device that got the packet before
|
||||
+ replacing skb->dev with the virtual device. */
|
||||
};
|
||||
|
||||
#ifdef __KERNEL__
|
||||
diff -Nur linux-2.4.30/include/net/pkt_sched.h linux-2.4.30-wl-fix/include/net/pkt_sched.h
|
||||
--- linux-2.4.30/include/net/pkt_sched.h 2004-11-17 12:54:22.000000000 +0100
|
||||
+++ linux-2.4.30-wl-fix/include/net/pkt_sched.h 2005-05-08 01:05:48.000000000 +0200
|
||||
@@ -59,8 +59,11 @@
|
||||
int (*enqueue)(struct sk_buff *, struct Qdisc *);
|
||||
struct sk_buff * (*dequeue)(struct Qdisc *);
|
||||
int (*requeue)(struct sk_buff *, struct Qdisc *);
|
||||
- unsigned int (*drop)(struct Qdisc *);
|
||||
-
|
||||
+#ifdef CONFIG_BCM4710
|
||||
+ int (*drop)(struct Qdisc *);
|
||||
+#else
|
||||
+ unsigned int (*drop)(struct Qdisc *);
|
||||
+#endif
|
||||
int (*init)(struct Qdisc *, struct rtattr *arg);
|
||||
void (*reset)(struct Qdisc *);
|
||||
void (*destroy)(struct Qdisc *);
|
||||
@@ -80,12 +83,19 @@
|
||||
#define TCQ_F_THROTTLED 2
|
||||
#define TCQ_F_INGRESS 4
|
||||
struct Qdisc_ops *ops;
|
||||
+#ifdef CONFIG_BCM4710
|
||||
+ struct Qdisc *next;
|
||||
+#endif
|
||||
u32 handle;
|
||||
- u32 parent;
|
||||
+#ifndef CONFIG_BCM4710
|
||||
+ u32 parent;
|
||||
+#endif
|
||||
atomic_t refcnt;
|
||||
struct sk_buff_head q;
|
||||
struct net_device *dev;
|
||||
- struct list_head list;
|
||||
+#ifndef CONFIG_BCM4710
|
||||
+ struct list_head list;
|
||||
+#endif
|
||||
|
||||
struct tc_stats stats;
|
||||
int (*reshape_fail)(struct sk_buff *skb, struct Qdisc *q);
|
||||
diff -Nur linux-2.4.30/net/core/dev.c linux-2.4.30-wl-fix/net/core/dev.c
|
||||
--- linux-2.4.30/net/core/dev.c 2005-04-04 03:42:20.000000000 +0200
|
||||
+++ linux-2.4.30-wl-fix/net/core/dev.c 2005-05-08 00:51:08.000000000 +0200
|
||||
@@ -2311,6 +2311,7 @@
|
||||
}
|
||||
return ret;
|
||||
|
||||
+#ifndef CONFIG_BCM4710
|
||||
case SIOCETHTOOL:
|
||||
dev_load(ifr.ifr_name);
|
||||
rtnl_lock();
|
||||
@@ -2324,6 +2325,7 @@
|
||||
ret = -EFAULT;
|
||||
}
|
||||
return ret;
|
||||
+#endif
|
||||
|
||||
/*
|
||||
* These ioctl calls:
|
||||
diff -Nur linux-2.4.30/net/core/Makefile linux-2.4.30-wl-fix/net/core/Makefile
|
||||
--- linux-2.4.30/net/core/Makefile 2004-11-17 12:54:22.000000000 +0100
|
||||
+++ linux-2.4.30-wl-fix/net/core/Makefile 2005-05-08 00:51:02.000000000 +0200
|
||||
@@ -9,7 +9,11 @@
|
||||
|
||||
O_TARGET := core.o
|
||||
|
||||
+ifeq ($(CONFIG_BCM4710),y)
|
||||
+export-objs := netfilter.o profile.o neighbour.o
|
||||
+else
|
||||
export-objs := netfilter.o profile.o ethtool.o neighbour.o
|
||||
+endif
|
||||
|
||||
obj-y := sock.o skbuff.o iovec.o datagram.o scm.o
|
||||
|
||||
@@ -21,8 +25,13 @@
|
||||
|
||||
obj-$(CONFIG_FILTER) += filter.o
|
||||
|
||||
+ifeq ($(CONFIG_BCM4710),y)
|
||||
+obj-$(CONFIG_NET) += dev.o dev_mcast.o dst.o neighbour.o \
|
||||
+ rtnetlink.o utils.o
|
||||
+else
|
||||
obj-$(CONFIG_NET) += dev.o ethtool.o dev_mcast.o dst.o neighbour.o \
|
||||
rtnetlink.o utils.o
|
||||
+endif
|
||||
|
||||
obj-$(CONFIG_NETFILTER) += netfilter.o
|
||||
obj-$(CONFIG_NET_DIVERT) += dv.o
|
||||
diff -Nur linux-2.4.30/net/sched/sch_api.c linux-2.4.30-wl-fix/net/sched/sch_api.c
|
||||
--- linux-2.4.30/net/sched/sch_api.c 2004-11-17 12:54:22.000000000 +0100
|
||||
+++ linux-2.4.30-wl-fix/net/sched/sch_api.c 2005-05-08 00:51:14.000000000 +0200
|
||||
@@ -194,11 +194,12 @@
|
||||
{
|
||||
struct Qdisc *q;
|
||||
|
||||
- list_for_each_entry(q, &dev->qdisc_list, list) {
|
||||
+ for (q = dev->qdisc_list; q; q = q->next) {
|
||||
if (q->handle == handle)
|
||||
return q;
|
||||
}
|
||||
return NULL;
|
||||
+
|
||||
}
|
||||
|
||||
struct Qdisc *qdisc_leaf(struct Qdisc *p, u32 classid)
|
||||
@@ -371,8 +372,6 @@
|
||||
unsigned long cl = cops->get(parent, classid);
|
||||
if (cl) {
|
||||
err = cops->graft(parent, cl, new, old);
|
||||
- if (new)
|
||||
- new->parent = classid;
|
||||
cops->put(parent, cl);
|
||||
}
|
||||
}
|
||||
@@ -427,7 +426,6 @@
|
||||
|
||||
memset(sch, 0, size);
|
||||
|
||||
- INIT_LIST_HEAD(&sch->list);
|
||||
skb_queue_head_init(&sch->q);
|
||||
|
||||
if (handle == TC_H_INGRESS)
|
||||
@@ -453,7 +451,8 @@
|
||||
|
||||
if (!ops->init || (err = ops->init(sch, tca[TCA_OPTIONS-1])) == 0) {
|
||||
write_lock(&qdisc_tree_lock);
|
||||
- list_add_tail(&sch->list, &dev->qdisc_list);
|
||||
+ sch->next = dev->qdisc_list;
|
||||
+ dev->qdisc_list = sch;
|
||||
write_unlock(&qdisc_tree_lock);
|
||||
#ifdef CONFIG_NET_ESTIMATOR
|
||||
if (tca[TCA_RATE-1])
|
||||
@@ -808,19 +807,16 @@
|
||||
if (idx > s_idx)
|
||||
s_q_idx = 0;
|
||||
read_lock(&qdisc_tree_lock);
|
||||
- q_idx = 0;
|
||||
- list_for_each_entry(q, &dev->qdisc_list, list) {
|
||||
- if (q_idx < s_q_idx) {
|
||||
- q_idx++;
|
||||
- continue;
|
||||
- }
|
||||
- if (tc_fill_qdisc(skb, q, q->parent, NETLINK_CB(cb->skb).pid,
|
||||
- cb->nlh->nlmsg_seq, NLM_F_MULTI, RTM_NEWQDISC) <= 0) {
|
||||
- read_unlock(&qdisc_tree_lock);
|
||||
- goto done;
|
||||
- }
|
||||
- q_idx++;
|
||||
- }
|
||||
+ for (q = dev->qdisc_list, q_idx = 0; q;
|
||||
+ q = q->next, q_idx++) {
|
||||
+ if (q_idx < s_q_idx)
|
||||
+ continue;
|
||||
+ if (tc_fill_qdisc(skb, q, 0, NETLINK_CB(cb->skb).pid,
|
||||
+ cb->nlh->nlmsg_seq, NLM_F_MULTI, RTM_NEWQDISC) <= 0) {
|
||||
+ read_unlock(&qdisc_tree_lock);
|
||||
+ goto done;
|
||||
+ }
|
||||
+ }
|
||||
read_unlock(&qdisc_tree_lock);
|
||||
}
|
||||
|
||||
@@ -1033,27 +1029,24 @@
|
||||
t = 0;
|
||||
|
||||
read_lock(&qdisc_tree_lock);
|
||||
- list_for_each_entry(q, &dev->qdisc_list, list) {
|
||||
- if (t < s_t || !q->ops->cl_ops ||
|
||||
- (tcm->tcm_parent &&
|
||||
- TC_H_MAJ(tcm->tcm_parent) != q->handle)) {
|
||||
- t++;
|
||||
- continue;
|
||||
- }
|
||||
- if (t > s_t)
|
||||
- memset(&cb->args[1], 0, sizeof(cb->args)-sizeof(cb->args[0]));
|
||||
- arg.w.fn = qdisc_class_dump;
|
||||
- arg.skb = skb;
|
||||
- arg.cb = cb;
|
||||
- arg.w.stop = 0;
|
||||
- arg.w.skip = cb->args[1];
|
||||
- arg.w.count = 0;
|
||||
- q->ops->cl_ops->walk(q, &arg.w);
|
||||
- cb->args[1] = arg.w.count;
|
||||
- if (arg.w.stop)
|
||||
- break;
|
||||
- t++;
|
||||
- }
|
||||
+ for (q=dev->qdisc_list, t=0; q; q = q->next, t++) {
|
||||
+ if (t < s_t) continue;
|
||||
+ if (!q->ops->cl_ops) continue;
|
||||
+ if (tcm->tcm_parent && TC_H_MAJ(tcm->tcm_parent) != q->handle)
|
||||
+ continue;
|
||||
+ if (t > s_t)
|
||||
+ memset(&cb->args[1], 0, sizeof(cb->args)-sizeof(cb->args[0]));
|
||||
+ arg.w.fn = qdisc_class_dump;
|
||||
+ arg.skb = skb;
|
||||
+ arg.cb = cb;
|
||||
+ arg.w.stop = 0;
|
||||
+ arg.w.skip = cb->args[1];
|
||||
+ arg.w.count = 0;
|
||||
+ q->ops->cl_ops->walk(q, &arg.w);
|
||||
+ cb->args[1] = arg.w.count;
|
||||
+ if (arg.w.stop)
|
||||
+ break;
|
||||
+ }
|
||||
read_unlock(&qdisc_tree_lock);
|
||||
|
||||
cb->args[0] = t;
|
||||
diff -Nur linux-2.4.30/net/sched/sch_generic.c linux-2.4.30-wl-fix/net/sched/sch_generic.c
|
||||
--- linux-2.4.30/net/sched/sch_generic.c 2004-11-17 12:54:22.000000000 +0100
|
||||
+++ linux-2.4.30-wl-fix/net/sched/sch_generic.c 2005-05-08 00:51:20.000000000 +0200
|
||||
@@ -392,7 +392,6 @@
|
||||
return NULL;
|
||||
memset(sch, 0, size);
|
||||
|
||||
- INIT_LIST_HEAD(&sch->list);
|
||||
skb_queue_head_init(&sch->q);
|
||||
sch->ops = ops;
|
||||
sch->enqueue = ops->enqueue;
|
||||
@@ -422,11 +421,22 @@
|
||||
void qdisc_destroy(struct Qdisc *qdisc)
|
||||
{
|
||||
struct Qdisc_ops *ops = qdisc->ops;
|
||||
+ struct net_device *dev;
|
||||
|
||||
if (qdisc->flags&TCQ_F_BUILTIN ||
|
||||
!atomic_dec_and_test(&qdisc->refcnt))
|
||||
return;
|
||||
- list_del(&qdisc->list);
|
||||
+
|
||||
+ dev = qdisc->dev;
|
||||
+ if (dev) {
|
||||
+ struct Qdisc *q, **qp;
|
||||
+ for (qp = &qdisc->dev->qdisc_list; (q=*qp) != NULL; qp = &q->next) {
|
||||
+ if (q == qdisc) {
|
||||
+ *qp = q->next;
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
#ifdef CONFIG_NET_ESTIMATOR
|
||||
qdisc_kill_estimator(&qdisc->stats);
|
||||
#endif
|
||||
@@ -455,9 +465,9 @@
|
||||
return;
|
||||
}
|
||||
write_lock(&qdisc_tree_lock);
|
||||
- list_add_tail(&qdisc->list, &dev->qdisc_list);
|
||||
+ qdisc->next = dev->qdisc_list;
|
||||
+ dev->qdisc_list = qdisc;
|
||||
write_unlock(&qdisc_tree_lock);
|
||||
-
|
||||
} else {
|
||||
qdisc = &noqueue_qdisc;
|
||||
}
|
||||
@@ -501,7 +511,7 @@
|
||||
dev->qdisc = &noop_qdisc;
|
||||
spin_unlock_bh(&dev->queue_lock);
|
||||
dev->qdisc_sleeping = &noop_qdisc;
|
||||
- INIT_LIST_HEAD(&dev->qdisc_list);
|
||||
+ dev->qdisc_list = NULL;
|
||||
write_unlock(&qdisc_tree_lock);
|
||||
|
||||
dev_watchdog_init(dev);
|
||||
@@ -523,7 +533,7 @@
|
||||
qdisc_destroy(qdisc);
|
||||
}
|
||||
#endif
|
||||
- BUG_TRAP(list_empty(&dev->qdisc_list));
|
||||
+ BUG_TRAP(dev->qdisc_list == NULL);
|
||||
BUG_TRAP(!timer_pending(&dev->watchdog_timer));
|
||||
spin_unlock_bh(&dev->queue_lock);
|
||||
write_unlock(&qdisc_tree_lock);
|
||||
diff -urN linux.old/net/core/dev.c linux.dev/net/core/dev.c
|
||||
--- linux.old/net/core/dev.c 2005-05-28 17:42:07.000000000 +0200
|
||||
+++ linux.dev/net/core/dev.c 2005-05-28 20:38:06.000000000 +0200
|
||||
@@ -2223,6 +2223,7 @@
|
||||
cmd == SIOCGMIIPHY ||
|
||||
cmd == SIOCGMIIREG ||
|
||||
cmd == SIOCSMIIREG ||
|
||||
+ cmd == SIOCETHTOOL ||
|
||||
cmd == SIOCWANDEV) {
|
||||
if (dev->do_ioctl) {
|
||||
if (!netif_device_present(dev))
|
||||
@@ -2405,6 +2406,7 @@
|
||||
|
||||
default:
|
||||
if (cmd == SIOCWANDEV ||
|
||||
+ (cmd == SIOCETHTOOL) ||
|
||||
(cmd >= SIOCDEVPRIVATE &&
|
||||
cmd <= SIOCDEVPRIVATE + 15)) {
|
||||
dev_load(ifr.ifr_name);
|
||||
@@ -0,0 +1,108 @@
|
||||
diff -urN linux.old/arch/mips/mm/tlbex-mips32.S linux.dev/arch/mips/mm/tlbex-mips32.S
|
||||
--- linux.old/arch/mips/mm/tlbex-mips32.S 2005-05-28 17:42:03.000000000 +0200
|
||||
+++ linux.dev/arch/mips/mm/tlbex-mips32.S 2005-05-28 21:48:55.000000000 +0200
|
||||
@@ -90,6 +90,9 @@
|
||||
.set noat
|
||||
LEAF(except_vec0_r4000)
|
||||
.set mips3
|
||||
+#ifdef CONFIG_BCM4704
|
||||
+ nop
|
||||
+#endif
|
||||
#ifdef CONFIG_SMP
|
||||
mfc0 k1, CP0_CONTEXT
|
||||
la k0, pgd_current
|
||||
diff -urN linux.old/arch/mips/mm/pg-r4k.c linux.dev/arch/mips/mm/pg-r4k.c
|
||||
--- linux.old/arch/mips/mm/pg-r4k.c 2005-01-19 15:09:29.000000000 +0100
|
||||
+++ linux.dev/arch/mips/mm/pg-r4k.c 2005-05-28 21:57:52.000000000 +0200
|
||||
@@ -180,6 +180,7 @@
|
||||
|
||||
static inline void build_cdex_s(void)
|
||||
{
|
||||
+#if !defined(CONFIG_BCM4704) && !defined(CONFIG_BCM4710)
|
||||
union mips_instruction mi;
|
||||
|
||||
if ((store_offset & (cpu_scache_line_size() - 1)))
|
||||
@@ -192,10 +193,12 @@
|
||||
mi.c_format.simmediate = store_offset;
|
||||
|
||||
emit_instruction(mi);
|
||||
+#endif
|
||||
}
|
||||
|
||||
static inline void build_cdex_p(void)
|
||||
{
|
||||
+#if !defined(CONFIG_BCM4704) && !defined(CONFIG_BCM4710)
|
||||
union mips_instruction mi;
|
||||
|
||||
if (store_offset & (cpu_dcache_line_size() - 1))
|
||||
@@ -218,6 +221,7 @@
|
||||
mi.c_format.simmediate = store_offset;
|
||||
|
||||
emit_instruction(mi);
|
||||
+#endif
|
||||
}
|
||||
|
||||
static void __build_store_reg(int reg)
|
||||
diff -urN linux.old/include/asm-mips/stackframe.h linux.dev/include/asm-mips/stackframe.h
|
||||
--- linux.old/include/asm-mips/stackframe.h 2002-11-29 00:53:15.000000000 +0100
|
||||
+++ linux.dev/include/asm-mips/stackframe.h 2005-05-28 21:53:03.000000000 +0200
|
||||
@@ -172,6 +172,46 @@
|
||||
rfe; \
|
||||
.set pop
|
||||
|
||||
+#elif defined(CONFIG_BCM4710) || defined(CONFIG_BCM4704)
|
||||
+
|
||||
+#define RESTORE_SOME \
|
||||
+ .set push; \
|
||||
+ .set reorder; \
|
||||
+ mfc0 t0, CP0_STATUS; \
|
||||
+ .set pop; \
|
||||
+ ori t0, 0x1f; \
|
||||
+ xori t0, 0x1f; \
|
||||
+ mtc0 t0, CP0_STATUS; \
|
||||
+ li v1, 0xff00; \
|
||||
+ and t0, v1; \
|
||||
+ lw v0, PT_STATUS(sp); \
|
||||
+ nor v1, $0, v1; \
|
||||
+ and v0, v1; \
|
||||
+ or v0, t0; \
|
||||
+ ori v1, v0, ST0_IE; \
|
||||
+ xori v1, v1, ST0_IE; \
|
||||
+ mtc0 v1, CP0_STATUS; \
|
||||
+ mtc0 v0, CP0_STATUS; \
|
||||
+ lw v1, PT_EPC(sp); \
|
||||
+ mtc0 v1, CP0_EPC; \
|
||||
+ lw $31, PT_R31(sp); \
|
||||
+ lw $28, PT_R28(sp); \
|
||||
+ lw $25, PT_R25(sp); \
|
||||
+ lw $7, PT_R7(sp); \
|
||||
+ lw $6, PT_R6(sp); \
|
||||
+ lw $5, PT_R5(sp); \
|
||||
+ lw $4, PT_R4(sp); \
|
||||
+ lw $3, PT_R3(sp); \
|
||||
+ lw $2, PT_R2(sp)
|
||||
+
|
||||
+#define RESTORE_SP_AND_RET \
|
||||
+ lw sp, PT_R29(sp); \
|
||||
+ nop; \
|
||||
+ nop; \
|
||||
+ .set mips3; \
|
||||
+ eret; \
|
||||
+ .set mips0
|
||||
+
|
||||
#else
|
||||
|
||||
#define RESTORE_SOME \
|
||||
diff -urN linux.old/arch/mips/mm/tlbex-r4k.S linux.dev/arch/mips/mm/tlbex-r4k.S
|
||||
--- linux.old/arch/mips/mm/tlbex-r4k.S 2005-05-28 17:42:03.000000000 +0200
|
||||
+++ linux.dev/arch/mips/mm/tlbex-r4k.S 2005-05-29 15:04:43.000000000 +0200
|
||||
@@ -168,6 +168,9 @@
|
||||
.set noat
|
||||
LEAF(except_vec0_r4000)
|
||||
.set mips3
|
||||
+#ifdef CONFIG_BCM4704
|
||||
+ nop
|
||||
+#endif
|
||||
GET_PGD(k0, k1) # get pgd pointer
|
||||
mfc0 k0, CP0_BADVADDR # Get faulting address
|
||||
srl k0, k0, _PGDIR_SHIFT # get pgd only bits
|
||||
147
target/linux/linux-2.4/patches/brcm/004-bcm94710_mmu.patch
Normal file
147
target/linux/linux-2.4/patches/brcm/004-bcm94710_mmu.patch
Normal file
@@ -0,0 +1,147 @@
|
||||
diff -urN linux.old/arch/mips/mm/c-r4k.c linux.dev/arch/mips/mm/c-r4k.c
|
||||
--- linux.old/arch/mips/mm/c-r4k.c 2005-05-28 17:42:06.000000000 +0200
|
||||
+++ linux.dev/arch/mips/mm/c-r4k.c 2005-05-29 18:26:34.000000000 +0200
|
||||
@@ -14,6 +14,12 @@
|
||||
#include <linux/mm.h>
|
||||
#include <linux/bitops.h>
|
||||
|
||||
+#ifdef CONFIG_BCM4710
|
||||
+#include "../bcm947xx/include/typedefs.h"
|
||||
+#include "../bcm947xx/include/sbconfig.h"
|
||||
+#include <asm/paccess.h>
|
||||
+#endif
|
||||
+
|
||||
#include <asm/bcache.h>
|
||||
#include <asm/bootinfo.h>
|
||||
#include <asm/cacheops.h>
|
||||
@@ -390,6 +396,11 @@
|
||||
addr = start & ~(dc_lsize - 1);
|
||||
aend = (end - 1) & ~(dc_lsize - 1);
|
||||
|
||||
+#ifdef CONFIG_BCM4710
|
||||
+ BCM4710_FILL_TLB(addr);
|
||||
+ BCM4710_FILL_TLB(aend);
|
||||
+#endif
|
||||
+
|
||||
while (1) {
|
||||
/* Hit_Writeback_Inv_D */
|
||||
protected_writeback_dcache_line(addr);
|
||||
@@ -509,6 +520,10 @@
|
||||
R4600_HIT_CACHEOP_WAR_IMPL;
|
||||
a = addr & ~(dc_lsize - 1);
|
||||
end = (addr + size - 1) & ~(dc_lsize - 1);
|
||||
+#ifdef CONFIG_BCM4710
|
||||
+ BCM4710_FILL_TLB(a);
|
||||
+ BCM4710_FILL_TLB(end);
|
||||
+#endif
|
||||
while (1) {
|
||||
flush_dcache_line(a); /* Hit_Writeback_Inv_D */
|
||||
if (a == end)
|
||||
@@ -576,6 +591,10 @@
|
||||
unsigned long ic_lsize = current_cpu_data.icache.linesz;
|
||||
unsigned long dc_lsize = current_cpu_data.dcache.linesz;
|
||||
|
||||
+#ifdef CONFIG_BCM4710
|
||||
+ BCM4710_PROTECTED_FILL_TLB(addr);
|
||||
+ BCM4710_PROTECTED_FILL_TLB(addr + 4);
|
||||
+#endif
|
||||
R4600_HIT_CACHEOP_WAR_IMPL;
|
||||
protected_writeback_dcache_line(addr & ~(dc_lsize - 1));
|
||||
protected_flush_icache_line(addr & ~(ic_lsize - 1));
|
||||
diff -urN linux.old/include/asm-mips/r4kcache.h linux.dev/include/asm-mips/r4kcache.h
|
||||
--- linux.old/include/asm-mips/r4kcache.h 2005-05-28 17:42:06.000000000 +0200
|
||||
+++ linux.dev/include/asm-mips/r4kcache.h 2005-05-29 18:34:46.000000000 +0200
|
||||
@@ -15,6 +15,25 @@
|
||||
#include <asm/asm.h>
|
||||
#include <asm/cacheops.h>
|
||||
|
||||
+#ifdef CONFIG_BCM4710
|
||||
+#define BCM4710_DUMMY_RREG() (((sbconfig_t *)(KSEG1ADDR(SB_ENUM_BASE + SBCONFIGOFF)))->sbimstate)
|
||||
+
|
||||
+#define BCM4710_FILL_TLB(addr) (*(volatile unsigned long *)(addr))
|
||||
+#define BCM4710_PROTECTED_FILL_TLB(addr) ({ unsigned long x; get_dbe(x, (volatile unsigned long *)(addr)); })
|
||||
+
|
||||
+#define cache_op(op,addr) \
|
||||
+ BCM4710_DUMMY_RREG(); \
|
||||
+ __asm__ __volatile__( \
|
||||
+ " .set noreorder \n" \
|
||||
+ " .set mips3\n\t \n" \
|
||||
+ " cache %0, %1 \n" \
|
||||
+ " .set mips0 \n" \
|
||||
+ " .set reorder" \
|
||||
+ : \
|
||||
+ : "i" (op), "m" (*(unsigned char *)(addr)))
|
||||
+
|
||||
+#else
|
||||
+
|
||||
#define cache_op(op,addr) \
|
||||
__asm__ __volatile__( \
|
||||
" .set noreorder \n" \
|
||||
@@ -24,6 +43,8 @@
|
||||
" .set reorder" \
|
||||
: \
|
||||
: "i" (op), "m" (*(unsigned char *)(addr)))
|
||||
+#endif
|
||||
+
|
||||
|
||||
static inline void flush_icache_line_indexed(unsigned long addr)
|
||||
{
|
||||
@@ -47,6 +68,10 @@
|
||||
|
||||
static inline void flush_dcache_line(unsigned long addr)
|
||||
{
|
||||
+
|
||||
+#ifdef CONFIG_BCM4710
|
||||
+ BCM4710_DUMMY_RREG();
|
||||
+#endif
|
||||
cache_op(Hit_Writeback_Inv_D, addr);
|
||||
}
|
||||
|
||||
@@ -196,7 +221,13 @@
|
||||
unsigned long start = page;
|
||||
unsigned long end = start + PAGE_SIZE;
|
||||
|
||||
+#ifdef CONFIG_BCM4710
|
||||
+ BCM4710_FILL_TLB(start);
|
||||
+#endif
|
||||
do {
|
||||
+#ifdef CONFIG_BCM4710
|
||||
+ BCM4710_DUMMY_RREG();
|
||||
+#endif
|
||||
cache16_unroll32(start,Hit_Invalidate_I);
|
||||
start += 0x200;
|
||||
} while (start < end);
|
||||
@@ -291,8 +322,12 @@
|
||||
unsigned long ws, addr;
|
||||
|
||||
for (ws = 0; ws < ws_end; ws += ws_inc)
|
||||
- for (addr = start; addr < end; addr += 0x400)
|
||||
+ for (addr = start; addr < end; addr += 0x400) {
|
||||
+#ifdef CONFIG_BCM4710
|
||||
+ BCM4710_DUMMY_RREG();
|
||||
+#endif
|
||||
cache32_unroll32(addr|ws,Index_Writeback_Inv_D);
|
||||
+ }
|
||||
}
|
||||
|
||||
static inline void blast_dcache32_page(unsigned long page)
|
||||
@@ -300,6 +335,9 @@
|
||||
unsigned long start = page;
|
||||
unsigned long end = start + PAGE_SIZE;
|
||||
|
||||
+#ifdef CONFIG_BCM4710
|
||||
+ __asm__ __volatile__("nop;nop;nop;nop");
|
||||
+#endif
|
||||
do {
|
||||
cache32_unroll32(start,Hit_Writeback_Inv_D);
|
||||
start += 0x400;
|
||||
@@ -339,6 +377,9 @@
|
||||
unsigned long start = page;
|
||||
unsigned long end = start + PAGE_SIZE;
|
||||
|
||||
+#ifdef CONFIG_BCM4710
|
||||
+ BCM4710_FILL_TLB(start);
|
||||
+#endif
|
||||
do {
|
||||
cache32_unroll32(start,Hit_Invalidate_I);
|
||||
start += 0x400;
|
||||
Reference in New Issue
Block a user