nuke most of the old ixp4xx patchsets

SVN-Revision: 11778
owl
Imre Kaloz 2008-07-12 02:02:58 +00:00
parent fc80a07184
commit 75aa30ada8
123 changed files with 0 additions and 33849 deletions

View File

@ -1,122 +0,0 @@
Index: linux-2.6.23.17/arch/arm/kernel/relocate_kernel.S
===================================================================
--- linux-2.6.23.17.orig/arch/arm/kernel/relocate_kernel.S
+++ linux-2.6.23.17/arch/arm/kernel/relocate_kernel.S
@@ -7,6 +7,23 @@
.globl relocate_new_kernel
relocate_new_kernel:
+ /* Move boot params back to where the kernel expects them */
+
+ ldr r0,kexec_boot_params_address
+ teq r0,#0
+ beq 8f
+
+ ldr r1,kexec_boot_params_copy
+ mov r6,#KEXEC_BOOT_PARAMS_SIZE/4
+7:
+ ldr r5,[r1],#4
+ str r5,[r0],#4
+ subs r6,r6,#1
+ bne 7b
+
+8:
+ /* Boot params moved, now go on with the kernel */
+
ldr r0,kexec_indirection_page
ldr r1,kexec_start_address
@@ -50,7 +67,7 @@ relocate_new_kernel:
mov lr,r1
mov r0,#0
ldr r1,kexec_mach_type
- mov r2,#0
+ ldr r2,kexec_boot_params_address
mov pc,lr
.globl kexec_start_address
@@ -65,6 +82,16 @@ kexec_indirection_page:
kexec_mach_type:
.long 0x0
+ /* phy addr where new kernel will expect to find boot params */
+ .globl kexec_boot_params_address
+kexec_boot_params_address:
+ .long 0x0
+
+ /* phy addr where old kernel put a copy of orig boot params */
+ .globl kexec_boot_params_copy
+kexec_boot_params_copy:
+ .long 0x0
+
relocate_new_kernel_end:
.globl relocate_new_kernel_size
Index: linux-2.6.23.17/arch/arm/kernel/setup.c
===================================================================
--- linux-2.6.23.17.orig/arch/arm/kernel/setup.c
+++ linux-2.6.23.17/arch/arm/kernel/setup.c
@@ -24,6 +24,7 @@
#include <linux/interrupt.h>
#include <linux/smp.h>
#include <linux/fs.h>
+#include <linux/kexec.h>
#include <asm/cpu.h>
#include <asm/elf.h>
@@ -770,6 +771,23 @@ static int __init customize_machine(void
}
arch_initcall(customize_machine);
+#ifdef CONFIG_KEXEC
+
+/* Physical addr of where the boot params should be for this machine */
+extern unsigned long kexec_boot_params_address;
+
+/* Physical addr of the buffer into which the boot params are copied */
+extern unsigned long kexec_boot_params_copy;
+
+/* Pointer to the boot params buffer, for manipulation and display */
+unsigned long kexec_boot_params;
+EXPORT_SYMBOL(kexec_boot_params);
+
+/* The buffer itself - make sure it is sized correctly */
+static unsigned long kexec_boot_params_buf[(KEXEC_BOOT_PARAMS_SIZE + 3) / 4];
+
+#endif
+
void __init setup_arch(char **cmdline_p)
{
struct tag *tags = (struct tag *)&init_tags;
@@ -788,6 +806,18 @@ void __init setup_arch(char **cmdline_p)
else if (mdesc->boot_params)
tags = phys_to_virt(mdesc->boot_params);
+#ifdef CONFIG_KEXEC
+ kexec_boot_params_copy = virt_to_phys(kexec_boot_params_buf);
+ kexec_boot_params = (unsigned long)kexec_boot_params_buf;
+ if (__atags_pointer) {
+ kexec_boot_params_address = __atags_pointer;
+ memcpy((void *)kexec_boot_params, tags, KEXEC_BOOT_PARAMS_SIZE);
+ } else if (mdesc->boot_params) {
+ kexec_boot_params_address = mdesc->boot_params;
+ memcpy((void *)kexec_boot_params, tags, KEXEC_BOOT_PARAMS_SIZE);
+ }
+#endif
+
/*
* If we have the old style parameters, convert them to
* a tag list.
Index: linux-2.6.23.17/include/asm-arm/kexec.h
===================================================================
--- linux-2.6.23.17.orig/include/asm-arm/kexec.h
+++ linux-2.6.23.17/include/asm-arm/kexec.h
@@ -14,6 +14,8 @@
#define KEXEC_ARCH KEXEC_ARCH_ARM
+#define KEXEC_BOOT_PARAMS_SIZE 1536
+
#ifndef __ASSEMBLY__
struct kimage;

View File

@ -1,928 +0,0 @@
Index: linux-2.6.23.17/drivers/net/via-velocity.c
===================================================================
--- linux-2.6.23.17.orig/drivers/net/via-velocity.c
+++ linux-2.6.23.17/drivers/net/via-velocity.c
@@ -96,11 +96,31 @@ MODULE_AUTHOR("VIA Networking Technologi
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("VIA Networking Velocity Family Gigabit Ethernet Adapter Driver");
+/* Valid values for vdebug (additive, this is a bitmask):
+ * 0x00 => off
+ * 0x01 => always on
+ * 0x02 => additional detail on tx (rx, too, if anyone implements same)
+ * 0x04 => detail the initialization process
+ * 0x08 => spot debug detail; to be used as developers see fit
+ */
+static int vdebug = 0;
+
+/* HAIL - these macros are for the normal 0x01-type tracing... */
+#define HAIL(S) \
+ if (vdebug&1) printk(KERN_NOTICE "%s\n", (S));
+#define HAILS(S,T) \
+ if (vdebug&1) printk(KERN_NOTICE "%s -> status=0x%x\n", (S), (T));
+
#define VELOCITY_PARAM(N,D) \
static int N[MAX_UNITS]=OPTION_DEFAULT;\
module_param_array(N, int, NULL, 0); \
MODULE_PARM_DESC(N, D);
+#define VELO_DEBUG_MIN 0
+#define VELO_DEBUG_MAX 255
+#define VELO_DEBUG_DEF 0
+VELOCITY_PARAM(velo_debug, "Debug level");
+
#define RX_DESC_MIN 64
#define RX_DESC_MAX 255
#define RX_DESC_DEF 64
@@ -385,12 +405,12 @@ static void __devinit velocity_set_int_o
if (val == -1)
*opt = def;
else if (val < min || val > max) {
- VELOCITY_PRT(MSG_LEVEL_INFO, KERN_NOTICE "%s: the value of parameter %s is invalid, the valid range is (%d-%d)\n",
- devname, name, min, max);
+ VELOCITY_PRT(MSG_LEVEL_INFO, KERN_NOTICE "via-velocity: the value of parameter %s is invalid, the valid range is (%d-%d)\n",
+ name, min, max);
*opt = def;
} else {
- VELOCITY_PRT(MSG_LEVEL_INFO, KERN_INFO "%s: set value of parameter %s to %d\n",
- devname, name, val);
+ VELOCITY_PRT(MSG_LEVEL_INFO, KERN_INFO "via-velocity: set value of parameter %s to %d\n",
+ name, val);
*opt = val;
}
}
@@ -415,12 +435,12 @@ static void __devinit velocity_set_bool_
if (val == -1)
*opt |= (def ? flag : 0);
else if (val < 0 || val > 1) {
- printk(KERN_NOTICE "%s: the value of parameter %s is invalid, the valid range is (0-1)\n",
- devname, name);
+ printk(KERN_NOTICE "via-velocity: the value of parameter %s is invalid, the valid range is (0-1)\n",
+ name);
*opt |= (def ? flag : 0);
} else {
- printk(KERN_INFO "%s: set parameter %s to %s\n",
- devname, name, val ? "TRUE" : "FALSE");
+ printk(KERN_INFO "via-velocity: set parameter %s to %s\n",
+ name, val ? "TRUE" : "FALSE");
*opt |= (val ? flag : 0);
}
}
@@ -438,6 +458,7 @@ static void __devinit velocity_set_bool_
static void __devinit velocity_get_options(struct velocity_opt *opts, int index, char *devname)
{
+ velocity_set_int_opt(&opts->velo_debug, velo_debug[index], VELO_DEBUG_MIN, VELO_DEBUG_MAX, VELO_DEBUG_DEF, "velo_debug", devname);
velocity_set_int_opt(&opts->rx_thresh, rx_thresh[index], RX_THRESH_MIN, RX_THRESH_MAX, RX_THRESH_DEF, "rx_thresh", devname);
velocity_set_int_opt(&opts->DMA_length, DMA_length[index], DMA_LENGTH_MIN, DMA_LENGTH_MAX, DMA_LENGTH_DEF, "DMA_length", devname);
velocity_set_int_opt(&opts->numrx, RxDescriptors[index], RX_DESC_MIN, RX_DESC_MAX, RX_DESC_DEF, "RxDescriptors", devname);
@@ -452,6 +473,7 @@ static void __devinit velocity_get_optio
velocity_set_int_opt((int *) &opts->wol_opts, wol_opts[index], WOL_OPT_MIN, WOL_OPT_MAX, WOL_OPT_DEF, "Wake On Lan options", devname);
velocity_set_int_opt((int *) &opts->int_works, int_works[index], INT_WORKS_MIN, INT_WORKS_MAX, INT_WORKS_DEF, "Interrupt service works", devname);
opts->numrx = (opts->numrx & ~3);
+ vdebug = opts->velo_debug;
}
/**
@@ -466,6 +488,8 @@ static void velocity_init_cam_filter(str
{
struct mac_regs __iomem * regs = vptr->mac_regs;
+ HAIL("velocity_init_cam_filter");
+
/* Turn on MCFG_PQEN, turn off MCFG_RTGOPT */
WORD_REG_BITS_SET(MCFG_PQEN, MCFG_RTGOPT, &regs->MCFG);
WORD_REG_BITS_ON(MCFG_VIDFR, &regs->MCFG);
@@ -484,14 +508,12 @@ static void velocity_init_cam_filter(str
WORD_REG_BITS_ON(MCFG_RTGOPT, &regs->MCFG);
mac_set_cam(regs, 0, (u8 *) & (vptr->options.vid), VELOCITY_VLAN_ID_CAM);
- vptr->vCAMmask[0] |= 1;
- mac_set_cam_mask(regs, vptr->vCAMmask, VELOCITY_VLAN_ID_CAM);
} else {
u16 temp = 0;
mac_set_cam(regs, 0, (u8 *) &temp, VELOCITY_VLAN_ID_CAM);
- temp = 1;
- mac_set_cam_mask(regs, (u8 *) &temp, VELOCITY_VLAN_ID_CAM);
}
+ vptr->vCAMmask[0] |= 1;
+ mac_set_cam_mask(regs, vptr->vCAMmask, VELOCITY_VLAN_ID_CAM);
}
/**
@@ -508,13 +530,15 @@ static void velocity_rx_reset(struct vel
struct mac_regs __iomem * regs = vptr->mac_regs;
int i;
+ HAIL("velocity_rx_reset");
vptr->rd_dirty = vptr->rd_filled = vptr->rd_curr = 0;
/*
* Init state, all RD entries belong to the NIC
*/
for (i = 0; i < vptr->options.numrx; ++i)
- vptr->rd_ring[i].rdesc0.owner = OWNED_BY_NIC;
+ /* vptr->rd_ring[i].rdesc0.owner = OWNED_BY_NIC; BE */
+ vptr->rd_ring[i].rdesc0 |= cpu_to_le32(BE_OWNED_BY_NIC); /* BE */
writew(vptr->options.numrx, &regs->RBRDU);
writel(vptr->rd_pool_dma, &regs->RDBaseLo);
@@ -537,12 +561,15 @@ static void velocity_init_registers(stru
struct mac_regs __iomem * regs = vptr->mac_regs;
int i, mii_status;
+ if (vdebug&5) printk(KERN_NOTICE "velocity_init_registers: entering\n");
+
mac_wol_reset(regs);
switch (type) {
case VELOCITY_INIT_RESET:
case VELOCITY_INIT_WOL:
+ if (vdebug&4) printk(KERN_NOTICE "velocity_init_registers: RESET or WOL\n");
netif_stop_queue(vptr->dev);
/*
@@ -570,12 +597,13 @@ static void velocity_init_registers(stru
case VELOCITY_INIT_COLD:
default:
+ if (vdebug&4) printk(KERN_NOTICE "velocity_init_registers: COLD or default\n");
/*
* Do reset
*/
velocity_soft_reset(vptr);
+ if (vdebug&4) printk(KERN_NOTICE "velocity_init_registers: soft reset complete.\n");
mdelay(5);
-
mac_eeprom_reload(regs);
for (i = 0; i < 6; i++) {
writeb(vptr->dev->dev_addr[i], &(regs->PAR[i]));
@@ -593,11 +621,16 @@ static void velocity_init_registers(stru
*/
BYTE_REG_BITS_SET(CFGB_OFSET, (CFGB_CRANDOM | CFGB_CAP | CFGB_MBA | CFGB_BAKOPT), &regs->CFGB);
+ if (vdebug&4) printk(KERN_NOTICE "velocity_init_registers: Initializing CAM filter\n");
/*
* Init CAM filter
*/
+ if (vdebug&8) printk(KERN_NOTICE "velocity: spot debug: about to init CAM filters\n");
+ mdelay(5); /* MJW - ARM processors, kernel 2.6.19 - this fixes oopses and hangs */
velocity_init_cam_filter(vptr);
+ if (vdebug&8) printk(KERN_NOTICE "velocity: spot debug: init CAM filters complete\n");
+ if (vdebug&4) printk(KERN_NOTICE "velocity_init_registers: Setting packet filter\n");
/*
* Set packet filter: Receive directed and broadcast address
*/
@@ -607,10 +640,12 @@ static void velocity_init_registers(stru
* Enable MII auto-polling
*/
enable_mii_autopoll(regs);
+ if (vdebug&4) printk(KERN_NOTICE "velocity_init_registers: enable_mii_autopoll complete.\n");
vptr->int_mask = INT_MASK_DEF;
- writel(cpu_to_le32(vptr->rd_pool_dma), &regs->RDBaseLo);
+ /* writel(cpu_to_le32(vptr->rd_pool_dma), &regs->RDBaseLo); BE */
+ writel((vptr->rd_pool_dma), &regs->RDBaseLo); /* BE */
writew(vptr->options.numrx - 1, &regs->RDCSize);
mac_rx_queue_run(regs);
mac_rx_queue_wake(regs);
@@ -618,10 +653,13 @@ static void velocity_init_registers(stru
writew(vptr->options.numtx - 1, &regs->TDCSize);
for (i = 0; i < vptr->num_txq; i++) {
- writel(cpu_to_le32(vptr->td_pool_dma[i]), &(regs->TDBaseLo[i]));
+ /* writel(cpu_to_le32(vptr->td_pool_dma[i]), &(regs->TDBaseLo[i])); BE */
+ writel((vptr->td_pool_dma[i]), &(regs->TDBaseLo[i])); /* BE */
mac_tx_queue_run(regs, i);
}
+ if (vdebug&4) printk(KERN_NOTICE "velocity_init_registers: DMA settings complete.\n");
+
init_flow_control_register(vptr);
writel(CR0_STOP, &regs->CR0Clr);
@@ -640,8 +678,10 @@ static void velocity_init_registers(stru
enable_flow_control_ability(vptr);
mac_hw_mibs_init(regs);
+ if (vdebug&4) printk(KERN_NOTICE "velocity_init_registers: Set interrupt mask\n");
mac_write_int_mask(vptr->int_mask, regs);
mac_clear_isr(regs);
+ if (vdebug&4) printk(KERN_NOTICE "velocity_init_registers: complete.\n");
}
}
@@ -659,6 +699,7 @@ static int velocity_soft_reset(struct ve
struct mac_regs __iomem * regs = vptr->mac_regs;
int i = 0;
+ HAIL("velocity_soft_reset");
writel(CR0_SFRST, &regs->CR0Set);
for (i = 0; i < W_MAX_TIMEOUT; i++) {
@@ -722,6 +763,7 @@ static int __devinit velocity_found1(str
VELOCITY_FULL_DRV_NAM, VELOCITY_VERSION);
printk(KERN_INFO "Copyright (c) 2002, 2003 VIA Networking Technologies, Inc.\n");
printk(KERN_INFO "Copyright (c) 2004 Red Hat Inc.\n");
+ printk(KERN_INFO "BE support, misc. fixes MJW 01Jan2007 - may be unstable\n");
first = 0;
}
@@ -934,6 +976,7 @@ static int velocity_init_rings(struct ve
dma_addr_t pool_dma;
u8 *pool;
+ HAIL("velocity_init_rings");
/*
* Allocate all RD/TD rings a single pool
*/
@@ -996,6 +1039,7 @@ static int velocity_init_rings(struct ve
static void velocity_free_rings(struct velocity_info *vptr)
{
int size;
+ HAIL("velocity_free_rings");
size = vptr->options.numrx * sizeof(struct rx_desc) +
vptr->options.numtx * sizeof(struct tx_desc) * vptr->num_txq;
@@ -1012,6 +1056,7 @@ static inline void velocity_give_many_rx
struct mac_regs __iomem *regs = vptr->mac_regs;
int avail, dirty, unusable;
+ HAIL("velocity_give_many_rx_descs");
/*
* RD number must be equal to 4X per hardware spec
* (programming guide rev 1.20, p.13)
@@ -1025,7 +1070,8 @@ static inline void velocity_give_many_rx
dirty = vptr->rd_dirty - unusable;
for (avail = vptr->rd_filled & 0xfffc; avail; avail--) {
dirty = (dirty > 0) ? dirty - 1 : vptr->options.numrx - 1;
- vptr->rd_ring[dirty].rdesc0.owner = OWNED_BY_NIC;
+ /* vptr->rd_ring[dirty].rdesc0.owner = OWNED_BY_NIC; BE */
+ vptr->rd_ring[dirty].rdesc0 |= cpu_to_le32(BE_OWNED_BY_NIC); /* BE */
}
writew(vptr->rd_filled & 0xfffc, &regs->RBRDU);
@@ -1035,12 +1081,14 @@ static inline void velocity_give_many_rx
static int velocity_rx_refill(struct velocity_info *vptr)
{
int dirty = vptr->rd_dirty, done = 0, ret = 0;
+ HAIL("velocity_rx_refill");
do {
struct rx_desc *rd = vptr->rd_ring + dirty;
/* Fine for an all zero Rx desc at init time as well */
- if (rd->rdesc0.owner == OWNED_BY_NIC)
+ /* if (rd->rdesc0.owner == OWNED_BY_NIC) BE */
+ if (rd->rdesc0 & cpu_to_le32(BE_OWNED_BY_NIC)) /* BE */
break;
if (!vptr->rd_info[dirty].skb) {
@@ -1075,6 +1123,7 @@ static int velocity_init_rd_ring(struct
unsigned int rsize = sizeof(struct velocity_rd_info) *
vptr->options.numrx;
+ HAIL("velocity_init_rd_ring");
vptr->rd_info = kmalloc(rsize, GFP_KERNEL);
if(vptr->rd_info == NULL)
goto out;
@@ -1104,6 +1153,7 @@ static void velocity_free_rd_ring(struct
{
int i;
+ HAIL("velocity_free_rd_ring");
if (vptr->rd_info == NULL)
return;
@@ -1145,6 +1195,7 @@ static int velocity_init_td_ring(struct
unsigned int tsize = sizeof(struct velocity_td_info) *
vptr->options.numtx;
+ HAIL("velocity_init_td_ring");
/* Init the TD ring entries */
for (j = 0; j < vptr->num_txq; j++) {
curr = vptr->td_pool_dma[j];
@@ -1181,6 +1232,7 @@ static void velocity_free_td_ring_entry(
struct velocity_td_info * td_info = &(vptr->td_infos[q][n]);
int i;
+ HAIL("velocity_free_td_ring_entry");
if (td_info == NULL)
return;
@@ -1210,6 +1262,7 @@ static void velocity_free_td_ring(struct
{
int i, j;
+ HAIL("velocity_free_td_ring");
for (j = 0; j < vptr->num_txq; j++) {
if (vptr->td_infos[j] == NULL)
continue;
@@ -1237,34 +1290,42 @@ static int velocity_rx_srv(struct veloci
struct net_device_stats *stats = &vptr->stats;
int rd_curr = vptr->rd_curr;
int works = 0;
+ u16 wRSR; /* BE */
+ HAILS("velocity_rx_srv", status);
do {
struct rx_desc *rd = vptr->rd_ring + rd_curr;
if (!vptr->rd_info[rd_curr].skb)
break;
- if (rd->rdesc0.owner == OWNED_BY_NIC)
+ /* if (rd->rdesc0.owner == OWNED_BY_NIC) BE */
+ if (rd->rdesc0 & cpu_to_le32(BE_OWNED_BY_NIC)) /* BE */
break;
rmb();
+ wRSR = (u16)(cpu_to_le32(rd->rdesc0)); /* BE */
/*
* Don't drop CE or RL error frame although RXOK is off
*/
- if ((rd->rdesc0.RSR & RSR_RXOK) || (!(rd->rdesc0.RSR & RSR_RXOK) && (rd->rdesc0.RSR & (RSR_CE | RSR_RL)))) {
+ /* if ((rd->rdesc0.RSR & RSR_RXOK) || (!(rd->rdesc0.RSR & RSR_RXOK) && (rd->rdesc0.RSR & (RSR_CE | RSR_RL)))) { BE */
+ if ((wRSR & RSR_RXOK) || (!(wRSR & RSR_RXOK) && (wRSR & (RSR_CE | RSR_RL)))) { /* BE */
if (velocity_receive_frame(vptr, rd_curr) < 0)
stats->rx_dropped++;
} else {
- if (rd->rdesc0.RSR & RSR_CRC)
+ /* if (rd->rdesc0.RSR & RSR_CRC) BE */
+ if (wRSR & RSR_CRC) /* BE */
stats->rx_crc_errors++;
- if (rd->rdesc0.RSR & RSR_FAE)
+ /* if (rd->rdesc0.RSR & RSR_FAE) BE */
+ if (wRSR & RSR_FAE) /* BE */
stats->rx_frame_errors++;
stats->rx_dropped++;
}
- rd->inten = 1;
+ /* rd->inten = 1; BE */
+ rd->ltwo |= cpu_to_le32(BE_INT_ENABLE); /* BE */
vptr->dev->last_rx = jiffies;
@@ -1295,13 +1356,21 @@ static int velocity_rx_srv(struct veloci
static inline void velocity_rx_csum(struct rx_desc *rd, struct sk_buff *skb)
{
+ u8 bCSM;
+ HAIL("velocity_rx_csum");
skb->ip_summed = CHECKSUM_NONE;
- if (rd->rdesc1.CSM & CSM_IPKT) {
- if (rd->rdesc1.CSM & CSM_IPOK) {
- if ((rd->rdesc1.CSM & CSM_TCPKT) ||
- (rd->rdesc1.CSM & CSM_UDPKT)) {
- if (!(rd->rdesc1.CSM & CSM_TUPOK)) {
+// if (rd->rdesc1.CSM & CSM_IPKT) {
+// if (rd->rdesc1.CSM & CSM_IPOK) {
+// if ((rd->rdesc1.CSM & CSM_TCPKT) ||
+// (rd->rdesc1.CSM & CSM_UDPKT)) {
+// if (!(rd->rdesc1.CSM & CSM_TUPOK)) {
+ bCSM = (u8)(cpu_to_le32(rd->rdesc1) >> 16); /* BE */
+ if (bCSM & CSM_IPKT) {
+ if (bCSM & CSM_IPOK) {
+ if ((bCSM & CSM_TCPKT) ||
+ (bCSM & CSM_UDPKT)) {
+ if (!(bCSM & CSM_TUPOK)) { /* BE */
return;
}
}
@@ -1327,9 +1396,11 @@ static inline int velocity_rx_copy(struc
{
int ret = -1;
+ HAIL("velocity_rx_copy");
if (pkt_size < rx_copybreak) {
struct sk_buff *new_skb;
+ HAIL("velocity_rx_copy (working...)");
new_skb = dev_alloc_skb(pkt_size + 2);
if (new_skb) {
new_skb->dev = vptr->dev;
@@ -1360,10 +1431,12 @@ static inline int velocity_rx_copy(struc
static inline void velocity_iph_realign(struct velocity_info *vptr,
struct sk_buff *skb, int pkt_size)
{
+ HAIL("velocity_iph_realign");
/* FIXME - memmove ? */
if (vptr->flags & VELOCITY_FLAGS_IP_ALIGN) {
int i;
+ HAIL("velocity_iph_realign (working...)");
for (i = pkt_size; i >= 0; i--)
*(skb->data + i + 2) = *(skb->data + i);
skb_reserve(skb, 2);
@@ -1382,19 +1455,27 @@ static inline void velocity_iph_realign(
static int velocity_receive_frame(struct velocity_info *vptr, int idx)
{
void (*pci_action)(struct pci_dev *, dma_addr_t, size_t, int);
+ u16 pkt_len; /* BE */
+ u16 wRSR; /* BE */
+ struct sk_buff *skb;
struct net_device_stats *stats = &vptr->stats;
struct velocity_rd_info *rd_info = &(vptr->rd_info[idx]);
struct rx_desc *rd = &(vptr->rd_ring[idx]);
- int pkt_len = rd->rdesc0.len;
- struct sk_buff *skb;
+ /* int pkt_len = rd->rdesc0.len BE */;
+
+ pkt_len = ((cpu_to_le32(rd->rdesc0) >> 16) & 0x00003FFFUL); /* BE */
+ wRSR = (u16)(cpu_to_le32(rd->rdesc0)); /* BE */
- if (rd->rdesc0.RSR & (RSR_STP | RSR_EDP)) {
+ HAIL("velocity_receive_frame");
+ /* if (rd->rdesc0.RSR & (RSR_STP | RSR_EDP)) { BE */
+ if (wRSR & (RSR_STP | RSR_EDP)) { /* BE */
VELOCITY_PRT(MSG_LEVEL_VERBOSE, KERN_ERR " %s : the received frame span multple RDs.\n", vptr->dev->name);
stats->rx_length_errors++;
return -EINVAL;
}
- if (rd->rdesc0.RSR & RSR_MAR)
+ /* if (rd->rdesc0.RSR & RSR_MAR) BE */
+ if (wRSR & RSR_MAR) /* BE */
vptr->stats.multicast++;
skb = rd_info->skb;
@@ -1407,7 +1488,8 @@ static int velocity_receive_frame(struct
*/
if (vptr->flags & VELOCITY_FLAGS_VAL_PKT_LEN) {
- if (rd->rdesc0.RSR & RSR_RL) {
+ /* if (rd->rdesc0.RSR & RSR_RL) { BE */
+ if (wRSR & RSR_RL) { /* BE */
stats->rx_length_errors++;
return -EINVAL;
}
@@ -1451,6 +1533,7 @@ static int velocity_alloc_rx_buf(struct
struct rx_desc *rd = &(vptr->rd_ring[idx]);
struct velocity_rd_info *rd_info = &(vptr->rd_info[idx]);
+ HAIL("velocity_alloc_rx_buf");
rd_info->skb = dev_alloc_skb(vptr->rx_buf_sz + 64);
if (rd_info->skb == NULL)
return -ENOMEM;
@@ -1468,10 +1551,14 @@ static int velocity_alloc_rx_buf(struct
*/
*((u32 *) & (rd->rdesc0)) = 0;
- rd->len = cpu_to_le32(vptr->rx_buf_sz);
- rd->inten = 1;
+ /* rd->len = cpu_to_le32(vptr->rx_buf_sz); BE */
+ /* rd->inten = 1; BE */
rd->pa_low = cpu_to_le32(rd_info->skb_dma);
- rd->pa_high = 0;
+ /* rd->pa_high = 0; BE */
+ rd->ltwo &= cpu_to_le32(0xC000FFFFUL); /* BE */
+ rd->ltwo |= cpu_to_le32((vptr->rx_buf_sz << 16)); /* BE */
+ rd->ltwo |= cpu_to_le32(BE_INT_ENABLE); /* BE */
+ rd->ltwo &= cpu_to_le32(0xFFFF0000UL); /* BE */
return 0;
}
@@ -1492,9 +1579,11 @@ static int velocity_tx_srv(struct veloci
int full = 0;
int idx;
int works = 0;
+ u16 wTSR; /* BE */
struct velocity_td_info *tdinfo;
struct net_device_stats *stats = &vptr->stats;
+ HAILS("velocity_tx_srv", status);
for (qnum = 0; qnum < vptr->num_txq; qnum++) {
for (idx = vptr->td_tail[qnum]; vptr->td_used[qnum] > 0;
idx = (idx + 1) % vptr->options.numtx) {
@@ -1505,22 +1594,29 @@ static int velocity_tx_srv(struct veloci
td = &(vptr->td_rings[qnum][idx]);
tdinfo = &(vptr->td_infos[qnum][idx]);
- if (td->tdesc0.owner == OWNED_BY_NIC)
+ /* if (td->tdesc0.owner == OWNED_BY_NIC) BE */
+ if (td->tdesc0 & cpu_to_le32(BE_OWNED_BY_NIC)) /* BE */
break;
if ((works++ > 15))
break;
- if (td->tdesc0.TSR & TSR0_TERR) {
+ wTSR = (u16)cpu_to_le32(td->tdesc0);
+ /* if (td->tdesc0.TSR & TSR0_TERR) { BE */
+ if (wTSR & TSR0_TERR) { /* BE */
stats->tx_errors++;
stats->tx_dropped++;
- if (td->tdesc0.TSR & TSR0_CDH)
+ /* if (td->tdesc0.TSR & TSR0_CDH) BE */
+ if (wTSR & TSR0_CDH) /* BE */
stats->tx_heartbeat_errors++;
- if (td->tdesc0.TSR & TSR0_CRS)
+ /* if (td->tdesc0.TSR & TSR0_CRS) BE */
+ if (wTSR & TSR0_CRS) /* BE */
stats->tx_carrier_errors++;
- if (td->tdesc0.TSR & TSR0_ABT)
+ /* if (td->tdesc0.TSR & TSR0_ABT) BE */
+ if (wTSR & TSR0_ABT) /* BE */
stats->tx_aborted_errors++;
- if (td->tdesc0.TSR & TSR0_OWC)
+ /* if (td->tdesc0.TSR & TSR0_OWC) BE */
+ if (wTSR & TSR0_OWC) /* BE */
stats->tx_window_errors++;
} else {
stats->tx_packets++;
@@ -1609,6 +1705,7 @@ static void velocity_print_link_status(s
static void velocity_error(struct velocity_info *vptr, int status)
{
+ HAILS("velocity_error", status);
if (status & ISR_TXSTLI) {
struct mac_regs __iomem * regs = vptr->mac_regs;
@@ -1698,6 +1795,7 @@ static void velocity_free_tx_buf(struct
struct sk_buff *skb = tdinfo->skb;
int i;
+ HAIL("velocity_free_tx_buf");
/*
* Don't unmap the pre-allocated tx_bufs
*/
@@ -1901,6 +1999,7 @@ static int velocity_xmit(struct sk_buff
struct velocity_td_info *tdinfo;
unsigned long flags;
int index;
+ u32 lbufsz; /* BE */
int pktlen = skb->len;
@@ -1917,9 +2016,18 @@ static int velocity_xmit(struct sk_buff
td_ptr = &(vptr->td_rings[qnum][index]);
tdinfo = &(vptr->td_infos[qnum][index]);
- td_ptr->tdesc1.TCPLS = TCPLS_NORMAL;
- td_ptr->tdesc1.TCR = TCR0_TIC;
- td_ptr->td_buf[0].queue = 0;
+ td_ptr->tdesc0 = 0x00000000UL; /* BE */
+ td_ptr->tdesc1 = 0x00000000UL; /* BE */
+
+ /* td_ptr->tdesc1.TCPLS = TCPLS_NORMAL; BE */
+ td_ptr->tdesc1 &= cpu_to_le32(0xfcffffffUL); /* BE */
+ td_ptr->tdesc1 |= cpu_to_le32(((u32)TCPLS_NORMAL) << 24); /* BE */
+
+ /* td_ptr->tdesc1.TCR = TCR0_TIC; BE */
+ td_ptr->tdesc1 |= cpu_to_le32(BE_TCR_TIC); /* BE */
+
+ /* td_ptr->td_buf[0].queue = 0; BE */
+ td_ptr->td_buf[0].ltwo &= cpu_to_le32(~BE_QUEUE_ENABLE); /* BE */
/*
* Pad short frames.
@@ -1931,20 +2039,36 @@ static int velocity_xmit(struct sk_buff
memset(tdinfo->buf + skb->len, 0, ETH_ZLEN - skb->len);
tdinfo->skb = skb;
tdinfo->skb_dma[0] = tdinfo->buf_dma;
- td_ptr->tdesc0.pktsize = pktlen;
+ /* td_ptr->tdesc0.pktsize = pktlen; */
+ td_ptr->tdesc0 &= cpu_to_le32(0xc000ffffUL); /* BE */
+ lbufsz = pktlen; /* Assign, and make sure it's unsigned 32 bits - BE */
+ lbufsz = lbufsz << 16; /* BE - shift over */
+ td_ptr->tdesc0 |= cpu_to_le32(lbufsz); /* BE */
+
td_ptr->td_buf[0].pa_low = cpu_to_le32(tdinfo->skb_dma[0]);
- td_ptr->td_buf[0].pa_high = 0;
- td_ptr->td_buf[0].bufsize = td_ptr->tdesc0.pktsize;
+ /* td_ptr->td_buf[0].pa_high = 0; */
+ /* td_ptr->td_buf[0].bufsize = td_ptr->tdesc0.pktsize; */
+ td_ptr->td_buf[0].ltwo = cpu_to_le32(lbufsz); /* BE */
tdinfo->nskb_dma = 1;
- td_ptr->tdesc1.CMDZ = 2;
+ /* td_ptr->tdesc1.CMDZ = 2; */
+ td_ptr->tdesc1 &= cpu_to_le32(0x0fffffffUL); /* BE */
+ td_ptr->tdesc1 |= cpu_to_le32(((u32)0x2) << 28); /* BE */
} else
#ifdef VELOCITY_ZERO_COPY_SUPPORT
+ /*
+ * BE - NOTE on the VELOCITY_ZERO_COPY_SUPPORT:
+ * This block of code has NOT been patched up for BE support, as
+ * it is certainly broken -- if it compiles at all. Since the BE
+ * fixes depend on the broken code, attempts to convert to BE support
+ * would almost certainly confuse more than help.
+ */
if (skb_shinfo(skb)->nr_frags > 0) {
int nfrags = skb_shinfo(skb)->nr_frags;
tdinfo->skb = skb;
if (nfrags > 6) {
skb_copy_from_linear_data(skb, tdinfo->buf, skb->len);
tdinfo->skb_dma[0] = tdinfo->buf_dma;
+ /* BE: Er, exactly what value are we assigning in this next line? */
td_ptr->tdesc0.pktsize =
td_ptr->td_buf[0].pa_low = cpu_to_le32(tdinfo->skb_dma[0]);
td_ptr->td_buf[0].pa_high = 0;
@@ -1961,6 +2085,7 @@ static int velocity_xmit(struct sk_buff
/* FIXME: support 48bit DMA later */
td_ptr->td_buf[i].pa_low = cpu_to_le32(tdinfo->skb_dma);
td_ptr->td_buf[i].pa_high = 0;
+ /* BE: This next line can't be right: */
td_ptr->td_buf[i].bufsize = skb->len->skb->data_len;
for (i = 0; i < nfrags; i++) {
@@ -1978,7 +2103,7 @@ static int velocity_xmit(struct sk_buff
}
} else
-#endif
+#endif /* (broken) VELOCITY_ZERO_COPY_SUPPORT */
{
/*
* Map the linear network buffer into PCI space and
@@ -1986,19 +2111,30 @@ static int velocity_xmit(struct sk_buff
*/
tdinfo->skb = skb;
tdinfo->skb_dma[0] = pci_map_single(vptr->pdev, skb->data, pktlen, PCI_DMA_TODEVICE);
- td_ptr->tdesc0.pktsize = pktlen;
+ /* td_ptr->tdesc0.pktsize = pktlen; BE */
+ td_ptr->tdesc0 &= cpu_to_le32(0xc000ffffUL); /* BE */
+ lbufsz = pktlen; /* Assign, and make sure it's unsigned 32 bits - BE */
+ lbufsz = lbufsz << 16; /* BE */
+ td_ptr->tdesc0 |= cpu_to_le32(lbufsz); /* BE */
td_ptr->td_buf[0].pa_low = cpu_to_le32(tdinfo->skb_dma[0]);
- td_ptr->td_buf[0].pa_high = 0;
- td_ptr->td_buf[0].bufsize = td_ptr->tdesc0.pktsize;
+ /* td_ptr->td_buf[0].pa_high = 0; BE */
+ /* td_ptr->td_buf[0].bufsize = td_ptr->tdesc0.pktsize; BE */
+ td_ptr->td_buf[0].ltwo = cpu_to_le32(lbufsz); /* BE */
+
tdinfo->nskb_dma = 1;
- td_ptr->tdesc1.CMDZ = 2;
+ /* td_ptr->tdesc1.CMDZ = 2; BE */
+ td_ptr->tdesc1 &= cpu_to_le32(0x0fffffffUL); /* BE */
+ td_ptr->tdesc1 |= cpu_to_le32(((u32)0x2) << 28);/* BE */
}
if (vptr->flags & VELOCITY_FLAGS_TAGGING) {
- td_ptr->tdesc1.pqinf.VID = (vptr->options.vid & 0xfff);
- td_ptr->tdesc1.pqinf.priority = 0;
- td_ptr->tdesc1.pqinf.CFI = 0;
- td_ptr->tdesc1.TCR |= TCR0_VETAG;
+ /* td_ptr->tdesc1.pqinf.priority = 0; BE */
+ /* td_ptr->tdesc1.pqinf.CFI = 0; BE */
+ td_ptr->tdesc1 &= cpu_to_le32(0xFFFF0000UL); /* BE */
+ /* td_ptr->tdesc1.pqinf.VID = (vptr->options.vid & 0xfff); BE */
+ td_ptr->tdesc1 |= cpu_to_le32((vptr->options.vid & 0xfff)); /* BE */
+ /* td_ptr->tdesc1.TCR |= TCR0_VETAG; BE */
+ td_ptr->tdesc1 |= cpu_to_le32(BE_TCR_VETAG); /* BE */
}
/*
@@ -2008,26 +2144,34 @@ static int velocity_xmit(struct sk_buff
&& (skb->ip_summed == CHECKSUM_PARTIAL)) {
const struct iphdr *ip = ip_hdr(skb);
if (ip->protocol == IPPROTO_TCP)
- td_ptr->tdesc1.TCR |= TCR0_TCPCK;
+ /* td_ptr->tdesc1.TCR |= TCR0_TCPCK; BE */
+ td_ptr->tdesc1 |= cpu_to_le32(BE_TCR_TCPCK); /* BE */
else if (ip->protocol == IPPROTO_UDP)
- td_ptr->tdesc1.TCR |= (TCR0_UDPCK);
- td_ptr->tdesc1.TCR |= TCR0_IPCK;
- }
+ /* td_ptr->tdesc1.TCR |= (TCR0_UDPCK); BE */
+ td_ptr->tdesc1 |= cpu_to_le32(BE_TCR_UDPCK); /* BE */
+ /* td_ptr->tdesc1.TCR |= TCR0_IPCK; BE */
+ td_ptr->tdesc1 |= cpu_to_le32(BE_TCR_IPCK); /* BE */
+ }
{
int prev = index - 1;
if (prev < 0)
prev = vptr->options.numtx - 1;
- td_ptr->tdesc0.owner = OWNED_BY_NIC;
+ /* td_ptr->tdesc0.owner = OWNED_BY_NIC; BE */
+ td_ptr->tdesc0 |= cpu_to_le32(BE_OWNED_BY_NIC); /* BE */
vptr->td_used[qnum]++;
vptr->td_curr[qnum] = (index + 1) % vptr->options.numtx;
if (AVAIL_TD(vptr, qnum) < 1)
netif_stop_queue(dev);
- td_ptr = &(vptr->td_rings[qnum][prev]);
- td_ptr->td_buf[0].queue = 1;
+ td_ptr = &(vptr->td_rings[qnum][prev]);
+ /* td_ptr->td_buf[0].queue = 1; BE */
+ td_ptr->td_buf[0].ltwo |= cpu_to_le32(BE_QUEUE_ENABLE); /* BE */
+ if (vdebug&2) printk(KERN_NOTICE "velocity_xmit: (%s) len=%d idx=%d tdesc0=0x%x tdesc1=0x%x ltwo=0x%x\n",
+ (pktlen<ETH_ZLEN) ? "short" : "normal", pktlen, index,
+ td_ptr->tdesc0, td_ptr->tdesc1, td_ptr->td_buf[0].ltwo);
mac_tx_queue_wake(vptr->mac_regs, qnum);
}
dev->trans_start = jiffies;
@@ -2053,7 +2197,7 @@ static int velocity_intr(int irq, void *
u32 isr_status;
int max_count = 0;
-
+ HAIL("velocity_intr");
spin_lock(&vptr->lock);
isr_status = mac_read_isr(vptr->mac_regs);
@@ -2072,7 +2216,10 @@ static int velocity_intr(int irq, void *
while (isr_status != 0) {
mac_write_isr(vptr->mac_regs, isr_status);
- if (isr_status & (~(ISR_PRXI | ISR_PPRXI | ISR_PTXI | ISR_PPTXI)))
+ HAILS("velocity_intr",isr_status);
+ /* MJW - velocity_error is ALWAYS called; need to mask off some other flags */
+ /* if (isr_status & (~(ISR_PRXI | ISR_PPRXI | ISR_PTXI | ISR_PPTXI))) */
+ if (isr_status & (~(ISR_PRXI | ISR_PPRXI | ISR_PTXI | ISR_PPTXI | ISR_PTX0I | ISR_ISR0)))
velocity_error(vptr, isr_status);
if (isr_status & (ISR_PRXI | ISR_PPRXI))
max_count += velocity_rx_srv(vptr, isr_status);
@@ -2110,6 +2257,7 @@ static void velocity_set_multi(struct ne
int i;
struct dev_mc_list *mclist;
+ HAIL("velocity_set_multi");
if (dev->flags & IFF_PROMISC) { /* Set promiscuous. */
writel(0xffffffff, &regs->MARCAM[0]);
writel(0xffffffff, &regs->MARCAM[4]);
@@ -2153,6 +2301,7 @@ static struct net_device_stats *velocity
{
struct velocity_info *vptr = netdev_priv(dev);
+ HAIL("net_device_stats");
/* If the hardware is down, don't touch MII */
if(!netif_running(dev))
return &vptr->stats;
@@ -2197,6 +2346,7 @@ static int velocity_ioctl(struct net_dev
struct velocity_info *vptr = netdev_priv(dev);
int ret;
+ HAIL("velocity_ioctl");
/* If we are asked for information and the device is power
saving then we need to bring the device back up to talk to it */
@@ -2415,6 +2565,7 @@ static int velocity_mii_read(struct mac_
{
u16 ww;
+ HAIL("velocity_mii_read");
/*
* Disable MIICR_MAUTO, so that mii addr can be set normally
*/
@@ -2451,6 +2602,7 @@ static int velocity_mii_write(struct mac
{
u16 ww;
+ HAIL("velocity_mii_write");
/*
* Disable MIICR_MAUTO, so that mii addr can be set normally
*/
Index: linux-2.6.23.17/drivers/net/via-velocity.h
===================================================================
--- linux-2.6.23.17.orig/drivers/net/via-velocity.h
+++ linux-2.6.23.17/drivers/net/via-velocity.h
@@ -196,64 +196,70 @@
* Receive descriptor
*/
-struct rdesc0 {
- u16 RSR; /* Receive status */
- u16 len:14; /* Received packet length */
- u16 reserved:1;
- u16 owner:1; /* Who owns this buffer ? */
-};
-
-struct rdesc1 {
- u16 PQTAG;
- u8 CSM;
- u8 IPKT;
-};
+//struct rdesc0 {
+// u16 RSR; /* Receive status */
+// u16 len:14; /* Received packet length */
+// u16 reserved:1;
+// u16 owner:1; /* Who owns this buffer ? */
+//};
+
+//struct rdesc1 {
+// u16 PQTAG;
+// u8 CSM;
+// u8 IPKT;
+//};
struct rx_desc {
- struct rdesc0 rdesc0;
- struct rdesc1 rdesc1;
+// struct rdesc0 rdesc0;
+// struct rdesc1 rdesc1;
+ u32 rdesc0;
+ u32 rdesc1;
u32 pa_low; /* Low 32 bit PCI address */
- u16 pa_high; /* Next 16 bit PCI address (48 total) */
- u16 len:15; /* Frame size */
- u16 inten:1; /* Enable interrupt */
+// u16 pa_high; /* Next 16 bit PCI address (48 total) */
+// u16 len:15; /* Frame size */
+// u16 inten:1; /* Enable interrupt */
+ u32 ltwo;
} __attribute__ ((__packed__));
/*
* Transmit descriptor
*/
-struct tdesc0 {
- u16 TSR; /* Transmit status register */
- u16 pktsize:14; /* Size of frame */
- u16 reserved:1;
- u16 owner:1; /* Who owns the buffer */
-};
-
-struct pqinf { /* Priority queue info */
- u16 VID:12;
- u16 CFI:1;
- u16 priority:3;
-} __attribute__ ((__packed__));
-
-struct tdesc1 {
- struct pqinf pqinf;
- u8 TCR;
- u8 TCPLS:2;
- u8 reserved:2;
- u8 CMDZ:4;
-} __attribute__ ((__packed__));
+//struct tdesc0 {
+// u16 TSR; /* Transmit status register */
+// u16 pktsize:14; /* Size of frame */
+// u16 reserved:1;
+// u16 owner:1; /* Who owns the buffer */
+//};
+
+//struct pqinf { /* Priority queue info */
+// u16 VID:12;
+// u16 CFI:1;
+// u16 priority:3;
+//} __attribute__ ((__packed__));
+
+//struct tdesc1 {
+// struct pqinf pqinf;
+// u8 TCR;
+// u8 TCPLS:2;
+// u8 reserved:2;
+// u8 CMDZ:4;
+//} __attribute__ ((__packed__));
struct td_buf {
u32 pa_low;
- u16 pa_high;
- u16 bufsize:14;
- u16 reserved:1;
- u16 queue:1;
+// u16 pa_high;
+// u16 bufsize:14;
+// u16 reserved:1;
+// u16 queue:1;
+ u32 ltwo;
} __attribute__ ((__packed__));
struct tx_desc {
- struct tdesc0 tdesc0;
- struct tdesc1 tdesc1;
+// struct tdesc0 tdesc0;
+// struct tdesc1 tdesc1;
+ u32 tdesc0;
+ u32 tdesc1;
struct td_buf td_buf[7];
};
@@ -279,6 +285,16 @@ enum velocity_owner {
OWNED_BY_NIC = 1
};
+/* Constants added for the BE fixes */
+#define BE_OWNED_BY_NIC 0x80000000UL
+#define BE_INT_ENABLE 0x80000000UL
+#define BE_QUEUE_ENABLE 0x80000000UL
+#define BE_TCR_TIC 0x00800000UL
+#define BE_TCR_VETAG 0x00200000UL
+#define BE_TCR_TCPCK 0x00040000UL
+#define BE_TCR_UDPCK 0x00080000UL
+#define BE_TCR_IPCK 0x00100000UL
+
/*
* MAC registers and macros.
@@ -1698,6 +1714,7 @@ enum velocity_flow_cntl_type {
};
struct velocity_opt {
+ int velo_debug; /* debug flag */
int numrx; /* Number of RX descriptors */
int numtx; /* Number of TX descriptors */
enum speed_opt spd_dpx; /* Media link mode */

View File

@ -1,111 +0,0 @@
Upgrade the power and reset button handling for the DSMG600:
* Remove the superfluous declaration of ctrl_alt_del().
* Convert GPIO and IRQ handling to use the <asm/gpio.h> api.
* Perform the reset on the release of the power button, so that
NAS devices which have been set to auto-power-on (by bridging
the power button) do not continuously power cycle.
* Remove all superflous constants from dsmg600.h
Signed-off-by: Rod Whitby <rod@whitby.id.au>
---
arch/arm/mach-ixp4xx/dsmg600-power.c | 24 ++++++++++++++----------
include/asm-arm/arch-ixp4xx/dsmg600.h | 7 +------
2 files changed, 15 insertions(+), 16 deletions(-)
Index: linux-2.6.23.17/arch/arm/mach-ixp4xx/dsmg600-power.c
===================================================================
--- linux-2.6.23.17.orig/arch/arm/mach-ixp4xx/dsmg600-power.c
+++ linux-2.6.23.17/arch/arm/mach-ixp4xx/dsmg600-power.c
@@ -26,10 +26,9 @@
#include <linux/jiffies.h>
#include <linux/timer.h>
+#include <asm/gpio.h>
#include <asm/mach-types.h>
-extern void ctrl_alt_del(void);
-
/* This is used to make sure the power-button pusher is serious. The button
* must be held until the value of this counter reaches zero.
*/
@@ -47,9 +46,16 @@ static void dsmg600_power_handler(unsign
* state of the power button.
*/
- if (*IXP4XX_GPIO_GPINR & DSMG600_PB_BM) {
+ if (gpio_get_value(DSMG600_PB_GPIO)) {
/* IO Pin is 1 (button pushed) */
+ if (power_button_countdown > 0) {
+ power_button_countdown--;
+ }
+
+ } else {
+
+ /* Done on button release, to allow for auto-power-on mods. */
if (power_button_countdown == 0) {
/* Signal init to do the ctrlaltdel action, this will bypass
* init if it hasn't started and do a kernel_restart.
@@ -58,11 +64,9 @@ static void dsmg600_power_handler(unsign
/* Change the state of the power LED to "blink" */
gpio_line_set(DSMG600_LED_PWR_GPIO, IXP4XX_GPIO_LOW);
+ } else {
+ power_button_countdown = PBUTTON_HOLDDOWN_COUNT;
}
- power_button_countdown--;
-
- } else {
- power_button_countdown = PBUTTON_HOLDDOWN_COUNT;
}
mod_timer(&dsmg600_power_timer, jiffies + msecs_to_jiffies(500));
@@ -81,12 +85,12 @@ static int __init dsmg600_power_init(voi
if (!(machine_is_dsmg600()))
return 0;
- if (request_irq(DSMG600_RB_IRQ, &dsmg600_reset_handler,
+ if (request_irq(gpio_to_irq(DSMG600_RB_GPIO), &dsmg600_reset_handler,
IRQF_DISABLED | IRQF_TRIGGER_LOW, "DSM-G600 reset button",
NULL) < 0) {
printk(KERN_DEBUG "Reset Button IRQ %d not available\n",
- DSMG600_RB_IRQ);
+ gpio_to_irq(DSMG600_RB_GPIO));
return -EIO;
}
@@ -114,7 +118,7 @@ static void __exit dsmg600_power_exit(vo
del_timer_sync(&dsmg600_power_timer);
- free_irq(DSMG600_RB_IRQ, NULL);
+ free_irq(gpio_to_irq(DSMG600_RB_GPIO), NULL);
}
module_init(dsmg600_power_init);
Index: linux-2.6.23.17/include/asm-arm/arch-ixp4xx/dsmg600.h
===================================================================
--- linux-2.6.23.17.orig/include/asm-arm/arch-ixp4xx/dsmg600.h
+++ linux-2.6.23.17/include/asm-arm/arch-ixp4xx/dsmg600.h
@@ -40,18 +40,13 @@
/* Buttons */
#define DSMG600_PB_GPIO 15 /* power button */
-#define DSMG600_PB_BM (1L << DSMG600_PB_GPIO)
-
#define DSMG600_RB_GPIO 3 /* reset button */
-#define DSMG600_RB_IRQ IRQ_IXP4XX_GPIO3
+/* Power control */
#define DSMG600_PO_GPIO 2 /* power off */
/* LEDs */
#define DSMG600_LED_PWR_GPIO 0
-#define DSMG600_LED_PWR_BM (1L << DSMG600_LED_PWR_GPIO)
-
#define DSMG600_LED_WLAN_GPIO 14
-#define DSMG600_LED_WLAN_BM (1L << DSMG600_LED_WLAN_GPIO)

View File

@ -1,188 +0,0 @@
Upgrade the power and reset button handling for the NAS100D:
* Convert GPIO and IRQ handling to use the <asm/gpio.h> api.
* Perform the reset only after the power button has been held down
for at least two seconds. Do the reset on the release of the power
button, so that NAS devices which have been set to auto-power-on (by
bridging the power button) do not continuously power cycle.
* Remove all superflous constants from nas100d.h
* Add LED constants to nas100d.h while we're there.
Also, update the board LED setup code to use constants.
Signed-off-by: Rod Whitby <rod@whitby.id.au>
Index: linux-2.6.23.17/arch/arm/mach-ixp4xx/nas100d-power.c
===================================================================
--- linux-2.6.23.17.orig/arch/arm/mach-ixp4xx/nas100d-power.c
+++ linux-2.6.23.17/arch/arm/mach-ixp4xx/nas100d-power.c
@@ -21,15 +21,61 @@
#include <linux/irq.h>
#include <linux/module.h>
#include <linux/reboot.h>
+#include <linux/jiffies.h>
+#include <linux/timer.h>
+#include <asm/gpio.h>
#include <asm/mach-types.h>
-static irqreturn_t nas100d_reset_handler(int irq, void *dev_id)
+extern void ctrl_alt_del(void);
+
+/* This is used to make sure the power-button pusher is serious. The button
+ * must be held until the value of this counter reaches zero.
+ */
+static volatile int power_button_countdown;
+
+/* Must hold the button down for at least this many counts to be processed */
+#define PBUTTON_HOLDDOWN_COUNT 4 /* 2 secs */
+
+static void nas100d_power_handler(unsigned long data);
+static DEFINE_TIMER(nas100d_power_timer, nas100d_power_handler, 0, 0);
+
+static void nas100d_power_handler(unsigned long data)
{
- /* Signal init to do the ctrlaltdel action, this will bypass init if
- * it hasn't started and do a kernel_restart.
+ /* This routine is called twice per second to check the
+ * state of the power button.
*/
- ctrl_alt_del();
+
+ if (gpio_get_value(NAS100D_PB_GPIO)) {
+
+ /* IO Pin is 1 (button pushed) */
+ if (power_button_countdown > 0) {
+ power_button_countdown--;
+ }
+
+ } else {
+
+ /* Done on button release, to allow for auto-power-on mods. */
+ if (power_button_countdown == 0) {
+ /* Signal init to do the ctrlaltdel action, this will bypass
+ * init if it hasn't started and do a kernel_restart.
+ */
+ ctrl_alt_del();
+
+ /* Change the state of the power LED to "blink" */
+ gpio_line_set(NAS100D_LED_PWR_GPIO, IXP4XX_GPIO_LOW);
+ } else {
+ power_button_countdown = PBUTTON_HOLDDOWN_COUNT;
+ }
+ }
+
+ mod_timer(&nas100d_power_timer, jiffies + msecs_to_jiffies(500));
+}
+
+static irqreturn_t nas100d_reset_handler(int irq, void *dev_id)
+{
+ /* This is the paper-clip reset, it shuts the machine down directly. */
+ machine_power_off();
return IRQ_HANDLED;
}
@@ -39,17 +85,30 @@ static int __init nas100d_power_init(voi
if (!(machine_is_nas100d()))
return 0;
- set_irq_type(NAS100D_RB_IRQ, IRQT_LOW);
+ set_irq_type(gpio_to_irq(NAS100D_RB_GPIO), IRQT_LOW);
- if (request_irq(NAS100D_RB_IRQ, &nas100d_reset_handler,
+ if (request_irq(gpio_to_irq(NAS100D_RB_GPIO), &nas100d_reset_handler,
IRQF_DISABLED, "NAS100D reset button", NULL) < 0) {
printk(KERN_DEBUG "Reset Button IRQ %d not available\n",
- NAS100D_RB_IRQ);
+ gpio_to_irq(NAS100D_RB_GPIO));
return -EIO;
}
+ /* The power button on the Iomega NAS100d is on GPIO 14, but
+ * it cannot handle interrupts on that GPIO line. So we'll
+ * have to poll it with a kernel timer.
+ */
+
+ /* Make sure that the power button GPIO is set up as an input */
+ gpio_line_config(NAS100D_PB_GPIO, IXP4XX_GPIO_IN);
+
+ /* Set the initial value for the power button IRQ handler */
+ power_button_countdown = PBUTTON_HOLDDOWN_COUNT;
+
+ mod_timer(&nas100d_power_timer, jiffies + msecs_to_jiffies(500));
+
return 0;
}
@@ -58,7 +117,9 @@ static void __exit nas100d_power_exit(vo
if (!(machine_is_nas100d()))
return;
- free_irq(NAS100D_RB_IRQ, NULL);
+ del_timer_sync(&nas100d_power_timer);
+
+ free_irq(gpio_to_irq(NAS100D_RB_GPIO), NULL);
}
module_init(nas100d_power_init);
Index: linux-2.6.23.17/include/asm-arm/arch-ixp4xx/nas100d.h
===================================================================
--- linux-2.6.23.17.orig/include/asm-arm/arch-ixp4xx/nas100d.h
+++ linux-2.6.23.17/include/asm-arm/arch-ixp4xx/nas100d.h
@@ -38,15 +38,15 @@
/* Buttons */
-#define NAS100D_PB_GPIO 14
-#define NAS100D_RB_GPIO 4
+#define NAS100D_PB_GPIO 14 /* power button */
+#define NAS100D_RB_GPIO 4 /* reset button */
+
+/* Power control */
+
#define NAS100D_PO_GPIO 12 /* power off */
-#define NAS100D_PB_IRQ IRQ_IXP4XX_GPIO14
-#define NAS100D_RB_IRQ IRQ_IXP4XX_GPIO4
+/* LEDs */
-/*
-#define NAS100D_PB_BM (1L << NAS100D_PB_GPIO)
-#define NAS100D_PO_BM (1L << NAS100D_PO_GPIO)
-#define NAS100D_RB_BM (1L << NAS100D_RB_GPIO)
-*/
+#define NAS100D_LED_WLAN_GPIO 0
+#define NAS100D_LED_DISK_GPIO 3
+#define NAS100D_LED_PWR_GPIO 15
Index: linux-2.6.23.17/arch/arm/mach-ixp4xx/nas100d-setup.c
===================================================================
--- linux-2.6.23.17.orig/arch/arm/mach-ixp4xx/nas100d-setup.c
+++ linux-2.6.23.17/arch/arm/mach-ixp4xx/nas100d-setup.c
@@ -42,20 +42,20 @@ static struct platform_device nas100d_fl
static struct resource nas100d_led_resources[] = {
{
.name = "wlan", /* green led */
- .start = 0,
- .end = 0,
+ .start = NAS100D_LED_WLAN_GPIO,
+ .end = NAS100D_LED_WLAN_GPIO,
.flags = IXP4XX_GPIO_LOW,
},
{
- .name = "ready", /* blue power led (off is flashing!) */
- .start = 15,
- .end = 15,
+ .name = "power", /* blue power led (off is flashing!) */
+ .start = NAS100D_LED_PWR_GPIO,
+ .end = NAS100D_LED_PWR_GPIO,
.flags = IXP4XX_GPIO_LOW,
},
{
.name = "disk", /* yellow led */
- .start = 3,
- .end = 3,
+ .start = NAS100D_LED_DISK_GPIO,
+ .end = NAS100D_LED_DISK_GPIO,
.flags = IXP4XX_GPIO_LOW,
},
};

View File

@ -1,232 +0,0 @@
Migrate all ixp4xx devices to the bitbanging I2C bus driver utilizing
the arch-neutral GPIO API (linux/i2c-gpio.h).
Tested by the nslu2-linux and openwrt projects in public firmware releases.
Acked-by: Rod Whitby <rod@whitby.id.au>
Signed-off-by: Michael-Luke Jones <mlj28@cam.ac.uk>
Index: linux-2.6.23.17/arch/arm/mach-ixp4xx/nslu2-setup.c
===================================================================
--- linux-2.6.23.17.orig/arch/arm/mach-ixp4xx/nslu2-setup.c
+++ linux-2.6.23.17/arch/arm/mach-ixp4xx/nslu2-setup.c
@@ -18,6 +18,7 @@
#include <linux/serial.h>
#include <linux/serial_8250.h>
#include <linux/leds.h>
+#include <linux/i2c-gpio.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
@@ -41,7 +42,7 @@ static struct platform_device nslu2_flas
.resource = &nslu2_flash_resource,
};
-static struct ixp4xx_i2c_pins nslu2_i2c_gpio_pins = {
+static struct i2c_gpio_platform_data nslu2_i2c_gpio_data = {
.sda_pin = NSLU2_SDA_PIN,
.scl_pin = NSLU2_SCL_PIN,
};
@@ -82,11 +83,12 @@ static struct platform_device nslu2_leds
};
#endif
-static struct platform_device nslu2_i2c_controller = {
- .name = "IXP4XX-I2C",
+static struct platform_device nslu2_i2c_gpio = {
+ .name = "i2c-gpio",
.id = 0,
- .dev.platform_data = &nslu2_i2c_gpio_pins,
- .num_resources = 0,
+ .dev = {
+ .platform_data = &nslu2_i2c_gpio_data,
+ },
};
static struct platform_device nslu2_beeper = {
@@ -139,7 +141,7 @@ static struct platform_device nslu2_uart
};
static struct platform_device *nslu2_devices[] __initdata = {
- &nslu2_i2c_controller,
+ &nslu2_i2c_gpio,
&nslu2_flash,
&nslu2_beeper,
#ifdef CONFIG_LEDS_IXP4XX
Index: linux-2.6.23.17/arch/arm/mach-ixp4xx/nas100d-setup.c
===================================================================
--- linux-2.6.23.17.orig/arch/arm/mach-ixp4xx/nas100d-setup.c
+++ linux-2.6.23.17/arch/arm/mach-ixp4xx/nas100d-setup.c
@@ -16,6 +16,7 @@
#include <linux/serial.h>
#include <linux/serial_8250.h>
#include <linux/leds.h>
+#include <linux/i2c-gpio.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
@@ -68,16 +69,17 @@ static struct platform_device nas100d_le
};
#endif
-static struct ixp4xx_i2c_pins nas100d_i2c_gpio_pins = {
+static struct i2c_gpio_platform_data nas100d_i2c_gpio_data = {
.sda_pin = NAS100D_SDA_PIN,
.scl_pin = NAS100D_SCL_PIN,
};
-static struct platform_device nas100d_i2c_controller = {
- .name = "IXP4XX-I2C",
+static struct platform_device nas100d_i2c_gpio = {
+ .name = "i2c-gpio",
.id = 0,
- .dev.platform_data = &nas100d_i2c_gpio_pins,
- .num_resources = 0,
+ .dev = {
+ .platform_data = &nas100d_i2c_gpio_data,
+ },
};
static struct resource nas100d_uart_resources[] = {
@@ -124,7 +126,7 @@ static struct platform_device nas100d_ua
};
static struct platform_device *nas100d_devices[] __initdata = {
- &nas100d_i2c_controller,
+ &nas100d_i2c_gpio,
&nas100d_flash,
#ifdef CONFIG_LEDS_IXP4XX
&nas100d_leds,
Index: linux-2.6.23.17/arch/arm/mach-ixp4xx/avila-setup.c
===================================================================
--- linux-2.6.23.17.orig/arch/arm/mach-ixp4xx/avila-setup.c
+++ linux-2.6.23.17/arch/arm/mach-ixp4xx/avila-setup.c
@@ -18,6 +18,7 @@
#include <linux/tty.h>
#include <linux/serial_8250.h>
#include <linux/slab.h>
+#include <linux/i2c-gpio.h>
#include <asm/types.h>
#include <asm/setup.h>
@@ -47,18 +48,17 @@ static struct platform_device avila_flas
.resource = &avila_flash_resource,
};
-static struct ixp4xx_i2c_pins avila_i2c_gpio_pins = {
+static struct i2c_gpio_platform_data avila_i2c_gpio_data = {
.sda_pin = AVILA_SDA_PIN,
.scl_pin = AVILA_SCL_PIN,
};
-static struct platform_device avila_i2c_controller = {
- .name = "IXP4XX-I2C",
+static struct platform_device avila_i2c_gpio = {
+ .name = "i2c-gpio",
.id = 0,
- .dev = {
- .platform_data = &avila_i2c_gpio_pins,
+ .dev = {
+ .platform_data = &avila_i2c_gpio_data,
},
- .num_resources = 0
};
static struct resource avila_uart_resources[] = {
@@ -133,7 +133,7 @@ static struct platform_device avila_pata
};
static struct platform_device *avila_devices[] __initdata = {
- &avila_i2c_controller,
+ &avila_i2c_gpio,
&avila_flash,
&avila_uart
};
Index: linux-2.6.23.17/arch/arm/mach-ixp4xx/dsmg600-setup.c
===================================================================
--- linux-2.6.23.17.orig/arch/arm/mach-ixp4xx/dsmg600-setup.c
+++ linux-2.6.23.17/arch/arm/mach-ixp4xx/dsmg600-setup.c
@@ -14,6 +14,7 @@
#include <linux/kernel.h>
#include <linux/serial.h>
#include <linux/serial_8250.h>
+#include <linux/i2c-gpio.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
@@ -37,15 +38,17 @@ static struct platform_device dsmg600_fl
.resource = &dsmg600_flash_resource,
};
-static struct ixp4xx_i2c_pins dsmg600_i2c_gpio_pins = {
+static struct i2c_gpio_platform_data dsmg600_i2c_gpio_data = {
.sda_pin = DSMG600_SDA_PIN,
.scl_pin = DSMG600_SCL_PIN,
};
-static struct platform_device dsmg600_i2c_controller = {
- .name = "IXP4XX-I2C",
+static struct platform_device dsmg600_i2c_gpio = {
+ .name = "i2c-gpio",
.id = 0,
- .dev.platform_data = &dsmg600_i2c_gpio_pins,
+ .dev = {
+ .platform_data = &dsmg600_i2c_gpio_data,
+ },
};
#ifdef CONFIG_LEDS_CLASS
@@ -116,7 +119,7 @@ static struct platform_device dsmg600_ua
};
static struct platform_device *dsmg600_devices[] __initdata = {
- &dsmg600_i2c_controller,
+ &dsmg600_i2c_gpio,
&dsmg600_flash,
};
Index: linux-2.6.23.17/arch/arm/mach-ixp4xx/ixdp425-setup.c
===================================================================
--- linux-2.6.23.17.orig/arch/arm/mach-ixp4xx/ixdp425-setup.c
+++ linux-2.6.23.17/arch/arm/mach-ixp4xx/ixdp425-setup.c
@@ -15,6 +15,7 @@
#include <linux/tty.h>
#include <linux/serial_8250.h>
#include <linux/slab.h>
+#include <linux/i2c-gpio.h>
#include <linux/io.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/nand.h>
@@ -120,18 +121,17 @@ static struct platform_device ixdp425_fl
};
#endif /* CONFIG_MTD_NAND_PLATFORM */
-static struct ixp4xx_i2c_pins ixdp425_i2c_gpio_pins = {
+static struct i2c_gpio_platform_data ixdp425_i2c_gpio_data = {
.sda_pin = IXDP425_SDA_PIN,
.scl_pin = IXDP425_SCL_PIN,
};
-static struct platform_device ixdp425_i2c_controller = {
- .name = "IXP4XX-I2C",
+static struct platform_device ixdp425_i2c_gpio = {
+ .name = "i2c-gpio",
.id = 0,
- .dev = {
- .platform_data = &ixdp425_i2c_gpio_pins,
+ .dev = {
+ .platform_data = &ixdp425_i2c_gpio_data,
},
- .num_resources = 0
};
static struct resource ixdp425_uart_resources[] = {
@@ -178,7 +178,7 @@ static struct platform_device ixdp425_ua
};
static struct platform_device *ixdp425_devices[] __initdata = {
- &ixdp425_i2c_controller,
+ &ixdp425_i2c_gpio,
&ixdp425_flash,
#if defined(CONFIG_MTD_NAND_PLATFORM) || \
defined(CONFIG_MTD_NAND_PLATFORM_MODULE)

View File

@ -1,793 +0,0 @@
Index: linux-2.6.23.17/arch/arm/mach-ixp4xx/fsg-pci.c
===================================================================
--- /dev/null
+++ linux-2.6.23.17/arch/arm/mach-ixp4xx/fsg-pci.c
@@ -0,0 +1,71 @@
+/*
+ * arch/arch/mach-ixp4xx/fsg-pci.c
+ *
+ * FSG board-level PCI initialization
+ *
+ * Author: Rod Whitby <rod@whitby.id.au>
+ * Maintainer: http://www.nslu2-linux.org/
+ *
+ * based on ixdp425-pci.c:
+ * Copyright (C) 2002 Intel Corporation.
+ * Copyright (C) 2003-2004 MontaVista Software, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ */
+
+#include <linux/pci.h>
+#include <linux/init.h>
+#include <linux/irq.h>
+
+#include <asm/mach/pci.h>
+#include <asm/mach-types.h>
+
+void __init fsg_pci_preinit(void)
+{
+ set_irq_type(IRQ_FSG_PCI_INTA, IRQT_LOW);
+ set_irq_type(IRQ_FSG_PCI_INTB, IRQT_LOW);
+ set_irq_type(IRQ_FSG_PCI_INTC, IRQT_LOW);
+
+ ixp4xx_pci_preinit();
+}
+
+static int __init fsg_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
+{
+ static int pci_irq_table[FSG_PCI_IRQ_LINES] = {
+ IRQ_FSG_PCI_INTC,
+ IRQ_FSG_PCI_INTB,
+ IRQ_FSG_PCI_INTA,
+ };
+
+ int irq = -1;
+ slot = slot - 11;
+
+ if (slot >= 1 && slot <= FSG_PCI_MAX_DEV &&
+ pin >= 1 && pin <= FSG_PCI_IRQ_LINES) {
+ irq = pci_irq_table[(slot - 1)];
+ }
+ printk("%s: Mapped slot %d pin %d to IRQ %d\n", __FUNCTION__,slot, pin, irq);
+
+ return irq;
+}
+
+struct hw_pci fsg_pci __initdata = {
+ .nr_controllers = 1,
+ .preinit = fsg_pci_preinit,
+ .swizzle = pci_std_swizzle,
+ .setup = ixp4xx_setup,
+ .scan = ixp4xx_scan_bus,
+ .map_irq = fsg_map_irq,
+};
+
+int __init fsg_pci_init(void)
+{
+ if (machine_is_fsg())
+ pci_common_init(&fsg_pci);
+ return 0;
+}
+
+subsys_initcall(fsg_pci_init);
Index: linux-2.6.23.17/arch/arm/mach-ixp4xx/fsg-setup.c
===================================================================
--- /dev/null
+++ linux-2.6.23.17/arch/arm/mach-ixp4xx/fsg-setup.c
@@ -0,0 +1,220 @@
+/*
+ * arch/arm/mach-ixp4xx/fsg-setup.c
+ *
+ * FSG board-setup
+ *
+ * based ixdp425-setup.c:
+ * Copyright (C) 2003-2004 MontaVista Software, Inc.
+ *
+ * Author: Rod Whitby <rod@whitby.id.au>
+ * Maintainers: http://www.nslu2-linux.org/
+ *
+ */
+
+#include <linux/kernel.h>
+#include <linux/serial.h>
+#include <linux/serial_8250.h>
+#include <linux/leds.h>
+#include <linux/reboot.h>
+#include <linux/i2c-gpio.h>
+
+#include <asm/mach-types.h>
+#include <asm/mach/arch.h>
+#include <asm/mach/flash.h>
+#include <asm/io.h>
+
+static struct flash_platform_data fsg_flash_data = {
+ .map_name = "cfi_probe",
+ .width = 2,
+};
+
+static struct resource fsg_flash_resource = {
+ .flags = IORESOURCE_MEM,
+};
+
+static struct platform_device fsg_flash = {
+ .name = "IXP4XX-Flash",
+ .id = 0,
+ .dev.platform_data = &fsg_flash_data,
+ .num_resources = 1,
+ .resource = &fsg_flash_resource,
+};
+
+static struct i2c_gpio_platform_data fsg_i2c_gpio_data = {
+ .sda_pin = FSG_SDA_PIN,
+ .scl_pin = FSG_SCL_PIN,
+};
+
+static struct platform_device fsg_i2c_gpio = {
+ .name = "i2c-gpio",
+ .id = 0,
+ .dev = {
+ .platform_data = &fsg_i2c_gpio_data,
+ },
+};
+
+static struct resource fsg_uart_resources[] = {
+ {
+ .start = IXP4XX_UART1_BASE_PHYS,
+ .end = IXP4XX_UART1_BASE_PHYS + 0x0fff,
+ .flags = IORESOURCE_MEM,
+ },
+ {
+ .start = IXP4XX_UART2_BASE_PHYS,
+ .end = IXP4XX_UART2_BASE_PHYS + 0x0fff,
+ .flags = IORESOURCE_MEM,
+ }
+};
+
+static struct plat_serial8250_port fsg_uart_data[] = {
+ {
+ .mapbase = IXP4XX_UART1_BASE_PHYS,
+ .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET,
+ .irq = IRQ_IXP4XX_UART1,
+ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
+ .iotype = UPIO_MEM,
+ .regshift = 2,
+ .uartclk = IXP4XX_UART_XTAL,
+ },
+ {
+ .mapbase = IXP4XX_UART2_BASE_PHYS,
+ .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET,
+ .irq = IRQ_IXP4XX_UART2,
+ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
+ .iotype = UPIO_MEM,
+ .regshift = 2,
+ .uartclk = IXP4XX_UART_XTAL,
+ },
+ { }
+};
+
+static struct platform_device fsg_uart = {
+ .name = "serial8250",
+ .id = PLAT8250_DEV_PLATFORM,
+ .dev.platform_data = fsg_uart_data,
+ .num_resources = ARRAY_SIZE(fsg_uart_resources),
+ .resource = fsg_uart_resources,
+};
+
+static struct platform_device fsg_leds = {
+ .name = "fsg-led",
+ .id = -1,
+};
+
+/* Built-in 10/100 Ethernet MAC interfaces */
+static struct eth_plat_info fsg_plat_eth[] = {
+ {
+ .phy = 5,
+ .rxq = 3,
+ .txreadyq = 20,
+ }, {
+ .phy = 4,
+ .rxq = 4,
+ .txreadyq = 21,
+ }
+};
+
+static struct platform_device fsg_eth[] = {
+ {
+ .name = "ixp4xx_eth",
+ .id = IXP4XX_ETH_NPEB,
+ .dev.platform_data = fsg_plat_eth,
+ }, {
+ .name = "ixp4xx_eth",
+ .id = IXP4XX_ETH_NPEC,
+ .dev.platform_data = fsg_plat_eth + 1,
+ }
+};
+
+static struct platform_device *fsg_devices[] __initdata = {
+ &fsg_i2c_gpio,
+ &fsg_flash,
+ &fsg_leds,
+ &fsg_eth[0],
+ &fsg_eth[1],
+};
+
+static void fsg_power_off(void)
+{
+ printk("Restarting system.\n");
+ machine_restart(NULL);
+}
+
+static void __init fsg_init(void)
+{
+ uint8_t __iomem *f;
+ int i;
+
+ ixp4xx_sys_init();
+
+ pm_power_off = fsg_power_off;
+
+ fsg_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
+ fsg_flash_resource.end =
+ IXP4XX_EXP_BUS_BASE(0) + ixp4xx_exp_bus_size - 1;
+
+ *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE;
+ *IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0;
+
+ /* Configure CS2 for operation, 8bit and writable */
+ *IXP4XX_EXP_CS2 = 0xbfff0002;
+
+ /* This is only useful on a modified machine, but it is valuable
+ * to have it first in order to see debug messages, and so that
+ * it does *not* get removed if platform_add_devices fails!
+ */
+ (void)platform_device_register(&fsg_uart);
+
+ platform_add_devices(fsg_devices, ARRAY_SIZE(fsg_devices));
+
+
+ /*
+ * Map in a portion of the flash and read the MAC addresses.
+ * Since it is stored in BE in the flash itself, we need to
+ * byteswap it if we're in LE mode.
+ */
+ if ((f = ioremap(IXP4XX_EXP_BUS_BASE(0), 0x400000))) {
+#ifdef __ARMEB__
+ for (i = 0; i < 6; i++) {
+ fsg_plat_eth[0].hwaddr[i] = readb(f + 0x3C0422 + i);
+ fsg_plat_eth[1].hwaddr[i] = readb(f + 0x3C043B + i);
+ }
+#else
+ fsg_plat_eth[0].hwaddr[0] = readb(f + 0x3C0422 + 3);
+ fsg_plat_eth[0].hwaddr[1] = readb(f + 0x3C0422 + 2);
+ fsg_plat_eth[0].hwaddr[2] = readb(f + 0x3C0422 + 1);
+ fsg_plat_eth[0].hwaddr[3] = readb(f + 0x3C0422 + 0);
+ fsg_plat_eth[0].hwaddr[4] = readb(f + 0x3C0422 + 7);
+ fsg_plat_eth[0].hwaddr[5] = readb(f + 0x3C0422 + 6);
+
+ fsg_plat_eth[1].hwaddr[0] = readb(f + 0x3C0422 + 3);
+ fsg_plat_eth[1].hwaddr[1] = readb(f + 0x3C0422 + 2);
+ fsg_plat_eth[1].hwaddr[2] = readb(f + 0x3C0422 + 1);
+ fsg_plat_eth[1].hwaddr[3] = readb(f + 0x3C0422 + 0);
+ fsg_plat_eth[1].hwaddr[4] = readb(f + 0x3C0422 + 7);
+ fsg_plat_eth[1].hwaddr[5] = readb(f + 0x3C0422 + 6);
+#endif
+ iounmap(f);
+ }
+ printk(KERN_INFO "FSG: Using MAC address %.2x:%.2x:%.2x:%.2x:%.2x:%.2x for port 0\n",
+ fsg_plat_eth[0].hwaddr[0], fsg_plat_eth[0].hwaddr[1],
+ fsg_plat_eth[0].hwaddr[2], fsg_plat_eth[0].hwaddr[3],
+ fsg_plat_eth[0].hwaddr[4], fsg_plat_eth[0].hwaddr[5]);
+ printk(KERN_INFO "FSG: Using MAC address %.2x:%.2x:%.2x:%.2x:%.2x:%.2x for port 1\n",
+ fsg_plat_eth[1].hwaddr[0], fsg_plat_eth[1].hwaddr[1],
+ fsg_plat_eth[1].hwaddr[2], fsg_plat_eth[1].hwaddr[3],
+ fsg_plat_eth[1].hwaddr[4], fsg_plat_eth[1].hwaddr[5]);
+
+}
+
+MACHINE_START(FSG, "Freecom FSG-3")
+ /* Maintainer: www.nslu2-linux.org */
+ .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
+ .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
+ .map_io = ixp4xx_map_io,
+ .init_irq = ixp4xx_init_irq,
+ .timer = &ixp4xx_timer,
+ .boot_params = 0x0100,
+ .init_machine = fsg_init,
+MACHINE_END
+
Index: linux-2.6.23.17/arch/arm/mach-ixp4xx/Kconfig
===================================================================
--- linux-2.6.23.17.orig/arch/arm/mach-ixp4xx/Kconfig
+++ linux-2.6.23.17/arch/arm/mach-ixp4xx/Kconfig
@@ -125,6 +125,15 @@ config ARCH_IXDP4XX
depends on ARCH_IXDP425 || MACH_IXDP465 || MACH_KIXRP435
default y
+config MACH_FSG
+ bool
+ prompt "Freecom FSG-3"
+ select PCI
+ help
+ Say 'Y' here if you want your kernel to support Freecom's
+ FSG-3 device. For more information on this platform,
+ see http://www.nslu2-linux.org/wiki/FSG3/HomePage
+
#
# Certain registers and IRQs are only enabled if supporting IXP465 CPUs
#
Index: linux-2.6.23.17/arch/arm/mach-ixp4xx/Makefile
===================================================================
--- linux-2.6.23.17.orig/arch/arm/mach-ixp4xx/Makefile
+++ linux-2.6.23.17/arch/arm/mach-ixp4xx/Makefile
@@ -15,6 +15,7 @@ obj-pci-$(CONFIG_MACH_NAS100D) += nas10
obj-pci-$(CONFIG_MACH_DSMG600) += dsmg600-pci.o
obj-pci-$(CONFIG_MACH_GATEWAY7001) += gateway7001-pci.o
obj-pci-$(CONFIG_MACH_WG302V2) += wg302v2-pci.o
+obj-pci-$(CONFIG_MACH_FSG) += fsg-pci.o
obj-y += common.o
@@ -28,5 +29,6 @@ obj-$(CONFIG_MACH_NAS100D) += nas100d-se
obj-$(CONFIG_MACH_DSMG600) += dsmg600-setup.o dsmg600-power.o
obj-$(CONFIG_MACH_GATEWAY7001) += gateway7001-setup.o
obj-$(CONFIG_MACH_WG302V2) += wg302v2-setup.o
+obj-$(CONFIG_MACH_FSG) += fsg-setup.o fsg-power.o
obj-$(CONFIG_PCI) += $(obj-pci-$(CONFIG_PCI)) common-pci.o
Index: linux-2.6.23.17/include/asm-arm/arch-ixp4xx/fsg.h
===================================================================
--- /dev/null
+++ linux-2.6.23.17/include/asm-arm/arch-ixp4xx/fsg.h
@@ -0,0 +1,50 @@
+/*
+ * include/asm-arm/arch-ixp4xx/fsg.h
+ *
+ * Freecom FSG-3 platform specific definitions
+ *
+ * Author: Rod Whitby <rod@whitby.id.au>
+ * Author: Tomasz Chmielewski <mangoo@wpkg.org>
+ * Maintainers: http://www.nslu2-linux.org
+ *
+ * Based on coyote.h by
+ * Copyright 2004 (c) MontaVista, Software, Inc.
+ *
+ * This file is licensed under the terms of the GNU General Public
+ * License version 2. This program is licensed "as is" without any
+ * warranty of any kind, whether express or implied.
+ */
+
+#ifndef __ASM_ARCH_HARDWARE_H__
+#error "Do not include this directly, instead #include <asm/hardware.h>"
+#endif
+
+#define FSG_SDA_PIN 12
+#define FSG_SCL_PIN 13
+
+/*
+ * FSG PCI IRQs
+ */
+#define FSG_PCI_MAX_DEV 3
+#define FSG_PCI_IRQ_LINES 3
+
+
+/* PCI controller GPIO to IRQ pin mappings */
+#define FSG_PCI_INTA_PIN 6
+#define FSG_PCI_INTB_PIN 7
+#define FSG_PCI_INTC_PIN 5
+
+/* Buttons */
+
+#define FSG_SB_GPIO 4 /* sync button */
+#define FSG_RB_GPIO 9 /* reset button */
+#define FSG_UB_GPIO 10 /* usb button */
+
+/* LEDs */
+
+#define FSG_LED_WLAN_BIT 0
+#define FSG_LED_WAN_BIT 1
+#define FSG_LED_SATA_BIT 2
+#define FSG_LED_USB_BIT 4
+#define FSG_LED_RING_BIT 5
+#define FSG_LED_SYNC_BIT 7
Index: linux-2.6.23.17/include/asm-arm/arch-ixp4xx/hardware.h
===================================================================
--- linux-2.6.23.17.orig/include/asm-arm/arch-ixp4xx/hardware.h
+++ linux-2.6.23.17/include/asm-arm/arch-ixp4xx/hardware.h
@@ -45,5 +45,6 @@
#include "nslu2.h"
#include "nas100d.h"
#include "dsmg600.h"
+#include "fsg.h"
#endif /* _ASM_ARCH_HARDWARE_H */
Index: linux-2.6.23.17/include/asm-arm/arch-ixp4xx/irqs.h
===================================================================
--- linux-2.6.23.17.orig/include/asm-arm/arch-ixp4xx/irqs.h
+++ linux-2.6.23.17/include/asm-arm/arch-ixp4xx/irqs.h
@@ -128,4 +128,11 @@
#define IRQ_DSMG600_PCI_INTE IRQ_IXP4XX_GPIO7
#define IRQ_DSMG600_PCI_INTF IRQ_IXP4XX_GPIO6
+/*
+ * Freecom FSG-3 Board IRQs
+ */
+#define IRQ_FSG_PCI_INTA IRQ_IXP4XX_GPIO6
+#define IRQ_FSG_PCI_INTB IRQ_IXP4XX_GPIO7
+#define IRQ_FSG_PCI_INTC IRQ_IXP4XX_GPIO5
+
#endif
Index: linux-2.6.23.17/arch/arm/mach-ixp4xx/fsg-power.c
===================================================================
--- /dev/null
+++ linux-2.6.23.17/arch/arm/mach-ixp4xx/fsg-power.c
@@ -0,0 +1,89 @@
+/*
+ * arch/arm/mach-ixp4xx/fsg-power.c
+ *
+ * FSG Power/Reset driver
+ *
+ * Copyright (C) 2008 Rod Whitby <rod@whitby.id.au>
+ *
+ * based on nslu2-power.c
+ * Copyright (C) 2005 Tower Technologies
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ */
+
+#include <linux/module.h>
+#include <linux/reboot.h>
+#include <linux/interrupt.h>
+#include <linux/irq.h>
+#include <linux/jiffies.h>
+#include <linux/timer.h>
+
+#include <asm/gpio.h>
+#include <asm/mach-types.h>
+
+static irqreturn_t fsg_power_handler(int irq, void *dev_id)
+{
+ /* Signal init to do the ctrlaltdel action, this will bypass init if
+ * it hasn't started and do a kernel_restart.
+ */
+ ctrl_alt_del();
+
+ return IRQ_HANDLED;
+}
+
+static irqreturn_t fsg_reset_handler(int irq, void *dev_id)
+{
+ /* This is the paper-clip reset, it shuts the machine down directly.
+ */
+ machine_power_off();
+
+ return IRQ_HANDLED;
+}
+
+static int __init fsg_power_init(void)
+{
+ if (!(machine_is_fsg()))
+ return 0;
+
+ set_irq_type(gpio_to_irq(FSG_RB_GPIO), IRQT_LOW);
+ set_irq_type(gpio_to_irq(FSG_SB_GPIO), IRQT_LOW);
+
+ if (request_irq(gpio_to_irq(FSG_RB_GPIO), &fsg_reset_handler,
+ IRQF_DISABLED, "FSG reset button", NULL) < 0) {
+
+ printk(KERN_DEBUG "Reset Button IRQ %d not available\n",
+ gpio_to_irq(FSG_RB_GPIO));
+
+ return -EIO;
+ }
+
+ if (request_irq(gpio_to_irq(FSG_SB_GPIO), &fsg_power_handler,
+ IRQF_DISABLED, "FSG power button", NULL) < 0) {
+
+ printk(KERN_DEBUG "Power Button IRQ %d not available\n",
+ gpio_to_irq(FSG_SB_GPIO));
+
+ return -EIO;
+ }
+
+ return 0;
+}
+
+static void __exit fsg_power_exit(void)
+{
+ if (!(machine_is_fsg()))
+ return;
+
+ free_irq(gpio_to_irq(FSG_SB_GPIO), NULL);
+ free_irq(gpio_to_irq(FSG_RB_GPIO), NULL);
+}
+
+module_init(fsg_power_init);
+module_exit(fsg_power_exit);
+
+MODULE_AUTHOR("Rod Whitby <rod@whitby.id.au>");
+MODULE_DESCRIPTION("FSG Power/Reset driver");
+MODULE_LICENSE("GPL");
Index: linux-2.6.23.17/drivers/leds/Kconfig
===================================================================
--- linux-2.6.23.17.orig/drivers/leds/Kconfig
+++ linux-2.6.23.17/drivers/leds/Kconfig
@@ -48,6 +48,12 @@ config LEDS_IXP4XX
particular board must have LEDs and they must be connected
to the GPIO lines. If unsure, say Y.
+config LEDS_FSG
+ tristate "LED Support for the Freecom FSG-3"
+ depends on LEDS_CLASS && MACH_FSG
+ help
+ This option enables support for the LEDs on the Freecom FSG-3.
+
config LEDS_TOSA
tristate "LED Support for the Sharp SL-6000 series"
depends on LEDS_CLASS && PXA_SHARPSL
Index: linux-2.6.23.17/drivers/leds/Makefile
===================================================================
--- linux-2.6.23.17.orig/drivers/leds/Makefile
+++ linux-2.6.23.17/drivers/leds/Makefile
@@ -9,6 +9,7 @@ obj-$(CONFIG_LEDS_CORGI) += leds-corgi.
obj-$(CONFIG_LEDS_LOCOMO) += leds-locomo.o
obj-$(CONFIG_LEDS_SPITZ) += leds-spitz.o
obj-$(CONFIG_LEDS_IXP4XX) += leds-ixp4xx-gpio.o
+obj-$(CONFIG_LEDS_FSG) += leds-fsg.o
obj-$(CONFIG_LEDS_TOSA) += leds-tosa.o
obj-$(CONFIG_LEDS_S3C24XX) += leds-s3c24xx.o
obj-$(CONFIG_LEDS_AMS_DELTA) += leds-ams-delta.o
Index: linux-2.6.23.17/drivers/leds/leds-fsg.c
===================================================================
--- /dev/null
+++ linux-2.6.23.17/drivers/leds/leds-fsg.c
@@ -0,0 +1,243 @@
+/*
+ * LED Driver for the Freecom FSG-3
+ *
+ * Copyright (c) 2008 Rod Whitby <rod@whitby.id.au>
+ *
+ * Author: Rod Whitby <rod@whitby.id.au>
+ *
+ * Based on leds-spitz.c
+ * Copyright 2005-2006 Openedhand Ltd.
+ * Author: Richard Purdie <rpurdie@openedhand.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ */
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/platform_device.h>
+#include <linux/leds.h>
+#include <asm/arch/hardware.h>
+#include <asm/io.h>
+
+static short __iomem *latch_address;
+static unsigned short latch_value;
+
+
+static void fsg_led_wlan_set(struct led_classdev *led_cdev, enum led_brightness value)
+{
+ if (value) {
+ latch_value &= ~(1 << FSG_LED_WLAN_BIT);
+ *latch_address = latch_value;
+ }
+ else {
+ latch_value |= (1 << FSG_LED_WLAN_BIT);
+ *latch_address = latch_value;
+ }
+}
+
+static void fsg_led_wan_set(struct led_classdev *led_cdev, enum led_brightness value)
+{
+ if (value) {
+ latch_value &= ~(1 << FSG_LED_WAN_BIT);
+ *latch_address = latch_value;
+ }
+ else {
+ latch_value |= (1 << FSG_LED_WAN_BIT);
+ *latch_address = latch_value;
+ }
+}
+
+static void fsg_led_sata_set(struct led_classdev *led_cdev, enum led_brightness value)
+{
+ if (value) {
+ latch_value &= ~(1 << FSG_LED_SATA_BIT);
+ *latch_address = latch_value;
+ }
+ else {
+ latch_value |= (1 << FSG_LED_SATA_BIT);
+ *latch_address = latch_value;
+ }
+}
+
+static void fsg_led_usb_set(struct led_classdev *led_cdev, enum led_brightness value)
+{
+ if (value) {
+ latch_value &= ~(1 << FSG_LED_USB_BIT);
+ *latch_address = latch_value;
+ }
+ else {
+ latch_value |= (1 << FSG_LED_USB_BIT);
+ *latch_address = latch_value;
+ }
+}
+
+static void fsg_led_sync_set(struct led_classdev *led_cdev, enum led_brightness value)
+{
+ if (value) {
+ latch_value &= ~(1 << FSG_LED_SYNC_BIT);
+ *latch_address = latch_value;
+ }
+ else {
+ latch_value |= (1 << FSG_LED_SYNC_BIT);
+ *latch_address = latch_value;
+ }
+}
+
+static void fsg_led_ring_set(struct led_classdev *led_cdev, enum led_brightness value)
+{
+ if (value) {
+ latch_value &= ~(1 << FSG_LED_RING_BIT);
+ *latch_address = latch_value;
+ }
+ else {
+ latch_value |= (1 << FSG_LED_RING_BIT);
+ *latch_address = latch_value;
+ }
+}
+
+
+
+static struct led_classdev fsg_wlan_led = {
+ .name = "fsg:wlan",
+ .brightness_set = fsg_led_wlan_set,
+};
+
+static struct led_classdev fsg_wan_led = {
+ .name = "fsg:wan",
+ .brightness_set = fsg_led_wan_set,
+};
+
+static struct led_classdev fsg_sata_led = {
+ .name = "fsg:sata",
+ .brightness_set = fsg_led_sata_set,
+};
+
+static struct led_classdev fsg_usb_led = {
+ .name = "fsg:usb",
+ .brightness_set = fsg_led_usb_set,
+};
+
+static struct led_classdev fsg_sync_led = {
+ .name = "fsg:sync",
+ .brightness_set = fsg_led_sync_set,
+};
+
+static struct led_classdev fsg_ring_led = {
+ .name = "fsg:ring",
+ .brightness_set = fsg_led_ring_set,
+};
+
+
+
+#ifdef CONFIG_PM
+static int fsg_led_suspend(struct platform_device *dev, pm_message_t state)
+{
+ led_classdev_suspend(&fsg_wlan_led);
+ led_classdev_suspend(&fsg_wan_led);
+ led_classdev_suspend(&fsg_sata_led);
+ led_classdev_suspend(&fsg_usb_led);
+ led_classdev_suspend(&fsg_sync_led);
+ led_classdev_suspend(&fsg_ring_led);
+ return 0;
+}
+
+static int fsg_led_resume(struct platform_device *dev)
+{
+ led_classdev_resume(&fsg_wlan_led);
+ led_classdev_resume(&fsg_wan_led);
+ led_classdev_resume(&fsg_sata_led);
+ led_classdev_resume(&fsg_usb_led);
+ led_classdev_resume(&fsg_sync_led);
+ led_classdev_resume(&fsg_ring_led);
+ return 0;
+}
+#endif
+
+
+static int fsg_led_probe(struct platform_device *pdev)
+{
+ int ret;
+
+ /* FIXME: Need to work out how to handle failure below */
+
+ ret = led_classdev_register(&pdev->dev, &fsg_wlan_led);
+ if (ret < 0)
+ return ret;
+
+ ret = led_classdev_register(&pdev->dev, &fsg_wan_led);
+ if (ret < 0)
+ return ret;
+
+ ret = led_classdev_register(&pdev->dev, &fsg_sata_led);
+ if (ret < 0)
+ return ret;
+
+ ret = led_classdev_register(&pdev->dev, &fsg_usb_led);
+ if (ret < 0)
+ return ret;
+
+ ret = led_classdev_register(&pdev->dev, &fsg_sync_led);
+ if (ret < 0)
+ return ret;
+
+ ret = led_classdev_register(&pdev->dev, &fsg_ring_led);
+ if (ret < 0)
+ return ret;
+
+ return ret;
+}
+
+static int fsg_led_remove(struct platform_device *pdev)
+{
+ led_classdev_unregister(&fsg_wlan_led);
+ led_classdev_unregister(&fsg_wan_led);
+ led_classdev_unregister(&fsg_sata_led);
+ led_classdev_unregister(&fsg_usb_led);
+ led_classdev_unregister(&fsg_sync_led);
+ led_classdev_unregister(&fsg_ring_led);
+
+ return 0;
+}
+
+
+static struct platform_driver fsg_led_driver = {
+ .probe = fsg_led_probe,
+ .remove = fsg_led_remove,
+#ifdef CONFIG_PM
+ .suspend = fsg_led_suspend,
+ .resume = fsg_led_resume,
+#endif
+ .driver = {
+ .name = "fsg-led",
+ },
+};
+
+
+static int __init fsg_led_init(void)
+{
+ /* Map the LED chip select address space */
+ latch_address = (unsigned short *) ioremap(IXP4XX_EXP_BUS_BASE(2), 512);
+ if (!latch_address)
+ return -ENOMEM;
+ latch_value = 0xffff;
+ *latch_address = latch_value;
+ /* FIXME: We leak memory if the next line fails */
+ return platform_driver_register(&fsg_led_driver);
+}
+
+static void __exit fsg_led_exit(void)
+{
+ platform_driver_unregister(&fsg_led_driver);
+ iounmap(latch_address);
+}
+
+
+module_init(fsg_led_init);
+module_exit(fsg_led_exit);
+
+MODULE_AUTHOR("Rod Whitby <rod@whitby.id.au>");
+MODULE_DESCRIPTION("Freecom FSG-3 LED driver");
+MODULE_LICENSE("GPL");

View File

@ -1,88 +0,0 @@
Index: linux-2.6.23.17/arch/arm/mach-ixp4xx/nslu2-setup.c
===================================================================
--- linux-2.6.23.17.orig/arch/arm/mach-ixp4xx/nslu2-setup.c
+++ linux-2.6.23.17/arch/arm/mach-ixp4xx/nslu2-setup.c
@@ -24,6 +24,7 @@
#include <asm/mach/arch.h>
#include <asm/mach/flash.h>
#include <asm/mach/time.h>
+#include <asm/io.h>
static struct flash_platform_data nslu2_flash_data = {
.map_name = "cfi_probe",
@@ -140,6 +141,23 @@ static struct platform_device nslu2_uart
.resource = nslu2_uart_resources,
};
+/* Built-in 10/100 Ethernet MAC interfaces */
+static struct eth_plat_info nslu2_plat_eth[] = {
+ {
+ .phy = 1,
+ .rxq = 3,
+ .txreadyq = 20,
+ }
+};
+
+static struct platform_device nslu2_eth[] = {
+ {
+ .name = "ixp4xx_eth",
+ .id = IXP4XX_ETH_NPEB,
+ .dev.platform_data = nslu2_plat_eth,
+ }
+};
+
static struct platform_device *nslu2_devices[] __initdata = {
&nslu2_i2c_gpio,
&nslu2_flash,
@@ -147,6 +165,7 @@ static struct platform_device *nslu2_dev
#ifdef CONFIG_LEDS_IXP4XX
&nslu2_leds,
#endif
+ &nslu2_eth[0],
};
static void nslu2_power_off(void)
@@ -175,6 +194,9 @@ static struct sys_timer nslu2_timer = {
static void __init nslu2_init(void)
{
+ uint8_t __iomem *f;
+ int i;
+
ixp4xx_sys_init();
nslu2_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
@@ -191,6 +213,33 @@ static void __init nslu2_init(void)
(void)platform_device_register(&nslu2_uart);
platform_add_devices(nslu2_devices, ARRAY_SIZE(nslu2_devices));
+
+
+ /*
+ * Map in a portion of the flash and read the MAC address.
+ * Since it is stored in BE in the flash itself, we need to
+ * byteswap it if we're in LE mode.
+ */
+ if ((f = ioremap(IXP4XX_EXP_BUS_BASE(0), 0x40000))) {
+#ifdef __ARMEB__
+ for (i = 0; i < 6; i++) {
+ nslu2_plat_eth[0].hwaddr[i] = readb(f + 0x3FFB0 + i);
+ }
+#else
+ nslu2_plat_eth[0].hwaddr[0] = readb(f + 0x3FFB0 + 3);
+ nslu2_plat_eth[0].hwaddr[1] = readb(f + 0x3FFB0 + 2);
+ nslu2_plat_eth[0].hwaddr[2] = readb(f + 0x3FFB0 + 1);
+ nslu2_plat_eth[0].hwaddr[3] = readb(f + 0x3FFB0 + 0);
+ nslu2_plat_eth[0].hwaddr[4] = readb(f + 0x3FFB0 + 7);
+ nslu2_plat_eth[0].hwaddr[5] = readb(f + 0x3FFB0 + 6);
+#endif
+ iounmap(f);
+ }
+ printk(KERN_INFO "NSLU2: Using MAC address %.2x:%.2x:%.2x:%.2x:%.2x:%.2x for port 0\n",
+ nslu2_plat_eth[0].hwaddr[0], nslu2_plat_eth[0].hwaddr[1],
+ nslu2_plat_eth[0].hwaddr[2], nslu2_plat_eth[0].hwaddr[3],
+ nslu2_plat_eth[0].hwaddr[4], nslu2_plat_eth[0].hwaddr[5]);
+
}
MACHINE_START(NSLU2, "Linksys NSLU2")

View File

@ -1,87 +0,0 @@
Index: linux-2.6.23.17/arch/arm/mach-ixp4xx/nas100d-setup.c
===================================================================
--- linux-2.6.23.17.orig/arch/arm/mach-ixp4xx/nas100d-setup.c
+++ linux-2.6.23.17/arch/arm/mach-ixp4xx/nas100d-setup.c
@@ -21,6 +21,7 @@
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
#include <asm/mach/flash.h>
+#include <asm/io.h>
static struct flash_platform_data nas100d_flash_data = {
.map_name = "cfi_probe",
@@ -125,12 +126,30 @@ static struct platform_device nas100d_ua
.resource = nas100d_uart_resources,
};
+/* Built-in 10/100 Ethernet MAC interfaces */
+static struct eth_plat_info nas100d_plat_eth[] = {
+ {
+ .phy = 0,
+ .rxq = 3,
+ .txreadyq = 20,
+ }
+};
+
+static struct platform_device nas100d_eth[] = {
+ {
+ .name = "ixp4xx_eth",
+ .id = IXP4XX_ETH_NPEB,
+ .dev.platform_data = nas100d_plat_eth,
+ }
+};
+
static struct platform_device *nas100d_devices[] __initdata = {
&nas100d_i2c_gpio,
&nas100d_flash,
#ifdef CONFIG_LEDS_IXP4XX
&nas100d_leds,
#endif
+ &nas100d_eth[0],
};
static void nas100d_power_off(void)
@@ -146,6 +165,9 @@ static void nas100d_power_off(void)
static void __init nas100d_init(void)
{
+ uint8_t __iomem *f;
+ int i;
+
ixp4xx_sys_init();
/* gpio 14 and 15 are _not_ clocks */
@@ -165,6 +187,33 @@ static void __init nas100d_init(void)
(void)platform_device_register(&nas100d_uart);
platform_add_devices(nas100d_devices, ARRAY_SIZE(nas100d_devices));
+
+
+ /*
+ * Map in a portion of the flash and read the MAC address.
+ * Since it is stored in BE in the flash itself, we need to
+ * byteswap it if we're in LE mode.
+ */
+ if ((f = ioremap(IXP4XX_EXP_BUS_BASE(0), 0x1000000))) {
+#ifdef __ARMEB__
+ for (i = 0; i < 6; i++) {
+ nas100d_plat_eth[0].hwaddr[i] = readb(f + 0xFC0FD8 + i);
+ }
+#else
+ nas100d_plat_eth[0].hwaddr[0] = readb(f + 0xFC0FD8 + 3);
+ nas100d_plat_eth[0].hwaddr[1] = readb(f + 0xFC0FD8 + 2);
+ nas100d_plat_eth[0].hwaddr[2] = readb(f + 0xFC0FD8 + 1);
+ nas100d_plat_eth[0].hwaddr[3] = readb(f + 0xFC0FD8 + 0);
+ nas100d_plat_eth[0].hwaddr[4] = readb(f + 0xFC0FD8 + 7);
+ nas100d_plat_eth[0].hwaddr[5] = readb(f + 0xFC0FD8 + 6);
+#endif
+ iounmap(f);
+ }
+ printk(KERN_INFO "NAS100D: Using MAC address %.2x:%.2x:%.2x:%.2x:%.2x:%.2x for port 0\n",
+ nas100d_plat_eth[0].hwaddr[0], nas100d_plat_eth[0].hwaddr[1],
+ nas100d_plat_eth[0].hwaddr[2], nas100d_plat_eth[0].hwaddr[3],
+ nas100d_plat_eth[0].hwaddr[4], nas100d_plat_eth[0].hwaddr[5]);
+
}
MACHINE_START(NAS100D, "Iomega NAS 100d")

View File

@ -1,17 +0,0 @@
Index: linux-2.6.23.17/drivers/char/random.c
===================================================================
--- linux-2.6.23.17.orig/drivers/char/random.c
+++ linux-2.6.23.17/drivers/char/random.c
@@ -248,9 +248,9 @@
/*
* Configuration information
*/
-#define INPUT_POOL_WORDS 128
-#define OUTPUT_POOL_WORDS 32
-#define SEC_XFER_SIZE 512
+#define INPUT_POOL_WORDS 256
+#define OUTPUT_POOL_WORDS 64
+#define SEC_XFER_SIZE 1024
/*
* The minimum number of bits of entropy before we wake up a read on

View File

@ -1,56 +0,0 @@
Index: linux-2.6.23.17/arch/arm/mach-ixp4xx/nslu2-setup.c
===================================================================
--- linux-2.6.23.17.orig/arch/arm/mach-ixp4xx/nslu2-setup.c
+++ linux-2.6.23.17/arch/arm/mach-ixp4xx/nslu2-setup.c
@@ -20,6 +20,7 @@
#include <linux/leds.h>
#include <linux/i2c-gpio.h>
+#include <asm/setup.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
#include <asm/mach/flash.h>
@@ -192,6 +193,35 @@ static struct sys_timer nslu2_timer = {
.init = nslu2_timer_init,
};
+static char nslu2_rtc_probe[] __initdata = "rtc-isl1208.ignore=0,0x6f rtc-x1205.probe=0,0x6f ";
+
+static void __init nslu2_fixup(struct machine_desc *desc,
+ struct tag *tags, char **cmdline, struct meminfo *mi)
+{
+ struct tag *t = tags;
+ char *p = *cmdline;
+
+ /* Find the end of the tags table, taking note of any cmdline tag. */
+ for (; t->hdr.size; t = tag_next(t)) {
+ if (t->hdr.tag == ATAG_CMDLINE) {
+ p = t->u.cmdline.cmdline;
+ }
+ }
+
+ /* Overwrite the end of the table with a new cmdline tag. */
+ t->hdr.tag = ATAG_CMDLINE;
+ t->hdr.size = (sizeof (struct tag_header) +
+ strlen(nslu2_rtc_probe) + strlen(p) + 1 + 4) >> 2;
+ strlcpy(t->u.cmdline.cmdline, nslu2_rtc_probe, COMMAND_LINE_SIZE);
+ strlcpy(t->u.cmdline.cmdline + strlen(nslu2_rtc_probe), p,
+ COMMAND_LINE_SIZE - strlen(nslu2_rtc_probe));
+
+ /* Terminate the table. */
+ t = tag_next(t);
+ t->hdr.tag = ATAG_NONE;
+ t->hdr.size = 0;
+}
+
static void __init nslu2_init(void)
{
uint8_t __iomem *f;
@@ -247,6 +277,7 @@ MACHINE_START(NSLU2, "Linksys NSLU2")
.phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
.io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xFFFC,
.boot_params = 0x00000100,
+ .fixup = nslu2_fixup,
.map_io = ixp4xx_map_io,
.init_irq = ixp4xx_init_irq,
.timer = &nslu2_timer,

View File

@ -1,56 +0,0 @@
Index: linux-2.6.23.17/arch/arm/mach-ixp4xx/nas100d-setup.c
===================================================================
--- linux-2.6.23.17.orig/arch/arm/mach-ixp4xx/nas100d-setup.c
+++ linux-2.6.23.17/arch/arm/mach-ixp4xx/nas100d-setup.c
@@ -18,6 +18,7 @@
#include <linux/leds.h>
#include <linux/i2c-gpio.h>
+#include <asm/setup.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
#include <asm/mach/flash.h>
@@ -163,6 +164,35 @@ static void nas100d_power_off(void)
gpio_line_set(NAS100D_PO_GPIO, IXP4XX_GPIO_HIGH);
}
+static char nas100d_rtc_probe[] __initdata = "rtc-pcf8563.probe=0,0x51 ";
+
+static void __init nas100d_fixup(struct machine_desc *desc,
+ struct tag *tags, char **cmdline, struct meminfo *mi)
+{
+ struct tag *t = tags;
+ char *p = *cmdline;
+
+ /* Find the end of the tags table, taking note of any cmdline tag. */
+ for (; t->hdr.size; t = tag_next(t)) {
+ if (t->hdr.tag == ATAG_CMDLINE) {
+ p = t->u.cmdline.cmdline;
+ }
+ }
+
+ /* Overwrite the end of the table with a new cmdline tag. */
+ t->hdr.tag = ATAG_CMDLINE;
+ t->hdr.size = (sizeof (struct tag_header) +
+ strlen(nas100d_rtc_probe) + strlen(p) + 1 + 4) >> 2;
+ strlcpy(t->u.cmdline.cmdline, nas100d_rtc_probe, COMMAND_LINE_SIZE);
+ strlcpy(t->u.cmdline.cmdline + strlen(nas100d_rtc_probe), p,
+ COMMAND_LINE_SIZE - strlen(nas100d_rtc_probe));
+
+ /* Terminate the table. */
+ t = tag_next(t);
+ t->hdr.tag = ATAG_NONE;
+ t->hdr.size = 0;
+}
+
static void __init nas100d_init(void)
{
uint8_t __iomem *f;
@@ -221,6 +251,7 @@ MACHINE_START(NAS100D, "Iomega NAS 100d"
.phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
.io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xFFFC,
.boot_params = 0x00000100,
+ .fixup = nas100d_fixup,
.map_io = ixp4xx_map_io,
.init_irq = ixp4xx_init_irq,
.timer = &ixp4xx_timer,

View File

@ -1,56 +0,0 @@
Index: linux-2.6.23.17/arch/arm/mach-ixp4xx/dsmg600-setup.c
===================================================================
--- linux-2.6.23.17.orig/arch/arm/mach-ixp4xx/dsmg600-setup.c
+++ linux-2.6.23.17/arch/arm/mach-ixp4xx/dsmg600-setup.c
@@ -16,6 +16,7 @@
#include <linux/serial_8250.h>
#include <linux/i2c-gpio.h>
+#include <asm/setup.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
#include <asm/mach/flash.h>
@@ -145,6 +146,35 @@ static struct sys_timer dsmg600_timer =
.init = dsmg600_timer_init,
};
+static char dsmg600_rtc_probe[] __initdata = "rtc-pcf8563.probe=0,0x51 ";
+
+static void __init dsmg600_fixup(struct machine_desc *desc,
+ struct tag *tags, char **cmdline, struct meminfo *mi)
+{
+ struct tag *t = tags;
+ char *p = *cmdline;
+
+ /* Find the end of the tags table, taking note of any cmdline tag. */
+ for (; t->hdr.size; t = tag_next(t)) {
+ if (t->hdr.tag == ATAG_CMDLINE) {
+ p = t->u.cmdline.cmdline;
+ }
+ }
+
+ /* Overwrite the end of the table with a new cmdline tag. */
+ t->hdr.tag = ATAG_CMDLINE;
+ t->hdr.size = (sizeof (struct tag_header) +
+ strlen(dsmg600_rtc_probe) + strlen(p) + 1 + 4) >> 2;
+ strlcpy(t->u.cmdline.cmdline, dsmg600_rtc_probe, COMMAND_LINE_SIZE);
+ strlcpy(t->u.cmdline.cmdline + strlen(dsmg600_rtc_probe), p,
+ COMMAND_LINE_SIZE - strlen(dsmg600_rtc_probe));
+
+ /* Terminate the table. */
+ t = tag_next(t);
+ t->hdr.tag = ATAG_NONE;
+ t->hdr.size = 0;
+}
+
static void __init dsmg600_init(void)
{
ixp4xx_sys_init();
@@ -177,6 +207,7 @@ MACHINE_START(DSMG600, "D-Link DSM-G600
.phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
.io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xFFFC,
.boot_params = 0x00000100,
+ .fixup = dsmg600_fixup,
.map_io = ixp4xx_map_io,
.init_irq = ixp4xx_init_irq,
.timer = &dsmg600_timer,

View File

@ -1,179 +0,0 @@
Index: linux-2.6.23.17/kernel/ksysfs.c
===================================================================
--- linux-2.6.23.17.orig/kernel/ksysfs.c
+++ linux-2.6.23.17/kernel/ksysfs.c
@@ -49,6 +49,165 @@ KERNEL_ATTR_RW(uevent_helper);
#endif
#ifdef CONFIG_KEXEC
+
+#include <asm/setup.h>
+
+extern unsigned long kexec_boot_params;
+
+char kexec_cmdline[COMMAND_LINE_SIZE] = "";
+
+static void
+replace_cmdline_tag(void)
+{
+ char *t;
+ struct tag *real;
+ struct tag *copy;
+ struct tag *rend;
+ int i;
+
+/* TODO: check the return params */
+ t = kmalloc(KEXEC_BOOT_PARAMS_SIZE + COMMAND_LINE_SIZE, GFP_KERNEL);
+ memset((void *)t, 0, KEXEC_BOOT_PARAMS_SIZE + COMMAND_LINE_SIZE);
+
+/* TODO: validate that the boot params are ATAGS, in fact */
+
+ copy = (struct tag *)t;
+ real = (struct tag *)kexec_boot_params;
+ rend = (struct tag *)(kexec_boot_params + KEXEC_BOOT_PARAMS_SIZE);
+ while ((real->hdr.size) && (real < rend)) {
+ if (real->hdr.tag != ATAG_CMDLINE) {
+ memcpy((void *)copy, (void *)real, real->hdr.size * 4);
+ copy = tag_next(copy);
+ }
+ real = tag_next(real);
+ }
+
+/* TODO: validate that we have enough space in the buffer */
+
+ i = strlen(kexec_cmdline);
+ if (i) {
+ copy->hdr.tag = ATAG_CMDLINE;
+ copy->hdr.size = (sizeof(struct tag_header) + i + 1 + 4) >> 2;
+ strcpy(copy->u.cmdline.cmdline, kexec_cmdline);
+ copy = tag_next(copy);
+ }
+
+ copy->hdr.tag = ATAG_NONE; /* Empty tag ends list */
+ copy->hdr.size = 0; /* zero length */
+
+/* TODO: validate that the temporary buffer isn't too full */
+
+ memcpy((void *)kexec_boot_params, (void *)t, KEXEC_BOOT_PARAMS_SIZE);
+
+ kfree(t); /* Don't forget to free the big buffer we used */
+}
+
+static ssize_t kexec_cmdline_show(struct kset *kset, char *page)
+{
+ return sprintf(page, "%s\n", kexec_cmdline);
+}
+
+static ssize_t kexec_cmdline_store(struct kset *kset, const char *page,
+ size_t count)
+{
+ if ((count + 1) > COMMAND_LINE_SIZE)
+ count = COMMAND_LINE_SIZE;
+ memcpy(kexec_cmdline, page, count);
+ kexec_cmdline[count] = '\0';
+ if (count && (kexec_cmdline[count - 1] == '\n'))
+ kexec_cmdline[count - 1] = '\0';
+ replace_cmdline_tag();
+ return count;
+}
+KERNEL_ATTR_RW(kexec_cmdline);
+
+static ssize_t kexec_boot_params_show(struct kset *kset, char *page)
+{
+ unsigned long *p;
+ char buf[PAGE_SIZE];
+ int keep_doing;
+
+ p = (unsigned long *)kexec_boot_params;
+
+ /* if this doesn't look like atags, just print first few words */
+ if (p[1] != ATAG_CORE)
+ return sprintf(page, "0x%lx 0x%lx 0x%lx 0x%lx\n",
+ p[0], p[1], p[2], p[3]);
+
+ /* carefully walk the atag list, and print out the structure */
+ keep_doing = 1;
+ do {
+ switch (p[1]) {
+ case ATAG_CORE:
+ /* watch out, core tag is permitted to be empty */
+ if (p[0] == 5)
+ sprintf(buf,
+ "CORE flg=%ld pgsz=%ld rdev=0x%lx\n",
+ p[2], p[3], p[4]);
+ else
+ sprintf(buf,"CORE\n");
+ break;
+ case ATAG_MEM:
+ sprintf(buf,"MEM %ldM@0x%lx\n", p[2] / (1024 * 1024),
+ p[3]);
+ break;
+ case ATAG_VIDEOTEXT:
+ sprintf(buf,"VIDEOTEXT sz=%ld\n", p[0]);
+ break;
+ case ATAG_RAMDISK:
+ sprintf(buf,"RAMDISK prmpt=%ld %ldK@0x%lx\n",
+ p[2], p[3], p[4]);
+ break;
+ case ATAG_INITRD2:
+ sprintf(buf,"INITRD2 %ldK@0x%lx\n", p[3] / 1024, p[2]);
+ break;
+ case ATAG_SERIAL:
+ sprintf(buf,"SERIAL high=0x%08lx low=0x%08lx\n",
+ p[3], p[2]);
+ break;
+ case ATAG_REVISION:
+ sprintf(buf,"REVISION rev=%ld\n", p[2]);
+ break;
+ case ATAG_VIDEOLFB:
+ sprintf(buf,"VIDEOLFB sz=%ld\n", p[0]);
+ break;
+ case ATAG_CMDLINE:
+ sprintf(buf,"CMD \"%s\"\n", (char *)&p[2]);
+ break;
+ case ATAG_NONE:
+ sprintf(buf,"NONE\n");
+ keep_doing = 0;
+ break;
+ default:
+ sprintf(buf,"-unknown- sz=%ld\n", p[0]);
+ break;
+ }
+
+ /* carefully add to page */
+ if ((strlen(buf) + strlen(page)) < PAGE_SIZE) {
+ strcat(page, buf);
+ } else {
+ keep_doing = 0;
+ }
+
+ /* stop when we encounter a header length of 0 */
+ if (p[0] == 0)
+ keep_doing = 0;
+
+ /* go to the next tag */
+ p += p[0];
+
+ /* stop if we walked off the end of the buffer */
+ if (p > (unsigned long *)(kexec_boot_params +
+ KEXEC_BOOT_PARAMS_SIZE))
+ keep_doing = 0;
+
+ } while (keep_doing);
+
+ return (strlen(page));
+}
+KERNEL_ATTR_RO(kexec_boot_params);
+
static ssize_t kexec_loaded_show(struct kset *kset, char *page)
{
return sprintf(page, "%d\n", !!kexec_image);
@@ -95,6 +254,8 @@ static struct attribute * kernel_attrs[]
#ifdef CONFIG_KEXEC
&kexec_loaded_attr.attr,
&kexec_crash_loaded_attr.attr,
+ &kexec_cmdline_attr.attr,
+ &kexec_boot_params_attr.attr,
#endif
NULL
};

View File

@ -1,42 +0,0 @@
Index: linux-2.6.23.17/arch/arm/mach-ixp4xx/gateway7001-setup.c
===================================================================
--- linux-2.6.23.17.orig/arch/arm/mach-ixp4xx/gateway7001-setup.c
+++ linux-2.6.23.17/arch/arm/mach-ixp4xx/gateway7001-setup.c
@@ -76,9 +76,36 @@ static struct platform_device gateway700
.resource = &gateway7001_uart_resource,
};
+/* Built-in 10/100 Ethernet MAC interfaces */
+static struct eth_plat_info gateway7001_plat_eth[] = {
+ {
+ .phy = 1,
+ .rxq = 3,
+ .txreadyq = 20,
+ }, {
+ .phy = 2,
+ .rxq = 4,
+ .txreadyq = 21,
+ }
+};
+
+static struct platform_device gateway7001_eth[] = {
+ {
+ .name = "ixp4xx_eth",
+ .id = IXP4XX_ETH_NPEB,
+ .dev.platform_data = gateway7001_plat_eth,
+ }, {
+ .name = "ixp4xx_eth",
+ .id = IXP4XX_ETH_NPEC,
+ .dev.platform_data = gateway7001_plat_eth + 1,
+ }
+};
+
static struct platform_device *gateway7001_devices[] __initdata = {
&gateway7001_flash,
- &gateway7001_uart
+ &gateway7001_uart,
+ &gateway7001_eth[0],
+ &gateway7001_eth[1],
};
static void __init gateway7001_init(void)

View File

@ -1,32 +0,0 @@
Index: linux-2.6.23.17/arch/arm/mach-ixp4xx/wg302v2-setup.c
===================================================================
--- linux-2.6.23.17.orig/arch/arm/mach-ixp4xx/wg302v2-setup.c
+++ linux-2.6.23.17/arch/arm/mach-ixp4xx/wg302v2-setup.c
@@ -77,9 +77,27 @@ static struct platform_device wg302v2_ua
.resource = &wg302v2_uart_resource,
};
+/* Built-in 10/100 Ethernet MAC interfaces */
+static struct eth_plat_info wg302_plat_eth[] = {
+ {
+ .phy = 8,
+ .rxq = 3,
+ .txreadyq = 20,
+ }
+};
+
+static struct platform_device wg302_eth[] = {
+ {
+ .name = "ixp4xx_eth",
+ .id = IXP4XX_ETH_NPEB,
+ .dev.platform_data = wg302_plat_eth,
+ }
+};
+
static struct platform_device *wg302v2_devices[] __initdata = {
&wg302v2_flash,
&wg302v2_uart,
+ &wg302_eth[0],
};
static void __init wg302v2_init(void)

View File

@ -1,297 +0,0 @@
Index: linux-2.6.23.17/arch/arm/mach-ixp4xx/Kconfig
===================================================================
--- linux-2.6.23.17.orig/arch/arm/mach-ixp4xx/Kconfig
+++ linux-2.6.23.17/arch/arm/mach-ixp4xx/Kconfig
@@ -57,6 +57,14 @@ config MACH_WG302V2
WG302 v2 or WAG302 v2 Access Points. For more information
on this platform, see http://openwrt.org
+config MACH_PRONGHORNMETRO
+ bool "Pronghorn Metro"
+ select PCI
+ help
+ Say 'Y' here if you want your kernel to support the ADI
+ Engineering Pronghorn Metro Platform. For more
+ information on this platform, see <file:Documentation/arm/IXP4xx>.
+
config ARCH_IXDP425
bool "IXDP425"
help
Index: linux-2.6.23.17/arch/arm/mach-ixp4xx/Makefile
===================================================================
--- linux-2.6.23.17.orig/arch/arm/mach-ixp4xx/Makefile
+++ linux-2.6.23.17/arch/arm/mach-ixp4xx/Makefile
@@ -16,6 +16,7 @@ obj-pci-$(CONFIG_MACH_DSMG600) += dsmg6
obj-pci-$(CONFIG_MACH_GATEWAY7001) += gateway7001-pci.o
obj-pci-$(CONFIG_MACH_WG302V2) += wg302v2-pci.o
obj-pci-$(CONFIG_MACH_FSG) += fsg-pci.o
+obj-pci-$(CONFIG_MACH_PRONGHORNMETRO) += pronghornmetro-pci.o
obj-y += common.o
@@ -30,5 +31,6 @@ obj-$(CONFIG_MACH_DSMG600) += dsmg6
obj-$(CONFIG_MACH_GATEWAY7001) += gateway7001-setup.o
obj-$(CONFIG_MACH_WG302V2) += wg302v2-setup.o
obj-$(CONFIG_MACH_FSG) += fsg-setup.o fsg-power.o
+obj-$(CONFIG_MACH_PRONGHORNMETRO) += pronghornmetro-setup.o
obj-$(CONFIG_PCI) += $(obj-pci-$(CONFIG_PCI)) common-pci.o
Index: linux-2.6.23.17/arch/arm/mach-ixp4xx/pronghornmetro-pci.c
===================================================================
--- /dev/null
+++ linux-2.6.23.17/arch/arm/mach-ixp4xx/pronghornmetro-pci.c
@@ -0,0 +1,74 @@
+/*
+ * arch/arch/mach-ixp4xx/pronghornmetro-pci.c
+ *
+ * PCI setup routines for ADI Engineering Pronghorn Metro
+ *
+ * Copyright (C) 2007 Imre Kaloz <kaloz@openwrt.org>
+ *
+ * based on coyote-pci.c:
+ * Copyright (C) 2002 Jungo Software Technologies.
+ * Copyright (C) 2003 MontaVista Softwrae, Inc.
+ *
+ * Maintainer: Imre Kaloz <kaloz@openwrt.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ */
+
+#include <linux/kernel.h>
+#include <linux/pci.h>
+#include <linux/init.h>
+#include <linux/irq.h>
+
+#include <asm/mach-types.h>
+#include <asm/hardware.h>
+#include <asm/irq.h>
+
+#include <asm/mach/pci.h>
+
+extern void ixp4xx_pci_preinit(void);
+extern int ixp4xx_setup(int nr, struct pci_sys_data *sys);
+extern struct pci_bus *ixp4xx_scan_bus(int nr, struct pci_sys_data *sys);
+
+void __init pronghornmetro_pci_preinit(void)
+{
+ set_irq_type(IRQ_IXP4XX_GPIO4, IRQT_LOW);
+ set_irq_type(IRQ_IXP4XX_GPIO6, IRQT_LOW);
+ set_irq_type(IRQ_IXP4XX_GPIO11, IRQT_LOW);
+ set_irq_type(IRQ_IXP4XX_GPIO1, IRQT_LOW);
+
+ ixp4xx_pci_preinit();
+}
+
+static int __init pronghornmetro_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
+{
+ if (slot == 13)
+ return IRQ_IXP4XX_GPIO4;
+ else if (slot == 14)
+ return IRQ_IXP4XX_GPIO6;
+ else if (slot == 15)
+ return IRQ_IXP4XX_GPIO11;
+ else if (slot == 16)
+ return IRQ_IXP4XX_GPIO1;
+ else return -1;
+}
+
+struct hw_pci pronghornmetro_pci __initdata = {
+ .nr_controllers = 1,
+ .preinit = pronghornmetro_pci_preinit,
+ .swizzle = pci_std_swizzle,
+ .setup = ixp4xx_setup,
+ .scan = ixp4xx_scan_bus,
+ .map_irq = pronghornmetro_map_irq,
+};
+
+int __init pronghornmetro_pci_init(void)
+{
+ if (machine_is_pronghorn_metro())
+ pci_common_init(&pronghornmetro_pci);
+ return 0;
+}
+
+subsys_initcall(pronghornmetro_pci_init);
Index: linux-2.6.23.17/arch/arm/mach-ixp4xx/pronghornmetro-setup.c
===================================================================
--- /dev/null
+++ linux-2.6.23.17/arch/arm/mach-ixp4xx/pronghornmetro-setup.c
@@ -0,0 +1,147 @@
+/*
+ * arch/arm/mach-ixp4xx/pronghornmetro-setup.c
+ *
+ * Board setup for the ADI Engineering Pronghorn Metro
+ *
+ * Copyright (C) 2007 Imre Kaloz <Kaloz@openwrt.org>
+ *
+ * based on coyote-setup.c:
+ * Copyright (C) 2003-2005 MontaVista Software, Inc.
+ *
+ * Author: Imre Kaloz <Kaloz@openwrt.org>
+ */
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/device.h>
+#include <linux/serial.h>
+#include <linux/tty.h>
+#include <linux/serial_8250.h>
+#include <linux/slab.h>
+
+#include <asm/types.h>
+#include <asm/setup.h>
+#include <asm/memory.h>
+#include <asm/hardware.h>
+#include <asm/irq.h>
+#include <asm/mach-types.h>
+#include <asm/mach/arch.h>
+#include <asm/mach/flash.h>
+
+static struct flash_platform_data pronghornmetro_flash_data = {
+ .map_name = "cfi_probe",
+ .width = 2,
+};
+
+static struct resource pronghornmetro_flash_resource = {
+ .flags = IORESOURCE_MEM,
+};
+
+static struct platform_device pronghornmetro_flash = {
+ .name = "IXP4XX-Flash",
+ .id = 0,
+ .dev = {
+ .platform_data = &pronghornmetro_flash_data,
+ },
+ .num_resources = 1,
+ .resource = &pronghornmetro_flash_resource,
+};
+
+static struct resource pronghornmetro_uart_resource = {
+ .start = IXP4XX_UART2_BASE_PHYS,
+ .end = IXP4XX_UART2_BASE_PHYS + 0x0fff,
+ .flags = IORESOURCE_MEM,
+};
+
+static struct plat_serial8250_port pronghornmetro_uart_data[] = {
+ {
+ .mapbase = IXP4XX_UART2_BASE_PHYS,
+ .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET,
+ .irq = IRQ_IXP4XX_UART2,
+ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
+ .iotype = UPIO_MEM,
+ .regshift = 2,
+ .uartclk = IXP4XX_UART_XTAL,
+ },
+ { },
+};
+
+static struct platform_device pronghornmetro_uart = {
+ .name = "serial8250",
+ .id = PLAT8250_DEV_PLATFORM,
+ .dev = {
+ .platform_data = pronghornmetro_uart_data,
+ },
+ .num_resources = 1,
+ .resource = &pronghornmetro_uart_resource,
+};
+
+static struct resource pronghornmetro_pata_resources[] = {
+ {
+ .flags = IORESOURCE_MEM
+ },
+ {
+ .flags = IORESOURCE_MEM,
+ },
+ {
+ .name = "intrq",
+ .start = IRQ_IXP4XX_GPIO0,
+ .end = IRQ_IXP4XX_GPIO0,
+ .flags = IORESOURCE_IRQ,
+ },
+};
+
+static struct ixp4xx_pata_data pronghornmetro_pata_data = {
+ .cs0_bits = 0xbfff0043,
+ .cs1_bits = 0xbfff0043,
+};
+
+static struct platform_device pronghornmetro_pata = {
+ .name = "pata_ixp4xx_cf",
+ .id = 0,
+ .dev.platform_data = &pronghornmetro_pata_data,
+ .num_resources = ARRAY_SIZE(pronghornmetro_pata_resources),
+ .resource = pronghornmetro_pata_resources,
+};
+
+static struct platform_device *pronghornmetro_devices[] __initdata = {
+ &pronghornmetro_flash,
+ &pronghornmetro_uart,
+};
+
+static void __init pronghornmetro_init(void)
+{
+ ixp4xx_sys_init();
+
+ pronghornmetro_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
+ pronghornmetro_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_16M - 1;
+
+ *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE;
+ *IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0;
+
+ platform_add_devices(pronghornmetro_devices, ARRAY_SIZE(pronghornmetro_devices));
+
+ pronghornmetro_pata_resources[0].start = IXP4XX_EXP_BUS_BASE(1);
+ pronghornmetro_pata_resources[0].end = IXP4XX_EXP_BUS_END(1);
+
+ pronghornmetro_pata_resources[1].start = IXP4XX_EXP_BUS_BASE(2);
+ pronghornmetro_pata_resources[1].end = IXP4XX_EXP_BUS_END(2);
+
+ pronghornmetro_pata_data.cs0_cfg = IXP4XX_EXP_CS1;
+ pronghornmetro_pata_data.cs1_cfg = IXP4XX_EXP_CS2;
+
+ platform_device_register(&pronghornmetro_pata);
+}
+
+#ifdef CONFIG_MACH_PRONGHORNMETRO
+MACHINE_START(PRONGHORNMETRO, "ADI Engineering Pronghorn Metro")
+ /* Maintainer: Imre Kaloz <kaloz@openwrt.org> */
+ .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
+ .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
+ .map_io = ixp4xx_map_io,
+ .init_irq = ixp4xx_init_irq,
+ .timer = &ixp4xx_timer,
+ .boot_params = 0x0100,
+ .init_machine = pronghornmetro_init,
+MACHINE_END
+#endif
Index: linux-2.6.23.17/Documentation/arm/IXP4xx
===================================================================
--- linux-2.6.23.17.orig/Documentation/arm/IXP4xx
+++ linux-2.6.23.17/Documentation/arm/IXP4xx
@@ -111,6 +111,9 @@ http://www.adiengineering.com/productsCo
the platform has two mini-PCI slots used for 802.11[bga] cards.
Finally, there is an IDE port hanging off the expansion bus.
+ADI Engineering Pronghorn Metro Platform
+http://www.adiengineering.com/php-bin/ecomm4/productDisplay.php?category_id=30&product_id=85
+
Gateworks Avila Network Platform
http://www.gateworks.com/avila_sbc.htm
Index: linux-2.6.23.17/include/asm-arm/arch-ixp4xx/uncompress.h
===================================================================
--- linux-2.6.23.17.orig/include/asm-arm/arch-ixp4xx/uncompress.h
+++ linux-2.6.23.17/include/asm-arm/arch-ixp4xx/uncompress.h
@@ -41,7 +41,8 @@ static __inline__ void __arch_decomp_set
* Some boards are using UART2 as console
*/
if (machine_is_adi_coyote() || machine_is_gtwx5715() ||
- machine_is_gateway7001() || machine_is_wg302v2())
+ machine_is_gateway7001() || machine_is_wg302v2() ||
+ machine_is_pronghorn_metro())
uart_base = (volatile u32*) IXP4XX_UART2_BASE_PHYS;
else
uart_base = (volatile u32*) IXP4XX_UART1_BASE_PHYS;

View File

@ -1,41 +0,0 @@
Index: linux-2.6.23.17/arch/arm/mach-ixp4xx/pronghornmetro-setup.c
===================================================================
--- linux-2.6.23.17.orig/arch/arm/mach-ixp4xx/pronghornmetro-setup.c
+++ linux-2.6.23.17/arch/arm/mach-ixp4xx/pronghornmetro-setup.c
@@ -104,9 +104,36 @@ static struct platform_device pronghornm
.resource = pronghornmetro_pata_resources,
};
+/* Built-in 10/100 Ethernet MAC interfaces */
+static struct eth_plat_info pronghornmetro_plat_eth[] = {
+ {
+ .phy = 0,
+ .rxq = 3,
+ .txreadyq = 20,
+ }, {
+ .phy = 1,
+ .rxq = 4,
+ .txreadyq = 21,
+ }
+};
+
+static struct platform_device pronghornmetro_eth[] = {
+ {
+ .name = "ixp4xx_eth",
+ .id = IXP4XX_ETH_NPEB,
+ .dev.platform_data = pronghornmetro_plat_eth,
+ }, {
+ .name = "ixp4xx_eth",
+ .id = IXP4XX_ETH_NPEC,
+ .dev.platform_data = pronghornmetro_plat_eth + 1,
+ }
+};
+
static struct platform_device *pronghornmetro_devices[] __initdata = {
&pronghornmetro_flash,
&pronghornmetro_uart,
+ &pronghornmetro_eth[0],
+ &pronghornmetro_eth[1],
};
static void __init pronghornmetro_init(void)

View File

@ -1,189 +0,0 @@
Index: linux-2.6.23.17/arch/arm/mach-ixp4xx/Kconfig
===================================================================
--- linux-2.6.23.17.orig/arch/arm/mach-ixp4xx/Kconfig
+++ linux-2.6.23.17/arch/arm/mach-ixp4xx/Kconfig
@@ -65,6 +65,14 @@ config MACH_PRONGHORNMETRO
Engineering Pronghorn Metro Platform. For more
information on this platform, see <file:Documentation/arm/IXP4xx>.
+config MACH_COMPEX
+ bool "Compex WP18 / NP18A"
+ select PCI
+ help
+ Say 'Y' here if you want your kernel to support Compex'
+ WP18 or NP18A boards. For more information on this
+ platform, see http://openwrt.org
+
config ARCH_IXDP425
bool "IXDP425"
help
Index: linux-2.6.23.17/arch/arm/mach-ixp4xx/Makefile
===================================================================
--- linux-2.6.23.17.orig/arch/arm/mach-ixp4xx/Makefile
+++ linux-2.6.23.17/arch/arm/mach-ixp4xx/Makefile
@@ -17,6 +17,7 @@ obj-pci-$(CONFIG_MACH_GATEWAY7001) += ga
obj-pci-$(CONFIG_MACH_WG302V2) += wg302v2-pci.o
obj-pci-$(CONFIG_MACH_FSG) += fsg-pci.o
obj-pci-$(CONFIG_MACH_PRONGHORNMETRO) += pronghornmetro-pci.o
+obj-pci-$(CONFIG_MACH_COMPEX) += ixdp425-pci.o
obj-y += common.o
@@ -32,5 +33,6 @@ obj-$(CONFIG_MACH_GATEWAY7001) += gatewa
obj-$(CONFIG_MACH_WG302V2) += wg302v2-setup.o
obj-$(CONFIG_MACH_FSG) += fsg-setup.o fsg-power.o
obj-$(CONFIG_MACH_PRONGHORNMETRO) += pronghornmetro-setup.o
+obj-$(CONFIG_MACH_COMPEX) += compex-setup.o
obj-$(CONFIG_PCI) += $(obj-pci-$(CONFIG_PCI)) common-pci.o
Index: linux-2.6.23.17/arch/arm/mach-ixp4xx/compex-setup.c
===================================================================
--- /dev/null
+++ linux-2.6.23.17/arch/arm/mach-ixp4xx/compex-setup.c
@@ -0,0 +1,120 @@
+/*
+ * arch/arm/mach-ixp4xx/compex-setup.c
+ *
+ * Ccompex WP18 / NP18A board-setup
+ *
+ * Copyright (C) 2007 Imre Kaloz <Kaloz@openwrt.org>
+ *
+ * based on ixdp425-setup.c:
+ * Copyright (C) 2003-2005 MontaVista Software, Inc.
+ *
+ * Author: Imre Kaloz <Kaloz@openwrt.org>
+ */
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/device.h>
+#include <linux/serial.h>
+#include <linux/tty.h>
+#include <linux/serial_8250.h>
+#include <linux/slab.h>
+
+#include <asm/types.h>
+#include <asm/setup.h>
+#include <asm/memory.h>
+#include <asm/hardware.h>
+#include <asm/mach-types.h>
+#include <asm/irq.h>
+#include <asm/mach/arch.h>
+#include <asm/mach/flash.h>
+
+static struct flash_platform_data compex_flash_data = {
+ .map_name = "cfi_probe",
+ .width = 2,
+};
+
+static struct resource compex_flash_resource = {
+ .flags = IORESOURCE_MEM,
+};
+
+static struct platform_device compex_flash = {
+ .name = "IXP4XX-Flash",
+ .id = 0,
+ .dev = {
+ .platform_data = &compex_flash_data,
+ },
+ .num_resources = 1,
+ .resource = &compex_flash_resource,
+};
+
+static struct resource compex_uart_resources[] = {
+ {
+ .start = IXP4XX_UART1_BASE_PHYS,
+ .end = IXP4XX_UART1_BASE_PHYS + 0x0fff,
+ .flags = IORESOURCE_MEM
+ },
+ {
+ .start = IXP4XX_UART2_BASE_PHYS,
+ .end = IXP4XX_UART2_BASE_PHYS + 0x0fff,
+ .flags = IORESOURCE_MEM
+ }
+};
+
+static struct plat_serial8250_port compex_uart_data[] = {
+ {
+ .mapbase = IXP4XX_UART1_BASE_PHYS,
+ .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET,
+ .irq = IRQ_IXP4XX_UART1,
+ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
+ .iotype = UPIO_MEM,
+ .regshift = 2,
+ .uartclk = IXP4XX_UART_XTAL,
+ },
+ {
+ .mapbase = IXP4XX_UART2_BASE_PHYS,
+ .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET,
+ .irq = IRQ_IXP4XX_UART2,
+ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
+ .iotype = UPIO_MEM,
+ .regshift = 2,
+ .uartclk = IXP4XX_UART_XTAL,
+ },
+ { },
+};
+
+static struct platform_device compex_uart = {
+ .name = "serial8250",
+ .id = PLAT8250_DEV_PLATFORM,
+ .dev.platform_data = compex_uart_data,
+ .num_resources = 2,
+ .resource = compex_uart_resources,
+};
+
+static struct platform_device *compex_devices[] __initdata = {
+ &compex_flash,
+ &compex_uart
+};
+
+static void __init compex_init(void)
+{
+ ixp4xx_sys_init();
+
+ compex_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
+ compex_flash_resource.end =
+ IXP4XX_EXP_BUS_BASE(0) + SZ_32M - 1;
+
+ platform_add_devices(compex_devices, ARRAY_SIZE(compex_devices));
+}
+
+#ifdef CONFIG_MACH_COMPEX
+MACHINE_START(COMPEX, "Compex WP18 / NP18A")
+ /* Maintainer: Imre Kaloz <Kaloz@openwrt.org> */
+ .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
+ .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
+ .map_io = ixp4xx_map_io,
+ .init_irq = ixp4xx_init_irq,
+ .timer = &ixp4xx_timer,
+ .boot_params = 0x0100,
+ .init_machine = compex_init,
+MACHINE_END
+#endif
Index: linux-2.6.23.17/arch/arm/mach-ixp4xx/ixdp425-pci.c
===================================================================
--- linux-2.6.23.17.orig/arch/arm/mach-ixp4xx/ixdp425-pci.c
+++ linux-2.6.23.17/arch/arm/mach-ixp4xx/ixdp425-pci.c
@@ -66,7 +66,7 @@ struct hw_pci ixdp425_pci __initdata = {
int __init ixdp425_pci_init(void)
{
if (machine_is_ixdp425() || machine_is_ixcdp1100() ||
- machine_is_ixdp465() || machine_is_kixrp435())
+ machine_is_ixdp465() || machine_is_kixrp435() || machine_is_compex())
pci_common_init(&ixdp425_pci);
return 0;
}
Index: linux-2.6.23.17/arch/arm/tools/mach-types
===================================================================
--- linux-2.6.23.17.orig/arch/arm/tools/mach-types
+++ linux-2.6.23.17/arch/arm/tools/mach-types
@@ -1278,7 +1278,7 @@ oiab MACH_OIAB OIAB 1269
smdk6400 MACH_SMDK6400 SMDK6400 1270
nokia_n800 MACH_NOKIA_N800 NOKIA_N800 1271
greenphone MACH_GREENPHONE GREENPHONE 1272
-compex42x MACH_COMPEXWP18 COMPEXWP18 1273
+compex MACH_COMPEX COMPEX 1273
xmate MACH_XMATE XMATE 1274
energizer MACH_ENERGIZER ENERGIZER 1275
ime1 MACH_IME1 IME1 1276

View File

@ -1,42 +0,0 @@
Index: linux-2.6.23.17/arch/arm/mach-ixp4xx/compex-setup.c
===================================================================
--- linux-2.6.23.17.orig/arch/arm/mach-ixp4xx/compex-setup.c
+++ linux-2.6.23.17/arch/arm/mach-ixp4xx/compex-setup.c
@@ -90,9 +90,36 @@ static struct platform_device compex_uar
.resource = compex_uart_resources,
};
+/* Built-in 10/100 Ethernet MAC interfaces */
+static struct eth_plat_info compex_plat_eth[] = {
+ {
+ .phy = -1,
+ .rxq = 3,
+ .txreadyq = 20,
+ }, {
+ .phy = 3,
+ .rxq = 4,
+ .txreadyq = 21,
+ }
+};
+
+static struct platform_device compex_eth[] = {
+ {
+ .name = "ixp4xx_eth",
+ .id = IXP4XX_ETH_NPEB,
+ .dev.platform_data = compex_plat_eth,
+ }, {
+ .name = "ixp4xx_eth",
+ .id = IXP4XX_ETH_NPEC,
+ .dev.platform_data = compex_plat_eth + 1,
+ }
+};
+
static struct platform_device *compex_devices[] __initdata = {
&compex_flash,
- &compex_uart
+ &compex_uart,
+ &compex_eth[0],
+ &compex_eth[1],
};
static void __init compex_init(void)

View File

@ -1,234 +0,0 @@
Index: linux-2.6.23.17/arch/arm/mach-ixp4xx/Kconfig
===================================================================
--- linux-2.6.23.17.orig/arch/arm/mach-ixp4xx/Kconfig
+++ linux-2.6.23.17/arch/arm/mach-ixp4xx/Kconfig
@@ -73,6 +73,14 @@ config MACH_COMPEX
WP18 or NP18A boards. For more information on this
platform, see http://openwrt.org
+config MACH_WRT300NV2
+ bool "Linksys WRT300N v2"
+ select PCI
+ help
+ Say 'Y' here if you want your kernel to support Linksys'
+ WRT300N v2 router. For more information on this
+ platform, see http://openwrt.org
+
config ARCH_IXDP425
bool "IXDP425"
help
Index: linux-2.6.23.17/arch/arm/mach-ixp4xx/Makefile
===================================================================
--- linux-2.6.23.17.orig/arch/arm/mach-ixp4xx/Makefile
+++ linux-2.6.23.17/arch/arm/mach-ixp4xx/Makefile
@@ -18,6 +18,7 @@ obj-pci-$(CONFIG_MACH_WG302V2) += wg302
obj-pci-$(CONFIG_MACH_FSG) += fsg-pci.o
obj-pci-$(CONFIG_MACH_PRONGHORNMETRO) += pronghornmetro-pci.o
obj-pci-$(CONFIG_MACH_COMPEX) += ixdp425-pci.o
+obj-pci-$(CONFIG_MACH_WRT300NV2) += wrt300nv2-pci.o
obj-y += common.o
@@ -34,5 +35,6 @@ obj-$(CONFIG_MACH_WG302V2) += wg302v2-se
obj-$(CONFIG_MACH_FSG) += fsg-setup.o fsg-power.o
obj-$(CONFIG_MACH_PRONGHORNMETRO) += pronghornmetro-setup.o
obj-$(CONFIG_MACH_COMPEX) += compex-setup.o
+obj-$(CONFIG_MACH_WRT300NV2) += wrt300nv2-setup.o
obj-$(CONFIG_PCI) += $(obj-pci-$(CONFIG_PCI)) common-pci.o
Index: linux-2.6.23.17/arch/arm/mach-ixp4xx/wrt300nv2-pci.c
===================================================================
--- /dev/null
+++ linux-2.6.23.17/arch/arm/mach-ixp4xx/wrt300nv2-pci.c
@@ -0,0 +1,65 @@
+/*
+ * arch/arch/mach-ixp4xx/wrt300nv2-pci.c
+ *
+ * PCI setup routines for Linksys WRT300N v2
+ *
+ * Copyright (C) 2007 Imre Kaloz <kaloz@openwrt.org>
+ *
+ * based on coyote-pci.c:
+ * Copyright (C) 2002 Jungo Software Technologies.
+ * Copyright (C) 2003 MontaVista Softwrae, Inc.
+ *
+ * Maintainer: Imre Kaloz <kaloz@openwrt.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ */
+
+#include <linux/kernel.h>
+#include <linux/pci.h>
+#include <linux/init.h>
+#include <linux/irq.h>
+
+#include <asm/mach-types.h>
+#include <asm/hardware.h>
+#include <asm/irq.h>
+
+#include <asm/mach/pci.h>
+
+extern void ixp4xx_pci_preinit(void);
+extern int ixp4xx_setup(int nr, struct pci_sys_data *sys);
+extern struct pci_bus *ixp4xx_scan_bus(int nr, struct pci_sys_data *sys);
+
+void __init wrt300nv2_pci_preinit(void)
+{
+ set_irq_type(IRQ_IXP4XX_GPIO8, IRQT_LOW);
+
+ ixp4xx_pci_preinit();
+}
+
+static int __init wrt300nv2_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
+{
+ if (slot == 1)
+ return IRQ_IXP4XX_GPIO8;
+ else return -1;
+}
+
+struct hw_pci wrt300nv2_pci __initdata = {
+ .nr_controllers = 1,
+ .preinit = wrt300nv2_pci_preinit,
+ .swizzle = pci_std_swizzle,
+ .setup = ixp4xx_setup,
+ .scan = ixp4xx_scan_bus,
+ .map_irq = wrt300nv2_map_irq,
+};
+
+int __init wrt300nv2_pci_init(void)
+{
+ if (machine_is_wrt300nv2())
+ pci_common_init(&wrt300nv2_pci);
+ return 0;
+}
+
+subsys_initcall(wrt300nv2_pci_init);
Index: linux-2.6.23.17/arch/arm/mach-ixp4xx/wrt300nv2-setup.c
===================================================================
--- /dev/null
+++ linux-2.6.23.17/arch/arm/mach-ixp4xx/wrt300nv2-setup.c
@@ -0,0 +1,108 @@
+/*
+ * arch/arm/mach-ixp4xx/wrt300nv2-setup.c
+ *
+ * Board setup for the Linksys WRT300N v2
+ *
+ * Copyright (C) 2007 Imre Kaloz <Kaloz@openwrt.org>
+ *
+ * based on coyote-setup.c:
+ * Copyright (C) 2003-2005 MontaVista Software, Inc.
+ *
+ * Author: Imre Kaloz <Kaloz@openwrt.org>
+ */
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/device.h>
+#include <linux/serial.h>
+#include <linux/tty.h>
+#include <linux/serial_8250.h>
+#include <linux/slab.h>
+
+#include <asm/types.h>
+#include <asm/setup.h>
+#include <asm/memory.h>
+#include <asm/hardware.h>
+#include <asm/irq.h>
+#include <asm/mach-types.h>
+#include <asm/mach/arch.h>
+#include <asm/mach/flash.h>
+
+static struct flash_platform_data wrt300nv2_flash_data = {
+ .map_name = "cfi_probe",
+ .width = 2,
+};
+
+static struct resource wrt300nv2_flash_resource = {
+ .flags = IORESOURCE_MEM,
+};
+
+static struct platform_device wrt300nv2_flash = {
+ .name = "IXP4XX-Flash",
+ .id = 0,
+ .dev = {
+ .platform_data = &wrt300nv2_flash_data,
+ },
+ .num_resources = 1,
+ .resource = &wrt300nv2_flash_resource,
+};
+
+static struct resource wrt300nv2_uart_resource = {
+ .start = IXP4XX_UART2_BASE_PHYS,
+ .end = IXP4XX_UART2_BASE_PHYS + 0x0fff,
+ .flags = IORESOURCE_MEM,
+};
+
+static struct plat_serial8250_port wrt300nv2_uart_data[] = {
+ {
+ .mapbase = IXP4XX_UART2_BASE_PHYS,
+ .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET,
+ .irq = IRQ_IXP4XX_UART2,
+ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
+ .iotype = UPIO_MEM,
+ .regshift = 2,
+ .uartclk = IXP4XX_UART_XTAL,
+ },
+ { },
+};
+
+static struct platform_device wrt300nv2_uart = {
+ .name = "serial8250",
+ .id = PLAT8250_DEV_PLATFORM,
+ .dev = {
+ .platform_data = wrt300nv2_uart_data,
+ },
+ .num_resources = 1,
+ .resource = &wrt300nv2_uart_resource,
+};
+
+static struct platform_device *wrt300nv2_devices[] __initdata = {
+ &wrt300nv2_flash,
+ &wrt300nv2_uart
+};
+
+static void __init wrt300nv2_init(void)
+{
+ ixp4xx_sys_init();
+
+ wrt300nv2_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
+ wrt300nv2_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_32M - 1;
+
+ *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE;
+ *IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0;
+
+ platform_add_devices(wrt300nv2_devices, ARRAY_SIZE(wrt300nv2_devices));
+}
+
+#ifdef CONFIG_MACH_WRT300NV2
+MACHINE_START(WRT300NV2, "Linksys WRT300N v2")
+ /* Maintainer: Imre Kaloz <kaloz@openwrt.org> */
+ .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
+ .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
+ .map_io = ixp4xx_map_io,
+ .init_irq = ixp4xx_init_irq,
+ .timer = &ixp4xx_timer,
+ .boot_params = 0x0100,
+ .init_machine = wrt300nv2_init,
+MACHINE_END
+#endif
Index: linux-2.6.23.17/include/asm-arm/arch-ixp4xx/uncompress.h
===================================================================
--- linux-2.6.23.17.orig/include/asm-arm/arch-ixp4xx/uncompress.h
+++ linux-2.6.23.17/include/asm-arm/arch-ixp4xx/uncompress.h
@@ -42,7 +42,7 @@ static __inline__ void __arch_decomp_set
*/
if (machine_is_adi_coyote() || machine_is_gtwx5715() ||
machine_is_gateway7001() || machine_is_wg302v2() ||
- machine_is_pronghorn_metro())
+ machine_is_pronghorn_metro() || machine_is_wrt300nv2())
uart_base = (volatile u32*) IXP4XX_UART2_BASE_PHYS;
else
uart_base = (volatile u32*) IXP4XX_UART1_BASE_PHYS;

View File

@ -1,42 +0,0 @@
Index: linux-2.6.23.17/arch/arm/mach-ixp4xx/wrt300nv2-setup.c
===================================================================
--- linux-2.6.23.17.orig/arch/arm/mach-ixp4xx/wrt300nv2-setup.c
+++ linux-2.6.23.17/arch/arm/mach-ixp4xx/wrt300nv2-setup.c
@@ -76,9 +76,36 @@ static struct platform_device wrt300nv2_
.resource = &wrt300nv2_uart_resource,
};
+/* Built-in 10/100 Ethernet MAC interfaces */
+static struct eth_plat_info wrt300nv2_plat_eth[] = {
+ {
+ .phy = -1,
+ .rxq = 3,
+ .txreadyq = 20,
+ }, {
+ .phy = 1,
+ .rxq = 4,
+ .txreadyq = 21,
+ }
+};
+
+static struct platform_device wrt300nv2_eth[] = {
+ {
+ .name = "ixp4xx_eth",
+ .id = IXP4XX_ETH_NPEB,
+ .dev.platform_data = wrt300nv2_plat_eth,
+ }, {
+ .name = "ixp4xx_eth",
+ .id = IXP4XX_ETH_NPEC,
+ .dev.platform_data = wrt300nv2_plat_eth + 1,
+ }
+};
+
static struct platform_device *wrt300nv2_devices[] __initdata = {
&wrt300nv2_flash,
- &wrt300nv2_uart
+ &wrt300nv2_uart,
+ &wrt300nv2_eth[0],
+ &wrt300nv2_eth[1],
};
static void __init wrt300nv2_init(void)

View File

@ -1,243 +0,0 @@
Index: linux-2.6.23.17/arch/arm/mach-ixp4xx/Kconfig
===================================================================
--- linux-2.6.23.17.orig/arch/arm/mach-ixp4xx/Kconfig
+++ linux-2.6.23.17/arch/arm/mach-ixp4xx/Kconfig
@@ -65,6 +65,14 @@ config MACH_PRONGHORNMETRO
Engineering Pronghorn Metro Platform. For more
information on this platform, see <file:Documentation/arm/IXP4xx>.
+config MACH_SIDEWINDER
+ bool "Sidewinder"
+ select PCI
+ help
+ Say 'Y' here if you want your kernel to support the ADI
+ Engineering Sidewinder Platform. For more
+ information on this platform, see <file:Documentation/arm/IXP4xx>.
+
config MACH_COMPEX
bool "Compex WP18 / NP18A"
select PCI
@@ -163,7 +171,7 @@ config MACH_FSG
#
config CPU_IXP46X
bool
- depends on MACH_IXDP465
+ depends on MACH_IXDP465 || MACH_SIDEWINDER
default y
config CPU_IXP43X
Index: linux-2.6.23.17/arch/arm/mach-ixp4xx/Makefile
===================================================================
--- linux-2.6.23.17.orig/arch/arm/mach-ixp4xx/Makefile
+++ linux-2.6.23.17/arch/arm/mach-ixp4xx/Makefile
@@ -19,6 +19,7 @@ obj-pci-$(CONFIG_MACH_FSG) += fsg-pci.o
obj-pci-$(CONFIG_MACH_PRONGHORNMETRO) += pronghornmetro-pci.o
obj-pci-$(CONFIG_MACH_COMPEX) += ixdp425-pci.o
obj-pci-$(CONFIG_MACH_WRT300NV2) += wrt300nv2-pci.o
+obj-pci-$(CONFIG_MACH_SIDEWINDER) += sidewinder-pci.o
obj-y += common.o
@@ -36,5 +37,6 @@ obj-$(CONFIG_MACH_FSG) += fsg-setup.o f
obj-$(CONFIG_MACH_PRONGHORNMETRO) += pronghornmetro-setup.o
obj-$(CONFIG_MACH_COMPEX) += compex-setup.o
obj-$(CONFIG_MACH_WRT300NV2) += wrt300nv2-setup.o
+obj-$(CONFIG_MACH_SIDEWINDER) += sidewinder-setup.o
obj-$(CONFIG_PCI) += $(obj-pci-$(CONFIG_PCI)) common-pci.o
Index: linux-2.6.23.17/arch/arm/mach-ixp4xx/sidewinder-pci.c
===================================================================
--- /dev/null
+++ linux-2.6.23.17/arch/arm/mach-ixp4xx/sidewinder-pci.c
@@ -0,0 +1,71 @@
+/*
+ * arch/arch/mach-ixp4xx/pronghornmetro-pci.c
+ *
+ * PCI setup routines for ADI Engineering Sidewinder
+ *
+ * Copyright (C) 2007 Imre Kaloz <kaloz@openwrt.org>
+ *
+ * based on coyote-pci.c:
+ * Copyright (C) 2002 Jungo Software Technologies.
+ * Copyright (C) 2003 MontaVista Softwrae, Inc.
+ *
+ * Maintainer: Imre Kaloz <kaloz@openwrt.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ */
+
+#include <linux/kernel.h>
+#include <linux/pci.h>
+#include <linux/init.h>
+#include <linux/irq.h>
+
+#include <asm/mach-types.h>
+#include <asm/hardware.h>
+#include <asm/irq.h>
+
+#include <asm/mach/pci.h>
+
+extern void ixp4xx_pci_preinit(void);
+extern int ixp4xx_setup(int nr, struct pci_sys_data *sys);
+extern struct pci_bus *ixp4xx_scan_bus(int nr, struct pci_sys_data *sys);
+
+void __init sidewinder_pci_preinit(void)
+{
+ set_irq_type(IRQ_IXP4XX_GPIO11, IRQT_LOW);
+ set_irq_type(IRQ_IXP4XX_GPIO10, IRQT_LOW);
+ set_irq_type(IRQ_IXP4XX_GPIO9, IRQT_LOW);
+
+ ixp4xx_pci_preinit();
+}
+
+static int __init sidewinder_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
+{
+ if (slot == 1)
+ return IRQ_IXP4XX_GPIO11;
+ else if (slot == 2)
+ return IRQ_IXP4XX_GPIO10;
+ else if (slot == 3)
+ return IRQ_IXP4XX_GPIO9;
+ else return -1;
+}
+
+struct hw_pci sidewinder_pci __initdata = {
+ .nr_controllers = 1,
+ .preinit = sidewinder_pci_preinit,
+ .swizzle = pci_std_swizzle,
+ .setup = ixp4xx_setup,
+ .scan = ixp4xx_scan_bus,
+ .map_irq = sidewinder_map_irq,
+};
+
+int __init sidewinder_pci_init(void)
+{
+ if (machine_is_sidewinder())
+ pci_common_init(&sidewinder_pci);
+ return 0;
+}
+
+subsys_initcall(sidewinder_pci_init);
Index: linux-2.6.23.17/arch/arm/mach-ixp4xx/sidewinder-setup.c
===================================================================
--- /dev/null
+++ linux-2.6.23.17/arch/arm/mach-ixp4xx/sidewinder-setup.c
@@ -0,0 +1,115 @@
+/*
+ * arch/arm/mach-ixp4xx/sidewinder-setup.c
+ *
+ * Board setup for the ADI Engineering Sidewinder
+ *
+ * Copyright (C) 2007 Imre Kaloz <Kaloz@openwrt.org>
+ *
+ * based on coyote-setup.c:
+ * Copyright (C) 2003-2005 MontaVista Software, Inc.
+ *
+ * Author: Imre Kaloz <Kaloz@openwrt.org>
+ */
+
+#include <linux/kernel.h>
+#include <linux/serial.h>
+#include <linux/serial_8250.h>
+
+#include <asm/mach-types.h>
+#include <asm/mach/arch.h>
+#include <asm/mach/flash.h>
+
+static struct flash_platform_data sidewinder_flash_data = {
+ .map_name = "cfi_probe",
+ .width = 2,
+};
+
+static struct resource sidewinder_flash_resource = {
+ .flags = IORESOURCE_MEM,
+};
+
+static struct platform_device sidewinder_flash = {
+ .name = "IXP4XX-Flash",
+ .id = 0,
+ .dev = {
+ .platform_data = &sidewinder_flash_data,
+ },
+ .num_resources = 1,
+ .resource = &sidewinder_flash_resource,
+};
+
+static struct resource sidewinder_uart_resources[] = {
+ {
+ .start = IXP4XX_UART1_BASE_PHYS,
+ .end = IXP4XX_UART1_BASE_PHYS + 0x0fff,
+ .flags = IORESOURCE_MEM,
+ },
+ {
+ .start = IXP4XX_UART2_BASE_PHYS,
+ .end = IXP4XX_UART2_BASE_PHYS + 0x0fff,
+ .flags = IORESOURCE_MEM,
+ }
+};
+
+static struct plat_serial8250_port sidewinder_uart_data[] = {
+ {
+ .mapbase = IXP4XX_UART1_BASE_PHYS,
+ .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET,
+ .irq = IRQ_IXP4XX_UART1,
+ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
+ .iotype = UPIO_MEM,
+ .regshift = 2,
+ .uartclk = IXP4XX_UART_XTAL,
+ },
+ {
+ .mapbase = IXP4XX_UART2_BASE_PHYS,
+ .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET,
+ .irq = IRQ_IXP4XX_UART2,
+ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
+ .iotype = UPIO_MEM,
+ .regshift = 2,
+ .uartclk = IXP4XX_UART_XTAL,
+ },
+ { },
+};
+
+static struct platform_device sidewinder_uart = {
+ .name = "serial8250",
+ .id = PLAT8250_DEV_PLATFORM,
+ .dev = {
+ .platform_data = sidewinder_uart_data,
+ },
+ .num_resources = ARRAY_SIZE(sidewinder_uart_resources),
+ .resource = sidewinder_uart_resources,
+};
+
+static struct platform_device *sidewinder_devices[] __initdata = {
+ &sidewinder_flash,
+ &sidewinder_uart,
+};
+
+static void __init sidewinder_init(void)
+{
+ ixp4xx_sys_init();
+
+ sidewinder_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
+ sidewinder_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_64M - 1;
+
+ *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE;
+ *IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0;
+
+ platform_add_devices(sidewinder_devices, ARRAY_SIZE(sidewinder_devices));
+}
+
+#ifdef CONFIG_MACH_SIDEWINDER
+MACHINE_START(SIDEWINDER, "ADI Engineering Sidewinder")
+ /* Maintainer: Imre Kaloz <kaloz@openwrt.org> */
+ .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
+ .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
+ .map_io = ixp4xx_map_io,
+ .init_irq = ixp4xx_init_irq,
+ .timer = &ixp4xx_timer,
+ .boot_params = 0x0100,
+ .init_machine = sidewinder_init,
+MACHINE_END
+#endif

View File

@ -1,217 +0,0 @@
Index: linux-2.6.23.17/arch/arm/mach-ixp4xx/ap1000-setup.c
===================================================================
--- /dev/null
+++ linux-2.6.23.17/arch/arm/mach-ixp4xx/ap1000-setup.c
@@ -0,0 +1,151 @@
+/*
+ * arch/arm/mach-ixp4xx/ap1000-setup.c
+ *
+ * Lanready AP-1000
+ *
+ * Copyright (C) 2007 Imre Kaloz <Kaloz@openwrt.org>
+ *
+ * based on ixdp425-setup.c:
+ * Copyright (C) 2003-2005 MontaVista Software, Inc.
+ *
+ * Author: Imre Kaloz <Kaloz@openwrt.org>
+ */
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/device.h>
+#include <linux/serial.h>
+#include <linux/tty.h>
+#include <linux/serial_8250.h>
+#include <linux/slab.h>
+
+#include <asm/types.h>
+#include <asm/setup.h>
+#include <asm/memory.h>
+#include <asm/hardware.h>
+#include <asm/mach-types.h>
+#include <asm/irq.h>
+#include <asm/mach/arch.h>
+#include <asm/mach/flash.h>
+
+static struct flash_platform_data ap1000_flash_data = {
+ .map_name = "cfi_probe",
+ .width = 2,
+};
+
+static struct resource ap1000_flash_resource = {
+ .flags = IORESOURCE_MEM,
+};
+
+static struct platform_device ap1000_flash = {
+ .name = "IXP4XX-Flash",
+ .id = 0,
+ .dev = {
+ .platform_data = &ap1000_flash_data,
+ },
+ .num_resources = 1,
+ .resource = &ap1000_flash_resource,
+};
+
+static struct resource ap1000_uart_resources[] = {
+ {
+ .start = IXP4XX_UART1_BASE_PHYS,
+ .end = IXP4XX_UART1_BASE_PHYS + 0x0fff,
+ .flags = IORESOURCE_MEM
+ },
+ {
+ .start = IXP4XX_UART2_BASE_PHYS,
+ .end = IXP4XX_UART2_BASE_PHYS + 0x0fff,
+ .flags = IORESOURCE_MEM
+ }
+};
+
+static struct plat_serial8250_port ap1000_uart_data[] = {
+ {
+ .mapbase = IXP4XX_UART1_BASE_PHYS,
+ .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET,
+ .irq = IRQ_IXP4XX_UART1,
+ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
+ .iotype = UPIO_MEM,
+ .regshift = 2,
+ .uartclk = IXP4XX_UART_XTAL,
+ },
+ {
+ .mapbase = IXP4XX_UART2_BASE_PHYS,
+ .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET,
+ .irq = IRQ_IXP4XX_UART2,
+ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
+ .iotype = UPIO_MEM,
+ .regshift = 2,
+ .uartclk = IXP4XX_UART_XTAL,
+ },
+ { },
+};
+
+static struct platform_device ap1000_uart = {
+ .name = "serial8250",
+ .id = PLAT8250_DEV_PLATFORM,
+ .dev.platform_data = ap1000_uart_data,
+ .num_resources = 2,
+ .resource = ap1000_uart_resources
+};
+
+static struct platform_device *ap1000_devices[] __initdata = {
+ &ap1000_flash,
+ &ap1000_uart
+};
+
+static char ap1000_mem_fixup[] __initdata = "mem=64M ";
+
+static void __init ap1000_fixup(struct machine_desc *desc,
+ struct tag *tags, char **cmdline, struct meminfo *mi)
+
+{
+ struct tag *t = tags;
+ char *p = *cmdline;
+
+ /* Find the end of the tags table, taking note of any cmdline tag. */
+ for (; t->hdr.size; t = tag_next(t)) {
+ if (t->hdr.tag == ATAG_CMDLINE) {
+ p = t->u.cmdline.cmdline;
+ }
+ }
+
+ /* Overwrite the end of the table with a new cmdline tag. */
+ t->hdr.tag = ATAG_CMDLINE;
+ t->hdr.size = (sizeof (struct tag_header) +
+ strlen(ap1000_mem_fixup) + strlen(p) + 1 + 4) >> 2;
+ strlcpy(t->u.cmdline.cmdline, ap1000_mem_fixup, COMMAND_LINE_SIZE);
+ strlcpy(t->u.cmdline.cmdline + strlen(ap1000_mem_fixup), p,
+ COMMAND_LINE_SIZE - strlen(ap1000_mem_fixup));
+
+ /* Terminate the table. */
+ t = tag_next(t);
+ t->hdr.tag = ATAG_NONE;
+ t->hdr.size = 0;
+}
+
+static void __init ap1000_init(void)
+{
+ ixp4xx_sys_init();
+
+ ap1000_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
+ ap1000_flash_resource.end =
+ IXP4XX_EXP_BUS_BASE(0) + ixp4xx_exp_bus_size - 1;
+
+ platform_add_devices(ap1000_devices, ARRAY_SIZE(ap1000_devices));
+}
+
+#ifdef CONFIG_MACH_AP1000
+MACHINE_START(AP1000, "Lanready AP-1000")
+ /* Maintainer: Imre Kaloz <Kaloz@openwrt.org> */
+ .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
+ .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
+ .fixup = ap1000_fixup,
+ .map_io = ixp4xx_map_io,
+ .init_irq = ixp4xx_init_irq,
+ .timer = &ixp4xx_timer,
+ .boot_params = 0x0100,
+ .init_machine = ap1000_init,
+MACHINE_END
+#endif
Index: linux-2.6.23.17/arch/arm/mach-ixp4xx/ixdp425-pci.c
===================================================================
--- linux-2.6.23.17.orig/arch/arm/mach-ixp4xx/ixdp425-pci.c
+++ linux-2.6.23.17/arch/arm/mach-ixp4xx/ixdp425-pci.c
@@ -66,7 +66,8 @@ struct hw_pci ixdp425_pci __initdata = {
int __init ixdp425_pci_init(void)
{
if (machine_is_ixdp425() || machine_is_ixcdp1100() ||
- machine_is_ixdp465() || machine_is_kixrp435() || machine_is_compex())
+ machine_is_ixdp465() || machine_is_kixrp435() ||
+ machine_is_compex() || machine_is_ap1000())
pci_common_init(&ixdp425_pci);
return 0;
}
Index: linux-2.6.23.17/arch/arm/mach-ixp4xx/Kconfig
===================================================================
--- linux-2.6.23.17.orig/arch/arm/mach-ixp4xx/Kconfig
+++ linux-2.6.23.17/arch/arm/mach-ixp4xx/Kconfig
@@ -89,6 +89,14 @@ config MACH_WRT300NV2
WRT300N v2 router. For more information on this
platform, see http://openwrt.org
+config MACH_AP1000
+ bool "Lanready AP-1000"
+ select PCI
+ help
+ Say 'Y' here if you want your kernel to support Lanready's
+ AP1000 board. For more information on this
+ platform, see http://openwrt.org
+
config ARCH_IXDP425
bool "IXDP425"
help
Index: linux-2.6.23.17/arch/arm/mach-ixp4xx/Makefile
===================================================================
--- linux-2.6.23.17.orig/arch/arm/mach-ixp4xx/Makefile
+++ linux-2.6.23.17/arch/arm/mach-ixp4xx/Makefile
@@ -20,6 +20,7 @@ obj-pci-$(CONFIG_MACH_PRONGHORNMETRO) +=
obj-pci-$(CONFIG_MACH_COMPEX) += ixdp425-pci.o
obj-pci-$(CONFIG_MACH_WRT300NV2) += wrt300nv2-pci.o
obj-pci-$(CONFIG_MACH_SIDEWINDER) += sidewinder-pci.o
+obj-pci-$(CONFIG_MACH_AP1000) += ixdp425-pci.o
obj-y += common.o
@@ -38,5 +39,6 @@ obj-$(CONFIG_MACH_PRONGHORNMETRO) += pro
obj-$(CONFIG_MACH_COMPEX) += compex-setup.o
obj-$(CONFIG_MACH_WRT300NV2) += wrt300nv2-setup.o
obj-$(CONFIG_MACH_SIDEWINDER) += sidewinder-setup.o
+obj-$(CONFIG_MACH_AP1000) += ap1000-setup.o
obj-$(CONFIG_PCI) += $(obj-pci-$(CONFIG_PCI)) common-pci.o
Index: linux-2.6.23.17/arch/arm/tools/mach-types
===================================================================
--- linux-2.6.23.17.orig/arch/arm/tools/mach-types
+++ linux-2.6.23.17/arch/arm/tools/mach-types
@@ -1367,3 +1367,4 @@ db88f5281 MACH_DB88F5281 DB88F5281 13
csb726 MACH_CSB726 CSB726 1359
tik27 MACH_TIK27 TIK27 1360
mx_uc7420 MACH_MX_UC7420 MX_UC7420 1361
+ap1000 MACH_AP1000 AP1000 1543

View File

@ -1,42 +0,0 @@
Index: linux-2.6.23.17/arch/arm/mach-ixp4xx/ap1000-setup.c
===================================================================
--- linux-2.6.23.17.orig/arch/arm/mach-ixp4xx/ap1000-setup.c
+++ linux-2.6.23.17/arch/arm/mach-ixp4xx/ap1000-setup.c
@@ -90,9 +90,36 @@ static struct platform_device ap1000_uar
.resource = ap1000_uart_resources
};
+/* Built-in 10/100 Ethernet MAC interfaces */
+static struct eth_plat_info ap1000_plat_eth[] = {
+ {
+ .phy = 4,
+ .rxq = 3,
+ .txreadyq = 20,
+ }, {
+ .phy = 5,
+ .rxq = 4,
+ .txreadyq = 21,
+ }
+};
+
+static struct platform_device ap1000_eth[] = {
+ {
+ .name = "ixp4xx_eth",
+ .id = IXP4XX_ETH_NPEB,
+ .dev.platform_data = ap1000_plat_eth,
+ }, {
+ .name = "ixp4xx_eth",
+ .id = IXP4XX_ETH_NPEC,
+ .dev.platform_data = ap1000_plat_eth + 1,
+ }
+};
+
static struct platform_device *ap1000_devices[] __initdata = {
&ap1000_flash,
- &ap1000_uart
+ &ap1000_uart,
+ &ap1000_eth[0],
+ &ap1000_eth[1],
};
static char ap1000_mem_fixup[] __initdata = "mem=64M ";

View File

@ -1,221 +0,0 @@
Index: linux-2.6.23.17/arch/arm/mach-ixp4xx/Kconfig
===================================================================
--- linux-2.6.23.17.orig/arch/arm/mach-ixp4xx/Kconfig
+++ linux-2.6.23.17/arch/arm/mach-ixp4xx/Kconfig
@@ -49,6 +49,14 @@ config MACH_GATEWAY7001
7001 Access Point. For more information on this platform,
see http://openwrt.org
+config MACH_WG302V1
+ bool "Netgear WG302 v1 / WAG302 v1"
+ select PCI
+ help
+ Say 'Y' here if you want your kernel to support Netgear's
+ WG302 v1 or WAG302 v1 Access Points. For more information
+ on this platform, see http://openwrt.org
+
config MACH_WG302V2
bool "Netgear WG302 v2 / WAG302 v2"
select PCI
Index: linux-2.6.23.17/arch/arm/mach-ixp4xx/Makefile
===================================================================
--- linux-2.6.23.17.orig/arch/arm/mach-ixp4xx/Makefile
+++ linux-2.6.23.17/arch/arm/mach-ixp4xx/Makefile
@@ -14,6 +14,7 @@ obj-pci-$(CONFIG_MACH_NSLU2) += nslu2-p
obj-pci-$(CONFIG_MACH_NAS100D) += nas100d-pci.o
obj-pci-$(CONFIG_MACH_DSMG600) += dsmg600-pci.o
obj-pci-$(CONFIG_MACH_GATEWAY7001) += gateway7001-pci.o
+obj-pci-$(CONFIG_MACH_WG302V1) += wg302v1-pci.o
obj-pci-$(CONFIG_MACH_WG302V2) += wg302v2-pci.o
obj-pci-$(CONFIG_MACH_FSG) += fsg-pci.o
obj-pci-$(CONFIG_MACH_PRONGHORNMETRO) += pronghornmetro-pci.o
@@ -33,6 +34,7 @@ obj-$(CONFIG_MACH_NSLU2) += nslu2-setup.
obj-$(CONFIG_MACH_NAS100D) += nas100d-setup.o nas100d-power.o
obj-$(CONFIG_MACH_DSMG600) += dsmg600-setup.o dsmg600-power.o
obj-$(CONFIG_MACH_GATEWAY7001) += gateway7001-setup.o
+obj-$(CONFIG_MACH_WG302V1) += wg302v1-setup.o
obj-$(CONFIG_MACH_WG302V2) += wg302v2-setup.o
obj-$(CONFIG_MACH_FSG) += fsg-setup.o fsg-power.o
obj-$(CONFIG_MACH_PRONGHORNMETRO) += pronghornmetro-setup.o
Index: linux-2.6.23.17/arch/arm/mach-ixp4xx/wg302v1-pci.c
===================================================================
--- /dev/null
+++ linux-2.6.23.17/arch/arm/mach-ixp4xx/wg302v1-pci.c
@@ -0,0 +1,63 @@
+/*
+ * arch/arch/mach-ixp4xx/wg302v1-pci.c
+ *
+ * PCI setup routines for the Netgear WG302 v1 and WAG302 v1
+ *
+ * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
+ *
+ * based on coyote-pci.c:
+ * Copyright (C) 2002 Jungo Software Technologies.
+ * Copyright (C) 2003 MontaVista Software, Inc.
+ *
+ * Maintainer: Imre Kaloz <kaloz@openwrt.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ */
+
+#include <linux/kernel.h>
+#include <linux/pci.h>
+#include <linux/init.h>
+#include <linux/irq.h>
+
+#include <asm/mach-types.h>
+#include <asm/hardware.h>
+
+#include <asm/mach/pci.h>
+
+void __init wg302v1_pci_preinit(void)
+{
+ set_irq_type(IRQ_IXP4XX_GPIO8, IRQT_LOW);
+ set_irq_type(IRQ_IXP4XX_GPIO10, IRQT_LOW);
+
+ ixp4xx_pci_preinit();
+}
+
+static int __init wg302v1_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
+{
+ if (slot == 1)
+ return IRQ_IXP4XX_GPIO8;
+ else if (slot == 2)
+ return IRQ_IXP4XX_GPIO10;
+ else return -1;
+}
+
+struct hw_pci wg302v1_pci __initdata = {
+ .nr_controllers = 1,
+ .preinit = wg302v1_pci_preinit,
+ .swizzle = pci_std_swizzle,
+ .setup = ixp4xx_setup,
+ .scan = ixp4xx_scan_bus,
+ .map_irq = wg302v1_map_irq,
+};
+
+int __init wg302v1_pci_init(void)
+{
+ if (machine_is_wg302v1())
+ pci_common_init(&wg302v1_pci);
+ return 0;
+}
+
+subsys_initcall(wg302v1_pci_init);
Index: linux-2.6.23.17/arch/arm/mach-ixp4xx/wg302v1-setup.c
===================================================================
--- /dev/null
+++ linux-2.6.23.17/arch/arm/mach-ixp4xx/wg302v1-setup.c
@@ -0,0 +1,109 @@
+/*
+ * arch/arm/mach-ixp4xx/wg302v1-setup.c
+ *
+ * Board setup for the Netgear WG302 v1 and WAG302 v1
+ *
+ * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
+ *
+ * based on coyote-setup.c:
+ * Copyright (C) 2003-2005 MontaVista Software, Inc.
+ *
+ * Author: Imre Kaloz <kaloz@openwrt.org>
+ *
+ */
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/device.h>
+#include <linux/serial.h>
+#include <linux/tty.h>
+#include <linux/serial_8250.h>
+#include <linux/slab.h>
+
+#include <asm/types.h>
+#include <asm/setup.h>
+#include <asm/memory.h>
+#include <asm/hardware.h>
+#include <asm/irq.h>
+#include <asm/mach-types.h>
+#include <asm/mach/arch.h>
+#include <asm/mach/flash.h>
+
+static struct flash_platform_data wg302v1_flash_data = {
+ .map_name = "cfi_probe",
+ .width = 2,
+};
+
+static struct resource wg302v1_flash_resource = {
+ .flags = IORESOURCE_MEM,
+};
+
+static struct platform_device wg302v1_flash = {
+ .name = "IXP4XX-Flash",
+ .id = 0,
+ .dev = {
+ .platform_data = &wg302v1_flash_data,
+ },
+ .num_resources = 1,
+ .resource = &wg302v1_flash_resource,
+};
+
+static struct resource wg302v1_uart_resource = {
+ .start = IXP4XX_UART1_BASE_PHYS,
+ .end = IXP4XX_UART1_BASE_PHYS + 0x0fff,
+ .flags = IORESOURCE_MEM,
+};
+
+static struct plat_serial8250_port wg302v1_uart_data[] = {
+ {
+ .mapbase = IXP4XX_UART1_BASE_PHYS,
+ .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET,
+ .irq = IRQ_IXP4XX_UART1,
+ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
+ .iotype = UPIO_MEM,
+ .regshift = 2,
+ .uartclk = IXP4XX_UART_XTAL,
+ },
+ { },
+};
+
+static struct platform_device wg302v1_uart = {
+ .name = "serial8250",
+ .id = PLAT8250_DEV_PLATFORM,
+ .dev = {
+ .platform_data = wg302v1_uart_data,
+ },
+ .num_resources = 1,
+ .resource = &wg302v1_uart_resource,
+};
+
+static struct platform_device *wg302v1_devices[] __initdata = {
+ &wg302v1_flash,
+ &wg302v1_uart,
+};
+
+static void __init wg302v1_init(void)
+{
+ ixp4xx_sys_init();
+
+ wg302v1_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
+ wg302v1_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_32M - 1;
+
+ *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE;
+ *IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0;
+
+ platform_add_devices(wg302v1_devices, ARRAY_SIZE(wg302v1_devices));
+}
+
+#ifdef CONFIG_MACH_WG302V1
+MACHINE_START(WG302V1, "Netgear WG302 v1 / WAG302 v1")
+ /* Maintainer: Imre Kaloz <kaloz@openwrt.org> */
+ .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
+ .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
+ .map_io = ixp4xx_map_io,
+ .init_irq = ixp4xx_init_irq,
+ .timer = &ixp4xx_timer,
+ .boot_params = 0x0100,
+ .init_machine = wg302v1_init,
+MACHINE_END
+#endif

View File

@ -1,32 +0,0 @@
Index: linux-2.6.23.17/arch/arm/mach-ixp4xx/wg302v1-setup.c
===================================================================
--- linux-2.6.23.17.orig/arch/arm/mach-ixp4xx/wg302v1-setup.c
+++ linux-2.6.23.17/arch/arm/mach-ixp4xx/wg302v1-setup.c
@@ -77,9 +77,27 @@ static struct platform_device wg302v1_ua
.resource = &wg302v1_uart_resource,
};
+/* Built-in 10/100 Ethernet MAC interfaces */
+static struct eth_plat_info wg302_plat_eth[] = {
+ {
+ .phy = 30,
+ .rxq = 3,
+ .txreadyq = 20,
+ }
+};
+
+static struct platform_device wg302_eth[] = {
+ {
+ .name = "ixp4xx_eth",
+ .id = IXP4XX_ETH_NPEB,
+ .dev.platform_data = wg302_plat_eth,
+ }
+};
+
static struct platform_device *wg302v1_devices[] __initdata = {
&wg302v1_flash,
&wg302v1_uart,
+ &wg302_eth[0],
};
static void __init wg302v1_init(void)

View File

@ -1,49 +0,0 @@
Index: linux-2.6.23.17/arch/arm/mach-ixp4xx/wg302v1-setup.c
===================================================================
--- linux-2.6.23.17.orig/arch/arm/mach-ixp4xx/wg302v1-setup.c
+++ linux-2.6.23.17/arch/arm/mach-ixp4xx/wg302v1-setup.c
@@ -100,6 +100,36 @@ static struct platform_device *wg302v1_d
&wg302_eth[0],
};
+static char wg302v1_mem_fixup[] __initdata = "mem=32M ";
+
+static void __init wg302v1_fixup(struct machine_desc *desc,
+ struct tag *tags, char **cmdline, struct meminfo *mi)
+
+{
+ struct tag *t = tags;
+ char *p = *cmdline;
+
+ /* Find the end of the tags table, taking note of any cmdline tag. */
+ for (; t->hdr.size; t = tag_next(t)) {
+ if (t->hdr.tag == ATAG_CMDLINE) {
+ p = t->u.cmdline.cmdline;
+ }
+ }
+
+ /* Overwrite the end of the table with a new cmdline tag. */
+ t->hdr.tag = ATAG_CMDLINE;
+ t->hdr.size = (sizeof (struct tag_header) +
+ strlen(wg302v1_mem_fixup) + strlen(p) + 1 + 4) >> 2;
+ strlcpy(t->u.cmdline.cmdline, wg302v1_mem_fixup, COMMAND_LINE_SIZE);
+ strlcpy(t->u.cmdline.cmdline + strlen(wg302v1_mem_fixup), p,
+ COMMAND_LINE_SIZE - strlen(wg302v1_mem_fixup));
+
+ /* Terminate the table. */
+ t = tag_next(t);
+ t->hdr.tag = ATAG_NONE;
+ t->hdr.size = 0;
+}
+
static void __init wg302v1_init(void)
{
ixp4xx_sys_init();
@@ -118,6 +148,7 @@ MACHINE_START(WG302V1, "Netgear WG302 v1
/* Maintainer: Imre Kaloz <kaloz@openwrt.org> */
.phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
.io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
+ .fixup = wg302v1_fixup,
.map_io = ixp4xx_map_io,
.init_irq = ixp4xx_init_irq,
.timer = &ixp4xx_timer,

File diff suppressed because it is too large Load Diff

View File

@ -1,13 +0,0 @@
Index: linux-2.6.23.17/arch/arm/mach-ixp4xx/ixp4xx_npe.c
===================================================================
--- linux-2.6.23.17.orig/arch/arm/mach-ixp4xx/ixp4xx_npe.c
+++ linux-2.6.23.17/arch/arm/mach-ixp4xx/ixp4xx_npe.c
@@ -588,6 +588,8 @@ int npe_load_firmware(struct npe *npe, c
npe_reset(npe);
#endif
+ print_npe(KERN_INFO, npe, "firmware's license can be found in /usr/share/doc/LICENSE.IPL\n");
+
print_npe(KERN_INFO, npe, "firmware functionality 0x%X, "
"revision 0x%X:%X\n", (image->id >> 16) & 0xFF,
(image->id >> 8) & 0xFF, image->id & 0xFF);

View File

@ -1,42 +0,0 @@
Index: linux-2.6.23.17/drivers/net/arm/ixp4xx_eth.c
===================================================================
--- linux-2.6.23.17.orig/drivers/net/arm/ixp4xx_eth.c
+++ linux-2.6.23.17/drivers/net/arm/ixp4xx_eth.c
@@ -297,6 +297,27 @@ static int mdio_read(struct net_device *
unsigned long flags;
u16 val;
+ /* For boards that use a switch chip (eg. Marvell 88E6060) */
+ if ( phy_id < 0 || phy_id > 31 ) {
+ switch (location) {
+ case MII_BMCR:
+ val = 0x3100;
+ break;
+ case MII_BMSR:
+ val = 0x406d;
+ break;
+ case MII_ADVERTISE:
+ val = 0x0101;
+ break;
+ case MII_LPA:
+ val = 0x4101;
+ break;
+ default:
+ val = 0;
+ break;
+ }
+ return val;
+ }
spin_lock_irqsave(&mdio_lock, flags);
val = mdio_cmd(dev, phy_id, location, 0, 0);
spin_unlock_irqrestore(&mdio_lock, flags);
@@ -308,6 +329,9 @@ static void mdio_write(struct net_device
{
unsigned long flags;
+ if ( phy_id < 0 || phy_id > 31 ) {
+ return;
+ }
spin_lock_irqsave(&mdio_lock, flags);
mdio_cmd(dev, phy_id, location, 1, val);
spin_unlock_irqrestore(&mdio_lock, flags);

View File

@ -1,190 +0,0 @@
Index: linux-2.6.23.17/drivers/i2c/chips/eeprom.c
===================================================================
--- linux-2.6.23.17.orig/drivers/i2c/chips/eeprom.c
+++ linux-2.6.23.17/drivers/i2c/chips/eeprom.c
@@ -33,6 +33,8 @@
#include <linux/jiffies.h>
#include <linux/i2c.h>
#include <linux/mutex.h>
+#include <linux/notifier.h>
+#include <linux/eeprom.h>
/* Addresses to scan */
static unsigned short normal_i2c[] = { 0x50, 0x51, 0x52, 0x53, 0x54,
@@ -41,26 +43,7 @@ static unsigned short normal_i2c[] = { 0
/* Insmod parameters */
I2C_CLIENT_INSMOD_1(eeprom);
-
-/* Size of EEPROM in bytes */
-#define EEPROM_SIZE 256
-
-/* possible types of eeprom devices */
-enum eeprom_nature {
- UNKNOWN,
- VAIO,
-};
-
-/* Each client has this additional data */
-struct eeprom_data {
- struct i2c_client client;
- struct mutex update_lock;
- u8 valid; /* bitfield, bit!=0 if slice is valid */
- unsigned long last_updated[8]; /* In jiffies, 8 slices */
- u8 data[EEPROM_SIZE]; /* Register values */
- enum eeprom_nature nature;
-};
-
+ATOMIC_NOTIFIER_HEAD(eeprom_chain);
static int eeprom_attach_adapter(struct i2c_adapter *adapter);
static int eeprom_detect(struct i2c_adapter *adapter, int address, int kind);
@@ -198,6 +181,7 @@ static int eeprom_detect(struct i2c_adap
data->valid = 0;
mutex_init(&data->update_lock);
data->nature = UNKNOWN;
+ data->attr = &eeprom_attr;
/* Tell the I2C layer a new client has arrived */
if ((err = i2c_attach_client(new_client)))
@@ -225,6 +209,9 @@ static int eeprom_detect(struct i2c_adap
if (err)
goto exit_detach;
+ /* call the notifier chain */
+ atomic_notifier_call_chain(&eeprom_chain, EEPROM_REGISTER, data);
+
return 0;
exit_detach:
@@ -250,6 +237,41 @@ static int eeprom_detach_client(struct i
return 0;
}
+/**
+ * register_eeprom_notifier - register a 'user' of EEPROM devices.
+ * @nb: pointer to notifier info structure
+ *
+ * Registers a callback function to be called upon detection
+ * of an EEPROM device. Detection invokes the 'add' callback
+ * with the kobj of the mutex and a bin_attribute which allows
+ * read from the EEPROM. The intention is that the notifier
+ * will be able to read system configuration from the notifier.
+ *
+ * Only EEPROMs detected *after* the addition of the notifier
+ * are notified. I.e. EEPROMs already known to the system
+ * will not be notified - add the notifier from board level
+ * code!
+ */
+int register_eeprom_notifier(struct notifier_block *nb)
+{
+ return atomic_notifier_chain_register(&eeprom_chain, nb);
+}
+
+/**
+ * unregister_eeprom_notifier - unregister a 'user' of EEPROM devices.
+ * @old: pointer to notifier info structure
+ *
+ * Removes a callback function from the list of 'users' to be
+ * notified upon detection of EEPROM devices.
+ */
+int unregister_eeprom_notifier(struct notifier_block *nb)
+{
+ return atomic_notifier_chain_unregister(&eeprom_chain, nb);
+}
+
+EXPORT_SYMBOL_GPL(register_eeprom_notifier);
+EXPORT_SYMBOL_GPL(unregister_eeprom_notifier);
+
static int __init eeprom_init(void)
{
return i2c_add_driver(&eeprom_driver);
Index: linux-2.6.23.17/include/linux/eeprom.h
===================================================================
--- /dev/null
+++ linux-2.6.23.17/include/linux/eeprom.h
@@ -0,0 +1,71 @@
+#ifndef _LINUX_EEPROM_H
+#define _LINUX_EEPROM_H
+/*
+ * EEPROM notifier header
+ *
+ * Copyright (C) 2006 John Bowler
+ */
+
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef __KERNEL__
+#error This is a kernel header
+#endif
+
+#include <linux/list.h>
+#include <linux/kobject.h>
+#include <linux/sysfs.h>
+
+/* Size of EEPROM in bytes */
+#define EEPROM_SIZE 256
+
+/* possible types of eeprom devices */
+enum eeprom_nature {
+ UNKNOWN,
+ VAIO,
+};
+
+/* Each client has this additional data */
+struct eeprom_data {
+ struct i2c_client client;
+ struct mutex update_lock;
+ u8 valid; /* bitfield, bit!=0 if slice is valid */
+ unsigned long last_updated[8]; /* In jiffies, 8 slices */
+ u8 data[EEPROM_SIZE]; /* Register values */
+ enum eeprom_nature nature;
+ struct bin_attribute *attr;
+};
+
+/*
+ * This is very basic.
+ *
+ * If an EEPROM is detected on the I2C bus (this only works for
+ * I2C EEPROMs) the notifier chain is called with
+ * both the I2C information and the kobject for the sysfs
+ * device which has been registers. It is then possible to
+ * read from the device via the bin_attribute::read method
+ * to extract configuration information.
+ *
+ * Register the notifier in the board level code, there is no
+ * need to unregister it but you can if you want (it will save
+ * a little bit or kernel memory to do so).
+ */
+
+extern int register_eeprom_notifier(struct notifier_block *nb);
+extern int unregister_eeprom_notifier(struct notifier_block *nb);
+
+#endif /* _LINUX_EEPROM_H */
Index: linux-2.6.23.17/include/linux/notifier.h
===================================================================
--- linux-2.6.23.17.orig/include/linux/notifier.h
+++ linux-2.6.23.17/include/linux/notifier.h
@@ -231,5 +231,8 @@ static inline int notifier_to_errno(int
#define PM_SUSPEND_PREPARE 0x0003 /* Going to suspend the system */
#define PM_POST_SUSPEND 0x0004 /* Suspend finished */
+/* eeprom notifier chain */
+#define EEPROM_REGISTER 0x0001
+
#endif /* __KERNEL__ */
#endif /* _LINUX_NOTIFIER_H */

View File

@ -1,43 +0,0 @@
Index: linux-2.6.23.17/arch/arm/mach-ixp4xx/avila-setup.c
===================================================================
--- linux-2.6.23.17.orig/arch/arm/mach-ixp4xx/avila-setup.c
+++ linux-2.6.23.17/arch/arm/mach-ixp4xx/avila-setup.c
@@ -132,10 +132,37 @@ static struct platform_device avila_pata
.resource = avila_pata_resources,
};
+/* Built-in 10/100 Ethernet MAC interfaces */
+static struct eth_plat_info avila_plat_eth[] = {
+ {
+ .phy = 0,
+ .rxq = 3,
+ .txreadyq = 20,
+ }, {
+ .phy = 1,
+ .rxq = 4,
+ .txreadyq = 21,
+ }
+};
+
+static struct platform_device avila_eth[] = {
+ {
+ .name = "ixp4xx_eth",
+ .id = IXP4XX_ETH_NPEB,
+ .dev.platform_data = avila_plat_eth,
+ }, {
+ .name = "ixp4xx_eth",
+ .id = IXP4XX_ETH_NPEC,
+ .dev.platform_data = avila_plat_eth + 1,
+ }
+};
+
static struct platform_device *avila_devices[] __initdata = {
&avila_i2c_gpio,
&avila_flash,
- &avila_uart
+ &avila_uart,
+ &avila_eth[0],
+ &avila_eth[1],
};
static void __init avila_init(void)

View File

@ -1,56 +0,0 @@
Index: linux-2.6.23.17/arch/arm/mach-ixp4xx/avila-setup.c
===================================================================
--- linux-2.6.23.17.orig/arch/arm/mach-ixp4xx/avila-setup.c
+++ linux-2.6.23.17/arch/arm/mach-ixp4xx/avila-setup.c
@@ -165,6 +165,35 @@ static struct platform_device *avila_dev
&avila_eth[1],
};
+static char avila_rtc_probe[] __initdata = "rtc-ds1672.probe=0,0x68 ";
+
+static void __init avila_fixup(struct machine_desc *desc,
+ struct tag *tags, char **cmdline, struct meminfo *mi)
+{
+ struct tag *t = tags;
+ char *p = *cmdline;
+
+ /* Find the end of the tags table, taking note of any cmdline tag. */
+ for (; t->hdr.size; t = tag_next(t)) {
+ if (t->hdr.tag == ATAG_CMDLINE) {
+ p = t->u.cmdline.cmdline;
+ }
+ }
+
+ /* Overwrite the end of the table with a new cmdline tag. */
+ t->hdr.tag = ATAG_CMDLINE;
+ t->hdr.size = (sizeof (struct tag_header) +
+ strlen(avila_rtc_probe) + strlen(p) + 1 + 4) >> 2;
+ strlcpy(t->u.cmdline.cmdline, avila_rtc_probe, COMMAND_LINE_SIZE);
+ strlcpy(t->u.cmdline.cmdline + strlen(avila_rtc_probe), p,
+ COMMAND_LINE_SIZE - strlen(avila_rtc_probe));
+
+ /* Terminate the table. */
+ t = tag_next(t);
+ t->hdr.tag = ATAG_NONE;
+ t->hdr.size = 0;
+}
+
static void __init avila_init(void)
{
ixp4xx_sys_init();
@@ -192,6 +221,7 @@ MACHINE_START(AVILA, "Gateworks Avila Ne
/* Maintainer: Deepak Saxena <dsaxena@plexity.net> */
.phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
.io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
+ .fixup = avila_fixup,
.map_io = ixp4xx_map_io,
.init_irq = ixp4xx_init_irq,
.timer = &ixp4xx_timer,
@@ -209,6 +239,7 @@ MACHINE_START(LOFT, "Giant Shoulder Inc
/* Maintainer: Tom Billman <kernel@giantshoulderinc.com> */
.phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
.io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
+ .fixup = avila_fixup,
.map_io = ixp4xx_map_io,
.init_irq = ixp4xx_init_irq,
.timer = &ixp4xx_timer,

View File

@ -1,72 +0,0 @@
Index: linux-2.6.23.17/arch/arm/mach-ixp4xx/avila-setup.c
===================================================================
--- linux-2.6.23.17.orig/arch/arm/mach-ixp4xx/avila-setup.c
+++ linux-2.6.23.17/arch/arm/mach-ixp4xx/avila-setup.c
@@ -14,10 +14,18 @@
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/device.h>
+#include <linux/if_ether.h>
+#include <linux/socket.h>
+#include <linux/netdevice.h>
#include <linux/serial.h>
#include <linux/tty.h>
#include <linux/serial_8250.h>
#include <linux/slab.h>
+#ifdef CONFIG_SENSORS_EEPROM
+# include <linux/i2c.h>
+# include <linux/eeprom.h>
+#endif
+
#include <linux/i2c-gpio.h>
#include <asm/types.h>
@@ -194,9 +202,48 @@ static void __init avila_fixup(struct ma
t->hdr.size = 0;
}
+#ifdef CONFIG_SENSORS_EEPROM
+static int loft_eeprom_do(struct notifier_block *self, unsigned long event, void *t)
+{
+ struct eeprom_data *data = t;
+ struct sockaddr address;
+ struct net_device * netdev ;
+
+ char macs[12];
+
+ /* The MACs are the first 12 bytes in the eeprom at address 0x51 */
+ if (event == EEPROM_REGISTER && data->client.addr == 0x51) {
+ data->attr->read(&data->client.dev.kobj, data->attr, macs, 0, 12);
+ /*eth0*/
+ /* using dev_get_by_name here is really ugly and can cause
+ * confusion if other ethernet devices are present. FIXME */
+
+ memcpy(address.sa_data, macs, ETH_ALEN);
+ memcpy(&avila_plat_eth[0].hwaddr, macs, ETH_ALEN);
+ if ( (netdev = dev_get_by_name("eth0")) )
+ netdev->set_mac_address(netdev, &address);
+
+ /*same for eth1*/
+ memcpy(address.sa_data, macs + ETH_ALEN, ETH_ALEN);
+ memcpy(&avila_plat_eth[1].hwaddr, macs + ETH_ALEN, ETH_ALEN);
+ if ( (netdev = dev_get_by_name("eth1")) )
+ netdev->set_mac_address(netdev, &address);
+ }
+
+ return NOTIFY_DONE;
+}
+
+static struct notifier_block loft_eeprom_notifier = {
+ .notifier_call = loft_eeprom_do
+};
+#endif
+
static void __init avila_init(void)
{
ixp4xx_sys_init();
+#ifdef CONFIG_SENSORS_EEPROM
+ register_eeprom_notifier(&loft_eeprom_notifier);
+#endif
avila_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
avila_flash_resource.end =

View File

@ -1,50 +0,0 @@
Index: linux-2.6.23.17/arch/arm/mach-ixp4xx/avila-setup.c
===================================================================
--- linux-2.6.23.17.orig/arch/arm/mach-ixp4xx/avila-setup.c
+++ linux-2.6.23.17/arch/arm/mach-ixp4xx/avila-setup.c
@@ -165,12 +165,34 @@ static struct platform_device avila_eth[
}
};
+#ifdef CONFIG_LEDS_IXP4XX
+static struct resource avila_led_resources[] = {
+ {
+ .name = "user",
+ .start = AVILA_LED_USER_GPIO,
+ .end = AVILA_LED_USER_GPIO,
+ .flags = IXP4XX_GPIO_LOW,
+ },
+};
+
+static struct platform_device avila_leds = {
+ .name = "IXP4XX-GPIO-LED",
+ .id = -1,
+ .num_resources = ARRAY_SIZE(avila_led_resources),
+ .resource = avila_led_resources,
+};
+#endif
+
+
static struct platform_device *avila_devices[] __initdata = {
&avila_i2c_gpio,
&avila_flash,
&avila_uart,
&avila_eth[0],
&avila_eth[1],
+#ifdef CONFIG_LEDS_IXP4XX
+ &avila_leds,
+#endif
};
static char avila_rtc_probe[] __initdata = "rtc-ds1672.probe=0,0x68 ";
Index: linux-2.6.23.17/include/asm-arm/arch-ixp4xx/avila.h
===================================================================
--- linux-2.6.23.17.orig/include/asm-arm/arch-ixp4xx/avila.h
+++ linux-2.6.23.17/include/asm-arm/arch-ixp4xx/avila.h
@@ -36,4 +36,5 @@
#define AVILA_PCI_INTC_PIN 9
#define AVILA_PCI_INTD_PIN 8
-
+/* User LED */
+#define AVILA_LED_USER_GPIO 3

View File

@ -1,49 +0,0 @@
Index: linux-2.6.23.17/arch/arm/mach-ixp4xx/avila-setup.c
===================================================================
--- linux-2.6.23.17.orig/arch/arm/mach-ixp4xx/avila-setup.c
+++ linux-2.6.23.17/arch/arm/mach-ixp4xx/avila-setup.c
@@ -183,6 +183,23 @@ static struct platform_device avila_leds
};
#endif
+#ifdef CONFIG_GPIO_DEVICE
+static struct resource avila_gpio_resources[] = {
+ {
+ .name = "gpio",
+ .start = AVILA_GPIO_MASK,
+ .end = AVILA_GPIO_MASK,
+ .flags = 0,
+ },
+};
+
+static struct platform_device avila_gpio = {
+ .name = "GPIODEV",
+ .id = -1,
+ .num_resources = ARRAY_SIZE(avila_gpio_resources),
+ .resource = avila_gpio_resources,
+};
+#endif
static struct platform_device *avila_devices[] __initdata = {
&avila_i2c_gpio,
@@ -193,6 +210,9 @@ static struct platform_device *avila_dev
#ifdef CONFIG_LEDS_IXP4XX
&avila_leds,
#endif
+#ifdef CONFIG_GPIO_DEVICE
+ &avila_gpio,
+#endif
};
static char avila_rtc_probe[] __initdata = "rtc-ds1672.probe=0,0x68 ";
Index: linux-2.6.23.17/include/asm-arm/arch-ixp4xx/avila.h
===================================================================
--- linux-2.6.23.17.orig/include/asm-arm/arch-ixp4xx/avila.h
+++ linux-2.6.23.17/include/asm-arm/arch-ixp4xx/avila.h
@@ -38,3 +38,6 @@
/* User LED */
#define AVILA_LED_USER_GPIO 3
+
+/* gpio mask used by platform device */
+#define AVILA_GPIO_MASK (1 << 1) | (1 << 3) | (1 << 5) | (1 << 7) | (1 << 9)

View File

@ -1,31 +0,0 @@
Index: linux-2.6.23.17/arch/arm/common/dmabounce.c
===================================================================
--- linux-2.6.23.17.orig/arch/arm/common/dmabounce.c
+++ linux-2.6.23.17/arch/arm/common/dmabounce.c
@@ -116,6 +116,10 @@ alloc_safe_buffer(struct dmabounce_devic
} else if (size <= device_info->large.size) {
pool = &device_info->large;
} else {
+#ifdef CONFIG_DMABOUNCE_DEBUG
+ printk(KERN_INFO "A dma bounce buffer outside the pool size was requested. Requested size was 0x%08X\nThe calling code was :\n", size);
+ dump_stack();
+#endif
pool = NULL;
}
Index: linux-2.6.23.17/arch/arm/mach-ixp4xx/Kconfig
===================================================================
--- linux-2.6.23.17.orig/arch/arm/mach-ixp4xx/Kconfig
+++ linux-2.6.23.17/arch/arm/mach-ixp4xx/Kconfig
@@ -220,6 +220,11 @@ config DMABOUNCE
default y
depends on PCI
+config DMABOUNCE_DEBUG
+ bool "Enable DMABounce debuging"
+ default n
+ depends on DMABOUNCE
+
config IXP4XX_INDIRECT_PCI
bool "Use indirect PCI memory access"
depends on PCI

View File

@ -1,13 +0,0 @@
Index: linux-2.6.23.17/include/asm-arm/arch-ixp4xx/avila.h
===================================================================
--- linux-2.6.23.17.orig/include/asm-arm/arch-ixp4xx/avila.h
+++ linux-2.6.23.17/include/asm-arm/arch-ixp4xx/avila.h
@@ -25,7 +25,7 @@
/*
* AVILA PCI IRQs
*/
-#define AVILA_PCI_MAX_DEV 4
+#define AVILA_PCI_MAX_DEV 6
#define LOFT_PCI_MAX_DEV 6
#define AVILA_PCI_IRQ_LINES 4

File diff suppressed because it is too large Load Diff

View File

@ -1,232 +0,0 @@
Migrate all ixp4xx devices to the bitbanging I2C bus driver utilizing
the arch-neutral GPIO API (linux/i2c-gpio.h).
Tested by the nslu2-linux and openwrt projects in public firmware releases.
Acked-by: Rod Whitby <rod@whitby.id.au>
Signed-off-by: Michael-Luke Jones <mlj28@cam.ac.uk>
Index: linux-2.6.24.7/arch/arm/mach-ixp4xx/nslu2-setup.c
===================================================================
--- linux-2.6.24.7.orig/arch/arm/mach-ixp4xx/nslu2-setup.c
+++ linux-2.6.24.7/arch/arm/mach-ixp4xx/nslu2-setup.c
@@ -18,6 +18,7 @@
#include <linux/serial.h>
#include <linux/serial_8250.h>
#include <linux/leds.h>
+#include <linux/i2c-gpio.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
@@ -41,7 +42,7 @@ static struct platform_device nslu2_flas
.resource = &nslu2_flash_resource,
};
-static struct ixp4xx_i2c_pins nslu2_i2c_gpio_pins = {
+static struct i2c_gpio_platform_data nslu2_i2c_gpio_data = {
.sda_pin = NSLU2_SDA_PIN,
.scl_pin = NSLU2_SCL_PIN,
};
@@ -82,11 +83,12 @@ static struct platform_device nslu2_leds
};
#endif
-static struct platform_device nslu2_i2c_controller = {
- .name = "IXP4XX-I2C",
+static struct platform_device nslu2_i2c_gpio = {
+ .name = "i2c-gpio",
.id = 0,
- .dev.platform_data = &nslu2_i2c_gpio_pins,
- .num_resources = 0,
+ .dev = {
+ .platform_data = &nslu2_i2c_gpio_data,
+ },
};
static struct platform_device nslu2_beeper = {
@@ -139,7 +141,7 @@ static struct platform_device nslu2_uart
};
static struct platform_device *nslu2_devices[] __initdata = {
- &nslu2_i2c_controller,
+ &nslu2_i2c_gpio,
&nslu2_flash,
&nslu2_beeper,
#ifdef CONFIG_LEDS_IXP4XX
Index: linux-2.6.24.7/arch/arm/mach-ixp4xx/nas100d-setup.c
===================================================================
--- linux-2.6.24.7.orig/arch/arm/mach-ixp4xx/nas100d-setup.c
+++ linux-2.6.24.7/arch/arm/mach-ixp4xx/nas100d-setup.c
@@ -16,6 +16,7 @@
#include <linux/serial.h>
#include <linux/serial_8250.h>
#include <linux/leds.h>
+#include <linux/i2c-gpio.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
@@ -68,16 +69,17 @@ static struct platform_device nas100d_le
};
#endif
-static struct ixp4xx_i2c_pins nas100d_i2c_gpio_pins = {
+static struct i2c_gpio_platform_data nas100d_i2c_gpio_data = {
.sda_pin = NAS100D_SDA_PIN,
.scl_pin = NAS100D_SCL_PIN,
};
-static struct platform_device nas100d_i2c_controller = {
- .name = "IXP4XX-I2C",
+static struct platform_device nas100d_i2c_gpio = {
+ .name = "i2c-gpio",
.id = 0,
- .dev.platform_data = &nas100d_i2c_gpio_pins,
- .num_resources = 0,
+ .dev = {
+ .platform_data = &nas100d_i2c_gpio_data,
+ },
};
static struct resource nas100d_uart_resources[] = {
@@ -124,7 +126,7 @@ static struct platform_device nas100d_ua
};
static struct platform_device *nas100d_devices[] __initdata = {
- &nas100d_i2c_controller,
+ &nas100d_i2c_gpio,
&nas100d_flash,
#ifdef CONFIG_LEDS_IXP4XX
&nas100d_leds,
Index: linux-2.6.24.7/arch/arm/mach-ixp4xx/avila-setup.c
===================================================================
--- linux-2.6.24.7.orig/arch/arm/mach-ixp4xx/avila-setup.c
+++ linux-2.6.24.7/arch/arm/mach-ixp4xx/avila-setup.c
@@ -18,6 +18,7 @@
#include <linux/tty.h>
#include <linux/serial_8250.h>
#include <linux/slab.h>
+#include <linux/i2c-gpio.h>
#include <asm/types.h>
#include <asm/setup.h>
@@ -47,18 +48,17 @@ static struct platform_device avila_flas
.resource = &avila_flash_resource,
};
-static struct ixp4xx_i2c_pins avila_i2c_gpio_pins = {
+static struct i2c_gpio_platform_data avila_i2c_gpio_data = {
.sda_pin = AVILA_SDA_PIN,
.scl_pin = AVILA_SCL_PIN,
};
-static struct platform_device avila_i2c_controller = {
- .name = "IXP4XX-I2C",
+static struct platform_device avila_i2c_gpio = {
+ .name = "i2c-gpio",
.id = 0,
- .dev = {
- .platform_data = &avila_i2c_gpio_pins,
+ .dev = {
+ .platform_data = &avila_i2c_gpio_data,
},
- .num_resources = 0
};
static struct resource avila_uart_resources[] = {
@@ -133,7 +133,7 @@ static struct platform_device avila_pata
};
static struct platform_device *avila_devices[] __initdata = {
- &avila_i2c_controller,
+ &avila_i2c_gpio,
&avila_flash,
&avila_uart
};
Index: linux-2.6.24.7/arch/arm/mach-ixp4xx/dsmg600-setup.c
===================================================================
--- linux-2.6.24.7.orig/arch/arm/mach-ixp4xx/dsmg600-setup.c
+++ linux-2.6.24.7/arch/arm/mach-ixp4xx/dsmg600-setup.c
@@ -14,6 +14,7 @@
#include <linux/kernel.h>
#include <linux/serial.h>
#include <linux/serial_8250.h>
+#include <linux/i2c-gpio.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
@@ -37,15 +38,17 @@ static struct platform_device dsmg600_fl
.resource = &dsmg600_flash_resource,
};
-static struct ixp4xx_i2c_pins dsmg600_i2c_gpio_pins = {
+static struct i2c_gpio_platform_data dsmg600_i2c_gpio_data = {
.sda_pin = DSMG600_SDA_PIN,
.scl_pin = DSMG600_SCL_PIN,
};
-static struct platform_device dsmg600_i2c_controller = {
- .name = "IXP4XX-I2C",
+static struct platform_device dsmg600_i2c_gpio = {
+ .name = "i2c-gpio",
.id = 0,
- .dev.platform_data = &dsmg600_i2c_gpio_pins,
+ .dev = {
+ .platform_data = &dsmg600_i2c_gpio_data,
+ },
};
#ifdef CONFIG_LEDS_CLASS
@@ -116,7 +119,7 @@ static struct platform_device dsmg600_ua
};
static struct platform_device *dsmg600_devices[] __initdata = {
- &dsmg600_i2c_controller,
+ &dsmg600_i2c_gpio,
&dsmg600_flash,
};
Index: linux-2.6.24.7/arch/arm/mach-ixp4xx/ixdp425-setup.c
===================================================================
--- linux-2.6.24.7.orig/arch/arm/mach-ixp4xx/ixdp425-setup.c
+++ linux-2.6.24.7/arch/arm/mach-ixp4xx/ixdp425-setup.c
@@ -15,6 +15,7 @@
#include <linux/tty.h>
#include <linux/serial_8250.h>
#include <linux/slab.h>
+#include <linux/i2c-gpio.h>
#include <linux/io.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/nand.h>
@@ -120,18 +121,17 @@ static struct platform_device ixdp425_fl
};
#endif /* CONFIG_MTD_NAND_PLATFORM */
-static struct ixp4xx_i2c_pins ixdp425_i2c_gpio_pins = {
+static struct i2c_gpio_platform_data ixdp425_i2c_gpio_data = {
.sda_pin = IXDP425_SDA_PIN,
.scl_pin = IXDP425_SCL_PIN,
};
-static struct platform_device ixdp425_i2c_controller = {
- .name = "IXP4XX-I2C",
+static struct platform_device ixdp425_i2c_gpio = {
+ .name = "i2c-gpio",
.id = 0,
- .dev = {
- .platform_data = &ixdp425_i2c_gpio_pins,
+ .dev = {
+ .platform_data = &ixdp425_i2c_gpio_data,
},
- .num_resources = 0
};
static struct resource ixdp425_uart_resources[] = {
@@ -178,7 +178,7 @@ static struct platform_device ixdp425_ua
};
static struct platform_device *ixdp425_devices[] __initdata = {
- &ixdp425_i2c_controller,
+ &ixdp425_i2c_gpio,
&ixdp425_flash,
#if defined(CONFIG_MTD_NAND_PLATFORM) || \
defined(CONFIG_MTD_NAND_PLATFORM_MODULE)

View File

@ -1,122 +0,0 @@
From 67e494e3e03ef807255f084800d8658b89ff5fec Mon Sep 17 00:00:00 2001
From: Rod Whitby <rod@whitby.id.au>
Date: Tue, 29 Jan 2008 10:00:25 +1030
Subject: ixp4xx: Button updates for the dsmg600 board (Patch #4769)
* Remove the superfluous declaration of ctrl_alt_del().
* Convert GPIO and IRQ handling to use the <asm/gpio.h> api.
* Perform the reset on the release of the power button, so that
NAS devices which have been set to auto-power-on (by solder
bridging the power button) do not continuously power cycle.
* Remove all superflous constants from dsmg600.h
Signed-off-by: Rod Whitby <rod@whitby.id.au>
Acked-by: Lennert Buytenhek <buytenh@wantstofly.org>
PATCH FOLLOWS
KernelVersion: 2.6.24-git5
Index: linux-2.6.24.7/arch/arm/mach-ixp4xx/dsmg600-power.c
===================================================================
--- linux-2.6.24.7.orig/arch/arm/mach-ixp4xx/dsmg600-power.c
+++ linux-2.6.24.7/arch/arm/mach-ixp4xx/dsmg600-power.c
@@ -26,14 +26,13 @@
#include <linux/jiffies.h>
#include <linux/timer.h>
+#include <asm/gpio.h>
#include <asm/mach-types.h>
-extern void ctrl_alt_del(void);
-
/* This is used to make sure the power-button pusher is serious. The button
* must be held until the value of this counter reaches zero.
*/
-static volatile int power_button_countdown;
+static int power_button_countdown;
/* Must hold the button down for at least this many counts to be processed */
#define PBUTTON_HOLDDOWN_COUNT 4 /* 2 secs */
@@ -47,22 +46,27 @@ static void dsmg600_power_handler(unsign
* state of the power button.
*/
- if (*IXP4XX_GPIO_GPINR & DSMG600_PB_BM) {
+ if (gpio_get_value(DSMG600_PB_GPIO)) {
/* IO Pin is 1 (button pushed) */
+ if (power_button_countdown > 0)
+ power_button_countdown--;
+
+ } else {
+
+ /* Done on button release, to allow for auto-power-on mods. */
if (power_button_countdown == 0) {
- /* Signal init to do the ctrlaltdel action, this will bypass
- * init if it hasn't started and do a kernel_restart.
+ /* Signal init to do the ctrlaltdel action,
+ * this will bypass init if it hasn't started
+ * and do a kernel_restart.
*/
ctrl_alt_del();
/* Change the state of the power LED to "blink" */
gpio_line_set(DSMG600_LED_PWR_GPIO, IXP4XX_GPIO_LOW);
+ } else {
+ power_button_countdown = PBUTTON_HOLDDOWN_COUNT;
}
- power_button_countdown--;
-
- } else {
- power_button_countdown = PBUTTON_HOLDDOWN_COUNT;
}
mod_timer(&dsmg600_power_timer, jiffies + msecs_to_jiffies(500));
@@ -81,12 +85,12 @@ static int __init dsmg600_power_init(voi
if (!(machine_is_dsmg600()))
return 0;
- if (request_irq(DSMG600_RB_IRQ, &dsmg600_reset_handler,
+ if (request_irq(gpio_to_irq(DSMG600_RB_GPIO), &dsmg600_reset_handler,
IRQF_DISABLED | IRQF_TRIGGER_LOW, "DSM-G600 reset button",
NULL) < 0) {
printk(KERN_DEBUG "Reset Button IRQ %d not available\n",
- DSMG600_RB_IRQ);
+ gpio_to_irq(DSMG600_RB_GPIO));
return -EIO;
}
@@ -114,7 +118,7 @@ static void __exit dsmg600_power_exit(vo
del_timer_sync(&dsmg600_power_timer);
- free_irq(DSMG600_RB_IRQ, NULL);
+ free_irq(gpio_to_irq(DSMG600_RB_GPIO), NULL);
}
module_init(dsmg600_power_init);
Index: linux-2.6.24.7/include/asm-arm/arch-ixp4xx/dsmg600.h
===================================================================
--- linux-2.6.24.7.orig/include/asm-arm/arch-ixp4xx/dsmg600.h
+++ linux-2.6.24.7/include/asm-arm/arch-ixp4xx/dsmg600.h
@@ -40,18 +40,13 @@
/* Buttons */
#define DSMG600_PB_GPIO 15 /* power button */
-#define DSMG600_PB_BM (1L << DSMG600_PB_GPIO)
-
#define DSMG600_RB_GPIO 3 /* reset button */
-#define DSMG600_RB_IRQ IRQ_IXP4XX_GPIO3
+/* Power control */
#define DSMG600_PO_GPIO 2 /* power off */
/* LEDs */
#define DSMG600_LED_PWR_GPIO 0
-#define DSMG600_LED_PWR_BM (1L << DSMG600_LED_PWR_GPIO)
-
#define DSMG600_LED_WLAN_GPIO 14
-#define DSMG600_LED_WLAN_BM (1L << DSMG600_LED_WLAN_GPIO)

View File

@ -1,194 +0,0 @@
From 6261e59795d861f21f63878944900a3da713348c Mon Sep 17 00:00:00 2001
From: Rod Whitby <rod@whitby.id.au>
Date: Tue, 29 Jan 2008 09:53:46 +1030
Subject: ixp4xx: Button and LED updates for the nas100d board (Patch #4768)
* Convert GPIO and IRQ handling to use the <asm/gpio.h> api.
* Perform the reset only after the power button has been held down
for at least two seconds. Do the reset on the release of the power
button, so that NAS devices which have been set to auto-power-on (by
solder bridging the power button) do not continuously power cycle.
* Remove all superflous constants from nas100d.h
* Add LED constants to nas100d.h while we're there.
* Update the board LED setup code to use those constants.
Signed-off-by: Rod Whitby <rod@whitby.id.au>
Acked-by: Lennert Buytenhek <buytenh@wantstofly.org>
PATCH FOLLOWS
KernelVersion: 2.6.24-git5
Index: linux-2.6.24.7/arch/arm/mach-ixp4xx/nas100d-power.c
===================================================================
--- linux-2.6.24.7.orig/arch/arm/mach-ixp4xx/nas100d-power.c
+++ linux-2.6.24.7/arch/arm/mach-ixp4xx/nas100d-power.c
@@ -21,15 +21,59 @@
#include <linux/irq.h>
#include <linux/module.h>
#include <linux/reboot.h>
+#include <linux/jiffies.h>
+#include <linux/timer.h>
+#include <asm/gpio.h>
#include <asm/mach-types.h>
-static irqreturn_t nas100d_reset_handler(int irq, void *dev_id)
+/* This is used to make sure the power-button pusher is serious. The button
+ * must be held until the value of this counter reaches zero.
+ */
+static int power_button_countdown;
+
+/* Must hold the button down for at least this many counts to be processed */
+#define PBUTTON_HOLDDOWN_COUNT 4 /* 2 secs */
+
+static void nas100d_power_handler(unsigned long data);
+static DEFINE_TIMER(nas100d_power_timer, nas100d_power_handler, 0, 0);
+
+static void nas100d_power_handler(unsigned long data)
{
- /* Signal init to do the ctrlaltdel action, this will bypass init if
- * it hasn't started and do a kernel_restart.
+ /* This routine is called twice per second to check the
+ * state of the power button.
*/
- ctrl_alt_del();
+
+ if (gpio_get_value(NAS100D_PB_GPIO)) {
+
+ /* IO Pin is 1 (button pushed) */
+ if (power_button_countdown > 0)
+ power_button_countdown--;
+
+ } else {
+
+ /* Done on button release, to allow for auto-power-on mods. */
+ if (power_button_countdown == 0) {
+ /* Signal init to do the ctrlaltdel action,
+ * this will bypass init if it hasn't started
+ * and do a kernel_restart.
+ */
+ ctrl_alt_del();
+
+ /* Change the state of the power LED to "blink" */
+ gpio_line_set(NAS100D_LED_PWR_GPIO, IXP4XX_GPIO_LOW);
+ } else {
+ power_button_countdown = PBUTTON_HOLDDOWN_COUNT;
+ }
+ }
+
+ mod_timer(&nas100d_power_timer, jiffies + msecs_to_jiffies(500));
+}
+
+static irqreturn_t nas100d_reset_handler(int irq, void *dev_id)
+{
+ /* This is the paper-clip reset, it shuts the machine down directly. */
+ machine_power_off();
return IRQ_HANDLED;
}
@@ -39,17 +83,30 @@ static int __init nas100d_power_init(voi
if (!(machine_is_nas100d()))
return 0;
- set_irq_type(NAS100D_RB_IRQ, IRQT_LOW);
+ set_irq_type(gpio_to_irq(NAS100D_RB_GPIO), IRQT_LOW);
- if (request_irq(NAS100D_RB_IRQ, &nas100d_reset_handler,
+ if (request_irq(gpio_to_irq(NAS100D_RB_GPIO), &nas100d_reset_handler,
IRQF_DISABLED, "NAS100D reset button", NULL) < 0) {
printk(KERN_DEBUG "Reset Button IRQ %d not available\n",
- NAS100D_RB_IRQ);
+ gpio_to_irq(NAS100D_RB_GPIO));
return -EIO;
}
+ /* The power button on the Iomega NAS100d is on GPIO 14, but
+ * it cannot handle interrupts on that GPIO line. So we'll
+ * have to poll it with a kernel timer.
+ */
+
+ /* Make sure that the power button GPIO is set up as an input */
+ gpio_line_config(NAS100D_PB_GPIO, IXP4XX_GPIO_IN);
+
+ /* Set the initial value for the power button IRQ handler */
+ power_button_countdown = PBUTTON_HOLDDOWN_COUNT;
+
+ mod_timer(&nas100d_power_timer, jiffies + msecs_to_jiffies(500));
+
return 0;
}
@@ -58,7 +115,9 @@ static void __exit nas100d_power_exit(vo
if (!(machine_is_nas100d()))
return;
- free_irq(NAS100D_RB_IRQ, NULL);
+ del_timer_sync(&nas100d_power_timer);
+
+ free_irq(gpio_to_irq(NAS100D_RB_GPIO), NULL);
}
module_init(nas100d_power_init);
Index: linux-2.6.24.7/arch/arm/mach-ixp4xx/nas100d-setup.c
===================================================================
--- linux-2.6.24.7.orig/arch/arm/mach-ixp4xx/nas100d-setup.c
+++ linux-2.6.24.7/arch/arm/mach-ixp4xx/nas100d-setup.c
@@ -43,20 +43,20 @@ static struct platform_device nas100d_fl
static struct resource nas100d_led_resources[] = {
{
.name = "wlan", /* green led */
- .start = 0,
- .end = 0,
+ .start = NAS100D_LED_WLAN_GPIO,
+ .end = NAS100D_LED_WLAN_GPIO,
.flags = IXP4XX_GPIO_LOW,
},
{
- .name = "ready", /* blue power led (off is flashing!) */
- .start = 15,
- .end = 15,
+ .name = "power", /* blue power led (off=flashing) */
+ .start = NAS100D_LED_PWR_GPIO,
+ .end = NAS100D_LED_PWR_GPIO,
.flags = IXP4XX_GPIO_LOW,
},
{
.name = "disk", /* yellow led */
- .start = 3,
- .end = 3,
+ .start = NAS100D_LED_DISK_GPIO,
+ .end = NAS100D_LED_DISK_GPIO,
.flags = IXP4XX_GPIO_LOW,
},
};
Index: linux-2.6.24.7/include/asm-arm/arch-ixp4xx/nas100d.h
===================================================================
--- linux-2.6.24.7.orig/include/asm-arm/arch-ixp4xx/nas100d.h
+++ linux-2.6.24.7/include/asm-arm/arch-ixp4xx/nas100d.h
@@ -38,15 +38,15 @@
/* Buttons */
-#define NAS100D_PB_GPIO 14
-#define NAS100D_RB_GPIO 4
+#define NAS100D_PB_GPIO 14 /* power button */
+#define NAS100D_RB_GPIO 4 /* reset button */
+
+/* Power control */
+
#define NAS100D_PO_GPIO 12 /* power off */
-#define NAS100D_PB_IRQ IRQ_IXP4XX_GPIO14
-#define NAS100D_RB_IRQ IRQ_IXP4XX_GPIO4
+/* LEDs */
-/*
-#define NAS100D_PB_BM (1L << NAS100D_PB_GPIO)
-#define NAS100D_PO_BM (1L << NAS100D_PO_GPIO)
-#define NAS100D_RB_BM (1L << NAS100D_RB_GPIO)
-*/
+#define NAS100D_LED_WLAN_GPIO 0
+#define NAS100D_LED_DISK_GPIO 3
+#define NAS100D_LED_PWR_GPIO 15

View File

@ -1,119 +0,0 @@
From 88721db37ead2212a54c1392e2e65bae78d2604b Mon Sep 17 00:00:00 2001
From: Rod Whitby <rod@whitby.id.au>
Date: Tue, 29 Jan 2008 10:05:48 +1030
Subject: ixp4xx: Register nslu2 rtc i2c_board_info (Patch #4772)
Register the i2c board info related to the RTC chip on the nslu2 board
to allow it to be found automatically on boot.
Signed-off-by: Rod Whitby <rod@whitby.id.au>
Signed-off-by: Alessandro Zummo <a.zummo@towertech.it>
PATCH FOLLOWS
KernelVersion: 2.6.24-git5
Index: linux-2.6.24.7/arch/arm/mach-ixp4xx/nslu2-setup.c
===================================================================
--- linux-2.6.24.7.orig/arch/arm/mach-ixp4xx/nslu2-setup.c
+++ linux-2.6.24.7/arch/arm/mach-ixp4xx/nslu2-setup.c
@@ -18,6 +18,7 @@
#include <linux/serial.h>
#include <linux/serial_8250.h>
#include <linux/leds.h>
+#include <linux/i2c.h>
#include <linux/i2c-gpio.h>
#include <asm/mach-types.h>
@@ -47,6 +48,12 @@ static struct i2c_gpio_platform_data nsl
.scl_pin = NSLU2_SCL_PIN,
};
+static struct i2c_board_info __initdata nslu2_i2c_board_info [] = {
+ {
+ I2C_BOARD_INFO("rtc-x1205", 0x6f),
+ },
+};
+
#ifdef CONFIG_LEDS_IXP4XX
static struct resource nslu2_led_resources[] = {
{
@@ -183,6 +190,9 @@ static void __init nslu2_init(void)
pm_power_off = nslu2_power_off;
+ i2c_register_board_info(0, nslu2_i2c_board_info,
+ ARRAY_SIZE(nslu2_i2c_board_info));
+
/*
* This is only useful on a modified machine, but it is valuable
* to have it first in order to see debug messages, and so that
Index: linux-2.6.24.7/arch/arm/mach-ixp4xx/nas100d-setup.c
===================================================================
--- linux-2.6.24.7.orig/arch/arm/mach-ixp4xx/nas100d-setup.c
+++ linux-2.6.24.7/arch/arm/mach-ixp4xx/nas100d-setup.c
@@ -16,6 +16,7 @@
#include <linux/serial.h>
#include <linux/serial_8250.h>
#include <linux/leds.h>
+#include <linux/i2c.h>
#include <linux/i2c-gpio.h>
#include <asm/mach-types.h>
@@ -39,6 +40,12 @@ static struct platform_device nas100d_fl
.resource = &nas100d_flash_resource,
};
+static struct i2c_board_info __initdata nas100d_i2c_board_info [] = {
+ {
+ I2C_BOARD_INFO("rtc-pcf8563", 0x51),
+ },
+};
+
#ifdef CONFIG_LEDS_IXP4XX
static struct resource nas100d_led_resources[] = {
{
@@ -157,6 +164,9 @@ static void __init nas100d_init(void)
pm_power_off = nas100d_power_off;
+ i2c_register_board_info(0, nas100d_i2c_board_info,
+ ARRAY_SIZE(nas100d_i2c_board_info));
+
/*
* This is only useful on a modified machine, but it is valuable
* to have it first in order to see debug messages, and so that
Index: linux-2.6.24.7/arch/arm/mach-ixp4xx/dsmg600-setup.c
===================================================================
--- linux-2.6.24.7.orig/arch/arm/mach-ixp4xx/dsmg600-setup.c
+++ linux-2.6.24.7/arch/arm/mach-ixp4xx/dsmg600-setup.c
@@ -14,6 +14,7 @@
#include <linux/kernel.h>
#include <linux/serial.h>
#include <linux/serial_8250.h>
+#include <linux/i2c.h>
#include <linux/i2c-gpio.h>
#include <asm/mach-types.h>
@@ -51,6 +52,12 @@ static struct platform_device dsmg600_i2
},
};
+static struct i2c_board_info __initdata dsmg600_i2c_board_info [] = {
+ {
+ I2C_BOARD_INFO("rtc-pcf8563", 0x51),
+ },
+};
+
#ifdef CONFIG_LEDS_CLASS
static struct resource dsmg600_led_resources[] = {
{
@@ -158,6 +165,9 @@ static void __init dsmg600_init(void)
pm_power_off = dsmg600_power_off;
+ i2c_register_board_info(0, dsmg600_i2c_board_info,
+ ARRAY_SIZE(dsmg600_i2c_board_info));
+
/* The UART is required on the DSM-G600 (Redboot cannot use the
* NIC) -- do it here so that it does *not* get removed if
* platform_add_devices fails!

View File

@ -1,239 +0,0 @@
From 383256474f2ba043bdb57a657f9d786df88780f1 Mon Sep 17 00:00:00 2001
From: Rod Whitby <rod@whitby.id.au>
Date: Tue, 29 Jan 2008 17:17:29 +1030
Subject: ixp4xx: Use leds-gpio driver instead of IXP4XX-GPIO-LED driver
These are the only three boards to use the IXP4XX-GPIO-LED driver, and
they can all use the new leds-gpio driver instead with no change in
functionality.
Signed-off-by: Rod Whitby <rod@whitby.id.au>
--
PATCH FOLLOWS
KernelVersion: v2.6.24-1915-gc9b12e6
Index: linux-2.6.24.7/arch/arm/configs/ixp4xx_defconfig
===================================================================
--- linux-2.6.24.7.orig/arch/arm/configs/ixp4xx_defconfig
+++ linux-2.6.24.7/arch/arm/configs/ixp4xx_defconfig
@@ -1330,8 +1330,8 @@ CONFIG_LEDS_CLASS=y
#
# LED drivers
#
-CONFIG_LEDS_IXP4XX=y
-# CONFIG_LEDS_GPIO is not set
+# CONFIG_LEDS_IXP4XX is not set
+CONFIG_LEDS_GPIO=y
#
# LED Triggers
Index: linux-2.6.24.7/arch/arm/mach-ixp4xx/dsmg600-setup.c
===================================================================
--- linux-2.6.24.7.orig/arch/arm/mach-ixp4xx/dsmg600-setup.c
+++ linux-2.6.24.7/arch/arm/mach-ixp4xx/dsmg600-setup.c
@@ -14,6 +14,7 @@
#include <linux/kernel.h>
#include <linux/serial.h>
#include <linux/serial_8250.h>
+#include <linux/leds.h>
#include <linux/i2c.h>
#include <linux/i2c-gpio.h>
@@ -58,29 +59,28 @@ static struct i2c_board_info __initdata
},
};
-#ifdef CONFIG_LEDS_CLASS
-static struct resource dsmg600_led_resources[] = {
+static struct gpio_led dsmg600_led_pins[] = {
{
- .name = "power",
- .start = DSMG600_LED_PWR_GPIO,
- .end = DSMG600_LED_PWR_GPIO,
- .flags = IXP4XX_GPIO_HIGH,
+ .name = "power",
+ .gpio = DSMG600_LED_PWR_GPIO,
},
{
- .name = "wlan",
- .start = DSMG600_LED_WLAN_GPIO,
- .end = DSMG600_LED_WLAN_GPIO,
- .flags = IXP4XX_GPIO_LOW,
+ .name = "wlan",
+ .gpio = DSMG600_LED_WLAN_GPIO,
+ .active_low = true,
},
};
+static struct gpio_led_platform_data dsmg600_led_data = {
+ .num_leds = ARRAY_SIZE(dsmg600_led_pins),
+ .leds = dsmg600_led_pins,
+};
+
static struct platform_device dsmg600_leds = {
- .name = "IXP4XX-GPIO-LED",
- .id = -1,
- .num_resources = ARRAY_SIZE(dsmg600_led_resources),
- .resource = dsmg600_led_resources,
+ .name = "leds-gpio",
+ .id = -1,
+ .dev.platform_data = &dsmg600_led_data,
};
-#endif
static struct resource dsmg600_uart_resources[] = {
{
@@ -128,6 +128,7 @@ static struct platform_device dsmg600_ua
static struct platform_device *dsmg600_devices[] __initdata = {
&dsmg600_i2c_gpio,
&dsmg600_flash,
+ &dsmg600_leds,
};
static void dsmg600_power_off(void)
@@ -175,11 +176,6 @@ static void __init dsmg600_init(void)
(void)platform_device_register(&dsmg600_uart);
platform_add_devices(dsmg600_devices, ARRAY_SIZE(dsmg600_devices));
-
-#ifdef CONFIG_LEDS_CLASS
- /* We don't care whether or not this works. */
- (void)platform_device_register(&dsmg600_leds);
-#endif
}
MACHINE_START(DSMG600, "D-Link DSM-G600 RevA")
Index: linux-2.6.24.7/arch/arm/mach-ixp4xx/nas100d-setup.c
===================================================================
--- linux-2.6.24.7.orig/arch/arm/mach-ixp4xx/nas100d-setup.c
+++ linux-2.6.24.7/arch/arm/mach-ixp4xx/nas100d-setup.c
@@ -46,35 +46,34 @@ static struct i2c_board_info __initdata
},
};
-#ifdef CONFIG_LEDS_IXP4XX
-static struct resource nas100d_led_resources[] = {
+static struct gpio_led nas100d_led_pins[] = {
{
.name = "wlan", /* green led */
- .start = NAS100D_LED_WLAN_GPIO,
- .end = NAS100D_LED_WLAN_GPIO,
- .flags = IXP4XX_GPIO_LOW,
+ .gpio = NAS100D_LED_WLAN_GPIO,
+ .active_low = true,
},
{
.name = "power", /* blue power led (off=flashing) */
- .start = NAS100D_LED_PWR_GPIO,
- .end = NAS100D_LED_PWR_GPIO,
- .flags = IXP4XX_GPIO_LOW,
+ .gpio = NAS100D_LED_PWR_GPIO,
+ .active_low = true,
},
{
.name = "disk", /* yellow led */
- .start = NAS100D_LED_DISK_GPIO,
- .end = NAS100D_LED_DISK_GPIO,
- .flags = IXP4XX_GPIO_LOW,
+ .gpio = NAS100D_LED_DISK_GPIO,
+ .active_low = true,
},
};
+static struct gpio_led_platform_data nas100d_led_data = {
+ .num_leds = ARRAY_SIZE(nas100d_led_pins),
+ .leds = nas100d_led_pins,
+};
+
static struct platform_device nas100d_leds = {
- .name = "IXP4XX-GPIO-LED",
+ .name = "leds-gpio",
.id = -1,
- .num_resources = ARRAY_SIZE(nas100d_led_resources),
- .resource = nas100d_led_resources,
+ .dev.platform_data = &nas100d_led_data,
};
-#endif
static struct i2c_gpio_platform_data nas100d_i2c_gpio_data = {
.sda_pin = NAS100D_SDA_PIN,
@@ -135,9 +134,7 @@ static struct platform_device nas100d_ua
static struct platform_device *nas100d_devices[] __initdata = {
&nas100d_i2c_gpio,
&nas100d_flash,
-#ifdef CONFIG_LEDS_IXP4XX
&nas100d_leds,
-#endif
};
static void nas100d_power_off(void)
Index: linux-2.6.24.7/arch/arm/mach-ixp4xx/nslu2-setup.c
===================================================================
--- linux-2.6.24.7.orig/arch/arm/mach-ixp4xx/nslu2-setup.c
+++ linux-2.6.24.7/arch/arm/mach-ixp4xx/nslu2-setup.c
@@ -54,41 +54,37 @@ static struct i2c_board_info __initdata
},
};
-#ifdef CONFIG_LEDS_IXP4XX
-static struct resource nslu2_led_resources[] = {
+static struct gpio_led nslu2_led_pins[] = {
{
.name = "ready", /* green led */
- .start = NSLU2_LED_GRN_GPIO,
- .end = NSLU2_LED_GRN_GPIO,
- .flags = IXP4XX_GPIO_HIGH,
+ .gpio = NSLU2_LED_GRN_GPIO,
},
{
.name = "status", /* red led */
- .start = NSLU2_LED_RED_GPIO,
- .end = NSLU2_LED_RED_GPIO,
- .flags = IXP4XX_GPIO_HIGH,
+ .gpio = NSLU2_LED_RED_GPIO,
},
{
.name = "disk-1",
- .start = NSLU2_LED_DISK1_GPIO,
- .end = NSLU2_LED_DISK1_GPIO,
- .flags = IXP4XX_GPIO_LOW,
+ .gpio = NSLU2_LED_DISK1_GPIO,
+ .active_low = true,
},
{
.name = "disk-2",
- .start = NSLU2_LED_DISK2_GPIO,
- .end = NSLU2_LED_DISK2_GPIO,
- .flags = IXP4XX_GPIO_LOW,
+ .gpio = NSLU2_LED_DISK2_GPIO,
+ .active_low = true,
},
};
+static struct gpio_led_platform_data nslu2_led_data = {
+ .num_leds = ARRAY_SIZE(nslu2_led_pins),
+ .leds = nslu2_led_pins,
+};
+
static struct platform_device nslu2_leds = {
- .name = "IXP4XX-GPIO-LED",
+ .name = "leds-gpio",
.id = -1,
- .num_resources = ARRAY_SIZE(nslu2_led_resources),
- .resource = nslu2_led_resources,
+ .dev.platform_data = &nslu2_led_data,
};
-#endif
static struct platform_device nslu2_i2c_gpio = {
.name = "i2c-gpio",
@@ -151,9 +147,7 @@ static struct platform_device *nslu2_dev
&nslu2_i2c_gpio,
&nslu2_flash,
&nslu2_beeper,
-#ifdef CONFIG_LEDS_IXP4XX
&nslu2_leds,
-#endif
};
static void nslu2_power_off(void)

View File

@ -1,772 +0,0 @@
Index: linux-2.6.24.7/arch/arm/mach-ixp4xx/Kconfig
===================================================================
--- linux-2.6.24.7.orig/arch/arm/mach-ixp4xx/Kconfig
+++ linux-2.6.24.7/arch/arm/mach-ixp4xx/Kconfig
@@ -125,6 +125,15 @@ config ARCH_IXDP4XX
depends on ARCH_IXDP425 || MACH_IXDP465 || MACH_KIXRP435
default y
+config MACH_FSG
+ bool
+ prompt "Freecom FSG-3"
+ select PCI
+ help
+ Say 'Y' here if you want your kernel to support Freecom's
+ FSG-3 device. For more information on this platform,
+ see http://www.nslu2-linux.org/wiki/FSG3/HomePage
+
#
# Certain registers and IRQs are only enabled if supporting IXP465 CPUs
#
Index: linux-2.6.24.7/arch/arm/mach-ixp4xx/Makefile
===================================================================
--- linux-2.6.24.7.orig/arch/arm/mach-ixp4xx/Makefile
+++ linux-2.6.24.7/arch/arm/mach-ixp4xx/Makefile
@@ -15,6 +15,7 @@ obj-pci-$(CONFIG_MACH_NAS100D) += nas10
obj-pci-$(CONFIG_MACH_DSMG600) += dsmg600-pci.o
obj-pci-$(CONFIG_MACH_GATEWAY7001) += gateway7001-pci.o
obj-pci-$(CONFIG_MACH_WG302V2) += wg302v2-pci.o
+obj-pci-$(CONFIG_MACH_FSG) += fsg-pci.o
obj-y += common.o
@@ -28,5 +29,6 @@ obj-$(CONFIG_MACH_NAS100D) += nas100d-se
obj-$(CONFIG_MACH_DSMG600) += dsmg600-setup.o dsmg600-power.o
obj-$(CONFIG_MACH_GATEWAY7001) += gateway7001-setup.o
obj-$(CONFIG_MACH_WG302V2) += wg302v2-setup.o
+obj-$(CONFIG_MACH_FSG) += fsg-setup.o
obj-$(CONFIG_PCI) += $(obj-pci-$(CONFIG_PCI)) common-pci.o
Index: linux-2.6.24.7/arch/arm/mach-ixp4xx/fsg-pci.c
===================================================================
--- /dev/null
+++ linux-2.6.24.7/arch/arm/mach-ixp4xx/fsg-pci.c
@@ -0,0 +1,71 @@
+/*
+ * arch/arch/mach-ixp4xx/fsg-pci.c
+ *
+ * FSG board-level PCI initialization
+ *
+ * Author: Rod Whitby <rod@whitby.id.au>
+ * Maintainer: http://www.nslu2-linux.org/
+ *
+ * based on ixdp425-pci.c:
+ * Copyright (C) 2002 Intel Corporation.
+ * Copyright (C) 2003-2004 MontaVista Software, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ */
+
+#include <linux/pci.h>
+#include <linux/init.h>
+#include <linux/irq.h>
+
+#include <asm/mach/pci.h>
+#include <asm/mach-types.h>
+
+void __init fsg_pci_preinit(void)
+{
+ set_irq_type(IRQ_FSG_PCI_INTA, IRQT_LOW);
+ set_irq_type(IRQ_FSG_PCI_INTB, IRQT_LOW);
+ set_irq_type(IRQ_FSG_PCI_INTC, IRQT_LOW);
+
+ ixp4xx_pci_preinit();
+}
+
+static int __init fsg_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
+{
+ static int pci_irq_table[FSG_PCI_IRQ_LINES] = {
+ IRQ_FSG_PCI_INTC,
+ IRQ_FSG_PCI_INTB,
+ IRQ_FSG_PCI_INTA,
+ };
+
+ int irq = -1;
+ slot = slot - 11;
+
+ if (slot >= 1 && slot <= FSG_PCI_MAX_DEV &&
+ pin >= 1 && pin <= FSG_PCI_IRQ_LINES)
+ irq = pci_irq_table[(slot - 1)];
+ printk(KERN_INFO "%s: Mapped slot %d pin %d to IRQ %d\n",
+ __func__, slot, pin, irq);
+
+ return irq;
+}
+
+struct hw_pci fsg_pci __initdata = {
+ .nr_controllers = 1,
+ .preinit = fsg_pci_preinit,
+ .swizzle = pci_std_swizzle,
+ .setup = ixp4xx_setup,
+ .scan = ixp4xx_scan_bus,
+ .map_irq = fsg_map_irq,
+};
+
+int __init fsg_pci_init(void)
+{
+ if (machine_is_fsg())
+ pci_common_init(&fsg_pci);
+ return 0;
+}
+
+subsys_initcall(fsg_pci_init);
Index: linux-2.6.24.7/arch/arm/mach-ixp4xx/fsg-setup.c
===================================================================
--- /dev/null
+++ linux-2.6.24.7/arch/arm/mach-ixp4xx/fsg-setup.c
@@ -0,0 +1,275 @@
+/*
+ * arch/arm/mach-ixp4xx/fsg-setup.c
+ *
+ * FSG board-setup
+ *
+ * Copyright (C) 2008 Rod Whitby <rod@whitby.id.au>
+ *
+ * based on ixdp425-setup.c:
+ * Copyright (C) 2003-2004 MontaVista Software, Inc.
+ * based on nslu2-power.c
+ * Copyright (C) 2005 Tower Technologies
+ *
+ * Author: Rod Whitby <rod@whitby.id.au>
+ * Maintainers: http://www.nslu2-linux.org/
+ *
+ */
+
+#include <linux/if_ether.h>
+#include <linux/irq.h>
+#include <linux/serial.h>
+#include <linux/serial_8250.h>
+#include <linux/leds.h>
+#include <linux/reboot.h>
+#include <linux/i2c.h>
+#include <linux/i2c-gpio.h>
+
+#include <asm/mach-types.h>
+#include <asm/mach/arch.h>
+#include <asm/mach/flash.h>
+#include <asm/io.h>
+#include <asm/gpio.h>
+
+static struct flash_platform_data fsg_flash_data = {
+ .map_name = "cfi_probe",
+ .width = 2,
+};
+
+static struct resource fsg_flash_resource = {
+ .flags = IORESOURCE_MEM,
+};
+
+static struct platform_device fsg_flash = {
+ .name = "IXP4XX-Flash",
+ .id = 0,
+ .dev.platform_data = &fsg_flash_data,
+ .num_resources = 1,
+ .resource = &fsg_flash_resource,
+};
+
+static struct i2c_gpio_platform_data fsg_i2c_gpio_data = {
+ .sda_pin = FSG_SDA_PIN,
+ .scl_pin = FSG_SCL_PIN,
+};
+
+static struct platform_device fsg_i2c_gpio = {
+ .name = "i2c-gpio",
+ .id = 0,
+ .dev = {
+ .platform_data = &fsg_i2c_gpio_data,
+ },
+};
+
+static struct i2c_board_info __initdata fsg_i2c_board_info [] = {
+ {
+ I2C_BOARD_INFO("rtc-isl1208", 0x6f),
+ },
+};
+
+static struct resource fsg_uart_resources[] = {
+ {
+ .start = IXP4XX_UART1_BASE_PHYS,
+ .end = IXP4XX_UART1_BASE_PHYS + 0x0fff,
+ .flags = IORESOURCE_MEM,
+ },
+ {
+ .start = IXP4XX_UART2_BASE_PHYS,
+ .end = IXP4XX_UART2_BASE_PHYS + 0x0fff,
+ .flags = IORESOURCE_MEM,
+ }
+};
+
+static struct plat_serial8250_port fsg_uart_data[] = {
+ {
+ .mapbase = IXP4XX_UART1_BASE_PHYS,
+ .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET,
+ .irq = IRQ_IXP4XX_UART1,
+ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
+ .iotype = UPIO_MEM,
+ .regshift = 2,
+ .uartclk = IXP4XX_UART_XTAL,
+ },
+ {
+ .mapbase = IXP4XX_UART2_BASE_PHYS,
+ .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET,
+ .irq = IRQ_IXP4XX_UART2,
+ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
+ .iotype = UPIO_MEM,
+ .regshift = 2,
+ .uartclk = IXP4XX_UART_XTAL,
+ },
+ { }
+};
+
+static struct platform_device fsg_uart = {
+ .name = "serial8250",
+ .id = PLAT8250_DEV_PLATFORM,
+ .dev.platform_data = fsg_uart_data,
+ .num_resources = ARRAY_SIZE(fsg_uart_resources),
+ .resource = fsg_uart_resources,
+};
+
+static struct platform_device fsg_leds = {
+ .name = "fsg-led",
+ .id = -1,
+};
+
+/* Built-in 10/100 Ethernet MAC interfaces */
+static struct eth_plat_info fsg_plat_eth[] = {
+ {
+ .phy = 5,
+ .rxq = 3,
+ .txreadyq = 20,
+ }, {
+ .phy = 4,
+ .rxq = 4,
+ .txreadyq = 21,
+ }
+};
+
+static struct platform_device fsg_eth[] = {
+ {
+ .name = "ixp4xx_eth",
+ .id = IXP4XX_ETH_NPEB,
+ .dev.platform_data = fsg_plat_eth,
+ }, {
+ .name = "ixp4xx_eth",
+ .id = IXP4XX_ETH_NPEC,
+ .dev.platform_data = fsg_plat_eth + 1,
+ }
+};
+
+static struct platform_device *fsg_devices[] __initdata = {
+ &fsg_i2c_gpio,
+ &fsg_flash,
+ &fsg_leds,
+ &fsg_eth[0],
+ &fsg_eth[1],
+};
+
+static void fsg_power_off(void)
+{
+ printk(KERN_INFO "Restarting system.\n");
+ machine_restart(NULL);
+}
+
+static irqreturn_t fsg_power_handler(int irq, void *dev_id)
+{
+ /* Signal init to do the ctrlaltdel action, this will bypass init if
+ * it hasn't started and do a kernel_restart.
+ */
+ ctrl_alt_del();
+
+ return IRQ_HANDLED;
+}
+
+static irqreturn_t fsg_reset_handler(int irq, void *dev_id)
+{
+ /* This is the paper-clip reset, it shuts the machine down directly.
+ */
+ machine_power_off();
+
+ return IRQ_HANDLED;
+}
+
+static void __init fsg_init(void)
+{
+ DECLARE_MAC_BUF(mac_buf);
+ uint8_t __iomem *f;
+ int i;
+
+ ixp4xx_sys_init();
+
+ fsg_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
+ fsg_flash_resource.end =
+ IXP4XX_EXP_BUS_BASE(0) + ixp4xx_exp_bus_size - 1;
+
+ *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE;
+ *IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0;
+
+ /* Configure CS2 for operation, 8bit and writable */
+ *IXP4XX_EXP_CS2 = 0xbfff0002;
+
+ i2c_register_board_info(0, fsg_i2c_board_info,
+ ARRAY_SIZE(fsg_i2c_board_info));
+
+ /* This is only useful on a modified machine, but it is valuable
+ * to have it first in order to see debug messages, and so that
+ * it does *not* get removed if platform_add_devices fails!
+ */
+ (void)platform_device_register(&fsg_uart);
+
+ platform_add_devices(fsg_devices, ARRAY_SIZE(fsg_devices));
+
+ pm_power_off = fsg_power_off;
+
+ set_irq_type(gpio_to_irq(FSG_RB_GPIO), IRQT_LOW);
+ if (request_irq(gpio_to_irq(FSG_RB_GPIO), &fsg_reset_handler,
+ IRQF_DISABLED, "FSG reset button", NULL) < 0) {
+
+ printk(KERN_DEBUG "Reset Button IRQ %d not available\n",
+ gpio_to_irq(FSG_RB_GPIO));
+ }
+
+ set_irq_type(gpio_to_irq(FSG_SB_GPIO), IRQT_LOW);
+ if (request_irq(gpio_to_irq(FSG_SB_GPIO), &fsg_power_handler,
+ IRQF_DISABLED, "FSG power button", NULL) < 0) {
+
+ printk(KERN_DEBUG "Power Button IRQ %d not available\n",
+ gpio_to_irq(FSG_SB_GPIO));
+ }
+
+ /*
+ * Map in a portion of the flash and read the MAC addresses.
+ * Since it is stored in BE in the flash itself, we need to
+ * byteswap it if we're in LE mode.
+ */
+ f = ioremap(IXP4XX_EXP_BUS_BASE(0), 0x400000);
+ if (f) {
+#ifdef __ARMEB__
+ for (i = 0; i < 6; i++) {
+ fsg_plat_eth[0].hwaddr[i] = readb(f + 0x3C0422 + i);
+ fsg_plat_eth[1].hwaddr[i] = readb(f + 0x3C043B + i);
+ }
+#else
+
+ /*
+ Endian-swapped reads from unaligned addresses are
+ required to extract the two MACs from the big-endian
+ Redboot config area in flash.
+ */
+
+ fsg_plat_eth[0].hwaddr[0] = readb(f + 0x3C0421);
+ fsg_plat_eth[0].hwaddr[1] = readb(f + 0x3C0420);
+ fsg_plat_eth[0].hwaddr[2] = readb(f + 0x3C0427);
+ fsg_plat_eth[0].hwaddr[3] = readb(f + 0x3C0426);
+ fsg_plat_eth[0].hwaddr[4] = readb(f + 0x3C0425);
+ fsg_plat_eth[0].hwaddr[5] = readb(f + 0x3C0424);
+
+ fsg_plat_eth[1].hwaddr[0] = readb(f + 0x3C0439);
+ fsg_plat_eth[1].hwaddr[1] = readb(f + 0x3C043F);
+ fsg_plat_eth[1].hwaddr[2] = readb(f + 0x3C043E);
+ fsg_plat_eth[1].hwaddr[3] = readb(f + 0x3C043D);
+ fsg_plat_eth[1].hwaddr[4] = readb(f + 0x3C043C);
+ fsg_plat_eth[1].hwaddr[5] = readb(f + 0x3C0443);
+#endif
+ iounmap(f);
+ }
+ printk(KERN_INFO "FSG: Using MAC address %s for port 0\n",
+ print_mac(mac_buf, fsg_plat_eth[0].hwaddr));
+ printk(KERN_INFO "FSG: Using MAC address %s for port 1\n",
+ print_mac(mac_buf, fsg_plat_eth[1].hwaddr));
+
+}
+
+MACHINE_START(FSG, "Freecom FSG-3")
+ /* Maintainer: www.nslu2-linux.org */
+ .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
+ .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
+ .map_io = ixp4xx_map_io,
+ .init_irq = ixp4xx_init_irq,
+ .timer = &ixp4xx_timer,
+ .boot_params = 0x0100,
+ .init_machine = fsg_init,
+MACHINE_END
+
Index: linux-2.6.24.7/include/asm-arm/arch-ixp4xx/fsg.h
===================================================================
--- /dev/null
+++ linux-2.6.24.7/include/asm-arm/arch-ixp4xx/fsg.h
@@ -0,0 +1,50 @@
+/*
+ * include/asm-arm/arch-ixp4xx/fsg.h
+ *
+ * Freecom FSG-3 platform specific definitions
+ *
+ * Author: Rod Whitby <rod@whitby.id.au>
+ * Author: Tomasz Chmielewski <mangoo@wpkg.org>
+ * Maintainers: http://www.nslu2-linux.org
+ *
+ * Based on coyote.h by
+ * Copyright 2004 (c) MontaVista, Software, Inc.
+ *
+ * This file is licensed under the terms of the GNU General Public
+ * License version 2. This program is licensed "as is" without any
+ * warranty of any kind, whether express or implied.
+ */
+
+#ifndef __ASM_ARCH_HARDWARE_H__
+#error "Do not include this directly, instead #include <asm/hardware.h>"
+#endif
+
+#define FSG_SDA_PIN 12
+#define FSG_SCL_PIN 13
+
+/*
+ * FSG PCI IRQs
+ */
+#define FSG_PCI_MAX_DEV 3
+#define FSG_PCI_IRQ_LINES 3
+
+
+/* PCI controller GPIO to IRQ pin mappings */
+#define FSG_PCI_INTA_PIN 6
+#define FSG_PCI_INTB_PIN 7
+#define FSG_PCI_INTC_PIN 5
+
+/* Buttons */
+
+#define FSG_SB_GPIO 4 /* sync button */
+#define FSG_RB_GPIO 9 /* reset button */
+#define FSG_UB_GPIO 10 /* usb button */
+
+/* LEDs */
+
+#define FSG_LED_WLAN_BIT 0
+#define FSG_LED_WAN_BIT 1
+#define FSG_LED_SATA_BIT 2
+#define FSG_LED_USB_BIT 4
+#define FSG_LED_RING_BIT 5
+#define FSG_LED_SYNC_BIT 7
Index: linux-2.6.24.7/include/asm-arm/arch-ixp4xx/hardware.h
===================================================================
--- linux-2.6.24.7.orig/include/asm-arm/arch-ixp4xx/hardware.h
+++ linux-2.6.24.7/include/asm-arm/arch-ixp4xx/hardware.h
@@ -45,5 +45,6 @@
#include "nslu2.h"
#include "nas100d.h"
#include "dsmg600.h"
+#include "fsg.h"
#endif /* _ASM_ARCH_HARDWARE_H */
Index: linux-2.6.24.7/include/asm-arm/arch-ixp4xx/irqs.h
===================================================================
--- linux-2.6.24.7.orig/include/asm-arm/arch-ixp4xx/irqs.h
+++ linux-2.6.24.7/include/asm-arm/arch-ixp4xx/irqs.h
@@ -128,4 +128,11 @@
#define IRQ_DSMG600_PCI_INTE IRQ_IXP4XX_GPIO7
#define IRQ_DSMG600_PCI_INTF IRQ_IXP4XX_GPIO6
+/*
+ * Freecom FSG-3 Board IRQs
+ */
+#define IRQ_FSG_PCI_INTA IRQ_IXP4XX_GPIO6
+#define IRQ_FSG_PCI_INTB IRQ_IXP4XX_GPIO7
+#define IRQ_FSG_PCI_INTC IRQ_IXP4XX_GPIO5
+
#endif
Index: linux-2.6.24.7/drivers/leds/Kconfig
===================================================================
--- linux-2.6.24.7.orig/drivers/leds/Kconfig
+++ linux-2.6.24.7/drivers/leds/Kconfig
@@ -48,6 +48,12 @@ config LEDS_IXP4XX
particular board must have LEDs and they must be connected
to the GPIO lines. If unsure, say Y.
+config LEDS_FSG
+ tristate "LED Support for the Freecom FSG-3"
+ depends on LEDS_CLASS && MACH_FSG
+ help
+ This option enables support for the LEDs on the Freecom FSG-3.
+
config LEDS_TOSA
tristate "LED Support for the Sharp SL-6000 series"
depends on LEDS_CLASS && PXA_SHARPSL
Index: linux-2.6.24.7/drivers/leds/Makefile
===================================================================
--- linux-2.6.24.7.orig/drivers/leds/Makefile
+++ linux-2.6.24.7/drivers/leds/Makefile
@@ -20,6 +20,7 @@ obj-$(CONFIG_LEDS_COBALT_QUBE) += leds-
obj-$(CONFIG_LEDS_COBALT_RAQ) += leds-cobalt-raq.o
obj-$(CONFIG_LEDS_GPIO) += leds-gpio.o
obj-$(CONFIG_LEDS_CM_X270) += leds-cm-x270.o
+obj-$(CONFIG_LEDS_FSG) += leds-fsg.o
# LED Triggers
obj-$(CONFIG_LEDS_TRIGGER_TIMER) += ledtrig-timer.o
Index: linux-2.6.24.7/drivers/leds/leds-fsg.c
===================================================================
--- /dev/null
+++ linux-2.6.24.7/drivers/leds/leds-fsg.c
@@ -0,0 +1,261 @@
+/*
+ * LED Driver for the Freecom FSG-3
+ *
+ * Copyright (c) 2008 Rod Whitby <rod@whitby.id.au>
+ *
+ * Author: Rod Whitby <rod@whitby.id.au>
+ *
+ * Based on leds-spitz.c
+ * Copyright 2005-2006 Openedhand Ltd.
+ * Author: Richard Purdie <rpurdie@openedhand.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ */
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/platform_device.h>
+#include <linux/leds.h>
+#include <asm/arch/hardware.h>
+#include <asm/io.h>
+
+static short __iomem *latch_address;
+static unsigned short latch_value;
+
+
+static void fsg_led_wlan_set(struct led_classdev *led_cdev,
+ enum led_brightness value)
+{
+ if (value) {
+ latch_value &= ~(1 << FSG_LED_WLAN_BIT);
+ *latch_address = latch_value;
+ } else {
+ latch_value |= (1 << FSG_LED_WLAN_BIT);
+ *latch_address = latch_value;
+ }
+}
+
+static void fsg_led_wan_set(struct led_classdev *led_cdev,
+ enum led_brightness value)
+{
+ if (value) {
+ latch_value &= ~(1 << FSG_LED_WAN_BIT);
+ *latch_address = latch_value;
+ } else {
+ latch_value |= (1 << FSG_LED_WAN_BIT);
+ *latch_address = latch_value;
+ }
+}
+
+static void fsg_led_sata_set(struct led_classdev *led_cdev,
+ enum led_brightness value)
+{
+ if (value) {
+ latch_value &= ~(1 << FSG_LED_SATA_BIT);
+ *latch_address = latch_value;
+ } else {
+ latch_value |= (1 << FSG_LED_SATA_BIT);
+ *latch_address = latch_value;
+ }
+}
+
+static void fsg_led_usb_set(struct led_classdev *led_cdev,
+ enum led_brightness value)
+{
+ if (value) {
+ latch_value &= ~(1 << FSG_LED_USB_BIT);
+ *latch_address = latch_value;
+ } else {
+ latch_value |= (1 << FSG_LED_USB_BIT);
+ *latch_address = latch_value;
+ }
+}
+
+static void fsg_led_sync_set(struct led_classdev *led_cdev,
+ enum led_brightness value)
+{
+ if (value) {
+ latch_value &= ~(1 << FSG_LED_SYNC_BIT);
+ *latch_address = latch_value;
+ } else {
+ latch_value |= (1 << FSG_LED_SYNC_BIT);
+ *latch_address = latch_value;
+ }
+}
+
+static void fsg_led_ring_set(struct led_classdev *led_cdev,
+ enum led_brightness value)
+{
+ if (value) {
+ latch_value &= ~(1 << FSG_LED_RING_BIT);
+ *latch_address = latch_value;
+ } else {
+ latch_value |= (1 << FSG_LED_RING_BIT);
+ *latch_address = latch_value;
+ }
+}
+
+
+
+static struct led_classdev fsg_wlan_led = {
+ .name = "fsg:blue:wlan",
+ .brightness_set = fsg_led_wlan_set,
+};
+
+static struct led_classdev fsg_wan_led = {
+ .name = "fsg:blue:wan",
+ .brightness_set = fsg_led_wan_set,
+};
+
+static struct led_classdev fsg_sata_led = {
+ .name = "fsg:blue:sata",
+ .brightness_set = fsg_led_sata_set,
+};
+
+static struct led_classdev fsg_usb_led = {
+ .name = "fsg:blue:usb",
+ .brightness_set = fsg_led_usb_set,
+};
+
+static struct led_classdev fsg_sync_led = {
+ .name = "fsg:blue:sync",
+ .brightness_set = fsg_led_sync_set,
+};
+
+static struct led_classdev fsg_ring_led = {
+ .name = "fsg:blue:ring",
+ .brightness_set = fsg_led_ring_set,
+};
+
+
+
+#ifdef CONFIG_PM
+static int fsg_led_suspend(struct platform_device *dev, pm_message_t state)
+{
+ led_classdev_suspend(&fsg_wlan_led);
+ led_classdev_suspend(&fsg_wan_led);
+ led_classdev_suspend(&fsg_sata_led);
+ led_classdev_suspend(&fsg_usb_led);
+ led_classdev_suspend(&fsg_sync_led);
+ led_classdev_suspend(&fsg_ring_led);
+ return 0;
+}
+
+static int fsg_led_resume(struct platform_device *dev)
+{
+ led_classdev_resume(&fsg_wlan_led);
+ led_classdev_resume(&fsg_wan_led);
+ led_classdev_resume(&fsg_sata_led);
+ led_classdev_resume(&fsg_usb_led);
+ led_classdev_resume(&fsg_sync_led);
+ led_classdev_resume(&fsg_ring_led);
+ return 0;
+}
+#endif
+
+
+static int fsg_led_probe(struct platform_device *pdev)
+{
+ int ret;
+
+ ret = led_classdev_register(&pdev->dev, &fsg_wlan_led);
+ if (ret < 0)
+ goto failwlan;
+
+ ret = led_classdev_register(&pdev->dev, &fsg_wan_led);
+ if (ret < 0)
+ goto failwan;
+
+ ret = led_classdev_register(&pdev->dev, &fsg_sata_led);
+ if (ret < 0)
+ goto failsata;
+
+ ret = led_classdev_register(&pdev->dev, &fsg_usb_led);
+ if (ret < 0)
+ goto failusb;
+
+ ret = led_classdev_register(&pdev->dev, &fsg_sync_led);
+ if (ret < 0)
+ goto failsync;
+
+ ret = led_classdev_register(&pdev->dev, &fsg_ring_led);
+ if (ret < 0)
+ goto failring;
+
+ /* Map the LED chip select address space */
+ latch_address = (unsigned short *) ioremap(IXP4XX_EXP_BUS_BASE(2), 512);
+ if (!latch_address) {
+ ret = -ENOMEM;
+ goto failremap;
+ }
+
+ latch_value = 0xffff;
+ *latch_address = latch_value;
+
+ return ret;
+
+ failremap:
+ led_classdev_unregister(&fsg_ring_led);
+ failring:
+ led_classdev_unregister(&fsg_sync_led);
+ failsync:
+ led_classdev_unregister(&fsg_usb_led);
+ failusb:
+ led_classdev_unregister(&fsg_sata_led);
+ failsata:
+ led_classdev_unregister(&fsg_wan_led);
+ failwan:
+ led_classdev_unregister(&fsg_wlan_led);
+ failwlan:
+
+ return ret;
+}
+
+static int fsg_led_remove(struct platform_device *pdev)
+{
+ iounmap(latch_address);
+
+ led_classdev_unregister(&fsg_wlan_led);
+ led_classdev_unregister(&fsg_wan_led);
+ led_classdev_unregister(&fsg_sata_led);
+ led_classdev_unregister(&fsg_usb_led);
+ led_classdev_unregister(&fsg_sync_led);
+ led_classdev_unregister(&fsg_ring_led);
+
+ return 0;
+}
+
+
+static struct platform_driver fsg_led_driver = {
+ .probe = fsg_led_probe,
+ .remove = fsg_led_remove,
+#ifdef CONFIG_PM
+ .suspend = fsg_led_suspend,
+ .resume = fsg_led_resume,
+#endif
+ .driver = {
+ .name = "fsg-led",
+ },
+};
+
+
+static int __init fsg_led_init(void)
+{
+ return platform_driver_register(&fsg_led_driver);
+}
+
+static void __exit fsg_led_exit(void)
+{
+ platform_driver_unregister(&fsg_led_driver);
+}
+
+
+module_init(fsg_led_init);
+module_exit(fsg_led_exit);
+
+MODULE_AUTHOR("Rod Whitby <rod@whitby.id.au>");
+MODULE_DESCRIPTION("Freecom FSG-3 LED driver");
+MODULE_LICENSE("GPL");

View File

@ -1,232 +0,0 @@
From af66bd3b3324d51f0c43b7672b7a0563db425377 Mon Sep 17 00:00:00 2001
From: Rod Whitby <rod@whitby.id.au>
Date: Tue, 29 Jan 2008 10:03:19 +1030
Subject: ixp4xx: Ethernet support for the nslu2 and nas100d boards
Enables the new ixp4xx qmgr and npe drivers in ixp4xx_defconfig.
Sets up the corresponding platform data for the nslu2 and nas100d
boards, and reads the ethernet MAC address from the internal flash.
Tested on both little-endian and big-endian kernels.
Signed-off-by: Rod Whitby <rod@whitby.id.au>
Signed-off-by: Michael Westerhof <mwester@dls.net>
Tested-by: Tom King <tom@websb.net>
PATCH FOLLOWS
KernelVersion: v2.6.24-1916-g3832564
Index: linux-2.6.24.7/arch/arm/configs/ixp4xx_defconfig
===================================================================
--- linux-2.6.24.7.orig/arch/arm/configs/ixp4xx_defconfig
+++ linux-2.6.24.7/arch/arm/configs/ixp4xx_defconfig
@@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
-# Linux kernel version: 2.6.24-rc8
-# Wed Jan 23 17:26:16 2008
+# Linux kernel version: 2.6.24
+# Sun Jan 27 07:33:38 2008
#
CONFIG_ARM=y
CONFIG_SYS_SUPPORTS_APM_EMULATION=y
@@ -174,6 +174,8 @@ CONFIG_MACH_GTWX5715=y
#
CONFIG_DMABOUNCE=y
# CONFIG_IXP4XX_INDIRECT_PCI is not set
+CONFIG_IXP4XX_QMGR=y
+CONFIG_IXP4XX_NPE=y
#
# Boot options
@@ -832,6 +834,7 @@ CONFIG_DUMMY=y
# CONFIG_PHYLIB is not set
CONFIG_NET_ETHERNET=y
CONFIG_MII=y
+CONFIG_IXP4XX_ETH=y
# CONFIG_AX88796 is not set
# CONFIG_HAPPYMEAL is not set
# CONFIG_SUNGEM is not set
@@ -925,6 +928,7 @@ CONFIG_HDLC_X25=m
# CONFIG_PC300TOO is not set
# CONFIG_FARSYNC is not set
# CONFIG_DSCC4 is not set
+# CONFIG_IXP4XX_HSS is not set
CONFIG_DLCI=m
CONFIG_DLCI_MAX=8
CONFIG_WAN_ROUTER_DRIVERS=m
Index: linux-2.6.24.7/arch/arm/mach-ixp4xx/nas100d-setup.c
===================================================================
--- linux-2.6.24.7.orig/arch/arm/mach-ixp4xx/nas100d-setup.c
+++ linux-2.6.24.7/arch/arm/mach-ixp4xx/nas100d-setup.c
@@ -12,6 +12,7 @@
*
*/
+#include <linux/if_ether.h>
#include <linux/kernel.h>
#include <linux/serial.h>
#include <linux/serial_8250.h>
@@ -22,6 +23,7 @@
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
#include <asm/mach/flash.h>
+#include <asm/io.h>
static struct flash_platform_data nas100d_flash_data = {
.map_name = "cfi_probe",
@@ -131,10 +133,28 @@ static struct platform_device nas100d_ua
.resource = nas100d_uart_resources,
};
+/* Built-in 10/100 Ethernet MAC interfaces */
+static struct eth_plat_info nas100d_plat_eth[] = {
+ {
+ .phy = 0,
+ .rxq = 3,
+ .txreadyq = 20,
+ }
+};
+
+static struct platform_device nas100d_eth[] = {
+ {
+ .name = "ixp4xx_eth",
+ .id = IXP4XX_ETH_NPEB,
+ .dev.platform_data = nas100d_plat_eth,
+ }
+};
+
static struct platform_device *nas100d_devices[] __initdata = {
&nas100d_i2c_gpio,
&nas100d_flash,
&nas100d_leds,
+ &nas100d_eth[0],
};
static void nas100d_power_off(void)
@@ -150,6 +170,10 @@ static void nas100d_power_off(void)
static void __init nas100d_init(void)
{
+ DECLARE_MAC_BUF(mac_buf);
+ uint8_t __iomem *f;
+ int i;
+
ixp4xx_sys_init();
/* gpio 14 and 15 are _not_ clocks */
@@ -172,6 +196,25 @@ static void __init nas100d_init(void)
(void)platform_device_register(&nas100d_uart);
platform_add_devices(nas100d_devices, ARRAY_SIZE(nas100d_devices));
+
+ /*
+ * Map in a portion of the flash and read the MAC address.
+ * Since it is stored in BE in the flash itself, we need to
+ * byteswap it if we're in LE mode.
+ */
+ f = ioremap(IXP4XX_EXP_BUS_BASE(0), 0x1000000);
+ if (f) {
+ for (i = 0; i < 6; i++)
+#ifdef __ARMEB__
+ nas100d_plat_eth[0].hwaddr[i] = readb(f + 0xFC0FD8 + i);
+#else
+ nas100d_plat_eth[0].hwaddr[i] = readb(f + 0xFC0FD8 + (i^3));
+#endif
+ iounmap(f);
+ }
+ printk(KERN_INFO "NAS100D: Using MAC address %s for port 0\n",
+ print_mac(mac_buf, nas100d_plat_eth[0].hwaddr));
+
}
MACHINE_START(NAS100D, "Iomega NAS 100d")
Index: linux-2.6.24.7/arch/arm/mach-ixp4xx/nslu2-setup.c
===================================================================
--- linux-2.6.24.7.orig/arch/arm/mach-ixp4xx/nslu2-setup.c
+++ linux-2.6.24.7/arch/arm/mach-ixp4xx/nslu2-setup.c
@@ -14,6 +14,7 @@
* Changed to conform to new style __init ixdp425 kas11 10/22/04
*/
+#include <linux/if_ether.h>
#include <linux/kernel.h>
#include <linux/serial.h>
#include <linux/serial_8250.h>
@@ -25,6 +26,7 @@
#include <asm/mach/arch.h>
#include <asm/mach/flash.h>
#include <asm/mach/time.h>
+#include <asm/io.h>
static struct flash_platform_data nslu2_flash_data = {
.map_name = "cfi_probe",
@@ -143,11 +145,29 @@ static struct platform_device nslu2_uart
.resource = nslu2_uart_resources,
};
+/* Built-in 10/100 Ethernet MAC interfaces */
+static struct eth_plat_info nslu2_plat_eth[] = {
+ {
+ .phy = 1,
+ .rxq = 3,
+ .txreadyq = 20,
+ }
+};
+
+static struct platform_device nslu2_eth[] = {
+ {
+ .name = "ixp4xx_eth",
+ .id = IXP4XX_ETH_NPEB,
+ .dev.platform_data = nslu2_plat_eth,
+ }
+};
+
static struct platform_device *nslu2_devices[] __initdata = {
&nslu2_i2c_gpio,
&nslu2_flash,
&nslu2_beeper,
&nslu2_leds,
+ &nslu2_eth[0],
};
static void nslu2_power_off(void)
@@ -176,6 +196,10 @@ static struct sys_timer nslu2_timer = {
static void __init nslu2_init(void)
{
+ DECLARE_MAC_BUF(mac_buf);
+ uint8_t __iomem *f;
+ int i;
+
ixp4xx_sys_init();
nslu2_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
@@ -195,6 +219,26 @@ static void __init nslu2_init(void)
(void)platform_device_register(&nslu2_uart);
platform_add_devices(nslu2_devices, ARRAY_SIZE(nslu2_devices));
+
+
+ /*
+ * Map in a portion of the flash and read the MAC address.
+ * Since it is stored in BE in the flash itself, we need to
+ * byteswap it if we're in LE mode.
+ */
+ f = ioremap(IXP4XX_EXP_BUS_BASE(0), 0x40000);
+ if (f) {
+ for (i = 0; i < 6; i++)
+#ifdef __ARMEB__
+ nslu2_plat_eth[0].hwaddr[i] = readb(f + 0x3FFB0 + i);
+#else
+ nslu2_plat_eth[0].hwaddr[i] = readb(f + 0x3FFB0 + (i^3));
+#endif
+ iounmap(f);
+ }
+ printk(KERN_INFO "NSLU2: Using MAC address %s for port 0\n",
+ print_mac(mac_buf, nslu2_plat_eth[0].hwaddr));
+
}
MACHINE_START(NSLU2, "Linksys NSLU2")

View File

@ -1,819 +0,0 @@
From: Rod Whitby <rod@whitby.id.au>
Subject: ixp4xx: Merge nslu2-power.c into nslu2-setup.c (Patch #4807)
There is no reason to have power control in a separate file from the
board setup code. Merge it back into the board setup file, removing
superfluous header includes and removing superfluous constants from
the machine header file.
Signed-off-by: Rod Whitby <rod@whitby.id.au>
--
PATCH FOLLOWS
KernelVersion: v2.6.24-1917-gaf66bd3
Index: linux-2.6.24.7/arch/arm/mach-ixp4xx/Makefile
===================================================================
--- linux-2.6.24.7.orig/arch/arm/mach-ixp4xx/Makefile
+++ linux-2.6.24.7/arch/arm/mach-ixp4xx/Makefile
@@ -24,9 +24,9 @@ obj-$(CONFIG_MACH_AVILA) += avila-setup.
obj-$(CONFIG_MACH_IXDPG425) += coyote-setup.o
obj-$(CONFIG_ARCH_ADI_COYOTE) += coyote-setup.o
obj-$(CONFIG_MACH_GTWX5715) += gtwx5715-setup.o
-obj-$(CONFIG_MACH_NSLU2) += nslu2-setup.o nslu2-power.o
-obj-$(CONFIG_MACH_NAS100D) += nas100d-setup.o nas100d-power.o
-obj-$(CONFIG_MACH_DSMG600) += dsmg600-setup.o dsmg600-power.o
+obj-$(CONFIG_MACH_NSLU2) += nslu2-setup.o
+obj-$(CONFIG_MACH_NAS100D) += nas100d-setup.o
+obj-$(CONFIG_MACH_DSMG600) += dsmg600-setup.o
obj-$(CONFIG_MACH_GATEWAY7001) += gateway7001-setup.o
obj-$(CONFIG_MACH_WG302V2) += wg302v2-setup.o
obj-$(CONFIG_MACH_FSG) += fsg-setup.o
Index: linux-2.6.24.7/arch/arm/mach-ixp4xx/nslu2-power.c
===================================================================
--- linux-2.6.24.7.orig/arch/arm/mach-ixp4xx/nslu2-power.c
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * arch/arm/mach-ixp4xx/nslu2-power.c
- *
- * NSLU2 Power/Reset driver
- *
- * Copyright (C) 2005 Tower Technologies
- *
- * based on nslu2-io.c
- * Copyright (C) 2004 Karen Spearel
- *
- * Author: Alessandro Zummo <a.zummo@towertech.it>
- * Maintainers: http://www.nslu2-linux.org/
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- */
-
-#include <linux/module.h>
-#include <linux/reboot.h>
-#include <linux/irq.h>
-#include <linux/interrupt.h>
-#include <linux/reboot.h>
-
-#include <asm/mach-types.h>
-
-static irqreturn_t nslu2_power_handler(int irq, void *dev_id)
-{
- /* Signal init to do the ctrlaltdel action, this will bypass init if
- * it hasn't started and do a kernel_restart.
- */
- ctrl_alt_del();
-
- return IRQ_HANDLED;
-}
-
-static irqreturn_t nslu2_reset_handler(int irq, void *dev_id)
-{
- /* This is the paper-clip reset, it shuts the machine down directly.
- */
- machine_power_off();
-
- return IRQ_HANDLED;
-}
-
-static int __init nslu2_power_init(void)
-{
- if (!(machine_is_nslu2()))
- return 0;
-
- *IXP4XX_GPIO_GPISR = 0x20400000; /* read the 2 irqs to clr */
-
- set_irq_type(NSLU2_RB_IRQ, IRQT_LOW);
- set_irq_type(NSLU2_PB_IRQ, IRQT_HIGH);
-
- if (request_irq(NSLU2_RB_IRQ, &nslu2_reset_handler,
- IRQF_DISABLED, "NSLU2 reset button", NULL) < 0) {
-
- printk(KERN_DEBUG "Reset Button IRQ %d not available\n",
- NSLU2_RB_IRQ);
-
- return -EIO;
- }
-
- if (request_irq(NSLU2_PB_IRQ, &nslu2_power_handler,
- IRQF_DISABLED, "NSLU2 power button", NULL) < 0) {
-
- printk(KERN_DEBUG "Power Button IRQ %d not available\n",
- NSLU2_PB_IRQ);
-
- return -EIO;
- }
-
- return 0;
-}
-
-static void __exit nslu2_power_exit(void)
-{
- if (!(machine_is_nslu2()))
- return;
-
- free_irq(NSLU2_RB_IRQ, NULL);
- free_irq(NSLU2_PB_IRQ, NULL);
-}
-
-module_init(nslu2_power_init);
-module_exit(nslu2_power_exit);
-
-MODULE_AUTHOR("Alessandro Zummo <a.zummo@towertech.it>");
-MODULE_DESCRIPTION("NSLU2 Power/Reset driver");
-MODULE_LICENSE("GPL");
Index: linux-2.6.24.7/arch/arm/mach-ixp4xx/nslu2-setup.c
===================================================================
--- linux-2.6.24.7.orig/arch/arm/mach-ixp4xx/nslu2-setup.c
+++ linux-2.6.24.7/arch/arm/mach-ixp4xx/nslu2-setup.c
@@ -3,22 +3,26 @@
*
* NSLU2 board-setup
*
- * based ixdp425-setup.c:
+ * Copyright (C) 2008 Rod Whitby <rod@whitby.id.au>
+ *
+ * based on ixdp425-setup.c:
* Copyright (C) 2003-2004 MontaVista Software, Inc.
+ * based on nslu2-power.c:
+ * Copyright (C) 2005 Tower Technologies
*
* Author: Mark Rakes <mrakes at mac.com>
* Author: Rod Whitby <rod@whitby.id.au>
+ * Author: Alessandro Zummo <a.zummo@towertech.it>
* Maintainers: http://www.nslu2-linux.org/
*
- * Fixed missing init_time in MACHINE_START kas11 10/22/04
- * Changed to conform to new style __init ixdp425 kas11 10/22/04
*/
#include <linux/if_ether.h>
-#include <linux/kernel.h>
+#include <linux/irq.h>
#include <linux/serial.h>
#include <linux/serial_8250.h>
#include <linux/leds.h>
+#include <linux/reboot.h>
#include <linux/i2c.h>
#include <linux/i2c-gpio.h>
@@ -27,6 +31,7 @@
#include <asm/mach/flash.h>
#include <asm/mach/time.h>
#include <asm/io.h>
+#include <asm/gpio.h>
static struct flash_platform_data nslu2_flash_data = {
.map_name = "cfi_probe",
@@ -181,6 +186,25 @@ static void nslu2_power_off(void)
gpio_line_set(NSLU2_PO_GPIO, IXP4XX_GPIO_HIGH);
}
+static irqreturn_t nslu2_power_handler(int irq, void *dev_id)
+{
+ /* Signal init to do the ctrlaltdel action, this will bypass init if
+ * it hasn't started and do a kernel_restart.
+ */
+ ctrl_alt_del();
+
+ return IRQ_HANDLED;
+}
+
+static irqreturn_t nslu2_reset_handler(int irq, void *dev_id)
+{
+ /* This is the paper-clip reset, it shuts the machine down directly.
+ */
+ machine_power_off();
+
+ return IRQ_HANDLED;
+}
+
static void __init nslu2_timer_init(void)
{
/* The xtal on this machine is non-standard. */
@@ -206,8 +230,6 @@ static void __init nslu2_init(void)
nslu2_flash_resource.end =
IXP4XX_EXP_BUS_BASE(0) + ixp4xx_exp_bus_size - 1;
- pm_power_off = nslu2_power_off;
-
i2c_register_board_info(0, nslu2_i2c_board_info,
ARRAY_SIZE(nslu2_i2c_board_info));
@@ -220,6 +242,23 @@ static void __init nslu2_init(void)
platform_add_devices(nslu2_devices, ARRAY_SIZE(nslu2_devices));
+ pm_power_off = nslu2_power_off;
+
+ if (request_irq(gpio_to_irq(NSLU2_RB_GPIO), &nslu2_reset_handler,
+ IRQF_DISABLED | IRQF_TRIGGER_LOW,
+ "NSLU2 reset button", NULL) < 0) {
+
+ printk(KERN_DEBUG "Reset Button IRQ %d not available\n",
+ gpio_to_irq(NSLU2_RB_GPIO));
+ }
+
+ if (request_irq(gpio_to_irq(NSLU2_PB_GPIO), &nslu2_power_handler,
+ IRQF_DISABLED | IRQF_TRIGGER_HIGH,
+ "NSLU2 power button", NULL) < 0) {
+
+ printk(KERN_DEBUG "Power Button IRQ %d not available\n",
+ gpio_to_irq(NSLU2_PB_GPIO));
+ }
/*
* Map in a portion of the flash and read the MAC address.
Index: linux-2.6.24.7/include/asm-arm/arch-ixp4xx/nslu2.h
===================================================================
--- linux-2.6.24.7.orig/include/asm-arm/arch-ixp4xx/nslu2.h
+++ linux-2.6.24.7/include/asm-arm/arch-ixp4xx/nslu2.h
@@ -39,34 +39,17 @@
/* Buttons */
-#define NSLU2_PB_GPIO 5
+#define NSLU2_PB_GPIO 5 /* power button */
#define NSLU2_PO_GPIO 8 /* power off */
-#define NSLU2_RB_GPIO 12
-
-#define NSLU2_PB_IRQ IRQ_IXP4XX_GPIO5
-#define NSLU2_RB_IRQ IRQ_IXP4XX_GPIO12
-
-#define NSLU2_PB_BM (1L << NSLU2_PB_GPIO)
-#define NSLU2_PO_BM (1L << NSLU2_PO_GPIO)
-#define NSLU2_RB_BM (1L << NSLU2_RB_GPIO)
+#define NSLU2_RB_GPIO 12 /* reset button */
/* Buzzer */
#define NSLU2_GPIO_BUZZ 4
-#define NSLU2_BZ_BM (1L << NSLU2_GPIO_BUZZ)
/* LEDs */
#define NSLU2_LED_RED_GPIO 0
#define NSLU2_LED_GRN_GPIO 1
-
-#define NSLU2_LED_RED_BM (1L << NSLU2_LED_RED_GPIO)
-#define NSLU2_LED_GRN_BM (1L << NSLU2_LED_GRN_GPIO)
-
#define NSLU2_LED_DISK1_GPIO 3
#define NSLU2_LED_DISK2_GPIO 2
-
-#define NSLU2_LED_DISK1_BM (1L << NSLU2_LED_DISK1_GPIO)
-#define NSLU2_LED_DISK2_BM (1L << NSLU2_LED_DISK2_GPIO)
-
-
Index: linux-2.6.24.7/arch/arm/mach-ixp4xx/nas100d-power.c
===================================================================
--- linux-2.6.24.7.orig/arch/arm/mach-ixp4xx/nas100d-power.c
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * arch/arm/mach-ixp4xx/nas100d-power.c
- *
- * NAS 100d Power/Reset driver
- *
- * Copyright (C) 2005 Tower Technologies
- *
- * based on nas100d-io.c
- * Copyright (C) 2004 Karen Spearel
- *
- * Author: Alessandro Zummo <a.zummo@towertech.it>
- * Maintainers: http://www.nslu2-linux.org/
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- */
-
-#include <linux/interrupt.h>
-#include <linux/irq.h>
-#include <linux/module.h>
-#include <linux/reboot.h>
-#include <linux/jiffies.h>
-#include <linux/timer.h>
-
-#include <asm/gpio.h>
-#include <asm/mach-types.h>
-
-/* This is used to make sure the power-button pusher is serious. The button
- * must be held until the value of this counter reaches zero.
- */
-static int power_button_countdown;
-
-/* Must hold the button down for at least this many counts to be processed */
-#define PBUTTON_HOLDDOWN_COUNT 4 /* 2 secs */
-
-static void nas100d_power_handler(unsigned long data);
-static DEFINE_TIMER(nas100d_power_timer, nas100d_power_handler, 0, 0);
-
-static void nas100d_power_handler(unsigned long data)
-{
- /* This routine is called twice per second to check the
- * state of the power button.
- */
-
- if (gpio_get_value(NAS100D_PB_GPIO)) {
-
- /* IO Pin is 1 (button pushed) */
- if (power_button_countdown > 0)
- power_button_countdown--;
-
- } else {
-
- /* Done on button release, to allow for auto-power-on mods. */
- if (power_button_countdown == 0) {
- /* Signal init to do the ctrlaltdel action,
- * this will bypass init if it hasn't started
- * and do a kernel_restart.
- */
- ctrl_alt_del();
-
- /* Change the state of the power LED to "blink" */
- gpio_line_set(NAS100D_LED_PWR_GPIO, IXP4XX_GPIO_LOW);
- } else {
- power_button_countdown = PBUTTON_HOLDDOWN_COUNT;
- }
- }
-
- mod_timer(&nas100d_power_timer, jiffies + msecs_to_jiffies(500));
-}
-
-static irqreturn_t nas100d_reset_handler(int irq, void *dev_id)
-{
- /* This is the paper-clip reset, it shuts the machine down directly. */
- machine_power_off();
-
- return IRQ_HANDLED;
-}
-
-static int __init nas100d_power_init(void)
-{
- if (!(machine_is_nas100d()))
- return 0;
-
- set_irq_type(gpio_to_irq(NAS100D_RB_GPIO), IRQT_LOW);
-
- if (request_irq(gpio_to_irq(NAS100D_RB_GPIO), &nas100d_reset_handler,
- IRQF_DISABLED, "NAS100D reset button", NULL) < 0) {
-
- printk(KERN_DEBUG "Reset Button IRQ %d not available\n",
- gpio_to_irq(NAS100D_RB_GPIO));
-
- return -EIO;
- }
-
- /* The power button on the Iomega NAS100d is on GPIO 14, but
- * it cannot handle interrupts on that GPIO line. So we'll
- * have to poll it with a kernel timer.
- */
-
- /* Make sure that the power button GPIO is set up as an input */
- gpio_line_config(NAS100D_PB_GPIO, IXP4XX_GPIO_IN);
-
- /* Set the initial value for the power button IRQ handler */
- power_button_countdown = PBUTTON_HOLDDOWN_COUNT;
-
- mod_timer(&nas100d_power_timer, jiffies + msecs_to_jiffies(500));
-
- return 0;
-}
-
-static void __exit nas100d_power_exit(void)
-{
- if (!(machine_is_nas100d()))
- return;
-
- del_timer_sync(&nas100d_power_timer);
-
- free_irq(gpio_to_irq(NAS100D_RB_GPIO), NULL);
-}
-
-module_init(nas100d_power_init);
-module_exit(nas100d_power_exit);
-
-MODULE_AUTHOR("Alessandro Zummo <a.zummo@towertech.it>");
-MODULE_DESCRIPTION("NAS100D Power/Reset driver");
-MODULE_LICENSE("GPL");
Index: linux-2.6.24.7/arch/arm/mach-ixp4xx/nas100d-setup.c
===================================================================
--- linux-2.6.24.7.orig/arch/arm/mach-ixp4xx/nas100d-setup.c
+++ linux-2.6.24.7/arch/arm/mach-ixp4xx/nas100d-setup.c
@@ -3,8 +3,14 @@
*
* NAS 100d board-setup
*
- * based ixdp425-setup.c:
+ * Copyright (C) 2008 Rod Whitby <rod@whitby.id.au>
+ *
+ * based on ixdp425-setup.c:
* Copyright (C) 2003-2004 MontaVista Software, Inc.
+ * based on nas100d-power.c:
+ * Copyright (C) 2005 Tower Technologies
+ * based on nas100d-io.c
+ * Copyright (C) 2004 Karen Spearel
*
* Author: Alessandro Zummo <a.zummo@towertech.it>
* Author: Rod Whitby <rod@whitby.id.au>
@@ -13,10 +19,13 @@
*/
#include <linux/if_ether.h>
-#include <linux/kernel.h>
+#include <linux/irq.h>
+#include <linux/jiffies.h>
+#include <linux/timer.h>
#include <linux/serial.h>
#include <linux/serial_8250.h>
#include <linux/leds.h>
+#include <linux/reboot.h>
#include <linux/i2c.h>
#include <linux/i2c-gpio.h>
@@ -24,6 +33,7 @@
#include <asm/mach/arch.h>
#include <asm/mach/flash.h>
#include <asm/io.h>
+#include <asm/gpio.h>
static struct flash_platform_data nas100d_flash_data = {
.map_name = "cfi_probe",
@@ -168,6 +178,57 @@ static void nas100d_power_off(void)
gpio_line_set(NAS100D_PO_GPIO, IXP4XX_GPIO_HIGH);
}
+/* This is used to make sure the power-button pusher is serious. The button
+ * must be held until the value of this counter reaches zero.
+ */
+static int power_button_countdown;
+
+/* Must hold the button down for at least this many counts to be processed */
+#define PBUTTON_HOLDDOWN_COUNT 4 /* 2 secs */
+
+static void nas100d_power_handler(unsigned long data);
+static DEFINE_TIMER(nas100d_power_timer, nas100d_power_handler, 0, 0);
+
+static void nas100d_power_handler(unsigned long data)
+{
+ /* This routine is called twice per second to check the
+ * state of the power button.
+ */
+
+ if (gpio_get_value(NAS100D_PB_GPIO)) {
+
+ /* IO Pin is 1 (button pushed) */
+ if (power_button_countdown > 0)
+ power_button_countdown--;
+
+ } else {
+
+ /* Done on button release, to allow for auto-power-on mods. */
+ if (power_button_countdown == 0) {
+ /* Signal init to do the ctrlaltdel action,
+ * this will bypass init if it hasn't started
+ * and do a kernel_restart.
+ */
+ ctrl_alt_del();
+
+ /* Change the state of the power LED to "blink" */
+ gpio_line_set(NAS100D_LED_PWR_GPIO, IXP4XX_GPIO_LOW);
+ } else {
+ power_button_countdown = PBUTTON_HOLDDOWN_COUNT;
+ }
+ }
+
+ mod_timer(&nas100d_power_timer, jiffies + msecs_to_jiffies(500));
+}
+
+static irqreturn_t nas100d_reset_handler(int irq, void *dev_id)
+{
+ /* This is the paper-clip reset, it shuts the machine down directly. */
+ machine_power_off();
+
+ return IRQ_HANDLED;
+}
+
static void __init nas100d_init(void)
{
DECLARE_MAC_BUF(mac_buf);
@@ -183,8 +244,6 @@ static void __init nas100d_init(void)
nas100d_flash_resource.end =
IXP4XX_EXP_BUS_BASE(0) + ixp4xx_exp_bus_size - 1;
- pm_power_off = nas100d_power_off;
-
i2c_register_board_info(0, nas100d_i2c_board_info,
ARRAY_SIZE(nas100d_i2c_board_info));
@@ -197,6 +256,29 @@ static void __init nas100d_init(void)
platform_add_devices(nas100d_devices, ARRAY_SIZE(nas100d_devices));
+ pm_power_off = nas100d_power_off;
+
+ if (request_irq(gpio_to_irq(NAS100D_RB_GPIO), &nas100d_reset_handler,
+ IRQF_DISABLED | IRQF_TRIGGER_LOW,
+ "NAS100D reset button", NULL) < 0) {
+
+ printk(KERN_DEBUG "Reset Button IRQ %d not available\n",
+ gpio_to_irq(NAS100D_RB_GPIO));
+ }
+
+ /* The power button on the Iomega NAS100d is on GPIO 14, but
+ * it cannot handle interrupts on that GPIO line. So we'll
+ * have to poll it with a kernel timer.
+ */
+
+ /* Make sure that the power button GPIO is set up as an input */
+ gpio_line_config(NAS100D_PB_GPIO, IXP4XX_GPIO_IN);
+
+ /* Set the initial value for the power button IRQ handler */
+ power_button_countdown = PBUTTON_HOLDDOWN_COUNT;
+
+ mod_timer(&nas100d_power_timer, jiffies + msecs_to_jiffies(500));
+
/*
* Map in a portion of the flash and read the MAC address.
* Since it is stored in BE in the flash itself, we need to
Index: linux-2.6.24.7/arch/arm/mach-ixp4xx/dsmg600-power.c
===================================================================
--- linux-2.6.24.7.orig/arch/arm/mach-ixp4xx/dsmg600-power.c
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- * arch/arm/mach-ixp4xx/dsmg600-power.c
- *
- * DSM-G600 Power/Reset driver
- * Author: Michael Westerhof <mwester@dls.net>
- *
- * Based on nslu2-power.c
- * Copyright (C) 2005 Tower Technologies
- * Author: Alessandro Zummo <a.zummo@towertech.it>
- *
- * which was based on nslu2-io.c
- * Copyright (C) 2004 Karen Spearel
- *
- * Maintainers: http://www.nslu2-linux.org/
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- */
-
-#include <linux/module.h>
-#include <linux/reboot.h>
-#include <linux/interrupt.h>
-#include <linux/irq.h>
-#include <linux/jiffies.h>
-#include <linux/timer.h>
-
-#include <asm/gpio.h>
-#include <asm/mach-types.h>
-
-/* This is used to make sure the power-button pusher is serious. The button
- * must be held until the value of this counter reaches zero.
- */
-static int power_button_countdown;
-
-/* Must hold the button down for at least this many counts to be processed */
-#define PBUTTON_HOLDDOWN_COUNT 4 /* 2 secs */
-
-static void dsmg600_power_handler(unsigned long data);
-static DEFINE_TIMER(dsmg600_power_timer, dsmg600_power_handler, 0, 0);
-
-static void dsmg600_power_handler(unsigned long data)
-{
- /* This routine is called twice per second to check the
- * state of the power button.
- */
-
- if (gpio_get_value(DSMG600_PB_GPIO)) {
-
- /* IO Pin is 1 (button pushed) */
- if (power_button_countdown > 0)
- power_button_countdown--;
-
- } else {
-
- /* Done on button release, to allow for auto-power-on mods. */
- if (power_button_countdown == 0) {
- /* Signal init to do the ctrlaltdel action,
- * this will bypass init if it hasn't started
- * and do a kernel_restart.
- */
- ctrl_alt_del();
-
- /* Change the state of the power LED to "blink" */
- gpio_line_set(DSMG600_LED_PWR_GPIO, IXP4XX_GPIO_LOW);
- } else {
- power_button_countdown = PBUTTON_HOLDDOWN_COUNT;
- }
- }
-
- mod_timer(&dsmg600_power_timer, jiffies + msecs_to_jiffies(500));
-}
-
-static irqreturn_t dsmg600_reset_handler(int irq, void *dev_id)
-{
- /* This is the paper-clip reset, it shuts the machine down directly. */
- machine_power_off();
-
- return IRQ_HANDLED;
-}
-
-static int __init dsmg600_power_init(void)
-{
- if (!(machine_is_dsmg600()))
- return 0;
-
- if (request_irq(gpio_to_irq(DSMG600_RB_GPIO), &dsmg600_reset_handler,
- IRQF_DISABLED | IRQF_TRIGGER_LOW, "DSM-G600 reset button",
- NULL) < 0) {
-
- printk(KERN_DEBUG "Reset Button IRQ %d not available\n",
- gpio_to_irq(DSMG600_RB_GPIO));
-
- return -EIO;
- }
-
- /* The power button on the D-Link DSM-G600 is on GPIO 15, but
- * it cannot handle interrupts on that GPIO line. So we'll
- * have to poll it with a kernel timer.
- */
-
- /* Make sure that the power button GPIO is set up as an input */
- gpio_line_config(DSMG600_PB_GPIO, IXP4XX_GPIO_IN);
-
- /* Set the initial value for the power button IRQ handler */
- power_button_countdown = PBUTTON_HOLDDOWN_COUNT;
-
- mod_timer(&dsmg600_power_timer, jiffies + msecs_to_jiffies(500));
-
- return 0;
-}
-
-static void __exit dsmg600_power_exit(void)
-{
- if (!(machine_is_dsmg600()))
- return;
-
- del_timer_sync(&dsmg600_power_timer);
-
- free_irq(gpio_to_irq(DSMG600_RB_GPIO), NULL);
-}
-
-module_init(dsmg600_power_init);
-module_exit(dsmg600_power_exit);
-
-MODULE_AUTHOR("Michael Westerhof <mwester@dls.net>");
-MODULE_DESCRIPTION("DSM-G600 Power/Reset driver");
-MODULE_LICENSE("GPL");
Index: linux-2.6.24.7/arch/arm/mach-ixp4xx/dsmg600-setup.c
===================================================================
--- linux-2.6.24.7.orig/arch/arm/mach-ixp4xx/dsmg600-setup.c
+++ linux-2.6.24.7/arch/arm/mach-ixp4xx/dsmg600-setup.c
@@ -1,20 +1,29 @@
/*
* DSM-G600 board-setup
*
+ * Copyright (C) 2008 Rod Whitby <rod@whitby.id.au>
* Copyright (C) 2006 Tower Technologies
- * Author: Alessandro Zummo <a.zummo@towertech.it>
*
- * based ixdp425-setup.c:
+ * based on ixdp425-setup.c:
* Copyright (C) 2003-2004 MontaVista Software, Inc.
+ * based on nslu2-power.c:
+ * Copyright (C) 2005 Tower Technologies
+ * based on nslu2-io.c:
+ * Copyright (C) 2004 Karen Spearel
*
* Author: Alessandro Zummo <a.zummo@towertech.it>
+ * Author: Michael Westerhof <mwester@dls.net>
+ * Author: Rod Whitby <rod@whitby.id.au>
* Maintainers: http://www.nslu2-linux.org/
*/
-#include <linux/kernel.h>
+#include <linux/irq.h>
+#include <linux/jiffies.h>
+#include <linux/timer.h>
#include <linux/serial.h>
#include <linux/serial_8250.h>
#include <linux/leds.h>
+#include <linux/reboot.h>
#include <linux/i2c.h>
#include <linux/i2c-gpio.h>
@@ -22,6 +31,7 @@
#include <asm/mach/arch.h>
#include <asm/mach/flash.h>
#include <asm/mach/time.h>
+#include <asm/gpio.h>
static struct flash_platform_data dsmg600_flash_data = {
.map_name = "cfi_probe",
@@ -140,6 +150,57 @@ static void dsmg600_power_off(void)
gpio_line_set(DSMG600_PO_GPIO, IXP4XX_GPIO_HIGH);
}
+/* This is used to make sure the power-button pusher is serious. The button
+ * must be held until the value of this counter reaches zero.
+ */
+static int power_button_countdown;
+
+/* Must hold the button down for at least this many counts to be processed */
+#define PBUTTON_HOLDDOWN_COUNT 4 /* 2 secs */
+
+static void dsmg600_power_handler(unsigned long data);
+static DEFINE_TIMER(dsmg600_power_timer, dsmg600_power_handler, 0, 0);
+
+static void dsmg600_power_handler(unsigned long data)
+{
+ /* This routine is called twice per second to check the
+ * state of the power button.
+ */
+
+ if (gpio_get_value(DSMG600_PB_GPIO)) {
+
+ /* IO Pin is 1 (button pushed) */
+ if (power_button_countdown > 0)
+ power_button_countdown--;
+
+ } else {
+
+ /* Done on button release, to allow for auto-power-on mods. */
+ if (power_button_countdown == 0) {
+ /* Signal init to do the ctrlaltdel action,
+ * this will bypass init if it hasn't started
+ * and do a kernel_restart.
+ */
+ ctrl_alt_del();
+
+ /* Change the state of the power LED to "blink" */
+ gpio_line_set(DSMG600_LED_PWR_GPIO, IXP4XX_GPIO_LOW);
+ } else {
+ power_button_countdown = PBUTTON_HOLDDOWN_COUNT;
+ }
+ }
+
+ mod_timer(&dsmg600_power_timer, jiffies + msecs_to_jiffies(500));
+}
+
+static irqreturn_t dsmg600_reset_handler(int irq, void *dev_id)
+{
+ /* This is the paper-clip reset, it shuts the machine down directly. */
+ machine_power_off();
+
+ return IRQ_HANDLED;
+}
+
static void __init dsmg600_timer_init(void)
{
/* The xtal on this machine is non-standard. */
@@ -164,8 +225,6 @@ static void __init dsmg600_init(void)
dsmg600_flash_resource.end =
IXP4XX_EXP_BUS_BASE(0) + ixp4xx_exp_bus_size - 1;
- pm_power_off = dsmg600_power_off;
-
i2c_register_board_info(0, dsmg600_i2c_board_info,
ARRAY_SIZE(dsmg600_i2c_board_info));
@@ -176,6 +235,29 @@ static void __init dsmg600_init(void)
(void)platform_device_register(&dsmg600_uart);
platform_add_devices(dsmg600_devices, ARRAY_SIZE(dsmg600_devices));
+
+ pm_power_off = dsmg600_power_off;
+
+ if (request_irq(gpio_to_irq(DSMG600_RB_GPIO), &dsmg600_reset_handler,
+ IRQF_DISABLED | IRQF_TRIGGER_LOW,
+ "DSM-G600 reset button", NULL) < 0) {
+
+ printk(KERN_DEBUG "Reset Button IRQ %d not available\n",
+ gpio_to_irq(DSMG600_RB_GPIO));
+ }
+
+ /* The power button on the D-Link DSM-G600 is on GPIO 15, but
+ * it cannot handle interrupts on that GPIO line. So we'll
+ * have to poll it with a kernel timer.
+ */
+
+ /* Make sure that the power button GPIO is set up as an input */
+ gpio_line_config(DSMG600_PB_GPIO, IXP4XX_GPIO_IN);
+
+ /* Set the initial value for the power button IRQ handler */
+ power_button_countdown = PBUTTON_HOLDDOWN_COUNT;
+
+ mod_timer(&dsmg600_power_timer, jiffies + msecs_to_jiffies(500));
}
MACHINE_START(DSMG600, "D-Link DSM-G600 RevA")

View File

@ -1,899 +0,0 @@
Index: linux-2.6.24.7/drivers/net/via-velocity.c
===================================================================
--- linux-2.6.24.7.orig/drivers/net/via-velocity.c
+++ linux-2.6.24.7/drivers/net/via-velocity.c
@@ -254,11 +254,31 @@ MODULE_AUTHOR("VIA Networking Technologi
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("VIA Networking Velocity Family Gigabit Ethernet Adapter Driver");
+/* Valid values for vdebug (additive, this is a bitmask):
+ * 0x00 => off
+ * 0x01 => always on
+ * 0x02 => additional detail on tx (rx, too, if anyone implements same)
+ * 0x04 => detail the initialization process
+ * 0x08 => spot debug detail; to be used as developers see fit
+ */
+static int vdebug = 0;
+
+/* HAIL - these macros are for the normal 0x01-type tracing... */
+#define HAIL(S) \
+ if (vdebug&1) printk(KERN_NOTICE "%s\n", (S));
+#define HAILS(S,T) \
+ if (vdebug&1) printk(KERN_NOTICE "%s -> status=0x%x\n", (S), (T));
+
#define VELOCITY_PARAM(N,D) \
static int N[MAX_UNITS]=OPTION_DEFAULT;\
module_param_array(N, int, NULL, 0); \
MODULE_PARM_DESC(N, D);
+#define VELO_DEBUG_MIN 0
+#define VELO_DEBUG_MAX 255
+#define VELO_DEBUG_DEF 0
+VELOCITY_PARAM(velo_debug, "Debug level");
+
#define RX_DESC_MIN 64
#define RX_DESC_MAX 255
#define RX_DESC_DEF 64
@@ -557,12 +577,12 @@ static void __devinit velocity_set_bool_
if (val == -1)
*opt |= (def ? flag : 0);
else if (val < 0 || val > 1) {
- printk(KERN_NOTICE "%s: the value of parameter %s is invalid, the valid range is (0-1)\n",
- devname, name);
+ printk(KERN_NOTICE "via-velocity: the value of parameter %s is invalid, the valid range is (0-1)\n",
+ name);
*opt |= (def ? flag : 0);
} else {
- printk(KERN_INFO "%s: set parameter %s to %s\n",
- devname, name, val ? "TRUE" : "FALSE");
+ printk(KERN_INFO "via-velocity: set parameter %s to %s\n",
+ name, val ? "TRUE" : "FALSE");
*opt |= (val ? flag : 0);
}
}
@@ -580,6 +600,7 @@ static void __devinit velocity_set_bool_
static void __devinit velocity_get_options(struct velocity_opt *opts, int index, char *devname)
{
+ velocity_set_int_opt(&opts->velo_debug, velo_debug[index], VELO_DEBUG_MIN, VELO_DEBUG_MAX, VELO_DEBUG_DEF, "velo_debug", devname);
velocity_set_int_opt(&opts->rx_thresh, rx_thresh[index], RX_THRESH_MIN, RX_THRESH_MAX, RX_THRESH_DEF, "rx_thresh", devname);
velocity_set_int_opt(&opts->DMA_length, DMA_length[index], DMA_LENGTH_MIN, DMA_LENGTH_MAX, DMA_LENGTH_DEF, "DMA_length", devname);
velocity_set_int_opt(&opts->numrx, RxDescriptors[index], RX_DESC_MIN, RX_DESC_MAX, RX_DESC_DEF, "RxDescriptors", devname);
@@ -593,6 +614,7 @@ static void __devinit velocity_get_optio
velocity_set_int_opt((int *) &opts->wol_opts, wol_opts[index], WOL_OPT_MIN, WOL_OPT_MAX, WOL_OPT_DEF, "Wake On Lan options", devname);
velocity_set_int_opt((int *) &opts->int_works, int_works[index], INT_WORKS_MIN, INT_WORKS_MAX, INT_WORKS_DEF, "Interrupt service works", devname);
opts->numrx = (opts->numrx & ~3);
+ vdebug = opts->velo_debug;
}
/**
@@ -608,6 +630,8 @@ static void velocity_init_cam_filter(str
struct mac_regs __iomem * regs = vptr->mac_regs;
unsigned short vid;
+ HAIL("velocity_init_cam_filter");
+
/* Turn on MCFG_PQEN, turn off MCFG_RTGOPT */
WORD_REG_BITS_SET(MCFG_PQEN, MCFG_RTGOPT, &regs->MCFG);
WORD_REG_BITS_ON(MCFG_VIDFR, &regs->MCFG);
@@ -636,8 +660,10 @@ static void velocity_init_cam_filter(str
} else {
u16 temp = 0;
mac_set_vlan_cam(regs, 0, (u8 *) &temp);
- temp = 1;
- mac_set_vlan_cam_mask(regs, (u8 *) &temp);
+ /* temp = 1; BE */
+ /* mac_set_vlan_cam_mask(regs, (u8 *) &temp); BE */
+ vptr->vCAMmask[0] |= 1; /* BE */
+ mac_set_vlan_cam_mask(regs, vptr->vCAMmask); /* BE */
}
}
@@ -675,13 +701,15 @@ static void velocity_rx_reset(struct vel
struct mac_regs __iomem * regs = vptr->mac_regs;
int i;
+ HAIL("velocity_rx_reset");
vptr->rd_dirty = vptr->rd_filled = vptr->rd_curr = 0;
/*
* Init state, all RD entries belong to the NIC
*/
for (i = 0; i < vptr->options.numrx; ++i)
- vptr->rd_ring[i].rdesc0.owner = OWNED_BY_NIC;
+ /* vptr->rd_ring[i].rdesc0.owner = OWNED_BY_NIC; BE */
+ vptr->rd_ring[i].rdesc0 |= cpu_to_le32(BE_OWNED_BY_NIC); /* BE */
writew(vptr->options.numrx, &regs->RBRDU);
writel(vptr->rd_pool_dma, &regs->RDBaseLo);
@@ -704,12 +732,15 @@ static void velocity_init_registers(stru
struct mac_regs __iomem * regs = vptr->mac_regs;
int i, mii_status;
+ if (vdebug&5) printk(KERN_NOTICE "velocity_init_registers: entering\n");
+
mac_wol_reset(regs);
switch (type) {
case VELOCITY_INIT_RESET:
case VELOCITY_INIT_WOL:
+ if (vdebug&4) printk(KERN_NOTICE "velocity_init_registers: RESET or WOL\n");
netif_stop_queue(vptr->dev);
/*
@@ -737,12 +768,13 @@ static void velocity_init_registers(stru
case VELOCITY_INIT_COLD:
default:
+ if (vdebug&4) printk(KERN_NOTICE "velocity_init_registers: COLD or default\n");
/*
* Do reset
*/
velocity_soft_reset(vptr);
+ if (vdebug&4) printk(KERN_NOTICE "velocity_init_registers: soft reset complete.\n");
mdelay(5);
-
mac_eeprom_reload(regs);
for (i = 0; i < 6; i++) {
writeb(vptr->dev->dev_addr[i], &(regs->PAR[i]));
@@ -760,11 +792,16 @@ static void velocity_init_registers(stru
*/
BYTE_REG_BITS_SET(CFGB_OFSET, (CFGB_CRANDOM | CFGB_CAP | CFGB_MBA | CFGB_BAKOPT), &regs->CFGB);
+ if (vdebug&4) printk(KERN_NOTICE "velocity_init_registers: Initializing CAM filter\n");
/*
* Init CAM filter
*/
+ if (vdebug&8) printk(KERN_NOTICE "velocity: spot debug: about to init CAM filters\n");
+ mdelay(5); /* MJW - ARM processors, kernel 2.6.19 - this fixes oopses and hangs */
velocity_init_cam_filter(vptr);
+ if (vdebug&8) printk(KERN_NOTICE "velocity: spot debug: init CAM filters complete\n");
+ if (vdebug&4) printk(KERN_NOTICE "velocity_init_registers: Setting packet filter\n");
/*
* Set packet filter: Receive directed and broadcast address
*/
@@ -774,10 +811,12 @@ static void velocity_init_registers(stru
* Enable MII auto-polling
*/
enable_mii_autopoll(regs);
+ if (vdebug&4) printk(KERN_NOTICE "velocity_init_registers: enable_mii_autopoll complete.\n");
vptr->int_mask = INT_MASK_DEF;
- writel(cpu_to_le32(vptr->rd_pool_dma), &regs->RDBaseLo);
+ /* writel(cpu_to_le32(vptr->rd_pool_dma), &regs->RDBaseLo); BE */
+ writel((vptr->rd_pool_dma), &regs->RDBaseLo); /* BE */
writew(vptr->options.numrx - 1, &regs->RDCSize);
mac_rx_queue_run(regs);
mac_rx_queue_wake(regs);
@@ -785,10 +824,13 @@ static void velocity_init_registers(stru
writew(vptr->options.numtx - 1, &regs->TDCSize);
for (i = 0; i < vptr->num_txq; i++) {
- writel(cpu_to_le32(vptr->td_pool_dma[i]), &(regs->TDBaseLo[i]));
+ /* writel(cpu_to_le32(vptr->td_pool_dma[i]), &(regs->TDBaseLo[i])); BE */
+ writel((vptr->td_pool_dma[i]), &(regs->TDBaseLo[i])); /* BE */
mac_tx_queue_run(regs, i);
}
+ if (vdebug&4) printk(KERN_NOTICE "velocity_init_registers: DMA settings complete.\n");
+
init_flow_control_register(vptr);
writel(CR0_STOP, &regs->CR0Clr);
@@ -807,8 +849,10 @@ static void velocity_init_registers(stru
enable_flow_control_ability(vptr);
mac_hw_mibs_init(regs);
+ if (vdebug&4) printk(KERN_NOTICE "velocity_init_registers: Set interrupt mask\n");
mac_write_int_mask(vptr->int_mask, regs);
mac_clear_isr(regs);
+ if (vdebug&4) printk(KERN_NOTICE "velocity_init_registers: complete.\n");
}
}
@@ -826,6 +870,7 @@ static int velocity_soft_reset(struct ve
struct mac_regs __iomem * regs = vptr->mac_regs;
int i = 0;
+ HAIL("velocity_soft_reset");
writel(CR0_SFRST, &regs->CR0Set);
for (i = 0; i < W_MAX_TIMEOUT; i++) {
@@ -888,6 +933,7 @@ static int __devinit velocity_found1(str
VELOCITY_FULL_DRV_NAM, VELOCITY_VERSION);
printk(KERN_INFO "Copyright (c) 2002, 2003 VIA Networking Technologies, Inc.\n");
printk(KERN_INFO "Copyright (c) 2004 Red Hat Inc.\n");
+ printk(KERN_INFO "BE support, misc. fixes MJW 01Jan2007 - may be unstable\n");
first = 0;
}
@@ -1104,6 +1150,7 @@ static int velocity_init_rings(struct ve
dma_addr_t pool_dma;
u8 *pool;
+ HAIL("velocity_init_rings");
/*
* Allocate all RD/TD rings a single pool
*/
@@ -1166,6 +1213,7 @@ static int velocity_init_rings(struct ve
static void velocity_free_rings(struct velocity_info *vptr)
{
int size;
+ HAIL("velocity_free_rings");
size = vptr->options.numrx * sizeof(struct rx_desc) +
vptr->options.numtx * sizeof(struct tx_desc) * vptr->num_txq;
@@ -1182,6 +1230,7 @@ static inline void velocity_give_many_rx
struct mac_regs __iomem *regs = vptr->mac_regs;
int avail, dirty, unusable;
+ HAIL("velocity_give_many_rx_descs");
/*
* RD number must be equal to 4X per hardware spec
* (programming guide rev 1.20, p.13)
@@ -1195,7 +1244,8 @@ static inline void velocity_give_many_rx
dirty = vptr->rd_dirty - unusable;
for (avail = vptr->rd_filled & 0xfffc; avail; avail--) {
dirty = (dirty > 0) ? dirty - 1 : vptr->options.numrx - 1;
- vptr->rd_ring[dirty].rdesc0.owner = OWNED_BY_NIC;
+ /* vptr->rd_ring[dirty].rdesc0.owner = OWNED_BY_NIC; BE */
+ vptr->rd_ring[dirty].rdesc0 |= cpu_to_le32(BE_OWNED_BY_NIC); /* BE */
}
writew(vptr->rd_filled & 0xfffc, &regs->RBRDU);
@@ -1205,12 +1255,14 @@ static inline void velocity_give_many_rx
static int velocity_rx_refill(struct velocity_info *vptr)
{
int dirty = vptr->rd_dirty, done = 0, ret = 0;
+ HAIL("velocity_rx_refill");
do {
struct rx_desc *rd = vptr->rd_ring + dirty;
/* Fine for an all zero Rx desc at init time as well */
- if (rd->rdesc0.owner == OWNED_BY_NIC)
+ /* if (rd->rdesc0.owner == OWNED_BY_NIC) BE */
+ if (rd->rdesc0 & cpu_to_le32(BE_OWNED_BY_NIC)) /* BE */
break;
if (!vptr->rd_info[dirty].skb) {
@@ -1244,6 +1296,7 @@ static int velocity_init_rd_ring(struct
int ret;
int mtu = vptr->dev->mtu;
+ HAIL("velocity_init_rd_ring");
vptr->rx_buf_sz = (mtu <= ETH_DATA_LEN) ? PKT_BUF_SZ : mtu + 32;
vptr->rd_info = kcalloc(vptr->options.numrx,
@@ -1275,6 +1328,7 @@ static void velocity_free_rd_ring(struct
{
int i;
+ HAIL("velocity_free_rd_ring");
if (vptr->rd_info == NULL)
return;
@@ -1314,6 +1368,7 @@ static int velocity_init_td_ring(struct
struct tx_desc *td;
struct velocity_td_info *td_info;
+ HAIL("velocity_init_td_ring");
/* Init the TD ring entries */
for (j = 0; j < vptr->num_txq; j++) {
curr = vptr->td_pool_dma[j];
@@ -1350,6 +1405,7 @@ static void velocity_free_td_ring_entry(
struct velocity_td_info * td_info = &(vptr->td_infos[q][n]);
int i;
+ HAIL("velocity_free_td_ring_entry");
if (td_info == NULL)
return;
@@ -1379,6 +1435,7 @@ static void velocity_free_td_ring(struct
{
int i, j;
+ HAIL("velocity_free_td_ring");
for (j = 0; j < vptr->num_txq; j++) {
if (vptr->td_infos[j] == NULL)
continue;
@@ -1406,34 +1463,42 @@ static int velocity_rx_srv(struct veloci
struct net_device_stats *stats = &vptr->stats;
int rd_curr = vptr->rd_curr;
int works = 0;
+ u16 wRSR; /* BE */
+ HAILS("velocity_rx_srv", status);
do {
struct rx_desc *rd = vptr->rd_ring + rd_curr;
if (!vptr->rd_info[rd_curr].skb)
break;
- if (rd->rdesc0.owner == OWNED_BY_NIC)
+ /* if (rd->rdesc0.owner == OWNED_BY_NIC) BE */
+ if (rd->rdesc0 & cpu_to_le32(BE_OWNED_BY_NIC)) /* BE */
break;
rmb();
+ wRSR = (u16)(cpu_to_le32(rd->rdesc0)); /* BE */
/*
* Don't drop CE or RL error frame although RXOK is off
*/
- if ((rd->rdesc0.RSR & RSR_RXOK) || (!(rd->rdesc0.RSR & RSR_RXOK) && (rd->rdesc0.RSR & (RSR_CE | RSR_RL)))) {
+ /* if ((rd->rdesc0.RSR & RSR_RXOK) || (!(rd->rdesc0.RSR & RSR_RXOK) && (rd->rdesc0.RSR & (RSR_CE | RSR_RL)))) { BE */
+ if ((wRSR & RSR_RXOK) || (!(wRSR & RSR_RXOK) && (wRSR & (RSR_CE | RSR_RL)))) { /* BE */
if (velocity_receive_frame(vptr, rd_curr) < 0)
stats->rx_dropped++;
} else {
- if (rd->rdesc0.RSR & RSR_CRC)
+ /* if (rd->rdesc0.RSR & RSR_CRC) BE */
+ if (wRSR & RSR_CRC) /* BE */
stats->rx_crc_errors++;
- if (rd->rdesc0.RSR & RSR_FAE)
+ /* if (rd->rdesc0.RSR & RSR_FAE) BE */
+ if (wRSR & RSR_FAE) /* BE */
stats->rx_frame_errors++;
stats->rx_dropped++;
}
- rd->inten = 1;
+ /* rd->inten = 1; BE */
+ rd->ltwo |= cpu_to_le32(BE_INT_ENABLE); /* BE */
vptr->dev->last_rx = jiffies;
@@ -1464,13 +1529,21 @@ static int velocity_rx_srv(struct veloci
static inline void velocity_rx_csum(struct rx_desc *rd, struct sk_buff *skb)
{
+ u8 bCSM;
+ HAIL("velocity_rx_csum");
skb->ip_summed = CHECKSUM_NONE;
- if (rd->rdesc1.CSM & CSM_IPKT) {
- if (rd->rdesc1.CSM & CSM_IPOK) {
- if ((rd->rdesc1.CSM & CSM_TCPKT) ||
- (rd->rdesc1.CSM & CSM_UDPKT)) {
- if (!(rd->rdesc1.CSM & CSM_TUPOK)) {
+// if (rd->rdesc1.CSM & CSM_IPKT) {
+// if (rd->rdesc1.CSM & CSM_IPOK) {
+// if ((rd->rdesc1.CSM & CSM_TCPKT) ||
+// (rd->rdesc1.CSM & CSM_UDPKT)) {
+// if (!(rd->rdesc1.CSM & CSM_TUPOK)) {
+ bCSM = (u8)(cpu_to_le32(rd->rdesc1) >> 16); /* BE */
+ if (bCSM & CSM_IPKT) {
+ if (bCSM & CSM_IPOK) {
+ if ((bCSM & CSM_TCPKT) ||
+ (bCSM & CSM_UDPKT)) {
+ if (!(bCSM & CSM_TUPOK)) { /* BE */
return;
}
}
@@ -1496,9 +1569,11 @@ static inline int velocity_rx_copy(struc
{
int ret = -1;
+ HAIL("velocity_rx_copy");
if (pkt_size < rx_copybreak) {
struct sk_buff *new_skb;
+ HAIL("velocity_rx_copy (working...)");
new_skb = dev_alloc_skb(pkt_size + 2);
if (new_skb) {
new_skb->dev = vptr->dev;
@@ -1529,10 +1604,12 @@ static inline int velocity_rx_copy(struc
static inline void velocity_iph_realign(struct velocity_info *vptr,
struct sk_buff *skb, int pkt_size)
{
+ HAIL("velocity_iph_realign");
/* FIXME - memmove ? */
if (vptr->flags & VELOCITY_FLAGS_IP_ALIGN) {
int i;
+ HAIL("velocity_iph_realign (working...)");
for (i = pkt_size; i >= 0; i--)
*(skb->data + i + 2) = *(skb->data + i);
skb_reserve(skb, 2);
@@ -1551,19 +1628,27 @@ static inline void velocity_iph_realign(
static int velocity_receive_frame(struct velocity_info *vptr, int idx)
{
void (*pci_action)(struct pci_dev *, dma_addr_t, size_t, int);
+ u16 pkt_len; /* BE */
+ u16 wRSR; /* BE */
+ struct sk_buff *skb;
struct net_device_stats *stats = &vptr->stats;
struct velocity_rd_info *rd_info = &(vptr->rd_info[idx]);
struct rx_desc *rd = &(vptr->rd_ring[idx]);
- int pkt_len = rd->rdesc0.len;
- struct sk_buff *skb;
+ /* int pkt_len = rd->rdesc0.len BE */;
+
+ pkt_len = ((cpu_to_le32(rd->rdesc0) >> 16) & 0x00003FFFUL); /* BE */
+ wRSR = (u16)(cpu_to_le32(rd->rdesc0)); /* BE */
- if (rd->rdesc0.RSR & (RSR_STP | RSR_EDP)) {
+ HAIL("velocity_receive_frame");
+ /* if (rd->rdesc0.RSR & (RSR_STP | RSR_EDP)) { BE */
+ if (wRSR & (RSR_STP | RSR_EDP)) { /* BE */
VELOCITY_PRT(MSG_LEVEL_VERBOSE, KERN_ERR " %s : the received frame span multple RDs.\n", vptr->dev->name);
stats->rx_length_errors++;
return -EINVAL;
}
- if (rd->rdesc0.RSR & RSR_MAR)
+ /* if (rd->rdesc0.RSR & RSR_MAR) BE */
+ if (wRSR & RSR_MAR) /* BE */
vptr->stats.multicast++;
skb = rd_info->skb;
@@ -1576,7 +1661,8 @@ static int velocity_receive_frame(struct
*/
if (vptr->flags & VELOCITY_FLAGS_VAL_PKT_LEN) {
- if (rd->rdesc0.RSR & RSR_RL) {
+ /* if (rd->rdesc0.RSR & RSR_RL) { BE */
+ if (wRSR & RSR_RL) { /* BE */
stats->rx_length_errors++;
return -EINVAL;
}
@@ -1620,6 +1706,7 @@ static int velocity_alloc_rx_buf(struct
struct rx_desc *rd = &(vptr->rd_ring[idx]);
struct velocity_rd_info *rd_info = &(vptr->rd_info[idx]);
+ HAIL("velocity_alloc_rx_buf");
rd_info->skb = dev_alloc_skb(vptr->rx_buf_sz + 64);
if (rd_info->skb == NULL)
return -ENOMEM;
@@ -1637,10 +1724,14 @@ static int velocity_alloc_rx_buf(struct
*/
*((u32 *) & (rd->rdesc0)) = 0;
- rd->len = cpu_to_le32(vptr->rx_buf_sz);
- rd->inten = 1;
+ /* rd->len = cpu_to_le32(vptr->rx_buf_sz); BE */
+ /* rd->inten = 1; BE */
rd->pa_low = cpu_to_le32(rd_info->skb_dma);
- rd->pa_high = 0;
+ /* rd->pa_high = 0; BE */
+ rd->ltwo &= cpu_to_le32(0xC000FFFFUL); /* BE */
+ rd->ltwo |= cpu_to_le32((vptr->rx_buf_sz << 16)); /* BE */
+ rd->ltwo |= cpu_to_le32(BE_INT_ENABLE); /* BE */
+ rd->ltwo &= cpu_to_le32(0xFFFF0000UL); /* BE */
return 0;
}
@@ -1661,9 +1752,11 @@ static int velocity_tx_srv(struct veloci
int full = 0;
int idx;
int works = 0;
+ u16 wTSR; /* BE */
struct velocity_td_info *tdinfo;
struct net_device_stats *stats = &vptr->stats;
+ HAILS("velocity_tx_srv", status);
for (qnum = 0; qnum < vptr->num_txq; qnum++) {
for (idx = vptr->td_tail[qnum]; vptr->td_used[qnum] > 0;
idx = (idx + 1) % vptr->options.numtx) {
@@ -1674,22 +1767,29 @@ static int velocity_tx_srv(struct veloci
td = &(vptr->td_rings[qnum][idx]);
tdinfo = &(vptr->td_infos[qnum][idx]);
- if (td->tdesc0.owner == OWNED_BY_NIC)
+ /* if (td->tdesc0.owner == OWNED_BY_NIC) BE */
+ if (td->tdesc0 & cpu_to_le32(BE_OWNED_BY_NIC)) /* BE */
break;
if ((works++ > 15))
break;
- if (td->tdesc0.TSR & TSR0_TERR) {
+ wTSR = (u16)cpu_to_le32(td->tdesc0);
+ /* if (td->tdesc0.TSR & TSR0_TERR) { BE */
+ if (wTSR & TSR0_TERR) { /* BE */
stats->tx_errors++;
stats->tx_dropped++;
- if (td->tdesc0.TSR & TSR0_CDH)
+ /* if (td->tdesc0.TSR & TSR0_CDH) BE */
+ if (wTSR & TSR0_CDH) /* BE */
stats->tx_heartbeat_errors++;
- if (td->tdesc0.TSR & TSR0_CRS)
+ /* if (td->tdesc0.TSR & TSR0_CRS) BE */
+ if (wTSR & TSR0_CRS) /* BE */
stats->tx_carrier_errors++;
- if (td->tdesc0.TSR & TSR0_ABT)
+ /* if (td->tdesc0.TSR & TSR0_ABT) BE */
+ if (wTSR & TSR0_ABT) /* BE */
stats->tx_aborted_errors++;
- if (td->tdesc0.TSR & TSR0_OWC)
+ /* if (td->tdesc0.TSR & TSR0_OWC) BE */
+ if (wTSR & TSR0_OWC) /* BE */
stats->tx_window_errors++;
} else {
stats->tx_packets++;
@@ -1778,6 +1878,7 @@ static void velocity_print_link_status(s
static void velocity_error(struct velocity_info *vptr, int status)
{
+ HAILS("velocity_error", status);
if (status & ISR_TXSTLI) {
struct mac_regs __iomem * regs = vptr->mac_regs;
@@ -1867,6 +1968,7 @@ static void velocity_free_tx_buf(struct
struct sk_buff *skb = tdinfo->skb;
int i;
+ HAIL("velocity_free_tx_buf");
/*
* Don't unmap the pre-allocated tx_bufs
*/
@@ -2067,6 +2169,7 @@ static int velocity_xmit(struct sk_buff
struct velocity_td_info *tdinfo;
unsigned long flags;
int index;
+ u32 lbufsz; /* BE */
int pktlen = skb->len;
@@ -2083,9 +2186,18 @@ static int velocity_xmit(struct sk_buff
td_ptr = &(vptr->td_rings[qnum][index]);
tdinfo = &(vptr->td_infos[qnum][index]);
- td_ptr->tdesc1.TCPLS = TCPLS_NORMAL;
- td_ptr->tdesc1.TCR = TCR0_TIC;
- td_ptr->td_buf[0].queue = 0;
+ td_ptr->tdesc0 = 0x00000000UL; /* BE */
+ td_ptr->tdesc1 = 0x00000000UL; /* BE */
+
+ /* td_ptr->tdesc1.TCPLS = TCPLS_NORMAL; BE */
+ td_ptr->tdesc1 &= cpu_to_le32(0xfcffffffUL); /* BE */
+ td_ptr->tdesc1 |= cpu_to_le32(((u32)TCPLS_NORMAL) << 24); /* BE */
+
+ /* td_ptr->tdesc1.TCR = TCR0_TIC; BE */
+ td_ptr->tdesc1 |= cpu_to_le32(BE_TCR_TIC); /* BE */
+
+ /* td_ptr->td_buf[0].queue = 0; BE */
+ td_ptr->td_buf[0].ltwo &= cpu_to_le32(~BE_QUEUE_ENABLE); /* BE */
/*
* Pad short frames.
@@ -2097,20 +2209,36 @@ static int velocity_xmit(struct sk_buff
memset(tdinfo->buf + skb->len, 0, ETH_ZLEN - skb->len);
tdinfo->skb = skb;
tdinfo->skb_dma[0] = tdinfo->buf_dma;
- td_ptr->tdesc0.pktsize = pktlen;
+ /* td_ptr->tdesc0.pktsize = pktlen; */
+ td_ptr->tdesc0 &= cpu_to_le32(0xc000ffffUL); /* BE */
+ lbufsz = pktlen; /* Assign, and make sure it's unsigned 32 bits - BE */
+ lbufsz = lbufsz << 16; /* BE - shift over */
+ td_ptr->tdesc0 |= cpu_to_le32(lbufsz); /* BE */
+
td_ptr->td_buf[0].pa_low = cpu_to_le32(tdinfo->skb_dma[0]);
- td_ptr->td_buf[0].pa_high = 0;
- td_ptr->td_buf[0].bufsize = td_ptr->tdesc0.pktsize;
+ /* td_ptr->td_buf[0].pa_high = 0; */
+ /* td_ptr->td_buf[0].bufsize = td_ptr->tdesc0.pktsize; */
+ td_ptr->td_buf[0].ltwo = cpu_to_le32(lbufsz); /* BE */
tdinfo->nskb_dma = 1;
- td_ptr->tdesc1.CMDZ = 2;
+ /* td_ptr->tdesc1.CMDZ = 2; */
+ td_ptr->tdesc1 &= cpu_to_le32(0x0fffffffUL); /* BE */
+ td_ptr->tdesc1 |= cpu_to_le32(((u32)0x2) << 28); /* BE */
} else
#ifdef VELOCITY_ZERO_COPY_SUPPORT
+ /*
+ * BE - NOTE on the VELOCITY_ZERO_COPY_SUPPORT:
+ * This block of code has NOT been patched up for BE support, as
+ * it is certainly broken -- if it compiles at all. Since the BE
+ * fixes depend on the broken code, attempts to convert to BE support
+ * would almost certainly confuse more than help.
+ */
if (skb_shinfo(skb)->nr_frags > 0) {
int nfrags = skb_shinfo(skb)->nr_frags;
tdinfo->skb = skb;
if (nfrags > 6) {
skb_copy_from_linear_data(skb, tdinfo->buf, skb->len);
tdinfo->skb_dma[0] = tdinfo->buf_dma;
+ /* BE: Er, exactly what value are we assigning in this next line? */
td_ptr->tdesc0.pktsize =
td_ptr->td_buf[0].pa_low = cpu_to_le32(tdinfo->skb_dma[0]);
td_ptr->td_buf[0].pa_high = 0;
@@ -2127,6 +2255,7 @@ static int velocity_xmit(struct sk_buff
/* FIXME: support 48bit DMA later */
td_ptr->td_buf[i].pa_low = cpu_to_le32(tdinfo->skb_dma);
td_ptr->td_buf[i].pa_high = 0;
+ /* BE: This next line can't be right: */
td_ptr->td_buf[i].bufsize = skb->len->skb->data_len;
for (i = 0; i < nfrags; i++) {
@@ -2144,7 +2273,7 @@ static int velocity_xmit(struct sk_buff
}
} else
-#endif
+#endif /* (broken) VELOCITY_ZERO_COPY_SUPPORT */
{
/*
* Map the linear network buffer into PCI space and
@@ -2152,19 +2281,29 @@ static int velocity_xmit(struct sk_buff
*/
tdinfo->skb = skb;
tdinfo->skb_dma[0] = pci_map_single(vptr->pdev, skb->data, pktlen, PCI_DMA_TODEVICE);
- td_ptr->tdesc0.pktsize = pktlen;
+ /* td_ptr->tdesc0.pktsize = pktlen; BE */
+ td_ptr->tdesc0 &= cpu_to_le32(0xc000ffffUL); /* BE */
+ lbufsz = pktlen; /* Assign, and make sure it's unsigned 32 bits - BE */
+ lbufsz = lbufsz << 16; /* BE */
+ td_ptr->tdesc0 |= cpu_to_le32(lbufsz); /* BE */
td_ptr->td_buf[0].pa_low = cpu_to_le32(tdinfo->skb_dma[0]);
- td_ptr->td_buf[0].pa_high = 0;
- td_ptr->td_buf[0].bufsize = td_ptr->tdesc0.pktsize;
+ /* td_ptr->td_buf[0].pa_high = 0; BE */
+ /* td_ptr->td_buf[0].bufsize = td_ptr->tdesc0.pktsize; BE */
+ td_ptr->td_buf[0].ltwo = cpu_to_le32(lbufsz); /* BE */
tdinfo->nskb_dma = 1;
- td_ptr->tdesc1.CMDZ = 2;
+ /* td_ptr->tdesc1.CMDZ = 2; BE */
+ td_ptr->tdesc1 &= cpu_to_le32(0x0fffffffUL); /* BE */
+ td_ptr->tdesc1 |= cpu_to_le32(((u32)0x2) << 28); /* BE */
}
if (vptr->vlgrp && vlan_tx_tag_present(skb)) {
- td_ptr->tdesc1.pqinf.VID = vlan_tx_tag_get(skb);
- td_ptr->tdesc1.pqinf.priority = 0;
- td_ptr->tdesc1.pqinf.CFI = 0;
- td_ptr->tdesc1.TCR |= TCR0_VETAG;
+ /* td_ptr->tdesc1.pqinf.VID = vlan_tx_tag_get(skb); BE */
+ /* td_ptr->tdesc1.pqinf.priority = 0; BE */
+ /* td_ptr->tdesc1.pqinf.CFI = 0; BE */
+ /* td_ptr->tdesc1.TCR |= TCR0_VETAG; BE */
+ td_ptr->tdesc1 &= cpu_to_le32(0xFFFF0000UL); /* BE */
+ td_ptr->tdesc1 |= cpu_to_le32(vlan_tx_tag_get(skb)); /* BE */
+ td_ptr->tdesc1 |= cpu_to_le32(BE_TCR_VETAG); /* BE */
}
/*
@@ -2174,26 +2313,34 @@ static int velocity_xmit(struct sk_buff
&& (skb->ip_summed == CHECKSUM_PARTIAL)) {
const struct iphdr *ip = ip_hdr(skb);
if (ip->protocol == IPPROTO_TCP)
- td_ptr->tdesc1.TCR |= TCR0_TCPCK;
+ /* td_ptr->tdesc1.TCR |= TCR0_TCPCK; BE */
+ td_ptr->tdesc1 |= cpu_to_le32(BE_TCR_TCPCK); /* BE */
else if (ip->protocol == IPPROTO_UDP)
- td_ptr->tdesc1.TCR |= (TCR0_UDPCK);
- td_ptr->tdesc1.TCR |= TCR0_IPCK;
- }
+ /* td_ptr->tdesc1.TCR |= (TCR0_UDPCK); BE */
+ td_ptr->tdesc1 |= cpu_to_le32(BE_TCR_UDPCK); /* BE */
+ /* td_ptr->tdesc1.TCR |= TCR0_IPCK; BE */
+ td_ptr->tdesc1 |= cpu_to_le32(BE_TCR_IPCK); /* BE */
+ }
{
int prev = index - 1;
if (prev < 0)
prev = vptr->options.numtx - 1;
- td_ptr->tdesc0.owner = OWNED_BY_NIC;
+ /* td_ptr->tdesc0.owner = OWNED_BY_NIC; BE */
+ td_ptr->tdesc0 |= cpu_to_le32(BE_OWNED_BY_NIC); /* BE */
vptr->td_used[qnum]++;
vptr->td_curr[qnum] = (index + 1) % vptr->options.numtx;
if (AVAIL_TD(vptr, qnum) < 1)
netif_stop_queue(dev);
- td_ptr = &(vptr->td_rings[qnum][prev]);
- td_ptr->td_buf[0].queue = 1;
+ td_ptr = &(vptr->td_rings[qnum][prev]);
+ /* td_ptr->td_buf[0].queue = 1; BE */
+ td_ptr->td_buf[0].ltwo |= cpu_to_le32(BE_QUEUE_ENABLE); /* BE */
+ if (vdebug&2) printk(KERN_NOTICE "velocity_xmit: (%s) len=%d idx=%d tdesc0=0x%x tdesc1=0x%x ltwo=0x%x\n",
+ (pktlen<ETH_ZLEN) ? "short" : "normal", pktlen, index,
+ td_ptr->tdesc0, td_ptr->tdesc1, td_ptr->td_buf[0].ltwo);
mac_tx_queue_wake(vptr->mac_regs, qnum);
}
dev->trans_start = jiffies;
@@ -2219,7 +2366,7 @@ static int velocity_intr(int irq, void *
u32 isr_status;
int max_count = 0;
-
+ HAIL("velocity_intr");
spin_lock(&vptr->lock);
isr_status = mac_read_isr(vptr->mac_regs);
@@ -2238,7 +2385,10 @@ static int velocity_intr(int irq, void *
while (isr_status != 0) {
mac_write_isr(vptr->mac_regs, isr_status);
- if (isr_status & (~(ISR_PRXI | ISR_PPRXI | ISR_PTXI | ISR_PPTXI)))
+ HAILS("velocity_intr",isr_status);
+ /* MJW - velocity_error is ALWAYS called; need to mask off some other flags */
+ /* if (isr_status & (~(ISR_PRXI | ISR_PPRXI | ISR_PTXI | ISR_PPTXI))) */
+ if (isr_status & (~(ISR_PRXI | ISR_PPRXI | ISR_PTXI | ISR_PPTXI | ISR_PTX0I | ISR_ISR0)))
velocity_error(vptr, isr_status);
if (isr_status & (ISR_PRXI | ISR_PPRXI))
max_count += velocity_rx_srv(vptr, isr_status);
@@ -2276,6 +2426,7 @@ static void velocity_set_multi(struct ne
int i;
struct dev_mc_list *mclist;
+ HAIL("velocity_set_multi");
if (dev->flags & IFF_PROMISC) { /* Set promiscuous. */
writel(0xffffffff, &regs->MARCAM[0]);
writel(0xffffffff, &regs->MARCAM[4]);
@@ -2319,6 +2470,7 @@ static struct net_device_stats *velocity
{
struct velocity_info *vptr = netdev_priv(dev);
+ HAIL("net_device_stats");
/* If the hardware is down, don't touch MII */
if(!netif_running(dev))
return &vptr->stats;
@@ -2363,6 +2515,7 @@ static int velocity_ioctl(struct net_dev
struct velocity_info *vptr = netdev_priv(dev);
int ret;
+ HAIL("velocity_ioctl");
/* If we are asked for information and the device is power
saving then we need to bring the device back up to talk to it */
@@ -2581,6 +2734,8 @@ static int velocity_mii_read(struct mac_
{
u16 ww;
+ HAIL("velocity_mii_read");
+ HAIL("velocity_mii_write");
/*
* Disable MIICR_MAUTO, so that mii addr can be set normally
*/
Index: linux-2.6.24.7/drivers/net/via-velocity.h
===================================================================
--- linux-2.6.24.7.orig/drivers/net/via-velocity.h
+++ linux-2.6.24.7/drivers/net/via-velocity.h
@@ -196,64 +196,70 @@
* Receive descriptor
*/
-struct rdesc0 {
- u16 RSR; /* Receive status */
- u16 len:14; /* Received packet length */
- u16 reserved:1;
- u16 owner:1; /* Who owns this buffer ? */
-};
-
-struct rdesc1 {
- u16 PQTAG;
- u8 CSM;
- u8 IPKT;
-};
+//struct rdesc0 {
+// u16 RSR; /* Receive status */
+// u16 len:14; /* Received packet length */
+// u16 reserved:1;
+// u16 owner:1; /* Who owns this buffer ? */
+//};
+
+//struct rdesc1 {
+// u16 PQTAG;
+// u8 CSM;
+// u8 IPKT;
+//};
struct rx_desc {
- struct rdesc0 rdesc0;
- struct rdesc1 rdesc1;
+// struct rdesc0 rdesc0;
+// struct rdesc1 rdesc1;
+ u32 rdesc0;
+ u32 rdesc1;
u32 pa_low; /* Low 32 bit PCI address */
- u16 pa_high; /* Next 16 bit PCI address (48 total) */
- u16 len:15; /* Frame size */
- u16 inten:1; /* Enable interrupt */
+// u16 pa_high; /* Next 16 bit PCI address (48 total) */
+// u16 len:15; /* Frame size */
+// u16 inten:1; /* Enable interrupt */
+ u32 ltwo;
} __attribute__ ((__packed__));
/*
* Transmit descriptor
*/
-struct tdesc0 {
- u16 TSR; /* Transmit status register */
- u16 pktsize:14; /* Size of frame */
- u16 reserved:1;
- u16 owner:1; /* Who owns the buffer */
-};
-
-struct pqinf { /* Priority queue info */
- u16 VID:12;
- u16 CFI:1;
- u16 priority:3;
-} __attribute__ ((__packed__));
-
-struct tdesc1 {
- struct pqinf pqinf;
- u8 TCR;
- u8 TCPLS:2;
- u8 reserved:2;
- u8 CMDZ:4;
-} __attribute__ ((__packed__));
+//struct tdesc0 {
+// u16 TSR; /* Transmit status register */
+// u16 pktsize:14; /* Size of frame */
+// u16 reserved:1;
+// u16 owner:1; /* Who owns the buffer */
+//};
+
+//struct pqinf { /* Priority queue info */
+// u16 VID:12;
+// u16 CFI:1;
+// u16 priority:3;
+//} __attribute__ ((__packed__));
+
+//struct tdesc1 {
+// struct pqinf pqinf;
+// u8 TCR;
+// u8 TCPLS:2;
+// u8 reserved:2;
+// u8 CMDZ:4;
+//} __attribute__ ((__packed__));
struct td_buf {
u32 pa_low;
- u16 pa_high;
- u16 bufsize:14;
- u16 reserved:1;
- u16 queue:1;
+// u16 pa_high;
+// u16 bufsize:14;
+// u16 reserved:1;
+// u16 queue:1;
+ u32 ltwo;
} __attribute__ ((__packed__));
struct tx_desc {
- struct tdesc0 tdesc0;
- struct tdesc1 tdesc1;
+// struct tdesc0 tdesc0;
+// struct tdesc1 tdesc1;
+ u32 tdesc0;
+ u32 tdesc1;
struct td_buf td_buf[7];
};
@@ -279,6 +285,16 @@ enum velocity_owner {
OWNED_BY_NIC = 1
};
+/* Constants added for the BE fixes */
+#define BE_OWNED_BY_NIC 0x80000000UL
+#define BE_INT_ENABLE 0x80000000UL
+#define BE_QUEUE_ENABLE 0x80000000UL
+#define BE_TCR_TIC 0x00800000UL
+#define BE_TCR_VETAG 0x00200000UL
+#define BE_TCR_TCPCK 0x00040000UL
+#define BE_TCR_UDPCK 0x00080000UL
+#define BE_TCR_IPCK 0x00100000UL
+
/*
* MAC registers and macros.
@@ -1512,6 +1528,7 @@ enum velocity_flow_cntl_type {
};
struct velocity_opt {
+ int velo_debug; /* debug flag */
int numrx; /* Number of RX descriptors */
int numtx; /* Number of TX descriptors */
enum speed_opt spd_dpx; /* Media link mode */

View File

@ -1,17 +0,0 @@
Index: linux-2.6.24.7/drivers/char/random.c
===================================================================
--- linux-2.6.24.7.orig/drivers/char/random.c
+++ linux-2.6.24.7/drivers/char/random.c
@@ -248,9 +248,9 @@
/*
* Configuration information
*/
-#define INPUT_POOL_WORDS 128
-#define OUTPUT_POOL_WORDS 32
-#define SEC_XFER_SIZE 512
+#define INPUT_POOL_WORDS 256
+#define OUTPUT_POOL_WORDS 64
+#define SEC_XFER_SIZE 1024
/*
* The minimum number of bits of entropy before we wake up a read on

View File

@ -1,42 +0,0 @@
Index: linux-2.6.24.7/arch/arm/mach-ixp4xx/gateway7001-setup.c
===================================================================
--- linux-2.6.24.7.orig/arch/arm/mach-ixp4xx/gateway7001-setup.c
+++ linux-2.6.24.7/arch/arm/mach-ixp4xx/gateway7001-setup.c
@@ -76,9 +76,36 @@ static struct platform_device gateway700
.resource = &gateway7001_uart_resource,
};
+/* Built-in 10/100 Ethernet MAC interfaces */
+static struct eth_plat_info gateway7001_plat_eth[] = {
+ {
+ .phy = 1,
+ .rxq = 3,
+ .txreadyq = 20,
+ }, {
+ .phy = 2,
+ .rxq = 4,
+ .txreadyq = 21,
+ }
+};
+
+static struct platform_device gateway7001_eth[] = {
+ {
+ .name = "ixp4xx_eth",
+ .id = IXP4XX_ETH_NPEB,
+ .dev.platform_data = gateway7001_plat_eth,
+ }, {
+ .name = "ixp4xx_eth",
+ .id = IXP4XX_ETH_NPEC,
+ .dev.platform_data = gateway7001_plat_eth + 1,
+ }
+};
+
static struct platform_device *gateway7001_devices[] __initdata = {
&gateway7001_flash,
- &gateway7001_uart
+ &gateway7001_uart,
+ &gateway7001_eth[0],
+ &gateway7001_eth[1],
};
static void __init gateway7001_init(void)

View File

@ -1,32 +0,0 @@
Index: linux-2.6.24.7/arch/arm/mach-ixp4xx/wg302v2-setup.c
===================================================================
--- linux-2.6.24.7.orig/arch/arm/mach-ixp4xx/wg302v2-setup.c
+++ linux-2.6.24.7/arch/arm/mach-ixp4xx/wg302v2-setup.c
@@ -77,9 +77,27 @@ static struct platform_device wg302v2_ua
.resource = &wg302v2_uart_resource,
};
+/* Built-in 10/100 Ethernet MAC interfaces */
+static struct eth_plat_info wg302_plat_eth[] = {
+ {
+ .phy = 8,
+ .rxq = 3,
+ .txreadyq = 20,
+ }
+};
+
+static struct platform_device wg302_eth[] = {
+ {
+ .name = "ixp4xx_eth",
+ .id = IXP4XX_ETH_NPEB,
+ .dev.platform_data = wg302_plat_eth,
+ }
+};
+
static struct platform_device *wg302v2_devices[] __initdata = {
&wg302v2_flash,
&wg302v2_uart,
+ &wg302_eth[0],
};
static void __init wg302v2_init(void)

View File

@ -1,297 +0,0 @@
Index: linux-2.6.24.7/arch/arm/mach-ixp4xx/Kconfig
===================================================================
--- linux-2.6.24.7.orig/arch/arm/mach-ixp4xx/Kconfig
+++ linux-2.6.24.7/arch/arm/mach-ixp4xx/Kconfig
@@ -57,6 +57,14 @@ config MACH_WG302V2
WG302 v2 or WAG302 v2 Access Points. For more information
on this platform, see http://openwrt.org
+config MACH_PRONGHORNMETRO
+ bool "Pronghorn Metro"
+ select PCI
+ help
+ Say 'Y' here if you want your kernel to support the ADI
+ Engineering Pronghorn Metro Platform. For more
+ information on this platform, see <file:Documentation/arm/IXP4xx>.
+
config ARCH_IXDP425
bool "IXDP425"
help
Index: linux-2.6.24.7/arch/arm/mach-ixp4xx/Makefile
===================================================================
--- linux-2.6.24.7.orig/arch/arm/mach-ixp4xx/Makefile
+++ linux-2.6.24.7/arch/arm/mach-ixp4xx/Makefile
@@ -16,6 +16,7 @@ obj-pci-$(CONFIG_MACH_DSMG600) += dsmg6
obj-pci-$(CONFIG_MACH_GATEWAY7001) += gateway7001-pci.o
obj-pci-$(CONFIG_MACH_WG302V2) += wg302v2-pci.o
obj-pci-$(CONFIG_MACH_FSG) += fsg-pci.o
+obj-pci-$(CONFIG_MACH_PRONGHORNMETRO) += pronghornmetro-pci.o
obj-y += common.o
@@ -30,5 +31,6 @@ obj-$(CONFIG_MACH_DSMG600) += dsmg6
obj-$(CONFIG_MACH_GATEWAY7001) += gateway7001-setup.o
obj-$(CONFIG_MACH_WG302V2) += wg302v2-setup.o
obj-$(CONFIG_MACH_FSG) += fsg-setup.o
+obj-$(CONFIG_MACH_PRONGHORNMETRO) += pronghornmetro-setup.o
obj-$(CONFIG_PCI) += $(obj-pci-$(CONFIG_PCI)) common-pci.o
Index: linux-2.6.24.7/arch/arm/mach-ixp4xx/pronghornmetro-pci.c
===================================================================
--- /dev/null
+++ linux-2.6.24.7/arch/arm/mach-ixp4xx/pronghornmetro-pci.c
@@ -0,0 +1,74 @@
+/*
+ * arch/arch/mach-ixp4xx/pronghornmetro-pci.c
+ *
+ * PCI setup routines for ADI Engineering Pronghorn Metro
+ *
+ * Copyright (C) 2007 Imre Kaloz <kaloz@openwrt.org>
+ *
+ * based on coyote-pci.c:
+ * Copyright (C) 2002 Jungo Software Technologies.
+ * Copyright (C) 2003 MontaVista Softwrae, Inc.
+ *
+ * Maintainer: Imre Kaloz <kaloz@openwrt.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ */
+
+#include <linux/kernel.h>
+#include <linux/pci.h>
+#include <linux/init.h>
+#include <linux/irq.h>
+
+#include <asm/mach-types.h>
+#include <asm/hardware.h>
+#include <asm/irq.h>
+
+#include <asm/mach/pci.h>
+
+extern void ixp4xx_pci_preinit(void);
+extern int ixp4xx_setup(int nr, struct pci_sys_data *sys);
+extern struct pci_bus *ixp4xx_scan_bus(int nr, struct pci_sys_data *sys);
+
+void __init pronghornmetro_pci_preinit(void)
+{
+ set_irq_type(IRQ_IXP4XX_GPIO4, IRQT_LOW);
+ set_irq_type(IRQ_IXP4XX_GPIO6, IRQT_LOW);
+ set_irq_type(IRQ_IXP4XX_GPIO11, IRQT_LOW);
+ set_irq_type(IRQ_IXP4XX_GPIO1, IRQT_LOW);
+
+ ixp4xx_pci_preinit();
+}
+
+static int __init pronghornmetro_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
+{
+ if (slot == 13)
+ return IRQ_IXP4XX_GPIO4;
+ else if (slot == 14)
+ return IRQ_IXP4XX_GPIO6;
+ else if (slot == 15)
+ return IRQ_IXP4XX_GPIO11;
+ else if (slot == 16)
+ return IRQ_IXP4XX_GPIO1;
+ else return -1;
+}
+
+struct hw_pci pronghornmetro_pci __initdata = {
+ .nr_controllers = 1,
+ .preinit = pronghornmetro_pci_preinit,
+ .swizzle = pci_std_swizzle,
+ .setup = ixp4xx_setup,
+ .scan = ixp4xx_scan_bus,
+ .map_irq = pronghornmetro_map_irq,
+};
+
+int __init pronghornmetro_pci_init(void)
+{
+ if (machine_is_pronghorn_metro())
+ pci_common_init(&pronghornmetro_pci);
+ return 0;
+}
+
+subsys_initcall(pronghornmetro_pci_init);
Index: linux-2.6.24.7/arch/arm/mach-ixp4xx/pronghornmetro-setup.c
===================================================================
--- /dev/null
+++ linux-2.6.24.7/arch/arm/mach-ixp4xx/pronghornmetro-setup.c
@@ -0,0 +1,147 @@
+/*
+ * arch/arm/mach-ixp4xx/pronghornmetro-setup.c
+ *
+ * Board setup for the ADI Engineering Pronghorn Metro
+ *
+ * Copyright (C) 2007 Imre Kaloz <Kaloz@openwrt.org>
+ *
+ * based on coyote-setup.c:
+ * Copyright (C) 2003-2005 MontaVista Software, Inc.
+ *
+ * Author: Imre Kaloz <Kaloz@openwrt.org>
+ */
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/device.h>
+#include <linux/serial.h>
+#include <linux/tty.h>
+#include <linux/serial_8250.h>
+#include <linux/slab.h>
+
+#include <asm/types.h>
+#include <asm/setup.h>
+#include <asm/memory.h>
+#include <asm/hardware.h>
+#include <asm/irq.h>
+#include <asm/mach-types.h>
+#include <asm/mach/arch.h>
+#include <asm/mach/flash.h>
+
+static struct flash_platform_data pronghornmetro_flash_data = {
+ .map_name = "cfi_probe",
+ .width = 2,
+};
+
+static struct resource pronghornmetro_flash_resource = {
+ .flags = IORESOURCE_MEM,
+};
+
+static struct platform_device pronghornmetro_flash = {
+ .name = "IXP4XX-Flash",
+ .id = 0,
+ .dev = {
+ .platform_data = &pronghornmetro_flash_data,
+ },
+ .num_resources = 1,
+ .resource = &pronghornmetro_flash_resource,
+};
+
+static struct resource pronghornmetro_uart_resource = {
+ .start = IXP4XX_UART2_BASE_PHYS,
+ .end = IXP4XX_UART2_BASE_PHYS + 0x0fff,
+ .flags = IORESOURCE_MEM,
+};
+
+static struct plat_serial8250_port pronghornmetro_uart_data[] = {
+ {
+ .mapbase = IXP4XX_UART2_BASE_PHYS,
+ .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET,
+ .irq = IRQ_IXP4XX_UART2,
+ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
+ .iotype = UPIO_MEM,
+ .regshift = 2,
+ .uartclk = IXP4XX_UART_XTAL,
+ },
+ { },
+};
+
+static struct platform_device pronghornmetro_uart = {
+ .name = "serial8250",
+ .id = PLAT8250_DEV_PLATFORM,
+ .dev = {
+ .platform_data = pronghornmetro_uart_data,
+ },
+ .num_resources = 1,
+ .resource = &pronghornmetro_uart_resource,
+};
+
+static struct resource pronghornmetro_pata_resources[] = {
+ {
+ .flags = IORESOURCE_MEM
+ },
+ {
+ .flags = IORESOURCE_MEM,
+ },
+ {
+ .name = "intrq",
+ .start = IRQ_IXP4XX_GPIO0,
+ .end = IRQ_IXP4XX_GPIO0,
+ .flags = IORESOURCE_IRQ,
+ },
+};
+
+static struct ixp4xx_pata_data pronghornmetro_pata_data = {
+ .cs0_bits = 0xbfff0043,
+ .cs1_bits = 0xbfff0043,
+};
+
+static struct platform_device pronghornmetro_pata = {
+ .name = "pata_ixp4xx_cf",
+ .id = 0,
+ .dev.platform_data = &pronghornmetro_pata_data,
+ .num_resources = ARRAY_SIZE(pronghornmetro_pata_resources),
+ .resource = pronghornmetro_pata_resources,
+};
+
+static struct platform_device *pronghornmetro_devices[] __initdata = {
+ &pronghornmetro_flash,
+ &pronghornmetro_uart,
+};
+
+static void __init pronghornmetro_init(void)
+{
+ ixp4xx_sys_init();
+
+ pronghornmetro_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
+ pronghornmetro_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_16M - 1;
+
+ *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE;
+ *IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0;
+
+ platform_add_devices(pronghornmetro_devices, ARRAY_SIZE(pronghornmetro_devices));
+
+ pronghornmetro_pata_resources[0].start = IXP4XX_EXP_BUS_BASE(1);
+ pronghornmetro_pata_resources[0].end = IXP4XX_EXP_BUS_END(1);
+
+ pronghornmetro_pata_resources[1].start = IXP4XX_EXP_BUS_BASE(2);
+ pronghornmetro_pata_resources[1].end = IXP4XX_EXP_BUS_END(2);
+
+ pronghornmetro_pata_data.cs0_cfg = IXP4XX_EXP_CS1;
+ pronghornmetro_pata_data.cs1_cfg = IXP4XX_EXP_CS2;
+
+ platform_device_register(&pronghornmetro_pata);
+}
+
+#ifdef CONFIG_MACH_PRONGHORNMETRO
+MACHINE_START(PRONGHORNMETRO, "ADI Engineering Pronghorn Metro")
+ /* Maintainer: Imre Kaloz <kaloz@openwrt.org> */
+ .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
+ .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
+ .map_io = ixp4xx_map_io,
+ .init_irq = ixp4xx_init_irq,
+ .timer = &ixp4xx_timer,
+ .boot_params = 0x0100,
+ .init_machine = pronghornmetro_init,
+MACHINE_END
+#endif
Index: linux-2.6.24.7/Documentation/arm/IXP4xx
===================================================================
--- linux-2.6.24.7.orig/Documentation/arm/IXP4xx
+++ linux-2.6.24.7/Documentation/arm/IXP4xx
@@ -111,6 +111,9 @@ http://www.adiengineering.com/productsCo
the platform has two mini-PCI slots used for 802.11[bga] cards.
Finally, there is an IDE port hanging off the expansion bus.
+ADI Engineering Pronghorn Metro Platform
+http://www.adiengineering.com/php-bin/ecomm4/productDisplay.php?category_id=30&product_id=85
+
Gateworks Avila Network Platform
http://www.gateworks.com/avila_sbc.htm
Index: linux-2.6.24.7/include/asm-arm/arch-ixp4xx/uncompress.h
===================================================================
--- linux-2.6.24.7.orig/include/asm-arm/arch-ixp4xx/uncompress.h
+++ linux-2.6.24.7/include/asm-arm/arch-ixp4xx/uncompress.h
@@ -41,7 +41,8 @@ static __inline__ void __arch_decomp_set
* Some boards are using UART2 as console
*/
if (machine_is_adi_coyote() || machine_is_gtwx5715() ||
- machine_is_gateway7001() || machine_is_wg302v2())
+ machine_is_gateway7001() || machine_is_wg302v2() ||
+ machine_is_pronghorn_metro())
uart_base = (volatile u32*) IXP4XX_UART2_BASE_PHYS;
else
uart_base = (volatile u32*) IXP4XX_UART1_BASE_PHYS;

View File

@ -1,41 +0,0 @@
Index: linux-2.6.24.7/arch/arm/mach-ixp4xx/pronghornmetro-setup.c
===================================================================
--- linux-2.6.24.7.orig/arch/arm/mach-ixp4xx/pronghornmetro-setup.c
+++ linux-2.6.24.7/arch/arm/mach-ixp4xx/pronghornmetro-setup.c
@@ -104,9 +104,36 @@ static struct platform_device pronghornm
.resource = pronghornmetro_pata_resources,
};
+/* Built-in 10/100 Ethernet MAC interfaces */
+static struct eth_plat_info pronghornmetro_plat_eth[] = {
+ {
+ .phy = 0,
+ .rxq = 3,
+ .txreadyq = 20,
+ }, {
+ .phy = 1,
+ .rxq = 4,
+ .txreadyq = 21,
+ }
+};
+
+static struct platform_device pronghornmetro_eth[] = {
+ {
+ .name = "ixp4xx_eth",
+ .id = IXP4XX_ETH_NPEB,
+ .dev.platform_data = pronghornmetro_plat_eth,
+ }, {
+ .name = "ixp4xx_eth",
+ .id = IXP4XX_ETH_NPEC,
+ .dev.platform_data = pronghornmetro_plat_eth + 1,
+ }
+};
+
static struct platform_device *pronghornmetro_devices[] __initdata = {
&pronghornmetro_flash,
&pronghornmetro_uart,
+ &pronghornmetro_eth[0],
+ &pronghornmetro_eth[1],
};
static void __init pronghornmetro_init(void)

View File

@ -1,189 +0,0 @@
Index: linux-2.6.24.7/arch/arm/mach-ixp4xx/Kconfig
===================================================================
--- linux-2.6.24.7.orig/arch/arm/mach-ixp4xx/Kconfig
+++ linux-2.6.24.7/arch/arm/mach-ixp4xx/Kconfig
@@ -65,6 +65,14 @@ config MACH_PRONGHORNMETRO
Engineering Pronghorn Metro Platform. For more
information on this platform, see <file:Documentation/arm/IXP4xx>.
+config MACH_COMPEX
+ bool "Compex WP18 / NP18A"
+ select PCI
+ help
+ Say 'Y' here if you want your kernel to support Compex'
+ WP18 or NP18A boards. For more information on this
+ platform, see http://openwrt.org
+
config ARCH_IXDP425
bool "IXDP425"
help
Index: linux-2.6.24.7/arch/arm/mach-ixp4xx/Makefile
===================================================================
--- linux-2.6.24.7.orig/arch/arm/mach-ixp4xx/Makefile
+++ linux-2.6.24.7/arch/arm/mach-ixp4xx/Makefile
@@ -17,6 +17,7 @@ obj-pci-$(CONFIG_MACH_GATEWAY7001) += ga
obj-pci-$(CONFIG_MACH_WG302V2) += wg302v2-pci.o
obj-pci-$(CONFIG_MACH_FSG) += fsg-pci.o
obj-pci-$(CONFIG_MACH_PRONGHORNMETRO) += pronghornmetro-pci.o
+obj-pci-$(CONFIG_MACH_COMPEX) += ixdp425-pci.o
obj-y += common.o
@@ -32,5 +33,6 @@ obj-$(CONFIG_MACH_GATEWAY7001) += gatewa
obj-$(CONFIG_MACH_WG302V2) += wg302v2-setup.o
obj-$(CONFIG_MACH_FSG) += fsg-setup.o
obj-$(CONFIG_MACH_PRONGHORNMETRO) += pronghornmetro-setup.o
+obj-$(CONFIG_MACH_COMPEX) += compex-setup.o
obj-$(CONFIG_PCI) += $(obj-pci-$(CONFIG_PCI)) common-pci.o
Index: linux-2.6.24.7/arch/arm/mach-ixp4xx/compex-setup.c
===================================================================
--- /dev/null
+++ linux-2.6.24.7/arch/arm/mach-ixp4xx/compex-setup.c
@@ -0,0 +1,120 @@
+/*
+ * arch/arm/mach-ixp4xx/compex-setup.c
+ *
+ * Ccompex WP18 / NP18A board-setup
+ *
+ * Copyright (C) 2007 Imre Kaloz <Kaloz@openwrt.org>
+ *
+ * based on ixdp425-setup.c:
+ * Copyright (C) 2003-2005 MontaVista Software, Inc.
+ *
+ * Author: Imre Kaloz <Kaloz@openwrt.org>
+ */
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/device.h>
+#include <linux/serial.h>
+#include <linux/tty.h>
+#include <linux/serial_8250.h>
+#include <linux/slab.h>
+
+#include <asm/types.h>
+#include <asm/setup.h>
+#include <asm/memory.h>
+#include <asm/hardware.h>
+#include <asm/mach-types.h>
+#include <asm/irq.h>
+#include <asm/mach/arch.h>
+#include <asm/mach/flash.h>
+
+static struct flash_platform_data compex_flash_data = {
+ .map_name = "cfi_probe",
+ .width = 2,
+};
+
+static struct resource compex_flash_resource = {
+ .flags = IORESOURCE_MEM,
+};
+
+static struct platform_device compex_flash = {
+ .name = "IXP4XX-Flash",
+ .id = 0,
+ .dev = {
+ .platform_data = &compex_flash_data,
+ },
+ .num_resources = 1,
+ .resource = &compex_flash_resource,
+};
+
+static struct resource compex_uart_resources[] = {
+ {
+ .start = IXP4XX_UART1_BASE_PHYS,
+ .end = IXP4XX_UART1_BASE_PHYS + 0x0fff,
+ .flags = IORESOURCE_MEM
+ },
+ {
+ .start = IXP4XX_UART2_BASE_PHYS,
+ .end = IXP4XX_UART2_BASE_PHYS + 0x0fff,
+ .flags = IORESOURCE_MEM
+ }
+};
+
+static struct plat_serial8250_port compex_uart_data[] = {
+ {
+ .mapbase = IXP4XX_UART1_BASE_PHYS,
+ .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET,
+ .irq = IRQ_IXP4XX_UART1,
+ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
+ .iotype = UPIO_MEM,
+ .regshift = 2,
+ .uartclk = IXP4XX_UART_XTAL,
+ },
+ {
+ .mapbase = IXP4XX_UART2_BASE_PHYS,
+ .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET,
+ .irq = IRQ_IXP4XX_UART2,
+ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
+ .iotype = UPIO_MEM,
+ .regshift = 2,
+ .uartclk = IXP4XX_UART_XTAL,
+ },
+ { },
+};
+
+static struct platform_device compex_uart = {
+ .name = "serial8250",
+ .id = PLAT8250_DEV_PLATFORM,
+ .dev.platform_data = compex_uart_data,
+ .num_resources = 2,
+ .resource = compex_uart_resources,
+};
+
+static struct platform_device *compex_devices[] __initdata = {
+ &compex_flash,
+ &compex_uart
+};
+
+static void __init compex_init(void)
+{
+ ixp4xx_sys_init();
+
+ compex_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
+ compex_flash_resource.end =
+ IXP4XX_EXP_BUS_BASE(0) + SZ_32M - 1;
+
+ platform_add_devices(compex_devices, ARRAY_SIZE(compex_devices));
+}
+
+#ifdef CONFIG_MACH_COMPEX
+MACHINE_START(COMPEX, "Compex WP18 / NP18A")
+ /* Maintainer: Imre Kaloz <Kaloz@openwrt.org> */
+ .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
+ .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
+ .map_io = ixp4xx_map_io,
+ .init_irq = ixp4xx_init_irq,
+ .timer = &ixp4xx_timer,
+ .boot_params = 0x0100,
+ .init_machine = compex_init,
+MACHINE_END
+#endif
Index: linux-2.6.24.7/arch/arm/mach-ixp4xx/ixdp425-pci.c
===================================================================
--- linux-2.6.24.7.orig/arch/arm/mach-ixp4xx/ixdp425-pci.c
+++ linux-2.6.24.7/arch/arm/mach-ixp4xx/ixdp425-pci.c
@@ -66,7 +66,7 @@ struct hw_pci ixdp425_pci __initdata = {
int __init ixdp425_pci_init(void)
{
if (machine_is_ixdp425() || machine_is_ixcdp1100() ||
- machine_is_ixdp465() || machine_is_kixrp435())
+ machine_is_ixdp465() || machine_is_kixrp435() || machine_is_compex())
pci_common_init(&ixdp425_pci);
return 0;
}
Index: linux-2.6.24.7/arch/arm/tools/mach-types
===================================================================
--- linux-2.6.24.7.orig/arch/arm/tools/mach-types
+++ linux-2.6.24.7/arch/arm/tools/mach-types
@@ -1276,7 +1276,7 @@ oiab MACH_OIAB OIAB 1269
smdk6400 MACH_SMDK6400 SMDK6400 1270
nokia_n800 MACH_NOKIA_N800 NOKIA_N800 1271
greenphone MACH_GREENPHONE GREENPHONE 1272
-compex42x MACH_COMPEXWP18 COMPEXWP18 1273
+compex MACH_COMPEX COMPEX 1273
xmate MACH_XMATE XMATE 1274
energizer MACH_ENERGIZER ENERGIZER 1275
ime1 MACH_IME1 IME1 1276

View File

@ -1,42 +0,0 @@
Index: linux-2.6.24.7/arch/arm/mach-ixp4xx/compex-setup.c
===================================================================
--- linux-2.6.24.7.orig/arch/arm/mach-ixp4xx/compex-setup.c
+++ linux-2.6.24.7/arch/arm/mach-ixp4xx/compex-setup.c
@@ -90,9 +90,36 @@ static struct platform_device compex_uar
.resource = compex_uart_resources,
};
+/* Built-in 10/100 Ethernet MAC interfaces */
+static struct eth_plat_info compex_plat_eth[] = {
+ {
+ .phy = -1,
+ .rxq = 3,
+ .txreadyq = 20,
+ }, {
+ .phy = 3,
+ .rxq = 4,
+ .txreadyq = 21,
+ }
+};
+
+static struct platform_device compex_eth[] = {
+ {
+ .name = "ixp4xx_eth",
+ .id = IXP4XX_ETH_NPEB,
+ .dev.platform_data = compex_plat_eth,
+ }, {
+ .name = "ixp4xx_eth",
+ .id = IXP4XX_ETH_NPEC,
+ .dev.platform_data = compex_plat_eth + 1,
+ }
+};
+
static struct platform_device *compex_devices[] __initdata = {
&compex_flash,
- &compex_uart
+ &compex_uart,
+ &compex_eth[0],
+ &compex_eth[1],
};
static void __init compex_init(void)

View File

@ -1,234 +0,0 @@
Index: linux-2.6.24.7/arch/arm/mach-ixp4xx/Kconfig
===================================================================
--- linux-2.6.24.7.orig/arch/arm/mach-ixp4xx/Kconfig
+++ linux-2.6.24.7/arch/arm/mach-ixp4xx/Kconfig
@@ -73,6 +73,14 @@ config MACH_COMPEX
WP18 or NP18A boards. For more information on this
platform, see http://openwrt.org
+config MACH_WRT300NV2
+ bool "Linksys WRT300N v2"
+ select PCI
+ help
+ Say 'Y' here if you want your kernel to support Linksys'
+ WRT300N v2 router. For more information on this
+ platform, see http://openwrt.org
+
config ARCH_IXDP425
bool "IXDP425"
help
Index: linux-2.6.24.7/arch/arm/mach-ixp4xx/Makefile
===================================================================
--- linux-2.6.24.7.orig/arch/arm/mach-ixp4xx/Makefile
+++ linux-2.6.24.7/arch/arm/mach-ixp4xx/Makefile
@@ -18,6 +18,7 @@ obj-pci-$(CONFIG_MACH_WG302V2) += wg302
obj-pci-$(CONFIG_MACH_FSG) += fsg-pci.o
obj-pci-$(CONFIG_MACH_PRONGHORNMETRO) += pronghornmetro-pci.o
obj-pci-$(CONFIG_MACH_COMPEX) += ixdp425-pci.o
+obj-pci-$(CONFIG_MACH_WRT300NV2) += wrt300nv2-pci.o
obj-y += common.o
@@ -34,5 +35,6 @@ obj-$(CONFIG_MACH_WG302V2) += wg302v2-se
obj-$(CONFIG_MACH_FSG) += fsg-setup.o
obj-$(CONFIG_MACH_PRONGHORNMETRO) += pronghornmetro-setup.o
obj-$(CONFIG_MACH_COMPEX) += compex-setup.o
+obj-$(CONFIG_MACH_WRT300NV2) += wrt300nv2-setup.o
obj-$(CONFIG_PCI) += $(obj-pci-$(CONFIG_PCI)) common-pci.o
Index: linux-2.6.24.7/arch/arm/mach-ixp4xx/wrt300nv2-pci.c
===================================================================
--- /dev/null
+++ linux-2.6.24.7/arch/arm/mach-ixp4xx/wrt300nv2-pci.c
@@ -0,0 +1,65 @@
+/*
+ * arch/arch/mach-ixp4xx/wrt300nv2-pci.c
+ *
+ * PCI setup routines for Linksys WRT300N v2
+ *
+ * Copyright (C) 2007 Imre Kaloz <kaloz@openwrt.org>
+ *
+ * based on coyote-pci.c:
+ * Copyright (C) 2002 Jungo Software Technologies.
+ * Copyright (C) 2003 MontaVista Softwrae, Inc.
+ *
+ * Maintainer: Imre Kaloz <kaloz@openwrt.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ */
+
+#include <linux/kernel.h>
+#include <linux/pci.h>
+#include <linux/init.h>
+#include <linux/irq.h>
+
+#include <asm/mach-types.h>
+#include <asm/hardware.h>
+#include <asm/irq.h>
+
+#include <asm/mach/pci.h>
+
+extern void ixp4xx_pci_preinit(void);
+extern int ixp4xx_setup(int nr, struct pci_sys_data *sys);
+extern struct pci_bus *ixp4xx_scan_bus(int nr, struct pci_sys_data *sys);
+
+void __init wrt300nv2_pci_preinit(void)
+{
+ set_irq_type(IRQ_IXP4XX_GPIO8, IRQT_LOW);
+
+ ixp4xx_pci_preinit();
+}
+
+static int __init wrt300nv2_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
+{
+ if (slot == 1)
+ return IRQ_IXP4XX_GPIO8;
+ else return -1;
+}
+
+struct hw_pci wrt300nv2_pci __initdata = {
+ .nr_controllers = 1,
+ .preinit = wrt300nv2_pci_preinit,
+ .swizzle = pci_std_swizzle,
+ .setup = ixp4xx_setup,
+ .scan = ixp4xx_scan_bus,
+ .map_irq = wrt300nv2_map_irq,
+};
+
+int __init wrt300nv2_pci_init(void)
+{
+ if (machine_is_wrt300nv2())
+ pci_common_init(&wrt300nv2_pci);
+ return 0;
+}
+
+subsys_initcall(wrt300nv2_pci_init);
Index: linux-2.6.24.7/arch/arm/mach-ixp4xx/wrt300nv2-setup.c
===================================================================
--- /dev/null
+++ linux-2.6.24.7/arch/arm/mach-ixp4xx/wrt300nv2-setup.c
@@ -0,0 +1,108 @@
+/*
+ * arch/arm/mach-ixp4xx/wrt300nv2-setup.c
+ *
+ * Board setup for the Linksys WRT300N v2
+ *
+ * Copyright (C) 2007 Imre Kaloz <Kaloz@openwrt.org>
+ *
+ * based on coyote-setup.c:
+ * Copyright (C) 2003-2005 MontaVista Software, Inc.
+ *
+ * Author: Imre Kaloz <Kaloz@openwrt.org>
+ */
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/device.h>
+#include <linux/serial.h>
+#include <linux/tty.h>
+#include <linux/serial_8250.h>
+#include <linux/slab.h>
+
+#include <asm/types.h>
+#include <asm/setup.h>
+#include <asm/memory.h>
+#include <asm/hardware.h>
+#include <asm/irq.h>
+#include <asm/mach-types.h>
+#include <asm/mach/arch.h>
+#include <asm/mach/flash.h>
+
+static struct flash_platform_data wrt300nv2_flash_data = {
+ .map_name = "cfi_probe",
+ .width = 2,
+};
+
+static struct resource wrt300nv2_flash_resource = {
+ .flags = IORESOURCE_MEM,
+};
+
+static struct platform_device wrt300nv2_flash = {
+ .name = "IXP4XX-Flash",
+ .id = 0,
+ .dev = {
+ .platform_data = &wrt300nv2_flash_data,
+ },
+ .num_resources = 1,
+ .resource = &wrt300nv2_flash_resource,
+};
+
+static struct resource wrt300nv2_uart_resource = {
+ .start = IXP4XX_UART2_BASE_PHYS,
+ .end = IXP4XX_UART2_BASE_PHYS + 0x0fff,
+ .flags = IORESOURCE_MEM,
+};
+
+static struct plat_serial8250_port wrt300nv2_uart_data[] = {
+ {
+ .mapbase = IXP4XX_UART2_BASE_PHYS,
+ .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET,
+ .irq = IRQ_IXP4XX_UART2,
+ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
+ .iotype = UPIO_MEM,
+ .regshift = 2,
+ .uartclk = IXP4XX_UART_XTAL,
+ },
+ { },
+};
+
+static struct platform_device wrt300nv2_uart = {
+ .name = "serial8250",
+ .id = PLAT8250_DEV_PLATFORM,
+ .dev = {
+ .platform_data = wrt300nv2_uart_data,
+ },
+ .num_resources = 1,
+ .resource = &wrt300nv2_uart_resource,
+};
+
+static struct platform_device *wrt300nv2_devices[] __initdata = {
+ &wrt300nv2_flash,
+ &wrt300nv2_uart
+};
+
+static void __init wrt300nv2_init(void)
+{
+ ixp4xx_sys_init();
+
+ wrt300nv2_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
+ wrt300nv2_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_32M - 1;
+
+ *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE;
+ *IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0;
+
+ platform_add_devices(wrt300nv2_devices, ARRAY_SIZE(wrt300nv2_devices));
+}
+
+#ifdef CONFIG_MACH_WRT300NV2
+MACHINE_START(WRT300NV2, "Linksys WRT300N v2")
+ /* Maintainer: Imre Kaloz <kaloz@openwrt.org> */
+ .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
+ .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
+ .map_io = ixp4xx_map_io,
+ .init_irq = ixp4xx_init_irq,
+ .timer = &ixp4xx_timer,
+ .boot_params = 0x0100,
+ .init_machine = wrt300nv2_init,
+MACHINE_END
+#endif
Index: linux-2.6.24.7/include/asm-arm/arch-ixp4xx/uncompress.h
===================================================================
--- linux-2.6.24.7.orig/include/asm-arm/arch-ixp4xx/uncompress.h
+++ linux-2.6.24.7/include/asm-arm/arch-ixp4xx/uncompress.h
@@ -42,7 +42,7 @@ static __inline__ void __arch_decomp_set
*/
if (machine_is_adi_coyote() || machine_is_gtwx5715() ||
machine_is_gateway7001() || machine_is_wg302v2() ||
- machine_is_pronghorn_metro())
+ machine_is_pronghorn_metro() || machine_is_wrt300nv2())
uart_base = (volatile u32*) IXP4XX_UART2_BASE_PHYS;
else
uart_base = (volatile u32*) IXP4XX_UART1_BASE_PHYS;

View File

@ -1,42 +0,0 @@
Index: linux-2.6.24.7/arch/arm/mach-ixp4xx/wrt300nv2-setup.c
===================================================================
--- linux-2.6.24.7.orig/arch/arm/mach-ixp4xx/wrt300nv2-setup.c
+++ linux-2.6.24.7/arch/arm/mach-ixp4xx/wrt300nv2-setup.c
@@ -76,9 +76,36 @@ static struct platform_device wrt300nv2_
.resource = &wrt300nv2_uart_resource,
};
+/* Built-in 10/100 Ethernet MAC interfaces */
+static struct eth_plat_info wrt300nv2_plat_eth[] = {
+ {
+ .phy = -1,
+ .rxq = 3,
+ .txreadyq = 20,
+ }, {
+ .phy = 1,
+ .rxq = 4,
+ .txreadyq = 21,
+ }
+};
+
+static struct platform_device wrt300nv2_eth[] = {
+ {
+ .name = "ixp4xx_eth",
+ .id = IXP4XX_ETH_NPEB,
+ .dev.platform_data = wrt300nv2_plat_eth,
+ }, {
+ .name = "ixp4xx_eth",
+ .id = IXP4XX_ETH_NPEC,
+ .dev.platform_data = wrt300nv2_plat_eth + 1,
+ }
+};
+
static struct platform_device *wrt300nv2_devices[] __initdata = {
&wrt300nv2_flash,
- &wrt300nv2_uart
+ &wrt300nv2_uart,
+ &wrt300nv2_eth[0],
+ &wrt300nv2_eth[1],
};
static void __init wrt300nv2_init(void)

View File

@ -1,243 +0,0 @@
Index: linux-2.6.24.7/arch/arm/mach-ixp4xx/Kconfig
===================================================================
--- linux-2.6.24.7.orig/arch/arm/mach-ixp4xx/Kconfig
+++ linux-2.6.24.7/arch/arm/mach-ixp4xx/Kconfig
@@ -65,6 +65,14 @@ config MACH_PRONGHORNMETRO
Engineering Pronghorn Metro Platform. For more
information on this platform, see <file:Documentation/arm/IXP4xx>.
+config MACH_SIDEWINDER
+ bool "Sidewinder"
+ select PCI
+ help
+ Say 'Y' here if you want your kernel to support the ADI
+ Engineering Sidewinder Platform. For more
+ information on this platform, see <file:Documentation/arm/IXP4xx>.
+
config MACH_COMPEX
bool "Compex WP18 / NP18A"
select PCI
@@ -163,7 +171,7 @@ config MACH_FSG
#
config CPU_IXP46X
bool
- depends on MACH_IXDP465
+ depends on MACH_IXDP465 || MACH_SIDEWINDER
default y
config CPU_IXP43X
Index: linux-2.6.24.7/arch/arm/mach-ixp4xx/Makefile
===================================================================
--- linux-2.6.24.7.orig/arch/arm/mach-ixp4xx/Makefile
+++ linux-2.6.24.7/arch/arm/mach-ixp4xx/Makefile
@@ -19,6 +19,7 @@ obj-pci-$(CONFIG_MACH_FSG) += fsg-pci.o
obj-pci-$(CONFIG_MACH_PRONGHORNMETRO) += pronghornmetro-pci.o
obj-pci-$(CONFIG_MACH_COMPEX) += ixdp425-pci.o
obj-pci-$(CONFIG_MACH_WRT300NV2) += wrt300nv2-pci.o
+obj-pci-$(CONFIG_MACH_SIDEWINDER) += sidewinder-pci.o
obj-y += common.o
@@ -36,5 +37,6 @@ obj-$(CONFIG_MACH_FSG) += fsg-setup.o
obj-$(CONFIG_MACH_PRONGHORNMETRO) += pronghornmetro-setup.o
obj-$(CONFIG_MACH_COMPEX) += compex-setup.o
obj-$(CONFIG_MACH_WRT300NV2) += wrt300nv2-setup.o
+obj-$(CONFIG_MACH_SIDEWINDER) += sidewinder-setup.o
obj-$(CONFIG_PCI) += $(obj-pci-$(CONFIG_PCI)) common-pci.o
Index: linux-2.6.24.7/arch/arm/mach-ixp4xx/sidewinder-pci.c
===================================================================
--- /dev/null
+++ linux-2.6.24.7/arch/arm/mach-ixp4xx/sidewinder-pci.c
@@ -0,0 +1,71 @@
+/*
+ * arch/arch/mach-ixp4xx/pronghornmetro-pci.c
+ *
+ * PCI setup routines for ADI Engineering Sidewinder
+ *
+ * Copyright (C) 2007 Imre Kaloz <kaloz@openwrt.org>
+ *
+ * based on coyote-pci.c:
+ * Copyright (C) 2002 Jungo Software Technologies.
+ * Copyright (C) 2003 MontaVista Softwrae, Inc.
+ *
+ * Maintainer: Imre Kaloz <kaloz@openwrt.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ */
+
+#include <linux/kernel.h>
+#include <linux/pci.h>
+#include <linux/init.h>
+#include <linux/irq.h>
+
+#include <asm/mach-types.h>
+#include <asm/hardware.h>
+#include <asm/irq.h>
+
+#include <asm/mach/pci.h>
+
+extern void ixp4xx_pci_preinit(void);
+extern int ixp4xx_setup(int nr, struct pci_sys_data *sys);
+extern struct pci_bus *ixp4xx_scan_bus(int nr, struct pci_sys_data *sys);
+
+void __init sidewinder_pci_preinit(void)
+{
+ set_irq_type(IRQ_IXP4XX_GPIO11, IRQT_LOW);
+ set_irq_type(IRQ_IXP4XX_GPIO10, IRQT_LOW);
+ set_irq_type(IRQ_IXP4XX_GPIO9, IRQT_LOW);
+
+ ixp4xx_pci_preinit();
+}
+
+static int __init sidewinder_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
+{
+ if (slot == 1)
+ return IRQ_IXP4XX_GPIO11;
+ else if (slot == 2)
+ return IRQ_IXP4XX_GPIO10;
+ else if (slot == 3)
+ return IRQ_IXP4XX_GPIO9;
+ else return -1;
+}
+
+struct hw_pci sidewinder_pci __initdata = {
+ .nr_controllers = 1,
+ .preinit = sidewinder_pci_preinit,
+ .swizzle = pci_std_swizzle,
+ .setup = ixp4xx_setup,
+ .scan = ixp4xx_scan_bus,
+ .map_irq = sidewinder_map_irq,
+};
+
+int __init sidewinder_pci_init(void)
+{
+ if (machine_is_sidewinder())
+ pci_common_init(&sidewinder_pci);
+ return 0;
+}
+
+subsys_initcall(sidewinder_pci_init);
Index: linux-2.6.24.7/arch/arm/mach-ixp4xx/sidewinder-setup.c
===================================================================
--- /dev/null
+++ linux-2.6.24.7/arch/arm/mach-ixp4xx/sidewinder-setup.c
@@ -0,0 +1,115 @@
+/*
+ * arch/arm/mach-ixp4xx/sidewinder-setup.c
+ *
+ * Board setup for the ADI Engineering Sidewinder
+ *
+ * Copyright (C) 2007 Imre Kaloz <Kaloz@openwrt.org>
+ *
+ * based on coyote-setup.c:
+ * Copyright (C) 2003-2005 MontaVista Software, Inc.
+ *
+ * Author: Imre Kaloz <Kaloz@openwrt.org>
+ */
+
+#include <linux/kernel.h>
+#include <linux/serial.h>
+#include <linux/serial_8250.h>
+
+#include <asm/mach-types.h>
+#include <asm/mach/arch.h>
+#include <asm/mach/flash.h>
+
+static struct flash_platform_data sidewinder_flash_data = {
+ .map_name = "cfi_probe",
+ .width = 2,
+};
+
+static struct resource sidewinder_flash_resource = {
+ .flags = IORESOURCE_MEM,
+};
+
+static struct platform_device sidewinder_flash = {
+ .name = "IXP4XX-Flash",
+ .id = 0,
+ .dev = {
+ .platform_data = &sidewinder_flash_data,
+ },
+ .num_resources = 1,
+ .resource = &sidewinder_flash_resource,
+};
+
+static struct resource sidewinder_uart_resources[] = {
+ {
+ .start = IXP4XX_UART1_BASE_PHYS,
+ .end = IXP4XX_UART1_BASE_PHYS + 0x0fff,
+ .flags = IORESOURCE_MEM,
+ },
+ {
+ .start = IXP4XX_UART2_BASE_PHYS,
+ .end = IXP4XX_UART2_BASE_PHYS + 0x0fff,
+ .flags = IORESOURCE_MEM,
+ }
+};
+
+static struct plat_serial8250_port sidewinder_uart_data[] = {
+ {
+ .mapbase = IXP4XX_UART1_BASE_PHYS,
+ .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET,
+ .irq = IRQ_IXP4XX_UART1,
+ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
+ .iotype = UPIO_MEM,
+ .regshift = 2,
+ .uartclk = IXP4XX_UART_XTAL,
+ },
+ {
+ .mapbase = IXP4XX_UART2_BASE_PHYS,
+ .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET,
+ .irq = IRQ_IXP4XX_UART2,
+ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
+ .iotype = UPIO_MEM,
+ .regshift = 2,
+ .uartclk = IXP4XX_UART_XTAL,
+ },
+ { },
+};
+
+static struct platform_device sidewinder_uart = {
+ .name = "serial8250",
+ .id = PLAT8250_DEV_PLATFORM,
+ .dev = {
+ .platform_data = sidewinder_uart_data,
+ },
+ .num_resources = ARRAY_SIZE(sidewinder_uart_resources),
+ .resource = sidewinder_uart_resources,
+};
+
+static struct platform_device *sidewinder_devices[] __initdata = {
+ &sidewinder_flash,
+ &sidewinder_uart,
+};
+
+static void __init sidewinder_init(void)
+{
+ ixp4xx_sys_init();
+
+ sidewinder_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
+ sidewinder_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_64M - 1;
+
+ *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE;
+ *IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0;
+
+ platform_add_devices(sidewinder_devices, ARRAY_SIZE(sidewinder_devices));
+}
+
+#ifdef CONFIG_MACH_SIDEWINDER
+MACHINE_START(SIDEWINDER, "ADI Engineering Sidewinder")
+ /* Maintainer: Imre Kaloz <kaloz@openwrt.org> */
+ .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
+ .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
+ .map_io = ixp4xx_map_io,
+ .init_irq = ixp4xx_init_irq,
+ .timer = &ixp4xx_timer,
+ .boot_params = 0x0100,
+ .init_machine = sidewinder_init,
+MACHINE_END
+#endif

View File

@ -1,208 +0,0 @@
Index: linux-2.6.24.7/arch/arm/mach-ixp4xx/ap1000-setup.c
===================================================================
--- /dev/null
+++ linux-2.6.24.7/arch/arm/mach-ixp4xx/ap1000-setup.c
@@ -0,0 +1,151 @@
+/*
+ * arch/arm/mach-ixp4xx/ap1000-setup.c
+ *
+ * Lanready AP-1000
+ *
+ * Copyright (C) 2007 Imre Kaloz <Kaloz@openwrt.org>
+ *
+ * based on ixdp425-setup.c:
+ * Copyright (C) 2003-2005 MontaVista Software, Inc.
+ *
+ * Author: Imre Kaloz <Kaloz@openwrt.org>
+ */
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/device.h>
+#include <linux/serial.h>
+#include <linux/tty.h>
+#include <linux/serial_8250.h>
+#include <linux/slab.h>
+
+#include <asm/types.h>
+#include <asm/setup.h>
+#include <asm/memory.h>
+#include <asm/hardware.h>
+#include <asm/mach-types.h>
+#include <asm/irq.h>
+#include <asm/mach/arch.h>
+#include <asm/mach/flash.h>
+
+static struct flash_platform_data ap1000_flash_data = {
+ .map_name = "cfi_probe",
+ .width = 2,
+};
+
+static struct resource ap1000_flash_resource = {
+ .flags = IORESOURCE_MEM,
+};
+
+static struct platform_device ap1000_flash = {
+ .name = "IXP4XX-Flash",
+ .id = 0,
+ .dev = {
+ .platform_data = &ap1000_flash_data,
+ },
+ .num_resources = 1,
+ .resource = &ap1000_flash_resource,
+};
+
+static struct resource ap1000_uart_resources[] = {
+ {
+ .start = IXP4XX_UART1_BASE_PHYS,
+ .end = IXP4XX_UART1_BASE_PHYS + 0x0fff,
+ .flags = IORESOURCE_MEM
+ },
+ {
+ .start = IXP4XX_UART2_BASE_PHYS,
+ .end = IXP4XX_UART2_BASE_PHYS + 0x0fff,
+ .flags = IORESOURCE_MEM
+ }
+};
+
+static struct plat_serial8250_port ap1000_uart_data[] = {
+ {
+ .mapbase = IXP4XX_UART1_BASE_PHYS,
+ .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET,
+ .irq = IRQ_IXP4XX_UART1,
+ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
+ .iotype = UPIO_MEM,
+ .regshift = 2,
+ .uartclk = IXP4XX_UART_XTAL,
+ },
+ {
+ .mapbase = IXP4XX_UART2_BASE_PHYS,
+ .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET,
+ .irq = IRQ_IXP4XX_UART2,
+ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
+ .iotype = UPIO_MEM,
+ .regshift = 2,
+ .uartclk = IXP4XX_UART_XTAL,
+ },
+ { },
+};
+
+static struct platform_device ap1000_uart = {
+ .name = "serial8250",
+ .id = PLAT8250_DEV_PLATFORM,
+ .dev.platform_data = ap1000_uart_data,
+ .num_resources = 2,
+ .resource = ap1000_uart_resources
+};
+
+static struct platform_device *ap1000_devices[] __initdata = {
+ &ap1000_flash,
+ &ap1000_uart
+};
+
+static char ap1000_mem_fixup[] __initdata = "mem=64M ";
+
+static void __init ap1000_fixup(struct machine_desc *desc,
+ struct tag *tags, char **cmdline, struct meminfo *mi)
+
+{
+ struct tag *t = tags;
+ char *p = *cmdline;
+
+ /* Find the end of the tags table, taking note of any cmdline tag. */
+ for (; t->hdr.size; t = tag_next(t)) {
+ if (t->hdr.tag == ATAG_CMDLINE) {
+ p = t->u.cmdline.cmdline;
+ }
+ }
+
+ /* Overwrite the end of the table with a new cmdline tag. */
+ t->hdr.tag = ATAG_CMDLINE;
+ t->hdr.size = (sizeof (struct tag_header) +
+ strlen(ap1000_mem_fixup) + strlen(p) + 1 + 4) >> 2;
+ strlcpy(t->u.cmdline.cmdline, ap1000_mem_fixup, COMMAND_LINE_SIZE);
+ strlcpy(t->u.cmdline.cmdline + strlen(ap1000_mem_fixup), p,
+ COMMAND_LINE_SIZE - strlen(ap1000_mem_fixup));
+
+ /* Terminate the table. */
+ t = tag_next(t);
+ t->hdr.tag = ATAG_NONE;
+ t->hdr.size = 0;
+}
+
+static void __init ap1000_init(void)
+{
+ ixp4xx_sys_init();
+
+ ap1000_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
+ ap1000_flash_resource.end =
+ IXP4XX_EXP_BUS_BASE(0) + ixp4xx_exp_bus_size - 1;
+
+ platform_add_devices(ap1000_devices, ARRAY_SIZE(ap1000_devices));
+}
+
+#ifdef CONFIG_MACH_AP1000
+MACHINE_START(AP1000, "Lanready AP-1000")
+ /* Maintainer: Imre Kaloz <Kaloz@openwrt.org> */
+ .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
+ .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
+ .fixup = ap1000_fixup,
+ .map_io = ixp4xx_map_io,
+ .init_irq = ixp4xx_init_irq,
+ .timer = &ixp4xx_timer,
+ .boot_params = 0x0100,
+ .init_machine = ap1000_init,
+MACHINE_END
+#endif
Index: linux-2.6.24.7/arch/arm/mach-ixp4xx/ixdp425-pci.c
===================================================================
--- linux-2.6.24.7.orig/arch/arm/mach-ixp4xx/ixdp425-pci.c
+++ linux-2.6.24.7/arch/arm/mach-ixp4xx/ixdp425-pci.c
@@ -66,7 +66,8 @@ struct hw_pci ixdp425_pci __initdata = {
int __init ixdp425_pci_init(void)
{
if (machine_is_ixdp425() || machine_is_ixcdp1100() ||
- machine_is_ixdp465() || machine_is_kixrp435() || machine_is_compex())
+ machine_is_ixdp465() || machine_is_kixrp435() ||
+ machine_is_compex() || machine_is_ap1000())
pci_common_init(&ixdp425_pci);
return 0;
}
Index: linux-2.6.24.7/arch/arm/mach-ixp4xx/Kconfig
===================================================================
--- linux-2.6.24.7.orig/arch/arm/mach-ixp4xx/Kconfig
+++ linux-2.6.24.7/arch/arm/mach-ixp4xx/Kconfig
@@ -89,6 +89,14 @@ config MACH_WRT300NV2
WRT300N v2 router. For more information on this
platform, see http://openwrt.org
+config MACH_AP1000
+ bool "Lanready AP-1000"
+ select PCI
+ help
+ Say 'Y' here if you want your kernel to support Lanready's
+ AP1000 board. For more information on this
+ platform, see http://openwrt.org
+
config ARCH_IXDP425
bool "IXDP425"
help
Index: linux-2.6.24.7/arch/arm/mach-ixp4xx/Makefile
===================================================================
--- linux-2.6.24.7.orig/arch/arm/mach-ixp4xx/Makefile
+++ linux-2.6.24.7/arch/arm/mach-ixp4xx/Makefile
@@ -20,6 +20,7 @@ obj-pci-$(CONFIG_MACH_PRONGHORNMETRO) +=
obj-pci-$(CONFIG_MACH_COMPEX) += ixdp425-pci.o
obj-pci-$(CONFIG_MACH_WRT300NV2) += wrt300nv2-pci.o
obj-pci-$(CONFIG_MACH_SIDEWINDER) += sidewinder-pci.o
+obj-pci-$(CONFIG_MACH_AP1000) += ixdp425-pci.o
obj-y += common.o
@@ -38,5 +39,6 @@ obj-$(CONFIG_MACH_PRONGHORNMETRO) += pro
obj-$(CONFIG_MACH_COMPEX) += compex-setup.o
obj-$(CONFIG_MACH_WRT300NV2) += wrt300nv2-setup.o
obj-$(CONFIG_MACH_SIDEWINDER) += sidewinder-setup.o
+obj-$(CONFIG_MACH_AP1000) += ap1000-setup.o
obj-$(CONFIG_PCI) += $(obj-pci-$(CONFIG_PCI)) common-pci.o

View File

@ -1,43 +0,0 @@
Index: linux-2.6.24.7/arch/arm/mach-ixp4xx/ap1000-setup.c
===================================================================
--- linux-2.6.24.7.orig/arch/arm/mach-ixp4xx/ap1000-setup.c
+++ linux-2.6.24.7/arch/arm/mach-ixp4xx/ap1000-setup.c
@@ -90,9 +90,37 @@ static struct platform_device ap1000_uar
.resource = ap1000_uart_resources
};
+/* Built-in 10/100 Ethernet MAC interfaces */
+static struct eth_plat_info ap1000_plat_eth[] = {
+ {
+ .phy = IXP4XX_ETH_PHY_MAX_ADDR,
+ .phy_mask = 0x1e,
+ .rxq = 3,
+ .txreadyq = 20,
+ }, {
+ .phy = 5,
+ .rxq = 4,
+ .txreadyq = 21,
+ }
+};
+
+static struct platform_device ap1000_eth[] = {
+ {
+ .name = "ixp4xx_eth",
+ .id = IXP4XX_ETH_NPEB,
+ .dev.platform_data = ap1000_plat_eth,
+ }, {
+ .name = "ixp4xx_eth",
+ .id = IXP4XX_ETH_NPEC,
+ .dev.platform_data = ap1000_plat_eth + 1,
+ }
+};
+
static struct platform_device *ap1000_devices[] __initdata = {
&ap1000_flash,
- &ap1000_uart
+ &ap1000_uart,
+ &ap1000_eth[0],
+ &ap1000_eth[1],
};
static char ap1000_mem_fixup[] __initdata = "mem=64M ";

View File

@ -1,221 +0,0 @@
Index: linux-2.6.24.7/arch/arm/mach-ixp4xx/Kconfig
===================================================================
--- linux-2.6.24.7.orig/arch/arm/mach-ixp4xx/Kconfig
+++ linux-2.6.24.7/arch/arm/mach-ixp4xx/Kconfig
@@ -49,6 +49,14 @@ config MACH_GATEWAY7001
7001 Access Point. For more information on this platform,
see http://openwrt.org
+config MACH_WG302V1
+ bool "Netgear WG302 v1 / WAG302 v1"
+ select PCI
+ help
+ Say 'Y' here if you want your kernel to support Netgear's
+ WG302 v1 or WAG302 v1 Access Points. For more information
+ on this platform, see http://openwrt.org
+
config MACH_WG302V2
bool "Netgear WG302 v2 / WAG302 v2"
select PCI
Index: linux-2.6.24.7/arch/arm/mach-ixp4xx/Makefile
===================================================================
--- linux-2.6.24.7.orig/arch/arm/mach-ixp4xx/Makefile
+++ linux-2.6.24.7/arch/arm/mach-ixp4xx/Makefile
@@ -14,6 +14,7 @@ obj-pci-$(CONFIG_MACH_NSLU2) += nslu2-p
obj-pci-$(CONFIG_MACH_NAS100D) += nas100d-pci.o
obj-pci-$(CONFIG_MACH_DSMG600) += dsmg600-pci.o
obj-pci-$(CONFIG_MACH_GATEWAY7001) += gateway7001-pci.o
+obj-pci-$(CONFIG_MACH_WG302V1) += wg302v1-pci.o
obj-pci-$(CONFIG_MACH_WG302V2) += wg302v2-pci.o
obj-pci-$(CONFIG_MACH_FSG) += fsg-pci.o
obj-pci-$(CONFIG_MACH_PRONGHORNMETRO) += pronghornmetro-pci.o
@@ -33,6 +34,7 @@ obj-$(CONFIG_MACH_NSLU2) += nslu2-setup.
obj-$(CONFIG_MACH_NAS100D) += nas100d-setup.o
obj-$(CONFIG_MACH_DSMG600) += dsmg600-setup.o
obj-$(CONFIG_MACH_GATEWAY7001) += gateway7001-setup.o
+obj-$(CONFIG_MACH_WG302V1) += wg302v1-setup.o
obj-$(CONFIG_MACH_WG302V2) += wg302v2-setup.o
obj-$(CONFIG_MACH_FSG) += fsg-setup.o
obj-$(CONFIG_MACH_PRONGHORNMETRO) += pronghornmetro-setup.o
Index: linux-2.6.24.7/arch/arm/mach-ixp4xx/wg302v1-pci.c
===================================================================
--- /dev/null
+++ linux-2.6.24.7/arch/arm/mach-ixp4xx/wg302v1-pci.c
@@ -0,0 +1,63 @@
+/*
+ * arch/arch/mach-ixp4xx/wg302v1-pci.c
+ *
+ * PCI setup routines for the Netgear WG302 v1 and WAG302 v1
+ *
+ * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
+ *
+ * based on coyote-pci.c:
+ * Copyright (C) 2002 Jungo Software Technologies.
+ * Copyright (C) 2003 MontaVista Software, Inc.
+ *
+ * Maintainer: Imre Kaloz <kaloz@openwrt.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ */
+
+#include <linux/kernel.h>
+#include <linux/pci.h>
+#include <linux/init.h>
+#include <linux/irq.h>
+
+#include <asm/mach-types.h>
+#include <asm/hardware.h>
+
+#include <asm/mach/pci.h>
+
+void __init wg302v1_pci_preinit(void)
+{
+ set_irq_type(IRQ_IXP4XX_GPIO8, IRQT_LOW);
+ set_irq_type(IRQ_IXP4XX_GPIO10, IRQT_LOW);
+
+ ixp4xx_pci_preinit();
+}
+
+static int __init wg302v1_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
+{
+ if (slot == 1)
+ return IRQ_IXP4XX_GPIO8;
+ else if (slot == 2)
+ return IRQ_IXP4XX_GPIO10;
+ else return -1;
+}
+
+struct hw_pci wg302v1_pci __initdata = {
+ .nr_controllers = 1,
+ .preinit = wg302v1_pci_preinit,
+ .swizzle = pci_std_swizzle,
+ .setup = ixp4xx_setup,
+ .scan = ixp4xx_scan_bus,
+ .map_irq = wg302v1_map_irq,
+};
+
+int __init wg302v1_pci_init(void)
+{
+ if (machine_is_wg302v1())
+ pci_common_init(&wg302v1_pci);
+ return 0;
+}
+
+subsys_initcall(wg302v1_pci_init);
Index: linux-2.6.24.7/arch/arm/mach-ixp4xx/wg302v1-setup.c
===================================================================
--- /dev/null
+++ linux-2.6.24.7/arch/arm/mach-ixp4xx/wg302v1-setup.c
@@ -0,0 +1,109 @@
+/*
+ * arch/arm/mach-ixp4xx/wg302v1-setup.c
+ *
+ * Board setup for the Netgear WG302 v1 and WAG302 v1
+ *
+ * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
+ *
+ * based on coyote-setup.c:
+ * Copyright (C) 2003-2005 MontaVista Software, Inc.
+ *
+ * Author: Imre Kaloz <kaloz@openwrt.org>
+ *
+ */
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/device.h>
+#include <linux/serial.h>
+#include <linux/tty.h>
+#include <linux/serial_8250.h>
+#include <linux/slab.h>
+
+#include <asm/types.h>
+#include <asm/setup.h>
+#include <asm/memory.h>
+#include <asm/hardware.h>
+#include <asm/irq.h>
+#include <asm/mach-types.h>
+#include <asm/mach/arch.h>
+#include <asm/mach/flash.h>
+
+static struct flash_platform_data wg302v1_flash_data = {
+ .map_name = "cfi_probe",
+ .width = 2,
+};
+
+static struct resource wg302v1_flash_resource = {
+ .flags = IORESOURCE_MEM,
+};
+
+static struct platform_device wg302v1_flash = {
+ .name = "IXP4XX-Flash",
+ .id = 0,
+ .dev = {
+ .platform_data = &wg302v1_flash_data,
+ },
+ .num_resources = 1,
+ .resource = &wg302v1_flash_resource,
+};
+
+static struct resource wg302v1_uart_resource = {
+ .start = IXP4XX_UART1_BASE_PHYS,
+ .end = IXP4XX_UART1_BASE_PHYS + 0x0fff,
+ .flags = IORESOURCE_MEM,
+};
+
+static struct plat_serial8250_port wg302v1_uart_data[] = {
+ {
+ .mapbase = IXP4XX_UART1_BASE_PHYS,
+ .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET,
+ .irq = IRQ_IXP4XX_UART1,
+ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
+ .iotype = UPIO_MEM,
+ .regshift = 2,
+ .uartclk = IXP4XX_UART_XTAL,
+ },
+ { },
+};
+
+static struct platform_device wg302v1_uart = {
+ .name = "serial8250",
+ .id = PLAT8250_DEV_PLATFORM,
+ .dev = {
+ .platform_data = wg302v1_uart_data,
+ },
+ .num_resources = 1,
+ .resource = &wg302v1_uart_resource,
+};
+
+static struct platform_device *wg302v1_devices[] __initdata = {
+ &wg302v1_flash,
+ &wg302v1_uart,
+};
+
+static void __init wg302v1_init(void)
+{
+ ixp4xx_sys_init();
+
+ wg302v1_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
+ wg302v1_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_32M - 1;
+
+ *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE;
+ *IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0;
+
+ platform_add_devices(wg302v1_devices, ARRAY_SIZE(wg302v1_devices));
+}
+
+#ifdef CONFIG_MACH_WG302V1
+MACHINE_START(WG302V1, "Netgear WG302 v1 / WAG302 v1")
+ /* Maintainer: Imre Kaloz <kaloz@openwrt.org> */
+ .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
+ .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
+ .map_io = ixp4xx_map_io,
+ .init_irq = ixp4xx_init_irq,
+ .timer = &ixp4xx_timer,
+ .boot_params = 0x0100,
+ .init_machine = wg302v1_init,
+MACHINE_END
+#endif

View File

@ -1,32 +0,0 @@
Index: linux-2.6.24.7/arch/arm/mach-ixp4xx/wg302v1-setup.c
===================================================================
--- linux-2.6.24.7.orig/arch/arm/mach-ixp4xx/wg302v1-setup.c
+++ linux-2.6.24.7/arch/arm/mach-ixp4xx/wg302v1-setup.c
@@ -77,9 +77,27 @@ static struct platform_device wg302v1_ua
.resource = &wg302v1_uart_resource,
};
+/* Built-in 10/100 Ethernet MAC interfaces */
+static struct eth_plat_info wg302_plat_eth[] = {
+ {
+ .phy = 30,
+ .rxq = 3,
+ .txreadyq = 20,
+ }
+};
+
+static struct platform_device wg302_eth[] = {
+ {
+ .name = "ixp4xx_eth",
+ .id = IXP4XX_ETH_NPEB,
+ .dev.platform_data = wg302_plat_eth,
+ }
+};
+
static struct platform_device *wg302v1_devices[] __initdata = {
&wg302v1_flash,
&wg302v1_uart,
+ &wg302_eth[0],
};
static void __init wg302v1_init(void)

View File

@ -1,49 +0,0 @@
Index: linux-2.6.24.7/arch/arm/mach-ixp4xx/wg302v1-setup.c
===================================================================
--- linux-2.6.24.7.orig/arch/arm/mach-ixp4xx/wg302v1-setup.c
+++ linux-2.6.24.7/arch/arm/mach-ixp4xx/wg302v1-setup.c
@@ -100,6 +100,36 @@ static struct platform_device *wg302v1_d
&wg302_eth[0],
};
+static char wg302v1_mem_fixup[] __initdata = "mem=32M ";
+
+static void __init wg302v1_fixup(struct machine_desc *desc,
+ struct tag *tags, char **cmdline, struct meminfo *mi)
+
+{
+ struct tag *t = tags;
+ char *p = *cmdline;
+
+ /* Find the end of the tags table, taking note of any cmdline tag. */
+ for (; t->hdr.size; t = tag_next(t)) {
+ if (t->hdr.tag == ATAG_CMDLINE) {
+ p = t->u.cmdline.cmdline;
+ }
+ }
+
+ /* Overwrite the end of the table with a new cmdline tag. */
+ t->hdr.tag = ATAG_CMDLINE;
+ t->hdr.size = (sizeof (struct tag_header) +
+ strlen(wg302v1_mem_fixup) + strlen(p) + 1 + 4) >> 2;
+ strlcpy(t->u.cmdline.cmdline, wg302v1_mem_fixup, COMMAND_LINE_SIZE);
+ strlcpy(t->u.cmdline.cmdline + strlen(wg302v1_mem_fixup), p,
+ COMMAND_LINE_SIZE - strlen(wg302v1_mem_fixup));
+
+ /* Terminate the table. */
+ t = tag_next(t);
+ t->hdr.tag = ATAG_NONE;
+ t->hdr.size = 0;
+}
+
static void __init wg302v1_init(void)
{
ixp4xx_sys_init();
@@ -118,6 +148,7 @@ MACHINE_START(WG302V1, "Netgear WG302 v1
/* Maintainer: Imre Kaloz <kaloz@openwrt.org> */
.phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
.io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
+ .fixup = wg302v1_fixup,
.map_io = ixp4xx_map_io,
.init_irq = ixp4xx_init_irq,
.timer = &ixp4xx_timer,

View File

@ -1,43 +0,0 @@
Index: linux-2.6.24.7/arch/arm/mach-ixp4xx/coyote-setup.c
===================================================================
--- linux-2.6.24.7.orig/arch/arm/mach-ixp4xx/coyote-setup.c
+++ linux-2.6.24.7/arch/arm/mach-ixp4xx/coyote-setup.c
@@ -73,9 +73,37 @@ static struct platform_device coyote_uar
.resource = &coyote_uart_resource,
};
+/* Built-in 10/100 Ethernet MAC interfaces */
+static struct eth_plat_info ixdpg425_plat_eth[] = {
+ {
+ .phy = 5,
+ .rxq = 3,
+ .txreadyq = 20,
+ }, {
+ .phy = 4,
+ .rxq = 4,
+ .txreadyq = 21,
+ }
+};
+
+static struct platform_device ixdpg425_eth[] = {
+ {
+ .name = "ixp4xx_eth",
+ .id = IXP4XX_ETH_NPEB,
+ .dev.platform_data = ixdpg425_plat_eth,
+ }, {
+ .name = "ixp4xx_eth",
+ .id = IXP4XX_ETH_NPEC,
+ .dev.platform_data = ixdpg425_plat_eth + 1,
+ }
+};
+
+
static struct platform_device *coyote_devices[] __initdata = {
&coyote_flash,
- &coyote_uart
+ &coyote_uart,
+ &ixdpg425_eth[0],
+ &ixdpg425_eth[1],
};
static void __init coyote_init(void)

View File

@ -1,293 +0,0 @@
Index: linux-2.6.24.7/arch/arm/mach-ixp4xx/Kconfig
===================================================================
--- linux-2.6.24.7.orig/arch/arm/mach-ixp4xx/Kconfig
+++ linux-2.6.24.7/arch/arm/mach-ixp4xx/Kconfig
@@ -150,6 +150,14 @@ config ARCH_PRPMC1100
PrPCM1100 Processor Mezanine Module. For more information on
this platform, see <file:Documentation/arm/IXP4xx>.
+config MACH_TW5334
+ bool "Titan Wireless TW-533-4"
+ select PCI
+ help
+ Say 'Y' here if you want your kernel to support the Titan
+ Wireless TW533-4. For more information on this platform,
+ see http://openwrt.org
+
config MACH_NAS100D
bool
prompt "NAS100D"
Index: linux-2.6.24.7/arch/arm/mach-ixp4xx/Makefile
===================================================================
--- linux-2.6.24.7.orig/arch/arm/mach-ixp4xx/Makefile
+++ linux-2.6.24.7/arch/arm/mach-ixp4xx/Makefile
@@ -22,6 +22,7 @@ obj-pci-$(CONFIG_MACH_COMPEX) += ixdp42
obj-pci-$(CONFIG_MACH_WRT300NV2) += wrt300nv2-pci.o
obj-pci-$(CONFIG_MACH_SIDEWINDER) += sidewinder-pci.o
obj-pci-$(CONFIG_MACH_AP1000) += ixdp425-pci.o
+obj-pci-$(CONFIG_MACH_TW5334) += tw5334-pci.o
obj-y += common.o
@@ -42,5 +43,6 @@ obj-$(CONFIG_MACH_COMPEX) += compex-setu
obj-$(CONFIG_MACH_WRT300NV2) += wrt300nv2-setup.o
obj-$(CONFIG_MACH_SIDEWINDER) += sidewinder-setup.o
obj-$(CONFIG_MACH_AP1000) += ap1000-setup.o
+obj-$(CONFIG_MACH_TW5334) += tw5334-setup.o
obj-$(CONFIG_PCI) += $(obj-pci-$(CONFIG_PCI)) common-pci.o
Index: linux-2.6.24.7/arch/arm/mach-ixp4xx/tw5334-setup.c
===================================================================
--- /dev/null
+++ linux-2.6.24.7/arch/arm/mach-ixp4xx/tw5334-setup.c
@@ -0,0 +1,162 @@
+/*
+ * arch/arm/mach-ixp4xx/tw5334-setup.c
+ *
+ * Board setup for the Titan Wireless TW-533-4
+ *
+ * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
+ *
+ * based on coyote-setup.c:
+ * Copyright (C) 2003-2005 MontaVista Software, Inc.
+ *
+ * Author: Imre Kaloz <Kaloz@openwrt.org>
+ */
+
+#include <linux/if_ether.h>
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/device.h>
+#include <linux/serial.h>
+#include <linux/tty.h>
+#include <linux/serial_8250.h>
+#include <linux/slab.h>
+
+#include <asm/types.h>
+#include <asm/setup.h>
+#include <asm/memory.h>
+#include <asm/hardware.h>
+#include <asm/irq.h>
+#include <asm/mach-types.h>
+#include <asm/mach/arch.h>
+#include <asm/mach/flash.h>
+
+static struct flash_platform_data tw5334_flash_data = {
+ .map_name = "cfi_probe",
+ .width = 2,
+};
+
+static struct resource tw5334_flash_resource = {
+ .flags = IORESOURCE_MEM,
+};
+
+static struct platform_device tw5334_flash = {
+ .name = "IXP4XX-Flash",
+ .id = 0,
+ .dev = {
+ .platform_data = &tw5334_flash_data,
+ },
+ .num_resources = 1,
+ .resource = &tw5334_flash_resource,
+};
+
+static struct resource tw5334_uart_resource = {
+ .start = IXP4XX_UART2_BASE_PHYS,
+ .end = IXP4XX_UART2_BASE_PHYS + 0x0fff,
+ .flags = IORESOURCE_MEM,
+};
+
+static struct plat_serial8250_port tw5334_uart_data[] = {
+ {
+ .mapbase = IXP4XX_UART2_BASE_PHYS,
+ .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET,
+ .irq = IRQ_IXP4XX_UART2,
+ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
+ .iotype = UPIO_MEM,
+ .regshift = 2,
+ .uartclk = IXP4XX_UART_XTAL,
+ },
+ { },
+};
+
+static struct platform_device tw5334_uart = {
+ .name = "serial8250",
+ .id = PLAT8250_DEV_PLATFORM,
+ .dev = {
+ .platform_data = tw5334_uart_data,
+ },
+ .num_resources = 1,
+ .resource = &tw5334_uart_resource,
+};
+
+/* Built-in 10/100 Ethernet MAC interfaces */
+static struct eth_plat_info tw5334_plat_eth[] = {
+ {
+ .phy = 0,
+ .rxq = 3,
+ .txreadyq = 20,
+ }, {
+ .phy = 1,
+ .rxq = 4,
+ .txreadyq = 21,
+ }
+};
+
+static struct platform_device tw5334_eth[] = {
+ {
+ .name = "ixp4xx_eth",
+ .id = IXP4XX_ETH_NPEB,
+ .dev.platform_data = tw5334_plat_eth,
+ }, {
+ .name = "ixp4xx_eth",
+ .id = IXP4XX_ETH_NPEC,
+ .dev.platform_data = tw5334_plat_eth + 1,
+ }
+};
+
+static struct platform_device *tw5334_devices[] __initdata = {
+ &tw5334_flash,
+ &tw5334_uart,
+ &tw5334_eth[0],
+ &tw5334_eth[1],
+};
+
+static void __init tw5334_init(void)
+{
+ DECLARE_MAC_BUF(mac_buf);
+ uint8_t __iomem *f;
+ int i;
+
+ ixp4xx_sys_init();
+
+ tw5334_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
+ tw5334_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_32M - 1;
+
+ *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE;
+ *IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0;
+
+ platform_add_devices(tw5334_devices, ARRAY_SIZE(tw5334_devices));
+
+ /*
+ * Map in a portion of the flash and read the MAC addresses.
+ * Since it is stored in BE in the flash itself, we need to
+ * byteswap it if we're in LE mode.
+ */
+ f = ioremap(IXP4XX_EXP_BUS_BASE(0), 0x1000000);
+ if (f) {
+ for (i = 0; i < 6; i++)
+#ifdef __ARMEB__
+ tw5334_plat_eth[0].hwaddr[i] = readb(f + 0xFC0422 + i);
+ tw5334_plat_eth[1].hwaddr[i] = readb(f + 0xFC043B + i);
+#else
+ tw5334_plat_eth[0].hwaddr[i] = readb(f + 0xFC0422 + (i^3));
+ tw5334_plat_eth[1].hwaddr[i] = readb(f + 0xFC043B + (i^3));
+#endif
+ iounmap(f);
+ }
+ printk(KERN_INFO "TW-533-4: Using MAC address %s for port 0\n",
+ print_mac(mac_buf, tw5334_plat_eth[0].hwaddr));
+ printk(KERN_INFO "TW-533-4: Using MAC address %s for port 1\n",
+ print_mac(mac_buf, tw5334_plat_eth[1].hwaddr));
+}
+
+#ifdef CONFIG_MACH_TW5334
+MACHINE_START(TW5334, "Titan Wireless TW-533-4")
+ /* Maintainer: Imre Kaloz <kaloz@openwrt.org> */
+ .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
+ .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
+ .map_io = ixp4xx_map_io,
+ .init_irq = ixp4xx_init_irq,
+ .timer = &ixp4xx_timer,
+ .boot_params = 0x0100,
+ .init_machine = tw5334_init,
+MACHINE_END
+#endif
Index: linux-2.6.24.7/arch/arm/mach-ixp4xx/tw5334-pci.c
===================================================================
--- /dev/null
+++ linux-2.6.24.7/arch/arm/mach-ixp4xx/tw5334-pci.c
@@ -0,0 +1,69 @@
+/*
+ * arch/arch/mach-ixp4xx/tw5334-pci.c
+ *
+ * PCI setup routines for the Titan Wireless TW-533-4
+ *
+ * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
+ *
+ * based on coyote-pci.c:
+ * Copyright (C) 2002 Jungo Software Technologies.
+ * Copyright (C) 2003 MontaVista Softwrae, Inc.
+ *
+ * Maintainer: Imre Kaloz <kaloz@openwrt.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ */
+
+#include <linux/kernel.h>
+#include <linux/pci.h>
+#include <linux/init.h>
+#include <linux/irq.h>
+
+#include <asm/mach-types.h>
+#include <asm/hardware.h>
+
+#include <asm/mach/pci.h>
+
+void __init tw5334_pci_preinit(void)
+{
+ set_irq_type(IRQ_IXP4XX_GPIO6, IRQT_LOW);
+ set_irq_type(IRQ_IXP4XX_GPIO2, IRQT_LOW);
+ set_irq_type(IRQ_IXP4XX_GPIO1, IRQT_LOW);
+ set_irq_type(IRQ_IXP4XX_GPIO0, IRQT_LOW);
+
+ ixp4xx_pci_preinit();
+}
+
+static int __init tw5334_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
+{
+ if (slot == 12)
+ return IRQ_IXP4XX_GPIO6;
+ else if (slot == 13)
+ return IRQ_IXP4XX_GPIO2;
+ else if (slot == 14)
+ return IRQ_IXP4XX_GPIO1;
+ else if (slot == 15)
+ return IRQ_IXP4XX_GPIO0;
+ else return -1;
+}
+
+struct hw_pci tw5334_pci __initdata = {
+ .nr_controllers = 1,
+ .preinit = tw5334_pci_preinit,
+ .swizzle = pci_std_swizzle,
+ .setup = ixp4xx_setup,
+ .scan = ixp4xx_scan_bus,
+ .map_irq = tw5334_map_irq,
+};
+
+int __init tw5334_pci_init(void)
+{
+ if (machine_is_tw5334())
+ pci_common_init(&tw5334_pci);
+ return 0;
+}
+
+subsys_initcall(tw5334_pci_init);
Index: linux-2.6.24.7/include/asm-arm/arch-ixp4xx/uncompress.h
===================================================================
--- linux-2.6.24.7.orig/include/asm-arm/arch-ixp4xx/uncompress.h
+++ linux-2.6.24.7/include/asm-arm/arch-ixp4xx/uncompress.h
@@ -42,7 +42,8 @@ static __inline__ void __arch_decomp_set
*/
if (machine_is_adi_coyote() || machine_is_gtwx5715() ||
machine_is_gateway7001() || machine_is_wg302v2() ||
- machine_is_pronghorn_metro() || machine_is_wrt300nv2())
+ machine_is_pronghorn_metro() || machine_is_wrt300nv2() ||
+ machine_is_tw5334())
uart_base = (volatile u32*) IXP4XX_UART2_BASE_PHYS;
else
uart_base = (volatile u32*) IXP4XX_UART1_BASE_PHYS;

View File

@ -1,395 +0,0 @@
Index: linux-2.6.24.7/arch/arm/mach-ixp4xx/Kconfig
===================================================================
--- linux-2.6.24.7.orig/arch/arm/mach-ixp4xx/Kconfig
+++ linux-2.6.24.7/arch/arm/mach-ixp4xx/Kconfig
@@ -25,6 +25,14 @@ config MACH_AVILA
Avila Network Platform. For more information on this platform,
see <file:Documentation/arm/IXP4xx>.
+config MACH_CAMBRIA
+ bool "Cambria"
+ select PCI
+ help
+ Say 'Y' here if you want your kernel to support the Gateworks
+ Cambria series. For more information on this platform,
+ see <file:Documentation/arm/IXP4xx>.
+
config MACH_LOFT
bool "Loft"
depends on MACH_AVILA
@@ -200,7 +208,7 @@ config CPU_IXP46X
config CPU_IXP43X
bool
- depends on MACH_KIXRP435
+ depends on MACH_KIXRP435 || MACH_CAMBRIA
default y
config MACH_GTWX5715
Index: linux-2.6.24.7/arch/arm/mach-ixp4xx/Makefile
===================================================================
--- linux-2.6.24.7.orig/arch/arm/mach-ixp4xx/Makefile
+++ linux-2.6.24.7/arch/arm/mach-ixp4xx/Makefile
@@ -7,6 +7,7 @@ obj-pci-n :=
obj-pci-$(CONFIG_ARCH_IXDP4XX) += ixdp425-pci.o
obj-pci-$(CONFIG_MACH_AVILA) += avila-pci.o
+obj-pci-$(CONFIG_MACH_CAMBRIA) += cambria-pci.o
obj-pci-$(CONFIG_MACH_IXDPG425) += ixdpg425-pci.o
obj-pci-$(CONFIG_ARCH_ADI_COYOTE) += coyote-pci.o
obj-pci-$(CONFIG_MACH_GTWX5715) += gtwx5715-pci.o
@@ -28,6 +29,7 @@ obj-y += common.o
obj-$(CONFIG_ARCH_IXDP4XX) += ixdp425-setup.o
obj-$(CONFIG_MACH_AVILA) += avila-setup.o
+obj-$(CONFIG_MACH_CAMBRIA) += cambria-setup.o
obj-$(CONFIG_MACH_IXDPG425) += coyote-setup.o
obj-$(CONFIG_ARCH_ADI_COYOTE) += coyote-setup.o
obj-$(CONFIG_MACH_GTWX5715) += gtwx5715-setup.o
Index: linux-2.6.24.7/arch/arm/mach-ixp4xx/cambria-pci.c
===================================================================
--- /dev/null
+++ linux-2.6.24.7/arch/arm/mach-ixp4xx/cambria-pci.c
@@ -0,0 +1,74 @@
+/*
+ * arch/arch/mach-ixp4xx/cambria-pci.c
+ *
+ * PCI setup routines for Gateworks Cambria series
+ *
+ * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
+ *
+ * based on coyote-pci.c:
+ * Copyright (C) 2002 Jungo Software Technologies.
+ * Copyright (C) 2003 MontaVista Softwrae, Inc.
+ *
+ * Maintainer: Imre Kaloz <kaloz@openwrt.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ */
+
+#include <linux/kernel.h>
+#include <linux/pci.h>
+#include <linux/init.h>
+#include <linux/irq.h>
+
+#include <asm/mach-types.h>
+#include <asm/hardware.h>
+#include <asm/irq.h>
+
+#include <asm/mach/pci.h>
+
+extern void ixp4xx_pci_preinit(void);
+extern int ixp4xx_setup(int nr, struct pci_sys_data *sys);
+extern struct pci_bus *ixp4xx_scan_bus(int nr, struct pci_sys_data *sys);
+
+void __init cambria_pci_preinit(void)
+{
+ set_irq_type(IRQ_IXP4XX_GPIO11, IRQT_LOW);
+ set_irq_type(IRQ_IXP4XX_GPIO10, IRQT_LOW);
+ set_irq_type(IRQ_IXP4XX_GPIO9, IRQT_LOW);
+ set_irq_type(IRQ_IXP4XX_GPIO8, IRQT_LOW);
+
+ ixp4xx_pci_preinit();
+}
+
+static int __init cambria_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
+{
+ if (slot == 1)
+ return IRQ_IXP4XX_GPIO11;
+ else if (slot == 2)
+ return IRQ_IXP4XX_GPIO10;
+ else if (slot == 3)
+ return IRQ_IXP4XX_GPIO9;
+ else if (slot == 4)
+ return IRQ_IXP4XX_GPIO8;
+ else return -1;
+}
+
+struct hw_pci cambria_pci __initdata = {
+ .nr_controllers = 1,
+ .preinit = cambria_pci_preinit,
+ .swizzle = pci_std_swizzle,
+ .setup = ixp4xx_setup,
+ .scan = ixp4xx_scan_bus,
+ .map_irq = cambria_map_irq,
+};
+
+int __init cambria_pci_init(void)
+{
+ if (machine_is_cambria())
+ pci_common_init(&cambria_pci);
+ return 0;
+}
+
+subsys_initcall(cambria_pci_init);
Index: linux-2.6.24.7/arch/arm/mach-ixp4xx/cambria-setup.c
===================================================================
--- /dev/null
+++ linux-2.6.24.7/arch/arm/mach-ixp4xx/cambria-setup.c
@@ -0,0 +1,250 @@
+/*
+ * arch/arm/mach-ixp4xx/cambria-setup.c
+ *
+ * Board setup for the Gateworks Cambria series
+ *
+ * Copyright (C) 2008 Imre Kaloz <Kaloz@openwrt.org>
+ *
+ * based on coyote-setup.c:
+ * Copyright (C) 2003-2005 MontaVista Software, Inc.
+ *
+ * Author: Imre Kaloz <Kaloz@openwrt.org>
+ */
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/device.h>
+#include <linux/if_ether.h>
+#include <linux/socket.h>
+#include <linux/netdevice.h>
+#include <linux/serial.h>
+#include <linux/tty.h>
+#include <linux/serial_8250.h>
+#include <linux/slab.h>
+#ifdef CONFIG_SENSORS_EEPROM
+# include <linux/i2c.h>
+# include <linux/eeprom.h>
+#endif
+
+#include <linux/i2c-gpio.h>
+#include <asm/types.h>
+#include <asm/setup.h>
+#include <asm/memory.h>
+#include <asm/hardware.h>
+#include <asm/irq.h>
+#include <asm/mach-types.h>
+#include <asm/mach/arch.h>
+#include <asm/mach/flash.h>
+
+static struct flash_platform_data cambria_flash_data = {
+ .map_name = "cfi_probe",
+ .width = 2,
+};
+
+static struct resource cambria_flash_resource = {
+ .flags = IORESOURCE_MEM,
+};
+
+static struct platform_device cambria_flash = {
+ .name = "IXP4XX-Flash",
+ .id = 0,
+ .dev = {
+ .platform_data = &cambria_flash_data,
+ },
+ .num_resources = 1,
+ .resource = &cambria_flash_resource,
+};
+
+static struct i2c_gpio_platform_data cambria_i2c_gpio_data = {
+ .sda_pin = 7,
+ .scl_pin = 6,
+};
+
+static struct platform_device cambria_i2c_gpio = {
+ .name = "i2c-gpio",
+ .id = 0,
+ .dev = {
+ .platform_data = &cambria_i2c_gpio_data,
+ },
+};
+
+static struct resource cambria_uart_resource = {
+ .start = IXP4XX_UART1_BASE_PHYS,
+ .end = IXP4XX_UART1_BASE_PHYS + 0x0fff,
+ .flags = IORESOURCE_MEM,
+};
+
+static struct plat_serial8250_port cambria_uart_data[] = {
+ {
+ .mapbase = IXP4XX_UART1_BASE_PHYS,
+ .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET,
+ .irq = IRQ_IXP4XX_UART1,
+ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
+ .iotype = UPIO_MEM,
+ .regshift = 2,
+ .uartclk = IXP4XX_UART_XTAL,
+ },
+ { },
+};
+
+static struct platform_device cambria_uart = {
+ .name = "serial8250",
+ .id = PLAT8250_DEV_PLATFORM,
+ .dev = {
+ .platform_data = cambria_uart_data,
+ },
+ .num_resources = 1,
+ .resource = &cambria_uart_resource,
+};
+
+static struct resource cambria_pata_resources[] = {
+ {
+ .flags = IORESOURCE_MEM
+ },
+ {
+ .flags = IORESOURCE_MEM,
+ },
+ {
+ .name = "intrq",
+ .start = IRQ_IXP4XX_GPIO12,
+ .end = IRQ_IXP4XX_GPIO12,
+ .flags = IORESOURCE_IRQ,
+ },
+};
+
+static struct ixp4xx_pata_data cambria_pata_data = {
+ .cs0_bits = 0xbfff3c03,
+ .cs1_bits = 0xbfff3c03,
+};
+
+static struct platform_device cambria_pata = {
+ .name = "pata_ixp4xx_cf",
+ .id = 0,
+ .dev.platform_data = &cambria_pata_data,
+ .num_resources = ARRAY_SIZE(cambria_pata_resources),
+ .resource = cambria_pata_resources,
+};
+
+static struct eth_plat_info cambria_plat_eth[] = {
+ {
+ .phy = 2,
+ .rxq = 4,
+ .txreadyq = 21,
+ }, {
+ .phy = 1,
+ .rxq = 2,
+ .txreadyq = 19,
+ }
+};
+
+static struct platform_device cambria_eth[] = {
+ {
+ .name = "ixp4xx_eth",
+ .id = IXP4XX_ETH_NPEC,
+ .dev.platform_data = cambria_plat_eth,
+ }, {
+ .name = "ixp4xx_eth",
+ .id = IXP4XX_ETH_NPEA,
+ .dev.platform_data = cambria_plat_eth + 1,
+ }
+};
+
+#ifdef CONFIG_LEDS_IXP4XX
+static struct platform_device cambria_leds_pld = {
+ .name = "IXP4XX-PLD-LED",
+ .id = -1,
+ .num_resources = 0,
+};
+
+static struct platform_device cambria_leds_mem = {
+ .name = "IXP4XX-MEM-LED",
+ .id = -1,
+ .num_resources = 0,
+};
+#endif
+
+static struct platform_device *cambria_devices[] __initdata = {
+ &cambria_i2c_gpio,
+ &cambria_flash,
+ &cambria_uart,
+#ifdef CONFIG_LEDS_IXP4XX
+ &cambria_leds_pld,
+ &cambria_leds_mem,
+#endif
+ &cambria_eth[0],
+ &cambria_eth[1],
+};
+
+#ifdef CONFIG_SENSORS_EEPROM
+static int cambria_eeprom_do(struct notifier_block *self, unsigned long event, void *t)
+{
+ struct eeprom_data *data = t;
+ struct sockaddr address;
+ struct net_device * netdev;
+
+ char macs[12];
+
+ /* The MACs are the first 12 bytes in the eeprom at address 0x51 */
+ if (event == EEPROM_REGISTER && data->client.addr == 0x51) {
+ data->attr->read(&data->client.dev.kobj, data->attr, macs, 0, 12);
+ /* eth0 */
+ memcpy(address.sa_data, macs, ETH_ALEN);
+ memcpy(&cambria_plat_eth[0].hwaddr, macs, ETH_ALEN);
+ if ( (netdev = dev_get_by_name(&init_net, "eth0")) )
+ netdev->set_mac_address(netdev, &address);
+
+ /* eth1 */
+ memcpy(address.sa_data, macs + ETH_ALEN, ETH_ALEN);
+ memcpy(&cambria_plat_eth[1].hwaddr, macs + ETH_ALEN, ETH_ALEN);
+ if ( (netdev = dev_get_by_name(&init_net, "eth1")) )
+ netdev->set_mac_address(netdev, &address);
+ }
+
+ return NOTIFY_DONE;
+}
+
+static struct notifier_block cambria_eeprom_notifier = {
+ .notifier_call = cambria_eeprom_do
+};
+#endif
+
+static void __init cambria_init(void)
+{
+ ixp4xx_sys_init();
+
+#ifdef CONFIG_SENSORS_EEPROM
+ register_eeprom_notifier(&cambria_eeprom_notifier);
+#endif
+
+ cambria_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
+ cambria_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_32M - 1;
+
+ *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE;
+ *IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0;
+
+ platform_add_devices(cambria_devices, ARRAY_SIZE(cambria_devices));
+
+ cambria_pata_resources[0].start = 0x53e00000;
+ cambria_pata_resources[0].end = 0x53e3ffff;
+
+ cambria_pata_resources[1].start = 0x53e40000;
+ cambria_pata_resources[1].end = 0x53e7ffff;
+
+ cambria_pata_data.cs0_cfg = IXP4XX_EXP_CS3;
+ cambria_pata_data.cs1_cfg = IXP4XX_EXP_CS3;
+
+ platform_device_register(&cambria_pata);
+}
+
+#ifdef CONFIG_MACH_CAMBRIA
+MACHINE_START(CAMBRIA, "Gateworks Cambria series")
+ /* Maintainer: Imre Kaloz <kaloz@openwrt.org> */
+ .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
+ .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
+ .map_io = ixp4xx_map_io,
+ .init_irq = ixp4xx_init_irq,
+ .timer = &ixp4xx_timer,
+ .boot_params = 0x0100,
+ .init_machine = cambria_init,
+MACHINE_END
+#endif
Index: linux-2.6.24.7/include/asm-arm/arch-ixp4xx/hardware.h
===================================================================
--- linux-2.6.24.7.orig/include/asm-arm/arch-ixp4xx/hardware.h
+++ linux-2.6.24.7/include/asm-arm/arch-ixp4xx/hardware.h
@@ -18,7 +18,7 @@
#define __ASM_ARCH_HARDWARE_H__
#define PCIBIOS_MIN_IO 0x00001000
-#define PCIBIOS_MIN_MEM (cpu_is_ixp43x() ? 0x40000000 : 0x48000000)
+#define PCIBIOS_MIN_MEM (cpu_is_ixp43x() ? 0x48000000 : 0x48000000)
/*
* We override the standard dma-mask routines for bouncing.

File diff suppressed because it is too large Load Diff

View File

@ -1,13 +0,0 @@
Index: linux-2.6.24.7/arch/arm/mach-ixp4xx/ixp4xx_npe.c
===================================================================
--- linux-2.6.24.7.orig/arch/arm/mach-ixp4xx/ixp4xx_npe.c
+++ linux-2.6.24.7/arch/arm/mach-ixp4xx/ixp4xx_npe.c
@@ -588,6 +588,8 @@ int npe_load_firmware(struct npe *npe, c
npe_reset(npe);
#endif
+ print_npe(KERN_INFO, npe, "firmware's license can be found in /usr/share/doc/LICENSE.IPL\n");
+
print_npe(KERN_INFO, npe, "firmware functionality 0x%X, "
"revision 0x%X:%X\n", (image->id >> 16) & 0xFF,
(image->id >> 8) & 0xFF, image->id & 0xFF);

View File

@ -1,252 +0,0 @@
Index: linux-2.6.24.7/drivers/net/arm/ixp4xx_eth.c
===================================================================
--- linux-2.6.24.7.orig/drivers/net/arm/ixp4xx_eth.c
+++ linux-2.6.24.7/drivers/net/arm/ixp4xx_eth.c
@@ -165,14 +165,15 @@ struct port {
struct net_device *netdev;
struct napi_struct napi;
struct net_device_stats stat;
- struct mii_if_info mii;
+ struct mii_if_info mii[IXP4XX_ETH_PHY_MAX_ADDR];
struct delayed_work mdio_thread;
struct eth_plat_info *plat;
buffer_t *rx_buff_tab[RX_DESCS], *tx_buff_tab[TX_DESCS];
struct desc *desc_tab; /* coherent */
u32 desc_tab_phys;
int id; /* logical port ID */
- u16 mii_bmcr;
+ u16 mii_bmcr[IXP4XX_ETH_PHY_MAX_ADDR];
+ int phy_count;
};
/* NPE message structure */
@@ -316,13 +317,14 @@ static void mdio_write(struct net_device
spin_unlock_irqrestore(&mdio_lock, flags);
}
-static void phy_reset(struct net_device *dev, int phy_id)
+static void phy_reset(struct net_device *dev, int idx)
{
struct port *port = netdev_priv(dev);
+ int phy_id = port->mii[idx].phy_id;
int cycles = 0;
- mdio_write(dev, phy_id, MII_BMCR, port->mii_bmcr | BMCR_RESET);
-
+ mdio_write(dev, phy_id, MII_BMCR, port->mii_bmcr[idx] | BMCR_RESET);
+
while (cycles < MAX_MII_RESET_RETRIES) {
if (!(mdio_read(dev, phy_id, MII_BMCR) & BMCR_RESET)) {
#if DEBUG_MDIO
@@ -335,12 +337,12 @@ static void phy_reset(struct net_device
cycles++;
}
- printk(KERN_ERR "%s: MII reset failed\n", dev->name);
+ printk(KERN_ERR "%s: MII reset failed on PHY%2d\n", dev->name, phy_id);
}
-static void eth_set_duplex(struct port *port)
+static void eth_set_duplex(struct port *port, int full_duplex)
{
- if (port->mii.full_duplex)
+ if (full_duplex)
__raw_writel(DEFAULT_TX_CNTRL0 & ~TX_CNTRL0_HALFDUPLEX,
&port->regs->tx_control[0]);
else
@@ -348,7 +350,7 @@ static void eth_set_duplex(struct port *
&port->regs->tx_control[0]);
}
-
+#if 0
static void phy_check_media(struct port *port, int init)
{
if (mii_check_media(&port->mii, 1, init))
@@ -367,7 +369,63 @@ static void phy_check_media(struct port
}
}
}
+#else
+static void phy_update_link(struct net_device *dev, int link)
+{
+ int prev_link = netif_carrier_ok(dev);
+
+ if (!prev_link && link) {
+ printk(KERN_INFO "%s: link up\n", dev->name);
+ netif_carrier_on(dev);
+ } else if (prev_link && !link) {
+ printk(KERN_INFO "%s: link down\n", dev->name);
+ netif_carrier_off(dev);
+ }
+}
+
+static void phy_check_media(struct port *port, int init)
+{
+ struct net_device *dev = port->netdev;
+
+ if (port->phy_count == 1) {
+ struct mii_if_info *mii = &port->mii[0];
+
+ if (mii_check_media(mii, 1, init))
+ eth_set_duplex(port, mii->full_duplex);
+
+ if (mii->force_media) /* mii_check_media() doesn't work */
+ phy_update_link(dev, mii_link_ok(mii));
+ } else {
+ int cur_link = 0;
+ int i;
+
+ if (init)
+ eth_set_duplex(port, 1);
+
+ for (i = 0; i < port->phy_count; i++)
+ cur_link |= mii_link_ok(&port->mii[i]);
+
+ phy_update_link(dev, cur_link);
+ }
+}
+#endif
+static void phy_power_down(struct net_device *dev, int idx)
+{
+ struct port *port = netdev_priv(dev);
+ int phy_id = port->mii[idx].phy_id;
+
+ port->mii_bmcr[idx] = mdio_read(dev, phy_id, MII_BMCR) &
+ ~(BMCR_RESET | BMCR_PDOWN);
+ mdio_write(dev, phy_id, MII_BMCR, port->mii_bmcr[idx] | BMCR_PDOWN);
+}
+
+static void phy_power_up(struct net_device *dev, int idx)
+{
+ struct port *port = netdev_priv(dev);
+
+ mdio_write(dev, port->mii[idx].phy_id, MII_BMCR, port->mii_bmcr[idx]);
+}
static void mdio_thread(struct work_struct *work)
{
@@ -790,9 +848,12 @@ static int eth_ioctl(struct net_device *
if (!netif_running(dev))
return -EINVAL;
- err = generic_mii_ioctl(&port->mii, if_mii(req), cmd, &duplex_chg);
+ if (port->phy_count != 1)
+ return -EOPNOTSUPP;
+
+ err = generic_mii_ioctl(&port->mii[0], if_mii(req), cmd, &duplex_chg);
if (duplex_chg)
- eth_set_duplex(port);
+ eth_set_duplex(port, port->mii[0].full_duplex);
return err;
}
@@ -944,7 +1005,8 @@ static int eth_open(struct net_device *d
}
}
- mdio_write(dev, port->plat->phy, MII_BMCR, port->mii_bmcr);
+ for (i = 0; i < port->phy_count; i++)
+ phy_power_up(dev, i);
memset(&msg, 0, sizeof(msg));
msg.cmd = NPE_VLAN_SETRXQOSENTRY;
@@ -1103,10 +1165,8 @@ static int eth_close(struct net_device *
printk(KERN_CRIT "%s: unable to disable loopback\n",
dev->name);
- port->mii_bmcr = mdio_read(dev, port->plat->phy, MII_BMCR) &
- ~(BMCR_RESET | BMCR_PDOWN); /* may have been altered */
- mdio_write(dev, port->plat->phy, MII_BMCR,
- port->mii_bmcr | BMCR_PDOWN);
+ for (i = 0; i < port->phy_count; i++)
+ phy_power_down(dev, i);
if (!ports_open)
qmgr_disable_irq(TXDONE_QUEUE);
@@ -1117,6 +1177,42 @@ static int eth_close(struct net_device *
return 0;
}
+static void eth_add_phy(struct net_device *dev, int phy_id)
+{
+ struct port *port = netdev_priv(dev);
+ int i;
+
+ i = port->phy_count++;
+
+ port->mii[i].dev = dev;
+ port->mii[i].mdio_read = mdio_read;
+ port->mii[i].mdio_write = mdio_write;
+ port->mii[i].phy_id = phy_id;
+ port->mii[i].phy_id_mask = 0x1F;
+ port->mii[i].reg_num_mask = 0x1F;
+
+ printk(KERN_INFO "%s: MII PHY %i on %s\n", dev->name, phy_id,
+ npe_name(port->npe));
+
+ phy_reset(dev, i);
+ phy_power_down(dev, i);
+}
+
+static void eth_init_mii(struct net_device *dev)
+{
+ struct port *port = netdev_priv(dev);
+
+ if (port->plat->phy < IXP4XX_ETH_PHY_MAX_ADDR) {
+ eth_add_phy(dev, port->plat->phy);
+ } else {
+ int i;
+ for (i = 0; i < IXP4XX_ETH_PHY_MAX_ADDR; i++)
+ if (port->plat->phy_mask & (1U << i))
+ eth_add_phy(dev, i);
+ }
+
+}
+
static int __devinit eth_init_one(struct platform_device *pdev)
{
struct port *port;
@@ -1189,20 +1285,7 @@ static int __devinit eth_init_one(struct
__raw_writel(DEFAULT_CORE_CNTRL, &port->regs->core_control);
udelay(50);
- port->mii.dev = dev;
- port->mii.mdio_read = mdio_read;
- port->mii.mdio_write = mdio_write;
- port->mii.phy_id = plat->phy;
- port->mii.phy_id_mask = 0x1F;
- port->mii.reg_num_mask = 0x1F;
-
- printk(KERN_INFO "%s: MII PHY %i on %s\n", dev->name, plat->phy,
- npe_name(port->npe));
-
- phy_reset(dev, plat->phy);
- port->mii_bmcr = mdio_read(dev, plat->phy, MII_BMCR) &
- ~(BMCR_RESET | BMCR_PDOWN);
- mdio_write(dev, plat->phy, MII_BMCR, port->mii_bmcr | BMCR_PDOWN);
+ eth_init_mii(dev);
INIT_DELAYED_WORK(&port->mdio_thread, mdio_thread);
return 0;
Index: linux-2.6.24.7/include/asm-arm/arch-ixp4xx/platform.h
===================================================================
--- linux-2.6.24.7.orig/include/asm-arm/arch-ixp4xx/platform.h
+++ linux-2.6.24.7/include/asm-arm/arch-ixp4xx/platform.h
@@ -106,12 +106,15 @@ struct sys_timer;
#define IXP4XX_ETH_NPEB 0x10
#define IXP4XX_ETH_NPEC 0x20
+#define IXP4XX_ETH_PHY_MAX_ADDR 32
+
/* Information about built-in Ethernet MAC interfaces */
struct eth_plat_info {
u8 phy; /* MII PHY ID, 0 - 31 */
u8 rxq; /* configurable, currently 0 - 31 only */
u8 txreadyq;
u8 hwaddr[6];
+ u32 phy_mask;
};
/* Information about built-in HSS (synchronous serial) interfaces */

View File

@ -1,44 +0,0 @@
Index: linux-2.6.24.7/drivers/net/arm/ixp4xx_eth.c
===================================================================
--- linux-2.6.24.7.orig/drivers/net/arm/ixp4xx_eth.c
+++ linux-2.6.24.7/drivers/net/arm/ixp4xx_eth.c
@@ -322,8 +322,12 @@ static void phy_reset(struct net_device
struct port *port = netdev_priv(dev);
int phy_id = port->mii[idx].phy_id;
int cycles = 0;
+ u16 bmcr;
- mdio_write(dev, phy_id, MII_BMCR, port->mii_bmcr[idx] | BMCR_RESET);
+ /* reset the PHY */
+ bmcr = mdio_read(dev, phy_id, MII_BMCR);
+ bmcr |= BMCR_ANENABLE;
+ mdio_write(dev, phy_id, MII_BMCR, bmcr | BMCR_RESET);
while (cycles < MAX_MII_RESET_RETRIES) {
if (!(mdio_read(dev, phy_id, MII_BMCR) & BMCR_RESET)) {
@@ -331,13 +335,23 @@ static void phy_reset(struct net_device
printk(KERN_DEBUG "%s: phy_reset() took %i cycles\n",
dev->name, cycles);
#endif
- return;
+ break;
}
udelay(1);
cycles++;
}
- printk(KERN_ERR "%s: MII reset failed on PHY%2d\n", dev->name, phy_id);
+ if (cycles == MAX_MII_RESET_RETRIES) {
+ printk(KERN_ERR "%s: MII reset failed on PHY%2d\n", dev->name,
+ phy_id);
+ return;
+ }
+
+ /* restart auto negotiation */
+ bmcr = mdio_read(dev, phy_id, MII_BMCR);
+ bmcr |= (BMCR_ANENABLE | BMCR_ANRESTART);
+ mdio_write(dev, phy_id, MII_BMCR, bmcr);
+
}
static void eth_set_duplex(struct port *port, int full_duplex)

View File

@ -1,90 +0,0 @@
Index: linux-2.6.24.7/arch/arm/mach-ixp4xx/ixp4xx_npe.c
===================================================================
--- linux-2.6.24.7.orig/arch/arm/mach-ixp4xx/ixp4xx_npe.c
+++ linux-2.6.24.7/arch/arm/mach-ixp4xx/ixp4xx_npe.c
@@ -571,8 +571,8 @@ int npe_load_firmware(struct npe *npe, c
for (i = 0; i < image->size; i++)
image->data[i] = swab32(image->data[i]);
- if (!cpu_is_ixp46x() && ((image->id >> 28) & 0xF /* device ID */)) {
- print_npe(KERN_INFO, npe, "IXP46x firmware ignored on "
+ if (cpu_is_ixp42x() && ((image->id >> 28) & 0xF /* device ID */)) {
+ print_npe(KERN_INFO, npe, "IXP46x/IXP43x firmware ignored on "
"IXP42x\n");
goto err;
}
@@ -594,7 +594,7 @@ int npe_load_firmware(struct npe *npe, c
"revision 0x%X:%X\n", (image->id >> 16) & 0xFF,
(image->id >> 8) & 0xFF, image->id & 0xFF);
- if (!cpu_is_ixp46x()) {
+ if (cpu_is_ixp42x()) {
if (!npe->id)
instr_size = NPE_A_42X_INSTR_SIZE;
else
Index: linux-2.6.24.7/drivers/net/arm/ixp4xx_eth.c
===================================================================
--- linux-2.6.24.7.orig/drivers/net/arm/ixp4xx_eth.c
+++ linux-2.6.24.7/drivers/net/arm/ixp4xx_eth.c
@@ -32,6 +32,7 @@
#include <linux/kernel.h>
#include <linux/mii.h>
#include <linux/platform_device.h>
+#include <asm/arch/cpu.h>
#include <asm/arch/npe.h>
#include <asm/arch/qmgr.h>
@@ -1335,12 +1336,16 @@ static struct platform_driver drv = {
static int __init eth_init_module(void)
{
- if (!(ixp4xx_read_feature_bits() & IXP4XX_FEATURE_NPEB_ETH0))
- return -ENOSYS;
- /* All MII PHY accesses use NPE-B Ethernet registers */
spin_lock_init(&mdio_lock);
- mdio_regs = (struct eth_regs __iomem *)IXP4XX_EthB_BASE_VIRT;
+ if (!cpu_is_ixp43x())
+ /* All MII PHY accesses use NPE-B Ethernet registers */
+ mdio_regs = (struct eth_regs __iomem *)IXP4XX_EthB_BASE_VIRT;
+
+ else
+ /* IXP43x lacks NPE-B and uses NPE-C for MII PHY access */
+ mdio_regs = (struct eth_regs __iomem *)IXP4XX_EthC_BASE_VIRT;
+
__raw_writel(DEFAULT_CORE_CNTRL, &mdio_regs->core_control);
return platform_driver_register(&drv);
Index: linux-2.6.24.7/include/asm-arm/arch-ixp4xx/cpu.h
===================================================================
--- linux-2.6.24.7.orig/include/asm-arm/arch-ixp4xx/cpu.h
+++ linux-2.6.24.7/include/asm-arm/arch-ixp4xx/cpu.h
@@ -34,6 +34,8 @@ static inline u32 ixp4xx_read_feature_bi
val &= ~IXP4XX_FEATURE_RESERVED;
if (!cpu_is_ixp46x())
val &= ~IXP4XX_FEATURE_IXP46X_ONLY;
+ if (cpu_is_ixp42x())
+ val &= ~IXP4XX_FEATURE_IXP43X_46X;
return val;
}
Index: linux-2.6.24.7/include/asm-arm/arch-ixp4xx/ixp4xx-regs.h
===================================================================
--- linux-2.6.24.7.orig/include/asm-arm/arch-ixp4xx/ixp4xx-regs.h
+++ linux-2.6.24.7/include/asm-arm/arch-ixp4xx/ixp4xx-regs.h
@@ -628,11 +628,12 @@
#define IXP4XX_FEATURE_XSCALE_MAX_FREQ (3 << 22)
#define IXP4XX_FEATURE_RESERVED (0xFF << 24)
-#define IXP4XX_FEATURE_IXP46X_ONLY (IXP4XX_FEATURE_ECC_TIMESYNC | \
+#define IXP4XX_FEATURE_IXP43X_46X (IXP4XX_FEATURE_ECC_TIMESYNC | \
IXP4XX_FEATURE_USB_HOST | \
IXP4XX_FEATURE_NPEA_ETH | \
- IXP4XX_FEATURE_NPEB_ETH_1_TO_3 | \
- IXP4XX_FEATURE_RSA | \
IXP4XX_FEATURE_XSCALE_MAX_FREQ)
+#define IXP4XX_FEATURE_IXP46X_ONLY (IXP4XX_FEATURE_NPEB_ETH_1_TO_3 | \
+ IXP4XX_FEATURE_RSA)
+
#endif

View File

@ -1,14 +0,0 @@
Index: linux-2.6.24.7/arch/arm/mach-ixp4xx/compex-setup.c
===================================================================
--- linux-2.6.24.7.orig/arch/arm/mach-ixp4xx/compex-setup.c
+++ linux-2.6.24.7/arch/arm/mach-ixp4xx/compex-setup.c
@@ -93,7 +93,8 @@ static struct platform_device compex_uar
/* Built-in 10/100 Ethernet MAC interfaces */
static struct eth_plat_info compex_plat_eth[] = {
{
- .phy = -1,
+ .phy = IXP4XX_ETH_PHY_MAX_ADDR,
+ .phy_mask = 0xf0000, /* port 0-4 of the Marvell switch */
.rxq = 3,
.txreadyq = 20,
}, {

View File

@ -1,190 +0,0 @@
Index: linux-2.6.24.7/drivers/i2c/chips/eeprom.c
===================================================================
--- linux-2.6.24.7.orig/drivers/i2c/chips/eeprom.c
+++ linux-2.6.24.7/drivers/i2c/chips/eeprom.c
@@ -33,6 +33,8 @@
#include <linux/jiffies.h>
#include <linux/i2c.h>
#include <linux/mutex.h>
+#include <linux/notifier.h>
+#include <linux/eeprom.h>
/* Addresses to scan */
static unsigned short normal_i2c[] = { 0x50, 0x51, 0x52, 0x53, 0x54,
@@ -41,26 +43,7 @@ static unsigned short normal_i2c[] = { 0
/* Insmod parameters */
I2C_CLIENT_INSMOD_1(eeprom);
-
-/* Size of EEPROM in bytes */
-#define EEPROM_SIZE 256
-
-/* possible types of eeprom devices */
-enum eeprom_nature {
- UNKNOWN,
- VAIO,
-};
-
-/* Each client has this additional data */
-struct eeprom_data {
- struct i2c_client client;
- struct mutex update_lock;
- u8 valid; /* bitfield, bit!=0 if slice is valid */
- unsigned long last_updated[8]; /* In jiffies, 8 slices */
- u8 data[EEPROM_SIZE]; /* Register values */
- enum eeprom_nature nature;
-};
-
+ATOMIC_NOTIFIER_HEAD(eeprom_chain);
static int eeprom_attach_adapter(struct i2c_adapter *adapter);
static int eeprom_detect(struct i2c_adapter *adapter, int address, int kind);
@@ -198,6 +181,7 @@ static int eeprom_detect(struct i2c_adap
data->valid = 0;
mutex_init(&data->update_lock);
data->nature = UNKNOWN;
+ data->attr = &eeprom_attr;
/* Tell the I2C layer a new client has arrived */
if ((err = i2c_attach_client(new_client)))
@@ -225,6 +209,9 @@ static int eeprom_detect(struct i2c_adap
if (err)
goto exit_detach;
+ /* call the notifier chain */
+ atomic_notifier_call_chain(&eeprom_chain, EEPROM_REGISTER, data);
+
return 0;
exit_detach:
@@ -250,6 +237,41 @@ static int eeprom_detach_client(struct i
return 0;
}
+/**
+ * register_eeprom_notifier - register a 'user' of EEPROM devices.
+ * @nb: pointer to notifier info structure
+ *
+ * Registers a callback function to be called upon detection
+ * of an EEPROM device. Detection invokes the 'add' callback
+ * with the kobj of the mutex and a bin_attribute which allows
+ * read from the EEPROM. The intention is that the notifier
+ * will be able to read system configuration from the notifier.
+ *
+ * Only EEPROMs detected *after* the addition of the notifier
+ * are notified. I.e. EEPROMs already known to the system
+ * will not be notified - add the notifier from board level
+ * code!
+ */
+int register_eeprom_notifier(struct notifier_block *nb)
+{
+ return atomic_notifier_chain_register(&eeprom_chain, nb);
+}
+
+/**
+ * unregister_eeprom_notifier - unregister a 'user' of EEPROM devices.
+ * @old: pointer to notifier info structure
+ *
+ * Removes a callback function from the list of 'users' to be
+ * notified upon detection of EEPROM devices.
+ */
+int unregister_eeprom_notifier(struct notifier_block *nb)
+{
+ return atomic_notifier_chain_unregister(&eeprom_chain, nb);
+}
+
+EXPORT_SYMBOL_GPL(register_eeprom_notifier);
+EXPORT_SYMBOL_GPL(unregister_eeprom_notifier);
+
static int __init eeprom_init(void)
{
return i2c_add_driver(&eeprom_driver);
Index: linux-2.6.24.7/include/linux/eeprom.h
===================================================================
--- /dev/null
+++ linux-2.6.24.7/include/linux/eeprom.h
@@ -0,0 +1,71 @@
+#ifndef _LINUX_EEPROM_H
+#define _LINUX_EEPROM_H
+/*
+ * EEPROM notifier header
+ *
+ * Copyright (C) 2006 John Bowler
+ */
+
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef __KERNEL__
+#error This is a kernel header
+#endif
+
+#include <linux/list.h>
+#include <linux/kobject.h>
+#include <linux/sysfs.h>
+
+/* Size of EEPROM in bytes */
+#define EEPROM_SIZE 256
+
+/* possible types of eeprom devices */
+enum eeprom_nature {
+ UNKNOWN,
+ VAIO,
+};
+
+/* Each client has this additional data */
+struct eeprom_data {
+ struct i2c_client client;
+ struct mutex update_lock;
+ u8 valid; /* bitfield, bit!=0 if slice is valid */
+ unsigned long last_updated[8]; /* In jiffies, 8 slices */
+ u8 data[EEPROM_SIZE]; /* Register values */
+ enum eeprom_nature nature;
+ struct bin_attribute *attr;
+};
+
+/*
+ * This is very basic.
+ *
+ * If an EEPROM is detected on the I2C bus (this only works for
+ * I2C EEPROMs) the notifier chain is called with
+ * both the I2C information and the kobject for the sysfs
+ * device which has been registers. It is then possible to
+ * read from the device via the bin_attribute::read method
+ * to extract configuration information.
+ *
+ * Register the notifier in the board level code, there is no
+ * need to unregister it but you can if you want (it will save
+ * a little bit or kernel memory to do so).
+ */
+
+extern int register_eeprom_notifier(struct notifier_block *nb);
+extern int unregister_eeprom_notifier(struct notifier_block *nb);
+
+#endif /* _LINUX_EEPROM_H */
Index: linux-2.6.24.7/include/linux/notifier.h
===================================================================
--- linux-2.6.24.7.orig/include/linux/notifier.h
+++ linux-2.6.24.7/include/linux/notifier.h
@@ -248,5 +248,8 @@ extern struct blocking_notifier_head reb
#define VT_WRITE 0x0003 /* A char got output */
#define VT_UPDATE 0x0004 /* A bigger update occurred */
+/* eeprom notifier chain */
+#define EEPROM_REGISTER 0x0001
+
#endif /* __KERNEL__ */
#endif /* _LINUX_NOTIFIER_H */

View File

@ -1,45 +0,0 @@
Index: linux-2.6.24.7/arch/arm/mach-ixp4xx/avila-setup.c
===================================================================
--- linux-2.6.24.7.orig/arch/arm/mach-ixp4xx/avila-setup.c
+++ linux-2.6.24.7/arch/arm/mach-ixp4xx/avila-setup.c
@@ -132,6 +132,31 @@ static struct platform_device avila_pata
.resource = avila_pata_resources,
};
+/* Built-in 10/100 Ethernet MAC interfaces */
+static struct eth_plat_info avila_npeb_data = {
+ .phy = 0,
+ .rxq = 3,
+ .txreadyq = 20,
+};
+
+static struct eth_plat_info avila_npec_data = {
+ .phy = 1,
+ .rxq = 4,
+ .txreadyq = 21,
+};
+
+static struct platform_device avila_npeb_device = {
+ .name = "ixp4xx_eth",
+ .id = IXP4XX_ETH_NPEB,
+ .dev.platform_data = &avila_npeb_data,
+};
+
+static struct platform_device avila_npec_device = {
+ .name = "ixp4xx_eth",
+ .id = IXP4XX_ETH_NPEC,
+ .dev.platform_data = &avila_npec_data,
+};
+
static struct platform_device *avila_devices[] __initdata = {
&avila_i2c_gpio,
&avila_flash,
@@ -159,6 +184,8 @@ static void __init avila_init(void)
platform_device_register(&avila_pata);
+ platform_device_register(avila_npeb_device);
+ platform_device_register(avila_npec_device);
}
MACHINE_START(AVILA, "Gateworks Avila Network Platform")

View File

@ -1,229 +0,0 @@
Index: linux-2.6.24.7/arch/arm/mach-ixp4xx/avila-setup.c
===================================================================
--- linux-2.6.24.7.orig/arch/arm/mach-ixp4xx/avila-setup.c
+++ linux-2.6.24.7/arch/arm/mach-ixp4xx/avila-setup.c
@@ -14,10 +14,18 @@
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/device.h>
+#include <linux/if_ether.h>
+#include <linux/socket.h>
+#include <linux/netdevice.h>
#include <linux/serial.h>
#include <linux/tty.h>
#include <linux/serial_8250.h>
#include <linux/slab.h>
+#ifdef CONFIG_SENSORS_EEPROM
+# include <linux/i2c.h>
+# include <linux/eeprom.h>
+#endif
+
#include <linux/i2c-gpio.h>
#include <asm/types.h>
@@ -29,6 +37,13 @@
#include <asm/mach/arch.h>
#include <asm/mach/flash.h>
+struct avila_board_info {
+ unsigned char *model;
+ void (* setup)(void);
+};
+
+static struct avila_board_info *avila_info __initdata;
+
static struct flash_platform_data avila_flash_data = {
.map_name = "cfi_probe",
.width = 2,
@@ -163,10 +178,160 @@ static struct platform_device *avila_dev
&avila_uart
};
+static void __init avila_gw23xx_setup(void)
+{
+ platform_device_register(&avila_npeb_device);
+ platform_device_register(&avila_npec_device);
+}
+
+#ifdef CONFIG_SENSORS_EEPROM
+static void __init avila_gw2342_setup(void)
+{
+ platform_device_register(&avila_npeb_device);
+ platform_device_register(&avila_npec_device);
+}
+
+static void __init avila_gw2345_setup(void)
+{
+ avila_npeb_data.phy = IXP4XX_ETH_PHY_MAX_ADDR;
+ avila_npeb_data.phy_mask = 0x1e; /* ports 1-4 of the KS8995 switch */
+ platform_device_register(&avila_npeb_device);
+
+ avila_npec_data.phy = 5; /* port 5 of the KS8995 switch */
+ platform_device_register(&avila_npec_device);
+}
+
+static void __init avila_gw2347_setup(void)
+{
+ platform_device_register(&avila_npeb_device);
+}
+
+static void __init avila_gw2348_setup(void)
+{
+ platform_device_register(&avila_npeb_device);
+ platform_device_register(&avila_npec_device);
+}
+
+static void __init avila_gw2353_setup(void)
+{
+ platform_device_register(&avila_npeb_device);
+}
+
+static void __init avila_gw2355_setup(void)
+{
+ avila_npeb_data.phy = IXP4XX_ETH_PHY_MAX_ADDR;
+ avila_npeb_data.phy_mask = 0x1e; /* ports 1-4 of the KS8995 switch */
+ platform_device_register(&avila_npeb_device);
+
+ avila_npec_data.phy = 16;
+ platform_device_register(&avila_npec_device);
+}
+
+static void __init avila_gw2357_setup(void)
+{
+ platform_device_register(&avila_npeb_device);
+}
+
+static struct avila_board_info avila_boards[] __initdata = {
+ {
+ .model = "GW2342",
+ .setup = avila_gw2342_setup,
+ }, {
+ .model = "GW2345",
+ .setup = avila_gw2345_setup,
+ }, {
+ .model = "GW2347",
+ .setup = avila_gw2347_setup,
+ }, {
+ .model = "GW2348",
+ .setup = avila_gw2348_setup,
+ }, {
+ .model = "GW2353",
+ .setup = avila_gw2353_setup,
+ }, {
+ .model = "GW2355",
+ .setup = avila_gw2355_setup,
+ }, {
+ .model = "GW2357",
+ .setup = avila_gw2357_setup,
+ }
+};
+
+static struct avila_board_info * __init avila_find_board_info(char *model)
+{
+ int i;
+
+ for (i = 0; i < ARRAY_SIZE(avila_boards); i++) {
+ struct avila_board_info *info = &avila_boards[i];
+ if (strncmp(info->model, model, strlen(info->model)) == 0)
+ return info;
+ }
+
+ return NULL;
+}
+
+struct avila_eeprom_header {
+ unsigned char mac0[ETH_ALEN];
+ unsigned char mac1[ETH_ALEN];
+ unsigned char res0[4];
+ unsigned char magic[2];
+ unsigned char config[14];
+ unsigned char model[16];
+};
+
+static int __init avila_eeprom_notify(struct notifier_block *self,
+ unsigned long event, void *t)
+{
+ struct eeprom_data *ee = t;
+ struct avila_eeprom_header hdr;
+
+ if (avila_info)
+ return NOTIFY_DONE;
+
+ /* The eeprom is at address 0x51 */
+ if (event != EEPROM_REGISTER || ee->client.addr != 0x51)
+ return NOTIFY_DONE;
+
+ ee->attr->read(&ee->client.dev.kobj, ee->attr, (char *)&hdr,
+ 0, sizeof(hdr));
+
+ if (hdr.magic[0] != 'G' || hdr.magic[1] != 'W')
+ return NOTIFY_DONE;
+
+ memcpy(&avila_npeb_data.hwaddr, hdr.mac0, ETH_ALEN);
+ memcpy(&avila_npec_data.hwaddr, hdr.mac1, ETH_ALEN);
+
+ avila_info = avila_find_board_info(hdr.model);
+
+ return NOTIFY_OK;
+}
+
+static struct notifier_block avila_eeprom_notifier __initdata = {
+ .notifier_call = avila_eeprom_notify
+};
+
+static void __init avila_register_eeprom_notifier(void)
+{
+ register_eeprom_notifier(&avila_eeprom_notifier);
+}
+
+static void __init avila_unregister_eeprom_notifier(void)
+{
+ unregister_eeprom_notifier(&avila_eeprom_notifier);
+}
+#else /* CONFIG_SENSORS_EEPROM */
+static inline void avila_register_eeprom_notifier(void) {};
+static inline void avila_unregister_eeprom_notifier(void) {};
+#endif /* CONFIG_SENSORS_EEPROM */
+
static void __init avila_init(void)
{
ixp4xx_sys_init();
+ /*
+ * These devices are present on all Avila models and don't need any
+ * model specific setup.
+ */
avila_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
avila_flash_resource.end =
IXP4XX_EXP_BUS_BASE(0) + ixp4xx_exp_bus_size - 1;
@@ -184,9 +349,28 @@ static void __init avila_init(void)
platform_device_register(&avila_pata);
- platform_device_register(avila_npeb_device);
- platform_device_register(avila_npec_device);
+ avila_register_eeprom_notifier();
+}
+
+static int __init avila_model_setup(void)
+{
+ if (!machine_is_avila())
+ return 0;
+
+ if (avila_info) {
+ printk(KERN_DEBUG "Running on Gateworks Avila %s\n",
+ avila_info->model);
+ avila_info->setup();
+ } else {
+ printk(KERN_INFO "Unknown/missing Avila model number"
+ " -- defaults will be used\n");
+ avila_gw23xx_setup();
+ }
+
+ avila_unregister_eeprom_notifier();
+ return 0;
}
+late_initcall(avila_model_setup);
MACHINE_START(AVILA, "Gateworks Avila Network Platform")
/* Maintainer: Deepak Saxena <dsaxena@plexity.net> */

View File

@ -1,116 +0,0 @@
Index: linux-2.6.24.7/include/asm-arm/arch-ixp4xx/avila.h
===================================================================
--- linux-2.6.24.7.orig/include/asm-arm/arch-ixp4xx/avila.h
+++ linux-2.6.24.7/include/asm-arm/arch-ixp4xx/avila.h
@@ -36,4 +36,6 @@
#define AVILA_PCI_INTC_PIN 9
#define AVILA_PCI_INTD_PIN 8
-
+/* User LEDs */
+#define AVILA_GW23XX_LED_USER_GPIO 3
+#define AVILA_GW23X7_LED_USER_GPIO 4
Index: linux-2.6.24.7/arch/arm/mach-ixp4xx/avila-setup.c
===================================================================
--- linux-2.6.24.7.orig/arch/arm/mach-ixp4xx/avila-setup.c
+++ linux-2.6.24.7/arch/arm/mach-ixp4xx/avila-setup.c
@@ -26,6 +26,7 @@
# include <linux/eeprom.h>
#endif
+#include <linux/leds.h>
#include <linux/i2c-gpio.h>
#include <asm/types.h>
@@ -172,6 +173,25 @@ static struct platform_device avila_npec
.dev.platform_data = &avila_npec_data,
};
+static struct gpio_led avila_leds[] = {
+ {
+ .name = "user", /* green led */
+ .gpio = AVILA_GW23XX_LED_USER_GPIO,
+ .active_low = 1,
+ }
+};
+
+static struct gpio_led_platform_data avila_leds_data = {
+ .num_leds = 1,
+ .leds = avila_leds,
+};
+
+static struct platform_device avila_leds_device = {
+ .name = "leds-gpio",
+ .id = -1,
+ .dev.platform_data = &avila_leds_data,
+};
+
static struct platform_device *avila_devices[] __initdata = {
&avila_i2c_gpio,
&avila_flash,
@@ -182,6 +202,8 @@ static void __init avila_gw23xx_setup(vo
{
platform_device_register(&avila_npeb_device);
platform_device_register(&avila_npec_device);
+
+ platform_device_register(&avila_leds_device);
}
#ifdef CONFIG_SENSORS_EEPROM
@@ -189,6 +211,8 @@ static void __init avila_gw2342_setup(vo
{
platform_device_register(&avila_npeb_device);
platform_device_register(&avila_npec_device);
+
+ platform_device_register(&avila_leds_device);
}
static void __init avila_gw2345_setup(void)
@@ -199,22 +223,30 @@ static void __init avila_gw2345_setup(vo
avila_npec_data.phy = 5; /* port 5 of the KS8995 switch */
platform_device_register(&avila_npec_device);
+
+ platform_device_register(&avila_leds_device);
}
static void __init avila_gw2347_setup(void)
{
platform_device_register(&avila_npeb_device);
+
+ avila_leds[0].gpio = AVILA_GW23X7_LED_USER_GPIO;
+ platform_device_register(&avila_leds_device);
}
static void __init avila_gw2348_setup(void)
{
platform_device_register(&avila_npeb_device);
platform_device_register(&avila_npec_device);
+
+ platform_device_register(&avila_leds_device);
}
static void __init avila_gw2353_setup(void)
{
platform_device_register(&avila_npeb_device);
+ platform_device_register(&avila_leds_device);
}
static void __init avila_gw2355_setup(void)
@@ -225,11 +257,16 @@ static void __init avila_gw2355_setup(vo
avila_npec_data.phy = 16;
platform_device_register(&avila_npec_device);
+
+ platform_device_register(&avila_leds_device);
}
static void __init avila_gw2357_setup(void)
{
platform_device_register(&avila_npeb_device);
+
+ avila_leds[0].gpio = AVILA_GW23X7_LED_USER_GPIO;
+ platform_device_register(&avila_leds_device);
}
static struct avila_board_info avila_boards[] __initdata = {

View File

@ -1,45 +0,0 @@
Index: linux-2.6.24.7/arch/arm/mach-ixp4xx/avila-setup.c
===================================================================
--- linux-2.6.24.7.orig/arch/arm/mach-ixp4xx/avila-setup.c
+++ linux-2.6.24.7/arch/arm/mach-ixp4xx/avila-setup.c
@@ -192,10 +192,28 @@ static struct platform_device avila_leds
.dev.platform_data = &avila_leds_data,
};
+static struct resource avila_gpio_resources[] = {
+ {
+ .name = "gpio",
+ /* FIXME: gpio mask should be model specific */
+ .start = AVILA_GPIO_MASK,
+ .end = AVILA_GPIO_MASK,
+ .flags = 0,
+ },
+};
+
+static struct platform_device avila_gpio = {
+ .name = "GPIODEV",
+ .id = -1,
+ .num_resources = ARRAY_SIZE(avila_gpio_resources),
+ .resource = avila_gpio_resources,
+};
+
static struct platform_device *avila_devices[] __initdata = {
&avila_i2c_gpio,
&avila_flash,
- &avila_uart
+ &avila_uart,
+ &avila_gpio,
};
static void __init avila_gw23xx_setup(void)
Index: linux-2.6.24.7/include/asm-arm/arch-ixp4xx/avila.h
===================================================================
--- linux-2.6.24.7.orig/include/asm-arm/arch-ixp4xx/avila.h
+++ linux-2.6.24.7/include/asm-arm/arch-ixp4xx/avila.h
@@ -39,3 +39,6 @@
/* User LEDs */
#define AVILA_GW23XX_LED_USER_GPIO 3
#define AVILA_GW23X7_LED_USER_GPIO 4
+
+/* gpio mask used by platform device */
+#define AVILA_GPIO_MASK (1 << 1) | (1 << 3) | (1 << 5) | (1 << 7) | (1 << 9)

View File

@ -1,52 +0,0 @@
Index: linux-2.6.24.7/arch/arm/mach-ixp4xx/avila-setup.c
===================================================================
--- linux-2.6.24.7.orig/arch/arm/mach-ixp4xx/avila-setup.c
+++ linux-2.6.24.7/arch/arm/mach-ixp4xx/avila-setup.c
@@ -247,6 +247,7 @@ static void __init avila_gw2345_setup(vo
static void __init avila_gw2347_setup(void)
{
+ avila_npeb_data.quirks |= IXP4XX_ETH_QUIRK_GW23X7;
platform_device_register(&avila_npeb_device);
avila_leds[0].gpio = AVILA_GW23X7_LED_USER_GPIO;
@@ -281,6 +282,7 @@ static void __init avila_gw2355_setup(vo
static void __init avila_gw2357_setup(void)
{
+ avila_npeb_data.quirks |= IXP4XX_ETH_QUIRK_GW23X7;
platform_device_register(&avila_npeb_device);
avila_leds[0].gpio = AVILA_GW23X7_LED_USER_GPIO;
Index: linux-2.6.24.7/drivers/net/arm/ixp4xx_eth.c
===================================================================
--- linux-2.6.24.7.orig/drivers/net/arm/ixp4xx_eth.c
+++ linux-2.6.24.7/drivers/net/arm/ixp4xx_eth.c
@@ -348,6 +348,14 @@ static void phy_reset(struct net_device
return;
}
+ if (port->plat->quirks & IXP4XX_ETH_QUIRK_GW23X7) {
+ mdio_write(dev, 1, 0x19,
+ (mdio_read(dev, 1, 0x19) & 0xfffe) | 0x8000);
+
+ printk(KERN_DEBUG "%s: phy_id of the DP83848 changed to 0\n",
+ dev->name);
+ }
+
/* restart auto negotiation */
bmcr = mdio_read(dev, phy_id, MII_BMCR);
bmcr |= (BMCR_ANENABLE | BMCR_ANRESTART);
Index: linux-2.6.24.7/include/asm-arm/arch-ixp4xx/platform.h
===================================================================
--- linux-2.6.24.7.orig/include/asm-arm/arch-ixp4xx/platform.h
+++ linux-2.6.24.7/include/asm-arm/arch-ixp4xx/platform.h
@@ -115,6 +115,8 @@ struct eth_plat_info {
u8 txreadyq;
u8 hwaddr[6];
u32 phy_mask;
+ u32 quirks;
+#define IXP4XX_ETH_QUIRK_GW23X7 0x00000001
};
/* Information about built-in HSS (synchronous serial) interfaces */

View File

@ -1,31 +0,0 @@
Index: linux-2.6.24.7/arch/arm/common/dmabounce.c
===================================================================
--- linux-2.6.24.7.orig/arch/arm/common/dmabounce.c
+++ linux-2.6.24.7/arch/arm/common/dmabounce.c
@@ -117,6 +117,10 @@ alloc_safe_buffer(struct dmabounce_devic
} else if (size <= device_info->large.size) {
pool = &device_info->large;
} else {
+#ifdef CONFIG_DMABOUNCE_DEBUG
+ printk(KERN_INFO "A dma bounce buffer outside the pool size was requested. Requested size was 0x%08X\nThe calling code was :\n", size);
+ dump_stack();
+#endif
pool = NULL;
}
Index: linux-2.6.24.7/arch/arm/mach-ixp4xx/Kconfig
===================================================================
--- linux-2.6.24.7.orig/arch/arm/mach-ixp4xx/Kconfig
+++ linux-2.6.24.7/arch/arm/mach-ixp4xx/Kconfig
@@ -236,6 +236,11 @@ config DMABOUNCE
default y
depends on PCI
+config DMABOUNCE_DEBUG
+ bool "Enable DMABounce debuging"
+ default n
+ depends on DMABOUNCE
+
config IXP4XX_INDIRECT_PCI
bool "Use indirect PCI memory access"
depends on PCI

View File

@ -1,13 +0,0 @@
Index: linux-2.6.24.7/include/asm-arm/arch-ixp4xx/avila.h
===================================================================
--- linux-2.6.24.7.orig/include/asm-arm/arch-ixp4xx/avila.h
+++ linux-2.6.24.7/include/asm-arm/arch-ixp4xx/avila.h
@@ -25,7 +25,7 @@
/*
* AVILA PCI IRQs
*/
-#define AVILA_PCI_MAX_DEV 4
+#define AVILA_PCI_MAX_DEV 6
#define LOFT_PCI_MAX_DEV 6
#define AVILA_PCI_IRQ_LINES 4

View File

@ -1,220 +0,0 @@
Index: linux-2.6.24.7/drivers/usb/host/ehci.h
===================================================================
--- linux-2.6.24.7.orig/drivers/usb/host/ehci.h
+++ linux-2.6.24.7/drivers/usb/host/ehci.h
@@ -730,6 +730,11 @@ ehci_port_speed(struct ehci_hcd *ehci, u
#define writel_be(val, addr) out_be32((__force unsigned *)addr, val)
#endif
+#if defined(CONFIG_ARM) && defined(CONFIG_ARCH_IXP4XX)
+#define readl_be(addr) __raw_readl((__force unsigned *)addr)
+#define writel_be(val, addr) __raw_writel(val, (__force unsigned *)addr)
+#endif
+
static inline unsigned int ehci_readl(const struct ehci_hcd *ehci,
__u32 __iomem * regs)
{
Index: linux-2.6.24.7/drivers/usb/host/ehci-hcd.c
===================================================================
--- linux-2.6.24.7.orig/drivers/usb/host/ehci-hcd.c
+++ linux-2.6.24.7/drivers/usb/host/ehci-hcd.c
@@ -964,6 +964,11 @@ MODULE_LICENSE ("GPL");
#define PLATFORM_DRIVER ehci_ppc_soc_driver
#endif
+#ifdef CONFIG_ARCH_IXP4XX
+#include "ehci-ixp4xx.c"
+#define PLATFORM_DRIVER ixp4xx_ehci_driver
+#endif
+
#if !defined(PCI_DRIVER) && !defined(PLATFORM_DRIVER) && \
!defined(PS3_SYSTEM_BUS_DRIVER)
#error "missing bus glue for ehci-hcd"
Index: linux-2.6.24.7/drivers/usb/host/ehci-ixp4xx.c
===================================================================
--- /dev/null
+++ linux-2.6.24.7/drivers/usb/host/ehci-ixp4xx.c
@@ -0,0 +1,152 @@
+/*
+ * IXP4XX EHCI Host Controller Driver
+ *
+ * Author: Vladimir Barinov <vbarinov@ru.mvista.com>
+ *
+ * Based on "ehci-fsl.c" by Randy Vinson <rvinson@mvista.com>
+ *
+ * 2007 (c) MontaVista Software, Inc. This file is licensed under
+ * the terms of the GNU General Public License version 2. This program
+ * is licensed "as is" without any warranty of any kind, whether express
+ * or implied.
+ */
+
+#include <linux/platform_device.h>
+
+static int ixp4xx_ehci_init(struct usb_hcd *hcd)
+{
+ struct ehci_hcd *ehci = hcd_to_ehci(hcd);
+ int retval = 0;
+
+ ehci->big_endian_desc = 1;
+ ehci->big_endian_mmio = 1;
+
+ ehci->caps = hcd->regs + 0x100;
+ ehci->regs = hcd->regs + 0x100
+ + HC_LENGTH(ehci_readl(ehci, &ehci->caps->hc_capbase));
+ ehci->hcs_params = ehci_readl(ehci, &ehci->caps->hcs_params);
+
+ ehci->is_tdi_rh_tt = 1;
+ ehci_reset(ehci);
+
+ retval = ehci_init(hcd);
+ if (retval)
+ return retval;
+
+ ehci_port_power(ehci, 0);
+
+ return retval;
+}
+
+static const struct hc_driver ixp4xx_ehci_hc_driver = {
+ .description = hcd_name,
+ .product_desc = "IXP4XX EHCI Host Controller",
+ .hcd_priv_size = sizeof(struct ehci_hcd),
+ .irq = ehci_irq,
+ .flags = HCD_MEMORY | HCD_USB2,
+ .reset = ixp4xx_ehci_init,
+ .start = ehci_run,
+ .stop = ehci_stop,
+ .shutdown = ehci_shutdown,
+ .urb_enqueue = ehci_urb_enqueue,
+ .urb_dequeue = ehci_urb_dequeue,
+ .endpoint_disable = ehci_endpoint_disable,
+ .get_frame_number = ehci_get_frame,
+ .hub_status_data = ehci_hub_status_data,
+ .hub_control = ehci_hub_control,
+#if defined(CONFIG_PM)
+ .bus_suspend = ehci_bus_suspend,
+ .bus_resume = ehci_bus_resume,
+#endif
+};
+
+static int ixp4xx_ehci_probe(struct platform_device *pdev)
+{
+ struct usb_hcd *hcd;
+ const struct hc_driver *driver = &ixp4xx_ehci_hc_driver;
+ struct resource *res;
+ int irq;
+ int retval;
+
+ if (usb_disabled())
+ return -ENODEV;
+
+ res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
+ if (!res) {
+ dev_err(&pdev->dev,
+ "Found HC with no IRQ. Check %s setup!\n",
+ pdev->dev.bus_id);
+ return -ENODEV;
+ }
+ irq = res->start;
+
+ hcd = usb_create_hcd(driver, &pdev->dev, pdev->dev.bus_id);
+ if (!hcd) {
+ retval = -ENOMEM;
+ goto fail_create_hcd;
+ }
+
+ res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+ if (!res) {
+ dev_err(&pdev->dev,
+ "Found HC with no register addr. Check %s setup!\n",
+ pdev->dev.bus_id);
+ retval = -ENODEV;
+ goto fail_request_resource;
+ }
+ hcd->rsrc_start = res->start;
+ hcd->rsrc_len = res->end - res->start + 1;
+
+ if (!request_mem_region(hcd->rsrc_start, hcd->rsrc_len,
+ driver->description)) {
+ dev_dbg(&pdev->dev, "controller already in use\n");
+ retval = -EBUSY;
+ goto fail_request_resource;
+ }
+
+ hcd->regs = ioremap_nocache(hcd->rsrc_start, hcd->rsrc_len);
+ if (hcd->regs == NULL) {
+ dev_dbg(&pdev->dev, "error mapping memory\n");
+ retval = -EFAULT;
+ goto fail_ioremap;
+ }
+
+ retval = usb_add_hcd(hcd, irq, IRQF_SHARED);
+ if (retval)
+ goto fail_add_hcd;
+
+ return retval;
+
+fail_add_hcd:
+ iounmap(hcd->regs);
+fail_ioremap:
+ release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
+fail_request_resource:
+ usb_put_hcd(hcd);
+fail_create_hcd:
+ dev_err(&pdev->dev, "init %s fail, %d\n", pdev->dev.bus_id, retval);
+ return retval;
+}
+
+static int ixp4xx_ehci_remove(struct platform_device *pdev)
+{
+ struct usb_hcd *hcd = platform_get_drvdata(pdev);
+
+ usb_remove_hcd(hcd);
+ iounmap(hcd->regs);
+ release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
+ usb_put_hcd(hcd);
+
+ return 0;
+}
+
+MODULE_ALIAS("platform:ixp4xx-ehci");
+
+static struct platform_driver ixp4xx_ehci_driver = {
+ .probe = ixp4xx_ehci_probe,
+ .remove = ixp4xx_ehci_remove,
+ .driver = {
+ .name = "ixp4xx-ehci",
+// .bus = &platform_bus_type
+ },
+};
Index: linux-2.6.24.7/drivers/usb/host/Kconfig
===================================================================
--- linux-2.6.24.7.orig/drivers/usb/host/Kconfig
+++ linux-2.6.24.7/drivers/usb/host/Kconfig
@@ -69,12 +69,12 @@ config USB_EHCI_TT_NEWSCHED
config USB_EHCI_BIG_ENDIAN_MMIO
bool
- depends on USB_EHCI_HCD && (PPC_CELLEB || PPC_PS3 || 440EPX)
+ depends on USB_EHCI_HCD && (PPC_CELLEB || PPC_PS3 || 440EPX || ARCH_IXP4XX)
default y
config USB_EHCI_BIG_ENDIAN_DESC
bool
- depends on USB_EHCI_HCD && 440EPX
+ depends on USB_EHCI_HCD && (440EPX || ARCH_IXP4XX)
default y
config USB_EHCI_FSL
Index: linux-2.6.24.7/drivers/usb/Kconfig
===================================================================
--- linux-2.6.24.7.orig/drivers/usb/Kconfig
+++ linux-2.6.24.7/drivers/usb/Kconfig
@@ -49,6 +49,7 @@ config USB_ARCH_HAS_EHCI
boolean
default y if PPC_83xx
default y if SOC_AU1200
+ default y if ARCH_IXP4XX
default PCI
# ARM SA1111 chips have a non-PCI based "OHCI-compatible" USB host interface.

View File

@ -1,13 +0,0 @@
Index: linux-2.6.24.7/include/asm-arm/arch-ixp4xx/io.h
===================================================================
--- linux-2.6.24.7.orig/include/asm-arm/arch-ixp4xx/io.h
+++ linux-2.6.24.7/include/asm-arm/arch-ixp4xx/io.h
@@ -13,6 +13,8 @@
#ifndef __ASM_ARM_ARCH_IO_H
#define __ASM_ARM_ARCH_IO_H
+#include <linux/bitops.h>
+
#include <asm/hardware.h>
#define IO_SPACE_LIMIT 0xffff0000

View File

@ -1,551 +0,0 @@
This patch adds support for the D-Link DSM-G600 Rev A.
This is an ARM XScale IXP4xx system relatively similar to
the NSLU2 and NAS-100D already supported by mainline. An
important difference is Gigabit Ethernet support using
the Via Velocity chipset.
This patch is the combined work of Michael Westerhof and
Alessandro Zummo, with contributions from Michael-Luke
Jones. This version addresses review comments from rmk
and Deepak Saxena.
Signed-off-by: Michael-Luke Jones <mlj28@cam.ac.uk>
Signed-off-by: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Michael Westerhof <mwester@dls.net>
---
arch/arm/mach-ixp4xx/Kconfig | 9 +
arch/arm/mach-ixp4xx/Makefile | 2
arch/arm/mach-ixp4xx/dsmg600-pci.c | 74 +++++++++++++
arch/arm/mach-ixp4xx/dsmg600-power.c | 130 ++++++++++++++++++++++++
arch/arm/mach-ixp4xx/dsmg600-setup.c | 175 +++++++++++++++++++++++++++++++++
include/asm-arm/arch-ixp4xx/dsmg600.h | 57 ++++++++++
include/asm-arm/arch-ixp4xx/hardware.h | 1
include/asm-arm/arch-ixp4xx/irqs.h | 10 +
8 files changed, 458 insertions(+)
Index: linux-2.6.21.7/arch/arm/mach-ixp4xx/Kconfig
===================================================================
--- linux-2.6.21.7.orig/arch/arm/mach-ixp4xx/Kconfig
+++ linux-2.6.21.7/arch/arm/mach-ixp4xx/Kconfig
@@ -89,6 +89,15 @@ config MACH_NAS100D
NAS 100d device. For more information on this platform,
see http://www.nslu2-linux.org/wiki/NAS100d/HomePage
+config MACH_DSMG600
+ bool
+ prompt "D-Link DSM-G600 RevA"
+ select PCI
+ help
+ Say 'Y' here if you want your kernel to support D-Link's
+ DSM-G600 RevA device. For more information on this platform,
+ see http://www.nslu2-linux.org/wiki/DSMG600/HomePage
+
#
# Avila and IXDP share the same source for now. Will change in future
#
Index: linux-2.6.21.7/arch/arm/mach-ixp4xx/Makefile
===================================================================
--- linux-2.6.21.7.orig/arch/arm/mach-ixp4xx/Makefile
+++ linux-2.6.21.7/arch/arm/mach-ixp4xx/Makefile
@@ -12,6 +12,7 @@ obj-pci-$(CONFIG_ARCH_ADI_COYOTE) += coy
obj-pci-$(CONFIG_MACH_GTWX5715) += gtwx5715-pci.o
obj-pci-$(CONFIG_MACH_NSLU2) += nslu2-pci.o
obj-pci-$(CONFIG_MACH_NAS100D) += nas100d-pci.o
+obj-pci-$(CONFIG_MACH_DSMG600) += dsmg600-pci.o
obj-y += common.o
@@ -22,5 +23,6 @@ obj-$(CONFIG_ARCH_ADI_COYOTE) += coyote-
obj-$(CONFIG_MACH_GTWX5715) += gtwx5715-setup.o
obj-$(CONFIG_MACH_NSLU2) += nslu2-setup.o nslu2-power.o
obj-$(CONFIG_MACH_NAS100D) += nas100d-setup.o nas100d-power.o
+obj-$(CONFIG_MACH_DSMG600) += dsmg600-setup.o dsmg600-power.o
obj-$(CONFIG_PCI) += $(obj-pci-$(CONFIG_PCI)) common-pci.o
Index: linux-2.6.21.7/arch/arm/mach-ixp4xx/dsmg600-pci.c
===================================================================
--- /dev/null
+++ linux-2.6.21.7/arch/arm/mach-ixp4xx/dsmg600-pci.c
@@ -0,0 +1,74 @@
+/*
+ * DSM-G600 board-level PCI initialization
+ *
+ * Copyright (C) 2006 Tower Technologies
+ * Author: Alessandro Zummo <a.zummo@towertech.it>
+ *
+ * based on ixdp425-pci.c:
+ * Copyright (C) 2002 Intel Corporation.
+ * Copyright (C) 2003-2004 MontaVista Software, Inc.
+ *
+ * Maintainer: http://www.nslu2-linux.org/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ */
+
+#include <linux/pci.h>
+#include <linux/init.h>
+#include <linux/irq.h>
+
+#include <asm/mach/pci.h>
+#include <asm/mach-types.h>
+
+void __init dsmg600_pci_preinit(void)
+{
+ set_irq_type(IRQ_DSMG600_PCI_INTA, IRQT_LOW);
+ set_irq_type(IRQ_DSMG600_PCI_INTB, IRQT_LOW);
+ set_irq_type(IRQ_DSMG600_PCI_INTC, IRQT_LOW);
+ set_irq_type(IRQ_DSMG600_PCI_INTD, IRQT_LOW);
+ set_irq_type(IRQ_DSMG600_PCI_INTE, IRQT_LOW);
+ set_irq_type(IRQ_DSMG600_PCI_INTF, IRQT_LOW);
+
+ ixp4xx_pci_preinit();
+}
+
+static int __init dsmg600_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
+{
+ static int pci_irq_table[DSMG600_PCI_MAX_DEV][DSMG600_PCI_IRQ_LINES] =
+ {
+ { IRQ_DSMG600_PCI_INTE, -1, -1 },
+ { IRQ_DSMG600_PCI_INTA, -1, -1 },
+ { IRQ_DSMG600_PCI_INTB, IRQ_DSMG600_PCI_INTC, IRQ_DSMG600_PCI_INTD },
+ { IRQ_DSMG600_PCI_INTF, -1, -1 },
+ };
+
+ int irq = -1;
+
+ if (slot >= 1 && slot <= DSMG600_PCI_MAX_DEV &&
+ pin >= 1 && pin <= DSMG600_PCI_IRQ_LINES)
+ irq = pci_irq_table[slot-1][pin-1];
+
+ return irq;
+}
+
+struct hw_pci __initdata dsmg600_pci = {
+ .nr_controllers = 1,
+ .preinit = dsmg600_pci_preinit,
+ .swizzle = pci_std_swizzle,
+ .setup = ixp4xx_setup,
+ .scan = ixp4xx_scan_bus,
+ .map_irq = dsmg600_map_irq,
+};
+
+int __init dsmg600_pci_init(void)
+{
+ if (machine_is_dsmg600())
+ pci_common_init(&dsmg600_pci);
+
+ return 0;
+}
+
+subsys_initcall(dsmg600_pci_init);
Index: linux-2.6.21.7/arch/arm/mach-ixp4xx/dsmg600-power.c
===================================================================
--- /dev/null
+++ linux-2.6.21.7/arch/arm/mach-ixp4xx/dsmg600-power.c
@@ -0,0 +1,130 @@
+/*
+ * arch/arm/mach-ixp4xx/dsmg600-power.c
+ *
+ * DSM-G600 Power/Reset driver
+ * Author: Michael Westerhof <mwester@dls.net>
+ *
+ * Based on nslu2-power.c
+ * Copyright (C) 2005 Tower Technologies
+ * Author: Alessandro Zummo <a.zummo@towertech.it>
+ *
+ * which was based on nslu2-io.c
+ * Copyright (C) 2004 Karen Spearel
+ *
+ * Maintainers: http://www.nslu2-linux.org/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ */
+
+#include <linux/module.h>
+#include <linux/reboot.h>
+#include <linux/interrupt.h>
+#include <linux/irq.h>
+#include <linux/jiffies.h>
+#include <linux/timer.h>
+
+#include <asm/mach-types.h>
+
+extern void ctrl_alt_del(void);
+
+/* This is used to make sure the power-button pusher is serious. The button
+ * must be held until the value of this counter reaches zero.
+ */
+static volatile int power_button_countdown;
+
+/* Must hold the button down for at least this many counts to be processed */
+#define PBUTTON_HOLDDOWN_COUNT 4 /* 2 secs */
+
+static void dsmg600_power_handler(unsigned long data);
+static DEFINE_TIMER(dsmg600_power_timer, dsmg600_power_handler, 0, 0);
+
+static void dsmg600_power_handler(unsigned long data)
+{
+ /* This routine is called twice per second to check the
+ * state of the power button.
+ */
+
+ if (*IXP4XX_GPIO_GPINR & DSMG600_PB_BM) {
+
+ /* IO Pin is 1 (button pushed) */
+ if (power_button_countdown > 0) {
+ power_button_countdown--;
+ }
+
+ } else {
+
+ /* Done on button release, to allow for auto-power-on mods. */
+ if (power_button_countdown == 0) {
+ /* Signal init to do the ctrlaltdel action, this will bypass
+ * init if it hasn't started and do a kernel_restart.
+ */
+ ctrl_alt_del();
+
+ /* Change the state of the power LED to "blink" */
+ gpio_line_set(DSMG600_LED_PWR_GPIO, IXP4XX_GPIO_LOW);
+ } else {
+ power_button_countdown = PBUTTON_HOLDDOWN_COUNT;
+ }
+ }
+
+ mod_timer(&dsmg600_power_timer, jiffies + msecs_to_jiffies(500));
+}
+
+static irqreturn_t dsmg600_reset_handler(int irq, void *dev_id)
+{
+ /* This is the paper-clip reset, it shuts the machine down directly. */
+ machine_power_off();
+
+ return IRQ_HANDLED;
+}
+
+static int __init dsmg600_power_init(void)
+{
+ if (!(machine_is_dsmg600()))
+ return 0;
+
+ if (request_irq(DSMG600_RB_IRQ, &dsmg600_reset_handler,
+ IRQF_DISABLED | IRQF_TRIGGER_LOW, "DSM-G600 reset button",
+ NULL) < 0) {
+
+ printk(KERN_DEBUG "Reset Button IRQ %d not available\n",
+ DSMG600_RB_IRQ);
+
+ return -EIO;
+ }
+
+ /* The power button on the D-Link DSM-G600 is on GPIO 15, but
+ * it cannot handle interrupts on that GPIO line. So we'll
+ * have to poll it with a kernel timer.
+ */
+
+ /* Make sure that the power button GPIO is set up as an input */
+ gpio_line_config(DSMG600_PB_GPIO, IXP4XX_GPIO_IN);
+
+ /* Set the initial value for the power button IRQ handler */
+ power_button_countdown = PBUTTON_HOLDDOWN_COUNT;
+
+ mod_timer(&dsmg600_power_timer, jiffies + msecs_to_jiffies(500));
+
+ return 0;
+}
+
+static void __exit dsmg600_power_exit(void)
+{
+ if (!(machine_is_dsmg600()))
+ return;
+
+ del_timer_sync(&dsmg600_power_timer);
+
+ free_irq(DSMG600_RB_IRQ, NULL);
+}
+
+module_init(dsmg600_power_init);
+module_exit(dsmg600_power_exit);
+
+MODULE_AUTHOR("Michael Westerhof <mwester@dls.net>");
+MODULE_DESCRIPTION("DSM-G600 Power/Reset driver");
+MODULE_LICENSE("GPL");
Index: linux-2.6.21.7/arch/arm/mach-ixp4xx/dsmg600-setup.c
===================================================================
--- /dev/null
+++ linux-2.6.21.7/arch/arm/mach-ixp4xx/dsmg600-setup.c
@@ -0,0 +1,175 @@
+/*
+ * DSM-G600 board-setup
+ *
+ * Copyright (C) 2006 Tower Technologies
+ * Author: Alessandro Zummo <a.zummo@towertech.it>
+ *
+ * based ixdp425-setup.c:
+ * Copyright (C) 2003-2004 MontaVista Software, Inc.
+ *
+ * Author: Alessandro Zummo <a.zummo@towertech.it>
+ * Maintainers: http://www.nslu2-linux.org/
+ */
+
+#include <linux/kernel.h>
+#include <linux/serial.h>
+#include <linux/serial_8250.h>
+
+#include <asm/mach-types.h>
+#include <asm/mach/arch.h>
+#include <asm/mach/flash.h>
+
+static struct flash_platform_data dsmg600_flash_data = {
+ .map_name = "cfi_probe",
+ .width = 2,
+};
+
+static struct resource dsmg600_flash_resource = {
+ .flags = IORESOURCE_MEM,
+};
+
+static struct platform_device dsmg600_flash = {
+ .name = "IXP4XX-Flash",
+ .id = 0,
+ .dev.platform_data = &dsmg600_flash_data,
+ .num_resources = 1,
+ .resource = &dsmg600_flash_resource,
+};
+
+static struct ixp4xx_i2c_pins dsmg600_i2c_gpio_pins = {
+ .sda_pin = DSMG600_SDA_PIN,
+ .scl_pin = DSMG600_SCL_PIN,
+};
+
+static struct platform_device dsmg600_i2c_controller = {
+ .name = "IXP4XX-I2C",
+ .id = 0,
+ .dev.platform_data = &dsmg600_i2c_gpio_pins,
+};
+
+#ifdef CONFIG_LEDS_CLASS
+static struct resource dsmg600_led_resources[] = {
+ {
+ .name = "power",
+ .start = DSMG600_LED_PWR_GPIO,
+ .end = DSMG600_LED_PWR_GPIO,
+ .flags = IXP4XX_GPIO_HIGH,
+ },
+ {
+ .name = "wlan",
+ .start = DSMG600_LED_WLAN_GPIO,
+ .end = DSMG600_LED_WLAN_GPIO,
+ .flags = IXP4XX_GPIO_LOW,
+ },
+};
+
+static struct platform_device dsmg600_leds = {
+ .name = "IXP4XX-GPIO-LED",
+ .id = -1,
+ .num_resources = ARRAY_SIZE(dsmg600_led_resources),
+ .resource = dsmg600_led_resources,
+};
+#endif
+
+static struct resource dsmg600_uart_resources[] = {
+ {
+ .start = IXP4XX_UART1_BASE_PHYS,
+ .end = IXP4XX_UART1_BASE_PHYS + 0x0fff,
+ .flags = IORESOURCE_MEM,
+ },
+ {
+ .start = IXP4XX_UART2_BASE_PHYS,
+ .end = IXP4XX_UART2_BASE_PHYS + 0x0fff,
+ .flags = IORESOURCE_MEM,
+ }
+};
+
+static struct plat_serial8250_port dsmg600_uart_data[] = {
+ {
+ .mapbase = IXP4XX_UART1_BASE_PHYS,
+ .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET,
+ .irq = IRQ_IXP4XX_UART1,
+ .flags = UPF_BOOT_AUTOCONF,
+ .iotype = UPIO_MEM,
+ .regshift = 2,
+ .uartclk = IXP4XX_UART_XTAL,
+ },
+ {
+ .mapbase = IXP4XX_UART2_BASE_PHYS,
+ .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET,
+ .irq = IRQ_IXP4XX_UART2,
+ .flags = UPF_BOOT_AUTOCONF,
+ .iotype = UPIO_MEM,
+ .regshift = 2,
+ .uartclk = IXP4XX_UART_XTAL,
+ },
+ { }
+};
+
+static struct platform_device dsmg600_uart = {
+ .name = "serial8250",
+ .id = PLAT8250_DEV_PLATFORM,
+ .dev.platform_data = dsmg600_uart_data,
+ .num_resources = ARRAY_SIZE(dsmg600_uart_resources),
+ .resource = dsmg600_uart_resources,
+};
+
+static struct platform_device *dsmg600_devices[] __initdata = {
+ &dsmg600_i2c_controller,
+ &dsmg600_flash,
+};
+
+static void dsmg600_power_off(void)
+{
+ /* enable the pwr cntl gpio */
+ gpio_line_config(DSMG600_PO_GPIO, IXP4XX_GPIO_OUT);
+
+ /* poweroff */
+ gpio_line_set(DSMG600_PO_GPIO, IXP4XX_GPIO_HIGH);
+}
+
+static void __init dsmg600_init(void)
+{
+ ixp4xx_sys_init();
+
+ /* Make sure that GPIO14 and GPIO15 are not used as clocks */
+ *IXP4XX_GPIO_GPCLKR = 0;
+
+ dsmg600_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
+ dsmg600_flash_resource.end =
+ IXP4XX_EXP_BUS_BASE(0) + ixp4xx_exp_bus_size - 1;
+
+ pm_power_off = dsmg600_power_off;
+
+ /* The UART is required on the DSM-G600 (Redboot cannot use the
+ * NIC) -- do it here so that it does *not* get removed if
+ * platform_add_devices fails!
+ */
+ (void)platform_device_register(&dsmg600_uart);
+
+ platform_add_devices(dsmg600_devices, ARRAY_SIZE(dsmg600_devices));
+
+#ifdef CONFIG_LEDS_CLASS
+ /* We don't care whether or not this works. */
+ (void)platform_device_register(&dsmg600_leds);
+#endif
+}
+
+static void __init dsmg600_fixup(struct machine_desc *desc,
+ struct tag *tags, char **cmdline, struct meminfo *mi)
+{
+ /* The xtal on this machine is non-standard. */
+ ixp4xx_timer_freq = DSMG600_FREQ;
+}
+
+MACHINE_START(DSMG600, "D-Link DSM-G600 RevA")
+ /* Maintainer: www.nslu2-linux.org */
+ .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
+ .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xFFFC,
+ .boot_params = 0x00000100,
+ .fixup = dsmg600_fixup,
+ .map_io = ixp4xx_map_io,
+ .init_irq = ixp4xx_init_irq,
+ .timer = &ixp4xx_timer,
+ .init_machine = dsmg600_init,
+MACHINE_END
Index: linux-2.6.21.7/include/asm-arm/arch-ixp4xx/dsmg600.h
===================================================================
--- /dev/null
+++ linux-2.6.21.7/include/asm-arm/arch-ixp4xx/dsmg600.h
@@ -0,0 +1,57 @@
+/*
+ * DSM-G600 platform specific definitions
+ *
+ * Copyright (C) 2006 Tower Technologies
+ * Author: Alessandro Zummo <a.zummo@towertech.it>
+ *
+ * based on ixdp425.h:
+ * Copyright 2004 (C) MontaVista, Software, Inc.
+ *
+ * This file is licensed under the terms of the GNU General Public
+ * License version 2. This program is licensed "as is" without any
+ * warranty of any kind, whether express or implied.
+ */
+
+#ifndef __ASM_ARCH_HARDWARE_H__
+#error "Do not include this directly, instead #include <asm/hardware.h>"
+#endif
+
+#define DSMG600_SDA_PIN 5
+#define DSMG600_SCL_PIN 4
+
+/*
+ * DSMG600 PCI IRQs
+ */
+#define DSMG600_PCI_MAX_DEV 4
+#define DSMG600_PCI_IRQ_LINES 3
+
+
+/* PCI controller GPIO to IRQ pin mappings */
+#define DSMG600_PCI_INTA_PIN 11
+#define DSMG600_PCI_INTB_PIN 10
+#define DSMG600_PCI_INTC_PIN 9
+#define DSMG600_PCI_INTD_PIN 8
+#define DSMG600_PCI_INTE_PIN 7
+#define DSMG600_PCI_INTF_PIN 6
+
+/* DSM-G600 Timer Setting */
+#define DSMG600_FREQ 66000000
+
+/* Buttons */
+
+#define DSMG600_PB_GPIO 15 /* power button */
+#define DSMG600_PB_BM (1L << DSMG600_PB_GPIO)
+
+#define DSMG600_RB_GPIO 3 /* reset button */
+
+#define DSMG600_RB_IRQ IRQ_IXP4XX_GPIO3
+
+#define DSMG600_PO_GPIO 2 /* power off */
+
+/* LEDs */
+
+#define DSMG600_LED_PWR_GPIO 0
+#define DSMG600_LED_PWR_BM (1L << DSMG600_LED_PWR_GPIO)
+
+#define DSMG600_LED_WLAN_GPIO 14
+#define DSMG600_LED_WLAN_BM (1L << DSMG600_LED_WLAN_GPIO)
Index: linux-2.6.21.7/include/asm-arm/arch-ixp4xx/hardware.h
===================================================================
--- linux-2.6.21.7.orig/include/asm-arm/arch-ixp4xx/hardware.h
+++ linux-2.6.21.7/include/asm-arm/arch-ixp4xx/hardware.h
@@ -47,5 +47,6 @@ extern unsigned int processor_id;
#include "prpmc1100.h"
#include "nslu2.h"
#include "nas100d.h"
+#include "dsmg600.h"
#endif /* _ASM_ARCH_HARDWARE_H */
Index: linux-2.6.21.7/include/asm-arm/arch-ixp4xx/irqs.h
===================================================================
--- linux-2.6.21.7.orig/include/asm-arm/arch-ixp4xx/irqs.h
+++ linux-2.6.21.7/include/asm-arm/arch-ixp4xx/irqs.h
@@ -118,4 +118,14 @@
#define IRQ_NAS100D_PCI_INTD IRQ_IXP4XX_GPIO8
#define IRQ_NAS100D_PCI_INTE IRQ_IXP4XX_GPIO7
+/*
+ * D-Link DSM-G600 RevA board IRQs
+ */
+#define IRQ_DSMG600_PCI_INTA IRQ_IXP4XX_GPIO11
+#define IRQ_DSMG600_PCI_INTB IRQ_IXP4XX_GPIO10
+#define IRQ_DSMG600_PCI_INTC IRQ_IXP4XX_GPIO9
+#define IRQ_DSMG600_PCI_INTD IRQ_IXP4XX_GPIO8
+#define IRQ_DSMG600_PCI_INTE IRQ_IXP4XX_GPIO7
+#define IRQ_DSMG600_PCI_INTF IRQ_IXP4XX_GPIO6
+
#endif

View File

@ -1,131 +0,0 @@
This patch is required as the frequency fixup in nslu2_init does not
run sufficiently early in the boot sequence to take effect. In
addition the dsmg600 setup code behaviour has been improved such
that a 'fixup' routine is avoided.
Signed-off-by: Michael-Luke Jones <mlj28@cam.ac.uk>
Index: linux-2.6.21.7/arch/arm/mach-ixp4xx/nslu2-setup.c
===================================================================
--- linux-2.6.21.7.orig/arch/arm/mach-ixp4xx/nslu2-setup.c
+++ linux-2.6.21.7/arch/arm/mach-ixp4xx/nslu2-setup.c
@@ -22,6 +22,7 @@
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
#include <asm/mach/flash.h>
+#include <asm/mach/time.h>
static struct flash_platform_data nslu2_flash_data = {
.map_name = "cfi_probe",
@@ -157,10 +158,21 @@ static void nslu2_power_off(void)
gpio_line_set(NSLU2_PO_GPIO, IXP4XX_GPIO_HIGH);
}
-static void __init nslu2_init(void)
+static void __init nslu2_timer_init(void)
{
- ixp4xx_timer_freq = NSLU2_FREQ;
+ /* The xtal on this machine is non-standard. */
+ ixp4xx_timer_freq = NSLU2_FREQ;
+
+ /* Call standard timer_init function. */
+ ixp4xx_timer_init();
+}
+static struct sys_timer nslu2_timer = {
+ .init = nslu2_timer_init,
+};
+
+static void __init nslu2_init(void)
+{
ixp4xx_sys_init();
nslu2_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
@@ -185,6 +197,6 @@ MACHINE_START(NSLU2, "Linksys NSLU2")
.boot_params = 0x00000100,
.map_io = ixp4xx_map_io,
.init_irq = ixp4xx_init_irq,
- .timer = &ixp4xx_timer,
+ .timer = &nslu2_timer,
.init_machine = nslu2_init,
MACHINE_END
Index: linux-2.6.21.7/arch/arm/mach-ixp4xx/common.c
===================================================================
--- linux-2.6.21.7.orig/arch/arm/mach-ixp4xx/common.c
+++ linux-2.6.21.7/arch/arm/mach-ixp4xx/common.c
@@ -269,7 +269,7 @@ static struct irqaction ixp4xx_timer_irq
.handler = ixp4xx_timer_interrupt,
};
-static void __init ixp4xx_timer_init(void)
+void __init ixp4xx_timer_init(void)
{
/* Clear Pending Interrupt by writing '1' to it */
*IXP4XX_OSST = IXP4XX_OSST_TIMER_1_PEND;
Index: linux-2.6.21.7/include/asm-arm/arch-ixp4xx/platform.h
===================================================================
--- linux-2.6.21.7.orig/include/asm-arm/arch-ixp4xx/platform.h
+++ linux-2.6.21.7/include/asm-arm/arch-ixp4xx/platform.h
@@ -113,6 +113,7 @@ extern unsigned long ixp4xx_timer_freq;
extern void ixp4xx_map_io(void);
extern void ixp4xx_init_irq(void);
extern void ixp4xx_sys_init(void);
+extern void ixp4xx_timer_init(void);
extern struct sys_timer ixp4xx_timer;
extern void ixp4xx_pci_preinit(void);
struct pci_sys_data;
Index: linux-2.6.21.7/arch/arm/mach-ixp4xx/dsmg600-setup.c
===================================================================
--- linux-2.6.21.7.orig/arch/arm/mach-ixp4xx/dsmg600-setup.c
+++ linux-2.6.21.7/arch/arm/mach-ixp4xx/dsmg600-setup.c
@@ -18,6 +18,7 @@
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
#include <asm/mach/flash.h>
+#include <asm/mach/time.h>
static struct flash_platform_data dsmg600_flash_data = {
.map_name = "cfi_probe",
@@ -128,6 +129,19 @@ static void dsmg600_power_off(void)
gpio_line_set(DSMG600_PO_GPIO, IXP4XX_GPIO_HIGH);
}
+static void __init dsmg600_timer_init(void)
+{
+ /* The xtal on this machine is non-standard. */
+ ixp4xx_timer_freq = DSMG600_FREQ;
+
+ /* Call standard timer_init function. */
+ ixp4xx_timer_init();
+}
+
+static struct sys_timer dsmg600_timer = {
+ .init = dsmg600_timer_init,
+};
+
static void __init dsmg600_init(void)
{
ixp4xx_sys_init();
@@ -155,21 +169,13 @@ static void __init dsmg600_init(void)
#endif
}
-static void __init dsmg600_fixup(struct machine_desc *desc,
- struct tag *tags, char **cmdline, struct meminfo *mi)
-{
- /* The xtal on this machine is non-standard. */
- ixp4xx_timer_freq = DSMG600_FREQ;
-}
-
MACHINE_START(DSMG600, "D-Link DSM-G600 RevA")
/* Maintainer: www.nslu2-linux.org */
.phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
.io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xFFFC,
.boot_params = 0x00000100,
- .fixup = dsmg600_fixup,
.map_io = ixp4xx_map_io,
.init_irq = ixp4xx_init_irq,
- .timer = &ixp4xx_timer,
+ .timer = &dsmg600_timer,
.init_machine = dsmg600_init,
MACHINE_END

View File

@ -1,196 +0,0 @@
This trivial patch updates the nslu2 and nas-100d headers to
remove pointless GPIO defines, and updates nslu2-setup.c
accordingly. In addition minor style cleanups to some comments
are included.
Signed-off-by: Michael-Luke Jones <mlj28@cam.ac.uk>
Index: linux-2.6.21.7/arch/arm/mach-ixp4xx/nslu2-setup.c
===================================================================
--- linux-2.6.21.7.orig/arch/arm/mach-ixp4xx/nslu2-setup.c
+++ linux-2.6.21.7/arch/arm/mach-ixp4xx/nslu2-setup.c
@@ -50,26 +50,26 @@ static struct ixp4xx_i2c_pins nslu2_i2c_
static struct resource nslu2_led_resources[] = {
{
.name = "ready", /* green led */
- .start = NSLU2_LED_GRN,
- .end = NSLU2_LED_GRN,
+ .start = NSLU2_LED_GRN_GPIO,
+ .end = NSLU2_LED_GRN_GPIO,
.flags = IXP4XX_GPIO_HIGH,
},
{
.name = "status", /* red led */
- .start = NSLU2_LED_RED,
- .end = NSLU2_LED_RED,
+ .start = NSLU2_LED_RED_GPIO,
+ .end = NSLU2_LED_RED_GPIO,
.flags = IXP4XX_GPIO_HIGH,
},
{
.name = "disk-1",
- .start = NSLU2_LED_DISK1,
- .end = NSLU2_LED_DISK1,
+ .start = NSLU2_LED_DISK1_GPIO,
+ .end = NSLU2_LED_DISK1_GPIO,
.flags = IXP4XX_GPIO_LOW,
},
{
.name = "disk-2",
- .start = NSLU2_LED_DISK2,
- .end = NSLU2_LED_DISK2,
+ .start = NSLU2_LED_DISK2_GPIO,
+ .end = NSLU2_LED_DISK2_GPIO,
.flags = IXP4XX_GPIO_LOW,
},
};
@@ -181,7 +181,8 @@ static void __init nslu2_init(void)
pm_power_off = nslu2_power_off;
- /* This is only useful on a modified machine, but it is valuable
+ /*
+ * This is only useful on a modified machine, but it is valuable
* to have it first in order to see debug messages, and so that
* it does *not* get removed if platform_add_devices fails!
*/
Index: linux-2.6.21.7/include/asm-arm/arch-ixp4xx/nslu2.h
===================================================================
--- linux-2.6.21.7.orig/include/asm-arm/arch-ixp4xx/nslu2.h
+++ linux-2.6.21.7/include/asm-arm/arch-ixp4xx/nslu2.h
@@ -9,7 +9,7 @@
* based on ixdp425.h:
* Copyright 2004 (c) MontaVista, Software, Inc.
*
- * This file is licensed under the terms of the GNU General Public
+ * This file is licensed under the terms of the GNU General Public
* License version 2. This program is licensed "as is" without any
* warranty of any kind, whether express or implied.
*/
@@ -34,36 +34,14 @@
#define NSLU2_PCI_INTC_PIN 9
#define NSLU2_PCI_INTD_PIN 8
-
/* NSLU2 Timer */
#define NSLU2_FREQ 66000000
-#define NSLU2_CLOCK_TICK_RATE (((NSLU2_FREQ / HZ & ~IXP4XX_OST_RELOAD_MASK) + 1) * HZ)
-#define NSLU2_CLOCK_TICKS_PER_USEC ((NSLU2_CLOCK_TICK_RATE + USEC_PER_SEC/2) / USEC_PER_SEC)
-
-/* GPIO */
-
-#define NSLU2_GPIO0 0
-#define NSLU2_GPIO1 1
-#define NSLU2_GPIO2 2
-#define NSLU2_GPIO3 3
-#define NSLU2_GPIO4 4
-#define NSLU2_GPIO5 5
-#define NSLU2_GPIO6 6
-#define NSLU2_GPIO7 7
-#define NSLU2_GPIO8 8
-#define NSLU2_GPIO9 9
-#define NSLU2_GPIO10 10
-#define NSLU2_GPIO11 11
-#define NSLU2_GPIO12 12
-#define NSLU2_GPIO13 13
-#define NSLU2_GPIO14 14
-#define NSLU2_GPIO15 15
/* Buttons */
-#define NSLU2_PB_GPIO NSLU2_GPIO5
-#define NSLU2_PO_GPIO NSLU2_GPIO8 /* power off */
-#define NSLU2_RB_GPIO NSLU2_GPIO12
+#define NSLU2_PB_GPIO 5
+#define NSLU2_PO_GPIO 8 /* power off */
+#define NSLU2_RB_GPIO 12
#define NSLU2_PB_IRQ IRQ_IXP4XX_GPIO5
#define NSLU2_RB_IRQ IRQ_IXP4XX_GPIO12
@@ -79,16 +57,16 @@
/* LEDs */
-#define NSLU2_LED_RED NSLU2_GPIO0
-#define NSLU2_LED_GRN NSLU2_GPIO1
+#define NSLU2_LED_RED_GPIO 0
+#define NSLU2_LED_GRN_GPIO 1
-#define NSLU2_LED_RED_BM (1L << NSLU2_LED_RED)
-#define NSLU2_LED_GRN_BM (1L << NSLU2_LED_GRN)
+#define NSLU2_LED_RED_BM (1L << NSLU2_LED_RED_GPIO)
+#define NSLU2_LED_GRN_BM (1L << NSLU2_LED_GRN_GPIO)
-#define NSLU2_LED_DISK1 NSLU2_GPIO3
-#define NSLU2_LED_DISK2 NSLU2_GPIO2
+#define NSLU2_LED_DISK1_GPIO 3
+#define NSLU2_LED_DISK2_GPIO 2
-#define NSLU2_LED_DISK1_BM (1L << NSLU2_GPIO2)
-#define NSLU2_LED_DISK2_BM (1L << NSLU2_GPIO3)
+#define NSLU2_LED_DISK1_BM (1L << NSLU2_LED_DISK1_GPIO)
+#define NSLU2_LED_DISK2_BM (1L << NSLU2_LED_DISK2_GPIO)
Index: linux-2.6.21.7/include/asm-arm/arch-ixp4xx/nas100d.h
===================================================================
--- linux-2.6.21.7.orig/include/asm-arm/arch-ixp4xx/nas100d.h
+++ linux-2.6.21.7/include/asm-arm/arch-ixp4xx/nas100d.h
@@ -10,7 +10,7 @@
* based on ixdp425.h:
* Copyright 2004 (c) MontaVista, Software, Inc.
*
- * This file is licensed under the terms of the GNU General Public
+ * This file is licensed under the terms of the GNU General Public
* License version 2. This program is licensed "as is" without any
* warranty of any kind, whether express or implied.
*/
@@ -36,31 +36,11 @@
#define NAS100D_PCI_INTD_PIN 8
#define NAS100D_PCI_INTE_PIN 7
-/* GPIO */
-
-#define NAS100D_GPIO0 0
-#define NAS100D_GPIO1 1
-#define NAS100D_GPIO2 2
-#define NAS100D_GPIO3 3
-#define NAS100D_GPIO4 4
-#define NAS100D_GPIO5 5
-#define NAS100D_GPIO6 6
-#define NAS100D_GPIO7 7
-#define NAS100D_GPIO8 8
-#define NAS100D_GPIO9 9
-#define NAS100D_GPIO10 10
-#define NAS100D_GPIO11 11
-#define NAS100D_GPIO12 12
-#define NAS100D_GPIO13 13
-#define NAS100D_GPIO14 14
-#define NAS100D_GPIO15 15
-
-
/* Buttons */
-#define NAS100D_PB_GPIO NAS100D_GPIO14
-#define NAS100D_RB_GPIO NAS100D_GPIO4
-#define NAS100D_PO_GPIO NAS100D_GPIO12 /* power off */
+#define NAS100D_PB_GPIO 14
+#define NAS100D_RB_GPIO 4
+#define NAS100D_PO_GPIO 12 /* power off */
#define NAS100D_PB_IRQ IRQ_IXP4XX_GPIO14
#define NAS100D_RB_IRQ IRQ_IXP4XX_GPIO4
Index: linux-2.6.21.7/arch/arm/mach-ixp4xx/nas100d-setup.c
===================================================================
--- linux-2.6.21.7.orig/arch/arm/mach-ixp4xx/nas100d-setup.c
+++ linux-2.6.21.7/arch/arm/mach-ixp4xx/nas100d-setup.c
@@ -155,7 +155,8 @@ static void __init nas100d_init(void)
pm_power_off = nas100d_power_off;
- /* This is only useful on a modified machine, but it is valuable
+ /*
+ * This is only useful on a modified machine, but it is valuable
* to have it first in order to see debug messages, and so that
* it does *not* get removed if platform_add_devices fails!
*/

File diff suppressed because it is too large Load Diff

View File

@ -1,17 +0,0 @@
---
drivers/net/ixp4xx/mac_driver.c | 24 ++++++++++--------------
1 file changed, 10 insertions(+), 14 deletions(-)
Index: linux-2.6.21.7/drivers/net/ixp4xx/mac_driver.c
===================================================================
--- linux-2.6.21.7.orig/drivers/net/ixp4xx/mac_driver.c
+++ linux-2.6.21.7/drivers/net/ixp4xx/mac_driver.c
@@ -842,7 +842,7 @@ static void __exit finish_mac(void)
}
}
-module_init(init_mac);
+late_initcall(init_mac);
module_exit(finish_mac);
MODULE_LICENSE("GPL");

View File

@ -1,392 +0,0 @@
---
drivers/net/ixp4xx/Kconfig | 10 +
drivers/net/ixp4xx/Makefile | 1
drivers/net/ixp4xx/npe_ucode.c | 185 +++++++++++++++++++++++++++++++++
drivers/net/ixp4xx/ucode_dl.c | 43 ++++---
include/asm-arm/arch-ixp4xx/platform.h | 19 +++
include/linux/ixp_npe.h | 1
6 files changed, 239 insertions(+), 20 deletions(-)
Index: linux-2.6.21.7/drivers/net/ixp4xx/Kconfig
===================================================================
--- linux-2.6.21.7.orig/drivers/net/ixp4xx/Kconfig
+++ linux-2.6.21.7/drivers/net/ixp4xx/Kconfig
@@ -11,6 +11,7 @@ config IXP4XX_NPE
tristate "IXP4xx NPE support"
depends on ARCH_IXP4XX
depends on NET_ETHERNET
+ select CRC16
help
The IXP4XX NPE driver supports the 3 CPU co-processors called
"Network Processing Engines" (NPE). It adds support fo downloading
@@ -18,7 +19,7 @@ config IXP4XX_NPE
More about this at: Documentation/networking/ixp4xx/README.
You can either use this OR the Intel Access Library (IAL)
-config IXP4XX_FW_LOAD
+config IXP4XX_NPE_FW_LOAD
bool "Use Firmware hotplug for Microcode download"
depends on IXP4XX_NPE
select HOTPLUG
@@ -28,6 +29,13 @@ config IXP4XX_FW_LOAD
/usr/lib/hotplug/firmware/NPE-[ABC]
see Documentation/firmware_class/hotplug-script
+config IXP4XX_NPE_FW_MTD
+ bool "Load firmware from an mtd partition"
+ depends on IXP4XX_NPE && MTD_IXP4XX
+ help
+ With this option, the driver will search for
+ the firmware into an MTD partition.
+
config IXP4XX_MAC
tristate "IXP4xx MAC support"
depends on IXP4XX_NPE
Index: linux-2.6.21.7/drivers/net/ixp4xx/Makefile
===================================================================
--- linux-2.6.21.7.orig/drivers/net/ixp4xx/Makefile
+++ linux-2.6.21.7/drivers/net/ixp4xx/Makefile
@@ -1,5 +1,6 @@
obj-$(CONFIG_IXP4XX_QMGR) += ixp4xx_qmgr.o
obj-$(CONFIG_IXP4XX_NPE) += ixp4xx_npe.o
+obj-$(CONFIG_IXP4XX_NPE_FW_MTD) += npe_ucode.o
obj-$(CONFIG_IXP4XX_MAC) += ixp4xx_mac.o
obj-$(CONFIG_IXP4XX_CRYPTO) += ixp4xx_crypto.o
Index: linux-2.6.21.7/drivers/net/ixp4xx/npe_ucode.c
===================================================================
--- /dev/null
+++ linux-2.6.21.7/drivers/net/ixp4xx/npe_ucode.c
@@ -0,0 +1,185 @@
+/*
+ * Provide an NPE platform device for microcode handling
+ *
+ * Copyright (C) 2006 Christian Hohnstaedt <chohnstaedt@innominate.com>
+ *
+ * This file is released under the GPLv2
+ */
+
+#include <linux/kernel.h>
+#include <linux/platform_device.h>
+#include <linux/init.h>
+#include <linux/slab.h>
+#include <linux/firmware.h>
+#include <linux/mtd/mtd.h>
+
+#include <linux/ixp_npe.h>
+
+#define DL_MAGIC 0xfeedf00d
+#define DL_MAGIC_SWAP 0x0df0edfe
+
+#define IMG_SIZE(image) (((image)->size * sizeof(u32)) + \
+ sizeof(struct dl_image))
+
+#define IMG_REV_MAJOR(id) (((id) >> 8) & 0x0f)
+#define IMG_REV_MINOR(id) ((id) & 0x0f)
+#define IMG_FUNC(id) (((id) >> 16) & 0xff)
+#define IMG_NPE(id) (((id) >> 24) & 0x0f)
+#define IMG_IXP(id) (((id) >> 28) & 0x0f)
+
+static struct platform_driver ixp4xx_npe_ucode_driver;
+static unsigned char *partition_name = NULL;
+
+static void print_image_info(u32 id, u32 offset, u32 size)
+{
+ unsigned char idx;
+ const char *names[] = { "IXP425", "IXP465", "unknown" };
+
+ idx = IMG_IXP(id) < 2 ? IMG_IXP(id) : 2;
+
+ printk(KERN_INFO "npe: found at 0x%x, %s/NPE-%c func: %02x, rev: %x.%x, "
+ "size: %5d, id: %08x\n", offset, names[idx], IMG_NPE(id) + 'A',
+ IMG_FUNC(id), IMG_REV_MAJOR(id), IMG_REV_MINOR(id), size, id);
+}
+
+void npe_swap_image(struct dl_image *image)
+{
+ unsigned int i;
+
+ image->magic = swab32(image->magic);
+ image->id = swab32(image->id);
+ image->size = swab32(image->size);
+
+ for (i = 0; i < image->size; i++)
+ image->u.data[i] = swab32(image->u.data[i]);
+}
+
+static void npe_find_microcode(struct mtd_info *mtd)
+{
+ u32 buf;
+ u32 magic = htonl(DL_MAGIC);
+ u32 id, size;
+ size_t retlen;
+ int err;
+ unsigned int offset = 0;
+
+ printk("npe: searching for firmware...\n");
+
+ while (offset < mtd->size) {
+
+ err = mtd->read(mtd, offset, 4, &retlen, (u_char *) &buf);
+ offset += retlen;
+
+ if (buf != magic)
+ continue;
+
+ err = mtd->read(mtd, offset, 4, &retlen, (u_char *) &id);
+ offset += retlen;
+
+ if (id == magic)
+ break;
+
+ id = ntohl(id);
+
+ err = mtd->read(mtd, offset, 4, &retlen, (u_char *) &size);
+ offset += retlen;
+
+ size = (ntohl(size) * 4) + 12;
+
+ print_image_info(id, offset - 12, size);
+
+ if (size < 24000 && ( IMG_FUNC(id) == 0x01 || IMG_FUNC(id) == 0x00) || IMG_FUNC(id) == 0x05 ) { // XXX fix size/detection
+
+ struct dl_image *image = kmalloc(size, GFP_KERNEL);
+
+ /* we are going to load it, rewind offset */
+ offset -= 12;
+
+ if (image) {
+ err = mtd->read(mtd, offset, size, &retlen, (u_char *) image);
+
+ if (err == 0 && retlen == size) {
+ if (image->magic == DL_MAGIC_SWAP)
+ npe_swap_image(image);
+
+ store_npe_image(image, NULL);
+ } else {
+ printk(KERN_ERR "unable to read firmware\n");
+ }
+
+ kfree(image);
+ }
+
+ offset += size;
+ }
+ }
+}
+
+static void npe_flash_add(struct mtd_info *mtd)
+{
+ if (partition_name == NULL)
+ return;
+
+ if (strcmp(mtd->name, partition_name) == 0) {
+ npe_find_microcode(mtd);
+ }
+}
+
+static void npe_flash_remove(struct mtd_info *mtd) {
+}
+
+static struct mtd_notifier npe_flash_notifier = {
+ .add = npe_flash_add,
+ .remove = npe_flash_remove,
+};
+
+static int npe_ucode_probe(struct platform_device *pdev)
+{
+ struct npe_ucode_platform_data *data = pdev->dev.platform_data;
+
+ if (partition_name)
+ return -EEXIST;
+
+ if (data && data->mtd_partition) {
+ partition_name = data->mtd_partition;
+ return 0;
+ }
+
+ return -EINVAL;
+}
+
+static int npe_ucode_remove(struct platform_device *pdev)
+{
+ return 0;
+}
+
+static struct platform_driver ixp4xx_npe_ucode_driver = {
+ .driver = {
+ .name = "ixp4xx_npe_ucode",
+ .owner = THIS_MODULE,
+ },
+ .probe = npe_ucode_probe,
+ .remove = npe_ucode_remove,
+};
+
+static int __init npe_ucode_init(void)
+{
+ int ret;
+
+ ret = platform_driver_register(&ixp4xx_npe_ucode_driver);
+ register_mtd_user(&npe_flash_notifier);
+
+ return ret;
+}
+
+static void __exit npe_ucode_exit(void)
+{
+ unregister_mtd_user(&npe_flash_notifier);
+ platform_driver_unregister(&ixp4xx_npe_ucode_driver);
+}
+
+module_init(npe_ucode_init);
+module_exit(npe_ucode_exit);
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Alessandro Zummo <a.zummo@towertech.it>");
Index: linux-2.6.21.7/drivers/net/ixp4xx/ucode_dl.c
===================================================================
--- linux-2.6.21.7.orig/drivers/net/ixp4xx/ucode_dl.c
+++ linux-2.6.21.7/drivers/net/ixp4xx/ucode_dl.c
@@ -16,6 +16,7 @@
#include <linux/firmware.h>
#include <linux/dma-mapping.h>
#include <linux/byteorder/swab.h>
+#include <linux/crc16.h>
#include <asm/uaccess.h>
#include <asm/io.h>
@@ -26,6 +27,12 @@
#define DL_MAGIC 0xfeedf00d
#define DL_MAGIC_SWAP 0x0df0edfe
+#define IMG_REV_MAJOR(id) (((id) >> 8) & 0x0f)
+#define IMG_REV_MINOR(id) ((id) & 0x0f)
+#define IMG_FUNC(id) (((id) >> 16) & 0xff)
+#define IMG_NPE(id) (((id) >> 24) & 0x0f)
+#define IMG_IXP(id) (((id) >> 28) & 0x0f)
+
#define EOF_BLOCK 0xf
#define IMG_SIZE(image) (((image)->size * sizeof(u32)) + \
sizeof(struct dl_image))
@@ -38,21 +45,6 @@ enum blk_type {
data,
};
-struct dl_block {
- u32 type;
- u32 offset;
-};
-
-struct dl_image {
- u32 magic;
- u32 id;
- u32 size;
- union {
- u32 data[0];
- struct dl_block block[0];
- } u;
-};
-
struct dl_codeblock {
u32 npe_addr;
u32 size;
@@ -127,20 +119,33 @@ download_block(struct npe_info *npe, str
return 0;
}
-static int store_npe_image(struct dl_image *image, struct device *dev)
+int store_npe_image(struct dl_image *image, struct device *dev)
{
struct dl_block *blk;
struct dl_codeblock *cb;
struct npe_info *npe;
int ret=0;
+ u16 crc;
if (!dev) {
- dev = get_npe_by_id( (image->id >> 24) & 0xf);
+ dev = get_npe_by_id(IMG_NPE(image->id));
return_npe_dev(dev);
}
if (!dev)
return -ENODEV;
+ if (image->size > 24000) { // XXX fix max size
+ printk(KERN_ERR "npe: firmware too large\n");
+ return -EFBIG;
+ }
+
+ if (IMG_REV_MAJOR(image->id) != 2) {
+ printk(KERN_ERR "npe: only revision 2 is supported at this time\n");
+ return -EINVAL;
+ }
+
+ crc = crc16(0, (u8 *) image, IMG_SIZE(image));
+
npe = dev_get_drvdata(dev);
if (npe->loaded && (npe->usage > 0)) {
printk(KERN_INFO "Cowardly refusing to reload an Image "
@@ -267,8 +272,7 @@ static ssize_t ucode_write(struct file *
static void npe_firmware_probe(struct device *dev)
{
-#if (defined(CONFIG_FW_LOADER) || defined(CONFIG_FW_LOADER_MODULE)) \
- && defined(MODULE)
+#ifdef CONFIG_IXP4XX_NPE_FW_LOADER
const struct firmware *fw_entry;
struct npe_info *npe = dev_get_drvdata(dev);
struct dl_image *image;
@@ -477,3 +481,4 @@ MODULE_AUTHOR("Christian Hohnstaedt <cho
EXPORT_SYMBOL(get_npe_by_id);
EXPORT_SYMBOL(return_npe_dev);
+EXPORT_SYMBOL(store_npe_image);
Index: linux-2.6.21.7/include/asm-arm/arch-ixp4xx/platform.h
===================================================================
--- linux-2.6.21.7.orig/include/asm-arm/arch-ixp4xx/platform.h
+++ linux-2.6.21.7/include/asm-arm/arch-ixp4xx/platform.h
@@ -86,6 +86,21 @@ struct ixp4xx_i2c_pins {
unsigned long scl_pin;
};
+struct dl_block {
+ u32 type;
+ u32 offset;
+};
+
+struct dl_image {
+ u32 magic;
+ u32 id;
+ u32 size;
+ union {
+ u32 data[0];
+ struct dl_block block[0];
+ } u;
+};
+
struct npe_plat_data {
const char *name;
int data_size;
@@ -105,6 +120,10 @@ struct mac_plat_info {
};
+struct npe_ucode_platform_data {
+ unsigned char *mtd_partition;
+};
+
/*
* This structure provide a means for the board setup code
* to give information to th pata_ixp4xx driver. It is
Index: linux-2.6.21.7/include/linux/ixp_npe.h
===================================================================
--- linux-2.6.21.7.orig/include/linux/ixp_npe.h
+++ linux-2.6.21.7/include/linux/ixp_npe.h
@@ -99,6 +99,7 @@ extern void npe_reset(struct npe_info *n
extern struct device *get_npe_by_id(int id);
extern void return_npe_dev(struct device *dev);
+extern int store_npe_image(struct dl_image *image, struct device *dev);
/* NPE Messages */
extern int

View File

@ -1,74 +0,0 @@
Index: linux-2.6.21.7/drivers/net/ixp4xx/mac_driver.c
===================================================================
--- linux-2.6.21.7.orig/drivers/net/ixp4xx/mac_driver.c
+++ linux-2.6.21.7/drivers/net/ixp4xx/mac_driver.c
@@ -161,6 +161,16 @@ static int media_check(struct net_device
{
struct mac_info *mac = netdev_priv(dev);
+ if ( mac->mii.phy_id < 0 ) {
+ if ( init ) {
+ netif_carrier_on(mac->mii.dev);
+ mac->mii.full_duplex = 1;
+ update_duplex_mode(dev);
+ return 1;
+ }
+ return 0;
+ }
+
if (mii_check_media(&mac->mii, netif_msg_link(mac), init)) {
update_duplex_mode(dev);
return 1;
@@ -448,7 +458,12 @@ static int ixmac_ioctl(struct net_device
return -EINVAL;
if (!try_module_get(THIS_MODULE))
return -ENODEV;
- rc = generic_mii_ioctl(&mac->mii, if_mii(rq), cmd, &duplex_changed);
+ if ( mac->mii.phy_id < 0 ) {
+ duplex_changed = 0;
+ rc = -EOPNOTSUPP;
+ } else {
+ rc = generic_mii_ioctl(&mac->mii, if_mii(rq), cmd, &duplex_changed);
+ }
module_put(THIS_MODULE);
if (duplex_changed)
update_duplex_mode(dev);
@@ -478,6 +493,9 @@ static void ixmac_get_drvinfo(struct net
static int ixmac_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
{
struct mac_info *mac = netdev_priv(dev);
+ if ( mac->mii.phy_id < 0 ) {
+ return 0;
+ }
mii_ethtool_gset(&mac->mii, cmd);
return 0;
}
@@ -486,6 +504,9 @@ static int ixmac_set_settings(struct net
{
struct mac_info *mac = netdev_priv(dev);
int rc;
+ if ( mac->mii.phy_id < 0 ) {
+ return -EOPNOTSUPP;
+ }
rc = mii_ethtool_sset(&mac->mii, cmd);
return rc;
}
@@ -493,12 +514,18 @@ static int ixmac_set_settings(struct net
static int ixmac_nway_reset(struct net_device *dev)
{
struct mac_info *mac = netdev_priv(dev);
+ if ( mac->mii.phy_id < 0 ) {
+ return -EOPNOTSUPP;
+ }
return mii_nway_restart(&mac->mii);
}
static u32 ixmac_get_link(struct net_device *dev)
{
struct mac_info *mac = netdev_priv(dev);
+ if ( mac->mii.phy_id < 0 ) {
+ return 1;
+ }
return mii_link_ok(&mac->mii);
}

View File

@ -1,42 +0,0 @@
Index: linux-2.6.21.7/arch/arm/mach-ixp4xx/nslu2-setup.c
===================================================================
--- linux-2.6.21.7.orig/arch/arm/mach-ixp4xx/nslu2-setup.c
+++ linux-2.6.21.7/arch/arm/mach-ixp4xx/nslu2-setup.c
@@ -138,6 +138,29 @@ static struct platform_device nslu2_uart
.resource = nslu2_uart_resources,
};
+static struct resource res_mac0 = {
+ .start = IXP4XX_EthB_BASE_PHYS,
+ .end = IXP4XX_EthB_BASE_PHYS + 0x1ff,
+ .flags = IORESOURCE_MEM,
+};
+
+static struct mac_plat_info plat_mac0 = {
+ .npe_id = 1,
+ .phy_id = 1,
+ .eth_id = 0,
+ .rxq_id = 27,
+ .txq_id = 24,
+ .rxdoneq_id = 4,
+};
+
+static struct platform_device mac0 = {
+ .name = "ixp4xx_mac",
+ .id = 0,
+ .dev.platform_data = &plat_mac0,
+ .num_resources = 1,
+ .resource = &res_mac0,
+};
+
static struct platform_device *nslu2_devices[] __initdata = {
&nslu2_i2c_controller,
&nslu2_flash,
@@ -145,6 +168,7 @@ static struct platform_device *nslu2_dev
#ifdef CONFIG_LEDS_IXP4XX
&nslu2_leds,
#endif
+ &mac0
};
static void nslu2_power_off(void)

View File

@ -1,41 +0,0 @@
Index: linux-2.6.21.7/arch/arm/mach-ixp4xx/nas100d-setup.c
===================================================================
--- linux-2.6.21.7.orig/arch/arm/mach-ixp4xx/nas100d-setup.c
+++ linux-2.6.21.7/arch/arm/mach-ixp4xx/nas100d-setup.c
@@ -123,12 +123,36 @@ static struct platform_device nas100d_ua
.resource = nas100d_uart_resources,
};
+static struct resource res_mac0 = {
+ .start = IXP4XX_EthB_BASE_PHYS,
+ .end = IXP4XX_EthB_BASE_PHYS + 0x1ff,
+ .flags = IORESOURCE_MEM,
+};
+
+static struct mac_plat_info plat_mac0 = {
+ .npe_id = 1,
+ .phy_id = 0,
+ .eth_id = 0,
+ .rxq_id = 27,
+ .txq_id = 24,
+ .rxdoneq_id = 4,
+};
+
+static struct platform_device mac0 = {
+ .name = "ixp4xx_mac",
+ .id = 0,
+ .dev.platform_data = &plat_mac0,
+ .num_resources = 1,
+ .resource = &res_mac0,
+};
+
static struct platform_device *nas100d_devices[] __initdata = {
&nas100d_i2c_controller,
&nas100d_flash,
#ifdef CONFIG_LEDS_IXP4XX
&nas100d_leds,
#endif
+ &mac0
};
static void nas100d_power_off(void)

View File

@ -1,35 +0,0 @@
---
arch/arm/mach-ixp4xx/nslu2-setup.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
Index: linux-2.6.21.7/arch/arm/mach-ixp4xx/nslu2-setup.c
===================================================================
--- linux-2.6.21.7.orig/arch/arm/mach-ixp4xx/nslu2-setup.c
+++ linux-2.6.21.7/arch/arm/mach-ixp4xx/nslu2-setup.c
@@ -161,6 +161,16 @@ static struct platform_device mac0 = {
.resource = &res_mac0,
};
+struct npe_ucode_platform_data nslu2_npe_ucode_data = {
+ .mtd_partition = "FIS directory",
+};
+
+static struct platform_device nslu2_npe_ucode = {
+ .name = "ixp4xx_npe_ucode",
+ .id = 0,
+ .dev.platform_data = &nslu2_npe_ucode_data,
+};
+
static struct platform_device *nslu2_devices[] __initdata = {
&nslu2_i2c_controller,
&nslu2_flash,
@@ -168,7 +178,8 @@ static struct platform_device *nslu2_dev
#ifdef CONFIG_LEDS_IXP4XX
&nslu2_leds,
#endif
- &mac0
+ &mac0,
+ &nslu2_npe_ucode,
};
static void nslu2_power_off(void)

View File

@ -1,34 +0,0 @@
---
arch/arm/mach-ixp4xx/nas100d-setup.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
Index: linux-2.6.21.7/arch/arm/mach-ixp4xx/nas100d-setup.c
===================================================================
--- linux-2.6.21.7.orig/arch/arm/mach-ixp4xx/nas100d-setup.c
+++ linux-2.6.21.7/arch/arm/mach-ixp4xx/nas100d-setup.c
@@ -146,13 +146,24 @@ static struct platform_device mac0 = {
.resource = &res_mac0,
};
+struct npe_ucode_platform_data nas100d_npe_ucode_data = {
+ .mtd_partition = "microcode",
+};
+
+static struct platform_device nas100d_npe_ucode = {
+ .name = "ixp4xx_npe_ucode",
+ .id = 0,
+ .dev.platform_data = &nas100d_npe_ucode_data,
+};
+
static struct platform_device *nas100d_devices[] __initdata = {
&nas100d_i2c_controller,
&nas100d_flash,
#ifdef CONFIG_LEDS_IXP4XX
&nas100d_leds,
#endif
- &mac0
+ &mac0,
+ &nas100d_npe_ucode,
};
static void nas100d_power_off(void)

View File

@ -1,56 +0,0 @@
---
arch/arm/mach-ixp4xx/nas100d-setup.c | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
Index: linux-2.6.21.7/arch/arm/mach-ixp4xx/nas100d-setup.c
===================================================================
--- linux-2.6.21.7.orig/arch/arm/mach-ixp4xx/nas100d-setup.c
+++ linux-2.6.21.7/arch/arm/mach-ixp4xx/nas100d-setup.c
@@ -16,6 +16,7 @@
#include <linux/serial.h>
#include <linux/serial_8250.h>
#include <linux/leds.h>
+#include <linux/mtd/mtd.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
@@ -166,6 +167,30 @@ static struct platform_device *nas100d_d
&nas100d_npe_ucode,
};
+static void nas100d_flash_add(struct mtd_info *mtd)
+{
+ if (strcmp(mtd->name, "RedBoot config") == 0) {
+ size_t retlen;
+ u_char mac[6];
+
+ if (mtd->read(mtd, 0x0FD8, 6, &retlen, mac) == 0 && retlen == 6) {
+ printk(KERN_INFO "nas100d mac: %.2x:%.2x:%.2x:%.2x:%.2x:%.2x\n",
+ mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
+ memcpy(plat_mac0.hwaddr, mac, 6);
+ } else {
+ printk(KERN_ERR "nas100d mac: read failed\n");
+ }
+ }
+}
+
+static void nas100d_flash_remove(struct mtd_info *mtd) {
+}
+
+static struct mtd_notifier nas100d_flash_notifier = {
+ .add = nas100d_flash_add,
+ .remove = nas100d_flash_remove,
+};
+
static void nas100d_power_off(void)
{
/* This causes the box to drop the power and go dead. */
@@ -198,6 +223,8 @@ static void __init nas100d_init(void)
(void)platform_device_register(&nas100d_uart);
platform_add_devices(nas100d_devices, ARRAY_SIZE(nas100d_devices));
+
+ register_mtd_user(&nas100d_flash_notifier);
}
MACHINE_START(NAS100D, "Iomega NAS 100d")

View File

@ -1,56 +0,0 @@
---
arch/arm/mach-ixp4xx/nslu2-setup.c | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
Index: linux-2.6.21.7/arch/arm/mach-ixp4xx/nslu2-setup.c
===================================================================
--- linux-2.6.21.7.orig/arch/arm/mach-ixp4xx/nslu2-setup.c
+++ linux-2.6.21.7/arch/arm/mach-ixp4xx/nslu2-setup.c
@@ -18,6 +18,7 @@
#include <linux/serial.h>
#include <linux/serial_8250.h>
#include <linux/leds.h>
+#include <linux/mtd/mtd.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
@@ -182,6 +183,30 @@ static struct platform_device *nslu2_dev
&nslu2_npe_ucode,
};
+static void nslu2_flash_add(struct mtd_info *mtd)
+{
+ if (strcmp(mtd->name, "RedBoot") == 0) {
+ size_t retlen;
+ u_char mac[6];
+
+ if (mtd->read(mtd, 0x3FFB0, 6, &retlen, mac) == 0 && retlen == 6) {
+ printk(KERN_INFO "nslu2 mac: %.2x:%.2x:%.2x:%.2x:%.2x:%.2x\n",
+ mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
+ memcpy(plat_mac0.hwaddr, mac, 6);
+ } else {
+ printk(KERN_ERR "nslu2 mac: read failed\n");
+ }
+ }
+}
+
+static void nslu2_flash_remove(struct mtd_info *mtd) {
+}
+
+static struct mtd_notifier nslu2_flash_notifier = {
+ .add = nslu2_flash_add,
+ .remove = nslu2_flash_remove,
+};
+
static void nslu2_power_off(void)
{
/* This causes the box to drop the power and go dead. */
@@ -224,6 +249,8 @@ static void __init nslu2_init(void)
(void)platform_device_register(&nslu2_uart);
platform_add_devices(nslu2_devices, ARRAY_SIZE(nslu2_devices));
+
+ register_mtd_user(&nslu2_flash_notifier);
}
MACHINE_START(NSLU2, "Linksys NSLU2")

View File

@ -1,49 +0,0 @@
From: Alan Cox <alan@redhat.com>
To: Alessandro Zummo <alessandro.zummo@towertech.it>
Cc: Jeff Garzik <jgarzik@redhat.com>, Alan Cox <alan@redhat.com>
Subject: Re: drivers/ata/pata_artop.c
Date: Sun, 15 Oct 2006 14:25:16 -0400
User-Agent: Mutt/1.4.1i
On Sun, Oct 15, 2006 at 07:18:31PM +0200, Alessandro Zummo wrote:
> In the discovery phase there's a lot of time spent in the detection
> of the second port.
The error recovery is a bit determined right now - Tejun's been doing some
work on SRST behaviour and also for the worst cases polled detect so it
should come out ok
> What's the correct way to inform the driver
> to avoid checking the second port?
Set the number of ports to 1 in your own tree for now. The real fix is
not to go poking at pata ports if the ret is 0xFF
---
drivers/ata/pata_artop.c | 6 ++++++
1 file changed, 6 insertions(+)
Index: linux-2.6.21.7/drivers/ata/pata_artop.c
===================================================================
--- linux-2.6.21.7.orig/drivers/ata/pata_artop.c
+++ linux-2.6.21.7/drivers/ata/pata_artop.c
@@ -26,6 +26,7 @@
#include <scsi/scsi_host.h>
#include <linux/libata.h>
#include <linux/ata.h>
+#include <asm/mach-types.h>
#define DRV_NAME "pata_artop"
#define DRV_VERSION "0.4.2"
@@ -469,6 +470,11 @@ static int artop_init_one (struct pci_de
pci_read_config_byte(pdev, 0x4a, &reg);
pci_write_config_byte(pdev, 0x4a, (reg & ~0x01) | 0x80);
+ /* NAS100D workaround */
+#ifdef CONFIG_MACH_NAS100D
+ if (machine_is_nas100d())
+ ports = 1;
+#endif
}
BUG_ON(info == NULL);

View File

@ -1,927 +0,0 @@
Index: linux-2.6.21.7/drivers/net/via-velocity.c
===================================================================
--- linux-2.6.21.7.orig/drivers/net/via-velocity.c
+++ linux-2.6.21.7/drivers/net/via-velocity.c
@@ -96,11 +96,31 @@ MODULE_AUTHOR("VIA Networking Technologi
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("VIA Networking Velocity Family Gigabit Ethernet Adapter Driver");
+/* Valid values for vdebug (additive, this is a bitmask):
+ * 0x00 => off
+ * 0x01 => always on
+ * 0x02 => additional detail on tx (rx, too, if anyone implements same)
+ * 0x04 => detail the initialization process
+ * 0x08 => spot debug detail; to be used as developers see fit
+ */
+static int vdebug = 0;
+
+/* HAIL - these macros are for the normal 0x01-type tracing... */
+#define HAIL(S) \
+ if (vdebug&1) printk(KERN_NOTICE "%s\n", (S));
+#define HAILS(S,T) \
+ if (vdebug&1) printk(KERN_NOTICE "%s -> status=0x%x\n", (S), (T));
+
#define VELOCITY_PARAM(N,D) \
static int N[MAX_UNITS]=OPTION_DEFAULT;\
module_param_array(N, int, NULL, 0); \
MODULE_PARM_DESC(N, D);
+#define VELO_DEBUG_MIN 0
+#define VELO_DEBUG_MAX 255
+#define VELO_DEBUG_DEF 0
+VELOCITY_PARAM(velo_debug, "Debug level");
+
#define RX_DESC_MIN 64
#define RX_DESC_MAX 255
#define RX_DESC_DEF 64
@@ -385,12 +405,12 @@ static void __devinit velocity_set_int_o
if (val == -1)
*opt = def;
else if (val < min || val > max) {
- VELOCITY_PRT(MSG_LEVEL_INFO, KERN_NOTICE "%s: the value of parameter %s is invalid, the valid range is (%d-%d)\n",
- devname, name, min, max);
+ VELOCITY_PRT(MSG_LEVEL_INFO, KERN_NOTICE "via-velocity: the value of parameter %s is invalid, the valid range is (%d-%d)\n",
+ name, min, max);
*opt = def;
} else {
- VELOCITY_PRT(MSG_LEVEL_INFO, KERN_INFO "%s: set value of parameter %s to %d\n",
- devname, name, val);
+ VELOCITY_PRT(MSG_LEVEL_INFO, KERN_INFO "via-velocity: set value of parameter %s to %d\n",
+ name, val);
*opt = val;
}
}
@@ -415,12 +435,12 @@ static void __devinit velocity_set_bool_
if (val == -1)
*opt |= (def ? flag : 0);
else if (val < 0 || val > 1) {
- printk(KERN_NOTICE "%s: the value of parameter %s is invalid, the valid range is (0-1)\n",
- devname, name);
+ printk(KERN_NOTICE "via-velocity: the value of parameter %s is invalid, the valid range is (0-1)\n",
+ name);
*opt |= (def ? flag : 0);
} else {
- printk(KERN_INFO "%s: set parameter %s to %s\n",
- devname, name, val ? "TRUE" : "FALSE");
+ printk(KERN_INFO "via-velocity: set parameter %s to %s\n",
+ name, val ? "TRUE" : "FALSE");
*opt |= (val ? flag : 0);
}
}
@@ -438,6 +458,7 @@ static void __devinit velocity_set_bool_
static void __devinit velocity_get_options(struct velocity_opt *opts, int index, char *devname)
{
+ velocity_set_int_opt(&opts->velo_debug, velo_debug[index], VELO_DEBUG_MIN, VELO_DEBUG_MAX, VELO_DEBUG_DEF, "velo_debug", devname);
velocity_set_int_opt(&opts->rx_thresh, rx_thresh[index], RX_THRESH_MIN, RX_THRESH_MAX, RX_THRESH_DEF, "rx_thresh", devname);
velocity_set_int_opt(&opts->DMA_length, DMA_length[index], DMA_LENGTH_MIN, DMA_LENGTH_MAX, DMA_LENGTH_DEF, "DMA_length", devname);
velocity_set_int_opt(&opts->numrx, RxDescriptors[index], RX_DESC_MIN, RX_DESC_MAX, RX_DESC_DEF, "RxDescriptors", devname);
@@ -452,6 +473,7 @@ static void __devinit velocity_get_optio
velocity_set_int_opt((int *) &opts->wol_opts, wol_opts[index], WOL_OPT_MIN, WOL_OPT_MAX, WOL_OPT_DEF, "Wake On Lan options", devname);
velocity_set_int_opt((int *) &opts->int_works, int_works[index], INT_WORKS_MIN, INT_WORKS_MAX, INT_WORKS_DEF, "Interrupt service works", devname);
opts->numrx = (opts->numrx & ~3);
+ vdebug = opts->velo_debug;
}
/**
@@ -466,6 +488,8 @@ static void velocity_init_cam_filter(str
{
struct mac_regs __iomem * regs = vptr->mac_regs;
+ HAIL("velocity_init_cam_filter");
+
/* Turn on MCFG_PQEN, turn off MCFG_RTGOPT */
WORD_REG_BITS_SET(MCFG_PQEN, MCFG_RTGOPT, &regs->MCFG);
WORD_REG_BITS_ON(MCFG_VIDFR, &regs->MCFG);
@@ -484,14 +508,12 @@ static void velocity_init_cam_filter(str
WORD_REG_BITS_ON(MCFG_RTGOPT, &regs->MCFG);
mac_set_cam(regs, 0, (u8 *) & (vptr->options.vid), VELOCITY_VLAN_ID_CAM);
- vptr->vCAMmask[0] |= 1;
- mac_set_cam_mask(regs, vptr->vCAMmask, VELOCITY_VLAN_ID_CAM);
} else {
u16 temp = 0;
mac_set_cam(regs, 0, (u8 *) &temp, VELOCITY_VLAN_ID_CAM);
- temp = 1;
- mac_set_cam_mask(regs, (u8 *) &temp, VELOCITY_VLAN_ID_CAM);
}
+ vptr->vCAMmask[0] |= 1;
+ mac_set_cam_mask(regs, vptr->vCAMmask, VELOCITY_VLAN_ID_CAM);
}
/**
@@ -508,13 +530,15 @@ static void velocity_rx_reset(struct vel
struct mac_regs __iomem * regs = vptr->mac_regs;
int i;
+ HAIL("velocity_rx_reset");
vptr->rd_dirty = vptr->rd_filled = vptr->rd_curr = 0;
/*
* Init state, all RD entries belong to the NIC
*/
for (i = 0; i < vptr->options.numrx; ++i)
- vptr->rd_ring[i].rdesc0.owner = OWNED_BY_NIC;
+ /* vptr->rd_ring[i].rdesc0.owner = OWNED_BY_NIC; BE */
+ vptr->rd_ring[i].rdesc0 |= cpu_to_le32(BE_OWNED_BY_NIC); /* BE */
writew(vptr->options.numrx, &regs->RBRDU);
writel(vptr->rd_pool_dma, &regs->RDBaseLo);
@@ -537,12 +561,15 @@ static void velocity_init_registers(stru
struct mac_regs __iomem * regs = vptr->mac_regs;
int i, mii_status;
+ if (vdebug&5) printk(KERN_NOTICE "velocity_init_registers: entering\n");
+
mac_wol_reset(regs);
switch (type) {
case VELOCITY_INIT_RESET:
case VELOCITY_INIT_WOL:
+ if (vdebug&4) printk(KERN_NOTICE "velocity_init_registers: RESET or WOL\n");
netif_stop_queue(vptr->dev);
/*
@@ -570,12 +597,13 @@ static void velocity_init_registers(stru
case VELOCITY_INIT_COLD:
default:
+ if (vdebug&4) printk(KERN_NOTICE "velocity_init_registers: COLD or default\n");
/*
* Do reset
*/
velocity_soft_reset(vptr);
+ if (vdebug&4) printk(KERN_NOTICE "velocity_init_registers: soft reset complete.\n");
mdelay(5);
-
mac_eeprom_reload(regs);
for (i = 0; i < 6; i++) {
writeb(vptr->dev->dev_addr[i], &(regs->PAR[i]));
@@ -593,11 +621,16 @@ static void velocity_init_registers(stru
*/
BYTE_REG_BITS_SET(CFGB_OFSET, (CFGB_CRANDOM | CFGB_CAP | CFGB_MBA | CFGB_BAKOPT), &regs->CFGB);
+ if (vdebug&4) printk(KERN_NOTICE "velocity_init_registers: Initializing CAM filter\n");
/*
* Init CAM filter
*/
+ if (vdebug&8) printk(KERN_NOTICE "velocity: spot debug: about to init CAM filters\n");
+ mdelay(5); /* MJW - ARM processors, kernel 2.6.19 - this fixes oopses and hangs */
velocity_init_cam_filter(vptr);
+ if (vdebug&8) printk(KERN_NOTICE "velocity: spot debug: init CAM filters complete\n");
+ if (vdebug&4) printk(KERN_NOTICE "velocity_init_registers: Setting packet filter\n");
/*
* Set packet filter: Receive directed and broadcast address
*/
@@ -607,10 +640,12 @@ static void velocity_init_registers(stru
* Enable MII auto-polling
*/
enable_mii_autopoll(regs);
+ if (vdebug&4) printk(KERN_NOTICE "velocity_init_registers: enable_mii_autopoll complete.\n");
vptr->int_mask = INT_MASK_DEF;
- writel(cpu_to_le32(vptr->rd_pool_dma), &regs->RDBaseLo);
+ /* writel(cpu_to_le32(vptr->rd_pool_dma), &regs->RDBaseLo); BE */
+ writel((vptr->rd_pool_dma), &regs->RDBaseLo); /* BE */
writew(vptr->options.numrx - 1, &regs->RDCSize);
mac_rx_queue_run(regs);
mac_rx_queue_wake(regs);
@@ -618,10 +653,13 @@ static void velocity_init_registers(stru
writew(vptr->options.numtx - 1, &regs->TDCSize);
for (i = 0; i < vptr->num_txq; i++) {
- writel(cpu_to_le32(vptr->td_pool_dma[i]), &(regs->TDBaseLo[i]));
+ /* writel(cpu_to_le32(vptr->td_pool_dma[i]), &(regs->TDBaseLo[i])); BE */
+ writel((vptr->td_pool_dma[i]), &(regs->TDBaseLo[i])); /* BE */
mac_tx_queue_run(regs, i);
}
+ if (vdebug&4) printk(KERN_NOTICE "velocity_init_registers: DMA settings complete.\n");
+
init_flow_control_register(vptr);
writel(CR0_STOP, &regs->CR0Clr);
@@ -640,8 +678,10 @@ static void velocity_init_registers(stru
enable_flow_control_ability(vptr);
mac_hw_mibs_init(regs);
+ if (vdebug&4) printk(KERN_NOTICE "velocity_init_registers: Set interrupt mask\n");
mac_write_int_mask(vptr->int_mask, regs);
mac_clear_isr(regs);
+ if (vdebug&4) printk(KERN_NOTICE "velocity_init_registers: complete.\n");
}
}
@@ -659,6 +699,7 @@ static int velocity_soft_reset(struct ve
struct mac_regs __iomem * regs = vptr->mac_regs;
int i = 0;
+ HAIL("velocity_soft_reset");
writel(CR0_SFRST, &regs->CR0Set);
for (i = 0; i < W_MAX_TIMEOUT; i++) {
@@ -722,6 +763,7 @@ static int __devinit velocity_found1(str
VELOCITY_FULL_DRV_NAM, VELOCITY_VERSION);
printk(KERN_INFO "Copyright (c) 2002, 2003 VIA Networking Technologies, Inc.\n");
printk(KERN_INFO "Copyright (c) 2004 Red Hat Inc.\n");
+ printk(KERN_INFO "BE support, misc. fixes MJW 01Jan2007 - may be unstable\n");
first = 0;
}
@@ -935,6 +977,7 @@ static int velocity_init_rings(struct ve
dma_addr_t pool_dma;
u8 *pool;
+ HAIL("velocity_init_rings");
/*
* Allocate all RD/TD rings a single pool
*/
@@ -997,6 +1040,7 @@ static int velocity_init_rings(struct ve
static void velocity_free_rings(struct velocity_info *vptr)
{
int size;
+ HAIL("velocity_free_rings");
size = vptr->options.numrx * sizeof(struct rx_desc) +
vptr->options.numtx * sizeof(struct tx_desc) * vptr->num_txq;
@@ -1013,6 +1057,7 @@ static inline void velocity_give_many_rx
struct mac_regs __iomem *regs = vptr->mac_regs;
int avail, dirty, unusable;
+ HAIL("velocity_give_many_rx_descs");
/*
* RD number must be equal to 4X per hardware spec
* (programming guide rev 1.20, p.13)
@@ -1026,7 +1071,8 @@ static inline void velocity_give_many_rx
dirty = vptr->rd_dirty - unusable;
for (avail = vptr->rd_filled & 0xfffc; avail; avail--) {
dirty = (dirty > 0) ? dirty - 1 : vptr->options.numrx - 1;
- vptr->rd_ring[dirty].rdesc0.owner = OWNED_BY_NIC;
+ /* vptr->rd_ring[dirty].rdesc0.owner = OWNED_BY_NIC; BE */
+ vptr->rd_ring[dirty].rdesc0 |= cpu_to_le32(BE_OWNED_BY_NIC); /* BE */
}
writew(vptr->rd_filled & 0xfffc, &regs->RBRDU);
@@ -1036,12 +1082,14 @@ static inline void velocity_give_many_rx
static int velocity_rx_refill(struct velocity_info *vptr)
{
int dirty = vptr->rd_dirty, done = 0, ret = 0;
+ HAIL("velocity_rx_refill");
do {
struct rx_desc *rd = vptr->rd_ring + dirty;
/* Fine for an all zero Rx desc at init time as well */
- if (rd->rdesc0.owner == OWNED_BY_NIC)
+ /* if (rd->rdesc0.owner == OWNED_BY_NIC) BE */
+ if (rd->rdesc0 & cpu_to_le32(BE_OWNED_BY_NIC)) /* BE */
break;
if (!vptr->rd_info[dirty].skb) {
@@ -1076,6 +1124,7 @@ static int velocity_init_rd_ring(struct
unsigned int rsize = sizeof(struct velocity_rd_info) *
vptr->options.numrx;
+ HAIL("velocity_init_rd_ring");
vptr->rd_info = kmalloc(rsize, GFP_KERNEL);
if(vptr->rd_info == NULL)
goto out;
@@ -1105,6 +1154,7 @@ static void velocity_free_rd_ring(struct
{
int i;
+ HAIL("velocity_free_rd_ring");
if (vptr->rd_info == NULL)
return;
@@ -1146,6 +1196,7 @@ static int velocity_init_td_ring(struct
unsigned int tsize = sizeof(struct velocity_td_info) *
vptr->options.numtx;
+ HAIL("velocity_init_td_ring");
/* Init the TD ring entries */
for (j = 0; j < vptr->num_txq; j++) {
curr = vptr->td_pool_dma[j];
@@ -1182,6 +1233,7 @@ static void velocity_free_td_ring_entry(
struct velocity_td_info * td_info = &(vptr->td_infos[q][n]);
int i;
+ HAIL("velocity_free_td_ring_entry");
if (td_info == NULL)
return;
@@ -1211,6 +1263,7 @@ static void velocity_free_td_ring(struct
{
int i, j;
+ HAIL("velocity_free_td_ring");
for (j = 0; j < vptr->num_txq; j++) {
if (vptr->td_infos[j] == NULL)
continue;
@@ -1238,34 +1291,42 @@ static int velocity_rx_srv(struct veloci
struct net_device_stats *stats = &vptr->stats;
int rd_curr = vptr->rd_curr;
int works = 0;
+ u16 wRSR; /* BE */
+ HAILS("velocity_rx_srv", status);
do {
struct rx_desc *rd = vptr->rd_ring + rd_curr;
if (!vptr->rd_info[rd_curr].skb)
break;
- if (rd->rdesc0.owner == OWNED_BY_NIC)
+ /* if (rd->rdesc0.owner == OWNED_BY_NIC) BE */
+ if (rd->rdesc0 & cpu_to_le32(BE_OWNED_BY_NIC)) /* BE */
break;
rmb();
+ wRSR = (u16)(cpu_to_le32(rd->rdesc0)); /* BE */
/*
* Don't drop CE or RL error frame although RXOK is off
*/
- if ((rd->rdesc0.RSR & RSR_RXOK) || (!(rd->rdesc0.RSR & RSR_RXOK) && (rd->rdesc0.RSR & (RSR_CE | RSR_RL)))) {
+ /* if ((rd->rdesc0.RSR & RSR_RXOK) || (!(rd->rdesc0.RSR & RSR_RXOK) && (rd->rdesc0.RSR & (RSR_CE | RSR_RL)))) { BE */
+ if ((wRSR & RSR_RXOK) || (!(wRSR & RSR_RXOK) && (wRSR & (RSR_CE | RSR_RL)))) { /* BE */
if (velocity_receive_frame(vptr, rd_curr) < 0)
stats->rx_dropped++;
} else {
- if (rd->rdesc0.RSR & RSR_CRC)
+ /* if (rd->rdesc0.RSR & RSR_CRC) BE */
+ if (wRSR & RSR_CRC) /* BE */
stats->rx_crc_errors++;
- if (rd->rdesc0.RSR & RSR_FAE)
+ /* if (rd->rdesc0.RSR & RSR_FAE) BE */
+ if (wRSR & RSR_FAE) /* BE */
stats->rx_frame_errors++;
stats->rx_dropped++;
}
- rd->inten = 1;
+ /* rd->inten = 1; BE */
+ rd->ltwo |= cpu_to_le32(BE_INT_ENABLE); /* BE */
vptr->dev->last_rx = jiffies;
@@ -1296,13 +1357,21 @@ static int velocity_rx_srv(struct veloci
static inline void velocity_rx_csum(struct rx_desc *rd, struct sk_buff *skb)
{
+ u8 bCSM;
+ HAIL("velocity_rx_csum");
skb->ip_summed = CHECKSUM_NONE;
- if (rd->rdesc1.CSM & CSM_IPKT) {
- if (rd->rdesc1.CSM & CSM_IPOK) {
- if ((rd->rdesc1.CSM & CSM_TCPKT) ||
- (rd->rdesc1.CSM & CSM_UDPKT)) {
- if (!(rd->rdesc1.CSM & CSM_TUPOK)) {
+// if (rd->rdesc1.CSM & CSM_IPKT) {
+// if (rd->rdesc1.CSM & CSM_IPOK) {
+// if ((rd->rdesc1.CSM & CSM_TCPKT) ||
+// (rd->rdesc1.CSM & CSM_UDPKT)) {
+// if (!(rd->rdesc1.CSM & CSM_TUPOK)) {
+ bCSM = (u8)(cpu_to_le32(rd->rdesc1) >> 16); /* BE */
+ if (bCSM & CSM_IPKT) {
+ if (bCSM & CSM_IPOK) {
+ if ((bCSM & CSM_TCPKT) ||
+ (bCSM & CSM_UDPKT)) {
+ if (!(bCSM & CSM_TUPOK)) { /* BE */
return;
}
}
@@ -1328,9 +1397,11 @@ static inline int velocity_rx_copy(struc
{
int ret = -1;
+ HAIL("velocity_rx_copy");
if (pkt_size < rx_copybreak) {
struct sk_buff *new_skb;
+ HAIL("velocity_rx_copy (working...)");
new_skb = dev_alloc_skb(pkt_size + 2);
if (new_skb) {
new_skb->dev = vptr->dev;
@@ -1360,10 +1431,12 @@ static inline int velocity_rx_copy(struc
static inline void velocity_iph_realign(struct velocity_info *vptr,
struct sk_buff *skb, int pkt_size)
{
+ HAIL("velocity_iph_realign");
/* FIXME - memmove ? */
if (vptr->flags & VELOCITY_FLAGS_IP_ALIGN) {
int i;
+ HAIL("velocity_iph_realign (working...)");
for (i = pkt_size; i >= 0; i--)
*(skb->data + i + 2) = *(skb->data + i);
skb_reserve(skb, 2);
@@ -1382,19 +1455,27 @@ static inline void velocity_iph_realign(
static int velocity_receive_frame(struct velocity_info *vptr, int idx)
{
void (*pci_action)(struct pci_dev *, dma_addr_t, size_t, int);
+ u16 pkt_len; /* BE */
+ u16 wRSR; /* BE */
+ struct sk_buff *skb;
struct net_device_stats *stats = &vptr->stats;
struct velocity_rd_info *rd_info = &(vptr->rd_info[idx]);
struct rx_desc *rd = &(vptr->rd_ring[idx]);
- int pkt_len = rd->rdesc0.len;
- struct sk_buff *skb;
+ /* int pkt_len = rd->rdesc0.len BE */;
+
+ pkt_len = ((cpu_to_le32(rd->rdesc0) >> 16) & 0x00003FFFUL); /* BE */
+ wRSR = (u16)(cpu_to_le32(rd->rdesc0)); /* BE */
- if (rd->rdesc0.RSR & (RSR_STP | RSR_EDP)) {
+ HAIL("velocity_receive_frame");
+ /* if (rd->rdesc0.RSR & (RSR_STP | RSR_EDP)) { BE */
+ if (wRSR & (RSR_STP | RSR_EDP)) { /* BE */
VELOCITY_PRT(MSG_LEVEL_VERBOSE, KERN_ERR " %s : the received frame span multple RDs.\n", vptr->dev->name);
stats->rx_length_errors++;
return -EINVAL;
}
- if (rd->rdesc0.RSR & RSR_MAR)
+ /* if (rd->rdesc0.RSR & RSR_MAR) BE */
+ if (wRSR & RSR_MAR) /* BE */
vptr->stats.multicast++;
skb = rd_info->skb;
@@ -1408,7 +1489,8 @@ static int velocity_receive_frame(struct
*/
if (vptr->flags & VELOCITY_FLAGS_VAL_PKT_LEN) {
- if (rd->rdesc0.RSR & RSR_RL) {
+ /* if (rd->rdesc0.RSR & RSR_RL) { BE */
+ if (wRSR & RSR_RL) { /* BE */
stats->rx_length_errors++;
return -EINVAL;
}
@@ -1452,6 +1534,7 @@ static int velocity_alloc_rx_buf(struct
struct rx_desc *rd = &(vptr->rd_ring[idx]);
struct velocity_rd_info *rd_info = &(vptr->rd_info[idx]);
+ HAIL("velocity_alloc_rx_buf");
rd_info->skb = dev_alloc_skb(vptr->rx_buf_sz + 64);
if (rd_info->skb == NULL)
return -ENOMEM;
@@ -1469,10 +1552,14 @@ static int velocity_alloc_rx_buf(struct
*/
*((u32 *) & (rd->rdesc0)) = 0;
- rd->len = cpu_to_le32(vptr->rx_buf_sz);
- rd->inten = 1;
+ /* rd->len = cpu_to_le32(vptr->rx_buf_sz); BE */
+ /* rd->inten = 1; BE */
rd->pa_low = cpu_to_le32(rd_info->skb_dma);
- rd->pa_high = 0;
+ /* rd->pa_high = 0; BE */
+ rd->ltwo &= cpu_to_le32(0xC000FFFFUL); /* BE */
+ rd->ltwo |= cpu_to_le32((vptr->rx_buf_sz << 16)); /* BE */
+ rd->ltwo |= cpu_to_le32(BE_INT_ENABLE); /* BE */
+ rd->ltwo &= cpu_to_le32(0xFFFF0000UL); /* BE */
return 0;
}
@@ -1493,9 +1580,11 @@ static int velocity_tx_srv(struct veloci
int full = 0;
int idx;
int works = 0;
+ u16 wTSR; /* BE */
struct velocity_td_info *tdinfo;
struct net_device_stats *stats = &vptr->stats;
+ HAILS("velocity_tx_srv", status);
for (qnum = 0; qnum < vptr->num_txq; qnum++) {
for (idx = vptr->td_tail[qnum]; vptr->td_used[qnum] > 0;
idx = (idx + 1) % vptr->options.numtx) {
@@ -1506,22 +1595,29 @@ static int velocity_tx_srv(struct veloci
td = &(vptr->td_rings[qnum][idx]);
tdinfo = &(vptr->td_infos[qnum][idx]);
- if (td->tdesc0.owner == OWNED_BY_NIC)
+ /* if (td->tdesc0.owner == OWNED_BY_NIC) BE */
+ if (td->tdesc0 & cpu_to_le32(BE_OWNED_BY_NIC)) /* BE */
break;
if ((works++ > 15))
break;
- if (td->tdesc0.TSR & TSR0_TERR) {
+ wTSR = (u16)cpu_to_le32(td->tdesc0);
+ /* if (td->tdesc0.TSR & TSR0_TERR) { BE */
+ if (wTSR & TSR0_TERR) { /* BE */
stats->tx_errors++;
stats->tx_dropped++;
- if (td->tdesc0.TSR & TSR0_CDH)
+ /* if (td->tdesc0.TSR & TSR0_CDH) BE */
+ if (wTSR & TSR0_CDH) /* BE */
stats->tx_heartbeat_errors++;
- if (td->tdesc0.TSR & TSR0_CRS)
+ /* if (td->tdesc0.TSR & TSR0_CRS) BE */
+ if (wTSR & TSR0_CRS) /* BE */
stats->tx_carrier_errors++;
- if (td->tdesc0.TSR & TSR0_ABT)
+ /* if (td->tdesc0.TSR & TSR0_ABT) BE */
+ if (wTSR & TSR0_ABT) /* BE */
stats->tx_aborted_errors++;
- if (td->tdesc0.TSR & TSR0_OWC)
+ /* if (td->tdesc0.TSR & TSR0_OWC) BE */
+ if (wTSR & TSR0_OWC) /* BE */
stats->tx_window_errors++;
} else {
stats->tx_packets++;
@@ -1610,6 +1706,7 @@ static void velocity_print_link_status(s
static void velocity_error(struct velocity_info *vptr, int status)
{
+ HAILS("velocity_error", status);
if (status & ISR_TXSTLI) {
struct mac_regs __iomem * regs = vptr->mac_regs;
@@ -1699,6 +1796,7 @@ static void velocity_free_tx_buf(struct
struct sk_buff *skb = tdinfo->skb;
int i;
+ HAIL("velocity_free_tx_buf");
/*
* Don't unmap the pre-allocated tx_bufs
*/
@@ -1902,6 +2000,7 @@ static int velocity_xmit(struct sk_buff
struct velocity_td_info *tdinfo;
unsigned long flags;
int index;
+ u32 lbufsz; /* BE */
int pktlen = skb->len;
@@ -1918,9 +2017,18 @@ static int velocity_xmit(struct sk_buff
td_ptr = &(vptr->td_rings[qnum][index]);
tdinfo = &(vptr->td_infos[qnum][index]);
- td_ptr->tdesc1.TCPLS = TCPLS_NORMAL;
- td_ptr->tdesc1.TCR = TCR0_TIC;
- td_ptr->td_buf[0].queue = 0;
+ td_ptr->tdesc0 = 0x00000000UL; /* BE */
+ td_ptr->tdesc1 = 0x00000000UL; /* BE */
+
+ /* td_ptr->tdesc1.TCPLS = TCPLS_NORMAL; BE */
+ td_ptr->tdesc1 &= cpu_to_le32(0xfcffffffUL); /* BE */
+ td_ptr->tdesc1 |= cpu_to_le32(((u32)TCPLS_NORMAL) << 24); /* BE */
+
+ /* td_ptr->tdesc1.TCR = TCR0_TIC; BE */
+ td_ptr->tdesc1 |= cpu_to_le32(BE_TCR_TIC); /* BE */
+
+ /* td_ptr->td_buf[0].queue = 0; BE */
+ td_ptr->td_buf[0].ltwo &= cpu_to_le32(~BE_QUEUE_ENABLE); /* BE */
/*
* Pad short frames.
@@ -1932,20 +2040,35 @@ static int velocity_xmit(struct sk_buff
memset(tdinfo->buf + skb->len, 0, ETH_ZLEN - skb->len);
tdinfo->skb = skb;
tdinfo->skb_dma[0] = tdinfo->buf_dma;
- td_ptr->tdesc0.pktsize = pktlen;
+ /* td_ptr->tdesc0.pktsize = pktlen; */
+ td_ptr->tdesc0 &= cpu_to_le32(0xc000ffffUL); /* BE */
+ lbufsz = pktlen; /* Assign, and make sure it's unsigned 32 bits - BE */
+ lbufsz = lbufsz << 16; /* BE - shift over */
+ td_ptr->tdesc0 |= cpu_to_le32(lbufsz); /* BE */
td_ptr->td_buf[0].pa_low = cpu_to_le32(tdinfo->skb_dma[0]);
- td_ptr->td_buf[0].pa_high = 0;
- td_ptr->td_buf[0].bufsize = td_ptr->tdesc0.pktsize;
+ /* td_ptr->td_buf[0].pa_high = 0; */
+ /* td_ptr->td_buf[0].bufsize = td_ptr->tdesc0.pktsize; */
+ td_ptr->td_buf[0].ltwo = cpu_to_le32(lbufsz); /* BE */
tdinfo->nskb_dma = 1;
- td_ptr->tdesc1.CMDZ = 2;
+ /* td_ptr->tdesc1.CMDZ = 2; */
+ td_ptr->tdesc1 &= cpu_to_le32(0x0fffffffUL); /* BE */
+ td_ptr->tdesc1 |= cpu_to_le32(((u32)0x2) << 28); /* BE */
} else
#ifdef VELOCITY_ZERO_COPY_SUPPORT
+ /*
+ * BE - NOTE on the VELOCITY_ZERO_COPY_SUPPORT:
+ * This block of code has NOT been patched up for BE support, as
+ * it is certainly broken -- if it compiles at all. Since the BE
+ * fixes depend on the broken code, attempts to convert to BE support
+ * would almost certainly confuse more than help.
+ */
if (skb_shinfo(skb)->nr_frags > 0) {
int nfrags = skb_shinfo(skb)->nr_frags;
tdinfo->skb = skb;
if (nfrags > 6) {
memcpy(tdinfo->buf, skb->data, skb->len);
tdinfo->skb_dma[0] = tdinfo->buf_dma;
+ /* BE: Er, exactly what value are we assigning in this next line? */
td_ptr->tdesc0.pktsize =
td_ptr->td_buf[0].pa_low = cpu_to_le32(tdinfo->skb_dma[0]);
td_ptr->td_buf[0].pa_high = 0;
@@ -1962,6 +2085,7 @@ static int velocity_xmit(struct sk_buff
/* FIXME: support 48bit DMA later */
td_ptr->td_buf[i].pa_low = cpu_to_le32(tdinfo->skb_dma);
td_ptr->td_buf[i].pa_high = 0;
+ /* BE: This next line can't be right: */
td_ptr->td_buf[i].bufsize = skb->len->skb->data_len;
for (i = 0; i < nfrags; i++) {
@@ -1979,7 +2103,7 @@ static int velocity_xmit(struct sk_buff
}
} else
-#endif
+#endif /* (broken) VELOCITY_ZERO_COPY_SUPPORT */
{
/*
* Map the linear network buffer into PCI space and
@@ -1987,19 +2111,30 @@ static int velocity_xmit(struct sk_buff
*/
tdinfo->skb = skb;
tdinfo->skb_dma[0] = pci_map_single(vptr->pdev, skb->data, pktlen, PCI_DMA_TODEVICE);
- td_ptr->tdesc0.pktsize = pktlen;
+ /* td_ptr->tdesc0.pktsize = pktlen; BE */
+ td_ptr->tdesc0 &= cpu_to_le32(0xc000ffffUL); /* BE */
+ lbufsz = pktlen; /* Assign, and make sure it's unsigned 32 bits - BE */
+ lbufsz = lbufsz << 16; /* BE */
+ td_ptr->tdesc0 |= cpu_to_le32(lbufsz); /* BE */
td_ptr->td_buf[0].pa_low = cpu_to_le32(tdinfo->skb_dma[0]);
- td_ptr->td_buf[0].pa_high = 0;
- td_ptr->td_buf[0].bufsize = td_ptr->tdesc0.pktsize;
+ /* td_ptr->td_buf[0].pa_high = 0; BE */
+ /* td_ptr->td_buf[0].bufsize = td_ptr->tdesc0.pktsize; BE */
+ td_ptr->td_buf[0].ltwo = cpu_to_le32(lbufsz); /* BE */
+
tdinfo->nskb_dma = 1;
- td_ptr->tdesc1.CMDZ = 2;
+ /* td_ptr->tdesc1.CMDZ = 2; BE */
+ td_ptr->tdesc1 &= cpu_to_le32(0x0fffffffUL); /* BE */
+ td_ptr->tdesc1 |= cpu_to_le32(((u32)0x2) << 28);/* BE */
}
if (vptr->flags & VELOCITY_FLAGS_TAGGING) {
- td_ptr->tdesc1.pqinf.VID = (vptr->options.vid & 0xfff);
- td_ptr->tdesc1.pqinf.priority = 0;
- td_ptr->tdesc1.pqinf.CFI = 0;
- td_ptr->tdesc1.TCR |= TCR0_VETAG;
+ /* td_ptr->tdesc1.pqinf.priority = 0; BE */
+ /* td_ptr->tdesc1.pqinf.CFI = 0; BE */
+ td_ptr->tdesc1 &= cpu_to_le32(0xFFFF0000UL); /* BE */
+ /* td_ptr->tdesc1.pqinf.VID = (vptr->options.vid & 0xfff); BE */
+ td_ptr->tdesc1 |= cpu_to_le32((vptr->options.vid & 0xfff)); /* BE */
+ /* td_ptr->tdesc1.TCR |= TCR0_VETAG; BE */
+ td_ptr->tdesc1 |= cpu_to_le32(BE_TCR_VETAG); /* BE */
}
/*
@@ -2009,26 +2144,34 @@ static int velocity_xmit(struct sk_buff
&& (skb->ip_summed == CHECKSUM_PARTIAL)) {
struct iphdr *ip = skb->nh.iph;
if (ip->protocol == IPPROTO_TCP)
- td_ptr->tdesc1.TCR |= TCR0_TCPCK;
+ /* td_ptr->tdesc1.TCR |= TCR0_TCPCK; BE */
+ td_ptr->tdesc1 |= cpu_to_le32(BE_TCR_TCPCK); /* BE */
else if (ip->protocol == IPPROTO_UDP)
- td_ptr->tdesc1.TCR |= (TCR0_UDPCK);
- td_ptr->tdesc1.TCR |= TCR0_IPCK;
- }
+ /* td_ptr->tdesc1.TCR |= (TCR0_UDPCK); BE */
+ td_ptr->tdesc1 |= cpu_to_le32(BE_TCR_UDPCK); /* BE */
+ /* td_ptr->tdesc1.TCR |= TCR0_IPCK; BE */
+ td_ptr->tdesc1 |= cpu_to_le32(BE_TCR_IPCK); /* BE */
+ }
{
int prev = index - 1;
if (prev < 0)
prev = vptr->options.numtx - 1;
- td_ptr->tdesc0.owner = OWNED_BY_NIC;
+ /* td_ptr->tdesc0.owner = OWNED_BY_NIC; BE */
+ td_ptr->tdesc0 |= cpu_to_le32(BE_OWNED_BY_NIC); /* BE */
vptr->td_used[qnum]++;
vptr->td_curr[qnum] = (index + 1) % vptr->options.numtx;
if (AVAIL_TD(vptr, qnum) < 1)
netif_stop_queue(dev);
- td_ptr = &(vptr->td_rings[qnum][prev]);
- td_ptr->td_buf[0].queue = 1;
+ td_ptr = &(vptr->td_rings[qnum][prev]);
+ /* td_ptr->td_buf[0].queue = 1; BE */
+ td_ptr->td_buf[0].ltwo |= cpu_to_le32(BE_QUEUE_ENABLE); /* BE */
+ if (vdebug&2) printk(KERN_NOTICE "velocity_xmit: (%s) len=%d idx=%d tdesc0=0x%x tdesc1=0x%x ltwo=0x%x\n",
+ (pktlen<ETH_ZLEN) ? "short" : "normal", pktlen, index,
+ td_ptr->tdesc0, td_ptr->tdesc1, td_ptr->td_buf[0].ltwo);
mac_tx_queue_wake(vptr->mac_regs, qnum);
}
dev->trans_start = jiffies;
@@ -2054,7 +2197,7 @@ static int velocity_intr(int irq, void *
u32 isr_status;
int max_count = 0;
-
+ HAIL("velocity_intr");
spin_lock(&vptr->lock);
isr_status = mac_read_isr(vptr->mac_regs);
@@ -2073,7 +2216,10 @@ static int velocity_intr(int irq, void *
while (isr_status != 0) {
mac_write_isr(vptr->mac_regs, isr_status);
- if (isr_status & (~(ISR_PRXI | ISR_PPRXI | ISR_PTXI | ISR_PPTXI)))
+ HAILS("velocity_intr",isr_status);
+ /* MJW - velocity_error is ALWAYS called; need to mask off some other flags */
+ /* if (isr_status & (~(ISR_PRXI | ISR_PPRXI | ISR_PTXI | ISR_PPTXI))) */
+ if (isr_status & (~(ISR_PRXI | ISR_PPRXI | ISR_PTXI | ISR_PPTXI | ISR_PTX0I | ISR_ISR0)))
velocity_error(vptr, isr_status);
if (isr_status & (ISR_PRXI | ISR_PPRXI))
max_count += velocity_rx_srv(vptr, isr_status);
@@ -2111,6 +2257,7 @@ static void velocity_set_multi(struct ne
int i;
struct dev_mc_list *mclist;
+ HAIL("velocity_set_multi");
if (dev->flags & IFF_PROMISC) { /* Set promiscuous. */
writel(0xffffffff, &regs->MARCAM[0]);
writel(0xffffffff, &regs->MARCAM[4]);
@@ -2154,6 +2301,7 @@ static struct net_device_stats *velocity
{
struct velocity_info *vptr = netdev_priv(dev);
+ HAIL("net_device_stats");
/* If the hardware is down, don't touch MII */
if(!netif_running(dev))
return &vptr->stats;
@@ -2198,6 +2346,7 @@ static int velocity_ioctl(struct net_dev
struct velocity_info *vptr = netdev_priv(dev);
int ret;
+ HAIL("velocity_ioctl");
/* If we are asked for information and the device is power
saving then we need to bring the device back up to talk to it */
@@ -2416,6 +2565,7 @@ static int velocity_mii_read(struct mac_
{
u16 ww;
+ HAIL("velocity_mii_read");
/*
* Disable MIICR_MAUTO, so that mii addr can be set normally
*/
@@ -2452,6 +2602,7 @@ static int velocity_mii_write(struct mac
{
u16 ww;
+ HAIL("velocity_mii_write");
/*
* Disable MIICR_MAUTO, so that mii addr can be set normally
*/
Index: linux-2.6.21.7/drivers/net/via-velocity.h
===================================================================
--- linux-2.6.21.7.orig/drivers/net/via-velocity.h
+++ linux-2.6.21.7/drivers/net/via-velocity.h
@@ -196,64 +196,70 @@
* Receive descriptor
*/
-struct rdesc0 {
- u16 RSR; /* Receive status */
- u16 len:14; /* Received packet length */
- u16 reserved:1;
- u16 owner:1; /* Who owns this buffer ? */
-};
-
-struct rdesc1 {
- u16 PQTAG;
- u8 CSM;
- u8 IPKT;
-};
+//struct rdesc0 {
+// u16 RSR; /* Receive status */
+// u16 len:14; /* Received packet length */
+// u16 reserved:1;
+// u16 owner:1; /* Who owns this buffer ? */
+//};
+
+//struct rdesc1 {
+// u16 PQTAG;
+// u8 CSM;
+// u8 IPKT;
+//};
struct rx_desc {
- struct rdesc0 rdesc0;
- struct rdesc1 rdesc1;
+// struct rdesc0 rdesc0;
+// struct rdesc1 rdesc1;
+ u32 rdesc0;
+ u32 rdesc1;
u32 pa_low; /* Low 32 bit PCI address */
- u16 pa_high; /* Next 16 bit PCI address (48 total) */
- u16 len:15; /* Frame size */
- u16 inten:1; /* Enable interrupt */
+// u16 pa_high; /* Next 16 bit PCI address (48 total) */
+// u16 len:15; /* Frame size */
+// u16 inten:1; /* Enable interrupt */
+ u32 ltwo;
} __attribute__ ((__packed__));
/*
* Transmit descriptor
*/
-struct tdesc0 {
- u16 TSR; /* Transmit status register */
- u16 pktsize:14; /* Size of frame */
- u16 reserved:1;
- u16 owner:1; /* Who owns the buffer */
-};
-
-struct pqinf { /* Priority queue info */
- u16 VID:12;
- u16 CFI:1;
- u16 priority:3;
-} __attribute__ ((__packed__));
-
-struct tdesc1 {
- struct pqinf pqinf;
- u8 TCR;
- u8 TCPLS:2;
- u8 reserved:2;
- u8 CMDZ:4;
-} __attribute__ ((__packed__));
+//struct tdesc0 {
+// u16 TSR; /* Transmit status register */
+// u16 pktsize:14; /* Size of frame */
+// u16 reserved:1;
+// u16 owner:1; /* Who owns the buffer */
+//};
+
+//struct pqinf { /* Priority queue info */
+// u16 VID:12;
+// u16 CFI:1;
+// u16 priority:3;
+//} __attribute__ ((__packed__));
+
+//struct tdesc1 {
+// struct pqinf pqinf;
+// u8 TCR;
+// u8 TCPLS:2;
+// u8 reserved:2;
+// u8 CMDZ:4;
+//} __attribute__ ((__packed__));
struct td_buf {
u32 pa_low;
- u16 pa_high;
- u16 bufsize:14;
- u16 reserved:1;
- u16 queue:1;
+// u16 pa_high;
+// u16 bufsize:14;
+// u16 reserved:1;
+// u16 queue:1;
+ u32 ltwo;
} __attribute__ ((__packed__));
struct tx_desc {
- struct tdesc0 tdesc0;
- struct tdesc1 tdesc1;
+// struct tdesc0 tdesc0;
+// struct tdesc1 tdesc1;
+ u32 tdesc0;
+ u32 tdesc1;
struct td_buf td_buf[7];
};
@@ -279,6 +285,16 @@ enum velocity_owner {
OWNED_BY_NIC = 1
};
+/* Constants added for the BE fixes */
+#define BE_OWNED_BY_NIC 0x80000000UL
+#define BE_INT_ENABLE 0x80000000UL
+#define BE_QUEUE_ENABLE 0x80000000UL
+#define BE_TCR_TIC 0x00800000UL
+#define BE_TCR_VETAG 0x00200000UL
+#define BE_TCR_TCPCK 0x00040000UL
+#define BE_TCR_UDPCK 0x00080000UL
+#define BE_TCR_IPCK 0x00100000UL
+
/*
* MAC registers and macros.
@@ -1698,6 +1714,7 @@ enum velocity_flow_cntl_type {
};
struct velocity_opt {
+ int velo_debug; /* debug flag */
int numrx; /* Number of RX descriptors */
int numtx; /* Number of TX descriptors */
enum speed_opt spd_dpx; /* Media link mode */

View File

@ -1,54 +0,0 @@
Index: linux-2.6.21.7/arch/arm/mach-ixp4xx/nslu2-setup.c
===================================================================
--- linux-2.6.21.7.orig/arch/arm/mach-ixp4xx/nslu2-setup.c
+++ linux-2.6.21.7/arch/arm/mach-ixp4xx/nslu2-setup.c
@@ -20,6 +20,7 @@
#include <linux/leds.h>
#include <linux/mtd/mtd.h>
+#include <asm/setup.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
#include <asm/mach/flash.h>
@@ -253,11 +254,41 @@ static void __init nslu2_init(void)
register_mtd_user(&nslu2_flash_notifier);
}
+static char nslu2_rtc_probe[] __initdata = "rtc-x1205.probe=0,0x6f ";
+
+static void __init nslu2_fixup(struct machine_desc *desc,
+ struct tag *tags, char **cmdline, struct meminfo *mi)
+{
+ struct tag *t = tags;
+ char *p = *cmdline;
+
+ /* Find the end of the tags table, taking note of any cmdline tag. */
+ for (; t->hdr.size; t = tag_next(t)) {
+ if (t->hdr.tag == ATAG_CMDLINE) {
+ p = t->u.cmdline.cmdline;
+ }
+ }
+
+ /* Overwrite the end of the table with a new cmdline tag. */
+ t->hdr.tag = ATAG_CMDLINE;
+ t->hdr.size = (sizeof (struct tag_header) +
+ strlen(nslu2_rtc_probe) + strlen(p) + 1 + 4) >> 2;
+ strlcpy(t->u.cmdline.cmdline, nslu2_rtc_probe, COMMAND_LINE_SIZE);
+ strlcpy(t->u.cmdline.cmdline + strlen(nslu2_rtc_probe), p,
+ COMMAND_LINE_SIZE - strlen(nslu2_rtc_probe));
+
+ /* Terminate the table. */
+ t = tag_next(t);
+ t->hdr.tag = ATAG_NONE;
+ t->hdr.size = 0;
+}
+
MACHINE_START(NSLU2, "Linksys NSLU2")
/* Maintainer: www.nslu2-linux.org */
.phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
.io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xFFFC,
.boot_params = 0x00000100,
+ .fixup = nslu2_fixup,
.map_io = ixp4xx_map_io,
.init_irq = ixp4xx_init_irq,
.timer = &nslu2_timer,

View File

@ -1,55 +0,0 @@
Index: linux-2.6.21.7/arch/arm/mach-ixp4xx/nas100d-setup.c
===================================================================
--- linux-2.6.21.7.orig/arch/arm/mach-ixp4xx/nas100d-setup.c
+++ linux-2.6.21.7/arch/arm/mach-ixp4xx/nas100d-setup.c
@@ -18,6 +18,7 @@
#include <linux/leds.h>
#include <linux/mtd/mtd.h>
+#include <asm/setup.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
#include <asm/mach/flash.h>
@@ -227,11 +228,42 @@ static void __init nas100d_init(void)
register_mtd_user(&nas100d_flash_notifier);
}
+static char nas100d_rtc_probe[] __initdata = "rtc-pcf8563.probe=0,0x51 ";
+
+static void __init nas100d_fixup(struct machine_desc *desc,
+ struct tag *tags, char **cmdline, struct meminfo *mi)
+{
+ struct tag *t = tags;
+ char *p = *cmdline;
+
+ /* Find the end of the tags table, taking note of any cmdline tag. */
+ for (; t->hdr.size; t = tag_next(t)) {
+ if (t->hdr.tag == ATAG_CMDLINE) {
+ p = t->u.cmdline.cmdline;
+ }
+ }
+
+ /* Overwrite the end of the table with a new cmdline tag. */
+ t->hdr.tag = ATAG_CMDLINE;
+ t->hdr.size =
+ (sizeof (struct tag_header) +
+ strlen(nas100d_rtc_probe) + strlen(p) + 1 + 4) >> 2;
+ strlcpy(t->u.cmdline.cmdline, nas100d_rtc_probe, COMMAND_LINE_SIZE);
+ strlcpy(t->u.cmdline.cmdline + strlen(nas100d_rtc_probe), p,
+ COMMAND_LINE_SIZE - strlen(nas100d_rtc_probe));
+
+ /* Terminate the table. */
+ t = tag_next(t);
+ t->hdr.tag = ATAG_NONE;
+ t->hdr.size = 0;
+}
+
MACHINE_START(NAS100D, "Iomega NAS 100d")
/* Maintainer: www.nslu2-linux.org */
.phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
.io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xFFFC,
.boot_params = 0x00000100,
+ .fixup = nas100d_fixup,
.map_io = ixp4xx_map_io,
.init_irq = ixp4xx_init_irq,
.timer = &ixp4xx_timer,

Some files were not shown because too many files have changed in this diff Show More