Commit d977939f authored by Len Brown's avatar Len Brown

Merge intel.com:/home/lenb/bk/26-latest-ref

into intel.com:/home/lenb/src/26-latest-dev
parents 2bac69cf cb281c89
...@@ -593,6 +593,12 @@ proc_types: ...@@ -593,6 +593,12 @@ proc_types:
b __armv4_cache_off b __armv4_cache_off
b __armv4_cache_flush b __armv4_cache_flush
.word 0x00070000 @ ARMv6
.word 0x000f0000
b __armv4_cache_on
b __armv4_cache_off
b __armv6_cache_flush
.word 0 @ unrecognised type .word 0 @ unrecognised type
.word 0 .word 0
mov pc, lr mov pc, lr
...@@ -652,6 +658,14 @@ cache_clean_flush: ...@@ -652,6 +658,14 @@ cache_clean_flush:
mov r3, #16 mov r3, #16
b call_cache_fn b call_cache_fn
__armv6_cache_flush:
mov r1, #0
mcr p15, 0, r1, c7, c14, 0 @ clean+invalidate D
mcr p15, 0, r1, c7, c5, 0 @ invalidate I+BTB
mcr p15, 0, r1, c7, c15, 0 @ clean+invalidate unified
mcr p15, 0, r1, c7, c10, 4 @ drain WB
mov pc, lr
__armv4_cache_flush: __armv4_cache_flush:
mov r2, #64*1024 @ default: 32K dcache size (*2) mov r2, #64*1024 @ default: 32K dcache size (*2)
mov r11, #32 @ default: 32 byte line size mov r11, #32 @ default: 32 byte line size
......
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
#include <linux/types.h> #include <linux/types.h>
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/completion.h>
#include <linux/reboot.h> #include <linux/reboot.h>
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/slab.h> #include <linux/slab.h>
...@@ -53,18 +54,14 @@ ...@@ -53,18 +54,14 @@
#define HAVE_EXPMASK #define HAVE_EXPMASK
#endif #endif
enum req {
req_readbytes,
req_reset
};
struct ecard_request { struct ecard_request {
enum req req; void (*fn)(struct ecard_request *);
ecard_t *ec; ecard_t *ec;
unsigned int address; unsigned int address;
unsigned int length; unsigned int length;
unsigned int use_loader; unsigned int use_loader;
void *buffer; void *buffer;
struct completion *complete;
}; };
struct expcard_blacklist { struct expcard_blacklist {
...@@ -129,15 +126,14 @@ slot_to_ecard(unsigned int slot) ...@@ -129,15 +126,14 @@ slot_to_ecard(unsigned int slot)
#define POD_INT_ADDR(x) ((volatile unsigned char *)\ #define POD_INT_ADDR(x) ((volatile unsigned char *)\
((BUS_ADDR((x)) - IO_BASE) + IO_START)) ((BUS_ADDR((x)) - IO_BASE) + IO_START))
static inline void ecard_task_reset(struct ecard_request *req) static void ecard_task_reset(struct ecard_request *req)
{ {
struct expansion_card *ec = req->ec; struct expansion_card *ec = req->ec;
if (ec->loader) if (ec->loader)
ecard_loader_reset(POD_INT_ADDR(ec->podaddr), ec->loader); ecard_loader_reset(POD_INT_ADDR(ec->podaddr), ec->loader);
} }
static void static void ecard_task_readbytes(struct ecard_request *req)
ecard_task_readbytes(struct ecard_request *req)
{ {
unsigned char *buf = (unsigned char *)req->buffer; unsigned char *buf = (unsigned char *)req->buffer;
volatile unsigned char *base_addr = volatile unsigned char *base_addr =
...@@ -206,26 +202,9 @@ ecard_task_readbytes(struct ecard_request *req) ...@@ -206,26 +202,9 @@ ecard_task_readbytes(struct ecard_request *req)
} }
static void ecard_do_request(struct ecard_request *req) static DECLARE_WAIT_QUEUE_HEAD(ecard_wait);
{
switch (req->req) {
case req_readbytes:
ecard_task_readbytes(req);
break;
case req_reset:
ecard_task_reset(req);
break;
}
}
#include <linux/completion.h>
static pid_t ecard_pid;
static wait_queue_head_t ecard_wait;
static struct ecard_request *ecard_req; static struct ecard_request *ecard_req;
static DECLARE_MUTEX(ecard_sem); static DECLARE_MUTEX(ecard_sem);
static DECLARE_COMPLETION(ecard_completion);
/* /*
* Set up the expansion card daemon's page tables. * Set up the expansion card daemon's page tables.
...@@ -299,9 +278,10 @@ ecard_task(void * unused) ...@@ -299,9 +278,10 @@ ecard_task(void * unused)
wait_event_interruptible(ecard_wait, ecard_req != NULL); wait_event_interruptible(ecard_wait, ecard_req != NULL);
req = xchg(&ecard_req, NULL); req = xchg(&ecard_req, NULL);
if (req != NULL) if (req != NULL) {
ecard_do_request(req); req->fn(req);
complete(&ecard_completion); complete(req->complete);
}
} }
} }
...@@ -311,17 +291,11 @@ ecard_task(void * unused) ...@@ -311,17 +291,11 @@ ecard_task(void * unused)
* FIXME: The test here is not sufficient to detect if the * FIXME: The test here is not sufficient to detect if the
* kcardd is running. * kcardd is running.
*/ */
static void static void ecard_call(struct ecard_request *req)
ecard_call(struct ecard_request *req)
{ {
/* DECLARE_COMPLETION(completion);
* Make sure we have a context that is able to sleep.
*/
if (current == &init_task || in_interrupt())
BUG();
if (ecard_pid <= 0) req->complete = &completion;
ecard_pid = kernel_thread(ecard_task, NULL, CLONE_KERNEL);
down(&ecard_sem); down(&ecard_sem);
ecard_req = req; ecard_req = req;
...@@ -330,7 +304,7 @@ ecard_call(struct ecard_request *req) ...@@ -330,7 +304,7 @@ ecard_call(struct ecard_request *req)
/* /*
* Now wait for kecardd to run. * Now wait for kecardd to run.
*/ */
wait_for_completion(&ecard_completion); wait_for_completion(&completion);
up(&ecard_sem); up(&ecard_sem);
} }
...@@ -341,7 +315,7 @@ ecard_readbytes(void *addr, ecard_t *ec, int off, int len, int useld) ...@@ -341,7 +315,7 @@ ecard_readbytes(void *addr, ecard_t *ec, int off, int len, int useld)
{ {
struct ecard_request req; struct ecard_request req;
req.req = req_readbytes; req.fn = ecard_task_readbytes;
req.ec = ec; req.ec = ec;
req.address = off; req.address = off;
req.length = len; req.length = len;
...@@ -1061,9 +1035,14 @@ ecard_probe(int slot, card_type_t type) ...@@ -1061,9 +1035,14 @@ ecard_probe(int slot, card_type_t type)
*/ */
static int __init ecard_init(void) static int __init ecard_init(void)
{ {
int slot, irqhw; int slot, irqhw, ret;
init_waitqueue_head(&ecard_wait); ret = kernel_thread(ecard_task, NULL, CLONE_KERNEL);
if (ret < 0) {
printk(KERN_ERR "Ecard: unable to create kernel thread: %d\n",
ret);
return ret;
}
printk("Probing expansion cards\n"); printk("Probing expansion cards\n");
...@@ -1146,7 +1125,7 @@ static void ecard_drv_shutdown(struct device *dev) ...@@ -1146,7 +1125,7 @@ static void ecard_drv_shutdown(struct device *dev)
if (drv->shutdown) if (drv->shutdown)
drv->shutdown(ec); drv->shutdown(ec);
ecard_release(ec); ecard_release(ec);
req.req = req_reset; req.fn = ecard_task_reset;
req.ec = ec; req.ec = ec;
ecard_call(&req); ecard_call(&req);
} }
......
...@@ -189,12 +189,10 @@ cpu_v6_name: ...@@ -189,12 +189,10 @@ cpu_v6_name:
* - cache type register is implemented * - cache type register is implemented
*/ */
__v6_setup: __v6_setup:
mrc p15, 0, r10, c0, c0, 1 @ read cache type register
tst r10, #1 << 24 @ Harvard cache?
mov r10, #0 mov r10, #0
mcrne p15, 0, r10, c7, c14, 0 @ clean+invalidate D cache mcr p15, 0, r10, c7, c14, 0 @ clean+invalidate D cache
mcrne p15, 0, r10, c7, c5, 0 @ invalidate I cache mcr p15, 0, r10, c7, c5, 0 @ invalidate I cache
mcreq p15, 0, r10, c7, c15, 0 @ clean+invalidate cache mcr p15, 0, r10, c7, c15, 0 @ clean+invalidate cache
mcr p15, 0, r10, c7, c10, 4 @ drain write buffer mcr p15, 0, r10, c7, c10, 4 @ drain write buffer
mcr p15, 0, r10, c8, c7, 0 @ invalidate I + D TLBs mcr p15, 0, r10, c8, c7, 0 @ invalidate I + D TLBs
mcr p15, 0, r10, c2, c0, 2 @ TTB control register mcr p15, 0, r10, c2, c0, 2 @ TTB control register
......
This diff is collapsed.
...@@ -28,9 +28,9 @@ typedef struct ray_dev_t { ...@@ -28,9 +28,9 @@ typedef struct ray_dev_t {
dev_node_t node; dev_node_t node;
window_handle_t amem_handle; /* handle to window for attribute memory */ window_handle_t amem_handle; /* handle to window for attribute memory */
window_handle_t rmem_handle; /* handle to window for rx buffer on card */ window_handle_t rmem_handle; /* handle to window for rx buffer on card */
UCHAR *sram; /* pointer to beginning of shared RAM */ void __iomem *sram; /* pointer to beginning of shared RAM */
UCHAR *amem; /* pointer to attribute mem window */ void __iomem *amem; /* pointer to attribute mem window */
UCHAR *rmem; /* pointer to receive buffer window */ void __iomem *rmem; /* pointer to receive buffer window */
dev_link_t *finder; /* pointer back to dev_link_t for card */ dev_link_t *finder; /* pointer back to dev_link_t for card */
struct timer_list timer; struct timer_list timer;
long tx_ccs_lock; long tx_ccs_lock;
......
...@@ -133,7 +133,7 @@ extern void __cpu_copy_user_page(void *to, const void *from, ...@@ -133,7 +133,7 @@ extern void __cpu_copy_user_page(void *to, const void *from,
} while (0) } while (0)
#define clear_page(page) memzero((void *)(page), PAGE_SIZE) #define clear_page(page) memzero((void *)(page), PAGE_SIZE)
extern void copy_page(void *to, void *from); extern void copy_page(void *to, const void *from);
#undef STRICT_MM_TYPECHECKS #undef STRICT_MM_TYPECHECKS
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment