aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ubicom32/files
diff options
context:
space:
mode:
authorImre Kaloz <kaloz@openwrt.org>2010-02-23 10:43:53 +0000
committerImre Kaloz <kaloz@openwrt.org>2010-02-23 10:43:53 +0000
commit8a3e589e74eecb13cc289a6c6410f2112b85011b (patch)
tree3eac3e565ec64f61d64b536e14d9a001e2d02405 /target/linux/ubicom32/files
parent38ccf4d8f308b4d9805a3c3dd6015df71b7473d0 (diff)
downloadmaster-187ad058-8a3e589e74eecb13cc289a6c6410f2112b85011b.tar.gz
master-187ad058-8a3e589e74eecb13cc289a6c6410f2112b85011b.tar.bz2
master-187ad058-8a3e589e74eecb13cc289a6c6410f2112b85011b.zip
[ubicom32]: add 2.6.32 support
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@19823 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/ubicom32/files')
-rw-r--r--target/linux/ubicom32/files/arch/ubicom32/include/asm/atomic.h5
-rw-r--r--target/linux/ubicom32/files/arch/ubicom32/include/asm/bitsperlong.h1
-rw-r--r--target/linux/ubicom32/files/arch/ubicom32/include/asm/page.h16
-rw-r--r--target/linux/ubicom32/files/arch/ubicom32/include/asm/pgtable.h4
-rw-r--r--target/linux/ubicom32/files/arch/ubicom32/include/asm/signal.h5
-rw-r--r--target/linux/ubicom32/files/arch/ubicom32/include/asm/socket.h3
-rw-r--r--target/linux/ubicom32/files/arch/ubicom32/kernel/init_task.c3
-rw-r--r--target/linux/ubicom32/files/arch/ubicom32/kernel/timer_device.c16
-rw-r--r--target/linux/ubicom32/files/drivers/net/ubi32-eth.c24
-rw-r--r--target/linux/ubicom32/files/drivers/serial/ubi32_mailbox.c10
10 files changed, 67 insertions, 20 deletions
diff --git a/target/linux/ubicom32/files/arch/ubicom32/include/asm/atomic.h b/target/linux/ubicom32/files/arch/ubicom32/include/asm/atomic.h
index 78d9fcd8f2..aaf7726020 100644
--- a/target/linux/ubicom32/files/arch/ubicom32/include/asm/atomic.h
+++ b/target/linux/ubicom32/files/arch/ubicom32/include/asm/atomic.h
@@ -236,7 +236,12 @@ static inline int atomic_add_unless(atomic_t *v, int a, int u)
#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)
+#include <linux/version.h>
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32)
+#include <asm-generic/atomic-long.h>
+#else
#include <asm-generic/atomic.h>
+#endif
/*
* The following is not a real function. The compiler should remove the function
diff --git a/target/linux/ubicom32/files/arch/ubicom32/include/asm/bitsperlong.h b/target/linux/ubicom32/files/arch/ubicom32/include/asm/bitsperlong.h
new file mode 100644
index 0000000000..6dc0bb0c13
--- /dev/null
+++ b/target/linux/ubicom32/files/arch/ubicom32/include/asm/bitsperlong.h
@@ -0,0 +1 @@
+#include <asm-generic/bitsperlong.h>
diff --git a/target/linux/ubicom32/files/arch/ubicom32/include/asm/page.h b/target/linux/ubicom32/files/arch/ubicom32/include/asm/page.h
index 89c6ce61c7..1ecb174a65 100644
--- a/target/linux/ubicom32/files/arch/ubicom32/include/asm/page.h
+++ b/target/linux/ubicom32/files/arch/ubicom32/include/asm/page.h
@@ -28,10 +28,12 @@
#ifndef _ASM_UBICOM32_PAGE_H
#define _ASM_UBICOM32_PAGE_H
+#include <linux/const.h>
+
/* PAGE_SHIFT determines the page size */
-#define PAGE_SHIFT 12
-#define PAGE_SIZE (1 << PAGE_SHIFT)
+#define PAGE_SHIFT (12)
+#define PAGE_SIZE (_AC(1,UL) << PAGE_SHIFT)
#define PAGE_MASK (~(PAGE_SIZE-1))
#include <asm/setup.h>
@@ -99,7 +101,15 @@ extern unsigned long memory_end;
#endif /* __ASSEMBLY__ */
-#ifdef __KERNEL__
+#define VM_DATA_DEFAULT_FLAGS \
+ (VM_READ | VM_WRITE | \
+ ((current->personality & READ_IMPLIES_EXEC) ? VM_EXEC : 0 ) | \
+ VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
+
+#include <linux/version.h>
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32)
+#include <asm-generic/getorder.h>
+#else
#include <asm-generic/page.h>
#endif
diff --git a/target/linux/ubicom32/files/arch/ubicom32/include/asm/pgtable.h b/target/linux/ubicom32/files/arch/ubicom32/include/asm/pgtable.h
index 70ad115ccf..ffb30a9ecf 100644
--- a/target/linux/ubicom32/files/arch/ubicom32/include/asm/pgtable.h
+++ b/target/linux/ubicom32/files/arch/ubicom32/include/asm/pgtable.h
@@ -114,11 +114,15 @@ extern inline void flush_pages_to_ram (unsigned long address, int n)
#define VMALLOC_START 0
#define VMALLOC_END 0xffffffff
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32)
+#include <asm-generic/pgtable.h>
+#else
#define arch_enter_lazy_mmu_mode() do {} while (0)
#define arch_leave_lazy_mmu_mode() do {} while (0)
#define arch_flush_lazy_mmu_mode() do {} while (0)
#define arch_enter_lazy_cpu_mode() do {} while (0)
#define arch_leave_lazy_cpu_mode() do {} while (0)
#define arch_flush_lazy_cpu_mode() do {} while (0)
+#endif
#endif /* _ASM_UBICOM32_PGTABLE_H */
diff --git a/target/linux/ubicom32/files/arch/ubicom32/include/asm/signal.h b/target/linux/ubicom32/files/arch/ubicom32/include/asm/signal.h
index a334e19ea3..946b3f77d6 100644
--- a/target/linux/ubicom32/files/arch/ubicom32/include/asm/signal.h
+++ b/target/linux/ubicom32/files/arch/ubicom32/include/asm/signal.h
@@ -124,7 +124,12 @@ typedef struct {
#define MINSIGSTKSZ 2048
#define SIGSTKSZ 8192
+#include <linux/version.h>
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32)
+#include <asm-generic/signal-defs.h>
+#else
#include <asm-generic/signal.h>
+#endif
#ifdef __KERNEL__
struct old_sigaction {
diff --git a/target/linux/ubicom32/files/arch/ubicom32/include/asm/socket.h b/target/linux/ubicom32/files/arch/ubicom32/include/asm/socket.h
index 2d95c24f78..24ac113140 100644
--- a/target/linux/ubicom32/files/arch/ubicom32/include/asm/socket.h
+++ b/target/linux/ubicom32/files/arch/ubicom32/include/asm/socket.h
@@ -84,4 +84,7 @@
#define SO_TIMESTAMPING 37
#define SCM_TIMESTAMPING SO_TIMESTAMPING
+#define SO_PROTOCOL 38
+#define SO_DOMAIN 39
+
#endif /* _ASM_UBICOM32_SOCKET_H */
diff --git a/target/linux/ubicom32/files/arch/ubicom32/kernel/init_task.c b/target/linux/ubicom32/files/arch/ubicom32/kernel/init_task.c
index ff0634424d..58baf52709 100644
--- a/target/linux/ubicom32/files/arch/ubicom32/kernel/init_task.c
+++ b/target/linux/ubicom32/files/arch/ubicom32/kernel/init_task.c
@@ -34,12 +34,15 @@
#include <linux/mqueue.h>
#include <linux/uaccess.h>
#include <asm/pgtable.h>
+#include <linux/version.h>
///static struct fs_struct init_fs = INIT_FS;
static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32)
struct mm_struct init_mm = INIT_MM(init_mm);
EXPORT_SYMBOL(init_mm);
+#endif
/*
* Initial task structure.
diff --git a/target/linux/ubicom32/files/arch/ubicom32/kernel/timer_device.c b/target/linux/ubicom32/files/arch/ubicom32/kernel/timer_device.c
index d2d094d37a..1943cbb9ee 100644
--- a/target/linux/ubicom32/files/arch/ubicom32/kernel/timer_device.c
+++ b/target/linux/ubicom32/files/arch/ubicom32/kernel/timer_device.c
@@ -169,7 +169,7 @@ static struct clocksource timer_device_clockbase = {
* timer_device_alloc_event()
* Allocate a timer device event.
*/
-static int timer_device_alloc_event(const char *name, int cpuid, const cpumask_t *mask)
+static int timer_device_alloc_event(const char *name, int cpuid, const struct cpumask *cpumask)
{
struct clock_event_device *dev;
struct irqaction *action;
@@ -208,10 +208,10 @@ static int timer_device_alloc_event(const char *name, int cpuid, const cpumask_t
action->name = name;
action->flags = IRQF_DISABLED | IRQF_TIMER;
action->handler = timer_device_event;
- cpumask_copy(&action->mask, mask);
+ //cpumask_copy(&action->mask, mask);
action->dev_id = dev;
setup_irq(dev->irq, action);
- irq_set_affinity(dev->irq, mask);
+ irq_set_affinity(dev->irq, cpumask);
ldsr_disable_vector(dev->irq);
/*
@@ -229,7 +229,7 @@ static int timer_device_alloc_event(const char *name, int cpuid, const cpumask_t
dev->mult = div_sc(frequency, NSEC_PER_SEC, dev->shift);
dev->max_delta_ns = clockevent_delta2ns(0xffffffff, dev);
dev->min_delta_ns = clockevent_delta2ns(100, dev);
- dev->cpumask = mask;
+ //dev->cpumask = mask;
printk(KERN_NOTICE "timer[%d]: %s - created\n", dev->irq, dev->name);
/*
@@ -246,7 +246,7 @@ static int timer_device_alloc_event(const char *name, int cpuid, const cpumask_t
*/
int __cpuinit local_timer_setup(unsigned int cpu)
{
- return timer_device_alloc_event("timer-cpu", cpu, cpumask_of(cpu));
+ return timer_device_alloc_event("timer-cpu", cpu);
}
#endif
@@ -283,19 +283,19 @@ void timer_device_init(void)
/*
* Always allocate a primary timer.
*/
- timer_device_alloc_event("timer-primary", -1, CPU_MASK_ALL_PTR);
+ timer_device_alloc_event("timer-primary", -1, cpu_all_mask);
#if defined(CONFIG_GENERIC_CLOCKEVENTS_BROADCAST)
/*
* If BROADCAST is selected we need to add a broadcast timer.
*/
- timer_device_alloc_event("timer-broadcast", -1, CPU_MASK_ALL_PTR);
+ timer_device_alloc_event("timer-broadcast", -1, cpu_all_mask);
#endif
/*
* Allocate extra timers that are requested.
*/
for (i = 0; i < CONFIG_TIMER_EXTRA_ALLOC; i++) {
- timer_device_alloc_event("timer-extra", -1, CPU_MASK_ALL_PTR);
+ timer_device_alloc_event("timer-extra", -1, cpu_all_mask);
}
}
diff --git a/target/linux/ubicom32/files/drivers/net/ubi32-eth.c b/target/linux/ubicom32/files/drivers/net/ubi32-eth.c
index e6c7392e06..e9c62f4625 100644
--- a/target/linux/ubicom32/files/drivers/net/ubi32-eth.c
+++ b/target/linux/ubicom32/files/drivers/net/ubi32-eth.c
@@ -634,6 +634,19 @@ void ubi32_eth_cleanup(void)
}
}
+ static const struct net_device_ops ubi32_netdev_ops = {
+ .ndo_open = ubi32_eth_open,
+ .ndo_stop = ubi32_eth_close,
+ .ndo_start_xmit = ubi32_eth_start_xmit,
+ .ndo_tx_timeout = ubi32_eth_tx_timeout,
+ .ndo_do_ioctl = ubi32_eth_ioctl,
+ .ndo_change_mtu = ubi32_eth_change_mtu,
+ .ndo_set_config = ubi32_eth_set_config,
+ .ndo_get_stats = ubi32_eth_get_stats,
+ .ndo_validate_addr = eth_validate_addr,
+ .ndo_set_mac_address = eth_mac_addr,
+ };
+
int ubi32_eth_init_module(void)
{
struct ethtionode *eth_node;
@@ -706,16 +719,9 @@ int ubi32_eth_init_module(void)
spin_lock_init(&priv->lock);
- dev->open = ubi32_eth_open;
- dev->stop = ubi32_eth_close;
- dev->hard_start_xmit = ubi32_eth_start_xmit;
- dev->tx_timeout = ubi32_eth_tx_timeout;
- dev->watchdog_timeo = UBI32_ETH_VP_TX_TIMEOUT;
+ dev->netdev_ops = &ubi32_netdev_ops;
- dev->set_config = ubi32_eth_set_config;
- dev->do_ioctl = ubi32_eth_ioctl;
- dev->get_stats = ubi32_eth_get_stats;
- dev->change_mtu = ubi32_eth_change_mtu;
+ dev->watchdog_timeo = UBI32_ETH_VP_TX_TIMEOUT;
#ifdef UBICOM32_USE_NAPI
netif_napi_add(dev, &priv->napi, ubi32_eth_napi_poll, UBI32_ETH_NAPI_WEIGHT);
#endif
diff --git a/target/linux/ubicom32/files/drivers/serial/ubi32_mailbox.c b/target/linux/ubicom32/files/drivers/serial/ubi32_mailbox.c
index fc0d6d21b6..f14fcdfd9a 100644
--- a/target/linux/ubicom32/files/drivers/serial/ubi32_mailbox.c
+++ b/target/linux/ubicom32/files/drivers/serial/ubi32_mailbox.c
@@ -34,6 +34,7 @@
#include <linux/tty.h>
#include <linux/tty_flip.h>
#include <linux/serial_core.h>
+#include <linux/version.h>
#include <asm/ip5000.h>
@@ -259,8 +260,13 @@ static void ubi32_mailbox_enable_ms(struct uart_port *port)
static void ubi32_mailbox_rx_chars(struct ubi32_mailbox_port *uart)
{
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32)
+ struct uart_state *state = uart->port.state;
+ struct tty_struct *tty = state->port.tty;
+#else
struct uart_info *info = uart->port.info;
struct tty_struct *tty = info->port.tty;
+#endif
unsigned int status, ch, flg;
status = 0; // XXX? UART_GET_LSR(uart);
@@ -308,7 +314,11 @@ static void ubi32_mailbox_rx_chars(struct ubi32_mailbox_port *uart)
static void ubi32_mailbox_tx_chars(struct ubi32_mailbox_port *uart)
{
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32)
+ struct circ_buf *xmit = &uart->port.state->xmit;
+#else
struct circ_buf *xmit = &uart->port.info->xmit;
+#endif
if (uart->port.x_char) {
UART_PUT_CHAR(uart, uart->port.x_char);